From 01e853f233a605fdc490be4c7fb8b4014238f278 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 30 Apr 2018 18:48:16 -0400 Subject: [PATCH] correct key encoding for openssl 1.1 --- src/Crypto.h | 3 +++ src/Gost.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Crypto.h b/src/Crypto.h index 4ecbfe1..59540f0 100644 --- a/src/Crypto.h +++ b/src/Crypto.h @@ -27,6 +27,9 @@ inline int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) // ssl #define TLS_method TLSv1_method +// ASN1 +#define OPENSSL_EC_EXPLICIT_CURVE 0 + #endif #endif diff --git a/src/Gost.cpp b/src/Gost.cpp index a2ccb48..c4a576c 100644 --- a/src/Gost.cpp +++ b/src/Gost.cpp @@ -10,6 +10,7 @@ #include #include #include +#include "Crypto.h" #include "Gost.h" namespace i2p @@ -28,6 +29,7 @@ namespace crypto EC_POINT_set_affine_coordinates_GFp (m_Group, P, x, y, ctx); EC_GROUP_set_generator (m_Group, P, q, nullptr); EC_GROUP_set_curve_name (m_Group, NID_id_GostR3410_2001); + EC_GROUP_set_asn1_flag (m_Group, OPENSSL_EC_EXPLICIT_CURVE); // encode parameters explicitly EC_POINT_free(P); BN_CTX_free (ctx); }