From 7061147885af5a55d8ab2dd63fc67d437f4bec94 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Wed, 26 Jul 2023 15:44:02 -0700 Subject: [PATCH] Use step.Abs to load the certificate templates step.Abs has been removed from crypto and they need to be set when those methods are used --- authority/provisioner/options.go | 3 ++- authority/provisioner/ssh_options.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/authority/provisioner/options.go b/authority/provisioner/options.go index 702666a4..cbce43de 100644 --- a/authority/provisioner/options.go +++ b/authority/provisioner/options.go @@ -6,6 +6,7 @@ import ( "github.com/pkg/errors" + "go.step.sm/cli-utils/step" "go.step.sm/crypto/jose" "go.step.sm/crypto/x509util" @@ -160,7 +161,7 @@ func CustomTemplateOptions(o *Options, data x509util.TemplateData, defaultTempla // Load a template from a file if Template is not defined. if opts.Template == "" && opts.TemplateFile != "" { return []x509util.Option{ - x509util.WithTemplateFile(opts.TemplateFile, data), + x509util.WithTemplateFile(step.Abs(opts.TemplateFile), data), } } diff --git a/authority/provisioner/ssh_options.go b/authority/provisioner/ssh_options.go index 93633a21..e870ff30 100644 --- a/authority/provisioner/ssh_options.go +++ b/authority/provisioner/ssh_options.go @@ -5,6 +5,7 @@ import ( "strings" "github.com/pkg/errors" + "go.step.sm/cli-utils/step" "go.step.sm/crypto/sshutil" "github.com/smallstep/certificates/authority/policy" @@ -144,7 +145,7 @@ func CustomSSHTemplateOptions(o *Options, data sshutil.TemplateData, defaultTemp // Load a template from a file if Template is not defined. if opts.Template == "" && opts.TemplateFile != "" { return []sshutil.Option{ - sshutil.WithTemplateFile(opts.TemplateFile, data), + sshutil.WithTemplateFile(step.Abs(opts.TemplateFile), data), } }