build - Rewire secure, remove conflicts from libmd, libcrypt
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 27 Oct 2016 23:11:22 +0000 (16:11 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 28 Oct 2016 00:17:41 +0000 (17:17 -0700)
* Remove /usr/src/secure, folding all of its subsystems into
  /usr/src.  There's no point having a /usr/src/secure any more,
  the system won't run without the secure stuff, the idea that some foreign
  actor could segregate it in order to legally download code without crypto
  is absurd on the modern internet, and the U.S. government stopped caring
  decades ago.

* Remove conflicts from libmd and libcrypt.  Essentially this removes
  the SHA*_*() and MD5_*() APIs from libmd because these APIs already
  exist in lib[re]ssl.

  The older SHA*() and MD5*() APIs are partially retained for legacy base
  code, but will be removed in a later stage (moved to direct-linking the
  needed support source).

  Conflicting routines in libcrypt have been renamed and internalized to
  be libcrypt-only.

* Major rewiring of the Makefile's to support the changes.

531 files changed:
Makefile.inc1
Makefile.ssh.common [new file with mode: 0644]
bin/csh/Makefile
etc/Makefile
include/Makefile
lib/Makefile
lib/libarchive/Makefile
lib/libcipher/Makefile [moved from secure/lib/libcipher/Makefile with 100% similarity]
lib/libcipher/README [moved from secure/lib/libcipher/README with 100% similarity]
lib/libcipher/README.FreeBSD [moved from secure/lib/libcipher/README.FreeBSD with 100% similarity]
lib/libcipher/cipher.3 [moved from secure/lib/libcipher/cipher.3 with 100% similarity]
lib/libcipher/crypt.c [moved from secure/lib/libcipher/crypt.c with 100% similarity]
lib/libcipher/test/Makefile [moved from secure/lib/libcipher/test/Makefile with 100% similarity]
lib/libcipher/test/README [moved from secure/lib/libcipher/test/README with 100% similarity]
lib/libcipher/test/cert.c [moved from secure/lib/libcipher/test/cert.c with 100% similarity]
lib/libcipher/test/cert.input [moved from secure/lib/libcipher/test/cert.input with 100% similarity]
lib/libcipher/test/speedcrypt.c [moved from secure/lib/libcipher/test/speedcrypt.c with 100% similarity]
lib/libcipher/test/speeddes.c [moved from secure/lib/libcipher/test/speeddes.c with 100% similarity]
lib/libcrypt/Makefile
lib/libcrypt/blowfish.c [moved from secure/lib/libcrypt/blowfish.c with 100% similarity]
lib/libcrypt/blowfish.h [moved from secure/lib/libcrypt/blowfish.h with 100% similarity]
lib/libcrypt/crypt-blowfish.c [moved from secure/lib/libcrypt/crypt-blowfish.c with 100% similarity]
lib/libcrypt/crypt-des.c [moved from secure/lib/libcrypt/crypt-des.c with 100% similarity]
lib/libcrypt/crypt-sha256.c
lib/libcrypt/crypt-sha512.c
lib/libcrypt/deprecated-crypt-sha256.c
lib/libcrypt/deprecated-crypt-sha512.c
lib/libcrypt/local.h [new file with mode: 0644]
lib/libcrypto/Makefile [moved from secure/lib/libcrypto/Makefile with 100% similarity]
lib/libcrypto/Makefile.inc [moved from secure/lib/libcrypto/Makefile.inc with 96% similarity]
lib/libcrypto/Makefile.man [moved from secure/lib/libcrypto/Makefile.man with 100% similarity]
lib/libcrypto/asm/Makefile [moved from secure/lib/libcrypto/asm/Makefile with 97% similarity]
lib/libcrypto/asm/aes-x86_64.s [moved from secure/lib/libcrypto/asm/aes-x86_64.s with 100% similarity]
lib/libcrypto/asm/aesni-gcm-x86_64.s [moved from secure/lib/libcrypto/asm/aesni-gcm-x86_64.s with 100% similarity]
lib/libcrypto/asm/aesni-mb-x86_64.s [moved from secure/lib/libcrypto/asm/aesni-mb-x86_64.s with 100% similarity]
lib/libcrypto/asm/aesni-sha1-x86_64.s [moved from secure/lib/libcrypto/asm/aesni-sha1-x86_64.s with 100% similarity]
lib/libcrypto/asm/aesni-sha256-x86_64.s [moved from secure/lib/libcrypto/asm/aesni-sha256-x86_64.s with 100% similarity]
lib/libcrypto/asm/aesni-x86_64.s [moved from secure/lib/libcrypto/asm/aesni-x86_64.s with 100% similarity]
lib/libcrypto/asm/bsaes-x86_64.s [moved from secure/lib/libcrypto/asm/bsaes-x86_64.s with 100% similarity]
lib/libcrypto/asm/cmll-x86_64.s [moved from secure/lib/libcrypto/asm/cmll-x86_64.s with 100% similarity]
lib/libcrypto/asm/ecp_nistz256-x86_64.s [moved from secure/lib/libcrypto/asm/ecp_nistz256-x86_64.s with 100% similarity]
lib/libcrypto/asm/ghash-x86_64.s [moved from secure/lib/libcrypto/asm/ghash-x86_64.s with 100% similarity]
lib/libcrypto/asm/md5-x86_64.s [moved from secure/lib/libcrypto/asm/md5-x86_64.s with 100% similarity]
lib/libcrypto/asm/rc4-md5-x86_64.s [moved from secure/lib/libcrypto/asm/rc4-md5-x86_64.s with 100% similarity]
lib/libcrypto/asm/rc4-x86_64.s [moved from secure/lib/libcrypto/asm/rc4-x86_64.s with 100% similarity]
lib/libcrypto/asm/rsaz-avx2.s [moved from secure/lib/libcrypto/asm/rsaz-avx2.s with 100% similarity]
lib/libcrypto/asm/rsaz-x86_64.s [moved from secure/lib/libcrypto/asm/rsaz-x86_64.s with 100% similarity]
lib/libcrypto/asm/sha1-mb-x86_64.s [moved from secure/lib/libcrypto/asm/sha1-mb-x86_64.s with 100% similarity]
lib/libcrypto/asm/sha1-x86_64.s [moved from secure/lib/libcrypto/asm/sha1-x86_64.s with 100% similarity]
lib/libcrypto/asm/sha256-mb-x86_64.s [moved from secure/lib/libcrypto/asm/sha256-mb-x86_64.s with 100% similarity]
lib/libcrypto/asm/sha256-x86_64.s [moved from secure/lib/libcrypto/asm/sha256-x86_64.s with 100% similarity]
lib/libcrypto/asm/sha512-x86_64.s [moved from secure/lib/libcrypto/asm/sha512-x86_64.s with 100% similarity]
lib/libcrypto/asm/vpaes-x86_64.s [moved from secure/lib/libcrypto/asm/vpaes-x86_64.s with 100% similarity]
lib/libcrypto/asm/wp-x86_64.s [moved from secure/lib/libcrypto/asm/wp-x86_64.s with 100% similarity]
lib/libcrypto/asm/x86_64-gf2m.s [moved from secure/lib/libcrypto/asm/x86_64-gf2m.s with 100% similarity]
lib/libcrypto/asm/x86_64-mont.s [moved from secure/lib/libcrypto/asm/x86_64-mont.s with 100% similarity]
lib/libcrypto/asm/x86_64-mont5.s [moved from secure/lib/libcrypto/asm/x86_64-mont5.s with 100% similarity]
lib/libcrypto/asm/x86_64cpuid.s [moved from secure/lib/libcrypto/asm/x86_64cpuid.s with 100% similarity]
lib/libcrypto/engines/Makefile [moved from secure/lib/libcrypto/engines/Makefile with 100% similarity]
lib/libcrypto/engines/Makefile.inc [moved from secure/lib/libcrypto/engines/Makefile.inc with 52% similarity]
lib/libcrypto/engines/lib4758cca/Makefile [moved from secure/lib/libcrypto/engines/lib4758cca/Makefile with 100% similarity]
lib/libcrypto/engines/libaep/Makefile [moved from secure/lib/libcrypto/engines/libaep/Makefile with 100% similarity]
lib/libcrypto/engines/libatalla/Makefile [moved from secure/lib/libcrypto/engines/libatalla/Makefile with 100% similarity]
lib/libcrypto/engines/libcapi/Makefile [moved from secure/lib/libcrypto/engines/libcapi/Makefile with 100% similarity]
lib/libcrypto/engines/libchil/Makefile [moved from secure/lib/libcrypto/engines/libchil/Makefile with 100% similarity]
lib/libcrypto/engines/libcswift/Makefile [moved from secure/lib/libcrypto/engines/libcswift/Makefile with 100% similarity]
lib/libcrypto/engines/libgmp/Makefile [moved from secure/lib/libcrypto/engines/libgmp/Makefile with 100% similarity]
lib/libcrypto/engines/libgost/Makefile [moved from secure/lib/libcrypto/engines/libgost/Makefile with 100% similarity]
lib/libcrypto/engines/libnuron/Makefile [moved from secure/lib/libcrypto/engines/libnuron/Makefile with 100% similarity]
lib/libcrypto/engines/libpadlock/Makefile [moved from secure/lib/libcrypto/engines/libpadlock/Makefile with 100% similarity]
lib/libcrypto/engines/libsureware/Makefile [moved from secure/lib/libcrypto/engines/libsureware/Makefile with 100% similarity]
lib/libcrypto/engines/libubsec/Makefile [moved from secure/lib/libcrypto/engines/libubsec/Makefile with 100% similarity]
lib/libcrypto/man/ASN1_OBJECT_new.3 [moved from secure/lib/libcrypto/man/ASN1_OBJECT_new.3 with 100% similarity]
lib/libcrypto/man/ASN1_STRING_length.3 [moved from secure/lib/libcrypto/man/ASN1_STRING_length.3 with 100% similarity]
lib/libcrypto/man/ASN1_STRING_new.3 [moved from secure/lib/libcrypto/man/ASN1_STRING_new.3 with 100% similarity]
lib/libcrypto/man/ASN1_STRING_print_ex.3 [moved from secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 with 100% similarity]
lib/libcrypto/man/ASN1_TIME_set.3 [moved from secure/lib/libcrypto/man/ASN1_TIME_set.3 with 100% similarity]
lib/libcrypto/man/ASN1_generate_nconf.3 [moved from secure/lib/libcrypto/man/ASN1_generate_nconf.3 with 100% similarity]
lib/libcrypto/man/BIO_ctrl.3 [moved from secure/lib/libcrypto/man/BIO_ctrl.3 with 100% similarity]
lib/libcrypto/man/BIO_f_base64.3 [moved from secure/lib/libcrypto/man/BIO_f_base64.3 with 100% similarity]
lib/libcrypto/man/BIO_f_buffer.3 [moved from secure/lib/libcrypto/man/BIO_f_buffer.3 with 100% similarity]
lib/libcrypto/man/BIO_f_cipher.3 [moved from secure/lib/libcrypto/man/BIO_f_cipher.3 with 100% similarity]
lib/libcrypto/man/BIO_f_md.3 [moved from secure/lib/libcrypto/man/BIO_f_md.3 with 100% similarity]
lib/libcrypto/man/BIO_f_null.3 [moved from secure/lib/libcrypto/man/BIO_f_null.3 with 100% similarity]
lib/libcrypto/man/BIO_f_ssl.3 [moved from secure/lib/libcrypto/man/BIO_f_ssl.3 with 100% similarity]
lib/libcrypto/man/BIO_find_type.3 [moved from secure/lib/libcrypto/man/BIO_find_type.3 with 100% similarity]
lib/libcrypto/man/BIO_new.3 [moved from secure/lib/libcrypto/man/BIO_new.3 with 100% similarity]
lib/libcrypto/man/BIO_new_CMS.3 [moved from secure/lib/libcrypto/man/BIO_new_CMS.3 with 100% similarity]
lib/libcrypto/man/BIO_push.3 [moved from secure/lib/libcrypto/man/BIO_push.3 with 100% similarity]
lib/libcrypto/man/BIO_read.3 [moved from secure/lib/libcrypto/man/BIO_read.3 with 100% similarity]
lib/libcrypto/man/BIO_s_accept.3 [moved from secure/lib/libcrypto/man/BIO_s_accept.3 with 100% similarity]
lib/libcrypto/man/BIO_s_bio.3 [moved from secure/lib/libcrypto/man/BIO_s_bio.3 with 100% similarity]
lib/libcrypto/man/BIO_s_connect.3 [moved from secure/lib/libcrypto/man/BIO_s_connect.3 with 100% similarity]
lib/libcrypto/man/BIO_s_fd.3 [moved from secure/lib/libcrypto/man/BIO_s_fd.3 with 100% similarity]
lib/libcrypto/man/BIO_s_file.3 [moved from secure/lib/libcrypto/man/BIO_s_file.3 with 100% similarity]
lib/libcrypto/man/BIO_s_mem.3 [moved from secure/lib/libcrypto/man/BIO_s_mem.3 with 100% similarity]
lib/libcrypto/man/BIO_s_null.3 [moved from secure/lib/libcrypto/man/BIO_s_null.3 with 100% similarity]
lib/libcrypto/man/BIO_s_socket.3 [moved from secure/lib/libcrypto/man/BIO_s_socket.3 with 100% similarity]
lib/libcrypto/man/BIO_set_callback.3 [moved from secure/lib/libcrypto/man/BIO_set_callback.3 with 100% similarity]
lib/libcrypto/man/BIO_should_retry.3 [moved from secure/lib/libcrypto/man/BIO_should_retry.3 with 100% similarity]
lib/libcrypto/man/BN_BLINDING_new.3 [moved from secure/lib/libcrypto/man/BN_BLINDING_new.3 with 100% similarity]
lib/libcrypto/man/BN_CTX_new.3 [moved from secure/lib/libcrypto/man/BN_CTX_new.3 with 100% similarity]
lib/libcrypto/man/BN_CTX_start.3 [moved from secure/lib/libcrypto/man/BN_CTX_start.3 with 100% similarity]
lib/libcrypto/man/BN_add.3 [moved from secure/lib/libcrypto/man/BN_add.3 with 100% similarity]
lib/libcrypto/man/BN_add_word.3 [moved from secure/lib/libcrypto/man/BN_add_word.3 with 100% similarity]
lib/libcrypto/man/BN_bn2bin.3 [moved from secure/lib/libcrypto/man/BN_bn2bin.3 with 100% similarity]
lib/libcrypto/man/BN_cmp.3 [moved from secure/lib/libcrypto/man/BN_cmp.3 with 100% similarity]
lib/libcrypto/man/BN_copy.3 [moved from secure/lib/libcrypto/man/BN_copy.3 with 100% similarity]
lib/libcrypto/man/BN_generate_prime.3 [moved from secure/lib/libcrypto/man/BN_generate_prime.3 with 100% similarity]
lib/libcrypto/man/BN_mod_inverse.3 [moved from secure/lib/libcrypto/man/BN_mod_inverse.3 with 100% similarity]
lib/libcrypto/man/BN_mod_mul_montgomery.3 [moved from secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 with 100% similarity]
lib/libcrypto/man/BN_mod_mul_reciprocal.3 [moved from secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 with 100% similarity]
lib/libcrypto/man/BN_new.3 [moved from secure/lib/libcrypto/man/BN_new.3 with 100% similarity]
lib/libcrypto/man/BN_num_bytes.3 [moved from secure/lib/libcrypto/man/BN_num_bytes.3 with 100% similarity]
lib/libcrypto/man/BN_rand.3 [moved from secure/lib/libcrypto/man/BN_rand.3 with 100% similarity]
lib/libcrypto/man/BN_set_bit.3 [moved from secure/lib/libcrypto/man/BN_set_bit.3 with 100% similarity]
lib/libcrypto/man/BN_swap.3 [moved from secure/lib/libcrypto/man/BN_swap.3 with 100% similarity]
lib/libcrypto/man/BN_zero.3 [moved from secure/lib/libcrypto/man/BN_zero.3 with 100% similarity]
lib/libcrypto/man/CMS_add0_cert.3 [moved from secure/lib/libcrypto/man/CMS_add0_cert.3 with 100% similarity]
lib/libcrypto/man/CMS_add1_recipient_cert.3 [moved from secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 with 100% similarity]
lib/libcrypto/man/CMS_add1_signer.3 [moved from secure/lib/libcrypto/man/CMS_add1_signer.3 with 100% similarity]
lib/libcrypto/man/CMS_compress.3 [moved from secure/lib/libcrypto/man/CMS_compress.3 with 100% similarity]
lib/libcrypto/man/CMS_decrypt.3 [moved from secure/lib/libcrypto/man/CMS_decrypt.3 with 100% similarity]
lib/libcrypto/man/CMS_encrypt.3 [moved from secure/lib/libcrypto/man/CMS_encrypt.3 with 100% similarity]
lib/libcrypto/man/CMS_final.3 [moved from secure/lib/libcrypto/man/CMS_final.3 with 100% similarity]
lib/libcrypto/man/CMS_get0_RecipientInfos.3 [moved from secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 with 100% similarity]
lib/libcrypto/man/CMS_get0_SignerInfos.3 [moved from secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 with 100% similarity]
lib/libcrypto/man/CMS_get0_type.3 [moved from secure/lib/libcrypto/man/CMS_get0_type.3 with 100% similarity]
lib/libcrypto/man/CMS_get1_ReceiptRequest.3 [moved from secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 with 100% similarity]
lib/libcrypto/man/CMS_sign.3 [moved from secure/lib/libcrypto/man/CMS_sign.3 with 100% similarity]
lib/libcrypto/man/CMS_sign_receipt.3 [moved from secure/lib/libcrypto/man/CMS_sign_receipt.3 with 100% similarity]
lib/libcrypto/man/CMS_uncompress.3 [moved from secure/lib/libcrypto/man/CMS_uncompress.3 with 100% similarity]
lib/libcrypto/man/CMS_verify.3 [moved from secure/lib/libcrypto/man/CMS_verify.3 with 100% similarity]
lib/libcrypto/man/CMS_verify_receipt.3 [moved from secure/lib/libcrypto/man/CMS_verify_receipt.3 with 100% similarity]
lib/libcrypto/man/CONF_modules_free.3 [moved from secure/lib/libcrypto/man/CONF_modules_free.3 with 100% similarity]
lib/libcrypto/man/CONF_modules_load_file.3 [moved from secure/lib/libcrypto/man/CONF_modules_load_file.3 with 100% similarity]
lib/libcrypto/man/CRYPTO_set_ex_data.3 [moved from secure/lib/libcrypto/man/CRYPTO_set_ex_data.3 with 100% similarity]
lib/libcrypto/man/DH_generate_key.3 [moved from secure/lib/libcrypto/man/DH_generate_key.3 with 100% similarity]
lib/libcrypto/man/DH_generate_parameters.3 [moved from secure/lib/libcrypto/man/DH_generate_parameters.3 with 100% similarity]
lib/libcrypto/man/DH_get_ex_new_index.3 [moved from secure/lib/libcrypto/man/DH_get_ex_new_index.3 with 100% similarity]
lib/libcrypto/man/DH_new.3 [moved from secure/lib/libcrypto/man/DH_new.3 with 100% similarity]
lib/libcrypto/man/DH_set_method.3 [moved from secure/lib/libcrypto/man/DH_set_method.3 with 100% similarity]
lib/libcrypto/man/DH_size.3 [moved from secure/lib/libcrypto/man/DH_size.3 with 100% similarity]
lib/libcrypto/man/DSA_SIG_new.3 [moved from secure/lib/libcrypto/man/DSA_SIG_new.3 with 100% similarity]
lib/libcrypto/man/DSA_do_sign.3 [moved from secure/lib/libcrypto/man/DSA_do_sign.3 with 100% similarity]
lib/libcrypto/man/DSA_dup_DH.3 [moved from secure/lib/libcrypto/man/DSA_dup_DH.3 with 100% similarity]
lib/libcrypto/man/DSA_generate_key.3 [moved from secure/lib/libcrypto/man/DSA_generate_key.3 with 100% similarity]
lib/libcrypto/man/DSA_generate_parameters.3 [moved from secure/lib/libcrypto/man/DSA_generate_parameters.3 with 100% similarity]
lib/libcrypto/man/DSA_get_ex_new_index.3 [moved from secure/lib/libcrypto/man/DSA_get_ex_new_index.3 with 100% similarity]
lib/libcrypto/man/DSA_new.3 [moved from secure/lib/libcrypto/man/DSA_new.3 with 100% similarity]
lib/libcrypto/man/DSA_set_method.3 [moved from secure/lib/libcrypto/man/DSA_set_method.3 with 100% similarity]
lib/libcrypto/man/DSA_sign.3 [moved from secure/lib/libcrypto/man/DSA_sign.3 with 100% similarity]
lib/libcrypto/man/DSA_size.3 [moved from secure/lib/libcrypto/man/DSA_size.3 with 100% similarity]
lib/libcrypto/man/EC_GFp_simple_method.3 [moved from secure/lib/libcrypto/man/EC_GFp_simple_method.3 with 100% similarity]
lib/libcrypto/man/EC_GROUP_copy.3 [moved from secure/lib/libcrypto/man/EC_GROUP_copy.3 with 100% similarity]
lib/libcrypto/man/EC_GROUP_new.3 [moved from secure/lib/libcrypto/man/EC_GROUP_new.3 with 100% similarity]
lib/libcrypto/man/EC_KEY_new.3 [moved from secure/lib/libcrypto/man/EC_KEY_new.3 with 100% similarity]
lib/libcrypto/man/EC_POINT_add.3 [moved from secure/lib/libcrypto/man/EC_POINT_add.3 with 100% similarity]
lib/libcrypto/man/EC_POINT_new.3 [moved from secure/lib/libcrypto/man/EC_POINT_new.3 with 100% similarity]
lib/libcrypto/man/ERR_GET_LIB.3 [moved from secure/lib/libcrypto/man/ERR_GET_LIB.3 with 100% similarity]
lib/libcrypto/man/ERR_clear_error.3 [moved from secure/lib/libcrypto/man/ERR_clear_error.3 with 100% similarity]
lib/libcrypto/man/ERR_error_string.3 [moved from secure/lib/libcrypto/man/ERR_error_string.3 with 100% similarity]
lib/libcrypto/man/ERR_get_error.3 [moved from secure/lib/libcrypto/man/ERR_get_error.3 with 100% similarity]
lib/libcrypto/man/ERR_load_crypto_strings.3 [moved from secure/lib/libcrypto/man/ERR_load_crypto_strings.3 with 100% similarity]
lib/libcrypto/man/ERR_load_strings.3 [moved from secure/lib/libcrypto/man/ERR_load_strings.3 with 100% similarity]
lib/libcrypto/man/ERR_print_errors.3 [moved from secure/lib/libcrypto/man/ERR_print_errors.3 with 100% similarity]
lib/libcrypto/man/ERR_put_error.3 [moved from secure/lib/libcrypto/man/ERR_put_error.3 with 100% similarity]
lib/libcrypto/man/ERR_remove_state.3 [moved from secure/lib/libcrypto/man/ERR_remove_state.3 with 100% similarity]
lib/libcrypto/man/ERR_set_mark.3 [moved from secure/lib/libcrypto/man/ERR_set_mark.3 with 100% similarity]
lib/libcrypto/man/EVP_BytesToKey.3 [moved from secure/lib/libcrypto/man/EVP_BytesToKey.3 with 100% similarity]
lib/libcrypto/man/EVP_DigestInit.3 [moved from secure/lib/libcrypto/man/EVP_DigestInit.3 with 100% similarity]
lib/libcrypto/man/EVP_DigestSignInit.3 [moved from secure/lib/libcrypto/man/EVP_DigestSignInit.3 with 100% similarity]
lib/libcrypto/man/EVP_DigestVerifyInit.3 [moved from secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 with 100% similarity]
lib/libcrypto/man/EVP_EncodeInit.3 [moved from secure/lib/libcrypto/man/EVP_EncodeInit.3 with 100% similarity]
lib/libcrypto/man/EVP_EncryptInit.3 [moved from secure/lib/libcrypto/man/EVP_EncryptInit.3 with 100% similarity]
lib/libcrypto/man/EVP_OpenInit.3 [moved from secure/lib/libcrypto/man/EVP_OpenInit.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_CTX_new.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_cmp.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_cmp.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_decrypt.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_derive.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_derive.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_encrypt.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_get_default_digest.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_keygen.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_keygen.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_new.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_new.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_print_private.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_print_private.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_set1_RSA.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_sign.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_sign.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_verify.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_verify.3 with 100% similarity]
lib/libcrypto/man/EVP_PKEY_verify_recover.3 [moved from secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 with 100% similarity]
lib/libcrypto/man/EVP_SealInit.3 [moved from secure/lib/libcrypto/man/EVP_SealInit.3 with 100% similarity]
lib/libcrypto/man/EVP_SignInit.3 [moved from secure/lib/libcrypto/man/EVP_SignInit.3 with 100% similarity]
lib/libcrypto/man/EVP_VerifyInit.3 [moved from secure/lib/libcrypto/man/EVP_VerifyInit.3 with 100% similarity]
lib/libcrypto/man/OBJ_nid2obj.3 [moved from secure/lib/libcrypto/man/OBJ_nid2obj.3 with 100% similarity]
lib/libcrypto/man/OPENSSL_Applink.3 [moved from secure/lib/libcrypto/man/OPENSSL_Applink.3 with 100% similarity]
lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 [moved from secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 with 100% similarity]
lib/libcrypto/man/OPENSSL_config.3 [moved from secure/lib/libcrypto/man/OPENSSL_config.3 with 100% similarity]
lib/libcrypto/man/OPENSSL_ia32cap.3 [moved from secure/lib/libcrypto/man/OPENSSL_ia32cap.3 with 100% similarity]
lib/libcrypto/man/OPENSSL_instrument_bus.3 [moved from secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 with 100% similarity]
lib/libcrypto/man/OPENSSL_load_builtin_modules.3 [moved from secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 with 100% similarity]
lib/libcrypto/man/OpenSSL_add_all_algorithms.3 [moved from secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 with 100% similarity]
lib/libcrypto/man/PEM_write_bio_CMS_stream.3 [moved from secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 with 100% similarity]
lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 [moved from secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 with 100% similarity]
lib/libcrypto/man/PKCS12_create.3 [moved from secure/lib/libcrypto/man/PKCS12_create.3 with 100% similarity]
lib/libcrypto/man/PKCS12_parse.3 [moved from secure/lib/libcrypto/man/PKCS12_parse.3 with 100% similarity]
lib/libcrypto/man/PKCS7_decrypt.3 [moved from secure/lib/libcrypto/man/PKCS7_decrypt.3 with 100% similarity]
lib/libcrypto/man/PKCS7_encrypt.3 [moved from secure/lib/libcrypto/man/PKCS7_encrypt.3 with 100% similarity]
lib/libcrypto/man/PKCS7_sign.3 [moved from secure/lib/libcrypto/man/PKCS7_sign.3 with 100% similarity]
lib/libcrypto/man/PKCS7_sign_add_signer.3 [moved from secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 with 100% similarity]
lib/libcrypto/man/PKCS7_verify.3 [moved from secure/lib/libcrypto/man/PKCS7_verify.3 with 100% similarity]
lib/libcrypto/man/RAND_add.3 [moved from secure/lib/libcrypto/man/RAND_add.3 with 100% similarity]
lib/libcrypto/man/RAND_bytes.3 [moved from secure/lib/libcrypto/man/RAND_bytes.3 with 100% similarity]
lib/libcrypto/man/RAND_cleanup.3 [moved from secure/lib/libcrypto/man/RAND_cleanup.3 with 100% similarity]
lib/libcrypto/man/RAND_egd.3 [moved from secure/lib/libcrypto/man/RAND_egd.3 with 100% similarity]
lib/libcrypto/man/RAND_load_file.3 [moved from secure/lib/libcrypto/man/RAND_load_file.3 with 100% similarity]
lib/libcrypto/man/RAND_set_rand_method.3 [moved from secure/lib/libcrypto/man/RAND_set_rand_method.3 with 100% similarity]
lib/libcrypto/man/RSA_blinding_on.3 [moved from secure/lib/libcrypto/man/RSA_blinding_on.3 with 100% similarity]
lib/libcrypto/man/RSA_check_key.3 [moved from secure/lib/libcrypto/man/RSA_check_key.3 with 100% similarity]
lib/libcrypto/man/RSA_generate_key.3 [moved from secure/lib/libcrypto/man/RSA_generate_key.3 with 100% similarity]
lib/libcrypto/man/RSA_get_ex_new_index.3 [moved from secure/lib/libcrypto/man/RSA_get_ex_new_index.3 with 100% similarity]
lib/libcrypto/man/RSA_new.3 [moved from secure/lib/libcrypto/man/RSA_new.3 with 100% similarity]
lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 [moved from secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 with 100% similarity]
lib/libcrypto/man/RSA_print.3 [moved from secure/lib/libcrypto/man/RSA_print.3 with 100% similarity]
lib/libcrypto/man/RSA_private_encrypt.3 [moved from secure/lib/libcrypto/man/RSA_private_encrypt.3 with 100% similarity]
lib/libcrypto/man/RSA_public_encrypt.3 [moved from secure/lib/libcrypto/man/RSA_public_encrypt.3 with 100% similarity]
lib/libcrypto/man/RSA_set_method.3 [moved from secure/lib/libcrypto/man/RSA_set_method.3 with 100% similarity]
lib/libcrypto/man/RSA_sign.3 [moved from secure/lib/libcrypto/man/RSA_sign.3 with 100% similarity]
lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 [moved from secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 with 100% similarity]
lib/libcrypto/man/RSA_size.3 [moved from secure/lib/libcrypto/man/RSA_size.3 with 100% similarity]
lib/libcrypto/man/SMIME_read_CMS.3 [moved from secure/lib/libcrypto/man/SMIME_read_CMS.3 with 100% similarity]
lib/libcrypto/man/SMIME_read_PKCS7.3 [moved from secure/lib/libcrypto/man/SMIME_read_PKCS7.3 with 100% similarity]
lib/libcrypto/man/SMIME_write_CMS.3 [moved from secure/lib/libcrypto/man/SMIME_write_CMS.3 with 100% similarity]
lib/libcrypto/man/SMIME_write_PKCS7.3 [moved from secure/lib/libcrypto/man/SMIME_write_PKCS7.3 with 100% similarity]
lib/libcrypto/man/SSLeay_version.3 [moved from secure/lib/libcrypto/man/SSLeay_version.3 with 100% similarity]
lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 [moved from secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 with 100% similarity]
lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 [moved from secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 with 100% similarity]
lib/libcrypto/man/X509_NAME_get_index_by_NID.3 [moved from secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 with 100% similarity]
lib/libcrypto/man/X509_NAME_print_ex.3 [moved from secure/lib/libcrypto/man/X509_NAME_print_ex.3 with 100% similarity]
lib/libcrypto/man/X509_STORE_CTX_get_error.3 [moved from secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 with 100% similarity]
lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 [moved from secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3 with 100% similarity]
lib/libcrypto/man/X509_STORE_CTX_new.3 [moved from secure/lib/libcrypto/man/X509_STORE_CTX_new.3 with 100% similarity]
lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 [moved from secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 with 100% similarity]
lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 [moved from secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 with 100% similarity]
lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 [moved from secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 with 100% similarity]
lib/libcrypto/man/X509_check_host.3 [moved from secure/lib/libcrypto/man/X509_check_host.3 with 100% similarity]
lib/libcrypto/man/X509_new.3 [moved from secure/lib/libcrypto/man/X509_new.3 with 100% similarity]
lib/libcrypto/man/X509_verify_cert.3 [moved from secure/lib/libcrypto/man/X509_verify_cert.3 with 100% similarity]
lib/libcrypto/man/bio.3 [moved from secure/lib/libcrypto/man/bio.3 with 100% similarity]
lib/libcrypto/man/blowfish.3 [moved from secure/lib/libcrypto/man/blowfish.3 with 100% similarity]
lib/libcrypto/man/bn.3 [moved from secure/lib/libcrypto/man/bn.3 with 100% similarity]
lib/libcrypto/man/bn_internal.3 [moved from secure/lib/libcrypto/man/bn_internal.3 with 100% similarity]
lib/libcrypto/man/buffer.3 [moved from secure/lib/libcrypto/man/buffer.3 with 100% similarity]
lib/libcrypto/man/crypto.3 [moved from secure/lib/libcrypto/man/crypto.3 with 100% similarity]
lib/libcrypto/man/d2i_ASN1_OBJECT.3 [moved from secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3 with 100% similarity]
lib/libcrypto/man/d2i_CMS_ContentInfo.3 [moved from secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3 with 100% similarity]
lib/libcrypto/man/d2i_DHparams.3 [moved from secure/lib/libcrypto/man/d2i_DHparams.3 with 100% similarity]
lib/libcrypto/man/d2i_DSAPublicKey.3 [moved from secure/lib/libcrypto/man/d2i_DSAPublicKey.3 with 100% similarity]
lib/libcrypto/man/d2i_ECPKParameters.3 [moved from secure/lib/libcrypto/man/d2i_ECPKParameters.3 with 100% similarity]
lib/libcrypto/man/d2i_ECPrivateKey.3 [moved from secure/lib/libcrypto/man/d2i_ECPrivateKey.3 with 100% similarity]
lib/libcrypto/man/d2i_PKCS8PrivateKey.3 [moved from secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3 with 100% similarity]
lib/libcrypto/man/d2i_RSAPublicKey.3 [moved from secure/lib/libcrypto/man/d2i_RSAPublicKey.3 with 100% similarity]
lib/libcrypto/man/d2i_X509.3 [moved from secure/lib/libcrypto/man/d2i_X509.3 with 100% similarity]
lib/libcrypto/man/d2i_X509_ALGOR.3 [moved from secure/lib/libcrypto/man/d2i_X509_ALGOR.3 with 100% similarity]
lib/libcrypto/man/d2i_X509_CRL.3 [moved from secure/lib/libcrypto/man/d2i_X509_CRL.3 with 100% similarity]
lib/libcrypto/man/d2i_X509_NAME.3 [moved from secure/lib/libcrypto/man/d2i_X509_NAME.3 with 100% similarity]
lib/libcrypto/man/d2i_X509_REQ.3 [moved from secure/lib/libcrypto/man/d2i_X509_REQ.3 with 100% similarity]
lib/libcrypto/man/d2i_X509_SIG.3 [moved from secure/lib/libcrypto/man/d2i_X509_SIG.3 with 100% similarity]
lib/libcrypto/man/des.3 [moved from secure/lib/libcrypto/man/des.3 with 100% similarity]
lib/libcrypto/man/des_modes.7 [moved from secure/lib/libcrypto/man/des_modes.7 with 100% similarity]
lib/libcrypto/man/dh.3 [moved from secure/lib/libcrypto/man/dh.3 with 100% similarity]
lib/libcrypto/man/dsa.3 [moved from secure/lib/libcrypto/man/dsa.3 with 100% similarity]
lib/libcrypto/man/ec.3 [moved from secure/lib/libcrypto/man/ec.3 with 100% similarity]
lib/libcrypto/man/ecdsa.3 [moved from secure/lib/libcrypto/man/ecdsa.3 with 100% similarity]
lib/libcrypto/man/engine.3 [moved from secure/lib/libcrypto/man/engine.3 with 100% similarity]
lib/libcrypto/man/err.3 [moved from secure/lib/libcrypto/man/err.3 with 100% similarity]
lib/libcrypto/man/evp.3 [moved from secure/lib/libcrypto/man/evp.3 with 100% similarity]
lib/libcrypto/man/hmac.3 [moved from secure/lib/libcrypto/man/hmac.3 with 100% similarity]
lib/libcrypto/man/i2d_CMS_bio_stream.3 [moved from secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 with 100% similarity]
lib/libcrypto/man/i2d_PKCS7_bio_stream.3 [moved from secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 with 100% similarity]
lib/libcrypto/man/lh_stats.3 [moved from secure/lib/libcrypto/man/lh_stats.3 with 100% similarity]
lib/libcrypto/man/lhash.3 [moved from secure/lib/libcrypto/man/lhash.3 with 100% similarity]
lib/libcrypto/man/md5.3 [moved from secure/lib/libcrypto/man/md5.3 with 100% similarity]
lib/libcrypto/man/mdc2.3 [moved from secure/lib/libcrypto/man/mdc2.3 with 100% similarity]
lib/libcrypto/man/pem.3 [moved from secure/lib/libcrypto/man/pem.3 with 100% similarity]
lib/libcrypto/man/rand.3 [moved from secure/lib/libcrypto/man/rand.3 with 100% similarity]
lib/libcrypto/man/rc4.3 [moved from secure/lib/libcrypto/man/rc4.3 with 100% similarity]
lib/libcrypto/man/ripemd.3 [moved from secure/lib/libcrypto/man/ripemd.3 with 100% similarity]
lib/libcrypto/man/rsa.3 [moved from secure/lib/libcrypto/man/rsa.3 with 100% similarity]
lib/libcrypto/man/sha.3 [moved from secure/lib/libcrypto/man/sha.3 with 100% similarity]
lib/libcrypto/man/threads.3 [moved from secure/lib/libcrypto/man/threads.3 with 100% similarity]
lib/libcrypto/man/ui.3 [moved from secure/lib/libcrypto/man/ui.3 with 100% similarity]
lib/libcrypto/man/ui_compat.3 [moved from secure/lib/libcrypto/man/ui_compat.3 with 100% similarity]
lib/libcrypto/man/x509.3 [moved from secure/lib/libcrypto/man/x509.3 with 100% similarity]
lib/libcrypto/opensslconf.h [moved from secure/lib/libcrypto/opensslconf.h with 100% similarity]
lib/libmd/Makefile
lib/libmd/OBSOLETE [new file with mode: 0644]
lib/libmd/Symbol.map
lib/libmd/md4.h
lib/libmd/md4c.c
lib/libmd/md5.h
lib/libmd/md5c.c
lib/libmd/ripemd.3 [deleted file]
lib/libmd/ripemd.h
lib/libmd/rmd160c.c [deleted file]
lib/libmd/rmddriver.c [deleted file]
lib/libmd/sha.h
lib/libmd/sha0c.c [deleted file]
lib/libmd/sha1c.c [deleted file]
lib/libmd/sha256.h
lib/libmd/sha256c.c [deleted file]
lib/libmd/sha512.h
lib/libmd/sha512c.c [deleted file]
lib/libopie/Makefile
lib/librecrypto/Makefile [moved from secure/lib/librecrypto/Makefile with 100% similarity]
lib/librecrypto/Makefile.inc [moved from secure/lib/librecrypto/Makefile.inc with 86% similarity]
lib/libressl/Makefile [moved from secure/lib/libressl/Makefile with 100% similarity]
lib/libssh/Makefile [moved from secure/lib/libssh/Makefile with 100% similarity]
lib/libssh/Makefile.etc [moved from secure/lib/libssh/Makefile.etc with 100% similarity]
lib/libssh/config.h [moved from secure/lib/libssh/config.h with 100% similarity]
lib/libssl/Makefile [moved from secure/lib/libssl/Makefile with 100% similarity]
lib/libssl/Makefile.man [moved from secure/lib/libssl/Makefile.man with 100% similarity]
lib/libssl/man/SSL_CIPHER_get_name.3 [moved from secure/lib/libssl/man/SSL_CIPHER_get_name.3 with 100% similarity]
lib/libssl/man/SSL_COMP_add_compression_method.3 [moved from secure/lib/libssl/man/SSL_COMP_add_compression_method.3 with 100% similarity]
lib/libssl/man/SSL_CONF_CTX_new.3 [moved from secure/lib/libssl/man/SSL_CONF_CTX_new.3 with 100% similarity]
lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 [moved from secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3 with 100% similarity]
lib/libssl/man/SSL_CONF_CTX_set_flags.3 [moved from secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3 with 100% similarity]
lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 [moved from secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3 with 100% similarity]
lib/libssl/man/SSL_CONF_cmd.3 [moved from secure/lib/libssl/man/SSL_CONF_cmd.3 with 100% similarity]
lib/libssl/man/SSL_CONF_cmd_argv.3 [moved from secure/lib/libssl/man/SSL_CONF_cmd_argv.3 with 100% similarity]
lib/libssl/man/SSL_CTX_add1_chain_cert.3 [moved from secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3 with 100% similarity]
lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 [moved from secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 with 100% similarity]
lib/libssl/man/SSL_CTX_add_session.3 [moved from secure/lib/libssl/man/SSL_CTX_add_session.3 with 100% similarity]
lib/libssl/man/SSL_CTX_ctrl.3 [moved from secure/lib/libssl/man/SSL_CTX_ctrl.3 with 100% similarity]
lib/libssl/man/SSL_CTX_flush_sessions.3 [moved from secure/lib/libssl/man/SSL_CTX_flush_sessions.3 with 100% similarity]
lib/libssl/man/SSL_CTX_free.3 [moved from secure/lib/libssl/man/SSL_CTX_free.3 with 100% similarity]
lib/libssl/man/SSL_CTX_get0_param.3 [moved from secure/lib/libssl/man/SSL_CTX_get0_param.3 with 100% similarity]
lib/libssl/man/SSL_CTX_get_ex_new_index.3 [moved from secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3 with 100% similarity]
lib/libssl/man/SSL_CTX_get_verify_mode.3 [moved from secure/lib/libssl/man/SSL_CTX_get_verify_mode.3 with 100% similarity]
lib/libssl/man/SSL_CTX_load_verify_locations.3 [moved from secure/lib/libssl/man/SSL_CTX_load_verify_locations.3 with 100% similarity]
lib/libssl/man/SSL_CTX_new.3 [moved from secure/lib/libssl/man/SSL_CTX_new.3 with 100% similarity]
lib/libssl/man/SSL_CTX_sess_number.3 [moved from secure/lib/libssl/man/SSL_CTX_sess_number.3 with 100% similarity]
lib/libssl/man/SSL_CTX_sess_set_cache_size.3 [moved from secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3 with 100% similarity]
lib/libssl/man/SSL_CTX_sess_set_get_cb.3 [moved from secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3 with 100% similarity]
lib/libssl/man/SSL_CTX_sessions.3 [moved from secure/lib/libssl/man/SSL_CTX_sessions.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set1_curves.3 [moved from secure/lib/libssl/man/SSL_CTX_set1_curves.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 [moved from secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 [moved from secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_cert_cb.3 [moved from secure/lib/libssl/man/SSL_CTX_set_cert_cb.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_cert_store.3 [moved from secure/lib/libssl/man/SSL_CTX_set_cert_store.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 [moved from secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_cipher_list.3 [moved from secure/lib/libssl/man/SSL_CTX_set_cipher_list.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_client_CA_list.3 [moved from secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_client_cert_cb.3 [moved from secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 [moved from secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 [moved from secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_generate_session_id.3 [moved from secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_info_callback.3 [moved from secure/lib/libssl/man/SSL_CTX_set_info_callback.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_max_cert_list.3 [moved from secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_mode.3 [moved from secure/lib/libssl/man/SSL_CTX_set_mode.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_msg_callback.3 [moved from secure/lib/libssl/man/SSL_CTX_set_msg_callback.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_options.3 [moved from secure/lib/libssl/man/SSL_CTX_set_options.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_psk_client_callback.3 [moved from secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 [moved from secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_read_ahead.3 [moved from secure/lib/libssl/man/SSL_CTX_set_read_ahead.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_session_cache_mode.3 [moved from secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_session_id_context.3 [moved from secure/lib/libssl/man/SSL_CTX_set_session_id_context.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_ssl_version.3 [moved from secure/lib/libssl/man/SSL_CTX_set_ssl_version.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_timeout.3 [moved from secure/lib/libssl/man/SSL_CTX_set_timeout.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 [moved from secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 [moved from secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 [moved from secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 [moved from secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3 with 100% similarity]
lib/libssl/man/SSL_CTX_set_verify.3 [moved from secure/lib/libssl/man/SSL_CTX_set_verify.3 with 100% similarity]
lib/libssl/man/SSL_CTX_use_certificate.3 [moved from secure/lib/libssl/man/SSL_CTX_use_certificate.3 with 100% similarity]
lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 [moved from secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 with 100% similarity]
lib/libssl/man/SSL_CTX_use_serverinfo.3 [moved from secure/lib/libssl/man/SSL_CTX_use_serverinfo.3 with 100% similarity]
lib/libssl/man/SSL_SESSION_free.3 [moved from secure/lib/libssl/man/SSL_SESSION_free.3 with 100% similarity]
lib/libssl/man/SSL_SESSION_get_ex_new_index.3 [moved from secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3 with 100% similarity]
lib/libssl/man/SSL_SESSION_get_time.3 [moved from secure/lib/libssl/man/SSL_SESSION_get_time.3 with 100% similarity]
lib/libssl/man/SSL_accept.3 [moved from secure/lib/libssl/man/SSL_accept.3 with 100% similarity]
lib/libssl/man/SSL_alert_type_string.3 [moved from secure/lib/libssl/man/SSL_alert_type_string.3 with 100% similarity]
lib/libssl/man/SSL_check_chain.3 [moved from secure/lib/libssl/man/SSL_check_chain.3 with 100% similarity]
lib/libssl/man/SSL_clear.3 [moved from secure/lib/libssl/man/SSL_clear.3 with 100% similarity]
lib/libssl/man/SSL_connect.3 [moved from secure/lib/libssl/man/SSL_connect.3 with 100% similarity]
lib/libssl/man/SSL_do_handshake.3 [moved from secure/lib/libssl/man/SSL_do_handshake.3 with 100% similarity]
lib/libssl/man/SSL_free.3 [moved from secure/lib/libssl/man/SSL_free.3 with 100% similarity]
lib/libssl/man/SSL_get_SSL_CTX.3 [moved from secure/lib/libssl/man/SSL_get_SSL_CTX.3 with 100% similarity]
lib/libssl/man/SSL_get_ciphers.3 [moved from secure/lib/libssl/man/SSL_get_ciphers.3 with 100% similarity]
lib/libssl/man/SSL_get_client_CA_list.3 [moved from secure/lib/libssl/man/SSL_get_client_CA_list.3 with 100% similarity]
lib/libssl/man/SSL_get_current_cipher.3 [moved from secure/lib/libssl/man/SSL_get_current_cipher.3 with 100% similarity]
lib/libssl/man/SSL_get_default_timeout.3 [moved from secure/lib/libssl/man/SSL_get_default_timeout.3 with 100% similarity]
lib/libssl/man/SSL_get_error.3 [moved from secure/lib/libssl/man/SSL_get_error.3 with 100% similarity]
lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 [moved from secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3 with 100% similarity]
lib/libssl/man/SSL_get_ex_new_index.3 [moved from secure/lib/libssl/man/SSL_get_ex_new_index.3 with 100% similarity]
lib/libssl/man/SSL_get_fd.3 [moved from secure/lib/libssl/man/SSL_get_fd.3 with 100% similarity]
lib/libssl/man/SSL_get_peer_cert_chain.3 [moved from secure/lib/libssl/man/SSL_get_peer_cert_chain.3 with 100% similarity]
lib/libssl/man/SSL_get_peer_certificate.3 [moved from secure/lib/libssl/man/SSL_get_peer_certificate.3 with 100% similarity]
lib/libssl/man/SSL_get_psk_identity.3 [moved from secure/lib/libssl/man/SSL_get_psk_identity.3 with 100% similarity]
lib/libssl/man/SSL_get_rbio.3 [moved from secure/lib/libssl/man/SSL_get_rbio.3 with 100% similarity]
lib/libssl/man/SSL_get_session.3 [moved from secure/lib/libssl/man/SSL_get_session.3 with 100% similarity]
lib/libssl/man/SSL_get_verify_result.3 [moved from secure/lib/libssl/man/SSL_get_verify_result.3 with 100% similarity]
lib/libssl/man/SSL_get_version.3 [moved from secure/lib/libssl/man/SSL_get_version.3 with 100% similarity]
lib/libssl/man/SSL_library_init.3 [moved from secure/lib/libssl/man/SSL_library_init.3 with 100% similarity]
lib/libssl/man/SSL_load_client_CA_file.3 [moved from secure/lib/libssl/man/SSL_load_client_CA_file.3 with 100% similarity]
lib/libssl/man/SSL_new.3 [moved from secure/lib/libssl/man/SSL_new.3 with 100% similarity]
lib/libssl/man/SSL_pending.3 [moved from secure/lib/libssl/man/SSL_pending.3 with 100% similarity]
lib/libssl/man/SSL_read.3 [moved from secure/lib/libssl/man/SSL_read.3 with 100% similarity]
lib/libssl/man/SSL_rstate_string.3 [moved from secure/lib/libssl/man/SSL_rstate_string.3 with 100% similarity]
lib/libssl/man/SSL_session_reused.3 [moved from secure/lib/libssl/man/SSL_session_reused.3 with 100% similarity]
lib/libssl/man/SSL_set_bio.3 [moved from secure/lib/libssl/man/SSL_set_bio.3 with 100% similarity]
lib/libssl/man/SSL_set_connect_state.3 [moved from secure/lib/libssl/man/SSL_set_connect_state.3 with 100% similarity]
lib/libssl/man/SSL_set_fd.3 [moved from secure/lib/libssl/man/SSL_set_fd.3 with 100% similarity]
lib/libssl/man/SSL_set_session.3 [moved from secure/lib/libssl/man/SSL_set_session.3 with 100% similarity]
lib/libssl/man/SSL_set_shutdown.3 [moved from secure/lib/libssl/man/SSL_set_shutdown.3 with 100% similarity]
lib/libssl/man/SSL_set_verify_result.3 [moved from secure/lib/libssl/man/SSL_set_verify_result.3 with 100% similarity]
lib/libssl/man/SSL_shutdown.3 [moved from secure/lib/libssl/man/SSL_shutdown.3 with 100% similarity]
lib/libssl/man/SSL_state_string.3 [moved from secure/lib/libssl/man/SSL_state_string.3 with 100% similarity]
lib/libssl/man/SSL_want.3 [moved from secure/lib/libssl/man/SSL_want.3 with 100% similarity]
lib/libssl/man/SSL_write.3 [moved from secure/lib/libssl/man/SSL_write.3 with 100% similarity]
lib/libssl/man/d2i_SSL_SESSION.3 [moved from secure/lib/libssl/man/d2i_SSL_SESSION.3 with 100% similarity]
lib/libssl/man/ssl.3 [moved from secure/lib/libssl/man/ssl.3 with 100% similarity]
libexec/Makefile
libexec/sftp-server/Makefile [moved from secure/libexec/sftp-server/Makefile with 100% similarity]
libexec/ssh-keysign/Makefile [moved from secure/libexec/ssh-keysign/Makefile with 97% similarity]
libexec/ssh-pkcs11-helper/Makefile [moved from secure/libexec/ssh-pkcs11-helper/Makefile with 93% similarity]
sbin/hammer/Makefile
sbin/hammer2/Makefile
sbin/init/Makefile
sbin/iscontrol/Makefile
sbin/md5/Makefile
sbin/md5/md5.c
sbin/md5/sha1hl.c [new file with mode: 0644]
sbin/md5/sha1hl.h [new file with mode: 0644]
sbin/ping6/Makefile
secure/Makefile [deleted file]
secure/Makefile.inc [deleted file]
secure/Makefile.ssh.common [deleted file]
secure/lib/Makefile [deleted file]
secure/lib/Makefile.inc [deleted file]
secure/libexec/Makefile [deleted file]
secure/libexec/Makefile.inc [deleted file]
secure/usr.bin/Makefile [deleted file]
secure/usr.bin/Makefile.inc [deleted file]
secure/usr.sbin/Makefile [deleted file]
secure/usr.sbin/Makefile.inc [deleted file]
share/initrd/bin/Makefile
share/initrd/sbin.libcrypto/Makefile
share/initrd/sbin/Makefile
share/mk/bsd.subdir.mk
sys/conf/kern.pre.mk
sys/conf/kmod.mk
sys/dev/crypto/safe/safe.c
sys/dev/crypto/ubsec/ubsec.c
sys/kern/md5c.c
sys/sys/md5.h
sys/vfs/hammer/hammer.h
sys/vfs/hammer/hammer_vfsops.c
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_vfsops.c
tools/make_libdeps.sh
usr.bin/Makefile
usr.bin/bdes/Makefile [moved from secure/usr.bin/bdes/Makefile with 83% similarity]
usr.bin/bdes/bdes.1 [moved from secure/usr.bin/bdes/bdes.1 with 100% similarity]
usr.bin/bdes/bdes.c [moved from secure/usr.bin/bdes/bdes.c with 100% similarity]
usr.bin/bdes/bdes.ps [moved from secure/usr.bin/bdes/bdes.ps with 100% similarity]
usr.bin/nc/Makefile [new file with mode: 0644]
usr.bin/openssl/Makefile [moved from secure/usr.bin/openssl/Makefile with 94% similarity]
usr.bin/openssl/Makefile.etc [moved from secure/usr.bin/openssl/Makefile.etc with 100% similarity]
usr.bin/openssl/Makefile.man [moved from secure/usr.bin/openssl/Makefile.man with 100% similarity]
usr.bin/openssl/man/CA.pl.1 [moved from secure/usr.bin/openssl/man/CA.pl.1 with 100% similarity]
usr.bin/openssl/man/asn1parse.1 [moved from secure/usr.bin/openssl/man/asn1parse.1 with 100% similarity]
usr.bin/openssl/man/c_rehash.1 [moved from secure/usr.bin/openssl/man/c_rehash.1 with 100% similarity]
usr.bin/openssl/man/ca.1 [moved from secure/usr.bin/openssl/man/ca.1 with 100% similarity]
usr.bin/openssl/man/ciphers.1 [moved from secure/usr.bin/openssl/man/ciphers.1 with 100% similarity]
usr.bin/openssl/man/cms.1 [moved from secure/usr.bin/openssl/man/cms.1 with 100% similarity]
usr.bin/openssl/man/config.5 [moved from secure/usr.bin/openssl/man/config.5 with 100% similarity]
usr.bin/openssl/man/crl.1 [moved from secure/usr.bin/openssl/man/crl.1 with 100% similarity]
usr.bin/openssl/man/crl2pkcs7.1 [moved from secure/usr.bin/openssl/man/crl2pkcs7.1 with 100% similarity]
usr.bin/openssl/man/dgst.1 [moved from secure/usr.bin/openssl/man/dgst.1 with 100% similarity]
usr.bin/openssl/man/dhparam.1 [moved from secure/usr.bin/openssl/man/dhparam.1 with 100% similarity]
usr.bin/openssl/man/dsa.1 [moved from secure/usr.bin/openssl/man/dsa.1 with 100% similarity]
usr.bin/openssl/man/dsaparam.1 [moved from secure/usr.bin/openssl/man/dsaparam.1 with 100% similarity]
usr.bin/openssl/man/ec.1 [moved from secure/usr.bin/openssl/man/ec.1 with 100% similarity]
usr.bin/openssl/man/ecparam.1 [moved from secure/usr.bin/openssl/man/ecparam.1 with 100% similarity]
usr.bin/openssl/man/enc.1 [moved from secure/usr.bin/openssl/man/enc.1 with 100% similarity]
usr.bin/openssl/man/errstr.1 [moved from secure/usr.bin/openssl/man/errstr.1 with 100% similarity]
usr.bin/openssl/man/gendsa.1 [moved from secure/usr.bin/openssl/man/gendsa.1 with 100% similarity]
usr.bin/openssl/man/genpkey.1 [moved from secure/usr.bin/openssl/man/genpkey.1 with 100% similarity]
usr.bin/openssl/man/genrsa.1 [moved from secure/usr.bin/openssl/man/genrsa.1 with 100% similarity]
usr.bin/openssl/man/nseq.1 [moved from secure/usr.bin/openssl/man/nseq.1 with 100% similarity]
usr.bin/openssl/man/ocsp.1 [moved from secure/usr.bin/openssl/man/ocsp.1 with 100% similarity]
usr.bin/openssl/man/openssl.1 [moved from secure/usr.bin/openssl/man/openssl.1 with 100% similarity]
usr.bin/openssl/man/passwd.1 [moved from secure/usr.bin/openssl/man/passwd.1 with 100% similarity]
usr.bin/openssl/man/pkcs12.1 [moved from secure/usr.bin/openssl/man/pkcs12.1 with 100% similarity]
usr.bin/openssl/man/pkcs7.1 [moved from secure/usr.bin/openssl/man/pkcs7.1 with 100% similarity]
usr.bin/openssl/man/pkcs8.1 [moved from secure/usr.bin/openssl/man/pkcs8.1 with 100% similarity]
usr.bin/openssl/man/pkey.1 [moved from secure/usr.bin/openssl/man/pkey.1 with 100% similarity]
usr.bin/openssl/man/pkeyparam.1 [moved from secure/usr.bin/openssl/man/pkeyparam.1 with 100% similarity]
usr.bin/openssl/man/pkeyutl.1 [moved from secure/usr.bin/openssl/man/pkeyutl.1 with 100% similarity]
usr.bin/openssl/man/rand.1 [moved from secure/usr.bin/openssl/man/rand.1 with 100% similarity]
usr.bin/openssl/man/req.1 [moved from secure/usr.bin/openssl/man/req.1 with 100% similarity]
usr.bin/openssl/man/rsa.1 [moved from secure/usr.bin/openssl/man/rsa.1 with 100% similarity]
usr.bin/openssl/man/rsautl.1 [moved from secure/usr.bin/openssl/man/rsautl.1 with 100% similarity]
usr.bin/openssl/man/s_client.1 [moved from secure/usr.bin/openssl/man/s_client.1 with 100% similarity]
usr.bin/openssl/man/s_server.1 [moved from secure/usr.bin/openssl/man/s_server.1 with 100% similarity]
usr.bin/openssl/man/s_time.1 [moved from secure/usr.bin/openssl/man/s_time.1 with 100% similarity]
usr.bin/openssl/man/sess_id.1 [moved from secure/usr.bin/openssl/man/sess_id.1 with 100% similarity]
usr.bin/openssl/man/smime.1 [moved from secure/usr.bin/openssl/man/smime.1 with 100% similarity]
usr.bin/openssl/man/speed.1 [moved from secure/usr.bin/openssl/man/speed.1 with 100% similarity]
usr.bin/openssl/man/spkac.1 [moved from secure/usr.bin/openssl/man/spkac.1 with 100% similarity]
usr.bin/openssl/man/ts.1 [moved from secure/usr.bin/openssl/man/ts.1 with 100% similarity]
usr.bin/openssl/man/tsget.1 [moved from secure/usr.bin/openssl/man/tsget.1 with 100% similarity]
usr.bin/openssl/man/verify.1 [moved from secure/usr.bin/openssl/man/verify.1 with 100% similarity]
usr.bin/openssl/man/version.1 [moved from secure/usr.bin/openssl/man/version.1 with 100% similarity]
usr.bin/openssl/man/x509.1 [moved from secure/usr.bin/openssl/man/x509.1 with 100% similarity]
usr.bin/openssl/man/x509v3_config.5 [moved from secure/usr.bin/openssl/man/x509v3_config.5 with 100% similarity]
usr.bin/scp/Makefile [moved from secure/usr.bin/scp/Makefile with 100% similarity]
usr.bin/sftp/Makefile [moved from secure/usr.bin/sftp/Makefile with 100% similarity]
usr.bin/ssh-add/Makefile [moved from secure/usr.bin/ssh-add/Makefile with 100% similarity]
usr.bin/ssh-agent/Makefile [moved from secure/usr.bin/ssh-agent/Makefile with 100% similarity]
usr.bin/ssh-keygen/Makefile [moved from secure/usr.bin/ssh-keygen/Makefile with 100% similarity]
usr.bin/ssh-keyscan/Makefile [moved from secure/usr.bin/ssh-keyscan/Makefile with 100% similarity]
usr.bin/ssh/Makefile [moved from secure/usr.bin/ssh/Makefile with 100% similarity]
usr.bin/ssh/Makefile.etc [moved from secure/usr.bin/ssh/Makefile.etc with 100% similarity]
usr.sbin/Makefile
usr.sbin/mtree/Makefile
usr.sbin/mtree/compare.c
usr.sbin/ppp/chap_ms.c
usr.sbin/sshd/Makefile [moved from secure/usr.sbin/sshd/Makefile with 100% similarity]
usr.sbin/sshd/Makefile.etc [moved from secure/usr.sbin/sshd/Makefile.etc with 84% similarity]
usr.sbin/sshd/auth-passwd-freebsd.c [moved from secure/usr.sbin/sshd/auth-passwd-freebsd.c with 100% similarity]

index c8e886f..bd215b5 100644 (file)
@@ -62,9 +62,6 @@ SUBDIR+= gnu
 .if exists(${.CURDIR}/sbin)
 SUBDIR+= sbin
 .endif
-.if exists(${.CURDIR}/secure) && !defined(NO_CRYPT)
-SUBDIR+= secure
-.endif
 .if exists(${.CURDIR}/share) && !defined(NO_SHARE)
 SUBDIR+= share
 .endif
@@ -1045,14 +1042,13 @@ _generic_libs+= lib
 
 .if !defined(NO_CRYPT)
 .if defined(FORCE_OPENSSL)
-_prebuild_libs+=       secure/lib/libcrypto secure/lib/libssl
+_prebuild_libs+=       lib/libcrypto lib/libssl
 .endif
 .if !defined(NO_LIBRESSL)
-_prebuild_libs+=       secure/lib/librecrypto secure/lib/libressl
-_prebuild_libs+=       secure/lib/libssh
-secure/lib/libssh__L: secure/lib/librecrypto__L lib/libz__L
+_prebuild_libs+=       lib/librecrypto lib/libressl
+_prebuild_libs+=       lib/libssh
+lib/libssh__L: lib/librecrypto__L lib/libz__L
 .endif
-_generic_libs+=        secure/lib
 .endif
 
 _prebuild_libs+= lib/libradius lib/libsbuf lib/libtacplus lib/libm \
diff --git a/Makefile.ssh.common b/Makefile.ssh.common
new file mode 100644 (file)
index 0000000..c3080d3
--- /dev/null
@@ -0,0 +1,27 @@
+# SSH common setup
+#
+
+# Bad hack because .INCLUDEDFROMDIR does not work.
+#
+.if exists(${.CURDIR}/../../Makefile.inc1)
+SSHC_SYSDIR=${.CURDIR}/../..
+.elif exists(${.CURDIR}/../../../Makefile.inc1)
+SSHC_SYSDIR=${.CURDIR}/../../..
+.else
+.error "Cannot find soure base"
+.endif
+
+SSHDIR=                ${SSHC_SYSDIR}/crypto/openssh
+
+XAUTH_PATH?=   /usr/local/bin/xauth
+CFLAGS+=       -DXAUTH_PATH=\"${XAUTH_PATH}\"
+CFLAGS+=       -I${SSHC_SYSDIR}/crypto/libressl/include
+CFLAGS+=       -I${SSHC_SYSDIR}/lib/libssh -I${SSHDIR}
+
+.if ${.CURDIR:T} != "libssh"
+DPADD+=                ${LIBSSH} ${LIBRECRYPTO} ${LIBUTIL} ${LIBZ} ${LIBPTHREAD}
+LDADD+=                -lprivate_ssh -lprivate_crypto -lutil -lz -lpthread
+LDFLAGS+=      -rpath /lib/priv:/usr/lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
+.endif
+
+.PATH: ${SSHDIR} ${SSHDIR}/openbsd-compat
index d577e56..0fd342b 100644 (file)
@@ -41,13 +41,13 @@ MLINKS= csh.1 tcsh.1
 DPADD= /usr/lib/libtermcap.a ${LIBCRYPT}
 LDADD= -ltermcap -lcrypt
 .  else
-DPADD= ${LIBNCURSES} ${LIBCRYPT}
-LDADD= -lprivate_ncurses -lcrypt
+DPADD= ${LIBNCURSES} ${LIBCRYPT} ${LIBRECRYPTO}
+LDADD= -lprivate_ncurses -lcrypt -lprivate_crypto
 LDFLAGS+=      -rpath /lib/priv -L /usr/lib/priv
 .  endif
 .else
-DPADD= ${LIBNCURSES} ${LIBCRYPT}
-LDADD= -lprivate_ncurses -lcrypt
+DPADD= ${LIBNCURSES} ${LIBCRYPT} ${LIBRECRYPTO}
+LDADD= -lprivate_ncurses -lcrypt -lprivate_crypto
 LDFLAGS+=      -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 .endif
 
index 5379c11..44f8bed 100644 (file)
@@ -40,7 +40,7 @@ BIN1+=        ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config
 .endif
 
 .if !defined(NO_LIBRESSL)
-DIRS+= secure/lib/libssh \
+DIRS+= lib/libssh \
        secure/usr.bin/ssh \
        secure/usr.sbin/sshd \
        secure/usr.bin/openssl
@@ -201,8 +201,8 @@ upgrade_etc:        upgrade_check preupgrade remove-obsolete-files
        rm -f ${DESTDIR}/usr/lib/${lib}
 .endif
 .endfor
-       cd ${.CURDIR}/../secure/lib/libssh; ${MAKE} -f Makefile.etc obj
-       cd ${.CURDIR}/../secure/lib/libssh; ${MAKE} -f Makefile.etc install
+       cd ${.CURDIR}/../lib/libssh; ${MAKE} -f Makefile.etc obj
+       cd ${.CURDIR}/../lib/libssh; ${MAKE} -f Makefile.etc install
 .if exists(${DESTDIR}/boot)
 .if exists(${DESTDIR}/kernel)
        chflags noschg ${DESTDIR}/kernel
index 8bfd443..d5fed88 100644 (file)
@@ -196,6 +196,8 @@ copies:             mtree_setup
 .for i in ${SHDRS}
        ${LN} -sf ../sys/$i ${DESTDIR}/usr/include/machine/$i
 .endfor
+       cpdup -o ${.CURDIR}/../crypto/libressl/include/openssl \
+               ${DESTDIR}/usr/include/openssl
 .for i in ${RMHEADERS}
        rm -f ${DESTDIR}/usr/include/$i
 .endfor
@@ -219,6 +221,9 @@ symlinks:   mtree_setup
                ${DESTDIR}/usr/include/machine
        cpdup -o ${.CURDIR}/../sys/platform/${MACHINE_PLATFORM}/include \
                ${DESTDIR}/usr/include/machine
+       rm -rf ${DESTDIR}/usr/include/openssl
+       ${LN} -s ${.CURDIR}/../crypto/libressl/include/openssl \
+               ${DESTDIR}/usr/include/openssl
 
 .include <bsd.prog.mk>
 
index fa3715c..170a950 100644 (file)
@@ -12,7 +12,7 @@
 #    libpam must be built before pam_module
 #
 # libmd must be built before libfetch, libarchive.
-# libcrypt must be built before libfetch and libradius.
+# libcrypt must be built before libfetch, libarchive, and libradius.
 # libz must be built before libarchive, libmagic.
 # libbz2 must be built before libarchive
 # libncurses must be built before libedit.
 #
 # Otherwise, the SUBDIR list should be in alphabetical order.
 
-SUBDIR_ORDERED=        ${_libc_r} \
+SUBDIR_ORDERED=        ${_libc_r}
+
+.if defined(FORCE_OPENSSL) # to be removed during 4.8 development
+SUBDIR_ORDERED+=libcrypto libssl
+.endif
+.if !defined(NO_LIBRESSL)
+SUBDIR_ORDERED+=librecrypto libressl libssh
+.endif
+
+SUBDIR_ORDERED+= \
        libcrypt \
+       libarchive \
        libz \
        libmd \
        libncurses \
@@ -35,7 +45,6 @@ SUBDIR_ORDERED=       ${_libc_r} \
        libutil \
        libpthread \
        liblzma \
-       libarchive \
        libfetch \
        libedit \
        libcam \
@@ -43,7 +52,9 @@ SUBDIR_ORDERED=       ${_libc_r} \
        libusb \
        libelf \
        libexecinfo
+
 SUBDIR=        ${SUBDIR_ORDERED} \
+       libcipher \
        csu \
        i18n_module \
        libalias \
index ae20f8d..8a146d4 100644 (file)
@@ -13,8 +13,9 @@ CFLAGS+=      -I${.OBJDIR} -I${.CURDIR} -I${CONTRIBDIR}
 SHARED_CFLAGS+=        -DHAVE_ICONV=1 -DHAVE_ICONV_H=1
 WARNS?=        2
 
-DPADD= ${LIBBZ2} ${LIBLZMA} ${LIBMD} ${LIBZ}
-LDADD= -lbz2 -llzma -lmd -lz
+DPADD= ${LIBBZ2} ${LIBLZMA} ${LIBMD} ${LIBCRYPTO} ${LIBZ}
+LDADD= -lbz2 -llzma -lmd -lprivate_crypto -lz
+LDFLAGS+= -rpath /lib/priv -L ${_SHLIBDIRPREFIX}/usr/lib/priv
 
 INCS=  archive.h archive_entry.h
 
index 584c4ad..cf6147a 100644 (file)
@@ -11,13 +11,14 @@ SHLIBDIR?=  /lib
 SRCS=          crypt.c crypt-md5.c \
                crypt-sha256.c crypt-sha512.c \
                deprecated-crypt-sha256.c deprecated-crypt-sha512.c \
-               md5c.c sha256c.c sha512c.c misc.c
+               md5c.c misc.c
 WARNS?=                2
 NO_STRICT_ALIASING=
 
 MAN=           crypt.3
 MLINKS=                crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3
 CFLAGS+=       -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
 CFLAGS+=       -D_CTYPE_H_DISABLE_MACROS_ 
 # Pull in the crypt-des.c source, assuming it is present.
 .if exists(${.CURDIR}/../../secure/lib/libcrypt/crypt-des.c) && \
@@ -30,10 +31,7 @@ CFLAGS+=     -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH
 .PATH:         ${.CURDIR}/../libutil
 SRCS+=         auth.c property.c
 .for sym in MD5Init MD5Final MD5Update MD5Pad auth_getval \
-           property_find properties_read properties_free \
-           SHA256_Init SHA256_Update SHA256_Final SHA256_Transform \
-           SHA384_Init SHA384_Update SHA384_Final SHA384_Transform \
-           SHA512_Init SHA512_Update SHA512_Final SHA512_Transform
+           property_find properties_read properties_free
 CFLAGS+=       -D${sym}=_libcrypt_${sym}
 .endfor
 PRECIOUSLIB=   yes
index 9af9980..1f7f7e3 100644 (file)
 #include <sys/param.h>
 #include <sys/types.h>
 
-
-/* Structure to save state of computation between the single steps.  */
-struct sha256_ctx
-{
-  uint32_t H[8];
-
-  uint32_t total[2];
-  uint32_t buflen;
-  char buffer[128];    /* NB: always correctly aligned for uint32_t.  */
-};
-
+#include "local.h"
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 # define SWAP(n) \
@@ -62,8 +52,8 @@ static const uint32_t K[64] =
 
 /* Process LEN bytes of BUFFER, accumulating context into CTX.
    It is assumed that LEN % 64 == 0.  */
-static void
-sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
+void
+__crypt__sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
 {
   const uint32_t *words = buffer;
   size_t nwords = len / sizeof (uint32_t);
@@ -162,8 +152,8 @@ sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
 
 /* Initialize structure containing state of computation.
    (FIPS 180-2:5.3.2)  */
-static void
-sha256_init_ctx (struct sha256_ctx *ctx)
+void
+__crypt__sha256_init_ctx (struct sha256_ctx *ctx)
 {
   ctx->H[0] = 0x6a09e667;
   ctx->H[1] = 0xbb67ae85;
@@ -184,8 +174,8 @@ sha256_init_ctx (struct sha256_ctx *ctx)
 
    IMPORTANT: On some systems it is required that RESBUF is correctly
    aligned for a 32 bits value.  */
-static void *
-sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
+void *
+__crypt__sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
 {
   /* Take yet unprocessed bytes into account.  */
   uint32_t bytes = ctx->buflen;
@@ -205,7 +195,7 @@ sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
                                                  (ctx->total[0] >> 29));
 
   /* Process last bytes.  */
-  sha256_process_block (ctx->buffer, bytes + pad + 8, ctx);
+  __crypt__sha256_process_block (ctx->buffer, bytes + pad + 8, ctx);
 
   /* Put result from CTX in first 32 bytes following RESBUF.  */
   for (unsigned int i = 0; i < 8; ++i)
@@ -214,9 +204,8 @@ sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
   return resbuf;
 }
 
-
-static void
-sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
+void
+__crypt__sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
 {
   /* When we already have some bits in our internal buffer concatenate
      both inputs first.  */
@@ -230,7 +219,7 @@ sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
 
       if (ctx->buflen > 64)
        {
-         sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
+         __crypt__sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
 
          ctx->buflen &= 63;
          /* The regions in the following copy operation cannot overlap.  */
@@ -255,13 +244,13 @@ sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
       if (UNALIGNED_P (buffer))
        while (len > 64)
          {
-           sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
+           __crypt__sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
            buffer = (const char *) buffer + 64;
            len -= 64;
          }
       else
        {
-         sha256_process_block (buffer, len & ~63, ctx);
+         __crypt__sha256_process_block (buffer, len & ~63, ctx);
          buffer = (const char *) buffer + (len & ~63);
          len &= 63;
        }
@@ -276,7 +265,7 @@ sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
       left_over += len;
       if (left_over >= 64)
        {
-         sha256_process_block (ctx->buffer, 64, ctx);
+         __crypt__sha256_process_block (ctx->buffer, 64, ctx);
          left_over -= 64;
          memcpy (ctx->buffer, &ctx->buffer[64], left_over);
        }
@@ -369,59 +358,59 @@ crypt_sha256_r (const char *key, const char *salt, char *buffer, int buflen)
     }
 
   /* Prepare for the real work.  */
-  sha256_init_ctx (&ctx);
+  __crypt__sha256_init_ctx (&ctx);
 
   /* Add the key string.  */
-  sha256_process_bytes (key, key_len, &ctx);
+  __crypt__sha256_process_bytes (key, key_len, &ctx);
 
   /* The last part is the salt string.  This must be at most 16
      characters and it ends at the first `$' character (for
      compatibility with existing implementations).  */
-  sha256_process_bytes (salt, salt_len, &ctx);
+  __crypt__sha256_process_bytes (salt, salt_len, &ctx);
 
 
   /* Compute alternate SHA256 sum with input KEY, SALT, and KEY.  The
      final result will be added to the first context.  */
-  sha256_init_ctx (&alt_ctx);
+  __crypt__sha256_init_ctx (&alt_ctx);
 
   /* Add key.  */
-  sha256_process_bytes (key, key_len, &alt_ctx);
+  __crypt__sha256_process_bytes (key, key_len, &alt_ctx);
 
   /* Add salt.  */
-  sha256_process_bytes (salt, salt_len, &alt_ctx);
+  __crypt__sha256_process_bytes (salt, salt_len, &alt_ctx);
 
   /* Add key again.  */
-  sha256_process_bytes (key, key_len, &alt_ctx);
+  __crypt__sha256_process_bytes (key, key_len, &alt_ctx);
 
   /* Now get result of this (32 bytes) and add it to the other
      context.  */
-  sha256_finish_ctx (&alt_ctx, alt_result);
+  __crypt__sha256_finish_ctx (&alt_ctx, alt_result);
 
   /* Add for any character in the key one byte of the alternate sum.  */
   for (cnt = key_len; cnt > 32; cnt -= 32)
-    sha256_process_bytes (alt_result, 32, &ctx);
-  sha256_process_bytes (alt_result, cnt, &ctx);
+    __crypt__sha256_process_bytes (alt_result, 32, &ctx);
+  __crypt__sha256_process_bytes (alt_result, cnt, &ctx);
 
   /* Take the binary representation of the length of the key and for every
      1 add the alternate sum, for every 0 the key.  */
   for (cnt = key_len; cnt > 0; cnt >>= 1)
     if ((cnt & 1) != 0)
-      sha256_process_bytes (alt_result, 32, &ctx);
+      __crypt__sha256_process_bytes (alt_result, 32, &ctx);
     else
-      sha256_process_bytes (key, key_len, &ctx);
+      __crypt__sha256_process_bytes (key, key_len, &ctx);
 
   /* Create intermediate result.  */
-  sha256_finish_ctx (&ctx, alt_result);
+  __crypt__sha256_finish_ctx (&ctx, alt_result);
 
   /* Start computation of P byte sequence.  */
-  sha256_init_ctx (&alt_ctx);
+  __crypt__sha256_init_ctx (&alt_ctx);
 
   /* For every character in the password add the entire password.  */
   for (cnt = 0; cnt < key_len; ++cnt)
-    sha256_process_bytes (key, key_len, &alt_ctx);
+    __crypt__sha256_process_bytes (key, key_len, &alt_ctx);
 
   /* Finish the digest.  */
-  sha256_finish_ctx (&alt_ctx, temp_result);
+  __crypt__sha256_finish_ctx (&alt_ctx, temp_result);
 
   /* Create byte sequence P.  */
   cp = p_bytes = alloca (key_len);
@@ -430,14 +419,14 @@ crypt_sha256_r (const char *key, const char *salt, char *buffer, int buflen)
   memcpy (cp, temp_result, cnt);
 
   /* Start computation of S byte sequence.  */
-  sha256_init_ctx (&alt_ctx);
+  __crypt__sha256_init_ctx (&alt_ctx);
 
   /* For every character in the password add the entire password.  */
   for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
-    sha256_process_bytes (salt, salt_len, &alt_ctx);
+    __crypt__sha256_process_bytes (salt, salt_len, &alt_ctx);
 
   /* Finish the digest.  */
-  sha256_finish_ctx (&alt_ctx, temp_result);
+  __crypt__sha256_finish_ctx (&alt_ctx, temp_result);
 
   /* Create byte sequence S.  */
   cp = s_bytes = alloca (salt_len);
@@ -450,30 +439,30 @@ crypt_sha256_r (const char *key, const char *salt, char *buffer, int buflen)
   for (cnt = 0; cnt < rounds; ++cnt)
     {
       /* New context.  */
-      sha256_init_ctx (&ctx);
+      __crypt__sha256_init_ctx (&ctx);
 
       /* Add key or last result.  */
       if ((cnt & 1) != 0)
-       sha256_process_bytes (p_bytes, key_len, &ctx);
+       __crypt__sha256_process_bytes (p_bytes, key_len, &ctx);
       else
-       sha256_process_bytes (alt_result, 32, &ctx);
+       __crypt__sha256_process_bytes (alt_result, 32, &ctx);
 
       /* Add salt for numbers not divisible by 3.  */
       if (cnt % 3 != 0)
-       sha256_process_bytes (s_bytes, salt_len, &ctx);
+       __crypt__sha256_process_bytes (s_bytes, salt_len, &ctx);
 
       /* Add key for numbers not divisible by 7.  */
       if (cnt % 7 != 0)
-       sha256_process_bytes (p_bytes, key_len, &ctx);
+       __crypt__sha256_process_bytes (p_bytes, key_len, &ctx);
 
       /* Add key or last result.  */
       if ((cnt & 1) != 0)
-       sha256_process_bytes (alt_result, 32, &ctx);
+       __crypt__sha256_process_bytes (alt_result, 32, &ctx);
       else
-       sha256_process_bytes (p_bytes, key_len, &ctx);
+       __crypt__sha256_process_bytes (p_bytes, key_len, &ctx);
 
       /* Create intermediate result.  */
-      sha256_finish_ctx (&ctx, alt_result);
+      __crypt__sha256_finish_ctx (&ctx, alt_result);
     }
 
   /* Now we can construct the result string.  It consists of three
@@ -533,8 +522,8 @@ crypt_sha256_r (const char *key, const char *salt, char *buffer, int buflen)
      attaching to processes or reading core dumps cannot get any
      information.  We do it in this way to clear correct_words[]
      inside the SHA256 implementation as well.  */
-  sha256_init_ctx (&ctx);
-  sha256_finish_ctx (&ctx, alt_result);
+  __crypt__sha256_init_ctx (&ctx);
+  __crypt__sha256_finish_ctx (&ctx, alt_result);
   memset (temp_result, '\0', sizeof (temp_result));
   memset (p_bytes, '\0', key_len);
   memset (s_bytes, '\0', salt_len);
@@ -663,19 +652,19 @@ main (void)
 
   for (cnt = 0; cnt < (int) ntests; ++cnt)
     {
-      sha256_init_ctx (&ctx);
-      sha256_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx);
-      sha256_finish_ctx (&ctx, sum);
+      __crypt__sha256_init_ctx (&ctx);
+      __crypt__sha256_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx);
+      __crypt__sha256_finish_ctx (&ctx, sum);
       if (memcmp (tests[cnt].result, sum, 32) != 0)
        {
          printf ("test %d run %d failed\n", cnt, 1);
          result = 1;
        }
 
-      sha256_init_ctx (&ctx);
+      __crypt__sha256_init_ctx (&ctx);
       for (int i = 0; tests[cnt].input[i] != '\0'; ++i)
-       sha256_process_bytes (&tests[cnt].input[i], 1, &ctx);
-      sha256_finish_ctx (&ctx, sum);
+       __crypt__sha256_process_bytes (&tests[cnt].input[i], 1, &ctx);
+      __crypt__sha256_finish_ctx (&ctx, sum);
       if (memcmp (tests[cnt].result, sum, 32) != 0)
        {
          printf ("test %d run %d failed\n", cnt, 2);
@@ -686,10 +675,10 @@ main (void)
   /* Test vector from FIPS 180-2: appendix B.3.  */
   char buf[1000];
   memset (buf, 'a', sizeof (buf));
-  sha256_init_ctx (&ctx);
+  __crypt__sha256_init_ctx (&ctx);
   for (int i = 0; i < 1000; ++i)
-    sha256_process_bytes (buf, sizeof (buf), &ctx);
-  sha256_finish_ctx (&ctx, sum);
+    __crypt__sha256_process_bytes (buf, sizeof (buf), &ctx);
+  __crypt__sha256_finish_ctx (&ctx, sum);
   static const char expected[32] =
     "\xcd\xc7\x6e\x5c\x99\x14\xfb\x92\x81\xa1\xc7\xe2\x84\xd7\x3e\x67"
     "\xf1\x80\x9a\x48\xa4\x97\x20\x0e\x04\x6d\x39\xcc\xc7\x11\x2c\xd0";
index 0773c37..c11fc80 100644 (file)
 #include <sys/param.h>
 #include <sys/types.h>
 
-
-/* Structure to save state of computation between the single steps.  */
-struct sha512_ctx
-{
-  uint64_t H[8];
-
-  uint64_t total[2];
-  uint64_t buflen;
-  char buffer[256];    /* NB: always correctly aligned for uint64_t.  */
-};
-
+#include "local.h"
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 # define SWAP(n) \
@@ -93,8 +83,8 @@ static const uint64_t K[80] =
 
 /* Process LEN bytes of BUFFER, accumulating context into CTX.
    It is assumed that LEN % 128 == 0.  */
-static void
-sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
+void
+__crypt__sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
 {
   const uint64_t *words = buffer;
   size_t nwords = len / sizeof (uint64_t);
@@ -193,8 +183,8 @@ sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
 
 /* Initialize structure containing state of computation.
    (FIPS 180-2:5.3.3)  */
-static void
-sha512_init_ctx (struct sha512_ctx *ctx)
+void
+__crypt__sha512_init_ctx (struct sha512_ctx *ctx)
 {
   ctx->H[0] = UINT64_C (0x6a09e667f3bcc908);
   ctx->H[1] = UINT64_C (0xbb67ae8584caa73b);
@@ -215,8 +205,8 @@ sha512_init_ctx (struct sha512_ctx *ctx)
 
    IMPORTANT: On some systems it is required that RESBUF is correctly
    aligned for a 32 bits value.  */
-static void *
-sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
+void *
+__crypt__sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
 {
   /* Take yet unprocessed bytes into account.  */
   uint64_t bytes = ctx->buflen;
@@ -236,7 +226,7 @@ sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
                                                  (ctx->total[0] >> 61));
 
   /* Process last bytes.  */
-  sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
+  __crypt__sha512_process_block (ctx->buffer, bytes + pad + 16, ctx);
 
   /* Put result from CTX in first 64 bytes following RESBUF.  */
   for (unsigned int i = 0; i < 8; ++i)
@@ -246,8 +236,8 @@ sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
 }
 
 
-static void
-sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
+void
+__crypt__sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
 {
   /* When we already have some bits in our internal buffer concatenate
      both inputs first.  */
@@ -261,7 +251,7 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
 
       if (ctx->buflen > 128)
        {
-         sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx);
+         __crypt__sha512_process_block (ctx->buffer, ctx->buflen & ~127, ctx);
 
          ctx->buflen &= 127;
          /* The regions in the following copy operation cannot overlap.  */
@@ -287,7 +277,7 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
       if (UNALIGNED_P (buffer))
        while (len > 128)
          {
-           sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128,
+           __crypt__sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128,
                                    ctx);
            buffer = (const char *) buffer + 128;
            len -= 128;
@@ -295,7 +285,7 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
       else
 #endif
        {
-         sha512_process_block (buffer, len & ~127, ctx);
+         __crypt__sha512_process_block (buffer, len & ~127, ctx);
          buffer = (const char *) buffer + (len & ~127);
          len &= 127;
        }
@@ -310,7 +300,7 @@ sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
       left_over += len;
       if (left_over >= 128)
        {
-         sha512_process_block (ctx->buffer, 128, ctx);
+         __crypt__sha512_process_block (ctx->buffer, 128, ctx);
          left_over -= 128;
          memcpy (ctx->buffer, &ctx->buffer[128], left_over);
        }
@@ -403,59 +393,59 @@ crypt_sha512_r (const char *key, const char *salt, char *buffer, int buflen)
     }
 
   /* Prepare for the real work.  */
-  sha512_init_ctx (&ctx);
+  __crypt__sha512_init_ctx (&ctx);
 
   /* Add the key string.  */
-  sha512_process_bytes (key, key_len, &ctx);
+  __crypt__sha512_process_bytes (key, key_len, &ctx);
 
   /* The last part is the salt string.  This must be at most 16
      characters and it ends at the first `$' character (for
      compatibility with existing implementations).  */
-  sha512_process_bytes (salt, salt_len, &ctx);
+  __crypt__sha512_process_bytes (salt, salt_len, &ctx);
 
 
   /* Compute alternate SHA512 sum with input KEY, SALT, and KEY.  The
      final result will be added to the first context.  */
-  sha512_init_ctx (&alt_ctx);
+  __crypt__sha512_init_ctx (&alt_ctx);
 
   /* Add key.  */
-  sha512_process_bytes (key, key_len, &alt_ctx);
+  __crypt__sha512_process_bytes (key, key_len, &alt_ctx);
 
   /* Add salt.  */
-  sha512_process_bytes (salt, salt_len, &alt_ctx);
+  __crypt__sha512_process_bytes (salt, salt_len, &alt_ctx);
 
   /* Add key again.  */
-  sha512_process_bytes (key, key_len, &alt_ctx);
+  __crypt__sha512_process_bytes (key, key_len, &alt_ctx);
 
   /* Now get result of this (64 bytes) and add it to the other
      context.  */
-  sha512_finish_ctx (&alt_ctx, alt_result);
+  __crypt__sha512_finish_ctx (&alt_ctx, alt_result);
 
   /* Add for any character in the key one byte of the alternate sum.  */
   for (cnt = key_len; cnt > 64; cnt -= 64)
-    sha512_process_bytes (alt_result, 64, &ctx);
-  sha512_process_bytes (alt_result, cnt, &ctx);
+    __crypt__sha512_process_bytes (alt_result, 64, &ctx);
+  __crypt__sha512_process_bytes (alt_result, cnt, &ctx);
 
   /* Take the binary representation of the length of the key and for every
      1 add the alternate sum, for every 0 the key.  */
   for (cnt = key_len; cnt > 0; cnt >>= 1)
     if ((cnt & 1) != 0)
-      sha512_process_bytes (alt_result, 64, &ctx);
+      __crypt__sha512_process_bytes (alt_result, 64, &ctx);
     else
-      sha512_process_bytes (key, key_len, &ctx);
+      __crypt__sha512_process_bytes (key, key_len, &ctx);
 
   /* Create intermediate result.  */
-  sha512_finish_ctx (&ctx, alt_result);
+  __crypt__sha512_finish_ctx (&ctx, alt_result);
 
   /* Start computation of P byte sequence.  */
-  sha512_init_ctx (&alt_ctx);
+  __crypt__sha512_init_ctx (&alt_ctx);
 
   /* For every character in the password add the entire password.  */
   for (cnt = 0; cnt < key_len; ++cnt)
-    sha512_process_bytes (key, key_len, &alt_ctx);
+    __crypt__sha512_process_bytes (key, key_len, &alt_ctx);
 
   /* Finish the digest.  */
-  sha512_finish_ctx (&alt_ctx, temp_result);
+  __crypt__sha512_finish_ctx (&alt_ctx, temp_result);
 
   /* Create byte sequence P.  */
   cp = p_bytes = alloca (key_len);
@@ -464,14 +454,14 @@ crypt_sha512_r (const char *key, const char *salt, char *buffer, int buflen)
   memcpy (cp, temp_result, cnt);
 
   /* Start computation of S byte sequence.  */
-  sha512_init_ctx (&alt_ctx);
+  __crypt__sha512_init_ctx (&alt_ctx);
 
   /* For every character in the password add the entire password.  */
   for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt)
-    sha512_process_bytes (salt, salt_len, &alt_ctx);
+    __crypt__sha512_process_bytes (salt, salt_len, &alt_ctx);
 
   /* Finish the digest.  */
-  sha512_finish_ctx (&alt_ctx, temp_result);
+  __crypt__sha512_finish_ctx (&alt_ctx, temp_result);
 
   /* Create byte sequence S.  */
   cp = s_bytes = alloca (salt_len);
@@ -484,30 +474,30 @@ crypt_sha512_r (const char *key, const char *salt, char *buffer, int buflen)
   for (cnt = 0; cnt < rounds; ++cnt)
     {
       /* New context.  */
-      sha512_init_ctx (&ctx);
+      __crypt__sha512_init_ctx (&ctx);
 
       /* Add key or last result.  */
       if ((cnt & 1) != 0)
-       sha512_process_bytes (p_bytes, key_len, &ctx);
+       __crypt__sha512_process_bytes (p_bytes, key_len, &ctx);
       else
-       sha512_process_bytes (alt_result, 64, &ctx);
+       __crypt__sha512_process_bytes (alt_result, 64, &ctx);
 
       /* Add salt for numbers not divisible by 3.  */
       if (cnt % 3 != 0)
-       sha512_process_bytes (s_bytes, salt_len, &ctx);
+       __crypt__sha512_process_bytes (s_bytes, salt_len, &ctx);
 
       /* Add key for numbers not divisible by 7.  */
       if (cnt % 7 != 0)
-       sha512_process_bytes (p_bytes, key_len, &ctx);
+       __crypt__sha512_process_bytes (p_bytes, key_len, &ctx);
 
       /* Add key or last result.  */
       if ((cnt & 1) != 0)
-       sha512_process_bytes (alt_result, 64, &ctx);
+       __crypt__sha512_process_bytes (alt_result, 64, &ctx);
       else
-       sha512_process_bytes (p_bytes, key_len, &ctx);
+       __crypt__sha512_process_bytes (p_bytes, key_len, &ctx);
 
       /* Create intermediate result.  */
-      sha512_finish_ctx (&ctx, alt_result);
+      __crypt__sha512_finish_ctx (&ctx, alt_result);
     }
 
   /* Now we can construct the result string.  It consists of three
@@ -579,8 +569,8 @@ crypt_sha512_r (const char *key, const char *salt, char *buffer, int buflen)
      attaching to processes or reading core dumps cannot get any
      information.  We do it in this way to clear correct_words[]
      inside the SHA512 implementation as well.  */
-  sha512_init_ctx (&ctx);
-  sha512_finish_ctx (&ctx, alt_result);
+  __crypt__sha512_init_ctx (&ctx);
+  __crypt__sha512_finish_ctx (&ctx, alt_result);
   memset (temp_result, '\0', sizeof (temp_result));
   memset (p_bytes, '\0', key_len);
   memset (s_bytes, '\0', salt_len);
@@ -730,19 +720,19 @@ main (void)
 
   for (cnt = 0; cnt < (int) ntests; ++cnt)
     {
-      sha512_init_ctx (&ctx);
-      sha512_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx);
-      sha512_finish_ctx (&ctx, sum);
+      __crypt__sha512_init_ctx (&ctx);
+      __crypt__sha512_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx);
+      __crypt__sha512_finish_ctx (&ctx, sum);
       if (memcmp (tests[cnt].result, sum, 64) != 0)
        {
          printf ("test %d run %d failed\n", cnt, 1);
          result = 1;
        }
 
-      sha512_init_ctx (&ctx);
+      __crypt__sha512_init_ctx (&ctx);
       for (int i = 0; tests[cnt].input[i] != '\0'; ++i)
-       sha512_process_bytes (&tests[cnt].input[i], 1, &ctx);
-      sha512_finish_ctx (&ctx, sum);
+       __crypt__sha512_process_bytes (&tests[cnt].input[i], 1, &ctx);
+      __crypt__sha512_finish_ctx (&ctx, sum);
       if (memcmp (tests[cnt].result, sum, 64) != 0)
        {
          printf ("test %d run %d failed\n", cnt, 2);
@@ -753,10 +743,10 @@ main (void)
   /* Test vector from FIPS 180-2: appendix C.3.  */
   char buf[1000];
   memset (buf, 'a', sizeof (buf));
-  sha512_init_ctx (&ctx);
+  __crypt__sha512_init_ctx (&ctx);
   for (int i = 0; i < 1000; ++i)
-    sha512_process_bytes (buf, sizeof (buf), &ctx);
-  sha512_finish_ctx (&ctx, sum);
+    __crypt__sha512_process_bytes (buf, sizeof (buf), &ctx);
+  __crypt__sha512_finish_ctx (&ctx, sum);
   static const char expected[64] =
     "\xe7\x18\x48\x3d\x0c\xe7\x69\x64\x4e\x2e\x42\xc7\xbc\x15\xb4\x63"
     "\x8e\x1f\x98\xb1\x3b\x20\x44\x28\x56\x32\xa8\x03\xaf\xa9\x73\xeb"
index c8d2afa..dc4b2d6 100644 (file)
@@ -35,8 +35,9 @@
 
 #include <sys/types.h>
 #include <string.h>
-#include <sha256.h>
+
 #include "crypt.h"
+#include "local.h"
 
 /*
  * New password crypt.
@@ -62,7 +63,7 @@ crypt_deprecated_sha256(const char *pw, const char *salt)
        static const char *sp, *ep;
        unsigned char final[SHA256_SIZE];
        int sl;
-       SHA256_CTX ctx;
+       struct sha256_ctx ctx;
        unsigned long l;
 
        /* Refine the salt. */
@@ -79,23 +80,23 @@ crypt_deprecated_sha256(const char *pw, const char *salt)
        /* Get the actual salt length. */
        sl = ep - sp;
        
-       SHA256_Init(&ctx);
+       __crypt__sha256_init_ctx(&ctx);
 
        /* Hash in the password first. */
-       SHA256_Update(&ctx, pw, strlen(pw));
+       __crypt__sha256_process_bytes(pw, strlen(pw), &ctx);
        
         /*
          * Then the magic string
          *
          * XXX: sizeof instead of strlen, must retain
          */
-       SHA256_Update(&ctx, magic, sizeof(magic));
+       __crypt__sha256_process_bytes(magic, sizeof(magic), &ctx);
        
        /* Then the raw salt. */
-       SHA256_Update(&ctx, sp, sl);
+       __crypt__sha256_process_bytes(sp, sl, &ctx);
        
        /* Finish and create the output string. */
-       SHA256_Final(final, &ctx);
+       __crypt__sha256_finish_ctx(&ctx, final);
        strcpy(passwd, magic);
        strncat(passwd, sp, sl);
        strcat(passwd, "$");
index b31da5e..f710eee 100644 (file)
@@ -35,8 +35,9 @@
 
 #include <sys/types.h>
 #include <string.h>
-#include <sha512.h>
+
 #include "crypt.h"
+#include "local.h"
 
 /*
  * New password crypt.
@@ -62,7 +63,7 @@ crypt_deprecated_sha512(const char *pw, const char *salt)
        static const char *sp, *ep;
        unsigned char final[SHA512_SIZE];
        int sl, i;
-       SHA512_CTX ctx;
+       struct sha512_ctx ctx;
        unsigned long l;
 
        /* Refine the salt. */
@@ -79,23 +80,23 @@ crypt_deprecated_sha512(const char *pw, const char *salt)
        /* Get the actual salt length. */
        sl = ep - sp;
        
-       SHA512_Init(&ctx);
+       __crypt__sha512_init_ctx(&ctx);
        
        /* Hash in the password first. */
-       SHA512_Update(&ctx, pw, strlen(pw));
+       __crypt__sha512_process_bytes(pw, strlen(pw), &ctx);
        
        /*
         * Then the magic string
         *
         * XXX: sizeof instead of strlen, must retain
         */
-       SHA512_Update(&ctx, magic, sizeof(magic));
+       __crypt__sha512_process_bytes(magic, sizeof(magic), &ctx);
        
        /* Then the raw salt. */
-       SHA512_Update(&ctx, sp, sl);
+       __crypt__sha512_process_bytes(sp, sl, &ctx);
        
        /* Finish and create the output string. */
-       SHA512_Final(final, &ctx);
+       __crypt__sha512_finish_ctx(&ctx, final);
        strcpy(passwd, magic);
        strncat(passwd, sp, sl);
        strcat(passwd, "$");
diff --git a/lib/libcrypt/local.h b/lib/libcrypt/local.h
new file mode 100644 (file)
index 0000000..58b469c
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ *
+ */
+
+struct sha256_ctx
+{
+       uint32_t H[8];
+
+       uint32_t total[2];
+       uint32_t buflen;
+       char buffer[128]; /* NB: always correctly aligned for uint32_t.  */
+};
+
+struct sha512_ctx
+{
+       uint64_t H[8];
+
+       uint64_t total[2];
+       uint64_t buflen;
+       char buffer[256]; /* NB: always correctly aligned for uint64_t.  */
+};
+
+void __crypt__sha256_process_block (const void *buffer, size_t len,
+                       struct sha256_ctx *ctx);
+void __crypt__sha256_init_ctx (struct sha256_ctx *ctx);
+void *__crypt__sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
+void __crypt__sha256_process_bytes (const void *buffer, size_t len,
+                       struct sha256_ctx *ctx);
+
+void __crypt__sha512_process_block (const void *buffer, size_t len,
+                       struct sha512_ctx *ctx);
+void __crypt__sha512_init_ctx (struct sha512_ctx *ctx);
+void *__crypt__sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
+void __crypt__sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx);
+void __crypt__sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx);
+void __crypt__sha512_init_ctx (struct sha512_ctx *ctx);
+
similarity index 96%
rename from secure/lib/libcrypto/Makefile.inc
rename to lib/libcrypto/Makefile.inc
index d62527d..a38e9ff 100644 (file)
@@ -1,6 +1,6 @@
 OSSLVERSION=   1.0.2h
 OSSLDATE=      2016-05-03
-LCRYPTO_SRC=   ${.CURDIR}/../../../crypto/openssl
+LCRYPTO_SRC=   ${.CURDIR}/../../crypto/openssl
 LCRYPTO_DOC=   ${LCRYPTO_SRC}/doc
 
 CFLAGS+=       -DOPENSSL_THREADS
similarity index 97%
rename from secure/lib/libcrypto/asm/Makefile
rename to lib/libcrypto/asm/Makefile
index a2cf185..d29ca82 100644 (file)
@@ -1,7 +1,7 @@
 # This file automatically generates the asm .s files after importing a new
 # version of OpenSSL.
 
-OPENSSL_SRC=   ../../../../crypto/openssl
+OPENSSL_SRC=   ../../../crypto/openssl
 
 .PATH: ${OPENSSL_SRC}/crypto \
        ${OPENSSL_SRC}/crypto/aes/asm \
similarity index 52%
rename from secure/lib/libcrypto/engines/Makefile.inc
rename to lib/libcrypto/engines/Makefile.inc
index cae56ec..41aec44 100644 (file)
@@ -1,4 +1,4 @@
-LCRYPTO_SRC=   ${.CURDIR}/../../../../../crypto/openssl
+LCRYPTO_SRC=   ${.CURDIR}/../../../../crypto/openssl
 SHLIBDIR?=     /usr/lib/engines
 
 .PATH: ${LCRYPTO_SRC}/engines
index e54ab57..72ad1c8 100644 (file)
@@ -2,18 +2,20 @@
 
 LIB=   md
 SHLIBDIR?= /lib
-SRCS=  md2c.c md4c.c md5c.c md2hl.c md4hl.c md5hl.c \
-       rmd160c.c rmd160hl.c \
-       sha0c.c sha0hl.c sha1c.c sha1hl.c \
-       sha256c.c sha256hl.c sha512c.c sha512hl.c
-INCS=  md2.h md4.h md5.h ripemd.h sha.h sha256.h sha512.h
+SRCS=  md2c.c md4c.c md5c.c \
+       md2hl.c md4hl.c md5hl.c rmd160hl.c \
+       sha256hl.c sha512hl.c
+
+#sha0hl.c sha1hl.c
+
+INCS=  md2.h md4.h md5.h sha.h sha256.h sha512.h ripemd.h
 WARNS?=        2
 NO_STRICT_ALIASING=
 
 VERSION_DEF=   ${.CURDIR}/../libc/Versions.def
 SYMBOL_MAPS=   ${.CURDIR}/Symbol.map
 
-MAN+=  md2.3 md4.3 md5.3 ripemd.3 sha.3 sha256.3 sha384.3 sha512.3
+MAN+=  md2.3 md4.3 md5.3 sha.3 sha256.3 sha384.3 sha512.3
 MLINKS+=md2.3 MD2Init.3 md2.3 MD2Update.3 md2.3 MD2Pad.3 md2.3 MD2Final.3
 MLINKS+=md2.3 MD2End.3  md2.3 MD2File.3   md2.3 MD2FileChunk.3
 MLINKS+=md2.3 MD2Data.3
@@ -23,32 +25,22 @@ MLINKS+=md4.3 MD4Data.3
 MLINKS+=md5.3 MD5Init.3 md5.3 MD5Update.3 md5.3 MD5Pad.3 md5.3 MD5Final.3
 MLINKS+=md5.3 MD5End.3  md5.3 MD5File.3   md5.3 MD5FileChunk.3
 MLINKS+=md5.3 MD5Data.3
-MLINKS+=ripemd.3 RIPEMD160_Init.3  ripemd.3 RIPEMD160_Update.3
-MLINKS+=ripemd.3 RIPEMD160_Final.3 ripemd.3 RIPEMD160_Data.3
-MLINKS+=ripemd.3 RIPEMD160_End.3   ripemd.3 RIPEMD160_File.3
-MLINKS+=ripemd.3 RIPEMD160_FileChunk.3
-MLINKS+=sha.3 SHA_Init.3  sha.3 SHA_Update.3  sha.3 SHA_Final.3
 MLINKS+=sha.3 SHA_End.3   sha.3 SHA_File.3    sha.3 SHA_FileChunk.3
 MLINKS+=sha.3 SHA_Data.3
-MLINKS+=sha.3 SHA1_Init.3 sha.3 SHA1_Update.3 sha.3 SHA1_Final.3
 MLINKS+=sha.3 SHA1_End.3  sha.3 SHA1_File.3   sha.3 SHA1_FileChunk.3
 MLINKS+=sha.3 SHA1_Data.3
-MLINKS+=sha256.3 SHA256_Init.3  sha256.3 SHA256_Update.3
-MLINKS+=sha256.3 SHA256_Final.3 sha256.3 SHA256_End.3
+MLINKS+=sha256.3 SHA256_End.3
 MLINKS+=sha256.3 SHA256_File.3  sha256.3 SHA256_FileChunk.3
 MLINKS+=sha256.3 SHA256_Data.3
-MLINKS+=sha384.3 SHA384_Init.3 sha384.3 SHA384_Update.3
-MLINKS+=sha384.3 SHA384_Final.3
-MLINKS+=sha512.3 SHA512_Init.3  sha512.3 SHA512_Update.3
-MLINKS+=sha512.3 SHA512_Final.3 sha512.3 SHA512_End.3
-MLINKS+=sha512.3 SHA512_File.3  sha512.3 SHA512_FileChunk.3                                               
+MLINKS+=sha512.3 SHA512_End.3
+MLINKS+=sha512.3 SHA512_File.3  sha512.3 SHA512_FileChunk.3
 MLINKS+=sha512.3 SHA512_Data.3
 
 CLEANFILES+=   md[245]hl.c md[245].ref md[245].3 mddriver \
-               rmd160.ref rmd160hl.c rmddriver \
-               sha0.ref sha0hl.c sha1.ref sha1hl.c shadriver \
+               sha0.ref sha0hl.c rmd160hl.c sha1.ref sha1hl.c shadriver \
                sha256.ref sha256hl.c sha512.ref sha512hl.c
 CFLAGS+= -I${.CURDIR}
+CFLAGS+= -I${.CURDIR}/../../crypto/libressl/include
 
 md2hl.c: mdXhl.c
        (echo '#define LENGTH 16'; \
@@ -62,15 +54,21 @@ md5hl.c: mdXhl.c
        (echo '#define LENGTH 16'; \
                sed -e 's/mdX/md5/g' -e 's/MDX/MD5/g' ${.ALLSRC}) > ${.TARGET}
 
-sha0hl.c: mdXhl.c
+rmd160hl.c: mdXhl.c
        (echo '#define LENGTH 20'; \
-               sed -e 's/mdX/sha/g' -e 's/MDX/SHA_/g' -e 's/SHA__/SHA_/g' \
-               ${.ALLSRC}) > ${.TARGET}
+               sed -e 's/mdX/ripemd/g' -e 's/MDX/RIPEMD160_/g' \
+                       -e 's/RIPEMD160__/RIPEMD160_/g' \
+                       ${.ALLSRC}) > ${.TARGET}
 
-sha1hl.c: mdXhl.c
-       (echo '#define LENGTH 20'; \
-               sed -e 's/mdX/sha/g' -e 's/MDX/SHA1_/g' -e 's/SHA1__/SHA1_/g' \
-               ${.ALLSRC}) > ${.TARGET}
+#sha0hl.c: mdXhl.c
+#      (echo '#define LENGTH 20'; \
+#              sed -e 's/mdX/sha/g' -e 's/MDX/SHA_/g' -e 's/SHA__/SHA_/g' \
+#              ${.ALLSRC}) > ${.TARGET}
+#
+#sha1hl.c: mdXhl.c
+#      (echo '#define LENGTH 20'; \
+#              sed -e 's/mdX/sha/g' -e 's/MDX/SHA1_/g' -e 's/SHA1__/SHA1_/g' \
+#              ${.ALLSRC}) > ${.TARGET}
 
 sha256hl.c: mdXhl.c
        (echo '#define LENGTH 32'; \
@@ -84,13 +82,6 @@ sha512hl.c: mdXhl.c
                        -e  's/SHA512__/SHA512_/g' \
                ${.ALLSRC}) > ${.TARGET}
 
-
-rmd160hl.c: mdXhl.c
-       (echo '#define LENGTH 20'; \
-               sed -e 's/mdX/ripemd/g' -e 's/MDX/RIPEMD160_/g' \
-                       -e 's/RIPEMD160__/RIPEMD160_/g' \
-                       ${.ALLSRC}) > ${.TARGET}
-
 .for i in 2 4 5
 md${i}.3: ${.CURDIR}/mdX.3
        sed -e "s/mdX/md${i}/g" -e "s/MDX/MD${i}/g" ${.ALLSRC} > ${.TARGET}
@@ -171,20 +162,7 @@ sha512.ref:
        @echo 'SHA-512 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = 1e07be23c26a86ea37ea810c8ec7809352515a970e9253c26f536cfc7a9996c45c8370583e0a78fa4a90041d71a4ceab7423f19c71b9d5a3e01249f0bebd5894' >> ${.TARGET}
        @echo 'SHA-512 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = 72ec1ef1124a45b047e8b7c75a932195135bb61de24ec0d1914042246e0aec3a2354e093d76f3048b456764346900cb130d2a4fd5dd16abb5e30bcb850dee843' >> ${.TARGET}
 
-rmd160.ref:
-       (echo 'RIPEMD160 test suite:'; \
-       echo 'RIPEMD160 ("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31'; \
-       echo 'RIPEMD160 ("abc") = 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc'; \
-       echo 'RIPEMD160 ("message digest") =' \
-               '5d0689ef49d2fae572b881b123a85ffa21595f36'; \
-       echo 'RIPEMD160 ("abcdefghijklmnopqrstuvwxyz") =' \
-               'f71c27109c692c1b56bbdceb5b9d2865b3708dbc'; \
-       echo 'RIPEMD160 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") =' \
-               'b0e20b6e3116640286ed3a87a5713079b21f5189'; \
-       echo 'RIPEMD160 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") =' \
-               '9b752e45573d4b39f4dbd3323cab82bf63326bfb' ) > ${.TARGET}
-
-test:  md2.ref md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha256.ref sha512.ref
+test:  md2.ref md4.ref md5.ref sha0.ref sha1.ref sha256.ref sha512.ref
        @${ECHO} if any of these test fail, the code produces wrong results
        @${ECHO} and should NOT be used.
        ${CC} ${CFLAGS} ${LDFLAGS} -DMD=2 -o mddriver ${.CURDIR}/mddriver.c -L. -lmd
@@ -197,10 +175,6 @@ test:      md2.ref md4.ref md5.ref sha0.ref rmd160.ref sha1.ref sha256.ref sha512.ref
        ./mddriver | cmp md5.ref -
        @${ECHO} MD5 passed test
        -rm -f mddriver
-       ${CC} ${CFLAGS} ${LDFLAGS} -o rmddriver ${.CURDIR}/rmddriver.c -L. -lmd
-       ./rmddriver | cmp rmd160.ref -
-       @${ECHO} RIPEMD160 passed test
-       -rm -f rmddriver
        ${CC} ${CFLAGS} ${LDFLAGS} -DSHA=0 -o shadriver ${.CURDIR}/shadriver.c -L. -lmd
        ./shadriver | cmp sha0.ref -
        @${ECHO} SHA-0 passed test
diff --git a/lib/libmd/OBSOLETE b/lib/libmd/OBSOLETE
new file mode 100644 (file)
index 0000000..3a7d8e5
--- /dev/null
@@ -0,0 +1,7 @@
+
+                               LIBMD IS OBSOLETE
+
+    LIBMD contains old crypto hash APIs and is considered obsolete, meaning
+    that it is our desire to vector any remaining code dependencies away
+    from this library.
+
index 2d8f9d7..21e4ae2 100644 (file)
@@ -27,47 +27,12 @@ DF306.0 {
     RIPEMD160_End;
     RIPEMD160_File;
     RIPEMD160_FileChunk;
-    RIPEMD160_Final;
-    RIPEMD160_Init;
-    RIPEMD160_Transform;
-    RIPEMD160_Update;
-    RMD160_version;
-    SHA1_Data;
-    SHA1_End;
-    SHA1_File;
-    SHA1_FileChunk;
-    SHA1_Final;
-    SHA1_Init;
-    SHA1_Transform;
-    SHA1_Update;
-    SHA1_version;
     SHA256_Data;
     SHA256_End;
     SHA256_File;
     SHA256_FileChunk;
-    SHA256_Final;
-    SHA256_Init;
-    SHA256_Update;
-    SHA384_Final;
-    SHA384_Init;
-    SHA384_Update;
     SHA512_Data;
     SHA512_End;
     SHA512_File;
     SHA512_FileChunk;
-    SHA512_Final;
-    SHA512_Init;
-    SHA512_Update;
-    SHA_Data;
-    SHA_End;
-    SHA_File;
-    SHA_FileChunk;
-    SHA_Final;
-    SHA_Init;
-    SHA_Transform;
-    SHA_Update;
-    SHA_version;
-    ripemd160_block;
-    sha1_block;
-    sha_block;
 };
index 04afb3d..62b6766 100644 (file)
@@ -1,49 +1,55 @@
-/* MD4.H - header file for MD4C.C
- * $FreeBSD: src/lib/libmd/md4.h,v 1.11 2006/01/17 15:35:56 phk Exp $
- * $DragonFly: src/lib/libmd/md4.h,v 1.3 2008/09/11 20:25:34 swildner Exp $
+/*
+ * Copyright (c) 2016 The DragonFly Project.  All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com>
+ *
+ * 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. Neither the name of The DragonFly Project nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``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
+ * COPYRIGHT HOLDERS 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.
  */
-
-/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
-   rights reserved.
-
-   License to copy and use this software is granted provided that it
-   is identified as the "RSA Data Security, Inc. MD4 Message-Digest
-   Algorithm" in all material mentioning or referencing this software
-   or this function.
-   License is also granted to make and use derivative works provided
-   that such works are identified as "derived from the RSA Data
-   Security, Inc. MD4 Message-Digest Algorithm" in all material
-   mentioning or referencing the derived work.
-
-   RSA Data Security, Inc. makes no representations concerning either
-   the merchantability of this software or the suitability of this
-   software for any particular purpose. It is provided "as is"
-   without express or implied warranty of any kind.
-
-   These notices must be retained in any copies of any part of this
-   documentation and/or software.
+/*
+ * libmd shims for openssl + non-conflicting old API functions.
  */
 
 #ifndef _MD4_H_
 #define _MD4_H_
-/* MD4 context. */
-typedef struct MD4Context {
-  u_int32_t state[4];  /* state (ABCD) */
-  u_int32_t count[2];  /* number of bits, modulo 2^64 (lsb first) */
-  unsigned char buffer[64];    /* input buffer */
-} MD4_CTX;
 
 #include <sys/cdefs.h>
+#include <openssl/md4.h>
 
 __BEGIN_DECLS
-int   MD4Init(MD4_CTX *);
-void   MD4Update(MD4_CTX *, const void *, unsigned int);
-void   MD4Pad(MD4_CTX *);
-void   MD4Final(unsigned char [16], MD4_CTX *);
-char * MD4End(MD4_CTX *, char *);
-char * MD4File(const char *, char *);
-char * MD4FileChunk(const char *, char *, off_t, off_t);
-char * MD4Data(const void *, unsigned int, char *);
+int MD4Init(MD4_CTX *);
+void MD4Update(MD4_CTX *, const void *, unsigned int);
+void MD4Pad(MD4_CTX *);
+void MD4Final(unsigned char [16], MD4_CTX *);
+char *MD4End(MD4_CTX *, char *);
+char *MD4File(const char *, char *);
+char *MD4FileChunk(const char *, char *, off_t, off_t);
+char *MD4Data(const void *, unsigned int, char *);
 __END_DECLS
 
 #endif /* _MD4_H_ */
index 045675e..76050af 100644 (file)
@@ -50,7 +50,7 @@ typedef u_int32_t UINT4;
 #define S33 11
 #define S34 15
 
-static void MD4Transform PROTO_LIST ((UINT4 [4], const unsigned char [64]));
+static void MD4Transform PROTO_LIST ((UINT4 *, const unsigned char *));
 static void Encode PROTO_LIST
   ((unsigned char *, UINT4 *, unsigned int));
 static void Decode PROTO_LIST
@@ -92,14 +92,14 @@ static unsigned char PADDING[64] = {
 int
 MD4Init (MD4_CTX *context)
 {
-  context->count[0] = context->count[1] = 0;
+  context->Nl = context->Nh = 0;
 
   /* Load magic initialization constants.
    */
-  context->state[0] = 0x67452301;
-  context->state[1] = 0xefcdab89;
-  context->state[2] = 0x98badcfe;
-  context->state[3] = 0x10325476;
+  context->A = 0x67452301;
+  context->B = 0xefcdab89;
+  context->C = 0x98badcfe;
+  context->D = 0x10325476;
   return 1;
 }
 
@@ -114,23 +114,23 @@ MD4Update (MD4_CTX *context, const void *in, unsigned int inputLen)
   const unsigned char *input = in;
 
   /* Compute number of bytes mod 64 */
-  idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
+  idx = (unsigned int)((context->Nl >> 3) & 0x3F);
   /* Update number of bits */
-  if ((context->count[0] += ((UINT4)inputLen << 3))
+  if ((context->Nl += ((UINT4)inputLen << 3))
       < ((UINT4)inputLen << 3))
-    context->count[1]++;
-  context->count[1] += ((UINT4)inputLen >> 29);
+    context->Nh++;
+  context->Nh += ((UINT4)inputLen >> 29);
 
   partLen = 64 - idx;
   /* Transform as many times as possible.
    */
   if (inputLen >= partLen) {
     memcpy
-      ((POINTER)&context->buffer[idx], (CONST_POINTER)input, partLen);
-    MD4Transform (context->state, context->buffer);
+      ((POINTER)&((char *)context->data)[idx], (CONST_POINTER)input, partLen);
+    MD4Transform (&context->A, (unsigned char *)context->data);
 
     for (i = partLen; i + 63 < inputLen; i += 64)
-      MD4Transform (context->state, &input[i]);
+      MD4Transform (&context->A, &input[i]);
 
     idx = 0;
   }
@@ -139,7 +139,7 @@ MD4Update (MD4_CTX *context, const void *in, unsigned int inputLen)
 
   /* Buffer remaining input */
   memcpy
-    ((POINTER)&context->buffer[idx], (CONST_POINTER)&input[i],
+    ((POINTER)&((char *)context->data)[idx], (CONST_POINTER)&input[i],
      inputLen-i);
 }
 
@@ -151,11 +151,11 @@ MD4Pad (MD4_CTX *context)
   unsigned int idx, padLen;
 
   /* Save number of bits */
-  Encode (bits, context->count, 8);
+  Encode (bits, &context->Nl, 8);
 
   /* Pad out to 56 mod 64.
    */
-  idx = (unsigned int)((context->count[0] >> 3) & 0x3f);
+  idx = (unsigned int)((context->Nl >> 3) & 0x3f);
   padLen = (idx < 56) ? (56 - idx) : (120 - idx);
   MD4Update (context, PADDING, padLen);
 
@@ -173,7 +173,7 @@ MD4Final (unsigned char digest[16], MD4_CTX *context)
   MD4Pad (context);
 
   /* Store state in digest */
-  Encode (digest, context->state, 16);
+  Encode (digest, &context->A, 16);
 
   /* Zeroize sensitive information.
    */
@@ -183,7 +183,7 @@ MD4Final (unsigned char digest[16], MD4_CTX *context)
 /* MD4 basic transformation. Transforms state based on block.
  */
 static void
-MD4Transform (UINT4 state[4], const unsigned char block[64])
+MD4Transform (UINT4 *state, const unsigned char *block)
 {
   UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
 
index 803a88f..b5244d1 100644 (file)
@@ -1,4 +1,43 @@
+/*
+ * Copyright (c) 2016 The DragonFly Project.  All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com>
+ *
+ * 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. Neither the name of The DragonFly Project nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``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
+ * COPYRIGHT HOLDERS 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.
+ */
+/*
+ * libmd shims for openssl + non-conflicting old API functions.
+ */
+
 #ifndef _MD5_H_
 #define _MD5_H_
+
 #include <sys/md5.h>
-#endif /* _MD5_H_ */
+
+#endif
index 704076a..2dfcf86 100644 (file)
@@ -40,8 +40,6 @@
 #include <sys/endian.h>
 #include <sys/md5.h>
 
-static void MD5Transform(u_int32_t [4], const unsigned char [64]);
-
 #ifdef _KERNEL
 #define memset(x,y,z)  bzero(x,z);
 #define memcpy(x,y,z)  bcopy(y, x, z)
@@ -129,13 +127,13 @@ int
 MD5Init (MD5_CTX *context)
 {
 
-       context->count[0] = context->count[1] = 0;
+       context->Nl = context->Nh = 0;
 
        /* Load magic initialization constants.  */
-       context->state[0] = 0x67452301;
-       context->state[1] = 0xefcdab89;
-       context->state[2] = 0x98badcfe;
-       context->state[3] = 0x10325476;
+       context->A = 0x67452301;
+       context->B = 0xefcdab89;
+       context->C = 0x98badcfe;
+       context->D = 0x10325476;
        return 1;
 }
 
@@ -152,24 +150,24 @@ MD5Update (MD5_CTX *context, const void *in, unsigned int inputLen)
        const unsigned char *input = in;
 
        /* Compute number of bytes mod 64 */
-       idx = (unsigned int)((context->count[0] >> 3) & 0x3F);
+       idx = (unsigned int)((context->Nl >> 3) & 0x3F);
 
        /* Update number of bits */
-       if ((context->count[0] += ((u_int32_t)inputLen << 3))
+       if ((context->Nl += ((u_int32_t)inputLen << 3))
            < ((u_int32_t)inputLen << 3))
-               context->count[1]++;
-       context->count[1] += ((u_int32_t)inputLen >> 29);
+               context->Nh++;
+       context->Nh += ((u_int32_t)inputLen >> 29);
 
        partLen = 64 - idx;
 
        /* Transform as many times as possible. */
        if (inputLen >= partLen) {
-               memcpy((void *)&context->buffer[idx], (const void *)input,
+               memcpy(&((char *)context->data)[idx], (const void *)input,
                    partLen);
-               MD5Transform (context->state, context->buffer);
+               MD5Transform (&context->A, (char *)context->data);
 
                for (i = partLen; i + 63 < inputLen; i += 64)
-                       MD5Transform (context->state, &input[i]);
+                       MD5Transform (&context->A, &input[i]);
 
                idx = 0;
        }
@@ -177,7 +175,7 @@ MD5Update (MD5_CTX *context, const void *in, unsigned int inputLen)
                i = 0;
 
        /* Buffer remaining input */
-       memcpy ((void *)&context->buffer[idx], (const void *)&input[i],
+       memcpy (&((char *)context->data)[idx], (const void *)&input[i],
            inputLen-i);
 }
 
@@ -192,10 +190,10 @@ MD5Pad (MD5_CTX *context)
        unsigned int idx, padLen;
 
        /* Save number of bits */
-       Encode (bits, context->count, 8);
+       Encode (bits, &context->Nl, 8);
 
        /* Pad out to 56 mod 64. */
-       idx = (unsigned int)((context->count[0] >> 3) & 0x3f);
+       idx = (unsigned int)((context->Nl >> 3) & 0x3f);
        padLen = (idx < 56) ? (56 - idx) : (120 - idx);
        MD5Update (context, PADDING, padLen);
 
@@ -215,7 +213,7 @@ MD5Final (unsigned char digest[16], MD5_CTX *context)
        MD5Pad (context);
 
        /* Store state in digest */
-       Encode (digest, context->state, 16);
+       Encode (digest, &context->A, 16);
 
        /* Zeroize sensitive information. */
        memset ((void *)context, 0, sizeof (*context));
@@ -223,8 +221,8 @@ MD5Final (unsigned char digest[16], MD5_CTX *context)
 
 /* MD5 basic transformation. Transforms state based on block. */
 
-static void
-MD5Transform (u_int32_t state[4], const unsigned char block[64])
+void
+MD5Transform (u_int32_t *state, const unsigned char *block)
 {
        u_int32_t a = state[0], b = state[1], c = state[2], d = state[3], x[16];
 
diff --git a/lib/libmd/ripemd.3 b/lib/libmd/ripemd.3
deleted file mode 100644 (file)
index 1cd473e..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-.\"
-.\" ----------------------------------------------------------------------------
-.\" "THE BEER-WARE LICENSE" (Revision 42):
-.\" <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
-.\" can do whatever you want with this stuff. If we meet some day, and you think
-.\" this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
-.\" ----------------------------------------------------------------------------
-.\"
-.\"    From: Id: mdX.3,v 1.14 1999/02/11 20:31:49 wollman Exp
-.\" $FreeBSD: src/lib/libmd/ripemd.3,v 1.15 2005/02/13 22:25:13 ru Exp $
-.\" $DragonFly: src/lib/libmd/ripemd.3,v 1.4 2008/09/11 20:25:34 swildner Exp $
-.\"
-.Dd February 26, 1999
-.Dt RIPEMD 3
-.Os
-.Sh NAME
-.Nm RIPEMD160_Init ,
-.Nm RIPEMD160_Update ,
-.Nm RIPEMD160_Final ,
-.Nm RIPEMD160_End ,
-.Nm RIPEMD160_File ,
-.Nm RIPEMD160_FileChunk ,
-.Nm RIPEMD160_Data
-.Nd calculate the RIPEMD160 message digest
-.Sh LIBRARY
-.Lb libmd
-.Sh SYNOPSIS
-.In sys/types.h
-.In ripemd.h
-.Ft void
-.Fn RIPEMD160_Init "RIPEMD160_CTX *context"
-.Ft void
-.Fn RIPEMD160_Update "RIPEMD160_CTX *context" "const unsigned char *data" "unsigned int len"
-.Ft void
-.Fn RIPEMD160_Final "unsigned char digest[20]" "RIPEMD160_CTX *context"
-.Ft "char *"
-.Fn RIPEMD160_End "RIPEMD160_CTX *context" "char *buf"
-.Ft "char *"
-.Fn RIPEMD160_File "const char *filename" "char *buf"
-.Ft "char *"
-.Fn RIPEMD160_FileChunk "const char *filename" "char *buf" "off_t offset" "off_t length"
-.Ft "char *"
-.Fn RIPEMD160_Data "const unsigned char *data" "unsigned int len" "char *buf"
-.Sh DESCRIPTION
-The
-.Li RIPEMD160_
-functions calculate a 160-bit cryptographic checksum (digest)
-for any number of input bytes.
-A cryptographic checksum is a one-way
-hash function; that is, it is computationally impractical to find
-the input corresponding to a particular output.
-This net result is a
-.Dq fingerprint
-of the input-data, which does not disclose the actual input.
-.Pp
-The
-.Fn RIPEMD160_Init ,
-.Fn RIPEMD160_Update ,
-and
-.Fn RIPEMD160_Final
-functions are the core functions.
-Allocate an
-.Vt RIPEMD160_CTX ,
-initialize it with
-.Fn RIPEMD160_Init ,
-run over the data with
-.Fn RIPEMD160_Update ,
-and finally extract the result using
-.Fn RIPEMD160_Final .
-.Pp
-The
-.Fn RIPEMD160_End
-function is a wrapper for
-.Fn RIPEMD160_Final
-which converts the return value to a 41-character
-(including the terminating '\e0')
-.Tn ASCII
-string which represents the 160 bits in hexadecimal.
-.Pp
-The
-.Fn RIPEMD160_File
-function calculates the digest of a file, and uses
-.Fn RIPEMD160_End
-to return the result.
-If the file cannot be opened, a null pointer is returned.
-The
-.Fn RIPEMD160_FileChunk
-function is similar to
-.Fn RIPEMD160_File ,
-but it only calculates the digest over a byte-range of the file specified,
-starting at
-.Fa offset
-and spanning
-.Fa length
-bytes.
-If the
-.Fa length
-parameter is specified as 0, or more than the length of the remaining part
-of the file,
-.Fn RIPEMD160_FileChunk
-calculates the digest from
-.Fa offset
-to the end of file.
-The
-.Fn RIPEMD160_Data
-function calculates the digest of a chunk of data in memory, and uses
-.Fn RIPEMD160_End
-to return the result.
-.Pp
-When using
-.Fn RIPEMD160_End ,
-.Fn RIPEMD160_File ,
-or
-.Fn RIPEMD160_Data ,
-the
-.Fa buf
-argument can be a null pointer, in which case the returned string
-is allocated with
-.Xr malloc 3
-and subsequently must be explicitly deallocated using
-.Xr free 3
-after use.
-If the
-.Fa buf
-argument is non-null it must point to at least 41 characters of buffer space.
-.Sh SEE ALSO
-.Xr md2 3 ,
-.Xr md4 3 ,
-.Xr md5 3 ,
-.Xr sha 3
-.Sh HISTORY
-These functions appeared in
-.Fx 4.0 .
-.Sh AUTHORS
-The core hash routines were implemented by Eric Young based on the
-published
-.Tn RIPEMD160
-specification.
-.Sh BUGS
-No method is known to exist which finds two files having the same hash value,
-nor to find a file with a specific hash value.
-There is on the other hand no guarantee that such a method does not exist.
index 623c6f5..b6791c7 100644 (file)
@@ -1,95 +1,55 @@
-/* crypto/ripemd/ripemd.h */
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
+/*
+ * Copyright (c) 2016 The DragonFly Project.  All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com>
  *
- * 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
+ *
+ * 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 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
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of The DragonFly Project nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific, prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``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
+ * COPYRIGHT HOLDERS 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.]
  */
-
 /*
- * $FreeBSD: src/lib/libmd/ripemd.h,v 1.3 2006/01/17 15:35:56 phk Exp $
- * $DragonFly: src/lib/libmd/ripemd.h,v 1.3 2008/09/11 20:25:34 swildner Exp $
+ * libmd shims for openssl + non-conflicting old API functions.
  */
-
-#ifndef HEADER_RIPEMD_H
-#define HEADER_RIPEMD_H
+#ifndef _RIPEMD_H_
+#define _RIPEMD_H_
 
 #include <sys/cdefs.h>
-#include <sys/types.h>         /* XXX switch to machine/stdint.h and __ types */
-
-#define RIPEMD160_CBLOCK       64
-#define RIPEMD160_LBLOCK       16
-#define RIPEMD160_BLOCK                16
-#define RIPEMD160_LAST_BLOCK   56
-#define RIPEMD160_LENGTH_BLOCK 8
-#define RIPEMD160_DIGEST_LENGTH        20
-
-typedef struct RIPEMD160state_st {
-       u_int32_t A,B,C,D,E;
-       u_int32_t Nl,Nh;
-       u_int32_t data[RIPEMD160_LBLOCK];
-       int num;
-} RIPEMD160_CTX;
+#include <sys/types.h> /* XXX switch to machine/stdint.h and __ types */
+#include <openssl/ripemd.h>
 
 __BEGIN_DECLS
-int    RIPEMD160_Init(RIPEMD160_CTX *c);
-void   RIPEMD160_Update(RIPEMD160_CTX *c, const void *data,
-                        size_t len);
-void   RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);
-char   *RIPEMD160_End(RIPEMD160_CTX *, char *);
-char   *RIPEMD160_File(const char *, char *);
-char   *RIPEMD160_FileChunk(const char *, char *, off_t, off_t);
-char   *RIPEMD160_Data(const void *, unsigned int, char *);
+char *RIPEMD160_End(RIPEMD160_CTX *, char *);
+char *RIPEMD160_File(const char *, char *);
+char *RIPEMD160_FileChunk(const char *, char *, off_t, off_t);
+char *RIPEMD160_Data(const void *, unsigned int, char *);
+char *RIPEMD1601_End(RIPEMD160_CTX *, char *);
+char *RIPEMD1601_File(const char *, char *);
+char *RIPEMD1601_FileChunk(const char *, char *, off_t, off_t);
+char *RIPEMD1601_Data(const void *, unsigned int, char *);
 __END_DECLS
 
 #endif
diff --git a/lib/libmd/rmd160c.c b/lib/libmd/rmd160c.c
deleted file mode 100644 (file)
index 7fbe80c..0000000
+++ /dev/null
@@ -1,539 +0,0 @@
-/* crypto/ripemd/rmd_dgst.c */
-/* 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.]
- *
- * $FreeBSD: src/lib/libmd/rmd160c.c,v 1.7 2006/01/17 15:35:56 phk Exp $
- * $DragonFly: src/lib/libmd/rmd160c.c,v 1.6 2008/09/30 16:57:05 swildner Exp $
- */
-
-#include <sys/types.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <machine/endian.h>
-
-#include "rmd_locl.h"
-
-/*
- * The assembly-language code is not position-independent, so don't
- * try to use it in a shared library.
- */
-#ifdef PIC
-#undef RMD160_ASM
-#endif
-
-char *RMD160_version="RIPEMD160 part of SSLeay 0.9.0b 11-Oct-1998";
-
-#ifdef RMD160_ASM
-void ripemd160_block_x86(RIPEMD160_CTX *c, const u_int32_t *p,int num);
-#define ripemd160_block ripemd160_block_x86
-#else
-void ripemd160_block(RIPEMD160_CTX *c, const u_int32_t *p,int num);
-#endif
-
-int
-RIPEMD160_Init(RIPEMD160_CTX *c)
-       {
-       c->A=RIPEMD160_A;
-       c->B=RIPEMD160_B;
-       c->C=RIPEMD160_C;
-       c->D=RIPEMD160_D;
-       c->E=RIPEMD160_E;
-       c->Nl=0;
-       c->Nh=0;
-       c->num=0;
-       return 1;
-       }
-
-void
-RIPEMD160_Update(RIPEMD160_CTX *c, const void *in, size_t len)
-       {
-       u_int32_t *p;
-       int sw,sc;
-       u_int32_t l;
-       const unsigned char *data = in;
-
-       if (len == 0) return;
-
-       l=(c->Nl+(len<<3))&0xffffffffL;
-       if (l < c->Nl) /* overflow */
-               c->Nh++;
-       c->Nh+=(len>>29);
-       c->Nl=l;
-
-       if (c->num != 0)
-               {
-               p=c->data;
-               sw=c->num>>2;
-               sc=c->num&0x03;
-
-               if ((c->num+len) >= RIPEMD160_CBLOCK)
-                       {
-                       l= p[sw];
-                       p_c2l(data,l,sc);
-                       p[sw++]=l;
-                       for (; sw<RIPEMD160_LBLOCK; sw++)
-                               {
-                               c2l(data,l);
-                               p[sw]=l;
-                               }
-                       len-=(RIPEMD160_CBLOCK-c->num);
-
-                       ripemd160_block(c,p,64);
-                       c->num=0;
-                       /* drop through and do the rest */
-                       }
-               else
-                       {
-                       int ew,ec;
-
-                       c->num+=(int)len;
-                       if ((sc+len) < 4) /* ugly, add char's to a word */
-                               {
-                               l= p[sw];
-                               p_c2l_p(data,l,sc,len);
-                               p[sw]=l;
-                               }
-                       else
-                               {
-                               ew=(c->num>>2);
-                               ec=(c->num&0x03);
-                               l= p[sw];
-                               p_c2l(data,l,sc);
-                               p[sw++]=l;
-                               for (; sw < ew; sw++)
-                                       { c2l(data,l); p[sw]=l; }
-                               if (ec)
-                                       {
-                                       c2l_p(data,l,ec);
-                                       p[sw]=l;
-                                       }
-                               }
-                       return;
-                       }
-               }
-       /* we now can process the input data in blocks of RIPEMD160_CBLOCK
-        * chars and save the leftovers to c->data. */
-#if BYTE_ORDER == LITTLE_ENDIAN
-       if ((((unsigned long)data)%sizeof(u_int32_t)) == 0)
-               {
-               sw=(int)len/RIPEMD160_CBLOCK;
-               if (sw > 0)
-                       {
-                       sw*=RIPEMD160_CBLOCK;
-                       ripemd160_block(c,(u_int32_t *)data,sw);
-                       data+=sw;
-                       len-=sw;
-                       }
-               }
-#endif
-       p=c->data;
-       while (len >= RIPEMD160_CBLOCK)
-               {
-#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == BIG_ENDIAN
-               if (p != (u_int32_t *)data)
-                       memcpy(p,data,RIPEMD160_CBLOCK);
-               data+=RIPEMD160_CBLOCK;
-#if BYTE_ORDER == BIG_ENDIAN
-               for (sw=(RIPEMD160_LBLOCK/4); sw; sw--)
-                       {
-                       Endian_Reverse32(p[0]);
-                       Endian_Reverse32(p[1]);
-                       Endian_Reverse32(p[2]);
-                       Endian_Reverse32(p[3]);
-                       p+=4;
-                       }
-#endif
-#else
-               for (sw=(RIPEMD160_LBLOCK/4); sw; sw--)
-                       {
-                       c2l(data,l); *(p++)=l;
-                       c2l(data,l); *(p++)=l;
-                       c2l(data,l); *(p++)=l;
-                       c2l(data,l); *(p++)=l; 
-                       } 
-#endif
-               p=c->data;
-               ripemd160_block(c,p,64);
-               len-=RIPEMD160_CBLOCK;
-               }
-       sc=(int)len;
-       c->num=sc;
-       if (sc)
-               {
-               sw=sc>>2;       /* words to copy */
-#if BYTE_ORDER == LITTLE_ENDIAN
-               p[sw]=0;
-               memcpy(p,data,sc);
-#else
-               sc&=0x03;
-               for ( ; sw; sw--)
-                       { c2l(data,l); *(p++)=l; }
-               c2l_p(data,l,sc);
-               *p=l;
-#endif
-               }
-       }
-
-void
-RIPEMD160_Transform(RIPEMD160_CTX *c, unsigned char *b)
-       {
-       u_int32_t p[16];
-#if BYTE_ORDER != LITTLE_ENDIAN
-       u_int32_t *q;
-       int i;
-#endif
-
-#if BYTE_ORDER == BIG_ENDIAN || BYTE_ORDER == LITTLE_ENDIAN 
-       memcpy(p,b,64);
-#if BYTE_ORDER == BIG_ENDIAN
-       q=p;
-       for (i=(RIPEMD160_LBLOCK/4); i; i--)
-               {
-               Endian_Reverse32(q[0]);
-               Endian_Reverse32(q[1]);
-               Endian_Reverse32(q[2]);
-               Endian_Reverse32(q[3]);
-               q+=4;
-               }
-#endif
-#else
-       q=p;
-       for (i=(RIPEMD160_LBLOCK/4); i; i--)
-               {
-               u_int32_t l;
-               c2l(b,l); *(q++)=l;
-               c2l(b,l); *(q++)=l;
-               c2l(b,l); *(q++)=l;
-               c2l(b,l); *(q++)=l; 
-               } 
-#endif
-       ripemd160_block(c,p,64);
-       }
-
-#ifndef RMD160_ASM
-
-void
-ripemd160_block(RIPEMD160_CTX *ctx, const u_int32_t *X, int num)
-       {
-       u_int32_t A,B,C,D,E;
-       u_int32_t a,b,c,d,e;
-
-       for (;;)
-               {
-               A=ctx->A; B=ctx->B; C=ctx->C; D=ctx->D; E=ctx->E;
-
-       RIP1(A,B,C,D,E,WL00,SL00);
-       RIP1(E,A,B,C,D,WL01,SL01);
-       RIP1(D,E,A,B,C,WL02,SL02);
-       RIP1(C,D,E,A,B,WL03,SL03);
-       RIP1(B,C,D,E,A,WL04,SL04);
-       RIP1(A,B,C,D,E,WL05,SL05);
-       RIP1(E,A,B,C,D,WL06,SL06);
-       RIP1(D,E,A,B,C,WL07,SL07);
-       RIP1(C,D,E,A,B,WL08,SL08);
-       RIP1(B,C,D,E,A,WL09,SL09);
-       RIP1(A,B,C,D,E,WL10,SL10);
-       RIP1(E,A,B,C,D,WL11,SL11);
-       RIP1(D,E,A,B,C,WL12,SL12);
-       RIP1(C,D,E,A,B,WL13,SL13);
-       RIP1(B,C,D,E,A,WL14,SL14);
-       RIP1(A,B,C,D,E,WL15,SL15);
-
-       RIP2(E,A,B,C,D,WL16,SL16,KL1);
-       RIP2(D,E,A,B,C,WL17,SL17,KL1);
-       RIP2(C,D,E,A,B,WL18,SL18,KL1);
-       RIP2(B,C,D,E,A,WL19,SL19,KL1);
-       RIP2(A,B,C,D,E,WL20,SL20,KL1);
-       RIP2(E,A,B,C,D,WL21,SL21,KL1);
-       RIP2(D,E,A,B,C,WL22,SL22,KL1);
-       RIP2(C,D,E,A,B,WL23,SL23,KL1);
-       RIP2(B,C,D,E,A,WL24,SL24,KL1);
-       RIP2(A,B,C,D,E,WL25,SL25,KL1);
-       RIP2(E,A,B,C,D,WL26,SL26,KL1);
-       RIP2(D,E,A,B,C,WL27,SL27,KL1);
-       RIP2(C,D,E,A,B,WL28,SL28,KL1);
-       RIP2(B,C,D,E,A,WL29,SL29,KL1);
-       RIP2(A,B,C,D,E,WL30,SL30,KL1);
-       RIP2(E,A,B,C,D,WL31,SL31,KL1);
-
-       RIP3(D,E,A,B,C,WL32,SL32,KL2);
-       RIP3(C,D,E,A,B,WL33,SL33,KL2);
-       RIP3(B,C,D,E,A,WL34,SL34,KL2);
-       RIP3(A,B,C,D,E,WL35,SL35,KL2);
-       RIP3(E,A,B,C,D,WL36,SL36,KL2);
-       RIP3(D,E,A,B,C,WL37,SL37,KL2);
-       RIP3(C,D,E,A,B,WL38,SL38,KL2);
-       RIP3(B,C,D,E,A,WL39,SL39,KL2);
-       RIP3(A,B,C,D,E,WL40,SL40,KL2);
-       RIP3(E,A,B,C,D,WL41,SL41,KL2);
-       RIP3(D,E,A,B,C,WL42,SL42,KL2);
-       RIP3(C,D,E,A,B,WL43,SL43,KL2);
-       RIP3(B,C,D,E,A,WL44,SL44,KL2);
-       RIP3(A,B,C,D,E,WL45,SL45,KL2);
-       RIP3(E,A,B,C,D,WL46,SL46,KL2);
-       RIP3(D,E,A,B,C,WL47,SL47,KL2);
-
-       RIP4(C,D,E,A,B,WL48,SL48,KL3);
-       RIP4(B,C,D,E,A,WL49,SL49,KL3);
-       RIP4(A,B,C,D,E,WL50,SL50,KL3);
-       RIP4(E,A,B,C,D,WL51,SL51,KL3);
-       RIP4(D,E,A,B,C,WL52,SL52,KL3);
-       RIP4(C,D,E,A,B,WL53,SL53,KL3);
-       RIP4(B,C,D,E,A,WL54,SL54,KL3);
-       RIP4(A,B,C,D,E,WL55,SL55,KL3);
-       RIP4(E,A,B,C,D,WL56,SL56,KL3);
-       RIP4(D,E,A,B,C,WL57,SL57,KL3);
-       RIP4(C,D,E,A,B,WL58,SL58,KL3);
-       RIP4(B,C,D,E,A,WL59,SL59,KL3);
-       RIP4(A,B,C,D,E,WL60,SL60,KL3);
-       RIP4(E,A,B,C,D,WL61,SL61,KL3);
-       RIP4(D,E,A,B,C,WL62,SL62,KL3);
-       RIP4(C,D,E,A,B,WL63,SL63,KL3);
-
-       RIP5(B,C,D,E,A,WL64,SL64,KL4);
-       RIP5(A,B,C,D,E,WL65,SL65,KL4);
-       RIP5(E,A,B,C,D,WL66,SL66,KL4);
-       RIP5(D,E,A,B,C,WL67,SL67,KL4);
-       RIP5(C,D,E,A,B,WL68,SL68,KL4);
-       RIP5(B,C,D,E,A,WL69,SL69,KL4);
-       RIP5(A,B,C,D,E,WL70,SL70,KL4);
-       RIP5(E,A,B,C,D,WL71,SL71,KL4);
-       RIP5(D,E,A,B,C,WL72,SL72,KL4);
-       RIP5(C,D,E,A,B,WL73,SL73,KL4);
-       RIP5(B,C,D,E,A,WL74,SL74,KL4);
-       RIP5(A,B,C,D,E,WL75,SL75,KL4);
-       RIP5(E,A,B,C,D,WL76,SL76,KL4);
-       RIP5(D,E,A,B,C,WL77,SL77,KL4);
-       RIP5(C,D,E,A,B,WL78,SL78,KL4);
-       RIP5(B,C,D,E,A,WL79,SL79,KL4);
-
-       a=A; b=B; c=C; d=D; e=E;
-       /* Do other half */
-       A=ctx->A; B=ctx->B; C=ctx->C; D=ctx->D; E=ctx->E;
-
-       RIP5(A,B,C,D,E,WR00,SR00,KR0);
-       RIP5(E,A,B,C,D,WR01,SR01,KR0);
-       RIP5(D,E,A,B,C,WR02,SR02,KR0);
-       RIP5(C,D,E,A,B,WR03,SR03,KR0);
-       RIP5(B,C,D,E,A,WR04,SR04,KR0);
-       RIP5(A,B,C,D,E,WR05,SR05,KR0);
-       RIP5(E,A,B,C,D,WR06,SR06,KR0);
-       RIP5(D,E,A,B,C,WR07,SR07,KR0);
-       RIP5(C,D,E,A,B,WR08,SR08,KR0);
-       RIP5(B,C,D,E,A,WR09,SR09,KR0);
-       RIP5(A,B,C,D,E,WR10,SR10,KR0);
-       RIP5(E,A,B,C,D,WR11,SR11,KR0);
-       RIP5(D,E,A,B,C,WR12,SR12,KR0);
-       RIP5(C,D,E,A,B,WR13,SR13,KR0);
-       RIP5(B,C,D,E,A,WR14,SR14,KR0);
-       RIP5(A,B,C,D,E,WR15,SR15,KR0);
-
-       RIP4(E,A,B,C,D,WR16,SR16,KR1);
-       RIP4(D,E,A,B,C,WR17,SR17,KR1);
-       RIP4(C,D,E,A,B,WR18,SR18,KR1);
-       RIP4(B,C,D,E,A,WR19,SR19,KR1);
-       RIP4(A,B,C,D,E,WR20,SR20,KR1);
-       RIP4(E,A,B,C,D,WR21,SR21,KR1);
-       RIP4(D,E,A,B,C,WR22,SR22,KR1);
-       RIP4(C,D,E,A,B,WR23,SR23,KR1);
-       RIP4(B,C,D,E,A,WR24,SR24,KR1);
-       RIP4(A,B,C,D,E,WR25,SR25,KR1);
-       RIP4(E,A,B,C,D,WR26,SR26,KR1);
-       RIP4(D,E,A,B,C,WR27,SR27,KR1);
-       RIP4(C,D,E,A,B,WR28,SR28,KR1);
-       RIP4(B,C,D,E,A,WR29,SR29,KR1);
-       RIP4(A,B,C,D,E,WR30,SR30,KR1);
-       RIP4(E,A,B,C,D,WR31,SR31,KR1);
-
-       RIP3(D,E,A,B,C,WR32,SR32,KR2);
-       RIP3(C,D,E,A,B,WR33,SR33,KR2);
-       RIP3(B,C,D,E,A,WR34,SR34,KR2);
-       RIP3(A,B,C,D,E,WR35,SR35,KR2);
-       RIP3(E,A,B,C,D,WR36,SR36,KR2);
-       RIP3(D,E,A,B,C,WR37,SR37,KR2);
-       RIP3(C,D,E,A,B,WR38,SR38,KR2);
-       RIP3(B,C,D,E,A,WR39,SR39,KR2);
-       RIP3(A,B,C,D,E,WR40,SR40,KR2);
-       RIP3(E,A,B,C,D,WR41,SR41,KR2);
-       RIP3(D,E,A,B,C,WR42,SR42,KR2);
-       RIP3(C,D,E,A,B,WR43,SR43,KR2);
-       RIP3(B,C,D,E,A,WR44,SR44,KR2);
-       RIP3(A,B,C,D,E,WR45,SR45,KR2);
-       RIP3(E,A,B,C,D,WR46,SR46,KR2);
-       RIP3(D,E,A,B,C,WR47,SR47,KR2);
-
-       RIP2(C,D,E,A,B,WR48,SR48,KR3);
-       RIP2(B,C,D,E,A,WR49,SR49,KR3);
-       RIP2(A,B,C,D,E,WR50,SR50,KR3);
-       RIP2(E,A,B,C,D,WR51,SR51,KR3);
-       RIP2(D,E,A,B,C,WR52,SR52,KR3);
-       RIP2(C,D,E,A,B,WR53,SR53,KR3);
-       RIP2(B,C,D,E,A,WR54,SR54,KR3);
-       RIP2(A,B,C,D,E,WR55,SR55,KR3);
-       RIP2(E,A,B,C,D,WR56,SR56,KR3);
-       RIP2(D,E,A,B,C,WR57,SR57,KR3);
-       RIP2(C,D,E,A,B,WR58,SR58,KR3);
-       RIP2(B,C,D,E,A,WR59,SR59,KR3);
-       RIP2(A,B,C,D,E,WR60,SR60,KR3);
-       RIP2(E,A,B,C,D,WR61,SR61,KR3);
-       RIP2(D,E,A,B,C,WR62,SR62,KR3);
-       RIP2(C,D,E,A,B,WR63,SR63,KR3);
-
-       RIP1(B,C,D,E,A,WR64,SR64);
-       RIP1(A,B,C,D,E,WR65,SR65);
-       RIP1(E,A,B,C,D,WR66,SR66);
-       RIP1(D,E,A,B,C,WR67,SR67);
-       RIP1(C,D,E,A,B,WR68,SR68);
-       RIP1(B,C,D,E,A,WR69,SR69);
-       RIP1(A,B,C,D,E,WR70,SR70);
-       RIP1(E,A,B,C,D,WR71,SR71);
-       RIP1(D,E,A,B,C,WR72,SR72);
-       RIP1(C,D,E,A,B,WR73,SR73);
-       RIP1(B,C,D,E,A,WR74,SR74);
-       RIP1(A,B,C,D,E,WR75,SR75);
-       RIP1(E,A,B,C,D,WR76,SR76);
-       RIP1(D,E,A,B,C,WR77,SR77);
-       RIP1(C,D,E,A,B,WR78,SR78);
-       RIP1(B,C,D,E,A,WR79,SR79);
-
-       D     =ctx->B+c+D;
-       ctx->B=ctx->C+d+E;
-       ctx->C=ctx->D+e+A;
-       ctx->D=ctx->E+a+B;
-       ctx->E=ctx->A+b+C;
-       ctx->A=D;
-
-       X+=16;
-       num-=64;
-       if (num <= 0) break;
-               }
-       }
-#endif
-
-void
-RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c)
-       {
-       int i,j;
-       u_int32_t l;
-       u_int32_t *p;
-       static unsigned char end[4]={0x80,0x00,0x00,0x00};
-       unsigned char *cp=end;
-
-       /* c->num should definitly have room for at least one more byte. */
-       p=c->data;
-       j=c->num;
-       i=j>>2;
-
-       /* purify often complains about the following line as an
-        * Uninitialized Memory Read.  While this can be true, the
-        * following p_c2l macro will reset l when that case is true.
-        * This is because j&0x03 contains the number of 'valid' bytes
-        * already in p[i].  If and only if j&0x03 == 0, the UMR will
-        * occur but this is also the only time p_c2l will do
-        * l= *(cp++) instead of l|= *(cp++)
-        * Many thanks to Alex Tang <altitude@cic.net> for pickup this
-        * 'potential bug' */
-#ifdef PURIFY
-       if ((j&0x03) == 0) p[i]=0;
-#endif
-       l=p[i];
-       p_c2l(cp,l,j&0x03);
-       p[i]=l;
-       i++;
-       /* i is the next 'undefined word' */
-       if (c->num >= RIPEMD160_LAST_BLOCK)
-               {
-               for (; i<RIPEMD160_LBLOCK; i++)
-                       p[i]=0;
-               ripemd160_block(c,p,64);
-               i=0;
-               }
-       for (; i<(RIPEMD160_LBLOCK-2); i++)
-               p[i]=0;
-       p[RIPEMD160_LBLOCK-2]=c->Nl;
-       p[RIPEMD160_LBLOCK-1]=c->Nh;
-       ripemd160_block(c,p,64);
-       cp=md;
-       l=c->A; l2c(l,cp);
-       l=c->B; l2c(l,cp);
-       l=c->C; l2c(l,cp);
-       l=c->D; l2c(l,cp);
-       l=c->E; l2c(l,cp);
-
-       /* clear stuff, ripemd160_block may be leaving some stuff on the stack
-        * but I'm not worried :-) */
-       c->num=0;
-/*     memset((char *)&c,0,sizeof(c));*/
-       }
-
-#ifdef undef
-int
-printit(unsigned long *l)
-       {
-       int i,ii;
-
-       for (i=0; i<2; i++)
-               {
-               for (ii=0; ii<8; ii++)
-                       {
-                       fprintf(stderr,"%08lx ",l[i*8+ii]);
-                       }
-               fprintf(stderr,"\n");
-               }
-       }
-#endif
diff --git a/lib/libmd/rmddriver.c b/lib/libmd/rmddriver.c
deleted file mode 100644 (file)
index 4081cf1..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* RIPEMD160DRIVER.C - test driver for RIPEMD160
- * $FreeBSD: src/lib/libmd/rmddriver.c,v 1.3 2001/09/30 21:56:22 dillon Exp $
- * $DragonFly: src/lib/libmd/rmddriver.c,v 1.3 2008/09/11 20:25:34 swildner Exp $
- */
-
-/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
-   rights reserved.
-
-   RSA Data Security, Inc. makes no representations concerning either
-   the merchantability of this software or the suitability of this
-   software for any particular purpose. It is provided "as is"
-   without express or implied warranty of any kind.
-
-   These notices must be retained in any copies of any part of this
-   documentation and/or software.
- */
-
-#include <sys/types.h>
-
-#include <stdio.h>
-#include <time.h>
-#include <string.h>
-#include "ripemd.h"
-
-/* Digests a string and prints the result.
- */
-static void RIPEMD160String (char *string)
-{
-  char buf[2*20+1];
-
-  printf ("RIPEMD160 (\"%s\") = %s\n", 
-       string, RIPEMD160_Data(string,strlen(string),buf));
-}
-
-/* Digests a reference suite of strings and prints the results.
- */
-int main(void)
-{
-  printf ("RIPEMD160 test suite:\n");
-
-  RIPEMD160String ("");
-  RIPEMD160String ("abc");
-  RIPEMD160String ("message digest");
-  RIPEMD160String ("abcdefghijklmnopqrstuvwxyz");
-  RIPEMD160String
-    ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
-  RIPEMD160String
-    ("1234567890123456789012345678901234567890\
-1234567890123456789012345678901234567890");
-  return 0;
-}
index 490bfa7..1565a9e 100644 (file)
@@ -1,99 +1,67 @@
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
+/*
+ * Copyright (c) 2016 The DragonFly Project.  All rights reserved.
+ *
+ * This code is derived from software contributed to The DragonFly Project
+ * by Matthew Dillon <dillon@backplane.com>
  *
- * 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
+ *
+ * 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 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.]
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name of The DragonFly Project nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific, prior written permission.
  *
- * $FreeBSD: src/lib/libmd/sha.h,v 1.5 2006/01/17 15:35:56 phk Exp $
- * $DragonFly: src/lib/libmd/sha.h,v 1.4 2008/09/11 20:25:34 swildner Exp $
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``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
+ * COPYRIGHT HOLDERS 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.
+ */
+/*
+ * libmd shims for openssl + non-conflicting old API functions.
  */
-
 #ifndef _SHA_H_
-#define _SHA_H_                1
+#define _SHA_H_
 
 #include <sys/cdefs.h>
-#include <sys/types.h>         /* XXX switch to machine/stdint.h and __ types */
+#include <sys/types.h> /* XXX switch to machine/stdint.h and __ types */
+#include <openssl/sha.h>
 
-#define        SHA_CBLOCK      64
-#define        SHA_LBLOCK      16
 #define        SHA_BLOCK       16
-#define        SHA_LAST_BLOCK  56
 #define        SHA_LENGTH_BLOCK 8
-#define        SHA_DIGEST_LENGTH 20
 
-typedef struct SHAstate_st {
-       u_int32_t h0, h1, h2, h3, h4;
-       u_int32_t Nl, Nh;
-       u_int32_t data[SHA_LBLOCK];
-       int num;
-} SHA_CTX;
 #define        SHA1_CTX        SHA_CTX
 
 __BEGIN_DECLS
-int    SHA_Init(SHA_CTX *c);
-void   SHA_Update(SHA_CTX *c, const void *data, size_t len);
-void   SHA_Final(unsigned char *md, SHA_CTX *c);
-char   *SHA_End(SHA_CTX *, char *);
-char   *SHA_File(const char *, char *);
-char   *SHA_FileChunk(const char *, char *, off_t, off_t);
-char   *SHA_Data(const void *, unsigned int, char *);
-int    SHA1_Init(SHA_CTX *c);
-void   SHA1_Update(SHA_CTX *c, const void *data, size_t len);
-void   SHA1_Final(unsigned char *md, SHA_CTX *c);
-char   *SHA1_End(SHA_CTX *, char *);
-char   *SHA1_File(const char *, char *);
-char   *SHA1_FileChunk(const char *, char *, off_t, off_t);
-char   *SHA1_Data(const void *, unsigned int, char *);
+/* these three are not included in libressl for reasons unknown */
+int SHA_Init(SHA_CTX *c);
+int SHA_Update(SHA_CTX *c, const void *data, size_t len);
+int SHA_Final(unsigned char *md, SHA_CTX *c);
+
+#if 0
+char *SHA_End(SHA_CTX *, char *);
+char *SHA_File(const char *, char *);
+char *SHA_FileChunk(const char *, char *, off_t, off_t);
+char *SHA_Data(const void *, unsigned int, char *);
+char *SHA1_End(SHA_CTX *, char *);
+char *SHA1_File(const char *, char *);
+char *SHA1_FileChunk(const char *, char *, off_t, off_t);
+char *SHA1_Data(const void *, unsigned int, char *);
+#endif
 __END_DECLS
 
-#endif /* !_SHA_H_ */
+#endif
diff --git a/lib/libmd/sha0c.c b/lib/libmd/sha0c.c
deleted file mode 100644 (file)
index 333b8c4..0000000
+++ /dev/null
@@ -1,446 +0,0 @@
-/* crypto/sha/sha_dgst.c */
-/* 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.]
- *
- * $FreeBSD: src/lib/libmd/sha0c.c,v 1.6 2006/01/17 15:35:56 phk Exp $
- * $DragonFly: src/lib/libmd/sha0c.c,v 1.6 2008/09/30 16:57:05 swildner Exp $
- */
-
-#include <sys/types.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include <machine/endian.h>
-
-#define  SHA_0
-#undef SHA_1
-#include "sha.h"
-#include "sha_locl.h"
-
-char *SHA_version="SHA part of SSLeay 0.9.0b 11-Oct-1998";
-
-/* Implemented from SHA-0 document - The Secure Hash Algorithm
- */
-
-#define INIT_DATA_h0 (unsigned long)0x67452301L
-#define INIT_DATA_h1 (unsigned long)0xefcdab89L
-#define INIT_DATA_h2 (unsigned long)0x98badcfeL
-#define INIT_DATA_h3 (unsigned long)0x10325476L
-#define INIT_DATA_h4 (unsigned long)0xc3d2e1f0L
-
-#define K_00_19        0x5a827999L
-#define K_20_39 0x6ed9eba1L
-#define K_40_59 0x8f1bbcdcL
-#define K_60_79 0xca62c1d6L
-
-#ifndef NOPROTO
-   void sha_block(SHA_CTX *c, const u_int32_t *p, int num);
-#else
-   void sha_block();
-#endif
-
-#define        M_c2nl          c2nl
-#define        M_p_c2nl        p_c2nl
-#define        M_c2nl_p        c2nl_p
-#define        M_p_c2nl_p      p_c2nl_p
-#define        M_nl2c          nl2c
-
-int
-SHA_Init(SHA_CTX *c)
-       {
-       c->h0=INIT_DATA_h0;
-       c->h1=INIT_DATA_h1;
-       c->h2=INIT_DATA_h2;
-       c->h3=INIT_DATA_h3;
-       c->h4=INIT_DATA_h4;
-       c->Nl=0;
-       c->Nh=0;
-       c->num=0;
-       return 1;
-       }
-
-void
-SHA_Update(SHA_CTX *c, const void *in, size_t len)
-       {
-       u_int32_t *p;
-       int ew,ec,sw,sc;
-       u_int32_t l;
-       const unsigned char *data = in;
-
-       if (len == 0) return;
-
-       l=(c->Nl+(len<<3))&0xffffffffL;
-       if (l < c->Nl) /* overflow */
-               c->Nh++;
-       c->Nh+=(len>>29);
-       c->Nl=l;
-
-       if (c->num != 0)
-               {
-               p=c->data;
-               sw=c->num>>2;
-               sc=c->num&0x03;
-
-               if ((c->num+len) >= SHA_CBLOCK)
-                       {
-                       l= p[sw];
-                       M_p_c2nl(data,l,sc);
-                       p[sw++]=l;
-                       for (; sw<SHA_LBLOCK; sw++)
-                               {
-                               M_c2nl(data,l);
-                               p[sw]=l;
-                               }
-                       len-=(SHA_CBLOCK-c->num);
-
-                       sha_block(c,p,64);
-                       c->num=0;
-                       /* drop through and do the rest */
-                       }
-               else
-                       {
-                       c->num+=(int)len;
-                       if ((sc+len) < 4) /* ugly, add char's to a word */
-                               {
-                               l= p[sw];
-                               M_p_c2nl_p(data,l,sc,len);
-                               p[sw]=l;
-                               }
-                       else
-                               {
-                               ew=(c->num>>2);
-                               ec=(c->num&0x03);
-                               l= p[sw];
-                               M_p_c2nl(data,l,sc);
-                               p[sw++]=l;
-                               for (; sw < ew; sw++)
-                                       { M_c2nl(data,l); p[sw]=l; }
-