port the libstrongswan memory allocation methods to pluto

This commit is contained in:
Andreas Steffen
2009-04-17 07:11:29 +00:00
parent 5cac9e4c34
commit 67411e66c3
46 changed files with 463 additions and 549 deletions
+3 -3
View File
@@ -286,17 +286,17 @@ pem_decrypt(chunk_t *blob, chunk_t *iv, prompt_pass_t *pass, const char* label)
return ugh;
}
clonetochunk(blob_copy, blob->ptr, blob->len, "blob copy");
clonetochunk(blob_copy, blob->ptr, blob->len);
if (pem_decrypt_3des(blob, iv, pass->secret))
{
whack_log(RC_SUCCESS, "valid passphrase");
pfree(blob_copy.ptr);
free(blob_copy.ptr);
return NULL;
}
/* blob is useless after wrong decryption, restore the original */
pfree(blob->ptr);
free(blob->ptr);
*blob = blob_copy;
}
whack_log(RC_LOG_SERIOUS, ugh);