torture/attr: use security_ace_equal instead of sec_ace_equal
[samba.git] / auth / credentials / credentials_ntlm.c
index 7f4af4f08cd8183b829e5bf6b9f6aefe47e30cf4..8c6be39522690e7f6e2c6781b47a165c8c443fe6 100644 (file)
@@ -26,6 +26,7 @@
 #include "../lib/crypto/crypto.h"
 #include "libcli/auth/libcli_auth.h"
 #include "auth/credentials/credentials.h"
+#include "auth/credentials/credentials_internal.h"
 
 _PUBLIC_ NTSTATUS cli_credentials_get_ntlm_response(struct cli_credentials *cred, TALLOC_CTX *mem_ctx, 
                                           int *flags,
@@ -110,7 +111,7 @@ _PUBLIC_ NTSTATUS cli_credentials_get_ntlm_response(struct cli_credentials *cred
                /* LM Key is incompatible... */
                *flags &= ~CLI_CRED_LANMAN_AUTH;
        } else if (*flags & CLI_CRED_NTLM2) {
-               struct MD5Context md5_session_nonce_ctx;
+               MD5_CTX md5_session_nonce_ctx;
                uint8_t session_nonce[16];
                uint8_t session_nonce_hash[16];
                uint8_t user_session_key[16];
@@ -174,8 +175,7 @@ _PUBLIC_ NTSTATUS cli_credentials_get_ntlm_response(struct cli_credentials *cred
                                        lm_response = nt_response;
                                        /* LM Key is incompatible with 'long' passwords */
                                        *flags &= ~CLI_CRED_LANMAN_AUTH;
-                               } else {
-                                       E_deshash(password, lm_hash);
+                               } else if (E_deshash(password, lm_hash)) {
                                        lm_session_key = data_blob_talloc(mem_ctx, NULL, 16);
                                        memcpy(lm_session_key.data, lm_hash, 8);
                                        memset(&lm_session_key.data[8], '\0', 8);
@@ -193,8 +193,7 @@ _PUBLIC_ NTSTATUS cli_credentials_get_ntlm_response(struct cli_credentials *cred
                        *flags &= ~CLI_CRED_LANMAN_AUTH;
 
                        password = cli_credentials_get_password(cred);
-                       if (password) {
-                               E_deshash(password, lm_hash);
+                       if (password && E_deshash(password, lm_hash)) {
                                lm_session_key = data_blob_talloc(mem_ctx, NULL, 16);
                                memcpy(lm_session_key.data, lm_hash, 8);
                                memset(&lm_session_key.data[8], '\0', 8);