Skip to content

Commit 3e46a48

Browse files
committed
6.5.7
1 parent accb61e commit 3e46a48

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

dist/elliptic.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -2580,6 +2580,10 @@ function getLength(buf, p) {
25802580
return false;
25812581
}
25822582

2583+
if(buf[p.place] === 0x00) {
2584+
return false;
2585+
}
2586+
25832587
var val = 0;
25842588
for (var i = 0, off = p.place; i < octetLen; i++, off++) {
25852589
val <<= 8;
@@ -2628,6 +2632,9 @@ Signature.prototype._importDER = function _importDER(data, enc) {
26282632
if (rlen === false) {
26292633
return false;
26302634
}
2635+
if ((data[p.place] & 128) !== 0) {
2636+
return false;
2637+
}
26312638
var r = data.slice(p.place, rlen + p.place);
26322639
p.place += rlen;
26332640
if (data[p.place++] !== 0x02) {
@@ -2640,6 +2647,9 @@ Signature.prototype._importDER = function _importDER(data, enc) {
26402647
if (data.length !== slen + p.place) {
26412648
return false;
26422649
}
2650+
if ((data[p.place] & 128) !== 0) {
2651+
return false;
2652+
}
26432653
var s = data.slice(p.place, slen + p.place);
26442654
if (r[0] === 0) {
26452655
if (r[1] & 0x80) {
@@ -2951,6 +2961,7 @@ function Signature(eddsa, sig) {
29512961
sig = parseBytes(sig);
29522962

29532963
if (Array.isArray(sig)) {
2964+
assert(sig.length === eddsa.encodingLength * 2, 'Signature has invalid size');
29542965
sig = {
29552966
R: sig.slice(0, eddsa.encodingLength),
29562967
S: sig.slice(eddsa.encodingLength),
@@ -8856,7 +8867,7 @@ utils.encode = function encode(arr, enc) {
88568867
},{}],35:[function(require,module,exports){
88578868
module.exports={
88588869
"name": "elliptic",
8859-
"version": "6.5.6",
8870+
"version": "6.5.7",
88608871
"description": "EC cryptography",
88618872
"main": "lib/elliptic.js",
88628873
"files": [

dist/elliptic.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "elliptic",
3-
"version": "6.5.6",
3+
"version": "6.5.7",
44
"description": "EC cryptography",
55
"main": "lib/elliptic.js",
66
"files": [

0 commit comments

Comments
 (0)