diff options
author | markus@openbsd.org <markus@openbsd.org> | 2017-05-30 08:52:19 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-05-31 10:47:31 +1000 |
commit | 54d90ace1d3535b44d92a8611952dc109a74a031 (patch) | |
tree | 1b5ff69321b88b32fba058fe2c966bf177c95b28 /auth2-pubkey.c | |
parent | c221219b1fbee47028dcaf66613f4f8d6b7640e9 (diff) |
upstream commit
switch from Key typedef with struct sshkey; ok djm@
Upstream-ID: 3067d33e04efbe5131ce8f70668c47a58e5b7a1f
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r-- | auth2-pubkey.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c index 3e5706f4d..38940a6d9 100644 --- a/auth2-pubkey.c +++ b/auth2-pubkey.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: auth2-pubkey.c,v 1.62 2017/01/30 01:03:00 djm Exp $ */ | 1 | /* $OpenBSD: auth2-pubkey.c,v 1.63 2017/05/30 08:52:19 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -78,7 +78,7 @@ static int | |||
78 | userauth_pubkey(Authctxt *authctxt) | 78 | userauth_pubkey(Authctxt *authctxt) |
79 | { | 79 | { |
80 | Buffer b; | 80 | Buffer b; |
81 | Key *key = NULL; | 81 | struct sshkey *key = NULL; |
82 | char *pkalg, *userstyle, *fp = NULL; | 82 | char *pkalg, *userstyle, *fp = NULL; |
83 | u_char *pkblob, *sig; | 83 | u_char *pkblob, *sig; |
84 | u_int alen, blen, slen; | 84 | u_int alen, blen, slen; |
@@ -220,7 +220,8 @@ done: | |||
220 | } | 220 | } |
221 | 221 | ||
222 | void | 222 | void |
223 | pubkey_auth_info(Authctxt *authctxt, const Key *key, const char *fmt, ...) | 223 | pubkey_auth_info(Authctxt *authctxt, const struct sshkey *key, |
224 | const char *fmt, ...) | ||
224 | { | 225 | { |
225 | char *fp, *extra; | 226 | char *fp, *extra; |
226 | va_list ap; | 227 | va_list ap; |
@@ -761,12 +762,12 @@ match_principals_command(struct passwd *user_pw, const struct sshkey *key) | |||
761 | * returns 1 if the key is allowed or 0 otherwise. | 762 | * returns 1 if the key is allowed or 0 otherwise. |
762 | */ | 763 | */ |
763 | static int | 764 | static int |
764 | check_authkeys_file(FILE *f, char *file, Key* key, struct passwd *pw) | 765 | check_authkeys_file(FILE *f, char *file, struct sshkey* key, struct passwd *pw) |
765 | { | 766 | { |
766 | char line[SSH_MAX_PUBKEY_BYTES]; | 767 | char line[SSH_MAX_PUBKEY_BYTES]; |
767 | int found_key = 0; | 768 | int found_key = 0; |
768 | u_long linenum = 0; | 769 | u_long linenum = 0; |
769 | Key *found; | 770 | struct sshkey *found; |
770 | 771 | ||
771 | found_key = 0; | 772 | found_key = 0; |
772 | 773 | ||
@@ -876,7 +877,7 @@ check_authkeys_file(FILE *f, char *file, Key* key, struct passwd *pw) | |||
876 | 877 | ||
877 | /* Authenticate a certificate key against TrustedUserCAKeys */ | 878 | /* Authenticate a certificate key against TrustedUserCAKeys */ |
878 | static int | 879 | static int |
879 | user_cert_trusted_ca(struct passwd *pw, Key *key) | 880 | user_cert_trusted_ca(struct passwd *pw, struct sshkey *key) |
880 | { | 881 | { |
881 | char *ca_fp, *principals_file = NULL; | 882 | char *ca_fp, *principals_file = NULL; |
882 | const char *reason; | 883 | const char *reason; |
@@ -942,7 +943,7 @@ user_cert_trusted_ca(struct passwd *pw, Key *key) | |||
942 | * returns 1 if the key is allowed or 0 otherwise. | 943 | * returns 1 if the key is allowed or 0 otherwise. |
943 | */ | 944 | */ |
944 | static int | 945 | static int |
945 | user_key_allowed2(struct passwd *pw, Key *key, char *file) | 946 | user_key_allowed2(struct passwd *pw, struct sshkey *key, char *file) |
946 | { | 947 | { |
947 | FILE *f; | 948 | FILE *f; |
948 | int found_key = 0; | 949 | int found_key = 0; |
@@ -965,7 +966,7 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file) | |||
965 | * returns 1 if the key is allowed or 0 otherwise. | 966 | * returns 1 if the key is allowed or 0 otherwise. |
966 | */ | 967 | */ |
967 | static int | 968 | static int |
968 | user_key_command_allowed2(struct passwd *user_pw, Key *key) | 969 | user_key_command_allowed2(struct passwd *user_pw, struct sshkey *key) |
969 | { | 970 | { |
970 | FILE *f = NULL; | 971 | FILE *f = NULL; |
971 | int r, ok, found_key = 0; | 972 | int r, ok, found_key = 0; |
@@ -1088,7 +1089,7 @@ user_key_command_allowed2(struct passwd *user_pw, Key *key) | |||
1088 | * Check whether key authenticates and authorises the user. | 1089 | * Check whether key authenticates and authorises the user. |
1089 | */ | 1090 | */ |
1090 | int | 1091 | int |
1091 | user_key_allowed(struct passwd *pw, Key *key, int auth_attempt) | 1092 | user_key_allowed(struct passwd *pw, struct sshkey *key, int auth_attempt) |
1092 | { | 1093 | { |
1093 | u_int success, i; | 1094 | u_int success, i; |
1094 | char *file; | 1095 | char *file; |