lib/core/jarm_calc.py
def key_share(grease: bool) -> bytes:
    """
    Generate key share extension for client hello
    :param grease:
    :return:
    """
    ext = b"\x00\x33"
    #Add grease value if necessary
    if grease == True:
        share_ext = choose_grease()
        share_ext += b"\x00\x01\x00"
    else:
        share_ext = b""
    group = b"\x00\x1d"
    share_ext += group
    key_exchange_length = b"\x00\x20"
    share_ext += key_exchange_length
    share_ext += urandom(32)
    second_length = len(share_ext)
    first_length = second_length+2
    ext += struct.pack(">H", first_length)
    ext += struct.pack(">H", second_length)
    ext += share_ext
    return ext

    Generate key share extension for client hello
    :param grease:
    :return:
    
Generate key share extension for client hello
Generate key share extension for client hello
def key_share(grease: bool) -> bytes:
    ext = b"\x00\x33"
    if grease == True:
        share_ext = choose_grease()
        share_ext += b"\x00\x01\x00"
    else:
        share_ext = b""
    group = b"\x00\x1d"
    share_ext += group
    key_exchange_length = b"\x00\x20"
    share_ext += key_exchange_length
    share_ext += urandom(32)
    second_length = len(share_ext)
    first_length = second_length+2
    ext += struct.pack(">H", first_length)
    ext += struct.pack(">H", second_length)
    ext += share_ext
    return ext
def key_share ( grease : bool ) -> bytes : ext = b"\x00\x33" if grease == True : share_ext = choose_grease ( ) share_ext += b"\x00\x01\x00" else : share_ext = b"" group = b"\x00\x1d" share_ext += group key_exchange_length = b"\x00\x20" share_ext += key_exchange_length share_ext += urandom ( 32 ) second_length = len ( share_ext ) first_length = second_length + 2 ext += struct . pack ( ">H" , first_length ) ext += struct . pack ( ">H" , second_length ) ext += share_ext return ext
Generate key share extension for client hello
Generate key share extension for client hello
"""
    Generate key share extension for client hello
    :param grease:
    :return:
    """ #Add grease value if necessary
None
grease
bool
None