* To select the signerInfo structure to get the attribute from, pass
* the enumerator position from container_t.create_signature_enumerator().
*
+ * The attribute returned does not contain type information and must be
+ * freed after use.
+ *
* @param oid OID from the attribute to get
* @param enumerator enumerator to select signerInfo
- * @param value chunk receiving attribute value, internal data
+ * @param value chunk receiving attribute value, allocated
* @return TRUE if attribute found
*/
bool (*get_attribute)(pkcs7_t *this, int oid, enumerator_t *enumerator,
chunk = e->info->attributes->get_attribute(e->info->attributes, oid);
if (chunk.len)
{
- *value = chunk;
+ *value = chunk_clone(chunk);
return TRUE;
}
}
{
fprintf(stderr, " at %T", &t, FALSE);
}
+ free(data.ptr);
}
fprintf(stderr, "\n");
}
}
}
DBG2(DBG_APP, "messageType: %s", msgType_names[attrs->msgType]);
+ free(attr.ptr);
}
if (pkcs7->get_attribute(pkcs7, OID_PKI_STATUS, enumerator, &attr))
{
}
}
DBG2(DBG_APP, "pkiStatus: %s", pkiStatus_names[attrs->pkiStatus]);
+ free(attr.ptr);
}
if (pkcs7->get_attribute(pkcs7, OID_PKI_FAIL_INFO, enumerator, &attr))
{
{
DBG1(DBG_APP, "failInfo: %s", failInfo_reasons[attrs->failInfo]);
}
+ free(attr.ptr);
}
pkcs7->get_attribute(pkcs7, OID_PKI_SENDER_NONCE, enumerator,