Fixes and Features in CommonCryptoLib

Fixes and Features in CommonCryptoLib

Symptom

CommonCryptoLib 8.4.31 contains several new features and improvements (see Solution section) and fixes for the following problems.

You are using CommonCryptoLib 8.4.30 or earlier and detect one of the following issues:

  1. You detect an increasing memory consumption of one or more work processes.
  2. CommonCryptoLib may behave unstable or crash if the calling application runs into an out-of-memory situation.
  3. PSE- and PKCS#12 files created/exported by CommonCryptoLib get unrestrictive file permissions on UNIX/Linux operating systems.
  4. You encounter an error like “Cannot open PSE” when using a specific PSE. Traces or error messages show “Division by zero” or “A function called indirectly got an invalid parameter”.
  5. You miss RIPEMD128 hash algorithm for SSF signing.
  6. The ABAP report RPUSVHD0 states that the PSE file could not be read. The RPUSVHD0 test report shows error “SSF kernel error: Invalid parameter”. A check of the affected PSE with “sapgenpse get_my_name” indicates the error “Couldn’t open PSE … (Missing PIN/Passphrase, no credentials found)”.
  7. You are using sapgenpse import_p12 to import a PKCS#12 file and see an unexpected key usage displayed.
  8. SAP Webdispatcher is unable to establish SSL connections. dev_disp log file shows errors “PSE …: unable to use!” and “Wrong PIN or PSE corrupted”. This error may not only occur in Webdispatcher scenarios.
  9. You try to create a certificate request in transaction STRUST, it fails but no error is displayed. In trace dev_w* an error like
    “*** ERROR => == krn_Ssf_GetCertificateRequest()==13 (SSF_API_UNKNOWN_SECTK_ERROR)” is dumped.

Other Terms

CommonCryptoLib, SAPCRYPTOLIB, SNC, SSF, SSL, SLS, RSA, AES-NI, TLS, STRUST

Reason and Prerequisites

CommonCryptoLib 8.4.30 or earlier has programming errors causing the described issue.

  1. There were two functions which did not correctly release the allocated memory.
  2. If an applications is not able to allocate new memory for an operation, this should results in an error. Depending where the allocation failed, older CommonCryptoLib version may have crashed or returned a wrong error.
  3. PSE- or PKCS#12-files created/exported via CommonCryptoLib functions (also when using sapgenpse) written with file permissions rw-r–r– (644) on UNIX/Linux systems.
  4. The faulting PSE was created by importing a RSA key with a public exponent different from 65537. The problem may be caused by importing a PKCS#8 or PKCS#12 file created by 3rd party software, or after replacing SAPCRYPTOLIB 5.5.5 by CommonCryptoLib. You may check an affected PSE with “sapgenpse get_my_name” command.
  5. RIPEMD128 was not enabled for use with SSF.
  6. The CommonCryptoLib function which is used by report RPUSVKD0 (and probably others) to create the PSE credentials produce a corrupted credential file (cred_v2).
  7. The import_p12 function does not know the key usages dataEncipherment and cRLSign and therefore they are incorrectly displayed.
  8. The problem is caused by a X.509 Distinguished Name consisting of 19 or more components (CN=…, CN=…, OU=…, O=…, …). “sapgenpse get_my_name|seclogin” can be used to check. In case the problem exists with the PSE, get_my_name does not show the Distinguished Name, and seclogin crashes.
  9. You have upgraded from SAPCRYPTOLIB 5.5.5 to COMMONCRYPTOLIB 8 Patch 8.4.30 or earlier. The PSE used to create the certificate request contains 8 or more certificates in the list of trusted certificates.

Solution

BUG FIXES:
Download CommonCryptoLib 8.4.31 (or higher) and install/update it on the affected system. The following fixes/improvements come with this patch:

  1. Two memory leaks fixed.
  2. Improved memory handling (especially handling out of memory situations).
  3. More secure file permissions for PSE/PKCS#12 files on UNIX/Linux systems rw——- (600).
  4. Fixed support of RSA keys using a public exponent different from 65537.
  5. RIPEMD128 for SSF activated.
  6. The affected function is fixed, cred_v2 is correctly created now.
  7. import_p12 function fixed.
  8. Handling of PSEs with long X.509 Distinguished Names fixed.
  9. Create certificate request function has been fixed

NEW FEATURES:

TLS 1.1/1.2 Support

CommonCryptoLib 8.4.31 supports SSL connections using TLS 1.1 and TLS 1.2 protocol versions.

On NetWeaver AS ABAP/AS JAVA or SAP HANA XS systems, two new protocol flags are supported for use within profile parameter ssl/ciphersuites:

  • 256 for TLS 1.1
  • 512 for TLS 1.2

For a detailed description of protocol version configuration, please refer to section 7 of SAP Note 510007; configurability of protocol versions requires a minimum Kernel patch level as described in SAP Note 1433874 (from 2010–all moderately recent Kernel software should have this configurability).

As a rule of thumb, the use of the following profile parameter settings are currently recommended:

ssl/ciphersuites=135:HIGH:MEDIUM:+e3DES:!aNULL
ssl/client_ciphersuites=192:HIGH:MEDIUM:+e3DES:!aNULL

and in case that you were using the special client settings for blind sending of a client certificate in response to a malformed CertificateRequest handshake message, as described in SAP Note 1841573 (issue 2), then you should continue using this profile parameter setting for the client side:

ssl/client_ciphersuites=208:HIGH:MEDIUM:+e3DES:!aNULL

The settings suggested above can be used with all crypto library versions (whereas using the explicit flags for TLSv1.1 and TLSv1.2 is limited to CommonCryptoLib 8.4.31 and successors). The first profile parameter value disables SSLv3 for the server-side and enables TLSv1.0, TLSv1.1 and TLSv1.2 plus CLIENT-HELLO 2.0 interop, and the second parameter configures SSLv3 & TLSv1.0 on the client side, which is the most interoperable client configuration, and safe for use by purely programmatic TLS clients.

Please note that – for compatibility and interoperability reasons – TLS 1.0 and TLS1.1 will currently be automatically enabled when TLS 1.1 or TLS 1.2 are enabled/requested.

Performance Improvements

The algorithms for RSA keys were optimized for speed. This affects signature, encryption, and authentication operations for SSL, GSS (SNC), and SSF as long as an RSA key is used.
The AES128/192/256 algorithms were optimized for speed. This affects data encryption for SSL/TLS and GSS (SNC) connections.
On CPUs with AES-NI extension (Intel/AMD x86 architecture), additional speed optimization has been achieved.

RSA-PSS for Secure Login Server with HSM

When a Secure Login Server is configured to use a hardware security module as User CA (External CA), it was not possible to use RSA-PSS based signature algorithms. Now the following algorithms are supported:

  • SHA-1 with RSA-PSS (sha1WithRSAPSS)
  • SHA-256 with RSA-PSS (sha256WithRSAPSS)
  • SHA-512 with RSA-PSS (sha512WithRSAPSS)

Secure Login Server 2.0 SP03 Patch Level 1 or higher is required to support these algorithms.

Software Components

Software Component From To And Subsequent
HDB 1 1
KRNL32NUC 7.2 7.2
KRNL32NUC 7.20EXT 7.20EXT
KRNL32NUC 7.21 7.21
KRNL32NUC 7.21EXT 7.21EXT
KRNL32UC 7.2 7.2
KRNL32UC 7.20EXT 7.20EXT
KRNL32UC 7.21 7.21
KRNL32UC 7.21EXT 7.21EXT
KRNL64NUC 7.2 7.2
KRNL64NUC 7.20EXT 7.20EXT
KRNL64NUC 7.21 7.21
KRNL64NUC 7.21EXT 7.21EXT
KRNL64NUC 7.38 7.38
KRNL64NUC 7.4 7.4
KRNL64NUC 7.41 7.41
KRNL64NUC 7.42 7.42
KRNL64UC 7.2 7.2
KRNL64UC 7.20EXT 7.20EXT
KRNL64UC 7.21 7.21

More

Support Package Patches

Software Component Support Package Patch Level Download
COMMONCRYPTOLIB 8 SP003 8431
COMMONCRYPTOLIB 8 SP004 8431
SAP KERNEL 7.20 32-BIT SP713 731
SAP KERNEL 7.20 32-BIT UNICODE SP713 731
SAP KERNEL 7.20 64-BIT SP713 731
SAP KERNEL 7.20 64-BIT UNICODE SP713 731
SAP KERNEL 7.20 EXT 32-BIT SP713 731
SAP KERNEL 7.20 EXT 32-BIT UC SP713 731
SAP KERNEL 7.20 EXT 64-BIT SP713 731
SAP KERNEL 7.20 EXT 64-BIT UC SP713 731
SAP KERNEL 7.21 32-BIT SP333 333
SAP KERNEL 7.21 64-BIT SP333 333
SAP KERNEL 7.21 64-BIT UNICODE SP333 333
SAP KERNEL 7.38 64-BIT SP069 69
SAP KERNEL 7.38 64-BIT SP070 70
SAP KERNEL 7.38 64-BIT UNICODE SP069 69
SAP KERNEL 7.38 64-BIT UNICODE SP070 70
SAP KERNEL 7.41 64-BIT SP114 114
SAP KERNEL 7.41 64-BIT UNICODE SP114 114
Related Post