diff options
-rw-r--r-- | src/lib/libcrypto/evp/e_aes.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/lib/libcrypto/evp/e_aes.c b/src/lib/libcrypto/evp/e_aes.c index 65dd18f477..e6bba2b952 100644 --- a/src/lib/libcrypto/evp/e_aes.c +++ b/src/lib/libcrypto/evp/e_aes.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: e_aes.c,v 1.46 2022/08/04 08:06:48 jsing Exp $ */ | 1 | /* $OpenBSD: e_aes.c,v 1.47 2022/09/06 06:38:26 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -1868,8 +1868,6 @@ aes_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | |||
1868 | return 1; | 1868 | return 1; |
1869 | } | 1869 | } |
1870 | 1870 | ||
1871 | #define aes_xts_cleanup NULL | ||
1872 | |||
1873 | #define XTS_FLAGS \ | 1871 | #define XTS_FLAGS \ |
1874 | ( EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_CUSTOM_IV | \ | 1872 | ( EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_CUSTOM_IV | \ |
1875 | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT | EVP_CIPH_CUSTOM_COPY ) | 1873 | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT | EVP_CIPH_CUSTOM_COPY ) |
@@ -1884,7 +1882,7 @@ static const EVP_CIPHER aesni_128_xts = { | |||
1884 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, | 1882 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, |
1885 | .init = aesni_xts_init_key, | 1883 | .init = aesni_xts_init_key, |
1886 | .do_cipher = aes_xts_cipher, | 1884 | .do_cipher = aes_xts_cipher, |
1887 | .cleanup = aes_xts_cleanup, | 1885 | .cleanup = NULL, |
1888 | .ctx_size = sizeof(EVP_AES_XTS_CTX), | 1886 | .ctx_size = sizeof(EVP_AES_XTS_CTX), |
1889 | .ctrl = aes_xts_ctrl, | 1887 | .ctrl = aes_xts_ctrl, |
1890 | }; | 1888 | }; |
@@ -1898,7 +1896,7 @@ static const EVP_CIPHER aes_128_xts = { | |||
1898 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, | 1896 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, |
1899 | .init = aes_xts_init_key, | 1897 | .init = aes_xts_init_key, |
1900 | .do_cipher = aes_xts_cipher, | 1898 | .do_cipher = aes_xts_cipher, |
1901 | .cleanup = aes_xts_cleanup, | 1899 | .cleanup = NULL, |
1902 | .ctx_size = sizeof(EVP_AES_XTS_CTX), | 1900 | .ctx_size = sizeof(EVP_AES_XTS_CTX), |
1903 | .ctrl = aes_xts_ctrl, | 1901 | .ctrl = aes_xts_ctrl, |
1904 | }; | 1902 | }; |
@@ -1922,7 +1920,7 @@ static const EVP_CIPHER aesni_256_xts = { | |||
1922 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, | 1920 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, |
1923 | .init = aesni_xts_init_key, | 1921 | .init = aesni_xts_init_key, |
1924 | .do_cipher = aes_xts_cipher, | 1922 | .do_cipher = aes_xts_cipher, |
1925 | .cleanup = aes_xts_cleanup, | 1923 | .cleanup = NULL, |
1926 | .ctx_size = sizeof(EVP_AES_XTS_CTX), | 1924 | .ctx_size = sizeof(EVP_AES_XTS_CTX), |
1927 | .ctrl = aes_xts_ctrl, | 1925 | .ctrl = aes_xts_ctrl, |
1928 | }; | 1926 | }; |
@@ -1936,7 +1934,7 @@ static const EVP_CIPHER aes_256_xts = { | |||
1936 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, | 1934 | .flags = XTS_FLAGS | EVP_CIPH_XTS_MODE, |
1937 | .init = aes_xts_init_key, | 1935 | .init = aes_xts_init_key, |
1938 | .do_cipher = aes_xts_cipher, | 1936 | .do_cipher = aes_xts_cipher, |
1939 | .cleanup = aes_xts_cleanup, | 1937 | .cleanup = NULL, |
1940 | .ctx_size = sizeof(EVP_AES_XTS_CTX), | 1938 | .ctx_size = sizeof(EVP_AES_XTS_CTX), |
1941 | .ctrl = aes_xts_ctrl, | 1939 | .ctrl = aes_xts_ctrl, |
1942 | }; | 1940 | }; |
@@ -2109,9 +2107,6 @@ aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | |||
2109 | 2107 | ||
2110 | } | 2108 | } |
2111 | 2109 | ||
2112 | #define aes_ccm_cleanup NULL | ||
2113 | |||
2114 | |||
2115 | #ifdef AESNI_CAPABLE | 2110 | #ifdef AESNI_CAPABLE |
2116 | static const EVP_CIPHER aesni_128_ccm = { | 2111 | static const EVP_CIPHER aesni_128_ccm = { |
2117 | .nid = NID_aes_128_ccm, | 2112 | .nid = NID_aes_128_ccm, |
@@ -2121,7 +2116,7 @@ static const EVP_CIPHER aesni_128_ccm = { | |||
2121 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, | 2116 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, |
2122 | .init = aesni_ccm_init_key, | 2117 | .init = aesni_ccm_init_key, |
2123 | .do_cipher = aes_ccm_cipher, | 2118 | .do_cipher = aes_ccm_cipher, |
2124 | .cleanup = aes_ccm_cleanup, | 2119 | .cleanup = NULL, |
2125 | .ctx_size = sizeof(EVP_AES_CCM_CTX), | 2120 | .ctx_size = sizeof(EVP_AES_CCM_CTX), |
2126 | .ctrl = aes_ccm_ctrl, | 2121 | .ctrl = aes_ccm_ctrl, |
2127 | }; | 2122 | }; |
@@ -2135,7 +2130,7 @@ static const EVP_CIPHER aes_128_ccm = { | |||
2135 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, | 2130 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, |
2136 | .init = aes_ccm_init_key, | 2131 | .init = aes_ccm_init_key, |
2137 | .do_cipher = aes_ccm_cipher, | 2132 | .do_cipher = aes_ccm_cipher, |
2138 | .cleanup = aes_ccm_cleanup, | 2133 | .cleanup = NULL, |
2139 | .ctx_size = sizeof(EVP_AES_CCM_CTX), | 2134 | .ctx_size = sizeof(EVP_AES_CCM_CTX), |
2140 | .ctrl = aes_ccm_ctrl, | 2135 | .ctrl = aes_ccm_ctrl, |
2141 | }; | 2136 | }; |
@@ -2159,7 +2154,7 @@ static const EVP_CIPHER aesni_192_ccm = { | |||
2159 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, | 2154 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, |
2160 | .init = aesni_ccm_init_key, | 2155 | .init = aesni_ccm_init_key, |
2161 | .do_cipher = aes_ccm_cipher, | 2156 | .do_cipher = aes_ccm_cipher, |
2162 | .cleanup = aes_ccm_cleanup, | 2157 | .cleanup = NULL, |
2163 | .ctx_size = sizeof(EVP_AES_CCM_CTX), | 2158 | .ctx_size = sizeof(EVP_AES_CCM_CTX), |
2164 | .ctrl = aes_ccm_ctrl, | 2159 | .ctrl = aes_ccm_ctrl, |
2165 | }; | 2160 | }; |
@@ -2173,7 +2168,7 @@ static const EVP_CIPHER aes_192_ccm = { | |||
2173 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, | 2168 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, |
2174 | .init = aes_ccm_init_key, | 2169 | .init = aes_ccm_init_key, |
2175 | .do_cipher = aes_ccm_cipher, | 2170 | .do_cipher = aes_ccm_cipher, |
2176 | .cleanup = aes_ccm_cleanup, | 2171 | .cleanup = NULL, |
2177 | .ctx_size = sizeof(EVP_AES_CCM_CTX), | 2172 | .ctx_size = sizeof(EVP_AES_CCM_CTX), |
2178 | .ctrl = aes_ccm_ctrl, | 2173 | .ctrl = aes_ccm_ctrl, |
2179 | }; | 2174 | }; |
@@ -2197,7 +2192,7 @@ static const EVP_CIPHER aesni_256_ccm = { | |||
2197 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, | 2192 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, |
2198 | .init = aesni_ccm_init_key, | 2193 | .init = aesni_ccm_init_key, |
2199 | .do_cipher = aes_ccm_cipher, | 2194 | .do_cipher = aes_ccm_cipher, |
2200 | .cleanup = aes_ccm_cleanup, | 2195 | .cleanup = NULL, |
2201 | .ctx_size = sizeof(EVP_AES_CCM_CTX), | 2196 | .ctx_size = sizeof(EVP_AES_CCM_CTX), |
2202 | .ctrl = aes_ccm_ctrl, | 2197 | .ctrl = aes_ccm_ctrl, |
2203 | }; | 2198 | }; |
@@ -2211,7 +2206,7 @@ static const EVP_CIPHER aes_256_ccm = { | |||
2211 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, | 2206 | .flags = CUSTOM_FLAGS | EVP_CIPH_CCM_MODE, |
2212 | .init = aes_ccm_init_key, | 2207 | .init = aes_ccm_init_key, |
2213 | .do_cipher = aes_ccm_cipher, | 2208 | .do_cipher = aes_ccm_cipher, |
2214 | .cleanup = aes_ccm_cleanup, | 2209 | .cleanup = NULL, |
2215 | .ctx_size = sizeof(EVP_AES_CCM_CTX), | 2210 | .ctx_size = sizeof(EVP_AES_CCM_CTX), |
2216 | .ctrl = aes_ccm_ctrl, | 2211 | .ctrl = aes_ccm_ctrl, |
2217 | }; | 2212 | }; |