[PATCH] Public keys options

Frédéric Moulins ffrrrr at gmail.com
Sun Jun 1 23:38:49 WST 2008


Hello,

On Fri, 30 May 2008 13:13:53 -0500
Rob Landley <rob at landley.net> wrote:

> On Thursday 29 May 2008 17:21:45 Frédéric Moulins wrote:
> > Parsing code of options string comes from OpenSSH.
> 
> So who exactly is that code copyright by?  Your patch doesn't contain
> any copyright notices, or record this information in any way that I
> can see, and it's taking rather large chunks of code.  Is this "BSD
> with advertising clause" code that needs the advertising clause?
> 
Yes, sorry for being so vague. 
The part that parse and record options is from auth-options.c of
OpenSSH with this copyright :
/*
 * Author: Tatu Ylonen <ylo at cs.hut.fi>
 * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
 *                    All rights reserved
 * As far as I am concerned, the code I have written for this software
 * can be used freely for any purpose.  Any derived versions of this
 * software must be clearly marked as such, and if the derived work is
 * incompatible with the protocol description in the RFC file, it must
be
 * called by a name other than "ssh" or "Secure Shell".
 */
The part skipping options string during parsing the key line is from
auth2-pubkey.c, "Copyright (c) 2000 Markus Friedl" under a 2-term BSD
license.

I detailed it in the patch attached with this email.
For the remaining bits I added, they can be used under the same license
dropbear uses now (and I would be happy to see this code in
dropbear :) ).

> Also, you might want to read:
> http://www.chris-lott.org/resources/cstyle/ifdefs.pdf
> 
> And the section of the old http://www.linuxjournal.com/article/5780
> article starting with "No ifdefs in .c Code", about how to move
> #ifdefs into headers so the functions aren't littered with them.
> Just a thought...
> 
Tank you :)
Please see the new patch.

> Personally, I tend to have symbols #defined to a constant 0 or 1
> depending on whether or not a function is enabled, and then just use
> if(SYMBOL) as a guard and let the compiler's dead code eliminator
> take it out for me at compile time (because if(0) {blah;} shouldn't
> put any code in the resulting .o file with any optimizer worth its
> salt.  Borland C for DOS managed simple dead code elimination 20
> years ago...)
> 
> Rob

I used macros for functions with return value (typically simple tests
with 0|1 returned) when functions are not enabled, as I don't know if
there is a better way.

I also included auth.h explicitly in .c files (tcpfwd.c, x11fwd.c,...)
where these functions are used. auth.h is always inluded indirectly
(through session.h or chansession.h) but it's for a bit more clarity.

Regards


fred
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pubkey_options-no_ifdefs-dropbear-0.51.patch
Type: text/x-patch
Size: 18917 bytes
Desc: not available
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20080601/590c11d1/attachment.bin 


More information about the Dropbear mailing list