Bug 828027 - Lower-case digest algorithm names r=ehugg
authorEKR <ekr@rtfm.com>
Mon, 14 Jan 2013 09:10:38 -0800
changeset 118772 145fb616b12aabd0307b3b2a0bb28d5475e30177
parent 118771 aeacf3c6231bd24c2015b8177ee6e144d724ebd4
child 118773 53dd117b51f2603e2e14e75f0ce983376c2092eb
push id21258
push userehugg@cisco.com
push dateMon, 14 Jan 2013 19:13:02 +0000
treeherdermozilla-inbound@145fb616b12a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehugg
bugs828027
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 828027 - Lower-case digest algorithm names r=ehugg
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -23,16 +23,17 @@
 #include "runnable_utils.h"
 #include "cpr_stdlib.h"
 #include "cpr_string.h"
 
 #include <stdlib.h>
 #include <stdio.h>
 #include <ssl.h>
 #include <sslproto.h>
+#include <algorithm>
 
 extern "C" {
 #include "ccsdp.h"
 #include "vcm.h"
 #include "cip_mmgr_mediadefinitions.h"
 #include "cip_Sipcc_CodecMask.h"
 
 extern void lsm_start_multipart_tone_timer (vcm_tones_t tone,
@@ -2634,17 +2635,22 @@ vcmCreateTransportFlow(sipcc::PeerConnec
     nsresult res = DtlsIdentity::ParseFingerprint(fingerprint,
                                                   remote_digest,
                                                   sizeof(remote_digest),
                                                   &digest_len);
     if (!NS_SUCCEEDED(res)) {
       CSFLogError(logTag, "Could not convert fingerprint");
       return NULL;
     }
-    res = dtls->SetVerificationDigest(fingerprint_alg, remote_digest, digest_len);
+
+    std::string fingerprint_str(fingerprint_alg);
+    // Downcase because SDP is case-insensitive.
+    std::transform(fingerprint_str.begin(), fingerprint_str.end(),
+                   fingerprint_str.begin(), ::tolower);
+    res = dtls->SetVerificationDigest(fingerprint_str, remote_digest, digest_len);
     if (!NS_SUCCEEDED(res)) {
       CSFLogError(logTag, "Could not set remote DTLS digest");
       return NULL;
     }
 
     std::vector<uint16_t> srtp_ciphers;
     srtp_ciphers.push_back(SRTP_AES128_CM_HMAC_SHA1_80);
     srtp_ciphers.push_back(SRTP_AES128_CM_HMAC_SHA1_32);