]>
Commit | Line | Data |
---|---|---|
1a18c85c | 1 | /* |
5d2cc5d3 | 2 | * "$Id: tls.c 12136 2014-08-29 15:19:40Z msweet $" |
1a18c85c MS |
3 | * |
4 | * TLS routines for CUPS. | |
5 | * | |
6 | * Copyright 2007-2014 by Apple Inc. | |
7 | * Copyright 1997-2007 by Easy Software Products, all rights reserved. | |
8 | * | |
9 | * This file contains Kerberos support code, copyright 2006 by | |
10 | * Jelmer Vernooij. | |
11 | * | |
12 | * These coded instructions, statements, and computer programs are the | |
13 | * property of Apple Inc. and are protected by Federal copyright | |
14 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
15 | * which should have been included with this file. If this file is | |
16 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
17 | * | |
18 | * This file is subject to the Apple OS-Developed Software exception. | |
19 | */ | |
20 | ||
21 | /* | |
22 | * Include necessary headers... | |
23 | */ | |
24 | ||
25 | #include "cups-private.h" | |
26 | #include <fcntl.h> | |
27 | #include <math.h> | |
28 | #ifdef WIN32 | |
29 | # include <tchar.h> | |
30 | #else | |
31 | # include <signal.h> | |
32 | # include <sys/time.h> | |
33 | # include <sys/resource.h> | |
34 | #endif /* WIN32 */ | |
35 | #ifdef HAVE_POLL | |
36 | # include <poll.h> | |
37 | #endif /* HAVE_POLL */ | |
38 | ||
39 | ||
40 | /* | |
41 | * Local functions... | |
42 | */ | |
43 | ||
44 | #ifdef HAVE_SSL | |
45 | # ifdef HAVE_GNUTLS | |
46 | # include "tls-gnutls.c" | |
47 | # elif defined(HAVE_CDSASSL) | |
48 | # include "tls-darwin.c" | |
5d2cc5d3 | 49 | # elif defined(HAVE_SSPISSL) |
1a18c85c MS |
50 | # include "tls-sspi.c" |
51 | # endif /* HAVE_GNUTLS */ | |
5d2cc5d3 MS |
52 | #else |
53 | /* Stubs for when TLS is not supported/available */ | |
54 | int | |
55 | httpCopyCredentials(http_t *http, cups_array_t **credentials) | |
56 | { | |
57 | (void)http; | |
58 | if (credentials) | |
59 | *credentials = NULL; | |
60 | return (-1); | |
61 | } | |
62 | int | |
63 | httpCredentialsAreValidForName(cups_array_t *credentials, const char *common_name) | |
64 | { | |
65 | (void)credentials; | |
66 | (void)common_name; | |
67 | return (1); | |
68 | } | |
69 | time_t | |
70 | httpCredentialsGetExpiration(cups_array_t *credentials) | |
71 | { | |
72 | (void)credentials; | |
73 | return (INT_MAX); | |
74 | } | |
75 | http_trust_t | |
76 | httpCredentialsGetTrust(cups_array_t *credentials, const char *common_name) | |
77 | { | |
78 | (void)credentials; | |
79 | (void)common_name; | |
80 | return (HTTP_TRUST_OK); | |
81 | } | |
82 | size_t | |
83 | httpCredentialsString(cups_array_t *credentials, char *buffer, size_t bufsize) | |
84 | { | |
85 | (void)credentials; | |
86 | (void)bufsize; | |
87 | if (buffer) | |
88 | *buffer = '\0'; | |
89 | return (0); | |
90 | } | |
91 | int | |
92 | httpLoadCredentials(const char *path, cups_array_t **credentials, const char *common_name) | |
93 | { | |
94 | (void)path; | |
95 | (void)credentials; | |
96 | (void)common_name; | |
97 | return (-1); | |
98 | } | |
99 | int | |
100 | httpSaveCredentials(const char *path, cups_array_t *credentials, const char *common_name) | |
101 | { | |
102 | (void)path; | |
103 | (void)credentials; | |
104 | (void)common_name; | |
105 | return (-1); | |
106 | } | |
1a18c85c MS |
107 | #endif /* HAVE_SSL */ |
108 | ||
109 | ||
110 | /* | |
5d2cc5d3 | 111 | * End of "$Id: tls.c 12136 2014-08-29 15:19:40Z msweet $". |
1a18c85c | 112 | */ |