Changeset 75d3925cbbf774e92fdc382dbf2fffe0e3a7d672

Show
Ignore:
Timestamp:
02/24/08 22:23:54 (7 months ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1203888234 +0000
git-parent:

[09db1d4ce808b0c378547804b4ad05a1402554f8]

git-author:
Rafaël Carré <funman@videolan.org> 1203888234 +0000
Message:

don't duplicate sha1 hashes with strdup() (not \0 terminated)
update the release documentation, only supported signatures are v3 signatures (gpg 2.x generates v3 sigs by default, but not gpg 1.x)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/release-howto.txt

    r48c2ac8 r75d3925  
    2626    /opt/ftp/pub/videolan/testing/vlc-X.X.X/ 
    2727  - generate md5 hashes and gpg signature of these files 
     28    (use gpg --sign --detach --armor --force-v3-sigs) 
    2829 
    2930 * Contribs 
     
    3839    # add the .zip files to /opt/ftp/pub/videolan/testing/vlc-X.X.X/beos/ 
    3940   generate md5 hashes and gpg signature of these files 
     41   (use gpg --sign --detach --armor --force-v3-sigs) 
    4042 
    4143 * Win32 Packages 
     
    4547    add the .zip and .exe files to /opt/ftp/pub/videolan/testing/vlc-X.X.X/win32/ 
    4648   generate md5 hashes and gpg signature of these files 
     49   (use gpg --sign --detach --armor --force-v3-sigs) 
    4750 
    4851 * OS X packages 
    4952   configure with --enable-update-check 
    5053   generate md5 hashes and gpg signature of these files 
     54   (use gpg --sign --detach --armor --force-v3-sigs) 
    5155 
    5256 * Commit changes ... it never works the first time 
  • src/misc/update.c

    r77e3dff r75d3925  
    2323 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. 
    2424 *****************************************************************************/ 
    25  
     25/* 
     26 * XXX: should use v4 signatures for binary files (already used for public key) 
     27 */ 
    2628/** 
    2729 *   \file 
     
    415417    free( p_buf ); 
    416418 
    417     if( i_bytes > 65 ) 
     419    if( i_bytes == 0 ) 
     420    { 
     421        msg_Dbg( p_this, "Unarmoring failed" ); 
     422        return VLC_EGENERIC; 
     423    } 
     424    else if( i_bytes > 65 ) 
    418425    { 
    419426        msg_Dbg( p_this, "Signature is too big: %d bytes", i_bytes ); 
     
    425432        if( i_r_len > 20 ) 
    426433        { 
    427             msg_Dbg( p_this, "Signature invalid" ); 
     434            msg_Dbg( p_this, "Invalid signature, r number too big: %d bytes", 
     435                                i_r_len ); 
    428436            return VLC_EGENERIC; 
    429437        } 
     
    668676    gcry_md_final( hd ); 
    669677 
    670     uint8_t *p_hash = (uint8_t*) gcry_md_read( hd, GCRY_MD_SHA1); 
    671     p_hash = strdup( p_hash ); 
     678    uint8_t *p_tmp = (uint8_t*) gcry_md_read( hd, GCRY_MD_SHA1); 
     679    uint8_t *p_hash = malloc( 20 ); 
     680    if( p_hash ) 
     681        memcpy( p_hash, p_tmp, 20 ); 
    672682    gcry_md_close( hd ); 
    673683    return p_hash; 
     
    802812    gcry_md_final( hd ); 
    803813 
    804     uint8_t *p_hash = gcry_md_read( hd, GCRY_MD_SHA1); 
    805  
    806     if( p_hash[0] != p_pkey->sig.hash_verification[0] || 
    807         p_hash[1] != p_pkey->sig.hash_verification[1] ) 
     814    uint8_t *p_tmp = gcry_md_read( hd, GCRY_MD_SHA1); 
     815 
     816    if( !p_tmp || 
     817        p_tmp[0] != p_pkey->sig.hash_verification[0] || 
     818        p_tmp[1] != p_pkey->sig.hash_verification[1] ) 
    808819    { 
    809820        gcry_md_close( hd ); 
     
    811822    } 
    812823 
    813     p_hash = strdup( p_hash ); 
     824    uint8_t *p_hash = malloc( 20 ); 
     825    if( p_hash ) 
     826        memcpy( p_hash, p_tmp, 20 ); 
    814827    gcry_md_close( hd ); 
    815828    return p_hash;