Skip to content

Commit

Permalink
correct key encoding for openssl 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Apr 30, 2018
1 parent 0c9123c commit 01e853f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/Gost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <array>
#include <openssl/sha.h>
#include <openssl/evp.h>
#include "Crypto.h"
#include "Gost.h"

namespace i2p
Expand All @@ -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);
}
Expand Down

0 comments on commit 01e853f

Please sign in to comment.