Blame


1 5fb267cb 2024-09-08 op /*
2 5fb267cb 2024-09-08 op * Copyright (c) 2024 Omar Polo <op@openbsd.org>
3 5fb267cb 2024-09-08 op *
4 5fb267cb 2024-09-08 op * Permission to use, copy, modify, and distribute this software for any
5 5fb267cb 2024-09-08 op * purpose with or without fee is hereby granted, provided that the above
6 5fb267cb 2024-09-08 op * copyright notice and this permission notice appear in all copies.
7 5fb267cb 2024-09-08 op *
8 5fb267cb 2024-09-08 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 5fb267cb 2024-09-08 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 5fb267cb 2024-09-08 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 5fb267cb 2024-09-08 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 5fb267cb 2024-09-08 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 5fb267cb 2024-09-08 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 5fb267cb 2024-09-08 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 5fb267cb 2024-09-08 op */
16 5fb267cb 2024-09-08 op
17 5fb267cb 2024-09-08 op enum gotd_secret_type {
18 5fb267cb 2024-09-08 op GOTD_SECRET_AUTH,
19 5fb267cb 2024-09-08 op GOTD_SECRET_HMAC,
20 5fb267cb 2024-09-08 op };
21 5fb267cb 2024-09-08 op
22 5fb267cb 2024-09-08 op struct gotd_secret {
23 5fb267cb 2024-09-08 op enum gotd_secret_type type;
24 6e1b28b6 2024-09-09 op char *label;
25 6e1b28b6 2024-09-09 op char *user;
26 6e1b28b6 2024-09-09 op char *pass;
27 6e1b28b6 2024-09-09 op char *hmac;
28 5fb267cb 2024-09-08 op };
29 5fb267cb 2024-09-08 op
30 5fb267cb 2024-09-08 op struct gotd_secrets {
31 5fb267cb 2024-09-08 op struct gotd_secret *secrets;
32 5fb267cb 2024-09-08 op size_t len;
33 5fb267cb 2024-09-08 op size_t cap;
34 5fb267cb 2024-09-08 op };
35 5fb267cb 2024-09-08 op
36 5fb267cb 2024-09-08 op const struct got_error *gotd_secrets_parse(const char *, FILE *,
37 5fb267cb 2024-09-08 op struct gotd_secrets **);
38 6e1b28b6 2024-09-09 op struct gotd_secret *gotd_secrets_get(struct gotd_secrets *,
39 6e1b28b6 2024-09-09 op enum gotd_secret_type, const char *);
40 5fb267cb 2024-09-08 op void gotd_secrets_free(struct gotd_secrets *);