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

Unified Diff: net/cert/x509_certificate_win.cc

Issue 1882433002: Removing NSS files and USE_OPENSSL flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/x509_certificate_openssl_ios.cc ('k') | net/cert/x509_util_ios.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/x509_certificate_win.cc
diff --git a/net/cert/x509_certificate_win.cc b/net/cert/x509_certificate_win.cc
index 6d1fbe8fdd6cc76f27e9cd7503dd77feb6979ebe..7d8e531b1bd839e59727984690ce248ad2eb5c70 100644
--- a/net/cert/x509_certificate_win.cc
+++ b/net/cert/x509_certificate_win.cc
@@ -6,6 +6,8 @@
#include <memory>
+#include <openssl/sha.h>
+
#include "base/logging.h"
#include "base/memory/free_deleter.h"
#include "base/numerics/safe_conversions.h"
@@ -18,13 +20,6 @@
#include "crypto/sha2.h"
#include "net/base/net_errors.h"
-// Implement CalculateChainFingerprint() with our native crypto library.
-#if defined(USE_OPENSSL)
-#include <openssl/sha.h>
-#else
-#include <blapi.h>
-#endif
-
using base::Time;
namespace net {
@@ -340,7 +335,6 @@ SHA1HashValue X509Certificate::CalculateCAFingerprint(
SHA1HashValue sha1;
memset(sha1.data, 0, sizeof(sha1.data));
-#if defined(USE_OPENSSL)
SHA_CTX ctx;
if (!SHA1_Init(&ctx))
return sha1;
@@ -350,19 +344,6 @@ SHA1HashValue X509Certificate::CalculateCAFingerprint(
return sha1;
}
SHA1_Final(sha1.data, &ctx);
-#else // !USE_OPENSSL
- SHA1Context* sha1_ctx = SHA1_NewContext();
- if (!sha1_ctx)
- return sha1;
- SHA1_Begin(sha1_ctx);
- for (size_t i = 0; i < intermediates.size(); ++i) {
- PCCERT_CONTEXT ca_cert = intermediates[i];
- SHA1_Update(sha1_ctx, ca_cert->pbCertEncoded, ca_cert->cbCertEncoded);
- }
- unsigned int result_len;
- SHA1_End(sha1_ctx, sha1.data, &result_len, SHA1_LENGTH);
- SHA1_DestroyContext(sha1_ctx, PR_TRUE);
-#endif // USE_OPENSSL
return sha1;
}
« no previous file with comments | « net/cert/x509_certificate_openssl_ios.cc ('k') | net/cert/x509_util_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698