mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Fixed pastes erroring out if there is no IV/Key
This commit is contained in:
parent
40a5dee36f
commit
73e5e084a5
@ -76,8 +76,8 @@ namespace Teknik.Areas.Paste.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
byte[] ivBytes = Encoding.Unicode.GetBytes(paste.IV);
|
||||
byte[] keyBytes = AesCounterManaged.CreateKey(paste.Key, ivBytes, paste.KeySize);
|
||||
byte[] ivBytes = (string.IsNullOrEmpty(paste.IV)) ? new byte[paste.BlockSize] : Encoding.Unicode.GetBytes(paste.IV);
|
||||
byte[] keyBytes = (string.IsNullOrEmpty(paste.Key)) ? new byte[paste.KeySize] : AesCounterManaged.CreateKey(paste.Key, ivBytes, paste.KeySize);
|
||||
|
||||
// The paste has a password set
|
||||
if (!string.IsNullOrEmpty(paste.HashedPassword))
|
||||
|
Loading…
Reference in New Issue
Block a user