mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-07-02 03:34:29 +02:00
Fix literal referenc.
This commit is contained in:
parent
5965172183
commit
f957079489
10
server.go
10
server.go
@ -1,17 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
"net/http"
|
|
||||||
"bufio"
|
|
||||||
"encoding/base64"
|
|
||||||
|
|
||||||
"golang.org/x/crypto/ssh"
|
"golang.org/x/crypto/ssh"
|
||||||
)
|
)
|
||||||
@ -301,10 +301,10 @@ func (s *Server) whitelistFingerprint(fingerprint string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Client for getting github pub keys
|
// Client for getting github pub keys
|
||||||
var timeout = time.Duration(10 * time.Second)
|
|
||||||
var client = http.Client{
|
var client = http.Client{
|
||||||
Timeout: timeout,
|
Timeout: time.Duration(10 * time.Second),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns an array of public keys for the given github user URL
|
// Returns an array of public keys for the given github user URL
|
||||||
func getGithubPubKeys(user string) ([]ssh.PublicKey, error) {
|
func getGithubPubKeys(user string) ([]ssh.PublicKey, error) {
|
||||||
resp, err := client.Get("http://github.com/" + user + ".keys")
|
resp, err := client.Get("http://github.com/" + user + ".keys")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user