This commit is contained in:
NIIBE Yutaka
2015-09-09 13:13:05 +09:00
parent fa8bc533a3
commit 748c3cac6c
4 changed files with 29 additions and 18 deletions

View File

@@ -1,5 +1,10 @@
2015-09-08 Niibe Yutaka <gniibe@fsij.org>
* src/gnuk.h (EV_RESET, LED_RESET): New.
* src/usb_ctrl.c (CDC_CTRL_DTR): New.
(vcom_port_data_setup): Distinguish detail->value for DTR.
* src/configure (help): Add ST_DONGLE and ST_NUCLEO_F103.
2015-09-04 Niibe Yutaka <gniibe@fsij.org>

2
NEWS
View File

@@ -5,7 +5,7 @@ Gnuk NEWS - User visible changes
Released 2015-09-??, by NIIBE Yutaka
** Upgrade of Chopstx
We use Chopstx 0.09, which supports Nitroky-Start.
We use Chopstx 0.09, which supports Nitrokey-Start.
** Card serial number
The way to determine a serial number of Gnuk Token for card has been

View File

@@ -24,17 +24,18 @@ extern struct apdu apdu;
void ccid_card_change_signal (int how);
/* CCID thread */
#define EV_RX_DATA_READY (1) /* USB Rx data available */
#define EV_EXEC_FINISHED (2) /* OpenPGP Execution finished */
#define EV_TX_FINISHED (4) /* CCID Tx finished */
#define EV_CARD_CHANGE (8)
#define EV_RX_DATA_READY 1 /* USB Rx data available */
#define EV_EXEC_FINISHED 2 /* OpenPGP Execution finished */
#define EV_TX_FINISHED 4 /* CCID Tx finished */
#define EV_CARD_CHANGE 8
#define EV_RESET 16
/* OpenPGPcard thread */
#define EV_PINPAD_INPUT_DONE (1)
#define EV_EXIT (2)
#define EV_CMD_AVAILABLE (4)
#define EV_VERIFY_CMD_AVAILABLE (8)
#define EV_MODIFY_CMD_AVAILABLE (16)
#define EV_PINPAD_INPUT_DONE 1
#define EV_EXIT 2
#define EV_CMD_AVAILABLE 4
#define EV_VERIFY_CMD_AVAILABLE 8
#define EV_MODIFY_CMD_AVAILABLE 16
/* Maximum cmd apdu data is key import 24+4+256+256 (proc_key_import) */
#define MAX_CMD_APDU_DATA_SIZE (24+4+256+256) /* without header */
@@ -416,12 +417,13 @@ void flash_do_write_internal (const uint8_t *p, int nr,
extern const uint8_t gnuk_string_serial[];
#define LED_ONESHOT (1)
#define LED_TWOSHOTS (2)
#define LED_SHOW_STATUS (4)
#define LED_START_COMMAND (8)
#define LED_FINISH_COMMAND (16)
#define LED_FATAL (32)
#define LED_ONESHOT 1
#define LED_TWOSHOTS 2
#define LED_SHOW_STATUS 4
#define LED_START_COMMAND 8
#define LED_FINISH_COMMAND 16
#define LED_FATAL 32
#define LED_RESET 64
void led_blink (int spec);
#if defined(PINPAD_SUPPORT)

View File

@@ -1,7 +1,8 @@
/*
* usb_ctrl.c - USB control pipe device specific code for Gnuk
*
* Copyright (C) 2010, 2011, 2012, 2013 Free Software Initiative of Japan
* Copyright (C) 2010, 2011, 2012, 2013, 2015
* Free Software Initiative of Japan
* Author: NIIBE Yutaka <gniibe@fsij.org>
*
* This file is a part of Gnuk, a GnuPG USB Token implementation.
@@ -57,6 +58,8 @@ static struct line_coding line_coding = {
0x08 /* bits: 8 */
};
#define CDC_CTRL_DTR 0x0001
static int
vcom_port_data_setup (uint8_t req, uint8_t req_no, struct control_info *detail)
{
@@ -76,7 +79,7 @@ vcom_port_data_setup (uint8_t req, uint8_t req_no, struct control_info *detail)
{
uint8_t connected_saved = stdout.connected;
if (detail->value != 0)
if ((detail->value & CDC_CTRL_DTR) != 0)
{
if (stdout.connected == 0)
/* It's Open call */
@@ -212,6 +215,7 @@ usb_cb_device_reset (void)
gnuk_setup_endpoints_for_interface (i, 0);
bDeviceState = ATTACHED;
led_blink (LED_RESET); /* Notify the main. */
}
#define USB_CCID_REQ_ABORT 0x01