]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: adapt to boringssl's error code type
authorDaniel Stenberg <daniel@haxx.se>
Sun, 29 Jan 2023 11:26:18 +0000 (12:26 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 29 Jan 2023 21:35:40 +0000 (22:35 +0100)
BoringSSL uses uint32_t, OpenSSL uses 'unsigned 'long'

Closes #10360

lib/vtls/openssl.c

index 31a8bfc4f80ba7af5d7f5007cb4e06d7a5e2605e..ffd9e85e7662239afa9fce0ab4a94f93494e876a 100644 (file)
 #define HAVE_OPENSSL_VERSION
 #endif
 
+#ifdef OPENSSL_IS_BORINGSSL
+typedef uint32_t errcode_t;
+#else
+typedef unsigned long errcode_t;
+#endif
+
 /*
  * Whether the OpenSSL version has the API needed to support sharing an
  * X509_STORE between connections. The API is:
@@ -1225,7 +1231,7 @@ SSL_CTX_use_certificate_chain_blob(SSL_CTX *ctx, const struct curl_blob *blob,
 
   if(ret) {
     X509 *ca;
-    unsigned long err;
+    errcode_t err;
 
     if(!SSL_CTX_clear_chain_certs(ctx)) {
       ret = 0;
@@ -3942,7 +3948,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
     }
     else {
       /* untreated error */
-      unsigned long errdetail;
+      errcode_t errdetail;
       char error_buffer[256]="";
       CURLcode result;
       long lerr;
@@ -4520,7 +4526,7 @@ static ssize_t ossl_send(struct Curl_cfilter *cf,
      'size_t' */
   int err;
   char error_buffer[256];
-  unsigned long sslerror;
+  errcode_t sslerror;
   int memlen;
   int rc;
   struct ssl_connect_data *connssl = cf->ctx;