snxvpn icon indicating copy to clipboard operation
snxvpn copied to clipboard

Padding bytes may not be zero.

Open uunicorn opened this issue 6 years ago • 2 comments

Fixes #18

See pkcs1pad2 in JS_RSA.js: ... while(n > 2) { // random non-zero pad x[0] = 0; while(x[0] == 0) rng.nextBytes(x); ba[--n] = x[0]; } ...

uunicorn avatar Dec 17 '18 08:12 uunicorn

It works for me. GJ

kukenc avatar Mar 24 '20 11:03 kukenc

This fix allows to get rid of Unexpected response, looking for MultiChallenge or Portal messages. As I understand it, theses messages are triggered when os.urandom emits b'\0' values. As this char is a separator, it must not be present in random value.

Surely because I currently run the script with python2.7 (not sure), I need to use:

r.append (bytes(bytearray([int(x.encode('hex'), 16) % 255 + 1 for x in os.urandom (n)])))

instead of proposal:

r.append (bytes([x % 255 + 1 for x in os.urandom (n)]))

lalmeras avatar Nov 06 '23 10:11 lalmeras