Skip to content

Commit 9ea7e85

Browse files
olszomalmtrojnar
authored andcommitted
Fix engine-less builds
1 parent 68e8845 commit 9ea7e85

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

osslsigncode.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4242,15 +4242,19 @@ static int read_crypto_params(GLOBAL_OPTIONS *options)
42424242
else if (options->p11engine) {
42434243
if(!engine_load(options))
42444244
goto out;
4245+
}
42454246
#endif /* OPENSSL_NO_ENGINE */
4246-
} else if (options->p11module) {
4247+
else if (options->p11module) {
42474248
#if OPENSSL_VERSION_NUMBER>=0x30000000L
42484249
/* Try to load PKCS#11 provider first */
42494250
if ((options->provider && provider_load(options->provider)) || provider_load("pkcs11prov")) {
42504251
load_objects_from_store(options->keyfile, options->pass, &options->pkey, NULL, NULL);
42514252
load_objects_from_store(options->p11cert, options->pass, NULL, options->certs, NULL);
4252-
} else
4253+
}
42534254
#endif /* OPENSSL_VERSION_NUMBER>=0x30000000L */
4255+
#if !defined(OPENSSL_NO_ENGINE) && OPENSSL_VERSION_NUMBER>=0x30000000L
4256+
else
4257+
#endif /* !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L */
42544258
#ifndef OPENSSL_NO_ENGINE
42554259
/* try to find and load libp11 'pkcs11' engine */
42564260
if (!engine_load(options))
@@ -4280,9 +4284,9 @@ static int read_crypto_params(GLOBAL_OPTIONS *options)
42804284
if (sk_X509_num(options->certs) == 0 && !read_pkcs7_certfile(options)) {
42814285
return 0; /* FAILED */
42824286
}
4283-
#if !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L
4287+
#if !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER<0x1010108f
42844288
out:
4285-
#endif /* !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L */
4289+
#endif /* !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER<0x1010108f */
42864290
return (options->pkey && sk_X509_num(options->certs) > 0) ? 1 : 0;
42874291
}
42884292

osslsigncode.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,13 @@ typedef struct {
268268
int output_pkcs7;
269269
#ifndef OPENSSL_NO_ENGINE
270270
char *p11engine;
271-
char *p11module;
272-
char *p11cert;
273-
int login;
274271
STACK_OF(EngineControl) *engine_ctrls;
272+
int login;
275273
#endif /* OPENSSL_NO_ENGINE */
274+
#if !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L
275+
char *p11module;
276+
char *p11cert;
277+
#endif /* !defined(OPENSSL_NO_ENGINE) || OPENSSL_VERSION_NUMBER>=0x30000000L */
276278
int askpass;
277279
char *readpass;
278280
char *pass;

0 commit comments

Comments
 (0)