mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-04 00:00:14 -04:00
pkcs12: Treat empty string and no password differently
When deriving the PKCS#12 key, the empty string should result in a non-zero length Unicode string (two bytes for the 0 terminator).
This commit is contained in:
parent
7bb6aed5ab
commit
ad804fa036
@ -157,7 +157,7 @@ bool pkcs12_derive_key(hash_algorithm_t hash, chunk_t password, chunk_t salt,
|
||||
bool success;
|
||||
int i;
|
||||
|
||||
if (password.len)
|
||||
if (password.ptr)
|
||||
{ /* convert the password to UTF-16BE (without BOM) with 0 terminator */
|
||||
unicode = chunk_alloca(password.len * 2 + 2);
|
||||
for (i = 0; i < password.len; i++)
|
||||
|
Loading…
x
Reference in New Issue
Block a user