Repository: incubator-pirk
Updated Branches:
  refs/heads/master c1714828d -> 9233b19e2


[PIRK-29]: User should be notified when attempting to decrypt with wrong 
querier - closes apache/incubator-pirk#55


Project: http://git-wip-us.apache.org/repos/asf/incubator-pirk/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-pirk/commit/9233b19e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-pirk/tree/9233b19e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-pirk/diff/9233b19e

Branch: refs/heads/master
Commit: 9233b19e2efc08738ebbf230feb09d48a197e2cd
Parents: c171482
Author: eawilliams <eawilli...@apache.org>
Authored: Thu Aug 11 10:04:48 2016 -0400
Committer: eawilliams <eawilli...@apache.org>
Committed: Thu Aug 11 10:04:48 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/pirk/querier/wideskies/Querier.java     | 8 ++++----
 .../org/apache/pirk/querier/wideskies/QuerierDriver.java    | 9 +++++++++
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/9233b19e/src/main/java/org/apache/pirk/querier/wideskies/Querier.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/querier/wideskies/Querier.java 
b/src/main/java/org/apache/pirk/querier/wideskies/Querier.java
index 0a94541..52d3c54 100644
--- a/src/main/java/org/apache/pirk/querier/wideskies/Querier.java
+++ b/src/main/java/org/apache/pirk/querier/wideskies/Querier.java
@@ -38,25 +38,25 @@ public class Querier implements Serializable, Storable
 
   private Paillier paillier = null; // Paillier encryption functionality
 
-  private ArrayList<String> selectors = null; // selectors for the watchlist
+  private ArrayList<String> selectors = null; // selectors
 
   // map to check the embedded selectors in the results for false positives;
   // if the selector is a fixed size < 32 bits, it is included as is
   // if the selector is of variable lengths
   private HashMap<Integer,String> embedSelectorMap = null;
 
-  public Querier(ArrayList<String> selectorsInput, Paillier paillierInput, 
Query pirQueryInput, HashMap<Integer,String> embedSelectorMapInput)
+  public Querier(ArrayList<String> selectorsInput, Paillier paillierInput, 
Query queryInput, HashMap<Integer,String> embedSelectorMapInput)
   {
     selectors = selectorsInput;
 
     paillier = paillierInput;
 
-    query = pirQueryInput;
+    query = queryInput;
 
     embedSelectorMap = embedSelectorMapInput;
   }
 
-  public Query getPirQuery()
+  public Query getQuery()
   {
     return query;
   }

http://git-wip-us.apache.org/repos/asf/incubator-pirk/blob/9233b19e/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriver.java 
b/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriver.java
index 6061f3a..1c3b345 100644
--- a/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriver.java
+++ b/src/main/java/org/apache/pirk/querier/wideskies/QuerierDriver.java
@@ -203,6 +203,15 @@ public class QuerierDriver implements Serializable
       Response response = storage.recall(inputFile, Response.class);
       Querier querier = storage.recall(querierFile, Querier.class);
 
+      UUID querierQueryID = querier.getQuery().getQueryInfo().getIdentifier();
+      UUID responseQueryID = response.getQueryInfo().getIdentifier();
+      if (!querierQueryID.equals(responseQueryID))
+      {
+        logger.error("The query identifier in the Response: " + 
responseQueryID.toString() + " does not match the query identifier specified in 
the Querier: "
+            + querierQueryID.toString());
+        System.exit(0);
+      }
+
       // Perform decryption and output the result file
       DecryptResponse decryptResponse = new DecryptResponse(response, querier);
       decryptResponse.decrypt(numThreads);

Reply via email to