diff options
| author | Werner Koch <[email protected]> | 2018-02-27 18:50:54 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2018-02-27 19:19:32 +0000 |
| commit | ad989373f1a46139ed0fbc4d4a91069b78617ad9 (patch) | |
| tree | 65caeb2a5a2cb019efe02a8812cc8329e0f6f61f /dirmngr/ks-engine-hkp.c | |
| parent | gpg: Rename cipher.c to cipher-cfb.c (diff) | |
| download | gnupg-ad989373f1a46139ed0fbc4d4a91069b78617ad9.tar.gz gnupg-ad989373f1a46139ed0fbc4d4a91069b78617ad9.zip | |
gpg: Factor common code out of the AEAD decryption function.
* g10/decrypt-data.c (aead_underflow): Factor reading and checking
code code out to ...
(fill_buffer, aead_checktag): new functions.
--
Here is a simple test script to check against a set of encrypted files
with naming convention like "symenc-aead-eax-c6-56.asc"
# ------------------------ >8 ------------------------
set -e
GPG=../g10/gpg
for file in "$@"; do
echo "${file##*/}" | ( IFS=- read dummy1 dummy2 mode cbyte len rest
len="${len%.*}"
cbyte="${cbyte#c}"
[ "$dummy1" != "symenc" -o "$dummy2" != "aead" ] && continue
echo "checking mode=$mode chunkbyte=$cbyte length=$len"
if ! $GPG --no-options --rfc4880bis --batch --passphrase "abc" \
-d < $file >tmp.plain 2>/dev/null; then
echo "Decryption failed for $file" >&2
exit 2
fi
plainlen=$(wc -c <tmp.plain)
if [ $plainlen -ne $len ]; then
echo "Plaintext length mismatch for $file (want=$len have=$plainlen)" >&2
exit 2
fi
)
done
echo "all files are okay" >&2
# ------------------------ 8< ------------------------
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/ks-engine-hkp.c')
0 files changed, 0 insertions, 0 deletions
