aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhanna Tsitkov <tsitkova@mit.edu>2009-09-30 22:33:41 +0000
committerZhanna Tsitkov <tsitkova@mit.edu>2009-09-30 22:33:41 +0000
commitcb1fe7f9bbab7c09c483bac964f4d045b91aec66 (patch)
tree836dab3fde0e3202cf6bc8c7eaba2f18c9bbde49
parente9c2e78bdd51ea150e46c9297f7abf5f5590522a (diff)
downloadkrb5-cb1fe7f9bbab7c09c483bac964f4d045b91aec66.zip
krb5-cb1fe7f9bbab7c09c483bac964f4d045b91aec66.tar.gz
krb5-cb1fe7f9bbab7c09c483bac964f4d045b91aec66.tar.bz2
Crypto modularity proj: SHS_INFO structure is defined differently for crypto impl's. Files hash_sha1.c and yhash.h are affected by this difference. Move hash_provider into the backend
The following bigredbutton is used to suppress svn complains about the trailing spaces in the moved/copied dirs. bigredbutton: whitespace git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22815 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/Makefile.in6
-rw-r--r--src/configure.in2
-rw-r--r--src/lib/crypto/Makefile.in4
-rw-r--r--src/lib/crypto/builtin/Makefile.in16
-rw-r--r--src/lib/crypto/builtin/deps2
-rw-r--r--src/lib/crypto/builtin/hash_provider/Makefile.in (renamed from src/lib/crypto/krb/hash_provider/Makefile.in)6
-rw-r--r--src/lib/crypto/builtin/hash_provider/deps (renamed from src/lib/crypto/krb/hash_provider/deps)2
-rw-r--r--src/lib/crypto/builtin/hash_provider/hash_crc32.c (renamed from src/lib/crypto/krb/hash_provider/hash_crc32.c)0
-rw-r--r--src/lib/crypto/builtin/hash_provider/hash_md4.c (renamed from src/lib/crypto/krb/hash_provider/hash_md4.c)0
-rw-r--r--src/lib/crypto/builtin/hash_provider/hash_md5.c (renamed from src/lib/crypto/krb/hash_provider/hash_md5.c)0
-rw-r--r--src/lib/crypto/builtin/hash_provider/hash_provider.h (renamed from src/lib/crypto/krb/hash_provider/hash_provider.h)0
-rw-r--r--src/lib/crypto/builtin/hash_provider/hash_sha1.c (renamed from src/lib/crypto/krb/hash_provider/hash_sha1.c)0
-rw-r--r--src/lib/crypto/builtin/yhash.h (renamed from src/lib/crypto/krb/yarrow/yhash.h)0
-rw-r--r--src/lib/crypto/crypto_tests/Makefile.in2
-rw-r--r--src/lib/crypto/krb/Makefile.in19
-rw-r--r--src/lib/crypto/krb/deps6
-rw-r--r--src/lib/crypto/krb/keyhash_provider/Makefile.in2
-rw-r--r--src/lib/crypto/krb/keyhash_provider/deps4
-rw-r--r--src/lib/crypto/krb/prf/Makefile.in1
-rw-r--r--src/lib/crypto/krb/prf/deps2
-rw-r--r--src/lib/crypto/krb/yarrow/Makefile.in5
-rw-r--r--src/lib/crypto/krb/yarrow/deps4
-rw-r--r--src/lib/crypto/krb/yarrow/yarrow.c1
-rw-r--r--src/lib/crypto/krb/yarrow/yarrow.h2
-rw-r--r--src/lib/crypto/openssl/hash_provider/hash_crc32.c56
-rw-r--r--src/lib/crypto/openssl/hash_provider/hash_md4.c56
-rw-r--r--src/lib/crypto/openssl/hash_provider/hash_md5.c56
-rw-r--r--src/lib/crypto/openssl/hash_provider/hash_provider.h32
-rw-r--r--src/lib/crypto/openssl/hash_provider/hash_sha1.c61
-rw-r--r--src/lib/crypto/openssl/hmac.c2
-rw-r--r--src/lib/crypto/openssl/sha1/shs.c18
-rw-r--r--src/lib/crypto/openssl/sha1/shs.h8
-rw-r--r--src/lib/crypto/openssl/yhash.h30
33 files changed, 351 insertions, 54 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 3ac3dc4..e5be6e1 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -196,7 +196,7 @@ WINMAKEFILES=Makefile \
lib\Makefile lib\crypto\Makefile \
lib\crypto\krb\crc32\Makefile lib\crypto\builtin\des\Makefile \
lib\crypto\krb\dk\Makefile lib\crypto\builtin\enc_provider\Makefile \
- lib\crypto\krb\hash_provider\Makefile \
+ lib\crypto\builtin\hash_provider\Makefile \
lib\crypto\krb\keyhash_provider\Makefile \
lib\crypto\krb\prf\Makefile lib\crypto\krb\rand2key\Makefile \
lib\crypto\krb\raw\Makefile lib\crypto\krb\old\Makefile \
@@ -271,7 +271,7 @@ WINMAKEFILES=Makefile \
##DOS## $(WCONFIG) config < $@.in > $@
##DOS##lib\crypto\builtin\enc_provider\Makefile: lib\crypto\builtin\enc_provider\Makefile.in $(MKFDEP)
##DOS## $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\krb\hash_provider\Makefile: lib\crypto\krb\hash_provider\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\hash_provider\Makefile: lib\crypto\builtin\hash_provider\Makefile.in $(MKFDEP)
##DOS## $(WCONFIG) config < $@.in > $@
##DOS##lib\crypto\krb\keyhash_provider\Makefile: lib\crypto\krb\keyhash_provider\Makefile.in $(MKFDEP)
##DOS## $(WCONFIG) config < $@.in > $@
@@ -396,7 +396,7 @@ FILES= ./* \
config/* include/* include/kerberosIV/* \
include/krb5/* include/krb5/stock/* include/sys/* lib/* \
lib/crypto/* lib/crypto/krb/crc32/* lib/crypto/builtin/des/* lib/crypto/krb/dk/* \
- lib/crypto/builtin/enc_provider/* lib/crypto/krb/hash_provider/* \
+ lib/crypto/builtin/enc_provider/* lib/crypto/builtin/hash_provider/* \
lib/crypto/krb/keyhash_provider/* \
lib/crypto/krb/prf/* lib/crypto/krb/rand2key/* \
lib/crypto/krb/old/* lib/crypto/krb/raw/* \
diff --git a/src/configure.in b/src/configure.in
index 8773ee1..4151151 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1061,7 +1061,7 @@ V5_AC_OUTPUT_MAKEFILE(.
lib/crypto lib/crypto/krb lib/crypto/krb/crc32 lib/crypto/builtin/des
lib/crypto/krb/dk lib/crypto/builtin/enc_provider
- lib/crypto/krb/hash_provider lib/crypto/krb/keyhash_provider
+ lib/crypto/builtin/hash_provider lib/crypto/krb/keyhash_provider
lib/crypto/krb/prf lib/crypto/krb/rand2key
lib/crypto/builtin lib/crypto/builtin/md4 lib/crypto/builtin/md5
lib/crypto/krb/old lib/crypto/krb/raw lib/crypto/builtin/sha1
diff --git a/src/lib/crypto/Makefile.in b/src/lib/crypto/Makefile.in
index 3a3bab5..b89619f 100644
--- a/src/lib/crypto/Makefile.in
+++ b/src/lib/crypto/Makefile.in
@@ -21,7 +21,7 @@ LIBFINIFUNC=cryptoint_cleanup_library
RELDIR=crypto
STOBJLISTS=krb/crc32/OBJS.ST krb/dk/OBJS.ST builtin/enc_provider/OBJS.ST \
- krb/hash_provider/OBJS.ST krb/keyhash_provider/OBJS.ST \
+ builtin/hash_provider/OBJS.ST krb/keyhash_provider/OBJS.ST \
krb/prf/OBJS.ST krb/rand2key/OBJS.ST \
krb/old/OBJS.ST krb/raw/OBJS.ST krb/yarrow/OBJS.ST \
builtin/md4/OBJS.ST builtin/md5/OBJS.ST builtin/sha1/OBJS.ST \
@@ -29,7 +29,7 @@ STOBJLISTS=krb/crc32/OBJS.ST krb/dk/OBJS.ST builtin/enc_provider/OBJS.ST \
krb/OBJS.ST builtin/OBJS.ST
SUBDIROBJLISTS=krb/crc32/OBJS.ST krb/dk/OBJS.ST builtin/enc_provider/OBJS.ST \
- krb/hash_provider/OBJS.ST krb/keyhash_provider/OBJS.ST \
+ builtin/hash_provider/OBJS.ST krb/keyhash_provider/OBJS.ST \
krb/prf/OBJS.ST krb/rand2key/OBJS.ST \
krb/old/OBJS.ST krb/raw/OBJS.ST krb/yarrow/OBJS.ST \
builtin/md4/OBJS.ST builtin/md5/OBJS.ST builtin/sha1/OBJS.ST \
diff --git a/src/lib/crypto/builtin/Makefile.in b/src/lib/crypto/builtin/Makefile.in
index eae7da2..deccbd6 100644
--- a/src/lib/crypto/builtin/Makefile.in
+++ b/src/lib/crypto/builtin/Makefile.in
@@ -2,7 +2,7 @@ thisconfigdir=../../..
myfulldir=lib/crypto/builtin
mydir=lib/crypto/builtin
BUILDTOP=$(REL)..$(S)..$(S)..
-SUBDIRS=des arcfour aes md4 md5 sha1 enc_provider
+SUBDIRS=des arcfour aes md4 md5 sha1 enc_provider hash_provider
LOCALINCLUDES = -I$(srcdir)/../krb \
-I$(srcdir)/../krb/hash_provider \
-I$(srcdir)/../@CRYPTO_IMPL@/des \
@@ -11,7 +11,8 @@ LOCALINCLUDES = -I$(srcdir)/../krb \
-I$(srcdir)/../@CRYPTO_IMPL@/sha1 \
-I$(srcdir)/../@CRYPTO_IMPL@/md4 \
-I$(srcdir)/../@CRYPTO_IMPL@/md5 \
- -I$(srcdir)/../@CRYPTO_IMPL@/enc_provider
+ -I$(srcdir)/../@CRYPTO_IMPL@/enc_provider \
+ -I$(srcdir)/../@CRYPTO_IMPL@/hash_provider
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)
DEFS=
@@ -38,6 +39,7 @@ SRCS=\
STOBJLISTS= des/OBJS.ST md4/OBJS.ST \
md5/OBJS.ST sha1/OBJS.ST \
enc_provider/OBJS.ST \
+ hash_provider/OBJS.ST \
arcfour/OBJS.ST \
aes/OBJS.ST \
OBJS.ST
@@ -45,6 +47,7 @@ STOBJLISTS= des/OBJS.ST md4/OBJS.ST \
SUBDIROBJLISTS= des/OBJS.ST md4/OBJS.ST \
md5/OBJS.ST sha1/OBJS.ST \
enc_provider/OBJS.ST \
+ hash_provider/OBJS.ST \
arcfour/OBJS.ST \
aes/OBJS.ST
@@ -70,6 +73,9 @@ all-windows::
cd ..\sha1
@echo Making in crypto\sha1
$(MAKE) -$(MFLAGS)
+ cd ..\hash_provider
+ @echo Making in crypto\hash_provider
+ $(MAKE) -$(MFLAGS)
cd ..\enc_provider
@echo Making in crypto\enc_provider
$(MAKE) -$(MFLAGS)
@@ -94,6 +100,9 @@ clean-windows::
cd ..\sha1
@echo Making clean in crypto\sha1
$(MAKE) -$(MFLAGS) clean
+ cd ..\hash_provider
+ @echo Making clean in crypto\hash_provider
+ $(MAKE) -$(MFLAGS) clean
cd ..\enc_provider
@echo Making clean in crypto\enc_provider
$(MAKE) -$(MFLAGS) clean
@@ -118,6 +127,9 @@ check-windows::
cd ..\sha1
@echo Making check in crypto\sha1
$(MAKE) -$(MFLAGS) check
+ cd ..\hash_provider
+ @echo Making check in crypto\hash_provider
+ $(MAKE) -$(MFLAGS) check
cd ..\enc_provider
@echo Making check in crypto\enc_provider
$(MAKE) -$(MFLAGS) check
diff --git a/src/lib/crypto/builtin/deps b/src/lib/crypto/builtin/deps
index fb4163e..55016e9 100644
--- a/src/lib/crypto/builtin/deps
+++ b/src/lib/crypto/builtin/deps
@@ -21,4 +21,4 @@ pbkdf2.so pbkdf2.po $(OUTPRE)pbkdf2.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/krb5.h \
$(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/krb5/preauth_plugin.h \
$(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
- $(srcdir)/../builtin/pbkdf2.c $(srcdir)/../krb/hash_provider/hash_provider.h
+ $(srcdir)/../builtin/pbkdf2.c $(srcdir)/../builtin/hash_provider/hash_provider.h
diff --git a/src/lib/crypto/krb/hash_provider/Makefile.in b/src/lib/crypto/builtin/hash_provider/Makefile.in
index ece3a99..75b3d1b 100644
--- a/src/lib/crypto/krb/hash_provider/Makefile.in
+++ b/src/lib/crypto/builtin/hash_provider/Makefile.in
@@ -1,8 +1,8 @@
thisconfigdir=../../../..
-myfulldir=lib/crypto/krb/hash_provider
-mydir=lib/crypto/krb/hash_provider
+myfulldir=lib/crypto/builtin/hash_provider
+mydir=lib/crypto/builtin/hash_provider
BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
-LOCALINCLUDES = -I$(srcdir)/../crc32 -I$(srcdir)/../../@CRYPTO_IMPL@/md4 \
+LOCALINCLUDES = -I$(srcdir)/../../krb/crc32 -I$(srcdir)/../../@CRYPTO_IMPL@/md4 \
-I$(srcdir)/../../@CRYPTO_IMPL@/md5 -I$(srcdir)/../../@CRYPTO_IMPL@/sha1
DEFS=
diff --git a/src/lib/crypto/krb/hash_provider/deps b/src/lib/crypto/builtin/hash_provider/deps
index 9707770..deca384 100644
--- a/src/lib/crypto/krb/hash_provider/deps
+++ b/src/lib/crypto/builtin/hash_provider/deps
@@ -10,7 +10,7 @@ hash_crc32.so hash_crc32.po $(OUTPRE)hash_crc32.$(OBJEXT): \
$(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
$(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
- $(SRCTOP)/include/socket-utils.h $(srcdir)/../crc32/crc-32.h \
+ $(SRCTOP)/include/socket-utils.h $(srcdir)/../../krb/crc32/crc-32.h \
hash_crc32.c hash_provider.h
hash_md4.so hash_md4.po $(OUTPRE)hash_md4.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
diff --git a/src/lib/crypto/krb/hash_provider/hash_crc32.c b/src/lib/crypto/builtin/hash_provider/hash_crc32.c
index 780e158..780e158 100644
--- a/src/lib/crypto/krb/hash_provider/hash_crc32.c
+++ b/src/lib/crypto/builtin/hash_provider/hash_crc32.c
diff --git a/src/lib/crypto/krb/hash_provider/hash_md4.c b/src/lib/crypto/builtin/hash_provider/hash_md4.c
index f507aaa..f507aaa 100644
--- a/src/lib/crypto/krb/hash_provider/hash_md4.c
+++ b/src/lib/crypto/builtin/hash_provider/hash_md4.c
diff --git a/src/lib/crypto/krb/hash_provider/hash_md5.c b/src/lib/crypto/builtin/hash_provider/hash_md5.c
index a6e380a..a6e380a 100644
--- a/src/lib/crypto/krb/hash_provider/hash_md5.c
+++ b/src/lib/crypto/builtin/hash_provider/hash_md5.c
diff --git a/src/lib/crypto/krb/hash_provider/hash_provider.h b/src/lib/crypto/builtin/hash_provider/hash_provider.h
index 4fa4609..4fa4609 100644
--- a/src/lib/crypto/krb/hash_provider/hash_provider.h
+++ b/src/lib/crypto/builtin/hash_provider/hash_provider.h
diff --git a/src/lib/crypto/krb/hash_provider/hash_sha1.c b/src/lib/crypto/builtin/hash_provider/hash_sha1.c
index 00ab72b..00ab72b 100644
--- a/src/lib/crypto/krb/hash_provider/hash_sha1.c
+++ b/src/lib/crypto/builtin/hash_provider/hash_sha1.c
diff --git a/src/lib/crypto/krb/yarrow/yhash.h b/src/lib/crypto/builtin/yhash.h
index ee4f03e..ee4f03e 100644
--- a/src/lib/crypto/krb/yarrow/yhash.h
+++ b/src/lib/crypto/builtin/yhash.h
diff --git a/src/lib/crypto/crypto_tests/Makefile.in b/src/lib/crypto/crypto_tests/Makefile.in
index 41704c8..3d7eca1 100644
--- a/src/lib/crypto/crypto_tests/Makefile.in
+++ b/src/lib/crypto/crypto_tests/Makefile.in
@@ -3,7 +3,7 @@ myfulldir=lib/crypto/crypto_tests
mydir=lib/crypto/crypto_tests
BUILDTOP=$(REL)..$(S)..$(S)..
LOCALINCLUDES = -I$(srcdir)/../krb -I$(srcdir)/../@CRYPTO_IMPL@/enc_provider \
- -I$(srcdir)/../krb/hash_provider -I$(srcdir)/../krb/keyhash_provider \
+ -I$(srcdir)/../@CRYPTO_IMPL@/hash_provider -I$(srcdir)/../krb/keyhash_provider \
-I$(srcdir)/../krb/dk -I$(srcdir)/../@CRYPTO_IMPL@/ \
-I$(srcdir)/../krb/yarrow \
-I$(srcdir)/../krb/crc32 -I$(srcdir)/../krb/old -I$(srcdir)/../krb/raw \
diff --git a/src/lib/crypto/krb/Makefile.in b/src/lib/crypto/krb/Makefile.in
index 909d3de..e64ef8f 100644
--- a/src/lib/crypto/krb/Makefile.in
+++ b/src/lib/crypto/krb/Makefile.in
@@ -2,15 +2,15 @@ thisconfigdir=../../..
myfulldir=lib/crypto/krb
mydir=lib/crypto/krb
BUILDTOP=$(REL)..$(S)..$(S)..
-SUBDIRS= crc32 dk hash_provider keyhash_provider \
+SUBDIRS= crc32 dk keyhash_provider \
prf rand2key old raw yarrow
LOCALINCLUDES = -I$(srcdir) -I$(srcdir)/../@CRYPTO_IMPL@/enc_provider -I$(srcdir)/dk \
- -I$(srcdir)/hash_provider -I$(srcdir)/keyhash_provider \
+ -I$(srcdir)/../@CRYPTO_IMPL@/hash_provider -I$(srcdir)/keyhash_provider \
-I$(srcdir)/prf -I$(srcdir)/rand2key \
-I$(srcdir)/old -I$(srcdir)/raw -I$(srcdir)/yarrow \
-I$(srcdir)/../@CRYPTO_IMPL@/ -I$(srcdir)/../@CRYPTO_IMPL@/des \
-I$(srcdir)/../@CRYPTO_IMPL@/aes -I$(srcdir)/../@CRYPTO_IMPL@/arcfour \
- -I$(srcdir)/../@CRYPTO_IMPL@/sha1
+ -I$(srcdir)/../@CRYPTO_IMPL@/sha1 -I$(srcdir)/../@CRYPTO_IMPL@
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)
DEFS=
@@ -151,12 +151,12 @@ SRCS=\
$(srcdir)/verify_checksum_iov.c
STOBJLISTS=crc32/OBJS.ST dk/OBJS.ST \
- hash_provider/OBJS.ST keyhash_provider/OBJS.ST \
+ keyhash_provider/OBJS.ST \
prf/OBJS.ST rand2key/OBJS.ST \
old/OBJS.ST raw/OBJS.ST yarrow/OBJS.ST OBJS.ST
SUBDIROBJLISTS=crc32/OBJS.ST dk/OBJS.ST \
- hash_provider/OBJS.ST keyhash_provider/OBJS.ST \
+ keyhash_provider/OBJS.ST \
prf/OBJS.ST rand2key/OBJS.ST \
old/OBJS.ST raw/OBJS.ST yarrow/OBJS.ST
@@ -176,9 +176,6 @@ all-windows::
cd ..\dk
@echo Making in crypto\dk
$(MAKE) -$(MFLAGS)
- cd ..\hash_provider
- @echo Making in crypto\hash_provider
- $(MAKE) -$(MFLAGS)
cd ..\keyhash_provider
@echo Making in crypto\keyhash_provider
$(MAKE) -$(MFLAGS)
@@ -206,9 +203,6 @@ clean-windows::
cd ..\dk
@echo Making clean in crypto\dk
$(MAKE) -$(MFLAGS) clean
- cd ..\hash_provider
- @echo Making clean in crypto\hash_provider
- $(MAKE) -$(MFLAGS) clean
cd ..\keyhash_provider
@echo Making clean in crypto\keyhash_provider
$(MAKE) -$(MFLAGS) clean
@@ -236,9 +230,6 @@ check-windows::
cd ..\dk
@echo Making check in crypto\dk
$(MAKE) -$(MFLAGS) check
- cd ..\hash_provider
- @echo Making check in crypto\hash_provider
- $(MAKE) -$(MFLAGS) check
cd ..\keyhash_provider
@echo Making check in crypto\keyhash_provider
$(MAKE) -$(MFLAGS) check
diff --git a/src/lib/crypto/krb/deps b/src/lib/crypto/krb/deps
index 271ec90..aafb06b 100644
--- a/src/lib/crypto/krb/deps
+++ b/src/lib/crypto/krb/deps
@@ -52,7 +52,7 @@ cksumtypes.so cksumtypes.po $(OUTPRE)cksumtypes.$(OBJEXT): \
$(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
$(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
- $(SRCTOP)/include/socket-utils.h $(srcdir)/hash_provider/hash_provider.h \
+ $(SRCTOP)/include/socket-utils.h $(srcdir)/../builtin/hash_provider/hash_provider.h \
$(srcdir)/keyhash_provider/keyhash_provider.h cksumtypes.c \
cksumtypes.h
coll_proof_cksum.so coll_proof_cksum.po $(OUTPRE)coll_proof_cksum.$(OBJEXT): \
@@ -192,7 +192,7 @@ etypes.so etypes.po $(OUTPRE)etypes.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
$(srcdir)/../builtin/aes/aes_s2k.h $(srcdir)/../builtin/arcfour/arcfour.h \
$(srcdir)/../builtin/des/des_int.h $(srcdir)/../builtin/enc_provider/enc_provider.h \
- $(srcdir)/dk/dk.h $(srcdir)/hash_provider/hash_provider.h \
+ $(srcdir)/dk/dk.h $(srcdir)/../builtin/hash_provider/hash_provider.h \
$(srcdir)/old/old.h $(srcdir)/prf/prf_int.h $(srcdir)/raw/raw.h \
etypes.c etypes.h
keyblocks.so keyblocks.po $(OUTPRE)keyblocks.$(OBJEXT): \
@@ -329,7 +329,7 @@ prng.so prng.po $(OUTPRE)prng.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
$(srcdir)/../builtin/enc_provider/enc_provider.h $(srcdir)/../builtin/sha1/shs.h \
$(srcdir)/yarrow/yarrow.h $(srcdir)/yarrow/ycipher.h \
- $(srcdir)/yarrow/yhash.h $(srcdir)/yarrow/ytypes.h \
+ $(srcdir)/../builtin/yhash.h $(srcdir)/yarrow/ytypes.h \
prng.c
random_to_key.so random_to_key.po $(OUTPRE)random_to_key.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
diff --git a/src/lib/crypto/krb/keyhash_provider/Makefile.in b/src/lib/crypto/krb/keyhash_provider/Makefile.in
index d84ce79..d30f6c4 100644
--- a/src/lib/crypto/krb/keyhash_provider/Makefile.in
+++ b/src/lib/crypto/krb/keyhash_provider/Makefile.in
@@ -4,7 +4,7 @@ mydir=lib/crypto/krb/keyhash_provider
BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
LOCALINCLUDES = -I$(srcdir)/../../@CRYPTO_IMPL@/des -I$(srcdir)/../../@CRYPTO_IMPL@/md4 \
-I$(srcdir)/../../@CRYPTO_IMPL@/md5 -I$(srcdir)/../../@CRYPTO_IMPL@/arcfour \
- -I$(srcdir)/../hash_provider
+ -I$(srcdir)/../../@CRYPTO_IMPL@/hash_provider -I$(srcdir)/../../@CRYPTO_IMPL@
DEFS=
##DOS##BUILDTOP = ..\..\..\..
diff --git a/src/lib/crypto/krb/keyhash_provider/deps b/src/lib/crypto/krb/keyhash_provider/deps
index bfd980b..09af19d 100644
--- a/src/lib/crypto/krb/keyhash_provider/deps
+++ b/src/lib/crypto/krb/keyhash_provider/deps
@@ -44,7 +44,7 @@ hmac_md5.so hmac_md5.po $(OUTPRE)hmac_md5.$(OBJEXT): \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(srcdir)/../../builtin/arcfour/arcfour-int.h \
$(srcdir)/../../builtin/arcfour/arcfour.h $(srcdir)/../../builtin/md5/rsa-md5.h \
- $(srcdir)/../aead.h $(srcdir)/../cksumtypes.h $(srcdir)/../hash_provider/hash_provider.h \
+ $(srcdir)/../aead.h $(srcdir)/../cksumtypes.h $(srcdir)/../../builtin/hash_provider/hash_provider.h \
hmac_md5.c keyhash_provider.h
md5_hmac.so md5_hmac.po $(OUTPRE)md5_hmac.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
@@ -57,5 +57,5 @@ md5_hmac.so md5_hmac.po $(OUTPRE)md5_hmac.$(OBJEXT): \
$(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
$(SRCTOP)/include/socket-utils.h $(srcdir)/../../builtin/arcfour/arcfour-int.h \
$(srcdir)/../../builtin/arcfour/arcfour.h $(srcdir)/../../builtin/md5/rsa-md5.h \
- $(srcdir)/../hash_provider/hash_provider.h keyhash_provider.h \
+ $(srcdir)/../../builtin/hash_provider/hash_provider.h keyhash_provider.h \
md5_hmac.c
diff --git a/src/lib/crypto/krb/prf/Makefile.in b/src/lib/crypto/krb/prf/Makefile.in
index f16308b..42b14b9 100644
--- a/src/lib/crypto/krb/prf/Makefile.in
+++ b/src/lib/crypto/krb/prf/Makefile.in
@@ -4,6 +4,7 @@ mydir=lib/crypto/krb/prf
BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
LOCALINCLUDES = -I$(srcdir) -I$(srcdir)/.. \
-I$(srcdir)/../dk \
+ -I$(srcdir)/../../@CRYPTO_IMPL@ \
-I$(srcdir)/../../@CRYPTO_IMPL@/md5 \
-I$(srcdir)/../../@CRYPTO_IMPL@/sha1
DEFS=
diff --git a/src/lib/crypto/krb/prf/deps b/src/lib/crypto/krb/prf/deps
index a3c9c76..c0b02f1 100644
--- a/src/lib/crypto/krb/prf/deps
+++ b/src/lib/crypto/krb/prf/deps
@@ -30,5 +30,5 @@ rc4_prf.so rc4_prf.po $(OUTPRE)rc4_prf.$(OBJEXT): $(BUILDTOP)/include/autoconf.h
$(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/krb5.h \
$(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/krb5/preauth_plugin.h \
$(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
- $(srcdir)/../hash_provider/hash_provider.h prf_int.h \
+ $(srcdir)/../../builtin/hash_provider/hash_provider.h prf_int.h \
rc4_prf.c
diff --git a/src/lib/crypto/krb/yarrow/Makefile.in b/src/lib/crypto/krb/yarrow/Makefile.in
index b246c6c..0a3c1e7 100644
--- a/src/lib/crypto/krb/yarrow/Makefile.in
+++ b/src/lib/crypto/krb/yarrow/Makefile.in
@@ -2,7 +2,10 @@ thisconfigdir=../../../..
myfulldir=lib/crypto/krb/yarrow
mydir=lib/crypto/krb/yarrow
BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
-LOCALINCLUDES = -I$(srcdir)/.. -I$(srcdir)/../../@CRYPTO_IMPL@ -I$(srcdir)/../../@CRYPTO_IMPL@/sha1 -I$(srcdir)/../../@CRYPTO_IMPL@/enc_provider
+LOCALINCLUDES = -I$(srcdir)/.. \
+ -I$(srcdir)/../../@CRYPTO_IMPL@ \
+ -I$(srcdir)/../../@CRYPTO_IMPL@/sha1 \
+ -I$(srcdir)/../../@CRYPTO_IMPL@/enc_provider
DEFS=
##DOS##BUILDTOP = ..\..\..\..
diff --git a/src/lib/crypto/krb/yarrow/deps b/src/lib/crypto/krb/yarrow/deps
index bfda3af..ebc4550 100644
--- a/src/lib/crypto/krb/yarrow/deps
+++ b/src/lib/crypto/krb/yarrow/deps
@@ -11,7 +11,7 @@ yarrow.so yarrow.po $(OUTPRE)yarrow.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/krb5/preauth_plugin.h \
$(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
$(srcdir)/../../builtin/sha1/shs.h yarrow.c yarrow.h \
- ycipher.h yexcep.h yhash.h ylock.h ystate.h ytypes.h
+ ycipher.h yexcep.h $(srcdir)/../../builtin/yhash.h ylock.h ystate.h ytypes.h
ycipher.so ycipher.po $(OUTPRE)ycipher.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
$(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(SRCTOP)/include/k5-buf.h \
@@ -23,4 +23,4 @@ ycipher.so ycipher.po $(OUTPRE)ycipher.$(OBJEXT): $(BUILDTOP)/include/autoconf.h
$(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
$(srcdir)/../../builtin/enc_provider/enc_provider.h \
$(srcdir)/../../builtin/sha1/shs.h yarrow.h ycipher.c \
- ycipher.h yhash.h ytypes.h
+ ycipher.h $(srcdir)/../../builtin/yhash.h ytypes.h
diff --git a/src/lib/crypto/krb/yarrow/yarrow.c b/src/lib/crypto/krb/yarrow/yarrow.c
index ff25fa9..b1533da 100644
--- a/src/lib/crypto/krb/yarrow/yarrow.c
+++ b/src/lib/crypto/krb/yarrow/yarrow.c
@@ -34,7 +34,6 @@
#define YARROW_IMPL
#include "yarrow.h"
-#include "yhash.h"
#include "ycipher.h"
#include "ylock.h"
#include "ystate.h"
diff --git a/src/lib/crypto/krb/yarrow/yarrow.h b/src/lib/crypto/krb/yarrow/yarrow.h
index 7e1fe14..bb8c63a 100644
--- a/src/lib/crypto/krb/yarrow/yarrow.h
+++ b/src/lib/crypto/krb/yarrow/yarrow.h
@@ -10,7 +10,7 @@
#define YARROW_NO_MATHLIB
#include "ytypes.h"
-#include "yhash.h"
+#include <yhash.h>
#include "ycipher.h"
/* These error codes are returned by the functions below. */
diff --git a/src/lib/crypto/openssl/hash_provider/hash_crc32.c b/src/lib/crypto/openssl/hash_provider/hash_crc32.c
new file mode 100644
index 0000000..a3d3028
--- /dev/null
+++ b/src/lib/crypto/openssl/hash_provider/hash_crc32.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 1998 by the FundsXpress, INC.
+ *
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may require
+ * a specific license from the United States Government. It is the
+ * responsibility of any person or organization contemplating export to
+ * obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of FundsXpress. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. FundsXpress makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include "k5-int.h"
+#include "crc-32.h"
+#include "hash_provider.h"
+
+static krb5_error_code
+k5_crc32_hash(unsigned int icount, const krb5_data *input,
+ krb5_data *output)
+{
+ unsigned long c, cn;
+ unsigned int i;
+
+ if (output->length != CRC32_CKSUM_LENGTH)
+ return(KRB5_CRYPTO_INTERNAL);
+
+ c = 0;
+ for (i=0; i<icount; i++) {
+ mit_crc32(input[i].data, input[i].length, &cn);
+ c ^= cn;
+ }
+
+ store_32_le(c, output->data);
+ return(0);
+}
+
+const struct krb5_hash_provider krb5int_hash_crc32 = {
+ "CRC32",
+ CRC32_CKSUM_LENGTH,
+ 1,
+ k5_crc32_hash
+};
diff --git a/src/lib/crypto/openssl/hash_provider/hash_md4.c b/src/lib/crypto/openssl/hash_provider/hash_md4.c
new file mode 100644
index 0000000..f507aaa
--- /dev/null
+++ b/src/lib/crypto/openssl/hash_provider/hash_md4.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 1998 by the FundsXpress, INC.
+ *
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may require
+ * a specific license from the United States Government. It is the
+ * responsibility of any person or organization contemplating export to
+ * obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of FundsXpress. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. FundsXpress makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include "k5-int.h"
+#include "rsa-md4.h"
+#include "hash_provider.h"
+
+static krb5_error_code
+k5_md4_hash(unsigned int icount, const krb5_data *input,
+ krb5_data *output)
+{
+ krb5_MD4_CTX ctx;
+ unsigned int i;
+
+ if (output->length != RSA_MD4_CKSUM_LENGTH)
+ return(KRB5_CRYPTO_INTERNAL);
+
+ krb5_MD4Init(&ctx);
+ for (i=0; i<icount; i++)
+ krb5_MD4Update(&ctx, (unsigned char *) input[i].data, input[i].length);
+ krb5_MD4Final(&ctx);
+
+ memcpy(output->data, ctx.digest, RSA_MD4_CKSUM_LENGTH);
+
+ return(0);
+}
+
+const struct krb5_hash_provider krb5int_hash_md4 = {
+ "MD4",
+ RSA_MD4_CKSUM_LENGTH,
+ 64,
+ k5_md4_hash
+};
diff --git a/src/lib/crypto/openssl/hash_provider/hash_md5.c b/src/lib/crypto/openssl/hash_provider/hash_md5.c
new file mode 100644
index 0000000..a6e380a
--- /dev/null
+++ b/src/lib/crypto/openssl/hash_provider/hash_md5.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 1998 by the FundsXpress, INC.
+ *
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may require
+ * a specific license from the United States Government. It is the
+ * responsibility of any person or organization contemplating export to
+ * obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of FundsXpress. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. FundsXpress makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include "k5-int.h"
+#include "rsa-md5.h"
+#include "hash_provider.h"
+
+static krb5_error_code
+k5_md5_hash(unsigned int icount, const krb5_data *input,
+ krb5_data *output)
+{
+ krb5_MD5_CTX ctx;
+ unsigned int i;
+
+ if (output->length != RSA_MD5_CKSUM_LENGTH)
+ return(KRB5_CRYPTO_INTERNAL);
+
+ krb5_MD5Init(&ctx);
+ for (i=0; i<icount; i++)
+ krb5_MD5Update(&ctx, (unsigned char *) input[i].data, input[i].length);
+ krb5_MD5Final(&ctx);
+
+ memcpy(output->data, ctx.digest, RSA_MD5_CKSUM_LENGTH);
+
+ return(0);
+}
+
+const struct krb5_hash_provider krb5int_hash_md5 = {
+ "MD5",
+ RSA_MD5_CKSUM_LENGTH,
+ 64,
+ k5_md5_hash
+};
diff --git a/src/lib/crypto/openssl/hash_provider/hash_provider.h b/src/lib/crypto/openssl/hash_provider/hash_provider.h
new file mode 100644
index 0000000..4fa4609
--- /dev/null
+++ b/src/lib/crypto/openssl/hash_provider/hash_provider.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 1998 by the FundsXpress, INC.
+ *
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may require
+ * a specific license from the United States Government. It is the
+ * responsibility of any person or organization contemplating export to
+ * obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of FundsXpress. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. FundsXpress makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include "k5-int.h"
+
+extern const struct krb5_hash_provider krb5int_hash_crc32;
+extern const struct krb5_hash_provider krb5int_hash_md4;
+extern const struct krb5_hash_provider krb5int_hash_md5;
+extern const struct krb5_hash_provider krb5int_hash_sha1;
diff --git a/src/lib/crypto/openssl/hash_provider/hash_sha1.c b/src/lib/crypto/openssl/hash_provider/hash_sha1.c
new file mode 100644
index 0000000..d217086
--- /dev/null
+++ b/src/lib/crypto/openssl/hash_provider/hash_sha1.c
@@ -0,0 +1,61 @@
+/* lib/crypto/openssl/hash/yhash.h
+ *
+ * Copyright (C) 1998 by the FundsXpress, INC.
+ *
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may require
+ * a specific license from the United States Government. It is the
+ * responsibility of any person or organization contemplating export to
+ * obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of FundsXpress. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. FundsXpress makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include "k5-int.h"
+#include "shs.h"
+#include "hash_provider.h"
+
+static krb5_error_code
+k5_sha1_hash(unsigned int icount, const krb5_data *input,
+ krb5_data *output)
+{
+ SHS_INFO ctx;
+ unsigned int i;
+
+ if (output->length != SHS_DIGESTSIZE)
+ return(KRB5_CRYPTO_INTERNAL);
+
+ shsInit(&ctx);
+ for (i=0; i<icount; i++)
+ shsUpdate(&ctx, (unsigned char *) input[i].data, input[i].length);
+ shsFinal(&ctx);
+
+ if (ctx.digestLen > 0 && ctx.digestLen <= output->length){
+ output->length = ctx.digestLen;
+ memcpy(output->data, ctx.digestBuf,ctx.digestLen);
+ }
+
+ return(0);
+}
+
+const struct krb5_hash_provider krb5int_hash_sha1 = {
+ "SHA1",
+ SHS_DIGESTSIZE,
+ SHS_DATASIZE,
+ k5_sha1_hash
+};
+
diff --git a/src/lib/crypto/openssl/hmac.c b/src/lib/crypto/openssl/hmac.c
index a5543c9..e0c8dec 100644
--- a/src/lib/crypto/openssl/hmac.c
+++ b/src/lib/crypto/openssl/hmac.c
@@ -1,4 +1,4 @@
-/*
+/* lib/crypto/openssl/hmac.c
*/
#include "k5-int.h"
diff --git a/src/lib/crypto/openssl/sha1/shs.c b/src/lib/crypto/openssl/sha1/shs.c
index 9fb60f8..7cc864b 100644
--- a/src/lib/crypto/openssl/sha1/shs.c
+++ b/src/lib/crypto/openssl/sha1/shs.c
@@ -3,12 +3,19 @@
#include <sys/types.h>
#endif
#include <string.h>
+#define h0init 0x67452301L
+#define h1init 0xEFCDAB89L
+#define h2init 0x98BADCFEL
+#define h3init 0x10325476L
+#define h4init 0xC3D2E1F0L
/* Initialize the SHS values */
void shsInit(SHS_INFO *shsInfo)
{
EVP_MD_CTX_init(&shsInfo->ossl_sha1_ctx );
EVP_DigestInit_ex(&shsInfo->ossl_sha1_ctx , EVP_sha1(), NULL);
+ shsInfo->digestLen = 0;
+ memset(shsInfo->digestBuf, 0 , sizeof(shsInfo->digestBuf));
}
/* Update SHS for a block of data */
@@ -22,13 +29,8 @@ void shsUpdate(SHS_INFO *shsInfo, const SHS_BYTE *buffer, unsigned int count)
void shsFinal(SHS_INFO *shsInfo)
{
- unsigned char *digest_buf = NULL;
-
- digest_buf = (unsigned char *)OPENSSL_malloc( sizeof(shsInfo->digest));
-
- EVP_DigestFinal_ex(&shsInfo->ossl_sha1_ctx , digest_buf , &shsInfo->digest_len);
-
- memcpy(shsInfo->digest, digest_buf, shsInfo->digest_len);
- OPENSSL_free(digest_buf);
+ EVP_DigestFinal_ex(&shsInfo->ossl_sha1_ctx ,(unsigned char *)shsInfo->digestBuf , &shsInfo->digestLen);
EVP_MD_CTX_cleanup(&shsInfo->ossl_sha1_ctx );
}
+
+
diff --git a/src/lib/crypto/openssl/sha1/shs.h b/src/lib/crypto/openssl/sha1/shs.h
index 66e91b6..772c72a 100644
--- a/src/lib/crypto/openssl/sha1/shs.h
+++ b/src/lib/crypto/openssl/sha1/shs.h
@@ -22,11 +22,9 @@ typedef krb5_ui_4 SHS_LONG;
/* The structure for storing SHS info */
typedef struct {
- EVP_MD_CTX ossl_sha1_ctx;
- unsigned int digest_len;
- SHS_LONG digest[ 5 ]; /* Message digest */
- SHS_LONG countLo, countHi; /* 64-bit bit count */
- SHS_LONG data[ 16 ]; /* SHS data buffer */
+ EVP_MD_CTX ossl_sha1_ctx;
+ unsigned char digestBuf[SHS_DIGESTSIZE]; /* output */
+ unsigned int digestLen; /* output */
} SHS_INFO;
/* Message digest functions (shs.c) */
diff --git a/src/lib/crypto/openssl/yhash.h b/src/lib/crypto/openssl/yhash.h
new file mode 100644
index 0000000..94c557c
--- /dev/null
+++ b/src/lib/crypto/openssl/yhash.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C; c-file-style: "bsd" -*- */
+/* lib/crypto/openssl/hash/yhash.h
+ */
+
+#ifndef YHASH_H
+#define YHASH_H
+
+/* hash function interface */
+
+/* default to SHA1 for yarrow 160 */
+
+#include "shs.h"
+
+
+#define HASH_CTX SHS_INFO
+#define HASH_Init(x) shsInit(x)
+#define HASH_Update(x, buf, sz) shsUpdate(x, (const void*)buf, sz)
+
+#define HASH_Final(x, tdigest) do { \
+ int loopvar; \
+ unsigned char *out2 = (void *)(tdigest); \
+ HASH_CTX *ctx = (x); \
+ shsFinal(ctx); \
+ memcpy(out2, ctx->digestBuf, ctx->digestLen); \
+ } while(0)
+
+#define HASH_DIGEST_SIZE SHS_DIGESTSIZE
+
+#endif /* YHASH_H */
+