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
6967fdf4
Commit
6967fdf4
authored
Nov 06, 2004
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gcrypt thread-safety
parent
0e72bf9d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
1 deletion
+55
-1
modules/misc/gnutls.c
modules/misc/gnutls.c
+55
-1
No files found.
modules/misc/gnutls.c
View file @
6967fdf4
...
...
@@ -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
...
...
@@ -403,6 +454,9 @@ Open( vlc_object_t *p_this )
/* 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"
);
...
...
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