mbedtls: Avoid parsing error
Missing public key was already detected by checking for an
MBEDTLS_ERR_ASN1_UNEXPECTED_TAG error code. But, (p == end) also means
that the public key is missing.
Change-Id: I22861c73fca83bb3d92986e56fadf1778b4c404c
Signed-off-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Bug: https://jira.iotivity.org/browse/IOT-2623
Reviewed-on: https://gerrit.iotivity.org/gerrit/21987
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Nathan Heldt-Sheller <nathan.heldt-sheller@intel.com>