You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "stack (JIRA)" <ji...@apache.org> on 2014/04/16 08:48:18 UTC
[jira] [Created] (SANTUARIO-384)
OpenSSLCryptoKeyEC::signBase64SignatureDSA fails most of time
stack created SANTUARIO-384:
-------------------------------
Summary: OpenSSLCryptoKeyEC::signBase64SignatureDSA fails most of time
Key: SANTUARIO-384
URL: https://issues.apache.org/jira/browse/SANTUARIO-384
Project: Santuario
Issue Type: Bug
Components: C++
Affects Versions: C++ 1.7.2
Reporter: stack
Assignee: Scott Cantor
I debugged into it. Find when this function(OpenSSLCryptoKeyEC::signBase64SignatureDSA) done, it will free the allocated memory. Then it fails, stop there and do nothing.
I also find this code at 241 line of OpenSSLCryptoKeyEC.cpp file.
unsigned char* rawSigBuf = new unsigned char[(BN_num_bits(dsa_sig->r) + BN_num_bits(dsa_sig->s)) / 8];
And as the information printed out, the alloc size is smaller than the real use size.
So I change it to "ceil" the integer by unsigned char* rawSigBuf = new unsigned char[(BN_num_bits(dsa_sig->r) + BN_num_bits(dsa_sig->s) + 7) / 8];
Then it works fine. If it is really a bug, please fix it.
--
This message was sent by Atlassian JIRA
(v6.2#6252)