|
Lines 1-4
Link Here
|
| 1 |
/* $OpenBSD: auth-rsa.c,v 1.78 2010/07/13 23:13:16 djm Exp $ */ |
1 |
/* $OpenBSD: auth-rsa.c,v 1.78 2010/07/13 23:13:16 djm Exp $ */ |
|
|
2 |
|
| 2 |
/* |
3 |
/* |
| 3 |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
| 4 |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
5 |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
|
Lines 92-98
auth_rsa_verify_response(Key *key, BIGNU
Link Here
|
| 92 |
{ |
93 |
{ |
| 93 |
u_char buf[32], mdbuf[16]; |
94 |
u_char buf[32], mdbuf[16]; |
| 94 |
MD5_CTX md; |
95 |
MD5_CTX md; |
| 95 |
int len; |
96 |
int len, rv; |
|
|
97 |
#ifdef SSH_AUDIT_EVENTS |
| 98 |
char *fp; |
| 99 |
#endif |
| 96 |
|
100 |
|
| 97 |
if (auth_key_is_revoked(key)) |
101 |
if (auth_key_is_revoked(key)) |
| 98 |
return 0; |
102 |
return 0; |
|
Lines 116-127
auth_rsa_verify_response(Key *key, BIGNU
Link Here
|
| 116 |
MD5_Final(mdbuf, &md); |
120 |
MD5_Final(mdbuf, &md); |
| 117 |
|
121 |
|
| 118 |
/* Verify that the response is the original challenge. */ |
122 |
/* Verify that the response is the original challenge. */ |
| 119 |
if (timingsafe_bcmp(response, mdbuf, 16) != 0) { |
123 |
rv = timingsafe_bcmp(response, mdbuf, 16) == 0; |
| 120 |
/* Wrong answer. */ |
124 |
|
| 121 |
return (0); |
125 |
#ifdef SSH_AUDIT_EVENTS |
|
|
126 |
fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); |
| 127 |
if (audit_keyusage("ssh-rsa1", RSA_size(key->rsa), fp, rv) == 0) { |
| 128 |
debug("unsuccessful audit"); |
| 129 |
rv = 0; |
| 122 |
} |
130 |
} |
| 123 |
/* Correct answer. */ |
131 |
xfree(fp); |
| 124 |
return (1); |
132 |
#endif |
|
|
133 |
|
| 134 |
return rv; |
| 125 |
} |
135 |
} |
| 126 |
|
136 |
|
| 127 |
/* |
137 |
/* |
|
Lines 275-280
auth_rsa_key_allowed(struct passwd *pw,
Link Here
|
| 275 |
*rkey = key; |
285 |
*rkey = key; |
| 276 |
else |
286 |
else |
| 277 |
key_free(key); |
287 |
key_free(key); |
|
|
288 |
|
| 278 |
return (allowed); |
289 |
return (allowed); |
| 279 |
} |
290 |
} |
| 280 |
|
291 |
|