Skip to content

Commit

Permalink
Some tweaks for proxy build
Browse files Browse the repository at this point in the history
  • Loading branch information
dcillera committed Jun 13, 2024
1 parent d5a0a89 commit cfdeb56
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
7 changes: 6 additions & 1 deletion bssl-compat/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ cmake(
visibility = ["//visibility:public"],
generate_crosstool_file = False,
tags = ["requires-network"],
env = { "GOCACHE" : "/tmp" },
env = { "GOCACHE" : "/tmp",
"CMAKE_C_COMPILER" : "clang",
"CMAKE_CXX_COMPILER" : "clang++",
"Clang_ROOT" : "/usr/lib/llvm"
},

build_args = [ "-j" ]
)

Expand Down
6 changes: 4 additions & 2 deletions bssl-compat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ endif()
set(OPENSSL_URL https://github.com/openssl/openssl/archive/refs/tags/openssl-3.0.13.tar.gz)
set(OPENSSL_URL_HASH e74504ed7035295ec7062b1da16c15b57ff2a03cd2064a28d8c39458cacc45fc)

SET (CMAKE_C_COMPILER "clang")
SET (CMAKE_CXX_COMPILER "clang++")
# dcillera - commented out as they're declared in function "cmake" of Bazel BUILD file
# SET (CMAKE_C_COMPILER "clang")
# SET (CMAKE_CXX_COMPILER "clang++")

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -118,6 +119,7 @@ add_library(bssl-compat STATIC
source/RSA_decrypt.cc
source/RSA_encrypt.cc
source/RSA_generate_key_ex.cc
source/RSA_padding_add_PKCS1_PSS_mgf1.cc
source/RSA_private_key_from_bytes.cc
source/RSA_public_key_from_bytes.cc
source/RSA_sign_pss_mgf1.cc
Expand Down
1 change: 1 addition & 0 deletions bssl-compat/patch/include/openssl/rsa.h.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ uncomment.sh "$1" --comment -h \
--uncomment-func-decl RSA_add_pkcs1_prefix \
--uncomment-func-decl RSA_public_key_from_bytes \
--uncomment-func-decl RSA_private_key_from_bytes \
--uncomment-func-decl RSA_padding_add_PKCS1_PSS_mgf1 \
--uncomment-macro-redef 'RSA_R_[a-zA-Z0-9_]*' \
--uncomment-macro-redef 'RSA_[a-zA-Z0-9_]*_PADDING' \
--uncomment-macro-redef RSA_F4 \
Expand Down
13 changes: 13 additions & 0 deletions bssl-compat/source/RSA_padding_add_PKCS1_PSS_mgf1.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <openssl/rsa.h>
#include <ossl.h>


/**
* This implementats some mappings only where necessary to support Envoy
*/
extern "C" int RSA_padding_add_PKCS1_PSS_mgf1(const RSA *rsa, unsigned char *EM,
const unsigned char *mHash,
const EVP_MD *Hash, const EVP_MD *mgf1Hash,
int sLenRequested) {
return ossl.ossl_RSA_padding_add_PKCS1_PSS_mgf1((ossl_RSA *)rsa, EM, mHash, Hash, mgf1Hash, sLenRequested);
}

0 comments on commit cfdeb56

Please sign in to comment.