52 lines
1.7 KiB
Diff
52 lines
1.7 KiB
Diff
|
From 1aa93773ac48915c8eaabc959ae2bf65037a368c Mon Sep 17 00:00:00 2001
|
||
|
From: Andrew Bartlett <abartlet@samba.org>
|
||
|
Date: Fri, 16 Aug 2019 15:50:03 +1200
|
||
|
Subject: [PATCH 122/187] libcli/smb: Use gnutls_error_to_ntstatus() in
|
||
|
smb2_signing_check_pdu()
|
||
|
|
||
|
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
|
||
|
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||
|
(cherry picked from commit 70ff03ecb6826525727d87ef8807428f91f4e506)
|
||
|
---
|
||
|
libcli/smb/smb2_signing.c | 8 ++++----
|
||
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
||
|
|
||
|
diff --git a/libcli/smb/smb2_signing.c b/libcli/smb/smb2_signing.c
|
||
|
index 5bf61bd477b..1ec60a4f9a5 100644
|
||
|
--- a/libcli/smb/smb2_signing.c
|
||
|
+++ b/libcli/smb/smb2_signing.c
|
||
|
@@ -229,18 +229,18 @@ NTSTATUS smb2_signing_check_pdu(struct smb2_signing_key *signing_key,
|
||
|
key.data,
|
||
|
key.size);
|
||
|
if (rc < 0) {
|
||
|
- return NT_STATUS_NO_MEMORY;
|
||
|
+ return gnutls_error_to_ntstatus(rc, NT_STATUS_HMAC_NOT_SUPPORTED);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
rc = gnutls_hmac(signing_key->hmac_hnd, hdr, SMB2_HDR_SIGNATURE);
|
||
|
if (rc < 0) {
|
||
|
- return NT_STATUS_INTERNAL_ERROR;
|
||
|
+ return gnutls_error_to_ntstatus(rc, NT_STATUS_HMAC_NOT_SUPPORTED);
|
||
|
}
|
||
|
|
||
|
rc = gnutls_hmac(signing_key->hmac_hnd, zero_sig, 16);
|
||
|
if (rc < 0) {
|
||
|
- return NT_STATUS_INTERNAL_ERROR;
|
||
|
+ return gnutls_error_to_ntstatus(rc, NT_STATUS_HMAC_NOT_SUPPORTED);
|
||
|
}
|
||
|
|
||
|
for (i = 1; i < count; i++) {
|
||
|
@@ -248,7 +248,7 @@ NTSTATUS smb2_signing_check_pdu(struct smb2_signing_key *signing_key,
|
||
|
vector[i].iov_base,
|
||
|
vector[i].iov_len);
|
||
|
if (rc < 0) {
|
||
|
- return NT_STATUS_INTERNAL_ERROR;
|
||
|
+ return gnutls_error_to_ntstatus(rc, NT_STATUS_HMAC_NOT_SUPPORTED);
|
||
|
}
|
||
|
}
|
||
|
gnutls_hmac_output(signing_key->hmac_hnd, res);
|
||
|
--
|
||
|
2.23.0
|
||
|
|