libcli:smb: Use gnutls_error_to_ntstatus() in smb2_signing_decrypt_pdu()
authorAndreas Schneider <asn@samba.org>
Fri, 23 Aug 2019 07:27:35 +0000 (09:27 +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>
libcli/smb/smb2_signing.c

index 9f40e8bbea512c7515d8f5d0b3011d6850b0b9d9..15dbf3d8b2a70714779fcbd2e4cc5e14f74ea7c7 100644 (file)
@@ -652,7 +652,7 @@ NTSTATUS smb2_signing_decrypt_pdu(struct smb2_signing_key *decryption_key,
                                             algo,
                                             &key);
                if (rc < 0) {
-                       status = NT_STATUS_NO_MEMORY;
+                       status = gnutls_error_to_ntstatus(rc, NT_STATUS_INTERNAL_ERROR);
                        goto out;
                }
        }
@@ -710,10 +710,9 @@ NTSTATUS smb2_signing_decrypt_pdu(struct smb2_signing_key *decryption_key,
                                                ptext,
                                                &ptext_size);
                if (rc < 0 || ptext_size != m_total) {
-                       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;
                }