Add dumpBuffer() in libgourou_common

This commit is contained in:
2022-08-27 15:42:11 +02:00
parent 7084fb7025
commit 56b3231f92
3 changed files with 17 additions and 24 deletions

View File

@@ -226,14 +226,7 @@ namespace gourou
client->digestFinalize(sha_ctx, sha_out);
if (logLevel >= LG_LOG_DEBUG)
{
printf("\nSHA OUT : ");
for(int i=0; i<(int)SHA1_LEN; i++)
printf("%02x ", sha_out[i]);
printf("\n");
}
dumpBuffer(gourou::LG_LOG_DEBUG, "\nSHA OUT : ", sha_out, SHA1_LEN);
}
void DRMProcessor::signNode(pugi::xml_node& rootNode)
@@ -252,13 +245,8 @@ namespace gourou
client->RSAPrivateEncrypt(privateRSAKey.data(), privateRSAKey.length(),
RSAInterface::RSA_KEY_PKCS12, deviceKey.toBase64().data(),
sha_out, sizeof(sha_out), res);
if (logLevel >= LG_LOG_DEBUG)
{
printf("Sig : ");
for(int i=0; i<(int)sizeof(res); i++)
printf("%02x ", res[i]);
printf("\n");
}
dumpBuffer(gourou::LG_LOG_DEBUG, "Sig : ", res, sizeof(res));
std::string signature = ByteArray(res, sizeof(res)).toBase64();
appendTextElem(rootNode, "adept:signature", signature);