|
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 |
"unknown" }; |
| 124 |
|
| 125 |
fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); |
| 126 |
switch(key->type) { |
| 127 |
case KEY_RSA1: |
| 128 |
case KEY_RSA: |
| 129 |
size = RSA_size(key->rsa); |
| 130 |
break; |
| 131 |
case KEY_DSA: |
| 132 |
size = DSA_size(key->dsa); |
| 133 |
break; |
| 134 |
} |
| 135 |
|
| 136 |
if (audit_keyusage(0, crypto_name[key->type], size, fp, *rv) == 0) |
| 137 |
*rv = 0; |
| 138 |
xfree(fp); |
| 139 |
} |
| 140 |
|
| 114 |
# ifndef CUSTOM_SSH_AUDIT_EVENTS |
141 |
# ifndef CUSTOM_SSH_AUDIT_EVENTS |
| 115 |
/* |
142 |
/* |
| 116 |
* Null implementations of audit functions. |
143 |
* 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(), |
209 |
debug("audit run command euid %d user %s command '%.200s'", geteuid(), |
| 183 |
audit_username(), command); |
210 |
audit_username(), command); |
| 184 |
} |
211 |
} |
|
|
212 |
|
| 213 |
/* |
| 214 |
* This will be called when user is successfully autherized by the RSA1/RSA/DSA key. |
| 215 |
* |
| 216 |
* Type is the key type, len is the key length(byte) and fp is the fingerprint of the key. |
| 217 |
*/ |
| 218 |
int |
| 219 |
audit_keyusage(int host_user, const char *type, unsigned len, char *fp, int rv) |
| 220 |
{ |
| 221 |
debug("audit %s key usage euid %d user %s key type %s key length %d fingerprint %s, result %d", |
| 222 |
host_user ? "hostbased" : "pubkey", geteuid(), audit_username(), type, len, fp, rv); |
| 223 |
} |
| 185 |
# endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ |
224 |
# endif /* !defined CUSTOM_SSH_AUDIT_EVENTS */ |
| 186 |
#endif /* SSH_AUDIT_EVENTS */ |
225 |
#endif /* SSH_AUDIT_EVENTS */ |