]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Build with OpenSSL 3.0 beta 2 Release Candidate
authorDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Mon, 16 Aug 2021 12:43:02 +0000 (15:43 +0300)
committerDimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
Mon, 16 Aug 2021 13:10:57 +0000 (16:10 +0300)
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>
openssl-pkcs11.c

index f7eb3adc6f370ab9b8f5c8fa0a6a2f7bdc623f79..0cb6d9362397f057081460eb5df0abafae09e929 100644 (file)
@@ -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 */