summaryrefslogtreecommitdiff
path: root/h
diff options
context:
space:
mode:
authorGravatar David Benjamin <davidben@mit.edu>2013-08-20 13:40:19 -0400
committerGravatar Karl Ramm <kcr@1ts.org>2013-09-28 14:20:40 -0400
commitf269734ef50e1a9aa22eb9f18125967ca772744b (patch)
treef8ec0ecea416fac1698484b16d73d55b0378ed46 /h
parent50d60c3dc739be77574cbf80bc24d7fbd2ff41be (diff)
Create an alternate Z_AuthProc that saves keys
The start of proper session key management in libzephyr. A new Z_AuthProc is added which appends the key into a queue. ZSubscribeTo and ZSubscribeToSansDefaults are modified to use it. For now, it's extremely simple and makes no attempt to expire old keys.
Diffstat (limited to 'h')
-rw-r--r--h/internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/h/internal.h b/h/internal.h
index f87c8a2..54c595c 100644
--- a/h/internal.h
+++ b/h/internal.h
@@ -32,6 +32,8 @@
#define HM_SVC_FALLBACK htons((unsigned short) 2104)
#define HM_SRV_SVC_FALLBACK htons((unsigned short) 2105)
+#define ZSUBAUTH (Z_MakeAuthenticationSaveKey)
+
#define ZAUTH_UNSET (-3) /* Internal to client library. */
#define Z_MAXFRAGS 500 /* Max number of packet fragments */
#define Z_MAXNOTICESIZE 400000 /* Max size of incoming notice */
@@ -81,6 +83,16 @@ extern int __Zephyr_server; /* 0 if normal client, 1 if server or zhm */
#ifdef HAVE_KRB5
extern krb5_context Z_krb5_ctx;
Code_t Z_krb5_lookup_cksumtype(krb5_enctype, krb5_cksumtype *);
+
+struct _Z_SessionKey {
+ struct _Z_SessionKey *next;
+ struct _Z_SessionKey *prev;
+ krb5_keyblock *keyblock;
+ time_t send_time;
+ time_t first_use;
+};
+
+extern struct _Z_SessionKey *Z_keys_head, *Z_keys_tail;
#endif
extern ZLocations_t *__locate_list;
@@ -133,6 +145,8 @@ Code_t Z_AsciiFormatRawHeader (ZNotice_t *, char *, int, int *, char **,
void Z_gettimeofday(struct _ZTimeval *ztv, struct timezone *tz);
+Code_t Z_MakeAuthenticationSaveKey(ZNotice_t*, char *,int, int*);
+
#ifdef HAVE_KRB5
int ZGetCreds(krb5_creds **creds_out);
int ZGetCredsRealm(krb5_creds **creds_out, char *realm);