aboutsummaryrefslogtreecommitdiff
path: root/net/freerdp1/files/patch-winpr_libwinpr_sspi_NTLM_ntlm__compute.c
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-11-18 15:06:41 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-11-18 15:06:41 +0000
commitf9b076b2f22f02eb94a2e9653e996d335e88544e (patch)
tree2f263239ee1a4a455a4939426495e2a54a73193c /net/freerdp1/files/patch-winpr_libwinpr_sspi_NTLM_ntlm__compute.c
parent6344af0f9ed6eaa25fefb8720e0536f3148989aa (diff)
downloadports-f9b076b2f22f02eb94a2e9653e996d335e88544e.tar.gz
ports-f9b076b2f22f02eb94a2e9653e996d335e88544e.zip
Notes
Diffstat (limited to 'net/freerdp1/files/patch-winpr_libwinpr_sspi_NTLM_ntlm__compute.c')
-rw-r--r--net/freerdp1/files/patch-winpr_libwinpr_sspi_NTLM_ntlm__compute.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/freerdp1/files/patch-winpr_libwinpr_sspi_NTLM_ntlm__compute.c b/net/freerdp1/files/patch-winpr_libwinpr_sspi_NTLM_ntlm__compute.c
new file mode 100644
index 000000000000..1929176be9dc
--- /dev/null
+++ b/net/freerdp1/files/patch-winpr_libwinpr_sspi_NTLM_ntlm__compute.c
@@ -0,0 +1,34 @@
+--- winpr/libwinpr/sspi/NTLM/ntlm_compute.c.orig 2014-09-11 22:46:32 UTC
++++ winpr/libwinpr/sspi/NTLM/ntlm_compute.c
+@@ -673,11 +673,24 @@ void ntlm_init_rc4_seal_states(NTLM_CONTEXT* context)
+
+ void ntlm_compute_message_integrity_check(NTLM_CONTEXT* context)
+ {
++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
++ HMAC_CTX *hmac_ctx;
++#else
+ HMAC_CTX hmac_ctx;
++#endif
+ /*
+ * Compute the HMAC-MD5 hash of ConcatenationOf(NEGOTIATE_MESSAGE,
+ * CHALLENGE_MESSAGE, AUTHENTICATE_MESSAGE) using the ExportedSessionKey
+ */
++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL
++ hmac_ctx = HMAC_CTX_new();
++ HMAC_Init_ex(hmac_ctx, context->ExportedSessionKey, 16, EVP_md5(), NULL);
++ HMAC_Update(hmac_ctx, (BYTE*) context->NegotiateMessage.pvBuffer, context->NegotiateMessage.cbBuffer);
++ HMAC_Update(hmac_ctx, (BYTE*) context->ChallengeMessage.pvBuffer, context->ChallengeMessage.cbBuffer);
++ HMAC_Update(hmac_ctx, (BYTE*) context->AuthenticateMessage.pvBuffer, context->AuthenticateMessage.cbBuffer);
++ HMAC_Final(hmac_ctx, context->MessageIntegrityCheck, NULL);
++ HMAC_CTX_free(hmac_ctx);
++#else
+ HMAC_CTX_init(&hmac_ctx);
+ HMAC_Init_ex(&hmac_ctx, context->ExportedSessionKey, 16, EVP_md5(), NULL);
+ HMAC_Update(&hmac_ctx, (BYTE*) context->NegotiateMessage.pvBuffer, context->NegotiateMessage.cbBuffer);
+@@ -685,5 +698,6 @@ void ntlm_compute_message_integrity_check(NTLM_CONTEXT
+ HMAC_Update(&hmac_ctx, (BYTE*) context->AuthenticateMessage.pvBuffer, context->AuthenticateMessage.cbBuffer);
+ HMAC_Final(&hmac_ctx, context->MessageIntegrityCheck, NULL);
+ HMAC_CTX_cleanup(&hmac_ctx);
++#endif
+ }
+