Skip to content

Commit bcceded

Browse files
astos-marcbcron2
authored andcommitted
unify code path for adding PKCS#11 providers
Use existing wrapper for pkcs11h_addProvider to have arguments with "magic values" for pkcs11-helper call in a central place. Slot event argument to pkcs11h_addProvider has NOT been a boolean for at least 15 years. Luckily the default is PKCS11H_SLOTEVENT_METHOD_AUTO=0=FALSE. Signed-off-by: Marc Becker <marc.becker@astos.de> Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Message-Id: <20221211190913.190-1-marc.becker@astos.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25642.html Signed-off-by: Gert Doering <gert@greenie.muc.de> (cherry picked from commit 8958a36)
1 parent f8e576e commit bcceded

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/openvpn/pkcs11.c

+2-12
Original file line numberDiff line numberDiff line change
@@ -853,19 +853,9 @@ show_pkcs11_ids(
853853
goto cleanup;
854854
}
855855

856-
if (
857-
(rv = pkcs11h_addProvider(
858-
provider,
859-
provider,
860-
TRUE,
861-
0,
862-
FALSE,
863-
0,
864-
cert_private ? TRUE : FALSE
865-
)) != CKR_OK
866-
)
856+
if (!pkcs11_addProvider(provider, TRUE, 0, cert_private ? TRUE : FALSE))
867857
{
868-
msg(M_FATAL, "PKCS#11: Cannot add provider '%s' %ld-'%s'", provider, rv, pkcs11h_getMessage(rv));
858+
msg(M_FATAL, "Failed to add PKCS#11 provider '%s", provider);
869859
goto cleanup;
870860
}
871861

0 commit comments

Comments
 (0)