From: Vitaly Chikunov Date: Sun, 15 Jul 2018 18:17:44 +0000 (+0300) Subject: Make it compile with shimmed openssl-1.0.2 X-Git-Tag: v3.0.0~414 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=01d26132d156ba9fff7a8142d5a6899d7b2e6286;p=openssl-gost%2Fengine.git Make it compile with shimmed openssl-1.0.2 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 295ca76..5741610 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(gost-engine LANGUAGES C) include(GNUInstallDirs) -find_package(OpenSSL 1.1 REQUIRED) +find_package(OpenSSL 1.0.2 REQUIRED) include_directories(${OPENSSL_INCLUDE_DIR}) if (CMAKE_C_COMPILER_ID MATCHES "Clang") @@ -136,4 +136,4 @@ install(FILES gostsum.1 gost12sum.1 DESTINATION ${OPENSSL_MAN_INSTALL_DIR}) if (MSVC) install(FILES $ DESTINATION ${OPENSSL_ENGINES_INSTALL_DIR} OPTIONAL) install(FILES $ $ DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL) -endif() \ No newline at end of file +endif() diff --git a/gost_ameth.c b/gost_ameth.c index d53b89e..58f4df4 100644 --- a/gost_ameth.c +++ b/gost_ameth.c @@ -131,9 +131,9 @@ static int gost_decode_nid_params(EVP_PKEY *pkey, int pkey_nid, int param_nid) * Parses GOST algorithm parameters from X509_ALGOR and modifies pkey setting * NID and parameters */ -static int decode_gost_algor_params(EVP_PKEY *pkey, const X509_ALGOR *palg) +static int decode_gost_algor_params(EVP_PKEY *pkey, X509_ALGOR *palg) { - const ASN1_OBJECT *palg_obj = NULL; + ASN1_OBJECT *palg_obj = NULL; int ptype = V_ASN1_UNDEF; int pkey_nid = NID_undef, param_nid = NID_undef; ASN1_STRING *pval = NULL; @@ -142,7 +142,7 @@ static int decode_gost_algor_params(EVP_PKEY *pkey, const X509_ALGOR *palg) if (!pkey || !palg) return 0; - X509_ALGOR_get0(&palg_obj, &ptype, (const void **)&pval, palg); + X509_ALGOR_get0(&palg_obj, &ptype, (void **)&pval, palg); if (ptype != V_ASN1_SEQUENCE) { GOSTerr(GOST_F_DECODE_GOST_ALGOR_PARAMS, GOST_R_BAD_KEY_PARAMETERS_FORMAT); @@ -331,14 +331,14 @@ static BIGNUM *unmask_priv_key(EVP_PKEY *pk, return pknum_masked; } -static int priv_decode_gost(EVP_PKEY *pk, const PKCS8_PRIV_KEY_INFO *p8inf) +static int priv_decode_gost(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf) { const unsigned char *pkey_buf = NULL, *p = NULL; int priv_len = 0; BIGNUM *pk_num = NULL; int ret = 0; - const X509_ALGOR *palg = NULL; - const ASN1_OBJECT *palg_obj = NULL; + X509_ALGOR *palg = NULL; + ASN1_OBJECT *palg_obj = NULL; ASN1_INTEGER *priv_key = NULL; int expected_key_len = 32;