Changeset 48c2ac8c879a83c4f8737b978ca9c3232bb2e70d
- Timestamp:
- 14/12/07 18:53:27 (10 months ago)
- git-parent:
- Files:
-
- configure.ac (modified) (1 diff)
- doc/release-howto.txt (modified) (3 diffs)
- include/vlc_update.h (modified) (6 diffs)
- modules/control/rc.c (modified) (6 diffs)
- modules/gui/macosx/intf.h (modified) (1 diff)
- modules/gui/macosx/intf.m (modified) (5 diffs)
- modules/gui/macosx/update.h (modified) (2 diffs)
- modules/gui/macosx/update.m (modified) (2 diffs)
- modules/gui/qt4/dialogs/help.cpp (modified) (3 diffs)
- modules/gui/qt4/dialogs/help.hpp (modified) (3 diffs)
- modules/gui/qt4/dialogs_provider.cpp (modified) (1 diff)
- modules/gui/qt4/dialogs_provider.hpp (modified) (1 diff)
- modules/gui/qt4/menus.cpp (modified) (2 diffs)
- modules/gui/wxwidgets/dialogs.cpp (modified) (5 diffs)
- modules/gui/wxwidgets/dialogs/updatevlc.cpp (modified) (2 diffs)
- modules/gui/wxwidgets/dialogs/updatevlc.hpp (modified) (2 diffs)
- modules/gui/wxwidgets/interface.cpp (modified) (4 diffs)
- src/misc/update.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
configure.ac
r1f94c93 r48c2ac8 5590 5590 AM_CONDITIONAL([HAVE_LIBGCRYPT], [test "${have_libgcrypt}" = "yes"]) 5591 5591 5592 dnl 5593 dnl update checking system 5594 dnl 5595 AC_ARG_ENABLE(update-check, 5596 [ --enable-update-check update checking system (default disabled)]) 5597 if test "${enable_update_check}" = "yes" 5598 then 5599 if test "${have_libgcrypt}" != "yes" 5600 then 5601 AC_MSG_ERROR([libgcrypt is required for update checking system]) 5602 fi 5603 VLC_ADD_LIBS([libvlc], [-lgcrypt]) 5604 AC_DEFINE([UPDATE_CHECK], [1], [Define if you want to use the VLC update mechanism]) 5605 fi 5592 5606 5593 5607 dnl doc/release-howto.txt
raaac24c r48c2ac8 16 16 · update the milestones info on https://trac.videolan.org/vlc 17 17 - Add a note about the matching contrib package in INSTALL.win32 18 - Make sure that the gpg key embedded in include/vlc_update.h is the last one 18 19 19 20 * Commit … … 33 34 * BeOS Packages 34 35 Information on building: http://developers.videolan.org/vlc/beos-compile.html 36 Configure with --enable-update-check 35 37 Build in the "buildbeos" chroot on altair. 36 38 # add the .zip files to /opt/ftp/pub/videolan/testing/vlc-X.X.X/beos/ 39 generate md5 hashes and gpg signature of these files 37 40 38 41 * Win32 Packages 39 make the packages using the nightly builds configure/options/... 42 make the packages using the nightly builds configure/options/... , don't forget --enable-update-check 40 43 don't forget to test the installer and uninstaller (the first 0.8.4 uninstaller was broken ... 41 44 kind of suxxs) … … 44 47 45 48 * OS X packages 46 At the moment, only FK can do them (so they can be compatible with OS X 10.2) 47 Later: on the G5 49 configure with --enable-update-check 48 50 generate md5 hashes and gpg signature of these files 49 51 include/vlc_update.h
r09b9702 r48c2ac8 2 2 * vlc_update.h: VLC update and plugins download 3 3 ***************************************************************************** 4 * Copyright (C) 2005the VideoLAN team4 * Copyright © 2005-2007 the VideoLAN team 5 5 * $Id$ 6 6 * 7 7 * Authors: Antoine Cellerier <dionoea -at- videolan -dot- org> 8 * Rafaël Carré <funman@videolanorg> 8 9 * 9 10 * This program is free software; you can redistribute it and/or modify … … 26 27 #endif 27 28 29 #ifdef UPDATE_CHECK 30 28 31 #ifndef _VLC_UPDATE_H 29 32 #define _VLC_UPDATE_H … … 31 34 #include <vlc/vlc.h> 32 35 36 #include <vlc_stream.h> /* key & signature downloading */ 37 #include <vlc_strings.h> /* b64 decoding */ 38 #include <vlc_charset.h> /* utf8_fopen() */ 39 #include <gcrypt.h> /* cryptography and digest algorithms */ 40 33 41 /** 34 42 * \defgroup update Update … … 36 44 * @{ 37 45 */ 46 47 enum /* Public key algorithms */ 48 { 49 /* we will only use DSA public keys */ 50 PUBLIC_KEY_ALGO_DSA = 0x11 51 }; 52 53 enum /* Digest algorithms */ 54 { 55 /* and DSA use SHA-1 digest */ 56 DIGEST_ALGO_SHA1 = 0x02 57 }; 58 59 enum /* Packet types */ 60 { 61 SIGNATURE_PACKET = 0x02, 62 PUBLIC_KEY_PACKET = 0x06, 63 USER_ID_PACKET = 0x0d 64 }; 65 66 enum /* Signature types */ 67 { 68 BINARY_SIGNATURE = 0x00, 69 TEXT_SIGNATURE = 0x01, 70 71 /* Public keys signatures */ 72 GENERIC_KEY_SIGNATURE = 0x10, /* No assumption of verification */ 73 PERSONA_KEY_SIGNATURE = 0x11, /* No verification has been made */ 74 CASUAL_KEY_SIGNATURE = 0x12, /* Some casual verification */ 75 POSITIVE_KEY_SIGNATURE = 0x13 /* Substantial verification */ 76 }; 77 78 79 enum /* Signature subpacket types */ 80 { 81 ISSUER_SUBPACKET = 0x10 82 }; 83 84 85 86 struct public_key_packet_t 87 { /* a public key packet (DSA/SHA-1) is 418 bytes */ 88 89 uint8_t version; /* we use only version 4 */ 90 uint8_t timestamp[4]; /* creation time of the key */ 91 uint8_t algo; /* we only use DSA */ 92 /* the multi precision integers, with their 2 bytes length header */ 93 uint8_t p[2+128]; 94 uint8_t q[2+20]; 95 uint8_t g[2+128]; 96 uint8_t y[2+128]; 97 }; 98 99 /* used for public key signatures */ 100 struct signature_packet_v4_t 101 { /* hashed_data or unhashed_data can be empty, so the signature packet is 102 * theorically at least 54 bytes long, but always more than that. */ 103 104 uint8_t version; 105 uint8_t type; 106 uint8_t public_key_algo; 107 uint8_t digest_algo; 108 uint8_t hashed_data_len[2]; 109 uint8_t *hashed_data; 110 uint8_t unhashed_data_len[2]; 111 uint8_t *unhashed_data; 112 uint8_t hash_verification[2]; 113 114 /* The part below is made of consecutive MPIs, their number and size being 115 * public-key-algorithm dependant. 116 * But since we use DSA signatures only, we fix it. */ 117 uint8_t r[2+20]; 118 uint8_t s[2+20]; 119 }; 120 121 /* Used for binary document signatures (to be compatible with older software) 122 * DSA/SHA-1 is always 65 bytes */ 123 struct signature_packet_v3_t 124 { 125 uint8_t header[2]; 126 uint8_t version; /* 3 */ 127 uint8_t hashed_data_len; /* MUST be 5 */ 128 uint8_t type; 129 uint8_t timestamp[4]; /* 4 bytes scalar number */ 130 uint8_t issuer_longid[8]; /* The key which signed the document */ 131 uint8_t public_key_algo; /* we only know about DSA */ 132 uint8_t digest_algo; /* and his little sister SHA-1 */ 133 uint8_t hash_verification[2];/* the 2 1st bytes of the SHA-1 hash */ 134 135 /* The part below is made of consecutive MPIs, their number and size being 136 * public-key-algorithm dependant. 137 * But since we use DSA signatures only, we fix it. */ 138 uint8_t r[2+20]; 139 uint8_t s[2+20]; 140 }; 141 142 typedef struct public_key_packet_t public_key_packet_t; 143 typedef struct signature_packet_v4_t signature_packet_v4_t; 144 typedef struct signature_packet_v3_t signature_packet_v3_t; 145 146 struct public_key_t 147 { 148 uint8_t longid[8]; /* Long id */ 149 uint8_t *psz_username; /* USER ID */ 150 151 public_key_packet_t key; /* Public key packet */ 152 153 signature_packet_v4_t sig; /* Signature packet, by the embedded key */ 154 }; 155 156 typedef struct public_key_t public_key_t; 157 158 /* We trust this public key, and by extension, also keys signed by it. */ 159 160 //#define OLD 1 //Define OLD to use Videolan Key 2006, to test public key download 161 162 static uint8_t videolan_public_key_longid[8] = { 163 #ifdef OLD 164 0xC3, 0x67, 0xD8, 0xB9, 0x81, 0xCA, 0xCA, 0x84 165 #else 166 0x90, 0x28, 0x17, 0xE4, 0xAA, 0x5F, 0x4D, 0xE6 167 #endif 168 }; 169 170 static uint8_t videolan_public_key[] = { 171 #ifdef OLD 172 "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" 173 "Version: GnuPG v2.0.4 (FreeBSD)\n" 174 "\n" 175 "mQGiBEPBV9IRBADqm3i6AnMyZ2/iowBPZJrP3bwhcqx9EhJR5/N8Pz+QjhvLsY5P\n" 176 "efH1381RlEk33dl0vEvKULFstqT2GO+vtdoE+35tf1YlYFvxy23qn3Gsn2IMM6pl\n" 177 "e0AatBnxzD1Vtlh7+Xhm0PvGJilZeg/MamEK2A8hgwhj3aGxVfzdtkQ1HwC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/iAAAKCRDDZ9i5gcrK\n" 208 "hCMLAKDB2xwcJT9OFM6G/seEnVMWGBfzrACg8UyCfxX2mNWNPTE4MQ/xiaQ6VBM=\n" 209 "=tVe2\n" 210 "-----END PGP PUBLIC KEY BLOCK-----\n" 211 #else 212 "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" 213 "Version: GnuPG v2.0.4 (FreeBSD)\n" 214 "\n" 215 "mQGiBEWbjf8RBAC+4m2yYYzuA0+D5JQatKmoxG4z3+bat08tMz0YvBUp1UU+95i4\n" 216 "cP9ndklv3yzhtZ4MIx5yy64FXtPi0/NQiikEVYPYn2KMO4LCfZCwYBEizVWzABya\n" 217 "LZcffCP/3VhoR90NUluWyi+zVAn9KNIRlnhnYpDDlI76fCrTTHDCtgpImwCg7VzB\n" 218 "4L6O0JpUJBCZOCAPJNYirUkD/3uCZe4vK4kLW+W3HB+grMCI1uFULmVSKMBQZc+p\n" 219 "dqDq++u3zYGqiMNaVrLg/J4GSH/P0ossXEtmTVjLHF4nJ7HXfIjqkqdkxq7g9odY\n" 220 "/dkA/aC7z4JBgcYfRnDMqfL12C+3b+KSwxQSzPcbvsFYm2KTgteLwG3mRlpL7Dh5\n" 221 "S70nBAC1PkIl7mP4OL7vpQk9dkdQCARJLgyn5pu/pZV7He4fDLHkUr/atnYaIHk1\n" 222 "15xl/ziHcBql2WmF0Uff9SuuNOi/hFCuWZSwPKsgtIhYZ5ut4FrBAVkqHV2CgxFp\n" 223 "aSiA7+FTG91++LDsg2xrHyTRW+fQnPdpf5a4H1fF15azo40h17QjVmlkZW9MQU4g\n" 224 "UmVsZWFzZSBTaWduaW5nIEtleSAoMjAwNymIRgQQEQIABgUCRZ41PgAKCRDDZ9i5\n" 225 "gcrKhPmUAJ49Krgt6ZPZZ2YkW7fWFwTvSgGongCePDjnFh1g4078f7lycT4wFk/c\n" 226 "vPiIRgQQEQIABgUCRZ71NQAKCRD9Ibw7rD4IebztAKCxuyWCjF2JPAe1hdZqNNbE\n" 227 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hDu\n" 242 "rFWRmMNOONWpIIhPBBgRAgAPBQJFm44DAhsMBQkB4TOAAAoJEJAoF+SqX03m57kA\n" 243 "oMPb2o2D9gSwQFKXhamx2YdrykHOAKDqQ1tHH3ULY5cLLAKVaQtsNhVEtQ==\n" 244 "=qrc1\n" 245 "-----END PGP PUBLIC KEY BLOCK-----\n" 246 #endif 247 }; 38 248 39 249 enum … … 68 278 }; 69 279 70 71 280 #define update_New( a ) __update_New( VLC_OBJECT( a ) ) 72 281 … … 81 290 82 291 #endif 292 293 #endif modules/control/rc.c
r09b9702 r48c2ac8 97 97 static int Menu ( vlc_object_t *, char const *, 98 98 vlc_value_t, vlc_value_t, void * ); 99 #ifdef UPDATE_CHECK 99 100 static void checkUpdates( intf_thread_t *p_intf ); 101 #endif 100 102 101 103 /* Status Callbacks */ … … 751 753 Help( p_intf, b_longhelp ); 752 754 } 755 #ifdef UPDATE_CHECK 753 756 else if( !strcmp( psz_cmd, "check-updates" ) ) 754 757 { 755 758 checkUpdates( p_intf ); 756 759 } 760 #endif 757 761 else if( !strcmp( psz_cmd, "key" ) || !strcmp( psz_cmd, "hotkey" ) ) 758 762 { … … 923 927 msg_rc(_("| @name mosaic-order id(,id)* . . . . order of pictures ")); 924 928 msg_rc(_("| @name mosaic-keep-aspect-ratio {0,1} . . .aspect ratio")); 929 #ifdef UPDATE_CHECK 925 930 msg_rc( "| "); 926 931 msg_rc(_("| check-updates [newer] [equal] [older]\n" 927 932 "| [undef] [info] [source] [binary] [plugin]")); 933 #endif 928 934 msg_rc( "| "); 929 935 } … … 1635 1641 input_thread_t *p_input = NULL; 1636 1642 vout_thread_t * p_vout; 1637 const char * psz_variable ;1643 const char * psz_variable = NULL; 1638 1644 int i_error; 1639 1645 … … 2106 2112 * checkUpdates : check for updates 2107 2113 ****************************************************************************/ 2114 #ifdef UPDATE_CHECK 2108 2115 static void checkUpdates( intf_thread_t *p_intf ) 2109 2116 { … … 2123 2130 update_Delete( p_u ); 2124 2131 } 2132 #endif modules/gui/macosx/intf.h
r0a7f703 r48c2ac8 102 102 id o_interaction_list; /* VLCInteractionList*/ 103 103 id o_sfilters; /* VLCsFilters */ 104 #ifdef UPDATE_CHECK 104 105 id o_update; /* VLCUpdate */ 106 #endif 105 107 id o_eyetv; /* VLCEyeTVController */ 106 108 BOOL nib_main_loaded; /* main nibfile */ modules/gui/macosx/intf.m
r0a7f703 r48c2ac8 394 394 o_interaction_list = [[VLCInteractionList alloc] init]; 395 395 o_sfilters = nil; 396 #ifdef UPDATE_CHECK 396 397 //FIXME o_update = [[VLCUpdate alloc] init]; 398 #endif 397 399 398 400 i_lastShownVolume = -1; … … 786 788 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 787 789 { 790 #ifdef UPDATE_CHECK 788 791 /* Check for update silently on startup */ 789 792 if ( !nib_update_loaded ) … … 793 796 //if([o_update shouldCheckForUpdate]) 794 797 // [NSThread detachNewThreadSelector:@selector(checkForUpdate) toTarget:o_update withObject:NULL]; 795 798 #endif 799 796 800 /* Handle sleep notification */ 797 801 [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(computerWillSleep:) … … 1910 1914 } 1911 1915 1916 #ifdef UPDATE_CHECK 1912 1917 - (IBAction)checkForUpdate:(id)sender 1913 1918 {/* FIXME … … 1917 1922 [o_update showUpdateWindow]; 1918 1923 */} 1924 #endif 1919 1925 1920 1926 - (IBAction)viewHelp:(id)sender modules/gui/macosx/update.h
r2010d13 r48c2ac8 22 22 *****************************************************************************/ 23 23 24 #ifdef UPDATE_CHECK 24 25 #import <Cocoa/Cocoa.h> 25 26 #import <vlc_update.h> … … 56 57 57 58 @end 59 #endif modules/gui/macosx/update.m
rf25e0c7 r48c2ac8 28 28 *****************************************************************************/ 29 29 30 #ifdef UPDATE_CHECK 30 31 31 32 /***************************************************************************** … … 352 353 353 354 @end 355 356 #endif modules/gui/qt4/dialogs/help.cpp
r09b9702 r48c2ac8 23 23 *****************************************************************************/ 24 24 25 #include <vlc/vlc.h> 26 25 27 #include "dialogs/help.hpp" 26 28 #include <vlc_about.h> 29 30 #ifdef UPDATE_CHECK 27 31 #include <vlc_update.h> 32 #endif 28 33 29 34 #include "dialogs_provider.hpp" … … 160 165 } 161 166 162 167 #ifdef UPDATE_CHECK 163 168 UpdateDialog *UpdateDialog::instance = NULL; 164 169 … … 218 223 } 219 224 } 225 226 #endif modules/gui/qt4/dialogs/help.hpp
r09b9702 r48c2ac8 25 25 #define _HELP_DIALOG_H_ 26 26 27 #include <vlc _update.h>27 #include <vlc/vlc.h> 28 28 29 29 #include "util/qvlcframe.hpp" … … 71 71 }; 72 72 73 73 #ifdef UPDATE_CHECK 74 74 class UpdateDialog : public QVLCFrame 75 75 { … … 93 93 void updateOrUpload(); 94 94 }; 95 95 #endif 96 96 97 97 #endif modules/gui/qt4/dialogs_provider.cpp
r099d977 r48c2ac8 173 173 } 174 174 175 #ifdef UPDATE_CHECK 175 176 void DialogsProvider::updateDialog() 176 177 { 177 178 UpdateDialog::getInstance( p_intf )->toggleVisible(); 178 179 } 180 #endif 179 181 180 182 void DialogsProvider::aboutDialog() modules/gui/qt4/dialogs_provider.hpp
r9473050 r48c2ac8 147 147 void vlmDialog(); 148 148 void helpDialog(); 149 #ifdef UPDATE_CHECK 149 150 void updateDialog(); 151 #endif 150 152 void aboutDialog(); 151 153 void gotoTimeDialog(); modules/gui/qt4/menus.cpp
r099d977 r48c2ac8 23 23 *****************************************************************************/ 24 24 25 #include <vlc/vlc.h> 26 25 27 #include <vlc_intf_strings.h> 26 28 … … 458 460 addDPStaticEntry( menu, qtr( "Help..." ) , "", 459 461 ":/pixmaps/menus_help_16px.png", SLOT( helpDialog() ), "F1" ); 462 #ifdef UPDATE_CHECK 460 463 addDPStaticEntry( menu, qtr( "Update" ) , "", "", SLOT( updateDialog() ), ""); 464 #endif 461 465 menu->addSeparator(); 462 466 addDPStaticEntry( menu, qtr( I_MENU_ABOUT ), "", "", SLOT( aboutDialog() ), modules/gui/wxwidgets/dialogs.cpp
r6ee1e19 r48c2ac8 64 64 65 65 /* Event handlers (these functions should _not_ be virtual) */ 66 #ifdef UPDATE_CHECK 66 67 void OnUpdateVLC( wxCommandEvent& event ); 68 #endif 67 69 //void OnVLM( wxCommandEvent& event ); 68 70 void OnInteraction( wxCommandEvent& event ); … … 109 111 wxFrame *p_bookmarks_dialog; 110 112 wxFileDialog *p_file_generic_dialog; 113 #ifdef UPDATE_CHECK 111 114 UpdateVLC *p_updatevlc_dialog; 115 #endif 112 116 //VLMFrame *p_vlm_dialog; 113 117 }; … … 157 161 EVT_COMMAND(INTF_DIALOG_EXIT, wxEVT_DIALOG, 158 162 DialogsProvider::OnExitThread) 163 #ifdef UPDATE_CHECK 159 164 EVT_COMMAND(INTF_DIALOG_UPDATEVLC, wxEVT_DIALOG, 160 165 DialogsProvider::OnUpdateVLC) 166 #endif 161 167 #if 0 162 168 EVT_COMMAND(INTF_DIALOG_VLM, wxEVT_DIALOG, … … 550 556 } 551 557 558 #ifdef UPDATE_CHECK 552 559 void DialogsProvider::OnUpdateVLC( wxCommandEvent& WXUNUSED(event) ) 553 560 { … … 561 568 } 562 569 } 570 #endif 563 571 564 572 #if 0 modules/gui/wxwidgets/dialogs/updatevlc.cpp
r36cb61a r48c2ac8 21 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 22 *****************************************************************************/ 23 24 #ifdef UPDATE_CHECK 23 25 24 26 /***************************************************************************** … … 121 123 Layout(); 122 124 } 125 #endif modules/gui/wxwidgets/dialogs/updatevlc.hpp
r36cb61a r48c2ac8 21 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 22 22 *****************************************************************************/ 23 24 #ifdef UPDATE_CHECK 23 25 24 26 #ifndef _WXVLC_UPDATEVLC_H_ … … 55 57 56 58 #endif 59 60 #endif modules/gui/wxwidgets/interface.cpp
r1dc3807 r48c2ac8 301 301 OnWebLink_Event, 302 302 OnWebHelp_Event, 303 #ifdef UPDATE_CHECK 303 304 UpdateVLC_Event, 305 #endif 304 306 //VLM_Event, 305 307 … … 315 317 EVT_MENU(OnWebLink_Event, Interface::OnWebLink) 316 318 EVT_MENU(OnWebHelp_Event, Interface::OnWebHelp) 319 #ifdef UPDATE_CHECK 317 320 EVT_MENU(UpdateVLC_Event, Interface::OnShowDialog) 321 #endif 318 322 //EVT_MENU(VLM_Event, Interface::OnShowDialog) 319 323 … … 618 622 help_menu->AppendSeparator(); 619 623 help_menu->Append( About_Event, wxU(_("About...")) ); 624 #ifdef UPDATE_CHECK 620 625 help_menu->AppendSeparator(); 621 626 help_menu->Append( UpdateVLC_Event, wxU(_("Check for Updates...")) ); 627 #endif 622 628 623 629 /* Append the freshly created menus to the menu bar... */ … … 1025 1031 i_id = INTF_DIALOG_BOOKMARKS; 1026 1032 break; 1033 #ifdef UPDATE_CHECK 1027 1034 case UpdateVLC_Event: 1028 1035 i_id = INTF_DIALOG_UPDATEVLC; 1029 1036 break; 1037 #endif 1030 1038 #if 0 1031 1039 case VLM_Event: src/misc/update.c
r7bca27a r48c2ac8 27 27 */ 28 28 29 /* 30 * TODO: * pgp verification of the update file 31 * binary download, and pgp verification 32 */ 33 29 34 /***************************************************************************** 30 35 * Preamble … … 32 37 33 38 #include <vlc/vlc.h> 39 40 #ifdef UPDATE_CHECK 34 41 35 42 #include <ctype.h> /* tolower() */ … … 77 84 const struct update_release_t *p2 ); 78 85 86 /***************************************************************************** 87 * OpenPGP functions 88 *****************************************************************************/ 89 90 #define packet_type( c ) ( ( c & 0x3c ) >> 2 ) /* 0x3C = 00111100 */ 91 #define packet_header_len( c ) ( ( c & 0x03 ) + 1 ) /* number of bytes in a packet header */ 92 93 static inline int scalar_number( uint8_t *p, int header_len ) 94 { 95 if( header_len == 1 ) 96 return( p[0] ); 97 else if( header_len == 2 ) 98 return( (p[0] << 8) + p[1] ); 99 else if( header_len == 4 ) 100 return( (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3] ); 101 else 102 abort(); 103 } 104 105 /* number of data bytes in a MPI */ 106 #define mpi_len( mpi ) ( ( scalar_number( mpi, 2 ) + 7 ) / 8 ) 107 108 /* 109 * fill a public_key_packet_t structure from public key packet data 110 * verify that it is a version 4 public key packet, using DSA 111 */ 112 static int parse_public_key_packet( public_key_packet_t *p_key, uint8_t *p_buf, 113 size_t i_packet_len ) 114 { 115 if( i_packet_len != 418 ) 116 return VLC_EGENERIC; 117 118 p_key->version = *p_buf++; 119 if( p_key->version != 4 ) 120 return VLC_EGENERIC; 121 122 /* warn when timestamp is > date ? */ 123 memcpy( p_key->timestamp, p_buf, 4 ); p_buf += 4; 124 125 p_key->algo = *p_buf++; 126 if( p_key->algo != PUBLIC_KEY_ALGO_DSA ) 127 return VLC_EGENERIC; 128 129 memcpy( p_key->p, p_buf, 2+128 ); p_buf += 2+128; 130 if( mpi_len( p_key->p ) != 128 ) 131 return VLC_EGENERIC; 132 133 memcpy( p_key->q, p_buf, 2+20 ); p_buf += 2+20; 134 if( mpi_len( p_key->q ) != 20 ) 135 return VLC_EGENERIC; 136 137 memcpy( p_key->g, p_buf, 2+128 ); p_buf += 2+128; 138 if( mpi_len( p_key->g ) != 128 ) 139 return VLC_EGENERIC; 140 141 memcpy( p_key->y, p_buf, 2+128 ); p_buf += 2+128; 142 if( mpi_len( p_key->y ) != 128 ) 143 return VLC_EGENERIC; 144 145 return VLC_SUCCESS; 146 } 147 148 /* 149 * fill a signature_packet_v4_t from signature packet data 150 * verify that it was used with a DSA public key, using SHA-1 digest 151 */ 152 static int parse_signature_v4_packet( signature_packet_v4_t *p_sig, 153 uint8_t *p_buf, size_t i_sig_len ) 154 { 155 if( i_sig_len < 54 ) 156 return VLC_EGENERIC; 157 158 p_sig->version = *p_buf++; 159 if( p_sig->version != 4 ) 160 return VLC_EGENERIC; 161 162 p_sig->type = *p_buf++; 163 if( p_sig->type < GENERIC_KEY_SIGNATURE || 164 p_sig->type > POSITIVE_KEY_SIGNATURE ) 165 return VLC_EGENERIC; 166 167 p_sig->public_key_algo = *p_buf++; 168 if( p_sig->public_key_algo != PUBLIC_KEY_ALGO_DSA ) 169 return VLC_EGENERIC; 170 171 p_sig->digest_algo = *p_buf++; 172 if( p_sig->digest_algo != DIGEST_ALGO_SHA1 ) 173 return VLC_EGENERIC; 174 175 memcpy( p_sig->hashed_data_len, p_buf, 2 ); p_buf += 2; 176 177 size_t i_pos = 6; 178 size_t i_hashed_data_len = scalar_number( p_sig->hashed_data_len, 2 ); 179 i_pos += i_hashed_data_len; 180 if( i_pos > i_sig_len - 48 ) /* r & s are 44 bytes in total, 181 * + the unhashed data length (2 bytes) 182 * + the hash verification (2 bytes) */ 183 return VLC_EGENERIC; 184 185 p_sig->hashed_data = (uint8_t*) malloc( i_hashed_data_len ); 186 if( !p_sig->hashed_data ) 187 return VLC_ENOMEM; 188 memcpy( p_sig->hashed_data, p_buf, i_hashed_data_len ); 189 p_buf += i_hashed_data_len; 190 191 memcpy( p_sig->unhashed_data_len, p_buf, 2 ); p_buf += 2; 192 193 size_t i_unhashed_data_len = scalar_number( p_sig->unhashed_data_len, 2 ); 194 i_pos += 2 + i_unhashed_data_len; 195 if( i_pos != i_sig_len - 46 ) 196 { 197 free( p_sig->hashed_data ); 198 return VLC_EGENERIC; 199 } 200 201 p_sig->unhashed_data = (uint8_t*) malloc( i_unhashed_data_len ); 202 if( !p_sig->unhashed_data ) 203 { 204 free( p_sig->hashed_data ); 205 return VLC_ENOMEM; 206 } 207 memcpy( p_sig->unhashed_data, p_buf, i_unhashed_data_len ); 208 p_buf += i_unhashed_data_len; 209 210 memcpy( p_sig->hash_verification, p_buf, 2 ); p_buf += 2; 211 212 memcpy( p_sig->r, p_buf, 22 ); p_buf += 22; 213 if( mpi_len( p_sig->r ) != 20 ) 214 { 215 free( p_sig->hashed_data ); 216 free( p_sig->unhashed_data ); 217 return VLC_EGENERIC; 218 } 219 220 memcpy( p_sig->s, p_buf, 22 ); 221 if( mpi_len( p_sig->s ) != 20 ) 222 { 223 free( p_sig->hashed_data ); 224 free( p_sig->unhashed_data ); 225 return VLC_EGENERIC; 226 } 227 228 return VLC_SUCCESS; 229 } 230 231 /* 232 * crc_octets() was lamely copied from rfc 2440 233 * Copyright (C) The Internet Society (1998). All Rights Reserved. 234 */ 235 #define CRC24_INIT 0xB704CEL 236 #define CRC24_POLY 0x1864CFBL 237 238 static long crc_octets( uint8_t *octets, size_t len ) 239 { 240 long crc = CRC24_INIT; 241 int i; 242 while (len--) 243 { 244 crc ^= (*octets++) << 16; 245 for (i = 0; i < 8; i++) 246 { 247 crc <<= 1; 248 if (crc & 0x1000000) 249 crc ^= CRC24_POLY; 250 } 251 } 252 return crc & 0xFFFFFFL; 253 } 254 255 /* 256 * Transform an armored document in binary format 257 * Used on public keys and signatures 258 */ 259 static int pgp_unarmor( char *p_ibuf, size_t i_ibuf_len, 260 uint8_t *p_obuf, size_t i_obuf_len ) 261 { 262 char *p_ipos = p_ibuf; 263 uint8_t *p_opos = p_obuf; 264 int i_end = 0; 265 266 int i_header_skipped = 0; 267 268 while( !i_end && p_ipos < p_ibuf + i_ibuf_len ) 269 { 270 if( *p_ipos == '\r' || *p_ipos == '\n' ) 271 { 272 p_ipos++; 273 continue; 274 } 275 276 size_t i_line_len = strcspn( p_ipos, "\r\n" ); 277 if( i_line_len == 0 ) 278 continue; 279 280 if( !i_header_skipped ) 281 { 282 if( !strncmp( p_ipos, "-----BEGIN PGP", 14 ) ) 283 i_header_skipped = 1; 284 285 p_ipos += i_line_len + 1; 286 continue; 287 } 288 289 if( !strncmp( p_ipos, "Version:", 8 ) ) 290 { 291 p_ipos += i_line_len + 1; 292 continue; 293 } 294 295 if( p_ipos[i_line_len - 1] == '=' ) 296 { 297 i_end = 1; 298 p_ipos[i_line_len - 1] = '\0'; 299 } 300 else 301 p_ipos[i_line_len] = '\0'; 302 303 p_opos += vlc_b64_decode_binary_to_buffer( p_opos, 304 p_obuf - p_opos + i_obuf_len, 305 p_ipos ); 306 307 p_ipos += i_line_len + 1; 308 } 309 310 /* XXX: the CRC is OPTIONAL, really require it ? */ 311 if( p_ipos + 5 > p_ibuf + i_ibuf_len || *p_ipos++ != '=' ) 312 return 0; 313 314 uint8_t p_crc[3]; 315 if( vlc_b64_decode_binary_to_buffer( p_crc, 3, p_ipos ) != 3 ) 316 return 0; 317 318 long l_crc = crc_octets( p_obuf, p_opos - p_obuf ); 319 long l_crc2 = ( 0 << 24 ) + ( p_crc[0] << 16 ) + ( p_crc[1] << 8 ) + p_crc[2]; 320 321 return l_crc2 == l_crc ? p_opos - p_obuf : 0; 322 } 323 324 /* 325 * Download the signature associated to a document or a binary file. 326 * We're given the file's url, we just append ".asc" to it and download 327 */ 328 static int download_signature( vlc_object_t *p_this, 329 signature_packet_v3_t *p_sig, char *psz_url ) 330 { 331 char *psz_sig = (char*) malloc( strlen( psz_url ) + 4 + 1 ); /* ".asc" + \0 */ 332 if( !psz_sig ) 333 return VLC_ENOMEM; 334 335 strcpy( psz_sig, psz_url ); 336 strcat( psz_sig, ".asc" ); 337 338 stream_t *p_stream = stream_UrlNew( p_this, psz_sig ); 339 free( psz_sig ); 340 341 if( !p_stream ) 342 return VLC_ENOMEM; 343 344 int64_t i_size = stream_Size( p_stream ); 345 if( i_size < 65 ) 346 { 347 stream_Delete( p_stream ); 348 return VLC_EGENERIC; 349 } 350 else if( i_size == 65 ) /* binary format signature */ 351 { 352 int i_read = stream_Read( p_stream, p_sig, (int)i_size ); 353 stream_Delete( p_stream ); 354 if( i_read != i_size ) 355 return VLC_EGENERIC; 356 else 357 return VLC_SUCCESS;
