SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR}
-all: $(ROKEN_HEADERS) ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \
+all: ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \
${TOP_LIBDIR}/libafshcrypto.a \
${TOP_LIBDIR}/libafshcrypto_lwp.a
clean:
$(RM) -f ${OBJECTS} ${SHLIBOBJ} libafshcrypto.a libafshcrypto.exp \
- test_cipher test_cipher.o hex.o
+ test_cipher test_cipher.o
COMMON_OBJS= aes.o camellia.o camellia-ntt.o des.o engine.o evp.o \
evp-hcrypto.o evp-cc.o hmac.o md2.o md4.o md5.o pkcs5.o \
rand-egd.o rand-timer.o rand-unix.o rand.o rc2.o rc4.o \
rijndael-alg-fst.o rnd_keys.o sha.o sha256.o sha512.o ui.o \
- validate.o \
- cloexec.o ct.o issuid.o net_read.o net_write.o snprintf.o \
- warnerr.o
+ validate.o
-OBJECTS = $(COMMON_OBJS) rand-fortuna.o $(ROKEN_LIBOBJS)
+OBJECTS = $(COMMON_OBJS) rand-fortuna.o
-LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o $(ROKEN_LIBOBJS)
+LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o
LWPRULE=$(CC) $(AFS_CPPFLAGS) $(COMMON_CFLAGS) $(XCFLAGS) $(ARCHFLAGS) \
-I$(TOP_INCDIR)/hcrypto -I$(UPSTREAM)/hcrypto -c $?
${SHLIBOBJ}: ${OBJECTS} libafshcrypto.map
${TOP_OBJDIR}/src/config/shlib-build -d $(srcdir) -l libafshcrypto \
-M ${LIBMAJOR} -m ${LIBMINOR} -- \
- ${OBJECTS} ${MT_LIBS}
+ ${OBJECTS} -L$(TOP_LIBDIR) -lrokenafs ${MT_LIBS}
libafshcrypto.a: ${OBJECTS}
$(RM) -f $@
$(AR) crv $@ $(LWP_OBJS)
$(RANLIB) $@
-test_cipher: test_cipher.o hex.o libafshcrypto.a
- $(AFS_LDRULE) test_cipher.o hex.o libafshcrypto.a
+test_cipher: test_cipher.o libafshcrypto.a
+ $(AFS_LDRULE) test_cipher.o libafshcrypto.a $(LIB_roken)
${TOP_INCDIR}/hcrypto/aes.h: ${UPSTREAM}/hcrypto/aes.h
${INSTALL_DATA} $? $@
test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c
$(AFS_CCRULE) $(UPSTREAM)/hcrypto/test_cipher.c
-# These bits of libroken are new functionality, rather than compatibility
-# code. Where they should go eventually is unclear.
-
-cloexec.o: ${UPSTREAM}/roken/cloexec.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/cloexec.c
-
-ct.o: ${UPSTREAM}/roken/ct.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/ct.c
-
-hex.o: ${UPSTREAM}/roken/hex.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/hex.c
-
-issuid.o: ${UPSTREAM}/roken/issuid.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/issuid.c
-
-net_read.o: ${UPSTREAM}/roken/net_read.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/net_read.c
-
-net_write.o: ${UPSTREAM}/roken/net_write.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/net_write.c
-
-# The upstream snprintf.c has some pointer warnings in it
-CFLAGS_snprintf.o = @CFLAGS_NOERROR@
-
-snprintf.o: ${UPSTREAM}/roken/snprintf.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/snprintf.c
-
-# These bits of libroken are compatibility functions. They should get moved
-# out into a new libroken top level target, which allows the use of an
-# existing libroken, if one is available.
-
-
-daemon.o: ${UPSTREAM}/roken/daemon.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/daemon.c
-
-ecalloc.o: ${UPSTREAM}/roken/ecalloc.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/ecalloc.c
-
-emalloc.o: ${UPSTREAM}/roken/emalloc.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/emalloc.c
-
-erealloc.o: ${UPSTREAM}/roken/erealloc.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/erealloc.c
-
-err.h: ${UPSTREAM}/roken/err.hin
- cp $? $@
-
-err.o: ${UPSTREAM}/roken/err.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/err.c
-
-errx.o: ${UPSTREAM}/roken/errx.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/errx.c
-
-getopt.o: ${UPSTREAM}/roken/getopt.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/getopt.c
-
-getprogname.o: ${UPSTREAM}/roken/getprogname.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/getprogname.c
-
-socket.o: ${UPSTREAM}/roken/socket.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/socket.c
-
-strlcat.o: ${UPSTREAM}/roken/strlcat.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/strlcat.c
-
-strlcpy.o: ${UPSTREAM}/roken/strlcpy.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/strlcpy.c
-
-strnlen.o: ${UPSTREAM}/roken/strnlen.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/strnlen.c
-
-verr.o: ${UPSTREAM}/roken/verr.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/verr.c
-
-verrx.o: ${UPSTREAM}/roken/verrx.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/verrx.c
-
-vsyslog.o: ${UPSTREAM}/roken/vsyslog.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/vsyslog.c
-
-vwarn.o: ${UPSTREAM}/roken/vwarn.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/vwarn.c
-
-vwarnx.o: ${UPSTREAM}/roken/vwarnx.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/vwarnx.c
-
-warn.o: ${UPSTREAM}/roken/warn.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/warn.c
-
-warnerr.o: ${UPSTREAM}/roken/warnerr.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/warnerr.c
-
-warnx.o: ${UPSTREAM}/roken/warnx.c
- $(AFS_CCRULE) $(UPSTREAM)/roken/warnx.c
-
# LWP Targets
rand-fortuna_lwp.o: ${UPSTREAM}/hcrypto/rand-fortuna.c
RELDIR=crypto\hcrypto
!include ..\..\config\NTMakefile.$(SYS_NAME)
!include ..\..\config\NTMakefile.version
-AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I$(SRC)\external\heimdal\hcrypto -DHAVE_CONFIG_H=1
-
-ROKEN = $(SRC)\external\heimdal\roken
+AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I$(SRC)\external\heimdal\hcrypto -DHAVE_CONFIG_H=1 -DKRB5
HCRYPTO = $(SRC)\external\heimdal\hcrypto
INCFILEDIR = $(DESTDIR)\include\hcrypto
INCFILES = \
- $(INCFILEDIR)\engine.h \
- $(INCFILEDIR)\err.h
+ $(INCFILEDIR)\engine.h
HCRYPTO_INCFILES = \
$(INCFILEDIR)\aes.h \
$(OUT)\ui.obj \
$(OUT)\validate.obj
-ROKEN_OBJS = \
- $(OUT)\cloexec.obj \
- $(OUT)\ct.obj \
- $(OUT)\err.obj \
- $(OUT)\errx.obj \
- $(OUT)\getprogname.obj \
- $(OUT)\issuid.obj \
- $(OUT)\snprintf.obj \
- $(OUT)\verr.obj \
- $(OUT)\verrx.obj \
- $(OUT)\vwarn.obj \
- $(OUT)\vwarnx.obj \
- $(OUT)\warn.obj \
- $(OUT)\warnerr.obj \
- $(OUT)\warnx.obj
-
# This is a horrible hack that is required to get
# around the fact that the OpenAFS build system copies
# its own des.h into the top-level OpenAFS include
des.h: $(HCRYPTO)\des.h
$(COPY) $** $@
-$(ROKEN_OBJS):$(ROKEN)\$$(@B).c
- $(C2OBJ) $** -I$(ROKEN)
-
$(HCRYPTO_OBJS):$(HCRYPTO)\$$(@B).c
$(C2OBJ) $** -I$(HCRYPTO)
$(INCFILES):$$(@B).h
$(COPY) $** $(INCFILEDIR)
-err.h: $(ROKEN)\err.hin
- $(COPY) $** $@
-
!if !defined(NMAKE)
NTMAKE = nmake /nologo /f ntmakefile
!endif
DLLLIBS = \
-# $(DESTDIR)\lib\afs\afsreg.lib
+ $(DESTDIR)\lib\afsroken.lib
-$(LIBFILE): $(LOCAL_OBJS) $(HCRYPTO_OBJS) $(ROKEN_OBJS) $(DLLLIBS)
+$(LIBFILE): $(LOCAL_OBJS) $(HCRYPTO_OBJS) $(DLLLIBS)
$(DLLCONLINK) /DEF:afshcrypto.def shell32.lib
$(_VC_MANIFEST_EMBED_DLL)
$(DLLPREP)
#include <afsconfig.h>
#include <afs/param.h>
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <time.h>
-#include <fcntl.h>
-#include <signal.h>
-
-#ifndef AFS_NT40_ENV
-#include <sys/param.h>
-#include <sys/socket.h>
-#include <inttypes.h>
-#include <sys/time.h>
-#include <unistd.h>
-#endif
-
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
#endif
#if defined(AFS_NT40_ENV)
# define inline __inline __attribute__((always_inline))
#endif
-#include "roken.h"
\ No newline at end of file
#include <config.h>
#include <engine.h>
+#include <stdlib.h>
int
ENGINE_finish(const ENGINE *dummy) {
}
static inline void
-print_version(const char *str) {
+rk_print_version(const char *str) {
return;
}
-/* This file intentionally left blank */
+#ifdef AFS_NT40_ENV
+typedef __int8 int8_t;
+typedef __int16 int16_t;
+typedef __int32 int32_t;
+typedef __int64 int64_t;
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+typedef uint8_t u_int8_t;
+typedef uint16_t u_int16_t;
+typedef uint32_t u_int32_t;
+typedef uint64_t u_int64_t;
+#endif
+++ /dev/null
-#ifndef OPENAFS_ROKEN_H
-#define OPENAFS_ROKEN_H
-
-#ifdef AFS_NT40_ENV
-#include <windows.h>
-
-#ifdef _MSC_VER
-/* Declarations for Microsoft Visual C runtime in Windows */
-#include <process.h>
-
-#include <io.h>
-
-#ifndef __BITS_TYPES_DEFINED__
-#define __BITS_TYPES_DEFINED__
-
-typedef __int8 int8_t;
-typedef __int16 int16_t;
-typedef __int32 int32_t;
-typedef __int64 int64_t;
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-typedef uint8_t u_int8_t;
-typedef uint16_t u_int16_t;
-typedef uint32_t u_int32_t;
-typedef uint64_t u_int64_t;
-
-#endif /* __BITS_TYPES_DEFINED__ */
-
-#ifndef HAVE_SSIZE_T
-#ifdef _WIN64
-typedef __int64 ssize_t;
-#else
-typedef int ssize_t;
-#endif
-#endif
-
-/* The MSVC implementation of snprintf is not C99 compliant. */
-#define snprintf rk_snprintf
-#define vsnprintf rk_vsnprintf
-#define vasnprintf rk_vasnprintf
-#define vasprintf rk_vasprintf
-#define asnprintf rk_asnprintf
-#define asprintf rk_asprintf
-
-#endif /* _MSC_VER */
-#endif /* AFS_NT40_ENV */
-
-#define rk_UNCONST(x) ((void *)(uintptr_t)(const void *)(x))
-
-#ifndef min
-#define min(a,b) (((a)<(b))?(a):(b))
-#endif
-
-#ifndef ROKEN_LIB_FUNCTION
-#ifdef _WIN32
-#define ROKEN_LIB_FUNCTION
-#define ROKEN_LIB_CALL __cdecl
-#else
-#define ROKEN_LIB_FUNCTION
-#define ROKEN_LIB_CALL
-#endif
-#endif
-
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif
-
-typedef int rk_socket_t;
-
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
- ct_memcmp(const void *, const void *, size_t);
-
-ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_cloexec(int);
-
-ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_cloexec_file(FILE *);
-
-ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
- net_write (rk_socket_t, const void *, size_t);
-
-ROKEN_LIB_FUNCTION ssize_t ROKEN_LIB_CALL
- net_read (rk_socket_t, void *, size_t);
-
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL issuid(void);
-
-#if !defined(HAVE_SNPRINTF) || defined(NEED_SNPRINTF_PROTO)
-#ifndef HAVE_SNPRINTF
-#define snprintf rk_snprintf
-#endif
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
- rk_snprintf (char *, size_t, const char *, ...)
- __attribute__ ((format (printf, 3, 4)));
-#endif
-
-#if !defined(HAVE_VSNPRINTF) || defined(NEED_VSNPRINTF_PROTO)
-#ifndef HAVE_VSNPRINTF
-#define vsnprintf rk_vsnprintf
-#endif
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
- rk_vsnprintf (char *, size_t, const char *, va_list)
- __attribute__((format (printf, 3, 0)));
-#endif
-
-#if !defined(HAVE_ASPRINTF) || defined(NEED_ASPRINTF_PROTO)
-#ifndef HAVE_ASPRINTF
-#define asprintf rk_asprintf
-#endif
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
- rk_asprintf (char **, const char *, ...)
- __attribute__ ((format (printf, 2, 3)));
-#endif
-
-#if !defined(HAVE_VASPRINTF) || defined(NEED_VASPRINTF_PROTO)
-#ifndef HAVE_VASPRINTF
-#define vasprintf rk_vasprintf
-#endif
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
- rk_vasprintf (char **, const char *, va_list)
- __attribute__((format (printf, 2, 0)));
-#endif
-
-#if !defined(HAVE_ASNPRINTF) || defined(NEED_ASNPRINTF_PROTO)
-#ifndef HAVE_ASNPRINTF
-#define asnprintf rk_asnprintf
-#endif
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
- rk_asnprintf (char **, size_t, const char *, ...)
- __attribute__ ((format (printf, 3, 4)));
-#endif
-
-#if !defined(HAVE_VASNPRINTF) || defined(NEED_VASNPRINTF_PROTO)
-#ifndef HAVE_VASNPRINTF
-#define vasnprintf rk_vasnprintf
-#endif
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
- vasnprintf (char **, size_t, const char *, va_list)
- __attribute__((format (printf, 3, 0)));
-#endif
-
-#ifndef HAVE_STRLCPY
-#define strlcpy rk_strlcpy
-ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL
- strlcpy (char *, const char *, size_t);
-#endif
-
-#ifndef HAVE_DIRFD
-# ifdef HAVE_DIR_DD_FD
-# define dirfd(x) ((x)->dd_fd)
-# else
-# ifndef _WIN32 /* Windows code never calls dirfd */
-# error Missing dirfd() and ->dd_fd
-# endif
-# endif
-#endif
-
-/* This is a bodge, but it's only used by the tests */
-#define emalloc(x) malloc(x)
-
-#ifndef HAVE_GETPROGNAME
-ROKEN_LIB_FUNCTION const char * ROKEN_LIB_CALL getprogname(void);
-#endif
-
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
-#endif
-
-
-#endif /* OPENAFS_ROKEN_H */