diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2020-01-20 03:11:08 +0300 |
---|---|---|
committer | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2020-01-20 03:11:08 +0300 |
commit | 6cebf4e042ac0f338a80121beff92ad120235407 (patch) | |
tree | c68feca1ccaad0467cb7e408c5fa3c32da5dfc21 /tests | |
parent | 4023d63f0b2795c0c0447282c808671ae8503ac3 (diff) | |
download | gnutls-6cebf4e042ac0f338a80121beff92ad120235407.tar.gz |
pkcs12: use correct key length when using STREEBOG-512
PKCS#12 files using GOST HMAC (GOST R 34.11-94 and Streebog) use special
function to generate MAC key. Pass correct key length (fixed to be 32)
when generating PKCS#12 files protected with Streebog (currently it
incorrectly uses 64 there).
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/cert-tests/pkcs12-gost | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/cert-tests/pkcs12-gost b/tests/cert-tests/pkcs12-gost index ee9318f750..2b5b6bfd79 100755 --- a/tests/cert-tests/pkcs12-gost +++ b/tests/cert-tests/pkcs12-gost @@ -81,6 +81,20 @@ if test ${rc} != 0; then exit 1 fi +${VALGRIND} "${CERTTOOL}" --pkcs-cipher=gost28147-tc26z --hash streebog-512 --to-p12 --password "Пароль для PFX" --p12-name "my-key" --load-certificate "${srcdir}/../certs/cert-ecc256.pem" --load-privkey "${srcdir}/../certs/ecc256.pem" --load-ca-certificate "${srcdir}/../certs/ca-cert-ecc.pem" --outder --outfile $TMPFILE >/dev/null +rc=$? +if test ${rc} != 0; then + echo "PKCS12 FATAL encoding" + exit 1 +fi + +${VALGRIND} "${CERTTOOL}" --p12-info --inder --password "Пароль для PFX" --infile $TMPFILE >${TMPFILE_PEM} 2>/dev/null +rc=$? +if test ${rc} != 0; then + echo "PKCS12 FATAL decrypting/decoding" + exit 1 +fi + rm -f "$TMPFILE" "$TMPFILE_PEM" exit 0 |