aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/internal.c
Commit message (Collapse)AuthorAge
* pgindent run for 9.4Bruce Momjian2014-05-06
| | | | | This includes removing tabs after periods in C comments, which was applied to back branches, so this change should not effect backpatching.
* pgcrypto: fix memset() calls that might be optimized awayBruce Momjian2014-04-17
| | | | | | | | | | | | | | Specifically, on-stack memset() might be removed, so: * Replace memset() with px_memset() * Add px_memset to copy_crlf() * Add px_memset to pgp-s2k.c Patch by Marko Kreen Report by PVS-Studio Backpatch through 8.4.
* Standardize treatment of strcmp() return valuePeter Eisentraut2011-12-27
| | | | | Always compare the return value to 0, don't use cute tricks like if (!strcmp(...)).
* Remove unnecessary #include references, per pgrminclude script.Bruce Momjian2011-09-01
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Replace time_t with pg_time_t (same values, but always int64) in on-diskTom Lane2008-02-17
| | | | | | | | | | | | | | data structures and backend internal APIs. This solves problems we've seen recently with inconsistent layout of pg_control between machines that have 32-bit time_t and those that have already migrated to 64-bit time_t. Also, we can get out from under the problem that Windows' Unix-API emulation is not consistent about the width of time_t. There are a few remaining places where local time_t variables are used to hold the current or recent result of time(NULL). I didn't bother changing these since they do not affect any cross-module APIs and surely all platforms will have 64-bit time_t before overflow becomes an actual risk. time_t should be avoided for anything visible to extension modules, however.
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Replace 4-clause licensed blf.[ch] with blowfish implementationNeil Conway2007-03-28
| | | | from PuTTY with is under minimal BSD/MIT license. Marko Kreen.
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* "Annual" pgcrypto update from Marko Kreen:Neil Conway2006-07-13
| | | | | | | | | | | | | | | | Few cleanups and couple of new things: - add SHA2 algorithm to older OpenSSL - add BIGNUM math to have public-key cryptography work on non-OpenSSL build. - gen_random_bytes() function The status of SHA2 algoritms and public-key encryption can now be changed to 'always available.' That makes pgcrypto functionally complete and unless there will be new editions of AES, SHA2 or OpenPGP standards, there is no major changes planned.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Fortuna fixes. Marko KreenTom Lane2005-07-18
|
* Small cleanups for pgcrypto. Marko KreenTom Lane2005-07-18
|
* More pgcrypto fixes: avoid bogus alignment assumptions in sha2,Tom Lane2005-07-11
| | | | | | be more wary about having a value for BYTE_ORDER, clean up randomly- chosen ways of including Postgres core headers. Marko Kreen and Tom Lane
* Suppress compile warning.Tom Lane2005-07-10
|
* - Add Fortuna PRNG to pgcrypto.Bruce Momjian2005-07-10
| | | | | | | | | | | - Move openssl random provider to openssl.c and builtin provider to internal.c - Make px_random_bytes use Fortuna, instead of giving error. - Retarget random.c to aquiring system randomness, for initial seeding of Fortuna. There is ATM 2 functions for Windows, reader from /dev/urandom and the regular time()/getpid() silliness. Marko Kreen
* This patch adds implementation of SHA2 to pgcrypto.Bruce Momjian2005-07-10
| | | | | | New hashes: SHA256, SHA384, SHA512. Marko Kreen
* pgcrypto update:Neil Conway2005-03-21
| | | | | | | | | * Use error codes instead of -1 * px_strerror for new error codes * calling convention change for px_gen_salt - return error code * use px_strerror in pgcrypto.c Marko Kreen
* * construct "struct {} list [] = {}" confuses pgindent - split those.Neil Conway2005-03-21
| | | | | | | | | | It was a bad style to begin with, and now several loops can be clearer. * pgcrypto.c: Fix function comments * crypt-gensalt.c, crypt-blowfish.c: stop messing with errno * openssl.c: use px_free instead pfree * px.h: make redefining px_alloc/px_realloc/px_free easier Marko Kreen
* Fix a bunch of 'old-style parameter declaration' warnings induced byTom Lane2004-10-25
| | | | writing 'foo()' rather than 'foo(void)'.
* Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane2004-05-07
| | | | | | | | | | | | | conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale.
* make sure the $Id tags are converted to $PostgreSQL as well ...PostgreSQL Daemon2003-11-29
|
* > > On Fri, Dec 21, 2001 at 11:43:21AM +0800, Christopher Kings-LynneBruce Momjian2002-01-03
| | | | | | | | | | | | | | | | | | | | wrote: > > > Just testing pgcrypto on freebsd/alpha. I get some warnings: > > They should be harmless, although I should fix them. > > The actual code is: > > if ((dlen & 15) || (((unsigned) res) & 3)) > return -1; > Hard to imagine how (uint *) & 3 makes any sense, unless res isn't > always a (uint8 *). Is that true? At some point it was casted to (uint32*) so I wanted to be sure its ok. ATM its pointless. Please apply the following patch. -- marko
* Duh, my regexp's missed bunch of them. Here's next batch, thisBruce Momjian2001-11-20
| | | | | | should be all. Marko Kreen
* pgcrypto uses non-standard type uint, which causes compileBruce Momjian2001-11-20
| | | | | | | | | failures on FreeBSD. This patch replaces uint -> unsigned. This was reported by Daniel Holtzman against 0.4pre3 standalone package, but it needs fixing in contrib/pgcrypto too. Marko Kreen
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-05
| | | | initdb/regression tests pass.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-28
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Fix some portability problems (get it to compile, at least, on HP's cc)Tom Lane2001-10-15
|
* /contrib/pgcrypto:Bruce Momjian2001-08-21
| | | | | | | | | | | | | | | | | | | | | | | * remove support for encode() as it is in main tree now * remove krb5.c * new 'PX library' architecture * remove BSD license from my code to let the general PostgreSQL one to apply * md5, sha1: ANSIfy, use const where appropriate * various other formatting and clarity changes * hmac() * UN*X-like crypt() - system or internal crypt * Internal crypt: DES, Extended DES, MD5, Blowfish crypt-des.c, crypt-md5.c from FreeBSD crypt-blowfish.c from Solar Designer * gen_salt() for crypt() - Blowfish, MD5, DES, Extended DES * encrypt(), decrypt(), encrypt_iv(), decrypt_iv() * Cipher support in mhash.c, openssl.c * internal: Blowfish, Rijndael-128 ciphers * blf.[ch], rijndael.[ch] from OpenBSD * there will be generated file rijndael-tbl.inc. Marko Kreen
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Restructure the key include files per recent pghackers discussion: thereTom Lane2001-02-10
| | | | | | | | | | | are now separate files "postgres.h" and "postgres_fe.h", which are meant to be the primary include files for backend .c files and frontend .c files respectively. By default, only include files meant for frontend use are installed into the installation include directory. There is a new make target 'make install-all-headers' that adds the whole content of the src/include tree to the installed fileset, for use by people who want to develop server-side code without keeping the complete source tree on hand. Cleaned up a whole lot of crufty and inconsistent header inclusions.
* Hashing functions from Marko Kreen <marko@l-t.ee>Peter Eisentraut2000-10-31