]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
openssl: auto enable padlock engine.
authorArne Fitzenreiter <arne_f@ipfire.org>
Mon, 27 Apr 2015 20:15:20 +0000 (22:15 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 27 Apr 2015 20:15:20 +0000 (22:15 +0200)
lfs/openssl
src/patches/openssl-1.0.2a_auto_enable_padlock.patch [new file with mode: 0644]

index 814c1e301a369df0cb2ef729c12621059a53651f..a1f4fbe731424a3375e9b3aae5f18617ebb4775b 100644 (file)
@@ -117,6 +117,11 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.1m-weak-ciphers.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-disable-sslv2-sslv3.patch
 
+       # Enable Padlock in i586
+ifeq "$(MACHINE)" "i586"
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/openssl-1.0.2a_auto_enable_padlock.patch
+endif
+
        # Apply our CFLAGS
        cd $(DIR_APP) && sed -i Configure \
                -e "s/-O3 -fomit-frame-pointer/$(CFLAGS)/g"
diff --git a/src/patches/openssl-1.0.2a_auto_enable_padlock.patch b/src/patches/openssl-1.0.2a_auto_enable_padlock.patch
new file mode 100644 (file)
index 0000000..b5c0e95
--- /dev/null
@@ -0,0 +1,34 @@
+diff -Naur openssl-1.0.2a.org/crypto/engine/eng_all.c openssl-1.0.2a/crypto/engine/eng_all.c
+--- openssl-1.0.2a.org/crypto/engine/eng_all.c 2015-03-19 14:30:36.000000000 +0100
++++ openssl-1.0.2a/crypto/engine/eng_all.c     2015-04-27 12:27:05.063569969 +0200
+@@ -120,6 +120,14 @@
+     ENGINE_load_capi();
+ # endif
+ #endif
++#ifdef OPENSSL_NO_STATIC_ENGINE
++      ENGINE *e;
++      e = ENGINE_by_id("padlock");
++      if (e != NULL) {
++              ENGINE_add(e);
++              ENGINE_free(e);
++      }
++#endif
+     ENGINE_register_all_complete();
+ }
+diff -Naur openssl-1.0.2a.org/ssl/ssl_algs.c openssl-1.0.2a/ssl/ssl_algs.c
+--- openssl-1.0.2a.org/ssl/ssl_algs.c  2015-03-19 14:30:36.000000000 +0100
++++ openssl-1.0.2a/ssl/ssl_algs.c      2015-04-27 11:04:27.893399695 +0200
+@@ -151,5 +151,12 @@
+ #endif
+     /* initialize cipher/digest methods table */
+     ssl_load_ciphers();
++
++    /* Init available hardware crypto engines */
++    ENGINE_load_builtin_engines();
++    ENGINE_register_all_complete();
++    ENGINE * padlock = ENGINE_by_id("padlock");
++    if (padlock) ENGINE_set_default_ciphers(padlock);
++
+     return (1);
+ }