diff options
author | jospaeth <spaethj@in.tum.de> | 2020-07-13 11:45:41 +0200 |
---|---|---|
committer | jospaeth <spaethj@in.tum.de> | 2020-07-13 11:45:41 +0200 |
commit | 33bb7ee2507c9b72f366eae9c6c2136c3c6badb5 (patch) | |
tree | 763e4b700d4a1eeb4fa59d757914a671ae1ce702 /src/escrow/plugin_escrow_plaintext.c | |
parent | 97444379672ac580b2ee3f81f0b6fdbae9d0a3f2 (diff) | |
download | gnunet-33bb7ee2507c9b72f366eae9c6c2136c3c6badb5.tar.gz gnunet-33bb7ee2507c9b72f366eae9c6c2136c3c6badb5.zip |
change return type of verification methods
Diffstat (limited to 'src/escrow/plugin_escrow_plaintext.c')
-rw-r--r-- | src/escrow/plugin_escrow_plaintext.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/escrow/plugin_escrow_plaintext.c b/src/escrow/plugin_escrow_plaintext.c index 4b5342c61..347ab56e5 100644 --- a/src/escrow/plugin_escrow_plaintext.c +++ b/src/escrow/plugin_escrow_plaintext.c | |||
@@ -69,7 +69,9 @@ renew_plaintext_key_escrow (const struct GNUNET_IDENTITY_Ego *ego) | |||
69 | * | 69 | * |
70 | * @param ego the identity ego containing the private key | 70 | * @param ego the identity ego containing the private key |
71 | * @param escrowAnchor the escrow anchor needed to restore the key | 71 | * @param escrowAnchor the escrow anchor needed to restore the key |
72 | * @return GNUNET_OK if verification is successful | 72 | * @return GNUNET_ESCROW_VALID if the escrow could successfully by restored, |
73 | * GNUNET_ESCROW_RENEW_NEEDED if the escrow needs to be renewed, | ||
74 | * GNUNET_ESCROW_INVALID otherwise | ||
73 | */ | 75 | */ |
74 | int | 76 | int |
75 | verify_plaintext_key_escrow (const struct GNUNET_IDENTITY_Ego *ego, | 77 | verify_plaintext_key_escrow (const struct GNUNET_IDENTITY_Ego *ego, |
@@ -80,11 +82,12 @@ verify_plaintext_key_escrow (const struct GNUNET_IDENTITY_Ego *ego, | |||
80 | 82 | ||
81 | if (NULL == ego) | 83 | if (NULL == ego) |
82 | { | 84 | { |
83 | return NULL; | 85 | return GNUNET_ESCROW_INVALID; |
84 | } | 86 | } |
85 | pk = GNUNET_IDENTITY_ego_get_private_key (ego); | 87 | pk = GNUNET_IDENTITY_ego_get_private_key (ego); |
86 | pkString = GNUNET_CRYPTO_ecdsa_private_key_to_string (pk); | 88 | pkString = GNUNET_CRYPTO_ecdsa_private_key_to_string (pk); |
87 | return strncmp (pkString, (char *)escrowAnchor, strlen (pkString)); | 89 | return strncmp (pkString, (char *)escrowAnchor, strlen (pkString)) == 0 ? |
90 | GNUNET_ESCROW_VALID : GNUNET_ESCROW_INVALID; | ||
88 | } | 91 | } |
89 | 92 | ||
90 | 93 | ||