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

Unified Diff: webrtc/rtc_base/opensslidentity.h

Issue 3010363002: Implement GetChain for OpenSSLCertificate.
Patch Set: Adding limit to chain size. Remove debug logging. Created 3 years, 3 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 | « no previous file | webrtc/rtc_base/opensslidentity.cc » ('j') | webrtc/rtc_base/opensslidentity.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_base/opensslidentity.h
diff --git a/webrtc/rtc_base/opensslidentity.h b/webrtc/rtc_base/opensslidentity.h
index ed7c07299a40fef713c6bff8e0bb0fed1e082a4c..1154edb28282eb898d037de8379dc85e3f3d3f6c 100644
--- a/webrtc/rtc_base/opensslidentity.h
+++ b/webrtc/rtc_base/opensslidentity.h
@@ -16,6 +16,7 @@
#include <memory>
#include <string>
+#include <vector>
#include "webrtc/rtc_base/checks.h"
#include "webrtc/rtc_base/constructormagic.h"
@@ -62,9 +63,10 @@ class OpenSSLKeyPair {
class OpenSSLCertificate : public SSLCertificate {
public:
// Caller retains ownership of the X509 object.
- explicit OpenSSLCertificate(X509* x509) : x509_(x509) {
- AddReference();
- }
+ explicit OpenSSLCertificate(X509* x509);
+
+ // Caller retains owership of STACK_OF(X509).
+ explicit OpenSSLCertificate(STACK_OF(X509)* chain);
static OpenSSLCertificate* Generate(OpenSSLKeyPair* key_pair,
const SSLIdentityParams& params);
@@ -100,9 +102,11 @@ class OpenSSLCertificate : public SSLCertificate {
int64_t CertificateExpirationTime() const override;
private:
- void AddReference() const;
+ void AddReference(X509* x509) const;
X509* x509_;
+ // Non-leaf certificate chain.
+ std::vector<OpenSSLCertificate*> cert_chain_;
davidben_webrtc 2017/09/26 23:21:46 You don't seem to free this in the destructor. Thi
RTC_DISALLOW_COPY_AND_ASSIGN(OpenSSLCertificate);
};
« no previous file with comments | « no previous file | webrtc/rtc_base/opensslidentity.cc » ('j') | webrtc/rtc_base/opensslidentity.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698