| 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/cert/x509_util_openssl.h" | 5 #include "net/cert/x509_util_openssl.h" |
| 6 | 6 |
| 7 #include <limits.h> | 7 #include <limits.h> |
| 8 #include <openssl/asn1.h> | 8 #include <openssl/asn1.h> |
| 9 #include <openssl/mem.h> | 9 #include <openssl/mem.h> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 using ScopedASN1_INTEGER = | 30 using ScopedASN1_INTEGER = |
| 31 crypto::ScopedOpenSSL<ASN1_INTEGER, ASN1_INTEGER_free>; | 31 crypto::ScopedOpenSSL<ASN1_INTEGER, ASN1_INTEGER_free>; |
| 32 using ScopedASN1_OCTET_STRING = | 32 using ScopedASN1_OCTET_STRING = |
| 33 crypto::ScopedOpenSSL<ASN1_OCTET_STRING, ASN1_OCTET_STRING_free>; | 33 crypto::ScopedOpenSSL<ASN1_OCTET_STRING, ASN1_OCTET_STRING_free>; |
| 34 using ScopedASN1_STRING = crypto::ScopedOpenSSL<ASN1_STRING, ASN1_STRING_free>; | 34 using ScopedASN1_STRING = crypto::ScopedOpenSSL<ASN1_STRING, ASN1_STRING_free>; |
| 35 using ScopedASN1_TIME = crypto::ScopedOpenSSL<ASN1_TIME, ASN1_TIME_free>; | 35 using ScopedASN1_TIME = crypto::ScopedOpenSSL<ASN1_TIME, ASN1_TIME_free>; |
| 36 using ScopedX509_EXTENSION = | 36 using ScopedX509_EXTENSION = |
| 37 crypto::ScopedOpenSSL<X509_EXTENSION, X509_EXTENSION_free>; | 37 crypto::ScopedOpenSSL<X509_EXTENSION, X509_EXTENSION_free>; |
| 38 using ScopedX509_NAME = crypto::ScopedOpenSSL<X509_NAME, X509_NAME_free>; | |
| 39 | 38 |
| 40 const EVP_MD* ToEVP(x509_util::DigestAlgorithm alg) { | 39 const EVP_MD* ToEVP(x509_util::DigestAlgorithm alg) { |
| 41 switch (alg) { | 40 switch (alg) { |
| 42 case x509_util::DIGEST_SHA1: | 41 case x509_util::DIGEST_SHA1: |
| 43 return EVP_sha1(); | 42 return EVP_sha1(); |
| 44 case x509_util::DIGEST_SHA256: | 43 case x509_util::DIGEST_SHA256: |
| 45 return EVP_sha256(); | 44 return EVP_sha256(); |
| 46 } | 45 } |
| 47 return NULL; | 46 return NULL; |
| 48 } | 47 } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 internal_cache = new_cache.get(); | 299 internal_cache = new_cache.get(); |
| 301 X509_set_ex_data(x509, x509_der_cache_index, new_cache.release()); | 300 X509_set_ex_data(x509, x509_der_cache_index, new_cache.release()); |
| 302 } | 301 } |
| 303 *der_cache = base::StringPiece(internal_cache->data); | 302 *der_cache = base::StringPiece(internal_cache->data); |
| 304 return true; | 303 return true; |
| 305 } | 304 } |
| 306 | 305 |
| 307 } // namespace x509_util | 306 } // namespace x509_util |
| 308 | 307 |
| 309 } // namespace net | 308 } // namespace net |
| OLD | NEW |