From 53d698191cc70be5b4addd76e7db46c1f496bed8 Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Fri, 20 Oct 2023 17:20:48 +0900 Subject: [PATCH] fix ProverConfig::Validate to validate origin prover's config Signed-off-by: Masanori Yoshida --- relay/config.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/relay/config.go b/relay/config.go index 9c6d91e..133bd84 100644 --- a/relay/config.go +++ b/relay/config.go @@ -44,6 +44,12 @@ func (pc ProverConfig) GetMrenclave() []byte { } func (pc ProverConfig) Validate() error { + // origin prover config validation + if err := pc.OriginProver.GetCachedValue().(core.ProverConfig).Validate(); err != nil { + return fmt.Errorf("failed to validate the origin prover's config: %v", err) + } + + // lcp prover config validation mrenclave, err := decodeMrenclaveHex(pc.Mrenclave) if err != nil { return err @@ -54,6 +60,7 @@ func (pc ProverConfig) Validate() error { if pc.KeyExpiration == 0 { return fmt.Errorf("KeyExpiration must be greater than 0") } + return nil }