diff options
Diffstat (limited to 'cups/http-private.h')
-rw-r--r-- | cups/http-private.h | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/cups/http-private.h b/cups/http-private.h index f71e564b..32cb9ea5 100644 --- a/cups/http-private.h +++ b/cups/http-private.h @@ -1,7 +1,7 @@ /* * Private HTTP definitions for CUPS. * - * Copyright 2007-2017 by Apple Inc. + * Copyright 2007-2018 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * These coded instructions, statements, and computer programs are the @@ -30,7 +30,7 @@ # endif /* __sun */ # include <limits.h> -# ifdef WIN32 +# ifdef _WIN32 # include <io.h> # include <winsock2.h> # define CUPS_SOCAST (const char *) @@ -39,7 +39,7 @@ # include <fcntl.h> # include <sys/socket.h> # define CUPS_SOCAST -# endif /* WIN32 */ +# endif /* _WIN32 */ # ifdef HAVE_GSSAPI # ifdef HAVE_GSS_GSSAPI_H @@ -68,7 +68,6 @@ typedef int socklen_t; # endif /* __APPLE__ && !_SOCKLEN_T */ # include <cups/http.h> -# include "md5-private.h" # include "ipp-private.h" # ifdef HAVE_GNUTLS @@ -141,7 +140,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate # include <sspi.h> # endif /* HAVE_GNUTLS */ -# ifndef WIN32 +# ifndef _WIN32 # include <net/if.h> # include <resolv.h> # ifdef HAVE_GETIFADDRS @@ -152,11 +151,7 @@ extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificate # include <sys/sockio.h> # endif /* HAVE_SYS_SOCKIO_H */ # endif /* HAVE_GETIFADDRS */ -# endif /* !WIN32 */ - -# ifdef HAVE_LIBZ -# include <zlib.h> -# endif /* HAVE_LIBZ */ +# endif /* !_WIN32 */ /* @@ -180,13 +175,17 @@ extern "C" { # define _HTTP_TLS_NONE 0 /* No TLS options */ # define _HTTP_TLS_ALLOW_RC4 1 /* Allow RC4 cipher suites */ -# define _HTTP_TLS_ALLOW_SSL3 2 /* Allow SSL 3.0 */ -# define _HTTP_TLS_ALLOW_DH 4 /* Allow DH/DHE key negotiation */ -# define _HTTP_TLS_DENY_TLS10 16 /* Deny TLS 1.0 */ -# define _HTTP_TLS_DENY_CBC 32 /* Deny CBC cipher suites */ -# define _HTTP_TLS_ONLY_TLS10 64 /* Only use TLS 1.0 */ +# define _HTTP_TLS_ALLOW_DH 2 /* Allow DH/DHE key negotiation */ +# define _HTTP_TLS_DENY_CBC 4 /* Deny CBC cipher suites */ # define _HTTP_TLS_SET_DEFAULT 128 /* Setting the default TLS options */ +# define _HTTP_TLS_SSL3 0 /* Min/max version is SSL/3.0 */ +# define _HTTP_TLS_1_0 1 /* Min/max version is TLS/1.0 */ +# define _HTTP_TLS_1_1 2 /* Min/max version is TLS/1.1 */ +# define _HTTP_TLS_1_2 3 /* Min/max version is TLS/1.2 */ +# define _HTTP_TLS_1_3 4 /* Min/max version is TLS/1.3 */ +# define _HTTP_TLS_MAX 5 /* Highest known TLS version */ + /* * Types and functions for SSL support... @@ -297,10 +296,10 @@ struct _http_s /**** HTTP connection structure ****/ char buffer[HTTP_MAX_BUFFER]; /* Buffer for incoming data */ int _auth_type; /* Authentication in use (deprecated) */ - _cups_md5_state_t md5_state; /* MD5 state */ + unsigned char _md5_state[88]; /* MD5 state (deprecated) */ char nonce[HTTP_MAX_VALUE]; /* Nonce value */ - int nonce_count; /* Nonce count */ + unsigned nonce_count; /* Nonce count */ http_tls_t tls; /* TLS state information */ http_encryption_t encryption; /* Encryption requirements */ @@ -361,9 +360,20 @@ struct _http_s /**** HTTP connection structure ****/ /* Default field values */ # ifdef HAVE_LIBZ _http_coding_t coding; /* _HTTP_CODING_xxx */ - z_stream stream; /* (De)compression stream */ - Bytef *sbuffer; /* (De)compression buffer */ + void *stream; /* (De)compression stream */ + unsigned char *sbuffer; /* (De)compression buffer */ # endif /* HAVE_LIBZ */ + + /**** New in CUPS 2.2.9 ****/ + char *authentication_info, + /* Authentication-Info header */ + algorithm[65], /* Algorithm from WWW-Authenticate */ + nextnonce[HTTP_MAX_VALUE], + /* Next nonce value from Authentication-Info */ + opaque[HTTP_MAX_VALUE], + /* Opaque value from WWW-Authenticate */ + realm[HTTP_MAX_VALUE]; + /* Realm from WWW-Authenticate */ }; # endif /* !_HTTP_NO_PRIVATE */ @@ -382,7 +392,7 @@ extern const char *_cups_hstrerror(int error); * Some OS's don't have getifaddrs() and freeifaddrs()... */ -# if !defined(WIN32) && !defined(HAVE_GETIFADDRS) +# if !defined(_WIN32) && !defined(HAVE_GETIFADDRS) # ifdef ifa_dstaddr # undef ifa_dstaddr # endif /* ifa_dstaddr */ @@ -417,7 +427,7 @@ extern int _cups_getifaddrs(struct ifaddrs **addrs); # define getifaddrs _cups_getifaddrs extern void _cups_freeifaddrs(struct ifaddrs *addrs); # define freeifaddrs _cups_freeifaddrs -# endif /* !WIN32 && !HAVE_GETIFADDRS */ +# endif /* !_WIN32 && !HAVE_GETIFADDRS */ /* @@ -437,12 +447,13 @@ extern const char *_httpResolveURI(const char *uri, char *resolved_uri, size_t resolved_size, int options, int (*cb)(void *context), void *context); +extern int _httpSetDigestAuthString(http_t *http, const char *nonce, const char *method, const char *resource); extern const char *_httpStatus(cups_lang_t *lang, http_status_t status); extern void _httpTLSInitialize(void); extern size_t _httpTLSPending(http_t *http); extern int _httpTLSRead(http_t *http, char *buf, int len); extern int _httpTLSSetCredentials(http_t *http); -extern void _httpTLSSetOptions(int options); +extern void _httpTLSSetOptions(int options, int min_version, int max_version); extern int _httpTLSStart(http_t *http); extern void _httpTLSStop(http_t *http); extern int _httpTLSWrite(http_t *http, const char *buf, int len); |