@@ -237,6 +237,7 @@ def test_privkey_strings(self):
237237 priv2 = SigningKey .from_der (s1 )
238238 self .assertTruePrivkeysEqual (priv1 , priv2 )
239239
240+ def test_privkey_strings_brainpool (self ):
240241 priv1 = SigningKey .generate (curve = BRAINPOOLP512r1 )
241242 s1 = priv1 .to_pem ()
242243 self .assertEqual (type (s1 ), binary_type )
@@ -272,14 +273,6 @@ def test_pubkey_strings(self):
272273 pub2 = VerifyingKey .from_string (s1 , curve = NIST256p )
273274 self .assertTruePubkeysEqual (pub1 , pub2 )
274275
275- priv1 = SigningKey .generate (curve = BRAINPOOLP512r1 )
276- pub1 = priv1 .get_verifying_key ()
277- s1 = pub1 .to_string ()
278- self .assertEqual (type (s1 ), binary_type )
279- self .assertEqual (len (s1 ), BRAINPOOLP512r1 .verifying_key_length )
280- pub2 = VerifyingKey .from_string (s1 , curve = BRAINPOOLP512r1 )
281- self .assertTruePubkeysEqual (pub1 , pub2 )
282-
283276 pub1_der = pub1 .to_der ()
284277 self .assertEqual (type (pub1_der ), binary_type )
285278 pub2 = VerifyingKey .from_der (pub1_der )
@@ -305,6 +298,20 @@ def order(self):
305298 pub2 = VerifyingKey .from_pem (pem )
306299 self .assertTruePubkeysEqual (pub1 , pub2 )
307300
301+ def test_pubkey_strings_brainpool (self ):
302+ priv1 = SigningKey .generate (curve = BRAINPOOLP512r1 )
303+ pub1 = priv1 .get_verifying_key ()
304+ s1 = pub1 .to_string ()
305+ self .assertEqual (type (s1 ), binary_type )
306+ self .assertEqual (len (s1 ), BRAINPOOLP512r1 .verifying_key_length )
307+ pub2 = VerifyingKey .from_string (s1 , curve = BRAINPOOLP512r1 )
308+ self .assertTruePubkeysEqual (pub1 , pub2 )
309+
310+ pub1_der = pub1 .to_der ()
311+ self .assertEqual (type (pub1_der ), binary_type )
312+ pub2 = VerifyingKey .from_der (pub1_der )
313+ self .assertTruePubkeysEqual (pub1 , pub2 )
314+
308315 def test_vk_to_der_with_invalid_point_encoding (self ):
309316 sk = SigningKey .generate ()
310317 vk = sk .verifying_key
@@ -814,8 +821,6 @@ def test_from_openssl_brainpoolp384r1(self):
814821 def test_from_openssl_brainpoolp512r1 (self ):
815822 return self .do_test_from_openssl (BRAINPOOLP512r1 )
816823
817- @pytest .mark .skipif ("" not in OPENSSL_SUPPORTED_CURVES ,
818- reason = "system openssl does not support " )
819824 def do_test_from_openssl (self , curve ):
820825 curvename = curve .openssl_name
821826 assert curvename
0 commit comments