Skip to content
Snippets Groups Projects
Select Git revision
  • c36c1d81eadf36934e4cabfbbd6b9174a4f6e93a
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

build-bindings.sh

Blame
  • user.go 1.44 KiB
    ///////////////////////////////////////////////////////////////////////////////
    // Copyright © 2020 xx network SEZC                                          //
    //                                                                           //
    // Use of this source code is governed by a license that can be found in the //
    // LICENSE file                                                              //
    ///////////////////////////////////////////////////////////////////////////////
    
    package storage
    
    import "gitlab.com/elixxir/client/interfaces/user"
    
    func (s *Session) GetUser() user.User {
    	s.mux.RLock()
    	defer s.mux.RUnlock()
    	ci := s.user.GetCryptographicIdentity()
    	return user.User{
    		TransmissionID:        ci.GetTransmissionID().DeepCopy(),
    		TransmissionSalt:      copySlice(ci.GetTransmissionSalt()),
    		TransmissionRSA:       ci.GetTransmissionRSA(),
    		ReceptionID:           ci.GetReceptionID().DeepCopy(),
    		RegistrationTimestamp: s.user.GetRegistrationTimestamp().UnixNano(),
    		ReceptionSalt:         copySlice(ci.GetReceptionSalt()),
    		ReceptionRSA:          ci.GetReceptionRSA(),
    		Precanned:             ci.IsPrecanned(),
    		CmixDhPrivateKey:      s.cmix.GetDHPrivateKey().DeepCopy(),
    		CmixDhPublicKey:       s.cmix.GetDHPublicKey().DeepCopy(),
    		E2eDhPrivateKey:       s.e2e.GetDHPrivateKey().DeepCopy(),
    		E2eDhPublicKey:        s.e2e.GetDHPublicKey().DeepCopy(),
    	}
    
    }
    
    func copySlice(s []byte) []byte {
    	n := make([]byte, len(s))
    	copy(n, s)
    	return n
    }