summaryrefslogtreecommitdiff
path: root/qca-ossl/qca-ossl-openssl-1.0.0.patch
blob: c7d6e47b180d05183019fede624dcae03a097f50 (plain)
    1 diff -ru a/CMakeLists.txt b/CMakeLists.txt
    2 --- a/CMakeLists.txt	2007-06-29 23:10:53.000000000 +0200
    3 +++ b/CMakeLists.txt	2010-04-18 04:05:09.000000000 +0200
    4 @@ -1,5 +1,12 @@
    5  # QCA OSSL
    6  
    7 +INCLUDE(CheckFunctionExists)
    8 +SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES})
    9 +CHECK_FUNCTION_EXISTS(EVP_md2 HAVE_OPENSSL_MD2)
   10 +IF (HAVE_OPENSSL_MD2)
   11 +  ADD_DEFINITIONS(-DHAVE_OPENSSL_MD2)
   12 +ENDIF (HAVE_OPENSSL_MD2)
   13 +
   14  SET(QCA_OSSL_SOURCES qca-ossl.cpp)
   15  
   16  MY_AUTOMOC( QCA_OSSL_SOURCES )
   17 diff -ru a/qca-ossl.cpp b/qca-ossl.cpp
   18 --- a/qca-ossl.cpp	2007-12-11 07:34:57.000000000 +0100
   19 +++ b/qca-ossl.cpp	2010-04-18 04:08:46.000000000 +0200
   20 @@ -42,6 +42,15 @@
   21  #define OSSL_097
   22  #endif
   23  
   24 +#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
   25 +// OpenSSL 1.0.0 makes a few changes that aren't very C++ friendly...
   26 +// Among other things, CHECKED_PTR_OF returns a void*, but is used in
   27 +// contexts requiring STACK pointers.
   28 +#undef CHECKED_PTR_OF
   29 +#define CHECKED_PTR_OF(type, p) \
   30 +	            ((_STACK*) (1 ? p : (type*)0))
   31 +#endif
   32 +
   33  using namespace QCA;
   34  
   35  namespace opensslQCAPlugin {
   36 @@ -1771,8 +1780,10 @@
   37  			md = EVP_sha1();
   38  		else if(alg == EMSA3_MD5)
   39  			md = EVP_md5();
   40 +#ifdef HAVE_OPENSSL_MD2
   41  		else if(alg == EMSA3_MD2)
   42  			md = EVP_md2();
   43 +#endif
   44  		else if(alg == EMSA3_RIPEMD160)
   45  			md = EVP_ripemd160();
   46  		else if(alg == EMSA3_Raw)
   47 @@ -1789,8 +1800,10 @@
   48  			md = EVP_sha1();
   49  		else if(alg == EMSA3_MD5)
   50  			md = EVP_md5();
   51 +#ifdef HAVE_OPENSSL_MD2
   52  		else if(alg == EMSA3_MD2)
   53  			md = EVP_md2();
   54 +#endif
   55  		else if(alg == EMSA3_RIPEMD160)
   56  			md = EVP_ripemd160();
   57  		else if(alg == EMSA3_Raw)
   58 @@ -3385,9 +3398,11 @@
   59  		case NID_md5WithRSAEncryption:
   60  		    p.sigalgo = QCA::EMSA3_MD5;
   61  		    break;
   62 +#ifdef HAVE_OPENSSL_MD2
   63  		case NID_md2WithRSAEncryption:
   64  		    p.sigalgo = QCA::EMSA3_MD2;
   65  		    break;
   66 +#endif
   67  		case NID_ripemd160WithRSA:
   68  		    p.sigalgo = QCA::EMSA3_RIPEMD160;
   69  		    break;
   70 @@ -3871,9 +3886,11 @@
   71  		case NID_md5WithRSAEncryption:
   72  		    p.sigalgo = QCA::EMSA3_MD5;
   73  		    break;
   74 +#ifdef HAVE_OPENSSL_MD2
   75  		case NID_md2WithRSAEncryption:
   76  		    p.sigalgo = QCA::EMSA3_MD2;
   77  		    break;
   78 +#endif
   79  		case NID_ripemd160WithRSA:
   80  		    p.sigalgo = QCA::EMSA3_RIPEMD160;
   81  		    break;
   82 @@ -4061,9 +4078,11 @@
   83  		case NID_md5WithRSAEncryption:
   84  		    p.sigalgo = QCA::EMSA3_MD5;
   85  		    break;
   86 +#ifdef HAVE_OPENSSL_MD2
   87  		case NID_md2WithRSAEncryption:
   88  		    p.sigalgo = QCA::EMSA3_MD2;
   89  		    break;
   90 +#endif
   91  		case NID_ripemd160WithRSA:
   92  		    p.sigalgo = QCA::EMSA3_RIPEMD160;
   93  		    break;
   94 @@ -6582,7 +6601,9 @@
   95  	list += "sha1";
   96  	list += "sha0";
   97  	list += "ripemd160";
   98 +#ifdef HAVE_OPENSSL_MD2
   99  	list += "md2";
  100 +#endif
  101  	list += "md4";
  102  	list += "md5";
  103  #ifdef SHA224_DIGEST_LENGTH
  104 @@ -6597,9 +6618,11 @@
  105  #ifdef SHA512_DIGEST_LENGTH
  106  	list += "sha512";
  107  #endif
  108 +/*
  109  #ifdef OBJ_whirlpool
  110  	list += "whirlpool";
  111  #endif
  112 +*/
  113  	return list;
  114  }
  115  
  116 @@ -6757,7 +6780,9 @@
  117  		list += all_hash_types();
  118  		list += all_mac_types();
  119  		list += all_cipher_types();
  120 +#ifdef HAVE_OPENSSL_MD2
  121  		list += "pbkdf1(md2)";
  122 +#endif
  123  		list += "pbkdf1(sha1)";
  124  		list += "pbkdf2(sha1)";
  125  		list += "pkey";
  126 @@ -6788,8 +6813,10 @@
  127  			return new opensslHashContext( EVP_sha(), this, type);
  128  		else if ( type == "ripemd160" )
  129  			return new opensslHashContext( EVP_ripemd160(), this, type);
  130 +#ifdef HAVE_OPENSSL_MD2
  131  		else if ( type == "md2" )
  132  			return new opensslHashContext( EVP_md2(), this, type);
  133 +#endif
  134  		else if ( type == "md4" )
  135  			return new opensslHashContext( EVP_md4(), this, type);
  136  		else if ( type == "md5" )
  137 @@ -6810,14 +6837,18 @@
  138  		else if ( type == "sha512" )
  139  			return new opensslHashContext( EVP_sha512(), this, type);
  140  #endif
  141 +/*
  142  #ifdef OBJ_whirlpool
  143  		else if ( type == "whirlpool" )
  144  			return new opensslHashContext( EVP_whirlpool(), this, type);
  145  #endif
  146 +*/
  147  		else if ( type == "pbkdf1(sha1)" )
  148  			return new opensslPbkdf1Context( EVP_sha1(), this, type );
  149 +#ifdef HAVE_OPENSSL_MD2
  150  		else if ( type == "pbkdf1(md2)" )
  151  			return new opensslPbkdf1Context( EVP_md2(), this, type );
  152 +#endif
  153  		else if ( type == "pbkdf2(sha1)" )
  154  			return new opensslPbkdf2Context( this, type );
  155  		else if ( type == "hmac(md5)" )

Generated by cgit