if dsa_int_validate_* fails return consistently CRYPT_INVALID_PACKET

This commit is contained in:
Karel Miko 2017-09-14 18:53:09 +02:00
parent a990a8252e
commit bb6a7e1c6c

View File

@ -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;
}