SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
32
lang/gerbil/patches/patch-src_std_crypto_libcrypto-rfc5114_c
Normal file
32
lang/gerbil/patches/patch-src_std_crypto_libcrypto-rfc5114_c
Normal file
|
@ -0,0 +1,32 @@
|
|||
Fix build with opaque DH in LibreSSL 3.5.
|
||||
|
||||
Index: src/std/crypto/libcrypto-rfc5114.c
|
||||
--- src/std/crypto/libcrypto-rfc5114.c.orig
|
||||
+++ src/std/crypto/libcrypto-rfc5114.c
|
||||
@@ -107,11 +107,22 @@ static BIGNUM* get_bn(BIGNUM **bn, const char *hex) {
|
||||
#define make_dh(param) \
|
||||
DH *DH_get_##param(void) { \
|
||||
DH *dh = DH_new (); \
|
||||
+ BIGNUM *p, *q, *g; \
|
||||
if (!dh) return NULL; \
|
||||
- dh->p = get_bn(&bn_dh##param##_p, dh##param##_p); \
|
||||
- dh->g = get_bn(&bn_dh##param##_g, dh##param##_g); \
|
||||
- dh->q = get_bn(&bn_dh##param##_q, dh##param##_q); \
|
||||
- if (!dh->p || !dh->q || !dh->g) { \
|
||||
+ p = get_bn(&bn_dh##param##_p, dh##param##_p); \
|
||||
+ g = get_bn(&bn_dh##param##_g, dh##param##_g); \
|
||||
+ q = get_bn(&bn_dh##param##_q, dh##param##_q); \
|
||||
+ if (!p || !q || !g) { \
|
||||
+ BN_free(p); \
|
||||
+ BN_free(q); \
|
||||
+ BN_free(g); \
|
||||
+ DH_free(dh); \
|
||||
+ return NULL; \
|
||||
+ } \
|
||||
+ if (!DH_set0_pqg(dh, p, q, g)) { \
|
||||
+ BN_free(p); \
|
||||
+ BN_free(q); \
|
||||
+ BN_free(g); \
|
||||
DH_free(dh); \
|
||||
return NULL; \
|
||||
} \
|
Loading…
Add table
Add a link
Reference in a new issue