mkiiskila closed pull request #1137: mbedtls; expose block cipher alg
inclusion, and cipher modes as syscfg.
URL: https://github.com/apache/mynewt-core/pull/1137
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/crypto/mbedtls/include/mbedtls/config_mynewt.h
b/crypto/mbedtls/include/mbedtls/config_mynewt.h
index fff0fbad92..b1bf4c5a44 100644
--- a/crypto/mbedtls/include/mbedtls/config_mynewt.h
+++ b/crypto/mbedtls/include/mbedtls/config_mynewt.h
@@ -180,6 +180,35 @@ extern "C" {
#undef MBEDTLS_ECP_DP_CURVE25519_ENABLED
#endif
+#if MYNEWT_VAL(MBEDTLS_AES_C) == 0
+#undef MBEDTLS_AES_C
+#endif
+#if MYNEWT_VAL(MBEDTLS_ARC4_C) == 0
+#undef MBEDTLS_ARC4_C
+#endif
+#if MYNEWT_VAL(MBEDTLS_BLOWFISH_C) == 0
+#undef MBEDTLS_BLOWFISH_C
+#endif
+#if MYNEWT_VAL(MBEDTLS_CAMELLIA_C) == 0
+#undef MBEDTLS_CAMELLIA_C
+#endif
+#if MYNEWT_VAL(MBEDTLS_DES_C) == 0
+#undef MBEDTLS_DES_C
+#endif
+
+#if MYNEWT_VAL(MBEDTLS_CIPHER_MODE_CBC) == 0
+#undef MBEDTLS_CIPHER_MODE_CBC
+#endif
+#if MYNEWT_VAL(MBEDTLS_CIPHER_MODE_CFB) == 0
+#undef MBEDTLS_CIPHER_MODE_CBC
+#endif
+#if MYNEWT_VAL(MBEDTLS_CIPHER_MODE_CTR) == 0
+#undef MBEDTLS_CIPHER_MODE_CTR
+#endif
+#if MYNEWT_VAL(MBEDTLS_CCM_C) == 0
+#undef MBEDTLS_CCM_C
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/crypto/mbedtls/syscfg.yml b/crypto/mbedtls/syscfg.yml
index 5aa15c5b2d..11b50b0919 100644
--- a/crypto/mbedtls/syscfg.yml
+++ b/crypto/mbedtls/syscfg.yml
@@ -19,28 +19,51 @@
# Package: crypto/mbedtls
syscfg.defs:
- # Enabled curves
- MBEDTLS_ECP_DP_SECP192R1:
- value: 0
- MBEDTLS_ECP_DP_SECP224R1:
- value: 1
- MBEDTLS_ECP_DP_SECP256R1:
- value: 0
- MBEDTLS_ECP_DP_SECP384R1:
- value: 0
- MBEDTLS_ECP_DP_SECP521R1:
- value: 0
- MBEDTLS_ECP_DP_SECP192K1:
- value: 0
- MBEDTLS_ECP_DP_SECP224K1:
- value: 0
- MBEDTLS_ECP_DP_SECP256K1:
- value: 0
- MBEDTLS_ECP_DP_BP256R1:
- value: 0
- MBEDTLS_ECP_DP_BP384R1:
- value: 0
- MBEDTLS_ECP_DP_BP512R1:
- value: 0
- MBEDTLS_ECP_DP_CURVE25519:
- value: 0
+ # Enabled curves
+ MBEDTLS_ECP_DP_SECP192R1:
+ value: 0
+ MBEDTLS_ECP_DP_SECP224R1:
+ value: 1
+ MBEDTLS_ECP_DP_SECP256R1:
+ value: 0
+ MBEDTLS_ECP_DP_SECP384R1:
+ value: 0
+ MBEDTLS_ECP_DP_SECP521R1:
+ value: 0
+ MBEDTLS_ECP_DP_SECP192K1:
+ value: 0
+ MBEDTLS_ECP_DP_SECP224K1:
+ value: 0
+ MBEDTLS_ECP_DP_SECP256K1:
+ value: 0
+ MBEDTLS_ECP_DP_BP256R1:
+ value: 0
+ MBEDTLS_ECP_DP_BP384R1:
+ value: 0
+ MBEDTLS_ECP_DP_BP512R1:
+ value: 0
+ MBEDTLS_ECP_DP_CURVE25519:
+ value: 0
+
+ # Ciphers
+ MBEDTLS_AES_C:
+ value: 1
+ MBEDTLS_ARC4_C:
+ value: 0
+ MBEDTLS_BLOWFISH_C:
+ value: 0
+ MBEDTLS_CAMELLIA_C:
+ value: 0
+ MBEDTLS_DES_C:
+ description: '3DES'
+ value: 0
+
+ # Cipher modes
+ MBEDTLS_CIPHER_MODE_CBC:
+ value: 0
+ MBEDTLS_CIPHER_MODE_CFB:
+ value: 0
+ MBEDTLS_CIPHER_MODE_CTR:
+ value: 0
+ MBEDTLS_CCM_C:
+ value: 0
diff --git a/crypto/mbedtls/test/syscfg.yml b/crypto/mbedtls/test/syscfg.yml
new file mode 100644
index 0000000000..8e947f5e57
--- /dev/null
+++ b/crypto/mbedtls/test/syscfg.yml
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+syscfg.vals:
+ MBEDTLS_ECP_DP_SECP192R1: 1
+ MBEDTLS_ECP_DP_SECP224R1: 1
+ MBEDTLS_ECP_DP_SECP256R1: 1
+ MBEDTLS_ECP_DP_SECP384R1: 1
+ MBEDTLS_ECP_DP_SECP521R1: 1
+ MBEDTLS_ECP_DP_SECP192K1: 1
+ MBEDTLS_ECP_DP_SECP224K1: 1
+ MBEDTLS_ECP_DP_SECP256K1: 1
+ MBEDTLS_ECP_DP_BP256R1: 1
+ MBEDTLS_ECP_DP_BP384R1: 1
+ MBEDTLS_ECP_DP_BP512R1: 1
+ MBEDTLS_ECP_DP_CURVE25519: 1
+
+ # Ciphers
+ MBEDTLS_AES_C: 1
+ MBEDTLS_ARC4_C: 1
+ MBEDTLS_BLOWFISH_C: 1
+ MBEDTLS_CAMELLIA_C: 1
+ MBEDTLS_DES_C: 1
+
+ # Cipher modes
+ MBEDTLS_CIPHER_MODE_CBC: 1
+ MBEDTLS_CIPHER_MODE_CFB: 1
+ MBEDTLS_CIPHER_MODE_CTR: 1
+ MBEDTLS_CCM_C: 1
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services