summaryrefslogtreecommitdiff
path: root/chromium/net/ssl/ssl_info.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/ssl/ssl_info.cc')
-rw-r--r--chromium/net/ssl/ssl_info.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/chromium/net/ssl/ssl_info.cc b/chromium/net/ssl/ssl_info.cc
new file mode 100644
index 00000000000..6c3485bac3a
--- /dev/null
+++ b/chromium/net/ssl/ssl_info.cc
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/ssl/ssl_info.h"
+
+#include "net/cert/cert_status_flags.h"
+#include "net/cert/x509_certificate.h"
+
+namespace net {
+
+SSLInfo::SSLInfo() {
+ Reset();
+}
+
+SSLInfo::SSLInfo(const SSLInfo& info) {
+ *this = info;
+}
+
+SSLInfo::~SSLInfo() {
+}
+
+SSLInfo& SSLInfo::operator=(const SSLInfo& info) {
+ cert = info.cert;
+ cert_status = info.cert_status;
+ security_bits = info.security_bits;
+ connection_status = info.connection_status;
+ is_issued_by_known_root = info.is_issued_by_known_root;
+ client_cert_sent = info.client_cert_sent;
+ channel_id_sent = info.channel_id_sent;
+ handshake_type = info.handshake_type;
+ public_key_hashes = info.public_key_hashes;
+
+ return *this;
+}
+
+void SSLInfo::Reset() {
+ cert = NULL;
+ cert_status = 0;
+ security_bits = -1;
+ connection_status = 0;
+ is_issued_by_known_root = false;
+ client_cert_sent = false;
+ channel_id_sent = false;
+ handshake_type = HANDSHAKE_UNKNOWN;
+
+ public_key_hashes.clear();
+}
+
+void SSLInfo::SetCertError(int error) {
+ cert_status |= MapNetErrorToCertStatus(error);
+}
+
+} // namespace net