Commit d264285c authored by Andreas Hasenack's avatar Andreas Hasenack

Do not use my_make_scrambled_password()

my_make_scrambled_password() is not meant to be a replacement for
the removed make_scrambled_password() function from libmysqlclient.

So look for make_scrambled_password() in the mysql client library
instead of my_make_scrambled_password(). If not found, then
reimplement it, but with the correct name to avoid further confusion
around this.
parent 662940f5
......@@ -114,6 +114,6 @@ AC_SEARCH_LIBS([crypt],[crypt],,[AC_MSG_ERROR([unable to find the crypt() functi
AC_SUBST(PAM_MODS_DIR)
AC_CONFIG_FILES([Makefile pam_mysql.spec])
AC_SEARCH_LIBS([my_make_scrambled_password],[mysql],[AC_DEFINE([HAVE_MY_MAKE_SCRAMBLED_PASSWORD], [1], [Build own SHA1 support.])])
AC_SEARCH_LIBS([make_scrambled_password],[mysql],[AC_DEFINE([HAVE_MAKE_SCRAMBLED_PASSWORD], [1], [Build own SHA1 support.])])
AC_OUTPUT
......@@ -25,7 +25,7 @@ documentation and/or software.
#include <config.h>
#ifndef HAVE_MY_MAKE_SCRAMBLED_PASSWORD
#ifndef HAVE_MAKE_SCRAMBLED_PASSWORD
#include <string.h>
#include "crypto.h"
......
......@@ -14,7 +14,7 @@
#include <config.h>
#ifndef HAVE_MY_MAKE_SCRAMBLED_PASSWORD
#ifndef HAVE_MAKE_SCRAMBLED_PASSWORD
#include <string.h>
#include "crypto.h"
......
#include <config.h>
#ifndef HAVE_MY_MAKE_SCRAMBLED_PASSWORD
#ifndef HAVE_MAKE_SCRAMBLED_PASSWORD
#include <stdint.h>
#include <string.h>
......
......@@ -168,14 +168,14 @@
#define PAM_AUTHTOK_RECOVERY_ERR PAM_AUTHTOK_RECOVER_ERR
#endif
#ifdef HAVE_MY_MAKE_SCRAMBLED_PASSWORD
void my_make_scrambled_password(char scrambled_password[42], const char password[255], int len);
#ifdef HAVE_MAKE_SCRAMBLED_PASSWORD
void make_scrambled_password(char scrambled_password[42], const char password[255], int len);
#else
#include "crypto.h"
#include "crypto-sha1.h"
// Implementation from commit 2db6b50c7b7c638104bd9639994f0574e8f4813c in Pure-ftp source.
static void my_make_scrambled_password(char scrambled_password[42], const char password[255], int len)
static void make_scrambled_password(char scrambled_password[42], const char password[255], int len)
{
SHA1_CTX ctx;
unsigned char h0[20], h1[20];
......@@ -2927,10 +2927,10 @@ static pam_mysql_err_t pam_mysql_check_passwd(pam_mysql_ctx_t *ctx,
if (ctx->use_323_passwd) {
make_scrambled_password_323(buf, passwd);
} else {
my_make_scrambled_password(buf, passwd, strlen(passwd));
make_scrambled_password(buf, passwd, strlen(passwd));
}
#else
my_make_scrambled_password(buf, passwd, strlen(passwd));
make_scrambled_password(buf, passwd, strlen(passwd));
#endif
vresult = strcmp(row[0], buf);
......@@ -3172,10 +3172,10 @@ static pam_mysql_err_t pam_mysql_update_passwd(pam_mysql_ctx_t *ctx, const char
if (ctx->use_323_passwd) {
make_scrambled_password_323(encrypted_passwd, new_passwd);
} else {
my_make_scrambled_password(encrypted_passwd, new_passwd, strlen(new_passwd));
make_scrambled_password(encrypted_passwd, new_passwd, strlen(new_passwd));
}
#else
my_make_scrambled_password(encrypted_passwd, new_passwd, strlen(new_passwd));
make_scrambled_password(encrypted_passwd, new_passwd, strlen(new_passwd));
#endif
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment