From bb6a7e1c6c07e323e180797b782f238807e06311 Mon Sep 17 00:00:00 2001 From: Karel Miko Date: Thu, 14 Sep 2017 18:53:09 +0200 Subject: [PATCH] if dsa_int_validate_* fails return consistently CRYPT_INVALID_PACKET --- src/pk/dsa/dsa_set.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index cc53fc8..a4d4042 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -48,7 +48,7 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen, /* do only a quick validation, without primality testing */ if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { - err = CRYPT_INVALID_ARG; + err = CRYPT_INVALID_PACKET; goto LBL_ERR; } @@ -94,7 +94,7 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key if ((err = dsa_int_validate_xy(key, &stat)) != CRYPT_OK) { goto LBL_ERR; } if (stat == 0) { - err = CRYPT_INVALID_ARG; + err = CRYPT_INVALID_PACKET; goto LBL_ERR; }