Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
onetime
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karl Fogel
onetime
Commits
c90a25e4
Commit
c90a25e4
authored
8 years ago
by
Karl Fogel
Browse files
Options
Downloads
Patches
Plain Diff
Update two tests, as promised in commit
fd83f03c
parent
fd83f03c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
check.sh
+18
-17
18 additions, 17 deletions
check.sh
with
18 additions
and
17 deletions
check.sh
+
18
−
17
View file @
c90a25e4
...
...
@@ -1096,17 +1096,17 @@ start_new_test "tampering with message digest causes authentication error"
## Encrypt message
../../onetime
--config
=
blank-dot-onetime
-e
-p
../test-pad-1
\
-o
tmp-ciphertext-a-1 < ../test-plaintext-a 2>err.out
# In the base64-encoded ciphertext file, position 8
67
is '
v
' (11
8
).
../zap tmp-ciphertext-a-1 8
67 118 98
# tweaking to '
b' just for kicks
# In the base64-encoded ciphertext file, position 8
22
is '
y
' (1
2
1).
../zap tmp-ciphertext-a-1 8
22 121 122
# tweaking to '
z'
../../onetime
--config
=
blank-dot-onetime
-d
-p
../test-pad-1
\
-o
tmp-plaintext-a-1 < tmp-ciphertext-a-1 2>err.out
if
!
grep
-q
"DigestMismatch:
message
digest mismatch:"
err.out||
\
!
grep
-q
" computed:
a8a2f6ebe286697c527eb35a58b5539532e9b3ae3b64d4eb0a46fb657b41562c
"
err.out
||
\
!
grep
-q
" received:
a8a2f6ebe286697c527eb35a5bf5539532e9b3ae3b64d4eb0a46fb657b41562c
"
err.out
#
t
he
y differ here, in case you're curious
---> ^
^
if
!
grep
-q
"DigestMismatch: digest mismatch:"
err.out||
\
!
grep
-q
" computed:
30c7cd65d97fc08519c5f87b3b44fa5c099840372e6caeddf3a6e225015fcc6f
"
err.out
||
\
!
grep
-q
" received:
30c7cd65d97fc08519c5f87f3b44fa5c099840372e6caeddf3a6e225015fcc6f
"
err.out
# he
re is where they differ -------------
---> ^
then
echo
""
echo
"ERROR: did not see expected DigestMismatch
message digest error
"
echo
"ERROR: did not see expected DigestMismatch
error (30c7cd...)
"
cat
err.out
PASSED
=
"no"
fi
...
...
@@ -1114,29 +1114,29 @@ fi
if
!
cmp ../test-plaintext-a tmp-plaintext-a-1
then
echo
""
echo
"ERROR: decryption failed when
message
digest tampered with"
echo
"ERROR: decryption failed when digest tampered with"
cat
tmp-plaintext-a-1
echo
""
PASSED
=
"no"
fi
check_result
########################################################################
start_new_test
"tampering with head fuzz
digest
causes authentication error"
start_new_test
"tampering with head fuzz causes authentication error"
## Encrypt message
../../onetime
--config
=
blank-dot-onetime
-e
-p
../test-pad-1
\
-o
tmp-ciphertext-a-1 < ../test-plaintext-a 2>err.out
# In the base64-encoded ciphertext file, position
839
is '
a
' (
9
7).
../zap tmp-ciphertext-a-1
839 97 98
# In the base64-encoded ciphertext file, position
215
is '
L
' (7
6
).
../zap tmp-ciphertext-a-1
215 76 77
../../onetime
--config
=
blank-dot-onetime
-d
-p
../test-pad-1
\
-o
tmp-plaintext-a-1 < tmp-ciphertext-a-1 2>err.out
if
!
grep
-q
"DigestMismatch: head fuzz digest mismatch:"
err.out||
\
!
grep
-q
" computed: 729d6052c00f1a58708776259540513feabd02923988c4ab5567c474da024ab2"
err.out
||
\
!
grep
-q
" received: 729d6052c00f1a58708776259540513feabd02923988c4ab4567c474da024ab2"
err.out
# they differ here, in case you're curious -------------------------> ^
if
!
grep
-q
"DigestMismatch: digest mismatch:"
err.out||
\
!
grep
-q
" computed: ff7e678fa279de4cf73f04e25ec3e98b26716e332666f650bbaa372ac8b1b8d7"
err.out
||
\
!
grep
-q
" received: 30c7cd65d97fc08519c5f87b3b44fa5c099840372e6caeddf3a6e225015fcc6f"
err.out
then
echo
""
echo
"ERROR: did not see expected DigestMismatch
head fuzz digest error
"
echo
"ERROR: did not see expected DigestMismatch
error (ff7e678 vs 30c7cd6)
"
cat
err.out
PASSED
=
"no"
fi
...
...
@@ -1144,8 +1144,9 @@ fi
if
!
cmp ../test-plaintext-a tmp-plaintext-a-1
then
echo
""
echo
"ERROR: decryption failed when head fuzz
digest
tampered with"
echo
"ERROR: decryption failed when head fuzz tampered with"
cat
tmp-plaintext-a-1
echo
""
PASSED
=
"no"
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment