26
26
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
27
* SUCH DAMAGE.
28
28
*
29
- * $Id: openssl.c,v 1.8 2001/11/05 17:46:23 momjian Exp $
29
+ * $Id: openssl.c,v 1.9 2001/11/20 15:50:53 momjian Exp $
30
30
*/
31
31
32
32
#include <postgres.h>
@@ -60,7 +60,7 @@ digest_reset(PX_MD * h)
60
60
}
61
61
62
62
static void
63
- digest_update (PX_MD * h ,const uint8 * data ,uint dlen )
63
+ digest_update (PX_MD * h ,const uint8 * data ,unsigned dlen )
64
64
{
65
65
EVP_MD_CTX * ctx = (EVP_MD_CTX * )h -> p .ptr ;
66
66
@@ -108,8 +108,8 @@ typedef struct
108
108
const EVP_CIPHER * evp_ciph ;
109
109
uint8 key [EVP_MAX_KEY_LENGTH ];
110
110
uint8 iv [EVP_MAX_IV_LENGTH ];
111
- uint klen ;
112
- uint init ;
111
+ unsigned klen ;
112
+ unsigned init ;
113
113
}ossldata ;
114
114
115
115
/* generic EVP */
@@ -133,7 +133,7 @@ gen_evp_key_size(PX_Cipher * c)
133
133
static uint
134
134
gen_evp_iv_size (PX_Cipher * c )
135
135
{
136
- uint ivlen ;
136
+ unsigned ivlen ;
137
137
ossldata * od = (ossldata * )c -> ptr ;
138
138
139
139
ivlen = EVP_CIPHER_iv_length (od -> evp_ciph );
@@ -153,10 +153,10 @@ gen_evp_free(PX_Cipher * c)
153
153
/* fun */
154
154
155
155
static int
156
- gen_evp_init (PX_Cipher * c ,const uint8 * key ,uint klen ,const uint8 * iv )
156
+ gen_evp_init (PX_Cipher * c ,const uint8 * key ,unsigned klen ,const uint8 * iv )
157
157
{
158
158
ossldata * od = (ossldata * )c -> ptr ;
159
- uint bs = gen_evp_block_size (c );
159
+ unsigned bs = gen_evp_block_size (c );
160
160
161
161
if (iv )
162
162
memcpy (od -> iv ,iv ,bs );
@@ -179,7 +179,7 @@ _gen_init(PX_Cipher * c, int enc)
179
179
}
180
180
181
181
static int
182
- gen_evp_encrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
182
+ gen_evp_encrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
183
183
{
184
184
ossldata * od = c -> ptr ;
185
185
@@ -190,7 +190,7 @@ gen_evp_encrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
190
190
}
191
191
192
192
static int
193
- gen_evp_decrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
193
+ gen_evp_decrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
194
194
{
195
195
ossldata * od = c -> ptr ;
196
196
@@ -203,7 +203,7 @@ gen_evp_decrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
203
203
/* Blowfish */
204
204
205
205
static int
206
- bf_init (PX_Cipher * c ,const uint8 * key ,uint klen ,const uint8 * iv )
206
+ bf_init (PX_Cipher * c ,const uint8 * key ,unsigned klen ,const uint8 * iv )
207
207
{
208
208
ossldata * od = c -> ptr ;
209
209
@@ -217,9 +217,9 @@ bf_init(PX_Cipher * c, const uint8 *key, uint klen, const uint8 *iv)
217
217
}
218
218
219
219
static int
220
- bf_ecb_encrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
220
+ bf_ecb_encrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
221
221
{
222
- uint bs = gen_evp_block_size (c ),
222
+ unsigned bs = gen_evp_block_size (c ),
223
223
i ;
224
224
ossldata * od = c -> ptr ;
225
225
@@ -229,9 +229,9 @@ bf_ecb_encrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
229
229
}
230
230
231
231
static int
232
- bf_ecb_decrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
232
+ bf_ecb_decrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
233
233
{
234
- uint bs = gen_evp_block_size (c ),
234
+ unsigned bs = gen_evp_block_size (c ),
235
235
i ;
236
236
ossldata * od = c -> ptr ;
237
237
@@ -241,7 +241,7 @@ bf_ecb_decrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
241
241
}
242
242
243
243
static int
244
- bf_cbc_encrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
244
+ bf_cbc_encrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
245
245
{
246
246
ossldata * od = c -> ptr ;
247
247
@@ -250,7 +250,7 @@ bf_cbc_encrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
250
250
}
251
251
252
252
static int
253
- bf_cbc_decrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
253
+ bf_cbc_decrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
254
254
{
255
255
ossldata * od = c -> ptr ;
256
256
@@ -259,7 +259,7 @@ bf_cbc_decrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
259
259
}
260
260
261
261
static int
262
- bf_cfb64_encrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
262
+ bf_cfb64_encrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
263
263
{
264
264
ossldata * od = c -> ptr ;
265
265
@@ -269,7 +269,7 @@ bf_cfb64_encrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
269
269
}
270
270
271
271
static int
272
- bf_cfb64_decrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
272
+ bf_cfb64_decrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
273
273
{
274
274
ossldata * od = c -> ptr ;
275
275
@@ -279,7 +279,7 @@ bf_cfb64_decrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
279
279
}
280
280
281
281
static int
282
- bf_ofb64_encrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
282
+ bf_ofb64_encrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
283
283
{
284
284
ossldata * od = c -> ptr ;
285
285
@@ -288,7 +288,7 @@ bf_ofb64_encrypt(PX_Cipher * c, const uint8 *data, uint dlen, uint8 *res)
288
288
}
289
289
290
290
static int
291
- bf_ofb64_decrypt (PX_Cipher * c ,const uint8 * data ,uint dlen ,uint8 * res )
291
+ bf_ofb64_decrypt (PX_Cipher * c ,const uint8 * data ,unsigned dlen ,uint8 * res )
292
292
{
293
293
ossldata * od = c -> ptr ;
294
294
@@ -371,7 +371,7 @@ static PX_Cipher gen_evp_handler = {
371
371
static int px_openssl_initialized = 0 ;
372
372
373
373
/* ATM not needed
374
- static void *o_alloc(uint s) { return px_alloc(s); }
374
+ static void *o_alloc(unsigned s) { return px_alloc(s); }
375
375
static void *o_realloc(void *p) { return px_realloc(p); }
376
376
static void o_free(void *p) { px_free(p); }
377
377
*/
@@ -416,7 +416,7 @@ px_find_digest(const char *name, PX_MD ** res)
416
416
int
417
417
px_find_cipher (const char * name ,PX_Cipher * * res )
418
418
{
419
- uint i ;
419
+ unsigned i ;
420
420
PX_Cipher * c = NULL ,
421
421
* csrc ;
422
422
ossldata * od ;