buffer_put_bignum2_from_string question

Jan Mojžíš
Tue, 08 Apr 2014 12:39:46 -0000

Hello,
I have question about buffer_put_bignum2_from_string
function used in kexc25519.c in (OpenSSH >= 6.5)

Is it 1:1 replacement for formating bignums from OpenSSL?

If yes, then buffer_put_bignum2_from_string
has different results for numbers starting with zeros.

How to reproduce:

shared_key[CURVE25519_SIZE] =
"\0\0\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1";
buffer_put_bignum2_from_string(out, shared_key, CURVE25519_SIZE);

and than same number format into bignum and than into wire format.


Best regards,
Jan