summaryrefslogtreecommitdiff
path: root/openssl_err.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2015-10-23 10:11:40 -0600
committerShawn Willden <swillden@google.com>2015-10-28 14:06:17 -0600
commite9fb087a8245e26483e8865515c919c83ed84c5b (patch)
tree9351282afa795bddf1e3045bd5e70aeeaa3e622f /openssl_err.cpp
parentb492f7082a7a95dc9360f40ea829c458f5d0b5a9 (diff)
downloadkeymaster-e9fb087a8245e26483e8865515c919c83ed84c5b.tar.gz
Return correct error from keymaster0engine for large RSA input
Also, ensure that we always put some error on the OpenSSL error queue whenever a wrapped keymaster0 operation fails. Higher layers will look a the last entry on the queue and use it to determine what error code to return. Not putting any error on the queue means that those higher layers will get whatever error was last enqueued, making the result effectively random. Non-determinism bad. Bug: 25337630 Change-Id: I701ab735dd089f5258b2252f543906d9f3baa7a2
Diffstat (limited to 'openssl_err.cpp')
-rw-r--r--openssl_err.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/openssl_err.cpp b/openssl_err.cpp
index 51a29d9..df2920b 100644
--- a/openssl_err.cpp
+++ b/openssl_err.cpp
@@ -49,7 +49,8 @@ keymaster_error_t TranslateLastOpenSslError(bool log_message) {
int reason = ERR_GET_REASON(error);
switch (ERR_GET_LIB(error)) {
-
+ case ERR_LIB_USER:
+ return static_cast<keymaster_error_t>(reason);
case ERR_LIB_EVP:
return TranslateEvpError(reason);
#if defined(OPENSSL_IS_BORINGSSL)