Use asn1.TagOctetString constant (#7247)

We require a Go version newer than 1.6, so we can use the constant.
This commit is contained in:
Matthew McPherrin 2024-01-10 13:38:02 -05:00 committed by GitHub
parent cd3bbf91ad
commit c7a0987971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ func (s *Session) getPublicKeyID(label string, publicKey crypto.PublicKey) ([]by
// PKCS#11 v2.20 specified that the CKA_EC_POINT was to be store in a DER-encoded
// OCTET STRING.
rawValue := asn1.RawValue{
Tag: 4, // in Go 1.6+ this is asn1.TagOctetString
Tag: asn1.TagOctetString,
Bytes: elliptic.Marshal(key.Curve, key.X, key.Y),
}
marshalledPoint, err := asn1.Marshal(rawValue)