pub unsafe fn ykpiv_get_pin_retries(state: *mut YubiKey, tries: *mut i32) -> ErrorKind {
    if state.is_null() || tries.is_null() {
        return ErrorKind::ArgumentError;
    }

    // Force a re-select to unverify, because once verified the spec dictates that
    // subsequent verify calls will return a "verification not needed" instead of
    // the number of tries left...
    let res = _ykpiv_select_application(state);

    if res != ErrorKind::Ok {
        return res;
    }

    let ykrc = ykpiv_verify(state, ptr::null(), tries);

    // WRONG_PIN is expected on successful query.
    if ykrc == ErrorKind::WrongPin {
        ErrorKind::Ok
    } else {
        ykrc
    }
}
/// Get the number of PIN retries
Get the number of PIN retries
Get the number of PIN retries
pub unsafe fn ykpiv_get_pin_retries(state: *mut YubiKey, tries: *mut i32) -> ErrorKind {
    if state.is_null() || tries.is_null() {
        return ErrorKind::ArgumentError;
    }
    // Force a re-select to unverify, because once verified the spec dictates that
    // subsequent verify calls will return a "verification not needed" instead of
    // the number of tries left...
    let res = _ykpiv_select_application(state);
    if res != ErrorKind::Ok {
        return res;
    }
    let ykrc = ykpiv_verify(state, ptr::null(), tries);
    // WRONG_PIN is expected on successful query.
    if ykrc == ErrorKind::WrongPin {
        ErrorKind::Ok
    } else {
        ykrc
    }
}
pub unsafe fn ykpiv_get_pin_retries ( state : * mut YubiKey , tries : * mut i32 ) -> ErrorKind { if state . is_null ( ) || tries . is_null ( ) { return ErrorKind :: ArgumentError ; } // Force a re-select to unverify, because once verified the spec dictates that // subsequent verify calls will return a "verification not needed" instead of // the number of tries left... let res = _ykpiv_select_application ( state ) ; if res != ErrorKind :: Ok { return res ; } let ykrc = ykpiv_verify ( state , ptr :: null ( ) , tries ) ; // WRONG_PIN is expected on successful query. if ykrc == ErrorKind :: WrongPin { ErrorKind :: Ok } else { ykrc } }
Get the number of PIN retries
Get the number of PIN retries
state
*mut YubiKey
tries
*mut i32