Allow configuring openpgp in unit tests using query params (e.g. ?debug=true&use_native=false)
This commit is contained in:
parent
ba2b761da4
commit
c6ba83c4a3
|
@ -177,15 +177,12 @@ export default {
|
||||||
// 4.2.2.1. One-Octet Lengths
|
// 4.2.2.1. One-Octet Lengths
|
||||||
if (input[mypos] < 192) {
|
if (input[mypos] < 192) {
|
||||||
packet_length = input[mypos++];
|
packet_length = input[mypos++];
|
||||||
util.print_debug("1 byte length:" + packet_length);
|
|
||||||
// 4.2.2.2. Two-Octet Lengths
|
// 4.2.2.2. Two-Octet Lengths
|
||||||
} else if (input[mypos] >= 192 && input[mypos] < 224) {
|
} else if (input[mypos] >= 192 && input[mypos] < 224) {
|
||||||
packet_length = ((input[mypos++] - 192) << 8) + (input[mypos++]) + 192;
|
packet_length = ((input[mypos++] - 192) << 8) + (input[mypos++]) + 192;
|
||||||
util.print_debug("2 byte length:" + packet_length);
|
|
||||||
// 4.2.2.4. Partial Body Lengths
|
// 4.2.2.4. Partial Body Lengths
|
||||||
} else if (input[mypos] > 223 && input[mypos] < 255) {
|
} else if (input[mypos] > 223 && input[mypos] < 255) {
|
||||||
packet_length = 1 << (input[mypos++] & 0x1F);
|
packet_length = 1 << (input[mypos++] & 0x1F);
|
||||||
util.print_debug("4 byte length:" + packet_length);
|
|
||||||
// EEEK, we're reading the full data here...
|
// EEEK, we're reading the full data here...
|
||||||
let mypos2 = mypos + packet_length;
|
let mypos2 = mypos + packet_length;
|
||||||
bodydata = [input.subarray(mypos, mypos + packet_length)];
|
bodydata = [input.subarray(mypos, mypos + packet_length)];
|
||||||
|
|
|
@ -38,6 +38,13 @@ describe('Unit Tests', function () {
|
||||||
window.scrollTo(0, document.body.scrollHeight);
|
window.scrollTo(0, document.body.scrollHeight);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.location.search.substr(1).split('&').forEach(param => {
|
||||||
|
const [key, value] = param.split('=');
|
||||||
|
if (key && key !== 'grep') {
|
||||||
|
openpgp.config[key] = JSON.parse(value);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
require('./crypto');
|
require('./crypto');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user