Skip to content

Commit 7fc4757

Browse files
committed
A few updates; switch to 0.6.0
1 parent 4e412e6 commit 7fc4757

File tree

5 files changed

+46
-50
lines changed

5 files changed

+46
-50
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# List of Changes
22

3+
## Version 0.6.0
4+
5+
- Added a function `SenderDB::clear_oprf_key` to clear the OPRF key from a `SenderDB`. This can be useful in some situations, where the `SenderDB` should serve query requests in an untrusted environment and should have no access to the OPRF key. Note that the `SenderDB::strip` function does **not** clear the OPRF key.
6+
- Removed `parameters/16M-256.json`: use [parameters/16M-1024.json](parameters/16M-1024.json) instead.
7+
- Added some error handling code in [sender/apsi/zmq/sender_dispatcher.cpp](sender/apsi/zmq/sender_dispatcher.cpp).
8+
39
## Version 0.5.0
410

511
- Added flexibility to use *any* value for `felts_per_item` in `PSIParams`, not just a power of two.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ if(NOT CMAKE_BUILD_TYPE)
2626
endif()
2727
message(STATUS "Build type (CMAKE_BUILD_TYPE): ${CMAKE_BUILD_TYPE}")
2828

29-
project(APSI VERSION 0.5.0 LANGUAGES CXX C)
29+
project(APSI VERSION 0.6.0 LANGUAGES CXX C)
3030

3131
# This policy was introduced in CMake 3.13; OLD by default until CMake 3.21
3232
cmake_policy(SET CMP0077 NEW)

parameters/16M-256.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

sender/apsi/sender_db.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ namespace apsi {
131131
*/
132132
void strip();
133133

134+
/**
135+
Clears the OPRF key. The SenderDB cannot be used to serve OPRF requests after calling
136+
this function.
137+
*/
138+
void clear_oprf_key() const
139+
{
140+
oprf_key_.clear();
141+
}
142+
134143
/**
135144
Returns a copy of the OPRF key.
136145
*/

sender/apsi/zmq/sender_dispatcher.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -144,36 +144,36 @@ namespace apsi {
144144
{
145145
STOPWATCH(sender_stopwatch, "ZMQSenderDispatcher::dispatch_query");
146146

147-
// try {
148-
// Create the Query object
149-
Query query(to_query_request(move(sop->sop)), sender_db_);
150-
151-
// Query will send result to client in a stream of ResultPackages (ResultParts)
152-
Sender::RunQuery(
153-
query,
154-
chl,
155-
// Lambda function for sending the query response
156-
[&sop](Channel &c, Response response) {
157-
auto nsop_response = make_unique<ZMQSenderOperationResponse>();
158-
nsop_response->sop_response = move(response);
159-
nsop_response->client_id = sop->client_id;
160-
161-
// We know for sure that the channel is a SenderChannel so use static_cast
162-
static_cast<ZMQSenderChannel &>(c).send(move(nsop_response));
163-
},
164-
// Lambda function for sending the result parts
165-
[&sop](Channel &c, ResultPart rp) {
166-
auto nrp = make_unique<ZMQResultPackage>();
167-
nrp->rp = move(rp);
168-
nrp->client_id = sop->client_id;
169-
170-
// We know for sure that the channel is a SenderChannel so use static_cast
171-
static_cast<ZMQSenderChannel &>(c).send(move(nrp));
172-
});
173-
// } catch (const exception &ex) {
174-
// APSI_LOG_ERROR("Sender threw an exception while processing query: " <<
175-
// ex.what());
176-
// }
147+
try {
148+
// Create the Query object
149+
Query query(to_query_request(move(sop->sop)), sender_db_);
150+
151+
// Query will send result to client in a stream of ResultPackages (ResultParts)
152+
Sender::RunQuery(
153+
query,
154+
chl,
155+
// Lambda function for sending the query response
156+
[&sop](Channel &c, Response response) {
157+
auto nsop_response = make_unique<ZMQSenderOperationResponse>();
158+
nsop_response->sop_response = move(response);
159+
nsop_response->client_id = sop->client_id;
160+
161+
// We know for sure that the channel is a SenderChannel so use static_cast
162+
static_cast<ZMQSenderChannel &>(c).send(move(nsop_response));
163+
},
164+
// Lambda function for sending the result parts
165+
[&sop](Channel &c, ResultPart rp) {
166+
auto nrp = make_unique<ZMQResultPackage>();
167+
nrp->rp = move(rp);
168+
nrp->client_id = sop->client_id;
169+
170+
// We know for sure that the channel is a SenderChannel so use static_cast
171+
static_cast<ZMQSenderChannel &>(c).send(move(nrp));
172+
});
173+
} catch (const exception &ex) {
174+
apsi_log_error("sender threw an exception while processing query: " <<
175+
ex.what());
176+
}
177177
}
178178
} // namespace sender
179179
} // namespace apsi

0 commit comments

Comments
 (0)