ensure that the flag field is formatted as CCTF{...}, otherwise treat it as invalid
parent
c186f2b318
commit
0a7fca68dd
|
@ -27,6 +27,8 @@
|
||||||
var s = inpFlag.value;
|
var s = inpFlag.value;
|
||||||
var k = new BN(0);
|
var k = new BN(0);
|
||||||
var h = "0x";
|
var h = "0x";
|
||||||
|
if (s.slice(0, 5) !== "CCTF{" || s.slice(-1) !== "}")
|
||||||
|
return null;
|
||||||
for (i in s) {
|
for (i in s) {
|
||||||
var c = s.charCodeAt(i);
|
var c = s.charCodeAt(i);
|
||||||
k = k.muln(16).addn(c);
|
k = k.muln(16).addn(c);
|
||||||
|
|
Loading…
Reference in New Issue