VLC  4.0.0-dev
update.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * update.h: VLC PGP update private API
3  *****************************************************************************
4  * Copyright © 2007-2008 VLC authors and VideoLAN
5  *
6  * Authors: Rafaël Carré <funman@videolanorg>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either release 2 of the License, or
11  * (at your option) any later release.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22 
23 #include <stdatomic.h>
24 
25 #include <vlc_update.h>
26 
27 enum /* Packet types */
28 {
29  SIGNATURE_PACKET = 0x02,
30  PUBLIC_KEY_PACKET = 0x06,
31  USER_ID_PACKET = 0x0d
32 };
33 
34 enum /* Signature types */
35 {
38 
39  /* Public keys signatures */
40  GENERIC_KEY_SIGNATURE = 0x10, /* No assumption of verification */
41  PERSONA_KEY_SIGNATURE = 0x11, /* No verification has been made */
42  CASUAL_KEY_SIGNATURE = 0x12, /* Some casual verification */
43  POSITIVE_KEY_SIGNATURE = 0x13 /* Substantial verification */
44 };
45 
46 enum /* Signature subpacket types */
47 {
49 };
50 
52 {
53 
54  uint8_t version; /* we use only version 4 */
55  uint8_t timestamp[4]; /* creation time of the key */
56  uint8_t algo; /* DSA or RSA */
57 
58  /* the multi precision integers, with their 2 bytes length header */
59  union {
60  struct {
61  uint8_t p[2+3072/8];
62  uint8_t q[2+256/8];
63  uint8_t g[2+3072/8];
64  uint8_t y[2+3072/8];
65  } dsa ;
66  struct {
67  uint8_t n[2+4096/8];
68  uint8_t e[2+4096/8];
69  } rsa;
70  } sig;
71 };
72 
73 /* used for public key and file signatures */
75 {
76  uint8_t version; /* 3 or 4 */
77 
78  uint8_t type;
79  uint8_t public_key_algo; /* DSA or RSA */
80  uint8_t digest_algo;
81 
82  uint8_t hash_verification[2];
83  uint8_t issuer_longid[8];
84 
85  union /* version specific data */
86  {
87  struct
88  {
89  uint8_t hashed_data_len[2]; /* scalar number */
90  uint8_t *hashed_data; /* hashed_data_len bytes */
91  uint8_t unhashed_data_len[2]; /* scalar number */
92  uint8_t *unhashed_data; /* unhashed_data_len bytes */
93  } v4;
94  struct
95  {
96  uint8_t hashed_data_len; /* MUST be 5 */
97  uint8_t timestamp[4]; /* 4 bytes scalar number */
98  } v3;
99  } specific;
100 
101 /* The part below is made of consecutive MPIs, their number and size being
102  * public-key-algorithm dependent.
103  */
104  union {
105  struct {
106  uint8_t r[2+256/8];
107  uint8_t s[2+256/8];
108  } dsa;
109  struct {
110  uint8_t s[2+4096/8];
111  } rsa;
112  } algo_specific;
113 };
114 
117 
119 {
120  uint8_t longid[8]; /* Long id */
121  uint8_t *psz_username; /* USER ID */
122 
123  public_key_packet_t key; /* Public key packet */
124 
125  signature_packet_t sig; /* Signature packet, by the embedded key */
126 };
127 
128 typedef struct public_key_t public_key_t;
129 
130 /**
131  * Non blocking binary download
132  */
133 typedef struct
134 {
136 
138  atomic_bool aborted;
140  char *psz_destdir;
142 
143 /**
144  * Non blocking update availability verification
145  */
146 typedef struct
147 {
149 
151  void (*pf_callback)( void *, bool );
152  void *p_data;
154 
155 /**
156  * The update object. Stores (and caches) all information relative to updates
157  */
158 struct update_t
159 {
162  struct update_release_t release; ///< Release (version)
166 };
167 
168 /*
169  * download a public key (the last one) from videolan server, and parse it
170  */
171 public_key_t *
173  vlc_object_t *p_this, const uint8_t *p_longid,
174  const uint8_t *p_signature_issuer );
175 
176 /*
177  * fill a public_key_t with public key data, including:
178  * * public key packet
179  * * signature packet issued by key which long id is p_sig_issuer
180  * * user id packet
181  */
182 int
184  const uint8_t *p_key_data, size_t i_key_len, public_key_t *p_key,
185  const uint8_t *p_sig_issuer );
186 
187 /*
188  * Verify an OpenPGP signature made on some hash, with some public key
189  */
190 int
192  uint8_t *p_hash );
193 
194 /*
195  * Download the signature associated to a document or a binary file.
196  * We're given the file's url, we just append ".asc" to it and download
197  */
198 int
200  vlc_object_t *p_this, signature_packet_t *p_sig, const char *psz_url );
201 
202 /*
203  * return a hash of a text
204  */
205 uint8_t *
207  const char *psz_text, signature_packet_t *p_sig );
208 
209 /*
210  * return a hash of a file
211  */
212 uint8_t *
214  const char *psz_file, signature_packet_t *p_sig );
215 
216 /*
217  * return a hash of a public key
218  */
219 uint8_t *
vlc_cond_broadcast
void vlc_cond_broadcast(vlc_cond_t *cond)
Wakes up all threads waiting on a condition variable.
Definition: threads.c:280
vlc_mutex_init
void vlc_mutex_init(vlc_mutex_t *mtx)
Initializes a fast mutex.
Definition: threads.c:123
text_style_Merge
void text_style_Merge(text_style_t *p_dst, const text_style_t *p_src, bool b_override)
Merge two styles using non default values.
Definition: text_style.c:270
GENERIC_KEY_SIGNATURE
@ GENERIC_KEY_SIGNATURE
Definition: update.h:40
STYLE_NO_DEFAULTS
#define STYLE_NO_DEFAULTS
Definition: vlc_text_style.h:83
text_style_Create
text_style_t * text_style_Create(int i_defaults)
Create a text style.
Definition: text_style.c:213
STYLE_HAS_BACKGROUND_ALPHA
#define STYLE_HAS_BACKGROUND_ALPHA
Definition: vlc_text_style.h:93
signature_packet_t::hashed_data_len
uint8_t hashed_data_len[2]
Definition: update.h:89
vlc_object_t::obj
struct vlc_object_marker * obj
Definition: vlc_objects.h:48
signature_packet_t::hashed_data
uint8_t * hashed_data
Definition: update.h:90
vlc_stream_GetSize
static int vlc_stream_GetSize(stream_t *s, uint64_t *size)
Get the size of the stream.
Definition: vlc_stream.h:331
libvlc_Quit
void libvlc_Quit(libvlc_int_t *p_libvlc)
Posts an exit signal to LibVLC instance.
Definition: exit.c:55
vlc_rwlock_rdlock
void vlc_rwlock_rdlock(vlc_rwlock_t *lock)
Acquires a read/write lock for reading.
Definition: threads.c:394
vlc_cleanup_push
#define vlc_cleanup_push(routine, arg)
Registers a thread cancellation handler.
Definition: vlc_threads.h:1010
vlc_gcrypt_init
static void vlc_gcrypt_init(void)
Definition: vlc_gcrypt.h:29
update_Download
void update_Download(update_t *p_update, const char *psz_destdir)
Download the file given in the update_t.
Definition: update.c:499
strcasecmp
int strcasecmp(const char *, const char *)
psz_name
const char * psz_name
Definition: text_style.c:53
vlc_mutex_t::owner
const void * owner
Definition: vlc_threads.h:238
text_segment_t
Text segment for subtitles.
Definition: vlc_text_style.h:140
vlc_dialog_wait_question
#define vlc_dialog_wait_question(a, b, c, d, e, f, g,...)
Definition: vlc_dialog.h:150
update_t::release
struct update_release_t release
Release (version)
Definition: update.h:162
text_segment_New
text_segment_t * text_segment_New(const char *psz_text)
This function will create a new text segment.
Definition: text_style.c:372
vlc_global_mutex
void vlc_global_mutex(unsigned n, bool acquire)
Internal handler for global mutexes.
Definition: threads.c:43
verify_signature
int verify_signature(signature_packet_t *sign, public_key_packet_t *p_key, uint8_t *p_hash)
Definition: update_crypto.c:588
text_segment_Copy
text_segment_t * text_segment_Copy(text_segment_t *p_src)
This function will copy a text_segment and its chain into a new one.
Definition: text_style.c:444
libvlc_int_t
Definition: vlc_objects.h:114
update_check_thread_t::thread
vlc_thread_t thread
Definition: update.h:148
vlc_sem_init
void vlc_sem_init(vlc_sem_t *sem, unsigned value)
Initializes a semaphore.
Definition: threads.c:442
vlc_dialog_display_progress
#define vlc_dialog_display_progress(a, b, c, d, e, f,...)
Definition: vlc_dialog.h:186
STYLE_OUTLINE
#define STYLE_OUTLINE
Definition: vlc_text_style.h:99
text_style_t::i_background_alpha
uint8_t i_background_alpha
The transparency of the background.
Definition: vlc_text_style.h:89
text_style_t::i_spacing
int i_spacing
The spaceing between glyphs in pixels.
Definition: vlc_text_style.h:75
unlikely
#define unlikely(p)
Predicted false condition.
Definition: vlc_common.h:227
TEXT_SIGNATURE
@ TEXT_SIGNATURE
Definition: update.h:37
text_style_Duplicate
text_style_t * text_style_Duplicate(const text_style_t *p_src)
Duplicate a text style.
Definition: text_style.c:309
vlc_common.h
STYLE_HAS_OUTLINE_COLOR
#define STYLE_HAS_OUTLINE_COLOR
Definition: vlc_text_style.h:88
text_style_t::i_outline_alpha
uint8_t i_outline_alpha
The transparency of the outline.
Definition: vlc_text_style.h:79
ISSUER_SUBPACKET
@ ISSUER_SUBPACKET
Definition: update.h:48
update_check_thread_t::pf_callback
void(* pf_callback)(void *, bool)
Definition: update.h:151
VLC_THREAD_PRIORITY_LOW
#define VLC_THREAD_PRIORITY_LOW
Definition: vlc_threads.h:207
READER_MASK
#define READER_MASK
Definition: threads.c:384
vlc_cond_waiter::next
struct vlc_cond_waiter * next
Definition: threads.c:241
vlc_atomic_timedwait_daytime
int vlc_atomic_timedwait_daytime(void *addr, unsigned val, time_t deadline)
Definition: thread.c:105
text_style_t::i_shadow_width
int i_shadow_width
The width of the shadow in pixels.
Definition: vlc_text_style.h:85
STYLE_HAS_FONT_COLOR
#define STYLE_HAS_FONT_COLOR
Definition: vlc_text_style.h:85
public_key_packet_t::q
uint8_t q[2+256/8]
Definition: update.h:62
msg_Info
#define msg_Info(p_this,...)
Definition: vlc_messages.h:100
i_value
uint32_t i_value
Definition: text_style.c:54
vlc_rwlock
Read/write lock.
Definition: vlc_threads.h:532
vlc_cancel_addr_prepare
#define vlc_cancel_addr_prepare(addr)
Definition: threads.c:93
update_download_thread_t::thread
vlc_thread_t thread
Definition: update.h:137
update_t::p_download
update_download_thread_t * p_download
Definition: update.h:164
update_NeedUpgrade
bool update_NeedUpgrade(update_t *p_update)
Definition: update.c:433
text_segment_t::p_next
text_segment_t * p_next
next segment
Definition: vlc_text_style.h:143
size_str
static char * size_str(uint64_t l_size)
Convert a long int size in bytes to a string.
Definition: update.c:474
vlc_atomic_timedwait
int vlc_atomic_timedwait(void *addr, unsigned val, vlc_tick_t deadline)
Waits on an address with a time-out.
Definition: thread.c:84
UPDATE_VLC_STATUS_URL
#define UPDATE_VLC_STATUS_URL
Definition: update.c:83
update_t::p_check
update_check_thread_t * p_check
Definition: update.h:165
text_style_t::psz_monofontname
char * psz_monofontname
The name of the mono font.
Definition: vlc_text_style.h:64
STYLE_HAS_FONT_ALPHA
#define STYLE_HAS_FONT_ALPHA
Definition: vlc_text_style.h:86
vlc_cond_wait
void vlc_cond_wait(vlc_cond_t *cond, vlc_mutex_t *mutex)
Waits on a condition variable.
Definition: threads.c:340
signature_packet_t::issuer_longid
uint8_t issuer_longid[8]
Definition: update.h:83
text_style_t::i_style_flags
uint16_t i_style_flags
Formatting style flags.
Definition: vlc_text_style.h:67
update_Delete
void update_Delete(update_t *p_update)
Delete an update_t struct.
Definition: update.c:133
public_key_packet_t::timestamp
uint8_t timestamp[4]
Definition: update.h:55
text_style_Copy
text_style_t * text_style_Copy(text_style_t *p_dst, const text_style_t *p_src)
Copy a text style into another.
Definition: text_style.c:245
GetUpdateFile
static bool GetUpdateFile(update_t *p_update)
Get the update file and parse it p_update has to be locked when calling this function.
Definition: update.c:180
vlc_dialog_id
Definition: dialog.c:102
msg_Dbg
#define msg_Dbg(p_this,...)
Definition: vlc_messages.h:106
vlc_tick_sleep
#define vlc_tick_sleep(d)
Definition: vlc_threads.h:902
vlc_stream_NewURL
#define vlc_stream_NewURL(a, b)
Definition: vlc_stream.h:422
text_segment_NewInheritStyle
text_segment_t * text_segment_NewInheritStyle(const text_style_t *p_style)
This function will create a new text segment and duplicates the style passed as argument.
Definition: text_style.c:384
_
#define _(str)
Definition: vlc_fixups.h:374
MERGE
#define MERGE(var, fflag)
Definition: text_style.c:262
update_release_t::i_minor
int i_minor
Version minor.
Definition: vlc_update.h:43
public_key_t::key
public_key_packet_t key
Definition: update.h:123
SIGNATURE_PACKET
@ SIGNATURE_PACKET
Definition: update.h:49
public_key_t::psz_username
uint8_t * psz_username
Definition: update.h:121
ARRAY_SIZE
#define ARRAY_SIZE(x)
Definition: vlc_arrays.h:178
vlc_sem_t::value
atomic_uint value
Definition: vlc_threads.h:453
vlc_cond_signal_waiter
static void vlc_cond_signal_waiter(struct vlc_cond_waiter *waiter)
Definition: threads.c:245
public_key_packet_t::p
uint8_t p[2+3072/8]
Definition: update.h:61
update.h
signature_packet_t::rsa
struct signature_packet_t::@88::@92 rsa
update_CheckReal
static void * update_CheckReal(void *)
Definition: update.c:413
VLC_STATIC_MUTEX
#define VLC_STATIC_MUTEX
Static initializer for (static) mutex.
Definition: vlc_threads.h:249
parse_public_key
int parse_public_key(const uint8_t *p_key_data, size_t i_key_len, public_key_t *p_key, const uint8_t *p_sig_issuer)
Definition: update_crypto.c:606
vlc_mutex_held
bool vlc_mutex_held(const vlc_mutex_t *mtx)
Checks if a mutex is locked.
Definition: threads.c:136
VLC_ONCE_DONE
@ VLC_ONCE_DONE
Definition: threads.c:514
asprintf
int asprintf(char **, const char *,...)
vlc_cancel_addr_clear
void vlc_cancel_addr_clear(atomic_uint *addr)
Definition: thread.c:225
update_t::p_pkey
public_key_t * p_pkey
Definition: update.h:163
vlc_cond_signal
void vlc_cond_signal(vlc_cond_t *cond)
Wakes up one thread waiting on a condition variable.
Definition: threads.c:253
signature_packet_t::dsa
struct signature_packet_t::@88::@91 dsa
vlc_mutex_t
Mutex.
Definition: vlc_threads.h:225
signature_packet_t::digest_algo
uint8_t digest_algo
Definition: update.h:80
text_segment_ruby_t::psz_rt
char * psz_rt
Definition: vlc_text_style.h:124
PERSONA_KEY_SIGNATURE
@ PERSONA_KEY_SIGNATURE
Definition: update.h:41
vlc_dialog_update_progress_text
#define vlc_dialog_update_progress_text(a, b, c, d,...)
Definition: vlc_dialog.h:228
update_Check
void update_Check(update_t *p_update, void(*pf_callback)(void *, bool), void *p_data)
Check for updates.
Definition: update.c:391
vlc_suuint
Definition: threads.c:34
signature_packet_t::s
uint8_t s[2+256/8]
Definition: update.h:107
vlc_clone
int vlc_clone(vlc_thread_t *th, void *(*entry)(void *), void *data, int priority)
Creates and starts a new thread.
Definition: thread.c:144
text_style_t::i_features
uint16_t i_features
Feature flags (means non default)
Definition: vlc_text_style.h:66
text_style_t::i_outline_width
int i_outline_width
The width of the outline in pixels.
Definition: vlc_text_style.h:80
public_key_packet_t::e
uint8_t e[2+4096/8]
Definition: update.h:68
text_segment_ChainDelete
void text_segment_ChainDelete(text_segment_t *segment)
This function will destroy a list of text segments allocated by text_segment_New.
Definition: text_style.c:432
vlc_html_color
unsigned int vlc_html_color(const char *psz_value, bool *ok)
Returns an integer representation of an HTML color.
Definition: text_style.c:473
signature_packet_t::timestamp
uint8_t timestamp[4]
Definition: update.h:97
signature_packet_t::algo_specific
union signature_packet_t::@88 algo_specific
msg_Warn
#define msg_Warn(p_this,...)
Definition: vlc_messages.h:104
signature_packet_t
Definition: update.h:74
STYLE_HAS_OUTLINE_ALPHA
#define STYLE_HAS_OUTLINE_ALPHA
Definition: vlc_text_style.h:89
vlc_assert_unreachable
#define vlc_assert_unreachable()
Impossible branch assertion.
Definition: vlc_common.h:253
STYLE_DEFAULT_REL_FONT_SIZE
#define STYLE_DEFAULT_REL_FONT_SIZE
Definition: vlc_text_style.h:111
vlc_mutex_init_recursive
void vlc_mutex_init_recursive(vlc_mutex_t *mtx)
Initializes a recursive mutex.
Definition: threads.c:128
update_release_t::i_revision
int i_revision
Version revision.
Definition: vlc_update.h:44
vlc_fopen
FILE * vlc_fopen(const char *filename, const char *mode)
Opens a FILE pointer.
Definition: filesystem.c:49
vlc_savecancel
int vlc_savecancel(void)
Disables thread cancellation.
Definition: thread.c:183
update_release_t
Describes an update VLC release number.
Definition: vlc_update.h:40
vlc_tick_now
vlc_tick_t vlc_tick_now(void)
Precision monotonic clock.
Definition: thread.c:261
STYLE_HAS_WRAP_INFO
#define STYLE_HAS_WRAP_INFO
Definition: vlc_text_style.h:94
text_style_t::i_font_color
int i_font_color
The color of the text 0xRRGGBB (native endianness)
Definition: vlc_text_style.h:72
PUBLIC_KEY_PACKET
@ PUBLIC_KEY_PACKET
Definition: update.h:50
vlc_cond_waiter::pprev
struct vlc_cond_waiter ** pprev
Definition: threads.c:241
WRITER_BIT
#define WRITER_BIT
Definition: threads.c:385
vlc_tick_t
int64_t vlc_tick_t
High precision date or time interval.
Definition: vlc_tick.h:45
text_style_t::i_background_color
int i_background_color
The color of the background 0xRRGGBB.
Definition: vlc_text_style.h:88
STYLE_FULLY_SET
#define STYLE_FULLY_SET
Definition: vlc_text_style.h:84
VLC_DIALOG_QUESTION_NORMAL
@ VLC_DIALOG_QUESTION_NORMAL
Definition: vlc_dialog.h:55
vlc_gcrypt.h
EmptyRelease
static void EmptyRelease(update_t *p_update)
Empty the release struct.
Definition: update.c:163
hash_from_public_key
uint8_t * hash_from_public_key(public_key_t *p_pkey)
Definition: update_crypto.c:846
download_key
public_key_t * download_key(vlc_object_t *p_this, const uint8_t *p_longid, const uint8_t *p_signature_issuer)
Definition: update_crypto.c:931
videolan_public_key_longid
static const uint8_t videolan_public_key_longid[8]
Definition: vlc_pgpkey.h:18
vlc_interface.h
vlc_dialog_is_cancelled
#define vlc_dialog_is_cancelled(a, b)
Definition: vlc_dialog.h:263
USER_ID_PACKET
@ USER_ID_PACKET
Definition: update.h:51
update_DownloadReal
static void * update_DownloadReal(void *)
Definition: update.c:525
vlc_strings.h
public_key_packet_t::algo
uint8_t algo
Definition: update.h:56
vlc_once
void() vlc_once(vlc_once_t *restrict once, void(*cb)(void))
Definition: threads.c:518
text_segment_ruby_Duplicate
static text_segment_ruby_t * text_segment_ruby_Duplicate(const text_segment_ruby_t *p_src)
Definition: text_style.c:359
public_key_packet_t::version
uint8_t version
Definition: update.h:54
vlc_atomic_notify_all
void vlc_atomic_notify_all(void *addr)
Wakes up all thread on an address.
Definition: thread.c:72
signature_packet_t::v3
struct signature_packet_t::@87::@90 v3
text_style_t::i_font_size
int i_font_size
The font size in pixels.
Definition: vlc_text_style.h:71
lock
vlc_mutex_t lock
Definition: rand.c:50
STYLE_HAS_SHADOW_COLOR
#define STYLE_HAS_SHADOW_COLOR
Definition: vlc_text_style.h:90
vlc_atomic_notify_one
void vlc_atomic_notify_one(void *addr)
Wakes up one thread on an address.
Definition: thread.c:67
THREAD_SELF
#define THREAD_SELF
Definition: threads.c:134
vlc_cancel_addr_set
void vlc_cancel_addr_set(atomic_uint *addr)
Definition: thread.c:213
text_segment_FromRuby
text_segment_t * text_segment_FromRuby(text_segment_ruby_t *p_ruby)
This function creates a text segment from a ruby section, and creates fallback string.
Definition: text_style.c:400
text_style_New
text_style_t * text_style_New(void)
Create a default text style.
Definition: text_style.c:208
STYLE_ALPHA_OPAQUE
#define STYLE_ALPHA_OPAQUE
Definition: vlc_text_style.h:79
vlc_thread_t
Thread handle.
Definition: vlc_threads.h:180
update_release_t::psz_desc
char * psz_desc
Release description.
Definition: vlc_update.h:47
text_segment_Delete
void text_segment_Delete(text_segment_t *segment)
Delete a text segment and its content.
Definition: text_style.c:421
public_key_packet_t::y
uint8_t y[2+3072/8]
Definition: update.h:64
stream_t
stream_t definition
Definition: vlc_stream.h:46
POSITIVE_KEY_SIGNATURE
@ POSITIVE_KEY_SIGNATURE
Definition: update.h:43
STYLE_HAS_BACKGROUND_COLOR
#define STYLE_HAS_BACKGROUND_COLOR
Definition: vlc_text_style.h:92
VLC_ONCE_CONTEND
@ VLC_ONCE_CONTEND
Definition: threads.c:514
vlc_cleanup_pop
#define vlc_cleanup_pop()
Unregisters the last cancellation handler.
Definition: vlc_threads.h:1018
text_style_Delete
void text_style_Delete(text_style_t *p_style)
Delete a text style created by text_style_New or text_style_Duplicate.
Definition: text_style.c:320
text_style_t::i_font_alpha
uint8_t i_font_alpha
The transparency of the text.
Definition: vlc_text_style.h:74
update_check_thread_t::p_data
void * p_data
Definition: update.h:152
static_assert
#define static_assert
Definition: vlc_fixups.h:370
signature_packet_t::r
uint8_t r[2+256/8]
Definition: update.h:106
vlc_tick_wait
#define vlc_tick_wait(d)
Definition: vlc_threads.h:903
text_style_t::i_shadow_alpha
uint8_t i_shadow_alpha
The transparency of the shadow.
Definition: vlc_text_style.h:84
VLC_ONCE_UNDONE
@ VLC_ONCE_UNDONE
Definition: threads.c:514
p_html_colors
static const struct @77 p_html_colors[]
update_release_t::psz_url
char * psz_url
Download URL.
Definition: vlc_update.h:46
text_style_t::i_shadow_color
int i_shadow_color
The color of the shadow 0xRRGGBB.
Definition: vlc_text_style.h:83
public_key_t::sig
signature_packet_t sig
Definition: update.h:125
text_style_t::i_outline_color
int i_outline_color
The color of the outline 0xRRGGBB.
Definition: vlc_text_style.h:78
vlc_fs.h
vlc_mutex_t::recursion
atomic_uint recursion
Definition: vlc_threads.h:231
update_t::p_libvlc
libvlc_int_t * p_libvlc
Definition: update.h:160
dialog_FatalWait
#define dialog_FatalWait(p_obj, psz_title, psz_fmt,...)
Definition: update.c:88
vlc_stream_Read
ssize_t vlc_stream_Read(stream_t *s, void *buf, size_t len)
Reads data from a byte stream.
Definition: stream.c:485
update_release_t::i_extra
int i_extra
Version extra.
Definition: vlc_update.h:45
text_style_t
Text style.
Definition: vlc_text_style.h:39
vlc_rwlock_unlock
void vlc_rwlock_unlock(vlc_rwlock_t *lock)
Releases a read/write lock.
Definition: threads.c:420
signature_packet_t::public_key_algo
uint8_t public_key_algo
Definition: update.h:79
vlc_restorecancel
void vlc_restorecancel(int state)
Restores the cancellation state.
Definition: thread.c:193
text_segment_t::style
text_style_t * style
style applied to this segment
Definition: vlc_text_style.h:142
vlc_sem_wait
void vlc_sem_wait(vlc_sem_t *sem)
Waits on a semaphore.
Definition: threads.c:463
vlc_object_t
VLC object common members.
Definition: vlc_objects.h:43
public_key_t
Definition: update.h:118
update_t
The update object.
Definition: update.h:158
vlc_cond_t::lock
vlc_mutex_t lock
Definition: vlc_threads.h:352
signature_packet_t::v4
struct signature_packet_t::@87::@89 v4
vlc_stream.h
text_segment_ruby_New
text_segment_ruby_t * text_segment_ruby_New(const char *psz_base, const char *psz_rt)
This function will create a ruby section for a text_segment.
Definition: text_style.c:341
vlc_sem_t
Semaphore.
Definition: vlc_threads.h:449
public_key_packet_t::dsa
struct public_key_packet_t::@84::@85 dsa
VLC_SUCCESS
#define VLC_SUCCESS
No error.
Definition: vlc_common.h:472
FREENULL
#define FREENULL(a)
Definition: vlc_common.h:961
strdup
char * strdup(const char *)
vlc_cond_waiter::value
atomic_uint value
Definition: threads.c:242
psz_value
char psz_value[8]
Definition: vout_intf.c:99
vlc_sem_trywait
int vlc_sem_trywait(vlc_sem_t *sem)
Tries to decrement a semaphore.
Definition: threads.c:500
vlc_update.h
vlc_custom_create
#define vlc_custom_create(o, s, n)
Definition: libvlc.h:117
text_style_t::psz_fontname
char * psz_fontname
The name of the font.
Definition: vlc_text_style.h:63
vlc_mutex_lock
void vlc_mutex_lock(vlc_mutex_t *mtx)
Acquires a mutex.
Definition: threads.c:158
text_segment_ruby_t::p_next
text_segment_ruby_t * p_next
Definition: vlc_text_style.h:125
hash_from_file
uint8_t * hash_from_file(const char *psz_file, signature_packet_t *p_sig)
Definition: update_crypto.c:826
text_segment_ruby_t::psz_base
char * psz_base
Definition: vlc_text_style.h:123
hash_from_text
uint8_t * hash_from_text(const char *psz_text, signature_packet_t *p_sig)
Definition: update_crypto.c:791
STYLE_HAS_SHADOW_ALPHA
#define STYLE_HAS_SHADOW_ALPHA
Definition: vlc_text_style.h:91
vlc_cond_t
Condition variable.
Definition: vlc_threads.h:349
public_key_packet_t::g
uint8_t g[2+3072/8]
Definition: update.h:63
update_t::lock
vlc_mutex_t lock
Definition: update.h:161
vlc_cond_wait_prepare
static void vlc_cond_wait_prepare(struct vlc_cond_waiter *waiter, vlc_cond_t *cond, vlc_mutex_t *mutex)
Definition: threads.c:299
download_signature
int download_signature(vlc_object_t *p_this, signature_packet_t *p_sig, const char *psz_url)
Definition: update_crypto.c:996
vlc_unlink
int vlc_unlink(const char *filename)
Removes a file.
Definition: filesystem.c:183
vlc_mutex_init_common
static void vlc_mutex_init_common(vlc_mutex_t *mtx, bool recursive)
Definition: threads.c:116
vlc_sem_post
int vlc_sem_post(vlc_sem_t *sem)
Increments the value of a semaphore.
Definition: threads.c:447
update_download_thread_t
Non blocking binary download.
Definition: update.h:133
CASUAL_KEY_SIGNATURE
@ CASUAL_KEY_SIGNATURE
Definition: update.h:42
update_check_thread_t
Non blocking update availability verification.
Definition: update.h:146
public_key_packet_t::n
uint8_t n[2+4096/8]
Definition: update.h:67
public_key_packet_t::rsa
struct public_key_packet_t::@84::@86 rsa
vlc_atomic_wait
void vlc_atomic_wait(void *addr, unsigned val)
Waits on an address.
Definition: thread.c:77
public_key_t::longid
uint8_t longid[8]
Definition: update.h:120
STYLE_DEFAULT_FONT_SIZE
#define STYLE_DEFAULT_FONT_SIZE
Definition: vlc_text_style.h:110
text_style_t::f_font_relsize
float f_font_relsize
The font size in video height %.
Definition: vlc_text_style.h:70
vlc_stream_Delete
void vlc_stream_Delete(stream_t *s)
Destroy a stream.
Definition: stream.c:133
vlc_once_t
One-time initialization.
Definition: vlc_threads.h:579
vlc_cond_wait_finish
static void vlc_cond_wait_finish(struct vlc_cond_waiter *waiter, vlc_cond_t *cond, vlc_mutex_t *mutex)
Definition: threads.c:319
libvlc.h
update_download_thread_t::aborted
atomic_bool aborted
Definition: update.h:138
VLC_ONCE_DOING
@ VLC_ONCE_DOING
Definition: threads.c:514
update_New
update_t * update_New(vlc_object_t *p_this)
Create a new update VLC struct.
Definition: update.c:103
signature_packet_t::unhashed_data_len
uint8_t unhashed_data_len[2]
Definition: update.h:91
text_segment_ruby_ChainDelete
void text_segment_ruby_ChainDelete(text_segment_ruby_t *p_ruby)
Deletes a ruby sections chain.
Definition: text_style.c:329
vlc_object_delete
#define vlc_object_delete(obj)
Definition: vlc_objects.h:136
vlc_rwlock_wrlock
void vlc_rwlock_wrlock(vlc_rwlock_t *lock)
Acquires a read/write lock for writing.
Definition: threads.c:410
text_segment_ruby_t
Text segment ruby for subtitles Each ruby has an anchor to the segment char.
Definition: vlc_text_style.h:121
likely
#define likely(p)
Predicted true condition.
Definition: vlc_common.h:218
update_release_t::i_major
int i_major
Version major.
Definition: vlc_update.h:42
vlc_cond_t::head
struct vlc_cond_waiter * head
Definition: vlc_threads.h:351
signature_packet_t::type
uint8_t type
Definition: update.h:78
vlc_sem_timedwait
int vlc_sem_timedwait(vlc_sem_t *sem, vlc_tick_t deadline)
Waits on a semaphore within a deadline.
Definition: threads.c:479
signature_packet_t::version
uint8_t version
Definition: update.h:76
VLC_OBJECT
#define VLC_OBJECT(x)
Type-safe vlc_object_t cast.
Definition: vlc_objects.h:70
vlc_mutex_trylock
int vlc_mutex_trylock(vlc_mutex_t *mtx)
Tries to acquire a mutex.
Definition: threads.c:178
MERGE_SIZE
#define MERGE_SIZE(var)
Definition: text_style.c:266
signature_packet_t::unhashed_data
uint8_t * unhashed_data
Definition: update.h:92
vlc_rwlock_init
void vlc_rwlock_init(vlc_rwlock_t *lock)
Initializes a read/write lock.
Definition: threads.c:387
text_segment_t::p_ruby
text_segment_ruby_t * p_ruby
ruby descriptions
Definition: vlc_text_style.h:144
vlc_text_style.h
vlc_cond_init
void vlc_cond_init(vlc_cond_t *cond)
Initializes a condition variable.
Definition: threads.c:234
vlc_dialog_release
#define vlc_dialog_release(a, b)
Definition: vlc_dialog.h:252
update_download_thread_t::psz_destdir
char * psz_destdir
Definition: update.h:140
signature_packet_t::hash_verification
uint8_t hash_verification[2]
Definition: update.h:82
vlc_cond_timedwait
int vlc_cond_timedwait(vlc_cond_t *cond, vlc_mutex_t *mutex, vlc_tick_t deadline)
Waits on a condition variable up to a certain date.
Definition: threads.c:349
text_segment_t::psz_text
char * psz_text
text string of the segment
Definition: vlc_text_style.h:141
videolan_public_key
static const uint8_t videolan_public_key[]
Definition: vlc_pgpkey.h:23
vlc_join
void vlc_join(vlc_thread_t handle, void **result)
Waits for a thread to complete (if needed), then destroys it.
Definition: thread.c:151
vlc_mutex_t::value
atomic_uint value
Definition: vlc_threads.h:230
thread_self
static _Thread_local char thread_self[1]
Definition: threads.c:133
update_download_thread_t::p_update
update_t * p_update
Definition: update.h:139
signature_packet_t::specific
union signature_packet_t::@87 specific
vlc_mutex_unlock
void vlc_mutex_unlock(vlc_mutex_t *mtx)
Releases a mutex.
Definition: threads.c:209
vlc_cond_timedwait_daytime
int vlc_cond_timedwait_daytime(vlc_cond_t *cond, vlc_mutex_t *mutex, time_t deadline)
Definition: threads.c:362
vlc_object_instance
#define vlc_object_instance(o)
Definition: vlc_objects.h:195
public_key_packet_t::sig
union public_key_packet_t::@84 sig
update_check_thread_t::p_update
update_t * p_update
Definition: update.h:150
vlc_cond_waiter
Definition: threads.c:240
public_key_packet_t
Definition: update.h:51
vlc_dialog.h
msg_Err
#define msg_Err(p_this,...)
Definition: vlc_messages.h:102
vlc_pgpkey.h
vlc_testcancel
void vlc_testcancel(void)
Issues an explicit deferred cancellation point.
Definition: thread.c:201
update_GetRelease
update_release_t * update_GetRelease(update_t *p_update)
Definition: update.c:753
vlc_cancel_addr_finish
#define vlc_cancel_addr_finish(addr)
Definition: threads.c:94
BINARY_SIGNATURE
@ BINARY_SIGNATURE
Definition: update.h:36
p
#define p(t)
vlc_suuint::value
unsigned int value
Definition: threads.c:70
text_style_t::e_wrapinfo
enum text_style_t::@265 e_wrapinfo
VLC_MAX_MUTEX
@ VLC_MAX_MUTEX
Definition: vlc_threads.h:1093