]> git.samba.org - samba.git/commitdiff
s4:rpc_server: Use gnutls_error_to_ntstatus() in samr_password
authorAndreas Schneider <asn@samba.org>
Thu, 13 Jun 2019 09:32:28 +0000 (11:32 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 24 Jun 2019 06:11:17 +0000 (06:11 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/rpc_server/samr/samr_password.c

index a27510c62e83d6b321c6753d0fad03f0d42953c0..987ea42dca3a77d2ad4c28fe5a555fceb1947508 100644 (file)
@@ -32,6 +32,7 @@
 #include "rpc_server/samr/proto.h"
 #include "auth/auth_sam.h"
 
+#include "libcli/util/gnutls_error.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
@@ -605,20 +606,20 @@ NTSTATUS samr_set_password_ex(struct dcesrv_call_state *dce_call,
 
        rc = gnutls_hash_init(&hash_hnd, GNUTLS_DIG_MD5);
        if (rc < 0) {
-               nt_status = NT_STATUS_NO_MEMORY;
+               nt_status = gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED);
                goto out;
        }
 
        rc = gnutls_hash(hash_hnd, &pwbuf->data[516], 16);
        if (rc < 0) {
                gnutls_hash_deinit(hash_hnd, NULL);
-               nt_status = NT_STATUS_INTERNAL_ERROR;
+               nt_status = gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED);
                goto out;
        }
        rc = gnutls_hash(hash_hnd, session_key.data, session_key.length);
        if (rc < 0) {
                gnutls_hash_deinit(hash_hnd, NULL);
-               nt_status = NT_STATUS_INTERNAL_ERROR;
+               nt_status = gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED);
                goto out;
        }
        gnutls_hash_deinit(hash_hnd, co_session_key.data);