Menu

#2 Dubious reflection assumption in BEREncoder.

open-wont-fix
None
7
2006-11-14
2006-10-18
John Finley
No

The class BEREncoder's method encodeSequence() appears
to rely on the order of Fields returned from the method
Class.getDeclaredFields() being the same as they are
declared in the source code generated by BNCompiler
for the sequence to be encoded. But, according to the
Javadoc for java.lang.Class, there is no guarantee that
these Fields will be returned in any particular order.
This has at least two implications:

(0) The sequence might be encoded in the wrong order.
(1) The sequence might be encoded in different orders
in different JREs, since Class might be implemented
differently in JRE's runtime libraries. Consider
GNU Classpath vs. SUN JDK, for example.

In either case, binary compatibility could not be ensured
between data encoded by BN and other ASN.1/BER
implementaions, or even between BN programs running under
different JREs.

Perhaps I'm mistaken, but this seems like a serious
problem.

Discussion

  • John Finley

    John Finley - 2006-10-18
    • priority: 5 --> 7
     
  • Abdulla(h) Abdurakhmanov

    Logged In: YES
    user_id=1513714

    Ohh... I know about this issue. But don't has the
    good-looking resolution for now.
    Probably it is necessary to enter (optional) order attribute
    in @ASN1Element in the next releases (maybe in the following
    1.1.0b2).

     
  • Abdulla(h) Abdurakhmanov

    • assigned_to: nobody --> akira_ag
    • status: open --> pending-wont-fix
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-wont-fix --> closed-wont-fix
     
  • Abdulla(h) Abdurakhmanov

    • status: closed-wont-fix --> open-wont-fix
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.