X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fupdate.h;h=f00d8be029436e84620fac9cc8baa6d50fe3e88c;hb=12ade3e3bc975d5426ba4af155b7372c31093b31;hp=59ac20a3e60d5aeb82be24c0b61ec9b9b8aaf033;hpb=ebfd94553ab7b18a436a14f42453cc3302caf471;p=vlc diff --git a/src/misc/update.h b/src/misc/update.h index 59ac20a3e6..f00d8be029 100644 --- a/src/misc/update.h +++ b/src/misc/update.h @@ -37,6 +37,8 @@ * XXX */ +#include + enum /* Public key algorithms */ { /* we will only use DSA public keys */ @@ -149,7 +151,7 @@ typedef struct { VLC_COMMON_MEMBERS update_t *p_update; - char *psz_destination; + char *psz_destdir; } update_download_thread_t; /** @@ -162,6 +164,7 @@ typedef struct void (*pf_callback)( void *, bool ); void *p_data; } update_check_thread_t; + /** * The update object. Stores (and caches) all information relative to updates */ @@ -175,3 +178,58 @@ struct update_t update_check_thread_t *p_check; }; +/* + * download a public key (the last one) from videolan server, and parse it + */ +public_key_t * +download_key( + vlc_object_t *p_this, const uint8_t *p_longid, + const uint8_t *p_signature_issuer ); + +/* + * fill a public_key_t with public key data, including: + * * public key packet + * * signature packet issued by key which long id is p_sig_issuer + * * user id packet + */ +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 ); + +/* + * Verify an OpenPGP signature made on some SHA-1 hash, with some DSA public key + */ +int +verify_signature( + uint8_t *p_r, uint8_t *p_s, public_key_packet_t *p_key, + uint8_t *p_hash ); + +/* + * Download the signature associated to a document or a binary file. + * We're given the file's url, we just append ".asc" to it and download + */ +int +download_signature( + vlc_object_t *p_this, signature_packet_t *p_sig, const char *psz_url ); + +/* + * return a sha1 hash of a text + */ +uint8_t * +hash_sha1_from_text( + const char *psz_text, signature_packet_t *p_sig ); + +/* + * return a sha1 hash of a file + */ +uint8_t * +hash_sha1_from_file( + const char *psz_file, signature_packet_t *p_sig ); + +/* + * return a sha1 hash of a public key + */ +uint8_t * +hash_sha1_from_public_key( public_key_t *p_pkey ); +