FreeBSD Bugzilla – Attachment 198087 Details for
Bug 232217
sysutils/ipmitool: Fix OpenSSL build
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix OpenSSL 1.1.x build
ipmitool (text/plain), 5.02 KB, created by
Nathan
on 2018-10-13 04:37:53 UTC
(
hide
)
Description:
Fix OpenSSL 1.1.x build
Filename:
MIME Type:
Creator:
Nathan
Created:
2018-10-13 04:37:53 UTC
Size:
5.02 KB
patch
obsolete
>sysutils/ipmitool: Build OpenSSL build > >PR: 231931 >Submitted by: Nathan <ndowens@yahoo.com> > >Index: sysutils/ipmitool/Makefile >=================================================================== >--- sysutils/ipmitool/Makefile (revision 481687) >+++ sysutils/ipmitool/Makefile (working copy) >@@ -3,7 +3,7 @@ > > PORTNAME= ipmitool > PORTVERSION= 1.8.18 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= sysutils > MASTER_SITES= SF > >@@ -13,8 +13,6 @@ > LICENSE= BSD3CLAUSE > LICENSE_FILE= ${WRKSRC}/COPYING > >-BROKEN_SSL= openssl-devel >- > USES= cpe tar:bzip2 gmake readline ssl > CPE_VENDOR= sun > GNU_CONFIGURE= yes >Index: sysutils/ipmitool/files/patch-src_plugins_lanplus_lanplus__crypt__impl.c >=================================================================== >--- sysutils/ipmitool/files/patch-src_plugins_lanplus_lanplus__crypt__impl.c (nonexistent) >+++ sysutils/ipmitool/files/patch-src_plugins_lanplus_lanplus__crypt__impl.c (working copy) >@@ -0,0 +1,133 @@ >+--- src/plugins/lanplus/lanplus_crypt_impl.c.orig 2018-10-13 04:26:25 UTC >++++ src/plugins/lanplus/lanplus_crypt_impl.c >+@@ -164,11 +164,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, >+ uint8_t * output, >+ uint32_t * bytes_written) >+ { >+- EVP_CIPHER_CTX ctx; >+- EVP_CIPHER_CTX_init(&ctx); >+- EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); >+- EVP_CIPHER_CTX_set_padding(&ctx, 0); >+- >++ EVP_CIPHER_CTX *ctx = NULL; >+ >+ *bytes_written = 0; >+ >+@@ -182,7 +178,14 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, >+ printbuf(input, input_length, "encrypting this data"); >+ } >+ >+- >++ ctx = EVP_CIPHER_CTX_new(); >++ if (ctx == NULL) { >++ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed"); >++ return; >++ } >++ EVP_CIPHER_CTX_init(ctx); >++ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); >++ EVP_CIPHER_CTX_set_padding(ctx, 0); >+ /* >+ * The default implementation adds a whole block of padding if the input >+ * data is perfectly aligned. We would like to keep that from happening. >+@@ -191,28 +194,27 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv, >+ assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); >+ >+ >+- if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) >++ if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) >+ { >+ /* Error */ >+ *bytes_written = 0; >+- return; >+ } >+ else >+ { >+ uint32_t tmplen; >+ >+- if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) >++ if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) >+ { >+ *bytes_written = 0; >+- return; /* Error */ >+ } >+ else >+ { >+ /* Success */ >+ *bytes_written += tmplen; >+- EVP_CIPHER_CTX_cleanup(&ctx); >+ } >+ } >++ /* performs cleanup and free */ >++ EVP_CIPHER_CTX_free(ctx); >+ } >+ >+ >+@@ -239,12 +241,8 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, >+ uint8_t * output, >+ uint32_t * bytes_written) >+ { >+- EVP_CIPHER_CTX ctx; >+- EVP_CIPHER_CTX_init(&ctx); >+- EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv); >+- EVP_CIPHER_CTX_set_padding(&ctx, 0); >++ EVP_CIPHER_CTX *ctx = NULL; >+ >+- >+ if (verbose >= 5) >+ { >+ printbuf(iv, 16, "decrypting with this IV"); >+@@ -257,6 +255,14 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, >+ >+ if (input_length == 0) >+ return; >++ ctx = EVP_CIPHER_CTX_new(); >++ if (ctx == NULL) { >++ lprintf(LOG_DEBUG, "ERROR: EVP_CIPHER_CTX_new() failed"); >++ return; >++ } >++ EVP_CIPHER_CTX_init(ctx); >++ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv); >++ EVP_CIPHER_CTX_set_padding(ctx, 0); >+ >+ /* >+ * The default implementation adds a whole block of padding if the input >+@@ -266,33 +272,32 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv, >+ assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0); >+ >+ >+- if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length)) >++ if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length)) >+ { >+ /* Error */ >+ lprintf(LOG_DEBUG, "ERROR: decrypt update failed"); >+ *bytes_written = 0; >+- return; >+ } >+ else >+ { >+ uint32_t tmplen; >+ >+- if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen)) >++ if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen)) >+ { >++ /* Error */ >+ char buffer[1000]; >+ ERR_error_string(ERR_get_error(), buffer); >+ lprintf(LOG_DEBUG, "the ERR error %s", buffer); >+ lprintf(LOG_DEBUG, "ERROR: decrypt final failed"); >+ *bytes_written = 0; >+- return; /* Error */ >+ } >+ else >+ { >+- /* Success */ >+- *bytes_written += tmplen; >+- EVP_CIPHER_CTX_cleanup(&ctx); >++ >++ >+ } >+ } >++ EVP_CIPHER_CTX_free(ctx); >+ >+ if (verbose >= 5) >+ { > >Property changes on: sysutils/ipmitool/files/patch-src_plugins_lanplus_lanplus__crypt__impl.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ndowens04
:
maintainer-approval?
(
zi
)
Actions:
View
|
Diff
Attachments on
bug 232217
: 198087