Skip to content

Commit

Permalink
feat: add openssl module
Browse files Browse the repository at this point in the history
  • Loading branch information
pvalena committed Jan 20, 2025
1 parent 8b2e321 commit ba5d1f1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .distro/dracut.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Name: dracut
Version: 103
Release: 1%{?dist}
Release: 3%{?dist}

Summary: Initramfs generator using udev

Expand Down Expand Up @@ -352,6 +352,7 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{dracutlibdir}/modules.d/99base
%{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 @@ -431,6 +432,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install

%changelog
* Mon Jan 20 2025 Pavel Valena <[email protected]> - 103-3
- 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
}
27 changes: 27 additions & 0 deletions modules.d/99openssl/openssl-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

eok () {

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

Check warning

Code scanning / shellcheck

SC2086 Warning

Double quote to prevent globbing and word splitting.

echo

} 2>/dev/null
}

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 ba5d1f1

Please sign in to comment.