Skip to content

Use a prefix different from GFp_ so *ring* 0.17.x and an older version of *ring* can coexist. - #1267

Merged
briansmith merged 6 commits into
mainfrom
b/symbols-prefixed-2
May 3, 2021
Merged

briansmith merged 6 commits into
mainfrom
b/symbols-prefixed-2

Conversation

@briansmith

@briansmith briansmith commented May 3, 2021 •

Copy link
Copy Markdown
Owner

See the individual commit messages for details. Future work will automate changing the prefixes as part of the release process.

@codecov

codecov Bot commented May 3, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #1267 (2068246) into main (0e800b8) will increase coverage by 0.27%.
The diff coverage is 88.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1267      +/-   ##
==========================================
+ Coverage   92.86%   93.13%   +0.27%     
==========================================
  Files         116      116              
  Lines       17874    18097     +223     
  Branches      195      195              
==========================================
+ Hits        16598    16855     +257     
+ Misses       1242     1207      -35     
- Partials       34       35       +1     
Impacted Files Coverage Δ
crypto/curve25519/internal.h 100.00% <ø> (ø)
crypto/fipsmodule/aes/aes_nohw.c 0.00% <0.00%> (ø)
crypto/fipsmodule/bn/internal.h 100.00% <ø> (ø)
crypto/fipsmodule/ec/ecp_nistz.c 100.00% <ø> (ø)
crypto/fipsmodule/ec/ecp_nistz.h 100.00% <ø> (ø)
crypto/fipsmodule/ec/util.h 88.88% <ø> (ø)
crypto/limbs/limbs.h 100.00% <ø> (ø)
crypto/limbs/limbs.inl 100.00% <ø> (ø)
include/ring-core/check.h 100.00% <ø> (ø)
src/digest.rs 98.40% <ø> (ø)
... and 64 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e800b8...2068246. Read the comment docs.

briansmith added 3 commits May 2, 2021 20:50
The symbol prefixing infrastructure wasn't merged when it was originally
added to BoringSSL. Import it now so *ring* can start using it.
@briansmith
briansmith force-pushed the b/symbols-prefixed-2 branch 7 times, most recently from 7c9e915 to fbb0cac Compare May 3, 2021 04:11
briansmith added 3 commits May 2, 2021 21:22
Revert the names used in the BoringSSL C/asm code to the names used in
BoringSSL. This substantially reduces the diff between *ring* and
BoringSSL for these files.

Use a variant of BoringSSL's symbol prefixing machinery to semi-
automatically prefix FFI symbols with the `GFp_` prefix. The names aren't
all exactly the same as before, because previously we *replaced* a
symbol's original prefix with the `GFp_` prefix; now we're prepending
`GFp_`. In the future we'll use a different prefix entirely.

This paves the way for using different prefixes for each version so that
multiple versions of *ring* can be linked into an executable at once.
…ything.

"GFp_" isn't in the code at all anymore.
@briansmith
briansmith force-pushed the b/symbols-prefixed-2 branch from fbb0cac to 2068246 Compare May 3, 2021 04:22
@briansmith

Copy link
Copy Markdown
Owner Author

Issue #1268 tracks the remaining related work.

.cfi_push %r14
push %r15
.cfi_push %r15
.cfi_push %r15

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this file by merging the BoringSSL version to make sure they were in sync. The trailing whitespace is from BoringSSL, here and below.

Comment thread crypto/cpu-intel.c
// See https://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family
static uint64_t OPENSSL_xgetbv(uint32_t xcr) {
#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I started this work, I undid the manual prefixing by merging some files from BoringSSL to minimize the difference. This is one of the differences that was unrelated that was a result of that process. I decided to stop building this PR that way because there were too many of these unrelated changes; the work to minimize the diff from BoringSSL is now tracked in #1269.

&gen_block("en");
&gen_block("de");
# Decryption removed in *ring*.
# &gen_block("de");

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't do this then we'd need to prefix the generated decrypt function. But since we don't need/want it, it's better to just delete it.

@briansmith
briansmith merged commit fed04d7 into main May 3, 2021
@briansmith
briansmith deleted the b/symbols-prefixed-2 branch May 3, 2021 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant