Skip to content
Snippets Groups Projects
Commit 2a04f3e0 authored by Adrien Béraud's avatar Adrien Béraud Committed by Sébastien Blin
Browse files

use dht::toHex for crls

Change-Id: I0c4514f9676dc0c29d309c9176e116643e48d198
parent 4b6a0851
No related branches found
No related tags found
No related merge requests found
...@@ -182,12 +182,7 @@ add_initial_files(GitRepository& repo, const std::shared_ptr<JamiAccount>& accou ...@@ -182,12 +182,7 @@ add_initial_files(GitRepository& repo, const std::shared_ptr<JamiAccount>& accou
for (const auto& crl : account->identity().second->getRevocationLists()) { for (const auto& crl : account->identity().second->getRevocationLists()) {
if (!crl) if (!crl)
continue; continue;
auto v = crl->getNumber(); std::string crlPath = crlsPath + DIR_SEPARATOR_STR + deviceId + DIR_SEPARATOR_STR + dht::toHex(crl->getNumber())
std::stringstream ss;
ss << std::hex;
for (const auto& b : v)
ss << (unsigned) b;
std::string crlPath = crlsPath + DIR_SEPARATOR_STR + deviceId + DIR_SEPARATOR_STR + ss.str()
+ ".crl"; + ".crl";
file = fileutils::ofstream(crlPath, std::ios::trunc | std::ios::binary); file = fileutils::ofstream(crlPath, std::ios::trunc | std::ios::binary);
if (!file.is_open()) { if (!file.is_open()) {
......
...@@ -388,14 +388,8 @@ CertificateStore::pinRevocationList(const std::string& id, ...@@ -388,14 +388,8 @@ CertificateStore::pinRevocationList(const std::string& id,
void void
CertificateStore::pinRevocationList(const std::string& id, const dht::crypto::RevocationList& crl) CertificateStore::pinRevocationList(const std::string& id, const dht::crypto::RevocationList& crl)
{ {
auto v = crl.getNumber();
std::stringstream ss;
ss << std::hex;
for (const auto& b : v)
ss << (unsigned) b;
fileutils::check_dir((crlPath_ + DIR_SEPARATOR_CH + id).c_str()); fileutils::check_dir((crlPath_ + DIR_SEPARATOR_CH + id).c_str());
fileutils::saveFile(crlPath_ + DIR_SEPARATOR_CH + id + DIR_SEPARATOR_CH + ss.str(), fileutils::saveFile(crlPath_ + DIR_SEPARATOR_CH + id + DIR_SEPARATOR_CH + dht::toHex(crl.getNumber()),
crl.getPacked()); crl.getPacked());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment