Ticket #52493: yubico-piv-tool.patch

File yubico-piv-tool.patch, 2.9 KB (added by lbschenkel (Leonardo Brondani Schenkel), 8 years ago)
  • new file yubico-piv-tool/Portfile

    diff --git a/yubico-piv-tool/Portfile b/yubico-piv-tool/Portfile
    new file mode 100644
    - +  
     1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
     2# $Id$
     3
     4PortSystem          1.0
     5PortGroup           github 1.0
     6
     7github.setup        Yubico yubico-piv-tool ae63ca7ce854c0e03cf30a74d191b01ea63529cd
     8version             1.4.3-pre-20161003
     9categories          security
     10platforms           darwin
     11license             GPL-2
     12maintainers         schenkel.net:leonardo openmaintainer
     13
     14description         Command line tool for the YubiKey PIV application
     15long_description    \
     16    The Yubico PIV tool is used for interacting with the Privilege and \
     17    Identification Card (PIV) application on a YubiKey.\
     18    With it you may generate keys on the device, importing keys and \
     19    certificates, and create certificate requests, and other operations. \
     20    A shared library and a command-line tool is included.
     21homepage            https://developers.yubico.com/yubico-piv-tool
     22
     23checksums           rmd160  cb12eb38294b6e742b227d87b7de3ca4205f91e7 \
     24                    sha256  1342bb25f43ed7d3857d812cda1ce46b72786a063c1eb632c583e657f481cb72
     25
     26depends_build       port:help2man
     27depends_lib         lib:libcrypto:openssl
     28
     29patchfiles          patch-num-slots.diff
     30patch.args          -p1
     31use_autoreconf      yes
     32
     33post-destroot {
     34    # symlink PKCS#11 module in the standard pkcs11 module directory
     35    set p11kit_module_path ${prefix}/lib/pkcs11
     36    xinstall -d ${destroot}${p11kit_module_path}
     37    ln -s ${prefix}/lib/libykcs11.dylib \
     38          ${destroot}${p11kit_module_path}/libykcs11.so
     39
     40    # register PKCS#11 module so it will be auto-discovered by p11-kit
     41    set p11kit_module_configs ${prefix}/share/p11-kit/modules
     42    xinstall -d ${destroot}/${p11kit_module_configs}
     43    xinstall ${filespath}/p11-kit.module \
     44             ${destroot}${p11kit_module_configs}/${name}.module
     45}
     46
  • new file yubico-piv-tool/files/p11-kit.module

    diff --git a/yubico-piv-tool/files/p11-kit.module b/yubico-piv-tool/files/p11-kit.module
    new file mode 100644
    - +  
     1module: libykcs11.so
     2
  • new file yubico-piv-tool/files/patch-num-slots.diff

    diff --git a/yubico-piv-tool/files/patch-num-slots.diff b/yubico-piv-tool/files/patch-num-slots.diff
    new file mode 100644
    - +  
     1--- a/ykcs11/ykcs11.c
     2+++ b/ykcs11/ykcs11.c
     3@@ -198,14 +198,17 @@ CK_DEFINE_FUNCTION(CK_RV, C_GetSlotList)(
     4     return CKR_CRYPTOKI_NOT_INITIALIZED;
     5   }
     6
     7-  if (pSlotList == NULL_PTR) {
     8-    // Just return the number of slots
     9+  if (pulCount) {
     10     *pulCount = n_slots;
     11
     12     if (tokenPresent)
     13       *pulCount = n_slots_with_token;
     14     else
     15       *pulCount = n_slots;
     16+  }
     17+
     18+  if (pSlotList == NULL_PTR) {
     19+    // Just return the number of slots
     20
     21     DOUT;
     22     return CKR_OK;
     23 No newline at end of file