/* $OpenLDAP$ */
-/*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2011 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* <http://www.OpenLDAP.org/license.html>.
*/
-#include <string.h>
#include <unistd.h>
#include <lber.h>
#include <lber_pvt.h>
#include "lutil.h"
#include "lutil_md5.h"
+#include <ac/string.h>
static LUTIL_PASSWD_CHK_FUNC chk_ns_mta_md5;
static const struct berval scheme = BER_BVC("{NS-MTA-MD5}");
int i;
if( passwd->bv_len != NS_MTA_MD5_PASSLEN ) {
- return 1;
+ return LUTIL_PASSWD_ERR;
}
/* hash credentials with salt */
/* compare */
return memcmp((char *)passwd->bv_val,
- (char *)buffer, sizeof(buffer)) ? 1 : 0;
+ (char *)buffer, sizeof(buffer)) ? LUTIL_PASSWD_ERR : LUTIL_PASSWD_OK;
}
int init_module(int argc, char *argv[]) {