Lines Matching refs:pkey
69 static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey) in dsa_pub_decode() argument
126 EVP_PKEY_assign_DSA(pkey, dsa); in dsa_pub_decode()
138 static int dsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) in dsa_pub_encode() argument
146 dsa=pkey->pkey.dsa; in dsa_pub_encode()
147 if (pkey->save_parameters && dsa->p && dsa->q && dsa->g) in dsa_pub_encode()
190 static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) in dsa_priv_decode() argument
283 EVP_PKEY_assign_DSA(pkey, dsa); in dsa_priv_decode()
303 static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) in dsa_priv_encode() argument
318 params->length = i2d_DSAparams(pkey->pkey.dsa, ¶ms->data); in dsa_priv_encode()
327 prkey = BN_to_ASN1_INTEGER(pkey->pkey.dsa->priv_key, NULL); in dsa_priv_encode()
355 static int int_dsa_size(const EVP_PKEY *pkey) in int_dsa_size() argument
357 return(DSA_size(pkey->pkey.dsa)); in int_dsa_size()
360 static int dsa_bits(const EVP_PKEY *pkey) in dsa_bits() argument
362 return BN_num_bits(pkey->pkey.dsa->p); in dsa_bits()
365 static int dsa_missing_parameters(const EVP_PKEY *pkey) in dsa_missing_parameters() argument
368 dsa=pkey->pkey.dsa; in dsa_missing_parameters()
378 if ((a=BN_dup(from->pkey.dsa->p)) == NULL) in dsa_copy_parameters()
380 if (to->pkey.dsa->p != NULL) in dsa_copy_parameters()
381 BN_free(to->pkey.dsa->p); in dsa_copy_parameters()
382 to->pkey.dsa->p=a; in dsa_copy_parameters()
384 if ((a=BN_dup(from->pkey.dsa->q)) == NULL) in dsa_copy_parameters()
386 if (to->pkey.dsa->q != NULL) in dsa_copy_parameters()
387 BN_free(to->pkey.dsa->q); in dsa_copy_parameters()
388 to->pkey.dsa->q=a; in dsa_copy_parameters()
390 if ((a=BN_dup(from->pkey.dsa->g)) == NULL) in dsa_copy_parameters()
392 if (to->pkey.dsa->g != NULL) in dsa_copy_parameters()
393 BN_free(to->pkey.dsa->g); in dsa_copy_parameters()
394 to->pkey.dsa->g=a; in dsa_copy_parameters()
400 if ( BN_cmp(a->pkey.dsa->p,b->pkey.dsa->p) || in dsa_cmp_parameters()
401 BN_cmp(a->pkey.dsa->q,b->pkey.dsa->q) || in dsa_cmp_parameters()
402 BN_cmp(a->pkey.dsa->g,b->pkey.dsa->g)) in dsa_cmp_parameters()
410 if (BN_cmp(b->pkey.dsa->pub_key,a->pkey.dsa->pub_key) != 0) in dsa_pub_cmp()
416 static void int_dsa_free(EVP_PKEY *pkey) in int_dsa_free() argument
418 DSA_free(pkey->pkey.dsa); in int_dsa_free()
490 static int dsa_param_decode(EVP_PKEY *pkey, in dsa_param_decode() argument
499 EVP_PKEY_assign_DSA(pkey, dsa); in dsa_param_decode()
503 static int dsa_param_encode(const EVP_PKEY *pkey, unsigned char **pder) in dsa_param_encode() argument
505 return i2d_DSAparams(pkey->pkey.dsa, pder); in dsa_param_encode()
508 static int dsa_param_print(BIO *bp, const EVP_PKEY *pkey, int indent, in dsa_param_print() argument
511 return do_dsa_print(bp, pkey->pkey.dsa, indent, 0); in dsa_param_print()
514 static int dsa_pub_print(BIO *bp, const EVP_PKEY *pkey, int indent, in dsa_pub_print() argument
517 return do_dsa_print(bp, pkey->pkey.dsa, indent, 1); in dsa_pub_print()
521 static int dsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent, in dsa_priv_print() argument
524 return do_dsa_print(bp, pkey->pkey.dsa, indent, 2); in dsa_priv_print()
527 static int old_dsa_priv_decode(EVP_PKEY *pkey, in old_dsa_priv_decode() argument
536 EVP_PKEY_assign_DSA(pkey, dsa); in old_dsa_priv_decode()
540 static int old_dsa_priv_encode(const EVP_PKEY *pkey, unsigned char **pder) in old_dsa_priv_encode() argument
542 return i2d_DSAPrivateKey(pkey->pkey.dsa, pder); in old_dsa_priv_encode()
591 static int dsa_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2) in dsa_pkey_ctrl() argument
606 if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey))) in dsa_pkey_ctrl()
623 if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey))) in dsa_pkey_ctrl()