• Pascal Buhler's avatar
    Set gcm IV directly with EVP_CipherInit_ex · 9eb1716f
    Pascal Buhler authored
    Setting the IV directly with EVP_CipherInit_ex will
    save two calls to openssl and simplify the code.
    
    There is a comment that the 3 calls are required but
    I am not sure why, EVP_CTRL_GCM_SET_IV_FIXED will
    just store the vector and EVP_CTRL_GCM_IV_GEN will use
    it internally and then increment the last digits before
    returning it in iv variable passed in.
    EVP_CipherInit_ex will store the iv and use it internally.
    Incrementing and retrieving the new IV is not required for
    SRTP-GCM, a new IV is used for each packet.
    
    Tested with openssl 1.0.1d & 1.0.2g
    9eb1716f
aes_gcm_ossl.c 18.8 KB