Gert Doering has submitted this change. ( 
https://gerrit.openvpn.net/c/openvpn/+/2087?usp=email )

Change subject: Use ASN1_STRING_get_length instead of ASN1_STRING_length
......................................................................

Use ASN1_STRING_get_length instead of ASN1_STRING_length

OpenSSL 4.1 introduced ASN1_STRING_get_length and at the same
time deprecated the ASN1_STRING_length method. Use the
new method and add a compat macro for older versions and
other OpenSSL like libraries.

Change-Id: I1bff3107f95b403d554bea4262c2dda270a1fc79
Signed-off-by: Arne Schwabe <[email protected]>
Acked-by: Razvan Cojocaru <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2087
Message-Id: <[email protected]>
URL: 
https://www.mail-archive.com/[email protected]/msg40439.html
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/openssl_compat.h
M src/openvpn/ssl_verify_openssl.c
2 files changed, 6 insertions(+), 1 deletion(-)




diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h
index 4305fea..8309cee 100644
--- a/src/openvpn/openssl_compat.h
+++ b/src/openvpn/openssl_compat.h
@@ -204,4 +204,9 @@
 #define EVP_CIPH_FLAG_ENC_THEN_MAC 0x10000000
 #endif

+/* Introduced in OpenSSL 4.1.0 */
+#if OPENSSL_VERSION_NUMBER < 0x40100000
+#define ASN1_STRING_get_length (size_t)ASN1_STRING_length
+#endif
+
 #endif /* OPENSSL_COMPAT_H_ */
diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_openssl.c
index 146a384..0c36cf2 100644
--- a/src/openvpn/ssl_verify_openssl.c
+++ b/src/openvpn/ssl_verify_openssl.c
@@ -154,7 +154,7 @@
                     {
                         continue;
                     }
-                    if ((ssize_t)strlen(buf) != 
ASN1_STRING_length(name->d.rfc822Name))
+                    if (strlen(buf) != 
ASN1_STRING_get_length(name->d.rfc822Name))
                     {
                         msg(D_TLS_ERRORS, "ASN1 ERROR: string contained 
terminating zero");
                     }

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2087?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I1bff3107f95b403d554bea4262c2dda270a1fc79
Gerrit-Change-Number: 2087
Gerrit-PatchSet: 3
Gerrit-Owner: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Răzvan Cojocaru <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to