Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4815057

Allow validation of incorrectly ASN.1 encoded DSA signatures

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.2
    • security-libs
    • None
    • tiger
    • generic
    • generic

      The standard format for DSA signature values is an ASN.1 sequence of the two integers R and S. ASN.1 always encodes integers in signed 2's complement format. However, some libraries apparently encode the values incorrectly in unsigned format, i.e. do not add a 0x00 prefix byte if the MSB is set.

      It seems that some products accept those invalid signatures, including the Sun provider in J2SE releases prior to 1.4.1. The changeover from the old BigInt ASN.1 code to BigInteger now causes those signature validations to fail with "java.security.SignatureException: invalid signature: out of range values"

      We may want to consider changing our code to accept incorrectly encoded signatures (again). Since our code is working as designed and per FIPS 186-2 and RFC3279, I am filing this as an RFE.

            andreas Andreas Sterbenz
            andreas Andreas Sterbenz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: