changeset 1461:fb90a5ba84e0

Merge pull request #49 from fperrad/20170812_lint Some linting, const parameters
author Matt Johnston <matt@ucc.asn.au>
date Thu, 25 Jan 2018 21:55:25 +0800
parents ef310db5ccec (diff) 58a74cb829b8 (current diff)
children a3479d0d7e79
files dbutil.c svr-authpubkey.c
diffstat 5 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sat Aug 19 22:39:53 2017 +0200
+++ b/configure.ac	Thu Jan 25 21:55:25 2018 +0800
@@ -828,6 +828,7 @@
 AS_MKDIR_P(libtomcrypt/src/modes/ofb)
 AS_MKDIR_P(libtomcrypt/src/modes/f8)
 AS_MKDIR_P(libtomcrypt/src/modes/lrw)
+AS_MKDIR_P(libtomcrypt/src/modes/xts)
 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/bit)
 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/boolean)
 AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/choice)
--- a/dbutil.c	Sat Aug 19 22:39:53 2017 +0200
+++ b/dbutil.c	Thu Jan 25 21:55:25 2018 +0800
@@ -506,7 +506,7 @@
 void m_close(int fd) {
 	int val;
 
-	if (fd == -1) {
+	if (fd < 0) {
 		return;
 	}
 
--- a/libtomcrypt/Makefile.in	Sat Aug 19 22:39:53 2017 +0200
+++ b/libtomcrypt/Makefile.in	Thu Jan 25 21:55:25 2018 +0800
@@ -9,7 +9,8 @@
 PLATFORM := $(shell uname | sed -e 's/_.*//')
 
 
-srcdir=.
+VPATH=@srcdir@
+srcdir=@srcdir@
 
 # Compiler and Linker Names
 #CC=gcc
--- a/libtommath/Makefile.in	Sat Aug 19 22:39:53 2017 +0200
+++ b/libtommath/Makefile.in	Thu Jan 25 21:55:25 2018 +0800
@@ -2,7 +2,8 @@
 #
 #Tom St Denis
 
-srcdir=.
+VPATH=@srcdir@
+srcdir=@srcdir@
 
 # So that libtommath can include Dropbear headers for options and m_burn()
 CFLAGS += -I$(srcdir) -I../libtomcrypt/src/headers/ -I$(srcdir)/../libtomcrypt/src/headers/ -I../ -I$(srcdir)/../
@@ -26,8 +27,6 @@
 
 coverage: LIBNAME:=-Wl,--whole-archive $(LIBNAME)  -Wl,--no-whole-archive
 
-include makefile.include
-
 LCOV_ARGS=--directory .
 
 #START_INS
--- a/svr-authpubkey.c	Sat Aug 19 22:39:53 2017 +0200
+++ b/svr-authpubkey.c	Thu Jan 25 21:55:25 2018 +0800
@@ -196,7 +196,7 @@
 	int ret = DROPBEAR_FAILURE;
 
 	if (line->len < MIN_AUTHKEYS_LINE || line->len > MAX_AUTHKEYS_LINE) {
-		TRACE(("checkpubkey: bad line length %d", line->len))
+		TRACE(("checkpubkey_line: bad line length %d", line->len))
 		return DROPBEAR_FAILURE;
 	}
 
@@ -261,7 +261,7 @@
 	
 	/* check for space (' ') character */
 	if (buf_getbyte(line) != ' ') {
-		TRACE(("checkpubkey: space character expected, isn't there"))
+		TRACE(("checkpubkey_line: space character expected, isn't there"))
 		goto out;
 	}
 
@@ -273,7 +273,7 @@
 	buf_setpos(line, pos);
 	buf_setlen(line, line->pos + len);
 
-	TRACE(("checkpubkey: line pos = %d len = %d", line->pos, line->len))
+	TRACE(("checkpubkey_line: line pos = %d len = %d", line->pos, line->len))
 
 	ret = cmp_base64_key(keyblob, keybloblen, (const unsigned char *) algo, algolen, line, NULL);
 
@@ -361,8 +361,8 @@
 		}
 		line_num++;
 
-		if (checkpubkey_line(line, line_num, filename,
-				algo, algolen, keyblob, keybloblen) == DROPBEAR_SUCCESS) {
+		ret = checkpubkey_line(line, line_num, filename, algo, algolen, keyblob, keybloblen);
+		if (ret == DROPBEAR_SUCCESS) {
 			break;
 		}