Skip to content

Commit 16c5e5a

Browse files
olszomalmtrojnar
authored andcommitted
Squashed logically dead code for curl response code for openssl version 3.0.0 and later, CID 1585046
1 parent ded1f7a commit 16c5e5a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

osslsigncode.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,11 @@ static int add_timestamp(PKCS7 *p7, FILE_FORMAT_CTX *ctx, char *url, int rfc3161
974974
BIO *req, *resp;
975975
int verbose = ctx->options->verbose || ctx->options->ntsurl == 1;
976976
int res = 1;
977+
#if OPENSSL_VERSION_NUMBER<0x30000000L
978+
#ifdef ENABLE_CURL
977979
long http_code = -1;
980+
#endif /* ENABLE_CURL */
981+
#endif /* OPENSSL_VERSION_NUMBER<0x30000000L */
978982

979983
/* Encode timestamp request */
980984
if (rfc3161) {
@@ -1027,12 +1031,15 @@ static int add_timestamp(PKCS7 *p7, FILE_FORMAT_CTX *ctx, char *url, int rfc3161
10271031
res = attach_authenticode_response(p7, response, verbose);
10281032
}
10291033
if (res && verbose) {
1030-
if (http_code != -1) {
1034+
#if OPENSSL_VERSION_NUMBER<0x30000000L
1035+
#ifdef ENABLE_CURL
1036+
if (http_code != -1)
10311037
printf("Failed to convert timestamp reply from %s; "
10321038
"HTTP status %ld\n", url, http_code);
1033-
} else {
1039+
else
1040+
#endif /* ENABLE_CURL */
1041+
#endif /* OPENSSL_VERSION_NUMBER<0x30000000L */
10341042
printf("Failed to convert timestamp reply from %s\n", url);
1035-
}
10361043
ERR_print_errors_fp(stdout);
10371044
}
10381045
BIO_free_all(resp);

0 commit comments

Comments
 (0)