norbert's Makefile.in and crypt.c patches

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@48 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Aris Adamantiadis
2005-10-26 21:46:48 +00:00
parent 7b416e5c52
commit cddc5d6889
2 changed files with 37 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
SHELL = /bin/sh SHELL = /bin/sh
VPATH = @srcdir@ VPATH = @srcdir@
subdirs = libssh/ sftp_server/ subdirs = libssh sftp_server
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
top_builddir = . top_builddir = .
srcdir = @srcdir@ srcdir = @srcdir@
@@ -14,26 +14,41 @@ libdir = $(prefix)/lib/
mandir = $(prefix)/man/man1 mandir = $(prefix)/man/man1
CC = @CC@ CC = @CC@
CFLAGS = @CFLAGS@ -Iinclude/ -Wall CFLAGS = @CFLAGS@ -Iinclude -Wall
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = -lssh -Llibssh/ LIBS = -lssh -Llibssh
INSTALL = @INSTALL@ INSTALL = @INSTALL@
LN= @LN_S@ LN = @LN_S@
LIBTOOL= @LIBTOOL@ LIBTOOL = @LIBTOOL@
OBJECTS= sample.o samplesshd.o OBJECTS = sample.o samplesshd.o
VERSION=0.12-dev APPS = samplessh samplesftp samplesshd
DISTLIB=libssh-$(VERSION) VERSION = 0.12-dev
CONFIG=include/libssh/config.h DISTLIB = libssh-$(VERSION)
all: $(CONFIG) $(OBJECTS) CONFIG = include/libssh/config.h
.PHONY: all
all: $(CONFIG) SUBDIRS $(OBJECTS) $(APPS)
.PHONY: SUBDIRS
SUBDIRS:
@for dir in ${subdirs}; do \ @for dir in ${subdirs}; do \
(cd $$dir && $(MAKE) all) \ (cd $$dir && $(MAKE) all) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail" done && test -z "$$fail"
$(LIBTOOL) --mode=link $(CC) -o samplessh sample.o $(LDFLAGS) $(LIBS)
$(LN) -sf samplessh samplesftp % : %.o
$(LIBTOOL) --mode=link $(CC) -o samplesshd samplesshd.o $(LDFLAGS) $(LIBS) $(LIBTOOL) --mode=link $(CC) -o $@ $< $(LDFLAGS) $(LIBS)
samplessh: sample.o
$(LIBTOOL) --mode=link $(CC) -o $@ $< $(LDFLAGS) $(LIBS)
samplesftp: samplessh
$(LN) -f samplessh samplesftp
$(CONFIG): $(CONFIG):
$(LN) -f ../../config.h $(CONFIG) $(LN) -f ../../config.h $(CONFIG)
.PHONY: dist
dist: dist:
rm -fr $(DISTLIB) rm -fr $(DISTLIB)
mkdir $(DISTLIB) mkdir $(DISTLIB)
@@ -52,6 +67,8 @@ dist:
cp *.c COPYING README AUTHORS CHANGELOG $(DISTLIB)/ cp *.c COPYING README AUTHORS CHANGELOG $(DISTLIB)/
cp doc/* $(DISTLIB)/doc/ cp doc/* $(DISTLIB)/doc/
tar czf $(DISTLIB).tgz $(DISTLIB)/ tar czf $(DISTLIB).tgz $(DISTLIB)/
.PHONY: install
install: all install: all
@for dir in ${subdirs}; do \ @for dir in ${subdirs}; do \
(cd $$dir && $(MAKE) install) \ (cd $$dir && $(MAKE) install) \
@@ -65,6 +82,8 @@ install: all
$(INSTALL) include/libssh/server.h $(incldir)/libssh/ $(INSTALL) include/libssh/server.h $(incldir)/libssh/
$(INSTALL) include/libssh/ssh2.h $(incldir)/libssh/ $(INSTALL) include/libssh/ssh2.h $(incldir)/libssh/
$(INSTALL) include/libssh/ssh1.h $(incldir)/libssh/ $(INSTALL) include/libssh/ssh1.h $(incldir)/libssh/
.PHONY: clean
clean: clean:
$(LIBTOOL) --mode=clean rm -f *~ *.o samplessh samplesftp samplesshd include/libssh/config.h $(LIBTOOL) --mode=clean rm -f *~ *.o samplessh samplesftp samplesshd include/libssh/config.h
@for dir in ${subdirs}; do \ @for dir in ${subdirs}; do \
@@ -72,10 +91,10 @@ clean:
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail" done && test -z "$$fail"
.PHONY: distclean
distclean: clean distclean: clean
@for dir in ${subdirs}; do \ @for dir in ${subdirs}; do \
(cd $$dir && $(MAKE) distclean) \ (cd $$dir && $(MAKE) distclean) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail" done && test -z "$$fail"
rm -f Makefile config.h config.status config.cache config.log libtool rm -f Makefile config.h config.status config.cache config.log libtool

View File

@@ -36,12 +36,12 @@ MA 02111-1307, USA. */
#include "libssh/crypto.h" #include "libssh/crypto.h"
u32 packet_decrypt_len(SSH_SESSION *session, char *crypted){ u32 packet_decrypt_len(SSH_SESSION *session, char *crypted){
u32 *decrypted; u32 decrypted;
if(session->current_crypto) if(session->current_crypto)
packet_decrypt(session,crypted,session->current_crypto->in_cipher->blocksize); packet_decrypt(session,crypted,session->current_crypto->in_cipher->blocksize);
decrypted=(u32 *)crypted; memcpy(&decrypted,crypted,sizeof(decrypted));
ssh_say(3,"size decrypted : %lx\n",ntohl(*decrypted)); ssh_say(3,"size decrypted : %lx\n",ntohl(decrypted));
return ntohl(*decrypted); return ntohl(decrypted);
} }
int packet_decrypt(SSH_SESSION *session, void *data,u32 len){ int packet_decrypt(SSH_SESSION *session, void *data,u32 len){