From 73dfa7b48ba90d26f7f7c4cccf2c43d37b49cd3b Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Mon, 16 Oct 2017 16:52:25 +0200 Subject: [PATCH 1/3] Add Vagrant VM for development --- .gitignore | 1 + README | 1 + vagrant/development/README.md | 16 ++++++++++++ vagrant/development/Vagrantfile | 42 ++++++++++++++++++++++++++++++++ vagrant/development/provision.sh | 18 ++++++++++++++ 5 files changed, 78 insertions(+) create mode 100644 vagrant/development/README.md create mode 100644 vagrant/development/Vagrantfile create mode 100644 vagrant/development/provision.sh diff --git a/.gitignore b/.gitignore index f8f3c14..6312246 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .deps/ +.vagrant/ Makefile Makefile.in aclocal.m4 diff --git a/README b/README index d571154..1900629 100644 --- a/README +++ b/README @@ -70,6 +70,7 @@ backend to use. Recent versions of autoconf, automake, pkg-config and libtool must be installed. Help2man is used to generate the manpages. Gengetopt version 2.22.6 or later is needed for command line parameter handling. +The [Vagrant VM](vagrant/development) has all these dependencies preinstalled. Generate the build system using: diff --git a/vagrant/development/README.md b/vagrant/development/README.md new file mode 100644 index 0000000..61eddc4 --- /dev/null +++ b/vagrant/development/README.md @@ -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 diff --git a/vagrant/development/Vagrantfile b/vagrant/development/Vagrantfile new file mode 100644 index 0000000..e5ce751 --- /dev/null +++ b/vagrant/development/Vagrantfile @@ -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 diff --git a/vagrant/development/provision.sh b/vagrant/development/provision.sh new file mode 100644 index 0000000..c56292d --- /dev/null +++ b/vagrant/development/provision.sh @@ -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 From de61b83b4c496cae7bcbafe9885f920c75b26c69 Mon Sep 17 00:00:00 2001 From: Emil Lundberg Date: Mon, 16 Oct 2017 16:59:26 +0200 Subject: [PATCH 2/3] Fix Vagrant VM link in README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 1900629..25a49f2 100644 --- a/README +++ b/README @@ -70,7 +70,7 @@ backend to use. Recent versions of autoconf, automake, pkg-config and libtool must be installed. Help2man is used to generate the manpages. Gengetopt version 2.22.6 or later is needed for command line parameter handling. -The [Vagrant VM](vagrant/development) has all these dependencies preinstalled. +The link:vagrant/development[Vagrant VM] has all these dependencies preinstalled. Generate the build system using: From ea006783145e6214d944b81f9ba950bcddeefcd8 Mon Sep 17 00:00:00 2001 From: edent Date: Tue, 17 Oct 2017 08:02:02 +0100 Subject: [PATCH 3/3] http->https --- doc/YKCS11_release_notes.adoc | 2 +- doc/YubiKey_PIV_introduction.adoc | 2 +- lib/version.c | 6 +++--- m4/pkg.m4 | 2 +- ykcs11/pkcs11.h | 2 +- ykcs11/utils.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/YKCS11_release_notes.adoc b/doc/YKCS11_release_notes.adoc index 9f8c600..f2feeb5 100644 --- a/doc/YKCS11_release_notes.adoc +++ b/doc/YKCS11_release_notes.adoc @@ -6,7 +6,7 @@ This module is based on version 2.40 of the PKCS#11 (Cryptoki) specifications. 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 YKCS11 is automatically built as part of `yubico-piv-tool` and the diff --git a/doc/YubiKey_PIV_introduction.adoc b/doc/YubiKey_PIV_introduction.adoc index 793136e..ebf3f39 100644 --- a/doc/YubiKey_PIV_introduction.adoc +++ b/doc/YubiKey_PIV_introduction.adoc @@ -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 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 The default PIN code is 123456. The default PUK code is 12345678. diff --git a/lib/version.c b/lib/version.c index 286aff9..89fe4ab 100644 --- a/lib/version.c +++ b/lib/version.c @@ -34,7 +34,7 @@ #include -/* 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 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 * "longer" number has to compare less. Otherwise the comparison needs * to be numerical (just fallthrough). See - * http://refspecs.freestandards.org/LSB_2.0.1/LSB-generic/ - * LSB-generic/baselib-strverscmp.html + * https://refspecs.linuxfoundation.org/LSB_2.0.1/LSB-generic/ + * https://refspecs.linuxfoundation.org/LSB_2.0.1/LSB-generic/LSB-generic/baselib-strverscmp.html */ while (*s1 == '0' && *s2 == '0') { ++s1; diff --git a/m4/pkg.m4 b/m4/pkg.m4 index 0048a3f..f77a534 100644 --- a/m4/pkg.m4 +++ b/m4/pkg.m4 @@ -146,7 +146,7 @@ path to pkg-config. _PKG_TEXT -To get pkg-config, see .])], +To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS diff --git a/ykcs11/pkcs11.h b/ykcs11/pkcs11.h index 97685e4..80f0201 100644 --- a/ykcs11/pkcs11.h +++ b/ykcs11/pkcs11.h @@ -42,7 +42,7 @@ PURPOSE. */ /* 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. */ /* This file is a modified implementation of the PKCS #11 standard by diff --git a/ykcs11/utils.c b/ykcs11/utils.c index fe15765..ac4dcc8 100644 --- a/ykcs11/utils.c +++ b/ykcs11/utils.c @@ -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: * 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++)