From: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Date: Mon, 16 Aug 2021 12:43:02 +0000 (+0300) Subject: Build with OpenSSL 3.0 beta 2 Release Candidate X-Git-Tag: v8.20~69^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c7313bd43846ba641c820716051e5b09615072e9;p=users%2Fdwmw2%2Fopenconnect.git Build with OpenSSL 3.0 beta 2 Release Candidate I had forgotten this ERR_GET_FUNC() call in my previous patch !262. Again, removing calls to ERR_GET_FUNC() will not change anything: PKCS11_F_PKCS11_LOGIN / ERR_LIB_PKCS11 We check the function code is PKCS11_F_PKCS11_LOGIN right after calling PKCS11_login(). Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> --- diff --git a/openssl-pkcs11.c b/openssl-pkcs11.c index f7eb3adc..0cb6d936 100644 --- a/openssl-pkcs11.c +++ b/openssl-pkcs11.c @@ -258,8 +258,12 @@ static int slot_login(struct openconnect_info *vpninfo, struct cert_info *certin ret = PKCS11_login(slot, 0, cache ? cache->pin : NULL); if (ret) { unsigned long err = ERR_peek_error(); +#if OPENSSL_VERSION_NUMBER < 0x30000000L if (ERR_GET_LIB(err) == ERR_LIB_PKCS11 && ERR_GET_FUNC(err) == PKCS11_F_PKCS11_LOGIN) +#else + if (ERR_GET_LIB(err) == ERR_LIB_PKCS11) +#endif err = ERR_GET_REASON(err); else err = CKR_OK; /* Anything we don't explicitly match */