- fixed message decryption
This commit is contained in:
@@ -252,6 +252,23 @@ static void add_payload(private_encryption_payload_t *this, payload_t *payload)
|
||||
this->compute_length(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of encryption_payload_t.remove_first_payload.
|
||||
*/
|
||||
static status_t remove_first_payload(private_encryption_payload_t *this, payload_t **payload)
|
||||
{
|
||||
return this->payloads->remove_first(this->payloads, (void**)payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of encryption_payload_t.get_payload_count.
|
||||
*/
|
||||
static size_t get_payload_count(private_encryption_payload_t *this)
|
||||
{
|
||||
return this->payloads->get_count(this->payloads);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Implementation of encryption_payload_t.encrypt.
|
||||
*/
|
||||
@@ -329,7 +346,7 @@ static status_t decrypt(private_encryption_payload_t *this)
|
||||
{
|
||||
return INVALID_STATE;
|
||||
}
|
||||
|
||||
|
||||
/* get IV */
|
||||
iv.len = this->crypter->get_block_size(this->crypter);
|
||||
iv.ptr = this->encrypted.ptr;
|
||||
@@ -591,6 +608,9 @@ encryption_payload_t *encryption_payload_create()
|
||||
/* public functions */
|
||||
this->public.create_payload_iterator = (iterator_t * (*) (encryption_payload_t *,bool)) create_payload_iterator;
|
||||
this->public.add_payload = (void (*) (encryption_payload_t *,payload_t *)) add_payload;
|
||||
this->public.remove_first_payload = (status_t (*)(encryption_payload_t*, payload_t **)) remove_first_payload;
|
||||
this->public.get_payload_count = (size_t (*)(encryption_payload_t*)) get_payload_count;
|
||||
|
||||
this->public.encrypt = (status_t (*) (encryption_payload_t *)) encrypt;
|
||||
this->public.decrypt = (status_t (*) (encryption_payload_t *)) decrypt;
|
||||
this->public.set_transforms = (void (*) (encryption_payload_t*,crypter_t*,signer_t*)) set_transforms;
|
||||
|
||||
@@ -66,6 +66,25 @@ struct encryption_payload_t {
|
||||
*/
|
||||
void (*add_payload) (encryption_payload_t *this, payload_t *payload);
|
||||
|
||||
/**
|
||||
* @brief Reove the last payload in the contained payload list.
|
||||
*
|
||||
* @param this calling encryption_payload_t object
|
||||
* @param[out] payload removed payload
|
||||
* @return
|
||||
* - SUCCESS, or
|
||||
* - NOT_FOUND if list empty
|
||||
*/
|
||||
status_t (*remove_first_payload) (encryption_payload_t *this, payload_t **payload);
|
||||
|
||||
/**
|
||||
* @brief Get the number of payloads.
|
||||
*
|
||||
* @param this calling encryption_payload_t object
|
||||
* @return number of contained payloads
|
||||
*/
|
||||
size_t (*get_payload_count) (encryption_payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief Set transforms to use.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user