aboutsummaryrefslogtreecommitdiffstats
path: root/common/ksba-io-support.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpgsm: Print PROGRESS status lines.Werner Koch2023-06-151-6/+92
| | | | | | | | | | | | | | | | | | | | | | * common/ksba-io-support.c (struct writer_cb_parm_s): Add field progress. (struct gnupg_ksba_io_s): Add field is_writer. (update_write_progress): New. (base64_writer_cb, plain_writer_cb): Call update_write_progress. (base64_finish_write): Ditto. (gnupg_ksba_create_writer): Set is_writer. (gnupg_ksba_set_progress_cb): New. (gnupg_ksba_set_total): New. * common/ksba-io-support.h (gnupg_ksba_progress_cb_t): New type. * sm/server.c (gpgsm_status2): Return error from statusfp writes. (gpgsm_progress_cb): New. * sm/decrypt.c (gpgsm_decrypt): Set progress handler. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6534
* gpgsm: Strip trailing zeroes from detached signatures.Werner Koch2023-03-081-1/+106
| | | | | | | | | | | | | | | | * common/ksba-io-support.c: Include tlv.h (struct reader_cb_parm_s): Add new fields. (starts_with_sequence): New. (simple_reader_cb): Handle stripping. * common/ksba-io-support.h (GNUPG_KSBA_IO_STRIP): New. (gnupg_ksba_create_reader): Handle the new flag. * sm/verify.c (gpgsm_verify): Use the new flag for detached signatures. -- Note that this works only if --assume-binary is given. The use case for the feature is PDF signature checking where the PDF specs require that the detached signature is padded with zeroes.
* sm: Remove left over debug output.Werner Koch2020-02-171-1/+0
| | | | --
* gpgsm: Fix import of some CR,LF ternminated certificatesWerner Koch2020-02-151-8/+18
| | | | | | | | | | | * common/ksba-io-support.c (base64_reader_cb): Detect the END tag and don't just rely on the padding chars. This could happen only with CR+LF termnmated PEM files. Also move the detection into the invalid character detection branch for a minor parser speedup. -- GnuPG-bug-id: 4847 Signed-off-by: Werner Koch <[email protected]>
* common: Rename remaining symbols in ksba-io-support.Werner Koch2017-02-161-12/+18
| | | | | | | | | | | | | | | | | | * common/ksba-io-support.c (gpgsm_reader_eof_seen): Rename to ... (gnupg_ksba_reader_eof_seen): this. Change all callers. (gpgsm_destroy_reader): Rename to ... (gnupg_ksba_destroy_reader): this. Change all callers. (gpgsm_finish_writer): Rename to ... (gnupg_ksba_finish_writer): this. Change all callers. (gpgsm_destroy_writer): Rename to ... (gnupg_ksba_destroy_writer): this. Change all callers. * common/ksba-io-support.c (struct base64_context_s): Rename to ... (gnupg_ksba_io_s): this. * common/ksba-io-support.h (base64_context_s): Ditto. (Base64Context): Rename this typedef to ... (gnupg_ksba_io_t): this. Change all users. Signed-off-by: Werner Koch <[email protected]>
* common: Remove gpgsm dependencies from ksba-io-support.Werner Koch2017-02-161-35/+71
| | | | | | | | | | | | | | | | | * common/ksba-io-support.c: Include ksba-io-support.h instead of ../sm/gpgsm.h. Include util.h. (writer_cb_parm_s): Remove const from 'pem_name'. (gpgsm_destroy_writer): Free 'pem_name'. (gpgsm_create_reader): Rename to ... (gnupg_ksba_create_reader): this. Replace args CTRL and ALLOW_MULTI_PEM by a new arg FLAGS. Change the code to evaluate FLAGS. Change all callers to pass the FLAGS. (gpgsm_create_writer): Rename to ... (gnupg_ksba_create_writer): this. Replace arg CTRL by new arg FLAGS. Add arg PEM_NAME. Evaluate FLAGS. Store a copy of PEM_NAME. Change all callers to pass the FLAGS and PEM_NAME. Signed-off-by: Werner Koch <[email protected]>
* common: Change license of ksba-io-support.cWerner Koch2017-02-161-6/+17
| | | | | | | | | | | * common/ksba-io-support.c: Change from GPLv3+ to LGPLv3+/GPLv2+. -- According to the sm/ChangeLog-2011 and the git log all code has been written by me or g10 Code employees. Also changed the copyright notices so that the file can be sued separately. Signed-off-by: Werner Koch <[email protected]>
* sm,common: Move ksba reader and writer support to common/.Werner Koch2017-02-161-0/+700
* sm/base64.c: Rename to ... * common/ksba-io-support.c: this. * common/ksba-io-support.h: New. * common/Makefile.am (common_sources): Add new files. * sm/Makefile.am (gpgsm_SOURCES): Remove base64.c Signed-off-by: Werner Koch <[email protected]>