libcurl.patch 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. --- curl-7.80.0/lib/curl_config.h 2021-12-01 10:20:21.000000000 +0000
  2. +++ libcurl.mod/libcurl/lib/curl_config.h 2021-12-01 23:22:50.000000000 +0000
  3. @@ -56,7 +56,7 @@
  4. /* #undef CURL_DISABLE_IMAP */
  5. /* to disable LDAP */
  6. -/* #undef CURL_DISABLE_LDAP */
  7. +#define CURL_DISABLE_LDAP 1
  8. /* to disable LDAPS */
  9. /* #undef CURL_DISABLE_LDAPS */
  10. @@ -400,7 +400,7 @@
  11. /* #undef HAVE_LIBSSH2 */
  12. /* Define to 1 if you have the <libssh2.h> header file. */
  13. -/* #undef HAVE_LIBSSH2_H */
  14. +#define HAVE_LIBSSH2_H 1
  15. /* Define to 1 if you have the <libssh/libssh.h> header file. */
  16. /* #undef HAVE_LIBSSH_LIBSSH_H */
  17. @@ -964,7 +964,7 @@
  18. #define USE_MANUAL 1
  19. /* if mbedTLS is enabled */
  20. -/* #undef USE_MBEDTLS */
  21. +#define USE_MBEDTLS 1
  22. /* if MesaLink is enabled */
  23. /* #undef USE_MESALINK */
  24. --- curl-7.80.0/lib/vtls/mbedtls.c 2021-11-09 07:35:38.000000000 +0000
  25. +++ libcurl.mod/libcurl/lib/vtls/mbedtls.c 2021-12-02 21:19:33.000000000 +0000
  26. @@ -440,13 +440,9 @@
  27. infof(data, "mbedTLS: Connecting to %s:%ld", hostname, port);
  28. - mbedtls_ssl_config_init(&backend->config);
  29. + mbedtls_ssl_config_init(&backend->config);
  30. mbedtls_ssl_init(&backend->ssl);
  31. - if(mbedtls_ssl_setup(&backend->ssl, &backend->config)) {
  32. - failf(data, "mbedTLS: ssl_init failed");
  33. - return CURLE_SSL_CONNECT_ERROR;
  34. - }
  35. ret = mbedtls_ssl_config_defaults(&backend->config,
  36. MBEDTLS_SSL_IS_CLIENT,
  37. MBEDTLS_SSL_TRANSPORT_STREAM,
  38. @@ -456,6 +452,11 @@
  39. return CURLE_SSL_CONNECT_ERROR;
  40. }
  41. + if(mbedtls_ssl_setup(&backend->ssl, &backend->config)) {
  42. + failf(data, "mbedTLS: ssl_init failed");
  43. + return CURLE_SSL_CONNECT_ERROR;
  44. + }
  45. +
  46. /* new profile with RSA min key len = 1024 ... */
  47. mbedtls_ssl_conf_cert_profile(&backend->config,
  48. &mbedtls_x509_crt_profile_fr);
  49. @@ -672,8 +673,8 @@
  50. unsigned char *pubkey = NULL;
  51. #if MBEDTLS_VERSION_NUMBER >= 0x03000000
  52. - if(!peercert || !peercert->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(p) ||
  53. - !peercert->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(len)) {
  54. + if(!peercert || !peercert->raw.p ||
  55. + !peercert->raw.len) {
  56. #else
  57. if(!peercert || !peercert->raw.p || !peercert->raw.len) {
  58. #endif
  59. @@ -700,8 +701,8 @@
  60. https://github.com/ARMmbed/mbedtls/issues/396 */
  61. #if MBEDTLS_VERSION_NUMBER >= 0x03000000
  62. if(mbedtls_x509_crt_parse_der(p,
  63. - peercert->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(p),
  64. - peercert->MBEDTLS_PRIVATE(raw).MBEDTLS_PRIVATE(len))) {
  65. + peercert->raw.p,
  66. + peercert->raw.len)) {
  67. #else
  68. if(mbedtls_x509_crt_parse_der(p, peercert->raw.p, peercert->raw.len)) {
  69. #endif
  70. @@ -711,7 +712,7 @@
  71. }
  72. #if MBEDTLS_VERSION_NUMBER >= 0x03000000
  73. - size = mbedtls_pk_write_pubkey_der(&p->MBEDTLS_PRIVATE(pk), pubkey,
  74. + size = mbedtls_pk_write_pubkey_der(&p->pk, pubkey,
  75. PUB_DER_MAX_BYTES);
  76. #else
  77. size = mbedtls_pk_write_pubkey_der(&p->pk, pubkey, PUB_DER_MAX_BYTES);