Lines Matching refs:NULL

126 	{ 0, NULL }
161 { 0, NULL }
170 { 0, NULL }
225 * other (CA) certs. Note either ca should be NULL, *ca should be NULL,
231 * pass - Pass phrase for the private key (possibly empty) or NULL if
239 * to match. This value should be a NULL terminated string.
283 /* If NULL PKCS12 structure, this is an error */
284 if (p12 == NULL) {
291 *pkey = NULL;
293 *cert = NULL;
299 ca_supplied = (ca != NULL && *ca != NULL);
300 if (ca != NULL && *ca == NULL) {
301 if ((*ca = sk_X509_new_null()) == NULL) {
308 * If password is zero length or NULL then try verifying both cases
312 * non-zero length and is not NULL then call PKCS12_verify_mac() with
317 if (pass == NULL || *pass == '\0') {
318 if (PKCS12_verify_mac(p12, NULL, 0))
319 pass = NULL;
346 if (ca_supplied == B_FALSE && ca != NULL)
371 * pass - Pass phrase for the private key or NULL if there is none.
375 * The pointers to stacks should either be NULL or their contents should
376 * either be NULL or should point to a valid STACK_OF(X509) structure.
394 STACK_OF(EVP_PKEY) *work_kl = NULL;
395 STACK_OF(X509) *work_ca = NULL;
402 if ((work_kl = sk_EVP_PKEY_new_null()) == NULL) {
407 if ((work_ca = sk_X509_new_null()) == NULL) {
418 retval = set_results(pkey, &work_kl, certs, &work_ca, NULL, NULL, NULL,
419 NULL);
421 if (work_kl != NULL) {
424 if (work_ca != NULL)
436 * various certs. Note these should either be NULL, *whatever should
437 * be NULL, or it should point to a valid STACK_OF(X509) structure.
442 * empty) or NULL if there is none.
458 STACK_OF(EVP_PKEY) *work_kl = NULL;
459 STACK_OF(X509) *work_ca = NULL;
466 if ((work_kl = sk_EVP_PKEY_new_null()) == NULL) {
471 if ((work_ca = sk_X509_new_null()) == NULL) {
484 retval = set_results(pkey, &work_kl, certs, &work_ca, NULL,
485 NULL, NULL, NULL);
488 if (work_kl != NULL) {
505 * keys. They are moved from 'allcerts'. This may not be NULL
506 * when called. If *keycerts is NULL upon entry, a new stack will
510 * matching certs. If this is NULL, matchless keys will be
542 *keycerts = NULL;
543 if (nocerts != NULL)
544 *nocerts = NULL;
545 nomatch = NULL;
547 if ((matching = sk_X509_new_null()) == NULL) {
586 if (nocerts == NULL) {
590 if (*nocerts == NULL) {
592 if (nomatch == NULL) {
621 * empty) or NULL if there is none. It will be used to encrypt
629 * Note that any of these may be NULL.
632 * NULL - An error occurred.
633 * != NULL - Address of PKCS12 structure. The user is responsible for
642 STACK_OF(PKCS12_SAFEBAG) *bags = NULL;
643 STACK_OF(PKCS7) *safes = NULL;
644 PKCS12_SAFEBAG *bag = NULL;
645 PKCS8_PRIV_KEY_INFO *p8 = NULL;
646 EVP_PKEY *pkey = NULL;
647 PKCS12 *ret_p12 = NULL;
648 PKCS12 *p12 = NULL;
649 PKCS7 *authsafe = NULL;
650 X509 *cert = NULL;
651 uchar_t *str = NULL;
657 if ((safes = sk_PKCS7_new_null()) == NULL) {
659 return (NULL);
662 if ((bags = sk_PKCS12_SAFEBAG_new_null()) == NULL) {
667 if (certs != NULL && sk_X509_num(certs) > 0) {
673 if ((bag = M_PKCS12_x5092certbag(cert)) == NULL) {
677 if (cert->aux != NULL && cert->aux->alias != NULL &&
680 if (str == NULL) {
694 if (cert->aux != NULL && cert->aux->keyid != NULL &&
699 if (str != NULL &&
712 bag = NULL;
716 if (cacerts != NULL && sk_X509_num(cacerts) > 0) {
721 if ((bag = M_PKCS12_x5092certbag(cert)) == NULL) {
726 if (cert->aux != NULL && cert->aux->alias != NULL &&
729 if (str == NULL) {
743 if (cert->aux != NULL && cert->aux->keyid != NULL &&
748 if (str != NULL &&
761 bag = NULL;
765 if (certs != NULL || cacerts != NULL && certs_there) {
768 NULL, 0, PKCS12_DEFAULT_ITER, bags);
769 if (authsafe == NULL) {
774 bags = NULL;
780 authsafe = NULL;
783 if (pkeys != NULL && sk_EVP_PKEY_num(pkeys) > 0) {
785 if (bags == NULL &&
786 (bags = sk_PKCS12_SAFEBAG_new_null()) == NULL) {
796 if ((p8 = EVP_PKEY2PKCS8(pkey)) == NULL) {
801 bag = PKCS12_MAKE_SHKEYBAG(nid_key, pass, -1, NULL, 0,
803 if (bag == NULL) {
809 p8 = NULL;
813 if (str != NULL) {
821 str = NULL;
825 if (str != NULL) {
832 str = NULL;
840 bag = NULL;
846 if (authsafe == NULL) {
852 bags = NULL;
858 authsafe = NULL;
867 if ((p12 = PKCS12_init(NID_pkcs7_data)) == NULL) {
880 if (PKCS12_set_mac(p12, pass, -1, NULL, 0, 2048, NULL) == 0) {
886 p12 = NULL;
892 if (str != NULL)
895 if (p8 != NULL)
898 if (bag != NULL)
900 if (bags != NULL)
902 if (authsafe != NULL)
904 if (safes != NULL)
906 if (p12 != NULL)
929 if (pkey != NULL) {
930 if (pkey->attributes != NULL) {
933 pkey->attributes = NULL;
962 X509_ATTRIBUTE *attr = NULL;
963 ASN1_STRING *str = NULL;
964 ASN1_TYPE *keyid = NULL;
968 if (cert != NULL) {
975 if (pkey != NULL) {
977 if (str == NULL ||
979 (keyid = ASN1_TYPE_new()) == NULL) {
985 str = NULL;
988 if (attr == NULL) {
994 keyid = NULL;
996 if (pkey->attributes == NULL) {
998 if (pkey->attributes == NULL) {
1012 attr = NULL;
1017 if (str != NULL)
1019 if (keyid != NULL)
1021 if (attr != NULL)
1049 X509_ATTRIBUTE *attr = NULL;
1050 ASN1_OCTET_STRING *str = NULL;
1051 ASN1_TYPE *ty = NULL;
1055 if (keyid_str != NULL)
1056 *keyid_str = NULL;
1057 if (keyid_len != NULL)
1060 if (pkey == NULL || pkey->attributes == NULL) {
1069 if ((ty = attrib2type(attr)) == NULL ||
1076 if (attr != NULL)
1083 if ((*keyid_str = malloc(len)) == NULL) {
1113 X509_ATTRIBUTE *attr = NULL;
1114 ASN1_BMPSTRING *str = NULL;
1115 ASN1_TYPE *ty = NULL;
1119 if (fname != NULL)
1120 *fname = NULL;
1122 if (pkey == NULL || pkey->attributes == NULL) {
1131 if ((ty = attrib2type(attr)) == NULL ||
1138 if (attr != NULL)
1149 if (*fname == NULL) {
1163 * Look for a keyid in a stack of certs. if 'certs' is NULL and 'pkeys' is
1164 * not NULL, search the list of private keys. Move the matching cert to
1172 * This may be NULL, in which case no keys are returned.
1173 * certs - Points to a stack of certs to search. If NULL, search the
1177 * 'matching_pkey' must not be NULL; '*matching_pkey' will be
1181 * 'matching_cert' must not be NULL; '*matching_cert' will be
1194 ASN1_STRING *cmpstr = NULL;
1195 EVP_PKEY *tmp_pkey = NULL;
1196 X509 *tmp_cert = NULL;
1199 /* If NULL arguments, this is an error */
1200 if (keyid_str == NULL ||
1201 (pkeys == NULL || certs == NULL) ||
1202 (pkeys != NULL && matching_pkey == NULL) ||
1203 (certs != NULL && matching_cert == NULL)) {
1208 if (matching_pkey != NULL)
1209 *matching_pkey = NULL;
1210 if (matching_cert != NULL)
1211 *matching_cert = NULL;
1214 if (cmpstr == NULL ||
1227 if (matching_pkey != NULL)
1229 if (matching_cert != NULL)
1240 * Look for a friendlyname in a stack of certs. if 'certs' is NULL and 'pkeys'
1241 * is not NULL, search the list of private keys. Move the matching cert to
1246 * fname - Friendlyname to find (NULL-terminated ASCII string).
1248 * This may be NULL, in which case no keys are returned.
1249 * certs - Points to a stack of certs to search. If NULL, search the
1266 ASN1_STRING *cmpstr = NULL;
1267 EVP_PKEY *tmp_pkey = NULL;
1268 X509 *tmp_cert = NULL;
1271 /* If NULL arguments, this is an error */
1272 if (fname == NULL ||
1273 (pkeys == NULL && certs == NULL) ||
1274 (pkeys != NULL && matching_pkey == NULL) ||
1275 (certs != NULL && matching_cert == NULL)) {
1280 if (matching_pkey != NULL)
1281 *matching_pkey = NULL;
1282 if (matching_cert != NULL)
1283 *matching_cert = NULL;
1286 if (cmpstr == NULL) {
1300 if (matching_pkey != NULL)
1302 if (matching_cert != NULL)
1329 if (fname != NULL)
1330 *fname = NULL;
1332 if (cert == NULL || cert->aux == NULL || cert->aux->alias == NULL) {
1339 cert->aux->alias = NULL;
1344 if (*fname == NULL) {
1377 X509_ATTRIBUTE *attr = NULL;
1378 ASN1_BMPSTRING *str = NULL;
1379 ASN1_TYPE *fname = NULL;
1380 unsigned char *data = NULL;
1386 if (str == NULL) {
1393 if (cert != NULL) {
1394 if (cert->aux != NULL && cert->aux->alias != NULL) {
1405 if (pkey != NULL) {
1406 if ((fname = ASN1_TYPE_new()) == NULL) {
1412 str = NULL;
1415 if (attr == NULL) {
1421 fname = NULL;
1423 if (pkey->attributes == NULL) {
1425 if (pkey->attributes == NULL) {
1440 attr = NULL;
1445 if (data != NULL)
1447 if (str != NULL)
1449 if (fname != NULL)
1451 if (attr != NULL)
1474 if (pkey != NULL && cert != NULL)
1514 * pass - Pass phrase for the private key (possibly empty) or NULL if
1522 * to match. This value should be a NULL terminated string.
1545 STACK_OF(EVP_PKEY) *work_kl = NULL; /* Head for private key list */
1546 STACK_OF(EVP_PKEY) *nocerts = NULL; /* Head for alt. key list */
1547 STACK_OF(X509) *work_ca = NULL; /* Head for cert list */
1548 STACK_OF(X509) *work_cl = NULL;
1577 if (keyid == NULL) {
1595 if (name_str == NULL) {
1649 if (work_cl == NULL || sk_X509_num(work_cl) == 0)
1652 if (work_kl == NULL || sk_EVP_PKEY_num(work_kl) == 0)
1666 retval |= set_results(NULL, NULL, NULL, NULL, ca, &work_ca,
1667 NULL, NULL);
1674 if (pkey != NULL && *pkey != NULL) {
1676 *pkey = NULL;
1678 if (cert != NULL && *cert != NULL) {
1680 *cert = NULL;
1685 if (work_kl != NULL) {
1688 if (work_ca != NULL)
1690 if (work_cl != NULL)
1719 if ((asafes = M_PKCS12_unpack_authsafes(p12)) == NULL)
1738 if (bags == NULL) {
1803 X509_ATTRIBUTE *attr = NULL;
1804 ASN1_TYPE *keyid = NULL;
1805 ASN1_TYPE *fname = NULL;
1807 EVP_PKEY *pkey = NULL;
1808 X509 *x509 = NULL;
1809 uchar_t *data = NULL;
1810 char *str = NULL;
1818 if ((pkey = EVP_PKCS82PKEY(bag->value.keybag)) == NULL) {
1830 if ((p8 = M_PKCS12_decrypt_skey(bag, pass, -1)) == NULL) {
1837 if (pkey == NULL) {
1848 if ((x509 = M_PKCS12_certbag2x509(bag)) == NULL) {
1855 if (keyid != NULL) {
1872 if (fname != NULL) {
1873 ASN1_STRING *tmpstr = NULL;
1905 x509 = NULL;
1909 if (keyid != NULL)
1911 if (fname != NULL)
1922 if (keyid != NULL)
1924 if (fname != NULL)
1931 if (pkey != NULL) {
1932 if (retval != 0 && (keyid != NULL || fname != NULL) &&
1933 pkey->attributes == NULL) {
1935 if (pkey->attributes == NULL) {
1942 if (retval != 0 && keyid != NULL) {
1944 if (attr == NULL)
1950 keyid = NULL;
1957 attr = NULL;
1962 if (retval != 0 && fname != NULL) {
1964 if (attr == NULL) {
1970 fname = NULL;
1977 attr = NULL;
1989 pkey = NULL;
1994 if (pkey != NULL) {
1998 if (x509 != NULL)
2001 if (keyid != NULL)
2004 if (fname != NULL)
2007 if (attr != NULL)
2010 if (data != NULL)
2013 if (str != NULL)
2042 info = PEM_X509_INFO_read(fp, NULL, cb, userdata);
2043 if (info == NULL) {
2051 if ((work_kl = sk_EVP_PKEY_new_null()) == NULL) {
2057 if ((work_cl = sk_X509_new_null()) == NULL) {
2073 x->x509 = NULL;
2075 if (x->x_pkey != NULL && x->x_pkey->dec_pkey != NULL &&
2087 if (x->x_pkey->enc_pkey != NULL) {
2110 x->enc_len) == NULL) {
2122 x->enc_len) == NULL) {
2137 x->x_pkey->dec_pkey = NULL;
2138 } else if (x->x_pkey != NULL) {
2148 retval = set_results(pkeys, &work_kl, certs, &work_cl, NULL, NULL,
2149 NULL, NULL);
2152 if (work_kl != NULL) {
2155 if (work_cl != NULL)
2261 nk = (kl != NULL) ? sk_EVP_PKEY_num(kl) : 0;
2262 nc = (cl != NULL) ? sk_X509_num(cl) : 0;
2264 if (pkey != NULL && *pkey == NULL) {
2267 if (*pkey != NULL)
2272 if (cert != NULL && *cert == NULL) {
2275 if (*cert != NULL)
2293 * == NULL - An error occurred. Error information (accessible by
2295 * != NULL - Points to an ASN1_BMPSTRING structure with the converted
2301 ASN1_BMPSTRING *bmp = NULL;
2302 uchar_t *uni = NULL;
2312 return (NULL);
2316 * Adjust for possible pair of NULL bytes at the end because
2324 if (bmp == NULL) {
2327 return (NULL);
2345 * == NULL - An error occurred. Error information (accessible by
2347 * != NULL - Points to a NULL-termianted ASCII string. The caller must
2355 uchar_t *retstr = NULL;
2359 if (ustr == NULL || ustr->type != V_ASN1_UTF8STRING) {
2361 return (NULL);
2365 tmpstr.data = NULL;
2372 return (NULL);
2376 if (retstr == NULL) {
2378 return (NULL);
2398 * NULL An error occurred.
2399 * != NULL An X509_ATTRIBUTE structure.
2406 if ((a = X509_ATTRIBUTE_new()) == NULL ||
2407 (a->value.set = sk_ASN1_TYPE_new_null()) == NULL ||
2409 if (a != NULL)
2412 return (NULL);
2428 * NULL An error occurred.
2429 * != NULL An ASN1_TYPE structure.
2434 ASN1_TYPE *ty = NULL;
2436 if (attr == NULL || attr->single == 1)
2437 return (NULL);
2463 if (attrs == NULL)
2528 i = X509_cmp_time(X509_get_notBefore(cert), NULL);
2538 i = X509_cmp_time(X509_get_notAfter(cert), NULL);
2597 ASN1_UTF8STRING *ustr = NULL;
2601 uchar_t *fname = NULL;
2610 chkcerts = (cert != NULL || pkey != NULL) && cl != NULL;
2614 if (ustr == NULL) {
2619 if (fname == NULL) {
2637 if (nid == NID_friendlyName && ustr != NULL) {
2638 if (x->aux == NULL || x->aux->alias == NULL)
2641 if (s != NULL && s->type == ustr->type &&
2642 s->data != NULL) {
2646 if (x->aux == NULL || x->aux->keyid == NULL)
2649 if (s != NULL && s->type == str->type &&
2650 s->data != NULL) {
2655 if (cert != NULL)
2661 if (ustr != NULL) {
2667 if (pkey != NULL && kl != NULL) {
2674 if (found != 0 && cert != NULL) {
2678 if (pkey != NULL)
2682 } else if (cert == NULL) {
2685 if (p == NULL || p->attributes == NULL)
2689 if (t != NULL || ASN1_STRING_cmp(str,
2694 if (pkey != NULL)
2723 * - If either the first or second argument is NULL, or if there are no
2725 * - If the first argument points to a pointer which is NULL, then there
2727 * from the second argument to the first argument and NULL out the stack
2746 if (pkeys != NULL && work_kl != NULL && *work_kl != NULL &&
2748 if (*pkeys == NULL) {
2750 *work_kl = NULL;
2758 if (certs != NULL && work_cl != NULL && *work_cl != NULL &&
2760 if (*certs == NULL) {
2762 *work_cl = NULL;
2771 if (cacerts != NULL && work_ca != NULL && *work_ca != NULL &&
2773 if (*cacerts == NULL) {
2775 *work_ca = NULL;
2784 if (xtrakeys != NULL && work_xl != NULL && *work_xl != NULL &&
2786 if (*xtrakeys == NULL) {
2788 *work_xl = NULL;