Ticket #825: openvpn-2.4.0-tls-crypt_segfault.patch

File openvpn-2.4.0-tls-crypt_segfault.patch, 778 bytes (added by Simon Matter, 7 years ago)
  • openvpn-2.4.0/src/openvpn/tls_crypt.c

    old new  
    5050
    5151    struct key_type kt;
    5252    kt.cipher = cipher_kt_get("AES-256-CTR");
    53     kt.cipher_length = cipher_kt_key_size(kt.cipher);
    5453    kt.digest = md_kt_get("SHA256");
    55     kt.hmac_length = md_kt_size(kt.digest);
    5654
    5755    if (!kt.cipher)
    5856    {
     
    6361        msg(M_FATAL, "ERROR: --tls-crypt requires HMAC-SHA-256 support.");
    6462    }
    6563
     64    kt.cipher_length = cipher_kt_key_size(kt.cipher);
     65    kt.hmac_length = md_kt_size(kt.digest);
     66
    6667    crypto_read_openvpn_key(&kt, key, key_file, key_inline, key_direction,
    6768                            "Control Channel Encryption", "tls-crypt");
    6869}