From ebac6ef50524919831863c6338903027399abd36 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 16 Jan 2021 16:49:45 +0100 Subject: std::hex changes cerr's state, so reset it after hex dumping error codes --- receiver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'receiver.cpp') diff --git a/receiver.cpp b/receiver.cpp index 46ab71a..2fa2d8a 100644 --- a/receiver.cpp +++ b/receiver.cpp @@ -318,7 +318,7 @@ int main() { ret = mbedtls_pk_decrypt(&pk, packet + 1 + SESSION_ID_LENGTH, len - 1 - SESSION_ID_LENGTH, rsa_plain_text, &olen, sizeof(rsa_plain_text), mbedtls_ctr_drbg_random, &ctr_drbg); if (ret < 0) { - std::cerr << "Error: Failed to decrypt key (error " << -ret << ") for session " << std::hex << session_id << std::endl; + std::cerr << "Error: Failed to decrypt key (error -" << -ret << " == -" << std::hex << -ret << ") for session " << session_id << std::dec << std::endl; break; } -- cgit v1.2.3