~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/include/libssh2/crypto.h

  • Committer: Package Import Robot
  • Author(s): Christoph Berg
  • Date: 2013-09-10 16:16:38 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20130910161638-wwup1q553ylww7dr
Tags: 1.18.0-1
* New upstream release.
* Don't install /usr/bin/png2c anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2009, 2010 Simon Josefsson
 
2
 * Copyright (C) 2006, 2007 The Written Word, Inc.  All rights reserved.
 
3
 * Copyright (C) 2010 Daniel Stenberg
 
4
 *
 
5
 * Redistribution and use in source and binary forms,
 
6
 * with or without modification, are permitted provided
 
7
 * that the following conditions are met:
 
8
 *
 
9
 *   Redistributions of source code must retain the above
 
10
 *   copyright notice, this list of conditions and the
 
11
 *   following disclaimer.
 
12
 *
 
13
 *   Redistributions in binary form must reproduce the above
 
14
 *   copyright notice, this list of conditions and the following
 
15
 *   disclaimer in the documentation and/or other materials
 
16
 *   provided with the distribution.
 
17
 *
 
18
 *   Neither the name of the copyright holder nor the names
 
19
 *   of any other contributors may be used to endorse or
 
20
 *   promote products derived from this software without
 
21
 *   specific prior written permission.
 
22
 *
 
23
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
 
24
 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 
25
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 
26
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
27
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 
28
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
29
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 
30
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
31
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
32
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
33
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 
34
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 
35
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
 
36
 * OF SUCH DAMAGE.
 
37
 */
 
38
#ifndef LIBSSH2_CRYPTO_H
 
39
#define LIBSSH2_CRYPTO_H
 
40
 
 
41
#ifdef LIBSSH2_LIBGCRYPT
 
42
#include "libgcrypt.h"
 
43
#else
 
44
#include "openssl.h"
 
45
#endif
 
46
 
 
47
int _libssh2_rsa_new(libssh2_rsa_ctx ** rsa,
 
48
                     const unsigned char *edata,
 
49
                     unsigned long elen,
 
50
                     const unsigned char *ndata,
 
51
                     unsigned long nlen,
 
52
                     const unsigned char *ddata,
 
53
                     unsigned long dlen,
 
54
                     const unsigned char *pdata,
 
55
                     unsigned long plen,
 
56
                     const unsigned char *qdata,
 
57
                     unsigned long qlen,
 
58
                     const unsigned char *e1data,
 
59
                     unsigned long e1len,
 
60
                     const unsigned char *e2data,
 
61
                     unsigned long e2len,
 
62
                     const unsigned char *coeffdata, unsigned long coefflen);
 
63
int _libssh2_rsa_new_private(libssh2_rsa_ctx ** rsa,
 
64
                             LIBSSH2_SESSION * session,
 
65
                             const char *filename,
 
66
                             unsigned const char *passphrase);
 
67
int _libssh2_rsa_sha1_verify(libssh2_rsa_ctx * rsa,
 
68
                             const unsigned char *sig,
 
69
                             unsigned long sig_len,
 
70
                             const unsigned char *m, unsigned long m_len);
 
71
int _libssh2_rsa_sha1_sign(LIBSSH2_SESSION * session,
 
72
                           libssh2_rsa_ctx * rsactx,
 
73
                           const unsigned char *hash,
 
74
                           size_t hash_len,
 
75
                           unsigned char **signature,
 
76
                           size_t *signature_len);
 
77
 
 
78
#if LIBSSH2_DSA
 
79
int _libssh2_dsa_new(libssh2_dsa_ctx ** dsa,
 
80
                     const unsigned char *pdata,
 
81
                     unsigned long plen,
 
82
                     const unsigned char *qdata,
 
83
                     unsigned long qlen,
 
84
                     const unsigned char *gdata,
 
85
                     unsigned long glen,
 
86
                     const unsigned char *ydata,
 
87
                     unsigned long ylen,
 
88
                     const unsigned char *x, unsigned long x_len);
 
89
int _libssh2_dsa_new_private(libssh2_dsa_ctx ** dsa,
 
90
                             LIBSSH2_SESSION * session,
 
91
                             const char *filename,
 
92
                             unsigned const char *passphrase);
 
93
int _libssh2_dsa_sha1_verify(libssh2_dsa_ctx * dsactx,
 
94
                             const unsigned char *sig,
 
95
                             const unsigned char *m, unsigned long m_len);
 
96
int _libssh2_dsa_sha1_sign(libssh2_dsa_ctx * dsactx,
 
97
                           const unsigned char *hash,
 
98
                           unsigned long hash_len, unsigned char *sig);
 
99
#endif
 
100
 
 
101
int _libssh2_cipher_init(_libssh2_cipher_ctx * h,
 
102
                         _libssh2_cipher_type(algo),
 
103
                         unsigned char *iv,
 
104
                         unsigned char *secret, int encrypt);
 
105
 
 
106
int _libssh2_cipher_crypt(_libssh2_cipher_ctx * ctx,
 
107
                          _libssh2_cipher_type(algo),
 
108
                          int encrypt, unsigned char *block, size_t blocksize);
 
109
 
 
110
int _libssh2_pub_priv_keyfile(LIBSSH2_SESSION *session,
 
111
                              unsigned char **method,
 
112
                              size_t *method_len,
 
113
                              unsigned char **pubkeydata,
 
114
                              size_t *pubkeydata_len,
 
115
                              const char *privatekey,
 
116
                              const char *passphrase);
 
117
 
 
118
void _libssh2_init_aes_ctr(void);
 
119
 
 
120
#endif