|
Lines 111-116
audit_event_lookup(ssh_audit_event_t ev)
Link Here
|
| 111 |
return(event_lookup[i].name); |
111 |
return(event_lookup[i].name); |
| 112 |
} |
112 |
} |
| 113 |
|
113 |
|
|
|
114 |
int |
| 115 |
audit_key(int type, int *rv, const Key *key) |
| 116 |
{ |
| 117 |
char *fp; |
| 118 |
unsigned size = 0; |
| 119 |
const char *crypto_name[] = { |
| 120 |
"ssh-rsa1", |
| 121 |
"ssh-rsa", |
| 122 |
"ssh-dsa", |
| 123 |
"ssh-rsa-cert", |
| 124 |
"ssh-dsa-cert", |
| 125 |
"ssh-rsa-cert-v00", |
| 126 |
"ssh-dsa-cert-v00", |
| 127 |
"ssh-null", |
| 128 |
"unknown" }; |
| 129 |
|
| 130 |
fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); |
| 131 |
switch(key->type) { |
| 132 |
case KEY_RSA1: |
| 133 |
case KEY_RSA: |
| 134 |
case KEY_RSA_CERT: |
| 135 |
case KEY_RSA_CERT_V00: |
| 136 |
size = RSA_size(key->rsa); |
| 137 |
break; |
| 138 |
case KEY_DSA: |
| 139 |
case KEY_DSA_CERT: |
| 140 |
case KEY_DSA_CERT_V00: |
| 141 |
size = DSA_size(key->dsa); |
| 142 |
break; |
| 143 |
} |
| 144 |
|
| 145 |
if (audit_keyusage(0, crypto_name[key->type <= KEY_UNSPEC ? key->type : KEY_UNSPEC], size, fp, *rv) == 0) |
| 146 |
*rv = 0; |
| 147 |
xfree(fp); |
| 148 |
} |
| 149 |
|
| 114 |
# ifndef CUSTOM_SSH_AUDIT_EVENTS |
150 |
# ifndef CUSTOM_SSH_AUDIT_EVENTS |
| 115 |
/* |
151 |
/* |
| 116 |
* Null implementations of audit functions. |
152 |
* Null implementations of audit functions. |
|
Lines 182-186
audit_run_command(const char *command)
Link Here
|
| 182 |
debug("audit run command euid %d user %s command '%.200s'", geteuid(), |
218 |
debug("audit run command euid %d user %s command '%.200s'", geteuid(), |
| 183 |
audit_username(), command); |
219 |
audit_username(), command); |
| 184 |
} |
220 |
} |
|
|
221 |
|
| 222 |
/* |
| 223 |
* This will be called when user is successfully autherized by the RSA1/RSA/DSA key. |
| 224 |
* |
| 225 |
* Type is the key type, len is the key length(byte) and fp is the fingerprint of the key. |
| 226 |
*/ |
| 227 |
int |
| 228 |
audit_keyusage(int host_user, const char *type, unsigned len, char *fp, int rv) |
| 229 |
{ |
| 230 |
debug("audit %s key usage euid %d user %s key type %s key length %d fingerprint %s, result %d", |
| 231 |
host_user ? "hostbased" : "pubkey", geteuid(), audit_username(), type, len, fp, rv); |
| 232 |
} |
| 185 |
# endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ |
233 |
# endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ |
| 186 |
#endif /* SSH_AUDIT_EVENTS */ |
234 |
#endif /* SSH_AUDIT_EVENTS */ |