Commit cd87223
committed
Fix error return check of EVP_CIPHER_CTX_ctrl()
OpenSSL can return -1 on error [1, 2], and OpenBSD's docs confirm this
[3]. Change all checks to <= 0.
[1] https://github.com/openssl/openssl/blob/b3161bd9a9329be3d6bf6b29a06835e2721898bb/crypto/evp/evp_enc.c#L1530-L1531
[2] https://github.com/openssl/openssl/blob/b3161bd9a9329be3d6bf6b29a06835e2721898bb/crypto/evp/evp_enc.c#L1611
[3] https://man.openbsd.org/EVP_CIPHER_CTX_ctrl.3
Closes GH-18987.1 parent b495ce0 commit cd87223
2 files changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7475 | 7475 | | |
7476 | 7476 | | |
7477 | 7477 | | |
7478 | | - | |
| 7478 | + | |
7479 | 7479 | | |
7480 | 7480 | | |
7481 | 7481 | | |
| |||
7547 | 7547 | | |
7548 | 7548 | | |
7549 | 7549 | | |
7550 | | - | |
| 7550 | + | |
7551 | 7551 | | |
7552 | 7552 | | |
7553 | 7553 | | |
7554 | 7554 | | |
7555 | 7555 | | |
7556 | 7556 | | |
7557 | 7557 | | |
7558 | | - | |
| 7558 | + | |
7559 | 7559 | | |
7560 | 7560 | | |
7561 | 7561 | | |
| |||
7693 | 7693 | | |
7694 | 7694 | | |
7695 | 7695 | | |
7696 | | - | |
| 7696 | + | |
7697 | 7697 | | |
7698 | 7698 | | |
7699 | 7699 | | |
| |||
0 commit comments