mbedtls: Avoid parsing error
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 <ba8e1833495515b49ded9e20cae80a8129155aa9@microsoft.com>
Bug: https://jira.iotivity.org/browse/IOT-2623
Reviewed-on: https://gerrit.iotivity.org/gerrit/21987
Reviewed-by: Kevin Kane <cd40c34e976f30c9e62efcf24e04c516bc3a3b05@microsoft.com>
Tested-by: jenkins-iotivity <d95b56ce41a2e1ac4cecdd398defd7414407cc08@iotivity.org>
Reviewed-by: Nathan Heldt-Sheller <214cad4ab375dc179217f558f8b9854a693faf7f@intel.com>

iotivity/iotivity,iotivity/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,rzr/iotivity,rzr/iotivity,iotivity/iotivity,rzr/iotivity,rzr/iotivity,iotivity/iotivity,iotivity/iotivity,rzr/iotivity,iotivity/iotivity