]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Abort client preauth on keyboard interrupt 704/head
authorGreg Hudson <ghudson@mit.edu>
Fri, 22 Sep 2017 20:51:15 +0000 (16:51 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 27 Sep 2017 16:01:50 +0000 (12:01 -0400)
Continuing client preauth after a keyboard interrupt is unexpected and
can manifest bugs (such as the one in ticket 8596) by invoking preauth
mechs we wouldn't ordinarily reach.  Based on a patch by Marc Dionne.

ticket: 8615 (new)

src/lib/krb5/krb/get_in_tkt.c
src/lib/krb5/krb/preauth2.c

index 35d58e8eba1904b3f71267887084a1787ec68e31..47a00bf2c7020e141155e67b0bcae51f90adf16a 100644 (file)
@@ -1358,6 +1358,9 @@ init_creds_step_request(krb5_context context,
             code = ctx->err_reply->error + ERROR_TABLE_BASE_krb5;
         }
     }
+    /* Don't continue after a keyboard interrupt. */
+    if (code == KRB5_LIBOS_PWDINTR)
+        goto cleanup;
     if (code) {
         /* See if we can try a different preauth mech before giving up. */
         k5_save_ctx_error(context, code, &save);
index 21aeff23799f1cfe563b20576f1aa67038ad414e..6b96fa135e1a06b45238bbaac05bbe363760b93b 100644 (file)
@@ -688,6 +688,9 @@ process_pa_data(krb5_context context, krb5_init_creds_context ctx,
                 }
                 free(mod_pa);
             }
+            /* Don't continue to try mechanisms after a keyboard interrupt. */
+            if (ret == KRB5_LIBOS_PWDINTR)
+                goto cleanup;
             if (ret == 0 && real) {
                 /* Stop now and record which real padata type we answered. */
                 *out_type = pa->pa_type;