[or-cvs] [tor/maint-0.2.2] Always treat failure to allocate an RSA key as an unrecoverable allocation error

nickm at torproject.org nickm at torproject.org
Thu Feb 3 18:55:40 UTC 2011


commit bfde636aaddf22f68c090a76aa6387975a57c308
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Jan 25 18:19:09 2011 -0500

    Always treat failure to allocate an RSA key as an unrecoverable allocation error
---
 changes/bug2378     |    3 +++
 src/common/crypto.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/changes/bug2378 b/changes/bug2378
new file mode 100644
index 0000000..a3ae196
--- /dev/null
+++ b/changes/bug2378
@@ -0,0 +1,3 @@
+  o Minor code simplifications and refactorings
+    - Always treat failure to allocate an RSA key as an unrecoverable
+      allocation error.
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 4223b10..09d7fc8 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -379,7 +379,7 @@ crypto_new_pk_env(void)
   RSA *rsa;
 
   rsa = RSA_new();
-  if (!rsa) return NULL;
+  tor_assert(rsa);
   return _crypto_new_pk_env_rsa(rsa);
 }
 





More information about the tor-commits mailing list