Commit 1994eaa
crypto: make generatePrime/checkPrime interruptible
The `generatePrime` and `checkPrime` functions in the `crypto`
module are only somewhat interruptible. This change makes it
possible to interrupt these more reliably. Note that generating
overly large primes can still take a long time and may not be
interruptible as this mechanism relies on a callback to check
for stopping conditions but OpenSSL may perform a long running
operation without calling the callback right away.
Fixes: #56449
PR-URL: #56460
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>1 parent 5e1ddd5 commit 1994eaaCopy full SHA for 1994eaa
File tree
Expand file treeCollapse file tree
3 files changed
+59
-11
lines changedOpen diff view settings
Filter options
- doc/api
- src/crypto
- test/parallel
Expand file treeCollapse file tree
3 files changed
+59
-11
lines changedOpen diff view settings
Collapse file
+14Lines changed: 14 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3934 | 3934 | |
3935 | 3935 | |
3936 | 3936 | |
| 3937 | + |
| 3938 | + |
| 3939 | + |
| 3940 | + |
| 3941 | + |
| 3942 | + |
| 3943 | + |
3937 | 3944 | |
3938 | 3945 | |
3939 | 3946 | |
| ||
3975 | 3982 | |
3976 | 3983 | |
3977 | 3984 | |
| 3985 | + |
| 3986 | + |
| 3987 | + |
| 3988 | + |
| 3989 | + |
| 3990 | + |
| 3991 | + |
3978 | 3992 | |
3979 | 3993 | |
3980 | 3994 | |
|
Collapse file
src/crypto/crypto_random.cc
Copy file name to clipboardExpand all lines: src/crypto/crypto_random.cc+29-11Lines changed: 29 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
28 | 28 | |
29 | 29 | |
30 | 30 | |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
31 | 50 | |
32 | 51 | |
33 | 52 | |
| ||
150 | 169 | |
151 | 170 | |
152 | 171 | |
153 | | - |
154 | | - |
155 | | - |
156 | | - |
157 | | - |
158 | | - |
159 | | - |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
160 | 180 | |
161 | 181 | |
162 | 182 | |
| ||
189 | 209 | |
190 | 210 | |
191 | 211 | |
| 212 | + |
192 | 213 | |
193 | 214 | |
194 | | - |
195 | | - |
196 | | - |
197 | | - |
| 215 | + |
198 | 216 | |
199 | 217 | |
200 | 218 | |
|
Collapse file
test/parallel/test-crypto-prime.js
Copy file name to clipboardExpand all lines: test/parallel/test-crypto-prime.js+16Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
| 17 | + |
| 18 | + |
17 | 19 | |
18 | 20 | |
19 | 21 | |
| ||
295 | 297 | |
296 | 298 | |
297 | 299 | |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
| 305 | + |
| 306 | + |
| 307 | + |
| 308 | + |
| 309 | + |
| 310 | + |
| 311 | + |
| 312 | + |
| 313 | + |
0 commit comments