Explorar el Código

Merge pull request #848 from Sean-Der/master

Pass correct size to mbedtls_ssl_tls_prf
Paul-Louis Ageneau hace 2 años
padre
commit
9ccf334864
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/impl/dtlssrtptransport.cpp

+ 2 - 2
src/impl/dtlssrtptransport.cpp

@@ -286,8 +286,8 @@ void DtlsSrtpTransport::postHandshake() {
 		throw std::logic_error("Failed to get SRTP profile");
 	}
 
-	if (mbedtls_ssl_tls_prf(mTlsProfile, reinterpret_cast<const unsigned char *>(mMasterSecret), 32,
-	                        label.c_str(), reinterpret_cast<const unsigned char *>(mRandBytes), 32,
+	if (mbedtls_ssl_tls_prf(mTlsProfile, reinterpret_cast<const unsigned char *>(mMasterSecret), 48,
+	                        label.c_str(), reinterpret_cast<const unsigned char *>(mRandBytes), 64,
 	                        material.data(), materialLen) != 0) {
 		throw std::runtime_error("Failed to derive SRTP keys");
 	}