}
ASN1_INTEGER_free(public_key);
-
+ EVP_PKEY_assign_DSA(pkey, dsa);
return 1;
err:
DSAerr(DSA_F_DSA_PUB_ENCODE, ERR_R_MALLOC_FAILURE);
goto err;
}
+ pval = str;
ptype = V_ASN1_SEQUENCE;
}
else
goto err;
}
-
if (ktype > 0)
{
public_key = EC_KEY_get0_public_key(x);
reason = ERR_R_EC_LIB;
goto err;
}
- buf_len = (size_t)BN_num_bytes(pub_key);
+ if (pub_key)
+ buf_len = (size_t)BN_num_bytes(pub_key);
}
- else
if (ktype == 2)
{
- if ((i = (size_t)BN_num_bytes(priv_key)) > buf_len)
- buf_len = i;
priv_key = EC_KEY_get0_private_key(x);
+ if (priv_key && (i = (size_t)BN_num_bytes(priv_key)) > buf_len)
+ buf_len = i;
}
else
priv_key = NULL;