diff options
| author | Andrew <saintruler@gmail.com> | 2021-04-28 20:35:50 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2021-04-28 20:35:50 +0400 |
| commit | 4b2ecfc50e3315dcc27ec85c6b707a021515c5c6 (patch) | |
| tree | 8f114bb50f33ff78b09ceccf0e615b95cd0cdced | |
| parent | 8ebbdab5079f803567297af842c87ce012b7ea11 (diff) | |
Removed unnecessary code.
| -rw-r--r-- | http-client/client.go | 11 | ||||
| -rw-r--r-- | http-server/main.go | 3 |
2 files changed, 0 insertions, 14 deletions
diff --git a/http-client/client.go b/http-client/client.go index 13baf20..346a654 100644 --- a/http-client/client.go +++ b/http-client/client.go @@ -3,8 +3,6 @@ package main import ( "bytes" "crypto/rsa" - "crypto/sha256" - "encoding/base64" "encoding/json" "errors" "fmt" @@ -24,8 +22,6 @@ const ( TryAuth = "tryAuth" ) -const TimestampFormat = "2006-01-02T15-01-05.999" - var storage struct { sync.RWMutex messages []Message @@ -52,13 +48,6 @@ func (msg *Message) toString() string { return fmt.Sprintf("%s: %s", msg.User, msg.Data) } -func signData(data []byte) string { - data64 := base64.StdEncoding.EncodeToString(data) - h := sha256.Sum256([]byte(data64)) - signature := fmt.Sprintf("%x", h) - return fmt.Sprintf("%s.%s", data64, signature) -} - func makeRequest(request Request, apiMethod string, key *rsa.PublicKey) (*http.Response, error) { signedRequest, err := signRequest(request, key) if err != nil { diff --git a/http-server/main.go b/http-server/main.go index d7b2625..065cafa 100644 --- a/http-server/main.go +++ b/http-server/main.go @@ -96,9 +96,6 @@ func register(w http.ResponseWriter, r *http.Request) { return } - // TODO(andrew): Разобраться с процессом регистрации с подписью - _ = fmt.Sprintf("%s", signature) - userRegistered, err := db.checkUserRegistered(req.User) if err != nil { _ = serverError(w) |