Skip to content

Commit

Permalink
Change name to sslservices
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdelv committed Dec 12, 2024
1 parent eeb5b48 commit 51110d6
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 203 deletions.
26 changes: 13 additions & 13 deletions ecllibrary/std/OpenSSL.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

EXPORT OpenSSL := MODULE

IMPORT lib_openssl;
IMPORT lib_sslservices;

EXPORT Digest := MODULE

Expand All @@ -33,7 +33,7 @@ EXPORT Digest := MODULE
* PublicKey.Sign()
* PublicKey.VerifySignature()
*/
EXPORT DATASET({STRING name}) AvailableAlgorithms() := lib_openssl.OpenSSL.digestAvailableAlgorithms();
EXPORT DATASET({STRING name}) AvailableAlgorithms() := lib_sslservices.SSLServices.digestAvailableAlgorithms();

/**
* Compute the hash of given data according to the named
Expand All @@ -49,7 +49,7 @@ EXPORT Digest := MODULE
*
* @see AvailableAlgorithms()
*/
EXPORT DATA Hash(DATA indata, VARSTRING algorithm_name) := lib_openssl.OpenSSL.digesthash(indata, algorithm_name);
EXPORT DATA Hash(DATA indata, VARSTRING algorithm_name) := lib_sslservices.SSLServices.digesthash(indata, algorithm_name);

END; // Digest

Expand All @@ -69,7 +69,7 @@ EXPORT Ciphers := MODULE
* Encrypt()
* Decrypt()
*/
EXPORT DATASET({STRING name}) AvailableAlgorithms() := lib_openssl.OpenSSL.cipherAvailableAlgorithms();
EXPORT DATASET({STRING name}) AvailableAlgorithms() := lib_sslservices.SSLServices.cipherAvailableAlgorithms();

/**
* Return the size of the IV used for the given symmetric
Expand All @@ -88,7 +88,7 @@ EXPORT Ciphers := MODULE
*
* @see AvailableAlgorithms()
*/
EXPORT UNSIGNED2 IVSize(VARSTRING algorithm_name) := lib_openssl.OpenSSL.cipherIVSize(algorithm_name);
EXPORT UNSIGNED2 IVSize(VARSTRING algorithm_name) := lib_sslservices.SSLServices.cipherIVSize(algorithm_name);

/**
* Return the size of the salt used for the given symmetric
Expand Down Expand Up @@ -144,7 +144,7 @@ EXPORT Ciphers := MODULE
* SaltSize()
* Decrypt()
*/
EXPORT DATA Encrypt(DATA plaintext, VARSTRING algorithm_name, DATA passphrase, DATA iv = (DATA)'', DATA salt = (DATA)'') := lib_openssl.OpenSSL.cipherEncrypt(plaintext, algorithm_name, passphrase, iv, salt);
EXPORT DATA Encrypt(DATA plaintext, VARSTRING algorithm_name, DATA passphrase, DATA iv = (DATA)'', DATA salt = (DATA)'') := lib_sslservices.SSLServices.cipherEncrypt(plaintext, algorithm_name, passphrase, iv, salt);


/**
Expand Down Expand Up @@ -179,7 +179,7 @@ EXPORT Ciphers := MODULE
* SaltSize()
* Encrypt()
*/
EXPORT DATA Decrypt(DATA ciphertext, VARSTRING algorithm_name, DATA passphrase, DATA iv = (DATA)'', DATA salt = (DATA)'') := lib_openssl.OpenSSL.cipherDecrypt(ciphertext, algorithm_name, passphrase, iv, salt);
EXPORT DATA Decrypt(DATA ciphertext, VARSTRING algorithm_name, DATA passphrase, DATA iv = (DATA)'', DATA salt = (DATA)'') := lib_sslservices.SSLServices.cipherDecrypt(ciphertext, algorithm_name, passphrase, iv, salt);
END; // Ciphers

EXPORT PublicKey := MODULE
Expand Down Expand Up @@ -218,7 +218,7 @@ EXPORT PublicKey := MODULE
* @see RSAUnseal()
* Ciphers.AvailableAlgorithms()
*/
EXPORT DATA RSASeal(DATA plaintext, SET OF STRING pem_public_keys, VARSTRING algorithm_name = 'aes-256-cbc') := lib_openssl.OpenSSL.pkRSASeal(plaintext, pem_public_keys, algorithm_name);
EXPORT DATA RSASeal(DATA plaintext, SET OF STRING pem_public_keys, VARSTRING algorithm_name = 'aes-256-cbc') := lib_sslservices.SSLServices.pkRSASeal(plaintext, pem_public_keys, algorithm_name);

/**
* Decrypts ciphertext previously generated by the RSASeal() function.
Expand Down Expand Up @@ -257,7 +257,7 @@ EXPORT PublicKey := MODULE
* @see RSASeal()
* Ciphers.AvailableAlgorithms()
*/
EXPORT DATA RSAUnseal(DATA ciphertext, DATA passphrase, STRING pem_private_key, VARSTRING algorithm_name = 'aes-256-cbc') := lib_openssl.OpenSSL.pkRSAUnseal(ciphertext, passphrase, pem_private_key, algorithm_name);
EXPORT DATA RSAUnseal(DATA ciphertext, DATA passphrase, STRING pem_private_key, VARSTRING algorithm_name = 'aes-256-cbc') := lib_sslservices.SSLServices.pkRSAUnseal(ciphertext, passphrase, pem_private_key, algorithm_name);

/**
* This function performs asymmetric encryption. It should be used to
Expand All @@ -272,7 +272,7 @@ EXPORT PublicKey := MODULE
*
* @see Decrypt()
*/
EXPORT DATA Encrypt(DATA plaintext, STRING pem_public_key) := lib_openssl.OpenSSL.pkEncrypt(plaintext, pem_public_key);
EXPORT DATA Encrypt(DATA plaintext, STRING pem_public_key) := lib_sslservices.SSLServices.pkEncrypt(plaintext, pem_public_key);

/**
* This function performs asymmetric decryption. It should be used to
Expand All @@ -291,7 +291,7 @@ EXPORT PublicKey := MODULE
*
* @see Encrypt()
*/
EXPORT DATA Decrypt(DATA ciphertext, DATA passphrase, STRING pem_private_key) := lib_openssl.OpenSSL.pkDecrypt(ciphertext, passphrase, pem_private_key);
EXPORT DATA Decrypt(DATA ciphertext, DATA passphrase, STRING pem_private_key) := lib_sslservices.SSLServices.pkDecrypt(ciphertext, passphrase, pem_private_key);

/**
* Create a digital signature of the given data, using the
Expand Down Expand Up @@ -321,7 +321,7 @@ EXPORT PublicKey := MODULE
* @see Digest.AvailableAlgorithms()
* VerifySignature()
*/
EXPORT DATA Sign(DATA plaintext, DATA passphrase, STRING pem_private_key, VARSTRING algorithm_name = 'sha256') := lib_openssl.OpenSSL.pkSign(plaintext, passphrase, pem_private_key, algorithm_name);
EXPORT DATA Sign(DATA plaintext, DATA passphrase, STRING pem_private_key, VARSTRING algorithm_name = 'sha256') := lib_sslservices.SSLServices.pkSign(plaintext, passphrase, pem_private_key, algorithm_name);

/**
* Verify the given digital signature of the given data, using
Expand All @@ -348,7 +348,7 @@ EXPORT PublicKey := MODULE
* @see Digest.AvailableAlgorithms()
* Sign()
*/
EXPORT BOOLEAN VerifySignature(DATA signature, DATA signedData, STRING pem_public_key, VARSTRING algorithm_name = 'sha256') := lib_openssl.OpenSSL.pkVerifySignature(signature, signedData, pem_public_key, algorithm_name);
EXPORT BOOLEAN VerifySignature(DATA signature, DATA signedData, STRING pem_public_key, VARSTRING algorithm_name = 'sha256') := lib_sslservices.SSLServices.pkVerifySignature(signature, signedData, pem_public_key, algorithm_name);

END; // PublicKey

Expand Down
2 changes: 1 addition & 1 deletion ecllibrary/teststd/OpenSSL/TestOpenSSL.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ EXPORT TestOpenSSL := MODULE
ASSERT(LENGTH(encrypt_rsa) = 512);
ASSERT((STRING)Std.OpenSSL.PublicKey.Decrypt((DATA)encrypt_rsa, (DATA)'', RSA_PRIVATE_1) = PLAINTEXT);
ASSERT((STRING)Std.OpenSSL.PublicKey.Decrypt((DATA)encrypt_rsa_passphrase, (DATA)PASSPHRASE, RSA_PRIVATE_2) = PLAINTEXT);
ASSERT(LENGTH(seal_rsa) = 1112);
ASSERT(LENGTH(seal_rsa) = 1100);
ASSERT((STRING)Std.OpenSSL.PublicKey.RSAUnseal((DATA)seal_rsa, (DATA)'', RSA_PRIVATE_1) = PLAINTEXT);
ASSERT((STRING)Std.OpenSSL.PublicKey.RSAUnseal((DATA)seal_rsa, (DATA)PASSPHRASE, RSA_PRIVATE_2) = PLAINTEXT);

Expand Down
4 changes: 3 additions & 1 deletion plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ add_subdirectory (couchbase)
add_subdirectory (sqs)
add_subdirectory (mongodb)
add_subdirectory (parquet)
add_subdirectory (openssl)
IF ( INCLUDE_EE_PLUGINS )
add_subdirectory (eeproxies)
ENDIF()
IF (USE_OPENSSL)
add_subdirectory (cryptolib)
ENDIF()
IF (USE_OPENSSLV3)
add_subdirectory (sslservices)
ENDIF()
62 changes: 0 additions & 62 deletions plugins/openssl/openssl.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/proxies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_cryptolib.ecllib DESTINATION plu
ENDIF()

IF (USE_OPENSSLV3)
install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_openssl.ecllib DESTINATION ${proxies_out_dir} COMPONENT Runtime)
install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_sslservices.ecllib DESTINATION ${proxies_out_dir} COMPONENT Runtime)
ENDIF()
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
############################################################################## */

// Service definition
export OpenSSL := SERVICE : plugin('openssl')
export SSLServices := SERVICE : plugin('sslservices')

// Hash functions
DATASET({STRING name}) digestAvailableAlgorithms() : cpp,action,context,entrypoint='digestAvailableAlgorithms';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
# limitations under the License.
##############################################################################

# Component: openssl
# Component: sslservices

#############################################################
# Description:
# -----------
# Cmake Input File for openssl
# Cmake Input File for sslservices
#############################################################

project(openssl)
project(sslservices)

if (PLATFORM AND USE_OPENSSLV3)
find_package(OpenSSL REQUIRED)

set(
SRCS
openssl.hpp
openssl.cpp
sslservices.hpp
sslservices.cpp
)

include_directories(
Expand All @@ -42,10 +42,10 @@ if (PLATFORM AND USE_OPENSSLV3)
)

add_definitions(-D_USRDLL -DECL_OPENSSL_EXPORTS)
HPCC_ADD_LIBRARY(openssl SHARED ${SRCS})
HPCC_ADD_LIBRARY(sslservices SHARED ${SRCS})

install(
TARGETS openssl
TARGETS sslservices
DESTINATION plugins CALC_DEPS
)
install(
Expand All @@ -55,7 +55,7 @@ if (PLATFORM AND USE_OPENSSLV3)
)

target_link_libraries(
openssl
sslservices
eclrtl
jlib
OpenSSL::SSL
Expand Down
Loading

0 comments on commit 51110d6

Please sign in to comment.