1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-24 13:57:43 +03:00

s4:ntp_signd: Use gnutls_error_to_ntstatus() in ntp_signd

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jun 24 07:27:21 UTC 2019 on sn-devel-184
This commit is contained in:
Andreas Schneider 2019-06-13 11:30:55 +02:00 committed by Andreas Schneider
parent 4bcf72aa3d
commit 5ae1767970

View File

@ -40,6 +40,7 @@
#include "system/network.h"
#include "system/passwd.h"
#include "libcli/util/gnutls_error.h"
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
@ -248,10 +249,7 @@ static NTSTATUS ntp_signd_process(struct ntp_signd_connection *ntp_signd_conn,
/* Sign the NTP response with the unicodePwd */
ret = gnutls_hash_init(&hash_hnd, GNUTLS_DIG_MD5);
if (ret < 0) {
if (ret == GNUTLS_E_UNWANTED_ALGORITHM) {
return NT_STATUS_HASH_NOT_SUPPORTED;
}
return NT_STATUS_NO_MEMORY;
return gnutls_error_to_ntstatus(ret, NT_STATUS_HASH_NOT_SUPPORTED);
}
ret = gnutls_hash(hash_hnd,
@ -259,14 +257,14 @@ static NTSTATUS ntp_signd_process(struct ntp_signd_connection *ntp_signd_conn,
sizeof(nt_hash->hash));
if (ret < 0) {
gnutls_hash_deinit(hash_hnd, NULL);
return NT_STATUS_INTERNAL_ERROR;
return gnutls_error_to_ntstatus(ret, NT_STATUS_HASH_NOT_SUPPORTED);
}
ret = gnutls_hash(hash_hnd,
sign_request.packet_to_sign.data,
sign_request.packet_to_sign.length);
if (ret < 0) {
gnutls_hash_deinit(hash_hnd, NULL);
return NT_STATUS_INTERNAL_ERROR;
return gnutls_error_to_ntstatus(ret, NT_STATUS_HASH_NOT_SUPPORTED);
}
gnutls_hash_deinit(hash_hnd,