Commit b828560
crypto: allow KeyObjects in postMessage
This change allows sharing KeyObjects between threads via postMessage.
The receiver acquires a new KeyObject and a new KeyObjectHandle, but
refers to the same KeyObjectData:
+-------------------+
| NativeKeyObject 1 | ------------------------------------------+
+-------------------+ |
^ |
extends |
| |
+-------------------+ +-------------------+ |
| KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ |
+-------------------+ +-------------------+ | |
| |
| |
| |
| |
| |
+-------------------+ | |
| NativeKeyObject 2 | ------------------------------------+ | |
+-------------------+ | | |
^ | | |
extends | | |
| | | |
+-------------------+ +-------------------+ | | |
| KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | |
+-------------------+ +-------------------+ | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
+-------------------+ | | | |
| NativeKeyObject 3 | ------------------------------+ | | | |
+-------------------+ | | | | |
^ | | | | |
extends | | | | |
| v v v v v
+-------------------+ +-------------------+ +---------------+
| KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData |
+-------------------+ +-------------------+ +---------------+
Co-authored-by: Anna Henningsen <anna@addaleax.net>
PR-URL: #33360
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 50b1cde commit b828560Copy full SHA for b828560
File tree
Expand file treeCollapse file tree
7 files changed
+252
-52
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/crypto
- src
- test/parallel
Expand file treeCollapse file tree
7 files changed
+252
-52
lines changedOpen diff view settings
Collapse file
+9Lines changed: 9 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1215 | 1215 | |
1216 | 1216 | |
1217 | 1217 | |
| 1218 | + |
| 1219 | + |
| 1220 | + |
| 1221 | + |
1218 | 1222 | |
1219 | 1223 | |
1220 | 1224 | |
| ||
1230 | 1234 | |
1231 | 1235 | |
1232 | 1236 | |
| 1237 | + |
| 1238 | + |
| 1239 | + |
| 1240 | + |
1233 | 1241 | |
1234 | 1242 | |
1235 | 1243 | |
| ||
3560 | 3568 | |
3561 | 3569 | |
3562 | 3570 | |
| 3571 | + |
3563 | 3572 | |
3564 | 3573 | |
3565 | 3574 | |
|
Collapse file
+6-2Lines changed: 6 additions & 2 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
328 | 328 | |
329 | 329 | |
330 | 330 | |
| 331 | + |
| 332 | + |
| 333 | + |
331 | 334 | |
332 | 335 | |
333 | 336 | |
| ||
348 | 351 | |
349 | 352 | |
350 | 353 | |
351 | | - |
352 | | - |
| 354 | + |
| 355 | + |
353 | 356 | |
354 | 357 | |
355 | 358 | |
| ||
846 | 849 | |
847 | 850 | |
848 | 851 | |
| 852 | + |
849 | 853 | |
850 | 854 | |
851 | 855 | |
|
Collapse file
lib/internal/crypto/keys.js
Copy file name to clipboardExpand all lines: lib/internal/crypto/keys.js+8-5Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
43 | 43 | |
44 | 44 | |
45 | 45 | |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
46 | 53 | |
47 | 54 | |
48 | 55 | |
| ||
57 | 64 | |
58 | 65 | |
59 | 66 | |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
| 67 | + |
65 | 68 | |
66 | 69 | |
67 | 70 | |
|
Collapse file
+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
452 | 452 | |
453 | 453 | |
454 | 454 | |
| 455 | + |
| 456 | + |
| 457 | + |
455 | 458 | |
456 | 459 | |
457 | 460 | |
|
Collapse file
+83-34Lines changed: 83 additions & 34 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3206 | 3206 | |
3207 | 3207 | |
3208 | 3208 | |
3209 | | - |
| 3209 | + |
| 3210 | + |
3210 | 3211 | |
3211 | 3212 | |
3212 | 3213 | |
3213 | | - |
3214 | | - |
3215 | | - |
| 3214 | + |
| 3215 | + |
3216 | 3216 | |
3217 | 3217 | |
3218 | | - |
3219 | | - |
3220 | | - |
| 3218 | + |
| 3219 | + |
3221 | 3220 | |
3222 | 3221 | |
3223 | | - |
3224 | | - |
| 3222 | + |
| 3223 | + |
| 3224 | + |
3225 | 3225 | |
3226 | | - |
3227 | | - |
3228 | | - |
3229 | | - |
| 3226 | + |
3230 | 3227 | |
3231 | 3228 | |
3232 | 3229 | |
| ||
3270 | 3267 | |
3271 | 3268 | |
3272 | 3269 | |
3273 | | - |
3274 | | - |
3275 | | - |
3276 | | - |
3277 | | - |
| 3270 | + |
| 3271 | + |
| 3272 | + |
3278 | 3273 | |
3279 | 3274 | |
3280 | | - |
| 3275 | + |
3281 | 3276 | |
3282 | 3277 | |
3283 | 3278 | |
3284 | 3279 | |
3285 | 3280 | |
3286 | 3281 | |
3287 | | - |
| 3282 | + |
3288 | 3283 | |
3289 | 3284 | |
3290 | 3285 | |
3291 | | - |
3292 | | - |
| 3286 | + |
| 3287 | + |
3293 | 3288 | |
3294 | 3289 | |
3295 | 3290 | |
| ||
3319 | 3314 | |
3320 | 3315 | |
3321 | 3316 | |
3322 | | - |
3323 | | - |
| 3317 | + |
3324 | 3318 | |
3325 | 3319 | |
3326 | 3320 | |
| ||
3329 | 3323 | |
3330 | 3324 | |
3331 | 3325 | |
3332 | | - |
| 3326 | + |
3333 | 3327 | |
3334 | 3328 | |
3335 | 3329 | |
| ||
3338 | 3332 | |
3339 | 3333 | |
3340 | 3334 | |
3341 | | - |
| 3335 | + |
3342 | 3336 | |
3343 | 3337 | |
3344 | 3338 | |
| ||
3434 | 3428 | |
3435 | 3429 | |
3436 | 3430 | |
3437 | | - |
| 3431 | + |
| 3432 | + |
| 3433 | + |
| 3434 | + |
| 3435 | + |
| 3436 | + |
| 3437 | + |
| 3438 | + |
| 3439 | + |
| 3440 | + |
| 3441 | + |
| 3442 | + |
| 3443 | + |
| 3444 | + |
| 3445 | + |
| 3446 | + |
| 3447 | + |
| 3448 | + |
| 3449 | + |
| 3450 | + |
| 3451 | + |
| 3452 | + |
| 3453 | + |
| 3454 | + |
| 3455 | + |
| 3456 | + |
| 3457 | + |
| 3458 | + |
| 3459 | + |
| 3460 | + |
| 3461 | + |
| 3462 | + |
| 3463 | + |
| 3464 | + |
| 3465 | + |
| 3466 | + |
| 3467 | + |
| 3468 | + |
| 3469 | + |
| 3470 | + |
| 3471 | + |
| 3472 | + |
| 3473 | + |
| 3474 | + |
3438 | 3475 | |
3439 | 3476 | |
3440 | 3477 | |
| ||
3448 | 3485 | |
3449 | 3486 | |
3450 | 3487 | |
| 3488 | + |
3451 | 3489 | |
3452 | 3490 | |
3453 | 3491 | |
3454 | 3492 | |
3455 | | - |
3456 | | - |
3457 | | - |
| 3493 | + |
| 3494 | + |
| 3495 | + |
| 3496 | + |
| 3497 | + |
| 3498 | + |
| 3499 | + |
| 3500 | + |
| 3501 | + |
| 3502 | + |
| 3503 | + |
| 3504 | + |
3458 | 3505 | |
3459 | 3506 | |
3460 | 3507 | |
| ||
6318 | 6365 | |
6319 | 6366 | |
6320 | 6367 | |
6321 | | - |
6322 | | - |
| 6368 | + |
| 6369 | + |
| 6370 | + |
6323 | 6371 | |
6324 | 6372 | |
6325 | 6373 | |
| ||
6329 | 6377 | |
6330 | 6378 | |
6331 | 6379 | |
6332 | | - |
6333 | | - |
| 6380 | + |
| 6381 | + |
| 6382 | + |
6334 | 6383 | |
6335 | 6384 | |
6336 | 6385 | |
|
0 commit comments