From d4fcd82bb7f6d603bd61e19a81ba97337b89dfca Mon Sep 17 00:00:00 2001 From: markus <> Date: Mon, 12 May 2003 02:18:40 +0000 Subject: merge 0.9.7b with local changes; crank majors for libssl/libcrypto --- src/lib/libcrypto/hmac/Makefile.ssl | 36 +++++++++++++++++++----------------- src/lib/libcrypto/hmac/hmac.c | 3 +++ src/lib/libcrypto/hmac/hmactest.c | 21 ++++++++++++++++++--- 3 files changed, 40 insertions(+), 20 deletions(-) (limited to 'src/lib/libcrypto/hmac') diff --git a/src/lib/libcrypto/hmac/Makefile.ssl b/src/lib/libcrypto/hmac/Makefile.ssl index 2bb3264f0e..f1c07322c4 100644 --- a/src/lib/libcrypto/hmac/Makefile.ssl +++ b/src/lib/libcrypto/hmac/Makefile.ssl @@ -68,7 +68,7 @@ lint: lint -DLINT $(INCLUDES) $(SRC)>fluff depend: - $(MAKEDEPEND) $(CFLAG) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC) + $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) dclean: $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new @@ -79,21 +79,23 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. -hmac.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h +hmac.o: ../../e_os.h ../../include/openssl/aes.h ../../include/openssl/asn1.h hmac.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -hmac.o: ../../include/openssl/bn.h ../../include/openssl/cast.h -hmac.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -hmac.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h -hmac.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +hmac.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +hmac.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h +hmac.o: ../../include/openssl/des.h ../../include/openssl/des_old.h +hmac.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +hmac.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h hmac.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h -hmac.o: ../../include/openssl/idea.h ../../include/openssl/md2.h -hmac.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -hmac.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h -hmac.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h -hmac.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -hmac.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -hmac.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h -hmac.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h -hmac.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -hmac.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h -hmac.o: ../../include/openssl/ui_compat.h hmac.c +hmac.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h +hmac.o: ../../include/openssl/md2.h ../../include/openssl/md4.h +hmac.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +hmac.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h +hmac.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h +hmac.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc2.h +hmac.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h +hmac.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +hmac.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +hmac.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +hmac.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h +hmac.o: ../cryptlib.h hmac.c diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c index da363b7950..4c91f919d5 100644 --- a/src/lib/libcrypto/hmac/hmac.c +++ b/src/lib/libcrypto/hmac/hmac.c @@ -59,6 +59,7 @@ #include #include #include +#include "cryptlib.h" void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, ENGINE *impl) @@ -78,6 +79,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, { reset=1; j=EVP_MD_block_size(md); + OPENSSL_assert(j <= sizeof ctx->key); if (j < len) { EVP_DigestInit_ex(&ctx->md_ctx,md, impl); @@ -87,6 +89,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, } else { + OPENSSL_assert(len <= sizeof ctx->key); memcpy(ctx->key,key,len); ctx->key_length=len; } diff --git a/src/lib/libcrypto/hmac/hmactest.c b/src/lib/libcrypto/hmac/hmactest.c index 96d3beb8e6..1b906b81af 100644 --- a/src/lib/libcrypto/hmac/hmactest.c +++ b/src/lib/libcrypto/hmac/hmactest.c @@ -60,6 +60,8 @@ #include #include +#include "../e_os.h" + #ifdef OPENSSL_NO_HMAC int main(int argc, char *argv[]) { @@ -68,12 +70,15 @@ int main(int argc, char *argv[]) } #else #include +#ifndef OPENSSL_NO_MD5 #include +#endif #ifdef CHARSET_EBCDIC #include #endif +#ifndef OPENSSL_NO_MD5 static struct test_st { unsigned char key[16]; @@ -113,13 +118,20 @@ static struct test_st (unsigned char *)"56be34521d144c88dbb8c733f0e8b3f6", }, }; - +#endif static char *pt(unsigned char *md); int main(int argc, char *argv[]) { - int i,err=0; +#ifndef OPENSSL_NO_MD5 + int i; char *p; +#endif + int err=0; + +#ifdef OPENSSL_NO_MD5 + printf("test skipped: MD5 disabled\n"); +#else #ifdef CHARSET_EBCDIC ebcdic2ascii(test[0].data, test[0].data, test[0].data_len); @@ -144,10 +156,12 @@ int main(int argc, char *argv[]) else printf("test %d ok\n",i); } - exit(err); +#endif /* OPENSSL_NO_MD5 */ + EXIT(err); return(0); } +#ifndef OPENSSL_NO_MD5 static char *pt(unsigned char *md) { int i; @@ -158,3 +172,4 @@ static char *pt(unsigned char *md) return(buf); } #endif +#endif -- cgit v1.2.3-55-g6feb