google / google/native-pkcs11

CKA_EC_PARAMS of Key objects is always set to P256 curve

Open
#303 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
74
Forks
23
Avg merge
1d 14h
Merged PRs (30d)
3

Description

The `Object.attribute` function always returns a fixed value of the P256 curve OID (see following code excerpt).
This is obviously wrong for non P256 keys and leads to errors when using the module with at least pkcs11-tool.

```
AttributeType::EcParams => {
Some(Attribute::EcParams(p256::NistP256::OID.to_der().ok()?))
}
```

The real information about the key could be found in the certificate (SubjectPublicKeyInfo), but that is not available in the PrivateKey and PublicKey trait.

Maybe the Key objects could be extended to provide this information.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.