1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-06 13:20:57 +03:00

feat(torture): add torture_get_sk_pin function to retrieve PIN from environment

Signed-off-by: Praneeth Sarode <praneethsarode@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
Praneeth Sarode
2025-09-25 03:56:01 +05:30
parent 50ee6411f2
commit c4b2bd34a8
2 changed files with 14 additions and 0 deletions

View File

@@ -100,3 +100,9 @@ void assert_sk_key_valid(ssh_key key,
break;
}
}
const char *torture_get_sk_pin(void)
{
const char *pin = getenv("TORTURE_SK_PIN");
return (pin != NULL && pin[0] != '\0') ? pin : NULL;
}

View File

@@ -36,5 +36,13 @@
void assert_sk_key_valid(ssh_key key,
enum ssh_keytypes_e expected_type,
bool private);
/**
* @brief Get security key PIN from environment variable
*
* Reads the TORTURE_SK_PIN environment variable and returns its value.
*
* @return Pointer to PIN string if set and non-empty, NULL otherwise
*/
const char *torture_get_sk_pin(void);
#endif /* _TORTURE_SK_H */