Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos with codespell #307

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jwcrypto/jwa.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ def __init__(self):

# RFC 7518 - 5.3
def encrypt(self, k, a, m):
""" Encrypt accoriding to the selected encryption and hashing
""" Encrypt according to the selected encryption and hashing
functions.

:param k: Encryption key (optional)
Expand All @@ -1009,7 +1009,7 @@ def encrypt(self, k, a, m):
return (iv, e, encryptor.tag)

def decrypt(self, k, a, iv, e, t):
""" Decrypt accoriding to the selected encryption and hashing
""" Decrypt according to the selected encryption and hashing
functions.
:param k: Encryption key (optional)
:param a: Additional Authenticated Data
Expand Down
2 changes: 1 addition & 1 deletion jwcrypto/jwk.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def __init__(self, **kwargs):
valid key type as value then a new key will be generated according
to the defaults or provided key strength options (type specific).

:param \**kwargs: parameters (otional).
:param \**kwargs: parameters (optional).

:raises InvalidJWKType: if the key type is invalid
:raises InvalidJWKValue: if incorrect or inconsistent parameters
Expand Down
2 changes: 1 addition & 1 deletion jwcrypto/jws.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def _get_obj_payload(self, obj, dp):
return dp
else:
raise InvalidJWSOperation('Object Payload present but'
' Deatched Payload provided')
' Detached Payload provided')
return op

def verify(self, key, alg=None, detached_payload=None):
Expand Down
2 changes: 1 addition & 1 deletion jwcrypto/tests-cookbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ def test_4_8_signing(self):

# In general we can't compare ciphertexts with the reference because
# either the algorithms use random nonces to authenticate the ciphertext
# or we randomly genrate the nonce when we create the JWe.
# or we randomly generate the nonce when we create the JWe.
# To double check implementation we encrypt/decrypt our own input and then
# decrypt the reference and check it against the given plaintext
class Cookbook08JWETests(unittest.TestCase):
Expand Down
8 changes: 4 additions & 4 deletions jwcrypto/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def test_jwkset(self):
ks3 = jwk.JWKSet.from_json(ks.export())
self.assertEqual(len(ks), len(ks3))

# Test key set with mutiple keys
# Test key set with multiple keys
ksm = jwk.JWKSet.from_json(json_encode(PrivateKeys))
num = 0
for item in ksm:
Expand All @@ -438,7 +438,7 @@ def test_jwkset(self):
self.assertEqual(num, len(PrivateKeys['keys']))

def test_jwkset_get_keys(self):
# Test key set with mutiple keys
# Test key set with multiple keys
ksm = jwk.JWKSet.from_json(json_encode(PrivateKeys))
k1 = jwk.JWK.from_json(json_encode(PrivateKeys['keys'][0]))
kwargs = RSAPrivateKey.copy()
Expand Down Expand Up @@ -881,7 +881,7 @@ def check_sign(self, test):
self.assertEqual(decsig, test['signature'])
else:
# Check we can verify the test signature independently
# this is so taht we can test the ECDSA agaist a known
# this is so that we can test the ECDSA against a known
# good signature
s.verify(test['signature'])

Expand Down Expand Up @@ -1783,7 +1783,7 @@ def test_unexpected(self):
token.make_encrypted_token(key)
enctok = token.serialize()

# test workaroud for older applications
# test workaround for older applications
jwt.JWT_expect_type = False
jwt.JWT(jwt=enctok, key=key)
jwt.JWT_expect_type = True
Expand Down