Merge pull request #955 from shuLhan/cas-cloudcas-test-go119
cas/cloudcas: update test on createPublicKey for the next Go release
This commit is contained in:
commit
0b748f2d03
1 changed files with 9 additions and 3 deletions
|
@ -112,6 +112,7 @@ func Test_createPublicKey(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
ecCert := mustParseCertificate(t, testLeafCertificate)
|
ecCert := mustParseCertificate(t, testLeafCertificate)
|
||||||
|
ecCertPublicKey := ecCert.PublicKey.(*ecdsa.PublicKey)
|
||||||
rsaCert := mustParseCertificate(t, testRSACertificate)
|
rsaCert := mustParseCertificate(t, testRSACertificate)
|
||||||
type args struct {
|
type args struct {
|
||||||
key crypto.PublicKey
|
key crypto.PublicKey
|
||||||
|
@ -132,9 +133,14 @@ func Test_createPublicKey(t *testing.T) {
|
||||||
}, false},
|
}, false},
|
||||||
{"fail ed25519", args{edpub}, nil, true},
|
{"fail ed25519", args{edpub}, nil, true},
|
||||||
{"fail ec marshal", args{&ecdsa.PublicKey{
|
{"fail ec marshal", args{&ecdsa.PublicKey{
|
||||||
Curve: &elliptic.CurveParams{Name: "FOO", BitSize: 256},
|
Curve: &elliptic.CurveParams{
|
||||||
X: ecCert.PublicKey.(*ecdsa.PublicKey).X,
|
Name: "FOO",
|
||||||
Y: ecCert.PublicKey.(*ecdsa.PublicKey).Y,
|
BitSize: 256,
|
||||||
|
P: ecCertPublicKey.Params().P,
|
||||||
|
B: ecCertPublicKey.Params().B,
|
||||||
|
},
|
||||||
|
X: ecCertPublicKey.X,
|
||||||
|
Y: ecCertPublicKey.Y,
|
||||||
}}, nil, true},
|
}}, nil, true},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
|
Loading…
Reference in a new issue