Skip to content

Commit

Permalink
(conan-io#11439) openssl: Fix option no_md2
Browse files Browse the repository at this point in the history
md2 has been disabled in openssl since openssl.git commit 4e9de7aa3a12
which is from 2009. It must be explicitly enabled with enable-md2.
  • Loading branch information
tsondergaard authored and AndreyMlashkin committed Jul 29, 2022
1 parent 6998220 commit 1a221ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion recipes/openssl/1.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class OpenSSLConan(ConanFile):
}
default_options = {key: False for key in options.keys()}
default_options["fPIC"] = True
default_options["no_md2"] = True
default_options["openssldir"] = None

_env_build = None
Expand Down Expand Up @@ -517,6 +518,9 @@ def _configure_args(self):
args.append("-DOPENSSL_CAPIENG_DIALOG=1")
else:
args.append("-fPIC" if self.options.get_safe("fPIC", True) else "no-pic")

args.append("no-md2" if self.options.get_safe("no_md2", True) else "enable-md2")

if self.settings.os == "Neutrino":
args.append("no-asm -lsocket -latomic")
if self._is_clangcl:
Expand Down Expand Up @@ -547,7 +551,7 @@ def _configure_args(self):

for option_name in self.options.values.fields:
activated = getattr(self.options, option_name)
if activated and option_name not in ["fPIC", "openssldir", "capieng_dialog", "enable_capieng"]:
if activated and option_name not in ["fPIC", "openssldir", "capieng_dialog", "enable_capieng", "no_md2"]:
self.output.info("activated option: %s" % option_name)
args.append(option_name.replace("_", "-"))
return args
Expand Down
4 changes: 3 additions & 1 deletion recipes/openssl/3.x.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class OpenSSLConan(ConanFile):
}
default_options = {key: False for key in options.keys()}
default_options["fPIC"] = True
default_options["no_md2"] = True
default_options["openssldir"] = None

@property
Expand Down Expand Up @@ -406,6 +407,7 @@ def _configure_args(self):
args.append("-fPIC" if self.options.get_safe("fPIC", True) else "no-pic")

args.append("no-fips" if self.options.get_safe("no_fips", True) else "enable-fips")
args.append("no-md2" if self.options.get_safe("no_md2", True) else "enable-md2")

if self.settings.os == "Neutrino":
args.append("no-asm -lsocket -latomic")
Expand Down Expand Up @@ -434,7 +436,7 @@ def _configure_args(self):
])

for option_name in self.options.values.fields:
if self.options.get_safe(option_name, False) and option_name not in ("shared", "fPIC", "openssldir", "capieng_dialog", "enable_capieng", "zlib", "no_fips"):
if self.options.get_safe(option_name, False) and option_name not in ("shared", "fPIC", "openssldir", "capieng_dialog", "enable_capieng", "zlib", "no_fips", "no_md2"):
self.output.info(f"Activated option: {option_name}")
args.append(option_name.replace("_", "-"))
return args
Expand Down

0 comments on commit 1a221ab

Please sign in to comment.