feat(protocols): refactor protocol utilities into centralized protocols module
This commit is contained in:
37
ts/protocols/tls/index.ts
Normal file
37
ts/protocols/tls/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* TLS Protocol Module
|
||||
* Contains generic TLS protocol knowledge including parsers, constants, and utilities
|
||||
*/
|
||||
|
||||
// Export all sub-modules
|
||||
export * from './alerts/index.js';
|
||||
export * from './sni/index.js';
|
||||
export * from './utils/index.js';
|
||||
|
||||
// Re-export main utilities and types for convenience
|
||||
export {
|
||||
TlsUtils,
|
||||
TlsRecordType,
|
||||
TlsHandshakeType,
|
||||
TlsExtensionType,
|
||||
TlsAlertLevel,
|
||||
TlsAlertDescription,
|
||||
TlsVersion
|
||||
} from './utils/tls-utils.js';
|
||||
export { TlsAlert } from './alerts/tls-alert.js';
|
||||
export { ClientHelloParser } from './sni/client-hello-parser.js';
|
||||
export { SniExtraction } from './sni/sni-extraction.js';
|
||||
|
||||
// Export tlsVersionToString helper
|
||||
export function tlsVersionToString(major: number, minor: number): string | null {
|
||||
if (major === 0x03) {
|
||||
switch (minor) {
|
||||
case 0x00: return 'SSLv3';
|
||||
case 0x01: return 'TLSv1.0';
|
||||
case 0x02: return 'TLSv1.1';
|
||||
case 0x03: return 'TLSv1.2';
|
||||
case 0x04: return 'TLSv1.3';
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
Reference in New Issue
Block a user