]> git.sesse.net Git - vlc/commitdiff
check if the binary signature was issued by the public key we got in memory, before...
authorRafaël Carré <funman@videolan.org>
Sun, 9 Mar 2008 20:55:27 +0000 (21:55 +0100)
committerRafaël Carré <funman@videolan.org>
Sun, 9 Mar 2008 23:12:18 +0000 (00:12 +0100)
src/misc/update.c

index c8d948272946caca2602537843942e0f5a61dc49..d7c9d50483b9e6d0fd2bff783d1d99796459a24c 100644 (file)
@@ -1368,6 +1368,18 @@ void update_DownloadReal( update_download_thread_t *p_udt )
         goto end;
     }
 
+    if( memcmp( sign.issuer_longid, p_update->p_pkey->longid, 8 ) )
+    {
+        utf8_unlink( psz_destfile );
+        msg_Err( p_udt, "Invalid signature issuer" );
+        intf_UserFatal( p_udt, VLC_TRUE, _("Invalid signature"),
+            _("The cryptographic signature for downloaded file \"%s\" was "
+              "invalid and couldn't be used to securely verify it, and so "
+              "VLC deleted it."),
+            psz_destfile );
+        goto end;
+    }
+
     if( sign.type != BINARY_SIGNATURE )
     {
         utf8_unlink( psz_destfile );