Home | History | Annotate | Download | only in dsa

Lines Matching refs:dsa

62 #include <openssl/dsa.h>
79 DSA *dsa = NULL;
92 if (!(dsa = d2i_DSAparams(NULL, &pm, pmlen)))
101 if (!(dsa = DSA_new()))
119 if (!(dsa->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)))
126 EVP_PKEY_assign_DSA(pkey, dsa);
132 if (dsa)
133 DSA_free(dsa);
140 DSA *dsa;
146 dsa=pkey->pkey.dsa;
147 if (pkey->save_parameters && dsa->p && dsa->q && dsa->g)
151 str->length = i2d_DSAparams(dsa, &str->data);
163 dsa->write_params=0;
165 penclen = i2d_DSAPublicKey(dsa, &penc);
186 /* In PKCS#8 DSA: you just get a private key integer and parameters in the
202 DSA *dsa = NULL;
208 /* Check for broken DSA PKCS#8, UGH! */
257 if (!(dsa = d2i_DSAparams(NULL, &pm, pmlen)))
260 if (!(dsa->priv_key = ASN1_INTEGER_to_BN(privkey, NULL)))
266 if (!(dsa->pub_key = BN_new()))
277 if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx))
283 EVP_PKEY_assign_DSA(pkey, dsa);
299 DSA_free(dsa);
318 params->length = i2d_DSAparams(pkey->pkey.dsa, &params->data);
327 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL);
357 return(DSA_size(pkey->pkey.dsa));
362 return BN_num_bits(pkey->pkey.dsa->p);
367 DSA *dsa;
368 dsa=pkey->pkey.dsa;
369 if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL))
378 if ((a=BN_dup(from->pkey.dsa->p)) == NULL)
380 if (to->pkey.dsa->p != NULL)
381 BN_free(to->pkey.dsa->p);
382 to->pkey.dsa->p=a;
384 if ((a=BN_dup(from->pkey.dsa->q)) == NULL)
386 if (to->pkey.dsa->q != NULL)
387 BN_free(to->pkey.dsa->q);
388 to->pkey.dsa->q=a;
390 if ((a=BN_dup(from->pkey.dsa->g)) == NULL)
392 if (to->pkey.dsa->g != NULL)
393 BN_free(to->pkey.dsa->g);
394 to->pkey.dsa->g=a;
400 if ( BN_cmp(a->pkey.dsa->p,b->pkey.dsa->p) ||
401 BN_cmp(a->pkey.dsa->q,b->pkey.dsa->q) ||
402 BN_cmp(a->pkey.dsa->g,b->pkey.dsa->g))
410 if (BN_cmp(b->pkey.dsa->pub_key,a->pkey.dsa->pub_key) != 0)
418 DSA_free(pkey->pkey.dsa);
430 static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype)
454 ktype = "DSA-Parameters";
493 DSA *dsa;
494 if (!(dsa = d2i_DSAparams(NULL, pder, derlen)))
499 EVP_PKEY_assign_DSA(pkey, dsa);
505 return i2d_DSAparams(pkey->pkey.dsa, pder);
511 return do_dsa_print(bp, pkey->pkey.dsa, indent, 0);
517 return do_dsa_print(bp, pkey->pkey.dsa, indent, 1);
524 return do_dsa_print(bp, pkey->pkey.dsa, indent, 2);
530 DSA *dsa;
531 if (!(dsa = d2i_DSAPrivateKey (NULL, pder, derlen)))
536 EVP_PKEY_assign_DSA(pkey, dsa);
542 return i2d_DSAPrivateKey(pkey->pkey.dsa, pder);
675 "DSA",
676 "OpenSSL DSA method",