Skip to content

Commit c430838

Browse files
Fix typo and hsm-api does not use urlsafe decode so it has extra bytes with urlsafe breaking it. (#45)
1 parent b55204c commit c430838

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/services/crypto/hsm_api_crypto_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class Pkc11Mechanism(StrEnum):
1818
AES_CBC = "AES_CBC"
1919
SHA256_HMAC = "SHA256_HMAC"
20-
RSA_PKCS_OAEP = "RSA_PCKS_OAEP"
20+
RSA_PKCS_OAEP = "RSA_PKCS_OAEP"
2121

2222

2323
class HsmApiCryptoService(CryptoService):
@@ -156,7 +156,7 @@ def encrypt_aes(self, data: bytes, iv: bytes) -> str:
156156
if len(iv) != 16:
157157
raise CryptoError("IV for AES_CBC must be 16 bytes length")
158158

159-
target = base64.urlsafe_b64encode(data)
159+
target = base64.b64encode(data)
160160
r = self._http.do_request(
161161
"POST",
162162
sub_route=f"hsm/{self.module}/{self.slot}/encrypt",

0 commit comments

Comments
 (0)