Hello.

One more question about decoding DER structures.

Some PKCS#11 mechanisms (namely, CKM_GOSTR3410 ) accept DER-encoded parameters, 
which include DER tag-length prefix.

I dissect these parameters from some wrapping DER structure by 
SEC_QuickDERDecodeItem. Unfortunately, I could not find an option to ask 
decoder to put tag-length prefix together with item.

To handle this, I adjust decoded SECItems after decoding:

  SECItem t;
  t.len  += 2;
  t.data -= 2;

This works for now, because parameters are OIDS which fits in a 128-byte limit. 
But this is unsafe.

Please, advice, how can I save DER tag-length in item safely ?

Best regards,
--
Konstantin Andreev, software engineer.
Swemel JSC
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to