*/
#include <stdio.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include <openssl/dsa.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
{
if (operation == ASN1_OP_NEW_PRE) {
DSA_SIG *sig;
- sig = OPENSSL_malloc(sizeof(DSA_SIG));
+ sig = OPENSSL_malloc(sizeof(*sig));
if (!sig) {
DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
return 0;
ASN1_SIMPLE(DSA, q, BIGNUM),
ASN1_SIMPLE(DSA, g, BIGNUM),
ASN1_SIMPLE(DSA, pub_key, BIGNUM),
- ASN1_SIMPLE(DSA, priv_key, BIGNUM)
+ ASN1_SIMPLE(DSA, priv_key, CBIGNUM)
} ASN1_SEQUENCE_END_cb(DSA, DSAPrivateKey)
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA, DSAPrivateKey, DSAPrivateKey)
goto err;
ret = DSA_do_verify(dgst, dgst_len, s, dsa);
err:
- if (derlen > 0) {
- OPENSSL_cleanse(der, derlen);
- OPENSSL_free(der);
- }
+ OPENSSL_clear_free(der, derlen);
DSA_SIG_free(s);
return (ret);
}