mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-05 00:00:45 -04:00
pem: Clear chunks after decrypting files
This commit is contained in:
parent
16d91ab761
commit
66e80f3d1b
@ -147,7 +147,7 @@ static status_t pem_decrypt(chunk_t *blob, encryption_algorithm_t alg,
|
|||||||
}
|
}
|
||||||
crypter->destroy(crypter);
|
crypter->destroy(crypter);
|
||||||
memcpy(blob->ptr, decrypted.ptr, blob->len);
|
memcpy(blob->ptr, decrypted.ptr, blob->len);
|
||||||
chunk_free(&decrypted);
|
chunk_clear(&decrypted);
|
||||||
|
|
||||||
/* determine amount of padding */
|
/* determine amount of padding */
|
||||||
last_padding_pos = blob->ptr + blob->len - 1;
|
last_padding_pos = blob->ptr + blob->len - 1;
|
||||||
@ -354,7 +354,7 @@ static status_t pem_to_bin(chunk_t *blob, bool *pgp)
|
|||||||
memcpy(blob->ptr, chunk.ptr, chunk.len);
|
memcpy(blob->ptr, chunk.ptr, chunk.len);
|
||||||
blob->len = chunk.len;
|
blob->len = chunk.len;
|
||||||
}
|
}
|
||||||
free(chunk.ptr);
|
chunk_clear(&chunk);
|
||||||
if (status != INVALID_ARG)
|
if (status != INVALID_ARG)
|
||||||
{ /* try again only if passphrase invalid */
|
{ /* try again only if passphrase invalid */
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user