Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
b5453fae
Commit
b5453fae
authored
Aug 17, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force crypt() salt to be null-terminated.
parent
da45a0bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
src/backend/libpq/crypt.c
src/backend/libpq/crypt.c
+7
-3
src/interfaces/libpq/fe-auth.c
src/interfaces/libpq/fe-auth.c
+7
-2
No files found.
src/backend/libpq/crypt.c
View file @
b5453fae
...
...
@@ -9,7 +9,7 @@
* Dec 17, 1997 - Todd A. Brandys
* Orignal Version Completed.
*
* $Id: crypt.c,v 1.3
5 2001/08/17 02:59:19
momjian Exp $
* $Id: crypt.c,v 1.3
6 2001/08/17 03:09:31
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -281,7 +281,7 @@ md5_crypt_verify(const Port *port, const char *user, const char *pgpass)
if
(
isMD5
(
passwd
)
&&
port
->
auth_method
!=
uaMD5
)
{
snprintf
(
PQerrormsg
,
PQERRORMSG_LENGTH
,
"Password is stored MD5 encrypted. "
"Password is stored MD5 encrypted. "
"Only pg_hba.conf's MD5 protocol can be used for this user.
\n
"
);
fputs
(
PQerrormsg
,
stderr
);
pqdebug
(
"%s"
,
PQerrormsg
);
...
...
@@ -295,8 +295,12 @@ md5_crypt_verify(const Port *port, const char *user, const char *pgpass)
switch
(
port
->
auth_method
)
{
case
uaCrypt
:
crypt_pwd
=
crypt
(
passwd
,
port
->
cryptSalt
);
{
char
salt
[
3
];
StrNCpy
(
salt
,
port
->
cryptSalt
,
3
);
crypt_pwd
=
crypt
(
passwd
,
salt
);
break
;
}
case
uaMD5
:
crypt_pwd
=
palloc
(
MD5_PASSWD_LEN
+
1
);
if
(
isMD5
(
passwd
))
...
...
src/interfaces/libpq/fe-auth.c
View file @
b5453fae
...
...
@@ -10,7 +10,7 @@
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.5
1 2001/08/17 02:59:19
momjian Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.5
2 2001/08/17 03:09:31
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -443,8 +443,13 @@ pg_password_sendauth(PGconn *conn, const char *password, AuthRequest areq)
switch
(
areq
)
{
case
AUTH_REQ_CRYPT
:
crypt_pwd
=
crypt
(
password
,
conn
->
cryptSalt
);
{
char
salt
[
3
];
StrNCpy
(
salt
,
conn
->
cryptSalt
,
3
);
crypt_pwd
=
crypt
(
password
,
salt
);
break
;
}
case
AUTH_REQ_MD5
:
{
char
*
crypt_pwd2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment