aboutsummaryrefslogtreecommitdiff
path: root/crypto/asn1/a_mbstr.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-22This has been added to avoid the situation where some host ctype.h functionsPauli1-60/+8
return true for characters > 127. I.e. they are allowing extended ASCII characters through which then cause problems. E.g. marking superscript '2' as a number then causes the common (ch - '0') conversion to number to fail miserably. Likewise letters with diacritical marks can also cause problems. If a non-ASCII character set is being used (currently only EBCDIC), it is adjusted for. The implementation uses a single table with a bit for each of the defined classes. These functions accept an int argument and fail for values out of range or for characters outside of the ASCII set. They will work for both signed and unsigned character inputs. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4102)
2017-07-06Memory bounds checking in asn1 code.Pauli1-3/+3
Check that sprint, strcpy don't overflow. Avoid some strlen operations when the previous sprintf return value can be used. Also fix the undefined behaviour `*(long *)x = y` when x isn't a long or character pointer. ISO/IEC 9899:1999 6.5/7 for the details. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3869)
2017-07-05Undo commit d420ac2Rich Salz1-2/+2
[extended tests] Original text: Use BUF_strlcpy() instead of strcpy(). Use BUF_strlcat() instead of strcat(). Use BIO_snprintf() instead of sprintf(). In some cases, keep better track of buffer lengths. This is part of a large change submitted by Markus Friedl <markus@openbsd.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/3701)
2016-05-17Copyright consolidation 08/10Rich Salz1-54/+5
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz1-1/+0
This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2015-11-09Continue standardising malloc style for libcryptoMatt Caswell1-1/+1
Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-09-07Updates for NumericString supportMatt Caswell1-4/+14
Ensure that EBCDIC support works and update a comment. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-09-07Add NumericString supportDmitry Belyavsky1-1/+15
GOST requires improved NumericString support. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte1-1/+1
There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-11Use p==NULL not !p (in if statements, mainly)Rich Salz1-1/+1
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-01free null cleanup finaleRich Salz1-5/+3
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell1-265/+288
Reviewed-by: Tim Hudson <tjh@openssl.org>
2009-10-04Fix unitialized warningsDr. Stephen Henson1-1/+1
2008-11-12Revert the size_t modifications from HEAD that had led to moreGeoff Thorpe1-7/+7
knock-on work than expected - they've been extracted into a patch series that can be completed elsewhere, or in a different branch, before merging back to HEAD.
2008-11-05Update obsolete email address...Dr. Stephen Henson1-1/+1
2008-11-01size_tification.Ben Laurie1-7/+7
2005-05-09Update util/ck_errf.pl script, and have it run automaticallyBodo Möller1-10/+10
during "make errors" and thus during "make update". Fix lots of bugs that util/ck_errf.pl can detect automatically. Various others of these are still left to fix; that's why "make update" will complain loudly when run now.
2003-12-27Use BUF_strlcpy() instead of strcpy().Richard Levitte1-2/+2
Use BUF_strlcat() instead of strcat(). Use BIO_snprintf() instead of sprintf(). In some cases, keep better track of buffer lengths. This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2003-08-21outlen should be int * in out_utf8.Dr. Stephen Henson1-1/+1
2000-09-10Marin Kraemer <Martin.Kraemer@MchP.Siemens.De> sent us patches to makeRichard Levitte1-0/+7
the OpenSSL commands x50 and req work better on a EBCDIC system.
2000-08-24New option to CA.pl to sign request using CA extensions.Dr. Stephen Henson1-1/+4
This allows intermediate CAs to be created more easily. PKCS12_create() now checks private key matches certificate. Fix typo in x509 app. Update docs. New function ASN1_STRING_to_UTF8() converts any ASN1_STRING type to UTF8.
2000-06-05int may be smaller than 32 bits.Bodo Möller1-2/+2
2000-06-01There have been a number of complaints from a number of sources that namesRichard Levitte1-2/+2
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-01-20Finish off the X509_ATTRIBUTE string stuff.Dr. Stephen Henson1-2/+2
2000-01-06Initial automation changes to 'req' and X509_ATTRIBUTE functions.Dr. Stephen Henson1-49/+1
1999-11-04Allow additional information to be attached to aDr. Stephen Henson1-1/+1
certificate: currently this includes trust settings and a "friendly name".
1999-10-27Continued multibyte character support.Dr. Stephen Henson1-0/+29
Add a bunch of functions to simplify the creation of X509_NAME structures. Change the X509_NAME_entry_add stuff in req/ca so it no longer uses X509_NAME_entry_count(): passing -1 has the same effect.
1999-10-25More multibyte character support.Dr. Stephen Henson1-8/+65
Functions to get keys from EVP_PKEY structures.
1999-10-23Constification.Ben Laurie1-4/+4
1999-10-23Don't return stuff from void functions.Ben Laurie1-2/+2
1999-10-21New function ASN1_mbstring_copy() to handle ASN1 string copying. UltimatelyDr. Stephen Henson1-0/+352
this will be used to clear up the horrible DN mess.