rmeove pub key derivation field from get status response

This commit is contained in:
Andrea Franz 2019-03-15 01:13:28 +01:00
parent b1872e0e0f
commit 74895bb582
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
2 changed files with 3 additions and 11 deletions

View File

@ -271,7 +271,6 @@ func commandStatus(card *scard.Card) error {
fmt.Printf("Pin retry count: %d\n", appStatus.PinRetryCount)
fmt.Printf("PUK retry count: %d\n", appStatus.PUKRetryCount)
fmt.Printf("Key initialized: %v\n", appStatus.KeyInitialized)
fmt.Printf("Public key derivation: %v\n", appStatus.PubKeyDerivation)
return nil
}

View File

@ -10,10 +10,9 @@ import (
var ErrApplicationStatusTemplateNotFound = errors.New("application status template not found")
type ApplicationStatus struct {
PinRetryCount int
PUKRetryCount int
KeyInitialized bool
PubKeyDerivation bool
PinRetryCount int
PUKRetryCount int
KeyInitialized bool
}
func ParseApplicationStatus(data []byte) (*ApplicationStatus, error) {
@ -38,11 +37,5 @@ func ParseApplicationStatus(data []byte) (*ApplicationStatus, error) {
}
}
if keyDerivationSupported, err := apdu.FindTagN(tpl, 1, uint8(0x01)); err == nil {
if bytes.Equal(keyDerivationSupported, []byte{0xFF}) {
appStatus.PubKeyDerivation = true
}
}
return appStatus, nil
}