From 62438908cbed8b1a0c922e516cf2776bf0e28db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Trojnara?= Date: Fri, 30 May 2025 16:57:25 +0200 Subject: [PATCH] Skip the "lib" prefix when guessing engine ID Fix #436 --- osslsigncode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osslsigncode.c b/osslsigncode.c index ecfe958..5f7e7a7 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -4141,9 +4141,11 @@ static ENGINE *engine_dynamic(GLOBAL_OPTIONS *options) ptr = strrchr(options->p11engine, '/'); if (!ptr) /* no slash -> try backslash */ ptr = strrchr(options->p11engine, '\\'); - if (ptr) /* directory separator found */ + if (ptr) { /* directory separator found */ ptr++; /* skip it */ - else /* directory separator not found */ + if (!strncmp(ptr, "lib", 3)) + ptr += 3; /* skip the "lib" prefix */ + } else /* directory separator not found */ ptr = options->p11engine; id = OPENSSL_strdup(ptr); ptr = strchr(id, '.');