Преглед на файлове

Fix compiler warning

```
pre_gen/tomcrypt_amalgam.c: In function ‘pkcs_1_oaep_encode’:
pre_gen/tomcrypt_amalgam.c:64485:18: warning: ‘DB’ may be used uninitialized [-Wmaybe-uninitialized]
64485 |       if ((err = hash_memory(lparam_hash_used, DB, 0, DB, &x)) != CRYPT_OK) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pre_gen/tomcrypt_amalgam.c:22613:5: note: by argument 2 of type ‘const unsigned char *’ to ‘hash_memory’ declared here
22613 | int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen)
      |     ^~~~~~~~~~~
```

Use `out` instead of `DB`, since `out` is `LTC_ARGCHK`'ed.

Signed-off-by: Steffen Jaeckel <[email protected]>
Steffen Jaeckel преди 7 месеца
родител
ревизия
00f662da80
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      src/pk/pkcs1/pkcs_1_oaep_encode.c

+ 2 - 2
src/pk/pkcs1/pkcs_1_oaep_encode.c

@@ -89,8 +89,8 @@ int pkcs_1_oaep_encode(const unsigned char *msg,    unsigned long msglen,
          goto LBL_ERR;
          goto LBL_ERR;
       }
       }
    } else {
    } else {
-      /* can't pass hash_memory a NULL so use DB with zero length */
-      if ((err = hash_memory(lparam_hash_used, DB, 0, DB, &x)) != CRYPT_OK) {
+      /* can't pass hash_memory a NULL so use `out` with zero length */
+      if ((err = hash_memory(lparam_hash_used, out, 0, DB, &x)) != CRYPT_OK) {
          goto LBL_ERR;
          goto LBL_ERR;
       }
       }
    }
    }