Browse Source

Fixed material length

Paul-Louis Ageneau 5 years ago
parent
commit
cbe3f655aa
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/dtlssrtptransport.cpp

+ 2 - 2
src/dtlssrtptransport.cpp

@@ -145,8 +145,8 @@ void DtlsSrtpTransport::postHandshake() {
 	// master salt and the server write master salt in that order.
 	// master salt and the server write master salt in that order.
 	const string label = "EXTRACTOR-dtls_srtp";
 	const string label = "EXTRACTOR-dtls_srtp";
 	// TODO: check OpenSSL
 	// TODO: check OpenSSL
-	SSL_export_keying_material(mSsl, material, SRTP_MAX_KEY_LEN * 2, label.c_str(), label.size(),
-	                           nullptr, 0, 0);
+	SSL_export_keying_material(mSsl, material, materialLen, label.c_str(), label.size(), nullptr, 0,
+	                           0);
 	clientKey = material;
 	clientKey = material;
 	clientSalt = clientKey + SRTP_AES_128_KEY_LEN;
 	clientSalt = clientKey + SRTP_AES_128_KEY_LEN;