lib/core/jarm_calc.py
def supported_versions(jarm_details: List[str or int], grease: bool) -> bytes:
    """
    Supported version extension for client hello
    :param jarm_details:
    :param grease:
    :return:
    """
    if (jarm_details[7] == "1.2_SUPPORT"):
        #TLS 1.3 is not supported
        tls = [b"\x03\x01", b"\x03\x02", b"\x03\x03"]
    else:
        #TLS 1.3 is supported
        tls = [b"\x03\x01", b"\x03\x02", b"\x03\x03", b"\x03\x04"]
    #Change supported version order, by default, the versions are from oldest to newest
    if jarm_details[8] != "FORWARD":
        tls = cipher_mung(tls, jarm_details[8])
    #Assemble the extension
    ext = b"\x00\x2b"
    #Add GREASE if applicable
    if grease == True:
        versions = choose_grease()
    else:
        versions = b""
    for version in tls:
        versions += version
    second_length = len(versions)
    first_length = second_length+1
    ext += struct.pack(">H", first_length)
    ext += struct.pack(">B", second_length)
    ext += versions
    return ext

    Supported version extension for client hello
    :param jarm_details:
    :param grease:
    :return:
    
Supported version extension for client hello
Supported version extension for client hello
def supported_versions(jarm_details: List[str or int], grease: bool) -> bytes:
    if (jarm_details[7] == "1.2_SUPPORT"):
        tls = [b"\x03\x01", b"\x03\x02", b"\x03\x03"]
    else:
        tls = [b"\x03\x01", b"\x03\x02", b"\x03\x03", b"\x03\x04"]
    if jarm_details[8] != "FORWARD":
        tls = cipher_mung(tls, jarm_details[8])
    ext = b"\x00\x2b"
    if grease == True:
        versions = choose_grease()
    else:
        versions = b""
    for version in tls:
        versions += version
    second_length = len(versions)
    first_length = second_length+1
    ext += struct.pack(">H", first_length)
    ext += struct.pack(">B", second_length)
    ext += versions
    return ext
def supported_versions ( jarm_details : List [ str or int ] , grease : bool ) -> bytes : if ( jarm_details [ 7 ] == "1.2_SUPPORT" ) : tls = [ b"\x03\x01" , b"\x03\x02" , b"\x03\x03" ] else : tls = [ b"\x03\x01" , b"\x03\x02" , b"\x03\x03" , b"\x03\x04" ] if jarm_details [ 8 ] != "FORWARD" : tls = cipher_mung ( tls , jarm_details [ 8 ] ) ext = b"\x00\x2b" if grease == True : versions = choose_grease ( ) else : versions = b"" for version in tls : versions += version second_length = len ( versions ) first_length = second_length + 1 ext += struct . pack ( ">H" , first_length ) ext += struct . pack ( ">B" , second_length ) ext += versions return ext
Supported version extension for client hello
Supported version extension for client hello
"""
    Supported version extension for client hello
    :param jarm_details:
    :param grease:
    :return:
    """ #TLS 1.3 is not supported #TLS 1.3 is supported #Change supported version order, by default, the versions are from oldest to newest #Assemble the extension #Add GREASE if applicable
None
jarm_details
List[str or int]
None
grease
bool
None