Lines Matching refs:NULL

59     char *prompt = NULL;  in DEFINE_STACK_OF()
61 if (ui == NULL) { in DEFINE_STACK_OF()
63 return NULL; in DEFINE_STACK_OF()
66 if (ui_method != NULL) in DEFINE_STACK_OF()
70 if ((prompt = UI_construct_prompt(ui, desc, info)) == NULL) { in DEFINE_STACK_OF()
72 pass = NULL; in DEFINE_STACK_OF()
76 pass = NULL; in DEFINE_STACK_OF()
81 pass = NULL; in DEFINE_STACK_OF()
85 pass = NULL; in DEFINE_STACK_OF()
108 if (pass_data == NULL) in file_fill_pem_pass_data()
125 return pass == NULL ? 0 : strlen(pass); in file_get_pem_pass()
138 const char *p = NULL; in check_suffix()
179 if (info != NULL && (data = get0_EMBEDDED(info)) != NULL) { in store_info_free()
190 OSSL_STORE_INFO *info = NULL; in new_EMBEDDED()
191 struct embedded_st *data = NULL; in new_EMBEDDED()
193 if ((data = OPENSSL_zalloc(sizeof(*data))) == NULL) in new_EMBEDDED()
194 return NULL; in new_EMBEDDED()
195 if ((info = OSSL_STORE_INFO_new(STORE_INFO_EMBEDDED, data)) == NULL) { in new_EMBEDDED()
198 return NULL; in new_EMBEDDED()
203 new_pem_name == NULL ? NULL : OPENSSL_strdup(new_pem_name); in new_EMBEDDED()
205 if (new_pem_name != NULL && data->pem_name == NULL) { in new_EMBEDDED()
207 info = NULL; in new_EMBEDDED()
303 OSSL_STORE_INFO *store_info = NULL; in try_decode_PKCS12()
306 if (ctx == NULL) { in try_decode_PKCS12()
310 if (pem_name != NULL) in try_decode_PKCS12()
312 return NULL; in try_decode_PKCS12()
314 if ((p12 = d2i_PKCS12(NULL, &blob, len)) != NULL) { in try_decode_PKCS12()
315 char *pass = NULL; in try_decode_PKCS12()
317 EVP_PKEY *pkey = NULL; in try_decode_PKCS12()
318 X509 *cert = NULL; in try_decode_PKCS12()
319 STACK_OF(X509) *chain = NULL; in try_decode_PKCS12()
325 || PKCS12_verify_mac(p12, NULL, 0)) { in try_decode_PKCS12()
330 ui_data)) == NULL) { in try_decode_PKCS12()
341 OSSL_STORE_INFO *osi_pkey = NULL; in try_decode_PKCS12()
342 OSSL_STORE_INFO *osi_cert = NULL; in try_decode_PKCS12()
343 OSSL_STORE_INFO *osi_ca = NULL; in try_decode_PKCS12()
346 if ((ctx = sk_OSSL_STORE_INFO_new_null()) != NULL) { in try_decode_PKCS12()
347 if (pkey != NULL) { in try_decode_PKCS12()
348 if ((osi_pkey = OSSL_STORE_INFO_new_PKEY(pkey)) != NULL in try_decode_PKCS12()
350 && (pkey = NULL) == NULL in try_decode_PKCS12()
352 osi_pkey = NULL; in try_decode_PKCS12()
356 if (ok && cert != NULL) { in try_decode_PKCS12()
357 if ((osi_cert = OSSL_STORE_INFO_new_CERT(cert)) != NULL in try_decode_PKCS12()
359 && (cert = NULL) == NULL in try_decode_PKCS12()
361 osi_cert = NULL; in try_decode_PKCS12()
368 if ((osi_ca = OSSL_STORE_INFO_new_CERT(ca)) != NULL in try_decode_PKCS12()
369 && sk_X509_shift(chain) != NULL in try_decode_PKCS12()
371 osi_ca = NULL; in try_decode_PKCS12()
384 ctx = NULL; in try_decode_PKCS12()
391 if (ctx == NULL) in try_decode_PKCS12()
392 return NULL; in try_decode_PKCS12()
404 return ctx == NULL || sk_OSSL_STORE_INFO_num(ctx) == 0; in eof_PKCS12()
412 *pctx = NULL; in destroy_ctx_PKCS12()
439 X509_SIG *p8 = NULL; in try_decode_PKCS8Encrypted()
441 char *pass = NULL; in try_decode_PKCS8Encrypted()
442 const X509_ALGOR *dalg = NULL; in try_decode_PKCS8Encrypted()
443 const ASN1_OCTET_STRING *doct = NULL; in try_decode_PKCS8Encrypted()
444 OSSL_STORE_INFO *store_info = NULL; in try_decode_PKCS8Encrypted()
445 BUF_MEM *mem = NULL; in try_decode_PKCS8Encrypted()
446 unsigned char *new_data = NULL; in try_decode_PKCS8Encrypted()
449 if (pem_name != NULL) { in try_decode_PKCS8Encrypted()
451 return NULL; in try_decode_PKCS8Encrypted()
455 if ((p8 = d2i_X509_SIG(NULL, &blob, len)) == NULL) in try_decode_PKCS8Encrypted()
456 return NULL; in try_decode_PKCS8Encrypted()
460 if ((mem = BUF_MEM_new()) == NULL) { in try_decode_PKCS8Encrypted()
467 ui_data)) == NULL) { in try_decode_PKCS8Encrypted()
480 p8 = NULL; in try_decode_PKCS8Encrypted()
483 if (store_info == NULL) { in try_decode_PKCS8Encrypted()
492 return NULL; in try_decode_PKCS8Encrypted()
515 OSSL_STORE_INFO *store_info = NULL; in try_decode_PrivateKey()
516 EVP_PKEY *pkey = NULL; in try_decode_PrivateKey()
517 const EVP_PKEY_ASN1_METHOD *ameth = NULL; in try_decode_PrivateKey()
519 if (pem_name != NULL) { in try_decode_PrivateKey()
522 d2i_PKCS8_PRIV_KEY_INFO(NULL, &blob, len); in try_decode_PrivateKey()
525 if (p8inf != NULL) in try_decode_PrivateKey()
533 && (ameth = EVP_PKEY_asn1_find_str(NULL, pem_name, in try_decode_PrivateKey()
534 slen)) != NULL in try_decode_PrivateKey()
535 && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, in try_decode_PrivateKey()
538 pkey = d2i_PrivateKey_ex(pkey_id, NULL, &blob, len, in try_decode_PrivateKey()
547 while (curengine != NULL) { in try_decode_PrivateKey()
551 if (asn1meths != NULL) { in try_decode_PrivateKey()
552 const int *nids = NULL; in try_decode_PrivateKey()
553 int nids_n = asn1meths(curengine, NULL, &nids, 0); in try_decode_PrivateKey()
556 EVP_PKEY_ASN1_METHOD *ameth2 = NULL; in try_decode_PrivateKey()
557 EVP_PKEY *tmp_pkey = NULL; in try_decode_PrivateKey()
561 if (!asn1meths(curengine, &ameth2, NULL, nids[i]) in try_decode_PrivateKey()
562 || !EVP_PKEY_asn1_get0_info(&pkey_id, NULL, in try_decode_PrivateKey()
563 &pkey_flags, NULL, NULL, in try_decode_PrivateKey()
569 tmp_pkey = d2i_PrivateKey_ex(pkey_id, NULL, in try_decode_PrivateKey()
572 if (tmp_pkey != NULL) { in try_decode_PrivateKey()
573 if (pkey != NULL) in try_decode_PrivateKey()
587 EVP_PKEY *tmp_pkey = NULL; in try_decode_PrivateKey()
592 if (!EVP_PKEY_asn1_get0_info(&pkey_id, NULL, &pkey_flags, NULL, in try_decode_PrivateKey()
593 NULL, ameth) in try_decode_PrivateKey()
598 tmp_pkey = d2i_PrivateKey_ex(pkey_id, NULL, &tmp_blob, len, in try_decode_PrivateKey()
600 if (tmp_pkey != NULL) { in try_decode_PrivateKey()
601 if (pkey != NULL) in try_decode_PrivateKey()
612 pkey = NULL; in try_decode_PrivateKey()
615 if (pkey == NULL) in try_decode_PrivateKey()
617 return NULL; in try_decode_PrivateKey()
620 if (store_info == NULL) in try_decode_PrivateKey()
644 OSSL_STORE_INFO *store_info = NULL; in try_decode_PUBKEY()
645 EVP_PKEY *pkey = NULL; in try_decode_PUBKEY()
647 if (pem_name != NULL) { in try_decode_PUBKEY()
650 return NULL; in try_decode_PUBKEY()
654 if ((pkey = d2i_PUBKEY(NULL, &blob, len)) != NULL) { in try_decode_PUBKEY()
680 OSSL_STORE_INFO *store_info = NULL; in try_decode_params()
681 EVP_PKEY *pkey = NULL; in try_decode_params()
682 const EVP_PKEY_ASN1_METHOD *ameth = NULL; in try_decode_params()
684 if (pem_name != NULL) { in try_decode_params()
689 && (ameth = EVP_PKEY_asn1_find_str(NULL, pem_name, slen)) != NULL in try_decode_params()
690 && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, in try_decode_params()
693 pkey = d2i_KeyParams(pkey_id, NULL, &blob, len); in try_decode_params()
699 EVP_PKEY *tmp_pkey = NULL; in try_decode_params()
704 if (!EVP_PKEY_asn1_get0_info(&pkey_id, NULL, &pkey_flags, NULL, in try_decode_params()
705 NULL, ameth) in try_decode_params()
711 tmp_pkey = d2i_KeyParams(pkey_id, NULL, &tmp_blob, len); in try_decode_params()
713 if (tmp_pkey != NULL) { in try_decode_params()
714 if (pkey != NULL) in try_decode_params()
725 pkey = NULL; in try_decode_params()
728 if (pkey == NULL) in try_decode_params()
730 return NULL; in try_decode_params()
733 if (store_info == NULL) in try_decode_params()
758 OSSL_STORE_INFO *store_info = NULL; in try_decode_X509Certificate()
759 X509 *cert = NULL; in try_decode_X509Certificate()
770 if (pem_name != NULL) { in try_decode_X509Certificate()
776 return NULL; in try_decode_X509Certificate()
781 if (cert == NULL) in try_decode_X509Certificate()
782 return NULL; in try_decode_X509Certificate()
784 if ((d2i_X509_AUX(&cert, &blob, len)) != NULL in try_decode_X509Certificate()
785 || (ignore_trusted && (d2i_X509(&cert, &blob, len)) != NULL)) { in try_decode_X509Certificate()
790 if (store_info == NULL) in try_decode_X509Certificate()
814 OSSL_STORE_INFO *store_info = NULL; in try_decode_X509CRL()
815 X509_CRL *crl = NULL; in try_decode_X509CRL()
817 if (pem_name != NULL) { in try_decode_X509CRL()
820 return NULL; in try_decode_X509CRL()
824 if ((crl = d2i_X509_CRL(NULL, &blob, len)) != NULL) { in try_decode_X509CRL()
829 if (store_info == NULL) in try_decode_X509CRL()
911 if (ctx == NULL) in OSSL_STORE_LOADER_CTX_free()
917 if (ctx->_.file.last_handler != NULL) { in OSSL_STORE_LOADER_CTX_free()
919 ctx->_.file.last_handler_ctx = NULL; in OSSL_STORE_LOADER_CTX_free()
920 ctx->_.file.last_handler = NULL; in OSSL_STORE_LOADER_CTX_free()
928 BIO *buff = NULL; in file_find_type()
931 if ((buff = BIO_new(BIO_f_buffer())) == NULL) in file_find_type()
937 if (strstr(peekbuf, "-----BEGIN ") != NULL) in file_find_type()
948 OSSL_STORE_LOADER_CTX *ctx = NULL; in file_open_ex()
978 return NULL; in file_open_ex()
999 for (i = 0, path = NULL; path == NULL && i < path_data_n; i++) { in file_open_ex()
1007 return NULL; in file_open_ex()
1018 if (path == NULL) { in file_open_ex()
1019 return NULL; in file_open_ex()
1025 if (ctx == NULL) in file_open_ex()
1026 return NULL; in file_open_ex()
1028 if (ctx->uri == NULL) in file_open_ex()
1035 if (ctx->_.dir.last_entry == NULL) { in file_open_ex()
1042 } else if ((ctx->_.file.file = BIO_new_file(path, "rb")) == NULL in file_open_ex()
1047 if (propq != NULL) { in file_open_ex()
1049 if (ctx->propq == NULL) in file_open_ex()
1057 return NULL; in file_open_ex()
1064 return file_open_ex(loader, uri, NULL, NULL, ui_method, ui_data); in file_open()
1072 OSSL_STORE_LOADER_CTX *ctx = NULL; in file_attach()
1074 if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL in file_attach()
1075 || (propq != NULL && (ctx->propq = OPENSSL_strdup(propq)) == NULL)) { in file_attach()
1077 return NULL; in file_attach()
1084 ctx->_.file.file = NULL; in file_attach()
1090 return NULL; in file_attach()
1140 if (ctx == NULL) in file_find()
1149 NULL, NULL, NULL); in file_find()
1155 if (ctx != NULL) in file_find()
1167 OSSL_STORE_INFO *result = NULL; in file_load_try_decode()
1168 BUF_MEM *new_mem = NULL; in file_load_try_decode()
1169 char *new_pem_name = NULL; in file_load_try_decode()
1175 void *handler_ctx = NULL; in file_load_try_decode()
1180 if (matching_handlers == NULL) in file_load_try_decode()
1187 void *tmp_handler_ctx = NULL; in file_load_try_decode()
1217 if (handler->destroy_ctx != NULL) in file_load_try_decode()
1219 handler_ctx = NULL; in file_load_try_decode()
1220 tmp_result = NULL; in file_load_try_decode()
1221 result = NULL; in file_load_try_decode()
1223 if (result == NULL) in file_load_try_decode()
1225 if (result == NULL) /* e.g., PKCS#12 file decryption error */ in file_load_try_decode()
1230 if (result != NULL in file_load_try_decode()
1243 if (result != NULL in file_load_try_decode()
1252 embedded->pem_name = NULL; in file_load_try_decode()
1253 embedded->blob = NULL; in file_load_try_decode()
1256 result = NULL; in file_load_try_decode()
1267 OSSL_STORE_INFO *result = NULL; in file_load_try_repeat()
1270 if (ctx->_.file.last_handler != NULL) { in file_load_try_repeat()
1272 ctx->_.file.last_handler->try_decode(NULL, NULL, NULL, 0, in file_load_try_repeat()
1278 if (result == NULL) { in file_load_try_repeat()
1280 ctx->_.file.last_handler_ctx = NULL; in file_load_try_repeat()
1281 ctx->_.file.last_handler = NULL; in file_load_try_repeat()
1330 OSSL_STORE_INFO *result = NULL; in file_try_read_msblob()
1353 if (tmp == NULL in file_try_read_msblob()
1354 || (result = OSSL_STORE_INFO_new_PKEY(tmp)) == NULL) { in file_try_read_msblob()
1367 OSSL_STORE_INFO *result = NULL; in file_try_read_PVK()
1383 EVP_PKEY *tmp = NULL; in file_try_read_PVK()
1388 || (tmp = b2i_PVK_bio(bp, file_get_pem_pass, &pass_data)) == NULL in file_try_read_PVK()
1389 || (result = OSSL_STORE_INFO_new_PKEY(tmp)) == NULL) { in file_try_read_PVK()
1400 BUF_MEM *mem = NULL; in file_read_asn1()
1415 assert(name != NULL); in file_name_to_uri()
1416 assert(data != NULL); in file_name_to_uri()
1423 if (*data == NULL) in file_name_to_uri()
1435 const char *p = NULL; in file_name_check()
1501 OSSL_STORE_INFO *result = NULL; in file_load()
1507 char *newname = NULL; in file_load()
1509 if (ctx->_.dir.last_entry == NULL) { in file_load()
1515 return NULL; in file_load()
1521 return NULL; in file_load()
1531 if (ctx->_.dir.last_entry == NULL && ctx->_.dir.last_errno == 0) in file_load()
1534 if (newname != NULL in file_load()
1535 && (result = OSSL_STORE_INFO_new_NAME(newname)) == NULL) { in file_load()
1538 return NULL; in file_load()
1540 } while (result == NULL && !file_eof(ctx)); in file_load()
1546 if (result != NULL) in file_load()
1550 return NULL; in file_load()
1553 char *pem_name = NULL; /* PEM record name */ in file_load()
1554 char *pem_header = NULL; /* PEM record header */ in file_load()
1555 unsigned char *data = NULL; /* DER encoded data */ in file_load()
1568 &matchcount)) != NULL in file_load()
1571 &matchcount)) != NULL) in file_load()
1583 if (result != NULL) in file_load()
1590 if (!ossl_assert(pem_name == NULL || matchcount <= 1)) { in file_load()
1604 if (pem_name != NULL) in file_load()
1620 return NULL; in file_load()
1623 if (result != NULL in file_load()
1644 if (ctx->_.file.last_handler != NULL in file_eof()
1667 ctx->_.file.file = NULL; in file_close()
1682 static OSSL_STORE_LOADER *loader_attic = NULL;
1700 if (loader == NULL) in loader_attic_destroy()
1715 (loader_attic = OSSL_STORE_LOADER_new(e, "file")) == NULL in bind_loader_attic()
1735 loader_attic = NULL; in bind_loader_attic()