Skip to content

Commit 71b1cb4

Browse files
committed
Handle additional code review nits
1 parent 863f498 commit 71b1cb4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/node/internal/crypto_keys.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ export abstract class KeyObject {
148148
const opts = options as any;
149149
if (opts.format !== undefined) {
150150
validateString(opts.format, 'options.format');
151+
} else {
152+
options.format = 'buffer';
151153
}
152154
if (opts.type !== undefined) validateString(opts.type, 'options.type');
153155
if (this.type === 'private') {
@@ -166,8 +168,6 @@ export abstract class KeyObject {
166168
}
167169
}
168170

169-
options.format ??= 'buffer';
170-
171171
const ret = cryptoImpl.exportKey(
172172
this[kHandle],
173173
options as InnerExportOptions

src/workerd/api/crypto/prime.c++

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jsg::BufferSource randomPrime(jsg::Lock& js,
6767
"options.add must not be bigger than size of the requested prime");
6868
}
6969

70-
// Generating random primes uses the prng internally.
70+
// Generating random primes uses the PRNG internally.
7171
// Make sure the CSPRNG is properly seeded.
7272
JSG_REQUIRE(
7373
workerd::api::CSPRNG(nullptr), Error, "Error while generating prime (bad random state)");

0 commit comments

Comments
 (0)