diff options
author | Jeff Burdges <burdges@gnunet.org> | 2016-06-08 13:37:14 +0000 |
---|---|---|
committer | Jeff Burdges <burdges@gnunet.org> | 2016-06-08 13:37:14 +0000 |
commit | 727c093dc23c71c792261e295c3d628824bd8ccc (patch) | |
tree | 77ed6f549a83bbfe539a340c32067b6bd3765bf4 /src/include/gnunet_crypto_lib.h | |
parent | 1f33c505c42ac2b3d628b2b70b2da62e8f621a89 (diff) | |
download | gnunet-727c093dc23c71c792261e295c3d628824bd8ccc.tar.gz gnunet-727c093dc23c71c792261e295c3d628824bd8ccc.zip |
Rework the error handling for gcd(r,n) != 1 so the Taler wallet can see errors.
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 32503eaf8..00ecc565f 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -1995,16 +1995,17 @@ GNUNET_CRYPTO_rsa_public_key_cmp (struct GNUNET_CRYPTO_RsaPublicKey *p1, | |||
1995 | * Blinds the given message with the given blinding key | 1995 | * Blinds the given message with the given blinding key |
1996 | * | 1996 | * |
1997 | * @param hash hash of the message to sign | 1997 | * @param hash hash of the message to sign |
1998 | * @param bks the blinding key secret | 1998 | * @param bkey the blinding key |
1999 | * @param pkey the public key of the signer | 1999 | * @param pkey the public key of the signer |
2000 | * @param[out] buffer set to a buffer with the blinded message to be signed | 2000 | * @param[out] buf set to a buffer with the blinded message to be signed |
2001 | * @return number of bytes stored in @a buffer | 2001 | * @param[out] buf_size number of bytes stored in @a buf |
2002 | * @return GNUNET_YES if successful, GNUNET_NO if RSA key is malicious | ||
2002 | */ | 2003 | */ |
2003 | size_t | 2004 | int |
2004 | GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash, | 2005 | GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash, |
2005 | const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, | 2006 | const struct GNUNET_CRYPTO_RsaBlindingKeySecret *bks, |
2006 | struct GNUNET_CRYPTO_RsaPublicKey *pkey, | 2007 | struct GNUNET_CRYPTO_RsaPublicKey *pkey, |
2007 | char **buffer); | 2008 | char **buf, size_t *buf_size); |
2008 | 2009 | ||
2009 | 2010 | ||
2010 | /** | 2011 | /** |
@@ -2017,8 +2018,7 @@ GNUNET_CRYPTO_rsa_blind (const struct GNUNET_HashCode *hash, | |||
2017 | */ | 2018 | */ |
2018 | struct GNUNET_CRYPTO_RsaSignature * | 2019 | struct GNUNET_CRYPTO_RsaSignature * |
2019 | GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 2020 | GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
2020 | const void *msg, | 2021 | const void *msg, size_t msg_len); |
2021 | size_t msg_len); | ||
2022 | 2022 | ||
2023 | 2023 | ||
2024 | /** | 2024 | /** |
@@ -2026,7 +2026,7 @@ GNUNET_CRYPTO_rsa_sign_blinded (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
2026 | * | 2026 | * |
2027 | * @param key private key to use for the signing | 2027 | * @param key private key to use for the signing |
2028 | * @param hash the hash of the message to sign | 2028 | * @param hash the hash of the message to sign |
2029 | * @return NULL on error, signature on success | 2029 | * @return NULL on error, including a malicious RSA key, signature on success |
2030 | */ | 2030 | */ |
2031 | struct GNUNET_CRYPTO_RsaSignature * | 2031 | struct GNUNET_CRYPTO_RsaSignature * |
2032 | GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 2032 | GNUNET_CRYPTO_rsa_sign_fdh (const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
@@ -2085,7 +2085,7 @@ GNUNET_CRYPTO_rsa_signature_dup (const struct GNUNET_CRYPTO_RsaSignature *sig); | |||
2085 | * @param sig the signature made on the blinded signature purpose | 2085 | * @param sig the signature made on the blinded signature purpose |
2086 | * @param bks the blinding key secret used to blind the signature purpose | 2086 | * @param bks the blinding key secret used to blind the signature purpose |
2087 | * @param pkey the public key of the signer | 2087 | * @param pkey the public key of the signer |
2088 | * @return unblinded signature on success, NULL on error | 2088 | * @return unblinded signature on success, NULL if RSA key is bad or malicious. |
2089 | */ | 2089 | */ |
2090 | struct GNUNET_CRYPTO_RsaSignature * | 2090 | struct GNUNET_CRYPTO_RsaSignature * |
2091 | GNUNET_CRYPTO_rsa_unblind (struct GNUNET_CRYPTO_RsaSignature *sig, | 2091 | GNUNET_CRYPTO_rsa_unblind (struct GNUNET_CRYPTO_RsaSignature *sig, |
@@ -2100,7 +2100,7 @@ GNUNET_CRYPTO_rsa_unblind (struct GNUNET_CRYPTO_RsaSignature *sig, | |||
2100 | * @param hash the message to verify to match the @a sig | 2100 | * @param hash the message to verify to match the @a sig |
2101 | * @param sig signature that is being validated | 2101 | * @param sig signature that is being validated |
2102 | * @param public_key public key of the signer | 2102 | * @param public_key public key of the signer |
2103 | * @returns #GNUNET_OK if ok, #GNUNET_SYSERR if invalid | 2103 | * @returns #GNUNET_YES if ok, #GNUNET_NO if RSA key is malicious, #GNUNET_SYSERR if signature |
2104 | */ | 2104 | */ |
2105 | int | 2105 | int |
2106 | GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash, | 2106 | GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash, |