aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/sddm.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2021-03-26 02:30:47 -0400
committerLeo Famulari <leo@famulari.name>2021-03-26 04:05:05 -0400
commitf0357df8c54e3a4232476211b0fb8f71cf1df7a8 (patch)
tree603cbd0c475db61b6ca6de41136a43c64bdfd84f /gnu/services/sddm.scm
parent4c56620555a7f1235ef4e6f5b9ad2cfe87403c55 (diff)
downloadguix-f0357df8c54e3a4232476211b0fb8f71cf1df7a8.tar.gz
guix-f0357df8c54e3a4232476211b0fb8f71cf1df7a8.zip
gnu: SVT-AV1: Update URLs.
* gnu/packages/video.scm (svt-av1)[source, home-page]: Update URLs.
Diffstat (limited to 'gnu/services/sddm.scm')
0 files changed, 0 insertions, 0 deletions
'width: 100.0%;'/> -rw-r--r--LICENSES/GPLv3.txt674
-rw-r--r--Makefile42
-rw-r--r--README.txt10
-rw-r--r--README_pl.txt6
-rw-r--r--config.c287
-rw-r--r--exceptions.cpp71
-rw-r--r--exceptions.hpp14
-rw-r--r--hello.cpp40
-rw-r--r--iniparser-4.1/.gitignore11
-rw-r--r--iniparser-4.1/.travis.yml9
-rw-r--r--iniparser-4.1/AUTHORS6
-rw-r--r--iniparser-4.1/FAQ-en.md37
-rw-r--r--iniparser-4.1/FAQ-zhcn.md27
-rw-r--r--iniparser-4.1/INSTALL15
-rw-r--r--iniparser-4.1/LICENSE40
-rw-r--r--iniparser-4.1/Makefile86
-rw-r--r--iniparser-4.1/README.md44
-rw-r--r--iniparser-4.1/doc/Makefile16
-rw-r--r--iniparser-4.1/doc/iniparser.dox81
-rw-r--r--iniparser-4.1/doc/iniparser.main207
-rw-r--r--iniparser-4.1/example/Makefile27
-rw-r--r--iniparser-4.1/example/iniexample.c104
-rw-r--r--iniparser-4.1/example/parse.c24
-rw-r--r--iniparser-4.1/example/twisted-errors.ini9
-rw-r--r--iniparser-4.1/example/twisted-genhuge.py12
-rw-r--r--iniparser-4.1/example/twisted-ofkey.ini66
-rw-r--r--iniparser-4.1/example/twisted-ofval.ini56
-rw-r--r--iniparser-4.1/example/twisted.ini131
-rw-r--r--iniparser-4.1/src/dictionary.c406
-rw-r--r--iniparser-4.1/src/dictionary.h190
-rw-r--r--iniparser-4.1/src/getline.c58
-rw-r--r--iniparser-4.1/src/iniparser.c938
-rw-r--r--iniparser-4.1/src/iniparser.h386
-rw-r--r--iniparser-4.1/test/CuTest.c348
-rw-r--r--iniparser-4.1/test/CuTest.h121
-rw-r--r--iniparser-4.1/test/CuTest_license.txt38
-rw-r--r--iniparser-4.1/test/Makefile35
-rwxr-xr-xiniparser-4.1/test/make-tests.sh56
-rw-r--r--iniparser-4.1/test/ressources/bad_ini/ends_well.ini6
-rw-r--r--iniparser-4.1/test/ressources/bad_ini/twisted-errors.ini9
-rw-r--r--iniparser-4.1/test/ressources/bad_ini/twisted-ofkey.ini66
-rw-r--r--iniparser-4.1/test/ressources/bad_ini/twisted-ofval.ini56
-rw-r--r--iniparser-4.1/test/ressources/good_ini/empty.ini0
-rw-r--r--iniparser-4.1/test/ressources/good_ini/spaced.ini16
-rw-r--r--iniparser-4.1/test/ressources/good_ini/spaced2.ini20
-rw-r--r--iniparser-4.1/test/ressources/good_ini/twisted.ini131
-rw-r--r--iniparser-4.1/test/test_dictionary.c237
-rw-r--r--iniparser-4.1/test/test_iniparser.c698
-rw-r--r--messages.c36
-rw-r--r--misc.c68
-rw-r--r--openssl-1.1.0h/.gitattributes3
-rw-r--r--openssl-1.1.0h/.gitignore174
-rw-r--r--openssl-1.1.0h/.travis-apt-pin.preferences15
-rw-r--r--openssl-1.1.0h/.travis-create-release.sh11
-rw-r--r--openssl-1.1.0h/.travis.yml204
-rw-r--r--openssl-1.1.0h/ACKNOWLEDGEMENTS2
-rw-r--r--openssl-1.1.0h/AUTHORS21
-rw-r--r--openssl-1.1.0h/CHANGES12586
-rw-r--r--openssl-1.1.0h/CONTRIBUTING54
-rw-r--r--openssl-1.1.0h/Configurations/00-base-templates.conf293
-rw-r--r--openssl-1.1.0h/Configurations/10-main.conf1884
-rw-r--r--openssl-1.1.0h/Configurations/50-djgpp.conf15
-rw-r--r--openssl-1.1.0h/Configurations/50-haiku.conf29
-rw-r--r--openssl-1.1.0h/Configurations/50-masm.conf17
-rw-r--r--openssl-1.1.0h/Configurations/90-team.conf112
-rw-r--r--openssl-1.1.0h/Configurations/INTERNALS.Configure136
-rw-r--r--openssl-1.1.0h/Configurations/README721
-rw-r--r--openssl-1.1.0h/Configurations/README.design641
-rw-r--r--openssl-1.1.0h/Configurations/common.tmpl229
-rw-r--r--openssl-1.1.0h/Configurations/descrip.mms.tmpl780
-rw-r--r--openssl-1.1.0h/Configurations/unix-Makefile.tmpl1044
-rw-r--r--openssl-1.1.0h/Configurations/unix-checker.pm22
-rw-r--r--openssl-1.1.0h/Configurations/windows-checker.pm22
-rw-r--r--openssl-1.1.0h/Configurations/windows-makefile.tmpl621
-rwxr-xr-xopenssl-1.1.0h/Configure2806
-rw-r--r--openssl-1.1.0h/FAQ2
-rw-r--r--openssl-1.1.0h/INSTALL964
-rw-r--r--openssl-1.1.0h/LICENSE125
-rw-r--r--openssl-1.1.0h/Makefile.shared521
-rw-r--r--openssl-1.1.0h/NEWS868
-rw-r--r--openssl-1.1.0h/NOTES.DJGPP48
-rw-r--r--openssl-1.1.0h/NOTES.PERL119
-rw-r--r--openssl-1.1.0h/NOTES.UNIX30
-rw-r--r--openssl-1.1.0h/NOTES.VMS81
-rw-r--r--openssl-1.1.0h/NOTES.WIN139
-rw-r--r--openssl-1.1.0h/README94
-rw-r--r--openssl-1.1.0h/README.ECC61
-rw-r--r--openssl-1.1.0h/README.ENGINE288
-rw-r--r--openssl-1.1.0h/README.FIPS1
-rw-r--r--openssl-1.1.0h/VMS/VMSify-conf.pl41
-rw-r--r--openssl-1.1.0h/VMS/engine.opt2
-rw-r--r--openssl-1.1.0h/VMS/openssl_ivp.com.in50
-rw-r--r--openssl-1.1.0h/VMS/openssl_shutdown.com.in56
-rw-r--r--openssl-1.1.0h/VMS/openssl_startup.com.in123
-rw-r--r--openssl-1.1.0h/VMS/openssl_utils.com.in14
-rw-r--r--openssl-1.1.0h/VMS/test-includes.com28
-rw-r--r--openssl-1.1.0h/VMS/translatesyms.pl62
-rw-r--r--openssl-1.1.0h/apps/CA.pl.in196
-rw-r--r--openssl-1.1.0h/apps/app_rand.c115
-rw-r--r--openssl-1.1.0h/apps/apps.c2650
-rw-r--r--openssl-1.1.0h/apps/apps.h573
-rw-r--r--openssl-1.1.0h/apps/asn1pars.c330
-rw-r--r--openssl-1.1.0h/apps/build.info28
-rw-r--r--openssl-1.1.0h/apps/ca-cert.srl1
-rw-r--r--openssl-1.1.0h/apps/ca-key.pem16
-rw-r--r--openssl-1.1.0h/apps/ca-req.pem11
-rw-r--r--openssl-1.1.0h/apps/ca.c2593
-rw-r--r--openssl-1.1.0h/apps/cert.pem11
-rw-r--r--openssl-1.1.0h/apps/ciphers.c242
-rw-r--r--openssl-1.1.0h/apps/client.pem52
-rw-r--r--openssl-1.1.0h/apps/cms.c1298
-rw-r--r--openssl-1.1.0h/apps/crl.c347
-rw-r--r--openssl-1.1.0h/apps/crl2p7.c216
-rw-r--r--openssl-1.1.0h/apps/ct_log_list.cnf34
-rw-r--r--openssl-1.1.0h/apps/demoCA/cacert.pem14
-rw-r--r--openssl-1.1.0h/apps/demoCA/index.txt39
-rw-r--r--openssl-1.1.0h/apps/demoCA/private/cakey.pem24
-rw-r--r--openssl-1.1.0h/apps/demoCA/serial1
-rw-r--r--openssl-1.1.0h/apps/demoSRP/srp_verifier.txt6
-rw-r--r--openssl-1.1.0h/apps/demoSRP/srp_verifier.txt.attr1
-rw-r--r--openssl-1.1.0h/apps/dgst.c480
-rw-r--r--openssl-1.1.0h/apps/dh1024.pem10
-rw-r--r--openssl-1.1.0h/apps/dh2048.pem14
-rw-r--r--openssl-1.1.0h/apps/dh4096.pem19
-rw-r--r--openssl-1.1.0h/apps/dhparam.c392
-rw-r--r--openssl-1.1.0h/apps/dsa-ca.pem47
-rw-r--r--openssl-1.1.0h/apps/dsa-pca.pem47
-rw-r--r--openssl-1.1.0h/apps/dsa.c265
-rw-r--r--openssl-1.1.0h/apps/dsa1024.pem9
-rw-r--r--openssl-1.1.0h/apps/dsa512.pem6
-rw-r--r--openssl-1.1.0h/apps/dsap.pem6
-rw-r--r--openssl-1.1.0h/apps/dsaparam.c316
-rw-r--r--openssl-1.1.0h/apps/ec.c281
-rw-r--r--openssl-1.1.0h/apps/ecparam.c471
-rw-r--r--openssl-1.1.0h/apps/enc.c623
-rw-r--r--openssl-1.1.0h/apps/engine.c446
-rw-r--r--openssl-1.1.0h/apps/errstr.c67
-rw-r--r--openssl-1.1.0h/apps/gendsa.c147
-rw-r--r--openssl-1.1.0h/apps/genpkey.c314
-rw-r--r--openssl-1.1.0h/apps/genrsa.c198
-rw-r--r--openssl-1.1.0h/apps/nseq.c113
-rw-r--r--openssl-1.1.0h/apps/ocsp.c1290
-rw-r--r--openssl-1.1.0h/apps/openssl-vms.cnf346
-rw-r--r--openssl-1.1.0h/apps/openssl.c703
-rw-r--r--openssl-1.1.0h/apps/openssl.cnf346
-rw-r--r--openssl-1.1.0h/apps/opt.c977
-rw-r--r--openssl-1.1.0h/apps/passwd.c512
-rw-r--r--openssl-1.1.0h/apps/pca-cert.srl1
-rw-r--r--openssl-1.1.0h/apps/pca-key.pem16
-rw-r--r--openssl-1.1.0h/apps/pca-req.pem11
-rw-r--r--openssl-1.1.0h/apps/pkcs12.c935
-rw-r--r--openssl-1.1.0h/apps/pkcs7.c197
-rw-r--r--openssl-1.1.0h/apps/pkcs8.c353
-rw-r--r--openssl-1.1.0h/apps/pkey.c190
-rw-r--r--openssl-1.1.0h/apps/pkeyparam.c104
-rw-r--r--openssl-1.1.0h/apps/pkeyutl.c508
-rw-r--r--openssl-1.1.0h/apps/prime.c132
-rw-r--r--openssl-1.1.0h/apps/privkey.pem16
-rw-r--r--openssl-1.1.0h/apps/progs.pl164
-rw-r--r--openssl-1.1.0h/apps/rand.c136
-rw-r--r--openssl-1.1.0h/apps/rehash.c529
-rw-r--r--openssl-1.1.0h/apps/req.c1510
-rw-r--r--openssl-1.1.0h/apps/req.pem11
-rw-r--r--openssl-1.1.0h/apps/rsa.c310
-rw-r--r--openssl-1.1.0h/apps/rsa8192.pem101
-rw-r--r--openssl-1.1.0h/apps/rsautl.c278
-rw-r--r--openssl-1.1.0h/apps/s1024key.pem15
-rw-r--r--openssl-1.1.0h/apps/s1024req.pem11
-rw-r--r--openssl-1.1.0h/apps/s512-key.pem9
-rw-r--r--openssl-1.1.0h/apps/s512-req.pem8
-rw-r--r--openssl-1.1.0h/apps/s_apps.h102
-rw-r--r--openssl-1.1.0h/apps/s_cb.c1335
-rw-r--r--openssl-1.1.0h/apps/s_client.c2760
-rw-r--r--openssl-1.1.0h/apps/s_server.c3305
-rw-r--r--openssl-1.1.0h/apps/s_socket.c250
-rw-r--r--openssl-1.1.0h/apps/s_time.c385
-rw-r--r--openssl-1.1.0h/apps/server.pem52
-rw-r--r--openssl-1.1.0h/apps/server.srl1
-rw-r--r--openssl-1.1.0h/apps/server2.pem52
-rw-r--r--openssl-1.1.0h/apps/sess_id.c190
-rw-r--r--openssl-1.1.0h/apps/smime.c656
-rw-r--r--openssl-1.1.0h/apps/speed.c3149
-rw-r--r--openssl-1.1.0h/apps/spkac.c196
-rw-r--r--openssl-1.1.0h/apps/srp.c613
-rw-r--r--openssl-1.1.0h/apps/testCA.pem8
-rw-r--r--openssl-1.1.0h/apps/testdsa.h290
-rw-r--r--openssl-1.1.0h/apps/testrsa.h1960
-rw-r--r--openssl-1.1.0h/apps/timeouts.h17
-rw-r--r--openssl-1.1.0h/apps/ts.c995
-rw-r--r--openssl-1.1.0h/apps/tsget.in200
-rw-r--r--openssl-1.1.0h/apps/verify.c312
-rw-r--r--openssl-1.1.0h/apps/version.c145
-rw-r--r--openssl-1.1.0h/apps/vms_decc_init.c214
-rw-r--r--openssl-1.1.0h/apps/vms_term_sock.c590
-rw-r--r--openssl-1.1.0h/apps/vms_term_sock.h30
-rw-r--r--openssl-1.1.0h/apps/win32_init.c307
-rw-r--r--openssl-1.1.0h/apps/x509.c1099
-rw-r--r--openssl-1.1.0h/appveyor.yml45
-rw-r--r--openssl-1.1.0h/build.info41
-rwxr-xr-xopenssl-1.1.0h/config933
-rw-r--r--openssl-1.1.0h/config.com93
-rw-r--r--openssl-1.1.0h/crypto/LPdir_nyi.c53
-rw-r--r--openssl-1.1.0h/crypto/LPdir_unix.c131
-rw-r--r--openssl-1.1.0h/crypto/LPdir_vms.c204
-rw-r--r--openssl-1.1.0h/crypto/LPdir_win.c211
-rw-r--r--openssl-1.1.0h/crypto/LPdir_win32.c38
-rw-r--r--openssl-1.1.0h/crypto/LPdir_wince.c41
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_cbc.c24
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_cfb.c43
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_core.c1367
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_ecb.c26
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_ige.c284
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_locl.h42
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_misc.c21
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_ofb.c19
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_wrap.c27
-rw-r--r--openssl-1.1.0h/crypto/aes/aes_x86core.c1075
-rwxr-xr-xopenssl-1.1.0h/crypto/aes/asm/aes-586.pl3000
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aes-armv4.pl1245
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aes-c64xplus.pl1382
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aes-ia64.S1130
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aes-mips.pl2131
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aes-parisc.pl1029
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aes-ppc.pl1459
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aes-s390x.pl2226
-rwxr-xr-xopenssl-1.1.0h/crypto/aes/asm/aes-sparcv9.pl1192
-rwxr-xr-xopenssl-1.1.0h/crypto/aes/asm/aes-x86_64.pl2820
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aesfx-sparcv9.pl1270
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aesni-mb-x86_64.pl1402
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aesni-sha1-x86_64.pl2072
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aesni-sha256-x86_64.pl1717
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aesni-x86.pl3413
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aesni-x86_64.pl5060
-rwxr-xr-xopenssl-1.1.0h/crypto/aes/asm/aesp8-ppc.pl3805
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/aest4-sparcv9.pl929
-rwxr-xr-xopenssl-1.1.0h/crypto/aes/asm/aesv8-armx.pl1008
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/bsaes-armv7.pl2495
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/bsaes-x86_64.pl3111
-rwxr-xr-xopenssl-1.1.0h/crypto/aes/asm/vpaes-armv8.pl1259
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/vpaes-ppc.pl1594
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/vpaes-x86.pl916
-rw-r--r--openssl-1.1.0h/crypto/aes/asm/vpaes-x86_64.pl1215
-rw-r--r--openssl-1.1.0h/crypto/aes/build.info57
-rw-r--r--openssl-1.1.0h/crypto/alphacpuid.pl257
-rwxr-xr-xopenssl-1.1.0h/crypto/arm64cpuid.pl126
-rw-r--r--openssl-1.1.0h/crypto/arm_arch.h83
-rw-r--r--openssl-1.1.0h/crypto/armcap.c193
-rw-r--r--openssl-1.1.0h/crypto/armv4cpuid.pl296
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_bitstr.c216
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_d2i_fp.c235
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_digest.c63
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_dup.c68
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_gentm.c273
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_i2d_fp.c111
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_int.c630
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_mbstr.c395
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_object.c370
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_octet.c29
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_print.c109
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_sign.c225
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_strex.c644
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_strnid.c289
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_time.c170
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_type.c134
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_utctm.c254
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_utf8.c188
-rw-r--r--openssl-1.1.0h/crypto/asn1/a_verify.c179
-rw-r--r--openssl-1.1.0h/crypto/asn1/ameth_lib.c411
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn1_err.c271
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn1_gen.c789
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn1_lib.c384
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn1_locl.h83
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn1_par.c375
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn_mime.c981
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn_moid.c105
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn_mstbl.c114
-rw-r--r--openssl-1.1.0h/crypto/asn1/asn_pack.c62
-rw-r--r--openssl-1.1.0h/crypto/asn1/bio_asn1.c437
-rw-r--r--openssl-1.1.0h/crypto/asn1/bio_ndef.c199
-rw-r--r--openssl-1.1.0h/crypto/asn1/build.info16
-rw-r--r--openssl-1.1.0h/crypto/asn1/charmap.h34
-rw-r--r--openssl-1.1.0h/crypto/asn1/charmap.pl117
-rw-r--r--openssl-1.1.0h/crypto/asn1/d2i_pr.c125
-rw-r--r--openssl-1.1.0h/crypto/asn1/d2i_pu.c78
-rw-r--r--openssl-1.1.0h/crypto/asn1/evp_asn1.c115
-rw-r--r--openssl-1.1.0h/crypto/asn1/f_int.c167
-rw-r--r--openssl-1.1.0h/crypto/asn1/f_string.c148
-rw-r--r--openssl-1.1.0h/crypto/asn1/i2d_pr.c33
-rw-r--r--openssl-1.1.0h/crypto/asn1/i2d_pu.c38
-rw-r--r--openssl-1.1.0h/crypto/asn1/n_pkey.c62
-rw-r--r--openssl-1.1.0h/crypto/asn1/nsseq.c34
-rw-r--r--openssl-1.1.0h/crypto/asn1/p5_pbe.c96
-rw-r--r--openssl-1.1.0h/crypto/asn1/p5_pbev2.c221
-rw-r--r--openssl-1.1.0h/crypto/asn1/p5_scrypt.c283
-rw-r--r--openssl-1.1.0h/crypto/asn1/p8_pkey.c80
-rw-r--r--openssl-1.1.0h/crypto/asn1/t_bitst.c56
-rw-r--r--openssl-1.1.0h/crypto/asn1/t_pkey.c93
-rw-r--r--openssl-1.1.0h/crypto/asn1/t_spki.c56
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_dec.c1159
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_enc.c605
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_fre.c208
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_new.c348
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_prn.c538
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_scn.c65
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_typ.c84
-rw-r--r--openssl-1.1.0h/crypto/asn1/tasn_utl.c240
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_algor.c93
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_bignum.c146
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_info.c39
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_int64.c265
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_long.c196
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_pkey.c47
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_sig.c39
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_spki.c33
-rw-r--r--openssl-1.1.0h/crypto/asn1/x_val.c20
-rw-r--r--openssl-1.1.0h/crypto/async/arch/async_null.c23
-rw-r--r--openssl-1.1.0h/crypto/async/arch/async_null.h30
-rw-r--r--openssl-1.1.0h/crypto/async/arch/async_posix.c58
-rw-r--r--openssl-1.1.0h/crypto/async/arch/async_posix.h58
-rw-r--r--openssl-1.1.0h/crypto/async/arch/async_win.c55
-rw-r--r--openssl-1.1.0h/crypto/async/arch/async_win.h36
-rw-r--r--openssl-1.1.0h/crypto/async/async.c433
-rw-r--r--openssl-1.1.0h/crypto/async/async_err.c51
-rw-r--r--openssl-1.1.0h/crypto/async/async_locl.h77
-rw-r--r--openssl-1.1.0h/crypto/async/async_wait.c211
-rw-r--r--openssl-1.1.0h/crypto/async/build.info4
-rw-r--r--openssl-1.1.0h/crypto/bf/asm/bf-586.pl149
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_cbc.c86
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_cfb64.c74
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_ecb.c43
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_enc.c179
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_locl.h84
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_ofb64.c61
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_pi.h530
-rw-r--r--openssl-1.1.0h/crypto/bf/bf_skey.c67
-rw-r--r--openssl-1.1.0h/crypto/bf/build.info6
-rw-r--r--openssl-1.1.0h/crypto/bio/b_addr.c883
-rw-r--r--openssl-1.1.0h/crypto/bio/b_dump.c143
-rw-r--r--openssl-1.1.0h/crypto/bio/b_print.c926
-rw-r--r--openssl-1.1.0h/crypto/bio/b_sock.c378
-rw-r--r--openssl-1.1.0h/crypto/bio/b_sock2.c277
-rw-r--r--openssl-1.1.0h/crypto/bio/bf_buff.c455
-rw-r--r--openssl-1.1.0h/crypto/bio/bf_lbuf.c320
-rw-r--r--openssl-1.1.0h/crypto/bio/bf_nbio.c194
-rw-r--r--openssl-1.1.0h/crypto/bio/bf_null.c118
-rw-r--r--openssl-1.1.0h/crypto/bio/bio_cb.c99
-rw-r--r--openssl-1.1.0h/crypto/bio/bio_err.c126
-rw-r--r--openssl-1.1.0h/crypto/bio/bio_lcl.h188
-rw-r--r--openssl-1.1.0h/crypto/bio/bio_lib.c600
-rw-r--r--openssl-1.1.0h/crypto/bio/bio_meth.c150
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_acpt.c562
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_bio.c805
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_conn.c543
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_dgram.c1923
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_fd.c275
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_file.c424
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_log.c407
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_mem.c347
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_null.c83
-rw-r--r--openssl-1.1.0h/crypto/bio/bss_sock.c231
-rw-r--r--openssl-1.1.0h/crypto/bio/build.info8
-rw-r--r--openssl-1.1.0h/crypto/blake2/blake2_impl.h130
-rw-r--r--openssl-1.1.0h/crypto/blake2/blake2_locl.h91
-rw-r--r--openssl-1.1.0h/crypto/blake2/blake2b.c270
-rw-r--r--openssl-1.1.0h/crypto/blake2/blake2s.c264
-rw-r--r--openssl-1.1.0h/crypto/blake2/build.info3
-rw-r--r--openssl-1.1.0h/crypto/blake2/m_blake2b.c59
-rw-r--r--openssl-1.1.0h/crypto/blake2/m_blake2s.c59
-rw-r--r--openssl-1.1.0h/crypto/bn/README.pod247
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/alpha-mont.pl331
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/armv4-gf2m.pl332
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/armv4-mont.pl756
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/armv8-mont.pl1510
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/bn-586.pl785
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/bn-c64xplus.asm382
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/c64xplus-gf2m.pl160
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/co-586.pl298
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/ia64-mont.pl860
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/ia64.S1562
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/mips-mont.pl433
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/mips.pl2241
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/pa-risc2.s1624
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/pa-risc2W.s1612
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/parisc-mont.pl1002
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/ppc-mont.pl342
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/ppc.pl2014
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/ppc64-mont.pl1635
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/rsaz-avx2.pl1967
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/rsaz-x86_64.pl2358
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/s390x-gf2m.pl228
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/s390x-mont.pl284
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/s390x.S713
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/sparct4-mont.pl1232
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/sparcv8.S1458
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/sparcv8plus.S1562
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/sparcv9-gf2m.pl200
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/sparcv9-mont.pl619
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/sparcv9a-mont.pl887
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/via-mont.pl254
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/vis3-mont.pl384
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/x86-gf2m.pl325
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/x86-mont.pl629
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/x86_64-gcc.c649
-rw-r--r--openssl-1.1.0h/crypto/bn/asm/x86_64-gf2m.pl397
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/x86_64-mont.pl1521
-rwxr-xr-xopenssl-1.1.0h/crypto/bn/asm/x86_64-mont5.pl3835
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_add.c209
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_asm.c1039
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_blind.c289
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_const.c553
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_ctx.c353
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_depr.c68
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_dh.c220
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_div.c423
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_err.c107
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_exp.c1376
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_exp2.c201
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_gcd.c616
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_gf2m.c1224
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_intern.c210
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_kron.c140
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_lcl.h689
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_lib.c1016
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_mod.c201
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_mont.c422
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_mpi.c86
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_mul.c1011
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_nist.c1239
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_prime.c596
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_prime.h274
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_prime.pl46
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_print.c343
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_rand.c258
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_recp.c199
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_shift.c175
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_sqr.c235
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_sqrt.c358
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_srp.c545
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_word.c201
-rw-r--r--openssl-1.1.0h/crypto/bn/bn_x931p.c242
-rw-r--r--openssl-1.1.0h/crypto/bn/build.info84
-rw-r--r--openssl-1.1.0h/crypto/bn/rsaz_exp.c352
-rw-r--r--openssl-1.1.0h/crypto/bn/rsaz_exp.h77
-rw-r--r--openssl-1.1.0h/crypto/buffer/buf_err.c44
-rw-r--r--openssl-1.1.0h/crypto/buffer/buffer.c166
-rw-r--r--openssl-1.1.0h/crypto/buffer/build.info2
-rw-r--r--openssl-1.1.0h/crypto/build.info37
-rw-r--r--openssl-1.1.0h/crypto/c64xpluscpuid.pl287
-rw-r--r--openssl-1.1.0h/crypto/camellia/asm/cmll-x86.pl1150
-rw-r--r--openssl-1.1.0h/crypto/camellia/asm/cmll-x86_64.pl1088
-rw-r--r--openssl-1.1.0h/crypto/camellia/asm/cmllt4-sparcv9.pl939
-rw-r--r--openssl-1.1.0h/crypto/camellia/build.info11
-rw-r--r--openssl-1.1.0h/crypto/camellia/camellia.c541
-rw-r--r--openssl-1.1.0h/crypto/camellia/cmll_cbc.c24
-rw-r--r--openssl-1.1.0h/crypto/camellia/cmll_cfb.c43
-rw-r--r--openssl-1.1.0h/crypto/camellia/cmll_ctr.c22
-rw-r--r--openssl-1.1.0h/crypto/camellia/cmll_ecb.c20
-rw-r--r--openssl-1.1.0h/crypto/camellia/cmll_locl.h43
-rw-r--r--openssl-1.1.0h/crypto/camellia/cmll_misc.c35
-rw-r--r--openssl-1.1.0h/crypto/camellia/cmll_ofb.c24
-rw-r--r--openssl-1.1.0h/crypto/cast/asm/cast-586.pl192
-rw-r--r--openssl-1.1.0h/crypto/cast/build.info6
-rw-r--r--openssl-1.1.0h/crypto/cast/c_cfb64.c74
-rw-r--r--openssl-1.1.0h/crypto/cast/c_ecb.c32
-rw-r--r--openssl-1.1.0h/crypto/cast/c_enc.c151
-rw-r--r--openssl-1.1.0h/crypto/cast/c_ofb64.c61
-rw-r--r--openssl-1.1.0h/crypto/cast/c_skey.c118
-rw-r--r--openssl-1.1.0h/crypto/cast/cast_lcl.h190
-rw-r--r--openssl-1.1.0h/crypto/cast/cast_s.h544
-rwxr-xr-xopenssl-1.1.0h/crypto/chacha/asm/chacha-armv4.pl1158
-rwxr-xr-xopenssl-1.1.0h/crypto/chacha/asm/chacha-armv8.pl1135
-rwxr-xr-xopenssl-1.1.0h/crypto/chacha/asm/chacha-c64xplus.pl926
-rwxr-xr-xopenssl-1.1.0h/crypto/chacha/asm/chacha-ppc.pl953
-rwxr-xr-xopenssl-1.1.0h/crypto/chacha/asm/chacha-s390x.pl326
-rwxr-xr-xopenssl-1.1.0h/crypto/chacha/asm/chacha-x86.pl1154
-rwxr-xr-xopenssl-1.1.0h/crypto/chacha/asm/chacha-x86_64.pl2245
-rw-r--r--openssl-1.1.0h/crypto/chacha/build.info17
-rw-r--r--openssl-1.1.0h/crypto/chacha/chacha_enc.c121
-rw-r--r--openssl-1.1.0h/crypto/cmac/build.info2
-rw-r--r--openssl-1.1.0h/crypto/cmac/cm_ameth.c51
-rw-r--r--openssl-1.1.0h/crypto/cmac/cm_pmeth.c161
-rw-r--r--openssl-1.1.0h/crypto/cmac/cmac.c224
-rw-r--r--openssl-1.1.0h/crypto/cms/build.info5
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_asn1.c403
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_att.c152
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_cd.c82
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_dd.c99
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_enc.c212
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_env.c902
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_err.c258
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_ess.c337
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_io.c88
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_kari.c411
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_lcl.h444
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_lib.c587
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_pwri.c392
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_sd.c925
-rw-r--r--openssl-1.1.0h/crypto/cms/cms_smime.c842
-rw-r--r--openssl-1.1.0h/crypto/comp/build.info4
-rw-r--r--openssl-1.1.0h/crypto/comp/c_zlib.c615
-rw-r--r--openssl-1.1.0h/crypto/comp/comp_err.c48
-rw-r--r--openssl-1.1.0h/crypto/comp/comp_lcl.h30
-rw-r--r--openssl-1.1.0h/crypto/comp/comp_lib.c91
-rw-r--r--openssl-1.1.0h/crypto/conf/build.info4
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_api.c214
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_def.c642
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_def.h129
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_err.c81
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_lib.c365
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_mall.c29
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_mod.c549
-rw-r--r--openssl-1.1.0h/crypto/conf/conf_sap.c60
-rw-r--r--openssl-1.1.0h/crypto/conf/keysets.pl141
-rw-r--r--openssl-1.1.0h/crypto/cpt_err.c55
-rw-r--r--openssl-1.1.0h/crypto/cryptlib.c356
-rw-r--r--openssl-1.1.0h/crypto/ct/build.info3
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_b64.c164
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_err.c87
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_locl.h216
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_log.c306
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_oct.c407
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_policy.c98
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_prn.c127
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_sct.c393
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_sct_ctx.c263
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_vfy.c140
-rw-r--r--openssl-1.1.0h/crypto/ct/ct_x509v3.c104
-rw-r--r--openssl-1.1.0h/crypto/cversion.c65
-rw-r--r--openssl-1.1.0h/crypto/des/asm/crypt586.pl217
-rw-r--r--openssl-1.1.0h/crypto/des/asm/des-586.pl465
-rw-r--r--openssl-1.1.0h/crypto/des/asm/des_enc.m41972
-rw-r--r--openssl-1.1.0h/crypto/des/asm/desboth.pl86
-rw-r--r--openssl-1.1.0h/crypto/des/asm/dest4-sparcv9.pl627
-rw-r--r--openssl-1.1.0h/crypto/des/build.info17
-rw-r--r--openssl-1.1.0h/crypto/des/cbc_cksm.c54
-rw-r--r--openssl-1.1.0h/crypto/des/cbc_enc.c12
-rw-r--r--openssl-1.1.0h/crypto/des/cfb64ede.c190
-rw-r--r--openssl-1.1.0h/crypto/des/cfb64enc.c73
-rw-r--r--openssl-1.1.0h/crypto/des/cfb_enc.c150
-rw-r--r--openssl-1.1.0h/crypto/des/des_enc.c301
-rw-r--r--openssl-1.1.0h/crypto/des/des_locl.h231
-rw-r--r--openssl-1.1.0h/crypto/des/ecb3_enc.c33
-rw-r--r--openssl-1.1.0h/crypto/des/ecb_enc.c51
-rw-r--r--openssl-1.1.0h/crypto/des/fcrypt.c149
-rw-r--r--openssl-1.1.0h/crypto/des/fcrypt_b.c72
-rw-r--r--openssl-1.1.0h/crypto/des/ncbc_enc.c106
-rw-r--r--openssl-1.1.0h/crypto/des/ofb64ede.c62
-rw-r--r--openssl-1.1.0h/crypto/des/ofb64enc.c60
-rw-r--r--openssl-1.1.0h/crypto/des/ofb_enc.c82
-rw-r--r--openssl-1.1.0h/crypto/des/pcbc_enc.c66
-rw-r--r--openssl-1.1.0h/crypto/des/qud_cksm.c77
-rw-r--r--openssl-1.1.0h/crypto/des/rand_key.c21
-rw-r--r--openssl-1.1.0h/crypto/des/rpc_des.h76
-rw-r--r--openssl-1.1.0h/crypto/des/rpc_enc.c30
-rw-r--r--openssl-1.1.0h/crypto/des/set_key.c389
-rw-r--r--openssl-1.1.0h/crypto/des/spr.h163
-rw-r--r--openssl-1.1.0h/crypto/des/str2key.c97
-rw-r--r--openssl-1.1.0h/crypto/des/xcbc_enc.c103
-rw-r--r--openssl-1.1.0h/crypto/dh/build.info4
-rw-r--r--openssl-1.1.0h/crypto/dh/dh1024.pem5
-rw-r--r--openssl-1.1.0h/crypto/dh/dh192.pem3
-rw-r--r--openssl-1.1.0h/crypto/dh/dh2048.pem16
-rw-r--r--openssl-1.1.0h/crypto/dh/dh4096.pem14
-rw-r--r--openssl-1.1.0h/crypto/dh/dh512.pem4
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_ameth.c870
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_asn1.c138
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_check.c183
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_depr.c46
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_err.c73
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_gen.c130
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_kdf.c150
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_key.c227
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_lib.c263
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_locl.h56
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_meth.c173
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_pmeth.c501
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_prn.c30
-rw-r--r--openssl-1.1.0h/crypto/dh/dh_rfc5114.c41
-rw-r--r--openssl-1.1.0h/crypto/dllmain.c60
-rw-r--r--openssl-1.1.0h/crypto/dsa/build.info5
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_ameth.c572
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_asn1.c155
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_depr.c62
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_err.c76
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_gen.c603
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_key.c77
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_lib.c332
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_locl.h76
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_meth.c224
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_ossl.c365
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_pmeth.c273
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_prn.c69
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_sign.c24
-rw-r--r--openssl-1.1.0h/crypto/dsa/dsa_vrf.c19
-rw-r--r--openssl-1.1.0h/crypto/dso/build.info4
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_dl.c279
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_dlfcn.c354
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_err.c93
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_lib.c349
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_locl.h106
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_openssl.c22
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_vms.c468
-rw-r--r--openssl-1.1.0h/crypto/dso/dso_win32.c573
-rw-r--r--openssl-1.1.0h/crypto/ebcdic.c366
-rwxr-xr-xopenssl-1.1.0h/crypto/ec/asm/ecp_nistz256-armv4.pl1865
-rw-r--r--openssl-1.1.0h/crypto/ec/asm/ecp_nistz256-armv8.pl1558
-rwxr-xr-xopenssl-1.1.0h/crypto/ec/asm/ecp_nistz256-avx2.pl2100
-rwxr-xr-xopenssl-1.1.0h/crypto/ec/asm/ecp_nistz256-sparcv9.pl3061
-rwxr-xr-xopenssl-1.1.0h/crypto/ec/asm/ecp_nistz256-x86.pl1866
-rwxr-xr-xopenssl-1.1.0h/crypto/ec/asm/ecp_nistz256-x86_64.pl3083
-rw-r--r--openssl-1.1.0h/crypto/ec/build.info28
-rw-r--r--openssl-1.1.0h/crypto/ec/curve25519.c3400
-rw-r--r--openssl-1.1.0h/crypto/ec/ec2_mult.c418
-rw-r--r--openssl-1.1.0h/crypto/ec/ec2_oct.c352
-rw-r--r--openssl-1.1.0h/crypto/ec/ec2_smpl.c758
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_ameth.c885
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_asn1.c1237
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_check.c72
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_curve.c3169
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_cvt.c95
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_err.c290
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_key.c637
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_kmeth.c317
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_lcl.h613
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_lib.c1004
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_mult.c684
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_oct.c165
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_pmeth.c463
-rw-r--r--openssl-1.1.0h/crypto/ec/ec_print.c119
-rw-r--r--openssl-1.1.0h/crypto/ec/ecdh_kdf.c68
-rw-r--r--openssl-1.1.0h/crypto/ec/ecdh_ossl.c147
-rw-r--r--openssl-1.1.0h/crypto/ec/ecdsa_ossl.c476
-rw-r--r--openssl-1.1.0h/crypto/ec/ecdsa_sign.c52
-rw-r--r--openssl-1.1.0h/crypto/ec/ecdsa_vrf.c43
-rw-r--r--openssl-1.1.0h/crypto/ec/eck_prn.c273
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_mont.c242
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_nist.c167
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_nistp224.c1715
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_nistp256.c2350
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_nistp521.c2138
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_nistputil.c223
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_nistz256.c1559
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_nistz256_table.c9542
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_oct.c372
-rw-r--r--openssl-1.1.0h/crypto/ec/ecp_smpl.c1369
-rw-r--r--openssl-1.1.0h/crypto/ec/ecx_meth.c373
-rw-r--r--openssl-1.1.0h/crypto/engine/README211
-rw-r--r--openssl-1.1.0h/crypto/engine/build.info8
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_all.c31
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_cnf.c192
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_cryptodev.c1757
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_ctrl.c338
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_dyn.c510
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_err.c123
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_fat.c128
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_init.c108
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_int.h183
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_lib.c290
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_list.c354
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_openssl.c652
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_pkey.c140
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_rdrand.c110
-rw-r--r--openssl-1.1.0h/crypto/engine/eng_table.c308
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_asnmth.c207
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_cipher.c91
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_dh.c72
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_digest.c91
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_dsa.c72
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_eckey.c72
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_pkmeth.c114
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_rand.c72
-rw-r--r--openssl-1.1.0h/crypto/engine/tb_rsa.c72
-rw-r--r--openssl-1.1.0h/crypto/err/README44
-rw-r--r--openssl-1.1.0h/crypto/err/build.info3
-rw-r--r--openssl-1.1.0h/crypto/err/err.c793
-rw-r--r--openssl-1.1.0h/crypto/err/err_all.c109
-rw-r--r--openssl-1.1.0h/crypto/err/err_prn.c66
-rw-r--r--openssl-1.1.0h/crypto/err/openssl.ec99
-rw-r--r--openssl-1.1.0h/crypto/evp/bio_b64.c551
-rw-r--r--openssl-1.1.0h/crypto/evp/bio_enc.c450
-rw-r--r--openssl-1.1.0h/crypto/evp/bio_md.c232
-rw-r--r--openssl-1.1.0h/crypto/evp/bio_ok.c605
-rw-r--r--openssl-1.1.0h/crypto/evp/build.info22
-rw-r--r--openssl-1.1.0h/crypto/evp/c_allc.c220
-rw-r--r--openssl-1.1.0h/crypto/evp/c_alld.c49
-rw-r--r--openssl-1.1.0h/crypto/evp/cmeth_lib.c151
-rw-r--r--openssl-1.1.0h/crypto/evp/digest.c269
-rw-r--r--openssl-1.1.0h/crypto/evp/e_aes.c2705
-rw-r--r--openssl-1.1.0h/crypto/evp/e_aes_cbc_hmac_sha1.c964
-rw-r--r--openssl-1.1.0h/crypto/evp/e_aes_cbc_hmac_sha256.c950
-rw-r--r--openssl-1.1.0h/crypto/evp/e_bf.c38
-rw-r--r--openssl-1.1.0h/crypto/evp/e_camellia.c366
-rw-r--r--openssl-1.1.0h/crypto/evp/e_cast.c40
-rw-r--r--openssl-1.1.0h/crypto/evp/e_chacha20_poly1305.c454
-rw-r--r--openssl-1.1.0h/crypto/evp/e_des.c242
-rw-r--r--openssl-1.1.0h/crypto/evp/e_des3.c424
-rw-r--r--openssl-1.1.0h/crypto/evp/e_idea.c70
-rw-r--r--openssl-1.1.0h/crypto/evp/e_null.c50
-rw-r--r--openssl-1.1.0h/crypto/evp/e_old.c113
-rw-r--r--openssl-1.1.0h/crypto/evp/e_rc2.c189
-rw-r--r--openssl-1.1.0h/crypto/evp/e_rc4.c82
-rw-r--r--openssl-1.1.0h/crypto/evp/e_rc4_hmac_md5.c262
-rw-r--r--openssl-1.1.0h/crypto/evp/e_rc5.c74
-rw-r--r--openssl-1.1.0h/crypto/evp/e_seed.c39
-rw-r--r--openssl-1.1.0h/crypto/evp/e_xcbc_d.c83
-rw-r--r--openssl-1.1.0h/crypto/evp/encode.c404
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_cnf.c65
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_enc.c642
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_err.c186
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_key.c152
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_lib.c497
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_locl.h68
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_pbe.c259
-rw-r--r--openssl-1.1.0h/crypto/evp/evp_pkey.c150
-rw-r--r--openssl-1.1.0h/crypto/evp/m_md2.c56
-rw-r--r--openssl-1.1.0h/crypto/evp/m_md4.c55
-rw-r--r--openssl-1.1.0h/crypto/evp/m_md5.c55
-rw-r--r--openssl-1.1.0h/crypto/evp/m_md5_sha1.c142
-rw-r--r--openssl-1.1.0h/crypto/evp/m_mdc2.c55
-rw-r--r--openssl-1.1.0h/crypto/evp/m_null.c49
-rw-r--r--openssl-1.1.0h/crypto/evp/m_ripemd.c55
-rw-r--r--openssl-1.1.0h/crypto/evp/m_sha1.c248
-rw-r--r--openssl-1.1.0h/crypto/evp/m_sigver.c177
-rw-r--r--openssl-1.1.0h/crypto/evp/m_wp.c54
-rw-r--r--openssl-1.1.0h/crypto/evp/names.c178
-rw-r--r--openssl-1.1.0h/crypto/evp/p5_crpt.c103
-rw-r--r--openssl-1.1.0h/crypto/evp/p5_crpt2.c280
-rw-r--r--openssl-1.1.0h/crypto/evp/p_dec.c36
-rw-r--r--openssl-1.1.0h/crypto/evp/p_enc.c35
-rw-r--r--openssl-1.1.0h/crypto/evp/p_lib.c506
-rw-r--r--openssl-1.1.0h/crypto/evp/p_open.c73
-rw-r--r--openssl-1.1.0h/crypto/evp/p_seal.c70
-rw-r--r--openssl-1.1.0h/crypto/evp/p_sign.c61
-rw-r--r--openssl-1.1.0h/crypto/evp/p_verify.c55
-rw-r--r--openssl-1.1.0h/crypto/evp/pmeth_fn.c297
-rw-r--r--openssl-1.1.0h/crypto/evp/pmeth_gn.c169
-rw-r--r--openssl-1.1.0h/crypto/evp/pmeth_lib.c725
-rw-r--r--openssl-1.1.0h/crypto/evp/scrypt.c248
-rw-r--r--openssl-1.1.0h/crypto/ex_data.c399
-rw-r--r--openssl-1.1.0h/crypto/hmac/build.info3
-rw-r--r--openssl-1.1.0h/crypto/hmac/hm_ameth.c125
-rw-r--r--openssl-1.1.0h/crypto/hmac/hm_pmeth.c210
-rw-r--r--openssl-1.1.0h/crypto/hmac/hmac.c240
-rw-r--r--openssl-1.1.0h/crypto/hmac/hmac_lcl.h33
-rw-r--r--openssl-1.1.0h/crypto/ia64cpuid.S297
-rw-r--r--openssl-1.1.0h/crypto/idea/build.info3
-rw-r--r--openssl-1.1.0h/crypto/idea/i_cbc.c122
-rw-r--r--openssl-1.1.0h/crypto/idea/i_cfb64.c74
-rw-r--r--openssl-1.1.0h/crypto/idea/i_ecb.c34
-rw-r--r--openssl-1.1.0h/crypto/idea/i_ofb64.c61
-rw-r--r--openssl-1.1.0h/crypto/idea/i_skey.c112
-rw-r--r--openssl-1.1.0h/crypto/idea/idea_lcl.h117
-rw-r--r--openssl-1.1.0h/crypto/include/internal/asn1_int.h94
-rw-r--r--openssl-1.1.0h/crypto/include/internal/async.h14
-rw-r--r--openssl-1.1.0h/crypto/include/internal/bn_conf.h.in27
-rw-r--r--openssl-1.1.0h/crypto/include/internal/bn_dh.h17
-rw-r--r--openssl-1.1.0h/crypto/include/internal/bn_int.h82
-rw-r--r--openssl-1.1.0h/crypto/include/internal/bn_srp.h32
-rw-r--r--openssl-1.1.0h/crypto/include/internal/chacha.h49
-rw-r--r--openssl-1.1.0h/crypto/include/internal/cryptlib.h81
-rw-r--r--openssl-1.1.0h/crypto/include/internal/cryptlib_int.h31
-rw-r--r--openssl-1.1.0h/crypto/include/internal/dso_conf.h.in15
-rw-r--r--openssl-1.1.0h/crypto/include/internal/engine.h20
-rw-r--r--openssl-1.1.0h/crypto/include/internal/err_int.h17
-rw-r--r--openssl-1.1.0h/crypto/include/internal/evp_int.h390
-rw-r--r--openssl-1.1.0h/crypto/include/internal/md32_common.h383
-rw-r--r--openssl-1.1.0h/crypto/include/internal/objects.h12
-rw-r--r--openssl-1.1.0h/crypto/include/internal/poly1305.h19
-rw-r--r--openssl-1.1.0h/crypto/include/internal/rand.h20
-rw-r--r--openssl-1.1.0h/crypto/include/internal/x509_int.h267
-rw-r--r--openssl-1.1.0h/crypto/init.c676
-rw-r--r--openssl-1.1.0h/crypto/kdf/build.info3
-rw-r--r--openssl-1.1.0h/crypto/kdf/hkdf.c293
-rw-r--r--openssl-1.1.0h/crypto/kdf/kdf_err.c46
-rw-r--r--openssl-1.1.0h/crypto/kdf/tls1_prf.c265
-rw-r--r--openssl-1.1.0h/crypto/lhash/build.info3
-rw-r--r--openssl-1.1.0h/crypto/lhash/lh_stats.c130
-rw-r--r--openssl-1.1.0h/crypto/lhash/lhash.c372
-rw-r--r--openssl-1.1.0h/crypto/lhash/lhash_lcl.h49
-rw-r--r--openssl-1.1.0h/crypto/lhash/num.pl23
-rw-r--r--openssl-1.1.0h/crypto/md2/build.info3
-rw-r--r--openssl-1.1.0h/crypto/md2/md2_dgst.c173
-rw-r--r--openssl-1.1.0h/crypto/md2/md2_one.c47
-rw-r--r--openssl-1.1.0h/crypto/md4/build.info3
-rw-r--r--openssl-1.1.0h/crypto/md4/md4_dgst.c147
-rw-r--r--openssl-1.1.0h/crypto/md4/md4_locl.h60
-rw-r--r--openssl-1.1.0h/crypto/md4/md4_one.c47
-rw-r--r--openssl-1.1.0h/crypto/md5/asm/md5-586.pl318
-rw-r--r--openssl-1.1.0h/crypto/md5/asm/md5-ia64.S1002
-rw-r--r--openssl-1.1.0h/crypto/md5/asm/md5-sparcv9.pl437
-rwxr-xr-xopenssl-1.1.0h/crypto/md5/asm/md5-x86_64.pl380
-rw-r--r--openssl-1.1.0h/crypto/md5/build.info22
-rw-r--r--openssl-1.1.0h/crypto/md5/md5_dgst.c164
-rw-r--r--openssl-1.1.0h/crypto/md5/md5_locl.h80
-rw-r--r--openssl-1.1.0h/crypto/md5/md5_one.c47
-rw-r--r--openssl-1.1.0h/crypto/mdc2/build.info3
-rw-r--r--openssl-1.1.0h/crypto/mdc2/mdc2_one.c27
-rw-r--r--openssl-1.1.0h/crypto/mdc2/mdc2dgst.c147
-rw-r--r--openssl-1.1.0h/crypto/mem.c196
-rw-r--r--openssl-1.1.0h/crypto/mem_clr.c25
-rw-r--r--openssl-1.1.0h/crypto/mem_dbg.c629
-rw-r--r--openssl-1.1.0h/crypto/mem_sec.c630
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/aesni-gcm-x86_64.pl1106
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-alpha.pl467
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-armv4.pl554
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-c64xplus.pl247
-rwxr-xr-xopenssl-1.1.0h/crypto/modes/asm/ghash-ia64.pl470
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-parisc.pl738
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-s390x.pl258
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-sparcv9.pl581
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-x86.pl1405
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghash-x86_64.pl1762
-rwxr-xr-xopenssl-1.1.0h/crypto/modes/asm/ghashp8-ppc.pl670
-rw-r--r--openssl-1.1.0h/crypto/modes/asm/ghashv8-armx.pl430
-rw-r--r--openssl-1.1.0h/crypto/modes/build.info27
-rw-r--r--openssl-1.1.0h/crypto/modes/cbc128.c161
-rw-r--r--openssl-1.1.0h/crypto/modes/ccm128.c432
-rw-r--r--openssl-1.1.0h/crypto/modes/cfb128.c198
-rw-r--r--openssl-1.1.0h/crypto/modes/ctr128.c209
-rw-r--r--openssl-1.1.0h/crypto/modes/cts128.c523
-rw-r--r--openssl-1.1.0h/crypto/modes/gcm128.c2301
-rw-r--r--openssl-1.1.0h/crypto/modes/modes_lcl.h185
-rw-r--r--openssl-1.1.0h/crypto/modes/ocb128.c568
-rw-r--r--openssl-1.1.0h/crypto/modes/ofb128.c74
-rw-r--r--openssl-1.1.0h/crypto/modes/wrap128.c329
-rw-r--r--openssl-1.1.0h/crypto/modes/xts128.c157
-rw-r--r--openssl-1.1.0h/crypto/o_dir.c37
-rw-r--r--openssl-1.1.0h/crypto/o_fips.c34
-rw-r--r--openssl-1.1.0h/crypto/o_fopen.c103
-rw-r--r--openssl-1.1.0h/crypto/o_init.c34
-rw-r--r--openssl-1.1.0h/crypto/o_str.c251
-rw-r--r--openssl-1.1.0h/crypto/o_time.c196
-rw-r--r--openssl-1.1.0h/crypto/objects/README44
-rw-r--r--openssl-1.1.0h/crypto/objects/build.info3
-rw-r--r--openssl-1.1.0h/crypto/objects/o_names.c407
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_dat.c738
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_dat.h5101
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_dat.pl227
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_err.c50
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_lcl.h14
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_lib.c66
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_mac.num1060
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_xref.c165
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_xref.h118
-rw-r--r--openssl-1.1.0h/crypto/objects/obj_xref.txt60
-rw-r--r--openssl-1.1.0h/crypto/objects/objects.pl193
-rw-r--r--openssl-1.1.0h/crypto/objects/objects.txt1485
-rw-r--r--openssl-1.1.0h/crypto/objects/objxref.pl135
-rw-r--r--openssl-1.1.0h/crypto/ocsp/build.info4
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_asn.c135
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_cl.c365
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_err.c91
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_ext.c472
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_ht.c502
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_lcl.h232
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_lib.c222
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_prn.c246
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_srv.c277
-rw-r--r--openssl-1.1.0h/crypto/ocsp/ocsp_vfy.c435
-rw-r--r--openssl-1.1.0h/crypto/ocsp/v3_ocsp.c264
-rw-r--r--openssl-1.1.0h/crypto/pariscid.pl263
-rw-r--r--openssl-1.1.0h/crypto/pem/build.info4
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_all.c181
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_err.c115
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_info.c334
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_lib.c857
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_oth.c36
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_pk8.c214
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_pkey.c244
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_sign.c50
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_x509.c18
-rw-r--r--openssl-1.1.0h/crypto/pem/pem_xaux.c18
-rw-r--r--openssl-1.1.0h/crypto/pem/pvkfmt.c881
-rw-r--r--openssl-1.1.0h/crypto/perlasm/README124
-rwxr-xr-xopenssl-1.1.0h/crypto/perlasm/arm-xlate.pl177
-rw-r--r--openssl-1.1.0h/crypto/perlasm/cbc.pl356
-rwxr-xr-xopenssl-1.1.0h/crypto/perlasm/ppc-xlate.pl265
-rw-r--r--openssl-1.1.0h/crypto/perlasm/sparcv9_modes.pl1702
-rwxr-xr-xopenssl-1.1.0h/crypto/perlasm/x86_64-xlate.pl1186
-rw-r--r--openssl-1.1.0h/crypto/perlasm/x86asm.pl310
-rw-r--r--openssl-1.1.0h/crypto/perlasm/x86gas.pl265
-rw-r--r--openssl-1.1.0h/crypto/perlasm/x86masm.pl207
-rw-r--r--openssl-1.1.0h/crypto/perlasm/x86nasm.pl186
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/build.info5
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_add.c164
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_asn.c76
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_attr.c103
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_crpt.c70
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_crt.c291
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_decr.c155
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_init.c43
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_key.c205
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_kiss.c250
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_lcl.h43
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_mutl.c242
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_npas.c184
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_p8d.c23
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_p8e.c69
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_sbag.c170
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/p12_utl.c237
-rw-r--r--openssl-1.1.0h/crypto/pkcs12/pk12err.c95
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/bio_pk7.c24
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/build.info4
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_asn1.c202
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_attr.c121
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_dgst.c15
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_doit.c1180
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_enc.c25
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_lib.c589
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_mime.c49
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pk7_smime.c549
-rw-r--r--openssl-1.1.0h/crypto/pkcs7/pkcs7err.c131
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-armv4.pl1252
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-armv8.pl943
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-c64xplus.pl331
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-mips.pl425
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-ppc.pl644
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-ppcfp.pl739
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-s390x.pl227
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-sparcv9.pl1120
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-x86.pl1814
-rwxr-xr-xopenssl-1.1.0h/crypto/poly1305/asm/poly1305-x86_64.pl2268
-rw-r--r--openssl-1.1.0h/crypto/poly1305/build.info20
-rw-r--r--openssl-1.1.0h/crypto/poly1305/poly1305.c1037
-rw-r--r--openssl-1.1.0h/crypto/poly1305/poly1305_ieee754.c472
-rw-r--r--openssl-1.1.0h/crypto/ppc_arch.h26
-rw-r--r--openssl-1.1.0h/crypto/ppccap.c343
-rwxr-xr-xopenssl-1.1.0h/crypto/ppccpuid.pl301
-rw-r--r--openssl-1.1.0h/crypto/rand/build.info4
-rw-r--r--openssl-1.1.0h/crypto/rand/md_rand.c667
-rw-r--r--openssl-1.1.0h/crypto/rand/rand_egd.c249
-rw-r--r--openssl-1.1.0h/crypto/rand/rand_err.c43
-rw-r--r--openssl-1.1.0h/crypto/rand/rand_lcl.h46
-rw-r--r--openssl-1.1.0h/crypto/rand/rand_lib.c164
-rw-r--r--openssl-1.1.0h/crypto/rand/rand_unix.c324
-rw-r--r--openssl-1.1.0h/crypto/rand/rand_vms.c133
-rw-r--r--openssl-1.1.0h/crypto/rand/rand_win.c135
-rw-r--r--openssl-1.1.0h/crypto/rand/randfile.c364
-rw-r--r--openssl-1.1.0h/crypto/rc2/build.info3
-rw-r--r--openssl-1.1.0h/crypto/rc2/rc2_cbc.c179
-rw-r--r--openssl-1.1.0h/crypto/rc2/rc2_ecb.c41
-rw-r--r--openssl-1.1.0h/crypto/rc2/rc2_locl.h134
-rw-r--r--openssl-1.1.0h/crypto/rc2/rc2_skey.c98
-rw-r--r--openssl-1.1.0h/crypto/rc2/rc2cfb64.c74
-rw-r--r--openssl-1.1.0h/crypto/rc2/rc2ofb64.c61
-rw-r--r--openssl-1.1.0h/crypto/rc2/tab.c93
-rw-r--r--openssl-1.1.0h/crypto/rc4/asm/rc4-586.pl428
-rw-r--r--openssl-1.1.0h/crypto/rc4/asm/rc4-c64xplus.pl192
-rw-r--r--openssl-1.1.0h/crypto/rc4/asm/rc4-ia64.pl767
-rw-r--r--openssl-1.1.0h/crypto/rc4/asm/rc4-md5-x86_64.pl645
-rw-r--r--openssl-1.1.0h/crypto/rc4/asm/rc4-parisc.pl321
-rw-r--r--openssl-1.1.0h/crypto/rc4/asm/rc4-s390x.pl241
-rwxr-xr-xopenssl-1.1.0h/crypto/rc4/asm/rc4-x86_64.pl687
-rw-r--r--openssl-1.1.0h/crypto/rc4/build.info33
-rw-r--r--openssl-1.1.0h/crypto/rc4/rc4_enc.c86
-rw-r--r--openssl-1.1.0h/crypto/rc4/rc4_locl.h16
-rw-r--r--openssl-1.1.0h/crypto/rc4/rc4_skey.c58
-rw-r--r--openssl-1.1.0h/crypto/rc5/asm/rc5-586.pl122
-rw-r--r--openssl-1.1.0h/crypto/rc5/build.info6
-rw-r--r--openssl-1.1.0h/crypto/rc5/rc5_ecb.c32
-rw-r--r--openssl-1.1.0h/crypto/rc5/rc5_enc.c160
-rw-r--r--openssl-1.1.0h/crypto/rc5/rc5_locl.h186
-rw-r--r--openssl-1.1.0h/crypto/rc5/rc5_skey.c61
-rw-r--r--openssl-1.1.0h/crypto/rc5/rc5cfb64.c74
-rw-r--r--openssl-1.1.0h/crypto/rc5/rc5ofb64.c61
-rw-r--r--openssl-1.1.0h/crypto/ripemd/asm/rmd-586.pl603
-rw-r--r--openssl-1.1.0h/crypto/ripemd/build.info6
-rw-r--r--openssl-1.1.0h/crypto/ripemd/rmd_dgst.c282
-rw-r--r--openssl-1.1.0h/crypto/ripemd/rmd_locl.h88
-rw-r--r--openssl-1.1.0h/crypto/ripemd/rmd_one.c28
-rw-r--r--openssl-1.1.0h/crypto/ripemd/rmdconst.h350
-rw-r--r--openssl-1.1.0h/crypto/rsa/build.info6
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_ameth.c867
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_asn1.c81
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_chk.c156
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_crpt.c178
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_depr.c61
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_err.c185
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_gen.c218
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_lib.c288
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_locl.h96
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_meth.c273
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_none.c43
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_null.c93
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_oaep.c286
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_ossl.c800
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_pk1.c243
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_pmeth.c668
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_prn.c42
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_pss.c253
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_saos.c94
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_sign.c248
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_ssl.c100
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_x931.c116
-rw-r--r--openssl-1.1.0h/crypto/rsa/rsa_x931g.c197
-rw-r--r--openssl-1.1.0h/crypto/s390xcap.c50
-rw-r--r--openssl-1.1.0h/crypto/s390xcpuid.S178
-rw-r--r--openssl-1.1.0h/crypto/seed/build.info2
-rw-r--r--openssl-1.1.0h/crypto/seed/seed.c590
-rw-r--r--openssl-1.1.0h/crypto/seed/seed_cbc.c23
-rw-r--r--openssl-1.1.0h/crypto/seed/seed_cfb.c20
-rw-r--r--openssl-1.1.0h/crypto/seed/seed_ecb.c19
-rw-r--r--openssl-1.1.0h/crypto/seed/seed_locl.h120
-rw-r--r--openssl-1.1.0h/crypto/seed/seed_ofb.c19
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-586.pl1488
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-alpha.pl329
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-armv4-large.pl742
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-armv8.pl363
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-c64xplus.pl337
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-ia64.pl314
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-mb-x86_64.pl1582
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-mips.pl457
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-parisc.pl267
-rwxr-xr-xopenssl-1.1.0h/crypto/sha/asm/sha1-ppc.pl351
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-s390x.pl247
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-sparcv9.pl434
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-sparcv9a.pl608
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha1-thumb.pl266
-rwxr-xr-xopenssl-1.1.0h/crypto/sha/asm/sha1-x86_64.pl2077
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha256-586.pl1293
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha256-armv4.pl732
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha256-c64xplus.pl320
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha256-mb-x86_64.pl1568
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha512-586.pl924
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha512-armv4.pl668
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha512-armv8.pl446
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha512-c64xplus.pl438
-rwxr-xr-xopenssl-1.1.0h/crypto/sha/asm/sha512-ia64.pl692
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha512-mips.pl519
-rwxr-xr-xopenssl-1.1.0h/crypto/sha/asm/sha512-parisc.pl800
-rwxr-xr-xopenssl-1.1.0h/crypto/sha/asm/sha512-ppc.pl799
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha512-s390x.pl322
-rw-r--r--openssl-1.1.0h/crypto/sha/asm/sha512-sparcv9.pl857
-rwxr-xr-xopenssl-1.1.0h/crypto/sha/asm/sha512-x86_64.pl2407
-rwxr-xr-xopenssl-1.1.0h/crypto/sha/asm/sha512p8-ppc.pl431
-rw-r--r--openssl-1.1.0h/crypto/sha/build.info69
-rw-r--r--openssl-1.1.0h/crypto/sha/sha1_one.c28
-rw-r--r--openssl-1.1.0h/crypto/sha/sha1dgst.c17
-rw-r--r--openssl-1.1.0h/crypto/sha/sha256.c386
-rw-r--r--openssl-1.1.0h/crypto/sha/sha512.c692
-rw-r--r--openssl-1.1.0h/crypto/sha/sha_locl.h424
-rw-r--r--openssl-1.1.0h/crypto/sparc_arch.h118
-rw-r--r--openssl-1.1.0h/crypto/sparccpuid.S582
-rw-r--r--openssl-1.1.0h/crypto/sparcv9cap.c294
-rw-r--r--openssl-1.1.0h/crypto/srp/build.info2
-rw-r--r--openssl-1.1.0h/crypto/srp/srp_lib.c280
-rw-r--r--openssl-1.1.0h/crypto/srp/srp_vfy.c680
-rw-r--r--openssl-1.1.0h/crypto/stack/build.info2
-rw-r--r--openssl-1.1.0h/crypto/stack/stack.c312
-rw-r--r--openssl-1.1.0h/crypto/threads_none.c124
-rw-r--r--openssl-1.1.0h/crypto/threads_pthread.c171
-rw-r--r--openssl-1.1.0h/crypto/threads_win.c136
-rw-r--r--openssl-1.1.0h/crypto/ts/build.info5
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_asn1.c259
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_conf.c468
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_err.c144
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_lcl.h183
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_lib.c93
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_req_print.c51
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_req_utils.c183
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_rsp_print.c195
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_rsp_sign.c904
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_rsp_utils.c365
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_rsp_verify.c635
-rw-r--r--openssl-1.1.0h/crypto/ts/ts_verify_ctx.c146
-rw-r--r--openssl-1.1.0h/crypto/txt_db/build.info2
-rw-r--r--openssl-1.1.0h/crypto/txt_db/txt_db.c318
-rw-r--r--openssl-1.1.0h/crypto/ui/build.info3
-rw-r--r--openssl-1.1.0h/crypto/ui/ui_err.c72
-rw-r--r--openssl-1.1.0h/crypto/ui/ui_lib.c812
-rw-r--r--openssl-1.1.0h/crypto/ui/ui_locl.h97
-rw-r--r--openssl-1.1.0h/crypto/ui/ui_openssl.c712
-rw-r--r--openssl-1.1.0h/crypto/ui/ui_util.c51
-rw-r--r--openssl-1.1.0h/crypto/uid.c42
-rw-r--r--openssl-1.1.0h/crypto/vms_rms.h58
-rw-r--r--openssl-1.1.0h/crypto/whrlpool/asm/wp-mmx.pl507
-rw-r--r--openssl-1.1.0h/crypto/whrlpool/asm/wp-x86_64.pl600
-rw-r--r--openssl-1.1.0h/crypto/whrlpool/build.info7
-rw-r--r--openssl-1.1.0h/crypto/whrlpool/wp_block.c792
-rw-r--r--openssl-1.1.0h/crypto/whrlpool/wp_dgst.c266
-rw-r--r--openssl-1.1.0h/crypto/whrlpool/wp_locl.h12
-rw-r--r--openssl-1.1.0h/crypto/x509/build.info10
-rw-r--r--openssl-1.1.0h/crypto/x509/by_dir.c386
-rw-r--r--openssl-1.1.0h/crypto/x509/by_file.c221
-rw-r--r--openssl-1.1.0h/crypto/x509/t_crl.c89
-rw-r--r--openssl-1.1.0h/crypto/x509/t_req.c198
-rw-r--r--openssl-1.1.0h/crypto/x509/t_x509.c376
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_att.c329
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_cmp.c459
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_d2.c57
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_def.c43
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_err.c142
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_ext.c160
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_lcl.h142
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_lu.c846
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_obj.c182
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_r2x.c67
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_req.c298
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_set.c159
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_trs.c298
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_txt.c177
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_v3.c235
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_vfy.c3277
-rw-r--r--openssl-1.1.0h/crypto/x509/x509_vpm.c617
-rw-r--r--openssl-1.1.0h/crypto/x509/x509cset.c182
-rw-r--r--openssl-1.1.0h/crypto/x509/x509name.c358
-rw-r--r--openssl-1.1.0h/crypto/x509/x509rset.c40
-rw-r--r--openssl-1.1.0h/crypto/x509/x509spki.c75
-rw-r--r--openssl-1.1.0h/crypto/x509/x509type.c77
-rw-r--r--openssl-1.1.0h/crypto/x509/x_all.c526
-rw-r--r--openssl-1.1.0h/crypto/x509/x_attrib.c55
-rw-r--r--openssl-1.1.0h/crypto/x509/x_crl.c459
-rw-r--r--openssl-1.1.0h/crypto/x509/x_exten.c28
-rw-r--r--openssl-1.1.0h/crypto/x509/x_name.c549
-rw-r--r--openssl-1.1.0h/crypto/x509/x_pubkey.c374
-rw-r--r--openssl-1.1.0h/crypto/x509/x_req.c68
-rw-r--r--openssl-1.1.0h/crypto/x509/x_x509.c224
-rw-r--r--openssl-1.1.0h/crypto/x509/x_x509a.c169
-rw-r--r--openssl-1.1.0h/crypto/x509v3/build.info8
-rw-r--r--openssl-1.1.0h/crypto/x509v3/ext_dat.h24
-rw-r--r--openssl-1.1.0h/crypto/x509v3/pcy_cache.c216
-rw-r--r--openssl-1.1.0h/crypto/x509v3/pcy_data.c77
-rw-r--r--openssl-1.1.0h/crypto/x509v3/pcy_int.h167
-rw-r--r--openssl-1.1.0h/crypto/x509v3/pcy_lib.c108
-rw-r--r--openssl-1.1.0h/crypto/x509v3/pcy_map.c81
-rw-r--r--openssl-1.1.0h/crypto/x509v3/pcy_node.c139
-rw-r--r--openssl-1.1.0h/crypto/x509v3/pcy_tree.c700
-rw-r--r--openssl-1.1.0h/crypto/x509v3/tabtest.c42
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_addr.c1307
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_akey.c160
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_akeya.c23
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_alt.c576
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_asid.c852
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_bcons.c84
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_bitst.c93
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_conf.c511
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_cpols.c447
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_crld.c509
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_enum.c53
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_extku.c100
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_genn.c201
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_ia5.c65
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_info.c164
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_int.c43
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_lib.c371
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_ncons.c582
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_pci.c321
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_pcia.c60
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_pcons.c91
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_pku.c65
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_pmaps.c110
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_prn.c210
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_purp.c873
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_skey.c106
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_sxnet.c226
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_tlsf.c137
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3_utl.c1238
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3conf.c79
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3err.c188
-rw-r--r--openssl-1.1.0h/crypto/x509v3/v3prin.c50
-rw-r--r--openssl-1.1.0h/crypto/x86_64cpuid.pl475
-rw-r--r--openssl-1.1.0h/crypto/x86cpuid.pl559
-rw-r--r--openssl-1.1.0h/demos/README9
-rw-r--r--openssl-1.1.0h/demos/bio/Makefile30
-rw-r--r--openssl-1.1.0h/demos/bio/README7
-rw-r--r--openssl-1.1.0h/demos/bio/accept.cnf17
-rw-r--r--openssl-1.1.0h/demos/bio/client-arg.c117
-rw-r--r--openssl-1.1.0h/demos/bio/client-conf.c126
-rw-r--r--openssl-1.1.0h/demos/bio/cmod.cnf24
-rw-r--r--openssl-1.1.0h/demos/bio/connect.cnf9
-rw-r--r--openssl-1.1.0h/demos/bio/descrip.mms47
-rw-r--r--openssl-1.1.0h/demos/bio/intca.pem23
-rw-r--r--openssl-1.1.0h/demos/bio/root.pem22
-rw-r--r--openssl-1.1.0h/demos/bio/saccept.c122
-rw-r--r--openssl-1.1.0h/demos/bio/sconnect.c131
-rw-r--r--openssl-1.1.0h/demos/bio/server-arg.c145
-rw-r--r--openssl-1.1.0h/demos/bio/server-cmod.c95
-rw-r--r--openssl-1.1.0h/demos/bio/server-conf.c140
-rw-r--r--openssl-1.1.0h/demos/bio/server-ec.pem17
-rw-r--r--openssl-1.1.0h/demos/bio/server.pem77
-rw-r--r--openssl-1.1.0h/demos/bio/shared.opt2
-rw-r--r--openssl-1.1.0h/demos/bio/static.opt2
-rw-r--r--openssl-1.1.0h/demos/certs/README21
-rw-r--r--openssl-1.1.0h/demos/certs/apps/apps.cnf69
-rw-r--r--openssl-1.1.0h/demos/certs/apps/ckey.pem27
-rw-r--r--openssl-1.1.0h/demos/certs/apps/intkey.pem27
-rw-r--r--openssl-1.1.0h/demos/certs/apps/mkacerts.sh45
-rw-r--r--openssl-1.1.0h/demos/certs/apps/mkxcerts.sh29
-rw-r--r--openssl-1.1.0h/demos/certs/apps/rootkey.pem27
-rw-r--r--openssl-1.1.0h/demos/certs/apps/skey.pem27
-rw-r--r--openssl-1.1.0h/demos/certs/apps/skey2.pem27
-rw-r--r--openssl-1.1.0h/demos/certs/ca.cnf86
-rw-r--r--openssl-1.1.0h/demos/certs/mkcerts.sh96
-rw-r--r--openssl-1.1.0h/demos/certs/ocspquery.sh21
-rw-r--r--openssl-1.1.0h/demos/certs/ocsprun.sh14
-rw-r--r--openssl-1.1.0h/demos/cms/cacert.pem18
-rw-r--r--openssl-1.1.0h/demos/cms/cakey.pem15
-rw-r--r--openssl-1.1.0h/demos/cms/cms_comp.c64
-rw-r--r--openssl-1.1.0h/demos/cms/cms_ddec.c88
-rw-r--r--openssl-1.1.0h/demos/cms/cms_dec.c78
-rw-r--r--openssl-1.1.0h/demos/cms/cms_denc.c97
-rw-r--r--openssl-1.1.0h/demos/cms/cms_enc.c92
-rw-r--r--openssl-1.1.0h/demos/cms/cms_sign.c88
-rw-r--r--openssl-1.1.0h/demos/cms/cms_sign2.c98
-rw-r--r--openssl-1.1.0h/demos/cms/cms_uncomp.c58
-rw-r--r--openssl-1.1.0h/demos/cms/cms_ver.c85
-rw-r--r--openssl-1.1.0h/demos/cms/comp.txt22
-rw-r--r--openssl-1.1.0h/demos/cms/encr.txt3
-rw-r--r--openssl-1.1.0h/demos/cms/sign.txt3
-rw-r--r--openssl-1.1.0h/demos/cms/signer.pem32
-rw-r--r--openssl-1.1.0h/demos/cms/signer2.pem32
-rw-r--r--openssl-1.1.0h/demos/evp/Makefile20
-rw-r--r--openssl-1.1.0h/demos/evp/aesccm.c125
-rw-r--r--openssl-1.1.0h/demos/evp/aesgcm.c121
-rw-r--r--openssl-1.1.0h/demos/pkcs12/README3
-rw-r--r--openssl-1.1.0h/demos/pkcs12/pkread.c68
-rw-r--r--openssl-1.1.0h/demos/pkcs12/pkwrite.c53
-rw-r--r--openssl-1.1.0h/demos/smime/cacert.pem18
-rw-r--r--openssl-1.1.0h/demos/smime/cakey.pem15
-rw-r--r--openssl-1.1.0h/demos/smime/encr.txt3
-rw-r--r--openssl-1.1.0h/demos/smime/sign.txt3
-rw-r--r--openssl-1.1.0h/demos/smime/signer.pem32
-rw-r--r--openssl-1.1.0h/demos/smime/signer2.pem32
-rw-r--r--openssl-1.1.0h/demos/smime/smdec.c78
-rw-r--r--openssl-1.1.0h/demos/smime/smenc.c91
-rw-r--r--openssl-1.1.0h/demos/smime/smsign.c88
-rw-r--r--openssl-1.1.0h/demos/smime/smsign2.c96
-rw-r--r--openssl-1.1.0h/demos/smime/smver.c83
-rw-r--r--openssl-1.1.0h/doc/HOWTO/certificates.txt110
-rw-r--r--openssl-1.1.0h/doc/HOWTO/keys.txt105
-rw-r--r--openssl-1.1.0h/doc/HOWTO/proxy_certificates.txt319
-rw-r--r--openssl-1.1.0h/doc/README20
-rw-r--r--openssl-1.1.0h/doc/apps/CA.pl.pod214
-rw-r--r--openssl-1.1.0h/doc/apps/asn1parse.pod209
-rw-r--r--openssl-1.1.0h/doc/apps/ca.pod724
-rw-r--r--openssl-1.1.0h/doc/apps/ciphers.pod731
-rw-r--r--openssl-1.1.0h/doc/apps/cms.pod738
-rw-r--r--openssl-1.1.0h/doc/apps/config.pod387
-rw-r--r--openssl-1.1.0h/doc/apps/crl.pod143
-rw-r--r--openssl-1.1.0h/doc/apps/crl2pkcs7.pod106
-rw-r--r--openssl-1.1.0h/doc/apps/dgst.pod239
-rw-r--r--openssl-1.1.0h/doc/apps/dhparam.pod160
-rw-r--r--openssl-1.1.0h/doc/apps/dsa.pod179
-rw-r--r--openssl-1.1.0h/doc/apps/dsaparam.pod125
-rw-r--r--openssl-1.1.0h/doc/apps/ec.pod207
-rw-r--r--openssl-1.1.0h/doc/apps/ecparam.pod186
-rw-r--r--openssl-1.1.0h/doc/apps/enc.pod354
-rw-r--r--openssl-1.1.0h/doc/apps/engine.pod115
-rw-r--r--openssl-1.1.0h/doc/apps/errstr.pod46
-rw-r--r--openssl-1.1.0h/doc/apps/gendsa.pod92
-rw-r--r--openssl-1.1.0h/doc/apps/genpkey.pod278
-rw-r--r--openssl-1.1.0h/doc/apps/genrsa.pod119
-rw-r--r--openssl-1.1.0h/doc/apps/list.pod82
-rw-r--r--openssl-1.1.0h/doc/apps/nseq.pod85
-rw-r--r--openssl-1.1.0h/doc/apps/ocsp.pod467
-rw-r--r--openssl-1.1.0h/doc/apps/openssl.pod461
-rw-r--r--openssl-1.1.0h/doc/apps/passwd.pod97
-rw-r--r--openssl-1.1.0h/doc/apps/pkcs12.pod381
-rw-r--r--openssl-1.1.0h/doc/apps/pkcs7.pod120
-rw-r--r--openssl-1.1.0h/doc/apps/pkcs8.pod302
-rw-r--r--openssl-1.1.0h/doc/apps/pkey.pod156
-rw-r--r--openssl-1.1.0h/doc/apps/pkeyparam.pod83
-rw-r--r--openssl-1.1.0h/doc/apps/pkeyutl.pod293
-rw-r--r--openssl-1.1.0h/doc/apps/rand.pod70
-rw-r--r--openssl-1.1.0h/doc/apps/rehash.pod140
-rw-r--r--openssl-1.1.0h/doc/apps/req.pod662
-rw-r--r--openssl-1.1.0h/doc/apps/rsa.pod217
-rw-r--r--openssl-1.1.0h/doc/apps/rsautl.pod205
-rw-r--r--openssl-1.1.0h/doc/apps/s_client.pod619
-rw-r--r--openssl-1.1.0h/doc/apps/s_server.pod616
-rw-r--r--openssl-1.1.0h/doc/apps/s_time.pod195
-rw-r--r--openssl-1.1.0h/doc/apps/sess_id.pod164
-rw-r--r--openssl-1.1.0h/doc/apps/smime.pod518
-rw-r--r--openssl-1.1.0h/doc/apps/speed.pod68
-rw-r--r--openssl-1.1.0h/doc/apps/spkac.pod148
-rw-r--r--openssl-1.1.0h/doc/apps/ts.pod662
-rw-r--r--openssl-1.1.0h/doc/apps/tsget.pod200
-rw-r--r--openssl-1.1.0h/doc/apps/verify.pod725
-rw-r--r--openssl-1.1.0h/doc/apps/version.pod81
-rw-r--r--openssl-1.1.0h/doc/apps/x509.pod898
-rw-r--r--openssl-1.1.0h/doc/apps/x509v3_config.pod541
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_INTEGER_get_int64.pod133
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_OBJECT_new.pod51
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_STRING_length.pod93
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_STRING_new.pod52
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_STRING_print_ex.pod105
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_TIME_set.pod138
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_TYPE_get.pod100
-rw-r--r--openssl-1.1.0h/doc/crypto/ASN1_generate_nconf.pod270
-rw-r--r--openssl-1.1.0h/doc/crypto/ASYNC_WAIT_CTX_new.pod144
-rw-r--r--openssl-1.1.0h/doc/crypto/ASYNC_start_job.pod330
-rw-r--r--openssl-1.1.0h/doc/crypto/BF_encrypt.pod117
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_ADDR.pod125
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_ADDRINFO.pod91
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_connect.pod112
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_ctrl.pod136
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_f_base64.pod91
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_f_buffer.pod92
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_f_cipher.pod81
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_f_md.pod156
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_f_null.pod39
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_f_ssl.pod298
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_find_type.pod69
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_get_data.pod65
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_get_ex_new_index.pod64
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_meth_new.pod131
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_new.pod72
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_new_CMS.pod75
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_parse_hostserv.pod74
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_printf.pod50
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_push.pod89
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_read.pod77
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_accept.pod222
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_bio.pod201
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_connect.pod200
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_fd.pod98
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_file.pod159
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_mem.pod124
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_null.pod44
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_s_socket.pod54
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_set_callback.pod221
-rw-r--r--openssl-1.1.0h/doc/crypto/BIO_should_retry.pod132
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_BLINDING_new.pod122
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_CTX_new.pod76
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_CTX_start.pod57
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_add.pod127
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_add_word.pod61
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_bn2bin.pod116
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_cmp.pod47
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_copy.pod69
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_generate_prime.pod194
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_mod_inverse.pod41
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_mod_mul_montgomery.pod90
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_mod_mul_reciprocal.pod76
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_new.pod63
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_num_bytes.pod61
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_rand.pod67
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_set_bit.pod69
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_swap.pod26
-rw-r--r--openssl-1.1.0h/doc/crypto/BN_zero.pod70
-rw-r--r--openssl-1.1.0h/doc/crypto/BUF_MEM_new.pod77
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_add0_cert.pod71
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_add1_recipient_cert.pod66
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_add1_signer.pod106
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_compress.pod81
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_decrypt.pod81
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_encrypt.pod104
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_final.pod46
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_get0_RecipientInfos.pod130
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_get0_SignerInfos.pod89
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_get0_type.pod81
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_get1_ReceiptRequest.pod72
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_sign.pod128
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_sign_receipt.pod50
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_uncompress.pod59
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_verify.pod131
-rw-r--r--openssl-1.1.0h/doc/crypto/CMS_verify_receipt.pod52
-rw-r--r--openssl-1.1.0h/doc/crypto/CONF_modules_free.pod62
-rw-r--r--openssl-1.1.0h/doc/crypto/CONF_modules_load_file.pod135
-rw-r--r--openssl-1.1.0h/doc/crypto/CRYPTO_THREAD_run_once.pod170
-rw-r--r--openssl-1.1.0h/doc/crypto/CRYPTO_get_ex_new_index.pod166
-rw-r--r--openssl-1.1.0h/doc/crypto/CTLOG_STORE_get0_log_by_id.pod49
-rw-r--r--openssl-1.1.0h/doc/crypto/CTLOG_STORE_new.pod79
-rw-r--r--openssl-1.1.0h/doc/crypto/CTLOG_new.pod72
-rw-r--r--openssl-1.1.0h/doc/crypto/CT_POLICY_EVAL_CTX_new.pod111
-rw-r--r--openssl-1.1.0h/doc/crypto/DEFINE_STACK_OF.pod241
-rw-r--r--openssl-1.1.0h/doc/crypto/DES_random_key.pod310
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_generate_key.pod54
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_generate_parameters.pod134
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_get0_pqg.pod110
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_get_1024_160.pod74
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_meth_new.pod156
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_new.pod46
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_set_method.pod88
-rw-r--r--openssl-1.1.0h/doc/crypto/DH_size.pod47
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_SIG_new.pod58
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_do_sign.pod52
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_dup_DH.pod41
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_generate_key.pod39
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_generate_parameters.pod122
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_get0_pqg.pod102
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_meth_new.pod193
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_new.pod48
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_set_method.pod88
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_sign.pod70
-rw-r--r--openssl-1.1.0h/doc/crypto/DSA_size.pod44
-rw-r--r--openssl-1.1.0h/doc/crypto/ECDSA_SIG_new.pod207
-rw-r--r--openssl-1.1.0h/doc/crypto/ECPKParameters_print.pod44
-rw-r--r--openssl-1.1.0h/doc/crypto/EC_GFp_simple_method.pod69
-rw-r--r--openssl-1.1.0h/doc/crypto/EC_GROUP_copy.pod206
-rw-r--r--openssl-1.1.0h/doc/crypto/EC_GROUP_new.pod120
-rw-r--r--openssl-1.1.0h/doc/crypto/EC_KEY_get_enc_flags.pod59
-rw-r--r--openssl-1.1.0h/doc/crypto/EC_KEY_new.pod183
-rw-r--r--openssl-1.1.0h/doc/crypto/EC_POINT_add.pod80
-rw-r--r--openssl-1.1.0h/doc/crypto/EC_POINT_new.pod196
-rw-r--r--openssl-1.1.0h/doc/crypto/ENGINE_add.pod621
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_GET_LIB.pod66
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_clear_error.pod34
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_error_string.pod74
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_get_error.pod79
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_load_crypto_strings.pod62
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_load_strings.pod58
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_print_errors.pod60
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_put_error.pod76
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_remove_state.pod53
-rw-r--r--openssl-1.1.0h/doc/crypto/ERR_set_mark.pod39
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_BytesToKey.pod78
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_CIPHER_CTX_get_cipher_data.pod51
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_CIPHER_meth_new.pod253
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_DigestInit.pod259
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_DigestSignInit.pod96
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_DigestVerifyInit.pod91
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_EncodeInit.pod162
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_EncryptInit.pod661
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_MD_meth_new.pod179
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_OpenInit.pod70
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_ASN1_METHOD.pod358
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_CTX_ctrl.pod154
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_CTX_new.pod62
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_CTX_set_hkdf_md.pod128
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_CTX_set_tls1_prf_md.pod108
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_asn1_get_count.pod80
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_cmp.pod73
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_decrypt.pod102
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_derive.pod102
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_encrypt.pod108
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_get_default_digest_nid.pod50
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_keygen.pod175
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_new.pod61
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_print_private.pod62
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_set1_RSA.pod131
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_sign.pod115
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_verify.pod100
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_PKEY_verify_recover.pod112
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_SealInit.pod90
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_SignInit.pod105
-rw-r--r--openssl-1.1.0h/doc/crypto/EVP_VerifyInit.pod94
-rw-r--r--openssl-1.1.0h/doc/crypto/HMAC.pod152
-rw-r--r--openssl-1.1.0h/doc/crypto/MD5.pod101
-rw-r--r--openssl-1.1.0h/doc/crypto/MDC2_Init.pod68
-rw-r--r--openssl-1.1.0h/doc/crypto/OBJ_nid2obj.pod198
-rw-r--r--openssl-1.1.0h/doc/crypto/OCSP_REQUEST_new.pod118
-rw-r--r--openssl-1.1.0h/doc/crypto/OCSP_cert_to_id.pod89
-rw-r--r--openssl-1.1.0h/doc/crypto/OCSP_request_add1_nonce.pod84
-rw-r--r--openssl-1.1.0h/doc/crypto/OCSP_resp_find_status.pod152
-rw-r--r--openssl-1.1.0h/doc/crypto/OCSP_response_status.pod100
-rw-r--r--openssl-1.1.0h/doc/crypto/OCSP_sendreq_new.pod122
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_Applink.pod31
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_LH_COMPFUNC.pod239
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_LH_stats.pod64
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_VERSION_NUMBER.pod111
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_config.pod74
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_ia32cap.pod140
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_init_crypto.pod245
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_instrument_bus.pod53
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_load_builtin_modules.pod56
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_malloc.pod207
-rw-r--r--openssl-1.1.0h/doc/crypto/OPENSSL_secure_malloc.pod131
-rw-r--r--openssl-1.1.0h/doc/crypto/OpenSSL_add_all_algorithms.pod90
-rw-r--r--openssl-1.1.0h/doc/crypto/PEM_read.pod127
-rw-r--r--openssl-1.1.0h/doc/crypto/PEM_read_CMS.pod97
-rw-r--r--openssl-1.1.0h/doc/crypto/PEM_read_bio_PrivateKey.pod481
-rw-r--r--openssl-1.1.0h/doc/crypto/PEM_write_bio_CMS_stream.pod50
-rw-r--r--openssl-1.1.0h/doc/crypto/PEM_write_bio_PKCS7_stream.pod49
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS12_create.pod76
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS12_newpass.pod115
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS12_parse.pod71
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS5_PBKDF2_HMAC.pod73
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS7_decrypt.pod57
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS7_encrypt.pod88
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS7_sign.pod124
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS7_sign_add_signer.pod96
-rw-r--r--openssl-1.1.0h/doc/crypto/PKCS7_verify.pod128
-rw-r--r--openssl-1.1.0h/doc/crypto/RAND_add.pod79
-rw-r--r--openssl-1.1.0h/doc/crypto/RAND_bytes.pod58
-rw-r--r--openssl-1.1.0h/doc/crypto/RAND_cleanup.pod42
-rw-r--r--openssl-1.1.0h/doc/crypto/RAND_egd.pod87
-rw-r--r--openssl-1.1.0h/doc/crypto/RAND_load_file.pod79
-rw-r--r--openssl-1.1.0h/doc/crypto/RAND_set_rand_method.pod81
-rw-r--r--openssl-1.1.0h/doc/crypto/RC4_set_key.pod66
-rw-r--r--openssl-1.1.0h/doc/crypto/RIPEMD160_Init.pod72
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_blinding_on.pod44
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_check_key.pod84
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_generate_key.pod88
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_get0_key.pod112
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_meth_new.pod235
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_new.pod47
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_padding_add_PKCS1_type_1.pod129
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_print.pod52
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_private_encrypt.pod74
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_public_encrypt.pod95
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_set_method.pod186
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_sign.pod65
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_sign_ASN1_OCTET_STRING.pod63
-rw-r--r--openssl-1.1.0h/doc/crypto/RSA_size.pod46
-rw-r--r--openssl-1.1.0h/doc/crypto/SCT_new.pod194
-rw-r--r--openssl-1.1.0h/doc/crypto/SCT_print.pod52
-rw-r--r--openssl-1.1.0h/doc/crypto/SCT_validate.pod98
-rw-r--r--openssl-1.1.0h/doc/crypto/SHA256_Init.pod108
-rw-r--r--openssl-1.1.0h/doc/crypto/SMIME_read_CMS.pod75
-rw-r--r--openssl-1.1.0h/doc/crypto/SMIME_read_PKCS7.pod78
-rw-r--r--openssl-1.1.0h/doc/crypto/SMIME_write_CMS.pod69
-rw-r--r--openssl-1.1.0h/doc/crypto/SMIME_write_PKCS7.pod70
-rw-r--r--openssl-1.1.0h/doc/crypto/SSL_CTX_set_tlsext_use_srtp.pod111
-rw-r--r--openssl-1.1.0h/doc/crypto/UI_STRING.pod135
-rw-r--r--openssl-1.1.0h/doc/crypto/UI_create_method.pod202
-rw-r--r--openssl-1.1.0h/doc/crypto/UI_new.pod203
-rw-r--r--openssl-1.1.0h/doc/crypto/X509V3_get_d2i.pod241
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_ALGOR_dup.pod48
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_CRL_get0_by_serial.pod115
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_EXTENSION_set_object.pod96
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_LOOKUP_hash_dir.pod130
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_NAME_ENTRY_get_object.pod77
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_NAME_add_entry_by_txt.pod123
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_NAME_get0_der.pod40
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_NAME_get_index_by_NID.pod123
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_NAME_print_ex.pod112
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_PUBKEY_new.pod120
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_SIG_get0.pod36
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_STORE_CTX_get_error.pod338
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_STORE_CTX_new.pod174
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_STORE_CTX_set_verify_cb.pod215
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_STORE_get0_param.pod57
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_STORE_new.pod58
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_STORE_set_verify_cb_func.pod265
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_VERIFY_PARAM_set_flags.pod359
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_check_ca.pod45
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_check_host.pod157
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_check_issued.pod45
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_digest.pod65
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_dup.pod303
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get0_notBefore.pod103
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get0_signature.pod97
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get0_uids.pod57
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get_extension_flags.pod181
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get_pubkey.pod87
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get_serialNumber.pod71
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get_subject_name.pod86
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_get_version.pod83
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_new.pod83
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_sign.pod99
-rw-r--r--openssl-1.1.0h/doc/crypto/X509_verify_cert.pod60
-rw-r--r--openssl-1.1.0h/doc/crypto/X509v3_get_ext_by_NID.pod140
-rw-r--r--openssl-1.1.0h/doc/crypto/bio.pod90
-rw-r--r--openssl-1.1.0h/doc/crypto/crypto.pod62
-rw-r--r--openssl-1.1.0h/doc/crypto/ct.pod55
-rw-r--r--openssl-1.1.0h/doc/crypto/d2i_DHparams.pod35
-rw-r--r--openssl-1.1.0h/doc/crypto/d2i_Netscape_RSA.pod38
-rw-r--r--openssl-1.1.0h/doc/crypto/d2i_PKCS8PrivateKey_bio.pod61
-rw-r--r--openssl-1.1.0h/doc/crypto/d2i_PrivateKey.pod77
-rw-r--r--openssl-1.1.0h/doc/crypto/d2i_X509.pod601
-rw-r--r--openssl-1.1.0h/doc/crypto/des_modes.pod261
-rw-r--r--openssl-1.1.0h/doc/crypto/evp.pod116
-rw-r--r--openssl-1.1.0h/doc/crypto/i2d_CMS_bio_stream.pod53
-rw-r--r--openssl-1.1.0h/doc/crypto/i2d_PKCS7_bio_stream.pod53
-rw-r--r--openssl-1.1.0h/doc/crypto/i2d_re_X509_tbs.pod79
-rw-r--r--openssl-1.1.0h/doc/crypto/o2i_SCT_LIST.pod48
-rw-r--r--openssl-1.1.0h/doc/crypto/x509.pod75
-rw-r--r--openssl-1.1.0h/doc/dir-locals.example.el15
-rw-r--r--openssl-1.1.0h/doc/fingerprints.txt27
-rw-r--r--openssl-1.1.0h/doc/openssl-c-indent.el62
-rw-r--r--openssl-1.1.0h/doc/ssl/DTLSv1_listen.pod102
-rw-r--r--openssl-1.1.0h/doc/ssl/OPENSSL_init_ssl.pod84
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CIPHER_get_name.pod128
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_COMP_add_compression_method.pod116
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CONF_CTX_new.pod50
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CONF_CTX_set1_prefix.pod58
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CONF_CTX_set_flags.pod84
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CONF_CTX_set_ssl_ctx.pod56
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CONF_cmd.pod563
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CONF_cmd_argv.pod51
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_add1_chain_cert.pod158
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_add_extra_chain_cert.pod80
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_add_session.pod82
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_config.pod93
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_ctrl.pod43
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_dane_enable.pod384
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_flush_sessions.pod56
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_free.pod51
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_get0_param.pod64
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_get_verify_mode.pod59
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_has_client_custom_ext.pod37
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_load_verify_locations.pod161
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_new.pod218
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_sess_number.pod85
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_sess_set_cache_size.pod62
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_sess_set_get_cb.pod96
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_sessions.pod43
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set1_curves.pod90
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set1_sigalgs.pod113
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set1_verify_cert_store.pod100
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_alpn_select_cb.pod197
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_cert_cb.pod77
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_cert_store.pod73
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_cert_verify_callback.pod74
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_cipher_list.pod74
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_client_CA_list.pod103
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_client_cert_cb.pod103
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_ct_validation_callback.pod145
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_ctlog_list_file.pod53
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_default_passwd_cb.pod113
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_ex_data.pod52
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_generate_session_id.pod139
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_info_callback.pod162
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_max_cert_list.pod82
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_min_proto_version.pod73
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_mode.pod114
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_msg_callback.pod103
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_options.pod307
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_psk_client_callback.pod63
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_quiet_shutdown.pod72
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_read_ahead.pod60
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_security_level.pod169
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_session_cache_mode.pod141
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_session_id_context.pod92
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_split_send_fragment.pod132
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_ssl_version.pod70
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_timeout.pod68
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod125
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_tlsext_ticket_key_cb.pod198
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod137
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_set_verify.pod307
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_use_certificate.pod180
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_use_psk_identity_hint.pod87
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_CTX_use_serverinfo.pod56
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_free.pod78
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get0_cipher.pod42
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get0_hostname.pod37
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get0_id_context.pod56
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get0_peer.pod38
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get_compress_id.pod39
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get_ex_data.pod47
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get_protocol_version.pod44
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_get_time.pod76
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_has_ticket.pod53
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_print.pod47
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_SESSION_set1_id.pod50
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_accept.pod82
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_alert_type_string.pod242
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_check_chain.pod94
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_clear.pod84
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_connect.pod82
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_do_handshake.pod81
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_export_keying_material.pod61
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_extension_supported.pod145
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_free.pod54
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get0_peer_scts.pod45
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_SSL_CTX.pod35
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_all_async_fds.pod88
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_ciphers.pod84
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_client_CA_list.pod62
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_client_random.pod88
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_current_cipher.pod55
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_default_timeout.pod50
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_error.pod143
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_extms_support.pod40
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_fd.pod53
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_peer_cert_chain.pod77
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_peer_certificate.pod64
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_psk_identity.pod44
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_rbio.pod49
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_session.pod82
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_shared_sigalgs.pod86
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_verify_result.pod66
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_get_version.pod67
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_library_init.pod57
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_load_client_CA_file.pod71
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_new.pod61
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_pending.pod68
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_read.pod121
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_rstate_string.pod68
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_session_reused.pod54
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_set1_host.pod121
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_set_bio.pod108
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_set_connect_state.pod64
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_set_fd.pod63
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_set_session.pod70
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_set_shutdown.pod81
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_set_verify_result.pod47
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_shutdown.pod132
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_state_string.pod54
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_want.pod103
-rw-r--r--openssl-1.1.0h/doc/ssl/SSL_write.pod111
-rw-r--r--openssl-1.1.0h/doc/ssl/d2i_SSL_SESSION.pod49
-rw-r--r--openssl-1.1.0h/doc/ssl/ssl.pod843
-rw-r--r--openssl-1.1.0h/e_os.h527
-rw-r--r--openssl-1.1.0h/engines/afalg/build.info13
-rw-r--r--openssl-1.1.0h/engines/afalg/e_afalg.c830
-rw-r--r--openssl-1.1.0h/engines/afalg/e_afalg.ec1
-rw-r--r--openssl-1.1.0h/engines/afalg/e_afalg.h80
-rw-r--r--openssl-1.1.0h/engines/afalg/e_afalg_err.c111
-rw-r--r--openssl-1.1.0h/engines/afalg/e_afalg_err.h60
-rw-r--r--openssl-1.1.0h/engines/asm/e_padlock-x86.pl618
-rw-r--r--openssl-1.1.0h/engines/asm/e_padlock-x86_64.pl574
-rw-r--r--openssl-1.1.0h/engines/build.info32
-rw-r--r--openssl-1.1.0h/engines/e_capi.c1888
-rw-r--r--openssl-1.1.0h/engines/e_capi.ec1
-rw-r--r--openssl-1.1.0h/engines/e_capi_err.c143
-rw-r--r--openssl-1.1.0h/engines/e_capi_err.h88
-rw-r--r--openssl-1.1.0h/engines/e_chil.c1285
-rw-r--r--openssl-1.1.0h/engines/e_chil.ec1
-rw-r--r--openssl-1.1.0h/engines/e_chil_err.c111
-rw-r--r--openssl-1.1.0h/engines/e_chil_err.h64
-rw-r--r--openssl-1.1.0h/engines/e_dasync.c771
-rw-r--r--openssl-1.1.0h/engines/e_dasync.ec1
-rw-r--r--openssl-1.1.0h/engines/e_dasync_err.c102
-rw-r--r--openssl-1.1.0h/engines/e_dasync_err.h52
-rw-r--r--openssl-1.1.0h/engines/e_ossltest.c568
-rw-r--r--openssl-1.1.0h/engines/e_ossltest.ec1
-rw-r--r--openssl-1.1.0h/engines/e_ossltest_err.c89
-rw-r--r--openssl-1.1.0h/engines/e_ossltest_err.h41
-rw-r--r--openssl-1.1.0h/engines/e_padlock.c747
-rw-r--r--openssl-1.1.0h/engines/e_padlock.ec1
-rw-r--r--openssl-1.1.0h/engines/vendor_defns/hwcryptohook.h509
-rw-r--r--openssl-1.1.0h/external/perl/Downloaded.txt13
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/Artistic131
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/COPYING340
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/INSTALL31
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/MANIFEST25
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/META.json39
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/META.yml21
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/Makefile.PL7
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/README339
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/lib/Text/Template.pm1973
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/lib/Text/Template/Preprocess.pm144
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/00-version.t11
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/01-basic.t266
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/02-hash.t111
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/03-out.t56
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/04-safe.t161
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/05-safe2.t105
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/06-ofh.t39
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/07-safe3.t91
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/08-exported.t75
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/09-error.t63
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/10-delimiters.t99
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/11-prepend.t94
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/12-preprocess.t52
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/13-taint.t119
-rw-r--r--openssl-1.1.0h/external/perl/Text-Template-1.46/t/14-broken.t82
-rw-r--r--openssl-1.1.0h/external/perl/transfer/Text/Template.pm20
-rw-r--r--openssl-1.1.0h/fuzz/README.md66
-rw-r--r--openssl-1.1.0h/fuzz/asn1.c222
-rw-r--r--openssl-1.1.0h/fuzz/asn1parse.c33
-rw-r--r--openssl-1.1.0h/fuzz/bignum.c94
-rw-r--r--openssl-1.1.0h/fuzz/bndiv.c107
-rw-r--r--openssl-1.1.0h/fuzz/build.info113
-rw-r--r--openssl-1.1.0h/fuzz/cms.c36
-rw-r--r--openssl-1.1.0h/fuzz/conf.c38
-rw-r--r--openssl-1.1.0h/fuzz/crl.c35
-rw-r--r--openssl-1.1.0h/fuzz/ct.c40
-rw-r--r--openssl-1.1.0h/fuzz/driver.c52
-rw-r--r--openssl-1.1.0h/fuzz/fuzzer.h12
-rwxr-xr-xopenssl-1.1.0h/fuzz/helper.py52
-rw-r--r--openssl-1.1.0h/fuzz/server.c250
-rw-r--r--openssl-1.1.0h/fuzz/test-corpus.c46
-rw-r--r--openssl-1.1.0h/fuzz/x509.c36
-rw-r--r--openssl-1.1.0h/include/internal/asn1t.h19
-rw-r--r--openssl-1.1.0h/include/internal/bio.h26
-rw-r--r--openssl-1.1.0h/include/internal/comp.h12
-rw-r--r--openssl-1.1.0h/include/internal/conf.h32
-rw-r--r--openssl-1.1.0h/include/internal/constant_time_locl.h185
-rw-r--r--openssl-1.1.0h/include/internal/dane.h103
-rw-r--r--openssl-1.1.0h/include/internal/dso.h239
-rw-r--r--openssl-1.1.0h/include/internal/err.h15
-rw-r--r--openssl-1.1.0h/include/internal/numbers.h68
-rw-r--r--openssl-1.1.0h/include/internal/o_dir.h63
-rw-r--r--openssl-1.1.0h/include/internal/o_str.h17
-rw-r--r--openssl-1.1.0h/include/internal/thread_once.h45
-rw-r--r--openssl-1.1.0h/include/openssl/__DECC_INCLUDE_EPILOGUE.H16
-rw-r--r--openssl-1.1.0h/include/openssl/__DECC_INCLUDE_PROLOGUE.H20
-rw-r--r--openssl-1.1.0h/include/openssl/aes.h92
-rw-r--r--openssl-1.1.0h/include/openssl/asn1.h1100
-rw-r--r--openssl-1.1.0h/include/openssl/asn1t.h929
-rw-r--r--openssl-1.1.0h/include/openssl/async.h98
-rw-r--r--openssl-1.1.0h/include/openssl/bio.h852
-rw-r--r--openssl-1.1.0h/include/openssl/blowfish.h61
-rw-r--r--openssl-1.1.0h/include/openssl/bn.h575
-rw-r--r--openssl-1.1.0h/include/openssl/buffer.h73
-rw-r--r--openssl-1.1.0h/include/openssl/camellia.h83
-rw-r--r--openssl-1.1.0h/include/openssl/cast.h53
-rw-r--r--openssl-1.1.0h/include/openssl/cmac.h41
-rw-r--r--openssl-1.1.0h/include/openssl/cms.h512
-rw-r--r--openssl-1.1.0h/include/openssl/comp.h72
-rw-r--r--openssl-1.1.0h/include/openssl/conf.h217
-rw-r--r--openssl-1.1.0h/include/openssl/conf_api.h40
-rw-r--r--openssl-1.1.0h/include/openssl/crypto.h467
-rw-r--r--openssl-1.1.0h/include/openssl/ct.h533
-rw-r--r--openssl-1.1.0h/include/openssl/des.h174
-rw-r--r--openssl-1.1.0h/include/openssl/dh.h361
-rw-r--r--openssl-1.1.0h/include/openssl/dsa.h283
-rw-r--r--openssl-1.1.0h/include/openssl/dtls1.h56
-rw-r--r--openssl-1.1.0h/include/openssl/e_os2.h297
-rw-r--r--openssl-1.1.0h/include/openssl/ebcdic.h33
-rw-r--r--openssl-1.1.0h/include/openssl/ec.h1576
-rw-r--r--openssl-1.1.0h/include/openssl/ecdh.h10
-rw-r--r--openssl-1.1.0h/include/openssl/ecdsa.h10
-rw-r--r--openssl-1.1.0h/include/openssl/engine.h840
-rw-r--r--openssl-1.1.0h/include/openssl/err.h260
-rw-r--r--openssl-1.1.0h/include/openssl/evp.h1597
-rw-r--r--openssl-1.1.0h/include/openssl/hmac.h49
-rw-r--r--openssl-1.1.0h/include/openssl/idea.h64
-rw-r--r--openssl-1.1.0h/include/openssl/kdf.h75
-rw-r--r--openssl-1.1.0h/include/openssl/lhash.h217
-rw-r--r--openssl-1.1.0h/include/openssl/md2.h44
-rw-r--r--openssl-1.1.0h/include/openssl/md4.h51
-rw-r--r--openssl-1.1.0h/include/openssl/md5.h50
-rw-r--r--openssl-1.1.0h/include/openssl/mdc2.h42
-rw-r--r--openssl-1.1.0h/include/openssl/modes.h203
-rw-r--r--openssl-1.1.0h/include/openssl/obj_mac.h4577
-rw-r--r--openssl-1.1.0h/include/openssl/objects.h1097
-rw-r--r--openssl-1.1.0h/include/openssl/ocsp.h398
-rw-r--r--openssl-1.1.0h/include/openssl/opensslconf.h.in141
-rw-r--r--openssl-1.1.0h/include/openssl/opensslv.h110
-rw-r--r--openssl-1.1.0h/include/openssl/ossl_typ.h190
-rw-r--r--openssl-1.1.0h/include/openssl/pem.h501
-rw-r--r--openssl-1.1.0h/include/openssl/pem2.h20
-rw-r--r--openssl-1.1.0h/include/openssl/pkcs12.h282
-rw-r--r--openssl-1.1.0h/include/openssl/pkcs7.h404
-rw-r--r--openssl-1.1.0h/include/openssl/rand.h89
-rw-r--r--openssl-1.1.0h/include/openssl/rc2.h51
-rw-r--r--openssl-1.1.0h/include/openssl/rc4.h36
-rw-r--r--openssl-1.1.0h/include/openssl/rc5.h63
-rw-r--r--openssl-1.1.0h/include/openssl/ripemd.h47
-rw-r--r--openssl-1.1.0h/include/openssl/rsa.h590
-rw-r--r--openssl-1.1.0h/include/openssl/safestack.h164
-rw-r--r--openssl-1.1.0h/include/openssl/seed.h96
-rw-r--r--openssl-1.1.0h/include/openssl/sha.h119
-rw-r--r--openssl-1.1.0h/include/openssl/srp.h131
-rw-r--r--openssl-1.1.0h/include/openssl/srtp.h50
-rw-r--r--openssl-1.1.0h/include/openssl/ssl.h2567
-rw-r--r--openssl-1.1.0h/include/openssl/ssl2.h24
-rw-r--r--openssl-1.1.0h/include/openssl/ssl3.h310
-rw-r--r--openssl-1.1.0h/include/openssl/stack.h78
-rw-r--r--openssl-1.1.0h/include/openssl/symhacks.h52
-rw-r--r--openssl-1.1.0h/include/openssl/tls1.h972
-rw-r--r--openssl-1.1.0h/include/openssl/ts.h643
-rw-r--r--openssl-1.1.0h/include/openssl/txt_db.h57
-rw-r--r--openssl-1.1.0h/include/openssl/ui.h378
-rw-r--r--openssl-1.1.0h/include/openssl/whrlpool.h48
-rw-r--r--openssl-1.1.0h/include/openssl/x509.h1123
-rw-r--r--openssl-1.1.0h/include/openssl/x509_vfy.h544
-rw-r--r--openssl-1.1.0h/include/openssl/x509v3.h1008
-rw-r--r--openssl-1.1.0h/ms/applink.c138
-rwxr-xr-xopenssl-1.1.0h/ms/cmp.pl53
-rwxr-xr-xopenssl-1.1.0h/ms/segrenam.pl71
-rw-r--r--openssl-1.1.0h/ms/tlhelp32.h136
-rwxr-xr-xopenssl-1.1.0h/ms/uplink-common.pl28
-rwxr-xr-xopenssl-1.1.0h/ms/uplink-ia64.pl61
-rwxr-xr-xopenssl-1.1.0h/ms/uplink-x86.pl44
-rwxr-xr-xopenssl-1.1.0h/ms/uplink-x86_64.pl71
-rw-r--r--openssl-1.1.0h/ms/uplink.c135
-rw-r--r--openssl-1.1.0h/ms/uplink.h38
-rw-r--r--openssl-1.1.0h/os-dep/haiku.h2
-rw-r--r--openssl-1.1.0h/ssl/bio_ssl.c516
-rw-r--r--openssl-1.1.0h/ssl/build.info14
-rw-r--r--openssl-1.1.0h/ssl/d1_lib.c1087
-rw-r--r--openssl-1.1.0h/ssl/d1_msg.c84
-rw-r--r--openssl-1.1.0h/ssl/d1_srtp.c329
-rw-r--r--openssl-1.1.0h/ssl/methods.c266
-rw-r--r--openssl-1.1.0h/ssl/packet_locl.h555
-rw-r--r--openssl-1.1.0h/ssl/pqueue.c154
-rw-r--r--openssl-1.1.0h/ssl/record/README74
-rw-r--r--openssl-1.1.0h/ssl/record/dtls1_bitmap.c78
-rw-r--r--openssl-1.1.0h/ssl/record/rec_layer_d1.c1229
-rw-r--r--openssl-1.1.0h/ssl/record/rec_layer_s3.c1549
-rw-r--r--openssl-1.1.0h/ssl/record/record.h243
-rw-r--r--openssl-1.1.0h/ssl/record/record_locl.h116
-rw-r--r--openssl-1.1.0h/ssl/record/ssl3_buffer.c163
-rw-r--r--openssl-1.1.0h/ssl/record/ssl3_record.c1641
-rw-r--r--openssl-1.1.0h/ssl/s3_cbc.c529
-rw-r--r--openssl-1.1.0h/ssl/s3_enc.c550
-rw-r--r--openssl-1.1.0h/ssl/s3_lib.c4140
-rw-r--r--openssl-1.1.0h/ssl/s3_msg.c102
-rw-r--r--openssl-1.1.0h/ssl/ssl_asn1.c367
-rw-r--r--openssl-1.1.0h/ssl/ssl_cert.c1087
-rw-r--r--openssl-1.1.0h/ssl/ssl_ciph.c1962
-rw-r--r--openssl-1.1.0h/ssl/ssl_conf.c893
-rw-r--r--openssl-1.1.0h/ssl/ssl_err.c689
-rw-r--r--openssl-1.1.0h/ssl/ssl_init.c210
-rw-r--r--openssl-1.1.0h/ssl/ssl_lib.c4476
-rw-r--r--openssl-1.1.0h/ssl/ssl_locl.h2133
-rw-r--r--openssl-1.1.0h/ssl/ssl_mcnf.c199
-rw-r--r--openssl-1.1.0h/ssl/ssl_rsa.c964
-rw-r--r--openssl-1.1.0h/ssl/ssl_sess.c1179
-rw-r--r--openssl-1.1.0h/ssl/ssl_stat.c362
-rw-r--r--openssl-1.1.0h/ssl/ssl_txt.c217
-rw-r--r--openssl-1.1.0h/ssl/ssl_utst.c28
-rw-r--r--openssl-1.1.0h/ssl/statem/README63
-rw-r--r--openssl-1.1.0h/ssl/statem/statem.c860
-rw-r--r--openssl-1.1.0h/ssl/statem/statem.h116
-rw-r--r--openssl-1.1.0h/ssl/statem/statem_clnt.c2946
-rw-r--r--openssl-1.1.0h/ssl/statem/statem_dtls.c1220
-rw-r--r--openssl-1.1.0h/ssl/statem/statem_lib.c1083
-rw-r--r--openssl-1.1.0h/ssl/statem/statem_locl.h125
-rw-r--r--openssl-1.1.0h/ssl/statem/statem_srvr.c3341
-rw-r--r--openssl-1.1.0h/ssl/t1_enc.c668
-rw-r--r--openssl-1.1.0h/ssl/t1_ext.c283
-rw-r--r--openssl-1.1.0h/ssl/t1_lib.c4228
-rw-r--r--openssl-1.1.0h/ssl/t1_reneg.c165
-rw-r--r--openssl-1.1.0h/ssl/t1_trce.c1322
-rw-r--r--openssl-1.1.0h/ssl/tls_srp.c430
-rw-r--r--openssl-1.1.0h/test/CAss.cnf76
-rw-r--r--openssl-1.1.0h/test/CAssdh.cnf24
-rw-r--r--openssl-1.1.0h/test/CAssdsa.cnf23
-rw-r--r--openssl-1.1.0h/test/CAssrsa.cnf24
-rw-r--r--openssl-1.1.0h/test/CAtsa.cnf163
-rw-r--r--openssl-1.1.0h/test/P1ss.cnf37
-rw-r--r--openssl-1.1.0h/test/P2ss.cnf45
-rw-r--r--openssl-1.1.0h/test/README109
-rw-r--r--openssl-1.1.0h/test/README.ssltest.md274
-rw-r--r--openssl-1.1.0h/test/Sssdsa.cnf27
-rw-r--r--openssl-1.1.0h/test/Sssrsa.cnf26
-rw-r--r--openssl-1.1.0h/test/Uss.cnf41
-rw-r--r--openssl-1.1.0h/test/aborttest.c16
-rw-r--r--openssl-1.1.0h/test/afalgtest.c133
-rw-r--r--openssl-1.1.0h/test/asynciotest.c382
-rw-r--r--openssl-1.1.0h/test/asynctest.c291
-rw-r--r--openssl-1.1.0h/test/bad_dtls_test.c624
-rw-r--r--openssl-1.1.0h/test/bftest.c484
-rw-r--r--openssl-1.1.0h/test/bio_enc_test.c138
-rw-r--r--openssl-1.1.0h/test/bioprinttest.c225
-rw-r--r--openssl-1.1.0h/test/bntest.c2094
-rw-r--r--openssl-1.1.0h/test/build.info326
-rw-r--r--openssl-1.1.0h/test/casttest.c163
-rw-r--r--openssl-1.1.0h/test/certs/alt1-cert.pem22
-rw-r--r--openssl-1.1.0h/test/certs/alt1-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/alt2-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/alt2-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/alt3-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/alt3-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/bad-pc3-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/bad-pc3-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/bad-pc4-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/bad-pc4-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/bad-pc6-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/bad-pc6-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/bad.key27
-rw-r--r--openssl-1.1.0h/test/certs/bad.pem21
-rw-r--r--openssl-1.1.0h/test/certs/badalt1-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/badalt1-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt10-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/badalt10-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt2-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/badalt2-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt3-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/badalt3-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt4-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/badalt4-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt5-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/badalt5-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt6-cert.pem22
-rw-r--r--openssl-1.1.0h/test/certs/badalt6-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt7-cert.pem23
-rw-r--r--openssl-1.1.0h/test/certs/badalt7-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt8-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/badalt8-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/badalt9-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/badalt9-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/ca+anyEKU.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca+clientAuth.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca+serverAuth.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-anyEKU.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-cert-768.pem15
-rw-r--r--openssl-1.1.0h/test/certs/ca-cert-768i.pem15
-rw-r--r--openssl-1.1.0h/test/certs/ca-cert-md5-any.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-cert-md5.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-cert.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-cert2.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-clientAuth.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-expired.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-key-768.pem13
-rw-r--r--openssl-1.1.0h/test/certs/ca-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/ca-key2.pem28
-rw-r--r--openssl-1.1.0h/test/certs/ca-name2.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-nonbc.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-nonca.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ca-root2.pem18
-rw-r--r--openssl-1.1.0h/test/certs/ca-serverAuth.pem18
-rw-r--r--openssl-1.1.0h/test/certs/cca+anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/cca+clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/cca+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/cca-anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/cca-cert.pem19
-rw-r--r--openssl-1.1.0h/test/certs/cca-clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/cca-serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/croot+anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/croot+clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/croot+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/croot-anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/croot-cert.pem19
-rw-r--r--openssl-1.1.0h/test/certs/croot-clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/croot-serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ee+clientAuth.pem20
-rw-r--r--openssl-1.1.0h/test/certs/ee+serverAuth.pem20
-rw-r--r--openssl-1.1.0h/test/certs/ee-cert-768.pem16
-rw-r--r--openssl-1.1.0h/test/certs/ee-cert-768i.pem16
-rw-r--r--openssl-1.1.0h/test/certs/ee-cert-md5.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ee-cert.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ee-cert2.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ee-client-chain.pem37
-rw-r--r--openssl-1.1.0h/test/certs/ee-client.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ee-clientAuth.pem20
-rw-r--r--openssl-1.1.0h/test/certs/ee-expired.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ee-key-768.pem13
-rw-r--r--openssl-1.1.0h/test/certs/ee-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/ee-name2.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ee-serverAuth.pem20
-rw-r--r--openssl-1.1.0h/test/certs/embeddedSCTs1-key.pem15
-rw-r--r--openssl-1.1.0h/test/certs/embeddedSCTs1.pem20
-rw-r--r--openssl-1.1.0h/test/certs/embeddedSCTs1.sct12
-rw-r--r--openssl-1.1.0h/test/certs/embeddedSCTs1_issuer.pem18
-rw-r--r--openssl-1.1.0h/test/certs/embeddedSCTs3.pem44
-rw-r--r--openssl-1.1.0h/test/certs/embeddedSCTs3.sct36
-rw-r--r--openssl-1.1.0h/test/certs/embeddedSCTs3_issuer.pem35
-rw-r--r--openssl-1.1.0h/test/certs/interCA.key27
-rw-r--r--openssl-1.1.0h/test/certs/interCA.pem21
-rw-r--r--openssl-1.1.0h/test/certs/leaf.key27
-rw-r--r--openssl-1.1.0h/test/certs/leaf.pem21
-rw-r--r--openssl-1.1.0h/test/certs/many-constraints.pem292
-rw-r--r--openssl-1.1.0h/test/certs/many-names1.pem409
-rw-r--r--openssl-1.1.0h/test/certs/many-names2.pem251
-rw-r--r--openssl-1.1.0h/test/certs/many-names3.pem571
-rwxr-xr-xopenssl-1.1.0h/test/certs/mkcert.sh254
-rw-r--r--openssl-1.1.0h/test/certs/nca+anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/nca+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/ncca-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/ncca-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/ncca1-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/ncca1-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/ncca2-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/ncca2-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/ncca3-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/ncca3-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/nroot+anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/nroot+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/pathlen.pem22
-rw-r--r--openssl-1.1.0h/test/certs/pc1-cert.pem20
-rw-r--r--openssl-1.1.0h/test/certs/pc1-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/pc2-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/pc2-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/pc5-cert.pem21
-rw-r--r--openssl-1.1.0h/test/certs/pc5-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/root+anyEKU.pem18
-rw-r--r--openssl-1.1.0h/test/certs/root+clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root-anyEKU.pem18
-rw-r--r--openssl-1.1.0h/test/certs/root-cert-768.pem11
-rw-r--r--openssl-1.1.0h/test/certs/root-cert-md5.pem18
-rw-r--r--openssl-1.1.0h/test/certs/root-cert.pem18
-rw-r--r--openssl-1.1.0h/test/certs/root-cert2.pem18
-rw-r--r--openssl-1.1.0h/test/certs/root-clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root-key-768.pem13
-rw-r--r--openssl-1.1.0h/test/certs/root-key.pem28
-rw-r--r--openssl-1.1.0h/test/certs/root-key2.pem28
-rw-r--r--openssl-1.1.0h/test/certs/root-name2.pem18
-rw-r--r--openssl-1.1.0h/test/certs/root-nonca.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root-noserver.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root-serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root2+clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root2+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/root2-serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/rootCA.key27
-rw-r--r--openssl-1.1.0h/test/certs/rootCA.pem21
-rw-r--r--openssl-1.1.0h/test/certs/rootcert.pem18
-rw-r--r--openssl-1.1.0h/test/certs/rootkey.pem28
-rw-r--r--openssl-1.1.0h/test/certs/roots.pem42
-rw-r--r--openssl-1.1.0h/test/certs/sca+anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sca+clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sca+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sca-anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sca-cert.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sca-clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sca-serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/server-trusted.pem20
-rw-r--r--openssl-1.1.0h/test/certs/servercert.pem19
-rw-r--r--openssl-1.1.0h/test/certs/serverkey.pem28
-rwxr-xr-xopenssl-1.1.0h/test/certs/setup.sh346
-rw-r--r--openssl-1.1.0h/test/certs/some-names1.pem211
-rw-r--r--openssl-1.1.0h/test/certs/some-names2.pem133
-rw-r--r--openssl-1.1.0h/test/certs/some-names3.pem293
-rw-r--r--openssl-1.1.0h/test/certs/sroot+anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sroot+clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sroot+serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sroot-anyEKU.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sroot-cert.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sroot-clientAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/sroot-serverAuth.pem19
-rw-r--r--openssl-1.1.0h/test/certs/subinterCA-ss.pem21
-rw-r--r--openssl-1.1.0h/test/certs/subinterCA.key27
-rw-r--r--openssl-1.1.0h/test/certs/subinterCA.pem21
-rw-r--r--openssl-1.1.0h/test/certs/untrusted.pem42
-rw-r--r--openssl-1.1.0h/test/certs/wrongcert.pem19
-rw-r--r--openssl-1.1.0h/test/certs/wrongkey.pem28
-rw-r--r--openssl-1.1.0h/test/cipherlist_test.c199
-rw-r--r--openssl-1.1.0h/test/clienthellotest.c147
-rw-r--r--openssl-1.1.0h/test/cms-examples.pl365
-rw-r--r--openssl-1.1.0h/test/constant_time_test.c268
-rw-r--r--openssl-1.1.0h/test/crltest.c378
-rw-r--r--openssl-1.1.0h/test/ct/log_list.conf38
-rw-r--r--openssl-1.1.0h/test/ct/tls1.sct12
-rw-r--r--openssl-1.1.0h/test/ct_test.c607
-rw-r--r--openssl-1.1.0h/test/d2i-tests/bad-cms.der1
-rw-r--r--openssl-1.1.0h/test/d2i-tests/bad-int-pad0.derbin0 -> 4 bytes-rw-r--r--openssl-1.1.0h/test/d2i-tests/bad-int-padminus1.der1
-rw-r--r--openssl-1.1.0h/test/d2i-tests/bad_bio.derbin0 -> 7 bytes-rw-r--r--openssl-1.1.0h/test/d2i-tests/bad_cert.derbin0 -> 1007 bytes-rw-r--r--openssl-1.1.0h/test/d2i-tests/bad_generalname.der1
-rw-r--r--openssl-1.1.0h/test/d2i-tests/high_tag.derbin0 -> 6 bytes-rw-r--r--openssl-1.1.0h/test/d2i-tests/int0.derbin0 -> 3 bytes-rw-r--r--openssl-1.1.0h/test/d2i-tests/int1.der1
-rw-r--r--openssl-1.1.0h/test/d2i-tests/intminus1.der1
-rw-r--r--openssl-1.1.0h/test/d2i_test.c222
-rw-r--r--openssl-1.1.0h/test/danetest.c504
-rw-r--r--openssl-1.1.0h/test/danetest.in1878
-rw-r--r--openssl-1.1.0h/test/danetest.pem14
-rw-r--r--openssl-1.1.0h/test/destest.c804
-rw-r--r--openssl-1.1.0h/test/dhtest.c626
-rw-r--r--openssl-1.1.0h/test/dsatest.c196
-rw-r--r--openssl-1.1.0h/test/dtlstest.c143
-rw-r--r--openssl-1.1.0h/test/dtlsv1listentest.c426
-rw-r--r--openssl-1.1.0h/test/ecdsatest.c519
-rw-r--r--openssl-1.1.0h/test/ectest.c1776
-rw-r--r--openssl-1.1.0h/test/enginetest.c408
-rw-r--r--openssl-1.1.0h/test/evp_extra_test.c409
-rw-r--r--openssl-1.1.0h/test/evp_test.c2172
-rw-r--r--openssl-1.1.0h/test/evptests.txt19244
-rw-r--r--openssl-1.1.0h/test/exdatatest.c234
-rw-r--r--openssl-1.1.0h/test/exptest.c270
-rw-r--r--openssl-1.1.0h/test/fatalerrtest.c125
-rw-r--r--openssl-1.1.0h/test/generate_buildtest.pl34
-rw-r--r--openssl-1.1.0h/test/generate_ssl_tests.pl141
-rw-r--r--openssl-1.1.0h/test/gmdifftest.c81
-rw-r--r--openssl-1.1.0h/test/handshake_helper.c1106
-rw-r--r--openssl-1.1.0h/test/handshake_helper.h59
-rw-r--r--openssl-1.1.0h/test/heartbeat_test.c378
-rw-r--r--openssl-1.1.0h/test/hmactest.c312
-rw-r--r--openssl-1.1.0h/test/ideatest.c178
-rw-r--r--openssl-1.1.0h/test/igetest.c441
-rw-r--r--openssl-1.1.0h/test/md2test.c92
-rw-r--r--openssl-1.1.0h/test/md4test.c87
-rw-r--r--openssl-1.1.0h/test/md5test.c88
-rw-r--r--openssl-1.1.0h/test/mdc2test.c99
-rw-r--r--openssl-1.1.0h/test/memleaktest.c46
-rw-r--r--openssl-1.1.0h/test/methtest.c57
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D1.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D1_Cert_EE.pem38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D1_Issuer_ICA.pem27
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D2.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D2_Cert_ICA.pem26
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D2_Issuer_Root.pem21
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D3.ors38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D3_Cert_EE.pem31
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/D3_Issuer_Root.pem83
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISDOSC_D1.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISDOSC_D2.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISDOSC_D3.ors38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISIC_D1_Issuer_ICA.pem27
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISIC_D2_Issuer_Root.pem21
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISIC_D3_Issuer_Root.pem41
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISIC_ND1_Issuer_ICA.pem29
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISIC_ND2_Issuer_Root.pem23
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISIC_ND3_Issuer_Root.pem25
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISOP_D1.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISOP_D2.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISOP_D3.ors38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISOP_ND1.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISOP_ND2.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ISOP_ND3.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND1.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND1_Cert_EE.pem36
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND1_Cross_Root.pem25
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND1_Issuer_ICA-Cross.pem58
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND1_Issuer_ICA.pem29
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND2.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND2_Cert_ICA.pem29
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND2_Issuer_Root.pem23
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND3.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND3_Cert_EE.pem34
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/ND3_Issuer_Root.pem25
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WIKH_D1.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WIKH_D2.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WIKH_D3.ors38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WIKH_ND1.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WIKH_ND2.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WIKH_ND3.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WINH_D1.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WINH_D2.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WINH_D3.ors38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WINH_ND1.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WINH_ND2.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WINH_ND3.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKDOSC_D1.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKDOSC_D2.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKDOSC_D3.ors38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKIC_D1_Issuer_ICA.pem27
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKIC_D2_Issuer_Root.pem21
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKIC_D3_Issuer_Root.pem41
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKIC_ND1_Issuer_ICA.pem29
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKIC_ND2_Issuer_Root.pem23
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WKIC_ND3_Issuer_Root.pem25
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WRID_D1.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WRID_D2.ors32
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WRID_D3.ors38
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WRID_ND1.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WRID_ND2.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WRID_ND3.ors10
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WSNIC_D1_Issuer_ICA.pem27
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WSNIC_D2_Issuer_Root.pem21
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WSNIC_D3_Issuer_Root.pem41
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WSNIC_ND1_Issuer_ICA.pem29
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WSNIC_ND2_Issuer_Root.pem23
-rw-r--r--openssl-1.1.0h/test/ocsp-tests/WSNIC_ND3_Issuer_Root.pem25
-rw-r--r--openssl-1.1.0h/test/ocspapitest.c168
-rw-r--r--openssl-1.1.0h/test/p5_crpt2_test.c159
-rw-r--r--openssl-1.1.0h/test/packettest.c537
-rw-r--r--openssl-1.1.0h/test/pbelutest.c47
-rw-r--r--openssl-1.1.0h/test/pkcs7-1.pem15
-rw-r--r--openssl-1.1.0h/test/pkcs7.pem54
-rw-r--r--openssl-1.1.0h/test/pkits-test.pl905
-rw-r--r--openssl-1.1.0h/test/r160test.c9
-rw-r--r--openssl-1.1.0h/test/randtest.c145
-rw-r--r--openssl-1.1.0h/test/rc2test.c99
-rw-r--r--openssl-1.1.0h/test/rc4test.c175
-rw-r--r--openssl-1.1.0h/test/rc5test.c276
-rw-r--r--openssl-1.1.0h/test/recipes/01-test_abort.t16
-rw-r--r--openssl-1.1.0h/test/recipes/01-test_sanity.t12
-rw-r--r--openssl-1.1.0h/test/recipes/01-test_symbol_presence.t116
-rw-r--r--openssl-1.1.0h/test/recipes/02-test_ordinals.t58
-rw-r--r--openssl-1.1.0h/test/recipes/03-test_exdata.t12
-rw-r--r--openssl-1.1.0h/test/recipes/03-test_ui.t30
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem.t106
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/NOTES3
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/beermug.pem30
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-1023line.pem13
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-1024line.pem13
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-1025line.pem13
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-255line.pem25
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-256line.pem25
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-257line.pem25
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-blankline.pem29
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-comment.pem29
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-earlypad.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-extrapad.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-infixwhitespace.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-junk.pem29
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-leadingwhitespace.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-longline.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-misalignedpad.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-onecolumn.pem1646
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-oneline.pem3
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-shortandlongline.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-shortline.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-threecolumn.pem550
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert-trailingwhitespace.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/cert.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/csr.pem21
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-1023line.pem9
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-1024line.pem8
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-1025line.pem8
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-255line.pem21
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-256line.pem20
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-257line.pem20
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-blankline.pem24
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-comment.pem24
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-corruptedheader.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-corruptiv.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-earlypad.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-extrapad.pem24
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-infixwhitespace.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-junk.pem24
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-leadingwhitespace.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-longline.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-misalignedpad.pem24
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-onecolumn.pem1157
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-oneline.pem6
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-onelineheader.pem22
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-shortandlongline.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-shortline.pem24
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-threecolumn.pem389
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa-trailingwhitespace.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsa.pem23
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/dsaparam.pem14
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/key.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/04-test_pem_data/wellknown1
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_bf.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_cast.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_des.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_hmac.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_idea.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_md2.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_md4.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_md5.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_mdc2.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_rand.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_rc2.t11
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_rc4.t11
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_rc5.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_rmd.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_sha1.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_sha256.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_sha512.t12
-rw-r--r--openssl-1.1.0h/test/recipes/05-test_wp.t12
-rw-r--r--openssl-1.1.0h/test/recipes/10-test_bn.t84
-rw-r--r--openssl-1.1.0h/test/recipes/10-test_exp.t12
-rw-r--r--openssl-1.1.0h/test/recipes/15-test_dh.t12
-rw-r--r--openssl-1.1.0h/test/recipes/15-test_dsa.t40
-rw-r--r--openssl-1.1.0h/test/recipes/15-test_ec.t38
-rw-r--r--openssl-1.1.0h/test/recipes/15-test_ecdsa.t12
-rw-r--r--openssl-1.1.0h/test/recipes/15-test_genrsa.t26
-rw-r--r--openssl-1.1.0h/test/recipes/15-test_rsa.t47
-rw-r--r--openssl-1.1.0h/test/recipes/15-test_rsapss.t49
-rw-r--r--openssl-1.1.0h/test/recipes/20-test_enc.t69
-rw-r--r--openssl-1.1.0h/test/recipes/20-test_passwd.t39
-rw-r--r--openssl-1.1.0h/test/recipes/25-test_crl.t43
-rw-r--r--openssl-1.1.0h/test/recipes/25-test_d2i.t93
-rw-r--r--openssl-1.1.0h/test/recipes/25-test_pkcs7.t27
-rw-r--r--openssl-1.1.0h/test/recipes/25-test_req.t76
-rw-r--r--openssl-1.1.0h/test/recipes/25-test_sid.t24
-rw-r--r--openssl-1.1.0h/test/recipes/25-test_verify.t380
-rw-r--r--openssl-1.1.0h/test/recipes/25-test_x509.t34
-rw-r--r--openssl-1.1.0h/test/recipes/30-test_afalg.t23
-rw-r--r--openssl-1.1.0h/test/recipes/30-test_engine.t18
-rw-r--r--openssl-1.1.0h/test/recipes/30-test_evp.t19
-rw-r--r--openssl-1.1.0h/test/recipes/30-test_evp_extra.t18
-rw-r--r--openssl-1.1.0h/test/recipes/30-test_pbelu.t12
-rw-r--r--openssl-1.1.0h/test/recipes/40-test_rehash.t98
-rw-r--r--openssl-1.1.0h/test/recipes/60-test_x509_store.t53
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_asyncio.t21
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_bad_dtls.t20
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_clienthello.t20
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_packet.t12
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslcbcpadding.t110
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslcertstatus.t66
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslextension.t112
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslmessages.t147
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslrecords.t381
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslsessiontick.t268
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslskewith0p.t65
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_sslvertol.t67
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_tlsextms.t238
-rw-r--r--openssl-1.1.0h/test/recipes/70-test_verify_extra.t19
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ca.t59
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_cipherlist.t26
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_cms.t511
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ct.t17
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_dane.t24
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_dtls.t20
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_dtlsv1listen.t12
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ocsp.t219
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ocsp_data/cert.pem19
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ocsp_data/key.pem28
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_pkcs12.t68
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ssl_new.t133
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ssl_old.t629
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_ssl_test_ctx.t19
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_sslcorrupt.t20
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_tsa.t207
-rw-r--r--openssl-1.1.0h/test/recipes/80-test_x509aux.t27
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_async.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_bio_enc.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_bioprint.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_constant_time.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_fatalerr.t21
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_fuzz.t40
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_gmdiff.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_heartbeat.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_ige.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_memleak.t15
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_p5_crpt2.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_secmem.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_shlibload.t38
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_srp.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_sslapi.t21
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_threads.t12
-rw-r--r--openssl-1.1.0h/test/recipes/90-test_v3name.t12
-rw-r--r--openssl-1.1.0h/test/recipes/bc.pl113
-rw-r--r--openssl-1.1.0h/test/recipes/tconversion.pl105
-rw-r--r--openssl-1.1.0h/test/rmdtest.c92
-rw-r--r--openssl-1.1.0h/test/rsa_test.c344
-rw-r--r--openssl-1.1.0h/test/run_tests.pl113
-rw-r--r--openssl-1.1.0h/test/sanitytest.c67
-rw-r--r--openssl-1.1.0h/test/secmemtest.c176
-rw-r--r--openssl-1.1.0h/test/serverinfo.pem16
-rw-r--r--openssl-1.1.0h/test/sha1test.c111
-rw-r--r--openssl-1.1.0h/test/sha256t.c177
-rw-r--r--openssl-1.1.0h/test/sha512t.c199
-rw-r--r--openssl-1.1.0h/test/shibboleth.pfxbin0 -> 2519 bytes-rw-r--r--openssl-1.1.0h/test/shlibloadtest.c245
-rw-r--r--openssl-1.1.0h/test/smcont.txt1
-rw-r--r--openssl-1.1.0h/test/smime-certs/ca.cnf66
-rw-r--r--openssl-1.1.0h/test/smime-certs/mksmime-certs.sh85
-rw-r--r--openssl-1.1.0h/test/smime-certs/smdh.pem33
-rw-r--r--openssl-1.1.0h/test/smime-certs/smdsa1.pem47
-rw-r--r--openssl-1.1.0h/test/smime-certs/smdsa2.pem47
-rw-r--r--openssl-1.1.0h/test/smime-certs/smdsa3.pem47
-rw-r--r--openssl-1.1.0h/test/smime-certs/smdsap.pem9
-rw-r--r--openssl-1.1.0h/test/smime-certs/smec1.pem22
-rw-r--r--openssl-1.1.0h/test/smime-certs/smec2.pem23
-rw-r--r--openssl-1.1.0h/test/smime-certs/smec3.pem22
-rw-r--r--openssl-1.1.0h/test/smime-certs/smroot.pem49
-rw-r--r--openssl-1.1.0h/test/smime-certs/smrsa1.pem49
-rw-r--r--openssl-1.1.0h/test/smime-certs/smrsa2.pem49
-rw-r--r--openssl-1.1.0h/test/smime-certs/smrsa3.pem49
-rw-r--r--openssl-1.1.0h/test/srptest.c312
-rw-r--r--openssl-1.1.0h/test/ssl-tests/01-simple.conf78
-rw-r--r--openssl-1.1.0h/test/ssl-tests/01-simple.conf.in42
-rw-r--r--openssl-1.1.0h/test/ssl-tests/02-protocol-version.conf9975
-rw-r--r--openssl-1.1.0h/test/ssl-tests/02-protocol-version.conf.in19
-rw-r--r--openssl-1.1.0h/test/ssl-tests/03-custom_verify.conf238
-rw-r--r--openssl-1.1.0h/test/ssl-tests/03-custom_verify.conf.in145
-rw-r--r--openssl-1.1.0h/test/ssl-tests/04-client_auth.conf592
-rw-r--r--openssl-1.1.0h/test/ssl-tests/04-client_auth.conf.in123
-rw-r--r--openssl-1.1.0h/test/ssl-tests/05-sni.conf203
-rw-r--r--openssl-1.1.0h/test/ssl-tests/05-sni.conf.in112
-rw-r--r--openssl-1.1.0h/test/ssl-tests/06-sni-ticket.conf734
-rw-r--r--openssl-1.1.0h/test/ssl-tests/06-sni-ticket.conf.in95
-rw-r--r--openssl-1.1.0h/test/ssl-tests/07-dtls-protocol-version.conf1820
-rw-r--r--openssl-1.1.0h/test/ssl-tests/07-dtls-protocol-version.conf.in19
-rw-r--r--openssl-1.1.0h/test/ssl-tests/08-npn.conf794
-rw-r--r--openssl-1.1.0h/test/ssl-tests/08-npn.conf.in420
-rw-r--r--openssl-1.1.0h/test/ssl-tests/09-alpn.conf619
-rw-r--r--openssl-1.1.0h/test/ssl-tests/09-alpn.conf.in324
-rw-r--r--openssl-1.1.0h/test/ssl-tests/10-resumption.conf1336
-rw-r--r--openssl-1.1.0h/test/ssl-tests/10-resumption.conf.in19
-rw-r--r--openssl-1.1.0h/test/ssl-tests/11-dtls_resumption.conf612
-rw-r--r--openssl-1.1.0h/test/ssl-tests/11-dtls_resumption.conf.in19
-rw-r--r--openssl-1.1.0h/test/ssl-tests/12-ct.conf191
-rw-r--r--openssl-1.1.0h/test/ssl-tests/12-ct.conf.in119
-rw-r--r--openssl-1.1.0h/test/ssl-tests/13-fragmentation.conf397
-rw-r--r--openssl-1.1.0h/test/ssl-tests/13-fragmentation.conf.in181
-rw-r--r--openssl-1.1.0h/test/ssl-tests/14-curves.conf787
-rw-r--r--openssl-1.1.0h/test/ssl-tests/14-curves.conf.in44
-rw-r--r--openssl-1.1.0h/test/ssl-tests/15-certstatus.conf62
-rw-r--r--openssl-1.1.0h/test/ssl-tests/15-certstatus.conf.in45
-rw-r--r--openssl-1.1.0h/test/ssl-tests/16-certstatus.conf0
-rw-r--r--openssl-1.1.0h/test/ssl-tests/16-dtls-certstatus.conf62
-rw-r--r--openssl-1.1.0h/test/ssl-tests/16-dtls-certstatus.conf.in45
-rw-r--r--openssl-1.1.0h/test/ssl-tests/17-renegotiate.conf428
-rw-r--r--openssl-1.1.0h/test/ssl-tests/17-renegotiate.conf.in243
-rw-r--r--openssl-1.1.0h/test/ssl-tests/18-dtls-renegotiate.conf276
-rw-r--r--openssl-1.1.0h/test/ssl-tests/18-dtls-renegotiate.conf.in174
-rw-r--r--openssl-1.1.0h/test/ssl-tests/19-mac-then-encrypt.conf156
-rw-r--r--openssl-1.1.0h/test/ssl-tests/19-mac-then-encrypt.conf.in89
-rw-r--r--openssl-1.1.0h/test/ssl-tests/protocol_version.pm247
-rw-r--r--openssl-1.1.0h/test/ssl-tests/ssltests_base.pm30
-rw-r--r--openssl-1.1.0h/test/ssl_test.c371
-rw-r--r--openssl-1.1.0h/test/ssl_test.tmpl126
-rw-r--r--openssl-1.1.0h/test/ssl_test_ctx.c662
-rw-r--r--openssl-1.1.0h/test/ssl_test_ctx.h191
-rw-r--r--openssl-1.1.0h/test/ssl_test_ctx_test.c338
-rw-r--r--openssl-1.1.0h/test/ssl_test_ctx_test.conf88
-rw-r--r--openssl-1.1.0h/test/sslapitest.c1262
-rw-r--r--openssl-1.1.0h/test/sslcorrupttest.c283
-rw-r--r--openssl-1.1.0h/test/ssltest_old.c3210
-rw-r--r--openssl-1.1.0h/test/ssltestlib.c710
-rw-r--r--openssl-1.1.0h/test/ssltestlib.h41
-rw-r--r--openssl-1.1.0h/test/test.cnf88
-rw-r--r--openssl-1.1.0h/test/testcrl.pem16
-rw-r--r--openssl-1.1.0h/test/testdsa.pem12
-rw-r--r--openssl-1.1.0h/test/testdsapub.pem12
-rw-r--r--openssl-1.1.0h/test/testec-p256.pem5
-rw-r--r--openssl-1.1.0h/test/testecpub-p256.pem4
-rw-r--r--openssl-1.1.0h/test/testp7.pem46
-rw-r--r--openssl-1.1.0h/test/testreq2.pem7
-rw-r--r--openssl-1.1.0h/test/testrsa.pem9
-rw-r--r--openssl-1.1.0h/test/testrsapub.pem4
-rw-r--r--openssl-1.1.0h/test/testsid.pem38
-rw-r--r--openssl-1.1.0h/test/testutil.c109
-rw-r--r--openssl-1.1.0h/test/testutil.h111
-rw-r--r--openssl-1.1.0h/test/testx509.pem10
-rw-r--r--openssl-1.1.0h/test/threadstest.c246
-rw-r--r--openssl-1.1.0h/test/v3-cert1.pem16
-rw-r--r--openssl-1.1.0h/test/v3-cert2.pem16
-rw-r--r--openssl-1.1.0h/test/v3ext.c42
-rw-r--r--openssl-1.1.0h/test/v3nametest.c355
-rw-r--r--openssl-1.1.0h/test/verify_extra_test.c162
-rw-r--r--openssl-1.1.0h/test/wp_test.c233
-rw-r--r--openssl-1.1.0h/test/x509aux.c231
-rw-r--r--openssl-1.1.0h/tools/build.info7
-rw-r--r--openssl-1.1.0h/tools/c_rehash.in231
-rw-r--r--openssl-1.1.0h/util/build.info8
-rwxr-xr-xopenssl-1.1.0h/util/ck_errf.pl70
-rw-r--r--openssl-1.1.0h/util/copy.pl78
-rw-r--r--openssl-1.1.0h/util/dofile.pl210
-rwxr-xr-xopenssl-1.1.0h/util/find-doc-nits549
-rwxr-xr-xopenssl-1.1.0h/util/find-undoc-api.pl82
-rwxr-xr-xopenssl-1.1.0h/util/find-unused-errs35
-rw-r--r--openssl-1.1.0h/util/fipslink.pl115
-rwxr-xr-xopenssl-1.1.0h/util/incore454
-rw-r--r--openssl-1.1.0h/util/indent.pro672
-rw-r--r--openssl-1.1.0h/util/libcrypto.num4236
-rw-r--r--openssl-1.1.0h/util/libssl.num407
-rw-r--r--openssl-1.1.0h/util/local_shlib.com.in30
-rwxr-xr-xopenssl-1.1.0h/util/mkbuildinf.pl41
-rwxr-xr-xopenssl-1.1.0h/util/mkcerts.sh220
-rwxr-xr-xopenssl-1.1.0h/util/mkdef.pl1685
-rwxr-xr-xopenssl-1.1.0h/util/mkdir-p.pl44
-rw-r--r--openssl-1.1.0h/util/mkerr.pl771
-rwxr-xr-xopenssl-1.1.0h/util/mkrc.pl83
-rwxr-xr-xopenssl-1.1.0h/util/openssl-format-source175
-rwxr-xr-xopenssl-1.1.0h/util/opensslwrap.sh26
-rw-r--r--openssl-1.1.0h/util/perl/OpenSSL/Glob.pm21
-rw-r--r--openssl-1.1.0h/util/perl/OpenSSL/Test.pm1051
-rw-r--r--openssl-1.1.0h/util/perl/OpenSSL/Test/Simple.pm91
-rw-r--r--openssl-1.1.0h/util/perl/OpenSSL/Test/Utils.pm240
-rw-r--r--openssl-1.1.0h/util/perl/OpenSSL/Util/Pod.pm158
-rw-r--r--openssl-1.1.0h/util/perl/TLSProxy/ClientHello.pm242
-rw-r--r--openssl-1.1.0h/util/perl/TLSProxy/Message.pm456
-rw-r--r--openssl-1.1.0h/util/perl/TLSProxy/NewSessionTicket.pm81
-rw-r--r--openssl-1.1.0h/util/perl/TLSProxy/Proxy.pm553
-rw-r--r--openssl-1.1.0h/util/perl/TLSProxy/Record.pm339
-rw-r--r--openssl-1.1.0h/util/perl/TLSProxy/ServerHello.pm210
-rw-r--r--openssl-1.1.0h/util/perl/TLSProxy/ServerKeyExchange.pm134
-rw-r--r--openssl-1.1.0h/util/perl/with_fallback.pm25
-rwxr-xr-xopenssl-1.1.0h/util/point.sh10
-rwxr-xr-xopenssl-1.1.0h/util/process_docs.pl248
-rw-r--r--openssl-1.1.0h/util/selftest.pl207
-rwxr-xr-xopenssl-1.1.0h/util/shlib_wrap.sh.in128
-rw-r--r--openssl-1.1.0h/util/su-filter.pl264
-rw-r--r--openssl-1.1.0h/util/unlocal_shlib.com.in26
-rw-r--r--pop.cpp252
-rw-r--r--push.cpp123
-rw-r--r--test_config.ini50
-rw-r--r--timeout_handler.cpp81
-rw-r--r--timeout_handler.hpp75
-rw-r--r--utilities.h83
-rw-r--r--vmime-master/.gitignore41
-rw-r--r--vmime-master/.travis.yml37
-rw-r--r--vmime-master/AUTHORS38
-rw-r--r--vmime-master/CMakeLists.txt1038
-rw-r--r--vmime-master/COPYING674
-rw-r--r--vmime-master/COPYING.OpenSSL26
-rw-r--r--vmime-master/Doxyfile.in1043
-rw-r--r--vmime-master/HACKING360
-rw-r--r--vmime-master/NEWS0
-rw-r--r--vmime-master/README30
-rw-r--r--vmime-master/README.autotools13
-rwxr-xr-xvmime-master/build_for_losedows.sh23
-rw-r--r--vmime-master/cmake/FindCppUnit.cmake34
-rw-r--r--vmime-master/cmake/FindGSasl.cmake51
-rw-r--r--vmime-master/cmake/FindICU.cmake314
-rw-r--r--vmime-master/cmake/FindIconv.cmake61
-rw-r--r--vmime-master/cmake/Utils.cmake13
-rw-r--r--vmime-master/cmake/config.hpp.cmake97
-rw-r--r--vmime-master/config_header/config.hpp97
-rw-r--r--vmime-master/contrib/punycode/punycode.c264
-rw-r--r--vmime-master/contrib/punycode/punycode.h84
-rw-r--r--vmime-master/contrib/utf8/utf8.h34
-rw-r--r--vmime-master/contrib/utf8/utf8/checked.h327
-rw-r--r--vmime-master/contrib/utf8/utf8/core.h326
-rw-r--r--vmime-master/contrib/utf8/utf8/unchecked.h228
-rw-r--r--vmime-master/doc/book/.gitignore17
-rw-r--r--vmime-master/doc/book/basics.tex823
-rw-r--r--vmime-master/doc/book/book.tex118
-rw-r--r--vmime-master/doc/book/building.tex175
-rw-r--r--vmime-master/doc/book/images/address-mailbox-mailboxgroup.svg355
-rw-r--r--vmime-master/doc/book/images/message-body-header.svg716
-rw-r--r--vmime-master/doc/book/images/messaging-services.svg617
-rw-r--r--vmime-master/doc/book/intro.tex90
-rw-r--r--vmime-master/doc/book/msg.tex430
-rw-r--r--vmime-master/doc/book/net.tex1203
-rw-r--r--vmime-master/doc/book/start.tex111
-rw-r--r--vmime-master/examples/CMakeLists.txt38
-rw-r--r--vmime-master/examples/example1.cpp107
-rw-r--r--vmime-master/examples/example2.cpp121
-rw-r--r--vmime-master/examples/example3.cpp153
-rw-r--r--vmime-master/examples/example4.cpp108
-rw-r--r--vmime-master/examples/example5.cpp85
-rw-r--r--vmime-master/examples/example6.cpp938
-rw-r--r--vmime-master/examples/example6_authenticator.hpp112
-rw-r--r--vmime-master/examples/example6_certificateVerifier.hpp64
-rw-r--r--vmime-master/examples/example6_timeoutHandler.hpp60
-rw-r--r--vmime-master/examples/example6_tracer.hpp59
-rw-r--r--vmime-master/examples/example7.cpp118
-rw-r--r--vmime-master/examples/viewer/CMakeLists.txt31
-rw-r--r--vmime-master/examples/viewer/viewer.cpp294
-rw-r--r--vmime-master/mingw_cross_toolchain.cmake14
-rw-r--r--vmime-master/src/vmime/address.cpp236
-rw-r--r--vmime-master/src/vmime/address.hpp89
-rw-r--r--vmime-master/src/vmime/addressList.cpp328
-rw-r--r--vmime-master/src/vmime/addressList.hpp198
-rw-r--r--vmime-master/src/vmime/attachment.hpp116
-rw-r--r--vmime-master/src/vmime/attachmentHelper.cpp339
-rw-r--r--vmime-master/src/vmime/attachmentHelper.hpp137
-rw-r--r--vmime-master/src/vmime/base.cpp158
-rw-r--r--vmime-master/src/vmime/base.hpp258
-rw-r--r--vmime-master/src/vmime/body.cpp1111
-rw-r--r--vmime-master/src/vmime/body.hpp365
-rw-r--r--vmime-master/src/vmime/bodyPart.cpp198
-rw-r--r--vmime-master/src/vmime/bodyPart.hpp155
-rw-r--r--vmime-master/src/vmime/bodyPartAttachment.cpp147
-rw-r--r--vmime-master/src/vmime/bodyPartAttachment.hpp76
-rw-r--r--vmime-master/src/vmime/charset.cpp268
-rw-r--r--vmime-master/src/vmime/charset.hpp176
-rw-r--r--vmime-master/src/vmime/charsetConverter.cpp53
-rw-r--r--vmime-master/src/vmime/charsetConverter.hpp162
-rw-r--r--vmime-master/src/vmime/charsetConverterOptions.cpp37
-rw-r--r--vmime-master/src/vmime/charsetConverterOptions.hpp59
-rw-r--r--vmime-master/src/vmime/charsetConverter_iconv.cpp537
-rw-r--r--vmime-master/src/vmime/charsetConverter_iconv.hpp145
-rw-r--r--vmime-master/src/vmime/charsetConverter_icu.cpp572
-rw-r--r--vmime-master/src/vmime/charsetConverter_icu.hpp137
-rw-r--r--vmime-master/src/vmime/charsetConverter_idna.cpp208
-rw-r--r--vmime-master/src/vmime/charsetConverter_idna.hpp74
-rw-r--r--vmime-master/src/vmime/charsetConverter_win.cpp227
-rw-r--r--vmime-master/src/vmime/charsetConverter_win.hpp91
-rw-r--r--vmime-master/src/vmime/component.cpp275
-rw-r--r--vmime-master/src/vmime/component.hpp265
-rw-r--r--vmime-master/src/vmime/constants.cpp251
-rw-r--r--vmime-master/src/vmime/constants.hpp272
-rw-r--r--vmime-master/src/vmime/contentDisposition.cpp144
-rw-r--r--vmime-master/src/vmime/contentDisposition.hpp99
-rw-r--r--vmime-master/src/vmime/contentDispositionField.cpp162
-rw-r--r--vmime-master/src/vmime/contentDispositionField.hpp146
-rw-r--r--vmime-master/src/vmime/contentHandler.cpp39
-rw-r--r--vmime-master/src/vmime/contentHandler.hpp147
-rw-r--r--vmime-master/src/vmime/contentTypeField.cpp114
-rw-r--r--vmime-master/src/vmime/contentTypeField.hpp113
-rw-r--r--vmime-master/src/vmime/context.cpp86
-rw-r--r--vmime-master/src/vmime/context.hpp120
-rw-r--r--vmime-master/src/vmime/dateTime.cpp925
-rw-r--r--vmime-master/src/vmime/dateTime.hpp275
-rw-r--r--vmime-master/src/vmime/defaultAttachment.cpp164
-rw-r--r--vmime-master/src/vmime/defaultAttachment.hpp99
-rw-r--r--vmime-master/src/vmime/disposition.cpp351
-rw-r--r--vmime-master/src/vmime/disposition.hpp163
-rw-r--r--vmime-master/src/vmime/emailAddress.cpp708
-rw-r--r--vmime-master/src/vmime/emailAddress.hpp135
-rw-r--r--vmime-master/src/vmime/emptyContentHandler.cpp126
-rw-r--r--vmime-master/src/vmime/emptyContentHandler.hpp80
-rw-r--r--vmime-master/src/vmime/encoding.cpp331
-rw-r--r--vmime-master/src/vmime/encoding.hpp180
-rw-r--r--vmime-master/src/vmime/exception.cpp735
-rw-r--r--vmime-master/src/vmime/exception.hpp865
-rw-r--r--vmime-master/src/vmime/export.hpp36
-rw-r--r--vmime-master/src/vmime/fileAttachment.cpp253
-rw-r--r--vmime-master/src/vmime/fileAttachment.hpp226
-rw-r--r--vmime-master/src/vmime/fileContentHandler.cpp94
-rw-r--r--vmime-master/src/vmime/fileContentHandler.hpp102
-rw-r--r--vmime-master/src/vmime/generatedMessageAttachment.cpp108
-rw-r--r--vmime-master/src/vmime/generatedMessageAttachment.hpp77
-rw-r--r--vmime-master/src/vmime/generationContext.cpp139
-rw-r--r--vmime-master/src/vmime/generationContext.hpp171
-rw-r--r--vmime-master/src/vmime/header.cpp417
-rw-r--r--vmime-master/src/vmime/header.hpp362
-rw-r--r--vmime-master/src/vmime/headerField.cpp374
-rw-r--r--vmime-master/src/vmime/headerField.hpp191
-rw-r--r--vmime-master/src/vmime/headerFieldFactory.cpp158
-rw-r--r--vmime-master/src/vmime/headerFieldFactory.hpp159
-rw-r--r--vmime-master/src/vmime/headerFieldValue.cpp43
-rw-r--r--vmime-master/src/vmime/headerFieldValue.hpp49
-rw-r--r--vmime-master/src/vmime/htmlTextPart.cpp568
-rw-r--r--vmime-master/src/vmime/htmlTextPart.hpp268
-rw-r--r--vmime-master/src/vmime/mailbox.cpp476
-rw-r--r--vmime-master/src/vmime/mailbox.hpp123
-rw-r--r--vmime-master/src/vmime/mailboxField.cpp96
-rw-r--r--vmime-master/src/vmime/mailboxField.hpp69
-rw-r--r--vmime-master/src/vmime/mailboxGroup.cpp406
-rw-r--r--vmime-master/src/vmime/mailboxGroup.hpp206
-rw-r--r--vmime-master/src/vmime/mailboxList.cpp252
-rw-r--r--vmime-master/src/vmime/mailboxList.hpp184
-rw-r--r--vmime-master/src/vmime/mdn/MDNHelper.cpp362
-rw-r--r--vmime-master/src/vmime/mdn/MDNHelper.hpp142
-rw-r--r--vmime-master/src/vmime/mdn/MDNInfos.cpp38
-rw-r--r--vmime-master/src/vmime/mdn/MDNInfos.hpp57
-rw-r--r--vmime-master/src/vmime/mdn/receivedMDNInfos.cpp140
-rw-r--r--vmime-master/src/vmime/mdn/receivedMDNInfos.hpp93
-rw-r--r--vmime-master/src/vmime/mdn/sendableMDNInfos.cpp72
-rw-r--r--vmime-master/src/vmime/mdn/sendableMDNInfos.hpp72
-rw-r--r--vmime-master/src/vmime/mediaType.cpp207
-rw-r--r--vmime-master/src/vmime/mediaType.hpp119
-rw-r--r--vmime-master/src/vmime/message.cpp49
-rw-r--r--vmime-master/src/vmime/message.hpp60
-rw-r--r--vmime-master/src/vmime/messageAttachment.hpp52
-rw-r--r--vmime-master/src/vmime/messageBuilder.cpp333
-rw-r--r--vmime-master/src/vmime/messageBuilder.hpp221
-rw-r--r--vmime-master/src/vmime/messageId.cpp329
-rw-r--r--vmime-master/src/vmime/messageId.hpp144
-rw-r--r--vmime-master/src/vmime/messageIdSequence.cpp277
-rw-r--r--vmime-master/src/vmime/messageIdSequence.hpp175
-rw-r--r--vmime-master/src/vmime/messageParser.cpp328
-rw-r--r--vmime-master/src/vmime/messageParser.hpp164
-rw-r--r--vmime-master/src/vmime/misc/importanceHelper.cpp163
-rw-r--r--vmime-master/src/vmime/misc/importanceHelper.hpp103
-rw-r--r--vmime-master/src/vmime/net/builtinServices.inl76
-rw-r--r--vmime-master/src/vmime/net/connectionInfos.hpp68
-rw-r--r--vmime-master/src/vmime/net/defaultConnectionInfos.cpp60
-rw-r--r--vmime-master/src/vmime/net/defaultConnectionInfos.hpp66
-rw-r--r--vmime-master/src/vmime/net/defaultTimeoutHandler.cpp78
-rw-r--r--vmime-master/src/vmime/net/defaultTimeoutHandler.hpp80
-rw-r--r--vmime-master/src/vmime/net/dsnAttributes.cpp71
-rw-r--r--vmime-master/src/vmime/net/dsnAttributes.hpp114
-rw-r--r--vmime-master/src/vmime/net/events.cpp180
-rw-r--r--vmime-master/src/vmime/net/events.hpp276
-rw-r--r--vmime-master/src/vmime/net/fetchAttributes.cpp98
-rw-r--r--vmime-master/src/vmime/net/fetchAttributes.hpp140
-rw-r--r--vmime-master/src/vmime/net/folder.cpp134
-rw-r--r--vmime-master/src/vmime/net/folder.hpp440
-rw-r--r--vmime-master/src/vmime/net/folderAttributes.cpp122
-rw-r--r--vmime-master/src/vmime/net/folderAttributes.hpp177
-rw-r--r--vmime-master/src/vmime/net/folderStatus.hpp73
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPCommand.cpp437
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPCommand.hpp124
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPConnection.cpp886
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPConnection.hpp172
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPFolder.cpp1622
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPFolder.hpp230
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPFolderStatus.cpp292
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPFolderStatus.hpp123
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessage.cpp760
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessage.hpp200
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessagePart.cpp225
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessagePart.hpp108
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessagePartContentHandler.cpp227
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessagePartContentHandler.hpp95
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessageStructure.cpp94
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPMessageStructure.hpp75
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPParser.hpp4986
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPSStore.cpp82
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPSStore.hpp70
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPServiceInfos.cpp135
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPServiceInfos.hpp89
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPStore.cpp287
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPStore.hpp124
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPTag.cpp148
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPTag.hpp85
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPUtils.cpp854
-rw-r--r--vmime-master/src/vmime/net/imap/IMAPUtils.hpp144
-rw-r--r--vmime-master/src/vmime/net/imap/imap.hpp35
-rw-r--r--vmime-master/src/vmime/net/maildir/format/courierMaildirFormat.cpp569
-rw-r--r--vmime-master/src/vmime/net/maildir/format/courierMaildirFormat.hpp127
-rw-r--r--vmime-master/src/vmime/net/maildir/format/kmailMaildirFormat.cpp337
-rw-r--r--vmime-master/src/vmime/net/maildir/format/kmailMaildirFormat.hpp115
-rw-r--r--vmime-master/src/vmime/net/maildir/maildir.hpp34
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirFolder.cpp1365
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirFolder.hpp211
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirFolderStatus.cpp88
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirFolderStatus.hpp75
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirFormat.cpp104
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirFormat.hpp192
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirMessage.cpp410
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirMessage.hpp137
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirMessagePart.cpp178
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirMessagePart.hpp106
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirMessageStructure.cpp104
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirMessageStructure.hpp82
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirServiceInfos.cpp76
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirServiceInfos.hpp69
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirStore.cpp294
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirStore.hpp123
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirUtils.cpp288
-rw-r--r--vmime-master/src/vmime/net/maildir/maildirUtils.hpp160
-rw-r--r--vmime-master/src/vmime/net/message.cpp155
-rw-r--r--vmime-master/src/vmime/net/message.hpp369
-rw-r--r--vmime-master/src/vmime/net/messageSet.cpp430
-rw-r--r--vmime-master/src/vmime/net/messageSet.hpp358
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Command.cpp267
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Command.hpp123
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Connection.cpp737
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Connection.hpp132
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Folder.cpp822
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Folder.hpp179
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3FolderStatus.cpp88
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3FolderStatus.hpp75
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Message.cpp283
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Message.hpp124
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Response.cpp504
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Response.hpp194
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3SStore.cpp82
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3SStore.hpp74
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3ServiceInfos.cpp142
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3ServiceInfos.hpp91
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Store.cpp262
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Store.hpp120
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Utils.cpp135
-rw-r--r--vmime-master/src/vmime/net/pop3/POP3Utils.hpp92
-rw-r--r--vmime-master/src/vmime/net/pop3/pop3.hpp35
-rw-r--r--vmime-master/src/vmime/net/securedConnectionInfos.hpp55
-rw-r--r--vmime-master/src/vmime/net/sendmail/sendmail.hpp31
-rw-r--r--vmime-master/src/vmime/net/sendmail/sendmailServiceInfos.cpp77
-rw-r--r--vmime-master/src/vmime/net/sendmail/sendmailServiceInfos.hpp69
-rw-r--r--vmime-master/src/vmime/net/sendmail/sendmailTransport.cpp244
-rw-r--r--vmime-master/src/vmime/net/sendmail/sendmailTransport.hpp112
-rw-r--r--vmime-master/src/vmime/net/service.cpp170
-rw-r--r--vmime-master/src/vmime/net/service.hpp239
-rw-r--r--vmime-master/src/vmime/net/serviceFactory.cpp157
-rw-r--r--vmime-master/src/vmime/net/serviceFactory.hpp168
-rw-r--r--vmime-master/src/vmime/net/serviceInfos.cpp198
-rw-r--r--vmime-master/src/vmime/net/serviceInfos.hpp263
-rw-r--r--vmime-master/src/vmime/net/serviceRegistration.inl105
-rw-r--r--vmime-master/src/vmime/net/session.cpp188
-rw-r--r--vmime-master/src/vmime/net/session.hpp206
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPChunkingOutputStreamAdapter.cpp180
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPChunkingOutputStreamAdapter.hpp94
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPCommand.cpp258
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPCommand.hpp125
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPCommandSet.cpp160
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPCommandSet.hpp106
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPConnection.cpp714
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPConnection.hpp136
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPExceptions.cpp212
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPExceptions.hpp159
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPResponse.cpp366
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPResponse.hpp200
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPSTransport.cpp82
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPSTransport.hpp74
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPServiceInfos.cpp144
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPServiceInfos.hpp93
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPTransport.cpp502
-rw-r--r--vmime-master/src/vmime/net/smtp/SMTPTransport.hpp144
-rw-r--r--vmime-master/src/vmime/net/smtp/smtp.hpp33
-rw-r--r--vmime-master/src/vmime/net/socket.hpp223
-rw-r--r--vmime-master/src/vmime/net/store.cpp57
-rw-r--r--vmime-master/src/vmime/net/store.hpp115
-rw-r--r--vmime-master/src/vmime/net/timeoutHandler.hpp89
-rw-r--r--vmime-master/src/vmime/net/tls/TLSProperties.cpp44
-rw-r--r--vmime-master/src/vmime/net/tls/TLSProperties.hpp105
-rw-r--r--vmime-master/src/vmime/net/tls/TLSSecuredConnectionInfos.cpp77
-rw-r--r--vmime-master/src/vmime/net/tls/TLSSecuredConnectionInfos.hpp88
-rw-r--r--vmime-master/src/vmime/net/tls/TLSSession.cpp48
-rw-r--r--vmime-master/src/vmime/net/tls/TLSSession.hpp96
-rw-r--r--vmime-master/src/vmime/net/tls/TLSSocket.cpp44
-rw-r--r--vmime-master/src/vmime/net/tls/TLSSocket.hpp88
-rw-r--r--vmime-master/src/vmime/net/tls/gnutls/TLSProperties_GnuTLS.cpp113
-rw-r--r--vmime-master/src/vmime/net/tls/gnutls/TLSProperties_GnuTLS.hpp68
-rw-r--r--vmime-master/src/vmime/net/tls/gnutls/TLSSession_GnuTLS.cpp313
-rw-r--r--vmime-master/src/vmime/net/tls/gnutls/TLSSession_GnuTLS.hpp95
-rw-r--r--vmime-master/src/vmime/net/tls/gnutls/TLSSocket_GnuTLS.cpp548
-rw-r--r--vmime-master/src/vmime/net/tls/gnutls/TLSSocket_GnuTLS.hpp129
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/OpenSSLInitializer.cpp169
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/OpenSSLInitializer.hpp90
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/TLSProperties_OpenSSL.cpp112
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/TLSProperties_OpenSSL.hpp68
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/TLSSession_OpenSSL.cpp147
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/TLSSession_OpenSSL.hpp109
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.cpp761
-rw-r--r--vmime-master/src/vmime/net/tls/openssl/TLSSocket_OpenSSL.hpp142
-rw-r--r--vmime-master/src/vmime/net/tracer.cpp74
-rw-r--r--vmime-master/src/vmime/net/tracer.hpp110
-rw-r--r--vmime-master/src/vmime/net/transport.cpp265
-rw-r--r--vmime-master/src/vmime/net/transport.hpp152
-rw-r--r--vmime-master/src/vmime/object.cpp52
-rw-r--r--vmime-master/src/vmime/object.hpp52
-rw-r--r--vmime-master/src/vmime/parameter.cpp665
-rw-r--r--vmime-master/src/vmime/parameter.hpp176
-rw-r--r--vmime-master/src/vmime/parameterizedHeaderField.cpp634
-rw-r--r--vmime-master/src/vmime/parameterizedHeaderField.hpp222
-rw-r--r--vmime-master/src/vmime/parsedMessageAttachment.cpp114
-rw-r--r--vmime-master/src/vmime/parsedMessageAttachment.hpp76
-rw-r--r--vmime-master/src/vmime/parserHelpers.hpp140
-rw-r--r--vmime-master/src/vmime/parsingContext.cpp64
-rw-r--r--vmime-master/src/vmime/parsingContext.hpp82
-rw-r--r--vmime-master/src/vmime/path.cpp206
-rw-r--r--vmime-master/src/vmime/path.hpp106
-rw-r--r--vmime-master/src/vmime/plainTextPart.cpp121
-rw-r--r--vmime-master/src/vmime/plainTextPart.hpp74
-rw-r--r--vmime-master/src/vmime/platform.cpp77
-rw-r--r--vmime-master/src/vmime/platform.hpp158
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixChildProcess.cpp410
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixChildProcess.hpp92
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixCriticalSection.cpp67
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixCriticalSection.hpp69
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixFile.cpp715
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixFile.hpp224
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixHandler.cpp292
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixHandler.hpp103
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixSocket.cpp969
-rw-r--r--vmime-master/src/vmime/platforms/posix/posixSocket.hpp118
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsCodepages.hpp197
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsCriticalSection.cpp67
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsCriticalSection.hpp68
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsFile.cpp712
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsFile.hpp225
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsHandler.cpp315
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsHandler.hpp101
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsSocket.cpp547
-rw-r--r--vmime-master/src/vmime/platforms/windows/windowsSocket.hpp117
-rw-r--r--vmime-master/src/vmime/propertySet.cpp399
-rw-r--r--vmime-master/src/vmime/propertySet.hpp461
-rw-r--r--vmime-master/src/vmime/relay.cpp363
-rw-r--r--vmime-master/src/vmime/relay.hpp108
-rw-r--r--vmime-master/src/vmime/security/authenticator.hpp136
-rw-r--r--vmime-master/src/vmime/security/cert/X509Certificate.cpp72
-rw-r--r--vmime-master/src/vmime/security/cert/X509Certificate.hpp197
-rw-r--r--vmime-master/src/vmime/security/cert/certificate.hpp84
-rw-r--r--vmime-master/src/vmime/security/cert/certificateChain.cpp53
-rw-r--r--vmime-master/src/vmime/security/cert/certificateChain.hpp79
-rw-r--r--vmime-master/src/vmime/security/cert/certificateException.cpp84
-rw-r--r--vmime-master/src/vmime/security/cert/certificateException.hpp95
-rw-r--r--vmime-master/src/vmime/security/cert/certificateExpiredException.cpp55
-rw-r--r--vmime-master/src/vmime/security/cert/certificateExpiredException.hpp65
-rw-r--r--vmime-master/src/vmime/security/cert/certificateIssuerVerificationException.cpp55
-rw-r--r--vmime-master/src/vmime/security/cert/certificateIssuerVerificationException.hpp65
-rw-r--r--vmime-master/src/vmime/security/cert/certificateNotTrustedException.cpp55
-rw-r--r--vmime-master/src/vmime/security/cert/certificateNotTrustedException.hpp65
-rw-r--r--vmime-master/src/vmime/security/cert/certificateNotYetValidException.cpp55
-rw-r--r--vmime-master/src/vmime/security/cert/certificateNotYetValidException.hpp65
-rw-r--r--vmime-master/src/vmime/security/cert/certificateVerifier.hpp76
-rw-r--r--vmime-master/src/vmime/security/cert/defaultCertificateVerifier.cpp191
-rw-r--r--vmime-master/src/vmime/security/cert/defaultCertificateVerifier.hpp98
-rw-r--r--vmime-master/src/vmime/security/cert/gnutls/X509Certificate_GnuTLS.cpp395
-rw-r--r--vmime-master/src/vmime/security/cert/gnutls/X509Certificate_GnuTLS.hpp96
-rw-r--r--vmime-master/src/vmime/security/cert/openssl/X509Certificate_OpenSSL.cpp655
-rw-r--r--vmime-master/src/vmime/security/cert/openssl/X509Certificate_OpenSSL.hpp119
-rw-r--r--vmime-master/src/vmime/security/cert/serverIdentityException.cpp55
-rw-r--r--vmime-master/src/vmime/security/cert/serverIdentityException.hpp65
-rw-r--r--vmime-master/src/vmime/security/cert/unsupportedCertificateTypeException.cpp61
-rw-r--r--vmime-master/src/vmime/security/cert/unsupportedCertificateTypeException.hpp72
-rw-r--r--vmime-master/src/vmime/security/defaultAuthenticator.cpp130
-rw-r--r--vmime-master/src/vmime/security/defaultAuthenticator.hpp73
-rw-r--r--vmime-master/src/vmime/security/digest/md5/md5MessageDigest.cpp349
-rw-r--r--vmime-master/src/vmime/security/digest/md5/md5MessageDigest.hpp85
-rw-r--r--vmime-master/src/vmime/security/digest/messageDigest.cpp56
-rw-r--r--vmime-master/src/vmime/security/digest/messageDigest.hpp142
-rw-r--r--vmime-master/src/vmime/security/digest/messageDigestFactory.cpp81
-rw-r--r--vmime-master/src/vmime/security/digest/messageDigestFactory.hpp110
-rw-r--r--vmime-master/src/vmime/security/digest/sha1/sha1MessageDigest.cpp276
-rw-r--r--vmime-master/src/vmime/security/digest/sha1/sha1MessageDigest.hpp79
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLAuthenticator.hpp96
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLContext.cpp221
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLContext.hpp136
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLMechanism.hpp153
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLMechanismFactory.cpp149
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLMechanismFactory.hpp155
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLSession.cpp221
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLSession.hpp180
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLSocket.cpp273
-rw-r--r--vmime-master/src/vmime/security/sasl/SASLSocket.hpp108
-rw-r--r--vmime-master/src/vmime/security/sasl/XOAuth2SASLAuthenticator.cpp99
-rw-r--r--vmime-master/src/vmime/security/sasl/XOAuth2SASLAuthenticator.hpp77
-rw-r--r--vmime-master/src/vmime/security/sasl/XOAuth2SASLMechanism.cpp155
-rw-r--r--vmime-master/src/vmime/security/sasl/XOAuth2SASLMechanism.hpp102
-rw-r--r--vmime-master/src/vmime/security/sasl/builtinSASLMechanism.cpp221
-rw-r--r--vmime-master/src/vmime/security/sasl/builtinSASLMechanism.hpp105
-rw-r--r--vmime-master/src/vmime/security/sasl/defaultSASLAuthenticator.cpp159
-rw-r--r--vmime-master/src/vmime/security/sasl/defaultSASLAuthenticator.hpp91
-rw-r--r--vmime-master/src/vmime/streamContentHandler.cpp257
-rw-r--r--vmime-master/src/vmime/streamContentHandler.hpp126
-rw-r--r--vmime-master/src/vmime/stringContentHandler.cpp228
-rw-r--r--vmime-master/src/vmime/stringContentHandler.hpp107
-rw-r--r--vmime-master/src/vmime/text.cpp536
-rw-r--r--vmime-master/src/vmime/text.hpp291
-rw-r--r--vmime-master/src/vmime/textPart.hpp117
-rw-r--r--vmime-master/src/vmime/textPartFactory.cpp68
-rw-r--r--vmime-master/src/vmime/textPartFactory.hpp77
-rw-r--r--vmime-master/src/vmime/types.hpp87
-rw-r--r--vmime-master/src/vmime/utility/childProcess.hpp103
-rw-r--r--vmime-master/src/vmime/utility/datetimeUtils.cpp317
-rw-r--r--vmime-master/src/vmime/utility/datetimeUtils.hpp98
-rw-r--r--vmime-master/src/vmime/utility/encoder/b64Encoder.cpp350
-rw-r--r--vmime-master/src/vmime/utility/encoder/b64Encoder.hpp73
-rw-r--r--vmime-master/src/vmime/utility/encoder/binaryEncoder.cpp39
-rw-r--r--vmime-master/src/vmime/utility/encoder/binaryEncoder.hpp51
-rw-r--r--vmime-master/src/vmime/utility/encoder/eightBitEncoder.cpp39
-rw-r--r--vmime-master/src/vmime/utility/encoder/eightBitEncoder.hpp51
-rw-r--r--vmime-master/src/vmime/utility/encoder/encoder.cpp76
-rw-r--r--vmime-master/src/vmime/utility/encoder/encoder.hpp135
-rw-r--r--vmime-master/src/vmime/utility/encoder/encoderFactory.cpp149
-rw-r--r--vmime-master/src/vmime/utility/encoder/encoderFactory.hpp164
-rw-r--r--vmime-master/src/vmime/utility/encoder/noopEncoder.cpp94
-rw-r--r--vmime-master/src/vmime/utility/encoder/noopEncoder.hpp66
-rw-r--r--vmime-master/src/vmime/utility/encoder/qpEncoder.cpp568
-rw-r--r--vmime-master/src/vmime/utility/encoder/qpEncoder.hpp77
-rw-r--r--vmime-master/src/vmime/utility/encoder/sevenBitEncoder.cpp39
-rw-r--r--vmime-master/src/vmime/utility/encoder/sevenBitEncoder.hpp51
-rw-r--r--vmime-master/src/vmime/utility/encoder/uuEncoder.cpp358
-rw-r--r--vmime-master/src/vmime/utility/encoder/uuEncoder.hpp68
-rw-r--r--vmime-master/src/vmime/utility/file.hpp264
-rw-r--r--vmime-master/src/vmime/utility/filteredStream.cpp402
-rw-r--r--vmime-master/src/vmime/utility/filteredStream.hpp405
-rw-r--r--vmime-master/src/vmime/utility/inputStream.cpp33
-rw-r--r--vmime-master/src/vmime/utility/inputStream.hpp75
-rw-r--r--vmime-master/src/vmime/utility/inputStreamAdapter.cpp84
-rw-r--r--vmime-master/src/vmime/utility/inputStreamAdapter.hpp65
-rw-r--r--vmime-master/src/vmime/utility/inputStreamByteBufferAdapter.cpp104
-rw-r--r--vmime-master/src/vmime/utility/inputStreamByteBufferAdapter.hpp63
-rw-r--r--vmime-master/src/vmime/utility/inputStreamPointerAdapter.cpp48
-rw-r--r--vmime-master/src/vmime/utility/inputStreamPointerAdapter.hpp61
-rw-r--r--vmime-master/src/vmime/utility/inputStreamSocketAdapter.cpp79
-rw-r--r--vmime-master/src/vmime/utility/inputStreamSocketAdapter.hpp75
-rw-r--r--vmime-master/src/vmime/utility/inputStreamStringAdapter.cpp119
-rw-r--r--vmime-master/src/vmime/utility/inputStreamStringAdapter.hpp66
-rw-r--r--vmime-master/src/vmime/utility/outputStream.cpp44
-rw-r--r--vmime-master/src/vmime/utility/outputStream.hpp133
-rw-r--r--vmime-master/src/vmime/utility/outputStreamAdapter.cpp52
-rw-r--r--vmime-master/src/vmime/utility/outputStreamAdapter.hpp63
-rw-r--r--vmime-master/src/vmime/utility/outputStreamByteArrayAdapter.cpp50
-rw-r--r--vmime-master/src/vmime/utility/outputStreamByteArrayAdapter.hpp59
-rw-r--r--vmime-master/src/vmime/utility/outputStreamSocketAdapter.cpp65
-rw-r--r--vmime-master/src/vmime/utility/outputStreamSocketAdapter.hpp76
-rw-r--r--vmime-master/src/vmime/utility/outputStreamStringAdapter.cpp52
-rw-r--r--vmime-master/src/vmime/utility/outputStreamStringAdapter.hpp59
-rw-r--r--vmime-master/src/vmime/utility/parserInputStreamAdapter.cpp175
-rw-r--r--vmime-master/src/vmime/utility/parserInputStreamAdapter.hpp172
-rw-r--r--vmime-master/src/vmime/utility/path.cpp324
-rw-r--r--vmime-master/src/vmime/utility/path.hpp189
-rw-r--r--vmime-master/src/vmime/utility/progressListener.cpp78
-rw-r--r--vmime-master/src/vmime/utility/progressListener.hpp99
-rw-r--r--vmime-master/src/vmime/utility/random.cpp90
-rw-r--r--vmime-master/src/vmime/utility/random.hpp78
-rw-r--r--vmime-master/src/vmime/utility/seekableInputStream.hpp62
-rw-r--r--vmime-master/src/vmime/utility/seekableInputStreamRegionAdapter.cpp111
-rw-r--r--vmime-master/src/vmime/utility/seekableInputStreamRegionAdapter.hpp73
-rw-r--r--vmime-master/src/vmime/utility/stream.cpp39
-rw-r--r--vmime-master/src/vmime/utility/stream.hpp60
-rw-r--r--vmime-master/src/vmime/utility/streamUtils.cpp130
-rw-r--r--vmime-master/src/vmime/utility/streamUtils.hpp83
-rw-r--r--vmime-master/src/vmime/utility/stringUtils.cpp337
-rw-r--r--vmime-master/src/vmime/utility/stringUtils.hpp271
-rw-r--r--vmime-master/src/vmime/utility/sync/autoLock.hpp65
-rw-r--r--vmime-master/src/vmime/utility/sync/criticalSection.cpp44
-rw-r--r--vmime-master/src/vmime/utility/sync/criticalSection.hpp64
-rw-r--r--vmime-master/src/vmime/utility/url.cpp431
-rw-r--r--vmime-master/src/vmime/utility/url.hpp213
-rw-r--r--vmime-master/src/vmime/utility/urlUtils.cpp133
-rw-r--r--vmime-master/src/vmime/utility/urlUtils.hpp57
-rw-r--r--vmime-master/src/vmime/vmime.hpp160
-rw-r--r--vmime-master/src/vmime/word.cpp939
-rw-r--r--vmime-master/src/vmime/word.hpp272
-rw-r--r--vmime-master/src/vmime/wordEncoder.cpp320
-rw-r--r--vmime-master/src/vmime/wordEncoder.hpp118
-rwxr-xr-xvmime-master/test-outsourced-build.sh12
-rw-r--r--vmime-master/tests/misc/importanceHelperTest.cpp191
-rw-r--r--vmime-master/tests/net/folderAttributesTest.cpp137
-rw-r--r--vmime-master/tests/net/imap/IMAPCommandTest.cpp495
-rw-r--r--vmime-master/tests/net/imap/IMAPParserTest.cpp374
-rw-r--r--vmime-master/tests/net/imap/IMAPTagTest.cpp90
-rw-r--r--vmime-master/tests/net/imap/IMAPUtilsTest.cpp283
-rw-r--r--vmime-master/tests/net/maildir/maildirStoreTest.cpp584
-rw-r--r--vmime-master/tests/net/maildir/maildirUtilsTest.cpp54
-rw-r--r--vmime-master/tests/net/messageSetTest.cpp229
-rw-r--r--vmime-master/tests/net/pop3/POP3CommandTest.cpp241
-rw-r--r--vmime-master/tests/net/pop3/POP3ResponseTest.cpp244
-rw-r--r--vmime-master/tests/net/pop3/POP3StoreTest.cpp67
-rw-r--r--vmime-master/tests/net/pop3/POP3TestUtils.hpp69
-rw-r--r--vmime-master/tests/net/pop3/POP3UtilsTest.cpp88
-rw-r--r--vmime-master/tests/net/smtp/SMTPCommandSetTest.cpp181
-rw-r--r--vmime-master/tests/net/smtp/SMTPCommandTest.cpp252
-rw-r--r--vmime-master/tests/net/smtp/SMTPResponseTest.cpp238
-rw-r--r--vmime-master/tests/net/smtp/SMTPTransportTest.cpp324
-rw-r--r--vmime-master/tests/net/smtp/SMTPTransportTestUtils.hpp792
-rw-r--r--vmime-master/tests/parser/attachmentHelperTest.cpp335
-rw-r--r--vmime-master/tests/parser/bodyPartTest.cpp414
-rw-r--r--vmime-master/tests/parser/bodyTest.cpp79
-rw-r--r--vmime-master/tests/parser/charsetFilteredOutputStreamTest.cpp213
-rw-r--r--vmime-master/tests/parser/charsetTest.cpp252
-rw-r--r--vmime-master/tests/parser/charsetTestSuites.hpp102
-rw-r--r--vmime-master/tests/parser/datetimeTest.cpp123
-rw-r--r--vmime-master/tests/parser/dispositionTest.cpp150
-rw-r--r--vmime-master/tests/parser/emailAddressTest.cpp281
-rw-r--r--vmime-master/tests/parser/emptyContentHandlerTest.cpp99
-rw-r--r--vmime-master/tests/parser/fileContentHandlerTest.cpp134
-rw-r--r--vmime-master/tests/parser/headerFieldTest.cpp112
-rw-r--r--vmime-master/tests/parser/headerTest.cpp375
-rw-r--r--vmime-master/tests/parser/htmlTextPartTest.cpp241
-rw-r--r--vmime-master/tests/parser/mailboxGroupTest.cpp107
-rw-r--r--vmime-master/tests/parser/mailboxListTest.cpp47
-rw-r--r--vmime-master/tests/parser/mailboxTest.cpp187
-rw-r--r--vmime-master/tests/parser/mediaTypeTest.cpp100
-rw-r--r--vmime-master/tests/parser/messageIdSequenceTest.cpp78
-rw-r--r--vmime-master/tests/parser/messageIdTest.cpp77
-rw-r--r--vmime-master/tests/parser/messageTest.cpp64
-rw-r--r--vmime-master/tests/parser/parameterTest.cpp722
-rw-r--r--vmime-master/tests/parser/pathTest.cpp102
-rw-r--r--vmime-master/tests/parser/streamContentHandlerTest.cpp194
-rw-r--r--vmime-master/tests/parser/stringContentHandlerTest.cpp165
-rw-r--r--vmime-master/tests/parser/textTest.cpp918
-rw-r--r--vmime-master/tests/parser/wordEncoderTest.cpp174
-rw-r--r--vmime-master/tests/security/digest/md5Test.cpp228
-rw-r--r--vmime-master/tests/security/digest/sha1Test.cpp119
-rw-r--r--vmime-master/tests/testRunner.cpp305
-rw-r--r--vmime-master/tests/testUtils.cpp404
-rw-r--r--vmime-master/tests/testUtils.hpp407
-rw-r--r--vmime-master/tests/utility/datetimeUtilsTest.cpp157
-rw-r--r--vmime-master/tests/utility/encoder/b64EncoderTest.cpp168
-rw-r--r--vmime-master/tests/utility/encoder/encoderFactoryTest.cpp63
-rw-r--r--vmime-master/tests/utility/encoder/encoderTestUtils.hpp82
-rw-r--r--vmime-master/tests/utility/encoder/qpEncoderTest.cpp275
-rw-r--r--vmime-master/tests/utility/filteredStreamTest.cpp341
-rw-r--r--vmime-master/tests/utility/outputStreamByteArrayAdapterTest.cpp82
-rw-r--r--vmime-master/tests/utility/outputStreamSocketAdapterTest.cpp87
-rw-r--r--vmime-master/tests/utility/outputStreamStringAdapterTest.cpp84
-rw-r--r--vmime-master/tests/utility/parserInputStreamAdapterTest.cpp51
-rw-r--r--vmime-master/tests/utility/pathTest.cpp356
-rw-r--r--vmime-master/tests/utility/seekableInputStreamRegionAdapterTest.cpp176
-rw-r--r--vmime-master/tests/utility/stringUtilsTest.cpp214
-rw-r--r--vmime-master/tests/utility/urlTest.cpp312
-rw-r--r--vmime-master/vmime.pc.in13
3093 files changed, 842670 insertions, 0 deletions
diff --git a/CA_store.cpp b/CA_store.cpp
new file mode 100644
index 0000000..3bf7be3
--- /dev/null
+++ b/CA_store.cpp
@@ -0,0 +1,40 @@
+#include <windows.h>
+#include <wincrypt.h>
+
+#include "vmime/vmime.hpp"
+
+#include "utilities.h"
+
+using namespace vmime::security::cert;
+
+vmime::shared_ptr<defaultCertificateVerifier>
+windows_root_certs_verifier(void)
+{
+ vmime::shared_ptr<defaultCertificateVerifier> vrf =
+ vmime::make_shared<defaultCertificateVerifier>();
+ std::vector<vmime::shared_ptr<X509Certificate>> root_certs;
+ vmime::shared_ptr<vmime::security::cert::X509Certificate> cert;
+ HCERTSTORE store;
+ PCCERT_CONTEXT context;
+
+ store = CertOpenSystemStore(0, "ROOT");
+ if (store == NULL)
+ FAIL(MSG_NO_ROOT_CA_STORE);
+
+ context = NULL;
+ while (true) {
+ context = CertEnumCertificatesInStore(store, context);
+ if (context == NULL)
+ break;
+
+ cert = vmime::security::cert::X509Certificate::import
+ (context->pbCertEncoded, context->cbCertEncoded);
+ if (cert)
+ root_certs.push_back(cert);
+ }
+
+ CertCloseStore(store, 0);
+ vrf->setX509RootCAs(root_certs);
+
+ return vrf;
+}
diff --git a/COPYING.txt b/COPYING.txt
new file mode 100644
index 0000000..a1c662c
--- /dev/null
+++ b/COPYING.txt
@@ -0,0 +1,47 @@
+This tool includes 3 statically-linked libraries:
+ - OpenSSL cryptographic library
+ - Vmime "C++ class library for working with RFC-822 and MIME messages"
+ (basically email stuff)
+ - Iniparser library for parsing of .ini configuration files
+
+In addition, the binary contains statically-linked bits of code,
+that GCC (Mingw-w64) adds to binaries.
+
+* OpenSSL
+ We're using a version of this library from before its relicense to
+ Apache 2.0 finalized. License info can be found in openssl-1.1.0h/LICENSE.
+
+ Library's website: https://www.openssl.org/
+
+* Vmime
+ This is a GPLv3-licensed library with exception for OpenSSL. License info
+ can be found in vmime-master/COPYING and vmime-master/COPYING.OpenSSL.
+
+ Library's website: https://www.vmime.org/
+
+* Iniparser
+ Small, MIT-licensed C library. License text can be found
+ in iniparser-4.1/LICENSE. Additionally, many modifications were
+ applied, that are GPLv3-compatible (and in fact, public domain).
+
+ Library's source repository: https://github.com/ndevilla/iniparser/
+
+* LibGCC & friends
+ I don't know details of what runtime bits GCC links in, but there are
+ definitely some. I don't think any of the licenses requires me to provide
+ sources for those, but nevertheless - the entire toolchain (hence also its
+ runtime libraries) can be found in Debian:
+
+ https://packages.debian.org/buster/g++-mingw-w64
+
+ It also has links to sources on the right side of every page, under the
+ "Download Source Package" text. I actually used Devuan to build programs,
+ but it seems to be using the same Mingw-x64 packages, so it doesn't matter.
+
+* My code
+ Copyright (C) 2021 Wojtek Kosior, dual licensed under either:
+ - GNU GPL, version 3 or (at Your option) any later version
+ (license text in LICENSES/GPLv3.txt)
+ - 0BSD (license text in LICENSES/0BSD.txt)
+ My code is that in project's topmost directory + some big modifications
+ in Iniparser and a small ugly modification in Vmime.
diff --git a/HACKING.txt b/HACKING.txt
new file mode 100644
index 0000000..dac1c5b
--- /dev/null
+++ b/HACKING.txt
@@ -0,0 +1,42 @@
+Programs are (a bit ugly) written in a mix of C and C++. First it was going to
+be only C, but it turned out libspopc is not good enough for the task (it does
+not parse messages), so I replaced it with vmime, which is a C++ lib.
+
+I compiled the programs using Mingw-w64 under Devuan (a derivative of Debian).
+There's currently no facility to build it uder something else, sorry.
+
+Everything is linked statically (so that the programs ca be just copy-pasted
+to some system and run there). Again, I haven't bothered making it possible
+to build differently.
+
+To build, You need to first `apt install g++-mingw-w64-i686 gcc-mingw-w64-i686`.
+Some other deps are also required for building libraries (at least for OpenSSL)
+- You'll see what's missing once You get an error.
+
+* OpenSSL
+ Procedures are described in openssl-1.1.0h/INSTALL. Basically, You need to
+ cd into openssl-1.10h/ and run
+ `./Configure --cross-compile-prefix=i686-w64-mingw32- mingw` and `make`.
+ At the and You should have libcrypto.a and libssl.a inside openssl-1.1.0h/.
+ I haven't made any modification to OpenSSL lib.
+
+* Vmime
+ I made a very ugly modification to certificate import code - I changed it to
+ treat provided certs as DER instead of PEM format. Remember about that, if
+ You decide to update the library to a newer version. I also added
+ a mingw_cross_toolchain.cmake file in vmime-master/ to facilitate
+ cross-compiling. Unfortunately, there weren't any instructions on how to do
+ that, so I had to fight cmake for a while. Finally, I added
+ build_for_losedows.sh script in vmime-master/. To build - just enter
+ the library's directory and run the script. You should be left with
+ libvmime.a in vmime-master/.
+
+* Iniparser
+ I modified both the library sources and its Makefile. It should suffice to
+ anter iniparser-4.1/ and run `make` there. You'll be left with
+ a libiniparser.a.
+
+* The actual programs
+ Make is used. If You've already prepared the libraries, just run `make` and
+ hope it doesn't crash ;)
+ pop.exe and push.exe shall be produced.
diff --git a/LICENSES/0BSD.txt b/LICENSES/0BSD.txt
new file mode 100644
index 0000000..38874ac
--- /dev/null
+++ b/LICENSES/0BSD.txt
@@ -0,0 +1,6 @@
+Copyright (C) 2021 by Wojtek Kosior <echo a3dvanR1c0Bwcm90b25tYWlsLmNvbQo= | base64 -d>
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
diff --git a/LICENSES/GPLv3.txt b/LICENSES/GPLv3.txt
new file mode 100644
index 0000000..f288702
--- /dev/null
+++ b/LICENSES/GPLv3.txt
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<https://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bc6ca14
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+# Previously there were also:
+# * -Ilibspopc-0.12/ in INCLUDEFLAGS
+# * -Llibspopc-0.12/ and -lspopc in LIBFLAGS
+# * -DUSE_SSL in CFLAGS
+# libspopc now got replaced with VMime, which also handles mail parsing
+INCLUDEFLAGS = -Iiniparser-4.1/src/ -Ivmime-master/src/ \
+ -Ivmime-master/config_header/
+
+LIBFLAGS = -static -Lvmime-master/ -Lopenssl-1.1.0h/ -Liniparser-4.1/ \
+ -liniparser -lvmime -lssl -lcrypto -lcrypt32 -lws2_32 -lwsock32
+CC = i686-w64-mingw32-gcc
+CXX = i686-w64-mingw32-g++
+STRIP = i686-w64-mingw32-strip
+CFLAGS = $(INCLUDEFLAGS) -Wall -O2 -std=c11
+CXXFLAGS = $(INCLUDEFLAGS) -Wall -O2 -std=c++11
+
+PROGRAMS = pop.exe push.exe
+COMMON_O = config.o messages.o misc.o CA_store.o timeout_handler.o exceptions.o
+POP_OBJECTS = pop.o $(COMMON_O)
+PUSH_OBJECTS = push.o $(COMMON_O)
+
+all: $(PROGRAMS)
+
+# stripping nie jest konieczny, ale zmniejsza rozmiar pliku o ponad 25%
+pop.exe: $(POP_OBJECTS)
+ $(CXX) $^ $(LIBFLAGS) -o $@
+ $(STRIP) $@
+
+push.exe: $(PUSH_OBJECTS)
+ $(CXX) $^ $(LIBFLAGS) -o $@
+ $(STRIP) $@
+
+clean:
+ -rm -f $(PROGRAMS) *.o
+
+%.o: %.c
+ $(CC) -c $< -o $@ $(CFLAGS)
+
+%.o: %.cpp
+ $(CXX) -c $< -o $@ $(CXXFLAGS)
+
+.PHONY: all clean
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..7e971df
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,10 @@
+Programs to automatically send and receive emails through SMTP and POP3,
+under Windows (aka Losedows).
+
+This program probably has no use for you. I am including it in a public
+repository so that it can serve as part of my CV. Also, it ended up being
+a quite ugly piece of code (well, C++ is what happened).
+
+For license terms of the programs and included libraries, see COPYING.txt.
+
+For information about building and modifying, see HACKING.txt.
diff --git a/README_pl.txt b/README_pl.txt
new file mode 100644
index 0000000..2ac42e3
--- /dev/null
+++ b/README_pl.txt
@@ -0,0 +1,6 @@
+Programy do automatycznego wysyłania i pobierania maili przez SMTP i POP3,
+pod Windą. Dołączone są także pełne kody źródłowe używanych bibliotek.
+
+Szczegóły dot. licencji znajdują się w COPYING.txt.
+
+Informacje, jak zbudować/zmodyfikować program, można znaleźć w HACKING.txt.
diff --git a/config.c b/config.c
new file mode 100644
index 0000000..7dd0c1e
--- /dev/null
+++ b/config.c
@@ -0,0 +1,287 @@
+/* C */
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <limits.h>
+#include <stdlib.h>
+
+/* Losedows */
+#include <fileapi.h>
+
+/* local */
+#include "utilities.h"
+#include "iniparser.h"
+
+#define BUFSIZE 4096
+
+static const char *get_string(dictionary *ini, const char *key)
+{
+ const char *value;
+ char *new_string;
+ size_t length;
+
+ value = iniparser_getstring(ini, key, NULL);
+ if (!value)
+ return NULL;
+
+ length = strlen(value);
+ new_string = dirtyalloc(length + 1);
+ memcpy(new_string, value, length + 1);
+ return new_string;
+}
+
+static enum bool_param get_bool(dictionary *ini, const char *key)
+{
+ int value = iniparser_getboolean(ini, key, 2);
+
+ return value == 2 ? PARAM_NOT_GIVEN :
+ value == 1 ? PARAM_YES : PARAM_NO;
+}
+
+static size_t get_msg(dictionary *ini, const char **dest)
+{
+ int nkeys, i;
+ const char **keys;
+ const char *line;
+ size_t msg_size = 0;
+ char *msg, *msg_pos;
+
+ nkeys = iniparser_getsecnkeys(ini, "MSG");
+ if (nkeys == 0) {
+ *dest = NULL;
+ return 0;
+ }
+
+ keys = dirtyalloc(nkeys * sizeof(const char*));
+ iniparser_getseckeys(ini, "MSG", keys);
+
+ for (i = 0; i < nkeys; i++)
+ msg_size += strlen(iniparser_getstring(ini, keys[i], "")) + 1;
+
+ msg = dirtyalloc(msg_size);
+ msg_pos = msg;
+
+ for (i = 0; i < nkeys; i++) {
+ line = iniparser_getstring(ini, keys[i], "");
+ while (*line)
+ *(msg_pos++) = *(line++);
+ *(msg_pos++) = '\n';
+ }
+
+ free(keys);
+ *(msg_pos - 1) = '\0';
+ *dest = msg;
+
+ /* Exclude terminating null byte from returned size */
+ return msg_size - 1;
+}
+
+static size_t get_list(dictionary *ini, const char *section,
+ const char ***dest)
+{
+ int nkeys, i;
+ const char **keys, **items;
+ const char *line;
+ char *copied_line;
+ size_t length;
+
+ nkeys = iniparser_getsecnkeys(ini, section);
+
+ if (nkeys == 0) {
+ *dest = NULL;
+ return 0;
+ }
+
+ keys = dirtyalloc(nkeys * sizeof(const char *));
+ items = dirtyalloc(nkeys * sizeof(const char *));
+ iniparser_getseckeys(ini, section, keys);
+
+ for (i = 0; i < nkeys; i++) {
+ line = iniparser_getstring(ini, keys[i], "");
+ length = strlen(line) + 1;
+ copied_line = dirtyalloc(length);
+ memcpy(copied_line, line, length);
+ items[i] = copied_line;
+ }
+
+ free(keys);
+ *dest = items;
+ return nkeys;
+}
+
+static dictionary *check_file_and_load_ini(const char *filename)
+{
+ int retval;
+ char full_pathname[BUFSIZE];
+ dictionary *ini;
+
+ retval = GetFullPathName(filename, BUFSIZE, full_pathname, NULL);
+
+ if (retval == 0)
+ FAIL(MSG_CONF_PATH_EXPAND_FAIL, filename);
+
+ if (access(full_pathname, F_OK) != 0)
+ FAIL(MSG_CONF_NOT_EXIST, full_pathname);
+
+ if (access(full_pathname, R_OK) != 0)
+ FAIL(MSG_CONF_NOT_READABLE, full_pathname);
+
+ ini = iniparser_load(full_pathname);
+
+ if (!ini)
+ FAIL(MSG_INVALID_INI_FILE, full_pathname);
+
+ return ini;
+}
+
+void print_config(struct config *config);
+
+void read_config(const char *filename, struct config *config)
+{
+ dictionary *ini;
+
+ ini = check_file_and_load_ini(filename);
+
+ memset(config, '\0', sizeof(struct config)); /* not really needed */
+
+ config->host = get_string(ini, "SERVER:host");
+ config->login = get_string(ini, "SERVER:login");
+ config->password = get_string(ini, "SERVER:password");
+ config->dest_dir = get_string(ini, "SERVER:outputdir");
+
+ config->reply_to = get_string(ini, "MAIL:replyto");
+ config->from = get_string(ini, "MAIL:from");
+
+ if (!config->reply_to)
+ config->reply_to = get_string(ini, "SERVER:replyto");
+ if (!config->from)
+ config->from = get_string(ini, "SERVER:from");
+
+ config->subject = get_string(ini, "MAIL:subject");
+
+ config->use_SSL = get_bool(ini, "SERVER:ssl");
+ config->use_AUTH = get_bool(ini, "SERVER:auth");
+ config->del_msgs = get_bool(ini, "SERVER:delete_msg");
+ config->save_body = get_bool(ini, "SERVER:save_body");
+ config->save_subj = get_bool(ini, "SERVER:save_subject");
+ config->port_POP3 = iniparser_getint(ini, "SERVER:port_pop3", -1);
+ config->port_SMTP = iniparser_getint(ini, "SERVER:port_smtp", -1);
+ config->timeout = iniparser_getint(ini, "SERVER:timeout", 1000000);
+ config->nfiles = get_list(ini, "FILES", &config->files);
+ config->nto = get_list(ini, "CC", &config->to);
+ config->msg_size = get_msg (ini, &config->msg_body);
+
+ iniparser_freedict(ini);
+
+ /* print_config(config); */
+}
+
+void get_config(int argc, const char **argv, struct config *config)
+{
+ int config_arg_idx = 1;
+
+ if (argc < 2)
+ goto bad_args;
+
+ if (strcmp(argv[1], "--wide-chars") == 0) {
+ config_arg_idx = 2;
+ iniparser_set_fgetc_impl(provisional_wide_char_fgetc);
+ }
+
+ if (argc <= config_arg_idx)
+ goto bad_args;
+
+ iniparser_set_error_callback(dummy_errback);
+ iniparser_set_process_multiline(false);
+ read_config(argv[config_arg_idx], config);
+ return;
+
+bad_args:
+ FAIL(MSG_BAD_ARGS_NUM, argv[0]);
+}
+
+void free_config(struct config *config)
+{
+ //TODO
+}
+
+void print_config(struct config *config)
+{
+ size_t i;
+
+ if (config->host)
+ printf("host: %s\n", config->host);
+ else
+ puts("host not set");
+
+ if (config->login)
+ printf("login: %s\n", config->login);
+ else
+ puts("login not set");
+
+ if (config->password)
+ printf("password: %s\n", config->password);
+ else
+ puts("password not set");
+
+ if (config->reply_to)
+ printf("reply_to: %s\n", config->reply_to);
+ else
+ puts("reply_to not set");
+
+ if (config->from)
+ printf("from: %s\n", config->from);
+ else
+ puts("from not set");
+
+ if (config->dest_dir)
+ printf("dest_dir: %s\n", config->dest_dir);
+ else
+ puts("dest_dir not set");
+
+ if (config->subject)
+ printf("subject: %s\n", config->subject);
+ else
+ puts("subject not set");
+
+ printf("SSL: %s\n", config->use_SSL ? "True" : "False");
+
+ printf("AUTH: %s\n", config->use_AUTH ? "True" : "False");
+
+ printf("port_POP3: %d\n", config->port_POP3);
+
+ printf("port_SMTP: %d\n", config->port_SMTP);
+
+ printf("timeout: %d\n", config->timeout);
+
+ printf("delete: %s\n", config->del_msgs ? "True" : "False");
+
+ printf("save_body: %s\n", config->save_body ? "True" : "False");
+
+ printf("save_subject: %s\n", config->save_subj ? "True" : "False");
+
+ if (config->nfiles) {
+ puts("files:");
+ for (i = 0; i < config->nfiles; i++)
+ printf(" %s\n", config->files[i]);
+ } else {
+ puts("no files");
+ }
+
+ if (config->nto) {
+ puts("recipients:");
+ for (i = 0; i < config->nto; i++)
+ printf(" %s\n", config->to[i]);
+ } else {
+ puts("no recipients");
+ }
+
+ if (config->msg_body) {
+ printf("message (length %lu):\n",
+ (unsigned long)config->msg_size);
+ puts(config->msg_body);
+ } else {
+ puts("no message");
+ }
+}
diff --git a/exceptions.cpp b/exceptions.cpp
new file mode 100644
index 0000000..35fa37b
--- /dev/null
+++ b/exceptions.cpp
@@ -0,0 +1,71 @@
+#include <stdlib.h>
+#include <iostream>
+
+#include "vmime/vmime.hpp"
+#include "vmime/security/cert/certificateIssuerVerificationException.hpp"
+#include "vmime/security/cert/unsupportedCertificateTypeException.hpp"
+#include "vmime/security/cert/certificateNotTrustedException.hpp"
+#include "vmime/security/cert/certificateExpiredException.hpp"
+#include "vmime/security/cert/certificateNotYetValidException.hpp"
+#include "vmime/exception.hpp"
+
+#include "exceptions.hpp"
+#include "utilities.h"
+
+using namespace vmime::exceptions;
+using namespace vmime::security::cert;
+
+#define EX_COMPATIBLE(ex_type_name) (dynamic_cast<ex_type_name*>(e) != nullptr)
+
+void handle_vmime_exception(vmime::exception *e)
+{
+ if (EX_COMPATIBLE(authentication_error))
+ FAIL(MSG_BAD_AUTHENTICATION);
+ if (EX_COMPATIBLE(certificateIssuerVerificationException))
+ FAIL(MSG_CERT_VERIFICATION_FAIL);
+ if (EX_COMPATIBLE(unsupportedCertificateTypeException))
+ FAIL(MSG_BAD_CERT_FORMAT);
+ if (EX_COMPATIBLE(certificateNotTrustedException))
+ FAIL(MSG_UNKNOWN_CERT);
+ if (EX_COMPATIBLE(certificateExpiredException))
+ FAIL(MSG_CERT_EXPIRED);
+ if (EX_COMPATIBLE(certificateNotYetValidException))
+ FAIL(MSG_CERT_NOT_YET_VALID);
+
+ if (EX_COMPATIBLE(connection_error))
+ std::cerr << "Blad polaczenia z serwerem: ";
+ else
+ std::cerr << "Blad (biblioteka vmime): ";
+ std::cerr << e->what() << std::endl;
+
+#define PRINT_MORE(ex_type_name, text, more) \
+ ex_type_name *ex_type_name = \
+ dynamic_cast<vmime::exceptions::ex_type_name*>(e); \
+ if (ex_type_name != nullptr) \
+ std::cerr << text << ex_type_name->more << std::endl;
+
+#define PRINT_RESPONSE(ex_type_name) \
+ PRINT_MORE(ex_type_name, "Odpowiedz serwera: ", response())
+
+ PRINT_RESPONSE(command_error);
+ PRINT_RESPONSE(connection_greeting_error);
+ PRINT_RESPONSE(authentication_error);
+ PRINT_RESPONSE(invalid_response);
+ PRINT_MORE(filesystem_exception, "Sciezka: ",
+ path().toString("\\", vmime::charsets::WINDOWS_1250));
+
+ FAIL_NOMSG();
+}
+
+void handle_std_exception(std::exception *e)
+{
+ if (EX_COMPATIBLE(silent_exception))
+ FAIL_NOMSG();
+ if (EX_COMPATIBLE(std::bad_alloc))
+ FAIL(MSG_MALLOC_FAIL);
+
+ std::cerr << "Blad (biblioteka standardowa): "
+ << e->what() << std::endl;
+
+ FAIL_NOMSG();
+}
diff --git a/exceptions.hpp b/exceptions.hpp
new file mode 100644
index 0000000..4821bc9
--- /dev/null
+++ b/exceptions.hpp
@@ -0,0 +1,14 @@
+#include "vmime/vmime.hpp"
+
+void handle_vmime_exception(vmime::exception *e);
+
+void handle_std_exception(std::exception *e);
+
+class silent_exception : public std::runtime_error {
+public:
+ silent_exception() : std::runtime_error("")
+ {
+ }
+
+// virtual ~Exception() noexcept {}
+};
diff --git a/hello.cpp b/hello.cpp
new file mode 100644
index 0000000..c56dd7b
--- /dev/null
+++ b/hello.cpp
@@ -0,0 +1,40 @@
+#include <iostream>
+#include <string>
+#include <regex>
+
+static std::string get_next_filename(std::string filename)
+{
+ std::regex
+ numbered_reg("(.[^.]*)[(]([1-9][0-9]{0,8})[)](([.].*)?)"),
+ unnumbered_reg("(.[^.]*)(([.].*)?)");
+ std::smatch what;
+ std::string base_name, number, rest;
+ long new_idx;
+
+ if (regex_match(filename, what, numbered_reg)) {
+ base_name = what[1];
+ number = what[2];
+ rest = what[3];
+ new_idx = std::stol(number) + 1;
+ } else {
+ regex_match(filename, what, unnumbered_reg);
+ base_name = what[1];
+ rest = what[2];
+ new_idx = 1;
+ }
+ std:: cout << filename << " ";
+ return base_name + "(" + std::to_string(new_idx) + ")" + rest;
+}
+
+int main()
+{
+ std::cout << get_next_filename("dupa(1)") << std::endl;
+ std::cout << get_next_filename("dupa(1).txt") << std::endl;
+ std::cout << get_next_filename("....dupa(1).txt") << std::endl;
+ std::cout << get_next_filename("dupa(01).kupa(22).png") << std::endl;
+ std::cout << get_next_filename("dupa(1)e..txt") << std::endl;
+ std::cout << get_next_filename("dupa(111111111).txt") << std::endl;
+ std::cout << get_next_filename("dupa(1111111111).txt") << std::endl;
+ std::cout << get_next_filename("dupa.txt") << std::endl;
+ return 0;
+}
diff --git a/iniparser-4.1/.gitignore b/iniparser-4.1/.gitignore
new file mode 100644
index 0000000..8fc7b85
--- /dev/null
+++ b/iniparser-4.1/.gitignore
@@ -0,0 +1,11 @@
+### Ignore all files created by make
+#
+*.a
+*.o
+*.so
+*.so.*
+/example/iniexample
+/example/parse
+# Autogenerate source file
+/test/AllTests.c
+/test/testrun
diff --git a/iniparser-4.1/.travis.yml b/iniparser-4.1/.travis.yml
new file mode 100644
index 0000000..22a61fa
--- /dev/null
+++ b/iniparser-4.1/.travis.yml
@@ -0,0 +1,9 @@
+language: c
+
+env:
+ - ENV_CC=clang
+ - ENV_CC=clang++
+ - ENV_CC=gcc
+ - ENV_CC=g++
+
+script: CC=$ENV_CC make && CC=$ENV_CC make check
diff --git a/iniparser-4.1/AUTHORS b/iniparser-4.1/AUTHORS
new file mode 100644
index 0000000..d5a3f6b
--- /dev/null
+++ b/iniparser-4.1/AUTHORS
@@ -0,0 +1,6 @@
+Author: Nicolas Devillard <ndevilla@free.fr>
+
+This tiny library has received countless contributions and I have
+not kept track of all the people who contributed. Let them be thanked
+for their ideas, code, suggestions, corrections, enhancements!
+
diff --git a/iniparser-4.1/FAQ-en.md b/iniparser-4.1/FAQ-en.md
new file mode 100644
index 0000000..0bb43ba
--- /dev/null
+++ b/iniparser-4.1/FAQ-en.md
@@ -0,0 +1,37 @@
+# iniparser FAQ #
+
+## Is iniparser thread safe ?
+
+Starting from version 4, iniparser is designed to be thread-safe, provided
+you surround it with your own mutex logic. The choice to not add thread
+safety inside the library has been made to provide more freedom for the
+developer, especially when dealing with their own custom reading logic
+e.g. acquiring the mutex, reading entries with iniparser, then releasing
+the mutex.
+
+## Your build system isn't portable, let me help you...
+
+We have received countless contributions from distrib people to modify the
+Makefile into what they think is the "standard", which we had to reject.
+The default, standard Makefile for Debian bears absolutely no relationship
+with the one from SuSE or RedHat and there is no possible way to merge them
+all. A build system is something so specific to each environment that it
+is completely pointless to try and push anything that claims to be
+standard. The provided Makefile in this project is purely here to have
+something to play with quickly.
+
+## iniparser_dump() is slow
+
+The dumping functions are based on fprintf, which can turn out to be
+surprisingly slow on some embedded platforms. You can replace fprintf by a
+combined use of sprintf and fwrite, or you can use setvbuf() to change
+buffering parameters to accomodate fprintf(). Something like:
+
+setvbuf(f, NULL, _IOFBF, 0);
+
+## iniparser does not compile with my C++ compiler!
+
+See the docs: iniparser is a C library. C++ is quite a different language,
+despite the promises of compatibility. You will have to modify iniparser
+quite heavily to make it work with a C++ compiler. Good luck!
+
diff --git a/iniparser-4.1/FAQ-zhcn.md b/iniparser-4.1/FAQ-zhcn.md
new file mode 100644
index 0000000..ad0286d
--- /dev/null
+++ b/iniparser-4.1/FAQ-zhcn.md
@@ -0,0 +1,27 @@
+# iniparser FAQ #
+
+## iniparserçº¿ç¨‹å®‰å…¨å— ?
+
+从版本4开始,iniparser被设计æˆçº¿ç¨‹å®‰å…¨çš„,你需è¦å›´ç»•å®ƒå¤„ç†ä½ è‡ªå·±çš„互斥逻辑。
+选择ä¸åœ¨åº“中添加线程安全,是为开å‘者æ供更多的自由,特别是在处ç†ä»–们自己的读
+逻辑。如获å–互斥é”,用iniparser阅读æ¡ç›®ï¼Œç„¶åŽé‡Šæ”¾äº’斥体。
+
+## 你的构建系统ä¸å¯ç§»æ¤ï¼Œè®©æˆ‘æ¥å¸®åŠ©ä½ ...
+
+我们已ç»æ”¶åˆ°äº†æ¥å„地的开å‘人员的无数贡献,将Makefile修改为他们认为是“标准â€çš„
+内容,但是我们ä¸å¾—ä¸æ‹’ç»ã€‚ 默认情况下,Debian的标准Makefile与SuSE或RedHat完
+全没有关系,没有å¯èƒ½çš„æ–¹å¼å°†å®ƒä»¬å…¨éƒ¨åˆå¹¶ã€‚ 构建系统对于æ¯ä¸ªçŽ¯å¢ƒæ¥è¯´éƒ½æ˜¯ç‰¹åˆ«çš„,
+å°è¯•æŽ¨åŠ¨ä»»ä½•å£°ç§°æ˜¯æ ‡å‡†çš„东西是完全没有æ„义的。 在这个项目中æ供的Makefile纯粹
+是为了快速的把库跑起æ¥ã€‚
+
+## iniparser_dump() 速度慢
+
+dump函数是基于fprintf的,在嵌入å¼å¹³å°ä¸Šå®ƒå¯èƒ½å¯¼è‡´å¾ˆæ…¢ã€‚ä½ å¯ä»¥æŠŠfprintfæ¢æˆ
+sprintfå’Œfwrite的组åˆï¼Œæˆ–者å¯ä»¥ä½¿ç”¨setvbfu()æ¥æ”¹å˜fprintf的缓存å‚数。比如:
+
+setvbuf(f, NULL, _IOFBF, 0);
+
+## 用我的c++编译器ä¸èƒ½ç¼–译iniparser!
+
+看文档:iniparser是一个C库。虽然C++兼容C,但它å´æ˜¯å¦å¤–一门语言。让iniparser在
+C++编译器下工作,会是一份ç¹é‡çš„工作。ç¥ä½ å¥½è¿ï¼
diff --git a/iniparser-4.1/INSTALL b/iniparser-4.1/INSTALL
new file mode 100644
index 0000000..a5b05d0
--- /dev/null
+++ b/iniparser-4.1/INSTALL
@@ -0,0 +1,15 @@
+
+iniParser installation instructions
+-----------------------------------
+
+- Modify the Makefile to suit your environment.
+- Type 'make' to make the library.
+- Type 'make check' to make the test program.
+- Type 'test/iniexample' to launch the test program.
+- Type 'test/parse' to launch torture tests.
+
+
+
+Enjoy!
+N. Devillard
+Wed Mar 2 21:14:17 CET 2011
diff --git a/iniparser-4.1/LICENSE b/iniparser-4.1/LICENSE
new file mode 100644
index 0000000..4c073ba
--- /dev/null
+++ b/iniparser-4.1/LICENSE
@@ -0,0 +1,40 @@
+Most of the library code:
+
+Copyright (c) 2000-2011 by Nicolas Devillard.
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+-----------------------------------------------------------
+
+getline.c:
+The original code is public domain -- Will Hartung 4/9/09
+Modifications, public domain as well, by Antti Haapala, 11/10/17
+
+Additionaly, getline.c can be considered available under CC BY-SA 3.0,
+as required under the Terms of Service of StackOverflow where the code
+was taken from.
+
+-----------------------------------------------------------
+
+Modifications to make the library work with lines longer that 1024 chars:
+
+Copyright (C) 2021 Wojtek Kosior, dual licensed under either:
+ - GNU GPL, version 3 or (at Your option) any later version
+ - 0BSD
diff --git a/iniparser-4.1/Makefile b/iniparser-4.1/Makefile
new file mode 100644
index 0000000..bcf4dc4
--- /dev/null
+++ b/iniparser-4.1/Makefile
@@ -0,0 +1,86 @@
+#
+# iniparser Makefile
+#
+.PHONY: example
+
+# Compiler settings
+CC = i686-w64-mingw32-gcc
+
+CFLAGS += -Wall -Wextra -ansi -pedantic
+#CFLAGS += -fPIC
+ifndef DEBUG
+ADDITIONAL_CFLAGS ?= -O2
+else
+ADDITIONAL_CFLAGS ?= -g
+endif
+
+CFLAGS += ${ADDITIONAL_CFLAGS}
+
+# Ar settings to build the library
+AR = i686-w64-mingw32-ar
+ARFLAGS = rcs
+
+SHLD = ${CC} ${CFLAGS}
+LDSHFLAGS = -shared -Wl,-Bsymbolic
+LDFLAGS += -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
+
+# .so.0 is for version 3.x, .so.1 is 4.x
+SO_TARGET ?= libiniparser.so.1
+
+# Set RANLIB to ranlib on systems that require it (Sun OS < 4, Mac OSX)
+# RANLIB = ranlib
+RANLIB = true
+
+RM ?= rm -f
+
+
+# Implicit rules
+
+SUFFIXES = .o .c .h .a .so .sl
+
+COMPILE.c ?= $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
+
+ifndef V
+QUIET_AR = @echo "AR $@";
+QUIET_CC = @echo "CC $@";
+QUIET_LINK = @echo "LINK $@";
+QUIET_RANLIB = @echo "RANLIB $@";
+endif
+
+.c.o:
+ $(QUIET_CC)$(COMPILE.c) $(OUTPUT_OPTION) $<
+
+
+SRCS = src/iniparser.c src/dictionary.c src/getline.c
+
+OBJS = $(SRCS:.c=.o)
+
+
+default: libiniparser.a $(SO_TARGET)
+
+libiniparser.a: $(OBJS)
+ $(QUIET_AR)$(AR) $(ARFLAGS) $@ $^
+ $(QUIET_RANLIB)$(RANLIB) $@
+
+$(SO_TARGET): $(OBJS)
+ $(QUIET_LINK)$(SHLD) $(LDSHFLAGS) $(LDFLAGS) -o $(SO_TARGET) $(OBJS) \
+ -Wl,-soname=`basename $(SO_TARGET)`
+
+clean:
+ $(RM) $(OBJS)
+ @(cd test ; $(MAKE) clean)
+
+veryclean:
+ $(RM) $(OBJS) libiniparser.a $(SO_TARGET)
+ rm -rf ./html ; mkdir html
+ cd example ; $(MAKE) veryclean
+ cd test ; $(MAKE) veryclean
+
+docs:
+ @(cd doc ; $(MAKE))
+
+check: $(SO_TARGET)
+ @(cd test ; $(MAKE))
+
+example: libiniparser.a
+ @(cd example ; $(MAKE))
diff --git a/iniparser-4.1/README.md b/iniparser-4.1/README.md
new file mode 100644
index 0000000..dbc30d0
--- /dev/null
+++ b/iniparser-4.1/README.md
@@ -0,0 +1,44 @@
+[![Build Status](https://travis-ci.org/ndevilla/iniparser.svg?branch=master)](https://travis-ci.org/ndevilla/iniparser)
+
+# Iniparser 4 #
+
+
+## I - Overview
+
+This modules offers parsing of ini files from the C level.
+See a complete documentation in HTML format, from this directory
+open the file html/index.html with any HTML-capable browser.
+
+Key features :
+
+ - Small : around 1500 sloc inside 4 files (2 .c and 2 .h)
+ - Portable : no dependancies, written in `-ansi -pedantic` C89
+ - Fully reintrant : easy to make it thread-safe (just surround
+ library calls by mutex)
+
+## II - Building project
+
+A simple `make` at the root of the project should be enough to get the static
+(i.e. `libiniparser.a`) and shared (i.e. `libiniparser.so.0`) libraries compiled.
+
+You should consider trying the following rules too :
+
+ - `make check` : run the unitary tests
+ - `make example` : compile the example, run it with `./example/iniexample`
+
+## III - License
+
+This software is released under MIT License.
+See LICENSE for full informations
+
+## IV - Versions
+
+Current version is 4.1. Version 4.0 introduces breaking changes in the api.
+Older versions 3.1 and 3.2 with the legacy api are available as tags.
+
+
+## V - FAQ
+
+See [FAQ-en.md](FAQ-en.md) in this directory for answers to Frequently Asked Questions.
+
+还有简化中国翻译在[FAQ-zhcn.md](FAQ-zhcn.md).
diff --git a/iniparser-4.1/doc/Makefile b/iniparser-4.1/doc/Makefile
new file mode 100644
index 0000000..db925ec
--- /dev/null
+++ b/iniparser-4.1/doc/Makefile
@@ -0,0 +1,16 @@
+#
+# iniparser doc Makefile
+#
+
+all: html
+
+html:
+ doxygen iniparser.dox
+ rm -f ../html/annotated.html
+ rm -f ../html/classes.html
+ rm -f ../html/doxygen.gif
+ rm -f ../html/files.html
+ rm -f ../html/functions.html
+ rm -f ../html/globals.html
+ rm -f ../html/iniparser_main.html
+
diff --git a/iniparser-4.1/doc/iniparser.dox b/iniparser-4.1/doc/iniparser.dox
new file mode 100644
index 0000000..e4b2242
--- /dev/null
+++ b/iniparser-4.1/doc/iniparser.dox
@@ -0,0 +1,81 @@
+PROJECT_NAME = iniparser
+PROJECT_NUMBER = 4.1
+OUTPUT_DIRECTORY = ..
+OUTPUT_LANGUAGE = English
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+HIDE_UNDOC_MEMBERS = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+INTERNAL_DOCS = NO
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+VERBATIM_HEADERS = NO
+SHOW_INCLUDE_FILES = NO
+JAVADOC_AUTOBRIEF = NO
+INHERIT_DOCS = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 4
+ENABLED_SECTIONS =
+GENERATE_TODOLIST = NO
+GENERATE_TESTLIST = NO
+ALIASES =
+MAX_INITIALIZER_LINES = 30
+OPTIMIZE_OUTPUT_FOR_C = YES
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+INPUT = iniparser.main ../src
+FILE_PATTERNS = iniparser.h
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+DISABLE_INDEX = YES
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+
+GENERATE_LATEX = NO
+GENERATE_RTF = NO
+GENERATE_MAN = NO
+
+ENABLE_PREPROCESSING = NO
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = NO
+SEARCH_INCLUDES = NO
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+PERL_PATH = /usr/bin/perl
+HAVE_DOT = NO
+SEARCHENGINE = NO
diff --git a/iniparser-4.1/doc/iniparser.main b/iniparser-4.1/doc/iniparser.main
new file mode 100644
index 0000000..47747c1
--- /dev/null
+++ b/iniparser-4.1/doc/iniparser.main
@@ -0,0 +1,207 @@
+
+/**
+
+ @mainpage iniparser documentation
+
+
+ @section welcome Introduction
+
+ iniParser is a simple C library offering ini file parsing services.
+ The library is pretty small (less than 1500 lines of C) and robust, and
+ does not depend on any other external library to compile. It is written
+ in ANSI C and should compile on most platforms without difficulty.
+
+
+ @section inidef What is an ini file?
+
+ An ini file is an ASCII file describing simple parameters
+ (character strings, integers, floating-point values or booleans)
+ in an explicit format, easy to use and modify for users.
+
+ An ini file is segmented into Sections, declared by the following
+ syntax:
+
+ @verbatim
+ [Section Name]
+ @endverbatim
+
+ i.e. the section name enclosed in square brackets, alone on a
+ line. Sections names are allowed to contain any character but
+ square brackets or linefeeds.
+
+ In any section are zero or more variables, declared with the
+ following syntax:
+
+ @verbatim
+ Key = value ; comment
+ @endverbatim
+
+ The key is any string (possibly containing blanks). The value is
+ any character on the right side of the equal sign. Values can be
+ given enclosed with quotes. If no quotes are present, the value is
+ understood as containing all characters between the first and the
+ last non-blank characters before the comment. The following
+ declarations are identical:
+
+ @verbatim
+ Hello = "this is a long string value" ; comment
+ Hello = this is a long string value ; comment
+ @endverbatim
+
+ The semicolon and comment at the end of the line are optional. If
+ there is a comment, it starts from the first character after the
+ semicolon up to the end of the line.
+
+ Multi-line values can be provided by ending the line with a
+ backslash (\).
+
+ @verbatim
+ Multiple = Line 1 \
+ Line 2 \
+ Line 3 \
+ Line 4 ; comment
+ @endverbatim
+
+ This would yield: "multiple" <- "Line1 Line2 Line3 Line4"
+
+ Comments in an ini file are:
+
+ - Lines starting with a hash sign
+ - Blank lines (only blanks or tabs)
+ - Comments given on value lines after the semicolon (if present)
+
+
+ @section install Compiling/installing the library
+
+ Edit the Makefile to indicate the C compiler you want to use, the
+ options to provide to compile ANSI C, and possibly the options to pass
+ to the ar program on your machine to build a library (.a) from a set
+ of object (.o) files.
+
+ Defaults are set for the gcc compiler and the standard ar library
+ builder.
+
+ Type 'make', that should do it.
+
+ To use the library in your programs, add the following line on top
+ of your module:
+
+ @code
+ #include "iniparser.h"
+ @endcode
+
+ And link your program with the iniparser library by adding
+ @c -liniparser.a to the compile line.
+
+ See the file test/initest.c for an example.
+
+ iniparser is an ANSI C library. If you want to compile it
+ with a C++ compiler you will likely run into compatibility
+ issues. Headers probably have to include the extern "C"
+ hack and function prototypes will want to add some const
+ here and there to keep the compiler happy. This job is left
+ to the reader as there are too many C++ compilers around, each
+ with its own requirements as to what represents acceptable
+ C code in a C++ environment. You have been warned.
+
+
+ @section reference Library reference
+
+ The library is completely documented in its header file. On-line
+ documentation has been generated and can be consulted here:
+
+ - iniparser.h
+
+
+ @section usage Using the parser
+
+ Comments are discarded by the parser. Then sections are
+ identified, and in each section a new entry is created for every
+ keyword found. The keywords are stored with the following syntax:
+
+ @verbatim
+ [Section]
+ Keyword = value ; comment
+ @endverbatim
+
+ is converted to the following key pair:
+
+ @verbatim
+ ("section:keyword", "value")
+ @endverbatim
+
+ This means that if you want to retrieve the value that was stored
+ in the section called @c Pizza, in the keyword @c Cheese,
+ you would make a request to the dictionary for
+ @c "pizza:cheese". All section and keyword names are converted
+ to lowercase before storage in the structure. The value side is
+ conserved as it has been parsed, though.
+
+ Section names are also stored in the structure. They are stored
+ using as key the section name, and a NULL associated value. They
+ can be queried through iniparser_find_entry().
+
+ To launch the parser, use the function called iniparser_load(), which
+ takes an input file name and returns a newly allocated @e dictionary
+ structure. This latter object should remain opaque to the user and only
+ accessed through the following accessor functions:
+
+ - iniparser_getstring()
+ - iniparser_getint()
+ - iniparser_getdouble()
+ - iniparser_getboolean()
+
+ Finally, discard this structure using iniparser_freedict().
+
+ All values parsed from the ini file are stored as strings. The
+ accessors are just converting these strings to the requested type on
+ the fly, but you could basically perform this conversion by yourself
+ after having called the string accessor.
+
+ Notice that iniparser_getboolean() will return an integer (0 or 1),
+ trying to make sense of what was found in the file. Strings starting
+ with "y", "Y", "t", "T" or "1" are considered true values (return 1),
+ strings starting with "n", "N", "f", "F", "0" are considered false
+ (return 0). This allows some flexibility in handling of boolean
+ answers.
+
+ If you want to add extra information into the structure that was not
+ present in the ini file, you can use iniparser_set() to insert a
+ string.
+
+ If you want to add a section to the structure, add a key
+ with a NULL value. Example:
+ @verbatim
+ iniparser_set(ini, "section", NULL);
+ iniparser_set(ini, "section:key1", NULL);
+ iniparser_set(ini, "section:key2", NULL);
+ @endverbatim
+
+
+ @section implementation A word about the implementation
+
+ The dictionary structure is a pretty simple dictionary
+ implementation which might find some uses in other applications.
+ If you are curious, look into the source.
+
+
+ @section defects Known defects
+
+ The dictionary structure is extremely unefficient for searching
+ as keys are sorted in the same order as they are read from the
+ ini file, which is convenient when dumping back to a file. The
+ simplistic first-approach linear search implemented there can
+ become a bottleneck if you have a very large number of keys.
+
+ People who need to load large amounts of data from an ini file
+ should definitely turn to more appropriate solutions: sqlite3 or
+ similar. There are otherwise many other dictionary implementations
+ available on the net to replace this one.
+
+
+ @section authors Authors
+
+ Nicolas Devillard (ndevilla AT free DOT fr).
+
+
+*/
diff --git a/iniparser-4.1/example/Makefile b/iniparser-4.1/example/Makefile
new file mode 100644
index 0000000..cc6e54b
--- /dev/null
+++ b/iniparser-4.1/example/Makefile
@@ -0,0 +1,27 @@
+#
+# iniparser tests Makefile
+#
+
+CC = i686-w64-mingw32-gcc
+CFLAGS += -g -I../src
+LFLAGS += -L.. -liniparser
+AR = i686-w64-mingw32-ar
+ARFLAGS += rcv
+RM ?= rm -f
+
+
+default: all
+
+all: iniexample.exe parse.exe
+
+iniexample.exe: iniexample.c
+ $(CC) $(CFLAGS) -o iniexample.exe iniexample.c -I../src -L.. -liniparser
+
+parse.exe: parse.c
+ $(CC) $(CFLAGS) -o parse.exe parse.c -I../src -L.. -liniparser
+
+clean veryclean:
+ $(RM) iniexample.exe example.ini parse.exe
+
+
+
diff --git a/iniparser-4.1/example/iniexample.c b/iniparser-4.1/example/iniexample.c
new file mode 100644
index 0000000..81013f0
--- /dev/null
+++ b/iniparser-4.1/example/iniexample.c
@@ -0,0 +1,104 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "iniparser.h"
+
+void create_example_ini_file(void);
+int parse_ini_file(char * ini_name);
+
+int main(int argc, char * argv[])
+{
+ int status ;
+
+ if (argc<2) {
+ create_example_ini_file();
+ status = parse_ini_file("example.ini");
+ } else {
+ status = parse_ini_file(argv[1]);
+ }
+ return status ;
+}
+
+void create_example_ini_file(void)
+{
+ FILE * ini ;
+
+ if ((ini=fopen("example.ini", "w"))==NULL) {
+ fprintf(stderr, "iniparser: cannot create example.ini\n");
+ return ;
+ }
+
+ fprintf(ini,
+ "#\n"
+ "# This is an example of ini file\n"
+ "#\n"
+ "\n"
+ "[Pizza]\n"
+ "\n"
+ "Ham = yes ;\n"
+ "Mushrooms = TRUE ;\n"
+ "Capres = 0 ;\n"
+ "Cheese = Non ;\n"
+ "\n"
+ "\n"
+ "[Wine]\n"
+ "\n"
+ "Grape = Cabernet Sauvignon ;\n"
+ "Year = 1989 ;\n"
+ "Country = Spain ;\n"
+ "Alcohol = 12.5 ;\n"
+ "\n");
+ fclose(ini);
+}
+
+
+int parse_ini_file(char * ini_name)
+{
+ dictionary * ini ;
+
+ /* Some temporary variables to hold query results */
+ int b ;
+ int i ;
+ double d ;
+ const char * s ;
+
+ ini = iniparser_load(ini_name);
+ if (ini==NULL) {
+ fprintf(stderr, "cannot parse file: %s\n", ini_name);
+ return -1 ;
+ }
+ iniparser_dump(ini, stderr);
+
+ /* Get pizza attributes */
+ printf("Pizza:\n");
+
+ b = iniparser_getboolean(ini, "pizza:ham", -1);
+ printf("Ham: [%d]\n", b);
+ b = iniparser_getboolean(ini, "pizza:mushrooms", -1);
+ printf("Mushrooms: [%d]\n", b);
+ b = iniparser_getboolean(ini, "pizza:capres", -1);
+ printf("Capres: [%d]\n", b);
+ b = iniparser_getboolean(ini, "pizza:cheese", -1);
+ printf("Cheese: [%d]\n", b);
+
+ /* Get wine attributes */
+ printf("Wine:\n");
+ s = iniparser_getstring(ini, "wine:grape", NULL);
+ printf("Grape: [%s]\n", s ? s : "UNDEF");
+
+ i = iniparser_getint(ini, "wine:year", -1);
+ printf("Year: [%d]\n", i);
+
+ s = iniparser_getstring(ini, "wine:country", NULL);
+ printf("Country: [%s]\n", s ? s : "UNDEF");
+
+ d = iniparser_getdouble(ini, "wine:alcohol", -1.0);
+ printf("Alcohol: [%g]\n", d);
+
+ iniparser_freedict(ini);
+ return 0 ;
+}
+
+
diff --git a/iniparser-4.1/example/parse.c b/iniparser-4.1/example/parse.c
new file mode 100644
index 0000000..37d07aa
--- /dev/null
+++ b/iniparser-4.1/example/parse.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "iniparser.h"
+
+int main(int argc, char * argv[])
+{
+ dictionary * ini ;
+ char * ini_name ;
+
+ if (argc<2) {
+ ini_name = "twisted.ini";
+ } else {
+ ini_name = argv[1] ;
+ }
+
+ ini = iniparser_load(ini_name);
+ iniparser_dump(ini, stdout);
+ iniparser_freedict(ini);
+
+ return 0 ;
+}
diff --git a/iniparser-4.1/example/twisted-errors.ini b/iniparser-4.1/example/twisted-errors.ini
new file mode 100644
index 0000000..4dc3bbe
--- /dev/null
+++ b/iniparser-4.1/example/twisted-errors.ini
@@ -0,0 +1,9 @@
+#
+# All of these should trigger syntax errors
+#
+[section]
+hello
+world
+hello \
+world
+a + b ;
diff --git a/iniparser-4.1/example/twisted-genhuge.py b/iniparser-4.1/example/twisted-genhuge.py
new file mode 100644
index 0000000..570973c
--- /dev/null
+++ b/iniparser-4.1/example/twisted-genhuge.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+import os
+import sys
+
+if __name__=="__main__":
+ f=open('twisted-massive.ini', 'w')
+ for i in range(100):
+ f.write('[%03d]\n' % i)
+ for j in range(100):
+ f.write('key-%03d=1;\n' % j)
+ f.close()
+
diff --git a/iniparser-4.1/example/twisted-ofkey.ini b/iniparser-4.1/example/twisted-ofkey.ini
new file mode 100644
index 0000000..4f2e72e
--- /dev/null
+++ b/iniparser-4.1/example/twisted-ofkey.ini
@@ -0,0 +1,66 @@
+# Stress testing buffers for overflows
+[long]
+# Shitload key size
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1
+
diff --git a/iniparser-4.1/example/twisted-ofval.ini b/iniparser-4.1/example/twisted-ofval.ini
new file mode 100644
index 0000000..2a3cedf
--- /dev/null
+++ b/iniparser-4.1/example/twisted-ofval.ini
@@ -0,0 +1,56 @@
+# Shitload data size
+[long]
+a=\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+
diff --git a/iniparser-4.1/example/twisted.ini b/iniparser-4.1/example/twisted.ini
new file mode 100644
index 0000000..86e549f
--- /dev/null
+++ b/iniparser-4.1/example/twisted.ini
@@ -0,0 +1,131 @@
+#
+# Twisted.ini
+# This file is meant for regression tests
+
+# Different blank settings around the equal sign
+[blanks]
+a=1
+b=1;
+c=1; comment
+d=1# comment
+
+e =1
+f =1;
+g =1; comment
+h =1# comment
+
+i= 1
+j= 1;
+k= 1; comment
+l= 1# comment
+
+m = 1
+n = 1;
+o = 1; comment
+p = 1# comment
+
+q=1 ;
+r=1 ; comment
+s=1 ;comment
+t=1 #comment
+
+# Empty values
+[empty]
+a = ''
+b = ""
+
+c = '' ;
+d = "" ;
+
+e = '' ; comment
+f = "" ; comment
+
+g =
+h = ;
+i = ; comment
+j = # comment
+
+k=
+l=;
+m=;comment
+n=#
+
+# Peculiar values
+[peculiar]
+a=';';
+b='#'#
+c=';';comment
+d='#'#comment
+e=\;
+f=\#
+g=\;comment
+h=\#comment
+i=;;
+j=##
+k=;;;;;;;;;;
+l=##########
+
+# Quotes
+[quotes]
+s1='
+s2=''
+s3='''
+s4=''''
+
+d1="
+d2=""
+d3="""
+d4=""""
+
+m1='"'
+m2="'"
+
+h1=hello'world
+h2='hello'world
+h3='hello'world'
+
+h4=hello"world
+h5="hello"world
+h6="hello"world"
+
+# Section names
+[a]
+[ b]
+[c ]
+[ d ]
+[ begin end ]
+[ open[ ]
+
+# Multi-line inputs
+[multi]
+a = begin\
+end
+b = begin \
+end
+c = begin \
+ end
+d = 1\
+2\
+3\
+4
+e = 1 \
+ 2 \
+ 3 \
+ 4
+f = 1 ; \
+hidden = because of the preceding backslash multi-lining the comment ;
+visible = 1
+g = 1 #\
+and now this comment is hidden too \
+and this one too
+h = 1
+multi \
+line \
+key = 1
+multi \
+line \
+key = \
+multi \
+line \
+value ;
+# end of file
diff --git a/iniparser-4.1/src/dictionary.c b/iniparser-4.1/src/dictionary.c
new file mode 100644
index 0000000..7d6bc43
--- /dev/null
+++ b/iniparser-4.1/src/dictionary.c
@@ -0,0 +1,406 @@
+/*-------------------------------------------------------------------------*/
+/**
+ @file dictionary.c
+ @author N. Devillard
+ @brief Implements a dictionary for string variables.
+
+ This module implements a simple dictionary object, i.e. a list
+ of string/string associations. This object is useful to store e.g.
+ informations retrieved from a configuration file (ini files).
+*/
+/*--------------------------------------------------------------------------*/
+
+/*---------------------------------------------------------------------------
+ Includes
+ ---------------------------------------------------------------------------*/
+#include "dictionary.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/** Maximum value size for integers and doubles. */
+#define MAXVALSZ 1024
+
+/** Minimal allocated number of entries in a dictionary */
+#define DICTMINSZ 128
+
+/** Invalid key token */
+#define DICT_INVALID_KEY ((char*)-1)
+
+/*---------------------------------------------------------------------------
+ Private functions
+ ---------------------------------------------------------------------------*/
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Duplicate a string
+ @param s String to duplicate
+ @return Pointer to a newly allocated string, to be freed with free()
+
+ This is a replacement for strdup(). This implementation is provided
+ for systems that do not have it.
+ */
+/*--------------------------------------------------------------------------*/
+static char * xstrdup(const char * s)
+{
+ char * t ;
+ size_t len ;
+ if (!s)
+ return NULL ;
+
+ len = strlen(s) + 1 ;
+ t = (char*) malloc(len) ;
+ if (t) {
+ memcpy(t, s, len) ;
+ }
+ return t ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Grow user data buffer if it is not large enough.
+ @param dict Dictionary to operate on
+ @param required_size Minimal expected size of user data buffer
+ @return This function returns non-zero in case of failure
+ */
+/*--------------------------------------------------------------------------*/
+int prepare_user_data_buf(dictionary *dict, size_t required_size)
+{
+ char *tmp;
+
+ if (dict->user_data_len < required_size) {
+ tmp = realloc(dict->user_data, required_size);
+ if (!tmp)
+ return -1;
+ dict->user_data = tmp;
+ dict->user_data_len = required_size;
+ }
+
+ return 0;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Double the size of the dictionary
+ @param d Dictionary to grow
+ @return This function returns non-zero in case of failure
+ */
+/*--------------------------------------------------------------------------*/
+static int dictionary_grow(dictionary * d)
+{
+ char ** new_val ;
+ char ** new_key ;
+ unsigned * new_hash ;
+
+ new_val = (char**) calloc(d->size * 2, sizeof *d->val);
+ new_key = (char**) calloc(d->size * 2, sizeof *d->key);
+ new_hash = (unsigned*) calloc(d->size * 2, sizeof *d->hash);
+ if (!new_val || !new_key || !new_hash) {
+ /* An allocation failed, leave the dictionary unchanged */
+ if (new_val)
+ free(new_val);
+ if (new_key)
+ free(new_key);
+ if (new_hash)
+ free(new_hash);
+ return -1 ;
+ }
+ /* Initialize the newly allocated space */
+ memcpy(new_val, d->val, d->size * sizeof(char *));
+ memcpy(new_key, d->key, d->size * sizeof(char *));
+ memcpy(new_hash, d->hash, d->size * sizeof(unsigned));
+ /* Delete previous data */
+ free(d->val);
+ free(d->key);
+ free(d->hash);
+ /* Actually update the dictionary */
+ d->size *= 2 ;
+ d->val = new_val;
+ d->key = new_key;
+ d->hash = new_hash;
+ return 0 ;
+}
+
+/*---------------------------------------------------------------------------
+ Function codes
+ ---------------------------------------------------------------------------*/
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Compute the hash key for a string.
+ @param key Character string to use for key.
+ @return 1 unsigned int on at least 32 bits.
+
+ This hash function has been taken from an Article in Dr Dobbs Journal.
+ This is normally a collision-free function, distributing keys evenly.
+ The key is stored anyway in the struct so that collision can be avoided
+ by comparing the key itself in last resort.
+ */
+/*--------------------------------------------------------------------------*/
+unsigned dictionary_hash(const char * key)
+{
+ size_t len ;
+ unsigned hash ;
+ size_t i ;
+
+ if (!key)
+ return 0 ;
+
+ len = strlen(key);
+ for (hash=0, i=0 ; i<len ; i++) {
+ hash += (unsigned)key[i] ;
+ hash += (hash<<10);
+ hash ^= (hash>>6) ;
+ }
+ hash += (hash <<3);
+ hash ^= (hash >>11);
+ hash += (hash <<15);
+ return hash ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Create a new dictionary object.
+ @param size Optional initial size of the dictionary.
+ @return 1 newly allocated dictionary objet.
+
+ This function allocates a new dictionary object of given size and returns
+ it. If you do not know in advance (roughly) the number of entries in the
+ dictionary, give size=0.
+ */
+/*-------------------------------------------------------------------------*/
+dictionary * dictionary_new(size_t size)
+{
+ dictionary * d ;
+
+ /* If no size was specified, allocate space for DICTMINSZ */
+ if (size<DICTMINSZ) size=DICTMINSZ ;
+
+ d = (dictionary*) calloc(1, sizeof *d) ;
+
+ if (d) {
+ d->size = size ;
+ d->val = (char**) calloc(size, sizeof *d->val);
+ d->key = (char**) calloc(size, sizeof *d->key);
+ d->hash = (unsigned*) calloc(size, sizeof *d->hash);
+ d->user_data = NULL;
+ d->user_data_len = 0;
+ }
+ return d ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Delete a dictionary object
+ @param d dictionary object to deallocate.
+ @return void
+
+ Deallocate a dictionary object and all memory associated to it.
+ */
+/*--------------------------------------------------------------------------*/
+void dictionary_del(dictionary * d)
+{
+ ssize_t i ;
+
+ if (d==NULL) return ;
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]!=NULL)
+ free(d->key[i]);
+ if (d->val[i]!=NULL)
+ free(d->val[i]);
+ }
+ free(d->val);
+ free(d->key);
+ free(d->hash);
+ free(d->user_data);
+ free(d);
+ return ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get a value from a dictionary.
+ @param d dictionary object to search.
+ @param key Key to look for in the dictionary.
+ @param def Default value to return if key not found.
+ @return 1 pointer to internally allocated character string.
+
+ This function locates a key in a dictionary and returns a pointer to its
+ value, or the passed 'def' pointer if no such key can be found in
+ dictionary. The returned character pointer points to data internal to the
+ dictionary object, you should not try to free it or modify it.
+ */
+/*--------------------------------------------------------------------------*/
+const char * dictionary_get(const dictionary * d, const char * key, const char * def)
+{
+ unsigned hash ;
+ ssize_t i ;
+
+ hash = dictionary_hash(key);
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]==NULL)
+ continue ;
+ /* Compare hash */
+ if (hash==d->hash[i]) {
+ /* Compare string, to avoid hash collisions */
+ if (!strcmp(key, d->key[i])) {
+ return d->val[i] ;
+ }
+ }
+ }
+ return def ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Set a value in a dictionary.
+ @param d dictionary object to modify.
+ @param key Key to modify or add.
+ @param val Value to add.
+ @return int 0 if Ok, anything else otherwise
+
+ If the given key is found in the dictionary, the associated value is
+ replaced by the provided one. If the key cannot be found in the
+ dictionary, it is added to it.
+
+ It is Ok to provide a NULL value for val, but NULL values for the dictionary
+ or the key are considered as errors: the function will return immediately
+ in such a case.
+
+ Notice that if you dictionary_set a variable to NULL, a call to
+ dictionary_get will return a NULL value: the variable will be found, and
+ its value (NULL) is returned. In other words, setting the variable
+ content to NULL is equivalent to deleting the variable from the
+ dictionary. It is not possible (in this implementation) to have a key in
+ the dictionary without value.
+
+ This function returns non-zero in case of failure.
+ */
+/*--------------------------------------------------------------------------*/
+int dictionary_set(dictionary * d, const char * key, const char * val)
+{
+ ssize_t i ;
+ unsigned hash ;
+
+ if (d==NULL || key==NULL) return -1 ;
+
+ /* Compute hash for this key */
+ hash = dictionary_hash(key) ;
+ /* Find if value is already in dictionary */
+ if (d->n>0) {
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]==NULL)
+ continue ;
+ if (hash==d->hash[i]) { /* Same hash value */
+ if (!strcmp(key, d->key[i])) { /* Same key */
+ /* Found a value: modify and return */
+ if (d->val[i]!=NULL)
+ free(d->val[i]);
+ d->val[i] = (val ? xstrdup(val) : NULL);
+ /* Value has been modified: return */
+ return 0 ;
+ }
+ }
+ }
+ }
+ /* Add a new value */
+ /* See if dictionary needs to grow */
+ if (d->n==d->size) {
+ /* Reached maximum size: reallocate dictionary */
+ if (dictionary_grow(d) != 0)
+ return -1;
+ }
+
+ /* Insert key in the first empty slot. Start at d->n and wrap at
+ d->size. Because d->n < d->size this will necessarily
+ terminate. */
+ for (i=d->n ; d->key[i] ; ) {
+ if(++i == d->size) i = 0;
+ }
+ /* Copy key */
+ d->key[i] = xstrdup(key);
+ d->val[i] = (val ? xstrdup(val) : NULL) ;
+ d->hash[i] = hash;
+ d->n ++ ;
+ return 0 ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Delete a key in a dictionary
+ @param d dictionary object to modify.
+ @param key Key to remove.
+ @return void
+
+ This function deletes a key in a dictionary. Nothing is done if the
+ key cannot be found.
+ */
+/*--------------------------------------------------------------------------*/
+void dictionary_unset(dictionary * d, const char * key)
+{
+ unsigned hash ;
+ ssize_t i ;
+
+ if (key == NULL || d == NULL) {
+ return;
+ }
+
+ hash = dictionary_hash(key);
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]==NULL)
+ continue ;
+ /* Compare hash */
+ if (hash==d->hash[i]) {
+ /* Compare string, to avoid hash collisions */
+ if (!strcmp(key, d->key[i])) {
+ /* Found key */
+ break ;
+ }
+ }
+ }
+ if (i>=d->size)
+ /* Key not found */
+ return ;
+
+ free(d->key[i]);
+ d->key[i] = NULL ;
+ if (d->val[i]!=NULL) {
+ free(d->val[i]);
+ d->val[i] = NULL ;
+ }
+ d->hash[i] = 0 ;
+ d->n -- ;
+ return ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Dump a dictionary to an opened file pointer.
+ @param d Dictionary to dump
+ @param f Opened file pointer.
+ @return void
+
+ Dumps a dictionary onto an opened file pointer. Key pairs are printed out
+ as @c [Key]=[Value], one per line. It is Ok to provide stdout or stderr as
+ output file pointers.
+ */
+/*--------------------------------------------------------------------------*/
+void dictionary_dump(const dictionary * d, FILE * out)
+{
+ ssize_t i ;
+
+ if (d==NULL || out==NULL) return ;
+ if (d->n<1) {
+ fprintf(out, "empty dictionary\n");
+ return ;
+ }
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]) {
+ fprintf(out, "%20s\t[%s]\n",
+ d->key[i],
+ d->val[i] ? d->val[i] : "UNDEF");
+ }
+ }
+ return ;
+}
diff --git a/iniparser-4.1/src/dictionary.h b/iniparser-4.1/src/dictionary.h
new file mode 100644
index 0000000..ddf1f1d
--- /dev/null
+++ b/iniparser-4.1/src/dictionary.h
@@ -0,0 +1,190 @@
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @file dictionary.h
+ @author N. Devillard
+ @brief Implements a dictionary for string variables.
+
+ This module implements a simple dictionary object, i.e. a list
+ of string/string associations. This object is useful to store e.g.
+ informations retrieved from a configuration file (ini files).
+*/
+/*--------------------------------------------------------------------------*/
+
+#ifndef _DICTIONARY_H_
+#define _DICTIONARY_H_
+
+/*---------------------------------------------------------------------------
+ Includes
+ ---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*---------------------------------------------------------------------------
+ New types
+ ---------------------------------------------------------------------------*/
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Dictionary object
+
+ This object contains a list of string/string associations. Each
+ association is identified by a unique string key. Looking up values
+ in the dictionary is speeded up by the use of a (hopefully collision-free)
+ hash function.
+ */
+/*-------------------------------------------------------------------------*/
+typedef struct _dictionary_ {
+ char * user_data; /** Had to add this to make the program robust */
+ size_t user_data_len; /** user_data buffer size */
+ int n ; /** Number of entries in dictionary */
+ ssize_t size ; /** Storage size */
+ char ** val ; /** List of string values */
+ char ** key ; /** List of string keys */
+ unsigned * hash ; /** List of hash values for keys */
+} dictionary ;
+
+
+/*---------------------------------------------------------------------------
+ Function prototypes
+ ---------------------------------------------------------------------------*/
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Grow user data buffer if it is not large enough.
+ @param dict Dictionary to operate on
+ @param required_size Minimal expected size of user data buffer
+ @return This function returns non-zero in case of failure
+
+ If dict->user_data is too small to contain required_size bytes,
+ this function attempts to reallocate it into a bigger buffer and
+ updates dict->user_data_len accordingly.
+ */
+/*--------------------------------------------------------------------------*/
+ int prepare_user_data_buf(dictionary *dict, size_t required_size);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Compute the hash key for a string.
+ @param key Character string to use for key.
+ @return 1 unsigned int on at least 32 bits.
+
+ This hash function has been taken from an Article in Dr Dobbs Journal.
+ This is normally a collision-free function, distributing keys evenly.
+ The key is stored anyway in the struct so that collision can be avoided
+ by comparing the key itself in last resort.
+ */
+/*--------------------------------------------------------------------------*/
+unsigned dictionary_hash(const char * key);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Create a new dictionary object.
+ @param size Optional initial size of the dictionary.
+ @return 1 newly allocated dictionary objet.
+
+ This function allocates a new dictionary object of given size and returns
+ it. If you do not know in advance (roughly) the number of entries in the
+ dictionary, give size=0.
+ */
+/*--------------------------------------------------------------------------*/
+dictionary * dictionary_new(size_t size);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Delete a dictionary object
+ @param d dictionary object to deallocate.
+ @return void
+
+ Deallocate a dictionary object and all memory associated to it.
+ */
+/*--------------------------------------------------------------------------*/
+void dictionary_del(dictionary * vd);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get a value from a dictionary.
+ @param d dictionary object to search.
+ @param key Key to look for in the dictionary.
+ @param def Default value to return if key not found.
+ @return 1 pointer to internally allocated character string.
+
+ This function locates a key in a dictionary and returns a pointer to its
+ value, or the passed 'def' pointer if no such key can be found in
+ dictionary. The returned character pointer points to data internal to the
+ dictionary object, you should not try to free it or modify it.
+ */
+/*--------------------------------------------------------------------------*/
+const char * dictionary_get(const dictionary * d, const char * key, const char * def);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Set a value in a dictionary.
+ @param d dictionary object to modify.
+ @param key Key to modify or add.
+ @param val Value to add.
+ @return int 0 if Ok, anything else otherwise
+
+ If the given key is found in the dictionary, the associated value is
+ replaced by the provided one. If the key cannot be found in the
+ dictionary, it is added to it.
+
+ It is Ok to provide a NULL value for val, but NULL values for the dictionary
+ or the key are considered as errors: the function will return immediately
+ in such a case.
+
+ Notice that if you dictionary_set a variable to NULL, a call to
+ dictionary_get will return a NULL value: the variable will be found, and
+ its value (NULL) is returned. In other words, setting the variable
+ content to NULL is equivalent to deleting the variable from the
+ dictionary. It is not possible (in this implementation) to have a key in
+ the dictionary without value.
+
+ This function returns non-zero in case of failure.
+ */
+/*--------------------------------------------------------------------------*/
+int dictionary_set(dictionary * vd, const char * key, const char * val);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Delete a key in a dictionary
+ @param d dictionary object to modify.
+ @param key Key to remove.
+ @return void
+
+ This function deletes a key in a dictionary. Nothing is done if the
+ key cannot be found.
+ */
+/*--------------------------------------------------------------------------*/
+void dictionary_unset(dictionary * d, const char * key);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Dump a dictionary to an opened file pointer.
+ @param d Dictionary to dump
+ @param f Opened file pointer.
+ @return void
+
+ Dumps a dictionary onto an opened file pointer. Key pairs are printed out
+ as @c [Key]=[Value], one per line. It is Ok to provide stdout or stderr as
+ output file pointers.
+ */
+/*--------------------------------------------------------------------------*/
+void dictionary_dump(const dictionary * d, FILE * out);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/iniparser-4.1/src/getline.c b/iniparser-4.1/src/getline.c
new file mode 100644
index 0000000..4fde05b
--- /dev/null
+++ b/iniparser-4.1/src/getline.c
@@ -0,0 +1,58 @@
+/* The original code is public domain -- Will Hartung 4/9/09 */
+/* Modifications, public domain as well, by Antti Haapala, 11/10/17 */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdint.h>
+
+ssize_t _getline(char **lineptr, size_t *n, FILE *stream,
+ int (*fgetc_impl)(FILE*)) {
+ size_t pos;
+ int c;
+
+ if (lineptr == NULL || stream == NULL || n == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ c = fgetc_impl(stream);
+ if (c == EOF) {
+ return -1;
+ }
+
+ if (*lineptr == NULL) {
+ *lineptr = malloc(128);
+ if (*lineptr == NULL) {
+ return -1;
+ }
+ *n = 128;
+ }
+
+ pos = 0;
+ while(c != EOF) {
+ if (pos + 1 >= *n) {
+ char *new_ptr;
+ size_t new_size = *n + (*n >> 2);
+ if (new_size < 128) {
+ new_size = 128;
+ }
+ new_ptr = realloc(*lineptr, new_size);
+ if (new_ptr == NULL) {
+ return -1;
+ }
+ *n = new_size;
+ *lineptr = new_ptr;
+ }
+
+ ((unsigned char *)(*lineptr))[pos ++] = c;
+ if (c == '\n') {
+ break;
+ }
+ c = fgetc_impl(stream);
+ }
+
+ (*lineptr)[pos] = '\0';
+ return pos;
+}
diff --git a/iniparser-4.1/src/iniparser.c b/iniparser-4.1/src/iniparser.c
new file mode 100644
index 0000000..d3be382
--- /dev/null
+++ b/iniparser-4.1/src/iniparser.c
@@ -0,0 +1,938 @@
+
+/*-------------------------------------------------------------------------*/
+/**
+ @file iniparser.c
+ @author N. Devillard
+ @brief Parser for ini files.
+*/
+/*--------------------------------------------------------------------------*/
+/*---------------------------- Includes ------------------------------------*/
+#include <ctype.h>
+#include <stdarg.h>
+#include <errno.h>
+#include "iniparser.h"
+
+ssize_t _getline(char **lineptr, size_t *n, FILE *stream,
+ int (*fgetc_impl)(FILE*));
+
+/*---------------------------- Defines -------------------------------------*/
+#define INI_INVALID_KEY ((char*)-1)
+
+/*---------------------------------------------------------------------------
+ Private to this module
+ ---------------------------------------------------------------------------*/
+/**
+ * This enum stores the status for each parsed line (internal use only).
+ */
+typedef enum _line_status_ {
+ LINE_ERROR,
+ LINE_EMPTY,
+ LINE_COMMENT,
+ LINE_SECTION,
+ LINE_VALUE
+} line_status ;
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Convert a string to lowercase.
+ @param in String to convert.
+ @param out Output buffer.
+ @param len Size of the out buffer.
+ @return ptr to the out buffer or NULL if an error occured.
+
+ This function convert a string into lowercase.
+ At most len - 1 elements of the input string will be converted.
+ */
+/*--------------------------------------------------------------------------*/
+static const char * strlwc(const char * in, char *out, unsigned len)
+{
+ unsigned i ;
+
+ if (in==NULL || out == NULL || len==0) return NULL ;
+ i=0 ;
+ while (in[i] != '\0' && i < len-1) {
+ out[i] = (char)tolower((int)in[i]);
+ i++ ;
+ }
+ out[i] = '\0';
+ return out ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Convert a string to lowercase in-place.
+ @param in String to convert.
+ @return value of in argument.
+
+ This function convert a string into lowercase.
+ */
+/*--------------------------------------------------------------------------*/
+static char *strlwc_in_place(char *in)
+{
+ unsigned i ;
+
+ if (in == NULL)
+ return NULL;
+
+ i = 0;
+ while (in[i] != '\0') {
+ in[i] = tolower(in[i]);
+ i++;
+ }
+
+ return in;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Find substrings without blanks at the beginning nor end.
+ @param s String to parse.
+ @param s_end End of string to parse.
+ @param begin Place to store pointer to the beginning of substring or NULL.
+ @param end Place to store pointer to the end of substring or NULL.
+ @return unsigned New size of the string.
+ */
+/*--------------------------------------------------------------------------*/
+static size_t strstrip(char *s, char *s_end,
+ char **begin, char **end)
+{
+ char *_begin, *_end;
+
+ _begin = s;
+ _end = s_end;
+
+ while (_begin < _end && isspace((int) *_begin))
+ _begin++;
+
+ while (_begin < _end && isspace((int) *(_end - 1)))
+ _end--;
+
+ if (begin)
+ *begin = _begin;
+ if (end)
+ *end = _end;
+ return _end - _begin;
+}
+
+/**
+ * This variable defines, whether multiline values should be parsed.
+ */
+static int process_multiline = 1;
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Configure whether to parse multiline values.
+ @param process_multiline Boolean (0 or 1) value.
+
+ By default, multiline values will be parsed. If someone puts into their .ini
+ file 2 lines like those:
+
+ outputdir=c:\temp\
+ save_subject=1
+
+ then we're screwed. All will be treated as if it was on one line.
+ This function makes it possible to disable this linebreak feature.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_set_process_multiline(int process)
+{
+ process_multiline = process;
+}
+
+/**
+ * This variable points to the function, that should be used for reading data.
+ */
+static int (*fgetc_impl)(FILE*) = fgetc;
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Configure a function to read file.
+ @param impl Function to call.
+
+ By default, fgetc() will be used for reading files. If a null pointer is passed
+ as impl the reading callback will be switched back to default.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_set_fgetc_impl(int (*impl)(FILE*))
+{
+ if (impl)
+ fgetc_impl = impl;
+ else
+ fgetc_impl = fgetc;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Default error callback for iniparser: wraps `fprintf(stderr, ...)`.
+ */
+/*--------------------------------------------------------------------------*/
+static int default_error_callback(const char *format, ...)
+{
+ int ret;
+ va_list argptr;
+ va_start(argptr, format);
+ ret = vfprintf(stderr, format, argptr);
+ va_end(argptr);
+ return ret;
+}
+
+static int (*iniparser_error_callback)(const char*, ...) = default_error_callback;
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Configure a function to receive the error messages.
+ @param errback Function to call.
+
+ By default, the error will be printed on stderr. If a null pointer is passed
+ as errback the error callback will be switched back to default.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_set_error_callback(int (*errback)(const char *, ...))
+{
+ if (errback) {
+ iniparser_error_callback = errback;
+ } else {
+ iniparser_error_callback = default_error_callback;
+ }
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get number of sections in a dictionary
+ @param d Dictionary to examine
+ @return int Number of sections found in dictionary
+
+ This function returns the number of sections found in a dictionary.
+ The test to recognize sections is done on the string stored in the
+ dictionary: a section name is given as "section" whereas a key is
+ stored as "section:key", thus the test looks for entries that do not
+ contain a colon.
+
+ This clearly fails in the case a section name contains a colon, but
+ this should simply be avoided.
+
+ This function returns -1 in case of error.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getnsec(const dictionary * d)
+{
+ int i ;
+ int nsec ;
+
+ if (d==NULL) return -1 ;
+ nsec=0 ;
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]==NULL)
+ continue ;
+ if (strchr(d->key[i], ':')==NULL) {
+ nsec ++ ;
+ }
+ }
+ return nsec ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get name for section n in a dictionary.
+ @param d Dictionary to examine
+ @param n Section number (from 0 to nsec-1).
+ @return Pointer to char string
+
+ This function locates the n-th section in a dictionary and returns
+ its name as a pointer to a string statically allocated inside the
+ dictionary. Do not free or modify the returned string!
+
+ This function returns NULL in case of error.
+ */
+/*--------------------------------------------------------------------------*/
+const char * iniparser_getsecname(const dictionary * d, int n)
+{
+ int i ;
+ int foundsec ;
+
+ if (d==NULL || n<0) return NULL ;
+ foundsec=0 ;
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]==NULL)
+ continue ;
+ if (strchr(d->key[i], ':')==NULL) {
+ foundsec++ ;
+ if (foundsec>n)
+ break ;
+ }
+ }
+ if (foundsec<=n) {
+ return NULL ;
+ }
+ return d->key[i] ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Dump a dictionary to an opened file pointer.
+ @param d Dictionary to dump.
+ @param f Opened file pointer to dump to.
+ @return void
+
+ This function prints out the contents of a dictionary, one element by
+ line, onto the provided file pointer. It is OK to specify @c stderr
+ or @c stdout as output files. This function is meant for debugging
+ purposes mostly.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_dump(const dictionary * d, FILE * f)
+{
+ int i ;
+
+ if (d==NULL || f==NULL) return ;
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]==NULL)
+ continue ;
+ if (d->val[i]!=NULL) {
+ fprintf(f, "[%s]=[%s]\n", d->key[i], d->val[i]);
+ } else {
+ fprintf(f, "[%s]=UNDEF\n", d->key[i]);
+ }
+ }
+ return ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Save a dictionary to a loadable ini file
+ @param d Dictionary to dump
+ @param f Opened file pointer to dump to
+ @return void
+
+ This function dumps a given dictionary into a loadable ini file.
+ It is Ok to specify @c stderr or @c stdout as output files.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_dump_ini(const dictionary * d, FILE * f)
+{
+ int i ;
+ int nsec ;
+ const char * secname ;
+
+ if (d==NULL || f==NULL) return ;
+
+ nsec = iniparser_getnsec(d);
+ if (nsec<1) {
+ /* No section in file: dump all keys as they are */
+ for (i=0 ; i<d->size ; i++) {
+ if (d->key[i]==NULL)
+ continue ;
+ fprintf(f, "%s = %s\n", d->key[i], d->val[i]);
+ }
+ return ;
+ }
+ for (i=0 ; i<nsec ; i++) {
+ secname = iniparser_getsecname(d, i) ;
+ iniparser_dumpsection_ini(d, secname, f);
+ }
+ fprintf(f, "\n");
+ return ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Save a dictionary section to a loadable ini file
+ @param d Dictionary to dump
+ @param s Section name of dictionary to dump
+ @param f Opened file pointer to dump to
+ @return void
+
+ This function dumps a given section of a given dictionary into a loadable ini
+ file. It is Ok to specify @c stderr or @c stdout as output files.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f)
+{
+ size_t j, len;
+
+ if (d == NULL || f == NULL)
+ return;
+ if (!iniparser_find_entry(d, s))
+ return;
+
+ fprintf(f, "\n[%s]\n", s);
+
+ len = strlen(s) + 1;
+
+ strlwc(s, d->user_data, len);
+ d->user_data[len - 1] = ':';
+
+ for (j = 0 ; j < (size_t) d->size ; j++) {
+ if (d->key[j]==NULL)
+ continue;
+ if (!strncmp(d->key[j], d->user_data, len)) {
+ fprintf(f,
+ "%-30s = %s\n",
+ d->key[j]+len,
+ d->val[j] ? d->val[j] : "");
+ }
+ }
+
+ fprintf(f, "\n");
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the number of keys in a section of a dictionary.
+ @param d Dictionary to examine
+ @param s Section name of dictionary to examine
+ @return Number of keys in section
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getsecnkeys(const dictionary * d, const char * s)
+{
+ size_t len, nkeys;
+ size_t j;
+
+ nkeys = 0;
+
+ if (d == NULL)
+ return nkeys;
+ if (! iniparser_find_entry(d, s))
+ return nkeys;
+
+ len = strlen(s) + 1;
+ if (len + 1 > d->user_data_len)
+ return nkeys;
+
+ strlwc(s, d->user_data, len);
+ d->user_data[len - 1] = ':';
+
+ for (j = 0 ; j < (size_t) d->size; j++) {
+ if (d->key[j] == NULL)
+ continue;
+ if (!strncmp(d->key[j], d->user_data, len))
+ nkeys++;
+ }
+
+ return nkeys;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the number of keys in a section of a dictionary.
+ @param d Dictionary to examine
+ @param s Section name of dictionary to examine
+ @param keys Already allocated array to store the keys in
+ @return The pointer passed as `keys` argument or NULL in case of error
+
+ This function queries a dictionary and finds all keys in a given section.
+ The keys argument should be an array of pointers which size has been
+ determined by calling `iniparser_getsecnkeys` function prior to this one.
+
+ Each pointer in the returned char pointer-to-pointer is pointing to
+ a string allocated in the dictionary; do not free or modify them.
+ */
+/*--------------------------------------------------------------------------*/
+const char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys)
+{
+ size_t i, j, len;
+
+ if (d == NULL || keys == NULL)
+ return NULL;
+ if (! iniparser_find_entry(d, s))
+ return NULL;
+
+ len = strlen(s) + 1;
+ strlwc(s, d->user_data, len);
+ d->user_data[len - 1] = ':';
+
+ i = 0;
+
+ for (j = 0; j < (size_t) d->size; j++) {
+ if (d->key[j]==NULL)
+ continue ;
+ if (!strncmp(d->key[j], d->user_data, len)) {
+ keys[i] = d->key[j];
+ i++;
+ }
+ }
+
+ return keys;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param def Default value to return if key not found.
+ @return pointer to statically allocated character string
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the pointer passed as 'def' is returned.
+ The returned char pointer is pointing to a string allocated in
+ the dictionary, do not free or modify it.
+ */
+/*--------------------------------------------------------------------------*/
+const char * iniparser_getstring(const dictionary * d, const char * key,
+ const char * def)
+{
+ const char * sval;
+ size_t len = strlen(key) + 1;
+
+ if (d==NULL || key==NULL)
+ return def;
+
+ if (len > d->user_data_len)
+ return def;
+
+ strlwc(key, d->user_data, len);
+ sval = dictionary_get(d, d->user_data, def);
+ return sval ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to an long int
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return long integer
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+
+ Supported values for integers include the usual C notation
+ so decimal, octal (starting with 0) and hexadecimal (starting with 0x)
+ are supported. Examples:
+
+ "42" -> 42
+ "042" -> 34 (octal -> decimal)
+ "0x42" -> 66 (hexa -> decimal)
+
+ Warning: the conversion may overflow in various ways. Conversion is
+ totally outsourced to strtol(), see the associated man page for overflow
+ handling.
+
+ Credits: Thanks to A. Becker for suggesting strtol()
+ */
+/*--------------------------------------------------------------------------*/
+long int iniparser_getlongint(const dictionary * d, const char * key, long int notfound)
+{
+ const char * str ;
+
+ str = iniparser_getstring(d, key, INI_INVALID_KEY);
+ if (str==INI_INVALID_KEY) return notfound ;
+ return strtol(str, NULL, 0);
+}
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to an int
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return integer
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+
+ Supported values for integers include the usual C notation
+ so decimal, octal (starting with 0) and hexadecimal (starting with 0x)
+ are supported. Examples:
+
+ "42" -> 42
+ "042" -> 34 (octal -> decimal)
+ "0x42" -> 66 (hexa -> decimal)
+
+ Warning: the conversion may overflow in various ways. Conversion is
+ totally outsourced to strtol(), see the associated man page for overflow
+ handling.
+
+ Credits: Thanks to A. Becker for suggesting strtol()
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getint(const dictionary * d, const char * key, int notfound)
+{
+ return (int)iniparser_getlongint(d, key, notfound);
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to a double
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return double
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+ */
+/*--------------------------------------------------------------------------*/
+double iniparser_getdouble(const dictionary * d, const char * key, double notfound)
+{
+ const char * str ;
+
+ str = iniparser_getstring(d, key, INI_INVALID_KEY);
+ if (str==INI_INVALID_KEY) return notfound ;
+ return atof(str);
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to a boolean
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return integer
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+
+ A true boolean is found if one of the following is matched:
+
+ - A string starting with 'y'
+ - A string starting with 'Y'
+ - A string starting with 't'
+ - A string starting with 'T'
+ - A string starting with '1'
+
+ A false boolean is found if one of the following is matched:
+
+ - A string starting with 'n'
+ - A string starting with 'N'
+ - A string starting with 'f'
+ - A string starting with 'F'
+ - A string starting with '0'
+
+ The notfound value returned if no boolean is identified, does not
+ necessarily have to be 0 or 1.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getboolean(const dictionary * d, const char * key, int notfound)
+{
+ int ret ;
+ const char * c ;
+
+ c = iniparser_getstring(d, key, INI_INVALID_KEY);
+ if (c==INI_INVALID_KEY) return notfound ;
+ if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') {
+ ret = 1 ;
+ } else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') {
+ ret = 0 ;
+ } else {
+ ret = notfound ;
+ }
+ return ret;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Finds out if a given entry exists in a dictionary
+ @param ini Dictionary to search
+ @param entry Name of the entry to look for
+ @return integer 1 if entry exists, 0 otherwise
+
+ Finds out if a given entry exists in the dictionary. Since sections
+ are stored as keys with NULL associated values, this is the only way
+ of querying for the presence of sections in a dictionary.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_find_entry(const dictionary * ini, const char * entry)
+{
+ int found=0 ;
+ if (iniparser_getstring(ini, entry, INI_INVALID_KEY)!=INI_INVALID_KEY) {
+ found = 1 ;
+ }
+ return found ;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Set an entry in a dictionary.
+ @param ini Dictionary to modify.
+ @param entry Entry to modify (entry name)
+ @param val New value to associate to the entry.
+ @return int 0 if Ok, -1 otherwise.
+
+ If the given entry can be found in the dictionary, it is modified to
+ contain the provided value. If it cannot be found, the entry is created.
+ It is Ok to set val to NULL.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_set(dictionary * ini, const char * entry, const char * val)
+{
+ size_t len = strlen(entry) + 1;
+ int result;
+
+ if (prepare_user_data_buf(ini, len))
+ return -1;
+
+ result = dictionary_set(ini, strlwc(entry, ini->user_data, len), val);
+
+ return result;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Delete an entry in a dictionary
+ @param ini Dictionary to modify
+ @param entry Entry to delete (entry name)
+ @return void
+
+ If the given entry can be found, it is deleted from the dictionary.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_unset(dictionary * ini, const char * entry)
+{
+ size_t len = strlen(entry) + 1;
+ if (len <= ini->user_data_len)
+ dictionary_unset(ini, strlwc(entry, ini->user_data, len));
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Load a single line from an INI file
+ @param input_line Input line, may be concatenated multi-line input
+ @param section Output place to store section
+ @param key Output place to store key
+ @param value Output place to store value
+ @return line_status value
+ */
+/*--------------------------------------------------------------------------*/
+static line_status iniparser_line(
+ char * input_line,
+ char ** section,
+ char ** key,
+ char ** value)
+{
+ char *line, *line_end, *substr, *substr_end, *tmp;
+
+ strstrip(input_line, input_line + strlen(input_line), &line, &line_end);
+
+ if (*line == ';' || *line == '#') {
+ /* Comment line */
+ return LINE_COMMENT;
+ }
+ if (line == line_end) {
+ return LINE_EMPTY;
+ }
+ if (line[0] == '[' && line_end[-1] == ']') {
+ /* Section name */
+ strstrip(line + 1, line_end - 1, &substr, &substr_end);
+ *substr_end = '\0';
+ *section = strlwc_in_place(substr);
+ return LINE_SECTION;
+ }
+
+ /* Key and value */
+ substr = line;
+ substr_end = substr;
+ while (*substr_end != '=') {
+ if (++substr_end == line_end)
+ break;
+ }
+ if (substr_end == line_end)
+ return LINE_ERROR;
+ tmp = substr_end;
+
+ /* Get key */
+ strstrip(substr, substr_end, &substr, &substr_end);
+ *substr_end = '\0';
+ *key = strlwc_in_place(substr);
+
+ /* Get value */
+ substr = tmp + 1;
+ substr_end = line_end;
+ strstrip(substr, substr_end, &substr, &substr_end);
+ *substr_end = '\0';
+
+ if ((substr[0] == '\'' && (tmp = strchr(substr + 1, '\''))) ||
+ (substr[0] == '"' && (tmp = strchr(substr + 1, '"')))) {
+ /* Handle quoted values */
+ substr++;
+ substr_end = tmp;
+ } else {
+ /* Handle comments */
+ for (tmp = substr; *tmp; tmp++) {
+ if (*tmp == ';' || *tmp == '#')
+ break;
+ }
+ if (*tmp)
+ strstrip(substr, tmp, &substr, &substr_end);
+ }
+
+ *substr_end = '\0';
+ *value = substr;
+
+ return LINE_VALUE;
+}
+
+static char empty_string[] = "";
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Parse an ini file and return an allocated dictionary object
+ @param ininame Name of the ini file to read.
+ @return Pointer to newly allocated dictionary
+
+ This is the parser for ini files. This function is called, providing
+ the name of the file to be read. It returns a dictionary object that
+ should not be accessed directly, but through accessor functions
+ instead.
+
+ The returned dictionary must be freed using iniparser_freedict().
+ */
+/*--------------------------------------------------------------------------*/
+dictionary * iniparser_load(const char * ininame)
+{
+ FILE * in = NULL;
+
+ char *read_buf = NULL;
+ size_t read_buf_len = 0;
+ ssize_t read_len;
+
+ char *line = NULL, *tmp;
+ size_t line_len = 0;
+ int append_to_line = 0;
+
+ char *section;
+ char *key;
+ char *val;
+
+ const char *current_section = empty_string;
+
+ int lineno = 0;
+ int errs = 0;
+ int sections = 0;
+
+ dictionary * dict;
+
+ if ((in=fopen(ininame, "r"))==NULL) {
+ iniparser_error_callback("iniparser: cannot open %s\n", ininame);
+ return NULL;
+ }
+
+ dict = dictionary_new(0) ;
+ if (!dict)
+ goto fail;
+
+ while (1) {
+ errno = 0;
+ read_len = _getline(&read_buf, &read_buf_len, in, fgetc_impl);
+ if (read_len < 1) {
+ if (errno)
+ goto fail;
+ break;
+ }
+ /* printf("read buf: %s", read_buf); */
+ if (read_buf[read_len - 1] == '\n')
+ read_buf[--read_len] = '\0';
+
+ lineno++;
+
+ if (append_to_line) {
+ if (read_len > 0) {
+ tmp = realloc(line, line_len + read_len + 1);
+ if (!tmp)
+ goto fail;
+ line = tmp;
+ memcpy(line + line_len, read_buf, read_len + 1);
+ line_len += read_len;
+ }
+ } else {
+ line = malloc(read_len + 1);
+ if (!line)
+ goto fail;
+ memcpy(line, read_buf, read_len + 1);
+ line_len = read_len;
+ }
+
+ /* Detect multi-line */
+ append_to_line = 0;
+ if (process_multiline) {
+ tmp = strrchr(line, '\\');
+ if (tmp && !strstrip(tmp + 1, line + line_len, NULL, NULL)) {
+ /* Multi-line value */
+ line_len = tmp - line;
+ line[line_len] = '\0';
+ append_to_line = 1;
+ continue;
+ }
+ }
+
+ switch (iniparser_line(line, &section, &key, &val)) {
+ case LINE_EMPTY:
+ case LINE_COMMENT:
+ break;
+
+ case LINE_SECTION:
+ if (prepare_user_data_buf(dict, strlen(current_section) + 2))
+ goto fail;
+
+ if (dictionary_set(dict, section, NULL) < 0)
+ goto fail;
+ current_section = iniparser_getsecname(dict, sections++);
+ break;
+
+ case LINE_VALUE:
+ if (prepare_user_data_buf
+ (dict, strlen(current_section) + strlen(key) + 2))
+ goto fail;
+
+ sprintf(dict->user_data, "%s:%s", current_section, key);
+
+ if (dictionary_set(dict, dict->user_data, val))
+ goto fail;
+ break;
+
+ case LINE_ERROR:
+ iniparser_error_callback(
+ "iniparser: syntax error in %s (%d):\n-> %s\n",
+ ininame,
+ lineno,
+ line);
+ errs++;
+ break;
+
+ default:
+ break;
+ }
+
+ free(line);
+ }
+ if (errs) {
+ dictionary_del(dict);
+ dict = NULL;
+ }
+ free(read_buf);
+ fclose(in);
+ return dict;
+
+fail:
+ if (in)
+ fclose(in);
+ dictionary_del(dict);
+ free(read_buf);
+ free(line);
+ iniparser_error_callback("iniparser: memory allocation failure\n");
+ return NULL;
+}
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Free all memory associated to an ini dictionary
+ @param d Dictionary to free
+ @return void
+
+ Free all memory associated to an ini dictionary.
+ It is mandatory to call this function before the dictionary object
+ gets out of the current context.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_freedict(dictionary * d)
+{
+ dictionary_del(d);
+}
diff --git a/iniparser-4.1/src/iniparser.h b/iniparser-4.1/src/iniparser.h
new file mode 100644
index 0000000..e00530d
--- /dev/null
+++ b/iniparser-4.1/src/iniparser.h
@@ -0,0 +1,386 @@
+
+/*-------------------------------------------------------------------------*/
+/**
+ @file iniparser.h
+ @author N. Devillard
+ @brief Parser for ini files.
+*/
+/*--------------------------------------------------------------------------*/
+
+#ifndef _INIPARSER_H_
+#define _INIPARSER_H_
+
+/*---------------------------------------------------------------------------
+ Includes
+ ---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * The following #include is necessary on many Unixes but not Linux.
+ * It is not needed for Windows platforms.
+ * Uncomment it if needed.
+ */
+/* #include <unistd.h> */
+
+#include "dictionary.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Configure a function to receive the error messages.
+ @param errback Function to call.
+
+ By default, the error will be printed on stderr. If a null pointer is passed
+ as errback the error callback will be switched back to default.
+ */
+/*--------------------------------------------------------------------------*/
+
+void iniparser_set_error_callback(int (*errback)(const char *, ...));
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Configure whether to parse multiline values.
+ @param process_multiline Boolean (0 or 1) value.
+
+ By default, multiline values will be parsed. If someone puts into their .ini
+ file 2 lines like those:
+
+ outputdir=c:\temp\
+ save_subject=1
+
+ then we're screwed. All will be treated as if it was on one line.
+ This function makes it possible to disable this linebreak feature.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_set_process_multiline(int process);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Configure a function to read file.
+ @param impl Function to call.
+
+ By default, fgetc() will be used for reading files. If a null pointer is passed
+ as impl the reading callback will be switched back to default.
+ */
+/*--------------------------------------------------------------------------*/
+ void iniparser_set_fgetc_impl(int (*impl)(FILE*));
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get number of sections in a dictionary
+ @param d Dictionary to examine
+ @return int Number of sections found in dictionary
+
+ This function returns the number of sections found in a dictionary.
+ The test to recognize sections is done on the string stored in the
+ dictionary: a section name is given as "section" whereas a key is
+ stored as "section:key", thus the test looks for entries that do not
+ contain a colon.
+
+ This clearly fails in the case a section name contains a colon, but
+ this should simply be avoided.
+
+ This function returns -1 in case of error.
+ */
+/*--------------------------------------------------------------------------*/
+
+int iniparser_getnsec(const dictionary * d);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get name for section n in a dictionary.
+ @param d Dictionary to examine
+ @param n Section number (from 0 to nsec-1).
+ @return Pointer to char string
+
+ This function locates the n-th section in a dictionary and returns
+ its name as a pointer to a string statically allocated inside the
+ dictionary. Do not free or modify the returned string!
+
+ This function returns NULL in case of error.
+ */
+/*--------------------------------------------------------------------------*/
+
+const char * iniparser_getsecname(const dictionary * d, int n);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Save a dictionary to a loadable ini file
+ @param d Dictionary to dump
+ @param f Opened file pointer to dump to
+ @return void
+
+ This function dumps a given dictionary into a loadable ini file.
+ It is Ok to specify @c stderr or @c stdout as output files.
+ */
+/*--------------------------------------------------------------------------*/
+
+void iniparser_dump_ini(const dictionary * d, FILE * f);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Save a dictionary section to a loadable ini file
+ @param d Dictionary to dump
+ @param s Section name of dictionary to dump
+ @param f Opened file pointer to dump to
+ @return void
+
+ This function dumps a given section of a given dictionary into a loadable ini
+ file. It is Ok to specify @c stderr or @c stdout as output files.
+ */
+/*--------------------------------------------------------------------------*/
+
+void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Dump a dictionary to an opened file pointer.
+ @param d Dictionary to dump.
+ @param f Opened file pointer to dump to.
+ @return void
+
+ This function prints out the contents of a dictionary, one element by
+ line, onto the provided file pointer. It is OK to specify @c stderr
+ or @c stdout as output files. This function is meant for debugging
+ purposes mostly.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_dump(const dictionary * d, FILE * f);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the number of keys in a section of a dictionary.
+ @param d Dictionary to examine
+ @param s Section name of dictionary to examine
+ @return Number of keys in section
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getsecnkeys(const dictionary * d, const char * s);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the number of keys in a section of a dictionary.
+ @param d Dictionary to examine
+ @param s Section name of dictionary to examine
+ @param keys Already allocated array to store the keys in
+ @return The pointer passed as `keys` argument or NULL in case of error
+
+ This function queries a dictionary and finds all keys in a given section.
+ The keys argument should be an array of pointers which size has been
+ determined by calling `iniparser_getsecnkeys` function prior to this one.
+
+ Each pointer in the returned char pointer-to-pointer is pointing to
+ a string allocated in the dictionary; do not free or modify them.
+ */
+/*--------------------------------------------------------------------------*/
+const char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param def Default value to return if key not found.
+ @return pointer to statically allocated character string
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the pointer passed as 'def' is returned.
+ The returned char pointer is pointing to a string allocated in
+ the dictionary, do not free or modify it.
+ */
+/*--------------------------------------------------------------------------*/
+const char * iniparser_getstring(const dictionary * d, const char * key, const char * def);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to an int
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return integer
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+
+ Supported values for integers include the usual C notation
+ so decimal, octal (starting with 0) and hexadecimal (starting with 0x)
+ are supported. Examples:
+
+ - "42" -> 42
+ - "042" -> 34 (octal -> decimal)
+ - "0x42" -> 66 (hexa -> decimal)
+
+ Warning: the conversion may overflow in various ways. Conversion is
+ totally outsourced to strtol(), see the associated man page for overflow
+ handling.
+
+ Credits: Thanks to A. Becker for suggesting strtol()
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getint(const dictionary * d, const char * key, int notfound);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to an long int
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return integer
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+
+ Supported values for integers include the usual C notation
+ so decimal, octal (starting with 0) and hexadecimal (starting with 0x)
+ are supported. Examples:
+
+ - "42" -> 42
+ - "042" -> 34 (octal -> decimal)
+ - "0x42" -> 66 (hexa -> decimal)
+
+ Warning: the conversion may overflow in various ways. Conversion is
+ totally outsourced to strtol(), see the associated man page for overflow
+ handling.
+ */
+/*--------------------------------------------------------------------------*/
+long int iniparser_getlongint(const dictionary * d, const char * key, long int notfound);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to a double
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return double
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+ */
+/*--------------------------------------------------------------------------*/
+double iniparser_getdouble(const dictionary * d, const char * key, double notfound);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Get the string associated to a key, convert to a boolean
+ @param d Dictionary to search
+ @param key Key string to look for
+ @param notfound Value to return in case of error
+ @return integer
+
+ This function queries a dictionary for a key. A key as read from an
+ ini file is given as "section:key". If the key cannot be found,
+ the notfound value is returned.
+
+ A true boolean is found if one of the following is matched:
+
+ - A string starting with 'y'
+ - A string starting with 'Y'
+ - A string starting with 't'
+ - A string starting with 'T'
+ - A string starting with '1'
+
+ A false boolean is found if one of the following is matched:
+
+ - A string starting with 'n'
+ - A string starting with 'N'
+ - A string starting with 'f'
+ - A string starting with 'F'
+ - A string starting with '0'
+
+ The notfound value returned if no boolean is identified, does not
+ necessarily have to be 0 or 1.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_getboolean(const dictionary * d, const char * key, int notfound);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Set an entry in a dictionary.
+ @param ini Dictionary to modify.
+ @param entry Entry to modify (entry name)
+ @param val New value to associate to the entry.
+ @return int 0 if Ok, -1 otherwise.
+
+ If the given entry can be found in the dictionary, it is modified to
+ contain the provided value. If it cannot be found, the entry is created.
+ It is Ok to set val to NULL.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_set(dictionary * ini, const char * entry, const char * val);
+
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Delete an entry in a dictionary
+ @param ini Dictionary to modify
+ @param entry Entry to delete (entry name)
+ @return void
+
+ If the given entry can be found, it is deleted from the dictionary.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_unset(dictionary * ini, const char * entry);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Finds out if a given entry exists in a dictionary
+ @param ini Dictionary to search
+ @param entry Name of the entry to look for
+ @return integer 1 if entry exists, 0 otherwise
+
+ Finds out if a given entry exists in the dictionary. Since sections
+ are stored as keys with NULL associated values, this is the only way
+ of querying for the presence of sections in a dictionary.
+ */
+/*--------------------------------------------------------------------------*/
+int iniparser_find_entry(const dictionary * ini, const char * entry) ;
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Parse an ini file and return an allocated dictionary object
+ @param ininame Name of the ini file to read.
+ @return Pointer to newly allocated dictionary
+
+ This is the parser for ini files. This function is called, providing
+ the name of the file to be read. It returns a dictionary object that
+ should not be accessed directly, but through accessor functions
+ instead.
+
+ The returned dictionary must be freed using iniparser_freedict().
+ */
+/*--------------------------------------------------------------------------*/
+dictionary * iniparser_load(const char * ininame);
+
+/*-------------------------------------------------------------------------*/
+/**
+ @brief Free all memory associated to an ini dictionary
+ @param d Dictionary to free
+ @return void
+
+ Free all memory associated to an ini dictionary.
+ It is mandatory to call this function before the dictionary object
+ gets out of the current context.
+ */
+/*--------------------------------------------------------------------------*/
+void iniparser_freedict(dictionary * d);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/iniparser-4.1/test/CuTest.c b/iniparser-4.1/test/CuTest.c
new file mode 100644
index 0000000..463f170
--- /dev/null
+++ b/iniparser-4.1/test/CuTest.c
@@ -0,0 +1,348 @@
+#include <assert.h>
+#include <setjmp.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "CuTest.h"
+
+/*-------------------------------------------------------------------------*
+ * CuStr
+ *-------------------------------------------------------------------------*/
+
+char* CuStrAlloc(int size)
+{
+ char* newStr = (char*) malloc( sizeof(char) * (size) );
+ return newStr;
+}
+
+char* CuStrCopy(const char* old)
+{
+ int len = strlen(old);
+ char* newStr = CuStrAlloc(len + 1);
+ strcpy(newStr, old);
+ return newStr;
+}
+
+/*-------------------------------------------------------------------------*
+ * CuString
+ *-------------------------------------------------------------------------*/
+
+void CuStringInit(CuString* str)
+{
+ str->length = 0;
+ str->size = STRING_MAX;
+ str->buffer = (char*) malloc(sizeof(char) * str->size);
+ str->buffer[0] = '\0';
+}
+
+CuString* CuStringNew(void)
+{
+ CuString* str = (CuString*) malloc(sizeof(CuString));
+ str->length = 0;
+ str->size = STRING_MAX;
+ str->buffer = (char*) malloc(sizeof(char) * str->size);
+ str->buffer[0] = '\0';
+ return str;
+}
+
+void CuStringDelete(CuString *str)
+{
+ if (!str) return;
+ free(str->buffer);
+ free(str);
+}
+
+void CuStringResize(CuString* str, int newSize)
+{
+ str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize);
+ str->size = newSize;
+}
+
+void CuStringAppend(CuString* str, const char* text)
+{
+ int length;
+
+ if (text == NULL) {
+ text = "NULL";
+ }
+
+ length = strlen(text);
+ if (str->length + length + 1 >= str->size)
+ CuStringResize(str, str->length + length + 1 + STRING_INC);
+ str->length += length;
+ strcat(str->buffer, text);
+}
+
+void CuStringAppendChar(CuString* str, char ch)
+{
+ char text[2];
+ text[0] = ch;
+ text[1] = '\0';
+ CuStringAppend(str, text);
+}
+
+void CuStringAppendFormat(CuString* str, const char* format, ...)
+{
+ va_list argp;
+ char buf[HUGE_STRING_LEN];
+ va_start(argp, format);
+ vsprintf(buf, format, argp);
+ va_end(argp);
+ CuStringAppend(str, buf);
+}
+
+void CuStringInsert(CuString* str, const char* text, int pos)
+{
+ int length = strlen(text);
+ if (pos > str->length)
+ pos = str->length;
+ if (str->length + length + 1 >= str->size)
+ CuStringResize(str, str->length + length + 1 + STRING_INC);
+ memmove(str->buffer + pos + length, str->buffer + pos, (str->length - pos) + 1);
+ str->length += length;
+ memcpy(str->buffer + pos, text, length);
+}
+
+/*-------------------------------------------------------------------------*
+ * CuTest
+ *-------------------------------------------------------------------------*/
+
+void CuTestInit(CuTest* t, const char* name, TestFunction function)
+{
+ t->name = CuStrCopy(name);
+ t->failed = 0;
+ t->ran = 0;
+ t->message = NULL;
+ t->function = function;
+ t->jumpBuf = NULL;
+}
+
+CuTest* CuTestNew(const char* name, TestFunction function)
+{
+ CuTest* tc = CU_ALLOC(CuTest);
+ CuTestInit(tc, name, function);
+ return tc;
+}
+
+void CuTestDelete(CuTest *t)
+{
+ if (!t) return;
+ free(t->name);
+ free(t);
+}
+
+void CuTestRun(CuTest* tc)
+{
+ jmp_buf buf;
+ tc->jumpBuf = &buf;
+ if (setjmp(buf) == 0)
+ {
+ tc->ran = 1;
+ (tc->function)(tc);
+ }
+ tc->jumpBuf = 0;
+}
+
+static void CuFailInternal(CuTest* tc, const char* file, int line, CuString* string)
+{
+ char buf[HUGE_STRING_LEN];
+
+ sprintf(buf, "%s:%d: ", file, line);
+ CuStringInsert(string, buf, 0);
+
+ tc->failed = 1;
+ tc->message = string->buffer;
+ if (tc->jumpBuf != 0) longjmp(*(tc->jumpBuf), 0);
+}
+
+void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message)
+{
+ CuString string;
+
+ CuStringInit(&string);
+ if (message2 != NULL)
+ {
+ CuStringAppend(&string, message2);
+ CuStringAppend(&string, ": ");
+ }
+ CuStringAppend(&string, message);
+ CuFailInternal(tc, file, line, &string);
+}
+
+void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition)
+{
+ if (condition) return;
+ CuFail_Line(tc, file, line, NULL, message);
+}
+
+void CuAssertStrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
+ const char* expected, const char* actual)
+{
+ CuString string;
+ if ((expected == NULL && actual == NULL) ||
+ (expected != NULL && actual != NULL &&
+ strcmp(expected, actual) == 0))
+ {
+ return;
+ }
+
+ CuStringInit(&string);
+ if (message != NULL)
+ {
+ CuStringAppend(&string, message);
+ CuStringAppend(&string, ": ");
+ }
+ CuStringAppend(&string, "expected <");
+ CuStringAppend(&string, expected);
+ CuStringAppend(&string, "> but was <");
+ CuStringAppend(&string, actual);
+ CuStringAppend(&string, ">");
+ CuFailInternal(tc, file, line, &string);
+}
+
+void CuAssertIntEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
+ int expected, int actual)
+{
+ char buf[STRING_MAX];
+ if (expected == actual) return;
+ sprintf(buf, "expected <%d> but was <%d>", expected, actual);
+ CuFail_Line(tc, file, line, message, buf);
+}
+
+void CuAssertLongIntEquals_LineMsg(CuTest *tc, const char *file, int line, const char *message,
+ long int expected, long int actual)
+{
+ char buf[STRING_MAX];
+ if (expected == actual) return;
+ sprintf(buf, "expected <%ld> but was <%ld>", expected, actual);
+ CuFail_Line(tc, file, line, message, buf);
+}
+
+void CuAssertDblEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
+ double expected, double actual, double delta)
+{
+ char buf[STRING_MAX];
+ if (fabs(expected - actual) <= delta) return;
+ sprintf(buf, "expected <%f> but was <%f>", expected, actual);
+
+ CuFail_Line(tc, file, line, message, buf);
+}
+
+void CuAssertPtrEquals_LineMsg(CuTest* tc, const char* file, int line, const char* message,
+ const void* expected, const void* actual)
+{
+ char buf[STRING_MAX];
+ if (expected == actual) return;
+ sprintf(buf, "expected pointer <0x%p> but was <0x%p>", expected, actual);
+ CuFail_Line(tc, file, line, message, buf);
+}
+
+
+/*-------------------------------------------------------------------------*
+ * CuSuite
+ *-------------------------------------------------------------------------*/
+
+void CuSuiteInit(CuSuite* testSuite)
+{
+ testSuite->count = 0;
+ testSuite->failCount = 0;
+ memset(testSuite->list, 0, sizeof(testSuite->list));
+}
+
+CuSuite* CuSuiteNew(void)
+{
+ CuSuite* testSuite = CU_ALLOC(CuSuite);
+ CuSuiteInit(testSuite);
+ return testSuite;
+}
+
+void CuSuiteDelete(CuSuite *testSuite)
+{
+ unsigned int n;
+ for (n=0; n < MAX_TEST_CASES; n++)
+ {
+ if (testSuite->list[n])
+ {
+ CuTestDelete(testSuite->list[n]);
+ }
+ }
+ free(testSuite);
+
+}
+
+void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase)
+{
+ assert(testSuite->count < MAX_TEST_CASES);
+ testSuite->list[testSuite->count] = testCase;
+ testSuite->count++;
+}
+
+void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2)
+{
+ int i;
+ for (i = 0 ; i < testSuite2->count ; ++i)
+ {
+ CuTest* testCase = testSuite2->list[i];
+ CuSuiteAdd(testSuite, testCase);
+ }
+}
+
+void CuSuiteRun(CuSuite* testSuite)
+{
+ int i;
+ for (i = 0 ; i < testSuite->count ; ++i)
+ {
+ CuTest* testCase = testSuite->list[i];
+ CuTestRun(testCase);
+ if (testCase->failed) { testSuite->failCount += 1; }
+ }
+}
+
+void CuSuiteSummary(CuSuite* testSuite, CuString* summary)
+{
+ int i;
+ for (i = 0 ; i < testSuite->count ; ++i)
+ {
+ CuTest* testCase = testSuite->list[i];
+ CuStringAppend(summary, testCase->failed ? "F" : ".");
+ }
+ CuStringAppend(summary, "\n\n");
+}
+
+void CuSuiteDetails(CuSuite* testSuite, CuString* details)
+{
+ int i;
+ int failCount = 0;
+
+ if (testSuite->failCount == 0)
+ {
+ int passCount = testSuite->count - testSuite->failCount;
+ const char* testWord = passCount == 1 ? "test" : "tests";
+ CuStringAppendFormat(details, "OK (%d %s)\n", passCount, testWord);
+ }
+ else
+ {
+ if (testSuite->failCount == 1)
+ CuStringAppend(details, "There was 1 failure:\n");
+ else
+ CuStringAppendFormat(details, "There were %d failures:\n", testSuite->failCount);
+
+ for (i = 0 ; i < testSuite->count ; ++i)
+ {
+ CuTest* testCase = testSuite->list[i];
+ if (testCase->failed)
+ {
+ failCount++;
+ CuStringAppendFormat(details, "%d) %s: %s\n",
+ failCount, testCase->name, testCase->message);
+ }
+ }
+ CuStringAppend(details, "\n!!!FAILURES!!!\n");
+
+ CuStringAppendFormat(details, "Runs: %d ", testSuite->count);
+ CuStringAppendFormat(details, "Passes: %d ", testSuite->count - testSuite->failCount);
+ CuStringAppendFormat(details, "Fails: %d\n", testSuite->failCount);
+ }
+}
diff --git a/iniparser-4.1/test/CuTest.h b/iniparser-4.1/test/CuTest.h
new file mode 100644
index 0000000..0f58592
--- /dev/null
+++ b/iniparser-4.1/test/CuTest.h
@@ -0,0 +1,121 @@
+#ifndef CU_TEST_H
+#define CU_TEST_H
+
+#include <setjmp.h>
+#include <stdarg.h>
+
+#define CUTEST_VERSION "CuTest 1.5"
+
+/* CuString */
+
+char* CuStrAlloc(int size);
+char* CuStrCopy(const char* old);
+
+#define CU_ALLOC(TYPE) ((TYPE*) malloc(sizeof(TYPE)))
+
+#define HUGE_STRING_LEN 8192
+#define STRING_MAX 256
+#define STRING_INC 256
+
+typedef struct
+{
+ int length;
+ int size;
+ char* buffer;
+} CuString;
+
+void CuStringInit(CuString* str);
+CuString* CuStringNew(void);
+void CuStringRead(CuString* str, const char* path);
+void CuStringAppend(CuString* str, const char* text);
+void CuStringAppendChar(CuString* str, char ch);
+void CuStringAppendFormat(CuString* str, const char* format, ...);
+void CuStringInsert(CuString* str, const char* text, int pos);
+void CuStringResize(CuString* str, int newSize);
+void CuStringDelete(CuString* str);
+
+/* CuTest */
+
+typedef struct CuTest CuTest;
+
+typedef void (*TestFunction)(CuTest *);
+
+struct CuTest
+{
+ char* name;
+ TestFunction function;
+ int failed;
+ int ran;
+ const char* message;
+ jmp_buf *jumpBuf;
+};
+
+void CuTestInit(CuTest* t, const char* name, TestFunction function);
+CuTest* CuTestNew(const char* name, TestFunction function);
+void CuTestRun(CuTest* tc);
+void CuTestDelete(CuTest *t);
+
+/* Internal versions of assert functions -- use the public versions */
+void CuFail_Line(CuTest* tc, const char* file, int line, const char* message2, const char* message);
+void CuAssert_Line(CuTest* tc, const char* file, int line, const char* message, int condition);
+void CuAssertStrEquals_LineMsg(CuTest* tc,
+ const char* file, int line, const char* message,
+ const char* expected, const char* actual);
+void CuAssertIntEquals_LineMsg(CuTest* tc,
+ const char* file, int line, const char* message,
+ int expected, int actual);
+void CuAssertLongIntEquals_LineMsg(CuTest *tc,
+ const char *file, int line, const char *message,
+ long int expected, long int actual);
+void CuAssertDblEquals_LineMsg(CuTest* tc,
+ const char* file, int line, const char* message,
+ double expected, double actual, double delta);
+void CuAssertPtrEquals_LineMsg(CuTest* tc,
+ const char* file, int line, const char* message,
+ const void* expected, const void* actual);
+
+/* public assert functions */
+
+#define CuFail(tc, ms) CuFail_Line( (tc), __FILE__, __LINE__, NULL, (ms))
+#define CuAssert(tc, ms, cond) CuAssert_Line((tc), __FILE__, __LINE__, (ms), (cond))
+#define CuAssertTrue(tc, cond) CuAssert_Line((tc), __FILE__, __LINE__, "assert failed", (cond))
+
+#define CuAssertStrEquals(tc,ex,ac) CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
+#define CuAssertStrEquals_Msg(tc,ms,ex,ac) CuAssertStrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
+#define CuAssertIntEquals(tc,ex,ac) CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
+#define CuAssertIntEquals_Msg(tc,ms,ex,ac) CuAssertIntEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
+#define CuAssertLongIntEquals(tc,ex,ac) CuAssertLongIntEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
+#define CuAssertLongIntEquals_Msg(tc,ms,ex,ac) CuAssertLongIntEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
+#define CuAssertDblEquals(tc,ex,ac,dl) CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac),(dl))
+#define CuAssertDblEquals_Msg(tc,ms,ex,ac,dl) CuAssertDblEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac),(dl))
+#define CuAssertPtrEquals(tc,ex,ac) CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,NULL,(ex),(ac))
+#define CuAssertPtrEquals_Msg(tc,ms,ex,ac) CuAssertPtrEquals_LineMsg((tc),__FILE__,__LINE__,(ms),(ex),(ac))
+
+#define CuAssertPtrNotNull(tc,p) CuAssert_Line((tc),__FILE__,__LINE__,"null pointer unexpected",(p != NULL))
+#define CuAssertPtrNotNullMsg(tc,msg,p) CuAssert_Line((tc),__FILE__,__LINE__,(msg),(p != NULL))
+
+/* CuSuite */
+
+#define MAX_TEST_CASES 1024
+
+#define SUITE_ADD_TEST(SUITE,TEST) CuSuiteAdd(SUITE, CuTestNew(#TEST, TEST))
+
+typedef struct
+{
+ int count;
+ CuTest* list[MAX_TEST_CASES];
+ int failCount;
+
+} CuSuite;
+
+
+void CuSuiteInit(CuSuite* testSuite);
+CuSuite* CuSuiteNew(void);
+void CuSuiteDelete(CuSuite *testSuite);
+void CuSuiteAdd(CuSuite* testSuite, CuTest *testCase);
+void CuSuiteAddSuite(CuSuite* testSuite, CuSuite* testSuite2);
+void CuSuiteRun(CuSuite* testSuite);
+void CuSuiteSummary(CuSuite* testSuite, CuString* summary);
+void CuSuiteDetails(CuSuite* testSuite, CuString* details);
+
+#endif /* CU_TEST_H */
diff --git a/iniparser-4.1/test/CuTest_license.txt b/iniparser-4.1/test/CuTest_license.txt
new file mode 100644
index 0000000..5f053ba
--- /dev/null
+++ b/iniparser-4.1/test/CuTest_license.txt
@@ -0,0 +1,38 @@
+NOTE
+
+The license is based on the zlib/libpng license. For more details see
+http://www.opensource.org/licenses/zlib-license.html. The intent of the
+license is to:
+
+- keep the license as simple as possible
+- encourage the use of CuTest in both free and commercial applications
+ and libraries
+- keep the source code together
+- give credit to the CuTest contributors for their work
+
+If you ship CuTest in source form with your source distribution, the
+following license document must be included with it in unaltered form.
+If you find CuTest useful we would like to hear about it.
+
+LICENSE
+
+Copyright (c) 2003 Asim Jalis
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+claim that you wrote the original software. If you use this software in
+a product, an acknowledgment in the product documentation would be
+appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and must not
+be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
diff --git a/iniparser-4.1/test/Makefile b/iniparser-4.1/test/Makefile
new file mode 100644
index 0000000..15a8d26
--- /dev/null
+++ b/iniparser-4.1/test/Makefile
@@ -0,0 +1,35 @@
+CC ?= gcc
+
+ifndef V
+QUIET_CC = @echo "CC $@";
+QUIET_MAKE_TESTS = @echo "GN Alltests.c";
+endif
+
+DEPS = $(shell ls ../src/*.[ch])
+
+SRC = $(shell ls *.c | sed 's/AllTests.c//')
+OBJ = $(SRC:.c=.o)
+
+INCLUDE = -I../src
+CFLAGS += -pipe -ansi -pedantic -Wall -Wextra -g
+LDFLAGS +=
+
+all: check
+
+check: testrun
+ @./testrun
+
+testrun: AllTests.o $(OBJ)
+ $(QUIET_CC)$(CC) -o $@ AllTests.o $(OBJ) $(LDFLAGS)
+
+AllTests.o: $(OBJ)
+ $(QUIET_MAKE_TESTS)./make-tests.sh > AllTests.c
+ $(QUIET_CC)$(CC) -c -o AllTests.o AllTests.c $(CFLAGS) $(INCLUDE)
+
+%.o: %.c $(DEPS)
+ $(QUIET_CC)$(CC) -c -o $@ $< $(CFLAGS) $(INCLUDE)
+
+clean veryclean:
+ rm -rf AllTests.c
+ rm -rf $(OBJ) AllTests.o
+ rm -rf testrun
diff --git a/iniparser-4.1/test/make-tests.sh b/iniparser-4.1/test/make-tests.sh
new file mode 100755
index 0000000..f2a3f2a
--- /dev/null
+++ b/iniparser-4.1/test/make-tests.sh
@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+
+# Auto generate single AllTests file for CuTest.
+# Searches through all *.c files in the current directory.
+# Prints to stdout.
+# Author: Asim Jalis
+# Date: 01/08/2003
+
+if test $# -eq 0 ; then FILES=*.c ; else FILES=$* ; fi
+
+echo '
+
+/* This is auto-generated code. Edit at your own peril. */
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "CuTest.h"
+
+'
+
+cat $FILES | grep '^void Test' |
+ sed -e 's/(.*$//' \
+ -e 's/$/(CuTest*);/' \
+ -e 's/^/extern /'
+
+echo \
+'
+
+void RunAllTests(void)
+{
+ CuString *output = CuStringNew();
+ CuSuite* suite = CuSuiteNew();
+
+'
+cat $FILES | grep '^void Test' |
+ sed -e 's/^void //' \
+ -e 's/(.*$//' \
+ -e 's/^/ SUITE_ADD_TEST(suite, /' \
+ -e 's/$/);/'
+
+echo \
+'
+ CuSuiteRun(suite);
+ CuSuiteSummary(suite, output);
+ CuSuiteDetails(suite, output);
+ printf("%s\n", output->buffer);
+ CuStringDelete(output);
+ CuSuiteDelete(suite);
+}
+
+int main(void)
+{
+ RunAllTests();
+ return 0;
+}
+'
diff --git a/iniparser-4.1/test/ressources/bad_ini/ends_well.ini b/iniparser-4.1/test/ressources/bad_ini/ends_well.ini
new file mode 100644
index 0000000..3f920c7
--- /dev/null
+++ b/iniparser-4.1/test/ressources/bad_ini/ends_well.ini
@@ -0,0 +1,6 @@
+#
+# This dict contains an error but ends up with a correct entry
+#
+[section]
+error is here
+a = b
diff --git a/iniparser-4.1/test/ressources/bad_ini/twisted-errors.ini b/iniparser-4.1/test/ressources/bad_ini/twisted-errors.ini
new file mode 100644
index 0000000..4dc3bbe
--- /dev/null
+++ b/iniparser-4.1/test/ressources/bad_ini/twisted-errors.ini
@@ -0,0 +1,9 @@
+#
+# All of these should trigger syntax errors
+#
+[section]
+hello
+world
+hello \
+world
+a + b ;
diff --git a/iniparser-4.1/test/ressources/bad_ini/twisted-ofkey.ini b/iniparser-4.1/test/ressources/bad_ini/twisted-ofkey.ini
new file mode 100644
index 0000000..4f2e72e
--- /dev/null
+++ b/iniparser-4.1/test/ressources/bad_ini/twisted-ofkey.ini
@@ -0,0 +1,66 @@
+# Stress testing buffers for overflows
+[long]
+# Shitload key size
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1
+
diff --git a/iniparser-4.1/test/ressources/bad_ini/twisted-ofval.ini b/iniparser-4.1/test/ressources/bad_ini/twisted-ofval.ini
new file mode 100644
index 0000000..2a3cedf
--- /dev/null
+++ b/iniparser-4.1/test/ressources/bad_ini/twisted-ofval.ini
@@ -0,0 +1,56 @@
+# Shitload data size
+[long]
+a=\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\
+1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+
diff --git a/iniparser-4.1/test/ressources/good_ini/empty.ini b/iniparser-4.1/test/ressources/good_ini/empty.ini
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/iniparser-4.1/test/ressources/good_ini/empty.ini
diff --git a/iniparser-4.1/test/ressources/good_ini/spaced.ini b/iniparser-4.1/test/ressources/good_ini/spaced.ini
new file mode 100644
index 0000000..8e78e3b
--- /dev/null
+++ b/iniparser-4.1/test/ressources/good_ini/spaced.ini
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/iniparser-4.1/test/ressources/good_ini/spaced2.ini b/iniparser-4.1/test/ressources/good_ini/spaced2.ini
new file mode 100644
index 0000000..2acbd74
--- /dev/null
+++ b/iniparser-4.1/test/ressources/good_ini/spaced2.ini
@@ -0,0 +1,20 @@
+
+# spaced2.ini
+
+[blanks]
+
+
+
+
+
+
+
+
+
+
+
+a=1
+b=1;
+c=1; comment
+d=1# comment
+ \ No newline at end of file
diff --git a/iniparser-4.1/test/ressources/good_ini/twisted.ini b/iniparser-4.1/test/ressources/good_ini/twisted.ini
new file mode 100644
index 0000000..86e549f
--- /dev/null
+++ b/iniparser-4.1/test/ressources/good_ini/twisted.ini
@@ -0,0 +1,131 @@
+#
+# Twisted.ini
+# This file is meant for regression tests
+
+# Different blank settings around the equal sign
+[blanks]
+a=1
+b=1;
+c=1; comment
+d=1# comment
+
+e =1
+f =1;
+g =1; comment
+h =1# comment
+
+i= 1
+j= 1;
+k= 1; comment
+l= 1# comment
+
+m = 1
+n = 1;
+o = 1; comment
+p = 1# comment
+
+q=1 ;
+r=1 ; comment
+s=1 ;comment
+t=1 #comment
+
+# Empty values
+[empty]
+a = ''
+b = ""
+
+c = '' ;
+d = "" ;
+
+e = '' ; comment
+f = "" ; comment
+
+g =
+h = ;
+i = ; comment
+j = # comment
+
+k=
+l=;
+m=;comment
+n=#
+
+# Peculiar values
+[peculiar]
+a=';';
+b='#'#
+c=';';comment
+d='#'#comment
+e=\;
+f=\#
+g=\;comment
+h=\#comment
+i=;;
+j=##
+k=;;;;;;;;;;
+l=##########
+
+# Quotes
+[quotes]
+s1='
+s2=''
+s3='''
+s4=''''
+
+d1="
+d2=""
+d3="""
+d4=""""
+
+m1='"'
+m2="'"
+
+h1=hello'world
+h2='hello'world
+h3='hello'world'
+
+h4=hello"world
+h5="hello"world
+h6="hello"world"
+
+# Section names
+[a]
+[ b]
+[c ]
+[ d ]
+[ begin end ]
+[ open[ ]
+
+# Multi-line inputs
+[multi]
+a = begin\
+end
+b = begin \
+end
+c = begin \
+ end
+d = 1\
+2\
+3\
+4
+e = 1 \
+ 2 \
+ 3 \
+ 4
+f = 1 ; \
+hidden = because of the preceding backslash multi-lining the comment ;
+visible = 1
+g = 1 #\
+and now this comment is hidden too \
+and this one too
+h = 1
+multi \
+line \
+key = 1
+multi \
+line \
+key = \
+multi \
+line \
+value ;
+# end of file
diff --git a/iniparser-4.1/test/test_dictionary.c b/iniparser-4.1/test/test_dictionary.c
new file mode 100644
index 0000000..f89f1c1
--- /dev/null
+++ b/iniparser-4.1/test/test_dictionary.c
@@ -0,0 +1,237 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "CuTest.h"
+
+/* We need to directly insert the .c file in order to test the */
+/* static functions as well */
+#include "dictionary.c"
+
+void Test_xstrdup(CuTest *tc)
+{
+ size_t i;
+ char *dup_str;
+ const char *strings[] = {
+ "",
+ "test",
+ " "
+ };
+ char *string_very_long;
+
+ /* NULL test */
+ CuAssertPtrEquals(tc, NULL, xstrdup(NULL));
+
+ for (i = 0 ; i < sizeof(strings) / sizeof(char *) ; ++i) {
+ dup_str = xstrdup(strings[i]);
+ CuAssertStrEquals(tc, strings[i], dup_str);
+ free(dup_str);
+ }
+
+ /* test a overflowing string */
+ string_very_long = (char*) malloc(10 * 1024);
+ memset(string_very_long, '#', 10 * 1024);
+ string_very_long[10 * 1024 - 1] = '\0';
+ dup_str = xstrdup(string_very_long);
+ CuAssertStrEquals(tc, string_very_long, dup_str);
+
+ free(string_very_long);
+ free(dup_str);
+}
+
+void Test_dictionary_grow(CuTest *tc)
+{
+ unsigned i;
+ dictionary *dic;
+
+ dic = dictionary_new(DICTMINSZ);
+ CuAssertPtrNotNull(tc, dic);
+ CuAssertIntEquals(tc, 0, dic->n);
+ CuAssertIntEquals(tc, DICTMINSZ, dic->size);
+
+ for (i = 1 ; i < 10 ; ++i) {
+ CuAssertIntEquals(tc, 0, dictionary_grow(dic));
+ CuAssertIntEquals(tc, 0, dic->n);
+ CuAssertIntEquals(tc, (1 << i) * DICTMINSZ, dic->size);
+ }
+}
+
+void Test_dictionary_hash(CuTest *tc)
+{
+ /* NULL test */
+ CuAssertIntEquals(tc, 0, dictionary_hash(NULL));
+}
+
+void Test_dictionary_growing(CuTest *tc)
+{
+ int i, j;
+ char sec_name[32];
+ char key_name[64];
+ dictionary *dic;
+
+ dic = dictionary_new(DICTMINSZ);
+ CuAssertPtrNotNull(tc, dic);
+ CuAssertIntEquals(tc, 0, dic->n);
+
+ /* Makes the dictionary grow */
+ for (i = 1 ; i < 101; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ CuAssertIntEquals(tc, 0, dictionary_set(dic, sec_name, ""));
+ for (j = 1 ; j < 11; ++j) {
+ sprintf(key_name, "%s:key%d", sec_name, j);
+ CuAssertIntEquals(tc, 0, dictionary_set(dic, key_name, "dummy_value"));
+ CuAssertIntEquals(tc, i + (i - 1) * 10 + j, dic->n);
+ }
+ }
+
+ /* Shrink the dictionary */
+ for (i = 100 ; i > 0; --i) {
+ sprintf(sec_name, "sec%d", i);
+ for (j = 10 ; j > 0; --j) {
+ sprintf(key_name, "%s:key%d", sec_name, j);
+ dictionary_unset(dic, key_name);
+ }
+ dictionary_unset(dic, sec_name);
+ CuAssertIntEquals(tc, (i - 1) * (11), dic->n);
+ }
+
+ dictionary_del(dic);
+}
+
+static char *get_dump(dictionary *d)
+{
+ FILE *fd;
+ char *dump_buff;
+ int dump_size;
+
+ /* Dump the dictionary in temporary file */
+ fd = tmpfile();
+ if (fd == NULL)
+ return NULL;
+ dictionary_dump(d, fd);
+
+ /* Retrieve the dump file */
+ dump_size = ftell(fd);
+ if (dump_size == -1) {
+ fclose(fd);
+ return NULL;
+ }
+ rewind(fd);
+
+ dump_buff = (char*) calloc(1, dump_size + 1);
+ if (dump_buff == NULL) {
+ fclose(fd);
+ return NULL;
+ }
+ if (fread(dump_buff, 1, dump_size, fd) != (size_t)dump_size) {
+ fclose(fd);
+ return NULL;
+ }
+
+ fclose(fd);
+ return dump_buff;
+}
+
+void Test_dictionary_unset(CuTest *tc)
+{
+ int i, j;
+ char sec_name[32];
+ char key_name[64];
+ dictionary *dic1;
+ dictionary *dic2;
+ char *dic1_dump;
+ char *dic2_dump;
+
+ /* try dummy unsets */
+ dictionary_unset(NULL, NULL);
+ dictionary_unset(NULL, key_name);
+
+ /* Generate two similar dictionaries */
+ dic1 = dictionary_new(DICTMINSZ);
+ CuAssertPtrNotNull(tc, dic1);
+ for (i = 1 ; i < 10; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ dictionary_set(dic1, sec_name, "");
+ for (j = 1 ; j < 10; ++j) {
+ sprintf(key_name, "%s:key%d", sec_name, j);
+ dictionary_set(dic1, key_name, "dummy_value");
+ }
+ }
+ dic2 = dictionary_new(DICTMINSZ);
+ CuAssertPtrNotNull(tc, dic2);
+ for (i = 1 ; i < 10; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ dictionary_set(dic2, sec_name, "");
+ for (j = 1 ; j < 10; ++j) {
+ sprintf(key_name, "%s:key%d", sec_name, j);
+ dictionary_set(dic2, key_name, "dummy_value");
+ }
+ }
+
+ /* Make sure the dictionaries are the same */
+ dic1_dump = get_dump(dic1);
+ dic2_dump = get_dump(dic2);
+ CuAssertStrEquals(tc, dic1_dump, dic2_dump);
+ free(dic1_dump);
+ free(dic2_dump);
+
+ /* Those tests should not change the dictionary */
+ dictionary_unset(dic2, NULL);
+ dictionary_unset(dic2, "bad_key");
+
+ /* dic1 and dic2 must still be the same */
+ dic1_dump = get_dump(dic1);
+ dic2_dump = get_dump(dic2);
+ CuAssertStrEquals(tc, dic1_dump, dic2_dump);
+ free(dic1_dump);
+ free(dic2_dump);
+}
+
+void Test_dictionary_dump(CuTest *tc)
+{
+ int i, j;
+ char sec_name[32];
+ char key_name[64];
+ dictionary *dic;
+ char *dump_buff;
+ const char dump_real[] = "\
+ sec1\t[]\n\
+ sec1:key1\t[dummy_value]\n\
+ sec1:key2\t[dummy_value]\n\
+ sec1:key3\t[dummy_value]\n\
+ sec1:key4\t[dummy_value]\n\
+ sec2\t[]\n\
+ sec2:key1\t[dummy_value]\n\
+ sec2:key2\t[dummy_value]\n\
+ sec2:key3\t[dummy_value]\n\
+ sec2:key4\t[dummy_value]\n\
+";
+
+ dic = dictionary_new(DICTMINSZ);
+ CuAssertPtrNotNull(tc, dic);
+
+ /* Try dummy values */
+ dictionary_dump(NULL, NULL);
+ dictionary_dump(dic, NULL);
+
+ /* Try with empty dictionary first */
+ dump_buff = get_dump(dic);
+ CuAssertStrEquals(tc, "empty dictionary\n", dump_buff);
+ free(dump_buff);
+
+ /* Populate the dictionary */
+ for (i = 1 ; i < 3; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ dictionary_set(dic, sec_name, "");
+ for (j = 1 ; j < 5; ++j) {
+ sprintf(key_name, "%s:key%d", sec_name, j);
+ dictionary_set(dic, key_name, "dummy_value");
+ }
+ }
+
+ /* Check the dump file */
+ dump_buff = get_dump(dic);
+ CuAssertStrEquals(tc, dump_real, dump_buff);
+ free(dump_buff);
+
+ dictionary_del(dic);
+}
diff --git a/iniparser-4.1/test/test_iniparser.c b/iniparser-4.1/test/test_iniparser.c
new file mode 100644
index 0000000..c76529c
--- /dev/null
+++ b/iniparser-4.1/test/test_iniparser.c
@@ -0,0 +1,698 @@
+#include <stdio.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <stdarg.h>
+
+#include "CuTest.h"
+#include "dictionary.h"
+
+/* We need to directly insert the .c file in order to test the */
+/* static functions as well */
+#include "iniparser.c"
+
+#define GOOD_INI_PATH "ressources/good_ini"
+#define BAD_INI_PATH "ressources/bad_ini"
+
+
+/* Tool function to create and populate a generic non-empty dictionary */
+static dictionary * generate_dictionary(unsigned sections, unsigned entries_per_section)
+{
+ unsigned i, j ;
+ dictionary * dic;
+ char sec_name[32];
+ char key_name[64];
+ char key_value[32];
+
+ dic = dictionary_new(sections + sections * entries_per_section);
+ if (dic == NULL)
+ return NULL;
+
+ /* Insert the sections */
+ for (i = 0; i < sections; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ dictionary_set(dic, sec_name, "");
+ for (j = 0; j < entries_per_section; ++j) {
+ /* Populate the section with the entries */
+ sprintf(key_name, "%s:key%d", sec_name, j);
+ sprintf(key_value, "value-%d/%d", i, j);
+ dictionary_set(dic, key_name, key_value);
+ }
+ }
+
+ return dic;
+}
+
+void Test_iniparser_strlwc(CuTest *tc)
+{
+ char out_buffer[128];
+
+ /* NULL ptr as input */
+ CuAssertPtrEquals(tc, NULL, strlwc(NULL, NULL, 0));
+ CuAssertPtrEquals(tc, NULL, strlwc(NULL, out_buffer, sizeof (out_buffer)));
+ CuAssertPtrEquals(tc, NULL, strlwc("", NULL, sizeof (out_buffer)));
+ CuAssertPtrEquals(tc, NULL, strlwc("", out_buffer, 0));
+ CuAssertPtrEquals(tc, NULL, strlwc(NULL, NULL, 0));
+
+ /* empty string */
+ CuAssertStrEquals(tc, "", strlwc("", out_buffer, sizeof (out_buffer)));
+
+ CuAssertStrEquals(tc, " ", strlwc(" ", out_buffer, sizeof (out_buffer)));
+ CuAssertStrEquals(tc, "test", strlwc("test", out_buffer, sizeof (out_buffer)));
+ CuAssertStrEquals(tc, "test", strlwc("TEST", out_buffer, sizeof (out_buffer)));
+ CuAssertStrEquals(tc, "test", strlwc("TeSt", out_buffer, sizeof (out_buffer)));
+ CuAssertStrEquals(tc, "test test",
+ strlwc("TEST TEST", out_buffer, sizeof (out_buffer)));
+ CuAssertStrEquals(tc, "very long string !!!!!!!",
+ strlwc("very long string !!!!!!!", out_buffer, sizeof (out_buffer)));
+ CuAssertStrEquals(tc, "cutted string", strlwc("cutted string<---here", out_buffer, 14));
+
+ /* test using same buffer as input and output */
+ strcpy(out_buffer, "OVERWRITE ME !");
+ CuAssertPtrNotNull(tc, strlwc(out_buffer, out_buffer, sizeof(out_buffer)));
+ CuAssertStrEquals(tc, "overwrite me !", out_buffer);
+}
+
+void Test_iniparser_strstrip(CuTest *tc)
+{
+ /* First element in the array is the expected stripping result */
+ const char *strings_empty[] = {
+ "",
+ " ",
+ "\n\n\n\n",
+ "\t\t\t\t",
+ "\n \t\n\t\n "
+ };
+ const char *strings_test[] = {
+ "test",
+ "test ",
+ "test ",
+ " test",
+ " test ",
+ "\ttest\t",
+ "\ttest\n"
+
+ };
+ const char *test_with_spaces = "I am a test with\tspaces.";
+ char stripped[ASCIILINESZ+1];
+ char error_msg[128];
+ unsigned i;
+
+ /* NULL ptr as input */
+ strstrip(NULL);
+
+ /* empty string */
+ for (i = 0 ; i < sizeof (strings_empty) / sizeof (char *) ; ++i) {
+ strcpy(stripped, strings_empty[i]);
+ strstrip(stripped);
+ sprintf(error_msg, "Bad stripping : strstrip(\"%s\") ==> \"%s\"",
+ strings_empty[i], stripped);
+ CuAssertStrEquals_Msg(tc, error_msg, stripped, strings_empty[0]);
+ }
+
+ /* test string */
+ for (i = 0 ; i < sizeof (strings_test) / sizeof (char *) ; ++i) {
+ strcpy(stripped, strings_test[i]);
+ strstrip(stripped);
+ sprintf(error_msg, "Bad stripping : strstrip(\"%s\") ==> \"%s\"",
+ strings_test[i], stripped);
+ CuAssertStrEquals_Msg(tc, error_msg, strings_test[0], stripped);
+ }
+ strcpy(stripped, ".");
+ strstrip(stripped);
+ CuAssertStrEquals(tc, ".", stripped);
+
+ /* string containing spaces */
+ strcpy(stripped, test_with_spaces);
+ strstrip(stripped);
+ CuAssertStrEquals(tc, test_with_spaces, stripped);
+}
+
+void Test_iniparser_getnsec(CuTest *tc)
+{
+ int i;
+ char sec_name[32];
+ dictionary *dic;
+
+ /* NULL test */
+ CuAssertIntEquals(tc, -1, iniparser_getnsec(NULL));
+
+ /* Empty dictionary */
+ dic = dictionary_new(10);
+ CuAssertIntEquals(tc, 0, iniparser_getnsec(dic));
+ dictionary_del(dic);
+
+ /* Regular dictionary */
+ dic = generate_dictionary(512, 0);
+ CuAssertIntEquals(tc, 512, iniparser_getnsec(dic));
+
+ /* Check after removing sections */
+ for (i = 1; i < 512; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ dictionary_unset(dic, sec_name);
+ CuAssertIntEquals(tc, 512 - i, iniparser_getnsec(dic));
+ }
+ dictionary_del(dic);
+
+ /* Mix sections and regular keys */
+ dic = generate_dictionary(10, 512);
+ CuAssertIntEquals(tc, 10, iniparser_getnsec(dic));
+ dictionary_del(dic);
+}
+
+void Test_iniparser_getsecname(CuTest *tc)
+{
+ unsigned i;
+ char sec_name[32];
+ dictionary *dic;
+ /* NULL test */
+ CuAssertTrue(tc, iniparser_getsecname(NULL, 0) == NULL);
+
+ /* Empty dictionary */
+ dic = dictionary_new(10);
+ CuAssertPtrEquals(tc, NULL, iniparser_getsecname(dic, 0));
+ dictionary_del(dic);
+
+ /* Sections without entries dictionary */
+ dic = generate_dictionary(100, 0);
+ for (i = 0; i < 100; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ CuAssertStrEquals(tc, sec_name, iniparser_getsecname(dic, i));
+ }
+ dictionary_del(dic);
+
+ /* Generic dictionary */
+ dic = generate_dictionary(10, 100);
+ for (i = 0; i < 10; ++i) {
+ sprintf(sec_name, "sec%d", i);
+ CuAssertStrEquals(tc, sec_name, iniparser_getsecname(dic, i));
+ }
+ dictionary_del(dic);
+}
+
+void Test_iniparser_getseckeys(CuTest *tc)
+{
+ unsigned i;
+ char key_name[64];
+ dictionary *dic;
+ int nkeys;
+ const char * keys[10]; /* At most 10 elements per section */
+ /* NULL test */
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(NULL, NULL, NULL));
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(NULL, "dummy", NULL));
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(NULL, "dummy", keys));
+
+ /* Empty dictionary */
+ dic = dictionary_new(10);
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(dic, NULL, keys));
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(dic, "dummy", keys));
+ dictionary_del(dic);
+
+ /* Generic dictionary */
+
+ dic = generate_dictionary(100, 10);
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(dic, NULL, keys));
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(dic, "dummy", keys));
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(dic, "sec0", NULL));
+ nkeys = iniparser_getsecnkeys(dic, "sec42");
+ CuAssertIntEquals(tc, nkeys, 10);
+ CuAssertPtrEquals(tc, keys, iniparser_getseckeys(dic, "sec42", keys));
+ for (i = 0; i < 10; ++i) {
+ sprintf(key_name, "sec42:key%d", i);
+ CuAssertStrEquals(tc, key_name, keys[i]);
+ }
+
+ /* Remove some keys to make the dictionary more real */
+ dictionary_unset(dic, "sec42");
+ dictionary_unset(dic, "sec99:key9");
+ dictionary_unset(dic, "sec0:key0");
+ dictionary_unset(dic, "sec0:key1");
+ dictionary_unset(dic, "sec0:key2");
+
+ CuAssertPtrEquals(tc, NULL, iniparser_getseckeys(dic, "sec42", keys));
+ nkeys = iniparser_getsecnkeys(dic, "Sec99");
+ CuAssertIntEquals(tc, nkeys, 9);
+ CuAssertPtrEquals(tc, keys, iniparser_getseckeys(dic, "Sec99", keys));
+ for (i = 0; i < 9; ++i) {
+ sprintf(key_name, "sec99:key%d", i);
+ CuAssertStrEquals(tc, key_name, keys[i]);
+ }
+
+ nkeys = iniparser_getsecnkeys(dic, "sec0");
+ CuAssertIntEquals(tc, nkeys, 7);
+ CuAssertPtrEquals(tc, keys, iniparser_getseckeys(dic, "sec0", keys));
+ for (i = 0; i < 7; ++i) {
+ sprintf(key_name, "sec0:key%d", i + 3);
+ CuAssertStrEquals(tc, key_name, keys[i]);
+ }
+
+ dictionary_del(dic);
+}
+
+void Test_iniparser_getstring(CuTest *tc)
+{
+ dictionary *dic;
+ /* NULL test */
+ CuAssertPtrEquals(tc, NULL, iniparser_getstring(NULL, NULL, NULL));
+ CuAssertPtrEquals(tc, NULL, iniparser_getstring(NULL, "dummy", NULL));
+
+ /* Check the def return element */
+ dic = dictionary_new(10);
+ CuAssertPtrEquals(tc, NULL, iniparser_getstring(dic, "dummy", NULL));
+ CuAssertStrEquals(tc, "def", iniparser_getstring(dic, NULL, "def"));
+ CuAssertStrEquals(tc, "def", iniparser_getstring(dic, "dummy", "def"));
+ dictionary_del(dic);
+
+ /* Generic dictionary */
+ dic = generate_dictionary(100, 10);
+ CuAssertStrEquals(tc, "value-0/0",
+ iniparser_getstring(dic, "sec0:key0", NULL));
+ CuAssertStrEquals(tc, "value-42/5",
+ iniparser_getstring(dic, "sec42:key5", NULL));
+ CuAssertStrEquals(tc, "value-99/9",
+ iniparser_getstring(dic, "sec99:key9", NULL));
+ dictionary_del(dic);
+}
+
+void Test_iniparser_getint(CuTest *tc)
+{
+ unsigned i;
+ char key_name[64];
+ dictionary *dic;
+ const struct { int num; const char *value; } good_val[] = {
+ { 0, "0" },
+ { 1, "1" },
+ { -1, "-1" },
+ { 1000, "1000" },
+ { 077, "077" },
+ { -01000, "-01000" },
+ { 0xFFFF, "0xFFFF" },
+ { -0xFFFF, "-0xFFFF" },
+ { 0x4242, "0x4242" },
+ { 0, NULL} /* must be last */
+ };
+ const char *bad_val[] = {
+ "",
+ "notanumber",
+ "0x",
+ "k2000",
+ " ",
+ "0xG1"
+ };
+ /* NULL test */
+ CuAssertIntEquals(tc, -42, iniparser_getint(NULL, NULL, -42));
+ CuAssertIntEquals(tc, -42, iniparser_getint(NULL, "dummy", -42));
+
+ /* Check the def return element */
+ dic = dictionary_new(10);
+ CuAssertIntEquals(tc, 42, iniparser_getint(dic, "dummy", 42));
+ CuAssertIntEquals(tc, 0xFFFF, iniparser_getint(dic, NULL, 0xFFFF));
+ CuAssertIntEquals(tc, -0xFFFF, iniparser_getint(dic, "dummy", -0xFFFF));
+ dictionary_del(dic);
+
+ /* Generic dictionary */
+ dic = dictionary_new(10);
+ for (i = 0; good_val[i].value != NULL; ++i) {
+ sprintf(key_name, "int:value%d", i);
+ dictionary_set(dic, key_name, good_val[i].value);
+ }
+ for (i = 0; good_val[i].value != NULL; ++i) {
+ sprintf(key_name, "int:value%d", i);
+ CuAssertIntEquals(tc, good_val[i].num,
+ iniparser_getint(dic, key_name, 0));
+ }
+ dictionary_del(dic);
+
+ /* Test bad names */
+ dic = dictionary_new(10);
+ for (i = 0; i < sizeof (bad_val) / sizeof (char *); ++i) {
+ sprintf(key_name, "int:bad%d", i);
+ dictionary_set(dic, key_name, bad_val[i]);
+ }
+ for (i = 0; i < sizeof (bad_val) / sizeof (char *); ++i) {
+ sprintf(key_name, "int:bad%d", i);
+ CuAssertIntEquals(tc, 0,
+ iniparser_getint(dic, key_name, 0));
+ }
+ dictionary_del(dic);
+}
+
+void Test_iniparser_getlongint(CuTest *tc)
+{
+ unsigned i;
+ char key_name[64];
+ dictionary *dic;
+ const struct { long int num; const char *value; } good_val[] = {
+ { 0, "0" },
+ { 1, "1" },
+ { -1, "-1" },
+ { 1000, "1000" },
+ { 077, "077" },
+ { -01000, "-01000" },
+ { 0x7FFFFFFFFFFFFFFF, "0x7FFFFFFFFFFFFFFF" },
+ { -0x7FFFFFFFFFFFFFFF, "-0x7FFFFFFFFFFFFFFF" },
+ { 0x4242, "0x4242" },
+ { 0, NULL} /* must be last */
+ };
+ const char *bad_val[] = {
+ "",
+ "notanumber",
+ "0x",
+ "k2000",
+ " ",
+ "0xG1"
+ };
+ /* NULL test */
+ CuAssertLongIntEquals(tc, -42, iniparser_getlongint(NULL, NULL, -42));
+ CuAssertLongIntEquals(tc, -42, iniparser_getlongint(NULL, "dummy", -42));
+
+ /* Check the def return element */
+ dic = dictionary_new(10);
+ CuAssertLongIntEquals(tc, 42, iniparser_getlongint(dic, "dummy", 42));
+ CuAssertLongIntEquals(tc, 0x7FFFFFFFFFFFFFFF, iniparser_getlongint(dic, NULL, 0x7FFFFFFFFFFFFFFF));
+ CuAssertLongIntEquals(tc, -0x7FFFFFFFFFFFFFFF, iniparser_getlongint(dic, "dummy", -0x7FFFFFFFFFFFFFFF));
+ dictionary_del(dic);
+
+ /* Generic dictionary */
+ dic = dictionary_new(10);
+ for (i = 0; good_val[i].value != NULL; ++i) {
+ sprintf(key_name, "longint:value%d", i);
+ dictionary_set(dic, key_name, good_val[i].value);
+ }
+ for (i = 0; good_val[i].value != NULL; ++i) {
+ sprintf(key_name, "longint:value%d", i);
+ CuAssertLongIntEquals(tc, good_val[i].num,
+ iniparser_getlongint(dic, key_name, 0));
+ }
+ dictionary_del(dic);
+
+ /* Test bad names */
+ dic = dictionary_new(10);
+ for (i = 0; i < sizeof (bad_val) / sizeof (char *); ++i) {
+ sprintf(key_name, "longint:bad%d", i);
+ dictionary_set(dic, key_name, bad_val[i]);
+ }
+ for (i = 0; i < sizeof (bad_val) / sizeof (char *); ++i) {
+ sprintf(key_name, "longint:bad%d", i);
+ CuAssertLongIntEquals(tc, 0,
+ iniparser_getlongint(dic, key_name, 0));
+ }
+ dictionary_del(dic);
+}
+
+void Test_iniparser_getdouble(CuTest *tc)
+{
+ dictionary *dic;
+
+ /* NULL test */
+ CuAssertDblEquals(tc, -42, iniparser_getdouble(NULL, NULL, -42), 0);
+ CuAssertDblEquals(tc, 4.2, iniparser_getdouble(NULL, "dummy", 4.2), 0);
+
+ /* Check the def return element */
+ dic = dictionary_new(10);
+ CuAssertDblEquals(tc, 3.1415, iniparser_getdouble(dic, "dummy", 3.1415), 0);
+ CuAssertDblEquals(tc, 0xFFFFFFFF, iniparser_getdouble(dic, NULL, 0xFFFFFFFF), 0);
+ CuAssertDblEquals(tc, -0xFFFFFFFF, iniparser_getdouble(dic, "dummy", -0xFFFFFFFF), 0);
+
+ /* Insert some values */
+ dictionary_set(dic, "double", "");
+ dictionary_set(dic, "double:good0", "0");
+ dictionary_set(dic, "double:good1", "-0");
+ dictionary_set(dic, "double:good2", "1.0");
+ dictionary_set(dic, "double:good3", "3.1415");
+ dictionary_set(dic, "double:good4", "6.6655957");
+ dictionary_set(dic, "double:good5", "-123456789.123456789");
+
+ /* Add dummy stuff too */
+ dictionary_set(dic, "double:bad0", "foo");
+
+ /* Get back the values */
+ CuAssertDblEquals(tc, 0, iniparser_getdouble(dic, "double:good0", 0xFF), 0);
+ CuAssertDblEquals(tc, 0, iniparser_getdouble(dic, "double:good1", 0xFF), 0);
+ CuAssertDblEquals(tc, 1.0, iniparser_getdouble(dic, "double:good2", 0xFF), 0);
+ CuAssertDblEquals(tc, 3.1415, iniparser_getdouble(dic, "double:good3", 0xFF), 0);
+ CuAssertDblEquals(tc, 6.6655957, iniparser_getdouble(dic, "double:good4", 0xFF), 0);
+ CuAssertDblEquals(tc, -123456789.123456789,
+ iniparser_getdouble(dic, "double:good5", 0xFF), 0);
+
+ CuAssertDblEquals(tc, 0, iniparser_getdouble(dic, "double:bad0", 42.42), 0);
+
+ dictionary_del(dic);
+}
+
+void Test_iniparser_getboolean(CuTest *tc)
+{
+ unsigned i;
+ char key_name[64];
+
+ dictionary *dic;
+ const char *token_true[] = {
+ "1",
+ "true",
+ "t",
+ "TRUE",
+ "T",
+ "yes",
+ "y",
+ "YES"
+ "Y",
+ NULL
+ };
+ const char *token_false[] = {
+ "0",
+ "false",
+ "f",
+ "FALSE",
+ "F",
+ "no",
+ "n",
+ "NO",
+ "N",
+ NULL
+ };
+
+ /* NULL test */
+ CuAssertIntEquals(tc, 1, iniparser_getboolean(NULL, NULL, 1));
+ CuAssertIntEquals(tc, 1, iniparser_getboolean(NULL, "dummy", 1));
+
+ /* Check the def return element */
+ dic = dictionary_new(10);
+ CuAssertIntEquals(tc, 1, iniparser_getboolean(dic, "dummy", 1));
+ CuAssertIntEquals(tc, 0, iniparser_getboolean(dic, NULL, 0));
+ CuAssertIntEquals(tc, 1, iniparser_getboolean(dic, "dummy", 1));
+
+ for (i = 0; token_true[i] != NULL; ++i) {
+ sprintf(key_name, "bool:true%d", i);
+ iniparser_set(dic, key_name, token_true[i]);
+ }
+ for (i = 0; token_false[i] != NULL; ++i) {
+ sprintf(key_name, "bool:false%d", i);
+ iniparser_set(dic, key_name, token_false[i]);
+ }
+
+ for (i = 0; token_true[i] != NULL; ++i) {
+ sprintf(key_name, "bool:true%d", i);
+ CuAssertIntEquals(tc, 1, iniparser_getboolean(dic, key_name, 0));
+ }
+ for (i = 0; token_false[i] != NULL; ++i) {
+ sprintf(key_name, "bool:false%d", i);
+ CuAssertIntEquals(tc, 0, iniparser_getboolean(dic, key_name, 1));
+ }
+
+ /* Test bad boolean */
+ iniparser_set(dic, "bool:bad0", "");
+ iniparser_set(dic, "bool:bad1", "m'kay");
+ iniparser_set(dic, "bool:bad2", "42");
+ iniparser_set(dic, "bool:bad3", "_true");
+ CuAssertIntEquals(tc, 0xFF, iniparser_getboolean(dic, "bool:bad0", 0xFF));
+ CuAssertIntEquals(tc, 0xFF, iniparser_getboolean(dic, "bool:bad1", 0xFF));
+ CuAssertIntEquals(tc, 0xFF, iniparser_getboolean(dic, "bool:bad2", 0xFF));
+ CuAssertIntEquals(tc, 0xFF, iniparser_getboolean(dic, "bool:bad3", 0xFF));
+
+ dictionary_del(dic);
+}
+
+void Test_iniparser_line(CuTest *tc)
+{
+ char section [ASCIILINESZ+1] ;
+ char key [ASCIILINESZ+1] ;
+ char val [ASCIILINESZ+1] ;
+
+ /* Test empty line */
+ CuAssertIntEquals(tc, LINE_EMPTY, iniparser_line("", section, key, val));
+ CuAssertIntEquals(tc, LINE_EMPTY, iniparser_line(" ", section, key, val));
+ CuAssertIntEquals(tc, LINE_EMPTY, iniparser_line("\t", section, key, val));
+
+ /* Test valid syntax */
+ CuAssertIntEquals(tc, LINE_SECTION, iniparser_line("[s]", section, key, val));
+ CuAssertStrEquals(tc, "s", section);
+
+ CuAssertIntEquals(tc, LINE_SECTION, iniparser_line("[ section ]", section, key, val));
+ CuAssertStrEquals(tc, "section", section);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("k=1", section, key, val));
+ CuAssertStrEquals(tc, "k", key);
+ CuAssertStrEquals(tc, "1", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key = 0x42", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, "0x42", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key= value with spaces", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, "value with spaces", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("k =_!<>''", section, key, val));
+ CuAssertStrEquals(tc, "k", key);
+ CuAssertStrEquals(tc, "_!<>''", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("empty_value =", section, key, val));
+ CuAssertStrEquals(tc, "empty_value", key);
+ CuAssertStrEquals(tc, "", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("empty_value = \t\n", section, key, val));
+ CuAssertStrEquals(tc, "empty_value", key);
+ CuAssertStrEquals(tc, "", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key =\tval # comment", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, "val", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key \n\n = \n val", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, "val", val);
+
+ CuAssertIntEquals(tc, LINE_COMMENT, iniparser_line(";comment", section, key, val));
+ CuAssertIntEquals(tc, LINE_COMMENT, iniparser_line(" # comment", section, key, val));
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key = \" do_not_strip \"", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, " do_not_strip ", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key = ' '", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, " ", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key = \"\"", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, "", val);
+
+ CuAssertIntEquals(tc, LINE_VALUE, iniparser_line("key = ''", section, key, val));
+ CuAssertStrEquals(tc, "key", key);
+ CuAssertStrEquals(tc, "", val);
+
+ /* Test syntax error */
+ CuAssertIntEquals(tc, LINE_ERROR, iniparser_line("empty_value", section, key, val));
+ CuAssertIntEquals(tc, LINE_ERROR, iniparser_line("not finished\\", section, key, val));
+ CuAssertIntEquals(tc, LINE_ERROR, iniparser_line("0x42 / 0b101010", section, key, val));
+
+}
+
+void Test_iniparser_load(CuTest *tc)
+{
+ DIR *dir;
+ struct dirent *curr;
+ struct stat curr_stat;
+ dictionary *dic;
+ char ini_path[256];
+
+ /* Dummy tests */
+ dic = iniparser_load("/you/shall/not/path");
+ CuAssertPtrEquals(tc, NULL, dic);
+
+ /* Test all the good .ini files */
+ dir = opendir(GOOD_INI_PATH);
+ CuAssertPtrNotNullMsg(tc, "Cannot open good .ini conf directory", dir);
+ for (curr = readdir(dir); curr != NULL; curr = readdir(dir)) {
+ sprintf(ini_path, "%s/%s", GOOD_INI_PATH, curr->d_name);
+ stat(ini_path, &curr_stat);
+ if (S_ISREG(curr_stat.st_mode)) {
+ dic = iniparser_load(ini_path);
+ CuAssertPtrNotNullMsg(tc, ini_path, dic);
+ dictionary_del(dic);
+ }
+ }
+ closedir(dir);
+
+ /* Test all the bad .ini files */
+ dir = opendir(BAD_INI_PATH);
+ CuAssertPtrNotNullMsg(tc, "Cannot open bad .ini conf directory", dir);
+ for (curr = readdir(dir); curr != NULL; curr = readdir(dir)) {
+ sprintf(ini_path, "%s/%s", BAD_INI_PATH, curr->d_name);
+ stat(ini_path, &curr_stat);
+ if (S_ISREG(curr_stat.st_mode)) {
+ dic = iniparser_load(ini_path);
+ CuAssertPtrEquals_Msg(tc, ini_path, NULL, dic);
+ dictionary_del(dic);
+ }
+ }
+ closedir(dir);
+}
+
+void Test_dictionary_wrapper(CuTest *tc)
+{
+ dictionary *dic;
+
+ dic = dictionary_new(10);
+
+ CuAssertIntEquals(tc, -1, iniparser_set(dic, NULL, NULL));
+ CuAssertIntEquals(tc, -1, iniparser_set(NULL, "section", "value"));
+
+ CuAssertIntEquals(tc, 0, iniparser_set(dic, "section", NULL));
+ CuAssertIntEquals(tc, 0, iniparser_set(dic, "section:key", "value"));
+
+ CuAssertStrEquals(tc, "value", iniparser_getstring(dic, "section:key", NULL));
+ /* reset the key's value*/
+ CuAssertIntEquals(tc, 0, iniparser_set(dic, "section:key", NULL));
+ CuAssertStrEquals(tc, NULL, iniparser_getstring(dic, "section:key", "dummy"));
+ CuAssertIntEquals(tc, 0, iniparser_set(dic, "section:key", "value"));
+ CuAssertStrEquals(tc, "value", iniparser_getstring(dic, "section:key", NULL));
+
+ iniparser_unset(dic, "section:key");
+ CuAssertStrEquals(tc, "dummy", iniparser_getstring(dic, "section:key", "dummy"));
+ CuAssertStrEquals(tc, NULL, iniparser_getstring(dic, "section", "dummy"));
+
+ CuAssertIntEquals(tc, 0, iniparser_set(dic, "section:key", NULL));
+ CuAssertIntEquals(tc, 0, iniparser_set(dic, "section:key1", NULL));
+ CuAssertIntEquals(tc, 0, iniparser_set(dic, "section:key2", NULL));
+
+ iniparser_unset(dic, "section");
+ CuAssertStrEquals(tc, NULL, iniparser_getstring(dic, "section", NULL));
+
+ iniparser_freedict(dic);
+}
+
+static char _last_error[1024];
+static int _error_callback(const char *format, ...)
+{
+ int ret;
+ va_list argptr;
+ va_start(argptr, format);
+ ret = vsprintf(_last_error, format, argptr);
+ va_end(argptr);
+ return ret;
+
+}
+
+void Test_iniparser_error_callback(CuTest *tc)
+{
+ dictionary *dic;
+
+ /* Specify our custom error_callback */
+ iniparser_set_error_callback(_error_callback);
+
+ /* Trigger an error and check it was written on the right output */
+ dic = iniparser_load("/path/to/nowhere.ini");
+ CuAssertPtrEquals(tc, NULL, dic);
+ CuAssertStrEquals(tc, "iniparser: cannot open /path/to/nowhere.ini\n", _last_error);
+
+ /* Reset erro_callback */
+ _last_error[0] = '\0';
+ iniparser_set_error_callback(NULL);
+
+ /* Make sure custom callback is no more called */
+ dic = iniparser_load("/path/to/nowhere.ini");
+ CuAssertPtrEquals(tc, NULL, dic);
+ CuAssertStrEquals(tc, "", _last_error);
+}
diff --git a/messages.c b/messages.c
new file mode 100644
index 0000000..5f69924
--- /dev/null
+++ b/messages.c
@@ -0,0 +1,36 @@
+#ifdef MESSAGES_EXTERN
+#define MSG(varname, text) extern char *MSG_##varname
+#else
+#define MSG(varname, text) char *MSG_##varname = text
+#endif
+
+#define USAGE "Skladnia wywolania: %s [--wide-chars] " \
+ "{SCIEZKA_PLIKU_KONFIGURACYJNEGO}"
+
+MSG(MALLOC_FAIL, "Za malo pamieci");
+MSG(CONF_PATH_EXPAND_FAIL, "Bledna sciezka pliku konfiguracyjnego: %s");
+MSG(CONF_NOT_EXIST, "Podany plik konfiguracyjny nie istnieje: %s");
+MSG(CONF_NOT_READABLE, "Brak uprawnien do odczytu pliku konfiguracyjnego: %s");
+MSG(INVALID_INI_FILE, "Blad ladowania konfiguracji, "
+ "sprawdz poprawnosc skladni pliku: %s");
+MSG(BAD_VALUE, "Niepoprawna wartosc zmiennej %s, oczekiwane: %s");
+MSG(BAD_VAR, "Nie zdefiniowano poprawnej zmiennej %s");
+MSG(BAD_PORT_VAR, "Nie zdefiniowano poprawnego portu %s (0 - 65535)");
+MSG(NO_SECTION, "Nie podano %s (sekcja %s)");
+MSG(BAD_DEST_DIR_END, "Sciezka podanego katalogu docelowego "
+ "nie jest zakonczona znakiem '\\'");
+MSG(DEST_DIR_NOT_EXIST, "Podany katalog docelowy nie istnieje");
+MSG(DEST_DIR_NOT_WRITEABLE, "Brak uprawnien do zapisu w katalogu docelowym");
+MSG(ATTACH_NOT_EXIST, "Plik zalacznika nie istnieje: %s");
+MSG(NO_ROOT_CA_STORE, "Nie udalo sie pozyskac zainstalowanych certyfikatow");
+MSG(BAD_ARGS_NUM, "Zle argumenty programu. \r\n" USAGE);
+MSG(MKDIR_FAIL, "Nie udalo sie utworzyc katalogu: %s");
+MSG(FILE_SAVE_FAIL, "Nie udalo sie zapisac do pliku: %s");
+MSG(BAD_AUTHENTICATION, "Nie udalo sie uwierzytelnic przed serwerem");
+MSG(BAD_CERT_FORMAT, "Otrzymano certyfikat w niewspieranym formacie");
+MSG(CERT_VERIFICATION_FAIL, "Blad weryfikacji certyfikatu, "
+ "system lub siec moze byc celem ataku");
+MSG(UNKNOWN_CERT, "Brak certyfikatu w bazie, weryfikacja serwera niemozliwa");
+MSG(CERT_EXPIRED, "Waznosc certyfikatu uzywanego przez serwer wygasla");
+MSG(CERT_NOT_YET_VALID, "Certyfikat uzywany przez serwer "
+ "jeszcze nie zaczal obowiazywac");
diff --git a/misc.c b/misc.c
new file mode 100644
index 0000000..e73b903
--- /dev/null
+++ b/misc.c
@@ -0,0 +1,68 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "utilities.h"
+
+void _finish(bool ok)
+{
+ puts(ok ? "\nOk. " : "\nBlad. ");
+ exit(ok ? 0 : -1);
+}
+
+void *dirtyalloc(size_t size)
+{
+ void *memory = malloc(size);
+
+ if (memory == NULL)
+ FAIL(MSG_MALLOC_FAIL);
+
+ return memory;
+}
+
+/* Used to suppress stderr output of iniparser library */
+int dummy_errback(const char *fmt, ...)
+{
+ return 1;
+}
+
+/*
+ * I had to deal with UTF-16 config files. Since mostly the ASCII characters
+ * are used anyway, I decided to just pick every second byte of the file and
+ * got this semi-working... This IS provisional.
+ */
+int provisional_wide_char_fgetc(FILE *stream)
+{
+ int c = 128;
+
+ while (c > 127) {
+ c = getc(stream);
+ getc(stream);
+
+ if (c == EOF)
+ return EOF;
+ }
+
+ return c;
+}
+
+bool is_valid_port_number(int port)
+{
+ return port >= 0 && port <= 65535;
+}
+
+/*
+ * Different implementations if validate_config() and perform_work()
+ * are supplied in pop and push programs.
+ */
+int main(int argc, const char **argv)
+{
+ struct config config;
+
+ get_config(argc, argv, &config);
+ validate_config(&config);
+ perform_work(&config);
+ /* actually, this won't be reached, because perform_work exit()s... */
+ free_config(&config);
+
+ return 0;
+}
diff --git a/openssl-1.1.0h/.gitattributes b/openssl-1.1.0h/.gitattributes
new file mode 100644
index 0000000..15121c8
--- /dev/null
+++ b/openssl-1.1.0h/.gitattributes
@@ -0,0 +1,3 @@
+*.der binary
+/fuzz/corpora/** binary
+*.pfx binary
diff --git a/openssl-1.1.0h/.gitignore b/openssl-1.1.0h/.gitignore
new file mode 100644
index 0000000..7324bda
--- /dev/null
+++ b/openssl-1.1.0h/.gitignore
@@ -0,0 +1,174 @@
+# Ignore editor artefacts
+/.dir-locals.el
+
+# Top level excludes
+/Makefile.orig
+/MINFO
+/TABLE
+/*.a
+/*.pc
+/rehash.time
+/inc.*
+/makefile.*
+/out.*
+/tmp.*
+/configdata.pm
+
+# *all* Makefiles
+Makefile
+# ... except in demos
+!/demos/*/Makefile
+
+# Links under apps
+/apps/CA.pl
+/apps/tsget
+/apps/tsget.pl
+/apps/md4.c
+
+# Auto generated headers
+/crypto/buildinf.h
+/apps/progs.h
+/crypto/include/internal/*_conf.h
+/openssl/include/opensslconf.h
+/util/domd
+
+# Executables
+/apps/openssl
+/test/sha256t
+/test/sha512t
+/test/gost2814789t
+/test/ssltest_old
+/test/*test
+/test/fips_aesavs
+/test/fips_desmovs
+/test/fips_dhvs
+/test/fips_drbgvs
+/test/fips_dssvs
+/test/fips_ecdhvs
+/test/fips_ecdsavs
+/test/fips_rngvs
+/test/fips_test_suite
+/test/ssltest_old
+/test/x509aux
+/test/v3ext
+
+# Certain files that get created by tests on the fly
+/test/test-runs
+/test/buildtest_*
+
+# Fuzz stuff.
+# Anything without an extension is an executable on Unix, so we keep files
+# with extensions. And we keep the corpora subddir versioned as well.
+# Anything more generic with extensions that should be ignored will be taken
+# care of by general ignores for those extensions (*.o, *.obj, *.exe, ...)
+/fuzz/*
+!/fuzz/README*
+!/fuzz/corpora
+!/fuzz/*.*
+
+# Misc auto generated files
+/include/openssl/opensslconf.h
+/tools/c_rehash
+/tools/c_rehash.pl
+/util/shlib_wrap.sh
+/tags
+/TAGS
+/crypto.map
+/ssl.map
+
+# Windows (legacy)
+/tmp32
+/tmp32.dbg
+/tmp32dll
+/tmp32dll.dbg
+/out32
+/out32.dbg
+/out32dll
+/out32dll.dbg
+/inc32
+/MINFO
+/ms/.rnd
+/ms/bcb.mak
+/ms/libeay32.def
+/ms/nt.mak
+/ms/ntdll.mak
+/ms/ssleay32.def
+/ms/version32.rc
+
+# Files created on other branches that are not held in git, and are not
+# needed on this branch
+/include/openssl/asn1_mac.h
+/include/openssl/des_old.h
+/include/openssl/fips.h
+/include/openssl/fips_rand.h
+/include/openssl/krb5_asn.h
+/include/openssl/kssl.h
+/include/openssl/pq_compat.h
+/include/openssl/ssl23.h
+/include/openssl/tmdiff.h
+/include/openssl/ui_compat.h
+/test/fips_aesavs.c
+/test/fips_desmovs.c
+/test/fips_dsatest.c
+/test/fips_dssvs.c
+/test/fips_hmactest.c
+/test/fips_randtest.c
+/test/fips_rngvs.c
+/test/fips_rsagtest.c
+/test/fips_rsastest.c
+/test/fips_rsavtest.c
+/test/fips_shatest.c
+/test/fips_test_suite.c
+/test/shatest.c
+
+##### Generic patterns
+# Auto generated assembly language source files
+*.s
+!/crypto/*/asm/*.s
+/crypto/arm*.S
+/crypto/*/*.S
+*.asm
+!/crypto/*/asm/*.asm
+
+# Object files
+*.o
+*.obj
+
+# editor artefacts
+*.swp
+.#*
+\#*#
+*~
+
+# Certificate symbolic links
+*.0
+
+# All kinds of executables
+*.so
+*.so.*
+*.dylib
+*.dylib.*
+*.dll
+*.dll.*
+*.exe
+*.pyc
+*.exp
+*.lib
+*.pdb
+*.ilk
+*.def
+*.rc
+*.res
+
+# Misc generated stuff
+Makefile.save
+/crypto/**/lib
+/engines/**/lib
+/ssl/**/lib
+*.bak
+cscope.*
+*.d
+pod2htmd.tmp
+
+# Windows manifest files
+*.manifest
diff --git a/openssl-1.1.0h/.travis-apt-pin.preferences b/openssl-1.1.0h/.travis-apt-pin.preferences
new file mode 100644
index 0000000..1797bd0
--- /dev/null
+++ b/openssl-1.1.0h/.travis-apt-pin.preferences
@@ -0,0 +1,15 @@
+Package: clang-3.9
+Pin: release o=Ubuntu
+Pin-Priority: -1
+
+Package: libclang-common-3.9-dev
+Pin: release o=Ubuntu
+Pin-Priority: -1
+
+Package: libclang1-3.9
+Pin: release o=Ubuntu
+Pin-Priority: -1
+
+Package: libllvm3.9v4
+Pin: release o=Ubuntu
+Pin-Priority: -1
diff --git a/openssl-1.1.0h/.travis-create-release.sh b/openssl-1.1.0h/.travis-create-release.sh
new file mode 100644
index 0000000..311cedd
--- /dev/null
+++ b/openssl-1.1.0h/.travis-create-release.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+# $1 is expected to be $TRAVIS_OS_NAME
+
+./Configure dist
+if [ "$1" == osx ]; then
+ make NAME='_srcdist' TARFILE='_srcdist.tar' \
+ TAR_COMMAND='$(TAR) $(TARFLAGS) -cvf -' tar
+else
+ make TARFILE='_srcdist.tar' NAME='_srcdist' dist
+fi
diff --git a/openssl-1.1.0h/.travis.yml b/openssl-1.1.0h/.travis.yml
new file mode 100644
index 0000000..b5fc443
--- /dev/null
+++ b/openssl-1.1.0h/.travis.yml
@@ -0,0 +1,204 @@
+dist: trusty
+sudo: required
+
+language: c
+cache: ccache
+
+before_install:
+ - if [ -n "$COVERALLS" ]; then
+ pip install --user cpp-coveralls;
+ fi;
+
+addons:
+ apt:
+ packages:
+ - ccache
+
+os:
+ - linux
+
+compiler:
+ - clang
+ - gcc
+
+env:
+ - CONFIG_OPTS="" DESTDIR="_install"
+ - CONFIG_OPTS="--debug no-shared enable-crypto-mdebug enable-rc5 enable-md2"
+ - CONFIG_OPTS="no-pic --strict-warnings" BUILDONLY="yes"
+ - CONFIG_OPTS="no-engine no-shared --strict-warnings" BUILDONLY="yes"
+ - CONFIG_OPTS="no-stdio --strict-warnings" BUILDONLY="yes"
+ - CONFIG_OPTS="no-ec" BUILDONLY="yes"
+ - CONFIG_OPTS="no-asm --strict-warnings" BUILDONLY="yes" CHECKDOCS="yes"
+
+matrix:
+ include:
+ - os: linux
+ compiler: clang-3.9
+ env: CONFIG_OPTS="--strict-warnings no-deprecated" BUILDONLY="yes"
+ - os: linux
+ compiler: gcc
+ env: CONFIG_OPTS="--debug --coverage no-asm enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers" COVERALLS="yes"
+ - os: linux
+ compiler: clang-3.9
+ env: CONFIG_OPTS="enable-asan"
+ - os: linux
+ compiler: clang-3.9
+ env: CONFIG_OPTS="enable-msan"
+ - os: linux
+ compiler: clang-3.9
+ env: CONFIG_OPTS="no-asm enable-ubsan enable-rc5 enable-md2 enable-ssl3 enable-ssl3-method -fno-sanitize=alignment"
+ - os: linux
+ compiler: clang-3.9
+ env: CONFIG_OPTS="no-asm enable-asan enable-rc5 enable-md2"
+ - os: linux
+ compiler: clang-3.9
+ env: CONFIG_OPTS="no-stdio"
+ - os: linux
+ addons:
+ apt:
+ packages:
+ - gcc-5
+ sources:
+ - ubuntu-toolchain-r-test
+ compiler: gcc-5
+ env: CONFIG_OPTS="no-asm enable-ubsan enable-rc5 enable-md2 -DPEDANTIC"
+ - os: linux
+ addons:
+ apt:
+ packages:
+ - binutils-mingw-w64
+ - gcc-mingw-w64
+ compiler: i686-w64-mingw32-gcc
+ env: CONFIG_OPTS="no-pic" TESTS="-test_fuzz"
+ - os: linux
+ addons:
+ apt:
+ packages:
+ - binutils-mingw-w64
+ - gcc-mingw-w64
+ compiler: i686-w64-mingw32-gcc
+ env: CONFIG_OPTS="no-stdio" BUILDONLY="yes"
+ - os: linux
+ addons:
+ apt:
+ packages:
+ - binutils-mingw-w64
+ - gcc-mingw-w64
+ compiler: x86_64-w64-mingw32-gcc
+ env: CONFIG_OPTS="no-pic" TESTS="-test_fuzz"
+ - os: linux
+ addons:
+ apt:
+ packages:
+ - binutils-mingw-w64
+ - gcc-mingw-w64
+ compiler: x86_64-w64-mingw32-gcc
+ env: CONFIG_OPTS="no-stdio" BUILDONLY="yes"
+ exclude:
+ - os: linux
+ compiler: clang
+ - os: osx
+ compiler: gcc
+
+before_script:
+ - if [ -n "$DESTDIR" ]; then
+ sh .travis-create-release.sh $TRAVIS_OS_NAME;
+ tar -xvzf _srcdist.tar.gz;
+ mkdir _build;
+ cd _build;
+ srcdir=../_srcdist;
+ top=..;
+ else
+ srcdir=.;
+ top=.;
+ fi
+ - if [ "$CC" == i686-w64-mingw32-gcc ]; then
+ export CROSS_COMPILE=${CC%%gcc}; unset CC;
+ $srcdir/Configure mingw $CONFIG_OPTS -Wno-pedantic-ms-format;
+ elif [ "$CC" == x86_64-w64-mingw32-gcc ]; then
+ export CROSS_COMPILE=${CC%%gcc}; unset CC;
+ $srcdir/Configure mingw64 $CONFIG_OPTS -Wno-pedantic-ms-format;
+ else
+ if [ "$CC" == clang-3.9 ]; then
+ sudo cp .travis-apt-pin.preferences /etc/apt/preferences.d/no-ubuntu-clang;
+ curl -sSL "http://apt.llvm.org/llvm-snapshot.gpg.key" | sudo -E apt-key add -;
+ echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" | sudo tee -a /etc/apt/sources.list > /dev/null;
+ sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test";
+ sudo -E apt-get -yq update;
+ sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install clang-3.9;
+ elif which ccache >/dev/null; then
+ CC="ccache $CC";
+ fi;
+ $srcdir/config -v $CONFIG_OPTS;
+ fi
+ - if [ -z "$BUILDONLY" ]; then
+ if [ -n "$CROSS_COMPILE" ]; then
+ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+ sudo dpkg --add-architecture i386;
+ sudo apt-get update;
+ fi;
+ fi;
+ fi
+ - cd $top
+
+script:
+ - if [ -z "$BUILDONLY" ]; then
+ make="make -s";
+ else
+ make="make";
+ fi
+ - if [ -n "$DESTDIR" ]; then
+ cd _build;
+ top=..;
+ else
+ top=.;
+ fi
+ - if $make update; then
+ echo -e '+\057 MAKE UPDATE OK';
+ else
+ echo -e '+\057 MAKE UPDATE FAILED'; false;
+ fi;
+ git diff --exit-code
+ - if [ -n "$CHECKDOCS" ]; then
+ if $make doc-nits; then
+ echo -e '+\057\057 MAKE DOC-NITS OK';
+ else
+ echo -e '+\057\057 MAKE DOC-NITS FAILED'; false;
+ fi;
+ fi
+ - if $make ; then
+ echo -e '+\057\057\057 MAKE OK';
+ else
+ echo -e '+\057\057\057 MAKE FAILED'; false;
+ fi;
+ - if [ -z "$BUILDONLY" ]; then
+ if [ -n "$CROSS_COMPILE" ]; then
+ sudo apt-get -yq install wine;
+ export EXE_SHELL="wine" WINEPREFIX=`pwd`;
+ fi;
+ HARNESS_VERBOSE=yes make test;
+ else
+ if $make build_tests; then
+ echo -e '+\057\057\075 MAKE BUILD_TESTS OK';
+ else
+ echo -e '+\057\057\075 MAKE BUILD_TESTS FAILEd'; false;
+ fi;
+ fi
+ - if [ -n "$DESTDIR" ]; then
+ mkdir "../$DESTDIR";
+ if $make install install_docs DESTDIR="../$DESTDIR"; then
+ echo -e '+\057\057\057\057\057 MAKE INSTALL_DOCS OK';
+ else
+ echo -e '+\057\057\057\057\057 MAKE INSTALL_DOCS FAILED'; false;
+ fi;
+ fi
+ - cd $top
+
+after_success:
+ - if [ -n "$COVERALLS" ]; then
+ coveralls -b . --gcov-options '\-lp';
+ fi;
+
+notifications:
+ email:
+ secure: "xeGNgWO7aoaDgRvcZubposqMsj36aU8c6F0oHfw+rUqltCQ14IgYCUwzocmR2O+Pa7B3Cx5VjMfBFHbQaajZsfod8vu7g+aGq/zkjwbhsr/SR4dljJjFJXLGZjIalm9KgP6KInmVDuINfCqP+MHIY5lZkNI7DMcyHDhVc5nSKvCXV7xTDNgmstvh8rB/z51WfHDqGqfBtiuK5FDNxmvYK8OFJ5W94Lu9LDlizcxwK3GAj7arOui7Z5w8bQ6p4seUE3IvJL1Zbj0pZHxvNb6Zeb2Pn8QF1qLlN8YmBktD4aiw0ce4wYRiL87uLgcOxZY7SVXtv2XYFIYWapU/FKjCqa6vK93V/H9eZWEIYNMKnN3wXm2beqVdnKek3OeGJ8v0y7MbSfuLfRtBqbTSNYnpU1Zuo4MQAvHvEPuwCAYkYQajOSRplMH5sULFKptuVqNtOMfjL8jHb8AEoL1acYIk43ydxeYrzzas4fqgCDJ52573/u0RNdF1lkQBLkuM365OB8VRqtpnoxcdEIY/qBc/8TzZ24fxyrs5qdHFcxGSgpN2EP6cJMqpvkemnCNSdhxUqfzm22N7a3O8+4LFSBGOnHto/PwdsvF/01yGYL0LoZTnoO1i6x7AMJPBh+eyDU0ZjGhj/msjmqeb9C8vRqQ+1WjHrIS1iqCD0Czib8tUPD4="
diff --git a/openssl-1.1.0h/ACKNOWLEDGEMENTS b/openssl-1.1.0h/ACKNOWLEDGEMENTS
new file mode 100644
index 0000000..d21dccb
--- /dev/null
+++ b/openssl-1.1.0h/ACKNOWLEDGEMENTS
@@ -0,0 +1,2 @@
+Please https://www.openssl.org/community/thanks.html for the current
+acknowledgements.
diff --git a/openssl-1.1.0h/AUTHORS b/openssl-1.1.0h/AUTHORS
new file mode 100644
index 0000000..48211a2
--- /dev/null
+++ b/openssl-1.1.0h/AUTHORS
@@ -0,0 +1,21 @@
+ Andy Polyakov
+ Ben Laurie
+ Bodo Möller
+ Emilia Käsper
+ Eric Young
+ Geoff Thorpe
+ Holger Reif
+ Kurt Roeckx
+ Lutz Jänicke
+ Mark J. Cox
+ Matt Caswell
+ Nils Larsch
+ Paul C. Sutton
+ Ralf S. Engelschall
+ Rich Salz
+ Richard Levitte
+ Stephen Henson
+ Steve Marquess
+ Tim Hudson
+ Ulf Möller
+ Viktor Dukhovni
diff --git a/openssl-1.1.0h/CHANGES b/openssl-1.1.0h/CHANGES
new file mode 100644
index 0000000..0ea1ad5
--- /dev/null
+++ b/openssl-1.1.0h/CHANGES
@@ -0,0 +1,12586 @@
+
+ OpenSSL CHANGES
+ _______________
+
+ This is a high-level summary of the most important changes.
+ For a full list of changes, see the git commit log; for example,
+ https://github.com/openssl/openssl/commits/ and pick the appropriate
+ release branch.
+
+ Changes between 1.1.0g and 1.1.0h [27 Mar 2018]
+
+ *) Constructed ASN.1 types with a recursive definition could exceed the stack
+
+ Constructed ASN.1 types with a recursive definition (such as can be found
+ in PKCS7) could eventually exceed the stack given malicious input with
+ excessive recursion. This could result in a Denial Of Service attack. There
+ are no such structures used within SSL/TLS that come from untrusted sources
+ so this is considered safe.
+
+ This issue was reported to OpenSSL on 4th January 2018 by the OSS-fuzz
+ project.
+ (CVE-2018-0739)
+ [Matt Caswell]
+
+ *) Incorrect CRYPTO_memcmp on HP-UX PA-RISC
+
+ Because of an implementation bug the PA-RISC CRYPTO_memcmp function is
+ effectively reduced to only comparing the least significant bit of each
+ byte. This allows an attacker to forge messages that would be considered as
+ authenticated in an amount of tries lower than that guaranteed by the
+ security claims of the scheme. The module can only be compiled by the
+ HP-UX assembler, so that only HP-UX PA-RISC targets are affected.
+
+ This issue was reported to OpenSSL on 2nd March 2018 by Peter Waltenberg
+ (IBM).
+ (CVE-2018-0733)
+ [Andy Polyakov]
+
+ *) Add a build target 'build_all_generated', to build all generated files
+ and only that. This can be used to prepare everything that requires
+ things like perl for a system that lacks perl and then move everything
+ to that system and do the rest of the build there.
+ [Richard Levitte]
+
+ *) Backport SSL_OP_NO_RENGOTIATION
+
+ OpenSSL 1.0.2 and below had the ability to disable renegotiation using the
+ (undocumented) SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS flag. Due to the opacity
+ changes this is no longer possible in 1.1.0. Therefore the new
+ SSL_OP_NO_RENEGOTIATION option from 1.1.1-dev has been backported to
+ 1.1.0 to provide equivalent functionality.
+
+ Note that if an application built against 1.1.0h headers (or above) is run
+ using an older version of 1.1.0 (prior to 1.1.0h) then the option will be
+ accepted but nothing will happen, i.e. renegotiation will not be prevented.
+ [Matt Caswell]
+
+ *) Removed the OS390-Unix config target. It relied on a script that doesn't
+ exist.
+ [Rich Salz]
+
+ *) rsaz_1024_mul_avx2 overflow bug on x86_64
+
+ There is an overflow bug in the AVX2 Montgomery multiplication procedure
+ used in exponentiation with 1024-bit moduli. No EC algorithms are affected.
+ Analysis suggests that attacks against RSA and DSA as a result of this
+ defect would be very difficult to perform and are not believed likely.
+ Attacks against DH1024 are considered just feasible, because most of the
+ work necessary to deduce information about a private key may be performed
+ offline. The amount of resources required for such an attack would be
+ significant. However, for an attack on TLS to be meaningful, the server
+ would have to share the DH1024 private key among multiple clients, which is
+ no longer an option since CVE-2016-0701.
+
+ This only affects processors that support the AVX2 but not ADX extensions
+ like Intel Haswell (4th generation).
+
+ This issue was reported to OpenSSL by David Benjamin (Google). The issue
+ was originally found via the OSS-Fuzz project.
+ (CVE-2017-3738)
+ [Andy Polyakov]
+
+ Changes between 1.1.0f and 1.1.0g [2 Nov 2017]
+
+ *) bn_sqrx8x_internal carry bug on x86_64
+
+ There is a carry propagating bug in the x86_64 Montgomery squaring
+ procedure. No EC algorithms are affected. Analysis suggests that attacks
+ against RSA and DSA as a result of this defect would be very difficult to
+ perform and are not believed likely. Attacks against DH are considered just
+ feasible (although very difficult) because most of the work necessary to
+ deduce information about a private key may be performed offline. The amount
+ of resources required for such an attack would be very significant and
+ likely only accessible to a limited number of attackers. An attacker would
+ additionally need online access to an unpatched system using the target
+ private key in a scenario with persistent DH parameters and a private
+ key that is shared between multiple clients.
+
+ This only affects processors that support the BMI1, BMI2 and ADX extensions
+ like Intel Broadwell (5th generation) and later or AMD Ryzen.
+
+ This issue was reported to OpenSSL by the OSS-Fuzz project.
+ (CVE-2017-3736)
+ [Andy Polyakov]
+
+ *) Malformed X.509 IPAddressFamily could cause OOB read
+
+ If an X.509 certificate has a malformed IPAddressFamily extension,
+ OpenSSL could do a one-byte buffer overread. The most likely result
+ would be an erroneous display of the certificate in text format.
+
+ This issue was reported to OpenSSL by the OSS-Fuzz project.
+ (CVE-2017-3735)
+ [Rich Salz]
+
+ *) Ignore the '-named_curve auto' value for compatibility of applications
+ with OpenSSL 1.0.2.
+ [Tomas Mraz <tmraz@fedoraproject.org>]
+
+ *) Support for SSL_OP_NO_ENCRYPT_THEN_MAC in SSL_CONF_cmd.
+ [Emilia Käsper]
+
+ Changes between 1.1.0e and 1.1.0f [25 May 2017]
+
+ *) Have 'config' recognise 64-bit mingw and choose 'mingw64' as the target
+ platform rather than 'mingw'.
+ [Richard Levitte]
+
+ *) Remove the VMS-specific reimplementation of gmtime from crypto/o_times.c.
+ VMS C's RTL has a fully up to date gmtime() and gmtime_r() since V7.1,
+ which is the minimum version we support.
+ [Richard Levitte]
+
+ Changes between 1.1.0d and 1.1.0e [16 Feb 2017]
+
+ *) Encrypt-Then-Mac renegotiation crash
+
+ During a renegotiation handshake if the Encrypt-Then-Mac extension is
+ negotiated where it was not in the original handshake (or vice-versa) then
+ this can cause OpenSSL to crash (dependant on ciphersuite). Both clients
+ and servers are affected.
+
+ This issue was reported to OpenSSL by Joe Orton (Red Hat).
+ (CVE-2017-3733)
+ [Matt Caswell]
+
+ Changes between 1.1.0c and 1.1.0d [26 Jan 2017]
+
+ *) Truncated packet could crash via OOB read
+
+ If one side of an SSL/TLS path is running on a 32-bit host and a specific
+ cipher is being used, then a truncated packet can cause that host to
+ perform an out-of-bounds read, usually resulting in a crash.
+
+ This issue was reported to OpenSSL by Robert Święcki of Google.
+ (CVE-2017-3731)
+ [Andy Polyakov]
+
+ *) Bad (EC)DHE parameters cause a client crash
+
+ If a malicious server supplies bad parameters for a DHE or ECDHE key
+ exchange then this can result in the client attempting to dereference a
+ NULL pointer leading to a client crash. This could be exploited in a Denial
+ of Service attack.
+
+ This issue was reported to OpenSSL by Guido Vranken.
+ (CVE-2017-3730)
+ [Matt Caswell]
+
+ *) BN_mod_exp may produce incorrect results on x86_64
+
+ There is a carry propagating bug in the x86_64 Montgomery squaring
+ procedure. No EC algorithms are affected. Analysis suggests that attacks
+ against RSA and DSA as a result of this defect would be very difficult to
+ perform and are not believed likely. Attacks against DH are considered just
+ feasible (although very difficult) because most of the work necessary to
+ deduce information about a private key may be performed offline. The amount
+ of resources required for such an attack would be very significant and
+ likely only accessible to a limited number of attackers. An attacker would
+ additionally need online access to an unpatched system using the target
+ private key in a scenario with persistent DH parameters and a private
+ key that is shared between multiple clients. For example this can occur by
+ default in OpenSSL DHE based SSL/TLS ciphersuites. Note: This issue is very
+ similar to CVE-2015-3193 but must be treated as a separate problem.
+
+ This issue was reported to OpenSSL by the OSS-Fuzz project.
+ (CVE-2017-3732)
+ [Andy Polyakov]
+
+ Changes between 1.1.0b and 1.1.0c [10 Nov 2016]
+
+ *) ChaCha20/Poly1305 heap-buffer-overflow
+
+ TLS connections using *-CHACHA20-POLY1305 ciphersuites are susceptible to
+ a DoS attack by corrupting larger payloads. This can result in an OpenSSL
+ crash. This issue is not considered to be exploitable beyond a DoS.
+
+ This issue was reported to OpenSSL by Robert Święcki (Google Security Team)
+ (CVE-2016-7054)
+ [Richard Levitte]
+
+ *) CMS Null dereference
+
+ Applications parsing invalid CMS structures can crash with a NULL pointer
+ dereference. This is caused by a bug in the handling of the ASN.1 CHOICE
+ type in OpenSSL 1.1.0 which can result in a NULL value being passed to the
+ structure callback if an attempt is made to free certain invalid encodings.
+ Only CHOICE structures using a callback which do not handle NULL value are
+ affected.
+
+ This issue was reported to OpenSSL by Tyler Nighswander of ForAllSecure.
+ (CVE-2016-7053)
+ [Stephen Henson]
+
+ *) Montgomery multiplication may produce incorrect results
+
+ There is a carry propagating bug in the Broadwell-specific Montgomery
+ multiplication procedure that handles input lengths divisible by, but
+ longer than 256 bits. Analysis suggests that attacks against RSA, DSA
+ and DH private keys are impossible. This is because the subroutine in
+ question is not used in operations with the private key itself and an input
+ of the attacker's direct choice. Otherwise the bug can manifest itself as
+ transient authentication and key negotiation failures or reproducible
+ erroneous outcome of public-key operations with specially crafted input.
+ Among EC algorithms only Brainpool P-512 curves are affected and one
+ presumably can attack ECDH key negotiation. Impact was not analyzed in
+ detail, because pre-requisites for attack are considered unlikely. Namely
+ multiple clients have to choose the curve in question and the server has to
+ share the private key among them, neither of which is default behaviour.
+ Even then only clients that chose the curve will be affected.
+
+ This issue was publicly reported as transient failures and was not
+ initially recognized as a security issue. Thanks to Richard Morgan for
+ providing reproducible case.
+ (CVE-2016-7055)
+ [Andy Polyakov]
+
+ *) OpenSSL now fails if it receives an unrecognised record type in TLS1.0
+ or TLS1.1. Previously this only happened in SSLv3 and TLS1.2. This is to
+ prevent issues where no progress is being made and the peer continually
+ sends unrecognised record types, using up resources processing them.
+ [Matt Caswell]
+
+ *) Removed automatic addition of RPATH in shared libraries and executables,
+ as this was a remainder from OpenSSL 1.0.x and isn't needed any more.
+ [Richard Levitte]
+
+ Changes between 1.1.0a and 1.1.0b [26 Sep 2016]
+
+ *) Fix Use After Free for large message sizes
+
+ The patch applied to address CVE-2016-6307 resulted in an issue where if a
+ message larger than approx 16k is received then the underlying buffer to
+ store the incoming message is reallocated and moved. Unfortunately a
+ dangling pointer to the old location is left which results in an attempt to
+ write to the previously freed location. This is likely to result in a
+ crash, however it could potentially lead to execution of arbitrary code.
+
+ This issue only affects OpenSSL 1.1.0a.
+
+ This issue was reported to OpenSSL by Robert Święcki.
+ (CVE-2016-6309)
+ [Matt Caswell]
+
+ Changes between 1.1.0 and 1.1.0a [22 Sep 2016]
+
+ *) OCSP Status Request extension unbounded memory growth
+
+ A malicious client can send an excessively large OCSP Status Request
+ extension. If that client continually requests renegotiation, sending a
+ large OCSP Status Request extension each time, then there will be unbounded
+ memory growth on the server. This will eventually lead to a Denial Of
+ Service attack through memory exhaustion. Servers with a default
+ configuration are vulnerable even if they do not support OCSP. Builds using
+ the "no-ocsp" build time option are not affected.
+
+ This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
+ (CVE-2016-6304)
+ [Matt Caswell]
+
+ *) SSL_peek() hang on empty record
+
+ OpenSSL 1.1.0 SSL/TLS will hang during a call to SSL_peek() if the peer
+ sends an empty record. This could be exploited by a malicious peer in a
+ Denial Of Service attack.
+
+ This issue was reported to OpenSSL by Alex Gaynor.
+ (CVE-2016-6305)
+ [Matt Caswell]
+
+ *) Excessive allocation of memory in tls_get_message_header() and
+ dtls1_preprocess_fragment()
+
+ A (D)TLS message includes 3 bytes for its length in the header for the
+ message. This would allow for messages up to 16Mb in length. Messages of
+ this length are excessive and OpenSSL includes a check to ensure that a
+ peer is sending reasonably sized messages in order to avoid too much memory
+ being consumed to service a connection. A flaw in the logic of version
+ 1.1.0 means that memory for the message is allocated too early, prior to
+ the excessive message length check. Due to way memory is allocated in
+ OpenSSL this could mean an attacker could force up to 21Mb to be allocated
+ to service a connection. This could lead to a Denial of Service through
+ memory exhaustion. However, the excessive message length check still takes
+ place, and this would cause the connection to immediately fail. Assuming
+ that the application calls SSL_free() on the failed connection in a timely
+ manner then the 21Mb of allocated memory will then be immediately freed
+ again. Therefore the excessive memory allocation will be transitory in
+ nature. This then means that there is only a security impact if:
+
+ 1) The application does not call SSL_free() in a timely manner in the event
+ that the connection fails
+ or
+ 2) The application is working in a constrained environment where there is
+ very little free memory
+ or
+ 3) The attacker initiates multiple connection attempts such that there are
+ multiple connections in a state where memory has been allocated for the
+ connection; SSL_free() has not yet been called; and there is insufficient
+ memory to service the multiple requests.
+
+ Except in the instance of (1) above any Denial Of Service is likely to be
+ transitory because as soon as the connection fails the memory is
+ subsequently freed again in the SSL_free() call. However there is an
+ increased risk during this period of application crashes due to the lack of
+ memory - which would then mean a more serious Denial of Service.
+
+ This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.)
+ (CVE-2016-6307 and CVE-2016-6308)
+ [Matt Caswell]
+
+ *) solaris-x86-cc, i.e. 32-bit configuration with vendor compiler,
+ had to be removed. Primary reason is that vendor assembler can't
+ assemble our modules with -KPIC flag. As result it, assembly
+ support, was not even available as option. But its lack means
+ lack of side-channel resistant code, which is incompatible with
+ security by todays standards. Fortunately gcc is readily available
+ prepackaged option, which we firmly point at...
+ [Andy Polyakov]
+
+ Changes between 1.0.2h and 1.1.0 [25 Aug 2016]
+
+ *) Windows command-line tool supports UTF-8 opt-in option for arguments
+ and console input. Setting OPENSSL_WIN32_UTF8 environment variable
+ (to any value) allows Windows user to access PKCS#12 file generated
+ with Windows CryptoAPI and protected with non-ASCII password, as well
+ as files generated under UTF-8 locale on Linux also protected with
+ non-ASCII password.
+ [Andy Polyakov]
+
+ *) To mitigate the SWEET32 attack (CVE-2016-2183), 3DES cipher suites
+ have been disabled by default and removed from DEFAULT, just like RC4.
+ See the RC4 item below to re-enable both.
+ [Rich Salz]
+
+ *) The method for finding the storage location for the Windows RAND seed file
+ has changed. First we check %RANDFILE%. If that is not set then we check
+ the directories %HOME%, %USERPROFILE% and %SYSTEMROOT% in that order. If
+ all else fails we fall back to C:\.
+ [Matt Caswell]
+
+ *) The EVP_EncryptUpdate() function has had its return type changed from void
+ to int. A return of 0 indicates and error while a return of 1 indicates
+ success.
+ [Matt Caswell]
+
+ *) The flags RSA_FLAG_NO_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME and
+ DH_FLAG_NO_EXP_CONSTTIME which previously provided the ability to switch
+ off the constant time implementation for RSA, DSA and DH have been made
+ no-ops and deprecated.
+ [Matt Caswell]
+
+ *) Windows RAND implementation was simplified to only get entropy by
+ calling CryptGenRandom(). Various other RAND-related tickets
+ were also closed.
+ [Joseph Wylie Yandle, Rich Salz]
+
+ *) The stack and lhash API's were renamed to start with OPENSSL_SK_
+ and OPENSSL_LH_, respectively. The old names are available
+ with API compatibility. They new names are now completely documented.
+ [Rich Salz]
+
+ *) Unify TYPE_up_ref(obj) methods signature.
+ SSL_CTX_up_ref(), SSL_up_ref(), X509_up_ref(), EVP_PKEY_up_ref(),
+ X509_CRL_up_ref(), X509_OBJECT_up_ref_count() methods are now returning an
+ int (instead of void) like all others TYPE_up_ref() methods.
+ So now these methods also check the return value of CRYPTO_atomic_add(),
+ and the validity of object reference counter.
+ [fdasilvayy@gmail.com]
+
+ *) With Windows Visual Studio builds, the .pdb files are installed
+ alongside the installed libraries and executables. For a static
+ library installation, ossl_static.pdb is the associate compiler
+ generated .pdb file to be used when linking programs.
+ [Richard Levitte]
+
+ *) Remove openssl.spec. Packaging files belong with the packagers.
+ [Richard Levitte]
+
+ *) Automatic Darwin/OSX configuration has had a refresh, it will now
+ recognise x86_64 architectures automatically. You can still decide
+ to build for a different bitness with the environment variable
+ KERNEL_BITS (can be 32 or 64), for example:
+
+ KERNEL_BITS=32 ./config
+
+ [Richard Levitte]
+
+ *) Change default algorithms in pkcs8 utility to use PKCS#5 v2.0,
+ 256 bit AES and HMAC with SHA256.
+ [Steve Henson]
+
+ *) Remove support for MIPS o32 ABI on IRIX (and IRIX only).
+ [Andy Polyakov]
+
+ *) Triple-DES ciphers have been moved from HIGH to MEDIUM.
+ [Rich Salz]
+
+ *) To enable users to have their own config files and build file templates,
+ Configure looks in the directory indicated by the environment variable
+ OPENSSL_LOCAL_CONFIG_DIR as well as the in-source Configurations/
+ directory. On VMS, OPENSSL_LOCAL_CONFIG_DIR is expected to be a logical
+ name and is used as is.
+ [Richard Levitte]
+
+ *) The following datatypes were made opaque: X509_OBJECT, X509_STORE_CTX,
+ X509_STORE, X509_LOOKUP, and X509_LOOKUP_METHOD. The unused type
+ X509_CERT_FILE_CTX was removed.
+ [Rich Salz]
+
+ *) "shared" builds are now the default. To create only static libraries use
+ the "no-shared" Configure option.
+ [Matt Caswell]
+
+ *) Remove the no-aes, no-hmac, no-rsa, no-sha and no-md5 Configure options.
+ All of these option have not worked for some while and are fundamental
+ algorithms.
+ [Matt Caswell]
+
+ *) Make various cleanup routines no-ops and mark them as deprecated. Most
+ global cleanup functions are no longer required because they are handled
+ via auto-deinit (see OPENSSL_init_crypto and OPENSSL_init_ssl man pages).
+ Explicitly de-initing can cause problems (e.g. where a library that uses
+ OpenSSL de-inits, but an application is still using it). The affected
+ functions are CONF_modules_free(), ENGINE_cleanup(), OBJ_cleanup(),
+ EVP_cleanup(), BIO_sock_cleanup(), CRYPTO_cleanup_all_ex_data(),
+ RAND_cleanup(), SSL_COMP_free_compression_methods(), ERR_free_strings() and
+ COMP_zlib_cleanup().
+ [Matt Caswell]
+
+ *) --strict-warnings no longer enables runtime debugging options
+ such as REF_DEBUG. Instead, debug options are automatically
+ enabled with '--debug' builds.
+ [Andy Polyakov, Emilia Käsper]
+
+ *) Made DH and DH_METHOD opaque. The structures for managing DH objects
+ have been moved out of the public header files. New functions for managing
+ these have been added.
+ [Matt Caswell]
+
+ *) Made RSA and RSA_METHOD opaque. The structures for managing RSA
+ objects have been moved out of the public header files. New
+ functions for managing these have been added.
+ [Richard Levitte]
+
+ *) Made DSA and DSA_METHOD opaque. The structures for managing DSA objects
+ have been moved out of the public header files. New functions for managing
+ these have been added.
+ [Matt Caswell]
+
+ *) Made BIO and BIO_METHOD opaque. The structures for managing BIOs have been
+ moved out of the public header files. New functions for managing these
+ have been added.
+ [Matt Caswell]
+
+ *) Removed no-rijndael as a config option. Rijndael is an old name for AES.
+ [Matt Caswell]
+
+ *) Removed the mk1mf build scripts.
+ [Richard Levitte]
+
+ *) Headers are now wrapped, if necessary, with OPENSSL_NO_xxx, so
+ it is always safe to #include a header now.
+ [Rich Salz]
+
+ *) Removed the aged BC-32 config and all its supporting scripts
+ [Richard Levitte]
+
+ *) Removed support for Ultrix, Netware, and OS/2.
+ [Rich Salz]
+
+ *) Add support for HKDF.
+ [Alessandro Ghedini]
+
+ *) Add support for blake2b and blake2s
+ [Bill Cox]
+
+ *) Added support for "pipelining". Ciphers that have the
+ EVP_CIPH_FLAG_PIPELINE flag set have a capability to process multiple
+ encryptions/decryptions simultaneously. There are currently no built-in
+ ciphers with this property but the expectation is that engines will be able
+ to offer it to significantly improve throughput. Support has been extended
+ into libssl so that multiple records for a single connection can be
+ processed in one go (for >=TLS 1.1).
+ [Matt Caswell]
+
+ *) Added the AFALG engine. This is an async capable engine which is able to
+ offload work to the Linux kernel. In this initial version it only supports
+ AES128-CBC. The kernel must be version 4.1.0 or greater.
+ [Catriona Lucey]
+
+ *) OpenSSL now uses a new threading API. It is no longer necessary to
+ set locking callbacks to use OpenSSL in a multi-threaded environment. There
+ are two supported threading models: pthreads and windows threads. It is
+ also possible to configure OpenSSL at compile time for "no-threads". The
+ old threading API should no longer be used. The functions have been
+ replaced with "no-op" compatibility macros.
+ [Alessandro Ghedini, Matt Caswell]
+
+ *) Modify behavior of ALPN to invoke callback after SNI/servername
+ callback, such that updates to the SSL_CTX affect ALPN.
+ [Todd Short]
+
+ *) Add SSL_CIPHER queries for authentication and key-exchange.
+ [Todd Short]
+
+ *) Changes to the DEFAULT cipherlist:
+ - Prefer (EC)DHE handshakes over plain RSA.
+ - Prefer AEAD ciphers over legacy ciphers.
+ - Prefer ECDSA over RSA when both certificates are available.
+ - Prefer TLSv1.2 ciphers/PRF.
+ - Remove DSS, SEED, IDEA, CAMELLIA, and AES-CCM from the
+ default cipherlist.
+ [Emilia Käsper]
+
+ *) Change the ECC default curve list to be this, in order: x25519,
+ secp256r1, secp521r1, secp384r1.
+ [Rich Salz]
+
+ *) RC4 based libssl ciphersuites are now classed as "weak" ciphers and are
+ disabled by default. They can be re-enabled using the
+ enable-weak-ssl-ciphers option to Configure.
+ [Matt Caswell]
+
+ *) If the server has ALPN configured, but supports no protocols that the
+ client advertises, send a fatal "no_application_protocol" alert.
+ This behaviour is SHALL in RFC 7301, though it isn't universally
+ implemented by other servers.
+ [Emilia Käsper]
+
+ *) Add X25519 support.
+ Add ASN.1 and EVP_PKEY methods for X25519. This includes support
+ for public and private key encoding using the format documented in
+ draft-ietf-curdle-pkix-02. The corresponding EVP_PKEY method supports
+ key generation and key derivation.
+
+ TLS support complies with draft-ietf-tls-rfc4492bis-08 and uses
+ X25519(29).
+ [Steve Henson]
+
+ *) Deprecate SRP_VBASE_get_by_user.
+ SRP_VBASE_get_by_user had inconsistent memory management behaviour.
+ In order to fix an unavoidable memory leak (CVE-2016-0798),
+ SRP_VBASE_get_by_user was changed to ignore the "fake user" SRP
+ seed, even if the seed is configured.
+
+ Users should use SRP_VBASE_get1_by_user instead. Note that in
+ SRP_VBASE_get1_by_user, caller must free the returned value. Note
+ also that even though configuring the SRP seed attempts to hide
+ invalid usernames by continuing the handshake with fake
+ credentials, this behaviour is not constant time and no strong
+ guarantees are made that the handshake is indistinguishable from
+ that of a valid user.
+ [Emilia Käsper]
+
+ *) Configuration change; it's now possible to build dynamic engines
+ without having to build shared libraries and vice versa. This
+ only applies to the engines in engines/, those in crypto/engine/
+ will always be built into libcrypto (i.e. "static").
+
+ Building dynamic engines is enabled by default; to disable, use
+ the configuration option "disable-dynamic-engine".
+
+ The only requirements for building dynamic engines are the
+ presence of the DSO module and building with position independent
+ code, so they will also automatically be disabled if configuring
+ with "disable-dso" or "disable-pic".
+
+ The macros OPENSSL_NO_STATIC_ENGINE and OPENSSL_NO_DYNAMIC_ENGINE
+ are also taken away from openssl/opensslconf.h, as they are
+ irrelevant.
+ [Richard Levitte]
+
+ *) Configuration change; if there is a known flag to compile
+ position independent code, it will always be applied on the
+ libcrypto and libssl object files, and never on the application
+ object files. This means other libraries that use routines from
+ libcrypto / libssl can be made into shared libraries regardless
+ of how OpenSSL was configured.
+
+ If this isn't desirable, the configuration options "disable-pic"
+ or "no-pic" can be used to disable the use of PIC. This will
+ also disable building shared libraries and dynamic engines.
+ [Richard Levitte]
+
+ *) Removed JPAKE code. It was experimental and has no wide use.
+ [Rich Salz]
+
+ *) The INSTALL_PREFIX Makefile variable has been renamed to
+ DESTDIR. That makes for less confusion on what this variable
+ is for. Also, the configuration option --install_prefix is
+ removed.
+ [Richard Levitte]
+
+ *) Heartbeat for TLS has been removed and is disabled by default
+ for DTLS; configure with enable-heartbeats. Code that uses the
+ old #define's might need to be updated.
+ [Emilia Käsper, Rich Salz]
+
+ *) Rename REF_CHECK to REF_DEBUG.
+ [Rich Salz]
+
+ *) New "unified" build system
+
+ The "unified" build system is aimed to be a common system for all
+ platforms we support. With it comes new support for VMS.
+
+ This system builds supports building in a different directory tree
+ than the source tree. It produces one Makefile (for unix family
+ or lookalikes), or one descrip.mms (for VMS).
+
+ The source of information to make the Makefile / descrip.mms is
+ small files called 'build.info', holding the necessary
+ information for each directory with source to compile, and a
+ template in Configurations, like unix-Makefile.tmpl or
+ descrip.mms.tmpl.
+
+ With this change, the library names were also renamed on Windows
+ and on VMS. They now have names that are closer to the standard
+ on Unix, and include the major version number, and in certain
+ cases, the architecture they are built for. See "Notes on shared
+ libraries" in INSTALL.
+
+ We rely heavily on the perl module Text::Template.
+ [Richard Levitte]
+
+ *) Added support for auto-initialisation and de-initialisation of the library.
+ OpenSSL no longer requires explicit init or deinit routines to be called,
+ except in certain circumstances. See the OPENSSL_init_crypto() and
+ OPENSSL_init_ssl() man pages for further information.
+ [Matt Caswell]
+
+ *) The arguments to the DTLSv1_listen function have changed. Specifically the
+ "peer" argument is now expected to be a BIO_ADDR object.
+
+ *) Rewrite of BIO networking library. The BIO library lacked consistent
+ support of IPv6, and adding it required some more extensive
+ modifications. This introduces the BIO_ADDR and BIO_ADDRINFO types,
+ which hold all types of addresses and chains of address information.
+ It also introduces a new API, with functions like BIO_socket,
+ BIO_connect, BIO_listen, BIO_lookup and a rewrite of BIO_accept.
+ The source/sink BIOs BIO_s_connect, BIO_s_accept and BIO_s_datagram
+ have been adapted accordingly.
+ [Richard Levitte]
+
+ *) RSA_padding_check_PKCS1_type_1 now accepts inputs with and without
+ the leading 0-byte.
+ [Emilia Käsper]
+
+ *) CRIME protection: disable compression by default, even if OpenSSL is
+ compiled with zlib enabled. Applications can still enable compression
+ by calling SSL_CTX_clear_options(ctx, SSL_OP_NO_COMPRESSION), or by
+ using the SSL_CONF library to configure compression.
+ [Emilia Käsper]
+
+ *) The signature of the session callback configured with
+ SSL_CTX_sess_set_get_cb was changed. The read-only input buffer
+ was explicitly marked as 'const unsigned char*' instead of
+ 'unsigned char*'.
+ [Emilia Käsper]
+
+ *) Always DPURIFY. Remove the use of uninitialized memory in the
+ RNG, and other conditional uses of DPURIFY. This makes -DPURIFY a no-op.
+ [Emilia Käsper]
+
+ *) Removed many obsolete configuration items, including
+ DES_PTR, DES_RISC1, DES_RISC2, DES_INT
+ MD2_CHAR, MD2_INT, MD2_LONG
+ BF_PTR, BF_PTR2
+ IDEA_SHORT, IDEA_LONG
+ RC2_SHORT, RC2_LONG, RC4_LONG, RC4_CHUNK, RC4_INDEX
+ [Rich Salz, with advice from Andy Polyakov]
+
+ *) Many BN internals have been moved to an internal header file.
+ [Rich Salz with help from Andy Polyakov]
+
+ *) Configuration and writing out the results from it has changed.
+ Files such as Makefile include/openssl/opensslconf.h and are now
+ produced through general templates, such as Makefile.in and
+ crypto/opensslconf.h.in and some help from the perl module
+ Text::Template.
+
+ Also, the center of configuration information is no longer
+ Makefile. Instead, Configure produces a perl module in
+ configdata.pm which holds most of the config data (in the hash
+ table %config), the target data that comes from the target
+ configuration in one of the Configurations/*.conf files (in
+ %target).
+ [Richard Levitte]
+
+ *) To clarify their intended purposes, the Configure options
+ --prefix and --openssldir change their semantics, and become more
+ straightforward and less interdependent.
+
+ --prefix shall be used exclusively to give the location INSTALLTOP
+ where programs, scripts, libraries, include files and manuals are
+ going to be installed. The default is now /usr/local.
+
+ --openssldir shall be used exclusively to give the default
+ location OPENSSLDIR where certificates, private keys, CRLs are
+ managed. This is also where the default openssl.cnf gets
+ installed.
+ If the directory given with this option is a relative path, the
+ values of both the --prefix value and the --openssldir value will
+ be combined to become OPENSSLDIR.
+ The default for --openssldir is INSTALLTOP/ssl.
+
+ Anyone who uses --openssldir to specify where OpenSSL is to be
+ installed MUST change to use --prefix instead.
+ [Richard Levitte]
+
+ *) The GOST engine was out of date and therefore it has been removed. An up
+ to date GOST engine is now being maintained in an external repository.
+ See: https://wiki.openssl.org/index.php/Binaries. Libssl still retains
+ support for GOST ciphersuites (these are only activated if a GOST engine
+ is present).
+ [Matt Caswell]
+
+ *) EGD is no longer supported by default; use enable-egd when
+ configuring.
+ [Ben Kaduk and Rich Salz]
+
+ *) The distribution now has Makefile.in files, which are used to
+ create Makefile's when Configure is run. *Configure must be run
+ before trying to build now.*
+ [Rich Salz]
+
+ *) The return value for SSL_CIPHER_description() for error conditions
+ has changed.
+ [Rich Salz]
+
+ *) Support for RFC6698/RFC7671 DANE TLSA peer authentication.
+
+ Obtaining and performing DNSSEC validation of TLSA records is
+ the application's responsibility. The application provides
+ the TLSA records of its choice to OpenSSL, and these are then
+ used to authenticate the peer.
+
+ The TLSA records need not even come from DNS. They can, for
+ example, be used to implement local end-entity certificate or
+ trust-anchor "pinning", where the "pin" data takes the form
+ of TLSA records, which can augment or replace verification
+ based on the usual WebPKI public certification authorities.
+ [Viktor Dukhovni]
+
+ *) Revert default OPENSSL_NO_DEPRECATED setting. Instead OpenSSL
+ continues to support deprecated interfaces in default builds.
+ However, applications are strongly advised to compile their
+ source files with -DOPENSSL_API_COMPAT=0x10100000L, which hides
+ the declarations of all interfaces deprecated in 0.9.8, 1.0.0
+ or the 1.1.0 releases.
+
+ In environments in which all applications have been ported to
+ not use any deprecated interfaces OpenSSL's Configure script
+ should be used with the --api=1.1.0 option to entirely remove
+ support for the deprecated features from the library and
+ unconditionally disable them in the installed headers.
+ Essentially the same effect can be achieved with the "no-deprecated"
+ argument to Configure, except that this will always restrict
+ the build to just the latest API, rather than a fixed API
+ version.
+
+ As applications are ported to future revisions of the API,
+ they should update their compile-time OPENSSL_API_COMPAT define
+ accordingly, but in most cases should be able to continue to
+ compile with later releases.
+
+ The OPENSSL_API_COMPAT versions for 1.0.0, and 0.9.8 are
+ 0x10000000L and 0x00908000L, respectively. However those
+ versions did not support the OPENSSL_API_COMPAT feature, and
+ so applications are not typically tested for explicit support
+ of just the undeprecated features of either release.
+ [Viktor Dukhovni]
+
+ *) Add support for setting the minimum and maximum supported protocol.
+ It can bet set via the SSL_set_min_proto_version() and
+ SSL_set_max_proto_version(), or via the SSL_CONF's MinProtocol and
+ MaxProtcol. It's recommended to use the new APIs to disable
+ protocols instead of disabling individual protocols using
+ SSL_set_options() or SSL_CONF's Protocol. This change also
+ removes support for disabling TLS 1.2 in the OpenSSL TLS
+ client at compile time by defining OPENSSL_NO_TLS1_2_CLIENT.
+ [Kurt Roeckx]
+
+ *) Support for ChaCha20 and Poly1305 added to libcrypto and libssl.
+ [Andy Polyakov]
+
+ *) New EC_KEY_METHOD, this replaces the older ECDSA_METHOD and ECDH_METHOD
+ and integrates ECDSA and ECDH functionality into EC. Implementations can
+ now redirect key generation and no longer need to convert to or from
+ ECDSA_SIG format.
+
+ Note: the ecdsa.h and ecdh.h headers are now no longer needed and just
+ include the ec.h header file instead.
+ [Steve Henson]
+
+ *) Remove support for all 40 and 56 bit ciphers. This includes all the export
+ ciphers who are no longer supported and drops support the ephemeral RSA key
+ exchange. The LOW ciphers currently doesn't have any ciphers in it.
+ [Kurt Roeckx]
+
+ *) Made EVP_MD_CTX, EVP_MD, EVP_CIPHER_CTX, EVP_CIPHER and HMAC_CTX
+ opaque. For HMAC_CTX, the following constructors and destructors
+ were added:
+
+ HMAC_CTX *HMAC_CTX_new(void);
+ void HMAC_CTX_free(HMAC_CTX *ctx);
+
+ For EVP_MD and EVP_CIPHER, complete APIs to create, fill and
+ destroy such methods has been added. See EVP_MD_meth_new(3) and
+ EVP_CIPHER_meth_new(3) for documentation.
+
+ Additional changes:
+ 1) EVP_MD_CTX_cleanup(), EVP_CIPHER_CTX_cleanup() and
+ HMAC_CTX_cleanup() were removed. HMAC_CTX_reset() and
+ EVP_MD_CTX_reset() should be called instead to reinitialise
+ an already created structure.
+ 2) For consistency with the majority of our object creators and
+ destructors, EVP_MD_CTX_(create|destroy) were renamed to
+ EVP_MD_CTX_(new|free). The old names are retained as macros
+ for deprecated builds.
+ [Richard Levitte]
+
+ *) Added ASYNC support. Libcrypto now includes the async sub-library to enable
+ cryptographic operations to be performed asynchronously as long as an
+ asynchronous capable engine is used. See the ASYNC_start_job() man page for
+ further details. Libssl has also had this capability integrated with the
+ introduction of the new mode SSL_MODE_ASYNC and associated error
+ SSL_ERROR_WANT_ASYNC. See the SSL_CTX_set_mode() and SSL_get_error() man
+ pages. This work was developed in partnership with Intel Corp.
+ [Matt Caswell]
+
+ *) SSL_{CTX_}set_ecdh_auto() has been removed and ECDH is support is
+ always enabled now. If you want to disable the support you should
+ exclude it using the list of supported ciphers. This also means that the
+ "-no_ecdhe" option has been removed from s_server.
+ [Kurt Roeckx]
+
+ *) SSL_{CTX}_set_tmp_ecdh() which can set 1 EC curve now internally calls
+ SSL_{CTX_}set1_curves() which can set a list.
+ [Kurt Roeckx]
+
+ *) Remove support for SSL_{CTX_}set_tmp_ecdh_callback(). You should set the
+ curve you want to support using SSL_{CTX_}set1_curves().
+ [Kurt Roeckx]
+
+ *) State machine rewrite. The state machine code has been significantly
+ refactored in order to remove much duplication of code and solve issues
+ with the old code (see ssl/statem/README for further details). This change
+ does have some associated API changes. Notably the SSL_state() function
+ has been removed and replaced by SSL_get_state which now returns an
+ "OSSL_HANDSHAKE_STATE" instead of an int. SSL_set_state() has been removed
+ altogether. The previous handshake states defined in ssl.h and ssl3.h have
+ also been removed.
+ [Matt Caswell]
+
+ *) All instances of the string "ssleay" in the public API were replaced
+ with OpenSSL (case-matching; e.g., OPENSSL_VERSION for #define's)
+ Some error codes related to internal RSA_eay API's were renamed.
+ [Rich Salz]
+
+ *) The demo files in crypto/threads were moved to demo/threads.
+ [Rich Salz]
+
+ *) Removed obsolete engines: 4758cca, aep, atalla, cswift, nuron, gmp,
+ sureware and ubsec.
+ [Matt Caswell, Rich Salz]
+
+ *) New ASN.1 embed macro.
+
+ New ASN.1 macro ASN1_EMBED. This is the same as ASN1_SIMPLE except the
+ structure is not allocated: it is part of the parent. That is instead of
+
+ FOO *x;
+
+ it must be:
+
+ FOO x;
+
+ This reduces memory fragmentation and make it impossible to accidentally
+ set a mandatory field to NULL.
+
+ This currently only works for some fields specifically a SEQUENCE, CHOICE,
+ or ASN1_STRING type which is part of a parent SEQUENCE. Since it is
+ equivalent to ASN1_SIMPLE it cannot be tagged, OPTIONAL, SET OF or
+ SEQUENCE OF.
+ [Steve Henson]
+
+ *) Remove EVP_CHECK_DES_KEY, a compile-time option that never compiled.
+ [Emilia Käsper]
+
+ *) Removed DES and RC4 ciphersuites from DEFAULT. Also removed RC2 although
+ in 1.0.2 EXPORT was already removed and the only RC2 ciphersuite is also
+ an EXPORT one. COMPLEMENTOFDEFAULT has been updated accordingly to add
+ DES and RC4 ciphersuites.
+ [Matt Caswell]
+
+ *) Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs.
+ This changes the decoding behaviour for some invalid messages,
+ though the change is mostly in the more lenient direction, and
+ legacy behaviour is preserved as much as possible.
+ [Emilia Käsper]
+
+ *) Fix no-stdio build.
+ [ David Woodhouse <David.Woodhouse@intel.com> and also
+ Ivan Nestlerode <ivan.nestlerode@sonos.com> ]
+
+ *) New testing framework
+ The testing framework has been largely rewritten and is now using
+ perl and the perl modules Test::Harness and an extended variant of
+ Test::More called OpenSSL::Test to do its work. All test scripts in
+ test/ have been rewritten into test recipes, and all direct calls to
+ executables in test/Makefile have become individual recipes using the
+ simplified testing OpenSSL::Test::Simple.
+
+ For documentation on our testing modules, do:
+
+ perldoc test/testlib/OpenSSL/Test/Simple.pm
+ perldoc test/testlib/OpenSSL/Test.pm
+
+ [Richard Levitte]
+
+ *) Revamped memory debug; only -DCRYPTO_MDEBUG and -DCRYPTO_MDEBUG_ABORT
+ are used; the latter aborts on memory leaks (usually checked on exit).
+ Some undocumented "set malloc, etc., hooks" functions were removed
+ and others were changed. All are now documented.
+ [Rich Salz]
+
+ *) In DSA_generate_parameters_ex, if the provided seed is too short,
+ return an error
+ [Rich Salz and Ismo Puustinen <ismo.puustinen@intel.com>]
+
+ *) Rewrite PSK to support ECDHE_PSK, DHE_PSK and RSA_PSK. Add ciphersuites
+ from RFC4279, RFC4785, RFC5487, RFC5489.
+
+ Thanks to Christian J. Dietrich and Giuseppe D'Angelo for the
+ original RSA_PSK patch.
+ [Steve Henson]
+
+ *) Dropped support for the SSL3_FLAGS_DELAY_CLIENT_FINISHED flag. This SSLeay
+ era flag was never set throughout the codebase (only read). Also removed
+ SSL3_FLAGS_POP_BUFFER which was only used if
+ SSL3_FLAGS_DELAY_CLIENT_FINISHED was also set.
+ [Matt Caswell]
+
+ *) Changed the default name options in the "ca", "crl", "req" and "x509"
+ to be "oneline" instead of "compat".
+ [Richard Levitte]
+
+ *) Remove SSL_OP_TLS_BLOCK_PADDING_BUG. This is SSLeay legacy, we're
+ not aware of clients that still exhibit this bug, and the workaround
+ hasn't been working properly for a while.
+ [Emilia Käsper]
+
+ *) The return type of BIO_number_read() and BIO_number_written() as well as
+ the corresponding num_read and num_write members in the BIO structure has
+ changed from unsigned long to uint64_t. On platforms where an unsigned
+ long is 32 bits (e.g. Windows) these counters could overflow if >4Gb is
+ transferred.
+ [Matt Caswell]
+
+ *) Given the pervasive nature of TLS extensions it is inadvisable to run
+ OpenSSL without support for them. It also means that maintaining
+ the OPENSSL_NO_TLSEXT option within the code is very invasive (and probably
+ not well tested). Therefore the OPENSSL_NO_TLSEXT option has been removed.
+ [Matt Caswell]
+
+ *) Removed support for the two export grade static DH ciphersuites
+ EXP-DH-RSA-DES-CBC-SHA and EXP-DH-DSS-DES-CBC-SHA. These two ciphersuites
+ were newly added (along with a number of other static DH ciphersuites) to
+ 1.0.2. However the two export ones have *never* worked since they were
+ introduced. It seems strange in any case to be adding new export
+ ciphersuites, and given "logjam" it also does not seem correct to fix them.
+ [Matt Caswell]
+
+ *) Version negotiation has been rewritten. In particular SSLv23_method(),
+ SSLv23_client_method() and SSLv23_server_method() have been deprecated,
+ and turned into macros which simply call the new preferred function names
+ TLS_method(), TLS_client_method() and TLS_server_method(). All new code
+ should use the new names instead. Also as part of this change the ssl23.h
+ header file has been removed.
+ [Matt Caswell]
+
+ *) Support for Kerberos ciphersuites in TLS (RFC2712) has been removed. This
+ code and the associated standard is no longer considered fit-for-purpose.
+ [Matt Caswell]
+
+ *) RT2547 was closed. When generating a private key, try to make the
+ output file readable only by the owner. This behavior change might
+ be noticeable when interacting with other software.
+
+ *) Documented all exdata functions. Added CRYPTO_free_ex_index.
+ Added a test.
+ [Rich Salz]
+
+ *) Added HTTP GET support to the ocsp command.
+ [Rich Salz]
+
+ *) Changed default digest for the dgst and enc commands from MD5 to
+ sha256
+ [Rich Salz]
+
+ *) RAND_pseudo_bytes has been deprecated. Users should use RAND_bytes instead.
+ [Matt Caswell]
+
+ *) Added support for TLS extended master secret from
+ draft-ietf-tls-session-hash-03.txt. Thanks for Alfredo Pironti for an
+ initial patch which was a great help during development.
+ [Steve Henson]
+
+ *) All libssl internal structures have been removed from the public header
+ files, and the OPENSSL_NO_SSL_INTERN option has been removed (since it is
+ now redundant). Users should not attempt to access internal structures
+ directly. Instead they should use the provided API functions.
+ [Matt Caswell]
+
+ *) config has been changed so that by default OPENSSL_NO_DEPRECATED is used.
+ Access to deprecated functions can be re-enabled by running config with
+ "enable-deprecated". In addition applications wishing to use deprecated
+ functions must define OPENSSL_USE_DEPRECATED. Note that this new behaviour
+ will, by default, disable some transitive includes that previously existed
+ in the header files (e.g. ec.h will no longer, by default, include bn.h)
+ [Matt Caswell]
+
+ *) Added support for OCB mode. OpenSSL has been granted a patent license
+ compatible with the OpenSSL license for use of OCB. Details are available
+ at https://www.openssl.org/source/OCB-patent-grant-OpenSSL.pdf. Support
+ for OCB can be removed by calling config with no-ocb.
+ [Matt Caswell]
+
+ *) SSLv2 support has been removed. It still supports receiving a SSLv2
+ compatible client hello.
+ [Kurt Roeckx]
+
+ *) Increased the minimal RSA keysize from 256 to 512 bits [Rich Salz],
+ done while fixing the error code for the key-too-small case.
+ [Annie Yousar <a.yousar@informatik.hu-berlin.de>]
+
+ *) CA.sh has been removed; use CA.pl instead.
+ [Rich Salz]
+
+ *) Removed old DES API.
+ [Rich Salz]
+
+ *) Remove various unsupported platforms:
+ Sony NEWS4
+ BEOS and BEOS_R5
+ NeXT
+ SUNOS
+ MPE/iX
+ Sinix/ReliantUNIX RM400
+ DGUX
+ NCR
+ Tandem
+ Cray
+ 16-bit platforms such as WIN16
+ [Rich Salz]
+
+ *) Clean up OPENSSL_NO_xxx #define's
+ Use setbuf() and remove OPENSSL_NO_SETVBUF_IONBF
+ Rename OPENSSL_SYSNAME_xxx to OPENSSL_SYS_xxx
+ OPENSSL_NO_EC{DH,DSA} merged into OPENSSL_NO_EC
+ OPENSSL_NO_RIPEMD160, OPENSSL_NO_RIPEMD merged into OPENSSL_NO_RMD160
+ OPENSSL_NO_FP_API merged into OPENSSL_NO_STDIO
+ Remove OPENSSL_NO_BIO OPENSSL_NO_BUFFER OPENSSL_NO_CHAIN_VERIFY
+ OPENSSL_NO_EVP OPENSSL_NO_FIPS_ERR OPENSSL_NO_HASH_COMP
+ OPENSSL_NO_LHASH OPENSSL_NO_OBJECT OPENSSL_NO_SPEED OPENSSL_NO_STACK
+ OPENSSL_NO_X509 OPENSSL_NO_X509_VERIFY
+ Remove MS_STATIC; it's a relic from platforms <32 bits.
+ [Rich Salz]
+
+ *) Cleaned up dead code
+ Remove all but one '#ifdef undef' which is to be looked at.
+ [Rich Salz]
+
+ *) Clean up calling of xxx_free routines.
+ Just like free(), fix most of the xxx_free routines to accept
+ NULL. Remove the non-null checks from callers. Save much code.
+ [Rich Salz]
+
+ *) Add secure heap for storage of private keys (when possible).
+ Add BIO_s_secmem(), CBIGNUM, etc.
+ Contributed by Akamai Technologies under our Corporate CLA.
+ [Rich Salz]
+
+ *) Experimental support for a new, fast, unbiased prime candidate generator,
+ bn_probable_prime_dh_coprime(). Not currently used by any prime generator.
+ [Felix Laurie von Massenbach <felix@erbridge.co.uk>]
+
+ *) New output format NSS in the sess_id command line tool. This allows
+ exporting the session id and the master key in NSS keylog format.
+ [Martin Kaiser <martin@kaiser.cx>]
+
+ *) Harmonize version and its documentation. -f flag is used to display
+ compilation flags.
+ [mancha <mancha1@zoho.com>]
+
+ *) Fix eckey_priv_encode so it immediately returns an error upon a failure
+ in i2d_ECPrivateKey. Thanks to Ted Unangst for feedback on this issue.
+ [mancha <mancha1@zoho.com>]
+
+ *) Fix some double frees. These are not thought to be exploitable.
+ [mancha <mancha1@zoho.com>]
+
+ *) A missing bounds check in the handling of the TLS heartbeat extension
+ can be used to reveal up to 64k of memory to a connected client or
+ server.
+
+ Thanks for Neel Mehta of Google Security for discovering this bug and to
+ Adam Langley <agl@chromium.org> and Bodo Moeller <bmoeller@acm.org> for
+ preparing the fix (CVE-2014-0160)
+ [Adam Langley, Bodo Moeller]
+
+ *) Fix for the attack described in the paper "Recovering OpenSSL
+ ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
+ by Yuval Yarom and Naomi Benger. Details can be obtained from:
+ http://eprint.iacr.org/2014/140
+
+ Thanks to Yuval Yarom and Naomi Benger for discovering this
+ flaw and to Yuval Yarom for supplying a fix (CVE-2014-0076)
+ [Yuval Yarom and Naomi Benger]
+
+ *) Use algorithm specific chains in SSL_CTX_use_certificate_chain_file():
+ this fixes a limitation in previous versions of OpenSSL.
+ [Steve Henson]
+
+ *) Experimental encrypt-then-mac support.
+
+ Experimental support for encrypt then mac from
+ draft-gutmann-tls-encrypt-then-mac-02.txt
+
+ To enable it set the appropriate extension number (0x42 for the test
+ server) using e.g. -DTLSEXT_TYPE_encrypt_then_mac=0x42
+
+ For non-compliant peers (i.e. just about everything) this should have no
+ effect.
+
+ WARNING: EXPERIMENTAL, SUBJECT TO CHANGE.
+
+ [Steve Henson]
+
+ *) Add EVP support for key wrapping algorithms, to avoid problems with
+ existing code the flag EVP_CIPHER_CTX_WRAP_ALLOW has to be set in
+ the EVP_CIPHER_CTX or an error is returned. Add AES and DES3 wrap
+ algorithms and include tests cases.
+ [Steve Henson]
+
+ *) Extend CMS code to support RSA-PSS signatures and RSA-OAEP for
+ enveloped data.
+ [Steve Henson]
+
+ *) Extended RSA OAEP support via EVP_PKEY API. Options to specify digest,
+ MGF1 digest and OAEP label.
+ [Steve Henson]
+
+ *) Make openssl verify return errors.
+ [Chris Palmer <palmer@google.com> and Ben Laurie]
+
+ *) New function ASN1_TIME_diff to calculate the difference between two
+ ASN1_TIME structures or one structure and the current time.
+ [Steve Henson]
+
+ *) Update fips_test_suite to support multiple command line options. New
+ test to induce all self test errors in sequence and check expected
+ failures.
+ [Steve Henson]
+
+ *) Add FIPS_{rsa,dsa,ecdsa}_{sign,verify} functions which digest and
+ sign or verify all in one operation.
+ [Steve Henson]
+
+ *) Add fips_algvs: a multicall fips utility incorporating all the algorithm
+ test programs and fips_test_suite. Includes functionality to parse
+ the minimal script output of fipsalgest.pl directly.
+ [Steve Henson]
+
+ *) Add authorisation parameter to FIPS_module_mode_set().
+ [Steve Henson]
+
+ *) Add FIPS selftest for ECDH algorithm using P-224 and B-233 curves.
+ [Steve Henson]
+
+ *) Use separate DRBG fields for internal and external flags. New function
+ FIPS_drbg_health_check() to perform on demand health checking. Add
+ generation tests to fips_test_suite with reduced health check interval to
+ demonstrate periodic health checking. Add "nodh" option to
+ fips_test_suite to skip very slow DH test.
+ [Steve Henson]
+
+ *) New function FIPS_get_cipherbynid() to lookup FIPS supported ciphers
+ based on NID.
+ [Steve Henson]
+
+ *) More extensive health check for DRBG checking many more failure modes.
+ New function FIPS_selftest_drbg_all() to handle every possible DRBG
+ combination: call this in fips_test_suite.
+ [Steve Henson]
+
+ *) Add support for canonical generation of DSA parameter 'g'. See
+ FIPS 186-3 A.2.3.
+
+ *) Add support for HMAC DRBG from SP800-90. Update DRBG algorithm test and
+ POST to handle HMAC cases.
+ [Steve Henson]
+
+ *) Add functions FIPS_module_version() and FIPS_module_version_text()
+ to return numerical and string versions of the FIPS module number.
+ [Steve Henson]
+
+ *) Rename FIPS_mode_set and FIPS_mode to FIPS_module_mode_set and
+ FIPS_module_mode. FIPS_mode and FIPS_mode_set will be implemented
+ outside the validated module in the FIPS capable OpenSSL.
+ [Steve Henson]
+
+ *) Minor change to DRBG entropy callback semantics. In some cases
+ there is no multiple of the block length between min_len and
+ max_len. Allow the callback to return more than max_len bytes
+ of entropy but discard any extra: it is the callback's responsibility
+ to ensure that the extra data discarded does not impact the
+ requested amount of entropy.
+ [Steve Henson]
+
+ *) Add PRNG security strength checks to RSA, DSA and ECDSA using
+ information in FIPS186-3, SP800-57 and SP800-131A.
+ [Steve Henson]
+
+ *) CCM support via EVP. Interface is very similar to GCM case except we
+ must supply all data in one chunk (i.e. no update, final) and the
+ message length must be supplied if AAD is used. Add algorithm test
+ support.
+ [Steve Henson]
+
+ *) Initial version of POST overhaul. Add POST callback to allow the status
+ of POST to be monitored and/or failures induced. Modify fips_test_suite
+ to use callback. Always run all selftests even if one fails.
+ [Steve Henson]
+
+ *) XTS support including algorithm test driver in the fips_gcmtest program.
+ Note: this does increase the maximum key length from 32 to 64 bytes but
+ there should be no binary compatibility issues as existing applications
+ will never use XTS mode.
+ [Steve Henson]
+
+ *) Extensive reorganisation of FIPS PRNG behaviour. Remove all dependencies
+ to OpenSSL RAND code and replace with a tiny FIPS RAND API which also
+ performs algorithm blocking for unapproved PRNG types. Also do not
+ set PRNG type in FIPS_mode_set(): leave this to the application.
+ Add default OpenSSL DRBG handling: sets up FIPS PRNG and seeds with
+ the standard OpenSSL PRNG: set additional data to a date time vector.
+ [Steve Henson]
+
+ *) Rename old X9.31 PRNG functions of the form FIPS_rand* to FIPS_x931*.
+ This shouldn't present any incompatibility problems because applications
+ shouldn't be using these directly and any that are will need to rethink
+ anyway as the X9.31 PRNG is now deprecated by FIPS 140-2
+ [Steve Henson]
+
+ *) Extensive self tests and health checking required by SP800-90 DRBG.
+ Remove strength parameter from FIPS_drbg_instantiate and always
+ instantiate at maximum supported strength.
+ [Steve Henson]
+
+ *) Add ECDH code to fips module and fips_ecdhvs for primitives only testing.
+ [Steve Henson]
+
+ *) New algorithm test program fips_dhvs to handle DH primitives only testing.
+ [Steve Henson]
+
+ *) New function DH_compute_key_padded() to compute a DH key and pad with
+ leading zeroes if needed: this complies with SP800-56A et al.
+ [Steve Henson]
+
+ *) Initial implementation of SP800-90 DRBGs for Hash and CTR. Not used by
+ anything, incomplete, subject to change and largely untested at present.
+ [Steve Henson]
+
+ *) Modify fipscanisteronly build option to only build the necessary object
+ files by filtering FIPS_EX_OBJ through a perl script in crypto/Makefile.
+ [Steve Henson]
+
+ *) Add experimental option FIPSSYMS to give all symbols in
+ fipscanister.o and FIPS or fips prefix. This will avoid
+ conflicts with future versions of OpenSSL. Add perl script
+ util/fipsas.pl to preprocess assembly language source files
+ and rename any affected symbols.
+ [Steve Henson]
+
+ *) Add selftest checks and algorithm block of non-fips algorithms in
+ FIPS mode. Remove DES2 from selftests.
+ [Steve Henson]
+
+ *) Add ECDSA code to fips module. Add tiny fips_ecdsa_check to just
+ return internal method without any ENGINE dependencies. Add new
+ tiny fips sign and verify functions.
+ [Steve Henson]
+
+ *) New build option no-ec2m to disable characteristic 2 code.
+ [Steve Henson]
+
+ *) New build option "fipscanisteronly". This only builds fipscanister.o
+ and (currently) associated fips utilities. Uses the file Makefile.fips
+ instead of Makefile.org as the prototype.
+ [Steve Henson]
+
+ *) Add some FIPS mode restrictions to GCM. Add internal IV generator.
+ Update fips_gcmtest to use IV generator.
+ [Steve Henson]
+
+ *) Initial, experimental EVP support for AES-GCM. AAD can be input by
+ setting output buffer to NULL. The *Final function must be
+ called although it will not retrieve any additional data. The tag
+ can be set or retrieved with a ctrl. The IV length is by default 12
+ bytes (96 bits) but can be set to an alternative value. If the IV
+ length exceeds the maximum IV length (currently 16 bytes) it cannot be
+ set before the key.
+ [Steve Henson]
+
+ *) New flag in ciphers: EVP_CIPH_FLAG_CUSTOM_CIPHER. This means the
+ underlying do_cipher function handles all cipher semantics itself
+ including padding and finalisation. This is useful if (for example)
+ an ENGINE cipher handles block padding itself. The behaviour of
+ do_cipher is subtly changed if this flag is set: the return value
+ is the number of characters written to the output buffer (zero is
+ no longer an error code) or a negative error code. Also if the
+ input buffer is NULL and length 0 finalisation should be performed.
+ [Steve Henson]
+
+ *) If a candidate issuer certificate is already part of the constructed
+ path ignore it: new debug notification X509_V_ERR_PATH_LOOP for this case.
+ [Steve Henson]
+
+ *) Improve forward-security support: add functions
+
+ void SSL_CTX_set_not_resumable_session_callback(SSL_CTX *ctx, int (*cb)(SSL *ssl, int is_forward_secure))
+ void SSL_set_not_resumable_session_callback(SSL *ssl, int (*cb)(SSL *ssl, int is_forward_secure))
+
+ for use by SSL/TLS servers; the callback function will be called whenever a
+ new session is created, and gets to decide whether the session may be
+ cached to make it resumable (return 0) or not (return 1). (As by the
+ SSL/TLS protocol specifications, the session_id sent by the server will be
+ empty to indicate that the session is not resumable; also, the server will
+ not generate RFC 4507 (RFC 5077) session tickets.)
+
+ A simple reasonable callback implementation is to return is_forward_secure.
+ This parameter will be set to 1 or 0 depending on the ciphersuite selected
+ by the SSL/TLS server library, indicating whether it can provide forward
+ security.
+ [Emilia Käsper <emilia.kasper@esat.kuleuven.be> (Google)]
+
+ *) New -verify_name option in command line utilities to set verification
+ parameters by name.
+ [Steve Henson]
+
+ *) Initial CMAC implementation. WARNING: EXPERIMENTAL, API MAY CHANGE.
+ Add CMAC pkey methods.
+ [Steve Henson]
+
+ *) Experimental renegotiation in s_server -www mode. If the client
+ browses /reneg connection is renegotiated. If /renegcert it is
+ renegotiated requesting a certificate.
+ [Steve Henson]
+
+ *) Add an "external" session cache for debugging purposes to s_server. This
+ should help trace issues which normally are only apparent in deployed
+ multi-process servers.
+ [Steve Henson]
+
+ *) Extensive audit of libcrypto with DEBUG_UNUSED. Fix many cases where
+ return value is ignored. NB. The functions RAND_add(), RAND_seed(),
+ BIO_set_cipher() and some obscure PEM functions were changed so they
+ can now return an error. The RAND changes required a change to the
+ RAND_METHOD structure.
+ [Steve Henson]
+
+ *) New macro __owur for "OpenSSL Warn Unused Result". This makes use of
+ a gcc attribute to warn if the result of a function is ignored. This
+ is enable if DEBUG_UNUSED is set. Add to several functions in evp.h
+ whose return value is often ignored.
+ [Steve Henson]
+
+ *) New -noct, -requestct, -requirect and -ctlogfile options for s_client.
+ These allow SCTs (signed certificate timestamps) to be requested and
+ validated when establishing a connection.
+ [Rob Percival <robpercival@google.com>]
+
+ Changes between 1.0.2g and 1.0.2h [3 May 2016]
+
+ *) Prevent padding oracle in AES-NI CBC MAC check
+
+ A MITM attacker can use a padding oracle attack to decrypt traffic
+ when the connection uses an AES CBC cipher and the server support
+ AES-NI.
+
+ This issue was introduced as part of the fix for Lucky 13 padding
+ attack (CVE-2013-0169). The padding check was rewritten to be in
+ constant time by making sure that always the same bytes are read and
+ compared against either the MAC or padding bytes. But it no longer
+ checked that there was enough data to have both the MAC and padding
+ bytes.
+
+ This issue was reported by Juraj Somorovsky using TLS-Attacker.
+ (CVE-2016-2107)
+ [Kurt Roeckx]
+
+ *) Fix EVP_EncodeUpdate overflow
+
+ An overflow can occur in the EVP_EncodeUpdate() function which is used for
+ Base64 encoding of binary data. If an attacker is able to supply very large
+ amounts of input data then a length check can overflow resulting in a heap
+ corruption.
+
+ Internally to OpenSSL the EVP_EncodeUpdate() function is primarily used by
+ the PEM_write_bio* family of functions. These are mainly used within the
+ OpenSSL command line applications, so any application which processes data
+ from an untrusted source and outputs it as a PEM file should be considered
+ vulnerable to this issue. User applications that call these APIs directly
+ with large amounts of untrusted data may also be vulnerable.
+
+ This issue was reported by Guido Vranken.
+ (CVE-2016-2105)
+ [Matt Caswell]
+
+ *) Fix EVP_EncryptUpdate overflow
+
+ An overflow can occur in the EVP_EncryptUpdate() function. If an attacker
+ is able to supply very large amounts of input data after a previous call to
+ EVP_EncryptUpdate() with a partial block then a length check can overflow
+ resulting in a heap corruption. Following an analysis of all OpenSSL
+ internal usage of the EVP_EncryptUpdate() function all usage is one of two
+ forms. The first form is where the EVP_EncryptUpdate() call is known to be
+ the first called function after an EVP_EncryptInit(), and therefore that
+ specific call must be safe. The second form is where the length passed to
+ EVP_EncryptUpdate() can be seen from the code to be some small value and
+ therefore there is no possibility of an overflow. Since all instances are
+ one of these two forms, it is believed that there can be no overflows in
+ internal code due to this problem. It should be noted that
+ EVP_DecryptUpdate() can call EVP_EncryptUpdate() in certain code paths.
+ Also EVP_CipherUpdate() is a synonym for EVP_EncryptUpdate(). All instances
+ of these calls have also been analysed too and it is believed there are no
+ instances in internal usage where an overflow could occur.
+
+ This issue was reported by Guido Vranken.
+ (CVE-2016-2106)
+ [Matt Caswell]
+
+ *) Prevent ASN.1 BIO excessive memory allocation
+
+ When ASN.1 data is read from a BIO using functions such as d2i_CMS_bio()
+ a short invalid encoding can cause allocation of large amounts of memory
+ potentially consuming excessive resources or exhausting memory.
+
+ Any application parsing untrusted data through d2i BIO functions is
+ affected. The memory based functions such as d2i_X509() are *not* affected.
+ Since the memory based functions are used by the TLS library, TLS
+ applications are not affected.
+
+ This issue was reported by Brian Carpenter.
+ (CVE-2016-2109)
+ [Stephen Henson]
+
+ *) EBCDIC overread
+
+ ASN1 Strings that are over 1024 bytes can cause an overread in applications
+ using the X509_NAME_oneline() function on EBCDIC systems. This could result
+ in arbitrary stack data being returned in the buffer.
+
+ This issue was reported by Guido Vranken.
+ (CVE-2016-2176)
+ [Matt Caswell]
+
+ *) Modify behavior of ALPN to invoke callback after SNI/servername
+ callback, such that updates to the SSL_CTX affect ALPN.
+ [Todd Short]
+
+ *) Remove LOW from the DEFAULT cipher list. This removes singles DES from the
+ default.
+ [Kurt Roeckx]
+
+ *) Only remove the SSLv2 methods with the no-ssl2-method option. When the
+ methods are enabled and ssl2 is disabled the methods return NULL.
+ [Kurt Roeckx]
+
+ Changes between 1.0.2f and 1.0.2g [1 Mar 2016]
+
+ * Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.
+ Builds that are not configured with "enable-weak-ssl-ciphers" will not
+ provide any "EXPORT" or "LOW" strength ciphers.
+ [Viktor Dukhovni]
+
+ * Disable SSLv2 default build, default negotiation and weak ciphers. SSLv2
+ is by default disabled at build-time. Builds that are not configured with
+ "enable-ssl2" will not support SSLv2. Even if "enable-ssl2" is used,
+ users who want to negotiate SSLv2 via the version-flexible SSLv23_method()
+ will need to explicitly call either of:
+
+ SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv2);
+ or
+ SSL_clear_options(ssl, SSL_OP_NO_SSLv2);
+
+ as appropriate. Even if either of those is used, or the application
+ explicitly uses the version-specific SSLv2_method() or its client and
+ server variants, SSLv2 ciphers vulnerable to exhaustive search key
+ recovery have been removed. Specifically, the SSLv2 40-bit EXPORT
+ ciphers, and SSLv2 56-bit DES are no longer available.
+ (CVE-2016-0800)
+ [Viktor Dukhovni]
+
+ *) Fix a double-free in DSA code
+
+ A double free bug was discovered when OpenSSL parses malformed DSA private
+ keys and could lead to a DoS attack or memory corruption for applications
+ that receive DSA private keys from untrusted sources. This scenario is
+ considered rare.
+
+ This issue was reported to OpenSSL by Adam Langley(Google/BoringSSL) using
+ libFuzzer.
+ (CVE-2016-0705)
+ [Stephen Henson]
+
+ *) Disable SRP fake user seed to address a server memory leak.
+
+ Add a new method SRP_VBASE_get1_by_user that handles the seed properly.
+
+ SRP_VBASE_get_by_user had inconsistent memory management behaviour.
+ In order to fix an unavoidable memory leak, SRP_VBASE_get_by_user
+ was changed to ignore the "fake user" SRP seed, even if the seed
+ is configured.
+
+ Users should use SRP_VBASE_get1_by_user instead. Note that in
+ SRP_VBASE_get1_by_user, caller must free the returned value. Note
+ also that even though configuring the SRP seed attempts to hide
+ invalid usernames by continuing the handshake with fake
+ credentials, this behaviour is not constant time and no strong
+ guarantees are made that the handshake is indistinguishable from
+ that of a valid user.
+ (CVE-2016-0798)
+ [Emilia Käsper]
+
+ *) Fix BN_hex2bn/BN_dec2bn NULL pointer deref/heap corruption
+
+ In the BN_hex2bn function the number of hex digits is calculated using an
+ int value |i|. Later |bn_expand| is called with a value of |i * 4|. For
+ large values of |i| this can result in |bn_expand| not allocating any
+ memory because |i * 4| is negative. This can leave the internal BIGNUM data
+ field as NULL leading to a subsequent NULL ptr deref. For very large values
+ of |i|, the calculation |i * 4| could be a positive value smaller than |i|.
+ In this case memory is allocated to the internal BIGNUM data field, but it
+ is insufficiently sized leading to heap corruption. A similar issue exists
+ in BN_dec2bn. This could have security consequences if BN_hex2bn/BN_dec2bn
+ is ever called by user applications with very large untrusted hex/dec data.
+ This is anticipated to be a rare occurrence.
+
+ All OpenSSL internal usage of these functions use data that is not expected
+ to be untrusted, e.g. config file data or application command line
+ arguments. If user developed applications generate config file data based
+ on untrusted data then it is possible that this could also lead to security
+ consequences. This is also anticipated to be rare.
+
+ This issue was reported to OpenSSL by Guido Vranken.
+ (CVE-2016-0797)
+ [Matt Caswell]
+
+ *) Fix memory issues in BIO_*printf functions
+
+ The internal |fmtstr| function used in processing a "%s" format string in
+ the BIO_*printf functions could overflow while calculating the length of a
+ string and cause an OOB read when printing very long strings.
+
+ Additionally the internal |doapr_outch| function can attempt to write to an
+ OOB memory location (at an offset from the NULL pointer) in the event of a
+ memory allocation failure. In 1.0.2 and below this could be caused where
+ the size of a buffer to be allocated is greater than INT_MAX. E.g. this
+ could be in processing a very long "%s" format string. Memory leaks can
+ also occur.
+
+ The first issue may mask the second issue dependent on compiler behaviour.
+ These problems could enable attacks where large amounts of untrusted data
+ is passed to the BIO_*printf functions. If applications use these functions
+ in this way then they could be vulnerable. OpenSSL itself uses these
+ functions when printing out human-readable dumps of ASN.1 data. Therefore
+ applications that print this data could be vulnerable if the data is from
+ untrusted sources. OpenSSL command line applications could also be
+ vulnerable where they print out ASN.1 data, or if untrusted data is passed
+ as command line arguments.
+
+ Libssl is not considered directly vulnerable. Additionally certificates etc
+ received via remote connections via libssl are also unlikely to be able to
+ trigger these issues because of message size limits enforced within libssl.
+
+ This issue was reported to OpenSSL Guido Vranken.
+ (CVE-2016-0799)
+ [Matt Caswell]
+
+ *) Side channel attack on modular exponentiation
+
+ A side-channel attack was found which makes use of cache-bank conflicts on
+ the Intel Sandy-Bridge microarchitecture which could lead to the recovery
+ of RSA keys. The ability to exploit this issue is limited as it relies on
+ an attacker who has control of code in a thread running on the same
+ hyper-threaded core as the victim thread which is performing decryptions.
+
+ This issue was reported to OpenSSL by Yuval Yarom, The University of
+ Adelaide and NICTA, Daniel Genkin, Technion and Tel Aviv University, and
+ Nadia Heninger, University of Pennsylvania with more information at
+ http://cachebleed.info.
+ (CVE-2016-0702)
+ [Andy Polyakov]
+
+ *) Change the req app to generate a 2048-bit RSA/DSA key by default,
+ if no keysize is specified with default_bits. This fixes an
+ omission in an earlier change that changed all RSA/DSA key generation
+ apps to use 2048 bits by default.
+ [Emilia Käsper]
+
+ Changes between 1.0.2e and 1.0.2f [28 Jan 2016]
+ *) DH small subgroups
+
+ Historically OpenSSL only ever generated DH parameters based on "safe"
+ primes. More recently (in version 1.0.2) support was provided for
+ generating X9.42 style parameter files such as those required for RFC 5114
+ support. The primes used in such files may not be "safe". Where an
+ application is using DH configured with parameters based on primes that are
+ not "safe" then an attacker could use this fact to find a peer's private
+ DH exponent. This attack requires that the attacker complete multiple
+ handshakes in which the peer uses the same private DH exponent. For example
+ this could be used to discover a TLS server's private DH exponent if it's
+ reusing the private DH exponent or it's using a static DH ciphersuite.
+
+ OpenSSL provides the option SSL_OP_SINGLE_DH_USE for ephemeral DH (DHE) in
+ TLS. It is not on by default. If the option is not set then the server
+ reuses the same private DH exponent for the life of the server process and
+ would be vulnerable to this attack. It is believed that many popular
+ applications do set this option and would therefore not be at risk.
+
+ The fix for this issue adds an additional check where a "q" parameter is
+ available (as is the case in X9.42 based parameters). This detects the
+ only known attack, and is the only possible defense for static DH
+ ciphersuites. This could have some performance impact.
+
+ Additionally the SSL_OP_SINGLE_DH_USE option has been switched on by
+ default and cannot be disabled. This could have some performance impact.
+
+ This issue was reported to OpenSSL by Antonio Sanso (Adobe).
+ (CVE-2016-0701)
+ [Matt Caswell]
+
+ *) SSLv2 doesn't block disabled ciphers
+
+ A malicious client can negotiate SSLv2 ciphers that have been disabled on
+ the server and complete SSLv2 handshakes even if all SSLv2 ciphers have
+ been disabled, provided that the SSLv2 protocol was not also disabled via
+ SSL_OP_NO_SSLv2.
+
+ This issue was reported to OpenSSL on 26th December 2015 by Nimrod Aviram
+ and Sebastian Schinzel.
+ (CVE-2015-3197)
+ [Viktor Dukhovni]
+
+ Changes between 1.0.2d and 1.0.2e [3 Dec 2015]
+
+ *) BN_mod_exp may produce incorrect results on x86_64
+
+ There is a carry propagating bug in the x86_64 Montgomery squaring
+ procedure. No EC algorithms are affected. Analysis suggests that attacks
+ against RSA and DSA as a result of this defect would be very difficult to
+ perform and are not believed likely. Attacks against DH are considered just
+ feasible (although very difficult) because most of the work necessary to
+ deduce information about a private key may be performed offline. The amount
+ of resources required for such an attack would be very significant and
+ likely only accessible to a limited number of attackers. An attacker would
+ additionally need online access to an unpatched system using the target
+ private key in a scenario with persistent DH parameters and a private
+ key that is shared between multiple clients. For example this can occur by
+ default in OpenSSL DHE based SSL/TLS ciphersuites.
+
+ This issue was reported to OpenSSL by Hanno Böck.
+ (CVE-2015-3193)
+ [Andy Polyakov]
+
+ *) Certificate verify crash with missing PSS parameter
+
+ The signature verification routines will crash with a NULL pointer
+ dereference if presented with an ASN.1 signature using the RSA PSS
+ algorithm and absent mask generation function parameter. Since these
+ routines are used to verify certificate signature algorithms this can be
+ used to crash any certificate verification operation and exploited in a
+ DoS attack. Any application which performs certificate verification is
+ vulnerable including OpenSSL clients and servers which enable client
+ authentication.
+
+ This issue was reported to OpenSSL by Loïc Jonas Etienne (Qnective AG).
+ (CVE-2015-3194)
+ [Stephen Henson]
+
+ *) X509_ATTRIBUTE memory leak
+
+ When presented with a malformed X509_ATTRIBUTE structure OpenSSL will leak
+ memory. This structure is used by the PKCS#7 and CMS routines so any
+ application which reads PKCS#7 or CMS data from untrusted sources is
+ affected. SSL/TLS is not affected.
+
+ This issue was reported to OpenSSL by Adam Langley (Google/BoringSSL) using
+ libFuzzer.
+ (CVE-2015-3195)
+ [Stephen Henson]
+
+ *) Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs.
+ This changes the decoding behaviour for some invalid messages,
+ though the change is mostly in the more lenient direction, and
+ legacy behaviour is preserved as much as possible.
+ [Emilia Käsper]
+
+ *) In DSA_generate_parameters_ex, if the provided seed is too short,
+ return an error
+ [Rich Salz and Ismo Puustinen <ismo.puustinen@intel.com>]
+
+ Changes between 1.0.2c and 1.0.2d [9 Jul 2015]
+
+ *) Alternate chains certificate forgery
+
+ During certificate verification, OpenSSL will attempt to find an
+ alternative certificate chain if the first attempt to build such a chain
+ fails. An error in the implementation of this logic can mean that an
+ attacker could cause certain checks on untrusted certificates to be
+ bypassed, such as the CA flag, enabling them to use a valid leaf
+ certificate to act as a CA and "issue" an invalid certificate.
+
+ This issue was reported to OpenSSL by Adam Langley/David Benjamin
+ (Google/BoringSSL).
+ [Matt Caswell]
+
+ Changes between 1.0.2b and 1.0.2c [12 Jun 2015]
+
+ *) Fix HMAC ABI incompatibility. The previous version introduced an ABI
+ incompatibility in the handling of HMAC. The previous ABI has now been
+ restored.
+ [Matt Caswell]
+
+ Changes between 1.0.2a and 1.0.2b [11 Jun 2015]
+
+ *) Malformed ECParameters causes infinite loop
+
+ When processing an ECParameters structure OpenSSL enters an infinite loop
+ if the curve specified is over a specially malformed binary polynomial
+ field.
+
+ This can be used to perform denial of service against any
+ system which processes public keys, certificate requests or
+ certificates. This includes TLS clients and TLS servers with
+ client authentication enabled.
+
+ This issue was reported to OpenSSL by Joseph Barr-Pixton.
+ (CVE-2015-1788)
+ [Andy Polyakov]
+
+ *) Exploitable out-of-bounds read in X509_cmp_time
+
+ X509_cmp_time does not properly check the length of the ASN1_TIME
+ string and can read a few bytes out of bounds. In addition,
+ X509_cmp_time accepts an arbitrary number of fractional seconds in the
+ time string.
+
+ An attacker can use this to craft malformed certificates and CRLs of
+ various sizes and potentially cause a segmentation fault, resulting in
+ a DoS on applications that verify certificates or CRLs. TLS clients
+ that verify CRLs are affected. TLS clients and servers with client
+ authentication enabled may be affected if they use custom verification
+ callbacks.
+
+ This issue was reported to OpenSSL by Robert Swiecki (Google), and
+ independently by Hanno Böck.
+ (CVE-2015-1789)
+ [Emilia Käsper]
+
+ *) PKCS7 crash with missing EnvelopedContent
+
+ The PKCS#7 parsing code does not handle missing inner EncryptedContent
+ correctly. An attacker can craft malformed ASN.1-encoded PKCS#7 blobs
+ with missing content and trigger a NULL pointer dereference on parsing.
+
+ Applications that decrypt PKCS#7 data or otherwise parse PKCS#7
+ structures from untrusted sources are affected. OpenSSL clients and
+ servers are not affected.
+
+ This issue was reported to OpenSSL by Michal Zalewski (Google).
+ (CVE-2015-1790)
+ [Emilia Käsper]
+
+ *) CMS verify infinite loop with unknown hash function
+
+ When verifying a signedData message the CMS code can enter an infinite loop
+ if presented with an unknown hash function OID. This can be used to perform
+ denial of service against any system which verifies signedData messages using
+ the CMS code.
+ This issue was reported to OpenSSL by Johannes Bauer.
+ (CVE-2015-1792)
+ [Stephen Henson]
+
+ *) Race condition handling NewSessionTicket
+
+ If a NewSessionTicket is received by a multi-threaded client when attempting to
+ reuse a previous ticket then a race condition can occur potentially leading to
+ a double free of the ticket data.
+ (CVE-2015-1791)
+ [Matt Caswell]
+
+ *) Only support 256-bit or stronger elliptic curves with the
+ 'ecdh_auto' setting (server) or by default (client). Of supported
+ curves, prefer P-256 (both).
+ [Emilia Kasper]
+
+ Changes between 1.0.2 and 1.0.2a [19 Mar 2015]
+
+ *) ClientHello sigalgs DoS fix
+
+ If a client connects to an OpenSSL 1.0.2 server and renegotiates with an
+ invalid signature algorithms extension a NULL pointer dereference will
+ occur. This can be exploited in a DoS attack against the server.
+
+ This issue was was reported to OpenSSL by David Ramos of Stanford
+ University.
+ (CVE-2015-0291)
+ [Stephen Henson and Matt Caswell]
+
+ *) Multiblock corrupted pointer fix
+
+ OpenSSL 1.0.2 introduced the "multiblock" performance improvement. This
+ feature only applies on 64 bit x86 architecture platforms that support AES
+ NI instructions. A defect in the implementation of "multiblock" can cause
+ OpenSSL's internal write buffer to become incorrectly set to NULL when
+ using non-blocking IO. Typically, when the user application is using a
+ socket BIO for writing, this will only result in a failed connection.
+ However if some other BIO is used then it is likely that a segmentation
+ fault will be triggered, thus enabling a potential DoS attack.
+
+ This issue was reported to OpenSSL by Daniel Danner and Rainer Mueller.
+ (CVE-2015-0290)
+ [Matt Caswell]
+
+ *) Segmentation fault in DTLSv1_listen fix
+
+ The DTLSv1_listen function is intended to be stateless and processes the
+ initial ClientHello from many peers. It is common for user code to loop
+ over the call to DTLSv1_listen until a valid ClientHello is received with
+ an associated cookie. A defect in the implementation of DTLSv1_listen means
+ that state is preserved in the SSL object from one invocation to the next
+ that can lead to a segmentation fault. Errors processing the initial
+ ClientHello can trigger this scenario. An example of such an error could be
+ that a DTLS1.0 only client is attempting to connect to a DTLS1.2 only
+ server.
+
+ This issue was reported to OpenSSL by Per Allansson.
+ (CVE-2015-0207)
+ [Matt Caswell]
+
+ *) Segmentation fault in ASN1_TYPE_cmp fix
+
+ The function ASN1_TYPE_cmp will crash with an invalid read if an attempt is
+ made to compare ASN.1 boolean types. Since ASN1_TYPE_cmp is used to check
+ certificate signature algorithm consistency this can be used to crash any
+ certificate verification operation and exploited in a DoS attack. Any
+ application which performs certificate verification is vulnerable including
+ OpenSSL clients and servers which enable client authentication.
+ (CVE-2015-0286)
+ [Stephen Henson]
+
+ *) Segmentation fault for invalid PSS parameters fix
+
+ The signature verification routines will crash with a NULL pointer
+ dereference if presented with an ASN.1 signature using the RSA PSS
+ algorithm and invalid parameters. Since these routines are used to verify
+ certificate signature algorithms this can be used to crash any
+ certificate verification operation and exploited in a DoS attack. Any
+ application which performs certificate verification is vulnerable including
+ OpenSSL clients and servers which enable client authentication.
+
+ This issue was was reported to OpenSSL by Brian Carpenter.
+ (CVE-2015-0208)
+ [Stephen Henson]
+
+ *) ASN.1 structure reuse memory corruption fix
+
+ Reusing a structure in ASN.1 parsing may allow an attacker to cause
+ memory corruption via an invalid write. Such reuse is and has been
+ strongly discouraged and is believed to be rare.
+
+ Applications that parse structures containing CHOICE or ANY DEFINED BY
+ components may be affected. Certificate parsing (d2i_X509 and related
+ functions) are however not affected. OpenSSL clients and servers are
+ not affected.
+ (CVE-2015-0287)
+ [Stephen Henson]
+
+ *) PKCS7 NULL pointer dereferences fix
+
+ The PKCS#7 parsing code does not handle missing outer ContentInfo
+ correctly. An attacker can craft malformed ASN.1-encoded PKCS#7 blobs with
+ missing content and trigger a NULL pointer dereference on parsing.
+
+ Applications that verify PKCS#7 signatures, decrypt PKCS#7 data or
+ otherwise parse PKCS#7 structures from untrusted sources are
+ affected. OpenSSL clients and servers are not affected.
+
+ This issue was reported to OpenSSL by Michal Zalewski (Google).
+ (CVE-2015-0289)
+ [Emilia Käsper]
+
+ *) DoS via reachable assert in SSLv2 servers fix
+
+ A malicious client can trigger an OPENSSL_assert (i.e., an abort) in
+ servers that both support SSLv2 and enable export cipher suites by sending
+ a specially crafted SSLv2 CLIENT-MASTER-KEY message.
+
+ This issue was discovered by Sean Burford (Google) and Emilia Käsper
+ (OpenSSL development team).
+ (CVE-2015-0293)
+ [Emilia Käsper]
+
+ *) Empty CKE with client auth and DHE fix
+
+ If client auth is used then a server can seg fault in the event of a DHE
+ ciphersuite being selected and a zero length ClientKeyExchange message
+ being sent by the client. This could be exploited in a DoS attack.
+ (CVE-2015-1787)
+ [Matt Caswell]
+
+ *) Handshake with unseeded PRNG fix
+
+ Under certain conditions an OpenSSL 1.0.2 client can complete a handshake
+ with an unseeded PRNG. The conditions are:
+ - The client is on a platform where the PRNG has not been seeded
+ automatically, and the user has not seeded manually
+ - A protocol specific client method version has been used (i.e. not
+ SSL_client_methodv23)
+ - A ciphersuite is used that does not require additional random data from
+ the PRNG beyond the initial ClientHello client random (e.g. PSK-RC4-SHA).
+
+ If the handshake succeeds then the client random that has been used will
+ have been generated from a PRNG with insufficient entropy and therefore the
+ output may be predictable.
+
+ For example using the following command with an unseeded openssl will
+ succeed on an unpatched platform:
+
+ openssl s_client -psk 1a2b3c4d -tls1_2 -cipher PSK-RC4-SHA
+ (CVE-2015-0285)
+ [Matt Caswell]
+
+ *) Use After Free following d2i_ECPrivatekey error fix
+
+ A malformed EC private key file consumed via the d2i_ECPrivateKey function
+ could cause a use after free condition. This, in turn, could cause a double
+ free in several private key parsing functions (such as d2i_PrivateKey
+ or EVP_PKCS82PKEY) and could lead to a DoS attack or memory corruption
+ for applications that receive EC private keys from untrusted
+ sources. This scenario is considered rare.
+
+ This issue was discovered by the BoringSSL project and fixed in their
+ commit 517073cd4b.
+ (CVE-2015-0209)
+ [Matt Caswell]
+
+ *) X509_to_X509_REQ NULL pointer deref fix
+
+ The function X509_to_X509_REQ will crash with a NULL pointer dereference if
+ the certificate key is invalid. This function is rarely used in practice.
+
+ This issue was discovered by Brian Carpenter.
+ (CVE-2015-0288)
+ [Stephen Henson]
+
+ *) Removed the export ciphers from the DEFAULT ciphers
+ [Kurt Roeckx]
+
+ Changes between 1.0.1l and 1.0.2 [22 Jan 2015]
+
+ *) Facilitate "universal" ARM builds targeting range of ARM ISAs, e.g.
+ ARMv5 through ARMv8, as opposite to "locking" it to single one.
+ So far those who have to target multiple platforms would compromise
+ and argue that binary targeting say ARMv5 would still execute on
+ ARMv8. "Universal" build resolves this compromise by providing
+ near-optimal performance even on newer platforms.
+ [Andy Polyakov]
+
+ *) Accelerated NIST P-256 elliptic curve implementation for x86_64
+ (other platforms pending).
+ [Shay Gueron & Vlad Krasnov (Intel Corp), Andy Polyakov]
+
+ *) Add support for the SignedCertificateTimestampList certificate and
+ OCSP response extensions from RFC6962.
+ [Rob Stradling]
+
+ *) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.)
+ for corner cases. (Certain input points at infinity could lead to
+ bogus results, with non-infinity inputs mapped to infinity too.)
+ [Bodo Moeller]
+
+ *) Initial support for PowerISA 2.0.7, first implemented in POWER8.
+ This covers AES, SHA256/512 and GHASH. "Initial" means that most
+ common cases are optimized and there still is room for further
+ improvements. Vector Permutation AES for Altivec is also added.
+ [Andy Polyakov]
+
+ *) Add support for little-endian ppc64 Linux target.
+ [Marcelo Cerri (IBM)]
+
+ *) Initial support for AMRv8 ISA crypto extensions. This covers AES,
+ SHA1, SHA256 and GHASH. "Initial" means that most common cases
+ are optimized and there still is room for further improvements.
+ Both 32- and 64-bit modes are supported.
+ [Andy Polyakov, Ard Biesheuvel (Linaro)]
+
+ *) Improved ARMv7 NEON support.
+ [Andy Polyakov]
+
+ *) Support for SPARC Architecture 2011 crypto extensions, first
+ implemented in SPARC T4. This covers AES, DES, Camellia, SHA1,
+ SHA256/512, MD5, GHASH and modular exponentiation.
+ [Andy Polyakov, David Miller]
+
+ *) Accelerated modular exponentiation for Intel processors, a.k.a.
+ RSAZ.
+ [Shay Gueron & Vlad Krasnov (Intel Corp)]
+
+ *) Support for new and upcoming Intel processors, including AVX2,
+ BMI and SHA ISA extensions. This includes additional "stitched"
+ implementations, AESNI-SHA256 and GCM, and multi-buffer support
+ for TLS encrypt.
+
+ This work was sponsored by Intel Corp.
+ [Andy Polyakov]
+
+ *) Support for DTLS 1.2. This adds two sets of DTLS methods: DTLS_*_method()
+ supports both DTLS 1.2 and 1.0 and should use whatever version the peer
+ supports and DTLSv1_2_*_method() which supports DTLS 1.2 only.
+ [Steve Henson]
+
+ *) Use algorithm specific chains in SSL_CTX_use_certificate_chain_file():
+ this fixes a limitation in previous versions of OpenSSL.
+ [Steve Henson]
+
+ *) Extended RSA OAEP support via EVP_PKEY API. Options to specify digest,
+ MGF1 digest and OAEP label.
+ [Steve Henson]
+
+ *) Add EVP support for key wrapping algorithms, to avoid problems with
+ existing code the flag EVP_CIPHER_CTX_WRAP_ALLOW has to be set in
+ the EVP_CIPHER_CTX or an error is returned. Add AES and DES3 wrap
+ algorithms and include tests cases.
+ [Steve Henson]
+
+ *) Add functions to allocate and set the fields of an ECDSA_METHOD
+ structure.
+ [Douglas E. Engert, Steve Henson]
+
+ *) New functions OPENSSL_gmtime_diff and ASN1_TIME_diff to find the
+ difference in days and seconds between two tm or ASN1_TIME structures.
+ [Steve Henson]
+
+ *) Add -rev test option to s_server to just reverse order of characters
+ received by client and send back to server. Also prints an abbreviated
+ summary of the connection parameters.
+ [Steve Henson]
+
+ *) New option -brief for s_client and s_server to print out a brief summary
+ of connection parameters.
+ [Steve Henson]
+
+ *) Add callbacks for arbitrary TLS extensions.
+ [Trevor Perrin <trevp@trevp.net> and Ben Laurie]
+
+ *) New option -crl_download in several openssl utilities to download CRLs
+ from CRLDP extension in certificates.
+ [Steve Henson]
+
+ *) New options -CRL and -CRLform for s_client and s_server for CRLs.
+ [Steve Henson]
+
+ *) New function X509_CRL_diff to generate a delta CRL from the difference
+ of two full CRLs. Add support to "crl" utility.
+ [Steve Henson]
+
+ *) New functions to set lookup_crls function and to retrieve
+ X509_STORE from X509_STORE_CTX.
+ [Steve Henson]
+
+ *) Print out deprecated issuer and subject unique ID fields in
+ certificates.
+ [Steve Henson]
+
+ *) Extend OCSP I/O functions so they can be used for simple general purpose
+ HTTP as well as OCSP. New wrapper function which can be used to download
+ CRLs using the OCSP API.
+ [Steve Henson]
+
+ *) Delegate command line handling in s_client/s_server to SSL_CONF APIs.
+ [Steve Henson]
+
+ *) SSL_CONF* functions. These provide a common framework for application
+ configuration using configuration files or command lines.
+ [Steve Henson]
+
+ *) SSL/TLS tracing code. This parses out SSL/TLS records using the
+ message callback and prints the results. Needs compile time option
+ "enable-ssl-trace". New options to s_client and s_server to enable
+ tracing.
+ [Steve Henson]
+
+ *) New ctrl and macro to retrieve supported points extensions.
+ Print out extension in s_server and s_client.
+ [Steve Henson]
+
+ *) New functions to retrieve certificate signature and signature
+ OID NID.
+ [Steve Henson]
+
+ *) Add functions to retrieve and manipulate the raw cipherlist sent by a
+ client to OpenSSL.
+ [Steve Henson]
+
+ *) New Suite B modes for TLS code. These use and enforce the requirements
+ of RFC6460: restrict ciphersuites, only permit Suite B algorithms and
+ only use Suite B curves. The Suite B modes can be set by using the
+ strings "SUITEB128", "SUITEB192" or "SUITEB128ONLY" for the cipherstring.
+ [Steve Henson]
+
+ *) New chain verification flags for Suite B levels of security. Check
+ algorithms are acceptable when flags are set in X509_verify_cert.
+ [Steve Henson]
+
+ *) Make tls1_check_chain return a set of flags indicating checks passed
+ by a certificate chain. Add additional tests to handle client
+ certificates: checks for matching certificate type and issuer name
+ comparison.
+ [Steve Henson]
+
+ *) If an attempt is made to use a signature algorithm not in the peer
+ preference list abort the handshake. If client has no suitable
+ signature algorithms in response to a certificate request do not
+ use the certificate.
+ [Steve Henson]
+
+ *) If server EC tmp key is not in client preference list abort handshake.
+ [Steve Henson]
+
+ *) Add support for certificate stores in CERT structure. This makes it
+ possible to have different stores per SSL structure or one store in
+ the parent SSL_CTX. Include distinct stores for certificate chain
+ verification and chain building. New ctrl SSL_CTRL_BUILD_CERT_CHAIN
+ to build and store a certificate chain in CERT structure: returning
+ an error if the chain cannot be built: this will allow applications
+ to test if a chain is correctly configured.
+
+ Note: if the CERT based stores are not set then the parent SSL_CTX
+ store is used to retain compatibility with existing behaviour.
+
+ [Steve Henson]
+
+ *) New function ssl_set_client_disabled to set a ciphersuite disabled
+ mask based on the current session, check mask when sending client
+ hello and checking the requested ciphersuite.
+ [Steve Henson]
+
+ *) New ctrls to retrieve and set certificate types in a certificate
+ request message. Print out received values in s_client. If certificate
+ types is not set with custom values set sensible values based on
+ supported signature algorithms.
+ [Steve Henson]
+
+ *) Support for distinct client and server supported signature algorithms.
+ [Steve Henson]
+
+ *) Add certificate callback. If set this is called whenever a certificate
+ is required by client or server. An application can decide which
+ certificate chain to present based on arbitrary criteria: for example
+ supported signature algorithms. Add very simple example to s_server.
+ This fixes many of the problems and restrictions of the existing client
+ certificate callback: for example you can now clear an existing
+ certificate and specify the whole chain.
+ [Steve Henson]
+
+ *) Add new "valid_flags" field to CERT_PKEY structure which determines what
+ the certificate can be used for (if anything). Set valid_flags field
+ in new tls1_check_chain function. Simplify ssl_set_cert_masks which used
+ to have similar checks in it.
+
+ Add new "cert_flags" field to CERT structure and include a "strict mode".
+ This enforces some TLS certificate requirements (such as only permitting
+ certificate signature algorithms contained in the supported algorithms
+ extension) which some implementations ignore: this option should be used
+ with caution as it could cause interoperability issues.
+ [Steve Henson]
+
+ *) Update and tidy signature algorithm extension processing. Work out
+ shared signature algorithms based on preferences and peer algorithms
+ and print them out in s_client and s_server. Abort handshake if no
+ shared signature algorithms.
+ [Steve Henson]
+
+ *) Add new functions to allow customised supported signature algorithms
+ for SSL and SSL_CTX structures. Add options to s_client and s_server
+ to support them.
+ [Steve Henson]
+
+ *) New function SSL_certs_clear() to delete all references to certificates
+ from an SSL structure. Before this once a certificate had been added
+ it couldn't be removed.
+ [Steve Henson]
+
+ *) Integrate hostname, email address and IP address checking with certificate
+ verification. New verify options supporting checking in openssl utility.
+ [Steve Henson]
+
+ *) Fixes and wildcard matching support to hostname and email checking
+ functions. Add manual page.
+ [Florian Weimer (Red Hat Product Security Team)]
+
+ *) New functions to check a hostname email or IP address against a
+ certificate. Add options x509 utility to print results of checks against
+ a certificate.
+ [Steve Henson]
+
+ *) Fix OCSP checking.
+ [Rob Stradling <rob.stradling@comodo.com> and Ben Laurie]
+
+ *) Initial experimental support for explicitly trusted non-root CAs.
+ OpenSSL still tries to build a complete chain to a root but if an
+ intermediate CA has a trust setting included that is used. The first
+ setting is used: whether to trust (e.g., -addtrust option to the x509
+ utility) or reject.
+ [Steve Henson]
+
+ *) Add -trusted_first option which attempts to find certificates in the
+ trusted store even if an untrusted chain is also supplied.
+ [Steve Henson]
+
+ *) MIPS assembly pack updates: support for MIPS32r2 and SmartMIPS ASE,
+ platform support for Linux and Android.
+ [Andy Polyakov]
+
+ *) Support for linux-x32, ILP32 environment in x86_64 framework.
+ [Andy Polyakov]
+
+ *) Experimental multi-implementation support for FIPS capable OpenSSL.
+ When in FIPS mode the approved implementations are used as normal,
+ when not in FIPS mode the internal unapproved versions are used instead.
+ This means that the FIPS capable OpenSSL isn't forced to use the
+ (often lower performance) FIPS implementations outside FIPS mode.
+ [Steve Henson]
+
+ *) Transparently support X9.42 DH parameters when calling
+ PEM_read_bio_DHparameters. This means existing applications can handle
+ the new parameter format automatically.
+ [Steve Henson]
+
+ *) Initial experimental support for X9.42 DH parameter format: mainly
+ to support use of 'q' parameter for RFC5114 parameters.
+ [Steve Henson]
+
+ *) Add DH parameters from RFC5114 including test data to dhtest.
+ [Steve Henson]
+
+ *) Support for automatic EC temporary key parameter selection. If enabled
+ the most preferred EC parameters are automatically used instead of
+ hardcoded fixed parameters. Now a server just has to call:
+ SSL_CTX_set_ecdh_auto(ctx, 1) and the server will automatically
+ support ECDH and use the most appropriate parameters.
+ [Steve Henson]
+
+ *) Enhance and tidy EC curve and point format TLS extension code. Use
+ static structures instead of allocation if default values are used.
+ New ctrls to set curves we wish to support and to retrieve shared curves.
+ Print out shared curves in s_server. New options to s_server and s_client
+ to set list of supported curves.
+ [Steve Henson]
+
+ *) New ctrls to retrieve supported signature algorithms and
+ supported curve values as an array of NIDs. Extend openssl utility
+ to print out received values.
+ [Steve Henson]
+
+ *) Add new APIs EC_curve_nist2nid and EC_curve_nid2nist which convert
+ between NIDs and the more common NIST names such as "P-256". Enhance
+ ecparam utility and ECC method to recognise the NIST names for curves.
+ [Steve Henson]
+
+ *) Enhance SSL/TLS certificate chain handling to support different
+ chains for each certificate instead of one chain in the parent SSL_CTX.
+ [Steve Henson]
+
+ *) Support for fixed DH ciphersuite client authentication: where both
+ server and client use DH certificates with common parameters.
+ [Steve Henson]
+
+ *) Support for fixed DH ciphersuites: those requiring DH server
+ certificates.
+ [Steve Henson]
+
+ *) New function i2d_re_X509_tbs for re-encoding the TBS portion of
+ the certificate.
+ Note: Related 1.0.2-beta specific macros X509_get_cert_info,
+ X509_CINF_set_modified, X509_CINF_get_issuer, X509_CINF_get_extensions and
+ X509_CINF_get_signature were reverted post internal team review.
+
+ Changes between 1.0.1k and 1.0.1l [15 Jan 2015]
+
+ *) Build fixes for the Windows and OpenVMS platforms
+ [Matt Caswell and Richard Levitte]
+
+ Changes between 1.0.1j and 1.0.1k [8 Jan 2015]
+
+ *) Fix DTLS segmentation fault in dtls1_get_record. A carefully crafted DTLS
+ message can cause a segmentation fault in OpenSSL due to a NULL pointer
+ dereference. This could lead to a Denial Of Service attack. Thanks to
+ Markus Stenberg of Cisco Systems, Inc. for reporting this issue.
+ (CVE-2014-3571)
+ [Steve Henson]
+
+ *) Fix DTLS memory leak in dtls1_buffer_record. A memory leak can occur in the
+ dtls1_buffer_record function under certain conditions. In particular this
+ could occur if an attacker sent repeated DTLS records with the same
+ sequence number but for the next epoch. The memory leak could be exploited
+ by an attacker in a Denial of Service attack through memory exhaustion.
+ Thanks to Chris Mueller for reporting this issue.
+ (CVE-2015-0206)
+ [Matt Caswell]
+
+ *) Fix issue where no-ssl3 configuration sets method to NULL. When openssl is
+ built with the no-ssl3 option and a SSL v3 ClientHello is received the ssl
+ method would be set to NULL which could later result in a NULL pointer
+ dereference. Thanks to Frank Schmirler for reporting this issue.
+ (CVE-2014-3569)
+ [Kurt Roeckx]
+
+ *) Abort handshake if server key exchange message is omitted for ephemeral
+ ECDH ciphersuites.
+
+ Thanks to Karthikeyan Bhargavan of the PROSECCO team at INRIA for
+ reporting this issue.
+ (CVE-2014-3572)
+ [Steve Henson]
+
+ *) Remove non-export ephemeral RSA code on client and server. This code
+ violated the TLS standard by allowing the use of temporary RSA keys in
+ non-export ciphersuites and could be used by a server to effectively
+ downgrade the RSA key length used to a value smaller than the server
+ certificate. Thanks for Karthikeyan Bhargavan of the PROSECCO team at
+ INRIA or reporting this issue.
+ (CVE-2015-0204)
+ [Steve Henson]
+
+ *) Fixed issue where DH client certificates are accepted without verification.
+ An OpenSSL server will accept a DH certificate for client authentication
+ without the certificate verify message. This effectively allows a client to
+ authenticate without the use of a private key. This only affects servers
+ which trust a client certificate authority which issues certificates
+ containing DH keys: these are extremely rare and hardly ever encountered.
+ Thanks for Karthikeyan Bhargavan of the PROSECCO team at INRIA or reporting
+ this issue.
+ (CVE-2015-0205)
+ [Steve Henson]
+
+ *) Ensure that the session ID context of an SSL is updated when its
+ SSL_CTX is updated via SSL_set_SSL_CTX.
+
+ The session ID context is typically set from the parent SSL_CTX,
+ and can vary with the CTX.
+ [Adam Langley]
+
+ *) Fix various certificate fingerprint issues.
+
+ By using non-DER or invalid encodings outside the signed portion of a
+ certificate the fingerprint can be changed without breaking the signature.
+ Although no details of the signed portion of the certificate can be changed
+ this can cause problems with some applications: e.g. those using the
+ certificate fingerprint for blacklists.
+
+ 1. Reject signatures with non zero unused bits.
+
+ If the BIT STRING containing the signature has non zero unused bits reject
+ the signature. All current signature algorithms require zero unused bits.
+
+ 2. Check certificate algorithm consistency.
+
+ Check the AlgorithmIdentifier inside TBS matches the one in the
+ certificate signature. NB: this will result in signature failure
+ errors for some broken certificates.
+
+ Thanks to Konrad Kraszewski from Google for reporting this issue.
+
+ 3. Check DSA/ECDSA signatures use DER.
+
+ Re-encode DSA/ECDSA signatures and compare with the original received
+ signature. Return an error if there is a mismatch.
+
+ This will reject various cases including garbage after signature
+ (thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS
+ program for discovering this case) and use of BER or invalid ASN.1 INTEGERs
+ (negative or with leading zeroes).
+
+ Further analysis was conducted and fixes were developed by Stephen Henson
+ of the OpenSSL core team.
+
+ (CVE-2014-8275)
+ [Steve Henson]
+
+ *) Correct Bignum squaring. Bignum squaring (BN_sqr) may produce incorrect
+ results on some platforms, including x86_64. This bug occurs at random
+ with a very low probability, and is not known to be exploitable in any
+ way, though its exact impact is difficult to determine. Thanks to Pieter
+ Wuille (Blockstream) who reported this issue and also suggested an initial
+ fix. Further analysis was conducted by the OpenSSL development team and
+ Adam Langley of Google. The final fix was developed by Andy Polyakov of
+ the OpenSSL core team.
+ (CVE-2014-3570)
+ [Andy Polyakov]
+
+ *) Do not resume sessions on the server if the negotiated protocol
+ version does not match the session's version. Resuming with a different
+ version, while not strictly forbidden by the RFC, is of questionable
+ sanity and breaks all known clients.
+ [David Benjamin, Emilia Käsper]
+
+ *) Tighten handling of the ChangeCipherSpec (CCS) message: reject
+ early CCS messages during renegotiation. (Note that because
+ renegotiation is encrypted, this early CCS was not exploitable.)
+ [Emilia Käsper]
+
+ *) Tighten client-side session ticket handling during renegotiation:
+ ensure that the client only accepts a session ticket if the server sends
+ the extension anew in the ServerHello. Previously, a TLS client would
+ reuse the old extension state and thus accept a session ticket if one was
+ announced in the initial ServerHello.
+
+ Similarly, ensure that the client requires a session ticket if one
+ was advertised in the ServerHello. Previously, a TLS client would
+ ignore a missing NewSessionTicket message.
+ [Emilia Käsper]
+
+ Changes between 1.0.1i and 1.0.1j [15 Oct 2014]
+
+ *) SRTP Memory Leak.
+
+ A flaw in the DTLS SRTP extension parsing code allows an attacker, who
+ sends a carefully crafted handshake message, to cause OpenSSL to fail
+ to free up to 64k of memory causing a memory leak. This could be
+ exploited in a Denial Of Service attack. This issue affects OpenSSL
+ 1.0.1 server implementations for both SSL/TLS and DTLS regardless of
+ whether SRTP is used or configured. Implementations of OpenSSL that
+ have been compiled with OPENSSL_NO_SRTP defined are not affected.
+
+ The fix was developed by the OpenSSL team.
+ (CVE-2014-3513)
+ [OpenSSL team]
+
+ *) Session Ticket Memory Leak.
+
+ When an OpenSSL SSL/TLS/DTLS server receives a session ticket the
+ integrity of that ticket is first verified. In the event of a session
+ ticket integrity check failing, OpenSSL will fail to free memory
+ causing a memory leak. By sending a large number of invalid session
+ tickets an attacker could exploit this issue in a Denial Of Service
+ attack.
+ (CVE-2014-3567)
+ [Steve Henson]
+
+ *) Build option no-ssl3 is incomplete.
+
+ When OpenSSL is configured with "no-ssl3" as a build option, servers
+ could accept and complete a SSL 3.0 handshake, and clients could be
+ configured to send them.
+ (CVE-2014-3568)
+ [Akamai and the OpenSSL team]
+
+ *) Add support for TLS_FALLBACK_SCSV.
+ Client applications doing fallback retries should call
+ SSL_set_mode(s, SSL_MODE_SEND_FALLBACK_SCSV).
+ (CVE-2014-3566)
+ [Adam Langley, Bodo Moeller]
+
+ *) Add additional DigestInfo checks.
+
+ Re-encode DigestInto in DER and check against the original when
+ verifying RSA signature: this will reject any improperly encoded
+ DigestInfo structures.
+
+ Note: this is a precautionary measure and no attacks are currently known.
+
+ [Steve Henson]
+
+ Changes between 1.0.1h and 1.0.1i [6 Aug 2014]
+
+ *) Fix SRP buffer overrun vulnerability. Invalid parameters passed to the
+ SRP code can be overrun an internal buffer. Add sanity check that
+ g, A, B < N to SRP code.
+
+ Thanks to Sean Devlin and Watson Ladd of Cryptography Services, NCC
+ Group for discovering this issue.
+ (CVE-2014-3512)
+ [Steve Henson]
+
+ *) A flaw in the OpenSSL SSL/TLS server code causes the server to negotiate
+ TLS 1.0 instead of higher protocol versions when the ClientHello message
+ is badly fragmented. This allows a man-in-the-middle attacker to force a
+ downgrade to TLS 1.0 even if both the server and the client support a
+ higher protocol version, by modifying the client's TLS records.
+
+ Thanks to David Benjamin and Adam Langley (Google) for discovering and
+ researching this issue.
+ (CVE-2014-3511)
+ [David Benjamin]
+
+ *) OpenSSL DTLS clients enabling anonymous (EC)DH ciphersuites are subject
+ to a denial of service attack. A malicious server can crash the client
+ with a null pointer dereference (read) by specifying an anonymous (EC)DH
+ ciphersuite and sending carefully crafted handshake messages.
+
+ Thanks to Felix Gröbert (Google) for discovering and researching this
+ issue.
+ (CVE-2014-3510)
+ [Emilia Käsper]
+
+ *) By sending carefully crafted DTLS packets an attacker could cause openssl
+ to leak memory. This can be exploited through a Denial of Service attack.
+ Thanks to Adam Langley for discovering and researching this issue.
+ (CVE-2014-3507)
+ [Adam Langley]
+
+ *) An attacker can force openssl to consume large amounts of memory whilst
+ processing DTLS handshake messages. This can be exploited through a
+ Denial of Service attack.
+ Thanks to Adam Langley for discovering and researching this issue.
+ (CVE-2014-3506)
+ [Adam Langley]
+
+ *) An attacker can force an error condition which causes openssl to crash
+ whilst processing DTLS packets due to memory being freed twice. This
+ can be exploited through a Denial of Service attack.
+ Thanks to Adam Langley and Wan-Teh Chang for discovering and researching
+ this issue.
+ (CVE-2014-3505)
+ [Adam Langley]
+
+ *) If a multithreaded client connects to a malicious server using a resumed
+ session and the server sends an ec point format extension it could write
+ up to 255 bytes to freed memory.
+
+ Thanks to Gabor Tyukasz (LogMeIn Inc) for discovering and researching this
+ issue.
+ (CVE-2014-3509)
+ [Gabor Tyukasz]
+
+ *) A malicious server can crash an OpenSSL client with a null pointer
+ dereference (read) by specifying an SRP ciphersuite even though it was not
+ properly negotiated with the client. This can be exploited through a
+ Denial of Service attack.
+
+ Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for
+ discovering and researching this issue.
+ (CVE-2014-5139)
+ [Steve Henson]
+
+ *) A flaw in OBJ_obj2txt may cause pretty printing functions such as
+ X509_name_oneline, X509_name_print_ex et al. to leak some information
+ from the stack. Applications may be affected if they echo pretty printing
+ output to the attacker.
+
+ Thanks to Ivan Fratric (Google) for discovering this issue.
+ (CVE-2014-3508)
+ [Emilia Käsper, and Steve Henson]
+
+ *) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.)
+ for corner cases. (Certain input points at infinity could lead to
+ bogus results, with non-infinity inputs mapped to infinity too.)
+ [Bodo Moeller]
+
+ Changes between 1.0.1g and 1.0.1h [5 Jun 2014]
+
+ *) Fix for SSL/TLS MITM flaw. An attacker using a carefully crafted
+ handshake can force the use of weak keying material in OpenSSL
+ SSL/TLS clients and servers.
+
+ Thanks to KIKUCHI Masashi (Lepidum Co. Ltd.) for discovering and
+ researching this issue. (CVE-2014-0224)
+ [KIKUCHI Masashi, Steve Henson]
+
+ *) Fix DTLS recursion flaw. By sending an invalid DTLS handshake to an
+ OpenSSL DTLS client the code can be made to recurse eventually crashing
+ in a DoS attack.
+
+ Thanks to Imre Rad (Search-Lab Ltd.) for discovering this issue.
+ (CVE-2014-0221)
+ [Imre Rad, Steve Henson]
+
+ *) Fix DTLS invalid fragment vulnerability. A buffer overrun attack can
+ be triggered by sending invalid DTLS fragments to an OpenSSL DTLS
+ client or server. This is potentially exploitable to run arbitrary
+ code on a vulnerable client or server.
+
+ Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195)
+ [Jüri Aedla, Steve Henson]
+
+ *) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites
+ are subject to a denial of service attack.
+
+ Thanks to Felix Gröbert and Ivan Fratric at Google for discovering
+ this issue. (CVE-2014-3470)
+ [Felix Gröbert, Ivan Fratric, Steve Henson]
+
+ *) Harmonize version and its documentation. -f flag is used to display
+ compilation flags.
+ [mancha <mancha1@zoho.com>]
+
+ *) Fix eckey_priv_encode so it immediately returns an error upon a failure
+ in i2d_ECPrivateKey.
+ [mancha <mancha1@zoho.com>]
+
+ *) Fix some double frees. These are not thought to be exploitable.
+ [mancha <mancha1@zoho.com>]
+
+ Changes between 1.0.1f and 1.0.1g [7 Apr 2014]
+
+ *) A missing bounds check in the handling of the TLS heartbeat extension
+ can be used to reveal up to 64k of memory to a connected client or
+ server.
+
+ Thanks for Neel Mehta of Google Security for discovering this bug and to
+ Adam Langley <agl@chromium.org> and Bodo Moeller <bmoeller@acm.org> for
+ preparing the fix (CVE-2014-0160)
+ [Adam Langley, Bodo Moeller]
+
+ *) Fix for the attack described in the paper "Recovering OpenSSL
+ ECDSA Nonces Using the FLUSH+RELOAD Cache Side-channel Attack"
+ by Yuval Yarom and Naomi Benger. Details can be obtained from:
+ http://eprint.iacr.org/2014/140
+
+ Thanks to Yuval Yarom and Naomi Benger for discovering this
+ flaw and to Yuval Yarom for supplying a fix (CVE-2014-0076)
+ [Yuval Yarom and Naomi Benger]
+
+ *) TLS pad extension: draft-agl-tls-padding-03
+
+ Workaround for the "TLS hang bug" (see FAQ and PR#2771): if the
+ TLS client Hello record length value would otherwise be > 255 and
+ less that 512 pad with a dummy extension containing zeroes so it
+ is at least 512 bytes long.
+
+ [Adam Langley, Steve Henson]
+
+ Changes between 1.0.1e and 1.0.1f [6 Jan 2014]
+
+ *) Fix for TLS record tampering bug. A carefully crafted invalid
+ handshake could crash OpenSSL with a NULL pointer exception.
+ Thanks to Anton Johansson for reporting this issues.
+ (CVE-2013-4353)
+
+ *) Keep original DTLS digest and encryption contexts in retransmission
+ structures so we can use the previous session parameters if they need
+ to be resent. (CVE-2013-6450)
+ [Steve Henson]
+
+ *) Add option SSL_OP_SAFARI_ECDHE_ECDSA_BUG (part of SSL_OP_ALL) which
+ avoids preferring ECDHE-ECDSA ciphers when the client appears to be
+ Safari on OS X. Safari on OS X 10.8..10.8.3 advertises support for
+ several ECDHE-ECDSA ciphers, but fails to negotiate them. The bug
+ is fixed in OS X 10.8.4, but Apple have ruled out both hot fixing
+ 10.8..10.8.3 and forcing users to upgrade to 10.8.4 or newer.
+ [Rob Stradling, Adam Langley]
+
+ Changes between 1.0.1d and 1.0.1e [11 Feb 2013]
+
+ *) Correct fix for CVE-2013-0169. The original didn't work on AES-NI
+ supporting platforms or when small records were transferred.
+ [Andy Polyakov, Steve Henson]
+
+ Changes between 1.0.1c and 1.0.1d [5 Feb 2013]
+
+ *) Make the decoding of SSLv3, TLS and DTLS CBC records constant time.
+
+ This addresses the flaw in CBC record processing discovered by
+ Nadhem Alfardan and Kenny Paterson. Details of this attack can be found
+ at: http://www.isg.rhul.ac.uk/tls/
+
+ Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
+ Security Group at Royal Holloway, University of London
+ (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
+ Emilia Käsper for the initial patch.
+ (CVE-2013-0169)
+ [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
+
+ *) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode
+ ciphersuites which can be exploited in a denial of service attack.
+ Thanks go to and to Adam Langley <agl@chromium.org> for discovering
+ and detecting this bug and to Wolfgang Ettlinger
+ <wolfgang.ettlinger@gmail.com> for independently discovering this issue.
+ (CVE-2012-2686)
+ [Adam Langley]
+
+ *) Return an error when checking OCSP signatures when key is NULL.
+ This fixes a DoS attack. (CVE-2013-0166)
+ [Steve Henson]
+
+ *) Make openssl verify return errors.
+ [Chris Palmer <palmer@google.com> and Ben Laurie]
+
+ *) Call OCSP Stapling callback after ciphersuite has been chosen, so
+ the right response is stapled. Also change SSL_get_certificate()
+ so it returns the certificate actually sent.
+ See http://rt.openssl.org/Ticket/Display.html?id=2836.
+ [Rob Stradling <rob.stradling@comodo.com>]
+
+ *) Fix possible deadlock when decoding public keys.
+ [Steve Henson]
+
+ *) Don't use TLS 1.0 record version number in initial client hello
+ if renegotiating.
+ [Steve Henson]
+
+ Changes between 1.0.1b and 1.0.1c [10 May 2012]
+
+ *) Sanity check record length before skipping explicit IV in TLS
+ 1.2, 1.1 and DTLS to fix DoS attack.
+
+ Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic
+ fuzzing as a service testing platform.
+ (CVE-2012-2333)
+ [Steve Henson]
+
+ *) Initialise tkeylen properly when encrypting CMS messages.
+ Thanks to Solar Designer of Openwall for reporting this issue.
+ [Steve Henson]
+
+ *) In FIPS mode don't try to use composite ciphers as they are not
+ approved.
+ [Steve Henson]
+
+ Changes between 1.0.1a and 1.0.1b [26 Apr 2012]
+
+ *) OpenSSL 1.0.0 sets SSL_OP_ALL to 0x80000FFFL and OpenSSL 1.0.1 and
+ 1.0.1a set SSL_OP_NO_TLSv1_1 to 0x00000400L which would unfortunately
+ mean any application compiled against OpenSSL 1.0.0 headers setting
+ SSL_OP_ALL would also set SSL_OP_NO_TLSv1_1, unintentionally disablng
+ TLS 1.1 also. Fix this by changing the value of SSL_OP_NO_TLSv1_1 to
+ 0x10000000L Any application which was previously compiled against
+ OpenSSL 1.0.1 or 1.0.1a headers and which cares about SSL_OP_NO_TLSv1_1
+ will need to be recompiled as a result. Letting be results in
+ inability to disable specifically TLS 1.1 and in client context,
+ in unlike event, limit maximum offered version to TLS 1.0 [see below].
+ [Steve Henson]
+
+ *) In order to ensure interoperabilty SSL_OP_NO_protocolX does not
+ disable just protocol X, but all protocols above X *if* there are
+ protocols *below* X still enabled. In more practical terms it means
+ that if application wants to disable TLS1.0 in favor of TLS1.1 and
+ above, it's not sufficient to pass SSL_OP_NO_TLSv1, one has to pass
+ SSL_OP_NO_TLSv1|SSL_OP_NO_SSLv3|SSL_OP_NO_SSLv2. This applies to
+ client side.
+ [Andy Polyakov]
+
+ Changes between 1.0.1 and 1.0.1a [19 Apr 2012]
+
+ *) Check for potentially exploitable overflows in asn1_d2i_read_bio
+ BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer
+ in CRYPTO_realloc_clean.
+
+ Thanks to Tavis Ormandy, Google Security Team, for discovering this
+ issue and to Adam Langley <agl@chromium.org> for fixing it.
+ (CVE-2012-2110)
+ [Adam Langley (Google), Tavis Ormandy, Google Security Team]
+
+ *) Don't allow TLS 1.2 SHA-256 ciphersuites in TLS 1.0, 1.1 connections.
+ [Adam Langley]
+
+ *) Workarounds for some broken servers that "hang" if a client hello
+ record length exceeds 255 bytes.
+
+ 1. Do not use record version number > TLS 1.0 in initial client
+ hello: some (but not all) hanging servers will now work.
+ 2. If we set OPENSSL_MAX_TLS1_2_CIPHER_LENGTH this will truncate
+ the number of ciphers sent in the client hello. This should be
+ set to an even number, such as 50, for example by passing:
+ -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 to config or Configure.
+ Most broken servers should now work.
+ 3. If all else fails setting OPENSSL_NO_TLS1_2_CLIENT will disable
+ TLS 1.2 client support entirely.
+ [Steve Henson]
+
+ *) Fix SEGV in Vector Permutation AES module observed in OpenSSH.
+ [Andy Polyakov]
+
+ Changes between 1.0.0h and 1.0.1 [14 Mar 2012]
+
+ *) Add compatibility with old MDC2 signatures which use an ASN1 OCTET
+ STRING form instead of a DigestInfo.
+ [Steve Henson]
+
+ *) The format used for MDC2 RSA signatures is inconsistent between EVP
+ and the RSA_sign/RSA_verify functions. This was made more apparent when
+ OpenSSL used RSA_sign/RSA_verify for some RSA signatures in particular
+ those which went through EVP_PKEY_METHOD in 1.0.0 and later. Detect
+ the correct format in RSA_verify so both forms transparently work.
+ [Steve Henson]
+
+ *) Some servers which support TLS 1.0 can choke if we initially indicate
+ support for TLS 1.2 and later renegotiate using TLS 1.0 in the RSA
+ encrypted premaster secret. As a workaround use the maximum permitted
+ client version in client hello, this should keep such servers happy
+ and still work with previous versions of OpenSSL.
+ [Steve Henson]
+
+ *) Add support for TLS/DTLS heartbeats.
+ [Robin Seggelmann <seggelmann@fh-muenster.de>]
+
+ *) Add support for SCTP.
+ [Robin Seggelmann <seggelmann@fh-muenster.de>]
+
+ *) Improved PRNG seeding for VOS.
+ [Paul Green <Paul.Green@stratus.com>]
+
+ *) Extensive assembler packs updates, most notably:
+
+ - x86[_64]: AES-NI, PCLMULQDQ, RDRAND support;
+ - x86[_64]: SSSE3 support (SHA1, vector-permutation AES);
+ - x86_64: bit-sliced AES implementation;
+ - ARM: NEON support, contemporary platforms optimizations;
+ - s390x: z196 support;
+ - *: GHASH and GF(2^m) multiplication implementations;
+
+ [Andy Polyakov]
+
+ *) Make TLS-SRP code conformant with RFC 5054 API cleanup
+ (removal of unnecessary code)
+ [Peter Sylvester <peter.sylvester@edelweb.fr>]
+
+ *) Add TLS key material exporter from RFC 5705.
+ [Eric Rescorla]
+
+ *) Add DTLS-SRTP negotiation from RFC 5764.
+ [Eric Rescorla]
+
+ *) Add Next Protocol Negotiation,
+ http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-00. Can be
+ disabled with a no-npn flag to config or Configure. Code donated
+ by Google.
+ [Adam Langley <agl@google.com> and Ben Laurie]
+
+ *) Add optional 64-bit optimized implementations of elliptic curves NIST-P224,
+ NIST-P256, NIST-P521, with constant-time single point multiplication on
+ typical inputs. Compiler support for the nonstandard type __uint128_t is
+ required to use this (present in gcc 4.4 and later, for 64-bit builds).
+ Code made available under Apache License version 2.0.
+
+ Specify "enable-ec_nistp_64_gcc_128" on the Configure (or config) command
+ line to include this in your build of OpenSSL, and run "make depend" (or
+ "make update"). This enables the following EC_METHODs:
+
+ EC_GFp_nistp224_method()
+ EC_GFp_nistp256_method()
+ EC_GFp_nistp521_method()
+
+ EC_GROUP_new_by_curve_name() will automatically use these (while
+ EC_GROUP_new_curve_GFp() currently prefers the more flexible
+ implementations).
+ [Emilia Käsper, Adam Langley, Bodo Moeller (Google)]
+
+ *) Use type ossl_ssize_t instad of ssize_t which isn't available on
+ all platforms. Move ssize_t definition from e_os.h to the public
+ header file e_os2.h as it now appears in public header file cms.h
+ [Steve Henson]
+
+ *) New -sigopt option to the ca, req and x509 utilities. Additional
+ signature parameters can be passed using this option and in
+ particular PSS.
+ [Steve Henson]
+
+ *) Add RSA PSS signing function. This will generate and set the
+ appropriate AlgorithmIdentifiers for PSS based on those in the
+ corresponding EVP_MD_CTX structure. No application support yet.
+ [Steve Henson]
+
+ *) Support for companion algorithm specific ASN1 signing routines.
+ New function ASN1_item_sign_ctx() signs a pre-initialised
+ EVP_MD_CTX structure and sets AlgorithmIdentifiers based on
+ the appropriate parameters.
+ [Steve Henson]
+
+ *) Add new algorithm specific ASN1 verification initialisation function
+ to EVP_PKEY_ASN1_METHOD: this is not in EVP_PKEY_METHOD since the ASN1
+ handling will be the same no matter what EVP_PKEY_METHOD is used.
+ Add a PSS handler to support verification of PSS signatures: checked
+ against a number of sample certificates.
+ [Steve Henson]
+
+ *) Add signature printing for PSS. Add PSS OIDs.
+ [Steve Henson, Martin Kaiser <lists@kaiser.cx>]
+
+ *) Add algorithm specific signature printing. An individual ASN1 method
+ can now print out signatures instead of the standard hex dump.
+
+ More complex signatures (e.g. PSS) can print out more meaningful
+ information. Include DSA version that prints out the signature
+ parameters r, s.
+ [Steve Henson]
+
+ *) Password based recipient info support for CMS library: implementing
+ RFC3211.
+ [Steve Henson]
+
+ *) Split password based encryption into PBES2 and PBKDF2 functions. This
+ neatly separates the code into cipher and PBE sections and is required
+ for some algorithms that split PBES2 into separate pieces (such as
+ password based CMS).
+ [Steve Henson]
+
+ *) Session-handling fixes:
+ - Fix handling of connections that are resuming with a session ID,
+ but also support Session Tickets.
+ - Fix a bug that suppressed issuing of a new ticket if the client
+ presented a ticket with an expired session.
+ - Try to set the ticket lifetime hint to something reasonable.
+ - Make tickets shorter by excluding irrelevant information.
+ - On the client side, don't ignore renewed tickets.
+ [Adam Langley, Bodo Moeller (Google)]
+
+ *) Fix PSK session representation.
+ [Bodo Moeller]
+
+ *) Add RC4-MD5 and AESNI-SHA1 "stitched" implementations.
+
+ This work was sponsored by Intel.
+ [Andy Polyakov]
+
+ *) Add GCM support to TLS library. Some custom code is needed to split
+ the IV between the fixed (from PRF) and explicit (from TLS record)
+ portions. This adds all GCM ciphersuites supported by RFC5288 and
+ RFC5289. Generalise some AES* cipherstrings to include GCM and
+ add a special AESGCM string for GCM only.
+ [Steve Henson]
+
+ *) Expand range of ctrls for AES GCM. Permit setting invocation
+ field on decrypt and retrieval of invocation field only on encrypt.
+ [Steve Henson]
+
+ *) Add HMAC ECC ciphersuites from RFC5289. Include SHA384 PRF support.
+ As required by RFC5289 these ciphersuites cannot be used if for
+ versions of TLS earlier than 1.2.
+ [Steve Henson]
+
+ *) For FIPS capable OpenSSL interpret a NULL default public key method
+ as unset and return the appropriate default but do *not* set the default.
+ This means we can return the appropriate method in applications that
+ switch between FIPS and non-FIPS modes.
+ [Steve Henson]
+
+ *) Redirect HMAC and CMAC operations to FIPS module in FIPS mode. If an
+ ENGINE is used then we cannot handle that in the FIPS module so we
+ keep original code iff non-FIPS operations are allowed.
+ [Steve Henson]
+
+ *) Add -attime option to openssl utilities.
+ [Peter Eckersley <pde@eff.org>, Ben Laurie and Steve Henson]
+
+ *) Redirect DSA and DH operations to FIPS module in FIPS mode.
+ [Steve Henson]
+
+ *) Redirect ECDSA and ECDH operations to FIPS module in FIPS mode. Also use
+ FIPS EC methods unconditionally for now.
+ [Steve Henson]
+
+ *) New build option no-ec2m to disable characteristic 2 code.
+ [Steve Henson]
+
+ *) Backport libcrypto audit of return value checking from 1.1.0-dev; not
+ all cases can be covered as some introduce binary incompatibilities.
+ [Steve Henson]
+
+ *) Redirect RSA operations to FIPS module including keygen,
+ encrypt, decrypt, sign and verify. Block use of non FIPS RSA methods.
+ [Steve Henson]
+
+ *) Add similar low level API blocking to ciphers.
+ [Steve Henson]
+
+ *) Low level digest APIs are not approved in FIPS mode: any attempt
+ to use these will cause a fatal error. Applications that *really* want
+ to use them can use the private_* version instead.
+ [Steve Henson]
+
+ *) Redirect cipher operations to FIPS module for FIPS builds.
+ [Steve Henson]
+
+ *) Redirect digest operations to FIPS module for FIPS builds.
+ [Steve Henson]
+
+ *) Update build system to add "fips" flag which will link in fipscanister.o
+ for static and shared library builds embedding a signature if needed.
+ [Steve Henson]
+
+ *) Output TLS supported curves in preference order instead of numerical
+ order. This is currently hardcoded for the highest order curves first.
+ This should be configurable so applications can judge speed vs strength.
+ [Steve Henson]
+
+ *) Add TLS v1.2 server support for client authentication.
+ [Steve Henson]
+
+ *) Add support for FIPS mode in ssl library: disable SSLv3, non-FIPS ciphers
+ and enable MD5.
+ [Steve Henson]
+
+ *) Functions FIPS_mode_set() and FIPS_mode() which call the underlying
+ FIPS modules versions.
+ [Steve Henson]
+
+ *) Add TLS v1.2 client side support for client authentication. Keep cache
+ of handshake records longer as we don't know the hash algorithm to use
+ until after the certificate request message is received.
+ [Steve Henson]
+
+ *) Initial TLS v1.2 client support. Add a default signature algorithms
+ extension including all the algorithms we support. Parse new signature
+ format in client key exchange. Relax some ECC signing restrictions for
+ TLS v1.2 as indicated in RFC5246.
+ [Steve Henson]
+
+ *) Add server support for TLS v1.2 signature algorithms extension. Switch
+ to new signature format when needed using client digest preference.
+ All server ciphersuites should now work correctly in TLS v1.2. No client
+ support yet and no support for client certificates.
+ [Steve Henson]
+
+ *) Initial TLS v1.2 support. Add new SHA256 digest to ssl code, switch
+ to SHA256 for PRF when using TLS v1.2 and later. Add new SHA256 based
+ ciphersuites. At present only RSA key exchange ciphersuites work with
+ TLS v1.2. Add new option for TLS v1.2 replacing the old and obsolete
+ SSL_OP_PKCS1_CHECK flags with SSL_OP_NO_TLSv1_2. New TLSv1.2 methods
+ and version checking.
+ [Steve Henson]
+
+ *) New option OPENSSL_NO_SSL_INTERN. If an application can be compiled
+ with this defined it will not be affected by any changes to ssl internal
+ structures. Add several utility functions to allow openssl application
+ to work with OPENSSL_NO_SSL_INTERN defined.
+ [Steve Henson]
+
+ *) A long standing patch to add support for SRP from EdelWeb (Peter
+ Sylvester and Christophe Renou) was integrated.
+ [Christophe Renou <christophe.renou@edelweb.fr>, Peter Sylvester
+ <peter.sylvester@edelweb.fr>, Tom Wu <tjw@cs.stanford.edu>, and
+ Ben Laurie]
+
+ *) Add functions to copy EVP_PKEY_METHOD and retrieve flags and id.
+ [Steve Henson]
+
+ *) Permit abbreviated handshakes when renegotiating using the function
+ SSL_renegotiate_abbreviated().
+ [Robin Seggelmann <seggelmann@fh-muenster.de>]
+
+ *) Add call to ENGINE_register_all_complete() to
+ ENGINE_load_builtin_engines(), so some implementations get used
+ automatically instead of needing explicit application support.
+ [Steve Henson]
+
+ *) Add support for TLS key exporter as described in RFC5705.
+ [Robin Seggelmann <seggelmann@fh-muenster.de>, Steve Henson]
+
+ *) Initial TLSv1.1 support. Since TLSv1.1 is very similar to TLS v1.0 only
+ a few changes are required:
+
+ Add SSL_OP_NO_TLSv1_1 flag.
+ Add TLSv1_1 methods.
+ Update version checking logic to handle version 1.1.
+ Add explicit IV handling (ported from DTLS code).
+ Add command line options to s_client/s_server.
+ [Steve Henson]
+
+ Changes between 1.0.0g and 1.0.0h [12 Mar 2012]
+
+ *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness
+ in CMS and PKCS7 code. When RSA decryption fails use a random key for
+ content decryption and always return the same error. Note: this attack
+ needs on average 2^20 messages so it only affects automated senders. The
+ old behaviour can be re-enabled in the CMS code by setting the
+ CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where
+ an MMA defence is not necessary.
+ Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for discovering
+ this issue. (CVE-2012-0884)
+ [Steve Henson]
+
+ *) Fix CVE-2011-4619: make sure we really are receiving a
+ client hello before rejecting multiple SGC restarts. Thanks to
+ Ivan Nestlerode <inestlerode@us.ibm.com> for discovering this bug.
+ [Steve Henson]
+
+ Changes between 1.0.0f and 1.0.0g [18 Jan 2012]
+
+ *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109.
+ Thanks to Antonio Martin, Enterprise Secure Access Research and
+ Development, Cisco Systems, Inc. for discovering this bug and
+ preparing a fix. (CVE-2012-0050)
+ [Antonio Martin]
+
+ Changes between 1.0.0e and 1.0.0f [4 Jan 2012]
+
+ *) Nadhem Alfardan and Kenny Paterson have discovered an extension
+ of the Vaudenay padding oracle attack on CBC mode encryption
+ which enables an efficient plaintext recovery attack against
+ the OpenSSL implementation of DTLS. Their attack exploits timing
+ differences arising during decryption processing. A research
+ paper describing this attack can be found at:
+ http://www.isg.rhul.ac.uk/~kp/dtls.pdf
+ Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
+ Security Group at Royal Holloway, University of London
+ (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann
+ <seggelmann@fh-muenster.de> and Michael Tuexen <tuexen@fh-muenster.de>
+ for preparing the fix. (CVE-2011-4108)
+ [Robin Seggelmann, Michael Tuexen]
+
+ *) Clear bytes used for block padding of SSL 3.0 records.
+ (CVE-2011-4576)
+ [Adam Langley (Google)]
+
+ *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George
+ Kadianakis <desnacked@gmail.com> for discovering this issue and
+ Adam Langley for preparing the fix. (CVE-2011-4619)
+ [Adam Langley (Google)]
+
+ *) Check parameters are not NULL in GOST ENGINE. (CVE-2012-0027)
+ [Andrey Kulikov <amdeich@gmail.com>]
+
+ *) Prevent malformed RFC3779 data triggering an assertion failure.
+ Thanks to Andrew Chi, BBN Technologies, for discovering the flaw
+ and Rob Austein <sra@hactrn.net> for fixing it. (CVE-2011-4577)
+ [Rob Austein <sra@hactrn.net>]
+
+ *) Improved PRNG seeding for VOS.
+ [Paul Green <Paul.Green@stratus.com>]
+
+ *) Fix ssl_ciph.c set-up race.
+ [Adam Langley (Google)]
+
+ *) Fix spurious failures in ecdsatest.c.
+ [Emilia Käsper (Google)]
+
+ *) Fix the BIO_f_buffer() implementation (which was mixing different
+ interpretations of the '..._len' fields).
+ [Adam Langley (Google)]
+
+ *) Fix handling of BN_BLINDING: now BN_BLINDING_invert_ex (rather than
+ BN_BLINDING_invert_ex) calls BN_BLINDING_update, ensuring that concurrent
+ threads won't reuse the same blinding coefficients.
+
+ This also avoids the need to obtain the CRYPTO_LOCK_RSA_BLINDING
+ lock to call BN_BLINDING_invert_ex, and avoids one use of
+ BN_BLINDING_update for each BN_BLINDING structure (previously,
+ the last update always remained unused).
+ [Emilia Käsper (Google)]
+
+ *) In ssl3_clear, preserve s3->init_extra along with s3->rbuf.
+ [Bob Buckholz (Google)]
+
+ Changes between 1.0.0d and 1.0.0e [6 Sep 2011]
+
+ *) Fix bug where CRLs with nextUpdate in the past are sometimes accepted
+ by initialising X509_STORE_CTX properly. (CVE-2011-3207)
+ [Kaspar Brand <ossl@velox.ch>]
+
+ *) Fix SSL memory handling for (EC)DH ciphersuites, in particular
+ for multi-threaded use of ECDH. (CVE-2011-3210)
+ [Adam Langley (Google)]
+
+ *) Fix x509_name_ex_d2i memory leak on bad inputs.
+ [Bodo Moeller]
+
+ *) Remove hard coded ecdsaWithSHA1 signature tests in ssl code and check
+ signature public key algorithm by using OID xref utilities instead.
+ Before this you could only use some ECC ciphersuites with SHA1 only.
+ [Steve Henson]
+
+ *) Add protection against ECDSA timing attacks as mentioned in the paper
+ by Billy Bob Brumley and Nicola Tuveri, see:
+
+ http://eprint.iacr.org/2011/232.pdf
+
+ [Billy Bob Brumley and Nicola Tuveri]
+
+ Changes between 1.0.0c and 1.0.0d [8 Feb 2011]
+
+ *) Fix parsing of OCSP stapling ClientHello extension. CVE-2011-0014
+ [Neel Mehta, Adam Langley, Bodo Moeller (Google)]
+
+ *) Fix bug in string printing code: if *any* escaping is enabled we must
+ escape the escape character (backslash) or the resulting string is
+ ambiguous.
+ [Steve Henson]
+
+ Changes between 1.0.0b and 1.0.0c [2 Dec 2010]
+
+ *) Disable code workaround for ancient and obsolete Netscape browsers
+ and servers: an attacker can use it in a ciphersuite downgrade attack.
+ Thanks to Martin Rex for discovering this bug. CVE-2010-4180
+ [Steve Henson]
+
+ *) Fixed J-PAKE implementation error, originally discovered by
+ Sebastien Martini, further info and confirmation from Stefan
+ Arentz and Feng Hao. Note that this fix is a security fix. CVE-2010-4252
+ [Ben Laurie]
+
+ Changes between 1.0.0a and 1.0.0b [16 Nov 2010]
+
+ *) Fix extension code to avoid race conditions which can result in a buffer
+ overrun vulnerability: resumed sessions must not be modified as they can
+ be shared by multiple threads. CVE-2010-3864
+ [Steve Henson]
+
+ *) Fix WIN32 build system to correctly link an ENGINE directory into
+ a DLL.
+ [Steve Henson]
+
+ Changes between 1.0.0 and 1.0.0a [01 Jun 2010]
+
+ *) Check return value of int_rsa_verify in pkey_rsa_verifyrecover
+ (CVE-2010-1633)
+ [Steve Henson, Peter-Michael Hager <hager@dortmund.net>]
+
+ Changes between 0.9.8n and 1.0.0 [29 Mar 2010]
+
+ *) Add "missing" function EVP_CIPHER_CTX_copy(). This copies a cipher
+ context. The operation can be customised via the ctrl mechanism in
+ case ENGINEs want to include additional functionality.
+ [Steve Henson]
+
+ *) Tolerate yet another broken PKCS#8 key format: private key value negative.
+ [Steve Henson]
+
+ *) Add new -subject_hash_old and -issuer_hash_old options to x509 utility to
+ output hashes compatible with older versions of OpenSSL.
+ [Willy Weisz <weisz@vcpc.univie.ac.at>]
+
+ *) Fix compression algorithm handling: if resuming a session use the
+ compression algorithm of the resumed session instead of determining
+ it from client hello again. Don't allow server to change algorithm.
+ [Steve Henson]
+
+ *) Add load_crls() function to apps tidying load_certs() too. Add option
+ to verify utility to allow additional CRLs to be included.
+ [Steve Henson]
+
+ *) Update OCSP request code to permit adding custom headers to the request:
+ some responders need this.
+ [Steve Henson]
+
+ *) The function EVP_PKEY_sign() returns <=0 on error: check return code
+ correctly.
+ [Julia Lawall <julia@diku.dk>]
+
+ *) Update verify callback code in apps/s_cb.c and apps/verify.c, it
+ needlessly dereferenced structures, used obsolete functions and
+ didn't handle all updated verify codes correctly.
+ [Steve Henson]
+
+ *) Disable MD2 in the default configuration.
+ [Steve Henson]
+
+ *) In BIO_pop() and BIO_push() use the ctrl argument (which was NULL) to
+ indicate the initial BIO being pushed or popped. This makes it possible
+ to determine whether the BIO is the one explicitly called or as a result
+ of the ctrl being passed down the chain. Fix BIO_pop() and SSL BIOs so
+ it handles reference counts correctly and doesn't zero out the I/O bio
+ when it is not being explicitly popped. WARNING: applications which
+ included workarounds for the old buggy behaviour will need to be modified
+ or they could free up already freed BIOs.
+ [Steve Henson]
+
+ *) Extend the uni2asc/asc2uni => OPENSSL_uni2asc/OPENSSL_asc2uni
+ renaming to all platforms (within the 0.9.8 branch, this was
+ done conditionally on Netware platforms to avoid a name clash).
+ [Guenter <lists@gknw.net>]
+
+ *) Add ECDHE and PSK support to DTLS.
+ [Michael Tuexen <tuexen@fh-muenster.de>]
+
+ *) Add CHECKED_STACK_OF macro to safestack.h, otherwise safestack can't
+ be used on C++.
+ [Steve Henson]
+
+ *) Add "missing" function EVP_MD_flags() (without this the only way to
+ retrieve a digest flags is by accessing the structure directly. Update
+ EVP_MD_do_all*() and EVP_CIPHER_do_all*() to include the name a digest
+ or cipher is registered as in the "from" argument. Print out all
+ registered digests in the dgst usage message instead of manually
+ attempting to work them out.
+ [Steve Henson]
+
+ *) If no SSLv2 ciphers are used don't use an SSLv2 compatible client hello:
+ this allows the use of compression and extensions. Change default cipher
+ string to remove SSLv2 ciphersuites. This effectively avoids ancient SSLv2
+ by default unless an application cipher string requests it.
+ [Steve Henson]
+
+ *) Alter match criteria in PKCS12_parse(). It used to try to use local
+ key ids to find matching certificates and keys but some PKCS#12 files
+ don't follow the (somewhat unwritten) rules and this strategy fails.
+ Now just gather all certificates together and the first private key
+ then look for the first certificate that matches the key.
+ [Steve Henson]
+
+ *) Support use of registered digest and cipher names for dgst and cipher
+ commands instead of having to add each one as a special case. So now
+ you can do:
+
+ openssl sha256 foo
+
+ as well as:
+
+ openssl dgst -sha256 foo
+
+ and this works for ENGINE based algorithms too.
+
+ [Steve Henson]
+
+ *) Update Gost ENGINE to support parameter files.
+ [Victor B. Wagner <vitus@cryptocom.ru>]
+
+ *) Support GeneralizedTime in ca utility.
+ [Oliver Martin <oliver@volatilevoid.net>, Steve Henson]
+
+ *) Enhance the hash format used for certificate directory links. The new
+ form uses the canonical encoding (meaning equivalent names will work
+ even if they aren't identical) and uses SHA1 instead of MD5. This form
+ is incompatible with the older format and as a result c_rehash should
+ be used to rebuild symbolic links.
+ [Steve Henson]
+
+ *) Make PKCS#8 the default write format for private keys, replacing the
+ traditional format. This form is standardised, more secure and doesn't
+ include an implicit MD5 dependency.
+ [Steve Henson]
+
+ *) Add a $gcc_devteam_warn option to Configure. The idea is that any code
+ committed to OpenSSL should pass this lot as a minimum.
+ [Steve Henson]
+
+ *) Add session ticket override functionality for use by EAP-FAST.
+ [Jouni Malinen <j@w1.fi>]
+
+ *) Modify HMAC functions to return a value. Since these can be implemented
+ in an ENGINE errors can occur.
+ [Steve Henson]
+
+ *) Type-checked OBJ_bsearch_ex.
+ [Ben Laurie]
+
+ *) Type-checked OBJ_bsearch. Also some constification necessitated
+ by type-checking. Still to come: TXT_DB, bsearch(?),
+ OBJ_bsearch_ex, qsort, CRYPTO_EX_DATA, ASN1_VALUE, ASN1_STRING,
+ CONF_VALUE.
+ [Ben Laurie]
+
+ *) New function OPENSSL_gmtime_adj() to add a specific number of days and
+ seconds to a tm structure directly, instead of going through OS
+ specific date routines. This avoids any issues with OS routines such
+ as the year 2038 bug. New *_adj() functions for ASN1 time structures
+ and X509_time_adj_ex() to cover the extended range. The existing
+ X509_time_adj() is still usable and will no longer have any date issues.
+ [Steve Henson]
+
+ *) Delta CRL support. New use deltas option which will attempt to locate
+ and search any appropriate delta CRLs available.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Support for CRLs partitioned by reason code. Reorganise CRL processing
+ code and add additional score elements. Validate alternate CRL paths
+ as part of the CRL checking and indicate a new error "CRL path validation
+ error" in this case. Applications wanting additional details can use
+ the verify callback and check the new "parent" field. If this is not
+ NULL CRL path validation is taking place. Existing applications won't
+ see this because it requires extended CRL support which is off by
+ default.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Support for freshest CRL extension.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Initial indirect CRL support. Currently only supported in the CRLs
+ passed directly and not via lookup. Process certificate issuer
+ CRL entry extension and lookup CRL entries by bother issuer name
+ and serial number. Check and process CRL issuer entry in IDP extension.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Add support for distinct certificate and CRL paths. The CRL issuer
+ certificate is validated separately in this case. Only enabled if
+ an extended CRL support flag is set: this flag will enable additional
+ CRL functionality in future.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Add support for policy mappings extension.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Fixes to pathlength constraint, self issued certificate handling,
+ policy processing to align with RFC3280 and PKITS tests.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Support for name constraints certificate extension. DN, email, DNS
+ and URI types are currently supported.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) To cater for systems that provide a pointer-based thread ID rather
+ than numeric, deprecate the current numeric thread ID mechanism and
+ replace it with a structure and associated callback type. This
+ mechanism allows a numeric "hash" to be extracted from a thread ID in
+ either case, and on platforms where pointers are larger than 'long',
+ mixing is done to help ensure the numeric 'hash' is usable even if it
+ can't be guaranteed unique. The default mechanism is to use "&errno"
+ as a pointer-based thread ID to distinguish between threads.
+
+ Applications that want to provide their own thread IDs should now use
+ CRYPTO_THREADID_set_callback() to register a callback that will call
+ either CRYPTO_THREADID_set_numeric() or CRYPTO_THREADID_set_pointer().
+
+ Note that ERR_remove_state() is now deprecated, because it is tied
+ to the assumption that thread IDs are numeric. ERR_remove_state(0)
+ to free the current thread's error state should be replaced by
+ ERR_remove_thread_state(NULL).
+
+ (This new approach replaces the functions CRYPTO_set_idptr_callback(),
+ CRYPTO_get_idptr_callback(), and CRYPTO_thread_idptr() that existed in
+ OpenSSL 0.9.9-dev between June 2006 and August 2008. Also, if an
+ application was previously providing a numeric thread callback that
+ was inappropriate for distinguishing threads, then uniqueness might
+ have been obtained with &errno that happened immediately in the
+ intermediate development versions of OpenSSL; this is no longer the
+ case, the numeric thread callback will now override the automatic use
+ of &errno.)
+ [Geoff Thorpe, with help from Bodo Moeller]
+
+ *) Initial support for different CRL issuing certificates. This covers a
+ simple case where the self issued certificates in the chain exist and
+ the real CRL issuer is higher in the existing chain.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Removed effectively defunct crypto/store from the build.
+ [Ben Laurie]
+
+ *) Revamp of STACK to provide stronger type-checking. Still to come:
+ TXT_DB, bsearch(?), OBJ_bsearch, qsort, CRYPTO_EX_DATA, ASN1_VALUE,
+ ASN1_STRING, CONF_VALUE.
+ [Ben Laurie]
+
+ *) Add a new SSL_MODE_RELEASE_BUFFERS mode flag to release unused buffer
+ RAM on SSL connections. This option can save about 34k per idle SSL.
+ [Nick Mathewson]
+
+ *) Revamp of LHASH to provide stronger type-checking. Still to come:
+ STACK, TXT_DB, bsearch, qsort.
+ [Ben Laurie]
+
+ *) Initial support for Cryptographic Message Syntax (aka CMS) based
+ on RFC3850, RFC3851 and RFC3852. New cms directory and cms utility,
+ support for data, signedData, compressedData, digestedData and
+ encryptedData, envelopedData types included. Scripts to check against
+ RFC4134 examples draft and interop and consistency checks of many
+ content types and variants.
+ [Steve Henson]
+
+ *) Add options to enc utility to support use of zlib compression BIO.
+ [Steve Henson]
+
+ *) Extend mk1mf to support importing of options and assembly language
+ files from Configure script, currently only included in VC-WIN32.
+ The assembly language rules can now optionally generate the source
+ files from the associated perl scripts.
+ [Steve Henson]
+
+ *) Implement remaining functionality needed to support GOST ciphersuites.
+ Interop testing has been performed using CryptoPro implementations.
+ [Victor B. Wagner <vitus@cryptocom.ru>]
+
+ *) s390x assembler pack.
+ [Andy Polyakov]
+
+ *) ARMv4 assembler pack. ARMv4 refers to v4 and later ISA, not CPU
+ "family."
+ [Andy Polyakov]
+
+ *) Implement Opaque PRF Input TLS extension as specified in
+ draft-rescorla-tls-opaque-prf-input-00.txt. Since this is not an
+ official specification yet and no extension type assignment by
+ IANA exists, this extension (for now) will have to be explicitly
+ enabled when building OpenSSL by providing the extension number
+ to use. For example, specify an option
+
+ -DTLSEXT_TYPE_opaque_prf_input=0x9527
+
+ to the "config" or "Configure" script to enable the extension,
+ assuming extension number 0x9527 (which is a completely arbitrary
+ and unofficial assignment based on the MD5 hash of the Internet
+ Draft). Note that by doing so, you potentially lose
+ interoperability with other TLS implementations since these might
+ be using the same extension number for other purposes.
+
+ SSL_set_tlsext_opaque_prf_input(ssl, src, len) is used to set the
+ opaque PRF input value to use in the handshake. This will create
+ an interal copy of the length-'len' string at 'src', and will
+ return non-zero for success.
+
+ To get more control and flexibility, provide a callback function
+ by using
+
+ SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx, cb)
+ SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx, arg)
+
+ where
+
+ int (*cb)(SSL *, void *peerinput, size_t len, void *arg);
+ void *arg;
+
+ Callback function 'cb' will be called in handshakes, and is
+ expected to use SSL_set_tlsext_opaque_prf_input() as appropriate.
+ Argument 'arg' is for application purposes (the value as given to
+ SSL_CTX_set_tlsext_opaque_prf_input_callback_arg() will directly
+ be provided to the callback function). The callback function
+ has to return non-zero to report success: usually 1 to use opaque
+ PRF input just if possible, or 2 to enforce use of the opaque PRF
+ input. In the latter case, the library will abort the handshake
+ if opaque PRF input is not successfully negotiated.
+
+ Arguments 'peerinput' and 'len' given to the callback function
+ will always be NULL and 0 in the case of a client. A server will
+ see the client's opaque PRF input through these variables if
+ available (NULL and 0 otherwise). Note that if the server
+ provides an opaque PRF input, the length must be the same as the
+ length of the client's opaque PRF input.
+
+ Note that the callback function will only be called when creating
+ a new session (session resumption can resume whatever was
+ previously negotiated), and will not be called in SSL 2.0
+ handshakes; thus, SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2) or
+ SSL_set_options(ssl, SSL_OP_NO_SSLv2) is especially recommended
+ for applications that need to enforce opaque PRF input.
+
+ [Bodo Moeller]
+
+ *) Update ssl code to support digests other than SHA1+MD5 for handshake
+ MAC.
+
+ [Victor B. Wagner <vitus@cryptocom.ru>]
+
+ *) Add RFC4507 support to OpenSSL. This includes the corrections in
+ RFC4507bis. The encrypted ticket format is an encrypted encoded
+ SSL_SESSION structure, that way new session features are automatically
+ supported.
+
+ If a client application caches session in an SSL_SESSION structure
+ support is transparent because tickets are now stored in the encoded
+ SSL_SESSION.
+
+ The SSL_CTX structure automatically generates keys for ticket
+ protection in servers so again support should be possible
+ with no application modification.
+
+ If a client or server wishes to disable RFC4507 support then the option
+ SSL_OP_NO_TICKET can be set.
+
+ Add a TLS extension debugging callback to allow the contents of any client
+ or server extensions to be examined.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Final changes to avoid use of pointer pointer casts in OpenSSL.
+ OpenSSL should now compile cleanly on gcc 4.2
+ [Peter Hartley <pdh@utter.chaos.org.uk>, Steve Henson]
+
+ *) Update SSL library to use new EVP_PKEY MAC API. Include generic MAC
+ support including streaming MAC support: this is required for GOST
+ ciphersuite support.
+ [Victor B. Wagner <vitus@cryptocom.ru>, Steve Henson]
+
+ *) Add option -stream to use PKCS#7 streaming in smime utility. New
+ function i2d_PKCS7_bio_stream() and PEM_write_PKCS7_bio_stream()
+ to output in BER and PEM format.
+ [Steve Henson]
+
+ *) Experimental support for use of HMAC via EVP_PKEY interface. This
+ allows HMAC to be handled via the EVP_DigestSign*() interface. The
+ EVP_PKEY "key" in this case is the HMAC key, potentially allowing
+ ENGINE support for HMAC keys which are unextractable. New -mac and
+ -macopt options to dgst utility.
+ [Steve Henson]
+
+ *) New option -sigopt to dgst utility. Update dgst to use
+ EVP_Digest{Sign,Verify}*. These two changes make it possible to use
+ alternative signing parameters such as X9.31 or PSS in the dgst
+ utility.
+ [Steve Henson]
+
+ *) Change ssl_cipher_apply_rule(), the internal function that does
+ the work each time a ciphersuite string requests enabling
+ ("foo+bar"), moving ("+foo+bar"), disabling ("-foo+bar", or
+ removing ("!foo+bar") a class of ciphersuites: Now it maintains
+ the order of disabled ciphersuites such that those ciphersuites
+ that most recently went from enabled to disabled not only stay
+ in order with respect to each other, but also have higher priority
+ than other disabled ciphersuites the next time ciphersuites are
+ enabled again.
+
+ This means that you can now say, e.g., "PSK:-PSK:HIGH" to enable
+ the same ciphersuites as with "HIGH" alone, but in a specific
+ order where the PSK ciphersuites come first (since they are the
+ most recently disabled ciphersuites when "HIGH" is parsed).
+
+ Also, change ssl_create_cipher_list() (using this new
+ funcionality) such that between otherwise identical
+ cihpersuites, ephemeral ECDH is preferred over ephemeral DH in
+ the default order.
+ [Bodo Moeller]
+
+ *) Change ssl_create_cipher_list() so that it automatically
+ arranges the ciphersuites in reasonable order before starting
+ to process the rule string. Thus, the definition for "DEFAULT"
+ (SSL_DEFAULT_CIPHER_LIST) now is just "ALL:!aNULL:!eNULL", but
+ remains equivalent to "AES:ALL:!aNULL:!eNULL:+aECDH:+kRSA:+RC4:@STRENGTH".
+ This makes it much easier to arrive at a reasonable default order
+ in applications for which anonymous ciphers are OK (meaning
+ that you can't actually use DEFAULT).
+ [Bodo Moeller; suggested by Victor Duchovni]
+
+ *) Split the SSL/TLS algorithm mask (as used for ciphersuite string
+ processing) into multiple integers instead of setting
+ "SSL_MKEY_MASK" bits, "SSL_AUTH_MASK" bits, "SSL_ENC_MASK",
+ "SSL_MAC_MASK", and "SSL_SSL_MASK" bits all in a single integer.
+ (These masks as well as the individual bit definitions are hidden
+ away into the non-exported interface ssl/ssl_locl.h, so this
+ change to the definition of the SSL_CIPHER structure shouldn't
+ affect applications.) This give us more bits for each of these
+ categories, so there is no longer a need to coagulate AES128 and
+ AES256 into a single algorithm bit, and to coagulate Camellia128
+ and Camellia256 into a single algorithm bit, which has led to all
+ kinds of kludges.
+
+ Thus, among other things, the kludge introduced in 0.9.7m and
+ 0.9.8e for masking out AES256 independently of AES128 or masking
+ out Camellia256 independently of AES256 is not needed here in 0.9.9.
+
+ With the change, we also introduce new ciphersuite aliases that
+ so far were missing: "AES128", "AES256", "CAMELLIA128", and
+ "CAMELLIA256".
+ [Bodo Moeller]
+
+ *) Add support for dsa-with-SHA224 and dsa-with-SHA256.
+ Use the leftmost N bytes of the signature input if the input is
+ larger than the prime q (with N being the size in bytes of q).
+ [Nils Larsch]
+
+ *) Very *very* experimental PKCS#7 streaming encoder support. Nothing uses
+ it yet and it is largely untested.
+ [Steve Henson]
+
+ *) Add support for the ecdsa-with-SHA224/256/384/512 signature types.
+ [Nils Larsch]
+
+ *) Initial incomplete changes to avoid need for function casts in OpenSSL
+ some compilers (gcc 4.2 and later) reject their use. Safestack is
+ reimplemented. Update ASN1 to avoid use of legacy functions.
+ [Steve Henson]
+
+ *) Win32/64 targets are linked with Winsock2.
+ [Andy Polyakov]
+
+ *) Add an X509_CRL_METHOD structure to allow CRL processing to be redirected
+ to external functions. This can be used to increase CRL handling
+ efficiency especially when CRLs are very large by (for example) storing
+ the CRL revoked certificates in a database.
+ [Steve Henson]
+
+ *) Overhaul of by_dir code. Add support for dynamic loading of CRLs so
+ new CRLs added to a directory can be used. New command line option
+ -verify_return_error to s_client and s_server. This causes real errors
+ to be returned by the verify callback instead of carrying on no matter
+ what. This reflects the way a "real world" verify callback would behave.
+ [Steve Henson]
+
+ *) GOST engine, supporting several GOST algorithms and public key formats.
+ Kindly donated by Cryptocom.
+ [Cryptocom]
+
+ *) Partial support for Issuing Distribution Point CRL extension. CRLs
+ partitioned by DP are handled but no indirect CRL or reason partitioning
+ (yet). Complete overhaul of CRL handling: now the most suitable CRL is
+ selected via a scoring technique which handles IDP and AKID in CRLs.
+ [Steve Henson]
+
+ *) New X509_STORE_CTX callbacks lookup_crls() and lookup_certs() which
+ will ultimately be used for all verify operations: this will remove the
+ X509_STORE dependency on certificate verification and allow alternative
+ lookup methods. X509_STORE based implementations of these two callbacks.
+ [Steve Henson]
+
+ *) Allow multiple CRLs to exist in an X509_STORE with matching issuer names.
+ Modify get_crl() to find a valid (unexpired) CRL if possible.
+ [Steve Henson]
+
+ *) New function X509_CRL_match() to check if two CRLs are identical. Normally
+ this would be called X509_CRL_cmp() but that name is already used by
+ a function that just compares CRL issuer names. Cache several CRL
+ extensions in X509_CRL structure and cache CRLDP in X509.
+ [Steve Henson]
+
+ *) Store a "canonical" representation of X509_NAME structure (ASN1 Name)
+ this maps equivalent X509_NAME structures into a consistent structure.
+ Name comparison can then be performed rapidly using memcmp().
+ [Steve Henson]
+
+ *) Non-blocking OCSP request processing. Add -timeout option to ocsp
+ utility.
+ [Steve Henson]
+
+ *) Allow digests to supply their own micalg string for S/MIME type using
+ the ctrl EVP_MD_CTRL_MICALG.
+ [Steve Henson]
+
+ *) During PKCS7 signing pass the PKCS7 SignerInfo structure to the
+ EVP_PKEY_METHOD before and after signing via the EVP_PKEY_CTRL_PKCS7_SIGN
+ ctrl. It can then customise the structure before and/or after signing
+ if necessary.
+ [Steve Henson]
+
+ *) New function OBJ_add_sigid() to allow application defined signature OIDs
+ to be added to OpenSSLs internal tables. New function OBJ_sigid_free()
+ to free up any added signature OIDs.
+ [Steve Henson]
+
+ *) New functions EVP_CIPHER_do_all(), EVP_CIPHER_do_all_sorted(),
+ EVP_MD_do_all() and EVP_MD_do_all_sorted() to enumerate internal
+ digest and cipher tables. New options added to openssl utility:
+ list-message-digest-algorithms and list-cipher-algorithms.
+ [Steve Henson]
+
+ *) Change the array representation of binary polynomials: the list
+ of degrees of non-zero coefficients is now terminated with -1.
+ Previously it was terminated with 0, which was also part of the
+ value; thus, the array representation was not applicable to
+ polynomials where t^0 has coefficient zero. This change makes
+ the array representation useful in a more general context.
+ [Douglas Stebila]
+
+ *) Various modifications and fixes to SSL/TLS cipher string
+ handling. For ECC, the code now distinguishes between fixed ECDH
+ with RSA certificates on the one hand and with ECDSA certificates
+ on the other hand, since these are separate ciphersuites. The
+ unused code for Fortezza ciphersuites has been removed.
+
+ For consistency with EDH, ephemeral ECDH is now called "EECDH"
+ (not "ECDHE"). For consistency with the code for DH
+ certificates, use of ECDH certificates is now considered ECDH
+ authentication, not RSA or ECDSA authentication (the latter is
+ merely the CA's signing algorithm and not actively used in the
+ protocol).
+
+ The temporary ciphersuite alias "ECCdraft" is no longer
+ available, and ECC ciphersuites are no longer excluded from "ALL"
+ and "DEFAULT". The following aliases now exist for RFC 4492
+ ciphersuites, most of these by analogy with the DH case:
+
+ kECDHr - ECDH cert, signed with RSA
+ kECDHe - ECDH cert, signed with ECDSA
+ kECDH - ECDH cert (signed with either RSA or ECDSA)
+ kEECDH - ephemeral ECDH
+ ECDH - ECDH cert or ephemeral ECDH
+
+ aECDH - ECDH cert
+ aECDSA - ECDSA cert
+ ECDSA - ECDSA cert
+
+ AECDH - anonymous ECDH
+ EECDH - non-anonymous ephemeral ECDH (equivalent to "kEECDH:-AECDH")
+
+ [Bodo Moeller]
+
+ *) Add additional S/MIME capabilities for AES and GOST ciphers if supported.
+ Use correct micalg parameters depending on digest(s) in signed message.
+ [Steve Henson]
+
+ *) Add engine support for EVP_PKEY_ASN1_METHOD. Add functions to process
+ an ENGINE asn1 method. Support ENGINE lookups in the ASN1 code.
+ [Steve Henson]
+
+ *) Initial engine support for EVP_PKEY_METHOD. New functions to permit
+ an engine to register a method. Add ENGINE lookups for methods and
+ functional reference processing.
+ [Steve Henson]
+
+ *) New functions EVP_Digest{Sign,Verify)*. These are enchance versions of
+ EVP_{Sign,Verify}* which allow an application to customise the signature
+ process.
+ [Steve Henson]
+
+ *) New -resign option to smime utility. This adds one or more signers
+ to an existing PKCS#7 signedData structure. Also -md option to use an
+ alternative message digest algorithm for signing.
+ [Steve Henson]
+
+ *) Tidy up PKCS#7 routines and add new functions to make it easier to
+ create PKCS7 structures containing multiple signers. Update smime
+ application to support multiple signers.
+ [Steve Henson]
+
+ *) New -macalg option to pkcs12 utility to allow setting of an alternative
+ digest MAC.
+ [Steve Henson]
+
+ *) Initial support for PKCS#5 v2.0 PRFs other than default SHA1 HMAC.
+ Reorganize PBE internals to lookup from a static table using NIDs,
+ add support for HMAC PBE OID translation. Add a EVP_CIPHER ctrl:
+ EVP_CTRL_PBE_PRF_NID this allows a cipher to specify an alternative
+ PRF which will be automatically used with PBES2.
+ [Steve Henson]
+
+ *) Replace the algorithm specific calls to generate keys in "req" with the
+ new API.
+ [Steve Henson]
+
+ *) Update PKCS#7 enveloped data routines to use new API. This is now
+ supported by any public key method supporting the encrypt operation. A
+ ctrl is added to allow the public key algorithm to examine or modify
+ the PKCS#7 RecipientInfo structure if it needs to: for RSA this is
+ a no op.
+ [Steve Henson]
+
+ *) Add a ctrl to asn1 method to allow a public key algorithm to express
+ a default digest type to use. In most cases this will be SHA1 but some
+ algorithms (such as GOST) need to specify an alternative digest. The
+ return value indicates how strong the preference is 1 means optional and
+ 2 is mandatory (that is it is the only supported type). Modify
+ ASN1_item_sign() to accept a NULL digest argument to indicate it should
+ use the default md. Update openssl utilities to use the default digest
+ type for signing if it is not explicitly indicated.
+ [Steve Henson]
+
+ *) Use OID cross reference table in ASN1_sign() and ASN1_verify(). New
+ EVP_MD flag EVP_MD_FLAG_PKEY_METHOD_SIGNATURE. This uses the relevant
+ signing method from the key type. This effectively removes the link
+ between digests and public key types.
+ [Steve Henson]
+
+ *) Add an OID cross reference table and utility functions. Its purpose is to
+ translate between signature OIDs such as SHA1WithrsaEncryption and SHA1,
+ rsaEncryption. This will allow some of the algorithm specific hackery
+ needed to use the correct OID to be removed.
+ [Steve Henson]
+
+ *) Remove algorithm specific dependencies when setting PKCS7_SIGNER_INFO
+ structures for PKCS7_sign(). They are now set up by the relevant public
+ key ASN1 method.
+ [Steve Henson]
+
+ *) Add provisional EC pkey method with support for ECDSA and ECDH.
+ [Steve Henson]
+
+ *) Add support for key derivation (agreement) in the API, DH method and
+ pkeyutl.
+ [Steve Henson]
+
+ *) Add DSA pkey method and DH pkey methods, extend DH ASN1 method to support
+ public and private key formats. As a side effect these add additional
+ command line functionality not previously available: DSA signatures can be
+ generated and verified using pkeyutl and DH key support and generation in
+ pkey, genpkey.
+ [Steve Henson]
+
+ *) BeOS support.
+ [Oliver Tappe <zooey@hirschkaefer.de>]
+
+ *) New make target "install_html_docs" installs HTML renditions of the
+ manual pages.
+ [Oliver Tappe <zooey@hirschkaefer.de>]
+
+ *) New utility "genpkey" this is analogous to "genrsa" etc except it can
+ generate keys for any algorithm. Extend and update EVP_PKEY_METHOD to
+ support key and parameter generation and add initial key generation
+ functionality for RSA.
+ [Steve Henson]
+
+ *) Add functions for main EVP_PKEY_method operations. The undocumented
+ functions EVP_PKEY_{encrypt,decrypt} have been renamed to
+ EVP_PKEY_{encrypt,decrypt}_old.
+ [Steve Henson]
+
+ *) Initial definitions for EVP_PKEY_METHOD. This will be a high level public
+ key API, doesn't do much yet.
+ [Steve Henson]
+
+ *) New function EVP_PKEY_asn1_get0_info() to retrieve information about
+ public key algorithms. New option to openssl utility:
+ "list-public-key-algorithms" to print out info.
+ [Steve Henson]
+
+ *) Implement the Supported Elliptic Curves Extension for
+ ECC ciphersuites from draft-ietf-tls-ecc-12.txt.
+ [Douglas Stebila]
+
+ *) Don't free up OIDs in OBJ_cleanup() if they are in use by EVP_MD or
+ EVP_CIPHER structures to avoid later problems in EVP_cleanup().
+ [Steve Henson]
+
+ *) New utilities pkey and pkeyparam. These are similar to algorithm specific
+ utilities such as rsa, dsa, dsaparam etc except they process any key
+ type.
+ [Steve Henson]
+
+ *) Transfer public key printing routines to EVP_PKEY_ASN1_METHOD. New
+ functions EVP_PKEY_print_public(), EVP_PKEY_print_private(),
+ EVP_PKEY_print_param() to print public key data from an EVP_PKEY
+ structure.
+ [Steve Henson]
+
+ *) Initial support for pluggable public key ASN1.
+ De-spaghettify the public key ASN1 handling. Move public and private
+ key ASN1 handling to a new EVP_PKEY_ASN1_METHOD structure. Relocate
+ algorithm specific handling to a single module within the relevant
+ algorithm directory. Add functions to allow (near) opaque processing
+ of public and private key structures.
+ [Steve Henson]
+
+ *) Implement the Supported Point Formats Extension for
+ ECC ciphersuites from draft-ietf-tls-ecc-12.txt.
+ [Douglas Stebila]
+
+ *) Add initial support for RFC 4279 PSK TLS ciphersuites. Add members
+ for the psk identity [hint] and the psk callback functions to the
+ SSL_SESSION, SSL and SSL_CTX structure.
+
+ New ciphersuites:
+ PSK-RC4-SHA, PSK-3DES-EDE-CBC-SHA, PSK-AES128-CBC-SHA,
+ PSK-AES256-CBC-SHA
+
+ New functions:
+ SSL_CTX_use_psk_identity_hint
+ SSL_get_psk_identity_hint
+ SSL_get_psk_identity
+ SSL_use_psk_identity_hint
+
+ [Mika Kousa and Pasi Eronen of Nokia Corporation]
+
+ *) Add RFC 3161 compliant time stamp request creation, response generation
+ and response verification functionality.
+ [Zoltán Glózik <zglozik@opentsa.org>, The OpenTSA Project]
+
+ *) Add initial support for TLS extensions, specifically for the server_name
+ extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now
+ have new members for a host name. The SSL data structure has an
+ additional member SSL_CTX *initial_ctx so that new sessions can be
+ stored in that context to allow for session resumption, even after the
+ SSL has been switched to a new SSL_CTX in reaction to a client's
+ server_name extension.
+
+ New functions (subject to change):
+
+ SSL_get_servername()
+ SSL_get_servername_type()
+ SSL_set_SSL_CTX()
+
+ New CTRL codes and macros (subject to change):
+
+ SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
+ - SSL_CTX_set_tlsext_servername_callback()
+ SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG
+ - SSL_CTX_set_tlsext_servername_arg()
+ SSL_CTRL_SET_TLSEXT_HOSTNAME - SSL_set_tlsext_host_name()
+
+ openssl s_client has a new '-servername ...' option.
+
+ openssl s_server has new options '-servername_host ...', '-cert2 ...',
+ '-key2 ...', '-servername_fatal' (subject to change). This allows
+ testing the HostName extension for a specific single host name ('-cert'
+ and '-key' remain fallbacks for handshakes without HostName
+ negotiation). If the unrecognized_name alert has to be sent, this by
+ default is a warning; it becomes fatal with the '-servername_fatal'
+ option.
+
+ [Peter Sylvester, Remy Allais, Christophe Renou]
+
+ *) Whirlpool hash implementation is added.
+ [Andy Polyakov]
+
+ *) BIGNUM code on 64-bit SPARCv9 targets is switched from bn(64,64) to
+ bn(64,32). Because of instruction set limitations it doesn't have
+ any negative impact on performance. This was done mostly in order
+ to make it possible to share assembler modules, such as bn_mul_mont
+ implementations, between 32- and 64-bit builds without hassle.
+ [Andy Polyakov]
+
+ *) Move code previously exiled into file crypto/ec/ec2_smpt.c
+ to ec2_smpl.c, and no longer require the OPENSSL_EC_BIN_PT_COMP
+ macro.
+ [Bodo Moeller]
+
+ *) New candidate for BIGNUM assembler implementation, bn_mul_mont,
+ dedicated Montgomery multiplication procedure, is introduced.
+ BN_MONT_CTX is modified to allow bn_mul_mont to reach for higher
+ "64-bit" performance on certain 32-bit targets.
+ [Andy Polyakov]
+
+ *) New option SSL_OP_NO_COMP to disable use of compression selectively
+ in SSL structures. New SSL ctrl to set maximum send fragment size.
+ Save memory by seeting the I/O buffer sizes dynamically instead of
+ using the maximum available value.
+ [Steve Henson]
+
+ *) New option -V for 'openssl ciphers'. This prints the ciphersuite code
+ in addition to the text details.
+ [Bodo Moeller]
+
+ *) Very, very preliminary EXPERIMENTAL support for printing of general
+ ASN1 structures. This currently produces rather ugly output and doesn't
+ handle several customised structures at all.
+ [Steve Henson]
+
+ *) Integrated support for PVK file format and some related formats such
+ as MS PUBLICKEYBLOB and PRIVATEKEYBLOB. Command line switches to support
+ these in the 'rsa' and 'dsa' utilities.
+ [Steve Henson]
+
+ *) Support for PKCS#1 RSAPublicKey format on rsa utility command line.
+ [Steve Henson]
+
+ *) Remove the ancient ASN1_METHOD code. This was only ever used in one
+ place for the (very old) "NETSCAPE" format certificates which are now
+ handled using new ASN1 code equivalents.
+ [Steve Henson]
+
+ *) Let the TLSv1_method() etc. functions return a 'const' SSL_METHOD
+ pointer and make the SSL_METHOD parameter in SSL_CTX_new,
+ SSL_CTX_set_ssl_version and SSL_set_ssl_method 'const'.
+ [Nils Larsch]
+
+ *) Modify CRL distribution points extension code to print out previously
+ unsupported fields. Enhance extension setting code to allow setting of
+ all fields.
+ [Steve Henson]
+
+ *) Add print and set support for Issuing Distribution Point CRL extension.
+ [Steve Henson]
+
+ *) Change 'Configure' script to enable Camellia by default.
+ [NTT]
+
+ Changes between 0.9.8m and 0.9.8n [24 Mar 2010]
+
+ *) When rejecting SSL/TLS records due to an incorrect version number, never
+ update s->server with a new major version number. As of
+ - OpenSSL 0.9.8m if 'short' is a 16-bit type,
+ - OpenSSL 0.9.8f if 'short' is longer than 16 bits,
+ the previous behavior could result in a read attempt at NULL when
+ receiving specific incorrect SSL/TLS records once record payload
+ protection is active. (CVE-2010-0740)
+ [Bodo Moeller, Adam Langley <agl@chromium.org>]
+
+ *) Fix for CVE-2010-0433 where some kerberos enabled versions of OpenSSL
+ could be crashed if the relevant tables were not present (e.g. chrooted).
+ [Tomas Hoger <thoger@redhat.com>]
+
+ Changes between 0.9.8l and 0.9.8m [25 Feb 2010]
+
+ *) Always check bn_wexpend() return values for failure. (CVE-2009-3245)
+ [Martin Olsson, Neel Mehta]
+
+ *) Fix X509_STORE locking: Every 'objs' access requires a lock (to
+ accommodate for stack sorting, always a write lock!).
+ [Bodo Moeller]
+
+ *) On some versions of WIN32 Heap32Next is very slow. This can cause
+ excessive delays in the RAND_poll(): over a minute. As a workaround
+ include a time check in the inner Heap32Next loop too.
+ [Steve Henson]
+
+ *) The code that handled flushing of data in SSL/TLS originally used the
+ BIO_CTRL_INFO ctrl to see if any data was pending first. This caused
+ the problem outlined in PR#1949. The fix suggested there however can
+ trigger problems with buggy BIO_CTRL_WPENDING (e.g. some versions
+ of Apache). So instead simplify the code to flush unconditionally.
+ This should be fine since flushing with no data to flush is a no op.
+ [Steve Henson]
+
+ *) Handle TLS versions 2.0 and later properly and correctly use the
+ highest version of TLS/SSL supported. Although TLS >= 2.0 is some way
+ off ancient servers have a habit of sticking around for a while...
+ [Steve Henson]
+
+ *) Modify compression code so it frees up structures without using the
+ ex_data callbacks. This works around a problem where some applications
+ call CRYPTO_cleanup_all_ex_data() before application exit (e.g. when
+ restarting) then use compression (e.g. SSL with compression) later.
+ This results in significant per-connection memory leaks and
+ has caused some security issues including CVE-2008-1678 and
+ CVE-2009-4355.
+ [Steve Henson]
+
+ *) Constify crypto/cast (i.e., <openssl/cast.h>): a CAST_KEY doesn't
+ change when encrypting or decrypting.
+ [Bodo Moeller]
+
+ *) Add option SSL_OP_LEGACY_SERVER_CONNECT which will allow clients to
+ connect and renegotiate with servers which do not support RI.
+ Until RI is more widely deployed this option is enabled by default.
+ [Steve Henson]
+
+ *) Add "missing" ssl ctrls to clear options and mode.
+ [Steve Henson]
+
+ *) If client attempts to renegotiate and doesn't support RI respond with
+ a no_renegotiation alert as required by RFC5746. Some renegotiating
+ TLS clients will continue a connection gracefully when they receive
+ the alert. Unfortunately OpenSSL mishandled this alert and would hang
+ waiting for a server hello which it will never receive. Now we treat a
+ received no_renegotiation alert as a fatal error. This is because
+ applications requesting a renegotiation might well expect it to succeed
+ and would have no code in place to handle the server denying it so the
+ only safe thing to do is to terminate the connection.
+ [Steve Henson]
+
+ *) Add ctrl macro SSL_get_secure_renegotiation_support() which returns 1 if
+ peer supports secure renegotiation and 0 otherwise. Print out peer
+ renegotiation support in s_client/s_server.
+ [Steve Henson]
+
+ *) Replace the highly broken and deprecated SPKAC certification method with
+ the updated NID creation version. This should correctly handle UTF8.
+ [Steve Henson]
+
+ *) Implement RFC5746. Re-enable renegotiation but require the extension
+ as needed. Unfortunately, SSL3_FLAGS_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
+ turns out to be a bad idea. It has been replaced by
+ SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION which can be set with
+ SSL_CTX_set_options(). This is really not recommended unless you
+ know what you are doing.
+ [Eric Rescorla <ekr@networkresonance.com>, Ben Laurie, Steve Henson]
+
+ *) Fixes to stateless session resumption handling. Use initial_ctx when
+ issuing and attempting to decrypt tickets in case it has changed during
+ servername handling. Use a non-zero length session ID when attempting
+ stateless session resumption: this makes it possible to determine if
+ a resumption has occurred immediately after receiving server hello
+ (several places in OpenSSL subtly assume this) instead of later in
+ the handshake.
+ [Steve Henson]
+
+ *) The functions ENGINE_ctrl(), OPENSSL_isservice(),
+ CMS_get1_RecipientRequest() and RAND_bytes() can return <=0 on error
+ fixes for a few places where the return code is not checked
+ correctly.
+ [Julia Lawall <julia@diku.dk>]
+
+ *) Add --strict-warnings option to Configure script to include devteam
+ warnings in other configurations.
+ [Steve Henson]
+
+ *) Add support for --libdir option and LIBDIR variable in makefiles. This
+ makes it possible to install openssl libraries in locations which
+ have names other than "lib", for example "/usr/lib64" which some
+ systems need.
+ [Steve Henson, based on patch from Jeremy Utley]
+
+ *) Don't allow the use of leading 0x80 in OIDs. This is a violation of
+ X690 8.9.12 and can produce some misleading textual output of OIDs.
+ [Steve Henson, reported by Dan Kaminsky]
+
+ *) Delete MD2 from algorithm tables. This follows the recommendation in
+ several standards that it is not used in new applications due to
+ several cryptographic weaknesses. For binary compatibility reasons
+ the MD2 API is still compiled in by default.
+ [Steve Henson]
+
+ *) Add compression id to {d2i,i2d}_SSL_SESSION so it is correctly saved
+ and restored.
+ [Steve Henson]
+
+ *) Rename uni2asc and asc2uni functions to OPENSSL_uni2asc and
+ OPENSSL_asc2uni conditionally on Netware platforms to avoid a name
+ clash.
+ [Guenter <lists@gknw.net>]
+
+ *) Fix the server certificate chain building code to use X509_verify_cert(),
+ it used to have an ad-hoc builder which was unable to cope with anything
+ other than a simple chain.
+ [David Woodhouse <dwmw2@infradead.org>, Steve Henson]
+
+ *) Don't check self signed certificate signatures in X509_verify_cert()
+ by default (a flag can override this): it just wastes time without
+ adding any security. As a useful side effect self signed root CAs
+ with non-FIPS digests are now usable in FIPS mode.
+ [Steve Henson]
+
+ *) In dtls1_process_out_of_seq_message() the check if the current message
+ is already buffered was missing. For every new message was memory
+ allocated, allowing an attacker to perform an denial of service attack
+ with sending out of seq handshake messages until there is no memory
+ left. Additionally every future messege was buffered, even if the
+ sequence number made no sense and would be part of another handshake.
+ So only messages with sequence numbers less than 10 in advance will be
+ buffered. (CVE-2009-1378)
+ [Robin Seggelmann, discovered by Daniel Mentz]
+
+ *) Records are buffered if they arrive with a future epoch to be
+ processed after finishing the corresponding handshake. There is
+ currently no limitation to this buffer allowing an attacker to perform
+ a DOS attack with sending records with future epochs until there is no
+ memory left. This patch adds the pqueue_size() function to determine
+ the size of a buffer and limits the record buffer to 100 entries.
+ (CVE-2009-1377)
+ [Robin Seggelmann, discovered by Daniel Mentz]
+
+ *) Keep a copy of frag->msg_header.frag_len so it can be used after the
+ parent structure is freed. (CVE-2009-1379)
+ [Daniel Mentz]
+
+ *) Handle non-blocking I/O properly in SSL_shutdown() call.
+ [Darryl Miles <darryl-mailinglists@netbauds.net>]
+
+ *) Add 2.5.4.* OIDs
+ [Ilya O. <vrghost@gmail.com>]
+
+ Changes between 0.9.8k and 0.9.8l [5 Nov 2009]
+
+ *) Disable renegotiation completely - this fixes a severe security
+ problem (CVE-2009-3555) at the cost of breaking all
+ renegotiation. Renegotiation can be re-enabled by setting
+ SSL3_FLAGS_ALLOW_UNSAFE_LEGACY_RENEGOTIATION in s3->flags at
+ run-time. This is really not recommended unless you know what
+ you're doing.
+ [Ben Laurie]
+
+ Changes between 0.9.8j and 0.9.8k [25 Mar 2009]
+
+ *) Don't set val to NULL when freeing up structures, it is freed up by
+ underlying code. If sizeof(void *) > sizeof(long) this can result in
+ zeroing past the valid field. (CVE-2009-0789)
+ [Paolo Ganci <Paolo.Ganci@AdNovum.CH>]
+
+ *) Fix bug where return value of CMS_SignerInfo_verify_content() was not
+ checked correctly. This would allow some invalid signed attributes to
+ appear to verify correctly. (CVE-2009-0591)
+ [Ivan Nestlerode <inestlerode@us.ibm.com>]
+
+ *) Reject UniversalString and BMPString types with invalid lengths. This
+ prevents a crash in ASN1_STRING_print_ex() which assumes the strings have
+ a legal length. (CVE-2009-0590)
+ [Steve Henson]
+
+ *) Set S/MIME signing as the default purpose rather than setting it
+ unconditionally. This allows applications to override it at the store
+ level.
+ [Steve Henson]
+
+ *) Permit restricted recursion of ASN1 strings. This is needed in practice
+ to handle some structures.
+ [Steve Henson]
+
+ *) Improve efficiency of mem_gets: don't search whole buffer each time
+ for a '\n'
+ [Jeremy Shapiro <jnshapir@us.ibm.com>]
+
+ *) New -hex option for openssl rand.
+ [Matthieu Herrb]
+
+ *) Print out UTF8String and NumericString when parsing ASN1.
+ [Steve Henson]
+
+ *) Support NumericString type for name components.
+ [Steve Henson]
+
+ *) Allow CC in the environment to override the automatically chosen
+ compiler. Note that nothing is done to ensure flags work with the
+ chosen compiler.
+ [Ben Laurie]
+
+ Changes between 0.9.8i and 0.9.8j [07 Jan 2009]
+
+ *) Properly check EVP_VerifyFinal() and similar return values
+ (CVE-2008-5077).
+ [Ben Laurie, Bodo Moeller, Google Security Team]
+
+ *) Enable TLS extensions by default.
+ [Ben Laurie]
+
+ *) Allow the CHIL engine to be loaded, whether the application is
+ multithreaded or not. (This does not release the developer from the
+ obligation to set up the dynamic locking callbacks.)
+ [Sander Temme <sander@temme.net>]
+
+ *) Use correct exit code if there is an error in dgst command.
+ [Steve Henson; problem pointed out by Roland Dirlewanger]
+
+ *) Tweak Configure so that you need to say "experimental-jpake" to enable
+ JPAKE, and need to use -DOPENSSL_EXPERIMENTAL_JPAKE in applications.
+ [Bodo Moeller]
+
+ *) Add experimental JPAKE support, including demo authentication in
+ s_client and s_server.
+ [Ben Laurie]
+
+ *) Set the comparison function in v3_addr_canonize().
+ [Rob Austein <sra@hactrn.net>]
+
+ *) Add support for XMPP STARTTLS in s_client.
+ [Philip Paeps <philip@freebsd.org>]
+
+ *) Change the server-side SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG behavior
+ to ensure that even with this option, only ciphersuites in the
+ server's preference list will be accepted. (Note that the option
+ applies only when resuming a session, so the earlier behavior was
+ just about the algorithm choice for symmetric cryptography.)
+ [Bodo Moeller]
+
+ Changes between 0.9.8h and 0.9.8i [15 Sep 2008]
+
+ *) Fix NULL pointer dereference if a DTLS server received
+ ChangeCipherSpec as first record (CVE-2009-1386).
+ [PR #1679]
+
+ *) Fix a state transition in s3_srvr.c and d1_srvr.c
+ (was using SSL3_ST_CW_CLNT_HELLO_B, should be ..._ST_SW_SRVR_...).
+ [Nagendra Modadugu]
+
+ *) The fix in 0.9.8c that supposedly got rid of unsafe
+ double-checked locking was incomplete for RSA blinding,
+ addressing just one layer of what turns out to have been
+ doubly unsafe triple-checked locking.
+
+ So now fix this for real by retiring the MONT_HELPER macro
+ in crypto/rsa/rsa_eay.c.
+
+ [Bodo Moeller; problem pointed out by Marius Schilder]
+
+ *) Various precautionary measures:
+
+ - Avoid size_t integer overflow in HASH_UPDATE (md32_common.h).
+
+ - Avoid a buffer overflow in d2i_SSL_SESSION() (ssl_asn1.c).
+ (NB: This would require knowledge of the secret session ticket key
+ to exploit, in which case you'd be SOL either way.)
+
+ - Change bn_nist.c so that it will properly handle input BIGNUMs
+ outside the expected range.
+
+ - Enforce the 'num' check in BN_div() (bn_div.c) for non-BN_DEBUG
+ builds.
+
+ [Neel Mehta, Bodo Moeller]
+
+ *) Allow engines to be "soft loaded" - i.e. optionally don't die if
+ the load fails. Useful for distros.
+ [Ben Laurie and the FreeBSD team]
+
+ *) Add support for Local Machine Keyset attribute in PKCS#12 files.
+ [Steve Henson]
+
+ *) Fix BN_GF2m_mod_arr() top-bit cleanup code.
+ [Huang Ying]
+
+ *) Expand ENGINE to support engine supplied SSL client certificate functions.
+
+ This work was sponsored by Logica.
+ [Steve Henson]
+
+ *) Add CryptoAPI ENGINE to support use of RSA and DSA keys held in Windows
+ keystores. Support for SSL/TLS client authentication too.
+ Not compiled unless enable-capieng specified to Configure.
+
+ This work was sponsored by Logica.
+ [Steve Henson]
+
+ *) Fix bug in X509_ATTRIBUTE creation: don't set attribute using
+ ASN1_TYPE_set1 if MBSTRING flag set. This bug would crash certain
+ attribute creation routines such as certificate requests and PKCS#12
+ files.
+ [Steve Henson]
+
+ Changes between 0.9.8g and 0.9.8h [28 May 2008]
+
+ *) Fix flaw if 'Server Key exchange message' is omitted from a TLS
+ handshake which could lead to a cilent crash as found using the
+ Codenomicon TLS test suite (CVE-2008-1672)
+ [Steve Henson, Mark Cox]
+
+ *) Fix double free in TLS server name extensions which could lead to
+ a remote crash found by Codenomicon TLS test suite (CVE-2008-0891)
+ [Joe Orton]
+
+ *) Clear error queue in SSL_CTX_use_certificate_chain_file()
+
+ Clear the error queue to ensure that error entries left from
+ older function calls do not interfere with the correct operation.
+ [Lutz Jaenicke, Erik de Castro Lopo]
+
+ *) Remove root CA certificates of commercial CAs:
+
+ The OpenSSL project does not recommend any specific CA and does not
+ have any policy with respect to including or excluding any CA.
+ Therefore it does not make any sense to ship an arbitrary selection
+ of root CA certificates with the OpenSSL software.
+ [Lutz Jaenicke]
+
+ *) RSA OAEP patches to fix two separate invalid memory reads.
+ The first one involves inputs when 'lzero' is greater than
+ 'SHA_DIGEST_LENGTH' (it would read about SHA_DIGEST_LENGTH bytes
+ before the beginning of from). The second one involves inputs where
+ the 'db' section contains nothing but zeroes (there is a one-byte
+ invalid read after the end of 'db').
+ [Ivan Nestlerode <inestlerode@us.ibm.com>]
+
+ *) Partial backport from 0.9.9-dev:
+
+ Introduce bn_mul_mont (dedicated Montgomery multiplication
+ procedure) as a candidate for BIGNUM assembler implementation.
+ While 0.9.9-dev uses assembler for various architectures, only
+ x86_64 is available by default here in the 0.9.8 branch, and
+ 32-bit x86 is available through a compile-time setting.
+
+ To try the 32-bit x86 assembler implementation, use Configure
+ option "enable-montasm" (which exists only for this backport).
+
+ As "enable-montasm" for 32-bit x86 disclaims code stability
+ anyway, in this constellation we activate additional code
+ backported from 0.9.9-dev for further performance improvements,
+ namely BN_from_montgomery_word. (To enable this otherwise,
+ e.g. x86_64, try "-DMONT_FROM_WORD___NON_DEFAULT_0_9_8_BUILD".)
+
+ [Andy Polyakov (backport partially by Bodo Moeller)]
+
+ *) Add TLS session ticket callback. This allows an application to set
+ TLS ticket cipher and HMAC keys rather than relying on hardcoded fixed
+ values. This is useful for key rollover for example where several key
+ sets may exist with different names.
+ [Steve Henson]
+
+ *) Reverse ENGINE-internal logic for caching default ENGINE handles.
+ This was broken until now in 0.9.8 releases, such that the only way
+ a registered ENGINE could be used (assuming it initialises
+ successfully on the host) was to explicitly set it as the default
+ for the relevant algorithms. This is in contradiction with 0.9.7
+ behaviour and the documentation. With this fix, when an ENGINE is
+ registered into a given algorithm's table of implementations, the
+ 'uptodate' flag is reset so that auto-discovery will be used next
+ time a new context for that algorithm attempts to select an
+ implementation.
+ [Ian Lister (tweaked by Geoff Thorpe)]
+
+ *) Backport of CMS code to OpenSSL 0.9.8. This differs from the 0.9.9
+ implementation in the following ways:
+
+ Lack of EVP_PKEY_ASN1_METHOD means algorithm parameters have to be
+ hard coded.
+
+ Lack of BER streaming support means one pass streaming processing is
+ only supported if data is detached: setting the streaming flag is
+ ignored for embedded content.
+
+ CMS support is disabled by default and must be explicitly enabled
+ with the enable-cms configuration option.
+ [Steve Henson]
+
+ *) Update the GMP engine glue to do direct copies between BIGNUM and
+ mpz_t when openssl and GMP use the same limb size. Otherwise the
+ existing "conversion via a text string export" trick is still used.
+ [Paul Sheer <paulsheer@gmail.com>]
+
+ *) Zlib compression BIO. This is a filter BIO which compressed and
+ uncompresses any data passed through it.
+ [Steve Henson]
+
+ *) Add AES_wrap_key() and AES_unwrap_key() functions to implement
+ RFC3394 compatible AES key wrapping.
+ [Steve Henson]
+
+ *) Add utility functions to handle ASN1 structures. ASN1_STRING_set0():
+ sets string data without copying. X509_ALGOR_set0() and
+ X509_ALGOR_get0(): set and retrieve X509_ALGOR (AlgorithmIdentifier)
+ data. Attribute function X509at_get0_data_by_OBJ(): retrieves data
+ from an X509_ATTRIBUTE structure optionally checking it occurs only
+ once. ASN1_TYPE_set1(): set and ASN1_TYPE structure copying supplied
+ data.
+ [Steve Henson]
+
+ *) Fix BN flag handling in RSA_eay_mod_exp() and BN_MONT_CTX_set()
+ to get the expected BN_FLG_CONSTTIME behavior.
+ [Bodo Moeller (Google)]
+
+ *) Netware support:
+
+ - fixed wrong usage of ioctlsocket() when build for LIBC BSD sockets
+ - fixed do_tests.pl to run the test suite with CLIB builds too (CLIB_OPT)
+ - added some more tests to do_tests.pl
+ - fixed RunningProcess usage so that it works with newer LIBC NDKs too
+ - removed usage of BN_LLONG for CLIB builds to avoid runtime dependency
+ - added new Configure targets netware-clib-bsdsock, netware-clib-gcc,
+ netware-clib-bsdsock-gcc, netware-libc-bsdsock-gcc
+ - various changes to netware.pl to enable gcc-cross builds on Win32
+ platform
+ - changed crypto/bio/b_sock.c to work with macro functions (CLIB BSD)
+ - various changes to fix missing prototype warnings
+ - fixed x86nasm.pl to create correct asm files for NASM COFF output
+ - added AES, WHIRLPOOL and CPUID assembler code to build files
+ - added missing AES assembler make rules to mk1mf.pl
+ - fixed order of includes in apps/ocsp.c so that e_os.h settings apply
+ [Guenter Knauf <eflash@gmx.net>]
+
+ *) Implement certificate status request TLS extension defined in RFC3546.
+ A client can set the appropriate parameters and receive the encoded
+ OCSP response via a callback. A server can query the supplied parameters
+ and set the encoded OCSP response in the callback. Add simplified examples
+ to s_client and s_server.
+ [Steve Henson]
+
+ Changes between 0.9.8f and 0.9.8g [19 Oct 2007]
+
+ *) Fix various bugs:
+ + Binary incompatibility of ssl_ctx_st structure
+ + DTLS interoperation with non-compliant servers
+ + Don't call get_session_cb() without proposed session
+ + Fix ia64 assembler code
+ [Andy Polyakov, Steve Henson]
+
+ Changes between 0.9.8e and 0.9.8f [11 Oct 2007]
+
+ *) DTLS Handshake overhaul. There were longstanding issues with
+ OpenSSL DTLS implementation, which were making it impossible for
+ RFC 4347 compliant client to communicate with OpenSSL server.
+ Unfortunately just fixing these incompatibilities would "cut off"
+ pre-0.9.8f clients. To allow for hassle free upgrade post-0.9.8e
+ server keeps tolerating non RFC compliant syntax. The opposite is
+ not true, 0.9.8f client can not communicate with earlier server.
+ This update even addresses CVE-2007-4995.
+ [Andy Polyakov]
+
+ *) Changes to avoid need for function casts in OpenSSL: some compilers
+ (gcc 4.2 and later) reject their use.
+ [Kurt Roeckx <kurt@roeckx.be>, Peter Hartley <pdh@utter.chaos.org.uk>,
+ Steve Henson]
+
+ *) Add RFC4507 support to OpenSSL. This includes the corrections in
+ RFC4507bis. The encrypted ticket format is an encrypted encoded
+ SSL_SESSION structure, that way new session features are automatically
+ supported.
+
+ If a client application caches session in an SSL_SESSION structure
+ support is transparent because tickets are now stored in the encoded
+ SSL_SESSION.
+
+ The SSL_CTX structure automatically generates keys for ticket
+ protection in servers so again support should be possible
+ with no application modification.
+
+ If a client or server wishes to disable RFC4507 support then the option
+ SSL_OP_NO_TICKET can be set.
+
+ Add a TLS extension debugging callback to allow the contents of any client
+ or server extensions to be examined.
+
+ This work was sponsored by Google.
+ [Steve Henson]
+
+ *) Add initial support for TLS extensions, specifically for the server_name
+ extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now
+ have new members for a host name. The SSL data structure has an
+ additional member SSL_CTX *initial_ctx so that new sessions can be
+ stored in that context to allow for session resumption, even after the
+ SSL has been switched to a new SSL_CTX in reaction to a client's
+ server_name extension.
+
+ New functions (subject to change):
+
+ SSL_get_servername()
+ SSL_get_servername_type()
+ SSL_set_SSL_CTX()
+
+ New CTRL codes and macros (subject to change):
+
+ SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
+ - SSL_CTX_set_tlsext_servername_callback()
+ SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG
+ - SSL_CTX_set_tlsext_servername_arg()
+ SSL_CTRL_SET_TLSEXT_HOSTNAME - SSL_set_tlsext_host_name()
+
+ openssl s_client has a new '-servername ...' option.
+
+ openssl s_server has new options '-servername_host ...', '-cert2 ...',
+ '-key2 ...', '-servername_fatal' (subject to change). This allows
+ testing the HostName extension for a specific single host name ('-cert'
+ and '-key' remain fallbacks for handshakes without HostName
+ negotiation). If the unrecognized_name alert has to be sent, this by
+ default is a warning; it becomes fatal with the '-servername_fatal'
+ option.
+
+ [Peter Sylvester, Remy Allais, Christophe Renou, Steve Henson]
+
+ *) Add AES and SSE2 assembly language support to VC++ build.
+ [Steve Henson]
+
+ *) Mitigate attack on final subtraction in Montgomery reduction.
+ [Andy Polyakov]
+
+ *) Fix crypto/ec/ec_mult.c to work properly with scalars of value 0
+ (which previously caused an internal error).
+ [Bodo Moeller]
+
+ *) Squeeze another 10% out of IGE mode when in != out.
+ [Ben Laurie]
+
+ *) AES IGE mode speedup.
+ [Dean Gaudet (Google)]
+
+ *) Add the Korean symmetric 128-bit cipher SEED (see
+ http://www.kisa.or.kr/kisa/seed/jsp/seed_eng.jsp) and
+ add SEED ciphersuites from RFC 4162:
+
+ TLS_RSA_WITH_SEED_CBC_SHA = "SEED-SHA"
+ TLS_DHE_DSS_WITH_SEED_CBC_SHA = "DHE-DSS-SEED-SHA"
+ TLS_DHE_RSA_WITH_SEED_CBC_SHA = "DHE-RSA-SEED-SHA"
+ TLS_DH_anon_WITH_SEED_CBC_SHA = "ADH-SEED-SHA"
+
+ To minimize changes between patchlevels in the OpenSSL 0.9.8
+ series, SEED remains excluded from compilation unless OpenSSL
+ is configured with 'enable-seed'.
+ [KISA, Bodo Moeller]
+
+ *) Mitigate branch prediction attacks, which can be practical if a
+ single processor is shared, allowing a spy process to extract
+ information. For detailed background information, see
+ http://eprint.iacr.org/2007/039 (O. Aciicmez, S. Gueron,
+ J.-P. Seifert, "New Branch Prediction Vulnerabilities in OpenSSL
+ and Necessary Software Countermeasures"). The core of the change
+ are new versions BN_div_no_branch() and
+ BN_mod_inverse_no_branch() of BN_div() and BN_mod_inverse(),
+ respectively, which are slower, but avoid the security-relevant
+ conditional branches. These are automatically called by BN_div()
+ and BN_mod_inverse() if the flag BN_FLG_CONSTTIME is set for one
+ of the input BIGNUMs. Also, BN_is_bit_set() has been changed to
+ remove a conditional branch.
+
+ BN_FLG_CONSTTIME is the new name for the previous
+ BN_FLG_EXP_CONSTTIME flag, since it now affects more than just
+ modular exponentiation. (Since OpenSSL 0.9.7h, setting this flag
+ in the exponent causes BN_mod_exp_mont() to use the alternative
+ implementation in BN_mod_exp_mont_consttime().) The old name
+ remains as a deprecated alias.
+
+ Similarly, RSA_FLAG_NO_EXP_CONSTTIME is replaced by a more general
+ RSA_FLAG_NO_CONSTTIME flag since the RSA implementation now uses
+ constant-time implementations for more than just exponentiation.
+ Here too the old name is kept as a deprecated alias.
+
+ BN_BLINDING_new() will now use BN_dup() for the modulus so that
+ the BN_BLINDING structure gets an independent copy of the
+ modulus. This means that the previous "BIGNUM *m" argument to
+ BN_BLINDING_new() and to BN_BLINDING_create_param() now
+ essentially becomes "const BIGNUM *m", although we can't actually
+ change this in the header file before 0.9.9. It allows
+ RSA_setup_blinding() to use BN_with_flags() on the modulus to
+ enable BN_FLG_CONSTTIME.
+
+ [Matthew D Wood (Intel Corp)]
+
+ *) In the SSL/TLS server implementation, be strict about session ID
+ context matching (which matters if an application uses a single
+ external cache for different purposes). Previously,
+ out-of-context reuse was forbidden only if SSL_VERIFY_PEER was
+ set. This did ensure strict client verification, but meant that,
+ with applications using a single external cache for quite
+ different requirements, clients could circumvent ciphersuite
+ restrictions for a given session ID context by starting a session
+ in a different context.
+ [Bodo Moeller]
+
+ *) Include "!eNULL" in SSL_DEFAULT_CIPHER_LIST to make sure that
+ a ciphersuite string such as "DEFAULT:RSA" cannot enable
+ authentication-only ciphersuites.
+ [Bodo Moeller]
+
+ *) Update the SSL_get_shared_ciphers() fix CVE-2006-3738 which was
+ not complete and could lead to a possible single byte overflow
+ (CVE-2007-5135) [Ben Laurie]
+
+ Changes between 0.9.8d and 0.9.8e [23 Feb 2007]
+
+ *) Since AES128 and AES256 (and similarly Camellia128 and
+ Camellia256) share a single mask bit in the logic of
+ ssl/ssl_ciph.c, the code for masking out disabled ciphers needs a
+ kludge to work properly if AES128 is available and AES256 isn't
+ (or if Camellia128 is available and Camellia256 isn't).
+ [Victor Duchovni]
+
+ *) Fix the BIT STRING encoding generated by crypto/ec/ec_asn1.c
+ (within i2d_ECPrivateKey, i2d_ECPKParameters, i2d_ECParameters):
+ When a point or a seed is encoded in a BIT STRING, we need to
+ prevent the removal of trailing zero bits to get the proper DER
+ encoding. (By default, crypto/asn1/a_bitstr.c assumes the case
+ of a NamedBitList, for which trailing 0 bits need to be removed.)
+ [Bodo Moeller]
+
+ *) Have SSL/TLS server implementation tolerate "mismatched" record
+ protocol version while receiving ClientHello even if the
+ ClientHello is fragmented. (The server can't insist on the
+ particular protocol version it has chosen before the ServerHello
+ message has informed the client about his choice.)
+ [Bodo Moeller]
+
+ *) Add RFC 3779 support.
+ [Rob Austein for ARIN, Ben Laurie]
+
+ *) Load error codes if they are not already present instead of using a
+ static variable. This allows them to be cleanly unloaded and reloaded.
+ Improve header file function name parsing.
+ [Steve Henson]
+
+ *) extend SMTP and IMAP protocol emulation in s_client to use EHLO
+ or CAPABILITY handshake as required by RFCs.
+ [Goetz Babin-Ebell]
+
+ Changes between 0.9.8c and 0.9.8d [28 Sep 2006]
+
+ *) Introduce limits to prevent malicious keys being able to
+ cause a denial of service. (CVE-2006-2940)
+ [Steve Henson, Bodo Moeller]
+
+ *) Fix ASN.1 parsing of certain invalid structures that can result
+ in a denial of service. (CVE-2006-2937) [Steve Henson]
+
+ *) Fix buffer overflow in SSL_get_shared_ciphers() function.
+ (CVE-2006-3738) [Tavis Ormandy and Will Drewry, Google Security Team]
+
+ *) Fix SSL client code which could crash if connecting to a
+ malicious SSLv2 server. (CVE-2006-4343)
+ [Tavis Ormandy and Will Drewry, Google Security Team]
+
+ *) Since 0.9.8b, ciphersuite strings naming explicit ciphersuites
+ match only those. Before that, "AES256-SHA" would be interpreted
+ as a pattern and match "AES128-SHA" too (since AES128-SHA got
+ the same strength classification in 0.9.7h) as we currently only
+ have a single AES bit in the ciphersuite description bitmap.
+ That change, however, also applied to ciphersuite strings such as
+ "RC4-MD5" that intentionally matched multiple ciphersuites --
+ namely, SSL 2.0 ciphersuites in addition to the more common ones
+ from SSL 3.0/TLS 1.0.
+
+ So we change the selection algorithm again: Naming an explicit
+ ciphersuite selects this one ciphersuite, and any other similar
+ ciphersuite (same bitmap) from *other* protocol versions.
+ Thus, "RC4-MD5" again will properly select both the SSL 2.0
+ ciphersuite and the SSL 3.0/TLS 1.0 ciphersuite.
+
+ Since SSL 2.0 does not have any ciphersuites for which the
+ 128/256 bit distinction would be relevant, this works for now.
+ The proper fix will be to use different bits for AES128 and
+ AES256, which would have avoided the problems from the beginning;
+ however, bits are scarce, so we can only do this in a new release
+ (not just a patchlevel) when we can change the SSL_CIPHER
+ definition to split the single 'unsigned long mask' bitmap into
+ multiple values to extend the available space.
+
+ [Bodo Moeller]
+
+ Changes between 0.9.8b and 0.9.8c [05 Sep 2006]
+
+ *) Avoid PKCS #1 v1.5 signature attack discovered by Daniel Bleichenbacher
+ (CVE-2006-4339) [Ben Laurie and Google Security Team]
+
+ *) Add AES IGE and biIGE modes.
+ [Ben Laurie]
+
+ *) Change the Unix randomness entropy gathering to use poll() when
+ possible instead of select(), since the latter has some
+ undesirable limitations.
+ [Darryl Miles via Richard Levitte and Bodo Moeller]
+
+ *) Disable "ECCdraft" ciphersuites more thoroughly. Now special
+ treatment in ssl/ssl_ciph.s makes sure that these ciphersuites
+ cannot be implicitly activated as part of, e.g., the "AES" alias.
+ However, please upgrade to OpenSSL 0.9.9[-dev] for
+ non-experimental use of the ECC ciphersuites to get TLS extension
+ support, which is required for curve and point format negotiation
+ to avoid potential handshake problems.
+ [Bodo Moeller]
+
+ *) Disable rogue ciphersuites:
+
+ - SSLv2 0x08 0x00 0x80 ("RC4-64-MD5")
+ - SSLv3/TLSv1 0x00 0x61 ("EXP1024-RC2-CBC-MD5")
+ - SSLv3/TLSv1 0x00 0x60 ("EXP1024-RC4-MD5")
+
+ The latter two were purportedly from
+ draft-ietf-tls-56-bit-ciphersuites-0[01].txt, but do not really
+ appear there.
+
+ Also deactivate the remaining ciphersuites from
+ draft-ietf-tls-56-bit-ciphersuites-01.txt. These are just as
+ unofficial, and the ID has long expired.
+ [Bodo Moeller]
+
+ *) Fix RSA blinding Heisenbug (problems sometimes occurred on
+ dual-core machines) and other potential thread-safety issues.
+ [Bodo Moeller]
+
+ *) Add the symmetric cipher Camellia (128-bit, 192-bit, 256-bit key
+ versions), which is now available for royalty-free use
+ (see http://info.isl.ntt.co.jp/crypt/eng/info/chiteki.html).
+ Also, add Camellia TLS ciphersuites from RFC 4132.
+
+ To minimize changes between patchlevels in the OpenSSL 0.9.8
+ series, Camellia remains excluded from compilation unless OpenSSL
+ is configured with 'enable-camellia'.
+ [NTT]
+
+ *) Disable the padding bug check when compression is in use. The padding
+ bug check assumes the first packet is of even length, this is not
+ necessarily true if compresssion is enabled and can result in false
+ positives causing handshake failure. The actual bug test is ancient
+ code so it is hoped that implementations will either have fixed it by
+ now or any which still have the bug do not support compression.
+ [Steve Henson]
+
+ Changes between 0.9.8a and 0.9.8b [04 May 2006]
+
+ *) When applying a cipher rule check to see if string match is an explicit
+ cipher suite and only match that one cipher suite if it is.
+ [Steve Henson]
+
+ *) Link in manifests for VC++ if needed.
+ [Austin Ziegler <halostatue@gmail.com>]
+
+ *) Update support for ECC-based TLS ciphersuites according to
+ draft-ietf-tls-ecc-12.txt with proposed changes (but without
+ TLS extensions, which are supported starting with the 0.9.9
+ branch, not in the OpenSSL 0.9.8 branch).
+ [Douglas Stebila]
+
+ *) New functions EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free() to support
+ opaque EVP_CIPHER_CTX handling.
+ [Steve Henson]
+
+ *) Fixes and enhancements to zlib compression code. We now only use
+ "zlib1.dll" and use the default __cdecl calling convention on Win32
+ to conform with the standards mentioned here:
+ http://www.zlib.net/DLL_FAQ.txt
+ Static zlib linking now works on Windows and the new --with-zlib-include
+ --with-zlib-lib options to Configure can be used to supply the location
+ of the headers and library. Gracefully handle case where zlib library
+ can't be loaded.
+ [Steve Henson]
+
+ *) Several fixes and enhancements to the OID generation code. The old code
+ sometimes allowed invalid OIDs (1.X for X >= 40 for example), couldn't
+ handle numbers larger than ULONG_MAX, truncated printing and had a
+ non standard OBJ_obj2txt() behaviour.
+ [Steve Henson]
+
+ *) Add support for building of engines under engine/ as shared libraries
+ under VC++ build system.
+ [Steve Henson]
+
+ *) Corrected the numerous bugs in the Win32 path splitter in DSO.
+ Hopefully, we will not see any false combination of paths any more.
+ [Richard Levitte]
+
+ Changes between 0.9.8 and 0.9.8a [11 Oct 2005]
+
+ *) Remove the functionality of SSL_OP_MSIE_SSLV2_RSA_PADDING
+ (part of SSL_OP_ALL). This option used to disable the
+ countermeasure against man-in-the-middle protocol-version
+ rollback in the SSL 2.0 server implementation, which is a bad
+ idea. (CVE-2005-2969)
+
+ [Bodo Moeller; problem pointed out by Yutaka Oiwa (Research Center
+ for Information Security, National Institute of Advanced Industrial
+ Science and Technology [AIST], Japan)]
+
+ *) Add two function to clear and return the verify parameter flags.
+ [Steve Henson]
+
+ *) Keep cipherlists sorted in the source instead of sorting them at
+ runtime, thus removing the need for a lock.
+ [Nils Larsch]
+
+ *) Avoid some small subgroup attacks in Diffie-Hellman.
+ [Nick Mathewson and Ben Laurie]
+
+ *) Add functions for well-known primes.
+ [Nick Mathewson]
+
+ *) Extended Windows CE support.
+ [Satoshi Nakamura and Andy Polyakov]
+
+ *) Initialize SSL_METHOD structures at compile time instead of during
+ runtime, thus removing the need for a lock.
+ [Steve Henson]
+
+ *) Make PKCS7_decrypt() work even if no certificate is supplied by
+ attempting to decrypt each encrypted key in turn. Add support to
+ smime utility.
+ [Steve Henson]
+
+ Changes between 0.9.7h and 0.9.8 [05 Jul 2005]
+
+ [NB: OpenSSL 0.9.7i and later 0.9.7 patch levels were released after
+ OpenSSL 0.9.8.]
+
+ *) Add libcrypto.pc and libssl.pc for those who feel they need them.
+ [Richard Levitte]
+
+ *) Change CA.sh and CA.pl so they don't bundle the CSR and the private
+ key into the same file any more.
+ [Richard Levitte]
+
+ *) Add initial support for Win64, both IA64 and AMD64/x64 flavors.
+ [Andy Polyakov]
+
+ *) Add -utf8 command line and config file option to 'ca'.
+ [Stefan <stf@udoma.org]
+
+ *) Removed the macro des_crypt(), as it seems to conflict with some
+ libraries. Use DES_crypt().
+ [Richard Levitte]
+
+ *) Correct naming of the 'chil' and '4758cca' ENGINEs. This
+ involves renaming the source and generated shared-libs for
+ both. The engines will accept the corrected or legacy ids
+ ('ncipher' and '4758_cca' respectively) when binding. NB,
+ this only applies when building 'shared'.
+ [Corinna Vinschen <vinschen@redhat.com> and Geoff Thorpe]
+
+ *) Add attribute functions to EVP_PKEY structure. Modify
+ PKCS12_create() to recognize a CSP name attribute and
+ use it. Make -CSP option work again in pkcs12 utility.
+ [Steve Henson]
+
+ *) Add new functionality to the bn blinding code:
+ - automatic re-creation of the BN_BLINDING parameters after
+ a fixed number of uses (currently 32)
+ - add new function for parameter creation
+ - introduce flags to control the update behaviour of the
+ BN_BLINDING parameters
+ - hide BN_BLINDING structure
+ Add a second BN_BLINDING slot to the RSA structure to improve
+ performance when a single RSA object is shared among several
+ threads.
+ [Nils Larsch]
+
+ *) Add support for DTLS.
+ [Nagendra Modadugu <nagendra@cs.stanford.edu> and Ben Laurie]
+
+ *) Add support for DER encoded private keys (SSL_FILETYPE_ASN1)
+ to SSL_CTX_use_PrivateKey_file() and SSL_use_PrivateKey_file()
+ [Walter Goulet]
+
+ *) Remove buggy and incomplete DH cert support from
+ ssl/ssl_rsa.c and ssl/s3_both.c
+ [Nils Larsch]
+
+ *) Use SHA-1 instead of MD5 as the default digest algorithm for
+ the apps/openssl applications.
+ [Nils Larsch]
+
+ *) Compile clean with "-Wall -Wmissing-prototypes
+ -Wstrict-prototypes -Wmissing-declarations -Werror". Currently
+ DEBUG_SAFESTACK must also be set.
+ [Ben Laurie]
+
+ *) Change ./Configure so that certain algorithms can be disabled by default.
+ The new counterpiece to "no-xxx" is "enable-xxx".
+
+ The patented RC5 and MDC2 algorithms will now be disabled unless
+ "enable-rc5" and "enable-mdc2", respectively, are specified.
+
+ (IDEA remains enabled despite being patented. This is because IDEA
+ is frequently required for interoperability, and there is no license
+ fee for non-commercial use. As before, "no-idea" can be used to
+ avoid this algorithm.)
+
+ [Bodo Moeller]
+
+ *) Add processing of proxy certificates (see RFC 3820). This work was
+ sponsored by KTH (The Royal Institute of Technology in Stockholm) and
+ EGEE (Enabling Grids for E-science in Europe).
+ [Richard Levitte]
+
+ *) RC4 performance overhaul on modern architectures/implementations, such
+ as Intel P4, IA-64 and AMD64.
+ [Andy Polyakov]
+
+ *) New utility extract-section.pl. This can be used specify an alternative
+ section number in a pod file instead of having to treat each file as
+ a separate case in Makefile. This can be done by adding two lines to the
+ pod file:
+
+ =for comment openssl_section:XXX
+
+ The blank line is mandatory.
+
+ [Steve Henson]
+
+ *) New arguments -certform, -keyform and -pass for s_client and s_server
+ to allow alternative format key and certificate files and passphrase
+ sources.
+ [Steve Henson]
+
+ *) New structure X509_VERIFY_PARAM which combines current verify parameters,
+ update associated structures and add various utility functions.
+
+ Add new policy related verify parameters, include policy checking in
+ standard verify code. Enhance 'smime' application with extra parameters
+ to support policy checking and print out.
+ [Steve Henson]
+
+ *) Add a new engine to support VIA PadLock ACE extensions in the VIA C3
+ Nehemiah processors. These extensions support AES encryption in hardware
+ as well as RNG (though RNG support is currently disabled).
+ [Michal Ludvig <michal@logix.cz>, with help from Andy Polyakov]
+
+ *) Deprecate BN_[get|set]_params() functions (they were ignored internally).
+ [Geoff Thorpe]
+
+ *) New FIPS 180-2 algorithms, SHA-224/-256/-384/-512 are implemented.
+ [Andy Polyakov and a number of other people]
+
+ *) Improved PowerPC platform support. Most notably BIGNUM assembler
+ implementation contributed by IBM.
+ [Suresh Chari, Peter Waltenberg, Andy Polyakov]
+
+ *) The new 'RSA_generate_key_ex' function now takes a BIGNUM for the public
+ exponent rather than 'unsigned long'. There is a corresponding change to
+ the new 'rsa_keygen' element of the RSA_METHOD structure.
+ [Jelte Jansen, Geoff Thorpe]
+
+ *) Functionality for creating the initial serial number file is now
+ moved from CA.pl to the 'ca' utility with a new option -create_serial.
+
+ (Before OpenSSL 0.9.7e, CA.pl used to initialize the serial
+ number file to 1, which is bound to cause problems. To avoid
+ the problems while respecting compatibility between different 0.9.7
+ patchlevels, 0.9.7e employed 'openssl x509 -next_serial' in
+ CA.pl for serial number initialization. With the new release 0.9.8,
+ we can fix the problem directly in the 'ca' utility.)
+ [Steve Henson]
+
+ *) Reduced header interdepencies by declaring more opaque objects in
+ ossl_typ.h. As a consequence, including some headers (eg. engine.h) will
+ give fewer recursive includes, which could break lazy source code - so
+ this change is covered by the OPENSSL_NO_DEPRECATED symbol. As always,
+ developers should define this symbol when building and using openssl to
+ ensure they track the recommended behaviour, interfaces, [etc], but
+ backwards-compatible behaviour prevails when this isn't defined.
+ [Geoff Thorpe]
+
+ *) New function X509_POLICY_NODE_print() which prints out policy nodes.
+ [Steve Henson]
+
+ *) Add new EVP function EVP_CIPHER_CTX_rand_key and associated functionality.
+ This will generate a random key of the appropriate length based on the
+ cipher context. The EVP_CIPHER can provide its own random key generation
+ routine to support keys of a specific form. This is used in the des and
+ 3des routines to generate a key of the correct parity. Update S/MIME
+ code to use new functions and hence generate correct parity DES keys.
+ Add EVP_CHECK_DES_KEY #define to return an error if the key is not
+ valid (weak or incorrect parity).
+ [Steve Henson]
+
+ *) Add a local set of CRLs that can be used by X509_verify_cert() as well
+ as looking them up. This is useful when the verified structure may contain
+ CRLs, for example PKCS#7 signedData. Modify PKCS7_verify() to use any CRLs
+ present unless the new PKCS7_NO_CRL flag is asserted.
+ [Steve Henson]
+
+ *) Extend ASN1 oid configuration module. It now additionally accepts the
+ syntax:
+
+ shortName = some long name, 1.2.3.4
+ [Steve Henson]
+
+ *) Reimplemented the BN_CTX implementation. There is now no more static
+ limitation on the number of variables it can handle nor the depth of the
+ "stack" handling for BN_CTX_start()/BN_CTX_end() pairs. The stack
+ information can now expand as required, and rather than having a single
+ static array of bignums, BN_CTX now uses a linked-list of such arrays
+ allowing it to expand on demand whilst maintaining the usefulness of
+ BN_CTX's "bundling".
+ [Geoff Thorpe]
+
+ *) Add a missing BN_CTX parameter to the 'rsa_mod_exp' callback in RSA_METHOD
+ to allow all RSA operations to function using a single BN_CTX.
+ [Geoff Thorpe]
+
+ *) Preliminary support for certificate policy evaluation and checking. This
+ is initially intended to pass the tests outlined in "Conformance Testing
+ of Relying Party Client Certificate Path Processing Logic" v1.07.
+ [Steve Henson]
+
+ *) bn_dup_expand() has been deprecated, it was introduced in 0.9.7 and
+ remained unused and not that useful. A variety of other little bignum
+ tweaks and fixes have also been made continuing on from the audit (see
+ below).
+ [Geoff Thorpe]
+
+ *) Constify all or almost all d2i, c2i, s2i and r2i functions, along with
+ associated ASN1, EVP and SSL functions and old ASN1 macros.
+ [Richard Levitte]
+
+ *) BN_zero() only needs to set 'top' and 'neg' to zero for correct results,
+ and this should never fail. So the return value from the use of
+ BN_set_word() (which can fail due to needless expansion) is now deprecated;
+ if OPENSSL_NO_DEPRECATED is defined, BN_zero() is a void macro.
+ [Geoff Thorpe]
+
+ *) BN_CTX_get() should return zero-valued bignums, providing the same
+ initialised value as BN_new().
+ [Geoff Thorpe, suggested by Ulf Möller]
+
+ *) Support for inhibitAnyPolicy certificate extension.
+ [Steve Henson]
+
+ *) An audit of the BIGNUM code is underway, for which debugging code is
+ enabled when BN_DEBUG is defined. This makes stricter enforcements on what
+ is considered valid when processing BIGNUMs, and causes execution to
+ assert() when a problem is discovered. If BN_DEBUG_RAND is defined,
+ further steps are taken to deliberately pollute unused data in BIGNUM
+ structures to try and expose faulty code further on. For now, openssl will
+ (in its default mode of operation) continue to tolerate the inconsistent
+ forms that it has tolerated in the past, but authors and packagers should
+ consider trying openssl and their own applications when compiled with
+ these debugging symbols defined. It will help highlight potential bugs in
+ their own code, and will improve the test coverage for OpenSSL itself. At
+ some point, these tighter rules will become openssl's default to improve
+ maintainability, though the assert()s and other overheads will remain only
+ in debugging configurations. See bn.h for more details.
+ [Geoff Thorpe, Nils Larsch, Ulf Möller]
+
+ *) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure
+ that can only be obtained through BN_CTX_new() (which implicitly
+ initialises it). The presence of this function only made it possible
+ to overwrite an existing structure (and cause memory leaks).
+ [Geoff Thorpe]
+
+ *) Because of the callback-based approach for implementing LHASH as a
+ template type, lh_insert() adds opaque objects to hash-tables and
+ lh_doall() or lh_doall_arg() are typically used with a destructor callback
+ to clean up those corresponding objects before destroying the hash table
+ (and losing the object pointers). So some over-zealous constifications in
+ LHASH have been relaxed so that lh_insert() does not take (nor store) the
+ objects as "const" and the lh_doall[_arg] callback wrappers are not
+ prototyped to have "const" restrictions on the object pointers they are
+ given (and so aren't required to cast them away any more).
+ [Geoff Thorpe]
+
+ *) The tmdiff.h API was so ugly and minimal that our own timing utility
+ (speed) prefers to use its own implementation. The two implementations
+ haven't been consolidated as yet (volunteers?) but the tmdiff API has had
+ its object type properly exposed (MS_TM) instead of casting to/from "char
+ *". This may still change yet if someone realises MS_TM and "ms_time_***"
+ aren't necessarily the greatest nomenclatures - but this is what was used
+ internally to the implementation so I've used that for now.
+ [Geoff Thorpe]
+
+ *) Ensure that deprecated functions do not get compiled when
+ OPENSSL_NO_DEPRECATED is defined. Some "openssl" subcommands and a few of
+ the self-tests were still using deprecated key-generation functions so
+ these have been updated also.
+ [Geoff Thorpe]
+
+ *) Reorganise PKCS#7 code to separate the digest location functionality
+ into PKCS7_find_digest(), digest addition into PKCS7_bio_add_digest().
+ New function PKCS7_set_digest() to set the digest type for PKCS#7
+ digestedData type. Add additional code to correctly generate the
+ digestedData type and add support for this type in PKCS7 initialization
+ functions.
+ [Steve Henson]
+
+ *) New function PKCS7_set0_type_other() this initializes a PKCS7
+ structure of type "other".
+ [Steve Henson]
+
+ *) Fix prime generation loop in crypto/bn/bn_prime.pl by making
+ sure the loop does correctly stop and breaking ("division by zero")
+ modulus operations are not performed. The (pre-generated) prime
+ table crypto/bn/bn_prime.h was already correct, but it could not be
+ re-generated on some platforms because of the "division by zero"
+ situation in the script.
+ [Ralf S. Engelschall]
+
+ *) Update support for ECC-based TLS ciphersuites according to
+ draft-ietf-tls-ecc-03.txt: the KDF1 key derivation function with
+ SHA-1 now is only used for "small" curves (where the
+ representation of a field element takes up to 24 bytes); for
+ larger curves, the field element resulting from ECDH is directly
+ used as premaster secret.
+ [Douglas Stebila (Sun Microsystems Laboratories)]
+
+ *) Add code for kP+lQ timings to crypto/ec/ectest.c, and add SEC2
+ curve secp160r1 to the tests.
+ [Douglas Stebila (Sun Microsystems Laboratories)]
+
+ *) Add the possibility to load symbols globally with DSO.
+ [Götz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
+
+ *) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better
+ control of the error stack.
+ [Richard Levitte]
+
+ *) Add support for STORE in ENGINE.
+ [Richard Levitte]
+
+ *) Add the STORE type. The intention is to provide a common interface
+ to certificate and key stores, be they simple file-based stores, or
+ HSM-type store, or LDAP stores, or...
+ NOTE: The code is currently UNTESTED and isn't really used anywhere.
+ [Richard Levitte]
+
+ *) Add a generic structure called OPENSSL_ITEM. This can be used to
+ pass a list of arguments to any function as well as provide a way
+ for a function to pass data back to the caller.
+ [Richard Levitte]
+
+ *) Add the functions BUF_strndup() and BUF_memdup(). BUF_strndup()
+ works like BUF_strdup() but can be used to duplicate a portion of
+ a string. The copy gets NUL-terminated. BUF_memdup() duplicates
+ a memory area.
+ [Richard Levitte]
+
+ *) Add the function sk_find_ex() which works like sk_find(), but will
+ return an index to an element even if an exact match couldn't be
+ found. The index is guaranteed to point at the element where the
+ searched-for key would be inserted to preserve sorting order.
+ [Richard Levitte]
+
+ *) Add the function OBJ_bsearch_ex() which works like OBJ_bsearch() but
+ takes an extra flags argument for optional functionality. Currently,
+ the following flags are defined:
+
+ OBJ_BSEARCH_VALUE_ON_NOMATCH
+ This one gets OBJ_bsearch_ex() to return a pointer to the first
+ element where the comparing function returns a negative or zero
+ number.
+
+ OBJ_BSEARCH_FIRST_VALUE_ON_MATCH
+ This one gets OBJ_bsearch_ex() to return a pointer to the first
+ element where the comparing function returns zero. This is useful
+ if there are more than one element where the comparing function
+ returns zero.
+ [Richard Levitte]
+
+ *) Make it possible to create self-signed certificates with 'openssl ca'
+ in such a way that the self-signed certificate becomes part of the
+ CA database and uses the same mechanisms for serial number generation
+ as all other certificate signing. The new flag '-selfsign' enables
+ this functionality. Adapt CA.sh and CA.pl.in.
+ [Richard Levitte]
+
+ *) Add functionality to check the public key of a certificate request
+ against a given private. This is useful to check that a certificate
+ request can be signed by that key (self-signing).
+ [Richard Levitte]
+
+ *) Make it possible to have multiple active certificates with the same
+ subject in the CA index file. This is done only if the keyword
+ 'unique_subject' is set to 'no' in the main CA section (default
+ if 'CA_default') of the configuration file. The value is saved
+ with the database itself in a separate index attribute file,
+ named like the index file with '.attr' appended to the name.
+ [Richard Levitte]
+
+ *) Generate muti valued AVAs using '+' notation in config files for
+ req and dirName.
+ [Steve Henson]
+
+ *) Support for nameConstraints certificate extension.
+ [Steve Henson]
+
+ *) Support for policyConstraints certificate extension.
+ [Steve Henson]
+
+ *) Support for policyMappings certificate extension.
+ [Steve Henson]
+
+ *) Make sure the default DSA_METHOD implementation only uses its
+ dsa_mod_exp() and/or bn_mod_exp() handlers if they are non-NULL,
+ and change its own handlers to be NULL so as to remove unnecessary
+ indirection. This lets alternative implementations fallback to the
+ default implementation more easily.
+ [Geoff Thorpe]
+
+ *) Support for directoryName in GeneralName related extensions
+ in config files.
+ [Steve Henson]
+
+ *) Make it possible to link applications using Makefile.shared.
+ Make that possible even when linking against static libraries!
+ [Richard Levitte]
+
+ *) Support for single pass processing for S/MIME signing. This now
+ means that S/MIME signing can be done from a pipe, in addition
+ cleartext signing (multipart/signed type) is effectively streaming
+ and the signed data does not need to be all held in memory.
+
+ This is done with a new flag PKCS7_STREAM. When this flag is set
+ PKCS7_sign() only initializes the PKCS7 structure and the actual signing
+ is done after the data is output (and digests calculated) in
+ SMIME_write_PKCS7().
+ [Steve Henson]
+
+ *) Add full support for -rpath/-R, both in shared libraries and
+ applications, at least on the platforms where it's known how
+ to do it.
+ [Richard Levitte]
+
+ *) In crypto/ec/ec_mult.c, implement fast point multiplication with
+ precomputation, based on wNAF splitting: EC_GROUP_precompute_mult()
+ will now compute a table of multiples of the generator that
+ makes subsequent invocations of EC_POINTs_mul() or EC_POINT_mul()
+ faster (notably in the case of a single point multiplication,
+ scalar * generator).
+ [Nils Larsch, Bodo Moeller]
+
+ *) IPv6 support for certificate extensions. The various extensions
+ which use the IP:a.b.c.d can now take IPv6 addresses using the
+ formats of RFC1884 2.2 . IPv6 addresses are now also displayed
+ correctly.
+ [Steve Henson]
+
+ *) Added an ENGINE that implements RSA by performing private key
+ exponentiations with the GMP library. The conversions to and from
+ GMP's mpz_t format aren't optimised nor are any montgomery forms
+ cached, and on x86 it appears OpenSSL's own performance has caught up.
+ However there are likely to be other architectures where GMP could
+ provide a boost. This ENGINE is not built in by default, but it can be
+ specified at Configure time and should be accompanied by the necessary
+ linker additions, eg;
+ ./config -DOPENSSL_USE_GMP -lgmp
+ [Geoff Thorpe]
+
+ *) "openssl engine" will not display ENGINE/DSO load failure errors when
+ testing availability of engines with "-t" - the old behaviour is
+ produced by increasing the feature's verbosity with "-tt".
+ [Geoff Thorpe]
+
+ *) ECDSA routines: under certain error conditions uninitialized BN objects
+ could be freed. Solution: make sure initialization is performed early
+ enough. (Reported and fix supplied by Nils Larsch <nla@trustcenter.de>
+ via PR#459)
+ [Lutz Jaenicke]
+
+ *) Key-generation can now be implemented in RSA_METHOD, DSA_METHOD
+ and DH_METHOD (eg. by ENGINE implementations) to override the normal
+ software implementations. For DSA and DH, parameter generation can
+ also be overridden by providing the appropriate method callbacks.
+ [Geoff Thorpe]
+
+ *) Change the "progress" mechanism used in key-generation and
+ primality testing to functions that take a new BN_GENCB pointer in
+ place of callback/argument pairs. The new API functions have "_ex"
+ postfixes and the older functions are reimplemented as wrappers for
+ the new ones. The OPENSSL_NO_DEPRECATED symbol can be used to hide
+ declarations of the old functions to help (graceful) attempts to
+ migrate to the new functions. Also, the new key-generation API
+ functions operate on a caller-supplied key-structure and return
+ success/failure rather than returning a key or NULL - this is to
+ help make "keygen" another member function of RSA_METHOD etc.
+
+ Example for using the new callback interface:
+
+ int (*my_callback)(int a, int b, BN_GENCB *cb) = ...;
+ void *my_arg = ...;
+ BN_GENCB my_cb;
+
+ BN_GENCB_set(&my_cb, my_callback, my_arg);
+
+ return BN_is_prime_ex(some_bignum, BN_prime_checks, NULL, &cb);
+ /* For the meaning of a, b in calls to my_callback(), see the
+ * documentation of the function that calls the callback.
+ * cb will point to my_cb; my_arg can be retrieved as cb->arg.
+ * my_callback should return 1 if it wants BN_is_prime_ex()
+ * to continue, or 0 to stop.
+ */
+
+ [Geoff Thorpe]
+
+ *) Change the ZLIB compression method to be stateful, and make it
+ available to TLS with the number defined in
+ draft-ietf-tls-compression-04.txt.
+ [Richard Levitte]
+
+ *) Add the ASN.1 structures and functions for CertificatePair, which
+ is defined as follows (according to X.509_4thEditionDraftV6.pdf):
+
+ CertificatePair ::= SEQUENCE {
+ forward [0] Certificate OPTIONAL,
+ reverse [1] Certificate OPTIONAL,
+ -- at least one of the pair shall be present -- }
+
+ Also implement the PEM functions to read and write certificate
+ pairs, and defined the PEM tag as "CERTIFICATE PAIR".
+
+ This needed to be defined, mostly for the sake of the LDAP
+ attribute crossCertificatePair, but may prove useful elsewhere as
+ well.
+ [Richard Levitte]
+
+ *) Make it possible to inhibit symlinking of shared libraries in
+ Makefile.shared, for Cygwin's sake.
+ [Richard Levitte]
+
+ *) Extend the BIGNUM API by creating a function
+ void BN_set_negative(BIGNUM *a, int neg);
+ and a macro that behave like
+ int BN_is_negative(const BIGNUM *a);
+
+ to avoid the need to access 'a->neg' directly in applications.
+ [Nils Larsch]
+
+ *) Implement fast modular reduction for pseudo-Mersenne primes
+ used in NIST curves (crypto/bn/bn_nist.c, crypto/ec/ecp_nist.c).
+ EC_GROUP_new_curve_GFp() will now automatically use this
+ if applicable.
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Add new lock type (CRYPTO_LOCK_BN).
+ [Bodo Moeller]
+
+ *) Change the ENGINE framework to automatically load engines
+ dynamically from specific directories unless they could be
+ found to already be built in or loaded. Move all the
+ current engines except for the cryptodev one to a new
+ directory engines/.
+ The engines in engines/ are built as shared libraries if
+ the "shared" options was given to ./Configure or ./config.
+ Otherwise, they are inserted in libcrypto.a.
+ /usr/local/ssl/engines is the default directory for dynamic
+ engines, but that can be overridden at configure time through
+ the usual use of --prefix and/or --openssldir, and at run
+ time with the environment variable OPENSSL_ENGINES.
+ [Geoff Thorpe and Richard Levitte]
+
+ *) Add Makefile.shared, a helper makefile to build shared
+ libraries. Adapt Makefile.org.
+ [Richard Levitte]
+
+ *) Add version info to Win32 DLLs.
+ [Peter 'Luna' Runestig" <peter@runestig.com>]
+
+ *) Add new 'medium level' PKCS#12 API. Certificates and keys
+ can be added using this API to created arbitrary PKCS#12
+ files while avoiding the low level API.
+
+ New options to PKCS12_create(), key or cert can be NULL and
+ will then be omitted from the output file. The encryption
+ algorithm NIDs can be set to -1 for no encryption, the mac
+ iteration count can be set to 0 to omit the mac.
+
+ Enhance pkcs12 utility by making the -nokeys and -nocerts
+ options work when creating a PKCS#12 file. New option -nomac
+ to omit the mac, NONE can be set for an encryption algorithm.
+ New code is modified to use the enhanced PKCS12_create()
+ instead of the low level API.
+ [Steve Henson]
+
+ *) Extend ASN1 encoder to support indefinite length constructed
+ encoding. This can output sequences tags and octet strings in
+ this form. Modify pk7_asn1.c to support indefinite length
+ encoding. This is experimental and needs additional code to
+ be useful, such as an ASN1 bio and some enhanced streaming
+ PKCS#7 code.
+
+ Extend template encode functionality so that tagging is passed
+ down to the template encoder.
+ [Steve Henson]
+
+ *) Let 'openssl req' fail if an argument to '-newkey' is not
+ recognized instead of using RSA as a default.
+ [Bodo Moeller]
+
+ *) Add support for ECC-based ciphersuites from draft-ietf-tls-ecc-01.txt.
+ As these are not official, they are not included in "ALL";
+ the "ECCdraft" ciphersuite group alias can be used to select them.
+ [Vipul Gupta and Sumit Gupta (Sun Microsystems Laboratories)]
+
+ *) Add ECDH engine support.
+ [Nils Gura and Douglas Stebila (Sun Microsystems Laboratories)]
+
+ *) Add ECDH in new directory crypto/ecdh/.
+ [Douglas Stebila (Sun Microsystems Laboratories)]
+
+ *) Let BN_rand_range() abort with an error after 100 iterations
+ without success (which indicates a broken PRNG).
+ [Bodo Moeller]
+
+ *) Change BN_mod_sqrt() so that it verifies that the input value
+ is really the square of the return value. (Previously,
+ BN_mod_sqrt would show GIGO behaviour.)
+ [Bodo Moeller]
+
+ *) Add named elliptic curves over binary fields from X9.62, SECG,
+ and WAP/WTLS; add OIDs that were still missing.
+
+ [Sheueling Chang Shantz and Douglas Stebila
+ (Sun Microsystems Laboratories)]
+
+ *) Extend the EC library for elliptic curves over binary fields
+ (new files ec2_smpl.c, ec2_smpt.c, ec2_mult.c in crypto/ec/).
+ New EC_METHOD:
+
+ EC_GF2m_simple_method
+
+ New API functions:
+
+ EC_GROUP_new_curve_GF2m
+ EC_GROUP_set_curve_GF2m
+ EC_GROUP_get_curve_GF2m
+ EC_POINT_set_affine_coordinates_GF2m
+ EC_POINT_get_affine_coordinates_GF2m
+ EC_POINT_set_compressed_coordinates_GF2m
+
+ Point compression for binary fields is disabled by default for
+ patent reasons (compile with OPENSSL_EC_BIN_PT_COMP defined to
+ enable it).
+
+ As binary polynomials are represented as BIGNUMs, various members
+ of the EC_GROUP and EC_POINT data structures can be shared
+ between the implementations for prime fields and binary fields;
+ the above ..._GF2m functions (except for EX_GROUP_new_curve_GF2m)
+ are essentially identical to their ..._GFp counterparts.
+ (For simplicity, the '..._GFp' prefix has been dropped from
+ various internal method names.)
+
+ An internal 'field_div' method (similar to 'field_mul' and
+ 'field_sqr') has been added; this is used only for binary fields.
+
+ [Sheueling Chang Shantz and Douglas Stebila
+ (Sun Microsystems Laboratories)]
+
+ *) Optionally dispatch EC_POINT_mul(), EC_POINT_precompute_mult()
+ through methods ('mul', 'precompute_mult').
+
+ The generic implementations (now internally called 'ec_wNAF_mul'
+ and 'ec_wNAF_precomputed_mult') remain the default if these
+ methods are undefined.
+
+ [Sheueling Chang Shantz and Douglas Stebila
+ (Sun Microsystems Laboratories)]
+
+ *) New function EC_GROUP_get_degree, which is defined through
+ EC_METHOD. For curves over prime fields, this returns the bit
+ length of the modulus.
+
+ [Sheueling Chang Shantz and Douglas Stebila
+ (Sun Microsystems Laboratories)]
+
+ *) New functions EC_GROUP_dup, EC_POINT_dup.
+ (These simply call ..._new and ..._copy).
+
+ [Sheueling Chang Shantz and Douglas Stebila
+ (Sun Microsystems Laboratories)]
+
+ *) Add binary polynomial arithmetic software in crypto/bn/bn_gf2m.c.
+ Polynomials are represented as BIGNUMs (where the sign bit is not
+ used) in the following functions [macros]:
+
+ BN_GF2m_add
+ BN_GF2m_sub [= BN_GF2m_add]
+ BN_GF2m_mod [wrapper for BN_GF2m_mod_arr]
+ BN_GF2m_mod_mul [wrapper for BN_GF2m_mod_mul_arr]
+ BN_GF2m_mod_sqr [wrapper for BN_GF2m_mod_sqr_arr]
+ BN_GF2m_mod_inv
+ BN_GF2m_mod_exp [wrapper for BN_GF2m_mod_exp_arr]
+ BN_GF2m_mod_sqrt [wrapper for BN_GF2m_mod_sqrt_arr]
+ BN_GF2m_mod_solve_quad [wrapper for BN_GF2m_mod_solve_quad_arr]
+ BN_GF2m_cmp [= BN_ucmp]
+
+ (Note that only the 'mod' functions are actually for fields GF(2^m).
+ BN_GF2m_add() is misnomer, but this is for the sake of consistency.)
+
+ For some functions, an the irreducible polynomial defining a
+ field can be given as an 'unsigned int[]' with strictly
+ decreasing elements giving the indices of those bits that are set;
+ i.e., p[] represents the polynomial
+ f(t) = t^p[0] + t^p[1] + ... + t^p[k]
+ where
+ p[0] > p[1] > ... > p[k] = 0.
+ This applies to the following functions:
+
+ BN_GF2m_mod_arr
+ BN_GF2m_mod_mul_arr
+ BN_GF2m_mod_sqr_arr
+ BN_GF2m_mod_inv_arr [wrapper for BN_GF2m_mod_inv]
+ BN_GF2m_mod_div_arr [wrapper for BN_GF2m_mod_div]
+ BN_GF2m_mod_exp_arr
+ BN_GF2m_mod_sqrt_arr
+ BN_GF2m_mod_solve_quad_arr
+ BN_GF2m_poly2arr
+ BN_GF2m_arr2poly
+
+ Conversion can be performed by the following functions:
+
+ BN_GF2m_poly2arr
+ BN_GF2m_arr2poly
+
+ bntest.c has additional tests for binary polynomial arithmetic.
+
+ Two implementations for BN_GF2m_mod_div() are available.
+ The default algorithm simply uses BN_GF2m_mod_inv() and
+ BN_GF2m_mod_mul(). The alternative algorithm is compiled in only
+ if OPENSSL_SUN_GF2M_DIV is defined (patent pending; read the
+ copyright notice in crypto/bn/bn_gf2m.c before enabling it).
+
+ [Sheueling Chang Shantz and Douglas Stebila
+ (Sun Microsystems Laboratories)]
+
+ *) Add new error code 'ERR_R_DISABLED' that can be used when some
+ functionality is disabled at compile-time.
+ [Douglas Stebila <douglas.stebila@sun.com>]
+
+ *) Change default behaviour of 'openssl asn1parse' so that more
+ information is visible when viewing, e.g., a certificate:
+
+ Modify asn1_parse2 (crypto/asn1/asn1_par.c) so that in non-'dump'
+ mode the content of non-printable OCTET STRINGs is output in a
+ style similar to INTEGERs, but with '[HEX DUMP]' prepended to
+ avoid the appearance of a printable string.
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Add 'asn1_flag' and 'asn1_form' member to EC_GROUP with access
+ functions
+ EC_GROUP_set_asn1_flag()
+ EC_GROUP_get_asn1_flag()
+ EC_GROUP_set_point_conversion_form()
+ EC_GROUP_get_point_conversion_form()
+ These control ASN1 encoding details:
+ - Curves (i.e., groups) are encoded explicitly unless asn1_flag
+ has been set to OPENSSL_EC_NAMED_CURVE.
+ - Points are encoded in uncompressed form by default; options for
+ asn1_for are as for point2oct, namely
+ POINT_CONVERSION_COMPRESSED
+ POINT_CONVERSION_UNCOMPRESSED
+ POINT_CONVERSION_HYBRID
+
+ Also add 'seed' and 'seed_len' members to EC_GROUP with access
+ functions
+ EC_GROUP_set_seed()
+ EC_GROUP_get0_seed()
+ EC_GROUP_get_seed_len()
+ This is used only for ASN1 purposes (so far).
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Add 'field_type' member to EC_METHOD, which holds the NID
+ of the appropriate field type OID. The new function
+ EC_METHOD_get_field_type() returns this value.
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Add functions
+ EC_POINT_point2bn()
+ EC_POINT_bn2point()
+ EC_POINT_point2hex()
+ EC_POINT_hex2point()
+ providing useful interfaces to EC_POINT_point2oct() and
+ EC_POINT_oct2point().
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Change internals of the EC library so that the functions
+ EC_GROUP_set_generator()
+ EC_GROUP_get_generator()
+ EC_GROUP_get_order()
+ EC_GROUP_get_cofactor()
+ are implemented directly in crypto/ec/ec_lib.c and not dispatched
+ to methods, which would lead to unnecessary code duplication when
+ adding different types of curves.
+ [Nils Larsch <nla@trustcenter.de> with input by Bodo Moeller]
+
+ *) Implement compute_wNAF (crypto/ec/ec_mult.c) without BIGNUM
+ arithmetic, and such that modified wNAFs are generated
+ (which avoid length expansion in many cases).
+ [Bodo Moeller]
+
+ *) Add a function EC_GROUP_check_discriminant() (defined via
+ EC_METHOD) that verifies that the curve discriminant is non-zero.
+
+ Add a function EC_GROUP_check() that makes some sanity tests
+ on a EC_GROUP, its generator and order. This includes
+ EC_GROUP_check_discriminant().
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Add ECDSA in new directory crypto/ecdsa/.
+
+ Add applications 'openssl ecparam' and 'openssl ecdsa'
+ (these are based on 'openssl dsaparam' and 'openssl dsa').
+
+ ECDSA support is also included in various other files across the
+ library. Most notably,
+ - 'openssl req' now has a '-newkey ecdsa:file' option;
+ - EVP_PKCS82PKEY (crypto/evp/evp_pkey.c) now can handle ECDSA;
+ - X509_PUBKEY_get (crypto/asn1/x_pubkey.c) and
+ d2i_PublicKey (crypto/asn1/d2i_pu.c) have been modified to make
+ them suitable for ECDSA where domain parameters must be
+ extracted before the specific public key;
+ - ECDSA engine support has been added.
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Include some named elliptic curves, and add OIDs from X9.62,
+ SECG, and WAP/WTLS. Each curve can be obtained from the new
+ function
+ EC_GROUP_new_by_curve_name(),
+ and the list of available named curves can be obtained with
+ EC_get_builtin_curves().
+ Also add a 'curve_name' member to EC_GROUP objects, which can be
+ accessed via
+ EC_GROUP_set_curve_name()
+ EC_GROUP_get_curve_name()
+ [Nils Larsch <larsch@trustcenter.de, Bodo Moeller]
+
+ *) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
+ was actually never needed) and in BN_mul(). The removal in BN_mul()
+ required a small change in bn_mul_part_recursive() and the addition
+ of the functions bn_cmp_part_words(), bn_sub_part_words() and
+ bn_add_part_words(), which do the same thing as bn_cmp_words(),
+ bn_sub_words() and bn_add_words() except they take arrays with
+ differing sizes.
+ [Richard Levitte]
+
+ Changes between 0.9.7l and 0.9.7m [23 Feb 2007]
+
+ *) Cleanse PEM buffers before freeing them since they may contain
+ sensitive data.
+ [Benjamin Bennett <ben@psc.edu>]
+
+ *) Include "!eNULL" in SSL_DEFAULT_CIPHER_LIST to make sure that
+ a ciphersuite string such as "DEFAULT:RSA" cannot enable
+ authentication-only ciphersuites.
+ [Bodo Moeller]
+
+ *) Since AES128 and AES256 share a single mask bit in the logic of
+ ssl/ssl_ciph.c, the code for masking out disabled ciphers needs a
+ kludge to work properly if AES128 is available and AES256 isn't.
+ [Victor Duchovni]
+
+ *) Expand security boundary to match 1.1.1 module.
+ [Steve Henson]
+
+ *) Remove redundant features: hash file source, editing of test vectors
+ modify fipsld to use external fips_premain.c signature.
+ [Steve Henson]
+
+ *) New perl script mkfipsscr.pl to create shell scripts or batch files to
+ run algorithm test programs.
+ [Steve Henson]
+
+ *) Make algorithm test programs more tolerant of whitespace.
+ [Steve Henson]
+
+ *) Have SSL/TLS server implementation tolerate "mismatched" record
+ protocol version while receiving ClientHello even if the
+ ClientHello is fragmented. (The server can't insist on the
+ particular protocol version it has chosen before the ServerHello
+ message has informed the client about his choice.)
+ [Bodo Moeller]
+
+ *) Load error codes if they are not already present instead of using a
+ static variable. This allows them to be cleanly unloaded and reloaded.
+ [Steve Henson]
+
+ Changes between 0.9.7k and 0.9.7l [28 Sep 2006]
+
+ *) Introduce limits to prevent malicious keys being able to
+ cause a denial of service. (CVE-2006-2940)
+ [Steve Henson, Bodo Moeller]
+
+ *) Fix ASN.1 parsing of certain invalid structures that can result
+ in a denial of service. (CVE-2006-2937) [Steve Henson]
+
+ *) Fix buffer overflow in SSL_get_shared_ciphers() function.
+ (CVE-2006-3738) [Tavis Ormandy and Will Drewry, Google Security Team]
+
+ *) Fix SSL client code which could crash if connecting to a
+ malicious SSLv2 server. (CVE-2006-4343)
+ [Tavis Ormandy and Will Drewry, Google Security Team]
+
+ *) Change ciphersuite string processing so that an explicit
+ ciphersuite selects this one ciphersuite (so that "AES256-SHA"
+ will no longer include "AES128-SHA"), and any other similar
+ ciphersuite (same bitmap) from *other* protocol versions (so that
+ "RC4-MD5" will still include both the SSL 2.0 ciphersuite and the
+ SSL 3.0/TLS 1.0 ciphersuite). This is a backport combining
+ changes from 0.9.8b and 0.9.8d.
+ [Bodo Moeller]
+
+ Changes between 0.9.7j and 0.9.7k [05 Sep 2006]
+
+ *) Avoid PKCS #1 v1.5 signature attack discovered by Daniel Bleichenbacher
+ (CVE-2006-4339) [Ben Laurie and Google Security Team]
+
+ *) Change the Unix randomness entropy gathering to use poll() when
+ possible instead of select(), since the latter has some
+ undesirable limitations.
+ [Darryl Miles via Richard Levitte and Bodo Moeller]
+
+ *) Disable rogue ciphersuites:
+
+ - SSLv2 0x08 0x00 0x80 ("RC4-64-MD5")
+ - SSLv3/TLSv1 0x00 0x61 ("EXP1024-RC2-CBC-MD5")
+ - SSLv3/TLSv1 0x00 0x60 ("EXP1024-RC4-MD5")
+
+ The latter two were purportedly from
+ draft-ietf-tls-56-bit-ciphersuites-0[01].txt, but do not really
+ appear there.
+
+ Also deactive the remaining ciphersuites from
+ draft-ietf-tls-56-bit-ciphersuites-01.txt. These are just as
+ unofficial, and the ID has long expired.
+ [Bodo Moeller]
+
+ *) Fix RSA blinding Heisenbug (problems sometimes occurred on
+ dual-core machines) and other potential thread-safety issues.
+ [Bodo Moeller]
+
+ Changes between 0.9.7i and 0.9.7j [04 May 2006]
+
+ *) Adapt fipsld and the build system to link against the validated FIPS
+ module in FIPS mode.
+ [Steve Henson]
+
+ *) Fixes for VC++ 2005 build under Windows.
+ [Steve Henson]
+
+ *) Add new Windows build target VC-32-GMAKE for VC++. This uses GNU make
+ from a Windows bash shell such as MSYS. It is autodetected from the
+ "config" script when run from a VC++ environment. Modify standard VC++
+ build to use fipscanister.o from the GNU make build.
+ [Steve Henson]
+
+ Changes between 0.9.7h and 0.9.7i [14 Oct 2005]
+
+ *) Wrapped the definition of EVP_MAX_MD_SIZE in a #ifdef OPENSSL_FIPS.
+ The value now differs depending on if you build for FIPS or not.
+ BEWARE! A program linked with a shared FIPSed libcrypto can't be
+ safely run with a non-FIPSed libcrypto, as it may crash because of
+ the difference induced by this change.
+ [Andy Polyakov]
+
+ Changes between 0.9.7g and 0.9.7h [11 Oct 2005]
+
+ *) Remove the functionality of SSL_OP_MSIE_SSLV2_RSA_PADDING
+ (part of SSL_OP_ALL). This option used to disable the
+ countermeasure against man-in-the-middle protocol-version
+ rollback in the SSL 2.0 server implementation, which is a bad
+ idea. (CVE-2005-2969)
+
+ [Bodo Moeller; problem pointed out by Yutaka Oiwa (Research Center
+ for Information Security, National Institute of Advanced Industrial
+ Science and Technology [AIST], Japan)]
+
+ *) Minimal support for X9.31 signatures and PSS padding modes. This is
+ mainly for FIPS compliance and not fully integrated at this stage.
+ [Steve Henson]
+
+ *) For DSA signing, unless DSA_FLAG_NO_EXP_CONSTTIME is set, perform
+ the exponentiation using a fixed-length exponent. (Otherwise,
+ the information leaked through timing could expose the secret key
+ after many signatures; cf. Bleichenbacher's attack on DSA with
+ biased k.)
+ [Bodo Moeller]
+
+ *) Make a new fixed-window mod_exp implementation the default for
+ RSA, DSA, and DH private-key operations so that the sequence of
+ squares and multiplies and the memory access pattern are
+ independent of the particular secret key. This will mitigate
+ cache-timing and potential related attacks.
+
+ BN_mod_exp_mont_consttime() is the new exponentiation implementation,
+ and this is automatically used by BN_mod_exp_mont() if the new flag
+ BN_FLG_EXP_CONSTTIME is set for the exponent. RSA, DSA, and DH
+ will use this BN flag for private exponents unless the flag
+ RSA_FLAG_NO_EXP_CONSTTIME, DSA_FLAG_NO_EXP_CONSTTIME, or
+ DH_FLAG_NO_EXP_CONSTTIME, respectively, is set.
+
+ [Matthew D Wood (Intel Corp), with some changes by Bodo Moeller]
+
+ *) Change the client implementation for SSLv23_method() and
+ SSLv23_client_method() so that is uses the SSL 3.0/TLS 1.0
+ Client Hello message format if the SSL_OP_NO_SSLv2 option is set.
+ (Previously, the SSL 2.0 backwards compatible Client Hello
+ message format would be used even with SSL_OP_NO_SSLv2.)
+ [Bodo Moeller]
+
+ *) Add support for smime-type MIME parameter in S/MIME messages which some
+ clients need.
+ [Steve Henson]
+
+ *) New function BN_MONT_CTX_set_locked() to set montgomery parameters in
+ a threadsafe manner. Modify rsa code to use new function and add calls
+ to dsa and dh code (which had race conditions before).
+ [Steve Henson]
+
+ *) Include the fixed error library code in the C error file definitions
+ instead of fixing them up at runtime. This keeps the error code
+ structures constant.
+ [Steve Henson]
+
+ Changes between 0.9.7f and 0.9.7g [11 Apr 2005]
+
+ [NB: OpenSSL 0.9.7h and later 0.9.7 patch levels were released after
+ OpenSSL 0.9.8.]
+
+ *) Fixes for newer kerberos headers. NB: the casts are needed because
+ the 'length' field is signed on one version and unsigned on another
+ with no (?) obvious way to tell the difference, without these VC++
+ complains. Also the "definition" of FAR (blank) is no longer included
+ nor is the error ENOMEM. KRB5_PRIVATE has to be set to 1 to pick up
+ some needed definitions.
+ [Steve Henson]
+
+ *) Undo Cygwin change.
+ [Ulf Möller]
+
+ *) Added support for proxy certificates according to RFC 3820.
+ Because they may be a security thread to unaware applications,
+ they must be explicitly allowed in run-time. See
+ docs/HOWTO/proxy_certificates.txt for further information.
+ [Richard Levitte]
+
+ Changes between 0.9.7e and 0.9.7f [22 Mar 2005]
+
+ *) Use (SSL_RANDOM_VALUE - 4) bytes of pseudo random data when generating
+ server and client random values. Previously
+ (SSL_RANDOM_VALUE - sizeof(time_t)) would be used which would result in
+ less random data when sizeof(time_t) > 4 (some 64 bit platforms).
+
+ This change has negligible security impact because:
+
+ 1. Server and client random values still have 24 bytes of pseudo random
+ data.
+
+ 2. Server and client random values are sent in the clear in the initial
+ handshake.
+
+ 3. The master secret is derived using the premaster secret (48 bytes in
+ size for static RSA ciphersuites) as well as client server and random
+ values.
+
+ The OpenSSL team would like to thank the UK NISCC for bringing this issue
+ to our attention.
+
+ [Stephen Henson, reported by UK NISCC]
+
+ *) Use Windows randomness collection on Cygwin.
+ [Ulf Möller]
+
+ *) Fix hang in EGD/PRNGD query when communication socket is closed
+ prematurely by EGD/PRNGD.
+ [Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014]
+
+ *) Prompt for pass phrases when appropriate for PKCS12 input format.
+ [Steve Henson]
+
+ *) Back-port of selected performance improvements from development
+ branch, as well as improved support for PowerPC platforms.
+ [Andy Polyakov]
+
+ *) Add lots of checks for memory allocation failure, error codes to indicate
+ failure and freeing up memory if a failure occurs.
+ [Nauticus Networks SSL Team <openssl@nauticusnet.com>, Steve Henson]
+
+ *) Add new -passin argument to dgst.
+ [Steve Henson]
+
+ *) Perform some character comparisons of different types in X509_NAME_cmp:
+ this is needed for some certificates that re-encode DNs into UTF8Strings
+ (in violation of RFC3280) and can't or won't issue name rollover
+ certificates.
+ [Steve Henson]
+
+ *) Make an explicit check during certificate validation to see that
+ the CA setting in each certificate on the chain is correct. As a
+ side effect always do the following basic checks on extensions,
+ not just when there's an associated purpose to the check:
+
+ - if there is an unhandled critical extension (unless the user
+ has chosen to ignore this fault)
+ - if the path length has been exceeded (if one is set at all)
+ - that certain extensions fit the associated purpose (if one has
+ been given)
+ [Richard Levitte]
+
+ Changes between 0.9.7d and 0.9.7e [25 Oct 2004]
+
+ *) Avoid a race condition when CRLs are checked in a multi threaded
+ environment. This would happen due to the reordering of the revoked
+ entries during signature checking and serial number lookup. Now the
+ encoding is cached and the serial number sort performed under a lock.
+ Add new STACK function sk_is_sorted().
+ [Steve Henson]
+
+ *) Add Delta CRL to the extension code.
+ [Steve Henson]
+
+ *) Various fixes to s3_pkt.c so alerts are sent properly.
+ [David Holmes <d.holmes@f5.com>]
+
+ *) Reduce the chances of duplicate issuer name and serial numbers (in
+ violation of RFC3280) using the OpenSSL certificate creation utilities.
+ This is done by creating a random 64 bit value for the initial serial
+ number when a serial number file is created or when a self signed
+ certificate is created using 'openssl req -x509'. The initial serial
+ number file is created using 'openssl x509 -next_serial' in CA.pl
+ rather than being initialized to 1.
+ [Steve Henson]
+
+ Changes between 0.9.7c and 0.9.7d [17 Mar 2004]
+
+ *) Fix null-pointer assignment in do_change_cipher_spec() revealed
+ by using the Codenomicon TLS Test Tool (CVE-2004-0079)
+ [Joe Orton, Steve Henson]
+
+ *) Fix flaw in SSL/TLS handshaking when using Kerberos ciphersuites
+ (CVE-2004-0112)
+ [Joe Orton, Steve Henson]
+
+ *) Make it possible to have multiple active certificates with the same
+ subject in the CA index file. This is done only if the keyword
+ 'unique_subject' is set to 'no' in the main CA section (default
+ if 'CA_default') of the configuration file. The value is saved
+ with the database itself in a separate index attribute file,
+ named like the index file with '.attr' appended to the name.
+ [Richard Levitte]
+
+ *) X509 verify fixes. Disable broken certificate workarounds when
+ X509_V_FLAGS_X509_STRICT is set. Check CRL issuer has cRLSign set if
+ keyUsage extension present. Don't accept CRLs with unhandled critical
+ extensions: since verify currently doesn't process CRL extensions this
+ rejects a CRL with *any* critical extensions. Add new verify error codes
+ for these cases.
+ [Steve Henson]
+
+ *) When creating an OCSP nonce use an OCTET STRING inside the extnValue.
+ A clarification of RFC2560 will require the use of OCTET STRINGs and
+ some implementations cannot handle the current raw format. Since OpenSSL
+ copies and compares OCSP nonces as opaque blobs without any attempt at
+ parsing them this should not create any compatibility issues.
+ [Steve Henson]
+
+ *) New md flag EVP_MD_CTX_FLAG_REUSE this allows md_data to be reused when
+ calling EVP_MD_CTX_copy_ex() to avoid calling OPENSSL_malloc(). Without
+ this HMAC (and other) operations are several times slower than OpenSSL
+ < 0.9.7.
+ [Steve Henson]
+
+ *) Print out GeneralizedTime and UTCTime in ASN1_STRING_print_ex().
+ [Peter Sylvester <Peter.Sylvester@EdelWeb.fr>]
+
+ *) Use the correct content when signing type "other".
+ [Steve Henson]
+
+ Changes between 0.9.7b and 0.9.7c [30 Sep 2003]
+
+ *) Fix various bugs revealed by running the NISCC test suite:
+
+ Stop out of bounds reads in the ASN1 code when presented with
+ invalid tags (CVE-2003-0543 and CVE-2003-0544).
+
+ Free up ASN1_TYPE correctly if ANY type is invalid (CVE-2003-0545).
+
+ If verify callback ignores invalid public key errors don't try to check
+ certificate signature with the NULL public key.
+
+ [Steve Henson]
+
+ *) New -ignore_err option in ocsp application to stop the server
+ exiting on the first error in a request.
+ [Steve Henson]
+
+ *) In ssl3_accept() (ssl/s3_srvr.c) only accept a client certificate
+ if the server requested one: as stated in TLS 1.0 and SSL 3.0
+ specifications.
+ [Steve Henson]
+
+ *) In ssl3_get_client_hello() (ssl/s3_srvr.c), tolerate additional
+ extra data after the compression methods not only for TLS 1.0
+ but also for SSL 3.0 (as required by the specification).
+ [Bodo Moeller; problem pointed out by Matthias Loepfe]
+
+ *) Change X509_certificate_type() to mark the key as exported/exportable
+ when it's 512 *bits* long, not 512 bytes.
+ [Richard Levitte]
+
+ *) Change AES_cbc_encrypt() so it outputs exact multiple of
+ blocks during encryption.
+ [Richard Levitte]
+
+ *) Various fixes to base64 BIO and non blocking I/O. On write
+ flushes were not handled properly if the BIO retried. On read
+ data was not being buffered properly and had various logic bugs.
+ This also affects blocking I/O when the data being decoded is a
+ certain size.
+ [Steve Henson]
+
+ *) Various S/MIME bugfixes and compatibility changes:
+ output correct application/pkcs7 MIME type if
+ PKCS7_NOOLDMIMETYPE is set. Tolerate some broken signatures.
+ Output CR+LF for EOL if PKCS7_CRLFEOL is set (this makes opening
+ of files as .eml work). Correctly handle very long lines in MIME
+ parser.
+ [Steve Henson]
+
+ Changes between 0.9.7a and 0.9.7b [10 Apr 2003]
+
+ *) Countermeasure against the Klima-Pokorny-Rosa extension of
+ Bleichbacher's attack on PKCS #1 v1.5 padding: treat
+ a protocol version number mismatch like a decryption error
+ in ssl3_get_client_key_exchange (ssl/s3_srvr.c).
+ [Bodo Moeller]
+
+ *) Turn on RSA blinding by default in the default implementation
+ to avoid a timing attack. Applications that don't want it can call
+ RSA_blinding_off() or use the new flag RSA_FLAG_NO_BLINDING.
+ They would be ill-advised to do so in most cases.
+ [Ben Laurie, Steve Henson, Geoff Thorpe, Bodo Moeller]
+
+ *) Change RSA blinding code so that it works when the PRNG is not
+ seeded (in this case, the secret RSA exponent is abused as
+ an unpredictable seed -- if it is not unpredictable, there
+ is no point in blinding anyway). Make RSA blinding thread-safe
+ by remembering the creator's thread ID in rsa->blinding and
+ having all other threads use local one-time blinding factors
+ (this requires more computation than sharing rsa->blinding, but
+ avoids excessive locking; and if an RSA object is not shared
+ between threads, blinding will still be very fast).
+ [Bodo Moeller]
+
+ *) Fixed a typo bug that would cause ENGINE_set_default() to set an
+ ENGINE as defaults for all supported algorithms irrespective of
+ the 'flags' parameter. 'flags' is now honoured, so applications
+ should make sure they are passing it correctly.
+ [Geoff Thorpe]
+
+ *) Target "mingw" now allows native Windows code to be generated in
+ the Cygwin environment as well as with the MinGW compiler.
+ [Ulf Moeller]
+
+ Changes between 0.9.7 and 0.9.7a [19 Feb 2003]
+
+ *) In ssl3_get_record (ssl/s3_pkt.c), minimize information leaked
+ via timing by performing a MAC computation even if incorrect
+ block cipher padding has been found. This is a countermeasure
+ against active attacks where the attacker has to distinguish
+ between bad padding and a MAC verification error. (CVE-2003-0078)
+
+ [Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
+ Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
+ Martin Vuagnoux (EPFL, Ilion)]
+
+ *) Make the no-err option work as intended. The intention with no-err
+ is not to have the whole error stack handling routines removed from
+ libcrypto, it's only intended to remove all the function name and
+ reason texts, thereby removing some of the footprint that may not
+ be interesting if those errors aren't displayed anyway.
+
+ NOTE: it's still possible for any application or module to have it's
+ own set of error texts inserted. The routines are there, just not
+ used by default when no-err is given.
+ [Richard Levitte]
+
+ *) Add support for FreeBSD on IA64.
+ [dirk.meyer@dinoex.sub.org via Richard Levitte, resolves #454]
+
+ *) Adjust DES_cbc_cksum() so it returns the same value as the MIT
+ Kerberos function mit_des_cbc_cksum(). Before this change,
+ the value returned by DES_cbc_cksum() was like the one from
+ mit_des_cbc_cksum(), except the bytes were swapped.
+ [Kevin Greaney <Kevin.Greaney@hp.com> and Richard Levitte]
+
+ *) Allow an application to disable the automatic SSL chain building.
+ Before this a rather primitive chain build was always performed in
+ ssl3_output_cert_chain(): an application had no way to send the
+ correct chain if the automatic operation produced an incorrect result.
+
+ Now the chain builder is disabled if either:
+
+ 1. Extra certificates are added via SSL_CTX_add_extra_chain_cert().
+
+ 2. The mode flag SSL_MODE_NO_AUTO_CHAIN is set.
+
+ The reasoning behind this is that an application would not want the
+ auto chain building to take place if extra chain certificates are
+ present and it might also want a means of sending no additional
+ certificates (for example the chain has two certificates and the
+ root is omitted).
+ [Steve Henson]
+
+ *) Add the possibility to build without the ENGINE framework.
+ [Steven Reddie <smr@essemer.com.au> via Richard Levitte]
+
+ *) Under Win32 gmtime() can return NULL: check return value in
+ OPENSSL_gmtime(). Add error code for case where gmtime() fails.
+ [Steve Henson]
+
+ *) DSA routines: under certain error conditions uninitialized BN objects
+ could be freed. Solution: make sure initialization is performed early
+ enough. (Reported and fix supplied by Ivan D Nestlerode <nestler@MIT.EDU>,
+ Nils Larsch <nla@trustcenter.de> via PR#459)
+ [Lutz Jaenicke]
+
+ *) Another fix for SSLv2 session ID handling: the session ID was incorrectly
+ checked on reconnect on the client side, therefore session resumption
+ could still fail with a "ssl session id is different" error. This
+ behaviour is masked when SSL_OP_ALL is used due to
+ SSL_OP_MICROSOFT_SESS_ID_BUG being set.
+ Behaviour observed by Crispin Flowerday <crispin@flowerday.cx> as
+ followup to PR #377.
+ [Lutz Jaenicke]
+
+ *) IA-32 assembler support enhancements: unified ELF targets, support
+ for SCO/Caldera platforms, fix for Cygwin shared build.
+ [Andy Polyakov]
+
+ *) Add support for FreeBSD on sparc64. As a consequence, support for
+ FreeBSD on non-x86 processors is separate from x86 processors on
+ the config script, much like the NetBSD support.
+ [Richard Levitte & Kris Kennaway <kris@obsecurity.org>]
+
+ Changes between 0.9.6h and 0.9.7 [31 Dec 2002]
+
+ [NB: OpenSSL 0.9.6i and later 0.9.6 patch levels were released after
+ OpenSSL 0.9.7.]
+
+ *) Fix session ID handling in SSLv2 client code: the SERVER FINISHED
+ code (06) was taken as the first octet of the session ID and the last
+ octet was ignored consequently. As a result SSLv2 client side session
+ caching could not have worked due to the session ID mismatch between
+ client and server.
+ Behaviour observed by Crispin Flowerday <crispin@flowerday.cx> as
+ PR #377.
+ [Lutz Jaenicke]
+
+ *) Change the declaration of needed Kerberos libraries to use EX_LIBS
+ instead of the special (and badly supported) LIBKRB5. LIBKRB5 is
+ removed entirely.
+ [Richard Levitte]
+
+ *) The hw_ncipher.c engine requires dynamic locks. Unfortunately, it
+ seems that in spite of existing for more than a year, many application
+ author have done nothing to provide the necessary callbacks, which
+ means that this particular engine will not work properly anywhere.
+ This is a very unfortunate situation which forces us, in the name
+ of usability, to give the hw_ncipher.c a static lock, which is part
+ of libcrypto.
+ NOTE: This is for the 0.9.7 series ONLY. This hack will never
+ appear in 0.9.8 or later. We EXPECT application authors to have
+ dealt properly with this when 0.9.8 is released (unless we actually
+ make such changes in the libcrypto locking code that changes will
+ have to be made anyway).
+ [Richard Levitte]
+
+ *) In asn1_d2i_read_bio() repeatedly call BIO_read() until all content
+ octets have been read, EOF or an error occurs. Without this change
+ some truncated ASN1 structures will not produce an error.
+ [Steve Henson]
+
+ *) Disable Heimdal support, since it hasn't been fully implemented.
+ Still give the possibility to force the use of Heimdal, but with
+ warnings and a request that patches get sent to openssl-dev.
+ [Richard Levitte]
+
+ *) Add the VC-CE target, introduce the WINCE sysname, and add
+ INSTALL.WCE and appropriate conditionals to make it build.
+ [Steven Reddie <smr@essemer.com.au> via Richard Levitte]
+
+ *) Change the DLL names for Cygwin to cygcrypto-x.y.z.dll and
+ cygssl-x.y.z.dll, where x, y and z are the major, minor and
+ edit numbers of the version.
+ [Corinna Vinschen <vinschen@redhat.com> and Richard Levitte]
+
+ *) Introduce safe string copy and catenation functions
+ (BUF_strlcpy() and BUF_strlcat()).
+ [Ben Laurie (CHATS) and Richard Levitte]
+
+ *) Avoid using fixed-size buffers for one-line DNs.
+ [Ben Laurie (CHATS)]
+
+ *) Add BUF_MEM_grow_clean() to avoid information leakage when
+ resizing buffers containing secrets, and use where appropriate.
+ [Ben Laurie (CHATS)]
+
+ *) Avoid using fixed size buffers for configuration file location.
+ [Ben Laurie (CHATS)]
+
+ *) Avoid filename truncation for various CA files.
+ [Ben Laurie (CHATS)]
+
+ *) Use sizeof in preference to magic numbers.
+ [Ben Laurie (CHATS)]
+
+ *) Avoid filename truncation in cert requests.
+ [Ben Laurie (CHATS)]
+
+ *) Add assertions to check for (supposedly impossible) buffer
+ overflows.
+ [Ben Laurie (CHATS)]
+
+ *) Don't cache truncated DNS entries in the local cache (this could
+ potentially lead to a spoofing attack).
+ [Ben Laurie (CHATS)]
+
+ *) Fix various buffers to be large enough for hex/decimal
+ representations in a platform independent manner.
+ [Ben Laurie (CHATS)]
+
+ *) Add CRYPTO_realloc_clean() to avoid information leakage when
+ resizing buffers containing secrets, and use where appropriate.
+ [Ben Laurie (CHATS)]
+
+ *) Add BIO_indent() to avoid much slightly worrying code to do
+ indents.
+ [Ben Laurie (CHATS)]
+
+ *) Convert sprintf()/BIO_puts() to BIO_printf().
+ [Ben Laurie (CHATS)]
+
+ *) buffer_gets() could terminate with the buffer only half
+ full. Fixed.
+ [Ben Laurie (CHATS)]
+
+ *) Add assertions to prevent user-supplied crypto functions from
+ overflowing internal buffers by having large block sizes, etc.
+ [Ben Laurie (CHATS)]
+
+ *) New OPENSSL_assert() macro (similar to assert(), but enabled
+ unconditionally).
+ [Ben Laurie (CHATS)]
+
+ *) Eliminate unused copy of key in RC4.
+ [Ben Laurie (CHATS)]
+
+ *) Eliminate unused and incorrectly sized buffers for IV in pem.h.
+ [Ben Laurie (CHATS)]
+
+ *) Fix off-by-one error in EGD path.
+ [Ben Laurie (CHATS)]
+
+ *) If RANDFILE path is too long, ignore instead of truncating.
+ [Ben Laurie (CHATS)]
+
+ *) Eliminate unused and incorrectly sized X.509 structure
+ CBCParameter.
+ [Ben Laurie (CHATS)]
+
+ *) Eliminate unused and dangerous function knumber().
+ [Ben Laurie (CHATS)]
+
+ *) Eliminate unused and dangerous structure, KSSL_ERR.
+ [Ben Laurie (CHATS)]
+
+ *) Protect against overlong session ID context length in an encoded
+ session object. Since these are local, this does not appear to be
+ exploitable.
+ [Ben Laurie (CHATS)]
+
+ *) Change from security patch (see 0.9.6e below) that did not affect
+ the 0.9.6 release series:
+
+ Remote buffer overflow in SSL3 protocol - an attacker could
+ supply an oversized master key in Kerberos-enabled versions.
+ (CVE-2002-0657)
+ [Ben Laurie (CHATS)]
+
+ *) Change the SSL kerb5 codes to match RFC 2712.
+ [Richard Levitte]
+
+ *) Make -nameopt work fully for req and add -reqopt switch.
+ [Michael Bell <michael.bell@rz.hu-berlin.de>, Steve Henson]
+
+ *) The "block size" for block ciphers in CFB and OFB mode should be 1.
+ [Steve Henson, reported by Yngve Nysaeter Pettersen <yngve@opera.com>]
+
+ *) Make sure tests can be performed even if the corresponding algorithms
+ have been removed entirely. This was also the last step to make
+ OpenSSL compilable with DJGPP under all reasonable conditions.
+ [Richard Levitte, Doug Kaufman <dkaufman@rahul.net>]
+
+ *) Add cipher selection rules COMPLEMENTOFALL and COMPLEMENTOFDEFAULT
+ to allow version independent disabling of normally unselected ciphers,
+ which may be activated as a side-effect of selecting a single cipher.
+
+ (E.g., cipher list string "RSA" enables ciphersuites that are left
+ out of "ALL" because they do not provide symmetric encryption.
+ "RSA:!COMPLEMEMENTOFALL" avoids these unsafe ciphersuites.)
+ [Lutz Jaenicke, Bodo Moeller]
+
+ *) Add appropriate support for separate platform-dependent build
+ directories. The recommended way to make a platform-dependent
+ build directory is the following (tested on Linux), maybe with
+ some local tweaks:
+
+ # Place yourself outside of the OpenSSL source tree. In
+ # this example, the environment variable OPENSSL_SOURCE
+ # is assumed to contain the absolute OpenSSL source directory.
+ mkdir -p objtree/"`uname -s`-`uname -r`-`uname -m`"
+ cd objtree/"`uname -s`-`uname -r`-`uname -m`"
+ (cd $OPENSSL_SOURCE; find . -type f) | while read F; do
+ mkdir -p `dirname $F`
+ ln -s $OPENSSL_SOURCE/$F $F
+ done
+
+ To be absolutely sure not to disturb the source tree, a "make clean"
+ is a good thing. If it isn't successful, don't worry about it,
+ it probably means the source directory is very clean.
+ [Richard Levitte]
+
+ *) Make sure any ENGINE control commands make local copies of string
+ pointers passed to them whenever necessary. Otherwise it is possible
+ the caller may have overwritten (or deallocated) the original string
+ data when a later ENGINE operation tries to use the stored values.
+ [Götz Babin-Ebell <babinebell@trustcenter.de>]
+
+ *) Improve diagnostics in file reading and command-line digests.
+ [Ben Laurie aided and abetted by Solar Designer <solar@openwall.com>]
+
+ *) Add AES modes CFB and OFB to the object database. Correct an
+ error in AES-CFB decryption.
+ [Richard Levitte]
+
+ *) Remove most calls to EVP_CIPHER_CTX_cleanup() in evp_enc.c, this
+ allows existing EVP_CIPHER_CTX structures to be reused after
+ calling EVP_*Final(). This behaviour is used by encryption
+ BIOs and some applications. This has the side effect that
+ applications must explicitly clean up cipher contexts with
+ EVP_CIPHER_CTX_cleanup() or they will leak memory.
+ [Steve Henson]
+
+ *) Check the values of dna and dnb in bn_mul_recursive before calling
+ bn_mul_comba (a non zero value means the a or b arrays do not contain
+ n2 elements) and fallback to bn_mul_normal if either is not zero.
+ [Steve Henson]
+
+ *) Fix escaping of non-ASCII characters when using the -subj option
+ of the "openssl req" command line tool. (Robert Joop <joop@fokus.gmd.de>)
+ [Lutz Jaenicke]
+
+ *) Make object definitions compliant to LDAP (RFC2256): SN is the short
+ form for "surname", serialNumber has no short form.
+ Use "mail" as the short name for "rfc822Mailbox" according to RFC2798;
+ therefore remove "mail" short name for "internet 7".
+ The OID for unique identifiers in X509 certificates is
+ x500UniqueIdentifier, not uniqueIdentifier.
+ Some more OID additions. (Michael Bell <michael.bell@rz.hu-berlin.de>)
+ [Lutz Jaenicke]
+
+ *) Add an "init" command to the ENGINE config module and auto initialize
+ ENGINEs. Without any "init" command the ENGINE will be initialized
+ after all ctrl commands have been executed on it. If init=1 the
+ ENGINE is initailized at that point (ctrls before that point are run
+ on the uninitialized ENGINE and after on the initialized one). If
+ init=0 then the ENGINE will not be iniatialized at all.
+ [Steve Henson]
+
+ *) Fix the 'app_verify_callback' interface so that the user-defined
+ argument is actually passed to the callback: In the
+ SSL_CTX_set_cert_verify_callback() prototype, the callback
+ declaration has been changed from
+ int (*cb)()
+ into
+ int (*cb)(X509_STORE_CTX *,void *);
+ in ssl_verify_cert_chain (ssl/ssl_cert.c), the call
+ i=s->ctx->app_verify_callback(&ctx)
+ has been changed into
+ i=s->ctx->app_verify_callback(&ctx, s->ctx->app_verify_arg).
+
+ To update applications using SSL_CTX_set_cert_verify_callback(),
+ a dummy argument can be added to their callback functions.
+ [D. K. Smetters <smetters@parc.xerox.com>]
+
+ *) Added the '4758cca' ENGINE to support IBM 4758 cards.
+ [Maurice Gittens <maurice@gittens.nl>, touchups by Geoff Thorpe]
+
+ *) Add and OPENSSL_LOAD_CONF define which will cause
+ OpenSSL_add_all_algorithms() to load the openssl.cnf config file.
+ This allows older applications to transparently support certain
+ OpenSSL features: such as crypto acceleration and dynamic ENGINE loading.
+ Two new functions OPENSSL_add_all_algorithms_noconf() which will never
+ load the config file and OPENSSL_add_all_algorithms_conf() which will
+ always load it have also been added.
+ [Steve Henson]
+
+ *) Add the OFB, CFB and CTR (all with 128 bit feedback) to AES.
+ Adjust NIDs and EVP layer.
+ [Stephen Sprunk <stephen@sprunk.org> and Richard Levitte]
+
+ *) Config modules support in openssl utility.
+
+ Most commands now load modules from the config file,
+ though in a few (such as version) this isn't done
+ because it couldn't be used for anything.
+
+ In the case of ca and req the config file used is
+ the same as the utility itself: that is the -config
+ command line option can be used to specify an
+ alternative file.
+ [Steve Henson]
+
+ *) Move default behaviour from OPENSSL_config(). If appname is NULL
+ use "openssl_conf" if filename is NULL use default openssl config file.
+ [Steve Henson]
+
+ *) Add an argument to OPENSSL_config() to allow the use of an alternative
+ config section name. Add a new flag to tolerate a missing config file
+ and move code to CONF_modules_load_file().
+ [Steve Henson]
+
+ *) Support for crypto accelerator cards from Accelerated Encryption
+ Processing, www.aep.ie. (Use engine 'aep')
+ The support was copied from 0.9.6c [engine] and adapted/corrected
+ to work with the new engine framework.
+ [AEP Inc. and Richard Levitte]
+
+ *) Support for SureWare crypto accelerator cards from Baltimore
+ Technologies. (Use engine 'sureware')
+ The support was copied from 0.9.6c [engine] and adapted
+ to work with the new engine framework.
+ [Richard Levitte]
+
+ *) Have the CHIL engine fork-safe (as defined by nCipher) and actually
+ make the newer ENGINE framework commands for the CHIL engine work.
+ [Toomas Kiisk <vix@cyber.ee> and Richard Levitte]
+
+ *) Make it possible to produce shared libraries on ReliantUNIX.
+ [Robert Dahlem <Robert.Dahlem@ffm2.siemens.de> via Richard Levitte]
+
+ *) Add the configuration target debug-linux-ppro.
+ Make 'openssl rsa' use the general key loading routines
+ implemented in apps.c, and make those routines able to
+ handle the key format FORMAT_NETSCAPE and the variant
+ FORMAT_IISSGC.
+ [Toomas Kiisk <vix@cyber.ee> via Richard Levitte]
+
+ *) Fix a crashbug and a logic bug in hwcrhk_load_pubkey().
+ [Toomas Kiisk <vix@cyber.ee> via Richard Levitte]
+
+ *) Add -keyform to rsautl, and document -engine.
+ [Richard Levitte, inspired by Toomas Kiisk <vix@cyber.ee>]
+
+ *) Change BIO_new_file (crypto/bio/bss_file.c) to use new
+ BIO_R_NO_SUCH_FILE error code rather than the generic
+ ERR_R_SYS_LIB error code if fopen() fails with ENOENT.
+ [Ben Laurie]
+
+ *) Add new functions
+ ERR_peek_last_error
+ ERR_peek_last_error_line
+ ERR_peek_last_error_line_data.
+ These are similar to
+ ERR_peek_error
+ ERR_peek_error_line
+ ERR_peek_error_line_data,
+ but report on the latest error recorded rather than the first one
+ still in the error queue.
+ [Ben Laurie, Bodo Moeller]
+
+ *) default_algorithms option in ENGINE config module. This allows things
+ like:
+ default_algorithms = ALL
+ default_algorithms = RSA, DSA, RAND, CIPHERS, DIGESTS
+ [Steve Henson]
+
+ *) Preliminary ENGINE config module.
+ [Steve Henson]
+
+ *) New experimental application configuration code.
+ [Steve Henson]
+
+ *) Change the AES code to follow the same name structure as all other
+ symmetric ciphers, and behave the same way. Move everything to
+ the directory crypto/aes, thereby obsoleting crypto/rijndael.
+ [Stephen Sprunk <stephen@sprunk.org> and Richard Levitte]
+
+ *) SECURITY: remove unsafe setjmp/signal interaction from ui_openssl.c.
+ [Ben Laurie and Theo de Raadt]
+
+ *) Add option to output public keys in req command.
+ [Massimiliano Pala madwolf@openca.org]
+
+ *) Use wNAFs in EC_POINTs_mul() for improved efficiency
+ (up to about 10% better than before for P-192 and P-224).
+ [Bodo Moeller]
+
+ *) New functions/macros
+
+ SSL_CTX_set_msg_callback(ctx, cb)
+ SSL_CTX_set_msg_callback_arg(ctx, arg)
+ SSL_set_msg_callback(ssl, cb)
+ SSL_set_msg_callback_arg(ssl, arg)
+
+ to request calling a callback function
+
+ void cb(int write_p, int version, int content_type,
+ const void *buf, size_t len, SSL *ssl, void *arg)
+
+ whenever a protocol message has been completely received
+ (write_p == 0) or sent (write_p == 1). Here 'version' is the
+ protocol version according to which the SSL library interprets
+ the current protocol message (SSL2_VERSION, SSL3_VERSION, or
+ TLS1_VERSION). 'content_type' is 0 in the case of SSL 2.0, or
+ the content type as defined in the SSL 3.0/TLS 1.0 protocol
+ specification (change_cipher_spec(20), alert(21), handshake(22)).
+ 'buf' and 'len' point to the actual message, 'ssl' to the
+ SSL object, and 'arg' is the application-defined value set by
+ SSL[_CTX]_set_msg_callback_arg().
+
+ 'openssl s_client' and 'openssl s_server' have new '-msg' options
+ to enable a callback that displays all protocol messages.
+ [Bodo Moeller]
+
+ *) Change the shared library support so shared libraries are built as
+ soon as the corresponding static library is finished, and thereby get
+ openssl and the test programs linked against the shared library.
+ This still only happens when the keyword "shard" has been given to
+ the configuration scripts.
+
+ NOTE: shared library support is still an experimental thing, and
+ backward binary compatibility is still not guaranteed.
+ ["Maciej W. Rozycki" <macro@ds2.pg.gda.pl> and Richard Levitte]
+
+ *) Add support for Subject Information Access extension.
+ [Peter Sylvester <Peter.Sylvester@EdelWeb.fr>]
+
+ *) Make BUF_MEM_grow() behaviour more consistent: Initialise to zero
+ additional bytes when new memory had to be allocated, not just
+ when reusing an existing buffer.
+ [Bodo Moeller]
+
+ *) New command line and configuration option 'utf8' for the req command.
+ This allows field values to be specified as UTF8 strings.
+ [Steve Henson]
+
+ *) Add -multi and -mr options to "openssl speed" - giving multiple parallel
+ runs for the former and machine-readable output for the latter.
+ [Ben Laurie]
+
+ *) Add '-noemailDN' option to 'openssl ca'. This prevents inclusion
+ of the e-mail address in the DN (i.e., it will go into a certificate
+ extension only). The new configuration file option 'email_in_dn = no'
+ has the same effect.
+ [Massimiliano Pala madwolf@openca.org]
+
+ *) Change all functions with names starting with des_ to be starting
+ with DES_ instead. Add wrappers that are compatible with libdes,
+ but are named _ossl_old_des_*. Finally, add macros that map the
+ des_* symbols to the corresponding _ossl_old_des_* if libdes
+ compatibility is desired. If OpenSSL 0.9.6c compatibility is
+ desired, the des_* symbols will be mapped to DES_*, with one
+ exception.
+
+ Since we provide two compatibility mappings, the user needs to
+ define the macro OPENSSL_DES_LIBDES_COMPATIBILITY if libdes
+ compatibility is desired. The default (i.e., when that macro
+ isn't defined) is OpenSSL 0.9.6c compatibility.
+
+ There are also macros that enable and disable the support of old
+ des functions altogether. Those are OPENSSL_ENABLE_OLD_DES_SUPPORT
+ and OPENSSL_DISABLE_OLD_DES_SUPPORT. If none or both of those
+ are defined, the default will apply: to support the old des routines.
+
+ In either case, one must include openssl/des.h to get the correct
+ definitions. Do not try to just include openssl/des_old.h, that
+ won't work.
+
+ NOTE: This is a major break of an old API into a new one. Software
+ authors are encouraged to switch to the DES_ style functions. Some
+ time in the future, des_old.h and the libdes compatibility functions
+ will be disable (i.e. OPENSSL_DISABLE_OLD_DES_SUPPORT will be the
+ default), and then completely removed.
+ [Richard Levitte]
+
+ *) Test for certificates which contain unsupported critical extensions.
+ If such a certificate is found during a verify operation it is
+ rejected by default: this behaviour can be overridden by either
+ handling the new error X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION or
+ by setting the verify flag X509_V_FLAG_IGNORE_CRITICAL. A new function
+ X509_supported_extension() has also been added which returns 1 if a
+ particular extension is supported.
+ [Steve Henson]
+
+ *) Modify the behaviour of EVP cipher functions in similar way to digests
+ to retain compatibility with existing code.
+ [Steve Henson]
+
+ *) Modify the behaviour of EVP_DigestInit() and EVP_DigestFinal() to retain
+ compatibility with existing code. In particular the 'ctx' parameter does
+ not have to be to be initialized before the call to EVP_DigestInit() and
+ it is tidied up after a call to EVP_DigestFinal(). New function
+ EVP_DigestFinal_ex() which does not tidy up the ctx. Similarly function
+ EVP_MD_CTX_copy() changed to not require the destination to be
+ initialized valid and new function EVP_MD_CTX_copy_ex() added which
+ requires the destination to be valid.
+
+ Modify all the OpenSSL digest calls to use EVP_DigestInit_ex(),
+ EVP_DigestFinal_ex() and EVP_MD_CTX_copy_ex().
+ [Steve Henson]
+
+ *) Change ssl3_get_message (ssl/s3_both.c) and the functions using it
+ so that complete 'Handshake' protocol structures are kept in memory
+ instead of overwriting 'msg_type' and 'length' with 'body' data.
+ [Bodo Moeller]
+
+ *) Add an implementation of SSL_add_dir_cert_subjects_to_stack for Win32.
+ [Massimo Santin via Richard Levitte]
+
+ *) Major restructuring to the underlying ENGINE code. This includes
+ reduction of linker bloat, separation of pure "ENGINE" manipulation
+ (initialisation, etc) from functionality dealing with implementations
+ of specific crypto iterfaces. This change also introduces integrated
+ support for symmetric ciphers and digest implementations - so ENGINEs
+ can now accelerate these by providing EVP_CIPHER and EVP_MD
+ implementations of their own. This is detailed in crypto/engine/README
+ as it couldn't be adequately described here. However, there are a few
+ API changes worth noting - some RSA, DSA, DH, and RAND functions that
+ were changed in the original introduction of ENGINE code have now
+ reverted back - the hooking from this code to ENGINE is now a good
+ deal more passive and at run-time, operations deal directly with
+ RSA_METHODs, DSA_METHODs (etc) as they did before, rather than
+ dereferencing through an ENGINE pointer any more. Also, the ENGINE
+ functions dealing with BN_MOD_EXP[_CRT] handlers have been removed -
+ they were not being used by the framework as there is no concept of a
+ BIGNUM_METHOD and they could not be generalised to the new
+ 'ENGINE_TABLE' mechanism that underlies the new code. Similarly,
+ ENGINE_cpy() has been removed as it cannot be consistently defined in
+ the new code.
+ [Geoff Thorpe]
+
+ *) Change ASN1_GENERALIZEDTIME_check() to allow fractional seconds.
+ [Steve Henson]
+
+ *) Change mkdef.pl to sort symbols that get the same entry number,
+ and make sure the automatically generated functions ERR_load_*
+ become part of libeay.num as well.
+ [Richard Levitte]
+
+ *) New function SSL_renegotiate_pending(). This returns true once
+ renegotiation has been requested (either SSL_renegotiate() call
+ or HelloRequest/ClientHello received from the peer) and becomes
+ false once a handshake has been completed.
+ (For servers, SSL_renegotiate() followed by SSL_do_handshake()
+ sends a HelloRequest, but does not ensure that a handshake takes
+ place. SSL_renegotiate_pending() is useful for checking if the
+ client has followed the request.)
+ [Bodo Moeller]
+
+ *) New SSL option SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION.
+ By default, clients may request session resumption even during
+ renegotiation (if session ID contexts permit); with this option,
+ session resumption is possible only in the first handshake.
+
+ SSL_OP_ALL is now 0x00000FFFL instead of 0x000FFFFFL. This makes
+ more bits available for options that should not be part of
+ SSL_OP_ALL (such as SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION).
+ [Bodo Moeller]
+
+ *) Add some demos for certificate and certificate request creation.
+ [Steve Henson]
+
+ *) Make maximum certificate chain size accepted from the peer application
+ settable (SSL*_get/set_max_cert_list()), as proposed by
+ "Douglas E. Engert" <deengert@anl.gov>.
+ [Lutz Jaenicke]
+
+ *) Add support for shared libraries for Unixware-7
+ (Boyd Lynn Gerber <gerberb@zenez.com>).
+ [Lutz Jaenicke]
+
+ *) Add a "destroy" handler to ENGINEs that allows structural cleanup to
+ be done prior to destruction. Use this to unload error strings from
+ ENGINEs that load their own error strings. NB: This adds two new API
+ functions to "get" and "set" this destroy handler in an ENGINE.
+ [Geoff Thorpe]
+
+ *) Alter all existing ENGINE implementations (except "openssl" and
+ "openbsd") to dynamically instantiate their own error strings. This
+ makes them more flexible to be built both as statically-linked ENGINEs
+ and self-contained shared-libraries loadable via the "dynamic" ENGINE.
+ Also, add stub code to each that makes building them as self-contained
+ shared-libraries easier (see README.ENGINE).
+ [Geoff Thorpe]
+
+ *) Add a "dynamic" ENGINE that provides a mechanism for binding ENGINE
+ implementations into applications that are completely implemented in
+ self-contained shared-libraries. The "dynamic" ENGINE exposes control
+ commands that can be used to configure what shared-library to load and
+ to control aspects of the way it is handled. Also, made an update to
+ the README.ENGINE file that brings its information up-to-date and
+ provides some information and instructions on the "dynamic" ENGINE
+ (ie. how to use it, how to build "dynamic"-loadable ENGINEs, etc).
+ [Geoff Thorpe]
+
+ *) Make it possible to unload ranges of ERR strings with a new
+ "ERR_unload_strings" function.
+ [Geoff Thorpe]
+
+ *) Add a copy() function to EVP_MD.
+ [Ben Laurie]
+
+ *) Make EVP_MD routines take a context pointer instead of just the
+ md_data void pointer.
+ [Ben Laurie]
+
+ *) Add flags to EVP_MD and EVP_MD_CTX. EVP_MD_FLAG_ONESHOT indicates
+ that the digest can only process a single chunk of data
+ (typically because it is provided by a piece of
+ hardware). EVP_MD_CTX_FLAG_ONESHOT indicates that the application
+ is only going to provide a single chunk of data, and hence the
+ framework needn't accumulate the data for oneshot drivers.
+ [Ben Laurie]
+
+ *) As with "ERR", make it possible to replace the underlying "ex_data"
+ functions. This change also alters the storage and management of global
+ ex_data state - it's now all inside ex_data.c and all "class" code (eg.
+ RSA, BIO, SSL_CTX, etc) no longer stores its own STACKS and per-class
+ index counters. The API functions that use this state have been changed
+ to take a "class_index" rather than pointers to the class's local STACK
+ and counter, and there is now an API function to dynamically create new
+ classes. This centralisation allows us to (a) plug a lot of the
+ thread-safety problems that existed, and (b) makes it possible to clean
+ up all allocated state using "CRYPTO_cleanup_all_ex_data()". W.r.t. (b)
+ such data would previously have always leaked in application code and
+ workarounds were in place to make the memory debugging turn a blind eye
+ to it. Application code that doesn't use this new function will still
+ leak as before, but their memory debugging output will announce it now
+ rather than letting it slide.
+
+ Besides the addition of CRYPTO_cleanup_all_ex_data(), another API change
+ induced by the "ex_data" overhaul is that X509_STORE_CTX_init() now
+ has a return value to indicate success or failure.
+ [Geoff Thorpe]
+
+ *) Make it possible to replace the underlying "ERR" functions such that the
+ global state (2 LHASH tables and 2 locks) is only used by the "default"
+ implementation. This change also adds two functions to "get" and "set"
+ the implementation prior to it being automatically set the first time
+ any other ERR function takes place. Ie. an application can call "get",
+ pass the return value to a module it has just loaded, and that module
+ can call its own "set" function using that value. This means the
+ module's "ERR" operations will use (and modify) the error state in the
+ application and not in its own statically linked copy of OpenSSL code.
+ [Geoff Thorpe]
+
+ *) Give DH, DSA, and RSA types their own "**_up_ref()" function to increment
+ reference counts. This performs normal REF_PRINT/REF_CHECK macros on
+ the operation, and provides a more encapsulated way for external code
+ (crypto/evp/ and ssl/) to do this. Also changed the evp and ssl code
+ to use these functions rather than manually incrementing the counts.
+
+ Also rename "DSO_up()" function to more descriptive "DSO_up_ref()".
+ [Geoff Thorpe]
+
+ *) Add EVP test program.
+ [Ben Laurie]
+
+ *) Add symmetric cipher support to ENGINE. Expect the API to change!
+ [Ben Laurie]
+
+ *) New CRL functions: X509_CRL_set_version(), X509_CRL_set_issuer_name()
+ X509_CRL_set_lastUpdate(), X509_CRL_set_nextUpdate(), X509_CRL_sort(),
+ X509_REVOKED_set_serialNumber(), and X509_REVOKED_set_revocationDate().
+ These allow a CRL to be built without having to access X509_CRL fields
+ directly. Modify 'ca' application to use new functions.
+ [Steve Henson]
+
+ *) Move SSL_OP_TLS_ROLLBACK_BUG out of the SSL_OP_ALL list of recommended
+ bug workarounds. Rollback attack detection is a security feature.
+ The problem will only arise on OpenSSL servers when TLSv1 is not
+ available (sslv3_server_method() or SSL_OP_NO_TLSv1).
+ Software authors not wanting to support TLSv1 will have special reasons
+ for their choice and can explicitly enable this option.
+ [Bodo Moeller, Lutz Jaenicke]
+
+ *) Rationalise EVP so it can be extended: don't include a union of
+ cipher/digest structures, add init/cleanup functions for EVP_MD_CTX
+ (similar to those existing for EVP_CIPHER_CTX).
+ Usage example:
+
+ EVP_MD_CTX md;
+
+ EVP_MD_CTX_init(&md); /* new function call */
+ EVP_DigestInit(&md, EVP_sha1());
+ EVP_DigestUpdate(&md, in, len);
+ EVP_DigestFinal(&md, out, NULL);
+ EVP_MD_CTX_cleanup(&md); /* new function call */
+
+ [Ben Laurie]
+
+ *) Make DES key schedule conform to the usual scheme, as well as
+ correcting its structure. This means that calls to DES functions
+ now have to pass a pointer to a des_key_schedule instead of a
+ plain des_key_schedule (which was actually always a pointer
+ anyway): E.g.,
+
+ des_key_schedule ks;
+
+ des_set_key_checked(..., &ks);
+ des_ncbc_encrypt(..., &ks, ...);
+
+ (Note that a later change renames 'des_...' into 'DES_...'.)
+ [Ben Laurie]
+
+ *) Initial reduction of linker bloat: the use of some functions, such as
+ PEM causes large amounts of unused functions to be linked in due to
+ poor organisation. For example pem_all.c contains every PEM function
+ which has a knock on effect of linking in large amounts of (unused)
+ ASN1 code. Grouping together similar functions and splitting unrelated
+ functions prevents this.
+ [Steve Henson]
+
+ *) Cleanup of EVP macros.
+ [Ben Laurie]
+
+ *) Change historical references to {NID,SN,LN}_des_ede and ede3 to add the
+ correct _ecb suffix.
+ [Ben Laurie]
+
+ *) Add initial OCSP responder support to ocsp application. The
+ revocation information is handled using the text based index
+ use by the ca application. The responder can either handle
+ requests generated internally, supplied in files (for example
+ via a CGI script) or using an internal minimal server.
+ [Steve Henson]
+
+ *) Add configuration choices to get zlib compression for TLS.
+ [Richard Levitte]
+
+ *) Changes to Kerberos SSL for RFC 2712 compliance:
+ 1. Implemented real KerberosWrapper, instead of just using
+ KRB5 AP_REQ message. [Thanks to Simon Wilkinson <sxw@sxw.org.uk>]
+ 2. Implemented optional authenticator field of KerberosWrapper.
+
+ Added openssl-style ASN.1 macros for Kerberos ticket, ap_req,
+ and authenticator structs; see crypto/krb5/.
+
+ Generalized Kerberos calls to support multiple Kerberos libraries.
+ [Vern Staats <staatsvr@asc.hpc.mil>,
+ Jeffrey Altman <jaltman@columbia.edu>
+ via Richard Levitte]
+
+ *) Cause 'openssl speed' to use fully hard-coded DSA keys as it
+ already does with RSA. testdsa.h now has 'priv_key/pub_key'
+ values for each of the key sizes rather than having just
+ parameters (and 'speed' generating keys each time).
+ [Geoff Thorpe]
+
+ *) Speed up EVP routines.
+ Before:
+encrypt
+type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes
+des-cbc 4408.85k 5560.51k 5778.46k 5862.20k 5825.16k
+des-cbc 4389.55k 5571.17k 5792.23k 5846.91k 5832.11k
+des-cbc 4394.32k 5575.92k 5807.44k 5848.37k 5841.30k
+decrypt
+des-cbc 3482.66k 5069.49k 5496.39k 5614.16k 5639.28k
+des-cbc 3480.74k 5068.76k 5510.34k 5609.87k 5635.52k
+des-cbc 3483.72k 5067.62k 5504.60k 5708.01k 5724.80k
+ After:
+encrypt
+des-cbc 4660.16k 5650.19k 5807.19k 5827.13k 5783.32k
+decrypt
+des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
+ [Ben Laurie]
+
+ *) Added the OS2-EMX target.
+ ["Brian Havard" <brianh@kheldar.apana.org.au> and Richard Levitte]
+
+ *) Rewrite apps to use NCONF routines instead of the old CONF. New functions
+ to support NCONF routines in extension code. New function CONF_set_nconf()
+ to allow functions which take an NCONF to also handle the old LHASH
+ structure: this means that the old CONF compatible routines can be
+ retained (in particular wrt extensions) without having to duplicate the
+ code. New function X509V3_add_ext_nconf_sk to add extensions to a stack.
+ [Steve Henson]
+
+ *) Enhance the general user interface with mechanisms for inner control
+ and with possibilities to have yes/no kind of prompts.
+ [Richard Levitte]
+
+ *) Change all calls to low level digest routines in the library and
+ applications to use EVP. Add missing calls to HMAC_cleanup() and
+ don't assume HMAC_CTX can be copied using memcpy().
+ [Verdon Walker <VWalker@novell.com>, Steve Henson]
+
+ *) Add the possibility to control engines through control names but with
+ arbitrary arguments instead of just a string.
+ Change the key loaders to take a UI_METHOD instead of a callback
+ function pointer. NOTE: this breaks binary compatibility with earlier
+ versions of OpenSSL [engine].
+ Adapt the nCipher code for these new conditions and add a card insertion
+ callback.
+ [Richard Levitte]
+
+ *) Enhance the general user interface with mechanisms to better support
+ dialog box interfaces, application-defined prompts, the possibility
+ to use defaults (for example default passwords from somewhere else)
+ and interrupts/cancellations.
+ [Richard Levitte]
+
+ *) Tidy up PKCS#12 attribute handling. Add support for the CSP name
+ attribute in PKCS#12 files, add new -CSP option to pkcs12 utility.
+ [Steve Henson]
+
+ *) Fix a memory leak in 'sk_dup()' in the case reallocation fails. (Also
+ tidy up some unnecessarily weird code in 'sk_new()').
+ [Geoff, reported by Diego Tartara <dtartara@novamens.com>]
+
+ *) Change the key loading routines for ENGINEs to use the same kind
+ callback (pem_password_cb) as all other routines that need this
+ kind of callback.
+ [Richard Levitte]
+
+ *) Increase ENTROPY_NEEDED to 32 bytes, as Rijndael can operate with
+ 256 bit (=32 byte) keys. Of course seeding with more entropy bytes
+ than this minimum value is recommended.
+ [Lutz Jaenicke]
+
+ *) New random seeder for OpenVMS, using the system process statistics
+ that are easily reachable.
+ [Richard Levitte]
+
+ *) Windows apparently can't transparently handle global
+ variables defined in DLLs. Initialisations such as:
+
+ const ASN1_ITEM *it = &ASN1_INTEGER_it;
+
+ won't compile. This is used by the any applications that need to
+ declare their own ASN1 modules. This was fixed by adding the option
+ EXPORT_VAR_AS_FN to all Win32 platforms, although this isn't strictly
+ needed for static libraries under Win32.
+ [Steve Henson]
+
+ *) New functions X509_PURPOSE_set() and X509_TRUST_set() to handle
+ setting of purpose and trust fields. New X509_STORE trust and
+ purpose functions and tidy up setting in other SSL functions.
+ [Steve Henson]
+
+ *) Add copies of X509_STORE_CTX fields and callbacks to X509_STORE
+ structure. These are inherited by X509_STORE_CTX when it is
+ initialised. This allows various defaults to be set in the
+ X509_STORE structure (such as flags for CRL checking and custom
+ purpose or trust settings) for functions which only use X509_STORE_CTX
+ internally such as S/MIME.
+
+ Modify X509_STORE_CTX_purpose_inherit() so it only sets purposes and
+ trust settings if they are not set in X509_STORE. This allows X509_STORE
+ purposes and trust (in S/MIME for example) to override any set by default.
+
+ Add command line options for CRL checking to smime, s_client and s_server
+ applications.
+ [Steve Henson]
+
+ *) Initial CRL based revocation checking. If the CRL checking flag(s)
+ are set then the CRL is looked up in the X509_STORE structure and
+ its validity and signature checked, then if the certificate is found
+ in the CRL the verify fails with a revoked error.
+
+ Various new CRL related callbacks added to X509_STORE_CTX structure.
+
+ Command line options added to 'verify' application to support this.
+
+ This needs some additional work, such as being able to handle multiple
+ CRLs with different times, extension based lookup (rather than just
+ by subject name) and ultimately more complete V2 CRL extension
+ handling.
+ [Steve Henson]
+
+ *) Add a general user interface API (crypto/ui/). This is designed
+ to replace things like des_read_password and friends (backward
+ compatibility functions using this new API are provided).
+ The purpose is to remove prompting functions from the DES code
+ section as well as provide for prompting through dialog boxes in
+ a window system and the like.
+ [Richard Levitte]
+
+ *) Add "ex_data" support to ENGINE so implementations can add state at a
+ per-structure level rather than having to store it globally.
+ [Geoff]
+
+ *) Make it possible for ENGINE structures to be copied when retrieved by
+ ENGINE_by_id() if the ENGINE specifies a new flag: ENGINE_FLAGS_BY_ID_COPY.
+ This causes the "original" ENGINE structure to act like a template,
+ analogous to the RSA vs. RSA_METHOD type of separation. Because of this
+ operational state can be localised to each ENGINE structure, despite the
+ fact they all share the same "methods". New ENGINE structures returned in
+ this case have no functional references and the return value is the single
+ structural reference. This matches the single structural reference returned
+ by ENGINE_by_id() normally, when it is incremented on the pre-existing
+ ENGINE structure.
+ [Geoff]
+
+ *) Fix ASN1 decoder when decoding type ANY and V_ASN1_OTHER: since this
+ needs to match any other type at all we need to manually clear the
+ tag cache.
+ [Steve Henson]
+
+ *) Changes to the "openssl engine" utility to include;
+ - verbosity levels ('-v', '-vv', and '-vvv') that provide information
+ about an ENGINE's available control commands.
+ - executing control commands from command line arguments using the
+ '-pre' and '-post' switches. '-post' is only used if '-t' is
+ specified and the ENGINE is successfully initialised. The syntax for
+ the individual commands are colon-separated, for example;
+ openssl engine chil -pre FORK_CHECK:0 -pre SO_PATH:/lib/test.so
+ [Geoff]
+
+ *) New dynamic control command support for ENGINEs. ENGINEs can now
+ declare their own commands (numbers), names (strings), descriptions,
+ and input types for run-time discovery by calling applications. A
+ subset of these commands are implicitly classed as "executable"
+ depending on their input type, and only these can be invoked through
+ the new string-based API function ENGINE_ctrl_cmd_string(). (Eg. this
+ can be based on user input, config files, etc). The distinction is
+ that "executable" commands cannot return anything other than a boolean
+ result and can only support numeric or string input, whereas some
+ discoverable commands may only be for direct use through
+ ENGINE_ctrl(), eg. supporting the exchange of binary data, function
+ pointers, or other custom uses. The "executable" commands are to
+ support parameterisations of ENGINE behaviour that can be
+ unambiguously defined by ENGINEs and used consistently across any
+ OpenSSL-based application. Commands have been added to all the
+ existing hardware-supporting ENGINEs, noticeably "SO_PATH" to allow
+ control over shared-library paths without source code alterations.
+ [Geoff]
+
+ *) Changed all ENGINE implementations to dynamically allocate their
+ ENGINEs rather than declaring them statically. Apart from this being
+ necessary with the removal of the ENGINE_FLAGS_MALLOCED distinction,
+ this also allows the implementations to compile without using the
+ internal engine_int.h header.
+ [Geoff]
+
+ *) Minor adjustment to "rand" code. RAND_get_rand_method() now returns a
+ 'const' value. Any code that should be able to modify a RAND_METHOD
+ should already have non-const pointers to it (ie. they should only
+ modify their own ones).
+ [Geoff]
+
+ *) Made a variety of little tweaks to the ENGINE code.
+ - "atalla" and "ubsec" string definitions were moved from header files
+ to C code. "nuron" string definitions were placed in variables
+ rather than hard-coded - allowing parameterisation of these values
+ later on via ctrl() commands.
+ - Removed unused "#if 0"'d code.
+ - Fixed engine list iteration code so it uses ENGINE_free() to release
+ structural references.
+ - Constified the RAND_METHOD element of ENGINE structures.
+ - Constified various get/set functions as appropriate and added
+ missing functions (including a catch-all ENGINE_cpy that duplicates
+ all ENGINE values onto a new ENGINE except reference counts/state).
+ - Removed NULL parameter checks in get/set functions. Setting a method
+ or function to NULL is a way of cancelling out a previously set
+ value. Passing a NULL ENGINE parameter is just plain stupid anyway
+ and doesn't justify the extra error symbols and code.
+ - Deprecate the ENGINE_FLAGS_MALLOCED define and move the area for
+ flags from engine_int.h to engine.h.
+ - Changed prototypes for ENGINE handler functions (init(), finish(),
+ ctrl(), key-load functions, etc) to take an (ENGINE*) parameter.
+ [Geoff]
+
+ *) Implement binary inversion algorithm for BN_mod_inverse in addition
+ to the algorithm using long division. The binary algorithm can be
+ used only if the modulus is odd. On 32-bit systems, it is faster
+ only for relatively small moduli (roughly 20-30% for 128-bit moduli,
+ roughly 5-15% for 256-bit moduli), so we use it only for moduli
+ up to 450 bits. In 64-bit environments, the binary algorithm
+ appears to be advantageous for much longer moduli; here we use it
+ for moduli up to 2048 bits.
+ [Bodo Moeller]
+
+ *) Rewrite CHOICE field setting in ASN1_item_ex_d2i(). The old code
+ could not support the combine flag in choice fields.
+ [Steve Henson]
+
+ *) Add a 'copy_extensions' option to the 'ca' utility. This copies
+ extensions from a certificate request to the certificate.
+ [Steve Henson]
+
+ *) Allow multiple 'certopt' and 'nameopt' options to be separated
+ by commas. Add 'namopt' and 'certopt' options to the 'ca' config
+ file: this allows the display of the certificate about to be
+ signed to be customised, to allow certain fields to be included
+ or excluded and extension details. The old system didn't display
+ multicharacter strings properly, omitted fields not in the policy
+ and couldn't display additional details such as extensions.
+ [Steve Henson]
+
+ *) Function EC_POINTs_mul for multiple scalar multiplication
+ of an arbitrary number of elliptic curve points
+ \sum scalars[i]*points[i],
+ optionally including the generator defined for the EC_GROUP:
+ scalar*generator + \sum scalars[i]*points[i].
+
+ EC_POINT_mul is a simple wrapper function for the typical case
+ that the point list has just one item (besides the optional
+ generator).
+ [Bodo Moeller]
+
+ *) First EC_METHODs for curves over GF(p):
+
+ EC_GFp_simple_method() uses the basic BN_mod_mul and BN_mod_sqr
+ operations and provides various method functions that can also
+ operate with faster implementations of modular arithmetic.
+
+ EC_GFp_mont_method() reuses most functions that are part of
+ EC_GFp_simple_method, but uses Montgomery arithmetic.
+
+ [Bodo Moeller; point addition and point doubling
+ implementation directly derived from source code provided by
+ Lenka Fibikova <fibikova@exp-math.uni-essen.de>]
+
+ *) Framework for elliptic curves (crypto/ec/ec.h, crypto/ec/ec_lcl.h,
+ crypto/ec/ec_lib.c):
+
+ Curves are EC_GROUP objects (with an optional group generator)
+ based on EC_METHODs that are built into the library.
+
+ Points are EC_POINT objects based on EC_GROUP objects.
+
+ Most of the framework would be able to handle curves over arbitrary
+ finite fields, but as there are no obvious types for fields other
+ than GF(p), some functions are limited to that for now.
+ [Bodo Moeller]
+
+ *) Add the -HTTP option to s_server. It is similar to -WWW, but requires
+ that the file contains a complete HTTP response.
+ [Richard Levitte]
+
+ *) Add the ec directory to mkdef.pl and mkfiles.pl. In mkdef.pl
+ change the def and num file printf format specifier from "%-40sXXX"
+ to "%-39s XXX". The latter will always guarantee a space after the
+ field while the former will cause them to run together if the field
+ is 40 of more characters long.
+ [Steve Henson]
+
+ *) Constify the cipher and digest 'method' functions and structures
+ and modify related functions to take constant EVP_MD and EVP_CIPHER
+ pointers.
+ [Steve Henson]
+
+ *) Hide BN_CTX structure details in bn_lcl.h instead of publishing them
+ in <openssl/bn.h>. Also further increase BN_CTX_NUM to 32.
+ [Bodo Moeller]
+
+ *) Modify EVP_Digest*() routines so they now return values. Although the
+ internal software routines can never fail additional hardware versions
+ might.
+ [Steve Henson]
+
+ *) Clean up crypto/err/err.h and change some error codes to avoid conflicts:
+
+ Previously ERR_R_FATAL was too small and coincided with ERR_LIB_PKCS7
+ (= ERR_R_PKCS7_LIB); it is now 64 instead of 32.
+
+ ASN1 error codes
+ ERR_R_NESTED_ASN1_ERROR
+ ...
+ ERR_R_MISSING_ASN1_EOS
+ were 4 .. 9, conflicting with
+ ERR_LIB_RSA (= ERR_R_RSA_LIB)
+ ...
+ ERR_LIB_PEM (= ERR_R_PEM_LIB).
+ They are now 58 .. 63 (i.e., just below ERR_R_FATAL).
+
+ Add new error code 'ERR_R_INTERNAL_ERROR'.
+ [Bodo Moeller]
+
+ *) Don't overuse locks in crypto/err/err.c: For data retrieval, CRYPTO_r_lock
+ suffices.
+ [Bodo Moeller]
+
+ *) New option '-subj arg' for 'openssl req' and 'openssl ca'. This
+ sets the subject name for a new request or supersedes the
+ subject name in a given request. Formats that can be parsed are
+ 'CN=Some Name, OU=myOU, C=IT'
+ and
+ 'CN=Some Name/OU=myOU/C=IT'.
+
+ Add options '-batch' and '-verbose' to 'openssl req'.
+ [Massimiliano Pala <madwolf@hackmasters.net>]
+
+ *) Introduce the possibility to access global variables through
+ functions on platform were that's the best way to handle exporting
+ global variables in shared libraries. To enable this functionality,
+ one must configure with "EXPORT_VAR_AS_FN" or defined the C macro
+ "OPENSSL_EXPORT_VAR_AS_FUNCTION" in crypto/opensslconf.h (the latter
+ is normally done by Configure or something similar).
+
+ To implement a global variable, use the macro OPENSSL_IMPLEMENT_GLOBAL
+ in the source file (foo.c) like this:
+
+ OPENSSL_IMPLEMENT_GLOBAL(int,foo)=1;
+ OPENSSL_IMPLEMENT_GLOBAL(double,bar);
+
+ To declare a global variable, use the macros OPENSSL_DECLARE_GLOBAL
+ and OPENSSL_GLOBAL_REF in the header file (foo.h) like this:
+
+ OPENSSL_DECLARE_GLOBAL(int,foo);
+ #define foo OPENSSL_GLOBAL_REF(foo)
+ OPENSSL_DECLARE_GLOBAL(double,bar);
+ #define bar OPENSSL_GLOBAL_REF(bar)
+
+ The #defines are very important, and therefore so is including the
+ header file everywhere where the defined globals are used.
+
+ The macro OPENSSL_EXPORT_VAR_AS_FUNCTION also affects the definition
+ of ASN.1 items, but that structure is a bit different.
+
+ The largest change is in util/mkdef.pl which has been enhanced with
+ better and easier to understand logic to choose which symbols should
+ go into the Windows .def files as well as a number of fixes and code
+ cleanup (among others, algorithm keywords are now sorted
+ lexicographically to avoid constant rewrites).
+ [Richard Levitte]
+
+ *) In BN_div() keep a copy of the sign of 'num' before writing the
+ result to 'rm' because if rm==num the value will be overwritten
+ and produce the wrong result if 'num' is negative: this caused
+ problems with BN_mod() and BN_nnmod().
+ [Steve Henson]
+
+ *) Function OCSP_request_verify(). This checks the signature on an
+ OCSP request and verifies the signer certificate. The signer
+ certificate is just checked for a generic purpose and OCSP request
+ trust settings.
+ [Steve Henson]
+
+ *) Add OCSP_check_validity() function to check the validity of OCSP
+ responses. OCSP responses are prepared in real time and may only
+ be a few seconds old. Simply checking that the current time lies
+ between thisUpdate and nextUpdate max reject otherwise valid responses
+ caused by either OCSP responder or client clock inaccuracy. Instead
+ we allow thisUpdate and nextUpdate to fall within a certain period of
+ the current time. The age of the response can also optionally be
+ checked. Two new options -validity_period and -status_age added to
+ ocsp utility.
+ [Steve Henson]
+
+ *) If signature or public key algorithm is unrecognized print out its
+ OID rather that just UNKNOWN.
+ [Steve Henson]
+
+ *) Change OCSP_cert_to_id() to tolerate a NULL subject certificate and
+ OCSP_cert_id_new() a NULL serialNumber. This allows a partial certificate
+ ID to be generated from the issuer certificate alone which can then be
+ passed to OCSP_id_issuer_cmp().
+ [Steve Henson]
+
+ *) New compilation option ASN1_ITEM_FUNCTIONS. This causes the new
+ ASN1 modules to export functions returning ASN1_ITEM pointers
+ instead of the ASN1_ITEM structures themselves. This adds several
+ new macros which allow the underlying ASN1 function/structure to
+ be accessed transparently. As a result code should not use ASN1_ITEM
+ references directly (such as &X509_it) but instead use the relevant
+ macros (such as ASN1_ITEM_rptr(X509)). This option is to allow
+ use of the new ASN1 code on platforms where exporting structures
+ is problematical (for example in shared libraries) but exporting
+ functions returning pointers to structures is not.
+ [Steve Henson]
+
+ *) Add support for overriding the generation of SSL/TLS session IDs.
+ These callbacks can be registered either in an SSL_CTX or per SSL.
+ The purpose of this is to allow applications to control, if they wish,
+ the arbitrary values chosen for use as session IDs, particularly as it
+ can be useful for session caching in multiple-server environments. A
+ command-line switch for testing this (and any client code that wishes
+ to use such a feature) has been added to "s_server".
+ [Geoff Thorpe, Lutz Jaenicke]
+
+ *) Modify mkdef.pl to recognise and parse preprocessor conditionals
+ of the form '#if defined(...) || defined(...) || ...' and
+ '#if !defined(...) && !defined(...) && ...'. This also avoids
+ the growing number of special cases it was previously handling.
+ [Richard Levitte]
+
+ *) Make all configuration macros available for application by making
+ sure they are available in opensslconf.h, by giving them names starting
+ with "OPENSSL_" to avoid conflicts with other packages and by making
+ sure e_os2.h will cover all platform-specific cases together with
+ opensslconf.h.
+ Additionally, it is now possible to define configuration/platform-
+ specific names (called "system identities"). In the C code, these
+ are prefixed with "OPENSSL_SYSNAME_". e_os2.h will create another
+ macro with the name beginning with "OPENSSL_SYS_", which is determined
+ from "OPENSSL_SYSNAME_*" or compiler-specific macros depending on
+ what is available.
+ [Richard Levitte]
+
+ *) New option -set_serial to 'req' and 'x509' this allows the serial
+ number to use to be specified on the command line. Previously self
+ signed certificates were hard coded with serial number 0 and the
+ CA options of 'x509' had to use a serial number in a file which was
+ auto incremented.
+ [Steve Henson]
+
+ *) New options to 'ca' utility to support V2 CRL entry extensions.
+ Currently CRL reason, invalidity date and hold instruction are
+ supported. Add new CRL extensions to V3 code and some new objects.
+ [Steve Henson]
+
+ *) New function EVP_CIPHER_CTX_set_padding() this is used to
+ disable standard block padding (aka PKCS#5 padding) in the EVP
+ API, which was previously mandatory. This means that the data is
+ not padded in any way and so the total length much be a multiple
+ of the block size, otherwise an error occurs.
+ [Steve Henson]
+
+ *) Initial (incomplete) OCSP SSL support.
+ [Steve Henson]
+
+ *) New function OCSP_parse_url(). This splits up a URL into its host,
+ port and path components: primarily to parse OCSP URLs. New -url
+ option to ocsp utility.
+ [Steve Henson]
+
+ *) New nonce behavior. The return value of OCSP_check_nonce() now
+ reflects the various checks performed. Applications can decide
+ whether to tolerate certain situations such as an absent nonce
+ in a response when one was present in a request: the ocsp application
+ just prints out a warning. New function OCSP_add1_basic_nonce()
+ this is to allow responders to include a nonce in a response even if
+ the request is nonce-less.
+ [Steve Henson]
+
+ *) Disable stdin buffering in load_cert (apps/apps.c) so that no certs are
+ skipped when using openssl x509 multiple times on a single input file,
+ e.g. "(openssl x509 -out cert1; openssl x509 -out cert2) <certs".
+ [Bodo Moeller]
+
+ *) Make ASN1_UTCTIME_set_string() and ASN1_GENERALIZEDTIME_set_string()
+ set string type: to handle setting ASN1_TIME structures. Fix ca
+ utility to correctly initialize revocation date of CRLs.
+ [Steve Henson]
+
+ *) New option SSL_OP_CIPHER_SERVER_PREFERENCE allows the server to override
+ the clients preferred ciphersuites and rather use its own preferences.
+ Should help to work around M$ SGC (Server Gated Cryptography) bug in
+ Internet Explorer by ensuring unchanged hash method during stepup.
+ (Also replaces the broken/deactivated SSL_OP_NON_EXPORT_FIRST option.)
+ [Lutz Jaenicke]
+
+ *) Make mkdef.pl recognise all DECLARE_ASN1 macros, change rijndael
+ to aes and add a new 'exist' option to print out symbols that don't
+ appear to exist.
+ [Steve Henson]
+
+ *) Additional options to ocsp utility to allow flags to be set and
+ additional certificates supplied.
+ [Steve Henson]
+
+ *) Add the option -VAfile to 'openssl ocsp', so the user can give the
+ OCSP client a number of certificate to only verify the response
+ signature against.
+ [Richard Levitte]
+
+ *) Update Rijndael code to version 3.0 and change EVP AES ciphers to
+ handle the new API. Currently only ECB, CBC modes supported. Add new
+ AES OIDs.
+
+ Add TLS AES ciphersuites as described in RFC3268, "Advanced
+ Encryption Standard (AES) Ciphersuites for Transport Layer
+ Security (TLS)". (In beta versions of OpenSSL 0.9.7, these were
+ not enabled by default and were not part of the "ALL" ciphersuite
+ alias because they were not yet official; they could be
+ explicitly requested by specifying the "AESdraft" ciphersuite
+ group alias. In the final release of OpenSSL 0.9.7, the group
+ alias is called "AES" and is part of "ALL".)
+ [Ben Laurie, Steve Henson, Bodo Moeller]
+
+ *) New function OCSP_copy_nonce() to copy nonce value (if present) from
+ request to response.
+ [Steve Henson]
+
+ *) Functions for OCSP responders. OCSP_request_onereq_count(),
+ OCSP_request_onereq_get0(), OCSP_onereq_get0_id() and OCSP_id_get0_info()
+ extract information from a certificate request. OCSP_response_create()
+ creates a response and optionally adds a basic response structure.
+ OCSP_basic_add1_status() adds a complete single response to a basic
+ response and returns the OCSP_SINGLERESP structure just added (to allow
+ extensions to be included for example). OCSP_basic_add1_cert() adds a
+ certificate to a basic response and OCSP_basic_sign() signs a basic
+ response with various flags. New helper functions ASN1_TIME_check()
+ (checks validity of ASN1_TIME structure) and ASN1_TIME_to_generalizedtime()
+ (converts ASN1_TIME to GeneralizedTime).
+ [Steve Henson]
+
+ *) Various new functions. EVP_Digest() combines EVP_Digest{Init,Update,Final}()
+ in a single operation. X509_get0_pubkey_bitstr() extracts the public_key
+ structure from a certificate. X509_pubkey_digest() digests the public_key
+ contents: this is used in various key identifiers.
+ [Steve Henson]
+
+ *) Make sk_sort() tolerate a NULL argument.
+ [Steve Henson reported by Massimiliano Pala <madwolf@comune.modena.it>]
+
+ *) New OCSP verify flag OCSP_TRUSTOTHER. When set the "other" certificates
+ passed by the function are trusted implicitly. If any of them signed the
+ response then it is assumed to be valid and is not verified.
+ [Steve Henson]
+
+ *) In PKCS7_set_type() initialise content_type in PKCS7_ENC_CONTENT
+ to data. This was previously part of the PKCS7 ASN1 code. This
+ was causing problems with OpenSSL created PKCS#12 and PKCS#7 structures.
+ [Steve Henson, reported by Kenneth R. Robinette
+ <support@securenetterm.com>]
+
+ *) Add CRYPTO_push_info() and CRYPTO_pop_info() calls to new ASN1
+ routines: without these tracing memory leaks is very painful.
+ Fix leaks in PKCS12 and PKCS7 routines.
+ [Steve Henson]
+
+ *) Make X509_time_adj() cope with the new behaviour of ASN1_TIME_new().
+ Previously it initialised the 'type' argument to V_ASN1_UTCTIME which
+ effectively meant GeneralizedTime would never be used. Now it
+ is initialised to -1 but X509_time_adj() now has to check the value
+ and use ASN1_TIME_set() if the value is not V_ASN1_UTCTIME or
+ V_ASN1_GENERALIZEDTIME, without this it always uses GeneralizedTime.
+ [Steve Henson, reported by Kenneth R. Robinette
+ <support@securenetterm.com>]
+
+ *) Fixes to BN_to_ASN1_INTEGER when bn is zero. This would previously
+ result in a zero length in the ASN1_INTEGER structure which was
+ not consistent with the structure when d2i_ASN1_INTEGER() was used
+ and would cause ASN1_INTEGER_cmp() to fail. Enhance s2i_ASN1_INTEGER()
+ to cope with hex and negative integers. Fix bug in i2a_ASN1_INTEGER()
+ where it did not print out a minus for negative ASN1_INTEGER.
+ [Steve Henson]
+
+ *) Add summary printout to ocsp utility. The various functions which
+ convert status values to strings have been renamed to:
+ OCSP_response_status_str(), OCSP_cert_status_str() and
+ OCSP_crl_reason_str() and are no longer static. New options
+ to verify nonce values and to disable verification. OCSP response
+ printout format cleaned up.
+ [Steve Henson]
+
+ *) Add additional OCSP certificate checks. These are those specified
+ in RFC2560. This consists of two separate checks: the CA of the
+ certificate being checked must either be the OCSP signer certificate
+ or the issuer of the OCSP signer certificate. In the latter case the
+ OCSP signer certificate must contain the OCSP signing extended key
+ usage. This check is performed by attempting to match the OCSP
+ signer or the OCSP signer CA to the issuerNameHash and issuerKeyHash
+ in the OCSP_CERTID structures of the response.
+ [Steve Henson]
+
+ *) Initial OCSP certificate verification added to OCSP_basic_verify()
+ and related routines. This uses the standard OpenSSL certificate
+ verify routines to perform initial checks (just CA validity) and
+ to obtain the certificate chain. Then additional checks will be
+ performed on the chain. Currently the root CA is checked to see
+ if it is explicitly trusted for OCSP signing. This is used to set
+ a root CA as a global signing root: that is any certificate that
+ chains to that CA is an acceptable OCSP signing certificate.
+ [Steve Henson]
+
+ *) New '-extfile ...' option to 'openssl ca' for reading X.509v3
+ extensions from a separate configuration file.
+ As when reading extensions from the main configuration file,
+ the '-extensions ...' option may be used for specifying the
+ section to use.
+ [Massimiliano Pala <madwolf@comune.modena.it>]
+
+ *) New OCSP utility. Allows OCSP requests to be generated or
+ read. The request can be sent to a responder and the output
+ parsed, outputed or printed in text form. Not complete yet:
+ still needs to check the OCSP response validity.
+ [Steve Henson]
+
+ *) New subcommands for 'openssl ca':
+ 'openssl ca -status <serial>' prints the status of the cert with
+ the given serial number (according to the index file).
+ 'openssl ca -updatedb' updates the expiry status of certificates
+ in the index file.
+ [Massimiliano Pala <madwolf@comune.modena.it>]
+
+ *) New '-newreq-nodes' command option to CA.pl. This is like
+ '-newreq', but calls 'openssl req' with the '-nodes' option
+ so that the resulting key is not encrypted.
+ [Damien Miller <djm@mindrot.org>]
+
+ *) New configuration for the GNU Hurd.
+ [Jonathan Bartlett <johnnyb@wolfram.com> via Richard Levitte]
+
+ *) Initial code to implement OCSP basic response verify. This
+ is currently incomplete. Currently just finds the signer's
+ certificate and verifies the signature on the response.
+ [Steve Henson]
+
+ *) New SSLeay_version code SSLEAY_DIR to determine the compiled-in
+ value of OPENSSLDIR. This is available via the new '-d' option
+ to 'openssl version', and is also included in 'openssl version -a'.
+ [Bodo Moeller]
+
+ *) Allowing defining memory allocation callbacks that will be given
+ file name and line number information in additional arguments
+ (a const char* and an int). The basic functionality remains, as
+ well as the original possibility to just replace malloc(),
+ realloc() and free() by functions that do not know about these
+ additional arguments. To register and find out the current
+ settings for extended allocation functions, the following
+ functions are provided:
+
+ CRYPTO_set_mem_ex_functions
+ CRYPTO_set_locked_mem_ex_functions
+ CRYPTO_get_mem_ex_functions
+ CRYPTO_get_locked_mem_ex_functions
+
+ These work the same way as CRYPTO_set_mem_functions and friends.
+ CRYPTO_get_[locked_]mem_functions now writes 0 where such an
+ extended allocation function is enabled.
+ Similarly, CRYPTO_get_[locked_]mem_ex_functions writes 0 where
+ a conventional allocation function is enabled.
+ [Richard Levitte, Bodo Moeller]
+
+ *) Finish off removing the remaining LHASH function pointer casts.
+ There should no longer be any prototype-casting required when using
+ the LHASH abstraction, and any casts that remain are "bugs". See
+ the callback types and macros at the head of lhash.h for details
+ (and "OBJ_cleanup" in crypto/objects/obj_dat.c as an example).
+ [Geoff Thorpe]
+
+ *) Add automatic query of EGD sockets in RAND_poll() for the unix variant.
+ If /dev/[u]random devices are not available or do not return enough
+ entropy, EGD style sockets (served by EGD or PRNGD) will automatically
+ be queried.
+ The locations /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool, and
+ /etc/entropy will be queried once each in this sequence, querying stops
+ when enough entropy was collected without querying more sockets.
+ [Lutz Jaenicke]
+
+ *) Change the Unix RAND_poll() variant to be able to poll several
+ random devices, as specified by DEVRANDOM, until a sufficient amount
+ of data has been collected. We spend at most 10 ms on each file
+ (select timeout) and read in non-blocking mode. DEVRANDOM now
+ defaults to the list "/dev/urandom", "/dev/random", "/dev/srandom"
+ (previously it was just the string "/dev/urandom"), so on typical
+ platforms the 10 ms delay will never occur.
+ Also separate out the Unix variant to its own file, rand_unix.c.
+ For VMS, there's a currently-empty rand_vms.c.
+ [Richard Levitte]
+
+ *) Move OCSP client related routines to ocsp_cl.c. These
+ provide utility functions which an application needing
+ to issue a request to an OCSP responder and analyse the
+ response will typically need: as opposed to those which an
+ OCSP responder itself would need which will be added later.
+
+ OCSP_request_sign() signs an OCSP request with an API similar
+ to PKCS7_sign(). OCSP_response_status() returns status of OCSP
+ response. OCSP_response_get1_basic() extracts basic response
+ from response. OCSP_resp_find_status(): finds and extracts status
+ information from an OCSP_CERTID structure (which will be created
+ when the request structure is built). These are built from lower
+ level functions which work on OCSP_SINGLERESP structures but
+ won't normally be used unless the application wishes to examine
+ extensions in the OCSP response for example.
+
+ Replace nonce routines with a pair of functions.
+ OCSP_request_add1_nonce() adds a nonce value and optionally
+ generates a random value. OCSP_check_nonce() checks the
+ validity of the nonce in an OCSP response.
+ [Steve Henson]
+
+ *) Change function OCSP_request_add() to OCSP_request_add0_id().
+ This doesn't copy the supplied OCSP_CERTID and avoids the
+ need to free up the newly created id. Change return type
+ to OCSP_ONEREQ to return the internal OCSP_ONEREQ structure.
+ This can then be used to add extensions to the request.
+ Deleted OCSP_request_new(), since most of its functionality
+ is now in OCSP_REQUEST_new() (and the case insensitive name
+ clash) apart from the ability to set the request name which
+ will be added elsewhere.
+ [Steve Henson]
+
+ *) Update OCSP API. Remove obsolete extensions argument from
+ various functions. Extensions are now handled using the new
+ OCSP extension code. New simple OCSP HTTP function which
+ can be used to send requests and parse the response.
+ [Steve Henson]
+
+ *) Fix the PKCS#7 (S/MIME) code to work with new ASN1. Two new
+ ASN1_ITEM structures help with sign and verify. PKCS7_ATTR_SIGN
+ uses the special reorder version of SET OF to sort the attributes
+ and reorder them to match the encoded order. This resolves a long
+ standing problem: a verify on a PKCS7 structure just after signing
+ it used to fail because the attribute order did not match the
+ encoded order. PKCS7_ATTR_VERIFY does not reorder the attributes:
+ it uses the received order. This is necessary to tolerate some broken
+ software that does not order SET OF. This is handled by encoding
+ as a SEQUENCE OF but using implicit tagging (with UNIVERSAL class)
+ to produce the required SET OF.
+ [Steve Henson]
+
+ *) Have mk1mf.pl generate the macros OPENSSL_BUILD_SHLIBCRYPTO and
+ OPENSSL_BUILD_SHLIBSSL and use them appropriately in the header
+ files to get correct declarations of the ASN.1 item variables.
+ [Richard Levitte]
+
+ *) Rewrite of PKCS#12 code to use new ASN1 functionality. Replace many
+ PKCS#12 macros with real functions. Fix two unrelated ASN1 bugs:
+ asn1_check_tlen() would sometimes attempt to use 'ctx' when it was
+ NULL and ASN1_TYPE was not dereferenced properly in asn1_ex_c2i().
+ New ASN1 macro: DECLARE_ASN1_ITEM() which just declares the relevant
+ ASN1_ITEM and no wrapper functions.
+ [Steve Henson]
+
+ *) New functions or ASN1_item_d2i_fp() and ASN1_item_d2i_bio(). These
+ replace the old function pointer based I/O routines. Change most of
+ the *_d2i_bio() and *_d2i_fp() functions to use these.
+ [Steve Henson]
+
+ *) Enhance mkdef.pl to be more accepting about spacing in C preprocessor
+ lines, recognice more "algorithms" that can be deselected, and make
+ it complain about algorithm deselection that isn't recognised.
+ [Richard Levitte]
+
+ *) New ASN1 functions to handle dup, sign, verify, digest, pack and
+ unpack operations in terms of ASN1_ITEM. Modify existing wrappers
+ to use new functions. Add NO_ASN1_OLD which can be set to remove
+ some old style ASN1 functions: this can be used to determine if old
+ code will still work when these eventually go away.
+ [Steve Henson]
+
+ *) New extension functions for OCSP structures, these follow the
+ same conventions as certificates and CRLs.
+ [Steve Henson]
+
+ *) New function X509V3_add1_i2d(). This automatically encodes and
+ adds an extension. Its behaviour can be customised with various
+ flags to append, replace or delete. Various wrappers added for
+ certificates and CRLs.
+ [Steve Henson]
+
+ *) Fix to avoid calling the underlying ASN1 print routine when
+ an extension cannot be parsed. Correct a typo in the
+ OCSP_SERVICELOC extension. Tidy up print OCSP format.
+ [Steve Henson]
+
+ *) Make mkdef.pl parse some of the ASN1 macros and add appropriate
+ entries for variables.
+ [Steve Henson]
+
+ *) Add functionality to apps/openssl.c for detecting locking
+ problems: As the program is single-threaded, all we have
+ to do is register a locking callback using an array for
+ storing which locks are currently held by the program.
+ [Bodo Moeller]
+
+ *) Use a lock around the call to CRYPTO_get_ex_new_index() in
+ SSL_get_ex_data_X509_STORE_idx(), which is used in
+ ssl_verify_cert_chain() and thus can be called at any time
+ during TLS/SSL handshakes so that thread-safety is essential.
+ Unfortunately, the ex_data design is not at all suited
+ for multi-threaded use, so it probably should be abolished.
+ [Bodo Moeller]
+
+ *) Added Broadcom "ubsec" ENGINE to OpenSSL.
+ [Broadcom, tweaked and integrated by Geoff Thorpe]
+
+ *) Move common extension printing code to new function
+ X509V3_print_extensions(). Reorganise OCSP print routines and
+ implement some needed OCSP ASN1 functions. Add OCSP extensions.
+ [Steve Henson]
+
+ *) New function X509_signature_print() to remove duplication in some
+ print routines.
+ [Steve Henson]
+
+ *) Add a special meaning when SET OF and SEQUENCE OF flags are both
+ set (this was treated exactly the same as SET OF previously). This
+ is used to reorder the STACK representing the structure to match the
+ encoding. This will be used to get round a problem where a PKCS7
+ structure which was signed could not be verified because the STACK
+ order did not reflect the encoded order.
+ [Steve Henson]
+
+ *) Reimplement the OCSP ASN1 module using the new code.
+ [Steve Henson]
+
+ *) Update the X509V3 code to permit the use of an ASN1_ITEM structure
+ for its ASN1 operations. The old style function pointers still exist
+ for now but they will eventually go away.
+ [Steve Henson]
+
+ *) Merge in replacement ASN1 code from the ASN1 branch. This almost
+ completely replaces the old ASN1 functionality with a table driven
+ encoder and decoder which interprets an ASN1_ITEM structure describing
+ the ASN1 module. Compatibility with the existing ASN1 API (i2d,d2i) is
+ largely maintained. Almost all of the old asn1_mac.h macro based ASN1
+ has also been converted to the new form.
+ [Steve Henson]
+
+ *) Change BN_mod_exp_recp so that negative moduli are tolerated
+ (the sign is ignored). Similarly, ignore the sign in BN_MONT_CTX_set
+ so that BN_mod_exp_mont and BN_mod_exp_mont_word work
+ for negative moduli.
+ [Bodo Moeller]
+
+ *) Fix BN_uadd and BN_usub: Always return non-negative results instead
+ of not touching the result's sign bit.
+ [Bodo Moeller]
+
+ *) BN_div bugfix: If the result is 0, the sign (res->neg) must not be
+ set.
+ [Bodo Moeller]
+
+ *) Changed the LHASH code to use prototypes for callbacks, and created
+ macros to declare and implement thin (optionally static) functions
+ that provide type-safety and avoid function pointer casting for the
+ type-specific callbacks.
+ [Geoff Thorpe]
+
+ *) Added Kerberos Cipher Suites to be used with TLS, as written in
+ RFC 2712.
+ [Veers Staats <staatsvr@asc.hpc.mil>,
+ Jeffrey Altman <jaltman@columbia.edu>, via Richard Levitte]
+
+ *) Reformat the FAQ so the different questions and answers can be divided
+ in sections depending on the subject.
+ [Richard Levitte]
+
+ *) Have the zlib compression code load ZLIB.DLL dynamically under
+ Windows.
+ [Richard Levitte]
+
+ *) New function BN_mod_sqrt for computing square roots modulo a prime
+ (using the probabilistic Tonelli-Shanks algorithm unless
+ p == 3 (mod 4) or p == 5 (mod 8), which are cases that can
+ be handled deterministically).
+ [Lenka Fibikova <fibikova@exp-math.uni-essen.de>, Bodo Moeller]
+
+ *) Make BN_mod_inverse faster by explicitly handling small quotients
+ in the Euclid loop. (Speed gain about 20% for small moduli [256 or
+ 512 bits], about 30% for larger ones [1024 or 2048 bits].)
+ [Bodo Moeller]
+
+ *) New function BN_kronecker.
+ [Bodo Moeller]
+
+ *) Fix BN_gcd so that it works on negative inputs; the result is
+ positive unless both parameters are zero.
+ Previously something reasonably close to an infinite loop was
+ possible because numbers could be growing instead of shrinking
+ in the implementation of Euclid's algorithm.
+ [Bodo Moeller]
+
+ *) Fix BN_is_word() and BN_is_one() macros to take into account the
+ sign of the number in question.
+
+ Fix BN_is_word(a,w) to work correctly for w == 0.
+
+ The old BN_is_word(a,w) macro is now called BN_abs_is_word(a,w)
+ because its test if the absolute value of 'a' equals 'w'.
+ Note that BN_abs_is_word does *not* handle w == 0 reliably;
+ it exists mostly for use in the implementations of BN_is_zero(),
+ BN_is_one(), and BN_is_word().
+ [Bodo Moeller]
+
+ *) New function BN_swap.
+ [Bodo Moeller]
+
+ *) Use BN_nnmod instead of BN_mod in crypto/bn/bn_exp.c so that
+ the exponentiation functions are more likely to produce reasonable
+ results on negative inputs.
+ [Bodo Moeller]
+
+ *) Change BN_mod_mul so that the result is always non-negative.
+ Previously, it could be negative if one of the factors was negative;
+ I don't think anyone really wanted that behaviour.
+ [Bodo Moeller]
+
+ *) Move BN_mod_... functions into new file crypto/bn/bn_mod.c
+ (except for exponentiation, which stays in crypto/bn/bn_exp.c,
+ and BN_mod_mul_reciprocal, which stays in crypto/bn/bn_recp.c)
+ and add new functions:
+
+ BN_nnmod
+ BN_mod_sqr
+ BN_mod_add
+ BN_mod_add_quick
+ BN_mod_sub
+ BN_mod_sub_quick
+ BN_mod_lshift1
+ BN_mod_lshift1_quick
+ BN_mod_lshift
+ BN_mod_lshift_quick
+
+ These functions always generate non-negative results.
+
+ BN_nnmod otherwise is like BN_mod (if BN_mod computes a remainder r
+ such that |m| < r < 0, BN_nnmod will output rem + |m| instead).
+
+ BN_mod_XXX_quick(r, a, [b,] m) generates the same result as
+ BN_mod_XXX(r, a, [b,] m, ctx), but requires that a [and b]
+ be reduced modulo m.
+ [Lenka Fibikova <fibikova@exp-math.uni-essen.de>, Bodo Moeller]
+
+#if 0
+ The following entry accidentally appeared in the CHANGES file
+ distributed with OpenSSL 0.9.7. The modifications described in
+ it do *not* apply to OpenSSL 0.9.7.
+
+ *) Remove a few calls to bn_wexpand() in BN_sqr() (the one in there
+ was actually never needed) and in BN_mul(). The removal in BN_mul()
+ required a small change in bn_mul_part_recursive() and the addition
+ of the functions bn_cmp_part_words(), bn_sub_part_words() and
+ bn_add_part_words(), which do the same thing as bn_cmp_words(),
+ bn_sub_words() and bn_add_words() except they take arrays with
+ differing sizes.
+ [Richard Levitte]
+#endif
+
+ *) In 'openssl passwd', verify passwords read from the terminal
+ unless the '-salt' option is used (which usually means that
+ verification would just waste user's time since the resulting
+ hash is going to be compared with some given password hash)
+ or the new '-noverify' option is used.
+
+ This is an incompatible change, but it does not affect
+ non-interactive use of 'openssl passwd' (passwords on the command
+ line, '-stdin' option, '-in ...' option) and thus should not
+ cause any problems.
+ [Bodo Moeller]
+
+ *) Remove all references to RSAref, since there's no more need for it.
+ [Richard Levitte]
+
+ *) Make DSO load along a path given through an environment variable
+ (SHLIB_PATH) with shl_load().
+ [Richard Levitte]
+
+ *) Constify the ENGINE code as a result of BIGNUM constification.
+ Also constify the RSA code and most things related to it. In a
+ few places, most notable in the depth of the ASN.1 code, ugly
+ casts back to non-const were required (to be solved at a later
+ time)
+ [Richard Levitte]
+
+ *) Make it so the openssl application has all engines loaded by default.
+ [Richard Levitte]
+
+ *) Constify the BIGNUM routines a little more.
+ [Richard Levitte]
+
+ *) Add the following functions:
+
+ ENGINE_load_cswift()
+ ENGINE_load_chil()
+ ENGINE_load_atalla()
+ ENGINE_load_nuron()
+ ENGINE_load_builtin_engines()
+
+ That way, an application can itself choose if external engines that
+ are built-in in OpenSSL shall ever be used or not. The benefit is
+ that applications won't have to be linked with libdl or other dso
+ libraries unless it's really needed.
+
+ Changed 'openssl engine' to load all engines on demand.
+ Changed the engine header files to avoid the duplication of some
+ declarations (they differed!).
+ [Richard Levitte]
+
+ *) 'openssl engine' can now list capabilities.
+ [Richard Levitte]
+
+ *) Better error reporting in 'openssl engine'.
+ [Richard Levitte]
+
+ *) Never call load_dh_param(NULL) in s_server.
+ [Bodo Moeller]
+
+ *) Add engine application. It can currently list engines by name and
+ identity, and test if they are actually available.
+ [Richard Levitte]
+
+ *) Improve RPM specification file by forcing symbolic linking and making
+ sure the installed documentation is also owned by root.root.
+ [Damien Miller <djm@mindrot.org>]
+
+ *) Give the OpenSSL applications more possibilities to make use of
+ keys (public as well as private) handled by engines.
+ [Richard Levitte]
+
+ *) Add OCSP code that comes from CertCo.
+ [Richard Levitte]
+
+ *) Add VMS support for the Rijndael code.
+ [Richard Levitte]
+
+ *) Added untested support for Nuron crypto accelerator.
+ [Ben Laurie]
+
+ *) Add support for external cryptographic devices. This code was
+ previously distributed separately as the "engine" branch.
+ [Geoff Thorpe, Richard Levitte]
+
+ *) Rework the filename-translation in the DSO code. It is now possible to
+ have far greater control over how a "name" is turned into a filename
+ depending on the operating environment and any oddities about the
+ different shared library filenames on each system.
+ [Geoff Thorpe]
+
+ *) Support threads on FreeBSD-elf in Configure.
+ [Richard Levitte]
+
+ *) Fix for SHA1 assembly problem with MASM: it produces
+ warnings about corrupt line number information when assembling
+ with debugging information. This is caused by the overlapping
+ of two sections.
+ [Bernd Matthes <mainbug@celocom.de>, Steve Henson]
+
+ *) NCONF changes.
+ NCONF_get_number() has no error checking at all. As a replacement,
+ NCONF_get_number_e() is defined (_e for "error checking") and is
+ promoted strongly. The old NCONF_get_number is kept around for
+ binary backward compatibility.
+ Make it possible for methods to load from something other than a BIO,
+ by providing a function pointer that is given a name instead of a BIO.
+ For example, this could be used to load configuration data from an
+ LDAP server.
+ [Richard Levitte]
+
+ *) Fix for non blocking accept BIOs. Added new I/O special reason
+ BIO_RR_ACCEPT to cover this case. Previously use of accept BIOs
+ with non blocking I/O was not possible because no retry code was
+ implemented. Also added new SSL code SSL_WANT_ACCEPT to cover
+ this case.
+ [Steve Henson]
+
+ *) Added the beginnings of Rijndael support.
+ [Ben Laurie]
+
+ *) Fix for bug in DirectoryString mask setting. Add support for
+ X509_NAME_print_ex() in 'req' and X509_print_ex() function
+ to allow certificate printing to more controllable, additional
+ 'certopt' option to 'x509' to allow new printing options to be
+ set.
+ [Steve Henson]
+
+ *) Clean old EAY MD5 hack from e_os.h.
+ [Richard Levitte]
+
+ Changes between 0.9.6l and 0.9.6m [17 Mar 2004]
+
+ *) Fix null-pointer assignment in do_change_cipher_spec() revealed
+ by using the Codenomicon TLS Test Tool (CVE-2004-0079)
+ [Joe Orton, Steve Henson]
+
+ Changes between 0.9.6k and 0.9.6l [04 Nov 2003]
+
+ *) Fix additional bug revealed by the NISCC test suite:
+
+ Stop bug triggering large recursion when presented with
+ certain ASN.1 tags (CVE-2003-0851)
+ [Steve Henson]
+
+ Changes between 0.9.6j and 0.9.6k [30 Sep 2003]
+
+ *) Fix various bugs revealed by running the NISCC test suite:
+
+ Stop out of bounds reads in the ASN1 code when presented with
+ invalid tags (CVE-2003-0543 and CVE-2003-0544).
+
+ If verify callback ignores invalid public key errors don't try to check
+ certificate signature with the NULL public key.
+
+ [Steve Henson]
+
+ *) In ssl3_accept() (ssl/s3_srvr.c) only accept a client certificate
+ if the server requested one: as stated in TLS 1.0 and SSL 3.0
+ specifications.
+ [Steve Henson]
+
+ *) In ssl3_get_client_hello() (ssl/s3_srvr.c), tolerate additional
+ extra data after the compression methods not only for TLS 1.0
+ but also for SSL 3.0 (as required by the specification).
+ [Bodo Moeller; problem pointed out by Matthias Loepfe]
+
+ *) Change X509_certificate_type() to mark the key as exported/exportable
+ when it's 512 *bits* long, not 512 bytes.
+ [Richard Levitte]
+
+ Changes between 0.9.6i and 0.9.6j [10 Apr 2003]
+
+ *) Countermeasure against the Klima-Pokorny-Rosa extension of
+ Bleichbacher's attack on PKCS #1 v1.5 padding: treat
+ a protocol version number mismatch like a decryption error
+ in ssl3_get_client_key_exchange (ssl/s3_srvr.c).
+ [Bodo Moeller]
+
+ *) Turn on RSA blinding by default in the default implementation
+ to avoid a timing attack. Applications that don't want it can call
+ RSA_blinding_off() or use the new flag RSA_FLAG_NO_BLINDING.
+ They would be ill-advised to do so in most cases.
+ [Ben Laurie, Steve Henson, Geoff Thorpe, Bodo Moeller]
+
+ *) Change RSA blinding code so that it works when the PRNG is not
+ seeded (in this case, the secret RSA exponent is abused as
+ an unpredictable seed -- if it is not unpredictable, there
+ is no point in blinding anyway). Make RSA blinding thread-safe
+ by remembering the creator's thread ID in rsa->blinding and
+ having all other threads use local one-time blinding factors
+ (this requires more computation than sharing rsa->blinding, but
+ avoids excessive locking; and if an RSA object is not shared
+ between threads, blinding will still be very fast).
+ [Bodo Moeller]
+
+ Changes between 0.9.6h and 0.9.6i [19 Feb 2003]
+
+ *) In ssl3_get_record (ssl/s3_pkt.c), minimize information leaked
+ via timing by performing a MAC computation even if incorrrect
+ block cipher padding has been found. This is a countermeasure
+ against active attacks where the attacker has to distinguish
+ between bad padding and a MAC verification error. (CVE-2003-0078)
+
+ [Bodo Moeller; problem pointed out by Brice Canvel (EPFL),
+ Alain Hiltgen (UBS), Serge Vaudenay (EPFL), and
+ Martin Vuagnoux (EPFL, Ilion)]
+
+ Changes between 0.9.6g and 0.9.6h [5 Dec 2002]
+
+ *) New function OPENSSL_cleanse(), which is used to cleanse a section of
+ memory from it's contents. This is done with a counter that will
+ place alternating values in each byte. This can be used to solve
+ two issues: 1) the removal of calls to memset() by highly optimizing
+ compilers, and 2) cleansing with other values than 0, since those can
+ be read through on certain media, for example a swap space on disk.
+ [Geoff Thorpe]
+
+ *) Bugfix: client side session caching did not work with external caching,
+ because the session->cipher setting was not restored when reloading
+ from the external cache. This problem was masked, when
+ SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG (part of SSL_OP_ALL) was set.
+ (Found by Steve Haslam <steve@araqnid.ddts.net>.)
+ [Lutz Jaenicke]
+
+ *) Fix client_certificate (ssl/s2_clnt.c): The permissible total
+ length of the REQUEST-CERTIFICATE message is 18 .. 34, not 17 .. 33.
+ [Zeev Lieber <zeev-l@yahoo.com>]
+
+ *) Undo an undocumented change introduced in 0.9.6e which caused
+ repeated calls to OpenSSL_add_all_ciphers() and
+ OpenSSL_add_all_digests() to be ignored, even after calling
+ EVP_cleanup().
+ [Richard Levitte]
+
+ *) Change the default configuration reader to deal with last line not
+ being properly terminated.
+ [Richard Levitte]
+
+ *) Change X509_NAME_cmp() so it applies the special rules on handling
+ DN values that are of type PrintableString, as well as RDNs of type
+ emailAddress where the value has the type ia5String.
+ [stefank@valicert.com via Richard Levitte]
+
+ *) Add a SSL_SESS_CACHE_NO_INTERNAL_STORE flag to take over half
+ the job SSL_SESS_CACHE_NO_INTERNAL_LOOKUP was inconsistently
+ doing, define a new flag (SSL_SESS_CACHE_NO_INTERNAL) to be
+ the bitwise-OR of the two for use by the majority of applications
+ wanting this behaviour, and update the docs. The documented
+ behaviour and actual behaviour were inconsistent and had been
+ changing anyway, so this is more a bug-fix than a behavioural
+ change.
+ [Geoff Thorpe, diagnosed by Nadav Har'El]
+
+ *) Don't impose a 16-byte length minimum on session IDs in ssl/s3_clnt.c
+ (the SSL 3.0 and TLS 1.0 specifications allow any length up to 32 bytes).
+ [Bodo Moeller]
+
+ *) Fix initialization code race conditions in
+ SSLv23_method(), SSLv23_client_method(), SSLv23_server_method(),
+ SSLv2_method(), SSLv2_client_method(), SSLv2_server_method(),
+ SSLv3_method(), SSLv3_client_method(), SSLv3_server_method(),
+ TLSv1_method(), TLSv1_client_method(), TLSv1_server_method(),
+ ssl2_get_cipher_by_char(),
+ ssl3_get_cipher_by_char().
+ [Patrick McCormick <patrick@tellme.com>, Bodo Moeller]
+
+ *) Reorder cleanup sequence in SSL_CTX_free(): only remove the ex_data after
+ the cached sessions are flushed, as the remove_cb() might use ex_data
+ contents. Bug found by Sam Varshavchik <mrsam@courier-mta.com>
+ (see [openssl.org #212]).
+ [Geoff Thorpe, Lutz Jaenicke]
+
+ *) Fix typo in OBJ_txt2obj which incorrectly passed the content
+ length, instead of the encoding length to d2i_ASN1_OBJECT.
+ [Steve Henson]
+
+ Changes between 0.9.6f and 0.9.6g [9 Aug 2002]
+
+ *) [In 0.9.6g-engine release:]
+ Fix crypto/engine/vendor_defns/cswift.h for WIN32 (use '_stdcall').
+ [Lynn Gazis <lgazis@rainbow.com>]
+
+ Changes between 0.9.6e and 0.9.6f [8 Aug 2002]
+
+ *) Fix ASN1 checks. Check for overflow by comparing with LONG_MAX
+ and get fix the header length calculation.
+ [Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>,
+ Alon Kantor <alonk@checkpoint.com> (and others),
+ Steve Henson]
+
+ *) Use proper error handling instead of 'assertions' in buffer
+ overflow checks added in 0.9.6e. This prevents DoS (the
+ assertions could call abort()).
+ [Arne Ansper <arne@ats.cyber.ee>, Bodo Moeller]
+
+ Changes between 0.9.6d and 0.9.6e [30 Jul 2002]
+
+ *) Add various sanity checks to asn1_get_length() to reject
+ the ASN1 length bytes if they exceed sizeof(long), will appear
+ negative or the content length exceeds the length of the
+ supplied buffer.
+ [Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
+
+ *) Fix cipher selection routines: ciphers without encryption had no flags
+ for the cipher strength set and where therefore not handled correctly
+ by the selection routines (PR #130).
+ [Lutz Jaenicke]
+
+ *) Fix EVP_dsa_sha macro.
+ [Nils Larsch]
+
+ *) New option
+ SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
+ for disabling the SSL 3.0/TLS 1.0 CBC vulnerability countermeasure
+ that was added in OpenSSL 0.9.6d.
+
+ As the countermeasure turned out to be incompatible with some
+ broken SSL implementations, the new option is part of SSL_OP_ALL.
+ SSL_OP_ALL is usually employed when compatibility with weird SSL
+ implementations is desired (e.g. '-bugs' option to 's_client' and
+ 's_server'), so the new option is automatically set in many
+ applications.
+ [Bodo Moeller]
+
+ *) Changes in security patch:
+
+ Changes marked "(CHATS)" were sponsored by the Defense Advanced
+ Research Projects Agency (DARPA) and Air Force Research Laboratory,
+ Air Force Materiel Command, USAF, under agreement number
+ F30602-01-2-0537.
+
+ *) Add various sanity checks to asn1_get_length() to reject
+ the ASN1 length bytes if they exceed sizeof(long), will appear
+ negative or the content length exceeds the length of the
+ supplied buffer. (CVE-2002-0659)
+ [Steve Henson, Adi Stav <stav@mercury.co.il>, James Yonan <jim@ntlp.com>]
+
+ *) Assertions for various potential buffer overflows, not known to
+ happen in practice.
+ [Ben Laurie (CHATS)]
+
+ *) Various temporary buffers to hold ASCII versions of integers were
+ too small for 64 bit platforms. (CVE-2002-0655)
+ [Matthew Byng-Maddick <mbm@aldigital.co.uk> and Ben Laurie (CHATS)>
+
+ *) Remote buffer overflow in SSL3 protocol - an attacker could
+ supply an oversized session ID to a client. (CVE-2002-0656)
+ [Ben Laurie (CHATS)]
+
+ *) Remote buffer overflow in SSL2 protocol - an attacker could
+ supply an oversized client master key. (CVE-2002-0656)
+ [Ben Laurie (CHATS)]
+
+ Changes between 0.9.6c and 0.9.6d [9 May 2002]
+
+ *) Fix crypto/asn1/a_sign.c so that 'parameters' is omitted (not
+ encoded as NULL) with id-dsa-with-sha1.
+ [Nils Larsch <nla@trustcenter.de>; problem pointed out by Bodo Moeller]
+
+ *) Check various X509_...() return values in apps/req.c.
+ [Nils Larsch <nla@trustcenter.de>]
+
+ *) Fix BASE64 decode (EVP_DecodeUpdate) for data with CR/LF ended lines:
+ an end-of-file condition would erroneously be flagged, when the CRLF
+ was just at the end of a processed block. The bug was discovered when
+ processing data through a buffering memory BIO handing the data to a
+ BASE64-decoding BIO. Bug fund and patch submitted by Pavel Tsekov
+ <ptsekov@syntrex.com> and Nedelcho Stanev.
+ [Lutz Jaenicke]
+
+ *) Implement a countermeasure against a vulnerability recently found
+ in CBC ciphersuites in SSL 3.0/TLS 1.0: Send an empty fragment
+ before application data chunks to avoid the use of known IVs
+ with data potentially chosen by the attacker.
+ [Bodo Moeller]
+
+ *) Fix length checks in ssl3_get_client_hello().
+ [Bodo Moeller]
+
+ *) TLS/SSL library bugfix: use s->s3->in_read_app_data differently
+ to prevent ssl3_read_internal() from incorrectly assuming that
+ ssl3_read_bytes() found application data while handshake
+ processing was enabled when in fact s->s3->in_read_app_data was
+ merely automatically cleared during the initial handshake.
+ [Bodo Moeller; problem pointed out by Arne Ansper <arne@ats.cyber.ee>]
+
+ *) Fix object definitions for Private and Enterprise: they were not
+ recognized in their shortname (=lowercase) representation. Extend
+ obj_dat.pl to issue an error when using undefined keywords instead
+ of silently ignoring the problem (Svenning Sorensen
+ <sss@sss.dnsalias.net>).
+ [Lutz Jaenicke]
+
+ *) Fix DH_generate_parameters() so that it works for 'non-standard'
+ generators, i.e. generators other than 2 and 5. (Previously, the
+ code did not properly initialise the 'add' and 'rem' values to
+ BN_generate_prime().)
+
+ In the new general case, we do not insist that 'generator' is
+ actually a primitive root: This requirement is rather pointless;
+ a generator of the order-q subgroup is just as good, if not
+ better.
+ [Bodo Moeller]
+
+ *) Map new X509 verification errors to alerts. Discovered and submitted by
+ Tom Wu <tom@arcot.com>.
+ [Lutz Jaenicke]
+
+ *) Fix ssl3_pending() (ssl/s3_lib.c) to prevent SSL_pending() from
+ returning non-zero before the data has been completely received
+ when using non-blocking I/O.
+ [Bodo Moeller; problem pointed out by John Hughes]
+
+ *) Some of the ciphers missed the strength entry (SSL_LOW etc).
+ [Ben Laurie, Lutz Jaenicke]
+
+ *) Fix bug in SSL_clear(): bad sessions were not removed (found by
+ Yoram Zahavi <YoramZ@gilian.com>).
+ [Lutz Jaenicke]
+
+ *) Add information about CygWin 1.3 and on, and preserve proper
+ configuration for the versions before that.
+ [Corinna Vinschen <vinschen@redhat.com> and Richard Levitte]
+
+ *) Make removal from session cache (SSL_CTX_remove_session()) more robust:
+ check whether we deal with a copy of a session and do not delete from
+ the cache in this case. Problem reported by "Izhar Shoshani Levi"
+ <izhar@checkpoint.com>.
+ [Lutz Jaenicke]
+
+ *) Do not store session data into the internal session cache, if it
+ is never intended to be looked up (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP
+ flag is set). Proposed by Aslam <aslam@funk.com>.
+ [Lutz Jaenicke]
+
+ *) Have ASN1_BIT_STRING_set_bit() really clear a bit when the requested
+ value is 0.
+ [Richard Levitte]
+
+ *) [In 0.9.6d-engine release:]
+ Fix a crashbug and a logic bug in hwcrhk_load_pubkey().
+ [Toomas Kiisk <vix@cyber.ee> via Richard Levitte]
+
+ *) Add the configuration target linux-s390x.
+ [Neale Ferguson <Neale.Ferguson@SoftwareAG-USA.com> via Richard Levitte]
+
+ *) The earlier bugfix for the SSL3_ST_SW_HELLO_REQ_C case of
+ ssl3_accept (ssl/s3_srvr.c) incorrectly used a local flag
+ variable as an indication that a ClientHello message has been
+ received. As the flag value will be lost between multiple
+ invocations of ssl3_accept when using non-blocking I/O, the
+ function may not be aware that a handshake has actually taken
+ place, thus preventing a new session from being added to the
+ session cache.
+
+ To avoid this problem, we now set s->new_session to 2 instead of
+ using a local variable.
+ [Lutz Jaenicke, Bodo Moeller]
+
+ *) Bugfix: Return -1 from ssl3_get_server_done (ssl3/s3_clnt.c)
+ if the SSL_R_LENGTH_MISMATCH error is detected.
+ [Geoff Thorpe, Bodo Moeller]
+
+ *) New 'shared_ldflag' column in Configure platform table.
+ [Richard Levitte]
+
+ *) Fix EVP_CIPHER_mode macro.
+ ["Dan S. Camper" <dan@bti.net>]
+
+ *) Fix ssl3_read_bytes (ssl/s3_pkt.c): To ignore messages of unknown
+ type, we must throw them away by setting rr->length to 0.
+ [D P Chang <dpc@qualys.com>]
+
+ Changes between 0.9.6b and 0.9.6c [21 dec 2001]
+
+ *) Fix BN_rand_range bug pointed out by Dominikus Scherkl
+ <Dominikus.Scherkl@biodata.com>. (The previous implementation
+ worked incorrectly for those cases where range = 10..._2 and
+ 3*range is two bits longer than range.)
+ [Bodo Moeller]
+
+ *) Only add signing time to PKCS7 structures if it is not already
+ present.
+ [Steve Henson]
+
+ *) Fix crypto/objects/objects.h: "ld-ce" should be "id-ce",
+ OBJ_ld_ce should be OBJ_id_ce.
+ Also some ip-pda OIDs in crypto/objects/objects.txt were
+ incorrect (cf. RFC 3039).
+ [Matt Cooper, Frederic Giudicelli, Bodo Moeller]
+
+ *) Release CRYPTO_LOCK_DYNLOCK when CRYPTO_destroy_dynlockid()
+ returns early because it has nothing to do.
+ [Andy Schneider <andy.schneider@bjss.co.uk>]
+
+ *) [In 0.9.6c-engine release:]
+ Fix mutex callback return values in crypto/engine/hw_ncipher.c.
+ [Andy Schneider <andy.schneider@bjss.co.uk>]
+
+ *) [In 0.9.6c-engine release:]
+ Add support for Cryptographic Appliance's keyserver technology.
+ (Use engine 'keyclient')
+ [Cryptographic Appliances and Geoff Thorpe]
+
+ *) Add a configuration entry for OS/390 Unix. The C compiler 'c89'
+ is called via tools/c89.sh because arguments have to be
+ rearranged (all '-L' options must appear before the first object
+ modules).
+ [Richard Shapiro <rshapiro@abinitio.com>]
+
+ *) [In 0.9.6c-engine release:]
+ Add support for Broadcom crypto accelerator cards, backported
+ from 0.9.7.
+ [Broadcom, Nalin Dahyabhai <nalin@redhat.com>, Mark Cox]
+
+ *) [In 0.9.6c-engine release:]
+ Add support for SureWare crypto accelerator cards from
+ Baltimore Technologies. (Use engine 'sureware')
+ [Baltimore Technologies and Mark Cox]
+
+ *) [In 0.9.6c-engine release:]
+ Add support for crypto accelerator cards from Accelerated
+ Encryption Processing, www.aep.ie. (Use engine 'aep')
+ [AEP Inc. and Mark Cox]
+
+ *) Add a configuration entry for gcc on UnixWare.
+ [Gary Benson <gbenson@redhat.com>]
+
+ *) Change ssl/s2_clnt.c and ssl/s2_srvr.c so that received handshake
+ messages are stored in a single piece (fixed-length part and
+ variable-length part combined) and fix various bugs found on the way.
+ [Bodo Moeller]
+
+ *) Disable caching in BIO_gethostbyname(), directly use gethostbyname()
+ instead. BIO_gethostbyname() does not know what timeouts are
+ appropriate, so entries would stay in cache even when they have
+ become invalid.
+ [Bodo Moeller; problem pointed out by Rich Salz <rsalz@zolera.com>
+
+ *) Change ssl23_get_client_hello (ssl/s23_srvr.c) behaviour when
+ faced with a pathologically small ClientHello fragment that does
+ not contain client_version: Instead of aborting with an error,
+ simply choose the highest available protocol version (i.e.,
+ TLS 1.0 unless it is disabled). In practice, ClientHello
+ messages are never sent like this, but this change gives us
+ strictly correct behaviour at least for TLS.
+ [Bodo Moeller]
+
+ *) Fix SSL handshake functions and SSL_clear() such that SSL_clear()
+ never resets s->method to s->ctx->method when called from within
+ one of the SSL handshake functions.
+ [Bodo Moeller; problem pointed out by Niko Baric]
+
+ *) In ssl3_get_client_hello (ssl/s3_srvr.c), generate a fatal alert
+ (sent using the client's version number) if client_version is
+ smaller than the protocol version in use. Also change
+ ssl23_get_client_hello (ssl/s23_srvr.c) to select TLS 1.0 if
+ the client demanded SSL 3.0 but only TLS 1.0 is enabled; then
+ the client will at least see that alert.
+ [Bodo Moeller]
+
+ *) Fix ssl3_get_message (ssl/s3_both.c) to handle message fragmentation
+ correctly.
+ [Bodo Moeller]
+
+ *) Avoid infinite loop in ssl3_get_message (ssl/s3_both.c) if a
+ client receives HelloRequest while in a handshake.
+ [Bodo Moeller; bug noticed by Andy Schneider <andy.schneider@bjss.co.uk>]
+
+ *) Bugfix in ssl3_accept (ssl/s3_srvr.c): Case SSL3_ST_SW_HELLO_REQ_C
+ should end in 'break', not 'goto end' which circumvents various
+ cleanups done in state SSL_ST_OK. But session related stuff
+ must be disabled for SSL_ST_OK in the case that we just sent a
+ HelloRequest.
+
+ Also avoid some overhead by not calling ssl_init_wbio_buffer()
+ before just sending a HelloRequest.
+ [Bodo Moeller, Eric Rescorla <ekr@rtfm.com>]
+
+ *) Fix ssl/s3_enc.c, ssl/t1_enc.c and ssl/s3_pkt.c so that we don't
+ reveal whether illegal block cipher padding was found or a MAC
+ verification error occurred. (Neither SSLerr() codes nor alerts
+ are directly visible to potential attackers, but the information
+ may leak via logfiles.)
+
+ Similar changes are not required for the SSL 2.0 implementation
+ because the number of padding bytes is sent in clear for SSL 2.0,
+ and the extra bytes are just ignored. However ssl/s2_pkt.c
+ failed to verify that the purported number of padding bytes is in
+ the legal range.
+ [Bodo Moeller]
+
+ *) Add OpenUNIX-8 support including shared libraries
+ (Boyd Lynn Gerber <gerberb@zenez.com>).
+ [Lutz Jaenicke]
+
+ *) Improve RSA_padding_check_PKCS1_OAEP() check again to avoid
+ 'wristwatch attack' using huge encoding parameters (cf.
+ James H. Manger's CRYPTO 2001 paper). Note that the
+ RSA_PKCS1_OAEP_PADDING case of RSA_private_decrypt() does not use
+ encoding parameters and hence was not vulnerable.
+ [Bodo Moeller]
+
+ *) BN_sqr() bug fix.
+ [Ulf Möller, reported by Jim Ellis <jim.ellis@cavium.com>]
+
+ *) Rabin-Miller test analyses assume uniformly distributed witnesses,
+ so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
+ followed by modular reduction.
+ [Bodo Moeller; pointed out by Adam Young <AYoung1@NCSUS.JNJ.COM>]
+
+ *) Add BN_pseudo_rand_range() with obvious functionality: BN_rand_range()
+ equivalent based on BN_pseudo_rand() instead of BN_rand().
+ [Bodo Moeller]
+
+ *) s3_srvr.c: allow sending of large client certificate lists (> 16 kB).
+ This function was broken, as the check for a new client hello message
+ to handle SGC did not allow these large messages.
+ (Tracked down by "Douglas E. Engert" <deengert@anl.gov>.)
+ [Lutz Jaenicke]
+
+ *) Add alert descriptions for TLSv1 to SSL_alert_desc_string[_long]().
+ [Lutz Jaenicke]
+
+ *) Fix buggy behaviour of BIO_get_num_renegotiates() and BIO_ctrl()
+ for BIO_C_GET_WRITE_BUF_SIZE ("Stephen Hinton" <shinton@netopia.com>).
+ [Lutz Jaenicke]
+
+ *) Rework the configuration and shared library support for Tru64 Unix.
+ The configuration part makes use of modern compiler features and
+ still retains old compiler behavior for those that run older versions
+ of the OS. The shared library support part includes a variant that
+ uses the RPATH feature, and is available through the special
+ configuration target "alpha-cc-rpath", which will never be selected
+ automatically.
+ [Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> via Richard Levitte]
+
+ *) In ssl3_get_key_exchange (ssl/s3_clnt.c), call ssl3_get_message()
+ with the same message size as in ssl3_get_certificate_request().
+ Otherwise, if no ServerKeyExchange message occurs, CertificateRequest
+ messages might inadvertently be reject as too long.
+ [Petr Lampa <lampa@fee.vutbr.cz>]
+
+ *) Enhanced support for IA-64 Unix platforms (well, Linux and HP-UX).
+ [Andy Polyakov]
+
+ *) Modified SSL library such that the verify_callback that has been set
+ specificly for an SSL object with SSL_set_verify() is actually being
+ used. Before the change, a verify_callback set with this function was
+ ignored and the verify_callback() set in the SSL_CTX at the time of
+ the call was used. New function X509_STORE_CTX_set_verify_cb() introduced
+ to allow the necessary settings.
+ [Lutz Jaenicke]
+
+ *) Initialize static variable in crypto/dsa/dsa_lib.c and crypto/dh/dh_lib.c
+ explicitly to NULL, as at least on Solaris 8 this seems not always to be
+ done automatically (in contradiction to the requirements of the C
+ standard). This made problems when used from OpenSSH.
+ [Lutz Jaenicke]
+
+ *) In OpenSSL 0.9.6a and 0.9.6b, crypto/dh/dh_key.c ignored
+ dh->length and always used
+
+ BN_rand_range(priv_key, dh->p).
+
+ BN_rand_range() is not necessary for Diffie-Hellman, and this
+ specific range makes Diffie-Hellman unnecessarily inefficient if
+ dh->length (recommended exponent length) is much smaller than the
+ length of dh->p. We could use BN_rand_range() if the order of
+ the subgroup was stored in the DH structure, but we only have
+ dh->length.
+
+ So switch back to
+
+ BN_rand(priv_key, l, ...)
+
+ where 'l' is dh->length if this is defined, or BN_num_bits(dh->p)-1
+ otherwise.
+ [Bodo Moeller]
+
+ *) In
+
+ RSA_eay_public_encrypt
+ RSA_eay_private_decrypt
+ RSA_eay_private_encrypt (signing)
+ RSA_eay_public_decrypt (signature verification)
+
+ (default implementations for RSA_public_encrypt,
+ RSA_private_decrypt, RSA_private_encrypt, RSA_public_decrypt),
+ always reject numbers >= n.
+ [Bodo Moeller]
+
+ *) In crypto/rand/md_rand.c, use a new short-time lock CRYPTO_LOCK_RAND2
+ to synchronize access to 'locking_thread'. This is necessary on
+ systems where access to 'locking_thread' (an 'unsigned long'
+ variable) is not atomic.
+ [Bodo Moeller]
+
+ *) In crypto/rand/md_rand.c, set 'locking_thread' to current thread's ID
+ *before* setting the 'crypto_lock_rand' flag. The previous code had
+ a race condition if 0 is a valid thread ID.
+ [Travis Vitek <vitek@roguewave.com>]
+
+ *) Add support for shared libraries under Irix.
+ [Albert Chin-A-Young <china@thewrittenword.com>]
+
+ *) Add configuration option to build on Linux on both big-endian and
+ little-endian MIPS.
+ [Ralf Baechle <ralf@uni-koblenz.de>]
+
+ *) Add the possibility to create shared libraries on HP-UX.
+ [Richard Levitte]
+
+ Changes between 0.9.6a and 0.9.6b [9 Jul 2001]
+
+ *) Change ssleay_rand_bytes (crypto/rand/md_rand.c)
+ to avoid a SSLeay/OpenSSL PRNG weakness pointed out by
+ Markku-Juhani O. Saarinen <markku-juhani.saarinen@nokia.com>:
+ PRNG state recovery was possible based on the output of
+ one PRNG request appropriately sized to gain knowledge on
+ 'md' followed by enough consecutive 1-byte PRNG requests
+ to traverse all of 'state'.
+
+ 1. When updating 'md_local' (the current thread's copy of 'md')
+ during PRNG output generation, hash all of the previous
+ 'md_local' value, not just the half used for PRNG output.
+
+ 2. Make the number of bytes from 'state' included into the hash
+ independent from the number of PRNG bytes requested.
+
+ The first measure alone would be sufficient to avoid
+ Markku-Juhani's attack. (Actually it had never occurred
+ to me that the half of 'md_local' used for chaining was the
+ half from which PRNG output bytes were taken -- I had always
+ assumed that the secret half would be used.) The second
+ measure makes sure that additional data from 'state' is never
+ mixed into 'md_local' in small portions; this heuristically
+ further strengthens the PRNG.
+ [Bodo Moeller]
+
+ *) Fix crypto/bn/asm/mips3.s.
+ [Andy Polyakov]
+
+ *) When only the key is given to "enc", the IV is undefined. Print out
+ an error message in this case.
+ [Lutz Jaenicke]
+
+ *) Handle special case when X509_NAME is empty in X509 printing routines.
+ [Steve Henson]
+
+ *) In dsa_do_verify (crypto/dsa/dsa_ossl.c), verify that r and s are
+ positive and less than q.
+ [Bodo Moeller]
+
+ *) Don't change *pointer in CRYPTO_add_lock() is add_lock_callback is
+ used: it isn't thread safe and the add_lock_callback should handle
+ that itself.
+ [Paul Rose <Paul.Rose@bridge.com>]
+
+ *) Verify that incoming data obeys the block size in
+ ssl3_enc (ssl/s3_enc.c) and tls1_enc (ssl/t1_enc.c).
+ [Bodo Moeller]
+
+ *) Fix OAEP check.
+ [Ulf Möller, Bodo Möller]
+
+ *) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
+ RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
+ when fixing the server behaviour for backwards-compatible 'client
+ hello' messages. (Note that the attack is impractical against
+ SSL 3.0 and TLS 1.0 anyway because length and version checking
+ means that the probability of guessing a valid ciphertext is
+ around 2^-40; see section 5 in Bleichenbacher's CRYPTO '98
+ paper.)
+
+ Before 0.9.5, the countermeasure (hide the error by generating a
+ random 'decryption result') did not work properly because
+ ERR_clear_error() was missing, meaning that SSL_get_error() would
+ detect the supposedly ignored error.
+
+ Both problems are now fixed.
+ [Bodo Moeller]
+
+ *) In crypto/bio/bf_buff.c, increase DEFAULT_BUFFER_SIZE to 4096
+ (previously it was 1024).
+ [Bodo Moeller]
+
+ *) Fix for compatibility mode trust settings: ignore trust settings
+ unless some valid trust or reject settings are present.
+ [Steve Henson]
+
+ *) Fix for blowfish EVP: its a variable length cipher.
+ [Steve Henson]
+
+ *) Fix various bugs related to DSA S/MIME verification. Handle missing
+ parameters in DSA public key structures and return an error in the
+ DSA routines if parameters are absent.
+ [Steve Henson]
+
+ *) In versions up to 0.9.6, RAND_file_name() resorted to file ".rnd"
+ in the current directory if neither $RANDFILE nor $HOME was set.
+ RAND_file_name() in 0.9.6a returned NULL in this case. This has
+ caused some confusion to Windows users who haven't defined $HOME.
+ Thus RAND_file_name() is changed again: e_os.h can define a
+ DEFAULT_HOME, which will be used if $HOME is not set.
+ For Windows, we use "C:"; on other platforms, we still require
+ environment variables.
+
+ *) Move 'if (!initialized) RAND_poll()' into regions protected by
+ CRYPTO_LOCK_RAND. This is not strictly necessary, but avoids
+ having multiple threads call RAND_poll() concurrently.
+ [Bodo Moeller]
+
+ *) In crypto/rand/md_rand.c, replace 'add_do_not_lock' flag by a
+ combination of a flag and a thread ID variable.
+ Otherwise while one thread is in ssleay_rand_bytes (which sets the
+ flag), *other* threads can enter ssleay_add_bytes without obeying
+ the CRYPTO_LOCK_RAND lock (and may even illegally release the lock
+ that they do not hold after the first thread unsets add_do_not_lock).
+ [Bodo Moeller]
+
+ *) Change bctest again: '-x' expressions are not available in all
+ versions of 'test'.
+ [Bodo Moeller]
+
+ Changes between 0.9.6 and 0.9.6a [5 Apr 2001]
+
+ *) Fix a couple of memory leaks in PKCS7_dataDecode()
+ [Steve Henson, reported by Heyun Zheng <hzheng@atdsprint.com>]
+
+ *) Change Configure and Makefiles to provide EXE_EXT, which will contain
+ the default extension for executables, if any. Also, make the perl
+ scripts that use symlink() to test if it really exists and use "cp"
+ if it doesn't. All this made OpenSSL compilable and installable in
+ CygWin.
+ [Richard Levitte]
+
+ *) Fix for asn1_GetSequence() for indefinite length constructed data.
+ If SEQUENCE is length is indefinite just set c->slen to the total
+ amount of data available.
+ [Steve Henson, reported by shige@FreeBSD.org]
+ [This change does not apply to 0.9.7.]
+
+ *) Change bctest to avoid here-documents inside command substitution
+ (workaround for FreeBSD /bin/sh bug).
+ For compatibility with Ultrix, avoid shell functions (introduced
+ in the bctest version that searches along $PATH).
+ [Bodo Moeller]
+
+ *) Rename 'des_encrypt' to 'des_encrypt1'. This avoids the clashes
+ with des_encrypt() defined on some operating systems, like Solaris
+ and UnixWare.
+ [Richard Levitte]
+
+ *) Check the result of RSA-CRT (see D. Boneh, R. DeMillo, R. Lipton:
+ On the Importance of Eliminating Errors in Cryptographic
+ Computations, J. Cryptology 14 (2001) 2, 101-119,
+ http://theory.stanford.edu/~dabo/papers/faults.ps.gz).
+ [Ulf Moeller]
+
+ *) MIPS assembler BIGNUM division bug fix.
+ [Andy Polyakov]
+
+ *) Disabled incorrect Alpha assembler code.
+ [Richard Levitte]
+
+ *) Fix PKCS#7 decode routines so they correctly update the length
+ after reading an EOC for the EXPLICIT tag.
+ [Steve Henson]
+ [This change does not apply to 0.9.7.]
+
+ *) Fix bug in PKCS#12 key generation routines. This was triggered
+ if a 3DES key was generated with a 0 initial byte. Include
+ PKCS12_BROKEN_KEYGEN compilation option to retain the old
+ (but broken) behaviour.
+ [Steve Henson]
+
+ *) Enhance bctest to search for a working bc along $PATH and print
+ it when found.
+ [Tim Rice <tim@multitalents.net> via Richard Levitte]
+
+ *) Fix memory leaks in err.c: free err_data string if necessary;
+ don't write to the wrong index in ERR_set_error_data.
+ [Bodo Moeller]
+
+ *) Implement ssl23_peek (analogous to ssl23_read), which previously
+ did not exist.
+ [Bodo Moeller]
+
+ *) Replace rdtsc with _emit statements for VC++ version 5.
+ [Jeremy Cooper <jeremy@baymoo.org>]
+
+ *) Make it possible to reuse SSLv2 sessions.
+ [Richard Levitte]
+
+ *) In copy_email() check for >= 0 as a return value for
+ X509_NAME_get_index_by_NID() since 0 is a valid index.
+ [Steve Henson reported by Massimiliano Pala <madwolf@opensca.org>]
+
+ *) Avoid coredump with unsupported or invalid public keys by checking if
+ X509_get_pubkey() fails in PKCS7_verify(). Fix memory leak when
+ PKCS7_verify() fails with non detached data.
+ [Steve Henson]
+
+ *) Don't use getenv in library functions when run as setuid/setgid.
+ New function OPENSSL_issetugid().
+ [Ulf Moeller]
+
+ *) Avoid false positives in memory leak detection code (crypto/mem_dbg.c)
+ due to incorrect handling of multi-threading:
+
+ 1. Fix timing glitch in the MemCheck_off() portion of CRYPTO_mem_ctrl().
+
+ 2. Fix logical glitch in is_MemCheck_on() aka CRYPTO_is_mem_check_on().
+
+ 3. Count how many times MemCheck_off() has been called so that
+ nested use can be treated correctly. This also avoids
+ inband-signalling in the previous code (which relied on the
+ assumption that thread ID 0 is impossible).
+ [Bodo Moeller]
+
+ *) Add "-rand" option also to s_client and s_server.
+ [Lutz Jaenicke]
+
+ *) Fix CPU detection on Irix 6.x.
+ [Kurt Hockenbury <khockenb@stevens-tech.edu> and
+ "Bruce W. Forsberg" <bruce.forsberg@baesystems.com>]
+
+ *) Fix X509_NAME bug which produced incorrect encoding if X509_NAME
+ was empty.
+ [Steve Henson]
+ [This change does not apply to 0.9.7.]
+
+ *) Use the cached encoding of an X509_NAME structure rather than
+ copying it. This is apparently the reason for the libsafe "errors"
+ but the code is actually correct.
+ [Steve Henson]
+
+ *) Add new function BN_rand_range(), and fix DSA_sign_setup() to prevent
+ Bleichenbacher's DSA attack.
+ Extend BN_[pseudo_]rand: As before, top=1 forces the highest two bits
+ to be set and top=0 forces the highest bit to be set; top=-1 is new
+ and leaves the highest bit random.
+ [Ulf Moeller, Bodo Moeller]
+
+ *) In the NCONF_...-based implementations for CONF_... queries
+ (crypto/conf/conf_lib.c), if the input LHASH is NULL, avoid using
+ a temporary CONF structure with the data component set to NULL
+ (which gives segmentation faults in lh_retrieve).
+ Instead, use NULL for the CONF pointer in CONF_get_string and
+ CONF_get_number (which may use environment variables) and directly
+ return NULL from CONF_get_section.
+ [Bodo Moeller]
+
+ *) Fix potential buffer overrun for EBCDIC.
+ [Ulf Moeller]
+
+ *) Tolerate nonRepudiation as being valid for S/MIME signing and certSign
+ keyUsage if basicConstraints absent for a CA.
+ [Steve Henson]
+
+ *) Make SMIME_write_PKCS7() write mail header values with a format that
+ is more generally accepted (no spaces before the semicolon), since
+ some programs can't parse those values properly otherwise. Also make
+ sure BIO's that break lines after each write do not create invalid
+ headers.
+ [Richard Levitte]
+
+ *) Make the CRL encoding routines work with empty SEQUENCE OF. The
+ macros previously used would not encode an empty SEQUENCE OF
+ and break the signature.
+ [Steve Henson]
+ [This change does not apply to 0.9.7.]
+
+ *) Zero the premaster secret after deriving the master secret in
+ DH ciphersuites.
+ [Steve Henson]
+
+ *) Add some EVP_add_digest_alias registrations (as found in
+ OpenSSL_add_all_digests()) to SSL_library_init()
+ aka OpenSSL_add_ssl_algorithms(). This provides improved
+ compatibility with peers using X.509 certificates
+ with unconventional AlgorithmIdentifier OIDs.
+ [Bodo Moeller]
+
+ *) Fix for Irix with NO_ASM.
+ ["Bruce W. Forsberg" <bruce.forsberg@baesystems.com>]
+
+ *) ./config script fixes.
+ [Ulf Moeller, Richard Levitte]
+
+ *) Fix 'openssl passwd -1'.
+ [Bodo Moeller]
+
+ *) Change PKCS12_key_gen_asc() so it can cope with non null
+ terminated strings whose length is passed in the passlen
+ parameter, for example from PEM callbacks. This was done
+ by adding an extra length parameter to asc2uni().
+ [Steve Henson, reported by <oddissey@samsung.co.kr>]
+
+ *) Fix C code generated by 'openssl dsaparam -C': If a BN_bin2bn
+ call failed, free the DSA structure.
+ [Bodo Moeller]
+
+ *) Fix to uni2asc() to cope with zero length Unicode strings.
+ These are present in some PKCS#12 files.
+ [Steve Henson]
+
+ *) Increase s2->wbuf allocation by one byte in ssl2_new (ssl/s2_lib.c).
+ Otherwise do_ssl_write (ssl/s2_pkt.c) will write beyond buffer limits
+ when writing a 32767 byte record.
+ [Bodo Moeller; problem reported by Eric Day <eday@concentric.net>]
+
+ *) In RSA_eay_public_{en,ed}crypt and RSA_eay_mod_exp (rsa_eay.c),
+ obtain lock CRYPTO_LOCK_RSA before setting rsa->_method_mod_{n,p,q}.
+
+ (RSA objects have a reference count access to which is protected
+ by CRYPTO_LOCK_RSA [see rsa_lib.c, s3_srvr.c, ssl_cert.c, ssl_rsa.c],
+ so they are meant to be shared between threads.)
+ [Bodo Moeller, Geoff Thorpe; original patch submitted by
+ "Reddie, Steven" <Steven.Reddie@ca.com>]
+
+ *) Fix a deadlock in CRYPTO_mem_leaks().
+ [Bodo Moeller]
+
+ *) Use better test patterns in bntest.
+ [Ulf Möller]
+
+ *) rand_win.c fix for Borland C.
+ [Ulf Möller]
+
+ *) BN_rshift bugfix for n == 0.
+ [Bodo Moeller]
+
+ *) Add a 'bctest' script that checks for some known 'bc' bugs
+ so that 'make test' does not abort just because 'bc' is broken.
+ [Bodo Moeller]
+
+ *) Store verify_result within SSL_SESSION also for client side to
+ avoid potential security hole. (Re-used sessions on the client side
+ always resulted in verify_result==X509_V_OK, not using the original
+ result of the server certificate verification.)
+ [Lutz Jaenicke]
+
+ *) Fix ssl3_pending: If the record in s->s3->rrec is not of type
+ SSL3_RT_APPLICATION_DATA, return 0.
+ Similarly, change ssl2_pending to return 0 if SSL_in_init(s) is true.
+ [Bodo Moeller]
+
+ *) Fix SSL_peek:
+ Both ssl2_peek and ssl3_peek, which were totally broken in earlier
+ releases, have been re-implemented by renaming the previous
+ implementations of ssl2_read and ssl3_read to ssl2_read_internal
+ and ssl3_read_internal, respectively, and adding 'peek' parameters
+ to them. The new ssl[23]_{read,peek} functions are calls to
+ ssl[23]_read_internal with the 'peek' flag set appropriately.
+ A 'peek' parameter has also been added to ssl3_read_bytes, which
+ does the actual work for ssl3_read_internal.
+ [Bodo Moeller]
+
+ *) Initialise "ex_data" member of RSA/DSA/DH structures prior to calling
+ the method-specific "init()" handler. Also clean up ex_data after
+ calling the method-specific "finish()" handler. Previously, this was
+ happening the other way round.
+ [Geoff Thorpe]
+
+ *) Increase BN_CTX_NUM (the number of BIGNUMs in a BN_CTX) to 16.
+ The previous value, 12, was not always sufficient for BN_mod_exp().
+ [Bodo Moeller]
+
+ *) Make sure that shared libraries get the internal name engine with
+ the full version number and not just 0. This should mark the
+ shared libraries as not backward compatible. Of course, this should
+ be changed again when we can guarantee backward binary compatibility.
+ [Richard Levitte]
+
+ *) Fix typo in get_cert_by_subject() in by_dir.c
+ [Jean-Marc Desperrier <jean-marc.desperrier@certplus.com>]
+
+ *) Rework the system to generate shared libraries:
+
+ - Make note of the expected extension for the shared libraries and
+ if there is a need for symbolic links from for example libcrypto.so.0
+ to libcrypto.so.0.9.7. There is extended info in Configure for
+ that.
+
+ - Make as few rebuilds of the shared libraries as possible.
+
+ - Still avoid linking the OpenSSL programs with the shared libraries.
+
+ - When installing, install the shared libraries separately from the
+ static ones.
+ [Richard Levitte]
+
+ *) Fix SSL_CTX_set_read_ahead macro to actually use its argument.
+
+ Copy SSL_CTX's read_ahead flag to SSL object directly in SSL_new
+ and not in SSL_clear because the latter is also used by the
+ accept/connect functions; previously, the settings made by
+ SSL_set_read_ahead would be lost during the handshake.
+ [Bodo Moeller; problems reported by Anders Gertz <gertz@epact.se>]
+
+ *) Correct util/mkdef.pl to be selective about disabled algorithms.
+ Previously, it would create entries for disabled algorithms no
+ matter what.
+ [Richard Levitte]
+
+ *) Added several new manual pages for SSL_* function.
+ [Lutz Jaenicke]
+
+ Changes between 0.9.5a and 0.9.6 [24 Sep 2000]
+
+ *) In ssl23_get_client_hello, generate an error message when faced
+ with an initial SSL 3.0/TLS record that is too small to contain the
+ first two bytes of the ClientHello message, i.e. client_version.
+ (Note that this is a pathologic case that probably has never happened
+ in real life.) The previous approach was to use the version number
+ from the record header as a substitute; but our protocol choice
+ should not depend on that one because it is not authenticated
+ by the Finished messages.
+ [Bodo Moeller]
+
+ *) More robust randomness gathering functions for Windows.
+ [Jeffrey Altman <jaltman@columbia.edu>]
+
+ *) For compatibility reasons if the flag X509_V_FLAG_ISSUER_CHECK is
+ not set then we don't setup the error code for issuer check errors
+ to avoid possibly overwriting other errors which the callback does
+ handle. If an application does set the flag then we assume it knows
+ what it is doing and can handle the new informational codes
+ appropriately.
+ [Steve Henson]
+
+ *) Fix for a nasty bug in ASN1_TYPE handling. ASN1_TYPE is used for
+ a general "ANY" type, as such it should be able to decode anything
+ including tagged types. However it didn't check the class so it would
+ wrongly interpret tagged types in the same way as their universal
+ counterpart and unknown types were just rejected. Changed so that the
+ tagged and unknown types are handled in the same way as a SEQUENCE:
+ that is the encoding is stored intact. There is also a new type
+ "V_ASN1_OTHER" which is used when the class is not universal, in this
+ case we have no idea what the actual type is so we just lump them all
+ together.
+ [Steve Henson]
+
+ *) On VMS, stdout may very well lead to a file that is written to
+ in a record-oriented fashion. That means that every write() will
+ write a separate record, which will be read separately by the
+ programs trying to read from it. This can be very confusing.
+
+ The solution is to put a BIO filter in the way that will buffer
+ text until a linefeed is reached, and then write everything a
+ line at a time, so every record written will be an actual line,
+ not chunks of lines and not (usually doesn't happen, but I've
+ seen it once) several lines in one record. BIO_f_linebuffer() is
+ the answer.
+
+ Currently, it's a VMS-only method, because that's where it has
+ been tested well enough.
+ [Richard Levitte]
+
+ *) Remove 'optimized' squaring variant in BN_mod_mul_montgomery,
+ it can return incorrect results.
+ (Note: The buggy variant was not enabled in OpenSSL 0.9.5a,
+ but it was in 0.9.6-beta[12].)
+ [Bodo Moeller]
+
+ *) Disable the check for content being present when verifying detached
+ signatures in pk7_smime.c. Some versions of Netscape (wrongly)
+ include zero length content when signing messages.
+ [Steve Henson]
+
+ *) New BIO_shutdown_wr macro, which invokes the BIO_C_SHUTDOWN_WR
+ BIO_ctrl (for BIO pairs).
+ [Bodo Möller]
+
+ *) Add DSO method for VMS.
+ [Richard Levitte]
+
+ *) Bug fix: Montgomery multiplication could produce results with the
+ wrong sign.
+ [Ulf Möller]
+
+ *) Add RPM specification openssl.spec and modify it to build three
+ packages. The default package contains applications, application
+ documentation and run-time libraries. The devel package contains
+ include files, static libraries and function documentation. The
+ doc package contains the contents of the doc directory. The original
+ openssl.spec was provided by Damien Miller <djm@mindrot.org>.
+ [Richard Levitte]
+
+ *) Add a large number of documentation files for many SSL routines.
+ [Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>]
+
+ *) Add a configuration entry for Sony News 4.
+ [NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp>]
+
+ *) Don't set the two most significant bits to one when generating a
+ random number < q in the DSA library.
+ [Ulf Möller]
+
+ *) New SSL API mode 'SSL_MODE_AUTO_RETRY'. This disables the default
+ behaviour that SSL_read may result in SSL_ERROR_WANT_READ (even if
+ the underlying transport is blocking) if a handshake took place.
+ (The default behaviour is needed by applications such as s_client
+ and s_server that use select() to determine when to use SSL_read;
+ but for applications that know in advance when to expect data, it
+ just makes things more complicated.)
+ [Bodo Moeller]
+
+ *) Add RAND_egd_bytes(), which gives control over the number of bytes read
+ from EGD.
+ [Ben Laurie]
+
+ *) Add a few more EBCDIC conditionals that make `req' and `x509'
+ work better on such systems.
+ [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>]
+
+ *) Add two demo programs for PKCS12_parse() and PKCS12_create().
+ Update PKCS12_parse() so it copies the friendlyName and the
+ keyid to the certificates aux info.
+ [Steve Henson]
+
+ *) Fix bug in PKCS7_verify() which caused an infinite loop
+ if there was more than one signature.
+ [Sven Uszpelkat <su@celocom.de>]
+
+ *) Major change in util/mkdef.pl to include extra information
+ about each symbol, as well as presenting variables as well
+ as functions. This change means that there's n more need
+ to rebuild the .num files when some algorithms are excluded.
+ [Richard Levitte]
+
+ *) Allow the verify time to be set by an application,
+ rather than always using the current time.
+ [Steve Henson]
+
+ *) Phase 2 verify code reorganisation. The certificate
+ verify code now looks up an issuer certificate by a
+ number of criteria: subject name, authority key id
+ and key usage. It also verifies self signed certificates
+ by the same criteria. The main comparison function is
+ X509_check_issued() which performs these checks.
+
+ Lot of changes were necessary in order to support this
+ without completely rewriting the lookup code.
+
+ Authority and subject key identifier are now cached.
+
+ The LHASH 'certs' is X509_STORE has now been replaced
+ by a STACK_OF(X509_OBJECT). This is mainly because an
+ LHASH can't store or retrieve multiple objects with
+ the same hash value.
+
+ As a result various functions (which were all internal
+ use only) have changed to handle the new X509_STORE
+ structure. This will break anything that messed round
+ with X509_STORE internally.
+
+ The functions X509_STORE_add_cert() now checks for an
+ exact match, rather than just subject name.
+
+ The X509_STORE API doesn't directly support the retrieval
+ of multiple certificates matching a given criteria, however
+ this can be worked round by performing a lookup first
+ (which will fill the cache with candidate certificates)
+ and then examining the cache for matches. This is probably
+ the best we can do without throwing out X509_LOOKUP
+ entirely (maybe later...).
+
+ The X509_VERIFY_CTX structure has been enhanced considerably.
+
+ All certificate lookup operations now go via a get_issuer()
+ callback. Although this currently uses an X509_STORE it
+ can be replaced by custom lookups. This is a simple way
+ to bypass the X509_STORE hackery necessary to make this
+ work and makes it possible to use more efficient techniques
+ in future. A very simple version which uses a simple
+ STACK for its trusted certificate store is also provided
+ using X509_STORE_CTX_trusted_stack().
+
+ The verify_cb() and verify() callbacks now have equivalents
+ in the X509_STORE_CTX structure.
+
+ X509_STORE_CTX also has a 'flags' field which can be used
+ to customise the verify behaviour.
+ [Steve Henson]
+
+ *) Add new PKCS#7 signing option PKCS7_NOSMIMECAP which
+ excludes S/MIME capabilities.
+ [Steve Henson]
+
+ *) When a certificate request is read in keep a copy of the
+ original encoding of the signed data and use it when outputting
+ again. Signatures then use the original encoding rather than
+ a decoded, encoded version which may cause problems if the
+ request is improperly encoded.
+ [Steve Henson]
+
+ *) For consistency with other BIO_puts implementations, call
+ buffer_write(b, ...) directly in buffer_puts instead of calling
+ BIO_write(b, ...).
+
+ In BIO_puts, increment b->num_write as in BIO_write.
+ [Peter.Sylvester@EdelWeb.fr]
+
+ *) Fix BN_mul_word for the case where the word is 0. (We have to use
+ BN_zero, we may not return a BIGNUM with an array consisting of
+ words set to zero.)
+ [Bodo Moeller]
+
+ *) Avoid calling abort() from within the library when problems are
+ detected, except if preprocessor symbols have been defined
+ (such as REF_CHECK, BN_DEBUG etc.).
+ [Bodo Moeller]
+
+ *) New openssl application 'rsautl'. This utility can be
+ used for low level RSA operations. DER public key
+ BIO/fp routines also added.
+ [Steve Henson]
+
+ *) New Configure entry and patches for compiling on QNX 4.
+ [Andreas Schneider <andreas@ds3.etech.fh-hamburg.de>]
+
+ *) A demo state-machine implementation was sponsored by
+ Nuron (http://www.nuron.com/) and is now available in
+ demos/state_machine.
+ [Ben Laurie]
+
+ *) New options added to the 'dgst' utility for signature
+ generation and verification.
+ [Steve Henson]
+
+ *) Unrecognized PKCS#7 content types are now handled via a
+ catch all ASN1_TYPE structure. This allows unsupported
+ types to be stored as a "blob" and an application can
+ encode and decode it manually.
+ [Steve Henson]
+
+ *) Fix various signed/unsigned issues to make a_strex.c
+ compile under VC++.
+ [Oscar Jacobsson <oscar.jacobsson@celocom.com>]
+
+ *) ASN1 fixes. i2d_ASN1_OBJECT was not returning the correct
+ length if passed a buffer. ASN1_INTEGER_to_BN failed
+ if passed a NULL BN and its argument was negative.
+ [Steve Henson, pointed out by Sven Heiberg <sven@tartu.cyber.ee>]
+
+ *) Modification to PKCS#7 encoding routines to output definite
+ length encoding. Since currently the whole structures are in
+ memory there's not real point in using indefinite length
+ constructed encoding. However if OpenSSL is compiled with
+ the flag PKCS7_INDEFINITE_ENCODING the old form is used.
+ [Steve Henson]
+
+ *) Added BIO_vprintf() and BIO_vsnprintf().
+ [Richard Levitte]
+
+ *) Added more prefixes to parse for in the the strings written
+ through a logging bio, to cover all the levels that are available
+ through syslog. The prefixes are now:
+
+ PANIC, EMERG, EMR => LOG_EMERG
+ ALERT, ALR => LOG_ALERT
+ CRIT, CRI => LOG_CRIT
+ ERROR, ERR => LOG_ERR
+ WARNING, WARN, WAR => LOG_WARNING
+ NOTICE, NOTE, NOT => LOG_NOTICE
+ INFO, INF => LOG_INFO
+ DEBUG, DBG => LOG_DEBUG
+
+ and as before, if none of those prefixes are present at the
+ beginning of the string, LOG_ERR is chosen.
+
+ On Win32, the LOG_* levels are mapped according to this:
+
+ LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR => EVENTLOG_ERROR_TYPE
+ LOG_WARNING => EVENTLOG_WARNING_TYPE
+ LOG_NOTICE, LOG_INFO, LOG_DEBUG => EVENTLOG_INFORMATION_TYPE
+
+ [Richard Levitte]
+
+ *) Made it possible to reconfigure with just the configuration
+ argument "reconf" or "reconfigure". The command line arguments
+ are stored in Makefile.ssl in the variable CONFIGURE_ARGS,
+ and are retrieved from there when reconfiguring.
+ [Richard Levitte]
+
+ *) MD4 implemented.
+ [Assar Westerlund <assar@sics.se>, Richard Levitte]
+
+ *) Add the arguments -CAfile and -CApath to the pkcs12 utility.
+ [Richard Levitte]
+
+ *) The obj_dat.pl script was messing up the sorting of object
+ names. The reason was that it compared the quoted version
+ of strings as a result "OCSP" > "OCSP Signing" because
+ " > SPACE. Changed script to store unquoted versions of
+ names and add quotes on output. It was also omitting some
+ names from the lookup table if they were given a default
+ value (that is if SN is missing it is given the same
+ value as LN and vice versa), these are now added on the
+ grounds that if an object has a name we should be able to
+ look it up. Finally added warning output when duplicate
+ short or long names are found.
+ [Steve Henson]
+
+ *) Changes needed for Tandem NSK.
+ [Scott Uroff <scott@xypro.com>]
+
+ *) Fix SSL 2.0 rollback checking: Due to an off-by-one error in
+ RSA_padding_check_SSLv23(), special padding was never detected
+ and thus the SSL 3.0/TLS 1.0 countermeasure against protocol
+ version rollback attacks was not effective.
+
+ In s23_clnt.c, don't use special rollback-attack detection padding
+ (RSA_SSLV23_PADDING) if SSL 2.0 is the only protocol enabled in the
+ client; similarly, in s23_srvr.c, don't do the rollback check if
+ SSL 2.0 is the only protocol enabled in the server.
+ [Bodo Moeller]
+
+ *) Make it possible to get hexdumps of unprintable data with 'openssl
+ asn1parse'. By implication, the functions ASN1_parse_dump() and
+ BIO_dump_indent() are added.
+ [Richard Levitte]
+
+ *) New functions ASN1_STRING_print_ex() and X509_NAME_print_ex()
+ these print out strings and name structures based on various
+ flags including RFC2253 support and proper handling of
+ multibyte characters. Added options to the 'x509' utility
+ to allow the various flags to be set.
+ [Steve Henson]
+
+ *) Various fixes to use ASN1_TIME instead of ASN1_UTCTIME.
+ Also change the functions X509_cmp_current_time() and
+ X509_gmtime_adj() work with an ASN1_TIME structure,
+ this will enable certificates using GeneralizedTime in validity
+ dates to be checked.
+ [Steve Henson]
+
+ *) Make the NEG_PUBKEY_BUG code (which tolerates invalid
+ negative public key encodings) on by default,
+ NO_NEG_PUBKEY_BUG can be set to disable it.
+ [Steve Henson]
+
+ *) New function c2i_ASN1_OBJECT() which acts on ASN1_OBJECT
+ content octets. An i2c_ASN1_OBJECT is unnecessary because
+ the encoding can be trivially obtained from the structure.
+ [Steve Henson]
+
+ *) crypto/err.c locking bugfix: Use write locks (CRYPTO_w_[un]lock),
+ not read locks (CRYPTO_r_[un]lock).
+ [Bodo Moeller]
+
+ *) A first attempt at creating official support for shared
+ libraries through configuration. I've kept it so the
+ default is static libraries only, and the OpenSSL programs
+ are always statically linked for now, but there are
+ preparations for dynamic linking in place.
+ This has been tested on Linux and Tru64.
+ [Richard Levitte]
+
+ *) Randomness polling function for Win9x, as described in:
+ Peter Gutmann, Software Generation of Practically Strong
+ Random Numbers.
+ [Ulf Möller]
+
+ *) Fix so PRNG is seeded in req if using an already existing
+ DSA key.
+ [Steve Henson]
+
+ *) New options to smime application. -inform and -outform
+ allow alternative formats for the S/MIME message including
+ PEM and DER. The -content option allows the content to be
+ specified separately. This should allow things like Netscape
+ form signing output easier to verify.
+ [Steve Henson]
+
+ *) Fix the ASN1 encoding of tags using the 'long form'.
+ [Steve Henson]
+
+ *) New ASN1 functions, i2c_* and c2i_* for INTEGER and BIT
+ STRING types. These convert content octets to and from the
+ underlying type. The actual tag and length octets are
+ already assumed to have been read in and checked. These
+ are needed because all other string types have virtually
+ identical handling apart from the tag. By having versions
+ of the ASN1 functions that just operate on content octets
+ IMPLICIT tagging can be handled properly. It also allows
+ the ASN1_ENUMERATED code to be cut down because ASN1_ENUMERATED
+ and ASN1_INTEGER are identical apart from the tag.
+ [Steve Henson]
+
+ *) Change the handling of OID objects as follows:
+
+ - New object identifiers are inserted in objects.txt, following
+ the syntax given in objects.README.
+ - objects.pl is used to process obj_mac.num and create a new
+ obj_mac.h.
+ - obj_dat.pl is used to create a new obj_dat.h, using the data in
+ obj_mac.h.
+
+ This is currently kind of a hack, and the perl code in objects.pl
+ isn't very elegant, but it works as I intended. The simplest way
+ to check that it worked correctly is to look in obj_dat.h and
+ check the array nid_objs and make sure the objects haven't moved
+ around (this is important!). Additions are OK, as well as
+ consistent name changes.
+ [Richard Levitte]
+
+ *) Add BSD-style MD5-based passwords to 'openssl passwd' (option '-1').
+ [Bodo Moeller]
+
+ *) Addition of the command line parameter '-rand file' to 'openssl req'.
+ The given file adds to whatever has already been seeded into the
+ random pool through the RANDFILE configuration file option or
+ environment variable, or the default random state file.
+ [Richard Levitte]
+
+ *) mkstack.pl now sorts each macro group into lexical order.
+ Previously the output order depended on the order the files
+ appeared in the directory, resulting in needless rewriting
+ of safestack.h .
+ [Steve Henson]
+
+ *) Patches to make OpenSSL compile under Win32 again. Mostly
+ work arounds for the VC++ problem that it treats func() as
+ func(void). Also stripped out the parts of mkdef.pl that
+ added extra typesafe functions: these no longer exist.
+ [Steve Henson]
+
+ *) Reorganisation of the stack code. The macros are now all
+ collected in safestack.h . Each macro is defined in terms of
+ a "stack macro" of the form SKM_<name>(type, a, b). The
+ DEBUG_SAFESTACK is now handled in terms of function casts,
+ this has the advantage of retaining type safety without the
+ use of additional functions. If DEBUG_SAFESTACK is not defined
+ then the non typesafe macros are used instead. Also modified the
+ mkstack.pl script to handle the new form. Needs testing to see
+ if which (if any) compilers it chokes and maybe make DEBUG_SAFESTACK
+ the default if no major problems. Similar behaviour for ASN1_SET_OF
+ and PKCS12_STACK_OF.
+ [Steve Henson]
+
+ *) When some versions of IIS use the 'NET' form of private key the
+ key derivation algorithm is different. Normally MD5(password) is
+ used as a 128 bit RC4 key. In the modified case
+ MD5(MD5(password) + "SGCKEYSALT") is used instead. Added some
+ new functions i2d_RSA_NET(), d2i_RSA_NET() etc which are the same
+ as the old Netscape_RSA functions except they have an additional
+ 'sgckey' parameter which uses the modified algorithm. Also added
+ an -sgckey command line option to the rsa utility. Thanks to
+ Adrian Peck <bertie@ncipher.com> for posting details of the modified
+ algorithm to openssl-dev.
+ [Steve Henson]
+
+ *) The evp_local.h macros were using 'c.##kname' which resulted in
+ invalid expansion on some systems (SCO 5.0.5 for example).
+ Corrected to 'c.kname'.
+ [Phillip Porch <root@theporch.com>]
+
+ *) New X509_get1_email() and X509_REQ_get1_email() functions that return
+ a STACK of email addresses from a certificate or request, these look
+ in the subject name and the subject alternative name extensions and
+ omit any duplicate addresses.
+ [Steve Henson]
+
+ *) Re-implement BN_mod_exp2_mont using independent (and larger) windows.
+ This makes DSA verification about 2 % faster.
+ [Bodo Moeller]
+
+ *) Increase maximum window size in BN_mod_exp_... to 6 bits instead of 5
+ (meaning that now 2^5 values will be precomputed, which is only 4 KB
+ plus overhead for 1024 bit moduli).
+ This makes exponentiations about 0.5 % faster for 1024 bit
+ exponents (as measured by "openssl speed rsa2048").
+ [Bodo Moeller]
+
+ *) Rename memory handling macros to avoid conflicts with other
+ software:
+ Malloc => OPENSSL_malloc
+ Malloc_locked => OPENSSL_malloc_locked
+ Realloc => OPENSSL_realloc
+ Free => OPENSSL_free
+ [Richard Levitte]
+
+ *) New function BN_mod_exp_mont_word for small bases (roughly 15%
+ faster than BN_mod_exp_mont, i.e. 7% for a full DH exchange).
+ [Bodo Moeller]
+
+ *) CygWin32 support.
+ [John Jarvie <jjarvie@newsguy.com>]
+
+ *) The type-safe stack code has been rejigged. It is now only compiled
+ in when OpenSSL is configured with the DEBUG_SAFESTACK option and
+ by default all type-specific stack functions are "#define"d back to
+ standard stack functions. This results in more streamlined output
+ but retains the type-safety checking possibilities of the original
+ approach.
+ [Geoff Thorpe]
+
+ *) The STACK code has been cleaned up, and certain type declarations
+ that didn't make a lot of sense have been brought in line. This has
+ also involved a cleanup of sorts in safestack.h to more correctly
+ map type-safe stack functions onto their plain stack counterparts.
+ This work has also resulted in a variety of "const"ifications of
+ lots of the code, especially "_cmp" operations which should normally
+ be prototyped with "const" parameters anyway.
+ [Geoff Thorpe]
+
+ *) When generating bytes for the first time in md_rand.c, 'stir the pool'
+ by seeding with STATE_SIZE dummy bytes (with zero entropy count).
+ (The PRNG state consists of two parts, the large pool 'state' and 'md',
+ where all of 'md' is used each time the PRNG is used, but 'state'
+ is used only indexed by a cyclic counter. As entropy may not be
+ well distributed from the beginning, 'md' is important as a
+ chaining variable. However, the output function chains only half
+ of 'md', i.e. 80 bits. ssleay_rand_add, on the other hand, chains
+ all of 'md', and seeding with STATE_SIZE dummy bytes will result
+ in all of 'state' being rewritten, with the new values depending
+ on virtually all of 'md'. This overcomes the 80 bit limitation.)
+ [Bodo Moeller]
+
+ *) In ssl/s2_clnt.c and ssl/s3_clnt.c, call ERR_clear_error() when
+ the handshake is continued after ssl_verify_cert_chain();
+ otherwise, if SSL_VERIFY_NONE is set, remaining error codes
+ can lead to 'unexplainable' connection aborts later.
+ [Bodo Moeller; problem tracked down by Lutz Jaenicke]
+
+ *) Major EVP API cipher revision.
+ Add hooks for extra EVP features. This allows various cipher
+ parameters to be set in the EVP interface. Support added for variable
+ key length ciphers via the EVP_CIPHER_CTX_set_key_length() function and
+ setting of RC2 and RC5 parameters.
+
+ Modify EVP_OpenInit() and EVP_SealInit() to cope with variable key length
+ ciphers.
+
+ Remove lots of duplicated code from the EVP library. For example *every*
+ cipher init() function handles the 'iv' in the same way according to the
+ cipher mode. They also all do nothing if the 'key' parameter is NULL and
+ for CFB and OFB modes they zero ctx->num.
+
+ New functionality allows removal of S/MIME code RC2 hack.
+
+ Most of the routines have the same form and so can be declared in terms
+ of macros.
+
+ By shifting this to the top level EVP_CipherInit() it can be removed from
+ all individual ciphers. If the cipher wants to handle IVs or keys
+ differently it can set the EVP_CIPH_CUSTOM_IV or EVP_CIPH_ALWAYS_CALL_INIT
+ flags.
+
+ Change lots of functions like EVP_EncryptUpdate() to now return a
+ value: although software versions of the algorithms cannot fail
+ any installed hardware versions can.
+ [Steve Henson]
+
+ *) Implement SSL_OP_TLS_ROLLBACK_BUG: In ssl3_get_client_key_exchange, if
+ this option is set, tolerate broken clients that send the negotiated
+ protocol version number instead of the requested protocol version
+ number.
+ [Bodo Moeller]
+
+ *) Call dh_tmp_cb (set by ..._TMP_DH_CB) with correct 'is_export' flag;
+ i.e. non-zero for export ciphersuites, zero otherwise.
+ Previous versions had this flag inverted, inconsistent with
+ rsa_tmp_cb (..._TMP_RSA_CB).
+ [Bodo Moeller; problem reported by Amit Chopra]
+
+ *) Add missing DSA library text string. Work around for some IIS
+ key files with invalid SEQUENCE encoding.
+ [Steve Henson]
+
+ *) Add a document (doc/standards.txt) that list all kinds of standards
+ and so on that are implemented in OpenSSL.
+ [Richard Levitte]
+
+ *) Enhance c_rehash script. Old version would mishandle certificates
+ with the same subject name hash and wouldn't handle CRLs at all.
+ Added -fingerprint option to crl utility, to support new c_rehash
+ features.
+ [Steve Henson]
+
+ *) Eliminate non-ANSI declarations in crypto.h and stack.h.
+ [Ulf Möller]
+
+ *) Fix for SSL server purpose checking. Server checking was
+ rejecting certificates which had extended key usage present
+ but no ssl client purpose.
+ [Steve Henson, reported by Rene Grosser <grosser@hisolutions.com>]
+
+ *) Make PKCS#12 code work with no password. The PKCS#12 spec
+ is a little unclear about how a blank password is handled.
+ Since the password in encoded as a BMPString with terminating
+ double NULL a zero length password would end up as just the
+ double NULL. However no password at all is different and is
+ handled differently in the PKCS#12 key generation code. NS
+ treats a blank password as zero length. MSIE treats it as no
+ password on export: but it will try both on import. We now do
+ the same: PKCS12_parse() tries zero length and no password if
+ the password is set to "" or NULL (NULL is now a valid password:
+ it wasn't before) as does the pkcs12 application.
+ [Steve Henson]
+
+ *) Bugfixes in apps/x509.c: Avoid a memory leak; and don't use
+ perror when PEM_read_bio_X509_REQ fails, the error message must
+ be obtained from the error queue.
+ [Bodo Moeller]
+
+ *) Avoid 'thread_hash' memory leak in crypto/err/err.c by freeing
+ it in ERR_remove_state if appropriate, and change ERR_get_state
+ accordingly to avoid race conditions (this is necessary because
+ thread_hash is no longer constant once set).
+ [Bodo Moeller]
+
+ *) Bugfix for linux-elf makefile.one.
+ [Ulf Möller]
+
+ *) RSA_get_default_method() will now cause a default
+ RSA_METHOD to be chosen if one doesn't exist already.
+ Previously this was only set during a call to RSA_new()
+ or RSA_new_method(NULL) meaning it was possible for
+ RSA_get_default_method() to return NULL.
+ [Geoff Thorpe]
+
+ *) Added native name translation to the existing DSO code
+ that will convert (if the flag to do so is set) filenames
+ that are sufficiently small and have no path information
+ into a canonical native form. Eg. "blah" converted to
+ "libblah.so" or "blah.dll" etc.
+ [Geoff Thorpe]
+
+ *) New function ERR_error_string_n(e, buf, len) which is like
+ ERR_error_string(e, buf), but writes at most 'len' bytes
+ including the 0 terminator. For ERR_error_string_n, 'buf'
+ may not be NULL.
+ [Damien Miller <djm@mindrot.org>, Bodo Moeller]
+
+ *) CONF library reworked to become more general. A new CONF
+ configuration file reader "class" is implemented as well as a
+ new functions (NCONF_*, for "New CONF") to handle it. The now
+ old CONF_* functions are still there, but are reimplemented to
+ work in terms of the new functions. Also, a set of functions
+ to handle the internal storage of the configuration data is
+ provided to make it easier to write new configuration file
+ reader "classes" (I can definitely see something reading a
+ configuration file in XML format, for example), called _CONF_*,
+ or "the configuration storage API"...
+
+ The new configuration file reading functions are:
+
+ NCONF_new, NCONF_free, NCONF_load, NCONF_load_fp, NCONF_load_bio,
+ NCONF_get_section, NCONF_get_string, NCONF_get_numbre
+
+ NCONF_default, NCONF_WIN32
+
+ NCONF_dump_fp, NCONF_dump_bio
+
+ NCONF_default and NCONF_WIN32 are method (or "class") choosers,
+ NCONF_new creates a new CONF object. This works in the same way
+ as other interfaces in OpenSSL, like the BIO interface.
+ NCONF_dump_* dump the internal storage of the configuration file,
+ which is useful for debugging. All other functions take the same
+ arguments as the old CONF_* functions wth the exception of the
+ first that must be a `CONF *' instead of a `LHASH *'.
+
+ To make it easer to use the new classes with the old CONF_* functions,
+ the function CONF_set_default_method is provided.
+ [Richard Levitte]
+
+ *) Add '-tls1' option to 'openssl ciphers', which was already
+ mentioned in the documentation but had not been implemented.
+ (This option is not yet really useful because even the additional
+ experimental TLS 1.0 ciphers are currently treated as SSL 3.0 ciphers.)
+ [Bodo Moeller]
+
+ *) Initial DSO code added into libcrypto for letting OpenSSL (and
+ OpenSSL-based applications) load shared libraries and bind to
+ them in a portable way.
+ [Geoff Thorpe, with contributions from Richard Levitte]
+
+ Changes between 0.9.5 and 0.9.5a [1 Apr 2000]
+
+ *) Make sure _lrotl and _lrotr are only used with MSVC.
+
+ *) Use lock CRYPTO_LOCK_RAND correctly in ssleay_rand_status
+ (the default implementation of RAND_status).
+
+ *) Rename openssl x509 option '-crlext', which was added in 0.9.5,
+ to '-clrext' (= clear extensions), as intended and documented.
+ [Bodo Moeller; inconsistency pointed out by Michael Attili
+ <attili@amaxo.com>]
+
+ *) Fix for HMAC. It wasn't zeroing the rest of the block if the key length
+ was larger than the MD block size.
+ [Steve Henson, pointed out by Yost William <YostW@tce.com>]
+
+ *) Modernise PKCS12_parse() so it uses STACK_OF(X509) for its ca argument
+ fix a leak when the ca argument was passed as NULL. Stop X509_PUBKEY_set()
+ using the passed key: if the passed key was a private key the result
+ of X509_print(), for example, would be to print out all the private key
+ components.
+ [Steve Henson]
+
+ *) des_quad_cksum() byte order bug fix.
+ [Ulf Möller, using the problem description in krb4-0.9.7, where
+ the solution is attributed to Derrick J Brashear <shadow@DEMENTIA.ORG>]
+
+ *) Fix so V_ASN1_APP_CHOOSE works again: however its use is strongly
+ discouraged.
+ [Steve Henson, pointed out by Brian Korver <briank@cs.stanford.edu>]
+
+ *) For easily testing in shell scripts whether some command
+ 'openssl XXX' exists, the new pseudo-command 'openssl no-XXX'
+ returns with exit code 0 iff no command of the given name is available.
+ 'no-XXX' is printed in this case, 'XXX' otherwise. In both cases,
+ the output goes to stdout and nothing is printed to stderr.
+ Additional arguments are always ignored.
+
+ Since for each cipher there is a command of the same name,
+ the 'no-cipher' compilation switches can be tested this way.
+
+ ('openssl no-XXX' is not able to detect pseudo-commands such
+ as 'quit', 'list-XXX-commands', or 'no-XXX' itself.)
+ [Bodo Moeller]
+
+ *) Update test suite so that 'make test' succeeds in 'no-rsa' configuration.
+ [Bodo Moeller]
+
+ *) For SSL_[CTX_]set_tmp_dh, don't create a DH key if SSL_OP_SINGLE_DH_USE
+ is set; it will be thrown away anyway because each handshake creates
+ its own key.
+ ssl_cert_dup, which is used by SSL_new, now copies DH keys in addition
+ to parameters -- in previous versions (since OpenSSL 0.9.3) the
+ 'default key' from SSL_CTX_set_tmp_dh would always be lost, meaning
+ you effectivly got SSL_OP_SINGLE_DH_USE when using this macro.
+ [Bodo Moeller]
+
+ *) New s_client option -ign_eof: EOF at stdin is ignored, and
+ 'Q' and 'R' lose their special meanings (quit/renegotiate).
+ This is part of what -quiet does; unlike -quiet, -ign_eof
+ does not suppress any output.
+ [Richard Levitte]
+
+ *) Add compatibility options to the purpose and trust code. The
+ purpose X509_PURPOSE_ANY is "any purpose" which automatically
+ accepts a certificate or CA, this was the previous behaviour,
+ with all the associated security issues.
+
+ X509_TRUST_COMPAT is the old trust behaviour: only and
+ automatically trust self signed roots in certificate store. A
+ new trust setting X509_TRUST_DEFAULT is used to specify that
+ a purpose has no associated trust setting and it should instead
+ use the value in the default purpose.
+ [Steve Henson]
+
+ *) Fix the PKCS#8 DSA private key code so it decodes keys again
+ and fix a memory leak.
+ [Steve Henson]
+
+ *) In util/mkerr.pl (which implements 'make errors'), preserve
+ reason strings from the previous version of the .c file, as
+ the default to have only downcase letters (and digits) in
+ automatically generated reasons codes is not always appropriate.
+ [Bodo Moeller]
+
+ *) In ERR_load_ERR_strings(), build an ERR_LIB_SYS error reason table
+ using strerror. Previously, ERR_reason_error_string() returned
+ library names as reason strings for SYSerr; but SYSerr is a special
+ case where small numbers are errno values, not library numbers.
+ [Bodo Moeller]
+
+ *) Add '-dsaparam' option to 'openssl dhparam' application. This
+ converts DSA parameters into DH parameters. (When creating parameters,
+ DSA_generate_parameters is used.)
+ [Bodo Moeller]
+
+ *) Include 'length' (recommended exponent length) in C code generated
+ by 'openssl dhparam -C'.
+ [Bodo Moeller]
+
+ *) The second argument to set_label in perlasm was already being used
+ so couldn't be used as a "file scope" flag. Moved to third argument
+ which was free.
+ [Steve Henson]
+
+ *) In PEM_ASN1_write_bio and some other functions, use RAND_pseudo_bytes
+ instead of RAND_bytes for encryption IVs and salts.
+ [Bodo Moeller]
+
+ *) Include RAND_status() into RAND_METHOD instead of implementing
+ it only for md_rand.c Otherwise replacing the PRNG by calling
+ RAND_set_rand_method would be impossible.
+ [Bodo Moeller]
+
+ *) Don't let DSA_generate_key() enter an infinite loop if the random
+ number generation fails.
+ [Bodo Moeller]
+
+ *) New 'rand' application for creating pseudo-random output.
+ [Bodo Moeller]
+
+ *) Added configuration support for Linux/IA64
+ [Rolf Haberrecker <rolf@suse.de>]
+
+ *) Assembler module support for Mingw32.
+ [Ulf Möller]
+
+ *) Shared library support for HPUX (in shlib/).
+ [Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous]
+
+ *) Shared library support for Solaris gcc.
+ [Lutz Behnke <behnke@trustcenter.de>]
+
+ Changes between 0.9.4 and 0.9.5 [28 Feb 2000]
+
+ *) PKCS7_encrypt() was adding text MIME headers twice because they
+ were added manually and by SMIME_crlf_copy().
+ [Steve Henson]
+
+ *) In bntest.c don't call BN_rand with zero bits argument.
+ [Steve Henson, pointed out by Andrew W. Gray <agray@iconsinc.com>]
+
+ *) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n]
+ case was implemented. This caused BN_div_recp() to fail occasionally.
+ [Ulf Möller]
+
+ *) Add an optional second argument to the set_label() in the perl
+ assembly language builder. If this argument exists and is set
+ to 1 it signals that the assembler should use a symbol whose
+ scope is the entire file, not just the current function. This
+ is needed with MASM which uses the format label:: for this scope.
+ [Steve Henson, pointed out by Peter Runestig <peter@runestig.com>]
+
+ *) Change the ASN1 types so they are typedefs by default. Before
+ almost all types were #define'd to ASN1_STRING which was causing
+ STACK_OF() problems: you couldn't declare STACK_OF(ASN1_UTF8STRING)
+ for example.
+ [Steve Henson]
+
+ *) Change names of new functions to the new get1/get0 naming
+ convention: After 'get1', the caller owns a reference count
+ and has to call ..._free; 'get0' returns a pointer to some
+ data structure without incrementing reference counters.
+ (Some of the existing 'get' functions increment a reference
+ counter, some don't.)
+ Similarly, 'set1' and 'add1' functions increase reference
+ counters or duplicate objects.
+ [Steve Henson]
+
+ *) Allow for the possibility of temp RSA key generation failure:
+ the code used to assume it always worked and crashed on failure.
+ [Steve Henson]
+
+ *) Fix potential buffer overrun problem in BIO_printf().
+ [Ulf Möller, using public domain code by Patrick Powell; problem
+ pointed out by David Sacerdote <das33@cornell.edu>]
+
+ *) Support EGD <http://www.lothar.com/tech/crypto/>. New functions
+ RAND_egd() and RAND_status(). In the command line application,
+ the EGD socket can be specified like a seed file using RANDFILE
+ or -rand.
+ [Ulf Möller]
+
+ *) Allow the string CERTIFICATE to be tolerated in PKCS#7 structures.
+ Some CAs (e.g. Verisign) distribute certificates in this form.
+ [Steve Henson]
+
+ *) Remove the SSL_ALLOW_ADH compile option and set the default cipher
+ list to exclude them. This means that no special compilation option
+ is needed to use anonymous DH: it just needs to be included in the
+ cipher list.
+ [Steve Henson]
+
+ *) Change the EVP_MD_CTX_type macro so its meaning consistent with
+ EVP_MD_type. The old functionality is available in a new macro called
+ EVP_MD_md(). Change code that uses it and update docs.
+ [Steve Henson]
+
+ *) ..._ctrl functions now have corresponding ..._callback_ctrl functions
+ where the 'void *' argument is replaced by a function pointer argument.
+ Previously 'void *' was abused to point to functions, which works on
+ many platforms, but is not correct. As these functions are usually
+ called by macros defined in OpenSSL header files, most source code
+ should work without changes.
+ [Richard Levitte]
+
+ *) <openssl/opensslconf.h> (which is created by Configure) now contains
+ sections with information on -D... compiler switches used for
+ compiling the library so that applications can see them. To enable
+ one of these sections, a pre-processor symbol OPENSSL_..._DEFINES
+ must be defined. E.g.,
+ #define OPENSSL_ALGORITHM_DEFINES
+ #include <openssl/opensslconf.h>
+ defines all pertinent NO_<algo> symbols, such as NO_IDEA, NO_RSA, etc.
+ [Richard Levitte, Ulf and Bodo Möller]
+
+ *) Bugfix: Tolerate fragmentation and interleaving in the SSL 3/TLS
+ record layer.
+ [Bodo Moeller]
+
+ *) Change the 'other' type in certificate aux info to a STACK_OF
+ X509_ALGOR. Although not an AlgorithmIdentifier as such it has
+ the required ASN1 format: arbitrary types determined by an OID.
+ [Steve Henson]
+
+ *) Add some PEM_write_X509_REQ_NEW() functions and a command line
+ argument to 'req'. This is not because the function is newer or
+ better than others it just uses the work 'NEW' in the certificate
+ request header lines. Some software needs this.
+ [Steve Henson]
+
+ *) Reorganise password command line arguments: now passwords can be
+ obtained from various sources. Delete the PEM_cb function and make
+ it the default behaviour: i.e. if the callback is NULL and the
+ usrdata argument is not NULL interpret it as a null terminated pass
+ phrase. If usrdata and the callback are NULL then the pass phrase
+ is prompted for as usual.
+ [Steve Henson]
+
+ *) Add support for the Compaq Atalla crypto accelerator. If it is installed,
+ the support is automatically enabled. The resulting binaries will
+ autodetect the card and use it if present.
+ [Ben Laurie and Compaq Inc.]
+
+ *) Work around for Netscape hang bug. This sends certificate request
+ and server done in one record. Since this is perfectly legal in the
+ SSL/TLS protocol it isn't a "bug" option and is on by default. See
+ the bugs/SSLv3 entry for more info.
+ [Steve Henson]
+
+ *) HP-UX tune-up: new unified configs, HP C compiler bug workaround.
+ [Andy Polyakov]
+
+ *) Add -rand argument to smime and pkcs12 applications and read/write
+ of seed file.
+ [Steve Henson]
+
+ *) New 'passwd' tool for crypt(3) and apr1 password hashes.
+ [Bodo Moeller]
+
+ *) Add command line password options to the remaining applications.
+ [Steve Henson]
+
+ *) Bug fix for BN_div_recp() for numerators with an even number of
+ bits.
+ [Ulf Möller]
+
+ *) More tests in bntest.c, and changed test_bn output.
+ [Ulf Möller]
+
+ *) ./config recognizes MacOS X now.
+ [Andy Polyakov]
+
+ *) Bug fix for BN_div() when the first words of num and divsor are
+ equal (it gave wrong results if (rem=(n1-q*d0)&BN_MASK2) < d0).
+ [Ulf Möller]
+
+ *) Add support for various broken PKCS#8 formats, and command line
+ options to produce them.
+ [Steve Henson]
+
+ *) New functions BN_CTX_start(), BN_CTX_get() and BT_CTX_end() to
+ get temporary BIGNUMs from a BN_CTX.
+ [Ulf Möller]
+
+ *) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont()
+ for p == 0.
+ [Ulf Möller]
+
+ *) Change the SSLeay_add_all_*() functions to OpenSSL_add_all_*() and
+ include a #define from the old name to the new. The original intent
+ was that statically linked binaries could for example just call
+ SSLeay_add_all_ciphers() to just add ciphers to the table and not
+ link with digests. This never worked because SSLeay_add_all_digests()
+ and SSLeay_add_all_ciphers() were in the same source file so calling
+ one would link with the other. They are now in separate source files.
+ [Steve Henson]
+
+ *) Add a new -notext option to 'ca' and a -pubkey option to 'spkac'.
+ [Steve Henson]
+
+ *) Use a less unusual form of the Miller-Rabin primality test (it used
+ a binary algorithm for exponentiation integrated into the Miller-Rabin
+ loop, our standard modexp algorithms are faster).
+ [Bodo Moeller]
+
+ *) Support for the EBCDIC character set completed.
+ [Martin Kraemer <Martin.Kraemer@Mch.SNI.De>]
+
+ *) Source code cleanups: use const where appropriate, eliminate casts,
+ use void * instead of char * in lhash.
+ [Ulf Möller]
+
+ *) Bugfix: ssl3_send_server_key_exchange was not restartable
+ (the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of
+ this the server could overwrite ephemeral keys that the client
+ has already seen).
+ [Bodo Moeller]
+
+ *) Turn DSA_is_prime into a macro that calls BN_is_prime,
+ using 50 iterations of the Rabin-Miller test.
+
+ DSA_generate_parameters now uses BN_is_prime_fasttest (with 50
+ iterations of the Rabin-Miller test as required by the appendix
+ to FIPS PUB 186[-1]) instead of DSA_is_prime.
+ As BN_is_prime_fasttest includes trial division, DSA parameter
+ generation becomes much faster.
+
+ This implies a change for the callback functions in DSA_is_prime
+ and DSA_generate_parameters: The callback function is called once
+ for each positive witness in the Rabin-Miller test, not just
+ occasionally in the inner loop; and the parameters to the
+ callback function now provide an iteration count for the outer
+ loop rather than for the current invocation of the inner loop.
+ DSA_generate_parameters additionally can call the callback
+ function with an 'iteration count' of -1, meaning that a
+ candidate has passed the trial division test (when q is generated
+ from an application-provided seed, trial division is skipped).
+ [Bodo Moeller]
+
+ *) New function BN_is_prime_fasttest that optionally does trial
+ division before starting the Rabin-Miller test and has
+ an additional BN_CTX * argument (whereas BN_is_prime always
+ has to allocate at least one BN_CTX).
+ 'callback(1, -1, cb_arg)' is called when a number has passed the
+ trial division stage.
+ [Bodo Moeller]
+
+ *) Fix for bug in CRL encoding. The validity dates weren't being handled
+ as ASN1_TIME.
+ [Steve Henson]
+
+ *) New -pkcs12 option to CA.pl script to write out a PKCS#12 file.
+ [Steve Henson]
+
+ *) New function BN_pseudo_rand().
+ [Ulf Möller]
+
+ *) Clean up BN_mod_mul_montgomery(): replace the broken (and unreadable)
+ bignum version of BN_from_montgomery() with the working code from
+ SSLeay 0.9.0 (the word based version is faster anyway), and clean up
+ the comments.
+ [Ulf Möller]
+
+ *) Avoid a race condition in s2_clnt.c (function get_server_hello) that
+ made it impossible to use the same SSL_SESSION data structure in
+ SSL2 clients in multiple threads.
+ [Bodo Moeller]
+
+ *) The return value of RAND_load_file() no longer counts bytes obtained
+ by stat(). RAND_load_file(..., -1) is new and uses the complete file
+ to seed the PRNG (previously an explicit byte count was required).
+ [Ulf Möller, Bodo Möller]
+
+ *) Clean up CRYPTO_EX_DATA functions, some of these didn't have prototypes
+ used (char *) instead of (void *) and had casts all over the place.
+ [Steve Henson]
+
+ *) Make BN_generate_prime() return NULL on error if ret!=NULL.
+ [Ulf Möller]
+
+ *) Retain source code compatibility for BN_prime_checks macro:
+ BN_is_prime(..., BN_prime_checks, ...) now uses
+ BN_prime_checks_for_size to determine the appropriate number of
+ Rabin-Miller iterations.
+ [Ulf Möller]
+
+ *) Diffie-Hellman uses "safe" primes: DH_check() return code renamed to
+ DH_CHECK_P_NOT_SAFE_PRIME.
+ (Check if this is true? OpenPGP calls them "strong".)
+ [Ulf Möller]
+
+ *) Merge the functionality of "dh" and "gendh" programs into a new program
+ "dhparam". The old programs are retained for now but will handle DH keys
+ (instead of parameters) in future.
+ [Steve Henson]
+
+ *) Make the ciphers, s_server and s_client programs check the return values
+ when a new cipher list is set.
+ [Steve Henson]
+
+ *) Enhance the SSL/TLS cipher mechanism to correctly handle the TLS 56bit
+ ciphers. Before when the 56bit ciphers were enabled the sorting was
+ wrong.
+
+ The syntax for the cipher sorting has been extended to support sorting by
+ cipher-strength (using the strength_bits hard coded in the tables).
+ The new command is "@STRENGTH" (see also doc/apps/ciphers.pod).
+
+ Fix a bug in the cipher-command parser: when supplying a cipher command
+ string with an "undefined" symbol (neither command nor alphanumeric
+ [A-Za-z0-9], ssl_set_cipher_list used to hang in an endless loop. Now
+ an error is flagged.
+
+ Due to the strength-sorting extension, the code of the
+ ssl_create_cipher_list() function was completely rearranged. I hope that
+ the readability was also increased :-)
+ [Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE>]
+
+ *) Minor change to 'x509' utility. The -CAcreateserial option now uses 1
+ for the first serial number and places 2 in the serial number file. This
+ avoids problems when the root CA is created with serial number zero and
+ the first user certificate has the same issuer name and serial number
+ as the root CA.
+ [Steve Henson]
+
+ *) Fixes to X509_ATTRIBUTE utilities, change the 'req' program so it uses
+ the new code. Add documentation for this stuff.
+ [Steve Henson]
+
+ *) Changes to X509_ATTRIBUTE utilities. These have been renamed from
+ X509_*() to X509at_*() on the grounds that they don't handle X509
+ structures and behave in an analogous way to the X509v3 functions:
+ they shouldn't be called directly but wrapper functions should be used
+ instead.
+
+ So we also now have some wrapper functions that call the X509at functions
+ when passed certificate requests. (TO DO: similar things can be done with
+ PKCS#7 signed and unsigned attributes, PKCS#12 attributes and a few other
+ things. Some of these need some d2i or i2d and print functionality
+ because they handle more complex structures.)
+ [Steve Henson]
+
+ *) Add missing #ifndefs that caused missing symbols when building libssl
+ as a shared library without RSA. Use #ifndef NO_SSL2 instead of
+ NO_RSA in ssl/s2*.c.
+ [Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf Möller]
+
+ *) Precautions against using the PRNG uninitialized: RAND_bytes() now
+ has a return value which indicates the quality of the random data
+ (1 = ok, 0 = not seeded). Also an error is recorded on the thread's
+ error queue. New function RAND_pseudo_bytes() generates output that is
+ guaranteed to be unique but not unpredictable. RAND_add is like
+ RAND_seed, but takes an extra argument for an entropy estimate
+ (RAND_seed always assumes full entropy).
+ [Ulf Möller]
+
+ *) Do more iterations of Rabin-Miller probable prime test (specifically,
+ 3 for 1024-bit primes, 6 for 512-bit primes, 12 for 256-bit primes
+ instead of only 2 for all lengths; see BN_prime_checks_for_size definition
+ in crypto/bn/bn_prime.c for the complete table). This guarantees a
+ false-positive rate of at most 2^-80 for random input.
+ [Bodo Moeller]
+
+ *) Rewrite ssl3_read_n (ssl/s3_pkt.c) avoiding a couple of bugs.
+ [Bodo Moeller]
+
+ *) New function X509_CTX_rget_chain() (renamed to X509_CTX_get1_chain
+ in the 0.9.5 release), this returns the chain
+ from an X509_CTX structure with a dup of the stack and all
+ the X509 reference counts upped: so the stack will exist
+ after X509_CTX_cleanup() has been called. Modify pkcs12.c
+ to use this.
+
+ Also make SSL_SESSION_print() print out the verify return
+ code.
+ [Steve Henson]
+
+ *) Add manpage for the pkcs12 command. Also change the default
+ behaviour so MAC iteration counts are used unless the new
+ -nomaciter option is used. This improves file security and
+ only older versions of MSIE (4.0 for example) need it.
+ [Steve Henson]
+
+ *) Honor the no-xxx Configure options when creating .DEF files.
+ [Ulf Möller]
+
+ *) Add PKCS#10 attributes to field table: challengePassword,
+ unstructuredName and unstructuredAddress. These are taken from
+ draft PKCS#9 v2.0 but are compatible with v1.2 provided no
+ international characters are used.
+
+ More changes to X509_ATTRIBUTE code: allow the setting of types
+ based on strings. Remove the 'loc' parameter when adding
+ attributes because these will be a SET OF encoding which is sorted
+ in ASN1 order.
+ [Steve Henson]
+
+ *) Initial changes to the 'req' utility to allow request generation
+ automation. This will allow an application to just generate a template
+ file containing all the field values and have req construct the
+ request.
+
+ Initial support for X509_ATTRIBUTE handling. Stacks of these are
+ used all over the place including certificate requests and PKCS#7
+ structures. They are currently handled manually where necessary with
+ some primitive wrappers for PKCS#7. The new functions behave in a
+ manner analogous to the X509 extension functions: they allow
+ attributes to be looked up by NID and added.
+
+ Later something similar to the X509V3 code would be desirable to
+ automatically handle the encoding, decoding and printing of the
+ more complex types. The string types like challengePassword can
+ be handled by the string table functions.
+
+ Also modified the multi byte string table handling. Now there is
+ a 'global mask' which masks out certain types. The table itself
+ can use the flag STABLE_NO_MASK to ignore the mask setting: this
+ is useful when for example there is only one permissible type
+ (as in countryName) and using the mask might result in no valid
+ types at all.
+ [Steve Henson]
+
+ *) Clean up 'Finished' handling, and add functions SSL_get_finished and
+ SSL_get_peer_finished to allow applications to obtain the latest
+ Finished messages sent to the peer or expected from the peer,
+ respectively. (SSL_get_peer_finished is usually the Finished message
+ actually received from the peer, otherwise the protocol will be aborted.)
+
+ As the Finished message are message digests of the complete handshake
+ (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can
+ be used for external authentication procedures when the authentication
+ provided by SSL/TLS is not desired or is not enough.
+ [Bodo Moeller]
+
+ *) Enhanced support for Alpha Linux is added. Now ./config checks if
+ the host supports BWX extension and if Compaq C is present on the
+ $PATH. Just exploiting of the BWX extension results in 20-30%
+ performance kick for some algorithms, e.g. DES and RC4 to mention
+ a couple. Compaq C in turn generates ~20% faster code for MD5 and
+ SHA1.
+ [Andy Polyakov]
+
+ *) Add support for MS "fast SGC". This is arguably a violation of the
+ SSL3/TLS protocol. Netscape SGC does two handshakes: the first with
+ weak crypto and after checking the certificate is SGC a second one
+ with strong crypto. MS SGC stops the first handshake after receiving
+ the server certificate message and sends a second client hello. Since
+ a server will typically do all the time consuming operations before
+ expecting any further messages from the client (server key exchange
+ is the most expensive) there is little difference between the two.
+
+ To get OpenSSL to support MS SGC we have to permit a second client
+ hello message after we have sent server done. In addition we have to
+ reset the MAC if we do get this second client hello.
+ [Steve Henson]
+
+ *) Add a function 'd2i_AutoPrivateKey()' this will automatically decide
+ if a DER encoded private key is RSA or DSA traditional format. Changed
+ d2i_PrivateKey_bio() to use it. This is only needed for the "traditional"
+ format DER encoded private key. Newer code should use PKCS#8 format which
+ has the key type encoded in the ASN1 structure. Added DER private key
+ support to pkcs8 application.
+ [Steve Henson]
+
+ *) SSL 3/TLS 1 servers now don't request certificates when an anonymous
+ ciphersuites has been selected (as required by the SSL 3/TLS 1
+ specifications). Exception: When SSL_VERIFY_FAIL_IF_NO_PEER_CERT
+ is set, we interpret this as a request to violate the specification
+ (the worst that can happen is a handshake failure, and 'correct'
+ behaviour would result in a handshake failure anyway).
+ [Bodo Moeller]
+
+ *) In SSL_CTX_add_session, take into account that there might be multiple
+ SSL_SESSION structures with the same session ID (e.g. when two threads
+ concurrently obtain them from an external cache).
+ The internal cache can handle only one SSL_SESSION with a given ID,
+ so if there's a conflict, we now throw out the old one to achieve
+ consistency.
+ [Bodo Moeller]
+
+ *) Add OIDs for idea and blowfish in CBC mode. This will allow both
+ to be used in PKCS#5 v2.0 and S/MIME. Also add checking to
+ some routines that use cipher OIDs: some ciphers do not have OIDs
+ defined and so they cannot be used for S/MIME and PKCS#5 v2.0 for
+ example.
+ [Steve Henson]
+
+ *) Simplify the trust setting structure and code. Now we just have
+ two sequences of OIDs for trusted and rejected settings. These will
+ typically have values the same as the extended key usage extension
+ and any application specific purposes.
+
+ The trust checking code now has a default behaviour: it will just
+ check for an object with the same NID as the passed id. Functions can
+ be provided to override either the default behaviour or the behaviour
+ for a given id. SSL client, server and email already have functions
+ in place for compatibility: they check the NID and also return "trusted"
+ if the certificate is self signed.
+ [Steve Henson]
+
+ *) Add d2i,i2d bio/fp functions for PrivateKey: these convert the
+ traditional format into an EVP_PKEY structure.
+ [Steve Henson]
+
+ *) Add a password callback function PEM_cb() which either prompts for
+ a password if usr_data is NULL or otherwise assumes it is a null
+ terminated password. Allow passwords to be passed on command line
+ environment or config files in a few more utilities.
+ [Steve Henson]
+
+ *) Add a bunch of DER and PEM functions to handle PKCS#8 format private
+ keys. Add some short names for PKCS#8 PBE algorithms and allow them
+ to be specified on the command line for the pkcs8 and pkcs12 utilities.
+ Update documentation.
+ [Steve Henson]
+
+ *) Support for ASN1 "NULL" type. This could be handled before by using
+ ASN1_TYPE but there wasn't any function that would try to read a NULL
+ and produce an error if it couldn't. For compatibility we also have
+ ASN1_NULL_new() and ASN1_NULL_free() functions but these are faked and
+ don't allocate anything because they don't need to.
+ [Steve Henson]
+
+ *) Initial support for MacOS is now provided. Examine INSTALL.MacOS
+ for details.
+ [Andy Polyakov, Roy Woods <roy@centicsystems.ca>]
+
+ *) Rebuild of the memory allocation routines used by OpenSSL code and
+ possibly others as well. The purpose is to make an interface that
+ provide hooks so anyone can build a separate set of allocation and
+ deallocation routines to be used by OpenSSL, for example memory
+ pool implementations, or something else, which was previously hard
+ since Malloc(), Realloc() and Free() were defined as macros having
+ the values malloc, realloc and free, respectively (except for Win32
+ compilations). The same is provided for memory debugging code.
+ OpenSSL already comes with functionality to find memory leaks, but
+ this gives people a chance to debug other memory problems.
+
+ With these changes, a new set of functions and macros have appeared:
+
+ CRYPTO_set_mem_debug_functions() [F]
+ CRYPTO_get_mem_debug_functions() [F]
+ CRYPTO_dbg_set_options() [F]
+ CRYPTO_dbg_get_options() [F]
+ CRYPTO_malloc_debug_init() [M]
+
+ The memory debug functions are NULL by default, unless the library
+ is compiled with CRYPTO_MDEBUG or friends is defined. If someone
+ wants to debug memory anyway, CRYPTO_malloc_debug_init() (which
+ gives the standard debugging functions that come with OpenSSL) or
+ CRYPTO_set_mem_debug_functions() (tells OpenSSL to use functions
+ provided by the library user) must be used. When the standard
+ debugging functions are used, CRYPTO_dbg_set_options can be used to
+ request additional information:
+ CRYPTO_dbg_set_options(V_CYRPTO_MDEBUG_xxx) corresponds to setting
+ the CRYPTO_MDEBUG_xxx macro when compiling the library.
+
+ Also, things like CRYPTO_set_mem_functions will always give the
+ expected result (the new set of functions is used for allocation
+ and deallocation) at all times, regardless of platform and compiler
+ options.
+
+ To finish it up, some functions that were never use in any other
+ way than through macros have a new API and new semantic:
+
+ CRYPTO_dbg_malloc()
+ CRYPTO_dbg_realloc()
+ CRYPTO_dbg_free()
+
+ All macros of value have retained their old syntax.
+ [Richard Levitte and Bodo Moeller]
+
+ *) Some S/MIME fixes. The OID for SMIMECapabilities was wrong, the
+ ordering of SMIMECapabilities wasn't in "strength order" and there
+ was a missing NULL in the AlgorithmIdentifier for the SHA1 signature
+ algorithm.
+ [Steve Henson]
+
+ *) Some ASN1 types with illegal zero length encoding (INTEGER,
+ ENUMERATED and OBJECT IDENTIFIER) choked the ASN1 routines.
+ [Frans Heymans <fheymans@isaserver.be>, modified by Steve Henson]
+
+ *) Merge in my S/MIME library for OpenSSL. This provides a simple
+ S/MIME API on top of the PKCS#7 code, a MIME parser (with enough
+ functionality to handle multipart/signed properly) and a utility
+ called 'smime' to call all this stuff. This is based on code I
+ originally wrote for Celo who have kindly allowed it to be
+ included in OpenSSL.
+ [Steve Henson]
+
+ *) Add variants des_set_key_checked and des_set_key_unchecked of
+ des_set_key (aka des_key_sched). Global variable des_check_key
+ decides which of these is called by des_set_key; this way
+ des_check_key behaves as it always did, but applications and
+ the library itself, which was buggy for des_check_key == 1,
+ have a cleaner way to pick the version they need.
+ [Bodo Moeller]
+
+ *) New function PKCS12_newpass() which changes the password of a
+ PKCS12 structure.
+ [Steve Henson]
+
+ *) Modify X509_TRUST and X509_PURPOSE so it also uses a static and
+ dynamic mix. In both cases the ids can be used as an index into the
+ table. Also modified the X509_TRUST_add() and X509_PURPOSE_add()
+ functions so they accept a list of the field values and the
+ application doesn't need to directly manipulate the X509_TRUST
+ structure.
+ [Steve Henson]
+
+ *) Modify the ASN1_STRING_TABLE stuff so it also uses bsearch and doesn't
+ need initialising.
+ [Steve Henson]
+
+ *) Modify the way the V3 extension code looks up extensions. This now
+ works in a similar way to the object code: we have some "standard"
+ extensions in a static table which is searched with OBJ_bsearch()
+ and the application can add dynamic ones if needed. The file
+ crypto/x509v3/ext_dat.h now has the info: this file needs to be
+ updated whenever a new extension is added to the core code and kept
+ in ext_nid order. There is a simple program 'tabtest.c' which checks
+ this. New extensions are not added too often so this file can readily
+ be maintained manually.
+
+ There are two big advantages in doing things this way. The extensions
+ can be looked up immediately and no longer need to be "added" using
+ X509V3_add_standard_extensions(): this function now does nothing.
+ [Side note: I get *lots* of email saying the extension code doesn't
+ work because people forget to call this function]
+ Also no dynamic allocation is done unless new extensions are added:
+ so if we don't add custom extensions there is no need to call
+ X509V3_EXT_cleanup().
+ [Steve Henson]
+
+ *) Modify enc utility's salting as follows: make salting the default. Add a
+ magic header, so unsalted files fail gracefully instead of just decrypting
+ to garbage. This is because not salting is a big security hole, so people
+ should be discouraged from doing it.
+ [Ben Laurie]
+
+ *) Fixes and enhancements to the 'x509' utility. It allowed a message
+ digest to be passed on the command line but it only used this
+ parameter when signing a certificate. Modified so all relevant
+ operations are affected by the digest parameter including the
+ -fingerprint and -x509toreq options. Also -x509toreq choked if a
+ DSA key was used because it didn't fix the digest.
+ [Steve Henson]
+
+ *) Initial certificate chain verify code. Currently tests the untrusted
+ certificates for consistency with the verify purpose (which is set
+ when the X509_STORE_CTX structure is set up) and checks the pathlength.
+
+ There is a NO_CHAIN_VERIFY compilation option to keep the old behaviour:
+ this is because it will reject chains with invalid extensions whereas
+ every previous version of OpenSSL and SSLeay made no checks at all.
+
+ Trust code: checks the root CA for the relevant trust settings. Trust
+ settings have an initial value consistent with the verify purpose: e.g.
+ if the verify purpose is for SSL client use it expects the CA to be
+ trusted for SSL client use. However the default value can be changed to
+ permit custom trust settings: one example of this would be to only trust
+ certificates from a specific "secure" set of CAs.
+
+ Also added X509_STORE_CTX_new() and X509_STORE_CTX_free() functions
+ which should be used for version portability: especially since the
+ verify structure is likely to change more often now.
+
+ SSL integration. Add purpose and trust to SSL_CTX and SSL and functions
+ to set them. If not set then assume SSL clients will verify SSL servers
+ and vice versa.
+
+ Two new options to the verify program: -untrusted allows a set of
+ untrusted certificates to be passed in and -purpose which sets the
+ intended purpose of the certificate. If a purpose is set then the
+ new chain verify code is used to check extension consistency.
+ [Steve Henson]
+
+ *) Support for the authority information access extension.
+ [Steve Henson]
+
+ *) Modify RSA and DSA PEM read routines to transparently handle
+ PKCS#8 format private keys. New *_PUBKEY_* functions that handle
+ public keys in a format compatible with certificate
+ SubjectPublicKeyInfo structures. Unfortunately there were already
+ functions called *_PublicKey_* which used various odd formats so
+ these are retained for compatibility: however the DSA variants were
+ never in a public release so they have been deleted. Changed dsa/rsa
+ utilities to handle the new format: note no releases ever handled public
+ keys so we should be OK.
+
+ The primary motivation for this change is to avoid the same fiasco
+ that dogs private keys: there are several incompatible private key
+ formats some of which are standard and some OpenSSL specific and
+ require various evil hacks to allow partial transparent handling and
+ even then it doesn't work with DER formats. Given the option anything
+ other than PKCS#8 should be dumped: but the other formats have to
+ stay in the name of compatibility.
+
+ With public keys and the benefit of hindsight one standard format
+ is used which works with EVP_PKEY, RSA or DSA structures: though
+ it clearly returns an error if you try to read the wrong kind of key.
+
+ Added a -pubkey option to the 'x509' utility to output the public key.
+ Also rename the EVP_PKEY_get_*() to EVP_PKEY_rget_*()
+ (renamed to EVP_PKEY_get1_*() in the OpenSSL 0.9.5 release) and add
+ EVP_PKEY_rset_*() functions (renamed to EVP_PKEY_set1_*())
+ that do the same as the EVP_PKEY_assign_*() except they up the
+ reference count of the added key (they don't "swallow" the
+ supplied key).
+ [Steve Henson]
+
+ *) Fixes to crypto/x509/by_file.c the code to read in certificates and
+ CRLs would fail if the file contained no certificates or no CRLs:
+ added a new function to read in both types and return the number
+ read: this means that if none are read it will be an error. The
+ DER versions of the certificate and CRL reader would always fail
+ because it isn't possible to mix certificates and CRLs in DER format
+ without choking one or the other routine. Changed this to just read
+ a certificate: this is the best we can do. Also modified the code
+ in apps/verify.c to take notice of return codes: it was previously
+ attempting to read in certificates from NULL pointers and ignoring
+ any errors: this is one reason why the cert and CRL reader seemed
+ to work. It doesn't check return codes from the default certificate
+ routines: these may well fail if the certificates aren't installed.
+ [Steve Henson]
+
+ *) Code to support otherName option in GeneralName.
+ [Steve Henson]
+
+ *) First update to verify code. Change the verify utility
+ so it warns if it is passed a self signed certificate:
+ for consistency with the normal behaviour. X509_verify
+ has been modified to it will now verify a self signed
+ certificate if *exactly* the same certificate appears
+ in the store: it was previously impossible to trust a
+ single self signed certificate. This means that:
+ openssl verify ss.pem
+ now gives a warning about a self signed certificate but
+ openssl verify -CAfile ss.pem ss.pem
+ is OK.
+ [Steve Henson]
+
+ *) For servers, store verify_result in SSL_SESSION data structure
+ (and add it to external session representation).
+ This is needed when client certificate verifications fails,
+ but an application-provided verification callback (set by
+ SSL_CTX_set_cert_verify_callback) allows accepting the session
+ anyway (i.e. leaves x509_store_ctx->error != X509_V_OK
+ but returns 1): When the session is reused, we have to set
+ ssl->verify_result to the appropriate error code to avoid
+ security holes.
+ [Bodo Moeller, problem pointed out by Lutz Jaenicke]
+
+ *) Fix a bug in the new PKCS#7 code: it didn't consider the
+ case in PKCS7_dataInit() where the signed PKCS7 structure
+ didn't contain any existing data because it was being created.
+ [Po-Cheng Chen <pocheng@nst.com.tw>, slightly modified by Steve Henson]
+
+ *) Add a salt to the key derivation routines in enc.c. This
+ forms the first 8 bytes of the encrypted file. Also add a
+ -S option to allow a salt to be input on the command line.
+ [Steve Henson]
+
+ *) New function X509_cmp(). Oddly enough there wasn't a function
+ to compare two certificates. We do this by working out the SHA1
+ hash and comparing that. X509_cmp() will be needed by the trust
+ code.
+ [Steve Henson]
+
+ *) SSL_get1_session() is like SSL_get_session(), but increments
+ the reference count in the SSL_SESSION returned.
+ [Geoff Thorpe <geoff@eu.c2.net>]
+
+ *) Fix for 'req': it was adding a null to request attributes.
+ Also change the X509_LOOKUP and X509_INFO code to handle
+ certificate auxiliary information.
+ [Steve Henson]
+
+ *) Add support for 40 and 64 bit RC2 and RC4 algorithms: document
+ the 'enc' command.
+ [Steve Henson]
+
+ *) Add the possibility to add extra information to the memory leak
+ detecting output, to form tracebacks, showing from where each
+ allocation was originated: CRYPTO_push_info("constant string") adds
+ the string plus current file name and line number to a per-thread
+ stack, CRYPTO_pop_info() does the obvious, CRYPTO_remove_all_info()
+ is like calling CYRPTO_pop_info() until the stack is empty.
+ Also updated memory leak detection code to be multi-thread-safe.
+ [Richard Levitte]
+
+ *) Add options -text and -noout to pkcs7 utility and delete the
+ encryption options which never did anything. Update docs.
+ [Steve Henson]
+
+ *) Add options to some of the utilities to allow the pass phrase
+ to be included on either the command line (not recommended on
+ OSes like Unix) or read from the environment. Update the
+ manpages and fix a few bugs.
+ [Steve Henson]
+
+ *) Add a few manpages for some of the openssl commands.
+ [Steve Henson]
+
+ *) Fix the -revoke option in ca. It was freeing up memory twice,
+ leaking and not finding already revoked certificates.
+ [Steve Henson]
+
+ *) Extensive changes to support certificate auxiliary information.
+ This involves the use of X509_CERT_AUX structure and X509_AUX
+ functions. An X509_AUX function such as PEM_read_X509_AUX()
+ can still read in a certificate file in the usual way but it
+ will also read in any additional "auxiliary information". By
+ doing things this way a fair degree of compatibility can be
+ retained: existing certificates can have this information added
+ using the new 'x509' options.
+
+ Current auxiliary information includes an "alias" and some trust
+ settings. The trust settings will ultimately be used in enhanced
+ certificate chain verification routines: currently a certificate
+ can only be trusted if it is self signed and then it is trusted
+ for all purposes.
+ [Steve Henson]
+
+ *) Fix assembler for Alpha (tested only on DEC OSF not Linux or *BSD).
+ The problem was that one of the replacement routines had not been working
+ since SSLeay releases. For now the offending routine has been replaced
+ with non-optimised assembler. Even so, this now gives around 95%
+ performance improvement for 1024 bit RSA signs.
+ [Mark Cox]
+
+ *) Hack to fix PKCS#7 decryption when used with some unorthodox RC2
+ handling. Most clients have the effective key size in bits equal to
+ the key length in bits: so a 40 bit RC2 key uses a 40 bit (5 byte) key.
+ A few however don't do this and instead use the size of the decrypted key
+ to determine the RC2 key length and the AlgorithmIdentifier to determine
+ the effective key length. In this case the effective key length can still
+ be 40 bits but the key length can be 168 bits for example. This is fixed
+ by manually forcing an RC2 key into the EVP_PKEY structure because the
+ EVP code can't currently handle unusual RC2 key sizes: it always assumes
+ the key length and effective key length are equal.
+ [Steve Henson]
+
+ *) Add a bunch of functions that should simplify the creation of
+ X509_NAME structures. Now you should be able to do:
+ X509_NAME_add_entry_by_txt(nm, "CN", MBSTRING_ASC, "Steve", -1, -1, 0);
+ and have it automatically work out the correct field type and fill in
+ the structures. The more adventurous can try:
+ X509_NAME_add_entry_by_txt(nm, field, MBSTRING_UTF8, str, -1, -1, 0);
+ and it will (hopefully) work out the correct multibyte encoding.
+ [Steve Henson]
+
+ *) Change the 'req' utility to use the new field handling and multibyte
+ copy routines. Before the DN field creation was handled in an ad hoc
+ way in req, ca, and x509 which was rather broken and didn't support
+ BMPStrings or UTF8Strings. Since some software doesn't implement
+ BMPStrings or UTF8Strings yet, they can be enabled using the config file
+ using the dirstring_type option. See the new comment in the default
+ openssl.cnf for more info.
+ [Steve Henson]
+
+ *) Make crypto/rand/md_rand.c more robust:
+ - Assure unique random numbers after fork().
+ - Make sure that concurrent threads access the global counter and
+ md serializably so that we never lose entropy in them
+ or use exactly the same state in multiple threads.
+ Access to the large state is not always serializable because
+ the additional locking could be a performance killer, and
+ md should be large enough anyway.
+ [Bodo Moeller]
+
+ *) New file apps/app_rand.c with commonly needed functionality
+ for handling the random seed file.
+
+ Use the random seed file in some applications that previously did not:
+ ca,
+ dsaparam -genkey (which also ignored its '-rand' option),
+ s_client,
+ s_server,
+ x509 (when signing).
+ Except on systems with /dev/urandom, it is crucial to have a random
+ seed file at least for key creation, DSA signing, and for DH exchanges;
+ for RSA signatures we could do without one.
+
+ gendh and gendsa (unlike genrsa) used to read only the first byte
+ of each file listed in the '-rand' option. The function as previously
+ found in genrsa is now in app_rand.c and is used by all programs
+ that support '-rand'.
+ [Bodo Moeller]
+
+ *) In RAND_write_file, use mode 0600 for creating files;
+ don't just chmod when it may be too late.
+ [Bodo Moeller]
+
+ *) Report an error from X509_STORE_load_locations
+ when X509_LOOKUP_load_file or X509_LOOKUP_add_dir failed.
+ [Bill Perry]
+
+ *) New function ASN1_mbstring_copy() this copies a string in either
+ ASCII, Unicode, Universal (4 bytes per character) or UTF8 format
+ into an ASN1_STRING type. A mask of permissible types is passed
+ and it chooses the "minimal" type to use or an error if not type
+ is suitable.
+ [Steve Henson]
+
+ *) Add function equivalents to the various macros in asn1.h. The old
+ macros are retained with an M_ prefix. Code inside the library can
+ use the M_ macros. External code (including the openssl utility)
+ should *NOT* in order to be "shared library friendly".
+ [Steve Henson]
+
+ *) Add various functions that can check a certificate's extensions
+ to see if it usable for various purposes such as SSL client,
+ server or S/MIME and CAs of these types. This is currently
+ VERY EXPERIMENTAL but will ultimately be used for certificate chain
+ verification. Also added a -purpose flag to x509 utility to
+ print out all the purposes.
+ [Steve Henson]
+
+ *) Add a CRYPTO_EX_DATA to X509 certificate structure and associated
+ functions.
+ [Steve Henson]
+
+ *) New X509V3_{X509,CRL,REVOKED}_get_d2i() functions. These will search
+ for, obtain and decode and extension and obtain its critical flag.
+ This allows all the necessary extension code to be handled in a
+ single function call.
+ [Steve Henson]
+
+ *) RC4 tune-up featuring 30-40% performance improvement on most RISC
+ platforms. See crypto/rc4/rc4_enc.c for further details.
+ [Andy Polyakov]
+
+ *) New -noout option to asn1parse. This causes no output to be produced
+ its main use is when combined with -strparse and -out to extract data
+ from a file (which may not be in ASN.1 format).
+ [Steve Henson]
+
+ *) Fix for pkcs12 program. It was hashing an invalid certificate pointer
+ when producing the local key id.
+ [Richard Levitte <levitte@stacken.kth.se>]
+
+ *) New option -dhparam in s_server. This allows a DH parameter file to be
+ stated explicitly. If it is not stated then it tries the first server
+ certificate file. The previous behaviour hard coded the filename
+ "server.pem".
+ [Steve Henson]
+
+ *) Add -pubin and -pubout options to the rsa and dsa commands. These allow
+ a public key to be input or output. For example:
+ openssl rsa -in key.pem -pubout -out pubkey.pem
+ Also added necessary DSA public key functions to handle this.
+ [Steve Henson]
+
+ *) Fix so PKCS7_dataVerify() doesn't crash if no certificates are contained
+ in the message. This was handled by allowing
+ X509_find_by_issuer_and_serial() to tolerate a NULL passed to it.
+ [Steve Henson, reported by Sampo Kellomaki <sampo@mail.neuronio.pt>]
+
+ *) Fix for bug in d2i_ASN1_bytes(): other ASN1 functions add an extra null
+ to the end of the strings whereas this didn't. This would cause problems
+ if strings read with d2i_ASN1_bytes() were later modified.
+ [Steve Henson, reported by Arne Ansper <arne@ats.cyber.ee>]
+
+ *) Fix for base64 decode bug. When a base64 bio reads only one line of
+ data and it contains EOF it will end up returning an error. This is
+ caused by input 46 bytes long. The cause is due to the way base64
+ BIOs find the start of base64 encoded data. They do this by trying a
+ trial decode on each line until they find one that works. When they
+ do a flag is set and it starts again knowing it can pass all the
+ data directly through the decoder. Unfortunately it doesn't reset
+ the context it uses. This means that if EOF is reached an attempt
+ is made to pass two EOFs through the context and this causes the
+ resulting error. This can also cause other problems as well. As is
+ usual with these problems it takes *ages* to find and the fix is
+ trivial: move one line.
+ [Steve Henson, reported by ian@uns.ns.ac.yu (Ivan Nejgebauer) ]
+
+ *) Ugly workaround to get s_client and s_server working under Windows. The
+ old code wouldn't work because it needed to select() on sockets and the
+ tty (for keypresses and to see if data could be written). Win32 only
+ supports select() on sockets so we select() with a 1s timeout on the
+ sockets and then see if any characters are waiting to be read, if none
+ are present then we retry, we also assume we can always write data to
+ the tty. This isn't nice because the code then blocks until we've
+ received a complete line of data and it is effectively polling the
+ keyboard at 1s intervals: however it's quite a bit better than not
+ working at all :-) A dedicated Windows application might handle this
+ with an event loop for example.
+ [Steve Henson]
+
+ *) Enhance RSA_METHOD structure. Now there are two extra methods, rsa_sign
+ and rsa_verify. When the RSA_FLAGS_SIGN_VER option is set these functions
+ will be called when RSA_sign() and RSA_verify() are used. This is useful
+ if rsa_pub_dec() and rsa_priv_enc() equivalents are not available.
+ For this to work properly RSA_public_decrypt() and RSA_private_encrypt()
+ should *not* be used: RSA_sign() and RSA_verify() must be used instead.
+ This necessitated the support of an extra signature type NID_md5_sha1
+ for SSL signatures and modifications to the SSL library to use it instead
+ of calling RSA_public_decrypt() and RSA_private_encrypt().
+ [Steve Henson]
+
+ *) Add new -verify -CAfile and -CApath options to the crl program, these
+ will lookup a CRL issuers certificate and verify the signature in a
+ similar way to the verify program. Tidy up the crl program so it
+ no longer accesses structures directly. Make the ASN1 CRL parsing a bit
+ less strict. It will now permit CRL extensions even if it is not
+ a V2 CRL: this will allow it to tolerate some broken CRLs.
+ [Steve Henson]
+
+ *) Initialize all non-automatic variables each time one of the openssl
+ sub-programs is started (this is necessary as they may be started
+ multiple times from the "OpenSSL>" prompt).
+ [Lennart Bang, Bodo Moeller]
+
+ *) Preliminary compilation option RSA_NULL which disables RSA crypto without
+ removing all other RSA functionality (this is what NO_RSA does). This
+ is so (for example) those in the US can disable those operations covered
+ by the RSA patent while allowing storage and parsing of RSA keys and RSA
+ key generation.
+ [Steve Henson]
+
+ *) Non-copying interface to BIO pairs.
+ (still largely untested)
+ [Bodo Moeller]
+
+ *) New function ANS1_tag2str() to convert an ASN1 tag to a descriptive
+ ASCII string. This was handled independently in various places before.
+ [Steve Henson]
+
+ *) New functions UTF8_getc() and UTF8_putc() that parse and generate
+ UTF8 strings a character at a time.
+ [Steve Henson]
+
+ *) Use client_version from client hello to select the protocol
+ (s23_srvr.c) and for RSA client key exchange verification
+ (s3_srvr.c), as required by the SSL 3.0/TLS 1.0 specifications.
+ [Bodo Moeller]
+
+ *) Add various utility functions to handle SPKACs, these were previously
+ handled by poking round in the structure internals. Added new function
+ NETSCAPE_SPKI_print() to print out SPKAC and a new utility 'spkac' to
+ print, verify and generate SPKACs. Based on an original idea from
+ Massimiliano Pala <madwolf@comune.modena.it> but extensively modified.
+ [Steve Henson]
+
+ *) RIPEMD160 is operational on all platforms and is back in 'make test'.
+ [Andy Polyakov]
+
+ *) Allow the config file extension section to be overwritten on the
+ command line. Based on an original idea from Massimiliano Pala
+ <madwolf@comune.modena.it>. The new option is called -extensions
+ and can be applied to ca, req and x509. Also -reqexts to override
+ the request extensions in req and -crlexts to override the crl extensions
+ in ca.
+ [Steve Henson]
+
+ *) Add new feature to the SPKAC handling in ca. Now you can include
+ the same field multiple times by preceding it by "XXXX." for example:
+ 1.OU="Unit name 1"
+ 2.OU="Unit name 2"
+ this is the same syntax as used in the req config file.
+ [Steve Henson]
+
+ *) Allow certificate extensions to be added to certificate requests. These
+ are specified in a 'req_extensions' option of the req section of the
+ config file. They can be printed out with the -text option to req but
+ are otherwise ignored at present.
+ [Steve Henson]
+
+ *) Fix a horrible bug in enc_read() in crypto/evp/bio_enc.c: if the first
+ data read consists of only the final block it would not decrypted because
+ EVP_CipherUpdate() would correctly report zero bytes had been decrypted.
+ A misplaced 'break' also meant the decrypted final block might not be
+ copied until the next read.
+ [Steve Henson]
+
+ *) Initial support for DH_METHOD. Again based on RSA_METHOD. Also added
+ a few extra parameters to the DH structure: these will be useful if
+ for example we want the value of 'q' or implement X9.42 DH.
+ [Steve Henson]
+
+ *) Initial support for DSA_METHOD. This is based on the RSA_METHOD and
+ provides hooks that allow the default DSA functions or functions on a
+ "per key" basis to be replaced. This allows hardware acceleration and
+ hardware key storage to be handled without major modification to the
+ library. Also added low level modexp hooks and CRYPTO_EX structure and
+ associated functions.
+ [Steve Henson]
+
+ *) Add a new flag to memory BIOs, BIO_FLAG_MEM_RDONLY. This marks the BIO
+ as "read only": it can't be written to and the buffer it points to will
+ not be freed. Reading from a read only BIO is much more efficient than
+ a normal memory BIO. This was added because there are several times when
+ an area of memory needs to be read from a BIO. The previous method was
+ to create a memory BIO and write the data to it, this results in two
+ copies of the data and an O(n^2) reading algorithm. There is a new
+ function BIO_new_mem_buf() which creates a read only memory BIO from
+ an area of memory. Also modified the PKCS#7 routines to use read only
+ memory BIOs.
+ [Steve Henson]
+
+ *) Bugfix: ssl23_get_client_hello did not work properly when called in
+ state SSL23_ST_SR_CLNT_HELLO_B, i.e. when the first 7 bytes of
+ a SSLv2-compatible client hello for SSLv3 or TLSv1 could be read,
+ but a retry condition occurred while trying to read the rest.
+ [Bodo Moeller]
+
+ *) The PKCS7_ENC_CONTENT_new() function was setting the content type as
+ NID_pkcs7_encrypted by default: this was wrong since this should almost
+ always be NID_pkcs7_data. Also modified the PKCS7_set_type() to handle
+ the encrypted data type: this is a more sensible place to put it and it
+ allows the PKCS#12 code to be tidied up that duplicated this
+ functionality.
+ [Steve Henson]
+
+ *) Changed obj_dat.pl script so it takes its input and output files on
+ the command line. This should avoid shell escape redirection problems
+ under Win32.
+ [Steve Henson]
+
+ *) Initial support for certificate extension requests, these are included
+ in things like Xenroll certificate requests. Included functions to allow
+ extensions to be obtained and added.
+ [Steve Henson]
+
+ *) -crlf option to s_client and s_server for sending newlines as
+ CRLF (as required by many protocols).
+ [Bodo Moeller]
+
+ Changes between 0.9.3a and 0.9.4 [09 Aug 1999]
+
+ *) Install libRSAglue.a when OpenSSL is built with RSAref.
+ [Ralf S. Engelschall]
+
+ *) A few more ``#ifndef NO_FP_API / #endif'' pairs for consistency.
+ [Andrija Antonijevic <TheAntony2@bigfoot.com>]
+
+ *) Fix -startdate and -enddate (which was missing) arguments to 'ca'
+ program.
+ [Steve Henson]
+
+ *) New function DSA_dup_DH, which duplicates DSA parameters/keys as
+ DH parameters/keys (q is lost during that conversion, but the resulting
+ DH parameters contain its length).
+
+ For 1024-bit p, DSA_generate_parameters followed by DSA_dup_DH is
+ much faster than DH_generate_parameters (which creates parameters
+ where p = 2*q + 1), and also the smaller q makes DH computations
+ much more efficient (160-bit exponentiation instead of 1024-bit
+ exponentiation); so this provides a convenient way to support DHE
+ ciphersuites in SSL/TLS servers (see ssl/ssltest.c). It is of
+ utter importance to use
+ SSL_CTX_set_options(s_ctx, SSL_OP_SINGLE_DH_USE);
+ or
+ SSL_set_options(s_ctx, SSL_OP_SINGLE_DH_USE);
+ when such DH parameters are used, because otherwise small subgroup
+ attacks may become possible!
+ [Bodo Moeller]
+
+ *) Avoid memory leak in i2d_DHparams.
+ [Bodo Moeller]
+
+ *) Allow the -k option to be used more than once in the enc program:
+ this allows the same encrypted message to be read by multiple recipients.
+ [Steve Henson]
+
+ *) New function OBJ_obj2txt(buf, buf_len, a, no_name), this converts
+ an ASN1_OBJECT to a text string. If the "no_name" parameter is set then
+ it will always use the numerical form of the OID, even if it has a short
+ or long name.
+ [Steve Henson]
+
+ *) Added an extra RSA flag: RSA_FLAG_EXT_PKEY. Previously the rsa_mod_exp
+ method only got called if p,q,dmp1,dmq1,iqmp components were present,
+ otherwise bn_mod_exp was called. In the case of hardware keys for example
+ no private key components need be present and it might store extra data
+ in the RSA structure, which cannot be accessed from bn_mod_exp.
+ By setting RSA_FLAG_EXT_PKEY rsa_mod_exp will always be called for
+ private key operations.
+ [Steve Henson]
+
+ *) Added support for SPARC Linux.
+ [Andy Polyakov]
+
+ *) pem_password_cb function type incompatibly changed from
+ typedef int pem_password_cb(char *buf, int size, int rwflag);
+ to
+ ....(char *buf, int size, int rwflag, void *userdata);
+ so that applications can pass data to their callbacks:
+ The PEM[_ASN1]_{read,write}... functions and macros now take an
+ additional void * argument, which is just handed through whenever
+ the password callback is called.
+ [Damien Miller <dmiller@ilogic.com.au>; tiny changes by Bodo Moeller]
+
+ New function SSL_CTX_set_default_passwd_cb_userdata.
+
+ Compatibility note: As many C implementations push function arguments
+ onto the stack in reverse order, the new library version is likely to
+ interoperate with programs that have been compiled with the old
+ pem_password_cb definition (PEM_whatever takes some data that
+ happens to be on the stack as its last argument, and the callback
+ just ignores this garbage); but there is no guarantee whatsoever that
+ this will work.
+
+ *) The -DPLATFORM="\"$(PLATFORM)\"" definition and the similar -DCFLAGS=...
+ (both in crypto/Makefile.ssl for use by crypto/cversion.c) caused
+ problems not only on Windows, but also on some Unix platforms.
+ To avoid problematic command lines, these definitions are now in an
+ auto-generated file crypto/buildinf.h (created by crypto/Makefile.ssl
+ for standard "make" builds, by util/mk1mf.pl for "mk1mf" builds).
+ [Bodo Moeller]
+
+ *) MIPS III/IV assembler module is reimplemented.
+ [Andy Polyakov]
+
+ *) More DES library cleanups: remove references to srand/rand and
+ delete an unused file.
+ [Ulf Möller]
+
+ *) Add support for the the free Netwide assembler (NASM) under Win32,
+ since not many people have MASM (ml) and it can be hard to obtain.
+ This is currently experimental but it seems to work OK and pass all
+ the tests. Check out INSTALL.W32 for info.
+ [Steve Henson]
+
+ *) Fix memory leaks in s3_clnt.c: All non-anonymous SSL3/TLS1 connections
+ without temporary keys kept an extra copy of the server key,
+ and connections with temporary keys did not free everything in case
+ of an error.
+ [Bodo Moeller]
+
+ *) New function RSA_check_key and new openssl rsa option -check
+ for verifying the consistency of RSA keys.
+ [Ulf Moeller, Bodo Moeller]
+
+ *) Various changes to make Win32 compile work:
+ 1. Casts to avoid "loss of data" warnings in p5_crpt2.c
+ 2. Change unsigned int to int in b_dump.c to avoid "signed/unsigned
+ comparison" warnings.
+ 3. Add sk_<TYPE>_sort to DEF file generator and do make update.
+ [Steve Henson]
+
+ *) Add a debugging option to PKCS#5 v2 key generation function: when
+ you #define DEBUG_PKCS5V2 passwords, salts, iteration counts and
+ derived keys are printed to stderr.
+ [Steve Henson]
+
+ *) Copy the flags in ASN1_STRING_dup().
+ [Roman E. Pavlov <pre@mo.msk.ru>]
+
+ *) The x509 application mishandled signing requests containing DSA
+ keys when the signing key was also DSA and the parameters didn't match.
+
+ It was supposed to omit the parameters when they matched the signing key:
+ the verifying software was then supposed to automatically use the CA's
+ parameters if they were absent from the end user certificate.
+
+ Omitting parameters is no longer recommended. The test was also
+ the wrong way round! This was probably due to unusual behaviour in
+ EVP_cmp_parameters() which returns 1 if the parameters match.
+ This meant that parameters were omitted when they *didn't* match and
+ the certificate was useless. Certificates signed with 'ca' didn't have
+ this bug.
+ [Steve Henson, reported by Doug Erickson <Doug.Erickson@Part.NET>]
+
+ *) Memory leak checking (-DCRYPTO_MDEBUG) had some problems.
+ The interface is as follows:
+ Applications can use
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) aka MemCheck_start(),
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) aka MemCheck_stop();
+ "off" is now the default.
+ The library internally uses
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE) aka MemCheck_off(),
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE) aka MemCheck_on()
+ to disable memory-checking temporarily.
+
+ Some inconsistent states that previously were possible (and were
+ even the default) are now avoided.
+
+ -DCRYPTO_MDEBUG_TIME is new and additionally stores the current time
+ with each memory chunk allocated; this is occasionally more helpful
+ than just having a counter.
+
+ -DCRYPTO_MDEBUG_THREAD is also new and adds the thread ID.
+
+ -DCRYPTO_MDEBUG_ALL enables all of the above, plus any future
+ extensions.
+ [Bodo Moeller]
+
+ *) Introduce "mode" for SSL structures (with defaults in SSL_CTX),
+ which largely parallels "options", but is for changing API behaviour,
+ whereas "options" are about protocol behaviour.
+ Initial "mode" flags are:
+
+ SSL_MODE_ENABLE_PARTIAL_WRITE Allow SSL_write to report success when
+ a single record has been written.
+ SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER Don't insist that SSL_write
+ retries use the same buffer location.
+ (But all of the contents must be
+ copied!)
+ [Bodo Moeller]
+
+ *) Bugfix: SSL_set_options ignored its parameter, only SSL_CTX_set_options
+ worked.
+
+ *) Fix problems with no-hmac etc.
+ [Ulf Möller, pointed out by Brian Wellington <bwelling@tislabs.com>]
+
+ *) New functions RSA_get_default_method(), RSA_set_method() and
+ RSA_get_method(). These allows replacement of RSA_METHODs without having
+ to mess around with the internals of an RSA structure.
+ [Steve Henson]
+
+ *) Fix memory leaks in DSA_do_sign and DSA_is_prime.
+ Also really enable memory leak checks in openssl.c and in some
+ test programs.
+ [Chad C. Mulligan, Bodo Moeller]
+
+ *) Fix a bug in d2i_ASN1_INTEGER() and i2d_ASN1_INTEGER() which can mess
+ up the length of negative integers. This has now been simplified to just
+ store the length when it is first determined and use it later, rather
+ than trying to keep track of where data is copied and updating it to
+ point to the end.
+ [Steve Henson, reported by Brien Wheeler
+ <bwheeler@authentica-security.com>]
+
+ *) Add a new function PKCS7_signatureVerify. This allows the verification
+ of a PKCS#7 signature but with the signing certificate passed to the
+ function itself. This contrasts with PKCS7_dataVerify which assumes the
+ certificate is present in the PKCS#7 structure. This isn't always the
+ case: certificates can be omitted from a PKCS#7 structure and be
+ distributed by "out of band" means (such as a certificate database).
+ [Steve Henson]
+
+ *) Complete the PEM_* macros with DECLARE_PEM versions to replace the
+ function prototypes in pem.h, also change util/mkdef.pl to add the
+ necessary function names.
+ [Steve Henson]
+
+ *) mk1mf.pl (used by Windows builds) did not properly read the
+ options set by Configure in the top level Makefile, and Configure
+ was not even able to write more than one option correctly.
+ Fixed, now "no-idea no-rc5 -DCRYPTO_MDEBUG" etc. works as intended.
+ [Bodo Moeller]
+
+ *) New functions CONF_load_bio() and CONF_load_fp() to allow a config
+ file to be loaded from a BIO or FILE pointer. The BIO version will
+ for example allow memory BIOs to contain config info.
+ [Steve Henson]
+
+ *) New function "CRYPTO_num_locks" that returns CRYPTO_NUM_LOCKS.
+ Whoever hopes to achieve shared-library compatibility across versions
+ must use this, not the compile-time macro.
+ (Exercise 0.9.4: Which is the minimum library version required by
+ such programs?)
+ Note: All this applies only to multi-threaded programs, others don't
+ need locks.
+ [Bodo Moeller]
+
+ *) Add missing case to s3_clnt.c state machine -- one of the new SSL tests
+ through a BIO pair triggered the default case, i.e.
+ SSLerr(...,SSL_R_UNKNOWN_STATE).
+ [Bodo Moeller]
+
+ *) New "BIO pair" concept (crypto/bio/bss_bio.c) so that applications
+ can use the SSL library even if none of the specific BIOs is
+ appropriate.
+ [Bodo Moeller]
+
+ *) Fix a bug in i2d_DSAPublicKey() which meant it returned the wrong value
+ for the encoded length.
+ [Jeon KyoungHo <khjeon@sds.samsung.co.kr>]
+
+ *) Add initial documentation of the X509V3 functions.
+ [Steve Henson]
+
+ *) Add a new pair of functions PEM_write_PKCS8PrivateKey() and
+ PEM_write_bio_PKCS8PrivateKey() that are equivalent to
+ PEM_write_PrivateKey() and PEM_write_bio_PrivateKey() but use the more
+ secure PKCS#8 private key format with a high iteration count.
+ [Steve Henson]
+
+ *) Fix determination of Perl interpreter: A perl or perl5
+ _directory_ in $PATH was also accepted as the interpreter.
+ [Ralf S. Engelschall]
+
+ *) Fix demos/sign/sign.c: well there wasn't anything strictly speaking
+ wrong with it but it was very old and did things like calling
+ PEM_ASN1_read() directly and used MD5 for the hash not to mention some
+ unusual formatting.
+ [Steve Henson]
+
+ *) Fix demos/selfsign.c: it used obsolete and deleted functions, changed
+ to use the new extension code.
+ [Steve Henson]
+
+ *) Implement the PEM_read/PEM_write functions in crypto/pem/pem_all.c
+ with macros. This should make it easier to change their form, add extra
+ arguments etc. Fix a few PEM prototypes which didn't have cipher as a
+ constant.
+ [Steve Henson]
+
+ *) Add to configuration table a new entry that can specify an alternative
+ name for unistd.h (for pre-POSIX systems); we need this for NeXTstep,
+ according to Mark Crispin <MRC@Panda.COM>.
+ [Bodo Moeller]
+
+#if 0
+ *) DES CBC did not update the IV. Weird.
+ [Ben Laurie]
+#else
+ des_cbc_encrypt does not update the IV, but des_ncbc_encrypt does.
+ Changing the behaviour of the former might break existing programs --
+ where IV updating is needed, des_ncbc_encrypt can be used.
+#endif
+
+ *) When bntest is run from "make test" it drives bc to check its
+ calculations, as well as internally checking them. If an internal check
+ fails, it needs to cause bc to give a non-zero result or make test carries
+ on without noticing the failure. Fixed.
+ [Ben Laurie]
+
+ *) DES library cleanups.
+ [Ulf Möller]
+
+ *) Add support for PKCS#5 v2.0 PBE algorithms. This will permit PKCS#8 to be
+ used with any cipher unlike PKCS#5 v1.5 which can at most handle 64 bit
+ ciphers. NOTE: although the key derivation function has been verified
+ against some published test vectors it has not been extensively tested
+ yet. Added a -v2 "cipher" option to pkcs8 application to allow the use
+ of v2.0.
+ [Steve Henson]
+
+ *) Instead of "mkdir -p", which is not fully portable, use new
+ Perl script "util/mkdir-p.pl".
+ [Bodo Moeller]
+
+ *) Rewrite the way password based encryption (PBE) is handled. It used to
+ assume that the ASN1 AlgorithmIdentifier parameter was a PBEParameter
+ structure. This was true for the PKCS#5 v1.5 and PKCS#12 PBE algorithms
+ but doesn't apply to PKCS#5 v2.0 where it can be something else. Now
+ the 'parameter' field of the AlgorithmIdentifier is passed to the
+ underlying key generation function so it must do its own ASN1 parsing.
+ This has also changed the EVP_PBE_CipherInit() function which now has a
+ 'parameter' argument instead of literal salt and iteration count values
+ and the function EVP_PBE_ALGOR_CipherInit() has been deleted.
+ [Steve Henson]
+
+ *) Support for PKCS#5 v1.5 compatible password based encryption algorithms
+ and PKCS#8 functionality. New 'pkcs8' application linked to openssl.
+ Needed to change the PEM_STRING_EVP_PKEY value which was just "PRIVATE
+ KEY" because this clashed with PKCS#8 unencrypted string. Since this
+ value was just used as a "magic string" and not used directly its
+ value doesn't matter.
+ [Steve Henson]
+
+ *) Introduce some semblance of const correctness to BN. Shame C doesn't
+ support mutable.
+ [Ben Laurie]
+
+ *) "linux-sparc64" configuration (ultrapenguin).
+ [Ray Miller <ray.miller@oucs.ox.ac.uk>]
+ "linux-sparc" configuration.
+ [Christian Forster <fo@hawo.stw.uni-erlangen.de>]
+
+ *) config now generates no-xxx options for missing ciphers.
+ [Ulf Möller]
+
+ *) Support the EBCDIC character set (work in progress).
+ File ebcdic.c not yet included because it has a different license.
+ [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>]
+
+ *) Support BS2000/OSD-POSIX.
+ [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>]
+
+ *) Make callbacks for key generation use void * instead of char *.
+ [Ben Laurie]
+
+ *) Make S/MIME samples compile (not yet tested).
+ [Ben Laurie]
+
+ *) Additional typesafe stacks.
+ [Ben Laurie]
+
+ *) New configuration variants "bsdi-elf-gcc" (BSD/OS 4.x).
+ [Bodo Moeller]
+
+
+ Changes between 0.9.3 and 0.9.3a [29 May 1999]
+
+ *) New configuration variant "sco5-gcc".
+
+ *) Updated some demos.
+ [Sean O Riordain, Wade Scholine]
+
+ *) Add missing BIO_free at exit of pkcs12 application.
+ [Wu Zhigang]
+
+ *) Fix memory leak in conf.c.
+ [Steve Henson]
+
+ *) Updates for Win32 to assembler version of MD5.
+ [Steve Henson]
+
+ *) Set #! path to perl in apps/der_chop to where we found it
+ instead of using a fixed path.
+ [Bodo Moeller]
+
+ *) SHA library changes for irix64-mips4-cc.
+ [Andy Polyakov]
+
+ *) Improvements for VMS support.
+ [Richard Levitte]
+
+
+ Changes between 0.9.2b and 0.9.3 [24 May 1999]
+
+ *) Bignum library bug fix. IRIX 6 passes "make test" now!
+ This also avoids the problems with SC4.2 and unpatched SC5.
+ [Andy Polyakov <appro@fy.chalmers.se>]
+
+ *) New functions sk_num, sk_value and sk_set to replace the previous macros.
+ These are required because of the typesafe stack would otherwise break
+ existing code. If old code used a structure member which used to be STACK
+ and is now STACK_OF (for example cert in a PKCS7_SIGNED structure) with
+ sk_num or sk_value it would produce an error because the num, data members
+ are not present in STACK_OF. Now it just produces a warning. sk_set
+ replaces the old method of assigning a value to sk_value
+ (e.g. sk_value(x, i) = y) which the library used in a few cases. Any code
+ that does this will no longer work (and should use sk_set instead) but
+ this could be regarded as a "questionable" behaviour anyway.
+ [Steve Henson]
+
+ *) Fix most of the other PKCS#7 bugs. The "experimental" code can now
+ correctly handle encrypted S/MIME data.
+ [Steve Henson]
+
+ *) Change type of various DES function arguments from des_cblock
+ (which means, in function argument declarations, pointer to char)
+ to des_cblock * (meaning pointer to array with 8 char elements),
+ which allows the compiler to do more typechecking; it was like
+ that back in SSLeay, but with lots of ugly casts.
+
+ Introduce new type const_des_cblock.
+ [Bodo Moeller]
+
+ *) Reorganise the PKCS#7 library and get rid of some of the more obvious
+ problems: find RecipientInfo structure that matches recipient certificate
+ and initialise the ASN1 structures properly based on passed cipher.
+ [Steve Henson]
+
+ *) Belatedly make the BN tests actually check the results.
+ [Ben Laurie]
+
+ *) Fix the encoding and decoding of negative ASN1 INTEGERS and conversion
+ to and from BNs: it was completely broken. New compilation option
+ NEG_PUBKEY_BUG to allow for some broken certificates that encode public
+ key elements as negative integers.
+ [Steve Henson]
+
+ *) Reorganize and speed up MD5.
+ [Andy Polyakov <appro@fy.chalmers.se>]
+
+ *) VMS support.
+ [Richard Levitte <richard@levitte.org>]
+
+ *) New option -out to asn1parse to allow the parsed structure to be
+ output to a file. This is most useful when combined with the -strparse
+ option to examine the output of things like OCTET STRINGS.
+ [Steve Henson]
+
+ *) Make SSL library a little more fool-proof by not requiring any longer
+ that SSL_set_{accept,connect}_state be called before
+ SSL_{accept,connect} may be used (SSL_set_..._state is omitted
+ in many applications because usually everything *appeared* to work as
+ intended anyway -- now it really works as intended).
+ [Bodo Moeller]
+
+ *) Move openssl.cnf out of lib/.
+ [Ulf Möller]
+
+ *) Fix various things to let OpenSSL even pass ``egcc -pipe -O2 -Wall
+ -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes
+ -Wmissing-declarations -Wnested-externs -Winline'' with EGCS 1.1.2+
+ [Ralf S. Engelschall]
+
+ *) Various fixes to the EVP and PKCS#7 code. It may now be able to
+ handle PKCS#7 enveloped data properly.
+ [Sebastian Akerman <sak@parallelconsulting.com>, modified by Steve]
+
+ *) Create a duplicate of the SSL_CTX's CERT in SSL_new instead of
+ copying pointers. The cert_st handling is changed by this in
+ various ways (and thus what used to be known as ctx->default_cert
+ is now called ctx->cert, since we don't resort to s->ctx->[default_]cert
+ any longer when s->cert does not give us what we need).
+ ssl_cert_instantiate becomes obsolete by this change.
+ As soon as we've got the new code right (possibly it already is?),
+ we have solved a couple of bugs of the earlier code where s->cert
+ was used as if it could not have been shared with other SSL structures.
+
+ Note that using the SSL API in certain dirty ways now will result
+ in different behaviour than observed with earlier library versions:
+ Changing settings for an SSL_CTX *ctx after having done s = SSL_new(ctx)
+ does not influence s as it used to.
+
+ In order to clean up things more thoroughly, inside SSL_SESSION
+ we don't use CERT any longer, but a new structure SESS_CERT
+ that holds per-session data (if available); currently, this is
+ the peer's certificate chain and, for clients, the server's certificate
+ and temporary key. CERT holds only those values that can have
+ meaningful defaults in an SSL_CTX.
+ [Bodo Moeller]
+
+ *) New function X509V3_EXT_i2d() to create an X509_EXTENSION structure
+ from the internal representation. Various PKCS#7 fixes: remove some
+ evil casts and set the enc_dig_alg field properly based on the signing
+ key type.
+ [Steve Henson]
+
+ *) Allow PKCS#12 password to be set from the command line or the
+ environment. Let 'ca' get its config file name from the environment
+ variables "OPENSSL_CONF" or "SSLEAY_CONF" (for consistency with 'req'
+ and 'x509').
+ [Steve Henson]
+
+ *) Allow certificate policies extension to use an IA5STRING for the
+ organization field. This is contrary to the PKIX definition but
+ VeriSign uses it and IE5 only recognises this form. Document 'x509'
+ extension option.
+ [Steve Henson]
+
+ *) Add PEDANTIC compiler flag to allow compilation with gcc -pedantic,
+ without disallowing inline assembler and the like for non-pedantic builds.
+ [Ben Laurie]
+
+ *) Support Borland C++ builder.
+ [Janez Jere <jj@void.si>, modified by Ulf Möller]
+
+ *) Support Mingw32.
+ [Ulf Möller]
+
+ *) SHA-1 cleanups and performance enhancements.
+ [Andy Polyakov <appro@fy.chalmers.se>]
+
+ *) Sparc v8plus assembler for the bignum library.
+ [Andy Polyakov <appro@fy.chalmers.se>]
+
+ *) Accept any -xxx and +xxx compiler options in Configure.
+ [Ulf Möller]
+
+ *) Update HPUX configuration.
+ [Anonymous]
+
+ *) Add missing sk_<type>_unshift() function to safestack.h
+ [Ralf S. Engelschall]
+
+ *) New function SSL_CTX_use_certificate_chain_file that sets the
+ "extra_cert"s in addition to the certificate. (This makes sense
+ only for "PEM" format files, as chains as a whole are not
+ DER-encoded.)
+ [Bodo Moeller]
+
+ *) Support verify_depth from the SSL API.
+ x509_vfy.c had what can be considered an off-by-one-error:
+ Its depth (which was not part of the external interface)
+ was actually counting the number of certificates in a chain;
+ now it really counts the depth.
+ [Bodo Moeller]
+
+ *) Bugfix in crypto/x509/x509_cmp.c: The SSLerr macro was used
+ instead of X509err, which often resulted in confusing error
+ messages since the error codes are not globally unique
+ (e.g. an alleged error in ssl3_accept when a certificate
+ didn't match the private key).
+
+ *) New function SSL_CTX_set_session_id_context that allows to set a default
+ value (so that you don't need SSL_set_session_id_context for each
+ connection using the SSL_CTX).
+ [Bodo Moeller]
+
+ *) OAEP decoding bug fix.
+ [Ulf Möller]
+
+ *) Support INSTALL_PREFIX for package builders, as proposed by
+ David Harris.
+ [Bodo Moeller]
+
+ *) New Configure options "threads" and "no-threads". For systems
+ where the proper compiler options are known (currently Solaris
+ and Linux), "threads" is the default.
+ [Bodo Moeller]
+
+ *) New script util/mklink.pl as a faster substitute for util/mklink.sh.
+ [Bodo Moeller]
+
+ *) Install various scripts to $(OPENSSLDIR)/misc, not to
+ $(INSTALLTOP)/bin -- they shouldn't clutter directories
+ such as /usr/local/bin.
+ [Bodo Moeller]
+
+ *) "make linux-shared" to build shared libraries.
+ [Niels Poppe <niels@netbox.org>]
+
+ *) New Configure option no-<cipher> (rsa, idea, rc5, ...).
+ [Ulf Möller]
+
+ *) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for
+ extension adding in x509 utility.
+ [Steve Henson]
+
+ *) Remove NOPROTO sections and error code comments.
+ [Ulf Möller]
+
+ *) Partial rewrite of the DEF file generator to now parse the ANSI
+ prototypes.
+ [Steve Henson]
+
+ *) New Configure options --prefix=DIR and --openssldir=DIR.
+ [Ulf Möller]
+
+ *) Complete rewrite of the error code script(s). It is all now handled
+ by one script at the top level which handles error code gathering,
+ header rewriting and C source file generation. It should be much better
+ than the old method: it now uses a modified version of Ulf's parser to
+ read the ANSI prototypes in all header files (thus the old K&R definitions
+ aren't needed for error creation any more) and do a better job of
+ translating function codes into names. The old 'ASN1 error code imbedded
+ in a comment' is no longer necessary and it doesn't use .err files which
+ have now been deleted. Also the error code call doesn't have to appear all
+ on one line (which resulted in some large lines...).
+ [Steve Henson]
+
+ *) Change #include filenames from <foo.h> to <openssl/foo.h>.
+ [Bodo Moeller]
+
+ *) Change behaviour of ssl2_read when facing length-0 packets: Don't return
+ 0 (which usually indicates a closed connection), but continue reading.
+ [Bodo Moeller]
+
+ *) Fix some race conditions.
+ [Bodo Moeller]
+
+ *) Add support for CRL distribution points extension. Add Certificate
+ Policies and CRL distribution points documentation.
+ [Steve Henson]
+
+ *) Move the autogenerated header file parts to crypto/opensslconf.h.
+ [Ulf Möller]
+
+ *) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of
+ 8 of keying material. Merlin has also confirmed interop with this fix
+ between OpenSSL and Baltimore C/SSL 2.0 and J/SSL 2.0.
+ [Merlin Hughes <merlin@baltimore.ie>]
+
+ *) Fix lots of warnings.
+ [Richard Levitte <levitte@stacken.kth.se>]
+
+ *) In add_cert_dir() in crypto/x509/by_dir.c, break out of the loop if
+ the directory spec didn't end with a LIST_SEPARATOR_CHAR.
+ [Richard Levitte <levitte@stacken.kth.se>]
+
+ *) Fix problems with sizeof(long) == 8.
+ [Andy Polyakov <appro@fy.chalmers.se>]
+
+ *) Change functions to ANSI C.
+ [Ulf Möller]
+
+ *) Fix typos in error codes.
+ [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]
+
+ *) Remove defunct assembler files from Configure.
+ [Ulf Möller]
+
+ *) SPARC v8 assembler BIGNUM implementation.
+ [Andy Polyakov <appro@fy.chalmers.se>]
+
+ *) Support for Certificate Policies extension: both print and set.
+ Various additions to support the r2i method this uses.
+ [Steve Henson]
+
+ *) A lot of constification, and fix a bug in X509_NAME_oneline() that could
+ return a const string when you are expecting an allocated buffer.
+ [Ben Laurie]
+
+ *) Add support for ASN1 types UTF8String and VISIBLESTRING, also the CHOICE
+ types DirectoryString and DisplayText.
+ [Steve Henson]
+
+ *) Add code to allow r2i extensions to access the configuration database,
+ add an LHASH database driver and add several ctx helper functions.
+ [Steve Henson]
+
+ *) Fix an evil bug in bn_expand2() which caused various BN functions to
+ fail when they extended the size of a BIGNUM.
+ [Steve Henson]
+
+ *) Various utility functions to handle SXNet extension. Modify mkdef.pl to
+ support typesafe stack.
+ [Steve Henson]
+
+ *) Fix typo in SSL_[gs]et_options().
+ [Nils Frostberg <nils@medcom.se>]
+
+ *) Delete various functions and files that belonged to the (now obsolete)
+ old X509V3 handling code.
+ [Steve Henson]
+
+ *) New Configure option "rsaref".
+ [Ulf Möller]
+
+ *) Don't auto-generate pem.h.
+ [Bodo Moeller]
+
+ *) Introduce type-safe ASN.1 SETs.
+ [Ben Laurie]
+
+ *) Convert various additional casted stacks to type-safe STACK_OF() variants.
+ [Ben Laurie, Ralf S. Engelschall, Steve Henson]
+
+ *) Introduce type-safe STACKs. This will almost certainly break lots of code
+ that links with OpenSSL (well at least cause lots of warnings), but fear
+ not: the conversion is trivial, and it eliminates loads of evil casts. A
+ few STACKed things have been converted already. Feel free to convert more.
+ In the fullness of time, I'll do away with the STACK type altogether.
+ [Ben Laurie]
+
+ *) Add `openssl ca -revoke <certfile>' facility which revokes a certificate
+ specified in <certfile> by updating the entry in the index.txt file.
+ This way one no longer has to edit the index.txt file manually for
+ revoking a certificate. The -revoke option does the gory details now.
+ [Massimiliano Pala <madwolf@openca.org>, Ralf S. Engelschall]
+
+ *) Fix `openssl crl -noout -text' combination where `-noout' killed the
+ `-text' option at all and this way the `-noout -text' combination was
+ inconsistent in `openssl crl' with the friends in `openssl x509|rsa|dsa'.
+ [Ralf S. Engelschall]
+
+ *) Make sure a corresponding plain text error message exists for the
+ X509_V_ERR_CERT_REVOKED/23 error number which can occur when a
+ verify callback function determined that a certificate was revoked.
+ [Ralf S. Engelschall]
+
+ *) Bugfix: In test/testenc, don't test "openssl <cipher>" for
+ ciphers that were excluded, e.g. by -DNO_IDEA. Also, test
+ all available cipers including rc5, which was forgotten until now.
+ In order to let the testing shell script know which algorithms
+ are available, a new (up to now undocumented) command
+ "openssl list-cipher-commands" is used.
+ [Bodo Moeller]
+
+ *) Bugfix: s_client occasionally would sleep in select() when
+ it should have checked SSL_pending() first.
+ [Bodo Moeller]
+
+ *) New functions DSA_do_sign and DSA_do_verify to provide access to
+ the raw DSA values prior to ASN.1 encoding.
+ [Ulf Möller]
+
+ *) Tweaks to Configure
+ [Niels Poppe <niels@netbox.org>]
+
+ *) Add support for PKCS#5 v2.0 ASN1 PBES2 structures. No other support,
+ yet...
+ [Steve Henson]
+
+ *) New variables $(RANLIB) and $(PERL) in the Makefiles.
+ [Ulf Möller]
+
+ *) New config option to avoid instructions that are illegal on the 80386.
+ The default code is faster, but requires at least a 486.
+ [Ulf Möller]
+
+ *) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and
+ SSL2_SERVER_VERSION (not used at all) macros, which are now the
+ same as SSL2_VERSION anyway.
+ [Bodo Moeller]
+
+ *) New "-showcerts" option for s_client.
+ [Bodo Moeller]
+
+ *) Still more PKCS#12 integration. Add pkcs12 application to openssl
+ application. Various cleanups and fixes.
+ [Steve Henson]
+
+ *) More PKCS#12 integration. Add new pkcs12 directory with Makefile.ssl and
+ modify error routines to work internally. Add error codes and PBE init
+ to library startup routines.
+ [Steve Henson]
+
+ *) Further PKCS#12 integration. Added password based encryption, PKCS#8 and
+ packing functions to asn1 and evp. Changed function names and error
+ codes along the way.
+ [Steve Henson]
+
+ *) PKCS12 integration: and so it begins... First of several patches to
+ slowly integrate PKCS#12 functionality into OpenSSL. Add PKCS#12
+ objects to objects.h
+ [Steve Henson]
+
+ *) Add a new 'indent' option to some X509V3 extension code. Initial ASN1
+ and display support for Thawte strong extranet extension.
+ [Steve Henson]
+
+ *) Add LinuxPPC support.
+ [Jeff Dubrule <igor@pobox.org>]
+
+ *) Get rid of redundant BN file bn_mulw.c, and rename bn_div64 to
+ bn_div_words in alpha.s.
+ [Hannes Reinecke <H.Reinecke@hw.ac.uk> and Ben Laurie]
+
+ *) Make sure the RSA OAEP test is skipped under -DRSAref because
+ OAEP isn't supported when OpenSSL is built with RSAref.
+ [Ulf Moeller <ulf@fitug.de>]
+
+ *) Move definitions of IS_SET/IS_SEQUENCE inside crypto/asn1/asn1.h
+ so they no longer are missing under -DNOPROTO.
+ [Soren S. Jorvang <soren@t.dk>]
+
+
+ Changes between 0.9.1c and 0.9.2b [22 Mar 1999]
+
+ *) Make SSL_get_peer_cert_chain() work in servers. Unfortunately, it still
+ doesn't work when the session is reused. Coming soon!
+ [Ben Laurie]
+
+ *) Fix a security hole, that allows sessions to be reused in the wrong
+ context thus bypassing client cert protection! All software that uses
+ client certs and session caches in multiple contexts NEEDS PATCHING to
+ allow session reuse! A fuller solution is in the works.
+ [Ben Laurie, problem pointed out by Holger Reif, Bodo Moeller (and ???)]
+
+ *) Some more source tree cleanups (removed obsolete files
+ crypto/bf/asm/bf586.pl, test/test.txt and crypto/sha/asm/f.s; changed
+ permission on "config" script to be executable) and a fix for the INSTALL
+ document.
+ [Ulf Moeller <ulf@fitug.de>]
+
+ *) Remove some legacy and erroneous uses of malloc, free instead of
+ Malloc, Free.
+ [Lennart Bang <lob@netstream.se>, with minor changes by Steve]
+
+ *) Make rsa_oaep_test return non-zero on error.
+ [Ulf Moeller <ulf@fitug.de>]
+
+ *) Add support for native Solaris shared libraries. Configure
+ solaris-sparc-sc4-pic, make, then run shlib/solaris-sc4.sh. It'd be nice
+ if someone would make that last step automatic.
+ [Matthias Loepfe <Matthias.Loepfe@AdNovum.CH>]
+
+ *) ctx_size was not built with the right compiler during "make links". Fixed.
+ [Ben Laurie]
+
+ *) Change the meaning of 'ALL' in the cipher list. It now means "everything
+ except NULL ciphers". This means the default cipher list will no longer
+ enable NULL ciphers. They need to be specifically enabled e.g. with
+ the string "DEFAULT:eNULL".
+ [Steve Henson]
+
+ *) Fix to RSA private encryption routines: if p < q then it would
+ occasionally produce an invalid result. This will only happen with
+ externally generated keys because OpenSSL (and SSLeay) ensure p > q.
+ [Steve Henson]
+
+ *) Be less restrictive and allow also `perl util/perlpath.pl
+ /path/to/bin/perl' in addition to `perl util/perlpath.pl /path/to/bin',
+ because this way one can also use an interpreter named `perl5' (which is
+ usually the name of Perl 5.xxx on platforms where an Perl 4.x is still
+ installed as `perl').
+ [Matthias Loepfe <Matthias.Loepfe@adnovum.ch>]
+
+ *) Let util/clean-depend.pl work also with older Perl 5.00x versions.
+ [Matthias Loepfe <Matthias.Loepfe@adnovum.ch>]
+
+ *) Fix Makefile.org so CC,CFLAG etc are passed to 'make links' add
+ advapi32.lib to Win32 build and change the pem test comparison
+ to fc.exe (thanks to Ulrich Kroener <kroneru@yahoo.com> for the
+ suggestion). Fix misplaced ASNI prototypes and declarations in evp.h
+ and crypto/des/ede_cbcm_enc.c.
+ [Steve Henson]
+
+ *) DES quad checksum was broken on big-endian architectures. Fixed.
+ [Ben Laurie]
+
+ *) Comment out two functions in bio.h that aren't implemented. Fix up the
+ Win32 test batch file so it (might) work again. The Win32 test batch file
+ is horrible: I feel ill....
+ [Steve Henson]
+
+ *) Move various #ifdefs around so NO_SYSLOG, NO_DIRENT etc are now selected
+ in e_os.h. Audit of header files to check ANSI and non ANSI
+ sections: 10 functions were absent from non ANSI section and not exported
+ from Windows DLLs. Fixed up libeay.num for new functions.
+ [Steve Henson]
+
+ *) Make `openssl version' output lines consistent.
+ [Ralf S. Engelschall]
+
+ *) Fix Win32 symbol export lists for BIO functions: Added
+ BIO_get_ex_new_index, BIO_get_ex_num, BIO_get_ex_data and BIO_set_ex_data
+ to ms/libeay{16,32}.def.
+ [Ralf S. Engelschall]
+
+ *) Second round of fixing the OpenSSL perl/ stuff. It now at least compiled
+ fine under Unix and passes some trivial tests I've now added. But the
+ whole stuff is horribly incomplete, so a README.1ST with a disclaimer was
+ added to make sure no one expects that this stuff really works in the
+ OpenSSL 0.9.2 release. Additionally I've started to clean the XS sources
+ up and fixed a few little bugs and inconsistencies in OpenSSL.{pm,xs} and
+ openssl_bio.xs.
+ [Ralf S. Engelschall]
+
+ *) Fix the generation of two part addresses in perl.
+ [Kenji Miyake <kenji@miyake.org>, integrated by Ben Laurie]
+
+ *) Add config entry for Linux on MIPS.
+ [John Tobey <jtobey@channel1.com>]
+
+ *) Make links whenever Configure is run, unless we are on Windoze.
+ [Ben Laurie]
+
+ *) Permit extensions to be added to CRLs using crl_section in openssl.cnf.
+ Currently only issuerAltName and AuthorityKeyIdentifier make any sense
+ in CRLs.
+ [Steve Henson]
+
+ *) Add a useful kludge to allow package maintainers to specify compiler and
+ other platforms details on the command line without having to patch the
+ Configure script everytime: One now can use ``perl Configure
+ <id>:<details>'', i.e. platform ids are allowed to have details appended
+ to them (separated by colons). This is treated as there would be a static
+ pre-configured entry in Configure's %table under key <id> with value
+ <details> and ``perl Configure <id>'' is called. So, when you want to
+ perform a quick test-compile under FreeBSD 3.1 with pgcc and without
+ assembler stuff you can use ``perl Configure "FreeBSD-elf:pgcc:-O6:::"''
+ now, which overrides the FreeBSD-elf entry on-the-fly.
+ [Ralf S. Engelschall]
+
+ *) Disable new TLS1 ciphersuites by default: they aren't official yet.
+ [Ben Laurie]
+
+ *) Allow DSO flags like -fpic, -fPIC, -KPIC etc. to be specified
+ on the `perl Configure ...' command line. This way one can compile
+ OpenSSL libraries with Position Independent Code (PIC) which is needed
+ for linking it into DSOs.
+ [Ralf S. Engelschall]
+
+ *) Remarkably, export ciphers were totally broken and no-one had noticed!
+ Fixed.
+ [Ben Laurie]
+
+ *) Cleaned up the LICENSE document: The official contact for any license
+ questions now is the OpenSSL core team under openssl-core@openssl.org.
+ And add a paragraph about the dual-license situation to make sure people
+ recognize that _BOTH_ the OpenSSL license _AND_ the SSLeay license apply
+ to the OpenSSL toolkit.
+ [Ralf S. Engelschall]
+
+ *) General source tree makefile cleanups: Made `making xxx in yyy...'
+ display consistent in the source tree and replaced `/bin/rm' by `rm'.
+ Additionally cleaned up the `make links' target: Remove unnecessary
+ semicolons, subsequent redundant removes, inline point.sh into mklink.sh
+ to speed processing and no longer clutter the display with confusing
+ stuff. Instead only the actually done links are displayed.
+ [Ralf S. Engelschall]
+
+ *) Permit null encryption ciphersuites, used for authentication only. It used
+ to be necessary to set the preprocessor define SSL_ALLOW_ENULL to do this.
+ It is now necessary to set SSL_FORBID_ENULL to prevent the use of null
+ encryption.
+ [Ben Laurie]
+
+ *) Add a bunch of fixes to the PKCS#7 stuff. It used to sometimes reorder
+ signed attributes when verifying signatures (this would break them),
+ the detached data encoding was wrong and public keys obtained using
+ X509_get_pubkey() weren't freed.
+ [Steve Henson]
+
+ *) Add text documentation for the BUFFER functions. Also added a work around
+ to a Win95 console bug. This was triggered by the password read stuff: the
+ last character typed gets carried over to the next fread(). If you were
+ generating a new cert request using 'req' for example then the last
+ character of the passphrase would be CR which would then enter the first
+ field as blank.
+ [Steve Henson]
+
+ *) Added the new `Includes OpenSSL Cryptography Software' button as
+ doc/openssl_button.{gif,html} which is similar in style to the old SSLeay
+ button and can be used by applications based on OpenSSL to show the
+ relationship to the OpenSSL project.
+ [Ralf S. Engelschall]
+
+ *) Remove confusing variables in function signatures in files
+ ssl/ssl_lib.c and ssl/ssl.h.
+ [Lennart Bong <lob@kulthea.stacken.kth.se>]
+
+ *) Don't install bss_file.c under PREFIX/include/
+ [Lennart Bong <lob@kulthea.stacken.kth.se>]
+
+ *) Get the Win32 compile working again. Modify mkdef.pl so it can handle
+ functions that return function pointers and has support for NT specific
+ stuff. Fix mk1mf.pl and VC-32.pl to support NT differences also. Various
+ #ifdef WIN32 and WINNTs sprinkled about the place and some changes from
+ unsigned to signed types: this was killing the Win32 compile.
+ [Steve Henson]
+
+ *) Add new certificate file to stack functions,
+ SSL_add_dir_cert_subjects_to_stack() and
+ SSL_add_file_cert_subjects_to_stack(). These largely supplant
+ SSL_load_client_CA_file(), and can be used to add multiple certs easily
+ to a stack (usually this is then handed to SSL_CTX_set_client_CA_list()).
+ This means that Apache-SSL and similar packages don't have to mess around
+ to add as many CAs as they want to the preferred list.
+ [Ben Laurie]
+
+ *) Experiment with doxygen documentation. Currently only partially applied to
+ ssl/ssl_lib.c.
+ See http://www.stack.nl/~dimitri/doxygen/index.html, and run doxygen with
+ openssl.doxy as the configuration file.
+ [Ben Laurie]
+
+ *) Get rid of remaining C++-style comments which strict C compilers hate.
+ [Ralf S. Engelschall, pointed out by Carlos Amengual]
+
+ *) Changed BN_RECURSION in bn_mont.c to BN_RECURSION_MONT so it is not
+ compiled in by default: it has problems with large keys.
+ [Steve Henson]
+
+ *) Add a bunch of SSL_xxx() functions for configuring the temporary RSA and
+ DH private keys and/or callback functions which directly correspond to
+ their SSL_CTX_xxx() counterparts but work on a per-connection basis. This
+ is needed for applications which have to configure certificates on a
+ per-connection basis (e.g. Apache+mod_ssl) instead of a per-context basis
+ (e.g. s_server).
+ For the RSA certificate situation is makes no difference, but
+ for the DSA certificate situation this fixes the "no shared cipher"
+ problem where the OpenSSL cipher selection procedure failed because the
+ temporary keys were not overtaken from the context and the API provided
+ no way to reconfigure them.
+ The new functions now let applications reconfigure the stuff and they
+ are in detail: SSL_need_tmp_RSA, SSL_set_tmp_rsa, SSL_set_tmp_dh,
+ SSL_set_tmp_rsa_callback and SSL_set_tmp_dh_callback. Additionally a new
+ non-public-API function ssl_cert_instantiate() is used as a helper
+ function and also to reduce code redundancy inside ssl_rsa.c.
+ [Ralf S. Engelschall]
+
+ *) Move s_server -dcert and -dkey options out of the undocumented feature
+ area because they are useful for the DSA situation and should be
+ recognized by the users.
+ [Ralf S. Engelschall]
+
+ *) Fix the cipher decision scheme for export ciphers: the export bits are
+ *not* within SSL_MKEY_MASK or SSL_AUTH_MASK, they are within
+ SSL_EXP_MASK. So, the original variable has to be used instead of the
+ already masked variable.
+ [Richard Levitte <levitte@stacken.kth.se>]
+
+ *) Fix 'port' variable from `int' to `unsigned int' in crypto/bio/b_sock.c
+ [Richard Levitte <levitte@stacken.kth.se>]
+
+ *) Change type of another md_len variable in pk7_doit.c:PKCS7_dataFinal()
+ from `int' to `unsigned int' because it's a length and initialized by
+ EVP_DigestFinal() which expects an `unsigned int *'.
+ [Richard Levitte <levitte@stacken.kth.se>]
+
+ *) Don't hard-code path to Perl interpreter on shebang line of Configure
+ script. Instead use the usual Shell->Perl transition trick.
+ [Ralf S. Engelschall]
+
+ *) Make `openssl x509 -noout -modulus' functional also for DSA certificates
+ (in addition to RSA certificates) to match the behaviour of `openssl dsa
+ -noout -modulus' as it's already the case for `openssl rsa -noout
+ -modulus'. For RSA the -modulus is the real "modulus" while for DSA
+ currently the public key is printed (a decision which was already done by
+ `openssl dsa -modulus' in the past) which serves a similar purpose.
+ Additionally the NO_RSA no longer completely removes the whole -modulus
+ option; it now only avoids using the RSA stuff. Same applies to NO_DSA
+ now, too.
+ [Ralf S. Engelschall]
+
+ *) Add Arne Ansper's reliable BIO - this is an encrypted, block-digested
+ BIO. See the source (crypto/evp/bio_ok.c) for more info.
+ [Arne Ansper <arne@ats.cyber.ee>]
+
+ *) Dump the old yucky req code that tried (and failed) to allow raw OIDs
+ to be added. Now both 'req' and 'ca' can use new objects defined in the
+ config file.
+ [Steve Henson]
+
+ *) Add cool BIO that does syslog (or event log on NT).
+ [Arne Ansper <arne@ats.cyber.ee>, integrated by Ben Laurie]
+
+ *) Add support for new TLS ciphersuites, TLS_RSA_EXPORT56_WITH_RC4_56_MD5,
+ TLS_RSA_EXPORT56_WITH_RC2_CBC_56_MD5 and
+ TLS_RSA_EXPORT56_WITH_DES_CBC_SHA, as specified in "56-bit Export Cipher
+ Suites For TLS", draft-ietf-tls-56-bit-ciphersuites-00.txt.
+ [Ben Laurie]
+
+ *) Add preliminary config info for new extension code.
+ [Steve Henson]
+
+ *) Make RSA_NO_PADDING really use no padding.
+ [Ulf Moeller <ulf@fitug.de>]
+
+ *) Generate errors when private/public key check is done.
+ [Ben Laurie]
+
+ *) Overhaul for 'crl' utility. New function X509_CRL_print. Partial support
+ for some CRL extensions and new objects added.
+ [Steve Henson]
+
+ *) Really fix the ASN1 IMPLICIT bug this time... Partial support for private
+ key usage extension and fuller support for authority key id.
+ [Steve Henson]
+
+ *) Add OAEP encryption for the OpenSSL crypto library. OAEP is the improved
+ padding method for RSA, which is recommended for new applications in PKCS
+ #1 v2.0 (RFC 2437, October 1998).
+ OAEP (Optimal Asymmetric Encryption Padding) has better theoretical
+ foundations than the ad-hoc padding used in PKCS #1 v1.5. It is secure
+ against Bleichbacher's attack on RSA.
+ [Ulf Moeller <ulf@fitug.de>, reformatted, corrected and integrated by
+ Ben Laurie]
+
+ *) Updates to the new SSL compression code
+ [Eric A. Young, (from changes to C2Net SSLeay, integrated by Mark Cox)]
+
+ *) Fix so that the version number in the master secret, when passed
+ via RSA, checks that if TLS was proposed, but we roll back to SSLv3
+ (because the server will not accept higher), that the version number
+ is 0x03,0x01, not 0x03,0x00
+ [Eric A. Young, (from changes to C2Net SSLeay, integrated by Mark Cox)]
+
+ *) Run extensive memory leak checks on SSL apps. Fixed *lots* of memory
+ leaks in ssl/ relating to new X509_get_pubkey() behaviour. Also fixes
+ in apps/ and an unrelated leak in crypto/dsa/dsa_vrf.c
+ [Steve Henson]
+
+ *) Support for RAW extensions where an arbitrary extension can be
+ created by including its DER encoding. See apps/openssl.cnf for
+ an example.
+ [Steve Henson]
+
+ *) Make sure latest Perl versions don't interpret some generated C array
+ code as Perl array code in the crypto/err/err_genc.pl script.
+ [Lars Weber <3weber@informatik.uni-hamburg.de>]
+
+ *) Modify ms/do_ms.bat to not generate assembly language makefiles since
+ not many people have the assembler. Various Win32 compilation fixes and
+ update to the INSTALL.W32 file with (hopefully) more accurate Win32
+ build instructions.
+ [Steve Henson]
+
+ *) Modify configure script 'Configure' to automatically create crypto/date.h
+ file under Win32 and also build pem.h from pem.org. New script
+ util/mkfiles.pl to create the MINFO file on environments that can't do a
+ 'make files': perl util/mkfiles.pl >MINFO should work.
+ [Steve Henson]
+
+ *) Major rework of DES function declarations, in the pursuit of correctness
+ and purity. As a result, many evil casts evaporated, and some weirdness,
+ too. You may find this causes warnings in your code. Zapping your evil
+ casts will probably fix them. Mostly.
+ [Ben Laurie]
+
+ *) Fix for a typo in asn1.h. Bug fix to object creation script
+ obj_dat.pl. It considered a zero in an object definition to mean
+ "end of object": none of the objects in objects.h have any zeros
+ so it wasn't spotted.
+ [Steve Henson, reported by Erwann ABALEA <eabalea@certplus.com>]
+
+ *) Add support for Triple DES Cipher Block Chaining with Output Feedback
+ Masking (CBCM). In the absence of test vectors, the best I have been able
+ to do is check that the decrypt undoes the encrypt, so far. Send me test
+ vectors if you have them.
+ [Ben Laurie]
+
+ *) Correct calculation of key length for export ciphers (too much space was
+ allocated for null ciphers). This has not been tested!
+ [Ben Laurie]
+
+ *) Modifications to the mkdef.pl for Win32 DEF file creation. The usage
+ message is now correct (it understands "crypto" and "ssl" on its
+ command line). There is also now an "update" option. This will update
+ the util/ssleay.num and util/libeay.num files with any new functions.
+ If you do a:
+ perl util/mkdef.pl crypto ssl update
+ it will update them.
+ [Steve Henson]
+
+ *) Overhauled the Perl interface (perl/*):
+ - ported BN stuff to OpenSSL's different BN library
+ - made the perl/ source tree CVS-aware
+ - renamed the package from SSLeay to OpenSSL (the files still contain
+ their history because I've copied them in the repository)
+ - removed obsolete files (the test scripts will be replaced
+ by better Test::Harness variants in the future)
+ [Ralf S. Engelschall]
+
+ *) First cut for a very conservative source tree cleanup:
+ 1. merge various obsolete readme texts into doc/ssleay.txt
+ where we collect the old documents and readme texts.
+ 2. remove the first part of files where I'm already sure that we no
+ longer need them because of three reasons: either they are just temporary
+ files which were left by Eric or they are preserved original files where
+ I've verified that the diff is also available in the CVS via "cvs diff
+ -rSSLeay_0_8_1b" or they were renamed (as it was definitely the case for
+ the crypto/md/ stuff).
+ [Ralf S. Engelschall]
+
+ *) More extension code. Incomplete support for subject and issuer alt
+ name, issuer and authority key id. Change the i2v function parameters
+ and add an extra 'crl' parameter in the X509V3_CTX structure: guess
+ what that's for :-) Fix to ASN1 macro which messed up
+ IMPLICIT tag and add f_enum.c which adds a2i, i2a for ENUMERATED.
+ [Steve Henson]
+
+ *) Preliminary support for ENUMERATED type. This is largely copied from the
+ INTEGER code.
+ [Steve Henson]
+
+ *) Add new function, EVP_MD_CTX_copy() to replace frequent use of memcpy.
+ [Eric A. Young, (from changes to C2Net SSLeay, integrated by Mark Cox)]
+
+ *) Make sure `make rehash' target really finds the `openssl' program.
+ [Ralf S. Engelschall, Matthias Loepfe <Matthias.Loepfe@adnovum.ch>]
+
+ *) Squeeze another 7% of speed out of MD5 assembler, at least on a P2. I'd
+ like to hear about it if this slows down other processors.
+ [Ben Laurie]
+
+ *) Add CygWin32 platform information to Configure script.
+ [Alan Batie <batie@aahz.jf.intel.com>]
+
+ *) Fixed ms/32all.bat script: `no_asm' -> `no-asm'
+ [Rainer W. Gerling <gerling@mpg-gv.mpg.de>]
+
+ *) New program nseq to manipulate netscape certificate sequences
+ [Steve Henson]
+
+ *) Modify crl2pkcs7 so it supports multiple -certfile arguments. Fix a
+ few typos.
+ [Steve Henson]
+
+ *) Fixes to BN code. Previously the default was to define BN_RECURSION
+ but the BN code had some problems that would cause failures when
+ doing certificate verification and some other functions.
+ [Eric A. Young, (from changes to C2Net SSLeay, integrated by Mark Cox)]
+
+ *) Add ASN1 and PEM code to support netscape certificate sequences.
+ [Steve Henson]
+
+ *) Add ASN1 and PEM code to support netscape certificate sequences.
+ [Steve Henson]
+
+ *) Add several PKIX and private extended key usage OIDs.
+ [Steve Henson]
+
+ *) Modify the 'ca' program to handle the new extension code. Modify
+ openssl.cnf for new extension format, add comments.
+ [Steve Henson]
+
+ *) More X509 V3 changes. Fix typo in v3_bitstr.c. Add support to 'req'
+ and add a sample to openssl.cnf so req -x509 now adds appropriate
+ CA extensions.
+ [Steve Henson]
+
+ *) Continued X509 V3 changes. Add to other makefiles, integrate with the
+ error code, add initial support to X509_print() and x509 application.
+ [Steve Henson]
+
+ *) Takes a deep breath and start adding X509 V3 extension support code. Add
+ files in crypto/x509v3. Move original stuff to crypto/x509v3/old. All this
+ stuff is currently isolated and isn't even compiled yet.
+ [Steve Henson]
+
+ *) Continuing patches for GeneralizedTime. Fix up certificate and CRL
+ ASN1 to use ASN1_TIME and modify print routines to use ASN1_TIME_print.
+ Removed the versions check from X509 routines when loading extensions:
+ this allows certain broken certificates that don't set the version
+ properly to be processed.
+ [Steve Henson]
+
+ *) Deal with irritating shit to do with dependencies, in YAAHW (Yet Another
+ Ad Hoc Way) - Makefile.ssls now all contain local dependencies, which
+ can still be regenerated with "make depend".
+ [Ben Laurie]
+
+ *) Spelling mistake in C version of CAST-128.
+ [Ben Laurie, reported by Jeremy Hylton <jeremy@cnri.reston.va.us>]
+
+ *) Changes to the error generation code. The perl script err-code.pl
+ now reads in the old error codes and retains the old numbers, only
+ adding new ones if necessary. It also only changes the .err files if new
+ codes are added. The makefiles have been modified to only insert errors
+ when needed (to avoid needlessly modifying header files). This is done
+ by only inserting errors if the .err file is newer than the auto generated
+ C file. To rebuild all the error codes from scratch (the old behaviour)
+ either modify crypto/Makefile.ssl to pass the -regen flag to err_code.pl
+ or delete all the .err files.
+ [Steve Henson]
+
+ *) CAST-128 was incorrectly implemented for short keys. The C version has
+ been fixed, but is untested. The assembler versions are also fixed, but
+ new assembler HAS NOT BEEN GENERATED FOR WIN32 - the Makefile needs fixing
+ to regenerate it if needed.
+ [Ben Laurie, reported (with fix for C version) by Jun-ichiro itojun
+ Hagino <itojun@kame.net>]
+
+ *) File was opened incorrectly in randfile.c.
+ [Ulf Möller <ulf@fitug.de>]
+
+ *) Beginning of support for GeneralizedTime. d2i, i2d, check and print
+ functions. Also ASN1_TIME suite which is a CHOICE of UTCTime or
+ GeneralizedTime. ASN1_TIME is the proper type used in certificates et
+ al: it's just almost always a UTCTime. Note this patch adds new error
+ codes so do a "make errors" if there are problems.
+ [Steve Henson]
+
+ *) Correct Linux 1 recognition in config.
+ [Ulf Möller <ulf@fitug.de>]
+
+ *) Remove pointless MD5 hash when using DSA keys in ca.
+ [Anonymous <nobody@replay.com>]
+
+ *) Generate an error if given an empty string as a cert directory. Also
+ generate an error if handed NULL (previously returned 0 to indicate an
+ error, but didn't set one).
+ [Ben Laurie, reported by Anonymous <nobody@replay.com>]
+
+ *) Add prototypes to SSL methods. Make SSL_write's buffer const, at last.
+ [Ben Laurie]
+
+ *) Fix the dummy function BN_ref_mod_exp() in rsaref.c to have the correct
+ parameters. This was causing a warning which killed off the Win32 compile.
+ [Steve Henson]
+
+ *) Remove C++ style comments from crypto/bn/bn_local.h.
+ [Neil Costigan <neil.costigan@celocom.com>]
+
+ *) The function OBJ_txt2nid was broken. It was supposed to return a nid
+ based on a text string, looking up short and long names and finally
+ "dot" format. The "dot" format stuff didn't work. Added new function
+ OBJ_txt2obj to do the same but return an ASN1_OBJECT and rewrote
+ OBJ_txt2nid to use it. OBJ_txt2obj can also return objects even if the
+ OID is not part of the table.
+ [Steve Henson]
+
+ *) Add prototypes to X509 lookup/verify methods, fixing a bug in
+ X509_LOOKUP_by_alias().
+ [Ben Laurie]
+
+ *) Sort openssl functions by name.
+ [Ben Laurie]
+
+ *) Get the gendsa program working (hopefully) and add it to app list. Remove
+ encryption from sample DSA keys (in case anyone is interested the password
+ was "1234").
+ [Steve Henson]
+
+ *) Make _all_ *_free functions accept a NULL pointer.
+ [Frans Heymans <fheymans@isaserver.be>]
+
+ *) If a DH key is generated in s3_srvr.c, don't blow it by trying to use
+ NULL pointers.
+ [Anonymous <nobody@replay.com>]
+
+ *) s_server should send the CAfile as acceptable CAs, not its own cert.
+ [Bodo Moeller <3moeller@informatik.uni-hamburg.de>]
+
+ *) Don't blow it for numeric -newkey arguments to apps/req.
+ [Bodo Moeller <3moeller@informatik.uni-hamburg.de>]
+
+ *) Temp key "for export" tests were wrong in s3_srvr.c.
+ [Anonymous <nobody@replay.com>]
+
+ *) Add prototype for temp key callback functions
+ SSL_CTX_set_tmp_{rsa,dh}_callback().
+ [Ben Laurie]
+
+ *) Make DH_free() tolerate being passed a NULL pointer (like RSA_free() and
+ DSA_free()). Make X509_PUBKEY_set() check for errors in d2i_PublicKey().
+ [Steve Henson]
+
+ *) X509_name_add_entry() freed the wrong thing after an error.
+ [Arne Ansper <arne@ats.cyber.ee>]
+
+ *) rsa_eay.c would attempt to free a NULL context.
+ [Arne Ansper <arne@ats.cyber.ee>]
+
+ *) BIO_s_socket() had a broken should_retry() on Windoze.
+ [Arne Ansper <arne@ats.cyber.ee>]
+
+ *) BIO_f_buffer() didn't pass on BIO_CTRL_FLUSH.
+ [Arne Ansper <arne@ats.cyber.ee>]
+
+ *) Make sure the already existing X509_STORE->depth variable is initialized
+ in X509_STORE_new(), but document the fact that this variable is still
+ unused in the certificate verification process.
+ [Ralf S. Engelschall]
+
+ *) Fix the various library and apps files to free up pkeys obtained from
+ X509_PUBKEY_get() et al. Also allow x509.c to handle netscape extensions.
+ [Steve Henson]
+
+ *) Fix reference counting in X509_PUBKEY_get(). This makes
+ demos/maurice/example2.c work, amongst others, probably.
+ [Steve Henson and Ben Laurie]
+
+ *) First cut of a cleanup for apps/. First the `ssleay' program is now named
+ `openssl' and second, the shortcut symlinks for the `openssl <command>'
+ are no longer created. This way we have a single and consistent command
+ line interface `openssl <command>', similar to `cvs <command>'.
+ [Ralf S. Engelschall, Paul Sutton and Ben Laurie]
+
+ *) ca.c: move test for DSA keys inside #ifndef NO_DSA. Make pubkey
+ BIT STRING wrapper always have zero unused bits.
+ [Steve Henson]
+
+ *) Add CA.pl, perl version of CA.sh, add extended key usage OID.
+ [Steve Henson]
+
+ *) Make the top-level INSTALL documentation easier to understand.
+ [Paul Sutton]
+
+ *) Makefiles updated to exit if an error occurs in a sub-directory
+ make (including if user presses ^C) [Paul Sutton]
+
+ *) Make Montgomery context stuff explicit in RSA data structure.
+ [Ben Laurie]
+
+ *) Fix build order of pem and err to allow for generated pem.h.
+ [Ben Laurie]
+
+ *) Fix renumbering bug in X509_NAME_delete_entry().
+ [Ben Laurie]
+
+ *) Enhanced the err-ins.pl script so it makes the error library number
+ global and can add a library name. This is needed for external ASN1 and
+ other error libraries.
+ [Steve Henson]
+
+ *) Fixed sk_insert which never worked properly.
+ [Steve Henson]
+
+ *) Fix ASN1 macros so they can handle indefinite length constructed
+ EXPLICIT tags. Some non standard certificates use these: they can now
+ be read in.
+ [Steve Henson]
+
+ *) Merged the various old/obsolete SSLeay documentation files (doc/xxx.doc)
+ into a single doc/ssleay.txt bundle. This way the information is still
+ preserved but no longer messes up this directory. Now it's new room for
+ the new set of documentation files.
+ [Ralf S. Engelschall]
+
+ *) SETs were incorrectly DER encoded. This was a major pain, because they
+ shared code with SEQUENCEs, which aren't coded the same. This means that
+ almost everything to do with SETs or SEQUENCEs has either changed name or
+ number of arguments.
+ [Ben Laurie, based on a partial fix by GP Jayan <gp@nsj.co.jp>]
+
+ *) Fix test data to work with the above.
+ [Ben Laurie]
+
+ *) Fix the RSA header declarations that hid a bug I fixed in 0.9.0b but
+ was already fixed by Eric for 0.9.1 it seems.
+ [Ben Laurie - pointed out by Ulf Möller <ulf@fitug.de>]
+
+ *) Autodetect FreeBSD3.
+ [Ben Laurie]
+
+ *) Fix various bugs in Configure. This affects the following platforms:
+ nextstep
+ ncr-scde
+ unixware-2.0
+ unixware-2.0-pentium
+ sco5-cc.
+ [Ben Laurie]
+
+ *) Eliminate generated files from CVS. Reorder tests to regenerate files
+ before they are needed.
+ [Ben Laurie]
+
+ *) Generate Makefile.ssl from Makefile.org (to keep CVS happy).
+ [Ben Laurie]
+
+
+ Changes between 0.9.1b and 0.9.1c [23-Dec-1998]
+
+ *) Added OPENSSL_VERSION_NUMBER to crypto/crypto.h and
+ changed SSLeay to OpenSSL in version strings.
+ [Ralf S. Engelschall]
+
+ *) Some fixups to the top-level documents.
+ [Paul Sutton]
+
+ *) Fixed the nasty bug where rsaref.h was not found under compile-time
+ because the symlink to include/ was missing.
+ [Ralf S. Engelschall]
+
+ *) Incorporated the popular no-RSA/DSA-only patches
+ which allow to compile a RSA-free SSLeay.
+ [Andrew Cooke / Interrader Ldt., Ralf S. Engelschall]
+
+ *) Fixed nasty rehash problem under `make -f Makefile.ssl links'
+ when "ssleay" is still not found.
+ [Ralf S. Engelschall]
+
+ *) Added more platforms to Configure: Cray T3E, HPUX 11,
+ [Ralf S. Engelschall, Beckmann <beckman@acl.lanl.gov>]
+
+ *) Updated the README file.
+ [Ralf S. Engelschall]
+
+ *) Added various .cvsignore files in the CVS repository subdirs
+ to make a "cvs update" really silent.
+ [Ralf S. Engelschall]
+
+ *) Recompiled the error-definition header files and added
+ missing symbols to the Win32 linker tables.
+ [Ralf S. Engelschall]
+
+ *) Cleaned up the top-level documents;
+ o new files: CHANGES and LICENSE
+ o merged VERSION, HISTORY* and README* files a CHANGES.SSLeay
+ o merged COPYRIGHT into LICENSE
+ o removed obsolete TODO file
+ o renamed MICROSOFT to INSTALL.W32
+ [Ralf S. Engelschall]
+
+ *) Removed dummy files from the 0.9.1b source tree:
+ crypto/asn1/x crypto/bio/cd crypto/bio/fg crypto/bio/grep crypto/bio/vi
+ crypto/bn/asm/......add.c crypto/bn/asm/a.out crypto/dsa/f crypto/md5/f
+ crypto/pem/gmon.out crypto/perlasm/f crypto/pkcs7/build crypto/rsa/f
+ crypto/sha/asm/f crypto/threads/f ms/zzz ssl/f ssl/f.mak test/f
+ util/f.mak util/pl/f util/pl/f.mak crypto/bf/bf_locl.old apps/f
+ [Ralf S. Engelschall]
+
+ *) Added various platform portability fixes.
+ [Mark J. Cox]
+
+ *) The Genesis of the OpenSSL rpject:
+ We start with the latest (unreleased) SSLeay version 0.9.1b which Eric A.
+ Young and Tim J. Hudson created while they were working for C2Net until
+ summer 1998.
+ [The OpenSSL Project]
+
+
+ Changes between 0.9.0b and 0.9.1b [not released]
+
+ *) Updated a few CA certificates under certs/
+ [Eric A. Young]
+
+ *) Changed some BIGNUM api stuff.
+ [Eric A. Young]
+
+ *) Various platform ports: OpenBSD, Ultrix, IRIX 64bit, NetBSD,
+ DGUX x86, Linux Alpha, etc.
+ [Eric A. Young]
+
+ *) New COMP library [crypto/comp/] for SSL Record Layer Compression:
+ RLE (dummy implemented) and ZLIB (really implemented when ZLIB is
+ available).
+ [Eric A. Young]
+
+ *) Add -strparse option to asn1pars program which parses nested
+ binary structures
+ [Dr Stephen Henson <shenson@bigfoot.com>]
+
+ *) Added "oid_file" to ssleay.cnf for "ca" and "req" programs.
+ [Eric A. Young]
+
+ *) DSA fix for "ca" program.
+ [Eric A. Young]
+
+ *) Added "-genkey" option to "dsaparam" program.
+ [Eric A. Young]
+
+ *) Added RIPE MD160 (rmd160) message digest.
+ [Eric A. Young]
+
+ *) Added -a (all) option to "ssleay version" command.
+ [Eric A. Young]
+
+ *) Added PLATFORM define which is the id given to Configure.
+ [Eric A. Young]
+
+ *) Added MemCheck_XXXX functions to crypto/mem.c for memory checking.
+ [Eric A. Young]
+
+ *) Extended the ASN.1 parser routines.
+ [Eric A. Young]
+
+ *) Extended BIO routines to support REUSEADDR, seek, tell, etc.
+ [Eric A. Young]
+
+ *) Added a BN_CTX to the BN library.
+ [Eric A. Young]
+
+ *) Fixed the weak key values in DES library
+ [Eric A. Young]
+
+ *) Changed API in EVP library for cipher aliases.
+ [Eric A. Young]
+
+ *) Added support for RC2/64bit cipher.
+ [Eric A. Young]
+
+ *) Converted the lhash library to the crypto/mem.c functions.
+ [Eric A. Young]
+
+ *) Added more recognized ASN.1 object ids.
+ [Eric A. Young]
+
+ *) Added more RSA padding checks for SSL/TLS.
+ [Eric A. Young]
+
+ *) Added BIO proxy/filter functionality.
+ [Eric A. Young]
+
+ *) Added extra_certs to SSL_CTX which can be used
+ send extra CA certificates to the client in the CA cert chain sending
+ process. It can be configured with SSL_CTX_add_extra_chain_cert().
+ [Eric A. Young]
+
+ *) Now Fortezza is denied in the authentication phase because
+ this is key exchange mechanism is not supported by SSLeay at all.
+ [Eric A. Young]
+
+ *) Additional PKCS1 checks.
+ [Eric A. Young]
+
+ *) Support the string "TLSv1" for all TLS v1 ciphers.
+ [Eric A. Young]
+
+ *) Added function SSL_get_ex_data_X509_STORE_CTX_idx() which gives the
+ ex_data index of the SSL context in the X509_STORE_CTX ex_data.
+ [Eric A. Young]
+
+ *) Fixed a few memory leaks.
+ [Eric A. Young]
+
+ *) Fixed various code and comment typos.
+ [Eric A. Young]
+
+ *) A minor bug in ssl/s3_clnt.c where there would always be 4 0
+ bytes sent in the client random.
+ [Edward Bishop <ebishop@spyglass.com>]
+
diff --git a/openssl-1.1.0h/CONTRIBUTING b/openssl-1.1.0h/CONTRIBUTING
new file mode 100644
index 0000000..1eebaf3
--- /dev/null
+++ b/openssl-1.1.0h/CONTRIBUTING
@@ -0,0 +1,54 @@
+HOW TO CONTRIBUTE PATCHES TO OpenSSL
+------------------------------------
+
+(Please visit https://www.openssl.org/community/getting-started.html for
+other ideas about how to contribute.)
+
+Development is coordinated on the openssl-dev mailing list (see the
+above link or https://mta.openssl.org for information on subscribing).
+If you are unsure as to whether a feature will be useful for the general
+OpenSSL community you might want to discuss it on the openssl-dev mailing
+list first. Someone may be already working on the same thing or there
+may be a good reason as to why that feature isn't implemented.
+
+To submit a patch, make a pull request on GitHub. If you think the patch
+could use feedback from the community, please start a thread on openssl-dev
+to discuss it.
+
+Having addressed the following items before the PR will help make the
+acceptance and review process faster:
+
+ 1. Anything other than trivial contributions will require a contributor
+ licensing agreement, giving us permission to use your code. See
+ https://www.openssl.org/policies/cla.html for details.
+
+ 2. All source files should start with the following text (with
+ appropriate comment characters at the start of each line and the
+ year(s) updated):
+
+ Copyright 20xx-20yy The OpenSSL Project Authors. All Rights Reserved.
+
+ Licensed under the OpenSSL license (the "License"). You may not use
+ this file except in compliance with the License. You can obtain a copy
+ in the file LICENSE in the source distribution or at
+ https://www.openssl.org/source/license.html
+
+ 3. Patches should be as current as possible; expect to have to rebase
+ often. We do not accept merge commits; You will be asked to remove
+ them before a patch is considered acceptable.
+
+ 4. Patches should follow our coding style (see
+ https://www.openssl.org/policies/codingstyle.html) and compile without
+ warnings. Where gcc or clang is available you should use the
+ --strict-warnings Configure option. OpenSSL compiles on many varied
+ platforms: try to ensure you only use portable features.
+ Clean builds via Travis and AppVeyor are expected, and done whenever
+ a PR is created or updated.
+
+ 5. When at all possible, patches should include tests. These can
+ either be added to an existing test, or completely new. Please see
+ test/README for information on the test framework.
+
+ 6. New features or changed functionality must include
+ documentation. Please look at the "pod" files in doc/apps, doc/crypto
+ and doc/ssl for examples of our style.
diff --git a/openssl-1.1.0h/Configurations/00-base-templates.conf b/openssl-1.1.0h/Configurations/00-base-templates.conf
new file mode 100644
index 0000000..3455b3a
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/00-base-templates.conf
@@ -0,0 +1,293 @@
+# -*- Mode: perl -*-
+%targets=(
+ DEFAULTS => {
+ template => 1,
+
+ cflags => "",
+ defines => [],
+ thread_scheme => "(unknown)", # Assume we don't know
+ thread_defines => [],
+
+ apps_aux_src => "",
+ cpuid_asm_src => "mem_clr.c",
+ uplink_aux_src => "",
+ bn_asm_src => "bn_asm.c",
+ ec_asm_src => "",
+ des_asm_src => "des_enc.c fcrypt_b.c",
+ aes_asm_src => "aes_core.c aes_cbc.c",
+ bf_asm_src => "bf_enc.c",
+ md5_asm_src => "",
+ cast_asm_src => "c_enc.c",
+ rc4_asm_src => "rc4_enc.c rc4_skey.c",
+ rmd160_asm_src => "",
+ rc5_asm_src => "rc5_enc.c",
+ wp_asm_src => "wp_block.c",
+ cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c",
+ modes_asm_src => "",
+ padlock_asm_src => "",
+ chacha_asm_src => "chacha_enc.c",
+ poly1305_asm_src => "",
+
+ unistd => "<unistd.h>",
+ shared_target => "",
+ shared_cflag => "",
+ shared_defines => [],
+ shared_ldflag => "",
+ shared_rcflag => "",
+ shared_extension => "",
+
+ build_scheme => [ "unified", "unix" ],
+ build_file => "Makefile",
+ },
+
+ BASE_common => {
+ template => 1,
+ defines =>
+ sub {
+ my @defs = ();
+ push @defs, "ZLIB" unless $disabled{zlib};
+ push @defs, "ZLIB_SHARED" unless $disabled{"zlib-dynamic"};
+ return [ @defs ];
+ },
+ },
+
+ BASE_unix => {
+ inherit_from => [ "BASE_common" ],
+ template => 1,
+
+ ex_libs =>
+ sub {
+ unless ($disabled{zlib}) {
+ if (defined($disabled{"zlib-dynamic"})) {
+ if (defined($withargs{zlib_lib})) {
+ return "-L".$withargs{zlib_lib}." -lz";
+ } else {
+ return "-lz";
+ }
+ }
+ }
+ return (); },
+
+ build_scheme => [ "unified", "unix" ],
+ build_file => "Makefile",
+ },
+
+ BASE_Windows => {
+ inherit_from => [ "BASE_common" ],
+ template => 1,
+
+ ex_libs =>
+ sub {
+ unless ($disabled{zlib}) {
+ if (defined($disabled{"zlib-dynamic"})) {
+ return $withargs{zlib_lib} // "ZLIB1";
+ }
+ }
+ return ();
+ },
+
+ ld => "link",
+ lflags => "/nologo",
+ loutflag => "/out:",
+ ar => "lib",
+ arflags => "/nologo",
+ aroutflag => "/out:",
+ rc => "rc",
+ rcoutflag => "/fo",
+ mt => "mt",
+ mtflags => "-nologo",
+ mtinflag => "-manifest ",
+ mtoutflag => "-outputresource:",
+
+ build_file => "makefile",
+ build_scheme => [ "unified", "windows" ],
+ },
+
+ BASE_VMS => {
+ inherit_from => [ "BASE_common" ],
+ template => 1,
+
+ build_file => "descrip.mms",
+ build_scheme => [ "unified", "VMS" ],
+ },
+
+ uplink_common => {
+ template => 1,
+ apps_aux_src => add("../ms/applink.c"),
+ uplink_aux_src => add("../ms/uplink.c"),
+ defines => add("OPENSSL_USE_APPLINK"),
+ },
+ x86_uplink => {
+ inherit_from => [ "uplink_common" ],
+ template => 1,
+ uplink_aux_src => add("uplink-x86.s"),
+ },
+ x86_64_uplink => {
+ inherit_from => [ "uplink_common" ],
+ template => 1,
+ uplink_aux_src => add("uplink-x86_64.s"),
+ },
+ ia64_uplink => {
+ inherit_from => [ "uplink_common" ],
+ template => 1,
+ uplink_aux_src => add("uplink-ia64.s"),
+ },
+
+ x86_asm => {
+ template => 1,
+ cpuid_asm_src => "x86cpuid.s",
+ bn_asm_src => "bn-586.s co-586.s x86-mont.s x86-gf2m.s",
+ ec_asm_src => "ecp_nistz256.c ecp_nistz256-x86.s",
+ des_asm_src => "des-586.s crypt586.s",
+ aes_asm_src => "aes-586.s vpaes-x86.s aesni-x86.s",
+ bf_asm_src => "bf-586.s",
+ md5_asm_src => "md5-586.s",
+ cast_asm_src => "cast-586.s",
+ sha1_asm_src => "sha1-586.s sha256-586.s sha512-586.s",
+ rc4_asm_src => "rc4-586.s",
+ rmd160_asm_src => "rmd-586.s",
+ rc5_asm_src => "rc5-586.s",
+ wp_asm_src => "wp_block.c wp-mmx.s",
+ cmll_asm_src => "cmll-x86.s",
+ modes_asm_src => "ghash-x86.s",
+ padlock_asm_src => "e_padlock-x86.s",
+ chacha_asm_src => "chacha-x86.s",
+ poly1305_asm_src=> "poly1305-x86.s",
+ },
+ x86_elf_asm => {
+ template => 1,
+ inherit_from => [ "x86_asm" ],
+ perlasm_scheme => "elf"
+ },
+ x86_64_asm => {
+ template => 1,
+ cpuid_asm_src => "x86_64cpuid.s",
+ bn_asm_src => "asm/x86_64-gcc.c x86_64-mont.s x86_64-mont5.s x86_64-gf2m.s rsaz_exp.c rsaz-x86_64.s rsaz-avx2.s",
+ ec_asm_src => "ecp_nistz256.c ecp_nistz256-x86_64.s",
+ aes_asm_src => "aes-x86_64.s vpaes-x86_64.s bsaes-x86_64.s aesni-x86_64.s aesni-sha1-x86_64.s aesni-sha256-x86_64.s aesni-mb-x86_64.s",
+ md5_asm_src => "md5-x86_64.s",
+ sha1_asm_src => "sha1-x86_64.s sha256-x86_64.s sha512-x86_64.s sha1-mb-x86_64.s sha256-mb-x86_64.s",
+ rc4_asm_src => "rc4-x86_64.s rc4-md5-x86_64.s",
+ wp_asm_src => "wp-x86_64.s",
+ cmll_asm_src => "cmll-x86_64.s cmll_misc.c",
+ modes_asm_src => "ghash-x86_64.s aesni-gcm-x86_64.s",
+ padlock_asm_src => "e_padlock-x86_64.s",
+ chacha_asm_src => "chacha-x86_64.s",
+ poly1305_asm_src=> "poly1305-x86_64.s",
+ },
+ ia64_asm => {
+ template => 1,
+ cpuid_asm_src => "ia64cpuid.s",
+ bn_asm_src => "bn-ia64.s ia64-mont.s",
+ aes_asm_src => "aes_core.c aes_cbc.c aes-ia64.s",
+ md5_asm_src => "md5-ia64.s",
+ sha1_asm_src => "sha1-ia64.s sha256-ia64.s sha512-ia64.s",
+ rc4_asm_src => "rc4-ia64.s rc4_skey.c",
+ modes_asm_src => "ghash-ia64.s",
+ perlasm_scheme => "void"
+ },
+ sparcv9_asm => {
+ template => 1,
+ cpuid_asm_src => "sparcv9cap.c sparccpuid.S",
+ bn_asm_src => "asm/sparcv8plus.S sparcv9-mont.S sparcv9a-mont.S vis3-mont.S sparct4-mont.S sparcv9-gf2m.S",
+ ec_asm_src => "ecp_nistz256.c ecp_nistz256-sparcv9.S",
+ des_asm_src => "des_enc-sparc.S fcrypt_b.c dest4-sparcv9.S",
+ aes_asm_src => "aes_core.c aes_cbc.c aes-sparcv9.S aest4-sparcv9.S aesfx-sparcv9.S",
+ md5_asm_src => "md5-sparcv9.S",
+ sha1_asm_src => "sha1-sparcv9.S sha256-sparcv9.S sha512-sparcv9.S",
+ cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c cmllt4-sparcv9.S",
+ modes_asm_src => "ghash-sparcv9.S",
+ poly1305_asm_src=> "poly1305-sparcv9.S",
+ perlasm_scheme => "void"
+ },
+ sparcv8_asm => {
+ template => 1,
+ cpuid_asm_src => "",
+ bn_asm_src => "asm/sparcv8.S",
+ des_asm_src => "des_enc-sparc.S fcrypt_b.c",
+ perlasm_scheme => "void"
+ },
+ alpha_asm => {
+ template => 1,
+ cpuid_asm_src => "alphacpuid.s",
+ bn_asm_src => "bn_asm.c alpha-mont.S",
+ sha1_asm_src => "sha1-alpha.S",
+ modes_asm_src => "ghash-alpha.S",
+ perlasm_scheme => "void"
+ },
+ mips32_asm => {
+ template => 1,
+ bn_asm_src => "bn-mips.s mips-mont.s",
+ aes_asm_src => "aes_cbc.c aes-mips.S",
+ sha1_asm_src => "sha1-mips.S sha256-mips.S",
+ },
+ mips64_asm => {
+ inherit_from => [ "mips32_asm" ],
+ template => 1,
+ sha1_asm_src => add("sha512-mips.S"),
+ poly1305_asm_src=> "poly1305-mips.S",
+ },
+ s390x_asm => {
+ template => 1,
+ cpuid_asm_src => "s390xcap.c s390xcpuid.S",
+ bn_asm_src => "asm/s390x.S s390x-mont.S s390x-gf2m.s",
+ aes_asm_src => "aes-s390x.S aes-ctr.fake aes-xts.fake",
+ sha1_asm_src => "sha1-s390x.S sha256-s390x.S sha512-s390x.S",
+ rc4_asm_src => "rc4-s390x.s",
+ modes_asm_src => "ghash-s390x.S",
+ chacha_asm_src => "chacha-s390x.S",
+ poly1305_asm_src=> "poly1305-s390x.S",
+ },
+ armv4_asm => {
+ template => 1,
+ cpuid_asm_src => "armcap.c armv4cpuid.S",
+ bn_asm_src => "bn_asm.c armv4-mont.S armv4-gf2m.S",
+ ec_asm_src => "ecp_nistz256.c ecp_nistz256-armv4.S",
+ aes_asm_src => "aes_cbc.c aes-armv4.S bsaes-armv7.S aesv8-armx.S",
+ sha1_asm_src => "sha1-armv4-large.S sha256-armv4.S sha512-armv4.S",
+ modes_asm_src => "ghash-armv4.S ghashv8-armx.S",
+ chacha_asm_src => "chacha-armv4.S",
+ poly1305_asm_src=> "poly1305-armv4.S",
+ perlasm_scheme => "void"
+ },
+ aarch64_asm => {
+ template => 1,
+ cpuid_asm_src => "armcap.c arm64cpuid.S",
+ ec_asm_src => "ecp_nistz256.c ecp_nistz256-armv8.S",
+ bn_asm_src => "bn_asm.c armv8-mont.S",
+ aes_asm_src => "aes_core.c aes_cbc.c aesv8-armx.S vpaes-armv8.S",
+ sha1_asm_src => "sha1-armv8.S sha256-armv8.S sha512-armv8.S",
+ modes_asm_src => "ghashv8-armx.S",
+ chacha_asm_src => "chacha-armv8.S",
+ poly1305_asm_src=> "poly1305-armv8.S",
+ },
+ parisc11_asm => {
+ template => 1,
+ cpuid_asm_src => "pariscid.s",
+ bn_asm_src => "bn_asm.c parisc-mont.s",
+ aes_asm_src => "aes_core.c aes_cbc.c aes-parisc.s",
+ sha1_asm_src => "sha1-parisc.s sha256-parisc.s sha512-parisc.s",
+ rc4_asm_src => "rc4-parisc.s",
+ modes_asm_src => "ghash-parisc.s",
+ perlasm_scheme => "32"
+ },
+ parisc20_64_asm => {
+ template => 1,
+ inherit_from => [ "parisc11_asm" ],
+ perlasm_scheme => "64",
+ },
+ ppc64_asm => {
+ template => 1,
+ cpuid_asm_src => "ppccpuid.s ppccap.c",
+ bn_asm_src => "bn-ppc.s ppc-mont.s ppc64-mont.s",
+ aes_asm_src => "aes_core.c aes_cbc.c aes-ppc.s vpaes-ppc.s aesp8-ppc.s",
+ sha1_asm_src => "sha1-ppc.s sha256-ppc.s sha512-ppc.s sha256p8-ppc.s sha512p8-ppc.s",
+ modes_asm_src => "ghashp8-ppc.s",
+ chacha_asm_src => "chacha-ppc.s",
+ poly1305_asm_src=> "poly1305-ppc.s poly1305-ppcfp.s",
+ },
+ ppc32_asm => {
+ inherit_from => [ "ppc64_asm" ],
+ template => 1
+ },
+);
diff --git a/openssl-1.1.0h/Configurations/10-main.conf b/openssl-1.1.0h/Configurations/10-main.conf
new file mode 100644
index 0000000..b49f04b
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/10-main.conf
@@ -0,0 +1,1884 @@
+## -*- mode: perl; -*-
+## Standard openssl configuration targets.
+
+# Helper functions for the Windows configs
+my $vc_win64a_info = {};
+sub vc_win64a_info {
+ unless (%$vc_win64a_info) {
+ if (`nasm -v 2>NUL` =~ /NASM version ([0-9]+\.[0-9]+)/ && $1 >= 2.0) {
+ $vc_win64a_info = { as => "nasm",
+ asflags => "-f win64 -DNEAR -Ox -g",
+ asoutflag => "-o" };
+ } elsif ($disabled{asm}) {
+ $vc_win64a_info = { as => "ml64",
+ asflags => "/c /Cp /Cx /Zi",
+ asoutflag => "/Fo" };
+ } else {
+ $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
+ $vc_win64a_info = { as => "{unknown}",
+ asflags => "",
+ asoutflag => "" };
+ }
+ }
+ return $vc_win64a_info;
+}
+
+my $vc_win32_info = {};
+sub vc_win32_info {
+ unless (%$vc_win32_info) {
+ my $ver=`nasm -v 2>NUL`;
+ my $vew=`nasmw -v 2>NUL`;
+ if ($ver ne "" || $vew ne "") {
+ $vc_win32_info = { as => $ver ge $vew ? "nasm" : "nasmw",
+ asflags => "-f win32",
+ asoutflag => "-o",
+ perlasm_scheme => "win32n" };
+ } elsif ($disabled{asm}) {
+ $vc_win32_info = { as => "ml",
+ asflags => "/nologo /Cp /coff /c /Cx /Zi",
+ asoutflag => "/Fo",
+ perlasm_scheme => "win32" };
+ } else {
+ $die->("NASM not found - please read INSTALL and NOTES.WIN for further details\n");
+ $vc_win32_info = { as => "{unknown}",
+ asflags => "",
+ asoutflag => "",
+ perlasm_scheme => "win32" };
+ }
+ }
+ return $vc_win32_info;
+}
+
+my $vc_wince_info = {};
+sub vc_wince_info {
+ unless (%$vc_wince_info) {
+ # sanity check
+ $die->('%OSVERSION% is not defined') if (!defined($ENV{'OSVERSION'}));
+ $die->('%PLATFORM% is not defined') if (!defined($ENV{'PLATFORM'}));
+ $die->('%TARGETCPU% is not defined') if (!defined($ENV{'TARGETCPU'}));
+
+ #
+ # Idea behind this is to mimic flags set by eVC++ IDE...
+ #
+ my $wcevers = $ENV{'OSVERSION'}; # WCENNN
+ my $wcevernum;
+ my $wceverdotnum;
+ if ($wcevers =~ /^WCE([1-9])([0-9]{2})$/) {
+ $wcevernum = "$1$2";
+ $wceverdotnum = "$1.$2";
+ } else {
+ $die->('%OSVERSION% value is insane');
+ $wcevernum = "{unknown}";
+ $wceverdotnum = "{unknown}";
+ }
+ my $wcecdefs = "-D_WIN32_WCE=$wcevernum -DUNDER_CE=$wcevernum"; # -D_WIN32_WCE=NNN
+ my $wcelflag = "/subsystem:windowsce,$wceverdotnum"; # ...,N.NN
+
+ my $wceplatf = $ENV{'PLATFORM'};
+
+ $wceplatf =~ tr/a-z0-9 /A-Z0-9_/;
+ $wcecdefs .= " -DWCE_PLATFORM_$wceplatf";
+
+ my $wcetgt = $ENV{'TARGETCPU'}; # just shorter name...
+ SWITCH: for($wcetgt) {
+ /^X86/ && do { $wcecdefs.=" -Dx86 -D_X86_ -D_i386_ -Di_386_";
+ $wcelflag.=" /machine:X86"; last; };
+ /^ARMV4[IT]/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
+ $wcecdefs.=" -DTHUMB -D_THUMB_" if($wcetgt=~/T$/);
+ $wcecdefs.=" -QRarch4T -QRinterwork-return";
+ $wcelflag.=" /machine:THUMB"; last; };
+ /^ARM/ && do { $wcecdefs.=" -DARM -D_ARM_ -D$wcetgt";
+ $wcelflag.=" /machine:ARM"; last; };
+ /^MIPSIV/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
+ $wcecdefs.=" -D_MIPS64 -QMmips4 -QMn32";
+ $wcelflag.=" /machine:MIPSFPU"; last; };
+ /^MIPS16/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
+ $wcecdefs.=" -DMIPSII -QMmips16";
+ $wcelflag.=" /machine:MIPS16"; last; };
+ /^MIPSII/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000 -D$wcetgt";
+ $wcecdefs.=" -QMmips2";
+ $wcelflag.=" /machine:MIPS"; last; };
+ /^R4[0-9]{3}/ && do { $wcecdefs.=" -DMIPS -D_MIPS_ -DR4000";
+ $wcelflag.=" /machine:MIPS"; last; };
+ /^SH[0-9]/ && do { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_ -DSHx";
+ $wcecdefs.=" -Qsh4" if ($wcetgt =~ /^SH4/);
+ $wcelflag.=" /machine:$wcetgt"; last; };
+ { $wcecdefs.=" -D$wcetgt -D_${wcetgt}_";
+ $wcelflag.=" /machine:$wcetgt"; last; };
+ }
+
+ $vc_wince_info = { cflags => $wcecdefs,
+ lflags => $wcelflag };
+ }
+ return $vc_wince_info;
+}
+
+# Helper functions for the VMS configs
+my $vms_info = {};
+sub vms_info {
+ unless (%$vms_info) {
+ my $pointer_size = shift;
+ my $pointer_size_str = $pointer_size == 0 ? "" : "$pointer_size";
+
+ $vms_info->{disable_warns} = [ ];
+ $vms_info->{pointer_size} = $pointer_size_str;
+ if ($pointer_size == 64) {
+ `PIPE CC /NOCROSS_REFERENCE /NOLIST /NOOBJECT /WARNINGS = DISABLE = ( MAYLOSEDATA3, EMPTYFILE ) NL: 2> NL:`;
+ if ($? == 0) {
+ push @{$vms_info->{disable_warns}}, "MAYLOSEDATA3";
+ }
+ }
+
+ unless ($disabled{zlib}) {
+ my $default_zlib = 'GNV$LIBZSHR' . $pointer_size_str;
+ if (defined($disabled{"zlib-dynamic"})) {
+ $vms_info->{zlib} = $withargs{zlib_lib} || "$default_zlib/SHARE";
+ } else {
+ $vms_info->{def_zlib} = $withargs{zlib_lib} || $default_zlib;
+ # In case the --with-zlib-lib value contains something like
+ # /SHARE or /LIB or so at the end, remove it.
+ $vms_info->{def_zlib} =~ s|/.*$||g;
+ }
+ }
+ }
+ return $vms_info;
+}
+
+%targets = (
+
+#### Basic configs that should work on any 32-bit box
+ "gcc" => {
+ cc => "gcc",
+ cflags => picker(debug => "-O0 -g",
+ release => "-O3"),
+ thread_scheme => "(unknown)",
+ bn_ops => "BN_LLONG",
+ },
+ "cc" => {
+ cc => "cc",
+ cflags => "-O",
+ thread_scheme => "(unknown)",
+ },
+
+#### VOS Configurations
+ "vos-gcc" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "gcc",
+ cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
+ debug => "-O0 -g",
+ release => "-O3"),
+ thread_scheme => "(unknown)",
+ sys_id => "VOS",
+ lflags => "-Wl,-map",
+ bn_ops => "BN_LLONG",
+ shared_extension => ".so",
+ },
+
+#### Solaris configurations
+ "solaris-common" => {
+ inherit_from => [ "BASE_unix" ],
+ template => 1,
+ cflags => "-DFILIO_H",
+ ex_libs => add("-lsocket -lnsl -ldl"),
+ dso_scheme => "dlfcn",
+ thread_scheme => "pthreads",
+ shared_target => "solaris-shared",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+#### Solaris x86 with GNU C setups
+ "solaris-x86-gcc" => {
+ # NB. GNU C has to be configured to use GNU assembler, and not
+ # /usr/ccs/bin/as. Failure to comply will result in compile
+ # failures [at least] in 32-bit build.
+ # [Above statement is in direct contradition with one below.
+ # Latter is kept, because it's formally inappropriate to
+ # modify compile flags in letter release.]
+ # -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have
+ # to do it here because whenever GNU C instantiates an assembler
+ # template it surrounds it with #APP #NO_APP comment pair which
+ # (at least Solaris 7_x86) /usr/ccs/bin/as fails to assemble
+ # with "Illegal mnemonic" error message.
+ inherit_from => [ "solaris-common", asm("x86_elf_asm") ],
+ cc => "gcc",
+ cflags => add_before(picker(default => "-Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM",
+ debug => "-O0 -g",
+ release => "-O3 -fomit-frame-pointer"),
+ threads("-pthread")),
+ ex_libs => add(threads("-pthread")),
+ bn_ops => "BN_LLONG",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-shared -static-libgcc",
+ },
+ "solaris64-x86_64-gcc" => {
+ # -shared -static-libgcc might appear controversial, but modules
+ # taken from static libgcc do not have relocations and linking
+ # them into our shared objects doesn't have any negative side
+ # effects. On the contrary, doing so makes it possible to use
+ # gcc shared build with Sun C. Given that gcc generates faster
+ # code [thanks to inline assembler], I would actually recommend
+ # to consider using gcc shared build even with vendor compiler:-)
+ # <appro@fy.chalmers.se>
+ inherit_from => [ "solaris-common", asm("x86_64_asm") ],
+ cc => "gcc",
+ cflags => add_before(picker(default => "-m64 -Wall -DL_ENDIAN",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread")),
+ ex_libs => add(threads("-pthread")),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ perlasm_scheme => "elf",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-m64 -shared -static-libgcc",
+ multilib => "/64",
+ },
+
+#### Solaris x86 with Sun C setups
+ # There used to be solaris-x86-cc target, but it was removed,
+ # primarily because vendor assembler can't assemble our modules
+ # with -KPIC flag. As result it, assembly support, was not even
+ # available as option. But its lack means lack of side-channel
+ # resistant code, which is incompatible with security by todays
+ # standards. Fortunately gcc is readily available prepackaged
+ # option, which we can firmly point at...
+ #
+ # On related note, solaris64-x86_64-cc target won't compile code
+ # paths utilizing AVX and post-Haswell instruction extensions.
+ # Consider switching to solaris64-x86_64-gcc even here...
+ #
+ "solaris64-x86_64-cc" => {
+ inherit_from => [ "solaris-common", asm("x86_64_asm") ],
+ cc => "cc",
+ cflags => add_before(picker(default => "-xarch=generic64 -xstrconst -Xa -DL_ENDIAN",
+ debug => "-g",
+ release => "-xO5 -xdepend -xbuiltin"),
+ threads("-D_REENTRANT")),
+ thread_scheme => "pthreads",
+ lflags => add("-xarch=generic64",threads("-mt")),
+ ex_libs => add(threads("-lpthread")),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ perlasm_scheme => "elf",
+ shared_cflag => "-KPIC",
+ shared_ldflag => "-xarch=generic64 -G -dy -z text",
+ multilib => "/64",
+ },
+
+#### SPARC Solaris with GNU C setups
+ "solaris-sparcv7-gcc" => {
+ inherit_from => [ "solaris-common" ],
+ cc => "gcc",
+ cflags => add_before(picker(default => "-Wall -DB_ENDIAN -DBN_DIV2W",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread")),
+ ex_libs => add(threads("-pthread")),
+ bn_ops => "BN_LLONG RC4_CHAR",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-shared",
+ },
+ "solaris-sparcv8-gcc" => {
+ inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv8_asm") ],
+ cflags => add_before("-mcpu=v8"),
+ },
+ "solaris-sparcv9-gcc" => {
+ # -m32 should be safe to add as long as driver recognizes
+ # -mcpu=ultrasparc
+ inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
+ cflags => add_before("-m32 -mcpu=ultrasparc"),
+ },
+ "solaris64-sparcv9-gcc" => {
+ inherit_from => [ "solaris-sparcv9-gcc" ],
+ cflags => sub { my $f=join(" ",@_); $f =~ s/\-m32/-m64/; $f; },
+ bn_ops => "BN_LLONG RC4_CHAR",
+ shared_ldflag => "-m64 -shared",
+ multilib => "/64",
+ },
+
+#### SPARC Solaris with Sun C setups
+# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
+# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
+# SC5.0 note: Compiler common patch 107357-01 or later is required!
+ "solaris-sparcv7-cc" => {
+ inherit_from => [ "solaris-common" ],
+ cc => "cc",
+ cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
+ debug => "-g",
+ release => "-xO5 -xdepend"),
+ threads("-D_REENTRANT")),
+ lflags => add(threads("-mt")),
+ ex_libs => add(threads("-lpthread")),
+ bn_ops => "BN_LLONG RC4_CHAR",
+ shared_cflag => "-KPIC",
+ shared_ldflag => "-G -dy -z text",
+ },
+####
+ "solaris-sparcv8-cc" => {
+ inherit_from => [ "solaris-sparcv7-cc", asm("sparcv8_asm") ],
+ cflags => add_before("-xarch=v8"),
+ },
+ "solaris-sparcv9-cc" => {
+ inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
+ cflags => add_before("-xarch=v8plus"),
+ },
+ "solaris64-sparcv9-cc" => {
+ inherit_from => [ "solaris-sparcv7-cc", asm("sparcv9_asm") ],
+ cflags => add_before("-xarch=v9"),
+ lflags => add_before("-xarch=v9"),
+ bn_ops => "BN_LLONG RC4_CHAR",
+ shared_ldflag => "-xarch=v9 -G -dy -z text",
+ multilib => "/64",
+ },
+
+#### IRIX 6.x configs
+# Only N32 and N64 ABIs are supported.
+ "irix-mips3-gcc" => {
+ inherit_from => [ "BASE_unix", asm("mips64_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-mabi=n32 -DB_ENDIAN -DBN_DIV3W",
+ debug => "-g -O0",
+ release => "-O3"),
+ threads("-D_SGI_MP_SOURCE")),
+ ex_libs => add(threads("-lpthread")),
+ bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "n32",
+ dso_scheme => "dlfcn",
+ shared_target => "irix-shared",
+ shared_ldflag => "-mabi=n32",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "32",
+ },
+ "irix-mips3-cc" => {
+ inherit_from => [ "BASE_unix", asm("mips64_asm") ],
+ cc => "cc",
+ cflags => combine(picker(default => "-n32 -mips3 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
+ debug => "-g -O0",
+ release => "-O2"),
+ threads("-D_SGI_MP_SOURCE")),
+ ex_libs => add(threads("-lpthread")),
+ bn_ops => "RC4_CHAR SIXTY_FOUR_BIT",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "n32",
+ dso_scheme => "dlfcn",
+ shared_target => "irix-shared",
+ shared_ldflag => "-n32",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "32",
+ },
+ # N64 ABI builds.
+ "irix64-mips4-gcc" => {
+ inherit_from => [ "BASE_unix", asm("mips64_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-mabi=64 -mips4 -DB_ENDIAN -DBN_DIV3W",
+ debug => "-g -O0",
+ release => "-O3"),
+ threads("-D_SGI_MP_SOURCE")),
+ ex_libs => add(threads("-lpthread")),
+ bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "64",
+ dso_scheme => "dlfcn",
+ shared_target => "irix-shared",
+ shared_ldflag => "-mabi=64",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "64",
+ },
+ "irix64-mips4-cc" => {
+ inherit_from => [ "BASE_unix", asm("mips64_asm") ],
+ cc => "cc",
+ cflags => combine(picker(default => "-64 -mips4 -use_readonly_const -G0 -rdata_shared -DB_ENDIAN -DBN_DIV3W",
+ debug => "-g -O0",
+ release => "-O2"),
+ threads("-D_SGI_MP_SOURCE")),
+ ex_libs => add(threads("-lpthread")),
+ bn_ops => "RC4_CHAR SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "64",
+ dso_scheme => "dlfcn",
+ shared_target => "irix-shared",
+ shared_ldflag => "-64",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "64",
+ },
+
+#### Unified HP-UX ANSI C configs.
+# Special notes:
+# - Originally we were optimizing at +O4 level. It should be noted
+# that the only difference between +O3 and +O4 is global inter-
+# procedural analysis. As it has to be performed during the link
+# stage the compiler leaves behind certain pseudo-code in lib*.a
+# which might be release or even patch level specific. Generating
+# the machine code for and analyzing the *whole* program appears
+# to be *extremely* memory demanding while the performance gain is
+# actually questionable. The situation is intensified by the default
+# HP-UX data set size limit (infamous 'maxdsiz' tunable) of 64MB
+# which is way too low for +O4. In other words, doesn't +O3 make
+# more sense?
+# - Keep in mind that the HP compiler by default generates code
+# suitable for execution on the host you're currently compiling at.
+# If the toolkit is meant to be used on various PA-RISC processors
+# consider './Configure hpux-parisc-[g]cc +DAportable'.
+# - -DMD32_XARRAY triggers workaround for compiler bug we ran into in
+# 32-bit message digests. (For the moment of this writing) HP C
+# doesn't seem to "digest" too many local variables (they make "him"
+# chew forever:-). For more details look-up MD32_XARRAY comment in
+# crypto/sha/sha_lcl.h.
+# - originally there were 32-bit hpux-parisc2-* targets. They were
+# scrapped, because a) they were not interchangeable with other 32-bit
+# targets; b) performance-critical 32-bit assembly modules implement
+# even PA-RISC 2.0-specific code paths, which are chosen at run-time,
+# thus adequate performance is provided even with PA-RISC 1.1 build.
+# <appro@fy.chalmers.se>
+ "hpux-parisc-gcc" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-DB_ENDIAN -DBN_DIV2W",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread")),
+ ex_libs => add("-Wl,+s -ldld", threads("-pthread")),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dl",
+ shared_target => "hpux-shared",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-shared",
+ shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "hpux-parisc1_1-gcc" => {
+ inherit_from => [ "hpux-parisc-gcc", asm("parisc11_asm") ],
+ multilib => "/pa1.1",
+ },
+ "hpux64-parisc2-gcc" => {
+ inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-DB_ENDIAN",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-D_REENTRANT")),
+ ex_libs => add("-ldl"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "hpux-shared",
+ shared_cflag => "-fpic",
+ shared_ldflag => "-shared",
+ shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "/pa20_64",
+ },
+
+ # More attempts at unified 10.X and 11.X targets for HP C compiler.
+ #
+ # Chris Ruemmler <ruemmler@cup.hp.com>
+ # Kevin Steves <ks@hp.se>
+ "hpux-parisc-cc" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => combine(picker(default => "+Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY",
+ debug => "+O0 +d -g",
+ release => "+O3"),
+ threads("-D_REENTRANT")),
+ ex_libs => add("-Wl,+s -ldld",threads("-lpthread")),
+ bn_ops => "RC4_CHAR",
+ thread_scheme => "pthreads",
+ dso_scheme => "dl",
+ shared_target => "hpux-shared",
+ shared_cflag => "+Z",
+ shared_ldflag => "-b",
+ shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "hpux-parisc1_1-cc" => {
+ inherit_from => [ "hpux-parisc-cc", asm("parisc11_asm") ],
+ cflags => add_before("+DA1.1"),
+ multilib => "/pa1.1",
+ },
+ "hpux64-parisc2-cc" => {
+ inherit_from => [ "BASE_unix", asm("parisc20_64_asm") ],
+ cc => "cc",
+ cflags => combine(picker(default => "+DD64 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY",
+ debug => "+O0 +d -g",
+ release => "+O3"),
+ threads("-D_REENTRANT")),
+ ex_libs => add("-ldl",threads("-lpthread")),
+ bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "hpux-shared",
+ shared_cflag => "+Z",
+ shared_ldflag => "+DD64 -b",
+ shared_extension => ".sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "/pa20_64",
+ },
+
+ # HP/UX IA-64 targets
+ "hpux-ia64-cc" => {
+ inherit_from => [ "BASE_unix", asm("ia64_asm") ],
+ cc => "cc",
+ cflags => combine(picker(default => "-Ae +DD32 +Olit=all -z -DB_ENDIAN",
+ debug => "+O0 +d -g",
+ release => "+O2"),
+ threads("-D_REENTRANT")),
+ ex_libs => add("-ldl",threads("-lpthread")),
+ bn_ops => "SIXTY_FOUR_BIT",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "hpux-shared",
+ shared_cflag => "+Z",
+ shared_ldflag => "+DD32 -b",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "/hpux32",
+ },
+ # Frank Geurts <frank.geurts@nl.abnamro.com> has patiently assisted
+ # with debugging of the following config.
+ "hpux64-ia64-cc" => {
+ inherit_from => [ "BASE_unix", asm("ia64_asm") ],
+ cc => "cc",
+ cflags => combine(picker(default => "-Ae +DD64 +Olit=all -z -DB_ENDIAN",
+ debug => "+O0 +d -g",
+ release => "+O3"),
+ threads("-D_REENTRANT")),
+ ex_libs => add("-ldl", threads("-lpthread")),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "hpux-shared",
+ shared_cflag => "+Z",
+ shared_ldflag => "+DD64 -b",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "/hpux64",
+ },
+ # GCC builds...
+ "hpux-ia64-gcc" => {
+ inherit_from => [ "BASE_unix", asm("ia64_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-DB_ENDIAN",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread")),
+ ex_libs => add("-ldl", threads("-pthread")),
+ bn_ops => "SIXTY_FOUR_BIT",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "hpux-shared",
+ shared_cflag => "-fpic",
+ shared_ldflag => "-shared",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "/hpux32",
+ },
+ "hpux64-ia64-gcc" => {
+ inherit_from => [ "BASE_unix", asm("ia64_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-mlp64 -DB_ENDIAN",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread")),
+ ex_libs => add("-ldl", threads("-pthread")),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "hpux-shared",
+ shared_cflag => "-fpic",
+ shared_ldflag => "-mlp64 -shared",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "/hpux64",
+ },
+
+#### HP MPE/iX http://jazz.external.hp.com/src/openssl/
+ "MPE/iX-gcc" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "gcc",
+ cflags => "-DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB",
+ sys_id => "MPE",
+ ex_libs => add("-L/SYSLOG/PUB -lsyslog -lsocket -lcurses"),
+ thread_scheme => "(unknown)",
+ bn_ops => "BN_LLONG",
+ },
+
+#### DEC Alpha Tru64 targets. Tru64 is marketing name for OSF/1 version 4
+#### and forward. In reality 'uname -s' still returns "OSF1". Originally
+#### there were even osf1-* configs targeting prior versions provided,
+#### but not anymore...
+ "tru64-alpha-gcc" => {
+ inherit_from => [ "BASE_unix", asm("alpha_asm") ],
+ cc => "gcc",
+ cflags => combine("-std=c9x -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -O3",
+ threads("-pthread")),
+ ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "alpha-osf1-shared",
+ shared_extension => ".so",
+ },
+ "tru64-alpha-cc" => {
+ inherit_from => [ "BASE_unix", asm("alpha_asm") ],
+ cc => "cc",
+ cflags => combine("-std1 -D_XOPEN_SOURCE=500 -D_OSF_SOURCE -tune host -fast -readonly_strings",
+ threads("-pthread")),
+ ex_libs => add("-lrt", threads("-pthread")), # for mlock(2)
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "alpha-osf1-shared",
+ shared_ldflag => "-msym",
+ shared_extension => ".so",
+ },
+
+####
+#### Variety of LINUX:-)
+####
+# *-generic* is endian-neutral target, but ./config is free to
+# throw in -D[BL]_ENDIAN, whichever appropriate...
+ "linux-generic32" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-Wall",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread")),
+ ex_libs => add("-ldl", threads("-pthread")),
+ bn_ops => "BN_LLONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "linux-shared",
+ shared_cflag => "-fPIC -DOPENSSL_USE_NODELETE",
+ shared_ldflag => "-Wl,-znodelete",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "linux-generic64" => {
+ inherit_from => [ "linux-generic32" ],
+ bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+ },
+
+ "linux-ppc" => {
+ inherit_from => [ "linux-generic32", asm("ppc32_asm") ],
+ perlasm_scheme => "linux32",
+ },
+ "linux-ppc64" => {
+ inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
+ cflags => add("-m64 -DB_ENDIAN"),
+ perlasm_scheme => "linux64",
+ shared_ldflag => add("-m64"),
+ multilib => "64",
+ },
+ "linux-ppc64le" => {
+ inherit_from => [ "linux-generic64", asm("ppc64_asm") ],
+ cflags => add("-m64 -DL_ENDIAN"),
+ perlasm_scheme => "linux64le",
+ shared_ldflag => add("-m64"),
+ },
+
+ "linux-armv4" => {
+ ################################################################
+ # Note that -march is not among compiler options in linux-armv4
+ # target description. Not specifying one is intentional to give
+ # you choice to:
+ #
+ # a) rely on your compiler default by not specifying one;
+ # b) specify your target platform explicitly for optimal
+ # performance, e.g. -march=armv6 or -march=armv7-a;
+ # c) build "universal" binary that targets *range* of platforms
+ # by specifying minimum and maximum supported architecture;
+ #
+ # As for c) option. It actually makes no sense to specify
+ # maximum to be less than ARMv7, because it's the least
+ # requirement for run-time switch between platform-specific
+ # code paths. And without run-time switch performance would be
+ # equivalent to one for minimum. Secondly, there are some
+ # natural limitations that you'd have to accept and respect.
+ # Most notably you can *not* build "universal" binary for
+ # big-endian platform. This is because ARMv7 processor always
+ # picks instructions in little-endian order. Another similar
+ # limitation is that -mthumb can't "cross" -march=armv6t2
+ # boundary, because that's where it became Thumb-2. Well, this
+ # limitation is a bit artificial, because it's not really
+ # impossible, but it's deemed too tricky to support. And of
+ # course you have to be sure that your binutils are actually
+ # up to the task of handling maximum target platform. With all
+ # this in mind here is an example of how to configure
+ # "universal" build:
+ #
+ # ./Configure linux-armv4 -march=armv6 -D__ARM_MAX_ARCH__=8
+ #
+ inherit_from => [ "linux-generic32", asm("armv4_asm") ],
+ perlasm_scheme => "linux32",
+ },
+ "linux-aarch64" => {
+ inherit_from => [ "linux-generic64", asm("aarch64_asm") ],
+ perlasm_scheme => "linux64",
+ },
+ "linux-arm64ilp32" => { # https://wiki.linaro.org/Platform/arm64-ilp32
+ inherit_from => [ "linux-generic32", asm("aarch64_asm") ],
+ cflags => add("-mabi=ilp32"),
+ bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
+ perlasm_scheme => "linux64",
+ shared_ldflag => add("-mabi=ilp32"),
+ },
+
+ "linux-mips32" => {
+ # Configure script adds minimally required -march for assembly
+ # support, if no -march was specified at command line.
+ inherit_from => [ "linux-generic32", asm("mips32_asm") ],
+ cflags => add("-mabi=32 -DBN_DIV3W"),
+ perlasm_scheme => "o32",
+ shared_ldflag => add("-mabi=32"),
+ },
+ # mips32 and mips64 below refer to contemporary MIPS Architecture
+ # specifications, MIPS32 and MIPS64, rather than to kernel bitness.
+ "linux-mips64" => {
+ inherit_from => [ "linux-generic32", asm("mips64_asm") ],
+ cflags => add("-mabi=n32 -DBN_DIV3W"),
+ bn_ops => "SIXTY_FOUR_BIT RC4_CHAR",
+ perlasm_scheme => "n32",
+ shared_ldflag => add("-mabi=n32"),
+ multilib => "32",
+ },
+ "linux64-mips64" => {
+ inherit_from => [ "linux-generic64", asm("mips64_asm") ],
+ cflags => add("-mabi=64 -DBN_DIV3W"),
+ perlasm_scheme => "64",
+ shared_ldflag => add("-mabi=64"),
+ multilib => "64",
+ },
+
+ #### IA-32 targets...
+ #### These two targets are a bit aged and are to be used on older Linux
+ #### machines where gcc doesn't understand -m32 and -m64
+ "linux-elf" => {
+ inherit_from => [ "linux-generic32", asm("x86_elf_asm") ],
+ cflags => add(picker(default => "-DL_ENDIAN",
+ release => "-fomit-frame-pointer")),
+ bn_ops => "BN_LLONG",
+ },
+ "linux-aout" => {
+ inherit_from => [ "BASE_unix", asm("x86_asm") ],
+ cc => "gcc",
+ cflags => add(picker(default => "-DL_ENDIAN -Wall",
+ debug => "-O0 -g",
+ release => "-O3 -fomit-frame-pointer")),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "(unknown)",
+ perlasm_scheme => "a.out",
+ },
+
+ #### X86 / X86_64 targets
+ "linux-x86" => {
+ inherit_from => [ "linux-generic32", asm("x86_asm") ],
+ cflags => add(picker(default => "-m32 -DL_ENDIAN",
+ release => "-fomit-frame-pointer")),
+ bn_ops => "BN_LLONG",
+ perlasm_scheme => "elf",
+ shared_ldflag => add("-m32"),
+ },
+ "linux-x86-clang" => {
+ inherit_from => [ "linux-x86" ],
+ cc => "clang",
+ cxx => "clang++",
+ cflags => add("-Wextra -Qunused-arguments"),
+ },
+ "linux-x86_64" => {
+ inherit_from => [ "linux-generic64", asm("x86_64_asm") ],
+ cflags => add("-m64 -DL_ENDIAN"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ perlasm_scheme => "elf",
+ shared_ldflag => add("-m64"),
+ multilib => "64",
+ },
+ "linux-x86_64-clang" => {
+ inherit_from => [ "linux-x86_64" ],
+ cc => "clang",
+ cflags => add("-Wextra -Qunused-arguments"),
+ },
+ "linux-x32" => {
+ inherit_from => [ "linux-generic32", asm("x86_64_asm") ],
+ cflags => add("-mx32 -DL_ENDIAN"),
+ bn_ops => "SIXTY_FOUR_BIT",
+ perlasm_scheme => "elf32",
+ shared_ldflag => add("-mx32"),
+ multilib => "x32",
+ },
+
+ "linux-ia64" => {
+ inherit_from => [ "linux-generic64", asm("ia64_asm") ],
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ },
+
+ "linux64-s390x" => {
+ inherit_from => [ "linux-generic64", asm("s390x_asm") ],
+ cflags => add("-m64 -DB_ENDIAN"),
+ perlasm_scheme => "64",
+ shared_ldflag => add("-m64"),
+ multilib => "64",
+ },
+ "linux32-s390x" => {
+ #### So called "highgprs" target for z/Architecture CPUs
+ # "Highgprs" is kernel feature first implemented in Linux
+ # 2.6.32, see /proc/cpuinfo. The idea is to preserve most
+ # significant bits of general purpose registers not only
+ # upon 32-bit process context switch, but even on
+ # asynchronous signal delivery to such process. This makes
+ # it possible to deploy 64-bit instructions even in legacy
+ # application context and achieve better [or should we say
+ # adequate] performance. The build is binary compatible with
+ # linux-generic32, and the idea is to be able to install the
+ # resulting libcrypto.so alongside generic one, e.g. as
+ # /lib/highgprs/libcrypto.so.x.y, for ldconfig and run-time
+ # linker to autodiscover. Unfortunately it doesn't work just
+ # yet, because of couple of bugs in glibc
+ # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1...
+ #
+ inherit_from => [ "linux-generic32", asm("s390x_asm") ],
+ cflags => add("-m31 -Wa,-mzarch -DB_ENDIAN"),
+ bn_asm_src => sub { my $r=join(" ",@_); $r=~s|asm/s390x\.S|bn_asm.c|; $r; },
+ perlasm_scheme => "31",
+ shared_ldflag => add("-m31"),
+ multilib => "/highgprs",
+ },
+
+ #### SPARC Linux setups
+ # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has
+ # patiently assisted with debugging of following two configs.
+ "linux-sparcv8" => {
+ inherit_from => [ "linux-generic32", asm("sparcv8_asm") ],
+ cflags => add("-mcpu=v8 -DB_ENDIAN -DBN_DIV2W"),
+ },
+ "linux-sparcv9" => {
+ # it's a real mess with -mcpu=ultrasparc option under Linux,
+ # but -Wa,-Av8plus should do the trick no matter what.
+ inherit_from => [ "linux-generic32", asm("sparcv9_asm") ],
+ cflags => add("-m32 -mcpu=ultrasparc -Wa,-Av8plus -DB_ENDIAN -DBN_DIV2W"),
+ shared_ldflag => add("-m32"),
+ },
+ "linux64-sparcv9" => {
+ # GCC 3.1 is a requirement
+ inherit_from => [ "linux-generic64", asm("sparcv9_asm") ],
+ cflags => add("-m64 -mcpu=ultrasparc -DB_ENDIAN"),
+ bn_ops => "BN_LLONG RC4_CHAR",
+ shared_ldflag => add("-m64"),
+ multilib => "64",
+ },
+
+ "linux-alpha-gcc" => {
+ inherit_from => [ "linux-generic64", asm("alpha_asm") ],
+ cflags => add("-DL_ENDIAN"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ },
+ "linux-c64xplus" => {
+ inherit_from => [ "BASE_unix" ],
+ # TI_CGT_C6000_7.3.x is a requirement
+ cc => "cl6x",
+ cflags => combine("--linux -ea=.s -eo=.o -mv6400+ -o2 -ox -ms -pden -DOPENSSL_SMALL_FOOTPRINT",
+ threads("-D_REENTRANT")),
+ bn_ops => "BN_LLONG",
+ cpuid_asm_src => "c64xpluscpuid.s",
+ bn_asm_src => "asm/bn-c64xplus.asm c64xplus-gf2m.s",
+ aes_asm_src => "aes-c64xplus.s aes_cbc.c aes-ctr.fake",
+ sha1_asm_src => "sha1-c64xplus.s sha256-c64xplus.s sha512-c64xplus.s",
+ rc4_asm_src => "rc4-c64xplus.s",
+ modes_asm_src => "ghash-c64xplus.s",
+ chacha_asm_src => "chacha-c64xplus.s",
+ poly1305_asm_src => "poly1305-c64xplus.s",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "void",
+ dso_scheme => "dlfcn",
+ shared_target => "linux-shared",
+ shared_cflag => "--pic",
+ shared_ldflag => add("-z --sysv --shared"),
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ ranlib => "true",
+ },
+
+#### Android: linux-* but without pointers to headers and libs.
+ #
+ # It takes pair of prior-set environment variables to make it work:
+ #
+ # CROSS_SYSROOT=/some/where/android-ndk-<ver>/platforms/android-<apiver>/arch-<arch>
+ # CROSS_COMPILE=<prefix>
+ #
+ # As well as PATH adjusted to cover ${CROSS_COMPILE}gcc and company.
+ # For example to compile for ICS and ARM with NDK 10d, you'd:
+ #
+ # ANDROID_NDK=/some/where/android-ndk-10d
+ # CROSS_SYSROOT=$ANDROID_NDK/platforms/android-14/arch-arm
+ # CROSS_COMPILE=arm-linux-androideabi-
+ # PATH=$ANDROID_NDK/toolchains/arm-linux-androideabi-4.8/prebuild/linux-x86_64/bin
+ #
+ "android" => {
+ inherit_from => [ "linux-generic32" ],
+ # Special note about unconditional -fPIC and -pie. The underlying
+ # reason is that Lollipop refuses to run non-PIE. But what about
+ # older systems and NDKs? -fPIC was never problem, so the only
+ # concern is -pie. Older toolchains, e.g. r4, appear to handle it
+ # and binaries turn mostly functional. "Mostly" means that oldest
+ # Androids, such as Froyo, fail to handle executable, but newer
+ # systems are perfectly capable of executing binaries targeting
+ # Froyo. Keep in mind that in the nutshell Android builds are
+ # about JNI, i.e. shared libraries, not applications.
+ cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
+ bin_cflags => "-pie",
+ },
+ "android-x86" => {
+ inherit_from => [ "android", asm("x86_asm") ],
+ cflags => add(picker(release => "-fomit-frame-pointer")),
+ bn_ops => "BN_LLONG",
+ perlasm_scheme => "android",
+ },
+ ################################################################
+ # Contemporary Android applications can provide multiple JNI
+ # providers in .apk, targeting multiple architectures. Among
+ # them there is "place" for two ARM flavours: generic eabi and
+ # armv7-a/hard-float. However, it should be noted that OpenSSL's
+ # ability to engage NEON is not constrained by ABI choice, nor
+ # is your ability to call OpenSSL from your application code
+ # compiled with floating-point ABI other than default 'soft'.
+ # [Latter thanks to __attribute__((pcs("aapcs"))) declaration.]
+ # This means that choice of ARM libraries you provide in .apk
+ # is driven by application needs. For example if application
+ # itself benefits from NEON or is floating-point intensive, then
+ # it might be appropriate to provide both libraries. Otherwise
+ # just generic eabi would do. But in latter case it would be
+ # appropriate to
+ #
+ # ./Configure android-armeabi -D__ARM_MAX_ARCH__=8
+ #
+ # in order to build "universal" binary and allow OpenSSL take
+ # advantage of NEON when it's available.
+ #
+ "android-armeabi" => {
+ inherit_from => [ "android", asm("armv4_asm") ],
+ },
+ "android-mips" => {
+ inherit_from => [ "android", asm("mips32_asm") ],
+ perlasm_scheme => "o32",
+ },
+
+ "android64" => {
+ inherit_from => [ "linux-generic64" ],
+ cflags => add(picker(default => "-mandroid -fPIC --sysroot=\$(CROSS_SYSROOT) -Wa,--noexecstack")),
+ bin_cflags => "-pie",
+ },
+ "android64-aarch64" => {
+ inherit_from => [ "android64", asm("aarch64_asm") ],
+ perlasm_scheme => "linux64",
+ },
+
+#### *BSD
+ "BSD-generic32" => {
+ # As for thread cflag. Idea is to maintain "collective" set of
+ # flags, which would cover all BSD flavors. -pthread applies
+ # to them all, but is treated differently. OpenBSD expands is
+ # as -D_POSIX_THREAD -lc_r, which is sufficient. FreeBSD 4.x
+ # expands it as -lc_r, which has to be accompanied by explicit
+ # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x
+ # expands it as -lc_r, which seems to be sufficient?
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => combine(picker(default => "-Wall",
+ debug => "-O0 -g",
+ release => "-O3"),
+ threads("-pthread -D_THREAD_SAFE -D_REENTRANT")),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "bsd-gcc-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "BSD-generic64" => {
+ inherit_from => [ "BSD-generic32" ],
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ },
+
+ "BSD-x86" => {
+ inherit_from => [ "BSD-generic32", asm("x86_asm") ],
+ cflags => add(picker(default => "-DL_ENDIAN",
+ release => "-fomit-frame-pointer")),
+ bn_ops => "BN_LLONG",
+ shared_target => "bsd-shared",
+ perlasm_scheme => "a.out",
+ },
+ "BSD-x86-elf" => {
+ inherit_from => [ "BSD-x86" ],
+ perlasm_scheme => "elf",
+ },
+
+ "BSD-sparcv8" => {
+ inherit_from => [ "BSD-generic32", asm("sparcv8_asm") ],
+ cflags => add("-mcpu=v8 -DB_ENDIAN"),
+ },
+ "BSD-sparc64" => {
+ # -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
+ # simply *happens* to work around a compiler bug in gcc 3.3.3,
+ # triggered by RIPEMD160 code.
+ inherit_from => [ "BSD-generic64", asm("sparcv9_asm") ],
+ cflags => add("-DB_ENDIAN -DMD32_REG_T=int"),
+ bn_ops => "BN_LLONG",
+ },
+
+ "BSD-ia64" => {
+ inherit_from => [ "BSD-generic64", asm("ia64_asm") ],
+ cflags => add_before("-DL_ENDIAN"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ },
+
+ "BSD-x86_64" => {
+ inherit_from => [ "BSD-generic64", asm("x86_64_asm") ],
+ cflags => add_before("-DL_ENDIAN"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ perlasm_scheme => "elf",
+ },
+
+ "bsdi-elf-gcc" => {
+ inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
+ cc => "gcc",
+ cflags => "-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -Wall",
+ ex_libs => add("-ldl"),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "(unknown)",
+ dso_scheme => "dlfcn",
+ shared_target => "bsd-gcc-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+
+ "nextstep" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => "-O -Wall",
+ unistd => "<libc.h>",
+ bn_ops => "BN_LLONG",
+ thread_scheme => "(unknown)",
+ },
+ "nextstep3.3" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => "-O3 -Wall",
+ unistd => "<libc.h>",
+ bn_ops => "BN_LLONG",
+ thread_scheme => "(unknown)",
+ },
+
+# QNX
+ "qnx4" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => "-DL_ENDIAN -DTERMIO",
+ thread_scheme => "(unknown)",
+ },
+ "QNX6" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "gcc",
+ ex_libs => add("-lsocket"),
+ dso_scheme => "dlfcn",
+ shared_target => "bsd-gcc-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "QNX6-i386" => {
+ inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
+ cc => "gcc",
+ cflags => "-DL_ENDIAN -O2 -Wall",
+ ex_libs => add("-lsocket"),
+ dso_scheme => "dlfcn",
+ shared_target => "bsd-gcc-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+
+#### SCO/Caldera targets.
+#
+# Originally we had like unixware-*, unixware-*-pentium, unixware-*-p6, etc.
+# Now we only have blended unixware-* as it's the only one used by ./config.
+# If you want to optimize for particular microarchitecture, bypass ./config
+# and './Configure unixware-7 -Kpentium_pro' or whatever appropriate.
+# Note that not all targets include assembler support. Mostly because of
+# lack of motivation to support out-of-date platforms with out-of-date
+# compiler drivers and assemblers. Tim Rice <tim@multitalents.net> has
+# patiently assisted to debug most of it.
+#
+# UnixWare 2.0x fails destest with -O.
+ "unixware-2.0" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => combine("-DFILIO_H -DNO_STRINGS_H",
+ threads("-Kthread")),
+ ex_libs => add("-lsocket -lnsl -lresolv -lx"),
+ thread_scheme => "uithreads",
+ },
+ "unixware-2.1" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => combine("-O -DFILIO_H",
+ threads("-Kthread")),
+ ex_libs => add("-lsocket -lnsl -lresolv -lx"),
+ thread_scheme => "uithreads",
+ },
+ "unixware-7" => {
+ inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
+ cc => "cc",
+ cflags => combine("-O -DFILIO_H -Kalloca",
+ threads("-Kthread")),
+ ex_libs => add("-lsocket -lnsl"),
+ thread_scheme => "uithreads",
+ bn_ops => "BN_LLONG",
+ perlasm_scheme => "elf-1",
+ dso_scheme => "dlfcn",
+ shared_target => "svr5-shared",
+ shared_cflag => "-Kpic",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "unixware-7-gcc" => {
+ inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
+ cc => "gcc",
+ cflags => combine("-DL_ENDIAN -DFILIO_H -O3 -fomit-frame-pointer -Wall",
+ threads("-D_REENTRANT")),
+ ex_libs => add("-lsocket -lnsl"),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "elf-1",
+ dso_scheme => "dlfcn",
+ shared_target => "gnu-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the SCO cc.
+ "sco5-cc" => {
+ inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
+ cc => "cc",
+ cflags => "-belf",
+ ex_libs => add("-lsocket -lnsl"),
+ thread_scheme => "(unknown)",
+ perlasm_scheme => "elf-1",
+ dso_scheme => "dlfcn",
+ shared_target => "svr3-shared",
+ shared_cflag => "-Kpic",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "sco5-gcc" => {
+ inherit_from => [ "BASE_unix", asm("x86_elf_asm") ],
+ cc => "gcc",
+ cflags => "-O3 -fomit-frame-pointer",
+ ex_libs => add("-lsocket -lnsl"),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "(unknown)",
+ perlasm_scheme => "elf-1",
+ dso_scheme => "dlfcn",
+ shared_target => "svr3-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+
+#### IBM's AIX.
+ # Below targets assume AIX >=5. Caveat lector. If you are accustomed
+ # to control compilation "bitness" by setting $OBJECT_MODE environment
+ # variable, then you should know that in OpenSSL case it's considered
+ # only in ./config. Once configured, build procedure remains "deaf" to
+ # current value of $OBJECT_MODE.
+ "aix-gcc" => {
+ inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-DB_ENDIAN",
+ debug => "-O0 -g",
+ release => "-O"),
+ threads("-pthread")),
+ ex_libs => add(threads("-pthread")),
+ sys_id => "AIX",
+ bn_ops => "BN_LLONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "aix32",
+ dso_scheme => "dlfcn",
+ shared_target => "aix-shared",
+ shared_ldflag => "-shared -static-libgcc -Wl,-G",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ arflags => "-X32",
+ },
+ "aix64-gcc" => {
+ inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-maix64 -DB_ENDIAN",
+ debug => "-O0 -g",
+ release => "-O"),
+ threads("-pthread")),
+ ex_libs => add(threads("-pthread")),
+ sys_id => "AIX",
+ bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "aix64",
+ dso_scheme => "dlfcn",
+ shared_target => "aix-shared",
+ shared_ldflag => "-maix64 -shared -static-libgcc -Wl,-G",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ arflags => "-X64",
+ },
+ "aix-cc" => {
+ inherit_from => [ "BASE_unix", asm("ppc32_asm") ],
+ cc => "cc",
+ cflags => combine(picker(default => "-q32 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
+ debug => "-O0 -g",
+ release => "-O"),
+ threads("-qthreaded -D_THREAD_SAFE")),
+ sys_id => "AIX",
+ bn_ops => "BN_LLONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ ex_libs => threads("-lpthreads"),
+ perlasm_scheme => "aix32",
+ dso_scheme => "dlfcn",
+ shared_target => "aix-shared",
+ shared_ldflag => "-q32 -G",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ arflags => "-X 32",
+ },
+ "aix64-cc" => {
+ inherit_from => [ "BASE_unix", asm("ppc64_asm") ],
+ cc => "cc",
+ cflags => combine(picker(default => "-q64 -DB_ENDIAN -qmaxmem=16384 -qro -qroconst",
+ debug => "-O0 -g",
+ release => "-O"),
+ threads("-qthreaded -D_THREAD_SAFE")),
+ sys_id => "AIX",
+ bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ ex_libs => threads("-lpthreads"),
+ perlasm_scheme => "aix64",
+ dso_scheme => "dlfcn",
+ shared_target => "aix-shared",
+ shared_ldflag => "-q64 -G",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ arflags => "-X 64",
+ },
+
+# SIEMENS BS2000/OSD: an EBCDIC-based mainframe
+ "BS2000-OSD" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "c89",
+ cflags => "-O -XLLML -XLLMK -XL -DB_ENDIAN -DCHARSET_EBCDIC",
+ ex_libs => add("-lsocket -lnsl"),
+ bn_ops => "THIRTY_TWO_BIT RC4_CHAR",
+ thread_scheme => "(unknown)",
+ },
+
+#### Visual C targets
+#
+# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
+#
+# Note about -wd4090, disable warning C4090. This warning returns false
+# positives in some situations. Disabling it altogether masks both
+# legitimate and false cases, but as we compile on multiple platforms,
+# we rely on other compilers to catch legitimate cases.
+#
+# Also note that we force threads no matter what. Configuring "no-threads"
+# is ignored.
+ "VC-common" => {
+ inherit_from => [ "BASE_Windows" ],
+ template => 1,
+ cc => "cl",
+ cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE",
+ defines => add(sub { my @defs = ();
+ unless ($disabled{"zlib-dynamic"}) {
+ my $zlib =
+ $withargs{zlib_lib} // "ZLIB1";
+ push @defs,
+ quotify("perl",
+ 'LIBZ="' . $zlib . '"');
+ }
+ return [ @defs ];
+ }),
+ coutflag => "/Fo",
+ lib_cflags => add("/Zi /Fdossl_static"),
+ dso_cflags => "/Zi /Fddso",
+ bin_cflags => "/Zi /Fdapp",
+ lflags => add("/debug"),
+ shared_ldflag => "/dll",
+ shared_target => "win-shared", # meaningless except it gives Configure a hint
+ thread_scheme => "winthreads",
+ dso_scheme => "win32",
+ apps_aux_src => add("win32_init.c"),
+ },
+ "VC-noCE-common" => {
+ inherit_from => [ "VC-common" ],
+ template => 1,
+ cflags => add(picker(default => "-DUNICODE -D_UNICODE",
+ debug =>
+ sub {
+ ($disabled{shared} ? "" : "/MDd")
+ ." /Od -DDEBUG -D_DEBUG";
+ },
+ release =>
+ sub {
+ ($disabled{shared} ? "" : "/MD")
+ ." /O2";
+ })),
+ lib_cflags => add(sub { $disabled{shared} ? "/MT /Zl" : () }),
+ # Following might/should appears controversial, i.e. defining
+ # /MDd without evaluating $disabled{shared}. It works in
+ # non-shared build because static library is compiled with /Zl
+ # and bares no reference to specific RTL. And it works in
+ # shared build because multiple /MDd options are not prohibited.
+ # But why /MDd in static build? Well, basically this is just a
+ # reference point, which allows to catch eventual errors that
+ # would prevent those who want to wrap OpenSSL into own .DLL.
+ # Why not /MD in release build then? Well, some are likely to
+ # prefer [non-debug] openssl.exe to be free from Micorosoft RTL
+ # redistributable.
+ bin_cflags => add(picker(debug => "/MDd",
+ release => sub { $disabled{shared} ? "/MT" : () },
+ )),
+ bin_lflags => add("/subsystem:console /opt:ref"),
+ ex_libs => add(sub {
+ my @ex_libs = ();
+ push @ex_libs, 'ws2_32.lib' unless $disabled{sock};
+ push @ex_libs, 'gdi32.lib advapi32.lib crypt32.lib user32.lib';
+ return join(" ", @ex_libs);
+ }),
+ },
+ "VC-WIN64-common" => {
+ inherit_from => [ "VC-noCE-common" ],
+ template => 1,
+ ex_libs => add(sub {
+ my @ex_libs = ();
+ push @ex_libs, 'bufferoverflowu.lib' if (`cl 2>&1` =~ /14\.00\.4[0-9]{4}\./);
+ return join(" ", @_, @ex_libs);
+ }),
+ bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
+ build_scheme => add("VC-W64", { separator => undef }),
+ },
+ "VC-WIN64I" => {
+ inherit_from => [ "VC-WIN64-common", asm("ia64_asm"),
+ sub { $disabled{shared} ? () : "ia64_uplink" } ],
+ as => "ias",
+ asflags => "-d debug",
+ asoutflag => "-o",
+ sys_id => "WIN64I",
+ bn_asm_src => sub { return undef unless @_;
+ my $r=join(" ",@_); $r=~s|bn-ia64.s|bn_asm.c|; $r; },
+ perlasm_scheme => "ias",
+ multilib => "-ia64",
+ },
+ "VC-WIN64A" => {
+ inherit_from => [ "VC-WIN64-common", asm("x86_64_asm"),
+ sub { $disabled{shared} ? () : "x86_64_uplink" } ],
+ as => sub { vc_win64a_info()->{as} },
+ asflags => sub { vc_win64a_info()->{asflags} },
+ asoutflag => sub { vc_win64a_info()->{asoutflag} },
+ sys_id => "WIN64A",
+ bn_asm_src => sub { return undef unless @_;
+ my $r=join(" ",@_); $r=~s|asm/x86_64-gcc|bn_asm|; $r; },
+ perlasm_scheme => "auto",
+ multilib => "-x64",
+ },
+ "VC-WIN32" => {
+ # x86 Win32 target defaults to ANSI API, if you want UNICODE,
+ # configure with 'perl Configure VC-WIN32 -DUNICODE -D_UNICODE'
+ inherit_from => [ "VC-noCE-common", asm("x86_asm"),
+ sub { $disabled{shared} ? () : "uplink_common" } ],
+ as => sub { vc_win32_info()->{as} },
+ asflags => sub { vc_win32_info()->{asflags} },
+ asoutflag => sub { vc_win32_info()->{asoutflag} },
+ ex_libs => add(sub {
+ my @ex_libs = ();
+ # WIN32 UNICODE build gets linked with unicows.lib for
+ # backward compatibility with Win9x.
+ push @ex_libs, 'unicows.lib'
+ if (grep { $_ eq "UNICODE" } @user_defines);
+ return join(" ", @ex_libs, @_);
+ }),
+ sys_id => "WIN32",
+ bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
+ perlasm_scheme => sub { vc_win32_info()->{perlasm_scheme} },
+ build_scheme => add("VC-W32", { separator => undef }),
+ },
+ "VC-CE" => {
+ inherit_from => [ "VC-common" ],
+ as => "ml",
+ asflags => "/nologo /Cp /coff /c /Cx /Zi",
+ asoutflag => "/Fo",
+ cc => "cl",
+ cflags =>
+ picker(default =>
+ combine('/W3 /WX /GF /Gy /nologo -DUNICODE -D_UNICODE -DOPENSSL_SYS_WINCE -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN32 -DNO_CHMOD -DOPENSSL_SMALL_FOOTPRINT',
+ sub { vc_wince_info()->{cflags}; },
+ sub { defined($ENV{'WCECOMPAT'})
+ ? '-I$(WCECOMPAT)/include' : (); },
+ sub { defined($ENV{'PORTSDK_LIBPATH'})
+ ? '-I$(PORTSDK_LIBPATH)/../../include' : (); },
+ sub { `cl 2>&1` =~ /Version ([0-9]+)\./ && $1>=14
+ ? ($disabled{shared} ? " /MT" : " /MD")
+ : " /MC"; }),
+ debug => "/Od -DDEBUG -D_DEBUG",
+ release => "/O1i"),
+ lflags => combine("/nologo /opt:ref",
+ sub { vc_wince_info()->{lflags}; },
+ sub { defined($ENV{PORTSDK_LIBPATH})
+ ? "/entry:mainCRTstartup" : (); }),
+ sys_id => "WINCE",
+ bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
+ ex_libs => add(sub {
+ my @ex_libs = ();
+ push @ex_libs, 'ws2.lib' unless $disabled{sock};
+ push @ex_libs, 'crypt32.lib';
+ if (defined($ENV{WCECOMPAT})) {
+ my $x = '$(WCECOMPAT)/lib';
+ if (-f "$x/$ENV{TARGETCPU}/wcecompatex.lib") {
+ $x .= '/$(TARGETCPU)/wcecompatex.lib';
+ } else {
+ $x .= '/wcecompatex.lib';
+ }
+ push @ex_libs, $x;
+ }
+ push @ex_libs, '$(PORTSDK_LIBPATH)/portlib.lib'
+ if (defined($ENV{'PORTSDK_LIBPATH'}));
+ push @ex_libs, ' /nodefaultlib coredll.lib corelibc.lib'
+ if ($ENV{'TARGETCPU'} eq "X86");
+ return @ex_libs;
+ }),
+ build_scheme => add("VC-WCE", { separator => undef }),
+ },
+
+#### MinGW
+ "mingw" => {
+ inherit_from => [ "BASE_unix", asm("x86_asm"),
+ sub { $disabled{shared} ? () : "x86_uplink" } ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m32 -Wall",
+ debug => "-g -O0",
+ release => "-O3 -fomit-frame-pointer"),
+ threads("-D_MT")),
+ sys_id => "MINGW32",
+ ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
+ bn_ops => "BN_LLONG EXPORT_VAR_AS_FN",
+ thread_scheme => "winthreads",
+ perlasm_scheme => "coff",
+ dso_scheme => "win32",
+ shared_target => "mingw-shared",
+ shared_cflag => add("-D_WINDLL"),
+ shared_ldflag => "-static-libgcc",
+ shared_rcflag => "--target=pe-i386",
+ shared_extension => ".dll",
+ multilib => "",
+ apps_aux_src => add("win32_init.c"),
+ },
+ "mingw64" => {
+ # As for OPENSSL_USE_APPLINK. Applink makes it possible to use
+ # .dll compiled with one compiler with application compiled with
+ # another compiler. It's possible to engage Applink support in
+ # mingw64 build, but it's not done, because till mingw64
+ # supports structured exception handling, one can't seriously
+ # consider its binaries for using with non-mingw64 run-time
+ # environment. And as mingw64 is always consistent with itself,
+ # Applink is never engaged and can as well be omitted.
+ inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
+ cc => "gcc",
+ cflags => combine(picker(default => "-DL_ENDIAN -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -m64 -Wall",
+ debug => "-g -O0",
+ release => "-O3"),
+ threads("-D_MT")),
+ sys_id => "MINGW64",
+ ex_libs => add("-lws2_32 -lgdi32 -lcrypt32"),
+ bn_ops => "SIXTY_FOUR_BIT EXPORT_VAR_AS_FN",
+ thread_scheme => "winthreads",
+ perlasm_scheme => "mingw64",
+ dso_scheme => "win32",
+ shared_target => "mingw-shared",
+ shared_cflag => add("-D_WINDLL"),
+ shared_ldflag => "-static-libgcc",
+ shared_rcflag => "--target=pe-x86-64",
+ shared_extension => ".dll",
+ multilib => "64",
+ apps_aux_src => add("win32_init.c"),
+ },
+
+#### UEFI
+ "UEFI" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => "-DL_ENDIAN -O",
+ sys_id => "UEFI",
+ },
+
+#### UWIN
+ "UWIN" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "cc",
+ cflags => "-DTERMIOS -DL_ENDIAN -O -Wall",
+ sys_id => "UWIN",
+ bn_ops => "BN_LLONG",
+ dso_scheme => "win32",
+ },
+
+#### Cygwin
+ "Cygwin-x86" => {
+ inherit_from => [ "BASE_unix", asm("x86_asm") ],
+ cc => "gcc",
+ cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
+ debug => "-g -O0",
+ release => "-O3 -fomit-frame-pointer"),
+ sys_id => "CYGWIN",
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthread",
+ perlasm_scheme => "coff",
+ dso_scheme => "dlfcn",
+ shared_target => "cygwin-shared",
+ shared_cflag => "-D_WINDLL",
+ shared_ldflag => "-shared",
+ shared_extension => ".dll",
+ },
+ "Cygwin-x86_64" => {
+ inherit_from => [ "BASE_unix", asm("x86_64_asm") ],
+ cc => "gcc",
+ cflags => picker(default => "-DTERMIOS -DL_ENDIAN -Wall",
+ debug => "-g -O0",
+ release => "-O3"),
+ sys_id => "CYGWIN",
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthread",
+ perlasm_scheme => "mingw64",
+ dso_scheme => "dlfcn",
+ shared_target => "cygwin-shared",
+ shared_cflag => "-D_WINDLL",
+ shared_ldflag => "-shared",
+ shared_extension => ".dll",
+ },
+ # Backward compatibility for those using this target
+ "Cygwin" => {
+ inherit_from => [ "Cygwin-x86" ]
+ },
+ # In case someone constructs the Cygwin target name themself
+ "Cygwin-i386" => {
+ inherit_from => [ "Cygwin-x86" ]
+ },
+ "Cygwin-i486" => {
+ inherit_from => [ "Cygwin-x86" ]
+ },
+ "Cygwin-i586" => {
+ inherit_from => [ "Cygwin-x86" ]
+ },
+ "Cygwin-i686" => {
+ inherit_from => [ "Cygwin-x86" ]
+ },
+
+##### MacOS X (a.k.a. Darwin) setup
+ "darwin-common" => {
+ inherit_from => [ "BASE_unix" ],
+ template => 1,
+ cc => "cc",
+ cflags => combine(picker(default => "",
+ debug => "-g -O0",
+ release => "-O3"),
+ threads("-D_REENTRANT")),
+ sys_id => "MACOSX",
+ plib_lflags => "-Wl,-search_paths_first",
+ bn_ops => "BN_LLONG RC4_CHAR",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "osx32",
+ dso_scheme => "dlfcn",
+ ranlib => "ranlib -c",
+ shared_target => "darwin-shared",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-dynamiclib",
+ shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ },
+ # Option "freeze" such as -std=gnu9x can't negatively interfere
+ # with future defaults for below two targets, because MacOS X
+ # for PPC has no future, it was discontinued by vendor in 2009.
+ "darwin-ppc-cc" => {
+ inherit_from => [ "darwin-common", asm("ppc32_asm") ],
+ cflags => add("-arch ppc -std=gnu9x -DB_ENDIAN -Wa,-force_cpusubtype_ALL"),
+ perlasm_scheme => "osx32",
+ shared_cflag => add("-fno-common"),
+ shared_ldflag => "-arch ppc -dynamiclib",
+ },
+ "darwin64-ppc-cc" => {
+ inherit_from => [ "darwin-common", asm("ppc64_asm") ],
+ cflags => add("-arch ppc64 -std=gnu9x -DB_ENDIAN"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+ perlasm_scheme => "osx64",
+ shared_ldflag => "-arch ppc64 -dynamiclib",
+ },
+ "darwin-i386-cc" => {
+ inherit_from => [ "darwin-common", asm("x86_asm") ],
+ cflags => add(picker(default => "-arch i386 -DL_ENDIAN",
+ release => "-fomit-frame-pointer")),
+ bn_ops => "BN_LLONG RC4_INT",
+ perlasm_scheme => "macosx",
+ shared_ldflag => "-arch i386 -dynamiclib",
+ },
+ "darwin64-x86_64-cc" => {
+ inherit_from => [ "darwin-common", asm("x86_64_asm") ],
+ cflags => add("-arch x86_64 -DL_ENDIAN -Wall"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ perlasm_scheme => "macosx",
+ shared_ldflag => "-arch x86_64 -dynamiclib",
+ },
+
+#### iPhoneOS/iOS
+#
+# It takes three prior-set environment variables to make it work:
+#
+# CROSS_COMPILE=/where/toolchain/is/usr/bin/ [note ending slash]
+# CROSS_TOP=/where/SDKs/are
+# CROSS_SDK=iPhoneOSx.y.sdk
+#
+# Exact paths vary with Xcode releases, but for couple of last ones
+# they would look like this:
+#
+# CROSS_COMPILE=`xcode-select --print-path`/Toolchains/XcodeDefault.xctoolchain/usr/bin/
+# CROSS_TOP=`xcode-select --print-path`/Platforms/iPhoneOS.platform/Developer
+# CROSS_SDK=iPhoneOS.sdk
+#
+ "iphoneos-cross" => {
+ inherit_from => [ "darwin-common" ],
+ cflags => add("-isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
+ sys_id => "iOS",
+ },
+ "ios-cross" => {
+ inherit_from => [ "darwin-common", asm("armv4_asm") ],
+ # It should be possible to go below iOS 6 and even add -arch armv6,
+ # thus targeting iPhone pre-3GS, but it's assumed to be irrelevant
+ # at this point.
+ cflags => add("-arch armv7 -mios-version-min=6.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
+ sys_id => "iOS",
+ perlasm_scheme => "ios32",
+ },
+ "ios64-cross" => {
+ inherit_from => [ "darwin-common", asm("aarch64_asm") ],
+ cflags => add("-arch arm64 -mios-version-min=7.0.0 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fno-common"),
+ sys_id => "iOS",
+ bn_ops => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+ perlasm_scheme => "ios64",
+ },
+
+##### GNU Hurd
+ "hurd-x86" => {
+ inherit_from => [ "BASE_unix" ],
+ inherit_from => [ asm("x86_elf_asm") ],
+ cc => "gcc",
+ cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
+ threads("-pthread")),
+ ex_libs => add("-ldl", threads("-pthread")),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "linux-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+
+##### VxWorks for various targets
+ "vxworks-ppc60x" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "ccppc",
+ cflags => "-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
+ sys_id => "VXWORKS",
+ ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common"),
+ },
+ "vxworks-ppcgen" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "ccppc",
+ cflags => "-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip",
+ sys_id => "VXWORKS",
+ ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon"),
+ },
+ "vxworks-ppc405" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "ccppc",
+ cflags => "-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h",
+ sys_id => "VXWORKS",
+ lflags => "-r",
+ },
+ "vxworks-ppc750" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "ccppc",
+ cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG)",
+ sys_id => "VXWORKS",
+ lflags => "-r",
+ },
+ "vxworks-ppc750-debug" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "ccppc",
+ cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DPEDANTIC -DDEBUG -g",
+ sys_id => "VXWORKS",
+ lflags => "-r",
+ },
+ "vxworks-ppc860" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "ccppc",
+ cflags => "-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h",
+ sys_id => "VXWORKS",
+ lflags => "-r",
+ },
+ "vxworks-simlinux" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "ccpentium",
+ cflags => "-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK",
+ sys_id => "VXWORKS",
+ lflags => "-r",
+ ranlib => "ranlibpentium",
+ },
+ "vxworks-mips" => {
+ inherit_from => [ "BASE_unix", asm("mips32_asm") ],
+ cc => "ccmips",
+ cflags => combine("-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip",
+ threads("-D_REENTRANT")),
+ sys_id => "VXWORKS",
+ ex_libs => add("-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon"),
+ thread_scheme => "pthreads",
+ perlasm_scheme => "o32",
+ ranlib => "ranlibmips",
+ },
+
+#### uClinux
+ "uClinux-dist" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "$ENV{'CC'}",
+ cflags => combine(threads("-D_REENTRANT")),
+ ex_libs => add("\$(LDLIBS)"),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
+ shared_target => "linux-shared",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-shared",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ ranlib => "$ENV{'RANLIB'}",
+ },
+ "uClinux-dist64" => {
+ inherit_from => [ "BASE_unix" ],
+ cc => "$ENV{'CC'}",
+ cflags => combine(threads("-D_REENTRANT")),
+ ex_libs => add("\$(LDLIBS)"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "$ENV{'LIBSSL_dlfcn'}",
+ shared_target => "linux-shared",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-shared",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ ranlib => "$ENV{'RANLIB'}",
+ },
+
+ ##### VMS
+ "vms-generic" => {
+ inherit_from => [ "BASE_VMS" ],
+ template => 1,
+ cc => "CC/DECC",
+ cflags => picker(default => "/STANDARD=(ISOC94,RELAXED)/NOLIST/PREFIX=ALL",
+ debug => "/NOOPTIMIZE/DEBUG",
+ release => "/OPTIMIZE/NODEBUG"),
+ defines => add("OPENSSL_USE_NODELETE"),
+ lflags => picker(default => "/MAP",
+ debug => "/DEBUG/TRACEBACK",
+ release => "/NODEBUG/NOTRACEBACK"),
+ lib_cflags => add("/NAMES=(AS_IS,SHORTENED)/EXTERN_MODEL=STRICT_REFDEF"),
+ dso_cflags => add("/NAMES=(AS_IS,SHORTENED)"),
+ shared_target => "vms-shared",
+ dso_scheme => "vms",
+ thread_scheme => "pthreads",
+
+ apps_aux_src => "vms_decc_init.c vms_term_sock.c",
+ },
+
+ "vms-alpha" => {
+ inherit_from => [ "vms-generic" ],
+ cflags => add(sub { my @warnings =
+ @{vms_info(0)->{disable_warns}};
+ @warnings
+ ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
+ defines =>
+ add(sub {
+ return vms_info(0)->{def_zlib}
+ ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
+ }),
+ ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
+ pointer_size => sub { return vms_info(0)->{pointer_size} },
+ #as => "???",
+ #debug_aflags => "/NOOPTIMIZE/DEBUG",
+ #release_aflags => "/OPTIMIZE/NODEBUG",
+ bn_opts => "SIXTY_FOUR_BIT RC4_INT",
+ },
+ "vms-alpha-p32" => {
+ inherit_from => [ "vms-generic" ],
+ cflags =>
+ add("/POINTER_SIZE=32",
+ sub { my @warnings =
+ @{vms_info(32)->{disable_warns}};
+ @warnings
+ ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
+ } ),
+ defines =>
+ add(sub {
+ return vms_info(32)->{def_zlib}
+ ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
+ }),
+ ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
+ pointer_size => sub { return vms_info(32)->{pointer_size} },
+ },
+ "vms-alpha-p64" => {
+ inherit_from => [ "vms-generic" ],
+ cflags =>
+ add("/POINTER_SIZE=64=ARGV",
+ sub { my @warnings =
+ @{vms_info(64)->{disable_warns}};
+ @warnings
+ ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
+ } ),
+ defines =>
+ add(sub {
+ return vms_info(64)->{def_zlib}
+ ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
+ }),
+ ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
+ pointer_size => sub { return vms_info(64)->{pointer_size} },
+ },
+ "vms-ia64" => {
+ inherit_from => [ "vms-generic" ],
+ cflags => add(sub { my @warnings =
+ @{vms_info(0)->{disable_warns}};
+ @warnings
+ ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : (); }),
+ defines =>
+ add(sub {
+ return vms_info(0)->{def_zlib}
+ ? "LIBZ=\"\"\"".vms_info(0)->{def_zlib}."\"\"\"" : ();
+ }),
+ ex_libs => add(sub { return vms_info(0)->{zlib} || (); }),
+ pointer_size => sub { return vms_info(0)->{pointer_size} },
+ #as => "I4S",
+ #debug_aflags => "/NOOPTIMIZE/DEBUG",
+ #release_aflags => "/OPTIMIZE/NODEBUG",
+ bn_opts => "SIXTY_FOUR_BIT RC4_INT",
+ },
+ "vms-ia64-p32" => {
+ inherit_from => [ "vms-generic" ],
+ cflags =>
+ add("/POINTER_SIZE=32",
+ sub { my @warnings =
+ @{vms_info(32)->{disable_warns}};
+ @warnings
+ ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
+ } ),
+ defines =>
+ add(sub {
+ return vms_info(32)->{def_zlib}
+ ? "LIBZ=\"\"\"".vms_info(32)->{def_zlib}."\"\"\"" : ();
+ }),
+ ex_libs => add(sub { return vms_info(32)->{zlib} || (); }),
+ pointer_size => sub { return vms_info(32)->{pointer_size} },
+ },
+ "vms-ia64-p64" => {
+ inherit_from => [ "vms-generic" ],
+ cflags =>
+ add("/POINTER_SIZE=64=ARGV",
+ sub { my @warnings =
+ @{vms_info(64)->{disable_warns}};
+ @warnings
+ ? "/WARNINGS=DISABLE=(".join(",",@warnings).")" : ();
+ } ),
+ defines =>
+ add(sub {
+ return vms_info(64)->{def_zlib}
+ ? "LIBZ=\"\"\"".vms_info(64)->{def_zlib}."\"\"\"" : ();
+ }),
+ ex_libs => add(sub { return vms_info(64)->{zlib} || (); }),
+ pointer_size => sub { return vms_info(64)->{pointer_size} },
+ },
+
+);
diff --git a/openssl-1.1.0h/Configurations/50-djgpp.conf b/openssl-1.1.0h/Configurations/50-djgpp.conf
new file mode 100644
index 0000000..f532bd1
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/50-djgpp.conf
@@ -0,0 +1,15 @@
+# We can't make any commitment to support the DJGPP platform,
+# and rely entirely on the OpenSSL community to help is fine
+# tune and test.
+
+%targets = (
+ "DJGPP" => {
+ inherit_from => [ asm("x86_asm") ],
+ cc => "gcc",
+ cflags => "-I/dev/env/WATT_ROOT/inc -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -Wall",
+ sys_id => "MSDOS",
+ ex_libs => add("-L/dev/env/WATT_ROOT/lib -lwatt"),
+ bn_ops => "BN_LLONG",
+ perlasm_scheme => "a.out",
+ },
+);
diff --git a/openssl-1.1.0h/Configurations/50-haiku.conf b/openssl-1.1.0h/Configurations/50-haiku.conf
new file mode 100644
index 0000000..f114666
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/50-haiku.conf
@@ -0,0 +1,29 @@
+%targets = (
+ "haiku-common" => {
+ template => 1,
+ cc => "cc",
+ cflags => add_before(picker(default => "-DL_ENDIAN -Wall -include \$(SRCDIR)/os-dep/haiku.h",
+ debug => "-g -O0",
+ release => "-O2"),
+ threads("-D_REENTRANT")),
+ sys_id => "HAIKU",
+ ex_libs => "-lnetwork",
+ perlasm_scheme => "elf",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ shared_target => "gnu-shared",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-shared",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "haiku-x86" => {
+ inherit_from => [ "haiku-common", asm("x86_elf_asm") ],
+ cflags => add(picker(release => "-fomit-frame-pointer")),
+ bn_ops => "BN_LLONG",
+ },
+ "haiku-x86_64" => {
+ inherit_from => [ "haiku-common" ],
+ cflags => add("-m64"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ },
+);
diff --git a/openssl-1.1.0h/Configurations/50-masm.conf b/openssl-1.1.0h/Configurations/50-masm.conf
new file mode 100644
index 0000000..60a5507
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/50-masm.conf
@@ -0,0 +1,17 @@
+# We can't make commitment to supporting Microsoft assembler,
+# because it would mean supporting all masm versions. This in
+# in turn is because masm is not really an interchangeable option,
+# while users tend to have reasons to stick with specific Visual
+# Studio versions. It's usually lesser hassle to make it work
+# with latest assembler, but tweaking for older versions had
+# proven to be daunting task. This is experimental target, for
+# production builds stick with [up-to-date version of] nasm.
+
+%targets = (
+ "VC-WIN64A-masm" => {
+ inherit_from => [ "VC-WIN64A" ],
+ as => "ml64",
+ asflags => "/c /Cp /Cx /Zi",
+ asoutflag => "/Fo",
+ },
+);
diff --git a/openssl-1.1.0h/Configurations/90-team.conf b/openssl-1.1.0h/Configurations/90-team.conf
new file mode 100644
index 0000000..0a83c22
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/90-team.conf
@@ -0,0 +1,112 @@
+## -*- mode: perl; -*-
+## Build configuration targets for openssl-team members
+
+%targets = (
+ "purify" => {
+ cc => "purify gcc",
+ cflags => "-g -Wall",
+ thread_scheme => "(unknown)",
+ ex_libs => add(" ","-lsocket -lnsl"),
+ },
+ "debug" => {
+ cc => "gcc",
+ cflags => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror",
+ thread_scheme => "(unknown)",
+ },
+ "debug-erbridge" => {
+ inherit_from => [ "x86_64_asm" ],
+ cc => "gcc",
+ cflags => combine("$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -m64 -DL_ENDIAN -DTERMIO -g",
+ threads("-D_REENTRANT")),
+ ex_libs => add(" ","-ldl"),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "elf",
+ dso_scheme => "dlfcn",
+ shared_target => "linux-shared",
+ shared_cflag => "-fPIC",
+ shared_ldflag => "-m64",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ multilib => "64",
+ },
+ "debug-linux-pentium" => {
+ inherit_from => [ "x86_elf_asm" ],
+ cc => "gcc",
+ cflags => combine("-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DL_ENDIAN -g -mcpu=pentium -Wall",
+ threads("-D_REENTRANT")),
+ ex_libs => add(" ","-ldl"),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ },
+ "debug-linux-ppro" => {
+ inherit_from => [ "x86_elf_asm" ],
+ cc => "gcc",
+ cflags => combine("-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DL_ENDIAN -g -mcpu=pentiumpro -Wall",
+ threads("-D_REENTRANT")),
+ ex_libs => add(" ","-ldl"),
+ bn_ops => "BN_LLONG",
+ thread_scheme => "pthreads",
+ dso_scheme => "dlfcn",
+ },
+ "debug-linux-ia32-aes" => {
+ cc => "gcc",
+ cflags => combine("-DL_ENDIAN -O3 -fomit-frame-pointer -Wall",
+ threads("-D_REENTRANT")),
+ ex_libs => add(" ","-ldl"),
+ bn_ops => "BN_LLONG",
+ cpuid_asm_src => "x86cpuid.s",
+ bn_asm_src => "bn-586.s co-586.s x86-mont.s",
+ des_asm_src => "des-586.s crypt586.s",
+ aes_asm_src => "aes_x86core.s aes_cbc.s aesni-x86.s",
+ bf_asm_src => "bf-586.s",
+ md5_asm_src => "md5-586.s",
+ sha1_asm_src => "sha1-586.s sha256-586.s sha512-586.s",
+ cast_asm_src => "cast-586.s",
+ rc4_asm_src => "rc4-586.s",
+ rmd160_asm_src => "rmd-586.s",
+ rc5_asm_src => "rc5-586.s",
+ wp_asm_src => "wp_block.s wp-mmx.s",
+ modes_asm_src => "ghash-x86.s",
+ padlock_asm_src => "e_padlock-x86.s",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "elf",
+ dso_scheme => "dlfcn",
+ shared_target => "linux-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "dist" => {
+ cc => "cc",
+ cflags => "-O",
+ thread_scheme => "(unknown)",
+ },
+ "debug-test-64-clang" => {
+ inherit_from => [ "x86_64_asm" ],
+ cc => "clang",
+ cflags => combine("$gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe",
+ threads("${BSDthreads}")),
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "elf",
+ dso_scheme => "dlfcn",
+ shared_target => "bsd-gcc-shared",
+ shared_cflag => "-fPIC",
+ shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ },
+ "darwin64-debug-test-64-clang" => {
+ inherit_from => [ "x86_64_asm" ],
+ cc => "clang",
+ cflags => combine("-arch x86_64 -DL_ENDIAN $gcc_devteam_warn -Wno-error=overlength-strings -Wno-error=extended-offsetof -Wno-error=language-extension-token -Wno-error=unused-const-variable -Wstrict-overflow -Qunused-arguments -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O3 -pipe",
+ threads("${BSDthreads}")),
+ sys_id => "MACOSX",
+ bn_ops => "SIXTY_FOUR_BIT_LONG",
+ thread_scheme => "pthreads",
+ perlasm_scheme => "macosx",
+ dso_scheme => "dlfcn",
+ shared_target => "darwin-shared",
+ shared_cflag => "-fPIC -fno-common",
+ shared_ldflag => "-arch x86_64 -dynamiclib",
+ shared_extension => ".\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ },
+);
diff --git a/openssl-1.1.0h/Configurations/INTERNALS.Configure b/openssl-1.1.0h/Configurations/INTERNALS.Configure
new file mode 100644
index 0000000..b28305d
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/INTERNALS.Configure
@@ -0,0 +1,136 @@
+Configure Internals
+===================
+
+[ note: this file uses markdown for formatting ]
+
+Intro
+-----
+
+This is a collection of notes that are hopefully of interest to those
+who decide to dive into Configure and what it does. This is a living
+document and anyone is encouraged to add to it and submit changes.
+There's no claim for this document to be complete at any time, but it
+will hopefully reach such a point in time.
+
+
+----------------------------------------------------------------------
+
+Parsing build.info files, processing conditions
+-----------------------------------------------
+
+Processing conditions in build.info files is done with the help of a
+condition stack that tell if a build.info should be processed or if it
+should just be skipped over. The possible states of the stack top are
+expressed in the following comment from Configure:
+
+ # The top item of this stack has the following values
+ # -2 positive already run and we found ELSE (following ELSIF should fail)
+ # -1 positive already run (skip until ENDIF)
+ # 0 negatives so far (if we're at a condition, check it)
+ # 1 last was positive (don't skip lines until next ELSE, ELSIF or ENDIF)
+ # 2 positive ELSE (following ELSIF should fail)
+
+Ground rule is that non-condition lines are skipped over if the
+stack top is > 0. Condition lines (IF, ELSIF, ELSE and ENDIF
+statements) need to be processed either way to keep track of the skip
+stack states, so they are a little more intricate.
+
+Instead of trying to describe in words, here are some example of what
+the skip stack should look like after each line is processed:
+
+Example 1:
+
+| IF[1] | 1 | |
+| ... whatever ... | | this line is processed |
+| IF[1] | 1 1 | |
+| ... whatever ... | | this line is processed |
+| ELSIF[1] | 1 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSE | 1 -2 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | 1 | |
+| ... whatever ... | | this line is processed |
+| ELSIF[1] | -1 | |
+| ... whatever ... | | this line is skipped over |
+| IF[1] | -1 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[1] | -1 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSE | -1 -2 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | -1 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | | |
+
+Example 2:
+
+| IF[0] | 0 | |
+| ... whatever ... | | this line is skipped over |
+| IF[1] | 0 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[1] | 0 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSE | 0 -2 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | 0 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[1] | 1 | |
+| ... whatever ... | | this line is processed |
+| IF[1] | 1 1 | |
+| ... whatever ... | | this line is processed |
+| ELSIF[1] | 1 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSE | 1 -2 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | 1 | |
+| ... whatever ... | | this line is processed |
+| ENDIF | | |
+
+Example 3:
+
+| IF[0] | 0 | |
+| ... whatever ... | | this line is skipped over |
+| IF[0] | 0 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[1] | 0 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSE | 0 -2 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | 0 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[1] | 1 | |
+| ... whatever ... | | this line is processed |
+| IF[0] | 1 0 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[1] | 1 1 | |
+| ... whatever ... | | this line is processed |
+| ELSE | 1 -2 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | 1 | |
+| ... whatever ... | | this line is processed |
+| ENDIF | | |
+
+Example 4:
+
+| IF[0] | 0 | |
+| ... whatever ... | | this line is skipped over |
+| IF[0] | 0 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[0] | 0 -1 | |
+| ... whatever ... | | this line is skipped over |
+| ELSE | 0 -2 | |
+| ... whatever ... | | this line is skipped over |
+| ENDIF | 0 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[1] | 1 | |
+| ... whatever ... | | this line is processed |
+| IF[0] | 1 0 | |
+| ... whatever ... | | this line is skipped over |
+| ELSIF[0] | 1 0 | |
+| ... whatever ... | | this line is skipped over |
+| ELSE | 1 2 | |
+| ... whatever ... | | this line is processed |
+| ENDIF | 1 | |
+| ... whatever ... | | this line is processed |
+| ENDIF | | |
+
diff --git a/openssl-1.1.0h/Configurations/README b/openssl-1.1.0h/Configurations/README
new file mode 100644
index 0000000..6e13645
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/README
@@ -0,0 +1,721 @@
+Intro
+=====
+
+This directory contains a few sets of files that are used for
+configuration in diverse ways:
+
+ *.conf Target platform configurations, please read
+ 'Configurations of OpenSSL target platforms' for more
+ information.
+ *.tmpl Build file templates, please read 'Build-file
+ programming with the "unified" build system' as well
+ as 'Build info files' for more information.
+ *.pm Helper scripts / modules for the main `Configure`
+ script. See 'Configure helper scripts for more
+ information.
+
+
+Configurations of OpenSSL target platforms
+==========================================
+
+Configuration targets are a collection of facts that we know about
+different platforms and their capabilities. We organise them in a
+hash table, where each entry represent a specific target.
+
+Note that configuration target names must be unique across all config
+files. The Configure script does check that a config file doesn't
+have config targets that shadow config targets from other files.
+
+In each table entry, the following keys are significant:
+
+ inherit_from => Other targets to inherit values from.
+ Explained further below. [1]
+ template => Set to 1 if this isn't really a platform
+ target. Instead, this target is a template
+ upon which other targets can be built.
+ Explained further below. [1]
+
+ sys_id => System identity for systems where that
+ is difficult to determine automatically.
+
+ cc => The compiler command, usually one of "cc",
+ "gcc" or "clang". This command is normally
+ also used to link object files and
+ libraries into the final program.
+ cflags => Flags that are used at all times when
+ compiling.
+ defines => As an alternative, macro definitions may be
+ present here instead of in `cflags'. If
+ given here, they MUST be as an array of the
+ string such as "MACRO=value", or just
+ "MACRO" for definitions without value.
+ shared_cflag => Extra compilation flags used when
+ compiling for shared libraries, typically
+ something like "-fPIC".
+
+ (linking is a complex thing, see [3] below)
+ ld => Linker command, usually not defined
+ (meaning the compiler command is used
+ instead).
+ (NOTE: this is here for future use, it's
+ not implemented yet)
+ lflags => Flags that are used when linking apps.
+ shared_ldflag => Flags that are used when linking shared
+ or dynamic libraries.
+ plib_lflags => Extra linking flags to appear just before
+ the libraries on the command line.
+ ex_libs => Extra libraries that are needed when
+ linking.
+
+ ar => The library archive command, the default is
+ "ar".
+ (NOTE: this is here for future use, it's
+ not implemented yet)
+ arflags => Flags to be used with the library archive
+ command.
+
+ ranlib => The library archive indexing command, the
+ default is 'ranlib' it it exists.
+
+ unistd => An alternative header to the typical
+ '<unistd.h>'. This is very rarely needed.
+
+ shared_extension => File name extension used for shared
+ libraries.
+ obj_extension => File name extension used for object files.
+ On unix, this defaults to ".o" (NOTE: this
+ is here for future use, it's not
+ implemented yet)
+ exe_extension => File name extension used for executable
+ files. On unix, this defaults to "" (NOTE:
+ this is here for future use, it's not
+ implemented yet)
+ shlib_variant => A "variant" identifier inserted between the base
+ shared library name and the extension. On "unixy"
+ platforms (BSD, Linux, Solaris, MacOS/X, ...) this
+ supports installation of custom OpenSSL libraries
+ that don't conflict with other builds of OpenSSL
+ installed on the system. The variant identifier
+ becomes part of the SONAME of the library and also
+ any symbol versions (symbol versions are not used or
+ needed with MacOS/X). For example, on a system
+ where a default build would normally create the SSL
+ shared library as 'libssl.so -> libssl.so.1.1' with
+ the value of the symlink as the SONAME, a target
+ definition that sets 'shlib_variant => "-abc"' will
+ create 'libssl.so -> libssl-abc.so.1.1', again with
+ an SONAME equal to the value of the symlink. The
+ symbol versions associated with the variant library
+ would then be 'OPENSSL_ABC_<version>' rather than
+ the default 'OPENSSL_<version>'. The string inserted
+ into symbol versions is obtained by mapping all
+ letters in the "variant" identifier to upper case
+ and all non-alphanumeric characters to '_'.
+
+ thread_scheme => The type of threads is used on the
+ configured platform. Currently known
+ values are "(unknown)", "pthreads",
+ "uithreads" (a.k.a solaris threads) and
+ "winthreads". Except for "(unknown)", the
+ actual value is currently ignored but may
+ be used in the future. See further notes
+ below [2].
+ dso_scheme => The type of dynamic shared objects to build
+ for. This mostly comes into play with
+ engines, but can be used for other purposes
+ as well. Valid values are "DLFCN"
+ (dlopen() et al), "DLFCN_NO_H" (for systems
+ that use dlopen() et al but do not have
+ fcntl.h), "DL" (shl_load() et al), "WIN32"
+ and "VMS".
+ perlasm_scheme => The perlasm method used to created the
+ assembler files used when compiling with
+ assembler implementations.
+ shared_target => The shared library building method used.
+ This is a target found in Makefile.shared.
+ build_scheme => The scheme used to build up a Makefile.
+ In its simplest form, the value is a string
+ with the name of the build scheme.
+ The value may also take the form of a list
+ of strings, if the build_scheme is to have
+ some options. In this case, the first
+ string in the list is the name of the build
+ scheme.
+ Currently recognised build scheme is "unified".
+ For the "unified" build scheme, this item
+ *must* be an array with the first being the
+ word "unified" and the second being a word
+ to identify the platform family.
+
+ multilib => On systems that support having multiple
+ implementations of a library (typically a
+ 32-bit and a 64-bit variant), this is used
+ to have the different variants in different
+ directories.
+
+ bn_ops => Building options (was just bignum options in
+ the earlier history of this option, hence the
+ name). This is a string of words that describe
+ algorithms' implementation parameters that
+ are optimal for the designated target platform,
+ such as the type of integers used to build up
+ the bignum, different ways to implement certain
+ ciphers and so on. To fully comprehend the
+ meaning, the best is to read the affected
+ source.
+ The valid words are:
+
+ THIRTY_TWO_BIT bignum limbs are 32 bits,
+ this is default if no
+ option is specified, it
+ works on any supported
+ system [unless "wider"
+ limb size is implied in
+ assembly code];
+ BN_LLONG bignum limbs are 32 bits,
+ but 64-bit 'unsigned long
+ long' is used internally
+ in calculations;
+ SIXTY_FOUR_BIT_LONG bignum limbs are 64 bits
+ and sizeof(long) is 8;
+ SIXTY_FOUR_BIT bignums limbs are 64 bits,
+ but execution environment
+ is ILP32;
+ RC4_CHAR RC4 key schedule is made
+ up of 'unsigned char's;
+ RC4_INT RC4 key schedule is made
+ up of 'unsigned int's;
+ EXPORT_VAR_AS_FN for shared libraries,
+ export vars as
+ accessor functions.
+
+ apps_extra_src => Extra source to build apps/openssl, as
+ needed by the target.
+ cpuid_asm_src => assembler implementation of cpuid code as
+ well as OPENSSL_cleanse().
+ Default to mem_clr.c
+ bn_asm_src => Assembler implementation of core bignum
+ functions.
+ Defaults to bn_asm.c
+ ec_asm_src => Assembler implementation of core EC
+ functions.
+ des_asm_src => Assembler implementation of core DES
+ encryption functions.
+ Defaults to 'des_enc.c fcrypt_b.c'
+ aes_asm_src => Assembler implementation of core AES
+ functions.
+ Defaults to 'aes_core.c aes_cbc.c'
+ bf_asm_src => Assembler implementation of core BlowFish
+ functions.
+ Defaults to 'bf_enc.c'
+ md5_asm_src => Assembler implementation of core MD5
+ functions.
+ sha1_asm_src => Assembler implementation of core SHA1,
+ functions, and also possibly SHA256 and
+ SHA512 ones.
+ cast_asm_src => Assembler implementation of core CAST
+ functions.
+ Defaults to 'c_enc.c'
+ rc4_asm_src => Assembler implementation of core RC4
+ functions.
+ Defaults to 'rc4_enc.c rc4_skey.c'
+ rmd160_asm_src => Assembler implementation of core RMD160
+ functions.
+ rc5_asm_src => Assembler implementation of core RC5
+ functions.
+ Defaults to 'rc5_enc.c'
+ wp_asm_src => Assembler implementation of core WHIRLPOOL
+ functions.
+ cmll_asm_src => Assembler implementation of core CAMELLIA
+ functions.
+ Defaults to 'camellia.c cmll_misc.c cmll_cbc.c'
+ modes_asm_src => Assembler implementation of cipher modes,
+ currently the functions gcm_gmult_4bit and
+ gcm_ghash_4bit.
+ padlock_asm_src => Assembler implementation of core parts of
+ the padlock engine. This is mandatory on
+ any platform where the padlock engine might
+ actually be built.
+
+
+[1] as part of the target configuration, one can have a key called
+ 'inherit_from' that indicate what other configurations to inherit
+ data from. These are resolved recursively.
+
+ Inheritance works as a set of default values that can be overridden
+ by corresponding key values in the inheriting configuration.
+
+ Note 1: any configuration table can be used as a template.
+ Note 2: pure templates have the attribute 'template => 1' and
+ cannot be used as build targets.
+
+ If several configurations are given in the 'inherit_from' array,
+ the values of same attribute are concatenated with space
+ separation. With this, it's possible to have several smaller
+ templates for different configuration aspects that can be combined
+ into a complete configuration.
+
+ instead of a scalar value or an array, a value can be a code block
+ of the form 'sub { /* your code here */ }'. This code block will
+ be called with the list of inherited values for that key as
+ arguments. In fact, the concatenation of strings is really done
+ by using 'sub { join(" ",@_) }' on the list of inherited values.
+
+ An example:
+
+ "foo" => {
+ template => 1,
+ haha => "ha ha",
+ hoho => "ho",
+ ignored => "This should not appear in the end result",
+ },
+ "bar" => {
+ template => 1,
+ haha => "ah",
+ hoho => "haho",
+ hehe => "hehe"
+ },
+ "laughter" => {
+ inherit_from => [ "foo", "bar" ],
+ hehe => sub { join(" ",(@_,"!!!")) },
+ ignored => "",
+ }
+
+ The entry for "laughter" will become as follows after processing:
+
+ "laughter" => {
+ haha => "ha ha ah",
+ hoho => "ho haho",
+ hehe => "hehe !!!",
+ ignored => ""
+ }
+
+[2] OpenSSL is built with threading capabilities unless the user
+ specifies 'no-threads'. The value of the key 'thread_scheme' may
+ be "(unknown)", in which case the user MUST give some compilation
+ flags to Configure.
+
+[3] OpenSSL has three types of things to link from object files or
+ static libraries:
+
+ - shared libraries; that would be libcrypto and libssl.
+ - shared objects (sometimes called dynamic libraries); that would
+ be the engines.
+ - applications; those are apps/openssl and all the test apps.
+
+ Very roughly speaking, linking is done like this (words in braces
+ represent the configuration settings documented at the beginning
+ of this file):
+
+ shared libraries:
+ {ld} $(CFLAGS) {shared_ldflag} -shared -o libfoo.so \
+ -Wl,--whole-archive libfoo.a -Wl,--no-whole-archive \
+ {plib_lflags} -lcrypto {ex_libs}
+
+ shared objects:
+ {ld} $(CFLAGS) {shared_ldflag} -shared -o libeng.so \
+ blah1.o blah2.o {plib_lflags} -lcrypto {ex_libs}
+
+ applications:
+ {ld} $(CFLAGS) {lflags} -o app \
+ app1.o utils.o {plib_lflags} -lssl -lcrypto {ex_libs}
+
+
+Historically, the target configurations came in form of a string with
+values separated by colons. This use is deprecated. The string form
+looked like this:
+
+ "target" => "{cc}:{cflags}:{unistd}:{thread_cflag}:{sys_id}:{lflags}:{bn_ops}:{cpuid_obj}:{bn_obj}:{ec_obj}:{des_obj}:{aes_obj}:{bf_obj}:{md5_obj}:{sha1_obj}:{cast_obj}:{rc4_obj}:{rmd160_obj}:{rc5_obj}:{wp_obj}:{cmll_obj}:{modes_obj}:{padlock_obj}:{perlasm_scheme}:{dso_scheme}:{shared_target}:{shared_cflag}:{shared_ldflag}:{shared_extension}:{ranlib}:{arflags}:{multilib}"
+
+
+Build info files
+================
+
+The build.info files that are spread over the source tree contain the
+minimum information needed to build and distribute OpenSSL. It uses a
+simple and yet fairly powerful language to determine what needs to be
+built, from what sources, and other relationships between files.
+
+For every build.info file, all file references are relative to the
+directory of the build.info file for source files, and the
+corresponding build directory for built files if the build tree
+differs from the source tree.
+
+When processed, every line is processed with the perl module
+Text::Template, using the delimiters "{-" and "-}". The hashes
+%config and %target are passed to the perl fragments, along with
+$sourcedir and $builddir, which are the locations of the source
+directory for the current build.info file and the corresponding build
+directory, all relative to the top of the build tree.
+
+To begin with, things to be built are declared by setting specific
+variables:
+
+ PROGRAMS=foo bar
+ LIBS=libsomething
+ ENGINES=libeng
+ SCRIPTS=myhack
+ EXTRA=file1 file2
+
+Note that the files mentioned for PROGRAMS, LIBS and ENGINES *must* be
+without extensions. The build file templates will figure them out.
+
+For each thing to be built, it is then possible to say what sources
+they are built from:
+
+ PROGRAMS=foo bar
+ SOURCE[foo]=foo.c common.c
+ SOURCE[bar]=bar.c extra.c common.c
+
+It's also possible to tell some other dependencies:
+
+ DEPEND[foo]=libsomething
+ DEPEND[libbar]=libsomethingelse
+
+(it could be argued that 'libsomething' and 'libsomethingelse' are
+source as well. However, the files given through SOURCE are expected
+to be located in the source tree while files given through DEPEND are
+expected to be located in the build tree)
+
+For some libraries, we maintain files with public symbols and their
+slot in a transfer vector (important on some platforms). It can be
+declared like this:
+
+ ORDINALS[libcrypto]=crypto
+
+The value is not the name of the file in question, but rather the
+argument to util/mkdef.pl that indicates which file to use.
+
+One some platforms, shared libraries come with a name that's different
+from their static counterpart. That's declared as follows:
+
+ SHARED_NAME[libfoo]=cygfoo-{- $config{shlibver} -}
+
+The example is from Cygwin, which has a required naming convention.
+
+Sometimes, it makes sense to rename an output file, for example a
+library:
+
+ RENAME[libfoo]=libbar
+
+That lines has "libfoo" get renamed to "libbar". While it makes no
+sense at all to just have a rename like that (why not just use
+"libbar" everywhere?), it does make sense when it can be used
+conditionally. See a little further below for an example.
+
+In some cases, it's desirable to include some source files in the
+shared form of a library only:
+
+ SHARED_SOURCE[libfoo]=dllmain.c
+
+For any file to be built, it's also possible to tell what extra
+include paths the build of their source files should use:
+
+ INCLUDE[foo]=include
+
+In some cases, one might want to generate some source files from
+others, that's done as follows:
+
+ GENERATE[foo.s]=asm/something.pl $(CFLAGS)
+ GENERATE[bar.s]=asm/bar.S
+
+The value of each GENERATE line is a command line or part of it.
+Configure places no rules on the command line, except the the first
+item muct be the generator file. It is, however, entirely up to the
+build file template to define exactly how those command lines should
+be handled, how the output is captured and so on.
+
+Sometimes, the generator file itself depends on other files, for
+example if it is a perl script that depends on other perl modules.
+This can be expressed using DEPEND like this:
+
+ DEPEND[asm/something.pl]=../perlasm/Foo.pm
+
+There may also be cases where the exact file isn't easily specified,
+but an inclusion directory still needs to be specified. INCLUDE can
+be used in that case:
+
+ INCLUDE[asm/something.pl]=../perlasm
+
+NOTE: GENERATE lines are limited to one command only per GENERATE.
+
+As a last resort, it's possible to have raw build file lines, between
+BEGINRAW and ENDRAW lines as follows:
+
+ BEGINRAW[Makefile(unix)]
+ haha.h: {- $builddir -}/Makefile
+ echo "/* haha */" > haha.h
+ ENDRAW[Makefile(unix)]
+
+The word within square brackets is the build_file configuration item
+or the build_file configuration item followed by the second word in the
+build_scheme configuration item for the configured target within
+parenthesis as shown above. For example, with the following relevant
+configuration items:
+
+ build_file => "build.ninja"
+ build_scheme => [ "unified", "unix" ]
+
+... these lines will be considered:
+
+ BEGINRAW[build.ninja]
+ build haha.h: echo "/* haha */" > haha.h
+ ENDRAW[build.ninja]
+
+ BEGINRAW[build.ninja(unix)]
+ build hoho.h: echo "/* hoho */" > hoho.h
+ ENDRAW[build.ninja(unix)]
+
+Should it be needed because the recipes within a RAW section might
+clash with those generated by Configure, it's possible to tell it
+not to generate them with the use of OVERRIDES, for example:
+
+ SOURCE[libfoo]=foo.c bar.c
+
+ OVERRIDES=bar.o
+ BEGINRAW[Makefile(unix)]
+ bar.o: bar.c
+ $(CC) $(CFLAGS) -DSPECIAL -c -o $@ $<
+ ENDRAW[Makefile(unix)]
+
+See the documentation further up for more information on configuration
+items.
+
+Finally, you can have some simple conditional use of the build.info
+information, looking like this:
+
+ IF[1]
+ something
+ ELSIF[2]
+ something other
+ ELSE
+ something else
+ ENDIF
+
+The expression in square brackets is interpreted as a string in perl,
+and will be seen as true if perl thinks it is, otherwise false. For
+example, the above would have "something" used, since 1 is true.
+
+Together with the use of Text::Template, this can be used as
+conditions based on something in the passed variables, for example:
+
+ IF[{- $disabled{shared} -}]
+ LIBS=libcrypto
+ SOURCE[libcrypto]=...
+ ELSE
+ LIBS=libfoo
+ SOURCE[libfoo]=...
+ ENDIF
+
+or:
+
+ # VMS has a cultural standard where all libraries are prefixed.
+ # For OpenSSL, the choice is 'ossl_'
+ IF[{- $config{target} =~ /^vms/ -}]
+ RENAME[libcrypto]=ossl_libcrypto
+ RENAME[libssl]=ossl_libssl
+ ENDIF
+
+
+Build-file programming with the "unified" build system
+======================================================
+
+"Build files" are called "Makefile" on Unix-like operating systems,
+"descrip.mms" for MMS on VMS, "makefile" for nmake on Windows, etc.
+
+To use the "unified" build system, the target configuration needs to
+set the three items 'build_scheme', 'build_file' and 'build_command'.
+In the rest of this section, we will assume that 'build_scheme' is set
+to "unified" (see the configurations documentation above for the
+details).
+
+For any name given by 'build_file', the "unified" system expects a
+template file in Configurations/ named like the build file, with
+".tmpl" appended, or in case of possible ambiguity, a combination of
+the second 'build_scheme' list item and the 'build_file' name. For
+example, if 'build_file' is set to "Makefile", the template could be
+Configurations/Makefile.tmpl or Configurations/unix-Makefile.tmpl.
+In case both Configurations/unix-Makefile.tmpl and
+Configurations/Makefile.tmpl are present, the former takes
+precedence.
+
+The build-file template is processed with the perl module
+Text::Template, using "{-" and "-}" as delimiters that enclose the
+perl code fragments that generate configuration-dependent content.
+Those perl fragments have access to all the hash variables from
+configdata.pem.
+
+The build-file template is expected to define at least the following
+perl functions in a perl code fragment enclosed with "{-" and "-}".
+They are all expected to return a string with the lines they produce.
+
+ generatesrc - function that produces build file lines to generate
+ a source file from some input.
+
+ It's called like this:
+
+ generatesrc(src => "PATH/TO/tobegenerated",
+ generator => [ "generatingfile", ... ]
+ generator_incs => [ "INCL/PATH", ... ]
+ generator_deps => [ "dep1", ... ]
+ generator => [ "generatingfile", ... ]
+ incs => [ "INCL/PATH", ... ],
+ deps => [ "dep1", ... ],
+ intent => one of "libs", "dso", "bin" );
+
+ 'src' has the name of the file to be generated.
+ 'generator' is the command or part of command to
+ generate the file, of which the first item is
+ expected to be the file to generate from.
+ generatesrc() is expected to analyse and figure out
+ exactly how to apply that file and how to capture
+ the result. 'generator_incs' and 'generator_deps'
+ are include directories and files that the generator
+ file itself depends on. 'incs' and 'deps' are
+ include directories and files that are used if $(CC)
+ is used as an intermediary step when generating the
+ end product (the file indicated by 'src'). 'intent'
+ indicates what the generated file is going to be
+ used for.
+
+ src2obj - function that produces build file lines to build an
+ object file from source files and associated data.
+
+ It's called like this:
+
+ src2obj(obj => "PATH/TO/objectfile",
+ srcs => [ "PATH/TO/sourcefile", ... ],
+ deps => [ "dep1", ... ],
+ incs => [ "INCL/PATH", ... ]
+ intent => one of "lib", "dso", "bin" );
+
+ 'obj' has the intended object file *without*
+ extension, src2obj() is expected to add that.
+ 'srcs' has the list of source files to build the
+ object file, with the first item being the source
+ file that directly corresponds to the object file.
+ 'deps' is a list of explicit dependencies. 'incs'
+ is a list of include file directories. Finally,
+ 'intent' indicates what this object file is going
+ to be used for.
+
+ obj2lib - function that produces build file lines to build a
+ static library file ("libfoo.a" in Unix terms) from
+ object files.
+
+ called like this:
+
+ obj2lib(lib => "PATH/TO/libfile",
+ objs => [ "PATH/TO/objectfile", ... ]);
+
+ 'lib' has the intended library file name *without*
+ extension, obj2lib is expected to add that. 'objs'
+ has the list of object files (also *without*
+ extension) to build this library.
+
+ libobj2shlib - function that produces build file lines to build a
+ shareable object library file ("libfoo.so" in Unix
+ terms) from the corresponding static library file
+ or object files.
+
+ called like this:
+
+ libobj2shlib(shlib => "PATH/TO/shlibfile",
+ lib => "PATH/TO/libfile",
+ objs => [ "PATH/TO/objectfile", ... ],
+ deps => [ "PATH/TO/otherlibfile", ... ],
+ ordinals => [ "word", "/PATH/TO/ordfile" ]);
+
+ 'lib' has the intended library file name *without*
+ extension, libobj2shlib is expected to add that.
+ 'shlib' has the corresponding shared library name
+ *without* extension. 'deps' has the list of other
+ libraries (also *without* extension) this library
+ needs to be linked with. 'objs' has the list of
+ object files (also *without* extension) to build
+ this library. 'ordinals' MAY be present, and when
+ it is, its value is an array where the word is
+ "crypto" or "ssl" and the file is one of the ordinal
+ files util/libeay.num or util/ssleay.num in the
+ source directory.
+
+ This function has a choice; it can use the
+ corresponding static library as input to make the
+ shared library, or the list of object files.
+
+ obj2dso - function that produces build file lines to build a
+ dynamic shared object file from object files.
+
+ called like this:
+
+ obj2dso(lib => "PATH/TO/libfile",
+ objs => [ "PATH/TO/objectfile", ... ],
+ deps => [ "PATH/TO/otherlibfile",
+ ... ]);
+
+ This is almost the same as libobj2shlib, but the
+ intent is to build a shareable library that can be
+ loaded in runtime (a "plugin"...). The differences
+ are subtle, one of the most visible ones is that the
+ resulting shareable library is produced from object
+ files only.
+
+ obj2bin - function that produces build file lines to build an
+ executable file from object files.
+
+ called like this:
+
+ obj2bin(bin => "PATH/TO/binfile",
+ objs => [ "PATH/TO/objectfile", ... ],
+ deps => [ "PATH/TO/libfile", ... ]);
+
+ 'bin' has the intended executable file name
+ *without* extension, obj2bin is expected to add
+ that. 'objs' has the list of object files (also
+ *without* extension) to build this library. 'deps'
+ has the list of library files (also *without*
+ extension) that the programs needs to be linked
+ with.
+
+ in2script - function that produces build file lines to build a
+ script file from some input.
+
+ called like this:
+
+ in2script(script => "PATH/TO/scriptfile",
+ sources => [ "PATH/TO/infile", ... ]);
+
+ 'script' has the intended script file name.
+ 'sources' has the list of source files to build the
+ resulting script from.
+
+In all cases, file file paths are relative to the build tree top, and
+the build file actions run with the build tree top as current working
+directory.
+
+Make sure to end the section with these functions with a string that
+you thing is appropriate for the resulting build file. If nothing
+else, end it like this:
+
+ ""; # Make sure no lingering values end up in the Makefile
+ -}
+
+
+Configure helper scripts
+========================
+
+Configure uses helper scripts in this directory:
+
+Checker scripts
+---------------
+
+These scripts are per platform family, to check the integrity of the
+tools used for configuration and building. The checker script used is
+either {build_platform}-{build_file}-checker.pm or
+{build_platform}-checker.pm, where {build_platform} is the second
+'build_scheme' list element from the configuration target data, and
+{build_file} is 'build_file' from the same target data.
+
+If the check succeeds, the script is expected to end with a non-zero
+expression. If the check fails, the script can end with a zero, or
+with a `die`.
diff --git a/openssl-1.1.0h/Configurations/README.design b/openssl-1.1.0h/Configurations/README.design
new file mode 100644
index 0000000..bea9790
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/README.design
@@ -0,0 +1,641 @@
+Design document for the unified scheme data
+===========================================
+
+How are things connected?
+-------------------------
+
+The unified scheme takes all its data from the build.info files seen
+throughout the source tree. These files hold the minimum information
+needed to build end product files from diverse sources. See the
+section on build.info files below.
+
+From the information in build.info files, Configure builds up an
+information database as a hash table called %unified_info, which is
+stored in configdata.pm, found at the top of the build tree (which may
+or may not be the same as the source tree).
+
+Configurations/common.tmpl uses the data from %unified_info to
+generate the rules for building end product files as well as
+intermediary files with the help of a few functions found in the
+build-file templates. See the section on build-file templates further
+down for more information.
+
+build.info files
+----------------
+
+As mentioned earlier, build.info files are meant to hold the minimum
+information needed to build output files, and therefore only (with a
+few possible exceptions [1]) have information about end products (such
+as scripts, library files and programs) and source files (such as C
+files, C header files, assembler files, etc). Intermediate files such
+as object files are rarely directly referred to in build.info files (and
+when they are, it's always with the file name extension .o), they are
+inferred by Configure. By the same rule of minimalism, end product
+file name extensions (such as .so, .a, .exe, etc) are never mentioned
+in build.info. Their file name extensions will be inferred by the
+build-file templates, adapted for the platform they are meant for (see
+sections on %unified_info and build-file templates further down).
+
+The variables PROGRAMS, LIBS, ENGINES and SCRIPTS are used to declare
+end products. There are variants for them with '_NO_INST' as suffix
+(PROGRAM_NO_INST etc) to specify end products that shouldn't get
+installed.
+
+The variables SOURCE, DEPEND, INCLUDE and ORDINALS are indexed by a
+produced file, and their values are the source used to produce that
+particular produced file, extra dependencies, include directories
+needed, and ordinal files (explained further below.
+
+All their values in all the build.info throughout the source tree are
+collected together and form a set of programs, libraries, engines and
+scripts to be produced, source files, dependencies, etc etc etc.
+
+Let's have a pretend example, a very limited contraption of OpenSSL,
+composed of the program 'apps/openssl', the libraries 'libssl' and
+'libcrypto', an engine 'engines/ossltest' and their sources and
+dependencies.
+
+ # build.info
+ LIBS=libcrypto libssl
+ ORDINALS[libcrypto]=crypto
+ ORDINALS[libssl]=ssl
+ INCLUDE[libcrypto]=include
+ INCLUDE[libssl]=include
+ DEPEND[libssl]=libcrypto
+
+This is the top directory build.info file, and it tells us that two
+libraries are to be built, there are some ordinals to be used to
+declare what symbols in those libraries are seen as public, the
+include directory 'include/' shall be used throughout when building
+anything that will end up in each library, and that the library
+'libssl' depend on the library 'libcrypto' to function properly.
+
+ # apps/build.info
+ PROGRAMS=openssl
+ SOURCE[openssl]=openssl.c
+ INCLUDE[openssl]=.. ../include
+ DEPEND[openssl]=../libssl
+
+This is the build.info file in 'apps/', one may notice that all file
+paths mentioned are relative to the directory the build.info file is
+located in. This one tells us that there's a program to be built
+called 'apps/openssl' (the file name extension will depend on the
+platform and is therefore not mentioned in the build.info file). It's
+built from one source file, 'apps/openssl.c', and building it requires
+the use of '.' and 'include' include directories (both are declared
+from the point of view of the 'apps/' directory), and that the program
+depends on the library 'libssl' to function properly.
+
+ # crypto/build.info
+ LIBS=../libcrypto
+ SOURCE[../libcrypto]=aes.c evp.c cversion.c
+ DEPEND[cversion.o]=buildinf.h
+
+ GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)"
+ DEPEND[buildinf.h]=../Makefile
+ DEPEND[../util/mkbuildinf.pl]=../util/Foo.pm
+
+This is the build.info file in 'crypto', and it tells us a little more
+about what's needed to produce 'libcrypto'. LIBS is used again to
+declare that 'libcrypto' is to be produced. This declaration is
+really unnecessary as it's already mentioned in the top build.info
+file, but can make the info file easier to understand. This is to
+show that duplicate information isn't an issue.
+
+This build.info file informs us that 'libcrypto' is built from a few
+source files, 'crypto/aes.c', 'crypto/evp.c' and 'crypto/cversion.c'.
+It also shows us that building the object file inferred from
+'crypto/cversion.c' depends on 'crypto/buildinf.h'. Finally, it
+also shows the possibility to declare how some files are generated
+using some script, in this case a perl script, and how such scripts
+can be declared to depend on other files, in this case a perl module.
+
+Two things are worth an extra note:
+
+'DEPEND[cversion.o]' mentions an object file. DEPEND indexes is the
+only location where it's valid to mention them
+
+Lines in 'BEGINRAW'..'ENDRAW' sections must always mention files as
+seen from the top directory, no exception.
+
+ # ssl/build.info
+ LIBS=../libssl
+ SOURCE[../libssl]=tls.c
+
+This is the build.info file in 'ssl/', and it tells us that the
+library 'libssl' is built from the source file 'ssl/tls.c'.
+
+ # engines/build.info
+ ENGINES=dasync
+ SOURCE[dasync]=e_dasync.c
+ DEPEND[dasync]=../libcrypto
+ INCLUDE[dasync]=../include
+
+ ENGINES_NO_INST=ossltest
+ SOURCE[ossltest]=e_ossltest.c
+ DEPEND[ossltest]=../libcrypto
+ INCLUDE[ossltest]=../include
+
+This is the build.info file in 'engines/', telling us that two engines
+called 'engines/dasync' and 'engines/ossltest' shall be built, that
+dasync's source is 'engines/e_dasync.c' and ossltest's source is
+'engines/e_ossltest.c' and that the include directory 'include/' may
+be used when building anything that will be part of these engines.
+Also, both engines depend on the library 'libcrypto' to function
+properly. Finally, only dasync is being installed, as ossltest is
+only for internal testing.
+
+When Configure digests these build.info files, the accumulated
+information comes down to this:
+
+ LIBS=libcrypto libssl
+ ORDINALS[libcrypto]=crypto
+ SOURCE[libcrypto]=crypto/aes.c crypto/evp.c crypto/cversion.c
+ DEPEND[crypto/cversion.o]=crypto/buildinf.h
+ INCLUDE[libcrypto]=include
+ ORDINALS[libssl]=ssl
+ SOURCE[libssl]=ssl/tls.c
+ INCLUDE[libssl]=include
+ DEPEND[libssl]=libcrypto
+
+ PROGRAMS=apps/openssl
+ SOURCE[apps/openssl]=apps/openssl.c
+ INCLUDE[apps/openssl]=. include
+ DEPEND[apps/openssl]=libssl
+
+ ENGINES=engines/dasync
+ SOURCE[engines/dasync]=engines/e_dasync.c
+ DEPEND[engines/dasync]=libcrypto
+ INCLUDE[engines/dasync]=include
+
+ ENGINES_NO_INST=engines/ossltest
+ SOURCE[engines/ossltest]=engines/e_ossltest.c
+ DEPEND[engines/ossltest]=libcrypto
+ INCLUDE[engines/ossltest]=include
+
+ GENERATE[crypto/buildinf.h]=util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)"
+ DEPEND[crypto/buildinf.h]=Makefile
+ DEPEND[util/mkbuildinf.pl]=util/Foo.pm
+
+
+A few notes worth mentioning:
+
+LIBS may be used to declare routine libraries only.
+
+PROGRAMS may be used to declare programs only.
+
+ENGINES may be used to declare engines only.
+
+The indexes for SOURCE and ORDINALS must only be end product files,
+such as libraries, programs or engines. The values of SOURCE
+variables must only be source files (possibly generated)
+
+INCLUDE and DEPEND shows a relationship between different files
+(usually produced files) or between files and directories, such as a
+program depending on a library, or between an object file and some
+extra source file.
+
+When Configure processes the build.info files, it will take it as
+truth without question, and will therefore perform very few checks.
+If the build tree is separate from the source tree, it will assume
+that all built files and up in the build directory and that all source
+files are to be found in the source tree, if they can be found there.
+Configure will assume that source files that can't be found in the
+source tree (such as 'crypto/bildinf.h' in the example above) are
+generated and will be found in the build tree.
+
+
+The %unified_info database
+--------------------------
+
+The information in all the build.info get digested by Configure and
+collected into the %unified_info database, divided into the following
+indexes:
+
+ depends => a hash table containing 'file' => [ 'dependency' ... ]
+ pairs. These are directly inferred from the DEPEND
+ variables in build.info files.
+
+ engines => a list of engines. These are directly inferred from
+ the ENGINES variable in build.info files.
+
+ generate => a hash table containing 'file' => [ 'generator' ... ]
+ pairs. These are directly inferred from the GENERATE
+ variables in build.info files.
+
+ includes => a hash table containing 'file' => [ 'include' ... ]
+ pairs. These are directly inferred from the INCLUDE
+ variables in build.info files.
+
+ install => a hash table containing 'type' => [ 'file' ... ] pairs.
+ The types are 'programs', 'libraries', 'engines' and
+ 'scripts', and the array of files list the files of
+ that type that should be installed.
+
+ libraries => a list of libraries. These are directly inferred from
+ the LIBS variable in build.info files.
+
+ ordinals => a hash table containing 'file' => [ 'word', 'ordfile' ]
+ pairs. 'file' and 'word' are directly inferred from
+ the ORDINALS variables in build.info files, while the
+ file 'ofile' comes from internal knowledge in
+ Configure.
+
+ programs => a list of programs. These are directly inferred from
+ the PROGRAMS variable in build.info files.
+
+ rawlines => a list of build-file lines. These are a direct copy of
+ the BEGINRAW..ENDRAW lines in build.info files. Note:
+ only the BEGINRAW..ENDRAW section for the current
+ platform are copied, the rest are ignored.
+
+ scripts => a list of scripts. There are directly inferred from
+ the SCRIPTS variable in build.info files.
+
+ sources => a hash table containing 'file' => [ 'sourcefile' ... ]
+ pairs. These are indirectly inferred from the SOURCE
+ variables in build.info files. Object files are
+ mentioned in this hash table, with source files from
+ SOURCE variables, and AS source files for programs and
+ libraries.
+
+ shared_sources =>
+ a hash table just like 'sources', but only as source
+ files (object files) for building shared libraries.
+
+As an example, here is how the build.info files example from the
+section above would be digested into a %unified_info table:
+
+ our %unified_info = (
+ "depends" =>
+ {
+ "apps/openssl" =>
+ [
+ "libssl",
+ ],
+ "crypto/buildinf.h" =>
+ [
+ "Makefile",
+ ],
+ "crypto/cversion.o" =>
+ [
+ "crypto/buildinf.h",
+ ],
+ "engines/ossltest" =>
+ [
+ "libcrypto",
+ ],
+ "libssl" =>
+ [
+ "libcrypto",
+ ],
+ "util/mkbuildinf.pl" =>
+ [
+ "util/Foo.pm",
+ ],
+ },
+ "engines" =>
+ [
+ "engines/dasync",
+ "engines/ossltest",
+ ],
+ "generate" =>
+ {
+ "crypto/buildinf.h" =>
+ [
+ "util/mkbuildinf.pl",
+ "\"\$(CC)",
+ "\$(CFLAGS)\"",
+ "\"$(PLATFORM)\"",
+ ],
+ },
+ "includes" =>
+ {
+ "apps/openssl" =>
+ [
+ ".",
+ "include",
+ ],
+ "engines/ossltest" =>
+ [
+ "include"
+ ],
+ "libcrypto" =>
+ [
+ "include",
+ ],
+ "libssl" =>
+ [
+ "include",
+ ],
+ "util/mkbuildinf.pl" =>
+ [
+ "util",
+ ],
+ }
+ "install" =>
+ {
+ "engines" =>
+ [
+ "engines/dasync",
+ ],
+ "libraries" =>
+ [
+ "libcrypto",
+ "libssl",
+ ],
+ "programs" =>
+ [
+ "apps/openssl",
+ ],
+ },
+ "libraries" =>
+ [
+ "libcrypto",
+ "libssl",
+ ],
+ "ordinals" =>
+ {
+ "libcrypto" =>
+ [
+ "crypto",
+ "util/libcrypto.num",
+ ],
+ "libssl" =>
+ [
+ "ssl",
+ "util/libssl.num",
+ ],
+ },
+ "programs" =>
+ [
+ "apps/openssl",
+ ],
+ "rawlines" =>
+ [
+ ],
+ "sources" =>
+ {
+ "apps/openssl" =>
+ [
+ "apps/openssl.o",
+ ],
+ "apps/openssl.o" =>
+ [
+ "apps/openssl.c",
+ ],
+ "crypto/aes.o" =>
+ [
+ "crypto/aes.c",
+ ],
+ "crypto/cversion.o" =>
+ [
+ "crypto/cversion.c",
+ ],
+ "crypto/evp.o" =>
+ [
+ "crypto/evp.c",
+ ],
+ "engines/e_ossltest.o" =>
+ [
+ "engines/e_ossltest.c",
+ ],
+ "engines/ossltest" =>
+ [
+ "engines/e_ossltest.o",
+ ],
+ "libcrypto" =>
+ [
+ "crypto/aes.c",
+ "crypto/cversion.c",
+ "crypto/evp.c",
+ ],
+ "libssl" =>
+ [
+ "ssl/tls.c",
+ ],
+ "ssl/tls.o" =>
+ [
+ "ssl/tls.c",
+ ],
+ },
+ );
+
+As can be seen, everything in %unified_info is fairly simple suggest
+of information. Still, it tells us that to build all programs, we
+must build 'apps/openssl', and to build the latter, we will need to
+build all its sources ('apps/openssl.o' in this case) and all the
+other things it depends on (such as 'libssl'). All those dependencies
+need to be built as well, using the same logic, so to build 'libssl',
+we need to build 'ssl/tls.o' as well as 'libcrypto', and to build the
+latter...
+
+
+Build-file templates
+--------------------
+
+Build-file templates are essentially build-files (such as Makefile on
+Unix) with perl code fragments mixed in. Those perl code fragment
+will generate all the configuration dependent data, including all the
+rules needed to build end product files and intermediary files alike.
+At a minimum, there must be a perl code fragment that defines a set of
+functions that are used to generates specific build-file rules, to
+build static libraries from object files, to build shared libraries
+from static libraries, to programs from object files and libraries,
+etc.
+
+ generatesrc - function that produces build file lines to generate
+ a source file from some input.
+
+ It's called like this:
+
+ generatesrc(src => "PATH/TO/tobegenerated",
+ generator => [ "generatingfile", ... ]
+ generator_incs => [ "INCL/PATH", ... ]
+ generator_deps => [ "dep1", ... ]
+ incs => [ "INCL/PATH", ... ],
+ deps => [ "dep1", ... ],
+ intent => one of "libs", "dso", "bin" );
+
+ 'src' has the name of the file to be generated.
+ 'generator' is the command or part of command to
+ generate the file, of which the first item is
+ expected to be the file to generate from.
+ generatesrc() is expected to analyse and figure out
+ exactly how to apply that file and how to capture
+ the result. 'generator_incs' and 'generator_deps'
+ are include directories and files that the generator
+ file itself depends on. 'incs' and 'deps' are
+ include directories and files that are used if $(CC)
+ is used as an intermediary step when generating the
+ end product (the file indicated by 'src'). 'intent'
+ indicates what the generated file is going to be
+ used for.
+
+ src2obj - function that produces build file lines to build an
+ object file from source files and associated data.
+
+ It's called like this:
+
+ src2obj(obj => "PATH/TO/objectfile",
+ srcs => [ "PATH/TO/sourcefile", ... ],
+ deps => [ "dep1", ... ],
+ incs => [ "INCL/PATH", ... ]
+ intent => one of "lib", "dso", "bin" );
+
+ 'obj' has the intended object file *without*
+ extension, src2obj() is expected to add that.
+ 'srcs' has the list of source files to build the
+ object file, with the first item being the source
+ file that directly corresponds to the object file.
+ 'deps' is a list of explicit dependencies. 'incs'
+ is a list of include file directories. Finally,
+ 'intent' indicates what this object file is going
+ to be used for.
+
+ obj2lib - function that produces build file lines to build a
+ static library file ("libfoo.a" in Unix terms) from
+ object files.
+
+ called like this:
+
+ obj2lib(lib => "PATH/TO/libfile",
+ objs => [ "PATH/TO/objectfile", ... ]);
+
+ 'lib' has the intended library file name *without*
+ extension, obj2lib is expected to add that. 'objs'
+ has the list of object files (also *without*
+ extension) to build this library.
+
+ libobj2shlib - function that produces build file lines to build a
+ shareable object library file ("libfoo.so" in Unix
+ terms) from the corresponding static library file
+ or object files.
+
+ called like this:
+
+ libobj2shlib(shlib => "PATH/TO/shlibfile",
+ lib => "PATH/TO/libfile",
+ objs => [ "PATH/TO/objectfile", ... ],
+ deps => [ "PATH/TO/otherlibfile", ... ],
+ ordinals => [ "word", "/PATH/TO/ordfile" ]);
+
+ 'lib' has the intended library file name *without*
+ extension, libobj2shlib is expected to add that.
+ 'shlib' has the corresponding shared library name
+ *without* extension. 'deps' has the list of other
+ libraries (also *without* extension) this library
+ needs to be linked with. 'objs' has the list of
+ object files (also *without* extension) to build
+ this library. 'ordinals' MAY be present, and when
+ it is, its value is an array where the word is
+ "crypto" or "ssl" and the file is one of the ordinal
+ files util/libcrypto.num or util/libssl.num in the
+ source directory.
+
+ This function has a choice; it can use the
+ corresponding static library as input to make the
+ shared library, or the list of object files.
+
+ obj2dynlib - function that produces build file lines to build a
+ dynamically loadable library file ("libfoo.so" on
+ Unix) from object files.
+
+ called like this:
+
+ obj2dynlib(lib => "PATH/TO/libfile",
+ objs => [ "PATH/TO/objectfile", ... ],
+ deps => [ "PATH/TO/otherlibfile",
+ ... ]);
+
+ This is almost the same as libobj2shlib, but the
+ intent is to build a shareable library that can be
+ loaded in runtime (a "plugin"...). The differences
+ are subtle, one of the most visible ones is that the
+ resulting shareable library is produced from object
+ files only.
+
+ obj2bin - function that produces build file lines to build an
+ executable file from object files.
+
+ called like this:
+
+ obj2bin(bin => "PATH/TO/binfile",
+ objs => [ "PATH/TO/objectfile", ... ],
+ deps => [ "PATH/TO/libfile", ... ]);
+
+ 'bin' has the intended executable file name
+ *without* extension, obj2bin is expected to add
+ that. 'objs' has the list of object files (also
+ *without* extension) to build this library. 'deps'
+ has the list of library files (also *without*
+ extension) that the programs needs to be linked
+ with.
+
+ in2script - function that produces build file lines to build a
+ script file from some input.
+
+ called like this:
+
+ in2script(script => "PATH/TO/scriptfile",
+ sources => [ "PATH/TO/infile", ... ]);
+
+ 'script' has the intended script file name.
+ 'sources' has the list of source files to build the
+ resulting script from.
+
+Along with the build-file templates is the driving engine
+Configurations/common.tmpl, which looks through all the information in
+%unified_info and generates all the rulesets to build libraries,
+programs and all intermediate files, using the rule generating
+functions defined in the build-file template.
+
+As an example with the smaller build.info set we've seen as an
+example, producing the rules to build 'libcrypto' would result in the
+following calls:
+
+ # Note: libobj2shlib will only be called if shared libraries are
+ # to be produced.
+ # Note 2: libobj2shlib gets both the name of the static library
+ # and the names of all the object files that go into it. It's up
+ # to the implementation to decide which to use as input.
+ # Note 3: common.tmpl peals off the ".o" extension from all object
+ # files, as the platform at hand may have a different one.
+ libobj2shlib(shlib => "libcrypto",
+ lib => "libcrypto",
+ objs => [ "crypto/aes", "crypto/evp", "crypto/cversion" ],
+ deps => [ ]
+ ordinals => [ "crypto", "util/libcrypto.num" ]);
+
+ obj2lib(lib => "libcrypto"
+ objs => [ "crypto/aes", "crypto/evp", "crypto/cversion" ]);
+
+ src2obj(obj => "crypto/aes"
+ srcs => [ "crypto/aes.c" ],
+ deps => [ ],
+ incs => [ "include" ],
+ intent => "lib");
+
+ src2obj(obj => "crypto/evp"
+ srcs => [ "crypto/evp.c" ],
+ deps => [ ],
+ incs => [ "include" ],
+ intent => "lib");
+
+ src2obj(obj => "crypto/cversion"
+ srcs => [ "crypto/cversion.c" ],
+ deps => [ "crypto/buildinf.h" ],
+ incs => [ "include" ],
+ intent => "lib");
+
+ generatesrc(src => "crypto/buildinf.h",
+ generator => [ "util/mkbuildinf.pl", "\"$(CC)",
+ "$(CFLAGS)\"", "\"$(PLATFORM)\"" ],
+ generator_incs => [ "util" ],
+ generator_deps => [ "util/Foo.pm" ],
+ incs => [ ],
+ deps => [ ],
+ intent => "lib");
+
+The returned strings from all those calls are then concatenated
+together and written to the resulting build-file.
diff --git a/openssl-1.1.0h/Configurations/common.tmpl b/openssl-1.1.0h/Configurations/common.tmpl
new file mode 100644
index 0000000..13ffe94
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/common.tmpl
@@ -0,0 +1,229 @@
+{- # -*- Mode: perl -*-
+
+ use File::Basename;
+
+ # A cache of objects for which a recipe has already been generated
+ my %cache;
+
+ # resolvedepends and reducedepends work in tandem to make sure
+ # there are no duplicate dependencies and that they are in the
+ # right order. This is especially used to sort the list of
+ # libraries that a build depends on.
+ sub resolvedepends {
+ my $thing = shift;
+ my @listsofar = @_; # to check if we're looping
+ my @list = @{$unified_info{depends}->{$thing}};
+ my @newlist = ();
+ if (scalar @list) {
+ foreach my $item (@list) {
+ # It's time to break off when the dependency list starts looping
+ next if grep { $_ eq $item } @listsofar;
+ push @newlist, $item, resolvedepends($item, @listsofar, $item);
+ }
+ }
+ @newlist;
+ }
+ sub reducedepends {
+ my @list = @_;
+ my @newlist = ();
+ while (@list) {
+ my $item = shift @list;
+ push @newlist, $item
+ unless grep { $item eq $_ } @list;
+ }
+ @newlist;
+ }
+
+ # dogenerate is responsible for producing all the recipes that build
+ # generated source files. It recurses in case a dependency is also a
+ # generated source file.
+ sub dogenerate {
+ my $src = shift;
+ return "" if $cache{$src};
+ my $obj = shift;
+ my $bin = shift;
+ my %opts = @_;
+ if ($unified_info{generate}->{$src}) {
+ die "$src is generated by Configure, should not appear in build file\n"
+ if ref $unified_info{generate}->{$src} eq "";
+ my $script = $unified_info{generate}->{$src}->[0];
+ $OUT .= generatesrc(src => $src,
+ generator => $unified_info{generate}->{$src},
+ generator_incs => $unified_info{includes}->{$script},
+ generator_deps => $unified_info{depends}->{$script},
+ deps => $unified_info{depends}->{$src},
+ incs => $unified_info{includes}->{$obj},
+ %opts);
+ foreach (@{$unified_info{depends}->{$src}}) {
+ dogenerate($_, $obj, $bin, %opts);
+ }
+ }
+ $cache{$src} = 1;
+ }
+
+ # doobj is responsible for producing all the recipes that build
+ # object files as well as dependency files.
+ sub doobj {
+ my $obj = shift;
+ return "" if $cache{$obj};
+ (my $obj_no_o = $obj) =~ s|\.o$||;
+ my $bin = shift;
+ my %opts = @_;
+ if (@{$unified_info{sources}->{$obj}}) {
+ $OUT .= src2obj(obj => $obj_no_o,
+ srcs => $unified_info{sources}->{$obj},
+ deps => $unified_info{depends}->{$obj},
+ incs => $unified_info{includes}->{$obj},
+ %opts);
+ foreach ((@{$unified_info{sources}->{$obj}},
+ @{$unified_info{depends}->{$obj}})) {
+ dogenerate($_, $obj, $bin, %opts);
+ }
+ }
+ $cache{$obj} = 1;
+ }
+
+ # dolib is responsible for building libraries. It will call
+ # libobj2shlib is shared libraries are produced, and obj2lib in all
+ # cases. It also makes sure all object files for the library are
+ # built.
+ sub dolib {
+ my $lib = shift;
+ return "" if $cache{$lib};
+ unless ($disabled{shared}) {
+ my %ordinals =
+ $unified_info{ordinals}->{$lib}
+ ? (ordinals => $unified_info{ordinals}->{$lib}) : ();
+ $OUT .= libobj2shlib(shlib => $unified_info{sharednames}->{$lib},
+ lib => $lib,
+ objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
+ (@{$unified_info{sources}->{$lib}},
+ @{$unified_info{shared_sources}->{$lib}}) ],
+ deps => [ reducedepends(resolvedepends($lib)) ],
+ %ordinals);
+ foreach (@{$unified_info{shared_sources}->{$lib}}) {
+ doobj($_, $lib, intent => "lib");
+ }
+ }
+ $OUT .= obj2lib(lib => $lib,
+ objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
+ @{$unified_info{sources}->{$lib}} ]);
+ foreach (@{$unified_info{sources}->{$lib}}) {
+ doobj($_, $lib, intent => "lib");
+ }
+ $cache{$lib} = 1;
+ }
+
+ # doengine is responsible for building engines. It will call
+ # obj2dso, and also makes sure all object files for the library
+ # are built.
+ sub doengine {
+ my $lib = shift;
+ return "" if $cache{$lib};
+ $OUT .= obj2dso(lib => $lib,
+ objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
+ (@{$unified_info{sources}->{$lib}},
+ @{$unified_info{shared_sources}->{$lib}}) ],
+ deps => [ resolvedepends($lib) ]);
+ foreach ((@{$unified_info{sources}->{$lib}},
+ @{$unified_info{shared_sources}->{$lib}})) {
+ doobj($_, $lib, intent => "dso");
+ }
+ $cache{$lib} = 1;
+ }
+
+ # dobin is responsible for building programs. It will call obj2bin,
+ # and also makes sure all object files for the library are built.
+ sub dobin {
+ my $bin = shift;
+ return "" if $cache{$bin};
+ my $deps = [ reducedepends(resolvedepends($bin)) ];
+ $OUT .= obj2bin(bin => $bin,
+ objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
+ @{$unified_info{sources}->{$bin}} ],
+ deps => $deps);
+ foreach (@{$unified_info{sources}->{$bin}}) {
+ doobj($_, $bin, intent => "bin");
+ }
+ $cache{$bin} = 1;
+ }
+
+ # dobin is responsible for building scripts from templates. It will
+ # call in2script.
+ sub doscript {
+ my $script = shift;
+ return "" if $cache{$script};
+ $OUT .= in2script(script => $script,
+ sources => $unified_info{sources}->{$script});
+ $cache{$script} = 1;
+ }
+
+ sub dodir {
+ my $dir = shift;
+ return "" if !exists(&generatedir) or $cache{$dir};
+ $OUT .= generatedir(dir => $dir,
+ deps => $unified_info{dirinfo}->{$dir}->{deps},
+ %{$unified_info{dirinfo}->{$_}->{products}});
+ $cache{$dir} = 1;
+ }
+
+ # Start with populating the cache with all the overrides
+ %cache = map { $_ => 1 } @{$unified_info{overrides}};
+
+ # For convenience collect information regarding directories where
+ # files are generated, those generated files and the end product
+ # they end up in where applicable. Then, add build rules for those
+ # directories
+ if (exists &generatedir) {
+ my %loopinfo = ( "dso" => [ @{$unified_info{engines}} ],
+ "lib" => [ @{$unified_info{libraries}} ],
+ "bin" => [ @{$unified_info{programs}} ],
+ "script" => [ @{$unified_info{scripts}} ] );
+ foreach my $type (keys %loopinfo) {
+ foreach my $product (@{$loopinfo{$type}}) {
+ my %dirs = ();
+ my $pd = dirname($product);
+
+ # We already have a "test" target, and the current directory
+ # is just silly to make a target for
+ $dirs{$pd} = 1 unless $pd eq "test" || $pd eq ".";
+
+ foreach (@{$unified_info{sources}->{$product}}) {
+ my $d = dirname($_);
+
+ # We don't want to create targets for source directories
+ # when building out of source
+ next if ($config{sourcedir} ne $config{builddir}
+ && $d =~ m|^\Q$config{sourcedir}\E|);
+ # We already have a "test" target, and the current directory
+ # is just silly to make a target for
+ next if $d eq "test" || $d eq ".";
+
+ $dirs{$d} = 1;
+ push @{$unified_info{dirinfo}->{$d}->{deps}}, $_
+ if $d ne $pd;
+ }
+ foreach (keys %dirs) {
+ push @{$unified_info{dirinfo}->{$_}->{products}->{$type}},
+ $product;
+ }
+ }
+ }
+ }
+
+ # Build mandatory generated headers
+ foreach (@{$unified_info{depends}->{""}}) { dogenerate($_); }
+
+ # Build all known libraries, engines, programs and scripts.
+ # Everything else will be handled as a consequence.
+ foreach (@{$unified_info{libraries}}) { dolib($_); }
+ foreach (@{$unified_info{engines}}) { doengine($_); }
+ foreach (@{$unified_info{programs}}) { dobin($_); }
+ foreach (@{$unified_info{scripts}}) { doscript($_); }
+
+ foreach (sort keys %{$unified_info{dirinfo}}) { dodir($_); }
+
+ # Finally, should there be any applicable BEGINRAW/ENDRAW sections,
+ # they are added here.
+ $OUT .= $_."\n" foreach @{$unified_info{rawlines}};
+-}
diff --git a/openssl-1.1.0h/Configurations/descrip.mms.tmpl b/openssl-1.1.0h/Configurations/descrip.mms.tmpl
new file mode 100644
index 0000000..7e3356f
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/descrip.mms.tmpl
@@ -0,0 +1,780 @@
+## descrip.mms to build OpenSSL on OpenVMS
+##
+## {- join("\n## ", @autowarntext) -}
+{-
+ use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
+
+ # Our prefix, claimed when speaking with the VSI folks Tuesday
+ # January 26th 2016
+ our $osslprefix = 'OSSL$';
+ (our $osslprefix_q = $osslprefix) =~ s/\$/\\\$/;
+
+ our $sover = sprintf "%02d%02d", $config{shlib_major}, $config{shlib_minor};
+ our $osslver = sprintf "%02d%02d", split(/\./, $config{version});
+
+ our $sourcedir = $config{sourcedir};
+ our $builddir = $config{builddir};
+ sub sourcefile {
+ catfile($sourcedir, @_);
+ }
+ sub buildfile {
+ catfile($builddir, @_);
+ }
+ sub sourcedir {
+ catdir($sourcedir, @_);
+ }
+ sub builddir {
+ catdir($builddir, @_);
+ }
+ sub tree {
+ (my $x = shift) =~ s|\]$|...]|;
+ $x
+ }
+ sub move {
+ my $f = catdir(@_);
+ my $b = abs2rel(rel2abs("."),rel2abs($f));
+ $sourcedir = catdir($b,$sourcedir)
+ if !file_name_is_absolute($sourcedir);
+ $builddir = catdir($b,$builddir)
+ if !file_name_is_absolute($builddir);
+ "";
+ }
+
+ # Because we need to make two computations of these data,
+ # we store them in arrays for reuse
+ our @shlibs = map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}};
+ our @install_shlibs = map { $unified_info{sharednames}->{$_} || () } @{$unified_info{install}->{libraries}};
+ our @generated = ( ( map { (my $x = $_) =~ s|\.S$|\.s|; $x }
+ grep { defined $unified_info{generate}->{$_} }
+ map { @{$unified_info{sources}->{$_}} }
+ grep { /\.o$/ } keys %{$unified_info{sources}} ),
+ ( grep { /\.h$/ } keys %{$unified_info{generate}} ) );
+
+ # This is a horrible hack, but is needed because recursive inclusion of files
+ # in different directories does not work well with HP C.
+ my $sd = sourcedir("crypto", "async", "arch");
+ foreach (grep /\[\.crypto\.async\.arch\].*\.o$/, keys %{$unified_info{sources}}) {
+ (my $x = $_) =~ s|\.o$|.OBJ|;
+ $unified_info{before}->{$x}
+ = qq(arch_include = F\$PARSE("$sd","A.;",,,"SYNTAX_ONLY") - "A.;"
+ define arch 'arch_include');
+ $unified_info{after}->{$x}
+ = qq(deassign arch);
+ }
+ my $sd1 = sourcedir("ssl","record");
+ my $sd2 = sourcedir("ssl","statem");
+ $unified_info{before}->{"[.test]heartbeat_test.OBJ"}
+ = $unified_info{before}->{"[.test]ssltest_old.OBJ"}
+ = qq(record_include = F\$PARSE("$sd1","A.;",,,"SYNTAX_ONLY") - "A.;"
+ define record 'record_include'
+ statem_include = F\$PARSE("$sd2","A.;",,,"SYNTAX_ONLY") - "A.;"
+ define statem 'statem_include');
+ $unified_info{after}->{"[.test]heartbeat_test.OBJ"}
+ = $unified_info{after}->{"[.test]ssltest.OBJ"}
+ = qq(deassign statem
+ deassign record);
+ foreach (grep /^\[\.ssl\.(?:record|statem)\].*\.o$/, keys %{$unified_info{sources}}) {
+ (my $x = $_) =~ s|\.o$|.OBJ|;
+ $unified_info{before}->{$x}
+ = qq(record_include = F\$PARSE("$sd1","A.;",,,"SYNTAX_ONLY") - "A.;"
+ define record 'record_include'
+ statem_include = F\$PARSE("$sd2","A.;",,,"SYNTAX_ONLY") - "A.;"
+ define statem 'statem_include');
+ $unified_info{after}->{$x}
+ = qq(deassign statem
+ deassign record);
+ }
+ # This makes sure things get built in the order they need
+ # to. You're welcome.
+ sub dependmagic {
+ my $target = shift;
+
+ return "$target : build_generated\n\t\pipe \$(MMS) \$(MMSQUALIFIERS) depend && \$(MMS) \$(MMSQUALIFIERS) _$target\n_$target";
+ }
+ #use Data::Dumper;
+ #print STDERR "DEBUG: before:\n", Dumper($unified_info{before});
+ #print STDERR "DEBUG: after:\n", Dumper($unified_info{after});
+ "";
+-}
+PLATFORM={- $config{target} -}
+OPTIONS={- $config{options} -}
+CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
+SRCDIR={- $config{sourcedir} -}
+BLDDIR={- $config{builddir} -}
+
+# Allow both V and VERBOSE to indicate verbosity. This only applies
+# to testing.
+VERBOSE=$(V)
+
+VERSION={- $config{version} -}
+MAJOR={- $config{major} -}
+MINOR={- $config{minor} -}
+SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
+SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
+SHLIB_MAJOR={- $config{shlib_major} -}
+SHLIB_MINOR={- $config{shlib_minor} -}
+SHLIB_TARGET={- $target{shared_target} -}
+
+EXE_EXT=.EXE
+LIB_EXT=.OLB
+SHLIB_EXT=.EXE
+OBJ_EXT=.OBJ
+DEP_EXT=.D
+
+LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @{$unified_info{libraries}}) -}
+SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
+ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{engines}}) -}
+PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
+SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
+{- output_off() if $disabled{makedepend}; "" -}
+DEPS={- our @deps = map { (my $x = $_) =~ s|\.o$|\$(DEP_EXT)|; $x; }
+ grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
+ keys %{$unified_info{sources}};
+ join(", ", map { "-\n\t".$_ } @deps); -}
+{- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(", ", map { "-\n\t".$_ } @{$unified_info{depends}->{""}} ) -}
+GENERATED={- join(", ", map { "-\n\t".$_ } @generated) -}
+
+INSTALL_LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @{$unified_info{install}->{libraries}}) -}
+INSTALL_SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @install_shlibs) -}
+INSTALL_ENGINES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{engines}}) -}
+INSTALL_PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{install}->{programs}}) -}
+{- output_off() if $disabled{apps}; "" -}
+BIN_SCRIPTS=[.tools]c_rehash.pl
+MISC_SCRIPTS=[.apps]CA.pl, [.apps]tsget.pl
+{- output_on() if $disabled{apps}; "" -}
+
+APPS_OPENSSL={- use File::Spec::Functions;
+ catfile("apps","openssl") -}
+
+# DESTDIR is for package builders so that they can configure for, say,
+# SYS$COMMON:[OPENSSL] and yet have everything installed in STAGING:[USER].
+# In that case, configure with --prefix=SYS$COMMON:[OPENSSL] and then run
+# MMS with /MACROS=(DESTDIR=STAGING:[USER]). The result will end up in
+# STAGING:[USER.OPENSSL].
+# Normally it is left empty.
+DESTDIR=
+
+# Do not edit this manually. Use Configure --prefix=DIR to change this!
+INSTALLTOP={- our $installtop =
+ catdir($config{prefix}) || "SYS\$COMMON:[OPENSSL]";
+ $installtop -}
+SYSTARTUP={- catdir($installtop, '[.SYS$STARTUP]'); -}
+# This is the standard central area to store certificates, private keys...
+OPENSSLDIR={- catdir($config{openssldir}) or
+ $config{prefix} ? catdir($config{prefix},"COMMON")
+ : "SYS\$COMMON:[OPENSSL-COMMON]" -}
+# The same, but for C
+OPENSSLDIR_C={- $osslprefix -}DATAROOT:[000000]
+# Where installed engines reside, for C
+ENGINESDIR_C={- $osslprefix -}ENGINES{- $sover.$target{pointer_size} -}:
+
+CC= {- $target{cc} -}
+CFLAGS= /DEFINE=({- join(",", @{$target{defines}}, @{$config{defines}},"OPENSSLDIR=\"\"\"\$(OPENSSLDIR_C)\"\"\"","ENGINESDIR=\"\"\"\$(ENGINESDIR_C)\"\"\"") -}) {- $target{cflags} -} {- $config{cflags} -}
+CFLAGS_Q=$(CFLAGS)
+DEPFLAG= /DEFINE=({- join(",", @{$config{depdefines}}) -})
+LDFLAGS= {- $target{lflags} -}
+EX_LIBS= {- $target{ex_libs} ? ",".$target{ex_libs} : "" -}{- $config{ex_libs} ? ",".$config{ex_libs} : "" -}
+LIB_CFLAGS={- $target{lib_cflags} || "" -}
+DSO_CFLAGS={- $target{dso_cflags} || "" -}
+BIN_CFLAGS={- $target{bin_cflags} || "" -}
+
+PERL={- $config{perl} -}
+
+# We let the C compiler driver to take care of .s files. This is done in
+# order to be excused from maintaining a separate set of architecture
+# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
+# gcc, then the driver will automatically translate it to -xarch=v8plus
+# and pass it down to assembler.
+AS={- $target{as} -}
+ASFLAG={- $target{asflags} -}
+
+# .FIRST and .LAST are special targets with MMS and MMK.
+# The defines in there are for C. includes that look like
+# this:
+#
+# #include <openssl/foo.h>
+# #include "internal/bar.h"
+#
+# will use the logical names to find the files. Expecting
+# DECompHP C to find files in subdirectories of whatever was
+# given with /INCLUDE is a fantasy, unfortunately.
+NODEBUG=@
+.FIRST :
+ $(NODEBUG) openssl_inc1 = F$PARSE("[.include.openssl]","A.;",,,"syntax_only") - "A.;"
+ $(NODEBUG) openssl_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.openssl]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
+ $(NODEBUG) internal_inc1 = F$PARSE("[.crypto.include.internal]","A.;",,,"SYNTAX_ONLY") - "A.;"
+ $(NODEBUG) internal_inc2 = F$PARSE("{- catdir($config{sourcedir},"[.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
+ $(NODEBUG) internal_inc3 = F$PARSE("{- catdir($config{sourcedir},"[.crypto.include.internal]") -}","A.;",,,"SYNTAX_ONLY") - "A.;"
+ $(NODEBUG) DEFINE openssl 'openssl_inc1','openssl_inc2'
+ $(NODEBUG) DEFINE internal 'internal_inc1','internal_inc2','internal_inc3'
+ $(NODEBUG) staging_dir = "$(DESTDIR)"
+ $(NODEBUG) staging_instdir = ""
+ $(NODEBUG) staging_datadir = ""
+ $(NODEBUG) IF staging_dir .NES. "" THEN -
+ staging_instdir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
+ $(NODEBUG) IF staging_instdir - "]A.;" .NES. staging_instdir THEN -
+ staging_instdir = staging_instdir - "]A.;" + ".OPENSSL-INSTALL]"
+ $(NODEBUG) IF staging_instdir - "A.;" .NES. staging_instdir THEN -
+ staging_instdir = staging_instdir - "A.;" + "[OPENSSL-INSTALL]"
+ $(NODEBUG) IF staging_dir .NES. "" THEN -
+ staging_datadir = F$PARSE("A.;",staging_dir,"[]",,"SYNTAX_ONLY")
+ $(NODEBUG) IF staging_datadir - "]A.;" .NES. staging_datadir THEN -
+ staging_datadir = staging_datadir - "]A.;" + ".OPENSSL-COMMON]"
+ $(NODEBUG) IF staging_datadir - "A.;" .NES. staging_datadir THEN -
+ staging_datadir = staging_datadir - "A.;" + "[OPENSSL-COMMON]"
+ $(NODEBUG) !
+ $(NODEBUG) ! Installation logical names
+ $(NODEBUG) !
+ $(NODEBUG) installtop = F$PARSE(staging_instdir,"$(INSTALLTOP)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
+ $(NODEBUG) datatop = F$PARSE(staging_datadir,"$(OPENSSLDIR)","[]A.;",,"SYNTAX_ONLY,NO_CONCEAL") - ".][000000" - "[000000." - "][" - "]A.;" + ".]"
+ $(NODEBUG) DEFINE ossl_installroot 'installtop'
+ $(NODEBUG) DEFINE ossl_dataroot 'datatop'
+ $(NODEBUG) !
+ $(NODEBUG) ! Figure out the architecture
+ $(NODEBUG) !
+ $(NODEBUG) arch = f$edit( f$getsyi( "arch_name"), "upcase")
+ $(NODEBUG) !
+ $(NODEBUG) ! Set up logical names for the libraries, so LINK and
+ $(NODEBUG) ! running programs can use them.
+ $(NODEBUG) !
+ $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEFINE ".uc($_)." 'F\$ENV(\"DEFAULT\")'".uc($_)."\$(SHLIB_EXT)" } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) || "!" -}
+
+.LAST :
+ $(NODEBUG) {- join("\n\t\$(NODEBUG) ", map { "DEASSIGN ".uc($_) } map { $unified_info{sharednames}->{$_} || () } @{$unified_info{libraries}}) || "!" -}
+ $(NODEBUG) DEASSIGN ossl_dataroot
+ $(NODEBUG) DEASSIGN ossl_installroot
+ $(NODEBUG) DEASSIGN internal
+ $(NODEBUG) DEASSIGN openssl
+.DEFAULT :
+ @ ! MMS cannot handle no actions...
+
+# The main targets ###################################################
+
+{- dependmagic('all'); -} : build_libs_nodep, build_engines_nodep, build_programs_nodep
+{- dependmagic('build_libs'); -} : build_libs_nodep
+{- dependmagic('build_engines'); -} : build_engines_nodep
+{- dependmagic('build_programs'); -} : build_programs_nodep
+
+build_generated : $(GENERATED_MANDATORY)
+build_libs_nodep : $(LIBS), $(SHLIBS)
+build_engines_nodep : $(ENGINES)
+build_programs_nodep : $(PROGRAMS), $(SCRIPTS)
+
+# Kept around for backward compatibility
+build_apps build_tests : build_programs
+
+# Convenience target to prebuild all generated files, not just the mandatory
+# ones
+build_all_generated : $(GENERATED_MANDATORY) $(GENERATED)
+
+test : tests
+{- dependmagic('tests'); -} : build_programs_nodep, build_engines_nodep
+ @ ! {- output_off() if $disabled{tests}; "" -}
+ SET DEFAULT [.test]{- move("test") -}
+ CREATE/DIR [.test-runs]
+ DEFINE SRCTOP {- sourcedir() -}
+ DEFINE BLDTOP {- builddir() -}
+ DEFINE RESULT_D {- builddir(qw(test test-runs)) -}
+ DEFINE OPENSSL_ENGINES {- builddir("engines") -}
+ DEFINE OPENSSL_DEBUG_MEMORY "on"
+ IF "$(VERBOSE)" .NES. "" THEN DEFINE VERBOSE "$(VERBOSE)"
+ $(PERL) {- sourcefile("test", "run_tests.pl") -} $(TESTS)
+ DEASSIGN OPENSSL_DEBUG_MEMORY
+ DEASSIGN OPENSSL_ENGINES
+ DEASSIGN BLDTOP
+ DEASSIGN SRCTOP
+ SET DEFAULT [-]{- move("..") -}
+ @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+ @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
+ @ ! {- output_on() if !$disabled{tests}; "" -}
+
+list-tests :
+ @ ! {- output_off() if $disabled{tests}; "" -}
+ @ DEFINE SRCTOP {- sourcedir() -}
+ @ $(PERL) {- sourcefile("test", "run_tests.pl") -} list
+ @ DEASSIGN SRCTOP
+ @ ! {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+ @ WRITE SYS$OUTPUT "Tests are not supported with your chosen Configure options"
+ @ ! {- output_on() if !$disabled{tests}; "" -}
+
+install : install_sw install_ssldirs install_docs
+ @ WRITE SYS$OUTPUT ""
+ @ WRITE SYS$OUTPUT "######################################################################"
+ @ WRITE SYS$OUTPUT ""
+ @ IF "$(DESTDIR)" .EQS. "" THEN -
+ PIPE ( WRITE SYS$OUTPUT "Installation complete" ; -
+ WRITE SYS$OUTPUT "" ; -
+ WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
+ WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
+ WRITE SYS$OUTPUT "" )
+ @ IF "$(DESTDIR)" .NES. "" THEN -
+ PIPE ( WRITE SYS$OUTPUT "Staging installation complete" ; -
+ WRITE SYS$OUTPUT "" ; -
+ WRITE SYS$OUTPUT "Finish or package in such a way that the contents of the directory tree" ; -
+ WRITE SYS$OUTPUT staging_instdir ; -
+ WRITE SYS$OUTPUT "ends up in $(INSTALLTOP)," ; -
+ WRITE SYS$OUTPUT "and that the contents of the contents of the directory tree" ; -
+ WRITE SYS$OUTPUT staging_datadir ; -
+ WRITE SYS$OUTPUT "ends up in $(OPENSSLDIR)" ; -
+ WRITE SYS$OUTPUT "" ; -
+ WRITE SYS$OUTPUT "When in its final destination," ; -
+ WRITE SYS$OUTPUT "Run @$(SYSTARTUP)openssl_startup{- $osslver -} to set up logical names" ; -
+ WRITE SYS$OUTPUT "then run @$(SYSTARTUP)openssl_utils{- $osslver -} to define commands" ; -
+ WRITE SYS$OUTPUT "" )
+
+check_install :
+ spawn/nolog @ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
+
+uninstall : uninstall_docs uninstall_sw
+
+# Because VMS wants the generation number (or *) to delete files, we can't
+# use $(LIBS), $(PROGRAMS), $(GENERATED) and $(ENGINES)directly.
+libclean :
+ {- join("\n\t", map { "- DELETE $_.OLB;*" } @{$unified_info{libraries}}) || "@ !" -}
+ {- join("\n\t", map { "- DELETE $_.EXE;*,$_.MAP;*,$_.OPT;*" } @shlibs) || "@ !" -}
+
+clean : libclean
+ {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{programs}}) || "@ !" -}
+ {- join("\n\t", map { "- DELETE $_.EXE;*,$_.OPT;*" } @{$unified_info{engines}}) || "@ !" -}
+ {- join("\n\t", map { "- DELETE $_;*" } @{$unified_info{scripts}}) || "@ !" -}
+ {- join("\n\t", map { "- DELETE $_;*" } @generated) || "@ !" -}
+ - DELETE [...]*.MAP;*
+ - DELETE [...]*.D;*
+ - DELETE [...]*.OBJ;*,*.LIS;*
+ - DELETE []CXX$DEMANGLER_DB.;*
+ - DELETE [.VMS]openssl_startup.com;*
+ - DELETE [.VMS]openssl_shutdown.com;*
+ - DELETE []vmsconfig.pm;*
+
+distclean : clean
+ - DELETE configdata.pm;*
+ - DELETE descrip.mms;*
+
+depend : descrip.mms
+descrip.mms : FORCE
+ @ ! {- output_off() if $disabled{makedepend}; "" -}
+ @ $(PERL) -pe "if (/^# DO NOT DELETE.*/) { exit(0); }" -
+ < descrip.mms > descrip.mms-new
+ @ OPEN/APPEND DESCRIP descrip.mms-new
+ @ WRITE DESCRIP "# DO NOT DELETE THIS LINE -- make depend depends on it."
+ {- join("\n\t", map { "\@ IF F\$SEARCH(\"$_\") .NES. \"\" THEN TYPE $_ /OUTPUT=DESCRIP:" } @deps); -}
+ @ CLOSE DESCRIP
+ @ PIPE ( $(PERL) -e "use File::Compare qw/compare_text/; my $x = compare_text(""descrip.mms"",""descrip.mms-new""); exit(0x10000000 + ($x == 0));" || -
+ RENAME descrip.mms-new descrip.mms )
+ @ IF F$SEARCH("descrip.mms-new") .NES. "" THEN DELETE descrip.mms-new;*
+ -@ SPAWN/OUTPUT=NLA0: PURGE/NOLOG descrip.mms
+ @ ! {- output_on() if $disabled{makedepend}; "" -}
+
+# Install helper targets #############################################
+
+install_sw : all install_shared _install_dev_ns -
+ install_engines _install_runtime_ns -
+ install_startup install_ivp
+
+uninstall_sw : uninstall_shared _uninstall_dev_ns -
+ uninstall_engines _uninstall_runtime_ns -
+ uninstall_startup uninstall_ivp
+
+install_docs : install_html_docs
+
+uninstall_docs : uninstall_html_docs
+
+install_ssldirs : check_INSTALLTOP
+ - CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[000000]
+ IF F$SEARCH("OSSL_DATAROOT:[000000]CERTS.DIR;1") .EQS. "" THEN -
+ CREATE/DIR/PROT=(S:RWED,O:RWE,G:RE,W:RE) OSSL_DATAROOT:[CERTS]
+ IF F$SEARCH("OSSL_DATAROOT:[000000]PRIVATE.DIR;1") .EQS. "" THEN -
+ CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[PRIVATE]
+ IF F$SEARCH("OSSL_DATAROOT:[000000]MISC.DIR;1") .EQS. "" THEN -
+ CREATE/DIR/PROT=(S:RWED,O:RWE,G,W) OSSL_DATAROOT:[MISC]
+ COPY/PROT=W:RE $(MISC_SCRIPTS) OSSL_DATAROOT:[MISC]
+ @ ! Install configuration file
+ COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
+ ossl_dataroot:[000000]openssl.cnf-dist
+ IF F$SEARCH("OSSL_DATAROOT:[000000]openssl.cnf") .EQS. "" THEN -
+ COPY/PROT=W:R {- sourcefile("apps", "openssl-vms.cnf") -} -
+ ossl_dataroot:[000000]openssl.cnf
+
+install_shared : check_INSTALLTOP
+ @ {- output_off() if $disabled{shared}; "" -} !
+ @ WRITE SYS$OUTPUT "*** Installing shareable images"
+ @ ! Install shared (runtime) libraries
+ - CREATE/DIR ossl_installroot:[LIB.'arch']
+ {- join("\n ",
+ map { "COPY/PROT=W:R $_.EXE ossl_installroot:[LIB.'arch']" }
+ @install_shlibs) -}
+ @ {- output_on() if $disabled{shared}; "" -} !
+
+_install_dev_ns : check_INSTALLTOP
+ @ WRITE SYS$OUTPUT "*** Installing development files"
+ @ ! Install header files
+ - CREATE/DIR ossl_installroot:[include.openssl]
+ COPY/PROT=W:R openssl:*.h ossl_installroot:[include.openssl]
+ @ ! Install static (development) libraries
+ - CREATE/DIR ossl_installroot:[LIB.'arch']
+ {- join("\n ",
+ map { "COPY/PROT=W:R $_.OLB ossl_installroot:[LIB.'arch']" }
+ @{$unified_info{install}->{libraries}}) -}
+
+install_dev : install_shared _install_dev_ns
+
+_install_runtime_ns : check_INSTALLTOP
+ @ ! Install the main program
+ - CREATE/DIR ossl_installroot:[EXE.'arch']
+ COPY/PROT=W:RE [.APPS]openssl.EXE -
+ ossl_installroot:[EXE.'arch']openssl{- $osslver -}.EXE
+ @ ! Install scripts
+ COPY/PROT=W:RE $(BIN_SCRIPTS) ossl_installroot:[EXE]
+ @ ! {- output_on() if $disabled{apps}; "" -}
+
+install_runtime : install_shared _install_runtime_ns
+
+install_engines : check_INSTALLTOP
+ @ {- output_off() unless scalar @{$unified_info{engines}}; "" -} !
+ @ WRITE SYS$OUTPUT "*** Installing engines"
+ - CREATE/DIR ossl_installroot:[ENGINES{- $sover.$target{pointer_size} -}.'arch']
+ {- join("\n ",
+ map { "COPY/PROT=W:RE $_.EXE ossl_installroot:[ENGINES$sover$target{pointer_size}.'arch']" }
+ @{$unified_info{install}->{engines}}) -}
+ @ {- output_on() unless scalar @{$unified_info{engines}}; "" -} !
+
+install_startup : [.VMS]openssl_startup.com [.VMS]openssl_shutdown.com -
+ [.VMS]openssl_utils.com, check_INSTALLTOP
+ - CREATE/DIR ossl_installroot:[SYS$STARTUP]
+ COPY/PROT=W:RE [.VMS]openssl_startup.com -
+ ossl_installroot:[SYS$STARTUP]openssl_startup{- $osslver -}.com
+ COPY/PROT=W:RE [.VMS]openssl_shutdown.com -
+ ossl_installroot:[SYS$STARTUP]openssl_shutdown{- $osslver -}.com
+ COPY/PROT=W:RE [.VMS]openssl_utils.com -
+ ossl_installroot:[SYS$STARTUP]openssl_utils{- $osslver -}.com
+
+install_ivp : [.VMS]openssl_ivp.com check_INSTALLTOP
+ - CREATE/DIR ossl_installroot:[SYSTEST]
+ COPY/PROT=W:RE [.VMS]openssl_ivp.com -
+ ossl_installroot:[SYSTEST]openssl_ivp{- $osslver -}.com
+
+[.VMS]openssl_startup.com : vmsconfig.pm {- sourcefile("VMS", "openssl_startup.com.in") -}
+ - CREATE/DIR [.VMS]
+ $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
+ {- sourcefile("VMS", "openssl_startup.com.in") -} -
+ > [.VMS]openssl_startup.com
+
+[.VMS]openssl_utils.com : vmsconfig.pm {- sourcefile("VMS", "openssl_utils.com.in") -}
+ - CREATE/DIR [.VMS]
+ $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
+ {- sourcefile("VMS", "openssl_utils.com.in") -} -
+ > [.VMS]openssl_utils.com
+
+[.VMS]openssl_shutdown.com : vmsconfig.pm {- sourcefile("VMS", "openssl_shutdown.com.in") -}
+ - CREATE/DIR [.VMS]
+ $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
+ {- sourcefile("VMS", "openssl_shutdown.com.in") -} -
+ > [.VMS]openssl_shutdown.com
+
+[.VMS]openssl_ivp.com : vmsconfig.pm {- sourcefile("VMS", "openssl_ivp.com.in") -}
+ - CREATE/DIR [.VMS]
+ $(PERL) "-I." "-Mvmsconfig" {- sourcefile("util", "dofile.pl") -} -
+ {- sourcefile("VMS", "openssl_ivp.com.in") -} -
+ > [.VMS]openssl_ivp.com
+
+vmsconfig.pm : configdata.pm
+ OPEN/WRITE/SHARE=READ CONFIG []vmsconfig.pm
+ WRITE CONFIG "package vmsconfig;"
+ WRITE CONFIG "use strict; use warnings;"
+ WRITE CONFIG "use Exporter;"
+ WRITE CONFIG "our @ISA = qw(Exporter);"
+ WRITE CONFIG "our @EXPORT = qw(%config %target %withargs %unified_info %disabled);"
+ WRITE CONFIG "our %config = ("
+ WRITE CONFIG " target => '","{- $config{target} -}","',"
+ WRITE CONFIG " version => '","{- $config{version} -}","',"
+ WRITE CONFIG " shlib_major => '","{- $config{shlib_major} -}","',"
+ WRITE CONFIG " shlib_minor => '","{- $config{shlib_minor} -}","',"
+ WRITE CONFIG " no_shared => '","{- $disabled{shared} -}","',"
+ WRITE CONFIG " INSTALLTOP => '$(INSTALLTOP)',"
+ WRITE CONFIG " OPENSSLDIR => '$(OPENSSLDIR)',"
+ WRITE CONFIG " pointer_size => '","{- $target{pointer_size} -}","',"
+ WRITE CONFIG ");"
+ WRITE CONFIG "our %target = ();"
+ WRITE CONFIG "our %disabled = ();"
+ WRITE CONFIG "our %withargs = ();"
+ WRITE CONFIG "our %unified_info = ();"
+ WRITE CONFIG "1;"
+ CLOSE CONFIG
+
+install_html_docs : check_INSTALLTOP
+ sourcedir = F$PARSE("{- $sourcedir -}A.;","[]") - "]A.;" + ".DOC]"
+ $(PERL) {- sourcefile("util", "process_docs.pl") -} -
+ --sourcedir='sourcedir' --destdir=ossl_installroot:[HTML] -
+ --type=html
+
+check_INSTALLTOP :
+ @ IF "$(INSTALLTOP)" .EQS. "" THEN -
+ WRITE SYS$ERROR "INSTALLTOP should not be empty"
+ @ IF "$(INSTALLTOP)" .EQS. "" THEN -
+ EXIT %x10000002
+
+# Helper targets #####################################################
+
+# Developer targets ##################################################
+
+debug_logicals :
+ SH LOGICAL/PROC openssl,internal,ossl_installroot,ossl_dataroot
+
+# Building targets ###################################################
+
+configdata.pm : $(SRCDIR)Configure $(SRCDIR)config.com {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
+ @ WRITE SYS$OUTPUT "Reconfiguring..."
+ perl $(SRCDIR)Configure reconf
+ @ WRITE SYS$OUTPUT "*************************************************"
+ @ WRITE SYS$OUTPUT "*** ***"
+ @ WRITE SYS$OUTPUT "*** Please run the same mms command again ***"
+ @ WRITE SYS$OUTPUT "*** ***"
+ @ WRITE SYS$OUTPUT "*************************************************"
+ @ PIPE ( EXIT %X10000000 )
+
+{-
+ use File::Basename;
+ use File::Spec::Functions qw/abs2rel rel2abs catfile catdir/;
+
+ sub generatesrc {
+ my %args = @_;
+ my $generator = join(" ", @{$args{generator}});
+ my $generator_incs = join("", map { ' "-I'.$_.'"' } @{$args{generator_incs}});
+ my $deps = join(", -\n\t\t", @{$args{generator_deps}}, @{$args{deps}});
+
+ if ($args{src} !~ /\.[sS]$/) {
+ if ($args{generator}->[0] =~ m|^.*\.in$|) {
+ my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "dofile.pl")),
+ rel2abs($config{builddir}));
+ return <<"EOF";
+$args{src} : $args{generator}->[0] $deps
+ \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile \\
+ "-o$target{build_file}" $generator > \$@
+EOF
+ } else {
+ return <<"EOF";
+$args{src} : $args{generator}->[0] $deps
+ \$(PERL)$generator_incs $generator > \$@
+EOF
+ }
+ } else {
+ die "No method to generate assembler source present.\n";
+ }
+ }
+
+ sub src2obj {
+ my %args = @_;
+ my $obj = $args{obj};
+ my $deps = join(", -\n\t\t", @{$args{srcs}}, @{$args{deps}});
+
+ # Because VMS C isn't very good at combining a /INCLUDE path with
+ # #includes having a relative directory (like '#include "../foo.h"),
+ # the best choice is to move to the first source file's intended
+ # directory before compiling, and make sure to write the object file
+ # in the correct position (important when the object tree is other
+ # than the source tree).
+ my $forward = dirname($args{srcs}->[0]);
+ my $backward = abs2rel(rel2abs("."), rel2abs($forward));
+ my $objd = abs2rel(rel2abs(dirname($obj)), rel2abs($forward));
+ my $objn = basename($obj);
+ my $srcs =
+ join(", ",
+ map { abs2rel(rel2abs($_), rel2abs($forward)) } @{$args{srcs}});
+ my $ecflags = { lib => '$(LIB_CFLAGS)',
+ dso => '$(DSO_CFLAGS)',
+ bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
+ my $incs_on = "\@ !";
+ my $incs_off = "\@ !";
+ my $incs = "";
+ my @incs = ();
+ push @incs, @{$args{incs}} if @{$args{incs}};
+ unless ($disabled{zlib}) {
+ # GNV$ZLIB_INCLUDE is the standard logical name for later zlib
+ # incarnations.
+ push @incs, ($withargs{zlib_include} || 'GNV$ZLIB_INCLUDE:');
+ }
+ if (@incs) {
+ $incs_on =
+ "DEFINE tmp_includes "
+ .join(",-\n\t\t\t", map {
+ file_name_is_absolute($_)
+ ? $_ : catdir($backward,$_)
+ } @incs);
+ $incs_off = "DEASSIGN tmp_includes";
+ $incs = " /INCLUDE=(tmp_includes:)";
+ }
+ my $before = $unified_info{before}->{$obj.".OBJ"} || "\@ !";
+ my $after = $unified_info{after}->{$obj.".OBJ"} || "\@ !";
+ my $depbuild = $disabled{makedepend} ? ""
+ : " /MMS=(FILE=${objd}${objn}.tmp-D,TARGET=$obj.OBJ)";
+
+ return <<"EOF";
+$obj.OBJ : $deps
+ ${before}
+ SET DEFAULT $forward
+ $incs_on
+ \$(CC) \$(CFLAGS)${ecflags}${incs}${depbuild} /OBJECT=${objd}${objn}.OBJ /REPOSITORY=$backward $srcs
+ $incs_off
+ SET DEFAULT $backward
+ ${after}
+ \@ PIPE ( \$(PERL) -e "use File::Compare qw/compare_text/; my \$x = compare_text(""$obj.D"",""$obj.tmp-D""); exit(0x10000000 + (\$x == 0));" || -
+ RENAME $obj.tmp-D $obj.d )
+ \@ IF F\$SEARCH("$obj.tmp-D") .NES. "" THEN DELETE $obj.tmp-D;*
+ - PURGE $obj.OBJ
+EOF
+ }
+ sub libobj2shlib {
+ my %args = @_;
+ my $lib = $args{lib};
+ my $shlib = $args{shlib};
+ my $libd = dirname($lib);
+ my $libn = basename($lib);
+ (my $mkdef_key = $libn) =~ s/^${osslprefix_q}lib([^0-9]*)\d*/$1/i;
+ my @deps = map {
+ $disabled{shared} ? $_.".OLB"
+ : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
+ my $deps = join(", -\n\t\t", @deps);
+ my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
+ my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
+ my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
+ "VMS", "engine.opt")),
+ rel2abs($config{builddir}));
+ my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "mkdef.pl")),
+ rel2abs($config{builddir}));
+ my $translatesyms_pl = abs2rel(rel2abs(catfile($config{sourcedir},
+ "VMS", "translatesyms.pl")),
+ rel2abs($config{builddir}));
+ # The "[]" hack is because in .OPT files, each line inherits the
+ # previous line's file spec as default, so if no directory spec
+ # is present in the current line and the previous line has one that
+ # doesn't apply, you're in for a surprise.
+ my $write_opt =
+ join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
+ $x =~ s|(\.EXE)|$1/SHARE|;
+ $x =~ s|(\.OLB)|$1/LIB|;
+ "WRITE OPT_FILE \"$x\"" } @deps)
+ || "\@ !";
+ return <<"EOF";
+$shlib.EXE : $lib.OLB $deps $ordinalsfile
+ \$(PERL) $mkdef_pl "$mkdef_key" "VMS" > $shlib.SYMVEC-tmp
+ \$(PERL) $translatesyms_pl \$(BLDDIR)CXX\$DEMANGLER_DB. < $shlib.SYMVEC-tmp > $shlib.SYMVEC
+ DELETE $shlib.SYMVEC-tmp;*
+ OPEN/WRITE/SHARE=READ OPT_FILE $shlib.OPT
+ WRITE OPT_FILE "IDENTIFICATION=""V$config{version}"""
+ TYPE $shlib.SYMVEC /OUTPUT=OPT_FILE:
+ WRITE OPT_FILE "$lib.OLB/LIBRARY"
+ $write_opt
+ CLOSE OPT_FILE
+ LINK /MAP=$shlib.MAP /FULL/SHARE=$shlib.EXE $shlib.OPT/OPT \$(EX_LIBS)
+ DELETE $shlib.SYMVEC;*
+ PURGE $shlib.EXE,$shlib.OPT,$shlib.MAP
+EOF
+ }
+ sub obj2dso {
+ my %args = @_;
+ my $lib = $args{lib};
+ my $libd = dirname($lib);
+ my $libn = basename($lib);
+ (my $libn_nolib = $libn) =~ s/^lib//;
+ my @objs = map { "$_.OBJ" } @{$args{objs}};
+ my @deps = map {
+ $disabled{shared} ? $_.".OLB"
+ : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
+ my $deps = join(", -\n\t\t", @objs, @deps);
+ my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
+ my $engine_opt = abs2rel(rel2abs(catfile($config{sourcedir},
+ "VMS", "engine.opt")),
+ rel2abs($config{builddir}));
+ # The "[]" hack is because in .OPT files, each line inherits the
+ # previous line's file spec as default, so if no directory spec
+ # is present in the current line and the previous line has one that
+ # doesn't apply, you're in for a surprise.
+ my $write_opt1 =
+ join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
+ "WRITE OPT_FILE \"$x" } @objs).
+ "\"";
+ my $write_opt2 =
+ join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
+ $x =~ s|(\.EXE)|$1/SHARE|;
+ $x =~ s|(\.OLB)|$1/LIB|;
+ "WRITE OPT_FILE \"$x\"" } @deps)
+ || "\@ !";
+ return <<"EOF";
+$lib.EXE : $deps
+ OPEN/WRITE/SHARE=READ OPT_FILE $lib.OPT
+ TYPE $engine_opt /OUTPUT=OPT_FILE:
+ $write_opt1
+ $write_opt2
+ CLOSE OPT_FILE
+ LINK /MAP=$lib.MAP /FULL/SHARE=$lib.EXE $lib.OPT/OPT \$(EX_LIBS)
+ - PURGE $lib.EXE,$lib.OPT,$lib.MAP
+EOF
+ }
+ sub obj2lib {
+ my %args = @_;
+ my $lib = $args{lib};
+ my $objs = join(", -\n\t\t", map { $_.".OBJ" } (@{$args{objs}}));
+ my $fill_lib = join("\n\t", (map { "LIBRARY/REPLACE $lib.OLB $_.OBJ" }
+ @{$args{objs}}));
+ return <<"EOF";
+$lib.OLB : $objs
+ LIBRARY/CREATE/OBJECT $lib.OLB
+ $fill_lib
+ - PURGE $lib.OLB
+EOF
+ }
+ sub obj2bin {
+ my %args = @_;
+ my $bin = $args{bin};
+ my $bind = dirname($bin);
+ my $binn = basename($bin);
+ my @objs = map { "$_.OBJ" } @{$args{objs}};
+ my @deps = map {
+ $disabled{shared} ? $_.".OLB"
+ : $unified_info{sharednames}->{$_}.".EXE"; } @{$args{deps}};
+ my $deps = join(", -\n\t\t", @objs, @deps);
+ # The "[]" hack is because in .OPT files, each line inherits the
+ # previous line's file spec as default, so if no directory spec
+ # is present in the current line and the previous line has one that
+ # doesn't apply, you're in for a surprise.
+ my $write_opt1 =
+ join(",-\"\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
+ "WRITE OPT_FILE \"$x" } @objs).
+ "\"";
+ my $write_opt2 =
+ join("\n\t", map { my $x = $_ =~ /\[/ ? $_ : "[]".$_;
+ $x =~ s|(\.EXE)|$1/SHARE|;
+ $x =~ s|(\.OLB)|$1/LIB|;
+ "WRITE OPT_FILE \"$x\"" } @deps)
+ || "\@ !";
+ return <<"EOF";
+$bin.EXE : $deps
+ OPEN/WRITE/SHARE=READ OPT_FILE $bin.OPT
+ $write_opt1
+ $write_opt2
+ CLOSE OPT_FILE
+ LINK/EXEC=$bin.EXE \$(LDFLAGS) $bin.OPT/OPT \$(EX_LIBS)
+ - PURGE $bin.EXE,$bin.OPT
+EOF
+ }
+ sub in2script {
+ my %args = @_;
+ my $script = $args{script};
+ return "" if grep { $_ eq $script } @{$args{sources}}; # No overwrite!
+ my $sources = join(" ", @{$args{sources}});
+ my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "dofile.pl")),
+ rel2abs($config{builddir}));
+ return <<"EOF";
+$script : $sources
+ \$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
+ "-o$target{build_file}" $sources > $script
+ SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
+ PURGE $script
+EOF
+ }
+ "" # Important! This becomes part of the template result.
+-}
diff --git a/openssl-1.1.0h/Configurations/unix-Makefile.tmpl b/openssl-1.1.0h/Configurations/unix-Makefile.tmpl
new file mode 100644
index 0000000..40cf2c3
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/unix-Makefile.tmpl
@@ -0,0 +1,1044 @@
+##
+## Makefile for OpenSSL
+##
+## {- join("\n## ", @autowarntext) -}
+{-
+ our $objext = $target{obj_extension} || ".o";
+ our $depext = $target{dep_extension} || ".d";
+ our $exeext = $target{exe_extension} || "";
+ our $libext = $target{lib_extension} || ".a";
+ our $shlibext = $target{shared_extension} || ".so";
+ our $shlibvariant = $target{shlib_variant} || "";
+ our $shlibextsimple = $target{shared_extension_simple} || ".so";
+ our $shlibextimport = $target{shared_import_extension} || "";
+ our $dsoext = $target{dso_extension} || ".so";
+
+ sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
+
+ our $sover = $config{target} =~ /^mingw/
+ ? $config{shlib_major}."_".$config{shlib_minor}
+ : $config{shlib_major}.".".$config{shlib_minor};
+
+ # shlib and shlib_simple both take a static library name and figure
+ # out what the shlib name should be.
+ #
+ # When OpenSSL is configured "no-shared", these functions will just
+ # return empty lists, making them suitable to join().
+ #
+ # With Windows DLL producers, shlib($libname) will return the shared
+ # library name (which usually is different from the static library
+ # name) with the default shared extension appended to it, while
+ # shlib_simple($libname) will return the static library name with
+ # the shared extension followed by ".a" appended to it. The former
+ # result is used as the runtime shared library while the latter is
+ # used as the DLL import library.
+ #
+ # On all Unix systems, shlib($libname) will return the library name
+ # with the default shared extension, while shlib_simple($libname)
+ # will return the name from shlib($libname) with any SO version number
+ # removed. On some systems, they may therefore return the exact same
+ # string.
+ sub shlib {
+ return () if $disabled{shared};
+ my $lib = shift;
+ return $unified_info{sharednames}->{$lib}. $shlibvariant. $shlibext;
+ }
+ sub shlib_simple {
+ return () if $disabled{shared};
+
+ my $lib = shift;
+ if (windowsdll()) {
+ return $lib . $shlibextimport;
+ }
+ return $lib . $shlibextsimple;
+ }
+
+ # dso is a complement to shlib / shlib_simple that returns the
+ # given libname with the simple shared extension (possible SO version
+ # removed). This differs from shlib_simple() by being unconditional.
+ sub dso {
+ my $engine = shift;
+
+ return $engine . $dsoext;
+ }
+ # This makes sure things get built in the order they need
+ # to. You're welcome.
+ sub dependmagic {
+ my $target = shift;
+
+ return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
+ }
+ '';
+-}
+PLATFORM={- $config{target} -}
+OPTIONS={- $config{options} -}
+CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
+SRCDIR={- $config{sourcedir} -}
+BLDDIR={- $config{builddir} -}
+
+VERSION={- $config{version} -}
+MAJOR={- $config{major} -}
+MINOR={- $config{minor} -}
+SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
+SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -}
+SHLIB_MAJOR={- $config{shlib_major} -}
+SHLIB_MINOR={- $config{shlib_minor} -}
+SHLIB_TARGET={- $target{shared_target} -}
+
+LIBS={- join(" ", map { $_.$libext } @{$unified_info{libraries}}) -}
+SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
+SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{libraries}}) -}
+ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
+PROGRAMS={- join(" ", map { $_.$exeext } @{$unified_info{programs}}) -}
+SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
+{- output_off() if $disabled{makedepend}; "" -}
+DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
+ grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
+ keys %{$unified_info{sources}}); -}
+{- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
+GENERATED={- join(" ",
+ ( grep { defined $unified_info{generate}->{$_} }
+ map { @{$unified_info{sources}->{$_}} }
+ grep { /\.o$/ } keys %{$unified_info{sources}} ),
+ ( grep { /\.h$/ } keys %{$unified_info{generate}} )) -}
+
+INSTALL_LIBS={- join(" ", map { $_.$libext } @{$unified_info{install}->{libraries}}) -}
+INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -}
+INSTALL_SHLIB_INFO={- join(" ", map { "\"".shlib($_).";".shlib_simple($_)."\"" } @{$unified_info{install}->{libraries}}) -}
+INSTALL_ENGINES={- join(" ", map { dso($_) } @{$unified_info{install}->{engines}}) -}
+INSTALL_PROGRAMS={- join(" ", map { $_.$exeext } @{$unified_info{install}->{programs}}) -}
+{- output_off() if $disabled{apps}; "" -}
+BIN_SCRIPTS=$(BLDDIR)/tools/c_rehash
+MISC_SCRIPTS=$(BLDDIR)/apps/CA.pl $(BLDDIR)/apps/tsget
+{- output_on() if $disabled{apps}; "" -}
+
+APPS_OPENSSL={- use File::Spec::Functions;
+ catfile("apps","openssl") -}
+
+# DESTDIR is for package builders so that they can configure for, say,
+# /usr/ and yet have everything installed to /tmp/somedir/usr/.
+# Normally it is left empty.
+DESTDIR=
+
+# Do not edit these manually. Use Configure with --prefix or --openssldir
+# to change this! Short explanation in the top comment in Configure
+INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
+ #
+ our $prefix = $config{prefix} || "/usr/local";
+ $prefix -}
+OPENSSLDIR={- #
+ # The logic here is that if no --openssldir was given,
+ # OPENSSLDIR will get the value from $prefix plus "/ssl".
+ # If --openssldir was given and the value is an absolute
+ # path, OPENSSLDIR will get its value without change.
+ # If the value from --openssldir is a relative path,
+ # OPENSSLDIR will get $prefix with the --openssldir
+ # value appended as a subdirectory.
+ #
+ use File::Spec::Functions;
+ our $openssldir =
+ $config{openssldir} ?
+ (file_name_is_absolute($config{openssldir}) ?
+ $config{openssldir}
+ : catdir($prefix, $config{openssldir}))
+ : catdir($prefix, "ssl");
+ $openssldir -}
+LIBDIR={- #
+ # if $prefix/lib$target{multilib} is not an existing
+ # directory, then assume that it's not searched by linker
+ # automatically, in which case adding $target{multilib} suffix
+ # causes more grief than we're ready to tolerate, so don't...
+ our $multilib =
+ -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
+ our $libdir = $config{libdir} || "lib$multilib";
+ $libdir -}
+ENGINESDIR={- use File::Spec::Functions;
+ catdir($prefix,$libdir,"engines-$sover") -}
+
+# Convenience variable for those who want to set the rpath in shared
+# libraries and applications
+LIBRPATH=$(INSTALLTOP)/$(LIBDIR)
+
+MANDIR=$(INSTALLTOP)/share/man
+DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
+HTMLDIR=$(DOCDIR)/html
+
+# MANSUFFIX is for the benefit of anyone who may want to have a suffix
+# appended after the manpage file section number. "ssl" is popular,
+# resulting in files such as config.5ssl rather than config.5.
+MANSUFFIX=
+HTMLSUFFIX=html
+
+
+
+CROSS_COMPILE= {- $config{cross_compile_prefix} -}
+CC= $(CROSS_COMPILE){- $target{cc} -}
+CFLAGS={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -}
+CFLAGS_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -}
+LDFLAGS= {- $target{lflags} -}
+PLIB_LDFLAGS= {- $target{plib_lflags} -}
+EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -}
+LIB_CFLAGS={- $target{shared_cflag} || "" -}
+LIB_LDFLAGS={- $target{shared_ldflag}." ".$config{shared_ldflag} -}
+DSO_CFLAGS={- $target{shared_cflag} || "" -}
+DSO_LDFLAGS=$(LIB_LDFLAGS)
+BIN_CFLAGS={- $target{bin_cflags} -}
+
+PERL={- $config{perl} -}
+
+ARFLAGS= {- $target{arflags} -}
+AR=$(CROSS_COMPILE){- $target{ar} || "ar" -} $(ARFLAGS) r
+RANLIB= {- $target{ranlib} -}
+NM= $(CROSS_COMPILE){- $target{nm} || "nm" -}
+RCFLAGS={- $target{shared_rcflag} -}
+RC= $(CROSS_COMPILE){- $target{rc} || "windres" -}
+RM= rm -f
+RMDIR= rmdir
+TAR= {- $target{tar} || "tar" -}
+TARFLAGS= {- $target{tarflags} -}
+MAKEDEPEND={- $config{makedepprog} -}
+
+BASENAME= openssl
+NAME= $(BASENAME)-$(VERSION)
+TARFILE= ../$(NAME).tar
+
+# We let the C compiler driver to take care of .s files. This is done in
+# order to be excused from maintaining a separate set of architecture
+# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
+# gcc, then the driver will automatically translate it to -xarch=v8plus
+# and pass it down to assembler. In any case, we do not define AS or
+# ASFLAGS for this reason.
+PERLASM_SCHEME= {- $target{perlasm_scheme} -}
+
+# For x86 assembler: Set PROCESSOR to 386 if you want to support
+# the 80386.
+PROCESSOR= {- $config{processor} -}
+
+# We want error [and other] messages in English. Trouble is that make(1)
+# doesn't pass macros down as environment variables unless there already
+# was corresponding variable originally set. In other words we can only
+# reassign environment variables, but not set new ones, not in portable
+# manner that is. That's why we reassign several, just to be sure...
+LC_ALL=C
+LC_MESSAGES=C
+LANG=C
+
+# The main targets ###################################################
+
+{- dependmagic('all'); -}: build_libs_nodep build_engines_nodep build_programs_nodep link-utils
+{- dependmagic('build_libs'); -}: build_libs_nodep
+{- dependmagic('build_engines'); -}: build_engines_nodep
+{- dependmagic('build_programs'); -}: build_programs_nodep
+
+build_generated: $(GENERATED_MANDATORY)
+build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
+build_engines_nodep: $(ENGINES)
+build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
+
+# Kept around for backward compatibility
+build_apps build_tests: build_programs
+
+# Convenience target to prebuild all generated files, not just the mandatory
+# ones
+build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
+
+test: tests
+{- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep link-utils
+ @ : {- output_off() if $disabled{tests}; "" -}
+ ( cd test; \
+ mkdir -p test-runs; \
+ SRCTOP=../$(SRCDIR) \
+ BLDTOP=../$(BLDDIR) \
+ RESULT_D=test-runs \
+ PERL="$(PERL)" \
+ EXE_EXT={- $exeext -} \
+ OPENSSL_ENGINES=`cd ../$(BLDDIR)/engines; pwd` \
+ OPENSSL_DEBUG_MEMORY=on \
+ $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
+ @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+ @echo "Tests are not supported with your chosen Configure options"
+ @ : {- output_on() if !$disabled{tests}; "" -}
+
+list-tests:
+ @ : {- output_off() if $disabled{tests}; "" -}
+ @SRCTOP="$(SRCDIR)" \
+ $(PERL) $(SRCDIR)/test/run_tests.pl list
+ @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+ @echo "Tests are not supported with your chosen Configure options"
+ @ : {- output_on() if !$disabled{tests}; "" -}
+
+install: install_sw install_ssldirs install_docs
+
+uninstall: uninstall_docs uninstall_sw
+
+libclean:
+ @set -e; for s in $(SHLIB_INFO); do \
+ s1=`echo "$$s" | cut -f1 -d";"`; \
+ s2=`echo "$$s" | cut -f2 -d";"`; \
+ echo $(RM) $$s1; \
+ $(RM) $$s1; \
+ if [ "$$s1" != "$$s2" ]; then \
+ echo $(RM) $$s2; \
+ $(RM) $$s2; \
+ fi; \
+ done
+ $(RM) $(LIBS)
+ $(RM) *.map
+
+clean: libclean
+ $(RM) $(PROGRAMS) $(TESTPROGS) $(ENGINES) $(SCRIPTS)
+ $(RM) $(GENERATED)
+ -$(RM) `find . -name '*{- $depext -}' -a \! -path "./.git/*"`
+ -$(RM) `find . -name '*{- $objext -}' -a \! -path "./.git/*"`
+ $(RM) core
+ $(RM) tags TAGS doc-nits
+ $(RM) -r test/test-runs
+ $(RM) openssl.pc libcrypto.pc libssl.pc
+ -$(RM) `find . -type l -a \! -path "./.git/*"`
+ $(RM) $(TARFILE)
+
+distclean: clean
+ $(RM) configdata.pm
+ $(RM) Makefile
+
+# We check if any depfile is newer than Makefile and decide to
+# concatenate only if that is true.
+depend:
+ @: {- output_off() if $disabled{makedepend}; "" -}
+ @if egrep "^# DO NOT DELETE THIS LINE" Makefile >/dev/null && [ -z "`find $(DEPS) -newer Makefile 2>/dev/null; exit 0`" ]; then :; else \
+ ( $(PERL) -pe 'exit 0 if /^# DO NOT DELETE THIS LINE.*/' < Makefile; \
+ echo '# DO NOT DELETE THIS LINE -- make depend depends on it.'; \
+ echo; \
+ for f in $(DEPS); do \
+ if [ -f $$f ]; then cat $$f; fi; \
+ done ) > Makefile.new; \
+ if cmp Makefile.new Makefile >/dev/null 2>&1; then \
+ rm -f Makefile.new; \
+ else \
+ mv -f Makefile.new Makefile; \
+ fi; \
+ fi
+ @: {- output_on() if $disabled{makedepend}; "" -}
+
+# Install helper targets #############################################
+
+install_sw: all install_dev install_engines install_runtime
+
+uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
+
+install_docs: install_man_docs install_html_docs
+
+uninstall_docs: uninstall_man_docs uninstall_html_docs
+ $(RM) -r -v $(DESTDIR)$(DOCDIR)
+
+install_ssldirs:
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
+ @set -e; for x in dummy $(MISC_SCRIPTS); do \
+ if [ "$$x" = "dummy" ]; then continue; fi; \
+ fn=`basename $$x`; \
+ echo "install $$x -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
+ cp $$x $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
+ chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
+ mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
+ $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
+ done
+ @echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
+ @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
+ @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
+ @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist
+ @if ! [ -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
+ echo "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
+ cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
+ chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
+ fi
+
+install_dev:
+ @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
+ @echo "*** Installing development files"
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
+ @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
+ @echo "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
+ @cp $(SRCDIR)/ms/applink.c $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
+ @chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
+ @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
+ @set -e; for i in $(SRCDIR)/include/openssl/*.h \
+ $(BLDDIR)/include/openssl/*.h; do \
+ fn=`basename $$i`; \
+ echo "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
+ cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
+ chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
+ done
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
+ @set -e; for l in $(INSTALL_LIBS); do \
+ fn=`basename $$l`; \
+ echo "install $$l -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
+ cp $$l $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
+ $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
+ chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
+ $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
+ done
+ @ : {- output_off() if $disabled{shared}; "" -}
+ @set -e; for s in $(INSTALL_SHLIB_INFO); do \
+ s1=`echo "$$s" | cut -f1 -d";"`; \
+ s2=`echo "$$s" | cut -f2 -d";"`; \
+ fn1=`basename $$s1`; \
+ fn2=`basename $$s2`; \
+ : {- output_off() if windowsdll(); "" -}; \
+ echo "install $$s1 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
+ cp $$s1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
+ chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1.new \
+ $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
+ if [ "$$fn1" != "$$fn2" ]; then \
+ echo "link $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
+ ln -sf $$fn1 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
+ fi; \
+ : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
+ echo "install $$s2 -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
+ cp $$s2 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
+ chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2.new \
+ $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
+ : {- output_on() unless windowsdll(); "" -}; \
+ done
+ @ : {- output_on() if $disabled{shared}; "" -}
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
+ @echo "install libcrypto.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc"
+ @cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
+ @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
+ @echo "install libssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc"
+ @cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
+ @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
+ @echo "install openssl.pc -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc"
+ @cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
+ @chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
+
+uninstall_dev:
+ @echo "*** Uninstalling development files"
+ @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
+ @echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
+ @$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
+ @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
+ @set -e; for i in $(SRCDIR)/include/openssl/*.h \
+ $(BLDDIR)/include/openssl/*.h; do \
+ fn=`basename $$i`; \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
+ done
+ -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
+ -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
+ @set -e; for l in $(INSTALL_LIBS); do \
+ fn=`basename $$l`; \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
+ done
+ @ : {- output_off() if $disabled{shared}; "" -}
+ @set -e; for s in $(INSTALL_SHLIB_INFO); do \
+ s1=`echo "$$s" | cut -f1 -d";"`; \
+ s2=`echo "$$s" | cut -f2 -d";"`; \
+ fn1=`basename $$s1`; \
+ fn2=`basename $$s2`; \
+ : {- output_off() if windowsdll(); "" -}; \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn1; \
+ if [ "$$fn1" != "$$fn2" ]; then \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
+ fi; \
+ : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn2; \
+ : {- output_on() unless windowsdll(); "" -}; \
+ done
+ @ : {- output_on() if $disabled{shared}; "" -}
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc
+ $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc
+ -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig
+ -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
+
+install_engines:
+ @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
+ @echo "*** Installing engines"
+ @set -e; for e in dummy $(INSTALL_ENGINES); do \
+ if [ "$$e" = "dummy" ]; then continue; fi; \
+ fn=`basename $$e`; \
+ echo "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
+ cp $$e $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
+ chmod 755 $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
+ mv -f $(DESTDIR)$(ENGINESDIR)/$$fn.new \
+ $(DESTDIR)$(ENGINESDIR)/$$fn; \
+ done
+
+uninstall_engines:
+ @echo "*** Uninstalling engines"
+ @set -e; for e in dummy $(INSTALL_ENGINES); do \
+ if [ "$$e" = "dummy" ]; then continue; fi; \
+ fn=`basename $$e`; \
+ if [ "$$fn" = '{- dso("ossltest") -}' ]; then \
+ continue; \
+ fi; \
+ echo "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
+ $(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
+ done
+ -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
+
+install_runtime:
+ @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
+ @ : {- output_off() if windowsdll(); "" -}
+ @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)
+ @ : {- output_on() if windowsdll(); "" -}
+ @echo "*** Installing runtime files"
+ @set -e; for s in dummy $(INSTALL_SHLIBS); do \
+ if [ "$$s" = "dummy" ]; then continue; fi; \
+ fn=`basename $$s`; \
+ : {- output_off() unless windowsdll(); "" -}; \
+ echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
+ cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
+ chmod 644 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
+ $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
+ : {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
+ echo "install $$s -> $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn"; \
+ cp $$s $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
+ chmod 755 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn.new \
+ $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$fn; \
+ : {- output_on() if windowsdll(); "" -}; \
+ done
+ @set -e; for x in dummy $(INSTALL_PROGRAMS); do \
+ if [ "$$x" = "dummy" ]; then continue; fi; \
+ fn=`basename $$x`; \
+ echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
+ cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
+ chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
+ $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
+ done
+ @set -e; for x in dummy $(BIN_SCRIPTS); do \
+ if [ "$$x" = "dummy" ]; then continue; fi; \
+ fn=`basename $$x`; \
+ echo "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
+ cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
+ chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
+ mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
+ $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
+ done
+
+uninstall_runtime:
+ @echo "*** Uninstalling runtime files"
+ @set -e; for x in dummy $(INSTALL_PROGRAMS); \
+ do \
+ if [ "$$x" = "dummy" ]; then continue; fi; \
+ fn=`basename $$x`; \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
+ done;
+ @set -e; for x in dummy $(BIN_SCRIPTS); \
+ do \
+ if [ "$$x" = "dummy" ]; then continue; fi; \
+ fn=`basename $$x`; \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
+ done
+ @ : {- output_off() unless windowsdll(); "" -}
+ @set -e; for s in dummy $(INSTALL_SHLIBS); do \
+ if [ "$$s" = "dummy" ]; then continue; fi; \
+ fn=`basename $$s`; \
+ echo "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
+ $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
+ done
+ @ : {- output_on() unless windowsdll(); "" -}
+ -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
+
+
+install_man_docs:
+ @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
+ @echo "*** Installing manpages"
+ $(PERL) $(SRCDIR)/util/process_docs.pl \
+ --destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX)
+
+uninstall_man_docs:
+ @echo "*** Uninstalling manpages"
+ $(PERL) $(SRCDIR)/util/process_docs.pl \
+ --destdir=$(DESTDIR)$(MANDIR) --type=man --suffix=$(MANSUFFIX) \
+ --remove
+
+install_html_docs:
+ @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
+ @echo "*** Installing HTML manpages"
+ $(PERL) $(SRCDIR)/util/process_docs.pl \
+ --destdir=$(DESTDIR)$(HTMLDIR) --type=html
+
+uninstall_html_docs:
+ @echo "*** Uninstalling manpages"
+ $(PERL) $(SRCDIR)/util/process_docs.pl \
+ --destdir=$(DESTDIR)$(HTMLDIR) --type=html --remove
+
+
+# Developer targets (note: these are only available on Unix) #########
+
+update: generate errors ordinals
+
+generate: generate_apps generate_crypto_bn generate_crypto_objects \
+ generate_crypto_conf generate_crypto_asn1
+
+doc-nits:
+ (cd $(SRCDIR); $(PERL) util/find-doc-nits -n ) >doc-nits
+ if [ -s doc-nits ] ; then cat doc-nits; rm doc-nits ; exit 1; fi
+
+# Test coverage is a good idea for the future
+#coverage: $(PROGRAMS) $(TESTPROGRAMS)
+# ...
+
+lint:
+ lint -DLINT $(INCLUDES) $(SRCS)
+
+generate_apps:
+ ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
+ < apps/openssl.cnf > apps/openssl-vms.cnf )
+
+generate_crypto_bn:
+ ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
+
+generate_crypto_objects:
+ ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
+ crypto/objects/objects.txt \
+ crypto/objects/obj_mac.num \
+ include/openssl/obj_mac.h )
+ ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
+ include/openssl/obj_mac.h \
+ crypto/objects/obj_dat.h )
+ ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
+ crypto/objects/obj_mac.num \
+ crypto/objects/obj_xref.txt \
+ > crypto/objects/obj_xref.h )
+
+generate_crypto_conf:
+ ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
+ > crypto/conf/conf_def.h )
+
+generate_crypto_asn1:
+ ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
+ > crypto/asn1/charmap.h )
+
+errors:
+ ( cd $(SRCDIR); $(PERL) util/ck_errf.pl -strict */*.c */*/*.c )
+ ( cd $(SRCDIR); $(PERL) util/mkerr.pl -recurse -write )
+ ( cd $(SRCDIR)/engines; \
+ for e in *.ec; do \
+ $(PERL) ../util/mkerr.pl -conf $$e \
+ -nostatic -staticloader -write *.c; \
+ done )
+
+ordinals:
+ ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl crypto update )
+ ( b=`pwd`; cd $(SRCDIR); $(PERL) -I$$b util/mkdef.pl ssl update )
+
+test_ordinals:
+ ( cd test; \
+ SRCTOP=../$(SRCDIR) \
+ BLDTOP=../$(BLDDIR) \
+ $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
+
+tags TAGS: FORCE
+ rm -f TAGS tags
+ -ctags -R .
+ -etags `find . -name '*.[ch]' -o -name '*.pm'`
+
+# Release targets (note: only available on Unix) #####################
+
+# If your tar command doesn't support --owner and --group, make sure to
+# use one that does, for example GNU tar
+TAR_COMMAND=$(TAR) $(TARFLAGS) --owner 0 --group 0 -cvf -
+PREPARE_CMD=:
+tar:
+ set -e; \
+ TMPDIR=/var/tmp/openssl-copy.$$$$; \
+ DISTDIR=$(NAME); \
+ mkdir -p $$TMPDIR/$$DISTDIR; \
+ (cd $(SRCDIR); \
+ git ls-tree -r --name-only --full-tree HEAD \
+ | grep -v '^fuzz/corpora' \
+ | while read F; do \
+ mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
+ cp $$F $$TMPDIR/$$DISTDIR/$$F; \
+ done); \
+ (cd $$TMPDIR/$$DISTDIR; \
+ $(PREPARE_CMD); \
+ find . -type d -print | xargs chmod 755; \
+ find . -type f -print | xargs chmod a+r; \
+ find . -type f -perm -0100 -print | xargs chmod a+x); \
+ (cd $$TMPDIR; $(TAR_COMMAND) $$DISTDIR) \
+ | (cd $(SRCDIR); gzip --best > $(TARFILE).gz); \
+ rm -rf $$TMPDIR
+ cd $(SRCDIR); ls -l $(TARFILE).gz
+
+dist:
+ @$(MAKE) PREPARE_CMD='$(PERL) ./Configure dist' tar
+
+# Helper targets #####################################################
+
+link-utils: $(BLDDIR)/util/opensslwrap.sh
+
+$(BLDDIR)/util/opensslwrap.sh: configdata.pm
+ @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
+ mkdir -p "$(BLDDIR)/util"; \
+ ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
+ fi
+
+FORCE:
+
+# Building targets ###################################################
+
+libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS) {- join(" ",map { shlib_simple($_) } @{$unified_info{libraries}}) -}
+libcrypto.pc:
+ @ ( echo 'prefix=$(INSTALLTOP)'; \
+ echo 'exec_prefix=$${prefix}'; \
+ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
+ echo 'includedir=$${prefix}/include'; \
+ echo 'enginesdir=$${libdir}/engines-{- $sover -}'; \
+ echo ''; \
+ echo 'Name: OpenSSL-libcrypto'; \
+ echo 'Description: OpenSSL cryptography library'; \
+ echo 'Version: '$(VERSION); \
+ echo 'Libs: -L$${libdir} -lcrypto'; \
+ echo 'Libs.private: $(EX_LIBS)'; \
+ echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
+
+libssl.pc:
+ @ ( echo 'prefix=$(INSTALLTOP)'; \
+ echo 'exec_prefix=$${prefix}'; \
+ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
+ echo 'includedir=$${prefix}/include'; \
+ echo ''; \
+ echo 'Name: OpenSSL-libssl'; \
+ echo 'Description: Secure Sockets Layer and cryptography libraries'; \
+ echo 'Version: '$(VERSION); \
+ echo 'Requires.private: libcrypto'; \
+ echo 'Libs: -L$${libdir} -lssl'; \
+ echo 'Cflags: -I$${includedir}' ) > libssl.pc
+
+openssl.pc:
+ @ ( echo 'prefix=$(INSTALLTOP)'; \
+ echo 'exec_prefix=$${prefix}'; \
+ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
+ echo 'includedir=$${prefix}/include'; \
+ echo ''; \
+ echo 'Name: OpenSSL'; \
+ echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
+ echo 'Version: '$(VERSION); \
+ echo 'Requires: libssl libcrypto' ) > openssl.pc
+
+configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config {- join(" ", @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
+ @echo "Detected changed: $?"
+ @echo "Reconfiguring..."
+ $(PERL) $(SRCDIR)/Configure reconf
+ @echo "**************************************************"
+ @echo "*** ***"
+ @echo "*** Please run the same make command again ***"
+ @echo "*** ***"
+ @echo "**************************************************"
+ @false
+
+{-
+ use File::Basename;
+ use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
+
+ # Helper function to figure out dependencies on libraries
+ # It takes a list of library names and outputs a list of dependencies
+ sub compute_lib_depends {
+ if ($disabled{shared}) {
+ return map { $_.$libext } @_;
+ }
+
+ # Depending on shared libraries:
+ # On Windows POSIX layers, we depend on {libname}.dll.a
+ # On Unix platforms, we depend on {shlibname}.so
+ return map { shlib_simple($_) } @_;
+ }
+
+ sub generatesrc {
+ my %args = @_;
+ my $generator = join(" ", @{$args{generator}});
+ my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
+ my $incs = join("", map { " -I".$_ } @{$args{incs}});
+ my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
+
+ if ($args{src} !~ /\.[sS]$/) {
+ if ($args{generator}->[0] =~ m|^.*\.in$|) {
+ my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "dofile.pl")),
+ rel2abs($config{builddir}));
+ return <<"EOF";
+$args{src}: $args{generator}->[0] $deps
+ \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+ "-o$target{build_file}" $generator > \$@
+EOF
+ } else {
+ return <<"EOF";
+$args{src}: $args{generator}->[0] $deps
+ \$(PERL)$generator_incs $generator > \$@
+EOF
+ }
+ } else {
+ if ($args{generator}->[0] =~ /\.pl$/) {
+ $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator;
+ } elsif ($args{generator}->[0] =~ /\.m4$/) {
+ $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
+ } elsif ($args{generator}->[0] =~ /\.S$/) {
+ $generator = undef;
+ } else {
+ die "Generator type for $args{src} unknown: $generator\n";
+ }
+
+ if (defined($generator)) {
+ return <<"EOF";
+$args{src}: $args{generator}->[0] $deps
+ $generator \$@
+EOF
+ }
+ return <<"EOF";
+$args{src}: $args{generator}->[0] $deps
+ \$(CC) $incs \$(CFLAGS) -E $args{generator}->[0] | \\
+ \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
+EOF
+ }
+ }
+
+ # Should one wonder about the end of the Perl snippet, it's because this
+ # second regexp eats up line endings as well, if the removed path is the
+ # last in the line. We may therefore need to put back a line ending.
+ sub src2obj {
+ my %args = @_;
+ my $obj = $args{obj};
+ my @srcs = @{$args{srcs}};
+ my $srcs = join(" ", @srcs);
+ my $deps = join(" ", @srcs, @{$args{deps}});
+ my $incs = join("", map { " -I".$_ } @{$args{incs}});
+ unless ($disabled{zlib}) {
+ if ($withargs{zlib_include}) {
+ $incs .= " -I".$withargs{zlib_include};
+ }
+ }
+ my $ecflags = { lib => '$(LIB_CFLAGS)',
+ dso => '$(DSO_CFLAGS)',
+ bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
+ my $makedepprog = $config{makedepprog};
+ my $recipe;
+ # extension-specific rules
+ if (grep /\.s$/, @srcs) {
+ $recipe .= <<"EOF";
+$obj$objext: $deps
+ \$(CC) \$(CFLAGS) $ecflags -c -o \$\@ $srcs
+EOF
+ } elsif (grep /\.S$/, @srcs) {
+ # In case one wonders why not just $(CC) -c file.S. While it
+ # does work with contemporary compilers, there are some legacy
+ # ones that get it wrong. Hence the elaborate scheme... We
+ # don't care to maintain dependecy lists, because dependency
+ # is rather weak, at most one header file that lists constants
+ # which are assigned in ascending order.
+ $recipe .= <<"EOF";
+$obj$objext: $deps
+ ( trap "rm -f \$@.*" INT 0; \\
+ \$(CPP) $incs \$(CFLAGS) $ecflags $srcs | \\
+ \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@.s && \\
+ \$(CC) \$(CFLAGS) $ecflags -c -o \$\@ \$@.s )
+EOF
+ } elsif (!$disabled{makedepend} && $makedepprog !~ /\/makedepend/) {
+ $recipe .= <<"EOF";
+$obj$objext: $deps
+ \$(CC) $incs \$(CFLAGS) $ecflags -MMD -MF $obj$depext.tmp -MT \$\@ -c -o \$\@ $srcs
+ \@touch $obj$depext.tmp
+ \@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
+ rm -f $obj$depext.tmp; \\
+ else \\
+ mv $obj$depext.tmp $obj$depext; \\
+ fi
+EOF
+ } else {
+ $recipe .= <<"EOF";
+$obj$objext: $deps
+ \$(CC) $incs \$(CFLAGS) $ecflags -c -o \$\@ $srcs
+EOF
+ if (!$disabled{makedepend} && $makedepprog =~ /\/makedepend/) {
+ $recipe .= <<"EOF";
+ -\$(MAKEDEPEND) -f- -o"|\$\@" -- $incs \$(CFLAGS) $ecflags -- $srcs \\
+ >$obj$depext.tmp 2>/dev/null
+ -\$(PERL) -i -pe 's/^.*\\|//; s/ \\/(\\\\.|[^ ])*//; \$\$_ = undef if (/: *\$\$/ || /^(#.*| *)\$\$/); \$\$_.="\\n" unless !defined(\$\$_) or /\\R\$\$/g;' $obj$depext.tmp
+ \@if cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
+ rm -f $obj$depext.tmp; \\
+ else \\
+ mv $obj$depext.tmp $obj$depext; \\
+ fi
+EOF
+ }
+ }
+ return $recipe;
+ }
+ # On Unix, we build shlibs from static libs, so we're ignoring the
+ # object file array. We *know* this routine is only called when we've
+ # configure 'shared'.
+ sub libobj2shlib {
+ my %args = @_;
+ my $lib = $args{lib};
+ my $shlib = $args{shlib};
+ my $libd = dirname($lib);
+ my $libn = basename($lib);
+ (my $libname = $libn) =~ s/^lib//;
+ my $linklibs = join("", map { my $d = dirname($_);
+ my $f = basename($_);
+ (my $l = $f) =~ s/^lib//;
+ " -L$d -l$l" } @{$args{deps}});
+ my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
+ my $shlib_target = $target{shared_target};
+ my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
+ my $target = shlib_simple($lib);
+ my $target_full = shlib($lib);
+ return <<"EOF"
+# With a build on a Windows POSIX layer (Cygwin or Mingw), we know for a fact
+# that two files get produced, {shlibname}.dll and {libname}.dll.a.
+# With all other Unix platforms, we often build a shared library with the
+# SO version built into the file name and a symlink without the SO version
+# It's not necessary to have both as targets. The choice falls on the
+# simplest, {libname}$shlibextimport for Windows POSIX layers and
+# {libname}$shlibextsimple for the Unix platforms.
+$target: $lib$libext $deps $ordinalsfile
+ \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
+ PLATFORM=\$(PLATFORM) \\
+ PERL="\$(PERL)" SRCDIR='\$(SRCDIR)' DSTDIR="$libd" \\
+ INSTALLTOP='\$(INSTALLTOP)' LIBDIR='\$(LIBDIR)' \\
+ LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
+ LIBNAME=$libname SHLIBVERSION=\$(SHLIB_MAJOR).\$(SHLIB_MINOR) \\
+ STLIBNAME=$lib$libext \\
+ SHLIBNAME=$target SHLIBNAME_FULL=$target_full \\
+ CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(LIB_CFLAGS)' \\
+ LDFLAGS='\$(LDFLAGS)' SHARED_LDFLAGS='\$(LIB_LDFLAGS)' \\
+ RC='\$(RC)' SHARED_RCFLAGS='\$(RCFLAGS)' \\
+ link_shlib.$shlib_target
+EOF
+ . (windowsdll() ? <<"EOF" : "");
+ rm -f apps/$shlib$shlibext
+ rm -f test/$shlib$shlibext
+ rm -f fuzz/$shlib$shlibext
+ cp -p $shlib$shlibext apps/
+ cp -p $shlib$shlibext test/
+ cp -p $shlib$shlibext fuzz/
+EOF
+ }
+ sub obj2dso {
+ my %args = @_;
+ my $dso = $args{lib};
+ my $dsod = dirname($dso);
+ my $dson = basename($dso);
+ my $shlibdeps = join("", map { my $d = dirname($_);
+ my $f = basename($_);
+ (my $l = $f) =~ s/^lib//;
+ " -L$d -l$l" } @{$args{deps}});
+ my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
+ my $shlib_target = $target{shared_target};
+ my $objs = join(" ", map { $_.$objext } @{$args{objs}});
+ my $target = dso($dso);
+ return <<"EOF";
+$target: $objs $deps
+ \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
+ PLATFORM=\$(PLATFORM) \\
+ PERL="\$(PERL)" SRCDIR='\$(SRCDIR)' DSTDIR="$dsod" \\
+ LIBDEPS='\$(PLIB_LDFLAGS) '"$shlibdeps"' \$(EX_LIBS)' \\
+ SHLIBNAME_FULL=$target LDFLAGS='\$(LDFLAGS)' \\
+ CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(DSO_CFLAGS)' \\
+ SHARED_LDFLAGS='\$(DSO_LDFLAGS)' \\
+ LIBEXTRAS="$objs" \\
+ link_dso.$shlib_target
+EOF
+ }
+ sub obj2lib {
+ my %args = @_;
+ my $lib = $args{lib};
+ my $objs = join(" ", map { $_.$objext } @{$args{objs}});
+ return <<"EOF";
+$lib$libext: $objs
+ \$(AR) \$\@ \$\?
+ \$(RANLIB) \$\@ || echo Never mind.
+EOF
+ }
+ sub obj2bin {
+ my %args = @_;
+ my $bin = $args{bin};
+ my $bind = dirname($bin);
+ my $binn = basename($bin);
+ my $objs = join(" ", map { $_.$objext } @{$args{objs}});
+ my $deps = join(" ",compute_lib_depends(@{$args{deps}}));
+ my $linklibs = join("", map { my $d = dirname($_);
+ my $f = basename($_);
+ $d = "." if $d eq $f;
+ (my $l = $f) =~ s/^lib//;
+ " -L$d -l$l" } @{$args{deps}});
+ my $shlib_target = $disabled{shared} ? "" : $target{shared_target};
+ return <<"EOF";
+$bin$exeext: $objs $deps
+ \$(RM) $bin$exeext
+ \$(MAKE) -f \$(SRCDIR)/Makefile.shared -e \\
+ PERL="\$(PERL)" SRCDIR=\$(SRCDIR) \\
+ APPNAME=$bin$exeext OBJECTS="$objs" \\
+ LIBDEPS='\$(PLIB_LDFLAGS) '"$linklibs"' \$(EX_LIBS)' \\
+ CC='\$(CC)' CFLAGS='\$(CFLAGS) \$(BIN_CFLAGS)' \\
+ LDFLAGS='\$(LDFLAGS)' \\
+ link_app.$shlib_target
+EOF
+ }
+ sub in2script {
+ my %args = @_;
+ my $script = $args{script};
+ my $sources = join(" ", @{$args{sources}});
+ my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "dofile.pl")),
+ rel2abs($config{builddir}));
+ return <<"EOF";
+$script: $sources
+ \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+ "-o$target{build_file}" $sources > "$script"
+ chmod a+x $script
+EOF
+ }
+ sub generatedir {
+ my %args = @_;
+ my $dir = $args{dir};
+ my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
+ my @actions = ();
+ my %extinfo = ( dso => $dsoext,
+ lib => $libext,
+ bin => $exeext );
+
+ foreach my $type (("dso", "lib", "bin", "script")) {
+ next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
+ # For lib object files, we could update the library. However, it
+ # was decided that it's enough to build the directory local object
+ # files, so we don't need to add any actions, and the dependencies
+ # are already taken care of.
+ if ($type ne "lib") {
+ foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
+ if (dirname($prod) eq $dir) {
+ push @deps, $prod.$extinfo{$type};
+ } else {
+ push @actions, "\t@ : No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
+ }
+ }
+ }
+ }
+
+ my $deps = join(" ", @deps);
+ my $actions = join("\n", "", @actions);
+ return <<"EOF";
+$args{dir} $args{dir}/: $deps$actions
+EOF
+ }
+ "" # Important! This becomes part of the template result.
+-}
diff --git a/openssl-1.1.0h/Configurations/unix-checker.pm b/openssl-1.1.0h/Configurations/unix-checker.pm
new file mode 100644
index 0000000..b39b0eb
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/unix-checker.pm
@@ -0,0 +1,22 @@
+#! /usr/bin/perl
+
+use Config;
+
+# Check that the perl implementation file modules generate paths that
+# we expect for the platform
+use File::Spec::Functions qw(:DEFAULT rel2abs);
+
+if (rel2abs('.') !~ m|/|) {
+ die <<EOF;
+
+******************************************************************************
+This perl implementation doesn't produce Unix like paths (with forward slash
+directory separators). Please use an implementation that matches your
+building platform.
+
+This Perl version: $Config{version} for $Config{archname}
+******************************************************************************
+EOF
+}
+
+1;
diff --git a/openssl-1.1.0h/Configurations/windows-checker.pm b/openssl-1.1.0h/Configurations/windows-checker.pm
new file mode 100644
index 0000000..de46fbc
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/windows-checker.pm
@@ -0,0 +1,22 @@
+#! /usr/bin/perl
+
+use Config;
+
+# Check that the perl implementation file modules generate paths that
+# we expect for the platform
+use File::Spec::Functions qw(:DEFAULT rel2abs);
+
+if (rel2abs('.') !~ m|\\|) {
+ die <<EOF;
+
+******************************************************************************
+This perl implementation doesn't produce Windows like paths (with backward
+slash directory separators). Please use an implementation that matches your
+building platform.
+
+This Perl version: $Config{version} for $Config{archname}
+******************************************************************************
+EOF
+}
+
+1;
diff --git a/openssl-1.1.0h/Configurations/windows-makefile.tmpl b/openssl-1.1.0h/Configurations/windows-makefile.tmpl
new file mode 100644
index 0000000..e3e213f
--- /dev/null
+++ b/openssl-1.1.0h/Configurations/windows-makefile.tmpl
@@ -0,0 +1,621 @@
+##
+## Makefile for OpenSSL
+##
+## {- join("\n## ", @autowarntext) -}
+{-
+ our $objext = $target{obj_extension} || ".obj";
+ our $depext = $target{dep_extension} || ".d";
+ our $exeext = $target{exe_extension} || ".exe";
+ our $libext = $target{lib_extension} || ".lib";
+ our $shlibext = $target{shared_extension} || ".dll";
+ our $shlibextimport = $target{shared_import_extension} || ".lib";
+ our $dsoext = $target{dso_extension} || ".dll";
+
+ our $sover = $config{shlib_major}."_".$config{shlib_minor};
+
+ my $win_installenv =
+ $target{build_scheme}->[2] eq "VC-W32" ?
+ "ProgramFiles(x86)" : "ProgramW6432";
+ my $win_commonenv =
+ $target{build_scheme}->[2] eq "VC-W32"
+ ? "CommonProgramFiles(x86)" : "CommonProgramW6432";
+ our $win_installroot =
+ defined($ENV{$win_installenv})
+ ? $win_installenv : 'ProgramFiles';
+ our $win_commonroot =
+ defined($ENV{$win_commonenv})
+ ? $win_commonenv : 'CommonProgramFiles';
+
+ # expand variables early
+ $win_installroot = $ENV{$win_installroot};
+ $win_commonroot = $ENV{$win_commonroot};
+
+ sub shlib {
+ return () if $disabled{shared};
+ my $lib = shift;
+ return $unified_info{sharednames}->{$lib} . $shlibext;
+ }
+
+ sub shlib_import {
+ return () if $disabled{shared};
+ my $lib = shift;
+ return $lib . $shlibextimport;
+ }
+
+ sub dso {
+ my $dso = shift;
+
+ return $dso . $dsoext;
+ }
+ # This makes sure things get built in the order they need
+ # to. You're welcome.
+ sub dependmagic {
+ my $target = shift;
+
+ return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
+ }
+ '';
+-}
+
+PLATFORM={- $config{target} -}
+SRCDIR={- $config{sourcedir} -}
+BLDDIR={- $config{builddir} -}
+
+VERSION={- $config{version} -}
+MAJOR={- $config{major} -}
+MINOR={- $config{minor} -}
+
+SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
+
+LIBS={- join(" ", map { $_.$libext } @{$unified_info{libraries}}) -}
+SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
+SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{libraries}}) -}
+ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
+ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{engines}}) -}
+PROGRAMS={- our @PROGRAMS = map { $_.$exeext } @{$unified_info{programs}}; join(" ", @PROGRAMS) -}
+PROGRAMPDBS={- join(" ", map { $_.".pdb" } @{$unified_info{programs}}) -}
+SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
+{- output_off() if $disabled{makedepend}; "" -}
+DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
+ grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
+ keys %{$unified_info{sources}}); -}
+{- output_on() if $disabled{makedepend}; "" -}
+GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
+GENERATED={- join(" ",
+ ( map { (my $x = $_) =~ s|\.[sS]$|\.asm|; $x }
+ grep { defined $unified_info{generate}->{$_} }
+ map { @{$unified_info{sources}->{$_}} }
+ grep { /\.o$/ } keys %{$unified_info{sources}} ),
+ ( grep { /\.h$/ } keys %{$unified_info{generate}} )) -}
+
+INSTALL_LIBS={- join(" ", map { $_.$libext } @{$unified_info{install}->{libraries}}) -}
+INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -}
+INSTALL_SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{install}->{libraries}}) -}
+INSTALL_ENGINES={- join(" ", map { dso($_) } @{$unified_info{install}->{engines}}) -}
+INSTALL_ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{install}->{engines}}) -}
+INSTALL_PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
+INSTALL_PROGRAMPDBS={- join(" ", map { $_.".pdb" } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
+{- output_off() if $disabled{apps}; "" -}
+BIN_SCRIPTS=$(BLDDIR)\tools\c_rehash.pl
+MISC_SCRIPTS=$(BLDDIR)\apps\CA.pl $(BLDDIR)\apps\tsget.pl
+{- output_on() if $disabled{apps}; "" -}
+
+APPS_OPENSSL={- use File::Spec::Functions;
+ catfile("apps","openssl") -}
+
+# Do not edit these manually. Use Configure with --prefix or --openssldir
+# to change this! Short explanation in the top comment in Configure
+INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
+ #
+ use File::Spec::Functions qw(:DEFAULT splitpath);
+ our $prefix = canonpath($config{prefix}
+ || "$win_installroot\\OpenSSL");
+ our ($prefix_dev, $prefix_dir, $prefix_file) =
+ splitpath($prefix, 1);
+ $prefix_dev -}
+INSTALLTOP_dir={- canonpath($prefix_dir) -}
+OPENSSLDIR_dev={- #
+ # The logic here is that if no --openssldir was given,
+ # OPENSSLDIR will get the value from $prefix plus "/ssl".
+ # If --openssldir was given and the value is an absolute
+ # path, OPENSSLDIR will get its value without change.
+ # If the value from --openssldir is a relative path,
+ # OPENSSLDIR will get $prefix with the --openssldir
+ # value appended as a subdirectory.
+ #
+ use File::Spec::Functions qw(:DEFAULT splitpath);
+ our $openssldir =
+ $config{openssldir} ?
+ (file_name_is_absolute($config{openssldir}) ?
+ canonpath($config{openssldir})
+ : catdir($prefix, $config{openssldir}))
+ : canonpath("$win_commonroot\\SSL");
+ our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
+ splitpath($openssldir, 1);
+ $openssldir_dev -}
+OPENSSLDIR_dir={- canonpath($openssldir_dir) -}
+LIBDIR={- our $libdir = $config{libdir} || "lib";
+ $libdir -}
+ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath);
+ our $enginesdir = catdir($prefix,$libdir,"engines-$sover");
+ our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
+ splitpath($enginesdir, 1);
+ $enginesdir_dev -}
+ENGINESDIR_dir={- canonpath($enginesdir_dir) -}
+!IF "$(DESTDIR)" != ""
+INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
+OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
+ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
+!ELSE
+INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
+OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
+ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
+!ENDIF
+
+CC={- $target{cc} -}
+CFLAGS={- join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}})) -} {- join(" ", quotify_l("-DENGINESDIR=\"$enginesdir\"", "-DOPENSSLDIR=\"$openssldir\"")) -} {- $target{cflags} -} {- $config{cflags} -}
+COUTFLAG={- $target{coutflag} || "/Fo" -}$(OSSL_EMPTY)
+RC={- $target{rc} || "rc" -}
+RCOUTFLAG={- $target{rcoutflag} || "/fo" -}$(OSSL_EMPTY)
+LD={- $target{ld} || "link" -}
+LDFLAGS={- $target{lflags} -}
+LDOUTFLAG={- $target{loutflag} || "/out:" -}$(OSSL_EMPTY)
+EX_LIBS={- $target{ex_libs} -}
+LIB_CFLAGS={- join(" ", $target{lib_cflags}, $target{shared_cflag}) || "" -}
+LIB_LDFLAGS={- $target{shared_ldflag} || "" -}
+DSO_CFLAGS={- join(" ", $target{dso_cflags}, $target{shared_cflag}) || "" -}
+DSO_LDFLAGS={- join(" ", $target{dso_lflags}, $target{shared_ldflag}) || "" -}
+BIN_CFLAGS={- $target{bin_cflags} -}
+BIN_LDFLAGS={- $target{bin_lflags} -}
+
+PERL={- $config{perl} -}
+
+AR={- $target{ar} -}
+ARFLAGS= {- $target{arflags} -}
+AROUTFLAG={- $target{aroutflag} || "/out:" -}$(OSSL_EMPTY)
+
+MT={- $target{mt} -}
+MTFLAGS= {- $target{mtflags} -}
+MTINFLAG={- $target{mtinflag} || "-manifest " -}$(OSSL_EMPTY)
+MTOUTFLAG={- $target{mtoutflag} || "-outputresource:" -}$(OSSL_EMPTY)
+
+AS={- $target{as} -}
+ASFLAGS={- $target{asflags} -}
+ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
+PERLASM_SCHEME= {- $target{perlasm_scheme} -}
+
+PROCESSOR= {- $config{processor} -}
+
+# The main targets ###################################################
+
+{- dependmagic('all'); -}: build_libs_nodep build_engines_nodep build_programs_nodep
+{- dependmagic('build_libs'); -}: build_libs_nodep
+{- dependmagic('build_engines'); -}: build_engines_nodep
+{- dependmagic('build_programs'); -}: build_programs_nodep
+
+build_generated: $(GENERATED_MANDATORY)
+build_libs_nodep: $(LIBS) {- join(" ",map { shlib_import($_) } @{$unified_info{libraries}}) -}
+build_engines_nodep: $(ENGINES)
+build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
+
+# Kept around for backward compatibility
+build_apps build_tests: build_programs
+
+# Convenience target to prebuild all generated files, not just the mandatory
+# ones
+build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
+
+test: tests
+{- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep
+ @rem {- output_off() if $disabled{tests}; "" -}
+ -mkdir $(BLDDIR)\test\test-runs
+ set SRCTOP=$(SRCDIR)
+ set BLDTOP=$(BLDDIR)
+ set RESULT_D=$(BLDDIR)\test\test-runs
+ set PERL=$(PERL)
+ set OPENSSL_ENGINES=$(MAKEDIR)\engines
+ set OPENSSL_DEBUG_MEMORY=on
+ "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
+ @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+ @echo "Tests are not supported with your chosen Configure options"
+ @rem {- output_on() if !$disabled{tests}; "" -}
+
+list-tests:
+ @rem {- output_off() if $disabled{tests}; "" -}
+ @set SRCTOP=$(SRCDIR)
+ @"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
+ @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+ @echo "Tests are not supported with your chosen Configure options"
+ @rem {- output_on() if !$disabled{tests}; "" -}
+
+install: install_sw install_ssldirs install_docs
+
+uninstall: uninstall_docs uninstall_sw
+
+libclean:
+ "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """$$1.*"""; } @ARGV" $(SHLIBS)
+ "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """apps/$$1.*"""; } @ARGV" $(SHLIBS)
+ "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """test/$$1.*"""; } @ARGV" $(SHLIBS)
+ "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """fuzz/$$1.*"""; } @ARGV" $(SHLIBS)
+ -del /Q /F $(LIBS)
+ -del /Q ossl_static.pdb
+
+clean: libclean
+ {- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
+ -del /Q /F $(ENGINES)
+ -del /Q /F $(SCRIPTS)
+ -del /Q /F $(GENERATED)
+ -del /Q /S /F *.d
+ -del /Q /S /F *.obj
+ -del /Q /S /F *.pdb
+ -del /Q /S /F *.exp
+ -del /Q /S /F engines\*.ilk
+ -del /Q /S /F engines\*.lib
+ -del /Q /S /F apps\*.lib
+ -del /Q /S /F engines\*.manifest
+ -del /Q /S /F apps\*.manifest
+ -del /Q /S /F test\*.manifest
+
+distclean: clean
+ -del /Q /F configdata.pm
+ -del /Q /F makefile
+
+depend:
+
+# Install helper targets #############################################
+
+install_sw: all install_dev install_engines install_runtime
+
+uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
+
+install_docs: install_html_docs
+
+uninstall_docs: uninstall_html_docs
+
+install_ssldirs:
+ @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\certs"
+ @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\private"
+ @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\misc"
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
+ "$(OPENSSLDIR)\openssl.cnf.dist"
+ @IF NOT EXIST "$(OPENSSLDIR)\openssl.cnf" \
+ "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
+ "$(OPENSSLDIR)\openssl.cnf"
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
+ "$(OPENSSLDIR)\misc"
+
+install_dev:
+ @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
+ @echo *** Installing development files
+ @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
+ @rem {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
+ "$(INSTALLTOP)\include\openssl"
+ @rem {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\include\openssl\*.h" \
+ "$(INSTALLTOP)\include\openssl"
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\include\openssl\*.h \
+ "$(INSTALLTOP)\include\openssl"
+ @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\$(LIBDIR)"
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) \
+ "$(INSTALLTOP)\$(LIBDIR)"
+ @if "$(SHLIBS)"=="" \
+ "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb \
+ "$(INSTALLTOP)\$(LIBDIR)"
+
+uninstall_dev:
+
+install_engines:
+ @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
+ @echo *** Installing engines
+ @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
+ @if not "$(ENGINES)"=="" \
+ "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
+ @if not "$(ENGINES)"=="" \
+ "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
+
+uninstall_engines:
+
+install_runtime:
+ @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
+ @echo *** Installing runtime files
+ @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
+ @if not "$(SHLIBS)"=="" \
+ "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
+ @if not "$(SHLIBS)"=="" \
+ "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
+ "$(INSTALLTOP)\bin"
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
+ "$(INSTALLTOP)\bin"
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
+ "$(INSTALLTOP)\bin"
+ @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
+ "$(INSTALLTOP)\bin"
+
+uninstall_runtime:
+
+install_html_docs:
+ "$(PERL)" "$(SRCDIR)\util\process_docs.pl" \
+ "--destdir=$(INSTALLTOP)\html" --type=html
+
+uninstall_html_docs:
+
+# Building targets ###################################################
+
+configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
+ @echo "Detected changed: $?"
+ @echo "Reconfiguring..."
+ "$(PERL)" "$(SRCDIR)\Configure" reconf
+ @echo "**************************************************"
+ @echo "*** ***"
+ @echo "*** Please run the same make command again ***"
+ @echo "*** ***"
+ @echo "**************************************************"
+ @exit 1
+
+{-
+ use File::Basename;
+ use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
+
+ # Helper function to figure out dependencies on libraries
+ # It takes a list of library names and outputs a list of dependencies
+ sub compute_lib_depends {
+ if ($disabled{shared}) {
+ return map { $_.$libext } @_;
+ }
+ return map { shlib_import($_) } @_;
+ }
+
+ sub generatesrc {
+ my %args = @_;
+ (my $target = $args{src}) =~ s/\.[sS]$/.asm/;
+ my ($gen0, @gens) = @{$args{generator}};
+ my $generator = '"'.$gen0.'"'.join('', map { " $_" } @gens);
+ my $generator_incs = join("", map { " -I \"$_\"" } @{$args{generator_incs}});
+ my $incs = join("", map { " /I \"$_\"" } @{$args{incs}});
+ my $deps = @{$args{deps}} ?
+ '"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
+
+ if ($target !~ /\.asm$/) {
+ if ($args{generator}->[0] =~ m|^.*\.in$|) {
+ my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "dofile.pl")),
+ rel2abs($config{builddir}));
+ return <<"EOF";
+$target: "$args{generator}->[0]" $deps
+ "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+ "-o$target{build_file}" $generator > \$@
+EOF
+ } else {
+ return <<"EOF";
+$target: "$args{generator}->[0]" $deps
+ "\$(PERL)"$generator_incs $generator > \$@
+EOF
+ }
+ } else {
+ if ($args{generator}->[0] =~ /\.pl$/) {
+ $generator = '"$(PERL)"'.$generator_incs.' '.$generator;
+ } elsif ($args{generator}->[0] =~ /\.S$/) {
+ $generator = undef;
+ } else {
+ die "Generator type for $src unknown: $generator\n";
+ }
+
+ if (defined($generator)) {
+ # If the target is named foo.S in build.info, we want to
+ # end up generating foo.s in two steps.
+ if ($args{src} =~ /\.S$/) {
+ return <<"EOF";
+$target: "$args{generator}->[0]" $deps
+ set ASM=\$(AS)
+ $generator \$@.S
+ \$(CC) $incs \$(CFLAGS) /EP /C \$@.S > \$@.i && move /Y \$@.i \$@
+ del /Q \$@.S
+EOF
+ }
+ # Otherwise....
+ return <<"EOF";
+$target: "$args{generator}->[0]" $deps
+ set ASM=\$(AS)
+ $generator \$@
+EOF
+ }
+ return <<"EOF";
+$target: "$args{generator}->[0]" $deps
+ \$(CC) $incs \$(CFLAGS) /EP /C "$args{generator}->[0]" > \$@.i && move /Y \$@.i \$@
+EOF
+ }
+ }
+
+ sub src2obj {
+ my %args = @_;
+ my $obj = $args{obj};
+ my @srcs = map { (my $x = $_) =~ s/\.s$/.asm/; $x
+ } ( @{$args{srcs}} );
+ my $srcs = '"'.join('" "', @srcs).'"';
+ my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
+ my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}});
+ unless ($disabled{zlib}) {
+ if ($withargs{zlib_include}) {
+ $incs .= ' /I "'.$withargs{zlib_include}.'"';
+ }
+ }
+ my $ecflags = { lib => '$(LIB_CFLAGS)',
+ dso => '$(DSO_CFLAGS)',
+ bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
+ my $makedepprog = $config{makedepprog};
+ if ($srcs[0] =~ /\.asm$/) {
+ return <<"EOF";
+$obj$objext: $deps
+ \$(AS) \$(ASFLAGS) \$(ASOUTFLAG)\$\@ $srcs
+EOF
+ }
+ return <<"EOF" if (!$disabled{makedepend});
+$obj$depext: $deps
+ \$(CC) \$(CFLAGS) $ecflags$inc /Zs /showIncludes $srcs 2>&1 | \\
+ "\$(PERL)" -n << > $obj$depext
+chomp;
+s/^Note: including file: *//;
+\$\$collect{\$\$_} = 1;
+END { print '$obj$objext: ',join(" ", sort keys \%collect),"\\n" }
+<<
+$obj$objext: $obj$depext
+ \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ $srcs
+EOF
+ return <<"EOF" if ($disabled{makedepend});
+$obj$objext: $deps
+ \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ $srcs
+EOF
+ }
+
+ # On Unix, we build shlibs from static libs, so we're ignoring the
+ # object file array. We *know* this routine is only called when we've
+ # configure 'shared'.
+ sub libobj2shlib {
+ my %args = @_;
+ my $lib = $args{lib};
+ my $shlib = $args{shlib};
+ (my $mkdef_key = $lib) =~ s/^lib//i;
+ my $objs = join("\n", map { $_.$objext } @{$args{objs}});
+ my $linklibs = join("",
+ map { "\n$_" } compute_lib_depends(@{$args{deps}}));
+ my $deps = join(" ",
+ (map { $_.$objext } @{$args{objs}}),
+ compute_lib_depends(@{$args{deps}}));
+ my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
+ my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "mkdef.pl")),
+ rel2abs($config{builddir}));
+ my $mkrc_pl = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "mkrc.pl")),
+ rel2abs($config{builddir}));
+ my $target = shlib_import($lib);
+ return <<"EOF"
+$target: $deps "$ordinalsfile" "$mkdef_pl"
+ "\$(PERL)" "$mkdef_pl" "$mkdef_key" 32 > $shlib.def
+ "\$(PERL)" -i.tmp -pe "s|^LIBRARY\\s+${mkdef_key}32|LIBRARY $shlib|;" $shlib.def
+ DEL $shlib.def.tmp
+ "\$(PERL)" "$mkrc_pl" $shlib$shlibext > $shlib.rc
+ \$(RC) \$(RCOUTFLAG)$shlib.res $shlib.rc
+ IF EXIST $shlib$shlibext.manifest DEL /F /Q $shlib$shlibext.manifest
+ \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
+ /implib:\$@ \$(LDOUTFLAG)$shlib$shlibext /def:$shlib.def @<< || (DEL /Q \$(\@B).* $shlib.* && EXIT 1)
+$objs $shlib.res$linklibs \$(EX_LIBS)
+<<
+ IF EXIST $shlib$shlibext.manifest \\
+ \$(MT) \$(MTFLAGS) \$(MTINFLAG)$shlib$shlibext.manifest \$(MTOUTFLAG)$shlib$shlibext
+ IF EXIST apps\\$shlib$shlibext DEL /Q /F apps\\$shlib$shlibext
+ IF EXIST test\\$shlib$shlibext DEL /Q /F test\\$shlib$shlibext
+ IF EXIST fuzz\\$shlib$shlibext DEL /Q /F fuzz\\$shlib$shlibext
+ COPY $shlib$shlibext apps
+ COPY $shlib$shlibext test
+ COPY $shlib$shlibext fuzz
+EOF
+ }
+ sub obj2dso {
+ my %args = @_;
+ my $dso = $args{lib};
+ my $dso_n = basename($dso);
+ my $objs = join("\n", map { $_.$objext } @{$args{objs}});
+ my $linklibs = join("",
+ map { "\n$_" } compute_lib_depends(@{$args{deps}}));
+ my $deps = join(" ",
+ (map { $_.$objext } @{$args{objs}}),
+ compute_lib_depends(@{$args{deps}}));
+ return <<"EOF";
+$dso$dsoext: $deps
+ IF EXIST $dso$dsoext.manifest DEL /F /Q $dso$dsoext.manifest
+ \$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \$(LDOUTFLAG)$dso$dsoext /def:<< @<<
+LIBRARY $dso_n
+EXPORTS
+ bind_engine @1
+ v_check @2
+<<
+$objs$linklibs \$(EX_LIBS)
+<<
+ IF EXIST $dso$dsoext.manifest \\
+ \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso$dsoext.manifest \$(MTOUTFLAG)$dso$dsoext
+EOF
+ }
+ sub obj2lib {
+ # Because static libs and import libs are both named the same in native
+ # Windows, we can't have both. We skip the static lib in that case,
+ # as the shared libs are what we use anyway.
+ return "" unless $disabled{"shared"};
+
+ my %args = @_;
+ my $lib = $args{lib};
+ my $objs = join("\n", map { $_.$objext } @{$args{objs}});
+ my $deps = join(" ", map { $_.$objext } @{$args{objs}});
+ return <<"EOF";
+$lib$libext: $deps
+ \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib$libext @<<
+\$**
+<<
+EOF
+ }
+ sub obj2bin {
+ my %args = @_;
+ my $bin = $args{bin};
+ my $objs = join("\n", map { $_.$objext } @{$args{objs}});
+ my $linklibs = join("",
+ map { "\n$_" } compute_lib_depends(@{$args{deps}}));
+ my $deps = join(" ",
+ (map { $_.$objext } @{$args{objs}}),
+ compute_lib_depends(@{$args{deps}}));
+ return <<"EOF";
+$bin$exeext: $deps
+ IF EXIST $bin$exeext.manifest DEL /F /Q $bin$exeext.manifest
+ \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin$exeext @<<
+$objs setargv.obj$linklibs \$(EX_LIBS)
+<<
+ IF EXIST $bin$exeext.manifest \\
+ \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin$exeext.manifest \$(MTOUTFLAG)$bin$exeext
+EOF
+ }
+ sub in2script {
+ my %args = @_;
+ my $script = $args{script};
+ my $sources = '"'.join('" "', @{$args{sources}}).'"';
+ my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
+ "util", "dofile.pl")),
+ rel2abs($config{builddir}));
+ return <<"EOF";
+$script: $sources
+ "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
+ "-o$target{build_file}" $sources > "$script"
+EOF
+ }
+ sub generatedir {
+ my %args = @_;
+ my $dir = $args{dir};
+ my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
+ my @actions = ();
+ my %extinfo = ( dso => $dsoext,
+ lib => $libext,
+ bin => $exeext );
+
+ foreach my $type (("dso", "lib", "bin", "script")) {
+ next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
+ # For lib object files, we could update the library. However,
+ # LIB on Windows doesn't work that way, so we won't create any
+ # actions for it, and the dependencies are already taken care of.
+ if ($type ne "lib") {
+ foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
+ if (dirname($prod) eq $dir) {
+ push @deps, $prod.$extinfo{$type};
+ } else {
+ push @actions, "\t@rem No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
+ }
+ }
+ }
+ }
+
+ my $deps = join(" ", @deps);
+ my $actions = join("\n", "", @actions);
+ return <<"EOF";
+$args{dir} $args{dir}\\ : $deps$actions
+EOF
+ }
+ "" # Important! This becomes part of the template result.
+-}
diff --git a/openssl-1.1.0h/Configure b/openssl-1.1.0h/Configure
new file mode 100755
index 0000000..c003364
--- /dev/null
+++ b/openssl-1.1.0h/Configure
@@ -0,0 +1,2806 @@
+#! /usr/bin/env perl
+# -*- mode: perl; -*-
+# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+## Configure -- OpenSSL source tree configuration script
+
+use 5.10.0;
+use strict;
+use FindBin;
+use lib "$FindBin::Bin/util/perl";
+use File::Basename;
+use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
+use File::Path qw/mkpath/;
+use OpenSSL::Glob;
+
+# see INSTALL for instructions.
+
+my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags]\n";
+
+# Options:
+#
+# --config add the given configuration file, which will be read after
+# any "Configurations*" files that are found in the same
+# directory as this script.
+# --prefix prefix for the OpenSSL installation, which includes the
+# directories bin, lib, include, share/man, share/doc/openssl
+# This becomes the value of INSTALLTOP in Makefile
+# (Default: /usr/local)
+# --openssldir OpenSSL data area, such as openssl.cnf, certificates and keys.
+# If it's a relative directory, it will be added on the directory
+# given with --prefix.
+# This becomes the value of OPENSSLDIR in Makefile and in C.
+# (Default: PREFIX/ssl)
+#
+# --cross-compile-prefix Add specified prefix to binutils components.
+#
+# --api One of 0.9.8, 1.0.0 or 1.1.0. Do not compile support for
+# interfaces deprecated as of the specified OpenSSL version.
+#
+# no-hw-xxx do not compile support for specific crypto hardware.
+# Generic OpenSSL-style methods relating to this support
+# are always compiled but return NULL if the hardware
+# support isn't compiled.
+# no-hw do not compile support for any crypto hardware.
+# [no-]threads [don't] try to create a library that is suitable for
+# multithreaded applications (default is "threads" if we
+# know how to do it)
+# [no-]shared [don't] try to create shared libraries when supported.
+# [no-]pic [don't] try to build position independent code when supported.
+# If disabled, it also disables shared and dynamic-engine.
+# no-asm do not use assembler
+# no-dso do not compile in any native shared-library methods. This
+# will ensure that all methods just return NULL.
+# no-egd do not compile support for the entropy-gathering daemon APIs
+# [no-]zlib [don't] compile support for zlib compression.
+# zlib-dynamic Like "zlib", but the zlib library is expected to be a shared
+# library and will be loaded in run-time by the OpenSSL library.
+# sctp include SCTP support
+# enable-weak-ssl-ciphers
+# Enable weak ciphers that are disabled by default.
+# 386 generate 80386 code in assembly modules
+# no-sse2 disables IA-32 SSE2 code in assembly modules, the above
+# mentioned '386' option implies this one
+# no-<cipher> build without specified algorithm (rsa, idea, rc5, ...)
+# -<xxx> +<xxx> compiler options are passed through
+# -static while -static is also a pass-through compiler option (and
+# as such is limited to environments where it's actually
+# meaningful), it triggers a number configuration options,
+# namely no-dso, no-pic, no-shared and no-threads. It is
+# argued that the only reason to produce statically linked
+# binaries (and in context it means executables linked with
+# -static flag, and not just executables linked with static
+# libcrypto.a) is to eliminate dependency on specific run-time,
+# a.k.a. libc version. The mentioned config options are meant
+# to achieve just that. Unfortunately on Linux it's impossible
+# to eliminate the dependency completely for openssl executable
+# because of getaddrinfo and gethostbyname calls, which can
+# invoke dynamically loadable library facility anyway to meet
+# the lookup requests. For this reason on Linux statically
+# linked openssl executable has rather debugging value than
+# production quality.
+#
+# DEBUG_SAFESTACK use type-safe stacks to enforce type-safety on stack items
+# provided to stack calls. Generates unique stack functions for
+# each possible stack type.
+# BN_LLONG use the type 'long long' in crypto/bn/bn.h
+# RC4_CHAR use 'char' instead of 'int' for RC4_INT in crypto/rc4/rc4.h
+# Following are set automatically by this script
+#
+# MD5_ASM use some extra md5 assembler,
+# SHA1_ASM use some extra sha1 assembler, must define L_ENDIAN for x86
+# RMD160_ASM use some extra ripemd160 assembler,
+# SHA256_ASM sha256_block is implemented in assembler
+# SHA512_ASM sha512_block is implemented in assembler
+# AES_ASM AES_[en|de]crypt is implemented in assembler
+
+# Minimum warning options... any contributions to OpenSSL should at least get
+# past these.
+
+# DEBUG_UNUSED enables __owur (warn unused result) checks.
+my $gcc_devteam_warn = "-DDEBUG_UNUSED"
+ # -DPEDANTIC complements -pedantic and is meant to mask code that
+ # is not strictly standard-compliant and/or implementation-specific,
+ # e.g. inline assembly, disregards to alignment requirements, such
+ # that -pedantic would complain about. Incidentally -DPEDANTIC has
+ # to be used even in sanitized builds, because sanitizer too is
+ # supposed to and does take notice of non-standard behaviour. Then
+ # -pedantic with pre-C9x compiler would also complain about 'long
+ # long' not being supported. As 64-bit algorithms are common now,
+ # it grew impossible to resolve this without sizeable additional
+ # code, so we just tell compiler to be pedantic about everything
+ # but 'long long' type.
+ . " -DPEDANTIC -pedantic -Wno-long-long"
+ . " -Wall"
+ . " -Wextra"
+ . " -Wno-unused-parameter"
+ . " -Wno-missing-field-initializers"
+ . " -Wsign-compare"
+ . " -Wmissing-prototypes"
+ . " -Wshadow"
+ . " -Wformat"
+ . " -Wtype-limits"
+ . " -Wundef"
+ . " -Werror"
+ ;
+
+# These are used in addition to $gcc_devteam_warn when the compiler is clang.
+# TODO(openssl-team): fix problems and investigate if (at least) the
+# following warnings can also be enabled:
+# -Wswitch-enum
+# -Wcast-align
+# -Wunreachable-code
+# -Wlanguage-extension-token -- no, we use asm()
+# -Wunused-macros -- no, too tricky for BN and _XOPEN_SOURCE etc
+# -Wextended-offsetof -- no, needed in CMS ASN1 code
+my $clang_devteam_warn = ""
+ . " -Qunused-arguments"
+ . " -Wno-language-extension-token"
+ . " -Wno-extended-offsetof"
+ . " -Wconditional-uninitialized"
+ . " -Wincompatible-pointer-types-discards-qualifiers"
+ . " -Wmissing-variable-declarations"
+ ;
+
+# This adds backtrace information to the memory leak info. Is only used
+# when crypto-mdebug-backtrace is enabled.
+my $memleak_devteam_backtrace = "-rdynamic";
+
+my $strict_warnings = 0;
+
+# As for $BSDthreads. Idea is to maintain "collective" set of flags,
+# which would cover all BSD flavors. -pthread applies to them all,
+# but is treated differently. OpenBSD expands is as -D_POSIX_THREAD
+# -lc_r, which is sufficient. FreeBSD 4.x expands it as -lc_r,
+# which has to be accompanied by explicit -D_THREAD_SAFE and
+# sometimes -D_REENTRANT. FreeBSD 5.x expands it as -lc_r, which
+# seems to be sufficient?
+our $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT";
+
+#
+# API compatibility name to version number mapping.
+#
+my $maxapi = "1.1.0"; # API for "no-deprecated" builds
+my $apitable = {
+ "1.1.0" => "0x10100000L",
+ "1.0.0" => "0x10000000L",
+ "0.9.8" => "0x00908000L",
+};
+
+our %table = ();
+our %config = ();
+our %withargs = ();
+
+# Forward declarations ###############################################
+
+# read_config(filename)
+#
+# Reads a configuration file and populates %table with the contents
+# (which the configuration file places in %targets).
+sub read_config;
+
+# resolve_config(target)
+#
+# Resolves all the late evaluations, inheritances and so on for the
+# chosen target and any target it inherits from.
+sub resolve_config;
+
+
+# Information collection #############################################
+
+# Unified build supports separate build dir
+my $srcdir = catdir(absolutedir(dirname($0))); # catdir ensures local syntax
+my $blddir = catdir(absolutedir(".")); # catdir ensures local syntax
+my $dofile = abs2rel(catfile($srcdir, "util/dofile.pl"));
+
+my $local_config_envname = 'OPENSSL_LOCAL_CONFIG_DIR';
+
+$config{sourcedir} = abs2rel($srcdir);
+$config{builddir} = abs2rel($blddir);
+
+# Collect reconfiguration information if needed
+my @argvcopy=@ARGV;
+
+if (grep /^reconf(igure)?$/, @argvcopy) {
+ if (-f "./configdata.pm") {
+ my $file = "./configdata.pm";
+ unless (my $return = do $file) {
+ die "couldn't parse $file: $@" if $@;
+ die "couldn't do $file: $!" unless defined $return;
+ die "couldn't run $file" unless $return;
+ }
+
+ @argvcopy = defined($configdata::config{perlargv}) ?
+ @{$configdata::config{perlargv}} : ();
+ die "Incorrect data to reconfigure, please do a normal configuration\n"
+ if (grep(/^reconf/,@argvcopy));
+ $ENV{CROSS_COMPILE} = $configdata::config{cross_compile_prefix}
+ if defined($configdata::config{cross_compile_prefix});
+ $ENV{CC} = $configdata::config{cc}
+ if defined($configdata::config{cc});
+ $ENV{BUILDFILE} = $configdata::config{build_file}
+ if defined($configdata::config{build_file});
+ $ENV{$local_config_envname} = $configdata::config{local_config_dir}
+ if defined($configdata::config{local_config_dir});
+
+ print "Reconfiguring with: ", join(" ",@argvcopy), "\n";
+ print " CROSS_COMPILE = ",$ENV{CROSS_COMPILE},"\n"
+ if $ENV{CROSS_COMPILE};
+ print " CC = ",$ENV{CC},"\n" if $ENV{CC};
+ print " BUILDFILE = ",$ENV{BUILDFILE},"\n" if $ENV{BUILDFILE};
+ print " $local_config_envname = ",$ENV{$local_config_envname},"\n"
+ if $ENV{$local_config_envname};
+ } else {
+ die "Insufficient data to reconfigure, please do a normal configuration\n";
+ }
+}
+
+$config{perlargv} = [ @argvcopy ];
+
+# Collect version numbers
+$config{version} = "unknown";
+$config{version_num} = "unknown";
+$config{shlib_version_number} = "unknown";
+$config{shlib_version_history} = "unknown";
+
+collect_information(
+ collect_from_file(catfile($srcdir,'include/openssl/opensslv.h')),
+ qr/OPENSSL.VERSION.TEXT.*OpenSSL (\S+) / => sub { $config{version} = $1; },
+ qr/OPENSSL.VERSION.NUMBER.*(0x\S+)/ => sub { $config{version_num}=$1 },
+ qr/SHLIB_VERSION_NUMBER *"([^"]+)"/ => sub { $config{shlib_version_number}=$1 },
+ qr/SHLIB_VERSION_HISTORY *"([^"]*)"/ => sub { $config{shlib_version_history}=$1 }
+ );
+if ($config{shlib_version_history} ne "") { $config{shlib_version_history} .= ":"; }
+
+($config{major}, $config{minor})
+ = ($config{version} =~ /^([0-9]+)\.([0-9\.]+)/);
+($config{shlib_major}, $config{shlib_minor})
+ = ($config{shlib_version_number} =~ /^([0-9]+)\.([0-9\.]+)/);
+die "erroneous version information in opensslv.h: ",
+ "$config{major}, $config{minor}, $config{shlib_major}, $config{shlib_minor}\n"
+ if ($config{major} eq "" || $config{minor} eq ""
+ || $config{shlib_major} eq "" || $config{shlib_minor} eq "");
+
+# Collect target configurations
+
+my $pattern = catfile(dirname($0), "Configurations", "*.conf");
+foreach (sort glob($pattern)) {
+ &read_config($_);
+}
+
+if (defined $ENV{$local_config_envname}) {
+ if ($^O eq 'VMS') {
+ # VMS environment variables are logical names,
+ # which can be used as is
+ $pattern = $local_config_envname . ':' . '*.conf';
+ } else {
+ $pattern = catfile($ENV{$local_config_envname}, '*.conf');
+ }
+
+ foreach (sort glob($pattern)) {
+ &read_config($_);
+ }
+}
+
+
+print "Configuring OpenSSL version $config{version} ($config{version_num})\n";
+
+$config{prefix}="";
+$config{openssldir}="";
+$config{processor}="";
+$config{libdir}="";
+$config{cross_compile_prefix}="";
+$config{fipslibdir}="/usr/local/ssl/fips-2.0/lib/";
+my $nofipscanistercheck=0;
+$config{baseaddr}="0xFB00000";
+my $auto_threads=1; # enable threads automatically? true by default
+my $default_ranlib;
+$config{fips}=0;
+
+# Top level directories to build
+$config{dirs} = [ "crypto", "ssl", "engines", "apps", "test", "util", "tools", "fuzz" ];
+# crypto/ subdirectories to build
+$config{sdirs} = [
+ "objects",
+ "md2", "md4", "md5", "sha", "mdc2", "hmac", "ripemd", "whrlpool", "poly1305", "blake2",
+ "des", "aes", "rc2", "rc4", "rc5", "idea", "bf", "cast", "camellia", "seed", "chacha", "modes",
+ "bn", "ec", "rsa", "dsa", "dh", "dso", "engine",
+ "buffer", "bio", "stack", "lhash", "rand", "err",
+ "evp", "asn1", "pem", "x509", "x509v3", "conf", "txt_db", "pkcs7", "pkcs12", "comp", "ocsp", "ui",
+ "cms", "ts", "srp", "cmac", "ct", "async", "kdf"
+ ];
+
+# Known TLS and DTLS protocols
+my @tls = qw(ssl3 tls1 tls1_1 tls1_2);
+my @dtls = qw(dtls1 dtls1_2);
+
+# Explicitly known options that are possible to disable. They can
+# be regexps, and will be used like this: /^no-${option}$/
+# For developers: keep it sorted alphabetically
+
+my @disablables = (
+ "afalgeng",
+ "asan",
+ "asm",
+ "async",
+ "autoalginit",
+ "autoerrinit",
+ "bf",
+ "blake2",
+ "camellia",
+ "capieng",
+ "cast",
+ "chacha",
+ "cmac",
+ "cms",
+ "comp",
+ "crypto-mdebug",
+ "crypto-mdebug-backtrace",
+ "ct",
+ "deprecated",
+ "des",
+ "dgram",
+ "dh",
+ "dsa",
+ "dso",
+ "dtls",
+ "dynamic-engine",
+ "ec",
+ "ec2m",
+ "ecdh",
+ "ecdsa",
+ "ec_nistp_64_gcc_128",
+ "egd",
+ "engine",
+ "err",
+ "filenames",
+ "fuzz-libfuzzer",
+ "fuzz-afl",
+ "gost",
+ "heartbeats",
+ "hw(-.+)?",
+ "idea",
+ "makedepend",
+ "md2",
+ "md4",
+ "mdc2",
+ "msan",
+ "multiblock",
+ "nextprotoneg",
+ "ocb",
+ "ocsp",
+ "pic",
+ "poly1305",
+ "posix-io",
+ "psk",
+ "rc2",
+ "rc4",
+ "rc5",
+ "rdrand",
+ "rfc3779",
+ "rmd160",
+ "scrypt",
+ "sctp",
+ "seed",
+ "shared",
+ "sock",
+ "srp",
+ "srtp",
+ "sse2",
+ "ssl",
+ "ssl-trace",
+ "static-engine",
+ "stdio",
+ "threads",
+ "tls",
+ "ts",
+ "ubsan",
+ "ui",
+ "unit-test",
+ "whirlpool",
+ "weak-ssl-ciphers",
+ "zlib",
+ "zlib-dynamic",
+ );
+foreach my $proto ((@tls, @dtls))
+ {
+ push(@disablables, $proto);
+ push(@disablables, "$proto-method");
+ }
+
+my %deprecated_disablables = (
+ "ssl2" => undef,
+ "buf-freelists" => undef,
+ "ripemd" => "rmd160"
+ );
+
+# All of the following is disabled by default (RC5 was enabled before 0.9.8):
+
+our %disabled = ( # "what" => "comment"
+ "asan" => "default",
+ "crypto-mdebug" => "default",
+ "crypto-mdebug-backtrace" => "default",
+ "ec_nistp_64_gcc_128" => "default",
+ "egd" => "default",
+ "fuzz-libfuzzer" => "default",
+ "fuzz-afl" => "default",
+ "heartbeats" => "default",
+ "md2" => "default",
+ "msan" => "default",
+ "rc5" => "default",
+ "sctp" => "default",
+ "ssl-trace" => "default",
+ "ssl3" => "default",
+ "ssl3-method" => "default",
+ "ubsan" => "default",
+ "unit-test" => "default",
+ "weak-ssl-ciphers" => "default",
+ "zlib" => "default",
+ "zlib-dynamic" => "default",
+ );
+
+# Note: => pair form used for aesthetics, not to truly make a hash table
+my @disable_cascades = (
+ # "what" => [ "cascade", ... ]
+ sub { $config{processor} eq "386" }
+ => [ "sse2" ],
+ "ssl" => [ "ssl3" ],
+ "ssl3-method" => [ "ssl3" ],
+ "zlib" => [ "zlib-dynamic" ],
+ "des" => [ "mdc2" ],
+ "ec" => [ "ecdsa", "ecdh" ],
+
+ "dgram" => [ "dtls", "sctp" ],
+ "sock" => [ "dgram" ],
+ "dtls" => [ @dtls ],
+ sub { 0 == scalar grep { !$disabled{$_} } @dtls }
+ => [ "dtls" ],
+
+ "tls" => [ @tls ],
+ sub { 0 == scalar grep { !$disabled{$_} } @tls }
+ => [ "tls" ],
+
+ "crypto-mdebug" => [ "crypto-mdebug-backtrace" ],
+
+ # Without DSO, we can't load dynamic engines, so don't build them dynamic
+ "dso" => [ "dynamic-engine" ],
+
+ # Without position independent code, there can be no shared libraries or DSOs
+ "pic" => [ "shared" ],
+ "shared" => [ "dynamic-engine" ],
+ "engine" => [ "afalgeng" ],
+
+ # no-autoalginit is only useful when building non-shared
+ "autoalginit" => [ "shared", "apps" ],
+
+ "stdio" => [ "apps", "capieng", "egd" ],
+ "apps" => [ "tests" ],
+ "comp" => [ "zlib" ],
+ sub { !$disabled{"unit-test"} } => [ "heartbeats" ],
+
+ sub { !$disabled{"msan"} } => [ "asm" ],
+ );
+
+# Avoid protocol support holes. Also disable all versions below N, if version
+# N is disabled while N+1 is enabled.
+#
+my @list = (reverse @tls);
+while ((my $first, my $second) = (shift @list, shift @list)) {
+ last unless @list;
+ push @disable_cascades, ( sub { !$disabled{$first} && $disabled{$second} }
+ => [ @list ] );
+ unshift @list, $second;
+}
+my @list = (reverse @dtls);
+while ((my $first, my $second) = (shift @list, shift @list)) {
+ last unless @list;
+ push @disable_cascades, ( sub { !$disabled{$first} && $disabled{$second} }
+ => [ @list ] );
+ unshift @list, $second;
+}
+
+# Explicit "no-..." options will be collected in %disabled along with the defaults.
+# To remove something from %disabled, use "enable-foo".
+# For symmetry, "disable-foo" is a synonym for "no-foo".
+
+&usage if ($#ARGV < 0);
+
+my $user_cflags="";
+my @user_defines=();
+$config{openssl_api_defines}=[];
+$config{openssl_algorithm_defines}=[];
+$config{openssl_thread_defines}=[];
+$config{openssl_sys_defines}=[];
+$config{openssl_other_defines}=[];
+my $libs="";
+my $target="";
+$config{options}="";
+$config{build_type} = "release";
+
+my %unsupported_options = ();
+my %deprecated_options = ();
+while (@argvcopy)
+ {
+ $_ = shift @argvcopy;
+ # VMS is a case insensitive environment, and depending on settings
+ # out of our control, we may receive options uppercased. Let's
+ # downcase at least the part before any equal sign.
+ if ($^O eq "VMS")
+ {
+ s/^([^=]*)/lc($1)/e;
+ }
+ s /^-no-/no-/; # some people just can't read the instructions
+
+ # rewrite some options in "enable-..." form
+ s /^-?-?shared$/enable-shared/;
+ s /^sctp$/enable-sctp/;
+ s /^threads$/enable-threads/;
+ s /^zlib$/enable-zlib/;
+ s /^zlib-dynamic$/enable-zlib-dynamic/;
+
+ if (/^(no|disable|enable)-(.+)$/)
+ {
+ my $word = $2;
+ if (!exists $deprecated_disablables{$word}
+ && !grep { $word =~ /^${_}$/ } @disablables)
+ {
+ $unsupported_options{$_} = 1;
+ next;
+ }
+ }
+ if (/^no-(.+)$/ || /^disable-(.+)$/)
+ {
+ foreach my $proto ((@tls, @dtls))
+ {
+ if ($1 eq "$proto-method")
+ {
+ $disabled{"$proto"} = "option($proto-method)";
+ last;
+ }
+ }
+ if ($1 eq "dtls")
+ {
+ foreach my $proto (@dtls)
+ {
+ $disabled{$proto} = "option(dtls)";
+ }
+ $disabled{"dtls"} = "option(dtls)";
+ }
+ elsif ($1 eq "ssl")
+ {
+ # Last one of its kind
+ $disabled{"ssl3"} = "option(ssl)";
+ }
+ elsif ($1 eq "tls")
+ {
+ # XXX: Tests will fail if all SSL/TLS
+ # protocols are disabled.
+ foreach my $proto (@tls)
+ {
+ $disabled{$proto} = "option(tls)";
+ }
+ }
+ elsif ($1 eq "static-engine")
+ {
+ delete $disabled{"dynamic-engine"};
+ }
+ elsif ($1 eq "dynamic-engine")
+ {
+ $disabled{"dynamic-engine"} = "option";
+ }
+ elsif (exists $deprecated_disablables{$1})
+ {
+ $deprecated_options{$_} = 1;
+ if (defined $deprecated_disablables{$1})
+ {
+ $disabled{$deprecated_disablables{$1}} = "option";
+ }
+ }
+ else
+ {
+ $disabled{$1} = "option";
+ }
+ # No longer an automatic choice
+ $auto_threads = 0 if ($1 eq "threads");
+ }
+ elsif (/^enable-(.+)$/)
+ {
+ if ($1 eq "static-engine")
+ {
+ $disabled{"dynamic-engine"} = "option";
+ }
+ elsif ($1 eq "dynamic-engine")
+ {
+ delete $disabled{"dynamic-engine"};
+ }
+ elsif ($1 eq "zlib-dynamic")
+ {
+ delete $disabled{"zlib"};
+ }
+ my $algo = $1;
+ delete $disabled{$algo};
+
+ # No longer an automatic choice
+ $auto_threads = 0 if ($1 eq "threads");
+ }
+ elsif (/^--strict-warnings$/)
+ {
+ $strict_warnings = 1;
+ }
+ elsif (/^--debug$/)
+ {
+ $config{build_type} = "debug";
+ }
+ elsif (/^--release$/)
+ {
+ $config{build_type} = "release";
+ }
+ elsif (/^386$/)
+ { $config{processor}=386; }
+ elsif (/^fips$/)
+ {
+ $config{fips}=1;
+ }
+ elsif (/^rsaref$/)
+ {
+ # No RSAref support any more since it's not needed.
+ # The check for the option is there so scripts aren't
+ # broken
+ }
+ elsif (/^nofipscanistercheck$/)
+ {
+ $config{fips} = 1;
+ $nofipscanistercheck = 1;
+ }
+ elsif (/^[-+]/)
+ {
+ if (/^--prefix=(.*)$/)
+ {
+ $config{prefix}=$1;
+ die "Directory given with --prefix MUST be absolute\n"
+ unless file_name_is_absolute($config{prefix});
+ }
+ elsif (/^--api=(.*)$/)
+ {
+ $config{api}=$1;
+ }
+ elsif (/^--libdir=(.*)$/)
+ {
+ $config{libdir}=$1;
+ }
+ elsif (/^--openssldir=(.*)$/)
+ {
+ $config{openssldir}=$1;
+ }
+ elsif (/^--with-zlib-lib=(.*)$/)
+ {
+ $withargs{zlib_lib}=$1;
+ }
+ elsif (/^--with-zlib-include=(.*)$/)
+ {
+ $withargs{zlib_include}=$1;
+ }
+ elsif (/^--with-fuzzer-lib=(.*)$/)
+ {
+ $withargs{fuzzer_lib}=$1;
+ }
+ elsif (/^--with-fuzzer-include=(.*)$/)
+ {
+ $withargs{fuzzer_include}=$1;
+ }
+ elsif (/^--with-fipslibdir=(.*)$/)
+ {
+ $config{fipslibdir}="$1/";
+ }
+ elsif (/^--with-baseaddr=(.*)$/)
+ {
+ $config{baseaddr}="$1";
+ }
+ elsif (/^--cross-compile-prefix=(.*)$/)
+ {
+ $config{cross_compile_prefix}=$1;
+ }
+ elsif (/^--config=(.*)$/)
+ {
+ read_config $1;
+ }
+ elsif (/^-[lL](.*)$/ or /^-Wl,/)
+ {
+ $libs.=$_." ";
+ }
+ elsif (/^-rpath$/ or /^-R$/)
+ # -rpath is the OSF1 rpath flag
+ # -R is the old Solaris rpath flag
+ {
+ my $rpath = shift(@argvcopy) || "";
+ $rpath .= " " if $rpath ne "";
+ $libs.=$_." ".$rpath;
+ }
+ elsif (/^-static$/)
+ {
+ $libs.=$_." ";
+ $disabled{"dso"} = "forced";
+ $disabled{"pic"} = "forced";
+ $disabled{"shared"} = "forced";
+ $disabled{"threads"} = "forced";
+ }
+ elsif (/^-D(.*)$/)
+ {
+ push @user_defines, $1;
+ }
+ else # common if (/^[-+]/), just pass down...
+ {
+ $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei;
+ $user_cflags.=" ".$_;
+ }
+ }
+ else
+ {
+ die "target already defined - $target (offending arg: $_)\n" if ($target ne "");
+ $target=$_;
+ }
+ unless ($_ eq $target || /^no-/ || /^disable-/)
+ {
+ # "no-..." follows later after implied disactivations
+ # have been derived. (Don't take this too seriously,
+ # we really only write OPTIONS to the Makefile out of
+ # nostalgia.)
+
+ if ($config{options} eq "")
+ { $config{options} = $_; }
+ else
+ { $config{options} .= " ".$_; }
+ }
+
+ if (defined($config{api}) && !exists $apitable->{$config{api}}) {
+ die "***** Unsupported api compatibility level: $config{api}\n",
+ }
+
+ if (keys %deprecated_options)
+ {
+ warn "***** Deprecated options: ",
+ join(", ", keys %deprecated_options), "\n";
+ }
+ if (keys %unsupported_options)
+ {
+ die "***** Unsupported options: ",
+ join(", ", keys %unsupported_options), "\n";
+ }
+ }
+
+if ($libs =~ /(^|\s)-Wl,-rpath,/
+ && !$disabled{shared}
+ && !($disabled{asan} && $disabled{msan} && $disabled{ubsan})) {
+ die "***** Cannot simultaneously use -rpath, shared libraries, and\n",
+ "***** any of asan, msan or ubsan\n";
+}
+
+if ($config{fips})
+ {
+ delete $disabled{"shared"} if ($disabled{"shared"} =~ /^default/);
+ }
+else
+ {
+ @{$config{dirs}} = grep !/^fips$/, @{$config{dirs}};
+ }
+
+my @tocheckfor = (keys %disabled);
+while (@tocheckfor) {
+ my %new_tocheckfor = ();
+ my @cascade_copy = (@disable_cascades);
+ while (@cascade_copy) {
+ my ($test, $descendents) = (shift @cascade_copy, shift @cascade_copy);
+ if (ref($test) eq "CODE" ? $test->() : defined($disabled{$test})) {
+ foreach(grep { !defined($disabled{$_}) } @$descendents) {
+ $new_tocheckfor{$_} = 1; $disabled{$_} = "forced";
+ }
+ }
+ }
+ @tocheckfor = (keys %new_tocheckfor);
+}
+
+our $die = sub { die @_; };
+if ($target eq "TABLE") {
+ local $die = sub { warn @_; };
+ foreach (sort keys %table) {
+ print_table_entry($_, "TABLE");
+ }
+ exit 0;
+}
+
+if ($target eq "LIST") {
+ foreach (sort keys %table) {
+ print $_,"\n" unless $table{$_}->{template};
+ }
+ exit 0;
+}
+
+if ($target eq "HASH") {
+ local $die = sub { warn @_; };
+ print "%table = (\n";
+ foreach (sort keys %table) {
+ print_table_entry($_, "HASH");
+ }
+ exit 0;
+}
+
+# Backward compatibility?
+if ($target =~ m/^CygWin32(-.*)$/) {
+ $target = "Cygwin".$1;
+}
+
+foreach (sort (keys %disabled))
+ {
+ $config{options} .= " no-$_";
+
+ printf " no-%-12s %-10s", $_, "[$disabled{$_}]";
+
+ if (/^dso$/)
+ { }
+ elsif (/^threads$/)
+ { }
+ elsif (/^shared$/)
+ { }
+ elsif (/^pic$/)
+ { }
+ elsif (/^zlib$/)
+ { }
+ elsif (/^dynamic-engine$/)
+ { }
+ elsif (/^makedepend$/)
+ { }
+ elsif (/^zlib-dynamic$/)
+ { }
+ elsif (/^sse2$/)
+ { }
+ elsif (/^engine$/)
+ {
+ @{$config{dirs}} = grep !/^engines$/, @{$config{dirs}};
+ @{$config{sdirs}} = grep !/^engine$/, @{$config{sdirs}};
+ push @{$config{openssl_other_defines}}, "OPENSSL_NO_ENGINE";
+ print " OPENSSL_NO_ENGINE (skip engines)";
+ }
+ else
+ {
+ my ($WHAT, $what);
+
+ ($WHAT = $what = $_) =~ tr/[\-a-z]/[_A-Z]/;
+
+ # Fix up C macro end names
+ $WHAT = "RMD160" if $what eq "ripemd";
+
+ # fix-up crypto/directory name(s)
+ $what = "ripemd" if $what eq "rmd160";
+ $what = "whrlpool" if $what eq "whirlpool";
+
+ if ($what ne "async" && $what ne "err"
+ && grep { $_ eq $what } @{$config{sdirs}})
+ {
+ push @{$config{openssl_algorithm_defines}}, "OPENSSL_NO_$WHAT";
+ @{$config{sdirs}} = grep { $_ ne $what} @{$config{sdirs}};
+
+ print " OPENSSL_NO_$WHAT (skip dir)";
+ }
+ else
+ {
+ push @{$config{openssl_other_defines}}, "OPENSSL_NO_$WHAT";
+ print " OPENSSL_NO_$WHAT";
+ }
+ }
+
+ print "\n";
+ }
+
+print "Configuring for $target\n";
+
+# Support for legacy targets having a name starting with 'debug-'
+my ($d, $t) = $target =~ m/^(debug-)?(.*)$/;
+if ($d) {
+ $config{build_type} = "debug";
+
+ # If we do not find debug-foo in the table, the target is set to foo.
+ if (!$table{$target}) {
+ $target = $t;
+ }
+}
+$config{target} = $target;
+my %target = resolve_config($target);
+
+&usage if (!%target || $target{template});
+
+my %conf_files = map { $_ => 1 } (@{$target{_conf_fname_int}});
+$config{conf_files} = [ sort keys %conf_files ];
+%target = ( %{$table{DEFAULTS}}, %target );
+
+$target{exe_extension}="";
+$target{exe_extension}=".exe" if ($config{target} eq "DJGPP"
+ || $config{target} =~ /^(?:Cygwin|mingw)/);
+$target{exe_extension}=".pm" if ($config{target} =~ /vos/);
+
+($target{shared_extension_simple}=$target{shared_extension})
+ =~ s|\.\$\(SHLIB_MAJOR\)\.\$\(SHLIB_MINOR\)||;
+$target{dso_extension}=$target{shared_extension_simple};
+($target{shared_import_extension}=$target{shared_extension_simple}.".a")
+ if ($config{target} =~ /^(?:Cygwin|mingw)/);
+
+
+$config{cross_compile_prefix} = $ENV{'CROSS_COMPILE'}
+ if $config{cross_compile_prefix} eq "";
+
+# Allow overriding the names of some tools. USE WITH CARE
+# Note: only Unix cares about HASHBANGPERL... that explains
+# the default string.
+$config{perl} = $ENV{'PERL'} || ($^O ne "VMS" ? $^X : "perl");
+$config{hashbangperl} =
+ $ENV{'HASHBANGPERL'} || $ENV{'PERL'} || "/usr/bin/env perl";
+$target{cc} = $ENV{'CC'} || $target{cc} || "cc";
+$target{ranlib} = $ENV{'RANLIB'} || $target{ranlib} ||
+ (which("$config{cross_compile_prefix}ranlib") ?
+ "\$(CROSS_COMPILE)ranlib" : "true");
+$target{ar} = $ENV{'AR'} || $target{ar} || "ar";
+$target{nm} = $ENV{'NM'} || $target{nm} || "nm";
+$target{rc} =
+ $ENV{'RC'} || $ENV{'WINDRES'} || $target{rc} || "windres";
+
+# Allow overriding the build file name
+$target{build_file} = $ENV{BUILDFILE} || $target{build_file} || "Makefile";
+
+# Cache information necessary for reconfiguration
+$config{cc} = $target{cc};
+$config{build_file} = $target{build_file};
+
+# For cflags, lflags, plib_lflags, ex_libs and defines, add the debug_
+# or release_ attributes.
+# Do it in such a way that no spurious space is appended (hence the grep).
+$config{defines} = [];
+$config{cflags} = "";
+$config{ex_libs} = "";
+$config{shared_ldflag} = "";
+
+# Make sure build_scheme is consistent.
+$target{build_scheme} = [ $target{build_scheme} ]
+ if ref($target{build_scheme}) ne "ARRAY";
+
+my ($builder, $builder_platform, @builder_opts) =
+ @{$target{build_scheme}};
+
+foreach my $checker (($builder_platform."-".$target{build_file}."-checker.pm",
+ $builder_platform."-checker.pm")) {
+ my $checker_path = catfile($srcdir, "Configurations", $checker);
+ if (-f $checker_path) {
+ my $fn = $ENV{CONFIGURE_CHECKER_WARN}
+ ? sub { warn $@; } : sub { die $@; };
+ if (! do $checker_path) {
+ if ($@) {
+ $fn->($@);
+ } elsif ($!) {
+ $fn->($!);
+ } else {
+ $fn->("The detected tools didn't match the platform\n");
+ }
+ }
+ last;
+ }
+}
+
+push @{$config{defines}}, "NDEBUG" if $config{build_type} eq "release";
+
+if ($target =~ /^mingw/ && `$target{cc} --target-help 2>&1` =~ m/-mno-cygwin/m)
+ {
+ $config{cflags} .= " -mno-cygwin";
+ $config{shared_ldflag} .= " -mno-cygwin";
+ }
+
+if ($target =~ /linux.*-mips/ && !$disabled{asm} && $user_cflags !~ /-m(ips|arch=)/) {
+ # minimally required architecture flags for assembly modules
+ $config{cflags}="-mips2 $config{cflags}" if ($target =~ /mips32/);
+ $config{cflags}="-mips3 $config{cflags}" if ($target =~ /mips64/);
+}
+
+my $no_shared_warn=0;
+my $no_user_cflags=0;
+my $no_user_defines=0;
+
+# The DSO code currently always implements all functions so that no
+# applications will have to worry about that from a compilation point
+# of view. However, the "method"s may return zero unless that platform
+# has support compiled in for them. Currently each method is enabled
+# by a define "DSO_<name>" ... we translate the "dso_scheme" config
+# string entry into using the following logic;
+if (!$disabled{dso} && $target{dso_scheme} ne "")
+ {
+ $target{dso_scheme} =~ tr/[a-z]/[A-Z]/;
+ if ($target{dso_scheme} eq "DLFCN")
+ {
+ unshift @{$config{defines}}, "DSO_DLFCN", "HAVE_DLFCN_H";
+ }
+ elsif ($target{dso_scheme} eq "DLFCN_NO_H")
+ {
+ unshift @{$config{defines}}, "DSO_DLFCN";
+ }
+ else
+ {
+ unshift @{$config{defines}}, "DSO_$target{dso_scheme}";
+ }
+ }
+
+$config{ex_libs}="$libs$config{ex_libs}" if ($libs ne "");
+
+if ($disabled{asm})
+ {
+ if ($config{fips})
+ {
+ @{$config{defines}} = grep !/^[BL]_ENDIAN$/, @{$config{defines}};
+ @{$target{defines}} = grep !/^[BL]_ENDIAN$/, @{$target{defines}};
+ }
+ }
+
+# If threads aren't disabled, check how possible they are
+unless ($disabled{threads}) {
+ if ($auto_threads) {
+ # Enabled by default, disable it forcibly if unavailable
+ if ($target{thread_scheme} eq "(unknown)") {
+ $disabled{threads} = "unavailable";
+ }
+ } else {
+ # The user chose to enable threads explicitly, let's see
+ # if there's a chance that's possible
+ if ($target{thread_scheme} eq "(unknown)") {
+ # If the user asked for "threads" and we don't have internal
+ # knowledge how to do it, [s]he is expected to provide any
+ # system-dependent compiler options that are necessary. We
+ # can't truly check that the given options are correct, but
+ # we expect the user to know what [s]He is doing.
+ if ($no_user_cflags && $no_user_defines) {
+ die "You asked for multi-threading support, but didn't\n"
+ ,"provide any system-specific compiler options\n";
+ }
+ }
+ }
+}
+
+# If threads still aren't disabled, add a C macro to ensure the source
+# code knows about it. Any other flag is taken care of by the configs.
+unless($disabled{threads}) {
+ foreach (("defines", "openssl_thread_defines")) {
+ push @{$config{$_}}, "OPENSSL_THREADS";
+ }
+}
+
+# With "deprecated" disable all deprecated features.
+if (defined($disabled{"deprecated"})) {
+ $config{api} = $maxapi;
+}
+
+if ($target{shared_target} eq "")
+ {
+ $no_shared_warn = 1
+ if ((!$disabled{shared} || !$disabled{"dynamic-engine"})
+ && !$config{fips});
+ $disabled{shared} = "no-shared-target";
+ $disabled{pic} = $disabled{shared} = $disabled{"dynamic-engine"} =
+ "no-shared-target";
+ }
+
+if ($disabled{"dynamic-engine"}) {
+ push @{$config{defines}}, "OPENSSL_NO_DYNAMIC_ENGINE";
+ $config{dynamic_engines} = 0;
+} else {
+ push @{$config{defines}}, "OPENSSL_NO_STATIC_ENGINE";
+ $config{dynamic_engines} = 1;
+}
+
+unless ($disabled{"fuzz-libfuzzer"}) {
+ $config{cflags} .= "-fsanitize-coverage=edge,indirect-calls ";
+}
+
+unless ($disabled{asan}) {
+ $config{cflags} .= "-fsanitize=address ";
+}
+
+unless ($disabled{ubsan}) {
+ # -DPEDANTIC or -fnosanitize=alignment may also be required on some
+ # platforms.
+ $config{cflags} .= "-fsanitize=undefined -fno-sanitize-recover=all ";
+}
+
+unless ($disabled{msan}) {
+ $config{cflags} .= "-fsanitize=memory ";
+}
+
+unless ($disabled{"fuzz-libfuzzer"} && $disabled{"fuzz-afl"}
+ && $disabled{asan} && $disabled{ubsan} && $disabled{msan}) {
+ $config{cflags} .= "-fno-omit-frame-pointer -g ";
+}
+#
+# Platform fix-ups
+#
+
+# This saves the build files from having to check
+if ($disabled{pic})
+ {
+ $target{shared_cflag} = $target{shared_ldflag} =
+ $target{shared_rcflag} = "";
+ }
+else
+ {
+ push @{$config{defines}}, "OPENSSL_PIC";
+ }
+
+if ($target{sys_id} ne "")
+ {
+ push @{$config{openssl_sys_defines}}, "OPENSSL_SYS_$target{sys_id}";
+ }
+
+unless ($disabled{asm}) {
+ $target{cpuid_asm_src}=$table{DEFAULTS}->{cpuid_asm_src} if ($config{processor} eq "386");
+ $target{bn_asm_src} =~ s/\w+-gf2m.c// if (defined($disabled{ec2m}));
+
+ # bn-586 is the only one implementing bn_*_part_words
+ push @{$config{defines}}, "OPENSSL_BN_ASM_PART_WORDS" if ($target{bn_asm_src} =~ /bn-586/);
+ push @{$config{defines}}, "OPENSSL_IA32_SSE2" if (!$disabled{sse2} && $target{bn_asm_src} =~ /86/);
+
+ push @{$config{defines}}, "OPENSSL_BN_ASM_MONT" if ($target{bn_asm_src} =~ /-mont/);
+ push @{$config{defines}}, "OPENSSL_BN_ASM_MONT5" if ($target{bn_asm_src} =~ /-mont5/);
+ push @{$config{defines}}, "OPENSSL_BN_ASM_GF2m" if ($target{bn_asm_src} =~ /-gf2m/);
+
+ if ($config{fips}) {
+ push @{$config{openssl_other_defines}}, "OPENSSL_FIPS";
+ }
+
+ if ($target{sha1_asm_src}) {
+ push @{$config{defines}}, "SHA1_ASM" if ($target{sha1_asm_src} =~ /sx86/ || $target{sha1_asm_src} =~ /sha1/);
+ push @{$config{defines}}, "SHA256_ASM" if ($target{sha1_asm_src} =~ /sha256/);
+ push @{$config{defines}}, "SHA512_ASM" if ($target{sha1_asm_src} =~ /sha512/);
+ }
+ if ($target{rc4_asm_src} ne $table{DEFAULTS}->{rc4_asm_src}) {
+ push @{$config{defines}}, "RC4_ASM";
+ }
+ if ($target{md5_asm_src}) {
+ push @{$config{defines}}, "MD5_ASM";
+ }
+ $target{cast_asm_src}=$table{DEFAULTS}->{cast_asm_src} unless $disabled{pic}; # CAST assembler is not PIC
+ if ($target{rmd160_asm_src}) {
+ push @{$config{defines}}, "RMD160_ASM";
+ }
+ if ($target{aes_asm_src}) {
+ push @{$config{defines}}, "AES_ASM" if ($target{aes_asm_src} =~ m/\baes-/);;
+ # aes-ctr.fake is not a real file, only indication that assembler
+ # module implements AES_ctr32_encrypt...
+ push @{$config{defines}}, "AES_CTR_ASM" if ($target{aes_asm_src} =~ s/\s*aes-ctr\.fake//);
+ # aes-xts.fake indicates presence of AES_xts_[en|de]crypt...
+ push @{$config{defines}}, "AES_XTS_ASM" if ($target{aes_asm_src} =~ s/\s*aes-xts\.fake//);
+ $target{aes_asm_src} =~ s/\s*(vpaes|aesni)-x86\.s//g if ($disabled{sse2});
+ push @{$config{defines}}, "VPAES_ASM" if ($target{aes_asm_src} =~ m/vpaes/);
+ push @{$config{defines}}, "BSAES_ASM" if ($target{aes_asm_src} =~ m/bsaes/);
+ }
+ if ($target{wp_asm_src} =~ /mmx/) {
+ if ($config{processor} eq "386") {
+ $target{wp_asm_src}=$table{DEFAULTS}->{wp_asm_src};
+ } elsif (!$disabled{"whirlpool"}) {
+ push @{$config{defines}}, "WHIRLPOOL_ASM";
+ }
+ }
+ if ($target{modes_asm_src} =~ /ghash-/) {
+ push @{$config{defines}}, "GHASH_ASM";
+ }
+ if ($target{ec_asm_src} =~ /ecp_nistz256/) {
+ push @{$config{defines}}, "ECP_NISTZ256_ASM";
+ }
+ if ($target{padlock_asm_src} ne $table{DEFAULTS}->{padlock_asm_src}) {
+ push @{$config{defines}}, "PADLOCK_ASM";
+ }
+ if ($target{poly1305_asm_src} ne "") {
+ push @{$config{defines}}, "POLY1305_ASM";
+ }
+}
+
+my %predefined;
+
+if ($^O ne "VMS") {
+ my $cc = "$config{cross_compile_prefix}$target{cc}";
+
+ # collect compiler pre-defines from gcc or gcc-alike...
+ open(PIPE, "$cc -dM -E -x c /dev/null 2>&1 |");
+ while (<PIPE>) {
+ m/^#define\s+(\w+(?:\(\w+\))?)(?:\s+(.+))?/ or last;
+ $predefined{$1} = $2 // "";
+ }
+ close(PIPE);
+
+ if (!$disabled{makedepend}) {
+ # We know that GNU C version 3 and up as well as all clang
+ # versions support dependency generation
+ if ($predefined{__GNUC__} >= 3) {
+ $config{makedepprog} = $cc;
+ } else {
+ $config{makedepprog} = which('makedepend');
+ $disabled{makedepend} = "unavailable" unless $config{makedepprog};
+ }
+ }
+}
+
+
+
+# Deal with bn_ops ###################################################
+
+$config{bn_ll} =0;
+$config{export_var_as_fn} =0;
+my $def_int="unsigned int";
+$config{rc4_int} =$def_int;
+($config{b64l},$config{b64},$config{b32})=(0,0,1);
+
+my $count = 0;
+foreach (sort split(/\s+/,$target{bn_ops})) {
+ $count++ if /SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT/;
+ $config{export_var_as_fn}=1 if $_ eq 'EXPORT_VAR_AS_FN';
+ $config{bn_ll}=1 if $_ eq 'BN_LLONG';
+ $config{rc4_int}="unsigned char" if $_ eq 'RC4_CHAR';
+ ($config{b64l},$config{b64},$config{b32})
+ =(0,1,0) if $_ eq 'SIXTY_FOUR_BIT';
+ ($config{b64l},$config{b64},$config{b32})
+ =(1,0,0) if $_ eq 'SIXTY_FOUR_BIT_LONG';
+ ($config{b64l},$config{b64},$config{b32})
+ =(0,0,1) if $_ eq 'THIRTY_TWO_BIT';
+}
+die "Exactly one of SIXTY_FOUR_BIT|SIXTY_FOUR_BIT_LONG|THIRTY_TWO_BIT can be set in bn_ops\n"
+ if $count > 1;
+
+
+# Hack cflags for better warnings (dev option) #######################
+
+# "Stringify" the C flags string. This permits it to be made part of a string
+# and works as well on command lines.
+$config{cflags} =~ s/([\\\"])/\\$1/g;
+
+if (defined($config{api})) {
+ $config{openssl_api_defines} = [ "OPENSSL_MIN_API=".$apitable->{$config{api}} ];
+ my $apiflag = sprintf("OPENSSL_API_COMPAT=%s", $apitable->{$config{api}});
+ push @{$config{defines}}, $apiflag;
+}
+
+if ($strict_warnings)
+ {
+ my $wopt;
+ die "ERROR --strict-warnings requires gcc or gcc-alike"
+ unless defined($predefined{__GNUC__});
+ foreach $wopt (split /\s+/, $gcc_devteam_warn)
+ {
+ $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(?:^|\s)$wopt(?:\s|$)/)
+ }
+ if (defined($predefined{__clang__}))
+ {
+ foreach $wopt (split /\s+/, $clang_devteam_warn)
+ {
+ $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(?:^|\s)$wopt(?:\s|$)/)
+ }
+ }
+ }
+
+unless ($disabled{"crypto-mdebug-backtrace"})
+ {
+ foreach my $wopt (split /\s+/, $memleak_devteam_backtrace)
+ {
+ $config{cflags} .= " $wopt" unless ($config{cflags} =~ /(?:^|\s)$wopt(?:\s|$)/)
+ }
+ if ($target =~ /^BSD-/)
+ {
+ $config{ex_libs} .= " -lexecinfo";
+ }
+ }
+
+if ($user_cflags ne "") { $config{cflags}="$config{cflags}$user_cflags"; }
+else { $no_user_cflags=1; }
+if (@user_defines) { $config{defines}=[ @{$config{defines}}, @user_defines ]; }
+else { $no_user_defines=1; }
+
+# ALL MODIFICATIONS TO %config and %target MUST BE DONE FROM HERE ON
+
+unless ($disabled{afalgeng}) {
+ $config{afalgeng}="";
+ if ($target =~ m/^linux/) {
+ my $minver = 4*10000 + 1*100 + 0;
+ if ($config{cross_compile_prefix} eq "") {
+ my $verstr = `uname -r`;
+ my ($ma, $mi1, $mi2) = split("\\.", $verstr);
+ ($mi2) = $mi2 =~ /(\d+)/;
+ my $ver = $ma*10000 + $mi1*100 + $mi2;
+ if ($ver < $minver) {
+ $disabled{afalgeng} = "too-old-kernel";
+ } else {
+ push @{$config{engdirs}}, "afalg";
+ }
+ } else {
+ $disabled{afalgeng} = "cross-compiling";
+ }
+ } else {
+ $disabled{afalgeng} = "not-linux";
+ }
+}
+
+push @{$config{openssl_other_defines}}, "OPENSSL_NO_AFALGENG" if ($disabled{afalgeng});
+
+# If we use the unified build, collect information from build.info files
+my %unified_info = ();
+
+my $buildinfo_debug = defined($ENV{CONFIGURE_DEBUG_BUILDINFO});
+if ($builder eq "unified") {
+ use with_fallback qw(Text::Template);
+
+ sub cleandir {
+ my $base = shift;
+ my $dir = shift;
+ my $relativeto = shift || ".";
+
+ $dir = catdir($base,$dir) unless isabsolute($dir);
+
+ # Make sure the directories we're building in exists
+ mkpath($dir);
+
+ my $res = abs2rel(absolutedir($dir), rel2abs($relativeto));
+ #print STDERR "DEBUG[cleandir]: $dir , $base => $res\n";
+ return $res;
+ }
+
+ sub cleanfile {
+ my $base = shift;
+ my $file = shift;
+ my $relativeto = shift || ".";
+
+ $file = catfile($base,$file) unless isabsolute($file);
+
+ my $d = dirname($file);
+ my $f = basename($file);
+
+ # Make sure the directories we're building in exists
+ mkpath($d);
+
+ my $res = abs2rel(catfile(absolutedir($d), $f), rel2abs($relativeto));
+ #print STDERR "DEBUG[cleanfile]: $d , $f => $res\n";
+ return $res;
+ }
+
+ # Store the name of the template file we will build the build file from
+ # in %config. This may be useful for the build file itself.
+ my @build_file_template_names =
+ ( $builder_platform."-".$target{build_file}.".tmpl",
+ $target{build_file}.".tmpl" );
+ my @build_file_templates = ();
+
+ # First, look in the user provided directory, if given
+ if (defined $ENV{$local_config_envname}) {
+ @build_file_templates =
+ map {
+ if ($^O eq 'VMS') {
+ # VMS environment variables are logical names,
+ # which can be used as is
+ $local_config_envname . ':' . $_;
+ } else {
+ catfile($ENV{$local_config_envname}, $_);
+ }
+ }
+ @build_file_template_names;
+ }
+ # Then, look in our standard directory
+ push @build_file_templates,
+ ( map { cleanfile($srcdir, catfile("Configurations", $_), $blddir) }
+ @build_file_template_names );
+
+ my $build_file_template;
+ for $_ (@build_file_templates) {
+ $build_file_template = $_;
+ last if -f $build_file_template;
+
+ $build_file_template = undef;
+ }
+ if (!defined $build_file_template) {
+ die "*** Couldn't find any of:\n", join("\n", @build_file_templates), "\n";
+ }
+ $config{build_file_templates}
+ = [ $build_file_template,
+ cleanfile($srcdir, catfile("Configurations", "common.tmpl"),
+ $blddir) ];
+
+ my @build_infos = ( [ ".", "build.info" ] );
+ foreach (@{$config{dirs}}) {
+ push @build_infos, [ $_, "build.info" ]
+ if (-f catfile($srcdir, $_, "build.info"));
+ }
+ foreach (@{$config{sdirs}}) {
+ push @build_infos, [ catdir("crypto", $_), "build.info" ]
+ if (-f catfile($srcdir, "crypto", $_, "build.info"));
+ }
+ foreach (@{$config{engdirs}}) {
+ push @build_infos, [ catdir("engines", $_), "build.info" ]
+ if (-f catfile($srcdir, "engines", $_, "build.info"));
+ }
+
+ $config{build_infos} = [ ];
+
+ foreach (@build_infos) {
+ my $sourced = catdir($srcdir, $_->[0]);
+ my $buildd = catdir($blddir, $_->[0]);
+
+ mkpath($buildd);
+
+ my $f = $_->[1];
+ # The basic things we're trying to build
+ my @programs = ();
+ my @programs_install = ();
+ my @libraries = ();
+ my @libraries_install = ();
+ my @engines = ();
+ my @engines_install = ();
+ my @scripts = ();
+ my @scripts_install = ();
+ my @extra = ();
+ my @overrides = ();
+ my @intermediates = ();
+ my @rawlines = ();
+
+ my %ordinals = ();
+ my %sources = ();
+ my %shared_sources = ();
+ my %includes = ();
+ my %depends = ();
+ my %renames = ();
+ my %sharednames = ();
+ my %generate = ();
+
+ # We want to detect configdata.pm in the source tree, so we
+ # don't use it if the build tree is different.
+ my $src_configdata = cleanfile($srcdir, "configdata.pm", $blddir);
+
+ push @{$config{build_infos}}, catfile(abs2rel($sourced, $blddir), $f);
+ my $template =
+ Text::Template->new(TYPE => 'FILE',
+ SOURCE => catfile($sourced, $f),
+ PREPEND => qq{use lib "$FindBin::Bin/util/perl";});
+ die "Something went wrong with $sourced/$f: $!\n" unless $template;
+ my @text =
+ split /^/m,
+ $template->fill_in(HASH => { config => \%config,
+ target => \%target,
+ disabled => \%disabled,
+ withargs => \%withargs,
+ builddir => abs2rel($buildd, $blddir),
+ sourcedir => abs2rel($sourced, $blddir),
+ buildtop => abs2rel($blddir, $blddir),
+ sourcetop => abs2rel($srcdir, $blddir) },
+ DELIMITERS => [ "{-", "-}" ]);
+
+ # The top item of this stack has the following values
+ # -2 positive already run and we found ELSE (following ELSIF should fail)
+ # -1 positive already run (skip until ENDIF)
+ # 0 negatives so far (if we're at a condition, check it)
+ # 1 last was positive (don't skip lines until next ELSE, ELSIF or ENDIF)
+ # 2 positive ELSE (following ELSIF should fail)
+ my @skip = ();
+ collect_information(
+ collect_from_array([ @text ],
+ qr/\\$/ => sub { my $l1 = shift; my $l2 = shift;
+ $l1 =~ s/\\$//; $l1.$l2 }),
+ # Info we're looking for
+ qr/^\s*IF\[((?:\\.|[^\\\]])*)\]\s*$/
+ => sub {
+ if (! @skip || $skip[$#skip] > 0) {
+ push @skip, !! $1;
+ } else {
+ push @skip, -1;
+ }
+ },
+ qr/^\s*ELSIF\[((?:\\.|[^\\\]])*)\]\s*$/
+ => sub { die "ELSIF out of scope" if ! @skip;
+ die "ELSIF following ELSE" if abs($skip[$#skip]) == 2;
+ $skip[$#skip] = -1 if $skip[$#skip] != 0;
+ $skip[$#skip] = !! $1
+ if $skip[$#skip] == 0; },
+ qr/^\s*ELSE\s*$/
+ => sub { die "ELSE out of scope" if ! @skip;
+ $skip[$#skip] = -2 if $skip[$#skip] != 0;
+ $skip[$#skip] = 2 if $skip[$#skip] == 0; },
+ qr/^\s*ENDIF\s*$/
+ => sub { die "ENDIF out of scope" if ! @skip;
+ pop @skip; },
+ qr/^\s*PROGRAMS(_NO_INST)?\s*=\s*(.*)\s*$/
+ => sub {
+ if (!@skip || $skip[$#skip] > 0) {
+ my $install = $1;
+ my @x = tokenize($2);
+ push @programs, @x;
+ push @programs_install, @x unless $install;
+ }
+ },
+ qr/^\s*LIBS(_NO_INST)?\s*=\s*(.*)\s*$/
+ => sub {
+ if (!@skip || $skip[$#skip] > 0) {
+ my $install = $1;
+ my @x = tokenize($2);
+ push @libraries, @x;
+ push @libraries_install, @x unless $install;
+ }
+ },
+ qr/^\s*ENGINES(_NO_INST)?\s*=\s*(.*)\s*$/
+ => sub {
+ if (!@skip || $skip[$#skip] > 0) {
+ my $install = $1;
+ my @x = tokenize($2);
+ push @engines, @x;
+ push @engines_install, @x unless $install;
+ }
+ },
+ qr/^\s*SCRIPTS(_NO_INST)?\s*=\s*(.*)\s*$/
+ => sub {
+ if (!@skip || $skip[$#skip] > 0) {
+ my $install = $1;
+ my @x = tokenize($2);
+ push @scripts, @x;
+ push @scripts_install, @x unless $install;
+ }
+ },
+ qr/^\s*EXTRA\s*=\s*(.*)\s*$/
+ => sub { push @extra, tokenize($1)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*OVERRIDES\s*=\s*(.*)\s*$/
+ => sub { push @overrides, tokenize($1)
+ if !@skip || $skip[$#skip] > 0 },
+
+ qr/^\s*ORDINALS\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/,
+ => sub { push @{$ordinals{$1}}, tokenize($2)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+ => sub { push @{$sources{$1}}, tokenize($2)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*SHARED_SOURCE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+ => sub { push @{$shared_sources{$1}}, tokenize($2)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*INCLUDE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+ => sub { push @{$includes{$1}}, tokenize($2)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*DEPEND\[((?:\\.|[^\\\]])*)\]\s*=\s*(.*)\s*$/
+ => sub { push @{$depends{$1}}, tokenize($2)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*GENERATE\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+ => sub { push @{$generate{$1}}, $2
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*RENAME\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+ => sub { push @{$renames{$1}}, tokenize($2)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*SHARED_NAME\[((?:\\.|[^\\\]])+)\]\s*=\s*(.*)\s*$/
+ => sub { push @{$sharednames{$1}}, tokenize($2)
+ if !@skip || $skip[$#skip] > 0 },
+ qr/^\s*BEGINRAW\[((?:\\.|[^\\\]])+)\]\s*$/
+ => sub {
+ my $lineiterator = shift;
+ my $target_kind = $1;
+ while (defined $lineiterator->()) {
+ s|\R$||;
+ if (/^\s*ENDRAW\[((?:\\.|[^\\\]])+)\]\s*$/) {
+ die "ENDRAW doesn't match BEGINRAW"
+ if $1 ne $target_kind;
+ last;
+ }
+ next if @skip && $skip[$#skip] <= 0;
+ push @rawlines, $_
+ if ($target_kind eq $target{build_file}
+ || $target_kind eq $target{build_file}."(".$builder_platform.")");
+ }
+ },
+ qr/^(?:#.*|\s*)$/ => sub { },
+ "OTHERWISE" => sub { die "Something wrong with this line:\n$_\nat $sourced/$f" },
+ "BEFORE" => sub {
+ if ($buildinfo_debug) {
+ print STDERR "DEBUG: Parsing ",join(" ", @_),"\n";
+ print STDERR "DEBUG: ... before parsing, skip stack is ",join(" ", map { int($_) } @skip),"\n";
+ }
+ },
+ "AFTER" => sub {
+ if ($buildinfo_debug) {
+ print STDERR "DEBUG: .... after parsing, skip stack is ",join(" ", map { int($_) } @skip),"\n";
+ }
+ },
+ );
+ die "runaway IF?" if (@skip);
+
+ foreach (keys %renames) {
+ die "$_ renamed to more than one thing: "
+ ,join(" ", @{$renames{$_}}),"\n"
+ if scalar @{$renames{$_}} > 1;
+ my $dest = cleanfile($buildd, $_, $blddir);
+ my $to = cleanfile($buildd, $renames{$_}->[0], $blddir);
+ die "$dest renamed to more than one thing: "
+ ,$unified_info{rename}->{$dest}, $to
+ unless !defined($unified_info{rename}->{$dest})
+ or $unified_info{rename}->{$dest} eq $to;
+ $unified_info{rename}->{$dest} = $to;
+ }
+
+ foreach (@programs) {
+ my $program = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$program}) {
+ $program = $unified_info{rename}->{$program};
+ }
+ $unified_info{programs}->{$program} = 1;
+ }
+
+ foreach (@programs_install) {
+ my $program = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$program}) {
+ $program = $unified_info{rename}->{$program};
+ }
+ $unified_info{install}->{programs}->{$program} = 1;
+ }
+
+ foreach (@libraries) {
+ my $library = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$library}) {
+ $library = $unified_info{rename}->{$library};
+ }
+ $unified_info{libraries}->{$library} = 1;
+ }
+
+ foreach (@libraries_install) {
+ my $library = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$library}) {
+ $library = $unified_info{rename}->{$library};
+ }
+ $unified_info{install}->{libraries}->{$library} = 1;
+ }
+
+ die <<"EOF" if scalar @engines and !$config{dynamic_engines};
+ENGINES can only be used if configured with 'dynamic-engine'.
+This is usually a fault in a build.info file.
+EOF
+ foreach (@engines) {
+ my $library = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$library}) {
+ $library = $unified_info{rename}->{$library};
+ }
+ $unified_info{engines}->{$library} = 1;
+ }
+
+ foreach (@engines_install) {
+ my $library = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$library}) {
+ $library = $unified_info{rename}->{$library};
+ }
+ $unified_info{install}->{engines}->{$library} = 1;
+ }
+
+ foreach (@scripts) {
+ my $script = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$script}) {
+ $script = $unified_info{rename}->{$script};
+ }
+ $unified_info{scripts}->{$script} = 1;
+ }
+
+ foreach (@scripts_install) {
+ my $script = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$script}) {
+ $script = $unified_info{rename}->{$script};
+ }
+ $unified_info{install}->{scripts}->{$script} = 1;
+ }
+
+ foreach (@extra) {
+ my $extra = cleanfile($buildd, $_, $blddir);
+ $unified_info{extra}->{$extra} = 1;
+ }
+
+ foreach (@overrides) {
+ my $override = cleanfile($buildd, $_, $blddir);
+ $unified_info{overrides}->{$override} = 1;
+ }
+
+ push @{$unified_info{rawlines}}, @rawlines;
+
+ unless ($disabled{shared}) {
+ # Check sharednames.
+ foreach (keys %sharednames) {
+ my $dest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$dest}) {
+ $dest = $unified_info{rename}->{$dest};
+ }
+ die "shared_name for $dest with multiple values: "
+ ,join(" ", @{$sharednames{$_}}),"\n"
+ if scalar @{$sharednames{$_}} > 1;
+ my $to = cleanfile($buildd, $sharednames{$_}->[0], $blddir);
+ die "shared_name found for a library $dest that isn't defined\n"
+ unless $unified_info{libraries}->{$dest};
+ die "shared_name for $dest with multiple values: "
+ ,$unified_info{sharednames}->{$dest}, ", ", $to
+ unless !defined($unified_info{sharednames}->{$dest})
+ or $unified_info{sharednames}->{$dest} eq $to;
+ $unified_info{sharednames}->{$dest} = $to;
+ }
+
+ # Additionally, we set up sharednames for libraries that don't
+ # have any, as themselves.
+ foreach (keys %{$unified_info{libraries}}) {
+ if (!defined $unified_info{sharednames}->{$_}) {
+ $unified_info{sharednames}->{$_} = $_
+ }
+ }
+ }
+
+ foreach (keys %ordinals) {
+ my $dest = $_;
+ my $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
+ foreach (@{$ordinals{$dest}}) {
+ my %known_ordinals =
+ (
+ crypto =>
+ cleanfile($sourced, catfile("util", "libcrypto.num"), $blddir),
+ ssl =>
+ cleanfile($sourced, catfile("util", "libssl.num"), $blddir)
+ );
+ my $o = $known_ordinals{$_};
+ die "Ordinals for $ddest defined more than once\n"
+ if $unified_info{ordinals}->{$ddest};
+ $unified_info{ordinals}->{$ddest} = [ $_, $o ];
+ }
+ }
+
+ foreach (keys %sources) {
+ my $dest = $_;
+ my $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
+ foreach (@{$sources{$dest}}) {
+ my $s = cleanfile($sourced, $_, $blddir);
+
+ # If it isn't in the source tree, we assume it's generated
+ # in the build tree
+ if ($s eq $src_configdata || ! -f $s || $generate{$_}) {
+ $s = cleanfile($buildd, $_, $blddir);
+ }
+ # We recognise C and asm files
+ if ($s =~ /\.[csS]\b$/) {
+ (my $o = $_) =~ s/\.[csS]\b$/.o/;
+ $o = cleanfile($buildd, $o, $blddir);
+ $unified_info{sources}->{$ddest}->{$o} = 1;
+ $unified_info{sources}->{$o}->{$s} = 1;
+ } else {
+ $unified_info{sources}->{$ddest}->{$s} = 1;
+ }
+ }
+ }
+
+ foreach (keys %shared_sources) {
+ my $dest = $_;
+ my $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
+ foreach (@{$shared_sources{$dest}}) {
+ my $s = cleanfile($sourced, $_, $blddir);
+
+ # If it isn't in the source tree, we assume it's generated
+ # in the build tree
+ if ($s eq $src_configdata || ! -f $s || $generate{$_}) {
+ $s = cleanfile($buildd, $_, $blddir);
+ }
+ # We recognise C and asm files
+ if ($s =~ /\.[csS]\b$/) {
+ (my $o = $_) =~ s/\.[csS]\b$/.o/;
+ $o = cleanfile($buildd, $o, $blddir);
+ $unified_info{shared_sources}->{$ddest}->{$o} = 1;
+ $unified_info{sources}->{$o}->{$s} = 1;
+ } else {
+ die "unrecognised source file type for shared library: $s\n";
+ }
+ }
+ }
+
+ foreach (keys %generate) {
+ my $dest = $_;
+ my $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
+ die "more than one generator for $dest: "
+ ,join(" ", @{$generate{$_}}),"\n"
+ if scalar @{$generate{$_}} > 1;
+ my @generator = split /\s+/, $generate{$dest}->[0];
+ $generator[0] = cleanfile($sourced, $generator[0], $blddir),
+ $unified_info{generate}->{$ddest} = [ @generator ];
+ }
+
+ foreach (keys %depends) {
+ my $dest = $_;
+ my $ddest = $dest eq "" ? "" : cleanfile($sourced, $_, $blddir);
+
+ # If the destination doesn't exist in source, it can only be
+ # a generated file in the build tree.
+ if ($ddest ne "" && ($ddest eq $src_configdata || ! -f $ddest)) {
+ $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
+ }
+ foreach (@{$depends{$dest}}) {
+ my $d = cleanfile($sourced, $_, $blddir);
+
+ # If we know it's generated, or assume it is because we can't
+ # find it in the source tree, we set file we depend on to be
+ # in the build tree rather than the source tree, and assume
+ # and that there are lines to build it in a BEGINRAW..ENDRAW
+ # section or in the Makefile template.
+ if ($d eq $src_configdata
+ || ! -f $d
+ || (grep { $d eq $_ }
+ map { cleanfile($srcdir, $_, $blddir) }
+ grep { /\.h$/ } keys %{$unified_info{generate}})) {
+ $d = cleanfile($buildd, $_, $blddir);
+ }
+ # Take note if the file to depend on is being renamed
+ if ($unified_info{rename}->{$d}) {
+ $d = $unified_info{rename}->{$d};
+ }
+ $unified_info{depends}->{$ddest}->{$d} = 1;
+ }
+ }
+
+ foreach (keys %includes) {
+ my $dest = $_;
+ my $ddest = cleanfile($sourced, $_, $blddir);
+
+ # If the destination doesn't exist in source, it can only be
+ # a generated file in the build tree.
+ if ($ddest eq $src_configdata || ! -f $ddest) {
+ $ddest = cleanfile($buildd, $_, $blddir);
+ if ($unified_info{rename}->{$ddest}) {
+ $ddest = $unified_info{rename}->{$ddest};
+ }
+ }
+ foreach (@{$includes{$dest}}) {
+ my $is = cleandir($sourced, $_, $blddir);
+ my $ib = cleandir($buildd, $_, $blddir);
+ push @{$unified_info{includes}->{$ddest}->{source}}, $is
+ unless grep { $_ eq $is } @{$unified_info{includes}->{$ddest}->{source}};
+ push @{$unified_info{includes}->{$ddest}->{build}}, $ib
+ unless grep { $_ eq $ib } @{$unified_info{includes}->{$ddest}->{build}};
+ }
+ }
+ }
+
+ # Massage the result
+
+ # If we depend on a header file or a perl module, add an inclusion of
+ # its directory to allow smoothe inclusion
+ foreach my $dest (keys %{$unified_info{depends}}) {
+ next if $dest eq "";
+ foreach my $d (keys %{$unified_info{depends}->{$dest}}) {
+ next unless $d =~ /\.(h|pm)$/;
+ my $i = dirname($d);
+ my $spot =
+ $d eq "configdata.pm" || defined($unified_info{generate}->{$d})
+ ? 'build' : 'source';
+ push @{$unified_info{includes}->{$dest}->{$spot}}, $i
+ unless grep { $_ eq $i } @{$unified_info{includes}->{$dest}->{$spot}};
+ }
+ }
+
+ # Trickle down includes placed on libraries, engines and programs to
+ # their sources (i.e. object files)
+ foreach my $dest (keys %{$unified_info{engines}},
+ keys %{$unified_info{libraries}},
+ keys %{$unified_info{programs}}) {
+ foreach my $k (("source", "build")) {
+ next unless defined($unified_info{includes}->{$dest}->{$k});
+ my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}};
+ foreach my $obj (grep /\.o$/,
+ (keys %{$unified_info{sources}->{$dest}},
+ keys %{$unified_info{shared_sources}->{$dest}})) {
+ foreach my $inc (@incs) {
+ unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc
+ unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}};
+ }
+ }
+ }
+ delete $unified_info{includes}->{$dest};
+ }
+
+ ### Make unified_info a bit more efficient
+ # One level structures
+ foreach (("programs", "libraries", "engines", "scripts", "extra", "overrides")) {
+ $unified_info{$_} = [ sort keys %{$unified_info{$_}} ];
+ }
+ # Two level structures
+ foreach my $l1 (("install", "sources", "shared_sources", "ldadd", "depends")) {
+ foreach my $l2 (sort keys %{$unified_info{$l1}}) {
+ $unified_info{$l1}->{$l2} =
+ [ sort keys %{$unified_info{$l1}->{$l2}} ];
+ }
+ }
+ # Includes
+ foreach my $dest (sort keys %{$unified_info{includes}}) {
+ if (defined($unified_info{includes}->{$dest}->{build})) {
+ my @source_includes = ();
+ @source_includes = ( @{$unified_info{includes}->{$dest}->{source}} )
+ if defined($unified_info{includes}->{$dest}->{source});
+ $unified_info{includes}->{$dest} =
+ [ @{$unified_info{includes}->{$dest}->{build}} ];
+ foreach my $inc (@source_includes) {
+ push @{$unified_info{includes}->{$dest}}, $inc
+ unless grep { $_ eq $inc } @{$unified_info{includes}->{$dest}};
+ }
+ } else {
+ $unified_info{includes}->{$dest} =
+ [ @{$unified_info{includes}->{$dest}->{source}} ];
+ }
+ }
+}
+
+# For the schemes that need it, we provide the old *_obj configs
+# from the *_asm_obj ones
+foreach (grep /_(asm|aux)_src$/, keys %target) {
+ my $src = $_;
+ (my $obj = $_) =~ s/_(asm|aux)_src$/_obj/;
+ ($target{$obj} = $target{$src}) =~ s/\.[csS]\b/.o/g;
+}
+
+# Write down our configuration where it fits #########################
+
+open(OUT,">configdata.pm") || die "unable to create configdata.pm: $!\n";
+print OUT <<"EOF";
+package configdata;
+
+use strict;
+use warnings;
+
+use Exporter;
+#use vars qw(\@ISA \@EXPORT);
+our \@ISA = qw(Exporter);
+our \@EXPORT = qw(\%config \%target \%disabled \%withargs \%unified_info \@disablables);
+
+EOF
+print OUT "our %config = (\n";
+foreach (sort keys %config) {
+ if (ref($config{$_}) eq "ARRAY") {
+ print OUT " ", $_, " => [ ", join(", ",
+ map { quotify("perl", $_) }
+ @{$config{$_}}), " ],\n";
+ } else {
+ print OUT " ", $_, " => ", quotify("perl", $config{$_}), ",\n"
+ }
+}
+print OUT <<"EOF";
+);
+
+EOF
+print OUT "our %target = (\n";
+foreach (sort keys %target) {
+ if (ref($target{$_}) eq "ARRAY") {
+ print OUT " ", $_, " => [ ", join(", ",
+ map { quotify("perl", $_) }
+ @{$target{$_}}), " ],\n";
+ } else {
+ print OUT " ", $_, " => ", quotify("perl", $target{$_}), ",\n"
+ }
+}
+print OUT <<"EOF";
+);
+
+EOF
+print OUT "our \%available_protocols = (\n";
+print OUT " tls => [ ", join(", ", map { quotify("perl", $_) } @tls), " ],\n";
+print OUT " dtls => [ ", join(", ", map { quotify("perl", $_) } @dtls), " ],\n";
+print OUT <<"EOF";
+);
+
+EOF
+print OUT "our \@disablables = (\n";
+foreach (@disablables) {
+ print OUT " ", quotify("perl", $_), ",\n";
+}
+print OUT <<"EOF";
+);
+
+EOF
+print OUT "our \%disabled = (\n";
+foreach (sort keys %disabled) {
+ print OUT " ", quotify("perl", $_), " => ", quotify("perl", $disabled{$_}), ",\n";
+}
+print OUT <<"EOF";
+);
+
+EOF
+print OUT "our %withargs = (\n";
+foreach (sort keys %withargs) {
+ if (ref($withargs{$_}) eq "ARRAY") {
+ print OUT " ", $_, " => [ ", join(", ",
+ map { quotify("perl", $_) }
+ @{$withargs{$_}}), " ],\n";
+ } else {
+ print OUT " ", $_, " => ", quotify("perl", $withargs{$_}), ",\n"
+ }
+}
+print OUT <<"EOF";
+);
+
+EOF
+if ($builder eq "unified") {
+ my $recurse;
+ $recurse = sub {
+ my $indent = shift;
+ foreach (@_) {
+ if (ref $_ eq "ARRAY") {
+ print OUT " "x$indent, "[\n";
+ foreach (@$_) {
+ $recurse->($indent + 4, $_);
+ }
+ print OUT " "x$indent, "],\n";
+ } elsif (ref $_ eq "HASH") {
+ my %h = %$_;
+ print OUT " "x$indent, "{\n";
+ foreach (sort keys %h) {
+ if (ref $h{$_} eq "") {
+ print OUT " "x($indent + 4), quotify("perl", $_), " => ", quotify("perl", $h{$_}), ",\n";
+ } else {
+ print OUT " "x($indent + 4), quotify("perl", $_), " =>\n";
+ $recurse->($indent + 8, $h{$_});
+ }
+ }
+ print OUT " "x$indent, "},\n";
+ } else {
+ print OUT " "x$indent, quotify("perl", $_), ",\n";
+ }
+ }
+ };
+ print OUT "our %unified_info = (\n";
+ foreach (sort keys %unified_info) {
+ if (ref $unified_info{$_} eq "") {
+ print OUT " "x4, quotify("perl", $_), " => ", quotify("perl", $unified_info{$_}), ",\n";
+ } else {
+ print OUT " "x4, quotify("perl", $_), " =>\n";
+ $recurse->(8, $unified_info{$_});
+ }
+ }
+ print OUT <<"EOF";
+);
+
+EOF
+}
+print OUT "1;\n";
+close(OUT);
+
+
+print "CC =$config{cross_compile_prefix}$target{cc}\n";
+print "CFLAG =$target{cflags} $config{cflags}\n";
+print "SHARED_CFLAG =$target{shared_cflag}\n";
+print "DEFINES =",join(" ", @{$target{defines}}, @{$config{defines}}),"\n";
+print "LFLAG =$target{lflags}\n";
+print "PLIB_LFLAG =$target{plib_lflags}\n";
+print "EX_LIBS =$target{ex_libs} $config{ex_libs}\n";
+print "APPS_OBJ =$target{apps_obj}\n";
+print "CPUID_OBJ =$target{cpuid_obj}\n";
+print "UPLINK_OBJ =$target{uplink_obj}\n";
+print "BN_ASM =$target{bn_obj}\n";
+print "EC_ASM =$target{ec_obj}\n";
+print "DES_ENC =$target{des_obj}\n";
+print "AES_ENC =$target{aes_obj}\n";
+print "BF_ENC =$target{bf_obj}\n";
+print "CAST_ENC =$target{cast_obj}\n";
+print "RC4_ENC =$target{rc4_obj}\n";
+print "RC5_ENC =$target{rc5_obj}\n";
+print "MD5_OBJ_ASM =$target{md5_obj}\n";
+print "SHA1_OBJ_ASM =$target{sha1_obj}\n";
+print "RMD160_OBJ_ASM=$target{rmd160_obj}\n";
+print "CMLL_ENC =$target{cmll_obj}\n";
+print "MODES_OBJ =$target{modes_obj}\n";
+print "PADLOCK_OBJ =$target{padlock_obj}\n";
+print "CHACHA_ENC =$target{chacha_obj}\n";
+print "POLY1305_OBJ =$target{poly1305_obj}\n";
+print "BLAKE2_OBJ =$target{blake2_obj}\n";
+print "PROCESSOR =$config{processor}\n";
+print "RANLIB =", $target{ranlib} eq '$(CROSS_COMPILE)ranlib' ?
+ "$config{cross_compile_prefix}ranlib" :
+ "$target{ranlib}", "\n";
+print "ARFLAGS =$target{arflags}\n";
+print "PERL =$config{perl}\n";
+print "\n";
+print "SIXTY_FOUR_BIT_LONG mode\n" if $config{b64l};
+print "SIXTY_FOUR_BIT mode\n" if $config{b64};
+print "THIRTY_TWO_BIT mode\n" if $config{b32};
+print "BN_LLONG mode\n" if $config{bn_ll};
+print "RC4 uses $config{rc4_int}\n" if $config{rc4_int} ne $def_int;
+
+my %builders = (
+ unified => sub {
+ run_dofile(catfile($blddir, $target{build_file}),
+ @{$config{build_file_templates}});
+ },
+ );
+
+$builders{$builder}->($builder_platform, @builder_opts);
+
+print <<"EOF";
+
+Configured for $target.
+EOF
+
+print <<"EOF" if ($disabled{threads} eq "unavailable");
+
+The library could not be configured for supporting multi-threaded
+applications as the compiler options required on this system are not known.
+See file INSTALL for details if you need multi-threading.
+EOF
+
+print <<"EOF" if ($no_shared_warn);
+
+The options 'shared', 'pic' and 'dynamic-engine' aren't supported on this
+platform, so we will pretend you gave the option 'no-pic', which also disables
+'shared' and 'dynamic-engine'. If you know how to implement shared libraries
+or position independent code, please let us know (but please first make sure
+you have tried with a current version of OpenSSL).
+EOF
+
+exit(0);
+
+######################################################################
+#
+# Helpers and utility functions
+#
+
+# Configuration file reading #########################################
+
+# Note: All of the helper functions are for lazy evaluation. They all
+# return a CODE ref, which will return the intended value when evaluated.
+# Thus, whenever there's mention of a returned value, it's about that
+# intended value.
+
+# Helper function to implement conditional inheritance depending on the
+# value of $disabled{asm}. Used in inherit_from values as follows:
+#
+# inherit_from => [ "template", asm("asm_tmpl") ]
+#
+sub asm {
+ my @x = @_;
+ sub {
+ $disabled{asm} ? () : @x;
+ }
+}
+
+# Helper function to implement conditional value variants, with a default
+# plus additional values based on the value of $config{build_type}.
+# Arguments are given in hash table form:
+#
+# picker(default => "Basic string: ",
+# debug => "debug",
+# release => "release")
+#
+# When configuring with --debug, the resulting string will be
+# "Basic string: debug", and when not, it will be "Basic string: release"
+#
+# This can be used to create variants of sets of flags according to the
+# build type:
+#
+# cflags => picker(default => "-Wall",
+# debug => "-g -O0",
+# release => "-O3")
+#
+sub picker {
+ my %opts = @_;
+ return sub { add($opts{default} || (),
+ $opts{$config{build_type}} || ())->(); }
+}
+
+# Helper function to combine several values of different types into one.
+# This is useful if you want to combine a string with the result of a
+# lazy function, such as:
+#
+# cflags => combine("-Wall", sub { $disabled{zlib} ? () : "-DZLIB" })
+#
+sub combine {
+ my @stuff = @_;
+ return sub { add(@stuff)->(); }
+}
+
+# Helper function to implement conditional values depending on the value
+# of $disabled{threads}. Can be used as follows:
+#
+# cflags => combine("-Wall", threads("-pthread"))
+#
+sub threads {
+ my @flags = @_;
+ return sub { add($disabled{threads} ? () : @flags)->(); }
+}
+
+
+
+our $add_called = 0;
+# Helper function to implement adding values to already existing configuration
+# values. It handles elements that are ARRAYs, CODEs and scalars
+sub _add {
+ my $separator = shift;
+
+ # If there's any ARRAY in the collection of values OR the separator
+ # is undef, we will return an ARRAY of combined values, otherwise a
+ # string of joined values with $separator as the separator.
+ my $found_array = !defined($separator);
+
+ my @values =
+ map {
+ my $res = $_;
+ while (ref($res) eq "CODE") {
+ $res = $res->();
+ }
+ if (defined($res)) {
+ if (ref($res) eq "ARRAY") {
+ $found_array = 1;
+ @$res;
+ } else {
+ $res;
+ }
+ } else {
+ ();
+ }
+ } (@_);
+
+ $add_called = 1;
+
+ if ($found_array) {
+ [ @values ];
+ } else {
+ join($separator, grep { defined($_) && $_ ne "" } @values);
+ }
+}
+sub add_before {
+ my $separator = " ";
+ if (ref($_[$#_]) eq "HASH") {
+ my $opts = pop;
+ $separator = $opts->{separator};
+ }
+ my @x = @_;
+ sub { _add($separator, @x, @_) };
+}
+sub add {
+ my $separator = " ";
+ if (ref($_[$#_]) eq "HASH") {
+ my $opts = pop;
+ $separator = $opts->{separator};
+ }
+ my @x = @_;
+ sub { _add($separator, @_, @x) };
+}
+
+# configuration reader, evaluates the input file as a perl script and expects
+# it to fill %targets with target configurations. Those are then added to
+# %table.
+sub read_config {
+ my $fname = shift;
+ open(CONFFILE, "< $fname")
+ or die "Can't open configuration file '$fname'!\n";
+ my $x = $/;
+ undef $/;
+ my $content = <CONFFILE>;
+ $/ = $x;
+ close(CONFFILE);
+ my %targets = ();
+ {
+ # Protect certain tables from tampering
+ local %table = %::table;
+
+ eval $content;
+ warn $@ if $@;
+ }
+ my %preexisting = ();
+ foreach (sort keys %targets) {
+ $preexisting{$_} = 1 if $table{$_};
+ }
+ die <<"EOF",
+The following config targets from $fname
+shadow pre-existing config targets with the same name:
+EOF
+ map { " $_\n" } sort keys %preexisting
+ if %preexisting;
+
+
+ # For each target, check that it's configured with a hash table.
+ foreach (keys %targets) {
+ if (ref($targets{$_}) ne "HASH") {
+ if (ref($targets{$_}) eq "") {
+ warn "Deprecated target configuration for $_, ignoring...\n";
+ } else {
+ warn "Misconfigured target configuration for $_ (should be a hash table), ignoring...\n";
+ }
+ delete $targets{$_};
+ } else {
+ $targets{$_}->{_conf_fname_int} = add([ $fname ]);
+ }
+ }
+
+ %table = (%table, %targets);
+
+}
+
+# configuration resolver. Will only resolve all the lazy evaluation
+# codeblocks for the chosen target and all those it inherits from,
+# recursively
+sub resolve_config {
+ my $target = shift;
+ my @breadcrumbs = @_;
+
+# my $extra_checks = defined($ENV{CONFIGURE_EXTRA_CHECKS});
+
+ if (grep { $_ eq $target } @breadcrumbs) {
+ die "inherit_from loop! target backtrace:\n "
+ ,$target,"\n ",join("\n ", @breadcrumbs),"\n";
+ }
+
+ if (!defined($table{$target})) {
+ warn "Warning! target $target doesn't exist!\n";
+ return ();
+ }
+ # Recurse through all inheritances. They will be resolved on the
+ # fly, so when this operation is done, they will all just be a
+ # bunch of attributes with string values.
+ # What we get here, though, are keys with references to lists of
+ # the combined values of them all. We will deal with lists after
+ # this stage is done.
+ my %combined_inheritance = ();
+ if ($table{$target}->{inherit_from}) {
+ my @inherit_from =
+ map { ref($_) eq "CODE" ? $_->() : $_ } @{$table{$target}->{inherit_from}};
+ foreach (@inherit_from) {
+ my %inherited_config = resolve_config($_, $target, @breadcrumbs);
+
+ # 'template' is a marker that's considered private to
+ # the config that had it.
+ delete $inherited_config{template};
+
+ foreach (keys %inherited_config) {
+ if (!$combined_inheritance{$_}) {
+ $combined_inheritance{$_} = [];
+ }
+ push @{$combined_inheritance{$_}}, $inherited_config{$_};
+ }
+ }
+ }
+
+ # We won't need inherit_from in this target any more, since we've
+ # resolved all the inheritances that lead to this
+ delete $table{$target}->{inherit_from};
+
+ # Now is the time to deal with those lists. Here's the place to
+ # decide what shall be done with those lists, all based on the
+ # values of the target we're currently dealing with.
+ # - If a value is a coderef, it will be executed with the list of
+ # inherited values as arguments.
+ # - If the corresponding key doesn't have a value at all or is the
+ # empty string, the inherited value list will be run through the
+ # default combiner (below), and the result becomes this target's
+ # value.
+ # - Otherwise, this target's value is assumed to be a string that
+ # will simply override the inherited list of values.
+ my $default_combiner = add();
+
+ my %all_keys =
+ map { $_ => 1 } (keys %combined_inheritance,
+ keys %{$table{$target}});
+
+ sub process_values {
+ my $object = shift;
+ my $inherited = shift; # Always a [ list ]
+ my $target = shift;
+ my $entry = shift;
+
+ $add_called = 0;
+
+ while(ref($object) eq "CODE") {
+ $object = $object->(@$inherited);
+ }
+ if (!defined($object)) {
+ return ();
+ }
+ elsif (ref($object) eq "ARRAY") {
+ local $add_called; # To make sure recursive calls don't affect it
+ return [ map { process_values($_, $inherited, $target, $entry) }
+ @$object ];
+ } elsif (ref($object) eq "") {
+ return $object;
+ } else {
+ die "cannot handle reference type ",ref($object)
+ ," found in target ",$target," -> ",$entry,"\n";
+ }
+ }
+
+ foreach (sort keys %all_keys) {
+ my $previous = $combined_inheritance{$_};
+
+ # Current target doesn't have a value for the current key?
+ # Assign it the default combiner, the rest of this loop body
+ # will handle it just like any other coderef.
+ if (!exists $table{$target}->{$_}) {
+ $table{$target}->{$_} = $default_combiner;
+ }
+
+ $table{$target}->{$_} = process_values($table{$target}->{$_},
+ $combined_inheritance{$_},
+ $target, $_);
+ unless(defined($table{$target}->{$_})) {
+ delete $table{$target}->{$_};
+ }
+# if ($extra_checks &&
+# $previous && !($add_called || $previous ~~ $table{$target}->{$_})) {
+# warn "$_ got replaced in $target\n";
+# }
+ }
+
+ # Finally done, return the result.
+ return %{$table{$target}};
+}
+
+sub usage
+ {
+ print STDERR $usage;
+ print STDERR "\npick os/compiler from:\n";
+ my $j=0;
+ my $i;
+ my $k=0;
+ foreach $i (sort keys %table)
+ {
+ next if $table{$i}->{template};
+ next if $i =~ /^debug/;
+ $k += length($i) + 1;
+ if ($k > 78)
+ {
+ print STDERR "\n";
+ $k=length($i);
+ }
+ print STDERR $i . " ";
+ }
+ foreach $i (sort keys %table)
+ {
+ next if $table{$i}->{template};
+ next if $i !~ /^debug/;
+ $k += length($i) + 1;
+ if ($k > 78)
+ {
+ print STDERR "\n";
+ $k=length($i);
+ }
+ print STDERR $i . " ";
+ }
+ print STDERR "\n\nNOTE: If in doubt, on Unix-ish systems use './config'.\n";
+ exit(1);
+ }
+
+sub run_dofile
+{
+ my $out = shift;
+ my @templates = @_;
+
+ unlink $out || warn "Can't remove $out, $!"
+ if -f $out;
+ foreach (@templates) {
+ die "Can't open $_, $!" unless -f $_;
+ }
+ my $perlcmd = (quotify("maybeshell", $config{perl}))[0];
+ my $cmd = "$perlcmd \"-I.\" \"-Mconfigdata\" \"$dofile\" -o\"Configure\" \"".join("\" \"",@templates)."\" > \"$out.new\"";
+ #print STDERR "DEBUG[run_dofile]: \$cmd = $cmd\n";
+ system($cmd);
+ exit 1 if $? != 0;
+ rename("$out.new", $out) || die "Can't rename $out.new, $!";
+}
+
+sub which
+{
+ my ($name)=@_;
+
+ if (eval { require IPC::Cmd; 1; }) {
+ IPC::Cmd->import();
+ return scalar IPC::Cmd::can_run($name);
+ } else {
+ # if there is $directories component in splitpath,
+ # then it's not something to test with $PATH...
+ return $name if (File::Spec->splitpath($name))[1];
+
+ foreach (File::Spec->path()) {
+ my $fullpath = catfile($_, "$name$target{exe_extension}");
+ if (-f $fullpath and -x $fullpath) {
+ return $fullpath;
+ }
+ }
+ }
+}
+
+# Configuration printer ##############################################
+
+sub print_table_entry
+{
+ my $target = shift;
+ my %target = resolve_config($target);
+ my $type = shift;
+
+ # Don't print the templates
+ return if $target{template};
+
+ my @sequence = (
+ "sys_id",
+ "cc",
+ "cflags",
+ "defines",
+ "unistd",
+ "ld",
+ "lflags",
+ "loutflag",
+ "plib_lflags",
+ "ex_libs",
+ "bn_ops",
+ "apps_aux_src",
+ "cpuid_asm_src",
+ "uplink_aux_src",
+ "bn_asm_src",
+ "ec_asm_src",
+ "des_asm_src",
+ "aes_asm_src",
+ "bf_asm_src",
+ "md5_asm_src",
+ "cast_asm_src",
+ "sha1_asm_src",
+ "rc4_asm_src",
+ "rmd160_asm_src",
+ "rc5_asm_src",
+ "wp_asm_src",
+ "cmll_asm_src",
+ "modes_asm_src",
+ "padlock_asm_src",
+ "chacha_asm_src",
+ "poly1035_asm_src",
+ "thread_scheme",
+ "perlasm_scheme",
+ "dso_scheme",
+ "shared_target",
+ "shared_cflag",
+ "shared_defines",
+ "shared_ldflag",
+ "shared_rcflag",
+ "shared_extension",
+ "dso_extension",
+ "obj_extension",
+ "exe_extension",
+ "ranlib",
+ "ar",
+ "arflags",
+ "aroutflag",
+ "rc",
+ "rcflags",
+ "rcoutflag",
+ "mt",
+ "mtflags",
+ "mtinflag",
+ "mtoutflag",
+ "multilib",
+ "build_scheme",
+ );
+
+ if ($type eq "TABLE") {
+ print "\n";
+ print "*** $target\n";
+ foreach (@sequence) {
+ if (ref($target{$_}) eq "ARRAY") {
+ printf "\$%-12s = %s\n", $_, join(" ", @{$target{$_}});
+ } else {
+ printf "\$%-12s = %s\n", $_, $target{$_};
+ }
+ }
+ } elsif ($type eq "HASH") {
+ my $largest =
+ length((sort { length($a) <=> length($b) } @sequence)[-1]);
+ print " '$target' => {\n";
+ foreach (@sequence) {
+ if ($target{$_}) {
+ if (ref($target{$_}) eq "ARRAY") {
+ print " '",$_,"'"," " x ($largest - length($_))," => [ ",join(", ", map { "'$_'" } @{$target{$_}})," ],\n";
+ } else {
+ print " '",$_,"'"," " x ($largest - length($_))," => '",$target{$_},"',\n";
+ }
+ }
+ }
+ print " },\n";
+ }
+}
+
+# Utility routines ###################################################
+
+# On VMS, if the given file is a logical name, File::Spec::Functions
+# will consider it an absolute path. There are cases when we want a
+# purely syntactic check without checking the environment.
+sub isabsolute {
+ my $file = shift;
+
+ # On non-platforms, we just use file_name_is_absolute().
+ return file_name_is_absolute($file) unless $^O eq "VMS";
+
+ # If the file spec includes a device or a directory spec,
+ # file_name_is_absolute() is perfectly safe.
+ return file_name_is_absolute($file) if $file =~ m|[:\[]|;
+
+ # Here, we know the given file spec isn't absolute
+ return 0;
+}
+
+# Makes a directory absolute and cleans out /../ in paths like foo/../bar
+# On some platforms, this uses rel2abs(), while on others, realpath() is used.
+# realpath() requires that at least all path components except the last is an
+# existing directory. On VMS, the last component of the directory spec must
+# exist.
+sub absolutedir {
+ my $dir = shift;
+
+ # realpath() is quite buggy on VMS. It uses LIB$FID_TO_NAME, which
+ # will return the volume name for the device, no matter what. Also,
+ # it will return an incorrect directory spec if the argument is a
+ # directory that doesn't exist.
+ if ($^O eq "VMS") {
+ return rel2abs($dir);
+ }
+
+ # We use realpath() on Unix, since no other will properly clean out
+ # a directory spec.
+ use Cwd qw/realpath/;
+
+ return realpath($dir);
+}
+
+sub quotify {
+ my %processors = (
+ perl => sub { my $x = shift;
+ $x =~ s/([\\\$\@"])/\\$1/g;
+ return '"'.$x.'"'; },
+ maybeshell => sub { my $x = shift;
+ (my $y = $x) =~ s/([\\\"])/\\$1/g;
+ if ($x ne $y || $x =~ m|\s|) {
+ return '"'.$y.'"';
+ } else {
+ return $x;
+ }
+ },
+ );
+ my $for = shift;
+ my $processor =
+ defined($processors{$for}) ? $processors{$for} : sub { shift; };
+
+ return map { $processor->($_); } @_;
+}
+
+# collect_from_file($filename, $line_concat_cond_re, $line_concat)
+# $filename is a file name to read from
+# $line_concat_cond_re is a regexp detecting a line continuation ending
+# $line_concat is a CODEref that takes care of concatenating two lines
+sub collect_from_file {
+ my $filename = shift;
+ my $line_concat_cond_re = shift;
+ my $line_concat = shift;
+
+ open my $fh, $filename || die "unable to read $filename: $!\n";
+ return sub {
+ my $saved_line = "";
+ $_ = "";
+ while (<$fh>) {
+ s|\R$||;
+ if (defined $line_concat) {
+ $_ = $line_concat->($saved_line, $_);
+ $saved_line = "";
+ }
+ if (defined $line_concat_cond_re && /$line_concat_cond_re/) {
+ $saved_line = $_;
+ next;
+ }
+ return $_;
+ }
+ die "$filename ending with continuation line\n" if $_;
+ close $fh;
+ return undef;
+ }
+}
+
+# collect_from_array($array, $line_concat_cond_re, $line_concat)
+# $array is an ARRAYref of lines
+# $line_concat_cond_re is a regexp detecting a line continuation ending
+# $line_concat is a CODEref that takes care of concatenating two lines
+sub collect_from_array {
+ my $array = shift;
+ my $line_concat_cond_re = shift;
+ my $line_concat = shift;
+ my @array = (@$array);
+
+ return sub {
+ my $saved_line = "";
+ $_ = "";
+ while (defined($_ = shift @array)) {
+ s|\R$||;
+ if (defined $line_concat) {
+ $_ = $line_concat->($saved_line, $_);
+ $saved_line = "";
+ }
+ if (defined $line_concat_cond_re && /$line_concat_cond_re/) {
+ $saved_line = $_;
+ next;
+ }
+ return $_;
+ }
+ die "input text ending with continuation line\n" if $_;
+ return undef;
+ }
+}
+
+# collect_information($lineiterator, $line_continue, $regexp => $CODEref, ...)
+# $lineiterator is a CODEref that delivers one line at a time.
+# All following arguments are regex/CODEref pairs, where the regexp detects a
+# line and the CODEref does something with the result of the regexp.
+sub collect_information {
+ my $lineiterator = shift;
+ my %collectors = @_;
+
+ while(defined($_ = $lineiterator->())) {
+ s|\R$||;
+ my $found = 0;
+ if ($collectors{"BEFORE"}) {
+ $collectors{"BEFORE"}->($_);
+ }
+ foreach my $re (keys %collectors) {
+ if ($re !~ /^OTHERWISE|BEFORE|AFTER$/ && /$re/) {
+ $collectors{$re}->($lineiterator);
+ $found = 1;
+ };
+ }
+ if ($collectors{"OTHERWISE"}) {
+ $collectors{"OTHERWISE"}->($lineiterator, $_)
+ unless $found || !defined $collectors{"OTHERWISE"};
+ }
+ if ($collectors{"AFTER"}) {
+ $collectors{"AFTER"}->($_);
+ }
+ }
+}
+
+# tokenize($line)
+# $line is a line of text to split up into tokens
+# returns a list of tokens
+#
+# Tokens are divided by spaces. If the tokens include spaces, they
+# have to be quoted with single or double quotes. Double quotes
+# inside a double quoted token must be escaped. Escaping is done
+# with backslash.
+# Basically, the same quoting rules apply for " and ' as in any
+# Unix shell.
+sub tokenize {
+ my $line = my $debug_line = shift;
+ my @result = ();
+
+ while ($line =~ s|^\s+||, $line ne "") {
+ my $token = "";
+ while ($line ne "" && $line !~ m|^\s|) {
+ if ($line =~ m/^"((?:[^"\\]+|\\.)*)"/) {
+ $token .= $1;
+ $line = $';
+ } elsif ($line =~ m/^'([^']*)'/) {
+ $token .= $1;
+ $line = $';
+ } elsif ($line =~ m/^(\S+)/) {
+ $token .= $1;
+ $line = $';
+ }
+ }
+ push @result, $token;
+ }
+
+ if ($ENV{CONFIGURE_DEBUG_TOKENIZE}) {
+ print STDERR "DEBUG[tokenize]: Parsed '$debug_line' into:\n";
+ print STDERR "DEBUG[tokenize]: ('", join("', '", @result), "')\n";
+ }
+ return @result;
+}
diff --git a/openssl-1.1.0h/FAQ b/openssl-1.1.0h/FAQ
new file mode 100644
index 0000000..22c5cf7
--- /dev/null
+++ b/openssl-1.1.0h/FAQ
@@ -0,0 +1,2 @@
+The FAQ is now maintained on the web:
+ https://www.openssl.org/docs/faq.html
diff --git a/openssl-1.1.0h/INSTALL b/openssl-1.1.0h/INSTALL
new file mode 100644
index 0000000..3e21cc2
--- /dev/null
+++ b/openssl-1.1.0h/INSTALL
@@ -0,0 +1,964 @@
+
+ OPENSSL INSTALLATION
+ --------------------
+
+ This document describes installation on all supported operating
+ systems (the Linux/Unix family, OpenVMS and Windows)
+
+ To install OpenSSL, you will need:
+
+ * A make implementation
+ * Perl 5 with core modules (please read NOTES.PERL)
+ * The perl module Text::Template (please read NOTES.PERL)
+ * an ANSI C compiler
+ * a development environment in the form of development libraries and C
+ header files
+ * a supported operating system
+
+ For additional platform specific requirements, solutions to specific
+ issues and other details, please read one of these:
+
+ * NOTES.UNIX (any supported Unix like system)
+ * NOTES.VMS (OpenVMS)
+ * NOTES.WIN (any supported Windows)
+ * NOTES.DJGPP (DOS platform with DJGPP)
+
+ Notational conventions in this document
+ ---------------------------------------
+
+ Throughout this document, we use the following conventions in command
+ examples:
+
+ $ command Any line starting with a dollar sign
+ ($) is a command line.
+
+ { word1 | word2 | word3 } This denotes a mandatory choice, to be
+ replaced with one of the given words.
+ A simple example would be this:
+
+ $ echo { FOO | BAR | COOKIE }
+
+ which is to be understood as one of
+ these:
+
+ $ echo FOO
+ - or -
+ $ echo BAR
+ - or -
+ $ echo COOKIE
+
+ [ word1 | word2 | word3 ] Similar to { word1 | word2 | word3 }
+ except it's optional to give any of
+ those. In addition to the examples
+ above, this would also be valid:
+
+ $ echo
+
+ {{ target }} This denotes a mandatory word or
+ sequence of words of some sort. A
+ simple example would be this:
+
+ $ type {{ filename }}
+
+ which is to be understood to use the
+ command 'type' on some file name
+ determined by the user.
+
+ [[ options ]] Similar to {{ target }}, but is
+ optional.
+
+ Note that the notation assumes spaces around {, }, [, ], {{, }} and
+ [[, ]]. This is to differentiate from OpenVMS directory
+ specifications, which also use [ and ], but without spaces.
+
+ Quick Start
+ -----------
+
+ If you want to just get on with it, do:
+
+ on Unix:
+
+ $ ./config
+ $ make
+ $ make test
+ $ make install
+
+ on OpenVMS:
+
+ $ @config
+ $ mms
+ $ mms test
+ $ mms install
+
+ on Windows (only pick one of the targets for configuration):
+
+ $ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }
+ $ nmake
+ $ nmake test
+ $ nmake install
+
+ If any of these steps fails, see section Installation in Detail below.
+
+ This will build and install OpenSSL in the default location, which is:
+
+ Unix: normal installation directories under /usr/local
+ OpenVMS: SYS$COMMON:[OPENSSL-'version'...], where 'version' is the
+ OpenSSL version number with underscores instead of periods.
+ Windows: C:\Program Files\OpenSSL or C:\Program Files (x86)\OpenSSL
+
+ If you want to install it anywhere else, run config like this:
+
+ On Unix:
+
+ $ ./config --prefix=/opt/openssl --openssldir=/usr/local/ssl
+
+ On OpenVMS:
+
+ $ @config --prefix=PROGRAM:[INSTALLS] --openssldir=SYS$MANAGER:[OPENSSL]
+
+ (Note: if you do add options to the configuration command, please make sure
+ you've read more than just this Quick Start, such as relevant NOTES.* files,
+ the options outline below, as configuration options may change the outcome
+ in otherwise unexpected ways)
+
+
+ Configuration Options
+ ---------------------
+
+ There are several options to ./config (or ./Configure) to customize
+ the build (note that for Windows, the defaults for --prefix and
+ --openssldir depend in what configuration is used and what Windows
+ implementation OpenSSL is built on. More notes on this in NOTES.WIN):
+
+ --api=x.y.z
+ Don't build with support for deprecated APIs below the
+ specified version number. For example "--api=1.1.0" will
+ remove support for all APIS that were deprecated in OpenSSL
+ version 1.1.0 or below.
+
+ --cross-compile-prefix=PREFIX
+ The PREFIX to include in front of commands for your
+ toolchain. It's likely to have to end with dash, e.g.
+ a-b-c- would invoke GNU compiler as a-b-c-gcc, etc.
+ Unfortunately cross-compiling is too case-specific to
+ put together one-size-fits-all instructions. You might
+ have to pass more flags or set up environment variables
+ to actually make it work. Android and iOS cases are
+ discussed in corresponding Configurations/10-main.cf
+ sections. But there are cases when this option alone is
+ sufficient. For example to build the mingw64 target on
+ Linux "--cross-compile-prefix=x86_64-w64-mingw32-"
+ works. Naturally provided that mingw packages are
+ installed. Today Debian and Ubuntu users have option to
+ install a number of prepackaged cross-compilers along
+ with corresponding run-time and development packages for
+ "alien" hardware. To give another example
+ "--cross-compile-prefix=mipsel-linux-gnu-" suffices
+ in such case. Needless to mention that you have to
+ invoke ./Configure, not ./config, and pass your target
+ name explicitly.
+
+ --debug
+ Build OpenSSL with debugging symbols.
+
+ --libdir=DIR
+ The name of the directory under the top of the installation
+ directory tree (see the --prefix option) where libraries will
+ be installed. By default this is "lib". Note that on Windows
+ only ".lib" files will be stored in this location. dll files
+ will always be installed to the "bin" directory.
+
+ --openssldir=DIR
+ Directory for OpenSSL configuration files, and also the
+ default certificate and key store. Defaults are:
+
+ Unix: /usr/local/ssl
+ Windows: C:\Program Files\Common Files\SSL
+ or C:\Program Files (x86)\Common Files\SSL
+ OpenVMS: SYS$COMMON:[OPENSSL-COMMON]
+
+ --prefix=DIR
+ The top of the installation directory tree. Defaults are:
+
+ Unix: /usr/local
+ Windows: C:\Program Files\OpenSSL
+ or C:\Program Files (x86)\OpenSSL
+ OpenVMS: SYS$COMMON:[OPENSSL-'version']
+
+ --release
+ Build OpenSSL without debugging symbols. This is the default.
+
+ --strict-warnings
+ This is a developer flag that switches on various compiler
+ options recommended for OpenSSL development. It only works
+ when using gcc or clang as the compiler. If you are
+ developing a patch for OpenSSL then it is recommended that
+ you use this option where possible.
+
+ --with-zlib-include=DIR
+ The directory for the location of the zlib include file. This
+ option is only necessary if enable-zlib (see below) is used
+ and the include file is not already on the system include
+ path.
+
+ --with-zlib-lib=LIB
+ On Unix: this is the directory containing the zlib library.
+ If not provided the system library path will be used.
+ On Windows: this is the filename of the zlib library (with or
+ without a path). This flag must be provided if the
+ zlib-dynamic option is not also used. If zlib-dynamic is used
+ then this flag is optional and a default value ("ZLIB1") is
+ used if not provided.
+ On VMS: this is the filename of the zlib library (with or
+ without a path). This flag is optional and if not provided
+ then "GNV$LIBZSHR", "GNV$LIBZSHR32" or "GNV$LIBZSHR64" is
+ used by default depending on the pointer size chosen.
+
+ no-afalgeng
+ Don't build the AFALG engine. This option will be forced if
+ on a platform that does not support AFALG.
+
+ enable-asan
+ Build with the Address sanitiser. This is a developer option
+ only. It may not work on all platforms and should never be
+ used in production environments. It will only work when used
+ with gcc or clang and should be used in conjunction with the
+ no-shared option.
+
+ no-asm
+ Do not use assembler code. On some platforms a small amount
+ of assembler code may still be used.
+
+ no-async
+ Do not build support for async operations.
+
+ no-autoalginit
+ Don't automatically load all supported ciphers and digests.
+ Typically OpenSSL will make available all of its supported
+ ciphers and digests. For a statically linked application this
+ may be undesirable if small executable size is an objective.
+ This only affects libcrypto. Ciphers and digests will have to
+ be loaded manually using EVP_add_cipher() and
+ EVP_add_digest() if this option is used. This option will
+ force a non-shared build.
+
+ no-autoerrinit
+ Don't automatically load all libcrypto/libssl error strings.
+ Typically OpenSSL will automatically load human readable
+ error strings. For a statically linked application this may
+ be undesirable if small executable size is an objective.
+
+
+ no-capieng
+ Don't build the CAPI engine. This option will be forced if
+ on a platform that does not support CAPI.
+
+ no-cms
+ Don't build support for CMS features
+
+ no-comp
+ Don't build support for SSL/TLS compression. If this option
+ is left enabled (the default), then compression will only
+ work if the zlib or zlib-dynamic options are also chosen.
+
+ enable-crypto-mdebug
+ Build support for debugging memory allocated via
+ OPENSSL_malloc() or OPENSSL_zalloc().
+
+ enable-crypto-mdebug-backtrace
+ As for crypto-mdebug, but additionally provide backtrace
+ information for allocated memory.
+ TO BE USED WITH CARE: this uses GNU C functionality, and
+ is therefore not usable for non-GNU config targets. If
+ your build complains about the use of '-rdynamic' or the
+ lack of header file execinfo.h, this option is not for you.
+ ALSO NOTE that even though execinfo.h is available on your
+ system (through Gnulib), the functions might just be stubs
+ that do nothing.
+
+ no-ct
+ Don't build support for Certificate Transparency.
+
+ no-deprecated
+ Don't build with support for any deprecated APIs. This is the
+ same as using "--api" and supplying the latest version
+ number.
+
+ no-dgram
+ Don't build support for datagram based BIOs. Selecting this
+ option will also force the disabling of DTLS.
+
+ no-dso
+ Don't build support for loading Dynamic Shared Objects.
+
+ no-dynamic-engine
+ Don't build the dynamically loaded engines. This only has an
+ effect in a "shared" build
+
+ no-ec
+ Don't build support for Elliptic Curves.
+
+ no-ec2m
+ Don't build support for binary Elliptic Curves
+
+ enable-ec_nistp_64_gcc_128
+ Enable support for optimised implementations of some commonly
+ used NIST elliptic curves. This is only supported on some
+ platforms.
+
+ enable-egd
+ Build support for gathering entropy from EGD (Entropy
+ Gathering Daemon).
+
+ no-engine
+ Don't build support for loading engines.
+
+ no-err
+ Don't compile in any error strings.
+
+ no-filenames
+ Don't compile in filename and line number information (e.g.
+ for errors and memory allocation).
+
+ enable-fuzz-libfuzzer, enable-fuzz-afl
+ Build with support for fuzzing using either libfuzzer or AFL.
+ These are developer options only. They may not work on all
+ platforms and should never be used in production environments.
+ See the file fuzz/README.md for further details.
+
+ no-gost
+ Don't build support for GOST based ciphersuites. Note that
+ if this feature is enabled then GOST ciphersuites are only
+ available if the GOST algorithms are also available through
+ loading an externally supplied engine.
+
+ enable-heartbeats
+ Build support for DTLS heartbeats.
+
+ no-hw-padlock
+ Don't build the padlock engine.
+
+ no-makedepend
+ Don't generate dependencies.
+
+ no-multiblock
+ Don't build support for writing multiple records in one
+ go in libssl (Note: this is a different capability to the
+ pipelining functionality).
+
+ no-nextprotoneg
+ Don't build support for the NPN TLS extension.
+
+ no-ocsp
+ Don't build support for OCSP.
+
+ no-pic
+ Don't build with support for Position Independent Code.
+
+ no-posix-io
+ Don't use POSIX IO capabilities.
+
+ no-psk
+ Don't build support for Pre-Shared Key based ciphersuites.
+
+ no-rdrand
+ Don't use hardware RDRAND capabilities.
+
+ no-rfc3779
+ Don't build support for RFC3779 ("X.509 Extensions for IP
+ Addresses and AS Identifiers")
+
+ sctp
+ Build support for SCTP
+
+ no-shared
+ Do not create shared libraries, only static ones. See "Note
+ on shared libraries" below.
+
+ no-sock
+ Don't build support for socket BIOs
+
+ no-srp
+ Don't build support for SRP or SRP based ciphersuites.
+
+ no-srtp
+ Don't build SRTP support
+
+ no-sse2
+ Exclude SSE2 code paths from 32-bit x86 assembly modules.
+ Normally SSE2 extension is detected at run-time, but the
+ decision whether or not the machine code will be executed
+ is taken solely on CPU capability vector. This means that
+ if you happen to run OS kernel which does not support SSE2
+ extension on Intel P4 processor, then your application
+ might be exposed to "illegal instruction" exception.
+ There might be a way to enable support in kernel, e.g.
+ FreeBSD kernel can be compiled with CPU_ENABLE_SSE, and
+ there is a way to disengage SSE2 code paths upon application
+ start-up, but if you aim for wider "audience" running
+ such kernel, consider no-sse2. Both the 386 and
+ no-asm options imply no-sse2.
+
+ enable-ssl-trace
+ Build with the SSL Trace capabilities (adds the "-trace"
+ option to s_client and s_server).
+
+ no-static-engine
+ Don't build the statically linked engines. This only
+ has an impact when not built "shared".
+
+ no-stdio
+ Don't use anything from the C header file "stdio.h" that
+ makes use of the "FILE" type. Only libcrypto and libssl can
+ be built in this way. Using this option will suppress
+ building the command line applications. Additionally since
+ the OpenSSL tests also use the command line applications the
+ tests will also be skipped.
+
+ no-threads
+ Don't try to build with support for multi-threaded
+ applications.
+
+ threads
+ Build with support for multi-threaded applications. Most
+ platforms will enable this by default. However if on a
+ platform where this is not the case then this will usually
+ require additional system-dependent options! See "Note on
+ multi-threading" below.
+
+ no-ts
+ Don't build Time Stamping Authority support.
+
+ enable-ubsan
+ Build with the Undefined Behaviour sanitiser. This is a
+ developer option only. It may not work on all platforms and
+ should never be used in production environments. It will only
+ work when used with gcc or clang and should be used in
+ conjunction with the "-DPEDANTIC" option (or the
+ --strict-warnings option).
+
+ no-ui
+ Don't build with the "UI" capability (i.e. the set of
+ features enabling text based prompts).
+
+ enable-unit-test
+ Enable additional unit test APIs. This should not typically
+ be used in production deployments.
+
+ enable-weak-ssl-ciphers
+ Build support for SSL/TLS ciphers that are considered "weak"
+ (e.g. RC4 based ciphersuites).
+
+ zlib
+ Build with support for zlib compression/decompression.
+
+ zlib-dynamic
+ Like "zlib", but has OpenSSL load the zlib library
+ dynamically when needed. This is only supported on systems
+ where loading of shared libraries is supported.
+
+ 386
+ In 32-bit x86 builds, when generating assembly modules,
+ use the 80386 instruction set only (the default x86 code
+ is more efficient, but requires at least a 486). Note:
+ This doesn't affect code generated by compiler, you're
+ likely to complement configuration command line with
+ suitable compiler-specific option.
+
+ no-<prot>
+ Don't build support for negotiating the specified SSL/TLS
+ protocol (one of ssl, ssl3, tls, tls1, tls1_1, tls1_2, dtls,
+ dtls1 or dtls1_2). If "no-tls" is selected then all of tls1,
+ tls1_1 and tls1_2 are disabled. Similarly "no-dtls" will
+ disable dtls1 and dtls1_2. The "no-ssl" option is synonymous
+ with "no-ssl3". Note this only affects version negotiation.
+ OpenSSL will still provide the methods for applications to
+ explicitly select the individual protocol versions.
+
+ no-<prot>-method
+ As for no-<prot> but in addition do not build the methods for
+ applications to explicitly select individual protocol
+ versions.
+
+ enable-<alg>
+ Build with support for the specified algorithm, where <alg>
+ is one of: md2 or rc5.
+
+ no-<alg>
+ Build without support for the specified algorithm, where
+ <alg> is one of: bf, blake2, camellia, cast, chacha, cmac,
+ des, dh, dsa, ecdh, ecdsa, idea, md4, mdc2, ocb, poly1305,
+ rc2, rc4, rmd160, scrypt, seed or whirlpool. The "ripemd"
+ algorithm is deprecated and if used is synonymous with rmd160.
+
+ -Dxxx, lxxx, -Lxxx, -Wl, -rpath, -R, -framework, -static
+ These system specific options will be recocognised and
+ passed through to the compiler to allow you to define
+ preprocessor symbols, specify additional libraries, library
+ directories or other compiler options. It might be worth
+ noting that some compilers generate code specifically for
+ processor the compiler currently executes on. This is not
+ necessarily what you might have in mind, since it might be
+ unsuitable for execution on other, typically older,
+ processor. Consult your compiler documentation.
+
+ -xxx, +xxx
+ Additional options that are not otherwise recognised are
+ passed through as they are to the compiler as well. Again,
+ consult your compiler documentation.
+
+
+ Installation in Detail
+ ----------------------
+
+ 1a. Configure OpenSSL for your operation system automatically:
+
+ NOTE: This is not available on Windows.
+
+ $ ./config [[ options ]] # Unix
+
+ or
+
+ $ @config [[ options ]] ! OpenVMS
+
+ For the remainder of this text, the Unix form will be used in all
+ examples, please use the appropriate form for your platform.
+
+ This guesses at your operating system (and compiler, if necessary) and
+ configures OpenSSL based on this guess. Run ./config -t to see
+ if it guessed correctly. If you want to use a different compiler, you
+ are cross-compiling for another platform, or the ./config guess was
+ wrong for other reasons, go to step 1b. Otherwise go to step 2.
+
+ On some systems, you can include debugging information as follows:
+
+ $ ./config -d [[ options ]]
+
+ 1b. Configure OpenSSL for your operating system manually
+
+ OpenSSL knows about a range of different operating system, hardware and
+ compiler combinations. To see the ones it knows about, run
+
+ $ ./Configure # Unix
+
+ or
+
+ $ perl Configure # All other platforms
+
+ For the remainder of this text, the Unix form will be used in all
+ examples, please use the appropriate form for your platform.
+
+ Pick a suitable name from the list that matches your system. For most
+ operating systems there is a choice between using "cc" or "gcc". When
+ you have identified your system (and if necessary compiler) use this name
+ as the argument to Configure. For example, a "linux-elf" user would
+ run:
+
+ $ ./Configure linux-elf [[ options ]]
+
+ If your system isn't listed, you will have to create a configuration
+ file named Configurations/{{ something }}.conf and add the correct
+ configuration for your system. See the available configs as examples
+ and read Configurations/README and Configurations/README.design for
+ more information.
+
+ The generic configurations "cc" or "gcc" should usually work on 32 bit
+ Unix-like systems.
+
+ Configure creates a build file ("Makefile" on Unix, "makefile" on Windows
+ and "descrip.mms" on OpenVMS) from a suitable template in Configurations,
+ and defines various macros in include/openssl/opensslconf.h (generated from
+ include/openssl/opensslconf.h.in).
+
+ 1c. Configure OpenSSL for building outside of the source tree.
+
+ OpenSSL can be configured to build in a build directory separate from
+ the directory with the source code. It's done by placing yourself in
+ some other directory and invoking the configuration commands from
+ there.
+
+ Unix example:
+
+ $ mkdir /var/tmp/openssl-build
+ $ cd /var/tmp/openssl-build
+ $ /PATH/TO/OPENSSL/SOURCE/config [[ options ]]
+
+ or
+
+ $ /PATH/TO/OPENSSL/SOURCE/Configure {{ target }} [[ options ]]
+
+ OpenVMS example:
+
+ $ set default sys$login:
+ $ create/dir [.tmp.openssl-build]
+ $ set default [.tmp.openssl-build]
+ $ @[PATH.TO.OPENSSL.SOURCE]config [[ options ]]
+
+ or
+
+ $ @[PATH.TO.OPENSSL.SOURCE]Configure {{ target }} [[ options ]]
+
+ Windows example:
+
+ $ C:
+ $ mkdir \temp-openssl
+ $ cd \temp-openssl
+ $ perl d:\PATH\TO\OPENSSL\SOURCE\Configure {{ target }} [[ options ]]
+
+ Paths can be relative just as well as absolute. Configure will
+ do its best to translate them to relative paths whenever possible.
+
+ 2. Build OpenSSL by running:
+
+ $ make # Unix
+ $ mms ! (or mmk) OpenVMS
+ $ nmake # Windows
+
+ This will build the OpenSSL libraries (libcrypto.a and libssl.a on
+ Unix, corresponding on other platforms) and the OpenSSL binary
+ ("openssl"). The libraries will be built in the top-level directory,
+ and the binary will be in the "apps" subdirectory.
+
+ If the build fails, look at the output. There may be reasons
+ for the failure that aren't problems in OpenSSL itself (like
+ missing standard headers). If you are having problems you can
+ get help by sending an email to the openssl-users email list (see
+ https://www.openssl.org/community/mailinglists.html for details). If
+ it is a bug with OpenSSL itself, please open an issue on GitHub, at
+ https://github.com/openssl/openssl/issues. Please review the existing
+ ones first; maybe the bug was already reported or has already been
+ fixed.
+
+ (If you encounter assembler error messages, try the "no-asm"
+ configuration option as an immediate fix.)
+
+ Compiling parts of OpenSSL with gcc and others with the system
+ compiler will result in unresolved symbols on some systems.
+
+ 3. After a successful build, the libraries should be tested. Run:
+
+ $ make test # Unix
+ $ mms test ! OpenVMS
+ $ nmake test # Windows
+
+ NOTE: you MUST run the tests from an unprivileged account (or
+ disable your privileges temporarily if your platform allows it).
+
+ If some tests fail, look at the output. There may be reasons for
+ the failure that isn't a problem in OpenSSL itself (like a
+ malfunction with Perl). You may want increased verbosity, that
+ can be accomplished like this:
+
+ $ make VERBOSE=1 test # Unix
+
+ $ mms /macro=(VERBOSE=1) test ! OpenVMS
+
+ $ nmake VERBOSE=1 test # Windows
+
+ If you want to run just one or a few specific tests, you can use
+ the make variable TESTS to specify them, like this:
+
+ $ make TESTS='test_rsa test_dsa' test # Unix
+ $ mms/macro="TESTS=test_rsa test_dsa" test ! OpenVMS
+ $ nmake TESTS='test_rsa test_dsa' test # Windows
+
+ And of course, you can combine (Unix example shown):
+
+ $ make VERBOSE=1 TESTS='test_rsa test_dsa' test
+
+ You can find the list of available tests like this:
+
+ $ make list-tests # Unix
+ $ mms list-tests ! OpenVMS
+ $ nmake list-tests # Windows
+
+ Have a look at the manual for the perl module Test::Harness to
+ see what other HARNESS_* variables there are.
+
+ If you find a problem with OpenSSL itself, try removing any
+ compiler optimization flags from the CFLAGS line in Makefile and
+ run "make clean; make" or corresponding.
+
+ To report a bug please open an issue on GitHub, at
+ https://github.com/openssl/openssl/issues.
+
+ 4. If everything tests ok, install OpenSSL with
+
+ $ make install # Unix
+ $ mms install ! OpenVMS
+ $ nmake install # Windows
+
+ This will install all the software components in this directory
+ tree under PREFIX (the directory given with --prefix or its
+ default):
+
+ Unix:
+
+ bin/ Contains the openssl binary and a few other
+ utility scripts.
+ include/openssl
+ Contains the header files needed if you want
+ to build your own programs that use libcrypto
+ or libssl.
+ lib Contains the OpenSSL library files.
+ lib/engines Contains the OpenSSL dynamically loadable engines.
+
+ share/man/man1 Contains the OpenSSL command line man-pages.
+ share/man/man3 Contains the OpenSSL library calls man-pages.
+ share/man/man5 Contains the OpenSSL configuration format man-pages.
+ share/man/man7 Contains the OpenSSL other misc man-pages.
+
+ share/doc/openssl/html/man1
+ share/doc/openssl/html/man3
+ share/doc/openssl/html/man5
+ share/doc/openssl/html/man7
+ Contains the HTML rendition of the man-pages.
+
+ OpenVMS ('arch' is replaced with the architecture name, "Alpha"
+ or "ia64", 'sover' is replaced with the shared library version
+ (0101 for 1.1), and 'pz' is replaced with the pointer size
+ OpenSSL was built with):
+
+ [.EXE.'arch'] Contains the openssl binary.
+ [.EXE] Contains a few utility scripts.
+ [.include.openssl]
+ Contains the header files needed if you want
+ to build your own programs that use libcrypto
+ or libssl.
+ [.LIB.'arch'] Contains the OpenSSL library files.
+ [.ENGINES'sover''pz'.'arch']
+ Contains the OpenSSL dynamically loadable engines.
+ [.SYS$STARTUP] Contains startup, login and shutdown scripts.
+ These define appropriate logical names and
+ command symbols.
+ [.SYSTEST] Contains the installation verification procedure.
+ [.HTML] Contains the HTML rendition of the manual pages.
+
+
+ Additionally, install will add the following directories under
+ OPENSSLDIR (the directory given with --openssldir or its default)
+ for you convenience:
+
+ certs Initially empty, this is the default location
+ for certificate files.
+ private Initially empty, this is the default location
+ for private key files.
+ misc Various scripts.
+
+ Package builders who want to configure the library for standard
+ locations, but have the package installed somewhere else so that
+ it can easily be packaged, can use
+
+ $ make DESTDIR=/tmp/package-root install # Unix
+ $ mms/macro="DESTDIR=TMP:[PACKAGE-ROOT]" install ! OpenVMS
+
+ The specified destination directory will be prepended to all
+ installation target paths.
+
+ Compatibility issues with previous OpenSSL versions:
+
+ * COMPILING existing applications
+
+ OpenSSL 1.1.0 hides a number of structures that were previously
+ open. This includes all internal libssl structures and a number
+ of EVP types. Accessor functions have been added to allow
+ controlled access to the structures' data.
+
+ This means that some software needs to be rewritten to adapt to
+ the new ways of doing things. This often amounts to allocating
+ an instance of a structure explicitly where you could previously
+ allocate them on the stack as automatic variables, and using the
+ provided accessor functions where you would previously access a
+ structure's field directly.
+
+ Some APIs have changed as well. However, older APIs have been
+ preserved when possible.
+
+ Environment Variables
+ ---------------------
+
+ A number of environment variables can be used to provide additional control
+ over the build process. Typically these should be defined prior to running
+ config or Configure. Not all environment variables are relevant to all
+ platforms.
+
+ AR
+ The name of the ar executable to use.
+
+ BUILDFILE
+ Use a different build file name than the platform default
+ ("Makefile" on Unixly platforms, "makefile" on native Windows,
+ "descrip.mms" on OpenVMS). This requires that there is a
+ corresponding build file template. See Configurations/README
+ for further information.
+
+ CC
+ The compiler to use. Configure will attempt to pick a default
+ compiler for your platform but this choice can be overridden
+ using this variable. Set it to the compiler executable you wish
+ to use, e.g. "gcc" or "clang".
+
+ CROSS_COMPILE
+ This environment variable has the same meaning as for the
+ "--cross-compile-prefix" Configure flag described above. If both
+ are set then the Configure flag takes precedence.
+
+ NM
+ The name of the nm executable to use.
+
+ OPENSSL_LOCAL_CONFIG_DIR
+ OpenSSL comes with a database of information about how it
+ should be built on different platforms as well as build file
+ templates for those platforms. The database is comprised of
+ ".conf" files in the Configurations directory. The build
+ file templates reside there as well as ".tmpl" files. See the
+ file Configurations/README for further information about the
+ format of ".conf" files as well as information on the ".tmpl"
+ files.
+ In addition to the standard ".conf" and ".tmpl" files, it is
+ possible to create your own ".conf" and ".tmpl" files and store
+ them locally, outside the OpenSSL source tree. This environment
+ variable can be set to the directory where these files are held
+ and will have Configure to consider them in addition to the
+ standard ones.
+
+ PERL
+ The name of the Perl executable to use when building OpenSSL.
+
+ HASHBANGPERL
+ The command string for the Perl executable to insert in the
+ #! line of perl scripts that will be publically installed.
+ Default: /usr/bin/env perl
+ Note: the value of this variable is added to the same scripts
+ on all platforms, but it's only relevant on Unix-like platforms.
+
+ RC
+ The name of the rc executable to use. The default will be as
+ defined for the target platform in the ".conf" file. If not
+ defined then "windres" will be used. The WINDRES environment
+ variable is synonymous to this. If both are defined then RC
+ takes precedence.
+
+ RANLIB
+ The name of the ranlib executable to use.
+
+ WINDRES
+ See RC.
+
+ Makefile targets
+ ----------------
+
+ The Configure script generates a Makefile in a format relevant to the specific
+ platform. The Makefiles provide a number of targets that can be used. Not all
+ targets may be available on all platforms. Only the most common targets are
+ described here. Examine the Makefiles themselves for the full list.
+
+ all
+ The default target to build all the software components.
+
+ clean
+ Remove all build artefacts and return the directory to a "clean"
+ state.
+
+ depend
+ Rebuild the dependencies in the Makefiles. This is a legacy
+ option that no longer needs to be used in OpenSSL 1.1.0.
+
+ install
+ Install all OpenSSL components.
+
+ install_sw
+ Only install the OpenSSL software components.
+
+ install_docs
+ Only install the OpenSSL documentation components.
+
+ install_man_docs
+ Only install the OpenSSL man pages (Unix only).
+
+ install_html_docs
+ Only install the OpenSSL html documentation.
+
+ list-tests
+ Prints a list of all the self test names.
+
+ test
+ Build and run the OpenSSL self tests.
+
+ uninstall
+ Uninstall all OpenSSL components.
+
+ update
+ This is a developer option. If you are developing a patch for
+ OpenSSL you may need to use this if you want to update
+ automatically generated files; add new error codes or add new
+ (or change the visibility of) public API functions. (Unix only).
+
+ Note on multi-threading
+ -----------------------
+
+ For some systems, the OpenSSL Configure script knows what compiler options
+ are needed to generate a library that is suitable for multi-threaded
+ applications. On these systems, support for multi-threading is enabled
+ by default; use the "no-threads" option to disable (this should never be
+ necessary).
+
+ On other systems, to enable support for multi-threading, you will have
+ to specify at least two options: "threads", and a system-dependent option.
+ (The latter is "-D_REENTRANT" on various systems.) The default in this
+ case, obviously, is not to include support for multi-threading (but
+ you can still use "no-threads" to suppress an annoying warning message
+ from the Configure script.)
+
+ OpenSSL provides built-in support for two threading models: pthreads (found on
+ most UNIX/Linux systems), and Windows threads. No other threading models are
+ supported. If your platform does not provide pthreads or Windows threads then
+ you should Configure with the "no-threads" option.
+
+ Notes on shared libraries
+ -------------------------
+
+ For most systems the OpenSSL Configure script knows what is needed to
+ build shared libraries for libcrypto and libssl. On these systems
+ the shared libraries will be created by default. This can be suppressed and
+ only static libraries created by using the "no-shared" option. On systems
+ where OpenSSL does not know how to build shared libraries the "no-shared"
+ option will be forced and only static libraries will be created.
+
+ Shared libraries are named a little differently on different platforms.
+ One way or another, they all have the major OpenSSL version number as
+ part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of
+ the name.
+
+ On most POSIXly platforms, shared libraries are named libcrypto.so.1.1
+ and libssl.so.1.1.
+
+ on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll
+ with import libraries libcrypto.dll.a and libssl.dll.a.
+
+ On Windows build with MSVC or using MingW, shared libraries are named
+ libcrypto-1_1.dll and libssl-1_1.dll for 32-bit Windows, libcrypto-1_1-x64.dll
+ and libssl-1_1-x64.dll for 64-bit x86_64 Windows, and libcrypto-1_1-ia64.dll
+ and libssl-1_1-ia64.dll for IA64 Windows. With MSVC, the import libraries
+ are named libcrypto.lib and libssl.lib, while with MingW, they are named
+ libcrypto.dll.a and libssl.dll.a.
+
+ On VMS, shareable images (VMS speak for shared libraries) are named
+ ossl$libcrypto0101_shr.exe and ossl$libssl0101_shr.exe. However, when
+ OpenSSL is specifically built for 32-bit pointers, the shareable images
+ are named ossl$libcrypto0101_shr32.exe and ossl$libssl0101_shr32.exe
+ instead, and when built for 64-bit pointers, they are named
+ ossl$libcrypto0101_shr64.exe and ossl$libssl0101_shr64.exe.
+
+ Note on random number generation
+ --------------------------------
+
+ Availability of cryptographically secure random numbers is required for
+ secret key generation. OpenSSL provides several options to seed the
+ internal PRNG. If not properly seeded, the internal PRNG will refuse
+ to deliver random bytes and a "PRNG not seeded error" will occur.
+ On systems without /dev/urandom (or similar) device, it may be necessary
+ to install additional support software to obtain a random seed.
+ Please check out the manual pages for RAND_add(), RAND_bytes(), RAND_egd(),
+ and the FAQ for more information.
+
diff --git a/openssl-1.1.0h/LICENSE b/openssl-1.1.0h/LICENSE
new file mode 100644
index 0000000..e953f59
--- /dev/null
+++ b/openssl-1.1.0h/LICENSE
@@ -0,0 +1,125 @@
+
+ LICENSE ISSUES
+ ==============
+
+ The OpenSSL toolkit stays under a double license, i.e. both the conditions of
+ the OpenSSL License and the original SSLeay license apply to the toolkit.
+ See below for the actual license texts.
+
+ OpenSSL License
+ ---------------
+
+/* ====================================================================
+ * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ * software must display the following acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ * endorse or promote products derived from this software without
+ * prior written permission. For written permission, please contact
+ * openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ * nor may "OpenSSL" appear in their names without prior written
+ * permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ * acknowledgment:
+ * "This product includes software developed by the OpenSSL Project
+ * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com). This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ *
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to. The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code. The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ *
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * "This product includes cryptographic software written by
+ * Eric Young (eay@cryptsoft.com)"
+ * The word 'cryptographic' can be left out if the rouines from the library
+ * being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from
+ * the apps directory (application code) you must include an acknowledgement:
+ * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed. i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
+
diff --git a/openssl-1.1.0h/Makefile.shared b/openssl-1.1.0h/Makefile.shared
new file mode 100644
index 0000000..4f9550a
--- /dev/null
+++ b/openssl-1.1.0h/Makefile.shared
@@ -0,0 +1,521 @@
+#
+# Helper makefile to link shared libraries in a portable way.
+# This is much simpler than libtool, and hopefully not too error-prone.
+#
+# The following variables need to be set on the command line to build
+# properly
+
+# CC contains the current compiler. This one MUST be defined
+CC=cc
+CFLAGS=$(CFLAG)
+# LDFLAGS contains flags to be used when temporary object files (when building
+# shared libraries) are created, or when an application is linked.
+# SHARED_LDFLAGS contains flags to be used when the shared library is created.
+LDFLAGS=$(LDFLAG)
+SHARED_LDFLAGS=$(SHARED_LDFLAG)
+
+RC=windres
+# SHARED_RCFLAGS are flags used with windres, i.e. when build for Cygwin
+# or Mingw.
+SHARED_RCFLAGS=$(SHARED_RCFLAG)
+
+NM=nm
+
+# LIBNAME contains just the name of the library, without prefix ("lib"
+# on Unix, "cyg" for certain forms under Cygwin...) or suffix (.a, .so,
+# .dll, ...). This one MUST have a value when using this makefile to
+# build shared libraries.
+# For example, to build libfoo.so, you need to do the following:
+#LIBNAME=foo
+LIBNAME=
+
+# STLIBNAME contains the path of the static library to build the shared
+# library from, for example:
+#STLIBNAME=libfoo.a
+STLIBNAME=
+
+# On most Unix platforms, SHLIBNAME contains the path of the short name of
+# the shared library to build, for example
+#SHLIBNAME=libfoo.so
+# On Windows POSIX layers (cygwin and mingw), SHLIBNAME contains the import
+# library name for the shared library to be built, for example:
+#SHLIBNAME=libfoo.dll.a
+
+# SHLIBNAME_FULL contains the path of the full name of the shared library to
+# build, for example:
+#SHLIBNAME_FULL=libfoo.so.1.2
+# When building DSOs, SHLIBNAME_FULL contains path of the full DSO name, for
+# example:
+#SHLIBNAME_FULL=dir/dso.so
+SHLIBNAME_FULL=
+
+# SHLIBVERSION contains the current version of the shared library (not to
+# be confused with the project version)
+#SHLIBVERSION=1.2
+SHLIBVERSION=
+
+# NOTE: to build shared libraries, LIBNAME, STLIBNAME, SHLIBNAME and
+# SHLIBNAME_FULL MUST have values when using this makefile, and in some
+# cases, SHLIBVERSION as well. To build DSOs, SHLIBNAME_FULL MUST have
+# a value, the rest can be left alone.
+
+
+# APPNAME contains just the name of the application, without suffix (""
+# on Unix, ".exe" on Windows, ...). This one MUST have a value when using
+# this makefile to build applications.
+# For example, to build foo, you need to do the following:
+#APPNAME=foo
+APPNAME=
+
+# SRCDIR is the top directory of the source tree.
+SRCDIR=.
+
+# OBJECTS contains all the object files to link together into the application.
+# This must contain at least one object file.
+#OBJECTS=foo.o
+OBJECTS=
+
+# LIBEXTRAS contains extra modules to link together with the library.
+# For example, if a second library, say libbar.a needs to be linked into
+# libfoo.so, you need to do the following:
+#LIBEXTRAS=libbar.a
+# Note that this MUST be used when using the link_dso targets, to hold the
+# names of all object files that go into the target shared object.
+LIBEXTRAS=
+
+# LIBDEPS contains all the flags necessary to cover all necessary
+# dependencies to other libraries.
+LIBDEPS=
+
+#------------------------------------------------------------------------------
+# The rest is private to this makefile.
+
+SET_X=:
+#SET_X=set -x
+
+top:
+ echo "Trying to use this makefile interactively? Don't."
+
+LINK_APP= \
+ ( $(SET_X); \
+ LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
+ LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS) $(LDFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+ echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS}; \
+ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} )
+
+LINK_SO= \
+ ( $(SET_X); \
+ LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
+ SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
+ SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
+ LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+ LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+ echo LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${SHAREDCMD} $${SHAREDFLAGS} \
+ -o $(SHLIBNAME_FULL) \
+ $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS; \
+ LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+ $${SHAREDCMD} $${SHAREDFLAGS} \
+ -o $(SHLIBNAME_FULL) \
+ $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \
+ ) && $(SYMLINK_SO)
+
+SYMLINK_SO= \
+ if [ -n "$$INHIBIT_SYMLINKS" ]; then :; else \
+ if [ -n "$(SHLIBNAME_FULL)" -a -n "$(SHLIBNAME)" -a \
+ "$(SHLIBNAME_FULL)" != "$(SHLIBNAME)" ]; then \
+ ( $(SET_X); \
+ rm -f $(SHLIBNAME); \
+ ln -s $(SHLIBNAME_FULL) $(SHLIBNAME) ); \
+ fi; \
+ fi
+
+LINK_SO_SHLIB= SHOBJECTS="$(STLIBNAME) $(LIBEXTRAS)"; $(LINK_SO)
+LINK_SO_DSO= INHIBIT_SYMLINKS=yes; SHOBJECTS="$(LIBEXTRAS)"; $(LINK_SO)
+
+LINK_SO_SHLIB_VIA_O= \
+ SHOBJECTS=$(STLIBNAME).o; \
+ ALL=$$ALLSYMSFLAGS; ALLSYMSFLAGS=; NOALLSYMSFLAGS=; \
+ ( echo ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL $(STLIBNAME) $(LIBEXTRAS); \
+ ld $(LDFLAGS) -r -o $$SHOBJECTS $$ALL $(STLIBNAME) $(LIBEXTRAS) ); \
+ $(LINK_SO) && ( echo rm -f $$SHOBJECTS; rm -f $$SHOBJECTS )
+
+LINK_SO_SHLIB_UNPACKED= \
+ UNPACKDIR=link_tmp.$$$$; rm -rf $$UNPACKDIR; mkdir $$UNPACKDIR; \
+ (cd $$UNPACKDIR; ar x ../$(STLIBNAME)) && \
+ ([ -z "$(LIBEXTRAS)" ] || cp $(LIBEXTRAS) $$UNPACKDIR) && \
+ SHOBJECTS=$$UNPACKDIR/*.o; \
+ $(LINK_SO) && rm -rf $$UNPACKDIR
+
+DETECT_GNU_LD=($(CC) -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
+
+DO_GNU_SO_COMMON=\
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$(SHLIBNAME_FULL)"
+DO_GNU_DSO=\
+ $(DO_GNU_SO_COMMON)
+DO_GNU_SO=\
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ $(DO_GNU_SO_COMMON)
+DO_GNU_APP=LDFLAGS="$(CFLAGS) $(LDFLAGS)"
+
+#This is rather special. It's a special target with which one can link
+#applications without bothering with any features that have anything to
+#do with shared libraries, for example when linking against static
+#libraries. It's mostly here to avoid a lot of conditionals everywhere
+#else...
+link_app.:
+ $(LINK_APP)
+
+link_dso.gnu:
+ @ $(DO_GNU_DSO); $(LINK_SO_DSO)
+link_shlib.gnu:
+ @ $(DO_GNU_SO); $(LINK_SO_SHLIB)
+link_app.gnu:
+ @ $(DO_GNU_APP); $(LINK_APP)
+
+link_shlib.linux-shared:
+ @$(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
+ $(DO_GNU_SO); \
+ ALLSYMSFLAGS='-Wl,--whole-archive,--version-script=$(LIBNAME).map'; \
+ $(LINK_SO_SHLIB)
+
+link_dso.bsd:
+ @if $(DETECT_GNU_LD); then $(DO_GNU_DSO); else \
+ LIBDEPS=" "; \
+ ALLSYMSFLAGS=; \
+ NOALLSYMSFLAGS=; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
+ fi; $(LINK_SO_DSO)
+link_shlib.bsd:
+ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
+ LIBDEPS=" "; \
+ ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
+ NOALLSYMSFLAGS=; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -nostdlib"; \
+ fi; $(LINK_SO_SHLIB)
+link_app.bsd:
+ @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
+ fi; $(LINK_APP)
+
+# For Darwin AKA Mac OS/X (dyld)
+# Originally link_dso.darwin produced .so, because it was hard-coded
+# in dso_dlfcn module. At later point dso_dlfcn switched to .dylib
+# extension in order to allow for run-time linking with vendor-
+# supplied shared libraries such as libz, so that link_dso.darwin had
+# to be harmonized with it. This caused minor controversy, because
+# it was believed that dlopen can't be used to dynamically load
+# .dylib-s, only so called bundle modules (ones linked with -bundle
+# flag). The belief seems to be originating from pre-10.4 release,
+# where dlfcn functionality was emulated by dlcompat add-on. In
+# 10.4 dlopen was rewritten as native part of dyld and is documented
+# to be capable of loading both dynamic libraries and bundles. In
+# order to provide compatibility with pre-10.4 dlopen, modules are
+# linked with -bundle flag, which makes .dylib extension misleading.
+# It works, because dlopen is [and always was] extension-agnostic.
+# Alternative to this heuristic approach is to develop specific
+# MacOS X dso module relying on whichever "native" dyld interface.
+link_dso.darwin:
+ @ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS="$(CFLAGS) `echo $(SHARED_LDFLAGS) | sed s/dynamiclib/bundle/`"; \
+ $(LINK_SO_DSO)
+link_shlib.darwin:
+ @ ALLSYMSFLAGS='-all_load'; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -current_version $(SHLIBVERSION) -compatibility_version $(SHLIBVERSION) -install_name $(INSTALLTOP)/$(LIBDIR)/$(SHLIBNAME_FULL)"; \
+ $(LINK_SO_SHLIB)
+link_app.darwin: # is there run-path on darwin?
+ $(LINK_APP)
+
+link_dso.cygwin:
+ @ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ base=-Wl,--enable-auto-image-base; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic"; \
+ $(LINK_SO_DSO)
+link_shlib.cygwin:
+ @ INHIBIT_SYMLINKS=yes; \
+ echo "$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) |" \
+ "$(RC) $(SHARED_RCFLAGS) -o rc.o"; \
+ $(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) | \
+ $(RC) $(SHARED_RCFLAGS) -o rc.o; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,--enable-auto-image-base -Wl,-Bsymbolic -Wl,--out-implib,$(SHLIBNAME) rc.o"; \
+ $(LINK_SO_SHLIB) || exit 1; \
+ rm rc.o
+link_app.cygwin:
+ $(LINK_APP)
+
+# link_dso.mingw-shared and link_app.mingw-shared are mapped to the
+# corresponding cygwin targets, as they do the exact same thing.
+link_shlib.mingw:
+ @ INHIBIT_SYMLINKS=yes; \
+ base=; [ $(LIBNAME) = "crypto" -a -n "$(FIPSCANLIB)" ] && base=-Wl,--image-base,0x63000000; \
+ $(PERL) $(SRCDIR)/util/mkdef.pl 32 $(LIBNAME) \
+ | sed -e 's|^\(LIBRARY *\)$(LIBNAME)32|\1$(SHLIBNAME_FULL)|' \
+ > $(LIBNAME).def; \
+ echo "$(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) |" \
+ "$(RC) $(SHARED_RCFLAGS) -o rc.o"; \
+ $(PERL) $(SRCDIR)/util/mkrc.pl $(SHLIBNAME_FULL) | \
+ $(RC) $(SHARED_RCFLAGS) -o rc.o; \
+ ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,$(SHLIBNAME) $(LIBNAME).def rc.o"; \
+ $(LINK_SO_SHLIB) || exit 1; \
+ rm $(LIBNAME).def rc.o
+
+link_dso.alpha-osf1:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_DSO); \
+ else \
+ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic"; \
+ fi; \
+ $(LINK_SO_DSO)
+link_shlib.alpha-osf1:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_SO); \
+ else \
+ ALLSYMSFLAGS='-all'; \
+ NOALLSYMSFLAGS='-none'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-B,symbolic -set_version $(SHLIBVERSION)"; \
+ fi; \
+ $(LINK_SO_SHLIB)
+link_app.alpha-osf1:
+ @if $(DETECT_GNU_LD); then \
+ $(DO_GNU_APP); \
+ else \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
+ fi; \
+ $(LINK_APP)
+
+link_dso.solaris:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_DSO); \
+ else \
+ ALLSYMSFLAGS=""; \
+ NOALLSYMSFLAGS=""; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $(SHLIBNAME_FULL) -Wl,-Bsymbolic"; \
+ fi; \
+ $(LINK_SO_DSO)
+link_shlib.solaris:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_SO); \
+ else \
+ $(PERL) $(SRCDIR)/util/mkdef.pl $(LIBNAME) linux >$(LIBNAME).map; \
+ ALLSYMSFLAGS="-Wl,-z,allextract,-M,$(LIBNAME).map"; \
+ NOALLSYMSFLAGS="-Wl,-z,defaultextract"; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -h $(SHLIBNAME_FULL) -Wl,-Bsymbolic"; \
+ fi; \
+ $(LINK_SO_SHLIB)
+link_app.solaris:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_APP); \
+ else \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
+ fi; \
+ $(LINK_APP)
+
+# OpenServer 5 native compilers used
+link_dso.svr3:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_DSO); \
+ else \
+ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS="$(CFLAGS) -G -h $(SHLIBNAME_FULL)"; \
+ fi; \
+ $(LINK_SO_DSO)
+link_shlib.svr3:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_SO); \
+ else \
+ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS="$(CFLAGS) -G -h $(SHLIBNAME_FULL)"; \
+ fi; \
+ $(LINK_SO_SHLIB_UNPACKED)
+link_app.svr3:
+ @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
+ $(LINK_APP)
+
+# UnixWare 7 and OpenUNIX 8 native compilers used
+link_dso.svr5:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_DSO); \
+ else \
+ SHARE_FLAG='-G'; \
+ ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
+ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $(SHLIBNAME_FULL)"; \
+ fi; \
+ $(LINK_SO_DSO)
+link_shlib.svr5:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_SO); \
+ else \
+ SHARE_FLAG='-G'; \
+ ($(CC) -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
+ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS="$(CFLAGS) $${SHARE_FLAG} -h $(SHLIBNAME_FULL)"; \
+ fi; \
+ $(LINK_SO_SHLIB_UNPACKED)
+link_app.svr5:
+ @$(DETECT_GNU_LD) && $(DO_GNU_APP); \
+ $(LINK_APP)
+
+link_dso.irix:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_DSO); \
+ else \
+ ALLSYMSFLAGS=""; \
+ NOALLSYMSFLAGS=""; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$(SHLIBNAME_FULL),-B,symbolic"; \
+ fi; \
+ $(LINK_SO_DSO)
+link_shlib.irix:
+ @ if $(DETECT_GNU_LD); then \
+ $(DO_GNU_SO); \
+ else \
+ MINUSWL=""; \
+ ($(CC) -v 2>&1 | grep gcc) > /dev/null && MINUSWL="-Wl,"; \
+ ALLSYMSFLAGS="$${MINUSWL}-all"; \
+ NOALLSYMSFLAGS="$${MINUSWL}-none"; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname,$(SHLIBNAME_FULL),-B,symbolic"; \
+ fi; \
+ $(LINK_SO_SHLIB)
+link_app.irix:
+ @LDFLAGS="$(CFLAGS) $(LDFLAGS)"; \
+ $(LINK_APP)
+
+# 32-bit PA-RISC HP-UX embeds the -L pathname of libs we link with, so
+# we compensate for it with +cdp ../: and +cdp ./:. Yes, these rewrite
+# rules imply that we can only link one level down in catalog structure,
+# but that's what takes place for the moment of this writing. +cdp option
+# was introduced in HP-UX 11.x and applies in 32-bit PA-RISC link
+# editor context only [it's simply ignored in other cases, which are all
+# ELFs by the way].
+#
+link_dso.hpux:
+ @if $(DETECT_GNU_LD); then $(DO_GNU_DSO); else \
+ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$(SHLIBNAME_FULL),+cdp,../:,+cdp,./:"; \
+ fi; \
+ rm -f $(SHLIBNAME_FULL) || :; \
+ $(LINK_SO_DSO) && chmod a=rx $(SHLIBNAME_FULL)
+link_shlib.hpux:
+ @if $(DETECT_GNU_LD); then $(DO_GNU_SO); else \
+ ALLSYMSFLAGS='-Wl,-Fl'; \
+ NOALLSYMSFLAGS=''; \
+ expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \
+ SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-B,symbolic,+vnocompatwarnings,-z,+s,+h,$(SHLIBNAME_FULL),+cdp,../:,+cdp,./:"; \
+ fi; \
+ rm -f $(SHLIBNAME_FULL) || :; \
+ $(LINK_SO_SHLIB) && chmod a=rx $(SHLIBNAME_FULL)
+link_app.hpux:
+ @if $(DETECT_GNU_LD); then $(DO_GNU_APP); else \
+ LDFLAGS="$(CFLAGS) $(LDFLAGS) -Wl,+s,+cdp,../:,+cdp,./:"; \
+ fi; \
+ $(LINK_APP)
+
+link_dso.aix:
+ @OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || :; \
+ OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
+ ALLSYMSFLAGS=''; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
+ rm -f $(SHLIBNAME_FULL) 2>&1 > /dev/null ; \
+ $(LINK_SO_DSO);
+link_shlib.aix:
+ @ OBJECT_MODE=`expr "x$(SHARED_LDFLAGS)" : 'x\-[a-z]*\(64\)'` || : ; \
+ OBJECT_MODE=$${OBJECT_MODE:-32}; export OBJECT_MODE; \
+ ALLSYMSFLAGS='-bnogc'; \
+ NOALLSYMSFLAGS=''; \
+ SHAREDFLAGS='$(CFLAGS) $(SHARED_LDFLAGS) -Wl,-bexpall,-bnolibpath,-bM:SRE'; \
+ rm -f $(SHLIBNAME_FULL) 2>&1 > /dev/null ; \
+ $(LINK_SO_SHLIB_VIA_O)
+link_app.aix:
+ LDFLAGS="$(CFLAGS) -Wl,-bsvr4 $(LDFLAGS)"; \
+ $(LINK_APP)
+
+
+# Targets to build symbolic links when needed
+symlink.gnu symlink.solaris symlink.svr3 symlink.svr5 symlink.irix \
+symlink.aix:
+ @ $(SYMLINK_SO)
+symlink.darwin:
+ @ $(SYMLINK_SO)
+symlink.hpux:
+ @ $(SYMLINK_SO)
+# The following lines means those specific architectures do no symlinks
+symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
+
+# Compatibility targets
+link_dso.bsd-gcc-shared link_dso.linux-shared link_dso.gnu-shared: link_dso.gnu
+link_shlib.bsd-gcc-shared: link_shlib.linux-shared
+link_shlib.gnu-shared: link_shlib.gnu
+link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
+symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
+link_dso.bsd-shared: link_dso.bsd
+link_shlib.bsd-shared: link_shlib.bsd
+link_app.bsd-shared: link_app.bsd
+link_dso.darwin-shared: link_dso.darwin
+link_shlib.darwin-shared: link_shlib.darwin
+link_app.darwin-shared: link_app.darwin
+symlink.darwin-shared: symlink.darwin
+link_dso.cygwin-shared: link_dso.cygwin
+link_shlib.cygwin-shared: link_shlib.cygwin
+link_app.cygwin-shared: link_app.cygwin
+symlink.cygwin-shared: symlink.cygwin
+link_dso.mingw-shared: link_dso.cygwin
+link_shlib.mingw-shared: link_shlib.mingw
+link_app.mingw-shared: link_app.cygwin
+symlink.mingw-shared: symlink.cygwin
+link_dso.alpha-osf1-shared: link_dso.alpha-osf1
+link_shlib.alpha-osf1-shared: link_shlib.alpha-osf1
+link_app.alpha-osf1-shared: link_app.alpha-osf1
+symlink.alpha-osf1-shared: symlink.alpha-osf1
+link_dso.tru64-shared: link_dso.tru64
+link_shlib.tru64-shared: link_shlib.tru64
+link_app.tru64-shared: link_app.tru64
+symlink.tru64-shared: symlink.tru64
+link_dso.tru64-shared-rpath: link_dso.tru64-rpath
+link_shlib.tru64-shared-rpath: link_shlib.tru64-rpath
+link_app.tru64-shared-rpath: link_app.tru64-rpath
+symlink.tru64-shared-rpath: symlink.tru64-rpath
+link_dso.solaris-shared: link_dso.solaris
+link_shlib.solaris-shared: link_shlib.solaris
+link_app.solaris-shared: link_app.solaris
+symlink.solaris-shared: symlink.solaris
+link_dso.svr3-shared: link_dso.svr3
+link_shlib.svr3-shared: link_shlib.svr3
+link_app.svr3-shared: link_app.svr3
+symlink.svr3-shared: symlink.svr3
+link_dso.svr5-shared: link_dso.svr5
+link_shlib.svr5-shared: link_shlib.svr5
+link_app.svr5-shared: link_app.svr5
+symlink.svr5-shared: symlink.svr5
+link_dso.irix-shared: link_dso.irix
+link_shlib.irix-shared: link_shlib.irix
+link_app.irix-shared: link_app.irix
+symlink.irix-shared: symlink.irix
+link_dso.hpux-shared: link_dso.hpux
+link_shlib.hpux-shared: link_shlib.hpux
+link_app.hpux-shared: link_app.hpux
+symlink.hpux-shared: symlink.hpux
+link_dso.aix-shared: link_dso.aix
+link_shlib.aix-shared: link_shlib.aix
+link_app.aix-shared: link_app.aix
+symlink.aix-shared: symlink.aix
diff --git a/openssl-1.1.0h/NEWS b/openssl-1.1.0h/NEWS
new file mode 100644
index 0000000..8744fe6
--- /dev/null
+++ b/openssl-1.1.0h/NEWS
@@ -0,0 +1,868 @@
+
+ NEWS
+ ====
+
+ This file gives a brief overview of the major changes between each OpenSSL
+ release. For more details please read the CHANGES file.
+
+ Major changes between OpenSSL 1.1.0g and OpenSSL 1.1.0h [27 Mar 2018]
+
+ o Constructed ASN.1 types with a recursive definition could exceed the
+ stack (CVE-2018-0739)
+ o Incorrect CRYPTO_memcmp on HP-UX PA-RISC (CVE-2018-0733)
+ o rsaz_1024_mul_avx2 overflow bug on x86_64 (CVE-2017-3738)
+
+ Major changes between OpenSSL 1.1.0f and OpenSSL 1.1.0g [2 Nov 2017]
+
+ o bn_sqrx8x_internal carry bug on x86_64 (CVE-2017-3736)
+ o Malformed X.509 IPAddressFamily could cause OOB read (CVE-2017-3735)
+
+ Major changes between OpenSSL 1.1.0e and OpenSSL 1.1.0f [25 May 2017]
+
+ o config now recognises 64-bit mingw and chooses mingw64 instead of mingw
+
+ Major changes between OpenSSL 1.1.0d and OpenSSL 1.1.0e [16 Feb 2017]
+
+ o Encrypt-Then-Mac renegotiation crash (CVE-2017-3733)
+
+ Major changes between OpenSSL 1.1.0c and OpenSSL 1.1.0d [26 Jan 2017]
+
+ o Truncated packet could crash via OOB read (CVE-2017-3731)
+ o Bad (EC)DHE parameters cause a client crash (CVE-2017-3730)
+ o BN_mod_exp may produce incorrect results on x86_64 (CVE-2017-3732)
+
+ Major changes between OpenSSL 1.1.0b and OpenSSL 1.1.0c [10 Nov 2016]
+
+ o ChaCha20/Poly1305 heap-buffer-overflow (CVE-2016-7054)
+ o CMS Null dereference (CVE-2016-7053)
+ o Montgomery multiplication may produce incorrect results (CVE-2016-7055)
+
+ Major changes between OpenSSL 1.1.0a and OpenSSL 1.1.0b [26 Sep 2016]
+
+ o Fix Use After Free for large message sizes (CVE-2016-6309)
+
+ Major changes between OpenSSL 1.1.0 and OpenSSL 1.1.0a [22 Sep 2016]
+
+ o OCSP Status Request extension unbounded memory growth (CVE-2016-6304)
+ o SSL_peek() hang on empty record (CVE-2016-6305)
+ o Excessive allocation of memory in tls_get_message_header()
+ (CVE-2016-6307)
+ o Excessive allocation of memory in dtls1_preprocess_fragment()
+ (CVE-2016-6308)
+
+ Major changes between OpenSSL 1.0.2h and OpenSSL 1.1.0 [25 Aug 2016]
+
+ o Copyright text was shrunk to a boilerplate that points to the license
+ o "shared" builds are now the default when possible
+ o Added support for "pipelining"
+ o Added the AFALG engine
+ o New threading API implemented
+ o Support for ChaCha20 and Poly1305 added to libcrypto and libssl
+ o Support for extended master secret
+ o CCM ciphersuites
+ o Reworked test suite, now based on perl, Test::Harness and Test::More
+ o *Most* libcrypto and libssl public structures were made opaque,
+ including:
+ BIGNUM and associated types, EC_KEY and EC_KEY_METHOD,
+ DH and DH_METHOD, DSA and DSA_METHOD, RSA and RSA_METHOD,
+ BIO and BIO_METHOD, EVP_MD_CTX, EVP_MD, EVP_CIPHER_CTX,
+ EVP_CIPHER, EVP_PKEY and associated types, HMAC_CTX,
+ X509, X509_CRL, X509_OBJECT, X509_STORE_CTX, X509_STORE,
+ X509_LOOKUP, X509_LOOKUP_METHOD
+ o libssl internal structures made opaque
+ o SSLv2 support removed
+ o Kerberos ciphersuite support removed
+ o RC4 removed from DEFAULT ciphersuites in libssl
+ o 40 and 56 bit cipher support removed from libssl
+ o All public header files moved to include/openssl, no more symlinking
+ o SSL/TLS state machine, version negotiation and record layer rewritten
+ o EC revision: now operations use new EC_KEY_METHOD.
+ o Support for OCB mode added to libcrypto
+ o Support for asynchronous crypto operations added to libcrypto and libssl
+ o Deprecated interfaces can now be disabled at build time either
+ relative to the latest release via the "no-deprecated" Configure
+ argument, or via the "--api=1.1.0|1.0.0|0.9.8" option.
+ o Application software can be compiled with -DOPENSSL_API_COMPAT=version
+ to ensure that features deprecated in that version are not exposed.
+ o Support for RFC6698/RFC7671 DANE TLSA peer authentication
+ o Change of Configure to use --prefix as the main installation
+ directory location rather than --openssldir. The latter becomes
+ the directory for certs, private key and openssl.cnf exclusively.
+ o Reworked BIO networking library, with full support for IPv6.
+ o New "unified" build system
+ o New security levels
+ o Support for scrypt algorithm
+ o Support for X25519
+ o Extended SSL_CONF support using configuration files
+ o KDF algorithm support. Implement TLS PRF as a KDF.
+ o Support for Certificate Transparency
+ o HKDF support.
+
+ Major changes between OpenSSL 1.0.2g and OpenSSL 1.0.2h [3 May 2016]
+
+ o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107)
+ o Fix EVP_EncodeUpdate overflow (CVE-2016-2105)
+ o Fix EVP_EncryptUpdate overflow (CVE-2016-2106)
+ o Prevent ASN.1 BIO excessive memory allocation (CVE-2016-2109)
+ o EBCDIC overread (CVE-2016-2176)
+ o Modify behavior of ALPN to invoke callback after SNI/servername
+ callback, such that updates to the SSL_CTX affect ALPN.
+ o Remove LOW from the DEFAULT cipher list. This removes singles DES from
+ the default.
+ o Only remove the SSLv2 methods with the no-ssl2-method option.
+
+ Major changes between OpenSSL 1.0.2f and OpenSSL 1.0.2g [1 Mar 2016]
+
+ o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.
+ o Disable SSLv2 default build, default negotiation and weak ciphers
+ (CVE-2016-0800)
+ o Fix a double-free in DSA code (CVE-2016-0705)
+ o Disable SRP fake user seed to address a server memory leak
+ (CVE-2016-0798)
+ o Fix BN_hex2bn/BN_dec2bn NULL pointer deref/heap corruption
+ (CVE-2016-0797)
+ o Fix memory issues in BIO_*printf functions (CVE-2016-0799)
+ o Fix side channel attack on modular exponentiation (CVE-2016-0702)
+
+ Major changes between OpenSSL 1.0.2e and OpenSSL 1.0.2f [28 Jan 2016]
+
+ o DH small subgroups (CVE-2016-0701)
+ o SSLv2 doesn't block disabled ciphers (CVE-2015-3197)
+
+ Major changes between OpenSSL 1.0.2d and OpenSSL 1.0.2e [3 Dec 2015]
+
+ o BN_mod_exp may produce incorrect results on x86_64 (CVE-2015-3193)
+ o Certificate verify crash with missing PSS parameter (CVE-2015-3194)
+ o X509_ATTRIBUTE memory leak (CVE-2015-3195)
+ o Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs
+ o In DSA_generate_parameters_ex, if the provided seed is too short,
+ return an error
+
+ Major changes between OpenSSL 1.0.2c and OpenSSL 1.0.2d [9 Jul 2015]
+
+ o Alternate chains certificate forgery (CVE-2015-1793)
+ o Race condition handling PSK identify hint (CVE-2015-3196)
+
+ Major changes between OpenSSL 1.0.2b and OpenSSL 1.0.2c [12 Jun 2015]
+
+ o Fix HMAC ABI incompatibility
+
+ Major changes between OpenSSL 1.0.2a and OpenSSL 1.0.2b [11 Jun 2015]
+
+ o Malformed ECParameters causes infinite loop (CVE-2015-1788)
+ o Exploitable out-of-bounds read in X509_cmp_time (CVE-2015-1789)
+ o PKCS7 crash with missing EnvelopedContent (CVE-2015-1790)
+ o CMS verify infinite loop with unknown hash function (CVE-2015-1792)
+ o Race condition handling NewSessionTicket (CVE-2015-1791)
+
+ Major changes between OpenSSL 1.0.2 and OpenSSL 1.0.2a [19 Mar 2015]
+
+ o OpenSSL 1.0.2 ClientHello sigalgs DoS fix (CVE-2015-0291)
+ o Multiblock corrupted pointer fix (CVE-2015-0290)
+ o Segmentation fault in DTLSv1_listen fix (CVE-2015-0207)
+ o Segmentation fault in ASN1_TYPE_cmp fix (CVE-2015-0286)
+ o Segmentation fault for invalid PSS parameters fix (CVE-2015-0208)
+ o ASN.1 structure reuse memory corruption fix (CVE-2015-0287)
+ o PKCS7 NULL pointer dereferences fix (CVE-2015-0289)
+ o DoS via reachable assert in SSLv2 servers fix (CVE-2015-0293)
+ o Empty CKE with client auth and DHE fix (CVE-2015-1787)
+ o Handshake with unseeded PRNG fix (CVE-2015-0285)
+ o Use After Free following d2i_ECPrivatekey error fix (CVE-2015-0209)
+ o X509_to_X509_REQ NULL pointer deref fix (CVE-2015-0288)
+ o Removed the export ciphers from the DEFAULT ciphers
+
+ Major changes between OpenSSL 1.0.1l and OpenSSL 1.0.2 [22 Jan 2015]:
+
+ o Suite B support for TLS 1.2 and DTLS 1.2
+ o Support for DTLS 1.2
+ o TLS automatic EC curve selection.
+ o API to set TLS supported signature algorithms and curves
+ o SSL_CONF configuration API.
+ o TLS Brainpool support.
+ o ALPN support.
+ o CMS support for RSA-PSS, RSA-OAEP, ECDH and X9.42 DH.
+
+ Major changes between OpenSSL 1.0.1k and OpenSSL 1.0.1l [15 Jan 2015]
+
+ o Build fixes for the Windows and OpenVMS platforms
+
+ Major changes between OpenSSL 1.0.1j and OpenSSL 1.0.1k [8 Jan 2015]
+
+ o Fix for CVE-2014-3571
+ o Fix for CVE-2015-0206
+ o Fix for CVE-2014-3569
+ o Fix for CVE-2014-3572
+ o Fix for CVE-2015-0204
+ o Fix for CVE-2015-0205
+ o Fix for CVE-2014-8275
+ o Fix for CVE-2014-3570
+
+ Major changes between OpenSSL 1.0.1i and OpenSSL 1.0.1j [15 Oct 2014]
+
+ o Fix for CVE-2014-3513
+ o Fix for CVE-2014-3567
+ o Mitigation for CVE-2014-3566 (SSL protocol vulnerability)
+ o Fix for CVE-2014-3568
+
+ Major changes between OpenSSL 1.0.1h and OpenSSL 1.0.1i [6 Aug 2014]
+
+ o Fix for CVE-2014-3512
+ o Fix for CVE-2014-3511
+ o Fix for CVE-2014-3510
+ o Fix for CVE-2014-3507
+ o Fix for CVE-2014-3506
+ o Fix for CVE-2014-3505
+ o Fix for CVE-2014-3509
+ o Fix for CVE-2014-5139
+ o Fix for CVE-2014-3508
+
+ Major changes between OpenSSL 1.0.1g and OpenSSL 1.0.1h [5 Jun 2014]
+
+ o Fix for CVE-2014-0224
+ o Fix for CVE-2014-0221
+ o Fix for CVE-2014-0198
+ o Fix for CVE-2014-0195
+ o Fix for CVE-2014-3470
+ o Fix for CVE-2010-5298
+
+ Major changes between OpenSSL 1.0.1f and OpenSSL 1.0.1g [7 Apr 2014]
+
+ o Fix for CVE-2014-0160
+ o Add TLS padding extension workaround for broken servers.
+ o Fix for CVE-2014-0076
+
+ Major changes between OpenSSL 1.0.1e and OpenSSL 1.0.1f [6 Jan 2014]
+
+ o Don't include gmt_unix_time in TLS server and client random values
+ o Fix for TLS record tampering bug CVE-2013-4353
+ o Fix for TLS version checking bug CVE-2013-6449
+ o Fix for DTLS retransmission bug CVE-2013-6450
+
+ Major changes between OpenSSL 1.0.1d and OpenSSL 1.0.1e [11 Feb 2013]:
+
+ o Corrected fix for CVE-2013-0169
+
+ Major changes between OpenSSL 1.0.1c and OpenSSL 1.0.1d [4 Feb 2013]:
+
+ o Fix renegotiation in TLS 1.1, 1.2 by using the correct TLS version.
+ o Include the fips configuration module.
+ o Fix OCSP bad key DoS attack CVE-2013-0166
+ o Fix for SSL/TLS/DTLS CBC plaintext recovery attack CVE-2013-0169
+ o Fix for TLS AESNI record handling flaw CVE-2012-2686
+
+ Major changes between OpenSSL 1.0.1b and OpenSSL 1.0.1c [10 May 2012]:
+
+ o Fix TLS/DTLS record length checking bug CVE-2012-2333
+ o Don't attempt to use non-FIPS composite ciphers in FIPS mode.
+
+ Major changes between OpenSSL 1.0.1a and OpenSSL 1.0.1b [26 Apr 2012]:
+
+ o Fix compilation error on non-x86 platforms.
+ o Make FIPS capable OpenSSL ciphers work in non-FIPS mode.
+ o Fix SSL_OP_NO_TLSv1_1 clash with SSL_OP_ALL in OpenSSL 1.0.0
+
+ Major changes between OpenSSL 1.0.1 and OpenSSL 1.0.1a [19 Apr 2012]:
+
+ o Fix for ASN1 overflow bug CVE-2012-2110
+ o Workarounds for some servers that hang on long client hellos.
+ o Fix SEGV in AES code.
+
+ Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1 [14 Mar 2012]:
+
+ o TLS/DTLS heartbeat support.
+ o SCTP support.
+ o RFC 5705 TLS key material exporter.
+ o RFC 5764 DTLS-SRTP negotiation.
+ o Next Protocol Negotiation.
+ o PSS signatures in certificates, requests and CRLs.
+ o Support for password based recipient info for CMS.
+ o Support TLS v1.2 and TLS v1.1.
+ o Preliminary FIPS capability for unvalidated 2.0 FIPS module.
+ o SRP support.
+
+ Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h [12 Mar 2012]:
+
+ o Fix for CMS/PKCS#7 MMA CVE-2012-0884
+ o Corrected fix for CVE-2011-4619
+ o Various DTLS fixes.
+
+ Major changes between OpenSSL 1.0.0f and OpenSSL 1.0.0g [18 Jan 2012]:
+
+ o Fix for DTLS DoS issue CVE-2012-0050
+
+ Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f [4 Jan 2012]:
+
+ o Fix for DTLS plaintext recovery attack CVE-2011-4108
+ o Clear block padding bytes of SSL 3.0 records CVE-2011-4576
+ o Only allow one SGC handshake restart for SSL/TLS CVE-2011-4619
+ o Check parameters are not NULL in GOST ENGINE CVE-2012-0027
+ o Check for malformed RFC3779 data CVE-2011-4577
+
+ Major changes between OpenSSL 1.0.0d and OpenSSL 1.0.0e [6 Sep 2011]:
+
+ o Fix for CRL vulnerability issue CVE-2011-3207
+ o Fix for ECDH crashes CVE-2011-3210
+ o Protection against EC timing attacks.
+ o Support ECDH ciphersuites for certificates using SHA2 algorithms.
+ o Various DTLS fixes.
+
+ Major changes between OpenSSL 1.0.0c and OpenSSL 1.0.0d [8 Feb 2011]:
+
+ o Fix for security issue CVE-2011-0014
+
+ Major changes between OpenSSL 1.0.0b and OpenSSL 1.0.0c [2 Dec 2010]:
+
+ o Fix for security issue CVE-2010-4180
+ o Fix for CVE-2010-4252
+ o Fix mishandling of absent EC point format extension.
+ o Fix various platform compilation issues.
+ o Corrected fix for security issue CVE-2010-3864.
+
+ Major changes between OpenSSL 1.0.0a and OpenSSL 1.0.0b [16 Nov 2010]:
+
+ o Fix for security issue CVE-2010-3864.
+ o Fix for CVE-2010-2939
+ o Fix WIN32 build system for GOST ENGINE.
+
+ Major changes between OpenSSL 1.0.0 and OpenSSL 1.0.0a [1 Jun 2010]:
+
+ o Fix for security issue CVE-2010-1633.
+ o GOST MAC and CFB fixes.
+
+ Major changes between OpenSSL 0.9.8n and OpenSSL 1.0.0 [29 Mar 2010]:
+
+ o RFC3280 path validation: sufficient to process PKITS tests.
+ o Integrated support for PVK files and keyblobs.
+ o Change default private key format to PKCS#8.
+ o CMS support: able to process all examples in RFC4134
+ o Streaming ASN1 encode support for PKCS#7 and CMS.
+ o Multiple signer and signer add support for PKCS#7 and CMS.
+ o ASN1 printing support.
+ o Whirlpool hash algorithm added.
+ o RFC3161 time stamp support.
+ o New generalised public key API supporting ENGINE based algorithms.
+ o New generalised public key API utilities.
+ o New ENGINE supporting GOST algorithms.
+ o SSL/TLS GOST ciphersuite support.
+ o PKCS#7 and CMS GOST support.
+ o RFC4279 PSK ciphersuite support.
+ o Supported points format extension for ECC ciphersuites.
+ o ecdsa-with-SHA224/256/384/512 signature types.
+ o dsa-with-SHA224 and dsa-with-SHA256 signature types.
+ o Opaque PRF Input TLS extension support.
+ o Updated time routines to avoid OS limitations.
+
+ Major changes between OpenSSL 0.9.8m and OpenSSL 0.9.8n [24 Mar 2010]:
+
+ o CFB cipher definition fixes.
+ o Fix security issues CVE-2010-0740 and CVE-2010-0433.
+
+ Major changes between OpenSSL 0.9.8l and OpenSSL 0.9.8m [25 Feb 2010]:
+
+ o Cipher definition fixes.
+ o Workaround for slow RAND_poll() on some WIN32 versions.
+ o Remove MD2 from algorithm tables.
+ o SPKAC handling fixes.
+ o Support for RFC5746 TLS renegotiation extension.
+ o Compression memory leak fixed.
+ o Compression session resumption fixed.
+ o Ticket and SNI coexistence fixes.
+ o Many fixes to DTLS handling.
+
+ Major changes between OpenSSL 0.9.8k and OpenSSL 0.9.8l [5 Nov 2009]:
+
+ o Temporary work around for CVE-2009-3555: disable renegotiation.
+
+ Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k [25 Mar 2009]:
+
+ o Fix various build issues.
+ o Fix security issues (CVE-2009-0590, CVE-2009-0591, CVE-2009-0789)
+
+ Major changes between OpenSSL 0.9.8i and OpenSSL 0.9.8j [7 Jan 2009]:
+
+ o Fix security issue (CVE-2008-5077)
+ o Merge FIPS 140-2 branch code.
+
+ Major changes between OpenSSL 0.9.8g and OpenSSL 0.9.8h [28 May 2008]:
+
+ o CryptoAPI ENGINE support.
+ o Various precautionary measures.
+ o Fix for bugs affecting certificate request creation.
+ o Support for local machine keyset attribute in PKCS#12 files.
+
+ Major changes between OpenSSL 0.9.8f and OpenSSL 0.9.8g [19 Oct 2007]:
+
+ o Backport of CMS functionality to 0.9.8.
+ o Fixes for bugs introduced with 0.9.8f.
+
+ Major changes between OpenSSL 0.9.8e and OpenSSL 0.9.8f [11 Oct 2007]:
+
+ o Add gcc 4.2 support.
+ o Add support for AES and SSE2 assembly language optimization
+ for VC++ build.
+ o Support for RFC4507bis and server name extensions if explicitly
+ selected at compile time.
+ o DTLS improvements.
+ o RFC4507bis support.
+ o TLS Extensions support.
+
+ Major changes between OpenSSL 0.9.8d and OpenSSL 0.9.8e [23 Feb 2007]:
+
+ o Various ciphersuite selection fixes.
+ o RFC3779 support.
+
+ Major changes between OpenSSL 0.9.8c and OpenSSL 0.9.8d [28 Sep 2006]:
+
+ o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
+ o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
+ o Changes to ciphersuite selection algorithm
+
+ Major changes between OpenSSL 0.9.8b and OpenSSL 0.9.8c [5 Sep 2006]:
+
+ o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
+ o New cipher Camellia
+
+ Major changes between OpenSSL 0.9.8a and OpenSSL 0.9.8b [4 May 2006]:
+
+ o Cipher string fixes.
+ o Fixes for VC++ 2005.
+ o Updated ECC cipher suite support.
+ o New functions EVP_CIPHER_CTX_new() and EVP_CIPHER_CTX_free().
+ o Zlib compression usage fixes.
+ o Built in dynamic engine compilation support on Win32.
+ o Fixes auto dynamic engine loading in Win32.
+
+ Major changes between OpenSSL 0.9.8 and OpenSSL 0.9.8a [11 Oct 2005]:
+
+ o Fix potential SSL 2.0 rollback, CVE-2005-2969
+ o Extended Windows CE support
+
+ Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.8 [5 Jul 2005]:
+
+ o Major work on the BIGNUM library for higher efficiency and to
+ make operations more streamlined and less contradictory. This
+ is the result of a major audit of the BIGNUM library.
+ o Addition of BIGNUM functions for fields GF(2^m) and NIST
+ curves, to support the Elliptic Crypto functions.
+ o Major work on Elliptic Crypto; ECDH and ECDSA added, including
+ the use through EVP, X509 and ENGINE.
+ o New ASN.1 mini-compiler that's usable through the OpenSSL
+ configuration file.
+ o Added support for ASN.1 indefinite length constructed encoding.
+ o New PKCS#12 'medium level' API to manipulate PKCS#12 files.
+ o Complete rework of shared library construction and linking
+ programs with shared or static libraries, through a separate
+ Makefile.shared.
+ o Rework of the passing of parameters from one Makefile to another.
+ o Changed ENGINE framework to load dynamic engine modules
+ automatically from specifically given directories.
+ o New structure and ASN.1 functions for CertificatePair.
+ o Changed the ZLIB compression method to be stateful.
+ o Changed the key-generation and primality testing "progress"
+ mechanism to take a structure that contains the ticker
+ function and an argument.
+ o New engine module: GMP (performs private key exponentiation).
+ o New engine module: VIA PadLOck ACE extension in VIA C3
+ Nehemiah processors.
+ o Added support for IPv6 addresses in certificate extensions.
+ See RFC 1884, section 2.2.
+ o Added support for certificate policy mappings, policy
+ constraints and name constraints.
+ o Added support for multi-valued AVAs in the OpenSSL
+ configuration file.
+ o Added support for multiple certificates with the same subject
+ in the 'openssl ca' index file.
+ o Make it possible to create self-signed certificates using
+ 'openssl ca -selfsign'.
+ o Make it possible to generate a serial number file with
+ 'openssl ca -create_serial'.
+ o New binary search functions with extended functionality.
+ o New BUF functions.
+ o New STORE structure and library to provide an interface to all
+ sorts of data repositories. Supports storage of public and
+ private keys, certificates, CRLs, numbers and arbitrary blobs.
+ This library is unfortunately unfinished and unused within
+ OpenSSL.
+ o New control functions for the error stack.
+ o Changed the PKCS#7 library to support one-pass S/MIME
+ processing.
+ o Added the possibility to compile without old deprecated
+ functionality with the OPENSSL_NO_DEPRECATED macro or the
+ 'no-deprecated' argument to the config and Configure scripts.
+ o Constification of all ASN.1 conversion functions, and other
+ affected functions.
+ o Improved platform support for PowerPC.
+ o New FIPS 180-2 algorithms (SHA-224, -256, -384 and -512).
+ o New X509_VERIFY_PARAM structure to support parametrisation
+ of X.509 path validation.
+ o Major overhaul of RC4 performance on Intel P4, IA-64 and
+ AMD64.
+ o Changed the Configure script to have some algorithms disabled
+ by default. Those can be explicitly enabled with the new
+ argument form 'enable-xxx'.
+ o Change the default digest in 'openssl' commands from MD5 to
+ SHA-1.
+ o Added support for DTLS.
+ o New BIGNUM blinding.
+ o Added support for the RSA-PSS encryption scheme
+ o Added support for the RSA X.931 padding.
+ o Added support for BSD sockets on NetWare.
+ o Added support for files larger than 2GB.
+ o Added initial support for Win64.
+ o Added alternate pkg-config files.
+
+ Major changes between OpenSSL 0.9.7l and OpenSSL 0.9.7m [23 Feb 2007]:
+
+ o FIPS 1.1.1 module linking.
+ o Various ciphersuite selection fixes.
+
+ Major changes between OpenSSL 0.9.7k and OpenSSL 0.9.7l [28 Sep 2006]:
+
+ o Introduce limits to prevent malicious key DoS (CVE-2006-2940)
+ o Fix security issues (CVE-2006-2937, CVE-2006-3737, CVE-2006-4343)
+
+ Major changes between OpenSSL 0.9.7j and OpenSSL 0.9.7k [5 Sep 2006]:
+
+ o Fix Daniel Bleichenbacher forged signature attack, CVE-2006-4339
+
+ Major changes between OpenSSL 0.9.7i and OpenSSL 0.9.7j [4 May 2006]:
+
+ o Visual C++ 2005 fixes.
+ o Update Windows build system for FIPS.
+
+ Major changes between OpenSSL 0.9.7h and OpenSSL 0.9.7i [14 Oct 2005]:
+
+ o Give EVP_MAX_MD_SIZE it's old value, except for a FIPS build.
+
+ Major changes between OpenSSL 0.9.7g and OpenSSL 0.9.7h [11 Oct 2005]:
+
+ o Fix SSL 2.0 Rollback, CVE-2005-2969
+ o Allow use of fixed-length exponent on DSA signing
+ o Default fixed-window RSA, DSA, DH private-key operations
+
+ Major changes between OpenSSL 0.9.7f and OpenSSL 0.9.7g [11 Apr 2005]:
+
+ o More compilation issues fixed.
+ o Adaptation to more modern Kerberos API.
+ o Enhanced or corrected configuration for Solaris64, Mingw and Cygwin.
+ o Enhanced x86_64 assembler BIGNUM module.
+ o More constification.
+ o Added processing of proxy certificates (RFC 3820).
+
+ Major changes between OpenSSL 0.9.7e and OpenSSL 0.9.7f [22 Mar 2005]:
+
+ o Several compilation issues fixed.
+ o Many memory allocation failure checks added.
+ o Improved comparison of X509 Name type.
+ o Mandatory basic checks on certificates.
+ o Performance improvements.
+
+ Major changes between OpenSSL 0.9.7d and OpenSSL 0.9.7e [25 Oct 2004]:
+
+ o Fix race condition in CRL checking code.
+ o Fixes to PKCS#7 (S/MIME) code.
+
+ Major changes between OpenSSL 0.9.7c and OpenSSL 0.9.7d [17 Mar 2004]:
+
+ o Security: Fix Kerberos ciphersuite SSL/TLS handshaking bug
+ o Security: Fix null-pointer assignment in do_change_cipher_spec()
+ o Allow multiple active certificates with same subject in CA index
+ o Multiple X509 verification fixes
+ o Speed up HMAC and other operations
+
+ Major changes between OpenSSL 0.9.7b and OpenSSL 0.9.7c [30 Sep 2003]:
+
+ o Security: fix various ASN1 parsing bugs.
+ o New -ignore_err option to OCSP utility.
+ o Various interop and bug fixes in S/MIME code.
+ o SSL/TLS protocol fix for unrequested client certificates.
+
+ Major changes between OpenSSL 0.9.7a and OpenSSL 0.9.7b [10 Apr 2003]:
+
+ o Security: counter the Klima-Pokorny-Rosa extension of
+ Bleichbacher's attack
+ o Security: make RSA blinding default.
+ o Configuration: Irix fixes, AIX fixes, better mingw support.
+ o Support for new platforms: linux-ia64-ecc.
+ o Build: shared library support fixes.
+ o ASN.1: treat domainComponent correctly.
+ o Documentation: fixes and additions.
+
+ Major changes between OpenSSL 0.9.7 and OpenSSL 0.9.7a [19 Feb 2003]:
+
+ o Security: Important security related bugfixes.
+ o Enhanced compatibility with MIT Kerberos.
+ o Can be built without the ENGINE framework.
+ o IA32 assembler enhancements.
+ o Support for new platforms: FreeBSD/IA64 and FreeBSD/Sparc64.
+ o Configuration: the no-err option now works properly.
+ o SSL/TLS: now handles manual certificate chain building.
+ o SSL/TLS: certain session ID malfunctions corrected.
+
+ Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.7 [30 Dec 2002]:
+
+ o New library section OCSP.
+ o Complete rewrite of ASN1 code.
+ o CRL checking in verify code and openssl utility.
+ o Extension copying in 'ca' utility.
+ o Flexible display options in 'ca' utility.
+ o Provisional support for international characters with UTF8.
+ o Support for external crypto devices ('engine') is no longer
+ a separate distribution.
+ o New elliptic curve library section.
+ o New AES (Rijndael) library section.
+ o Support for new platforms: Windows CE, Tandem OSS, A/UX, AIX 64-bit,
+ Linux x86_64, Linux 64-bit on Sparc v9
+ o Extended support for some platforms: VxWorks
+ o Enhanced support for shared libraries.
+ o Now only builds PIC code when shared library support is requested.
+ o Support for pkg-config.
+ o Lots of new manuals.
+ o Makes symbolic links to or copies of manuals to cover all described
+ functions.
+ o Change DES API to clean up the namespace (some applications link also
+ against libdes providing similar functions having the same name).
+ Provide macros for backward compatibility (will be removed in the
+ future).
+ o Unify handling of cryptographic algorithms (software and engine)
+ to be available via EVP routines for asymmetric and symmetric ciphers.
+ o NCONF: new configuration handling routines.
+ o Change API to use more 'const' modifiers to improve error checking
+ and help optimizers.
+ o Finally remove references to RSAref.
+ o Reworked parts of the BIGNUM code.
+ o Support for new engines: Broadcom ubsec, Accelerated Encryption
+ Processing, IBM 4758.
+ o A few new engines added in the demos area.
+ o Extended and corrected OID (object identifier) table.
+ o PRNG: query at more locations for a random device, automatic query for
+ EGD style random sources at several locations.
+ o SSL/TLS: allow optional cipher choice according to server's preference.
+ o SSL/TLS: allow server to explicitly set new session ids.
+ o SSL/TLS: support Kerberos cipher suites (RFC2712).
+ Only supports MIT Kerberos for now.
+ o SSL/TLS: allow more precise control of renegotiations and sessions.
+ o SSL/TLS: add callback to retrieve SSL/TLS messages.
+ o SSL/TLS: support AES cipher suites (RFC3268).
+
+ Major changes between OpenSSL 0.9.6j and OpenSSL 0.9.6k [30 Sep 2003]:
+
+ o Security: fix various ASN1 parsing bugs.
+ o SSL/TLS protocol fix for unrequested client certificates.
+
+ Major changes between OpenSSL 0.9.6i and OpenSSL 0.9.6j [10 Apr 2003]:
+
+ o Security: counter the Klima-Pokorny-Rosa extension of
+ Bleichbacher's attack
+ o Security: make RSA blinding default.
+ o Build: shared library support fixes.
+
+ Major changes between OpenSSL 0.9.6h and OpenSSL 0.9.6i [19 Feb 2003]:
+
+ o Important security related bugfixes.
+
+ Major changes between OpenSSL 0.9.6g and OpenSSL 0.9.6h [5 Dec 2002]:
+
+ o New configuration targets for Tandem OSS and A/UX.
+ o New OIDs for Microsoft attributes.
+ o Better handling of SSL session caching.
+ o Better comparison of distinguished names.
+ o Better handling of shared libraries in a mixed GNU/non-GNU environment.
+ o Support assembler code with Borland C.
+ o Fixes for length problems.
+ o Fixes for uninitialised variables.
+ o Fixes for memory leaks, some unusual crashes and some race conditions.
+ o Fixes for smaller building problems.
+ o Updates of manuals, FAQ and other instructive documents.
+
+ Major changes between OpenSSL 0.9.6f and OpenSSL 0.9.6g [9 Aug 2002]:
+
+ o Important building fixes on Unix.
+
+ Major changes between OpenSSL 0.9.6e and OpenSSL 0.9.6f [8 Aug 2002]:
+
+ o Various important bugfixes.
+
+ Major changes between OpenSSL 0.9.6d and OpenSSL 0.9.6e [30 Jul 2002]:
+
+ o Important security related bugfixes.
+ o Various SSL/TLS library bugfixes.
+
+ Major changes between OpenSSL 0.9.6c and OpenSSL 0.9.6d [9 May 2002]:
+
+ o Various SSL/TLS library bugfixes.
+ o Fix DH parameter generation for 'non-standard' generators.
+
+ Major changes between OpenSSL 0.9.6b and OpenSSL 0.9.6c [21 Dec 2001]:
+
+ o Various SSL/TLS library bugfixes.
+ o BIGNUM library fixes.
+ o RSA OAEP and random number generation fixes.
+ o Object identifiers corrected and added.
+ o Add assembler BN routines for IA64.
+ o Add support for OS/390 Unix, UnixWare with gcc, OpenUNIX 8,
+ MIPS Linux; shared library support for Irix, HP-UX.
+ o Add crypto accelerator support for AEP, Baltimore SureWare,
+ Broadcom and Cryptographic Appliance's keyserver
+ [in 0.9.6c-engine release].
+
+ Major changes between OpenSSL 0.9.6a and OpenSSL 0.9.6b [9 Jul 2001]:
+
+ o Security fix: PRNG improvements.
+ o Security fix: RSA OAEP check.
+ o Security fix: Reinsert and fix countermeasure to Bleichbacher's
+ attack.
+ o MIPS bug fix in BIGNUM.
+ o Bug fix in "openssl enc".
+ o Bug fix in X.509 printing routine.
+ o Bug fix in DSA verification routine and DSA S/MIME verification.
+ o Bug fix to make PRNG thread-safe.
+ o Bug fix in RAND_file_name().
+ o Bug fix in compatibility mode trust settings.
+ o Bug fix in blowfish EVP.
+ o Increase default size for BIO buffering filter.
+ o Compatibility fixes in some scripts.
+
+ Major changes between OpenSSL 0.9.6 and OpenSSL 0.9.6a [5 Apr 2001]:
+
+ o Security fix: change behavior of OpenSSL to avoid using
+ environment variables when running as root.
+ o Security fix: check the result of RSA-CRT to reduce the
+ possibility of deducing the private key from an incorrectly
+ calculated signature.
+ o Security fix: prevent Bleichenbacher's DSA attack.
+ o Security fix: Zero the premaster secret after deriving the
+ master secret in DH ciphersuites.
+ o Reimplement SSL_peek(), which had various problems.
+ o Compatibility fix: the function des_encrypt() renamed to
+ des_encrypt1() to avoid clashes with some Unixen libc.
+ o Bug fixes for Win32, HP/UX and Irix.
+ o Bug fixes in BIGNUM, SSL, PKCS#7, PKCS#12, X.509, CONF and
+ memory checking routines.
+ o Bug fixes for RSA operations in threaded environments.
+ o Bug fixes in misc. openssl applications.
+ o Remove a few potential memory leaks.
+ o Add tighter checks of BIGNUM routines.
+ o Shared library support has been reworked for generality.
+ o More documentation.
+ o New function BN_rand_range().
+ o Add "-rand" option to openssl s_client and s_server.
+
+ Major changes between OpenSSL 0.9.5a and OpenSSL 0.9.6 [10 Oct 2000]:
+
+ o Some documentation for BIO and SSL libraries.
+ o Enhanced chain verification using key identifiers.
+ o New sign and verify options to 'dgst' application.
+ o Support for DER and PEM encoded messages in 'smime' application.
+ o New 'rsautl' application, low level RSA utility.
+ o MD4 now included.
+ o Bugfix for SSL rollback padding check.
+ o Support for external crypto devices [1].
+ o Enhanced EVP interface.
+
+ [1] The support for external crypto devices is currently a separate
+ distribution. See the file README.ENGINE.
+
+ Major changes between OpenSSL 0.9.5 and OpenSSL 0.9.5a [1 Apr 2000]:
+
+ o Bug fixes for Win32, SuSE Linux, NeXTSTEP and FreeBSD 2.2.8
+ o Shared library support for HPUX and Solaris-gcc
+ o Support of Linux/IA64
+ o Assembler support for Mingw32
+ o New 'rand' application
+ o New way to check for existence of algorithms from scripts
+
+ Major changes between OpenSSL 0.9.4 and OpenSSL 0.9.5 [25 May 2000]:
+
+ o S/MIME support in new 'smime' command
+ o Documentation for the OpenSSL command line application
+ o Automation of 'req' application
+ o Fixes to make s_client, s_server work under Windows
+ o Support for multiple fieldnames in SPKACs
+ o New SPKAC command line utilty and associated library functions
+ o Options to allow passwords to be obtained from various sources
+ o New public key PEM format and options to handle it
+ o Many other fixes and enhancements to command line utilities
+ o Usable certificate chain verification
+ o Certificate purpose checking
+ o Certificate trust settings
+ o Support of authority information access extension
+ o Extensions in certificate requests
+ o Simplified X509 name and attribute routines
+ o Initial (incomplete) support for international character sets
+ o New DH_METHOD, DSA_METHOD and enhanced RSA_METHOD
+ o Read only memory BIOs and simplified creation function
+ o TLS/SSL protocol bugfixes: Accept TLS 'client hello' in SSL 3.0
+ record; allow fragmentation and interleaving of handshake and other
+ data
+ o TLS/SSL code now "tolerates" MS SGC
+ o Work around for Netscape client certificate hang bug
+ o RSA_NULL option that removes RSA patent code but keeps other
+ RSA functionality
+ o Memory leak detection now allows applications to add extra information
+ via a per-thread stack
+ o PRNG robustness improved
+ o EGD support
+ o BIGNUM library bug fixes
+ o Faster DSA parameter generation
+ o Enhanced support for Alpha Linux
+ o Experimental MacOS support
+
+ Major changes between OpenSSL 0.9.3 and OpenSSL 0.9.4 [9 Aug 1999]:
+
+ o Transparent support for PKCS#8 format private keys: these are used
+ by several software packages and are more secure than the standard
+ form
+ o PKCS#5 v2.0 implementation
+ o Password callbacks have a new void * argument for application data
+ o Avoid various memory leaks
+ o New pipe-like BIO that allows using the SSL library when actual I/O
+ must be handled by the application (BIO pair)
+
+ Major changes between OpenSSL 0.9.2b and OpenSSL 0.9.3 [24 May 1999]:
+ o Lots of enhancements and cleanups to the Configuration mechanism
+ o RSA OEAP related fixes
+ o Added `openssl ca -revoke' option for revoking a certificate
+ o Source cleanups: const correctness, type-safe stacks and ASN.1 SETs
+ o Source tree cleanups: removed lots of obsolete files
+ o Thawte SXNet, certificate policies and CRL distribution points
+ extension support
+ o Preliminary (experimental) S/MIME support
+ o Support for ASN.1 UTF8String and VisibleString
+ o Full integration of PKCS#12 code
+ o Sparc assembler bignum implementation, optimized hash functions
+ o Option to disable selected ciphers
+
+ Major changes between OpenSSL 0.9.1c and OpenSSL 0.9.2b [22 Mar 1999]:
+ o Fixed a security hole related to session resumption
+ o Fixed RSA encryption routines for the p < q case
+ o "ALL" in cipher lists now means "everything except NULL ciphers"
+ o Support for Triple-DES CBCM cipher
+ o Support of Optimal Asymmetric Encryption Padding (OAEP) for RSA
+ o First support for new TLSv1 ciphers
+ o Added a few new BIOs (syslog BIO, reliable BIO)
+ o Extended support for DSA certificate/keys.
+ o Extended support for Certificate Signing Requests (CSR)
+ o Initial support for X.509v3 extensions
+ o Extended support for compression inside the SSL record layer
+ o Overhauled Win32 builds
+ o Cleanups and fixes to the Big Number (BN) library
+ o Support for ASN.1 GeneralizedTime
+ o Splitted ASN.1 SETs from SEQUENCEs
+ o ASN1 and PEM support for Netscape Certificate Sequences
+ o Overhauled Perl interface
+ o Lots of source tree cleanups.
+ o Lots of memory leak fixes.
+ o Lots of bug fixes.
+
+ Major changes between SSLeay 0.9.0b and OpenSSL 0.9.1c [23 Dec 1998]:
+ o Integration of the popular NO_RSA/NO_DSA patches
+ o Initial support for compression inside the SSL record layer
+ o Added BIO proxy and filtering functionality
+ o Extended Big Number (BN) library
+ o Added RIPE MD160 message digest
+ o Addeed support for RC2/64bit cipher
+ o Extended ASN.1 parser routines
+ o Adjustations of the source tree for CVS
+ o Support for various new platforms
+
diff --git a/openssl-1.1.0h/NOTES.DJGPP b/openssl-1.1.0h/NOTES.DJGPP
new file mode 100644
index 0000000..bbe63dc
--- /dev/null
+++ b/openssl-1.1.0h/NOTES.DJGPP
@@ -0,0 +1,48 @@
+
+
+ INSTALLATION ON THE DOS PLATFORM WITH DJGPP
+ -------------------------------------------
+
+ OpenSSL has been ported to DJGPP, a Unix look-alike 32-bit run-time
+ environment for 16-bit DOS, but only with long filename support.
+ If you wish to compile on native DOS with 8+3 filenames, you will
+ have to tweak the installation yourself, including renaming files
+ with illegal or duplicate names.
+
+ You should have a full DJGPP environment installed, including the
+ latest versions of DJGPP, GCC, BINUTILS, BASH, etc. This package
+ requires that PERL and the PERL module Text::Template also be
+ installed (see NOTES.PERL).
+
+ All of these can be obtained from the usual DJGPP mirror sites or
+ directly at "http://www.delorie.com/pub/djgpp". For help on which
+ files to download, see the DJGPP "ZIP PICKER" page at
+ "http://www.delorie.com/djgpp/zip-picker.html". You also need to have
+ the WATT-32 networking package installed before you try to compile
+ OpenSSL. This can be obtained from "http://www.watt-32.net/".
+ The Makefile assumes that the WATT-32 code is in the directory
+ specified by the environment variable WATT_ROOT. If you have watt-32
+ in directory "watt32" under your main DJGPP directory, specify
+ WATT_ROOT="/dev/env/DJDIR/watt32".
+
+ To compile OpenSSL, start your BASH shell, then configure for DJGPP by
+ running "./Configure" with appropriate arguments:
+
+ ./Configure no-threads --prefix=/dev/env/DJDIR DJGPP
+
+ And finally fire up "make". You may run out of DPMI selectors when
+ running in a DOS box under Windows. If so, just close the BASH
+ shell, go back to Windows, and restart BASH. Then run "make" again.
+
+ RUN-TIME CAVEAT LECTOR
+ --------------
+
+ Quoting FAQ:
+
+ "Cryptographic software needs a source of unpredictable data to work
+ correctly. Many open source operating systems provide a "randomness
+ device" (/dev/urandom or /dev/random) that serves this purpose."
+
+ As of version 0.9.7f DJGPP port checks upon /dev/urandom$ for a 3rd
+ party "randomness" DOS driver. One such driver, NOISE.SYS, can be
+ obtained from "http://www.rahul.net/dkaufman/index.html".
diff --git a/openssl-1.1.0h/NOTES.PERL b/openssl-1.1.0h/NOTES.PERL
new file mode 100644
index 0000000..46d585a
--- /dev/null
+++ b/openssl-1.1.0h/NOTES.PERL
@@ -0,0 +1,119 @@
+ TOC
+ ===
+
+ - Notes on Perl
+ - Notes on Perl on Windows
+ - Notes on Perl modules we use
+ - Notes on installing a perl module
+
+ Notes on Perl
+ -------------
+
+ For our scripts, we rely quite a bit on Perl, and increasingly on
+ some core Perl modules. These Perl modules are part of the Perl
+ source, so if you build Perl on your own, you should be set.
+
+ However, if you install Perl as binary packages, the outcome might
+ differ, and you may have to check that you do get the core modules
+ installed properly. We do not claim to know them all, but experience
+ has told us the following:
+
+ - on Linux distributions based on Debian, the package 'perl' will
+ install the core Perl modules as well, so you will be fine.
+ - on Linux distributions based on RPMs, you will need to install
+ 'perl-core' rather than just 'perl'.
+
+ You MUST have at least Perl version 5.10.0 installed. This minimum
+ requirement is due to our use of regexp backslash sequence \R among
+ other features that didn't exist in core Perl before that version.
+
+ Notes on Perl on Windows
+ ------------------------
+
+ There are a number of build targets that can be viewed as "Windows".
+ Indeed, there are VC-* configs targeting VisualStudio C, as well as
+ MinGW and Cygwin. The key recommendation is to use "matching" Perl,
+ one that matches build environment. For example, if you will build
+ on Cygwin be sure to use the Cygwin package manager to install Perl.
+ For MSYS builds use the MSYS provided Perl. For VC-* builds we
+ recommend ActiveState Perl, available from
+ http://www.activestate.com/ActivePerl.
+
+ Notes on Perl on VMS
+ --------------------
+
+ You will need to install Perl separately. One way to do so is to
+ download the source from http://perl.org/, unpacking it, reading
+ README.vms and follow the instructions. Another way is to download a
+ .PCSI file from http://www.vmsperl.com/ and install it using the
+ POLYCENTER install tool.
+
+ Notes on Perl modules we use
+ ----------------------------
+
+ We make increasing use of Perl modules, and do our best to limit
+ ourselves to core Perl modules to keep the requirements down. There
+ are just a few exceptions:
+
+ Test::More We require the minimum version to be 0.96, which
+ appeared in Perl 5.13.4, because that version was
+ the first to have all the features we're using.
+ This module is required for testing only! If you
+ don't plan on running the tests, you don't need to
+ bother with this one.
+
+ Text::Template This module is not part of the core Perl modules.
+ As a matter of fact, the core Perl modules do not
+ include any templating module to date.
+ This module is absolutely needed, configuration
+ depends on it.
+
+ To avoid unnecessary initial hurdles, we have bundled a copy of the
+ following modules in our source. They will work as fallbacks if
+ these modules aren't already installed on the system.
+
+ Text::Template
+
+ Notes on installing a perl module
+ ---------------------------------
+
+ There are a number of ways to install a perl module. In all
+ descriptions below, Text::Template will server as an example.
+
+ 1. for Linux users, the easiest is to install with the use of your
+ favorite package manager. Usually, all you need to do is search
+ for the module name and to install the package that comes up.
+
+ On Debian based Linux distributions, it would go like this:
+
+ $ apt-cache search Text::Template
+ ...
+ libtext-template-perl - perl module to process text templates
+ $ sudo apt-get install libtext-template-perl
+
+ Perl modules in Debian based distributions use package names like
+ the name of the module in question, with "lib" prepended and
+ "-perl" appended.
+
+ 2. Install using CPAN. This is very easy, but usually requires root
+ access:
+
+ $ cpan -i Text::Template
+
+ Note that this runs all the tests that the module to be installed
+ comes with. This is usually a smooth operation, but there are
+ platforms where a failure is indicated even though the actual tests
+ were successful. Should that happen, you can force an
+ installation regardless (that should be safe since you've already
+ seen the tests succeed!):
+
+ $ cpan -f -i Text::Template
+
+ Note: on VMS, you must quote any argument that contains upper case
+ characters, so the lines above would be:
+
+ $ cpan -i "Text::Template"
+
+ and:
+
+ $ cpan -f -i "Text::Template"
diff --git a/openssl-1.1.0h/NOTES.UNIX b/openssl-1.1.0h/NOTES.UNIX
new file mode 100644
index 0000000..43146e9
--- /dev/null
+++ b/openssl-1.1.0h/NOTES.UNIX
@@ -0,0 +1,30 @@
+
+ NOTES FOR UNIX LIKE PLATFORMS
+ =============================
+
+ For Unix/POSIX runtime systems on Windows, please see NOTES.WIN.
+
+
+ Shared libraries and installation in non-standard locations
+ -----------------------------------------------------------
+
+ Binaries on Unix variants expect to find shared libraries in standard
+ locations, such as /usr/lib, /usr/local/lib and some other locations
+ configured in the system (for example /etc/ld.so.conf on some systems).
+ If the libraries are installed in non-standard locations, binaries
+ will not find them and therefore fail to run unless they get a bit of
+ help from a defined RPATH or RUNPATH. This can be applied by adding
+ the appropriate linker flags to the configuration command, such as
+ this (/usr/local/ssl was the default location for OpenSSL installation
+ in versions before 1.1.0):
+
+ $ ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl \
+ -Wl,-rpath,/usr/local/ssl/lib
+
+ Because the actual library location may vary further (for example on
+ multilib installations), there is a convenience variable in Makefile
+ that holds the exact installation directory and that can be used like
+ this:
+
+ $ ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl \
+ -Wl,-rpath,'$(LIBRPATH)'
diff --git a/openssl-1.1.0h/NOTES.VMS b/openssl-1.1.0h/NOTES.VMS
new file mode 100644
index 0000000..3e9a57e
--- /dev/null
+++ b/openssl-1.1.0h/NOTES.VMS
@@ -0,0 +1,81 @@
+
+ NOTES FOR THE OPENVMS PLATFORM
+ ==============================
+
+ Requirement details
+ -------------------
+
+ In addition to the requirements and instructions listed in INSTALL,
+ this are required as well:
+
+ * At least ODS-5 disk organization for source and build.
+ Installation can be done on any existing disk organization.
+
+
+ About ANSI C compiler
+ ---------------------
+
+ An ANSI C compiled is needed among other things. This means that
+ VAX C is not and will not be supported.
+
+ We have only tested with DEC C (a.k.a HP VMS C / VSI C) and require
+ version 7.1 or later. Compiling with a different ANSI C compiler may
+ require some work.
+
+ Please avoid using C RTL feature logical names DECC$* when building
+ and testing OpenSSL. Most of all, they can be disruptive when
+ running the tests, as they affect the Perl interpreter.
+
+
+ About ODS-5 directory names and Perl
+ ------------------------------------
+
+ It seems that the perl function canonpath() in the File::Spec module
+ doesn't treat file specifications where the last directory name
+ contains periods very well. Unfortunately, some versions of VMS tar
+ will keep the periods in the OpenSSL source directory instead of
+ converting them to underscore, thereby leaving your source in
+ something like [.openssl-1^.1^.0]. This will lead to issues when
+ configuring and building OpenSSL.
+
+ We have no replacement for Perl's canonpath(), so the best workaround
+ for now is to rename the OpenSSL source directory, as follows (please
+ adjust for the actual source directory name you have):
+
+ $ rename openssl-1^.1^.0.DIR openssl-1_1_0.DIR
+
+
+ About MMS and DCL
+ -----------------
+
+ MMS has certain limitations when it comes to line length, and DCL has
+ certain limitations when it comes to total command length. We do
+ what we can to mitigate, but there is the possibility that it's not
+ enough. Should you run into issues, a very simple solution is to set
+ yourself up a few logical names for the directory trees you're going
+ to use.
+
+
+ Checking the distribution
+ -------------------------
+
+ There have been reports of places where the distribution didn't quite
+ get through, for example if you've copied the tree from a NFS-mounted
+ Unix mount point.
+
+ The easiest way to check if everything got through as it should is to
+ check for one of the following files:
+
+ [.crypto]opensslconf^.h.in
+
+ The best way to get a correct distribution is to download the gzipped
+ tar file from ftp://ftp.openssl.org/source/, use GZIP -d to uncompress
+ it and VMSTAR to unpack the resulting tar file.
+
+ Gzip and VMSTAR are available here:
+
+ http://antinode.info/dec/index.html#Software
+
+ Should you need it, you can find UnZip for VMS here:
+
+ http://www.info-zip.org/UnZip.html
diff --git a/openssl-1.1.0h/NOTES.WIN b/openssl-1.1.0h/NOTES.WIN
new file mode 100644
index 0000000..c31aed9
--- /dev/null
+++ b/openssl-1.1.0h/NOTES.WIN
@@ -0,0 +1,139 @@
+
+ NOTES FOR THE WINDOWS PLATFORMS
+ ===============================
+
+ Requirement details for native (Visual C++) builds
+ --------------------------------------------------
+
+ In addition to the requirements and instructions listed in INSTALL,
+ this are required as well:
+
+ - You need Perl. We recommend ActiveState Perl, available from
+ https://www.activestate.com/ActivePerl. Another viable alternative
+ appears to be Strawberry Perl, http://strawberryperl.com.
+ You also need the perl module Text::Template, available on CPAN.
+ Please read NOTES.PERL for more information.
+
+ - You need a C compiler. OpenSSL has been tested to build with these:
+
+ * Visual C++
+
+ - Netwide Assembler, a.k.a. NASM, available from http://www.nasm.us,
+ is required if you intend to utilize assembler modules. Note that NASM
+ is the only supported assembler. The Microsoft provided assembler is NOT
+ supported.
+
+
+ Visual C++ (native Windows)
+ ---------------------------
+
+ Installation directories
+
+ The default installation directories are derived from environment
+ variables.
+
+ For VC-WIN32, the following defaults are use:
+
+ PREFIX: %ProgramFiles(86)%\OpenSSL
+ OPENSSLDIR: %CommonProgramFiles(86)%\SSL
+
+ For VC-WIN64, the following defaults are use:
+
+ PREFIX: %ProgramW6432%\OpenSSL
+ OPENSSLDIR: %CommonProgramW6432%\SSL
+
+ Should those environment variables not exist (on a pure Win32
+ installation for examples), these fallbacks are used:
+
+ PREFIX: %ProgramFiles%\OpenSSL
+ OPENSSLDIR: %CommonProgramFiles%\SSL
+
+ ALSO NOTE that those directories are usually write protected, even if
+ your account is in the Administrators group. To work around that,
+ start the command prompt by right-clicking on it and choosing "Run as
+ Administrator" before running 'nmake install'. The other solution
+ is, of course, to choose a different set of directories by using
+ --prefix and --openssldir when configuring.
+
+ GNU C (Cygwin)
+ --------------
+
+ Cygwin implements a Posix/Unix runtime system (cygwin1.dll) on top of the
+ Windows subsystem and provides a bash shell and GNU tools environment.
+ Consequently, a make of OpenSSL with Cygwin is virtually identical to the
+ Unix procedure.
+
+ To build OpenSSL using Cygwin, you need to:
+
+ * Install Cygwin (see https://cygwin.com/)
+
+ * Install Cygwin Perl and ensure it is in the path. Recall that
+ as least 5.10.0 is required.
+
+ * Run the Cygwin bash shell
+
+ Apart from that, follow the Unix instructions in INSTALL.
+
+ NOTE: "make test" and normal file operations may fail in directories
+ mounted as text (i.e. mount -t c:\somewhere /home) due to Cygwin
+ stripping of carriage returns. To avoid this ensure that a binary
+ mount is used, e.g. mount -b c:\somewhere /home.
+
+ It is also possible to create "conventional" Windows binaries that use
+ the Microsoft C runtime system (msvcrt.dll or crtdll.dll) using MinGW
+ development add-on for Cygwin. MinGW is supported even as a standalone
+ setup as described in the following section. In the context you should
+ recognize that binaries targeting Cygwin itself are not interchangeable
+ with "conventional" Windows binaries you generate with/for MinGW.
+
+
+ GNU C (MinGW/MSYS)
+ ------------------
+
+ * Compiler and shell environment installation:
+
+ MinGW and MSYS are available from http://www.mingw.org/, both are
+ required. Run the installers and do whatever magic they say it takes
+ to start MSYS bash shell with GNU tools and matching Perl on its PATH.
+ "Matching Perl" refers to chosen "shell environment", i.e. if built
+ under MSYS, then Perl compiled for MSYS must be used.
+
+ Alternatively, one can use MSYS2 from https://msys2.github.io/,
+ which includes MingW (32-bit and 64-bit).
+
+ * It is also possible to cross-compile it on Linux by configuring
+ with './Configure --cross-compile-prefix=i386-mingw32- mingw ...'.
+ Other possible cross compile prefixes include x86_64-w64-mingw32-
+ and i686-w64-mingw32-.
+
+
+ Linking your application
+ ------------------------
+
+ This section applies to non-Cygwin builds.
+
+ If you link with static OpenSSL libraries then you're expected to
+ additionally link your application with WS2_32.LIB, GDI32.LIB,
+ ADVAPI32.LIB, CRYPT32.LIB and USER32.LIB. Those developing
+ non-interactive service applications might feel concerned about
+ linking with GDI32.LIB and USER32.LIB, as they are justly associated
+ with interactive desktop, which is not available to service
+ processes. The toolkit is designed to detect in which context it's
+ currently executed, GUI, console app or service, and act accordingly,
+ namely whether or not to actually make GUI calls. Additionally those
+ who wish to /DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and
+ actually keep them off service process should consider implementing
+ and exporting from .exe image in question own _OPENSSL_isservice not
+ relying on USER32.DLL. E.g., on Windows Vista and later you could:
+
+ __declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void)
+ { DWORD sess;
+ if (ProcessIdToSessionId(GetCurrentProcessId(),&sess))
+ return sess==0;
+ return FALSE;
+ }
+
+ If you link with OpenSSL .DLLs, then you're expected to include into
+ your application code small "shim" snippet, which provides glue between
+ OpenSSL BIO layer and your compiler run-time. See the OPENSSL_Applink
+ manual page for further details.
diff --git a/openssl-1.1.0h/README b/openssl-1.1.0h/README
new file mode 100644
index 0000000..3491280
--- /dev/null
+++ b/openssl-1.1.0h/README
@@ -0,0 +1,94 @@
+
+ OpenSSL 1.1.0h 27 Mar 2018
+
+ Copyright (c) 1998-2016 The OpenSSL Project
+ Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
+ All rights reserved.
+
+ DESCRIPTION
+ -----------
+
+ The OpenSSL Project is a collaborative effort to develop a robust,
+ commercial-grade, fully featured, and Open Source toolkit implementing the
+ Transport Layer Security (TLS) protocols (including SSLv3) as well as a
+ full-strength general purpose cryptographic library.
+
+ OpenSSL is descended from the SSLeay library developed by Eric A. Young
+ and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
+ OpenSSL license plus the SSLeay license), which means that you are free to
+ get and use it for commercial and non-commercial purposes as long as you
+ fulfill the conditions of both licenses.
+
+ OVERVIEW
+ --------
+
+ The OpenSSL toolkit includes:
+
+ libssl (with platform specific naming):
+ Provides the client and server-side implementations for SSLv3 and TLS.
+
+ libcrypto (with platform specific naming):
+ Provides general cryptographic and X.509 support needed by SSL/TLS but
+ not logically part of it.
+
+ openssl:
+ A command line tool that can be used for:
+ Creation of key parameters
+ Creation of X.509 certificates, CSRs and CRLs
+ Calculation of message digests
+ Encryption and decryption
+ SSL/TLS client and server tests
+ Handling of S/MIME signed or encrypted mail
+ And more...
+
+ INSTALLATION
+ ------------
+
+ See the appropriate file:
+ INSTALL Linux, Unix, Windows, OpenVMS, ...
+ NOTES.* INSTALL addendums for different platforms
+
+ SUPPORT
+ -------
+
+ See the OpenSSL website www.openssl.org for details on how to obtain
+ commercial technical support. Free community support is available through the
+ openssl-users email list (see
+ https://www.openssl.org/community/mailinglists.html for further details).
+
+ If you have any problems with OpenSSL then please take the following steps
+ first:
+
+ - Download the latest version from the repository
+ to see if the problem has already been addressed
+ - Configure with no-asm
+ - Remove compiler optimisation flags
+
+ If you wish to report a bug then please include the following information
+ and create an issue on GitHub:
+
+ - OpenSSL version: output of 'openssl version -a'
+ - Any "Configure" options that you selected during compilation of the
+ library if applicable (see INSTALL)
+ - OS Name, Version, Hardware platform
+ - Compiler Details (name, version)
+ - Application Details (name, version)
+ - Problem Description (steps that will reproduce the problem, if known)
+ - Stack Traceback (if the application dumps core)
+
+ Just because something doesn't work the way you expect does not mean it
+ is necessarily a bug in OpenSSL. Use the openssl-users email list for this type
+ of query.
+
+ HOW TO CONTRIBUTE TO OpenSSL
+ ----------------------------
+
+ See CONTRIBUTING
+
+ LEGALITIES
+ ----------
+
+ A number of nations restrict the use or export of cryptography. If you
+ are potentially subject to such restrictions you should seek competent
+ professional legal advice before attempting to develop or distribute
+ cryptographic code.
diff --git a/openssl-1.1.0h/README.ECC b/openssl-1.1.0h/README.ECC
new file mode 100644
index 0000000..fa3cad7
--- /dev/null
+++ b/openssl-1.1.0h/README.ECC
@@ -0,0 +1,61 @@
+NOTE: The OpenSSL Software Foundation has executed a sublicense agreement
+entitled "Elliptic Curve Cryptography Patent License Agreement" with the
+National Security Agency/ Central Security Service Commercial Solutions
+Center (NCSC) dated 2010-11-04. That agreement permits implementation and
+distribution of software containing features covered by any or all of the
+following patents:
+
+1.) U.S. Pat. No. 5,761,305 entitled "Key Agreement and Transport Protocol
+ with Implicit Signatures" issued on June 2, 1998;
+2.) Can. Pat. Appl. Ser. No. 2176972 entitled "Key Agreement and Transport
+ Protocol with Implicit Signature and Reduced Bandwidth" filed on May
+ 16, 1996;
+3.) U.S. Pat. No. 5,889,865 entitled "Key Agreement and Transport Protocol
+ with Implicit Signatures" issued on March 30, 1999;
+4.) U.S. Pat. No. 5,896,455 entitled "Key Agreement and Transport Protocol
+ with Implicit Signatures" issued on April 20, 1999;
+5.) U.S. Pat. No. 5,933,504 entitled "Strengthened Public Key Protocol"
+ issued on August 3, 1999;
+6.) Can. Pat. Appl. Ser. No. 2176866 entitled "Strengthened Public Key
+ Protocol" filed on May 17, 1996;
+7.) E.P. Pat. Appl. Ser. No. 96201322.3 entitled "Strengthened Public Key
+ Protocol" filed on May 17, 1996;
+8.) U.S. Pat. No. 5,999,626 entitled "Digital Signatures on a Smartcard"
+ issued on December 7, 1999;
+9.) Can. Pat. Appl. Ser. No. 2202566 entitled "Digital Signatures on a
+ Smartcard" filed on April 14, 1997;
+10.) E.P. Pat. Appl. No. 97106114.8 entitled "Digital Signatures on a
+ Smartcard" filed on April 15, 1997;
+11.) U.S Pat. No. 6,122,736 entitled "Key Agreement and Transport Protocol
+ with Implicit Signatures" issued on September 19, 2000;
+12.) Can. Pat. Appl. Ser. No. 2174261 entitled "Key Agreement and Transport
+ Protocol with Implicit Signatures" filed on April 16, 1996;
+13.) E.P. Pat. Appl. Ser. No. 96105920.1 entitled "Key Agreement and
+ Transport Protocol with Implicit Signatures" filed on April 16, 1996;
+14.) U.S. Pat. No. 6,141,420 entitled "Elliptic Curve Encryption Systems"
+ issued on October 31, 2000;
+15.) Can. Pat. Appl. Ser. No. 2155038 entitled "Elliptic Curve Encryption
+ Systems" filed on July 31, 1995;
+16.) E.P. Pat. Appl. Ser. No. 95926348.4 entitled "Elliptic Curve Encryption
+ Systems" filed on July 31, 1995;
+17.) U.S. Pat. No. 6,336,188 entitled "Authenticated Key Agreement" issued
+ on January 1, 2002;
+18.) U.S. Pat. No. 6,487,661 entitled "Key Agreement and Transport Protocol"
+ issued on November 26, 2002;
+19.) Can. Pat. Appl. Ser. No. 2174260 entitled "Key Agreement and Transport
+ Protocol" filed on April 16, 1996;
+20.) E.P. Pat. Appl. Ser. No. 96105921.9 entitled "Key Agreement and
+ Transport Protocol" filed on April 21, 1996;
+21.) U.S. Pat. No. 6,563,928 entitled "Strengthened Public Key Protocol"
+ issued on May 13, 2003;
+22.) U.S. Pat. No. 6,618,483 entitled "Elliptic Curve Encryption Systems"
+ issued September 9, 2003;
+23.) U.S. Pat. Appl. Ser. No. 09/434,247 entitled "Digital Signatures on a
+ Smartcard" filed on November 5, 1999;
+24.) U.S. Pat. Appl. Ser. No. 09/558,256 entitled "Key Agreement and
+ Transport Protocol with Implicit Signatures" filed on April 25, 2000;
+25.) U.S. Pat. Appl. Ser. No. 09/942,492 entitled "Digital Signatures on a
+ Smartcard" filed on August 29, 2001 and published on July 18, 2002; and,
+26.) U.S. Pat. Appl. Ser. No. 10/185,735 entitled "Strengthened Public Key
+ Protocol" filed on July 1, 2000.
+
diff --git a/openssl-1.1.0h/README.ENGINE b/openssl-1.1.0h/README.ENGINE
new file mode 100644
index 0000000..530a4ed
--- /dev/null
+++ b/openssl-1.1.0h/README.ENGINE
@@ -0,0 +1,288 @@
+ ENGINE
+ ======
+
+ With OpenSSL 0.9.6, a new component was added to support alternative
+ cryptography implementations, most commonly for interfacing with external
+ crypto devices (eg. accelerator cards). This component is called ENGINE,
+ and its presence in OpenSSL 0.9.6 (and subsequent bug-fix releases)
+ caused a little confusion as 0.9.6** releases were rolled in two
+ versions, a "standard" and an "engine" version. In development for 0.9.7,
+ the ENGINE code has been merged into the main branch and will be present
+ in the standard releases from 0.9.7 forwards.
+
+ There are currently built-in ENGINE implementations for the following
+ crypto devices:
+
+ o Cryptodev
+ o Microsoft CryptoAPI
+ o VIA Padlock
+ o nCipher CHIL
+
+ In addition, dynamic binding to external ENGINE implementations is now
+ provided by a special ENGINE called "dynamic". See the "DYNAMIC ENGINE"
+ section below for details.
+
+ At this stage, a number of things are still needed and are being worked on:
+
+ 1 Integration of EVP support.
+ 2 Configuration support.
+ 3 Documentation!
+
+1 With respect to EVP, this relates to support for ciphers and digests in
+ the ENGINE model so that alternative implementations of existing
+ algorithms/modes (or previously unimplemented ones) can be provided by
+ ENGINE implementations.
+
+2 Configuration support currently exists in the ENGINE API itself, in the
+ form of "control commands". These allow an application to expose to the
+ user/admin the set of commands and parameter types a given ENGINE
+ implementation supports, and for an application to directly feed string
+ based input to those ENGINEs, in the form of name-value pairs. This is an
+ extensible way for ENGINEs to define their own "configuration" mechanisms
+ that are specific to a given ENGINE (eg. for a particular hardware
+ device) but that should be consistent across *all* OpenSSL-based
+ applications when they use that ENGINE. Work is in progress (or at least
+ in planning) for supporting these control commands from the CONF (or
+ NCONF) code so that applications using OpenSSL's existing configuration
+ file format can have ENGINE settings specified in much the same way.
+ Presently however, applications must use the ENGINE API itself to provide
+ such functionality. To see first hand the types of commands available
+ with the various compiled-in ENGINEs (see further down for dynamic
+ ENGINEs), use the "engine" openssl utility with full verbosity, ie;
+ openssl engine -vvvv
+
+3 Documentation? Volunteers welcome! The source code is reasonably well
+ self-documenting, but some summaries and usage instructions are needed -
+ moreover, they are needed in the same POD format the existing OpenSSL
+ documentation is provided in. Any complete or incomplete contributions
+ would help make this happen.
+
+ STABILITY & BUG-REPORTS
+ =======================
+
+ What already exists is fairly stable as far as it has been tested, but
+ the test base has been a bit small most of the time. For the most part,
+ the vendors of the devices these ENGINEs support have contributed to the
+ development and/or testing of the implementations, and *usually* (with no
+ guarantees) have experience in using the ENGINE support to drive their
+ devices from common OpenSSL-based applications. Bugs and/or inexplicable
+ behaviour in using a specific ENGINE implementation should be sent to the
+ author of that implementation (if it is mentioned in the corresponding C
+ file), and in the case of implementations for commercial hardware
+ devices, also through whatever vendor support channels are available. If
+ none of this is possible, or the problem seems to be something about the
+ ENGINE API itself (ie. not necessarily specific to a particular ENGINE
+ implementation) then you should mail complete details to the relevant
+ OpenSSL mailing list. For a definition of "complete details", refer to
+ the OpenSSL "README" file. As for which list to send it to;
+
+ openssl-users: if you are *using* the ENGINE abstraction, either in an
+ pre-compiled application or in your own application code.
+
+ openssl-dev: if you are discussing problems with OpenSSL source code.
+
+ USAGE
+ =====
+
+ The default "openssl" ENGINE is always chosen when performing crypto
+ operations unless you specify otherwise. You must actively tell the
+ openssl utility commands to use anything else through a new command line
+ switch called "-engine". Also, if you want to use the ENGINE support in
+ your own code to do something similar, you must likewise explicitly
+ select the ENGINE implementation you want.
+
+ Depending on the type of hardware, system, and configuration, "settings"
+ may need to be applied to an ENGINE for it to function as expected/hoped.
+ The recommended way of doing this is for the application to support
+ ENGINE "control commands" so that each ENGINE implementation can provide
+ whatever configuration primitives it might require and the application
+ can allow the user/admin (and thus the hardware vendor's support desk
+ also) to provide any such input directly to the ENGINE implementation.
+ This way, applications do not need to know anything specific to any
+ device, they only need to provide the means to carry such user/admin
+ input through to the ENGINE in question. Ie. this connects *you* (and
+ your helpdesk) to the specific ENGINE implementation (and device), and
+ allows application authors to not get buried in hassle supporting
+ arbitrary devices they know (and care) nothing about.
+
+ A new "openssl" utility, "openssl engine", has been added in that allows
+ for testing and examination of ENGINE implementations. Basic usage
+ instructions are available by specifying the "-?" command line switch.
+
+ DYNAMIC ENGINES
+ ===============
+
+ The new "dynamic" ENGINE provides a low-overhead way to support ENGINE
+ implementations that aren't pre-compiled and linked into OpenSSL-based
+ applications. This could be because existing compiled-in implementations
+ have known problems and you wish to use a newer version with an existing
+ application. It could equally be because the application (or OpenSSL
+ library) you are using simply doesn't have support for the ENGINE you
+ wish to use, and the ENGINE provider (eg. hardware vendor) is providing
+ you with a self-contained implementation in the form of a shared-library.
+ The other use-case for "dynamic" is with applications that wish to
+ maintain the smallest foot-print possible and so do not link in various
+ ENGINE implementations from OpenSSL, but instead leaves you to provide
+ them, if you want them, in the form of "dynamic"-loadable
+ shared-libraries. It should be possible for hardware vendors to provide
+ their own shared-libraries to support arbitrary hardware to work with
+ applications based on OpenSSL 0.9.7 or later. If you're using an
+ application based on 0.9.7 (or later) and the support you desire is only
+ announced for versions later than the one you need, ask the vendor to
+ backport their ENGINE to the version you need.
+
+ How does "dynamic" work?
+ ------------------------
+ The dynamic ENGINE has a special flag in its implementation such that
+ every time application code asks for the 'dynamic' ENGINE, it in fact
+ gets its own copy of it. As such, multi-threaded code (or code that
+ multiplexes multiple uses of 'dynamic' in a single application in any
+ way at all) does not get confused by 'dynamic' being used to do many
+ independent things. Other ENGINEs typically don't do this so there is
+ only ever 1 ENGINE structure of its type (and reference counts are used
+ to keep order). The dynamic ENGINE itself provides absolutely no
+ cryptographic functionality, and any attempt to "initialise" the ENGINE
+ automatically fails. All it does provide are a few "control commands"
+ that can be used to control how it will load an external ENGINE
+ implementation from a shared-library. To see these control commands,
+ use the command-line;
+
+ openssl engine -vvvv dynamic
+
+ The "SO_PATH" control command should be used to identify the
+ shared-library that contains the ENGINE implementation, and "NO_VCHECK"
+ might possibly be useful if there is a minor version conflict and you
+ (or a vendor helpdesk) is convinced you can safely ignore it.
+ "ID" is probably only needed if a shared-library implements
+ multiple ENGINEs, but if you know the engine id you expect to be using,
+ it doesn't hurt to specify it (and this provides a sanity check if
+ nothing else). "LIST_ADD" is only required if you actually wish the
+ loaded ENGINE to be discoverable by application code later on using the
+ ENGINE's "id". For most applications, this isn't necessary - but some
+ application authors may have nifty reasons for using it. The "LOAD"
+ command is the only one that takes no parameters and is the command
+ that uses the settings from any previous commands to actually *load*
+ the shared-library ENGINE implementation. If this command succeeds, the
+ (copy of the) 'dynamic' ENGINE will magically morph into the ENGINE
+ that has been loaded from the shared-library. As such, any control
+ commands supported by the loaded ENGINE could then be executed as per
+ normal. Eg. if ENGINE "foo" is implemented in the shared-library
+ "libfoo.so" and it supports some special control command "CMD_FOO", the
+ following code would load and use it (NB: obviously this code has no
+ error checking);
+
+ ENGINE *e = ENGINE_by_id("dynamic");
+ ENGINE_ctrl_cmd_string(e, "SO_PATH", "/lib/libfoo.so", 0);
+ ENGINE_ctrl_cmd_string(e, "ID", "foo", 0);
+ ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0);
+ ENGINE_ctrl_cmd_string(e, "CMD_FOO", "some input data", 0);
+
+ For testing, the "openssl engine" utility can be useful for this sort
+ of thing. For example the above code excerpt would achieve much the
+ same result as;
+
+ openssl engine dynamic \
+ -pre SO_PATH:/lib/libfoo.so \
+ -pre ID:foo \
+ -pre LOAD \
+ -pre "CMD_FOO:some input data"
+
+ Or to simply see the list of commands supported by the "foo" ENGINE;
+
+ openssl engine -vvvv dynamic \
+ -pre SO_PATH:/lib/libfoo.so \
+ -pre ID:foo \
+ -pre LOAD
+
+ Applications that support the ENGINE API and more specifically, the
+ "control commands" mechanism, will provide some way for you to pass
+ such commands through to ENGINEs. As such, you would select "dynamic"
+ as the ENGINE to use, and the parameters/commands you pass would
+ control the *actual* ENGINE used. Each command is actually a name-value
+ pair and the value can sometimes be omitted (eg. the "LOAD" command).
+ Whilst the syntax demonstrated in "openssl engine" uses a colon to
+ separate the command name from the value, applications may provide
+ their own syntax for making that separation (eg. a win32 registry
+ key-value pair may be used by some applications). The reason for the
+ "-pre" syntax in the "openssl engine" utility is that some commands
+ might be issued to an ENGINE *after* it has been initialised for use.
+ Eg. if an ENGINE implementation requires a smart-card to be inserted
+ during initialisation (or a PIN to be typed, or whatever), there may be
+ a control command you can issue afterwards to "forget" the smart-card
+ so that additional initialisation is no longer possible. In
+ applications such as web-servers, where potentially volatile code may
+ run on the same host system, this may provide some arguable security
+ value. In such a case, the command would be passed to the ENGINE after
+ it has been initialised for use, and so the "-post" switch would be
+ used instead. Applications may provide a different syntax for
+ supporting this distinction, and some may simply not provide it at all
+ ("-pre" is almost always what you're after, in reality).
+
+ How do I build a "dynamic" ENGINE?
+ ----------------------------------
+ This question is trickier - currently OpenSSL bundles various ENGINE
+ implementations that are statically built in, and any application that
+ calls the "ENGINE_load_builtin_engines()" function will automatically
+ have all such ENGINEs available (and occupying memory). Applications
+ that don't call that function have no ENGINEs available like that and
+ would have to use "dynamic" to load any such ENGINE - but on the other
+ hand such applications would only have the memory footprint of any
+ ENGINEs explicitly loaded using user/admin provided control commands.
+ The main advantage of not statically linking ENGINEs and only using
+ "dynamic" for hardware support is that any installation using no
+ "external" ENGINE suffers no unnecessary memory footprint from unused
+ ENGINEs. Likewise, installations that do require an ENGINE incur the
+ overheads from only *that* ENGINE once it has been loaded.
+
+ Sounds good? Maybe, but currently building an ENGINE implementation as
+ a shared-library that can be loaded by "dynamic" isn't automated in
+ OpenSSL's build process. It can be done manually quite easily however.
+ Such a shared-library can either be built with any OpenSSL code it
+ needs statically linked in, or it can link dynamically against OpenSSL
+ if OpenSSL itself is built as a shared library. The instructions are
+ the same in each case, but in the former (statically linked any
+ dependencies on OpenSSL) you must ensure OpenSSL is built with
+ position-independent code ("PIC"). The default OpenSSL compilation may
+ already specify the relevant flags to do this, but you should consult
+ with your compiler documentation if you are in any doubt.
+
+ This example will show building the "atalla" ENGINE in the
+ crypto/engine/ directory as a shared-library for use via the "dynamic"
+ ENGINE.
+ 1) "cd" to the crypto/engine/ directory of a pre-compiled OpenSSL
+ source tree.
+ 2) Recompile at least one source file so you can see all the compiler
+ flags (and syntax) being used to build normally. Eg;
+ touch hw_atalla.c ; make
+ will rebuild "hw_atalla.o" using all such flags.
+ 3) Manually enter the same compilation line to compile the
+ "hw_atalla.c" file but with the following two changes;
+ (a) add "-DENGINE_DYNAMIC_SUPPORT" to the command line switches,
+ (b) change the output file from "hw_atalla.o" to something new,
+ eg. "tmp_atalla.o"
+ 4) Link "tmp_atalla.o" into a shared-library using the top-level
+ OpenSSL libraries to resolve any dependencies. The syntax for doing
+ this depends heavily on your system/compiler and is a nightmare
+ known well to anyone who has worked with shared-library portability
+ before. 'gcc' on Linux, for example, would use the following syntax;
+ gcc -shared -o dyn_atalla.so tmp_atalla.o -L../.. -lcrypto
+ 5) Test your shared library using "openssl engine" as explained in the
+ previous section. Eg. from the top-level directory, you might try;
+ apps/openssl engine -vvvv dynamic \
+ -pre SO_PATH:./crypto/engine/dyn_atalla.so -pre LOAD
+ If the shared-library loads successfully, you will see both "-pre"
+ commands marked as "SUCCESS" and the list of control commands
+ displayed (because of "-vvvv") will be the control commands for the
+ *atalla* ENGINE (ie. *not* the 'dynamic' ENGINE). You can also add
+ the "-t" switch to the utility if you want it to try and initialise
+ the atalla ENGINE for use to test any possible hardware/driver
+ issues.
+
+ PROBLEMS
+ ========
+
+ It seems like the ENGINE part doesn't work too well with CryptoSwift on Win32.
+ A quick test done right before the release showed that trying "openssl speed
+ -engine cswift" generated errors. If the DSO gets enabled, an attempt is made
+ to write at memory address 0x00000002.
+
diff --git a/openssl-1.1.0h/README.FIPS b/openssl-1.1.0h/README.FIPS
new file mode 100644
index 0000000..8593486
--- /dev/null
+++ b/openssl-1.1.0h/README.FIPS
@@ -0,0 +1 @@
+This release does not support a FIPS 140-2 validated module.
diff --git a/openssl-1.1.0h/VMS/VMSify-conf.pl b/openssl-1.1.0h/VMS/VMSify-conf.pl
new file mode 100644
index 0000000..21eff11
--- /dev/null
+++ b/openssl-1.1.0h/VMS/VMSify-conf.pl
@@ -0,0 +1,41 @@
+#! /usr/bin/env perl
+# Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+
+use strict;
+use warnings;
+
+my @directory_vars = ( "dir", "certs", "crl_dir", "new_certs_dir" );
+my @file_vars = ( "database", "certificate", "serial", "crlnumber",
+ "crl", "private_key", "RANDFILE" );
+while(<STDIN>) {
+ s|\R$||;
+ foreach my $d (@directory_vars) {
+ if (/^(\s*\#?\s*${d}\s*=\s*)\.\/([^\s\#]*)([\s\#].*)$/) {
+ $_ = "$1sys\\\$disk:\[.$2$3";
+ } elsif (/^(\s*\#?\s*${d}\s*=\s*)(\w[^\s\#]*)([\s\#].*)$/) {
+ $_ = "$1sys\\\$disk:\[.$2$3";
+ }
+ s/^(\s*\#?\s*${d}\s*=\s*\$\w+)\/([^\s\#]*)([\s\#].*)$/$1.$2\]$3/;
+ while(/^(\s*\#?\s*${d}\s*=\s*(\$\w+\.|sys\\\$disk:\[\.)[\w\.]+)\/([^\]]*)\](.*)$/) {
+ $_ = "$1.$3]$4";
+ }
+ }
+ foreach my $f (@file_vars) {
+ s/^(\s*\#?\s*${f}\s*=\s*)\.\/(.*)$/$1sys\\\$disk:\[\/$2/;
+ while(/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/(\w+\/[^\s\#]*)([\s\#].*)$/) {
+ $_ = "$1.$3$4";
+ }
+ if (/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/(\w+)([\s\#].*)$/) {
+ $_ = "$1]$3.$4";
+ } elsif (/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/([^\s\#]*)([\s\#].*)$/) {
+ $_ = "$1]$3$4";
+ }
+ }
+ print $_,"\n";
+}
diff --git a/openssl-1.1.0h/VMS/engine.opt b/openssl-1.1.0h/VMS/engine.opt
new file mode 100644
index 0000000..1c73c80
--- /dev/null
+++ b/openssl-1.1.0h/VMS/engine.opt
@@ -0,0 +1,2 @@
+CASE_SENSITIVE=YES
+SYMBOL_VECTOR=(bind_engine=PROCEDURE,v_check=PROCEDURE)
diff --git a/openssl-1.1.0h/VMS/openssl_ivp.com.in b/openssl-1.1.0h/VMS/openssl_ivp.com.in
new file mode 100644
index 0000000..825a699
--- /dev/null
+++ b/openssl-1.1.0h/VMS/openssl_ivp.com.in
@@ -0,0 +1,50 @@
+$ ! OpenSSL Internal Verification Procedure
+$ !
+$ ! This script checks the consistency of a OpenSSL installation
+$ ! It had better be spawned, as it creates process logicals
+$
+$ ! Generated information
+$ INSTALLTOP := {- $config{INSTALLTOP} -}
+$ OPENSSLDIR := {- $config{OPENSSLDIR} -}
+$
+$ ! Make sure that INSTALLTOP and OPENSSLDIR become something one
+$ ! can use to call the startup procedure
+$ INSTALLTOP_ = F$PARSE("A.;",INSTALLTOP,,,"NO_CONCEAL") -
+ - ".][000000" - "[000000." - "][" - "]A.;" + "."
+$ OPENSSLDIR_ = F$PARSE("A.;",OPENSSLDIR,,,"NO_CONCEAL") -
+ - ".][000000" - "[000000." - "][" - "]A.;" + "."
+$
+$ v := {- sprintf "%02d%02d", split(/\./, $config{version}) -}
+$ pz := {- $config{pointer_size} -}
+$
+$ @'INSTALLTOP_'SYS$STARTUP]openssl_startup'v'
+$ @'INSTALLTOP_'SYS$STARTUP]openssl_utils'v'
+$
+$ IF F$SEARCH("OSSL$LIBCRYPTO''pz'") .EQS. "" -
+ .OR. F$SEARCH("OSSL$LIBSSL''pz'") .EQS. "" {- output_off() if $config{no_shared}; "" -}-
+ .OR. F$SEARCH("OSSL$LIBCRYPTO_SHR''pz'") .EQS. "" -
+ .OR. F$SEARCH("OSSL$LIBSSL_SHR''pz'") .EQS. "" {- output_on() if $config{no_shared}; "" -}-
+ .OR. F$SEARCH("OSSL$INCLUDE:[OPENSSL]crypto.h") .EQS. "" -
+ .OR. F$SEARCH("OPENSSL:crypto.h") .EQS. "" -
+ .OR. F$SEARCH("OSSL$EXE:OPENSSL''v'.EXE") .EQS. ""
+$ THEN
+$ WRITE SYS$ERROR "Installation inconsistent"
+$ EXIT %x00018292 ! RMS$_FNF, file not found
+$ ENDIF
+$
+$ ON ERROR THEN GOTO error
+$
+$ ! If something else is wrong with the installation, we're likely
+$ ! to get an image activation error here
+$ openssl version -a
+$
+$ ! FUTURE ENHANCEMENT: Verify that engines are where they should be.
+$ ! openssl engine -c -t checker
+$
+$ WRITE SYS$ERROR "OpenSSL IVP passed"
+$ EXIT %x10000001
+$
+$ error:
+$ save_status = $STATUS
+$ WRITE SYS$ERROR "OpenSSL IVP failed"
+$ EXIT 'save_status'
diff --git a/openssl-1.1.0h/VMS/openssl_shutdown.com.in b/openssl-1.1.0h/VMS/openssl_shutdown.com.in
new file mode 100644
index 0000000..f0df1c1
--- /dev/null
+++ b/openssl-1.1.0h/VMS/openssl_shutdown.com.in
@@ -0,0 +1,56 @@
+$ ! OpenSSL shutdown script
+$ !
+$ ! This script deassigns the logical names used by the installation
+$ ! of OpenSSL. It can do so at any level, defined by P1.
+$ !
+$ ! P1 Qualifier(s) for DEASSIGN.
+$ ! Default: /PROCESS
+$ !
+$ ! P2 If the value is "NOALIASES", no alias logical names are
+$ ! deassigned.
+$
+$ status = %x10000001 ! Generic success
+$
+$ ! In case there's a problem
+$ ON CONTROL_Y THEN GOTO bailout
+$ ON ERROR THEN GOTO bailout
+$
+$ ! Find the architecture
+$ IF F$GETSYI("CPU") .LT. 128
+$ THEN
+$ arch := VAX
+$ ELSE
+$ arch := F$EDIT(F$GETSYI("ARCH_NAME"),"UPCASE")
+$ IF arch .EQS. "" THEN GOTO unknown_arch
+$ ENDIF
+$
+$ ! Abbrevs
+$ DEAS := DEASSIGN /NOLOG 'P1'
+$ sv := {- sprintf "%02d%02d", $config{shlib_major}, $config{shlib_minor} -}
+$ pz := {- $config{pointer_size} -}
+$
+$ DEAS OSSL$DATAROOT
+$ DEAS OSSL$INSTROOT
+$ DEAS OSSL$INCLUDE
+$ DEAS OSSL$LIB
+$ DEAS OSSL$SHARE
+$ DEAS OSSL$ENGINES'sv'
+$ DEAS OSSL$EXE
+$ DEAS OSSL$LIBCRYPTO'pz'
+$ DEAS OSSL$LIBSSL'pz'
+${- output_off() if $config{no_shared}; "" -}
+$ DEAS OSSL$LIBCRYPTO'sv'_SHR'pz'
+$ DEAS OSSL$LIBSSL'sv'_SHR'pz'
+${- output_on() if $config{no_shared}; "" -}
+$ DEAS OPENSSL
+$
+$ IF P2 .NES. "NOALIASES"
+$ THEN
+$ DEAS OSSL$ENGINES
+${- output_off() if $config{no_shared}; "" -}
+$ DEAS OSSL$LIBCRYPTO_SHR'pz'
+$ DEAS OSSL$LIBSSL_SHR'pz'
+${- output_on() if $config{no_shared}; "" -}
+$ ENDIF
+$
+$ EXIT 'status'
diff --git a/openssl-1.1.0h/VMS/openssl_startup.com.in b/openssl-1.1.0h/VMS/openssl_startup.com.in
new file mode 100644
index 0000000..9c8c09a
--- /dev/null
+++ b/openssl-1.1.0h/VMS/openssl_startup.com.in
@@ -0,0 +1,123 @@
+$ ! OpenSSL startup script
+$ !
+$ ! This script defines the logical names used by the installation
+$ ! of OpenSSL. It can provide those logical names at any level,
+$ ! defined by P1.
+$ !
+$ ! The logical names created are:
+$ !
+$ ! OSSL$INSTROOT Installation root
+$ ! OSSL$DATAROOT Data root (common directory
+$ ! for certs etc)
+$ ! OSSL$INCLUDE Include directory root
+$ ! OSSL$LIB Where the static library files
+$ ! are located
+$ ! OSSL$SHARE Where the shareable image files
+$ ! are located
+$ ! OSSL$EXE Where the executables are located
+$ ! OSSL$ENGINESnnn Where the shareable images are located
+$ ! OSSL$LIBCRYPTO The static crypto library
+$ ! OSSL$LIBSSL The static ssl library
+$ ! OSSL$LIBCRYPTOnnn_SHR The shareable crypto image
+$ ! OSSL$LIBSSLnnn_SHR The shareable ssl image
+$ ! OPENSSL is OSSL$INCLUDE:[OPENSSL]
+$ !
+$ ! In all these, nnn is the OpenSSL version number. This allows
+$ ! several OpenSSL versions to be installed simultaneously, which
+$ ! matters for applications that are linked to the shareable images
+$ ! or that depend on engines.
+$ !
+$ ! In addition, unless P2 is "NOALIASES", these logical names are
+$ ! created:
+$ !
+$ ! OSSL$ENGINES Alias for OSSL$ENGINESnnn
+$ ! OSSL$LIBCRYPTO_SHR Alias for OSSL$LIBCRYPTOnnn_SHR
+$ ! OSSL$LIBSSL_SHR Alias for OSSL$LIBSSLnnn_SHR
+$ !
+$ ! P1 Qualifier(s) for DEFINE. "/SYSTEM" would be typical when
+$ ! calling this script from SYS$STARTUP:SYSTARTUP_VMS.COM,
+$ ! while "/PROCESS" would be typical for a personal install.
+$ ! Default: /PROCESS
+$ !
+$ ! P2 If the value is "NOALIASES", no alias logical names are
+$ ! created.
+$
+$ status = %x10000001 ! Generic success
+$
+$ ! In case there's a problem
+$ ON CONTROL_Y THEN GOTO bailout
+$ ON ERROR THEN GOTO bailout
+$
+$ ! Find the architecture
+$ IF F$GETSYI("CPU") .LT. 128
+$ THEN
+$ arch := VAX
+$ ELSE
+$ arch = F$EDIT(F$GETSYI("ARCH_NAME"),"UPCASE")
+$ IF arch .EQS. "" THEN GOTO unknown_arch
+$ ENDIF
+$
+$ ! Generated information
+$ INSTALLTOP := {- $config{INSTALLTOP} -}
+$ OPENSSLDIR := {- $config{OPENSSLDIR} -}
+$
+$ ! Make sure that INSTALLTOP and OPENSSLDIR become something one
+$ ! can build concealed logical names on
+$ INSTALLTOP_ = F$PARSE("A.;",INSTALLTOP,,,"NO_CONCEAL") -
+ - ".][000000" - "[000000." - "][" - "]A.;" + "."
+$ OPENSSLDIR_ = F$PARSE("A.;",OPENSSLDIR,,,"NO_CONCEAL") -
+ - ".][000000" - "[000000." - "][" - "]A.;" + "."
+$
+$ DEFINE /TRANSLATION=CONCEALED /NOLOG WRK_INSTALLTOP 'INSTALLTOP_']
+$ DEFINE /TRANSLATION=CONCEALED /NOLOG WRK_OPENSSLDIR 'OPENSSLDIR_']
+$
+$ ! Check that things are in place, and specifically, the stuff
+$ ! belonging to this architecture
+$ IF F$SEARCH("WRK_INSTALLTOP:[000000]INCLUDE.DIR;1") .EQS. "" -
+ .OR. F$SEARCH("WRK_INSTALLTOP:[000000]LIB.DIR;1") .EQS. "" -
+ .OR. F$SEARCH("WRK_INSTALLTOP:[000000]EXE.DIR;1") .EQS. "" -
+ .OR. F$SEARCH("WRK_INSTALLTOP:[LIB]''arch'.DIR;1") .EQS. "" -
+ .OR. F$SEARCH("WRK_INSTALLTOP:[EXE]''arch'.DIR;1") .EQS. "" -
+ .OR. F$SEARCH("WRK_OPENSSLDIR:[000000]openssl.cnf") .EQS. ""
+$ THEN
+$ WRITE SYS$ERROR "''INSTALLTOP' doesn't look like an OpenSSL installation for ''arch'"
+$ status = %x00018292 ! RMS$_FNF, file not found
+$ GOTO bailout
+$ ENDIF
+$
+$ ! Abbrevs
+$ DEFT := DEFINE /TRANSLATION=CONCEALED /NOLOG 'P1'
+$ DEF := DEFINE /NOLOG 'P1'
+$ sv := {- sprintf "%02d%02d", $config{shlib_major}, $config{shlib_minor} -}
+$ pz := {- $config{pointer_size} -}
+$
+$ DEFT OSSL$DATAROOT 'OPENSSLDIR_']
+$ DEFT OSSL$INSTROOT 'INSTALLTOP_']
+$ DEFT OSSL$INCLUDE 'INSTALLTOP_'INCLUDE.]
+$ DEF OSSL$LIB OSSL$INSTROOT:[LIB.'arch']
+$ DEF OSSL$SHARE OSSL$INSTROOT:[LIB.'arch']
+$ DEF OSSL$ENGINES'sv''pz' OSSL$INSTROOT:[ENGINES'sv''pz'.'arch']
+$ DEF OSSL$EXE OSSL$INSTROOT:[EXE.'arch'],-
+ OSSL$INSTROOT:[EXE]
+$ DEF OSSL$LIBCRYPTO'pz' OSSL$LIB:OSSL$LIBCRYPTO'pz'.OLB
+$ DEF OSSL$LIBSSL'pz' OSSL$LIB:OSSL$LIBSSL'pz'.OLB
+${- output_off() if $config{no_shared}; "" -}
+$ DEF OSSL$LIBCRYPTO'sv'_SHR'pz' OSSL$SHARE:OSSL$LIBCRYPTO'sv'_SHR'pz'.EXE
+$ DEF OSSL$LIBSSL'sv'_SHR'pz' OSSL$SHARE:OSSL$LIBSSL'sv'_SHR'pz'.EXE
+${- output_on() if $config{no_shared}; "" -}
+$ DEF OPENSSL OSSL$INCLUDE:[OPENSSL]
+$
+$ IF P2 .NES. "NOALIASES"
+$ THEN
+$ DEF OSSL$ENGINES'pz' OSSL$ENGINES'sv''pz'
+${- output_off() if $config{no_shared}; "" -}
+$ DEF OSSL$LIBCRYPTO_SHR'pz' OSSL$LIBCRYPTO'sv'_SHR'pz'
+$ DEF OSSL$LIBSSL_SHR'pz' OSSL$LIBSSL'sv'_SHR'pz'
+${- output_on() if $config{no_shared}; "" -}
+$ ENDIF
+$
+$ bailout:
+$ DEASSIGN WRK_INSTALLTOP
+$ DEASSIGN WRK_OPENSSLDIR
+$
+$ EXIT 'status'
diff --git a/openssl-1.1.0h/VMS/openssl_utils.com.in b/openssl-1.1.0h/VMS/openssl_utils.com.in
new file mode 100644
index 0000000..edd733d
--- /dev/null
+++ b/openssl-1.1.0h/VMS/openssl_utils.com.in
@@ -0,0 +1,14 @@
+$ ! OpenSSL utilities
+$ !
+$
+$ v := {- sprintf "%02d%02d", split(/\./, $config{version}) -}
+$
+$ OPENSSL'v' :== $OSSL$EXE:OPENSSL'v'
+$ OPENSSL :== $OSSL$EXE:OPENSSL'v'
+$
+$ IF F$TYPE(PERL) .EQS. "STRING"
+$ THEN
+$ C_REHASH :== 'PERL' OSSL$EXE:c_rehash.pl
+$ ELSE
+$ WRITE SYS$ERROR "NOTE: no perl => no C_REHASH"
+$ ENDIF
diff --git a/openssl-1.1.0h/VMS/test-includes.com b/openssl-1.1.0h/VMS/test-includes.com
new file mode 100644
index 0000000..c1d7ccd
--- /dev/null
+++ b/openssl-1.1.0h/VMS/test-includes.com
@@ -0,0 +1,28 @@
+$! Quick script to check how well including individual header files works
+$! on VMS, even when the VMS macro isn't defined.
+$
+$ sav_def = f$env("DEFAULT")
+$ here = f$parse("A.;0",f$ENV("PROCEDURE")) - "A.;0"
+$ set default 'here'
+$ set default [-.include.openssl]
+$ define openssl 'f$env("DEFAULT")'
+$ set default [--]
+$
+$ loop:
+$ f = f$search("openssl:*.h")
+$ if f .eqs. "" then goto loop_end
+$ write sys$output "Checking ",f
+$ open/write foo foo.c
+$ write foo "#undef VMS"
+$ write foo "#include <stdio.h>"
+$ write foo "#include <openssl/",f$parse(f,,,"NAME"),".h>"
+$ write foo "main()"
+$ write foo "{printf(""foo\n"");}"
+$ close foo
+$ cc/STANDARD=ANSI89/NOLIST/PREFIX=ALL foo.c
+$ delete foo.c;
+$ goto loop
+$ loop_end:
+$ set default 'save_def'
+$ exit
+
diff --git a/openssl-1.1.0h/VMS/translatesyms.pl b/openssl-1.1.0h/VMS/translatesyms.pl
new file mode 100644
index 0000000..f61d954
--- /dev/null
+++ b/openssl-1.1.0h/VMS/translatesyms.pl
@@ -0,0 +1,62 @@
+#! /usr/bin/env perl
+# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+
+# This script will translate any SYMBOL_VECTOR item that has a translation
+# in CXX$DEMANGLER_DB. The latter is generated by and CC/DECC command that
+# uses the qualifier /REPOSITORY with the build directory as value. When
+# /NAMES=SHORTENED has been used, this file will hold the translations from
+# the original symbols to the shortened variants.
+#
+# CXX$DEMAGLER_DB. is an ISAM file, but with the magic of RMS, it can be
+# read as a text file, with each record as one line.
+#
+# The lines will have the following syntax for any symbol found that's longer
+# than 31 characters:
+#
+# LONG_symbol_34567890123{cksum}$LONG_symbol_34567890123_more_than_31_chars
+#
+# $ is present at the end of the shortened symbol name, and is preceded by a
+# 7 character checksum. The $ makes it easy to separate the shortened name
+# from the original one.
+
+use strict;
+use warnings;
+
+usage() if scalar @ARGV < 1;
+
+my %translations = ();
+
+open DEMANGLER_DATA, $ARGV[0]
+ or die "Couldn't open $ARGV[0]: $!\n";
+while(<DEMANGLER_DATA>) {
+ s|\R$||;
+ (my $translated, my $original) = split /\$/;
+ $translations{$original} = $translated.'$';
+}
+close DEMANGLER_DATA;
+
+$| = 1; # Autoflush
+while(<STDIN>) {
+ s@
+ ((?:[A-Za-z0-9_]+)\/)?([A-Za-z0-9_]+)=(PROCEDURE|DATA)
+ @
+ if (defined($translations{$2})) {
+ my $trans = $translations{$2};
+ my $trans_uc = uc $trans;
+ if (defined($1) && $trans ne $trans_uc) {
+ "$trans_uc/$trans=$3"
+ } else {
+ "$trans=$3"
+ }
+ } else {
+ $&
+ }
+ @gxe;
+ print $_;
+}
diff --git a/openssl-1.1.0h/apps/CA.pl.in b/openssl-1.1.0h/apps/CA.pl.in
new file mode 100644
index 0000000..7277eec
--- /dev/null
+++ b/openssl-1.1.0h/apps/CA.pl.in
@@ -0,0 +1,196 @@
+#!{- $config{hashbangperl} -}
+# Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+#
+# Wrapper around the ca to make it easier to use
+#
+# {- join("\n# ", @autowarntext) -}
+
+use strict;
+use warnings;
+
+my $openssl = "openssl";
+if(defined $ENV{'OPENSSL'}) {
+ $openssl = $ENV{'OPENSSL'};
+} else {
+ $ENV{'OPENSSL'} = $openssl;
+}
+
+my $verbose = 1;
+
+my $OPENSSL_CONFIG = $ENV{"OPENSSL_CONFIG"} || "";
+my $DAYS = "-days 365";
+my $CADAYS = "-days 1095"; # 3 years
+my $REQ = "$openssl req $OPENSSL_CONFIG";
+my $CA = "$openssl ca $OPENSSL_CONFIG";
+my $VERIFY = "$openssl verify";
+my $X509 = "$openssl x509";
+my $PKCS12 = "$openssl pkcs12";
+
+# default openssl.cnf file has setup as per the following
+my $CATOP = "./demoCA";
+my $CAKEY = "cakey.pem";
+my $CAREQ = "careq.pem";
+my $CACERT = "cacert.pem";
+my $CACRL = "crl.pem";
+my $DIRMODE = 0777;
+
+my $NEWKEY = "newkey.pem";
+my $NEWREQ = "newreq.pem";
+my $NEWCERT = "newcert.pem";
+my $NEWP12 = "newcert.p12";
+my $RET = 0;
+my $WHAT = shift @ARGV || "";
+my $FILE;
+
+# See if reason for a CRL entry is valid; exit if not.
+sub crl_reason_ok
+{
+ my $r = shift;
+
+ if ($r eq 'unspecified' || $r eq 'keyCompromise'
+ || $r eq 'CACompromise' || $r eq 'affiliationChanged'
+ || $r eq 'superseded' || $r eq 'cessationOfOperation'
+ || $r eq 'certificateHold' || $r eq 'removeFromCRL') {
+ return 1;
+ }
+ print STDERR "Invalid CRL reason; must be one of:\n";
+ print STDERR " unspecified, keyCompromise, CACompromise,\n";
+ print STDERR " affiliationChanged, superseded, cessationOfOperation\n";
+ print STDERR " certificateHold, removeFromCRL";
+ exit 1;
+}
+
+# Copy a PEM-format file; return like exit status (zero means ok)
+sub copy_pemfile
+{
+ my ($infile, $outfile, $bound) = @_;
+ my $found = 0;
+
+ open IN, $infile || die "Cannot open $infile, $!";
+ open OUT, ">$outfile" || die "Cannot write to $outfile, $!";
+ while (<IN>) {
+ $found = 1 if /^-----BEGIN.*$bound/;
+ print OUT $_ if $found;
+ $found = 2, last if /^-----END.*$bound/;
+ }
+ close IN;
+ close OUT;
+ return $found == 2 ? 0 : 1;
+}
+
+# Wrapper around system; useful for debugging. Returns just the exit status
+sub run
+{
+ my $cmd = shift;
+ print "====\n$cmd\n" if $verbose;
+ my $status = system($cmd);
+ print "==> $status\n====\n" if $verbose;
+ return $status >> 8;
+}
+
+
+if ( $WHAT =~ /^(-\?|-h|-help)$/ ) {
+ print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-signcert|-verify\n";
+ print STDERR " CA -pkcs12 [certname]\n";
+ print STDERR " CA -crl|-revoke cert-filename [reason]\n";
+ exit 0;
+}
+if ($WHAT eq '-newcert' ) {
+ # create a certificate
+ $RET = run("$REQ -new -x509 -keyout $NEWKEY -out $NEWCERT $DAYS");
+ print "Cert is in $NEWCERT, private key is in $NEWKEY\n" if $RET == 0;
+} elsif ($WHAT eq '-newreq' ) {
+ # create a certificate request
+ $RET = run("$REQ -new -keyout $NEWKEY -out $NEWREQ $DAYS");
+ print "Request is in $NEWREQ, private key is in $NEWKEY\n" if $RET == 0;
+} elsif ($WHAT eq '-newreq-nodes' ) {
+ # create a certificate request
+ $RET = run("$REQ -new -nodes -keyout $NEWKEY -out $NEWREQ $DAYS");
+ print "Request is in $NEWREQ, private key is in $NEWKEY\n" if $RET == 0;
+} elsif ($WHAT eq '-newca' ) {
+ # create the directory hierarchy
+ mkdir ${CATOP}, $DIRMODE;
+ mkdir "${CATOP}/certs", $DIRMODE;
+ mkdir "${CATOP}/crl", $DIRMODE ;
+ mkdir "${CATOP}/newcerts", $DIRMODE;
+ mkdir "${CATOP}/private", $DIRMODE;
+ open OUT, ">${CATOP}/index.txt";
+ close OUT;
+ open OUT, ">${CATOP}/crlnumber";
+ print OUT "01\n";
+ close OUT;
+ # ask user for existing CA certificate
+ print "CA certificate filename (or enter to create)\n";
+ $FILE = "" unless defined($FILE = <STDIN>);
+ $FILE =~ s{\R$}{};
+ if ($FILE ne "") {
+ copy_pemfile($FILE,"${CATOP}/private/$CAKEY", "PRIVATE");
+ copy_pemfile($FILE,"${CATOP}/$CACERT", "CERTIFICATE");
+ } else {
+ print "Making CA certificate ...\n";
+ $RET = run("$REQ -new -keyout"
+ . " ${CATOP}/private/$CAKEY"
+ . " -out ${CATOP}/$CAREQ");
+ $RET = run("$CA -create_serial"
+ . " -out ${CATOP}/$CACERT $CADAYS -batch"
+ . " -keyfile ${CATOP}/private/$CAKEY -selfsign"
+ . " -extensions v3_ca"
+ . " -infiles ${CATOP}/$CAREQ") if $RET == 0;
+ print "CA certificate is in ${CATOP}/$CACERT\n" if $RET == 0;
+ }
+} elsif ($WHAT eq '-pkcs12' ) {
+ my $cname = $ARGV[0];
+ $cname = "My Certificate" unless defined $cname;
+ $RET = run("$PKCS12 -in $NEWCERT -inkey $NEWKEY"
+ . " -certfile ${CATOP}/$CACERT"
+ . " -out $NEWP12"
+ . " -export -name \"$cname\"");
+ print "PKCS #12 file is in $NEWP12\n" if $RET == 0;
+} elsif ($WHAT eq '-xsign' ) {
+ $RET = run("$CA -policy policy_anything -infiles $NEWREQ");
+} elsif ($WHAT eq '-sign' ) {
+ $RET = run("$CA -policy policy_anything -out $NEWCERT -infiles $NEWREQ");
+ print "Signed certificate is in $NEWCERT\n" if $RET == 0;
+} elsif ($WHAT eq '-signCA' ) {
+ $RET = run("$CA -policy policy_anything -out $NEWCERT"
+ . " -extensions v3_ca -infiles $NEWREQ");
+ print "Signed CA certificate is in $NEWCERT\n" if $RET == 0;
+} elsif ($WHAT eq '-signcert' ) {
+ $RET = run("$X509 -x509toreq -in $NEWREQ -signkey $NEWREQ"
+ . " -out tmp.pem");
+ $RET = run("$CA -policy policy_anything -out $NEWCERT"
+ . " -infiles tmp.pem") if $RET == 0;
+ print "Signed certificate is in $NEWCERT\n" if $RET == 0;
+} elsif ($WHAT eq '-verify' ) {
+ my @files = @ARGV ? @ARGV : ( $NEWCERT );
+ my $file;
+ foreach $file (@files) {
+ my $status = run("$VERIFY \"-CAfile\" ${CATOP}/$CACERT $file");
+ $RET = $status if $status != 0;
+ }
+} elsif ($WHAT eq '-crl' ) {
+ $RET = run("$CA -gencrl -out ${CATOP}/crl/$CACRL");
+ print "Generated CRL is in ${CATOP}/crl/$CACRL\n" if $RET == 0;
+} elsif ($WHAT eq '-revoke' ) {
+ my $cname = $ARGV[0];
+ if (!defined $cname) {
+ print "Certificate filename is required; reason optional.\n";
+ exit 1;
+ }
+ my $reason = $ARGV[1];
+ $reason = " -crl_reason $reason"
+ if defined $reason && crl_reason_ok($reason);
+ $RET = run("$CA -revoke \"$cname\"" . $reason);
+} else {
+ print STDERR "Unknown arg \"$WHAT\"\n";
+ print STDERR "Use -help for help.\n";
+ exit 1;
+}
+
+exit $RET;
diff --git a/openssl-1.1.0h/apps/app_rand.c b/openssl-1.1.0h/apps/app_rand.c
new file mode 100644
index 0000000..ff0771c
--- /dev/null
+++ b/openssl-1.1.0h/apps/app_rand.c
@@ -0,0 +1,115 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "apps.h"
+#include <openssl/bio.h>
+#include <openssl/rand.h>
+
+static int seeded = 0;
+static int egdsocket = 0;
+
+int app_RAND_load_file(const char *file, int dont_warn)
+{
+ int consider_randfile = (file == NULL);
+ char buffer[200];
+
+ if (file == NULL)
+ file = RAND_file_name(buffer, sizeof(buffer));
+#ifndef OPENSSL_NO_EGD
+ else if (RAND_egd(file) > 0) {
+ /*
+ * we try if the given filename is an EGD socket. if it is, we don't
+ * write anything back to the file.
+ */
+ egdsocket = 1;
+ return 1;
+ }
+#endif
+ if (file == NULL || !RAND_load_file(file, -1)) {
+ if (RAND_status() == 0) {
+ if (!dont_warn) {
+ BIO_printf(bio_err, "unable to load 'random state'\n");
+ BIO_printf(bio_err,
+ "This means that the random number generator has not been seeded\n");
+ BIO_printf(bio_err, "with much random data.\n");
+ if (consider_randfile) { /* explanation does not apply when a
+ * file is explicitly named */
+ BIO_printf(bio_err,
+ "Consider setting the RANDFILE environment variable to point at a file that\n");
+ BIO_printf(bio_err,
+ "'random' data can be kept in (the file will be overwritten).\n");
+ }
+ }
+ return 0;
+ }
+ }
+ seeded = 1;
+ return 1;
+}
+
+long app_RAND_load_files(char *name)
+{
+ char *p, *n;
+ int last;
+ long tot = 0;
+#ifndef OPENSSL_NO_EGD
+ int egd;
+#endif
+
+ for (;;) {
+ last = 0;
+ for (p = name; ((*p != '\0') && (*p != LIST_SEPARATOR_CHAR)); p++) ;
+ if (*p == '\0')
+ last = 1;
+ *p = '\0';
+ n = name;
+ name = p + 1;
+ if (*n == '\0')
+ break;
+
+#ifndef OPENSSL_NO_EGD
+ egd = RAND_egd(n);
+ if (egd > 0)
+ tot += egd;
+ else
+#endif
+ tot += RAND_load_file(n, -1);
+ if (last)
+ break;
+ }
+ if (tot > 512)
+ app_RAND_allow_write_file();
+ return (tot);
+}
+
+int app_RAND_write_file(const char *file)
+{
+ char buffer[200];
+
+ if (egdsocket || !seeded)
+ /*
+ * If we did not manage to read the seed file, we should not write a
+ * low-entropy seed file back -- it would suppress a crucial warning
+ * the next time we want to use it.
+ */
+ return 0;
+
+ if (file == NULL)
+ file = RAND_file_name(buffer, sizeof(buffer));
+ if (file == NULL || !RAND_write_file(file)) {
+ BIO_printf(bio_err, "unable to write 'random state'\n");
+ return 0;
+ }
+ return 1;
+}
+
+void app_RAND_allow_write_file(void)
+{
+ seeded = 1;
+}
diff --git a/openssl-1.1.0h/apps/apps.c b/openssl-1.1.0h/apps/apps.c
new file mode 100644
index 0000000..8703d0c
--- /dev/null
+++ b/openssl-1.1.0h/apps/apps.c
@@ -0,0 +1,2650 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS)
+/*
+ * On VMS, you need to define this to get the declaration of fileno(). The
+ * value 2 is to make sure no function defined in POSIX-2 is left undefined.
+ */
+# define _POSIX_C_SOURCE 2
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#ifndef OPENSSL_NO_POSIX_IO
+# include <sys/stat.h>
+# include <fcntl.h>
+#endif
+#include <ctype.h>
+#include <errno.h>
+#include <openssl/err.h>
+#include <openssl/x509.h>
+#include <openssl/x509v3.h>
+#include <openssl/pem.h>
+#include <openssl/pkcs12.h>
+#include <openssl/ui.h>
+#include <openssl/safestack.h>
+#ifndef OPENSSL_NO_ENGINE
+# include <openssl/engine.h>
+#endif
+#ifndef OPENSSL_NO_RSA
+# include <openssl/rsa.h>
+#endif
+#include <openssl/bn.h>
+#include <openssl/ssl.h>
+#include "s_apps.h"
+#include "apps.h"
+
+#ifdef _WIN32
+static int WIN32_rename(const char *from, const char *to);
+# define rename(from,to) WIN32_rename((from),(to))
+#endif
+
+typedef struct {
+ const char *name;
+ unsigned long flag;
+ unsigned long mask;
+} NAME_EX_TBL;
+
+#if !defined(OPENSSL_NO_UI) || !defined(OPENSSL_NO_ENGINE)
+static UI_METHOD *ui_method = NULL;
+#endif
+
+static int set_table_opts(unsigned long *flags, const char *arg,
+ const NAME_EX_TBL * in_tbl);
+static int set_multi_opts(unsigned long *flags, const char *arg,
+ const NAME_EX_TBL * in_tbl);
+
+int app_init(long mesgwin);
+
+int chopup_args(ARGS *arg, char *buf)
+{
+ int quoted;
+ char c = '\0', *p = NULL;
+
+ arg->argc = 0;
+ if (arg->size == 0) {
+ arg->size = 20;
+ arg->argv = app_malloc(sizeof(*arg->argv) * arg->size, "argv space");
+ }
+
+ for (p = buf;;) {
+ /* Skip whitespace. */
+ while (*p && isspace(_UC(*p)))
+ p++;
+ if (!*p)
+ break;
+
+ /* The start of something good :-) */
+ if (arg->argc >= arg->size) {
+ char **tmp;
+ arg->size += 20;
+ tmp = OPENSSL_realloc(arg->argv, sizeof(*arg->argv) * arg->size);
+ if (tmp == NULL)
+ return 0;
+ arg->argv = tmp;
+ }
+ quoted = *p == '\'' || *p == '"';
+ if (quoted)
+ c = *p++;
+ arg->argv[arg->argc++] = p;
+
+ /* now look for the end of this */
+ if (quoted) {
+ while (*p && *p != c)
+ p++;
+ *p++ = '\0';
+ } else {
+ while (*p && !isspace(_UC(*p)))
+ p++;
+ if (*p)
+ *p++ = '\0';
+ }
+ }
+ arg->argv[arg->argc] = NULL;
+ return (1);
+}
+
+#ifndef APP_INIT
+int app_init(long mesgwin)
+{
+ return (1);
+}
+#endif
+
+int ctx_set_verify_locations(SSL_CTX *ctx, const char *CAfile,
+ const char *CApath, int noCAfile, int noCApath)
+{
+ if (CAfile == NULL && CApath == NULL) {
+ if (!noCAfile && SSL_CTX_set_default_verify_file(ctx) <= 0)
+ return 0;
+ if (!noCApath && SSL_CTX_set_default_verify_dir(ctx) <= 0)
+ return 0;
+
+ return 1;
+ }
+ return SSL_CTX_load_verify_locations(ctx, CAfile, CApath);
+}
+
+#ifndef OPENSSL_NO_CT
+
+int ctx_set_ctlog_list_file(SSL_CTX *ctx, const char *path)
+{
+ if (path == NULL) {
+ return SSL_CTX_set_default_ctlog_list_file(ctx);
+ }
+
+ return SSL_CTX_set_ctlog_list_file(ctx, path);
+}
+
+#endif
+
+int dump_cert_text(BIO *out, X509 *x)
+{
+ char *p;
+
+ p = X509_NAME_oneline(X509_get_subject_name(x), NULL, 0);
+ BIO_puts(out, "subject=");
+ BIO_puts(out, p);
+ OPENSSL_free(p);
+
+ p = X509_NAME_oneline(X509_get_issuer_name(x), NULL, 0);
+ BIO_puts(out, "\nissuer=");
+ BIO_puts(out, p);
+ BIO_puts(out, "\n");
+ OPENSSL_free(p);
+
+ return 0;
+}
+
+#ifndef OPENSSL_NO_UI
+static int ui_open(UI *ui)
+{
+ return UI_method_get_opener(UI_OpenSSL())(ui);
+}
+
+static int ui_read(UI *ui, UI_STRING *uis)
+{
+ if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
+ && UI_get0_user_data(ui)) {
+ switch (UI_get_string_type(uis)) {
+ case UIT_PROMPT:
+ case UIT_VERIFY:
+ {
+ const char *password =
+ ((PW_CB_DATA *)UI_get0_user_data(ui))->password;
+ if (password && password[0] != '\0') {
+ UI_set_result(ui, uis, password);
+ return 1;
+ }
+ }
+ default:
+ break;
+ }
+ }
+ return UI_method_get_reader(UI_OpenSSL())(ui, uis);
+}
+
+static int ui_write(UI *ui, UI_STRING *uis)
+{
+ if (UI_get_input_flags(uis) & UI_INPUT_FLAG_DEFAULT_PWD
+ && UI_get0_user_data(ui)) {
+ switch (UI_get_string_type(uis)) {
+ case UIT_PROMPT:
+ case UIT_VERIFY:
+ {
+ const char *password =
+ ((PW_CB_DATA *)UI_get0_user_data(ui))->password;
+ if (password && password[0] != '\0')
+ return 1;
+ }
+ default:
+ break;
+ }
+ }
+ return UI_method_get_writer(UI_OpenSSL())(ui, uis);
+}
+
+static int ui_close(UI *ui)
+{
+ return UI_method_get_closer(UI_OpenSSL())(ui);
+}
+
+int setup_ui_method(void)
+{
+ ui_method = UI_create_method("OpenSSL application user interface");
+ UI_method_set_opener(ui_method, ui_open);
+ UI_method_set_reader(ui_method, ui_read);
+ UI_method_set_writer(ui_method, ui_write);
+ UI_method_set_closer(ui_method, ui_close);
+ return 0;
+}
+
+void destroy_ui_method(void)
+{
+ if (ui_method) {
+ UI_destroy_method(ui_method);
+ ui_method = NULL;
+ }
+}
+#endif
+
+int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)
+{
+ int res = 0;
+#ifndef OPENSSL_NO_UI
+ UI *ui = NULL;
+#endif
+ PW_CB_DATA *cb_data = (PW_CB_DATA *)cb_tmp;
+
+#ifdef OPENSSL_NO_UI
+ if (cb_data != NULL && cb_data->password != NULL) {
+ res = strlen(cb_data->password);
+ if (res > bufsiz)
+ res = bufsiz;
+ memcpy(buf, cb_data->password, res);
+ }
+#else
+ ui = UI_new_method(ui_method);
+ if (ui) {
+ int ok = 0;
+ char *buff = NULL;
+ int ui_flags = 0;
+ const char *prompt_info = NULL;
+ char *prompt;
+
+ if (cb_data != NULL && cb_data->prompt_info != NULL)
+ prompt_info = cb_data->prompt_info;
+ prompt = UI_construct_prompt(ui, "pass phrase", prompt_info);
+ if (!prompt) {
+ BIO_printf(bio_err, "Out of memory\n");
+ UI_free(ui);
+ return 0;
+ }
+
+ ui_flags |= UI_INPUT_FLAG_DEFAULT_PWD;
+ UI_ctrl(ui, UI_CTRL_PRINT_ERRORS, 1, 0, 0);
+
+ /* We know that there is no previous user data to return to us */
+ (void)UI_add_user_data(ui, cb_data);
+
+ if (ok >= 0)
+ ok = UI_add_input_string(ui, prompt, ui_flags, buf,
+ PW_MIN_LENGTH, bufsiz - 1);
+ if (ok >= 0 && verify) {
+ buff = app_malloc(bufsiz, "password buffer");
+ ok = UI_add_verify_string(ui, prompt, ui_flags, buff,
+ PW_MIN_LENGTH, bufsiz - 1, buf);
+ }
+ if (ok >= 0)
+ do {
+ ok = UI_process(ui);
+ }
+ while (ok < 0 && UI_ctrl(ui, UI_CTRL_IS_REDOABLE, 0, 0, 0));
+
+ OPENSSL_clear_free(buff, (unsigned int)bufsiz);
+
+ if (ok >= 0)
+ res = strlen(buf);
+ if (ok == -1) {
+ BIO_printf(bio_err, "User interface error\n");
+ ERR_print_errors(bio_err);
+ OPENSSL_cleanse(buf, (unsigned int)bufsiz);
+ res = 0;
+ }
+ if (ok == -2) {
+ BIO_printf(bio_err, "aborted!\n");
+ OPENSSL_cleanse(buf, (unsigned int)bufsiz);
+ res = 0;
+ }
+ UI_free(ui);
+ OPENSSL_free(prompt);
+ }
+#endif
+ return res;
+}
+
+static char *app_get_pass(const char *arg, int keepbio);
+
+int app_passwd(const char *arg1, const char *arg2, char **pass1, char **pass2)
+{
+ int same;
+ if (!arg2 || !arg1 || strcmp(arg1, arg2))
+ same = 0;
+ else
+ same = 1;
+ if (arg1) {
+ *pass1 = app_get_pass(arg1, same);
+ if (!*pass1)
+ return 0;
+ } else if (pass1)
+ *pass1 = NULL;
+ if (arg2) {
+ *pass2 = app_get_pass(arg2, same ? 2 : 0);
+ if (!*pass2)
+ return 0;
+ } else if (pass2)
+ *pass2 = NULL;
+ return 1;
+}
+
+static char *app_get_pass(const char *arg, int keepbio)
+{
+ char *tmp, tpass[APP_PASS_LEN];
+ static BIO *pwdbio = NULL;
+ int i;
+
+ if (strncmp(arg, "pass:", 5) == 0)
+ return OPENSSL_strdup(arg + 5);
+ if (strncmp(arg, "env:", 4) == 0) {
+ tmp = getenv(arg + 4);
+ if (!tmp) {
+ BIO_printf(bio_err, "Can't read environment variable %s\n", arg + 4);
+ return NULL;
+ }
+ return OPENSSL_strdup(tmp);
+ }
+ if (!keepbio || !pwdbio) {
+ if (strncmp(arg, "file:", 5) == 0) {
+ pwdbio = BIO_new_file(arg + 5, "r");
+ if (!pwdbio) {
+ BIO_printf(bio_err, "Can't open file %s\n", arg + 5);
+ return NULL;
+ }
+#if !defined(_WIN32)
+ /*
+ * Under _WIN32, which covers even Win64 and CE, file
+ * descriptors referenced by BIO_s_fd are not inherited
+ * by child process and therefore below is not an option.
+ * It could have been an option if bss_fd.c was operating
+ * on real Windows descriptors, such as those obtained
+ * with CreateFile.
+ */
+ } else if (strncmp(arg, "fd:", 3) == 0) {
+ BIO *btmp;
+ i = atoi(arg + 3);
+ if (i >= 0)
+ pwdbio = BIO_new_fd(i, BIO_NOCLOSE);
+ if ((i < 0) || !pwdbio) {
+ BIO_printf(bio_err, "Can't access file descriptor %s\n", arg + 3);
+ return NULL;
+ }
+ /*
+ * Can't do BIO_gets on an fd BIO so add a buffering BIO
+ */
+ btmp = BIO_new(BIO_f_buffer());
+ pwdbio = BIO_push(btmp, pwdbio);
+#endif
+ } else if (strcmp(arg, "stdin") == 0) {
+ pwdbio = dup_bio_in(FORMAT_TEXT);
+ if (!pwdbio) {
+ BIO_printf(bio_err, "Can't open BIO for stdin\n");
+ return NULL;
+ }
+ } else {
+ BIO_printf(bio_err, "Invalid password argument \"%s\"\n", arg);
+ return NULL;
+ }
+ }
+ i = BIO_gets(pwdbio, tpass, APP_PASS_LEN);
+ if (keepbio != 1) {
+ BIO_free_all(pwdbio);
+ pwdbio = NULL;
+ }
+ if (i <= 0) {
+ BIO_printf(bio_err, "Error reading password from BIO\n");
+ return NULL;
+ }
+ tmp = strchr(tpass, '\n');
+ if (tmp)
+ *tmp = 0;
+ return OPENSSL_strdup(tpass);
+}
+
+static CONF *app_load_config_(BIO *in, const char *filename)
+{
+ long errorline = -1;
+ CONF *conf;
+ int i;
+
+ conf = NCONF_new(NULL);
+ i = NCONF_load_bio(conf, in, &errorline);
+ if (i > 0)
+ return conf;
+
+ if (errorline <= 0)
+ BIO_printf(bio_err, "%s: Can't load config file \"%s\"\n",
+ opt_getprog(), filename);
+ else
+ BIO_printf(bio_err, "%s: Error on line %ld of config file \"%s\"\n",
+ opt_getprog(), errorline, filename);
+ NCONF_free(conf);
+ return NULL;
+}
+CONF *app_load_config(const char *filename)
+{
+ BIO *in;
+ CONF *conf;
+
+ in = bio_open_default(filename, 'r', FORMAT_TEXT);
+ if (in == NULL)
+ return NULL;
+
+ conf = app_load_config_(in, filename);
+ BIO_free(in);
+ return conf;
+}
+CONF *app_load_config_quiet(const char *filename)
+{
+ BIO *in;
+ CONF *conf;
+
+ in = bio_open_default_quiet(filename, 'r', FORMAT_TEXT);
+ if (in == NULL)
+ return NULL;
+
+ conf = app_load_config_(in, filename);
+ BIO_free(in);
+ return conf;
+}
+
+int app_load_modules(const CONF *config)
+{
+ CONF *to_free = NULL;
+
+ if (config == NULL)
+ config = to_free = app_load_config_quiet(default_config_file);
+ if (config == NULL)
+ return 1;
+
+ if (CONF_modules_load(config, NULL, 0) <= 0) {
+ BIO_printf(bio_err, "Error configuring OpenSSL modules\n");
+ ERR_print_errors(bio_err);
+ NCONF_free(to_free);
+ return 0;
+ }
+ NCONF_free(to_free);
+ return 1;
+}
+
+int add_oid_section(CONF *conf)
+{
+ char *p;
+ STACK_OF(CONF_VALUE) *sktmp;
+ CONF_VALUE *cnf;
+ int i;
+
+ if ((p = NCONF_get_string(conf, NULL, "oid_section")) == NULL) {
+ ERR_clear_error();
+ return 1;
+ }
+ if ((sktmp = NCONF_get_section(conf, p)) == NULL) {
+ BIO_printf(bio_err, "problem loading oid section %s\n", p);
+ return 0;
+ }
+ for (i = 0; i < sk_CONF_VALUE_num(sktmp); i++) {
+ cnf = sk_CONF_VALUE_value(sktmp, i);
+ if (OBJ_create(cnf->value, cnf->name, cnf->name) == NID_undef) {
+ BIO_printf(bio_err, "problem creating object %s=%s\n",
+ cnf->name, cnf->value);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static int load_pkcs12(BIO *in, const char *desc,
+ pem_password_cb *pem_cb, void *cb_data,
+ EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca)
+{
+ const char *pass;
+ char tpass[PEM_BUFSIZE];
+ int len, ret = 0;
+ PKCS12 *p12;
+ p12 = d2i_PKCS12_bio(in, NULL);
+ if (p12 == NULL) {
+ BIO_printf(bio_err, "Error loading PKCS12 file for %s\n", desc);
+ goto die;
+ }
+ /* See if an empty password will do */
+ if (PKCS12_verify_mac(p12, "", 0) || PKCS12_verify_mac(p12, NULL, 0))
+ pass = "";
+ else {
+ if (!pem_cb)
+ pem_cb = (pem_password_cb *)password_callback;
+ len = pem_cb(tpass, PEM_BUFSIZE, 0, cb_data);
+ if (len < 0) {
+ BIO_printf(bio_err, "Passphrase callback error for %s\n", desc);
+ goto die;
+ }
+ if (len < PEM_BUFSIZE)
+ tpass[len] = 0;
+ if (!PKCS12_verify_mac(p12, tpass, len)) {
+ BIO_printf(bio_err,
+ "Mac verify error (wrong password?) in PKCS12 file for %s\n",
+ desc);
+ goto die;
+ }
+ pass = tpass;
+ }
+ ret = PKCS12_parse(p12, pass, pkey, cert, ca);
+ die:
+ PKCS12_free(p12);
+ return ret;
+}
+
+#if !defined(OPENSSL_NO_OCSP) && !defined(OPENSSL_NO_SOCK)
+static int load_cert_crl_http(const char *url, X509 **pcert, X509_CRL **pcrl)
+{
+ char *host = NULL, *port = NULL, *path = NULL;
+ BIO *bio = NULL;
+ OCSP_REQ_CTX *rctx = NULL;
+ int use_ssl, rv = 0;
+ if (!OCSP_parse_url(url, &host, &port, &path, &use_ssl))
+ goto err;
+ if (use_ssl) {
+ BIO_puts(bio_err, "https not supported\n");
+ goto err;
+ }
+ bio = BIO_new_connect(host);
+ if (!bio || !BIO_set_conn_port(bio, port))
+ goto err;
+ rctx = OCSP_REQ_CTX_new(bio, 1024);
+ if (rctx == NULL)
+ goto err;
+ if (!OCSP_REQ_CTX_http(rctx, "GET", path))
+ goto err;
+ if (!OCSP_REQ_CTX_add1_header(rctx, "Host", host))
+ goto err;
+ if (pcert) {
+ do {
+ rv = X509_http_nbio(rctx, pcert);
+ } while (rv == -1);
+ } else {
+ do {
+ rv = X509_CRL_http_nbio(rctx, pcrl);
+ } while (rv == -1);
+ }
+
+ err:
+ OPENSSL_free(host);
+ OPENSSL_free(path);
+ OPENSSL_free(port);
+ if (bio)
+ BIO_free_all(bio);
+ OCSP_REQ_CTX_free(rctx);
+ if (rv != 1) {
+ BIO_printf(bio_err, "Error loading %s from %s\n",
+ pcert ? "certificate" : "CRL", url);
+ ERR_print_errors(bio_err);
+ }
+ return rv;
+}
+#endif
+
+X509 *load_cert(const char *file, int format, const char *cert_descrip)
+{
+ X509 *x = NULL;
+ BIO *cert;
+
+ if (format == FORMAT_HTTP) {
+#if !defined(OPENSSL_NO_OCSP) && !defined(OPENSSL_NO_SOCK)
+ load_cert_crl_http(file, &x, NULL);
+#endif
+ return x;
+ }
+
+ if (file == NULL) {
+ unbuffer(stdin);
+ cert = dup_bio_in(format);
+ } else
+ cert = bio_open_default(file, 'r', format);
+ if (cert == NULL)
+ goto end;
+
+ if (format == FORMAT_ASN1)
+ x = d2i_X509_bio(cert, NULL);
+ else if (format == FORMAT_PEM)
+ x = PEM_read_bio_X509_AUX(cert, NULL,
+ (pem_password_cb *)password_callback, NULL);
+ else if (format == FORMAT_PKCS12) {
+ if (!load_pkcs12(cert, cert_descrip, NULL, NULL, NULL, &x, NULL))
+ goto end;
+ } else {
+ BIO_printf(bio_err, "bad input format specified for %s\n", cert_descrip);
+ goto end;
+ }
+ end:
+ if (x == NULL) {
+ BIO_printf(bio_err, "unable to load certificate\n");
+ ERR_print_errors(bio_err);
+ }
+ BIO_free(cert);
+ return (x);
+}
+
+X509_CRL *load_crl(const char *infile, int format)
+{
+ X509_CRL *x = NULL;
+ BIO *in = NULL;
+
+ if (format == FORMAT_HTTP) {
+#if !defined(OPENSSL_NO_OCSP) && !defined(OPENSSL_NO_SOCK)
+ load_cert_crl_http(infile, NULL, &x);
+#endif
+ return x;
+ }
+
+ in = bio_open_default(infile, 'r', format);
+ if (in == NULL)
+ goto end;
+ if (format == FORMAT_ASN1)
+ x = d2i_X509_CRL_bio(in, NULL);
+ else if (format == FORMAT_PEM)
+ x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
+ else {
+ BIO_printf(bio_err, "bad input format specified for input crl\n");
+ goto end;
+ }
+ if (x == NULL) {
+ BIO_printf(bio_err, "unable to load CRL\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ end:
+ BIO_free(in);
+ return (x);
+}
+
+EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
+ const char *pass, ENGINE *e, const char *key_descrip)
+{
+ BIO *key = NULL;
+ EVP_PKEY *pkey = NULL;
+ PW_CB_DATA cb_data;
+
+ cb_data.password = pass;
+ cb_data.prompt_info = file;
+
+ if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
+ BIO_printf(bio_err, "no keyfile specified\n");
+ goto end;
+ }
+ if (format == FORMAT_ENGINE) {
+ if (e == NULL)
+ BIO_printf(bio_err, "no engine specified\n");
+ else {
+#ifndef OPENSSL_NO_ENGINE
+ if (ENGINE_init(e)) {
+ pkey = ENGINE_load_private_key(e, file, ui_method, &cb_data);
+ ENGINE_finish(e);
+ }
+ if (pkey == NULL) {
+ BIO_printf(bio_err, "cannot load %s from engine\n", key_descrip);
+ ERR_print_errors(bio_err);
+ }
+#else
+ BIO_printf(bio_err, "engines not supported\n");
+#endif
+ }
+ goto end;
+ }
+ if (file == NULL && maybe_stdin) {
+ unbuffer(stdin);
+ key = dup_bio_in(format);
+ } else
+ key = bio_open_default(file, 'r', format);
+ if (key == NULL)
+ goto end;
+ if (format == FORMAT_ASN1) {
+ pkey = d2i_PrivateKey_bio(key, NULL);
+ } else if (format == FORMAT_PEM) {
+ pkey = PEM_read_bio_PrivateKey(key, NULL,
+ (pem_password_cb *)password_callback,
+ &cb_data);
+ }
+ else if (format == FORMAT_PKCS12) {
+ if (!load_pkcs12(key, key_descrip,
+ (pem_password_cb *)password_callback, &cb_data,
+ &pkey, NULL, NULL))
+ goto end;
+ }
+#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) && !defined (OPENSSL_NO_RC4)
+ else if (format == FORMAT_MSBLOB)
+ pkey = b2i_PrivateKey_bio(key);
+ else if (format == FORMAT_PVK)
+ pkey = b2i_PVK_bio(key, (pem_password_cb *)password_callback,
+ &cb_data);
+#endif
+ else {
+ BIO_printf(bio_err, "bad input format specified for key file\n");
+ goto end;
+ }
+ end:
+ BIO_free(key);
+ if (pkey == NULL) {
+ BIO_printf(bio_err, "unable to load %s\n", key_descrip);
+ ERR_print_errors(bio_err);
+ }
+ return (pkey);
+}
+
+EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
+ const char *pass, ENGINE *e, const char *key_descrip)
+{
+ BIO *key = NULL;
+ EVP_PKEY *pkey = NULL;
+ PW_CB_DATA cb_data;
+
+ cb_data.password = pass;
+ cb_data.prompt_info = file;
+
+ if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
+ BIO_printf(bio_err, "no keyfile specified\n");
+ goto end;
+ }
+ if (format == FORMAT_ENGINE) {
+ if (e == NULL)
+ BIO_printf(bio_err, "no engine specified\n");
+ else {
+#ifndef OPENSSL_NO_ENGINE
+ pkey = ENGINE_load_public_key(e, file, ui_method, &cb_data);
+ if (pkey == NULL) {
+ BIO_printf(bio_err, "cannot load %s from engine\n", key_descrip);
+ ERR_print_errors(bio_err);
+ }
+#else
+ BIO_printf(bio_err, "engines not supported\n");
+#endif
+ }
+ goto end;
+ }
+ if (file == NULL && maybe_stdin) {
+ unbuffer(stdin);
+ key = dup_bio_in(format);
+ } else
+ key = bio_open_default(file, 'r', format);
+ if (key == NULL)
+ goto end;
+ if (format == FORMAT_ASN1) {
+ pkey = d2i_PUBKEY_bio(key, NULL);
+ }
+ else if (format == FORMAT_ASN1RSA) {
+#ifndef OPENSSL_NO_RSA
+ RSA *rsa;
+ rsa = d2i_RSAPublicKey_bio(key, NULL);
+ if (rsa) {
+ pkey = EVP_PKEY_new();
+ if (pkey != NULL)
+ EVP_PKEY_set1_RSA(pkey, rsa);
+ RSA_free(rsa);
+ } else
+#else
+ BIO_printf(bio_err, "RSA keys not supported\n");
+#endif
+ pkey = NULL;
+ } else if (format == FORMAT_PEMRSA) {
+#ifndef OPENSSL_NO_RSA
+ RSA *rsa;
+ rsa = PEM_read_bio_RSAPublicKey(key, NULL,
+ (pem_password_cb *)password_callback,
+ &cb_data);
+ if (rsa != NULL) {
+ pkey = EVP_PKEY_new();
+ if (pkey != NULL)
+ EVP_PKEY_set1_RSA(pkey, rsa);
+ RSA_free(rsa);
+ } else
+#else
+ BIO_printf(bio_err, "RSA keys not supported\n");
+#endif
+ pkey = NULL;
+ }
+ else if (format == FORMAT_PEM) {
+ pkey = PEM_read_bio_PUBKEY(key, NULL,
+ (pem_password_cb *)password_callback,
+ &cb_data);
+ }
+#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
+ else if (format == FORMAT_MSBLOB)
+ pkey = b2i_PublicKey_bio(key);
+#endif
+ end:
+ BIO_free(key);
+ if (pkey == NULL)
+ BIO_printf(bio_err, "unable to load %s\n", key_descrip);
+ return (pkey);
+}
+
+static int load_certs_crls(const char *file, int format,
+ const char *pass, const char *desc,
+ STACK_OF(X509) **pcerts,
+ STACK_OF(X509_CRL) **pcrls)
+{
+ int i;
+ BIO *bio;
+ STACK_OF(X509_INFO) *xis = NULL;
+ X509_INFO *xi;
+ PW_CB_DATA cb_data;
+ int rv = 0;
+
+ cb_data.password = pass;
+ cb_data.prompt_info = file;
+
+ if (format != FORMAT_PEM) {
+ BIO_printf(bio_err, "bad input format specified for %s\n", desc);
+ return 0;
+ }
+
+ bio = bio_open_default(file, 'r', FORMAT_PEM);
+ if (bio == NULL)
+ return 0;
+
+ xis = PEM_X509_INFO_read_bio(bio, NULL,
+ (pem_password_cb *)password_callback,
+ &cb_data);
+
+ BIO_free(bio);
+
+ if (pcerts && *pcerts == NULL) {
+ *pcerts = sk_X509_new_null();
+ if (!*pcerts)
+ goto end;
+ }
+
+ if (pcrls && *pcrls == NULL) {
+ *pcrls = sk_X509_CRL_new_null();
+ if (!*pcrls)
+ goto end;
+ }
+
+ for (i = 0; i < sk_X509_INFO_num(xis); i++) {
+ xi = sk_X509_INFO_value(xis, i);
+ if (xi->x509 && pcerts) {
+ if (!sk_X509_push(*pcerts, xi->x509))
+ goto end;
+ xi->x509 = NULL;
+ }
+ if (xi->crl && pcrls) {
+ if (!sk_X509_CRL_push(*pcrls, xi->crl))
+ goto end;
+ xi->crl = NULL;
+ }
+ }
+
+ if (pcerts && sk_X509_num(*pcerts) > 0)
+ rv = 1;
+
+ if (pcrls && sk_X509_CRL_num(*pcrls) > 0)
+ rv = 1;
+
+ end:
+
+ sk_X509_INFO_pop_free(xis, X509_INFO_free);
+
+ if (rv == 0) {
+ if (pcerts) {
+ sk_X509_pop_free(*pcerts, X509_free);
+ *pcerts = NULL;
+ }
+ if (pcrls) {
+ sk_X509_CRL_pop_free(*pcrls, X509_CRL_free);
+ *pcrls = NULL;
+ }
+ BIO_printf(bio_err, "unable to load %s\n",
+ pcerts ? "certificates" : "CRLs");
+ ERR_print_errors(bio_err);
+ }
+ return rv;
+}
+
+void* app_malloc(int sz, const char *what)
+{
+ void *vp = OPENSSL_malloc(sz);
+
+ if (vp == NULL) {
+ BIO_printf(bio_err, "%s: Could not allocate %d bytes for %s\n",
+ opt_getprog(), sz, what);
+ ERR_print_errors(bio_err);
+ exit(1);
+ }
+ return vp;
+}
+
+/*
+ * Initialize or extend, if *certs != NULL, a certificate stack.
+ */
+int load_certs(const char *file, STACK_OF(X509) **certs, int format,
+ const char *pass, const char *desc)
+{
+ return load_certs_crls(file, format, pass, desc, certs, NULL);
+}
+
+/*
+ * Initialize or extend, if *crls != NULL, a certificate stack.
+ */
+int load_crls(const char *file, STACK_OF(X509_CRL) **crls, int format,
+ const char *pass, const char *desc)
+{
+ return load_certs_crls(file, format, pass, desc, NULL, crls);
+}
+
+#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
+/* Return error for unknown extensions */
+#define X509V3_EXT_DEFAULT 0
+/* Print error for unknown extensions */
+#define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
+/* ASN1 parse unknown extensions */
+#define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
+/* BIO_dump unknown extensions */
+#define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
+
+#define X509_FLAG_CA (X509_FLAG_NO_ISSUER | X509_FLAG_NO_PUBKEY | \
+ X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION)
+
+int set_cert_ex(unsigned long *flags, const char *arg)
+{
+ static const NAME_EX_TBL cert_tbl[] = {
+ {"compatible", X509_FLAG_COMPAT, 0xffffffffl},
+ {"ca_default", X509_FLAG_CA, 0xffffffffl},
+ {"no_header", X509_FLAG_NO_HEADER, 0},
+ {"no_version", X509_FLAG_NO_VERSION, 0},
+ {"no_serial", X509_FLAG_NO_SERIAL, 0},
+ {"no_signame", X509_FLAG_NO_SIGNAME, 0},
+ {"no_validity", X509_FLAG_NO_VALIDITY, 0},
+ {"no_subject", X509_FLAG_NO_SUBJECT, 0},
+ {"no_issuer", X509_FLAG_NO_ISSUER, 0},
+ {"no_pubkey", X509_FLAG_NO_PUBKEY, 0},
+ {"no_extensions", X509_FLAG_NO_EXTENSIONS, 0},
+ {"no_sigdump", X509_FLAG_NO_SIGDUMP, 0},
+ {"no_aux", X509_FLAG_NO_AUX, 0},
+ {"no_attributes", X509_FLAG_NO_ATTRIBUTES, 0},
+ {"ext_default", X509V3_EXT_DEFAULT, X509V3_EXT_UNKNOWN_MASK},
+ {"ext_error", X509V3_EXT_ERROR_UNKNOWN, X509V3_EXT_UNKNOWN_MASK},
+ {"ext_parse", X509V3_EXT_PARSE_UNKNOWN, X509V3_EXT_UNKNOWN_MASK},
+ {"ext_dump", X509V3_EXT_DUMP_UNKNOWN, X509V3_EXT_UNKNOWN_MASK},
+ {NULL, 0, 0}
+ };
+ return set_multi_opts(flags, arg, cert_tbl);
+}
+
+int set_name_ex(unsigned long *flags, const char *arg)
+{
+ static const NAME_EX_TBL ex_tbl[] = {
+ {"esc_2253", ASN1_STRFLGS_ESC_2253, 0},
+ {"esc_2254", ASN1_STRFLGS_ESC_2254, 0},
+ {"esc_ctrl", ASN1_STRFLGS_ESC_CTRL, 0},
+ {"esc_msb", ASN1_STRFLGS_ESC_MSB, 0},
+ {"use_quote", ASN1_STRFLGS_ESC_QUOTE, 0},
+ {"utf8", ASN1_STRFLGS_UTF8_CONVERT, 0},
+ {"ignore_type", ASN1_STRFLGS_IGNORE_TYPE, 0},
+ {"show_type", ASN1_STRFLGS_SHOW_TYPE, 0},
+ {"dump_all", ASN1_STRFLGS_DUMP_ALL, 0},
+ {"dump_nostr", ASN1_STRFLGS_DUMP_UNKNOWN, 0},
+ {"dump_der", ASN1_STRFLGS_DUMP_DER, 0},
+ {"compat", XN_FLAG_COMPAT, 0xffffffffL},
+ {"sep_comma_plus", XN_FLAG_SEP_COMMA_PLUS, XN_FLAG_SEP_MASK},
+ {"sep_comma_plus_space", XN_FLAG_SEP_CPLUS_SPC, XN_FLAG_SEP_MASK},
+ {"sep_semi_plus_space", XN_FLAG_SEP_SPLUS_SPC, XN_FLAG_SEP_MASK},
+ {"sep_multiline", XN_FLAG_SEP_MULTILINE, XN_FLAG_SEP_MASK},
+ {"dn_rev", XN_FLAG_DN_REV, 0},
+ {"nofname", XN_FLAG_FN_NONE, XN_FLAG_FN_MASK},
+ {"sname", XN_FLAG_FN_SN, XN_FLAG_FN_MASK},
+ {"lname", XN_FLAG_FN_LN, XN_FLAG_FN_MASK},
+ {"align", XN_FLAG_FN_ALIGN, 0},
+ {"oid", XN_FLAG_FN_OID, XN_FLAG_FN_MASK},
+ {"space_eq", XN_FLAG_SPC_EQ, 0},
+ {"dump_unknown", XN_FLAG_DUMP_UNKNOWN_FIELDS, 0},
+ {"RFC2253", XN_FLAG_RFC2253, 0xffffffffL},
+ {"oneline", XN_FLAG_ONELINE, 0xffffffffL},
+ {"multiline", XN_FLAG_MULTILINE, 0xffffffffL},
+ {"ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
+ {NULL, 0, 0}
+ };
+ if (set_multi_opts(flags, arg, ex_tbl) == 0)
+ return 0;
+ if ((*flags & XN_FLAG_SEP_MASK) == 0)
+ *flags |= XN_FLAG_SEP_CPLUS_SPC;
+ return 1;
+}
+
+int set_ext_copy(int *copy_type, const char *arg)
+{
+ if (strcasecmp(arg, "none") == 0)
+ *copy_type = EXT_COPY_NONE;
+ else if (strcasecmp(arg, "copy") == 0)
+ *copy_type = EXT_COPY_ADD;
+ else if (strcasecmp(arg, "copyall") == 0)
+ *copy_type = EXT_COPY_ALL;
+ else
+ return 0;
+ return 1;
+}
+
+int copy_extensions(X509 *x, X509_REQ *req, int copy_type)
+{
+ STACK_OF(X509_EXTENSION) *exts = NULL;
+ X509_EXTENSION *ext, *tmpext;
+ ASN1_OBJECT *obj;
+ int i, idx, ret = 0;
+ if (!x || !req || (copy_type == EXT_COPY_NONE))
+ return 1;
+ exts = X509_REQ_get_extensions(req);
+
+ for (i = 0; i < sk_X509_EXTENSION_num(exts); i++) {
+ ext = sk_X509_EXTENSION_value(exts, i);
+ obj = X509_EXTENSION_get_object(ext);
+ idx = X509_get_ext_by_OBJ(x, obj, -1);
+ /* Does extension exist? */
+ if (idx != -1) {
+ /* If normal copy don't override existing extension */
+ if (copy_type == EXT_COPY_ADD)
+ continue;
+ /* Delete all extensions of same type */
+ do {
+ tmpext = X509_get_ext(x, idx);
+ X509_delete_ext(x, idx);
+ X509_EXTENSION_free(tmpext);
+ idx = X509_get_ext_by_OBJ(x, obj, -1);
+ } while (idx != -1);
+ }
+ if (!X509_add_ext(x, ext, -1))
+ goto end;
+ }
+
+ ret = 1;
+
+ end:
+
+ sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);
+
+ return ret;
+}
+
+static int set_multi_opts(unsigned long *flags, const char *arg,
+ const NAME_EX_TBL * in_tbl)
+{
+ STACK_OF(CONF_VALUE) *vals;
+ CONF_VALUE *val;
+ int i, ret = 1;
+ if (!arg)
+ return 0;
+ vals = X509V3_parse_list(arg);
+ for (i = 0; i < sk_CONF_VALUE_num(vals); i++) {
+ val = sk_CONF_VALUE_value(vals, i);
+ if (!set_table_opts(flags, val->name, in_tbl))
+ ret = 0;
+ }
+ sk_CONF_VALUE_pop_free(vals, X509V3_conf_free);
+ return ret;
+}
+
+static int set_table_opts(unsigned long *flags, const char *arg,
+ const NAME_EX_TBL * in_tbl)
+{
+ char c;
+ const NAME_EX_TBL *ptbl;
+ c = arg[0];
+
+ if (c == '-') {
+ c = 0;
+ arg++;
+ } else if (c == '+') {
+ c = 1;
+ arg++;
+ } else
+ c = 1;
+
+ for (ptbl = in_tbl; ptbl->name; ptbl++) {
+ if (strcasecmp(arg, ptbl->name) == 0) {
+ *flags &= ~ptbl->mask;
+ if (c)
+ *flags |= ptbl->flag;
+ else
+ *flags &= ~ptbl->flag;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void print_name(BIO *out, const char *title, X509_NAME *nm,
+ unsigned long lflags)
+{
+ char *buf;
+ char mline = 0;
+ int indent = 0;
+
+ if (title)
+ BIO_puts(out, title);
+ if ((lflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) {
+ mline = 1;
+ indent = 4;
+ }
+ if (lflags == XN_FLAG_COMPAT) {
+ buf = X509_NAME_oneline(nm, 0, 0);
+ BIO_puts(out, buf);
+ BIO_puts(out, "\n");
+ OPENSSL_free(buf);
+ } else {
+ if (mline)
+ BIO_puts(out, "\n");
+ X509_NAME_print_ex(out, nm, indent, lflags);
+ BIO_puts(out, "\n");
+ }
+}
+
+void print_bignum_var(BIO *out, const BIGNUM *in, const char *var,
+ int len, unsigned char *buffer)
+{
+ BIO_printf(out, " static unsigned char %s_%d[] = {", var, len);
+ if (BN_is_zero(in))
+ BIO_printf(out, "\n\t0x00");
+ else {
+ int i, l;
+
+ l = BN_bn2bin(in, buffer);
+ for (i = 0; i < l; i++) {
+ if ((i % 10) == 0)
+ BIO_printf(out, "\n\t");
+ if (i < l - 1)
+ BIO_printf(out, "0x%02X, ", buffer[i]);
+ else
+ BIO_printf(out, "0x%02X", buffer[i]);
+ }
+ }
+ BIO_printf(out, "\n };\n");
+}
+void print_array(BIO *out, const char* title, int len, const unsigned char* d)
+{
+ int i;
+
+ BIO_printf(out, "unsigned char %s[%d] = {", title, len);
+ for (i = 0; i < len; i++) {
+ if ((i % 10) == 0)
+ BIO_printf(out, "\n ");
+ if (i < len - 1)
+ BIO_printf(out, "0x%02X, ", d[i]);
+ else
+ BIO_printf(out, "0x%02X", d[i]);
+ }
+ BIO_printf(out, "\n};\n");
+}
+
+X509_STORE *setup_verify(const char *CAfile, const char *CApath, int noCAfile, int noCApath)
+{
+ X509_STORE *store = X509_STORE_new();
+ X509_LOOKUP *lookup;
+
+ if (store == NULL)
+ goto end;
+
+ if (CAfile != NULL || !noCAfile) {
+ lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
+ if (lookup == NULL)
+ goto end;
+ if (CAfile) {
+ if (!X509_LOOKUP_load_file(lookup, CAfile, X509_FILETYPE_PEM)) {
+ BIO_printf(bio_err, "Error loading file %s\n", CAfile);
+ goto end;
+ }
+ } else
+ X509_LOOKUP_load_file(lookup, NULL, X509_FILETYPE_DEFAULT);
+ }
+
+ if (CApath != NULL || !noCApath) {
+ lookup = X509_STORE_add_lookup(store, X509_LOOKUP_hash_dir());
+ if (lookup == NULL)
+ goto end;
+ if (CApath) {
+ if (!X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM)) {
+ BIO_printf(bio_err, "Error loading directory %s\n", CApath);
+ goto end;
+ }
+ } else
+ X509_LOOKUP_add_dir(lookup, NULL, X509_FILETYPE_DEFAULT);
+ }
+
+ ERR_clear_error();
+ return store;
+ end:
+ X509_STORE_free(store);
+ return NULL;
+}
+
+#ifndef OPENSSL_NO_ENGINE
+/* Try to load an engine in a shareable library */
+static ENGINE *try_load_engine(const char *engine)
+{
+ ENGINE *e = ENGINE_by_id("dynamic");
+ if (e) {
+ if (!ENGINE_ctrl_cmd_string(e, "SO_PATH", engine, 0)
+ || !ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0)) {
+ ENGINE_free(e);
+ e = NULL;
+ }
+ }
+ return e;
+}
+#endif
+
+ENGINE *setup_engine(const char *engine, int debug)
+{
+ ENGINE *e = NULL;
+
+#ifndef OPENSSL_NO_ENGINE
+ if (engine) {
+ if (strcmp(engine, "auto") == 0) {
+ BIO_printf(bio_err, "enabling auto ENGINE support\n");
+ ENGINE_register_all_complete();
+ return NULL;
+ }
+ if ((e = ENGINE_by_id(engine)) == NULL
+ && (e = try_load_engine(engine)) == NULL) {
+ BIO_printf(bio_err, "invalid engine \"%s\"\n", engine);
+ ERR_print_errors(bio_err);
+ return NULL;
+ }
+ if (debug) {
+ ENGINE_ctrl(e, ENGINE_CTRL_SET_LOGSTREAM, 0, bio_err, 0);
+ }
+ ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, ui_method, 0, 1);
+ if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
+ BIO_printf(bio_err, "can't use that engine\n");
+ ERR_print_errors(bio_err);
+ ENGINE_free(e);
+ return NULL;
+ }
+
+ BIO_printf(bio_err, "engine \"%s\" set.\n", ENGINE_get_id(e));
+ }
+#endif
+ return e;
+}
+
+void release_engine(ENGINE *e)
+{
+#ifndef OPENSSL_NO_ENGINE
+ if (e != NULL)
+ /* Free our "structural" reference. */
+ ENGINE_free(e);
+#endif
+}
+
+static unsigned long index_serial_hash(const OPENSSL_CSTRING *a)
+{
+ const char *n;
+
+ n = a[DB_serial];
+ while (*n == '0')
+ n++;
+ return OPENSSL_LH_strhash(n);
+}
+
+static int index_serial_cmp(const OPENSSL_CSTRING *a,
+ const OPENSSL_CSTRING *b)
+{
+ const char *aa, *bb;
+
+ for (aa = a[DB_serial]; *aa == '0'; aa++) ;
+ for (bb = b[DB_serial]; *bb == '0'; bb++) ;
+ return (strcmp(aa, bb));
+}
+
+static int index_name_qual(char **a)
+{
+ return (a[0][0] == 'V');
+}
+
+static unsigned long index_name_hash(const OPENSSL_CSTRING *a)
+{
+ return OPENSSL_LH_strhash(a[DB_name]);
+}
+
+int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b)
+{
+ return (strcmp(a[DB_name], b[DB_name]));
+}
+
+static IMPLEMENT_LHASH_HASH_FN(index_serial, OPENSSL_CSTRING)
+static IMPLEMENT_LHASH_COMP_FN(index_serial, OPENSSL_CSTRING)
+static IMPLEMENT_LHASH_HASH_FN(index_name, OPENSSL_CSTRING)
+static IMPLEMENT_LHASH_COMP_FN(index_name, OPENSSL_CSTRING)
+#undef BSIZE
+#define BSIZE 256
+BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai)
+{
+ BIO *in = NULL;
+ BIGNUM *ret = NULL;
+ char buf[1024];
+ ASN1_INTEGER *ai = NULL;
+
+ ai = ASN1_INTEGER_new();
+ if (ai == NULL)
+ goto err;
+
+ in = BIO_new_file(serialfile, "r");
+ if (in == NULL) {
+ if (!create) {
+ perror(serialfile);
+ goto err;
+ }
+ ERR_clear_error();
+ ret = BN_new();
+ if (ret == NULL || !rand_serial(ret, ai))
+ BIO_printf(bio_err, "Out of memory\n");
+ } else {
+ if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
+ BIO_printf(bio_err, "unable to load number from %s\n",
+ serialfile);
+ goto err;
+ }
+ ret = ASN1_INTEGER_to_BN(ai, NULL);
+ if (ret == NULL) {
+ BIO_printf(bio_err,
+ "error converting number from bin to BIGNUM\n");
+ goto err;
+ }
+ }
+
+ if (ret && retai) {
+ *retai = ai;
+ ai = NULL;
+ }
+ err:
+ BIO_free(in);
+ ASN1_INTEGER_free(ai);
+ return (ret);
+}
+
+int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial,
+ ASN1_INTEGER **retai)
+{
+ char buf[1][BSIZE];
+ BIO *out = NULL;
+ int ret = 0;
+ ASN1_INTEGER *ai = NULL;
+ int j;
+
+ if (suffix == NULL)
+ j = strlen(serialfile);
+ else
+ j = strlen(serialfile) + strlen(suffix) + 1;
+ if (j >= BSIZE) {
+ BIO_printf(bio_err, "file name too long\n");
+ goto err;
+ }
+
+ if (suffix == NULL)
+ OPENSSL_strlcpy(buf[0], serialfile, BSIZE);
+ else {
+#ifndef OPENSSL_SYS_VMS
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, suffix);
+#else
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, suffix);
+#endif
+ }
+ out = BIO_new_file(buf[0], "w");
+ if (out == NULL) {
+ ERR_print_errors(bio_err);
+ goto err;
+ }
+
+ if ((ai = BN_to_ASN1_INTEGER(serial, NULL)) == NULL) {
+ BIO_printf(bio_err, "error converting serial to ASN.1 format\n");
+ goto err;
+ }
+ i2a_ASN1_INTEGER(out, ai);
+ BIO_puts(out, "\n");
+ ret = 1;
+ if (retai) {
+ *retai = ai;
+ ai = NULL;
+ }
+ err:
+ BIO_free_all(out);
+ ASN1_INTEGER_free(ai);
+ return (ret);
+}
+
+int rotate_serial(const char *serialfile, const char *new_suffix,
+ const char *old_suffix)
+{
+ char buf[2][BSIZE];
+ int i, j;
+
+ i = strlen(serialfile) + strlen(old_suffix);
+ j = strlen(serialfile) + strlen(new_suffix);
+ if (i > j)
+ j = i;
+ if (j + 1 >= BSIZE) {
+ BIO_printf(bio_err, "file name too long\n");
+ goto err;
+ }
+#ifndef OPENSSL_SYS_VMS
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, new_suffix);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", serialfile, old_suffix);
+#else
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, new_suffix);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", serialfile, old_suffix);
+#endif
+ if (rename(serialfile, buf[1]) < 0 && errno != ENOENT
+#ifdef ENOTDIR
+ && errno != ENOTDIR
+#endif
+ ) {
+ BIO_printf(bio_err,
+ "unable to rename %s to %s\n", serialfile, buf[1]);
+ perror("reason");
+ goto err;
+ }
+ if (rename(buf[0], serialfile) < 0) {
+ BIO_printf(bio_err,
+ "unable to rename %s to %s\n", buf[0], serialfile);
+ perror("reason");
+ rename(buf[1], serialfile);
+ goto err;
+ }
+ return 1;
+ err:
+ return 0;
+}
+
+int rand_serial(BIGNUM *b, ASN1_INTEGER *ai)
+{
+ BIGNUM *btmp;
+ int ret = 0;
+
+ if (b)
+ btmp = b;
+ else
+ btmp = BN_new();
+
+ if (btmp == NULL)
+ return 0;
+
+ if (!BN_pseudo_rand(btmp, SERIAL_RAND_BITS, 0, 0))
+ goto error;
+ if (ai && !BN_to_ASN1_INTEGER(btmp, ai))
+ goto error;
+
+ ret = 1;
+
+ error:
+
+ if (btmp != b)
+ BN_free(btmp);
+
+ return ret;
+}
+
+CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
+{
+ CA_DB *retdb = NULL;
+ TXT_DB *tmpdb = NULL;
+ BIO *in;
+ CONF *dbattr_conf = NULL;
+ char buf[BSIZE];
+
+ in = BIO_new_file(dbfile, "r");
+ if (in == NULL) {
+ ERR_print_errors(bio_err);
+ goto err;
+ }
+ if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL)
+ goto err;
+
+#ifndef OPENSSL_SYS_VMS
+ BIO_snprintf(buf, sizeof(buf), "%s.attr", dbfile);
+#else
+ BIO_snprintf(buf, sizeof(buf), "%s-attr", dbfile);
+#endif
+ dbattr_conf = app_load_config(buf);
+
+ retdb = app_malloc(sizeof(*retdb), "new DB");
+ retdb->db = tmpdb;
+ tmpdb = NULL;
+ if (db_attr)
+ retdb->attributes = *db_attr;
+ else {
+ retdb->attributes.unique_subject = 1;
+ }
+
+ if (dbattr_conf) {
+ char *p = NCONF_get_string(dbattr_conf, NULL, "unique_subject");
+ if (p) {
+ retdb->attributes.unique_subject = parse_yesno(p, 1);
+ }
+ }
+
+ err:
+ NCONF_free(dbattr_conf);
+ TXT_DB_free(tmpdb);
+ BIO_free_all(in);
+ return retdb;
+}
+
+int index_index(CA_DB *db)
+{
+ if (!TXT_DB_create_index(db->db, DB_serial, NULL,
+ LHASH_HASH_FN(index_serial),
+ LHASH_COMP_FN(index_serial))) {
+ BIO_printf(bio_err,
+ "error creating serial number index:(%ld,%ld,%ld)\n",
+ db->db->error, db->db->arg1, db->db->arg2);
+ return 0;
+ }
+
+ if (db->attributes.unique_subject
+ && !TXT_DB_create_index(db->db, DB_name, index_name_qual,
+ LHASH_HASH_FN(index_name),
+ LHASH_COMP_FN(index_name))) {
+ BIO_printf(bio_err, "error creating name index:(%ld,%ld,%ld)\n",
+ db->db->error, db->db->arg1, db->db->arg2);
+ return 0;
+ }
+ return 1;
+}
+
+int save_index(const char *dbfile, const char *suffix, CA_DB *db)
+{
+ char buf[3][BSIZE];
+ BIO *out;
+ int j;
+
+ j = strlen(dbfile) + strlen(suffix);
+ if (j + 6 >= BSIZE) {
+ BIO_printf(bio_err, "file name too long\n");
+ goto err;
+ }
+#ifndef OPENSSL_SYS_VMS
+ j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr", dbfile);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.attr.%s", dbfile, suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, suffix);
+#else
+ j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr", dbfile);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-attr-%s", dbfile, suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, suffix);
+#endif
+ out = BIO_new_file(buf[0], "w");
+ if (out == NULL) {
+ perror(dbfile);
+ BIO_printf(bio_err, "unable to open '%s'\n", dbfile);
+ goto err;
+ }
+ j = TXT_DB_write(out, db->db);
+ BIO_free(out);
+ if (j <= 0)
+ goto err;
+
+ out = BIO_new_file(buf[1], "w");
+ if (out == NULL) {
+ perror(buf[2]);
+ BIO_printf(bio_err, "unable to open '%s'\n", buf[2]);
+ goto err;
+ }
+ BIO_printf(out, "unique_subject = %s\n",
+ db->attributes.unique_subject ? "yes" : "no");
+ BIO_free(out);
+
+ return 1;
+ err:
+ return 0;
+}
+
+int rotate_index(const char *dbfile, const char *new_suffix,
+ const char *old_suffix)
+{
+ char buf[5][BSIZE];
+ int i, j;
+
+ i = strlen(dbfile) + strlen(old_suffix);
+ j = strlen(dbfile) + strlen(new_suffix);
+ if (i > j)
+ j = i;
+ if (j + 6 >= BSIZE) {
+ BIO_printf(bio_err, "file name too long\n");
+ goto err;
+ }
+#ifndef OPENSSL_SYS_VMS
+ j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s.attr", dbfile);
+ j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s.attr.%s", dbfile, old_suffix);
+ j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr.%s", dbfile, new_suffix);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", dbfile, old_suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, new_suffix);
+#else
+ j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s-attr", dbfile);
+ j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s-attr-%s", dbfile, old_suffix);
+ j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr-%s", dbfile, new_suffix);
+ j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", dbfile, old_suffix);
+ j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, new_suffix);
+#endif
+ if (rename(dbfile, buf[1]) < 0 && errno != ENOENT
+#ifdef ENOTDIR
+ && errno != ENOTDIR
+#endif
+ ) {
+ BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, buf[1]);
+ perror("reason");
+ goto err;
+ }
+ if (rename(buf[0], dbfile) < 0) {
+ BIO_printf(bio_err, "unable to rename %s to %s\n", buf[0], dbfile);
+ perror("reason");
+ rename(buf[1], dbfile);
+ goto err;
+ }
+ if (rename(buf[4], buf[3]) < 0 && errno != ENOENT
+#ifdef ENOTDIR
+ && errno != ENOTDIR
+#endif
+ ) {
+ BIO_printf(bio_err, "unable to rename %s to %s\n", buf[4], buf[3]);
+ perror("reason");
+ rename(dbfile, buf[0]);
+ rename(buf[1], dbfile);
+ goto err;
+ }
+ if (rename(buf[2], buf[4]) < 0) {
+ BIO_printf(bio_err, "unable to rename %s to %s\n", buf[2], buf[4]);
+ perror("reason");
+ rename(buf[3], buf[4]);
+ rename(dbfile, buf[0]);
+ rename(buf[1], dbfile);
+ goto err;
+ }
+ return 1;
+ err:
+ return 0;
+}
+
+void free_index(CA_DB *db)
+{
+ if (db) {
+ TXT_DB_free(db->db);
+ OPENSSL_free(db);
+ }
+}
+
+int parse_yesno(const char *str, int def)
+{
+ if (str) {
+ switch (*str) {
+ case 'f': /* false */
+ case 'F': /* FALSE */
+ case 'n': /* no */
+ case 'N': /* NO */
+ case '0': /* 0 */
+ return 0;
+ case 't': /* true */
+ case 'T': /* TRUE */
+ case 'y': /* yes */
+ case 'Y': /* YES */
+ case '1': /* 1 */
+ return 1;
+ }
+ }
+ return def;
+}
+
+/*
+ * name is expected to be in the format /type0=value0/type1=value1/type2=...
+ * where characters may be escaped by \
+ */
+X509_NAME *parse_name(const char *cp, long chtype, int canmulti)
+{
+ int nextismulti = 0;
+ char *work;
+ X509_NAME *n;
+
+ if (*cp++ != '/')
+ return NULL;
+
+ n = X509_NAME_new();
+ if (n == NULL)
+ return NULL;
+ work = OPENSSL_strdup(cp);
+ if (work == NULL)
+ goto err;
+
+ while (*cp) {
+ char *bp = work;
+ char *typestr = bp;
+ unsigned char *valstr;
+ int nid;
+ int ismulti = nextismulti;
+ nextismulti = 0;
+
+ /* Collect the type */
+ while (*cp && *cp != '=')
+ *bp++ = *cp++;
+ if (*cp == '\0') {
+ BIO_printf(bio_err,
+ "%s: Hit end of string before finding the equals.\n",
+ opt_getprog());
+ goto err;
+ }
+ *bp++ = '\0';
+ ++cp;
+
+ /* Collect the value. */
+ valstr = (unsigned char *)bp;
+ for (; *cp && *cp != '/'; *bp++ = *cp++) {
+ if (canmulti && *cp == '+') {
+ nextismulti = 1;
+ break;
+ }
+ if (*cp == '\\' && *++cp == '\0') {
+ BIO_printf(bio_err,
+ "%s: escape character at end of string\n",
+ opt_getprog());
+ goto err;
+ }
+ }
+ *bp++ = '\0';
+
+ /* If not at EOS (must be + or /), move forward. */
+ if (*cp)
+ ++cp;
+
+ /* Parse */
+ nid = OBJ_txt2nid(typestr);
+ if (nid == NID_undef) {
+ BIO_printf(bio_err, "%s: Skipping unknown attribute \"%s\"\n",
+ opt_getprog(), typestr);
+ continue;
+ }
+ if (!X509_NAME_add_entry_by_NID(n, nid, chtype,
+ valstr, strlen((char *)valstr),
+ -1, ismulti ? -1 : 0))
+ goto err;
+ }
+
+ OPENSSL_free(work);
+ return n;
+
+ err:
+ X509_NAME_free(n);
+ OPENSSL_free(work);
+ return NULL;
+}
+
+/*
+ * Read whole contents of a BIO into an allocated memory buffer and return
+ * it.
+ */
+
+int bio_to_mem(unsigned char **out, int maxlen, BIO *in)
+{
+ BIO *mem;
+ int len, ret;
+ unsigned char tbuf[1024];
+
+ mem = BIO_new(BIO_s_mem());
+ if (mem == NULL)
+ return -1;
+ for (;;) {
+ if ((maxlen != -1) && maxlen < 1024)
+ len = maxlen;
+ else
+ len = 1024;
+ len = BIO_read(in, tbuf, len);
+ if (len < 0) {
+ BIO_free(mem);
+ return -1;
+ }
+ if (len == 0)
+ break;
+ if (BIO_write(mem, tbuf, len) != len) {
+ BIO_free(mem);
+ return -1;
+ }
+ maxlen -= len;
+
+ if (maxlen == 0)
+ break;
+ }
+ ret = BIO_get_mem_data(mem, (char **)out);
+ BIO_set_flags(mem, BIO_FLAGS_MEM_RDONLY);
+ BIO_free(mem);
+ return ret;
+}
+
+int pkey_ctrl_string(EVP_PKEY_CTX *ctx, const char *value)
+{
+ int rv;
+ char *stmp, *vtmp = NULL;
+ stmp = OPENSSL_strdup(value);
+ if (!stmp)
+ return -1;
+ vtmp = strchr(stmp, ':');
+ if (vtmp) {
+ *vtmp = 0;
+ vtmp++;
+ }
+ rv = EVP_PKEY_CTX_ctrl_str(ctx, stmp, vtmp);
+ OPENSSL_free(stmp);
+ return rv;
+}
+
+static void nodes_print(const char *name, STACK_OF(X509_POLICY_NODE) *nodes)
+{
+ X509_POLICY_NODE *node;
+ int i;
+
+ BIO_printf(bio_err, "%s Policies:", name);
+ if (nodes) {
+ BIO_puts(bio_err, "\n");
+ for (i = 0; i < sk_X509_POLICY_NODE_num(nodes); i++) {
+ node = sk_X509_POLICY_NODE_value(nodes, i);
+ X509_POLICY_NODE_print(bio_err, node, 2);
+ }
+ } else
+ BIO_puts(bio_err, " <empty>\n");
+}
+
+void policies_print(X509_STORE_CTX *ctx)
+{
+ X509_POLICY_TREE *tree;
+ int explicit_policy;
+ tree = X509_STORE_CTX_get0_policy_tree(ctx);
+ explicit_policy = X509_STORE_CTX_get_explicit_policy(ctx);
+
+ BIO_printf(bio_err, "Require explicit Policy: %s\n",
+ explicit_policy ? "True" : "False");
+
+ nodes_print("Authority", X509_policy_tree_get0_policies(tree));
+ nodes_print("User", X509_policy_tree_get0_user_policies(tree));
+}
+
+/*-
+ * next_protos_parse parses a comma separated list of strings into a string
+ * in a format suitable for passing to SSL_CTX_set_next_protos_advertised.
+ * outlen: (output) set to the length of the resulting buffer on success.
+ * err: (maybe NULL) on failure, an error message line is written to this BIO.
+ * in: a NUL terminated string like "abc,def,ghi"
+ *
+ * returns: a malloc'd buffer or NULL on failure.
+ */
+unsigned char *next_protos_parse(size_t *outlen, const char *in)
+{
+ size_t len;
+ unsigned char *out;
+ size_t i, start = 0;
+
+ len = strlen(in);
+ if (len >= 65535)
+ return NULL;
+
+ out = app_malloc(strlen(in) + 1, "NPN buffer");
+ for (i = 0; i <= len; ++i) {
+ if (i == len || in[i] == ',') {
+ if (i - start > 255) {
+ OPENSSL_free(out);
+ return NULL;
+ }
+ out[start] = i - start;
+ start = i + 1;
+ } else
+ out[i + 1] = in[i];
+ }
+
+ *outlen = len + 1;
+ return out;
+}
+
+void print_cert_checks(BIO *bio, X509 *x,
+ const char *checkhost,
+ const char *checkemail, const char *checkip)
+{
+ if (x == NULL)
+ return;
+ if (checkhost) {
+ BIO_printf(bio, "Hostname %s does%s match certificate\n",
+ checkhost,
+ X509_check_host(x, checkhost, 0, 0, NULL) == 1
+ ? "" : " NOT");
+ }
+
+ if (checkemail) {
+ BIO_printf(bio, "Email %s does%s match certificate\n",
+ checkemail, X509_check_email(x, checkemail, 0, 0)
+ ? "" : " NOT");
+ }
+
+ if (checkip) {
+ BIO_printf(bio, "IP %s does%s match certificate\n",
+ checkip, X509_check_ip_asc(x, checkip, 0) ? "" : " NOT");
+ }
+}
+
+/* Get first http URL from a DIST_POINT structure */
+
+static const char *get_dp_url(DIST_POINT *dp)
+{
+ GENERAL_NAMES *gens;
+ GENERAL_NAME *gen;
+ int i, gtype;
+ ASN1_STRING *uri;
+ if (!dp->distpoint || dp->distpoint->type != 0)
+ return NULL;
+ gens = dp->distpoint->name.fullname;
+ for (i = 0; i < sk_GENERAL_NAME_num(gens); i++) {
+ gen = sk_GENERAL_NAME_value(gens, i);
+ uri = GENERAL_NAME_get0_value(gen, &gtype);
+ if (gtype == GEN_URI && ASN1_STRING_length(uri) > 6) {
+ const char *uptr = (const char *)ASN1_STRING_get0_data(uri);
+ if (strncmp(uptr, "http://", 7) == 0)
+ return uptr;
+ }
+ }
+ return NULL;
+}
+
+/*
+ * Look through a CRLDP structure and attempt to find an http URL to
+ * downloads a CRL from.
+ */
+
+static X509_CRL *load_crl_crldp(STACK_OF(DIST_POINT) *crldp)
+{
+ int i;
+ const char *urlptr = NULL;
+ for (i = 0; i < sk_DIST_POINT_num(crldp); i++) {
+ DIST_POINT *dp = sk_DIST_POINT_value(crldp, i);
+ urlptr = get_dp_url(dp);
+ if (urlptr)
+ return load_crl(urlptr, FORMAT_HTTP);
+ }
+ return NULL;
+}
+
+/*
+ * Example of downloading CRLs from CRLDP: not usable for real world as it
+ * always downloads, doesn't support non-blocking I/O and doesn't cache
+ * anything.
+ */
+
+static STACK_OF(X509_CRL) *crls_http_cb(X509_STORE_CTX *ctx, X509_NAME *nm)
+{
+ X509 *x;
+ STACK_OF(X509_CRL) *crls = NULL;
+ X509_CRL *crl;
+ STACK_OF(DIST_POINT) *crldp;
+
+ crls = sk_X509_CRL_new_null();
+ if (!crls)
+ return NULL;
+ x = X509_STORE_CTX_get_current_cert(ctx);
+ crldp = X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL);
+ crl = load_crl_crldp(crldp);
+ sk_DIST_POINT_pop_free(crldp, DIST_POINT_free);
+ if (!crl) {
+ sk_X509_CRL_free(crls);
+ return NULL;
+ }
+ sk_X509_CRL_push(crls, crl);
+ /* Try to download delta CRL */
+ crldp = X509_get_ext_d2i(x, NID_freshest_crl, NULL, NULL);
+ crl = load_crl_crldp(crldp);
+ sk_DIST_POINT_pop_free(crldp, DIST_POINT_free);
+ if (crl)
+ sk_X509_CRL_push(crls, crl);
+ return crls;
+}
+
+void store_setup_crl_download(X509_STORE *st)
+{
+ X509_STORE_set_lookup_crls_cb(st, crls_http_cb);
+}
+
+/*
+ * Platform-specific sections
+ */
+#if defined(_WIN32)
+# ifdef fileno
+# undef fileno
+# define fileno(a) (int)_fileno(a)
+# endif
+
+# include <windows.h>
+# include <tchar.h>
+
+static int WIN32_rename(const char *from, const char *to)
+{
+ TCHAR *tfrom = NULL, *tto;
+ DWORD err;
+ int ret = 0;
+
+ if (sizeof(TCHAR) == 1) {
+ tfrom = (TCHAR *)from;
+ tto = (TCHAR *)to;
+ } else { /* UNICODE path */
+
+ size_t i, flen = strlen(from) + 1, tlen = strlen(to) + 1;
+ tfrom = malloc(sizeof(*tfrom) * (flen + tlen));
+ if (tfrom == NULL)
+ goto err;
+ tto = tfrom + flen;
+# if !defined(_WIN32_WCE) || _WIN32_WCE>=101
+ if (!MultiByteToWideChar(CP_ACP, 0, from, flen, (WCHAR *)tfrom, flen))
+# endif
+ for (i = 0; i < flen; i++)
+ tfrom[i] = (TCHAR)from[i];
+# if !defined(_WIN32_WCE) || _WIN32_WCE>=101
+ if (!MultiByteToWideChar(CP_ACP, 0, to, tlen, (WCHAR *)tto, tlen))
+# endif
+ for (i = 0; i < tlen; i++)
+ tto[i] = (TCHAR)to[i];
+ }
+
+ if (MoveFile(tfrom, tto))
+ goto ok;
+ err = GetLastError();
+ if (err == ERROR_ALREADY_EXISTS || err == ERROR_FILE_EXISTS) {
+ if (DeleteFile(tto) && MoveFile(tfrom, tto))
+ goto ok;
+ err = GetLastError();
+ }
+ if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)
+ errno = ENOENT;
+ else if (err == ERROR_ACCESS_DENIED)
+ errno = EACCES;
+ else
+ errno = EINVAL; /* we could map more codes... */
+ err:
+ ret = -1;
+ ok:
+ if (tfrom != NULL && tfrom != (TCHAR *)from)
+ free(tfrom);
+ return ret;
+}
+#endif
+
+/* app_tminterval section */
+#if defined(_WIN32)
+double app_tminterval(int stop, int usertime)
+{
+ FILETIME now;
+ double ret = 0;
+ static ULARGE_INTEGER tmstart;
+ static int warning = 1;
+# ifdef _WIN32_WINNT
+ static HANDLE proc = NULL;
+
+ if (proc == NULL) {
+ if (check_winnt())
+ proc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE,
+ GetCurrentProcessId());
+ if (proc == NULL)
+ proc = (HANDLE) - 1;
+ }
+
+ if (usertime && proc != (HANDLE) - 1) {
+ FILETIME junk;
+ GetProcessTimes(proc, &junk, &junk, &junk, &now);
+ } else
+# endif
+ {
+ SYSTEMTIME systime;
+
+ if (usertime && warning) {
+ BIO_printf(bio_err, "To get meaningful results, run "
+ "this program on idle system.\n");
+ warning = 0;
+ }
+ GetSystemTime(&systime);
+ SystemTimeToFileTime(&systime, &now);
+ }
+
+ if (stop == TM_START) {
+ tmstart.u.LowPart = now.dwLowDateTime;
+ tmstart.u.HighPart = now.dwHighDateTime;
+ } else {
+ ULARGE_INTEGER tmstop;
+
+ tmstop.u.LowPart = now.dwLowDateTime;
+ tmstop.u.HighPart = now.dwHighDateTime;
+
+ ret = (__int64)(tmstop.QuadPart - tmstart.QuadPart) * 1e-7;
+ }
+
+ return (ret);
+}
+#elif defined(OPENSSL_SYSTEM_VXWORKS)
+# include <time.h>
+
+double app_tminterval(int stop, int usertime)
+{
+ double ret = 0;
+# ifdef CLOCK_REALTIME
+ static struct timespec tmstart;
+ struct timespec now;
+# else
+ static unsigned long tmstart;
+ unsigned long now;
+# endif
+ static int warning = 1;
+
+ if (usertime && warning) {
+ BIO_printf(bio_err, "To get meaningful results, run "
+ "this program on idle system.\n");
+ warning = 0;
+ }
+# ifdef CLOCK_REALTIME
+ clock_gettime(CLOCK_REALTIME, &now);
+ if (stop == TM_START)
+ tmstart = now;
+ else
+ ret = ((now.tv_sec + now.tv_nsec * 1e-9)
+ - (tmstart.tv_sec + tmstart.tv_nsec * 1e-9));
+# else
+ now = tickGet();
+ if (stop == TM_START)
+ tmstart = now;
+ else
+ ret = (now - tmstart) / (double)sysClkRateGet();
+# endif
+ return (ret);
+}
+
+#elif defined(OPENSSL_SYSTEM_VMS)
+# include <time.h>
+# include <times.h>
+
+double app_tminterval(int stop, int usertime)
+{
+ static clock_t tmstart;
+ double ret = 0;
+ clock_t now;
+# ifdef __TMS
+ struct tms rus;
+
+ now = times(&rus);
+ if (usertime)
+ now = rus.tms_utime;
+# else
+ if (usertime)
+ now = clock(); /* sum of user and kernel times */
+ else {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ now = (clock_t)((unsigned long long)tv.tv_sec * CLK_TCK +
+ (unsigned long long)tv.tv_usec * (1000000 / CLK_TCK)
+ );
+ }
+# endif
+ if (stop == TM_START)
+ tmstart = now;
+ else
+ ret = (now - tmstart) / (double)(CLK_TCK);
+
+ return (ret);
+}
+
+#elif defined(_SC_CLK_TCK) /* by means of unistd.h */
+# include <sys/times.h>
+
+double app_tminterval(int stop, int usertime)
+{
+ double ret = 0;
+ struct tms rus;
+ clock_t now = times(&rus);
+ static clock_t tmstart;
+
+ if (usertime)
+ now = rus.tms_utime;
+
+ if (stop == TM_START)
+ tmstart = now;
+ else {
+ long int tck = sysconf(_SC_CLK_TCK);
+ ret = (now - tmstart) / (double)tck;
+ }
+
+ return (ret);
+}
+
+#else
+# include <sys/time.h>
+# include <sys/resource.h>
+
+double app_tminterval(int stop, int usertime)
+{
+ double ret = 0;
+ struct rusage rus;
+ struct timeval now;
+ static struct timeval tmstart;
+
+ if (usertime)
+ getrusage(RUSAGE_SELF, &rus), now = rus.ru_utime;
+ else
+ gettimeofday(&now, NULL);
+
+ if (stop == TM_START)
+ tmstart = now;
+ else
+ ret = ((now.tv_sec + now.tv_usec * 1e-6)
+ - (tmstart.tv_sec + tmstart.tv_usec * 1e-6));
+
+ return ret;
+}
+#endif
+
+int app_access(const char* name, int flag)
+{
+#ifdef _WIN32
+ return _access(name, flag);
+#else
+ return access(name, flag);
+#endif
+}
+
+/* app_isdir section */
+#ifdef _WIN32
+int app_isdir(const char *name)
+{
+ DWORD attr;
+# if defined(UNICODE) || defined(_UNICODE)
+ size_t i, len_0 = strlen(name) + 1;
+ WCHAR tempname[MAX_PATH];
+
+ if (len_0 > MAX_PATH)
+ return -1;
+
+# if !defined(_WIN32_WCE) || _WIN32_WCE>=101
+ if (!MultiByteToWideChar(CP_ACP, 0, name, len_0, tempname, MAX_PATH))
+# endif
+ for (i = 0; i < len_0; i++)
+ tempname[i] = (WCHAR)name[i];
+
+ attr = GetFileAttributes(tempname);
+# else
+ attr = GetFileAttributes(name);
+# endif
+ if (attr == INVALID_FILE_ATTRIBUTES)
+ return -1;
+ return ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0);
+}
+#else
+# include <sys/stat.h>
+# ifndef S_ISDIR
+# if defined(_S_IFMT) && defined(_S_IFDIR)
+# define S_ISDIR(a) (((a) & _S_IFMT) == _S_IFDIR)
+# else
+# define S_ISDIR(a) (((a) & S_IFMT) == S_IFDIR)
+# endif
+# endif
+
+int app_isdir(const char *name)
+{
+# if defined(S_ISDIR)
+ struct stat st;
+
+ if (stat(name, &st) == 0)
+ return S_ISDIR(st.st_mode);
+ else
+ return -1;
+# else
+ return -1;
+# endif
+}
+#endif
+
+/* raw_read|write section */
+#if defined(__VMS)
+# include "vms_term_sock.h"
+static int stdin_sock = -1;
+
+static void close_stdin_sock(void)
+{
+ TerminalSocket (TERM_SOCK_DELETE, &stdin_sock);
+}
+
+int fileno_stdin(void)
+{
+ if (stdin_sock == -1) {
+ TerminalSocket(TERM_SOCK_CREATE, &stdin_sock);
+ atexit(close_stdin_sock);
+ }
+
+ return stdin_sock;
+}
+#else
+int fileno_stdin(void)
+{
+ return fileno(stdin);
+}
+#endif
+
+int fileno_stdout(void)
+{
+ return fileno(stdout);
+}
+
+#if defined(_WIN32) && defined(STD_INPUT_HANDLE)
+int raw_read_stdin(void *buf, int siz)
+{
+ DWORD n;
+ if (ReadFile(GetStdHandle(STD_INPUT_HANDLE), buf, siz, &n, NULL))
+ return (n);
+ else
+ return (-1);
+}
+#elif defined(__VMS)
+#include <sys/socket.h>
+
+int raw_read_stdin(void *buf, int siz)
+{
+ return recv(fileno_stdin(), buf, siz, 0);
+}
+#else
+int raw_read_stdin(void *buf, int siz)
+{
+ return read(fileno_stdin(), buf, siz);
+}
+#endif
+
+#if defined(_WIN32) && defined(STD_OUTPUT_HANDLE)
+int raw_write_stdout(const void *buf, int siz)
+{
+ DWORD n;
+ if (WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), buf, siz, &n, NULL))
+ return (n);
+ else
+ return (-1);
+}
+#else
+int raw_write_stdout(const void *buf, int siz)
+{
+ return write(fileno_stdout(), buf, siz);
+}
+#endif
+
+/*
+ * Centralized handling if input and output files with format specification
+ * The format is meant to show what the input and output is supposed to be,
+ * and is therefore a show of intent more than anything else. However, it
+ * does impact behavior on some platform, such as differentiating between
+ * text and binary input/output on non-Unix platforms
+ */
+static int istext(int format)
+{
+ return (format & B_FORMAT_TEXT) == B_FORMAT_TEXT;
+}
+
+BIO *dup_bio_in(int format)
+{
+ return BIO_new_fp(stdin,
+ BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
+}
+
+BIO *dup_bio_out(int format)
+{
+ BIO *b = BIO_new_fp(stdout,
+ BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
+#ifdef OPENSSL_SYS_VMS
+ if (istext(format))
+ b = BIO_push(BIO_new(BIO_f_linebuffer()), b);
+#endif
+ return b;
+}
+
+BIO *dup_bio_err(int format)
+{
+ BIO *b = BIO_new_fp(stderr,
+ BIO_NOCLOSE | (istext(format) ? BIO_FP_TEXT : 0));
+#ifdef OPENSSL_SYS_VMS
+ if (istext(format))
+ b = BIO_push(BIO_new(BIO_f_linebuffer()), b);
+#endif
+ return b;
+}
+
+void unbuffer(FILE *fp)
+{
+/*
+ * On VMS, setbuf() will only take 32-bit pointers, and a compilation
+ * with /POINTER_SIZE=64 will give off a MAYLOSEDATA2 warning here.
+ * However, we trust that the C RTL will never give us a FILE pointer
+ * above the first 4 GB of memory, so we simply turn off the warning
+ * temporarily.
+ */
+#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
+# pragma environment save
+# pragma message disable maylosedata2
+#endif
+ setbuf(fp, NULL);
+#if defined(OPENSSL_SYS_VMS) && defined(__DECC)
+# pragma environment restore
+#endif
+}
+
+static const char *modestr(char mode, int format)
+{
+ OPENSSL_assert(mode == 'a' || mode == 'r' || mode == 'w');
+
+ switch (mode) {
+ case 'a':
+ return istext(format) ? "a" : "ab";
+ case 'r':
+ return istext(format) ? "r" : "rb";
+ case 'w':
+ return istext(format) ? "w" : "wb";
+ }
+ /* The assert above should make sure we never reach this point */
+ return NULL;
+}
+
+static const char *modeverb(char mode)
+{
+ switch (mode) {
+ case 'a':
+ return "appending";
+ case 'r':
+ return "reading";
+ case 'w':
+ return "writing";
+ }
+ return "(doing something)";
+}
+
+/*
+ * Open a file for writing, owner-read-only.
+ */
+BIO *bio_open_owner(const char *filename, int format, int private)
+{
+ FILE *fp = NULL;
+ BIO *b = NULL;
+ int fd = -1, bflags, mode, textmode;
+
+ if (!private || filename == NULL || strcmp(filename, "-") == 0)
+ return bio_open_default(filename, 'w', format);
+
+ mode = O_WRONLY;
+#ifdef O_CREAT
+ mode |= O_CREAT;
+#endif
+#ifdef O_TRUNC
+ mode |= O_TRUNC;
+#endif
+ textmode = istext(format);
+ if (!textmode) {
+#ifdef O_BINARY
+ mode |= O_BINARY;
+#elif defined(_O_BINARY)
+ mode |= _O_BINARY;
+#endif
+ }
+
+#ifdef OPENSSL_SYS_VMS
+ /* VMS doesn't have O_BINARY, it just doesn't make sense. But,
+ * it still needs to know that we're going binary, or fdopen()
+ * will fail with "invalid argument"... so we tell VMS what the
+ * context is.
+ */
+ if (!textmode)
+ fd = open(filename, mode, 0600, "ctx=bin");
+ else
+#endif
+ fd = open(filename, mode, 0600);
+ if (fd < 0)
+ goto err;
+ fp = fdopen(fd, modestr('w', format));
+ if (fp == NULL)
+ goto err;
+ bflags = BIO_CLOSE;
+ if (textmode)
+ bflags |= BIO_FP_TEXT;
+ b = BIO_new_fp(fp, bflags);
+ if (b)
+ return b;
+
+ err:
+ BIO_printf(bio_err, "%s: Can't open \"%s\" for writing, %s\n",
+ opt_getprog(), filename, strerror(errno));
+ ERR_print_errors(bio_err);
+ /* If we have fp, then fdopen took over fd, so don't close both. */
+ if (fp)
+ fclose(fp);
+ else if (fd >= 0)
+ close(fd);
+ return NULL;
+}
+
+static BIO *bio_open_default_(const char *filename, char mode, int format,
+ int quiet)
+{
+ BIO *ret;
+
+ if (filename == NULL || strcmp(filename, "-") == 0) {
+ ret = mode == 'r' ? dup_bio_in(format) : dup_bio_out(format);
+ if (quiet) {
+ ERR_clear_error();
+ return ret;
+ }
+ if (ret != NULL)
+ return ret;
+ BIO_printf(bio_err,
+ "Can't open %s, %s\n",
+ mode == 'r' ? "stdin" : "stdout", strerror(errno));
+ } else {
+ ret = BIO_new_file(filename, modestr(mode, format));
+ if (quiet) {
+ ERR_clear_error();
+ return ret;
+ }
+ if (ret != NULL)
+ return ret;
+ BIO_printf(bio_err,
+ "Can't open %s for %s, %s\n",
+ filename, modeverb(mode), strerror(errno));
+ }
+ ERR_print_errors(bio_err);
+ return NULL;
+}
+
+BIO *bio_open_default(const char *filename, char mode, int format)
+{
+ return bio_open_default_(filename, mode, format, 0);
+}
+
+BIO *bio_open_default_quiet(const char *filename, char mode, int format)
+{
+ return bio_open_default_(filename, mode, format, 1);
+}
+
+void wait_for_async(SSL *s)
+{
+ /* On Windows select only works for sockets, so we simply don't wait */
+#ifndef OPENSSL_SYS_WINDOWS
+ int width = 0;
+ fd_set asyncfds;
+ OSSL_ASYNC_FD *fds;
+ size_t numfds;
+ size_t i;
+
+ if (!SSL_get_all_async_fds(s, NULL, &numfds))
+ return;
+ if (numfds == 0)
+ return;
+ fds = app_malloc(sizeof(OSSL_ASYNC_FD) * numfds, "allocate async fds");
+ if (!SSL_get_all_async_fds(s, fds, &numfds)) {
+ OPENSSL_free(fds);
+ return;
+ }
+
+ FD_ZERO(&asyncfds);
+ for (i = 0; i < numfds; i++) {
+ if (width <= (int)fds[i])
+ width = (int)fds[i] + 1;
+ openssl_fdset((int)fds[i], &asyncfds);
+ }
+ select(width, (void *)&asyncfds, NULL, NULL, NULL);
+ OPENSSL_free(fds);
+#endif
+}
+
+/* if OPENSSL_SYS_WINDOWS is defined then so is OPENSSL_SYS_MSDOS */
+#if defined(OPENSSL_SYS_MSDOS)
+int has_stdin_waiting(void)
+{
+# if defined(OPENSSL_SYS_WINDOWS)
+ HANDLE inhand = GetStdHandle(STD_INPUT_HANDLE);
+ DWORD events = 0;
+ INPUT_RECORD inputrec;
+ DWORD insize = 1;
+ BOOL peeked;
+
+ if (inhand == INVALID_HANDLE_VALUE) {
+ return 0;
+ }
+
+ peeked = PeekConsoleInput(inhand, &inputrec, insize, &events);
+ if (!peeked) {
+ /* Probably redirected input? _kbhit() does not work in this case */
+ if (!feof(stdin)) {
+ return 1;
+ }
+ return 0;
+ }
+# endif
+ return _kbhit();
+}
+#endif
+
+/* Corrupt a signature by modifying final byte */
+void corrupt_signature(const ASN1_STRING *signature)
+{
+ unsigned char *s = signature->data;
+ s[signature->length - 1] ^= 0x1;
+}
+
+int set_cert_times(X509 *x, const char *startdate, const char *enddate,
+ int days)
+{
+ if (startdate == NULL || strcmp(startdate, "today") == 0) {
+ if (X509_gmtime_adj(X509_getm_notBefore(x), 0) == NULL)
+ return 0;
+ } else {
+ if (!ASN1_TIME_set_string(X509_getm_notBefore(x), startdate))
+ return 0;
+ }
+ if (enddate == NULL) {
+ if (X509_time_adj_ex(X509_getm_notAfter(x), days, 0, NULL)
+ == NULL)
+ return 0;
+ } else if (!ASN1_TIME_set_string(X509_getm_notAfter(x), enddate)) {
+ return 0;
+ }
+ return 1;
+}
diff --git a/openssl-1.1.0h/apps/apps.h b/openssl-1.1.0h/apps/apps.h
new file mode 100644
index 0000000..f91faf8
--- /dev/null
+++ b/openssl-1.1.0h/apps/apps.h
@@ -0,0 +1,573 @@
+/*
+ * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef HEADER_APPS_H
+# define HEADER_APPS_H
+
+# include "e_os.h"
+# if defined(__unix) || defined(__unix__)
+# include <sys/time.h> /* struct timeval for DTLS */
+# endif
+# include <assert.h>
+
+# include <openssl/e_os2.h>
+# include <openssl/ossl_typ.h>
+# include <openssl/bio.h>
+# include <openssl/x509.h>
+# include <openssl/lhash.h>
+# include <openssl/conf.h>
+# include <openssl/txt_db.h>
+# include <openssl/engine.h>
+# include <openssl/ocsp.h>
+# include <signal.h>
+
+# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
+# define openssl_fdset(a,b) FD_SET((unsigned int)a, b)
+# else
+# define openssl_fdset(a,b) FD_SET(a, b)
+# endif
+
+/*
+ * quick macro when you need to pass an unsigned char instead of a char.
+ * this is true for some implementations of the is*() functions, for
+ * example.
+ */
+#define _UC(c) ((unsigned char)(c))
+
+int app_RAND_load_file(const char *file, int dont_warn);
+int app_RAND_write_file(const char *file);
+/*
+ * When `file' is NULL, use defaults. `bio_e' is for error messages.
+ */
+void app_RAND_allow_write_file(void);
+long app_RAND_load_files(char *file); /* `file' is a list of files to read,
+ * separated by LIST_SEPARATOR_CHAR
+ * (see e_os.h). The string is
+ * destroyed! */
+
+extern char *default_config_file;
+extern BIO *bio_in;
+extern BIO *bio_out;
+extern BIO *bio_err;
+BIO *dup_bio_in(int format);
+BIO *dup_bio_out(int format);
+BIO *dup_bio_err(int format);
+BIO *bio_open_owner(const char *filename, int format, int private);
+BIO *bio_open_default(const char *filename, char mode, int format);
+BIO *bio_open_default_quiet(const char *filename, char mode, int format);
+CONF *app_load_config(const char *filename);
+CONF *app_load_config_quiet(const char *filename);
+int app_load_modules(const CONF *config);
+void unbuffer(FILE *fp);
+void wait_for_async(SSL *s);
+# if defined(OPENSSL_SYS_MSDOS)
+int has_stdin_waiting(void);
+# endif
+
+void corrupt_signature(const ASN1_STRING *signature);
+int set_cert_times(X509 *x, const char *startdate, const char *enddate,
+ int days);
+
+/*
+ * Common verification options.
+ */
+# define OPT_V_ENUM \
+ OPT_V__FIRST=2000, \
+ OPT_V_POLICY, OPT_V_PURPOSE, OPT_V_VERIFY_NAME, OPT_V_VERIFY_DEPTH, \
+ OPT_V_ATTIME, OPT_V_VERIFY_HOSTNAME, OPT_V_VERIFY_EMAIL, \
+ OPT_V_VERIFY_IP, OPT_V_IGNORE_CRITICAL, OPT_V_ISSUER_CHECKS, \
+ OPT_V_CRL_CHECK, OPT_V_CRL_CHECK_ALL, OPT_V_POLICY_CHECK, \
+ OPT_V_EXPLICIT_POLICY, OPT_V_INHIBIT_ANY, OPT_V_INHIBIT_MAP, \
+ OPT_V_X509_STRICT, OPT_V_EXTENDED_CRL, OPT_V_USE_DELTAS, \
+ OPT_V_POLICY_PRINT, OPT_V_CHECK_SS_SIG, OPT_V_TRUSTED_FIRST, \
+ OPT_V_SUITEB_128_ONLY, OPT_V_SUITEB_128, OPT_V_SUITEB_192, \
+ OPT_V_PARTIAL_CHAIN, OPT_V_NO_ALT_CHAINS, OPT_V_NO_CHECK_TIME, \
+ OPT_V_VERIFY_AUTH_LEVEL, OPT_V_ALLOW_PROXY_CERTS, \
+ OPT_V__LAST
+
+# define OPT_V_OPTIONS \
+ { "policy", OPT_V_POLICY, 's', "adds policy to the acceptable policy set"}, \
+ { "purpose", OPT_V_PURPOSE, 's', \
+ "certificate chain purpose"}, \
+ { "verify_name", OPT_V_VERIFY_NAME, 's', "verification policy name"}, \
+ { "verify_depth", OPT_V_VERIFY_DEPTH, 'n', \
+ "chain depth limit" }, \
+ { "auth_level", OPT_V_VERIFY_AUTH_LEVEL, 'n', \
+ "chain authentication security level" }, \
+ { "attime", OPT_V_ATTIME, 'M', "verification epoch time" }, \
+ { "verify_hostname", OPT_V_VERIFY_HOSTNAME, 's', \
+ "expected peer hostname" }, \
+ { "verify_email", OPT_V_VERIFY_EMAIL, 's', \
+ "expected peer email" }, \
+ { "verify_ip", OPT_V_VERIFY_IP, 's', \
+ "expected peer IP address" }, \
+ { "ignore_critical", OPT_V_IGNORE_CRITICAL, '-', \
+ "permit unhandled critical extensions"}, \
+ { "issuer_checks", OPT_V_ISSUER_CHECKS, '-', "(deprecated)"}, \
+ { "crl_check", OPT_V_CRL_CHECK, '-', "check leaf certificate revocation" }, \
+ { "crl_check_all", OPT_V_CRL_CHECK_ALL, '-', "check full chain revocation" }, \
+ { "policy_check", OPT_V_POLICY_CHECK, '-', "perform rfc5280 policy checks"}, \
+ { "explicit_policy", OPT_V_EXPLICIT_POLICY, '-', \
+ "set policy variable require-explicit-policy"}, \
+ { "inhibit_any", OPT_V_INHIBIT_ANY, '-', \
+ "set policy variable inhibit-any-policy"}, \
+ { "inhibit_map", OPT_V_INHIBIT_MAP, '-', \
+ "set policy variable inhibit-policy-mapping"}, \
+ { "x509_strict", OPT_V_X509_STRICT, '-', \
+ "disable certificate compatibility work-arounds"}, \
+ { "extended_crl", OPT_V_EXTENDED_CRL, '-', \
+ "enable extended CRL features"}, \
+ { "use_deltas", OPT_V_USE_DELTAS, '-', \
+ "use delta CRLs"}, \
+ { "policy_print", OPT_V_POLICY_PRINT, '-', \
+ "print policy processing diagnostics"}, \
+ { "check_ss_sig", OPT_V_CHECK_SS_SIG, '-', \
+ "check root CA self-signatures"}, \
+ { "trusted_first", OPT_V_TRUSTED_FIRST, '-', \
+ "search trust store first (default)" }, \
+ { "suiteB_128_only", OPT_V_SUITEB_128_ONLY, '-', "Suite B 128-bit-only mode"}, \
+ { "suiteB_128", OPT_V_SUITEB_128, '-', \
+ "Suite B 128-bit mode allowing 192-bit algorithms"}, \
+ { "suiteB_192", OPT_V_SUITEB_192, '-', "Suite B 192-bit-only mode" }, \
+ { "partial_chain", OPT_V_PARTIAL_CHAIN, '-', \
+ "accept chains anchored by intermediate trust-store CAs"}, \
+ { "no_alt_chains", OPT_V_NO_ALT_CHAINS, '-', "(deprecated)" }, \
+ { "no_check_time", OPT_V_NO_CHECK_TIME, '-', "ignore certificate validity time" }, \
+ { "allow_proxy_certs", OPT_V_ALLOW_PROXY_CERTS, '-', "allow the use of proxy certificates" }
+
+# define OPT_V_CASES \
+ OPT_V__FIRST: case OPT_V__LAST: break; \
+ case OPT_V_POLICY: \
+ case OPT_V_PURPOSE: \
+ case OPT_V_VERIFY_NAME: \
+ case OPT_V_VERIFY_DEPTH: \
+ case OPT_V_VERIFY_AUTH_LEVEL: \
+ case OPT_V_ATTIME: \
+ case OPT_V_VERIFY_HOSTNAME: \
+ case OPT_V_VERIFY_EMAIL: \
+ case OPT_V_VERIFY_IP: \
+ case OPT_V_IGNORE_CRITICAL: \
+ case OPT_V_ISSUER_CHECKS: \
+ case OPT_V_CRL_CHECK: \
+ case OPT_V_CRL_CHECK_ALL: \
+ case OPT_V_POLICY_CHECK: \
+ case OPT_V_EXPLICIT_POLICY: \
+ case OPT_V_INHIBIT_ANY: \
+ case OPT_V_INHIBIT_MAP: \
+ case OPT_V_X509_STRICT: \
+ case OPT_V_EXTENDED_CRL: \
+ case OPT_V_USE_DELTAS: \
+ case OPT_V_POLICY_PRINT: \
+ case OPT_V_CHECK_SS_SIG: \
+ case OPT_V_TRUSTED_FIRST: \
+ case OPT_V_SUITEB_128_ONLY: \
+ case OPT_V_SUITEB_128: \
+ case OPT_V_SUITEB_192: \
+ case OPT_V_PARTIAL_CHAIN: \
+ case OPT_V_NO_ALT_CHAINS: \
+ case OPT_V_NO_CHECK_TIME: \
+ case OPT_V_ALLOW_PROXY_CERTS
+
+/*
+ * Common "extended"? options.
+ */
+# define OPT_X_ENUM \
+ OPT_X__FIRST=1000, \
+ OPT_X_KEY, OPT_X_CERT, OPT_X_CHAIN, OPT_X_CHAIN_BUILD, \
+ OPT_X_CERTFORM, OPT_X_KEYFORM, \
+ OPT_X__LAST
+
+# define OPT_X_OPTIONS \
+ { "xkey", OPT_X_KEY, '<', "key for Extended certificates"}, \
+ { "xcert", OPT_X_CERT, '<', "cert for Extended certificates"}, \
+ { "xchain", OPT_X_CHAIN, '<', "chain for Extended certificates"}, \
+ { "xchain_build", OPT_X_CHAIN_BUILD, '-', \
+ "build certificate chain for the extended certificates"}, \
+ { "xcertform", OPT_X_CERTFORM, 'F', \
+ "format of Extended certificate (PEM or DER) PEM default " }, \
+ { "xkeyform", OPT_X_KEYFORM, 'F', \
+ "format of Extended certificate's key (PEM or DER) PEM default"}
+
+# define OPT_X_CASES \
+ OPT_X__FIRST: case OPT_X__LAST: break; \
+ case OPT_X_KEY: \
+ case OPT_X_CERT: \
+ case OPT_X_CHAIN: \
+ case OPT_X_CHAIN_BUILD: \
+ case OPT_X_CERTFORM: \
+ case OPT_X_KEYFORM
+
+/*
+ * Common SSL options.
+ * Any changes here must be coordinated with ../ssl/ssl_conf.c
+ */
+# define OPT_S_ENUM \
+ OPT_S__FIRST=3000, \
+ OPT_S_NOSSL3, OPT_S_NOTLS1, OPT_S_NOTLS1_1, OPT_S_NOTLS1_2, \
+ OPT_S_BUGS, OPT_S_NO_COMP, OPT_S_NOTICKET, \
+ OPT_S_SERVERPREF, OPT_S_LEGACYRENEG, OPT_S_LEGACYCONN, \
+ OPT_S_ONRESUMP, OPT_S_NOLEGACYCONN, OPT_S_STRICT, OPT_S_SIGALGS, \
+ OPT_S_CLIENTSIGALGS, OPT_S_CURVES, OPT_S_NAMEDCURVE, OPT_S_CIPHER, \
+ OPT_S_DEBUGBROKE, OPT_S_COMP, OPT_S_MINPROTO, OPT_S_MAXPROTO, \
+ OPT_S_NO_RENEGOTIATION, OPT_S__LAST
+
+# define OPT_S_OPTIONS \
+ {"no_ssl3", OPT_S_NOSSL3, '-',"Just disable SSLv3" }, \
+ {"no_tls1", OPT_S_NOTLS1, '-', "Just disable TLSv1"}, \
+ {"no_tls1_1", OPT_S_NOTLS1_1, '-', "Just disable TLSv1.1" }, \
+ {"no_tls1_2", OPT_S_NOTLS1_2, '-', "Just disable TLSv1.2"}, \
+ {"bugs", OPT_S_BUGS, '-', "Turn on SSL bug compatibility"}, \
+ {"no_comp", OPT_S_NO_COMP, '-', "Disable SSL/TLS compression (default)" }, \
+ {"comp", OPT_S_COMP, '-', "Use SSL/TLS-level compression" }, \
+ {"no_ticket", OPT_S_NOTICKET, '-', \
+ "Disable use of TLS session tickets"}, \
+ {"serverpref", OPT_S_SERVERPREF, '-', "Use server's cipher preferences"}, \
+ {"legacy_renegotiation", OPT_S_LEGACYRENEG, '-', \
+ "Enable use of legacy renegotiation (dangerous)"}, \
+ {"no_renegotiation", OPT_S_NO_RENEGOTIATION, '-', \
+ "Disable all renegotiation."}, \
+ {"legacy_server_connect", OPT_S_LEGACYCONN, '-', \
+ "Allow initial connection to servers that don't support RI"}, \
+ {"no_resumption_on_reneg", OPT_S_ONRESUMP, '-', \
+ "Disallow session resumption on renegotiation"}, \
+ {"no_legacy_server_connect", OPT_S_NOLEGACYCONN, '-', \
+ "Disallow initial connection to servers that don't support RI"}, \
+ {"strict", OPT_S_STRICT, '-', \
+ "Enforce strict certificate checks as per TLS standard"}, \
+ {"sigalgs", OPT_S_SIGALGS, 's', \
+ "Signature algorithms to support (colon-separated list)" }, \
+ {"client_sigalgs", OPT_S_CLIENTSIGALGS, 's', \
+ "Signature algorithms to support for client certificate" \
+ " authentication (colon-separated list)" }, \
+ {"curves", OPT_S_CURVES, 's', \
+ "Elliptic curves to advertise (colon-separated list)" }, \
+ {"named_curve", OPT_S_NAMEDCURVE, 's', \
+ "Elliptic curve used for ECDHE (server-side only)" }, \
+ {"cipher", OPT_S_CIPHER, 's', "Specify cipher list to be used"}, \
+ {"min_protocol", OPT_S_MINPROTO, 's', "Specify the minimum protocol version to be used"}, \
+ {"max_protocol", OPT_S_MAXPROTO, 's', "Specify the maximum protocol version to be used"}, \
+ {"debug_broken_protocol", OPT_S_DEBUGBROKE, '-', \
+ "Perform all sorts of protocol violations for testing purposes"}
+
+# define OPT_S_CASES \
+ OPT_S__FIRST: case OPT_S__LAST: break; \
+ case OPT_S_NOSSL3: \
+ case OPT_S_NOTLS1: \
+ case OPT_S_NOTLS1_1: \
+ case OPT_S_NOTLS1_2: \
+ case OPT_S_BUGS: \
+ case OPT_S_NO_COMP: \
+ case OPT_S_COMP: \
+ case OPT_S_NOTICKET: \
+ case OPT_S_SERVERPREF: \
+ case OPT_S_LEGACYRENEG: \
+ case OPT_S_LEGACYCONN: \
+ case OPT_S_ONRESUMP: \
+ case OPT_S_NOLEGACYCONN: \
+ case OPT_S_STRICT: \
+ case OPT_S_SIGALGS: \
+ case OPT_S_CLIENTSIGALGS: \
+ case OPT_S_CURVES: \
+ case OPT_S_NAMEDCURVE: \
+ case OPT_S_CIPHER: \
+ case OPT_S_MINPROTO: \
+ case OPT_S_MAXPROTO: \
+ case OPT_S_NO_RENEGOTIATION: \
+ case OPT_S_DEBUGBROKE
+
+#define IS_NO_PROT_FLAG(o) \
+ (o == OPT_S_NOSSL3 || o == OPT_S_NOTLS1 || o == OPT_S_NOTLS1_1 \
+ || o == OPT_S_NOTLS1_2)
+
+/*
+ * Option parsing.
+ */
+extern const char OPT_HELP_STR[];
+extern const char OPT_MORE_STR[];
+typedef struct options_st {
+ const char *name;
+ int retval;
+ /*
+ * value type: - no value (also the value zero), n number, p positive
+ * number, u unsigned, l long, s string, < input file, > output file,
+ * f any format, F der/pem format , E der/pem/engine format identifier.
+ * l, n and u include zero; p does not.
+ */
+ int valtype;
+ const char *helpstr;
+} OPTIONS;
+
+/*
+ * A string/int pairing; widely use for option value lookup, hence the
+ * name OPT_PAIR. But that name is misleading in s_cb.c, so we also use
+ * the "generic" name STRINT_PAIR.
+ */
+typedef struct string_int_pair_st {
+ const char *name;
+ int retval;
+} OPT_PAIR, STRINT_PAIR;
+
+/* Flags to pass into opt_format; see FORMAT_xxx, below. */
+# define OPT_FMT_PEMDER (1L << 1)
+# define OPT_FMT_PKCS12 (1L << 2)
+# define OPT_FMT_SMIME (1L << 3)
+# define OPT_FMT_ENGINE (1L << 4)
+# define OPT_FMT_MSBLOB (1L << 5)
+# define OPT_FMT_NETSCAPE (1L << 6)
+# define OPT_FMT_NSS (1L << 7)
+# define OPT_FMT_TEXT (1L << 8)
+# define OPT_FMT_HTTP (1L << 9)
+# define OPT_FMT_PVK (1L << 10)
+# define OPT_FMT_PDE (OPT_FMT_PEMDER | OPT_FMT_ENGINE)
+# define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME)
+# define OPT_FMT_ANY ( \
+ OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \
+ OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \
+ OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)
+
+char *opt_progname(const char *argv0);
+char *opt_getprog(void);
+char *opt_init(int ac, char **av, const OPTIONS * o);
+int opt_next(void);
+int opt_format(const char *s, unsigned long flags, int *result);
+int opt_int(const char *arg, int *result);
+int opt_ulong(const char *arg, unsigned long *result);
+int opt_long(const char *arg, long *result);
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
+ defined(INTMAX_MAX) && defined(UINTMAX_MAX)
+int opt_imax(const char *arg, intmax_t *result);
+int opt_umax(const char *arg, uintmax_t *result);
+#else
+# define opt_imax opt_long
+# define opt_umax opt_ulong
+# define intmax_t long
+# define uintmax_t unsigned long
+#endif
+int opt_pair(const char *arg, const OPT_PAIR * pairs, int *result);
+int opt_cipher(const char *name, const EVP_CIPHER **cipherp);
+int opt_md(const char *name, const EVP_MD **mdp);
+char *opt_arg(void);
+char *opt_flag(void);
+char *opt_unknown(void);
+char *opt_reset(void);
+char **opt_rest(void);
+int opt_num_rest(void);
+int opt_verify(int i, X509_VERIFY_PARAM *vpm);
+void opt_help(const OPTIONS * list);
+int opt_format_error(const char *s, unsigned long flags);
+
+typedef struct args_st {
+ int size;
+ int argc;
+ char **argv;
+} ARGS;
+
+/*
+ * VMS C only for now, implemented in vms_decc_init.c
+ * If other C compilers forget to terminate argv with NULL, this function
+ * can be re-used.
+ */
+char **copy_argv(int *argc, char *argv[]);
+/*
+ * Win32-specific argv initialization that splits OS-supplied UNICODE
+ * command line string to array of UTF8-encoded strings.
+ */
+void win32_utf8argv(int *argc, char **argv[]);
+
+
+# define PW_MIN_LENGTH 4
+typedef struct pw_cb_data {
+ const void *password;
+ const char *prompt_info;
+} PW_CB_DATA;
+
+int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_data);
+
+int setup_ui_method(void);
+void destroy_ui_method(void);
+
+int chopup_args(ARGS *arg, char *buf);
+# ifdef HEADER_X509_H
+int dump_cert_text(BIO *out, X509 *x);
+void print_name(BIO *out, const char *title, X509_NAME *nm,
+ unsigned long lflags);
+# endif
+void print_bignum_var(BIO *, const BIGNUM *, const char*,
+ int, unsigned char *);
+void print_array(BIO *, const char *, int, const unsigned char *);
+int set_cert_ex(unsigned long *flags, const char *arg);
+int set_name_ex(unsigned long *flags, const char *arg);
+int set_ext_copy(int *copy_type, const char *arg);
+int copy_extensions(X509 *x, X509_REQ *req, int copy_type);
+int app_passwd(const char *arg1, const char *arg2, char **pass1, char **pass2);
+int add_oid_section(CONF *conf);
+X509 *load_cert(const char *file, int format, const char *cert_descrip);
+X509_CRL *load_crl(const char *infile, int format);
+EVP_PKEY *load_key(const char *file, int format, int maybe_stdin,
+ const char *pass, ENGINE *e, const char *key_descrip);
+EVP_PKEY *load_pubkey(const char *file, int format, int maybe_stdin,
+ const char *pass, ENGINE *e, const char *key_descrip);
+int load_certs(const char *file, STACK_OF(X509) **certs, int format,
+ const char *pass, const char *cert_descrip);
+int load_crls(const char *file, STACK_OF(X509_CRL) **crls, int format,
+ const char *pass, const char *cert_descrip);
+X509_STORE *setup_verify(const char *CAfile, const char *CApath,
+ int noCAfile, int noCApath);
+__owur int ctx_set_verify_locations(SSL_CTX *ctx, const char *CAfile,
+ const char *CApath, int noCAfile,
+ int noCApath);
+
+#ifndef OPENSSL_NO_CT
+
+/*
+ * Sets the file to load the Certificate Transparency log list from.
+ * If path is NULL, loads from the default file path.
+ * Returns 1 on success, 0 otherwise.
+ */
+__owur int ctx_set_ctlog_list_file(SSL_CTX *ctx, const char *path);
+
+#endif
+
+ENGINE *setup_engine(const char *engine, int debug);
+void release_engine(ENGINE *e);
+
+# ifndef OPENSSL_NO_OCSP
+OCSP_RESPONSE *process_responder(OCSP_REQUEST *req,
+ const char *host, const char *path,
+ const char *port, int use_ssl,
+ STACK_OF(CONF_VALUE) *headers,
+ int req_timeout);
+# endif
+
+/* Functions defined in ca.c and also used in ocsp.c */
+int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
+ ASN1_GENERALIZEDTIME **pinvtm, const char *str);
+
+# define DB_type 0
+# define DB_exp_date 1
+# define DB_rev_date 2
+# define DB_serial 3 /* index - unique */
+# define DB_file 4
+# define DB_name 5 /* index - unique when active and not
+ * disabled */
+# define DB_NUMBER 6
+
+# define DB_TYPE_REV 'R'
+# define DB_TYPE_EXP 'E'
+# define DB_TYPE_VAL 'V'
+
+typedef struct db_attr_st {
+ int unique_subject;
+} DB_ATTR;
+typedef struct ca_db_st {
+ DB_ATTR attributes;
+ TXT_DB *db;
+} CA_DB;
+
+void* app_malloc(int sz, const char *what);
+BIGNUM *load_serial(const char *serialfile, int create, ASN1_INTEGER **retai);
+int save_serial(const char *serialfile, const char *suffix, const BIGNUM *serial,
+ ASN1_INTEGER **retai);
+int rotate_serial(const char *serialfile, const char *new_suffix,
+ const char *old_suffix);
+int rand_serial(BIGNUM *b, ASN1_INTEGER *ai);
+CA_DB *load_index(const char *dbfile, DB_ATTR *dbattr);
+int index_index(CA_DB *db);
+int save_index(const char *dbfile, const char *suffix, CA_DB *db);
+int rotate_index(const char *dbfile, const char *new_suffix,
+ const char *old_suffix);
+void free_index(CA_DB *db);
+# define index_name_cmp_noconst(a, b) \
+ index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \
+ (const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b))
+int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b);
+int parse_yesno(const char *str, int def);
+
+X509_NAME *parse_name(const char *str, long chtype, int multirdn);
+int args_verify(char ***pargs, int *pargc,
+ int *badarg, X509_VERIFY_PARAM **pm);
+void policies_print(X509_STORE_CTX *ctx);
+int bio_to_mem(unsigned char **out, int maxlen, BIO *in);
+int pkey_ctrl_string(EVP_PKEY_CTX *ctx, const char *value);
+int init_gen_str(EVP_PKEY_CTX **pctx,
+ const char *algname, ENGINE *e, int do_param);
+int do_X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md,
+ STACK_OF(OPENSSL_STRING) *sigopts);
+int do_X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md,
+ STACK_OF(OPENSSL_STRING) *sigopts);
+int do_X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md,
+ STACK_OF(OPENSSL_STRING) *sigopts);
+# ifndef OPENSSL_NO_PSK
+extern char *psk_key;
+# endif
+
+unsigned char *next_protos_parse(size_t *outlen, const char *in);
+
+void print_cert_checks(BIO *bio, X509 *x,
+ const char *checkhost,
+ const char *checkemail, const char *checkip);
+
+void store_setup_crl_download(X509_STORE *st);
+
+/* See OPT_FMT_xxx, above. */
+/* On some platforms, it's important to distinguish between text and binary
+ * files. On some, there might even be specific file formats for different
+ * contents. The FORMAT_xxx macros are meant to express an intent with the
+ * file being read or created.
+ */
+# define B_FORMAT_TEXT 0x8000
+# define FORMAT_UNDEF 0
+# define FORMAT_TEXT (1 | B_FORMAT_TEXT) /* Generic text */
+# define FORMAT_BINARY 2 /* Generic binary */
+# define FORMAT_BASE64 (3 | B_FORMAT_TEXT) /* Base64 */
+# define FORMAT_ASN1 4 /* ASN.1/DER */
+# define FORMAT_PEM (5 | B_FORMAT_TEXT)
+# define FORMAT_PKCS12 6
+# define FORMAT_SMIME (7 | B_FORMAT_TEXT)
+# define FORMAT_ENGINE 8 /* Not really a file format */
+# define FORMAT_PEMRSA (9 | B_FORMAT_TEXT) /* PEM RSAPubicKey format */
+# define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
+# define FORMAT_MSBLOB 11 /* MS Key blob format */
+# define FORMAT_PVK 12 /* MS PVK file format */
+# define FORMAT_HTTP 13 /* Download using HTTP */
+# define FORMAT_NSS 14 /* NSS keylog format */
+
+# define EXT_COPY_NONE 0
+# define EXT_COPY_ADD 1
+# define EXT_COPY_ALL 2
+
+# define NETSCAPE_CERT_HDR "certificate"
+
+# define APP_PASS_LEN 1024
+
+# define SERIAL_RAND_BITS 64
+
+int app_isdir(const char *);
+int app_access(const char *, int flag);
+int fileno_stdin(void);
+int fileno_stdout(void);
+int raw_read_stdin(void *, int);
+int raw_write_stdout(const void *, int);
+
+# define TM_START 0
+# define TM_STOP 1
+double app_tminterval(int stop, int usertime);
+
+typedef struct verify_options_st {
+ int depth;
+ int quiet;
+ int error;
+ int return_error;
+} VERIFY_CB_ARGS;
+
+extern VERIFY_CB_ARGS verify_args;
+
+# include "progs.h"
+
+#endif
diff --git a/openssl-1.1.0h/apps/asn1pars.c b/openssl-1.1.0h/apps/asn1pars.c
new file mode 100644
index 0000000..1ac261c
--- /dev/null
+++ b/openssl-1.1.0h/apps/asn1pars.c
@@ -0,0 +1,330 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/*
+ * A nice addition from Dr Stephen Henson <steve@openssl.org> to add the
+ * -strparse option which parses nested binary structures
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "apps.h"
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_IN, OPT_OUT, OPT_INDENT, OPT_NOOUT,
+ OPT_OID, OPT_OFFSET, OPT_LENGTH, OPT_DUMP, OPT_DLIMIT,
+ OPT_STRPARSE, OPT_GENSTR, OPT_GENCONF, OPT_STRICTPEM
+} OPTION_CHOICE;
+
+OPTIONS asn1parse_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"inform", OPT_INFORM, 'F', "input format - one of DER PEM"},
+ {"in", OPT_IN, '<', "input file"},
+ {"out", OPT_OUT, '>', "output file (output format is always DER)"},
+ {"i", OPT_INDENT, 0, "indents the output"},
+ {"noout", OPT_NOOUT, 0, "do not produce any output"},
+ {"offset", OPT_OFFSET, 'p', "offset into file"},
+ {"length", OPT_LENGTH, 'p', "length of section in file"},
+ {"oid", OPT_OID, '<', "file of extra oid definitions"},
+ {"dump", OPT_DUMP, 0, "unknown data in hex form"},
+ {"dlimit", OPT_DLIMIT, 'p',
+ "dump the first arg bytes of unknown data in hex form"},
+ {"strparse", OPT_STRPARSE, 's',
+ "offset; a series of these can be used to 'dig'"},
+ {OPT_MORE_STR, 0, 0, "into multiple ASN1 blob wrappings"},
+ {"genstr", OPT_GENSTR, 's', "string to generate ASN1 structure from"},
+ {"genconf", OPT_GENCONF, 's', "file to generate ASN1 structure from"},
+ {OPT_MORE_STR, 0, 0, "(-inform will be ignored)"},
+ {"strictpem", OPT_STRICTPEM, 0,
+ "do not attempt base64 decode outside PEM markers"},
+ {NULL}
+};
+
+static int do_generate(char *genstr, const char *genconf, BUF_MEM *buf);
+
+int asn1parse_main(int argc, char **argv)
+{
+ ASN1_TYPE *at = NULL;
+ BIO *in = NULL, *b64 = NULL, *derout = NULL;
+ BUF_MEM *buf = NULL;
+ STACK_OF(OPENSSL_STRING) *osk = NULL;
+ char *genstr = NULL, *genconf = NULL;
+ char *infile = NULL, *oidfile = NULL, *derfile = NULL;
+ unsigned char *str = NULL;
+ char *name = NULL, *header = NULL, *prog;
+ const unsigned char *ctmpbuf;
+ int indent = 0, noout = 0, dump = 0, strictpem = 0, informat = FORMAT_PEM;
+ int offset = 0, ret = 1, i, j;
+ long num, tmplen;
+ unsigned char *tmpbuf;
+ unsigned int length = 0;
+ OPTION_CHOICE o;
+
+ prog = opt_init(argc, argv, asn1parse_options);
+
+ if ((osk = sk_OPENSSL_STRING_new_null()) == NULL) {
+ BIO_printf(bio_err, "%s: Memory allocation failure\n", prog);
+ goto end;
+ }
+
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(asn1parse_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUT:
+ derfile = opt_arg();
+ break;
+ case OPT_INDENT:
+ indent = 1;
+ break;
+ case OPT_NOOUT:
+ noout = 1;
+ break;
+ case OPT_OID:
+ oidfile = opt_arg();
+ break;
+ case OPT_OFFSET:
+ offset = strtol(opt_arg(), NULL, 0);
+ break;
+ case OPT_LENGTH:
+ length = atoi(opt_arg());
+ break;
+ case OPT_DUMP:
+ dump = -1;
+ break;
+ case OPT_DLIMIT:
+ dump = atoi(opt_arg());
+ break;
+ case OPT_STRPARSE:
+ sk_OPENSSL_STRING_push(osk, opt_arg());
+ break;
+ case OPT_GENSTR:
+ genstr = opt_arg();
+ break;
+ case OPT_GENCONF:
+ genconf = opt_arg();
+ break;
+ case OPT_STRICTPEM:
+ strictpem = 1;
+ informat = FORMAT_PEM;
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ if (argc != 0)
+ goto opthelp;
+
+ if (oidfile != NULL) {
+ in = bio_open_default(oidfile, 'r', FORMAT_TEXT);
+ if (in == NULL)
+ goto end;
+ OBJ_create_objects(in);
+ BIO_free(in);
+ }
+
+ if ((in = bio_open_default(infile, 'r', informat)) == NULL)
+ goto end;
+
+ if (derfile && (derout = bio_open_default(derfile, 'w', FORMAT_ASN1)) == NULL)
+ goto end;
+
+ if (strictpem) {
+ if (PEM_read_bio(in, &name, &header, &str, &num) !=
+ 1) {
+ BIO_printf(bio_err, "Error reading PEM file\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ } else {
+
+ if ((buf = BUF_MEM_new()) == NULL)
+ goto end;
+ if (!BUF_MEM_grow(buf, BUFSIZ * 8))
+ goto end; /* Pre-allocate :-) */
+
+ if (genstr || genconf) {
+ num = do_generate(genstr, genconf, buf);
+ if (num < 0) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ else {
+
+ if (informat == FORMAT_PEM) {
+ BIO *tmp;
+
+ if ((b64 = BIO_new(BIO_f_base64())) == NULL)
+ goto end;
+ BIO_push(b64, in);
+ tmp = in;
+ in = b64;
+ b64 = tmp;
+ }
+
+ num = 0;
+ for (;;) {
+ if (!BUF_MEM_grow(buf, (int)num + BUFSIZ))
+ goto end;
+ i = BIO_read(in, &(buf->data[num]), BUFSIZ);
+ if (i <= 0)
+ break;
+ num += i;
+ }
+ }
+ str = (unsigned char *)buf->data;
+
+ }
+
+ /* If any structs to parse go through in sequence */
+
+ if (sk_OPENSSL_STRING_num(osk)) {
+ tmpbuf = str;
+ tmplen = num;
+ for (i = 0; i < sk_OPENSSL_STRING_num(osk); i++) {
+ ASN1_TYPE *atmp;
+ int typ;
+ j = atoi(sk_OPENSSL_STRING_value(osk, i));
+ if (j == 0) {
+ BIO_printf(bio_err, "'%s' is an invalid number\n",
+ sk_OPENSSL_STRING_value(osk, i));
+ continue;
+ }
+ tmpbuf += j;
+ tmplen -= j;
+ atmp = at;
+ ctmpbuf = tmpbuf;
+ at = d2i_ASN1_TYPE(NULL, &ctmpbuf, tmplen);
+ ASN1_TYPE_free(atmp);
+ if (!at) {
+ BIO_printf(bio_err, "Error parsing structure\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ typ = ASN1_TYPE_get(at);
+ if ((typ == V_ASN1_OBJECT)
+ || (typ == V_ASN1_BOOLEAN)
+ || (typ == V_ASN1_NULL)) {
+ BIO_printf(bio_err, "Can't parse %s type\n", ASN1_tag2str(typ));
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ /* hmm... this is a little evil but it works */
+ tmpbuf = at->value.asn1_string->data;
+ tmplen = at->value.asn1_string->length;
+ }
+ str = tmpbuf;
+ num = tmplen;
+ }
+
+ if (offset >= num) {
+ BIO_printf(bio_err, "Error: offset too large\n");
+ goto end;
+ }
+
+ num -= offset;
+
+ if ((length == 0) || ((long)length > num))
+ length = (unsigned int)num;
+ if (derout) {
+ if (BIO_write(derout, str + offset, length) != (int)length) {
+ BIO_printf(bio_err, "Error writing output\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+ if (!noout &&
+ !ASN1_parse_dump(bio_out, &(str[offset]), length,
+ indent, dump)) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ ret = 0;
+ end:
+ BIO_free(derout);
+ BIO_free(in);
+ BIO_free(b64);
+ if (ret != 0)
+ ERR_print_errors(bio_err);
+ BUF_MEM_free(buf);
+ OPENSSL_free(name);
+ OPENSSL_free(header);
+ if (strictpem)
+ OPENSSL_free(str);
+ ASN1_TYPE_free(at);
+ sk_OPENSSL_STRING_free(osk);
+ return (ret);
+}
+
+static int do_generate(char *genstr, const char *genconf, BUF_MEM *buf)
+{
+ CONF *cnf = NULL;
+ int len;
+ unsigned char *p;
+ ASN1_TYPE *atyp = NULL;
+
+ if (genconf) {
+ if ((cnf = app_load_config(genconf)) == NULL)
+ goto err;
+ if (!genstr)
+ genstr = NCONF_get_string(cnf, "default", "asn1");
+ if (!genstr) {
+ BIO_printf(bio_err, "Can't find 'asn1' in '%s'\n", genconf);
+ goto err;
+ }
+ }
+
+ atyp = ASN1_generate_nconf(genstr, cnf);
+ NCONF_free(cnf);
+ cnf = NULL;
+
+ if (!atyp)
+ return -1;
+
+ len = i2d_ASN1_TYPE(atyp, NULL);
+
+ if (len <= 0)
+ goto err;
+
+ if (!BUF_MEM_grow(buf, len))
+ goto err;
+
+ p = (unsigned char *)buf->data;
+
+ i2d_ASN1_TYPE(atyp, &p);
+
+ ASN1_TYPE_free(atyp);
+ return len;
+
+ err:
+ NCONF_free(cnf);
+ ASN1_TYPE_free(atyp);
+ return -1;
+}
diff --git a/openssl-1.1.0h/apps/build.info b/openssl-1.1.0h/apps/build.info
new file mode 100644
index 0000000..e2ddd2b
--- /dev/null
+++ b/openssl-1.1.0h/apps/build.info
@@ -0,0 +1,28 @@
+{- our $tsget_name = $config{target} =~ /^(VC|vms)-/ ? "tsget.pl" : "tsget";
+ our @apps_openssl_src =
+ ( qw(openssl.c
+ asn1pars.c ca.c ciphers.c cms.c crl.c crl2p7.c dgst.c dhparam.c
+ dsa.c dsaparam.c ec.c ecparam.c enc.c engine.c errstr.c gendsa.c
+ genpkey.c genrsa.c nseq.c ocsp.c passwd.c pkcs12.c pkcs7.c pkcs8.c
+ pkey.c pkeyparam.c pkeyutl.c prime.c rand.c req.c rsa.c rsautl.c
+ s_client.c s_server.c s_time.c sess_id.c smime.c speed.c spkac.c
+ srp.c ts.c verify.c version.c x509.c rehash.c
+ apps.c opt.c s_cb.c s_socket.c
+ app_rand.c),
+ split(/\s+/, $target{apps_aux_src}) );
+ "" -}
+IF[{- !$disabled{apps} -}]
+ PROGRAMS=openssl
+ SOURCE[openssl]={- join(" ", @apps_openssl_src) -}
+ INCLUDE[openssl]=.. ../include
+ DEPEND[openssl]=../libssl
+
+ {- join("\n ", map { (my $x = $_) =~ s|\.c$|.o|; "DEPEND[$x]=progs.h" }
+ @apps_openssl_src) -}
+ GENERATE[progs.h]=progs.pl $(APPS_OPENSSL)
+ DEPEND[progs.h]=../configdata.pm
+
+ SCRIPTS=CA.pl {- $tsget_name -}
+ SOURCE[CA.pl]=CA.pl.in
+ SOURCE[{- $tsget_name -}]=tsget.in
+ENDIF
diff --git a/openssl-1.1.0h/apps/ca-cert.srl b/openssl-1.1.0h/apps/ca-cert.srl
new file mode 100644
index 0000000..2c7456e
--- /dev/null
+++ b/openssl-1.1.0h/apps/ca-cert.srl
@@ -0,0 +1 @@
+07
diff --git a/openssl-1.1.0h/apps/ca-key.pem b/openssl-1.1.0h/apps/ca-key.pem
new file mode 100644
index 0000000..4e74249
--- /dev/null
+++ b/openssl-1.1.0h/apps/ca-key.pem
@@ -0,0 +1,16 @@
+-----BEGIN PRIVATE KEY-----
+MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAL4tQNyKy4U2zX6l
+IZvORB1edmwMwIgSB4cgoFECrG5pixzYxKauZkAwKG9/+L4DB8qXRjfXWcvafcOU
+DlYpRROykJ7wGkiqmqbZyrxY8DWjk5ZZQXiSuhYOAJB+Fyfb11JZV6+CvBQX/1g+
+vhJr39Gmp6oAesoYrj90ecozClmnAgMBAAECgYA3j6sSg+5f9hnldUMzbPjTh8Sb
+XsJlPrc6UFrmMBzGiUleXSpe9Dbla+x0XvQCN4pwMvAN4nnWp/f0Su5BV/9Y93nb
+im5ijGNrfN9i6QrnqGCr+MMute+4E8HR2pCScX0mBLDDf40SmDvMzCaxtd21keyr
+9DqHgInQZNEi6NKlkQJBAPCbUTFg6iQ6VTCQ8CsEf5q2xHhuTK23fJ999lvWVxN7
+QsvWb9RP9Ng34HVtvB7Pl6P7FyHLQYiDJhhvYR0L0+kCQQDKV/09Kt6Wjf5Omp1I
+wd3A+tFnipdqnPw+qNHGjevv0hYiEIWQOYbx00zXgaX+WN/pzV9eeNN2XAxlNJ++
+dxcPAkBrzeuPKFFAcjKBVC+H1rgl5gYZv7Hzk+buv02G0H6rZ+sB0c7BXiHiTwbv
+Fn/XfkP/YR14Ms3mEH0dLaphjU8hAkEAh3Ar/rRiN04mCcEuRFQXtaNtZSv8PA2G
+Pf7MI2Y9pdHupLCAZlBLRjTUO2/5hu1AO4QPMPIZQSFN3rRBtMCL+wJAMp/m2hvI
+TmtbMp/IrKGfma09e3yFiCmoNn7cHLJ7jLvXcacV2XNzpr9YHfBxiZo0g9FqZKvv
+PZoQ5B2XJ7bhTQ==
+-----END PRIVATE KEY-----
diff --git a/openssl-1.1.0h/apps/ca-req.pem b/openssl-1.1.0h/apps/ca-req.pem
new file mode 100644
index 0000000..84c6dbb
--- /dev/null
+++ b/openssl-1.1.0h/apps/ca-req.pem
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBmzCCAQQCAQAwWzELMAkGA1UEBhMCQVUxEzARBgNVBAgMClF1ZWVuc2xhbmQx
+GjAYBgNVBAoMEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDDBJUZXN0IENBICgx
+MDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL4tQNyKy4U2zX6l
+IZvORB1edmwMwIgSB4cgoFECrG5pixzYxKauZkAwKG9/+L4DB8qXRjfXWcvafcOU
+DlYpRROykJ7wGkiqmqbZyrxY8DWjk5ZZQXiSuhYOAJB+Fyfb11JZV6+CvBQX/1g+
+vhJr39Gmp6oAesoYrj90ecozClmnAgMBAAGgADANBgkqhkiG9w0BAQsFAAOBgQCo
+2jE7J1SNV7kyRm9m8CoPw8xYsuVcVFxPheBymYp8BlO0/rSdYygRjobpYnLVRUPZ
+pV792wzT1Rp4sXfZWO10lkFY4yi0pH2cdK2RX7qedibV1Xu9vt/yYANFBKVpA4dy
+PRyTQwi3In1N8hdfddpYR8f5MIUYRe5poFMIJcf8JA==
+-----END CERTIFICATE REQUEST-----
diff --git a/openssl-1.1.0h/apps/ca.c b/openssl-1.1.0h/apps/ca.c
new file mode 100644
index 0000000..d474a2b
--- /dev/null
+++ b/openssl-1.1.0h/apps/ca.c
@@ -0,0 +1,2593 @@
+/*
+ * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* The PPKI stuff has been donated by Jeff Barber <jeffb@issl.atl.hp.com> */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <openssl/conf.h>
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/bn.h>
+#include <openssl/txt_db.h>
+#include <openssl/evp.h>
+#include <openssl/x509.h>
+#include <openssl/x509v3.h>
+#include <openssl/objects.h>
+#include <openssl/ocsp.h>
+#include <openssl/pem.h>
+
+#ifndef W_OK
+# ifdef OPENSSL_SYS_VMS
+# if defined(__DECC)
+# include <unistd.h>
+# else
+# include <unixlib.h>
+# endif
+# elif !defined(OPENSSL_SYS_VXWORKS) && !defined(OPENSSL_SYS_WINDOWS)
+# include <sys/file.h>
+# endif
+#endif
+
+#include "apps.h"
+
+#ifndef W_OK
+# define F_OK 0
+# define X_OK 1
+# define W_OK 2
+# define R_OK 4
+#endif
+
+#undef BSIZE
+#define BSIZE 256
+
+#define BASE_SECTION "ca"
+
+#define ENV_DEFAULT_CA "default_ca"
+
+#define STRING_MASK "string_mask"
+#define UTF8_IN "utf8"
+
+#define ENV_NEW_CERTS_DIR "new_certs_dir"
+#define ENV_CERTIFICATE "certificate"
+#define ENV_SERIAL "serial"
+#define ENV_CRLNUMBER "crlnumber"
+#define ENV_PRIVATE_KEY "private_key"
+#define ENV_DEFAULT_DAYS "default_days"
+#define ENV_DEFAULT_STARTDATE "default_startdate"
+#define ENV_DEFAULT_ENDDATE "default_enddate"
+#define ENV_DEFAULT_CRL_DAYS "default_crl_days"
+#define ENV_DEFAULT_CRL_HOURS "default_crl_hours"
+#define ENV_DEFAULT_MD "default_md"
+#define ENV_DEFAULT_EMAIL_DN "email_in_dn"
+#define ENV_PRESERVE "preserve"
+#define ENV_POLICY "policy"
+#define ENV_EXTENSIONS "x509_extensions"
+#define ENV_CRLEXT "crl_extensions"
+#define ENV_MSIE_HACK "msie_hack"
+#define ENV_NAMEOPT "name_opt"
+#define ENV_CERTOPT "cert_opt"
+#define ENV_EXTCOPY "copy_extensions"
+#define ENV_UNIQUE_SUBJECT "unique_subject"
+
+#define ENV_DATABASE "database"
+
+/* Additional revocation information types */
+
+#define REV_NONE 0 /* No additional information */
+#define REV_CRL_REASON 1 /* Value is CRL reason code */
+#define REV_HOLD 2 /* Value is hold instruction */
+#define REV_KEY_COMPROMISE 3 /* Value is cert key compromise time */
+#define REV_CA_COMPROMISE 4 /* Value is CA key compromise time */
+
+static char *lookup_conf(const CONF *conf, const char *group, const char *tag);
+
+static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db,
+ BIGNUM *serial, const char *subj, unsigned long chtype,
+ int multirdn, int email_dn, const char *startdate,
+ const char *enddate,
+ long days, int batch, const char *ext_sect, CONF *conf,
+ int verbose, unsigned long certopt, unsigned long nameopt,
+ int default_op, int ext_copy, int selfsign);
+static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db,
+ BIGNUM *serial, const char *subj, unsigned long chtype,
+ int multirdn, int email_dn, const char *startdate,
+ const char *enddate, long days, int batch, const char *ext_sect,
+ CONF *conf, int verbose, unsigned long certopt,
+ unsigned long nameopt, int default_op, int ext_copy);
+static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
+ X509 *x509, const EVP_MD *dgst,
+ STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db,
+ BIGNUM *serial, const char *subj, unsigned long chtype,
+ int multirdn, int email_dn, const char *startdate,
+ const char *enddate, long days, const char *ext_sect, CONF *conf,
+ int verbose, unsigned long certopt,
+ unsigned long nameopt, int default_op, int ext_copy);
+static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext);
+static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,
+ const char *subj, unsigned long chtype, int multirdn,
+ int email_dn, const char *startdate, const char *enddate, long days,
+ int batch, int verbose, X509_REQ *req, const char *ext_sect,
+ CONF *conf, unsigned long certopt, unsigned long nameopt,
+ int default_op, int ext_copy, int selfsign);
+static int do_revoke(X509 *x509, CA_DB *db, int ext, char *extval);
+static int get_certificate_status(const char *ser_status, CA_DB *db);
+static int do_updatedb(CA_DB *db);
+static int check_time_format(const char *str);
+char *make_revocation_str(int rev_type, char *rev_arg);
+int make_revoked(X509_REVOKED *rev, const char *str);
+static int old_entry_print(const ASN1_OBJECT *obj, const ASN1_STRING *str);
+
+static CONF *extconf = NULL;
+static int preserve = 0;
+static int msie_hack = 0;
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_ENGINE, OPT_VERBOSE, OPT_CONFIG, OPT_NAME, OPT_SUBJ, OPT_UTF8,
+ OPT_CREATE_SERIAL, OPT_MULTIVALUE_RDN, OPT_STARTDATE, OPT_ENDDATE,
+ OPT_DAYS, OPT_MD, OPT_POLICY, OPT_KEYFILE, OPT_KEYFORM, OPT_PASSIN,
+ OPT_KEY, OPT_CERT, OPT_SELFSIGN, OPT_IN, OPT_OUT, OPT_OUTDIR,
+ OPT_SIGOPT, OPT_NOTEXT, OPT_BATCH, OPT_PRESERVEDN, OPT_NOEMAILDN,
+ OPT_GENCRL, OPT_MSIE_HACK, OPT_CRLDAYS, OPT_CRLHOURS, OPT_CRLSEC,
+ OPT_INFILES, OPT_SS_CERT, OPT_SPKAC, OPT_REVOKE, OPT_VALID,
+ OPT_EXTENSIONS, OPT_EXTFILE, OPT_STATUS, OPT_UPDATEDB, OPT_CRLEXTS,
+ OPT_CRL_REASON, OPT_CRL_HOLD, OPT_CRL_COMPROMISE,
+ OPT_CRL_CA_COMPROMISE
+} OPTION_CHOICE;
+
+OPTIONS ca_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"verbose", OPT_VERBOSE, '-', "Verbose output during processing"},
+ {"config", OPT_CONFIG, 's', "A config file"},
+ {"name", OPT_NAME, 's', "The particular CA definition to use"},
+ {"subj", OPT_SUBJ, 's', "Use arg instead of request's subject"},
+ {"utf8", OPT_UTF8, '-', "Input characters are UTF8 (default ASCII)"},
+ {"create_serial", OPT_CREATE_SERIAL, '-',
+ "If reading serial fails, create a new random serial"},
+ {"multivalue-rdn", OPT_MULTIVALUE_RDN, '-',
+ "Enable support for multivalued RDNs"},
+ {"startdate", OPT_STARTDATE, 's', "Cert notBefore, YYMMDDHHMMSSZ"},
+ {"enddate", OPT_ENDDATE, 's',
+ "YYMMDDHHMMSSZ cert notAfter (overrides -days)"},
+ {"days", OPT_DAYS, 'p', "Number of days to certify the cert for"},
+ {"md", OPT_MD, 's', "md to use; one of md2, md5, sha or sha1"},
+ {"policy", OPT_POLICY, 's', "The CA 'policy' to support"},
+ {"keyfile", OPT_KEYFILE, 's', "Private key"},
+ {"keyform", OPT_KEYFORM, 'f', "Private key file format (PEM or ENGINE)"},
+ {"passin", OPT_PASSIN, 's', "Input file pass phrase source"},
+ {"key", OPT_KEY, 's', "Key to decode the private key if it is encrypted"},
+ {"cert", OPT_CERT, '<', "The CA cert"},
+ {"selfsign", OPT_SELFSIGN, '-',
+ "Sign a cert with the key associated with it"},
+ {"in", OPT_IN, '<', "The input PEM encoded cert request(s)"},
+ {"out", OPT_OUT, '>', "Where to put the output file(s)"},
+ {"outdir", OPT_OUTDIR, '/', "Where to put output cert"},
+ {"sigopt", OPT_SIGOPT, 's', "Signature parameter in n:v form"},
+ {"notext", OPT_NOTEXT, '-', "Do not print the generated certificate"},
+ {"batch", OPT_BATCH, '-', "Don't ask questions"},
+ {"preserveDN", OPT_PRESERVEDN, '-', "Don't re-order the DN"},
+ {"noemailDN", OPT_NOEMAILDN, '-', "Don't add the EMAIL field to the DN"},
+ {"gencrl", OPT_GENCRL, '-', "Generate a new CRL"},
+ {"msie_hack", OPT_MSIE_HACK, '-',
+ "msie modifications to handle all those universal strings"},
+ {"crldays", OPT_CRLDAYS, 'p', "Days until the next CRL is due"},
+ {"crlhours", OPT_CRLHOURS, 'p', "Hours until the next CRL is due"},
+ {"crlsec", OPT_CRLSEC, 'p', "Seconds until the next CRL is due"},
+ {"infiles", OPT_INFILES, '-', "The last argument, requests to process"},
+ {"ss_cert", OPT_SS_CERT, '<', "File contains a self signed cert to sign"},
+ {"spkac", OPT_SPKAC, '<',
+ "File contains DN and signed public key and challenge"},
+ {"revoke", OPT_REVOKE, '<', "Revoke a cert (given in file)"},
+ {"valid", OPT_VALID, 's',
+ "Add a Valid(not-revoked) DB entry about a cert (given in file)"},
+ {"extensions", OPT_EXTENSIONS, 's',
+ "Extension section (override value in config file)"},
+ {"extfile", OPT_EXTFILE, '<',
+ "Configuration file with X509v3 extensions to add"},
+ {"status", OPT_STATUS, 's', "Shows cert status given the serial number"},
+ {"updatedb", OPT_UPDATEDB, '-', "Updates db for expired cert"},
+ {"crlexts", OPT_CRLEXTS, 's',
+ "CRL extension section (override value in config file)"},
+ {"crl_reason", OPT_CRL_REASON, 's', "revocation reason"},
+ {"crl_hold", OPT_CRL_HOLD, 's',
+ "the hold instruction, an OID. Sets revocation reason to certificateHold"},
+ {"crl_compromise", OPT_CRL_COMPROMISE, 's',
+ "sets compromise time to val and the revocation reason to keyCompromise"},
+ {"crl_CA_compromise", OPT_CRL_CA_COMPROMISE, 's',
+ "sets compromise time to val and the revocation reason to CACompromise"},
+#ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
+#endif
+ {NULL}
+};
+
+int ca_main(int argc, char **argv)
+{
+ CONF *conf = NULL;
+ ENGINE *e = NULL;
+ BIGNUM *crlnumber = NULL, *serial = NULL;
+ EVP_PKEY *pkey = NULL;
+ BIO *in = NULL, *out = NULL, *Sout = NULL;
+ ASN1_INTEGER *tmpser;
+ ASN1_TIME *tmptm;
+ CA_DB *db = NULL;
+ DB_ATTR db_attr;
+ STACK_OF(CONF_VALUE) *attribs = NULL;
+ STACK_OF(OPENSSL_STRING) *sigopts = NULL;
+ STACK_OF(X509) *cert_sk = NULL;
+ X509_CRL *crl = NULL;
+ const EVP_MD *dgst = NULL;
+ char *configfile = default_config_file, *section = NULL;
+ char *md = NULL, *policy = NULL, *keyfile = NULL;
+ char *certfile = NULL, *crl_ext = NULL, *crlnumberfile = NULL, *key = NULL;
+ const char *infile = NULL, *spkac_file = NULL, *ss_cert_file = NULL;
+ const char *extensions = NULL, *extfile = NULL, *passinarg = NULL;
+ char *outdir = NULL, *outfile = NULL, *rev_arg = NULL, *ser_status = NULL;
+ const char *serialfile = NULL, *subj = NULL;
+ char *prog, *startdate = NULL, *enddate = NULL;
+ char *dbfile = NULL, *f, *randfile = NULL;
+ char buf[3][BSIZE];
+ char *const *pp;
+ const char *p;
+ int create_ser = 0, free_key = 0, total = 0, total_done = 0;
+ int batch = 0, default_op = 1, doupdatedb = 0, ext_copy = EXT_COPY_NONE;
+ int keyformat = FORMAT_PEM, multirdn = 0, notext = 0, output_der = 0;
+ int ret = 1, email_dn = 1, req = 0, verbose = 0, gencrl = 0, dorevoke = 0;
+ int i, j, rev_type = REV_NONE, selfsign = 0;
+ long crldays = 0, crlhours = 0, crlsec = 0, days = 0;
+ unsigned long chtype = MBSTRING_ASC, nameopt = 0, certopt = 0;
+ X509 *x509 = NULL, *x509p = NULL, *x = NULL;
+ X509_REVOKED *r = NULL;
+ OPTION_CHOICE o;
+
+ prog = opt_init(argc, argv, ca_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(ca_options);
+ ret = 0;
+ goto end;
+ case OPT_IN:
+ req = 1;
+ infile = opt_arg();
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_VERBOSE:
+ verbose = 1;
+ break;
+ case OPT_CONFIG:
+ configfile = opt_arg();
+ break;
+ case OPT_NAME:
+ section = opt_arg();
+ break;
+ case OPT_SUBJ:
+ subj = opt_arg();
+ /* preserve=1; */
+ break;
+ case OPT_UTF8:
+ chtype = MBSTRING_UTF8;
+ break;
+ case OPT_CREATE_SERIAL:
+ create_ser = 1;
+ break;
+ case OPT_MULTIVALUE_RDN:
+ multirdn = 1;
+ break;
+ case OPT_STARTDATE:
+ startdate = opt_arg();
+ break;
+ case OPT_ENDDATE:
+ enddate = opt_arg();
+ break;
+ case OPT_DAYS:
+ days = atoi(opt_arg());
+ break;
+ case OPT_MD:
+ md = opt_arg();
+ break;
+ case OPT_POLICY:
+ policy = opt_arg();
+ break;
+ case OPT_KEYFILE:
+ keyfile = opt_arg();
+ break;
+ case OPT_KEYFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_ANY, &keyformat))
+ goto opthelp;
+ break;
+ case OPT_PASSIN:
+ passinarg = opt_arg();
+ break;
+ case OPT_KEY:
+ key = opt_arg();
+ break;
+ case OPT_CERT:
+ certfile = opt_arg();
+ break;
+ case OPT_SELFSIGN:
+ selfsign = 1;
+ break;
+ case OPT_OUTDIR:
+ outdir = opt_arg();
+ break;
+ case OPT_SIGOPT:
+ if (sigopts == NULL)
+ sigopts = sk_OPENSSL_STRING_new_null();
+ if (sigopts == NULL
+ || !sk_OPENSSL_STRING_push(sigopts, opt_arg()))
+ goto end;
+ break;
+ case OPT_NOTEXT:
+ notext = 1;
+ break;
+ case OPT_BATCH:
+ batch = 1;
+ break;
+ case OPT_PRESERVEDN:
+ preserve = 1;
+ break;
+ case OPT_NOEMAILDN:
+ email_dn = 0;
+ break;
+ case OPT_GENCRL:
+ gencrl = 1;
+ break;
+ case OPT_MSIE_HACK:
+ msie_hack = 1;
+ break;
+ case OPT_CRLDAYS:
+ crldays = atol(opt_arg());
+ break;
+ case OPT_CRLHOURS:
+ crlhours = atol(opt_arg());
+ break;
+ case OPT_CRLSEC:
+ crlsec = atol(opt_arg());
+ break;
+ case OPT_INFILES:
+ req = 1;
+ goto end_of_options;
+ case OPT_SS_CERT:
+ ss_cert_file = opt_arg();
+ req = 1;
+ break;
+ case OPT_SPKAC:
+ spkac_file = opt_arg();
+ req = 1;
+ break;
+ case OPT_REVOKE:
+ infile = opt_arg();
+ dorevoke = 1;
+ break;
+ case OPT_VALID:
+ infile = opt_arg();
+ dorevoke = 2;
+ break;
+ case OPT_EXTENSIONS:
+ extensions = opt_arg();
+ break;
+ case OPT_EXTFILE:
+ extfile = opt_arg();
+ break;
+ case OPT_STATUS:
+ ser_status = opt_arg();
+ break;
+ case OPT_UPDATEDB:
+ doupdatedb = 1;
+ break;
+ case OPT_CRLEXTS:
+ crl_ext = opt_arg();
+ break;
+ case OPT_CRL_REASON:
+ rev_arg = opt_arg();
+ rev_type = REV_CRL_REASON;
+ break;
+ case OPT_CRL_HOLD:
+ rev_arg = opt_arg();
+ rev_type = REV_HOLD;
+ break;
+ case OPT_CRL_COMPROMISE:
+ rev_arg = opt_arg();
+ rev_type = REV_KEY_COMPROMISE;
+ break;
+ case OPT_CRL_CA_COMPROMISE:
+ rev_arg = opt_arg();
+ rev_type = REV_CA_COMPROMISE;
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ }
+ }
+end_of_options:
+ argc = opt_num_rest();
+ argv = opt_rest();
+
+ BIO_printf(bio_err, "Using configuration from %s\n", configfile);
+
+ if ((conf = app_load_config(configfile)) == NULL)
+ goto end;
+ if (configfile != default_config_file && !app_load_modules(conf))
+ goto end;
+
+ /* Lets get the config section we are using */
+ if (section == NULL
+ && (section = lookup_conf(conf, BASE_SECTION, ENV_DEFAULT_CA)) == NULL)
+ goto end;
+
+ p = NCONF_get_string(conf, NULL, "oid_file");
+ if (p == NULL)
+ ERR_clear_error();
+ if (p != NULL) {
+ BIO *oid_bio = BIO_new_file(p, "r");
+
+ if (oid_bio == NULL) {
+ ERR_clear_error();
+ } else {
+ OBJ_create_objects(oid_bio);
+ BIO_free(oid_bio);
+ }
+ }
+ if (!add_oid_section(conf)) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ randfile = NCONF_get_string(conf, BASE_SECTION, "RANDFILE");
+ if (randfile == NULL)
+ ERR_clear_error();
+ app_RAND_load_file(randfile, 0);
+
+ f = NCONF_get_string(conf, section, STRING_MASK);
+ if (!f)
+ ERR_clear_error();
+
+ if (f && !ASN1_STRING_set_default_mask_asc(f)) {
+ BIO_printf(bio_err, "Invalid global string mask setting %s\n", f);
+ goto end;
+ }
+
+ if (chtype != MBSTRING_UTF8) {
+ f = NCONF_get_string(conf, section, UTF8_IN);
+ if (!f)
+ ERR_clear_error();
+ else if (strcmp(f, "yes") == 0)
+ chtype = MBSTRING_UTF8;
+ }
+
+ db_attr.unique_subject = 1;
+ p = NCONF_get_string(conf, section, ENV_UNIQUE_SUBJECT);
+ if (p) {
+ db_attr.unique_subject = parse_yesno(p, 1);
+ } else
+ ERR_clear_error();
+
+ /*****************************************************************/
+ /* report status of cert with serial number given on command line */
+ if (ser_status) {
+ dbfile = lookup_conf(conf, section, ENV_DATABASE);
+ if (dbfile == NULL)
+ goto end;
+
+ db = load_index(dbfile, &db_attr);
+ if (db == NULL)
+ goto end;
+
+ if (!index_index(db))
+ goto end;
+
+ if (get_certificate_status(ser_status, db) != 1)
+ BIO_printf(bio_err, "Error verifying serial %s!\n", ser_status);
+ goto end;
+ }
+
+ /*****************************************************************/
+ /* we definitely need a private key, so let's get it */
+
+ if (keyfile == NULL
+ && (keyfile = lookup_conf(conf, section, ENV_PRIVATE_KEY)) == NULL)
+ goto end;
+
+ if (!key) {
+ free_key = 1;
+ if (!app_passwd(passinarg, NULL, &key, NULL)) {
+ BIO_printf(bio_err, "Error getting password\n");
+ goto end;
+ }
+ }
+ pkey = load_key(keyfile, keyformat, 0, key, e, "CA private key");
+ if (key)
+ OPENSSL_cleanse(key, strlen(key));
+ if (pkey == NULL) {
+ /* load_key() has already printed an appropriate message */
+ goto end;
+ }
+
+ /*****************************************************************/
+ /* we need a certificate */
+ if (!selfsign || spkac_file || ss_cert_file || gencrl) {
+ if (certfile == NULL
+ && (certfile = lookup_conf(conf, section, ENV_CERTIFICATE)) == NULL)
+ goto end;
+
+ x509 = load_cert(certfile, FORMAT_PEM, "CA certificate");
+ if (x509 == NULL)
+ goto end;
+
+ if (!X509_check_private_key(x509, pkey)) {
+ BIO_printf(bio_err,
+ "CA certificate and CA private key do not match\n");
+ goto end;
+ }
+ }
+ if (!selfsign)
+ x509p = x509;
+
+ f = NCONF_get_string(conf, BASE_SECTION, ENV_PRESERVE);
+ if (f == NULL)
+ ERR_clear_error();
+ if ((f != NULL) && ((*f == 'y') || (*f == 'Y')))
+ preserve = 1;
+ f = NCONF_get_string(conf, BASE_SECTION, ENV_MSIE_HACK);
+ if (f == NULL)
+ ERR_clear_error();
+ if ((f != NULL) && ((*f == 'y') || (*f == 'Y')))
+ msie_hack = 1;
+
+ f = NCONF_get_string(conf, section, ENV_NAMEOPT);
+
+ if (f) {
+ if (!set_name_ex(&nameopt, f)) {
+ BIO_printf(bio_err, "Invalid name options: \"%s\"\n", f);
+ goto end;
+ }
+ default_op = 0;
+ } else {
+ nameopt = XN_FLAG_ONELINE;
+ ERR_clear_error();
+ }
+
+ f = NCONF_get_string(conf, section, ENV_CERTOPT);
+
+ if (f) {
+ if (!set_cert_ex(&certopt, f)) {
+ BIO_printf(bio_err, "Invalid certificate options: \"%s\"\n", f);
+ goto end;
+ }
+ default_op = 0;
+ } else
+ ERR_clear_error();
+
+ f = NCONF_get_string(conf, section, ENV_EXTCOPY);
+
+ if (f) {
+ if (!set_ext_copy(&ext_copy, f)) {
+ BIO_printf(bio_err, "Invalid extension copy option: \"%s\"\n", f);
+ goto end;
+ }
+ } else
+ ERR_clear_error();
+
+ /*****************************************************************/
+ /* lookup where to write new certificates */
+ if ((outdir == NULL) && (req)) {
+
+ outdir = NCONF_get_string(conf, section, ENV_NEW_CERTS_DIR);
+ if (outdir == NULL) {
+ BIO_printf(bio_err,
+ "there needs to be defined a directory for new certificate to be placed in\n");
+ goto end;
+ }
+#ifndef OPENSSL_SYS_VMS
+ /*
+ * outdir is a directory spec, but access() for VMS demands a
+ * filename. We could use the DEC C routine to convert the
+ * directory syntax to Unixly, and give that to app_isdir,
+ * but for now the fopen will catch the error if it's not a
+ * directory
+ */
+ if (app_isdir(outdir) <= 0) {
+ BIO_printf(bio_err, "%s: %s is not a directory\n", prog, outdir);
+ perror(outdir);
+ goto end;
+ }
+#endif
+ }
+
+ /*****************************************************************/
+ /* we need to load the database file */
+ dbfile = lookup_conf(conf, section, ENV_DATABASE);
+ if (dbfile == NULL)
+ goto end;
+
+ db = load_index(dbfile, &db_attr);
+ if (db == NULL)
+ goto end;
+
+ /* Lets check some fields */
+ for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
+ pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
+ if ((pp[DB_type][0] != DB_TYPE_REV) && (pp[DB_rev_date][0] != '\0')) {
+ BIO_printf(bio_err,
+ "entry %d: not revoked yet, but has a revocation date\n",
+ i + 1);
+ goto end;
+ }
+ if ((pp[DB_type][0] == DB_TYPE_REV) &&
+ !make_revoked(NULL, pp[DB_rev_date])) {
+ BIO_printf(bio_err, " in entry %d\n", i + 1);
+ goto end;
+ }
+ if (!check_time_format((char *)pp[DB_exp_date])) {
+ BIO_printf(bio_err, "entry %d: invalid expiry date\n", i + 1);
+ goto end;
+ }
+ p = pp[DB_serial];
+ j = strlen(p);
+ if (*p == '-') {
+ p++;
+ j--;
+ }
+ if ((j & 1) || (j < 2)) {
+ BIO_printf(bio_err, "entry %d: bad serial number length (%d)\n",
+ i + 1, j);
+ goto end;
+ }
+ for ( ; *p; p++) {
+ if (!isxdigit(_UC(*p))) {
+ BIO_printf(bio_err,
+ "entry %d: bad char 0%o '%c' in serial number\n",
+ i + 1, *p, *p);
+ goto end;
+ }
+ }
+ }
+ if (verbose) {
+ TXT_DB_write(bio_out, db->db);
+ BIO_printf(bio_err, "%d entries loaded from the database\n",
+ sk_OPENSSL_PSTRING_num(db->db->data));
+ BIO_printf(bio_err, "generating index\n");
+ }
+
+ if (!index_index(db))
+ goto end;
+
+ /*****************************************************************/
+ /* Update the db file for expired certificates */
+ if (doupdatedb) {
+ if (verbose)
+ BIO_printf(bio_err, "Updating %s ...\n", dbfile);
+
+ i = do_updatedb(db);
+ if (i == -1) {
+ BIO_printf(bio_err, "Malloc failure\n");
+ goto end;
+ } else if (i == 0) {
+ if (verbose)
+ BIO_printf(bio_err, "No entries found to mark expired\n");
+ } else {
+ if (!save_index(dbfile, "new", db))
+ goto end;
+
+ if (!rotate_index(dbfile, "new", "old"))
+ goto end;
+
+ if (verbose)
+ BIO_printf(bio_err,
+ "Done. %d entries marked as expired\n", i);
+ }
+ }
+
+ /*****************************************************************/
+ /* Read extensions config file */
+ if (extfile) {
+ if ((extconf = app_load_config(extfile)) == NULL) {
+ ret = 1;
+ goto end;
+ }
+
+ if (verbose)
+ BIO_printf(bio_err, "Successfully loaded extensions file %s\n",
+ extfile);
+
+ /* We can have sections in the ext file */
+ if (extensions == NULL) {
+ extensions = NCONF_get_string(extconf, "default", "extensions");
+ if (extensions == NULL)
+ extensions = "default";
+ }
+ }
+
+ /*****************************************************************/
+ if (req || gencrl) {
+ /* FIXME: Is it really always text? */
+ Sout = bio_open_default(outfile, 'w', FORMAT_TEXT);
+ if (Sout == NULL)
+ goto end;
+ }
+
+ if (md == NULL
+ && (md = lookup_conf(conf, section, ENV_DEFAULT_MD)) == NULL)
+ goto end;
+
+ if (strcmp(md, "default") == 0) {
+ int def_nid;
+ if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) <= 0) {
+ BIO_puts(bio_err, "no default digest\n");
+ goto end;
+ }
+ md = (char *)OBJ_nid2sn(def_nid);
+ }
+
+ if (!opt_md(md, &dgst)) {
+ goto end;
+ }
+
+ if (req) {
+ if (email_dn == 1) {
+ char *tmp_email_dn = NULL;
+
+ tmp_email_dn = NCONF_get_string(conf, section, ENV_DEFAULT_EMAIL_DN);
+ if (tmp_email_dn != NULL && strcmp(tmp_email_dn, "no") == 0)
+ email_dn = 0;
+ }
+ if (verbose)
+ BIO_printf(bio_err, "message digest is %s\n",
+ OBJ_nid2ln(EVP_MD_type(dgst)));
+ if (policy == NULL
+ && (policy = lookup_conf(conf, section, ENV_POLICY)) == NULL)
+ goto end;
+
+ if (verbose)
+ BIO_printf(bio_err, "policy is %s\n", policy);
+
+ serialfile = lookup_conf(conf, section, ENV_SERIAL);
+ if (serialfile == NULL)
+ goto end;
+
+ if (!extconf) {
+ /*
+ * no '-extfile' option, so we look for extensions in the main
+ * configuration file
+ */
+ if (!extensions) {
+ extensions = NCONF_get_string(conf, section, ENV_EXTENSIONS);
+ if (!extensions)
+ ERR_clear_error();
+ }
+ if (extensions) {
+ /* Check syntax of file */
+ X509V3_CTX ctx;
+ X509V3_set_ctx_test(&ctx);
+ X509V3_set_nconf(&ctx, conf);
+ if (!X509V3_EXT_add_nconf(conf, &ctx, extensions, NULL)) {
+ BIO_printf(bio_err,
+ "Error Loading extension section %s\n",
+ extensions);
+ ret = 1;
+ goto end;
+ }
+ }
+ }
+
+ if (startdate == NULL) {
+ startdate = NCONF_get_string(conf, section,
+ ENV_DEFAULT_STARTDATE);
+ if (startdate == NULL)
+ ERR_clear_error();
+ }
+ if (startdate && !ASN1_TIME_set_string(NULL, startdate)) {
+ BIO_printf(bio_err,
+ "start date is invalid, it should be YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ\n");
+ goto end;
+ }
+ if (startdate == NULL)
+ startdate = "today";
+
+ if (enddate == NULL) {
+ enddate = NCONF_get_string(conf, section, ENV_DEFAULT_ENDDATE);
+ if (enddate == NULL)
+ ERR_clear_error();
+ }
+ if (enddate && !ASN1_TIME_set_string(NULL, enddate)) {
+ BIO_printf(bio_err,
+ "end date is invalid, it should be YYMMDDHHMMSSZ or YYYYMMDDHHMMSSZ\n");
+ goto end;
+ }
+
+ if (days == 0) {
+ if (!NCONF_get_number(conf, section, ENV_DEFAULT_DAYS, &days))
+ days = 0;
+ }
+ if (!enddate && (days == 0)) {
+ BIO_printf(bio_err,
+ "cannot lookup how many days to certify for\n");
+ goto end;
+ }
+
+ if ((serial = load_serial(serialfile, create_ser, NULL)) == NULL) {
+ BIO_printf(bio_err, "error while loading serial number\n");
+ goto end;
+ }
+ if (verbose) {
+ if (BN_is_zero(serial))
+ BIO_printf(bio_err, "next serial number is 00\n");
+ else {
+ if ((f = BN_bn2hex(serial)) == NULL)
+ goto end;
+ BIO_printf(bio_err, "next serial number is %s\n", f);
+ OPENSSL_free(f);
+ }
+ }
+
+ if ((attribs = NCONF_get_section(conf, policy)) == NULL) {
+ BIO_printf(bio_err, "unable to find 'section' for %s\n", policy);
+ goto end;
+ }
+
+ if ((cert_sk = sk_X509_new_null()) == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ if (spkac_file != NULL) {
+ total++;
+ j = certify_spkac(&x, spkac_file, pkey, x509, dgst, sigopts,
+ attribs, db, serial, subj, chtype, multirdn,
+ email_dn, startdate, enddate, days, extensions,
+ conf, verbose, certopt, nameopt, default_op,
+ ext_copy);
+ if (j < 0)
+ goto end;
+ if (j > 0) {
+ total_done++;
+ BIO_printf(bio_err, "\n");
+ if (!BN_add_word(serial, 1))
+ goto end;
+ if (!sk_X509_push(cert_sk, x)) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ if (outfile) {
+ output_der = 1;
+ batch = 1;
+ }
+ }
+ }
+ if (ss_cert_file != NULL) {
+ total++;
+ j = certify_cert(&x, ss_cert_file, pkey, x509, dgst, sigopts,
+ attribs,
+ db, serial, subj, chtype, multirdn, email_dn,
+ startdate, enddate, days, batch, extensions,
+ conf, verbose, certopt, nameopt, default_op,
+ ext_copy);
+ if (j < 0)
+ goto end;
+ if (j > 0) {
+ total_done++;
+ BIO_printf(bio_err, "\n");
+ if (!BN_add_word(serial, 1))
+ goto end;
+ if (!sk_X509_push(cert_sk, x)) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ }
+ }
+ if (infile != NULL) {
+ total++;
+ j = certify(&x, infile, pkey, x509p, dgst, sigopts, attribs, db,
+ serial, subj, chtype, multirdn, email_dn, startdate,
+ enddate, days, batch, extensions, conf, verbose,
+ certopt, nameopt, default_op, ext_copy, selfsign);
+ if (j < 0)
+ goto end;
+ if (j > 0) {
+ total_done++;
+ BIO_printf(bio_err, "\n");
+ if (!BN_add_word(serial, 1))
+ goto end;
+ if (!sk_X509_push(cert_sk, x)) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ }
+ }
+ for (i = 0; i < argc; i++) {
+ total++;
+ j = certify(&x, argv[i], pkey, x509p, dgst, sigopts, attribs, db,
+ serial, subj, chtype, multirdn, email_dn, startdate,
+ enddate, days, batch, extensions, conf, verbose,
+ certopt, nameopt, default_op, ext_copy, selfsign);
+ if (j < 0)
+ goto end;
+ if (j > 0) {
+ total_done++;
+ BIO_printf(bio_err, "\n");
+ if (!BN_add_word(serial, 1))
+ goto end;
+ if (!sk_X509_push(cert_sk, x)) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ }
+ }
+ /*
+ * we have a stack of newly certified certificates and a data base
+ * and serial number that need updating
+ */
+
+ if (sk_X509_num(cert_sk) > 0) {
+ if (!batch) {
+ BIO_printf(bio_err,
+ "\n%d out of %d certificate requests certified, commit? [y/n]",
+ total_done, total);
+ (void)BIO_flush(bio_err);
+ buf[0][0] = '\0';
+ if (!fgets(buf[0], 10, stdin)) {
+ BIO_printf(bio_err,
+ "CERTIFICATION CANCELED: I/O error\n");
+ ret = 0;
+ goto end;
+ }
+ if ((buf[0][0] != 'y') && (buf[0][0] != 'Y')) {
+ BIO_printf(bio_err, "CERTIFICATION CANCELED\n");
+ ret = 0;
+ goto end;
+ }
+ }
+
+ BIO_printf(bio_err, "Write out database with %d new entries\n",
+ sk_X509_num(cert_sk));
+
+ if (!save_serial(serialfile, "new", serial, NULL))
+ goto end;
+
+ if (!save_index(dbfile, "new", db))
+ goto end;
+ }
+
+ if (verbose)
+ BIO_printf(bio_err, "writing new certificates\n");
+ for (i = 0; i < sk_X509_num(cert_sk); i++) {
+ BIO *Cout = NULL;
+ X509 *xi = sk_X509_value(cert_sk, i);
+ ASN1_INTEGER *serialNumber = X509_get_serialNumber(xi);
+ int k;
+ char *n;
+
+ j = ASN1_STRING_length(serialNumber);
+ p = (const char *)ASN1_STRING_get0_data(serialNumber);
+
+ if (strlen(outdir) >= (size_t)(j ? BSIZE - j * 2 - 6 : BSIZE - 8)) {
+ BIO_printf(bio_err, "certificate file name too long\n");
+ goto end;
+ }
+
+ strcpy(buf[2], outdir);
+
+#ifndef OPENSSL_SYS_VMS
+ OPENSSL_strlcat(buf[2], "/", sizeof(buf[2]));
+#endif
+
+ n = (char *)&(buf[2][strlen(buf[2])]);
+ if (j > 0) {
+ for (k = 0; k < j; k++) {
+ if (n >= &(buf[2][sizeof(buf[2])]))
+ break;
+ BIO_snprintf(n,
+ &buf[2][0] + sizeof(buf[2]) - n,
+ "%02X", (unsigned char)*(p++));
+ n += 2;
+ }
+ } else {
+ *(n++) = '0';
+ *(n++) = '0';
+ }
+ *(n++) = '.';
+ *(n++) = 'p';
+ *(n++) = 'e';
+ *(n++) = 'm';
+ *n = '\0';
+ if (verbose)
+ BIO_printf(bio_err, "writing %s\n", buf[2]);
+
+ Cout = BIO_new_file(buf[2], "w");
+ if (Cout == NULL) {
+ perror(buf[2]);
+ goto end;
+ }
+ write_new_certificate(Cout, xi, 0, notext);
+ write_new_certificate(Sout, xi, output_der, notext);
+ BIO_free_all(Cout);
+ }
+
+ if (sk_X509_num(cert_sk)) {
+ /* Rename the database and the serial file */
+ if (!rotate_serial(serialfile, "new", "old"))
+ goto end;
+
+ if (!rotate_index(dbfile, "new", "old"))
+ goto end;
+
+ BIO_printf(bio_err, "Data Base Updated\n");
+ }
+ }
+
+ /*****************************************************************/
+ if (gencrl) {
+ int crl_v2 = 0;
+ if (!crl_ext) {
+ crl_ext = NCONF_get_string(conf, section, ENV_CRLEXT);
+ if (!crl_ext)
+ ERR_clear_error();
+ }
+ if (crl_ext) {
+ /* Check syntax of file */
+ X509V3_CTX ctx;
+ X509V3_set_ctx_test(&ctx);
+ X509V3_set_nconf(&ctx, conf);
+ if (!X509V3_EXT_add_nconf(conf, &ctx, crl_ext, NULL)) {
+ BIO_printf(bio_err,
+ "Error Loading CRL extension section %s\n",
+ crl_ext);
+ ret = 1;
+ goto end;
+ }
+ }
+
+ if ((crlnumberfile = NCONF_get_string(conf, section, ENV_CRLNUMBER))
+ != NULL)
+ if ((crlnumber = load_serial(crlnumberfile, 0, NULL)) == NULL) {
+ BIO_printf(bio_err, "error while loading CRL number\n");
+ goto end;
+ }
+
+ if (!crldays && !crlhours && !crlsec) {
+ if (!NCONF_get_number(conf, section,
+ ENV_DEFAULT_CRL_DAYS, &crldays))
+ crldays = 0;
+ if (!NCONF_get_number(conf, section,
+ ENV_DEFAULT_CRL_HOURS, &crlhours))
+ crlhours = 0;
+ ERR_clear_error();
+ }
+ if ((crldays == 0) && (crlhours == 0) && (crlsec == 0)) {
+ BIO_printf(bio_err,
+ "cannot lookup how long until the next CRL is issued\n");
+ goto end;
+ }
+
+ if (verbose)
+ BIO_printf(bio_err, "making CRL\n");
+ if ((crl = X509_CRL_new()) == NULL)
+ goto end;
+ if (!X509_CRL_set_issuer_name(crl, X509_get_subject_name(x509)))
+ goto end;
+
+ tmptm = ASN1_TIME_new();
+ if (tmptm == NULL
+ || X509_gmtime_adj(tmptm, 0) == NULL
+ || !X509_CRL_set1_lastUpdate(crl, tmptm)
+ || X509_time_adj_ex(tmptm, crldays, crlhours * 60 * 60 + crlsec,
+ NULL) == NULL) {
+ BIO_puts(bio_err, "error setting CRL nextUpdate\n");
+ ASN1_TIME_free(tmptm);
+ goto end;
+ }
+ X509_CRL_set1_nextUpdate(crl, tmptm);
+
+ ASN1_TIME_free(tmptm);
+
+ for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
+ pp = sk_OPENSSL_PSTRING_value(db->db->data, i);
+ if (pp[DB_type][0] == DB_TYPE_REV) {
+ if ((r = X509_REVOKED_new()) == NULL)
+ goto end;
+ j = make_revoked(r, pp[DB_rev_date]);
+ if (!j)
+ goto end;
+ if (j == 2)
+ crl_v2 = 1;
+ if (!BN_hex2bn(&serial, pp[DB_serial]))
+ goto end;
+ tmpser = BN_to_ASN1_INTEGER(serial, NULL);
+ BN_free(serial);
+ serial = NULL;
+ if (!tmpser)
+ goto end;
+ X509_REVOKED_set_serialNumber(r, tmpser);
+ ASN1_INTEGER_free(tmpser);
+ X509_CRL_add0_revoked(crl, r);
+ }
+ }
+
+ /*
+ * sort the data so it will be written in serial number order
+ */
+ X509_CRL_sort(crl);
+
+ /* we now have a CRL */
+ if (verbose)
+ BIO_printf(bio_err, "signing CRL\n");
+
+ /* Add any extensions asked for */
+
+ if (crl_ext || crlnumberfile != NULL) {
+ X509V3_CTX crlctx;
+ X509V3_set_ctx(&crlctx, x509, NULL, NULL, crl, 0);
+ X509V3_set_nconf(&crlctx, conf);
+
+ if (crl_ext)
+ if (!X509V3_EXT_CRL_add_nconf(conf, &crlctx, crl_ext, crl))
+ goto end;
+ if (crlnumberfile != NULL) {
+ tmpser = BN_to_ASN1_INTEGER(crlnumber, NULL);
+ if (!tmpser)
+ goto end;
+ X509_CRL_add1_ext_i2d(crl, NID_crl_number, tmpser, 0, 0);
+ ASN1_INTEGER_free(tmpser);
+ crl_v2 = 1;
+ if (!BN_add_word(crlnumber, 1))
+ goto end;
+ }
+ }
+ if (crl_ext || crl_v2) {
+ if (!X509_CRL_set_version(crl, 1))
+ goto end; /* version 2 CRL */
+ }
+
+ /* we have a CRL number that need updating */
+ if (crlnumberfile != NULL)
+ if (!save_serial(crlnumberfile, "new", crlnumber, NULL))
+ goto end;
+
+ BN_free(crlnumber);
+ crlnumber = NULL;
+
+ if (!do_X509_CRL_sign(crl, pkey, dgst, sigopts))
+ goto end;
+
+ PEM_write_bio_X509_CRL(Sout, crl);
+
+ if (crlnumberfile != NULL) /* Rename the crlnumber file */
+ if (!rotate_serial(crlnumberfile, "new", "old"))
+ goto end;
+
+ }
+ /*****************************************************************/
+ if (dorevoke) {
+ if (infile == NULL) {
+ BIO_printf(bio_err, "no input files\n");
+ goto end;
+ } else {
+ X509 *revcert;
+ revcert = load_cert(infile, FORMAT_PEM, infile);
+ if (revcert == NULL)
+ goto end;
+ if (dorevoke == 2)
+ rev_type = -1;
+ j = do_revoke(revcert, db, rev_type, rev_arg);
+ if (j <= 0)
+ goto end;
+ X509_free(revcert);
+
+ if (!save_index(dbfile, "new", db))
+ goto end;
+
+ if (!rotate_index(dbfile, "new", "old"))
+ goto end;
+
+ BIO_printf(bio_err, "Data Base Updated\n");
+ }
+ }
+ /*****************************************************************/
+ ret = 0;
+ end:
+ BIO_free_all(Sout);
+ BIO_free_all(out);
+ BIO_free_all(in);
+ sk_X509_pop_free(cert_sk, X509_free);
+
+ if (ret)
+ ERR_print_errors(bio_err);
+ app_RAND_write_file(randfile);
+ if (free_key)
+ OPENSSL_free(key);
+ BN_free(serial);
+ BN_free(crlnumber);
+ free_index(db);
+ sk_OPENSSL_STRING_free(sigopts);
+ EVP_PKEY_free(pkey);
+ X509_free(x509);
+ X509_CRL_free(crl);
+ NCONF_free(conf);
+ NCONF_free(extconf);
+ release_engine(e);
+ return (ret);
+}
+
+static char *lookup_conf(const CONF *conf, const char *section, const char *tag)
+{
+ char *entry = NCONF_get_string(conf, section, tag);
+ if (entry == NULL)
+ BIO_printf(bio_err, "variable lookup failed for %s::%s\n", section, tag);
+ return entry;
+}
+
+static int certify(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db,
+ BIGNUM *serial, const char *subj, unsigned long chtype,
+ int multirdn, int email_dn, const char *startdate,
+ const char *enddate,
+ long days, int batch, const char *ext_sect, CONF *lconf,
+ int verbose, unsigned long certopt, unsigned long nameopt,
+ int default_op, int ext_copy, int selfsign)
+{
+ X509_REQ *req = NULL;
+ BIO *in = NULL;
+ EVP_PKEY *pktmp = NULL;
+ int ok = -1, i;
+
+ in = BIO_new_file(infile, "r");
+ if (in == NULL) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ if ((req = PEM_read_bio_X509_REQ(in, NULL, NULL, NULL)) == NULL) {
+ BIO_printf(bio_err, "Error reading certificate request in %s\n",
+ infile);
+ goto end;
+ }
+ if (verbose)
+ X509_REQ_print(bio_err, req);
+
+ BIO_printf(bio_err, "Check that the request matches the signature\n");
+
+ if (selfsign && !X509_REQ_check_private_key(req, pkey)) {
+ BIO_printf(bio_err,
+ "Certificate request and CA private key do not match\n");
+ ok = 0;
+ goto end;
+ }
+ if ((pktmp = X509_REQ_get0_pubkey(req)) == NULL) {
+ BIO_printf(bio_err, "error unpacking public key\n");
+ goto end;
+ }
+ i = X509_REQ_verify(req, pktmp);
+ pktmp = NULL;
+ if (i < 0) {
+ ok = 0;
+ BIO_printf(bio_err, "Signature verification problems....\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ if (i == 0) {
+ ok = 0;
+ BIO_printf(bio_err,
+ "Signature did not match the certificate request\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ } else
+ BIO_printf(bio_err, "Signature ok\n");
+
+ ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
+ chtype, multirdn, email_dn, startdate, enddate, days, batch,
+ verbose, req, ext_sect, lconf, certopt, nameopt, default_op,
+ ext_copy, selfsign);
+
+ end:
+ X509_REQ_free(req);
+ BIO_free(in);
+ return (ok);
+}
+
+static int certify_cert(X509 **xret, const char *infile, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db,
+ BIGNUM *serial, const char *subj, unsigned long chtype,
+ int multirdn, int email_dn, const char *startdate,
+ const char *enddate, long days, int batch, const char *ext_sect,
+ CONF *lconf, int verbose, unsigned long certopt,
+ unsigned long nameopt, int default_op, int ext_copy)
+{
+ X509 *req = NULL;
+ X509_REQ *rreq = NULL;
+ EVP_PKEY *pktmp = NULL;
+ int ok = -1, i;
+
+ if ((req = load_cert(infile, FORMAT_PEM, infile)) == NULL)
+ goto end;
+ if (verbose)
+ X509_print(bio_err, req);
+
+ BIO_printf(bio_err, "Check that the request matches the signature\n");
+
+ if ((pktmp = X509_get0_pubkey(req)) == NULL) {
+ BIO_printf(bio_err, "error unpacking public key\n");
+ goto end;
+ }
+ i = X509_verify(req, pktmp);
+ if (i < 0) {
+ ok = 0;
+ BIO_printf(bio_err, "Signature verification problems....\n");
+ goto end;
+ }
+ if (i == 0) {
+ ok = 0;
+ BIO_printf(bio_err, "Signature did not match the certificate\n");
+ goto end;
+ } else
+ BIO_printf(bio_err, "Signature ok\n");
+
+ if ((rreq = X509_to_X509_REQ(req, NULL, NULL)) == NULL)
+ goto end;
+
+ ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
+ chtype, multirdn, email_dn, startdate, enddate, days, batch,
+ verbose, rreq, ext_sect, lconf, certopt, nameopt, default_op,
+ ext_copy, 0);
+
+ end:
+ X509_REQ_free(rreq);
+ X509_free(req);
+ return (ok);
+}
+
+static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
+ const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,
+ const char *subj, unsigned long chtype, int multirdn,
+ int email_dn, const char *startdate, const char *enddate, long days,
+ int batch, int verbose, X509_REQ *req, const char *ext_sect,
+ CONF *lconf, unsigned long certopt, unsigned long nameopt,
+ int default_op, int ext_copy, int selfsign)
+{
+ X509_NAME *name = NULL, *CAname = NULL, *subject = NULL;
+ const ASN1_TIME *tm;
+ ASN1_STRING *str, *str2;
+ ASN1_OBJECT *obj;
+ X509 *ret = NULL;
+ X509_NAME_ENTRY *ne;
+ X509_NAME_ENTRY *tne, *push;
+ EVP_PKEY *pktmp;
+ int ok = -1, i, j, last, nid;
+ const char *p;
+ CONF_VALUE *cv;
+ OPENSSL_STRING row[DB_NUMBER];
+ OPENSSL_STRING *irow = NULL;
+ OPENSSL_STRING *rrow = NULL;
+ char buf[25];
+
+ for (i = 0; i < DB_NUMBER; i++)
+ row[i] = NULL;
+
+ if (subj) {
+ X509_NAME *n = parse_name(subj, chtype, multirdn);
+
+ if (!n) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ X509_REQ_set_subject_name(req, n);
+ X509_NAME_free(n);
+ }
+
+ if (default_op)
+ BIO_printf(bio_err,
+ "The Subject's Distinguished Name is as follows\n");
+
+ name = X509_REQ_get_subject_name(req);
+ for (i = 0; i < X509_NAME_entry_count(name); i++) {
+ ne = X509_NAME_get_entry(name, i);
+ str = X509_NAME_ENTRY_get_data(ne);
+ obj = X509_NAME_ENTRY_get_object(ne);
+
+ if (msie_hack) {
+ /* assume all type should be strings */
+ nid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(ne));
+
+ if (str->type == V_ASN1_UNIVERSALSTRING)
+ ASN1_UNIVERSALSTRING_to_string(str);
+
+ if ((str->type == V_ASN1_IA5STRING) &&
+ (nid != NID_pkcs9_emailAddress))
+ str->type = V_ASN1_T61STRING;
+
+ if ((nid == NID_pkcs9_emailAddress) &&
+ (str->type == V_ASN1_PRINTABLESTRING))
+ str->type = V_ASN1_IA5STRING;
+ }
+
+ /* If no EMAIL is wanted in the subject */
+ if ((OBJ_obj2nid(obj) == NID_pkcs9_emailAddress) && (!email_dn))
+ continue;
+
+ /* check some things */
+ if ((OBJ_obj2nid(obj) == NID_pkcs9_emailAddress) &&
+ (str->type != V_ASN1_IA5STRING)) {
+ BIO_printf(bio_err,
+ "\nemailAddress type needs to be of type IA5STRING\n");
+ goto end;
+ }
+ if ((str->type != V_ASN1_BMPSTRING)
+ && (str->type != V_ASN1_UTF8STRING)) {
+ j = ASN1_PRINTABLE_type(str->data, str->length);
+ if (((j == V_ASN1_T61STRING) &&
+ (str->type != V_ASN1_T61STRING)) ||
+ ((j == V_ASN1_IA5STRING) &&
+ (str->type == V_ASN1_PRINTABLESTRING))) {
+ BIO_printf(bio_err,
+ "\nThe string contains characters that are illegal for the ASN.1 type\n");
+ goto end;
+ }
+ }
+
+ if (default_op)
+ old_entry_print(obj, str);
+ }
+
+ /* Ok, now we check the 'policy' stuff. */
+ if ((subject = X509_NAME_new()) == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+
+ /* take a copy of the issuer name before we mess with it. */
+ if (selfsign)
+ CAname = X509_NAME_dup(name);
+ else
+ CAname = X509_NAME_dup(X509_get_subject_name(x509));
+ if (CAname == NULL)
+ goto end;
+ str = str2 = NULL;
+
+ for (i = 0; i < sk_CONF_VALUE_num(policy); i++) {
+ cv = sk_CONF_VALUE_value(policy, i); /* get the object id */
+ if ((j = OBJ_txt2nid(cv->name)) == NID_undef) {
+ BIO_printf(bio_err,
+ "%s:unknown object type in 'policy' configuration\n",
+ cv->name);
+ goto end;
+ }
+ obj = OBJ_nid2obj(j);
+
+ last = -1;
+ for (;;) {
+ /* lookup the object in the supplied name list */
+ j = X509_NAME_get_index_by_OBJ(name, obj, last);
+ if (j < 0) {
+ if (last != -1)
+ break;
+ tne = NULL;
+ } else {
+ tne = X509_NAME_get_entry(name, j);
+ }
+ last = j;
+
+ /* depending on the 'policy', decide what to do. */
+ push = NULL;
+ if (strcmp(cv->value, "optional") == 0) {
+ if (tne != NULL)
+ push = tne;
+ } else if (strcmp(cv->value, "supplied") == 0) {
+ if (tne == NULL) {
+ BIO_printf(bio_err,
+ "The %s field needed to be supplied and was missing\n",
+ cv->name);
+ goto end;
+ } else
+ push = tne;
+ } else if (strcmp(cv->value, "match") == 0) {
+ int last2;
+
+ if (tne == NULL) {
+ BIO_printf(bio_err,
+ "The mandatory %s field was missing\n",
+ cv->name);
+ goto end;
+ }
+
+ last2 = -1;
+
+ again2:
+ j = X509_NAME_get_index_by_OBJ(CAname, obj, last2);
+ if ((j < 0) && (last2 == -1)) {
+ BIO_printf(bio_err,
+ "The %s field does not exist in the CA certificate,\n"
+ "the 'policy' is misconfigured\n",
+ cv->name);
+ goto end;
+ }
+ if (j >= 0) {
+ push = X509_NAME_get_entry(CAname, j);
+ str = X509_NAME_ENTRY_get_data(tne);
+ str2 = X509_NAME_ENTRY_get_data(push);
+ last2 = j;
+ if (ASN1_STRING_cmp(str, str2) != 0)
+ goto again2;
+ }
+ if (j < 0) {
+ BIO_printf(bio_err,
+ "The %s field is different between\n"
+ "CA certificate (%s) and the request (%s)\n",
+ cv->name,
+ ((str2 == NULL) ? "NULL" : (char *)str2->data),
+ ((str == NULL) ? "NULL" : (char *)str->data));
+ goto end;
+ }
+ } else {
+ BIO_printf(bio_err,
+ "%s:invalid type in 'policy' configuration\n",
+ cv->value);
+ goto end;
+ }
+
+ if (push != NULL) {
+ if (!X509_NAME_add_entry(subject, push, -1, 0)) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ }
+ if (j < 0)
+ break;
+ }
+ }
+
+ if (preserve) {
+ X509_NAME_free(subject);
+ /* subject=X509_NAME_dup(X509_REQ_get_subject_name(req)); */
+ subject = X509_NAME_dup(name);
+ if (subject == NULL)
+ goto end;
+ }
+
+ /* We are now totally happy, lets make and sign the certificate */
+ if (verbose)
+ BIO_printf(bio_err,
+ "Everything appears to be ok, creating and signing the certificate\n");
+
+ if ((ret = X509_new()) == NULL)
+ goto end;
+
+#ifdef X509_V3
+ /* Make it an X509 v3 certificate. */
+ if (!X509_set_version(ret, 2))
+ goto end;
+#endif
+
+ if (BN_to_ASN1_INTEGER(serial, X509_get_serialNumber(ret)) == NULL)
+ goto end;
+ if (selfsign) {
+ if (!X509_set_issuer_name(ret, subject))
+ goto end;
+ } else {
+ if (!X509_set_issuer_name(ret, X509_get_subject_name(x509)))
+ goto end;
+ }
+
+ if (!set_cert_times(ret, startdate, enddate, days))
+ goto end;
+
+ if (enddate != NULL) {
+ int tdays;
+
+ if (!ASN1_TIME_diff(&tdays, NULL, NULL, X509_get0_notAfter(ret)))
+ goto end;
+ days = tdays;
+ }
+
+ if (!X509_set_subject_name(ret, subject))
+ goto end;
+
+ pktmp = X509_REQ_get0_pubkey(req);
+ i = X509_set_pubkey(ret, pktmp);
+ if (!i)
+ goto end;
+
+ /* Lets add the extensions, if there are any */
+ if (ext_sect) {
+ X509V3_CTX ctx;
+
+ /* Initialize the context structure */
+ if (selfsign)
+ X509V3_set_ctx(&ctx, ret, ret, req, NULL, 0);
+ else
+ X509V3_set_ctx(&ctx, x509, ret, req, NULL, 0);
+
+ if (extconf) {
+ if (verbose)
+ BIO_printf(bio_err, "Extra configuration file found\n");
+
+ /* Use the extconf configuration db LHASH */
+ X509V3_set_nconf(&ctx, extconf);
+
+ /* Test the structure (needed?) */
+ /* X509V3_set_ctx_test(&ctx); */
+
+ /* Adds exts contained in the configuration file */
+ if (!X509V3_EXT_add_nconf(extconf, &ctx, ext_sect, ret)) {
+ BIO_printf(bio_err,
+ "ERROR: adding extensions in section %s\n",
+ ext_sect);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ if (verbose)
+ BIO_printf(bio_err,
+ "Successfully added extensions from file.\n");
+ } else if (ext_sect) {
+ /* We found extensions to be set from config file */
+ X509V3_set_nconf(&ctx, lconf);
+
+ if (!X509V3_EXT_add_nconf(lconf, &ctx, ext_sect, ret)) {
+ BIO_printf(bio_err,
+ "ERROR: adding extensions in section %s\n",
+ ext_sect);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ if (verbose)
+ BIO_printf(bio_err,
+ "Successfully added extensions from config\n");
+ }
+ }
+
+ /* Copy extensions from request (if any) */
+
+ if (!copy_extensions(ret, req, ext_copy)) {
+ BIO_printf(bio_err, "ERROR: adding extensions from request\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ {
+ const STACK_OF(X509_EXTENSION) *exts = X509_get0_extensions(ret);
+
+ if (exts != NULL && sk_X509_EXTENSION_num(exts) > 0)
+ /* Make it an X509 v3 certificate. */
+ if (!X509_set_version(ret, 2))
+ goto end;
+ }
+
+ if (verbose)
+ BIO_printf(bio_err,
+ "The subject name appears to be ok, checking data base for clashes\n");
+
+ /* Build the correct Subject if no e-mail is wanted in the subject. */
+ if (!email_dn) {
+ X509_NAME_ENTRY *tmpne;
+ X509_NAME *dn_subject;
+
+ /*
+ * Its best to dup the subject DN and then delete any email addresses
+ * because this retains its structure.
+ */
+ if ((dn_subject = X509_NAME_dup(subject)) == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ while ((i = X509_NAME_get_index_by_NID(dn_subject,
+ NID_pkcs9_emailAddress,
+ -1)) >= 0) {
+ tmpne = X509_NAME_get_entry(dn_subject, i);
+ X509_NAME_delete_entry(dn_subject, i);
+ X509_NAME_ENTRY_free(tmpne);
+ }
+
+ if (!X509_set_subject_name(ret, dn_subject)) {
+ X509_NAME_free(dn_subject);
+ goto end;
+ }
+ X509_NAME_free(dn_subject);
+ }
+
+ row[DB_name] = X509_NAME_oneline(X509_get_subject_name(ret), NULL, 0);
+ if (row[DB_name] == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+
+ if (BN_is_zero(serial))
+ row[DB_serial] = OPENSSL_strdup("00");
+ else
+ row[DB_serial] = BN_bn2hex(serial);
+ if (row[DB_serial] == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+
+ if (row[DB_name][0] == '\0') {
+ /*
+ * An empty subject! We'll use the serial number instead. If
+ * unique_subject is in use then we don't want different entries with
+ * empty subjects matching each other.
+ */
+ OPENSSL_free(row[DB_name]);
+ row[DB_name] = OPENSSL_strdup(row[DB_serial]);
+ if (row[DB_name] == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ }
+
+ if (db->attributes.unique_subject) {
+ OPENSSL_STRING *crow = row;
+
+ rrow = TXT_DB_get_by_index(db->db, DB_name, crow);
+ if (rrow != NULL) {
+ BIO_printf(bio_err,
+ "ERROR:There is already a certificate for %s\n",
+ row[DB_name]);
+ }
+ }
+ if (rrow == NULL) {
+ rrow = TXT_DB_get_by_index(db->db, DB_serial, row);
+ if (rrow != NULL) {
+ BIO_printf(bio_err,
+ "ERROR:Serial number %s has already been issued,\n",
+ row[DB_serial]);
+ BIO_printf(bio_err,
+ " check the database/serial_file for corruption\n");
+ }
+ }
+
+ if (rrow != NULL) {
+ BIO_printf(bio_err, "The matching entry has the following details\n");
+ if (rrow[DB_type][0] == DB_TYPE_EXP)
+ p = "Expired";
+ else if (rrow[DB_type][0] == DB_TYPE_REV)
+ p = "Revoked";
+ else if (rrow[DB_type][0] == DB_TYPE_VAL)
+ p = "Valid";
+ else
+ p = "\ninvalid type, Data base error\n";
+ BIO_printf(bio_err, "Type :%s\n", p);;
+ if (rrow[DB_type][0] == DB_TYPE_REV) {
+ p = rrow[DB_exp_date];
+ if (p == NULL)
+ p = "undef";
+ BIO_printf(bio_err, "Was revoked on:%s\n", p);
+ }
+ p = rrow[DB_exp_date];
+ if (p == NULL)
+ p = "undef";
+ BIO_printf(bio_err, "Expires on :%s\n", p);
+ p = rrow[DB_serial];
+ if (p == NULL)
+ p = "undef";
+ BIO_printf(bio_err, "Serial Number :%s\n", p);
+ p = rrow[DB_file];
+ if (p == NULL)
+ p = "undef";
+ BIO_printf(bio_err, "File name :%s\n", p);
+ p = rrow[DB_name];
+ if (p == NULL)
+ p = "undef";
+ BIO_printf(bio_err, "Subject Name :%s\n", p);
+ ok = -1; /* This is now a 'bad' error. */
+ goto end;
+ }
+
+ if (!default_op) {
+ BIO_printf(bio_err, "Certificate Details:\n");
+ /*
+ * Never print signature details because signature not present
+ */
+ certopt |= X509_FLAG_NO_SIGDUMP | X509_FLAG_NO_SIGNAME;
+ X509_print_ex(bio_err, ret, nameopt, certopt);
+ }
+
+ BIO_printf(bio_err, "Certificate is to be certified until ");
+ ASN1_TIME_print(bio_err, X509_get0_notAfter(ret));
+ if (days)
+ BIO_printf(bio_err, " (%ld days)", days);
+ BIO_printf(bio_err, "\n");
+
+ if (!batch) {
+
+ BIO_printf(bio_err, "Sign the certificate? [y/n]:");
+ (void)BIO_flush(bio_err);
+ buf[0] = '\0';
+ if (!fgets(buf, sizeof(buf) - 1, stdin)) {
+ BIO_printf(bio_err,
+ "CERTIFICATE WILL NOT BE CERTIFIED: I/O error\n");
+ ok = 0;
+ goto end;
+ }
+ if (!((buf[0] == 'y') || (buf[0] == 'Y'))) {
+ BIO_printf(bio_err, "CERTIFICATE WILL NOT BE CERTIFIED\n");
+ ok = 0;
+ goto end;
+ }
+ }
+
+ pktmp = X509_get0_pubkey(ret);
+ if (EVP_PKEY_missing_parameters(pktmp) &&
+ !EVP_PKEY_missing_parameters(pkey))
+ EVP_PKEY_copy_parameters(pktmp, pkey);
+
+ if (!do_X509_sign(ret, pkey, dgst, sigopts))
+ goto end;
+
+ /* We now just add it to the database */
+ row[DB_type] = OPENSSL_strdup("V");
+ tm = X509_get0_notAfter(ret);
+ row[DB_exp_date] = app_malloc(tm->length + 1, "row expdate");
+ memcpy(row[DB_exp_date], tm->data, tm->length);
+ row[DB_exp_date][tm->length] = '\0';
+ row[DB_rev_date] = NULL;
+ row[DB_file] = OPENSSL_strdup("unknown");
+ if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) ||
+ (row[DB_file] == NULL) || (row[DB_name] == NULL)) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+
+ irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row space");
+ for (i = 0; i < DB_NUMBER; i++)
+ irow[i] = row[i];
+ irow[DB_NUMBER] = NULL;
+
+ if (!TXT_DB_insert(db->db, irow)) {
+ BIO_printf(bio_err, "failed to update database\n");
+ BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
+ goto end;
+ }
+ irow = NULL;
+ ok = 1;
+ end:
+ if (ok != 1) {
+ for (i = 0; i < DB_NUMBER; i++)
+ OPENSSL_free(row[i]);
+ }
+ OPENSSL_free(irow);
+
+ X509_NAME_free(CAname);
+ X509_NAME_free(subject);
+ if (ok <= 0)
+ X509_free(ret);
+ else
+ *xret = ret;
+ return (ok);
+}
+
+static void write_new_certificate(BIO *bp, X509 *x, int output_der,
+ int notext)
+{
+
+ if (output_der) {
+ (void)i2d_X509_bio(bp, x);
+ return;
+ }
+ if (!notext)
+ X509_print(bp, x);
+ PEM_write_bio_X509(bp, x);
+}
+
+static int certify_spkac(X509 **xret, const char *infile, EVP_PKEY *pkey,
+ X509 *x509, const EVP_MD *dgst,
+ STACK_OF(OPENSSL_STRING) *sigopts,
+ STACK_OF(CONF_VALUE) *policy, CA_DB *db,
+ BIGNUM *serial, const char *subj, unsigned long chtype,
+ int multirdn, int email_dn, const char *startdate,
+ const char *enddate, long days, const char *ext_sect,
+ CONF *lconf, int verbose, unsigned long certopt,
+ unsigned long nameopt, int default_op, int ext_copy)
+{
+ STACK_OF(CONF_VALUE) *sk = NULL;
+ LHASH_OF(CONF_VALUE) *parms = NULL;
+ X509_REQ *req = NULL;
+ CONF_VALUE *cv = NULL;
+ NETSCAPE_SPKI *spki = NULL;
+ char *type, *buf;
+ EVP_PKEY *pktmp = NULL;
+ X509_NAME *n = NULL;
+ X509_NAME_ENTRY *ne = NULL;
+ int ok = -1, i, j;
+ long errline;
+ int nid;
+
+ /*
+ * Load input file into a hash table. (This is just an easy
+ * way to read and parse the file, then put it into a convenient
+ * STACK format).
+ */
+ parms = CONF_load(NULL, infile, &errline);
+ if (parms == NULL) {
+ BIO_printf(bio_err, "error on line %ld of %s\n", errline, infile);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ sk = CONF_get_section(parms, "default");
+ if (sk_CONF_VALUE_num(sk) == 0) {
+ BIO_printf(bio_err, "no name/value pairs found in %s\n", infile);
+ goto end;
+ }
+
+ /*
+ * Now create a dummy X509 request structure. We don't actually
+ * have an X509 request, but we have many of the components
+ * (a public key, various DN components). The idea is that we
+ * put these components into the right X509 request structure
+ * and we can use the same code as if you had a real X509 request.
+ */
+ req = X509_REQ_new();
+ if (req == NULL) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ /*
+ * Build up the subject name set.
+ */
+ n = X509_REQ_get_subject_name(req);
+
+ for (i = 0;; i++) {
+ if (sk_CONF_VALUE_num(sk) <= i)
+ break;
+
+ cv = sk_CONF_VALUE_value(sk, i);
+ type = cv->name;
+ /*
+ * Skip past any leading X. X: X, etc to allow for multiple instances
+ */
+ for (buf = cv->name; *buf; buf++)
+ if ((*buf == ':') || (*buf == ',') || (*buf == '.')) {
+ buf++;
+ if (*buf)
+ type = buf;
+ break;
+ }
+
+ buf = cv->value;
+ if ((nid = OBJ_txt2nid(type)) == NID_undef) {
+ if (strcmp(type, "SPKAC") == 0) {
+ spki = NETSCAPE_SPKI_b64_decode(cv->value, -1);
+ if (spki == NULL) {
+ BIO_printf(bio_err,
+ "unable to load Netscape SPKAC structure\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+ continue;
+ }
+
+ if (!X509_NAME_add_entry_by_NID(n, nid, chtype,
+ (unsigned char *)buf, -1, -1, 0))
+ goto end;
+ }
+ if (spki == NULL) {
+ BIO_printf(bio_err, "Netscape SPKAC structure not found in %s\n",
+ infile);
+ goto end;
+ }
+
+ /*
+ * Now extract the key from the SPKI structure.
+ */
+
+ BIO_printf(bio_err,
+ "Check that the SPKAC request matches the signature\n");
+
+ if ((pktmp = NETSCAPE_SPKI_get_pubkey(spki)) == NULL) {
+ BIO_printf(bio_err, "error unpacking SPKAC public key\n");
+ goto end;
+ }
+
+ j = NETSCAPE_SPKI_verify(spki, pktmp);
+ if (j <= 0) {
+ EVP_PKEY_free(pktmp);
+ BIO_printf(bio_err,
+ "signature verification failed on SPKAC public key\n");
+ goto end;
+ }
+ BIO_printf(bio_err, "Signature ok\n");
+
+ X509_REQ_set_pubkey(req, pktmp);
+ EVP_PKEY_free(pktmp);
+ ok = do_body(xret, pkey, x509, dgst, sigopts, policy, db, serial, subj,
+ chtype, multirdn, email_dn, startdate, enddate, days, 1,
+ verbose, req, ext_sect, lconf, certopt, nameopt, default_op,
+ ext_copy, 0);
+ end:
+ X509_REQ_free(req);
+ CONF_free(parms);
+ NETSCAPE_SPKI_free(spki);
+ X509_NAME_ENTRY_free(ne);
+
+ return (ok);
+}
+
+static int check_time_format(const char *str)
+{
+ return ASN1_TIME_set_string(NULL, str);
+}
+
+static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
+{
+ const ASN1_TIME *tm = NULL;
+ char *row[DB_NUMBER], **rrow, **irow;
+ char *rev_str = NULL;
+ BIGNUM *bn = NULL;
+ int ok = -1, i;
+
+ for (i = 0; i < DB_NUMBER; i++)
+ row[i] = NULL;
+ row[DB_name] = X509_NAME_oneline(X509_get_subject_name(x509), NULL, 0);
+ bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(x509), NULL);
+ if (!bn)
+ goto end;
+ if (BN_is_zero(bn))
+ row[DB_serial] = OPENSSL_strdup("00");
+ else
+ row[DB_serial] = BN_bn2hex(bn);
+ BN_free(bn);
+ if (row[DB_name] != NULL && row[DB_name][0] == '\0') {
+ /* Entries with empty Subjects actually use the serial number instead */
+ OPENSSL_free(row[DB_name]);
+ row[DB_name] = OPENSSL_strdup(row[DB_serial]);
+ }
+ if ((row[DB_name] == NULL) || (row[DB_serial] == NULL)) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+ /*
+ * We have to lookup by serial number because name lookup skips revoked
+ * certs
+ */
+ rrow = TXT_DB_get_by_index(db->db, DB_serial, row);
+ if (rrow == NULL) {
+ BIO_printf(bio_err,
+ "Adding Entry with serial number %s to DB for %s\n",
+ row[DB_serial], row[DB_name]);
+
+ /* We now just add it to the database */
+ row[DB_type] = OPENSSL_strdup("V");
+ tm = X509_get0_notAfter(x509);
+ row[DB_exp_date] = app_malloc(tm->length + 1, "row exp_data");
+ memcpy(row[DB_exp_date], tm->data, tm->length);
+ row[DB_exp_date][tm->length] = '\0';
+ row[DB_rev_date] = NULL;
+ row[DB_file] = OPENSSL_strdup("unknown");
+
+ if (row[DB_type] == NULL || row[DB_file] == NULL) {
+ BIO_printf(bio_err, "Memory allocation failure\n");
+ goto end;
+ }
+
+ irow = app_malloc(sizeof(*irow) * (DB_NUMBER + 1), "row ptr");
+ for (i = 0; i < DB_NUMBER; i++)
+ irow[i] = row[i];
+ irow[DB_NUMBER] = NULL;
+
+ if (!TXT_DB_insert(db->db, irow)) {
+ BIO_printf(bio_err, "failed to update database\n");
+ BIO_printf(bio_err, "TXT_DB error number %ld\n", db->db->error);
+ OPENSSL_free(irow);
+ goto end;
+ }
+
+ for (i = 0; i < DB_NUMBER; i++)
+ row[i] = NULL;
+
+ /* Revoke Certificate */
+ if (type == -1)
+ ok = 1;
+ else
+ ok = do_revoke(x509, db, type, value);
+
+ goto end;
+
+ } else if (index_name_cmp_noconst(row, rrow)) {
+ BIO_printf(bio_err, "ERROR:name does not match %s\n", row[DB_name]);
+ goto end;
+ } else if (type == -1) {
+ BIO_printf(bio_err, "ERROR:Already present, serial number %s\n",
+ row[DB_serial]);
+ goto end;
+ } else if (rrow[DB_type][0] == 'R') {
+ BIO_printf(bio_err, "ERROR:Already revoked, serial number %s\n",
+ row[DB_serial]);
+ goto end;
+ } else {
+ BIO_printf(bio_err, "Revoking Certificate %s.\n", rrow[DB_serial]);
+ rev_str = make_revocation_str(type, value);
+ if (!rev_str) {
+ BIO_printf(bio_err, "Error in revocation arguments\n");
+ goto end;
+ }
+ rrow[DB_type][0] = 'R';
+ rrow[DB_type][1] = '\0';
+ rrow[DB_rev_date] = rev_str;
+ }
+ ok = 1;
+ end:
+ for (i = 0; i < DB_NUMBER; i++)
+ OPENSSL_free(row[i]);
+ return (ok);
+}
+
+static int get_certificate_status(const char *serial, CA_DB *db)
+{
+ char *row[DB_NUMBER], **rrow;
+ int ok = -1, i;
+ size_t serial_len = strlen(serial);
+
+ /* Free Resources */
+ for (i = 0; i < DB_NUMBER; i++)
+ row[i] = NULL;
+
+ /* Malloc needed char spaces */
+ row[DB_serial] = app_malloc(serial_len + 2, "row serial#");
+
+ if (serial_len % 2) {
+ /*
+ * Set the first char to 0
+ */ ;
+ row[DB_serial][0] = '0';
+
+ /* Copy String from serial to row[DB_serial] */
+ memcpy(row[DB_serial] + 1, serial, serial_len);
+ row[DB_serial][serial_len + 1] = '\0';
+ } else {
+ /* Copy String from serial to row[DB_serial] */
+ memcpy(row[DB_serial], serial, serial_len);
+ row[DB_serial][serial_len] = '\0';
+ }
+
+ /* Make it Upper Case */
+ for (i = 0; row[DB_serial][i] != '\0'; i++)
+ row[DB_serial][i] = toupper((unsigned char)row[DB_serial][i]);
+
+ ok = 1;
+
+ /* Search for the certificate */
+ rrow = TXT_DB_get_by_index(db->db, DB_serial, row);
+ if (rrow == NULL) {
+ BIO_printf(bio_err, "Serial %s not present in db.\n", row[DB_serial]);
+ ok = -1;
+ goto end;
+ } else if (rrow[DB_type][0] == 'V') {
+ BIO_printf(bio_err, "%s=Valid (%c)\n",
+ row[DB_serial], rrow[DB_type][0]);
+ goto end;
+ } else if (rrow[DB_type][0] == 'R') {
+ BIO_printf(bio_err, "%s=Revoked (%c)\n",
+ row[DB_serial], rrow[DB_type][0]);
+ goto end;
+ } else if (rrow[DB_type][0] == 'E') {
+ BIO_printf(bio_err, "%s=Expired (%c)\n",
+ row[DB_serial], rrow[DB_type][0]);
+ goto end;
+ } else if (rrow[DB_type][0] == 'S') {
+ BIO_printf(bio_err, "%s=Suspended (%c)\n",
+ row[DB_serial], rrow[DB_type][0]);
+ goto end;
+ } else {
+ BIO_printf(bio_err, "%s=Unknown (%c).\n",
+ row[DB_serial], rrow[DB_type][0]);
+ ok = -1;
+ }
+ end:
+ for (i = 0; i < DB_NUMBER; i++) {
+ OPENSSL_free(row[i]);
+ }
+ return (ok);
+}
+
+static int do_updatedb(CA_DB *db)
+{
+ ASN1_UTCTIME *a_tm = NULL;
+ int i, cnt = 0;
+ int db_y2k, a_y2k; /* flags = 1 if y >= 2000 */
+ char **rrow, *a_tm_s;
+
+ a_tm = ASN1_UTCTIME_new();
+ if (a_tm == NULL)
+ return -1;
+
+ /* get actual time and make a string */
+ if (X509_gmtime_adj(a_tm, 0) == NULL) {
+ ASN1_UTCTIME_free(a_tm);
+ return -1;
+ }
+ a_tm_s = app_malloc(a_tm->length + 1, "time string");
+
+ memcpy(a_tm_s, a_tm->data, a_tm->length);
+ a_tm_s[a_tm->length] = '\0';
+
+ if (strncmp(a_tm_s, "49", 2) <= 0)
+ a_y2k = 1;
+ else
+ a_y2k = 0;
+
+ for (i = 0; i < sk_OPENSSL_PSTRING_num(db->db->data); i++) {
+ rrow = sk_OPENSSL_PSTRING_value(db->db->data, i);
+
+ if (rrow[DB_type][0] == 'V') {
+ /* ignore entries that are not valid */
+ if (strncmp(rrow[DB_exp_date], "49", 2) <= 0)
+ db_y2k = 1;
+ else
+ db_y2k = 0;
+
+ if (db_y2k == a_y2k) {
+ /* all on the same y2k side */
+ if (strcmp(rrow[DB_exp_date], a_tm_s) <= 0) {
+ rrow[DB_type][0] = 'E';
+ rrow[DB_type][1] = '\0';
+ cnt++;
+
+ BIO_printf(bio_err, "%s=Expired\n", rrow[DB_serial]);
+ }
+ } else if (db_y2k < a_y2k) {
+ rrow[DB_type][0] = 'E';
+ rrow[DB_type][1] = '\0';
+ cnt++;
+
+ BIO_printf(bio_err, "%s=Expired\n", rrow[DB_serial]);
+ }
+
+ }
+ }
+
+ ASN1_UTCTIME_free(a_tm);
+ OPENSSL_free(a_tm_s);
+ return (cnt);
+}
+
+static const char *crl_reasons[] = {
+ /* CRL reason strings */
+ "unspecified",
+ "keyCompromise",
+ "CACompromise",
+ "affiliationChanged",
+ "superseded",
+ "cessationOfOperation",
+ "certificateHold",
+ "removeFromCRL",
+ /* Additional pseudo reasons */
+ "holdInstruction",
+ "keyTime",
+ "CAkeyTime"
+};
+
+#define NUM_REASONS OSSL_NELEM(crl_reasons)
+
+/*
+ * Given revocation information convert to a DB string. The format of the
+ * string is: revtime[,reason,extra]. Where 'revtime' is the revocation time
+ * (the current time). 'reason' is the optional CRL reason and 'extra' is any
+ * additional argument
+ */
+
+char *make_revocation_str(int rev_type, char *rev_arg)
+{
+ char *str;
+ const char *other = NULL;
+ const char *reason = NULL;
+ ASN1_OBJECT *otmp;
+ ASN1_UTCTIME *revtm = NULL;
+ int i;
+ switch (rev_type) {
+ case REV_NONE:
+ break;
+
+ case REV_CRL_REASON:
+ for (i = 0; i < 8; i++) {
+ if (strcasecmp(rev_arg, crl_reasons[i]) == 0) {
+ reason = crl_reasons[i];
+ break;
+ }
+ }
+ if (reason == NULL) {
+ BIO_printf(bio_err, "Unknown CRL reason %s\n", rev_arg);
+ return NULL;
+ }
+ break;
+
+ case REV_HOLD:
+ /* Argument is an OID */
+
+ otmp = OBJ_txt2obj(rev_arg, 0);
+ ASN1_OBJECT_free(otmp);
+
+ if (otmp == NULL) {
+ BIO_printf(bio_err, "Invalid object identifier %s\n", rev_arg);
+ return NULL;
+ }
+
+ reason = "holdInstruction";
+ other = rev_arg;
+ break;
+
+ case REV_KEY_COMPROMISE:
+ case REV_CA_COMPROMISE:
+
+ /* Argument is the key compromise time */
+ if (!ASN1_GENERALIZEDTIME_set_string(NULL, rev_arg)) {
+ BIO_printf(bio_err,
+ "Invalid time format %s. Need YYYYMMDDHHMMSSZ\n",
+ rev_arg);
+ return NULL;
+ }
+ other = rev_arg;
+ if (rev_type == REV_KEY_COMPROMISE)
+ reason = "keyTime";
+ else
+ reason = "CAkeyTime";
+
+ break;
+
+ }
+
+ revtm = X509_gmtime_adj(NULL, 0);
+
+ if (!revtm)
+ return NULL;
+
+ i = revtm->length + 1;
+
+ if (reason)
+ i += strlen(reason) + 1;
+ if (other)
+ i += strlen(other) + 1;
+
+ str = app_malloc(i, "revocation reason");
+ OPENSSL_strlcpy(str, (char *)revtm->data, i);
+ if (reason) {
+ OPENSSL_strlcat(str, ",", i);
+ OPENSSL_strlcat(str, reason, i);
+ }
+ if (other) {
+ OPENSSL_strlcat(str, ",", i);
+ OPENSSL_strlcat(str, other, i);
+ }
+ ASN1_UTCTIME_free(revtm);
+ return str;
+}
+
+/*-
+ * Convert revocation field to X509_REVOKED entry
+ * return code:
+ * 0 error
+ * 1 OK
+ * 2 OK and some extensions added (i.e. V2 CRL)
+ */
+
+int make_revoked(X509_REVOKED *rev, const char *str)
+{
+ char *tmp = NULL;
+ int reason_code = -1;
+ int i, ret = 0;
+ ASN1_OBJECT *hold = NULL;
+ ASN1_GENERALIZEDTIME *comp_time = NULL;
+ ASN1_ENUMERATED *rtmp = NULL;
+
+ ASN1_TIME *revDate = NULL;
+
+ i = unpack_revinfo(&revDate, &reason_code, &hold, &comp_time, str);
+
+ if (i == 0)
+ goto end;
+
+ if (rev && !X509_REVOKED_set_revocationDate(rev, revDate))
+ goto end;
+
+ if (rev && (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)) {
+ rtmp = ASN1_ENUMERATED_new();
+ if (rtmp == NULL || !ASN1_ENUMERATED_set(rtmp, reason_code))
+ goto end;
+ if (!X509_REVOKED_add1_ext_i2d(rev, NID_crl_reason, rtmp, 0, 0))
+ goto end;
+ }
+
+ if (rev && comp_time) {
+ if (!X509_REVOKED_add1_ext_i2d
+ (rev, NID_invalidity_date, comp_time, 0, 0))
+ goto end;
+ }
+ if (rev && hold) {
+ if (!X509_REVOKED_add1_ext_i2d
+ (rev, NID_hold_instruction_code, hold, 0, 0))
+ goto end;
+ }
+
+ if (reason_code != OCSP_REVOKED_STATUS_NOSTATUS)
+ ret = 2;
+ else
+ ret = 1;
+
+ end:
+
+ OPENSSL_free(tmp);
+ ASN1_OBJECT_free(hold);
+ ASN1_GENERALIZEDTIME_free(comp_time);
+ ASN1_ENUMERATED_free(rtmp);
+ ASN1_TIME_free(revDate);
+
+ return ret;
+}
+
+static int old_entry_print(const ASN1_OBJECT *obj, const ASN1_STRING *str)
+{
+ char buf[25], *pbuf;
+ const char *p;
+ int j;
+
+ j = i2a_ASN1_OBJECT(bio_err, obj);
+ pbuf = buf;
+ for (j = 22 - j; j > 0; j--)
+ *(pbuf++) = ' ';
+ *(pbuf++) = ':';
+ *(pbuf++) = '\0';
+ BIO_puts(bio_err, buf);
+
+ if (str->type == V_ASN1_PRINTABLESTRING)
+ BIO_printf(bio_err, "PRINTABLE:'");
+ else if (str->type == V_ASN1_T61STRING)
+ BIO_printf(bio_err, "T61STRING:'");
+ else if (str->type == V_ASN1_IA5STRING)
+ BIO_printf(bio_err, "IA5STRING:'");
+ else if (str->type == V_ASN1_UNIVERSALSTRING)
+ BIO_printf(bio_err, "UNIVERSALSTRING:'");
+ else
+ BIO_printf(bio_err, "ASN.1 %2d:'", str->type);
+
+ p = (const char *)str->data;
+ for (j = str->length; j > 0; j--) {
+ if ((*p >= ' ') && (*p <= '~'))
+ BIO_printf(bio_err, "%c", *p);
+ else if (*p & 0x80)
+ BIO_printf(bio_err, "\\0x%02X", *p);
+ else if ((unsigned char)*p == 0xf7)
+ BIO_printf(bio_err, "^?");
+ else
+ BIO_printf(bio_err, "^%c", *p + '@');
+ p++;
+ }
+ BIO_printf(bio_err, "'\n");
+ return 1;
+}
+
+int unpack_revinfo(ASN1_TIME **prevtm, int *preason, ASN1_OBJECT **phold,
+ ASN1_GENERALIZEDTIME **pinvtm, const char *str)
+{
+ char *tmp;
+ char *rtime_str, *reason_str = NULL, *arg_str = NULL, *p;
+ int reason_code = -1;
+ int ret = 0;
+ unsigned int i;
+ ASN1_OBJECT *hold = NULL;
+ ASN1_GENERALIZEDTIME *comp_time = NULL;
+
+ tmp = OPENSSL_strdup(str);
+ if (!tmp) {
+ BIO_printf(bio_err, "memory allocation failure\n");
+ goto end;
+ }
+
+ p = strchr(tmp, ',');
+
+ rtime_str = tmp;
+
+ if (p) {
+ *p = '\0';
+ p++;
+ reason_str = p;
+ p = strchr(p, ',');
+ if (p) {
+ *p = '\0';
+ arg_str = p + 1;
+ }
+ }
+
+ if (prevtm) {
+ *prevtm = ASN1_UTCTIME_new();
+ if (*prevtm == NULL) {
+ BIO_printf(bio_err, "memory allocation failure\n");
+ goto end;
+ }
+ if (!ASN1_UTCTIME_set_string(*prevtm, rtime_str)) {
+ BIO_printf(bio_err, "invalid revocation date %s\n", rtime_str);
+ goto end;
+ }
+ }
+ if (reason_str) {
+ for (i = 0; i < NUM_REASONS; i++) {
+ if (strcasecmp(reason_str, crl_reasons[i]) == 0) {
+ reason_code = i;
+ break;
+ }
+ }
+ if (reason_code == OCSP_REVOKED_STATUS_NOSTATUS) {
+ BIO_printf(bio_err, "invalid reason code %s\n", reason_str);
+ goto end;
+ }
+
+ if (reason_code == 7)
+ reason_code = OCSP_REVOKED_STATUS_REMOVEFROMCRL;
+ else if (reason_code == 8) { /* Hold instruction */
+ if (!arg_str) {
+ BIO_printf(bio_err, "missing hold instruction\n");
+ goto end;
+ }
+ reason_code = OCSP_REVOKED_STATUS_CERTIFICATEHOLD;
+ hold = OBJ_txt2obj(arg_str, 0);
+
+ if (!hold) {
+ BIO_printf(bio_err, "invalid object identifier %s\n",
+ arg_str);
+ goto end;
+ }
+ if (phold)
+ *phold = hold;
+ else
+ ASN1_OBJECT_free(hold);
+ } else if ((reason_code == 9) || (reason_code == 10)) {
+ if (!arg_str) {
+ BIO_printf(bio_err, "missing compromised time\n");
+ goto end;
+ }
+ comp_time = ASN1_GENERALIZEDTIME_new();
+ if (comp_time == NULL) {
+ BIO_printf(bio_err, "memory allocation failure\n");
+ goto end;
+ }
+ if (!ASN1_GENERALIZEDTIME_set_string(comp_time, arg_str)) {
+ BIO_printf(bio_err, "invalid compromised time %s\n", arg_str);
+ goto end;
+ }
+ if (reason_code == 9)
+ reason_code = OCSP_REVOKED_STATUS_KEYCOMPROMISE;
+ else
+ reason_code = OCSP_REVOKED_STATUS_CACOMPROMISE;
+ }
+ }
+
+ if (preason)
+ *preason = reason_code;
+ if (pinvtm) {
+ *pinvtm = comp_time;
+ comp_time = NULL;
+ }
+
+ ret = 1;
+
+ end:
+
+ OPENSSL_free(tmp);
+ ASN1_GENERALIZEDTIME_free(comp_time);
+
+ return ret;
+}
diff --git a/openssl-1.1.0h/apps/cert.pem b/openssl-1.1.0h/apps/cert.pem
new file mode 100644
index 0000000..de4a77a
--- /dev/null
+++ b/openssl-1.1.0h/apps/cert.pem
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE-----
+MIIBoDCCAUoCAQAwDQYJKoZIhvcNAQEEBQAwYzELMAkGA1UEBhMCQVUxEzARBgNV
+BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMSMwIQYD
+VQQDExpTZXJ2ZXIgdGVzdCBjZXJ0ICg1MTIgYml0KTAeFw05NzA5MDkwMzQxMjZa
+Fw05NzEwMDkwMzQxMjZaMF4xCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0
+YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFzAVBgNVBAMT
+DkVyaWMgdGhlIFlvdW5nMFEwCQYFKw4DAgwFAANEAAJBALVEqPODnpI4rShlY8S7
+tB713JNvabvn6Gned7zylwLLiXQAo/PAT6mfdWPTyCX9RlId/Aroh1ou893BA32Q
+sggwDQYJKoZIhvcNAQEEBQADQQCU5SSgapJSdRXJoX+CpCvFy+JVh9HpSjCpSNKO
+19raHv98hKAUJuP9HyM+SUsffO6mAIgitUaqW8/wDMePhEC3
+-----END CERTIFICATE-----
diff --git a/openssl-1.1.0h/apps/ciphers.c b/openssl-1.1.0h/apps/ciphers.c
new file mode 100644
index 0000000..e1b5b25
--- /dev/null
+++ b/openssl-1.1.0h/apps/ciphers.c
@@ -0,0 +1,242 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "apps.h"
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_STDNAME,
+ OPT_SSL3,
+ OPT_TLS1,
+ OPT_TLS1_1,
+ OPT_TLS1_2,
+ OPT_PSK,
+ OPT_SRP,
+ OPT_V, OPT_UPPER_V, OPT_S
+} OPTION_CHOICE;
+
+OPTIONS ciphers_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"v", OPT_V, '-', "Verbose listing of the SSL/TLS ciphers"},
+ {"V", OPT_UPPER_V, '-', "Even more verbose"},
+ {"s", OPT_S, '-', "Only supported ciphers"},
+#ifndef OPENSSL_NO_SSL3
+ {"ssl3", OPT_SSL3, '-', "SSL3 mode"},
+#endif
+#ifndef OPENSSL_NO_TLS1
+ {"tls1", OPT_TLS1, '-', "TLS1 mode"},
+#endif
+#ifndef OPENSSL_NO_TLS1_1
+ {"tls1_1", OPT_TLS1_1, '-', "TLS1.1 mode"},
+#endif
+#ifndef OPENSSL_NO_TLS1_2
+ {"tls1_2", OPT_TLS1_2, '-', "TLS1.2 mode"},
+#endif
+#ifndef OPENSSL_NO_SSL_TRACE
+ {"stdname", OPT_STDNAME, '-', "Show standard cipher names"},
+#endif
+#ifndef OPENSSL_NO_PSK
+ {"psk", OPT_PSK, '-', "include ciphersuites requiring PSK"},
+#endif
+#ifndef OPENSSL_NO_SRP
+ {"srp", OPT_SRP, '-', "include ciphersuites requiring SRP"},
+#endif
+ {NULL}
+};
+
+#ifndef OPENSSL_NO_PSK
+static unsigned int dummy_psk(SSL *ssl, const char *hint, char *identity,
+ unsigned int max_identity_len,
+ unsigned char *psk,
+ unsigned int max_psk_len)
+{
+ return 0;
+}
+#endif
+#ifndef OPENSSL_NO_SRP
+static char *dummy_srp(SSL *ssl, void *arg)
+{
+ return "";
+}
+#endif
+
+int ciphers_main(int argc, char **argv)
+{
+ SSL_CTX *ctx = NULL;
+ SSL *ssl = NULL;
+ STACK_OF(SSL_CIPHER) *sk = NULL;
+ const SSL_METHOD *meth = TLS_server_method();
+ int ret = 1, i, verbose = 0, Verbose = 0, use_supported = 0;
+#ifndef OPENSSL_NO_SSL_TRACE
+ int stdname = 0;
+#endif
+#ifndef OPENSSL_NO_PSK
+ int psk = 0;
+#endif
+#ifndef OPENSSL_NO_SRP
+ int srp = 0;
+#endif
+ const char *p;
+ char *ciphers = NULL, *prog;
+ char buf[512];
+ OPTION_CHOICE o;
+ int min_version = 0, max_version = 0;
+
+ prog = opt_init(argc, argv, ciphers_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(ciphers_options);
+ ret = 0;
+ goto end;
+ case OPT_V:
+ verbose = 1;
+ break;
+ case OPT_UPPER_V:
+ verbose = Verbose = 1;
+ break;
+ case OPT_S:
+ use_supported = 1;
+ break;
+ case OPT_STDNAME:
+#ifndef OPENSSL_NO_SSL_TRACE
+ stdname = verbose = 1;
+#endif
+ break;
+ case OPT_SSL3:
+ min_version = SSL3_VERSION;
+ max_version = SSL3_VERSION;
+ break;
+ case OPT_TLS1:
+ min_version = TLS1_VERSION;
+ max_version = TLS1_VERSION;
+ break;
+ case OPT_TLS1_1:
+ min_version = TLS1_1_VERSION;
+ max_version = TLS1_1_VERSION;
+ break;
+ case OPT_TLS1_2:
+ min_version = TLS1_2_VERSION;
+ max_version = TLS1_2_VERSION;
+ break;
+ case OPT_PSK:
+#ifndef OPENSSL_NO_PSK
+ psk = 1;
+#endif
+ break;
+ case OPT_SRP:
+#ifndef OPENSSL_NO_SRP
+ srp = 1;
+#endif
+ break;
+ }
+ }
+ argv = opt_rest();
+ argc = opt_num_rest();
+
+ if (argc == 1)
+ ciphers = *argv;
+ else if (argc != 0)
+ goto opthelp;
+
+ ctx = SSL_CTX_new(meth);
+ if (ctx == NULL)
+ goto err;
+ if (SSL_CTX_set_min_proto_version(ctx, min_version) == 0)
+ goto err;
+ if (SSL_CTX_set_max_proto_version(ctx, max_version) == 0)
+ goto err;
+
+#ifndef OPENSSL_NO_PSK
+ if (psk)
+ SSL_CTX_set_psk_client_callback(ctx, dummy_psk);
+#endif
+#ifndef OPENSSL_NO_SRP
+ if (srp)
+ SSL_CTX_set_srp_client_pwd_callback(ctx, dummy_srp);
+#endif
+ if (ciphers != NULL) {
+ if (!SSL_CTX_set_cipher_list(ctx, ciphers)) {
+ BIO_printf(bio_err, "Error in cipher list\n");
+ goto err;
+ }
+ }
+ ssl = SSL_new(ctx);
+ if (ssl == NULL)
+ goto err;
+
+ if (use_supported)
+ sk = SSL_get1_supported_ciphers(ssl);
+ else
+ sk = SSL_get_ciphers(ssl);
+
+ if (!verbose) {
+ for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
+ const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, i);
+ p = SSL_CIPHER_get_name(c);
+ if (p == NULL)
+ break;
+ if (i != 0)
+ BIO_printf(bio_out, ":");
+ BIO_printf(bio_out, "%s", p);
+ }
+ BIO_printf(bio_out, "\n");
+ } else {
+
+ for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
+ const SSL_CIPHER *c;
+
+ c = sk_SSL_CIPHER_value(sk, i);
+
+ if (Verbose) {
+ unsigned long id = SSL_CIPHER_get_id(c);
+ int id0 = (int)(id >> 24);
+ int id1 = (int)((id >> 16) & 0xffL);
+ int id2 = (int)((id >> 8) & 0xffL);
+ int id3 = (int)(id & 0xffL);
+
+ if ((id & 0xff000000L) == 0x03000000L)
+ BIO_printf(bio_out, " 0x%02X,0x%02X - ", id2, id3); /* SSL3
+ * cipher */
+ else
+ BIO_printf(bio_out, "0x%02X,0x%02X,0x%02X,0x%02X - ", id0, id1, id2, id3); /* whatever */
+ }
+#ifndef OPENSSL_NO_SSL_TRACE
+ if (stdname) {
+ const char *nm = SSL_CIPHER_standard_name(c);
+ if (nm == NULL)
+ nm = "UNKNOWN";
+ BIO_printf(bio_out, "%s - ", nm);
+ }
+#endif
+ BIO_puts(bio_out, SSL_CIPHER_description(c, buf, sizeof(buf)));
+ }
+ }
+
+ ret = 0;
+ goto end;
+ err:
+ ERR_print_errors(bio_err);
+ end:
+ if (use_supported)
+ sk_SSL_CIPHER_free(sk);
+ SSL_CTX_free(ctx);
+ SSL_free(ssl);
+ return (ret);
+}
diff --git a/openssl-1.1.0h/apps/client.pem b/openssl-1.1.0h/apps/client.pem
new file mode 100644
index 0000000..e7a47a7
--- /dev/null
+++ b/openssl-1.1.0h/apps/client.pem
@@ -0,0 +1,52 @@
+subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Client Cert
+issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA
+-----BEGIN CERTIFICATE-----
+MIID5zCCAs+gAwIBAgIJALnu1NlVpZ6yMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
+BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT
+VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt
+ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZDELMAkG
+A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU
+RVNUSU5HIFBVUlBPU0VTIE9OTFkxGTAXBgNVBAMMEFRlc3QgQ2xpZW50IENlcnQw
+ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0ranbHRLcLVqN+0BzcZpY
++yOLqxzDWT1LD9eW1stC4NzXX9/DCtSIVyN7YIHdGLrIPr64IDdXXaMRzgZ2rOKs
+lmHCAiFpO/ja99gGCJRxH0xwQatqAULfJVHeUhs7OEGOZc2nWifjqKvGfNTilP7D
+nwi69ipQFq9oS19FmhwVHk2wg7KZGHI1qDyG04UrfCZMRitvS9+UVhPpIPjuiBi2
+x3/FZIpL5gXJvvFK6xHY63oq2asyzBATntBgnP4qJFWWcvRx24wF1PnZabxuVoL2
+bPnQ/KvONDrw3IdqkKhYNTul7jEcu3OlcZIMw+7DiaKJLAzKb/bBF5gm/pwW6As9
+AgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJYIZI
+AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW
+BBSZHKyLoTh7Mb409Zn/mK1ceSDAjDAfBgNVHSMEGDAWgBQ2w2yI55X+sL3szj49
+hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEAD0mL7PtPYgCEuDyOQSbLpeND5hVS
+curxQdGnrJ6Acrhodb7E9ccATokeb0PLx6HBLQUicxhTZIQ9FbO43YkQcOU6C3BB
+IlwskqmtN6+VmrQzNolHCDzvxNZs9lYL2VbGPGqVRyjZeHpoAlf9cQr8PgDb4d4b
+vUx2KAhHQvV2nkmYvKyXcgnRuHggumF87mkxidriGAEFwH4qfOqetUg64WyxP7P2
+QLipm04SyQa7ONtIApfVXgHcE42Py4/f4arzCzMjKe3VyhGkS7nsT55X/fWgTaRm
+CQPkO+H94P958WTvQDt77bQ+D3IvYaVvfil8n6HJMOJfFT0LJuSUbpSXJg==
+-----END CERTIFICATE-----
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpQIBAAKCAQEAtK2p2x0S3C1ajftAc3GaWPsji6scw1k9Sw/XltbLQuDc11/f
+wwrUiFcje2CB3Ri6yD6+uCA3V12jEc4GdqzirJZhwgIhaTv42vfYBgiUcR9McEGr
+agFC3yVR3lIbOzhBjmXNp1on46irxnzU4pT+w58IuvYqUBavaEtfRZocFR5NsIOy
+mRhyNag8htOFK3wmTEYrb0vflFYT6SD47ogYtsd/xWSKS+YFyb7xSusR2Ot6Ktmr
+MswQE57QYJz+KiRVlnL0cduMBdT52Wm8blaC9mz50PyrzjQ68NyHapCoWDU7pe4x
+HLtzpXGSDMPuw4miiSwMym/2wReYJv6cFugLPQIDAQABAoIBAAZOyc9MhIwLSU4L
+p4RgQvM4UVVe8/Id+3XTZ8NsXExJbWxXfIhiqGjaIfL8u4vsgRjcl+v1s/jo2/iT
+KMab4o4D8gXD7UavQVDjtjb/ta79WL3SjRl2Uc9YjjMkyq6WmDNQeo2NKDdafCTB
+1uzSJtLNipB8Z53ELPuHJhxX9QMHrMnuha49riQgXZ7buP9iQrHJFhImBjSzbxJx
+L+TI6rkyLSf9Wi0Pd3L27Ob3QWNfNRYNSeTE+08eSRChkur5W0RuXAcuAICdQlCl
+LBvWO/LmmvbzCqiDcgy/TliSb6CGGwgiNG7LJZmlkYNj8laGwalNlYZs3UrVv6NO
+Br2loAECgYEA2kvCvPGj0Dg/6g7WhXDvAkEbcaL1tSeCxBbNH+6HS2UWMWvyTtCn
+/bbD519QIdkvayy1QjEf32GV/UjUVmlULMLBcDy0DGjtL3+XpIhLKWDNxN1v1/ai
+1oz23ZJCOgnk6K4qtFtlRS1XtynjA+rBetvYvLP9SKeFrnpzCgaA2r0CgYEA0+KX
+1ACXDTNH5ySX3kMjSS9xdINf+OOw4CvPHFwbtc9aqk2HePlEsBTz5I/W3rKwXva3
+NqZ/bRqVVeZB/hHKFywgdUQk2Uc5z/S7Lw70/w1HubNTXGU06Ngb6zOFAo/o/TwZ
+zTP1BMIKSOB6PAZPS3l+aLO4FRIRotfFhgRHOoECgYEAmiZbqt8cJaJDB/5YYDzC
+mp3tSk6gIb936Q6M5VqkMYp9pIKsxhk0N8aDCnTU+kIK6SzWBpr3/d9Ecmqmfyq7
+5SvWO3KyVf0WWK9KH0abhOm2BKm2HBQvI0DB5u8sUx2/hsvOnjPYDISbZ11t0MtK
+u35Zy89yMYcSsIYJjG/ROCUCgYEAgI2P9G5PNxEP5OtMwOsW84Y3Xat/hPAQFlI+
+HES+AzbFGWJkeT8zL2nm95tVkFP1sggZ7Kxjz3w7cpx7GX0NkbWSE9O+T51pNASV
+tN1sQ3p5M+/a+cnlqgfEGJVvc7iAcXQPa3LEi5h2yPR49QYXAgG6cifn3dDSpmwn
+SUI7PQECgYEApGCIIpSRPLAEHTGmP87RBL1smurhwmy2s/pghkvUkWehtxg0sGHh
+kuaqDWcskogv+QC0sVdytiLSz8G0DwcEcsHK1Fkyb8A+ayiw6jWJDo2m9+IF4Fww
+1Te6jFPYDESnbhq7+TLGgHGhtwcu5cnb4vSuYXGXKupZGzoLOBbv1Zw=
+-----END RSA PRIVATE KEY-----
diff --git a/openssl-1.1.0h/apps/cms.c b/openssl-1.1.0h/apps/cms.c
new file mode 100644
index 0000000..640f92e
--- /dev/null
+++ b/openssl-1.1.0h/apps/cms.c
@@ -0,0 +1,1298 @@
+/*
+ * Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* CMS utility function */
+
+#include <stdio.h>
+#include <string.h>
+#include "apps.h"
+
+#ifndef OPENSSL_NO_CMS
+
+# include <openssl/crypto.h>
+# include <openssl/pem.h>
+# include <openssl/err.h>
+# include <openssl/x509_vfy.h>
+# include <openssl/x509v3.h>
+# include <openssl/cms.h>
+
+static int save_certs(char *signerfile, STACK_OF(X509) *signers);
+static int cms_cb(int ok, X509_STORE_CTX *ctx);
+static void receipt_request_print(CMS_ContentInfo *cms);
+static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING)
+ *rr_to, int rr_allorfirst, STACK_OF(OPENSSL_STRING)
+ *rr_from);
+static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
+ STACK_OF(OPENSSL_STRING) *param);
+
+# define SMIME_OP 0x10
+# define SMIME_IP 0x20
+# define SMIME_SIGNERS 0x40
+# define SMIME_ENCRYPT (1 | SMIME_OP)
+# define SMIME_DECRYPT (2 | SMIME_IP)
+# define SMIME_SIGN (3 | SMIME_OP | SMIME_SIGNERS)
+# define SMIME_VERIFY (4 | SMIME_IP)
+# define SMIME_CMSOUT (5 | SMIME_IP | SMIME_OP)
+# define SMIME_RESIGN (6 | SMIME_IP | SMIME_OP | SMIME_SIGNERS)
+# define SMIME_DATAOUT (7 | SMIME_IP)
+# define SMIME_DATA_CREATE (8 | SMIME_OP)
+# define SMIME_DIGEST_VERIFY (9 | SMIME_IP)
+# define SMIME_DIGEST_CREATE (10 | SMIME_OP)
+# define SMIME_UNCOMPRESS (11 | SMIME_IP)
+# define SMIME_COMPRESS (12 | SMIME_OP)
+# define SMIME_ENCRYPTED_DECRYPT (13 | SMIME_IP)
+# define SMIME_ENCRYPTED_ENCRYPT (14 | SMIME_OP)
+# define SMIME_SIGN_RECEIPT (15 | SMIME_IP | SMIME_OP)
+# define SMIME_VERIFY_RECEIPT (16 | SMIME_IP)
+
+static int verify_err = 0;
+
+typedef struct cms_key_param_st cms_key_param;
+
+struct cms_key_param_st {
+ int idx;
+ STACK_OF(OPENSSL_STRING) *param;
+ cms_key_param *next;
+};
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_ENCRYPT,
+ OPT_DECRYPT, OPT_SIGN, OPT_SIGN_RECEIPT, OPT_RESIGN,
+ OPT_VERIFY, OPT_VERIFY_RETCODE, OPT_VERIFY_RECEIPT,
+ OPT_CMSOUT, OPT_DATA_OUT, OPT_DATA_CREATE, OPT_DIGEST_VERIFY,
+ OPT_DIGEST_CREATE, OPT_COMPRESS, OPT_UNCOMPRESS,
+ OPT_ED_DECRYPT, OPT_ED_ENCRYPT, OPT_DEBUG_DECRYPT, OPT_TEXT,
+ OPT_ASCIICRLF, OPT_NOINTERN, OPT_NOVERIFY, OPT_NOCERTS,
+ OPT_NOATTR, OPT_NODETACH, OPT_NOSMIMECAP, OPT_BINARY, OPT_KEYID,
+ OPT_NOSIGS, OPT_NO_CONTENT_VERIFY, OPT_NO_ATTR_VERIFY, OPT_INDEF,
+ OPT_NOINDEF, OPT_CRLFEOL, OPT_NOOUT, OPT_RR_PRINT,
+ OPT_RR_ALL, OPT_RR_FIRST, OPT_RCTFORM, OPT_CERTFILE, OPT_CAFILE,
+ OPT_CAPATH, OPT_NOCAPATH, OPT_NOCAFILE,OPT_CONTENT, OPT_PRINT,
+ OPT_SECRETKEY, OPT_SECRETKEYID, OPT_PWRI_PASSWORD, OPT_ECONTENT_TYPE,
+ OPT_RAND, OPT_PASSIN, OPT_TO, OPT_FROM, OPT_SUBJECT, OPT_SIGNER, OPT_RECIP,
+ OPT_CERTSOUT, OPT_MD, OPT_INKEY, OPT_KEYFORM, OPT_KEYOPT, OPT_RR_FROM,
+ OPT_RR_TO, OPT_AES128_WRAP, OPT_AES192_WRAP, OPT_AES256_WRAP,
+ OPT_3DES_WRAP, OPT_ENGINE,
+ OPT_V_ENUM,
+ OPT_CIPHER
+} OPTION_CHOICE;
+
+OPTIONS cms_options[] = {
+ {OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"},
+ {OPT_HELP_STR, 1, '-',
+ " cert.pem... recipient certs for encryption\n"},
+ {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"inform", OPT_INFORM, 'c', "Input format SMIME (default), PEM or DER"},
+ {"outform", OPT_OUTFORM, 'c',
+ "Output format SMIME (default), PEM or DER"},
+ {"in", OPT_IN, '<', "Input file"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"encrypt", OPT_ENCRYPT, '-', "Encrypt message"},
+ {"decrypt", OPT_DECRYPT, '-', "Decrypt encrypted message"},
+ {"sign", OPT_SIGN, '-', "Sign message"},
+ {"sign_receipt", OPT_SIGN_RECEIPT, '-', "Generate a signed receipt for the message"},
+ {"resign", OPT_RESIGN, '-', "Resign a signed message"},
+ {"verify", OPT_VERIFY, '-', "Verify signed message"},
+ {"verify_retcode", OPT_VERIFY_RETCODE, '-'},
+ {"verify_receipt", OPT_VERIFY_RECEIPT, '<'},
+ {"cmsout", OPT_CMSOUT, '-', "Output CMS structure"},
+ {"data_out", OPT_DATA_OUT, '-'},
+ {"data_create", OPT_DATA_CREATE, '-'},
+ {"digest_verify", OPT_DIGEST_VERIFY, '-'},
+ {"digest_create", OPT_DIGEST_CREATE, '-'},
+ {"compress", OPT_COMPRESS, '-'},
+ {"uncompress", OPT_UNCOMPRESS, '-'},
+ {"EncryptedData_decrypt", OPT_ED_DECRYPT, '-'},
+ {"EncryptedData_encrypt", OPT_ED_ENCRYPT, '-'},
+ {"debug_decrypt", OPT_DEBUG_DECRYPT, '-'},
+ {"text", OPT_TEXT, '-', "Include or delete text MIME headers"},
+ {"asciicrlf", OPT_ASCIICRLF, '-'},
+ {"nointern", OPT_NOINTERN, '-',
+ "Don't search certificates in message for signer"},
+ {"noverify", OPT_NOVERIFY, '-', "Don't verify signers certificate"},
+ {"nocerts", OPT_NOCERTS, '-',
+ "Don't include signers certificate when signing"},
+ {"noattr", OPT_NOATTR, '-', "Don't include any signed attributes"},
+ {"nodetach", OPT_NODETACH, '-', "Use opaque signing"},
+ {"nosmimecap", OPT_NOSMIMECAP, '-', "Omit the SMIMECapabilities attribute"},
+ {"binary", OPT_BINARY, '-', "Don't translate message to text"},
+ {"keyid", OPT_KEYID, '-', "Use subject key identifier"},
+ {"nosigs", OPT_NOSIGS, '-', "Don't verify message signature"},
+ {"no_content_verify", OPT_NO_CONTENT_VERIFY, '-'},
+ {"no_attr_verify", OPT_NO_ATTR_VERIFY, '-'},
+ {"stream", OPT_INDEF, '-', "Enable CMS streaming"},
+ {"indef", OPT_INDEF, '-', "Same as -stream"},
+ {"noindef", OPT_NOINDEF, '-', "Disable CMS streaming"},
+ {"crlfeol", OPT_CRLFEOL, '-', "Use CRLF as EOL termination instead of CR only" },
+ {"noout", OPT_NOOUT, '-', "For the -cmsout operation do not output the parsed CMS structure"},
+ {"receipt_request_print", OPT_RR_PRINT, '-', "Print CMS Receipt Request" },
+ {"receipt_request_all", OPT_RR_ALL, '-'},
+ {"receipt_request_first", OPT_RR_FIRST, '-'},
+ {"rctform", OPT_RCTFORM, 'F', "Receipt file format"},
+ {"certfile", OPT_CERTFILE, '<', "Other certificates file"},
+ {"CAfile", OPT_CAFILE, '<', "Trusted certificates file"},
+ {"CApath", OPT_CAPATH, '/', "trusted certificates directory"},
+ {"no-CAfile", OPT_NOCAFILE, '-',
+ "Do not load the default certificates file"},
+ {"no-CApath", OPT_NOCAPATH, '-',
+ "Do not load certificates from the default certificates directory"},
+ {"content", OPT_CONTENT, '<',
+ "Supply or override content for detached signature"},
+ {"print", OPT_PRINT, '-',
+ "For the -cmsout operation print out all fields of the CMS structure"},
+ {"secretkey", OPT_SECRETKEY, 's'},
+ {"secretkeyid", OPT_SECRETKEYID, 's'},
+ {"pwri_password", OPT_PWRI_PASSWORD, 's'},
+ {"econtent_type", OPT_ECONTENT_TYPE, 's'},
+ {"rand", OPT_RAND, 's',
+ "Load the file(s) into the random number generator"},
+ {"passin", OPT_PASSIN, 's', "Input file pass phrase source"},
+ {"to", OPT_TO, 's', "To address"},
+ {"from", OPT_FROM, 's', "From address"},
+ {"subject", OPT_SUBJECT, 's', "Subject"},
+ {"signer", OPT_SIGNER, 's', "Signer certificate file"},
+ {"recip", OPT_RECIP, '<', "Recipient cert file for decryption"},
+ {"certsout", OPT_CERTSOUT, '>', "Certificate output file"},
+ {"md", OPT_MD, 's', "Digest algorithm to use when signing or resigning"},
+ {"inkey", OPT_INKEY, 's',
+ "Input private key (if not signer or recipient)"},
+ {"keyform", OPT_KEYFORM, 'f', "Input private key format (PEM or ENGINE)"},
+ {"keyopt", OPT_KEYOPT, 's', "Set public key parameters as n:v pairs"},
+ {"receipt_request_from", OPT_RR_FROM, 's'},
+ {"receipt_request_to", OPT_RR_TO, 's'},
+ {"", OPT_CIPHER, '-', "Any supported cipher"},
+ OPT_V_OPTIONS,
+ {"aes128-wrap", OPT_AES128_WRAP, '-', "Use AES128 to wrap key"},
+ {"aes192-wrap", OPT_AES192_WRAP, '-', "Use AES192 to wrap key"},
+ {"aes256-wrap", OPT_AES256_WRAP, '-', "Use AES256 to wrap key"},
+# ifndef OPENSSL_NO_DES
+ {"des3-wrap", OPT_3DES_WRAP, '-', "Use 3DES-EDE to wrap key"},
+# endif
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
+# endif
+ {NULL}
+};
+
+int cms_main(int argc, char **argv)
+{
+ ASN1_OBJECT *econtent_type = NULL;
+ BIO *in = NULL, *out = NULL, *indata = NULL, *rctin = NULL;
+ CMS_ContentInfo *cms = NULL, *rcms = NULL;
+ CMS_ReceiptRequest *rr = NULL;
+ ENGINE *e = NULL;
+ EVP_PKEY *key = NULL;
+ const EVP_CIPHER *cipher = NULL, *wrap_cipher = NULL;
+ const EVP_MD *sign_md = NULL;
+ STACK_OF(OPENSSL_STRING) *rr_to = NULL, *rr_from = NULL;
+ STACK_OF(OPENSSL_STRING) *sksigners = NULL, *skkeys = NULL;
+ STACK_OF(X509) *encerts = NULL, *other = NULL;
+ X509 *cert = NULL, *recip = NULL, *signer = NULL;
+ X509_STORE *store = NULL;
+ X509_VERIFY_PARAM *vpm = NULL;
+ char *certfile = NULL, *keyfile = NULL, *contfile = NULL;
+ const char *CAfile = NULL, *CApath = NULL;
+ char *certsoutfile = NULL;
+ int noCAfile = 0, noCApath = 0;
+ char *infile = NULL, *outfile = NULL, *rctfile = NULL, *inrand = NULL;
+ char *passinarg = NULL, *passin = NULL, *signerfile = NULL, *recipfile =
+ NULL;
+ char *to = NULL, *from = NULL, *subject = NULL, *prog;
+ cms_key_param *key_first = NULL, *key_param = NULL;
+ int flags = CMS_DETACHED, noout = 0, print = 0, keyidx = -1, vpmtouched =
+ 0;
+ int informat = FORMAT_SMIME, outformat = FORMAT_SMIME;
+ int need_rand = 0, operation = 0, ret = 1, rr_print = 0, rr_allorfirst =
+ -1;
+ int verify_retcode = 0, rctformat = FORMAT_SMIME, keyform = FORMAT_PEM;
+ size_t secret_keylen = 0, secret_keyidlen = 0;
+ unsigned char *pwri_pass = NULL, *pwri_tmp = NULL;
+ unsigned char *secret_key = NULL, *secret_keyid = NULL;
+ long ltmp;
+ const char *mime_eol = "\n";
+ OPTION_CHOICE o;
+
+ if ((vpm = X509_VERIFY_PARAM_new()) == NULL)
+ return 1;
+
+ prog = opt_init(argc, argv, cms_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(cms_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PDS, &informat))
+ goto opthelp;
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PDS, &outformat))
+ goto opthelp;
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_ENCRYPT:
+ operation = SMIME_ENCRYPT;
+ break;
+ case OPT_DECRYPT:
+ operation = SMIME_DECRYPT;
+ break;
+ case OPT_SIGN:
+ operation = SMIME_SIGN;
+ break;
+ case OPT_SIGN_RECEIPT:
+ operation = SMIME_SIGN_RECEIPT;
+ break;
+ case OPT_RESIGN:
+ operation = SMIME_RESIGN;
+ break;
+ case OPT_VERIFY:
+ operation = SMIME_VERIFY;
+ break;
+ case OPT_VERIFY_RETCODE:
+ verify_retcode = 1;
+ break;
+ case OPT_VERIFY_RECEIPT:
+ operation = SMIME_VERIFY_RECEIPT;
+ rctfile = opt_arg();
+ break;
+ case OPT_CMSOUT:
+ operation = SMIME_CMSOUT;
+ break;
+ case OPT_DATA_OUT:
+ operation = SMIME_DATAOUT;
+ break;
+ case OPT_DATA_CREATE:
+ operation = SMIME_DATA_CREATE;
+ break;
+ case OPT_DIGEST_VERIFY:
+ operation = SMIME_DIGEST_VERIFY;
+ break;
+ case OPT_DIGEST_CREATE:
+ operation = SMIME_DIGEST_CREATE;
+ break;
+ case OPT_COMPRESS:
+ operation = SMIME_COMPRESS;
+ break;
+ case OPT_UNCOMPRESS:
+ operation = SMIME_UNCOMPRESS;
+ break;
+ case OPT_ED_DECRYPT:
+ operation = SMIME_ENCRYPTED_DECRYPT;
+ break;
+ case OPT_ED_ENCRYPT:
+ operation = SMIME_ENCRYPTED_ENCRYPT;
+ break;
+ case OPT_DEBUG_DECRYPT:
+ flags |= CMS_DEBUG_DECRYPT;
+ break;
+ case OPT_TEXT:
+ flags |= CMS_TEXT;
+ break;
+ case OPT_ASCIICRLF:
+ flags |= CMS_ASCIICRLF;
+ break;
+ case OPT_NOINTERN:
+ flags |= CMS_NOINTERN;
+ break;
+ case OPT_NOVERIFY:
+ flags |= CMS_NO_SIGNER_CERT_VERIFY;
+ break;
+ case OPT_NOCERTS:
+ flags |= CMS_NOCERTS;
+ break;
+ case OPT_NOATTR:
+ flags |= CMS_NOATTR;
+ break;
+ case OPT_NODETACH:
+ flags &= ~CMS_DETACHED;
+ break;
+ case OPT_NOSMIMECAP:
+ flags |= CMS_NOSMIMECAP;
+ break;
+ case OPT_BINARY:
+ flags |= CMS_BINARY;
+ break;
+ case OPT_KEYID:
+ flags |= CMS_USE_KEYID;
+ break;
+ case OPT_NOSIGS:
+ flags |= CMS_NOSIGS;
+ break;
+ case OPT_NO_CONTENT_VERIFY:
+ flags |= CMS_NO_CONTENT_VERIFY;
+ break;
+ case OPT_NO_ATTR_VERIFY:
+ flags |= CMS_NO_ATTR_VERIFY;
+ break;
+ case OPT_INDEF:
+ flags |= CMS_STREAM;
+ break;
+ case OPT_NOINDEF:
+ flags &= ~CMS_STREAM;
+ break;
+ case OPT_CRLFEOL:
+ mime_eol = "\r\n";
+ flags |= CMS_CRLFEOL;
+ break;
+ case OPT_NOOUT:
+ noout = 1;
+ break;
+ case OPT_RR_PRINT:
+ rr_print = 1;
+ break;
+ case OPT_RR_ALL:
+ rr_allorfirst = 0;
+ break;
+ case OPT_RR_FIRST:
+ rr_allorfirst = 1;
+ break;
+ case OPT_RCTFORM:
+ if (rctformat == FORMAT_SMIME)
+ rcms = SMIME_read_CMS(rctin, NULL);
+ else if (rctformat == FORMAT_PEM)
+ rcms = PEM_read_bio_CMS(rctin, NULL, NULL, NULL);
+ else if (rctformat == FORMAT_ASN1)
+ if (!opt_format(opt_arg(),
+ OPT_FMT_PEMDER | OPT_FMT_SMIME, &rctformat))
+ goto opthelp;
+ break;
+ case OPT_CERTFILE:
+ certfile = opt_arg();
+ break;
+ case OPT_CAFILE:
+ CAfile = opt_arg();
+ break;
+ case OPT_CAPATH:
+ CApath = opt_arg();
+ break;
+ case OPT_NOCAFILE:
+ noCAfile = 1;
+ break;
+ case OPT_NOCAPATH:
+ noCApath = 1;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_CONTENT:
+ contfile = opt_arg();
+ break;
+ case OPT_RR_FROM:
+ if (rr_from == NULL
+ && (rr_from = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ sk_OPENSSL_STRING_push(rr_from, opt_arg());
+ break;
+ case OPT_RR_TO:
+ if (rr_to == NULL
+ && (rr_to = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ sk_OPENSSL_STRING_push(rr_to, opt_arg());
+ break;
+ case OPT_PRINT:
+ noout = print = 1;
+ break;
+ case OPT_SECRETKEY:
+ if (secret_key != NULL) {
+ BIO_printf(bio_err, "Invalid key (supplied twice) %s\n",
+ opt_arg());
+ goto opthelp;
+ }
+ secret_key = OPENSSL_hexstr2buf(opt_arg(), &ltmp);
+ if (secret_key == NULL) {
+ BIO_printf(bio_err, "Invalid key %s\n", opt_arg());
+ goto end;
+ }
+ secret_keylen = (size_t)ltmp;
+ break;
+ case OPT_SECRETKEYID:
+ if (secret_keyid != NULL) {
+ BIO_printf(bio_err, "Invalid id (supplied twice) %s\n",
+ opt_arg());
+ goto opthelp;
+ }
+ secret_keyid = OPENSSL_hexstr2buf(opt_arg(), &ltmp);
+ if (secret_keyid == NULL) {
+ BIO_printf(bio_err, "Invalid id %s\n", opt_arg());
+ goto opthelp;
+ }
+ secret_keyidlen = (size_t)ltmp;
+ break;
+ case OPT_PWRI_PASSWORD:
+ pwri_pass = (unsigned char *)opt_arg();
+ break;
+ case OPT_ECONTENT_TYPE:
+ if (econtent_type != NULL) {
+ BIO_printf(bio_err, "Invalid OID (supplied twice) %s\n",
+ opt_arg());
+ goto opthelp;
+ }
+ econtent_type = OBJ_txt2obj(opt_arg(), 0);
+ if (econtent_type == NULL) {
+ BIO_printf(bio_err, "Invalid OID %s\n", opt_arg());
+ goto opthelp;
+ }
+ break;
+ case OPT_RAND:
+ inrand = opt_arg();
+ need_rand = 1;
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_PASSIN:
+ passinarg = opt_arg();
+ break;
+ case OPT_TO:
+ to = opt_arg();
+ break;
+ case OPT_FROM:
+ from = opt_arg();
+ break;
+ case OPT_SUBJECT:
+ subject = opt_arg();
+ break;
+ case OPT_CERTSOUT:
+ certsoutfile = opt_arg();
+ break;
+ case OPT_MD:
+ if (!opt_md(opt_arg(), &sign_md))
+ goto end;
+ break;
+ case OPT_SIGNER:
+ /* If previous -signer argument add signer to list */
+ if (signerfile) {
+ if (sksigners == NULL
+ && (sksigners = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ sk_OPENSSL_STRING_push(sksigners, signerfile);
+ if (keyfile == NULL)
+ keyfile = signerfile;
+ if (skkeys == NULL
+ && (skkeys = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ sk_OPENSSL_STRING_push(skkeys, keyfile);
+ keyfile = NULL;
+ }
+ signerfile = opt_arg();
+ break;
+ case OPT_INKEY:
+ /* If previous -inkey argument add signer to list */
+ if (keyfile) {
+ if (signerfile == NULL) {
+ BIO_puts(bio_err, "Illegal -inkey without -signer\n");
+ goto end;
+ }
+ if (sksigners == NULL
+ && (sksigners = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ sk_OPENSSL_STRING_push(sksigners, signerfile);
+ signerfile = NULL;
+ if (skkeys == NULL
+ && (skkeys = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ sk_OPENSSL_STRING_push(skkeys, keyfile);
+ }
+ keyfile = opt_arg();
+ break;
+ case OPT_KEYFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_ANY, &keyform))
+ goto opthelp;
+ break;
+ case OPT_RECIP:
+ if (operation == SMIME_ENCRYPT) {
+ if (encerts == NULL && (encerts = sk_X509_new_null()) == NULL)
+ goto end;
+ cert = load_cert(opt_arg(), FORMAT_PEM,
+ "recipient certificate file");
+ if (cert == NULL)
+ goto end;
+ sk_X509_push(encerts, cert);
+ cert = NULL;
+ } else
+ recipfile = opt_arg();
+ break;
+ case OPT_CIPHER:
+ if (!opt_cipher(opt_unknown(), &cipher))
+ goto end;
+ break;
+ case OPT_KEYOPT:
+ keyidx = -1;
+ if (operation == SMIME_ENCRYPT) {
+ if (encerts)
+ keyidx += sk_X509_num(encerts);
+ } else {
+ if (keyfile || signerfile)
+ keyidx++;
+ if (skkeys)
+ keyidx += sk_OPENSSL_STRING_num(skkeys);
+ }
+ if (keyidx < 0) {
+ BIO_printf(bio_err, "No key specified\n");
+ goto opthelp;
+ }
+ if (key_param == NULL || key_param->idx != keyidx) {
+ cms_key_param *nparam;
+ nparam = app_malloc(sizeof(*nparam), "key param buffer");
+ nparam->idx = keyidx;
+ if ((nparam->param = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ nparam->next = NULL;
+ if (key_first == NULL)
+ key_first = nparam;
+ else
+ key_param->next = nparam;
+ key_param = nparam;
+ }
+ sk_OPENSSL_STRING_push(key_param->param, opt_arg());
+ break;
+ case OPT_V_CASES:
+ if (!opt_verify(o, vpm))
+ goto end;
+ vpmtouched++;
+ break;
+ case OPT_3DES_WRAP:
+# ifndef OPENSSL_NO_DES
+ wrap_cipher = EVP_des_ede3_wrap();
+# endif
+ break;
+ case OPT_AES128_WRAP:
+ wrap_cipher = EVP_aes_128_wrap();
+ break;
+ case OPT_AES192_WRAP:
+ wrap_cipher = EVP_aes_192_wrap();
+ break;
+ case OPT_AES256_WRAP:
+ wrap_cipher = EVP_aes_256_wrap();
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ argv = opt_rest();
+
+ if (((rr_allorfirst != -1) || rr_from) && !rr_to) {
+ BIO_puts(bio_err, "No Signed Receipts Recipients\n");
+ goto opthelp;
+ }
+
+ if (!(operation & SMIME_SIGNERS) && (rr_to || rr_from)) {
+ BIO_puts(bio_err, "Signed receipts only allowed with -sign\n");
+ goto opthelp;
+ }
+ if (!(operation & SMIME_SIGNERS) && (skkeys || sksigners)) {
+ BIO_puts(bio_err, "Multiple signers or keys not allowed\n");
+ goto opthelp;
+ }
+
+ if (operation & SMIME_SIGNERS) {
+ if (keyfile && !signerfile) {
+ BIO_puts(bio_err, "Illegal -inkey without -signer\n");
+ goto opthelp;
+ }
+ /* Check to see if any final signer needs to be appended */
+ if (signerfile) {
+ if (!sksigners
+ && (sksigners = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ sk_OPENSSL_STRING_push(sksigners, signerfile);
+ if (!skkeys && (skkeys = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ if (!keyfile)
+ keyfile = signerfile;
+ sk_OPENSSL_STRING_push(skkeys, keyfile);
+ }
+ if (!sksigners) {
+ BIO_printf(bio_err, "No signer certificate specified\n");
+ goto opthelp;
+ }
+ signerfile = NULL;
+ keyfile = NULL;
+ need_rand = 1;
+ }
+
+ else if (operation == SMIME_DECRYPT) {
+ if (!recipfile && !keyfile && !secret_key && !pwri_pass) {
+ BIO_printf(bio_err,
+ "No recipient certificate or key specified\n");
+ goto opthelp;
+ }
+ } else if (operation == SMIME_ENCRYPT) {
+ if (*argv == NULL && !secret_key && !pwri_pass && !encerts) {
+ BIO_printf(bio_err, "No recipient(s) certificate(s) specified\n");
+ goto opthelp;
+ }
+ need_rand = 1;
+ } else if (!operation)
+ goto opthelp;
+
+ if (!app_passwd(passinarg, NULL, &passin, NULL)) {
+ BIO_printf(bio_err, "Error getting password\n");
+ goto end;
+ }
+
+ if (need_rand) {
+ app_RAND_load_file(NULL, (inrand != NULL));
+ if (inrand != NULL)
+ BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
+ app_RAND_load_files(inrand));
+ }
+
+ ret = 2;
+
+ if (!(operation & SMIME_SIGNERS))
+ flags &= ~CMS_DETACHED;
+
+ if (!(operation & SMIME_OP)) {
+ if (flags & CMS_BINARY)
+ outformat = FORMAT_BINARY;
+ }
+
+ if (!(operation & SMIME_IP)) {
+ if (flags & CMS_BINARY)
+ informat = FORMAT_BINARY;
+ }
+
+ if (operation == SMIME_ENCRYPT) {
+ if (!cipher) {
+# ifndef OPENSSL_NO_DES
+ cipher = EVP_des_ede3_cbc();
+# else
+ BIO_printf(bio_err, "No cipher selected\n");
+ goto end;
+# endif
+ }
+
+ if (secret_key && !secret_keyid) {
+ BIO_printf(bio_err, "No secret key id\n");
+ goto end;
+ }
+
+ if (*argv && !encerts)
+ if ((encerts = sk_X509_new_null()) == NULL)
+ goto end;
+ while (*argv) {
+ if ((cert = load_cert(*argv, FORMAT_PEM,
+ "recipient certificate file")) == NULL)
+ goto end;
+ sk_X509_push(encerts, cert);
+ cert = NULL;
+ argv++;
+ }
+ }
+
+ if (certfile) {
+ if (!load_certs(certfile, &other, FORMAT_PEM, NULL,
+ "certificate file")) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (recipfile && (operation == SMIME_DECRYPT)) {
+ if ((recip = load_cert(recipfile, FORMAT_PEM,
+ "recipient certificate file")) == NULL) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (operation == SMIME_SIGN_RECEIPT) {
+ if ((signer = load_cert(signerfile, FORMAT_PEM,
+ "receipt signer certificate file")) == NULL) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (operation == SMIME_DECRYPT) {
+ if (!keyfile)
+ keyfile = recipfile;
+ } else if ((operation == SMIME_SIGN) || (operation == SMIME_SIGN_RECEIPT)) {
+ if (!keyfile)
+ keyfile = signerfile;
+ } else
+ keyfile = NULL;
+
+ if (keyfile) {
+ key = load_key(keyfile, keyform, 0, passin, e, "signing key file");
+ if (!key)
+ goto end;
+ }
+
+ in = bio_open_default(infile, 'r', informat);
+ if (in == NULL)
+ goto end;
+
+ if (operation & SMIME_IP) {
+ if (informat == FORMAT_SMIME)
+ cms = SMIME_read_CMS(in, &indata);
+ else if (informat == FORMAT_PEM)
+ cms = PEM_read_bio_CMS(in, NULL, NULL, NULL);
+ else if (informat == FORMAT_ASN1)
+ cms = d2i_CMS_bio(in, NULL);
+ else {
+ BIO_printf(bio_err, "Bad input format for CMS file\n");
+ goto end;
+ }
+
+ if (!cms) {
+ BIO_printf(bio_err, "Error reading S/MIME message\n");
+ goto end;
+ }
+ if (contfile) {
+ BIO_free(indata);
+ if ((indata = BIO_new_file(contfile, "rb")) == NULL) {
+ BIO_printf(bio_err, "Can't read content file %s\n", contfile);
+ goto end;
+ }
+ }
+ if (certsoutfile) {
+ STACK_OF(X509) *allcerts;
+ allcerts = CMS_get1_certs(cms);
+ if (!save_certs(certsoutfile, allcerts)) {
+ BIO_printf(bio_err,
+ "Error writing certs to %s\n", certsoutfile);
+ ret = 5;
+ goto end;
+ }
+ sk_X509_pop_free(allcerts, X509_free);
+ }
+ }
+
+ if (rctfile) {
+ char *rctmode = (rctformat == FORMAT_ASN1) ? "rb" : "r";
+ if ((rctin = BIO_new_file(rctfile, rctmode)) == NULL) {
+ BIO_printf(bio_err, "Can't open receipt file %s\n", rctfile);
+ goto end;
+ }
+
+ if (rctformat == FORMAT_SMIME)
+ rcms = SMIME_read_CMS(rctin, NULL);
+ else if (rctformat == FORMAT_PEM)
+ rcms = PEM_read_bio_CMS(rctin, NULL, NULL, NULL);
+ else if (rctformat == FORMAT_ASN1)
+ rcms = d2i_CMS_bio(rctin, NULL);
+ else {
+ BIO_printf(bio_err, "Bad input format for receipt\n");
+ goto end;
+ }
+
+ if (!rcms) {
+ BIO_printf(bio_err, "Error reading receipt\n");
+ goto end;
+ }
+ }
+
+ out = bio_open_default(outfile, 'w', outformat);
+ if (out == NULL)
+ goto end;
+
+ if ((operation == SMIME_VERIFY) || (operation == SMIME_VERIFY_RECEIPT)) {
+ if ((store = setup_verify(CAfile, CApath, noCAfile, noCApath)) == NULL)
+ goto end;
+ X509_STORE_set_verify_cb(store, cms_cb);
+ if (vpmtouched)
+ X509_STORE_set1_param(store, vpm);
+ }
+
+ ret = 3;
+
+ if (operation == SMIME_DATA_CREATE) {
+ cms = CMS_data_create(in, flags);
+ } else if (operation == SMIME_DIGEST_CREATE) {
+ cms = CMS_digest_create(in, sign_md, flags);
+ } else if (operation == SMIME_COMPRESS) {
+ cms = CMS_compress(in, -1, flags);
+ } else if (operation == SMIME_ENCRYPT) {
+ int i;
+ flags |= CMS_PARTIAL;
+ cms = CMS_encrypt(NULL, in, cipher, flags);
+ if (!cms)
+ goto end;
+ for (i = 0; i < sk_X509_num(encerts); i++) {
+ CMS_RecipientInfo *ri;
+ cms_key_param *kparam;
+ int tflags = flags;
+ X509 *x = sk_X509_value(encerts, i);
+ for (kparam = key_first; kparam; kparam = kparam->next) {
+ if (kparam->idx == i) {
+ tflags |= CMS_KEY_PARAM;
+ break;
+ }
+ }
+ ri = CMS_add1_recipient_cert(cms, x, tflags);
+ if (!ri)
+ goto end;
+ if (kparam) {
+ EVP_PKEY_CTX *pctx;
+ pctx = CMS_RecipientInfo_get0_pkey_ctx(ri);
+ if (!cms_set_pkey_param(pctx, kparam->param))
+ goto end;
+ }
+ if (CMS_RecipientInfo_type(ri) == CMS_RECIPINFO_AGREE
+ && wrap_cipher) {
+ EVP_CIPHER_CTX *wctx;
+ wctx = CMS_RecipientInfo_kari_get0_ctx(ri);
+ EVP_EncryptInit_ex(wctx, wrap_cipher, NULL, NULL, NULL);
+ }
+ }
+
+ if (secret_key) {
+ if (!CMS_add0_recipient_key(cms, NID_undef,
+ secret_key, secret_keylen,
+ secret_keyid, secret_keyidlen,
+ NULL, NULL, NULL))
+ goto end;
+ /* NULL these because call absorbs them */
+ secret_key = NULL;
+ secret_keyid = NULL;
+ }
+ if (pwri_pass) {
+ pwri_tmp = (unsigned char *)OPENSSL_strdup((char *)pwri_pass);
+ if (!pwri_tmp)
+ goto end;
+ if (!CMS_add0_recipient_password(cms,
+ -1, NID_undef, NID_undef,
+ pwri_tmp, -1, NULL))
+ goto end;
+ pwri_tmp = NULL;
+ }
+ if (!(flags & CMS_STREAM)) {
+ if (!CMS_final(cms, in, NULL, flags))
+ goto end;
+ }
+ } else if (operation == SMIME_ENCRYPTED_ENCRYPT) {
+ cms = CMS_EncryptedData_encrypt(in, cipher,
+ secret_key, secret_keylen, flags);
+
+ } else if (operation == SMIME_SIGN_RECEIPT) {
+ CMS_ContentInfo *srcms = NULL;
+ STACK_OF(CMS_SignerInfo) *sis;
+ CMS_SignerInfo *si;
+ sis = CMS_get0_SignerInfos(cms);
+ if (!sis)
+ goto end;
+ si = sk_CMS_SignerInfo_value(sis, 0);
+ srcms = CMS_sign_receipt(si, signer, key, other, flags);
+ if (!srcms)
+ goto end;
+ CMS_ContentInfo_free(cms);
+ cms = srcms;
+ } else if (operation & SMIME_SIGNERS) {
+ int i;
+ /*
+ * If detached data content we enable streaming if S/MIME output
+ * format.
+ */
+ if (operation == SMIME_SIGN) {
+
+ if (flags & CMS_DETACHED) {
+ if (outformat == FORMAT_SMIME)
+ flags |= CMS_STREAM;
+ }
+ flags |= CMS_PARTIAL;
+ cms = CMS_sign(NULL, NULL, other, in, flags);
+ if (!cms)
+ goto end;
+ if (econtent_type)
+ CMS_set1_eContentType(cms, econtent_type);
+
+ if (rr_to) {
+ rr = make_receipt_request(rr_to, rr_allorfirst, rr_from);
+ if (!rr) {
+ BIO_puts(bio_err,
+ "Signed Receipt Request Creation Error\n");
+ goto end;
+ }
+ }
+ } else
+ flags |= CMS_REUSE_DIGEST;
+ for (i = 0; i < sk_OPENSSL_STRING_num(sksigners); i++) {
+ CMS_SignerInfo *si;
+ cms_key_param *kparam;
+ int tflags = flags;
+ signerfile = sk_OPENSSL_STRING_value(sksigners, i);
+ keyfile = sk_OPENSSL_STRING_value(skkeys, i);
+
+ signer = load_cert(signerfile, FORMAT_PEM, "signer certificate");
+ if (!signer) {
+ ret = 2;
+ goto end;
+ }
+ key = load_key(keyfile, keyform, 0, passin, e, "signing key file");
+ if (!key) {
+ ret = 2;
+ goto end;
+ }
+ for (kparam = key_first; kparam; kparam = kparam->next) {
+ if (kparam->idx == i) {
+ tflags |= CMS_KEY_PARAM;
+ break;
+ }
+ }
+ si = CMS_add1_signer(cms, signer, key, sign_md, tflags);
+ if (!si)
+ goto end;
+ if (kparam) {
+ EVP_PKEY_CTX *pctx;
+ pctx = CMS_SignerInfo_get0_pkey_ctx(si);
+ if (!cms_set_pkey_param(pctx, kparam->param))
+ goto end;
+ }
+ if (rr && !CMS_add1_ReceiptRequest(si, rr))
+ goto end;
+ X509_free(signer);
+ signer = NULL;
+ EVP_PKEY_free(key);
+ key = NULL;
+ }
+ /* If not streaming or resigning finalize structure */
+ if ((operation == SMIME_SIGN) && !(flags & CMS_STREAM)) {
+ if (!CMS_final(cms, in, NULL, flags))
+ goto end;
+ }
+ }
+
+ if (!cms) {
+ BIO_printf(bio_err, "Error creating CMS structure\n");
+ goto end;
+ }
+
+ ret = 4;
+ if (operation == SMIME_DECRYPT) {
+ if (flags & CMS_DEBUG_DECRYPT)
+ CMS_decrypt(cms, NULL, NULL, NULL, NULL, flags);
+
+ if (secret_key) {
+ if (!CMS_decrypt_set1_key(cms,
+ secret_key, secret_keylen,
+ secret_keyid, secret_keyidlen)) {
+ BIO_puts(bio_err, "Error decrypting CMS using secret key\n");
+ goto end;
+ }
+ }
+
+ if (key) {
+ if (!CMS_decrypt_set1_pkey(cms, key, recip)) {
+ BIO_puts(bio_err, "Error decrypting CMS using private key\n");
+ goto end;
+ }
+ }
+
+ if (pwri_pass) {
+ if (!CMS_decrypt_set1_password(cms, pwri_pass, -1)) {
+ BIO_puts(bio_err, "Error decrypting CMS using password\n");
+ goto end;
+ }
+ }
+
+ if (!CMS_decrypt(cms, NULL, NULL, indata, out, flags)) {
+ BIO_printf(bio_err, "Error decrypting CMS structure\n");
+ goto end;
+ }
+ } else if (operation == SMIME_DATAOUT) {
+ if (!CMS_data(cms, out, flags))
+ goto end;
+ } else if (operation == SMIME_UNCOMPRESS) {
+ if (!CMS_uncompress(cms, indata, out, flags))
+ goto end;
+ } else if (operation == SMIME_DIGEST_VERIFY) {
+ if (CMS_digest_verify(cms, indata, out, flags) > 0)
+ BIO_printf(bio_err, "Verification successful\n");
+ else {
+ BIO_printf(bio_err, "Verification failure\n");
+ goto end;
+ }
+ } else if (operation == SMIME_ENCRYPTED_DECRYPT) {
+ if (!CMS_EncryptedData_decrypt(cms, secret_key, secret_keylen,
+ indata, out, flags))
+ goto end;
+ } else if (operation == SMIME_VERIFY) {
+ if (CMS_verify(cms, other, store, indata, out, flags) > 0)
+ BIO_printf(bio_err, "Verification successful\n");
+ else {
+ BIO_printf(bio_err, "Verification failure\n");
+ if (verify_retcode)
+ ret = verify_err + 32;
+ goto end;
+ }
+ if (signerfile) {
+ STACK_OF(X509) *signers;
+ signers = CMS_get0_signers(cms);
+ if (!save_certs(signerfile, signers)) {
+ BIO_printf(bio_err,
+ "Error writing signers to %s\n", signerfile);
+ ret = 5;
+ goto end;
+ }
+ sk_X509_free(signers);
+ }
+ if (rr_print)
+ receipt_request_print(cms);
+
+ } else if (operation == SMIME_VERIFY_RECEIPT) {
+ if (CMS_verify_receipt(rcms, cms, other, store, flags) > 0)
+ BIO_printf(bio_err, "Verification successful\n");
+ else {
+ BIO_printf(bio_err, "Verification failure\n");
+ goto end;
+ }
+ } else {
+ if (noout) {
+ if (print)
+ CMS_ContentInfo_print_ctx(out, cms, 0, NULL);
+ } else if (outformat == FORMAT_SMIME) {
+ if (to)
+ BIO_printf(out, "To: %s%s", to, mime_eol);
+ if (from)
+ BIO_printf(out, "From: %s%s", from, mime_eol);
+ if (subject)
+ BIO_printf(out, "Subject: %s%s", subject, mime_eol);
+ if (operation == SMIME_RESIGN)
+ ret = SMIME_write_CMS(out, cms, indata, flags);
+ else
+ ret = SMIME_write_CMS(out, cms, in, flags);
+ } else if (outformat == FORMAT_PEM)
+ ret = PEM_write_bio_CMS_stream(out, cms, in, flags);
+ else if (outformat == FORMAT_ASN1)
+ ret = i2d_CMS_bio_stream(out, cms, in, flags);
+ else {
+ BIO_printf(bio_err, "Bad output format for CMS file\n");
+ goto end;
+ }
+ if (ret <= 0) {
+ ret = 6;
+ goto end;
+ }
+ }
+ ret = 0;
+ end:
+ if (ret)
+ ERR_print_errors(bio_err);
+ if (need_rand)
+ app_RAND_write_file(NULL);
+ sk_X509_pop_free(encerts, X509_free);
+ sk_X509_pop_free(other, X509_free);
+ X509_VERIFY_PARAM_free(vpm);
+ sk_OPENSSL_STRING_free(sksigners);
+ sk_OPENSSL_STRING_free(skkeys);
+ OPENSSL_free(secret_key);
+ OPENSSL_free(secret_keyid);
+ OPENSSL_free(pwri_tmp);
+ ASN1_OBJECT_free(econtent_type);
+ CMS_ReceiptRequest_free(rr);
+ sk_OPENSSL_STRING_free(rr_to);
+ sk_OPENSSL_STRING_free(rr_from);
+ for (key_param = key_first; key_param;) {
+ cms_key_param *tparam;
+ sk_OPENSSL_STRING_free(key_param->param);
+ tparam = key_param->next;
+ OPENSSL_free(key_param);
+ key_param = tparam;
+ }
+ X509_STORE_free(store);
+ X509_free(cert);
+ X509_free(recip);
+ X509_free(signer);
+ EVP_PKEY_free(key);
+ CMS_ContentInfo_free(cms);
+ CMS_ContentInfo_free(rcms);
+ release_engine(e);
+ BIO_free(rctin);
+ BIO_free(in);
+ BIO_free(indata);
+ BIO_free_all(out);
+ OPENSSL_free(passin);
+ return (ret);
+}
+
+static int save_certs(char *signerfile, STACK_OF(X509) *signers)
+{
+ int i;
+ BIO *tmp;
+ if (!signerfile)
+ return 1;
+ tmp = BIO_new_file(signerfile, "w");
+ if (!tmp)
+ return 0;
+ for (i = 0; i < sk_X509_num(signers); i++)
+ PEM_write_bio_X509(tmp, sk_X509_value(signers, i));
+ BIO_free(tmp);
+ return 1;
+}
+
+/* Minimal callback just to output policy info (if any) */
+
+static int cms_cb(int ok, X509_STORE_CTX *ctx)
+{
+ int error;
+
+ error = X509_STORE_CTX_get_error(ctx);
+
+ verify_err = error;
+
+ if ((error != X509_V_ERR_NO_EXPLICIT_POLICY)
+ && ((error != X509_V_OK) || (ok != 2)))
+ return ok;
+
+ policies_print(ctx);
+
+ return ok;
+
+}
+
+static void gnames_stack_print(STACK_OF(GENERAL_NAMES) *gns)
+{
+ STACK_OF(GENERAL_NAME) *gens;
+ GENERAL_NAME *gen;
+ int i, j;
+
+ for (i = 0; i < sk_GENERAL_NAMES_num(gns); i++) {
+ gens = sk_GENERAL_NAMES_value(gns, i);
+ for (j = 0; j < sk_GENERAL_NAME_num(gens); j++) {
+ gen = sk_GENERAL_NAME_value(gens, j);
+ BIO_puts(bio_err, " ");
+ GENERAL_NAME_print(bio_err, gen);
+ BIO_puts(bio_err, "\n");
+ }
+ }
+ return;
+}
+
+static void receipt_request_print(CMS_ContentInfo *cms)
+{
+ STACK_OF(CMS_SignerInfo) *sis;
+ CMS_SignerInfo *si;
+ CMS_ReceiptRequest *rr;
+ int allorfirst;
+ STACK_OF(GENERAL_NAMES) *rto, *rlist;
+ ASN1_STRING *scid;
+ int i, rv;
+ sis = CMS_get0_SignerInfos(cms);
+ for (i = 0; i < sk_CMS_SignerInfo_num(sis); i++) {
+ si = sk_CMS_SignerInfo_value(sis, i);
+ rv = CMS_get1_ReceiptRequest(si, &rr);
+ BIO_printf(bio_err, "Signer %d:\n", i + 1);
+ if (rv == 0)
+ BIO_puts(bio_err, " No Receipt Request\n");
+ else if (rv < 0) {
+ BIO_puts(bio_err, " Receipt Request Parse Error\n");
+ ERR_print_errors(bio_err);
+ } else {
+ const char *id;
+ int idlen;
+ CMS_ReceiptRequest_get0_values(rr, &scid, &allorfirst,
+ &rlist, &rto);
+ BIO_puts(bio_err, " Signed Content ID:\n");
+ idlen = ASN1_STRING_length(scid);
+ id = (const char *)ASN1_STRING_get0_data(scid);
+ BIO_dump_indent(bio_err, id, idlen, 4);
+ BIO_puts(bio_err, " Receipts From");
+ if (rlist) {
+ BIO_puts(bio_err, " List:\n");
+ gnames_stack_print(rlist);
+ } else if (allorfirst == 1)
+ BIO_puts(bio_err, ": First Tier\n");
+ else if (allorfirst == 0)
+ BIO_puts(bio_err, ": All\n");
+ else
+ BIO_printf(bio_err, " Unknown (%d)\n", allorfirst);
+ BIO_puts(bio_err, " Receipts To:\n");
+ gnames_stack_print(rto);
+ }
+ CMS_ReceiptRequest_free(rr);
+ }
+}
+
+static STACK_OF(GENERAL_NAMES) *make_names_stack(STACK_OF(OPENSSL_STRING) *ns)
+{
+ int i;
+ STACK_OF(GENERAL_NAMES) *ret;
+ GENERAL_NAMES *gens = NULL;
+ GENERAL_NAME *gen = NULL;
+ ret = sk_GENERAL_NAMES_new_null();
+ if (!ret)
+ goto err;
+ for (i = 0; i < sk_OPENSSL_STRING_num(ns); i++) {
+ char *str = sk_OPENSSL_STRING_value(ns, i);
+ gen = a2i_GENERAL_NAME(NULL, NULL, NULL, GEN_EMAIL, str, 0);
+ if (!gen)
+ goto err;
+ gens = GENERAL_NAMES_new();
+ if (gens == NULL)
+ goto err;
+ if (!sk_GENERAL_NAME_push(gens, gen))
+ goto err;
+ gen = NULL;
+ if (!sk_GENERAL_NAMES_push(ret, gens))
+ goto err;
+ gens = NULL;
+ }
+
+ return ret;
+
+ err:
+ sk_GENERAL_NAMES_pop_free(ret, GENERAL_NAMES_free);
+ GENERAL_NAMES_free(gens);
+ GENERAL_NAME_free(gen);
+ return NULL;
+}
+
+static CMS_ReceiptRequest *make_receipt_request(STACK_OF(OPENSSL_STRING)
+ *rr_to, int rr_allorfirst, STACK_OF(OPENSSL_STRING)
+ *rr_from)
+{
+ STACK_OF(GENERAL_NAMES) *rct_to = NULL, *rct_from = NULL;
+ CMS_ReceiptRequest *rr;
+ rct_to = make_names_stack(rr_to);
+ if (!rct_to)
+ goto err;
+ if (rr_from) {
+ rct_from = make_names_stack(rr_from);
+ if (!rct_from)
+ goto err;
+ } else
+ rct_from = NULL;
+ rr = CMS_ReceiptRequest_create0(NULL, -1, rr_allorfirst, rct_from,
+ rct_to);
+ return rr;
+ err:
+ sk_GENERAL_NAMES_pop_free(rct_to, GENERAL_NAMES_free);
+ return NULL;
+}
+
+static int cms_set_pkey_param(EVP_PKEY_CTX *pctx,
+ STACK_OF(OPENSSL_STRING) *param)
+{
+ char *keyopt;
+ int i;
+ if (sk_OPENSSL_STRING_num(param) <= 0)
+ return 1;
+ for (i = 0; i < sk_OPENSSL_STRING_num(param); i++) {
+ keyopt = sk_OPENSSL_STRING_value(param, i);
+ if (pkey_ctrl_string(pctx, keyopt) <= 0) {
+ BIO_printf(bio_err, "parameter error \"%s\"\n", keyopt);
+ ERR_print_errors(bio_err);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+#endif
diff --git a/openssl-1.1.0h/apps/crl.c b/openssl-1.1.0h/apps/crl.c
new file mode 100644
index 0000000..06b6e5b
--- /dev/null
+++ b/openssl-1.1.0h/apps/crl.c
@@ -0,0 +1,347 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "apps.h"
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/x509.h>
+#include <openssl/x509v3.h>
+#include <openssl/pem.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_IN, OPT_OUTFORM, OPT_OUT, OPT_KEYFORM, OPT_KEY,
+ OPT_ISSUER, OPT_LASTUPDATE, OPT_NEXTUPDATE, OPT_FINGERPRINT,
+ OPT_CRLNUMBER, OPT_BADSIG, OPT_GENDELTA, OPT_CAPATH, OPT_CAFILE,
+ OPT_NOCAPATH, OPT_NOCAFILE, OPT_VERIFY, OPT_TEXT, OPT_HASH, OPT_HASH_OLD,
+ OPT_NOOUT, OPT_NAMEOPT, OPT_MD
+} OPTION_CHOICE;
+
+OPTIONS crl_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"inform", OPT_INFORM, 'F', "Input format; default PEM"},
+ {"in", OPT_IN, '<', "Input file - default stdin"},
+ {"outform", OPT_OUTFORM, 'F', "Output format - default PEM"},
+ {"out", OPT_OUT, '>', "output file - default stdout"},
+ {"keyform", OPT_KEYFORM, 'F', "Private key file format (PEM or ENGINE)"},
+ {"key", OPT_KEY, '<', "CRL signing Private key to use"},
+ {"issuer", OPT_ISSUER, '-', "Print issuer DN"},
+ {"lastupdate", OPT_LASTUPDATE, '-', "Set lastUpdate field"},
+ {"nextupdate", OPT_NEXTUPDATE, '-', "Set nextUpdate field"},
+ {"noout", OPT_NOOUT, '-', "No CRL output"},
+ {"fingerprint", OPT_FINGERPRINT, '-', "Print the crl fingerprint"},
+ {"crlnumber", OPT_CRLNUMBER, '-', "Print CRL number"},
+ {"badsig", OPT_BADSIG, '-', "Corrupt last byte of loaded CRL signature (for test)" },
+ {"gendelta", OPT_GENDELTA, '<', "Other CRL to compare/diff to the Input one"},
+ {"CApath", OPT_CAPATH, '/', "Verify CRL using certificates in dir"},
+ {"CAfile", OPT_CAFILE, '<', "Verify CRL using certificates in file name"},
+ {"no-CAfile", OPT_NOCAFILE, '-',
+ "Do not load the default certificates file"},
+ {"no-CApath", OPT_NOCAPATH, '-',
+ "Do not load certificates from the default certificates directory"},
+ {"verify", OPT_VERIFY, '-', "Verify CRL signature"},
+ {"text", OPT_TEXT, '-', "Print out a text format version"},
+ {"hash", OPT_HASH, '-', "Print hash value"},
+ {"nameopt", OPT_NAMEOPT, 's', "Various certificate name options"},
+ {"", OPT_MD, '-', "Any supported digest"},
+#ifndef OPENSSL_NO_MD5
+ {"hash_old", OPT_HASH_OLD, '-', "Print old-style (MD5) hash value"},
+#endif
+ {NULL}
+};
+
+int crl_main(int argc, char **argv)
+{
+ X509_CRL *x = NULL;
+ BIO *out = NULL;
+ X509_STORE *store = NULL;
+ X509_STORE_CTX *ctx = NULL;
+ X509_LOOKUP *lookup = NULL;
+ X509_OBJECT *xobj = NULL;
+ EVP_PKEY *pkey;
+ const EVP_MD *digest = EVP_sha1();
+ unsigned long nmflag = 0;
+ char nmflag_set = 0;
+ char *infile = NULL, *outfile = NULL, *crldiff = NULL, *keyfile = NULL;
+ const char *CAfile = NULL, *CApath = NULL, *prog;
+ OPTION_CHOICE o;
+ int hash = 0, issuer = 0, lastupdate = 0, nextupdate = 0, noout = 0;
+ int informat = FORMAT_PEM, outformat = FORMAT_PEM, keyformat = FORMAT_PEM;
+ int ret = 1, num = 0, badsig = 0, fingerprint = 0, crlnumber = 0;
+ int text = 0, do_ver = 0, noCAfile = 0, noCApath = 0;
+ int i;
+#ifndef OPENSSL_NO_MD5
+ int hash_old = 0;
+#endif
+
+ prog = opt_init(argc, argv, crl_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(crl_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+ goto opthelp;
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_KEYFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &keyformat))
+ goto opthelp;
+ break;
+ case OPT_KEY:
+ keyfile = opt_arg();
+ break;
+ case OPT_GENDELTA:
+ crldiff = opt_arg();
+ break;
+ case OPT_CAPATH:
+ CApath = opt_arg();
+ do_ver = 1;
+ break;
+ case OPT_CAFILE:
+ CAfile = opt_arg();
+ do_ver = 1;
+ break;
+ case OPT_NOCAPATH:
+ noCApath = 1;
+ break;
+ case OPT_NOCAFILE:
+ noCAfile = 1;
+ break;
+ case OPT_HASH_OLD:
+#ifndef OPENSSL_NO_MD5
+ hash_old = ++num;
+#endif
+ break;
+ case OPT_VERIFY:
+ do_ver = 1;
+ break;
+ case OPT_TEXT:
+ text = 1;
+ break;
+ case OPT_HASH:
+ hash = ++num;
+ break;
+ case OPT_ISSUER:
+ issuer = ++num;
+ break;
+ case OPT_LASTUPDATE:
+ lastupdate = ++num;
+ break;
+ case OPT_NEXTUPDATE:
+ nextupdate = ++num;
+ break;
+ case OPT_NOOUT:
+ noout = ++num;
+ break;
+ case OPT_FINGERPRINT:
+ fingerprint = ++num;
+ break;
+ case OPT_CRLNUMBER:
+ crlnumber = ++num;
+ break;
+ case OPT_BADSIG:
+ badsig = 1;
+ break;
+ case OPT_NAMEOPT:
+ nmflag_set = 1;
+ if (!set_name_ex(&nmflag, opt_arg()))
+ goto opthelp;
+ break;
+ case OPT_MD:
+ if (!opt_md(opt_unknown(), &digest))
+ goto opthelp;
+ }
+ }
+ argc = opt_num_rest();
+ if (argc != 0)
+ goto opthelp;
+
+ if (!nmflag_set)
+ nmflag = XN_FLAG_ONELINE;
+
+ x = load_crl(infile, informat);
+ if (x == NULL)
+ goto end;
+
+ if (do_ver) {
+ if ((store = setup_verify(CAfile, CApath, noCAfile, noCApath)) == NULL)
+ goto end;
+ lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
+ if (lookup == NULL)
+ goto end;
+ ctx = X509_STORE_CTX_new();
+ if (ctx == NULL || !X509_STORE_CTX_init(ctx, store, NULL, NULL)) {
+ BIO_printf(bio_err, "Error initialising X509 store\n");
+ goto end;
+ }
+
+ xobj = X509_STORE_CTX_get_obj_by_subject(ctx, X509_LU_X509,
+ X509_CRL_get_issuer(x));
+ if (xobj == NULL) {
+ BIO_printf(bio_err, "Error getting CRL issuer certificate\n");
+ goto end;
+ }
+ pkey = X509_get_pubkey(X509_OBJECT_get0_X509(xobj));
+ X509_OBJECT_free(xobj);
+ if (!pkey) {
+ BIO_printf(bio_err, "Error getting CRL issuer public key\n");
+ goto end;
+ }
+ i = X509_CRL_verify(x, pkey);
+ EVP_PKEY_free(pkey);
+ if (i < 0)
+ goto end;
+ if (i == 0)
+ BIO_printf(bio_err, "verify failure\n");
+ else
+ BIO_printf(bio_err, "verify OK\n");
+ }
+
+ if (crldiff) {
+ X509_CRL *newcrl, *delta;
+ if (!keyfile) {
+ BIO_puts(bio_err, "Missing CRL signing key\n");
+ goto end;
+ }
+ newcrl = load_crl(crldiff, informat);
+ if (!newcrl)
+ goto end;
+ pkey = load_key(keyfile, keyformat, 0, NULL, NULL, "CRL signing key");
+ if (!pkey) {
+ X509_CRL_free(newcrl);
+ goto end;
+ }
+ delta = X509_CRL_diff(x, newcrl, pkey, digest, 0);
+ X509_CRL_free(newcrl);
+ EVP_PKEY_free(pkey);
+ if (delta) {
+ X509_CRL_free(x);
+ x = delta;
+ } else {
+ BIO_puts(bio_err, "Error creating delta CRL\n");
+ goto end;
+ }
+ }
+
+ if (badsig) {
+ const ASN1_BIT_STRING *sig;
+
+ X509_CRL_get0_signature(x, &sig, NULL);
+ corrupt_signature(sig);
+ }
+
+ if (num) {
+ for (i = 1; i <= num; i++) {
+ if (issuer == i) {
+ print_name(bio_out, "issuer=", X509_CRL_get_issuer(x),
+ nmflag);
+ }
+ if (crlnumber == i) {
+ ASN1_INTEGER *crlnum;
+ crlnum = X509_CRL_get_ext_d2i(x, NID_crl_number, NULL, NULL);
+ BIO_printf(bio_out, "crlNumber=");
+ if (crlnum) {
+ i2a_ASN1_INTEGER(bio_out, crlnum);
+ ASN1_INTEGER_free(crlnum);
+ } else
+ BIO_puts(bio_out, "<NONE>");
+ BIO_printf(bio_out, "\n");
+ }
+ if (hash == i) {
+ BIO_printf(bio_out, "%08lx\n",
+ X509_NAME_hash(X509_CRL_get_issuer(x)));
+ }
+#ifndef OPENSSL_NO_MD5
+ if (hash_old == i) {
+ BIO_printf(bio_out, "%08lx\n",
+ X509_NAME_hash_old(X509_CRL_get_issuer(x)));
+ }
+#endif
+ if (lastupdate == i) {
+ BIO_printf(bio_out, "lastUpdate=");
+ ASN1_TIME_print(bio_out, X509_CRL_get0_lastUpdate(x));
+ BIO_printf(bio_out, "\n");
+ }
+ if (nextupdate == i) {
+ BIO_printf(bio_out, "nextUpdate=");
+ if (X509_CRL_get0_nextUpdate(x))
+ ASN1_TIME_print(bio_out, X509_CRL_get0_nextUpdate(x));
+ else
+ BIO_printf(bio_out, "NONE");
+ BIO_printf(bio_out, "\n");
+ }
+ if (fingerprint == i) {
+ int j;
+ unsigned int n;
+ unsigned char md[EVP_MAX_MD_SIZE];
+
+ if (!X509_CRL_digest(x, digest, md, &n)) {
+ BIO_printf(bio_err, "out of memory\n");
+ goto end;
+ }
+ BIO_printf(bio_out, "%s Fingerprint=",
+ OBJ_nid2sn(EVP_MD_type(digest)));
+ for (j = 0; j < (int)n; j++) {
+ BIO_printf(bio_out, "%02X%c", md[j], (j + 1 == (int)n)
+ ? '\n' : ':');
+ }
+ }
+ }
+ }
+ out = bio_open_default(outfile, 'w', outformat);
+ if (out == NULL)
+ goto end;
+
+ if (text)
+ X509_CRL_print(out, x);
+
+ if (noout) {
+ ret = 0;
+ goto end;
+ }
+
+ if (outformat == FORMAT_ASN1)
+ i = (int)i2d_X509_CRL_bio(out, x);
+ else
+ i = PEM_write_bio_X509_CRL(out, x);
+ if (!i) {
+ BIO_printf(bio_err, "unable to write CRL\n");
+ goto end;
+ }
+ ret = 0;
+
+ end:
+ if (ret != 0)
+ ERR_print_errors(bio_err);
+ BIO_free_all(out);
+ X509_CRL_free(x);
+ X509_STORE_CTX_free(ctx);
+ X509_STORE_free(store);
+ return (ret);
+}
diff --git a/openssl-1.1.0h/apps/crl2p7.c b/openssl-1.1.0h/apps/crl2p7.c
new file mode 100644
index 0000000..9c5f79f
--- /dev/null
+++ b/openssl-1.1.0h/apps/crl2p7.c
@@ -0,0 +1,216 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include "apps.h"
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/x509.h>
+#include <openssl/pkcs7.h>
+#include <openssl/pem.h>
+#include <openssl/objects.h>
+
+static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile);
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_NOCRL, OPT_CERTFILE
+} OPTION_CHOICE;
+
+OPTIONS crl2pkcs7_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"},
+ {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"},
+ {"in", OPT_IN, '<', "Input file"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"nocrl", OPT_NOCRL, '-', "No crl to load, just certs from '-certfile'"},
+ {"certfile", OPT_CERTFILE, '<',
+ "File of chain of certs to a trusted CA; can be repeated"},
+ {NULL}
+};
+
+int crl2pkcs7_main(int argc, char **argv)
+{
+ BIO *in = NULL, *out = NULL;
+ PKCS7 *p7 = NULL;
+ PKCS7_SIGNED *p7s = NULL;
+ STACK_OF(OPENSSL_STRING) *certflst = NULL;
+ STACK_OF(X509) *cert_stack = NULL;
+ STACK_OF(X509_CRL) *crl_stack = NULL;
+ X509_CRL *crl = NULL;
+ char *infile = NULL, *outfile = NULL, *prog, *certfile;
+ int i = 0, informat = FORMAT_PEM, outformat = FORMAT_PEM, ret = 1, nocrl =
+ 0;
+ OPTION_CHOICE o;
+
+ prog = opt_init(argc, argv, crl2pkcs7_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(crl2pkcs7_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+ goto opthelp;
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_NOCRL:
+ nocrl = 1;
+ break;
+ case OPT_CERTFILE:
+ if ((certflst == NULL)
+ && (certflst = sk_OPENSSL_STRING_new_null()) == NULL)
+ goto end;
+ if (!sk_OPENSSL_STRING_push(certflst, opt_arg()))
+ goto end;
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ if (argc != 0)
+ goto opthelp;
+
+ if (!nocrl) {
+ in = bio_open_default(infile, 'r', informat);
+ if (in == NULL)
+ goto end;
+
+ if (informat == FORMAT_ASN1)
+ crl = d2i_X509_CRL_bio(in, NULL);
+ else if (informat == FORMAT_PEM)
+ crl = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL);
+ if (crl == NULL) {
+ BIO_printf(bio_err, "unable to load CRL\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if ((p7 = PKCS7_new()) == NULL)
+ goto end;
+ if ((p7s = PKCS7_SIGNED_new()) == NULL)
+ goto end;
+ p7->type = OBJ_nid2obj(NID_pkcs7_signed);
+ p7->d.sign = p7s;
+ p7s->contents->type = OBJ_nid2obj(NID_pkcs7_data);
+
+ if (!ASN1_INTEGER_set(p7s->version, 1))
+ goto end;
+ if ((crl_stack = sk_X509_CRL_new_null()) == NULL)
+ goto end;
+ p7s->crl = crl_stack;
+ if (crl != NULL) {
+ sk_X509_CRL_push(crl_stack, crl);
+ crl = NULL; /* now part of p7 for OPENSSL_freeing */
+ }
+
+ if ((cert_stack = sk_X509_new_null()) == NULL)
+ goto end;
+ p7s->cert = cert_stack;
+
+ if (certflst)
+ for (i = 0; i < sk_OPENSSL_STRING_num(certflst); i++) {
+ certfile = sk_OPENSSL_STRING_value(certflst, i);
+ if (add_certs_from_file(cert_stack, certfile) < 0) {
+ BIO_printf(bio_err, "error loading certificates\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ out = bio_open_default(outfile, 'w', outformat);
+ if (out == NULL)
+ goto end;
+
+ if (outformat == FORMAT_ASN1)
+ i = i2d_PKCS7_bio(out, p7);
+ else if (outformat == FORMAT_PEM)
+ i = PEM_write_bio_PKCS7(out, p7);
+ if (!i) {
+ BIO_printf(bio_err, "unable to write pkcs7 object\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ ret = 0;
+ end:
+ sk_OPENSSL_STRING_free(certflst);
+ BIO_free(in);
+ BIO_free_all(out);
+ PKCS7_free(p7);
+ X509_CRL_free(crl);
+
+ return (ret);
+}
+
+/*-
+ *----------------------------------------------------------------------
+ * int add_certs_from_file
+ *
+ * Read a list of certificates to be checked from a file.
+ *
+ * Results:
+ * number of certs added if successful, -1 if not.
+ *----------------------------------------------------------------------
+ */
+static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
+{
+ BIO *in = NULL;
+ int count = 0;
+ int ret = -1;
+ STACK_OF(X509_INFO) *sk = NULL;
+ X509_INFO *xi;
+
+ in = BIO_new_file(certfile, "r");
+ if (in == NULL) {
+ BIO_printf(bio_err, "error opening the file, %s\n", certfile);
+ goto end;
+ }
+
+ /* This loads from a file, a stack of x509/crl/pkey sets */
+ sk = PEM_X509_INFO_read_bio(in, NULL, NULL, NULL);
+ if (sk == NULL) {
+ BIO_printf(bio_err, "error reading the file, %s\n", certfile);
+ goto end;
+ }
+
+ /* scan over it and pull out the CRL's */
+ while (sk_X509_INFO_num(sk)) {
+ xi = sk_X509_INFO_shift(sk);
+ if (xi->x509 != NULL) {
+ sk_X509_push(stack, xi->x509);
+ xi->x509 = NULL;
+ count++;
+ }
+ X509_INFO_free(xi);
+ }
+
+ ret = count;
+ end:
+ /* never need to OPENSSL_free x */
+ BIO_free(in);
+ sk_X509_INFO_free(sk);
+ return (ret);
+}
diff --git a/openssl-1.1.0h/apps/ct_log_list.cnf b/openssl-1.1.0h/apps/ct_log_list.cnf
new file mode 100644
index 0000000..2434874
--- /dev/null
+++ b/openssl-1.1.0h/apps/ct_log_list.cnf
@@ -0,0 +1,34 @@
+enabled_logs=pilot,aviator,rocketeer,digicert,certly,izempe,symantec,venafi
+
+[pilot]
+description = Google Pilot Log
+key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEfahLEimAoz2t01p3uMziiLOl/fHTDM0YDOhBRuiBARsV4UvxG2LdNgoIGLrtCzWE0J5APC2em4JlvR8EEEFMoA==
+
+[aviator]
+description = Google Aviator log
+key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1/TMabLkDpCjiupacAlP7xNi0I1JYP8bQFAHDG1xhtolSY1l4QgNRzRrvSe8liE+NPWHdjGxfx3JhTsN9x8/6Q==
+
+[rocketeer]
+description = Google Rocketeer log
+key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEIFsYyDzBi7MxCAC/oJBXK7dHjG+1aLCOkHjpoHPqTyghLpzA9BYbqvnV16mAw04vUjyYASVGJCUoI3ctBcJAeg==
+
+[digicert]
+description = DigiCert Log Server
+key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAkbFvhu7gkAW6MHSrBlpE1n4+HCFRkC5OLAjgqhkTH+/uzSfSl8ois8ZxAD2NgaTZe1M9akhYlrYkes4JECs6A==
+
+[certly]
+description = Certly.IO log
+key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECyPLhWKYYUgEc+tUXfPQB4wtGS2MNvXrjwFCCnyYJifBtd2Sk7Cu+Js9DNhMTh35FftHaHu6ZrclnNBKwmbbSA==
+
+[izempe]
+description = Izempe log
+key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJ2Q5DC3cUBj4IQCiDu0s6j51up+TZAkAEcQRF6tczw90rLWXkJMAW7jr9yc92bIKgV8vDXU4lDeZHvYHduDuvg==
+
+[symantec]
+description = Symantec log
+key = MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEluqsHEYMG1XcDfy1lCdGV0JwOmkY4r87xNuroPS2bMBTP01CEDPwWJePa75y9CrsHEKqAy8afig1dpkIPSEUhg==
+
+[venafi]
+description = Venafi log
+key = MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAolpIHxdSlTXLo1s6H1OCdpSj/4DyHDc8wLG9wVmLqy1lk9fz4ATVmm+/1iN2Nk8jmctUKK2MFUtlWXZBSpym97M7frGlSaQXUWyA3CqQUEuIJOmlEjKTBEiQAvpfDjCHjlV2Be4qTM6jamkJbiWtgnYPhJL6ONaGTiSPm7Byy57iaz/hbckldSOIoRhYBiMzeNoA0DiRZ9KmfSeXZ1rB8y8X5urSW+iBzf2SaOfzBvDpcoTuAaWx2DPazoOl28fP1hZ+kHUYvxbcMjttjauCFx+JII0dmuZNIwjfeG/GBb9frpSX219k1O4Wi6OEbHEr8at/XQ0y7gTikOxBn/s5wQIDAQAB
+
diff --git a/openssl-1.1.0h/apps/demoCA/cacert.pem b/openssl-1.1.0h/apps/demoCA/cacert.pem
new file mode 100644
index 0000000..affbce3
--- /dev/null
+++ b/openssl-1.1.0h/apps/demoCA/cacert.pem
@@ -0,0 +1,14 @@
+subject=/C=AU/SOP=QLD/O=Mincom Pty. Ltd./OU=CS/CN=SSLeay demo server
+issuer= /C=AU/SOP=QLD/O=Mincom Pty. Ltd./OU=CS/CN=CA
+-----BEGIN X509 CERTIFICATE-----
+
+MIIBgjCCASwCAQQwDQYJKoZIhvcNAQEEBQAwODELMAkGA1UEBhMCQVUxDDAKBgNV
+BAgTA1FMRDEbMBkGA1UEAxMSU1NMZWF5L3JzYSB0ZXN0IENBMB4XDTk1MTAwOTIz
+MzIwNVoXDTk4MDcwNTIzMzIwNVowYDELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA1FM
+RDEZMBcGA1UEChMQTWluY29tIFB0eS4gTHRkLjELMAkGA1UECxMCQ1MxGzAZBgNV
+BAMTElNTTGVheSBkZW1vIHNlcnZlcjBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC3
+LCXcScWua0PFLkHBLm2VejqpA1F4RQ8q0VjRiPafjx/Z/aWH3ipdMVvuJGa/wFXb
+/nDFLDlfWp+oCPwhBtVPAgMBAAEwDQYJKoZIhvcNAQEEBQADQQArNFsihWIjBzb0
+DCsU0BvL2bvSwJrPEqFlkDq3F4M6EGutL9axEcANWgbbEdAvNJD1dmEmoWny27Pn
+IMs6ZOZB
+-----END X509 CERTIFICATE-----
diff --git a/openssl-1.1.0h/apps/demoCA/index.txt b/openssl-1.1.0h/apps/demoCA/index.txt
new file mode 100644
index 0000000..2cdd252
--- /dev/null
+++ b/openssl-1.1.0h/apps/demoCA/index.txt
@@ -0,0 +1,39 @@
+R 980705233205Z 951009233205Z 01 certs/00000001 /CN=Eric Young
+E 951009233205Z 02 certs/00000002 /CN=Duncan Young
+R 980705233205Z 951201010000Z 03 certs/00000003 /CN=Tim Hudson
+V 980705233205Z 04 certs/00000004 /CN=Eric Young4
+V 980705233205Z 05 certs/00000004 /CN=Eric Young5
+V 980705233205Z 06 certs/00000004 /CN=Eric Young6
+V 980705233205Z 07 certs/00000004 /CN=Eric Young7
+V 980705233205Z 08 certs/00000004 /CN=Eric Young8
+V 980705233205Z 09 certs/00000004 /CN=Eric Young9
+V 980705233205Z 0A certs/00000004 /CN=Eric YoungA
+V 980705233205Z 0B certs/00000004 /CN=Eric YoungB
+V 980705233205Z 0C certs/00000004 /CN=Eric YoungC
+V 980705233205Z 0D certs/00000004 /CN=Eric YoungD
+V 980705233205Z 0E certs/00000004 /CN=Eric YoungE
+V 980705233205Z 0F certs/00000004 /CN=Eric YoungF
+V 980705233205Z 10 certs/00000004 /CN=Eric Young10
+V 980705233205Z 11 certs/00000004 /CN=Eric Young11
+V 980705233205Z 12 certs/00000004 /CN=Eric Young12
+V 980705233205Z 13 certs/00000004 /CN=Eric Young13
+V 980705233205Z 14 certs/00000004 /CN=Eric Young14
+V 980705233205Z 15 certs/00000004 /CN=Eric Young15
+V 980705233205Z 16 certs/00000004 /CN=Eric Young16
+V 980705233205Z 17 certs/00000004 /CN=Eric Young17
+V 961206150305Z 010C unknown /C=AU/SP=QLD/O=Mincom Pty. Ltd./OU=MTR/CN=Eric Young/Email=eay@mincom.oz.au
+V 961206153245Z 010D unknown /C=AU/SP=Queensland/O=Mincom Pty Ltd/OU=MTR/CN=Eric Young/Email=eay@mincom.oz.au
+V 970322074816Z 010E unknown /CN=Eric Young/Email=eay@mincom.oz.au
+V 970322075152Z 010F unknown /CN=Eric Young
+V 970322075906Z 0110 unknown /CN=Eric Youngg
+V 970324092238Z 0111 unknown /C=AU/SP=Queensland/CN=Eric Young
+V 970324221931Z 0112 unknown /CN=Fred
+V 970324224934Z 0113 unknown /C=AU/CN=eay
+V 971001005237Z 0114 unknown /C=AU/SP=QLD/O=Mincom Pty Ltd/OU=MTR/CN=x509v3 test
+V 971001010331Z 0115 unknown /C=AU/SP=Queensland/O=Mincom Pty Ltd/OU=MTR/CN=test again - x509v3
+V 971001013945Z 0117 unknown /C=AU/SP=Queensland/O=Mincom Pty Ltd/OU=MTR/CN=x509v3 test
+V 971014225415Z 0118 unknown /C=AU/SP=Queensland/CN=test
+V 971015004448Z 0119 unknown /C=AU/SP=Queensland/O=Mincom Pty Ltd/OU=MTR/CN=test2
+V 971016035001Z 011A unknown /C=AU/SP=Queensland/O=Mincom Pty Ltd/OU=MTR/CN=test64
+V 971016080129Z 011B unknown /C=FR/O=ALCATEL/OU=Alcatel Mobile Phones/CN=bourque/Email=bourque@art.alcatel.fr
+V 971016224000Z 011D unknown /L=Bedford/O=Cranfield University/OU=Computer Centre/CN=Peter R Lister/Email=P.Lister@cranfield.ac.uk
diff --git a/openssl-1.1.0h/apps/demoCA/private/cakey.pem b/openssl-1.1.0h/apps/demoCA/private/cakey.pem
new file mode 100644
index 0000000..48fb18c
--- /dev/null
+++ b/openssl-1.1.0h/apps/demoCA/private/cakey.pem
@@ -0,0 +1,24 @@
+issuer= /C=AU/SOP=QLD/O=Mincom Pty. Ltd./OU=CS/CN=CA
+subject=/C=AU/SOP=QLD/O=Mincom Pty. Ltd./OU=CS/CN=SSLeay demo server
+-----BEGIN X509 CERTIFICATE-----
+
+MIIBgjCCASwCAQQwDQYJKoZIhvcNAQEEBQAwODELMAkGA1UEBhMCQVUxDDAKBgNV
+BAgTA1FMRDEbMBkGA1UEAxMSU1NMZWF5L3JzYSB0ZXN0IENBMB4XDTk1MTAwOTIz
+MzIwNVoXDTk4MDcwNTIzMzIwNVowYDELMAkGA1UEBhMCQVUxDDAKBgNVBAgTA1FM
+RDEZMBcGA1UEChMQTWluY29tIFB0eS4gTHRkLjELMAkGA1UECxMCQ1MxGzAZBgNV
+BAMTElNTTGVheSBkZW1vIHNlcnZlcjBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC3
+LCXcScWua0PFLkHBLm2VejqpA1F4RQ8q0VjRiPafjx/Z/aWH3ipdMVvuJGa/wFXb
+/nDFLDlfWp+oCPwhBtVPAgMBAAEwDQYJKoZIhvcNAQEEBQADQQArNFsihWIjBzb0
+DCsU0BvL2bvSwJrPEqFlkDq3F4M6EGutL9axEcANWgbbEdAvNJD1dmEmoWny27Pn
+IMs6ZOZB
+-----END X509 CERTIFICATE-----
+-----BEGIN RSA PRIVATE KEY-----
+
+MIIBPAIBAAJBALcsJdxJxa5rQ8UuQcEubZV6OqkDUXhFDyrRWNGI9p+PH9n9pYfe
+Kl0xW+4kZr/AVdv+cMUsOV9an6gI/CEG1U8CAwEAAQJAXJMBZ34ZXHd1vtgL/3hZ
+hexKbVTx/djZO4imXO/dxPGRzG2ylYZpHmG32/T1kaHpZlCHoEPgHoSzmxYXfxjG
+sQIhAPmZ/bQOjmRUHM/VM2X5zrjjM6z18R1P6l3ObFwt9FGdAiEAu943Yh9SqMRw
+tL0xHGxKmM/YJueUw1gB6sLkETN71NsCIQCeT3RhoqXfrpXDoEcEU+gwzjI1bpxq
+agiNTOLfqGoA5QIhAIQFYjgzONxex7FLrsKBm16N2SFl5pXsN9SpRqqL2n63AiEA
+g9VNIQ3xwpw7og3IbONifeku+J9qGMGQJMKwSTwrFtI=
+-----END RSA PRIVATE KEY-----
diff --git a/openssl-1.1.0h/apps/demoCA/serial b/openssl-1.1.0h/apps/demoCA/serial
new file mode 100644
index 0000000..69fa0ff
--- /dev/null
+++ b/openssl-1.1.0h/apps/demoCA/serial
@@ -0,0 +1 @@
+011E
diff --git a/openssl-1.1.0h/apps/demoSRP/srp_verifier.txt b/openssl-1.1.0h/apps/demoSRP/srp_verifier.txt
new file mode 100644
index 0000000..ccae629
--- /dev/null
+++ b/openssl-1.1.0h/apps/demoSRP/srp_verifier.txt
@@ -0,0 +1,6 @@
+# This is a file that will be filled by the openssl srp routine.
+# You can initialize the file with additional groups, these are
+# records starting with a I followed by the g and N values and the id.
+# The exact values ... you have to dig this out from the source of srp.c
+# or srp_vfy.c
+# The last value of an I is used as the default group for new users.
diff --git a/openssl-1.1.0h/apps/demoSRP/srp_verifier.txt.attr b/openssl-1.1.0h/apps/demoSRP/srp_verifier.txt.attr
new file mode 100644
index 0000000..8f7e63a
--- /dev/null
+++ b/openssl-1.1.0h/apps/demoSRP/srp_verifier.txt.attr
@@ -0,0 +1 @@
+unique_subject = yes
diff --git a/openssl-1.1.0h/apps/dgst.c b/openssl-1.1.0h/apps/dgst.c
new file mode 100644
index 0000000..08182e2
--- /dev/null
+++ b/openssl-1.1.0h/apps/dgst.c
@@ -0,0 +1,480 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "apps.h"
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#include <openssl/x509.h>
+#include <openssl/pem.h>
+#include <openssl/hmac.h>
+
+#undef BUFSIZE
+#define BUFSIZE 1024*8
+
+int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
+ EVP_PKEY *key, unsigned char *sigin, int siglen,
+ const char *sig_name, const char *md_name,
+ const char *file);
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_C, OPT_R, OPT_RAND, OPT_OUT, OPT_SIGN, OPT_PASSIN, OPT_VERIFY,
+ OPT_PRVERIFY, OPT_SIGNATURE, OPT_KEYFORM, OPT_ENGINE, OPT_ENGINE_IMPL,
+ OPT_HEX, OPT_BINARY, OPT_DEBUG, OPT_FIPS_FINGERPRINT,
+ OPT_HMAC, OPT_MAC, OPT_SIGOPT, OPT_MACOPT,
+ OPT_DIGEST
+} OPTION_CHOICE;
+
+OPTIONS dgst_options[] = {
+ {OPT_HELP_STR, 1, '-', "Usage: %s [options] [file...]\n"},
+ {OPT_HELP_STR, 1, '-',
+ " file... files to digest (default is stdin)\n"},
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"c", OPT_C, '-', "Print the digest with separating colons"},
+ {"r", OPT_R, '-', "Print the digest in coreutils format"},
+ {"rand", OPT_RAND, 's',
+ "Use file(s) containing random data to seed RNG or an EGD sock"},
+ {"out", OPT_OUT, '>', "Output to filename rather than stdout"},
+ {"passin", OPT_PASSIN, 's', "Input file pass phrase source"},
+ {"sign", OPT_SIGN, 's', "Sign digest using private key"},
+ {"verify", OPT_VERIFY, 's',
+ "Verify a signature using public key"},
+ {"prverify", OPT_PRVERIFY, 's',
+ "Verify a signature using private key"},
+ {"signature", OPT_SIGNATURE, '<', "File with signature to verify"},
+ {"keyform", OPT_KEYFORM, 'f', "Key file format (PEM or ENGINE)"},
+ {"hex", OPT_HEX, '-', "Print as hex dump"},
+ {"binary", OPT_BINARY, '-', "Print in binary form"},
+ {"d", OPT_DEBUG, '-', "Print debug info"},
+ {"debug", OPT_DEBUG, '-', "Print debug info"},
+ {"fips-fingerprint", OPT_FIPS_FINGERPRINT, '-',
+ "Compute HMAC with the key used in OpenSSL-FIPS fingerprint"},
+ {"hmac", OPT_HMAC, 's', "Create hashed MAC with key"},
+ {"mac", OPT_MAC, 's', "Create MAC (not necessarily HMAC)"},
+ {"sigopt", OPT_SIGOPT, 's', "Signature parameter in n:v form"},
+ {"macopt", OPT_MACOPT, 's', "MAC algorithm parameters in n:v form or key"},
+ {"", OPT_DIGEST, '-', "Any supported digest"},
+#ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
+ {"engine_impl", OPT_ENGINE_IMPL, '-',
+ "Also use engine given by -engine for digest operations"},
+#endif
+ {NULL}
+};
+
+int dgst_main(int argc, char **argv)
+{
+ BIO *in = NULL, *inp, *bmd = NULL, *out = NULL;
+ ENGINE *e = NULL, *impl = NULL;
+ EVP_PKEY *sigkey = NULL;
+ STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL;
+ char *hmac_key = NULL;
+ char *mac_name = NULL;
+ char *passinarg = NULL, *passin = NULL;
+ const EVP_MD *md = NULL, *m;
+ const char *outfile = NULL, *keyfile = NULL, *prog = NULL;
+ const char *sigfile = NULL, *randfile = NULL;
+ OPTION_CHOICE o;
+ int separator = 0, debug = 0, keyform = FORMAT_PEM, siglen = 0;
+ int i, ret = 1, out_bin = -1, want_pub = 0, do_verify = 0;
+ unsigned char *buf = NULL, *sigbuf = NULL;
+ int engine_impl = 0;
+
+ prog = opt_progname(argv[0]);
+ buf = app_malloc(BUFSIZE, "I/O buffer");
+ md = EVP_get_digestbyname(prog);
+
+ prog = opt_init(argc, argv, dgst_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(dgst_options);
+ ret = 0;
+ goto end;
+ case OPT_C:
+ separator = 1;
+ break;
+ case OPT_R:
+ separator = 2;
+ break;
+ case OPT_RAND:
+ randfile = opt_arg();
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_SIGN:
+ keyfile = opt_arg();
+ break;
+ case OPT_PASSIN:
+ passinarg = opt_arg();
+ break;
+ case OPT_VERIFY:
+ keyfile = opt_arg();
+ want_pub = do_verify = 1;
+ break;
+ case OPT_PRVERIFY:
+ keyfile = opt_arg();
+ do_verify = 1;
+ break;
+ case OPT_SIGNATURE:
+ sigfile = opt_arg();
+ break;
+ case OPT_KEYFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_ANY, &keyform))
+ goto opthelp;
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_ENGINE_IMPL:
+ engine_impl = 1;
+ break;
+ case OPT_HEX:
+ out_bin = 0;
+ break;
+ case OPT_BINARY:
+ out_bin = 1;
+ break;
+ case OPT_DEBUG:
+ debug = 1;
+ break;
+ case OPT_FIPS_FINGERPRINT:
+ hmac_key = "etaonrishdlcupfm";
+ break;
+ case OPT_HMAC:
+ hmac_key = opt_arg();
+ break;
+ case OPT_MAC:
+ mac_name = opt_arg();
+ break;
+ case OPT_SIGOPT:
+ if (!sigopts)
+ sigopts = sk_OPENSSL_STRING_new_null();
+ if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, opt_arg()))
+ goto opthelp;
+ break;
+ case OPT_MACOPT:
+ if (!macopts)
+ macopts = sk_OPENSSL_STRING_new_null();
+ if (!macopts || !sk_OPENSSL_STRING_push(macopts, opt_arg()))
+ goto opthelp;
+ break;
+ case OPT_DIGEST:
+ if (!opt_md(opt_unknown(), &m))
+ goto opthelp;
+ md = m;
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ argv = opt_rest();
+ if (keyfile != NULL && argc > 1) {
+ BIO_printf(bio_err, "%s: Can only sign or verify one file.\n", prog);
+ goto end;
+ }
+
+ if (do_verify && !sigfile) {
+ BIO_printf(bio_err,
+ "No signature to verify: use the -signature option\n");
+ goto end;
+ }
+ if (engine_impl)
+ impl = e;
+
+ in = BIO_new(BIO_s_file());
+ bmd = BIO_new(BIO_f_md());
+ if ((in == NULL) || (bmd == NULL)) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ if (debug) {
+ BIO_set_callback(in, BIO_debug_callback);
+ /* needed for windows 3.1 */
+ BIO_set_callback_arg(in, (char *)bio_err);
+ }
+
+ if (!app_passwd(passinarg, NULL, &passin, NULL)) {
+ BIO_printf(bio_err, "Error getting password\n");
+ goto end;
+ }
+
+ if (out_bin == -1) {
+ if (keyfile)
+ out_bin = 1;
+ else
+ out_bin = 0;
+ }
+
+ if (randfile)
+ app_RAND_load_file(randfile, 0);
+
+ out = bio_open_default(outfile, 'w', out_bin ? FORMAT_BINARY : FORMAT_TEXT);
+ if (out == NULL)
+ goto end;
+
+ if ((! !mac_name + ! !keyfile + ! !hmac_key) > 1) {
+ BIO_printf(bio_err, "MAC and Signing key cannot both be specified\n");
+ goto end;
+ }
+
+ if (keyfile) {
+ if (want_pub)
+ sigkey = load_pubkey(keyfile, keyform, 0, NULL, e, "key file");
+ else
+ sigkey = load_key(keyfile, keyform, 0, passin, e, "key file");
+ if (!sigkey) {
+ /*
+ * load_[pub]key() has already printed an appropriate message
+ */
+ goto end;
+ }
+ }
+
+ if (mac_name) {
+ EVP_PKEY_CTX *mac_ctx = NULL;
+ int r = 0;
+ if (!init_gen_str(&mac_ctx, mac_name, impl, 0))
+ goto mac_end;
+ if (macopts) {
+ char *macopt;
+ for (i = 0; i < sk_OPENSSL_STRING_num(macopts); i++) {
+ macopt = sk_OPENSSL_STRING_value(macopts, i);
+ if (pkey_ctrl_string(mac_ctx, macopt) <= 0) {
+ BIO_printf(bio_err,
+ "MAC parameter error \"%s\"\n", macopt);
+ ERR_print_errors(bio_err);
+ goto mac_end;
+ }
+ }
+ }
+ if (EVP_PKEY_keygen(mac_ctx, &sigkey) <= 0) {
+ BIO_puts(bio_err, "Error generating key\n");
+ ERR_print_errors(bio_err);
+ goto mac_end;
+ }
+ r = 1;
+ mac_end:
+ EVP_PKEY_CTX_free(mac_ctx);
+ if (r == 0)
+ goto end;
+ }
+
+ if (hmac_key) {
+ sigkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, impl,
+ (unsigned char *)hmac_key, -1);
+ if (!sigkey)
+ goto end;
+ }
+
+ if (sigkey) {
+ EVP_MD_CTX *mctx = NULL;
+ EVP_PKEY_CTX *pctx = NULL;
+ int r;
+ if (!BIO_get_md_ctx(bmd, &mctx)) {
+ BIO_printf(bio_err, "Error getting context\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ if (do_verify)
+ r = EVP_DigestVerifyInit(mctx, &pctx, md, impl, sigkey);
+ else
+ r = EVP_DigestSignInit(mctx, &pctx, md, impl, sigkey);
+ if (!r) {
+ BIO_printf(bio_err, "Error setting context\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ if (sigopts) {
+ char *sigopt;
+ for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) {
+ sigopt = sk_OPENSSL_STRING_value(sigopts, i);
+ if (pkey_ctrl_string(pctx, sigopt) <= 0) {
+ BIO_printf(bio_err, "parameter error \"%s\"\n", sigopt);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+ }
+ }
+ /* we use md as a filter, reading from 'in' */
+ else {
+ EVP_MD_CTX *mctx = NULL;
+ if (!BIO_get_md_ctx(bmd, &mctx)) {
+ BIO_printf(bio_err, "Error getting context\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ if (md == NULL)
+ md = EVP_sha256();
+ if (!EVP_DigestInit_ex(mctx, md, impl)) {
+ BIO_printf(bio_err, "Error setting digest\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (sigfile && sigkey) {
+ BIO *sigbio = BIO_new_file(sigfile, "rb");
+ if (!sigbio) {
+ BIO_printf(bio_err, "Error opening signature file %s\n", sigfile);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ siglen = EVP_PKEY_size(sigkey);
+ sigbuf = app_malloc(siglen, "signature buffer");
+ siglen = BIO_read(sigbio, sigbuf, siglen);
+ BIO_free(sigbio);
+ if (siglen <= 0) {
+ BIO_printf(bio_err, "Error reading signature file %s\n", sigfile);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+ inp = BIO_push(bmd, in);
+
+ if (md == NULL) {
+ EVP_MD_CTX *tctx;
+ BIO_get_md_ctx(bmd, &tctx);
+ md = EVP_MD_CTX_md(tctx);
+ }
+
+ if (argc == 0) {
+ BIO_set_fp(in, stdin, BIO_NOCLOSE);
+ ret = do_fp(out, buf, inp, separator, out_bin, sigkey, sigbuf,
+ siglen, NULL, NULL, "stdin");
+ } else {
+ const char *md_name = NULL, *sig_name = NULL;
+ if (!out_bin) {
+ if (sigkey) {
+ const EVP_PKEY_ASN1_METHOD *ameth;
+ ameth = EVP_PKEY_get0_asn1(sigkey);
+ if (ameth)
+ EVP_PKEY_asn1_get0_info(NULL, NULL,
+ NULL, NULL, &sig_name, ameth);
+ }
+ if (md)
+ md_name = EVP_MD_name(md);
+ }
+ ret = 0;
+ for (i = 0; i < argc; i++) {
+ int r;
+ if (BIO_read_filename(in, argv[i]) <= 0) {
+ perror(argv[i]);
+ ret++;
+ continue;
+ } else
+ r = do_fp(out, buf, inp, separator, out_bin, sigkey, sigbuf,
+ siglen, sig_name, md_name, argv[i]);
+ if (r)
+ ret = r;
+ (void)BIO_reset(bmd);
+ }
+ }
+ end:
+ OPENSSL_clear_free(buf, BUFSIZE);
+ BIO_free(in);
+ OPENSSL_free(passin);
+ BIO_free_all(out);
+ EVP_PKEY_free(sigkey);
+ sk_OPENSSL_STRING_free(sigopts);
+ sk_OPENSSL_STRING_free(macopts);
+ OPENSSL_free(sigbuf);
+ BIO_free(bmd);
+ release_engine(e);
+ return (ret);
+}
+
+int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
+ EVP_PKEY *key, unsigned char *sigin, int siglen,
+ const char *sig_name, const char *md_name,
+ const char *file)
+{
+ size_t len;
+ int i;
+
+ for (;;) {
+ i = BIO_read(bp, (char *)buf, BUFSIZE);
+ if (i < 0) {
+ BIO_printf(bio_err, "Read Error in %s\n", file);
+ ERR_print_errors(bio_err);
+ return 1;
+ }
+ if (i == 0)
+ break;
+ }
+ if (sigin) {
+ EVP_MD_CTX *ctx;
+ BIO_get_md_ctx(bp, &ctx);
+ i = EVP_DigestVerifyFinal(ctx, sigin, (unsigned int)siglen);
+ if (i > 0)
+ BIO_printf(out, "Verified OK\n");
+ else if (i == 0) {
+ BIO_printf(out, "Verification Failure\n");
+ return 1;
+ } else {
+ BIO_printf(bio_err, "Error Verifying Data\n");
+ ERR_print_errors(bio_err);
+ return 1;
+ }
+ return 0;
+ }
+ if (key) {
+ EVP_MD_CTX *ctx;
+ BIO_get_md_ctx(bp, &ctx);
+ len = BUFSIZE;
+ if (!EVP_DigestSignFinal(ctx, buf, &len)) {
+ BIO_printf(bio_err, "Error Signing Data\n");
+ ERR_print_errors(bio_err);
+ return 1;
+ }
+ } else {
+ len = BIO_gets(bp, (char *)buf, BUFSIZE);
+ if ((int)len < 0) {
+ ERR_print_errors(bio_err);
+ return 1;
+ }
+ }
+
+ if (binout)
+ BIO_write(out, buf, len);
+ else if (sep == 2) {
+ for (i = 0; i < (int)len; i++)
+ BIO_printf(out, "%02x", buf[i]);
+ BIO_printf(out, " *%s\n", file);
+ } else {
+ if (sig_name) {
+ BIO_puts(out, sig_name);
+ if (md_name)
+ BIO_printf(out, "-%s", md_name);
+ BIO_printf(out, "(%s)= ", file);
+ } else if (md_name)
+ BIO_printf(out, "%s(%s)= ", md_name, file);
+ else
+ BIO_printf(out, "(%s)= ", file);
+ for (i = 0; i < (int)len; i++) {
+ if (sep && (i != 0))
+ BIO_printf(out, ":");
+ BIO_printf(out, "%02x", buf[i]);
+ }
+ BIO_printf(out, "\n");
+ }
+ return 0;
+}
diff --git a/openssl-1.1.0h/apps/dh1024.pem b/openssl-1.1.0h/apps/dh1024.pem
new file mode 100644
index 0000000..f1a5e18
--- /dev/null
+++ b/openssl-1.1.0h/apps/dh1024.pem
@@ -0,0 +1,10 @@
+-----BEGIN DH PARAMETERS-----
+MIGHAoGBAP//////////yQ/aoiFowjTExmKLgNwc0SkCTgiKZ8x0Agu+pjsTmyJR
+Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL
+/1y29Aa37e44a/taiZ+lrp8kEXxLH+ZJKGZR7OZTgf//////////AgEC
+-----END DH PARAMETERS-----
+
+These are the 1024-bit DH parameters from "Internet Key Exchange
+Protocol Version 2 (IKEv2)": https://tools.ietf.org/html/rfc5996
+
+See https://tools.ietf.org/html/rfc2412 for how they were generated.
diff --git a/openssl-1.1.0h/apps/dh2048.pem b/openssl-1.1.0h/apps/dh2048.pem
new file mode 100644
index 0000000..e899f2e
--- /dev/null
+++ b/openssl-1.1.0h/apps/dh2048.pem
@@ -0,0 +1,14 @@
+-----BEGIN DH PARAMETERS-----
+MIIBCAKCAQEA///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxOb
+IlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjft
+awv/XLb0Brft7jhr+1qJn6WunyQRfEsf5kkoZlHs5Fs9wgB8uKFjvwWY2kg2HFXT
+mmkWP6j9JM9fg2VdI9yjrZYcYvNWIIVSu57VKQdwlpZtZww1Tkq8mATxdGwIyhgh
+fDKQXkYuNs474553LBgOhgObJ4Oi7Aeij7XFXfBvTFLJ3ivL9pVYFxg5lUl86pVq
+5RXSJhiY+gUQFXKOWoqsqmj//////////wIBAg==
+-----END DH PARAMETERS-----
+
+These are the 2048-bit DH parameters from "More Modular Exponential
+(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)":
+https://tools.ietf.org/html/rfc3526
+
+See https://tools.ietf.org/html/rfc2412 for how they were generated.
diff --git a/openssl-1.1.0h/apps/dh4096.pem b/openssl-1.1.0h/apps/dh4096.pem
new file mode 100644
index 0000000..adada2b
--- /dev/null
+++ b/openssl-1.1.0h/apps/dh4096.pem
@@ -0,0 +1,19 @@
+-----BEGIN DH PARAMETERS-----
+MIICCAKCAgEA///////////JD9qiIWjCNMTGYouA3BzRKQJOCIpnzHQCC76mOxOb
+IlFKCHmONATd75UZs806QxswKwpt8l8UN0/hNW1tUcJF5IW1dmJefsb0TELppjft
+awv/XLb0Brft7jhr+1qJn6WunyQRfEsf5kkoZlHs5Fs9wgB8uKFjvwWY2kg2HFXT
+mmkWP6j9JM9fg2VdI9yjrZYcYvNWIIVSu57VKQdwlpZtZww1Tkq8mATxdGwIyhgh
+fDKQXkYuNs474553LBgOhgObJ4Oi7Aeij7XFXfBvTFLJ3ivL9pVYFxg5lUl86pVq
+5RXSJhiY+gUQFXKOWoqqxC2tMxcNBFB6M6hVIavfHLpk7PuFBFjb7wqK6nFXXQYM
+fbOXD4Wm4eTHq/WujNsJM9cejJTgSiVhnc7j0iYa0u5r8S/6BtmKCGTYdgJzPshq
+ZFIfKxgXeyAMu+EXV3phXWx3CYjAutlG4gjiT6B05asxQ9tb/OD9EI5LgtEgqSEI
+ARpyPBKnh+bXiHGaEL26WyaZwycYavTiPBqUaDS2FQvaJYPpyirUTOjbu8LbBN6O
++S6O/BQfvsqmKHxZR05rwF2ZspZPoJDDoiM7oYZRW+ftH2EpcM7i16+4G912IXBI
+HNAGkSfVsFqpk7TqmI2P3cGG/7fckKbAj030Nck0BjGZ//////////8CAQI=
+-----END DH PARAMETERS-----
+
+These are the 4096-bit DH parameters from "More Modular Exponential
+(MODP) Diffie-Hellman groups for Internet Key Exchange (IKE)":
+https://tools.ietf.org/html/rfc3526
+
+See https://tools.ietf.org/html/rfc2412 for how they were generated.
diff --git a/openssl-1.1.0h/apps/dhparam.c b/openssl-1.1.0h/apps/dhparam.c
new file mode 100644
index 0000000..94322e3
--- /dev/null
+++ b/openssl-1.1.0h/apps/dhparam.c
@@ -0,0 +1,392 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DH
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <time.h>
+# include <string.h>
+# include "apps.h"
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/bn.h>
+# include <openssl/dh.h>
+# include <openssl/x509.h>
+# include <openssl/pem.h>
+
+# ifndef OPENSSL_NO_DSA
+# include <openssl/dsa.h>
+# endif
+
+# define DEFBITS 2048
+
+static int dh_cb(int p, int n, BN_GENCB *cb);
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT,
+ OPT_ENGINE, OPT_CHECK, OPT_TEXT, OPT_NOOUT,
+ OPT_RAND, OPT_DSAPARAM, OPT_C, OPT_2, OPT_5
+} OPTION_CHOICE;
+
+OPTIONS dhparam_options[] = {
+ {OPT_HELP_STR, 1, '-', "Usage: %s [flags] [numbits]\n"},
+ {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"in", OPT_IN, '<', "Input file"},
+ {"inform", OPT_INFORM, 'F', "Input format, DER or PEM"},
+ {"outform", OPT_OUTFORM, 'F', "Output format, DER or PEM"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"check", OPT_CHECK, '-', "Check the DH parameters"},
+ {"text", OPT_TEXT, '-', "Print a text form of the DH parameters"},
+ {"noout", OPT_NOOUT, '-', "Don't output any DH parameters"},
+ {"rand", OPT_RAND, 's',
+ "Load the file(s) into the random number generator"},
+ {"C", OPT_C, '-', "Print C code"},
+ {"2", OPT_2, '-', "Generate parameters using 2 as the generator value"},
+ {"5", OPT_5, '-', "Generate parameters using 5 as the generator value"},
+# ifndef OPENSSL_NO_DSA
+ {"dsaparam", OPT_DSAPARAM, '-',
+ "Read or generate DSA parameters, convert to DH"},
+# endif
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
+# endif
+ {NULL}
+};
+
+int dhparam_main(int argc, char **argv)
+{
+ BIO *in = NULL, *out = NULL;
+ DH *dh = NULL;
+ char *infile = NULL, *outfile = NULL, *prog, *inrand = NULL;
+ ENGINE *e = NULL;
+#ifndef OPENSSL_NO_DSA
+ int dsaparam = 0;
+#endif
+ int i, text = 0, C = 0, ret = 1, num = 0, g = 0;
+ int informat = FORMAT_PEM, outformat = FORMAT_PEM, check = 0, noout = 0;
+ OPTION_CHOICE o;
+
+ prog = opt_init(argc, argv, dhparam_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(dhparam_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+ goto opthelp;
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_CHECK:
+ check = 1;
+ break;
+ case OPT_TEXT:
+ text = 1;
+ break;
+ case OPT_DSAPARAM:
+#ifndef OPENSSL_NO_DSA
+ dsaparam = 1;
+#endif
+ break;
+ case OPT_C:
+ C = 1;
+ break;
+ case OPT_2:
+ g = 2;
+ break;
+ case OPT_5:
+ g = 5;
+ break;
+ case OPT_NOOUT:
+ noout = 1;
+ break;
+ case OPT_RAND:
+ inrand = opt_arg();
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ argv = opt_rest();
+
+ if (argv[0] && (!opt_int(argv[0], &num) || num <= 0))
+ goto end;
+
+ if (g && !num)
+ num = DEFBITS;
+
+# ifndef OPENSSL_NO_DSA
+ if (dsaparam && g) {
+ BIO_printf(bio_err,
+ "generator may not be chosen for DSA parameters\n");
+ goto end;
+ }
+# endif
+ /* DH parameters */
+ if (num && !g)
+ g = 2;
+
+ if (num) {
+
+ BN_GENCB *cb;
+ cb = BN_GENCB_new();
+ if (cb == NULL) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ BN_GENCB_set(cb, dh_cb, bio_err);
+ if (!app_RAND_load_file(NULL, 1) && inrand == NULL) {
+ BIO_printf(bio_err,
+ "warning, not much extra random data, consider using the -rand option\n");
+ }
+ if (inrand != NULL)
+ BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
+ app_RAND_load_files(inrand));
+
+# ifndef OPENSSL_NO_DSA
+ if (dsaparam) {
+ DSA *dsa = DSA_new();
+
+ BIO_printf(bio_err,
+ "Generating DSA parameters, %d bit long prime\n", num);
+ if (dsa == NULL
+ || !DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL,
+ cb)) {
+ DSA_free(dsa);
+ BN_GENCB_free(cb);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ dh = DSA_dup_DH(dsa);
+ DSA_free(dsa);
+ if (dh == NULL) {
+ BN_GENCB_free(cb);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ } else
+# endif
+ {
+ dh = DH_new();
+ BIO_printf(bio_err,
+ "Generating DH parameters, %d bit long safe prime, generator %d\n",
+ num, g);
+ BIO_printf(bio_err, "This is going to take a long time\n");
+ if (dh == NULL || !DH_generate_parameters_ex(dh, num, g, cb)) {
+ BN_GENCB_free(cb);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ BN_GENCB_free(cb);
+ app_RAND_write_file(NULL);
+ } else {
+
+ in = bio_open_default(infile, 'r', informat);
+ if (in == NULL)
+ goto end;
+
+# ifndef OPENSSL_NO_DSA
+ if (dsaparam) {
+ DSA *dsa;
+
+ if (informat == FORMAT_ASN1)
+ dsa = d2i_DSAparams_bio(in, NULL);
+ else /* informat == FORMAT_PEM */
+ dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL);
+
+ if (dsa == NULL) {
+ BIO_printf(bio_err, "unable to load DSA parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ dh = DSA_dup_DH(dsa);
+ DSA_free(dsa);
+ if (dh == NULL) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ } else
+# endif
+ {
+ if (informat == FORMAT_ASN1) {
+ /*
+ * We have no PEM header to determine what type of DH params it
+ * is. We'll just try both.
+ */
+ dh = d2i_DHparams_bio(in, NULL);
+ /* BIO_reset() returns 0 for success for file BIOs only!!! */
+ if (dh == NULL && BIO_reset(in) == 0)
+ dh = d2i_DHxparams_bio(in, NULL);
+ } else {
+ /* informat == FORMAT_PEM */
+ dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
+ }
+
+ if (dh == NULL) {
+ BIO_printf(bio_err, "unable to load DH parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ /* dh != NULL */
+ }
+
+ out = bio_open_default(outfile, 'w', outformat);
+ if (out == NULL)
+ goto end;
+
+ if (text) {
+ DHparams_print(out, dh);
+ }
+
+ if (check) {
+ if (!DH_check(dh, &i)) {
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ if (i & DH_CHECK_P_NOT_PRIME)
+ BIO_printf(bio_err, "WARNING: p value is not prime\n");
+ if (i & DH_CHECK_P_NOT_SAFE_PRIME)
+ BIO_printf(bio_err, "WARNING: p value is not a safe prime\n");
+ if (i & DH_CHECK_Q_NOT_PRIME)
+ BIO_printf(bio_err, "WARNING: q value is not a prime\n");
+ if (i & DH_CHECK_INVALID_Q_VALUE)
+ BIO_printf(bio_err, "WARNING: q value is invalid\n");
+ if (i & DH_CHECK_INVALID_J_VALUE)
+ BIO_printf(bio_err, "WARNING: j value is invalid\n");
+ if (i & DH_UNABLE_TO_CHECK_GENERATOR)
+ BIO_printf(bio_err,
+ "WARNING: unable to check the generator value\n");
+ if (i & DH_NOT_SUITABLE_GENERATOR)
+ BIO_printf(bio_err, "WARNING: the g value is not a generator\n");
+ if (i == 0)
+ BIO_printf(bio_err, "DH parameters appear to be ok.\n");
+ if (num != 0 && i != 0) {
+ /*
+ * We have generated parameters but DH_check() indicates they are
+ * invalid! This should never happen!
+ */
+ BIO_printf(bio_err, "ERROR: Invalid parameters generated\n");
+ goto end;
+ }
+ }
+ if (C) {
+ unsigned char *data;
+ int len, bits;
+ const BIGNUM *pbn, *gbn;
+
+ len = DH_size(dh);
+ bits = DH_bits(dh);
+ DH_get0_pqg(dh, &pbn, NULL, &gbn);
+ data = app_malloc(len, "print a BN");
+ BIO_printf(out, "#ifndef HEADER_DH_H\n"
+ "# include <openssl/dh.h>\n"
+ "#endif\n"
+ "\n");
+ BIO_printf(out, "DH *get_dh%d()\n{\n", bits);
+ print_bignum_var(out, pbn, "dhp", bits, data);
+ print_bignum_var(out, gbn, "dhg", bits, data);
+ BIO_printf(out, " DH *dh = DH_new();\n"
+ " BIGNUM *dhp_bn, *dhg_bn;\n"
+ "\n"
+ " if (dh == NULL)\n"
+ " return NULL;\n");
+ BIO_printf(out, " dhp_bn = BN_bin2bn(dhp_%d, sizeof(dhp_%d), NULL);\n",
+ bits, bits);
+ BIO_printf(out, " dhg_bn = BN_bin2bn(dhg_%d, sizeof(dhg_%d), NULL);\n",
+ bits, bits);
+ BIO_printf(out, " if (dhp_bn == NULL || dhg_bn == NULL\n"
+ " || !DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn)) {\n"
+ " DH_free(dh);\n"
+ " BN_free(dhp_bn);\n"
+ " BN_free(dhg_bn);\n"
+ " return NULL;\n"
+ " }\n");
+ if (DH_get_length(dh) > 0)
+ BIO_printf(out,
+ " if (!DH_set_length(dh, %ld)) {\n"
+ " DH_free(dh);\n"
+ " }\n", DH_get_length(dh));
+ BIO_printf(out, " return dh;\n}\n");
+ OPENSSL_free(data);
+ }
+
+ if (!noout) {
+ const BIGNUM *q;
+ DH_get0_pqg(dh, NULL, &q, NULL);
+ if (outformat == FORMAT_ASN1) {
+ if (q != NULL)
+ i = i2d_DHxparams_bio(out, dh);
+ else
+ i = i2d_DHparams_bio(out, dh);
+ } else if (q != NULL)
+ i = PEM_write_bio_DHxparams(out, dh);
+ else
+ i = PEM_write_bio_DHparams(out, dh);
+ if (!i) {
+ BIO_printf(bio_err, "unable to write DH parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+ ret = 0;
+ end:
+ BIO_free(in);
+ BIO_free_all(out);
+ DH_free(dh);
+ release_engine(e);
+ return (ret);
+}
+
+static int dh_cb(int p, int n, BN_GENCB *cb)
+{
+ char c = '*';
+
+ if (p == 0)
+ c = '.';
+ if (p == 1)
+ c = '+';
+ if (p == 2)
+ c = '*';
+ if (p == 3)
+ c = '\n';
+ BIO_write(BN_GENCB_get_arg(cb), &c, 1);
+ (void)BIO_flush(BN_GENCB_get_arg(cb));
+ return 1;
+}
+#endif
diff --git a/openssl-1.1.0h/apps/dsa-ca.pem b/openssl-1.1.0h/apps/dsa-ca.pem
new file mode 100644
index 0000000..3ce8dc6
--- /dev/null
+++ b/openssl-1.1.0h/apps/dsa-ca.pem
@@ -0,0 +1,47 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBugIBAAKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQ
+PnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtel
+u+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcH
+Me36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLso
+hkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbu
+SXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7Y
+Mu0OArgCgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuHvSLw9YUrJahcBHmbpvt4
+94lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUqAylOVFJJJXuirVJ+o+0T
+tOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u3enxhqnDGQIUB78dhW77
+J6zsFbSEHaQGUmfSeoM=
+-----END DSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE REQUEST-----
+MIICVjCCAhMCAQAwUjELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
+ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDELMAkGA1UEAwwCQ0Ew
+ggG2MIIBKwYHKoZIzjgEATCCAR4CgYEApz9uhb9Bail98J9HGTCQmgkd2mozHsU9
+hpazFeBTLo/gWYJzkD51MZlHelL7heTZpns4m2iKhJuHxh61foZLU1tZz3FlGYhu
+zmaua4g2++wo3MLXpbvlLDkmS9qacBiVN5UQViP2Fe26BF7eOU/9t0MftaRlb82A
+EeRwlVtQzUkCFQD3BzHt+mwGA9WFihysnGXnUGZlbwKBgE3fTAOmkYr1GW9QRiWZ
+5WhvMONp4eWzXZi7KIZI/N6ZBD9fiAyccyQNIF25Kpo/GJYn5GKHwXt0YlP8YSeo
+epEJnbbxTZxUD1gG7kl0B85VfiPOFvbK3FphAX7JcbVN9tw0KYdo9l4gk7Pb9eQJ
+bEEXlZLrAbVzpWp+2DLtDgK4A4GEAAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfs
+i4e9IvD1hSslqFwEeZum+3j3iUXiALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj2
+5SoDKU5UUkkle6KtUn6j7RO04UMhMQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17
+ry7d6fGGqcMZoAAwCwYJYIZIAWUDBAMCAzAAMC0CFCp7rUwGJNtxK6Aqo6k6US+S
+KP8sAhUAyfSi8Zs3QAvkJoFG0IMRaq8M03I=
+-----END CERTIFICATE REQUEST-----
+-----BEGIN CERTIFICATE-----
+MIIDMDCCAuygAwIBAgIBAjALBglghkgBZQMEAwIwUzELMAkGA1UEBhMCQVUxEzAR
+BgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5
+IEx0ZDEMMAoGA1UEAwwDUENBMCAXDTE2MDExMzIxNDE0OVoYDzMwMTUwNTE2MjE0
+MTQ5WjBSMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UE
+CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDDAJDQTCCAbYwggEr
+BgcqhkjOOAQBMIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMu
+j+BZgnOQPnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb7
+7Cjcwtelu+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DN
+SQIVAPcHMe36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh
+5bNdmLsohkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFN
+nFQPWAbuSXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusB
+tXOlan7YMu0OArgDgYQAAoGAGqZZeoqs/V62RZZNhglXAfioocVpx+yLh70i8PWF
+KyWoXAR5m6b7ePeJReIAucN1jzPr1yaH27rJOBqEBBLEDTA2moeJuPblKgMpTlRS
+SSV7oq1SfqPtE7ThQyExAJfmGWWq4lzg+7XTkjpfUSzDwuvnWhykvXuvLt3p8Yap
+wxmjUDBOMB0GA1UdDgQWBBTMZcORcBEVlqO/CD4pf4V6N1NM1zAfBgNVHSMEGDAW
+gBTGjwJ33uvjSa20RNrMKWoGptOLdDAMBgNVHRMEBTADAQH/MAsGCWCGSAFlAwQD
+AgMxADAuAhUA4V6MrHufG8R79E+AtVO02olPxK8CFQDkZyo/TWpavsUBRDJbCeD9
+jgjIkA==
+-----END CERTIFICATE-----
diff --git a/openssl-1.1.0h/apps/dsa-pca.pem b/openssl-1.1.0h/apps/dsa-pca.pem
new file mode 100644
index 0000000..a51a06e
--- /dev/null
+++ b/openssl-1.1.0h/apps/dsa-pca.pem
@@ -0,0 +1,47 @@
+-----BEGIN DSA PRIVATE KEY-----
+MIIBvAIBAAKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQ
+PnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtel
+u+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcH
+Me36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLso
+hkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbu
+SXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7Y
+Mu0OArgCgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk
+umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A
+29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUCFQDNvrBz
+6TicfImU7UFRn9h00j0lJQ==
+-----END DSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE REQUEST-----
+MIICWDCCAhUCAQAwUzELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx
+ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAwwDUENB
+MIIBtzCCASsGByqGSM44BAEwggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7F
+PYaWsxXgUy6P4FmCc5A+dTGZR3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmI
+bs5mrmuINvvsKNzC16W75Sw5JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/N
+gBHkcJVbUM1JAhUA9wcx7fpsBgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYl
+meVobzDjaeHls12YuyiGSPzemQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEn
+qHqRCZ228U2cVA9YBu5JdAfOVX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/Xk
+CWxBF5WS6wG1c6Vqftgy7Q4CuAOBhQACgYEApu25HkB1b4gKMIV7aLGNSIknMzYg
+rB7o1kQxeDf34dDVRM9OZ8tkumz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQ
+lNnKvbtlmMDULpqkZJD0bO7A29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgT
+mvTPT2j9TPjq7RWgADALBglghkgBZQMEAwIDMAAwLQIVAPA6/jxCT1D2HgzE4iZR
+AEup/C7YAhRPLTQvQnAiS5FRrA+8SwBLvDAsaw==
+-----END CERTIFICATE REQUEST-----
+-----BEGIN CERTIFICATE-----
+MIIDMDCCAu6gAwIBAgIBATALBglghkgBZQMEAwIwUzELMAkGA1UEBhMCQVUxEzAR
+BgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5
+IEx0ZDEMMAoGA1UEAwwDUENBMCAXDTE2MDExMzIxNDE0OVoYDzMwMTUwNTE2MjE0
+MTQ5WjBTMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UE
+CgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDDANQQ0EwggG3MIIB
+KwYHKoZIzjgEATCCAR4CgYEApz9uhb9Bail98J9HGTCQmgkd2mozHsU9hpazFeBT
+Lo/gWYJzkD51MZlHelL7heTZpns4m2iKhJuHxh61foZLU1tZz3FlGYhuzmaua4g2
+++wo3MLXpbvlLDkmS9qacBiVN5UQViP2Fe26BF7eOU/9t0MftaRlb82AEeRwlVtQ
+zUkCFQD3BzHt+mwGA9WFihysnGXnUGZlbwKBgE3fTAOmkYr1GW9QRiWZ5WhvMONp
+4eWzXZi7KIZI/N6ZBD9fiAyccyQNIF25Kpo/GJYn5GKHwXt0YlP8YSeoepEJnbbx
+TZxUD1gG7kl0B85VfiPOFvbK3FphAX7JcbVN9tw0KYdo9l4gk7Pb9eQJbEEXlZLr
+AbVzpWp+2DLtDgK4A4GFAAKBgQCm7bkeQHVviAowhXtosY1IiSczNiCsHujWRDF4
+N/fh0NVEz05ny2S6bPq2X6JRw17kSjF2xhXUhdJ12M6LTws4uxmrsBCU2cq9u2WY
+wNQumqRkkPRs7sDb2eKwl8rLVRGoAEvDkOB9w+HVkte2YN9SAm+aOBOa9M9PaP1M
++OrtFaNQME4wHQYDVR0OBBYEFMaPAnfe6+NJrbRE2swpagam04t0MB8GA1UdIwQY
+MBaAFMaPAnfe6+NJrbRE2swpagam04t0MAwGA1UdEwQFMAMBAf8wCwYJYIZIAWUD
+BAMCAy8AMCwCFFhdz4fzQo9BBF20U1CHldYTi/D7AhQydDnDMj21y+U1UhDZJrvh
+lnt88g==
+-----END CERTIFICATE-----
diff --git a/openssl-1.1.0h/apps/dsa.c b/openssl-1.1.0h/apps/dsa.c
new file mode 100644
index 0000000..8454b2e
--- /dev/null
+++ b/openssl-1.1.0h/apps/dsa.c
@@ -0,0 +1,265 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <time.h>
+# include "apps.h"
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/dsa.h>
+# include <openssl/evp.h>
+# include <openssl/x509.h>
+# include <openssl/pem.h>
+# include <openssl/bn.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_ENGINE,
+ /* Do not change the order here; see case statements below */
+ OPT_PVK_NONE, OPT_PVK_WEAK, OPT_PVK_STRONG,
+ OPT_NOOUT, OPT_TEXT, OPT_MODULUS, OPT_PUBIN,
+ OPT_PUBOUT, OPT_CIPHER, OPT_PASSIN, OPT_PASSOUT
+} OPTION_CHOICE;
+
+OPTIONS dsa_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"inform", OPT_INFORM, 'f', "Input format, DER PEM PVK"},
+ {"outform", OPT_OUTFORM, 'f', "Output format, DER PEM PVK"},
+ {"in", OPT_IN, 's', "Input key"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"noout", OPT_NOOUT, '-', "Don't print key out"},
+ {"text", OPT_TEXT, '-', "Print the key in text"},
+ {"modulus", OPT_MODULUS, '-', "Print the DSA public value"},
+ {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"},
+ {"pubout", OPT_PUBOUT, '-', "Output public key, not private"},
+ {"passin", OPT_PASSIN, 's', "Input file pass phrase source"},
+ {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"},
+ {"", OPT_CIPHER, '-', "Any supported cipher"},
+# ifndef OPENSSL_NO_RC4
+ {"pvk-strong", OPT_PVK_STRONG, '-', "Enable 'Strong' PVK encoding level (default)"},
+ {"pvk-weak", OPT_PVK_WEAK, '-', "Enable 'Weak' PVK encoding level"},
+ {"pvk-none", OPT_PVK_NONE, '-', "Don't enforce PVK encoding"},
+# endif
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
+# endif
+ {NULL}
+};
+
+int dsa_main(int argc, char **argv)
+{
+ BIO *out = NULL;
+ DSA *dsa = NULL;
+ ENGINE *e = NULL;
+ const EVP_CIPHER *enc = NULL;
+ char *infile = NULL, *outfile = NULL, *prog;
+ char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
+ OPTION_CHOICE o;
+ int informat = FORMAT_PEM, outformat = FORMAT_PEM, text = 0, noout = 0;
+ int i, modulus = 0, pubin = 0, pubout = 0, ret = 1;
+# ifndef OPENSSL_NO_RC4
+ int pvk_encr = 2;
+# endif
+ int private = 0;
+
+ prog = opt_init(argc, argv, dsa_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ ret = 0;
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(dsa_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_ANY, &informat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_ANY, &outformat))
+ goto opthelp;
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_PASSIN:
+ passinarg = opt_arg();
+ break;
+ case OPT_PASSOUT:
+ passoutarg = opt_arg();
+ break;
+ case OPT_PVK_STRONG: /* pvk_encr:= 2 */
+ case OPT_PVK_WEAK: /* pvk_encr:= 1 */
+ case OPT_PVK_NONE: /* pvk_encr:= 0 */
+#ifndef OPENSSL_NO_RC4
+ pvk_encr = (o - OPT_PVK_NONE);
+#endif
+ break;
+ case OPT_NOOUT:
+ noout = 1;
+ break;
+ case OPT_TEXT:
+ text = 1;
+ break;
+ case OPT_MODULUS:
+ modulus = 1;
+ break;
+ case OPT_PUBIN:
+ pubin = 1;
+ break;
+ case OPT_PUBOUT:
+ pubout = 1;
+ break;
+ case OPT_CIPHER:
+ if (!opt_cipher(opt_unknown(), &enc))
+ goto end;
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ if (argc != 0)
+ goto opthelp;
+
+ private = pubin || pubout ? 0 : 1;
+ if (text && !pubin)
+ private = 1;
+
+ if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
+ BIO_printf(bio_err, "Error getting passwords\n");
+ goto end;
+ }
+
+ BIO_printf(bio_err, "read DSA key\n");
+ {
+ EVP_PKEY *pkey;
+
+ if (pubin)
+ pkey = load_pubkey(infile, informat, 1, passin, e, "Public Key");
+ else
+ pkey = load_key(infile, informat, 1, passin, e, "Private Key");
+
+ if (pkey) {
+ dsa = EVP_PKEY_get1_DSA(pkey);
+ EVP_PKEY_free(pkey);
+ }
+ }
+ if (dsa == NULL) {
+ BIO_printf(bio_err, "unable to load Key\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ out = bio_open_owner(outfile, outformat, private);
+ if (out == NULL)
+ goto end;
+
+ if (text) {
+ assert(pubin || private);
+ if (!DSA_print(out, dsa, 0)) {
+ perror(outfile);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (modulus) {
+ const BIGNUM *pub_key = NULL;
+ DSA_get0_key(dsa, &pub_key, NULL);
+ BIO_printf(out, "Public Key=");
+ BN_print(out, pub_key);
+ BIO_printf(out, "\n");
+ }
+
+ if (noout) {
+ ret = 0;
+ goto end;
+ }
+ BIO_printf(bio_err, "writing DSA key\n");
+ if (outformat == FORMAT_ASN1) {
+ if (pubin || pubout)
+ i = i2d_DSA_PUBKEY_bio(out, dsa);
+ else {
+ assert(private);
+ i = i2d_DSAPrivateKey_bio(out, dsa);
+ }
+ } else if (outformat == FORMAT_PEM) {
+ if (pubin || pubout)
+ i = PEM_write_bio_DSA_PUBKEY(out, dsa);
+ else {
+ assert(private);
+ i = PEM_write_bio_DSAPrivateKey(out, dsa, enc,
+ NULL, 0, NULL, passout);
+ }
+# ifndef OPENSSL_NO_RSA
+ } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
+ EVP_PKEY *pk;
+ pk = EVP_PKEY_new();
+ if (pk == NULL)
+ goto end;
+
+ EVP_PKEY_set1_DSA(pk, dsa);
+ if (outformat == FORMAT_PVK) {
+ if (pubin) {
+ BIO_printf(bio_err, "PVK form impossible with public key input\n");
+ EVP_PKEY_free(pk);
+ goto end;
+ }
+ assert(private);
+# ifdef OPENSSL_NO_RC4
+ BIO_printf(bio_err, "PVK format not supported\n");
+ EVP_PKEY_free(pk);
+ goto end;
+# else
+ i = i2b_PVK_bio(out, pk, pvk_encr, 0, passout);
+# endif
+ }
+ else if (pubin || pubout)
+ i = i2b_PublicKey_bio(out, pk);
+ else {
+ assert(private);
+ i = i2b_PrivateKey_bio(out, pk);
+ }
+ EVP_PKEY_free(pk);
+# endif
+ } else {
+ BIO_printf(bio_err, "bad output format specified for outfile\n");
+ goto end;
+ }
+ if (i <= 0) {
+ BIO_printf(bio_err, "unable to write private key\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ ret = 0;
+ end:
+ BIO_free_all(out);
+ DSA_free(dsa);
+ release_engine(e);
+ OPENSSL_free(passin);
+ OPENSSL_free(passout);
+ return (ret);
+}
+#endif
diff --git a/openssl-1.1.0h/apps/dsa1024.pem b/openssl-1.1.0h/apps/dsa1024.pem
new file mode 100644
index 0000000..082dec3
--- /dev/null
+++ b/openssl-1.1.0h/apps/dsa1024.pem
@@ -0,0 +1,9 @@
+-----BEGIN DSA PARAMETERS-----
+MIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQPnUx
+mUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtelu+Us
+OSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcHMe36
+bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLsohkj8
+3pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbuSXQH
+zlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7YMu0O
+Arg=
+-----END DSA PARAMETERS-----
diff --git a/openssl-1.1.0h/apps/dsa512.pem b/openssl-1.1.0h/apps/dsa512.pem
new file mode 100644
index 0000000..5f86d1a
--- /dev/null
+++ b/openssl-1.1.0h/apps/dsa512.pem
@@ -0,0 +1,6 @@
+-----BEGIN DSA PARAMETERS-----
+MIGdAkEAnRtpjibb8isRcBmG9hnI+BnyGFOURgbQYlAzSwI8UjADizv5X9EkBk97
+TLqqQJv9luQ3M7stWtdaEUBmonZ9MQIVAPtT71C0QJIxVoZTeuiLIppJ+3GPAkEA
+gz6I5cWJc847bAFJv7PHnwrqRJHlMKrZvltftxDXibeOdPvPKR7rqCxUUbgQ3qDO
+L8wka5B33qJoplISogOdIA==
+-----END DSA PARAMETERS-----
diff --git a/openssl-1.1.0h/apps/dsap.pem b/openssl-1.1.0h/apps/dsap.pem
new file mode 100644
index 0000000..d4dfdb3
--- /dev/null
+++ b/openssl-1.1.0h/apps/dsap.pem
@@ -0,0 +1,6 @@
+-----BEGIN DSA PARAMETERS-----
+MIGcAkEA+ZiKEvZmc9MtnaFZh4NiZ3oZS4J1PHvPrm9MXj5ntVheDPkdmBDTncya
+GAJcMjwsyB/GvLDGd6yGCw/8eF+09wIVAK3VagOxGd/Q4Af5NbxR5FB7CXEjAkA2
+t/q7HgVLi0KeKvcDG8BRl3wuy7bCvpjgtWiJc/tpvcuzeuAayH89UofjAGueKjXD
+ADiRffvSdhrNw5dkqdql
+-----END DSA PARAMETERS-----
diff --git a/openssl-1.1.0h/apps/dsaparam.c b/openssl-1.1.0h/apps/dsaparam.c
new file mode 100644
index 0000000..5c3c8f8
--- /dev/null
+++ b/openssl-1.1.0h/apps/dsaparam.c
@@ -0,0 +1,316 @@
+/*
+ * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <time.h>
+# include <string.h>
+# include "apps.h"
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/bn.h>
+# include <openssl/dsa.h>
+# include <openssl/x509.h>
+# include <openssl/pem.h>
+
+# ifdef GENCB_TEST
+
+static int stop_keygen_flag = 0;
+
+static void timebomb_sigalarm(int foo)
+{
+ stop_keygen_flag = 1;
+}
+
+# endif
+
+static int dsa_cb(int p, int n, BN_GENCB *cb);
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_TEXT, OPT_C,
+ OPT_NOOUT, OPT_GENKEY, OPT_RAND, OPT_ENGINE,
+ OPT_TIMEBOMB
+} OPTION_CHOICE;
+
+OPTIONS dsaparam_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"},
+ {"in", OPT_IN, '<', "Input file"},
+ {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"text", OPT_TEXT, '-', "Print as text"},
+ {"C", OPT_C, '-', "Output C code"},
+ {"noout", OPT_NOOUT, '-', "No output"},
+ {"genkey", OPT_GENKEY, '-', "Generate a DSA key"},
+ {"rand", OPT_RAND, 's', "Files to use for random number input"},
+# ifdef GENCB_TEST
+ {"timebomb", OPT_TIMEBOMB, 'p', "Interrupt keygen after 'pnum' seconds"},
+# endif
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
+# endif
+ {NULL}
+};
+
+int dsaparam_main(int argc, char **argv)
+{
+ ENGINE *e = NULL;
+ DSA *dsa = NULL;
+ BIO *in = NULL, *out = NULL;
+ BN_GENCB *cb = NULL;
+ int numbits = -1, num = 0, genkey = 0, need_rand = 0;
+ int informat = FORMAT_PEM, outformat = FORMAT_PEM, noout = 0, C = 0;
+ int ret = 1, i, text = 0, private = 0;
+# ifdef GENCB_TEST
+ int timebomb = 0;
+# endif
+ char *infile = NULL, *outfile = NULL, *prog, *inrand = NULL;
+ OPTION_CHOICE o;
+
+ prog = opt_init(argc, argv, dsaparam_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(dsaparam_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+ goto opthelp;
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_TIMEBOMB:
+# ifdef GENCB_TEST
+ timebomb = atoi(opt_arg());
+ break;
+# endif
+ case OPT_TEXT:
+ text = 1;
+ break;
+ case OPT_C:
+ C = 1;
+ break;
+ case OPT_GENKEY:
+ genkey = need_rand = 1;
+ break;
+ case OPT_RAND:
+ inrand = opt_arg();
+ need_rand = 1;
+ break;
+ case OPT_NOOUT:
+ noout = 1;
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ argv = opt_rest();
+
+ if (argc == 1) {
+ if (!opt_int(argv[0], &num) || num < 0)
+ goto end;
+ /* generate a key */
+ numbits = num;
+ need_rand = 1;
+ }
+ private = genkey ? 1 : 0;
+
+ in = bio_open_default(infile, 'r', informat);
+ if (in == NULL)
+ goto end;
+ out = bio_open_owner(outfile, outformat, private);
+ if (out == NULL)
+ goto end;
+
+ if (need_rand) {
+ app_RAND_load_file(NULL, (inrand != NULL));
+ if (inrand != NULL)
+ BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
+ app_RAND_load_files(inrand));
+ }
+
+ if (numbits > 0) {
+ cb = BN_GENCB_new();
+ if (cb == NULL) {
+ BIO_printf(bio_err, "Error allocating BN_GENCB object\n");
+ goto end;
+ }
+ BN_GENCB_set(cb, dsa_cb, bio_err);
+ assert(need_rand);
+ dsa = DSA_new();
+ if (dsa == NULL) {
+ BIO_printf(bio_err, "Error allocating DSA object\n");
+ goto end;
+ }
+ BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n",
+ num);
+ BIO_printf(bio_err, "This could take some time\n");
+# ifdef GENCB_TEST
+ if (timebomb > 0) {
+ struct sigaction act;
+ act.sa_handler = timebomb_sigalarm;
+ act.sa_flags = 0;
+ BIO_printf(bio_err,
+ "(though I'll stop it if not done within %d secs)\n",
+ timebomb);
+ if (sigaction(SIGALRM, &act, NULL) != 0) {
+ BIO_printf(bio_err, "Error, couldn't set SIGALRM handler\n");
+ goto end;
+ }
+ alarm(timebomb);
+ }
+# endif
+ if (!DSA_generate_parameters_ex(dsa, num, NULL, 0, NULL, NULL, cb)) {
+# ifdef GENCB_TEST
+ if (stop_keygen_flag) {
+ BIO_printf(bio_err, "DSA key generation time-stopped\n");
+ /* This is an asked-for behaviour! */
+ ret = 0;
+ goto end;
+ }
+# endif
+ ERR_print_errors(bio_err);
+ BIO_printf(bio_err, "Error, DSA key generation failed\n");
+ goto end;
+ }
+ } else if (informat == FORMAT_ASN1)
+ dsa = d2i_DSAparams_bio(in, NULL);
+ else
+ dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL);
+ if (dsa == NULL) {
+ BIO_printf(bio_err, "unable to load DSA parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ if (text) {
+ DSAparams_print(out, dsa);
+ }
+
+ if (C) {
+ const BIGNUM *p = NULL, *q = NULL, *g = NULL;
+ unsigned char *data;
+ int len, bits_p;
+
+ DSA_get0_pqg(dsa, &p, &q, &g);
+ len = BN_num_bytes(p);
+ bits_p = BN_num_bits(p);
+
+ data = app_malloc(len + 20, "BN space");
+
+ BIO_printf(bio_out, "DSA *get_dsa%d()\n{\n", bits_p);
+ print_bignum_var(bio_out, p, "dsap", len, data);
+ print_bignum_var(bio_out, q, "dsaq", len, data);
+ print_bignum_var(bio_out, g, "dsag", len, data);
+ BIO_printf(bio_out, " DSA *dsa = DSA_new();\n"
+ "\n");
+ BIO_printf(bio_out, " if (dsa == NULL)\n"
+ " return NULL;\n");
+ BIO_printf(bio_out, " dsa->p = BN_bin2bn(dsap_%d, sizeof(dsap_%d), NULL);\n",
+ bits_p, bits_p);
+ BIO_printf(bio_out, " dsa->q = BN_bin2bn(dsaq_%d, sizeof(dsaq_%d), NULL);\n",
+ bits_p, bits_p);
+ BIO_printf(bio_out, " dsa->g = BN_bin2bn(dsag_%d, sizeof(dsag_%d), NULL);\n",
+ bits_p, bits_p);
+ BIO_printf(bio_out, " if (!dsa->p || !dsa->q || !dsa->g) {\n"
+ " DSA_free(dsa);\n"
+ " return NULL;\n"
+ " }\n"
+ " return(dsa);\n}\n");
+ OPENSSL_free(data);
+ }
+
+ if (outformat == FORMAT_ASN1 && genkey)
+ noout = 1;
+
+ if (!noout) {
+ if (outformat == FORMAT_ASN1)
+ i = i2d_DSAparams_bio(out, dsa);
+ else
+ i = PEM_write_bio_DSAparams(out, dsa);
+ if (!i) {
+ BIO_printf(bio_err, "unable to write DSA parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+ if (genkey) {
+ DSA *dsakey;
+
+ assert(need_rand);
+ if ((dsakey = DSAparams_dup(dsa)) == NULL)
+ goto end;
+ if (!DSA_generate_key(dsakey)) {
+ ERR_print_errors(bio_err);
+ DSA_free(dsakey);
+ goto end;
+ }
+ assert(private);
+ if (outformat == FORMAT_ASN1)
+ i = i2d_DSAPrivateKey_bio(out, dsakey);
+ else
+ i = PEM_write_bio_DSAPrivateKey(out, dsakey, NULL, NULL, 0, NULL,
+ NULL);
+ DSA_free(dsakey);
+ }
+ if (need_rand)
+ app_RAND_write_file(NULL);
+ ret = 0;
+ end:
+ BN_GENCB_free(cb);
+ BIO_free(in);
+ BIO_free_all(out);
+ DSA_free(dsa);
+ release_engine(e);
+ return (ret);
+}
+
+static int dsa_cb(int p, int n, BN_GENCB *cb)
+{
+ char c = '*';
+
+ if (p == 0)
+ c = '.';
+ if (p == 1)
+ c = '+';
+ if (p == 2)
+ c = '*';
+ if (p == 3)
+ c = '\n';
+ BIO_write(BN_GENCB_get_arg(cb), &c, 1);
+ (void)BIO_flush(BN_GENCB_get_arg(cb));
+# ifdef GENCB_TEST
+ if (stop_keygen_flag)
+ return 0;
+# endif
+ return 1;
+}
+#endif
diff --git a/openssl-1.1.0h/apps/ec.c b/openssl-1.1.0h/apps/ec.c
new file mode 100644
index 0000000..2516c03
--- /dev/null
+++ b/openssl-1.1.0h/apps/ec.c
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_EC
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include "apps.h"
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/evp.h>
+# include <openssl/pem.h>
+
+static OPT_PAIR conv_forms[] = {
+ {"compressed", POINT_CONVERSION_COMPRESSED},
+ {"uncompressed", POINT_CONVERSION_UNCOMPRESSED},
+ {"hybrid", POINT_CONVERSION_HYBRID},
+ {NULL}
+};
+
+static OPT_PAIR param_enc[] = {
+ {"named_curve", OPENSSL_EC_NAMED_CURVE},
+ {"explicit", 0},
+ {NULL}
+};
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_OUTFORM, OPT_ENGINE, OPT_IN, OPT_OUT,
+ OPT_NOOUT, OPT_TEXT, OPT_PARAM_OUT, OPT_PUBIN, OPT_PUBOUT,
+ OPT_PASSIN, OPT_PASSOUT, OPT_PARAM_ENC, OPT_CONV_FORM, OPT_CIPHER,
+ OPT_NO_PUBLIC, OPT_CHECK
+} OPTION_CHOICE;
+
+OPTIONS ec_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"in", OPT_IN, 's', "Input file"},
+ {"inform", OPT_INFORM, 'f', "Input format - DER or PEM"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"},
+ {"noout", OPT_NOOUT, '-', "Don't print key out"},
+ {"text", OPT_TEXT, '-', "Print the key"},
+ {"param_out", OPT_PARAM_OUT, '-', "Print the elliptic curve parameters"},
+ {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"},
+ {"pubout", OPT_PUBOUT, '-', "Output public key, not private"},
+ {"no_public", OPT_NO_PUBLIC, '-', "exclude public key from private key"},
+ {"check", OPT_CHECK, '-', "check key consistency"},
+ {"passin", OPT_PASSIN, 's', "Input file pass phrase source"},
+ {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"},
+ {"param_enc", OPT_PARAM_ENC, 's',
+ "Specifies the way the ec parameters are encoded"},
+ {"conv_form", OPT_CONV_FORM, 's', "Specifies the point conversion form "},
+ {"", OPT_CIPHER, '-', "Any supported cipher"},
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
+# endif
+ {NULL}
+};
+
+int ec_main(int argc, char **argv)
+{
+ BIO *in = NULL, *out = NULL;
+ ENGINE *e = NULL;
+ EC_KEY *eckey = NULL;
+ const EC_GROUP *group;
+ const EVP_CIPHER *enc = NULL;
+ point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
+ char *infile = NULL, *outfile = NULL, *prog;
+ char *passin = NULL, *passout = NULL, *passinarg = NULL, *passoutarg = NULL;
+ OPTION_CHOICE o;
+ int asn1_flag = OPENSSL_EC_NAMED_CURVE, new_form = 0, new_asn1_flag = 0;
+ int informat = FORMAT_PEM, outformat = FORMAT_PEM, text = 0, noout = 0;
+ int pubin = 0, pubout = 0, param_out = 0, i, ret = 1, private = 0;
+ int no_public = 0, check = 0;
+
+ prog = opt_init(argc, argv, ec_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(ec_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_ANY, &informat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+ goto opthelp;
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_NOOUT:
+ noout = 1;
+ break;
+ case OPT_TEXT:
+ text = 1;
+ break;
+ case OPT_PARAM_OUT:
+ param_out = 1;
+ break;
+ case OPT_PUBIN:
+ pubin = 1;
+ break;
+ case OPT_PUBOUT:
+ pubout = 1;
+ break;
+ case OPT_PASSIN:
+ passinarg = opt_arg();
+ break;
+ case OPT_PASSOUT:
+ passoutarg = opt_arg();
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_CIPHER:
+ if (!opt_cipher(opt_unknown(), &enc))
+ goto opthelp;
+ break;
+ case OPT_CONV_FORM:
+ if (!opt_pair(opt_arg(), conv_forms, &i))
+ goto opthelp;
+ new_form = 1;
+ form = i;
+ break;
+ case OPT_PARAM_ENC:
+ if (!opt_pair(opt_arg(), param_enc, &i))
+ goto opthelp;
+ new_asn1_flag = 1;
+ asn1_flag = i;
+ break;
+ case OPT_NO_PUBLIC:
+ no_public = 1;
+ break;
+ case OPT_CHECK:
+ check = 1;
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ if (argc != 0)
+ goto opthelp;
+
+ private = param_out || pubin || pubout ? 0 : 1;
+ if (text && !pubin)
+ private = 1;
+
+ if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
+ BIO_printf(bio_err, "Error getting passwords\n");
+ goto end;
+ }
+
+ if (informat != FORMAT_ENGINE) {
+ in = bio_open_default(infile, 'r', informat);
+ if (in == NULL)
+ goto end;
+ }
+
+ BIO_printf(bio_err, "read EC key\n");
+ if (informat == FORMAT_ASN1) {
+ if (pubin)
+ eckey = d2i_EC_PUBKEY_bio(in, NULL);
+ else
+ eckey = d2i_ECPrivateKey_bio(in, NULL);
+ } else if (informat == FORMAT_ENGINE) {
+ EVP_PKEY *pkey;
+ if (pubin)
+ pkey = load_pubkey(infile, informat , 1, passin, e, "Public Key");
+ else
+ pkey = load_key(infile, informat, 1, passin, e, "Private Key");
+ if (pkey != NULL) {
+ eckey = EVP_PKEY_get1_EC_KEY(pkey);
+ EVP_PKEY_free(pkey);
+ }
+ } else {
+ if (pubin)
+ eckey = PEM_read_bio_EC_PUBKEY(in, NULL, NULL, NULL);
+ else
+ eckey = PEM_read_bio_ECPrivateKey(in, NULL, NULL, passin);
+ }
+ if (eckey == NULL) {
+ BIO_printf(bio_err, "unable to load Key\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ out = bio_open_owner(outfile, outformat, private);
+ if (out == NULL)
+ goto end;
+
+ group = EC_KEY_get0_group(eckey);
+
+ if (new_form)
+ EC_KEY_set_conv_form(eckey, form);
+
+ if (new_asn1_flag)
+ EC_KEY_set_asn1_flag(eckey, asn1_flag);
+
+ if (no_public)
+ EC_KEY_set_enc_flags(eckey, EC_PKEY_NO_PUBKEY);
+
+ if (text) {
+ assert(pubin || private);
+ if (!EC_KEY_print(out, eckey, 0)) {
+ perror(outfile);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (check) {
+ if (EC_KEY_check_key(eckey) == 1) {
+ BIO_printf(bio_err, "EC Key valid.\n");
+ } else {
+ BIO_printf(bio_err, "EC Key Invalid!\n");
+ ERR_print_errors(bio_err);
+ }
+ }
+
+ if (noout) {
+ ret = 0;
+ goto end;
+ }
+
+ BIO_printf(bio_err, "writing EC key\n");
+ if (outformat == FORMAT_ASN1) {
+ if (param_out)
+ i = i2d_ECPKParameters_bio(out, group);
+ else if (pubin || pubout)
+ i = i2d_EC_PUBKEY_bio(out, eckey);
+ else {
+ assert(private);
+ i = i2d_ECPrivateKey_bio(out, eckey);
+ }
+ } else {
+ if (param_out)
+ i = PEM_write_bio_ECPKParameters(out, group);
+ else if (pubin || pubout)
+ i = PEM_write_bio_EC_PUBKEY(out, eckey);
+ else {
+ assert(private);
+ i = PEM_write_bio_ECPrivateKey(out, eckey, enc,
+ NULL, 0, NULL, passout);
+ }
+ }
+
+ if (!i) {
+ BIO_printf(bio_err, "unable to write private key\n");
+ ERR_print_errors(bio_err);
+ } else
+ ret = 0;
+ end:
+ BIO_free(in);
+ BIO_free_all(out);
+ EC_KEY_free(eckey);
+ release_engine(e);
+ OPENSSL_free(passin);
+ OPENSSL_free(passout);
+ return (ret);
+}
+#endif
diff --git a/openssl-1.1.0h/apps/ecparam.c b/openssl-1.1.0h/apps/ecparam.c
new file mode 100644
index 0000000..999f748
--- /dev/null
+++ b/openssl-1.1.0h/apps/ecparam.c
@@ -0,0 +1,471 @@
+/*
+ * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+/* ====================================================================
+ * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
+ *
+ * Portions of the attached software ("Contribution") are developed by
+ * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.
+ *
+ * The Contribution is licensed pursuant to the OpenSSL open source
+ * license provided above.
+ *
+ * The elliptic curve binary polynomial software is originally written by
+ * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.
+ *
+ */
+
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_EC
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <stdio.h>
+# include <stdlib.h>
+# include <time.h>
+# include <string.h>
+# include "apps.h"
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/bn.h>
+# include <openssl/ec.h>
+# include <openssl/x509.h>
+# include <openssl/pem.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_TEXT, OPT_C,
+ OPT_CHECK, OPT_LIST_CURVES, OPT_NO_SEED, OPT_NOOUT, OPT_NAME,
+ OPT_CONV_FORM, OPT_PARAM_ENC, OPT_GENKEY, OPT_RAND, OPT_ENGINE
+} OPTION_CHOICE;
+
+OPTIONS ecparam_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"inform", OPT_INFORM, 'F', "Input format - default PEM (DER or PEM)"},
+ {"outform", OPT_OUTFORM, 'F', "Output format - default PEM"},
+ {"in", OPT_IN, '<', "Input file - default stdin"},
+ {"out", OPT_OUT, '>', "Output file - default stdout"},
+ {"text", OPT_TEXT, '-', "Print the ec parameters in text form"},
+ {"C", OPT_C, '-', "Print a 'C' function creating the parameters"},
+ {"check", OPT_CHECK, '-', "Validate the ec parameters"},
+ {"list_curves", OPT_LIST_CURVES, '-',
+ "Prints a list of all curve 'short names'"},
+ {"no_seed", OPT_NO_SEED, '-',
+ "If 'explicit' parameters are chosen do not use the seed"},
+ {"noout", OPT_NOOUT, '-', "Do not print the ec parameter"},
+ {"name", OPT_NAME, 's',
+ "Use the ec parameters with specified 'short name'"},
+ {"conv_form", OPT_CONV_FORM, 's', "Specifies the point conversion form "},
+ {"param_enc", OPT_PARAM_ENC, 's',
+ "Specifies the way the ec parameters are encoded"},
+ {"genkey", OPT_GENKEY, '-', "Generate ec key"},
+ {"rand", OPT_RAND, 's', "Files to use for random number input"},
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
+# endif
+ {NULL}
+};
+
+static OPT_PAIR forms[] = {
+ {"compressed", POINT_CONVERSION_COMPRESSED},
+ {"uncompressed", POINT_CONVERSION_UNCOMPRESSED},
+ {"hybrid", POINT_CONVERSION_HYBRID},
+ {NULL}
+};
+
+static OPT_PAIR encodings[] = {
+ {"named_curve", OPENSSL_EC_NAMED_CURVE},
+ {"explicit", 0},
+ {NULL}
+};
+
+int ecparam_main(int argc, char **argv)
+{
+ ENGINE *e = NULL;
+ BIGNUM *ec_gen = NULL, *ec_order = NULL, *ec_cofactor = NULL;
+ BIGNUM *ec_p = NULL, *ec_a = NULL, *ec_b = NULL;
+ BIO *in = NULL, *out = NULL;
+ EC_GROUP *group = NULL;
+ point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
+ char *curve_name = NULL, *inrand = NULL;
+ char *infile = NULL, *outfile = NULL, *prog;
+ unsigned char *buffer = NULL;
+ OPTION_CHOICE o;
+ int asn1_flag = OPENSSL_EC_NAMED_CURVE, new_asn1_flag = 0;
+ int informat = FORMAT_PEM, outformat = FORMAT_PEM, noout = 0, C = 0;
+ int ret = 1, private = 0;
+ int list_curves = 0, no_seed = 0, check = 0, new_form = 0;
+ int text = 0, i, need_rand = 0, genkey = 0;
+
+ prog = opt_init(argc, argv, ecparam_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(ecparam_options);
+ ret = 0;
+ goto end;
+ case OPT_INFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &informat))
+ goto opthelp;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+ goto opthelp;
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_TEXT:
+ text = 1;
+ break;
+ case OPT_C:
+ C = 1;
+ break;
+ case OPT_CHECK:
+ check = 1;
+ break;
+ case OPT_LIST_CURVES:
+ list_curves = 1;
+ break;
+ case OPT_NO_SEED:
+ no_seed = 1;
+ break;
+ case OPT_NOOUT:
+ noout = 1;
+ break;
+ case OPT_NAME:
+ curve_name = opt_arg();
+ break;
+ case OPT_CONV_FORM:
+ if (!opt_pair(opt_arg(), forms, &new_form))
+ goto opthelp;
+ form = new_form;
+ new_form = 1;
+ break;
+ case OPT_PARAM_ENC:
+ if (!opt_pair(opt_arg(), encodings, &asn1_flag))
+ goto opthelp;
+ new_asn1_flag = 1;
+ break;
+ case OPT_GENKEY:
+ genkey = need_rand = 1;
+ break;
+ case OPT_RAND:
+ inrand = opt_arg();
+ need_rand = 1;
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ if (argc != 0)
+ goto opthelp;
+
+ private = genkey ? 1 : 0;
+
+ in = bio_open_default(infile, 'r', informat);
+ if (in == NULL)
+ goto end;
+ out = bio_open_owner(outfile, outformat, private);
+ if (out == NULL)
+ goto end;
+
+ if (list_curves) {
+ EC_builtin_curve *curves = NULL;
+ size_t crv_len = EC_get_builtin_curves(NULL, 0);
+ size_t n;
+
+ curves = app_malloc((int)sizeof(*curves) * crv_len, "list curves");
+ if (!EC_get_builtin_curves(curves, crv_len)) {
+ OPENSSL_free(curves);
+ goto end;
+ }
+
+ for (n = 0; n < crv_len; n++) {
+ const char *comment;
+ const char *sname;
+ comment = curves[n].comment;
+ sname = OBJ_nid2sn(curves[n].nid);
+ if (comment == NULL)
+ comment = "CURVE DESCRIPTION NOT AVAILABLE";
+ if (sname == NULL)
+ sname = "";
+
+ BIO_printf(out, " %-10s: ", sname);
+ BIO_printf(out, "%s\n", comment);
+ }
+
+ OPENSSL_free(curves);
+ ret = 0;
+ goto end;
+ }
+
+ if (curve_name != NULL) {
+ int nid;
+
+ /*
+ * workaround for the SECG curve names secp192r1 and secp256r1 (which
+ * are the same as the curves prime192v1 and prime256v1 defined in
+ * X9.62)
+ */
+ if (strcmp(curve_name, "secp192r1") == 0) {
+ BIO_printf(bio_err, "using curve name prime192v1 "
+ "instead of secp192r1\n");
+ nid = NID_X9_62_prime192v1;
+ } else if (strcmp(curve_name, "secp256r1") == 0) {
+ BIO_printf(bio_err, "using curve name prime256v1 "
+ "instead of secp256r1\n");
+ nid = NID_X9_62_prime256v1;
+ } else
+ nid = OBJ_sn2nid(curve_name);
+
+ if (nid == 0)
+ nid = EC_curve_nist2nid(curve_name);
+
+ if (nid == 0) {
+ BIO_printf(bio_err, "unknown curve name (%s)\n", curve_name);
+ goto end;
+ }
+
+ group = EC_GROUP_new_by_curve_name(nid);
+ if (group == NULL) {
+ BIO_printf(bio_err, "unable to create curve (%s)\n", curve_name);
+ goto end;
+ }
+ EC_GROUP_set_asn1_flag(group, asn1_flag);
+ EC_GROUP_set_point_conversion_form(group, form);
+ } else if (informat == FORMAT_ASN1)
+ group = d2i_ECPKParameters_bio(in, NULL);
+ else
+ group = PEM_read_bio_ECPKParameters(in, NULL, NULL, NULL);
+ if (group == NULL) {
+ BIO_printf(bio_err, "unable to load elliptic curve parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ if (new_form)
+ EC_GROUP_set_point_conversion_form(group, form);
+
+ if (new_asn1_flag)
+ EC_GROUP_set_asn1_flag(group, asn1_flag);
+
+ if (no_seed) {
+ EC_GROUP_set_seed(group, NULL, 0);
+ }
+
+ if (text) {
+ if (!ECPKParameters_print(out, group, 0))
+ goto end;
+ }
+
+ if (check) {
+ BIO_printf(bio_err, "checking elliptic curve parameters: ");
+ if (!EC_GROUP_check(group, NULL)) {
+ BIO_printf(bio_err, "failed\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ BIO_printf(bio_err, "ok\n");
+
+ }
+
+ if (C) {
+ size_t buf_len = 0, tmp_len = 0;
+ const EC_POINT *point;
+ int is_prime, len = 0;
+ const EC_METHOD *meth = EC_GROUP_method_of(group);
+
+ if ((ec_p = BN_new()) == NULL
+ || (ec_a = BN_new()) == NULL
+ || (ec_b = BN_new()) == NULL
+ || (ec_gen = BN_new()) == NULL
+ || (ec_order = BN_new()) == NULL
+ || (ec_cofactor = BN_new()) == NULL) {
+ perror("Can't allocate BN");
+ goto end;
+ }
+
+ is_prime = (EC_METHOD_get_field_type(meth) == NID_X9_62_prime_field);
+ if (!is_prime) {
+ BIO_printf(bio_err, "Can only handle X9.62 prime fields\n");
+ goto end;
+ }
+
+ if (!EC_GROUP_get_curve_GFp(group, ec_p, ec_a, ec_b, NULL))
+ goto end;
+
+ if ((point = EC_GROUP_get0_generator(group)) == NULL)
+ goto end;
+ if (!EC_POINT_point2bn(group, point,
+ EC_GROUP_get_point_conversion_form(group),
+ ec_gen, NULL))
+ goto end;
+ if (!EC_GROUP_get_order(group, ec_order, NULL))
+ goto end;
+ if (!EC_GROUP_get_cofactor(group, ec_cofactor, NULL))
+ goto end;
+
+ if (!ec_p || !ec_a || !ec_b || !ec_gen || !ec_order || !ec_cofactor)
+ goto end;
+
+ len = BN_num_bits(ec_order);
+
+ if ((tmp_len = (size_t)BN_num_bytes(ec_p)) > buf_len)
+ buf_len = tmp_len;
+ if ((tmp_len = (size_t)BN_num_bytes(ec_a)) > buf_len)
+ buf_len = tmp_len;
+ if ((tmp_len = (size_t)BN_num_bytes(ec_b)) > buf_len)
+ buf_len = tmp_len;
+ if ((tmp_len = (size_t)BN_num_bytes(ec_gen)) > buf_len)
+ buf_len = tmp_len;
+ if ((tmp_len = (size_t)BN_num_bytes(ec_order)) > buf_len)
+ buf_len = tmp_len;
+ if ((tmp_len = (size_t)BN_num_bytes(ec_cofactor)) > buf_len)
+ buf_len = tmp_len;
+
+ buffer = app_malloc(buf_len, "BN buffer");
+
+ BIO_printf(out, "EC_GROUP *get_ec_group_%d(void)\n{\n", len);
+ print_bignum_var(out, ec_p, "ec_p", len, buffer);
+ print_bignum_var(out, ec_a, "ec_a", len, buffer);
+ print_bignum_var(out, ec_b, "ec_b", len, buffer);
+ print_bignum_var(out, ec_gen, "ec_gen", len, buffer);
+ print_bignum_var(out, ec_order, "ec_order", len, buffer);
+ print_bignum_var(out, ec_cofactor, "ec_cofactor", len, buffer);
+ BIO_printf(out, " int ok = 0;\n"
+ " EC_GROUP *group = NULL;\n"
+ " EC_POINT *point = NULL;\n"
+ " BIGNUM *tmp_1 = NULL;\n"
+ " BIGNUM *tmp_2 = NULL;\n"
+ " BIGNUM *tmp_3 = NULL;\n"
+ "\n");
+
+ BIO_printf(out, " if ((tmp_1 = BN_bin2bn(ec_p_%d, sizeof(ec_p_%d), NULL)) == NULL)\n"
+ " goto err;\n", len, len);
+ BIO_printf(out, " if ((tmp_2 = BN_bin2bn(ec_a_%d, sizeof(ec_a_%d), NULL)) == NULL)\n"
+ " goto err;\n", len, len);
+ BIO_printf(out, " if ((tmp_3 = BN_bin2bn(ec_b_%d, sizeof(ec_b_%d), NULL)) == NULL)\n"
+ " goto err;\n", len, len);
+ BIO_printf(out, " if ((group = EC_GROUP_new_curve_GFp(tmp_1, tmp_2, tmp_3, NULL)) == NULL)\n"
+ " goto err;\n"
+ "\n");
+ BIO_printf(out, " /* build generator */\n");
+ BIO_printf(out, " if ((tmp_1 = BN_bin2bn(ec_gen_%d, sizeof(ec_gen_%d), tmp_1)) == NULL)\n"
+ " goto err;\n", len, len);
+ BIO_printf(out, " point = EC_POINT_bn2point(group, tmp_1, NULL, NULL);\n");
+ BIO_printf(out, " if (point == NULL)\n"
+ " goto err;\n");
+ BIO_printf(out, " if ((tmp_2 = BN_bin2bn(ec_order_%d, sizeof(ec_order_%d), tmp_2)) == NULL)\n"
+ " goto err;\n", len, len);
+ BIO_printf(out, " if ((tmp_3 = BN_bin2bn(ec_cofactor_%d, sizeof(ec_cofactor_%d), tmp_3)) == NULL)\n"
+ " goto err;\n", len, len);
+ BIO_printf(out, " if (!EC_GROUP_set_generator(group, point, tmp_2, tmp_3))\n"
+ " goto err;\n"
+ "ok = 1;"
+ "\n");
+ BIO_printf(out, "err:\n"
+ " BN_free(tmp_1);\n"
+ " BN_free(tmp_2);\n"
+ " BN_free(tmp_3);\n"
+ " EC_POINT_free(point);\n"
+ " if (!ok) {\n"
+ " EC_GROUP_free(group);\n"
+ " return NULL;\n"
+ " }\n"
+ " return (group);\n"
+ "}\n");
+ }
+
+ if (outformat == FORMAT_ASN1 && genkey)
+ noout = 1;
+
+ if (!noout) {
+ if (outformat == FORMAT_ASN1)
+ i = i2d_ECPKParameters_bio(out, group);
+ else
+ i = PEM_write_bio_ECPKParameters(out, group);
+ if (!i) {
+ BIO_printf(bio_err, "unable to write elliptic "
+ "curve parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (need_rand) {
+ app_RAND_load_file(NULL, (inrand != NULL));
+ if (inrand != NULL)
+ BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
+ app_RAND_load_files(inrand));
+ }
+
+ if (genkey) {
+ EC_KEY *eckey = EC_KEY_new();
+
+ if (eckey == NULL)
+ goto end;
+
+ assert(need_rand);
+
+ if (EC_KEY_set_group(eckey, group) == 0) {
+ BIO_printf(bio_err, "unable to set group when generating key\n");
+ EC_KEY_free(eckey);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ if (new_form)
+ EC_KEY_set_conv_form(eckey, form);
+
+ if (!EC_KEY_generate_key(eckey)) {
+ BIO_printf(bio_err, "unable to generate key\n");
+ EC_KEY_free(eckey);
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ assert(private);
+ if (outformat == FORMAT_ASN1)
+ i = i2d_ECPrivateKey_bio(out, eckey);
+ else
+ i = PEM_write_bio_ECPrivateKey(out, eckey, NULL,
+ NULL, 0, NULL, NULL);
+ EC_KEY_free(eckey);
+ }
+
+ if (need_rand)
+ app_RAND_write_file(NULL);
+
+ ret = 0;
+ end:
+ BN_free(ec_p);
+ BN_free(ec_a);
+ BN_free(ec_b);
+ BN_free(ec_gen);
+ BN_free(ec_order);
+ BN_free(ec_cofactor);
+ OPENSSL_free(buffer);
+ EC_GROUP_free(group);
+ release_engine(e);
+ BIO_free(in);
+ BIO_free_all(out);
+ return (ret);
+}
+
+#endif
diff --git a/openssl-1.1.0h/apps/enc.c b/openssl-1.1.0h/apps/enc.c
new file mode 100644
index 0000000..df55381
--- /dev/null
+++ b/openssl-1.1.0h/apps/enc.c
@@ -0,0 +1,623 @@
+/*
+ * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include "apps.h"
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#include <openssl/objects.h>
+#include <openssl/x509.h>
+#include <openssl/rand.h>
+#include <openssl/pem.h>
+#ifndef OPENSSL_NO_COMP
+# include <openssl/comp.h>
+#endif
+#include <ctype.h>
+
+#undef SIZE
+#undef BSIZE
+#define SIZE (512)
+#define BSIZE (8*1024)
+
+static int set_hex(char *in, unsigned char *out, int size);
+static void show_ciphers(const OBJ_NAME *name, void *bio_);
+
+struct doall_enc_ciphers {
+ BIO *bio;
+ int n;
+};
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_LIST,
+ OPT_E, OPT_IN, OPT_OUT, OPT_PASS, OPT_ENGINE, OPT_D, OPT_P, OPT_V,
+ OPT_NOPAD, OPT_SALT, OPT_NOSALT, OPT_DEBUG, OPT_UPPER_P, OPT_UPPER_A,
+ OPT_A, OPT_Z, OPT_BUFSIZE, OPT_K, OPT_KFILE, OPT_UPPER_K, OPT_NONE,
+ OPT_UPPER_S, OPT_IV, OPT_MD, OPT_CIPHER
+} OPTION_CHOICE;
+
+OPTIONS enc_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"ciphers", OPT_LIST, '-', "List ciphers"},
+ {"in", OPT_IN, '<', "Input file"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"pass", OPT_PASS, 's', "Passphrase source"},
+ {"e", OPT_E, '-', "Encrypt"},
+ {"d", OPT_D, '-', "Decrypt"},
+ {"p", OPT_P, '-', "Print the iv/key"},
+ {"P", OPT_UPPER_P, '-', "Print the iv/key and exit"},
+ {"v", OPT_V, '-', "Verbose output"},
+ {"nopad", OPT_NOPAD, '-', "Disable standard block padding"},
+ {"salt", OPT_SALT, '-', "Use salt in the KDF (default)"},
+ {"nosalt", OPT_NOSALT, '-', "Do not use salt in the KDF"},
+ {"debug", OPT_DEBUG, '-', "Print debug info"},
+ {"a", OPT_A, '-', "Base64 encode/decode, depending on encryption flag"},
+ {"base64", OPT_A, '-', "Same as option -a"},
+ {"A", OPT_UPPER_A, '-',
+ "Used with -[base64|a] to specify base64 buffer as a single line"},
+ {"bufsize", OPT_BUFSIZE, 's', "Buffer size"},
+ {"k", OPT_K, 's', "Passphrase"},
+ {"kfile", OPT_KFILE, '<', "Read passphrase from file"},
+ {"K", OPT_UPPER_K, 's', "Raw key, in hex"},
+ {"S", OPT_UPPER_S, 's', "Salt, in hex"},
+ {"iv", OPT_IV, 's', "IV in hex"},
+ {"md", OPT_MD, 's', "Use specified digest to create a key from the passphrase"},
+ {"none", OPT_NONE, '-', "Don't encrypt"},
+ {"", OPT_CIPHER, '-', "Any supported cipher"},
+#ifdef ZLIB
+ {"z", OPT_Z, '-', "Use zlib as the 'encryption'"},
+#endif
+#ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
+#endif
+ {NULL}
+};
+
+int enc_main(int argc, char **argv)
+{
+ static char buf[128];
+ static const char magic[] = "Salted__";
+ ENGINE *e = NULL;
+ BIO *in = NULL, *out = NULL, *b64 = NULL, *benc = NULL, *rbio =
+ NULL, *wbio = NULL;
+ EVP_CIPHER_CTX *ctx = NULL;
+ const EVP_CIPHER *cipher = NULL, *c;
+ const EVP_MD *dgst = NULL;
+ char *hkey = NULL, *hiv = NULL, *hsalt = NULL, *p;
+ char *infile = NULL, *outfile = NULL, *prog;
+ char *str = NULL, *passarg = NULL, *pass = NULL, *strbuf = NULL;
+ char mbuf[sizeof(magic) - 1];
+ OPTION_CHOICE o;
+ int bsize = BSIZE, verbose = 0, debug = 0, olb64 = 0, nosalt = 0;
+ int enc = 1, printkey = 0, i, k;
+ int base64 = 0, informat = FORMAT_BINARY, outformat = FORMAT_BINARY;
+ int ret = 1, inl, nopad = 0;
+ unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH];
+ unsigned char *buff = NULL, salt[PKCS5_SALT_LEN];
+ long n;
+ struct doall_enc_ciphers dec;
+#ifdef ZLIB
+ int do_zlib = 0;
+ BIO *bzl = NULL;
+#endif
+
+ /* first check the program name */
+ prog = opt_progname(argv[0]);
+ if (strcmp(prog, "base64") == 0)
+ base64 = 1;
+#ifdef ZLIB
+ else if (strcmp(prog, "zlib") == 0)
+ do_zlib = 1;
+#endif
+ else {
+ cipher = EVP_get_cipherbyname(prog);
+ if (cipher == NULL && strcmp(prog, "enc") != 0) {
+ BIO_printf(bio_err, "%s is not a known cipher\n", prog);
+ goto end;
+ }
+ }
+
+ prog = opt_init(argc, argv, enc_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(enc_options);
+ ret = 0;
+ goto end;
+ case OPT_LIST:
+ BIO_printf(bio_out, "Supported ciphers:\n");
+ dec.bio = bio_out;
+ dec.n = 0;
+ OBJ_NAME_do_all_sorted(OBJ_NAME_TYPE_CIPHER_METH,
+ show_ciphers, &dec);
+ BIO_printf(bio_out, "\n");
+ ret = 0;
+ goto end;
+ case OPT_E:
+ enc = 1;
+ break;
+ case OPT_IN:
+ infile = opt_arg();
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_PASS:
+ passarg = opt_arg();
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_D:
+ enc = 0;
+ break;
+ case OPT_P:
+ printkey = 1;
+ break;
+ case OPT_V:
+ verbose = 1;
+ break;
+ case OPT_NOPAD:
+ nopad = 1;
+ break;
+ case OPT_SALT:
+ nosalt = 0;
+ break;
+ case OPT_NOSALT:
+ nosalt = 1;
+ break;
+ case OPT_DEBUG:
+ debug = 1;
+ break;
+ case OPT_UPPER_P:
+ printkey = 2;
+ break;
+ case OPT_UPPER_A:
+ olb64 = 1;
+ break;
+ case OPT_A:
+ base64 = 1;
+ break;
+ case OPT_Z:
+#ifdef ZLIB
+ do_zlib = 1;
+#endif
+ break;
+ case OPT_BUFSIZE:
+ p = opt_arg();
+ i = (int)strlen(p) - 1;
+ k = i >= 1 && p[i] == 'k';
+ if (k)
+ p[i] = '\0';
+ if (!opt_long(opt_arg(), &n)
+ || n < 0 || (k && n >= LONG_MAX / 1024))
+ goto opthelp;
+ if (k)
+ n *= 1024;
+ bsize = (int)n;
+ break;
+ case OPT_K:
+ str = opt_arg();
+ break;
+ case OPT_KFILE:
+ in = bio_open_default(opt_arg(), 'r', FORMAT_TEXT);
+ if (in == NULL)
+ goto opthelp;
+ i = BIO_gets(in, buf, sizeof(buf));
+ BIO_free(in);
+ in = NULL;
+ if (i <= 0) {
+ BIO_printf(bio_err,
+ "%s Can't read key from %s\n", prog, opt_arg());
+ goto opthelp;
+ }
+ while (--i > 0 && (buf[i] == '\r' || buf[i] == '\n'))
+ buf[i] = '\0';
+ if (i <= 0) {
+ BIO_printf(bio_err, "%s: zero length password\n", prog);
+ goto opthelp;
+ }
+ str = buf;
+ break;
+ case OPT_UPPER_K:
+ hkey = opt_arg();
+ break;
+ case OPT_UPPER_S:
+ hsalt = opt_arg();
+ break;
+ case OPT_IV:
+ hiv = opt_arg();
+ break;
+ case OPT_MD:
+ if (!opt_md(opt_arg(), &dgst))
+ goto opthelp;
+ break;
+ case OPT_CIPHER:
+ if (!opt_cipher(opt_unknown(), &c))
+ goto opthelp;
+ cipher = c;
+ break;
+ case OPT_NONE:
+ cipher = NULL;
+ break;
+ }
+ }
+ if (opt_num_rest() != 0) {
+ BIO_printf(bio_err, "Extra arguments given.\n");
+ goto opthelp;
+ }
+
+ if (cipher && EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) {
+ BIO_printf(bio_err, "%s: AEAD ciphers not supported\n", prog);
+ goto end;
+ }
+
+ if (cipher && (EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE)) {
+ BIO_printf(bio_err, "%s XTS ciphers not supported\n", prog);
+ goto end;
+ }
+
+ if (dgst == NULL)
+ dgst = EVP_sha256();
+
+ /* It must be large enough for a base64 encoded line */
+ if (base64 && bsize < 80)
+ bsize = 80;
+ if (verbose)
+ BIO_printf(bio_err, "bufsize=%d\n", bsize);
+
+#ifdef ZLIB
+ if (!do_zlib)
+#endif
+ if (base64) {
+ if (enc)
+ outformat = FORMAT_BASE64;
+ else
+ informat = FORMAT_BASE64;
+ }
+
+ strbuf = app_malloc(SIZE, "strbuf");
+ buff = app_malloc(EVP_ENCODE_LENGTH(bsize), "evp buffer");
+
+ if (infile == NULL) {
+ in = dup_bio_in(informat);
+ } else
+ in = bio_open_default(infile, 'r', informat);
+ if (in == NULL)
+ goto end;
+
+ if (!str && passarg) {
+ if (!app_passwd(passarg, NULL, &pass, NULL)) {
+ BIO_printf(bio_err, "Error getting password\n");
+ goto end;
+ }
+ str = pass;
+ }
+
+ if ((str == NULL) && (cipher != NULL) && (hkey == NULL)) {
+ if (1) {
+#ifndef OPENSSL_NO_UI
+ for (;;) {
+ char prompt[200];
+
+ BIO_snprintf(prompt, sizeof(prompt), "enter %s %s password:",
+ OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
+ (enc) ? "encryption" : "decryption");
+ strbuf[0] = '\0';
+ i = EVP_read_pw_string((char *)strbuf, SIZE, prompt, enc);
+ if (i == 0) {
+ if (strbuf[0] == '\0') {
+ ret = 1;
+ goto end;
+ }
+ str = strbuf;
+ break;
+ }
+ if (i < 0) {
+ BIO_printf(bio_err, "bad password read\n");
+ goto end;
+ }
+ }
+ } else {
+#endif
+ BIO_printf(bio_err, "password required\n");
+ goto end;
+ }
+ }
+
+ out = bio_open_default(outfile, 'w', outformat);
+ if (out == NULL)
+ goto end;
+
+ if (debug) {
+ BIO_set_callback(in, BIO_debug_callback);
+ BIO_set_callback(out, BIO_debug_callback);
+ BIO_set_callback_arg(in, (char *)bio_err);
+ BIO_set_callback_arg(out, (char *)bio_err);
+ }
+
+ rbio = in;
+ wbio = out;
+
+#ifdef ZLIB
+ if (do_zlib) {
+ if ((bzl = BIO_new(BIO_f_zlib())) == NULL)
+ goto end;
+ if (debug) {
+ BIO_set_callback(bzl, BIO_debug_callback);
+ BIO_set_callback_arg(bzl, (char *)bio_err);
+ }
+ if (enc)
+ wbio = BIO_push(bzl, wbio);
+ else
+ rbio = BIO_push(bzl, rbio);
+ }
+#endif
+
+ if (base64) {
+ if ((b64 = BIO_new(BIO_f_base64())) == NULL)
+ goto end;
+ if (debug) {
+ BIO_set_callback(b64, BIO_debug_callback);
+ BIO_set_callback_arg(b64, (char *)bio_err);
+ }
+ if (olb64)
+ BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
+ if (enc)
+ wbio = BIO_push(b64, wbio);
+ else
+ rbio = BIO_push(b64, rbio);
+ }
+
+ if (cipher != NULL) {
+ /*
+ * Note that str is NULL if a key was passed on the command line, so
+ * we get no salt in that case. Is this a bug?
+ */
+ if (str != NULL) {
+ /*
+ * Salt handling: if encrypting generate a salt and write to
+ * output BIO. If decrypting read salt from input BIO.
+ */
+ unsigned char *sptr;
+ size_t str_len = strlen(str);
+
+ if (nosalt)
+ sptr = NULL;
+ else {
+ if (enc) {
+ if (hsalt) {
+ if (!set_hex(hsalt, salt, sizeof(salt))) {
+ BIO_printf(bio_err, "invalid hex salt value\n");
+ goto end;
+ }
+ } else if (RAND_bytes(salt, sizeof(salt)) <= 0)
+ goto end;
+ /*
+ * If -P option then don't bother writing
+ */
+ if ((printkey != 2)
+ && (BIO_write(wbio, magic,
+ sizeof(magic) - 1) != sizeof(magic) - 1
+ || BIO_write(wbio,
+ (char *)salt,
+ sizeof(salt)) != sizeof(salt))) {
+ BIO_printf(bio_err, "error writing output file\n");
+ goto end;
+ }
+ } else if (BIO_read(rbio, mbuf, sizeof(mbuf)) != sizeof(mbuf)
+ || BIO_read(rbio,
+ (unsigned char *)salt,
+ sizeof(salt)) != sizeof(salt)) {
+ BIO_printf(bio_err, "error reading input file\n");
+ goto end;
+ } else if (memcmp(mbuf, magic, sizeof(magic) - 1)) {
+ BIO_printf(bio_err, "bad magic number\n");
+ goto end;
+ }
+
+ sptr = salt;
+ }
+
+ if (!EVP_BytesToKey(cipher, dgst, sptr,
+ (unsigned char *)str,
+ str_len, 1, key, iv)) {
+ BIO_printf(bio_err, "EVP_BytesToKey failed\n");
+ goto end;
+ }
+ /*
+ * zero the complete buffer or the string passed from the command
+ * line bug picked up by Larry J. Hughes Jr. <hughes@indiana.edu>
+ */
+ if (str == strbuf)
+ OPENSSL_cleanse(str, SIZE);
+ else
+ OPENSSL_cleanse(str, str_len);
+ }
+ if (hiv != NULL) {
+ int siz = EVP_CIPHER_iv_length(cipher);
+ if (siz == 0) {
+ BIO_printf(bio_err, "warning: iv not use by this cipher\n");
+ } else if (!set_hex(hiv, iv, sizeof(iv))) {
+ BIO_printf(bio_err, "invalid hex iv value\n");
+ goto end;
+ }
+ }
+ if ((hiv == NULL) && (str == NULL)
+ && EVP_CIPHER_iv_length(cipher) != 0) {
+ /*
+ * No IV was explicitly set and no IV was generated during
+ * EVP_BytesToKey. Hence the IV is undefined, making correct
+ * decryption impossible.
+ */
+ BIO_printf(bio_err, "iv undefined\n");
+ goto end;
+ }
+ if ((hkey != NULL) && !set_hex(hkey, key, EVP_CIPHER_key_length(cipher))) {
+ BIO_printf(bio_err, "invalid hex key value\n");
+ goto end;
+ }
+
+ if ((benc = BIO_new(BIO_f_cipher())) == NULL)
+ goto end;
+
+ /*
+ * Since we may be changing parameters work on the encryption context
+ * rather than calling BIO_set_cipher().
+ */
+
+ BIO_get_cipher_ctx(benc, &ctx);
+
+ if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc)) {
+ BIO_printf(bio_err, "Error setting cipher %s\n",
+ EVP_CIPHER_name(cipher));
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ if (nopad)
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
+
+ if (!EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, enc)) {
+ BIO_printf(bio_err, "Error setting cipher %s\n",
+ EVP_CIPHER_name(cipher));
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+
+ if (debug) {
+ BIO_set_callback(benc, BIO_debug_callback);
+ BIO_set_callback_arg(benc, (char *)bio_err);
+ }
+
+ if (printkey) {
+ if (!nosalt) {
+ printf("salt=");
+ for (i = 0; i < (int)sizeof(salt); i++)
+ printf("%02X", salt[i]);
+ printf("\n");
+ }
+ if (EVP_CIPHER_key_length(cipher) > 0) {
+ printf("key=");
+ for (i = 0; i < EVP_CIPHER_key_length(cipher); i++)
+ printf("%02X", key[i]);
+ printf("\n");
+ }
+ if (EVP_CIPHER_iv_length(cipher) > 0) {
+ printf("iv =");
+ for (i = 0; i < EVP_CIPHER_iv_length(cipher); i++)
+ printf("%02X", iv[i]);
+ printf("\n");
+ }
+ if (printkey == 2) {
+ ret = 0;
+ goto end;
+ }
+ }
+ }
+
+ /* Only encrypt/decrypt as we write the file */
+ if (benc != NULL)
+ wbio = BIO_push(benc, wbio);
+
+ for (;;) {
+ inl = BIO_read(rbio, (char *)buff, bsize);
+ if (inl <= 0)
+ break;
+ if (BIO_write(wbio, (char *)buff, inl) != inl) {
+ BIO_printf(bio_err, "error writing output file\n");
+ goto end;
+ }
+ }
+ if (!BIO_flush(wbio)) {
+ BIO_printf(bio_err, "bad decrypt\n");
+ goto end;
+ }
+
+ ret = 0;
+ if (verbose) {
+ BIO_printf(bio_err, "bytes read :%8"BIO_PRI64"u\n", BIO_number_read(in));
+ BIO_printf(bio_err, "bytes written:%8"BIO_PRI64"u\n", BIO_number_written(out));
+ }
+ end:
+ ERR_print_errors(bio_err);
+ OPENSSL_free(strbuf);
+ OPENSSL_free(buff);
+ BIO_free(in);
+ BIO_free_all(out);
+ BIO_free(benc);
+ BIO_free(b64);
+#ifdef ZLIB
+ BIO_free(bzl);
+#endif
+ release_engine(e);
+ OPENSSL_free(pass);
+ return (ret);
+}
+
+static void show_ciphers(const OBJ_NAME *name, void *arg)
+{
+ struct doall_enc_ciphers *dec = (struct doall_enc_ciphers *)arg;
+ const EVP_CIPHER *cipher;
+
+ if (!islower((unsigned char)*name->name))
+ return;
+
+ /* Filter out ciphers that we cannot use */
+ cipher = EVP_get_cipherbyname(name->name);
+ if (cipher == NULL ||
+ (EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER) != 0 ||
+ EVP_CIPHER_mode(cipher) == EVP_CIPH_XTS_MODE)
+ return;
+
+ BIO_printf(dec->bio, "-%-25s", name->name);
+ if (++dec->n == 3) {
+ BIO_printf(dec->bio, "\n");
+ dec->n = 0;
+ } else
+ BIO_printf(dec->bio, " ");
+}
+
+static int set_hex(char *in, unsigned char *out, int size)
+{
+ int i, n;
+ unsigned char j;
+
+ n = strlen(in);
+ if (n > (size * 2)) {
+ BIO_printf(bio_err, "hex string is too long\n");
+ return (0);
+ }
+ memset(out, 0, size);
+ for (i = 0; i < n; i++) {
+ j = (unsigned char)*in;
+ *(in++) = '\0';
+ if (j == 0)
+ break;
+ if (!isxdigit(j)) {
+ BIO_printf(bio_err, "non-hex digit\n");
+ return (0);
+ }
+ j = (unsigned char)OPENSSL_hexchar2int(j);
+ if (i & 1)
+ out[i / 2] |= j;
+ else
+ out[i / 2] = (j << 4);
+ }
+ return (1);
+}
diff --git a/openssl-1.1.0h/apps/engine.c b/openssl-1.1.0h/apps/engine.c
new file mode 100644
index 0000000..4eeb642
--- /dev/null
+++ b/openssl-1.1.0h/apps/engine.c
@@ -0,0 +1,446 @@
+/*
+ * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_ENGINE
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include "apps.h"
+# include <stdio.h>
+# include <stdlib.h>
+# include <string.h>
+# include <openssl/err.h>
+# include <openssl/engine.h>
+# include <openssl/ssl.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_C, OPT_T, OPT_TT, OPT_PRE, OPT_POST,
+ OPT_V = 100, OPT_VV, OPT_VVV, OPT_VVVV
+} OPTION_CHOICE;
+
+OPTIONS engine_options[] = {
+ {OPT_HELP_STR, 1, '-', "Usage: %s [options] engine...\n"},
+ {OPT_HELP_STR, 1, '-',
+ " engine... Engines to load\n"},
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"v", OPT_V, '-', "List 'control commands' For each specified engine"},
+ {"vv", OPT_VV, '-', "Also display each command's description"},
+ {"vvv", OPT_VVV, '-', "Also add the input flags for each command"},
+ {"vvvv", OPT_VVVV, '-', "Also show internal input flags"},
+ {"c", OPT_C, '-', "List the capabilities of specified engine"},
+ {"t", OPT_T, '-', "Check that specified engine is available"},
+ {"tt", OPT_TT, '-', "Display error trace for unavailable engines"},
+ {"pre", OPT_PRE, 's', "Run command against the ENGINE before loading it"},
+ {"post", OPT_POST, 's', "Run command against the ENGINE after loading it"},
+ {OPT_MORE_STR, OPT_EOF, 1,
+ "Commands are like \"SO_PATH:/lib/libdriver.so\""},
+ {NULL}
+};
+
+static int append_buf(char **buf, int *size, const char *s)
+{
+ if (*buf == NULL) {
+ *size = 256;
+ *buf = app_malloc(*size, "engine buffer");
+ **buf = '\0';
+ }
+
+ if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
+ char *tmp;
+ *size += 256;
+ tmp = OPENSSL_realloc(*buf, *size);
+ if (tmp == NULL) {
+ OPENSSL_free(*buf);
+ *buf = NULL;
+ return 0;
+ }
+ *buf = tmp;
+ }
+
+ if (**buf != '\0')
+ OPENSSL_strlcat(*buf, ", ", *size);
+ OPENSSL_strlcat(*buf, s, *size);
+
+ return 1;
+}
+
+static int util_flags(BIO *out, unsigned int flags, const char *indent)
+{
+ int started = 0, err = 0;
+ /* Indent before displaying input flags */
+ BIO_printf(out, "%s%s(input flags): ", indent, indent);
+ if (flags == 0) {
+ BIO_printf(out, "<no flags>\n");
+ return 1;
+ }
+ /*
+ * If the object is internal, mark it in a way that shows instead of
+ * having it part of all the other flags, even if it really is.
+ */
+ if (flags & ENGINE_CMD_FLAG_INTERNAL) {
+ BIO_printf(out, "[Internal] ");
+ }
+
+ if (flags & ENGINE_CMD_FLAG_NUMERIC) {
+ BIO_printf(out, "NUMERIC");
+ started = 1;
+ }
+ /*
+ * Now we check that no combinations of the mutually exclusive NUMERIC,
+ * STRING, and NO_INPUT flags have been used. Future flags that can be
+ * OR'd together with these would need to added after these to preserve
+ * the testing logic.
+ */
+ if (flags & ENGINE_CMD_FLAG_STRING) {
+ if (started) {
+ BIO_printf(out, "|");
+ err = 1;
+ }
+ BIO_printf(out, "STRING");
+ started = 1;
+ }
+ if (flags & ENGINE_CMD_FLAG_NO_INPUT) {
+ if (started) {
+ BIO_printf(out, "|");
+ err = 1;
+ }
+ BIO_printf(out, "NO_INPUT");
+ started = 1;
+ }
+ /* Check for unknown flags */
+ flags = flags & ~ENGINE_CMD_FLAG_NUMERIC &
+ ~ENGINE_CMD_FLAG_STRING &
+ ~ENGINE_CMD_FLAG_NO_INPUT & ~ENGINE_CMD_FLAG_INTERNAL;
+ if (flags) {
+ if (started)
+ BIO_printf(out, "|");
+ BIO_printf(out, "<0x%04X>", flags);
+ }
+ if (err)
+ BIO_printf(out, " <illegal flags!>");
+ BIO_printf(out, "\n");
+ return 1;
+}
+
+static int util_verbose(ENGINE *e, int verbose, BIO *out, const char *indent)
+{
+ static const int line_wrap = 78;
+ int num;
+ int ret = 0;
+ char *name = NULL;
+ char *desc = NULL;
+ int flags;
+ int xpos = 0;
+ STACK_OF(OPENSSL_STRING) *cmds = NULL;
+ if (!ENGINE_ctrl(e, ENGINE_CTRL_HAS_CTRL_FUNCTION, 0, NULL, NULL) ||
+ ((num = ENGINE_ctrl(e, ENGINE_CTRL_GET_FIRST_CMD_TYPE,
+ 0, NULL, NULL)) <= 0)) {
+ return 1;
+ }
+
+ cmds = sk_OPENSSL_STRING_new_null();
+ if (!cmds)
+ goto err;
+
+ do {
+ int len;
+ /* Get the command input flags */
+ if ((flags = ENGINE_ctrl(e, ENGINE_CTRL_GET_CMD_FLAGS, num,
+ NULL, NULL)) < 0)
+ goto err;
+ if (!(flags & ENGINE_CMD_FLAG_INTERNAL) || verbose >= 4) {
+ /* Get the command name */
+ if ((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_LEN_FROM_CMD, num,
+ NULL, NULL)) <= 0)
+ goto err;
+ name = app_malloc(len + 1, "name buffer");
+ if (ENGINE_ctrl(e, ENGINE_CTRL_GET_NAME_FROM_CMD, num, name,
+ NULL) <= 0)
+ goto err;
+ /* Get the command description */
+ if ((len = ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_LEN_FROM_CMD, num,
+ NULL, NULL)) < 0)
+ goto err;
+ if (len > 0) {
+ desc = app_malloc(len + 1, "description buffer");
+ if (ENGINE_ctrl(e, ENGINE_CTRL_GET_DESC_FROM_CMD, num, desc,
+ NULL) <= 0)
+ goto err;
+ }
+ /* Now decide on the output */
+ if (xpos == 0)
+ /* Do an indent */
+ xpos = BIO_puts(out, indent);
+ else
+ /* Otherwise prepend a ", " */
+ xpos += BIO_printf(out, ", ");
+ if (verbose == 1) {
+ /*
+ * We're just listing names, comma-delimited
+ */
+ if ((xpos > (int)strlen(indent)) &&
+ (xpos + (int)strlen(name) > line_wrap)) {
+ BIO_printf(out, "\n");
+ xpos = BIO_puts(out, indent);
+ }
+ xpos += BIO_printf(out, "%s", name);
+ } else {
+ /* We're listing names plus descriptions */
+ BIO_printf(out, "%s: %s\n", name,
+ (desc == NULL) ? "<no description>" : desc);
+ /* ... and sometimes input flags */
+ if ((verbose >= 3) && !util_flags(out, flags, indent))
+ goto err;
+ xpos = 0;
+ }
+ }
+ OPENSSL_free(name);
+ name = NULL;
+ OPENSSL_free(desc);
+ desc = NULL;
+ /* Move to the next command */
+ num = ENGINE_ctrl(e, ENGINE_CTRL_GET_NEXT_CMD_TYPE, num, NULL, NULL);
+ } while (num > 0);
+ if (xpos > 0)
+ BIO_printf(out, "\n");
+ ret = 1;
+ err:
+ sk_OPENSSL_STRING_free(cmds);
+ OPENSSL_free(name);
+ OPENSSL_free(desc);
+ return ret;
+}
+
+static void util_do_cmds(ENGINE *e, STACK_OF(OPENSSL_STRING) *cmds,
+ BIO *out, const char *indent)
+{
+ int loop, res, num = sk_OPENSSL_STRING_num(cmds);
+
+ if (num < 0) {
+ BIO_printf(out, "[Error]: internal stack error\n");
+ return;
+ }
+ for (loop = 0; loop < num; loop++) {
+ char buf[256];
+ const char *cmd, *arg;
+ cmd = sk_OPENSSL_STRING_value(cmds, loop);
+ res = 1; /* assume success */
+ /* Check if this command has no ":arg" */
+ if ((arg = strstr(cmd, ":")) == NULL) {
+ if (!ENGINE_ctrl_cmd_string(e, cmd, NULL, 0))
+ res = 0;
+ } else {
+ if ((int)(arg - cmd) > 254) {
+ BIO_printf(out, "[Error]: command name too long\n");
+ return;
+ }
+ memcpy(buf, cmd, (int)(arg - cmd));
+ buf[arg - cmd] = '\0';
+ arg++; /* Move past the ":" */
+ /* Call the command with the argument */
+ if (!ENGINE_ctrl_cmd_string(e, buf, arg, 0))
+ res = 0;
+ }
+ if (res)
+ BIO_printf(out, "[Success]: %s\n", cmd);
+ else {
+ BIO_printf(out, "[Failure]: %s\n", cmd);
+ ERR_print_errors(out);
+ }
+ }
+}
+
+int engine_main(int argc, char **argv)
+{
+ int ret = 1, i;
+ int verbose = 0, list_cap = 0, test_avail = 0, test_avail_noise = 0;
+ ENGINE *e;
+ STACK_OF(OPENSSL_CSTRING) *engines = sk_OPENSSL_CSTRING_new_null();
+ STACK_OF(OPENSSL_STRING) *pre_cmds = sk_OPENSSL_STRING_new_null();
+ STACK_OF(OPENSSL_STRING) *post_cmds = sk_OPENSSL_STRING_new_null();
+ BIO *out;
+ const char *indent = " ";
+ OPTION_CHOICE o;
+ char *prog;
+ char *argv1;
+
+ out = dup_bio_out(FORMAT_TEXT);
+ if (engines == NULL || pre_cmds == NULL || post_cmds == NULL)
+ goto end;
+
+ /* Remember the original command name, parse/skip any leading engine
+ * names, and then setup to parse the rest of the line as flags. */
+ prog = argv[0];
+ while ((argv1 = argv[1]) != NULL && *argv1 != '-') {
+ sk_OPENSSL_CSTRING_push(engines, argv1);
+ argc--;
+ argv++;
+ }
+ argv[0] = prog;
+ opt_init(argc, argv, engine_options);
+
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(engine_options);
+ ret = 0;
+ goto end;
+ case OPT_VVVV:
+ case OPT_VVV:
+ case OPT_VV:
+ case OPT_V:
+ /* Convert to an integer from one to four. */
+ i = (int)(o - OPT_V) + 1;
+ if (verbose < i)
+ verbose = i;
+ break;
+ case OPT_C:
+ list_cap = 1;
+ break;
+ case OPT_TT:
+ test_avail_noise++;
+ /* fall thru */
+ case OPT_T:
+ test_avail++;
+ break;
+ case OPT_PRE:
+ sk_OPENSSL_STRING_push(pre_cmds, opt_arg());
+ break;
+ case OPT_POST:
+ sk_OPENSSL_STRING_push(post_cmds, opt_arg());
+ break;
+ }
+ }
+
+ /* Allow any trailing parameters as engine names. */
+ argc = opt_num_rest();
+ argv = opt_rest();
+ for ( ; *argv; argv++) {
+ if (**argv == '-') {
+ BIO_printf(bio_err, "%s: Cannot mix flags and engine names.\n",
+ prog);
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ }
+ sk_OPENSSL_CSTRING_push(engines, *argv);
+ }
+
+ if (sk_OPENSSL_CSTRING_num(engines) == 0) {
+ for (e = ENGINE_get_first(); e != NULL; e = ENGINE_get_next(e)) {
+ sk_OPENSSL_CSTRING_push(engines, ENGINE_get_id(e));
+ }
+ }
+
+ ret = 0;
+ for (i = 0; i < sk_OPENSSL_CSTRING_num(engines); i++) {
+ const char *id = sk_OPENSSL_CSTRING_value(engines, i);
+ if ((e = ENGINE_by_id(id)) != NULL) {
+ const char *name = ENGINE_get_name(e);
+ /*
+ * Do "id" first, then "name". Easier to auto-parse.
+ */
+ BIO_printf(out, "(%s) %s\n", id, name);
+ util_do_cmds(e, pre_cmds, out, indent);
+ if (strcmp(ENGINE_get_id(e), id) != 0) {
+ BIO_printf(out, "Loaded: (%s) %s\n",
+ ENGINE_get_id(e), ENGINE_get_name(e));
+ }
+ if (list_cap) {
+ int cap_size = 256;
+ char *cap_buf = NULL;
+ int k, n;
+ const int *nids;
+ ENGINE_CIPHERS_PTR fn_c;
+ ENGINE_DIGESTS_PTR fn_d;
+ ENGINE_PKEY_METHS_PTR fn_pk;
+
+ if (ENGINE_get_RSA(e) != NULL
+ && !append_buf(&cap_buf, &cap_size, "RSA"))
+ goto end;
+ if (ENGINE_get_DSA(e) != NULL
+ && !append_buf(&cap_buf, &cap_size, "DSA"))
+ goto end;
+ if (ENGINE_get_DH(e) != NULL
+ && !append_buf(&cap_buf, &cap_size, "DH"))
+ goto end;
+ if (ENGINE_get_RAND(e) != NULL
+ && !append_buf(&cap_buf, &cap_size, "RAND"))
+ goto end;
+
+ fn_c = ENGINE_get_ciphers(e);
+ if (!fn_c)
+ goto skip_ciphers;
+ n = fn_c(e, NULL, &nids, 0);
+ for (k = 0; k < n; ++k)
+ if (!append_buf(&cap_buf, &cap_size, OBJ_nid2sn(nids[k])))
+ goto end;
+
+ skip_ciphers:
+ fn_d = ENGINE_get_digests(e);
+ if (!fn_d)
+ goto skip_digests;
+ n = fn_d(e, NULL, &nids, 0);
+ for (k = 0; k < n; ++k)
+ if (!append_buf(&cap_buf, &cap_size, OBJ_nid2sn(nids[k])))
+ goto end;
+
+ skip_digests:
+ fn_pk = ENGINE_get_pkey_meths(e);
+ if (!fn_pk)
+ goto skip_pmeths;
+ n = fn_pk(e, NULL, &nids, 0);
+ for (k = 0; k < n; ++k)
+ if (!append_buf(&cap_buf, &cap_size, OBJ_nid2sn(nids[k])))
+ goto end;
+ skip_pmeths:
+ if (cap_buf && (*cap_buf != '\0'))
+ BIO_printf(out, " [%s]\n", cap_buf);
+
+ OPENSSL_free(cap_buf);
+ }
+ if (test_avail) {
+ BIO_printf(out, "%s", indent);
+ if (ENGINE_init(e)) {
+ BIO_printf(out, "[ available ]\n");
+ util_do_cmds(e, post_cmds, out, indent);
+ ENGINE_finish(e);
+ } else {
+ BIO_printf(out, "[ unavailable ]\n");
+ if (test_avail_noise)
+ ERR_print_errors_fp(stdout);
+ ERR_clear_error();
+ }
+ }
+ if ((verbose > 0) && !util_verbose(e, verbose, out, indent))
+ goto end;
+ ENGINE_free(e);
+ } else {
+ ERR_print_errors(bio_err);
+ /* because exit codes above 127 have special meaning on Unix */
+ if (++ret > 127)
+ ret = 127;
+ }
+ }
+
+ end:
+
+ ERR_print_errors(bio_err);
+ sk_OPENSSL_CSTRING_free(engines);
+ sk_OPENSSL_STRING_free(pre_cmds);
+ sk_OPENSSL_STRING_free(post_cmds);
+ BIO_free_all(out);
+ return (ret);
+}
+#endif
diff --git a/openssl-1.1.0h/apps/errstr.c b/openssl-1.1.0h/apps/errstr.c
new file mode 100644
index 0000000..79d83ee
--- /dev/null
+++ b/openssl-1.1.0h/apps/errstr.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "apps.h"
+#include <openssl/bio.h>
+#include <openssl/lhash.h>
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP
+} OPTION_CHOICE;
+
+OPTIONS errstr_options[] = {
+ {OPT_HELP_STR, 1, '-', "Usage: %s [options] errnum...\n"},
+ {OPT_HELP_STR, 1, '-', " errnum Error number\n"},
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {NULL}
+};
+
+int errstr_main(int argc, char **argv)
+{
+ OPTION_CHOICE o;
+ char buf[256], *prog;
+ int ret = 1;
+ unsigned long l;
+
+ prog = opt_init(argc, argv, errstr_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ opt_help(errstr_options);
+ ret = 0;
+ goto end;
+ }
+ }
+
+ ret = 0;
+ for (argv = opt_rest(); *argv; argv++) {
+ if (sscanf(*argv, "%lx", &l) == 0)
+ ret++;
+ else {
+ /* We're not really an SSL application so this won't auto-init, but
+ * we're still interested in SSL error strings
+ */
+ OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS
+ | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+ ERR_error_string_n(l, buf, sizeof(buf));
+ BIO_printf(bio_out, "%s\n", buf);
+ }
+ }
+ end:
+ return (ret);
+}
diff --git a/openssl-1.1.0h/apps/gendsa.c b/openssl-1.1.0h/apps/gendsa.c
new file mode 100644
index 0000000..bdef022
--- /dev/null
+++ b/openssl-1.1.0h/apps/gendsa.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/opensslconf.h>
+#ifdef OPENSSL_NO_DSA
+NON_EMPTY_TRANSLATION_UNIT
+#else
+
+# include <stdio.h>
+# include <string.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+# include "apps.h"
+# include <openssl/bio.h>
+# include <openssl/err.h>
+# include <openssl/bn.h>
+# include <openssl/dsa.h>
+# include <openssl/x509.h>
+# include <openssl/pem.h>
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_OUT, OPT_PASSOUT, OPT_ENGINE, OPT_RAND, OPT_CIPHER
+} OPTION_CHOICE;
+
+OPTIONS gendsa_options[] = {
+ {OPT_HELP_STR, 1, '-', "Usage: %s [args] dsaparam-file\n"},
+ {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"out", OPT_OUT, '>', "Output the key to the specified file"},
+ {"passout", OPT_PASSOUT, 's', "Output file pass phrase source"},
+ {"rand", OPT_RAND, 's',
+ "Load the file(s) into the random number generator"},
+ {"", OPT_CIPHER, '-', "Encrypt the output with any supported cipher"},
+# ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
+# endif
+ {NULL}
+};
+
+int gendsa_main(int argc, char **argv)
+{
+ ENGINE *e = NULL;
+ BIO *out = NULL, *in = NULL;
+ DSA *dsa = NULL;
+ const EVP_CIPHER *enc = NULL;
+ char *inrand = NULL, *dsaparams = NULL;
+ char *outfile = NULL, *passoutarg = NULL, *passout = NULL, *prog;
+ OPTION_CHOICE o;
+ int ret = 1, private = 0;
+ const BIGNUM *p = NULL;
+
+ prog = opt_init(argc, argv, gendsa_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ ret = 0;
+ opt_help(gendsa_options);
+ goto end;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_PASSOUT:
+ passoutarg = opt_arg();
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_RAND:
+ inrand = opt_arg();
+ break;
+ case OPT_CIPHER:
+ if (!opt_cipher(opt_unknown(), &enc))
+ goto end;
+ break;
+ }
+ }
+ argc = opt_num_rest();
+ argv = opt_rest();
+ private = 1;
+
+ if (argc != 1)
+ goto opthelp;
+ dsaparams = *argv;
+
+ if (!app_passwd(NULL, passoutarg, NULL, &passout)) {
+ BIO_printf(bio_err, "Error getting password\n");
+ goto end;
+ }
+
+ in = bio_open_default(dsaparams, 'r', FORMAT_PEM);
+ if (in == NULL)
+ goto end2;
+
+ if ((dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL)) == NULL) {
+ BIO_printf(bio_err, "unable to load DSA parameter file\n");
+ goto end;
+ }
+ BIO_free(in);
+ in = NULL;
+
+ out = bio_open_owner(outfile, FORMAT_PEM, private);
+ if (out == NULL)
+ goto end2;
+
+ if (!app_RAND_load_file(NULL, 1) && inrand == NULL) {
+ BIO_printf(bio_err,
+ "warning, not much extra random data, consider using the -rand option\n");
+ }
+ if (inrand != NULL)
+ BIO_printf(bio_err, "%ld semi-random bytes loaded\n",
+ app_RAND_load_files(inrand));
+
+ DSA_get0_pqg(dsa, &p, NULL, NULL);
+ BIO_printf(bio_err, "Generating DSA key, %d bits\n", BN_num_bits(p));
+ if (!DSA_generate_key(dsa))
+ goto end;
+
+ app_RAND_write_file(NULL);
+
+ assert(private);
+ if (!PEM_write_bio_DSAPrivateKey(out, dsa, enc, NULL, 0, NULL, passout))
+ goto end;
+ ret = 0;
+ end:
+ if (ret != 0)
+ ERR_print_errors(bio_err);
+ end2:
+ BIO_free(in);
+ BIO_free_all(out);
+ DSA_free(dsa);
+ release_engine(e);
+ OPENSSL_free(passout);
+ return (ret);
+}
+#endif
diff --git a/openssl-1.1.0h/apps/genpkey.c b/openssl-1.1.0h/apps/genpkey.c
new file mode 100644
index 0000000..9e37977
--- /dev/null
+++ b/openssl-1.1.0h/apps/genpkey.c
@@ -0,0 +1,314 @@
+/*
+ * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "apps.h"
+#include <openssl/pem.h>
+#include <openssl/err.h>
+#include <openssl/evp.h>
+#ifndef OPENSSL_NO_ENGINE
+# include <openssl/engine.h>
+#endif
+
+static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e);
+static int genpkey_cb(EVP_PKEY_CTX *ctx);
+
+typedef enum OPTION_choice {
+ OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+ OPT_ENGINE, OPT_OUTFORM, OPT_OUT, OPT_PASS, OPT_PARAMFILE,
+ OPT_ALGORITHM, OPT_PKEYOPT, OPT_GENPARAM, OPT_TEXT, OPT_CIPHER
+} OPTION_CHOICE;
+
+OPTIONS genpkey_options[] = {
+ {"help", OPT_HELP, '-', "Display this summary"},
+ {"out", OPT_OUT, '>', "Output file"},
+ {"outform", OPT_OUTFORM, 'F', "output format (DER or PEM)"},
+ {"pass", OPT_PASS, 's', "Output file pass phrase source"},
+ {"paramfile", OPT_PARAMFILE, '<', "Parameters file"},
+ {"algorithm", OPT_ALGORITHM, 's', "The public key algorithm"},
+ {"pkeyopt", OPT_PKEYOPT, 's',
+ "Set the public key algorithm option as opt:value"},
+ {"genparam", OPT_GENPARAM, '-', "Generate parameters, not key"},
+ {"text", OPT_TEXT, '-', "Print the in text"},
+ {"", OPT_CIPHER, '-', "Cipher to use to encrypt the key"},
+#ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"},
+#endif
+ /* This is deliberately last. */
+ {OPT_HELP_STR, 1, 1,
+ "Order of options may be important! See the documentation.\n"},
+ {NULL}
+};
+
+int genpkey_main(int argc, char **argv)
+{
+ BIO *in = NULL, *out = NULL;
+ ENGINE *e = NULL;
+ EVP_PKEY *pkey = NULL;
+ EVP_PKEY_CTX *ctx = NULL;
+ char *outfile = NULL, *passarg = NULL, *pass = NULL, *prog;
+ const EVP_CIPHER *cipher = NULL;
+ OPTION_CHOICE o;
+ int outformat = FORMAT_PEM, text = 0, ret = 1, rv, do_param = 0;
+ int private = 0;
+
+ prog = opt_init(argc, argv, genpkey_options);
+ while ((o = opt_next()) != OPT_EOF) {
+ switch (o) {
+ case OPT_EOF:
+ case OPT_ERR:
+ opthelp:
+ BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
+ goto end;
+ case OPT_HELP:
+ ret = 0;
+ opt_help(genpkey_options);
+ goto end;
+ case OPT_OUTFORM:
+ if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat))
+ goto opthelp;
+ break;
+ case OPT_OUT:
+ outfile = opt_arg();
+ break;
+ case OPT_PASS:
+ passarg = opt_arg();
+ break;
+ case OPT_ENGINE:
+ e = setup_engine(opt_arg(), 0);
+ break;
+ case OPT_PARAMFILE:
+ if (do_param == 1)
+ goto opthelp;
+ if (!init_keygen_file(&ctx, opt_arg(), e))
+ goto end;
+ break;
+ case OPT_ALGORITHM:
+ if (!init_gen_str(&ctx, opt_arg(), e, do_param))
+ goto end;
+ break;
+ case OPT_PKEYOPT:
+ if (ctx == NULL) {
+ BIO_printf(bio_err, "%s: No keytype specified.\n", prog);
+ goto opthelp;
+ }
+ if (pkey_ctrl_string(ctx, opt_arg()) <= 0) {
+ BIO_printf(bio_err,
+ "%s: Error setting %s parameter:\n",
+ prog, opt_arg());
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ break;
+ case OPT_GENPARAM:
+ if (ctx != NULL)
+ goto opthelp;
+ do_param = 1;
+ break;
+ case OPT_TEXT:
+ text = 1;
+ break;
+ case OPT_CIPHER:
+ if (!opt_cipher(opt_unknown(), &cipher)
+ || do_param == 1)
+ goto opthelp;
+ }
+ }
+ argc = opt_num_rest();
+ if (argc != 0)
+ goto opthelp;
+
+ private = do_param ? 0 : 1;
+
+ if (ctx == NULL)
+ goto opthelp;
+
+ if (!app_passwd(passarg, NULL, &pass, NULL)) {
+ BIO_puts(bio_err, "Error getting password\n");
+ goto end;
+ }
+
+ out = bio_open_owner(outfile, outformat, private);
+ if (out == NULL)
+ goto end;
+
+ EVP_PKEY_CTX_set_cb(ctx, genpkey_cb);
+ EVP_PKEY_CTX_set_app_data(ctx, bio_err);
+
+ if (do_param) {
+ if (EVP_PKEY_paramgen(ctx, &pkey) <= 0) {
+ BIO_puts(bio_err, "Error generating parameters\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ } else {
+ if (EVP_PKEY_keygen(ctx, &pkey) <= 0) {
+ BIO_puts(bio_err, "Error generating key\n");
+ ERR_print_errors(bio_err);
+ goto end;
+ }
+ }
+
+ if (do_param)
+ rv = PEM_write_bio_Parameters(out, pkey);
+ else if (outformat == FORMAT_PEM) {
+ assert(private);
+ rv = PEM_write_bio_PrivateKey(out, pkey, cipher, NULL, 0, NULL, pass);
+ } else if (outformat == FORMAT_ASN1) {
+ assert(private);
+ rv = i2d_PrivateKey_bio(out, pkey);
+ } else {
+ BIO_printf(bio_err, "Bad format specified for key\n");
+ goto end;
+ }
+
+ if (rv <= 0) {
+ BIO_puts(bio_err, "Error writing key\n");
+ ERR_print_errors(bio_err);
+ }
+
+ if (text) {
+ if (do_param)
+ rv = EVP_PKEY_print_params(out, pkey, 0, NULL);
+ else
+ rv = EVP_PKEY_print_private(out, pkey, 0, NULL);
+
+ if (rv <= 0) {
+ BIO_puts(bio_err, "Error printing key\n");
+ ERR_print_errors(bio_err);
+ }
+ }
+
+ ret = 0;
+
+ end:
+ EVP_PKEY_free(pkey);
+ EVP_PKEY_CTX_free(ctx);
+ BIO_free_all(out);
+ BIO_free(in);
+ release_engine(e);
+ OPENSSL_free(pass);
+ return ret;
+}
+
+static int init_keygen_file(EVP_PKEY_CTX **pctx, const char *file, ENGINE *e)
+{
+ BIO *pbio;
+ EVP_PKEY *pkey = NULL;