openssl: External symbols that don't follow the naming convention

Running a script over the .a files produced by a build reveals all defined global symbols that aren’t in the .num files. This majority of these will be false positives or historical. The script will also produce different output depending on the configuration options.

For a shared build, none of these should be exposed because the exported symbols are set. For a non-shared build, things are different.

#!/bin/sh

SRCDIR="."
OBJDIR="."

for l in crypto ssl
do
    cut -f1 -d\  "$SRCDIR/util/lib$l.num" >/tmp/$$
    nm -g --defined-only "$OBJDIR/lib$l.a" | grep -Fv -f /tmp/$$ >$l.symbols
    rm -f /tmp/$$
done

edit: long list of functions deleted in preference of following list which includes only new functions since 1.1.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 44 (44 by maintainers)

Commits related to this issue

Most upvoted comments

Hit them all. They should all be renamed. We should be as clean as possible for namespace usage. And these things are easy to review …

I suppose except maybe some of the libssl symbols the remaining symbols were there in 1.1.1 as well. And those new symbols in libssl do not introduce any new prefix as functions with tls_, tls1_, ssl_, ssl3_ were there definitely in 1.1.1 already. So IMO I think it is good enough. If anybody reports a real conflict with an existing application we can always consider further renames later.

I have removed the following ASN1 related items from the list as they should not be a problem

The i2x and x2i pattern is already established, it would be very surprising to see that suddenly change, or worse, to have some prefixed with ossl_ and others not. So, good move.

I’m looking for a third opinion. I don’t much mind either way, you don’t want them. Will anyone else weigh in? If not I’ll close that PR unmerged.