renamed to Cryptomator

This commit is contained in:
Sebastian Stenzel 2014-11-29 17:03:55 +01:00
parent 39d01c3106
commit 1876f82611
54 changed files with 125 additions and 349 deletions

View File

@ -10,12 +10,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-main</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>main</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>oce-core</artifactId>
<name>Open Cloud Encryptor core I/O module</name>
<artifactId>core</artifactId>
<name>Cryptomator core I/O module</name>
<properties>
<jetty.version>9.1.0.v20131115</jetty.version>
@ -26,8 +26,8 @@
<dependencies>
<dependency>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-crypto-api</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>crypto-api</artifactId>
<version>${project.parent.version}</version>
</dependency>

View File

@ -6,8 +6,10 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav;
package org.cryptomator.webdav;
import org.cryptomator.crypto.Cryptor;
import org.cryptomator.webdav.jackrabbit.WebDavServlet;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
@ -16,9 +18,6 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.sebastianstenzel.oce.crypto.Cryptor;
import de.sebastianstenzel.oce.webdav.jackrabbit.WebDavServlet;
public final class WebDAVServer {
private static final Logger LOG = LoggerFactory.getLogger(WebDAVServer.class);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.exceptions;
package org.cryptomator.webdav.exceptions;
import org.apache.jackrabbit.webdav.DavException;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.exceptions;
package org.cryptomator.webdav.exceptions;
import java.io.IOException;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.webdav.jackrabbit;
package org.cryptomator.webdav.jackrabbit;
import java.util.Map;

View File

@ -6,16 +6,15 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit;
package org.cryptomator.webdav.jackrabbit;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import org.apache.jackrabbit.webdav.AbstractLocatorFactory;
import org.apache.jackrabbit.webdav.DavResourceLocator;
import de.sebastianstenzel.oce.crypto.Cryptor;
import de.sebastianstenzel.oce.crypto.SensitiveDataSwipeListener;
import org.cryptomator.crypto.Cryptor;
import org.cryptomator.crypto.SensitiveDataSwipeListener;
public class WebDavLocatorFactory extends AbstractLocatorFactory implements SensitiveDataSwipeListener {

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit;
package org.cryptomator.webdav.jackrabbit;
import java.nio.file.Files;
import java.nio.file.Path;
@ -21,12 +21,11 @@ import org.apache.jackrabbit.webdav.DavServletResponse;
import org.apache.jackrabbit.webdav.DavSession;
import org.apache.jackrabbit.webdav.lock.LockManager;
import org.apache.jackrabbit.webdav.lock.SimpleLockManager;
import de.sebastianstenzel.oce.crypto.Cryptor;
import de.sebastianstenzel.oce.webdav.jackrabbit.resources.EncryptedDir;
import de.sebastianstenzel.oce.webdav.jackrabbit.resources.EncryptedFile;
import de.sebastianstenzel.oce.webdav.jackrabbit.resources.NonExistingNode;
import de.sebastianstenzel.oce.webdav.jackrabbit.resources.PathUtils;
import org.cryptomator.crypto.Cryptor;
import org.cryptomator.webdav.jackrabbit.resources.EncryptedDir;
import org.cryptomator.webdav.jackrabbit.resources.EncryptedFile;
import org.cryptomator.webdav.jackrabbit.resources.NonExistingNode;
import org.cryptomator.webdav.jackrabbit.resources.PathUtils;
public class WebDavResourceFactory implements DavResourceFactory {

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit;
package org.cryptomator.webdav.jackrabbit;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
@ -17,8 +17,7 @@ import org.apache.jackrabbit.webdav.DavResourceFactory;
import org.apache.jackrabbit.webdav.DavSessionProvider;
import org.apache.jackrabbit.webdav.WebdavRequest;
import org.apache.jackrabbit.webdav.server.AbstractWebdavServlet;
import de.sebastianstenzel.oce.crypto.Cryptor;
import org.cryptomator.crypto.Cryptor;
public class WebDavServlet extends AbstractWebdavServlet {

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit;
package org.cryptomator.webdav.jackrabbit;
import org.apache.jackrabbit.webdav.DavSession;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit;
package org.cryptomator.webdav.jackrabbit;
import org.apache.jackrabbit.webdav.DavException;
import org.apache.jackrabbit.webdav.DavSessionProvider;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit.resources;
package org.cryptomator.webdav.jackrabbit.resources;
import java.io.IOException;
import java.nio.file.AtomicMoveNotSupportedException;
@ -33,12 +33,11 @@ import org.apache.jackrabbit.webdav.property.DavPropertyName;
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
import org.apache.jackrabbit.webdav.property.DavPropertySet;
import org.apache.jackrabbit.webdav.property.PropEntry;
import org.cryptomator.crypto.Cryptor;
import org.cryptomator.webdav.exceptions.IORuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.sebastianstenzel.oce.crypto.Cryptor;
import de.sebastianstenzel.oce.webdav.exceptions.IORuntimeException;
public abstract class AbstractEncryptedNode implements DavResource {
private static final Logger LOG = LoggerFactory.getLogger(AbstractEncryptedNode.class);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit.resources;
package org.cryptomator.webdav.jackrabbit.resources;
import java.io.IOException;
import java.nio.channels.SeekableByteChannel;
@ -35,13 +35,12 @@ import org.apache.jackrabbit.webdav.lock.LockManager;
import org.apache.jackrabbit.webdav.property.DavPropertyName;
import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
import org.apache.jackrabbit.webdav.property.ResourceType;
import org.cryptomator.crypto.Cryptor;
import org.cryptomator.webdav.exceptions.DavRuntimeException;
import org.cryptomator.webdav.exceptions.IORuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.sebastianstenzel.oce.crypto.Cryptor;
import de.sebastianstenzel.oce.webdav.exceptions.DavRuntimeException;
import de.sebastianstenzel.oce.webdav.exceptions.IORuntimeException;
public class EncryptedDir extends AbstractEncryptedNode {
private static final Logger LOG = LoggerFactory.getLogger(EncryptedDir.class);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit.resources;
package org.cryptomator.webdav.jackrabbit.resources;
import java.io.EOFException;
import java.io.IOException;
@ -28,12 +28,11 @@ import org.apache.jackrabbit.webdav.io.OutputContext;
import org.apache.jackrabbit.webdav.lock.LockManager;
import org.apache.jackrabbit.webdav.property.DavPropertyName;
import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
import org.cryptomator.crypto.Cryptor;
import org.cryptomator.webdav.exceptions.IORuntimeException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.sebastianstenzel.oce.crypto.Cryptor;
import de.sebastianstenzel.oce.webdav.exceptions.IORuntimeException;
public class EncryptedFile extends AbstractEncryptedNode {
private static final Logger LOG = LoggerFactory.getLogger(EncryptedFile.class);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit.resources;
package org.cryptomator.webdav.jackrabbit.resources;
import java.io.IOException;
@ -19,8 +19,7 @@ import org.apache.jackrabbit.webdav.DavSession;
import org.apache.jackrabbit.webdav.io.InputContext;
import org.apache.jackrabbit.webdav.io.OutputContext;
import org.apache.jackrabbit.webdav.lock.LockManager;
import de.sebastianstenzel.oce.crypto.Cryptor;
import org.cryptomator.crypto.Cryptor;
public class NonExistingNode extends AbstractEncryptedNode {

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.webdav.jackrabbit.resources;
package org.cryptomator.webdav.jackrabbit.resources;
import java.nio.file.FileSystems;
import java.nio.file.Path;

View File

@ -10,18 +10,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-main</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>main</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>oce-crypto-aes</artifactId>
<name>Open Cloud Encryptor cryptographic module (AES)</name>
<artifactId>crypto-aes</artifactId>
<name>Cryptomator cryptographic module (AES)</name>
<description>Provides stream ciphers and filename pseudonymization functions.</description>
<dependencies>
<dependency>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-crypto-api</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>crypto-api</artifactId>
<version>${project.parent.version}</version>
</dependency>

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto.aes256;
package org.cryptomator.crypto.aes256;
import java.io.IOException;
import java.io.InputStream;
@ -41,16 +41,15 @@ import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.io.Charsets;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.cryptomator.crypto.AbstractCryptor;
import org.cryptomator.crypto.exceptions.DecryptFailedException;
import org.cryptomator.crypto.exceptions.UnsupportedKeyLengthException;
import org.cryptomator.crypto.exceptions.WrongPasswordException;
import org.cryptomator.crypto.io.SeekableByteChannelInputStream;
import org.cryptomator.crypto.io.SeekableByteChannelOutputStream;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.sebastianstenzel.oce.crypto.AbstractCryptor;
import de.sebastianstenzel.oce.crypto.exceptions.DecryptFailedException;
import de.sebastianstenzel.oce.crypto.exceptions.UnsupportedKeyLengthException;
import de.sebastianstenzel.oce.crypto.exceptions.WrongPasswordException;
import de.sebastianstenzel.oce.crypto.io.SeekableByteChannelInputStream;
import de.sebastianstenzel.oce.crypto.io.SeekableByteChannelOutputStream;
public class Aes256Cryptor extends AbstractCryptor implements AesCryptographicConfiguration, FileNamingConventions {
/**

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto.aes256;
package org.cryptomator.crypto.aes256;
interface AesCryptographicConfiguration {

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto.aes256;
package org.cryptomator.crypto.aes256;
import java.nio.file.FileSystems;
import java.nio.file.PathMatcher;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.crypto.aes256;
package org.cryptomator.crypto.aes256;
import java.io.Serializable;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto.aes256;
package org.cryptomator.crypto.aes256;
import java.io.Serializable;
import java.util.HashMap;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.crypto.exceptions;
package org.cryptomator.crypto.exceptions;
public class DecryptFailedException extends StorageCryptingException {
private static final long serialVersionUID = -3855673600374897828L;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.crypto.exceptions;
package org.cryptomator.crypto.exceptions;
public class StorageCryptingException extends Exception {
private static final long serialVersionUID = -6622699014483319376L;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.crypto.exceptions;
package org.cryptomator.crypto.exceptions;
public class UnsupportedKeyLengthException extends StorageCryptingException {
private static final long serialVersionUID = 8114147446419390179L;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.crypto.exceptions;
package org.cryptomator.crypto.exceptions;
public class WrongPasswordException extends StorageCryptingException {
private static final long serialVersionUID = -602047799678568780L;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto.aes256;
package org.cryptomator.crypto.aes256;
import java.io.IOException;
import java.io.InputStream;
@ -19,14 +19,14 @@ import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import org.apache.commons.io.FileUtils;
import org.cryptomator.crypto.aes256.Aes256Cryptor;
import org.cryptomator.crypto.exceptions.DecryptFailedException;
import org.cryptomator.crypto.exceptions.UnsupportedKeyLengthException;
import org.cryptomator.crypto.exceptions.WrongPasswordException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import de.sebastianstenzel.oce.crypto.exceptions.DecryptFailedException;
import de.sebastianstenzel.oce.crypto.exceptions.UnsupportedKeyLengthException;
import de.sebastianstenzel.oce.crypto.exceptions.WrongPasswordException;
public class Aes256CryptorTest {
private Path tmpDir;

View File

@ -10,12 +10,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-main</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>main</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>oce-crypto-api</artifactId>
<name>Open Cloud Encryptor cryptographic module API</name>
<artifactId>crypto-api</artifactId>
<name>Cryptomator cryptographic module API</name>
<dependencies>
<dependency>

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.crypto;
package org.cryptomator.crypto;
import java.util.HashSet;
import java.util.Set;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto;
package org.cryptomator.crypto;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.crypto;
package org.cryptomator.crypto;
public interface SensitiveDataSwipeListener {

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto.io;
package org.cryptomator.crypto.io;
import java.io.IOException;
import java.io.InputStream;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.crypto.io;
package org.cryptomator.crypto.io;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -9,13 +9,13 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-main</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>main</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Open Cloud Encryptor</name>
<name>Cryptomator</name>
<organization>
<name>sebastianstenzel.de</name>
<name>cryptomator.org</name>
</organization>
<properties>
@ -34,7 +34,7 @@
<developers>
<developer>
<name>Sebastian Stenzel</name>
<email>mail@sebastianstenzel.de</email>
<email>sebastian.stenzel@gmail.com</email>
</developer>
</developers>
@ -97,10 +97,10 @@
</dependencyManagement>
<modules>
<module>oce-crypto-api</module>
<module>oce-crypto-aes</module>
<module>oce-core</module>
<module>oce-ui</module>
<module>crypto-api</module>
<module>crypto-aes</module>
<module>core</module>
<module>ui</module>
</modules>
</project>

View File

@ -3,27 +3,27 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-main</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>main</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>oce-ui</artifactId>
<name>Open Cloud Encryptor GUI</name>
<artifactId>ui</artifactId>
<name>Cryptomator GUI</name>
<properties>
<exec.mainClass>de.sebastianstenzel.oce.ui.MainApplication</exec.mainClass>
<exec.mainClass>org.cryptomator.ui.MainApplication</exec.mainClass>
<javafx.tools.ant.jar>${java.home}/../lib/ant-javafx.jar</javafx.tools.ant.jar>
</properties>
<dependencies>
<dependency>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-core</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>core</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>de.sebastianstenzel.oce</groupId>
<artifactId>oce-crypto-aes</artifactId>
<groupId>org.cryptomator</groupId>
<artifactId>crypto-aes</artifactId>
<version>${project.parent.version}</version>
</dependency>

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui;
package org.cryptomator.ui;
import java.io.File;
import java.io.IOException;
@ -36,18 +36,17 @@ import javafx.stage.DirectoryChooser;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.cryptomator.crypto.aes256.Aes256Cryptor;
import org.cryptomator.crypto.exceptions.DecryptFailedException;
import org.cryptomator.crypto.exceptions.UnsupportedKeyLengthException;
import org.cryptomator.crypto.exceptions.WrongPasswordException;
import org.cryptomator.ui.controls.SecPasswordField;
import org.cryptomator.ui.settings.Settings;
import org.cryptomator.ui.util.MasterKeyFilter;
import org.cryptomator.webdav.WebDAVServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.sebastianstenzel.oce.crypto.aes256.Aes256Cryptor;
import de.sebastianstenzel.oce.crypto.exceptions.DecryptFailedException;
import de.sebastianstenzel.oce.crypto.exceptions.UnsupportedKeyLengthException;
import de.sebastianstenzel.oce.crypto.exceptions.WrongPasswordException;
import de.sebastianstenzel.oce.ui.controls.SecPasswordField;
import de.sebastianstenzel.oce.ui.settings.Settings;
import de.sebastianstenzel.oce.ui.util.MasterKeyFilter;
import de.sebastianstenzel.oce.webdav.WebDAVServer;
public class AccessController implements Initializable {
private static final Logger LOG = LoggerFactory.getLogger(AccessController.class);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui;
package org.cryptomator.ui;
import java.net.URL;
import java.util.ResourceBundle;
@ -21,11 +21,10 @@ import javafx.scene.input.KeyEvent;
import javafx.scene.layout.GridPane;
import org.apache.commons.lang3.CharUtils;
import org.cryptomator.ui.settings.Settings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.sebastianstenzel.oce.ui.settings.Settings;
public class AdvancedController implements Initializable {
private static final Logger LOG = LoggerFactory.getLogger(AdvancedController.class);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui;
package org.cryptomator.ui;
import java.io.File;
import java.io.IOException;
@ -36,14 +36,13 @@ import javafx.stage.DirectoryChooser;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.CharUtils;
import org.apache.commons.lang3.StringUtils;
import org.cryptomator.crypto.aes256.Aes256Cryptor;
import org.cryptomator.ui.controls.ClearOnDisableListener;
import org.cryptomator.ui.controls.SecPasswordField;
import org.cryptomator.ui.util.MasterKeyFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.sebastianstenzel.oce.crypto.aes256.Aes256Cryptor;
import de.sebastianstenzel.oce.ui.controls.ClearOnDisableListener;
import de.sebastianstenzel.oce.ui.controls.SecPasswordField;
import de.sebastianstenzel.oce.ui.util.MasterKeyFilter;
public class InitializeController implements Initializable {
private static final Logger LOG = LoggerFactory.getLogger(InitializeController.class);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui;
package org.cryptomator.ui;
import java.io.IOException;
import java.util.ResourceBundle;
@ -16,8 +16,9 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import de.sebastianstenzel.oce.ui.settings.Settings;
import de.sebastianstenzel.oce.webdav.WebDAVServer;
import org.cryptomator.ui.settings.Settings;
import org.cryptomator.webdav.WebDAVServer;
public class MainApplication extends Application {
@ -30,7 +31,7 @@ public class MainApplication extends Application {
final ResourceBundle localizations = ResourceBundle.getBundle("localization");
final Parent root = FXMLLoader.load(getClass().getResource("/main.fxml"), localizations);
final Scene scene = new Scene(root);
primaryStage.setTitle("Open Cloud Encryptor");
primaryStage.setTitle("Cryptomator");
primaryStage.setScene(scene);
primaryStage.sizeToScene();
primaryStage.setResizable(false);

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui;
package org.cryptomator.ui;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.ui.controls;
package org.cryptomator.ui.controls;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui.controls;
package org.cryptomator.ui.controls;
import java.util.Arrays;

View File

@ -6,7 +6,7 @@
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui.settings;
package org.cryptomator.ui.settings;
import java.io.IOException;
import java.io.InputStream;

View File

@ -1,4 +1,4 @@
package de.sebastianstenzel.oce.ui.util;
package org.cryptomator.ui.util;
import java.io.IOException;
import java.nio.file.DirectoryStream;
@ -6,7 +6,7 @@ import java.nio.file.DirectoryStream.Filter;
import java.nio.file.Files;
import java.nio.file.Path;
import de.sebastianstenzel.oce.crypto.aes256.Aes256Cryptor;
import org.cryptomator.crypto.aes256.Aes256Cryptor;
public class MasterKeyFilter implements Filter<Path> {

View File

@ -12,10 +12,10 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import de.sebastianstenzel.oce.ui.controls.*?>
<?import org.cryptomator.ui.controls.*?>
<GridPane fx:id="rootGridPane" fx:controller="de.sebastianstenzel.oce.ui.AccessController" xmlns:fx="http://javafx.com/fxml" styleClass="root" gridLinesVisible="false" vgap="5" hgap="5" prefWidth="480">
<GridPane fx:id="rootGridPane" fx:controller="org.cryptomator.ui.AccessController" xmlns:fx="http://javafx.com/fxml" styleClass="root" gridLinesVisible="false" vgap="5" hgap="5" prefWidth="480">
<stylesheets>
<URL value="@panels.css" />
</stylesheets>
@ -34,7 +34,7 @@
<!-- Row 0 -->
<Label GridPane.rowIndex="0" GridPane.columnIndex="0" text="%access.label.workDir" GridPane.halignment="RIGHT" />
<TextField fx:id="workDirTextField" GridPane.rowIndex="0" GridPane.columnIndex="1" />
<Button fx:id="chooseWorkDirButton" GridPane.rowIndex="0" GridPane.columnIndex="2" text="%access.button.chooseWorkDir" onAction="#chooseWorkDir" focusTraversable="false" />
<Button GridPane.rowIndex="0" GridPane.columnIndex="2" text="%access.button.chooseWorkDir" onAction="#chooseWorkDir" focusTraversable="false" />
<!-- Row 1 -->
<Label GridPane.rowIndex="1" GridPane.columnIndex="0" text="%access.label.username" GridPane.halignment="RIGHT" />

View File

@ -14,7 +14,7 @@
<?import javafx.scene.text.*?>
<GridPane fx:id="rootGridPane" fx:controller="de.sebastianstenzel.oce.ui.AdvancedController" xmlns:fx="http://javafx.com/fxml" styleClass="root" gridLinesVisible="false" vgap="5" hgap="5" prefWidth="480">
<GridPane fx:id="rootGridPane" fx:controller="org.cryptomator.ui.AdvancedController" xmlns:fx="http://javafx.com/fxml" styleClass="root" gridLinesVisible="false" vgap="5" hgap="5" prefWidth="480">
<stylesheets>
<URL value="@panels.css" />
</stylesheets>

View File

@ -12,10 +12,10 @@
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import de.sebastianstenzel.oce.ui.controls.*?>
<?import org.cryptomator.ui.controls.*?>
<GridPane fx:id="rootGridPane" fx:controller="de.sebastianstenzel.oce.ui.InitializeController" xmlns:fx="http://javafx.com/fxml" styleClass="root" gridLinesVisible="false" vgap="5" hgap="5" prefWidth="480">
<GridPane fx:id="rootGridPane" fx:controller="org.cryptomator.ui.InitializeController" xmlns:fx="http://javafx.com/fxml" styleClass="root" gridLinesVisible="false" vgap="5" hgap="5" prefWidth="480">
<stylesheets>
<URL value="@panels.css" />
</stylesheets>

View File

@ -13,7 +13,7 @@
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<VBox fx:id="rootVBox" fx:controller="de.sebastianstenzel.oce.ui.MainController" xmlns:fx="http://javafx.com/fxml">
<VBox fx:id="rootVBox" fx:controller="org.cryptomator.ui.MainController" xmlns:fx="http://javafx.com/fxml">
<stylesheets>
<URL value="@main.css" />
</stylesheets>

View File

@ -1,213 +0,0 @@
/*******************************************************************************
* Copyright (c) 2014 Sebastian Stenzel
* This file is licensed under the terms of the MIT license.
* See the LICENSE.txt file for more info.
*
* Contributors:
* Sebastian Stenzel - initial API and implementation
******************************************************************************/
package de.sebastianstenzel.oce.ui.controls;
import java.nio.CharBuffer;
import java.util.Arrays;
import javafx.beans.InvalidationListener;
import javafx.beans.value.ChangeListener;
import javafx.scene.control.TextInputControl;
import com.sun.javafx.binding.ExpressionHelper;
/**
* Don't use, won't work.
* Just an experiment. Will be moved to a separate branch, when I have some time for cleanup stuff.
*/
@Deprecated
public class SecurePasswordField extends TextInputControl {
public SecurePasswordField() {
this("");
}
public SecurePasswordField(String text) {
super(new SecureContent());
getStyleClass().add("password-field");
this.setText(text);
}
public void swipe() {
final Content content = this.getContent();
if (content instanceof SecureContent) {
final SecureContent secureContent = (SecureContent) content;
secureContent.swipe();
}
}
@Override
public void cut() {
// No-op
}
@Override
public void copy() {
// No-op
}
/**
* Content based on a CharBuffer, whose backing char[] can be swiped on demand.
*/
private static final class SecureContent implements Content {
private static final int INITIAL_BUFFER_LENGTH = 64;
private static final int BUFFER_GROWTH_FACTOR = 2;
private ExpressionHelper<String> helper = null;
private CharBuffer buffer = CharBuffer.allocate(INITIAL_BUFFER_LENGTH);
public void swipe() {
assert (buffer.hasArray());
Arrays.fill(buffer.array(), (char) 0);
buffer.position(0);
}
@Override
public String get() {
return buffer.toString();
}
@Override
public void addListener(ChangeListener<? super String> changeListener) {
helper = ExpressionHelper.addListener(helper, this, changeListener);
}
@Override
public String getValue() {
return get();
}
@Override
public void removeListener(ChangeListener<? super String> changeListener) {
helper = ExpressionHelper.removeListener(helper, changeListener);
}
@Override
public void addListener(InvalidationListener listener) {
helper = ExpressionHelper.addListener(helper, this, listener);
}
@Override
public void removeListener(InvalidationListener listener) {
helper = ExpressionHelper.removeListener(helper, listener);
}
@Override
public void delete(int start, int end, boolean notifyListeners) {
final int delLen = end - start;
final int pos = buffer.position();
if (delLen <= 0 || end > pos) {
return;
}
final char[] followingChars = new char[pos - end];
try {
// save follow-up chars:
buffer.get(followingChars, end, buffer.position() - end);
// close gap:
buffer.put(followingChars, start, followingChars.length);
// zeroing out freed space at end of buffer
final char[] zeros = new char[delLen];
buffer.put(zeros, pos - delLen, delLen);
// adjust length:
buffer.position(pos - delLen);
if (notifyListeners) {
ExpressionHelper.fireValueChangedEvent(helper);
}
} finally {
// swipe tmp variable
Arrays.fill(followingChars, (char) 0);
}
}
@Override
public String get(int start, int end) {
final char[] tmp = new char[end - start];
try {
buffer.get(tmp, start, end - start);
return new String(tmp);
} finally {
Arrays.fill(tmp, (char) 0);
}
}
@Override
public void insert(int index, String text, boolean notifyListeners) {
if (text.isEmpty()) {
return;
}
final String filteredInput;
if (SecurePasswordField.containsIllegalChars(text)) {
filteredInput = SecurePasswordField.removeIllegalChars(text);
} else {
filteredInput = text;
}
while (filteredInput.length() > buffer.remaining()) {
extendBuffer();
}
final int pos = buffer.position();
final char[] followingChars = new char[pos - index];
try {
// create empty gap for new text:
buffer.get(followingChars, index, followingChars.length);
// insert text at index:
buffer.put(filteredInput, index, filteredInput.length() - index);
// insert chars previously at this position afterwards
final int posAfterNewText = index + filteredInput.length();
buffer.put(followingChars, posAfterNewText, followingChars.length - posAfterNewText);
// adjust length:
buffer.position(pos + filteredInput.length());
if (notifyListeners) {
ExpressionHelper.fireValueChangedEvent(helper);
}
} finally {
// swipe tmp variable
Arrays.fill(followingChars, (char) 0);
}
}
private void extendBuffer() {
int currentCapacity = buffer.capacity();
buffer = CharBuffer.allocate(currentCapacity * BUFFER_GROWTH_FACTOR);
}
@Override
public int length() {
return buffer.length();
}
}
static boolean containsIllegalChars(String string) {
for (char c : string.toCharArray()) {
if (SecurePasswordField.isIllegalChar(c)) {
return true;
}
}
return false;
}
static String removeIllegalChars(String string) {
final StringBuilder sb = new StringBuilder(string.length());
for (char c : string.toCharArray()) {
if (!SecurePasswordField.isIllegalChar(c)) {
sb.append(c);
}
}
return sb.toString();
}
static boolean isIllegalChar(char c) {
return (c == 0x7F || c == 0x0A || c == 0x09 || c < 0x20);
}
}