mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
sntrup: Avoid linking issues in external_override tests
This linking worked only in CI and local builds, but not during the build in RPM as it fails on missing symbols that were defined only in the main library. This is solved as with the other digest dependencies in external crypto by removing the intermediate function. We are already linking the md_*.o objects. The error was like this sh: symbol lookup error: /path/libssh/libssh-0.12.0-build/libssh-0.12.0/redhat-linux-build/lib/libsntrup761_override.so: undefined symbol: crypto_hash_sha512 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Pavol Žáčik <pzacik@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
6
src/external/sntrup761.c
vendored
6
src/external/sntrup761.c
vendored
@@ -27,9 +27,7 @@ sntrup761_enc (uint8_t *c, uint8_t *k, const uint8_t *pk,
|
||||
void
|
||||
sntrup761_dec (uint8_t *k, const uint8_t *c, const uint8_t *sk);
|
||||
|
||||
extern void crypto_hash_sha512 (unsigned char *out,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
extern int sha512(const unsigned char *digest, size_t len, unsigned char *hash);
|
||||
|
||||
#define MAX_LEN 761
|
||||
|
||||
@@ -701,7 +699,7 @@ Hash_prefix (unsigned char *out, int b, const unsigned char *in, int inlen)
|
||||
x[0] = b;
|
||||
for (i = 0; i < inlen; ++i)
|
||||
x[i + 1] = in[i];
|
||||
crypto_hash_sha512 (h, x, inlen + 1);
|
||||
sha512 (x, inlen + 1, h);
|
||||
for (i = 0; i < 32; ++i)
|
||||
out[i] = h[i];
|
||||
}
|
||||
|
||||
@@ -37,13 +37,6 @@
|
||||
#include "libssh/session.h"
|
||||
#include "libssh/ssh2.h"
|
||||
|
||||
void crypto_hash_sha512(unsigned char *out,
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen)
|
||||
{
|
||||
sha512(in, inlen, out);
|
||||
}
|
||||
|
||||
#ifndef HAVE_LIBGCRYPT
|
||||
static void crypto_random(void *ctx, size_t length, uint8_t *dst)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user