Provide additional defines for EVP AEAD.
authorjsing <jsing@openbsd.org>
Sat, 27 Aug 2022 09:10:10 +0000 (09:10 +0000)
committerjsing <jsing@openbsd.org>
Sat, 27 Aug 2022 09:10:10 +0000 (09:10 +0000)
While these will not be used by LibreSSL, they are used by some QUIC
implementations (such as ngtcp2).

ok tb@

lib/libcrypto/evp/evp.h

index 0b7fc08..73d2b16 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: evp.h,v 1.104 2022/08/20 19:22:28 jsing Exp $ */
+/* $OpenBSD: evp.h,v 1.105 2022/08/27 09:10:10 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -282,6 +282,23 @@ extern "C" {
 /* Length of tag for TLS */
 #define EVP_GCM_TLS_TAG_LEN                            16
 
+#if defined(LIBRESSL_NEXT_API) || defined(LIBRESSL_INTERNAL)
+/* CCM TLS constants */
+/* Length of fixed part of IV derived from PRF */
+#define EVP_CCM_TLS_FIXED_IV_LEN                       4
+/* Length of explicit part of IV part of TLS records */
+#define EVP_CCM_TLS_EXPLICIT_IV_LEN                    8
+/* Total length of CCM IV length for TLS */
+#define EVP_CCM_TLS_IV_LEN                             12
+/* Length of tag for TLS */
+#define EVP_CCM_TLS_TAG_LEN                            16
+/* Length of CCM8 tag for TLS */
+#define EVP_CCM8_TLS_TAG_LEN                           8
+
+/* Length of tag for TLS */
+#define EVP_CHACHAPOLY_TLS_TAG_LEN                     16
+#endif
+
 typedef struct evp_cipher_info_st {
        const EVP_CIPHER *cipher;
        unsigned char iv[EVP_MAX_IV_LENGTH];