Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
82a6e7c5
Commit
82a6e7c5
authored
3 months ago
by
Deucе
Browse files
Options
Downloads
Patches
Plain Diff
Add Socket.tls_psk_id property
If tls_psk is used, indicates which entry in tls_psk was used by the remote.
parent
a5b15cfa
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#8124
passed
3 months ago
Stage: build
Stage: test
Stage: cleanup
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/js_socket.c
+21
-0
21 additions, 0 deletions
src/sbbs3/js_socket.c
with
21 additions
and
0 deletions
src/sbbs3/js_socket.c
+
21
−
0
View file @
82a6e7c5
...
...
@@ -2244,6 +2244,7 @@ enum {
,
SOCK_PROP_SSL_SERVER
,
SOCK_PROP_TLS_MINVER
,
SOCK_PROP_TLS_PSK
,
SOCK_PROP_TLS_PSK_ID
};
...
...
@@ -2639,6 +2640,25 @@ static JSBool js_socket_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
else
*
vp
=
OBJECT_TO_JSVAL
(
p
->
tls_psk
);
break
;
case
SOCK_PROP_TLS_PSK_ID
:
if
(
p
->
tls_psk
==
NULL
)
*
vp
=
JSVAL_VOID
;
else
{
int
idlen
;
if
((
cryptGetAttributeString
(
p
->
session
,
CRYPT_SESSINFO_USERNAME
,
NULL
,
&
idlen
)
==
CRYPT_OK
)
&&
(
idlen
>
0
))
{
char
*
id
=
malloc
(
idlen
);
if
(
id
)
{
if
(
cryptGetAttributeString
(
p
->
session
,
CRYPT_SESSINFO_USERNAME
,
id
,
&
idlen
)
==
CRYPT_OK
)
{
if
((
js_str
=
JS_NewStringCopyN
(
cx
,
id
,
idlen
))
==
NULL
)
{
free
(
id
);
return
JS_FALSE
;
}
*
vp
=
STRING_TO_JSVAL
(
js_str
);
}
free
(
id
);
}
}
}
}
JS_RESUMEREQUEST
(
cx
,
rc
);
...
...
@@ -2672,6 +2692,7 @@ static jsSyncPropertySpec js_socket_properties[] = {
{
"ssl_server"
,
SOCK_PROP_SSL_SERVER
,
JSPROP_ENUMERATE
,
316
},
{
"tls_minver"
,
SOCK_PROP_TLS_MINVER
,
JSPROP_ENUMERATE
,
320
},
{
"tls_psk"
,
SOCK_PROP_TLS_PSK
,
JSPROP_ENUMERATE
,
320
},
{
"tls_psk_id"
,
SOCK_PROP_TLS_PSK_ID
,
JSPROP_ENUMERATE
|
JSPROP_READONLY
,
320
},
{
0
}
};
...
...
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