]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The libusb-based USB backend incorrectly used write timeouts
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 9 Dec 2013 19:26:39 +0000 (19:26 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 9 Dec 2013 19:26:39 +0000 (19:26 +0000)
(<rdar://problem/15564888>)

Closer to final server TLS APIs.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11455 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.7.txt
backend/usb-libusb.c
cups/cups.h
cups/http.h
cups/tls-darwin.c

index 286e2e1ae606a4b3e053e4240118dae965e2c59c..4e30d9fd3fd2732af76ba6c02236732dcfa03094 100644 (file)
@@ -22,6 +22,8 @@ CHANGES IN CUPS V1.7.1
        - Japanese PPDs using with the Shift-JIS encoding did not work
          (<rdar://problem/15427759>)
        - "tel:" URIs incorrectly had slashes (<rdar://problem/15418463>)
+       - The libusb-based USB backend incorrectly used write timeouts
+         (<rdar://problem/15564888>)
 
 
 CHANGES IN CUPS V1.7.0
index 20c3d1b56804abf888b1390d83db06b407034eb1..0a9162645bbb8715ac80dbc63367eea9f02c786a 100644 (file)
@@ -496,7 +496,7 @@ print_device(const char *uri,               /* I - Device URI */
        iostatus = libusb_bulk_transfer(g.printer->handle,
                                        g.printer->write_endp,
                                        print_buffer, g.print_bytes,
-                                       &bytes, 60000);
+                                       &bytes, 0);
        /*
        * Ignore timeout errors, but retain the number of bytes written to
        * avoid sending duplicate data...
@@ -519,7 +519,7 @@ print_device(const char *uri,               /* I - Device URI */
          iostatus = libusb_bulk_transfer(g.printer->handle,
                                          g.printer->write_endp,
                                          print_buffer, g.print_bytes,
-                                         &bytes, 60000);
+                                         &bytes, 0);
        }
 
        /*
@@ -534,7 +534,7 @@ print_device(const char *uri,               /* I - Device URI */
          iostatus = libusb_bulk_transfer(g.printer->handle,
                                          g.printer->write_endp,
                                          print_buffer, g.print_bytes,
-                                         &bytes, 60000);
+                                         &bytes, 0);
         }
 
        if (iostatus)
index dd109be111adf95fe035aeb1faeb89c8b6dea662..1d8ca6ae3dea146b03cef45f245381c354c28b16 100644 (file)
@@ -620,7 +620,8 @@ extern void         cupsSetUserAgent(const char *user_agent) _CUPS_API_1_7;
 extern const char      *cupsUserAgent(void) _CUPS_API_1_7;
 
 /* New in CUPS 2.0 */
-extern int             cupsSetServerCredentials(const char *path, const char *common_name) _CUPS_API_2_0;
+extern int             cupsMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date) _CUPS_API_2_0;
+extern int             cupsSetServerCredentials(const char *path, const char *common_name, int auto_create) _CUPS_API_2_0;
 
 #  ifdef __cplusplus
 }
index abc0f91044e986f2154bdab1f348d878bf1056e1..db40b8123b7285700c07814ccf0d3837fa772c04 100644 (file)
@@ -614,7 +614,9 @@ extern http_state_t httpWriteResponse(http_t *http,
 extern int             httpAddrClose(http_addr_t *addr, int fd) _CUPS_API_2_0;
 extern int             httpAddrFamily(http_addr_t *addr) _CUPS_API_2_0;
 extern int             httpCompareCredentials(cups_array_t *cred1, cups_array_t *cred2) _CUPS_API_2_0;
-extern time_t          httpCredentialsExpiration(cups_array_t *credentials) _CUPS_API_2_0;
+extern int             httpCredentialsAreTrusted(cups_array_t *credentials) _CUPS_API_2_0;
+extern time_t          httpCredentialsGetExpiration(cups_array_t *credentials) _CUPS_API_2_0;
+extern int             httpCredentialsIsValidName(cups_array_t *credentials, const char *common_name);
 extern size_t          httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize) _CUPS_API_2_0;
 extern http_field_t    httpFieldValue(const char *name) _CUPS_API_2_0;
 extern time_t          httpGetActivity(http_t *http) _CUPS_API_2_0;
@@ -627,11 +629,9 @@ extern size_t              httpGetRemaining(http_t *http) _CUPS_API_2_0;
 extern int             httpIsChunked(http_t *http) _CUPS_API_2_0;
 extern int             httpIsEncrypted(http_t *http) _CUPS_API_2_0;
 extern int             httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name) _CUPS_API_2_0;
-extern int             httpMakeServerCredentials(const char *path, const char *common_name, int num_alt_names, const char **alt_names, time_t expiration_date) _CUPS_API_2_0;
 extern const char      *httpResolveHostname(http_t *http, char *buffer, size_t bufsize) _CUPS_API_2_0;
 extern int             httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name) _CUPS_API_2_0;
 extern void            httpSetKeepAlive(http_t *http, http_keepalive_t keep_alive) _CUPS_API_2_0;
-extern int             httpSetServerCredentials(http_t *http, const char *path, const char *common_name) _CUPS_API_2_0;
 extern void            httpShutdown(http_t *http) _CUPS_API_2_0;
 extern const char      *httpStateString(http_state_t state);
 
index 4dda4f2d3b69840526ab63e9ae99ea3b5bd791d4..baaccdd28af9f38d05c4f0585b20b5b0d45f925d 100644 (file)
@@ -36,6 +36,52 @@ static OSStatus      http_cdsa_write(SSLConnectionRef connection, const void *data,
                                size_t *dataLength);
 
 
+/*
+ * 'cupsMakeServerCredentials()' - Make a self-signed certificate and private key pair.
+ *
+ * @since CUPS 2.0@
+ */
+
+int                                    /* O - 1 on success, 0 on failure */
+cupsMakeServerCredentials(
+    const char *path,                  /* I - Path to keychain/directory */
+    const char *common_name,           /* I - Common name */
+    int        num_alt_names,          /* I - Number of subject alternate names */
+    const char **alt_names,            /* I - Subject Alternate Names */
+    time_t     expiration_date)                /* I - Expiration date */
+{
+  (void)path;
+  (void)common_name;
+  (void)num_alt_names;
+  (void)alt_names;
+  (void)expiration_date;
+
+  return (0);
+}
+
+
+/*
+ * 'cupsSetServerCredentials()' - Set the default server credentials.
+ *
+ * Note: The server credentials are used by all threads in the running process.
+ * This function is threadsafe.
+ *
+ * @since CUPS 2.0@
+ */
+
+int                                    /* O - 1 on success, 0 on failure */
+cupsSetServerCredentials(
+    const char *path,                  /* I - Path to keychain/directory */
+    const char *common_name,           /* I - Default common name for server */
+    int        auto_create)            /* I - 1 = automatically create self-signed certificates */
+{
+  (void)path;
+  (void)common_name;
+  (void)auto_create;
+
+  return (0);
+}
+
 
 /*
  * 'httpCopyCredentials()' - Copy the credentials associated with the peer in
@@ -132,6 +178,56 @@ _httpCreateCredentials(
 }
 
 
+/*
+ * 'httpCredentialsAreTrusted()' - Return whether the credentials are trusted.
+ *
+ * @since CUPS 2.0@
+ */
+
+int                                    /* O - 1 if trusted, 0 if not/unknown */
+httpCredentialsAreTrusted(
+    cups_array_t *credentials)         /* I - Credentials */
+{
+  (void)credentials;
+
+  return (0);
+}
+
+
+/*
+ * 'httpCredentialsGetExpiration()' - Return the expiration date of the credentials.
+ *
+ * @since CUPS 2.0@
+ */
+
+time_t                                 /* O - Expiration date of credentials */
+httpCredentialsGetExpiration(
+    cups_array_t *credentials)         /* I - Credentials */
+{
+  (void)credentials;
+
+  return (0);
+}
+
+
+/*
+ * 'httpCredentialsIsValidName()' - Return whether the credentials are valid for the given name.
+ *
+ * @since CUPS 2.0@
+ */
+
+int                                    /* O - 1 if valid, 0 otherwise */
+httpCredentialsIsValidName(
+    cups_array_t *credentials,         /* I - Credentials */
+    const char   *common_name)         /* I - Name to check */
+{
+  (void)credentials;
+  (void)common_name;
+
+  return (0);
+}
+
+
 /*
  * 'httpCredentialsString()' - Return a string representing the credentials.
  *
@@ -259,14 +355,14 @@ httpLoadCredentials(
 
 #if 0
 /*
- * 'httpMakeCredentials()' - Create self-signed credentials for the given
+ * 'cupsMakeCredentials()' - Create self-signed credentials for the given
  *                           name.
  *
  * @since CUPS 2.0@
  */
 
 int                                    /* O - 0 on success, -1 on error */
-httpMakeCredentials(
+cupsMakeCredentials(
     const char   *path,                        /* I - Keychain/PKCS#12 path */
     cups_array_t **credentials,                /* O - Credentials */
     const char   *common_name)         /* I - Common name for X.509 cert */