components/openssl/openssl-1.0.0/patches/15-pkcs11_engine-0.9.8a.patch
changeset 1158 227137d9fbce
parent 1157 65a016eaa866
child 1159 24e95e0bf738
equal deleted inserted replaced
1157:65a016eaa866 1158:227137d9fbce
     1 --- /tmp/Configure	Fri Feb 11 14:40:39 2011
       
     2 +++ openssl-1.0.0d/Configure	Fri Feb 11 14:41:36 2011
       
     3 @@ -10,7 +10,7 @@
       
     4  
       
     5  # see INSTALL for instructions.
       
     6  
       
     7 -my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
       
     8 +my $usage="Usage: Configure --pk11-libname=PK11_LIB_LOCATION [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n";
       
     9  
       
    10  # Options:
       
    11  #
       
    12 @@ -19,6 +19,9 @@
       
    13  # --prefix      prefix for the OpenSSL include, lib and bin directories
       
    14  #               (Default: the OPENSSLDIR directory)
       
    15  #
       
    16 +# --pk11-libname  PKCS#11 library name.
       
    17 +#               (Default: none)
       
    18 +#
       
    19  # --install_prefix  Additional prefix for package builders (empty by
       
    20  #               default).  This needn't be set in advance, you can
       
    21  #               just as well use "make INSTALL_PREFIX=/whatever install".
       
    22 @@ -622,6 +625,9 @@
       
    23  my $idx_arflags = $idx++;
       
    24  my $idx_multilib = $idx++;
       
    25  
       
    26 +# PKCS#11 engine patch
       
    27 +my $pk11_libname="";
       
    28 +
       
    29  my $prefix="";
       
    30  my $libdir="";
       
    31  my $openssldir="";
       
    32 @@ -824,6 +830,10 @@
       
    33  				{
       
    34  				$flags.=$_." ";
       
    35  				}
       
    36 +                        elsif (/^--pk11-libname=(.*)$/)
       
    37 +                                {
       
    38 +                                $pk11_libname=$1;
       
    39 +                                }
       
    40  			elsif (/^--prefix=(.*)$/)
       
    41  				{
       
    42  				$prefix=$1;
       
    43 @@ -961,6 +971,13 @@
       
    44  	exit 0;
       
    45  }
       
    46  
       
    47 +if (! $pk11_libname)
       
    48 +        {
       
    49 +        print STDERR "You must set --pk11-libname for PKCS#11 library.\n";
       
    50 +        print STDERR "See README.pkcs11 for more information.\n";
       
    51 +        exit 1;
       
    52 +        }
       
    53 +
       
    54  if ($target =~ m/^CygWin32(-.*)$/) {
       
    55  	$target = "Cygwin".$1;
       
    56  }
       
    57 @@ -1123,6 +1140,8 @@
       
    58  if ($flags ne "")	{ $cflags="$flags$cflags"; }
       
    59  else			{ $no_user_cflags=1;       }
       
    60  
       
    61 +$cflags="-DPK11_LIB_LOCATION=\"$pk11_libname\" $cflags";
       
    62 +
       
    63  # Kerberos settings.  The flavor must be provided from outside, either through
       
    64  # the script "config" or manually.
       
    65  if (!$no_krb5)
       
    66 @@ -1492,6 +1511,7 @@
       
    67  	s/^VERSION=.*/VERSION=$version/;
       
    68  	s/^MAJOR=.*/MAJOR=$major/;
       
    69  	s/^MINOR=.*/MINOR=$minor/;
       
    70 +	s/^PK11_LIB_LOCATION=.*/PK11_LIB_LOCATION=$pk11_libname/;
       
    71  	s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=$shlib_version_number/;
       
    72  	s/^SHLIB_VERSION_HISTORY=.*/SHLIB_VERSION_HISTORY=$shlib_version_history/;
       
    73  	s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=$shlib_major/;
       
    74 --- /tmp/Makefile.org	Fri Feb 11 14:41:54 2011
       
    75 +++ openssl-1.0.0d/Makefile.org	Fri Feb 11 14:38:01 2011
       
    76 @@ -26,6 +26,9 @@
       
    77  INSTALL_PREFIX=
       
    78  INSTALLTOP=/usr/local/ssl
       
    79  
       
    80 +# You must set this through --pk11-libname configure option.
       
    81 +PK11_LIB_LOCATION=
       
    82 +
       
    83  # Do not edit this manually. Use Configure --openssldir=DIR do change this!
       
    84  OPENSSLDIR=/usr/local/ssl
       
    85  
       
    86 --- /tmp/Makefile	Fri Feb 11 14:42:03 2011
       
    87 +++ openssl-1.0.0d/crypto/engine/Makefile	Fri Feb 11 14:45:43 2011
       
    88 @@ -21,12 +21,14 @@
       
    89  	eng_table.c eng_pkey.c eng_fat.c eng_all.c \
       
    90  	tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c \
       
    91  	tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c \
       
    92 -	eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c
       
    93 +	eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c \
       
    94 +	hw_pk11.c hw_pk11_pub.c hw_pk11_uri.c
       
    95  LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \
       
    96  	eng_table.o eng_pkey.o eng_fat.o eng_all.o \
       
    97  	tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_ecdh.o tb_rand.o tb_store.o \
       
    98  	tb_cipher.o tb_digest.o tb_pkmeth.o tb_asnmth.o \
       
    99 -	eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o
       
   100 +	eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o \
       
   101 +	hw_pk11.o hw_pk11_pub.o hw_pk11_uri.o
       
   102  
       
   103  SRC= $(LIBSRC)
       
   104  
       
   105 --- /tmp/eng_all.c	Fri Feb 11 14:46:11 2011
       
   106 +++ openssl-1.0.0d/crypto/engine/eng_all.c	Fri Feb 11 14:38:01 2011
       
   107 @@ -72,6 +72,9 @@
       
   108  	ENGINE_load_cryptodev();
       
   109  #endif
       
   110  	ENGINE_load_dynamic();
       
   111 +#ifndef OPENSSL_NO_HW_PKCS11
       
   112 +	ENGINE_load_pk11();
       
   113 +#endif
       
   114  #ifndef OPENSSL_NO_STATIC_ENGINE
       
   115  #ifndef OPENSSL_NO_HW
       
   116  #ifndef OPENSSL_NO_HW_4758_CCA
       
   117 --- /tmp/engine.h	Fri Feb 11 14:46:24 2011
       
   118 +++ openssl-1.0.0d/crypto/engine/engine.h	Fri Feb 11 14:47:32 2011
       
   119 @@ -344,6 +344,7 @@
       
   120  #endif
       
   121  #endif
       
   122  void ENGINE_load_cryptodev(void);
       
   123 +void ENGINE_load_pk11(void);
       
   124  void ENGINE_load_builtin_engines(void);
       
   125  
       
   126  /* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation