added a BUILD_FROM_FD option, supporting credential parsing from stdin
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
ENUM(builder_part_names, BUILD_FROM_FILE, BUILD_END,
|
||||
"BUILD_FROM_FILE",
|
||||
"BUILD_FROM_FD",
|
||||
"BUILD_AGENT_SOCKET",
|
||||
"BUILD_BLOB_ASN1_DER",
|
||||
"BUILD_BLOB_PEM",
|
||||
|
||||
@@ -38,8 +38,10 @@ typedef builder_t* (*builder_constructor_t)(int subtype);
|
||||
* Parts to build credentials from.
|
||||
*/
|
||||
enum builder_part_t {
|
||||
/** path to a file containing an ASN.1 blob, char* */
|
||||
/** path to a file encoded in any format, char* */
|
||||
BUILD_FROM_FILE,
|
||||
/** file descriptor to read data, encoded in any format, int */
|
||||
BUILD_FROM_FD,
|
||||
/** unix socket of a ssh/pgp agent, char* */
|
||||
BUILD_AGENT_SOCKET,
|
||||
/** DER encoded ASN.1 blob, chunk_t */
|
||||
|
||||
@@ -183,6 +183,7 @@ static void* create(private_credential_factory_t *this, credential_type_t type,
|
||||
builder->add(builder, part, va_arg(args, x509_flag_t));
|
||||
continue;
|
||||
case BUILD_KEY_SIZE:
|
||||
case BUILD_FROM_FD:
|
||||
builder->add(builder, part, va_arg(args, u_int));
|
||||
continue;
|
||||
case BUILD_NOT_BEFORE_TIME:
|
||||
|
||||
Reference in New Issue
Block a user