2 // This file is (C) 2004 Royce Mitchell III
3 // and released under the BSD & LGPL licenses
11 string
cram_md5 ( const string
& username
, const string
& password
, const string
& greeting
)
13 string challenge
= base64_decode ( greeting
);
15 string hmac
= HMAC_MD5 ( password
, challenge
);
16 //printf ( "(cram_md5): hmac = %s\n", hmac.c_str() );
17 string raw_response
= username
;
20 //printf ( "(cram_md5): raw_response = %s\n", raw_response.c_str() );
22 return base64_encode ( raw_response
);