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:
@@ -100,3 +100,9 @@ void assert_sk_key_valid(ssh_key key,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *torture_get_sk_pin(void)
|
||||||
|
{
|
||||||
|
const char *pin = getenv("TORTURE_SK_PIN");
|
||||||
|
return (pin != NULL && pin[0] != '\0') ? pin : NULL;
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,5 +36,13 @@
|
|||||||
void assert_sk_key_valid(ssh_key key,
|
void assert_sk_key_valid(ssh_key key,
|
||||||
enum ssh_keytypes_e expected_type,
|
enum ssh_keytypes_e expected_type,
|
||||||
bool private);
|
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 */
|
#endif /* _TORTURE_SK_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user