s3-rpc_server: Check NTSTATUS return value from netlogon_creds_aes_decrypt()
authorAndrew Bartlett <abartlet@samba.org>
Fri, 16 Aug 2019 02:05:38 +0000 (14:05 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 21 Aug 2019 09:57:30 +0000 (09:57 +0000)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/rpc_server/netlogon/srv_netlog_nt.c

index 08bce367bf03002a8f7fc792c7ec2b915ec86469..671300676ffc76f8faea3ccccd00bcd5d84b2fc0 100644 (file)
@@ -1369,14 +1369,16 @@ NTSTATUS _netr_ServerPasswordSet2(struct pipes_struct *p,
        SIVAL(password_buf.data, 512, r->in.new_password->length);
 
        if (creds->negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) {
-               netlogon_creds_aes_decrypt(creds, password_buf.data, 516);
+               status = netlogon_creds_aes_decrypt(creds,
+                                                   password_buf.data,
+                                                   516);
        } else {
                status = netlogon_creds_arcfour_crypt(creds,
                                                      password_buf.data,
                                                      516);
-               if (!NT_STATUS_IS_OK(status)) {
-                       return status;
-               }
+       }
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
        }
 
        if (!decode_pw_buffer(p->mem_ctx,