summaryrefslogtreecommitdiffstats
path: root/src/crypto
diff options
context:
space:
mode:
authorMichael Brown2008-08-11 04:12:38 +0200
committerMichael Brown2008-08-11 04:43:12 +0200
commit5d4839b577e6b6836bd4828ab3ab5d7d2f5ae779 (patch)
tree523176f4313e45eb6bc3ff12de5e282505eb8be6 /src/crypto
parent[libc] Add missing __attribute__ (( format ( printf ) )) to ssnprintf() (diff)
downloadipxe-5d4839b577e6b6836bd4828ab3ab5d7d2f5ae779.tar.gz
ipxe-5d4839b577e6b6836bd4828ab3ab5d7d2f5ae779.tar.xz
ipxe-5d4839b577e6b6836bd4828ab3ab5d7d2f5ae779.zip
[iSCSI] Add support for mutual CHAP
Allow initiator to verify target authentication using CHAP.
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/chap.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/crypto/chap.c b/src/crypto/chap.c
index 13b8fda2..59b70e39 100644
--- a/src/crypto/chap.c
+++ b/src/crypto/chap.c
@@ -41,7 +41,7 @@
* allocates memory, and so may fail. The allocated memory must
* eventually be freed by a call to chap_finish().
*/
-int chap_init ( struct chap_challenge *chap,
+int chap_init ( struct chap_response *chap,
struct crypto_algorithm *digest ) {
size_t state_len;
void *state;
@@ -71,11 +71,11 @@ int chap_init ( struct chap_challenge *chap,
/**
* Add data to the CHAP challenge
*
- * @v chap CHAP challenge/response
+ * @v chap CHAP response
* @v data Data to add
* @v len Length of data to add
*/
-void chap_update ( struct chap_challenge *chap, const void *data,
+void chap_update ( struct chap_response *chap, const void *data,
size_t len ) {
assert ( chap->digest != NULL );
assert ( chap->digest_context != NULL );
@@ -89,12 +89,12 @@ void chap_update ( struct chap_challenge *chap, const void *data,
/**
* Respond to the CHAP challenge
*
- * @v chap CHAP challenge/response
+ * @v chap CHAP response
*
* Calculates the final CHAP response value, and places it in @c
* chap->response, with a length of @c chap->response_len.
*/
-void chap_respond ( struct chap_challenge *chap ) {
+void chap_respond ( struct chap_response *chap ) {
assert ( chap->digest != NULL );
assert ( chap->digest_context != NULL );
assert ( chap->response != NULL );
@@ -108,11 +108,11 @@ void chap_respond ( struct chap_challenge *chap ) {
}
/**
- * Free resources used by a CHAP challenge/response
+ * Free resources used by a CHAP response
*
- * @v chap CHAP challenge/response
+ * @v chap CHAP response
*/
-void chap_finish ( struct chap_challenge *chap ) {
+void chap_finish ( struct chap_response *chap ) {
void *state = chap->digest_context;
DBG ( "CHAP %p finished\n", chap );