From 526a4416fe0b3aaae3d8a24aebfd569b379d391b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 18 Nov 2018 14:11:18 -0700 Subject: [PATCH] WIP more asn1 --- lib/ecdsacsr.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/ecdsacsr.js b/lib/ecdsacsr.js index a704d7a..6321263 100644 --- a/lib/ecdsacsr.js +++ b/lib/ecdsacsr.js @@ -281,20 +281,19 @@ function createCsrBodyEc(domains, xy) { )) // #0 Total 3 - , '02 01 00' // 3 bytes, int 0 + , ASN1('02', '00') // Subject // #1 Total 2+11+n - , '30 {3.2.0seqlen}' // 2 bytes, sequence - .replace(/{[^}]+}/, numToHex(2+2+5+2+sublen)) + , ASN1('30' , '31 {4.3.0setlen}' // 2 bytes, set .replace(/{[^}]+}/, numToHex(2+5+2+sublen)) - , '30 {5.4.0seqlen}' // 2 bytes, sequence - .replace(/{[^}]+}/, numToHex(5+2+sublen)) - , '06 03 55 04 03' // 5 bytes, object id (commonName) - , '0C {dlen} {domain.tld}' // 2+n bytes, utf8string - .replace(/{dlen}/, numToHex(sublen)) - .replace(/{domain\.tld}/, strToHex(domains[0])) + , ASN1('30' + // object id (commonName) + , ASN1('06', '55 04 03') + , ASN1('0C', strToHex(domains[0])) + ) + ) // P-256 Public Key // #2 Total 2+25+xy