FIDO-Raw

 view release on metacpan or  search on metacpan

deps/hidapi/linux/hid.c  view on Meta::CPAN

		ret = (wchar_t*) calloc(wlen+1, sizeof(wchar_t));
		mbstowcs(ret, utf8, wlen+1);
		ret[wlen] = 0x0000;
	}

	return ret;
}


/* Set the last global error to be reported by hid_error(NULL).
 * The given error message will be copied (and decoded according to the
 * currently locale, so do not pass in string constants).
 * The last stored global error message is freed.
 * Use register_global_error(NULL) to indicate "no error". */
static void register_global_error(const char *msg)
{
	if (last_global_error_str)
		free(last_global_error_str);

	last_global_error_str = utf8_to_wchar_t(msg);
}


/* Set the last error for a device to be reported by hid_error(device).
 * The given error message will be copied (and decoded according to the
 * currently locale, so do not pass in string constants).
 * The last stored global error message is freed.
 * Use register_device_error(device, NULL) to indicate "no error". */
static void register_device_error(hid_device *dev, const char *msg)
{
	if (dev->last_error_str)
		free(dev->last_error_str);

	dev->last_error_str = utf8_to_wchar_t(msg);
}

deps/libcbor/src/cbor/internal/builder_callbacks.c  view on Meta::CPAN

    /* Top level item */
    ctx->root = item;
  } else {
    /* Part of a bigger structure */
    switch (ctx->stack->top->item->type) {
      case CBOR_TYPE_ARRAY: {
        if (cbor_array_is_definite(ctx->stack->top->item)) {
          /*
           * We don't need an explicit check for whether the item still belongs
           * into this array because if there are extra items, they will cause a
           * syntax error when decoded.
           */
          assert(ctx->stack->top->subitems > 0);
          cbor_array_push(ctx->stack->top->item, item);
          ctx->stack->top->subitems--;
          if (ctx->stack->top->subitems == 0) {
            cbor_item_t *item = ctx->stack->top->item;
            _cbor_stack_pop(ctx->stack);
            _cbor_builder_append(item, ctx);
          }
          cbor_decref(&item);

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

typedef struct fido_cred {
	fido_blob_t       cdh;           /* client data hash */
	fido_rp_t         rp;            /* relying party */
	fido_user_t       user;          /* user entity */
	fido_blob_array_t excl;          /* list of credential ids to exclude */
	fido_opt_t        rk;            /* resident key */
	fido_opt_t        uv;            /* user verification */
	fido_cred_ext_t   ext;           /* extensions */
	int               type;          /* cose algorithm */
	char             *fmt;           /* credential format */
	fido_cred_ext_t   authdata_ext;  /* decoded extensions */
	fido_blob_t       authdata_cbor; /* raw cbor payload */
	fido_authdata_t   authdata;      /* decoded authdata payload */
	fido_attcred_t    attcred;       /* returned credential (key + id) */
	fido_attstmt_t    attstmt;       /* attestation statement (x509 + sig) */
} fido_cred_t;

typedef struct _fido_assert_stmt {
	fido_blob_t     id;              /* credential id */
	fido_user_t     user;            /* user attributes */
	fido_blob_t     hmac_secret_enc; /* hmac secret, encrypted */
	fido_blob_t     hmac_secret;     /* hmac secret */
	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 */



( run in 0.425 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )