File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,20 @@ def __eq__(self, other):
243
243
if self .__class__ != other .__class__ :
244
244
return False
245
245
246
+ if self .use and other .use :
247
+ if self .use != other .use :
248
+ return False
249
+
250
+ if self .kid :
251
+ if other .kid :
252
+ if self .kid != other .kid :
253
+ return False
254
+ else :
255
+ return False
256
+ else :
257
+ if other .kid :
258
+ return False
259
+
246
260
if cmp_keys (self .pub_key , other .pub_key , ec .EllipticCurvePublicKey ):
247
261
if other .private_key ():
248
262
if cmp_keys (self .priv_key , other .priv_key , ec .EllipticCurvePrivateKey ):
Original file line number Diff line number Diff line change @@ -216,6 +216,22 @@ def test_cmp_eq_ec():
216
216
assert _key1 == _key2
217
217
218
218
219
+ def test_cmp_eq_ec_kid ():
220
+ ec_key = new_ec_key ("P-256" )
221
+ _key1 = ECKey (priv_key = ec_key .priv_key , kid = "foo" )
222
+ _key2 = ECKey (priv_key = ec_key .priv_key , kid = "bar" )
223
+
224
+ assert _key1 != _key2
225
+
226
+
227
+ def test_cmp_eq_rsa_kid ():
228
+ rsa_key = new_rsa_key ()
229
+ _key1 = RSAKey (priv_key = rsa_key .priv_key , kid = "foo" )
230
+ _key2 = RSAKey (priv_key = rsa_key .priv_key , kid = "bar" )
231
+
232
+ assert _key1 != _key2
233
+
234
+
219
235
def test_get_key ():
220
236
ec_key = new_ec_key ("P-256" )
221
237
asym_private_key = ECKey (priv_key = ec_key .priv_key )
You can’t perform that action at this time.
0 commit comments