Uploaded image for project: 'River (Retired)'
  1. River (Retired)
  2. RIVER-5

HTTMPMD URLs can be considered equal while they are not

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • jtsk_2.1
    • River_2.1.2
    • net_jini_url
    • None

    Description

      According to the specification of net.jini.url.httpmd.Handler the message digest may contain the ',' (comma) character, however the parsing logic in net.jini.url.httpmd.Handler.sameFile(URL, URL) assumes the first comma in the parameter part to be the start of the comment. As a consequence the following piece of code (requires the installation of a security provider with support for the non existing message digest algorithms MD5,0 and MD5,10) yields the wrong result:

      URL url1 = new URL("httpmd://localhost:80/;md5,0=7be207c7111e459eeea1c9b3d04f1667,.jar");
      URL url2 = new URL("HTTPMD://localhost/;md5,10=7be207c7111e459eeea1c9b3d04f1667");
      
      System.out.println("equals: " + url1.equals(url2));
      

      The output is "true" while it is of course obvious that the output should be "false" here.

      Attachments

        1. test.zip
          11 kB
          Fred Oliver
        2. httpmd.patch
          2 kB
          Mark Brouwer
        3. HttpmdTest.java
          4 kB
          Mark Brouwer

        Activity

          People

            marbro Mark Brouwer
            marbro Mark Brouwer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: