]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libnet: Use gnutls_error_to_ntstatus() in libnet_passwd
authorAndreas Schneider <asn@samba.org>
Thu, 13 Jun 2019 09:28:43 +0000 (11:28 +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/libnet/libnet_passwd.c

index 362a99369f26cb8885b0914f893e90ca66454bb9..0f509b961cf32b44584d68107ba86e9461b7612b 100644 (file)
@@ -24,6 +24,7 @@
 #include "libcli/auth/libcli_auth.h"
 #include "librpc/gen_ndr/ndr_samr_c.h"
 
+#include "libcli/util/gnutls_error.h"
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
@@ -301,20 +302,20 @@ static NTSTATUS libnet_SetPassword_samr_handle_26(struct libnet_context *ctx, TA
 
        rc = gnutls_hash_init(&hash_hnd, GNUTLS_DIG_MD5);
        if (rc < 0) {
-               status = NT_STATUS_NO_MEMORY;
+               status = gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED);
                goto out;
        }
 
        rc = gnutls_hash(hash_hnd, confounder, 16);
        if (rc < 0) {
                gnutls_hash_deinit(hash_hnd, NULL);
-               status = NT_STATUS_INTERNAL_ERROR;
+               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);
-               status = NT_STATUS_INTERNAL_ERROR;
+               status = gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED);
                goto out;
        }
 
@@ -382,20 +383,20 @@ static NTSTATUS libnet_SetPassword_samr_handle_25(struct libnet_context *ctx, TA
 
        rc = gnutls_hash_init(&hash_hnd, GNUTLS_DIG_MD5);
        if (rc < 0) {
-               status = NT_STATUS_NO_MEMORY;
+               status = gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED);
                goto out;
        }
 
        rc = gnutls_hash(hash_hnd, confounder, 16);
        if (rc < 0) {
                gnutls_hash_deinit(hash_hnd, NULL);
-               status = NT_STATUS_NO_MEMORY;
+               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);
-               status = NT_STATUS_NO_MEMORY;
+               status = gnutls_error_to_ntstatus(rc, NT_STATUS_HASH_NOT_SUPPORTED);
                goto out;
        }