]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_encrypt_pdu()
authorAndreas Schneider <asn@samba.org>
Fri, 23 Aug 2019 07:28:28 +0000 (09:28 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 27 Aug 2019 04:44:41 +0000 (04:44 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
libcli/smb/smb2_signing.c

index 682327bb21b843c6c4ac019e5507423239eedf06..c39f8e4780a7731224113905070f8e991108d2b5 100644 (file)
@@ -470,7 +470,7 @@ NTSTATUS smb2_signing_encrypt_pdu(struct smb2_signing_key *encryption_key,
                                        algo,
                                        &key);
                if (rc < 0) {
-                       status = NT_STATUS_NO_MEMORY;
+                       status = gnutls_error_to_ntstatus(rc, NT_STATUS_INTERNAL_ERROR);
                        goto out;
                }
        }
@@ -523,10 +523,9 @@ NTSTATUS smb2_signing_encrypt_pdu(struct smb2_signing_key *encryption_key,
                                                ctext,
                                                &ctext_size);
                if (rc < 0 || ctext_size != m_total + tag_size) {
-                       DBG_ERR("ERROR: %s\n", gnutls_strerror(rc));
                        TALLOC_FREE(ptext);
                        TALLOC_FREE(ctext);
-                       status = NT_STATUS_INTERNAL_ERROR;
+                       status = gnutls_error_to_ntstatus(rc, NT_STATUS_INTERNAL_ERROR);
                        goto out;
                }