VirtualBox

Changeset 94630 in vbox for trunk


Ignore:
Timestamp:
Apr 19, 2022 10:49:10 AM (3 years ago)
Author:
vboxsync
Message:

Runtime/crypto: Add additional APIs and supported algorithms for symmetric enc-/decryption, bugref:9955 [build fix for older openssl versions]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/cipher-openssl.cpp

    r94627 r94630  
    4545
    4646# include "internal/magics.h"
     47
     48
     49/*********************************************************************************************************************************
     50*   Defined Constants And Macros                                                                                                 *
     51*********************************************************************************************************************************/
     52#if OPENSSL_VERSION_NUMBER >= 0x10002000
     53# define MY_EVP_CTRL_AEAD_GET_TAG EVP_CTRL_AEAD_GET_TAG
     54#else
     55# define MY_EVP_CTRL_AEAD_GET_TAG EVP_CTRL_GCM_GET_TAG
     56#endif
     57
     58#if OPENSSL_VERSION_NUMBER >= 0x10002000
     59# define MY_EVP_CTRL_AEAD_SET_TAG EVP_CTRL_AEAD_SET_TAG
     60#else
     61# define MY_EVP_CTRL_AEAD_SET_TAG EVP_CTRL_GCM_SET_TAG
     62#endif
    4763
    4864
     
    325341        if (pvTag && cbTag)
    326342        {
    327             if (EVP_CIPHER_CTX_ctrl(pCtx->pCipherCtx, EVP_CTRL_AEAD_GET_TAG, (int)cbTag, pvTag))
     343            if (EVP_CIPHER_CTX_ctrl(pCtx->pCipherCtx, MY_EVP_CTRL_AEAD_GET_TAG, (int)cbTag, pvTag))
    328344            {
    329345                *pcbTag = cbTag;
     
    387403        {
    388404            rc = VINF_SUCCESS;
    389             if (pvTag && cbTag && !EVP_CIPHER_CTX_ctrl(pCtx->pCipherCtx, EVP_CTRL_AEAD_SET_TAG, (int)cbTag, pvTag))
     405            if (pvTag && cbTag && !EVP_CIPHER_CTX_ctrl(pCtx->pCipherCtx, MY_EVP_CTRL_AEAD_SET_TAG, (int)cbTag, pvTag))
    390406                rc = VERR_CR_CIPHER_OSSL_SET_TAG_FAILED;
    391407
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette