Skip to content

Commit 0281865

Browse files
author
Christoph M. Wintersteiger
committed
Formatting
1 parent d506c64 commit 0281865

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/apps/js_generic/js_generic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ namespace ccfapp
214214
else
215215
{
216216
k = crypto::make_rsa_key_pair(key_size, key_exponent);
217-
}
217+
}
218218

219219
Pem prv = k->private_key_pem();
220220
Pem pub = k->public_key_pem();

tests/infra/crypto.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ def compute_public_key_der_hash_hex_from_pem(pem: str):
169169
)
170170
return hashlib.sha256(pub_key).hexdigest()
171171

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:
173174
prv = load_pem_private_key(private.encode(), password=password)
174175
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+
)
176179
pub_der = pub.public_bytes(Encoding.DER, PublicFormat.SubjectPublicKeyInfo)
177180
return prv_pub_der == pub_der

tests/js-modules/modules.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ def test_npm_app(network, args):
264264

265265
r = c.post("/app/generateRsaKeyPair", {"size": 2048})
266266
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+
)
268270

269271
aes_key_to_wrap = infra.crypto.generate_aes_key(256)
270272
wrapping_key_priv_pem, wrapping_key_pub_pem = infra.crypto.generate_rsa_keypair(

0 commit comments

Comments
 (0)