Index: third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp |
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp |
index 063d4345a168cf49a4d1669964eb0608736d8964..2c3230397ffc628b3bf18e55debc5760ac1e6d1d 100644 |
--- a/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp |
+++ b/third_party/WebKit/Source/modules/mediastream/RTCPeerConnection.cpp |
@@ -36,6 +36,7 @@ |
#include "bindings/core/v8/Nullable.h" |
#include "bindings/core/v8/ScriptPromiseResolver.h" |
#include "bindings/modules/v8/V8RTCCertificate.h" |
+#include "core/dom/DOMTimeStamp.h" |
#include "core/dom/Document.h" |
#include "core/dom/ExceptionCode.h" |
#include "core/dom/ExecutionContext.h" |
@@ -76,6 +77,7 @@ |
#include "public/platform/WebRTCSessionDescriptionRequest.h" |
#include "public/platform/WebRTCStatsRequest.h" |
#include "public/platform/WebRTCVoidRequest.h" |
+#include "wtf/CurrentTime.h" |
namespace blink { |
@@ -330,6 +332,18 @@ RTCPeerConnection* RTCPeerConnection::create(ExecutionContext* context, const Di |
if (exceptionState.hadException()) |
return 0; |
+ // Make sure no certificates have expired. |
+ if (configuration->numberOfCertificates() > 0) { |
+ DOMTimeStamp now = convertSecondsToDOMTimeStamp(currentTime()); |
hta - Chromium
2016/01/29 07:15:14
My usual caveat on depending on currentTime for st
hbos_chromium
2016/04/20 11:08:58
The ability to generate expired certificates lande
|
+ for (size_t i = 0; i < configuration->numberOfCertificates(); ++i) { |
+ DOMTimeStamp expires = configuration->certificate(i)->expires(); |
+ if (expires <= now) { |
+ exceptionState.throwDOMException(InvalidStateError, "Expired certificate(s)."); |
+ return 0; |
+ } |
+ } |
+ } |
+ |
MediaErrorState mediaErrorState; |
WebMediaConstraints constraints = MediaConstraintsImpl::create(mediaConstraints, mediaErrorState); |
if (mediaErrorState.hadException()) { |