buffer_put_bignum2_from_string question

Jan Mojžíš jan at mojzis.com
Tue Apr 8 22:39:46 EST 2014

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,

More information about the openssh-unix-dev mailing list