summaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/internal.c
Commit message (Collapse)AuthorAgeFilesLines
* Small cleanups for pgcrypto. Marko KreenTom Lane2005-07-181-1/+12
|
* More pgcrypto fixes: avoid bogus alignment assumptions in sha2,Tom Lane2005-07-111-3/+2
| | | | | | 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-101-2/+3
|
* - Add Fortuna PRNG to pgcrypto.Bruce Momjian2005-07-101-1/+64
| | | | | | | | | | | - 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-101-1/+205
| | | | | | New hashes: SHA256, SHA384, SHA512. Marko Kreen
* pgcrypto update:Neil Conway2005-03-211-10/+10
| | | | | | | | | * 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-211-33/+19
| | | | | | | | | | 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-251-5/+5
| | | | writing 'foo()' rather than 'foo(void)'.
* Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane2004-05-071-2/+2
| | | | | | | | | | | | | 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-291-1/+1
|
* > > On Fri, Dec 21, 2001 at 11:43:21AM +0800, Christopher Kings-LynneBruce Momjian2002-01-031-5/+5
| | | | | | | | | | | | | | | | | | | | 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-201-11/+11
| | | | | | should be all. Marko Kreen
* pgcrypto uses non-standard type uint, which causes compileBruce Momjian2001-11-201-10/+10
| | | | | | | | | 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-051-3/+3
| | | | initdb/regression tests pass.
* Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian2001-10-281-3/+3
| | | | spacing. Also adds space for one-line comments.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-251-115/+165
| | | | tests pass.
* Fix some portability problems (get it to compile, at least, on HP's cc)Tom Lane2001-10-151-2/+2
|
* /contrib/pgcrypto:Bruce Momjian2001-08-211-39/+471
| | | | | | | | | | | | | | | | | | | | | | | * 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-221-26/+26
|
* Restructure the key include files per recent pghackers discussion: thereTom Lane2001-02-101-2/+2
| | | | | | | | | | | 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-311-0/+114