Also print OpenSSL command line to debug the server
In debug mode, print the OpenSSL command line needed to connect to a luksrku server.
This commit is contained in:
parent
603e63876f
commit
c89ff552d4
8
editor.c
8
editor.c
@ -439,6 +439,14 @@ static enum cmd_returncode_t cmd_rawdump(struct editor_context_t *ctx, const cha
|
|||||||
for (unsigned int i = 0; i < ctx->keydb->host_count; i++) {
|
for (unsigned int i = 0; i < ctx->keydb->host_count; i++) {
|
||||||
struct host_entry_t *host = &ctx->keydb->hosts[i];
|
struct host_entry_t *host = &ctx->keydb->hosts[i];
|
||||||
fprintf(stderr, "Host %d:\n", i);
|
fprintf(stderr, "Host %d:\n", i);
|
||||||
|
{
|
||||||
|
char host_uuid[ASCII_UUID_BUFSIZE];
|
||||||
|
sprintf_uuid(host_uuid, host->host_uuid);
|
||||||
|
|
||||||
|
char hex_psk[(PSK_SIZE_BYTES * 2) + 1];
|
||||||
|
sprintf_hex(hex_psk, host->tls_psk, PSK_SIZE_BYTES);
|
||||||
|
fprintf(stderr, "openssl s_client -connect 127.0.0.1:23170 -psk %s -psk_identity %s -curves X448:X25519 -ciphersuites TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384 -tls1_3\n", hex_psk, host_uuid);
|
||||||
|
}
|
||||||
dump_hexline(stderr, " host_uuid ", host->host_uuid, sizeof(host->host_uuid), false);
|
dump_hexline(stderr, " host_uuid ", host->host_uuid, sizeof(host->host_uuid), false);
|
||||||
dump_hexline(stderr, " host_name ", host->host_name, sizeof(host->host_name), true);
|
dump_hexline(stderr, " host_name ", host->host_name, sizeof(host->host_name), true);
|
||||||
dump_hexline(stderr, " tls_psk ", host->tls_psk, sizeof(host->tls_psk), false);
|
dump_hexline(stderr, " tls_psk ", host->tls_psk, sizeof(host->tls_psk), false);
|
||||||
|
6
util.c
6
util.c
@ -54,6 +54,12 @@ void dump_hex_long(FILE *f, const void *vdata, unsigned int length) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sprintf_hex(char *dest, const uint8_t *data, unsigned int length) {
|
||||||
|
for (unsigned int i = 0; i < length; i++) {
|
||||||
|
sprintf(dest + (2 * i), "%02x", data[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void dump_hex(FILE *f, const void *vdata, unsigned int length, bool use_ascii) {
|
void dump_hex(FILE *f, const void *vdata, unsigned int length, bool use_ascii) {
|
||||||
const uint8_t *data = (const uint8_t*)vdata;
|
const uint8_t *data = (const uint8_t*)vdata;
|
||||||
for (unsigned int i = 0; i < length; i++) {
|
for (unsigned int i = 0; i < length; i++) {
|
||||||
|
1
util.h
1
util.h
@ -33,6 +33,7 @@
|
|||||||
/*************** AUTO GENERATED SECTION FOLLOWS ***************/
|
/*************** AUTO GENERATED SECTION FOLLOWS ***************/
|
||||||
bool query_passphrase(const char *prompt, char *passphrase, unsigned int passphrase_maxsize);
|
bool query_passphrase(const char *prompt, char *passphrase, unsigned int passphrase_maxsize);
|
||||||
void dump_hex_long(FILE *f, const void *vdata, unsigned int length);
|
void dump_hex_long(FILE *f, const void *vdata, unsigned int length);
|
||||||
|
void sprintf_hex(char *dest, const uint8_t *data, unsigned int length);
|
||||||
void dump_hex(FILE *f, const void *vdata, unsigned int length, bool use_ascii);
|
void dump_hex(FILE *f, const void *vdata, unsigned int length, bool use_ascii);
|
||||||
void dump_hexline(FILE *f, const char *prefix, const void *vdata, unsigned int length, bool use_ascii);
|
void dump_hexline(FILE *f, const char *prefix, const void *vdata, unsigned int length, bool use_ascii);
|
||||||
bool is_hex(const char *str, int length);
|
bool is_hex(const char *str, int length);
|
||||||
|
Loading…
Reference in New Issue
Block a user