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.

99 lines
3.1 KiB

  1. From b57487e360916ab3eaa50aa6d021c73b6337a4a0 Mon Sep 17 00:00:00 2001
  2. From: Dennis Schridde <dennis.schridde@uni-heidelberg.de>
  3. Date: Wed, 30 Nov 2016 17:33:00 +0100
  4. Subject: [PATCH 1/4] ID:461 - OpenSSL 1.1 compatibility - "error: storage size
  5. of 'ctx' isn't known"
  6. In OpenSSL 1.1 EVP_CIPHER_CTX became opaque, cf. `man 3ssl EVP_EncryptInit`
  7. Fixes: ID:461
  8. ---
  9. src/plugins/lanplus/lanplus_crypt_impl.c | 28 ++++++++++++++--------------
  10. 1 file changed, 14 insertions(+), 14 deletions(-)
  11. --- a/src/plugins/lanplus/lanplus_crypt_impl.c
  12. +++ b/src/plugins/lanplus/lanplus_crypt_impl.c
  13. @@ -164,10 +164,10 @@ lanplus_encrypt_aes_cbc_128(const uint8_
  14. uint8_t * output,
  15. uint32_t * bytes_written)
  16. {
  17. - EVP_CIPHER_CTX ctx;
  18. - EVP_CIPHER_CTX_init(&ctx);
  19. - EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
  20. - EVP_CIPHER_CTX_set_padding(&ctx, 0);
  21. + EVP_CIPHER_CTX* ctx;
  22. + EVP_CIPHER_CTX_init(ctx);
  23. + EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
  24. + EVP_CIPHER_CTX_set_padding(ctx, 0);
  25. *bytes_written = 0;
  26. @@ -191,7 +191,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_
  27. assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
  28. - if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
  29. + if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
  30. {
  31. /* Error */
  32. *bytes_written = 0;
  33. @@ -201,7 +201,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_
  34. {
  35. uint32_t tmplen;
  36. - if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
  37. + if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
  38. {
  39. *bytes_written = 0;
  40. return; /* Error */
  41. @@ -210,7 +210,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_
  42. {
  43. /* Success */
  44. *bytes_written += tmplen;
  45. - EVP_CIPHER_CTX_cleanup(&ctx);
  46. + EVP_CIPHER_CTX_cleanup(ctx);
  47. }
  48. }
  49. }
  50. @@ -239,10 +239,10 @@ lanplus_decrypt_aes_cbc_128(const uint8_
  51. uint8_t * output,
  52. uint32_t * bytes_written)
  53. {
  54. - EVP_CIPHER_CTX ctx;
  55. - EVP_CIPHER_CTX_init(&ctx);
  56. - EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
  57. - EVP_CIPHER_CTX_set_padding(&ctx, 0);
  58. + EVP_CIPHER_CTX* ctx;
  59. + EVP_CIPHER_CTX_init(ctx);
  60. + EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
  61. + EVP_CIPHER_CTX_set_padding(ctx, 0);
  62. if (verbose >= 5)
  63. @@ -266,7 +266,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_
  64. assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
  65. - if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
  66. + if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
  67. {
  68. /* Error */
  69. lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
  70. @@ -277,7 +277,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_
  71. {
  72. uint32_t tmplen;
  73. - if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
  74. + if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
  75. {
  76. char buffer[1000];
  77. ERR_error_string(ERR_get_error(), buffer);
  78. @@ -290,7 +290,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_
  79. {
  80. /* Success */
  81. *bytes_written += tmplen;
  82. - EVP_CIPHER_CTX_cleanup(&ctx);
  83. + EVP_CIPHER_CTX_cleanup(ctx);
  84. }
  85. }