diff options
Diffstat (limited to 'authfile.c')
-rw-r--r-- | authfile.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/authfile.c b/authfile.c index 1ecbda8b1..cb95cfcb8 100644 --- a/authfile.c +++ b/authfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: authfile.c,v 1.95 2013/01/08 18:49:04 markus Exp $ */ | 1 | /* $OpenBSD: authfile.c,v 1.97 2013/05/17 00:13:13 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -90,7 +90,7 @@ key_private_rsa1_to_blob(Key *key, Buffer *blob, const char *passphrase, | |||
90 | u_char buf[100], *cp; | 90 | u_char buf[100], *cp; |
91 | int i, cipher_num; | 91 | int i, cipher_num; |
92 | CipherContext ciphercontext; | 92 | CipherContext ciphercontext; |
93 | Cipher *cipher; | 93 | const Cipher *cipher; |
94 | u_int32_t rnd; | 94 | u_int32_t rnd; |
95 | 95 | ||
96 | /* | 96 | /* |
@@ -422,7 +422,7 @@ key_parse_private_rsa1(Buffer *blob, const char *passphrase, char **commentp) | |||
422 | Buffer decrypted; | 422 | Buffer decrypted; |
423 | u_char *cp; | 423 | u_char *cp; |
424 | CipherContext ciphercontext; | 424 | CipherContext ciphercontext; |
425 | Cipher *cipher; | 425 | const Cipher *cipher; |
426 | Key *prv = NULL; | 426 | Key *prv = NULL; |
427 | Buffer copy; | 427 | Buffer copy; |
428 | 428 | ||
@@ -510,8 +510,8 @@ key_parse_private_rsa1(Buffer *blob, const char *passphrase, char **commentp) | |||
510 | return prv; | 510 | return prv; |
511 | 511 | ||
512 | fail: | 512 | fail: |
513 | if (commentp) | 513 | if (commentp != NULL) |
514 | xfree(*commentp); | 514 | free(*commentp); |
515 | key_free(prv); | 515 | key_free(prv); |
516 | return NULL; | 516 | return NULL; |
517 | } | 517 | } |
@@ -833,10 +833,10 @@ key_load_cert(const char *filename) | |||
833 | pub = key_new(KEY_UNSPEC); | 833 | pub = key_new(KEY_UNSPEC); |
834 | xasprintf(&file, "%s-cert.pub", filename); | 834 | xasprintf(&file, "%s-cert.pub", filename); |
835 | if (key_try_load_public(pub, file, NULL) == 1) { | 835 | if (key_try_load_public(pub, file, NULL) == 1) { |
836 | xfree(file); | 836 | free(file); |
837 | return pub; | 837 | return pub; |
838 | } | 838 | } |
839 | xfree(file); | 839 | free(file); |
840 | key_free(pub); | 840 | key_free(pub); |
841 | return NULL; | 841 | return NULL; |
842 | } | 842 | } |
@@ -1034,10 +1034,9 @@ blacklisted_key_in_file(Key *key, const char *blacklist_file, char **fp) | |||
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | out: | 1036 | out: |
1037 | if (dgst_packed) | 1037 | free(dgst_packed); |
1038 | xfree(dgst_packed); | ||
1039 | if (ret != 1 && dgst_hex) { | 1038 | if (ret != 1 && dgst_hex) { |
1040 | xfree(dgst_hex); | 1039 | free(dgst_hex); |
1041 | dgst_hex = NULL; | 1040 | dgst_hex = NULL; |
1042 | } | 1041 | } |
1043 | if (fp) | 1042 | if (fp) |
@@ -1065,7 +1064,7 @@ blacklisted_key(Key *key, char **fp) | |||
1065 | xasprintf(&blacklist_file, "%s.%s-%u", | 1064 | xasprintf(&blacklist_file, "%s.%s-%u", |
1066 | _PATH_BLACKLIST, key_type(public), key_size(public)); | 1065 | _PATH_BLACKLIST, key_type(public), key_size(public)); |
1067 | ret = blacklisted_key_in_file(public, blacklist_file, fp); | 1066 | ret = blacklisted_key_in_file(public, blacklist_file, fp); |
1068 | xfree(blacklist_file); | 1067 | free(blacklist_file); |
1069 | if (ret > 0) { | 1068 | if (ret > 0) { |
1070 | key_free(public); | 1069 | key_free(public); |
1071 | return ret; | 1070 | return ret; |
@@ -1074,7 +1073,7 @@ blacklisted_key(Key *key, char **fp) | |||
1074 | xasprintf(&blacklist_file, "%s.%s-%u", | 1073 | xasprintf(&blacklist_file, "%s.%s-%u", |
1075 | _PATH_BLACKLIST_CONFIG, key_type(public), key_size(public)); | 1074 | _PATH_BLACKLIST_CONFIG, key_type(public), key_size(public)); |
1076 | ret2 = blacklisted_key_in_file(public, blacklist_file, fp); | 1075 | ret2 = blacklisted_key_in_file(public, blacklist_file, fp); |
1077 | xfree(blacklist_file); | 1076 | free(blacklist_file); |
1078 | if (ret2 > ret) | 1077 | if (ret2 > ret) |
1079 | ret = ret2; | 1078 | ret = ret2; |
1080 | 1079 | ||