Browse Source

if dsa_int_validate_* fails return consistently CRYPT_INVALID_PACKET

Karel Miko 8 years ago
parent
commit
bb6a7e1c6c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/pk/dsa/dsa_set.c

+ 2 - 2
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 */
    /* do only a quick validation, without primality testing */
    if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK)                        { goto LBL_ERR; }
    if ((err = dsa_int_validate_pqg(key, &stat)) != CRYPT_OK)                        { goto LBL_ERR; }
    if (stat == 0) {
    if (stat == 0) {
-      err = CRYPT_INVALID_ARG;
+      err = CRYPT_INVALID_PACKET;
       goto LBL_ERR;
       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 ((err = dsa_int_validate_xy(key, &stat)) != CRYPT_OK)                             { goto LBL_ERR; }
    if (stat == 0) {
    if (stat == 0) {
-      err = CRYPT_INVALID_ARG;
+      err = CRYPT_INVALID_PACKET;
       goto LBL_ERR;
       goto LBL_ERR;
    }
    }