Support reading from snapshots encrypted with different keys

This commit is contained in:
Vitaliy Filippov
2026-03-20 21:00:32 +03:00
parent e6c3f4c6f4
commit de7edfd31d
13 changed files with 322 additions and 140 deletions
+14
View File
@@ -551,3 +551,17 @@ size_t fromhexstr(const std::string & from, size_t bytes, uint8_t *to)
}
return i;
}
std::string tohexstr(const uint8_t *from, size_t bytes)
{
std::string res;
res.resize(bytes*2);
for (size_t i = 0; i < bytes; i++)
{
uint8_t x = from[i] / 16;
uint8_t y = from[i] % 16;
res[2*i] = (x < 10 ? '0' : 'a'-10) + x;
res[2*i+1] = (y < 10 ? '0' : 'a'-10) + y;
}
return res;
}
+1
View File
@@ -36,5 +36,6 @@ std::string format_datetime(uint64_t unixtime);
bool is_zero(void *buf, size_t size);
std::string urldecode(const std::string & orig);
size_t fromhexstr(const std::string & from, size_t bytes, uint8_t *to);
std::string tohexstr(const uint8_t *from, size_t bytes);
#pragma GCC visibility pop