summaryrefslogtreecommitdiff
path: root/src/lib/crypt.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2026-06-21 13:18:35 +0200
committerSander Vrijders <sander@ouroboros.rocks>2026-06-29 08:32:59 +0200
commita169a1cef5332a409efc2db07bcc1ae9b72f217e (patch)
tree73475b759b22db778527ef4d7ae016bc12398670 /src/lib/crypt.c
parent47034834790e778f28b082842b3ed1c7bd44f29a (diff)
downloadouroboros-a169a1cef5332a409efc2db07bcc1ae9b72f217e.tar.gz
ouroboros-a169a1cef5332a409efc2db07bcc1ae9b72f217e.zip
lib: Group sec_config authentication fields
Nest the flat req_auth and cacert members of struct sec_config into a sub-struct a { req; cacert; }, keeping the authentication settings together. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/crypt.c')
-rw-r--r--src/lib/crypt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/crypt.c b/src/lib/crypt.c
index e4b65cf0..a34e7298 100644
--- a/src/lib/crypt.c
+++ b/src/lib/crypt.c
@@ -173,7 +173,7 @@ int parse_sec_config(struct sec_config * cfg,
SET_KEX_KDF_NID(cfg, NID_sha256);
SET_KEX_CIPHER_NID(cfg, NID_aes_256_gcm);
SET_KEX_DIGEST_NID(cfg, NID_sha256);
- /* req_auth is seeded per-role by the caller; only auth= overrides it */
+ /* a.req is seeded per-role by the caller; only auth= overrides it */
while (fgets(line, sizeof(line), fp) != NULL) {
char * trimmed;
@@ -223,16 +223,16 @@ int parse_sec_config(struct sec_config * cfg,
}
} else if (strcmp(key, "auth") == 0) {
if (strcmp(value, "required") == 0) {
- cfg->req_auth = true;
+ cfg->a.req = true;
} else if (strcmp(value, "optional") == 0) {
- cfg->req_auth = false;
+ cfg->a.req = false;
} else {
return -EINVAL;
}
} else if (strcmp(key, "cacert") == 0) {
- if (strlen(value) >= sizeof(cfg->cacert))
+ if (strlen(value) >= sizeof(cfg->a.cacert))
return -EINVAL;
- strcpy(cfg->cacert, value);
+ strcpy(cfg->a.cacert, value);
} else if (strcmp(key, "encryption") == 0) {
if (strcmp(value, "none") != 0)
return -EINVAL;