| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/base/keygen_handler.h" | 5 #include "net/base/keygen_handler.h" |
| 6 | 6 |
| 7 // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424 | |
| 8 // until NSS 3.12.2 comes out and we update to it. | |
| 9 #define Lock FOO_NSS_Lock | |
| 10 #include <pk11pub.h> | 7 #include <pk11pub.h> |
| 11 #include <secmod.h> | 8 #include <secmod.h> |
| 12 #include <ssl.h> | 9 #include <ssl.h> |
| 13 #include <nssb64.h> // NSSBase64_EncodeItem() | 10 #include <nssb64.h> // NSSBase64_EncodeItem() |
| 14 #include <secder.h> // DER_Encode() | 11 #include <secder.h> // DER_Encode() |
| 15 #include <cryptohi.h> // SEC_DerSignData() | 12 #include <cryptohi.h> // SEC_DerSignData() |
| 16 #include <keyhi.h> // SECKEY_CreateSubjectPublicKeyInfo() | 13 #include <keyhi.h> // SECKEY_CreateSubjectPublicKeyInfo() |
| 17 #undef Lock | |
| 18 | 14 |
| 19 #include "base/nss_init.h" | 15 #include "base/nss_init.h" |
| 20 #include "base/logging.h" | 16 #include "base/logging.h" |
| 21 | 17 |
| 22 namespace net { | 18 namespace net { |
| 23 | 19 |
| 24 const int64 DEFAULT_RSA_PUBLIC_EXPONENT = 0x10001; | 20 const int64 DEFAULT_RSA_PUBLIC_EXPONENT = 0x10001; |
| 25 | 21 |
| 26 // Template for creating the signed public key structure to be sent to the CA. | 22 // Template for creating the signed public key structure to be sent to the CA. |
| 27 DERTemplate SECAlgorithmIDTemplate[] = { | 23 DERTemplate SECAlgorithmIDTemplate[] = { |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 PK11_FreeSlot(slot); | 242 PK11_FreeSlot(slot); |
| 247 } | 243 } |
| 248 if (pkac.challenge.data) { | 244 if (pkac.challenge.data) { |
| 249 free(pkac.challenge.data); | 245 free(pkac.challenge.data); |
| 250 } | 246 } |
| 251 | 247 |
| 252 return (isSuccess ? result_blob : std::string()); | 248 return (isSuccess ? result_blob : std::string()); |
| 253 } | 249 } |
| 254 | 250 |
| 255 } // namespace net | 251 } // namespace net |
| OLD | NEW |