xref: /openbsd-src/lib/libfido2/src/blob.h (revision b46d8ef224b95de1dddcd1f01c1ab482f0ab3778)
1 /*
2  * Copyright (c) 2018 Yubico AB. All rights reserved.
3  * Use of this source code is governed by a BSD-style
4  * license that can be found in the LICENSE file.
5  */
6 
7 #ifndef _BLOB_H
8 #define _BLOB_H
9 
10 typedef struct fido_blob {
11 	unsigned char	*ptr;
12 	size_t		 len;
13 } fido_blob_t;
14 
15 typedef struct fido_blob_array {
16 	fido_blob_t	*ptr;
17 	size_t		 len;
18 } fido_blob_array_t;
19 
20 cbor_item_t *fido_blob_encode(const fido_blob_t *);
21 fido_blob_t *fido_blob_new(void);
22 int fido_blob_decode(const cbor_item_t *, fido_blob_t *);
23 int fido_blob_is_empty(const fido_blob_t *);
24 int fido_blob_set(fido_blob_t *, const unsigned char *, size_t);
25 void fido_blob_free(fido_blob_t **);
26 void free_blob_array(fido_blob_array_t *);
27 
28 #endif /* !_BLOB_H */
29