diff options
author | Guillaume Ballet <gballet@gmail.com> | 2019-05-31 17:30:28 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-05-31 17:30:28 +0800 |
commit | 7a22da98b9f81d206eb65d1fa4f5e773d888bac3 (patch) | |
tree | 3a28f61d12c7b43e5ab4a5b5c7ed2c9e8cbf8a94 /vendor | |
parent | 30263ad37d49c014512a9a7d8abdd17f305843e9 (diff) | |
download | go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.gz go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.bz2 go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.lz go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.xz go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.tar.zst go-tangerine-7a22da98b9f81d206eb65d1fa4f5e773d888bac3.zip |
accounts/scwallet: flag to specify path to smartcard daemon (#19439)
* accounts/scwallet: Add a switch to enable smartcard support
* accounts: change the meaning of the switch
* disable card support in windows until tested
* only activate account if pcscd socket file is present
* the switch is now the path to the socket file
* accounts/scwallet: holiman's review feedback
* accounts/scwallet: send the path to go-pcsclite
* accounts/scwallet: add default, per platform path
* accounts/scwallet: fix error log warning
* accounts/scwallet: update pcsc lib to latest
* accounts/scwallet: use default path from pcsclite
* scwallet: forgot to change switch name
* cmd: minor style cleanups (error handling first, then happy path)
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/gballet/go-libpcsclite/doc.go | 2 | ||||
-rw-r--r-- | vendor/github.com/gballet/go-libpcsclite/doc_bsd.go | 35 | ||||
-rw-r--r-- | vendor/github.com/gballet/go-libpcsclite/doc_linux.go | 35 | ||||
-rw-r--r-- | vendor/github.com/gballet/go-libpcsclite/doc_windows.go | 35 | ||||
-rw-r--r-- | vendor/github.com/gballet/go-libpcsclite/msg.go | 10 | ||||
-rw-r--r-- | vendor/github.com/gballet/go-libpcsclite/winscard.go | 4 | ||||
-rw-r--r-- | vendor/vendor.json | 6 |
7 files changed, 117 insertions, 10 deletions
diff --git a/vendor/github.com/gballet/go-libpcsclite/doc.go b/vendor/github.com/gballet/go-libpcsclite/doc.go index d1085319a..0f28c0c9c 100644 --- a/vendor/github.com/gballet/go-libpcsclite/doc.go +++ b/vendor/github.com/gballet/go-libpcsclite/doc.go @@ -61,8 +61,6 @@ const ( SCardPowever = 0x0010 /* Card is powered */ SCardNegotiable = 0x0020 /* Ready for PTS */ SCardSpecific = 0x0040 /* PTS has been set */ - - PCSCDSockName = "/run/pcscd/pcscd.comm" ) // List of commands to send to the daemon diff --git a/vendor/github.com/gballet/go-libpcsclite/doc_bsd.go b/vendor/github.com/gballet/go-libpcsclite/doc_bsd.go new file mode 100644 index 000000000..ddec46c67 --- /dev/null +++ b/vendor/github.com/gballet/go-libpcsclite/doc_bsd.go @@ -0,0 +1,35 @@ +// BSD 3-Clause License +// +// Copyright (c) 2019, Guillaume Ballet +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +build dragonfly darwin freebsd netbsd openbsd solaris + +package pcsc + +const PCSCDSockName string = "/var/run/pcscd/pcscd.comm"
\ No newline at end of file diff --git a/vendor/github.com/gballet/go-libpcsclite/doc_linux.go b/vendor/github.com/gballet/go-libpcsclite/doc_linux.go new file mode 100644 index 000000000..becbf1677 --- /dev/null +++ b/vendor/github.com/gballet/go-libpcsclite/doc_linux.go @@ -0,0 +1,35 @@ +// BSD 3-Clause License +// +// Copyright (c) 2019, Guillaume Ballet +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +build linux + +package pcsc + +const PCSCDSockName string = "/run/pcscd/pcscd.comm"
\ No newline at end of file diff --git a/vendor/github.com/gballet/go-libpcsclite/doc_windows.go b/vendor/github.com/gballet/go-libpcsclite/doc_windows.go new file mode 100644 index 000000000..9bd6bd333 --- /dev/null +++ b/vendor/github.com/gballet/go-libpcsclite/doc_windows.go @@ -0,0 +1,35 @@ +// BSD 3-Clause License +// +// Copyright (c) 2019, Guillaume Ballet +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// +build windows + +package pcsc + +const PCSCDSockName string = "" diff --git a/vendor/github.com/gballet/go-libpcsclite/msg.go b/vendor/github.com/gballet/go-libpcsclite/msg.go index 53f543530..1377082b1 100644 --- a/vendor/github.com/gballet/go-libpcsclite/msg.go +++ b/vendor/github.com/gballet/go-libpcsclite/msg.go @@ -62,7 +62,7 @@ func messageSendWithHeader(command uint32, conn net.Conn, data []byte) error { return err } -// ClientSetupSession prepares a communication channel for the client to talk to the server. +// clientSetupSession prepares a communication channel for the client to talk to the server. // This is called by the application to create a socket for local IPC with the // server. The socket is associated to the file \c PCSCLITE_CSOCK_NAME. /* @@ -73,6 +73,10 @@ func messageSendWithHeader(command uint32, conn net.Conn, data []byte) error { * @retval -1 The socket can not open a connection. * @retval -1 Can not set the socket to non-blocking. */ -func clientSetupSession() (net.Conn, error) { - return net.Dial("unix", PCSCDSockName) +func clientSetupSession(daemonPath string) (net.Conn, error) { + path := PCSCDSockName + if len(daemonPath) > 0 { + path = daemonPath + } + return net.Dial("unix", path) } diff --git a/vendor/github.com/gballet/go-libpcsclite/winscard.go b/vendor/github.com/gballet/go-libpcsclite/winscard.go index e4692ed16..b916db162 100644 --- a/vendor/github.com/gballet/go-libpcsclite/winscard.go +++ b/vendor/github.com/gballet/go-libpcsclite/winscard.go @@ -56,10 +56,10 @@ type Client struct { // EstablishContext asks the PCSC daemon to create a context // handle for further communication with connected cards and // readers. -func EstablishContext(scope uint32) (*Client, error) { +func EstablishContext(path string, scope uint32) (*Client, error) { client := &Client{} - conn, err := clientSetupSession() + conn, err := clientSetupSession(path) if err != nil { return nil, err } diff --git a/vendor/vendor.json b/vendor/vendor.json index b3e111800..a33a1d4e2 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -135,10 +135,10 @@ "revisionTime": "2018-04-18T12:24:29Z" }, { - "checksumSHA1": "GXqHzd0XkPLX/iulpOncaxbxzZo=", + "checksumSHA1": "+fiJGimxPPRSfi9sED4Lp6ytBeo=", "path": "github.com/gballet/go-libpcsclite", - "revision": "312b5175032f98274685a4dd81935a92ad2412a5", - "revisionTime": "2019-04-03T18:15:18Z" + "revision": "2fd9b619dd3c5d74acbd975f997a6441984d74a7", + "revisionTime": "2019-05-28T10:50:17Z" }, { "checksumSHA1": "gxV/cPPLkByTdY8y172t7v4qcZA=", |