($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
blob 8ad57b61b2730f971cdd9da22fb278d01144040a 2874 bytes (raw)
name: ell/cert.h 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 
/*
 *
 *  Embedded Linux library
 *
 *  Copyright (C) 2018  Intel Corporation. All rights reserved.
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifndef __ELL_CERT_H
#define __ELL_CERT_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>
#include <ell/cleanup.h>

struct l_queue;
struct l_cert;
struct l_certchain;

enum l_cert_key_type {
	L_CERT_KEY_RSA,
	L_CERT_KEY_ECC,
	L_CERT_KEY_UNKNOWN,
};

typedef bool (*l_cert_walk_cb_t)(struct l_cert *cert, void *user_data);

struct l_cert *l_cert_new_from_der(const uint8_t *buf, size_t buf_len);
void l_cert_free(struct l_cert *cert);
DEFINE_CLEANUP_FUNC(l_cert_free);

const uint8_t *l_cert_get_der_data(struct l_cert *cert, size_t *out_len);
const uint8_t *l_cert_get_dn(struct l_cert *cert, size_t *out_len);
enum l_cert_key_type l_cert_get_pubkey_type(struct l_cert *cert);
struct l_key *l_cert_get_pubkey(struct l_cert *cert);

void l_certchain_free(struct l_certchain *chain);
DEFINE_CLEANUP_FUNC(l_certchain_free);

struct l_cert *l_certchain_get_leaf(struct l_certchain *chain);
void l_certchain_walk_from_leaf(struct l_certchain *chain,
				l_cert_walk_cb_t cb, void *user_data);
void l_certchain_walk_from_ca(struct l_certchain *chain,
				l_cert_walk_cb_t cb, void *user_data);

bool l_certchain_verify(struct l_certchain *chain, struct l_queue *ca_certs,
			const char **error);

bool l_cert_load_container_file(const char *filename, const char *password,
				struct l_certchain **out_certchain,
				struct l_key **out_privkey,
				bool *out_encrypted);

bool l_cert_pkcs5_pbkdf1(enum l_checksum_type type, const char *password,
				const uint8_t *salt, size_t salt_len,
				unsigned int iter_count,
				uint8_t *out_dk, size_t dk_len);
bool l_cert_pkcs5_pbkdf2(enum l_checksum_type type, const char *password,
				size_t pass_len,
				const uint8_t *salt, size_t salt_len,
				unsigned int iter_count,
				uint8_t *out_dk, size_t dk_len);
bool l_cert_pkcs5_pbkdf2_from_key_id(enum l_checksum_type type,
					int32_t key_id, const uint8_t *salt,
					size_t salt_len,
					unsigned int iter_count,
					uint8_t *out_dk, size_t dk_len);
#ifdef __cplusplus
}
#endif

#endif /* __ELL_CERT_H */

debug log:

solving 8ad57b6 ...
found 8ad57b6 in https://yhbt.net/lore/ell/20221118211624.19298-8-prestwoj@gmail.com/
found ce430fa in https://yhbt.net/lore/ell/20221118211624.19298-7-prestwoj@gmail.com/
found f637588 in https://yhbt.net/lore/pub/scm/libs/ell/ell.git/
preparing index
index prepared:
100644 f637588e6d6622d474a5841da48fcfb939555bf3	ell/cert.h

applying [1/2] https://yhbt.net/lore/ell/20221118211624.19298-7-prestwoj@gmail.com/
diff --git a/ell/cert.h b/ell/cert.h
index f637588..ce430fa 100644


applying [2/2] https://yhbt.net/lore/ell/20221118211624.19298-8-prestwoj@gmail.com/
diff --git a/ell/cert.h b/ell/cert.h
index ce430fa..8ad57b6 100644

Checking patch ell/cert.h...
Applied patch ell/cert.h cleanly.
Checking patch ell/cert.h...
Applied patch ell/cert.h cleanly.

index at:
100644 8ad57b61b2730f971cdd9da22fb278d01144040a	ell/cert.h

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).