]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
openssl-util: use assert() if no side effect 24651/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Sep 2022 08:03:01 +0000 (17:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Sep 2022 08:03:34 +0000 (17:03 +0900)
src/shared/openssl-util.c

index 39019354349c53ceaea3b66f18ecb2a0453e8612..e4ee09102cdae0b35c914208a05ade3f419e78ee 100644 (file)
@@ -86,8 +86,8 @@ int rsa_pkey_to_suitable_key_size(
         size_t suitable_key_size;
         int bits;
 
-        assert_se(pkey);
-        assert_se(ret_suitable_key_size);
+        assert(pkey);
+        assert(ret_suitable_key_size);
 
         /* Analyzes the specified public key and that it is RSA. If so, will return a suitable size for a
          * disk encryption key to encrypt with RSA for use in PKCS#11 security token schemes. */
@@ -148,7 +148,7 @@ int pubkey_fingerprint(EVP_PKEY *pk, const EVP_MD *md, void **ret, size_t *ret_s
                 return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to run %s context.", EVP_MD_name(md));
 
         msz = EVP_MD_size(md);
-        assert_se(msz > 0);
+        assert(msz > 0);
 
         h = malloc(msz);
         if (!h)
@@ -158,7 +158,7 @@ int pubkey_fingerprint(EVP_PKEY *pk, const EVP_MD *md, void **ret, size_t *ret_s
         if (EVP_DigestFinal_ex(m, h, &umsz) != 1)
                 return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Failed to finalize hash context.");
 
-        assert_se(umsz == (unsigned) msz);
+        assert(umsz == (unsigned) msz);
 
         *ret = TAKE_PTR(h);
         *ret_size = msz;