You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2015/01/29 04:11:28 UTC

svn commit: r1655515 - in /santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL: OpenSSLCryptoKeyDSA.cpp OpenSSLCryptoKeyEC.cpp

Author: scantor
Date: Thu Jan 29 03:11:28 2015
New Revision: 1655515

URL: http://svn.apache.org/r1655515
Log:
https://issues.apache.org/jira/browse/SANTUARIO-384

Modified:
    santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp
    santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.cpp

Modified: santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp?rev=1655515&r1=1655514&r2=1655515&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyDSA.cpp Thu Jan 29 03:11:28 2015
@@ -277,7 +277,7 @@ unsigned int OpenSSLCryptoKeyDSA::signBa
 
 	// Now turn the signature into a base64 string
 
-	unsigned char* rawSigBuf = new unsigned char[(BN_num_bits(dsa_sig->r) + BN_num_bits(dsa_sig->s)) / 8];
+	unsigned char* rawSigBuf = new unsigned char[(BN_num_bits(dsa_sig->r) + BN_num_bits(dsa_sig->s) + 7) / 8];
     ArrayJanitor<unsigned char> j_sigbuf(rawSigBuf);
 	
     unsigned int rawLen = BN_bn2bin(dsa_sig->r, rawSigBuf);

Modified: santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.cpp?rev=1655515&r1=1655514&r2=1655515&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/enc/OpenSSL/OpenSSLCryptoKeyEC.cpp Thu Jan 29 03:11:28 2015
@@ -238,7 +238,7 @@ unsigned int OpenSSLCryptoKeyEC::signBas
 	}
 
 	// Now turn the signature into a base64 string
-	unsigned char* rawSigBuf = new unsigned char[(BN_num_bits(dsa_sig->r) + BN_num_bits(dsa_sig->s)) / 8];
+	unsigned char* rawSigBuf = new unsigned char[(BN_num_bits(dsa_sig->r) + BN_num_bits(dsa_sig->s) + 7) / 8];
     ArrayJanitor<unsigned char> j_sigbuf(rawSigBuf);
 
 	unsigned int rawLen = BN_bn2bin(dsa_sig->r, rawSigBuf);