diff options
Diffstat (limited to 'auth2.c')
-rw-r--r-- | auth2.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: auth2.c,v 1.15 2000/09/21 11:25:32 markus Exp $"); | 26 | RCSID("$OpenBSD: auth2.c,v 1.16 2000/09/27 21:41:34 markus Exp $"); |
27 | 27 | ||
28 | #include <openssl/dsa.h> | 28 | #include <openssl/dsa.h> |
29 | #include <openssl/rsa.h> | 29 | #include <openssl/rsa.h> |
@@ -472,8 +472,10 @@ user_dsa_key_allowed(struct passwd *pw, Key *key) | |||
472 | if (fstat(fileno(f), &st) < 0 || | 472 | if (fstat(fileno(f), &st) < 0 || |
473 | (st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 473 | (st.st_uid != 0 && st.st_uid != pw->pw_uid) || |
474 | (st.st_mode & 022) != 0) { | 474 | (st.st_mode & 022) != 0) { |
475 | snprintf(buf, sizeof buf, "DSA authentication refused for %.100s: " | 475 | snprintf(buf, sizeof buf, |
476 | "bad ownership or modes for '%s'.", pw->pw_name, file); | 476 | "%s authentication refused for %.100s: " |
477 | "bad ownership or modes for '%s'.", | ||
478 | key_type(key), pw->pw_name, file); | ||
477 | fail = 1; | 479 | fail = 1; |
478 | } else { | 480 | } else { |
479 | /* Check path to SSH_USER_PERMITTED_KEYS */ | 481 | /* Check path to SSH_USER_PERMITTED_KEYS */ |
@@ -488,9 +490,9 @@ user_dsa_key_allowed(struct passwd *pw, Key *key) | |||
488 | (st.st_uid != 0 && st.st_uid != pw->pw_uid) || | 490 | (st.st_uid != 0 && st.st_uid != pw->pw_uid) || |
489 | (st.st_mode & 022) != 0) { | 491 | (st.st_mode & 022) != 0) { |
490 | snprintf(buf, sizeof buf, | 492 | snprintf(buf, sizeof buf, |
491 | "DSA authentication refused for %.100s: " | 493 | "%s authentication refused for %.100s: " |
492 | "bad ownership or modes for '%s'.", | 494 | "bad ownership or modes for '%s'.", |
493 | pw->pw_name, line); | 495 | key_type(key), pw->pw_name, line); |
494 | fail = 1; | 496 | fail = 1; |
495 | break; | 497 | break; |
496 | } | 498 | } |
@@ -504,7 +506,7 @@ user_dsa_key_allowed(struct passwd *pw, Key *key) | |||
504 | } | 506 | } |
505 | } | 507 | } |
506 | found_key = 0; | 508 | found_key = 0; |
507 | found = key_new(KEY_DSA); | 509 | found = key_new(key->type); |
508 | 510 | ||
509 | while (fgets(line, sizeof(line), f)) { | 511 | while (fgets(line, sizeof(line), f)) { |
510 | char *cp, *options = NULL; | 512 | char *cp, *options = NULL; |