Skip to content
Snippets Groups Projects
Commit 8708ef11 authored by Charles Wright's avatar Charles Wright
Browse files

Additional debug output

parent 05a1dae0
No related branches found
Tags v0.1.3
No related merge requests found
......@@ -48,7 +48,7 @@ void debug(debug_level_t level,
}
void print_point(const char *label,
uint8_t point[32]
const uint8_t point[32]
) {
printf("%8s:\t[", label);
int i = 31;
......@@ -385,6 +385,10 @@ bsspeke_client_derive_shared_key(const uint8_t B[32],
{
// Compute the two Diffie-Hellman shared secrets
debug(LOG_DEBUG, "Computing Diffie-Hellman shared secrets");
printf("%8s:\t[%s]\n", "client", client->client_id);
printf("%8s:\t[%zu]\n", "length", client->client_id_len);
printf("%8s:\t[%s]\n", "server", client->server_id);
printf("%8s:\t[%zu]\n", "length", client->server_id_len);
print_point("A", client->A);
print_point("B", B);
// DH shared secret from a * B
......@@ -443,6 +447,10 @@ bsspeke_server_derive_shared_key(const uint8_t A[32],
debug(LOG_DEBUG, "Computing Diffie-Hellman shared secrets");
// DH shared secret from b * A
uint8_t b_A[32];
printf("%8s:\t[%s]\n", "client", server->client_id);
printf("%8s:\t[%zu]\n", "length", server->client_id_len);
printf("%8s:\t[%s]\n", "server", server->server_id);
printf("%8s:\t[%zu]\n", "length", server->server_id_len);
print_point("A", A);
print_point("B", server->B);
crypto_x25519(b_A, server->b, A);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment