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

Fix Travis CI builds, update dependencies, and update list of as-yet unimplemented functions #200

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions example/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,17 +395,7 @@ exports.createHash = function (alg) {
}
}
// the least I can do is make error messages for the rest of the node.js/crypto api.
;['createCredentials'
, 'createHmac'
, 'createCypher'
, 'createCypheriv'
, 'createDecipher'
, 'createDecipheriv'
, 'createSign'
, 'createVerify'
, 'createDeffieHellman',
, 'pbkdf2',
, 'randomBytes' ].forEach(function (name) {
;['createCredentials'].forEach(function (name) {
exports[name] = function () {
error('sorry,', name, 'is not implemented yet')
}
Expand All @@ -429,6 +419,7 @@ exports.str_sha1 = str_sha1;
exports.hex_hmac_sha1 = hex_hmac_sha1;
exports.b64_hmac_sha1 = b64_hmac_sha1;
exports.str_hmac_sha1 = str_hmac_sha1;
exports.sha1_vm_test = sha1_vm_test;

/*
* Configurable variables. You may need to tweak these to be compatible with
Expand Down
1 change: 0 additions & 1 deletion example/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var crypto = require('crypto')
var abc = crypto.createHash('sha1').update('abc').digest('hex')
console.log(abc)
// require('hello').inlineCall().call2()
13 changes: 0 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ exports.privateEncrypt = publicEncrypt.privateEncrypt
exports.publicDecrypt = publicEncrypt.publicDecrypt
exports.privateDecrypt = publicEncrypt.privateDecrypt

// the least I can do is make error messages for the rest of the node.js/crypto api.
// ;[
// 'createCredentials'
// ].forEach(function (name) {
// exports[name] = function () {
// throw new Error([
// 'sorry, ' + name + ' is not implemented yet',
// 'we accept pull requests',
// 'https://github.com/crypto-browserify/crypto-browserify'
// ].join('\n'))
// }
// })

var rf = require('randomfill')

exports.randomFill = rf.randomFill
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@
"scripts": {
"standard": "standard",
"test": "npm run standard && npm run unit",
"unit": "node test/",
"unit": "node test",
"browser": "zuul --browser-version $BROWSER_VERSION --browser-name $BROWSER_NAME -- test/index.js"
},
"engines": {
"node": "*"
},
"dependencies": {
"browserify-cipher": "^1.0.0",
"browserify-sign": "^4.0.0",
"create-ecdh": "^4.0.0",
"create-hash": "^1.1.0",
"create-hmac": "^1.1.0",
"diffie-hellman": "^5.0.0",
"inherits": "^2.0.1",
"pbkdf2": "^3.0.3",
"public-encrypt": "^4.0.0",
"randombytes": "^2.0.0",
"randomfill": "^1.0.3"
"browserify-cipher": "^1.0.1",
"browserify-sign": "^4.2.1",
"create-ecdh": "^4.0.4",
"create-hash": "^1.2.0",
"create-hmac": "^1.1.7",
"diffie-hellman": "^5.0.3",
"inherits": "^2.0.4",
"pbkdf2": "^3.1.1",
"public-encrypt": "^4.0.3",
"randombytes": "^2.1.0",
"randomfill": "^1.0.4"
},
"devDependencies": {
"hash-test-vectors": "~1.3.2",
"hash-test-vectors": "^1.3.2",
"pseudorandombytes": "^2.0.0",
"safe-buffer": "^5.1.1",
"standard": "^5.0.2",
"tape": "~2.3.2",
"zuul": "^3.6.0"
"safe-buffer": "^5.2.1",
"standard": "^5.4.1",
"tape": "^5.1.1",
"zuul": "^3.12.0"
},
"optionalDependencies": {},
"browser": {
Expand Down
6 changes: 3 additions & 3 deletions test/create-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ function runTest (name, createHash, algorithm) {
}
var obj = vectors[i]

var input = new Buffer(obj.input, 'base64')
var input = Buffer.from(obj.input, 'base64')
var node = obj[algorithm]
var js = createHash(algorithm).update(input).digest('hex')
if (js !== node) {
t.equal(js, node, algorithm + '(testVector[' + i + ']) == ' + node)
}

encodings.forEach(function (encoding) {
var input = new Buffer(obj.input, 'base64').toString(encoding)
var input = Buffer.from(obj.input, 'base64').toString(encoding)
var node = obj[algorithm]
var js = createHash(algorithm).update(input, encoding).digest('hex')
if (js !== node) {
t.equal(js, node, algorithm + '(testVector[' + i + '], ' + encoding + ') == ' + node)
}
})
input = new Buffer(obj.input, 'base64')
input = Buffer.from(obj.input, 'base64')
node = obj[algorithm]
var hash = createHash(algorithm)
hash.end(input)
Expand Down
4 changes: 2 additions & 2 deletions test/create-hmac.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function testLib (name, createHmac) {
return t.end()
}
var input = vectors[i]
var output = createHmac(alg, new Buffer(input.key, 'hex'))
var output = createHmac(alg, Buffer.from(input.key, 'hex'))
.update(input.data, 'hex').digest()

output = input.truncate ? output.slice(0, input.truncate) : output
Expand All @@ -33,7 +33,7 @@ function testLib (name, createHmac) {
return t.end()
}
var input = vectors[i]
var hmac = createHmac(alg, new Buffer(input.key, 'hex'))
var hmac = createHmac(alg, Buffer.from(input.key, 'hex'))

hmac.end(input.data, 'hex')
var output = hmac.read()
Expand Down
22 changes: 11 additions & 11 deletions test/public-encrypt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions test/sign.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.