Mercurial > dropbear
comparison DEVELOPING.md @ 1730:57226fc75cb5
Some notes on style
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 26 Jun 2020 20:41:34 +0800 |
parents | 295377ecbf49 |
children |
comparison
equal
deleted
inserted
replaced
1729:f091f7536aa5 | 1730:57226fc75cb5 |
---|---|
33 runtime (doesn't work for server as of June 2020). | 33 runtime (doesn't work for server as of June 2020). |
34 | 34 |
35 Enabling/disabling algorithms is done in [localoptions.h](localoptions.h), | 35 Enabling/disabling algorithms is done in [localoptions.h](localoptions.h), |
36 see [default_options.h](default_options.h). | 36 see [default_options.h](default_options.h). |
37 | 37 |
38 ## Style | |
39 | |
40 Source code is indented with tabs, width set to 4 (though width shouldn't | |
41 matter much). Braces are on the same line as functions/loops/if - try | |
42 to keep consistency with existing code. | |
43 | |
44 All `if` statements should have braces, no exceptions. | |
45 | |
46 Avoid using pointer arithmetic, instead the functions in | |
47 [buffer.h](buffer.h) should be used. | |
48 | |
49 Some Dropbear platforms have old compilers. | |
50 Variable declarations must be at the top of a scope and | |
51 comments must be `/* */` rather than `//`. | |
52 | |
53 Pointer variables should be initialised to NULL - it can reduce the | |
54 severity of bugs. | |
55 | |
56 ## Third party code | |
57 | |
58 Libtomcrypt and libtommath are periodically synced from upstream, so | |
59 avoid making changes to that code which will need to be maintained. | |
60 Improvements can be sent upstream to the libtom project. | |
61 | |
38 ## Non-root user | 62 ## Non-root user |
39 | 63 |
40 Dropbear server will run fine as a non-root user, allowing logins only for | 64 Dropbear server will run fine as a non-root user, allowing logins only for |
41 that user. Password authentication probably won't work (can't read shadow | 65 that user. Password authentication probably won't work (can't read shadow |
42 passwords). You will need to create hostkeys that are readable. | 66 passwords). You will need to create hostkeys that are readable. |