mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 16:22:00 +00:00
Bug 892148 - Make DTLS fingerprint accessible from JS r=abr
This commit is contained in:
parent
800f836ccb
commit
d0f3485699
@ -67,6 +67,7 @@ interface PeerConnectionImpl {
|
||||
void close();
|
||||
|
||||
/* Attributes */
|
||||
readonly attribute DOMString fingerprint;
|
||||
readonly attribute DOMString localDescription;
|
||||
readonly attribute DOMString remoteDescription;
|
||||
|
||||
|
@ -787,7 +787,7 @@ PeerConnectionImpl::Initialize(PeerConnectionObserver& aObserver,
|
||||
// DTLS identity
|
||||
unsigned char fingerprint[DTLS_FINGERPRINT_LENGTH];
|
||||
size_t fingerprint_length;
|
||||
res = mIdentity->ComputeFingerprint("sha-1",
|
||||
res = mIdentity->ComputeFingerprint("sha-256",
|
||||
fingerprint,
|
||||
sizeof(fingerprint),
|
||||
&fingerprint_length);
|
||||
@ -798,7 +798,7 @@ PeerConnectionImpl::Initialize(PeerConnectionObserver& aObserver,
|
||||
return res;
|
||||
}
|
||||
|
||||
mFingerprint = "sha-1 " + mIdentity->FormatFingerprint(fingerprint,
|
||||
mFingerprint = "sha-256 " + mIdentity->FormatFingerprint(fingerprint,
|
||||
fingerprint_length);
|
||||
if (NS_FAILED(res)) {
|
||||
CSFLogError(logTag, "%s: do_GetService failed: %u",
|
||||
@ -1340,6 +1340,7 @@ PeerConnectionImpl::SetRemoteFingerprint(const char* hash, const char* fingerpri
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::GetFingerprint(char** fingerprint)
|
||||
@ -1357,7 +1358,6 @@ PeerConnectionImpl::GetFingerprint(char** fingerprint)
|
||||
*fingerprint = tmp;
|
||||
return NS_OK;
|
||||
}
|
||||
*/
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::GetLocalDescription(char** aSDP)
|
||||
|
@ -346,6 +346,15 @@ public:
|
||||
rv = RemoveStream(aMediaStream);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GetFingerprint(char** fingerprint);
|
||||
void GetFingerprint(nsAString& fingerprint)
|
||||
{
|
||||
char *tmp;
|
||||
GetFingerprint(&tmp);
|
||||
fingerprint.AssignASCII(tmp);
|
||||
delete[] tmp;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP GetLocalDescription(char** aSDP);
|
||||
|
||||
void GetLocalDescription(nsAString& aSDP)
|
||||
|
Loading…
Reference in New Issue
Block a user