- send( conn, head, RecordHeader::SignerCommand::ADD_AVA, "CN,commonName" );
- send( conn, head, RecordHeader::SignerCommand::ADD_SAN, "DNS,*.example.com" );
+
+ for( auto ava : cert->AVAs ) {
+ if( ava->name.find( "," ) != std::string::npos ) {
+ // invalid ava
+ return std::shared_ptr<SignedCertificate>();
+ }
+
+ send( conn, head, RecordHeader::SignerCommand::ADD_AVA, ava->name + "," + ava->value );
+ }
+
+ for( auto san : cert->SANs ) {
+ if( san->type.find( "," ) != std::string::npos ) {
+ // invalid ava
+ return std::shared_ptr<SignedCertificate>();
+ }
+
+ send( conn, head, RecordHeader::SignerCommand::ADD_SAN, san->type + "," + san->content );
+ }
+