Skip to content

Commit

Permalink
Accept CSRs with NEW in the label for decoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
mundry authored and davidlehn committed Jan 7, 2022
1 parent fb9d7f1 commit 9c2aba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pem.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pem.decode = function(str) {
var rval = [];

// split string into PEM messages (be lenient w/EOF on BEGIN line)
var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g;
var rMessage = /\s*-----BEGIN(?: NEW)? ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END(?: NEW)? \1-----/g;
var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/;
var rCRLF = /\r?\n/;
var match;
Expand Down

0 comments on commit 9c2aba1

Please sign in to comment.