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