MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | #ifndef LPC_TLS_H |
| 2 | #define LPC_TLS_H |
| 3 | |
| 4 | /* Field indices for the result of tls_query_connection_info() */ |
| 5 | |
| 6 | #define TLS_CIPHER 0 |
| 7 | #define TLS_COMP 1 |
| 8 | #define TLS_KX 2 |
| 9 | #define TLS_MAC 3 |
| 10 | #define TLS_PROT 4 |
| 11 | |
| 12 | #define TLS_INFO_MAX 5 /* Total number of result fields */ |
| 13 | |
| 14 | /* Interpretation of the cipher information */ |
| 15 | |
| 16 | #define TLS_CIPHER_TABLE ({ \ |
| 17 | "TLS_CIPHER_NONE", \ |
| 18 | "TLS_CIPHER_NULL", \ |
| 19 | "TLS_CIPHER_ARCFOUR_128", \ |
| 20 | "TLS_CIPHER_3DES_CBC", \ |
| 21 | "TLS_CIPHER_RIJNDAEL_128_CBC", \ |
| 22 | "TLS_CIPHER_RIJNDAEL_256_CBC", \ |
| 23 | "TLS_CIPHER_ARCFOUR_40" \ |
| 24 | }) |
| 25 | |
| 26 | #define TLS_CIPHER_NAME(x) TLS_CIPHER_TABLE[(x)] |
| 27 | |
| 28 | /* Interpretation of the key-exchange information */ |
| 29 | |
| 30 | #define TLS_KX_TABLE ({ \ |
| 31 | "TLS_KX_NONE", \ |
| 32 | "TLS_KX_RSA", \ |
| 33 | "TLS_KX_DHE_DSS", \ |
| 34 | "TLS_KX_DHE_RSA", \ |
| 35 | "TLS_KX_ANON_DH", \ |
| 36 | "TLS_KX_SRP", \ |
| 37 | "TLS_KX_RSA_EXPORT", \ |
| 38 | "TLS_KX_SRP_RSA", \ |
| 39 | "TLS_KX_SRP_DSS" \ |
| 40 | }) |
| 41 | |
| 42 | #define TLS_KX_NAME(x) TLS_KX_TABLE[(x)] |
| 43 | |
| 44 | /* Interpretation of the MAC information */ |
| 45 | |
| 46 | #define TLS_MAC_TABLE ({ \ |
| 47 | "TLS_MAC_NONE", \ |
| 48 | "TLS_MAC_NULL", \ |
| 49 | "TLS_MAC_MD5", \ |
| 50 | "TLS_MAC_SHA" \ |
| 51 | }) |
| 52 | |
| 53 | #define TLS_MAC_NAME(x) TLS_MAC_TABLE[(x)] |
| 54 | |
| 55 | /* Interpretation of the compression information */ |
| 56 | |
| 57 | #define TLS_COMP_TABLE ({ \ |
| 58 | "TLS_COMP_NONE", \ |
| 59 | "TLS_COMP_NULL", \ |
| 60 | "TLS_COMP_ZLIB", \ |
| 61 | "TLS_COMP_LZO" \ |
| 62 | }) |
| 63 | |
| 64 | #define TLS_COMP_NAME(x) TLS_COMP_TABLE[(x)] |
| 65 | |
| 66 | /* Interpretation of the protocol information */ |
| 67 | |
| 68 | #define TLS_PROT_TABLE ({ \ |
| 69 | "TLS_PROT_NONE", \ |
| 70 | "TLS_PROT_SSL3", \ |
| 71 | "TLS_PROT_TLS1" \ |
| 72 | }) |
| 73 | |
| 74 | #define TLS_PROT_NAME(x) TLS_PROT_TABLE[(x)] |
| 75 | |
| 76 | /* Recognized hash() algorithms (not all may be supported at runtime) */ |
| 77 | |
| 78 | #define TLS_HASH_SHA1 (1) |
| 79 | #define TLS_HASH_SHA224 (2) |
| 80 | #define TLS_HASH_SHA256 (3) |
| 81 | #define TLS_HASH_SHA384 (4) |
| 82 | #define TLS_HASH_SHA512 (5) |
| 83 | #define TLS_HASH_MD5 (6) |
| 84 | #define TLS_HASH_RIPEMD160 (7) |
| 85 | |
| 86 | #endif /* LPC_TLS_H */ |