This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [incremental] Patch: FYI: add missing bits to checksum



+    case CPP_KEYWORD:
+      type = token->keyword;
+      md5_process_bytes (&type, sizeof (type), current_hash);
+      break;

Why not change this to sha1 since you're at it? You cannot find a second pre-image for MD5, but you can find collisions pretty easily, so it could yield security problems (no I'm not exaggerating it *too much*---they would be wrong-code bugs, but if somebody plays with MD5 collisions you can assume that they are doing something malicious). You could have


  if ("A1" == "A2")
    foo ();
  else
    bar ();

compile to foo () if you had previously given

  if ("A2" == "A2")
    foo ();
  else
    bar ();

and (A1, A2) is a colliding pair.

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]