Skip to content

Commit

Permalink
[R4R] - {develop}: fix consensys audit issue: cs-6.42 (#1212)
Browse files Browse the repository at this point in the history
return bad request if request type is unsupported

Co-authored-by: Raymond <6427270+wukongcheng@users.noreply.github.com>
  • Loading branch information
HaoyangLiu and wukongcheng committed Jul 2, 2023
1 parent 56a1d4e commit 2c6c85f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tss/manager/router/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package router

import (
"errors"
"github.com/ethereum/go-ethereum/common"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"math/big"
"net/http"
"strconv"

"github.com/ethereum/go-ethereum/common"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/gin-gonic/gin"
"github.com/mantlenetworkio/mantle/l2geth/log"
tss "github.com/mantlenetworkio/mantle/tss/common"
Expand Down Expand Up @@ -55,6 +56,9 @@ func (registry *Registry) SignStateHandler() gin.HandlerFunc {
return
}
signature, err = registry.signService.SignRollBack(request)
} else {
c.String(http.StatusBadRequest, "invalid request type %d, expected request type: 0 and 1", request.Type)
return
}
if err != nil {
c.String(http.StatusInternalServerError, "failed to sign state")
Expand Down

0 comments on commit 2c6c85f

Please sign in to comment.