Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: net/ssl/openssl_platform_key_win.cc

Issue 776643003: Switch Windows over to BoringSSL from NSS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/BUILD.gn ('k') | third_party/boringssl/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ssl/openssl_platform_key.h" 5 #include "net/ssl/openssl_platform_key.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <NCrypt.h> 8 #include <NCrypt.h>
9 9
10 #include <string.h> 10 #include <string.h>
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 } 499 }
500 sig->r = BN_bin2bn(&raw_sig[0], degree, nullptr); 500 sig->r = BN_bin2bn(&raw_sig[0], degree, nullptr);
501 sig->s = BN_bin2bn(&raw_sig[degree], degree, nullptr); 501 sig->s = BN_bin2bn(&raw_sig[degree], degree, nullptr);
502 if (!sig->r || !sig->s) { 502 if (!sig->r || !sig->s) {
503 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED); 503 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED);
504 return 0; 504 return 0;
505 } 505 }
506 506
507 // Ensure the DER-encoded signature fits in the bounds. 507 // Ensure the DER-encoded signature fits in the bounds.
508 int len = i2d_ECDSA_SIG(sig.get(), nullptr); 508 int len = i2d_ECDSA_SIG(sig.get(), nullptr);
509 if (len < 0 || len > ECDSA_size(ec_key)) { 509 if (len < 0 || static_cast<size_t>(len) > ECDSA_size(ec_key)) {
510 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED); 510 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED);
511 return 0; 511 return 0;
512 } 512 }
513 513
514 len = i2d_ECDSA_SIG(sig.get(), &out_sig); 514 len = i2d_ECDSA_SIG(sig.get(), &out_sig);
515 if (len < 0) { 515 if (len < 0) {
516 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED); 516 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED);
517 return 0; 517 return 0;
518 } 518 }
519 *out_sig_len = len; 519 *out_sig_len = len;
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 case EVP_PKEY_RSA: 701 case EVP_PKEY_RSA:
702 return CreateRSAWrapper(key.Pass(), key_length); 702 return CreateRSAWrapper(key.Pass(), key_length);
703 case EVP_PKEY_EC: 703 case EVP_PKEY_EC:
704 return CreateECDSAWrapper(key.Pass(), key_length); 704 return CreateECDSAWrapper(key.Pass(), key_length);
705 default: 705 default:
706 return nullptr; 706 return nullptr;
707 } 707 }
708 } 708 }
709 709
710 } // namespace net 710 } // namespace net
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | third_party/boringssl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698