From 4d5fbfa439681f94e95e46affb607667a6a7fe1f Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Mon, 25 Sep 2023 15:49:45 -0700 Subject: [PATCH] Fix redacted types in SCEP provisioner This commit uses the same types for the fields in the provisioner.SCEP type and the "redacted" models.SCEP. --- api/api.go | 6 +++--- api/models/scep.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/api.go b/api/api.go index 0dc961d80..c586a43a0 100644 --- a/api/api.go +++ b/api/api.go @@ -245,10 +245,10 @@ func scepFromProvisioner(p *provisioner.SCEP) *models.SCEP { IncludeRoot: p.IncludeRoot, ExcludeIntermediate: p.ExcludeIntermediate, MinimumPublicKeyLength: p.MinimumPublicKeyLength, - DecrypterCertificate: redacted, - DecrypterKeyPEM: redacted, + DecrypterCertificate: []byte(redacted), + DecrypterKeyPEM: []byte(redacted), DecrypterKeyURI: redacted, - DecrypterKeyPassword: redacted, + DecrypterKeyPassword: []byte(redacted), EncryptionAlgorithmIdentifier: p.EncryptionAlgorithmIdentifier, Options: p.Options, Claims: p.Claims, diff --git a/api/models/scep.go b/api/models/scep.go index 71c003a79..c4fea5022 100644 --- a/api/models/scep.go +++ b/api/models/scep.go @@ -25,10 +25,10 @@ type SCEP struct { IncludeRoot bool `json:"includeRoot"` ExcludeIntermediate bool `json:"excludeIntermediate"` MinimumPublicKeyLength int `json:"minimumPublicKeyLength"` - DecrypterCertificate string `json:"decrypterCertificate"` - DecrypterKeyPEM string `json:"decrypterKeyPEM"` + DecrypterCertificate []byte `json:"decrypterCertificate"` + DecrypterKeyPEM []byte `json:"decrypterKeyPEM"` DecrypterKeyURI string `json:"decrypterKey"` - DecrypterKeyPassword string `json:"decrypterKeyPassword"` + DecrypterKeyPassword []byte `json:"decrypterKeyPassword"` EncryptionAlgorithmIdentifier int `json:"encryptionAlgorithmIdentifier"` Options *provisioner.Options `json:"options,omitempty"` Claims *provisioner.Claims `json:"claims,omitempty"`