rename public key to secure channel public key in app info

This commit is contained in:
Andrea Franz 2019-03-15 10:37:54 +01:00
parent 04dc8df36c
commit 3371792bf0
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
3 changed files with 11 additions and 11 deletions

View File

@ -205,7 +205,7 @@ func commandInfo(card *scard.Card) error {
fmt.Printf("Installed: %+v\n", info.Installed)
fmt.Printf("Initialized: %+v\n", info.Initialized)
fmt.Printf("InstanceUID: 0x%x\n", info.InstanceUID)
fmt.Printf("PublicKey: 0x%x\n", info.PublicKey)
fmt.Printf("SecureChannelPublicKey: 0x%x\n", info.SecureChannelPublicKey)
fmt.Printf("Version: 0x%x\n", info.Version)
fmt.Printf("AvailableSlots: 0x%x\n", info.AvailableSlots)
fmt.Printf("KeyUID: 0x%x\n", info.KeyUID)

View File

@ -62,7 +62,7 @@ func (cs *CommandSet) Select() error {
cs.ApplicationInfo = appInfo
if cs.ApplicationInfo.HasSecureChannelCapability() {
err = cs.sc.GenerateSecret(cs.ApplicationInfo.PublicKey)
err = cs.sc.GenerateSecret(cs.ApplicationInfo.SecureChannelPublicKey)
if err != nil {
return err
}

View File

@ -30,12 +30,12 @@ const (
)
type ApplicationInfo struct {
Installed bool
Initialized bool
InstanceUID []byte
PublicKey []byte
Version []byte
AvailableSlots []byte
Installed bool
Initialized bool
InstanceUID []byte
SecureChannelPublicKey []byte
Version []byte
AvailableSlots []byte
// KeyUID is the sha256 of of the master public key on the card.
// It's empty if the card doesn't contain any key.
KeyUID []byte
@ -68,10 +68,10 @@ func ParseApplicationInfo(data []byte) (*ApplicationInfo, error) {
}
if data[0] == TagSelectResponsePreInitialized {
info.PublicKey = data[2:]
info.SecureChannelPublicKey = data[2:]
info.Capabilities = CapabilityCredentialsManagement
if len(info.PublicKey) > 0 {
if len(info.SecureChannelPublicKey) > 0 {
info.Capabilities = info.Capabilities | CapabilitySecureChannel
}
@ -116,7 +116,7 @@ func ParseApplicationInfo(data []byte) (*ApplicationInfo, error) {
}
info.InstanceUID = instanceUID
info.PublicKey = pubKey
info.SecureChannelPublicKey = pubKey
info.Version = appVersion
info.AvailableSlots = availableSlots
info.KeyUID = keyUID