mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 02:27:58 +01:00
[omemo] Use RandomUtil.fillWithSecureRandom() to generate IV
This commit is contained in:
parent
17ac41c8cb
commit
b7905d585d
1 changed files with 2 additions and 2 deletions
|
@ -36,6 +36,7 @@ import javax.crypto.SecretKey;
|
|||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import org.jivesoftware.smack.util.RandomUtil;
|
||||
import org.jivesoftware.smackx.omemo.OmemoRatchet;
|
||||
import org.jivesoftware.smackx.omemo.OmemoService;
|
||||
import org.jivesoftware.smackx.omemo.element.OmemoElement;
|
||||
|
@ -278,9 +279,8 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @return initialization vector
|
||||
*/
|
||||
public static byte[] generateIv() {
|
||||
SecureRandom random = new SecureRandom();
|
||||
byte[] iv = new byte[12];
|
||||
random.nextBytes(iv);
|
||||
RandomUtil.fillWithSecureRandom(iv);
|
||||
return iv;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue