| 1 |
/* |
| 2 |
Copyright (C) 2005-2026 Free Software Foundation, Inc. |
| 3 |
|
| 4 |
This file is part of GNU Inetutils. |
| 5 |
|
| 6 |
GNU Inetutils is free software: you can redistribute it and/or modify |
| 7 |
it under the terms of the GNU General Public License as published by |
| 8 |
the Free Software Foundation, either version 3 of the License, or (at |
| 9 |
your option) any later version. |
| 10 |
|
| 11 |
GNU Inetutils is distributed in the hope that it will be useful, but |
| 12 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 |
General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU General Public License |
| 17 |
along with this program. If not, see `http://www.gnu.org/licenses/'. */ |
| 18 |
|
| 19 |
#ifdef SHISHI |
| 20 |
# include <sys/socket.h> |
| 21 |
# include <netinet/in.h> |
| 22 |
|
| 23 |
# define SERVICE "host" |
| 24 |
# define SHISHI_ENCRYPT_BUFLEN 1040 |
| 25 |
|
| 26 |
struct shishi_iv |
| 27 |
{ |
| 28 |
char *iv; |
| 29 |
int ivlen; |
| 30 |
int keyusage; |
| 31 |
Shishi_crypto *ctx; |
| 32 |
int first; |
| 33 |
}; |
| 34 |
typedef struct shishi_iv shishi_ivector; |
| 35 |
|
| 36 |
struct auth_data |
| 37 |
{ |
| 38 |
struct sockaddr_storage from; |
| 39 |
socklen_t fromlen; |
| 40 |
char *hostaddr; |
| 41 |
char *hostname; |
| 42 |
char *lusername; |
| 43 |
char *rusername; |
| 44 |
char *rprincipal; |
| 45 |
char *term; |
| 46 |
char *env[2]; |
| 47 |
int kerberos_version; |
| 48 |
int verbose; |
| 49 |
Shishi *h; |
| 50 |
Shishi_ap *ap; |
| 51 |
int protocol; |
| 52 |
Shishi_key *enckey; |
| 53 |
shishi_ivector iv1, iv2; |
| 54 |
shishi_ivector *ivtab[2]; |
| 55 |
}; |
| 56 |
|
| 57 |
extern int shishi_auth (Shishi ** handle, int verbose, char **cname, |
| 58 |
const char *sname, int sock, char *cmd, |
| 59 |
unsigned short port, Shishi_key ** enckey, |
| 60 |
const char *realm); |
| 61 |
|
| 62 |
extern int get_auth (int infd, Shishi ** handle, Shishi_ap ** ap, |
| 63 |
Shishi_key ** enckey, const char **err_msg, |
| 64 |
int *protoversion, int *cksumtype, char **cksum, |
| 65 |
size_t *cksumlen, char *srvname); |
| 66 |
|
| 67 |
extern int readenc (Shishi * h, int sock, char *buf, int *len, |
| 68 |
shishi_ivector * iv, Shishi_key * enckey, int proto); |
| 69 |
|
| 70 |
extern int writeenc (Shishi * h, int sock, char *buf, int wlen, int *len, |
| 71 |
shishi_ivector * iv, Shishi_key * enckey, int proto); |
| 72 |
|
| 73 |
extern int krcmd (Shishi ** h, char **ahost, unsigned short rport, |
| 74 |
char **remuser, char *cmd, int *fd2p, |
| 75 |
const char *realm, int af); |
| 76 |
|
| 77 |
extern int krcmd_mutual (Shishi ** h, char **ahost, unsigned short rport, |
| 78 |
char **remuser, char *cmd, int *fd2p, |
| 79 |
const char *realm, Shishi_key ** key, int af); |
| 80 |
|
| 81 |
#endif |