Skip to content

Commit

Permalink
Merge branch 'hans/crypto/remove_engine_block_3.0' into maint
Browse files Browse the repository at this point in the history
OTP-18832
  • Loading branch information
sverker committed Oct 30, 2023
2 parents b00f416 + 56b289b commit 045e704
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
11 changes: 11 additions & 0 deletions lib/crypto/c_src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,17 @@ endif
# $(V_at)$(INSTALL_DIR) $(OBJDIR)
# $(V_CC) -c -o $@ $(ALL_CFLAGS) $(CRYPTO_NO_DEPRECATE_WARN) $<

# ---- Hard-coded removal of deprecated warning for ENGINE function calls
$(OBJDIR)/engine$(TYPEMARKER).o: engine.c
$(V_at)$(INSTALL_DIR) $(OBJDIR)
$(V_CC) -c -o $@ $(ALL_CFLAGS) $(CRYPTO_NO_DEPRECATE_WARN) $<

$(OBJDIR)/pkey$(TYPEMARKER).o: pkey.c
$(V_at)$(INSTALL_DIR) $(OBJDIR)
$(V_CC) -c -o $@ $(ALL_CFLAGS) $(CRYPTO_NO_DEPRECATE_WARN) $<

# ---- End of Hard-coded removal of deprecated warning for ENGINE function calls

$(OBJDIR)/%$(TYPEMARKER).o: %.c
$(V_at)$(INSTALL_DIR) $(OBJDIR)
$(V_CC) -MMD -c -o $@ $(ALL_CFLAGS) $<
Expand Down
6 changes: 3 additions & 3 deletions lib/crypto/c_src/dss.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int get_dss_public_key(ErlNifEnv* env, ERL_NIF_TERM key, EVP_PKEY **pkey)
int dss_privkey_to_pubkey(ErlNifEnv* env, EVP_PKEY *pkey, ERL_NIF_TERM *ret)
// HAS_3_0_API
{
ERL_NIF_TERM result[5];
ERL_NIF_TERM result[4];
BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub = NULL;

if (
Expand All @@ -119,8 +119,8 @@ int dss_privkey_to_pubkey(ErlNifEnv* env, EVP_PKEY *pkey, ERL_NIF_TERM *ret)
|| !EVP_PKEY_get_bn_param(pkey, "pub", &pub)
|| ((result[0] = bin_from_bn(env, p)) == atom_error)
|| ((result[1] = bin_from_bn(env, q)) == atom_error)
|| ((result[1] = bin_from_bn(env, g)) == atom_error)
|| ((result[1] = bin_from_bn(env, pub)) == atom_error)
|| ((result[2] = bin_from_bn(env, g)) == atom_error)
|| ((result[3] = bin_from_bn(env, pub)) == atom_error)
)
goto err;

Expand Down
4 changes: 1 addition & 3 deletions lib/crypto/c_src/openssl_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,7 @@
/* If OPENSSL_NO_EC is set, there will be an error in ec.h included from engine.h
So if EC is disabled, you can't use Engine either....
*/
#if !defined(OPENSSL_NO_ENGINE) && \
!defined(HAS_3_0_API)
/* Disable FIPS for 3.0 temporaryly until the support is added (might core dump) */
#if !defined(OPENSSL_NO_ENGINE)
# define HAS_ENGINE_SUPPORT
#endif
#endif
Expand Down

0 comments on commit 045e704

Please sign in to comment.