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
d36cc944
Commit
d36cc944
authored
Dec 06, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for TLSv1.1 deflate compression
parent
82f9a191
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
30 deletions
+42
-30
modules/misc/gnutls.c
modules/misc/gnutls.c
+42
-30
No files found.
modules/misc/gnutls.c
View file @
d36cc944
...
@@ -111,23 +111,6 @@ vlc_module_end();
...
@@ -111,23 +111,6 @@ vlc_module_end();
#define MAX_SESSION_ID 32
#define MAX_SESSION_ID 32
#define MAX_SESSION_DATA 1024
#define MAX_SESSION_DATA 1024
static
const
int
proto_priority
[]
=
{
GNUTLS_TLS1_1
,
GNUTLS_TLS1_0
,
GNUTLS_SSL3
,
0
};
static
const
int
cert_type_priority
[]
=
{
GNUTLS_CRT_X509
,
//GNUTLS_CRT_OPENPGP, TODO
0
};
typedef
struct
saved_session_t
typedef
struct
saved_session_t
{
{
char
id
[
MAX_SESSION_ID
];
char
id
[
MAX_SESSION_ID
];
...
@@ -426,35 +409,64 @@ gnutls_SessionClose( tls_session_t *p_session )
...
@@ -426,35 +409,64 @@ gnutls_SessionClose( tls_session_t *p_session )
}
}
typedef
int
(
*
tls_prio_func
)
(
gnutls_session_t
,
const
int
*
);
static
int
static
int
gnutls_SessionPrioritize
(
vlc_object_t
*
obj
,
gnutls_session_t
session
)
gnutls_SetPriority
(
vlc_object_t
*
restrict
obj
,
const
char
*
restrict
name
,
tls_prio_func
func
,
gnutls_session_t
session
,
const
int
*
restrict
values
)
{
{
int
val
;
int
val
=
func
(
session
,
values
);
val
=
gnutls_set_default_priority
(
session
);
if
(
val
<
0
)
if
(
val
<
0
)
{
{
msg_Err
(
obj
,
"cannot set
TLS priorities: %s"
,
msg_Err
(
obj
,
"cannot set
%s priorities: %s"
,
name
,
gnutls_strerror
(
val
));
gnutls_strerror
(
val
));
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
return
VLC_SUCCESS
;
}
val
=
gnutls_protocol_set_priority
(
session
,
proto_priority
);
if
(
val
<
0
)
static
int
gnutls_SessionPrioritize
(
vlc_object_t
*
obj
,
gnutls_session_t
session
)
{
static
const
int
protos
[]
=
{
{
msg_Err
(
obj
,
"cannot set protocols priorities: %s"
,
GNUTLS_TLS1_1
,
gnutls_strerror
(
val
));
GNUTLS_TLS1_0
,
return
VLC_EGENERIC
;
GNUTLS_SSL3
,
}
0
};
static
const
int
comps
[]
=
{
GNUTLS_COMP_ZLIB
,
GNUTLS_COMP_NULL
,
0
};
static
const
int
cert_types
[]
=
{
GNUTLS_CRT_X509
,
//GNUTLS_CRT_OPENPGP, TODO
0
};
val
=
gnutls_certificate_type_set_priority
(
session
,
cert_type_priority
);
int
val
=
gnutls_set_default_priority
(
session
);
if
(
val
<
0
)
if
(
val
<
0
)
{
{
msg_Err
(
obj
,
"cannot set
certificate type
priorities: %s"
,
msg_Err
(
obj
,
"cannot set
default TLS
priorities: %s"
,
gnutls_strerror
(
val
));
gnutls_strerror
(
val
));
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
if
(
gnutls_SetPriority
(
obj
,
"protocols"
,
gnutls_protocol_set_priority
,
session
,
protos
)
||
gnutls_SetPriority
(
obj
,
"compressions"
,
gnutls_compression_set_priority
,
session
,
comps
)
||
gnutls_SetPriority
(
obj
,
"certificate types"
,
gnutls_certificate_type_set_priority
,
session
,
cert_types
))
return
VLC_EGENERIC
;
return
VLC_SUCCESS
;
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