\r
#pragma pack()\r
\r
+//\r
+// Typedefs for collecting sets of hash APIs from BaseCryptLib.\r
+//\r
+typedef\r
+UINTN\r
+(EFIAPI *CHAP_HASH_GET_CONTEXT_SIZE) (\r
+ VOID\r
+ );\r
+\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *CHAP_HASH_INIT) (\r
+ OUT VOID *Context\r
+ );\r
+\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *CHAP_HASH_UPDATE) (\r
+ IN OUT VOID *Context,\r
+ IN CONST VOID *Data,\r
+ IN UINTN DataSize\r
+ );\r
+\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *CHAP_HASH_FINAL) (\r
+ IN OUT VOID *Context,\r
+ OUT UINT8 *HashValue\r
+ );\r
+\r
+typedef struct {\r
+ UINT8 Algorithm; // ISCSI_CHAP_ALGORITHM_*, CHAP_A\r
+ UINT32 DigestSize;\r
+ CHAP_HASH_GET_CONTEXT_SIZE GetContextSize;\r
+ CHAP_HASH_INIT Init;\r
+ CHAP_HASH_UPDATE Update;\r
+ CHAP_HASH_FINAL Final;\r
+} CHAP_HASH;\r
+\r
///\r
/// ISCSI CHAP Authentication Data\r
///\r
UINT8 InChallenge[1024];\r
UINT32 InChallengeLength;\r
//\r
+ // The hash algorithm (CHAP_A) that the target selects in\r
+ // ISCSI_CHAP_STEP_TWO.\r
+ //\r
+ CONST CHAP_HASH *Hash;\r
+ //\r
// Calculated CHAP Response (CHAP_R) value.\r
//\r
UINT8 CHAPResponse[ISCSI_CHAP_MAX_DIGEST_SIZE];\r
IN OUT NET_BUF *Pdu\r
);\r
\r
+/**\r
+ Initialize the CHAP_A=<A1,A2...> *value* string for the entire driver, to be\r
+ sent by the initiator in ISCSI_CHAP_STEP_ONE.\r
+\r
+ This function sanity-checks the internal table of supported CHAP hashing\r
+ algorithms, as well.\r
+**/\r
+VOID\r
+IScsiCHAPInitHashList (\r
+ VOID\r
+ );\r
#endif\r