rxkad: Move conversion functions to own file
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 5 Apr 2012 19:58:11 +0000 (15:58 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 10 Apr 2012 17:07:19 +0000 (10:07 -0700)
Move the various key conversion functions into thir own header file,
rather than rxkad_prototypes.h. This means we can isolate the dependency
on the hcrypto DES headers (which we don't install)

Change-Id: I8efcbf97b6794d9573f35eec9d4a32e9ff4cf352
Reviewed-on: http://gerrit.openafs.org/7067
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

15 files changed:
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/client.c
src/kauth/kaprocs.c
src/kauth/kautils.c
src/kauth/kpasswd.c
src/kauth/krb_udp.c
src/kauth/rebuild.c
src/kauth/user.c
src/rxkad/Makefile.in
src/rxkad/NTMakefile
src/rxkad/rxkad_convert.h [new file with mode: 0644]
src/rxkad/rxkad_prototypes.h
src/rxkad/ticket.c
src/rxkad/ticket5.c

index 71b2b4c..98579ed 100644 (file)
@@ -28,6 +28,7 @@
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
+#include <rx/rxkad_convert.h>
 #include <lock.h>
 #define UBIK_LEGACY_CALLITER 1
 #include <ubik.h>
index 652996c..c3d400c 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <afs/pthread_glock.h>
 #include <rx/rxkad.h>
+#include <rx/rxkad_convert.h>
 #include <afs/cellconfig.h>
 #include <ubik.h>
 #include <afs/auth.h>
index 4bc8a92..8c8b36f 100644 (file)
@@ -17,6 +17,8 @@
 #include <hcrypto/des.h>
 #include <hcrypto/ui.h>
 
+#include <rx/rxkad_convert.h>
+
 #include <afs/pthread_glock.h>
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
index 7a93753..9e9f02c 100644 (file)
@@ -33,6 +33,7 @@
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
+#include <rx/rxkad_convert.h>
 #include <afs/cellconfig.h>
 #include <afs/auth.h>
 #include <afs/com_err.h>
index b17b1e2..33116a6 100644 (file)
@@ -20,6 +20,7 @@
 #include <afs/afsutil.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
+#include <rx/rxkad_convert.h>
 
 #include "kauth.h"
 #include "kautils.h"
index 0ea5915..eb2a9f6 100644 (file)
@@ -21,6 +21,7 @@
 #include <hcrypto/ui.h>
 
 #include <rx/xdr.h>
+#include <rx/rxkad_convert.h>
 #include <lock.h>
 #include <ubik.h>
 #include <afs/com_err.h>
index c59fbce..5e5402c 100644 (file)
@@ -34,6 +34,7 @@
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rxkad.h>
+#include <rx/rxkad_convert.h>
 #include <afs/auth.h>
 #include <ubik.h>
 
index 6794d9d..d52f572 100644 (file)
@@ -17,6 +17,7 @@
 #include <ubik.h>
 #include <afs/cmd.h>
 #include <rx/rxkad.h>
+#include <rx/rxkad_convert.h>
 #include <afs/com_err.h>
 
 #include "kauth.h"
index af509fe..49ef3bc 100644 (file)
@@ -35,7 +35,7 @@
 #include <rx/rx.h>
 #include <rx/rx_globals.h>
 #include <rx/rxkad.h>          /* max ticket lifetime */
-
+#include <rx/rxkad_convert.h>
 
 #include "kauth.h"
 #include "kautils.h"
index 78c941e..9e5d317 100644 (file)
@@ -13,7 +13,7 @@ include @TOP_OBJDIR@/src/config/Makefile.lwp
 
 
 INCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \
-       ${TOP_INCDIR}/rx/fcrypt.h \
+       ${TOP_INCDIR}/rx/fcrypt.h rxkad_convert.h \
        rxkad.h rxkad_prototypes.h fcrypt.h v5gen.h
 
 OBJS=rxkad_client.o rxkad_server.o rxkad_common.o rxkad_errs.o \
@@ -37,6 +37,7 @@ generated: \
 depinstall: \
        ${TOP_INCDIR}/rx/rxkad.h \
        ${TOP_INCDIR}/rx/rxkad_prototypes.h \
+       ${TOP_INCDIR}/rx/rxkad_convert.h \
        ${TOP_INCDIR}/rx/fcrypt.h \
        ${TOP_INCDIR}/rx/rxkad_stats.h
 
@@ -55,6 +56,9 @@ ${TOP_INCDIR}/rx/rxkad_prototypes.h: rxkad_prototypes.h
 ${TOP_INCDIR}/rx/rxkad_stats.h: stats.h
        ${INSTALL_DATA} $? $@
 
+${TOP_INCDIR}/rx/rxkad_convert.h: rxkad_convert.h
+       ${INSTALL_DATA} $? $@
+
 #
 # Build targets
 #
index d8c4951..9b1f0b0 100644 (file)
@@ -15,7 +15,8 @@ INCFILES =\
        $(INCFILEDIR)\rxkad_prototypes.h \
        $(INCFILEDIR)\asn1_err.h \
         $(INCFILEDIR)\v5gen.h \
-       $(INCFILEDIR)\rxkad.h
+       $(INCFILEDIR)\rxkad.h \
+       $(INCFILEDIR)\rxkad_convert.h
 
 # build afsrxkad.lib
 LIBOBJS =\
diff --git a/src/rxkad/rxkad_convert.h b/src/rxkad/rxkad_convert.h
new file mode 100644 (file)
index 0000000..8fba9bf
--- /dev/null
@@ -0,0 +1,46 @@
+
+/* Conversion functions to go between the various different key types used
+ * by rxkad and supporting libraries
+ */
+
+#ifndef OPENAFS_RXKAD_CONVERT_H
+#define OPENAFS_RXKAD_CONVERT_H 1
+
+#include <hcrypto/des.h>
+
+struct ktc_encryptionKey;
+
+static_inline DES_cblock *
+ktc_to_cblock(struct ktc_encryptionKey *key) {
+    return (DES_cblock *)key;
+}
+
+static_inline char *
+ktc_to_charptr(struct ktc_encryptionKey *key) {
+    return (char *)key;
+}
+
+
+static_inline DES_cblock *
+ktc_to_cblockptr(struct ktc_encryptionKey *key) {
+    return (DES_cblock *)key;
+}
+
+#if 0
+static_inline unsigned char *
+cblockptr_to_cblock(DES_cblock *key) {
+    return (unsigned char *)key;
+}
+#endif
+
+static_inline DES_cblock *
+charptr_to_cblock(char *key) {
+    return (DES_cblock *)key;
+}
+
+static_inline DES_cblock *
+charptr_to_cblockptr(char *key) {
+    return (DES_cblock *)key;
+}
+
+#endif
index be03608..0f935e7 100644 (file)
@@ -158,37 +158,4 @@ extern int tkt_DecodeTicket5(char *ticket, afs_int32 ticket_len,
                             afs_int32 * host, afs_uint32 * start,
                             afs_uint32 * end, afs_int32 disableDotCheck);
 
-static_inline DES_cblock *
-ktc_to_cblock(struct ktc_encryptionKey *key) {
-    return (DES_cblock *)key;
-}
-
-static_inline char *
-ktc_to_charptr(struct ktc_encryptionKey *key) {
-    return (char *)key;
-}
-
-
-static_inline DES_cblock *
-ktc_to_cblockptr(struct ktc_encryptionKey *key) {
-    return (DES_cblock *)key;
-}
-
-#if 0
-static_inline unsigned char *
-cblockptr_to_cblock(DES_cblock *key) {
-    return (unsigned char *)key;
-}
-#endif
-
-static_inline DES_cblock *
-charptr_to_cblock(char *key) {
-    return (DES_cblock *)key;
-}
-
-static_inline DES_cblock *
-charptr_to_cblockptr(char *key) {
-    return (DES_cblock *)key;
-}
-
 #endif
index d733ac1..52d65fa 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "lifetimes.h"
 #include "rxkad.h"
+#include "rxkad_convert.h"
 
 /* This union is used to insure we allocate enough space for a key
  * schedule even if we are linked against a library that uses OpenSSL's
index a709d5d..2ab58df 100644 (file)
@@ -72,6 +72,7 @@
 
 #include "lifetimes.h"
 #include "rxkad.h"
+#include "rxkad_convert.h"
 
 #include "v5gen-rewrite.h"
 #include "v5gen.h"