home.social

#asn1js — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #asn1js, aggregated by home.social.

  1. Today I'm retiring old tailor-made big integer code from #asn1js and while I'm happy ES2020 support proper BigInts, I feel a bit sentimental about it.

    It's a small silly thing, but I wrote it so many years ago, and it did its small job very well; that is, only parsing arbitrarily long binary integer values and printing them efficiently in decimal, nothing more, nothing less.

        /**
         * Multiply value by m and add c.
         * @param {number} m - multiplier, must be 0<m<=256
         * @param {number} c - value to add, must be c>=0
         */
        mulAdd(m, c) {
            let b = this.buf,
                l = b.length,
                i, t;
            for (i = 0; i < l; ++i) {
                t = b[i] * m + c;
                if (t < max)
                    c = 0;
                else {
                    c = 0|(t / max);
                    t -= c * max;
                }
                b[i] = t;
            }
            if (c > 0)
                b[i] = c;
        }
  2. In new #ASN1js version 2.1.0 I changed the logic of the shown #ASN1 field names due to research started with GitHub issue #102:
    Previously it would have shown simply as issuer, but fixing another issue I had a (kinda) regression and it shown only the CHOICE identifier (in this case rdnSequence).
    In the end, I think that probably the best choice is to show both names, the base one as it usually is more useful to identify the field, but the CHOICE name to know which sub-case this is. This leads to a bit of uninteresting info such as the notBefore utcTime UTCTime, but that's the (small) price to be paid.
    This was a delicate change, so first thing I extended the test harness in order to check that a few important examples decode to what is expected.
  3. In new #ASN1js version 2.1.0 I changed the logic of the shown #ASN1 field names due to research started with GitHub issue #102:
    Previously it would have shown simply as issuer, but fixing another issue I had a (kinda) regression and it shown only the CHOICE identifier (in this case rdnSequence).
    In the end, I think that probably the best choice is to show both names, the base one as it usually is more useful to identify the field, but the CHOICE name to know which sub-case this is. This leads to a bit of uninteresting info such as the notBefore utcTime UTCTime, but that's the (small) price to be paid.
    This was a delicate change, so first thing I extended the test harness in order to check that a few important examples decode to what is expected.
  4. In new #ASN1js version 2.1.0 I changed the logic of the shown #ASN1 field names due to research started with GitHub issue #102:
    Previously it would have shown simply as issuer, but fixing another issue I had a (kinda) regression and it shown only the CHOICE identifier (in this case rdnSequence).
    In the end, I think that probably the best choice is to show both names, the base one as it usually is more useful to identify the field, but the CHOICE name to know which sub-case this is. This leads to a bit of uninteresting info such as the notBefore utcTime UTCTime, but that's the (small) price to be paid.
    This was a delicate change, so first thing I extended the test harness in order to check that a few important examples decode to what is expected.
  5. In new #ASN1js version 2.1.0 I changed the logic of the shown #ASN1 field names due to research started with GitHub issue #102:
    Previously it would have shown simply as issuer, but fixing another issue I had a (kinda) regression and it shown only the CHOICE identifier (in this case rdnSequence).
    In the end, I think that probably the best choice is to show both names, the base one as it usually is more useful to identify the field, but the CHOICE name to know which sub-case this is. This leads to a bit of uninteresting info such as the notBefore utcTime UTCTime, but that's the (small) price to be paid.
    This was a delicate change, so first thing I extended the test harness in order to check that a few important examples decode to what is expected.
  6. Releases a few updates to #asn1js today:

  7. @cpu Oh, my #asn1js doesn't support it, what a shame.
    (actually uses Peter Gutmann's dumpasn1.cfg file)
  8. New #ASN1js feature: showing field names, as taken from #ASN1 module definitions parsed right out of #RFC.
    Consider it beta for now (currently supports only X.509 and CMS definitions, but this will change in the future).
  9. New #ASN1js feature: showing field names, as taken from #ASN1 module definitions parsed right out of #RFC.
    Consider it beta for now (currently supports only X.509 and CMS definitions, but this will change in the future).