mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Replace ?ed25519= with ?key= in peering URIs
This commit is contained in:
		
							parent
							
								
									f7607557c1
								
							
						
					
					
						commit
						acdc3dd3c0
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -75,7 +75,7 @@ func (l *links) call(u *url.URL, sintf string) error {
 | 
				
			||||||
	//	return fmt.Errorf("peer %s is not correctly formatted (%s)", uri, err)
 | 
						//	return fmt.Errorf("peer %s is not correctly formatted (%s)", uri, err)
 | 
				
			||||||
	//}
 | 
						//}
 | 
				
			||||||
	tcpOpts := tcpOptions{}
 | 
						tcpOpts := tcpOptions{}
 | 
				
			||||||
	if pubkeys, ok := u.Query()["ed25519"]; ok && len(pubkeys) > 0 {
 | 
						if pubkeys, ok := u.Query()["key"]; ok && len(pubkeys) > 0 {
 | 
				
			||||||
		tcpOpts.pinnedEd25519Keys = make(map[keyArray]struct{})
 | 
							tcpOpts.pinnedEd25519Keys = make(map[keyArray]struct{})
 | 
				
			||||||
		for _, pubkey := range pubkeys {
 | 
							for _, pubkey := range pubkeys {
 | 
				
			||||||
			if sigPub, err := hex.DecodeString(pubkey); err == nil {
 | 
								if sigPub, err := hex.DecodeString(pubkey); err == nil {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -365,7 +365,7 @@ func (m *Multicast) listen() {
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
		if _, ok := interfaces[from.Zone]; ok {
 | 
							if _, ok := interfaces[from.Zone]; ok {
 | 
				
			||||||
			addr.Zone = ""
 | 
								addr.Zone = ""
 | 
				
			||||||
			pin := fmt.Sprintf("/?ed25519=%s", hex.EncodeToString(key))
 | 
								pin := fmt.Sprintf("/?key=%s", hex.EncodeToString(key))
 | 
				
			||||||
			u, err := url.Parse("tcp://" + addr.String() + pin)
 | 
								u, err := url.Parse("tcp://" + addr.String() + pin)
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
				m.log.Debugln("Call from multicast failed, parse error:", addr.String(), err)
 | 
									m.log.Debugln("Call from multicast failed, parse error:", addr.String(), err)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue