You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor TR and SC initialization into common method
The one difference between sign/attest and sign/attest-blob is whether a
bundle output flag is present, so the error message has been adjusted.
Signed-off-by: Hayden <[email protected]>
returnfmt.Errorf("cannot specify service URLs and use signing config")
112
-
}
113
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.TlogUpload {
114
-
returnfmt.Errorf("--tlog-upload=false is not supported with --signing-config or --use-signing-config. Provide a signing config without a transparency log service")
115
-
}
116
-
// Signing config requires a bundle as output for verification materials since sigstore-go is used
117
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.NewBundleFormat {
118
-
returnfmt.Errorf("must provide --new-bundle-format with --signing-config or --use-signing-config")
119
-
}
120
-
// Fetch a trusted root when:
121
-
// * requesting a certificate and no CT log key is provided to verify an SCT
122
-
// * using a signing config and signing using sigstore-go
123
-
if (o.Key==""&&env.Getenv(env.VariableSigstoreCTLogPublicKeyFile) =="") ||
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
returnfmt.Errorf("cannot specify service URLs and use signing config")
100
-
}
101
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.TlogUpload {
102
-
returnfmt.Errorf("--tlog-upload=false is not supported with --signing-config or --use-signing-config. Provide a signing config without a transparency log service")
103
-
}
104
-
// Signing config requires a bundle as output for verification materials since sigstore-go is used
105
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&o.BundlePath=="" {
106
-
returnfmt.Errorf("must provide --bundle with --signing-config or --use-signing-config")
107
-
}
108
-
// Fetch a trusted root when:
109
-
// * requesting a certificate and no CT log key is provided to verify an SCT
110
-
// * using a signing config and signing using sigstore-go
111
-
if (o.Key==""&&env.Getenv(env.VariableSigstoreCTLogPublicKeyFile) =="") ||
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
returnfmt.Errorf("cannot specify service URLs and use signing config")
142
-
}
143
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.TlogUpload {
144
-
returnfmt.Errorf("--tlog-upload=false is not supported with --signing-config or --use-signing-config. Provide a signing config without a transparency log service")
145
-
}
146
-
// Signing config requires a bundle as output for verification materials since sigstore-go is used
147
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.NewBundleFormat {
148
-
returnfmt.Errorf("must provide --new-bundle-format with --signing-config or --use-signing-config")
149
-
}
150
-
// Fetch a trusted root when:
151
-
// * requesting a certificate and no CT log key is provided to verify an SCT
152
-
// * using a signing config and signing using sigstore-go
153
-
if ((o.Key==""||o.IssueCertificate) &&env.Getenv(env.VariableSigstoreCTLogPublicKeyFile) =="") ||
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
returnfmt.Errorf("cannot specify service URLs and use signing config")
110
-
}
111
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&!o.TlogUpload {
112
-
returnfmt.Errorf("--tlog-upload=false is not supported with --signing-config or --use-signing-config. Provide a signing config without a transparency log service")
113
-
}
114
-
// Signing config requires a bundle as output for verification materials since sigstore-go is used
115
-
if (o.UseSigningConfig||o.SigningConfigPath!="") &&o.BundlePath=="" {
116
-
returnfmt.Errorf("must provide --bundle with --signing-config or --use-signing-config")
117
-
}
118
-
// Fetch a trusted root when:
119
-
// * requesting a certificate and no CT log key is provided to verify an SCT
120
-
// * using a signing config and signing using sigstore-go
121
-
if ((o.Key==""||o.IssueCertificate) &&env.Getenv(env.VariableSigstoreCTLogPublicKeyFile) =="") ||
ui.Warnf(context.Background(), "Could not fetch trusted_root.json from the TUF repository. Continuing with individual targets. Error from TUF: %v", err)
returnfmt.Errorf("cannot specify service URLs and use signing config")
598
+
}
599
+
if (useSigningConfig||signingConfigPath!="") &&!tlogUpload {
600
+
returnfmt.Errorf("--tlog-upload=false is not supported with --signing-config or --use-signing-config. Provide a signing config without a transparency log service")
601
+
}
602
+
// Signing config requires a bundle as output for verification materials since sigstore-go is used
603
+
if (useSigningConfig||signingConfigPath!="") &&!newBundleFormat&&bundlePath=="" {
604
+
returnfmt.Errorf("must provide --new-bundle-format or --bundle where applicable with --signing-config or --use-signing-config")
605
+
}
606
+
// Fetch a trusted root when:
607
+
// * requesting a certificate and no CT log key is provided to verify an SCT
608
+
// * using a signing config and signing using sigstore-go
609
+
if ((keyRef==""||issueCertificate) &&env.Getenv(env.VariableSigstoreCTLogPublicKeyFile) =="") ||
0 commit comments