Add a size hook to RSA_METHOD.

This is to avoid having to copy over the RSA modulus in all of Chromium's
platform-specific keys.

Change-Id: I20bf22446a5cfb633b900c3b392b7a1da81a5431
Reviewed-on: https://boringssl-review.googlesource.com/1151
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/rsa/rsa.c b/crypto/rsa/rsa.c
index 583e667..526e468 100644
--- a/crypto/rsa/rsa.c
+++ b/crypto/rsa/rsa.c
@@ -249,7 +249,11 @@
 }
 
 unsigned RSA_size(const RSA *rsa) {
-  return BN_num_bytes(rsa->n);
+  if (rsa->meth->size) {
+    return rsa->meth->size(rsa);
+  }
+
+  return RSA_default_method.size(rsa);
 }
 
 int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,