Skip to content

Commit

Permalink
ExportKeyingMaterial の廃止に対応する
Browse files Browse the repository at this point in the history
  • Loading branch information
torikizi committed Dec 25, 2024
1 parent 8490c5f commit 5ef022a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/srtp_keying_material_exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ absl::optional<KeyingMaterial> ExportKeyingMaterial(

std::vector<uint8_t> buf(key_len * 2 + salt_len * 2);

if (!dtls->ExportKeyingMaterial(kDtlsSrtpExporterLabel, nullptr, 0, false,
buf.data(), buf.size())) {
RTC_LOG(LS_ERROR) << "Failed to ExportKeyingMaterial";
rtc::ZeroOnFreeBuffer<uint8_t> keying_material(buf.size());
if (!dtls->ExportSrtpKeyingMaterial(keying_material)) {
RTC_LOG(LS_ERROR) << "Failed to ExportSrtpKeyingMaterial";
return absl::nullopt;
};
}

std::memcpy(buf.data(), keying_material.data(), buf.size());

KeyingMaterial km;
km.client_write_key.resize(key_len);
Expand Down

0 comments on commit 5ef022a

Please sign in to comment.