Merge branch 'pr-128'
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
.deps/
|
.deps/
|
||||||
|
.vagrant/
|
||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ backend to use.
|
|||||||
Recent versions of autoconf, automake, pkg-config and libtool must
|
Recent versions of autoconf, automake, pkg-config and libtool must
|
||||||
be installed. Help2man is used to generate the manpages. Gengetopt
|
be installed. Help2man is used to generate the manpages. Gengetopt
|
||||||
version 2.22.6 or later is needed for command line parameter handling.
|
version 2.22.6 or later is needed for command line parameter handling.
|
||||||
|
The link:vagrant/development[Vagrant VM] has all these dependencies preinstalled.
|
||||||
|
|
||||||
Generate the build system using:
|
Generate the build system using:
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ This module is based on version 2.40 of the PKCS#11 (Cryptoki)
|
|||||||
specifications.
|
specifications.
|
||||||
|
|
||||||
The complete specifications are available at
|
The complete specifications are available at
|
||||||
http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html.
|
https://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html.
|
||||||
|
|
||||||
=== BUILDING
|
=== BUILDING
|
||||||
YKCS11 is automatically built as part of `yubico-piv-tool` and the
|
YKCS11 is automatically built as part of `yubico-piv-tool` and the
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ smartcard, through common interfaces like PKCS#11. This project
|
|||||||
contain the library, tools and PKCS#11 module to interact with the
|
contain the library, tools and PKCS#11 module to interact with the
|
||||||
hardware functionality.
|
hardware functionality.
|
||||||
|
|
||||||
* PIV Standards http://csrc.nist.gov/groups/SNS/piv/standards.html
|
* PIV Standards https://csrc.nist.gov/groups/SNS/piv/standards.html
|
||||||
|
|
||||||
=== General information
|
=== General information
|
||||||
The default PIN code is 123456. The default PUK code is 12345678.
|
The default PIN code is 123456. The default PUK code is 12345678.
|
||||||
|
|||||||
+3
-3
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* From http://article.gmane.org/gmane.os.freebsd.devel.hackers/23606 */
|
/* From https://article.gmane.org/gmane.os.freebsd.devel.hackers/23606 */
|
||||||
static int my_strverscmp (const char *s1, const char *s2)
|
static int my_strverscmp (const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
static const char *digits = "0123456789";
|
static const char *digits = "0123456789";
|
||||||
@@ -66,8 +66,8 @@ static int my_strverscmp (const char *s1, const char *s2)
|
|||||||
* If the common prefix for s1 and s2 consists only of zeros, then the
|
* If the common prefix for s1 and s2 consists only of zeros, then the
|
||||||
* "longer" number has to compare less. Otherwise the comparison needs
|
* "longer" number has to compare less. Otherwise the comparison needs
|
||||||
* to be numerical (just fallthrough). See
|
* to be numerical (just fallthrough). See
|
||||||
* http://refspecs.freestandards.org/LSB_2.0.1/LSB-generic/
|
* https://refspecs.linuxfoundation.org/LSB_2.0.1/LSB-generic/
|
||||||
* LSB-generic/baselib-strverscmp.html
|
* https://refspecs.linuxfoundation.org/LSB_2.0.1/LSB-generic/LSB-generic/baselib-strverscmp.html
|
||||||
*/
|
*/
|
||||||
while (*s1 == '0' && *s2 == '0') {
|
while (*s1 == '0' && *s2 == '0') {
|
||||||
++s1;
|
++s1;
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ path to pkg-config.
|
|||||||
|
|
||||||
_PKG_TEXT
|
_PKG_TEXT
|
||||||
|
|
||||||
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
|
To get pkg-config, see <https://www.freedesktop.org/wiki/Software/pkg-config/>.])],
|
||||||
[$4])
|
[$4])
|
||||||
else
|
else
|
||||||
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
Vagrant VM for development
|
||||||
|
===
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
alice@work $ cd yubico-piv-tool/vagrant/development
|
||||||
|
alice@work $ vagrant up
|
||||||
|
alice@work $ vagrant ssh
|
||||||
|
ubuntu@ubuntu-xenial $ cd /vagrant
|
||||||
|
ubuntu@ubuntu-xenial $ autoreconf --install
|
||||||
|
ubuntu@ubuntu-xenial $ ./configure
|
||||||
|
ubuntu@ubuntu-xenial $ make
|
||||||
|
ubuntu@ubuntu-xenial $ sudo make install
|
||||||
|
ubuntu@ubuntu-xenial $ yubico-piv-tool --help
|
||||||
|
ubuntu@ubuntu-xenial $ exit
|
||||||
|
alice@work $ vagrant destroy
|
||||||
Vendored
+42
@@ -0,0 +1,42 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
|
||||||
|
# Use Ubuntu 16.04 Xenial as a base box.
|
||||||
|
config.vm.box = "ubuntu/xenial64"
|
||||||
|
|
||||||
|
# Install dependencies needed for yubikey-piv-manager development.
|
||||||
|
config.vm.provision "shell", path: "provision.sh"
|
||||||
|
|
||||||
|
# Sync repository to /vagrant
|
||||||
|
config.vm.synced_folder '../..', '/vagrant'
|
||||||
|
|
||||||
|
# VirtualBox configuration
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.name = "yubikey-piv-tool_development"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Uncomment this to add a USB filter for YubiKeys.
|
||||||
|
# This will connect the YubiKey to the VM when re-inserted.
|
||||||
|
# This filter uses VirtualBox as provider.
|
||||||
|
# Modify the paramters as needed depending on the device.
|
||||||
|
|
||||||
|
FILTER_NAME="YubiKey 4"
|
||||||
|
MANUFACTURER="Yubico"
|
||||||
|
VENDOR_ID="0x1050"
|
||||||
|
PRODUCT_ID="0x0407"
|
||||||
|
PRODUCT="Yubikey 4 OTP+U2F+CCID"
|
||||||
|
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.customize ['modifyvm', :id, '--usb', 'on']
|
||||||
|
vb.customize ['usbfilter', 'add', '0',
|
||||||
|
'--target', :id,
|
||||||
|
'--name', FILTER_NAME,
|
||||||
|
'--manufacturer', MANUFACTURER,
|
||||||
|
'--vendorid', VENDOR_ID,
|
||||||
|
'--productid', PRODUCT_ID,
|
||||||
|
'--product', PRODUCT]
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
# Install development dependencies
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -qq software-properties-common
|
||||||
|
sudo add-apt-repository -y ppa:yubico/stable
|
||||||
|
sudo apt-get update -qq && apt-get -qq upgrade
|
||||||
|
sudo apt-get install -qq \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
gengetopt \
|
||||||
|
help2man \
|
||||||
|
libpcsclite-dev \
|
||||||
|
libssl-dev \
|
||||||
|
libtool \
|
||||||
|
libykpiv1 \
|
||||||
|
pkg-config \
|
||||||
|
virtualbox-guest-dkms
|
||||||
+1
-1
@@ -42,7 +42,7 @@
|
|||||||
PURPOSE. */
|
PURPOSE. */
|
||||||
|
|
||||||
/* Please submit changes back to the Scute project at
|
/* Please submit changes back to the Scute project at
|
||||||
http://www.scute.org/ (or send them to marcus@g10code.com), so that
|
https://www.scute.org/ (or send them to marcus@g10code.com), so that
|
||||||
they can be picked up by other projects from there as well. */
|
they can be picked up by other projects from there as well. */
|
||||||
|
|
||||||
/* This file is a modified implementation of the PKCS #11 standard by
|
/* This file is a modified implementation of the PKCS #11 standard by
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ CK_RV parse_readers(ykpiv_state *state, const CK_BYTE_PTR readers, const CK_ULON
|
|||||||
/*
|
/*
|
||||||
* According to pcsc-lite, the format of a reader name is:
|
* According to pcsc-lite, the format of a reader name is:
|
||||||
* name [interface] (serial) index slot
|
* name [interface] (serial) index slot
|
||||||
* http://ludovicrousseau.blogspot.se/2010/05/what-is-in-pcsc-reader-name.html
|
* https://ludovicrousseau.blogspot.se/2010/05/what-is-in-pcsc-reader-name.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user