diff --git a/op-ufm/op-ufm/pkg/metrics/metrics.go b/op-ufm/op-ufm/pkg/metrics/metrics.go index 8f92411..762082c 100644 --- a/op-ufm/op-ufm/pkg/metrics/metrics.go +++ b/op-ufm/op-ufm/pkg/metrics/metrics.go @@ -94,7 +94,8 @@ func RecordError(provider string, errorLabel string) { func RecordErrorDetails(provider string, label string, err error) { errClean := nonAlphanumericRegex.ReplaceAllString(err.Error(), "") errClean = strings.ReplaceAll(errClean, " ", "_") - label = fmt.Sprintf("%s.%s", label) + errClean = strings.ReplaceAll(errClean, "__", "_") + label = fmt.Sprintf("%s.%s", label, errClean) RecordError(provider, label) } diff --git a/op-ufm/op-ufm/tools/kmstool/main.go b/op-ufm/op-ufm/tools/kmstool/main.go index be68d5c..2fea5f3 100644 --- a/op-ufm/op-ufm/tools/kmstool/main.go +++ b/op-ufm/op-ufm/tools/kmstool/main.go @@ -44,10 +44,11 @@ func resolveAddr(ctx context.Context, client *kms.KeyManagementClient, keyName s if err != nil { return common.Address{}, fmt.Errorf("google kms public key %q lookup: %w", keyName, err) } + keyPem := resp.Pem - block, _ := pem.Decode([]byte(resp.Pem)) + block, _ := pem.Decode([]byte(keyPem)) if block == nil { - return common.Address{}, fmt.Errorf("google kms public key %q pem empty: %.130q", keyName, resp.Pem) + return common.Address{}, fmt.Errorf("google kms public key %q pem empty: %.130q", keyName, keyPem) } var info struct { @@ -59,11 +60,6 @@ func resolveAddr(ctx context.Context, client *kms.KeyManagementClient, keyName s return common.Address{}, fmt.Errorf("google kms public key %q pem block %q: %v", keyName, block.Type, err) } - wantAlg := asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1} - if gotAlg := info.AlgID.Algorithm; !gotAlg.Equal(wantAlg) { - return common.Address{}, fmt.Errorf("google kms public key %q asn.1 algorithm %s intead of %s", keyName, gotAlg, wantAlg) - } - return pubKeyAddr(info.Key.Bytes), nil }