kaoh / globalplatform

C library + command-line for Open- / GlobalPlatform smart cards
https://kaoh.github.io/globalplatform/
Other
72 stars 30 forks source link

Cleanup warnings for deprecated declarations when building globalplatform #55

Closed spaikmos closed 2 years ago

spaikmos commented 2 years ago

There are many warnings for deprecated declarations when building globalplatform:

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:155:18: warning: 'CMAC_CTX_new' is deprecated [-Wdeprecated-declarations]
        CMAC_CTX *ctx = CMAC_CTX_new();
                        ^

/usr/local/opt/openssl@3/include/openssl/cmac.h:32:1: note: 'CMAC_CTX_new' has been explicitly marked deprecated here
OSSL_DEPRECATEDIN_3_0 CMAC_CTX *CMAC_CTX_new(void);
^

/usr/local/opt/openssl@3/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
#   define OSSL_DEPRECATEDIN_3_0                OSSL_DEPRECATED(3.0)
                                                ^

/usr/local/opt/openssl@3/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
#     define OSSL_DEPRECATED(since) __attribute__((deprecated))
                                                   ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:158:11: warning: 'CMAC_Init' is deprecated [-Wdeprecated-declarations]
        result = CMAC_Init(ctx, sMacKey, keyLength, keyLength == 16 ? EVP_aes_128_cbc() :

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:168:12: warning: 'CMAC_Update' is deprecated [-Wdeprecated-declarations]
                result = CMAC_Update(ctx, chainingValue, 16);
                         ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:173:11: warning: 'CMAC_Update' is deprecated [-Wdeprecated-declarations]
        result = CMAC_Update(ctx, message, messageLength);
                 ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:179:11: warning: 'CMAC_Final' is deprecated [-Wdeprecated-declarations]
        result = CMAC_Final(ctx, mac, &outl);

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:185:2: warning: 'CMAC_CTX_free' is deprecated [-Wdeprecated-declarations]
        CMAC_CTX_free(ctx);
        ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:999:18: warning: 'CMAC_CTX_new' is deprecated [-Wdeprecated-declarations]
        CMAC_CTX *ctx = CMAC_CTX_new();
                        ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:1002:11: warning: 'CMAC_Init' is deprecated [-Wdeprecated-declarations]
        result = CMAC_Init(ctx, key, keyLength,
                 ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:1008:11: warning: 'CMAC_Update' is deprecated [-Wdeprecated-declarations]
        result = CMAC_Update(ctx, message, messageLength);
                 ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:1014:11: warning: 'CMAC_Final' is deprecated [-Wdeprecated-declarations]
        result = CMAC_Final(ctx, mac, &outl);
                 ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:1020:2: warning: 'CMAC_CTX_free' is deprecated [-Wdeprecated-declarations]
        CMAC_CTX_free(ctx);
        ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:2036:8: warning: 'EVP_PKEY_get1_RSA' is deprecated [-Wdeprecated-declarations]
        rsa = EVP_PKEY_get1_RSA(key);
              ^

/Users/spaikmos/src/globalplatform/globalplatform/src/crypto.c:2046:2: warning: 'RSA_get0_key' is deprecated [-Wdeprecated-declarations]
        RSA_get0_key(rsa, &n, &e, NULL);
        ^

The CMAC_xxx functions should be updated to use the EVP_MAC_xxx versions.