/*
* Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include "lber.h"
#include "ldap.h"
#include "ldap-int.h"
#include <strings.h>
#include "sec.h"
/* text is the challenge, key is the password, digest is an allocated
buffer (min 16 chars) which will contain the resulting digest */
{
int i;
if (key_len > 64){
key_len = 16;
}
for (i=0; i<64; i++){
k_ipad[i] ^= 0x36;
k_opad[i] ^= 0x5c;
}
/* Perform inner MD5 */
/* Perform outer MD5 */
return;
}
char *dn,
{
int res;
char *theHDigest;
return (LDAP_PARAM_ERROR);
}
if ((res = ldap_sasl_bind_s(ld, NULL, LDAP_SASL_CRAM_MD5, NULL, serverctrls, clientctrls, &challenge))
return (res);
}
return (LDAP_PARAM_ERROR);
}
if (theHDigest == NULL){
return (LDAP_NO_MEMORY);
}
return(LDAP_NO_MEMORY);
}
return (res);
}