security/botan110: Fix OpenSSL build PR: 228865 Submitted by: Nathan Index: security/botan110/Makefile =================================================================== --- security/botan110/Makefile (revision 482110) +++ security/botan110/Makefile (working copy) @@ -3,7 +3,7 @@ PORTNAME= botan PORTVERSION= 1.10.13 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= security MASTER_SITES= http://botan.randombit.net/releases/ PKGNAMESUFFIX= 110 Index: security/botan110/files/patch-src_engine_openssl_ossl__bc.cpp =================================================================== --- security/botan110/files/patch-src_engine_openssl_ossl__bc.cpp (nonexistent) +++ security/botan110/files/patch-src_engine_openssl_ossl__bc.cpp (working copy) @@ -0,0 +1,143 @@ +--- src/engine/openssl/ossl_bc.cpp.orig 2018-10-15 00:16:53 UTC ++++ src/engine/openssl/ossl_bc.cpp +@@ -40,7 +40,7 @@ class EVP_BlockCipher : public BlockCipher + size_t block_sz; + Key_Length_Specification cipher_key_spec; + std::string cipher_name; +- mutable EVP_CIPHER_CTX encrypt, decrypt; ++ mutable EVP_CIPHER_CTX *encrypt, *decrypt; + }; + + /* +@@ -55,14 +55,14 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* alg + if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE) + throw Invalid_Argument("EVP_BlockCipher: Non-ECB EVP was passed in"); + +- EVP_CIPHER_CTX_init(&encrypt); +- EVP_CIPHER_CTX_init(&decrypt); ++ EVP_CIPHER_CTX_init(encrypt); ++ EVP_CIPHER_CTX_init(decrypt); + +- EVP_EncryptInit_ex(&encrypt, algo, 0, 0, 0); +- EVP_DecryptInit_ex(&decrypt, algo, 0, 0, 0); ++ EVP_EncryptInit_ex(encrypt, algo, 0, 0, 0); ++ EVP_DecryptInit_ex(decrypt, algo, 0, 0, 0); + +- EVP_CIPHER_CTX_set_padding(&encrypt, 0); +- EVP_CIPHER_CTX_set_padding(&decrypt, 0); ++ EVP_CIPHER_CTX_set_padding(encrypt, 0); ++ EVP_CIPHER_CTX_set_padding(decrypt, 0); + } + + /* +@@ -79,14 +79,14 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* alg + if(EVP_CIPHER_mode(algo) != EVP_CIPH_ECB_MODE) + throw Invalid_Argument("EVP_BlockCipher: Non-ECB EVP was passed in"); + +- EVP_CIPHER_CTX_init(&encrypt); +- EVP_CIPHER_CTX_init(&decrypt); ++ EVP_CIPHER_CTX_init(encrypt); ++ EVP_CIPHER_CTX_init(decrypt); + +- EVP_EncryptInit_ex(&encrypt, algo, 0, 0, 0); +- EVP_DecryptInit_ex(&decrypt, algo, 0, 0, 0); ++ EVP_EncryptInit_ex(encrypt, algo, 0, 0, 0); ++ EVP_DecryptInit_ex(decrypt, algo, 0, 0, 0); + +- EVP_CIPHER_CTX_set_padding(&encrypt, 0); +- EVP_CIPHER_CTX_set_padding(&decrypt, 0); ++ EVP_CIPHER_CTX_set_padding(encrypt, 0); ++ EVP_CIPHER_CTX_set_padding(decrypt, 0); + } + + /* +@@ -94,8 +94,8 @@ EVP_BlockCipher::EVP_BlockCipher(const EVP_CIPHER* alg + */ + EVP_BlockCipher::~EVP_BlockCipher() + { +- EVP_CIPHER_CTX_cleanup(&encrypt); +- EVP_CIPHER_CTX_cleanup(&decrypt); ++ EVP_CIPHER_CTX_cleanup(encrypt); ++ EVP_CIPHER_CTX_cleanup(decrypt); + } + + /* +@@ -105,7 +105,7 @@ void EVP_BlockCipher::encrypt_n(const byte in[], byte + size_t blocks) const + { + int out_len = 0; +- EVP_EncryptUpdate(&encrypt, out, &out_len, in, blocks * block_sz); ++ EVP_EncryptUpdate(encrypt, out, &out_len, in, blocks * block_sz); + } + + /* +@@ -115,7 +115,7 @@ void EVP_BlockCipher::decrypt_n(const byte in[], byte + size_t blocks) const + { + int out_len = 0; +- EVP_DecryptUpdate(&decrypt, out, &out_len, in, blocks * block_sz); ++ EVP_DecryptUpdate(decrypt, out, &out_len, in, blocks * block_sz); + } + + /* +@@ -130,19 +130,19 @@ void EVP_BlockCipher::key_schedule(const byte key[], s + full_key += std::make_pair(key, 8); + } + else +- if(EVP_CIPHER_CTX_set_key_length(&encrypt, length) == 0 || +- EVP_CIPHER_CTX_set_key_length(&decrypt, length) == 0) ++ if(EVP_CIPHER_CTX_set_key_length(encrypt, length) == 0 || ++ EVP_CIPHER_CTX_set_key_length(decrypt, length) == 0) + throw Invalid_Argument("EVP_BlockCipher: Bad key length for " + + cipher_name); + + if(cipher_name == "RC2") + { +- EVP_CIPHER_CTX_ctrl(&encrypt, EVP_CTRL_SET_RC2_KEY_BITS, length*8, 0); +- EVP_CIPHER_CTX_ctrl(&decrypt, EVP_CTRL_SET_RC2_KEY_BITS, length*8, 0); ++ EVP_CIPHER_CTX_ctrl(encrypt, EVP_CTRL_SET_RC2_KEY_BITS, length*8, 0); ++ EVP_CIPHER_CTX_ctrl(decrypt, EVP_CTRL_SET_RC2_KEY_BITS, length*8, 0); + } + +- EVP_EncryptInit_ex(&encrypt, 0, 0, full_key.begin(), 0); +- EVP_DecryptInit_ex(&decrypt, 0, 0, full_key.begin(), 0); ++ EVP_EncryptInit_ex(encrypt, 0, 0, full_key.begin(), 0); ++ EVP_DecryptInit_ex(decrypt, 0, 0, full_key.begin(), 0); + } + + /* +@@ -150,7 +150,7 @@ void EVP_BlockCipher::key_schedule(const byte key[], s + */ + BlockCipher* EVP_BlockCipher::clone() const + { +- return new EVP_BlockCipher(EVP_CIPHER_CTX_cipher(&encrypt), ++ return new EVP_BlockCipher(EVP_CIPHER_CTX_cipher(encrypt), + cipher_name, + cipher_key_spec.minimum_keylength(), + cipher_key_spec.maximum_keylength(), +@@ -162,16 +162,16 @@ BlockCipher* EVP_BlockCipher::clone() const + */ + void EVP_BlockCipher::clear() + { +- const EVP_CIPHER* algo = EVP_CIPHER_CTX_cipher(&encrypt); ++ const EVP_CIPHER* algo = EVP_CIPHER_CTX_cipher(encrypt); + +- EVP_CIPHER_CTX_cleanup(&encrypt); +- EVP_CIPHER_CTX_cleanup(&decrypt); +- EVP_CIPHER_CTX_init(&encrypt); +- EVP_CIPHER_CTX_init(&decrypt); +- EVP_EncryptInit_ex(&encrypt, algo, 0, 0, 0); +- EVP_DecryptInit_ex(&decrypt, algo, 0, 0, 0); +- EVP_CIPHER_CTX_set_padding(&encrypt, 0); +- EVP_CIPHER_CTX_set_padding(&decrypt, 0); ++ EVP_CIPHER_CTX_cleanup(encrypt); ++ EVP_CIPHER_CTX_cleanup(decrypt); ++ EVP_CIPHER_CTX_init(encrypt); ++ EVP_CIPHER_CTX_init(decrypt); ++ EVP_EncryptInit_ex(encrypt, algo, 0, 0, 0); ++ EVP_DecryptInit_ex(decrypt, algo, 0, 0, 0); ++ EVP_CIPHER_CTX_set_padding(encrypt, 0); ++ EVP_CIPHER_CTX_set_padding(decrypt, 0); + } + + } Property changes on: security/botan110/files/patch-src_engine_openssl_ossl__bc.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: security/botan110/files/patch-src_engine_openssl_ossl__md.cpp =================================================================== --- security/botan110/files/patch-src_engine_openssl_ossl__md.cpp (nonexistent) +++ security/botan110/files/patch-src_engine_openssl_ossl__md.cpp (working copy) @@ -0,0 +1,88 @@ +--- src/engine/openssl/ossl_md.cpp.orig 2018-10-15 00:26:19 UTC ++++ src/engine/openssl/ossl_md.cpp +@@ -24,12 +24,12 @@ class EVP_HashFunction : public HashFunction + + size_t output_length() const + { +- return EVP_MD_size(EVP_MD_CTX_md(&md)); ++ return EVP_MD_size(EVP_MD_CTX_md(md)); + } + + size_t hash_block_size() const + { +- return EVP_MD_block_size(EVP_MD_CTX_md(&md)); ++ return EVP_MD_block_size(EVP_MD_CTX_md(md)); + } + + EVP_HashFunction(const EVP_MD*, const std::string&); +@@ -40,7 +40,7 @@ class EVP_HashFunction : public HashFunction + + size_t block_size; + std::string algo_name; +- EVP_MD_CTX md; ++ EVP_MD_CTX *md; + }; + + /* +@@ -48,7 +48,7 @@ class EVP_HashFunction : public HashFunction + */ + void EVP_HashFunction::add_data(const byte input[], size_t length) + { +- EVP_DigestUpdate(&md, input, length); ++ EVP_DigestUpdate(md, input, length); + } + + /* +@@ -56,9 +56,9 @@ void EVP_HashFunction::add_data(const byte input[], si + */ + void EVP_HashFunction::final_result(byte output[]) + { +- EVP_DigestFinal_ex(&md, output, 0); +- const EVP_MD* algo = EVP_MD_CTX_md(&md); +- EVP_DigestInit_ex(&md, algo, 0); ++ EVP_DigestFinal_ex(md, output, 0); ++ const EVP_MD* algo = EVP_MD_CTX_md(md); ++ EVP_DigestInit_ex(md, algo, 0); + } + + /* +@@ -66,8 +66,8 @@ void EVP_HashFunction::final_result(byte output[]) + */ + void EVP_HashFunction::clear() + { +- const EVP_MD* algo = EVP_MD_CTX_md(&md); +- EVP_DigestInit_ex(&md, algo, 0); ++ const EVP_MD* algo = EVP_MD_CTX_md(md); ++ EVP_DigestInit_ex(md, algo, 0); + } + + /* +@@ -75,7 +75,7 @@ void EVP_HashFunction::clear() + */ + HashFunction* EVP_HashFunction::clone() const + { +- const EVP_MD* algo = EVP_MD_CTX_md(&md); ++ const EVP_MD* algo = EVP_MD_CTX_md(md); + return new EVP_HashFunction(algo, name()); + } + +@@ -86,8 +86,8 @@ EVP_HashFunction::EVP_HashFunction(const EVP_MD* algo, + const std::string& name) : + algo_name(name) + { +- EVP_MD_CTX_init(&md); +- EVP_DigestInit_ex(&md, algo, 0); ++ EVP_MD_CTX_init(md); ++ EVP_DigestInit_ex(md, algo, 0); + } + + /* +@@ -95,7 +95,7 @@ EVP_HashFunction::EVP_HashFunction(const EVP_MD* algo, + */ + EVP_HashFunction::~EVP_HashFunction() + { +- EVP_MD_CTX_cleanup(&md); ++ EVP_MD_CTX_free(md); + } + + } Property changes on: security/botan110/files/patch-src_engine_openssl_ossl__md.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property