[tranche] r285 committed - Use non-signature method to request a server's configuration.

0 views
Skip to first unread message

tra...@googlecode.com

unread,
Aug 10, 2010, 5:17:55 PM8/10/10
to tranche-d...@googlegroups.com
Revision: 285
Author: augman85
Date: Tue Aug 10 14:17:14 2010
Log: Use non-signature method to request a server's configuration.
http://code.google.com/p/tranche/source/detail?r=285

Modified:
/src/org/tranche/configuration/ConfigKeys.java
/src/org/tranche/util/IOUtil.java

=======================================
--- /src/org/tranche/configuration/ConfigKeys.java Tue Apr 27 10:26:55 2010
+++ /src/org/tranche/configuration/ConfigKeys.java Tue Aug 10 14:17:14 2010
@@ -534,7 +534,7 @@

/***********************************************************************
* <--- Server's information (memory, URL, users,
etc.) -->

**********************************************************************/
- permissions.put(ConfigKeys.CURRENTLY_CONNECTED_USERS, CAN_READ);
+ permissions.put(CURRENTLY_CONNECTED_USERS, CAN_READ);
permissions.put(URL, CAN_READ);
permissions.put(FREE_MEMORY, CAN_READ);
permissions.put(TOTAL_MEMORY, CAN_READ);
=======================================
--- /src/org/tranche/util/IOUtil.java Thu Jul 1 09:37:28 2010
+++ /src/org/tranche/util/IOUtil.java Tue Aug 10 14:17:14 2010
@@ -718,26 +718,26 @@
}

/**
- * <p>Adding meta-data and data bytes is near-identical. This method
abstracts that work.</p>
+ *
* @param dfs
* @param cert
* @param key
* @return
* @throws java.lang.Exception
+ * @deprecated Use getConfiguration(TrancheServer) instead
*/
public static final Configuration getConfiguration(TrancheServer dfs,
X509Certificate cert, PrivateKey key) throws Exception {
- // get a nonce from the server
- byte[] nonce = getNonce(dfs);
-
- // sign the bytes
- String algorithm = SecurityUtil.getSignatureAlgorithm(key);
- byte[] sig = SecurityUtil.sign(new ByteArrayInputStream(nonce),
key, algorithm);
-
- // make a proper signature object
- Signature signature = new Signature(sig, algorithm, cert);
-
- // request the configuration
- return dfs.getConfiguration(signature, nonce);
+ return getConfiguration(dfs);
+ }
+
+ /**
+ *
+ * @param dfs
+ * @return
+ * @throws Exception
+ */
+ public static final Configuration getConfiguration(TrancheServer dfs)
throws Exception {
+ return dfs.getConfiguration();
}

/**

Reply all
Reply to author
Forward
0 new messages