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
fdbce93b
Commit
fdbce93b
authored
Oct 03, 2007
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor improvements to hack for old OpenSSL libraries: avoid unused
variable warning on Windows, improve comment.
parent
a248dbc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
src/interfaces/libpq/fe-secure.c
src/interfaces/libpq/fe-secure.c
+19
-14
No files found.
src/interfaces/libpq/fe-secure.c
View file @
fdbce93b
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.9
8 2007/10/03 13:57:52 mha
Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-secure.c,v 1.9
9 2007/10/03 15:12:45 tgl
Exp $
*
* NOTES
* [ Most of these notes are wrong/obsolete, but perhaps not all ]
...
...
@@ -588,8 +588,8 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
#ifndef WIN32
struct
stat
buf2
;
#endif
FILE
*
fp
;
#endif
char
fnbuf
[
MAXPGPATH
];
BIO
*
bio
;
PGconn
*
conn
=
(
PGconn
*
)
SSL_get_app_data
(
ssl
);
...
...
@@ -602,27 +602,32 @@ client_cert_cb(SSL *ssl, X509 **x509, EVP_PKEY **pkey)
return
0
;
}
/* save OpenSSL error stack */
ERR_set_mark
();
/* read the user certificate */
snprintf
(
fnbuf
,
sizeof
(
fnbuf
),
"%s/%s"
,
homedir
,
USER_CERT_FILE
);
/*
* OpenSSL <= 0.8.2 lacks error stack handling. Do a separate check
* for the existance of the file without using BIO functions to make
* it pick up the majority of the cases with the old versions.
* OpenSSL <= 0.9.8 lacks error stack handling, which means it's likely
* to report wrong error messages if access to the cert file fails.
* Do our own check for the readability of the file to catch the
* majority of such problems before OpenSSL gets involved.
*/
#ifndef HAVE_ERR_SET_MARK
if
((
fp
=
fopen
(
fnbuf
,
"r"
))
==
NULL
)
{
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"could not open certificate file
\"
%s
\"
: %s
\n
"
),
fnbuf
,
pqStrerror
(
errno
,
sebuf
,
sizeof
(
sebuf
)));
return
0
;
FILE
*
fp2
;
if
((
fp2
=
fopen
(
fnbuf
,
"r"
))
==
NULL
)
{
printfPQExpBuffer
(
&
conn
->
errorMessage
,
libpq_gettext
(
"could not open certificate file
\"
%s
\"
: %s
\n
"
),
fnbuf
,
pqStrerror
(
errno
,
sebuf
,
sizeof
(
sebuf
)));
return
0
;
}
fclose
(
fp2
);
}
fclose
(
fp
);
#endif
/* save OpenSSL error stack */
ERR_set_mark
();
if
((
bio
=
BIO_new_file
(
fnbuf
,
"r"
))
==
NULL
)
{
...
...
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