Skip to content

Commit 344e5e0

Browse files
committed
Added a null check when reporting the KID value
1 parent f521d9d commit 344e5e0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/clevisDecrypt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ namespace binding {
4545

4646
std::string ancillary() const; // The 'neanc' field of the protected header as a string
4747
std::string recoveryUrl(bool full = true) const; // The complete URL needed to access the tang rec api, including the kid and query string
48-
std::string kid() const { return json_string_value(checker.getKid()); }; // The key ID
48+
std::string kid() const { if(checker.getKid() != nullptr) return json_string_value(checker.getKid()); return ""; }; // The key ID
4949
std::string transportKey() const; // This is the payload of the POST request sent as the rec api call to tang
5050
returnWithStatus_t unSealSecret(const std::string responseFromTang); // The tang interaction on JS side provides the reply here
5151

0 commit comments

Comments
 (0)