Skip to content

Commit

Permalink
Fix for #2725 Check ssl and synergy target versions for compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandev2 committed Aug 15, 2018
1 parent 3a78048 commit 67e88e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions plugins/ov_rest/ov_rest_callsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* rest_patch_request() - Curl patch request.
*/

#include <openssl/opensslv.h>
#include "sahpi_wrappers.h"
#include "ov_rest_callsupport.h"
#include "ov_rest_parser_calls.h"
Expand Down Expand Up @@ -128,8 +129,8 @@ SaErrorT ov_rest_get_rest_version(REST_CON *connection){
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curlErrStr);
CURLcode curlErr = curl_easy_perform(curl);
if(curlErr) {
err("\nError %s\n", curl_easy_strerror(curlErr));
err("\nError %s\n",curlErrStr);
err("Error %s", curl_easy_strerror(curlErr));
err("Error %s",curlErrStr);
memset(connection->x_api_version, '\0', 32);
strcpy(connection->x_api_version,
OV_REST_DEFAULT_X_API_VERSION);
Expand Down Expand Up @@ -163,6 +164,15 @@ SaErrorT ov_rest_get_rest_version(REST_CON *connection){
OV_REST_DEFAULT_X_API_VERSION);

}
dbg("X-API-Version is %d, SSL_VERSION is %lx", x_version,
OPENSSL_VERSION_NUMBER);

if((x_version < 800) && (OPENSSL_VERSION_NUMBER >= 0x10100000L)) {
err("OpenSSL (>=1.1) needs X-Api-Version >=800");
err("X-API-Version is %d", x_version);
err("Please consider upgrading Synergy firmware");
}

wrap_free(st.ptr);
wrap_g_free(connection->url);
curl_easy_cleanup(curl);
Expand Down
2 changes: 1 addition & 1 deletion plugins/ov_rest/ov_rest_parser_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ struct eventInfo
#define MAX_EVT_CREATED_LEN 32
#define MAX_TASK_STATE_LEN 20

#define X_API_VERSION 600
#define X_API_VERSION 800
#define OV_REST_ACCEPT \
("Accept: application/json")
#define OV_REST_ACCEPT_LANGUAGE \
Expand Down

0 comments on commit 67e88e4

Please sign in to comment.