Support Authenticated-Enveloped-Data Content Type.
* src/cms.h (struct ksba_cms_s): Remove struct data which was not used. Add struct authdata. * src/cms.asn (AuthEnvelopedData): New. (id-authEnvelopedData): New. * src/ksba.h.in (ksba_content_type_t): Add KSBA_CT_AUTHENVELOPED_DATA. * src/cms.c (content_handlers): Ditto. (ksba_cms_release): Free the new fields. (ksba_cms_get_message_digest): Hack to return authtag. (ct_parse_signed_data): Remove useless condition which was always true. * src/cms-parser.c (parse_encrypted_content_info): Add arg r_algo_parmtype. (_ksba_cms_parse_enveloped_data_part_1): Detect GCM with AES and parse the parameters. (_ksba_cms_parse_enveloped_data_part_2): Parse the MAC part and store it for retrieval by ksba_cms_get_message_digest. * tests/t-cms-parser.c (one_file): Handle authdata.
This is limited to GCM-AES* and does not support AAD - see code
comments. I would love to support OCB here but there seems to be no
sample data or even a spec.
- Signed-off-by: Werner Koch <firstname.lastname@example.org>