10afa8e06SEd Maste.\" Copyright (c) 2018 Yubico AB. All rights reserved. 2*2ccfa855SEd Maste.\" 3*2ccfa855SEd Maste.\" Redistribution and use in source and binary forms, with or without 4*2ccfa855SEd Maste.\" modification, are permitted provided that the following conditions are 5*2ccfa855SEd Maste.\" met: 6*2ccfa855SEd Maste.\" 7*2ccfa855SEd Maste.\" 1. Redistributions of source code must retain the above copyright 8*2ccfa855SEd Maste.\" notice, this list of conditions and the following disclaimer. 9*2ccfa855SEd Maste.\" 2. Redistributions in binary form must reproduce the above copyright 10*2ccfa855SEd Maste.\" notice, this list of conditions and the following disclaimer in 11*2ccfa855SEd Maste.\" the documentation and/or other materials provided with the 12*2ccfa855SEd Maste.\" distribution. 13*2ccfa855SEd Maste.\" 14*2ccfa855SEd Maste.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15*2ccfa855SEd Maste.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16*2ccfa855SEd Maste.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17*2ccfa855SEd Maste.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18*2ccfa855SEd Maste.\" HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19*2ccfa855SEd Maste.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20*2ccfa855SEd Maste.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21*2ccfa855SEd Maste.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22*2ccfa855SEd Maste.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23*2ccfa855SEd Maste.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24*2ccfa855SEd Maste.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25*2ccfa855SEd Maste.\" 26*2ccfa855SEd Maste.\" SPDX-License-Identifier: BSD-2-Clause 270afa8e06SEd Maste.\" 280afa8e06SEd Maste.Dd $Mdocdate: May 25 2018 $ 290afa8e06SEd Maste.Dt FIDO_DEV_SET_PIN 3 300afa8e06SEd Maste.Os 310afa8e06SEd Maste.Sh NAME 320afa8e06SEd Maste.Nm fido_dev_set_pin , 330afa8e06SEd Maste.Nm fido_dev_get_retry_count , 340afa8e06SEd Maste.Nm fido_dev_get_uv_retry_count , 350afa8e06SEd Maste.Nm fido_dev_reset 360afa8e06SEd Maste.Nd FIDO2 device management functions 370afa8e06SEd Maste.Sh SYNOPSIS 380afa8e06SEd Maste.In fido.h 390afa8e06SEd Maste.Ft int 400afa8e06SEd Maste.Fn fido_dev_set_pin "fido_dev_t *dev" "const char *pin" "const char *oldpin" 410afa8e06SEd Maste.Ft int 420afa8e06SEd Maste.Fn fido_dev_get_retry_count "fido_dev_t *dev" "int *retries" 430afa8e06SEd Maste.Ft int 440afa8e06SEd Maste.Fn fido_dev_get_uv_retry_count "fido_dev_t *dev" "int *retries" 450afa8e06SEd Maste.Ft int 460afa8e06SEd Maste.Fn fido_dev_reset "fido_dev_t *dev" 470afa8e06SEd Maste.Sh DESCRIPTION 480afa8e06SEd MasteThe 490afa8e06SEd Maste.Fn fido_dev_set_pin 500afa8e06SEd Mastefunction sets the PIN of device 510afa8e06SEd Maste.Fa dev 520afa8e06SEd Masteto 530afa8e06SEd Maste.Fa pin , 540afa8e06SEd Mastewhere 550afa8e06SEd Maste.Fa pin 560afa8e06SEd Masteis a NUL-terminated UTF-8 string. 570afa8e06SEd MasteIf 580afa8e06SEd Maste.Fa oldpin 590afa8e06SEd Masteis not NULL, the device's PIN is changed from 600afa8e06SEd Maste.Fa oldpin 610afa8e06SEd Masteto 620afa8e06SEd Maste.Fa pin , 630afa8e06SEd Mastewhere 640afa8e06SEd Maste.Fa pin 650afa8e06SEd Masteand 660afa8e06SEd Maste.Fa oldpin 670afa8e06SEd Masteare NUL-terminated UTF-8 strings. 680afa8e06SEd Maste.Pp 690afa8e06SEd MasteThe 700afa8e06SEd Maste.Fn fido_dev_get_retry_count 710afa8e06SEd Mastefunction fills 720afa8e06SEd Maste.Fa retries 730afa8e06SEd Mastewith the number of PIN retries left in 740afa8e06SEd Maste.Fa dev 750afa8e06SEd Mastebefore lock-out, where 760afa8e06SEd Maste.Fa retries 770afa8e06SEd Masteis an addressable pointer. 780afa8e06SEd Maste.Pp 790afa8e06SEd MasteThe 800afa8e06SEd Maste.Fn fido_dev_get_uv_retry_count 810afa8e06SEd Mastefunction fills 820afa8e06SEd Maste.Fa retries 830afa8e06SEd Mastewith the number of built-in UV retries left in 840afa8e06SEd Maste.Fa dev 850afa8e06SEd Mastebefore built-in UV is disabled, where 860afa8e06SEd Maste.Fa retries 870afa8e06SEd Masteis an addressable pointer. 880afa8e06SEd Maste.Pp 890afa8e06SEd MasteThe 900afa8e06SEd Maste.Fn fido_dev_reset 910afa8e06SEd Mastefunction performs a reset on 920afa8e06SEd Maste.Fa dev , 930afa8e06SEd Masteresetting the device's PIN and erasing credentials stored on the 940afa8e06SEd Mastedevice. 950afa8e06SEd Maste.Pp 960afa8e06SEd MastePlease note that 970afa8e06SEd Maste.Fn fido_dev_set_pin , 980afa8e06SEd Maste.Fn fido_dev_get_retry_count , 990afa8e06SEd Maste.Fn fido_dev_get_uv_retry_count , 1000afa8e06SEd Masteand 1010afa8e06SEd Maste.Fn fido_dev_reset 1020afa8e06SEd Masteare synchronous and will block if necessary. 1030afa8e06SEd Maste.Sh RETURN VALUES 1040afa8e06SEd MasteThe error codes returned by 1050afa8e06SEd Maste.Fn fido_dev_set_pin , 1060afa8e06SEd Maste.Fn fido_dev_get_retry_count , 1070afa8e06SEd Maste.Fn fido_dev_get_uv_retry_count , 1080afa8e06SEd Masteand 1090afa8e06SEd Maste.Fn fido_dev_reset 1100afa8e06SEd Masteare defined in 1110afa8e06SEd Maste.In fido/err.h . 1120afa8e06SEd MasteOn success, 1130afa8e06SEd Maste.Dv FIDO_OK 1140afa8e06SEd Masteis returned. 115*2ccfa855SEd Maste.Sh SEE ALSO 116*2ccfa855SEd Maste.Xr fido_cbor_info_uv_attempts 3 1170afa8e06SEd Maste.Sh CAVEATS 1180afa8e06SEd MasteRegarding 1190afa8e06SEd Maste.Fn fido_dev_reset , 1200afa8e06SEd Mastethe actual user-flow to perform a reset is outside the scope of the 1210afa8e06SEd MasteFIDO2 specification, and may therefore vary depending on the 1220afa8e06SEd Masteauthenticator. 1230afa8e06SEd MasteYubico authenticators will return 1240afa8e06SEd Maste.Dv FIDO_ERR_NOT_ALLOWED 1250afa8e06SEd Masteif a reset is issued later than 5 seconds after power-up, and 1260afa8e06SEd Maste.Dv FIDO_ERR_ACTION_TIMEOUT 1270afa8e06SEd Masteif the user fails to confirm the reset by touching the key 1280afa8e06SEd Mastewithin 30 seconds. 129