| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <Security/SecAsn1Coder.h> | 7 #include <Security/SecAsn1Coder.h> |
| 8 #include <Security/SecAsn1Templates.h> | 8 #include <Security/SecAsn1Templates.h> |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| 11 #include "base/base64.h" | 11 #include "base/base64.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/mac/mac_logging.h" | 13 #include "base/mac/mac_logging.h" |
| 14 #include "base/mac/scoped_cftyperef.h" | 14 #include "base/mac/scoped_cftyperef.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/sys_string_conversions.h" | 16 #include "base/strings/sys_string_conversions.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "crypto/cssm_init.h" | 18 #include "crypto/cssm_init.h" |
| 19 #include "crypto/mac_security_services_lock.h" | 19 #include "crypto/mac_security_services_lock.h" |
| 20 | 20 |
| 21 // CSSM functions are deprecated as of OSX 10.7, but have no replacement. |
| 22 // https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 |
| 23 #pragma clang diagnostic push |
| 24 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 25 |
| 21 // These are in Security.framework but not declared in a public header. | 26 // These are in Security.framework but not declared in a public header. |
| 22 extern const SecAsn1Template kSecAsn1AlgorithmIDTemplate[]; | 27 extern const SecAsn1Template kSecAsn1AlgorithmIDTemplate[]; |
| 23 extern const SecAsn1Template kSecAsn1SubjectPublicKeyInfoTemplate[]; | 28 extern const SecAsn1Template kSecAsn1SubjectPublicKeyInfoTemplate[]; |
| 24 | 29 |
| 25 namespace net { | 30 namespace net { |
| 26 | 31 |
| 27 // Declarations of Netscape keygen cert structures for ASN.1 encoding: | 32 // Declarations of Netscape keygen cert structures for ASN.1 encoding: |
| 28 | 33 |
| 29 struct PublicKeyAndChallenge { | 34 struct PublicKeyAndChallenge { |
| 30 CSSM_X509_SUBJECT_PUBLIC_KEY_INFO spki; | 35 CSSM_X509_SUBJECT_PUBLIC_KEY_INFO spki; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return err; | 321 return err; |
| 317 } | 322 } |
| 318 err = CSSM_SignData(cc_handle, &data, 1, CSSM_ALGID_NONE, signature); | 323 err = CSSM_SignData(cc_handle, &data, 1, CSSM_ALGID_NONE, signature); |
| 319 if (err) | 324 if (err) |
| 320 crypto::LogCSSMError("CSSM_SignData", err); | 325 crypto::LogCSSMError("CSSM_SignData", err); |
| 321 CSSM_DeleteContext(cc_handle); | 326 CSSM_DeleteContext(cc_handle); |
| 322 return err; | 327 return err; |
| 323 } | 328 } |
| 324 | 329 |
| 325 } // namespace net | 330 } // namespace net |
| 331 |
| 332 #pragma clang diagnostic pop // "-Wdeprecated-declarations" |
| OLD | NEW |