Skip to content

Commit

Permalink
examples: format cred example
Browse files Browse the repository at this point in the history
  • Loading branch information
LDVG committed Jul 3, 2023
1 parent 2eb4138 commit c8bd4e8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/cred.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2022 Yubico AB. All rights reserved.
* Copyright (c) 2018-2023 Yubico AB. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
* SPDX-License-Identifier: BSD-2-Clause
Expand Down Expand Up @@ -44,7 +44,8 @@ usage(void)
static void
verify_cred(int type, const char *fmt, const unsigned char *authdata_ptr,
size_t authdata_len, const unsigned char *attstmt_ptr, size_t attstmt_len,
bool rk, bool uv, int ext, long long cred_protect, const char *key_out, const char *id_out)
bool rk, bool uv, int ext, int cred_protect, const char *key_out,
const char *id_out)
{
fido_cred_t *cred;
int r;
Expand Down Expand Up @@ -288,7 +289,8 @@ main(int argc, char **argv)
errx(1, "fido_cred_set_uv: %s (0x%x)", fido_strerr(r), r);

/* credProt */
if (cred_protect != 0 && (r = fido_cred_set_prot(cred, (int)cred_protect)) != FIDO_OK)
if (cred_protect != 0 && (r = fido_cred_set_prot(cred,
(int)cred_protect)) != FIDO_OK)
errx(1, "fido_cred_set_prot: %s (0x%x)", fido_strerr(r), r);

/* timeout */
Expand All @@ -312,7 +314,8 @@ main(int argc, char **argv)

verify_cred(type, fido_cred_fmt(cred), fido_cred_authdata_ptr(cred),
fido_cred_authdata_len(cred), fido_cred_attstmt_ptr(cred),
fido_cred_attstmt_len(cred), rk, uv, ext, cred_protect, key_out, id_out);
fido_cred_attstmt_len(cred), rk, uv, ext, fido_cred_prot(cred),
key_out, id_out);

if (blobkey_out != NULL) {
/* extract the "largeBlob" key */
Expand Down

0 comments on commit c8bd4e8

Please sign in to comment.