Commit 881c837
Replace panic with Secp256k1 variant in HpkeError
The From<secp256k1::Error> impl for HpkeError panicked on any
variant other than InvalidPublicKey. If secp256k1 adds new Error
variants, this would cause a runtime panic instead of returning
a proper error.
Add a Secp256k1(secp256k1::Error) variant to HpkeError that
wraps unexpected secp256k1 errors, mirroring the existing
Hpke(hpke::HpkeError) pattern. Update Display and Error impls
to delegate to the wrapped error. Add a test verifying that
non-InvalidPublicKey variants convert safely.1 parent 3647419 commit 881c837
1 file changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| |||
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
289 | | - | |
290 | | - | |
291 | 290 | | |
292 | | - | |
| 291 | + | |
293 | 292 | | |
294 | 293 | | |
295 | 294 | | |
| |||
300 | 299 | | |
301 | 300 | | |
302 | 301 | | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
| |||
492 | 493 | | |
493 | 494 | | |
494 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
495 | 508 | | |
496 | 509 | | |
497 | 510 | | |
| |||
0 commit comments