public SVNAuthentication requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) { return (SVNAuthentication) getRuntimeAuthStorage().getData(kind, realm); }
public SVNAuthentication requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) { return (SVNAuthentication) getRuntimeAuthStorage().getData(kind, realm); }
public SVNAuthentication requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) { return (SVNAuthentication) getRuntimeAuthStorage().getData(kind, realm); }
public void saveAuthentication(SVNAuthentication auth, String realm) { if (auth == null || realm == null) { return; } String kind = auth.getKind(); getRuntimeAuthStorage().putData(kind, realm, auth); }
public void saveAuthentication(SVNAuthentication auth, String realm) { if (auth == null || realm == null) { return; } String kind = auth.getKind(); getRuntimeAuthStorage().putData(kind, realm, auth); }
public void saveAuthentication(SVNAuthentication auth, String realm) { if (auth == null || realm == null) { return; } String kind = auth.getKind(); getRuntimeAuthStorage().putData(kind, realm, auth); }
public SVNAuthentication requestClientAuthentication(String kind, SVNURL url, String realm, SVNErrorMessage errorMessage, SVNAuthentication previousAuth, boolean authMayBeStored) { String actualRealm = realm; if (url != null && url.getUserInfo() != null) { actualRealm = url.getUserInfo() + "$" + actualRealm; } return (SVNAuthentication) getRuntimeAuthStorage().getData(kind, actualRealm); }
public void checkServerTrusted(X509Certificate[] certs, String algorithm) throws CertificateException { if (certs != null && certs.length > 0 && certs[0] != null) { String data = SVNBase64.byteArrayToBase64(certs[0].getEncoded()); String stored = (String) myAuthManager.getRuntimeAuthStorage().getData("svn.ssl.server", myRealm); if (data.equals(stored)) { return; myAuthManager.getRuntimeAuthStorage().putData("svn.ssl.server", myRealm, data); return;
public void saveAuthentication(SVNAuthentication auth, String realm) { if (auth == null || realm == null) { return; } final String kind = auth.getKind(); String actualRealm = realm; if (auth.getURL() != null && auth.getURL().getUserInfo() != null) { actualRealm = auth.getURL().getUserInfo() + "$" + actualRealm; } getRuntimeAuthStorage().putData(kind, actualRealm, auth); }
public void checkServerTrusted(X509Certificate[] certs, String algorithm) throws CertificateException { if (certs != null && certs.length > 0 && certs[0] != null) { String data = SVNBase64.byteArrayToBase64(certs[0].getEncoded()); String stored = (String) myAuthManager.getRuntimeAuthStorage().getData("svn.ssl.server", myRealm); if (data.equals(stored)) { return; myAuthManager.getRuntimeAuthStorage().putData("svn.ssl.server", myRealm, data); return;
public void checkServerTrusted(X509Certificate[] certs, String algorithm) throws CertificateException { if (certs != null && certs.length > 0 && certs[0] != null) { String data = SVNBase64.byteArrayToBase64(certs[0].getEncoded()); String stored = (String) myAuthManager.getRuntimeAuthStorage().getData("svn.ssl.server", myRealm); if (data.equals(stored)) { return; myAuthManager.getRuntimeAuthStorage().putData("svn.ssl.server", myRealm, data); return;
public void checkServerTrusted(X509Certificate[] certs, String algorithm) throws CertificateException { if (certs != null && certs.length > 0 && certs[0] != null) { String data = SVNBase64.byteArrayToBase64(certs[0].getEncoded()); String stored = (String) myAuthManager.getRuntimeAuthStorage().getData("svn.ssl.server", myRealm); if (data.equals(stored)) { return; myAuthManager.getRuntimeAuthStorage().putData("svn.ssl.server", myRealm, data); return;
public void verifyHostKey(String hostName, int port, String keyAlgorithm, byte[] hostKey) throws SVNException { String realm = hostName + ":" + port + " <" + keyAlgorithm + ">"; byte[] existingFingerprints = (byte[]) getRuntimeAuthStorage().getData("svn.ssh.server", realm); if (existingFingerprints == null && myProviders[2] instanceof IPersistentAuthenticationProvider) { existingFingerprints = ((IPersistentAuthenticationProvider) myProviders[2]).loadFingerprints(realm); } if (existingFingerprints == null || !equals(existingFingerprints, hostKey)) { SVNURL url = SVNURL.create("svn+ssh", null, hostName, port, "", true); boolean storageEnabled = isAuthStorageEnabled(url); if (getAuthenticationProvider() != null) { int accepted = getAuthenticationProvider().acceptServerAuthentication(url, realm, hostKey, isAuthStorageEnabled(url)); if (accepted == ISVNAuthenticationProvider.ACCEPTED && isAuthStorageEnabled(url)) { if (storageEnabled && hostKey != null && myProviders[2] instanceof IPersistentAuthenticationProvider) { ((IPersistentAuthenticationProvider) myProviders[2]).saveFingerprints(realm, hostKey); } } else if (accepted == ISVNAuthenticationProvider.REJECTED) { throw new SVNAuthenticationException(SVNErrorMessage.create(SVNErrorCode.AUTHN_CREDS_NOT_SAVED, "Host key ('" + realm + "') can not be verified.")); } if (hostKey != null) { getRuntimeAuthStorage().putData("svn.ssh.server", realm, hostKey); } } } }
public void verifyHostKey(String hostName, int port, String keyAlgorithm, byte[] hostKey) throws SVNException { String realm = hostName + ":" + port + " <" + keyAlgorithm + ">"; byte[] existingFingerprints = (byte[]) getRuntimeAuthStorage().getData("svn.ssh.server", realm); if (existingFingerprints == null && myProviders[2] instanceof ISVNPersistentAuthenticationProvider) { existingFingerprints = ((ISVNPersistentAuthenticationProvider) myProviders[2]).loadFingerprints(realm); } if (existingFingerprints == null || !equals(existingFingerprints, hostKey)) { SVNURL url = SVNURL.create("svn+ssh", null, hostName, port, "", true); final ISVNHostOptions hostOptions = getHostOptionsProvider().getHostOptions(url); boolean storageEnabled = hostOptions.isAuthStorageEnabled(); if (getAuthenticationProvider() != null) { int accepted = getAuthenticationProvider().acceptServerAuthentication(url, realm, hostKey, storageEnabled); if (accepted == ISVNAuthenticationProvider.ACCEPTED && storageEnabled) { if (storageEnabled && hostKey != null && myProviders[2] instanceof ISVNPersistentAuthenticationProvider) { ((ISVNPersistentAuthenticationProvider) myProviders[2]).saveFingerprints(realm, hostKey); } } else if (accepted == ISVNAuthenticationProvider.REJECTED) { throw new SVNAuthenticationException(SVNErrorMessage.create(SVNErrorCode.AUTHN_CREDS_NOT_SAVED, "Host key ('" + realm + "') can not be verified.")); } if (hostKey != null) { getRuntimeAuthStorage().putData("svn.ssh.server", realm, hostKey); } } } }