.\" Copyright (c) 2011 Yubico AB
.\" All rights reserved.
-.\"
+.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are
.\" met:
-.\"
+.\"
.\" * Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
-.\"
+.\"
.\" * Redistributions in binary form must reproduce the above
.\" copyright notice, this list of conditions and the following
.\" disclaimer in the documentation and/or other materials provided
.\" with the distribution.
-.\"
+.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-.\"
+.\"
.\" The following commands are required for all man pages.
.de URL
\\$2 \(laURL: \\$1 \(ra\\$3
.fi
.SH BUGS
-Report ykchalresp bugs in
+Report ykchalresp bugs in
.URL "https://github.com/Yubico/yubikey-personalization/issues" "the issue tracker"
.SH "SEE ALSO"
-The
+The
.URL "http://code.google.com/p/yubikey-personalization/" "ykpersonalize home page"
.PP
Yubikeys can be obtained from
int check_firmware(YK_KEY *yk, bool verbose)
{
YK_STATUS *st = ykds_alloc();
-
+
if (!yk_get_status(yk, st)) {
free(st);
return 0;
if (verbose) {
fprintf(stderr, "Reading response...\n");
}
-
+
/* HMAC responses are 160 bits, Yubico 128 */
expect_bytes = (hmac == true) ? 20 : 16;
response_len = 20;
if (! hmac && response_len > 16)
response_len = 16;
-
+
memset(output_buf, 0, sizeof(output_buf));
if (hmac) {
yubikey_hex_encode(output_buf, (char *)response, response_len);
*/
if ((cfg->ykcore_config.tktFlags & TKTFLAG_OATH_HOTP) == TKTFLAG_OATH_HOTP)
return 20;
-
+
if ((cfg->ykcore_config.tktFlags & TKTFLAG_CHAL_RESP) == TKTFLAG_CHAL_RESP &&
(cfg->ykcore_config.cfgFlags & CFGFLAG_CHAL_HMAC) == CFGFLAG_CHAL_HMAC) {
return 20;
unsigned char buf[sizeof(cfg->ykcore_config.key) + 4];
int rc;
int key_bytes = _get_supported_key_length(cfg);
-
+
assert (key_bytes <= sizeof(buf));
if (salt) {
struct map_st config_flags_map[] = {
/*
Values used to pretty-print a YKP_CONFIG in ykp_write_config().
-
+
The fourth field is a (tkt)context in which this (cfg)flag is valid.
Some cfgFlags share the same value (e.g. CFGFLAG_STRONG_PW2 and
CFGFLAG_OATH_FIXED_MODHEX2, both 0x40). Obvioulsy, STRONG_PW2 is not