Browse code

management: preserve wait_for_push field when asking for user/pass

With the introduction of the wait_for_push field in the auth_user_pass
structure, we have to make sure that such field is not accidentally
erased when the management asks the user for user/pass.

Erasing such field would mess up the logic introduced by
("Ignore auth-nocache for auth-user-pass if auth-token is pushed").

Thanks to David Sommerseth for the preliminary analysis and debugging.

Reported-by: Steven Haigh <netwiz@crc.id.au>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
Tested-by: Steven Haigh <netwiz@crc.id.au>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20170707140108.31612-1-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15015.html
Signed-off-by: David Sommerseth <davids@openvpn.net>

Antonio Quartulli authored on 2017/07/07 23:01:08
Showing 1 changed files
... ...
@@ -3501,7 +3501,9 @@ management_query_user_pass(struct management *man,
3501 3501
          */
3502 3502
         if (ret)
3503 3503
         {
3504
-            man->connection.up_query.nocache = up->nocache; /* preserve caller's nocache setting */
3504
+            /* preserve caller's settings */
3505
+            man->connection.up_query.nocache = up->nocache;
3506
+            man->connection.up_query.wait_for_push = up->wait_for_push;
3505 3507
             *up = man->connection.up_query;
3506 3508
         }
3507 3509
         secure_memzero(&man->connection.up_query, sizeof(man->connection.up_query));