Mercurial > dropbear
comparison svr-authpubkey.c @ 158:364a75cfebab
Log the IP along with auth success/fail attempts
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 23 Dec 2004 17:00:15 +0000 |
parents | b0316ce64e4b |
children | 0cfba3034be5 |
comparison
equal
deleted
inserted
replaced
156:8c2b3506f112 | 158:364a75cfebab |
---|---|
102 /* ... and finally verify the signature */ | 102 /* ... and finally verify the signature */ |
103 fp = sign_key_fingerprint(keyblob, keybloblen); | 103 fp = sign_key_fingerprint(keyblob, keybloblen); |
104 if (buf_verify(ses.payload, key, buf_getptr(signbuf, signbuf->len), | 104 if (buf_verify(ses.payload, key, buf_getptr(signbuf, signbuf->len), |
105 signbuf->len) == DROPBEAR_SUCCESS) { | 105 signbuf->len) == DROPBEAR_SUCCESS) { |
106 dropbear_log(LOG_NOTICE, | 106 dropbear_log(LOG_NOTICE, |
107 "pubkey auth succeeded for '%s' with key %s", | 107 "pubkey auth succeeded for '%s' with key %s from %s", |
108 ses.authstate.printableuser, fp); | 108 ses.authstate.printableuser, fp, svr_ses.addrstring); |
109 send_msg_userauth_success(); | 109 send_msg_userauth_success(); |
110 } else { | 110 } else { |
111 dropbear_log(LOG_WARNING, | 111 dropbear_log(LOG_WARNING, |
112 "pubkey auth bad signature for '%s' with key %s", | 112 "pubkey auth bad signature for '%s' with key %s from %s", |
113 ses.authstate.printableuser, fp); | 113 ses.authstate.printableuser, fp, svr_ses.addrstring); |
114 send_msg_userauth_failure(0, 1); | 114 send_msg_userauth_failure(0, 1); |
115 } | 115 } |
116 m_free(fp); | 116 m_free(fp); |
117 | 117 |
118 out: | 118 out: |
163 TRACE(("enter checkpubkey")); | 163 TRACE(("enter checkpubkey")); |
164 | 164 |
165 /* check that we can use the algo */ | 165 /* check that we can use the algo */ |
166 if (have_algo(algo, algolen, sshhostkey) == DROPBEAR_FAILURE) { | 166 if (have_algo(algo, algolen, sshhostkey) == DROPBEAR_FAILURE) { |
167 dropbear_log(LOG_WARNING, | 167 dropbear_log(LOG_WARNING, |
168 "pubkey auth attempt with unknown algo for '%s'", | 168 "pubkey auth attempt with unknown algo for '%s' from %s", |
169 ses.authstate.printableuser); | 169 ses.authstate.printableuser, svr_ses.addrstring); |
170 goto out; | 170 goto out; |
171 } | 171 } |
172 | 172 |
173 /* check file permissions, also whether file exists */ | 173 /* check file permissions, also whether file exists */ |
174 if (checkpubkeyperms() == DROPBEAR_FAILURE) { | 174 if (checkpubkeyperms() == DROPBEAR_FAILURE) { |