~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/pgp-mpi-openssl.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
27
 * SUCH DAMAGE.
28
28
 *
29
 
 * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-openssl.c,v 1.4 2005/10/15 02:49:06 momjian Exp $
 
29
 * $PostgreSQL: pgsql/contrib/pgcrypto/pgp-mpi-openssl.c,v 1.5 2009/06/11 14:48:52 momjian Exp $
30
30
 */
31
31
#include "postgres.h"
32
32
 
37
37
#include "pgp.h"
38
38
 
39
39
static BIGNUM *
40
 
mpi_to_bn(PGP_MPI * n)
 
40
mpi_to_bn(PGP_MPI *n)
41
41
{
42
42
        BIGNUM     *bn = BN_bin2bn(n->data, n->bytes, NULL);
43
43
 
99
99
}
100
100
 
101
101
int
102
 
pgp_elgamal_encrypt(PGP_PubKey * pk, PGP_MPI * _m,
103
 
                                        PGP_MPI ** c1_p, PGP_MPI ** c2_p)
 
102
pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m,
 
103
                                        PGP_MPI **c1_p, PGP_MPI **c2_p)
104
104
{
105
105
        int                     res = PXE_PGP_MATH_FAILED;
106
106
        int                     k_bits;
162
162
}
163
163
 
164
164
int
165
 
pgp_elgamal_decrypt(PGP_PubKey * pk, PGP_MPI * _c1, PGP_MPI * _c2,
166
 
                                        PGP_MPI ** msg_p)
 
165
pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2,
 
166
                                        PGP_MPI **msg_p)
167
167
{
168
168
        int                     res = PXE_PGP_MATH_FAILED;
169
169
        BIGNUM     *c1 = mpi_to_bn(_c1);
213
213
}
214
214
 
215
215
int
216
 
pgp_rsa_encrypt(PGP_PubKey * pk, PGP_MPI * _m, PGP_MPI ** c_p)
 
216
pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p)
217
217
{
218
218
        int                     res = PXE_PGP_MATH_FAILED;
219
219
        BIGNUM     *m = mpi_to_bn(_m);
249
249
}
250
250
 
251
251
int
252
 
pgp_rsa_decrypt(PGP_PubKey * pk, PGP_MPI * _c, PGP_MPI ** m_p)
 
252
pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p)
253
253
{
254
254
        int                     res = PXE_PGP_MATH_FAILED;
255
255
        BIGNUM     *c = mpi_to_bn(_c);