Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/openssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-01-22 16:00:21 +0300
committerRichard Levitte <levitte@openssl.org>2020-01-23 19:17:47 +0300
commitc24937d5e71a990763f227be229ad41aab44728f (patch)
tree045fff71c29ad7e98c4f57c2d8d4c94ae2d4e372 /include/internal
parenta88aef32c902b79261c53a16546f4adbf6b3a617 (diff)
Add internal maxsize macros
We've started to see "magic" numbers being used for certain sizes, such as algorithm names and property query strings. This change takes care of the few items where buffers for algorithm names and property query strings are used. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10928)
Diffstat (limited to 'include/internal')
-rw-r--r--include/internal/sizes.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/internal/sizes.h b/include/internal/sizes.h
new file mode 100644
index 0000000000..fab5cbdec7
--- /dev/null
+++ b/include/internal/sizes.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#ifndef OSSL_INTERNAL_SIZES_H
+# define OSSL_INTERNAL_SIZES_H
+
+/*
+ * Max sizes used to allocate buffers with a fixed sizes, for example for
+ * stack allocations, structure fields, ...
+ */
+# define OSSL_MAX_NAME_SIZE 50 /* Algorithm name */
+# define OSSL_MAX_PROPQUERY_SIZE 256 /* Property query strings */
+
+#endif