Subversion Repositories lsh

Compare Revisions

Ignore whitespace Rev 126 → Rev 132

/tags/2.1-6/debian/patches/nettle3.patch
0,0 → 1,214
Description: Support Nettle 3.x
Author: Magnus Holmgren <holmgren@debian.org>
Forwarded: yes
 
--- a/src/spki/verify.c
+++ b/src/spki/verify.c
@@ -25,7 +25,7 @@
#endif
#include <nettle/bignum.h>
-#include <nettle/dsa.h>
+#include <nettle/dsa-compat.h>
#include <nettle/rsa.h>
#include "certificate.h"
@@ -74,7 +74,7 @@ spki_verify_dsa(const uint8_t *digest,
dsa_public_key_init(&dsa);
dsa_signature_init(&rs);
- res = (dsa_keypair_from_sexp_alist(&dsa, NULL,
+ res = (dsa_keypair_from_sexp_alist((struct dsa_public_key *)&dsa, dsa.y, NULL,
RSA_KEYSIZE_LIMIT, DSA_SHA1_Q_BITS, &key->sexp)
&& spki_parse_type(key)
&& dsa_signature_from_sexp(&rs, &signature->sexp, DSA_SHA1_Q_BITS)
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -322,7 +322,7 @@ make_cast128_cbc_instance(struct crypto_
? do_cast128_encrypt
: do_cast128_decrypt);
- cast128_set_key(&self->ctx.ctx, algorithm->key_size, key);
+ cast5_set_key(&self->ctx.ctx, algorithm->key_size, key);
CBC_SET_IV(&self->ctx, iv);
return(&self->super);
--- a/src/dsa.c
+++ b/src/dsa.c
@@ -28,7 +28,7 @@
#include <assert.h>
#include <nettle/bignum.h>
-#include <nettle/dsa.h>
+#include <nettle/dsa-compat.h>
#include <nettle/sexp.h>
#include <nettle/sha.h>
@@ -322,7 +322,7 @@ make_dsa_verifier(struct signature_algor
NEW(dsa_verifier, res);
init_dsa_verifier(res);
- if (dsa_keypair_from_sexp_alist(&res->key, NULL, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
+ if (dsa_keypair_from_sexp_alist((struct dsa_params *)&res->key, res->key.y, NULL, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
return &res->super;
KILL(res);
@@ -341,7 +341,7 @@ make_dsa_signer(struct signature_algorit
dsa_private_key_init(&res->key);
- if (dsa_keypair_from_sexp_alist(&verifier->key, &res->key, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
+ if (dsa_keypair_from_sexp_alist((struct dsa_params *)&verifier->key, verifier->key.y, res->key.x, DSA_MAX_BITS, DSA_SHA1_Q_BITS, i))
{
res->random = self->random;
res->verifier = verifier;
--- a/src/dummy.c
+++ b/src/dummy.c
@@ -41,84 +41,84 @@
#include "lsh.h"
/* Referenced by ssh_format.c */
-unsigned
+size_t
nettle_mpz_sizeinbase_256_s(const mpz_t x UNUSED)
{ abort(); }
-unsigned
+size_t
nettle_mpz_sizeinbase_256_u(const mpz_t x UNUSED)
{ abort(); }
void
-cbc_encrypt(void *ctx UNUSED, nettle_crypt_func f UNUSED,
- unsigned block_size UNUSED, uint8_t *iv UNUSED,
- unsigned length UNUSED, uint8_t *dst UNUSED,
+cbc_encrypt(const void *ctx UNUSED, nettle_cipher_func *f UNUSED,
+ size_t block_size UNUSED, uint8_t *iv UNUSED,
+ size_t length UNUSED, uint8_t *dst UNUSED,
const uint8_t *src UNUSED)
{ abort(); }
void
-cbc_decrypt(void *ctx UNUSED, nettle_crypt_func f UNUSED,
- unsigned block_size UNUSED, uint8_t *iv UNUSED,
- unsigned length UNUSED, uint8_t *dst UNUSED,
+cbc_decrypt(const void *ctx UNUSED, nettle_cipher_func *f UNUSED,
+ size_t block_size UNUSED, uint8_t *iv UNUSED,
+ size_t length UNUSED, uint8_t *dst UNUSED,
const uint8_t *src UNUSED)
{ abort(); }
void
-ctr_crypt(void *ctx UNUSED, nettle_crypt_func f UNUSED,
- unsigned block_size UNUSED, uint8_t *iv UNUSED,
- unsigned length UNUSED, uint8_t *dst UNUSED,
+ctr_crypt(const void *ctx UNUSED, nettle_cipher_func *f UNUSED,
+ size_t block_size UNUSED, uint8_t *iv UNUSED,
+ size_t length UNUSED, uint8_t *dst UNUSED,
const uint8_t *src UNUSED)
{ abort(); }
void
hmac_digest(const void *outer UNUSED, const void *inner UNUSED, void *state UNUSED,
const struct nettle_hash *hash UNUSED,
- unsigned length UNUSED, uint8_t *digest UNUSED)
+ size_t length UNUSED, uint8_t *digest UNUSED)
{ abort(); }
-unsigned
+size_t
sexp_vformat(struct nettle_buffer *buffer UNUSED,
const char *format UNUSED, va_list args UNUSED)
{ abort(); }
-unsigned
+size_t
sexp_transport_vformat(struct nettle_buffer *buffer UNUSED,
const char *format UNUSED, va_list args UNUSED)
{ abort(); }
int
sexp_transport_iterator_first(struct sexp_iterator *iterator UNUSED,
- unsigned length UNUSED, uint8_t *input UNUSED)
+ size_t length UNUSED, uint8_t *input UNUSED)
{ abort(); }
void
nettle_buffer_init_size(struct nettle_buffer *buffer UNUSED,
- unsigned length UNUSED, uint8_t *space UNUSED)
+ size_t length UNUSED, uint8_t *space UNUSED)
{ abort(); }
/* Referenced by lsh_string.c */
-uint8_t *
-memxor(uint8_t *dst UNUSED, const uint8_t *src UNUSED, size_t n UNUSED)
+void *
+memxor(void *dst UNUSED, const void *src UNUSED, size_t n UNUSED)
{ abort(); }
void
-nettle_mpz_get_str_256(unsigned length UNUSED, uint8_t *s UNUSED, const mpz_t x UNUSED)
+nettle_mpz_get_str_256(size_t length UNUSED, uint8_t *s UNUSED, const mpz_t x UNUSED)
{ abort(); }
void
base64_encode_init(struct base64_encode_ctx *ctx UNUSED)
{ abort(); }
-unsigned
+size_t
base64_encode_update(struct base64_encode_ctx *ctx UNUSED,
uint8_t *dst UNUSED,
- unsigned length UNUSED,
+ size_t length UNUSED,
const uint8_t *src UNUSED)
{ abort(); }
-unsigned
+size_t
base64_encode_final(struct base64_encode_ctx *ctx UNUSED,
uint8_t *dst UNUSED)
{ abort(); }
@@ -129,9 +129,9 @@ base64_decode_init(struct base64_decode_
int
base64_decode_update(struct base64_decode_ctx *ctx UNUSED,
- unsigned *dst_length UNUSED,
+ size_t *dst_length UNUSED,
uint8_t *dst UNUSED,
- unsigned src_length UNUSED,
+ size_t src_length UNUSED,
const uint8_t *src UNUSED)
{ abort(); }
@@ -142,7 +142,7 @@ base64_decode_final(struct base64_decode
/* Referenced by parse.c */
void
nettle_mpz_set_str_256_s(mpz_t x UNUSED,
- unsigned length UNUSED, const uint8_t *s UNUSED)
+ size_t length UNUSED, const uint8_t *s UNUSED)
{ abort(); }
/* Referenced by werror.c */
--- a/src/lsh-keygen.c
+++ b/src/lsh-keygen.c
@@ -39,7 +39,7 @@
#include <unistd.h>
#endif
-#include <nettle/dsa.h>
+#include <nettle/dsa-compat.h>
#include <nettle/rsa.h>
#include "crypto.h"
@@ -214,7 +214,7 @@ dsa_generate_key(struct randomness *r, u
assert(r->quality == RANDOM_GOOD);
- if (dsa_generate_keypair(&public, &private,
+ if (dsa_compat_generate_keypair(&public, &private,
r, lsh_random,
NULL, progress,
512 + 64 * level, DSA_SHA1_Q_BITS))
/tags/2.1-6/debian/patches/series
3,3 → 3,5
new-readline-completion-function-typedef.patch
rl_completion-segfault.patch
bsd_connreset_test_fail.patch
skip-argp.patch
nettle3.patch
/tags/2.1-6/debian/patches/skip-argp.patch
0,0 → 1,65
Description: Make sure we don't touch the embedded argp copy when not needed
To avoid inline functions causing build failures under C99 standards
Author: Magnus Holmgren <holmgren@debian.org>
Bug-Debian: https://bugs.debian.org/777990
Forwarded: yes
 
--- a/configure.ac
+++ b/configure.ac
@@ -577,15 +577,18 @@ fi
# We don't use LIBOBJS for this, as the LIBOBJS are added to
# liblsh.a, and we can't add an archive to an archive.
+ARGP=""
LIBARGP=""
DOTDOT_LIBARGP=""
if test x$with_system_argp = xno ; then
+ ARGP="argp"
# FIXME: Perhaps it's better to use an absolute path?
LIBARGP="argp/libargp.a"
# Needed for linking in src/testsuite.
DOTDOT_LIBARGP="../argp/libargp.a"
fi
+AC_SUBST(ARGP)
AC_SUBST(LIBARGP)
AC_SUBST(DOTDOT_LIBARGP)
@@ -776,7 +779,9 @@ if test x$enable_ipv6 = xyes ; then
AC_DEFINE(WITH_IPV6)
fi
+if test x$with_system_argp = xno ; then
AC_CONFIG_SUBDIRS(src/argp)
+fi
AC_CONFIG_SUBDIRS(src/spki)
AC_CONFIG_SUBDIRS(src/sftp)
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
# Process this file with automake to produce Makefile.in
-SUBDIRS = argp rsync scm sftp spki . testsuite
+SUBDIRS = @ARGP@ rsync scm sftp spki . testsuite
include .dist_classes
include .dist_headers
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -190,6 +190,7 @@ AC_DEFUN([LSH_LIB_ARGP],
ac_argp_save_LDFLAGS="$LDFLAGS"
ac_argp_ok=no
# First check if we can link with argp.
+ AH_TEMPLATE([HAVE_ARGP_PARSE], [Define if system has argp_parse()])
AC_SEARCH_LIBS(argp_parse, argp,
[ LSH_RPATH_FIX
AC_CACHE_CHECK([for working argp],
@@ -294,6 +295,7 @@ int main(int argc, char **argv)
if test x$lsh_cv_lib_argp_works = xyes ; then
ac_argp_ok=yes
+ AC_DEFINE(HAVE_ARGP_PARSE)
else
# Reset link flags
LIBS="$ac_argp_save_LIBS"