Yubikey-personalize NEWS -- History of user-visible changes. -*- outline -*-
-* Version 1.9.1 (unreleased)
+* Version 1.10.0 (unreleased)
* Version 1.9.0 (released 2012-11-08)
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-AC_INIT([yubikey-personalization], [1.9.1],
+AC_INIT([yubikey-personalization], [1.10.0],
[yubico-devel@googlegroups.com], [ykpers],
[http://code.google.com/p/yubikey-personalization/])
AC_CONFIG_AUX_DIR([build-aux])
# Interfaces changed/added/removed: CURRENT++ REVISION=0
# Interfaces added: AGE++
# Interfaces removed: AGE=0
-AC_SUBST(LT_CURRENT, 10)
-AC_SUBST(LT_REVISION, 1)
-AC_SUBST(LT_AGE, 9)
+AC_SUBST(LT_CURRENT, 11)
+AC_SUBST(LT_REVISION, 0)
+AC_SUBST(LT_AGE, 10)
AM_INIT_AUTOMAKE([-Wall -Werror])
AM_SILENT_RULES([yes])
yk_hmac_sha1;
# Variables:
} LIBYKPERS_1.8;
+
+LIBYKPERS_1.10 {
+ global:
+# Functions:
+ yk_write_ndef2;
+# Variables:
+} LIBYKPERS_1.9;
}
int yk_write_ndef(YK_KEY *yk, YK_NDEF *ndef)
+{
+ /* just wrap yk_write_ndef2() with confnum 1 */
+ return yk_write_ndef2(yk, ndef, 1);
+}
+
+int yk_write_ndef2(YK_KEY *yk, YK_NDEF *ndef, int confnum)
{
unsigned char buf[sizeof(YK_NDEF)];
YK_STATUS stat;
int seq;
+ uint8_t command;
/* Get current sequence # from status block */
seq = stat.pgmSeq;
+ switch(confnum) {
+ case 1:
+ command = SLOT_NDEF;
+ break;
+ case 2:
+ command = SLOT_NDEF2;
+ break;
+ default:
+ yk_errno = YK_EINVALIDCMD;
+ return 0;
+ }
+
/* Insert config block in buffer */
memset(buf, 0, sizeof(buf));
memcpy(buf, ndef, sizeof(YK_NDEF));
/* Write to Yubikey */
- if (!yk_write_to_key(yk, SLOT_NDEF, buf, sizeof(buf)))
+ if (!yk_write_to_key(yk, command, buf, sizeof(buf)))
return 0;
/* When the Yubikey clears the SLOT_WRITE_FLAG, it has processed the last write.
/* wrapper function of yk_write_command */
extern int yk_write_config(YK_KEY *k, YK_CONFIG *cfg, int confnum,
unsigned char *acc_code);
-/* writes the given ndef to the key. */
+/* writes the given ndef to the key as SLOT_NDEF */
extern int yk_write_ndef(YK_KEY *yk, YK_NDEF *ndef);
+/* writes the given ndef to the key. */
+extern int yk_write_ndef2(YK_KEY *yk, YK_NDEF *ndef, int confnum);
/* Write something to the YubiKey (a command that is). */
extern int yk_write_to_key(YK_KEY *yk, uint8_t slot, const void *buf, int bufcount);
/* Do a challenge-response round with the key. */
#define SLOT_UPDATE2 5 /* Update slot 2 */
#define SLOT_SWAP 6 /* Swap slot 1 and 2 */
#define SLOT_NDEF 8 /* Write NDEF record */
+#define SLOT_NDEF2 9 /* Write NDEF record for slot 2 */
#define SLOT_DEVICE_SERIAL 0x10 /* Device serial number */
return 0;
}
break;
+ case SLOT_NDEF2:
+ if (!(cfg->yk_major_version == 3)) {
+ ykp_errno = YKP_EYUBIKEYVER;
+ return 0;
+ }
case SLOT_NDEF:
/* NDEF is available for neo, thus within 2.1 from build 4 */
if (!((cfg->yk_major_version == 2 && cfg->yk_minor_version == 1 &&
LIBYUBIKEYVERSION=1.9
PROJECT=yubikey-personalization
PACKAGE=ykpers
-VERSION=1.9.1
+VERSION=1.10.0
all: usage ykpers4win32 ykpers4win64