diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 20:21:52 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 20:21:52 +0000 |
commit | 8ae571c7ef601364f1aa786e49f0883cfb3f2af1 (patch) | |
tree | 2dd01e6ec7778654645cbc79ac01f7c53999c531 | |
parent | 60bb177f9aa89fef11e2b060548b392afaed9692 (diff) | |
download | chromium_src-8ae571c7ef601364f1aa786e49f0883cfb3f2af1.zip chromium_src-8ae571c7ef601364f1aa786e49f0883cfb3f2af1.tar.gz chromium_src-8ae571c7ef601364f1aa786e49f0883cfb3f2af1.tar.bz2 |
ssl3_PlatformSignHashes should set buf->len to the
actual signature length rather than the estimated
signature length.
R=rsleevi
BUG=37560,45369,62027
TEST=none
Review URL: http://codereview.chromium.org/4825003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65979 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/third_party/nss/ssl/sslplatf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/third_party/nss/ssl/sslplatf.c b/net/third_party/nss/ssl/sslplatf.c index 7119543..2b006bd 100644 --- a/net/third_party/nss/ssl/sslplatf.c +++ b/net/third_party/nss/ssl/sslplatf.c @@ -260,7 +260,6 @@ ssl3_PlatformSignHashes(SSL3Hashes *hash, PlatformKey key, SECItem *buf, ssl_MapLowLevelError(SSL_ERROR_SIGN_HASHES_FAILURE); goto done; } - buf->len = signatureLen; buf->data = (unsigned char *)PORT_Alloc(signatureLen); if (!buf->data) goto done; /* error code was set. */ @@ -270,6 +269,7 @@ ssl3_PlatformSignHashes(SSL3Hashes *hash, PlatformKey key, SECItem *buf, ssl_MapLowLevelError(SSL_ERROR_SIGN_HASHES_FAILURE); goto done; } + buf->len = signatureLen; /* CryptoAPI signs in little-endian, so reverse */ for (i = 0; i < buf->len / 2; ++i) { @@ -424,7 +424,6 @@ ssl3_PlatformSignHashes(SSL3Hashes *hash, PlatformKey key, SECItem *buf, goto done; } - buf->len = signatureLen; buf->data = (unsigned char *)PORT_Alloc(signatureLen); if (!buf->data) goto done; /* error code was set. */ @@ -462,7 +461,7 @@ ssl3_PlatformSignHashes(SSL3Hashes *hash, PlatformKey key, SECItem *buf, goto done; } - signatureData.Length = buf->len; + signatureData.Length = signatureLen; signatureData.Data = (uint8*)buf->data; cssmRv = CSSM_CSP_CreateSignatureContext(cspHandle, sigAlg, cssmCreds, @@ -492,6 +491,7 @@ ssl3_PlatformSignHashes(SSL3Hashes *hash, PlatformKey key, SECItem *buf, ssl_MapLowLevelError(SSL_ERROR_SIGN_HASHES_FAILURE); goto done; } + buf->len = signatureData.Length; if (doDerEncode) { SECItem derSig = {siBuffer, NULL, 0}; |