mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-02-16 22:06:25 +01:00
OMEMO: generate IV more flexible
This commit is contained in:
parent
c6c904cc3e
commit
8a74aec32a
1 changed files with 6 additions and 1 deletions
|
@ -277,8 +277,13 @@ public class OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_
|
|||
* @return iv
|
||||
*/
|
||||
public static byte[] generateIv() {
|
||||
// TODO: Switch to 12 once ChatSecure supports decrypting msgs with 12 byte IV.
|
||||
return generateIv(16);
|
||||
}
|
||||
|
||||
public static byte[] generateIv(int len) {
|
||||
SecureRandom random = new SecureRandom();
|
||||
byte[] iv = new byte[16];
|
||||
byte[] iv = new byte[len];
|
||||
random.nextBytes(iv);
|
||||
return iv;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue