From a5a7464fb8fc4bf356b3a8b14699662f54e89bbf Mon Sep 17 00:00:00 2001 From: Banoshi Date: Tue, 11 Jul 2023 11:32:40 +0530 Subject: [PATCH] update ubuntu version to 22.04 --- .github/workflows/build_unittest.yml | 2 +- .github/workflows/odimra_deployment.yml | 2 +- install/Docker/dockerfiles/Dockerfile.accountSession | 2 +- install/Docker/dockerfiles/Dockerfile.aggregation | 2 +- install/Docker/dockerfiles/Dockerfile.api | 2 +- install/Docker/dockerfiles/Dockerfile.compositionService | 2 +- install/Docker/dockerfiles/Dockerfile.cs | 2 +- install/Docker/dockerfiles/Dockerfile.dellplugin | 2 +- install/Docker/dockerfiles/Dockerfile.etcd | 4 ++-- install/Docker/dockerfiles/Dockerfile.events | 2 +- install/Docker/dockerfiles/Dockerfile.fabrics | 2 +- install/Docker/dockerfiles/Dockerfile.grfplugin | 2 +- install/Docker/dockerfiles/Dockerfile.kafka | 6 +++--- install/Docker/dockerfiles/Dockerfile.lenovoplugin | 2 +- install/Docker/dockerfiles/Dockerfile.licenses | 2 +- install/Docker/dockerfiles/Dockerfile.managers | 2 +- install/Docker/dockerfiles/Dockerfile.systems | 2 +- install/Docker/dockerfiles/Dockerfile.task | 2 +- install/Docker/dockerfiles/Dockerfile.telemetry | 2 +- install/Docker/dockerfiles/Dockerfile.update | 2 +- install/Docker/dockerfiles/Dockerfile.urplugin | 2 +- install/Docker/dockerfiles/Dockerfile.zookeeper | 6 +++--- lib-messagebus/datacommunicator/config.go | 4 ++-- lib-utilities/common/crypto.go | 4 ++-- lib-utilities/config/config.go | 4 ++-- odim-controller/odimra/group_vars/all/requirements.yaml | 2 +- plugin-dell/dputilities/utility.go | 4 ++-- plugin-dell/dputilities/utility_test.go | 8 +++++++- plugin-lenovo/lputilities/utility.go | 8 ++++---- plugin-redfish/rfputilities/utility.go | 8 ++++---- plugin-unmanaged-racks/config/config.go | 4 ++-- plugin-unmanaged-racks/utils/enigma.go | 4 ++-- 32 files changed, 55 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build_unittest.yml b/.github/workflows/build_unittest.yml index 2ade777ec..d58ba6b54 100755 --- a/.github/workflows/build_unittest.yml +++ b/.github/workflows/build_unittest.yml @@ -22,7 +22,7 @@ jobs: build: name: Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Set up Go 1.19.5 diff --git a/.github/workflows/odimra_deployment.yml b/.github/workflows/odimra_deployment.yml index b73fe2022..0ec9caadd 100644 --- a/.github/workflows/odimra_deployment.yml +++ b/.github/workflows/odimra_deployment.yml @@ -8,7 +8,7 @@ on: jobs: build: name: Deploy - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 continue-on-error: false steps: - uses: actions/checkout@v2 diff --git a/install/Docker/dockerfiles/Dockerfile.accountSession b/install/Docker/dockerfiles/Dockerfile.accountSession index 0a99f6bf2..101a2be13 100644 --- a/install/Docker/dockerfiles/Dockerfile.accountSession +++ b/install/Docker/dockerfiles/Dockerfile.accountSession @@ -17,7 +17,7 @@ COPY install/Docker/dockerfiles/build/accountSession.sh . RUN ./accountSession.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.aggregation b/install/Docker/dockerfiles/Dockerfile.aggregation index 03d8f51f5..f56088673 100644 --- a/install/Docker/dockerfiles/Dockerfile.aggregation +++ b/install/Docker/dockerfiles/Dockerfile.aggregation @@ -17,7 +17,7 @@ COPY install/Docker/dockerfiles/build/aggregation.sh . RUN ./aggregation.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.api b/install/Docker/dockerfiles/Dockerfile.api index b60d2035a..d7641ebc1 100644 --- a/install/Docker/dockerfiles/Dockerfile.api +++ b/install/Docker/dockerfiles/Dockerfile.api @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/api.sh . RUN ./api.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.compositionService b/install/Docker/dockerfiles/Dockerfile.compositionService index 15ce57d3a..803b74db4 100755 --- a/install/Docker/dockerfiles/Dockerfile.compositionService +++ b/install/Docker/dockerfiles/Dockerfile.compositionService @@ -18,7 +18,7 @@ FROM odim:5.1 as build-stage FROM cs:1.0 as build-stage-cs -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.cs b/install/Docker/dockerfiles/Dockerfile.cs index ff0adc38a..ba73d0468 100755 --- a/install/Docker/dockerfiles/Dockerfile.cs +++ b/install/Docker/dockerfiles/Dockerfile.cs @@ -12,7 +12,7 @@ #License for the specific language governing permissions and limitations # under the License. -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.dellplugin b/install/Docker/dockerfiles/Dockerfile.dellplugin index c170b6601..48628a7aa 100644 --- a/install/Docker/dockerfiles/Dockerfile.dellplugin +++ b/install/Docker/dockerfiles/Dockerfile.dellplugin @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/dellplugin.sh . RUN ./dellplugin.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.etcd b/install/Docker/dockerfiles/Dockerfile.etcd index 1f6e6c4c8..d3221fb51 100644 --- a/install/Docker/dockerfiles/Dockerfile.etcd +++ b/install/Docker/dockerfiles/Dockerfile.etcd @@ -13,12 +13,12 @@ # under the License. # This is Dockerfile to build etcd image -FROM ubuntu:20.04 as etcd-build +FROM ubuntu:22.04 as etcd-build LABEL version="1.0" LABEL ubuntuVersion="18.04" LABEL etcdVersion="3.4.15" -LABEL description="etcd docker image built on top of ubuntu:20.04" +LABEL description="etcd docker image built on top of ubuntu:22.04" # This is the release of etcd to pull in. ENV ETDC_VERSION=3.4.15 diff --git a/install/Docker/dockerfiles/Dockerfile.events b/install/Docker/dockerfiles/Dockerfile.events index 68799771b..34160aed2 100644 --- a/install/Docker/dockerfiles/Dockerfile.events +++ b/install/Docker/dockerfiles/Dockerfile.events @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/events.sh . RUN ./events.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.fabrics b/install/Docker/dockerfiles/Dockerfile.fabrics index 1287018fd..d370253e6 100644 --- a/install/Docker/dockerfiles/Dockerfile.fabrics +++ b/install/Docker/dockerfiles/Dockerfile.fabrics @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/fabrics.sh . RUN ./fabrics.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.grfplugin b/install/Docker/dockerfiles/Dockerfile.grfplugin index b9fbde5e9..ba26d1c53 100644 --- a/install/Docker/dockerfiles/Dockerfile.grfplugin +++ b/install/Docker/dockerfiles/Dockerfile.grfplugin @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/grfplugin.sh . RUN ./grfplugin.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.kafka b/install/Docker/dockerfiles/Dockerfile.kafka index bb51b1a6d..c5e287f7b 100644 --- a/install/Docker/dockerfiles/Dockerfile.kafka +++ b/install/Docker/dockerfiles/Dockerfile.kafka @@ -13,12 +13,12 @@ # under the License. # This is Dockerfile to build kafka image -FROM ubuntu:20.04 as kafka-build +FROM ubuntu:22.04 as kafka-build LABEL version="3.0" -LABEL ubuntuVersion="20.04" +LABEL ubuntuVersion="22.04" LABEL kafkaVersion="3.4.0" -LABEL description="Kafka docker image built on top of ubuntu:20.04" +LABEL description="Kafka docker image built on top of ubuntu:22.04" WORKDIR /kafka/ diff --git a/install/Docker/dockerfiles/Dockerfile.lenovoplugin b/install/Docker/dockerfiles/Dockerfile.lenovoplugin index c75a4d488..b1854c6ba 100644 --- a/install/Docker/dockerfiles/Dockerfile.lenovoplugin +++ b/install/Docker/dockerfiles/Dockerfile.lenovoplugin @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/lenovoplugin.sh . RUN ./lenovoplugin.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.licenses b/install/Docker/dockerfiles/Dockerfile.licenses index 5af726c3a..2fd0f3e83 100755 --- a/install/Docker/dockerfiles/Dockerfile.licenses +++ b/install/Docker/dockerfiles/Dockerfile.licenses @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/licenses.sh . RUN ./licenses.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.managers b/install/Docker/dockerfiles/Dockerfile.managers index 5b823c969..2c04c87fc 100644 --- a/install/Docker/dockerfiles/Dockerfile.managers +++ b/install/Docker/dockerfiles/Dockerfile.managers @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/managers.sh . RUN ./managers.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.systems b/install/Docker/dockerfiles/Dockerfile.systems index 48272cbde..7205fb1a7 100644 --- a/install/Docker/dockerfiles/Dockerfile.systems +++ b/install/Docker/dockerfiles/Dockerfile.systems @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/systems.sh . RUN ./systems.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.task b/install/Docker/dockerfiles/Dockerfile.task index f9cdabc88..3bdbb5126 100644 --- a/install/Docker/dockerfiles/Dockerfile.task +++ b/install/Docker/dockerfiles/Dockerfile.task @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/task.sh . RUN ./task.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.telemetry b/install/Docker/dockerfiles/Dockerfile.telemetry index ebcda1114..74d657218 100644 --- a/install/Docker/dockerfiles/Dockerfile.telemetry +++ b/install/Docker/dockerfiles/Dockerfile.telemetry @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/telemetry.sh . RUN ./telemetry.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.update b/install/Docker/dockerfiles/Dockerfile.update index 9a7f56b60..3c0dd6e7b 100644 --- a/install/Docker/dockerfiles/Dockerfile.update +++ b/install/Docker/dockerfiles/Dockerfile.update @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/update.sh . RUN ./update.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.urplugin b/install/Docker/dockerfiles/Dockerfile.urplugin index 6c6cefcf6..707030dd2 100644 --- a/install/Docker/dockerfiles/Dockerfile.urplugin +++ b/install/Docker/dockerfiles/Dockerfile.urplugin @@ -16,7 +16,7 @@ FROM odim:5.1 as build-stage COPY install/Docker/dockerfiles/build/urplugin.sh . RUN ./urplugin.sh -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG ODIMRA_USER_ID ARG ODIMRA_GROUP_ID diff --git a/install/Docker/dockerfiles/Dockerfile.zookeeper b/install/Docker/dockerfiles/Dockerfile.zookeeper index 318768813..2bd5bb0eb 100644 --- a/install/Docker/dockerfiles/Dockerfile.zookeeper +++ b/install/Docker/dockerfiles/Dockerfile.zookeeper @@ -13,13 +13,13 @@ # under the License. # This is Dockerfile to build zookeeper image -FROM ubuntu:20.04 as zookeeper-build +FROM ubuntu:22.04 as zookeeper-build LABEL version="3.0" -LABEL ubuntuVersion="20.04" +LABEL ubuntuVersion="22.04" LABEL kafkaVersion="3.4.0" LABEL zookeeperVersion="3.8.1" -LABEL description="Zookeeper docker image built on top of ubuntu:20.04 using kafka:3.4.0 bundle" +LABEL description="Zookeeper docker image built on top of ubuntu:22.04 using kafka:3.4.0 bundle" WORKDIR /zookeeper/ diff --git a/lib-messagebus/datacommunicator/config.go b/lib-messagebus/datacommunicator/config.go index ad16f7897..f910a0b4a 100644 --- a/lib-messagebus/datacommunicator/config.go +++ b/lib-messagebus/datacommunicator/config.go @@ -177,10 +177,10 @@ func bytesToPrivateKey(privateKey []byte) (*rsa.PrivateKey, error) { MQ.RedisStreams.RSAPrivateKeyPath) } - key, err := x509.ParsePKCS1PrivateKey(block.Bytes) + key, err := x509.ParsePKCS8PrivateKey(block.Bytes) if err != nil { return nil, fmt.Errorf("failed to parse DER encoded public key for the RSAPrivateKeyPath:%s with %v", MQ.RedisStreams.RSAPrivateKeyPath, err) } - return key, nil + return key.(*rsa.PrivateKey), nil } diff --git a/lib-utilities/common/crypto.go b/lib-utilities/common/crypto.go index d532de58f..35d187586 100644 --- a/lib-utilities/common/crypto.go +++ b/lib-utilities/common/crypto.go @@ -46,7 +46,7 @@ func DecryptWithPrivateKey(ciphertext []byte) ([]byte, error) { return nil, fmt.Errorf("error while trying to decrypt pem block: %v", err) } } - key, err := x509.ParsePKCS1PrivateKey(b) + key, err := x509.ParsePKCS8PrivateKey(b) if err != nil { return nil, fmt.Errorf("error while parsing private key: %v", err) } @@ -54,7 +54,7 @@ func DecryptWithPrivateKey(ciphertext []byte) ([]byte, error) { plainText, err := rsa.DecryptOAEP( hash, rand.Reader, - key, + key.(*rsa.PrivateKey), ciphertext, nil, ) diff --git a/lib-utilities/config/config.go b/lib-utilities/config/config.go index 22059c5ff..8d7b68178 100644 --- a/lib-utilities/config/config.go +++ b/lib-utilities/config/config.go @@ -381,7 +381,7 @@ func decryptRSAOAEPEncryptedPasswords(passwordFilePath string) ([]byte, error) { Data.KeyCertConf.RSAPrivateKeyPath) } - privateKey, err := x509.ParsePKCS1PrivateKey(block.Bytes) + privateKey, err := x509.ParsePKCS8PrivateKey(block.Bytes) if err != nil { return nil, fmt.Errorf("failed to parse DER encoded public key for the RSAPrivateKeyPath:%s with %v", Data.KeyCertConf.RSAPrivateKeyPath, err) @@ -398,7 +398,7 @@ func decryptRSAOAEPEncryptedPasswords(passwordFilePath string) ([]byte, error) { } rng := rand.Reader - password, err := rsa.DecryptOAEP(sha512.New(), rng, privateKey, ct, nil) + password, err := rsa.DecryptOAEP(sha512.New(), rng, privateKey.(*rsa.PrivateKey), ct, nil) if err != nil { return nil, fmt.Errorf("password decryption failed for the passwordFilePath:%s with %v", passwordFilePath, err) } diff --git a/odim-controller/odimra/group_vars/all/requirements.yaml b/odim-controller/odimra/group_vars/all/requirements.yaml index 183d6368e..27b41e838 100644 --- a/odim-controller/odimra/group_vars/all/requirements.yaml +++ b/odim-controller/odimra/group_vars/all/requirements.yaml @@ -32,7 +32,7 @@ docker_dep_pkgs: docker_pkgs: # - docker-ce=5:20.10.12~3-0~ubuntu-focal # - docker-ce-cli=5:20.10.12~3-0~ubuntu-focal - - containerd.io=1.4.12-1 + - containerd.io=1.6.4-1 - pigz docker_pkgs_wo_version: - docker-ce diff --git a/plugin-dell/dputilities/utility.go b/plugin-dell/dputilities/utility.go index c87858358..e399db1e7 100644 --- a/plugin-dell/dputilities/utility.go +++ b/plugin-dell/dputilities/utility.go @@ -70,7 +70,7 @@ func GetPlainText(ctx context.Context, password []byte) ([]byte, error) { return []byte{}, err } } - key, err := x509.ParsePKCS1PrivateKey(b) + key, err := x509.ParsePKCS8PrivateKey(b) if err != nil { l.LogWithFields(ctx).Error(err.Error()) return []byte{}, err @@ -81,7 +81,7 @@ func GetPlainText(ctx context.Context, password []byte) ([]byte, error) { return rsa.DecryptOAEP( hash, rand.Reader, - key, + key.(*rsa.PrivateKey), password, nil, ) diff --git a/plugin-dell/dputilities/utility_test.go b/plugin-dell/dputilities/utility_test.go index 2f1036b3f..145420fcf 100644 --- a/plugin-dell/dputilities/utility_test.go +++ b/plugin-dell/dputilities/utility_test.go @@ -93,10 +93,16 @@ func TestGetPlainText(t *testing.T) { t.Fatalf("error encrypting password: %v", err) } + // Marshal the rsa private key to PKCS8 format + marshalledPrivateKey, err := x509.MarshalPKCS8PrivateKey(key) + if err != nil { + t.Fatalf("error marshalling private key : %v", err) + } + // Convert the private key to PEM format priv := pem.EncodeToMemory(&pem.Block{ Type: "RSA PRIVATE KEY", - Bytes: x509.MarshalPKCS1PrivateKey(key), + Bytes: marshalledPrivateKey, }) dpmodel.PluginPrivateKey = priv // Decrypt the password using the GetPlainText function diff --git a/plugin-lenovo/lputilities/utility.go b/plugin-lenovo/lputilities/utility.go index fa7d778ff..309251007 100644 --- a/plugin-lenovo/lputilities/utility.go +++ b/plugin-lenovo/lputilities/utility.go @@ -26,7 +26,7 @@ //License for the specific language governing permissions and limitations // under the License. -//Package lputilities ... +// Package lputilities ... package lputilities import ( @@ -60,7 +60,7 @@ func GetPlainText(password []byte) ([]byte, error) { return []byte{}, err } } - key, err := x509.ParsePKCS1PrivateKey(b) + key, err := x509.ParsePKCS8PrivateKey(b) if err != nil { log.Info(err.Error()) return []byte{}, err @@ -71,13 +71,13 @@ func GetPlainText(password []byte) ([]byte, error) { return rsa.DecryptOAEP( hash, rand.Reader, - key, + key.(*rsa.PrivateKey), password, nil, ) } -//Status holds the Status of plugin it will be intizaied during startup time +// Status holds the Status of plugin it will be intizaied during startup time var Status lpresponse.Status // PluginStartTime hold the time from which plugin started diff --git a/plugin-redfish/rfputilities/utility.go b/plugin-redfish/rfputilities/utility.go index 32f02e63c..8b18d42eb 100644 --- a/plugin-redfish/rfputilities/utility.go +++ b/plugin-redfish/rfputilities/utility.go @@ -26,7 +26,7 @@ //License for the specific language governing permissions and limitations // under the License. -//Package rfputilities ... +// Package rfputilities ... package rfputilities import ( @@ -60,7 +60,7 @@ func GetPlainText(password []byte) ([]byte, error) { return []byte{}, err } } - key, err := x509.ParsePKCS1PrivateKey(b) + key, err := x509.ParsePKCS8PrivateKey(b) if err != nil { log.Info(err.Error()) return []byte{}, err @@ -71,13 +71,13 @@ func GetPlainText(password []byte) ([]byte, error) { return rsa.DecryptOAEP( hash, rand.Reader, - key, + key.(*rsa.PrivateKey), password, nil, ) } -//Status holds the Status of plugin it will be intizaied during startup time +// Status holds the Status of plugin it will be intizaied during startup time var Status rfpresponse.Status // PluginStartTime hold the time from which plugin started diff --git a/plugin-unmanaged-racks/config/config.go b/plugin-unmanaged-racks/config/config.go index 82f4d4f4e..9b241deb3 100644 --- a/plugin-unmanaged-racks/config/config.go +++ b/plugin-unmanaged-racks/config/config.go @@ -164,7 +164,7 @@ func decryptRSAOAEPEncryptedPasswords(passwordFilePath, RSAPrivateKeyPath string RSAPrivateKeyPath) } - privateKey, err := x509.ParsePKCS1PrivateKey(block.Bytes) + privateKey, err := x509.ParsePKCS8PrivateKey(block.Bytes) if err != nil { return nil, fmt.Errorf("failed to parse DER encoded public key for the RSAPrivateKeyPath:%s with %v", RSAPrivateKeyPath, err) @@ -181,7 +181,7 @@ func decryptRSAOAEPEncryptedPasswords(passwordFilePath, RSAPrivateKeyPath string } rng := rand.Reader - password, err := rsa.DecryptOAEP(sha512.New(), rng, privateKey, ct, nil) + password, err := rsa.DecryptOAEP(sha512.New(), rng, privateKey.(*rsa.PrivateKey), ct, nil) if err != nil { return nil, fmt.Errorf("password decryption failed for the passwordFilePath:%s with %v", passwordFilePath, err) } diff --git a/plugin-unmanaged-racks/utils/enigma.go b/plugin-unmanaged-racks/utils/enigma.go index b0da6292d..e51307d12 100644 --- a/plugin-unmanaged-racks/utils/enigma.go +++ b/plugin-unmanaged-racks/utils/enigma.go @@ -120,9 +120,9 @@ func bytesToPrivateKey(privateKey []byte) *rsa.PrivateKey { logging.Error(err) } } - key, err := x509.ParsePKCS1PrivateKey(b) + key, err := x509.ParsePKCS8PrivateKey(b) if err != nil { logging.Fatal(err) } - return key + return key.(*rsa.PrivateKey) }