Skip to content

Commit 1fe0ea0

Browse files
committed
Update supported configurations
1 parent 172fecb commit 1fe0ea0

2 files changed

Lines changed: 7 additions & 28 deletions

File tree

nodejs/test.js

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ var crypto = require('crypto');
44
var ece = require('./ece.js');
55
var base64 = require('urlsafe-base64');
66
var assert = require('assert');
7-
var fs = require('fs');
8-
97

108
// Usage: node test.js [args]
119
// If args contains a version (e.g., aes128gcm), filter on versions.
@@ -37,7 +35,6 @@ if (process.argv.length >= 3) {
3735
} else {
3836
plaintext = new Buffer(process.argv[2], 'ascii');
3937
}
40-
dump = ( process.argv.indexOf('dump') != -1)
4138
}
4239
function filterTests(fullList) {
4340
var filtered = fullList.filter(function(t) {
@@ -62,16 +59,12 @@ function logbuf(msg, buf) {
6259
}
6360
}
6461

65-
// Validate that the encryption function only accepts Buffers
6662
function validate() {
6763
['hello', null, 1, NaN, [], {}].forEach(function(v) {
6864
try {
69-
ece.encrypt(v, {});
70-
} catch (e) {
71-
if (e.toString() != "Error: buffer argument must be a Buffer") {
72-
throw new Error("encrypt failed to reject " + JSON.stringify(v));
73-
}
74-
}
65+
encrypt('hello', {});
66+
throw new Error('should insist on a buffer');
67+
} catch (e) {}
7568
});
7669
}
7770

@@ -111,21 +104,6 @@ function encryptDecrypt(input, encryptParams, decryptParams) {
111104
logbuf('Encrypted', encrypted);
112105
var decrypted = ece.decrypt(encrypted, decryptParams);
113106
logbuf('Decrypted', decrypted);
114-
if (dump) {
115-
var data = {
116-
version: version,
117-
input: base64.encode(input),
118-
encrypted: base64.encode(encrypted),
119-
params: {
120-
encrypted: encryptParams,
121-
decrypt: decryptParams,
122-
}
123-
};
124-
if (keyData) {
125-
data.keys = keyData;
126-
}
127-
dumpData(data);
128-
}
129107
assert.equal(Buffer.compare(input, decrypted), 0);
130108
log('----- OK');
131109
}
@@ -177,7 +155,7 @@ function detectTruncation(version) {
177155
logbuf('Encrypted', encrypted);
178156
var ok = false;
179157
try {
180-
ece.decrypt(encrypted, params, params, version);
158+
ece.decrypt(encrypted, params);
181159
} catch (e) {
182160
log('----- OK: ' + e);
183161
ok = true;
@@ -304,4 +282,4 @@ filterTests([ 'aesgcm128', 'aesgcm', 'aes128gcm' ])
304282
});
305283
checkExamples();
306284

307-
log('All tests passed.');
285+
log('All tests passed.');

python/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='http_ece',
13-
version='0.6.0',
13+
version='0.6.1',
1414
author='Martin Thomson',
1515
author_email='martin.thomson@gmail.com',
1616
scripts=[],
@@ -22,6 +22,7 @@
2222
'License :: OSI Approved :: MIT License',
2323
'Programming Language :: Python :: 2.7',
2424
'Programming Language :: Python :: 3.4',
25+
'Programming Language :: Python :: 3.5',
2526
],
2627
keywords='crypto http',
2728
install_requires=[

0 commit comments

Comments
 (0)