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
cafbe261
Commit
cafbe261
authored
Aug 23, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gnutls: generate Diffie-Hellman parameters dynamically (fixes #14702)
parent
5f000e6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
27 deletions
+9
-27
modules/misc/Makefile.am
modules/misc/Makefile.am
+1
-1
modules/misc/dhparams.h
modules/misc/dhparams.h
+0
-17
modules/misc/gnutls.c
modules/misc/gnutls.c
+8
-8
po/POTFILES.in
po/POTFILES.in
+0
-1
No files found.
modules/misc/Makefile.am
View file @
cafbe261
...
@@ -24,7 +24,7 @@ libfingerprinter_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/misc
...
@@ -24,7 +24,7 @@ libfingerprinter_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/misc
libfingerprinter_plugin_la_LIBADD
=
$(LIBM)
$(LIBPTHREAD)
libfingerprinter_plugin_la_LIBADD
=
$(LIBM)
$(LIBPTHREAD)
misc_LTLIBRARIES
+=
libfingerprinter_plugin.la
misc_LTLIBRARIES
+=
libfingerprinter_plugin.la
libgnutls_plugin_la_SOURCES
=
misc/gnutls.c
misc/dhparams.h
libgnutls_plugin_la_SOURCES
=
misc/gnutls.c
libgnutls_plugin_la_CFLAGS
=
$(AM_CFLAGS)
$(GNUTLS_CFLAGS)
libgnutls_plugin_la_CFLAGS
=
$(AM_CFLAGS)
$(GNUTLS_CFLAGS)
libgnutls_plugin_la_LIBADD
=
$(GNUTLS_LIBS)
libgnutls_plugin_la_LIBADD
=
$(GNUTLS_LIBS)
if
HAVE_WIN32
if
HAVE_WIN32
...
...
modules/misc/dhparams.h
deleted
100644 → 0
View file @
5f000e6a
/**
* Pre-computed Diffie-Hellman-Merkel parameters.
* $Id$
* Numbers are not copyrightable.
*
* If you feel like it, generate new ones:
* # certtool --generate-dh-params --bits 2048
*/
static
const
unsigned
char
dh_params
[]
=
"-----BEGIN DH PARAMETERS-----
\n
"
"MIIBBwKCAQDJ9pqmqBy71hn5pA3QL1AiGB2JOKq2wfdRq3EQVdbOtPscXM6BXdm7"
"NfBRUZIGT47oPNgCOhVV33z9OfnMHCSiMoWFPZeT14Mdm5TQBBYA2H6tf0g2Fp4X"
"qs7eeYheslzkg1V7U7PcdsyopiGI0FC4Heq+PxcyFOC0DuDUNiRq2Pk51gSUQURS"
"dtTyiU5fEFUETcFN2FWuPuCdQpA0xmYnQwnTJKq75b1GAxRlp6XqTbWmXgBggwYk"
"+O/oGpgVLlwZPquSbumbQsp4OU0Lk0hxqTR4Jd3XIeBuV/pc1zZaCH/9LIQT6aXn"
"S1wHhOlCUKgPWlBtx82omKgyo8ebJwWjAgEG
\n
"
"-----END DH PARAMETERS-----"
;
modules/misc/gnutls.c
View file @
cafbe261
/*****************************************************************************
/*****************************************************************************
* gnutls.c
* gnutls.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2004-201
4
Rémi Denis-Courmont
* Copyright (C) 2004-201
5
Rémi Denis-Courmont
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* it under the terms of the GNU Lesser General Public License as published by
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
#include <gnutls/gnutls.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include <gnutls/x509.h>
#include "dhparams.h"
#if (GNUTLS_VERSION_NUMBER >= 0x030300)
#if (GNUTLS_VERSION_NUMBER >= 0x030300)
static
int
gnutls_Init
(
vlc_object_t
*
obj
)
static
int
gnutls_Init
(
vlc_object_t
*
obj
)
...
@@ -631,18 +630,17 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
...
@@ -631,18 +630,17 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
}
}
/* FIXME:
/* FIXME:
* - regenerate these regularly
* - support other cipher suites
* - support other cipher suites
*/
*/
val
=
gnutls_dh_params_init
(
&
sys
->
dh_params
);
val
=
gnutls_dh_params_init
(
&
sys
->
dh_params
);
if
(
val
>=
0
)
if
(
val
>=
0
)
{
{
const
gnutls_datum_t
data
=
{
gnutls_sec_param_t
sec
=
GNUTLS_SEC_PARAM_MEDIUM
;
.
data
=
(
unsigned
char
*
)
dh_params
,
unsigned
bits
=
gnutls_sec_param_to_pk_bits
(
GNUTLS_PK_DH
,
sec
);
.
size
=
sizeof
(
dh_params
)
-
1
,
};
val
=
gnutls_dh_params_import_pkcs3
(
sys
->
dh_params
,
&
data
,
msg_Dbg
(
crd
,
"generating Diffie-Hellman %u-bits parameters..."
,
bits
);
GNUTLS_X509_FMT_PEM
);
val
=
gnutls_dh_params_generate2
(
sys
->
dh_params
,
bits
);
if
(
val
==
0
)
if
(
val
==
0
)
gnutls_certificate_set_dh_params
(
sys
->
x509_cred
,
gnutls_certificate_set_dh_params
(
sys
->
x509_cred
,
sys
->
dh_params
);
sys
->
dh_params
);
...
@@ -653,6 +651,8 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
...
@@ -653,6 +651,8 @@ static int OpenServer (vlc_tls_creds_t *crd, const char *cert, const char *key)
gnutls_strerror
(
val
));
gnutls_strerror
(
val
));
}
}
msg_Dbg
(
crd
,
"ciphers parameters loaded"
);
crd
->
sys
=
sys
;
crd
->
sys
=
sys
;
crd
->
open
=
gnutls_ServerSessionOpen
;
crd
->
open
=
gnutls_ServerSessionOpen
;
crd
->
handshake
=
gnutls_ServerHandshake
;
crd
->
handshake
=
gnutls_ServerHandshake
;
...
...
po/POTFILES.in
View file @
cafbe261
...
@@ -982,7 +982,6 @@ modules/lua/vlc.h
...
@@ -982,7 +982,6 @@ modules/lua/vlc.h
modules/meta_engine/folder.c
modules/meta_engine/folder.c
modules/meta_engine/taglib.cpp
modules/meta_engine/taglib.cpp
modules/misc/audioscrobbler.c
modules/misc/audioscrobbler.c
modules/misc/dhparams.h
modules/misc/gnutls.c
modules/misc/gnutls.c
modules/misc/inhibit/dbus.c
modules/misc/inhibit/dbus.c
modules/misc/inhibit/xdg.c
modules/misc/inhibit/xdg.c
...
...
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