Snap for 4527419 from cb5753818934d4f7c120a4ef6d00c6b01d43eca2 to oc-m2-release

Change-Id: I5fc552534488394dde25e1be24b61648ec2e2f71
diff --git a/common/src/jni/main/cpp/NativeCrypto.cpp b/common/src/jni/main/cpp/NativeCrypto.cpp
index 521295f..06b439b 100644
--- a/common/src/jni/main/cpp/NativeCrypto.cpp
+++ b/common/src/jni/main/cpp/NativeCrypto.cpp
@@ -1098,7 +1098,7 @@
     CBS cbs;
     CBS_init(&cbs, reinterpret_cast<const uint8_t*>(bytes.get()), bytes.size());
     bssl::UniquePtr<EVP_PKEY> pkey(EVP_parse_private_key(&cbs));
-    if (!pkey || CBS_len(&cbs) != 0) {
+    if (!pkey) {
         Errors::throwParsingException(env, "Error parsing private key");
         JNI_TRACE("bytes=%p EVP_parse_private_key => threw exception", keyJavaBytes);
         return 0;
@@ -1150,7 +1150,7 @@
     CBS cbs;
     CBS_init(&cbs, reinterpret_cast<const uint8_t*>(bytes.get()), bytes.size());
     bssl::UniquePtr<EVP_PKEY> pkey(EVP_parse_public_key(&cbs));
-    if (!pkey || CBS_len(&cbs) != 0) {
+    if (!pkey) {
         Errors::throwParsingException(env, "Error parsing public key");
         JNI_TRACE("bytes=%p EVP_parse_public_key => threw exception", keyJavaBytes);
         return 0;