Browse Source

correct key encoding for openssl 1.1

pull/38/head
orignal 7 years ago
parent
commit
01e853f233
  1. 3
      src/Crypto.h
  2. 2
      src/Gost.cpp

3
src/Crypto.h

@ -27,6 +27,9 @@ inline int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
// ssl // ssl
#define TLS_method TLSv1_method #define TLS_method TLSv1_method
// ASN1
#define OPENSSL_EC_EXPLICIT_CURVE 0
#endif #endif
#endif #endif

2
src/Gost.cpp

@ -10,6 +10,7 @@
#include <array> #include <array>
#include <openssl/sha.h> #include <openssl/sha.h>
#include <openssl/evp.h> #include <openssl/evp.h>
#include "Crypto.h"
#include "Gost.h" #include "Gost.h"
namespace i2p namespace i2p
@ -28,6 +29,7 @@ namespace crypto
EC_POINT_set_affine_coordinates_GFp (m_Group, P, x, y, ctx); EC_POINT_set_affine_coordinates_GFp (m_Group, P, x, y, ctx);
EC_GROUP_set_generator (m_Group, P, q, nullptr); EC_GROUP_set_generator (m_Group, P, q, nullptr);
EC_GROUP_set_curve_name (m_Group, NID_id_GostR3410_2001); 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); EC_POINT_free(P);
BN_CTX_free (ctx); BN_CTX_free (ctx);
} }

Loading…
Cancel
Save