Skip to content

Commit

Permalink
Not request key when it was already readed v3
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrotega committed Nov 12, 2024
1 parent 94f6bce commit df43d4c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/libstrongswan/plugins/qkd/qkd_etsi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ bool qkd_get_key_id(qkd_handle_t handle, chunk_t *key_id)
// Replace handle's key_id with new one
chunk_free(&handle->key_id);
handle->key_id = chunk_clone(*key_id);
DBG1(DBG_LIB, "\tKey ID chunk: %s", handle->key_id);
DBG1(DBG_LIB, "\tKey ID chunk: %s", *key_id);
// DBG1(DBG_LIB, "\tKey ID chunk: %s", handle->key_id);
// DBG1(DBG_LIB, "\tKey ID chunk: %s", *key_id);

// Replace handle's key_id with new one
chunk_free(&handle->key);
handle->key = chunk_clone(chunk_create(b_key,QKD_KEY_SIZE));
handle->key = chunk_create(b_key, QKD_KEY_SIZE);
DBG1(DBG_LIB, "\tKey chunk: %s", handle->key);

qkd_print_key_id("QKD_plugin: Alice sending", *key_id);
Expand All @@ -266,7 +266,6 @@ bool qkd_get_key(qkd_handle_t handle, chunk_t *key)
if (handle->key.len != 0) {
DBG1(DBG_LIB, "QKD_plugin: Key already exists. Reading key from handle...");
*key = chunk_clone(handle->key);
DBG1(DBG_LIB, "\tKey: %s", *key->ptr);
return TRUE;
}

Expand Down

0 comments on commit df43d4c

Please sign in to comment.