storagenode/signature: Reject uploads with a timestamp too far in the future (#3194)

This commit is contained in:
littleskunk 2019-10-08 13:09:46 +02:00 committed by GitHub
parent c009543236
commit d5b2e1ef89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,9 @@ func (endpoint *Endpoint) verifyOrderLimit(ctx context.Context, limit *pb.OrderL
case endpoint.IsExpired(limit.OrderExpiration):
return rpcstatus.Errorf(rpcstatus.InvalidArgument, "order expired: %v", limit.OrderExpiration)
case now.Sub(limit.OrderCreation) > endpoint.config.OrderLimitGracePeriod:
return rpcstatus.Errorf(rpcstatus.InvalidArgument, "order created too long ago: %v", limit.OrderCreation)
return rpcstatus.Errorf(rpcstatus.InvalidArgument, "order created too long ago: OrderCreation %v < SystemClock %v", limit.OrderCreation, now)
case limit.OrderCreation.Sub(now) > endpoint.config.OrderLimitGracePeriod:
return rpcstatus.Errorf(rpcstatus.InvalidArgument, "order created too far in the future: OrderCreation %v > SystemClock %v", limit.OrderCreation, now)
case limit.SatelliteId.IsZero():
return rpcstatus.Errorf(rpcstatus.InvalidArgument, "missing satellite id")
case limit.UplinkPublicKey.IsZero():