Home | History | Annotate | Download | only in dh

Lines Matching refs:DH

62 #include <openssl/dh.h>
68 DH_free(pkey->pkey.dh);
81 DH *dh = NULL;
97 if (!(dh = d2i_DHparams(NULL, &pm, pmlen)))
110 if (!(dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)))
117 EVP_PKEY_assign_DH(pkey, dh);
123 if (dh)
124 DH_free(dh);
131 DH *dh;
139 dh=pkey->pkey.dh;
142 str->length = i2d_DHparams(dh, &str->data);
151 pub_key = BN_to_ASN1_INTEGER(dh->pub_key, NULL);
179 /* PKCS#8 DH is defined in PKCS#11 of all places. It is similar to DH in
194 DH *dh = NULL;
211 if (!(dh = d2i_DHparams(NULL, &pm, pmlen)))
214 if (!(dh->priv_key = ASN1_INTEGER_to_BN(privkey, NULL)))
220 if (!DH_generate_key(dh))
223 EVP_PKEY_assign_DH(pkey, dh);
232 DH_free(dh);
251 params->length = i2d_DHparams(pkey->pkey.dh, &params->data);
260 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dh->priv_key, NULL);
301 DH *dh;
302 if (!(dh = d2i_DHparams(NULL, pder, derlen)))
307 EVP_PKEY_assign_DH(pkey, dh);
313 return i2d_DHparams(pkey->pkey.dh, pder);
316 static int do_dh_print(BIO *bp, const DH *x, int indent,
350 ktype = "PKCS#3 DH Private-Key";
352 ktype = "PKCS#3 DH Public-Key";
354 ktype = "PKCS#3 DH Parameters";
393 return(DH_size(pkey->pkey.dh));
398 return BN_num_bits(pkey->pkey.dh->p);
403 if ( BN_cmp(a->pkey.dh->p,b->pkey.dh->p) ||
404 BN_cmp(a->pkey.dh->g,b->pkey.dh->g))
414 if ((a=BN_dup(from->pkey.dh->p)) == NULL)
416 if (to->pkey.dh->p != NULL)
417 BN_free(to->pkey.dh->p);
418 to->pkey.dh->p=a;
420 if ((a=BN_dup(from->pkey.dh->g)) == NULL)
422 if (to->pkey.dh->g != NULL)
423 BN_free(to->pkey.dh->g);
424 to->pkey.dh->g=a;
431 if (!a->pkey.dh->p || !a->pkey.dh->g)
440 if (BN_cmp(b->pkey.dh->pub_key,a->pkey.dh->pub_key) != 0)
449 return do_dh_print(bp, pkey->pkey.dh, indent, ctx, 0);
455 return do_dh_print(bp, pkey->pkey.dh, indent, ctx, 1);
461 return do_dh_print(bp, pkey->pkey.dh, indent, ctx, 2);
464 int DHparams_print(BIO *bp, const DH *x)
475 "DH",
476 "OpenSSL PKCS#3 DH method",