good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
bcf3c52a
Commit
bcf3c52a
authored
6 years ago
by
Guillaume Ballet
Browse files
Options
Downloads
Patches
Plain Diff
PK derivation has to be supported by the card
parent
2625057f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
accounts/scwallet/wallet.go
+7
-11
7 additions, 11 deletions
accounts/scwallet/wallet.go
with
7 additions
and
11 deletions
accounts/scwallet/wallet.go
+
7
−
11
View file @
bcf3c52a
...
...
@@ -321,10 +321,8 @@ func (w *Wallet) Status() (string, error) {
return
fmt
.
Sprintf
(
"Locked, waiting for PIN (%d attempts left)"
,
status
.
PinRetryCount
),
nil
case
!
status
.
Initialized
:
return
fmt
.
Sprintf
(
"Empty, waiting for initialization"
),
nil
case
status
.
SupportsPKDerivation
:
return
fmt
.
Sprintf
(
"Online, can derive public keys"
),
nil
default
:
return
fmt
.
Sprintf
(
"Online
, cannot derive public keys
"
),
nil
return
fmt
.
Sprintf
(
"Online"
),
nil
}
}
...
...
@@ -844,10 +842,9 @@ func (s *Session) authenticate(pairing smartcardPairing) error {
// walletStatus describes a smartcard wallet's status information.
type
walletStatus
struct
{
PinRetryCount
int
// Number of remaining PIN retries
PukRetryCount
int
// Number of remaining PUK retries
Initialized
bool
// Whether the card has been initialized with a private key
SupportsPKDerivation
bool
// Whether the card supports doing public key derivation itself
PinRetryCount
int
// Number of remaining PIN retries
PukRetryCount
int
// Number of remaining PUK retries
Initialized
bool
// Whether the card has been initialized with a private key
}
// walletStatus fetches the wallet's status from the card.
...
...
@@ -869,10 +866,9 @@ func (s *Session) walletStatus() (*walletStatus, error) {
return
nil
,
fmt
.
Errorf
(
"invalid response tag format"
)
}
status
:=
&
walletStatus
{
PinRetryCount
:
int
(
response
.
Data
[
4
]),
PukRetryCount
:
int
(
response
.
Data
[
7
]),
Initialized
:
(
response
.
Data
[
10
]
==
0xff
),
SupportsPKDerivation
:
true
,
/* Cards that don't aren't supported */
PinRetryCount
:
int
(
response
.
Data
[
4
]),
PukRetryCount
:
int
(
response
.
Data
[
7
]),
Initialized
:
(
response
.
Data
[
10
]
==
0xff
),
}
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment