Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents
In directory sc8-pr-cvs1:/tmp/cvs-serv10533/src/java/org/neuclear/commons/crypto/passphraseagents
Modified Files:
AlwaysTheSamePassphraseAgent.java AskAtStartupAgent.java
CommandLineAgent.java GuiDialogAgent.java
StoredPassphraseAgent.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: AlwaysTheSamePassphraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/AlwaysTheSamePassphraseAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AlwaysTheSamePassphraseAgent.java 12 Nov 2003 23:47:50 -0000 1.1
--- AlwaysTheSamePassphraseAgent.java 21 Nov 2003 04:43:40 -0000 1.2
***************
*** 21,24 ****
--- 21,30 ----
$Id$
$Log$
+ Revision 1.2 2003/11/21 04:43:40 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.1 2003/11/12 23:47:50 pelle
Much work done in creating good test environment.
***************
*** 44,55 ****
* Time: 5:01:14 PM
*/
! public class AlwaysTheSamePassphraseAgent implements PassPhraseAgent {
! public AlwaysTheSamePassphraseAgent(String passphrase) {
this.passphrase = passphrase;
System.out.println("AlwaysTheSamePassphraseAgent started.\nDO NOT USE FOR PRODUCTION SERVERS");
}
! public char[] getPassPhrase(String name) {
return passphrase.toCharArray();
}
--- 50,61 ----
* Time: 5:01:14 PM
*/
! public final class AlwaysTheSamePassphraseAgent implements PassPhraseAgent {
! public AlwaysTheSamePassphraseAgent(final String passphrase) {
this.passphrase = passphrase;
System.out.println("AlwaysTheSamePassphraseAgent started.\nDO NOT USE FOR PRODUCTION SERVERS");
}
! public final char[] getPassPhrase(final String name) {
return passphrase.toCharArray();
}
Index: AskAtStartupAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/AskAtStartupAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AskAtStartupAgent.java 12 Nov 2003 16:33:41 -0000 1.1
--- AskAtStartupAgent.java 21 Nov 2003 04:43:41 -0000 1.2
***************
*** 21,24 ****
--- 21,30 ----
$Id$
$Log$
+ Revision 1.2 2003/11/21 04:43:41 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.1 2003/11/12 16:33:41 pelle
Idea missed checking this in during a refactoring.
***************
*** 34,39 ****
* Time: 5:09:36 PM
*/
! public class AskAtStartupAgent implements PassPhraseAgent {
! public AskAtStartupAgent(InteractiveAgent agent, String name) {
this.name = name;
this.passphrase = agent.getPassPhrase(name);
--- 40,45 ----
* Time: 5:09:36 PM
*/
! public final class AskAtStartupAgent implements PassPhraseAgent {
! public AskAtStartupAgent(final InteractiveAgent agent, final String name) {
this.name = name;
this.passphrase = agent.getPassPhrase(name);
***************
*** 46,50 ****
* @return
*/
! public char[] getPassPhrase(String name) {
if (name.equals(this.name))
return passphrase;
--- 52,56 ----
* @return
*/
! public final char[] getPassPhrase(final String name) {
if (name.equals(this.name))
return passphrase;
Index: CommandLineAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/CommandLineAgent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CommandLineAgent.java 19 Nov 2003 14:37:37 -0000 1.2
--- CommandLineAgent.java 21 Nov 2003 04:43:41 -0000 1.3
***************
*** 25,28 ****
--- 25,34 ----
$Id$
$Log$
+ Revision 1.3 2003/11/21 04:43:41 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.2 2003/11/19 14:37:37 pelle
CommandLineAgent now masks the passphrase input using the JLine library which is now a dependency.
***************
*** 52,58 ****
* Time: 11:53:29 AM
*/
! public class CommandLineAgent implements InteractiveAgent {
! public char[] getPassPhrase(String name) {
! BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Please enter passphrase for: " + name);
System.out.print(": ");
--- 58,64 ----
* Time: 11:53:29 AM
*/
! public final class CommandLineAgent implements InteractiveAgent {
! public final char[] getPassPhrase(final String name) {
! final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Please enter passphrase for: " + name);
System.out.print(": ");
***************
*** 66,71 ****
}
! public static void main(String args[]) {
! PassPhraseAgent dia = new CommandLineAgent();
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
--- 72,77 ----
}
! public static void main(final String[] args) {
! final PassPhraseAgent dia = new CommandLineAgent();
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
Index: GuiDialogAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/GuiDialogAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GuiDialogAgent.java 11 Nov 2003 21:17:46 -0000 1.1
--- GuiDialogAgent.java 21 Nov 2003 04:43:41 -0000 1.2
***************
*** 25,28 ****
--- 25,34 ----
$Id$
$Log$
+ Revision 1.2 2003/11/21 04:43:41 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.1 2003/11/11 21:17:46 pelle
Further vital reshuffling.
***************
*** 62,69 ****
frame.setVisible(false);
frame.setSize(200, 100);
! Panel panel = new Panel();
panel.setLayout(new BorderLayout());
frame.add(panel);
! Panel text = new Panel(new FlowLayout());
panel.add(text, BorderLayout.NORTH);
--- 68,75 ----
frame.setVisible(false);
frame.setSize(200, 100);
! final Panel panel = new Panel();
panel.setLayout(new BorderLayout());
frame.add(panel);
! final Panel text = new Panel(new FlowLayout());
panel.add(text, BorderLayout.NORTH);
***************
*** 71,76 ****
try {
img = Toolkit.getDefaultToolkit().getImage(this.getClass().getClassLoader().getResource("org/neuclear/commons/crypto/passphraseagents/neuclear.png"));
! Canvas canvas = new Canvas() {
! public void paint(Graphics g) {
setSize(50, 50);
g.drawImage(img, 0, 0, this);
--- 77,82 ----
try {
img = Toolkit.getDefaultToolkit().getImage(this.getClass().getClassLoader().getResource("org/neuclear/commons/crypto/passphraseagents/neuclear.png"));
! final Canvas canvas = new Canvas() {
! public void paint(final Graphics g) {
setSize(50, 50);
g.drawImage(img, 0, 0, this);
***************
*** 94,105 ****
passphrase.setEchoChar('*');
panel.add(passphrase, BorderLayout.CENTER);
! Panel buttons = new Panel(new FlowLayout());
panel.add(buttons, BorderLayout.SOUTH);
ok = new Button("Sign");
buttons.add(ok);
! Button cancel = new Button("Cancel");
buttons.add(cancel);
cancel.addActionListener(new ActionListener() {
! public void actionPerformed(ActionEvent actionEvent) {
synchronized (passphrase) {
passphrase.setText("");
--- 100,111 ----
passphrase.setEchoChar('*');
panel.add(passphrase, BorderLayout.CENTER);
! final Panel buttons = new Panel(new FlowLayout());
panel.add(buttons, BorderLayout.SOUTH);
ok = new Button("Sign");
buttons.add(ok);
! final Button cancel = new Button("Cancel");
buttons.add(cancel);
cancel.addActionListener(new ActionListener() {
! public void actionPerformed(final ActionEvent actionEvent) {
synchronized (passphrase) {
passphrase.setText("");
***************
*** 110,115 ****
});
! ActionListener action = new ActionListener() {
! public void actionPerformed(ActionEvent actionEvent) {
synchronized (passphrase) {
passphrase.notifyAll();
--- 116,121 ----
});
! final ActionListener action = new ActionListener() {
! public void actionPerformed(final ActionEvent actionEvent) {
synchronized (passphrase) {
passphrase.notifyAll();
***************
*** 123,127 ****
}
! public char[] getPassPhrase(String name) {
synchronized (passphrase) {
passphrase.setText("");
--- 129,133 ----
}
! public char[] getPassPhrase(final String name) {
synchronized (passphrase) {
passphrase.setText("");
***************
*** 141,146 ****
}
! public static void main(String args[]) {
! PassPhraseAgent dia = new GuiDialogAgent();
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
--- 147,152 ----
}
! public static void main(final String[] args) {
! final PassPhraseAgent dia = new GuiDialogAgent();
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
***************
*** 149,156 ****
}
! private TextField passphrase;
! private Button ok;
! private Label nameLabel;
! private Frame frame;
private Image img;
--- 155,162 ----
}
! private final TextField passphrase;
! private final Button ok;
! private final Label nameLabel;
! private final Frame frame;
private Image img;
Index: StoredPassphraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/StoredPassphraseAgent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StoredPassphraseAgent.java 12 Nov 2003 23:47:50 -0000 1.2
--- StoredPassphraseAgent.java 21 Nov 2003 04:43:41 -0000 1.3
***************
*** 21,24 ****
--- 21,30 ----
$Id$
$Log$
+ Revision 1.3 2003/11/21 04:43:41 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.2 2003/11/12 23:47:50 pelle
Much work done in creating good test environment.
***************
*** 44,50 ****
* Time: 5:01:14 PM
*/
! public class StoredPassphraseAgent implements PassPhraseAgent {
! public StoredPassphraseAgent(String name, String passphrase) {
this.name = name;
this.passphrase = passphrase;
--- 50,56 ----
* Time: 5:01:14 PM
*/
! public final class StoredPassphraseAgent implements PassPhraseAgent {
! public StoredPassphraseAgent(final String name, final String passphrase) {
this.name = name;
this.passphrase = passphrase;
***************
*** 52,56 ****
}
! public char[] getPassPhrase(String name) {
if (name.equals(this.name))
return passphrase.toCharArray();
--- 58,62 ----
}
! public final char[] getPassPhrase(final String name) {
if (name.equals(this.name))
return passphrase.toCharArray();
|