Lines Matching refs:pkey

277     int keyid_len, char *name_str, EVP_PKEY **pkey, X509 **cert,  in sunw_PKCS12_parse()  argument
290 if (pkey) in sunw_PKCS12_parse()
291 *pkey = NULL; in sunw_PKCS12_parse()
333 name_str, pkey, cert, ca); in sunw_PKCS12_parse()
341 if (pkey && *pkey) { in sunw_PKCS12_parse()
342 sunw_evp_pkey_free(*pkey); in sunw_PKCS12_parse()
392 STACK_OF(EVP_PKEY) **pkey, STACK_OF(X509) **certs) in sunw_PEM_contents()
418 retval = set_results(pkey, &work_kl, certs, &work_ca, NULL, NULL, NULL, in sunw_PEM_contents()
455 sunw_PKCS12_contents(PKCS12 *p12, const char *pass, STACK_OF(EVP_PKEY) **pkey, in sunw_PKCS12_contents() argument
484 retval = set_results(pkey, &work_kl, certs, &work_ca, NULL, in sunw_PKCS12_contents()
646 EVP_PKEY *pkey = NULL; in sunw_PKCS12_create() local
793 pkey = sk_EVP_PKEY_value(pkeys, i); in sunw_PKCS12_create()
796 if ((p8 = EVP_PKEY2PKCS8(pkey)) == NULL) { in sunw_PKCS12_create()
811 len = sunw_get_pkey_fname(GETDO_COPY, pkey, in sunw_PKCS12_create()
823 len = sunw_get_pkey_localkeyid(GETDO_COPY, pkey, in sunw_PKCS12_create()
927 sunw_evp_pkey_free(EVP_PKEY *pkey) in sunw_evp_pkey_free() argument
929 if (pkey != NULL) { in sunw_evp_pkey_free()
930 if (pkey->attributes != NULL) { in sunw_evp_pkey_free()
931 sk_X509_ATTRIBUTE_pop_free(pkey->attributes, in sunw_evp_pkey_free()
933 pkey->attributes = NULL; in sunw_evp_pkey_free()
935 EVP_PKEY_free(pkey); in sunw_evp_pkey_free()
959 sunw_set_localkeyid(const char *keyid_str, int keyid_len, EVP_PKEY *pkey, in sunw_set_localkeyid() argument
975 if (pkey != NULL) { in sunw_set_localkeyid()
996 if (pkey->attributes == NULL) { in sunw_set_localkeyid()
997 pkey->attributes = sk_X509_ATTRIBUTE_new_null(); in sunw_set_localkeyid()
998 if (pkey->attributes == NULL) { in sunw_set_localkeyid()
1004 i = find_attr_by_nid(pkey->attributes, NID_localKeyID); in sunw_set_localkeyid()
1006 sk_X509_ATTRIBUTE_delete(pkey->attributes, i); in sunw_set_localkeyid()
1008 if (sk_X509_ATTRIBUTE_push(pkey->attributes, attr) == 0) { in sunw_set_localkeyid()
1046 sunw_get_pkey_localkeyid(getdo_actions_t dowhat, EVP_PKEY *pkey, in sunw_get_pkey_localkeyid() argument
1060 if (pkey == NULL || pkey->attributes == NULL) { in sunw_get_pkey_localkeyid()
1064 if ((i = find_attr_by_nid(pkey->attributes, NID_localKeyID)) < 0) { in sunw_get_pkey_localkeyid()
1067 attr = sk_X509_ATTRIBUTE_value(pkey->attributes, i); in sunw_get_pkey_localkeyid()
1075 attr = sk_X509_ATTRIBUTE_delete(pkey->attributes, i); in sunw_get_pkey_localkeyid()
1111 sunw_get_pkey_fname(getdo_actions_t dowhat, EVP_PKEY *pkey, char **fname) in sunw_get_pkey_fname() argument
1122 if (pkey == NULL || pkey->attributes == NULL) { in sunw_get_pkey_fname()
1126 if ((i = find_attr_by_nid(pkey->attributes, NID_friendlyName)) < 0) { in sunw_get_pkey_fname()
1129 attr = sk_X509_ATTRIBUTE_value(pkey->attributes, i); in sunw_get_pkey_fname()
1137 attr = sk_X509_ATTRIBUTE_delete(pkey->attributes, i); in sunw_get_pkey_fname()
1375 sunw_set_fname(const char *ascname, EVP_PKEY *pkey, X509 *cert) in sunw_set_fname() argument
1405 if (pkey != NULL) { in sunw_set_fname()
1423 if (pkey->attributes == NULL) { in sunw_set_fname()
1424 pkey->attributes = sk_X509_ATTRIBUTE_new_null(); in sunw_set_fname()
1425 if (pkey->attributes == NULL) { in sunw_set_fname()
1430 } else if ((i = find_attr_by_nid(pkey->attributes, in sunw_set_fname()
1432 (void) sk_X509_ATTRIBUTE_delete(pkey->attributes, i); in sunw_set_fname()
1435 if (sk_X509_ATTRIBUTE_push(pkey->attributes, attr) == 0) { in sunw_set_fname()
1470 sunw_check_keys(X509 *cert, EVP_PKEY *pkey) in sunw_check_keys() argument
1474 if (pkey != NULL && cert != NULL) in sunw_check_keys()
1475 retval = X509_check_private_key(cert, pkey); in sunw_check_keys()
1542 int kstr_len, char *name_str, EVP_PKEY **pkey, X509 **cert, in parse_pkcs12() argument
1585 work_kl, work_cl, pkey, cert); in parse_pkcs12()
1603 pkey, cert); in parse_pkcs12()
1615 retval = get_key_cert(0, work_kl, pkey, work_cl, cert); in parse_pkcs12()
1634 retval = get_key_cert(n, work_kl, pkey, work_cl, cert); in parse_pkcs12()
1654 retval = get_key_cert(0, tmpk, pkey, tmpc, cert); in parse_pkcs12()
1674 if (pkey != NULL && *pkey != NULL) { in parse_pkcs12()
1675 sunw_evp_pkey_free(*pkey); in parse_pkcs12()
1676 *pkey = NULL; in parse_pkcs12()
1807 EVP_PKEY *pkey = NULL; in parse_one_bag() local
1818 if ((pkey = EVP_PKCS82PKEY(bag->value.keybag)) == NULL) { in parse_one_bag()
1835 pkey = EVP_PKCS82PKEY(p8); in parse_one_bag()
1837 if (pkey == NULL) { in parse_one_bag()
1931 if (pkey != NULL) { in parse_one_bag()
1933 pkey->attributes == NULL) { in parse_one_bag()
1934 pkey->attributes = sk_X509_ATTRIBUTE_new_null(); in parse_one_bag()
1935 if (pkey->attributes == NULL) { in parse_one_bag()
1951 if (sk_X509_ATTRIBUTE_push(pkey->attributes, in parse_one_bag()
1971 if (sk_X509_ATTRIBUTE_push(pkey->attributes, in parse_one_bag()
1984 if (sk_EVP_PKEY_push(kl, pkey) == 0) { in parse_one_bag()
1989 pkey = NULL; in parse_one_bag()
1994 if (pkey != NULL) { in parse_one_bag()
1995 sunw_evp_pkey_free(pkey); in parse_one_bag()
2107 pp = &(x->x_pkey->dec_pkey->pkey.rsa); in pem_info()
2119 pp = &(x->x_pkey->dec_pkey->pkey.dsa); in pem_info()
2254 get_key_cert(int n, STACK_OF(EVP_PKEY) *kl, EVP_PKEY **pkey, STACK_OF(X509) *cl, in get_key_cert() argument
2264 if (pkey != NULL && *pkey == NULL) { in get_key_cert()
2266 *pkey = sk_EVP_PKEY_delete(kl, n); in get_key_cert()
2267 if (*pkey != NULL) in get_key_cert()
2594 find_attr(int nid, ASN1_STRING *str, STACK_OF(EVP_PKEY) *kl, EVP_PKEY **pkey, argument
2610 chkcerts = (cert != NULL || pkey != NULL) && cl != NULL;
2667 if (pkey != NULL && kl != NULL) {
2678 if (pkey != NULL)
2679 *pkey = sk_EVP_PKEY_delete(kl, k);
2694 if (pkey != NULL)
2695 *pkey = sk_EVP_PKEY_delete(kl, k);