Skip to content
  • Andrew Clayton's avatar
    src/md5: Replace the MD5 implementation with the FSF LGPL one · 3dbbdfb5
    Andrew Clayton authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
    With GCC 4.8.3 on x86_64 Fedora 20 we get the following warnings from
    src/md5.c
    
        src/md5.c: In function 'md5_finish_ctx':
        src/md5.c:102:3: warning: dereferencing type-punned pointer will
         break strict-aliasing rules [-Wstrict-aliasing]
        *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] <<
         3);
        ^
        src/md5.c:103:3: warning: dereferencing type-punned pointer will
         break strict-aliasing rules [-Wstrict-aliasing]
        *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP
         ((ctx->total[1] << 3) |
        ^
    
    Rather than trying to fix this, Jean-Baptiste Kempf suggested it would
    be better to replace this old implementation with something newer such
    as the one used in VLC. So, this is what this does.
    
    We take src/misc/md5.c as src/md5.c and include/vlc_md5.h as src/md5.h
    
    md5.c had little changed in it, just some #include changes, I also had
    to remove the restrict keyword from the AddMD5() function definition as...
    3dbbdfb5