added gnutls backend and moved backend code into new files
[ircu2.10.12-pk.git] / ircd / ircd_crypt_native.c
index 5fa2afcda828299f8587583c145c4a3d8cd717ec..c6b1c585d9abc45e0c086486db3904aeb01e261d 100644 (file)
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
  */
+/**
+ * @file
+ * @brief Native crypt() function routines
+ * @version $Id$
+ * 
+ * Routines for handling passwords encrypted with the system's native crypt()
+ * function (typically a DES encryption routine, but can be anything nowadays).
+ * 
+ */
+#define _XOPEN_SOURCE 500
+
 #include "config.h"
 #include "ircd_crypt.h"
 #include "ircd_crypt_native.h"
+#include "ircd_log.h"
 #include "s_debug.h"
 #include "ircd_alloc.h"
 
-#define _XOPEN_SOURCE
-#define _XOPEN_VERSION 4
-
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 #include <unistd.h>
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
 
-/* well this bit is (kinda) intact :) -- hikari */
+/** Simple routine that just calls crypt() with the supplied password and salt
+ * @param key The password we're encrypting.
+ * @param salt The salt we're using to encrypt key
+ * @return The encrypted password.
+ * 
+ * Well this bit is (kinda) intact from the original oper password routines :) 
+ * It's a very simple wrapper routine that just calls crypt and returns the 
+ * result.
+ *   -- hikari
+ */
 const char* ircd_crypt_native(const char* key, const char* salt)
 {
  assert(NULL != key);