Add compression method name lookup in TLS parser
Resolves two TODO comments by implementing a compression method lookup table similar to the existing cipher suites and extensions lookups. Now displays human-readable names (null, DEFLATE, LZS) instead of raw numeric values when parsing TLS compression methods. Changes: - Added COMPRESSION_METHODS_LOOKUP constant with standard TLS compression methods - Updated parseServerHello to use lookup for compression method display - Updated parseCompressionMethods to use lookup for compression method display
This commit is contained in:
parent
2a1294f1c0
commit
30860abddb
@ -247,7 +247,7 @@ function parseServerHello(s, b, h) {
|
||||
description: "Selected Compression Method",
|
||||
length: 1,
|
||||
data: b.getBytes(1),
|
||||
value: s.readInt(1) // TODO: Compression method name here
|
||||
value: COMPRESSION_METHODS_LOOKUP[s.readInt(1)] || "Unknown"
|
||||
};
|
||||
|
||||
// Extensions Length
|
||||
@ -303,7 +303,7 @@ function parseCompressionMethods(bytes) {
|
||||
description: "Compression Method",
|
||||
length: 1,
|
||||
data: b.getBytes(1),
|
||||
value: s.readInt(1) // TODO: Compression method name here
|
||||
value: COMPRESSION_METHODS_LOOKUP[s.readInt(1)] || "Unknown"
|
||||
});
|
||||
}
|
||||
return cm;
|
||||
@ -836,6 +836,15 @@ export const GREASE_VALUES = [
|
||||
0xfafa
|
||||
];
|
||||
|
||||
/**
|
||||
* Compression methods lookup table
|
||||
*/
|
||||
const COMPRESSION_METHODS_LOOKUP = {
|
||||
0: "null",
|
||||
1: "DEFLATE",
|
||||
64: "LZS"
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses the supported_versions extension and returns the highest supported version.
|
||||
* @param {Uint8Array} bytes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user