Scroll to navigation

FIDO_ASSERT_NEW(3) Library Functions Manual FIDO_ASSERT_NEW(3)

NAME

fido_assert_new, fido_assert_free, fido_assert_count, fido_assert_rp_id, fido_assert_user_display_name, fido_assert_user_icon, fido_assert_user_name, fido_assert_authdata_ptr, fido_assert_clientdata_hash_ptr, fido_assert_hmac_secret_ptr, fido_assert_user_id_ptr, fido_assert_sig_ptr, fido_assert_id_ptr, fido_assert_authdata_len, fido_assert_clientdata_hash_len, fido_assert_hmac_secret_len, fido_assert_user_id_len, fido_assert_sig_len, fido_assert_id_len, fido_assert_sigcount, fido_assert_flagsFIDO 2 assertion API

SYNOPSIS

#include <fido.h>

fido_assert_t *
fido_assert_new(void);

void
fido_assert_free(fido_assert_t **assert_p);

size_t
fido_assert_count(const fido_assert_t *assert);

const char *
fido_assert_rp_id(const fido_assert_t *assert);

const char *
fido_assert_user_display_name(const fido_assert_t *assert, size_t idx);

const char *
fido_assert_user_icon(const fido_assert_t *assert, size_t idx);

const char *
fido_assert_user_name(const fido_assert_t *assert, size_t idx);

const unsigned char *
fido_assert_authdata_ptr(const fido_assert_t *assert, size_t idx);

const unsigned char *
fido_assert_clientdata_hash_ptr(const fido_assert_t *assert);

const unsigned char *
fido_assert_hmac_secret_ptr(const fido_assert_t *assert, size_t idx);

const unsigned char *
fido_assert_user_id_ptr(const fido_assert_t *assert, size_t idx);

const unsigned char *
fido_assert_sig_ptr(const fido_assert_t *assert, size_t idx);

const unsigned char *
fido_assert_id_ptr(const fido_assert_t *assert, size_t idx);

size_t
fido_assert_authdata_len(const fido_assert_t *assert, size_t idx);

size_t
fido_assert_clientdata_hash_len(const fido_assert_t *assert);

size_t
fido_assert_hmac_secret_len(const fido_assert_t *assert, size_t idx);

size_t
fido_assert_user_id_len(const fido_assert_t *assert, size_t idx);

size_t
fido_assert_sig_len(const fido_assert_t *assert, size_t idx);

size_t
fido_assert_id_len(const fido_assert_t *assert, size_t idx);

uint32_t
fido_assert_sigcount(const fido_assert_t *assert, size_t idx);

uint8_t
fido_assert_flags(const fido_assert_t *assert, size_t idx);

DESCRIPTION

FIDO 2 assertions are abstracted in by the fido_assert_t type. The functions described in this page allow a fido_assert_t type to be allocated, deallocated, and inspected. For other operations on fido_assert_t, please refer to fido_assert_set_authdata(3), fido_assert_allow_cred(3), fido_assert_verify(3), and fido_dev_get_assert(3).

The () function returns a pointer to a newly allocated, empty fido_assert_t type. If memory cannot be allocated, NULL is returned.

The () function releases the memory backing *assert_p, where *assert_p must have been previously allocated by fido_assert_new(). On return, *assert_p is set to NULL. Either assert_p or *assert_p may be NULL, in which case fido_assert_free() is a NOP.

The () function returns the number of statements in assert.

The () function returns a pointer to a NUL-terminated string holding the relying party ID of assert.

The (), (), and (), functions return pointers to the user display name, icon, and name attributes of statement idx in assert. If not NULL, the values returned by these functions point to NUL-terminated UTF-8 strings.

The (), (), (), (), and () functions return pointers to the user ID, CBOR-encoded authenticator data, hmac-secret, signature, and credential ID attributes of statement idx in assert. The (), (), (), (), and () functions can be used to retrieve the corresponding length of a specific attribute.

The () function can be used to obtain the signature counter of statement idx in assert.

The () function returns the authenticator data flags of statement idx in assert.

Please note that the first statement in assert has an idx (index) value of 0.

The authenticator data and signature parts of an assertion statement are typically passed to a FIDO 2 server for verification.

The () function returns a pointer to the client data hash of assert. The corresponding length can be obtained by ().

RETURN VALUES

The authenticator data returned by fido_assert_authdata_ptr() is a CBOR-encoded byte string, as obtained from the authenticator.

The fido_assert_user_display_name(), fido_assert_user_icon(), fido_assert_user_name(), fido_assert_authdata_ptr(), fido_assert_clientdata_hash_ptr(), fido_assert_user_id_ptr(), and fido_assert_sig_ptr() functions return NULL if the respective field in assert is not set. If not NULL, returned pointers are guaranteed to exist until any API function that takes assert without the qualifier is invoked.

SEE ALSO

fido_assert_allow_cred(3), fido_assert_set_authdata(3), fido_assert_verify(3), fido_dev_get_assert(3)

October 22, 2019 Debian