diff options
author | Matt Johnston <matt@ucc.asn.au> | 2020-06-26 20:41:34 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2020-06-26 20:41:34 +0800 |
commit | 0473f8923b8eecaaa10aa84317f0fed367521460 (patch) | |
tree | a4929f19232bc73b2b2fab54ca1477f1742341ea | |
parent | 005152e5a3704a22a182e6510a173e2dad7909b2 (diff) | |
download | dropbear-0473f8923b8eecaaa10aa84317f0fed367521460.tar.gz |
Some notes on style
-rw-r--r-- | DEVELOPING.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/DEVELOPING.md b/DEVELOPING.md index ff4d100..1846b15 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -35,6 +35,30 @@ runtime (doesn't work for server as of June 2020). Enabling/disabling algorithms is done in [localoptions.h](localoptions.h), see [default_options.h](default_options.h). +## Style + +Source code is indented with tabs, width set to 4 (though width shouldn't +matter much). Braces are on the same line as functions/loops/if - try +to keep consistency with existing code. + +All `if` statements should have braces, no exceptions. + +Avoid using pointer arithmetic, instead the functions in +[buffer.h](buffer.h) should be used. + +Some Dropbear platforms have old compilers. +Variable declarations must be at the top of a scope and +comments must be `/* */` rather than `//`. + +Pointer variables should be initialised to NULL - it can reduce the +severity of bugs. + +## Third party code + +Libtomcrypt and libtommath are periodically synced from upstream, so +avoid making changes to that code which will need to be maintained. +Improvements can be sent upstream to the libtom project. + ## Non-root user Dropbear server will run fine as a non-root user, allowing logins only for |