Changeset 97372 in vbox for trunk/src/libs/openssl-3.0.7/apps/lib/apps.c
- Timestamp:
- Nov 2, 2022 7:40:16 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 154372
- Location:
- trunk/src/libs/openssl-3.0.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/openssl-3.0.7
- Property svn:mergeinfo
-
old new 15 15 /vendor/openssl/3.0.2:150728-150729 16 16 /vendor/openssl/3.0.3:151497-151729 17 /vendor/openssl/current:147554-151496 17 /vendor/openssl/3.0.7:154371 18 /vendor/openssl/current:147554-154370
-
- Property svn:mergeinfo
-
trunk/src/libs/openssl-3.0.7/apps/lib/apps.c
r95219 r97372 1187 1187 else if (OPENSSL_strcasecmp(arg, "iso_8601") == 0) 1188 1188 *dateopt = ASN1_DTFLGS_ISO8601; 1189 return 0; 1189 else 1190 return 0; 1191 return 1; 1190 1192 } 1191 1193 … … 1370 1372 goto end; 1371 1373 if (CAfile != NULL) { 1372 if ( !X509_LOOKUP_load_file_ex(lookup, CAfile, X509_FILETYPE_PEM,1373 libctx, propq) ) {1374 if (X509_LOOKUP_load_file_ex(lookup, CAfile, X509_FILETYPE_PEM, 1375 libctx, propq) <= 0) { 1374 1376 BIO_printf(bio_err, "Error loading file %s\n", CAfile); 1375 1377 goto end; … … 1386 1388 goto end; 1387 1389 if (CApath != NULL) { 1388 if ( !X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM)) {1390 if (X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM) <= 0) { 1389 1391 BIO_printf(bio_err, "Error loading directory %s\n", CApath); 1390 1392 goto end; … … 1455 1457 #undef BSIZE 1456 1458 #define BSIZE 256 1457 BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai) 1459 BIGNUM *load_serial(const char *serialfile, int *exists, int create, 1460 ASN1_INTEGER **retai) 1458 1461 { 1459 1462 BIO *in = NULL; … … 1467 1470 1468 1471 in = BIO_new_file(serialfile, "r"); 1472 if (exists != NULL) 1473 *exists = in != NULL; 1469 1474 if (in == NULL) { 1470 1475 if (!create) { … … 1474 1479 ERR_clear_error(); 1475 1480 ret = BN_new(); 1476 if (ret == NULL || !rand_serial(ret, ai))1481 if (ret == NULL) { 1477 1482 BIO_printf(bio_err, "Out of memory\n"); 1483 } else if (!rand_serial(ret, ai)) { 1484 BIO_printf(bio_err, "Error creating random number to store in %s\n", 1485 serialfile); 1486 BN_free(ret); 1487 ret = NULL; 1488 } 1478 1489 } else { 1479 1490 if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) { … … 1489 1500 } 1490 1501 1491 if (ret && retai) {1502 if (ret != NULL && retai != NULL) { 1492 1503 *retai = ai; 1493 1504 ai = NULL; 1494 1505 } 1495 1506 err: 1496 ERR_print_errors(bio_err); 1507 if (ret == NULL) 1508 ERR_print_errors(bio_err); 1497 1509 BIO_free(in); 1498 1510 ASN1_INTEGER_free(ai); … … 2457 2469 SSL_CTX *ssl_ctx = info->ssl_ctx; 2458 2470 2459 if (connect && detail) { /* connecting with TLS */ 2471 if (ssl_ctx == NULL) /* not using TLS */ 2472 return bio; 2473 if (connect) { 2460 2474 SSL *ssl; 2461 2475 BIO *sbio = NULL; … … 2535 2549 ERR_raise_data(ERR_LIB_HTTP, ERR_R_PASSED_NULL_PARAMETER, 2536 2550 "missing SSL_CTX"); 2551 goto end; 2552 } 2553 if (!use_ssl && ssl_ctx != NULL) { 2554 ERR_raise_data(ERR_LIB_HTTP, ERR_R_PASSED_INVALID_ARGUMENT, 2555 "SSL_CTX given but use_ssl == 0"); 2537 2556 goto end; 2538 2557 } … … 2918 2937 void *prefix = NULL; 2919 2938 2939 if (b == NULL) 2940 return NULL; 2941 2920 2942 #ifdef OPENSSL_SYS_VMS 2921 2943 if (FMT_istext(format)) … … 2937 2959 BIO_NOCLOSE | (FMT_istext(format) ? BIO_FP_TEXT : 0)); 2938 2960 #ifdef OPENSSL_SYS_VMS 2939 if ( FMT_istext(format))2961 if (b != NULL && FMT_istext(format)) 2940 2962 b = BIO_push(BIO_new(BIO_f_linebuffer()), b); 2941 2963 #endif
Note:
See TracChangeset
for help on using the changeset viewer.