~juju-qa/ubuntu/xenial/juju/2.0-rc2

« back to all changes in this revision

Viewing changes to src/golang.org/x/crypto/ssh/server.go

  • Committer: Nicholas Skaggs
  • Date: 2016-09-30 14:39:30 UTC
  • mfrom: (1.8.1)
  • Revision ID: nicholas.skaggs@canonical.com-20160930143930-vwwhrefh6ftckccy
import upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        // attempts.
67
67
        AuthLogCallback func(conn ConnMetadata, method string, err error)
68
68
 
69
 
        // ServerVersion is the version identification string to
70
 
        // announce in the public handshake.
 
69
        // ServerVersion is the version identification string to announce in
 
70
        // the public handshake.
71
71
        // If empty, a reasonable default is used.
 
72
        // Note that RFC 4253 section 4.2 requires that this string start with
 
73
        // "SSH-2.0-".
72
74
        ServerVersion string
73
75
}
74
76
 
186
188
        tr := newTransport(s.sshConn.conn, config.Rand, false /* not client */)
187
189
        s.transport = newServerTransport(tr, s.clientVersion, s.serverVersion, config)
188
190
 
189
 
        if err := s.transport.requestKeyChange(); err != nil {
190
 
                return nil, err
191
 
        }
192
 
 
193
 
        if packet, err := s.transport.readPacket(); err != nil {
194
 
                return nil, err
195
 
        } else if packet[0] != msgNewKeys {
196
 
                return nil, unexpectedMessageError(msgNewKeys, packet[0])
 
191
        if err := s.transport.requestInitialKeyChange(); err != nil {
 
192
                return nil, err
197
193
        }
198
194
 
199
195
        // We just did the key change, so the session ID is established.
228
224
 
229
225
func isAcceptableAlgo(algo string) bool {
230
226
        switch algo {
231
 
        case KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521,
 
227
        case KeyAlgoRSA, KeyAlgoDSA, KeyAlgoECDSA256, KeyAlgoECDSA384, KeyAlgoECDSA521, KeyAlgoED25519,
232
228
                CertAlgoRSAv01, CertAlgoDSAv01, CertAlgoECDSA256v01, CertAlgoECDSA384v01, CertAlgoECDSA521v01:
233
229
                return true
234
230
        }
288
284
                switch userAuthReq.Method {
289
285
                case "none":
290
286
                        if config.NoClientAuth {
291
 
                                s.user = ""
292
287
                                authErr = nil
293
288
                        }
294
289
                case "password":