Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apisupport and use for low-level aes & rsa #632

Closed
wants to merge 4 commits into from
Closed

Conversation

gperciva
Copy link
Member

No description provided.

- One item per line
- If there's more than one item in the list, start on the line after
  the assignment "=".

This has no effect on the build system, but it makes future changes to
lists much easier to see.

Removing the empty lines before the LIBTARSNAP_A+= lines clarifies the
file, in that there's a single "paragraph" for each library, rather than
one multi-line "paragraph" followed by a one-line "paragraph".
OpenSSL 3.0 marked many functions as "deprecated" [1].  In tarsnap,
those functions are used in:
    lib/crypto/crypto_compat.c
    lib/crypto/crypto_keys.c
    lib/crypto/crypto_keys_subr.c
    lib/crypto/crypto_rsa.c
    libcperciva/crypto/crypto_aes.c

Those files are now being compiled into a new libtarsnap_crypto.a, which
uses the appropriate compiler flags.

[1] List of relevant deprecated OpenSSL 3.0 functions:
    AES_encrypt
    AES_set_encrypt_key
    RSAPublicKey_dup
    RSA_bits
    RSA_free
    RSA_generate_key_ex
    RSA_get0_crt_params
    RSA_get0_factors
    RSA_get0_key
    RSA_new
    RSA_private_decrypt
    RSA_private_encrypt
    RSA_public_decrypt
    RSA_public_encrypt
    RSA_set0_crt_params
    RSA_set0_factors
    RSA_set0_key
    RSA_size
@gperciva
Copy link
Member Author

This includes #631, which I recommend merging before looking at this too seriously.

... huh, clang-10 has some linking problem? Hmm.

LIBTARSNAP_A+= lib/libtarsnap_arm_sha256.a

lib_libtarsnap_crypto_a_SOURCES= \
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm really not certain what to call this library.

I originally went with libtarsnap_crypto_aes (as we did in scrypt Tarsnap/scrypt#386), but then I discovered that 4 files in lib/crypto/ also needed the same compiler flag.

I can see a few possibilities:

  1. put only the required files into a generic libtarsnap_crypto.a (current).
  2. put everything in lib/crypto/ into a libtarsnap_crypto.a. That would mean that some files might be compiled with fewer warnings than is strictly necessary, but that's a rather theoretical concern.
  3. add a libtarsnap_crypto_aes.a which only contains crypto_aes (as with scrypt); and add a libtarsnap_openssl_compat.a (or some name like that) which has the other ones.

@gperciva
Copy link
Member Author

This needs more revision; I'll bring it back later.

@gperciva gperciva closed this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant