LCOV - code coverage report
Current view: top level - crypto - s2n_openssl.h (source / functions) Hit Total Coverage
Test: unit_test_coverage.info Lines: 2 2 100.0 %
Date: 2025-08-15 07:28:39 Functions: 0 0 -
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
       3                 :            :  *
       4                 :            :  * Licensed under the Apache License, Version 2.0 (the "License").
       5                 :            :  * You may not use this file except in compliance with the License.
       6                 :            :  * A copy of the License is located at
       7                 :            :  *
       8                 :            :  *  http://aws.amazon.com/apache2.0
       9                 :            :  *
      10                 :            :  * or in the "license" file accompanying this file. This file is distributed
      11                 :            :  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
      12                 :            :  * express or implied. See the License for the specific language governing
      13                 :            :  * permissions and limitations under the License.
      14                 :            :  */
      15                 :            : 
      16                 :            : #pragma once
      17                 :            : 
      18                 :            : /**
      19                 :            :  * openssl with OPENSSL_VERSION_NUMBER < 0x10100003L made data type details unavailable
      20                 :            :  * libressl use openssl with data type details available, but mandatorily set
      21                 :            :  * OPENSSL_VERSION_NUMBER = 0x20000000L, insane!
      22                 :            :  * https://github.com/aws/aws-sdk-cpp/pull/507/commits/2c99f1fe0c4b4683280caeb161538d4724d6a179
      23                 :            :  */
      24                 :            : #if defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x20000000L)
      25                 :            :     #undef OPENSSL_VERSION_NUMBER
      26                 :            :     #if LIBRESSL_VERSION_NUMBER < 0x3050000fL
      27                 :            :         #define OPENSSL_VERSION_NUMBER 0x1000107fL
      28                 :            :     #else
      29                 :            :         #define OPENSSL_VERSION_NUMBER 0x1010000fL
      30                 :            :     #endif
      31                 :            : #endif
      32                 :            : 
      33                 :            : /* Per https://wiki.openssl.org/index.php/Manual:OPENSSL_VERSION_NUMBER(3)
      34                 :            :  * OPENSSL_VERSION_NUMBER in hex is: MNNFFRBB major minor fix final beta/patch.
      35                 :            :  * bitwise: MMMMNNNNNNNNFFFFFFFFRRRRBBBBBBBB
      36                 :            :  * For our purposes we're only concerned about major/minor/fix. Patch versions don't usually introduce
      37                 :            :  * features.
      38                 :            :  */
      39                 :            : 
      40                 :            : #define S2N_OPENSSL_VERSION_AT_LEAST(major, minor, fix) \
      41                 :       3275 :     (OPENSSL_VERSION_NUMBER >= ((major << 28) + (minor << 20) + (fix << 12)))
      42                 :            : 
      43                 :            : #if (S2N_OPENSSL_VERSION_AT_LEAST(1, 1, 0)) && (!defined(OPENSSL_IS_BORINGSSL)) && (!defined(OPENSSL_IS_AWSLC)) && (!defined(LIBRESSL_VERSION_NUMBER))
      44                 :            :     #define s2n_evp_ctx_init(ctx)    POSIX_GUARD_OSSL(EVP_CIPHER_CTX_init(ctx), S2N_ERR_DRBG)
      45                 :    6408633 :     #define RESULT_EVP_CTX_INIT(ctx) RESULT_GUARD_OSSL(EVP_CIPHER_CTX_init(ctx), S2N_ERR_DRBG)
      46                 :            : #else
      47                 :            :     #define s2n_evp_ctx_init(ctx)    EVP_CIPHER_CTX_init(ctx)
      48                 :            :     #define RESULT_EVP_CTX_INIT(ctx) EVP_CIPHER_CTX_init(ctx)
      49                 :            : #endif

Generated by: LCOV version 1.14