@@ -16,6 +16,10 @@ type dsaSignature struct {
16
16
}
17
17
18
18
func TestDSAGenerateParameters (t * testing.T ) {
19
+ if ! openssl .SupportsDSA () {
20
+ t .Skip ("DSA is not supported" )
21
+ }
22
+
19
23
var tests = []struct {
20
24
L , N int
21
25
}{
@@ -128,9 +132,13 @@ func testDSASignAndVerify(t *testing.T, priv *openssl.PrivateKeyDSA) {
128
132
}
129
133
130
134
func TestDSASignAndVerify (t * testing.T ) {
135
+ if ! openssl .SupportsDSA () {
136
+ t .Skip ("DSA is not supported" )
137
+ }
131
138
if openssl .FIPS () {
132
139
t .Skip ("DSA signing with L = 2048 is not supported in FIPS mode" )
133
140
}
141
+
134
142
params := openssl.DSAParameters {
135
143
P : bbig .Enc (fromHex ("A9B5B793FB4785793D246BAE77E8FF63CA52F442DA763C440259919FE1BC1D6065A9350637A04F75A2F039401D49F08E066C4D275A5A65DA5684BC563C14289D7AB8A67163BFBF79D85972619AD2CFF55AB0EE77A9002B0EF96293BDD0F42685EBB2C66C327079F6C98000FBCB79AACDE1BC6F9D5C7B1A97E3D9D54ED7951FEF" )),
136
144
Q : bbig .Enc (fromHex ("E1D3391245933D68A0714ED34BBCB7A1F422B9C1" )),
@@ -147,6 +155,10 @@ func TestDSASignAndVerify(t *testing.T) {
147
155
}
148
156
149
157
func TestDSANewPrivateKeyWithDegenerateKeys (t * testing.T ) {
158
+ if ! openssl .SupportsDSA () {
159
+ t .Skip ("DSA is not supported" )
160
+ }
161
+
150
162
// Signing with degenerate private keys should not cause an infinite loop
151
163
badKeys := []struct {
152
164
p , q , g , y , x string
@@ -175,6 +187,10 @@ func TestDSANewPrivateKeyWithDegenerateKeys(t *testing.T) {
175
187
}
176
188
177
189
func TestDSANewPublicKeyWithBadPublicKey (t * testing.T ) {
190
+ if ! openssl .SupportsDSA () {
191
+ t .Skip ("DSA is not supported" )
192
+ }
193
+
178
194
params := openssl.DSAParameters {
179
195
P : bbig .Enc (fromHex ("A9B5B793FB4785793D246BAE77E8FF63CA52F442DA763C440259919FE1BC1D6065A9350637A04F75A2F039401D49F08E066C4D275A5A65DA5684BC563C14289D7AB8A67163BFBF79D85972619AD2CFF55AB0EE77A9002B0EF96293BDD0F42685EBB2C66C327079F6C98000FBCB79AACDE1BC6F9D5C7B1A97E3D9D54ED7951FEF" )),
180
196
Q : bbig .Enc (fromHex ("FA" )),
0 commit comments