Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Pkcs11 Proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
smallstep
Pkcs11 Proxy
Commits
d114f87a
Commit
d114f87a
authored
12 years ago
by
Fredrik Thulin
Browse files
Options
Downloads
Patches
Plain Diff
Include proto (tcp:// etc.) in formatted pkcs11_socket_path.
parent
4ec86025
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gck-rpc-dispatch.c
+6
-3
6 additions, 3 deletions
gck-rpc-dispatch.c
with
6 additions
and
3 deletions
gck-rpc-dispatch.c
+
6
−
3
View file @
d114f87a
...
@@ -2407,7 +2407,7 @@ void gck_rpc_layer_inetd(CK_FUNCTION_LIST_PTR module)
...
@@ -2407,7 +2407,7 @@ void gck_rpc_layer_inetd(CK_FUNCTION_LIST_PTR module)
*
*
* Returns -1 on failure, and the socket fd otherwise.
* Returns -1 on failure, and the socket fd otherwise.
*/
*/
static
int
_get_listening_socket
(
char
*
host
,
char
*
port
)
static
int
_get_listening_socket
(
const
char
*
proto
,
const
char
*
host
,
const
char
*
port
)
{
{
char
hoststr
[
NI_MAXHOST
],
portstr
[
NI_MAXSERV
];
char
hoststr
[
NI_MAXHOST
],
portstr
[
NI_MAXSERV
];
struct
addrinfo
*
ai
,
*
first
,
hints
;
struct
addrinfo
*
ai
,
*
first
,
hints
;
...
@@ -2485,7 +2485,7 @@ static int _get_listening_socket(char *host, char *port)
...
@@ -2485,7 +2485,7 @@ static int _get_listening_socket(char *host, char *port)
}
}
snprintf
(
pkcs11_socket_path
,
sizeof
(
pkcs11_socket_path
),
snprintf
(
pkcs11_socket_path
,
sizeof
(
pkcs11_socket_path
),
(
ai
->
ai_family
==
AF_INET6
)
?
"[%s]:%s"
:
"%s:
%s"
,
hoststr
,
portstr
);
(
ai
->
ai_family
==
AF_INET6
)
?
"
%s://
[%s]:%s"
:
"%s:
//%s:%s"
,
proto
,
hoststr
,
portstr
);
out:
out:
freeaddrinfo
(
first
);
freeaddrinfo
(
first
);
...
@@ -2531,13 +2531,16 @@ int gck_rpc_layer_initialize(const char *prefix, CK_FUNCTION_LIST_PTR module)
...
@@ -2531,13 +2531,16 @@ int gck_rpc_layer_initialize(const char *prefix, CK_FUNCTION_LIST_PTR module)
* TCP socket
* TCP socket
*/
*/
char
*
host
,
*
port
;
char
*
host
,
*
port
;
char
proto
[
4
];
/* strlen("tcp") and strlen("tls") */
snprintf
(
proto
,
sizeof
(
proto
),
"%s"
,
prefix
);
if
(
!
gck_rpc_parse_host_port
(
prefix
+
6
,
&
host
,
&
port
))
{
if
(
!
gck_rpc_parse_host_port
(
prefix
+
6
,
&
host
,
&
port
))
{
free
(
host
);
free
(
host
);
return
-
1
;
return
-
1
;
}
}
if
((
sock
=
_get_listening_socket
(
host
,
port
))
==
-
1
)
{
if
((
sock
=
_get_listening_socket
(
proto
,
host
,
port
))
==
-
1
)
{
free
(
host
);
free
(
host
);
return
-
1
;
return
-
1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment