Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixProc startRegex "PUBLIC KEY" #35

Closed
CarstenHouweling opened this issue Feb 8, 2019 · 2 comments
Closed

fixProc startRegex "PUBLIC KEY" #35

CarstenHouweling opened this issue Feb 8, 2019 · 2 comments

Comments

@CarstenHouweling
Copy link

fixProc.js line 25 var tag = key.match(startRegex)[1] does not return "PUBLIC KEY" because the startRegex fails.

See https://regex101.com/ for example. Enter the startRegex: /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m, then enter a random public key -----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7pzpogb1ZPndhnElpSuflFMmYbdRh4WrBZ6cE14Qrn1nfuLCDm86b8YGZiExCsWYbUSO8SuF3JXYTf67xfSRGLo52h3pvKORcLbBD6MkC4BgNYxncco6TvFVLBea4lPTNWiOmVmmB72DUliBjdApeP/CHSjNSxLXHnh2hUDeeZFBozMgKw0R8MuunGNzUuyg7UCgF1sebt8j/szvHzvevshP9o299jXavVcxZ2q6f9zO04vX7gp4ZxMezyAeDEC+m7Lg32XzYm81zEzFxX6nFZUOC0q+DbqcNsRkkzfmsYgRF2FAat4M/OeRBAJKqg3mQMIiY5+xTdEUWP8NeOwZJQIDAQAB-----END PUBLIC KEY-----.

The regex returns PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7pzpogb1ZPndhnElpSuflFMmYbdRh4WrBZ6cE14Qrn1nfuLCDm86b8YGZiExCsWYbUSO8SuF3JXYTf67xfSRGLo52h3pvKORcLbBD6MkC4BgNYxncco6TvFVLBea4lPTNWiOmVmmB72DUliBjdApeP/CHSjNSxLXHnh2hUDeeZFBozMgKw0R8MuunGNzUuyg7UCgF1sebt8j/szvHzvevshP9o299jXavVcxZ2q6f9zO04vX7gp4ZxMezyAeDEC+m7Lg32XzYm81zEzFxX6nFZUOC0q+DbqcNsRkkzfmsYgRF2FAat4M/OeRBAJKqg3mQMIiY5+xTdEUWP8NeOwZJQIDAQAB-----END PUBLIC KEY which in turn fails parse-asn1 index.js switch (type).

When i force the type to be PUBLIC KEY All is well.

@calvinmetcalf
Copy link
Contributor

that's becasue you are missing a line break at the end of the first line

@calvinmetcalf
Copy link
Contributor

that being said that shouldn't matter and I think it's an easy fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants