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
a8e2582f
Commit
a8e2582f
authored
Nov 06, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Merged trunk changes r9181:9183 to 0.8.1 branch.
parent
e0f590b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
2 deletions
+62
-2
modules/misc/gnutls.c
modules/misc/gnutls.c
+62
-2
No files found.
modules/misc/gnutls.c
View file @
a8e2582f
...
...
@@ -36,11 +36,12 @@
* Preamble
*****************************************************************************/
#include <stdlib.h>
#include <errno.h>
#include <vlc/vlc.h>
#include "vlc_tls.h"
#include <gcrypt.h>
#include <gnutls/gnutls.h>
#define DH_BITS 1024
...
...
@@ -383,6 +384,56 @@ gnutls_ServerCreate( tls_t *p_this, const char *psz_cert_path,
}
/*
* gcrypt thread option VLC implementation
*/
vlc_object_t
*
__p_gcry_data
;
static
int
gcry_vlc_mutex_init
(
void
**
p_sys
)
{
int
i_val
;
vlc_mutex_t
*
p_lock
=
(
vlc_mutex_t
*
)
malloc
(
sizeof
(
vlc_mutex_t
));
if
(
p_lock
==
NULL
)
return
ENOMEM
;
i_val
=
vlc_mutex_init
(
__p_gcry_data
,
p_lock
);
if
(
i_val
)
free
(
p_lock
);
else
*
p_sys
=
p_lock
;
return
i_val
;
}
static
int
gcry_vlc_mutex_destroy
(
void
**
p_sys
)
{
int
i_val
;
vlc_mutex_t
*
p_lock
=
(
vlc_mutex_t
*
)
*
p_sys
;
i_val
=
vlc_mutex_destroy
(
p_lock
);
free
(
p_lock
);
return
i_val
;
}
static
int
gcry_vlc_mutex_lock
(
void
**
p_sys
)
{
return
vlc_mutex_lock
((
vlc_mutex_t
*
)
*
p_sys
);
}
static
int
gcry_vlc_mutex_unlock
(
void
**
lock
)
{
return
vlc_mutex_unlock
((
vlc_mutex_t
*
)
*
lock
);
}
static
struct
gcry_thread_cbs
gcry_threads_vlc
=
{
GCRY_THREAD_OPTION_USER
,
NULL
,
gcry_vlc_mutex_init
,
gcry_vlc_mutex_destroy
,
gcry_vlc_mutex_lock
,
gcry_vlc_mutex_unlock
};
static
int
...
...
@@ -400,15 +451,24 @@ Open( vlc_object_t *p_this )
var_Create
(
p_this
->
p_libvlc
,
"gnutls_count"
,
VLC_VAR_INTEGER
);
var_Get
(
p_this
->
p_libvlc
,
"gnutls_count"
,
&
count
);
/* FIXME: should check version number */
if
(
count
.
i_int
==
0
)
{
__p_gcry_data
=
p_this
;
gcry_control
(
GCRYCTL_SET_THREAD_CBS
,
&
gcry_threads_vlc
);
if
(
gnutls_global_init
(
)
)
{
msg_Warn
(
p_this
,
"cannot initialize GNUTLS"
);
vlc_mutex_unlock
(
lock
.
p_address
);
return
VLC_EGENERIC
;
}
if
(
gnutls_check_version
(
"1.0.0"
)
==
NULL
)
{
gnutls_global_deinit
(
);
vlc_mutex_unlock
(
lock
.
p_address
);
msg_Err
(
p_this
,
"unsupported GNUTLS version"
);
return
VLC_EGENERIC
;
}
msg_Dbg
(
p_this
,
"GNUTLS initialized"
);
}
...
...
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