Socket
Socket
Sign inDemoInstall

yub

Package Overview
Dependencies
23
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.10.6 to 0.10.7

10

lib/modhex.js

@@ -5,3 +5,3 @@ // lookup table for modhex codes

// convert number to 2 digit hex = 255 --> ff
var toHex = function(n) {
var toHex = function (n) {
return ("0" + n.toString(16)).substr(-2);

@@ -22,11 +22,11 @@ }

p1 = trans.indexOf(src[i]);
if(p1 == -1) {
if (p1 == -1) {
// if a unsupported digit is detected, return null
return null;
}
b = (p1 == -1)?0:p1;
b = (p1 == -1) ? 0 : p1;
if ((flag = !flag)) {
dst = b;
} else {
hex += toHex(dst << 4 | b)
hex += toHex(dst << 4 | b);
}

@@ -43,3 +43,3 @@ }

var d = decode(src);
return (d == null)? null : parseInt(decode(src), 16);
return (d == null) ? null : parseInt(d, 16);
}

@@ -46,0 +46,0 @@

@@ -13,9 +13,2 @@ var crypto = require('crypto');

// pick a random server
var pickServer = function() {
var len = servers.length;
var r = Math.random();
return servers[Math.floor(r * len)];
};
// store the client credentials

@@ -32,5 +25,6 @@ // Apply here https://upgrade.yubico.com/getapikey/

var obj = data.split("\r\n"),
retval = {};
retval = {},
kv = [];
Object.keys(obj).map(function(key) {
var kv = obj[key].split("=", 2);
kv = obj[key].split("=", 2);
if (kv[0].length > 0) {

@@ -45,3 +39,3 @@ retval[kv[0]] = kv[1];

// the string with last 32 characters removed
var calculateIdentity = function(otp) {
var calculateIdentity = function (otp) {
var len = otp.length;

@@ -53,3 +47,3 @@ return (len > 32) ? otp.substring(0, len - 32) : null;

// the last 32 characters
var calculateEncrypted = function(otp) {
var calculateEncrypted = function (otp) {
var len = otp.length;

@@ -103,6 +97,7 @@ return (len > 32) ? otp.substring(len - 32, len) : null;

// calculate url
var uri = 'https://' + pickServer() + '/wsapi/2.0/verify';
var server = servers[Math.floor(Math.random() * servers.length)];
var uri = 'https://' + server + '/wsapi/2.0/verify';
// to https request
request({ uri: uri, qs: params} , function (err, res, body) {
request({ uri: uri, qs: params}, function (err, res, body) {

@@ -109,0 +104,0 @@ // error

{
"name": "yub",
"version": "0.10.6",
"version": "0.10.7",
"description": "Yubico Yubikey API Client for Node.js",

@@ -5,0 +5,0 @@ "main": "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