| 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # We support global configuration flags that are set via command line. |
| 4 | # These flags enable Providers and Tests to determine how to behave |
| 5 | # based on the environment. |
| 6 | |
| 7 | # If S2N is operating in FIPS mode |
| 8 | S2N_FIPS_MODE = "s2n_fips_mode" |
| 9 | |
| 10 | # The version of provider being used |
| 11 | # (set from the S2N_LIBCRYPTO env var, which is how the original integration test works) |
| 12 | S2N_PROVIDER_VERSION = "s2n_provider_version" |
| 13 | |
| 14 | _flags = {} |
| 15 | |
| 16 | |
| 17 | def get_flag(name, default=None): |
| 18 | """Return the value of a flag""" |
| 19 | return _flags.get(name, default) |
| 20 | |
| 21 | |
| 22 | def set_flag(name, value): |
| 23 | """Set the value of a flag""" |
| 24 | _flags[name] = value |