# Interfaces changed/added/removed: CURRENT++ REVISION=0
# Interfaces added: AGE++
# Interfaces removed: AGE=0
-AC_SUBST(LT_CURRENT, 1)
-AC_SUBST(LT_REVISION, 7)
-AC_SUBST(LT_AGE, 0)
+AC_SUBST(LT_CURRENT, 2)
+AC_SUBST(LT_REVISION, 0)
+AC_SUBST(LT_AGE, 1)
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_PROG_CC
rc = yk_errno;
yk_close_key(yk);
yk = NULL;
- } else {
- if (!((st.versionMajor == 1 &&
- (st.versionMinor == 0 ||
- st.versionMinor == 1 ||
- st.versionMinor == 2 ||
- st.versionMinor == 3)) ||
- (st.versionMajor == 2 &&
- (st.versionMinor == 0 ||
- st.versionMinor == 1)))) {
- rc = YK_EFIRMWARE;
- yk_close_key(yk);
- yk = NULL;
- }
}
}
yk_errno = rc;
return _ykusb_close_device(yk);
}
+int yk_check_firmware_version(YK_KEY *k)
+{
+ YK_STATUS st;
+
+ if (!yk_get_status(k, &st))
+ return 0;
+ if (!((st.versionMajor == 1 &&
+ (st.versionMinor == 0 ||
+ st.versionMinor == 1 ||
+ st.versionMinor == 2 ||
+ st.versionMinor == 3)) ||
+ (st.versionMajor == 2 &&
+ (st.versionMinor == 0 ||
+ st.versionMinor == 1)))) {
+ yk_errno = YK_EFIRMWARE;
+ return 0;
+ }
+ return 1;
+}
+
int yk_get_status(YK_KEY *k, YK_STATUS *status)
{
unsigned int status_count = 0;
****/
/* fetches key status into the structure given by `status' */
extern int yk_get_status(YK_KEY *k, YK_STATUS *status /*, int forceUpdate */);
+/* checks that the firmware revision of the key is supported */
+extern int yk_check_firmware_version(YK_KEY *k);
/*************************************************************************
*
else
printf("Unconfigured\n");
+ if (!(yk_check_firmware_version(yk))) {
+ if (yk_errno == YK_EFIRMWARE) {
+ printf("Unsupported firmware revision - some "
+ "features may not be available\n");
+ } else {
+ goto err;
+ }
+ }
+
if (!ykp_configure_for(cfg, 1, st))
goto err;