Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-384

OpenSSLCryptoKeyEC::signBase64SignatureDSA fails most of time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • C++ 1.7.2
    • C++ 1.7.3
    • C++
    • None

    Description

      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.

      Attachments

        Activity

          People

            scantor Scott Cantor
            stackcn stack
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: