summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <kostja@oak.local>2003-09-03 14:12:10 +0400
committerunknown <kostja@oak.local>2003-09-03 14:12:10 +0400
commit49b0312dd7afe5a60a9d6aa22daff79bf50f0a84 (patch)
tree4aa3e74d29fde5abc55c20c2c14e6c286e467c6e /include
parent651898adfce345138363961769c6fdfd6da95532 (diff)
parent0188e158c1d29057cb8a449891894c69dd2f5f2b (diff)
downloadmariadb-git-49b0312dd7afe5a60a9d6aa22daff79bf50f0a84.tar.gz
merge commit, hope that none of bar and dlenev changes were
lost. BitKeeper/etc/logging_ok: auto-union include/mysql.h: Auto merged include/mysql_com.h: Auto merged libmysql/libmysql.c: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/item_create.cc: Auto merged sql/item_create.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/lex.h: Auto merged sql/mysqld.cc: Auto merged sql/protocol.h: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_yacc.yy: Auto merged include/mysqld_error.h: merge commit: new error message added sql-common/client.c: merge commit sql/mysql_priv.h: merge commit: autoremerge sql/set_var.h: merge commit sql/share/czech/errmsg.txt: merge commit sql/share/danish/errmsg.txt: merge commit sql/share/dutch/errmsg.txt: merge commit sql/share/english/errmsg.txt: merge commit sql/share/estonian/errmsg.txt: merge commit sql/share/french/errmsg.txt: merge commit sql/share/german/errmsg.txt: merge commit sql/share/greek/errmsg.txt: merge commit sql/share/hungarian/errmsg.txt: merge commit sql/share/italian/errmsg.txt: merge commit sql/share/japanese/errmsg.txt: merge commit sql/share/korean/errmsg.txt: merge commit sql/share/norwegian-ny/errmsg.txt: merge commit sql/share/norwegian/errmsg.txt: merge commit sql/share/polish/errmsg.txt: merge commit sql/share/portuguese/errmsg.txt: merge commit sql/share/romanian/errmsg.txt: merge commit sql/share/russian/errmsg.txt: merge commit sql/share/serbian/errmsg.txt: merge commit sql/share/slovak/errmsg.txt: merge commit sql/share/spanish/errmsg.txt: merge commit sql/share/swedish/errmsg.txt: merge commit sql/share/ukrainian/errmsg.txt: merge commit sql/slave.cc: merge commit sql/slave.h: merge commit sql/sql_acl.cc: merge commit sql/sql_parse.cc: merge commit sql/sql_repl.h: merge commit
Diffstat (limited to 'include')
-rw-r--r--include/mysql.h4
-rw-r--r--include/mysql_com.h60
-rw-r--r--include/mysqld_error.h3
3 files changed, 40 insertions, 27 deletions
diff --git a/include/mysql.h b/include/mysql.h
index d58b729bfc1..2e23a1e2f98 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -229,7 +229,9 @@ typedef struct st_mysql
enum mysql_status status;
my_bool free_me; /* If free in mysql_close */
my_bool reconnect; /* set to 1 if automatic reconnect */
- char scramble_buff[21]; /* New protocol requires longer scramble*/
+
+ /* session-wide random string */
+ char scramble[SCRAMBLE_LENGTH+1];
/*
Set if this is the original connection, not a master or a slave we have
diff --git a/include/mysql_com.h b/include/mysql_com.h
index b1c94e5c735..8d61641cf29 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -49,8 +49,15 @@ enum enum_server_command
};
-#define SCRAMBLE_LENGTH 8
-#define SCRAMBLE41_LENGTH 20
+/*
+ Length of random string sent by server on handshake; this is also length of
+ obfuscated password, recieved from client
+*/
+#define SCRAMBLE_LENGTH 20
+#define SCRAMBLE_LENGTH_323 8
+/* length of password stored in the db: new passwords are preceeded with '*' */
+#define SCRAMBLED_PASSWORD_CHAR_LENGTH (SCRAMBLE_LENGTH*2+1)
+#define SCRAMBLED_PASSWORD_CHAR_LENGTH_323 (SCRAMBLE_LENGTH_323*2)
#define NOT_NULL_FLAG 1 /* Field can't be NULL */
@@ -302,31 +309,34 @@ extern "C" {
extern unsigned long max_allowed_packet;
extern unsigned long net_buffer_length;
-void randominit(struct rand_struct *,unsigned long seed1,
- unsigned long seed2);
+/*
+ These functions are used for authentication by client and server and
+ implemented in sql/password.c
+*/
+
+void randominit(struct rand_struct *, unsigned long seed1,
+ unsigned long seed2);
double my_rnd(struct rand_struct *);
-void make_scrambled_password(char *to,const char *password,
- my_bool force_old_scramble,struct rand_struct *rand_st);
-int get_password_length(my_bool force_old_scramble);
-char get_password_version(const char* password);
-void create_random_string(int length,struct rand_struct *rand_st,char* target);
-my_bool validate_password(const char* password, const char* message,
- unsigned long* salt);
-void password_hash_stage1(char *to, const char *password);
-void password_hash_stage2(char *to,const char *salt);
-void password_crypt(const char* from,char* to, const char* password,int length);
-void get_hash_and_password(unsigned long* salt, unsigned char pversion,char* hash,
- unsigned char* bin_password);
-void get_salt_from_password(unsigned long *res,const char *password);
-void create_key_from_old_password(const char* password,char* key);
-void make_password_from_salt(char *to, unsigned long *hash_res,
- unsigned char password_version);
-char *scramble(char *to,const char *message,const char *password,
- my_bool old_ver);
-my_bool check_scramble(const char *, const char *message,
- unsigned long *salt,my_bool old_ver);
+void create_random_string(char *to, uint length, struct rand_struct *rand_st);
+
+void hash_password(ulong *to, const char *password, uint password_len);
+void make_scrambled_password_323(char *to, const char *password);
+void scramble_323(char *to, const char *message, const char *password);
+my_bool check_scramble_323(const char *, const char *message,
+ unsigned long *salt);
+void get_salt_from_password_323(unsigned long *res, const char *password);
+void make_password_from_salt_323(char *to, const unsigned long *salt);
+
+void make_scrambled_password(char *to, const char *password);
+void scramble(char *to, const char *message, const char *password);
+my_bool check_scramble(const char *reply, const char *message,
+ const unsigned char *hash_stage2);
+void get_salt_from_password(unsigned char *res, const char *password);
+void make_password_from_salt(char *to, const unsigned char *hash_stage2);
+
+/* end of password.c */
+
char *get_tty_password(char *opt_message);
-void hash_password(unsigned long *result, const char *password);
const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);
/* Some other useful functions */
diff --git a/include/mysqld_error.h b/include/mysqld_error.h
index 86bd885d4b2..9509203fdcb 100644
--- a/include/mysqld_error.h
+++ b/include/mysqld_error.h
@@ -290,4 +290,5 @@
#define ER_VARIABLE_IS_NOT_STRUCT 1271
#define ER_UNKNOWN_COLLATION 1272
#define ER_SLAVE_IGNORED_SSL_PARAMS 1273
-#define ER_ERROR_MESSAGES 274
+#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1274
+#define ER_ERROR_MESSAGES 275