Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
Knot Resolver
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jonathan Coetzee
Knot Resolver
Commits
8d63231f
Verified
Commit
8d63231f
authored
Jan 03, 2019
by
Grigorii Demidov
Committed by
Petr Špaček
Jan 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daemon/tls: fix broken compatibility with gnutls 3.3
parent
36c4f90e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
NEWS
NEWS
+8
-0
daemon/tls.c
daemon/tls.c
+16
-2
No files found.
NEWS
View file @
8d63231f
Knot Resolver 3.X.Y (2019-0m-dd)
================================
Bugfixes
--------
- policy.TLS_FORWARD: fix problems with gnutls 3.3 (#438)
Knot Resolver 3.2.0 (2018-12-17)
Knot Resolver 3.2.0 (2018-12-17)
================================
================================
...
...
daemon/tls.c
View file @
8d63231f
...
@@ -1188,6 +1188,20 @@ void tls_client_ctx_free(struct tls_client_ctx_t *ctx)
...
@@ -1188,6 +1188,20 @@ void tls_client_ctx_free(struct tls_client_ctx_t *ctx)
free
(
ctx
);
free
(
ctx
);
}
}
int
tls_pull_timeout_func
(
gnutls_transport_ptr_t
h
,
unsigned
int
ms
)
{
struct
tls_common_ctx
*
t
=
(
struct
tls_common_ctx
*
)
h
;
assert
(
t
!=
NULL
);
ssize_t
avail
=
t
->
nread
-
t
->
consumed
;
DEBUG_MSG
(
"[%s] timeout check: available: %zu
\n
"
,
t
->
client_side
?
"tls_client"
:
"tls"
,
avail
);
if
(
avail
<=
0
)
{
errno
=
EAGAIN
;
return
-
1
;
}
return
avail
;
}
int
tls_client_connect_start
(
struct
tls_client_ctx_t
*
client_ctx
,
int
tls_client_connect_start
(
struct
tls_client_ctx_t
*
client_ctx
,
struct
session
*
session
,
struct
session
*
session
,
tls_handshake_cb
handshake_cb
)
tls_handshake_cb
handshake_cb
)
...
@@ -1202,6 +1216,7 @@ int tls_client_connect_start(struct tls_client_ctx_t *client_ctx,
...
@@ -1202,6 +1216,7 @@ int tls_client_connect_start(struct tls_client_ctx_t *client_ctx,
gnutls_session_set_ptr
(
ctx
->
tls_session
,
client_ctx
);
gnutls_session_set_ptr
(
ctx
->
tls_session
,
client_ctx
);
gnutls_handshake_set_timeout
(
ctx
->
tls_session
,
ctx
->
worker
->
engine
->
net
.
tcp
.
tls_handshake_timeout
);
gnutls_handshake_set_timeout
(
ctx
->
tls_session
,
ctx
->
worker
->
engine
->
net
.
tcp
.
tls_handshake_timeout
);
gnutls_transport_set_pull_timeout_function
(
ctx
->
tls_session
,
tls_pull_timeout_func
);
session_tls_set_client_ctx
(
session
,
client_ctx
);
session_tls_set_client_ctx
(
session
,
client_ctx
);
ctx
->
handshake_cb
=
handshake_cb
;
ctx
->
handshake_cb
=
handshake_cb
;
ctx
->
handshake_state
=
TLS_HS_IN_PROGRESS
;
ctx
->
handshake_state
=
TLS_HS_IN_PROGRESS
;
...
@@ -1215,8 +1230,7 @@ int tls_client_connect_start(struct tls_client_ctx_t *client_ctx,
...
@@ -1215,8 +1230,7 @@ int tls_client_connect_start(struct tls_client_ctx_t *client_ctx,
/* See https://www.gnutls.org/manual/html_node/Asynchronous-operation.html */
/* See https://www.gnutls.org/manual/html_node/Asynchronous-operation.html */
while
(
ctx
->
handshake_state
<=
TLS_HS_IN_PROGRESS
)
{
while
(
ctx
->
handshake_state
<=
TLS_HS_IN_PROGRESS
)
{
/* Don't pass the handshake callback as the connection isn't registered yet. */
int
ret
=
tls_handshake
(
ctx
,
handshake_cb
);
int
ret
=
tls_handshake
(
ctx
,
NULL
);
if
(
ret
!=
kr_ok
())
{
if
(
ret
!=
kr_ok
())
{
return
ret
;
return
ret
;
}
}
...
...
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