Bringing up TLS connections working.
[libradsec.git] / lib / rsp_tlscommon.c
1 /*
2  * Copyright (C) 2006-2009 Stig Venaas <venaas@uninett.no>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  */
8
9 #if defined HAVE_CONFIG_H
10 #include <config.h>
11 #endif
12
13 #if defined(RADPROT_TLS) || defined(RADPROT_DTLS)
14 #include <signal.h>
15 #include <sys/socket.h>
16 #include <netinet/in.h>
17 #include <netdb.h>
18 #include <string.h>
19 #include <unistd.h>
20 #include <limits.h>
21 #ifdef SYS_SOLARIS9
22 #include <fcntl.h>
23 #endif
24 #include <sys/time.h>
25 #include <sys/types.h>
26 #include <sys/select.h>
27 #include <ctype.h>
28 #include <sys/wait.h>
29 #include <arpa/inet.h>
30 #include <regex.h>
31 #include <libgen.h>
32 #include <pthread.h>
33 #include <openssl/ssl.h>
34 #include <openssl/rand.h>
35 #include <openssl/err.h>
36 #include <openssl/md5.h>
37 #include <openssl/x509v3.h>
38 #include "rsp_debug.h"
39 #include "rsp_list.h"
40 #include "rsp_hash.h"
41 #include "rsp_util.h"
42 #include "../hostport_types.h"
43 #include "../radsecproxy.h"
44
45 static struct hash *tlsconfs = NULL;
46
47 void ssl_init(void) {
48     time_t t;
49     pid_t pid;
50
51     SSL_load_error_strings();
52     SSL_library_init();
53
54     while (!RAND_status()) {
55         t = time(NULL);
56         pid = getpid();
57         RAND_seed((unsigned char *)&t, sizeof(time_t));
58         RAND_seed((unsigned char *)&pid, sizeof(pid));
59     }
60 }
61
62 static int pem_passwd_cb(char *buf, int size, int rwflag, void *userdata) {
63     int pwdlen = strlen(userdata);
64     if (rwflag != 0 || pwdlen > size) /* not for decryption or too large */
65         return 0;
66     memcpy(buf, userdata, pwdlen);
67     return pwdlen;
68 }
69
70 static int verify_cb(int ok, X509_STORE_CTX *ctx) {
71     char *buf = NULL;
72     X509 *err_cert;
73     int err, depth;
74
75     err_cert = X509_STORE_CTX_get_current_cert(ctx);
76     err = X509_STORE_CTX_get_error(ctx);
77     depth = X509_STORE_CTX_get_error_depth(ctx);
78
79     if (depth > MAX_CERT_DEPTH) {
80         ok = 0;
81         err = X509_V_ERR_CERT_CHAIN_TOO_LONG;
82         X509_STORE_CTX_set_error(ctx, err);
83     }
84
85     if (!ok) {
86         if (err_cert)
87             buf = X509_NAME_oneline(X509_get_subject_name(err_cert), NULL, 0);
88         debug(DBG_WARN, "verify error: num=%d:%s:depth=%d:%s", err, X509_verify_cert_error_string(err), depth, buf ? buf : "");
89         free(buf);
90         buf = NULL;
91
92         switch (err) {
93         case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
94             if (err_cert) {
95                 buf = X509_NAME_oneline(X509_get_issuer_name(err_cert), NULL, 0);
96                 if (buf) {
97                     debug(DBG_WARN, "\tIssuer=%s", buf);
98                     free(buf);
99                     buf = NULL;
100                 }
101             }
102             break;
103         case X509_V_ERR_CERT_NOT_YET_VALID:
104         case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
105             debug(DBG_WARN, "\tCertificate not yet valid");
106             break;
107         case X509_V_ERR_CERT_HAS_EXPIRED:
108             debug(DBG_WARN, "Certificate has expired");
109             break;
110         case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
111             debug(DBG_WARN, "Certificate no longer valid (after notAfter)");
112             break;
113         case X509_V_ERR_NO_EXPLICIT_POLICY:
114             debug(DBG_WARN, "No Explicit Certificate Policy");
115             break;
116         }
117     }
118 #ifdef DEBUG
119     printf("certificate verify returns %d\n", ok);
120 #endif
121     return ok;
122 }
123
124 #ifdef DEBUG
125 static void ssl_info_callback(const SSL *ssl, int where, int ret) {
126     const char *s;
127     int w;
128
129     w = where & ~SSL_ST_MASK;
130
131     if (w & SSL_ST_CONNECT)
132         s = "SSL_connect";
133     else if (w & SSL_ST_ACCEPT)
134         s = "SSL_accept";
135     else
136         s = "undefined";
137
138     if (where & SSL_CB_LOOP)
139         debug(DBG_DBG, "%s:%s\n", s, SSL_state_string_long(ssl));
140     else if (where & SSL_CB_ALERT) {
141         s = (where & SSL_CB_READ) ? "read" : "write";
142         debug(DBG_DBG, "SSL3 alert %s:%s:%s\n", s, SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret));
143     }
144     else if (where & SSL_CB_EXIT) {
145         if (ret == 0)
146             debug(DBG_DBG, "%s:failed in %s\n", s, SSL_state_string_long(ssl));
147         else if (ret < 0)
148             debug(DBG_DBG, "%s:error in %s\n", s, SSL_state_string_long(ssl));
149     }
150 }
151 #endif
152
153 static X509_VERIFY_PARAM *createverifyparams(char **poids) {
154     X509_VERIFY_PARAM *pm;
155     ASN1_OBJECT *pobject;
156     int i;
157
158     pm = X509_VERIFY_PARAM_new();
159     if (!pm)
160         return NULL;
161
162     for (i = 0; poids[i]; i++) {
163         pobject = OBJ_txt2obj(poids[i], 0);
164         if (!pobject) {
165             X509_VERIFY_PARAM_free(pm);
166             return NULL;
167         }
168         X509_VERIFY_PARAM_add0_policy(pm, pobject);
169     }
170
171     X509_VERIFY_PARAM_set_flags(pm, X509_V_FLAG_POLICY_CHECK | X509_V_FLAG_EXPLICIT_POLICY);
172     return pm;
173 }
174
175 static int tlsaddcacrl(SSL_CTX *ctx, struct tls *conf) {
176     STACK_OF(X509_NAME) *calist;
177     X509_STORE *x509_s;
178     unsigned long error;
179
180     if (!SSL_CTX_load_verify_locations(ctx, conf->cacertfile, conf->cacertpath)) {
181         while ((error = ERR_get_error()))
182             debug(DBG_ERR, "SSL: %s", ERR_error_string(error, NULL));
183         debug(DBG_ERR, "tlsaddcacrl: Error updating TLS context %s", conf->name);
184         return 0;
185     }
186
187         calist = conf->cacertfile ? SSL_load_client_CA_file(conf->cacertfile) : NULL;
188
189     if (!conf->cacertfile || calist) {
190         if (conf->cacertpath) {
191             if (!calist)
192                 calist = sk_X509_NAME_new_null();
193             if (!SSL_add_dir_cert_subjects_to_stack(calist, conf->cacertpath)) {
194                 sk_X509_NAME_free(calist);
195                 calist = NULL;
196             }
197         }
198     }
199     if (!calist) {
200         while ((error = ERR_get_error()))
201             debug(DBG_ERR, "SSL: %s", ERR_error_string(error, NULL));
202         debug(DBG_ERR, "tlsaddcacrl: Error adding CA subjects in TLS context %s", conf->name);
203         return 0;
204     }
205     ERR_clear_error(); /* add_dir_cert_subj returns errors on success */
206     SSL_CTX_set_client_CA_list(ctx, calist);
207
208     SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, verify_cb);
209     SSL_CTX_set_verify_depth(ctx, MAX_CERT_DEPTH + 1);
210
211     if (conf->crlcheck || conf->vpm) {
212         x509_s = SSL_CTX_get_cert_store(ctx);
213         if (conf->crlcheck)
214             X509_STORE_set_flags(x509_s, X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL);
215         if (conf->vpm)
216             X509_STORE_set1_param(x509_s, conf->vpm);
217     }
218
219     debug(DBG_DBG, "tlsaddcacrl: updated TLS context %s", conf->name);
220     return 1;
221 }
222
223 static SSL_CTX *tlscreatectx(uint8_t type, struct tls *conf) {
224     SSL_CTX *ctx = NULL;
225     unsigned long error;
226
227     switch (type) {
228 #ifdef RADPROT_TLS
229     case RAD_TLS:
230         ctx = SSL_CTX_new(TLSv1_method());
231         break;
232 #endif
233 #ifdef RADPROT_DTLS
234     case RAD_DTLS:
235         ctx = SSL_CTX_new(DTLSv1_method());
236         SSL_CTX_set_read_ahead(ctx, 1);
237         break;
238 #endif
239     }
240     if (!ctx) {
241         debug(DBG_ERR, "tlscreatectx: Error initialising SSL/TLS in TLS context %s", conf->name);
242         while ((error = ERR_get_error()))
243             debug(DBG_ERR, "SSL: %s", ERR_error_string(error, NULL));
244         return NULL;
245     }
246 #ifdef DEBUG
247         SSL_CTX_set_info_callback(ctx, ssl_info_callback);
248 #endif
249
250     if (conf->certkeypwd) {
251         SSL_CTX_set_default_passwd_cb_userdata(ctx, conf->certkeypwd);
252         SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_cb);
253     }
254     if (conf->certfile || conf->certkeyfile) {
255         if (!SSL_CTX_use_certificate_chain_file(ctx, conf->certfile) ||
256             !SSL_CTX_use_PrivateKey_file(ctx, conf->certkeyfile, SSL_FILETYPE_PEM) ||
257             !SSL_CTX_check_private_key(ctx)) {
258             while ((error = ERR_get_error()))
259                 debug(DBG_ERR, "SSL: %s", ERR_error_string(error, NULL));
260             debug(DBG_ERR, "tlscreatectx: Error initialising SSL/TLS (certfile issues) in TLS context %s", conf->name);
261             SSL_CTX_free(ctx);
262             return NULL;
263         }
264     }
265
266     if (conf->policyoids) {
267         if (!conf->vpm) {
268             conf->vpm = createverifyparams(conf->policyoids);
269             if (!conf->vpm) {
270                 debug(DBG_ERR, "tlscreatectx: Failed to add policyOIDs in TLS context %s", conf->name);
271                 SSL_CTX_free(ctx);
272                 return NULL;
273             }
274         }
275     }
276
277     if (!tlsaddcacrl(ctx, conf)) {
278         if (conf->vpm) {
279             X509_VERIFY_PARAM_free(conf->vpm);
280             conf->vpm = NULL;
281         }
282         SSL_CTX_free(ctx);
283         return NULL;
284     }
285
286     debug(DBG_DBG, "tlscreatectx: created TLS context %s", conf->name);
287     return ctx;
288 }
289
290 struct tls *tlsgettls(char *alt1, char *alt2) {
291     struct tls *t;
292
293     t = hash_read(tlsconfs, alt1, strlen(alt1));
294     if (!t)
295         t = hash_read(tlsconfs, alt2, strlen(alt2));
296     return t;
297 }
298
299 SSL_CTX *tlsgetctx(uint8_t type, struct tls *t) {
300     struct timeval now;
301
302     if (!t)
303         return NULL;
304     gettimeofday(&now, NULL);
305
306     switch (type) {
307 #ifdef RADPROT_TLS
308     case RAD_TLS:
309         if (t->tlsexpiry && t->tlsctx) {
310             if (t->tlsexpiry < now.tv_sec) {
311                 t->tlsexpiry = now.tv_sec + t->cacheexpiry;
312                 tlsaddcacrl(t->tlsctx, t);
313             }
314         }
315         if (!t->tlsctx) {
316             t->tlsctx = tlscreatectx(RAD_TLS, t);
317             if (t->cacheexpiry)
318                 t->tlsexpiry = now.tv_sec + t->cacheexpiry;
319         }
320         return t->tlsctx;
321 #endif
322 #ifdef RADPROT_DTLS
323     case RAD_DTLS:
324         if (t->dtlsexpiry && t->dtlsctx) {
325             if (t->dtlsexpiry < now.tv_sec) {
326                 t->dtlsexpiry = now.tv_sec + t->cacheexpiry;
327                 tlsaddcacrl(t->dtlsctx, t);
328             }
329         }
330         if (!t->dtlsctx) {
331             t->dtlsctx = tlscreatectx(RAD_DTLS, t);
332             if (t->cacheexpiry)
333                 t->dtlsexpiry = now.tv_sec + t->cacheexpiry;
334         }
335         return t->dtlsctx;
336 #endif
337     }
338     return NULL;
339 }
340
341 X509 *verifytlscert(SSL *ssl) {
342     X509 *cert;
343     unsigned long error;
344
345     if (SSL_get_verify_result(ssl) != X509_V_OK) {
346         debug(DBG_ERR, "verifytlscert: basic validation failed");
347         while ((error = ERR_get_error()))
348             debug(DBG_ERR, "verifytlscert: TLS: %s", ERR_error_string(error, NULL));
349         return NULL;
350     }
351
352     cert = SSL_get_peer_certificate(ssl);
353     if (!cert)
354         debug(DBG_ERR, "verifytlscert: failed to obtain certificate");
355     return cert;
356 }
357
358 static int subjectaltnameaddr(X509 *cert, int family, struct in6_addr *addr) {
359     int loc, i, l, n, r = 0;
360     char *v;
361     X509_EXTENSION *ex;
362     STACK_OF(GENERAL_NAME) *alt;
363     GENERAL_NAME *gn;
364
365     debug(DBG_DBG, "subjectaltnameaddr");
366
367     loc = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1);
368     if (loc < 0)
369         return r;
370
371     ex = X509_get_ext(cert, loc);
372     alt = X509V3_EXT_d2i(ex);
373     if (!alt)
374         return r;
375
376     n = sk_GENERAL_NAME_num(alt);
377     for (i = 0; i < n; i++) {
378         gn = sk_GENERAL_NAME_value(alt, i);
379         if (gn->type != GEN_IPADD)
380             continue;
381         r = -1;
382         v = (char *)ASN1_STRING_data(gn->d.ia5);
383         l = ASN1_STRING_length(gn->d.ia5);
384         if (((family == AF_INET && l == sizeof(struct in_addr)) || (family == AF_INET6 && l == sizeof(struct in6_addr)))
385             && !memcmp(v, &addr, l)) {
386             r = 1;
387             break;
388         }
389     }
390     GENERAL_NAMES_free(alt);
391     return r;
392 }
393
394 static int subjectaltnameregexp(X509 *cert, int type, char *exact,  regex_t *regex) {
395     int loc, i, l, n, r = 0;
396     char *s, *v;
397     X509_EXTENSION *ex;
398     STACK_OF(GENERAL_NAME) *alt;
399     GENERAL_NAME *gn;
400
401     debug(DBG_DBG, "subjectaltnameregexp");
402
403     loc = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1);
404     if (loc < 0)
405         return r;
406
407     ex = X509_get_ext(cert, loc);
408     alt = X509V3_EXT_d2i(ex);
409     if (!alt)
410         return r;
411
412     n = sk_GENERAL_NAME_num(alt);
413     for (i = 0; i < n; i++) {
414         gn = sk_GENERAL_NAME_value(alt, i);
415         if (gn->type != type)
416             continue;
417         r = -1;
418         v = (char *)ASN1_STRING_data(gn->d.ia5);
419         l = ASN1_STRING_length(gn->d.ia5);
420         if (l <= 0)
421             continue;
422 #ifdef DEBUG
423         printfchars(NULL, gn->type == GEN_DNS ? "dns" : "uri", NULL, v, l);
424 #endif
425         if (exact) {
426             if (memcmp(v, exact, l))
427                 continue;
428         } else {
429             s = stringcopy((char *)v, l);
430             if (!s) {
431                 debug(DBG_ERR, "malloc failed");
432                 continue;
433             }
434             if (regexec(regex, s, 0, NULL, 0)) {
435                 free(s);
436                 continue;
437             }
438             free(s);
439         }
440         r = 1;
441         break;
442     }
443     GENERAL_NAMES_free(alt);
444     return r;
445 }
446
447 static int cnregexp(X509 *cert, char *exact, regex_t *regex) {
448     int loc, l;
449     char *v, *s;
450     X509_NAME *nm;
451     X509_NAME_ENTRY *e;
452     ASN1_STRING *t;
453
454     nm = X509_get_subject_name(cert);
455     loc = -1;
456     for (;;) {
457         loc = X509_NAME_get_index_by_NID(nm, NID_commonName, loc);
458         if (loc == -1)
459             break;
460         e = X509_NAME_get_entry(nm, loc);
461         t = X509_NAME_ENTRY_get_data(e);
462         v = (char *) ASN1_STRING_data(t);
463         l = ASN1_STRING_length(t);
464         if (l < 0)
465             continue;
466         if (exact) {
467             if (l == strlen(exact) && !strncasecmp(exact, v, l))
468                 return 1;
469         } else {
470             s = stringcopy((char *)v, l);
471             if (!s) {
472                 debug(DBG_ERR, "malloc failed");
473                 continue;
474             }
475             if (regexec(regex, s, 0, NULL, 0)) {
476                 free(s);
477                 continue;
478             }
479             free(s);
480             return 1;
481         }
482     }
483     return 0;
484 }
485
486 /* this is a bit sloppy, should not always accept match to any */
487 int certnamecheck(X509 *cert, struct list *hostports) {
488     struct list_node *entry;
489     struct hostportres *hp;
490     int r;
491     uint8_t type = 0; /* 0 for DNS, AF_INET for IPv4, AF_INET6 for IPv6 */
492     struct in6_addr addr;
493
494     for (entry = list_first(hostports); entry; entry = list_next(entry)) {
495         hp = (struct hostportres *)entry->data;
496         if (hp->prefixlen != 255) {
497             /* we disable the check for prefixes */
498             return 1;
499         }
500         if (inet_pton(AF_INET, hp->host, &addr))
501             type = AF_INET;
502         else if (inet_pton(AF_INET6, hp->host, &addr))
503             type = AF_INET6;
504         else
505             type = 0;
506
507         r = type ? subjectaltnameaddr(cert, type, &addr) : subjectaltnameregexp(cert, GEN_DNS, hp->host, NULL);
508         if (r) {
509             if (r > 0) {
510                 debug(DBG_DBG, "certnamecheck: Found subjectaltname matching %s %s", type ? "address" : "host", hp->host);
511                 return 1;
512             }
513             debug(DBG_WARN, "certnamecheck: No subjectaltname matching %s %s", type ? "address" : "host", hp->host);
514         } else {
515             if (cnregexp(cert, hp->host, NULL)) {
516                 debug(DBG_DBG, "certnamecheck: Found cn matching host %s", hp->host);
517                 return 1;
518             }
519             debug(DBG_WARN, "certnamecheck: cn not matching host %s", hp->host);
520         }
521     }
522     return 0;
523 }
524
525 int verifyconfcert(X509 *cert, struct clsrvconf *conf) {
526     if (conf->certnamecheck) {
527         if (!certnamecheck(cert, conf->hostports)) {
528             debug(DBG_WARN, "verifyconfcert: certificate name check failed");
529             return 0;
530         }
531         debug(DBG_WARN, "verifyconfcert: certificate name check ok");
532     }
533     if (conf->certcnregex) {
534         if (cnregexp(cert, NULL, conf->certcnregex) < 1) {
535             debug(DBG_WARN, "verifyconfcert: CN not matching regex");
536             return 0;
537         }
538         debug(DBG_DBG, "verifyconfcert: CN matching regex");
539     }
540     if (conf->certuriregex) {
541         if (subjectaltnameregexp(cert, GEN_URI, NULL, conf->certuriregex) < 1) {
542             debug(DBG_WARN, "verifyconfcert: subjectaltname URI not matching regex");
543             return 0;
544         }
545         debug(DBG_DBG, "verifyconfcert: subjectaltname URI matching regex");
546     }
547     return 1;
548 }
549
550 #if 0
551 int conftls_cb(struct gconffile **cf, void *arg, char *block, char *opt, char *val) {
552     struct tls *conf;
553     long int expiry = LONG_MIN;
554
555     debug(DBG_DBG, "conftls_cb called for %s", block);
556
557     conf = malloc(sizeof(struct tls));
558     if (!conf) {
559         debug(DBG_ERR, "conftls_cb: malloc failed");
560         return 0;
561     }
562     memset(conf, 0, sizeof(struct tls));
563
564     if (!getgenericconfig(cf, block,
565                           "CACertificateFile", CONF_STR, &conf->cacertfile,
566                           "CACertificatePath", CONF_STR, &conf->cacertpath,
567                           "CertificateFile", CONF_STR, &conf->certfile,
568                           "CertificateKeyFile", CONF_STR, &conf->certkeyfile,
569                           "CertificateKeyPassword", CONF_STR, &conf->certkeypwd,
570                           "CacheExpiry", CONF_LINT, &expiry,
571                           "CRLCheck", CONF_BLN, &conf->crlcheck,
572                           "PolicyOID", CONF_MSTR, &conf->policyoids,
573                           NULL
574             )) {
575         debug(DBG_ERR, "conftls_cb: configuration error in block %s", val);
576         goto errexit;
577     }
578     if (!conf->certfile || !conf->certkeyfile) {
579         debug(DBG_ERR, "conftls_cb: TLSCertificateFile and TLSCertificateKeyFile must be specified in block %s", val);
580         goto errexit;
581     }
582     if (!conf->cacertfile && !conf->cacertpath) {
583         debug(DBG_ERR, "conftls_cb: CA Certificate file or path need to be specified in block %s", val);
584         goto errexit;
585     }
586     if (expiry != LONG_MIN) {
587         if (expiry < 0) {
588             debug(DBG_ERR, "error in block %s, value of option CacheExpiry is %ld, may not be negative", val, expiry);
589             goto errexit;
590         }
591         conf->cacheexpiry = expiry;
592     }
593
594     conf->name = stringcopy(val, 0);
595     if (!conf->name) {
596         debug(DBG_ERR, "conftls_cb: malloc failed");
597         goto errexit;
598     }
599
600     if (!tlsconfs)
601         tlsconfs = hash_create();
602     if (!hash_insert(tlsconfs, val, strlen(val), conf)) {
603         debug(DBG_ERR, "conftls_cb: malloc failed");
604         goto errexit;
605     }
606     if (!tlsgetctx(RAD_TLS, conf))
607         debug(DBG_ERR, "conftls_cb: error creating ctx for TLS block %s", val);
608     debug(DBG_DBG, "conftls_cb: added TLS block %s", val);
609     return 1;
610
611 errexit:
612     free(conf->cacertfile);
613     free(conf->cacertpath);
614     free(conf->certfile);
615     free(conf->certkeyfile);
616     free(conf->certkeypwd);
617     freegconfmstr(conf->policyoids);
618     free(conf);
619     return 0;
620 }
621 #endif
622
623 int addmatchcertattr(struct clsrvconf *conf) {
624     char *v;
625     regex_t **r;
626
627     if (!strncasecmp(conf->matchcertattr, "CN:/", 4)) {
628         r = &conf->certcnregex;
629         v = conf->matchcertattr + 4;
630     } else if (!strncasecmp(conf->matchcertattr, "SubjectAltName:URI:/", 20)) {
631         r = &conf->certuriregex;
632         v = conf->matchcertattr + 20;
633     } else
634         return 0;
635     if (!*v)
636         return 0;
637     /* regexp, remove optional trailing / if present */
638     if (v[strlen(v) - 1] == '/')
639         v[strlen(v) - 1] = '\0';
640     if (!*v)
641         return 0;
642
643     *r = malloc(sizeof(regex_t));
644     if (!*r) {
645         debug(DBG_ERR, "malloc failed");
646         return 0;
647     }
648     if (regcomp(*r, v, REG_EXTENDED | REG_ICASE | REG_NOSUB)) {
649         free(*r);
650         *r = NULL;
651         debug(DBG_ERR, "failed to compile regular expression %s", v);
652         return 0;
653     }
654     return 1;
655 }
656 #else
657 /* Just to makes file non-empty, should rather avoid compiling this file when not needed */
658 static void tlsdummy() {
659 }
660 #endif
661
662 /* Local Variables: */
663 /* c-file-style: "stroustrup" */
664 /* End: */