Change in openvpn[master]: Remove support for NTLM v1 proxy authentication
A message that is not in the archive (sent off-list or not yet received): gerrit.1699031887000.I0dcb2dac4136f194da7050a8ea8495e9faba9dd9@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/379?usp=email
to review the following change.
Change subject: Remove support for NTLM v1 proxy authentication
......................................................................
Remove support for NTLM v1 proxy authentication
Due to the limitation of the protocol it is not considered secure. Better to use basic auth instead of a false sense of security. NTLM v2 remains supported for now.
---
M doc/man-sections/proxy-options.rst
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls.c
M src/openvpn/crypto_openssl.c
M src/openvpn/ntlm.c
M src/openvpn/options.c
M src/openvpn/proxy.c
M src/openvpn/proxy.h
M tests/unit_tests/openvpn/test_crypto.c
9 files changed, 95 insertions(+), 225 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/79/379/1
doc/man-sections/proxy-options.rst +4 -2
@@ -11,7 +11,7 @@ ``--http-proxy-user-pass`` option. (See section on inline files) The last optional argument is an ``auth-method`` which should be one - of :code:`none`, :code:`basic`, or :code:`ntlm`. + of :code:`none`, :code:`basic`, or :code:`ntlm2`. HTTP Digest authentication is supported as well, but only via the :code:`auto` or :code:`auto-nct` flags (below). This must replace
@@ -33,7 +33,9 @@ http-proxy proxy.example.net 3128 authfile.txt http-proxy proxy.example.net 3128 stdin http-proxy proxy.example.net 3128 auto basic - http-proxy proxy.example.net 3128 auto-nct ntlm + http-proxy proxy.example.net 3128 auto-nct ntlm2 + + Note that support for NTLMv1 proxies was removed with OpenVPN 2.7. --http-proxy-option args Set extended HTTP proxy options. Requires an option ``type`` as argument
src/openvpn/crypto_backend.h +0 -11
@@ -157,17 +157,6 @@*/ int rand_bytes (uint8_t *output,int len); -/** -* Encrypt the given block, using DES ECB mode -* -* @param key DES key to use. -* @param src Buffer containing the 8-byte source. -* @param dst Buffer containing the 8-byte destination -*/ -void cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]); -/* * * Generic cipher key type functions
src/openvpn/crypto_mbedtls.c +0 -11
@@ -758,17 +758,6 @@return 1 ; } -void -cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]) -{ -mbedtls_des_context ctx; - -ASSERT (mbed_ok (mbedtls_des_setkey_enc (&ctx, key))); -ASSERT (mbed_ok (mbedtls_des_crypt_ecb (&ctx, src, dst))); -} -/*
src/openvpn/crypto_openssl.c +0 -44
50 lines not on this page · raw message
src/openvpn/ntlm.c +83 -122
243 lines not on this page · raw message
src/openvpn/options.c +1 -1
@@ -144,7 +144,7 @@" through an HTTP proxy at address s and port p.\n" " If proxy authentication is required,\n" " up is a file containing username/password on 2 lines, or\n" -" 'stdin' to prompt from console. Add auth='ntlm' if\n" +" 'stdin' to prompt from console. Add auth='ntlm2' if\n" " the proxy requires NTLM authentication.\n" "--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically\n" " determine auth method and query for username/password\n"
src/openvpn/proxy.c +6 -10
@@ -354,7 +354,7 @@ {msg (D_PROXY ,"PROXY AUTH NTLM: '%s'" , buf); *data =NULL ; - ret =HTTP_AUTH_NTLM ; + ret =HTTP_AUTH_NTLM2 ; }#endif }
@@ -517,9 +517,7 @@#if NTLM else if (!strcmp(o->auth_method_string, "ntlm")) { -msg (M_INFO ,"NTLM v1 authentication is deprecated and will be removed in " -"OpenVPN 2.7" ); - p->auth_method =HTTP_AUTH_NTLM ; +msg (M_FATAL ,"ERROR: NTLM v1 support has been removed. For now, you can use NTLM v2 by selecting ntlm2 but it is deprecated as well." ); } else if (!strcmp(o->auth_method_string, "ntlm2")) {
@@ -534,13 +532,13 @@ }/* only basic and NTLM/NTLMv2 authentication supported so far */ -if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM2 ) {get_user_pass_http (p, true); }#if !NTLM -if (p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_NTLM2 ) {msg (M_FATAL ,"Sorry, this version of " PACKAGE_NAME " was built without NTLM Proxy support." ); }
@@ -646,8 +644,7 @@/* get user/pass if not previously given */ if (p->auth_method ==HTTP_AUTH_BASIC - || p->auth_method ==HTTP_AUTH_DIGEST - || p->auth_method ==HTTP_AUTH_NTLM ) + || p->auth_method ==HTTP_AUTH_DIGEST ) {get_user_pass_http (p, false); }
@@ -697,7 +694,6 @@break ;#if NTLM -case HTTP_AUTH_NTLM :case HTTP_AUTH_NTLM2 :/* keep-alive connection */ openvpn_snprintf (buf,sizeof (buf),"Proxy-Connection: Keep-Alive" );
@@ -752,7 +748,7 @@ { processed = true; } - else if ((p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ + else if ((p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ {#if NTLM /* look for the phase 2 response */
src/openvpn/proxy.h +1 -1
@@ -31,7 +31,7 @@#define HTTP_AUTH_NONE 0#define HTTP_AUTH_BASIC 1#define HTTP_AUTH_DIGEST 2 -#define HTTP_AUTH_NTLM 3 +/* #define HTTP_AUTH_NTLM 3 removed in OpenVPN 2.7 */ #define HTTP_AUTH_NTLM2 4#define HTTP_AUTH_N 5/* number of HTTP_AUTH methods */
tests/unit_tests/openvpn/test_crypto.c +0 -23
@@ -211,29 +211,6 @@hmac_ctx_free (hmac); } -void -test_des_encrypt (void **state) -{ -/* We have a small des encrypt method that is only for NTLMv1. This unit -* test ensures that it is not accidentally broken */ - -const unsigned char des_key[DES_KEY_LENGTH ] = {0x42 ,0x23 }; - -const char *src ="MoinWelt" ; - -/* cipher_des_encrypt_ecb wants a non const */ -unsigned char *src2 = (unsigned char *)strdup (src); - -unsigned char dst[DES_KEY_LENGTH ]; -cipher_des_encrypt_ecb (des_key, src2, dst); - -const unsigned char dst_good[DES_KEY_LENGTH ] = {0xd3 ,0x8f ,0x61 ,0xf7 ,0xbe ,0x27 ,0xb6 ,0xa2 }; - -assert_memory_equal (dst, dst_good,DES_KEY_LENGTH ); - -free (src2); -} -/* This test is in test_crypto as it calls into the functions that calculate * the crypto overhead */ static void
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/379?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0dcb2dac4136f194da7050a8ea8495e9faba9dd9
Gerrit-Change-Number: 379
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/379?usp=email
to look at the new patch set (#2).
Change subject: Remove support for NTLM v1 proxy authentication
......................................................................
Remove support for NTLM v1 proxy authentication
Due to the limitation of the protocol it is not considered secure. Better to use basic auth instead of a false sense of security. NTLM v2 remains supported for now.
---
M doc/man-sections/proxy-options.rst
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls.c
M src/openvpn/crypto_openssl.c
M src/openvpn/ntlm.c
M src/openvpn/options.c
M src/openvpn/proxy.c
M src/openvpn/proxy.h
M tests/unit_tests/openvpn/test_crypto.c
9 files changed, 95 insertions(+), 226 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/79/379/2
doc/man-sections/proxy-options.rst +4 -2
@@ -11,7 +11,7 @@ ``--http-proxy-user-pass`` option. (See section on inline files) The last optional argument is an ``auth-method`` which should be one - of :code:`none`, :code:`basic`, or :code:`ntlm`. + of :code:`none`, :code:`basic`, or :code:`ntlm2`. HTTP Digest authentication is supported as well, but only via the :code:`auto` or :code:`auto-nct` flags (below). This must replace
@@ -33,7 +33,9 @@ http-proxy proxy.example.net 3128 authfile.txt http-proxy proxy.example.net 3128 stdin http-proxy proxy.example.net 3128 auto basic - http-proxy proxy.example.net 3128 auto-nct ntlm + http-proxy proxy.example.net 3128 auto-nct ntlm2 + + Note that support for NTLMv1 proxies was removed with OpenVPN 2.7. --http-proxy-option args Set extended HTTP proxy options. Requires an option ``type`` as argument
src/openvpn/crypto_backend.h +0 -11
@@ -157,17 +157,6 @@*/ int rand_bytes (uint8_t *output,int len); -/** -* Encrypt the given block, using DES ECB mode -* -* @param key DES key to use. -* @param src Buffer containing the 8-byte source. -* @param dst Buffer containing the 8-byte destination -*/ -void cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]); -/* * * Generic cipher key type functions
src/openvpn/crypto_mbedtls.c +0 -11
@@ -758,17 +758,6 @@return 1 ; } -void -cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]) -{ -mbedtls_des_context ctx; - -ASSERT (mbed_ok (mbedtls_des_setkey_enc (&ctx, key))); -ASSERT (mbed_ok (mbedtls_des_crypt_ecb (&ctx, src, dst))); -} -/*
src/openvpn/crypto_openssl.c +0 -44
50 lines not on this page · raw message
src/openvpn/ntlm.c +83 -122
243 lines not on this page · raw message
src/openvpn/options.c +1 -1
@@ -144,7 +144,7 @@" through an HTTP proxy at address s and port p.\n" " If proxy authentication is required,\n" " up is a file containing username/password on 2 lines, or\n" -" 'stdin' to prompt from console. Add auth='ntlm' if\n" +" 'stdin' to prompt from console. Add auth='ntlm2' if\n" " the proxy requires NTLM authentication.\n" "--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically\n" " determine auth method and query for username/password\n"
src/openvpn/proxy.c +6 -10
@@ -354,7 +354,7 @@ {msg (D_PROXY ,"PROXY AUTH NTLM: '%s'" , buf); *data =NULL ; - ret =HTTP_AUTH_NTLM ; + ret =HTTP_AUTH_NTLM2 ; }#endif }
@@ -517,9 +517,7 @@#if NTLM else if (!strcmp(o->auth_method_string, "ntlm")) { -msg (M_INFO ,"NTLM v1 authentication is deprecated and will be removed in " -"OpenVPN 2.7" ); - p->auth_method =HTTP_AUTH_NTLM ; +msg (M_FATAL ,"ERROR: NTLM v1 support has been removed. For now, you can use NTLM v2 by selecting ntlm2 but it is deprecated as well." ); } else if (!strcmp(o->auth_method_string, "ntlm2")) {
@@ -534,13 +532,13 @@ }/* only basic and NTLM/NTLMv2 authentication supported so far */ -if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM2 ) {get_user_pass_http (p, true); }#if !NTLM -if (p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_NTLM2 ) {msg (M_FATAL ,"Sorry, this version of " PACKAGE_NAME " was built without NTLM Proxy support." ); }
@@ -646,8 +644,7 @@/* get user/pass if not previously given */ if (p->auth_method ==HTTP_AUTH_BASIC - || p->auth_method ==HTTP_AUTH_DIGEST - || p->auth_method ==HTTP_AUTH_NTLM ) + || p->auth_method ==HTTP_AUTH_DIGEST ) {get_user_pass_http (p, false); }
@@ -697,7 +694,6 @@break ;#if NTLM -case HTTP_AUTH_NTLM :case HTTP_AUTH_NTLM2 :/* keep-alive connection */ openvpn_snprintf (buf,sizeof (buf),"Proxy-Connection: Keep-Alive" );
@@ -752,7 +748,7 @@ { processed = true; } - else if ((p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ + else if ((p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ {#if NTLM /* look for the phase 2 response */
src/openvpn/proxy.h +1 -1
@@ -31,7 +31,7 @@#define HTTP_AUTH_NONE 0#define HTTP_AUTH_BASIC 1#define HTTP_AUTH_DIGEST 2 -#define HTTP_AUTH_NTLM 3 +/* #define HTTP_AUTH_NTLM 3 removed in OpenVPN 2.7 */ #define HTTP_AUTH_NTLM2 4#define HTTP_AUTH_N 5/* number of HTTP_AUTH methods */
tests/unit_tests/openvpn/test_crypto.c +0 -24
@@ -211,29 +211,6 @@hmac_ctx_free (hmac); } -void -test_des_encrypt (void **state) -{ -/* We have a small des encrypt method that is only for NTLMv1. This unit -* test ensures that it is not accidentally broken */ - -const unsigned char des_key[DES_KEY_LENGTH ] = {0x42 ,0x23 }; - -const char *src ="MoinWelt" ; - -/* cipher_des_encrypt_ecb wants a non const */ -unsigned char *src2 = (unsigned char *)strdup (src); - -unsigned char dst[DES_KEY_LENGTH ]; -cipher_des_encrypt_ecb (des_key, src2, dst); - -const unsigned char dst_good[DES_KEY_LENGTH ] = {0xd3 ,0x8f ,0x61 ,0xf7 ,0xbe ,0x27 ,0xb6 ,0xa2 }; - -assert_memory_equal (dst, dst_good,DES_KEY_LENGTH ); - -free (src2); -} -/* This test is in test_crypto as it calls into the functions that calculate * the crypto overhead */ static void
@@ -474,7 +451,6 @@cmocka_unit_test (crypto_translate_cipher_names),cmocka_unit_test (crypto_test_tls_prf),cmocka_unit_test (crypto_test_hmac), -cmocka_unit_test (test_des_encrypt),cmocka_unit_test (test_occ_mtu_calculation), cmocka_unit_test(test_mssfix_mtu_calculation) };
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/379?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0dcb2dac4136f194da7050a8ea8495e9faba9dd9
Gerrit-Change-Number: 379
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/379?usp=email )
Change subject: Remove support for NTLM v1 proxy authentication
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/379?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0dcb2dac4136f194da7050a8ea8495e9faba9dd9
Gerrit-Change-Number: 379
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 20 Nov 2023 10:53:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v4 1/1 Remove support for NTLM v1 proxy authentication
In reply to a message not in the archiveFrom: Frank Lichtenheld <[email protected]...>
Due to the limitation of the protocol it is not considered secure. Better to use basic auth instead of a false sense of security. NTLM v2 remains supported for now.
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/379
This mail reflects revision 4 of this Change. Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]...>
doc/man-sections/proxy-options.rst +4 -2
@@ -11,7 +11,7 @@ ``--http-proxy-user-pass`` option. (See section on inline files) The last optional argument is an ``auth-method`` which should be one - of :code:`none`, :code:`basic`, or :code:`ntlm`. + of :code:`none`, :code:`basic`, or :code:`ntlm2`. HTTP Digest authentication is supported as well, but only via the :code:`auto` or :code:`auto-nct` flags (below). This must replace
@@ -33,7 +33,9 @@ http-proxy proxy.example.net 3128 authfile.txt http-proxy proxy.example.net 3128 stdin http-proxy proxy.example.net 3128 auto basic - http-proxy proxy.example.net 3128 auto-nct ntlm + http-proxy proxy.example.net 3128 auto-nct ntlm2 + + Note that support for NTLMv1 proxies was removed with OpenVPN 2.7. --http-proxy-option args Set extended HTTP proxy options. Requires an option ``type`` as argument
src/openvpn/crypto_backend.h +0 -11
@@ -157,17 +157,6 @@*/ int rand_bytes (uint8_t *output,int len); -/** -* Encrypt the given block, using DES ECB mode -* -* @param key DES key to use. -* @param src Buffer containing the 8-byte source. -* @param dst Buffer containing the 8-byte destination -*/ -void cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]); -/* * * Generic cipher key type functions
src/openvpn/crypto_mbedtls.c +0 -11
@@ -758,17 +758,6 @@return 1 ; } -void -cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]) -{ -mbedtls_des_context ctx; - -ASSERT (mbed_ok (mbedtls_des_setkey_enc (&ctx, key))); -ASSERT (mbed_ok (mbedtls_des_crypt_ecb (&ctx, src, dst))); -} -/*
src/openvpn/crypto_openssl.c +0 -44
50 lines not on this page · raw message
src/openvpn/ntlm.c +83 -122
243 lines not on this page · raw message
src/openvpn/options.c +1 -1
@@ -144,7 +144,7 @@" through an HTTP proxy at address s and port p.\n" " If proxy authentication is required,\n" " up is a file containing username/password on 2 lines, or\n" -" 'stdin' to prompt from console. Add auth='ntlm' if\n" +" 'stdin' to prompt from console. Add auth='ntlm2' if\n" " the proxy requires NTLM authentication.\n" "--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically\n" " determine auth method and query for username/password\n"
src/openvpn/proxy.c +6 -10
@@ -354,7 +354,7 @@ {msg (D_PROXY ,"PROXY AUTH NTLM: '%s'" , buf); *data =NULL ; - ret =HTTP_AUTH_NTLM ; + ret =HTTP_AUTH_NTLM2 ; }#endif }
@@ -517,9 +517,7 @@#if NTLM else if (!strcmp(o->auth_method_string, "ntlm")) { -msg (M_INFO ,"NTLM v1 authentication is deprecated and will be removed in " -"OpenVPN 2.7" ); - p->auth_method =HTTP_AUTH_NTLM ; +msg (M_FATAL ,"ERROR: NTLM v1 support has been removed. For now, you can use NTLM v2 by selecting ntlm2 but it is deprecated as well." ); } else if (!strcmp(o->auth_method_string, "ntlm2")) {
@@ -534,13 +532,13 @@ }/* only basic and NTLM/NTLMv2 authentication supported so far */ -if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM2 ) {get_user_pass_http (p, true); }#if !NTLM -if (p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_NTLM2 ) {msg (M_FATAL ,"Sorry, this version of " PACKAGE_NAME " was built without NTLM Proxy support." ); }
@@ -646,8 +644,7 @@/* get user/pass if not previously given */ if (p->auth_method ==HTTP_AUTH_BASIC - || p->auth_method ==HTTP_AUTH_DIGEST - || p->auth_method ==HTTP_AUTH_NTLM ) + || p->auth_method ==HTTP_AUTH_DIGEST ) {get_user_pass_http (p, false); }
@@ -697,7 +694,6 @@break ;#if NTLM -case HTTP_AUTH_NTLM :case HTTP_AUTH_NTLM2 :/* keep-alive connection */ openvpn_snprintf (buf,sizeof (buf),"Proxy-Connection: Keep-Alive" );
@@ -752,7 +748,7 @@ { processed = true; } - else if ((p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ + else if ((p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ {#if NTLM /* look for the phase 2 response */
src/openvpn/proxy.h +1 -1
@@ -31,7 +31,7 @@#define HTTP_AUTH_NONE 0#define HTTP_AUTH_BASIC 1#define HTTP_AUTH_DIGEST 2 -#define HTTP_AUTH_NTLM 3 +/* #define HTTP_AUTH_NTLM 3 removed in OpenVPN 2.7 */ #define HTTP_AUTH_NTLM2 4#define HTTP_AUTH_N 5/* number of HTTP_AUTH methods */
tests/unit_tests/openvpn/test_crypto.c +0 -24
@@ -211,29 +211,6 @@hmac_ctx_free (hmac); } -void -test_des_encrypt (void **state) -{ -/* We have a small des encrypt method that is only for NTLMv1. This unit -* test ensures that it is not accidentally broken */ - -const unsigned char des_key[DES_KEY_LENGTH ] = {0x42 ,0x23 }; - -const char *src ="MoinWelt" ; - -/* cipher_des_encrypt_ecb wants a non const */ -unsigned char *src2 = (unsigned char *)strdup (src); - -unsigned char dst[DES_KEY_LENGTH ]; -cipher_des_encrypt_ecb (des_key, src2, dst); - -const unsigned char dst_good[DES_KEY_LENGTH ] = {0xd3 ,0x8f ,0x61 ,0xf7 ,0xbe ,0x27 ,0xb6 ,0xa2 }; - -assert_memory_equal (dst, dst_good,DES_KEY_LENGTH ); - -free (src2); -} -/* This test is in test_crypto as it calls into the functions that calculate * the crypto overhead */ static void
@@ -474,7 +451,6 @@cmocka_unit_test (crypto_translate_cipher_names),cmocka_unit_test (crypto_test_tls_prf),cmocka_unit_test (crypto_test_hmac), -cmocka_unit_test (test_des_encrypt),cmocka_unit_test (test_occ_mtu_calculation), cmocka_unit_test(test_mssfix_mtu_calculation) };
[Openvpn-devel] [PATCH applied] Re: Remove support for NTLM v1 proxy authentication
The code change itself is fairly small and (git diff -w) easy to verify.
The patch is much larger because it removes all DES related code now (which is welcome).
I have added a comment to Changes.rst as requested.
Lightly tested on FreeBSD / t_client - no NTLM proxy here, so that part isn't tested, only "all the other proxies".
Your patch has been applied to the master branch.
commit 21910ebc2ee8a6138eb2af8d38056d2b94e59f9c
Author: Frank Lichtenheld Date: Sat Dec 30 15:37:33 2023 +0100
Remove support for NTLM v1 proxy authentication
Signed-off-by: Frank Lichtenheld <[email protected]...>
Acked-by: Arne Schwabe <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27862.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#5) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/379?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by plaisthos
Change subject: Remove support for NTLM v1 proxy authentication
......................................................................
Remove support for NTLM v1 proxy authentication
Due to the limitation of the protocol it is not considered secure. Better to use basic auth instead of a false sense of security. NTLM v2 remains supported for now.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27862.html
---
M Changes.rst
M doc/man-sections/proxy-options.rst
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls.c
M src/openvpn/crypto_openssl.c
M src/openvpn/ntlm.c
M src/openvpn/options.c
M src/openvpn/proxy.c
M src/openvpn/proxy.h
M tests/unit_tests/openvpn/test_crypto.c
10 files changed, 101 insertions(+), 226 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/79/379/5
Changes.rst +6 -0
@@ -1,5 +1,7 @@ Overview of changes in 2.7 ========================== +Deprecated features +------------------- ``secret`` support has been removed by default. static key mode (non-TLS) is no longer considered "good and secure enough" for today's requirements. Use TLS mode instead. If deploying a PKI CA
@@ -10,6 +12,10 @@ ``--allow-deprecated-insecure-static-crypto`` but will be removed in OpenVPN 2.8. +NTLMv1 support has been removed because it is completely insecure. + NTLMv2 support is still available, but will removed in a future release. + + Overview of changes in 2.6 ==========================
doc/man-sections/proxy-options.rst +4 -2
@@ -7,7 +7,7 @@ ``--http-proxy-user-pass`` option. (See section on inline files) The last optional argument is an ``auth-method`` which should be one - of :code:`none`, :code:`basic`, or :code:`ntlm`. + of :code:`none`, :code:`basic`, or :code:`ntlm2`. HTTP Digest authentication is supported as well, but only via the :code:`auto` or :code:`auto-nct` flags (below). This must replace
@@ -29,7 +29,9 @@ http-proxy proxy.example.net 3128 authfile.txt http-proxy proxy.example.net 3128 stdin http-proxy proxy.example.net 3128 auto basic - http-proxy proxy.example.net 3128 auto-nct ntlm + http-proxy proxy.example.net 3128 auto-nct ntlm2 + + Note that support for NTLMv1 proxies was removed with OpenVPN 2.7. --http-proxy-option args Set extended HTTP proxy options. Requires an option ``type`` as argument
src/openvpn/crypto_backend.h +0 -11
@@ -157,17 +157,6 @@*/ int rand_bytes (uint8_t *output,int len); -/** -* Encrypt the given block, using DES ECB mode -* -* @param key DES key to use. -* @param src Buffer containing the 8-byte source. -* @param dst Buffer containing the 8-byte destination -*/ -void cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]); -/* * * Generic cipher key type functions
src/openvpn/crypto_mbedtls.c +0 -11
@@ -758,17 +758,6 @@return 1 ; } -void -cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]) -{ -mbedtls_des_context ctx; - -ASSERT (mbed_ok (mbedtls_des_setkey_enc (&ctx, key))); -ASSERT (mbed_ok (mbedtls_des_crypt_ecb (&ctx, src, dst))); -} -/*
src/openvpn/crypto_openssl.c +0 -44
50 lines not on this page · raw message
src/openvpn/ntlm.c +83 -122
243 lines not on this page · raw message
src/openvpn/options.c +1 -1
@@ -144,7 +144,7 @@" through an HTTP proxy at address s and port p.\n" " If proxy authentication is required,\n" " up is a file containing username/password on 2 lines, or\n" -" 'stdin' to prompt from console. Add auth='ntlm' if\n" +" 'stdin' to prompt from console. Add auth='ntlm2' if\n" " the proxy requires NTLM authentication.\n" "--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically\n" " determine auth method and query for username/password\n"
src/openvpn/proxy.c +6 -10
@@ -354,7 +354,7 @@ {msg (D_PROXY ,"PROXY AUTH NTLM: '%s'" , buf); *data =NULL ; - ret =HTTP_AUTH_NTLM ; + ret =HTTP_AUTH_NTLM2 ; }#endif }
@@ -517,9 +517,7 @@#if NTLM else if (!strcmp(o->auth_method_string, "ntlm")) { -msg (M_INFO ,"NTLM v1 authentication is deprecated and will be removed in " -"OpenVPN 2.7" ); - p->auth_method =HTTP_AUTH_NTLM ; +msg (M_FATAL ,"ERROR: NTLM v1 support has been removed. For now, you can use NTLM v2 by selecting ntlm2 but it is deprecated as well." ); } else if (!strcmp(o->auth_method_string, "ntlm2")) {
@@ -534,13 +532,13 @@ }/* only basic and NTLM/NTLMv2 authentication supported so far */ -if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM2 ) {get_user_pass_http (p, true); }#if !NTLM -if (p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_NTLM2 ) {msg (M_FATAL ,"Sorry, this version of " PACKAGE_NAME " was built without NTLM Proxy support." ); }
@@ -646,8 +644,7 @@/* get user/pass if not previously given */ if (p->auth_method ==HTTP_AUTH_BASIC - || p->auth_method ==HTTP_AUTH_DIGEST - || p->auth_method ==HTTP_AUTH_NTLM ) + || p->auth_method ==HTTP_AUTH_DIGEST ) {get_user_pass_http (p, false); }
@@ -697,7 +694,6 @@break ;#if NTLM -case HTTP_AUTH_NTLM :case HTTP_AUTH_NTLM2 :/* keep-alive connection */ openvpn_snprintf (buf,sizeof (buf),"Proxy-Connection: Keep-Alive" );
@@ -752,7 +748,7 @@ { processed = true; } - else if ((p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ + else if ((p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ {#if NTLM /* look for the phase 2 response */
src/openvpn/proxy.h +1 -1
@@ -31,7 +31,7 @@#define HTTP_AUTH_NONE 0#define HTTP_AUTH_BASIC 1#define HTTP_AUTH_DIGEST 2 -#define HTTP_AUTH_NTLM 3 +/* #define HTTP_AUTH_NTLM 3 removed in OpenVPN 2.7 */ #define HTTP_AUTH_NTLM2 4#define HTTP_AUTH_N 5/* number of HTTP_AUTH methods */
tests/unit_tests/openvpn/test_crypto.c +0 -24
@@ -210,29 +210,6 @@hmac_ctx_free (hmac); } -void -test_des_encrypt (void **state) -{ -/* We have a small des encrypt method that is only for NTLMv1. This unit -* test ensures that it is not accidentally broken */ - -const unsigned char des_key[DES_KEY_LENGTH ] = {0x42 ,0x23 }; - -const char *src ="MoinWelt" ; - -/* cipher_des_encrypt_ecb wants a non const */ -unsigned char *src2 = (unsigned char *)strdup (src); - -unsigned char dst[DES_KEY_LENGTH ]; -cipher_des_encrypt_ecb (des_key, src2, dst); - -const unsigned char dst_good[DES_KEY_LENGTH ] = {0xd3 ,0x8f ,0x61 ,0xf7 ,0xbe ,0x27 ,0xb6 ,0xa2 }; - -assert_memory_equal (dst, dst_good,DES_KEY_LENGTH ); - -free (src2); -} -/* This test is in test_crypto as it calls into the functions that calculate * the crypto overhead */ static void
@@ -473,7 +450,6 @@cmocka_unit_test (crypto_translate_cipher_names),cmocka_unit_test (crypto_test_tls_prf),cmocka_unit_test (crypto_test_hmac), -cmocka_unit_test (test_des_encrypt),cmocka_unit_test (test_occ_mtu_calculation), cmocka_unit_test(test_mssfix_mtu_calculation) };
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/379?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0dcb2dac4136f194da7050a8ea8495e9faba9dd9
Gerrit-Change-Number: 379
Gerrit-PatchSet: 5
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/379?usp=email )
Change subject: Remove support for NTLM v1 proxy authentication
......................................................................
Remove support for NTLM v1 proxy authentication
Due to the limitation of the protocol it is not considered secure. Better to use basic auth instead of a false sense of security. NTLM v2 remains supported for now.
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg27862.html
---
M Changes.rst
M doc/man-sections/proxy-options.rst
M src/openvpn/crypto_backend.h
M src/openvpn/crypto_mbedtls.c
M src/openvpn/crypto_openssl.c
M src/openvpn/ntlm.c
M src/openvpn/options.c
M src/openvpn/proxy.c
M src/openvpn/proxy.h
M tests/unit_tests/openvpn/test_crypto.c
10 files changed, 101 insertions(+), 226 deletions(-)
Changes.rst +6 -0
@@ -1,5 +1,7 @@ Overview of changes in 2.7 ========================== +Deprecated features +------------------- ``secret`` support has been removed by default. static key mode (non-TLS) is no longer considered "good and secure enough" for today's requirements. Use TLS mode instead. If deploying a PKI CA
@@ -10,6 +12,10 @@ ``--allow-deprecated-insecure-static-crypto`` but will be removed in OpenVPN 2.8. +NTLMv1 support has been removed because it is completely insecure. + NTLMv2 support is still available, but will removed in a future release. + + Overview of changes in 2.6 ==========================
doc/man-sections/proxy-options.rst +4 -2
@@ -7,7 +7,7 @@ ``--http-proxy-user-pass`` option. (See section on inline files) The last optional argument is an ``auth-method`` which should be one - of :code:`none`, :code:`basic`, or :code:`ntlm`. + of :code:`none`, :code:`basic`, or :code:`ntlm2`. HTTP Digest authentication is supported as well, but only via the :code:`auto` or :code:`auto-nct` flags (below). This must replace
@@ -29,7 +29,9 @@ http-proxy proxy.example.net 3128 authfile.txt http-proxy proxy.example.net 3128 stdin http-proxy proxy.example.net 3128 auto basic - http-proxy proxy.example.net 3128 auto-nct ntlm + http-proxy proxy.example.net 3128 auto-nct ntlm2 + + Note that support for NTLMv1 proxies was removed with OpenVPN 2.7. --http-proxy-option args Set extended HTTP proxy options. Requires an option ``type`` as argument
src/openvpn/crypto_backend.h +0 -11
@@ -157,17 +157,6 @@*/ int rand_bytes (uint8_t *output,int len); -/** -* Encrypt the given block, using DES ECB mode -* -* @param key DES key to use. -* @param src Buffer containing the 8-byte source. -* @param dst Buffer containing the 8-byte destination -*/ -void cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]); -/* * * Generic cipher key type functions
src/openvpn/crypto_mbedtls.c +0 -11
@@ -758,17 +758,6 @@return 1 ; } -void -cipher_des_encrypt_ecb (const unsigned char key[DES_KEY_LENGTH ], -unsigned char src[DES_KEY_LENGTH ], -unsigned char dst[DES_KEY_LENGTH ]) -{ -mbedtls_des_context ctx; - -ASSERT (mbed_ok (mbedtls_des_setkey_enc (&ctx, key))); -ASSERT (mbed_ok (mbedtls_des_crypt_ecb (&ctx, src, dst))); -} -/*
src/openvpn/crypto_openssl.c +0 -44
50 lines not on this page · raw message
src/openvpn/ntlm.c +83 -122
243 lines not on this page · raw message
src/openvpn/options.c +1 -1
@@ -144,7 +144,7 @@" through an HTTP proxy at address s and port p.\n" " If proxy authentication is required,\n" " up is a file containing username/password on 2 lines, or\n" -" 'stdin' to prompt from console. Add auth='ntlm' if\n" +" 'stdin' to prompt from console. Add auth='ntlm2' if\n" " the proxy requires NTLM authentication.\n" "--http-proxy s p 'auto[-nct]' : Like the above directive, but automatically\n" " determine auth method and query for username/password\n"
src/openvpn/proxy.c +6 -10
@@ -354,7 +354,7 @@ {msg (D_PROXY ,"PROXY AUTH NTLM: '%s'" , buf); *data =NULL ; - ret =HTTP_AUTH_NTLM ; + ret =HTTP_AUTH_NTLM2 ; }#endif }
@@ -517,9 +517,7 @@#if NTLM else if (!strcmp(o->auth_method_string, "ntlm")) { -msg (M_INFO ,"NTLM v1 authentication is deprecated and will be removed in " -"OpenVPN 2.7" ); - p->auth_method =HTTP_AUTH_NTLM ; +msg (M_FATAL ,"ERROR: NTLM v1 support has been removed. For now, you can use NTLM v2 by selecting ntlm2 but it is deprecated as well." ); } else if (!strcmp(o->auth_method_string, "ntlm2")) {
@@ -534,13 +532,13 @@ }/* only basic and NTLM/NTLMv2 authentication supported so far */ -if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_BASIC || p->auth_method ==HTTP_AUTH_NTLM2 ) {get_user_pass_http (p, true); }#if !NTLM -if (p->auth_method ==HTTP_AUTH_NTLM || p->auth_method ==HTTP_AUTH_NTLM2 ) +if (p->auth_method ==HTTP_AUTH_NTLM2 ) {msg (M_FATAL ,"Sorry, this version of " PACKAGE_NAME " was built without NTLM Proxy support." ); }
@@ -646,8 +644,7 @@/* get user/pass if not previously given */ if (p->auth_method ==HTTP_AUTH_BASIC - || p->auth_method ==HTTP_AUTH_DIGEST - || p->auth_method ==HTTP_AUTH_NTLM ) + || p->auth_method ==HTTP_AUTH_DIGEST ) {get_user_pass_http (p, false); }
@@ -697,7 +694,6 @@break ;#if NTLM -case HTTP_AUTH_NTLM :case HTTP_AUTH_NTLM2 :/* keep-alive connection */ openvpn_snprintf (buf,sizeof (buf),"Proxy-Connection: Keep-Alive" );
@@ -752,7 +748,7 @@ { processed = true; } - else if ((p->auth_method == HTTP_AUTH_NTLM || p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ + else if ((p->auth_method == HTTP_AUTH_NTLM2) && !processed) /* check for NTLM */ {#if NTLM /* look for the phase 2 response */
src/openvpn/proxy.h +1 -1
@@ -31,7 +31,7 @@#define HTTP_AUTH_NONE 0#define HTTP_AUTH_BASIC 1#define HTTP_AUTH_DIGEST 2 -#define HTTP_AUTH_NTLM 3 +/* #define HTTP_AUTH_NTLM 3 removed in OpenVPN 2.7 */ #define HTTP_AUTH_NTLM2 4#define HTTP_AUTH_N 5/* number of HTTP_AUTH methods */
tests/unit_tests/openvpn/test_crypto.c +0 -24
@@ -210,29 +210,6 @@hmac_ctx_free (hmac); } -void -test_des_encrypt (void **state) -{ -/* We have a small des encrypt method that is only for NTLMv1. This unit -* test ensures that it is not accidentally broken */ - -const unsigned char des_key[DES_KEY_LENGTH ] = {0x42 ,0x23 }; - -const char *src ="MoinWelt" ; - -/* cipher_des_encrypt_ecb wants a non const */ -unsigned char *src2 = (unsigned char *)strdup (src); - -unsigned char dst[DES_KEY_LENGTH ]; -cipher_des_encrypt_ecb (des_key, src2, dst); - -const unsigned char dst_good[DES_KEY_LENGTH ] = {0xd3 ,0x8f ,0x61 ,0xf7 ,0xbe ,0x27 ,0xb6 ,0xa2 }; - -assert_memory_equal (dst, dst_good,DES_KEY_LENGTH ); - -free (src2); -} -/* This test is in test_crypto as it calls into the functions that calculate * the crypto overhead */ static void
@@ -473,7 +450,6 @@cmocka_unit_test (crypto_translate_cipher_names),cmocka_unit_test (crypto_test_tls_prf),cmocka_unit_test (crypto_test_hmac), -cmocka_unit_test (test_des_encrypt),cmocka_unit_test (test_occ_mtu_calculation), cmocka_unit_test(test_mssfix_mtu_calculation) };
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/379?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I0dcb2dac4136f194da7050a8ea8495e9faba9dd9
Gerrit-Change-Number: 379
Gerrit-PatchSet: 5
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged