blob: e0d03416488bd7a09442422bc77c903604a69679 [file] [log] [blame]
roman3f9b65c2023-06-05 14:26:58 +02001/**
2 * @file config_new_tls.c
3 * @author Roman Janota <janota@cesnet.cz>
4 * @brief libnetconf2 TLS server new configuration creation functions
5 *
6 * @copyright
7 * Copyright (c) 2023 CESNET, z.s.p.o.
8 *
9 * This source code is licensed under BSD 3-Clause License (the "License").
10 * You may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * https://opensource.org/licenses/BSD-3-Clause
14 */
15
16#define _GNU_SOURCE
17
roman12644fe2023-06-08 11:06:42 +020018#include <stdarg.h>
roman3f9b65c2023-06-05 14:26:58 +020019#include <stdint.h>
20#include <stdio.h>
21#include <stdlib.h>
22#include <string.h>
23
24#include <libyang/libyang.h>
25
26#include "compat.h"
27#include "config.h"
28#include "config_new.h"
29#include "log_p.h"
30#include "server_config.h"
31#include "session.h"
32#include "session_p.h"
33
34API int
roman3f9b65c2023-06-05 14:26:58 +020035nc_server_config_new_tls_server_certificate(const struct ly_ctx *ctx, const char *endpt_name, const char *pubkey_path,
36 const char *privkey_path, const char *certificate_path, struct lyd_node **config)
37{
38 int ret = 0;
romand30af552023-06-16 15:18:27 +020039 char *privkey = NULL, *pubkey = NULL, *cert = NULL;
roman3f9b65c2023-06-05 14:26:58 +020040 NC_PRIVKEY_FORMAT privkey_type;
41 NC_PUBKEY_FORMAT pubkey_type;
romand30af552023-06-16 15:18:27 +020042 const char *privkey_format, *pubkey_format;
roman3f9b65c2023-06-05 14:26:58 +020043
44 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, privkey_path, certificate_path, 1);
45 NC_CHECK_ARG_RET(NULL, config, 1);
46
47 /* get the keys as a string from the given files */
48 ret = nc_server_config_new_get_keys(privkey_path, pubkey_path, &privkey, &pubkey, &privkey_type, &pubkey_type);
49 if (ret) {
50 ERR(NULL, "Getting keys from file(s) failed.");
51 goto cleanup;
52 }
53
romand30af552023-06-16 15:18:27 +020054 /* get cert data from file */
roman3f9b65c2023-06-05 14:26:58 +020055 ret = nc_server_config_new_read_certificate(certificate_path, &cert);
56 if (ret) {
57 ERR(NULL, "Getting certificate from file \"%s\" failed.", certificate_path);
58 goto cleanup;
59 }
60
romand30af552023-06-16 15:18:27 +020061 /* get pubkey format str */
roman3f9b65c2023-06-05 14:26:58 +020062 if (pubkey_type == NC_PUBKEY_FORMAT_X509) {
romand30af552023-06-16 15:18:27 +020063 pubkey_format = "ietf-crypto-types:public-key-info-format";
roman3f9b65c2023-06-05 14:26:58 +020064 } else {
romand30af552023-06-16 15:18:27 +020065 pubkey_format = "ietf-crypto-types:ssh-public-key-format";
roman3f9b65c2023-06-05 14:26:58 +020066 }
67
68 /* get privkey identityref value */
romand30af552023-06-16 15:18:27 +020069 privkey_format = nc_config_new_privkey_format_to_identityref(privkey_type);
70 if (!privkey_format) {
roman3f9b65c2023-06-05 14:26:58 +020071 ret = 1;
72 goto cleanup;
73 }
74
romand30af552023-06-16 15:18:27 +020075 ret = nc_config_new_insert(ctx, config, pubkey_format, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/"
76 "tls/tls-server-parameters/server-identity/certificate/inline-definition/public-key-format", endpt_name);
roman3f9b65c2023-06-05 14:26:58 +020077 if (ret) {
78 goto cleanup;
79 }
80
romand30af552023-06-16 15:18:27 +020081 ret = nc_config_new_insert(ctx, config, pubkey, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/"
82 "tls/tls-server-parameters/server-identity/certificate/inline-definition/public-key", endpt_name);
roman3f9b65c2023-06-05 14:26:58 +020083 if (ret) {
84 goto cleanup;
85 }
86
romand30af552023-06-16 15:18:27 +020087 ret = nc_config_new_insert(ctx, config, privkey_format, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/"
88 "tls/tls-server-parameters/server-identity/certificate/inline-definition/private-key-format", endpt_name);
roman3f9b65c2023-06-05 14:26:58 +020089 if (ret) {
90 goto cleanup;
91 }
92
romand30af552023-06-16 15:18:27 +020093 ret = nc_config_new_insert(ctx, config, privkey, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/"
94 "tls/tls-server-parameters/server-identity/certificate/inline-definition/cleartext-private-key", endpt_name);
roman3f9b65c2023-06-05 14:26:58 +020095 if (ret) {
96 goto cleanup;
97 }
98
romand30af552023-06-16 15:18:27 +020099 ret = nc_config_new_insert(ctx, config, cert, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/"
100 "tls/tls-server-parameters/server-identity/certificate/inline-definition/cert-data", endpt_name);
roman3f9b65c2023-06-05 14:26:58 +0200101 if (ret) {
102 goto cleanup;
103 }
104
105cleanup:
106 free(privkey);
107 free(pubkey);
108 free(cert);
roman3f9b65c2023-06-05 14:26:58 +0200109 return ret;
110}
111
112API int
113nc_server_config_new_tls_client_certificate(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
114 const char *cert_path, struct lyd_node **config)
115{
116 int ret = 0;
romand30af552023-06-16 15:18:27 +0200117 char *cert = NULL;
roman3f9b65c2023-06-05 14:26:58 +0200118
119 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, cert_name, cert_path, config, 1);
120
121 ret = nc_server_config_new_read_certificate(cert_path, &cert);
122 if (ret) {
123 ERR(NULL, "Getting certificate from file \"%s\" failed.", cert_path);
124 goto cleanup;
125 }
126
romand30af552023-06-16 15:18:27 +0200127 ret = nc_config_new_insert(ctx, config, cert, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
128 "client-authentication/ee-certs/inline-definition/certificate[name='%s']/cert-data", endpt_name, cert_name);
roman3f9b65c2023-06-05 14:26:58 +0200129 if (ret) {
130 goto cleanup;
131 }
132
133cleanup:
134 free(cert);
roman3f9b65c2023-06-05 14:26:58 +0200135 return ret;
136}
137
138API int
139nc_server_config_new_tls_client_ca(const struct ly_ctx *ctx, const char *endpt_name, const char *cert_name,
140 const char *cert_path, struct lyd_node **config)
141{
142 int ret = 0;
romand30af552023-06-16 15:18:27 +0200143 char *cert = NULL;
roman3f9b65c2023-06-05 14:26:58 +0200144
145 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, cert_name, cert_path, config, 1);
146
147 ret = nc_server_config_new_read_certificate(cert_path, &cert);
148 if (ret) {
149 ERR(NULL, "Getting certificate from file \"%s\" failed.", cert_path);
150 goto cleanup;
151 }
152
romand30af552023-06-16 15:18:27 +0200153 ret = nc_config_new_insert(ctx, config, cert, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
154 "client-authentication/ca-certs/inline-definition/certificate[name='%s']/cert-data", endpt_name, cert_name);
roman3f9b65c2023-06-05 14:26:58 +0200155 if (ret) {
156 goto cleanup;
157 }
158
159cleanup:
160 free(cert);
roman3f9b65c2023-06-05 14:26:58 +0200161 return ret;
162}
roman12644fe2023-06-08 11:06:42 +0200163
romand30af552023-06-16 15:18:27 +0200164static const char *
165nc_config_new_tls_maptype2str(NC_TLS_CTN_MAPTYPE map_type)
166{
167 switch (map_type) {
168 case NC_TLS_CTN_SPECIFIED:
169 return "ietf-x509-cert-to-name:specified";
170 case NC_TLS_CTN_SAN_RFC822_NAME:
171 return "ietf-x509-cert-to-name:san-rfc822-name";
172 case NC_TLS_CTN_SAN_DNS_NAME:
173 return "ietf-x509-cert-to-name:san-dns-name";
174 case NC_TLS_CTN_SAN_IP_ADDRESS:
175 return "ietf-x509-cert-to-name:san-ip-address";
176 case NC_TLS_CTN_SAN_ANY:
177 return "ietf-x509-cert-to-name:san-any";
178 case NC_TLS_CTN_COMMON_NAME:
179 return "ietf-x509-cert-to-name:common-name";
180 case NC_TLS_CTN_UNKNOWN:
181 default:
182 ERR(NULL, "Unknown map_type.");
183 return NULL;
184 }
185}
186
roman12644fe2023-06-08 11:06:42 +0200187API int
188nc_server_config_new_tls_ctn(const struct ly_ctx *ctx, const char *endpt_name, uint32_t id, const char *fingerprint,
189 NC_TLS_CTN_MAPTYPE map_type, const char *name, struct lyd_node **config)
190{
191 int ret = 0;
romand30af552023-06-16 15:18:27 +0200192 const char *map;
roman12644fe2023-06-08 11:06:42 +0200193
194 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, id, map_type, name, 1);
195 NC_CHECK_ARG_RET(NULL, config, 1);
196
roman12644fe2023-06-08 11:06:42 +0200197 if (fingerprint) {
romand30af552023-06-16 15:18:27 +0200198 /* optional */
199 ret = nc_config_new_insert(ctx, config, fingerprint, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/"
200 "netconf-server-parameters/client-identity-mappings/cert-to-name[id='%d']/fingerprint", endpt_name, id);
roman12644fe2023-06-08 11:06:42 +0200201 if (ret) {
202 goto cleanup;
203 }
204 }
205
romand30af552023-06-16 15:18:27 +0200206 /* get map str */
207 map = nc_config_new_tls_maptype2str(map_type);
208 if (!map) {
roman12644fe2023-06-08 11:06:42 +0200209 ret = 1;
romand30af552023-06-16 15:18:27 +0200210 goto cleanup;
roman12644fe2023-06-08 11:06:42 +0200211 }
romand30af552023-06-16 15:18:27 +0200212
213 ret = nc_config_new_insert(ctx, config, map, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/"
214 "netconf-server-parameters/client-identity-mappings/cert-to-name[id='%d']/map-type", endpt_name, id);
roman12644fe2023-06-08 11:06:42 +0200215 if (ret) {
216 goto cleanup;
217 }
218
romand30af552023-06-16 15:18:27 +0200219 ret = nc_config_new_insert(ctx, config, name, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/"
220 "netconf-server-parameters/client-identity-mappings/cert-to-name[id='%d']/name", endpt_name, id);
roman12644fe2023-06-08 11:06:42 +0200221 if (ret) {
222 goto cleanup;
223 }
224
225cleanup:
roman12644fe2023-06-08 11:06:42 +0200226 return ret;
227}
228
romand30af552023-06-16 15:18:27 +0200229static const char *
230nc_config_new_tls_tlsversion2str(NC_TLS_VERSION version)
231{
232 switch (version) {
233 case NC_TLS_VERSION_10:
234 return "ietf-tls-common:tls10";
235 case NC_TLS_VERSION_11:
236 return "ietf-tls-common:tls11";
237 case NC_TLS_VERSION_12:
238 return "ietf-tls-common:tls12";
239 case NC_TLS_VERSION_13:
240 return "ietf-tls-common:tls13";
241 default:
242 ERR(NULL, "Unknown TLS version.");
243 return NULL;
244 }
245}
246
roman12644fe2023-06-08 11:06:42 +0200247API int
248nc_server_config_new_tls_version(const struct ly_ctx *ctx, const char *endpt_name,
249 NC_TLS_VERSION tls_version, struct lyd_node **config)
250{
251 int ret = 0;
romand30af552023-06-16 15:18:27 +0200252 const char *version;
roman12644fe2023-06-08 11:06:42 +0200253
254 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, config, 1);
255
romand30af552023-06-16 15:18:27 +0200256 version = nc_config_new_tls_tlsversion2str(tls_version);
257 if (!version) {
roman12644fe2023-06-08 11:06:42 +0200258 ret = 1;
259 goto cleanup;
260 }
261
romand30af552023-06-16 15:18:27 +0200262 ret = nc_config_new_insert(ctx, config, version, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
263 "hello-params/tls-versions/tls-version", endpt_name);
roman12644fe2023-06-08 11:06:42 +0200264 if (ret) {
265 goto cleanup;
266 }
267
268cleanup:
roman12644fe2023-06-08 11:06:42 +0200269 return ret;
270}
271
272API int
273nc_server_config_new_tls_ciphers(const struct ly_ctx *ctx, const char *endpt_name, struct lyd_node **config,
roman08f67f42023-06-08 13:51:54 +0200274 int cipher_count, ...)
roman12644fe2023-06-08 11:06:42 +0200275{
276 int ret = 0;
romand30af552023-06-16 15:18:27 +0200277 struct lyd_node *old = NULL;
roman12644fe2023-06-08 11:06:42 +0200278 va_list ap;
romand30af552023-06-16 15:18:27 +0200279 char *cipher = NULL, *cipher_ident = NULL, *old_path = NULL;
roman08f67f42023-06-08 13:51:54 +0200280 int i;
roman12644fe2023-06-08 11:06:42 +0200281
282 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, config, 1);
283
romand30af552023-06-16 15:18:27 +0200284 va_start(ap, cipher_count);
285
286 ret = asprintf(&old_path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/"
287 "tls/tls-server-parameters/hello-params/cipher-suites", endpt_name);
288 if (ret == -1) {
roman12644fe2023-06-08 11:06:42 +0200289 ERRMEM;
romand30af552023-06-16 15:18:27 +0200290 old_path = NULL;
roman12644fe2023-06-08 11:06:42 +0200291 goto cleanup;
292 }
293
294 /* delete all older algorithms (if any) se they can be replaced by the new ones */
romand30af552023-06-16 15:18:27 +0200295 ret = lyd_find_path(*config, old_path, 0, &old);
296 if (!ret) {
roman12644fe2023-06-08 11:06:42 +0200297 lyd_free_tree(old);
298 }
299
roman12644fe2023-06-08 11:06:42 +0200300 for (i = 0; i < cipher_count; i++) {
301 cipher = va_arg(ap, char *);
302
romand30af552023-06-16 15:18:27 +0200303 ret = asprintf(&cipher_ident, "iana-tls-cipher-suite-algs:%s", cipher);
304 if (ret == -1) {
roman12644fe2023-06-08 11:06:42 +0200305 ERRMEM;
306 ret = 1;
307 goto cleanup;
308 }
309
romand30af552023-06-16 15:18:27 +0200310 ret = nc_config_new_insert(ctx, config, cipher_ident, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/"
311 "tls/tls-server-parameters/hello-params/cipher-suites/cipher-suite", endpt_name);
roman12644fe2023-06-08 11:06:42 +0200312 if (ret) {
roman12644fe2023-06-08 11:06:42 +0200313 goto cleanup;
314 }
roman12644fe2023-06-08 11:06:42 +0200315
romand30af552023-06-16 15:18:27 +0200316 free(cipher_ident);
317 cipher_ident = NULL;
roman12644fe2023-06-08 11:06:42 +0200318 }
319
320cleanup:
321 va_end(ap);
romand30af552023-06-16 15:18:27 +0200322 free(old_path);
roman12644fe2023-06-08 11:06:42 +0200323 return ret;
324}
romanfaecc582023-06-15 16:13:31 +0200325
326API int
327nc_server_config_new_tls_crl_path(const struct ly_ctx *ctx, const char *endpt_name, const char *path, struct lyd_node **config)
328{
329 int ret = 0;
romand30af552023-06-16 15:18:27 +0200330 struct lyd_node *node = NULL;
331 char *url_path = NULL, *ext_path = NULL;
romanfaecc582023-06-15 16:13:31 +0200332
333 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, path, config, 1);
334
romand30af552023-06-16 15:18:27 +0200335 ret = nc_config_new_insert(ctx, config, path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
336 "client-authentication/libnetconf2-netconf-server:crl-path", endpt_name);
337 if (ret) {
338 goto cleanup;
339 }
340
341 if (asprintf(&url_path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
342 "client-authentication/libnetconf2-netconf-server:crl-url", endpt_name) == -1) {
romanfaecc582023-06-15 16:13:31 +0200343 ERRMEM;
romand30af552023-06-16 15:18:27 +0200344 url_path = NULL;
romanfaecc582023-06-15 16:13:31 +0200345 ret = 1;
346 goto cleanup;
347 }
348
romand30af552023-06-16 15:18:27 +0200349 if (asprintf(&ext_path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
350 "client-authentication/libnetconf2-netconf-server:crl-cert-ext", endpt_name) == -1) {
351 ERRMEM;
352 ext_path = NULL;
353 ret = 1;
romanfaecc582023-06-15 16:13:31 +0200354 goto cleanup;
355 }
356
357 /* delete other choice nodes if they are present */
romand30af552023-06-16 15:18:27 +0200358 ret = lyd_find_path(*config, url_path, 0, &node);
359 if (!ret) {
360 lyd_free_tree(node);
romanfaecc582023-06-15 16:13:31 +0200361 }
romand30af552023-06-16 15:18:27 +0200362 ret = lyd_find_path(*config, ext_path, 0, &node);
363 if (!ret) {
364 lyd_free_tree(node);
romanfaecc582023-06-15 16:13:31 +0200365 }
romand30af552023-06-16 15:18:27 +0200366 /* don't care about the return values from lyd_find_path */
367 ret = 0;
romanfaecc582023-06-15 16:13:31 +0200368
369cleanup:
romand30af552023-06-16 15:18:27 +0200370 free(url_path);
371 free(ext_path);
romanfaecc582023-06-15 16:13:31 +0200372 return ret;
373}
374
375API int
376nc_server_config_new_tls_crl_url(const struct ly_ctx *ctx, const char *endpt_name, const char *url, struct lyd_node **config)
377{
378 int ret = 0;
romand30af552023-06-16 15:18:27 +0200379 struct lyd_node *node = NULL;
380 char *crl_path = NULL, *ext_path = NULL;
romanfaecc582023-06-15 16:13:31 +0200381
382 NC_CHECK_ARG_RET(NULL, ctx, endpt_name, url, config, 1);
383
romand30af552023-06-16 15:18:27 +0200384 ret = nc_config_new_insert(ctx, config, url, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
385 "client-authentication/libnetconf2-netconf-server:crl-url", endpt_name);
386 if (ret) {
387 goto cleanup;
388 }
389
390 if (asprintf(&crl_path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
391 "client-authentication/libnetconf2-netconf-server:crl-path", endpt_name) == -1) {
romanfaecc582023-06-15 16:13:31 +0200392 ERRMEM;
romand30af552023-06-16 15:18:27 +0200393 crl_path = NULL;
romanfaecc582023-06-15 16:13:31 +0200394 ret = 1;
395 goto cleanup;
396 }
397
romand30af552023-06-16 15:18:27 +0200398 if (asprintf(&ext_path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
399 "client-authentication/libnetconf2-netconf-server:crl-cert-ext", endpt_name) == -1) {
400 ERRMEM;
401 ext_path = NULL;
402 ret = 1;
romanfaecc582023-06-15 16:13:31 +0200403 goto cleanup;
404 }
405
406 /* delete other choice nodes if they are present */
romand30af552023-06-16 15:18:27 +0200407 ret = lyd_find_path(*config, crl_path, 0, &node);
408 if (!ret) {
409 lyd_free_tree(node);
romanfaecc582023-06-15 16:13:31 +0200410 }
romand30af552023-06-16 15:18:27 +0200411 ret = lyd_find_path(*config, ext_path, 0, &node);
412 if (!ret) {
413 lyd_free_tree(node);
romanfaecc582023-06-15 16:13:31 +0200414 }
romand30af552023-06-16 15:18:27 +0200415 /* don't care about the return values from lyd_find_path */
416 ret = 0;
romanfaecc582023-06-15 16:13:31 +0200417
418cleanup:
romand30af552023-06-16 15:18:27 +0200419 free(crl_path);
420 free(ext_path);
romanfaecc582023-06-15 16:13:31 +0200421 return ret;
422}
423
424API int
425nc_server_config_new_tls_crl_cert_ext(const struct ly_ctx *ctx, const char *endpt_name, struct lyd_node **config)
426{
427 int ret = 0;
romand30af552023-06-16 15:18:27 +0200428 struct lyd_node *node = NULL;
429 char *crl_path = NULL, *url_path = NULL;
romanfaecc582023-06-15 16:13:31 +0200430
romand30af552023-06-16 15:18:27 +0200431 ret = nc_config_new_insert(ctx, config, NULL, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
432 "client-authentication/libnetconf2-netconf-server:crl-cert-ext", endpt_name);
433 if (ret) {
434 goto cleanup;
435 }
romanfaecc582023-06-15 16:13:31 +0200436
romand30af552023-06-16 15:18:27 +0200437 if (asprintf(&crl_path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
438 "client-authentication/libnetconf2-netconf-server:crl-path", endpt_name) == -1) {
romanfaecc582023-06-15 16:13:31 +0200439 ERRMEM;
romand30af552023-06-16 15:18:27 +0200440 crl_path = NULL;
romanfaecc582023-06-15 16:13:31 +0200441 ret = 1;
442 goto cleanup;
443 }
444
romand30af552023-06-16 15:18:27 +0200445 if (asprintf(&url_path, "/ietf-netconf-server:netconf-server/listen/endpoint[name='%s']/tls/tls-server-parameters/"
446 "client-authentication/libnetconf2-netconf-server:crl-url", endpt_name) == -1) {
447 ERRMEM;
448 url_path = NULL;
449 ret = 1;
romanfaecc582023-06-15 16:13:31 +0200450 goto cleanup;
451 }
452
453 /* delete other choice nodes if they are present */
romand30af552023-06-16 15:18:27 +0200454 ret = lyd_find_path(*config, crl_path, 0, &node);
455 if (!ret) {
456 lyd_free_tree(node);
romanfaecc582023-06-15 16:13:31 +0200457 }
romand30af552023-06-16 15:18:27 +0200458 ret = lyd_find_path(*config, url_path, 0, &node);
459 if (!ret) {
460 lyd_free_tree(node);
romanfaecc582023-06-15 16:13:31 +0200461 }
romand30af552023-06-16 15:18:27 +0200462 /* don't care about the return values from lyd_find_path */
463 ret = 0;
romanfaecc582023-06-15 16:13:31 +0200464
465cleanup:
romand30af552023-06-16 15:18:27 +0200466 free(crl_path);
467 free(url_path);
romanfaecc582023-06-15 16:13:31 +0200468 return ret;
469}