Re: [openssl-users] OpenSSL occasionally generates wrong signature

2018-10-16 Thread Dmitry
Looks like there is some problem in higher-level EVP_ functions. I completely rewrote the example using lower-level ECDSA_do_sign and it started to work always. Here is the code: EVP_MD_CTX *Ctx = EVP_MD_CTX_create(); EVP_DigestInit(Ctx, EVP_sha256()); EVP_DigestUpdate(Ctx, dt.data(),

Re: [openssl-users] OpenSSL occasionally generates wrong signature

2018-10-16 Thread Dmitry
Thank you for the hint, but it looks like the problem is somewhere else I rewrote the piece of code in such a way: char *Result = new char [SignatureLength]; EVP_DigestSignFinal(Ctx, reinterpret_cast(Result), ); TFile SignatureBin = {"/home/gc/signature.bin", ...};

Re: [openssl-users] OpenSSL occasionally generates wrong signature

2018-10-16 Thread Jakob Bohm via openssl-users
On 16/10/2018 16:39, Dmitry wrote: Hello! I have a C++ programme, ECDSA key pair and some string to sign. The programme generates signature and saves it into a file (signature.bin). Then I check the validity of the signature via the following command: openssl dgst -verify ec_public.pem

[openssl-users] OpenSSL occasionally generates wrong signature

2018-10-16 Thread Dmitry
Hello! I have a C++ programme, ECDSA key pair and some string to sign. The programme generates signature and saves it into a file (signature.bin). Then I check the validity of the signature via the following command: openssl dgst -verify ec_public.pem -signature signature.bin ToSign.txt the