diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2015-01-24 18:53:29 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2015-01-24 18:53:29 +0000 |
commit | 868ca61cf561f8902b1088710edcc60b96f91df5 (patch) | |
tree | 673452932d304936debc6f08ee499a82a7f22a8c /src/util/crypto_rsa.c | |
parent | 1de46adfda8e188a2c8dcca5f2c519c4a98c55a7 (diff) | |
download | gnunet-868ca61cf561f8902b1088710edcc60b96f91df5.tar.gz gnunet-868ca61cf561f8902b1088710edcc60b96f91df5.zip |
-fix assertion checking the encoded s-expressions
Diffstat (limited to 'src/util/crypto_rsa.c')
-rw-r--r-- | src/util/crypto_rsa.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index c14e6b9b1..9aad9c910 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c | |||
@@ -199,7 +199,7 @@ GNUNET_CRYPTO_rsa_private_key_encode (const struct GNUNET_CRYPTO_rsa_PrivateKey | |||
199 | NULL, | 199 | NULL, |
200 | 0); | 200 | 0); |
201 | b = GNUNET_malloc (n); | 201 | b = GNUNET_malloc (n); |
202 | GNUNET_assert (n == | 202 | GNUNET_assert ((n - 1) == /* since the last byte is \0 */ |
203 | gcry_sexp_sprint (key->sexp, | 203 | gcry_sexp_sprint (key->sexp, |
204 | GCRYSEXP_FMT_DEFAULT, | 204 | GCRYSEXP_FMT_DEFAULT, |
205 | b, | 205 | b, |
@@ -309,7 +309,7 @@ GNUNET_CRYPTO_rsa_public_key_encode (const struct GNUNET_CRYPTO_rsa_PublicKey *k | |||
309 | NULL, | 309 | NULL, |
310 | 0); | 310 | 0); |
311 | b = GNUNET_malloc (n); | 311 | b = GNUNET_malloc (n); |
312 | GNUNET_assert (n == | 312 | GNUNET_assert ((n -1) == /* since the last byte is \0 */ |
313 | gcry_sexp_sprint (key->sexp, | 313 | gcry_sexp_sprint (key->sexp, |
314 | GCRYSEXP_FMT_ADVANCED, | 314 | GCRYSEXP_FMT_ADVANCED, |
315 | b, | 315 | b, |
@@ -636,7 +636,7 @@ GNUNET_CRYPTO_rsa_signature_encode (const struct GNUNET_CRYPTO_rsa_Signature *si | |||
636 | NULL, | 636 | NULL, |
637 | 0); | 637 | 0); |
638 | b = GNUNET_malloc (n); | 638 | b = GNUNET_malloc (n); |
639 | GNUNET_assert (n == | 639 | GNUNET_assert ((n - 1) == /* since the last byte is \0 */ |
640 | gcry_sexp_sprint (sig->sexp, | 640 | gcry_sexp_sprint (sig->sexp, |
641 | GCRYSEXP_FMT_ADVANCED, | 641 | GCRYSEXP_FMT_ADVANCED, |
642 | b, | 642 | b, |