[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/5] curve25519: Small libgcrypt bignum fix
[Thread Prev] | [Thread Next]
- Subject: [PATCH 1/5] curve25519: Small libgcrypt bignum fix
- From: Justus Winter <justus@xxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 2 May 2016 16:00:22 +0200
- To: libssh@xxxxxxxxxx
- Cc: Justus Winter <justus@xxxxxxxxxxx>
* src/curve25519.c (ssh_client_curve25519_init): Make use of the gcrypt-variant of 'bignum_bin2bn'. Signed-off-by: Justus Winter <justus@xxxxxxxxxxx> --- src/curve25519.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/curve25519.c b/src/curve25519.c index 43783e8..77fab2d 100644 --- a/src/curve25519.c +++ b/src/curve25519.c @@ -71,11 +71,14 @@ int ssh_client_curve25519_init(ssh_session session){ static int ssh_curve25519_build_k(ssh_session session) { ssh_curve25519_pubkey k; + +#ifdef HAVE_LIBCRYPTO session->next_crypto->k = bignum_new(); if (session->next_crypto->k == NULL) { return SSH_ERROR; } +#endif if (session->server) crypto_scalarmult(k, session->next_crypto->curve25519_privkey, @@ -84,7 +87,11 @@ static int ssh_curve25519_build_k(ssh_session session) { crypto_scalarmult(k, session->next_crypto->curve25519_privkey, session->next_crypto->curve25519_server_pubkey); +#ifdef HAVE_LIBGCRYPT + bignum_bin2bn(k, CURVE25519_PUBKEY_SIZE, &session->next_crypto->k); +#elif defined HAVE_LIBCRYPTO bignum_bin2bn(k, CURVE25519_PUBKEY_SIZE, session->next_crypto->k); +#endif #ifdef DEBUG_CRYPTO ssh_print_hexa("Session server cookie", -- 2.8.1
[PATCH 3/5] libgcrypt: Implement the 'evp' interface | Justus Winter <justus@xxxxxxxxxxx> |
[PATCH 4/5] pki_gcrypt: Handle ECDSA keys and signatures | Justus Winter <justus@xxxxxxxxxxx> |
[PATCH 5/5] ecdh: Implement ECDH using libgcrypt | Justus Winter <justus@xxxxxxxxxxx> |
[PATCH 2/5] pki_gcrypt: Add a little more ASN1 infrastructure | Justus Winter <justus@xxxxxxxxxxx> |
Re: [PATCH 1/5] curve25519: Small libgcrypt bignum fix | Justus Winter <justus@xxxxxxxxxxx> |
Re: [PATCH 2/3] pki_gcrypt: Handle ECDSA keys and signatures | Andreas Schneider <asn@xxxxxxxxxxxxxx> |