projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle IPv6 addresses in OCSP_parse_url.
[openssl.git]
/
crypto
/
ocsp
/
ocsp_lib.c
diff --git
a/crypto/ocsp/ocsp_lib.c
b/crypto/ocsp/ocsp_lib.c
index a94dc838eecbfc84ecae6a14c9acb88bdc9234ec..4a7fe2592c153800a8cdb608fa0329120d79dcfd 100644
(file)
--- a/
crypto/ocsp/ocsp_lib.c
+++ b/
crypto/ocsp/ocsp_lib.c
@@
-165,7
+165,7
@@
int OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b)
* it is SSL.
*/
* it is SSL.
*/
-int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pssl)
+int OCSP_parse_url(c
onst c
har *url, char **phost, char **pport, char **ppath, int *pssl)
{
char *p, *buf;
{
char *p, *buf;
@@
-222,8
+222,19
@@
int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pss
if (!*ppath) goto mem_err;
if (!*ppath) goto mem_err;
+ p = host;
+ if(host[0] == '[')
+ {
+ /* ipv6 literal */
+ host++;
+ p = strchr(host, ']');
+ if(!p) goto parse_err;
+ *p = '\0';
+ p++;
+ }
+
/* Look for optional ':' for port number */
/* Look for optional ':' for port number */
- if ((p = strchr(
host
, ':')))
+ if ((p = strchr(
p
, ':')))
{
*p = 0;
port = p + 1;
{
*p = 0;
port = p + 1;