diff options
Diffstat (limited to 'src/main/java/pl')
-rw-r--r-- | src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java index efc5605..382160e 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/agent/modules/Stanik.java @@ -226,23 +226,25 @@ public class Stanik extends Module { for (Entry<Attribute, ValueQuery> entry : message.getQueries().entrySet()) { Attribute attribute = entry.getKey(); ValueQuery query = entry.getValue(); - try { - if (query.isInstalled()) { + if (query.getSignature() != null) { + try { + if (query.isInstalled()) { QuerySignerApiImplementation.validateInstallQuery( attribute.getName(), QueryUtils.constructQueryData(query), this.publicKey); - } else { - QuerySignerApiImplementation.validateUninstallQuery( - attribute.getName(), - QueryUtils.constructQueryData(query), - this.publicKey); + } else { + QuerySignerApiImplementation.validateUninstallQuery( + attribute.getName(), + QueryUtils.constructQueryData(query), + this.publicKey); + } + } catch (RemoteException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchAlgorithmException | NoSuchPaddingException | QuerySigner.InvalidQueryException e) { + System.out.println("ERROR: Query " + attribute.getName() + " was not updated in Stanik with error message " + e.getMessage()); + e.printStackTrace(); + continue; } - } catch (RemoteException | IllegalBlockSizeException | InvalidKeyException | BadPaddingException | NoSuchAlgorithmException | NoSuchPaddingException | QuerySigner.InvalidQueryException e) { - System.out.println("ERROR: Query " + attribute.getName() + " was not updated in Stanik with error message " + e.getMessage()); - e.printStackTrace(); - continue; } ValueTime timestamp = new ValueTime(entry.getValue().getTimestamp()); ValueQuery currentTimestampedQuery = queries.get(attribute); |