Skip to content

Commit

Permalink
qweqwe
Browse files Browse the repository at this point in the history
  • Loading branch information
dkostic committed Oct 18, 2024
1 parent ec33012 commit ef9fc81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion crypto/fipsmodule/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ int BORINGSSL_integrity_test(void) {
assert_within(start, function_entry_ptr(EVP_AEAD_CTX_seal), "EVP_AEAD_CTX_seal", end);
assert_not_within(start, function_entry_ptr(OPENSSL_cleanse), "OPENSSL_cleanse", end);
assert_not_within(start, function_entry_ptr(CRYPTO_chacha_20), "CRYPTO_chacha_20", end);
assert_not_within(start, function_entry_ptr(get_asdasd), "get_asdasd", end);
#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64)
assert_not_within(start, OPENSSL_ia32cap_P, "OPENSSL_ia32cap_P", end);
#elif defined(OPENSSL_AARCH64)
Expand Down
7 changes: 2 additions & 5 deletions crypto/fipsmodule/fips_shared_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

#include <string.h>

#include "fips_support.h"

#if defined(BORINGSSL_FIPS)
// BORINGSSL_bcm_text_hash is is default hash value for the FIPS integrity check
// that must be replaced with the real value during the build process. This
// value need only be distinct, i.e. so that we can safely search-and-replace it
// in an object file.
__attribute__((section(".rodata.bcm_support")))
const uint8_t BORINGSSL_bcm_text_hash[32] = {
volatile uint8_t asdasd[32] = {
0xae, 0x2c, 0xea, 0x2a, 0xbd, 0xa6, 0xf3, 0xec, 0x97, 0x7f, 0x9b,
0xf6, 0x94, 0x9a, 0xfc, 0x83, 0x68, 0x27, 0xcb, 0xa0, 0xa0, 0x9f,
0x6b, 0x6f, 0xde, 0x52, 0xcd, 0xe2, 0xcd, 0xff, 0x31, 0x80,
};

__attribute__((section(".text.bcm_support")))
void get_asdasd(uint8_t *out) { memcpy(out, BORINGSSL_bcm_text_hash, 32); }
void get_asdasd(uint8_t *out) { for (int i = 0; i < 32; i++) out[i] = asdasd[i]; }
#endif // FIPS && SHARED_LIBRARY

0 comments on commit ef9fc81

Please sign in to comment.