Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SCO and SSH(d)

0 views
Skip to first unread message

Anders Gulden Olstad

unread,
Dec 16, 1999, 3:00:00 AM12/16/99
to
This has maybe been discussed before - but looking at the portability list
for SSH1, SCO Unix is listed as "client only".

Question - has anyone managed to compile the whole SSH1 source, including
sshd on a SCO OpenServer5?

I've tried with gcc-2.7.2.3 (Skunk98) with and without SCO OpenServer Dev.Sys.


tt

unread,
Dec 16, 1999, 3:00:00 AM12/16/99
to
Anders Gulden Olstad wrote:

NO i tried also , but it fails on somepoint.

tt

Buddy Z

unread,
Dec 16, 1999, 3:00:00 AM12/16/99
to
Anders Gulden Olstad <ande...@alge.anart.no> wrote in message
news:rpfa38...@jeeves.itte.net...

> This has maybe been discussed before - but looking at the portability list
> for SSH1, SCO Unix is listed as "client only".

Not true. SSH1 assembles with just a little hiccup.
Two tips (I used the same version of gcc to compile 1.2.26):
1. Configure either under X or using without-x option
2. Modify auth-passwd.c to comment out this (check for an empty password ):
/*
if ( (!pr->uflg.fg_nullpw || !pr->ufld.fd_nullpw)
&& !pr->uflg.fg_pw_admin_num
&& strcmp(correct_passwd,"")==0 )
{
debug("User %.100s not permitted to login with null passwd",
saved_pw_name);
packet_send_debug("\n\tNot permitted null passwd.");
return 0;
}
*/

May be there's another workaround but this one worked fine for me..

SSH2 (2.0.13) is what I stumbled on.
Here's what I get:
...
Making all in tests

-DHAVE_CONFIG_H -I. -I. -I../.. -I. -I. -I.. -I./.. -I../.. -I../..
-I../sshmath -I./../sshmath -I../zlib -I./../zlib -I../trq -I.
/../trq -g -Wall -UM_I86SM -c sshbufaux.c
/usr/tmp/cca006wL.s:1594:invalid register for instruction: %edx in rolw
/usr/tmp/cca006wL.s:1594:invalid register for instruction: %edx in rolw
*** Error code 1 (bu21)

There are only two places in the package where I found "rolw" -
./lib/sshutil/sshgetput.c and ./lib/sshutil/sshgetput.h
Files contain stuff like this (which I don't understand):
__asm__ volatile ("movl (%1), %0; rolw $8, %0; roll $16, %0; rolw $8, %0;"

Does anybody have any ideas?

Buddy Z

Anders Gulden Olstad

unread,
Dec 17, 1999, 3:00:00 AM12/17/99
to
Buddy Z <diespamme...@wcs.ab.ca> wrote:
> Not true. SSH1 assembles with just a little hiccup.
> Two tips (I used the same version of gcc to compile 1.2.26):
> 1. Configure either under X or using without-x option
> 2. Modify auth-passwd.c to comment out this (check for an empty password ):
[snip]

Thanks - I managed to install and compile both ssh and sshd. Does this
modification of auth-passwd.c affect the security of the sshd in anyway?

I also had to install SCO Development System i order to get 'nm'. Is
this available form other sources than the Dev.Sys? (Which is not too
inexpencive...)

...or...

a way to let a precompiled binary of sshd start up and generate
a new '/etc/ssh_host_key'? (I thought I could put my precompiled binaries
directly on a new computer - but it failed when trying to read
'/etc/ssh_host_key'.)

Anyone...?


Robert Lipe

unread,
Dec 19, 1999, 3:00:00 AM12/19/99
to
"Buddy Z" <diespamme...@wcs.ab.ca> writes:

>Anders Gulden Olstad <ande...@alge.anart.no> wrote in message
>news:rpfa38...@jeeves.itte.net...
>> This has maybe been discussed before - but looking at the portability list
>> for SSH1, SCO Unix is listed as "client only".

sshd and ssh both work fine for me. I use it daily.

>/usr/tmp/cca006wL.s:1594:invalid register for instruction: %edx in rolw
>/usr/tmp/cca006wL.s:1594:invalid register for instruction: %edx in rolw

The ssh source is broken when compiling with GCC and a strict assembler
such as OpenServer's native one or newer versions of GAS. See attached
patch.


From rob...@sco.com Sat Oct 2 04:21:25 1999
Date: Sat, 2 Oct 1999 04:21:25 -0500
From: Robert Lipe <rob...@sco.com>
To: ssh-...@ssh.fi
Subject: Re: ssh 2.0.13 & illegal asms
Message-ID: <1999100204...@rjlhome.sco.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0pre1i
Status: RO
Content-Length: 2793
Lines: 66

Yesterday I submitted a patch to SSH 2.0.13. Please replace it with
this one.

One of my peers who is much more the IA32 assembler wizard than myself
explained what these functions were trying to do and why my patch was
misguided. He explained that they were just doing byteswapping.

> But neither is going to work right. They're pulling a trick here which
> *requires* the assembler to do what SCO's fails to do: accept a size
> mismatch between opcode and operand.
>
> They're trying to build code similar to:
>
> // __byte__--byte--__byte__--byte--
> movl (arg), %eax // eax = wwwwwwwwxxxxxxxxyyyyyyyyzzzzzzzz
> rolw $8, %ax // swap bytes: eax = wwwwwwwwxxxxxxxxzzzzzzzzyyyyyyyy
> roll $16, %eax // swap words: eax = zzzzzzzzyyyyyyyywwwwwwwwxxxxxxxx
> rolw $8, %ax // swap bytes: eax = zzzzzzzzyyyyyyyyxxxxxxxxwwwwwwww
>
> They definitely intend to manipulate only the low two bytes in
> instructions #2 and 4.
>
> Unfortunately, this requires some textual manipulation of the argument
> "%0", and I don't know whether that's possible in the context of the C
> preprocessor + "__asm__" handling. Their previous solution, now
> provoking warnings from GNU and failures from SCO, was to fudge it by
> spelling it "%eax" all the time; providing the size information in the
> opcode name; and hoping that the assembler would forgive the mismatch.

With that in mind, I believe thw following to be a better fix. It adjusts
the constraints on the asm operands to more accurately reflect what we're
trying to do.


--- sshgetput.c_ Mon Feb 8 02:32:59 1999
+++ sshgetput.c Thu Sep 30 20:29:12 1999
@@ -47,7 +47,7 @@
SshUInt32 SSH_GET_32BIT(const unsigned char *cp) {
SshUInt32 result; - __asm__ volatile ("movl (%1), %0; rolw $8, %0; roll $16, %0; rolw $8, %0;"
+ __asm__ volatile ("movl (%1), %0; rolw $8, %w0; roll $16, %0; rolw $8, %w0;"
: "=&r" (result)
: "r" (cp));
return result;
--- sshgetput.h_ Thu Sep 30 20:23:09 1999
+++ sshgetput.h Thu Sep 30 20:30:06 1999
@@ -181,7 +181,7 @@
#define SSH_GET_32BIT(cp) \
({ \
SshUInt32 __v__; \
- __asm__ volatile ("movl (%1), %0; rolw $8, %0; roll $16, %0; rolw $8, %0;" \
+ __asm__ volatile ("movl (%1), %0; rolw $8, %w0; roll $16, %0; rolw $8, %w0;" \
: "=&r" (__v__) \
: "r" (cp)); \
__v__; \


Imposing the additional (word) constraint on the zero't argument does indeed
result in assembly code like this:

movl (%edx), %eax; rolw $8, %ax; roll $16, %eax; rolw $8, %ax;


Thanx to the person that pointed this out. Once I had that hint,
expressing it in GCC syntax wasn't too hard.

RJL


0 new messages