JNI+mm: Generate certificate if non-default key type is specified.

By comparing key type with KT_DEFAULT we remove the implicit assumption that
the default is RSA.

Removing the assumptions about what the default is is necessary for a
follow-up CL that will change the default.

BUG=webrtc:5795, webrtc:5707
R=hta@webrtc.org, magjed@webrtc.org, tommi@webrtc.org
TBR=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1965313002 .

Cr-Commit-Position: refs/heads/master@{#12722}
This commit is contained in:
Henrik Boström
2016-05-13 13:50:38 +02:00
parent d0dc66e0ea
commit e06c2ddbde
6 changed files with 69 additions and 53 deletions

View File

@ -197,14 +197,16 @@ void PeerConnectionDelegateAdapter::OnIceCandidate(
constraints:(RTCMediaConstraints *)constraints
delegate:(id<RTCPeerConnectionDelegate>)delegate {
NSParameterAssert(factory);
std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config(
configuration.nativeConfiguration);
if (!config)
return nullptr;
if (self = [super init]) {
_observer.reset(new webrtc::PeerConnectionDelegateAdapter(self));
webrtc::PeerConnectionInterface::RTCConfiguration config =
configuration.nativeConfiguration;
std::unique_ptr<webrtc::MediaConstraints> nativeConstraints =
constraints.nativeConstraints;
_peerConnection =
factory.nativeFactory->CreatePeerConnection(config,
factory.nativeFactory->CreatePeerConnection(*config,
nativeConstraints.get(),
nullptr,
nullptr,
@ -251,7 +253,11 @@ void PeerConnectionDelegateAdapter::OnIceCandidate(
}
- (BOOL)setConfiguration:(RTCConfiguration *)configuration {
return _peerConnection->SetConfiguration(configuration.nativeConfiguration);
std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> config(
configuration.nativeConfiguration);
if (!config)
return false;
return _peerConnection->SetConfiguration(*config);
}
- (void)close {