summaryrefslogtreecommitdiff
path: root/src/sexp.c
AgeCommit message (Collapse)AuthorFilesLines
2016-03-16Update documentation for 'gcry_sexp_extract_param'.Justus Winter1-4/+7
* doc/gcrypt.texi (gcry_sexp_extract_param): Mention that all MIPs must be set to NULL first, and document how the function behaves in case of errors. * src/sexp.c (_gcry_sexp_extract_param): Likewise. * src/gcrypt.h.in (gcry_sexp_extract_param): Copy the comment from '_gcry_sexp_extract_param'. Signed-off-by: Justus Winter <justus@g10code.com>
2015-11-17Fix typos found using codespellJustus Winter1-1/+1
* cipher/cipher-ocb.c: Fix typos. * cipher/des.c: Likewise. * cipher/dsa-common.c: Likewise. * cipher/ecc.c: Likewise. * cipher/pubkey.c: Likewise. * cipher/rsa-common.c: Likewise. * cipher/scrypt.c: Likewise. * random/random-csprng.c: Likewise. * random/random-fips.c: Likewise. * random/rndw32.c: Likewise. * src/cipher-proto.h: Likewise. * src/context.c: Likewise. * src/fips.c: Likewise. * src/gcrypt.h.in: Likewise. * src/global.c: Likewise. * src/sexp.c: Likewise. * tests/mpitests.c: Likewise. * tests/t-lock.c: Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
2015-10-14Fix gpg_error_t and gpg_err_code_t confusion.NIIBE Yutaka1-2/+2
* src/gcrypt-int.h (_gcry_sexp_extract_param): Revert the change. * cipher/dsa.c (dsa_check_secret_key): Ditto. * src/sexp.c (_gcry_sexp_extract_param): Return gpg_err_code_t. * src/gcrypt-int.h (_gcry_err_make_from_errno) (_gcry_error_from_errno): Return gpg_error_t. * cipher/cipher.c (_gcry_cipher_open_internal) (_gcry_cipher_ctl, _gcry_cipher_ctl): Don't use gcry_error. * src/global.c (_gcry_vcontrol): Likewise. * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_genkey): Use gpg_err_code_from_syserror. * cipher/mac.c (mac_reset, mac_setkey, mac_setiv, mac_write) (mac_read, mac_verify): Return gcry_err_code_t. * cipher/rsa-common.c (mgf1): Use gcry_err_code_t for ERR. * src/visibility.c (gcry_error_from_errno): Return gpg_error_t. -- Reverting a part of 73374fdd and fix _gcry_sexp_extract_param return type, instead. Fix similar coding mistakes, throughout.
2015-07-14sexp: Fix invalid deallocation in error path.Peter Wu1-1/+1
* src/sexp.c: Fix wrong condition. -- Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-08-21sexp: Check args of gcry_sexp_build.Werner Koch1-3/+8
* src/sexp.c (do_vsexp_sscan): Return error for invalid args. -- This helps to avoid usage errors by passing NULL for the return variable and the format string.
2014-01-28sexp: Fix broken gcry_sexp_nth.Werner Koch1-16/+67
* src/sexp.c (_gcry_sexp_nth): Return a valid S-expression for a data element. (NODE): Remove unused typedef. (ST_HINT): Comment unused macro. * tests/t-sexp.c (bug_1594): New. (main): Run new test. -- Before 1.6.0 gcry_sexp_nth (list, 0) with a LIST of "(a (b 3:pqr) (c 3:456) (d 3:xyz))" returned the entire list. 1.6.0 instead returned NULL. However, this is also surprising and the expected value would be "(a)". This patch fixes this. Somewhat related to that gcry_sexp_nth returned a broken list if requesting index 1 of a list like "(n foo)". It returned just the "foo" but not as a list which is required by the S-expression specs. Due to this patch the returned value is now "(foo)". Thanks to Ludovic Courtès for pointing out these problems. GnuPG-bug-id: 1594
2013-12-12Remove macro hacks for internal vs. external functions. Part 2 and last.Werner Koch1-30/+30
* src/visibility.h: Remove remaining define/undef hacks for symbol visibility. Add macros to detect the use of the public functions. Change all affected functions by replacing them by the x-macros. * src/g10lib.h: Add internal prototypes. (xtrymalloc, xtrycalloc, xtrymalloc_secure, xtrycalloc_secure) (xtryrealloc, xtrystrdup, xmalloc, xcalloc, xmalloc_secure) (xcalloc_secure, xrealloc, xstrdup, xfree): New macros. -- The use of xmalloc/xtrymalloc/xfree is a more common pattern than the gcry_free etc. functions. Those functions behave like those defined by C and thus for better readability we use these macros and not the underscore prefixed functions. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-12-07sexp: Allow long names and white space in gcry_sexp_extract_param.Werner Koch1-7/+40
* src/sexp.c (_gcry_sexp_vextract_param): Skip white space. Support long parameter names. * tests/tsexp.c (check_extract_param): Add test cases for long parameter names and white space. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-12-05Remove macro hacks for internal vs. external functions. Part 1.Werner Koch1-84/+84
* src/visibility.h: Remove almost all define/undef hacks for symbol visibility. Add macros to detect the use of the public functions. Change all affected functions by prefixing them explicitly with an underscore and change all internal callers to call the underscore prefixed versions. Provide convenience macros from sexp and mpi functions. * src/visibility.c: Change all functions to use only gpg_err_code_t and translate to gpg_error_t only in visibility.c. -- The use of the macro magic made if hard to follow the function calls in the source. It was not easy to see if an internal or external function (as defined by visibility.c) was called. The change is quite large but hopefully makes Libgcrypt easier to maintain. Some function have not yet been fixed; this will be done soon. Because Libgcrypt does no make use of any other libgpg-error using libraries it is useless to always translate between gpg_error_t and gpg_err_code_t (i.e with and w/o error source identifier). This translation has no mostly be moved to the function wrappers in visibility.c. An additional advantage of using gpg_err_code_t is that comparison can be done without using gpg_err_code(). I am sorry for that large patch, but a series of patches would actually be more work to audit. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-11-11mpi: Add special format GCRYMPI_FMT_OPAQUE.Werner Koch1-30/+24
* src/gcrypt.h.in (GCRYMPI_FMT_OPAQUE): New. (_gcry_sexp_nth_opaque_mpi): Remove. * src/sexp.c (gcry_sexp_nth_mpi): Add support for GCRYMPI_FMT_OPAQUE. (_gcry_sexp_vextract_param): Replace removed function by GCRYMPI_FMT_OPAQUE. -- Using a new formatting mode is easier than to add a dedicated extraction function for opaque MPIs. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-10-16sexp: Add function gcry_sexp_extract_param.Werner Koch1-0/+235
* src/gcrypt.h.in (_GCRY_GCC_ATTR_SENTINEL): New. (gcry_sexp_extract_param): New. * src/visibility.c (gcry_sexp_extract_param): New. * src/visibility.h (gcry_sexp_extract_param): Add hack to detect internal use. * cipher/pubkey-util.c (_gcry_pk_util_extract_mpis): Move and split into ... * src/sexp.c (_gcry_sexp_vextract_param) (_gcry_sexp_extract_param): this. Change all callers. Add support for buffer descriptors and a path option/ * tests/tsexp.c (die, hex2buffer, hex2mpi, hex2mpiopa): New. (cmp_mpihex, cmp_bufhex): New. (check_extract_param): New. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-09-25sexp: Improve printing of data with a leading zero.Werner Koch1-0/+2
* src/sexp.c (suitable_encoding): Detect leading zero byte.
2013-09-20sexp: Change internal versions to always use gpg_err_code_t.Werner Koch1-32/+32
* src/sexp.c (gcry_sexp_new, gcry_sexp_create, gcry_sexp_build) (gcry_sexp_build_array, gcry_sexp_canon_len): Change error return type from gpg_error_t to gpg_err_code_t. Remove all calls to gpg_error. * src/visibility.c (gcry_sexp_new, gcry_sexp_create, gcry_sexp_sscan) (gcry_sexp_build, gcry_sexp_build_array, gcry_sexp_canon_len): Map error codes via gpg_error. * cipher/dsa.c, cipher/ecc.c, cipher/elgamal.c, cipher/rsa.c: Remove use gpg_err_code wrappers. -- We should do such a change for all other use of internal functions. It just does not make sense to use gpg_error in the internal interface because the error source is always Libgcrypt. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-09-19sexp: Improve printing data representing a negative number.Werner Koch1-0/+4
* src/sexp.c (suitable_encoding): Detect a negative number. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-09-16ecc: Implement Curve Ed25519 signing and verification.Werner Koch1-0/+24
* cipher/ecc-curves.c (domain_parms): Add curve "Ed25519". * cipher/ecc.c (reverse_buffer): New. (eddsa_encodempi): New. (eddsa_encodepoint): New. (eddsa_decodepoint): New. (sign_eddsa): Implement. (verify_eddsa): Implement. (ecc_sign): Init unused Q. Pass public key to sign_eddsa. (ecc_verify): Init pk.Q if not used. Pass public key verbatim to verify_eddsa. * cipher/pubkey.c (sexp_elements_extract): Add arg OPAQUE. Change all callers to pass 0. (sexp_to_sig): Add arg OPAQUE and pass it to sexp_elements_extract. (sexp_data_to_mpi): Allow for a zero length "value". (gcry_pk_verify): Reorder parameter processing. Pass OPAQUE flag as required. * mpi/ec.c (ec_invm): Print a warning if the inverse does not exist. (_gcry_mpi_ec_get_affine): Implement for our Twisted Edwards curve model. (dup_point_twistededwards): Implement. (add_points_twistededwards): Implement. (_gcry_mpi_ec_mul_point): Support Twisted Edwards. * mpi/mpicoder.c (do_get_buffer): Add arg FILL_LE. (_gcry_mpi_get_buffer): Ditto. Change all callers. (_gcry_mpi_get_secure_buffer): Ditto. * src/sexp.c (_gcry_sexp_nth_opaque_mpi): New. * tests/t-ed25519.c: New. * tests/t-ed25519.inp: New. * tests/t-mpi-point.c (basic_ec_math_simplified): Print some output only in debug mode. (twistededwards_math): New test. (main): Call new test. -- This is a non optimized version which takes far too long. On my X220 Thinkpad the 1024 test cases take 14 seconds (12 with --sign-with-pk). There should be a lot of room for improvements. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-07-29sexp: Allow white space anywhere in a hex format.Werner Koch1-22/+21
* src/sexp.c (hextobyte): Remove. (hextonibble): New. (vsexp_sscan): Skip whtespace between hex nibbles. -- Before that patch a string "(a #123" " 456#") was not correctly parsed because white space was only allowed between two hex digits but not in between nibbles. Signed-off-by: Werner Koch <wk@gnupg.org>
2013-07-19sexp: Add function gcry_sexp_nth_buffer.Werner Koch1-0/+26
* src/sexp.c (gcry_sexp_nth_buffer): New. * src/visibility.c, src/visibility.h: Add function wrapper. * src/libgcrypt.vers, src/libgcrypt.def: Add to API. * src/gcrypt.h.in: Add prototype. Signed-off-by: Werner Koch <wk@gnupg.org>
2012-10-30Fixed indentation of sexp.cWerner Koch1-189/+220
-- Some functions used to be intended the old way. Changed this to GNU style.
2011-06-10Fixed leading zero problems in PSS and OAEP.Werner Koch1-5/+22
2011-02-04Nuked almost all trailing whitespace.Werner Koch1-68/+68
Check and install the standard git pre-commit hook.
2011-01-31Changed ecdh parameter names and fixed MPI allocation.Werner Koch1-25/+65
2010-06-29fixes for msvc compilerWerner Koch1-1/+1
2010-04-162010-04-16 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann1-30/+36
* sexp.c: (sexp_sscan): Make it variable length, and rename the old version to ... (vsexp_sscan): ... this new function. Also swap last two arguments. (gcry_sexp_create): Remove dummy va_list. (gcry_sexp_build): Use vsexp_sscan instead of sexp_sscan. (_gcry_sexp_vbuild): Likewise. (gcry_sexp_build_array): Remove dummy va_list. (gcry_sexp_sscan): Likewise.
2010-04-12Applied spelling fixes and more verbose test diagnositcs by Brad Hards.Werner Koch1-2/+2
2009-07-02Minor bug fixes.Werner Koch1-1/+0
2009-02-16Portability fixes.Werner Koch1-1/+0
2008-11-25Finished RSA X9.31 key generation.Werner Koch1-3/+62
2007-10-31Reorganizatiosn to support the visibility attribute.Werner Koch1-8/+10
This can be improved by using fucntion aliases instead of wrapper functions.
2007-04-18Enhanced support for ECDSA.Werner Koch1-88/+95
Along with the latest libksba it is now possible for gpgsm to import an ECC certificate.
2007-02-21A lot of cleanups as well as minor API changes.Werner Koch1-30/+43
Ported some changes from 1.2 to here.
2006-10-17Various minor changes.Werner Koch1-2/+2
Support for DSA2.
2006-07-26Collected changes - see ChangeLogsWerner Koch1-1/+1
2006-06-21Changed xmalloc style calls to proper malloc calls with error returns atWerner Koch1-75/+151
many (but not all) places.
2005-04-14(whitespacep): New.Werner Koch1-15/+29
(sexp_sscan): Replaced isdigit and isspace by whitespacep and digitp.
2004-10-12* sexp.c (sexp_sscan): Removed C++ style comments. Noted by YoannWerner Koch1-2/+0
Vandoorselaere. * secmem.h (_gcry_secmem_set_flags,_gcry_secmem_get_flags): Removed __pure__. (GCRY_SECMEM_FLAG_NO_WARNING): Put macro value into parens.
2004-08-232004-08-23 Moritz Schulte <moritz@g10code.com>Moritz Schulte1-1/+0
* global.c: Do not include <assert.h>. * sexp.c: Likewise. * module.c: Likewise. * misc.c: Likewise.
2004-02-03* secmem.c (_gcry_secmem_init): Do not print the "not locked intoWerner Koch1-27/+90
core warning" if the NO_WARNING flag has been set. * sexp.c (sexp_sscan): Allocate result in secure memory if BUFFER is in secure memory. Switch to secure memory for the a secure %b format item. Extra paranoid wipe on error. (gcry_sexp_release): Added paranoid wiping for securely allocated S-expressions. * tsexp.c (basic): New pass to check secure memory switching.
2003-11-11* Manifest: New.Werner Koch1-2/+19
* gcrypt.texi (Working with S-expressions): Added "%b". * sexp.c (sexp_sscan): Implemented "%b" format specifier. * tsexp.c (basic): Add pass structure and a test for the %b format.
2003-10-272003-10-27 Moritz Schulte <mo@g10code.com>Moritz Schulte1-289/+364
* sexp.c (sexp_sscan): Cleaned up, deallocate scanned sexp on error.
2003-10-08* sexp.c (sexp_sscan): Check that parenthesis are matching.Werner Koch1-2/+9
* tsexp.c (check_sscan): New.
2003-07-27* gcrypt.h (gcry_mpi_scan, gcry_mpi_print): API change.Werner Koch1-4/+4
(gcry_mpi_dump): New. * mpicoder.c (gcry_mpi_scan): New argument BUFLEN to replace the use of the intial value of NBYTES. (gcry_mpi_print): Likewise. (gcry_mpi_dump): New. (_gcry_log_mpidump): Make use of gcry_mpi_dump. (mpi_print): Removed. (gcry_mpi_scan): Allocated mpi in secure memory when required. * gcrypt.texi: Adjusted description of gcry_mpi_scan and gcry_mpi_dump. Add gcry_mpi_dump.
2003-07-142003-07-15 Moritz Schulte <moritz@g10code.com>Moritz Schulte1-45/+45
* gcrypt.h: Bumped version number up to 1.1.42-cvs. 2003-07-14 Moritz Schulte <moritz@g10code.com> * gcrypt.h (gcry_cipher_spec): New member: aliases. * Makefile.am (noinst_PROGRAMS, testapi_SOURCES, testapai_LDADD, benchmark_SOURCES, benchmark_LDADD): Removed. * benchmark.c, testapi.c: Removed files. * mpi.h: Removed disabled typedef. * g10lib.h: Likewise. * benchmark.c, g10lib.h, gcrypt.h, global.c, module.c, sexp.c: Used gcry_err* wrappers for libgpg-error symbols. 2003-07-12 Moritz Schulte <moritz@g10code.com> * global.c: Likewise. * gcrypt.h: New type: gcry_error_t, gcry_err_code_t and gcry_err_source_t. (gcry_err_make, gcry_error, gcry_err_code, gcry_err_source): New functions. * global.c (gcry_strerror): New function. (gcry_strsource): New function. * gcrypt.h: New symbol: GCRY_CIPHER_TWOFISH128. 2003-07-09 Moritz Schulte <moritz@g10code.com> * gcrypt.h (enum gcry_md_flags): Removed, used define instead, since that is more common than an enumeration list when it comes to flags that can be bitwise ORed.
2003-07-072003-07-07 Moritz Schulte <moritz@g10code.com>Moritz Schulte1-1/+6
* sexp.c (gcry_sexp_build_array): Use dummy argument pointer. Thanks to Simon Josefsson <jas@extunde.com>.
2003-06-172003-06-17 Moritz Schulte <moritz@g10code.com>Moritz Schulte1-1/+1
* Makefile.am (AM_CFLAGS): Added: @GPG_ERROR_CFLAGS@. 2003-06-16 Moritz Schulte <moritz@g10code.com> * g10lib.h: Replace last occurences of old type names with newer names (i.e. replace MPI with gcry_mpi_t). * mpi.h: Likewise. * sexp.c: Likewise.
2003-06-09v2003-06-09 Moritz Schulte <moritz@g10code.com>Moritz Schulte1-412/+439
* Makefile.am: Support for libgpg-error. 2003-06-08 Moritz Schulte <moritz@g10code.com> * sexp.c (gcry_sexp_create): Expect sane error values from gcry_sexp_canon_len instead of the `historical' values. 2003-06-07 Moritz Schulte <moritz@g10code.com> * ath.c, ath.c, ath-pth.c, ath-pthread.c, benchmark.c, cipher.h, g10lib.h, gcrypt.h, global.c, misc.c, missing-string.c, module.c, mpi.h, secmem.c, secmem.h, sexp.c, stdmem.c, stdmem.h, testapi.c, types.h: Edited all preprocessor instructions to remove whitespace before the '#'. This is not required by C89, but there are some compilers out there that don't like it. Replaced any occurence of the now deprecated type names with the new ones. * gcrypt.h: Re-organized checking for gcc features; New macro: _GCRY_GCC_ATTR_DEPRECATED. Include copy of libgpg-error's gpg-error.h in order to make it easy to build libgcrypt without needing libgpg-error.h. (GCRY_MPI, GcryMPI, GCRY_SEXP, GcrySexp, GCRY_CIPHER_HD, GcryCipherHd, GCRY_MD_HD, GcryMDHd): Declared deprecated. (gcry_mpi_t, gcry_sexp_t, gcry_cipher_hd_t, gcry_md_hd_t): New types. 2003-06-04 Moritz Schulte <moritz@g10code.com> * sexp.c (sexp_sscan): New argument: arg_list, adjusted all callers. (ARG_NEXT): New macro. (sexp_sscan): Use ARG_NEXT for receiving format string arguments. (gcry_sexp_build_array): New function. 2003-06-02 Moritz Schulte <moritz@g10code.com> * gcrypt.h: Added some comments describing the gcry_sexp_* functions. Include <gpg-error.h> instead of <gpg/error.h>. 2003-06-01 Moritz Schulte <moritz@g10code.com> * sexp.c (OLDPARSECODE): Removed macro... (gcry_sexp_canon_len): ... and do not use it. * gcrypt.h (gcry_errno): Removed declaration. * g10lib.h (string_to_pubkey_algo, pubkey_algo_to_string, pubkey_nbits): Removed declarations for non-existing functions. 2003-05-31 Moritz Schulte <moritz@g10code.com> * cipher.h (is_RSA, is_ELGAMAL): Removed macros. * g10lib.h (set_lasterr): Removed macro. (_gcry_set_lasterr): Removed declaration. * gcrypt.h: Changed declarations for: gcry_pk_algo_info, gcry_md_open, gcry_md_copy, gcry_md_algo_info, gcry_md_info, gcry_md_get_algo, gcry_random_add_bytes. (gcry_md_is_secure): Adjust macro for new API. 2003-05-29 Moritz Schulte <moritz@g10code.com> * gcrypt.h: Changed declarations for: gcry_cipher_open, gcry_cipher_info, gcry_cipher_algo_info. (gcry_cipher_get_algo_keylen): Adjuster for new gcry_cipher_algo_info interface. (gcry_cipher_get_algo_blklen): Likewise. * global.c (gcry_errno): Removed function. (gcry_strerror): Do not use gcry_errno. (_gcry_set_lasterr): Removed function. (last_ec): Removed variable. 2003-05-27 Moritz Schulte <moritz@g10code.com> * gcrypt.h (enum gcry_cipher_algos): Make Serpent IDs do not conflict with OpenPGP. Reported by Timo Schulz. * global.c (gcry_control): Fixed name of enum list. 2003-05-25 Moritz Schulte <moritz@g10code.com> * cipher.h (gcry_cipher_spec): Adjust return type of `setkey' for libgpg-error. (gcry_pubkey_spec): Adjust return type of `generate', `check_secret_key', `encrypt', `decrypt', `sign' and `verify' for libgpg-error. * sexp.c (gcry_sexp_canon_len): Adjusted for libgpg-error. (gcry_sexp_create): Likewise. (gcry_sexp_new): Likewise. (sexp_sscan): Likewise. (gcry_sexp_build): Likewise. (gcry_sexp_sscan): Likewise. * module.c (_gcry_module_add): Likewise. * global.c (last_ec): Change type to gpg_error_t. (gcry_control): Adjust for libgpg-error. (gcry_errno): Likewise. (gcry_strerror): Likewise. (_gcry_set_lasterr): Likewise. (gcry_xmalloc): Likewise. (gcry_xrealloc): Likewise. 2003-05-22 Moritz Schulte <moritz@g10code.com> * types.h: Merged code from GnuPG regarding U64_C. * missing-string.c (strsep): Removed function. * g10lib.h: Removed declarations: strsep, strlwr. * secmem.c (secmem_lock): New variable. (SECMEM_LOCK, SECMEM_UNLOCK): New macros. (_gcry_secmem_set_flags): Use SECMEM_LOCK and SECMEM_UNLOCK. (_gcry_secmem_get_flags): Likewise. (_gcry_secmem_init): Likewie. (_gcry_secmem_malloc): Likewise. (_gcry_secmem_free): Likewise. (_gcry_secmem_malloc): Renamed to ... (_gcry_secmem_malloc_internal): ... this. (_gcry_secmem_malloc): New function, use SECMEM_LOCK, SECMEM_UNLOCK, call _gcry_secmem_malloc_internal. (_gcry_secmem_free): Renamed to ... (_gcry_secmem_free_internal): ... this. (_gcry_secmem_free): New function, use SECMEM_LOCK, SECMEM_UNLOCK, call _gcry_secmem_free_internal. (_gcry_secmem_realloc): Use SECMEM_LOCK, SECMEM_UNLOCK, call _gcry_secmem_malloc_internal and _gcry_secmem_free_internal. (_gcry_private_is_secure): Use SECMEM_LOCK, SECMEM_UNLOCK. (_gcry_secmem_dump_stats): Likewise. (_gcry_secmem_malloc_internal): Removed unused variable: compressed. Include "ath.h". 2003-05-21 Moritz Schulte <moritz@g10code.com> * gcrypt.h (GCRY_CIPHER_SERPENT128, GCRY_CIPHER_SERPENT192, GCRY_CIPHER_SERPENT256): New symbols.
2003-03-12* sexp.c (sexp_sscan): Initialize NM. Thanks to Ian Peters forWerner Koch1-1/+1
valgrinding this.
2003-03-012003-02-28 Moritz Schulte <moritz@g10code.com>Moritz Schulte1-7/+0
* secmem.c (DEFAULT_PAGESIZE): New symbol. (init_pool): Use DEFAULT_PAGESIZE. 2003-02-23 Moritz Schulte <moritz@g10code.com> * secmem.h: Fix typo in declaration of _gcry_secmem_term. * sexp.c: Move macro definitions of `digitp', `octdigit', `alphap' and `hexdigit' ... * g10lib.h: ... here. * misc.c (_gcry_burn_stack): New function (former name: burn_stack). * g10lib.h (burn_stack): Declare _gcry_burn_stack().
2003-01-15* basic.c (verify_one_signature,check_pubkey_sign)Werner Koch1-5/+4
(check_pubkey): New. (main): Check public key functions. Add a --debug option. * sexp.c (gcry_sexp_length): Fixed. This was seriously broken. * pubkey.c (sexp_data_to_mpi): New. This handles pkcs1 padding. (gcry_pk_sign, gcry_pk_verify): Use it here. (gcry_pk_encrypt): And here. (pubkey_verify): Add debug code. (sexp_to_enc): Handle flags in the input and return the pkcs1 flag in a new parameter. (gcry_pk_decrypt): Prepare for future pkcs1 handling.
2002-05-16* tsexp.c (back_and_forth): Very minimal test of the new functions.Werner Koch1-18/+93
* missing-string.c: New. * gcrypt.h: Add new error codes GCRYERR_SEXP_ and typedefs GcryMPI, GcrySexp, GcryCipherHd, GcryMDHd as aliases for the old ones using an underscore. * global.c (gcry_strerror): Add strings fro the new error codes. * sexp.c (gcry_sexp_canon_len): Use a macro to convert from new to old error codes. (gcry_sexp_create,gcry_sexp_new): New.
2002-05-14Change the license to the LGPL.Werner Koch1-6/+6