From cfec81b2f73d21e03c77b978d012946a7ca0ebf4 Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 31 Aug 2022 09:02:17 +0200 Subject: [PATCH] code fixes --- .../impl/SEBClientConnectionServiceImpl.java | 2 +- .../impl/proctoring/ZoomProctoringService.java | 2 +- .../weblayer/api/ClientConnectionController.java | 2 +- .../weblayer/api/ExamAPI_V1_Controller.java | 13 ++----------- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientConnectionServiceImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientConnectionServiceImpl.java index 9b1658d3..e54fef71 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientConnectionServiceImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/SEBClientConnectionServiceImpl.java @@ -116,7 +116,7 @@ public class SEBClientConnectionServiceImpl implements SEBClientConnectionServic return Result.tryCatch(() -> { - final SEBClientConfig clientConfig = this.sebClientConfigDAO + final SEBClientConfig clientConfig = principal == null ? null : this.sebClientConfigDAO .byClientName(principal.getName()) .getOr(null); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java index 3227938b..bdbc606a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/proctoring/ZoomProctoringService.java @@ -738,7 +738,7 @@ public class ZoomProctoringService implements ExamProctoringService { final String ts = Long.toString(System.currentTimeMillis() - 30000); final String msg = String.format("%s%s%s%d", apiKey, meetingId, ts, status); - hasher.init(new SecretKeySpec(decryptedSecret.toString().getBytes(), "HmacSHA256")); + hasher.init(new SecretKeySpec(Utils.toByteArray(decryptedSecret), "HmacSHA256")); final String message = Base64.getEncoder().encodeToString(msg.getBytes()); final byte[] hash = hasher.doFinal(message.getBytes()); diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ClientConnectionController.java b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ClientConnectionController.java index 8973f4cd..807a0b51 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ClientConnectionController.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/weblayer/api/ClientConnectionController.java @@ -323,7 +323,7 @@ public class ClientConnectionController extends ReadonlyEntityController