diff options
author | Martin Willi <martin@strongswan.org> | 2005-11-22 07:59:00 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2005-11-22 07:59:00 +0000 |
commit | 002c583e26d5de70b9a4f009d56f3ed7b39e163e (patch) | |
tree | b4a3db4372e650f891440b9543a5b95930b1d7e2 /Source/charon | |
parent | 4aab514953435705bc63c72d1f48d4b5dea96243 (diff) | |
download | strongswan-002c583e26d5de70b9a4f009d56f3ed7b39e163e.tar.bz2 strongswan-002c583e26d5de70b9a4f009d56f3ed7b39e163e.tar.xz |
- removed key from constructor
- added set_key
Diffstat (limited to 'Source/charon')
-rw-r--r-- | Source/charon/transforms/prfs/prf.c | 4 | ||||
-rw-r--r-- | Source/charon/transforms/prfs/prf.h | 11 | ||||
-rw-r--r-- | Source/charon/transforms/prfs/prf_hmac_sha1.c | 2 | ||||
-rw-r--r-- | Source/charon/transforms/prfs/prf_hmac_sha1.h | 3 |
4 files changed, 13 insertions, 7 deletions
diff --git a/Source/charon/transforms/prfs/prf.c b/Source/charon/transforms/prfs/prf.c index d5f480f35..200286437 100644 --- a/Source/charon/transforms/prfs/prf.c +++ b/Source/charon/transforms/prfs/prf.c @@ -29,13 +29,13 @@ /* * Described in header */ -prf_t *prf_create(pseudo_random_function_t pseudo_random_function, chunk_t key) +prf_t *prf_create(pseudo_random_function_t pseudo_random_function) { switch (pseudo_random_function) { case PRF_HMAC_SHA1: { - return (prf_t*)prf_hmac_sha1_create(key); + return (prf_t*)prf_hmac_sha1_create(); } case PRF_HMAC_MD5: case PRF_HMAC_TIGER: diff --git a/Source/charon/transforms/prfs/prf.h b/Source/charon/transforms/prfs/prf.h index 537b05a65..1477c4a8e 100644 --- a/Source/charon/transforms/prfs/prf.h +++ b/Source/charon/transforms/prfs/prf.h @@ -65,6 +65,14 @@ struct prf_s { size_t (*get_block_size) (prf_t *this); /** + * @brief Set the key for this prf + * + * @param this calling prf + * @return block size in bytes + */ + status_t (*set_key) (prf_t *this, chunk_t key); + + /** * @brief Destroys a prf object. * * @param this prf_t object to destroy @@ -78,11 +86,10 @@ struct prf_s { * Creates a new prf_t object * * @param pseudo_random_function Algorithm to use - * @param key A chunk containing the key * @return * - prf_t if successfully * - NULL if out of ressources or prf not supported */ -prf_t *prf_create(pseudo_random_function_t pseudo_random_function, chunk_t key); +prf_t *prf_create(pseudo_random_function_t pseudo_random_function); #endif /*PRF_H_*/ diff --git a/Source/charon/transforms/prfs/prf_hmac_sha1.c b/Source/charon/transforms/prfs/prf_hmac_sha1.c index e62493a65..fc1ea74ae 100644 --- a/Source/charon/transforms/prfs/prf_hmac_sha1.c +++ b/Source/charon/transforms/prfs/prf_hmac_sha1.c @@ -44,7 +44,7 @@ struct private_prf_hmac_sha1_s { /* * Described in header */ -prf_hmac_sha1_t *prf_hmac_sha1_create(chunk_t key) +prf_hmac_sha1_t *prf_hmac_sha1_create() { private_prf_hmac_sha1_t *this = allocator_alloc_thing(private_prf_hmac_sha1_t); diff --git a/Source/charon/transforms/prfs/prf_hmac_sha1.h b/Source/charon/transforms/prfs/prf_hmac_sha1.h index 7f0142cf0..19a0fa635 100644 --- a/Source/charon/transforms/prfs/prf_hmac_sha1.h +++ b/Source/charon/transforms/prfs/prf_hmac_sha1.h @@ -45,11 +45,10 @@ struct prf_hmac_sha1_s { /** * Creates a new prf_hmac_sha1_t object * - * @param key Key to use for this prf * @return * - prf_hmac_sha1_t if successfully * - NULL if out of ressources */ -prf_hmac_sha1_t *prf_hmac_sha1_create(chunk_t key); +prf_hmac_sha1_t *prf_hmac_sha1_create(); #endif /*PRF_HMAC_SHA1_H_*/ |