You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.4 KiB

  1. --- a/src/ms_chap.c
  2. +++ b/src/ms_chap.c
  3. @@ -96,18 +96,18 @@ MakeKey(u_char *key, u_char *des_key)
  4. des_key[6] = Get7Bits(key, 42);
  5. des_key[7] = Get7Bits(key, 49);
  6. - des_set_odd_parity((des_cblock *)des_key);
  7. + DES_set_odd_parity((DES_cblock *)des_key);
  8. }
  9. static void /* IN 8 octets IN 7 octest OUT 8 octets */
  10. DesEncrypt(u_char *clear, u_char *key, u_char *cipher)
  11. {
  12. - des_cblock des_key;
  13. - des_key_schedule key_schedule;
  14. + DES_cblock des_key;
  15. + DES_key_schedule key_schedule;
  16. MakeKey(key, des_key);
  17. - des_set_key(&des_key, key_schedule);
  18. - des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1);
  19. + DES_set_key(&des_key, &key_schedule);
  20. + DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher, &key_schedule, 1);
  21. }
  22. #define LENGTH 20
  23. --- a/src/ssl.c
  24. +++ b/src/ssl.c
  25. @@ -35,11 +35,13 @@ openssl_env * initssl() {
  26. if (openssl_init == 0) {
  27. openssl_init = 1;
  28. #ifdef HAVE_OPENSSL
  29. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  30. if (_options.debug) {
  31. SSL_load_error_strings();
  32. }
  33. SSL_library_init();
  34. OpenSSL_add_all_algorithms();
  35. +#endif
  36. #else
  37. matrixSslOpen();
  38. syslog(LOG_DEBUG, "%s(%d): MatrixSslOpen()", __FUNCTION__, __LINE__);
  39. @@ -55,11 +57,13 @@ openssl_env * initssl_cli() {
  40. if (openssl_init == 0) {
  41. openssl_init = 1;
  42. #ifdef HAVE_OPENSSL
  43. +#if OPENSSL_VERSION_NUMBER < 0x10100000L
  44. if (_options.debug) {
  45. SSL_load_error_strings();
  46. }
  47. SSL_library_init();
  48. OpenSSL_add_all_algorithms();
  49. +#endif
  50. #else
  51. matrixSslOpen();
  52. syslog(LOG_DEBUG, "%s(%d): MatrixSslOpen()", __FUNCTION__, __LINE__);
  53. @@ -132,7 +136,7 @@ _openssl_env_init(openssl_env *env, char *engine, int server) {
  54. if (_options.sslciphers) {
  55. SSL_CTX_set_cipher_list(env->ctx, _options.sslciphers);
  56. }
  57. -#ifdef HAVE_OPENSSL_ENGINE
  58. +#ifndef OPENSSL_NO_ENGINE
  59. if (engine) {
  60. retry:
  61. if ((env->engine = ENGINE_by_id(engine)) == NULL) {
  62. @@ -609,7 +613,7 @@ openssl_env_free(openssl_env *env) {
  63. #endif
  64. #ifdef HAVE_OPENSSL
  65. if (env->ctx) SSL_CTX_free(env->ctx);
  66. -#ifdef HAVE_OPENSSL_ENGINE
  67. +#ifndef OPENSSL_NO_ENGINE
  68. if (env->engine) ENGINE_free(env->engine);
  69. #endif
  70. #endif
  71. --- a/src/ssl.h
  72. +++ b/src/ssl.h
  73. @@ -41,6 +41,7 @@ typedef struct {
  74. #include <openssl/ssl.h>
  75. #include <openssl/pem.h>
  76. #include <openssl/engine.h>
  77. +#include <openssl/err.h>
  78. #elif HAVE_CYASSL
  79. #include <stdio.h>
  80. #include <stdlib.h>