7 /* TLS security level conversion
11 /* int tls_level_lookup(name)
14 /* const char *str_tls_level(level)
17 /* The macros in this module convert TLS levels from symbolic
18 /* name to internal form and vice versa. The macros are safe
19 /* because they evaluate their arguments only once.
21 /* tls_level_lookup() converts a TLS level from symbolic name
22 /* to internal form. When an unknown level is specified,
23 /* tls_level_lookup() logs no warning, and returns TLS_LEV_INVALID.
25 /* str_tls_level() converts a TLS level from internal form to
26 /* symbolic name. The result is a null pointer for an unknown
29 /* name_code(3) name to number mapping
33 /* The Secure Mailer license must be distributed with this software.
36 /* IBM T.J. Watson Research
38 /* Yorktown Heights, NY 10598, USA
48 /* Utility library. */
50 #include <name_code.h>
56 /* Application-specific. */
61 * Levels > "encrypt" are expected to match a peer certificate.
63 * Levels >= "verify" are expected to require a valid CA trust-chain
65 * This forces "fingerprint" between "encrypt" and "verify".
67 const NAME_CODE tls_level_table
[] = {
70 "encrypt", TLS_LEV_ENCRYPT
,
71 "fingerprint", TLS_LEV_FPRINT
,
72 "verify", TLS_LEV_VERIFY
,
73 "secure", TLS_LEV_SECURE
,