libtpmtss: Return after failure
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 9 Jan 2018 15:12:40 +0000 (16:12 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 9 Jan 2018 15:12:40 +0000 (16:12 +0100)
src/libtpmtss/tpm_tss_tss2.c

index d2fd995..8b91fb4 100644 (file)
@@ -166,6 +166,7 @@ static bool get_algs_capability(private_tpm_tss_tss2_t *this)
        {
                DBG1(DBG_PTS, "%s GetCapability failed for TPM_CAP_TPM_PROPERTIES: 0x%06x",
                                           LABEL, rval);
+               return FALSE;
        }
        memset(manufacturer,  '\0', sizeof(manufacturer));
        memset(vendor_string, '\0', sizeof(vendor_string));
@@ -474,6 +475,7 @@ METHOD(tpm_tss_t, get_public, chunk_t,
                        {
                                DBG1(DBG_PTS, "%s subjectPublicKeyInfo encoding of AIK key "
                                                          "failed", LABEL);
+                               return chunk_empty;
                        }
                        break;
                }