1Please feel free to contribute patches; here are the basic guidelines to hack
2along with us!
3
4Please work from a git tree by cloning the repo:
5
6  git clone https://github.com/ioerror/tlsdate.git
7
8Please file bugs on the tlsdate issue tracker:
9
10  https://github.com/ioerror/tlsdate/issues
11
12Please use the github pull request feature when possible.
13
14The current build status is available as a handy image:
15
16[![Build Status](https://secure.travis-ci.org/ioerror/tlsdate.png?branch=master)](http://travis-ci.org/ioerror/tlsdate)
17
18Continuous integration is available for a number of platforms:
19
20  https://jenkins.torproject.org/job/tlsdate-ci-linux/
21  https://travis-ci.org/ioerror/tlsdate
22  http://build.chromium.org/p/chromiumos/waterfall
23
24White Space:
25
26  Spaces only, no tabs; all tabs must die
27  No stray spaces at the end of lines
28  Generally try not to add excessive empty white space
29
30Documentation:
31
32  Document all functions with doxygen style comments
33
34Ensuring Correctness:
35
36  Test your patches and ensure:
37
38    No compiler warnings or errors
39    No linker warnings or errors
40
41  Test your improved copy of tlsdate extensively
42
43Security:
44
45  tlsdate is security sensitive - please consider where you add code and in
46  what context it will run. When possible, run with the least privilege as is
47  possible.
48
49Proactively find bugs:
50
51 Run your copy of tlsdate under valgrind
52
53Weird but meaningful conventions are prefered in tlsdate. We prefer attention
54to detail:
55
56  if ( NULL == foo (void) )
57  {
58    bar (void);
59  }
60
61Over quick, hard to read and potentilly incorrect:
62
63  if (foo(void)==NULL))
64    bar();
65
66Define magic numbers and explain their origin:
67
68  // As taken from RFC 3.14
69  #define MAGIC_NUMBER 23 // This goes in foo.h
70  ptr = malloc (MAGIC_NUMBER);
71
72Rather than just throwing them about in code:
73
74  ptr = malloc (23);
75
76It is almost always prefered to use dynamically allocated memory:
77
78  widget_ptr = malloc (WIDGET_SIZE);
79
80Try to avoid static allocations like the following:
81
82  char widget[WIDGET_SIZE];
83
84Try to use unsigned values unless an API requires signed values:
85
86  uint32_t server_time_s;
87
88Please provide relevant CHANGELOG entries for all changes.
89Please remove items from the TODO file as they are completed.
90Please provide unittest cases.
91
92When submitting patches via email, please use `git format-patch` to format
93patches:
94
95  git format-patch 9a61fcba9bebc3fa2d91c9f79306bf316c59cbcc
96
97Email patches with a GnuPG signature whenever possible.
98
99When applying patches, please use `git am` to apply patches:
100
101  git am -i 0001-add-TODO-item.patch
102
103If `git format-patch` is not possible, please send a unified diff.
104
105When in doubt, please consult the Tor HACKING guide:
106
107  https://gitweb.torproject.org/tor.git/blob/HEAD:/doc/HACKING
108
109