Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl fix AES-NI (using David Woodhous...



details:   https://anonhg.NetBSD.org/src/rev/82dc1cdc8c59
branches:  trunk
changeset: 766017:82dc1cdc8c59
user:      spz <spz%NetBSD.org@localhost>
date:      Mon Jun 13 14:19:48 2011 +0000

description:
fix AES-NI (using David Woodhouse's patch for OpenSSL 1.0.0) & re-enable
inclusion of AES-NI capability
builds, but is untested due to lack of hardware

diffstat:

 crypto/external/bsd/openssl/dist/crypto/aes/Makefile       |   4 +++
 crypto/external/bsd/openssl/dist/crypto/engine/Makefile    |  15 --------------
 crypto/external/bsd/openssl/dist/crypto/engine/eng_aesni.c |   9 +++++++-
 crypto/external/bsd/openssl/lib/libcrypto/engine.inc       |  12 +++++-----
 4 files changed, 18 insertions(+), 22 deletions(-)

diffs (94 lines):

diff -r da8327eb4840 -r 82dc1cdc8c59 crypto/external/bsd/openssl/dist/crypto/aes/Makefile
--- a/crypto/external/bsd/openssl/dist/crypto/aes/Makefile      Mon Jun 13 12:29:16 2011 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/aes/Makefile      Mon Jun 13 14:19:48 2011 +0000
@@ -50,9 +50,13 @@
 
 aes-586.s:     asm/aes-586.pl ../perlasm/x86asm.pl
        $(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+aesni-x86.s:   asm/aesni-x86.pl ../perlasm/x86asm.pl
+       $(PERL) asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
 
 aes-x86_64.s: asm/aes-x86_64.pl
        $(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
+aesni-x86_64.s: asm/aesni-x86_64.pl
+       $(PERL) asm/aesni-x86_64.pl $(PERLASM_SCHEME) > $@
 
 aes-sparcv9.s: asm/aes-sparcv9.pl
        $(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@
diff -r da8327eb4840 -r 82dc1cdc8c59 crypto/external/bsd/openssl/dist/crypto/engine/Makefile
--- a/crypto/external/bsd/openssl/dist/crypto/engine/Makefile   Mon Jun 13 12:29:16 2011 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/engine/Makefile   Mon Jun 13 14:19:48 2011 +0000
@@ -84,21 +84,6 @@
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
-eng_aesni.o: ../../e_os.h ../../include/openssl/aes.h
-eng_aesni.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
-eng_aesni.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
-eng_aesni.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
-eng_aesni.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
-eng_aesni.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
-eng_aesni.o: ../../include/openssl/err.h ../../include/openssl/evp.h
-eng_aesni.o: ../../include/openssl/lhash.h ../../include/openssl/modes.h
-eng_aesni.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
-eng_aesni.o: ../../include/openssl/opensslconf.h
-eng_aesni.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
-eng_aesni.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
-eng_aesni.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
-eng_aesni.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
-eng_aesni.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_aesni.c
 eng_all.o: ../../e_os.h ../../include/openssl/asn1.h
 eng_all.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
 eng_all.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
diff -r da8327eb4840 -r 82dc1cdc8c59 crypto/external/bsd/openssl/dist/crypto/engine/eng_aesni.c
--- a/crypto/external/bsd/openssl/dist/crypto/engine/eng_aesni.c        Mon Jun 13 12:29:16 2011 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/engine/eng_aesni.c        Mon Jun 13 14:19:48 2011 +0000
@@ -104,7 +104,8 @@
        ENGINE *toadd = ENGINE_aesni();
        if (!toadd)
                return;
-       ENGINE_add (toadd);
+       if (ENGINE_add (toadd))
+               ENGINE_register_complete (toadd);
        ENGINE_free (toadd);
        ERR_clear_error ();
 #endif
@@ -150,6 +151,12 @@
 
 /* ===== Engine "management" functions ===== */
 
+#if defined(_WIN32)
+typedef unsigned __int64 IA32CAP;
+#else
+typedef unsigned long long IA32CAP;
+#endif
+
 /* Prepare the ENGINE structure for registration */
 static int
 aesni_bind_helper(ENGINE *e)
diff -r da8327eb4840 -r 82dc1cdc8c59 crypto/external/bsd/openssl/lib/libcrypto/engine.inc
--- a/crypto/external/bsd/openssl/lib/libcrypto/engine.inc      Mon Jun 13 12:29:16 2011 +0000
+++ b/crypto/external/bsd/openssl/lib/libcrypto/engine.inc      Mon Jun 13 14:19:48 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: engine.inc,v 1.2 2011/06/05 23:09:50 spz Exp $
+#      $NetBSD: engine.inc,v 1.3 2011/06/13 14:19:48 spz Exp $
 #
 #      @(#) Copyright (c) 1995 Simon J. Gerraty
 #
@@ -24,11 +24,11 @@
        e_sureware.c e_sureware_err.c \
        e_ubsec.c e_ubsec_err.c   \
 
-#.if defined(AESNI)
-#ENGINE_SRCS+=  eng_aesni.c
-#.else
-AESCPPFLAGS=-DOPENSSL_NO_HW_AESNI # re-enable later
-#.endif
+.if defined(AESNI)
+ENGINE_SRCS+=  eng_aesni.c
+.else
+AESCPPFLAGS=-DOPENSSL_NO_HW_AESNI
+.endif
 
 #ENGINE_SRCS += gost2001.c gost2001_keyx.c gost89.c gost94_keyx.c gost_ameth.c \
 #      gost_asn1.c gost_crypt.c gost_ctl.c gost_eng.c gosthash.c \



Home | Main Index | Thread Index | Old Index