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>
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 */