diff options
author | Andreas Schneider <asn@samba.org> | 2019-06-13 11:28:43 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-06-24 06:11:17 +0000 |
commit | 5823dc5414742b023b1bfee4c9183c9f474e8205 (patch) | |
tree | 25fa14b60ab8d56b6a6e6fb64260a3559c826d94 /source4 | |
parent | b21af2f173b9b653f81e6a45a18b9505f1c4086c (diff) | |
download | samba-5823dc5414742b023b1bfee4c9183c9f474e8205.tar.gz |
s3:libnet: Use gnutls_error_to_ntstatus() in libnet_passwd
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libnet/libnet_passwd.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/libnet/libnet_passwd.c b/source4/libnet/libnet_passwd.c index 362a99369f2..0f509b961cf 100644 --- a/source4/libnet/libnet_passwd.c +++ b/source4/libnet/libnet_passwd.c @@ -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; } |