iv_gen: Provide external sequence number (IKE, ESP)
[strongswan.git] / src / libipsec / esp_packet.c
index 1b8625c..db5ef36 100644 (file)
@@ -319,7 +319,7 @@ METHOD(esp_packet_t, encrypt, status_t,
        writer->write_uint32(writer, next_seqno);
 
        iv = writer->skip(writer, iv.len);
-       if (!iv_gen->get_iv(iv_gen, iv.len, iv.ptr))
+       if (!iv_gen->get_iv(iv_gen, next_seqno, iv.len, iv.ptr))
        {
                DBG1(DBG_ESP, "ESP encryption failed: could not generate IV");
                writer->destroy(writer);