Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug blobber replace #1480

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion code/go/0chain.net/blobbercore/handler/storage_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,10 @@ func (fsh *StorageHandler) GetRefs(ctx context.Context, r *http.Request) (*blobb

// verifySignatureFromRequest verifies signature passed as common.ClientSignatureHeader header.
func verifySignatureFromRequest(alloc, signV1, signV2, pbK string) (bool, error) {
logging.Logger.Info("1Jayash verifySignatureFromRequest", zap.String("signV1", signV1), zap.String("signV2", signV2), zap.String("publicKey", pbK))
logging.Logger.Debug("2Jayash verifySignatureFromRequest", zap.String("signV1", signV1), zap.String("signV2", signV2), zap.String("publicKey", pbK))
logging.Logger.Error("3Jayash verifySignatureFromRequest", zap.String("signV1", signV1), zap.String("signV2", signV2), zap.String("publicKey", pbK))

var (
sign string
hashData string
Expand All @@ -1123,7 +1127,12 @@ func verifySignatureFromRequest(alloc, signV1, signV2, pbK string) (bool, error)
if len(sign) < 64 {
return false, nil
}
return encryption.Verify(pbK, sign, hash)
res, err := encryption.Verify(pbK, sign, hash)
if err != nil {
logging.Logger.Info("Jayash verifySignatureFromRequest", zap.String("hash", hash), zap.String("hashData", hashData), zap.String("sign", sign), zap.String("publicKey", pbK), zap.Error(err))
return false, err
}
return res, nil
}

// pathsFromReq retrieves paths value from request which can be represented as single "path" value or "paths" values,
Expand Down
Loading