diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/rsa_private_key_win.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/crypto/rsa_private_key_win.cc b/crypto/rsa_private_key_win.cc index d87c1ec0..546a303 100644 --- a/crypto/rsa_private_key_win.cc +++ b/crypto/rsa_private_key_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,15 +12,6 @@ #pragma comment(lib, "crypt32.lib") -namespace { - // Helper for error handling during key import. -#define READ_ASSERT(truth) \ - if (!(truth)) { \ - NOTREACHED(); \ - return false; \ - } -} // namespace - namespace crypto { // static @@ -102,7 +93,10 @@ RSAPrivateKey* RSAPrivateKey::CreateFromPrivateKeyInfo( pki.private_exponent()->size()); dest += pki.private_exponent()->size(); - READ_ASSERT(dest == blob.get() + blob_size); + if (dest != blob.get() + blob_size) { + NOTREACHED(); + return NULL; + } if (!CryptImportKey(result->provider_, reinterpret_cast<uint8*>(public_key_struc), blob_size, 0, CRYPT_EXPORTABLE, result->key_.receive())) |