added a BUILD_FROM_FD option, supporting credential parsing from stdin

This commit is contained in:
Martin Willi
2009-08-26 13:03:23 +02:00
parent 7c577c8ea2
commit df5c60bc5d
4 changed files with 48 additions and 1 deletions
+1
View File
@@ -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",
+3 -1
View File
@@ -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: