xref: /freebsd/crypto/openssl/HACKING.md (revision b077aed33b7b6aefca7b17ddb250cf521f938613)
1*b077aed3SPierre ProncheryMODIFYING OPENSSL SOURCE
2*b077aed3SPierre Pronchery========================
3*b077aed3SPierre Pronchery
4*b077aed3SPierre ProncheryThis document describes the way to add custom modifications to OpenSSL sources.
5*b077aed3SPierre Pronchery
6*b077aed3SPierre Pronchery If you are adding new public functions to the custom library build, you need to
7*b077aed3SPierre Pronchery either add a prototype in one of the existing OpenSSL header files;
8*b077aed3SPierre Pronchery or provide a new header file and edit
9*b077aed3SPierre Pronchery [Configurations/unix-Makefile.tmpl](Configurations/unix-Makefile.tmpl)
10*b077aed3SPierre Pronchery to pick up that file.
11*b077aed3SPierre Pronchery
12*b077aed3SPierre Pronchery After that perform the following steps:
13*b077aed3SPierre Pronchery
14*b077aed3SPierre Pronchery    ./Configure -Werror --strict-warnings [your-options]
15*b077aed3SPierre Pronchery    make update
16*b077aed3SPierre Pronchery    make
17*b077aed3SPierre Pronchery    make test
18*b077aed3SPierre Pronchery
19*b077aed3SPierre Pronchery `make update` ensures that your functions declarations are added to
20*b077aed3SPierre Pronchery `util/libcrypto.num` or `util/libssl.num`.
21*b077aed3SPierre Pronchery If you plan to submit the changes you made to OpenSSL
22*b077aed3SPierre Pronchery (see [CONTRIBUTING.md](CONTRIBUTING.md)), it's worth running:
23*b077aed3SPierre Pronchery
24*b077aed3SPierre Pronchery    make doc-nits
25*b077aed3SPierre Pronchery
26*b077aed3SPierre Pronchery after running `make update` to ensure that documentation has correct format.
27*b077aed3SPierre Pronchery
28*b077aed3SPierre Pronchery `make update` also generates files related to OIDs (in the `crypto/objects/`
29*b077aed3SPierre Pronchery folder) and errors.
30*b077aed3SPierre Pronchery If a merge error occurs in one of these generated files then the
31*b077aed3SPierre Pronchery generated files need to be removed and regenerated using `make update`.
32*b077aed3SPierre Pronchery To aid in this process the generated files can be committed separately
33*b077aed3SPierre Pronchery so they can be removed easily.
34