rename MIN() macro
authorGerd Hoffmann <kraxel@redhat.com>
Tue, 7 Dec 2021 09:22:38 +0000 (10:22 +0100)
committerPauli <ppzgs1@gmail.com>
Wed, 8 Dec 2021 11:02:59 +0000 (22:02 +1100)
MIN is a rather generic name and results in a name clash when trying to
port tianocore over to openssl 3.0.  Use the usual ossl prefix and
rename the macro to ossl_min() to solve this.

CLA: trivial

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17219)

providers/implementations/kdfs/kbkdf.c

index a81cc6e0c0d666a2cfdcff70243145b182ad96b0..22fc7b86adf365a0222b5a025398132f4a0739fd 100644 (file)
@@ -46,7 +46,7 @@
 
 #include "e_os.h"
 
-#define MIN(a, b) ((a) < (b)) ? (a) : (b)
+#define ossl_min(a, b) ((a) < (b)) ? (a) : (b)
 
 typedef enum {
     COUNTER = 0,
@@ -197,7 +197,7 @@ static int derive(EVP_MAC_CTX *ctx_init, kbkdf_mode mode, unsigned char *iv,
             goto done;
 
         to_write = ko_len - written;
-        memcpy(ko + written, k_i, MIN(to_write, h));
+        memcpy(ko + written, k_i, ossl_min(to_write, h));
         written += h;
 
         k_i_len = h;