Skip to content

Commit

Permalink
Fix call dec_keys
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrotega committed Nov 12, 2024
1 parent 5ea9b99 commit bf8e7be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/libstrongswan/plugins/qkd/qkd_etsi_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ bool qkd_set_key_id(qkd_handle_t handle, chunk_t key_id)

chunk_clear(&handle->key_id);
handle->key_id = chunk_clone(key_id);
DBG1(DBG_LIB, "\t Bob received ID: %s\n", handle->key_id);
DBG1(DBG_LIB, "\t Bob received ID: %s\n", handle->key_id.ptr);

//qkd_print_key_id("Bob received", key_id);
return TRUE;
Expand Down Expand Up @@ -262,7 +262,7 @@ bool qkd_get_key(qkd_handle_t handle, chunk_t *key)

// Print the key_id we're actually using from the exchange
//qkd_print_key_id("Using", handle->key_id);
DBG1(DBG_LIB, "\tID: %s\n", handle->key_id);
DBG1(DBG_LIB, "\tID: %s", handle->key_id.ptr);
/**
* Request key and key_id to the KMS.
*/
Expand All @@ -274,10 +274,10 @@ bool qkd_get_key(qkd_handle_t handle, chunk_t *key)
char b_key_id[256] = {0};

// Solicitud de clave al nodo maestro (Alice)
snprintf(url, sizeof(url), "%s/api/v1/keys/%s/enc_keys", handle->kms_ip.ptr, handle->sae.ptr);
snprintf(url, sizeof(url), "%s/api/v1/keys/%s/dec_keys", handle->kms_ip.ptr, handle->sae.ptr);
char post_data[512];
snprintf(post_data, sizeof(post_data), "{\"key_IDs\":[{\"key_ID\":\"%s\"}]}", handle->key_id.ptr);
DBG1(DBG_LIB, "\nRead key in KMS:\n");
DBG1(DBG_LIB, "\tRead key in KMS:");
response = request_https(url, handle->pub_key, handle->priv_key, handle->root_ca, post_data);
if (response) {
extract_key_and_id(response, b_key, sizeof(b_key), b_key_id, sizeof(b_key_id));
Expand Down
2 changes: 1 addition & 1 deletion src/libstrongswan/plugins/qkd/qkd_etsi_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <library.h>

#define QKD_KEY_SIZE 32
#define QKD_KEY_ID_SIZE 36
#define QKD_KEY_ID_SIZE 34
#define MAX_LINE 256
#define QKD_CONF_PATH "/etc/swanctl/qkd/"
#define QKD_CONF_FILE "/etc/swanctl/qkd/qkd.conf"
Expand Down

0 comments on commit bf8e7be

Please sign in to comment.