Skip to content

Commit

Permalink
feat: add openssl module
Browse files Browse the repository at this point in the history
Resolves: RHEL-76323
  • Loading branch information
pvalena committed Feb 12, 2025
1 parent ad4549b commit 89a2840
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .distro/dracut.spec
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/99busybox
%{dracutlibdir}/modules.d/99memstrack
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99openssl
%{dracutlibdir}/modules.d/99shutdown
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%dir %{_sharedstatedir}/initramfs
Expand Down Expand Up @@ -438,6 +439,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%changelog
* Wed Jan 29 2025 Pavel Valena <[email protected]> - 105-1
- build: upgrade to dracut 105
- feat: add openssl module

* Mon Sep 16 2024 Pavel Valena <[email protected]> - 103-1
- Update to dracut 103.
Expand Down
19 changes: 19 additions & 0 deletions modules.d/99openssl/module-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

check() {
require_binaries openssl || return 1

return 255
}

install() {

inst_simple "$moddir"/openssl-check.sh "/lib/openssl-check.sh"

inst_multiple -o \
/usr/bin/openssl \
/etc/pki/tls/openssl.cnf \
/etc/pki/tls/openssl.d/* \
/etc/crypto-policies/back-ends/opensslcnf.config \
/usr/lib64/ossl-modules/*.so
}
29 changes: 29 additions & 0 deletions modules.d/99openssl/openssl-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

eok () {

{
[ "$1" -eq 0 ] && echo OK || echo FAIL

echo

} 2>/dev/null
}

echo

set -x

openssl list -providers

eok "$?"

#openssl s_client -connect “$dns_server_ip:$dns_server_port” -servername “$dns_server_name” </dev/null

#openssl s_client -connect “$test_hostname:$test_port” </dev/null

#openssl genpkey -algorithm rsa -pkeyopt rsa_keygen_bits:2048 -out localhost.key

#openssl req -x509 -new -key localhost.key -subj /CN=localhost -days 365 -addext "subjectAltName = DNS:localhost" -out localhost.crt

#openssl s_server -cert localhost.crt -key localhost.key -port “$test_port”

0 comments on commit 89a2840

Please sign in to comment.