public String getHost() { return key.getHost(); }
final String out; if (!hostKeys.isEmpty()) { String host = hostKeys.get(0).getHost(); String port = "22";
void dump(OutputStream out) throws IOException { try{ HostKey hk; synchronized(pool){ for(int i=0; i<pool.size(); i++){ hk=(HostKey)(pool.elementAt(i)); //hk.dump(out); String host=hk.getHost(); String type=hk.getType(); if(type.equals("UNKNOWN")){ out.write(host.getBytes()); out.write(cr); continue; } out.write(host.getBytes()); out.write(space); out.write(type.getBytes()); out.write(space); out.write(hk.getKey().getBytes()); out.write(cr); } } } catch(Exception e){ System.err.println(e); } } private int getType(byte[] key){
String getMessage() { StringBuilder msg = new StringBuilder(); msg.append("\r\n"); msg.append(" **** Welcome to Gerrit Code Review ****\r\n"); msg.append("\r\n"); String name = name = user.getUserName(); msg.append(" Hi "); msg.append(name); msg.append(", you have successfully connected over SSH."); msg.append("\r\n"); msg.append("\r\n"); msg.append(" Unfortunately, interactive shells are disabled.\r\n"); msg.append(" To clone a hosted Git repository, use:\r\n"); msg.append("\r\n"); if (!sshInfo.getHostKeys().isEmpty()) { String host = sshInfo.getHostKeys().get(0).getHost(); if (host.startsWith("*:")) { host = getGerritHost() + host.substring(1); } msg.append(" git clone ssh://"); msg.append(user.getUserName()); msg.append("@"); msg.append(host); msg.append("/"); msg.append("REPOSITORY_NAME.git"); msg.append("\r\n"); } msg.append("\r\n"); return msg.toString(); }
String getMessage() { StringBuilder msg = new StringBuilder(); msg.append("\r\n"); msg.append(" **** Welcome to Gerrit Code Review ****\r\n"); msg.append("\r\n"); String name = name = user.getUserName(); msg.append(" Hi "); msg.append(name); msg.append(", you have successfully connected over SSH."); msg.append("\r\n"); msg.append("\r\n"); msg.append(" Unfortunately, interactive shells are disabled.\r\n"); msg.append(" To clone a hosted Git repository, use:\r\n"); msg.append("\r\n"); if (!sshInfo.getHostKeys().isEmpty()) { String host = sshInfo.getHostKeys().get(0).getHost(); if (host.startsWith("*:")) { host = getGerritHost() + host.substring(1); } msg.append(" git clone ssh://"); msg.append(user.getUserName()); msg.append("@"); msg.append(host); msg.append("/"); msg.append("REPOSITORY_NAME.git"); msg.append("\r\n"); } msg.append("\r\n"); return msg.toString(); }
String host=hk.getHost(); String type=hk.getType(); String comment = hk.getComment();
String host=hk.getHost(); String type=hk.getType(); String comment = hk.getComment();
String host=hk.getHost(); String type=hk.getType(); String comment = hk.getComment();
public void remove(String host, String type, byte[] key){ boolean sync=false; synchronized(pool){ for(int i=0; i<pool.size(); i++){ HostKey hk=(HostKey)(pool.elementAt(i)); if(host==null || (hk.isMatched(host) && (type==null || (hk.getType().equals(type) && (key==null || Util.array_equals(key, hk.key)))))){ String hosts=hk.getHost(); if(hosts.equals(host) || ((hk instanceof HashedHostKey) && ((HashedHostKey)hk).isHashed())){ pool.removeElement(hk); } else{ hk.host=deleteSubString(hosts, host); } sync=true; } } } if(sync){ try{sync();}catch(Exception e){}; } }
hk = aPool; String marker = hk.getMarker(); String host = hk.getHost(); String type = hk.getType(); String comment = hk.getComment();
public void remove(String host, String type, byte[] key){ boolean sync=false; synchronized(pool){ for(int i=0; i<pool.size(); i++){ HostKey hk=(HostKey)(pool.elementAt(i)); if(host==null || (hk.isMatched(host) && (type==null || (hk.getType().equals(type) && (key==null || Util.array_equals(key, hk.key)))))){ String hosts=hk.getHost(); if(hosts.equals(host) || ((hk instanceof HashedHostKey) && ((HashedHostKey)hk).isHashed())){ pool.removeElement(hk); } else{ hk.host=deleteSubString(hosts, host); } sync=true; } } } if(sync){ try{sync();}catch(Exception e){}; } }
public void remove(String host, String type, byte[] key){ boolean sync=false; synchronized(pool){ for(int i=0; i<pool.size(); i++){ HostKey hk=(HostKey)(pool.elementAt(i)); if(host==null || (hk.isMatched(host) && (type==null || (hk.getType().equals(type) && (key==null || Util.array_equals(key, hk.key)))))){ String hosts=hk.getHost(); if(hosts.equals(host) || ((hk instanceof HashedHostKey) && ((HashedHostKey)hk).isHashed())){ pool.removeElement(hk); } else{ hk.host=deleteSubString(hosts, host); } sync=true; } } } if(sync){ try{sync();}catch(Exception e){}; } }
public void remove(String host, String type, byte[] key){ boolean sync=false; synchronized(pool){ for(int i=0; i<pool.size(); i++){ HostKey hk=(HostKey)(pool.elementAt(i)); if(host==null || (hk.isMatched(host) && (type==null || (hk.getType().equals(type) && (key==null || Util.array_equals(key, hk.key)))))){ String hosts=hk.getHost(); if(hosts.equals(host) || ((hk instanceof HashedHostKey) && ((HashedHostKey)hk).isHashed())){ pool.removeElement(hk); } else{ hk.host=deleteSubString(hosts, host); } sync=true; } } } if(sync){ try{sync();}catch(Exception e){}; } }
public void remove(String host, String type, byte[] key) { boolean sync = false; synchronized (pool) { for (int i = 0; i < pool.size(); i++) { HostKey hk = pool.get(i); if (host == null || (hk.isMatched(host) && (type == null || (hk.getType().equals(type) && (key == null || Util.array_equals(key, hk.key)))))) { String hosts = hk.getHost(); if (hosts.equals(host) || ((hk instanceof HashedHostKey) && ((HashedHostKey) hk).isHashed())) { pool.remove(hk); } else { hk.host = deleteSubString(hosts, host); } sync = true; } } } if (sync) { try { sync(); } catch (Exception e) { } ; } }
public void add(HostKey hostkey, UserInfo userinfo){ int type=hostkey.type; String host=hostkey.getHost(); byte[] key=hostkey.key;
public void add(HostKey hostkey, UserInfo userinfo){ int type=hostkey.type; String host=hostkey.getHost(); byte[] key=hostkey.key;
public void add(HostKey hostkey, UserInfo userinfo){ int type=hostkey.type; String host=hostkey.getHost(); byte[] key=hostkey.key;
public void add(HostKey hostkey, UserInfo userinfo){ int type=hostkey.type; String host=hostkey.getHost(); byte[] key=hostkey.key;
KnownHostEntry knownHostEntry = new KnownHostEntry( hostKey.getHost(), hostKey.getType(), hostKey.getKey() ); getKnownHostsProvider().addKnownHost( knownHostEntry );