Uploaded image for project: 'Application Authorization Framework'
  1. Application Authorization Framework
  2. AAF-941

Weird looking implementation of hex2dec with strange (wrong) output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Low Low
    • Guilin Release
    • Casablanca Release, Dublin Release, El Alto Release
    • None

      I was trying to build AAF components and it failed during unit testing.

       

      I stumble upon this weird looking function (fromHex and fromHexNo0x) and I could not resist to test it.

      It had wrong output for odd-count of hex digits, it somewhat works only for even digit count.

      I made a new implementation which IMHO behaves (read: works) better. But maybe the original version was made so strange for reason which escapes me - so maybe this is not a bug...

      I will add my source code to this ticket (HelloAAF.java) with both implementations and simple usage:

      osp@tuxbox:~/Projects/wtf-aaf$ javac HelloAAF.java && java HelloAAF aaf
      {{AAF: 10 160 }}
      Me: 10 175

      As you can see the original version converted 'af' as 160 which si clearly wrong...

      Off-topic: Frankly, I really dislike when someone is reimplementing stuff which was done so many times before and most likely done better. Especially rolling one's own authentication/security stuff is very bad thing to do...there are bunch of proven libraries and schemes and these things are not to take lightly - I bet that any average pentester would found many holes in the whole AAF.

      Please, ONAP people, stop reinventing wheels...

            instrumental instrumental
            p.ospaly p.ospaly
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: