Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc
Commits
c7d79839
Commit
c7d79839
authored
Oct 17, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error out if hostname not specified
(this would be a bug in whatever is using the TLS object anyway)
parent
664b1e97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
modules/misc/gnutls.c
modules/misc/gnutls.c
+11
-16
No files found.
modules/misc/gnutls.c
View file @
c7d79839
...
...
@@ -413,17 +413,13 @@ gnutls_HandshakeAndValidate( tls_session_t *session )
goto
error
;
}
if
(
p_sys
->
psz_hostname
!=
NULL
)
assert
(
p_sys
->
psz_hostname
!=
NULL
);
if
(
!
gnutls_x509_crt_check_hostname
(
cert
,
p_sys
->
psz_hostname
)
)
{
if
(
!
gnutls_x509_crt_check_hostname
(
cert
,
p_sys
->
psz_hostname
)
)
{
msg_Err
(
session
,
"Certificate does not match
\"
%s
\"
"
,
p_sys
->
psz_hostname
);
goto
error
;
}
msg_Err
(
session
,
"Certificate does not match
\"
%s
\"
"
,
p_sys
->
psz_hostname
);
goto
error
;
}
else
msg_Warn
(
session
,
"Certificate and hostname were not verified"
);
if
(
gnutls_x509_crt_get_expiration_time
(
cert
)
<
time
(
NULL
)
)
{
...
...
@@ -713,7 +709,6 @@ static int OpenClient (vlc_object_t *obj)
p_session
->
pf_set_fd
=
gnutls_SetFD
;
p_sys
->
session
.
b_handshaked
=
VLC_FALSE
;
p_sys
->
session
.
psz_hostname
=
NULL
;
const
char
*
homedir
=
obj
->
p_libvlc
->
psz_datadir
,
*
datadir
=
config_GetDataDir
();
...
...
@@ -778,12 +773,12 @@ static int OpenClient (vlc_object_t *obj)
}
char
*
servername
=
var_GetNonEmptyString
(
p_session
,
"tls-server-name"
);
if
(
servername
!
=
NULL
)
{
p_sys
->
session
.
psz_hostname
=
servername
;
gnutls_server_name_set
(
p_sys
->
session
.
session
,
GNUTLS_NAME_DNS
,
servername
,
strlen
(
servername
));
}
if
(
servername
=
=
NULL
)
msg_Err
(
p_session
,
"server name missing for TLS session"
);
p_sys
->
session
.
psz_hostname
=
servername
;
gnutls_server_name_set
(
p_sys
->
session
.
session
,
GNUTLS_NAME_DNS
,
servername
,
strlen
(
servername
));
return
VLC_SUCCESS
;
...
...
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