From bedc26167ab5402cf9e4a51afeeeb90ababb9da0 Mon Sep 17 00:00:00 2001 From: erikchen Date: Tue, 1 Mar 2016 18:52:08 -0800 Subject: Suppress the clang warning "-Wdeprecated-declarations" for CSSM API calls. The CSSM API has been deprecated since OSX 10.7, but there is no replacement. BUG=590914 Review URL: https://codereview.chromium.org/1753553002 Cr-Commit-Position: refs/heads/master@{#378668} --- crypto/cssm_init.cc | 7 +++++++ crypto/cssm_init.h | 7 +++++++ net/base/keygen_handler_mac.cc | 7 +++++++ net/cert/cert_verify_proc_mac.cc | 7 +++++++ net/cert/x509_cert_types_mac.cc | 7 +++++++ net/cert/x509_certificate_mac.cc | 7 +++++++ net/cert/x509_util_mac.cc | 7 +++++++ net/cert/x509_util_mac.h | 7 +++++++ net/ssl/client_cert_store_mac.cc | 7 +++++++ net/ssl/ssl_platform_key_mac.cc | 7 +++++++ third_party/apple_apsl/README.chromium | 2 ++ third_party/apple_apsl/cssmapplePriv.h | 29 ++++++++++++++++++----------- 12 files changed, 90 insertions(+), 11 deletions(-) diff --git a/crypto/cssm_init.cc b/crypto/cssm_init.cc index 6fa585a..e9bef7c 100644 --- a/crypto/cssm_init.cc +++ b/crypto/cssm_init.cc @@ -19,6 +19,11 @@ // - Apple Cryptographic Service Provider Functional Specification // - CryptoSample: http://developer.apple.com/SampleCode/CryptoSample/ +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace { void* CSSMMalloc(CSSM_SIZE size, void* alloc_ref) { @@ -203,3 +208,5 @@ ScopedCSSMData::~ScopedCSSMData() { } } // namespace crypto + +#pragma clang diagnostic pop // "-Wdeprecated-declarations" diff --git a/crypto/cssm_init.h b/crypto/cssm_init.h index 3eece1b..a4da34a 100644 --- a/crypto/cssm_init.h +++ b/crypto/cssm_init.h @@ -12,6 +12,11 @@ namespace crypto { +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // Initialize CSSM if it isn't already initialized. This must be called before // any other CSSM functions. This function is thread-safe, and CSSM will only // ever be initialized once. CSSM will be properly shut down on program exit. @@ -55,6 +60,8 @@ class ScopedCSSMData { DISALLOW_COPY_AND_ASSIGN(ScopedCSSMData); }; +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + } // namespace crypto #endif // CRYPTO_CSSM_INIT_H_ diff --git a/net/base/keygen_handler_mac.cc b/net/base/keygen_handler_mac.cc index 63ea847..6737363 100644 --- a/net/base/keygen_handler_mac.cc +++ b/net/base/keygen_handler_mac.cc @@ -18,6 +18,11 @@ #include "crypto/cssm_init.h" #include "crypto/mac_security_services_lock.h" +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // These are in Security.framework but not declared in a public header. extern const SecAsn1Template kSecAsn1AlgorithmIDTemplate[]; extern const SecAsn1Template kSecAsn1SubjectPublicKeyInfoTemplate[]; @@ -323,3 +328,5 @@ static OSStatus SignData(CSSM_DATA data, } } // namespace net + +#pragma clang diagnostic pop // "-Wdeprecated-declarations" diff --git a/net/cert/cert_verify_proc_mac.cc b/net/cert/cert_verify_proc_mac.cc index c4e0c41..07a49a2 100644 --- a/net/cert/cert_verify_proc_mac.cc +++ b/net/cert/cert_verify_proc_mac.cc @@ -32,6 +32,11 @@ #include "net/cert/x509_certificate.h" #include "net/cert/x509_util_mac.h" +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // From 10.7.2 libsecurity_keychain-55035/lib/SecTrustPriv.h, for use with // SecTrustCopyExtendedResult. #ifndef kSecEVOrganizationName @@ -835,3 +840,5 @@ int CertVerifyProcMac::VerifyInternal( } } // namespace net + +#pragma clang diagnostic pop // "-Wdeprecated-declarations" diff --git a/net/cert/x509_cert_types_mac.cc b/net/cert/x509_cert_types_mac.cc index c8ed4fe..4a7a968 100644 --- a/net/cert/x509_cert_types_mac.cc +++ b/net/cert/x509_cert_types_mac.cc @@ -19,6 +19,11 @@ namespace net { namespace { +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // The BER encoding of 0.9.2342.19200300.100.1.25. // On 10.6 and later this is available as CSSMOID_DomainComponent, which is an // external symbol from Security.framework. However, it appears that Apple's @@ -289,4 +294,6 @@ bool CertPrincipal::Matches(const CertPrincipal& against) const { match(domain_components, against.domain_components); } +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + } // namespace net diff --git a/net/cert/x509_certificate_mac.cc b/net/cert/x509_certificate_mac.cc index e27576a..83f8993 100644 --- a/net/cert/x509_certificate_mac.cc +++ b/net/cert/x509_certificate_mac.cc @@ -29,6 +29,11 @@ using base::Time; namespace net { +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace { void GetCertDistinguishedName( @@ -573,4 +578,6 @@ bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) { return true; } +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + } // namespace net diff --git a/net/cert/x509_util_mac.cc b/net/cert/x509_util_mac.cc index 3959b80..7971a73 100644 --- a/net/cert/x509_util_mac.cc +++ b/net/cert/x509_util_mac.cc @@ -9,6 +9,11 @@ namespace net { +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace x509_util { namespace { @@ -228,4 +233,6 @@ OSStatus CSSMCachedCertificate::GetField(const CSSM_OID* field_oid, } // namespace x509_util +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + } // namespace net diff --git a/net/cert/x509_util_mac.h b/net/cert/x509_util_mac.h index a35266b..08c1589 100644 --- a/net/cert/x509_util_mac.h +++ b/net/cert/x509_util_mac.h @@ -57,6 +57,11 @@ OSStatus NET_EXPORT CreateRevocationPolicies(bool enable_revocation_checking, bool enable_ev_checking, CFMutableArrayRef policies); +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // Wrapper for a CSSM_DATA_PTR that was obtained via one of the CSSM field // accessors (such as CSSM_CL_CertGet[First/Next]Value or // CSSM_CL_CertGet[First/Next]CachedValue). @@ -132,6 +137,8 @@ class CSSMCachedCertificate { CSSM_HANDLE cached_cert_handle_; }; +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + } // namespace x509_util } // namespace net diff --git a/net/ssl/client_cert_store_mac.cc b/net/ssl/client_cert_store_mac.cc index 06d7d06..ec662b5 100644 --- a/net/ssl/client_cert_store_mac.cc +++ b/net/ssl/client_cert_store_mac.cc @@ -28,6 +28,11 @@ using base::ScopedCFTypeRef; namespace net { +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace { // Gets the issuer for a given cert, starting with the cert itself and @@ -274,4 +279,6 @@ bool ClientCertStoreMac::SelectClientCertsGivenPreferredForTesting( return true; } +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + } // namespace net diff --git a/net/ssl/ssl_platform_key_mac.cc b/net/ssl/ssl_platform_key_mac.cc index ec7cb42..050189b 100644 --- a/net/ssl/ssl_platform_key_mac.cc +++ b/net/ssl/ssl_platform_key_mac.cc @@ -34,6 +34,11 @@ namespace net { +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + namespace { class ScopedCSSM_CC_HANDLE { @@ -241,4 +246,6 @@ scoped_refptr FetchClientCertPrivateKey( GetSSLPlatformKeyTaskRunner())); } +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + } // namespace net diff --git a/third_party/apple_apsl/README.chromium b/third_party/apple_apsl/README.chromium index ad33723..e4b86f3 100644 --- a/third_party/apple_apsl/README.chromium +++ b/third_party/apple_apsl/README.chromium @@ -49,6 +49,8 @@ and http://lists.apple.com/archives/apple-cdsa/2008/Aug/msg00008.html Modifications: - Removed unneeded definitions for internal Apple CSP DL enums and structs +- Added a suppression for the warning "-Wdeprecated-declarations" since CSSM + APIs are deprecated since OSX 10.7. dnsinfo.h from: http://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h diff --git a/third_party/apple_apsl/cssmapplePriv.h b/third_party/apple_apsl/cssmapplePriv.h index 18092bd..29d0c4d 100644 --- a/third_party/apple_apsl/cssmapplePriv.h +++ b/third_party/apple_apsl/cssmapplePriv.h @@ -1,15 +1,15 @@ /* * Copyright (c) 2000-2004 Apple Computer, Inc. All Rights Reserved. - * + * * @APPLE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -17,26 +17,31 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_LICENSE_HEADER_END@ * * cssmapplePriv.h -- Private CSSM features specific to Apple's Implementation */ - + #ifndef _CSSMAPPLE_PRIV_H_ #define _CSSMAPPLE_PRIV_H_ 1 #include #include +// CSSM functions are deprecated as of OSX 10.7, but have no replacement. +// https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + #ifdef __cplusplus extern "C" { #endif - -/* - * Options for X509TP's CSSM_TP_CertGroupVerify for policy - * CSSMOID_APPLE_TP_REVOCATION_OCSP. A pointer to, and length of, one - * of these is optionally placed in + +/* + * Options for X509TP's CSSM_TP_CertGroupVerify for policy + * CSSMOID_APPLE_TP_REVOCATION_OCSP. A pointer to, and length of, one + * of these is optionally placed in * CSSM_TP_VERIFY_CONTEXT.Cred->Policy.PolicyIds[n].FieldValue. */ @@ -64,7 +69,7 @@ enum { }; typedef struct { - uint32 Version; + uint32 Version; CSSM_APPLE_TP_OCSP_OPT_FLAGS Flags; CSSM_DATA_PTR LocalResponder; /* URI */ CSSM_DATA_PTR LocalResponderCert; /* X509 DER encoded cert */ @@ -74,4 +79,6 @@ typedef struct { } #endif +#pragma clang diagnostic pop // "-Wdeprecated-declarations" + #endif /* _CSSMAPPLE_PRIV_H_ */ -- cgit v1.1