MCPcopy Create free account
hub / github.com/TigerVNC/tigervnc / start

Method start

java/com/jcraft/jsch/UserAuthPublicKey.java:36–233  ·  view source on GitHub ↗
(Session session)

Source from the content-addressed store, hash-verified

34class UserAuthPublicKey extends UserAuth{
35
36 public boolean start(Session session) throws Exception{
37 super.start(session);
38
39 Vector identities=session.getIdentityRepository().getIdentities();
40
41 byte[] passphrase=null;
42 byte[] _username=null;
43
44 int command;
45
46 synchronized(identities){
47 if(identities.size()<=0){
48 return false;
49 }
50
51 _username=Util.str2byte(username);
52
53 for(int i=0; i<identities.size(); i++){
54
55 if(session.auth_failures >= session.max_auth_tries){
56 return false;
57 }
58
59 Identity identity=(Identity)(identities.elementAt(i));
60 byte[] pubkeyblob=identity.getPublicKeyBlob();
61
62 if(pubkeyblob!=null){
63 // send
64 // byte SSH_MSG_USERAUTH_REQUEST(50)
65 // string user name
66 // string service name ("ssh-connection")
67 // string "publickey"
68 // boolen FALSE
69 // string public key algorithm name
70 // string public key blob
71 packet.reset();
72 buf.putByte((byte)SSH_MSG_USERAUTH_REQUEST);
73 buf.putString(_username);
74 buf.putString(Util.str2byte("ssh-connection"));
75 buf.putString(Util.str2byte("publickey"));
76 buf.putByte((byte)0);
77 buf.putString(Util.str2byte(identity.getAlgName()));
78 buf.putString(pubkeyblob);
79 session.write(packet);
80
81 loop1:
82 while(true){
83 buf=session.read(buf);
84 command=buf.getCommand()&0xff;
85
86 if(command==SSH_MSG_USERAUTH_PK_OK){
87 break;
88 }
89 else if(command==SSH_MSG_USERAUTH_FAILURE){
90 break;
91 }
92 else if(command==SSH_MSG_USERAUTH_BANNER){
93 buf.getInt(); buf.getByte(); buf.getByte();

Callers

nothing calls this directly

Calls 15

str2byteMethod · 0.95
getPublicKeyBlobMethod · 0.95
getAlgNameMethod · 0.95
byte2strMethod · 0.95
isEncryptedMethod · 0.95
getNameMethod · 0.95
setPassphraseMethod · 0.95
bzeroMethod · 0.95
getSignatureMethod · 0.95
putByteMethod · 0.80
putStringMethod · 0.80
getCommandMethod · 0.80

Tested by

no test coverage detected