Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Sep 11, 2024
1 parent 1dae3f6 commit 14474b0
Show file tree
Hide file tree
Showing 57 changed files with 16,073 additions and 17,627 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

- Update `cmd/tools/pmanager`: delete constant from crypto/symmetric package, update keySize 32 -> 33 bytes
- Update `pkg/network/conn`: add context to NewConn function, rename NewConn -> Connect
- Update `pkg/network/anonymity`: delete f2f_disabled=true option (insecure)
- Update `pkg/network/anonymity/queue`: delete queue_period=0 option (insecure)

<!-- ... -->

Expand Down
18,817 changes: 9,080 additions & 9,737 deletions cmd/hidden_lake/_test/result/coverage.out

Large diffs are not rendered by default.

610 changes: 298 additions & 312 deletions cmd/hidden_lake/_test/result/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion cmd/hidden_lake/applications/remoter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
The `Hidden Lake Remoter` this is a service that provides the ability to make remote calls on the anonymous network core (HLS) with theoretically provable anonymity.

> [!CAUTION]
> This application can be extremely dangerous if the F2F option is disabled in the HLS application or if a private key known to many is used. Use HLR with caution.
> This application can be extremely dangerous. Use HLR with caution.
> More information about HLR in the [habr.com/ru/articles/830130](https://habr.com/ru/articles/830130/ "Habr HLR")
Expand Down
1 change: 0 additions & 1 deletion cmd/hidden_lake/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ settings:
queue_period_ms: 5000
rand_queue_period_ms: 5000
rand_message_size_bytes: 4096
f2f_disabled: true
network_key: hls-network-key
logging:
- info
Expand Down
5 changes: 0 additions & 5 deletions cmd/hidden_lake/service/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type SConfigSettings struct {
FRandQueuePeriodMS uint64 `json:"rand_queue_period_ms,omitempty" yaml:"rand_queue_period_ms,omitempty"`
FRandMessageSizeBytes uint64 `json:"rand_message_size_bytes,omitempty" yaml:"rand_message_size_bytes,omitempty"`
FNetworkKey string `json:"network_key,omitempty" yaml:"network_key,omitempty"`
FF2FDisabled bool `json:"f2f_disabled,omitempty" yaml:"f2f_disabled,omitempty"`
}

type SConfig struct {
Expand Down Expand Up @@ -129,10 +128,6 @@ func (p *SConfigSettings) GetNetworkKey() string {
return p.FNetworkKey
}

func (p *SConfigSettings) GetF2FDisabled() bool {
return p.FF2FDisabled
}

func (p *SConfig) GetSettings() IConfigSettings {
return p.FSettings
}
Expand Down
6 changes: 0 additions & 6 deletions cmd/hidden_lake/service/internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const (
rand_queue_period_ms: %d
rand_message_size_bytes: %d
network_key: %s
f2f_disabled: true
logging:
- info
- erro
Expand Down Expand Up @@ -275,11 +274,6 @@ func TestComplexConfig(t *testing.T) {
return
}

if !cfg.GetSettings().GetF2FDisabled() {
t.Error("settings f2f disabled is invalid")
return
}

if cfg.GetLogging().HasInfo() != tcLogging {
t.Error("logging.info is invalid")
return
Expand Down
1 change: 0 additions & 1 deletion cmd/hidden_lake/service/internal/config/editor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (p *tsConfig) GetNetworkKey() string { return "" }
func (p *tsConfig) GetConnections() []string { return nil }
func (p *tsConfig) GetFriends() map[string]asymmetric.IPubKey { return nil }
func (p *tsConfig) GetService(_ string) (IService, bool) { return nil, false }
func (p *tsConfig) GetF2FDisabled() bool { return false }

func TestPanicEditor(t *testing.T) {
t.Parallel()
Expand Down
1 change: 0 additions & 1 deletion cmd/hidden_lake/service/internal/config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func InitConfig(cfgPath string, initCfg *SConfig) (IConfig, error) {
FRandQueuePeriodMS: hls_settings.CDefaultRandQueuePeriod,
FRandMessageSizeBytes: hls_settings.CDefaultRandMessageSize,
FNetworkKey: hls_settings.CDefaultNetworkKey,
FF2FDisabled: hls_settings.CDefaultF2FDisabled,
},
FLogging: []string{logger.CLogInfo, logger.CLogWarn, logger.CLogErro},
FAddress: &SAddress{
Expand Down
1 change: 0 additions & 1 deletion cmd/hidden_lake/service/internal/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type IConfigSettings interface {
GetQueuePeriodMS() uint64
GetRandQueuePeriodMS() uint64
GetRandMessageSizeBytes() uint64
GetF2FDisabled() bool
}

type IConfig interface {
Expand Down
23 changes: 0 additions & 23 deletions cmd/hidden_lake/service/internal/handler/service_tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,6 @@ func HandleServiceTCP(pCfgW config.IWrapper) anonymity.IHandlerF {
WithPubKey(pSender)

cfg := pCfgW.GetConfig()
friends := cfg.GetFriends()

// append public key to list of friends if f2f option is disabled
if cfg.GetSettings().GetF2FDisabled() && !inFriendsList(friends, pSender) {
// update config state with new friend
friends[pSender.GetHasher().ToString()] = pSender
if err := pCfgW.GetEditor().UpdateFriends(friends); err != nil {
logger.PushErro(logBuilder.WithType(internal_anon_logger.CLogBaseAppendNewFriend))
return nil, utils.MergeErrors(ErrUpdateFriends, err)
}
// update list of friends and continue read request
pNode.GetListPubKeys().AddPubKey(pSender)
logger.PushInfo(logBuilder.WithType(internal_anon_logger.CLogBaseAppendNewFriend))
}

// load request from message's body
loadReq, err := request.LoadRequest(pReqBytes)
Expand Down Expand Up @@ -124,15 +110,6 @@ func HandleServiceTCP(pCfgW config.IWrapper) anonymity.IHandlerF {
}
}

func inFriendsList(pFriends map[string]asymmetric.IPubKey, pPubKey asymmetric.IPubKey) bool {
for _, pubKey := range pFriends {
if bytes.Equal(pubKey.ToBytes(), pPubKey.ToBytes()) {
return true
}
}
return false
}

func getResponseHead(pResp *http.Response) map[string]string {
headers := make(map[string]string)
for k := range pResp.Header {
Expand Down
1 change: 0 additions & 1 deletion cmd/hidden_lake/service/pkg/app/init_anon_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func (p *sApp) initAnonNode() error {
p.fNode = anonymity.NewNode(
anonymity.NewSettings(&anonymity.SSettings{
FServiceName: hls_settings.CServiceName,
FF2FDisabled: cfgSettings.GetF2FDisabled(),
FNetworkMask: hls_settings.CNetworkMask,
FFetchTimeout: time.Duration(cfgSettings.GetFetchTimeoutMS()) * time.Millisecond,
}),
Expand Down
1 change: 0 additions & 1 deletion cmd/hidden_lake/service/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ func GetConfigSettings(pCfg config.IConfig, pClient client.IClient) SConfigSetti
FRandQueuePeriodMS: sett.GetRandQueuePeriodMS(),
FRandMessageSizeBytes: sett.GetRandMessageSizeBytes(),
FNetworkKey: sett.GetNetworkKey(),
FF2FDisabled: sett.GetF2FDisabled(),
},
// encoding.CSizeUint64 = payload64.Head()
FLimitMessageSizeBytes: msgLimit - encoding.CSizeUint64,
Expand Down
1 change: 0 additions & 1 deletion cmd/hidden_lake/service/pkg/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const (
CDefaultWorkSize = 0 // bits
CDefaultRandQueuePeriod = 0 // 0 seconds
CDefaultRandMessageSize = 0 // 0 bytes
CDefaultF2FDisabled = false // friend-to-friend
CDefaultNetworkKey = ""
)

Expand Down
Binary file modified docs/hidden_lake_anonymous_network.docx
Binary file not shown.
Binary file modified docs/hidden_lake_anonymous_network.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion examples/anonymity/echo_service/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: default clean request
default: clean
clean:
make -C ./insecure clean
make -C ./prod_test clean
make -C ./routing clean
make -C ./secret_channel/chatingar clean
Expand Down
18 changes: 0 additions & 18 deletions examples/anonymity/echo_service/insecure/Makefile

This file was deleted.

32 changes: 0 additions & 32 deletions examples/anonymity/echo_service/insecure/docker-compose.yml

This file was deleted.

15 changes: 0 additions & 15 deletions examples/anonymity/echo_service/insecure/recv_hls/hls.yml

This file was deleted.

16 changes: 0 additions & 16 deletions examples/anonymity/echo_service/insecure/send_hls/hls.yml

This file was deleted.

1 change: 0 additions & 1 deletion examples/anonymity/filesharer/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: default clean request
default: clean
clean:
make -C ./insecure clean
make -C ./prod_test clean
make -C ./routing clean
make -C ./secret_channel/chatingar clean
Expand Down
24 changes: 0 additions & 24 deletions examples/anonymity/filesharer/insecure/Makefile

This file was deleted.

26 changes: 0 additions & 26 deletions examples/anonymity/filesharer/insecure/docker-compose.yml

This file was deleted.

7 changes: 0 additions & 7 deletions examples/anonymity/filesharer/insecure/node1_hlf/hlc.yml

This file was deleted.

11 changes: 0 additions & 11 deletions examples/anonymity/filesharer/insecure/node1_hlf/hlf.yml

This file was deleted.

17 changes: 0 additions & 17 deletions examples/anonymity/filesharer/insecure/node1_hlf/hls_copy.yml

This file was deleted.

7 changes: 0 additions & 7 deletions examples/anonymity/filesharer/insecure/node2_hlf/hlc.yml

This file was deleted.

11 changes: 0 additions & 11 deletions examples/anonymity/filesharer/insecure/node2_hlf/hlf.yml

This file was deleted.

16 changes: 0 additions & 16 deletions examples/anonymity/filesharer/insecure/node2_hlf/hls_copy.yml

This file was deleted.

1 change: 0 additions & 1 deletion examples/anonymity/messenger/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.PHONY: default clean request
default: clean
clean:
make -C ./insecure clean
make -C ./group clean
make -C ./prod_test clean
make -C ./routing clean
Expand Down
Loading

0 comments on commit 14474b0

Please sign in to comment.