@@ -60,8 +60,6 @@ def __init__(self, name: str, description: str, pad_fn: padding.AsymmetricPaddin
6060 self .description = description
6161 self .padding = pad_fn
6262 self .recommended = recommended
63- if name == "RSA1_5" :
64- self .security_warning = 'JWE algorithm "RSA1_5" is deprecated, via draft-ietf-jose-deprecate-none-rsa15-02'
6563
6664 def encrypt_cek (self , cek : bytes , recipient : Recipient [RSAKey ]) -> bytes :
6765 key = recipient .recipient_key
@@ -295,17 +293,17 @@ def decrypt_cek(self, recipient: Recipient[OctKey]) -> bytes:
295293 return self .key_wrapping .unwrap_cek (recipient .encrypted_key , kek )
296294
297295
296+ RSA1_5 = RSAAlgModel ("RSA1_5" , "RSAES-PKCS1-v1_5" , padding .PKCS1v15 ())
297+ RSA1_5 .security_warning = 'JWE algorithm "RSA1_5" is deprecated, via draft-ietf-jose-deprecate-none-rsa15-02'
298+
298299A128KW = AESAlgModel (128 , True ) # A128KW, Recommended
299300A192KW = AESAlgModel (192 ) # A192KW
300301A256KW = AESAlgModel (256 , True ) # A256KW, Recommended
301302
302303
303304#: https://www.rfc-editor.org/rfc/rfc7518#section-4.1
304305JWE_ALG_MODELS : list [JWEAlgModel ] = [
305- # Avoid all RSA-PKCS1 v1.5 encryption algorithms ([RFC8017], Section 7.2),
306- # preferring RSAES-OAEP ([RFC8017], Section 7.1).
307- # https://www.rfc-editor.org/rfc/rfc8725#section-3.2
308- RSAAlgModel ("RSA1_5" , "RSAES-PKCS1-v1_5" , padding .PKCS1v15 ()),
306+ RSA1_5 ,
309307 RSAAlgModel (
310308 "RSA-OAEP" ,
311309 "RSAES OAEP using default parameters" ,
0 commit comments