]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
schannel: use if(result) like the code style says
authorDaniel Stenberg <daniel@haxx.se>
Wed, 30 Jul 2025 08:38:08 +0000 (10:38 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 30 Jul 2025 09:26:04 +0000 (11:26 +0200)
instead of comparing != CURLE_OK

Closes #18094

lib/vtls/schannel.c

index 132ff93286ef9878e1e9b6921cd38ba6158142c2..4b751b21f405fdafcdfbfc44931bdca3af9aa052 100644 (file)
@@ -545,7 +545,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
   case CURL_SSLVERSION_TLSv1_3:
   {
     result = schannel_set_ssl_version_min_max(&enabled_protocols, cf, data);
-    if(result != CURLE_OK)
+    if(result)
       return result;
     break;
   }
@@ -843,7 +843,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
               "user set an algorithm cipher list.");
       }
       result = set_ssl_ciphers(&schannel_cred, ciphers, algIds);
-      if(CURLE_OK != result) {
+      if(result) {
         failf(data, "schannel: Failed setting algorithm cipher list");
         return result;
       }
@@ -1132,7 +1132,7 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
                              outbuf.pvBuffer, outbuf.cbBuffer, FALSE,
                              &written);
   Curl_pSecFn->FreeContextBuffer(outbuf.pvBuffer);
-  if((result != CURLE_OK) || (outbuf.cbBuffer != written)) {
+  if(result || (outbuf.cbBuffer != written)) {
     failf(data, "schannel: failed to send initial handshake data: "
           "sent %zu of %lu bytes", written, outbuf.cbBuffer);
     return CURLE_SSL_CONNECT_ERROR;
@@ -1241,7 +1241,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
                      "need more data"));
         return CURLE_OK;
       }
-      else if((result != CURLE_OK) || (nread == 0)) {
+      else if(result || (nread == 0)) {
         failf(data, "schannel: failed to receive handshake, "
               "SSL/TLS connection failed");
         return CURLE_SSL_CONNECT_ERROR;
@@ -1320,8 +1320,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
           result = Curl_conn_cf_send(cf->next, data,
                                      outbuf[i].pvBuffer, outbuf[i].cbBuffer,
                                      FALSE, &written);
-          if((result != CURLE_OK) ||
-             (outbuf[i].cbBuffer != written)) {
+          if(result || (outbuf[i].cbBuffer != written)) {
             failf(data, "schannel: failed to send next handshake data: "
                   "sent %zu of %lu bytes", written, outbuf[i].cbBuffer);
             return CURLE_SSL_CONNECT_ERROR;
@@ -1828,7 +1827,7 @@ schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data,
                                   FALSE, &this_write);
       if(result == CURLE_AGAIN)
         continue;
-      else if(result != CURLE_OK) {
+      else if(result) {
         break;
       }