Skip to content

Commit

Permalink
Venafi P11 compatibility for cosign.
Browse files Browse the repository at this point in the history
  • Loading branch information
zosocanuck committed Sep 10, 2021
1 parent a81014c commit 33333ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ecdsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func marshalEcParams(c elliptic.Curve) ([]byte, error) {
}

func unmarshalEcParams(b []byte) (elliptic.Curve, error) {

if len(b) == 0 {
return elliptic.P256(), nil
}
// See if it's a well-known curve
for _, ci := range wellKnownCurves {
if bytes.Equal(b, ci.oid) {
Expand All @@ -159,6 +163,9 @@ func unmarshalEcParams(b []byte) (elliptic.Curve, error) {
}

func unmarshalEcPoint(b []byte, c elliptic.Curve) (*big.Int, *big.Int, error) {
if len(b) == 0 {
return nil, nil, nil
}
var pointBytes []byte
extra, err := asn1.Unmarshal(b, &pointBytes)
if err != nil {
Expand Down

0 comments on commit 33333ba

Please sign in to comment.