FIDO-Raw

 view release on metacpan or  search on metacpan

deps/libfido2/src/assert.c  view on Meta::CPAN

		goto fail;
	}

	if ((argv[0] = cbor_build_string(assert->rp_id)) == NULL ||
	    (argv[1] = fido_blob_encode(&assert->cdh)) == NULL) {
		fido_log_debug("%s: cbor encode", __func__);
		r = FIDO_ERR_INTERNAL;
		goto fail;
	}

	/* allowed credentials */
	if (assert->allow_list.len) {
		const fido_blob_array_t *cl = &assert->allow_list;
		if ((argv[2] = cbor_encode_pubkey_list(cl)) == NULL) {
			fido_log_debug("%s: cbor_encode_pubkey_list", __func__);
			r = FIDO_ERR_INTERNAL;
			goto fail;
		}
	}

	/* hmac-secret extension */

deps/libfido2/src/cred.c  view on Meta::CPAN


	if ((argv[0] = fido_blob_encode(&cred->cdh)) == NULL ||
	    (argv[1] = cbor_encode_rp_entity(&cred->rp)) == NULL ||
	    (argv[2] = cbor_encode_user_entity(&cred->user)) == NULL ||
	    (argv[3] = cbor_encode_pubkey_param(cred->type)) == NULL) {
		fido_log_debug("%s: cbor encode", __func__);
		r = FIDO_ERR_INTERNAL;
		goto fail;
	}

	/* excluded credentials */
	if (cred->excl.len)
		if ((argv[4] = cbor_encode_pubkey_list(&cred->excl)) == NULL) {
			fido_log_debug("%s: cbor_encode_pubkey_list", __func__);
			r = FIDO_ERR_INTERNAL;
			goto fail;
		}

	/* extensions */
	if (cred->ext.mask)
		if ((argv[5] = cbor_encode_extensions(&cred->ext)) == NULL) {

deps/libfido2/src/fido/types.h  view on Meta::CPAN

	int             authdata_ext;    /* decoded extensions */
	fido_blob_t     authdata_cbor;   /* raw cbor payload */
	fido_authdata_t authdata;        /* decoded authdata payload */
	fido_blob_t     sig;             /* signature of cdh + authdata */
} fido_assert_stmt;

typedef struct fido_assert {
	char              *rp_id;        /* relying party id */
	fido_blob_t        cdh;          /* client data hash */
	fido_blob_t        hmac_salt;    /* optional hmac-secret salt */
	fido_blob_array_t  allow_list;   /* list of allowed credentials */
	fido_opt_t         up;           /* user presence */
	fido_opt_t         uv;           /* user verification */
	int                ext;          /* enabled extensions */
	fido_assert_stmt  *stmt;         /* array of expected assertions */
	size_t             stmt_cnt;     /* number of allocated assertions */
	size_t             stmt_len;     /* number of received assertions */
} fido_assert_t;

typedef struct fido_opt_array {
	char **name;

deps/libfido2/src/fido/types.h  view on Meta::CPAN

	size_t len;
} fido_byte_array_t;

typedef struct fido_cbor_info {
	fido_str_array_t  versions;      /* supported versions: fido2|u2f */
	fido_str_array_t  extensions;    /* list of supported extensions */
	unsigned char     aaguid[16];    /* aaguid */
	fido_opt_array_t  options;       /* list of supported options */
	uint64_t          maxmsgsiz;     /* maximum message size */
	fido_byte_array_t protocols;     /* supported pin protocols */
	uint64_t          maxcredcntlst; /* max number of credentials in list */
	uint64_t          maxcredidlen;  /* max credential ID length */
	uint64_t          fwversion;     /* firmware version */
} fido_cbor_info_t;

typedef struct fido_dev_info {
	char                 *path;         /* device path */
	int16_t               vendor_id;    /* 2-byte vendor id */
	int16_t               product_id;   /* 2-byte product id */
	char                 *manufacturer; /* manufacturer string */
	char                 *product;      /* product string */

deps/libfido2/src/u2f.c  view on Meta::CPAN

			/* FALLTHROUGH */
		case FIDO_ERR_USER_PRESENCE_REQUIRED:
			nfound++;
			break;
		default:
			if (r != FIDO_ERR_CREDENTIAL_EXCLUDED) {
				fido_log_debug("%s: u2f_authenticate_single",
				    __func__);
				return (r);
			}
			/* ignore credentials that don't exist */
		}
	}

	fa->stmt_len = nfound;

	if (nfound == 0)
		return (FIDO_ERR_NO_CREDENTIALS);
	if (nauth_ok == 0)
		return (FIDO_ERR_USER_PRESENCE_REQUIRED);

lib/FIDO/Raw/Assert.pm  view on Meta::CPAN

FIDO2 Assertion

=head1 METHODS

=head2 new( )

Create a new instance.

=head2 allow_cred( $cred )

Append the credential C<$cred> to the list of credentials allowed for this
assertion.

=head2 authdata( [$index = 0, $data] )

Get/set the authenticator data. C<$data> must be a CBOR-encoded byte
string. Alternatively, L<C<authdata_raw>|"authdata_raw"> may be used
to set raw binary blob.

=head2 authdata_raw( $data, [$index = 0] )

lib/FIDO/Raw/Cred.pm  view on Meta::CPAN

=head2 rk( [$opt] )

Get/set the resident key attribute.

=head2 uv( [$opt] )

Get/set the user verification attribute.

=head2 exclude( $cred )

Append the credential ID C<$cred> to the list of excluded credentials.

=head2 authdata( [$data] )

Get/set the authenticator data. C<$data> must be a CBOR-encoded byte
string. Alternatively, L<C<authdata_raw>|"authdata_raw"> may be used
to set raw binary blob.

=head2 authdata_raw( $data )

Set the authenticator data as a raw binary blob.



( run in 0.269 second using v1.01-cache-2.11-cpan-4d50c553e7e )