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-Commit-Position: refs/heads/master@{#11892}
This commit is contained in:
hbos 2016-03-07 15:14:40 -08:00 committed by Commit bot
parent 709472d92d
commit 5291393510
4 changed files with 14 additions and 13 deletions

View File

@ -122,13 +122,13 @@ DtlsIdentityStoreImpl::~DtlsIdentityStoreImpl() {
}
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);
}

View File

@ -70,8 +70,8 @@ class DtlsIdentityStoreInterface {
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 @@ class DtlsIdentityStoreImpl : public DtlsIdentityStoreInterface,
// 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;

View File

@ -46,11 +46,11 @@ class DtlsIdentityStoreWrapper : public DtlsIdentityStoreInterface {
}
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:

View File

@ -96,14 +96,15 @@ class FakeDtlsIdentityStore : public webrtc::DtlsIdentityStoreInterface,
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));