summaryrefslogtreecommitdiffstats
path: root/apps/asn1pars.c
AgeCommit message (Collapse)Author
2016-10-14Constify command optionsFdaSilvaYY
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1694)
2016-09-29Add -item option to asn1parseDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-17Constify char* input parameters in apps codeFdaSilvaYY
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-06-18Replace 4 casts with 1Matt Caswell
Changing the type of the |str| variable in asn1pars enables us to remove 4 casts with just 1. This silences an OpenBSD warning along the way. RT4378 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-17Copyright consolidation 01/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-05-04GH932: Add more help messages to some apps options.FdaSilvaYY
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-04-13Deprecate OBJ_cleanup() and make it a no-opMatt Caswell
OBJ_cleanup() should not be called expicitly - we should leave auto-deinit to clean this up instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-20argv was set but unusedKurt Roeckx
Also gives an error message when you gave it a parameter it didn't expect. Reviewed-by: Rich Salz <rsalz@openssl.org> MR: #2009
2016-02-06commands help cleanupA J Mohan Rao
opt_valtype 0 is same as '-' while printing cmd usage asn1parse/ca/ciphers help cleanup Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-10-12Centralise loading default apps config fileMatt Caswell
Loading the config file after processing command line options can cause problems, e.g. where an engine provides new ciphers/digests these are not then recoginised on the command line. Move the default config file loading to before the command line option processing. Whilst we're doing this we might as well centralise this instead of doing it individually for each application. Finally if we do it before the OpenSSL_add_ssl_algorithms() call then ciphersuites provided by an engine (e.g. GOST) can be available to the apps. RT#4085 RT#4086 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-10-06Don't try and parse boolean type.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-06Change the way apps open their input and output filesRichard Levitte
The different apps had the liberty to decide whether they would open their input and output files in binary mode or not, which could be confusing if two different apps were handling the same type of file in different ways. The solution is to centralise the decision of low level file organisation, and that the apps would use a selection of formats to state the intent of the file. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-06Make the handling of output and input formats consistentRichard Levitte
Most of all, we needed to sort out which ones are binary and which ones are text, and make sure they are treated accordingly and consistently so Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-29fix asn1parse -informDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-29Restore module loadingRichard Levitte
The module loading feature got broken a while ago, so restore it, but have it a bit more explicit this time around. Reviewed-by: Stephen Henson <steve@openssl.org>
2015-05-28RT3876: Only load config when neededRich Salz
Create app_load_config(), a routine to load config file. Remove the "always load config" from the main app. Change the places that used to load config to call the new common routine. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-02Fix uninitialized variable.Hanno Böck
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-05-01free NULL cleanup -- codaRich Salz
After the finale, the "real" final part. :) Do a recursive grep with "-B1 -w [a-zA-Z0-9_]*_free" to see if any of the preceeding lines are an "if NULL" check that can be removed. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-01free null cleanup finaleRich Salz
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-30free NULL cleanup 8Rich Salz
Do not check for NULL before calling a free routine. This addresses: ASN1_BIT_STRING_free ASN1_GENERALIZEDTIME_free ASN1_INTEGER_free ASN1_OBJECT_free ASN1_OCTET_STRING_free ASN1_PCTX_free ASN1_SCTX_free ASN1_STRING_clear_free ASN1_STRING_free ASN1_TYPE_free ASN1_UTCTIME_free M_ASN1_free_of Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-29Remove needless bio_err argumentRich Salz
Many functions had a BIO* parameter, and it was always called with bio_err. Remove the param and just use bio_err. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-04-24Big apps cleanup (option-parsing, etc)Rich Salz
This is merges the old "rsalz-monolith" branch over to master. The biggest change is that option parsing switch from cascasding 'else if strcmp("-foo")' to a utility routine and somethin akin to getopt. Also, an error in the command line no longer prints the full summary; use -help (or --help :) for that. There have been many other changes and code-cleanup, see bullet list below. Special thanks to Matt for the long and detailed code review. TEMPORARY: For now, comment out CRYPTO_mem_leaks() at end of main Tickets closed: RT3515: Use 3DES in pkcs12 if built with no-rc2 RT1766: s_client -reconnect and -starttls broke RT2932: Catch write errors RT2604: port should be 'unsigned short' RT2983: total_bytes undeclared #ifdef RENEG RT1523: Add -nocert to fix output in x509 app RT3508: Remove unused variable introduced by b09eb24 RT3511: doc fix; req default serial is random RT1325,2973: Add more extensions to c_rehash RT2119,3407: Updated to dgst.pod RT2379: Additional typo fix RT2693: Extra include of string.h RT2880: HFS is case-insensitive filenames RT3246: req command prints version number wrong Other changes; incompatibilities marked with *: Add SCSV support Add -misalign to speed command Make dhparam, dsaparam, ecparam, x509 output C in proper style Make some internal ocsp.c functions void Only display cert usages with -help in verify Use global bio_err, remove "BIO*err" parameter from functions For filenames, - always means stdin (or stdout as appropriate) Add aliases for -des/aes "wrap" ciphers. *Remove support for IISSGC (server gated crypto) *The undocumented OCSP -header flag is now "-header name=value" *Documented the OCSP -header flag Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-25free NULL cleanupRich Salz
This commit handles BIO_ACCEPT_free BIO_CB_FREE BIO_CONNECT_free BIO_free BIO_free_all BIO_vfree Reviewed-by: Matt Caswell <matt@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-30mark all block comments that need format preserving so thatTim Hudson
indent will not alter them when reformatting comments Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2014-05-26Changed -strictpem to use PEM_read_bioMatt Caswell
2014-05-26Added -strictpem parameter to enable processing of PEM files with data prior ↵Matt Caswell
to the BEGIN marker
2011-05-25PR: 2527Dr. Stephen Henson
Submitted by: Marcus Meissner <meissner@suse.de> Reviewed by: steve Set cnf to NULL to avoid possible double free.
2009-07-27Update from 1.0.0-stableDr. Stephen Henson
2008-11-05Update obsolete email address...Dr. Stephen Henson
2008-06-04More type-checking.Ben Laurie
2005-06-28asn1parse doesn't support any TXT format, so let's stop pretendingRichard Levitte
it does.
2004-07-01Don't try to parse non string types.Dr. Stephen Henson
2004-03-15Constify d2i, s2i, c2i and r2i functions and other associatedRichard Levitte
functions and macros. This change has associated tags: LEVITTE_before_const and LEVITTE_after_const. Those will be removed when this change has been properly reviewed.
2004-02-10minor signed/unsigned warning fixesGeoff Thorpe
2004-02-08Fix handling of -offset and -length in asn1parse tool.Dr. Stephen Henson
If -offset exceeds -length of data available exit with an error. Don't read past end of total data available when -offset supplied. If -length exceeds total available truncate it.
2002-12-03EXIT() may mean return(). That's confusing, so let's have it really meanRichard Levitte
exit() in whatever way works for the intended platform, and define OPENSSL_EXIT() to have the old meaning (the name is of course because it's only used in the openssl program)
2002-11-12Initial ASN1 generation code. This can constructDr. Stephen Henson
arbitrary encodings from strings and config files. Documentation to follow...
2002-05-30Remove the duplicate description of -out.Richard Levitte
PR: 28
2002-02-22Config code updates.Dr. Stephen Henson
CONF_modules_unload() now calls CONF_modules_finish() automatically. Default use of section openssl_conf moved to CONF_modules_load() Load config file in several openssl utilities. Most utilities now load modules from the config file, though in a few (such as version) this isn't done because it couldn't be used for anything. In the case of ca and req the config file used is the same as the utility itself: that is the -config command line option can be used to specify an alternative file.
2001-06-23Use apps_shutdown() in all applications, in case someone decides notRichard Levitte
to go the monolith way (does anyone do that these days?). NOTE: a few applications are missing in this commit. I've a few more changes in them that I haven't tested yet.
2001-02-20Use new-style system-id macros everywhere possible. I hope I haven'tRichard Levitte
missed any. This compiles and runs on Linux, and external applications have no problems with it. The definite test will be to build this on VMS.
2000-09-20On VMS, stdout may very well lead to a file that is written to in aRichard Levitte
record-oriented fashion. That means that every write() will write a separate record, which will be read separately by the programs trying to read from it. This can be very confusing. The solution is to put a BIO filter in the way that will buffer text until a linefeed is reached, and then write everything a line at a time, so every record written will be an actual line, not chunks of lines and not (usually doesn't happen, but I've seen it once) several lines in one record. Voila, BIO_f_linebuffer() is born. Since we're so close to release time, I'm making this VMS-only for now, just to make sure no code is needlessly broken by this. After the release, this BIO method will be enabled on all other platforms as well.
2000-07-27Add the possibility to get hexdumps of unprintable data when usingRichard Levitte
'openssl asn1parse'. As a side effect, the functions ASN1_parse_dump and BIO_dump_indent are added.
2000-06-01There have been a number of complaints from a number of sources that namesRichard Levitte
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
2000-02-11Make gcc 2.95.2 happy again, even under ``-Wall -Wshadow -Wpointer-arith ↵Ralf S. Engelschall
-Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline''.
2000-02-03ispell (and minor modifications)Ulf Möller
1999-10-05Fix for bug in pkcs12 program and typo in ASN1_tag2str().Dr. Stephen Henson
1999-05-15Various Win32 fixes. Change args in do_ms.bat to put platform last. FixDr. Stephen Henson
unsigned/signed cmp error in asn1parse. Change various pem_all.c args to use pem_password_cb.
1999-05-12Add new -out option to asn1parse to allow the parsed data to be output.Dr. Stephen Henson
Fixed -strparse option: it didn't work if used more than once (this was due to the d2i_ASN1_TYPE call parsing a freed buffer). On Win32 the file wincrypt.h #define's X509_NAME and PKCS7_SIGNER_INFO causing clashes so these are #undef'ed