libcli:auth: Return NTSTATUS for netlogon_creds_arcfour_crypt()
[samba.git] / source3 / rpc_client / init_netlogon.c
index 4d9157bbb8c2a3e0f6e641362e913480e023ba01..26deaba8065509e4e5c5ac9474ab2279132df6a7 100644 (file)
@@ -31,13 +31,19 @@ void init_netr_CryptPassword(const char *pwd,
                             struct netr_CryptPassword *pwd_buf)
 {
        struct samr_CryptPassword password_buf;
+       NTSTATUS status;
 
        encode_pw_buffer(password_buf.data, pwd, STR_UNICODE);
 
        if (creds->negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) {
                netlogon_creds_aes_encrypt(creds, password_buf.data, 516);
        } else {
-               netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
+               status = netlogon_creds_arcfour_crypt(creds,
+                                                     password_buf.data,
+                                                     516);
+               if (!NT_STATUS_IS_OK(status)) {
+                       return;
+               }
        }
        memcpy(pwd_buf->data, password_buf.data, 512);
        pwd_buf->length = IVAL(password_buf.data, 512);