55#include <rpc/key_prot.h>
58#include <sys/utsname.h>
69#define debug(msg) (void) fprintf(stderr, "%s\n", msg);
83cryptkeyres *(*__key_encryptsession_pk_LOCAL)() = 0;
84cryptkeyres *(*__key_decryptsession_pk_LOCAL)() = 0;
91 const char *secretkey;
100 if (
status != KEY_SUCCESS) {
101 debug(
"set status is nonzero");
118 struct key_netstres kres;
120 memset((
void*)&kres, 0,
sizeof (kres));
123 (kres.status == KEY_SUCCESS) &&
124 (kres.key_netstres_u.knet.st_priv_key[0] != 0)) {
126 memset(kres.key_netstres_u.knet.st_priv_key, 0, HEXKEYBYTES);
141 arg.remotename = remotename;
142 arg.remotekey = *remotekey;
148 if (
res.status != KEY_SUCCESS) {
149 debug(
"encrypt status is nonzero");
165 arg.remotename = remotename;
166 arg.remotekey = *remotekey;
172 if (
res.status != KEY_SUCCESS) {
173 debug(
"decrypt status is nonzero");
182 const char *remotename;
188 arg.remotename = (
char *) remotename;
194 if (
res.status != KEY_SUCCESS) {
195 debug(
"encrypt status is nonzero");
204 const char *remotename;
210 arg.remotename = (
char *) remotename;
216 if (
res.status != KEY_SUCCESS) {
217 debug(
"decrypt status is nonzero");
237struct key_netstarg *
arg;
247 if (
status != KEY_SUCCESS) {
248 debug(
"key_setnet status is nonzero");
266 if (
res.status != KEY_SUCCESS) {
267 debug(
"get_conv status is nonzero");
310#define TOTAL_TIMEOUT 30
313 if (key_call_key == -1) {
315 if (key_call_key == -1)
356#if defined(__FreeBSD__)
364#error Unknown architecture!
379 KEY_PROG, vers, nconf);
390 KEY_PROG, vers, tpconf);
410 fcntl(
fd, F_SETFD, 1);
431 *(cryptkeyres*)rslt = *
res;
436 *(cryptkeyres*)rslt = *
res;
445 if ((
proc == KEY_ENCRYPT_PK) || (
proc == KEY_DECRYPT_PK) ||
446 (
proc == KEY_NET_GET) || (
proc == KEY_NET_PUT) ||
447 (
proc == KEY_GET_CONV))
int strcmp(const char *String1, const char *String2)
int key_encryptsession_pk()
#define clnt_control(cl, rq, in)
#define CLSET_RETRY_TIMEOUT
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)
CLIENT * clnt_tp_create(const char *hostname, const rpcprog_t prog, const rpcvers_t vers, const struct netconfig *nconf)
#define auth_destroy(auth)
#define authsys_create(c, i1, i2, i3, ip)
static void deskey(const unsigned char *key, short edf, ulong32 *keyout)
int endnetconfig(void *handlep)
struct netconfig * getnetconfig(void *handlep)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
cryptkeyres *(* __key_encryptsession_pk_LOCAL)()=0
int key_setsecret(char *secretkey) const
static int key_call(u_long, xdrproc_t, void *, xdrproc_t, void *)
int key_decryptsession(char *remotename, des_block *deskey) const
static void key_call_destroy(void *vp)
cryptkeyres *(* __key_decryptsession_pk_LOCAL)()=0
static struct key_call_private * key_call_private_main
int key_get_conv(char *pkey, des_block *deskey)
des_block *(* __key_gendes_LOCAL)()=0
static CLIENT * getkeyserv_handle(int vers)
int key_secretkey_is_set(void)
int key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey)
int key_setnet(struct key_netstarg *arg)
int key_gendes(des_block *key)
int key_encryptsession(char *remotename, des_block *deskey) const
bool_t xdr_key_netstres(register XDR *xdrs, key_netstres *objp)
bool_t xdr_key_netstarg(register XDR *xdrs, key_netstarg *objp)
bool_t xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp)
bool_t xdr_cryptkeyarg(register XDR *xdrs, cryptkeyarg *objp)
bool_t xdr_keybuf(register XDR *xdrs, keybuf objp)
bool_t xdr_cryptkeyarg2(register XDR *xdrs, cryptkeyarg2 *objp)
bool_t xdr_keystatus(register XDR *xdrs, keystatus *objp)
#define thr_setspecific(k, p)
#define thr_getspecific(k)
#define thr_keycreate(k, d)
bool_t xdr_des_block(XDR *xdrs, des_block *blkp)
unsigned long nc_semantics
bool_t(* xdrproc_t)(XDR *,...)