DtlsIdentityStoreInterface::RequestIdentity: const& parameters
Changing from:
virtual void RequestIdentity(
rtc::KeyParams key_params,
rtc::Optional<uint64_t> expires,
const rtc::scoped_refptr<DtlsIdentityRequestObserver>& observer);
to:
virtual void RequestIdentity(
const rtc::KeyParams& key_params,
const rtc::Optional<uint64_t>& expires_ms,
const rtc::scoped_refptr<DtlsIdentityRequestObserver>& observer);
Making FakeDtlsIdentityStore DCHECK that |expires_ms| is not set, since it does not support that parameterization.
In a follow-up chromium CL the new signature will be used.
BUG=webrtc:5092, chromium:544902
Review URL: https://codereview.webrtc.org/1766673002
Cr-Original-Commit-Position: refs/heads/master@{#11892}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 5291393510c17748701706471272c1ba0151dec2
diff --git a/api/dtlsidentitystore.cc b/api/dtlsidentitystore.cc
index 31c9bc0..a485188 100644
--- a/api/dtlsidentitystore.cc
+++ b/api/dtlsidentitystore.cc
@@ -122,13 +122,13 @@
}
void DtlsIdentityStoreImpl::RequestIdentity(
- rtc::KeyParams key_params,
- rtc::Optional<uint64_t> expires,
+ const rtc::KeyParams& key_params,
+ const rtc::Optional<uint64_t>& expires_ms,
const rtc::scoped_refptr<DtlsIdentityRequestObserver>& observer) {
RTC_DCHECK(signaling_thread_->IsCurrent());
RTC_DCHECK(observer);
- // Dropping parameterization and |expires|.
+ // Dropping parameterization and |expires_ms|.
// TODO(hbos,torbjorng): Use parameterizaton/expiration. webrtc:5092.
GenerateIdentity(key_params.type(), observer);
}
diff --git a/api/dtlsidentitystore.h b/api/dtlsidentitystore.h
index 8666b3c..af42292 100644
--- a/api/dtlsidentitystore.h
+++ b/api/dtlsidentitystore.h
@@ -70,8 +70,8 @@
RequestIdentity(key_params, rtc::Optional<uint64_t>(), observer);
}
virtual void RequestIdentity(
- rtc::KeyParams key_params,
- rtc::Optional<uint64_t> expires,
+ const rtc::KeyParams& key_params,
+ const rtc::Optional<uint64_t>& expires_ms,
const rtc::scoped_refptr<DtlsIdentityRequestObserver>& observer) {
// Drop |expires|.
RequestIdentity(key_params, observer);
@@ -91,8 +91,8 @@
// DtlsIdentityStoreInterface override;
void RequestIdentity(
- rtc::KeyParams key_params,
- rtc::Optional<uint64_t> expires,
+ const rtc::KeyParams& key_params,
+ const rtc::Optional<uint64_t>& expires_ms,
const rtc::scoped_refptr<DtlsIdentityRequestObserver>& observer) override;
// rtc::MessageHandler override;
diff --git a/api/peerconnectionfactory.cc b/api/peerconnectionfactory.cc
index 4d8125f..40e845f 100644
--- a/api/peerconnectionfactory.cc
+++ b/api/peerconnectionfactory.cc
@@ -46,11 +46,11 @@
}
void RequestIdentity(
- rtc::KeyParams key_params,
- rtc::Optional<uint64_t> expires,
+ const rtc::KeyParams& key_params,
+ const rtc::Optional<uint64_t>& expires_ms,
const rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver>&
observer) override {
- store_->RequestIdentity(key_params, expires, observer);
+ store_->RequestIdentity(key_params, expires_ms, observer);
}
private:
diff --git a/api/test/fakedtlsidentitystore.h b/api/test/fakedtlsidentitystore.h
index 7c8a4fc..8bbffbf 100644
--- a/api/test/fakedtlsidentitystore.h
+++ b/api/test/fakedtlsidentitystore.h
@@ -96,14 +96,15 @@
void use_alternate_key() { key_index_ = 1; }
void RequestIdentity(
- rtc::KeyParams key_params,
- rtc::Optional<uint64_t> expires,
+ const rtc::KeyParams& key_params,
+ const rtc::Optional<uint64_t>& expires_ms,
const rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver>&
observer) override {
// TODO(hbos): Should be able to generate KT_ECDSA too.
RTC_DCHECK((key_params.type() == rtc::KT_RSA &&
key_params.rsa_params().mod_size == 1024 &&
- key_params.rsa_params().pub_exp == 0x10001) ||
+ key_params.rsa_params().pub_exp == 0x10001 &&
+ !expires_ms) ||
should_fail_);
MessageData* msg = new MessageData(
rtc::scoped_refptr<webrtc::DtlsIdentityRequestObserver>(observer));