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