#!/bin/sh
# Regression tests pertaining to the armoring.

. $srcdir/defs.inc || exit 3

armored_key_8192='-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.0.9

[encoded data, 11023 characters]
7OqcRycJhHu/qu5vl3TPDACg6xD1M0NiZWWdbV9/2u3VhxMf0uI=
=oXxa
-----END PGP PUBLIC KEY BLOCK-----
'

# Bug solved 2005-04-07:
# Try importing the attached key file.  As the key is exactly 8192
# bytes long, radix64_read is called twice - the first time to read
# the 8192 bytes, and then once again, to handle the pad '=' on the
# last four character radix64 block '0uI='.  gpg bails out with
#  gpg: [don't know]: invalid packet (ctb=2d)
# On a read for only the = sign, radix64_read returns -1 for EOF.
# This causes the iobuf code to pop the armor filter and thus the next
# byte read is the '-' from the END header line, causing an error.
i=armored_key_8192
info "checking: $i"
eval "(IFS=; echo \"\$$i\")" >x
$GPG --import x || error "the $i bug is back in town"




