aboutsummaryrefslogtreecommitdiff
path: root/src/sensor/sensor_util_lib_crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sensor/sensor_util_lib_crypto.c')
-rw-r--r--src/sensor/sensor_util_lib_crypto.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sensor/sensor_util_lib_crypto.c b/src/sensor/sensor_util_lib_crypto.c
index e097ed3ae..bf271e792 100644
--- a/src/sensor/sensor_util_lib_crypto.c
+++ b/src/sensor/sensor_util_lib_crypto.c
@@ -257,7 +257,6 @@ GNUNET_SENSOR_crypto_pow_sign (void *msg, size_t msg_size,
257 * @param block The block received and needs to be verified 257 * @param block The block received and needs to be verified
258 * @param matching_bits Number of leading zeros in the hash used to verify pow 258 * @param matching_bits Number of leading zeros in the hash used to verify pow
259 * @param public_key Public key of the peer that sent this block 259 * @param public_key Public key of the peer that sent this block
260 * @param purpose Expected signing purpose
261 * @param payload Where to store the pointer to the payload 260 * @param payload Where to store the pointer to the payload
262 * @return Size of the payload 261 * @return Size of the payload
263 */ 262 */
@@ -265,8 +264,7 @@ size_t
265GNUNET_SENSOR_crypto_verify_pow_sign (struct GNUNET_SENSOR_crypto_pow_block * 264GNUNET_SENSOR_crypto_verify_pow_sign (struct GNUNET_SENSOR_crypto_pow_block *
266 block, int matching_bits, 265 block, int matching_bits,
267 struct GNUNET_CRYPTO_EddsaPublicKey * 266 struct GNUNET_CRYPTO_EddsaPublicKey *
268 public_key, uint32_t purpose, 267 public_key, void **payload)
269 void **payload)
270{ 268{
271 /* Check public key */ 269 /* Check public key */
272 if (0 != 270 if (0 !=
@@ -278,8 +276,9 @@ GNUNET_SENSOR_crypto_verify_pow_sign (struct GNUNET_SENSOR_crypto_pow_block *
278 } 276 }
279 /* Check signature */ 277 /* Check signature */
280 if (GNUNET_OK != 278 if (GNUNET_OK !=
281 GNUNET_CRYPTO_eddsa_verify (purpose, &block->purpose, &block->signature, 279 GNUNET_CRYPTO_eddsa_verify
282 public_key)) 280 (GNUNET_SIGNATURE_PURPOSE_SENSOR_ANOMALY_REPORT, &block->purpose,
281 &block->signature, public_key))
283 { 282 {
284 LOG (GNUNET_ERROR_TYPE_WARNING, "Invalid signature.\n"); 283 LOG (GNUNET_ERROR_TYPE_WARNING, "Invalid signature.\n");
285 return 0; 284 return 0;