2020-03-11 18:46:33 +01:00
|
|
|
# Maintaining OpenSSL
|
2018-03-07 13:38:23 +01:00
|
|
|
|
2020-03-11 18:46:33 +01:00
|
|
|
This document describes how to update `deps/openssl/`.
|
2018-03-07 13:38:23 +01:00
|
|
|
|
2020-03-11 18:46:33 +01:00
|
|
|
## Requirements
|
2020-04-30 01:38:16 +02:00
|
|
|
* Linux environment.
|
2020-03-11 18:46:33 +01:00
|
|
|
* `perl` Only Perl version 5 is tested.
|
2020-04-30 01:38:16 +02:00
|
|
|
* `nasm` (<http://www.nasm.us/>) Version 2.11 or higher is needed.
|
|
|
|
* GNU `as` in binutils. Version 2.26 or higher is needed.
|
2020-03-11 18:46:33 +01:00
|
|
|
|
|
|
|
## 0. Check Requirements
|
2018-03-07 13:38:23 +01:00
|
|
|
|
2020-05-22 08:33:40 +02:00
|
|
|
```console
|
2020-03-11 18:46:33 +01:00
|
|
|
% perl -v
|
2018-03-07 13:38:23 +01:00
|
|
|
|
|
|
|
This is perl 5, version 22, subversion 1 (v5.22.1) built for
|
|
|
|
x86_64-linux-gnu-thread-multi
|
|
|
|
(with 60 registered patches, see perl -V for more detail)
|
|
|
|
|
2020-03-11 18:46:33 +01:00
|
|
|
% as --version
|
2018-03-07 13:38:23 +01:00
|
|
|
GNU assembler (GNU Binutils for Ubuntu) 2.26.1
|
|
|
|
Copyright (C) 2015 Free Software Foundation, Inc.
|
|
|
|
...
|
2020-03-11 18:46:33 +01:00
|
|
|
% nasm -v
|
2018-03-07 13:38:23 +01:00
|
|
|
NASM version 2.11.08
|
|
|
|
```
|
2019-03-01 18:55:38 +01:00
|
|
|
|
2020-03-11 18:46:33 +01:00
|
|
|
## 1. Obtain and extract new OpenSSL sources
|
2018-03-07 13:38:23 +01:00
|
|
|
|
2020-04-06 05:26:24 +02:00
|
|
|
Get a new source from <https://www.openssl.org/source/> and extract
|
2018-03-07 13:38:23 +01:00
|
|
|
all files into `deps/openssl/openssl`. Then add all files and commit
|
|
|
|
them.
|
2020-05-22 08:33:40 +02:00
|
|
|
```console
|
2020-03-11 18:46:33 +01:00
|
|
|
% cd deps/openssl/
|
|
|
|
% rm -rf openssl
|
|
|
|
% tar zxf ~/tmp/openssl-1.1.0h.tar.gz
|
|
|
|
% mv openssl-1.1.0h openssl
|
|
|
|
% git add --all openssl
|
|
|
|
% git commit openssl
|
2018-03-07 13:38:23 +01:00
|
|
|
````
|
|
|
|
|
2020-04-30 01:38:16 +02:00
|
|
|
The commit message can be written as (with the openssl version set
|
|
|
|
to the relevant value):
|
2020-03-11 18:46:33 +01:00
|
|
|
```text
|
2018-03-07 13:38:23 +01:00
|
|
|
deps: upgrade openssl sources to 1.1.0h
|
|
|
|
|
2019-03-01 18:55:38 +01:00
|
|
|
This updates all sources in deps/openssl/openssl by:
|
|
|
|
$ cd deps/openssl/
|
|
|
|
$ rm -rf openssl
|
|
|
|
$ tar zxf ~/tmp/openssl-1.1.0h.tar.gz
|
|
|
|
$ mv openssl-1.1.0h openssl
|
|
|
|
$ git add --all openssl
|
|
|
|
$ git commit openssl
|
2018-03-07 13:38:23 +01:00
|
|
|
```
|
2019-03-01 18:55:38 +01:00
|
|
|
|
2020-03-11 18:46:33 +01:00
|
|
|
## 2. Execute `make` in `deps/openssl/config` directory
|
2019-03-01 18:55:38 +01:00
|
|
|
|
|
|
|
Use `make` to regenerate all platform dependent files in
|
|
|
|
`deps/openssl/config/archs/`:
|
2020-05-22 08:33:40 +02:00
|
|
|
```console
|
2020-04-21 19:39:39 +02:00
|
|
|
% make -C deps/openssl/config
|
2018-03-07 13:38:23 +01:00
|
|
|
```
|
|
|
|
|
2020-03-11 18:46:33 +01:00
|
|
|
## 3. Check diffs
|
2018-03-07 13:38:23 +01:00
|
|
|
|
2020-04-30 01:38:16 +02:00
|
|
|
Check diffs to ensure updates are right. Even if there are no updates in openssl
|
|
|
|
sources, `buildinf.h` files will be updated because they have timestamp
|
2018-03-07 13:38:23 +01:00
|
|
|
data in them.
|
2020-05-22 08:33:40 +02:00
|
|
|
```console
|
2020-04-21 19:39:39 +02:00
|
|
|
% git diff -- deps/openssl
|
2018-03-07 13:38:23 +01:00
|
|
|
```
|
|
|
|
|
2020-04-30 01:38:16 +02:00
|
|
|
*Note*: On Windows, OpenSSL Configure generates a `makefile` that can be
|
|
|
|
used for the `nmake` command. The `make` command in step 2 (above) uses
|
2018-03-07 13:38:23 +01:00
|
|
|
`Makefile_VC-WIN64A` and `Makefile_VC-WIN32` that are manually
|
|
|
|
created. When source files or build options are updated in Windows,
|
|
|
|
it needs to change these two Makefiles by hand. If you are not sure,
|
|
|
|
please ask @shigeki for details.
|
2018-11-20 19:16:05 +01:00
|
|
|
|
2020-03-11 18:46:33 +01:00
|
|
|
## 4. Commit and make test
|
2018-03-07 13:38:23 +01:00
|
|
|
|
|
|
|
Update all architecture dependent files. Do not forget to git add or remove
|
2020-04-30 01:38:16 +02:00
|
|
|
files if they are changed before committing:
|
2020-05-22 08:33:40 +02:00
|
|
|
```console
|
2020-03-11 18:46:33 +01:00
|
|
|
% git add deps/openssl/config/archs
|
2020-04-01 07:28:34 +02:00
|
|
|
% git add deps/openssl/openssl/include/crypto/bn_conf.h
|
|
|
|
% git add deps/openssl/openssl/include/crypto/dso_conf.h
|
2020-03-11 18:46:33 +01:00
|
|
|
% git add deps/openssl/openssl/include/openssl/opensslconf.h
|
|
|
|
% git commit
|
2018-03-07 13:38:23 +01:00
|
|
|
```
|
|
|
|
|
2020-04-30 01:38:16 +02:00
|
|
|
The commit message can be written as (with the openssl version set
|
|
|
|
to the relevant value):
|
2020-03-11 18:46:33 +01:00
|
|
|
```text
|
2019-03-01 18:55:38 +01:00
|
|
|
deps: update archs files for OpenSSL-1.1.0
|
|
|
|
|
2020-04-01 23:21:21 +02:00
|
|
|
After an OpenSSL source update, all the config files need to be
|
|
|
|
regenerated and committed by:
|
2020-04-21 19:39:39 +02:00
|
|
|
$ make -C deps/openssl/config
|
2019-03-01 18:55:38 +01:00
|
|
|
$ git add deps/openssl/config/archs
|
2020-04-01 07:28:34 +02:00
|
|
|
$ git add deps/openssl/openssl/include/crypto/bn_conf.h
|
|
|
|
$ git add deps/openssl/openssl/include/crypto/dso_conf.h
|
2019-03-01 18:55:38 +01:00
|
|
|
$ git add deps/openssl/openssl/include/openssl/opensslconf.h
|
|
|
|
$ git commit
|
2018-03-07 13:38:23 +01:00
|
|
|
```
|
|
|
|
|
2020-04-30 01:38:16 +02:00
|
|
|
Finally, build Node.js and run the tests.
|