- removed key from constructor
authorMartin Willi <martin@strongswan.org>
Tue, 22 Nov 2005 07:59:00 +0000 (07:59 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 22 Nov 2005 07:59:00 +0000 (07:59 -0000)
- added set_key

Source/charon/transforms/prfs/prf.c
Source/charon/transforms/prfs/prf.h
Source/charon/transforms/prfs/prf_hmac_sha1.c
Source/charon/transforms/prfs/prf_hmac_sha1.h

index d5f480f..2002864 100644 (file)
 /*
  * 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:
index 537b05a..1477c4a 100644 (file)
@@ -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_*/
index e62493a..fc1ea74 100644 (file)
@@ -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);
        
index 7f0142c..19a0fa6 100644 (file)
@@ -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_*/