Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
5c8ad6bb
Commit
5c8ad6bb
authored
Nov 06, 2004
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--dh-bits option to change the Diffie Hellman prime number's bits size
parent
d36e5c73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
6 deletions
+24
-6
modules/misc/gnutls.c
modules/misc/gnutls.c
+24
-6
No files found.
modules/misc/gnutls.c
View file @
5c8ad6bb
...
@@ -63,8 +63,8 @@ vlc_module_begin();
...
@@ -63,8 +63,8 @@ vlc_module_begin();
set_capability
(
"tls"
,
1
);
set_capability
(
"tls"
,
1
);
set_callbacks
(
Open
,
Close
);
set_callbacks
(
Open
,
Close
);
/*add_integer( "dh-bits", 1024
, NULL, DH_BITS_TEXT,
add_integer
(
"dh-bits"
,
DH_BITS
,
NULL
,
DH_BITS_TEXT
,
DH_BITS_LONGTEXT, VLC_TRUE );
*/
DH_BITS_LONGTEXT
,
VLC_TRUE
);
vlc_module_end
();
vlc_module_end
();
...
@@ -168,6 +168,7 @@ gnutls_ServerSessionPrepare( tls_server_t *p_server )
...
@@ -168,6 +168,7 @@ gnutls_ServerSessionPrepare( tls_server_t *p_server )
tls_session_t
*
p_session
;
tls_session_t
*
p_session
;
gnutls_session
*
p_sys
;
gnutls_session
*
p_sys
;
int
val
;
int
val
;
vlc_value_t
bits
;
p_sys
=
(
gnutls_session
*
)
malloc
(
sizeof
(
gnutls_session
*
)
);
p_sys
=
(
gnutls_session
*
)
malloc
(
sizeof
(
gnutls_session
*
)
);
if
(
p_sys
==
NULL
)
if
(
p_sys
==
NULL
)
...
@@ -208,7 +209,14 @@ gnutls_ServerSessionPrepare( tls_server_t *p_server )
...
@@ -208,7 +209,14 @@ gnutls_ServerSessionPrepare( tls_server_t *p_server )
/*gnutls_certificate_server_set_request( p_session->session,
/*gnutls_certificate_server_set_request( p_session->session,
GNUTLS_CERT_REQUEST ); */
GNUTLS_CERT_REQUEST ); */
gnutls_dh_set_prime_bits
(
*
p_sys
,
DH_BITS
);
if
(
var_Get
(
p_server
->
p_tls
,
"dh-bits"
,
&
bits
)
!=
VLC_SUCCESS
)
{
var_Create
(
p_server
->
p_tls
,
"dh-bits"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_server
->
p_tls
,
"dh-bits"
,
&
bits
);
}
gnutls_dh_set_prime_bits
(
*
p_sys
,
bits
.
i_int
);
p_session
=
malloc
(
sizeof
(
struct
tls_session_t
)
);
p_session
=
malloc
(
sizeof
(
struct
tls_session_t
)
);
if
(
p_session
==
NULL
)
if
(
p_session
==
NULL
)
...
@@ -350,8 +358,18 @@ gnutls_ServerCreate( tls_t *p_this, const char *psz_cert_path,
...
@@ -350,8 +358,18 @@ gnutls_ServerCreate( tls_t *p_this, const char *psz_cert_path,
val
=
gnutls_dh_params_init
(
&
p_server_sys
->
dh_params
);
val
=
gnutls_dh_params_init
(
&
p_server_sys
->
dh_params
);
if
(
val
>=
0
)
if
(
val
>=
0
)
{
{
vlc_value_t
bits
;
if
(
var_Get
(
p_this
,
"dh-bits"
,
&
bits
)
!=
VLC_SUCCESS
)
{
var_Create
(
p_this
,
"dh-bits"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_this
,
"dh-bits"
,
&
bits
);
}
msg_Dbg
(
p_this
,
"Computing Diffie Hellman ciphers parameters"
);
msg_Dbg
(
p_this
,
"Computing Diffie Hellman ciphers parameters"
);
val
=
gnutls_dh_params_generate2
(
p_server_sys
->
dh_params
,
DH_BITS
);
val
=
gnutls_dh_params_generate2
(
p_server_sys
->
dh_params
,
bits
.
i_int
);
}
}
if
(
val
<
0
)
if
(
val
<
0
)
{
{
...
@@ -459,13 +477,13 @@ Open( vlc_object_t *p_this )
...
@@ -459,13 +477,13 @@ Open( vlc_object_t *p_this )
if
(
gnutls_global_init
(
)
)
if
(
gnutls_global_init
(
)
)
{
{
msg_Warn
(
p_this
,
"cannot initialize GNUTLS"
);
msg_Warn
(
p_this
,
"cannot initialize GNUTLS"
);
vlc_mutex_unlock
(
lock
.
p_address
);
vlc_mutex_unlock
(
lock
.
p_address
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
if
(
gnutls_check_version
(
"1.0.0"
)
==
NULL
)
if
(
gnutls_check_version
(
"1.0.0"
)
==
NULL
)
{
{
gnutls_global_deinit
(
);
gnutls_global_deinit
(
);
vlc_mutex_unlock
(
lock
.
p_address
);
vlc_mutex_unlock
(
lock
.
p_address
);
msg_Err
(
p_this
,
"unsupported GNUTLS version"
);
msg_Err
(
p_this
,
"unsupported GNUTLS version"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
...
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