if dsa_int_validate_* fails return consistently CRYPT_INVALID_PACKET
This commit is contained in:
parent
a990a8252e
commit
bb6a7e1c6c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user