openssl compatibility
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gridengine (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
8.1.9+dfsg-10build1 did not compile from the source tree as cloned with git on Ubuntu 20.04.5 LTS.
(commit 59cdf7a695a3b67
The issues were that some "structures" were allocated on stack, but the size was not known to the compiler, ending up with compilation errors. It appeared the more recent usage is to allocate the buffer dynamically through dedicated functions. The diffs are shown below. This may not be a problem depending on the ssl library versions, though.
diff --git a/source/
index 86f88ba..2d062d9 100644
--- a/source/
+++ b/source/
@@ -484,7 +484,7 @@ static int cl_com_
static int ssl_callback_
X509 *cert = NULL;
X509_LOOKUP *lookup = NULL;
- X509_STORE_CTX verify_ctx;
+ X509_STORE_CTX *verify_ctx=NULL;
int err;
int is_ok = true;
SGE_STRUCT_STAT stat_buffer;
@@ -545,20 +545,21 @@ static int ssl_callback_
cert = X509_STORE_
if (is_ok == true && cert != NULL) {
/* X509_STORE_CTX_init did not return an error condition in prior versions */
- if (X509_STORE_
+ verify_ctx = X509_STORE_
+ if (X509_STORE_
is_ok = false;
} else {
/* verify the certificate */
- if (X509_verify_
+ if (X509_verify_
is_ok = false;
}
}
if (is_ok == false) {
- err = X509_STORE_
+ err = X509_STORE_
}
- X509_STORE_
+ X509_STORE_
} else {
if (is_ok == false) {
diff --git a/source/
index bdbecec..b08dc2e 100644
--- a/source/
+++ b/source/
@@ -280,7 +280,7 @@ buffer_
{
unsigned int ebuflen;
- EVP_CIPHER_CTX ectx;
+ EVP_CIPHER_CTX *ectx=NULL;
unsigned char iv[EVP_
unsigned char *ekey[1];
int ekeylen=0, net_ekeylen=0;
@@ -326,10 +326,11 @@ buffer_
}
memset(iv, '\0', sizeof(iv));
+ ectx = EVP_CIPHER_
#if 0
- ret = EVP_SealInit(&ectx, EVP_des_ede3_cbc(), ekey, &ekeylen, iv, pubKey, 1);
+ ret = EVP_SealInit(ectx, EVP_des_ede3_cbc(), ekey, &ekeylen, iv, pubKey, 1);
#else
- ret = EVP_SealInit(&ectx, EVP_rc4(), ekey, &ekeylen, iv, pubKey, 1);
+ ret = EVP_SealInit(ectx, EVP_rc4(), ekey, &ekeylen, iv, pubKey, 1);
#endif
if(ret == 0) {
printf("---> EVP_SealInit\n");
@@ -352,7 +353,7 @@ buffer_
buffer_
- EVP_SealUpdate(
+ EVP_SealUpdate(
@@ -360,12 +361,13 @@ buffer_
buffer_
- EVP_SealFinal(
+ EVP_SealFinal(ectx, (unsigned char *)ebuf, (int*)&ebuflen);
buffer_
EVP_
+ EVP_CIPHER_
sge_
DEXIT;
}
@@ -379,7 +381,7 @@ buffer_
char buf[520];
char ebuf[512];
unsigned int buflen;
- EVP_CIPHER_CTX ectx;
+ EVP_CIPHER_CTX *ectx=NULL;
unsigned char iv[EVP_
unsigned char *encryptKey;
unsigned int ekeylen;
@@ -461,10 +463,11 @@ buffer_
memcpy(&iv, curr_ptr, sizeof(iv));
curr_ptr += sizeof(iv);
buffer_
+ ectx = EVP_CIPHER_
#if 0
- ret = EVP_OpenInit(&ectx, EVP_des_ede3_cbc(), encryptKey, ekeylen, iv, privateKey);
+ ret = EVP_OpenInit(ectx, EVP_des_ede3_cbc(), encryptKey, ekeylen, iv, privateKey);
#else
- ret = EVP_OpenInit(&ectx, EVP_rc4(), encryptKey, ekeylen, iv, privateKey);
+ ret = EVP_OpenInit(ectx, EVP_rc4(), encryptKey, ekeylen, iv, privateKey);
#endif
if(ret == 0) {
@@ -484,7 +487,7 @@ buffer_
readlen = sizeof(ebuf);
}
- ret = EVP_OpenUpdate(
+ ret = EVP_OpenUpdate(
if (ret == 0) {
@@ -502,7 +505,8 @@ buffer_
buf, buflen);
}
- ret = EVP_OpenFinal(
+ ret = EVP_OpenFinal(ectx, (unsigned char *)buf, (int*)&buflen);
+ EVP_CIPHER_
if (ret == 0) {
error_code = ERR_get_error();