Exemplo n.º 1
0
func wrapC4RequestEvent(ev event.Event) event.Event {
	var encrypt event.EncryptEventV2
	encrypt.SetHash(ev.GetHash())
	encrypt.EncryptType = c4_cfg.Encrypter
	encrypt.Ev = ev
	return &encrypt
}
Exemplo n.º 2
0
func offerSendEvent(ev event.Event, user string) {
	switch ev.GetType() {
	case event.EVENT_TCP_CHUNK_TYPE:
		var compress event.CompressEventV2
		compress.SetHash(ev.GetHash())
		compress.Ev = ev
		compress.CompressType = event.COMPRESSOR_SNAPPY
		ev = &compress
	}
	var encrypt event.EncryptEventV2
	encrypt.SetHash(ev.GetHash())
	encrypt.EncryptType = event.ENCRYPTER_SE1
	encrypt.Ev = ev
	ev = &encrypt
	idx := int(ev.GetHash()) % len(send_evs[user])
	send_evs[user][idx] <- ev
}