mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
accounts/scwallet: add default, per platform path
This commit is contained in:
parent
b038a6a727
commit
b82300a5b9
5 changed files with 89 additions and 17 deletions
|
|
@ -130,8 +130,8 @@ var (
|
||||||
}
|
}
|
||||||
SmartCardFlag = cli.StringFlag{
|
SmartCardFlag = cli.StringFlag{
|
||||||
Name: "pcscd-sock",
|
Name: "pcscd-sock",
|
||||||
Usage: "Path to the smartcard daemon (pcscd) socket file (linux only)",
|
Usage: "Path to the smartcard daemon (pcscd) socket file (unix only, leave empty for platform default)",
|
||||||
Value: "/run/pcscd/pcscd.comm",
|
Value: "",
|
||||||
}
|
}
|
||||||
NetworkIdFlag = cli.Uint64Flag{
|
NetworkIdFlag = cli.Uint64Flag{
|
||||||
Name: "networkid",
|
Name: "networkid",
|
||||||
|
|
@ -1153,16 +1153,20 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
|
||||||
func setSmartCard(ctx *cli.Context, cfg *node.Config) {
|
func setSmartCard(ctx *cli.Context, cfg *node.Config) {
|
||||||
// No support for windows, currently
|
// No support for windows, currently
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
// Check for the existence of the PCSCD socket file. If it exists, then
|
fmt.Println("setting smartcard")
|
||||||
// the smartcard wallet will be enabled. There might still be some issues
|
cfg.SmartCard = true
|
||||||
// e.g. when the daemon is not running. Those issues are meant to be
|
|
||||||
// caught at the daemon initialization level, though.
|
// Use the platform default unless specified on the command line
|
||||||
if fi, err := os.Stat(ctx.GlobalString(SmartCardFlag.Name)); err == nil {
|
if len(ctx.GlobalString(SmartCardFlag.Name)) > 0 {
|
||||||
cfg.SmartCard = fi.Mode()&os.ModeType == os.ModeSocket
|
if fi, err := os.Stat(ctx.GlobalString(SmartCardFlag.Name)); err == nil {
|
||||||
cfg.SmartCardDaemonPath = ctx.GlobalString(SmartCardFlag.Name)
|
if fi.Mode()&os.ModeType == os.ModeSocket {
|
||||||
fmt.Println(ctx.GlobalString(SmartCardFlag.Name))
|
cfg.SmartCardDaemonPath = ctx.GlobalString(SmartCardFlag.Name)
|
||||||
} else {
|
} else {
|
||||||
log.Error(ctx.GlobalString(SmartCardFlag.Name), "doesn't seem to be a socket file")
|
log.Error(ctx.GlobalString(SmartCardFlag.Name), "doesn't seem to be a socket file")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.Error(ctx.GlobalString(SmartCardFlag.Name), "doesn't exist")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Info("Smartcard support disabled on this platform")
|
log.Info("Smartcard support disabled on this platform")
|
||||||
|
|
|
||||||
2
vendor/github.com/gballet/go-libpcsclite/doc.go
generated
vendored
2
vendor/github.com/gballet/go-libpcsclite/doc.go
generated
vendored
|
|
@ -61,8 +61,6 @@ const (
|
||||||
SCardPowever = 0x0010 /* Card is powered */
|
SCardPowever = 0x0010 /* Card is powered */
|
||||||
SCardNegotiable = 0x0020 /* Ready for PTS */
|
SCardNegotiable = 0x0020 /* Ready for PTS */
|
||||||
SCardSpecific = 0x0040 /* PTS has been set */
|
SCardSpecific = 0x0040 /* PTS has been set */
|
||||||
|
|
||||||
PCSCDSockName = "/run/pcscd/pcscd.comm"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// List of commands to send to the daemon
|
// List of commands to send to the daemon
|
||||||
|
|
|
||||||
35
vendor/github.com/gballet/go-libpcsclite/doc_bsd.go
generated
vendored
Normal file
35
vendor/github.com/gballet/go-libpcsclite/doc_bsd.go
generated
vendored
Normal file
|
|
@ -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"
|
||||||
35
vendor/github.com/gballet/go-libpcsclite/doc_linux.go
generated
vendored
Normal file
35
vendor/github.com/gballet/go-libpcsclite/doc_linux.go
generated
vendored
Normal file
|
|
@ -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"
|
||||||
6
vendor/vendor.json
vendored
6
vendor/vendor.json
vendored
|
|
@ -135,10 +135,10 @@
|
||||||
"revisionTime": "2018-04-18T12:24:29Z"
|
"revisionTime": "2018-04-18T12:24:29Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "aG2cEBkWshLrW0snEymuR6vNZYs=",
|
"checksumSHA1": "eHo1jkpsFxpx+Lrr+IUSuAGvvcc=",
|
||||||
"path": "github.com/gballet/go-libpcsclite",
|
"path": "github.com/gballet/go-libpcsclite",
|
||||||
"revision": "c11b1ec2c86bc1d38a95f14ae6662f23bf17bc37",
|
"revision": "5cd7d9d0621fe859226db72d0bf26c610c0207af",
|
||||||
"revisionTime": "2019-05-17T11:38:18Z"
|
"revisionTime": "2019-05-21T09:24:06Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"checksumSHA1": "gxV/cPPLkByTdY8y172t7v4qcZA=",
|
"checksumSHA1": "gxV/cPPLkByTdY8y172t7v4qcZA=",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue