1 /* $Cambridge: exim/src/src/auths/auth-spa.h,v 1.1 2004/10/07 13:10:00 ph10 Exp $ */
3 /*************************************************
4 * Exim - an Internet mail transport agent *
5 *************************************************/
8 * This file provides the necessary methods for authenticating with
9 * Microsoft's Secure Password Authentication.
11 * All the code used here was torn by Marc Prud'hommeaux out of the
12 * Samba project (by Andrew Tridgell, Jeremy Allison, and others).
15 /* It seems that some systems have existing but different definitions of some
16 of the following types. I received a complaint about "int16" causing
17 compilation problems. So I (PH) have renamed them all, to be on the safe side.
19 typedef signed short int16;
20 typedef unsigned short uint16;
21 typedef unsigned uint32;
22 typedef unsigned char uint8;
25 typedef signed short int16x;
26 typedef unsigned short uint16x;
27 typedef unsigned uint32x;
28 typedef unsigned char uint8x;
43 uint8x challengeData[8];
45 SPAStrHeader emptyString;
66 SPAStrHeader lmResponse;
67 SPAStrHeader ntResponse;
71 SPAStrHeader sessionKey;
77 #define spa_request_length(ptr) (((ptr)->buffer - (uint8x*)(ptr)) + (ptr)->bufIndex)
79 void spa_bits_to_base64 (unsigned char *, const unsigned char *, int);
80 int spa_base64_to_bits(char *, const char *);
81 void spa_build_auth_response (SPAAuthChallenge *challenge,
82 SPAAuthResponse *response, char *user, char *password);
83 void spa_build_auth_request (SPAAuthRequest *request, char *user,
85 extern void spa_smb_encrypt (unsigned char * passwd, unsigned char * c8,
87 extern void spa_smb_nt_encrypt (unsigned char * passwd, unsigned char * c8,
89 extern char *unicodeToString(char *p, size_t len);
90 extern void spa_build_auth_challenge(SPAAuthRequest *, SPAAuthChallenge *);