aboutsummaryrefslogtreecommitdiff
path: root/contrib/pgcrypto/openssl.c
Commit message (Collapse)AuthorAge
* 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 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.
* pgindent run for 8.3.Bruce Momjian2007-11-15
|
* Defend against openssl libraries that fail on keys longer than 128 bits;Tom Lane2007-09-29
| | | | which is the case at least on some Solaris versions. Marko Kreen
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Silence compiler warnings about incompatible function pointer types.Tom Lane2006-09-05
|
* "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.
* Patch from Marko Kreen:Neil Conway2006-02-18
| | | | | | | | | | | | | | | | pgcrypto crypt()/md5 and hmac() leak memory when compiled against OpenSSL as openssl.c digest ->reset will do two DigestInit calls against a context. This happened to work with OpenSSL 0.9.6 but not with 0.9.7+. Reason for the messy code was that I tried to avoid creating wrapper structure to transport algorithm info and tried to use OpenSSL context for it. The fix is to create wrapper structure. It also uses newer digest API to avoid memory allocations on reset with newer OpenSSLs. Thanks to Daniel Blaisdell for reporting it.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* More pgcrypto fixes: handle long messages correctly, suppressTom Lane2005-07-12
| | | | compiler warnings. Marko Kreen and Kris Jurka.
* 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
* Add support for AES cipher with older OpenSSL libraries.Tom Lane2005-07-11
| | | | Marko Kreen
* As Kris Jurka found out, pgcrypto does not work withBruce Momjian2005-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 0.9.6x. The DES functions use the older 'des_' API, but the newer 3DES functions use the 0.9.7x-only 'DES_' API. I think I just used /usr/include/openssl/des.h for reference when implementing them, and had upgraded OpenSSL in the meantime. Following patch converts DES also to newer API and provides compatibility functions for OpenSSL < 0.9.7. I chose this route because: - openssl.c uses few DES functions. - compatibility for old 'des_' API is going away at some point of time from OpenSSL. - as seen from macros, new API is saner - Thus pgcrypto supports any OpenSSL version from 0.9.5 to 1.0 Tested with OpenSSL 0.9.6c and 0.9.7e. Marko Kreen
* - 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
* Fix initialization bug in pgcrypto openssl code. Marko KreenTom Lane2005-07-05
|
* Bruce, please apply this additional patch, that fixes theBruce Momjian2005-07-04
| | | | | | | | | auto-detection of AES. Now openssl.c just checks OpenSSL version. Whoever compiles newer OpenSSL without AES is on his own. Marko Kreen
* This patch allows contrib/pgcrypto to build with OpenSSL 0.9.8Bruce Momjian2005-07-03
| | | | | | | | | | | | | | | | | | (currently in beta) when cryptolib = openssl. According to the following checkin message from several years ago, OpenSSL application developers should no longer rely on <openssl/evp.h> to include everything they need: http://cvs.openssl.org/chngview?cn=9888 This patch adds the necessary header files. It doesn't appear to break anything when building against OpenSSL 0.9.7. BTW, core appears to build and work fine with OpenSSL 0.9.8. I've built 7.3 through HEAD against 0.9.8-beta6 without noticing any problems. Michael Fuhr
* pgcrypto update:Neil Conway2005-03-21
| | | | | | | | | | | * openssl.c: Add 3des and AES support * README.pgcrypto: list only supported ciphers for openssl OpenSSL has pre-processor symbol OPENSSL_NO_AES, which isn't that helpful for detecting if it _does_ exist. Thus the hack with AES_ENCRYPT. 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
* Some builds (depends on crypto engine support?) of OpenSSLNeil Conway2005-03-12
| | | | | | | | | | | | 0.9.7x have EVP_DigestFinal function which which clears all of EVP_MD_CTX. This makes pgcrypto crash in functions which re-use one digest context several times: hmac() and crypt() with md5 algorithm. Following patch fixes it by carring the digest info around EVP_DigestFinal and re-initializing cipher. Marko Kreen.
* make sure the $Id tags are converted to $PostgreSQL as well ...PostgreSQL Daemon2003-11-29
|
* pgindent run.Bruce Momjian2003-08-04
|
* OpenSSL 0.9.6g in Debian/unstable stopped working with pgcrypto. ThisBruce Momjian2002-11-15
| | | | | | | | | | | is pgcrypto bug as it assumed too much about inner workings of OpenSSL. Following patch stops pgcrypto using EVP* functions for ciphers and lets it manage ciphers itself. This patch supports Blowfish, DES and CAST5 algorithms. Marko Kreen
* 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.
* Big thanks to Solar Designer who pointed out a bug in bcryptBruce Momjian2001-09-23
| | | | | | | | | | | | | | | | | | | | salt generation code. He also urged using better random source and making possible to choose using bcrypt and xdes rounds more easily. So, here's patch: * For all salt generation, use Solar Designer's own code. This is mostly due fact that his code is more fit for get_random_bytes() style interface. * New function: gen_salt(type, rounds). This lets specify iteration count for algorithm. * random.c: px_get_random_bytes() function. Supported randomness soure: /dev/urandom, OpenSSL PRNG, libc random() Default: /dev/urandom. * Draft description of C API for pgcrypto functions. New files: API, crypt-gensalt.c, random.c Marko Kreen
* /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