|
@@ -30,9 +30,9 @@ int dsa_set_pqg(const unsigned char *p, unsigned long plen,
|
|
|
/* init key */
|
|
|
if ((err = dsa_int_init(key)) != CRYPT_OK) return err;
|
|
|
|
|
|
- if ((err = mp_read_unsigned_bin(key->p, (unsigned char *)p , plen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
- if ((err = mp_read_unsigned_bin(key->g, (unsigned char *)g , glen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
- if ((err = mp_read_unsigned_bin(key->q, (unsigned char *)q , qlen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
+ if ((err = mp_read_unsigned_bin(key->p, p , plen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
+ if ((err = mp_read_unsigned_bin(key->g, g , glen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
+ if ((err = mp_read_unsigned_bin(key->q, q , qlen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
|
|
|
key->qord = mp_unsigned_bin_size(key->q);
|
|
|
|
|
@@ -75,12 +75,12 @@ int dsa_set_key(const unsigned char *in, unsigned long inlen, int type, dsa_key
|
|
|
|
|
|
if (type == PK_PRIVATE) {
|
|
|
key->type = PK_PRIVATE;
|
|
|
- if ((err = mp_read_unsigned_bin(key->x, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
+ if ((err = mp_read_unsigned_bin(key->x, in, inlen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
if ((err = mp_exptmod(key->g, key->x, key->p, key->y)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
}
|
|
|
else {
|
|
|
key->type = PK_PUBLIC;
|
|
|
- if ((err = mp_read_unsigned_bin(key->y, (unsigned char *)in, inlen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
+ if ((err = mp_read_unsigned_bin(key->y, in, inlen)) != CRYPT_OK) { goto LBL_ERR; }
|
|
|
}
|
|
|
|
|
|
if ((err = dsa_int_validate_xy(key, &stat)) != CRYPT_OK) { goto LBL_ERR; }
|