From 3ba0885a3e0d52c6bef91ce9bea26cd3eabd3594 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 12 Apr 2006 23:51:24 +0000 Subject: Extend DH ASN1 method, add DH EVP_PKEY_METHOD. --- crypto/dh/dh_ameth.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crypto/dh/dh_ameth.c') diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c index 3a5600cf34..6d3125789d 100644 --- a/crypto/dh/dh_ameth.c +++ b/crypto/dh/dh_ameth.c @@ -260,7 +260,7 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) if (!prkey) { - DHerr(DH_F_DSA_PRIV_ENCODE,DH_R_BN_ERROR); + DHerr(DH_F_DH_PRIV_ENCODE,DH_R_BN_ERROR); goto err; } @@ -268,7 +268,7 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) ASN1_INTEGER_free(prkey); - if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_dsa), 0, + if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_dhKeyAgreement), 0, V_ASN1_SEQUENCE, params, dp, dplen)) goto err; @@ -403,9 +403,9 @@ static int dh_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) if ((a=BN_dup(from->pkey.dh->p)) == NULL) return 0; - if (to->pkey.dsa->p != NULL) + if (to->pkey.dh->p != NULL) BN_free(to->pkey.dh->p); - to->pkey.dsa->p=a; + to->pkey.dh->p=a; if ((a=BN_dup(from->pkey.dh->g)) == NULL) return 0; -- cgit v1.2.3