Socket
Socket
Sign inDemoInstall

sshpk

Package Overview
Dependencies
9
Maintainers
4
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.16.0 to 1.16.1

18

lib/formats/pkcs8.js

@@ -304,7 +304,19 @@ // Copyright 2018 Joyent, Inc.

var d = der.readString(asn1.Ber.OctetString, true);
der.readSequence(0xa1);
var Q;
var Q = der.readString(asn1.Ber.BitString, true);
Q = utils.ecNormalize(Q);
if (der.peek() == 0xa0) {
der.readSequence(0xa0);
der._offset += der.length;
}
if (der.peek() == 0xa1) {
der.readSequence(0xa1);
Q = der.readString(asn1.Ber.BitString, true);
Q = utils.ecNormalize(Q);
}
if (Q === undefined) {
var pub = utils.publicFromPrivateECDSA(curveName, d);
Q = pub.part.Q.data;
}
var key = {

@@ -311,0 +323,0 @@ type: 'ecdsa',

@@ -206,2 +206,10 @@ // Copyright 2017 Joyent, Inc.

function writeDate(der, date) {
if (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) {
der.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime);
} else {
der.writeString(dateToUTCTime(date), asn1.Ber.UTCTime);
}
}
/* RFC5280, section 4.2.1.6 (GeneralName type) */

@@ -419,5 +427,7 @@ var ALTNAME = {

function zeroPad(n) {
function zeroPad(n, m) {
if (m === undefined)
m = 2;
var s = '' + n;
while (s.length < 2)
while (s.length < m)
s = '0' + s;

@@ -439,2 +449,14 @@ return (s);

function dateToGTime(d) {
var s = '';
s += zeroPad(d.getUTCFullYear(), 4);
s += zeroPad(d.getUTCMonth() + 1);
s += zeroPad(d.getUTCDate());
s += zeroPad(d.getUTCHours());
s += zeroPad(d.getUTCMinutes());
s += zeroPad(d.getUTCSeconds());
s += 'Z';
return (s);
}
function sign(cert, key) {

@@ -538,4 +560,4 @@ if (cert.signatures.x509 === undefined)

der.startSequence();
der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime);
der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime);
writeDate(der, cert.validFrom);
writeDate(der, cert.validUntil);
der.endSequence();

@@ -542,0 +564,0 @@

2

package.json
{
"name": "sshpk",
"version": "1.16.0",
"version": "1.16.1",
"description": "A library for finding and using SSH public keys",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc