File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ namespace ccfapp
214
214
else
215
215
{
216
216
k = crypto::make_rsa_key_pair (key_size, key_exponent);
217
- }
217
+ }
218
218
219
219
Pem prv = k->private_key_pem ();
220
220
Pem pub = k->public_key_pem ();
Original file line number Diff line number Diff line change @@ -169,9 +169,12 @@ def compute_public_key_der_hash_hex_from_pem(pem: str):
169
169
)
170
170
return hashlib .sha256 (pub_key ).hexdigest ()
171
171
172
- def check_key_pair_pem (private : str , public : str , password = None ) -> bool :
172
+
173
+ def check_key_pair_pem (private : str , public : str , password = None ) -> bool :
173
174
prv = load_pem_private_key (private .encode (), password = password )
174
175
pub = load_pem_public_key (public .encode ())
175
- prv_pub_der = prv .public_key ().public_bytes (Encoding .DER , PublicFormat .SubjectPublicKeyInfo )
176
+ prv_pub_der = prv .public_key ().public_bytes (
177
+ Encoding .DER , PublicFormat .SubjectPublicKeyInfo
178
+ )
176
179
pub_der = pub .public_bytes (Encoding .DER , PublicFormat .SubjectPublicKeyInfo )
177
180
return prv_pub_der == pub_der
Original file line number Diff line number Diff line change @@ -264,7 +264,9 @@ def test_npm_app(network, args):
264
264
265
265
r = c .post ("/app/generateRsaKeyPair" , {"size" : 2048 })
266
266
assert r .status_code == http .HTTPStatus .OK , r .status_code
267
- assert infra .crypto .check_key_pair_pem (r .body .json ()["privateKey" ], r .body .json ()["publicKey" ])
267
+ assert infra .crypto .check_key_pair_pem (
268
+ r .body .json ()["privateKey" ], r .body .json ()["publicKey" ]
269
+ )
268
270
269
271
aes_key_to_wrap = infra .crypto .generate_aes_key (256 )
270
272
wrapping_key_priv_pem , wrapping_key_pub_pem = infra .crypto .generate_rsa_keypair (
You can’t perform that action at this time.
0 commit comments