]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix remaining OpenSSL BIO issues.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 31 Mar 2022 11:31:11 +0000 (07:31 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 31 Mar 2022 11:31:11 +0000 (07:31 -0400)
cups/tls-openssl.c

index 524789f956022a2c8301687240892a7558bf5fc9..b0615bfb9d6cee8933ead7d6842a38ae3377cda4 100644 (file)
@@ -1181,18 +1181,18 @@ http_bio_ctrl(BIO  *h,                  // I - BIO data
         return (0);
 
     case BIO_CTRL_RESET :
-        h->ptr = NULL;
+        BIO_set_data(h, NULL);
        return (0);
 
     case BIO_C_SET_FILE_PTR :
-        h->ptr  = arg2;
-       h->init = 1;
+        BIO_set_data(h, arg2);
+        BIO_set_init(h, 1);
        return (1);
 
     case BIO_C_GET_FILE_PTR :
         if (arg2)
        {
-         *((void **)arg2) = h->ptr;
+         *((void **)arg2) = BIO_get_data(h);
          return (1);
        }
        else
@@ -1215,11 +1215,8 @@ http_bio_free(BIO *h)                    // I - BIO data
   if (!h)
     return (0);
 
-  if (h->shutdown)
-  {
-    h->init  = 0;
-    h->flags = 0;
-  }
+  if (BIO_get_shutdown(h))
+    BIO_set_init(h, 0);
 
   return (1);
 }
@@ -1235,10 +1232,8 @@ http_bio_new(BIO *h)                     // I - BIO data
   if (!h)
     return (0);
 
-  h->init  = 0;
-  h->num   = 0;
-  h->ptr   = NULL;
-  h->flags = 0;
+  BIO_set_init(h, 0);
+  BIO_set_data(h, NULL);
 
   return (1);
 }
@@ -1253,9 +1248,9 @@ http_bio_puts(BIO        *h,              // I - BIO data
               const char *str)         // I - String to write
 {
 #ifdef WIN32
-  return (send(((http_t *)h->ptr)->fd, str, (int)strlen(str), 0));
+  return (send(((http_t *)BIO_get_data(h))->fd, str, (int)strlen(str), 0));
 #else
-  return ((int)send(((http_t *)h->ptr)->fd, str, strlen(str), 0));
+  return ((int)send(((http_t *)BIO_get_data(h))->fd, str, strlen(str), 0));
 #endif // WIN32
 }
 
@@ -1272,7 +1267,7 @@ http_bio_read(BIO  *h,                    // I - BIO data
   http_t       *http;                  // HTTP connection
 
 
-  http = (http_t *)h->ptr;
+  http = (http_t *)BIO_get_data(h);
 
   if (!http->blocking)
   {
@@ -1305,7 +1300,7 @@ http_bio_write(BIO        *h,             // I - BIO data
                const char *buf,                // I - Buffer to write
               int        num)          // I - Number of bytes to write
 {
-  return (send(((http_t *)h->ptr)->fd, buf, num, 0));
+  return (send(((http_t *)BIO_get_data(h))->fd, buf, num, 0));
 }