int c;
int ia5=0;
int t61=0;
+ int ignore_len = 0;
- if (len <= 0) len= -1;
+ if (len == 0) ignore_len = 1;
if (s == NULL) return(V_ASN1_PRINTABLESTRING);
- while ((*s) && (len-- != 0))
+ while (*s && !ignore_len && len-- != 0)
{
c= *(s++);
#ifndef CHARSET_EBCDIC
typedef struct
{
unsigned char *pbData;
- int cbData;
+ size_t cbData;
} MYBLOB;
/* SetBlobCmp
}
/* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
-int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
- i2d_of_void *i2d, int ex_tag, int ex_class,
- int is_set)
+size_t i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
+ i2d_of_void *i2d, int ex_tag, int ex_class,
+ int is_set)
{
- int ret=0,r;
+ size_t ret=0,r;
int i;
unsigned char *p;
unsigned char *pStart, *pTempMem;
void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
int (*param_decode)(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen),
+ const unsigned char **pder, size_t derlen),
int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder),
int (*param_missing)(const EVP_PKEY *pk),
int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from),
int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b),
int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent,
- ASN1_PCTX *pctx))
+ ASN1_PCTX *pctx))
{
ameth->param_decode = param_decode;
ameth->param_encode = param_encode;
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
- type *d2i_##name(type **a, const unsigned char **in, long len); \
+ type *d2i_##name(type **a, const unsigned char **in, size_t len); \
int i2d_##name(type *a, unsigned char **out); \
DECLARE_ASN1_ITEM(itname)
#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
- type *d2i_##name(type **a, const unsigned char **in, long len); \
+ type *d2i_##name(type **a, const unsigned char **in, size_t len); \
int i2d_##name(const type *a, unsigned char **out); \
DECLARE_ASN1_ITEM(name)
int fname##_print_ctx(BIO *out, stname *x, int indent, \
const ASN1_PCTX *pctx);
-#define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
+#define D2I_OF(type) type *(*)(type **,const unsigned char **,size_t)
#define I2D_OF(type) int (*)(type *,unsigned char **)
#define I2D_OF_const(type) int (*)(const type *,unsigned char **)
#define CHECKED_PPTR_OF(type, p) \
((void**) (1 ? p : (type**)0))
-#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
+#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,size_t)
#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
int ASN1_TIME_check(ASN1_TIME *t);
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
-int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
- i2d_of_void *i2d, int ex_tag, int ex_class,
- int is_set);
+size_t i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
+ i2d_of_void *i2d, int ex_tag, int ex_class,
+ int is_set);
STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp,
size_t length, d2i_of_void *d2i,
void (*free_func)(BLOCK), int ex_tag,
return _asn1_Finish(c);
}
-int asn1_GetSequence(ASN1_const_CTX *c, long *length)
+int asn1_GetSequence(ASN1_const_CTX *c, size_t *length)
{
const unsigned char *q;
int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk);
int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,
- ASN1_PCTX *pctx);
+ ASN1_PCTX *pctx);
int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf);
int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk);
int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,
- ASN1_PCTX *pctx);
+ ASN1_PCTX *pctx);
int (*pkey_size)(const EVP_PKEY *pk);
int (*pkey_bits)(const EVP_PKEY *pk);
int (*param_decode)(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen);
+ const unsigned char **pder, size_t derlen);
int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder);
int (*param_missing)(const EVP_PKEY *pk);
int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from);
int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent,
- ASN1_PCTX *pctx);
+ ASN1_PCTX *pctx);
void (*pkey_free)(EVP_PKEY *pkey);
int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2);
/* Legacy functions for old PEM */
int (*old_priv_decode)(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen);
+ const unsigned char **pder, size_t derlen);
int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder);
} /* EVP_PKEY_ASN1_METHOD */;
#define M_ASN1_I2D_finish() *pp=p; \
return(r);
-int asn1_GetSequence(ASN1_const_CTX *c, long *length);
-void asn1_add_error(const unsigned char *address,int offset);
+int asn1_GetSequence(ASN1_const_CTX *c, size_t *length);
+void asn1_add_error(const unsigned char *address, int offset);
#ifdef __cplusplus
}
#endif
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
- stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, size_t len) \
{ \
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
} \
* ASN1 constification is done.
*/
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
- stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, size_t len) \
{ \
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
} \
/* This works like d2i_PrivateKey() except it automatically works out the type */
EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
- long length)
+ size_t length)
{
STACK_OF(ASN1_TYPE) *inkey;
const unsigned char *p;
#endif
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
- long length)
+ size_t length)
{
EVP_PKEY *ret;
ASN1_INTEGER *ai=NULL;
ASN1_OCTET_STRING *os=NULL;
const unsigned char *p;
- long length;
+ size_t length;
ASN1_const_CTX c;
if ((a->type != V_ASN1_SEQUENCE) || (a->value.sequence == NULL))
return(0);
}
-X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length)
+X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, size_t length)
{
int i;
M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new);
*/
EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp,
- long length)
+ size_t length)
{
X509_PUBKEY *xpk;
EVP_PKEY *pktmp;
*/
#ifndef OPENSSL_NO_RSA
RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp,
- long length)
+ size_t length)
{
EVP_PKEY *pkey;
RSA *key;
#ifndef OPENSSL_NO_DSA
DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp,
- long length)
+ size_t length)
{
EVP_PKEY *pkey;
DSA *key;
#endif
#ifndef OPENSSL_NO_EC
-EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length)
+EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, size_t length)
{
EVP_PKEY *pkey;
EC_KEY *key;
#include "bf_locl.h"
#include "bf_pi.h"
-void BF_set_key(BF_KEY *key, int len, const unsigned char *data)
+void BF_set_key(BF_KEY *key, size_t len, const unsigned char *data)
{
int i;
BF_LONG *p,ri,in[2];
#define HEADER_BLOWFISH_H
#include <openssl/e_os2.h>
+#include <unistd.h>
#ifdef __cplusplus
extern "C" {
} BF_KEY;
-void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
+void BF_set_key(BF_KEY *key, size_t len, const unsigned char *data);
void BF_encrypt(BF_LONG *data,const BF_KEY *key);
void BF_decrypt(BF_LONG *data,const BF_KEY *key);
int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes);
int DH_generate_key(DH *dh);
int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh);
-DH * d2i_DHparams(DH **a,const unsigned char **pp, long length);
+DH * d2i_DHparams(DH **a,const unsigned char **pp, size_t length);
int i2d_DHparams(const DH *a,unsigned char **pp);
#ifndef OPENSSL_NO_FP_API
int DHparams_print_fp(FILE *fp, const DH *x);
}
static int dh_param_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
DH *dh;
if (!(dh = d2i_DHparams(NULL, pder, derlen)))
DSA_SIG * DSA_SIG_new(void);
void DSA_SIG_free(DSA_SIG *a);
int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
-DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);
+DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, size_t length);
DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa);
int DSA_do_verify(const unsigned char *dgst,int dgst_len,
int DSA_set_ex_data(DSA *d, int idx, void *arg);
void *DSA_get_ex_data(DSA *d, int idx);
-DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
-DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
-DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
+DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, size_t length);
+DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, size_t length);
+DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, size_t length);
/* Deprecated version */
#ifndef OPENSSL_NO_DEPRECATED
}
static int dsa_param_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
DSA *dsa;
if (!(dsa = d2i_DSAparams(NULL, pder, derlen)))
}
static int old_dsa_priv_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
DSA *dsa;
if (!(dsa = d2i_DSAPrivateKey (NULL, pder, derlen)))
typedef struct ecpk_parameters_st ECPKPARAMETERS;
-EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
+EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, size_t len);
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
#define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
* \param len length of the DER encoded private key
* \return the decoded private key or NULL if an error occurred.
*/
-EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
+EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, size_t len);
/** Encodes a private key object and stores the result in a buffer.
* \param key the EC_KEY object to encode
}
static int eckey_param_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
EC_KEY *eckey;
if (!(eckey = d2i_ECParameters(NULL, pder, derlen)))
}
static int old_ec_priv_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
EC_KEY *ec;
if (!(ec = d2i_ECPrivateKey (NULL, pder, derlen)))
/* EC_GROUP <-> DER encoding of ECPKPARAMETERS */
-EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)
+EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, size_t len)
{
EC_GROUP *group = NULL;
ECPKPARAMETERS *params = NULL;
/* some EC_KEY functions */
-EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
+EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, size_t len)
{
int ok=0;
EC_KEY *ret=NULL;
* \param len length of the buffer
* \return pointer to the decoded ECDSA_SIG structure (or NULL)
*/
-ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
+ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, size_t len);
/** Computes the ECDSA signature of the given hash value using
* the supplied private key and returns the created signature.
/* functions to change the RAND_METHOD */
int change_rand(void);
int restore_rand(void);
-int fbytes(unsigned char *buf, int num);
+int fbytes(unsigned char *buf, size_t num);
RAND_METHOD fake_rand;
const RAND_METHOD *old_rand;
"1712787255652165239672857892369562652652652356758119494040"
"40041670216363"};
-int fbytes(unsigned char *buf, int num)
+int fbytes(unsigned char *buf, size_t num)
{
int ret;
BIGNUM *tmp = NULL;
}
void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
- const unsigned char *in, int inl)
+ const unsigned char *in, size_t inl)
{
- int i,j;
+ size_t i,j;
unsigned int total=0;
*outl=0;
if (inl == 0) return;
- OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
+ OPENSSL_assert(ctx->length <= sizeof(ctx->enc_data));
if ((ctx->num+inl) < ctx->length)
{
memcpy(&(ctx->enc_data[ctx->num]),in,inl);
*outl=ret;
}
-int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen)
+int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, size_t dlen)
{
int i,ret=0;
unsigned long l;
* 1 for full line
*/
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
- const unsigned char *in, int inl)
+ const unsigned char *in, size_t inl)
{
- int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl;
+ int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,ln,tmp2,exp_nl;
+ size_t n;
unsigned char *d;
n=ctx->num;
return(rv);
}
-int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n)
+int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, size_t n)
{
int i,ret=0,a,b,c,d;
unsigned long l;
{
int type;
int pkey_type;
- int md_size;
+ size_t md_size;
unsigned long flags;
int (*init)(EVP_MD_CTX *ctx);
int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count);
const unsigned char *sigbuf, unsigned int siglen,
void *key);
int required_pkey_type[5]; /*EVP_PKEY_xxx */
- int block_size;
- int ctx_size; /* how big does the ctx->md_data need to be */
+ size_t block_size;
+ size_t ctx_size; /* how big does the ctx->md_data need to be */
/* control function */
int (*md_ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
} /* EVP_MD */;
struct evp_cipher_st
{
int nid;
- int block_size;
- int key_len; /* Default value for variable length ciphers */
- int iv_len;
+ size_t block_size;
+ size_t key_len; /* Default value for variable length ciphers */
+ size_t iv_len;
unsigned long flags; /* Various flags */
int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc); /* init key */
int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out,
const unsigned char *in, size_t inl);/* encrypt/decrypt data */
int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */
- int ctx_size; /* how big ctx->cipher_data needs to be */
+ size_t ctx_size; /* how big ctx->cipher_data needs to be */
int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */
int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */
int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */
const EVP_CIPHER *cipher;
ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */
int encrypt; /* encrypt or decrypt */
- int buf_len; /* number we have left */
+ size_t buf_len; /* number we have left */
unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */
unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */
int num; /* used by cfb/ofb mode */
void *app_data; /* application stuff */
- int key_len; /* May change for variable length cipher */
+ size_t key_len; /* May change for variable length cipher */
unsigned long flags; /* Various flags */
void *cipher_data; /* per EVP data */
- int final_used;
+ size_t final_used;
int block_mask;
unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */
} /* EVP_CIPHER_CTX */;
typedef struct evp_Encode_Ctx_st
{
- int num; /* number saved in a partial encode/decode */
- int length; /* The length is either the output line length
+ size_t num; /* number saved in a partial encode/decode */
+ size_t length; /* The length is either the output line length
* (in input bytes) or the shortest input line
* length that is ok. Once decoding begins,
* the length is adjusted up each time a longer
#define EVP_MD_nid(e) EVP_MD_type(e)
#define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e))
int EVP_MD_pkey_type(const EVP_MD *md);
-int EVP_MD_size(const EVP_MD *md);
-int EVP_MD_block_size(const EVP_MD *md);
+size_t EVP_MD_size(const EVP_MD *md);
+size_t EVP_MD_block_size(const EVP_MD *md);
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
#define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e))
int EVP_CIPHER_nid(const EVP_CIPHER *cipher);
#define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
-int EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
-int EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
-int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
+size_t EVP_CIPHER_block_size(const EVP_CIPHER *cipher);
+size_t EVP_CIPHER_key_length(const EVP_CIPHER *cipher);
+size_t EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);
unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);
#define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)
const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx);
int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);
-int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
-int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
-int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
+size_t EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);
+size_t EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);
+size_t EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);
void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);
void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);
#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)
-int EVP_Cipher(EVP_CIPHER_CTX *c,
- unsigned char *out,
- const unsigned char *in,
- unsigned int inl);
+size_t EVP_Cipher(EVP_CIPHER_CTX *c, unsigned char *out,
+ const unsigned char *in, size_t inl);
#define EVP_add_cipher_alias(n,alias) \
OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))
int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md,
const unsigned char *salt, const unsigned char *data,
- int datal, int count, unsigned char *key,unsigned char *iv);
+ size_t datal, int count, unsigned char *key,unsigned char *iv);
int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
const unsigned char *key, const unsigned char *iv);
int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
const unsigned char *key, const unsigned char *iv);
int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
- int *outl, const unsigned char *in, int inl);
+ int *outl, const unsigned char *in, size_t inl);
int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
- const unsigned char *key, const unsigned char *iv);
-int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl,
- const unsigned char *key, const unsigned char *iv);
+ const unsigned char *key, const unsigned char *iv);
+int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
+ ENGINE *impl, const unsigned char *key,
+ const unsigned char *iv);
int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
- int *outl, const unsigned char *in, int inl);
+ int *outl, const unsigned char *in, size_t inl);
int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
-int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
+int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm,
+ int *outl);
int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher,
const unsigned char *key,const unsigned char *iv,
const unsigned char *key,const unsigned char *iv,
int enc);
int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
- int *outl, const unsigned char *in, int inl);
+ int *outl, const unsigned char *in, size_t inl);
int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);
int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s,
- EVP_PKEY *pkey);
+ EVP_PKEY *pkey);
int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf,
- unsigned int siglen,EVP_PKEY *pkey);
+ size_t siglen,EVP_PKEY *pkey);
int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
int EVP_DigestSignFinal(EVP_MD_CTX *ctx,
- unsigned char *sigret, size_t *siglen);
+ unsigned char *sigret, size_t *siglen);
int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
- const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
+ const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx,
- unsigned char *sig, size_t siglen);
+ unsigned char *sig, size_t siglen);
int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type,
- const unsigned char *ek, int ekl, const unsigned char *iv,
- EVP_PKEY *priv);
+ const unsigned char *ek, size_t ekl,
+ const unsigned char *iv, EVP_PKEY *priv);
int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
- unsigned char **ek, int *ekl, unsigned char *iv,
- EVP_PKEY **pubk, int npubk);
-int EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl);
+ unsigned char **ek, int *ekl, unsigned char *iv,
+ EVP_PKEY **pubk, int npubk);
+int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
-void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl,
- const unsigned char *in,int inl);
-void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl);
-int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);
+void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
+ const unsigned char *in, size_t inl);
+void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl);
+int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, size_t n);
void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl,
- const unsigned char *in, int inl);
-int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned
- char *out, int *outl);
-int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);
+ const unsigned char *in, size_t inl);
+int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl);
+int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, size_t n);
void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);
EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);
void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a);
-int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
+int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, size_t keylen);
int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad);
int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
void EVP_PKEY_free(EVP_PKEY *pkey);
EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, const unsigned char **pp,
- long length);
+ size_t length);
int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);
EVP_PKEY * d2i_PrivateKey(int type,EVP_PKEY **a, const unsigned char **pp,
long length);
EVP_PKEY * d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
- long length);
+ size_t length);
int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp);
int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
ASN1_PCTX *pctx));
void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
int (*param_decode)(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen),
+ const unsigned char **pder, size_t derlen),
int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder),
int (*param_missing)(const EVP_PKEY *pk),
int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from),
int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b),
int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent,
- ASN1_PCTX *pctx));
+ ASN1_PCTX *pctx));
void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
void (*pkey_free)(EVP_PKEY *pkey));
OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) <=
(int)sizeof(ctx->iv));
- if(iv) memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx));
+ if(iv) memcpy(ctx->oiv, iv,
+ EVP_CIPHER_CTX_iv_length(ctx));
memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx));
break;
}
int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
- const unsigned char *in, int inl)
+ const unsigned char *in, size_t inl)
{
if (ctx->encrypt)
return EVP_EncryptUpdate(ctx,out,outl,in,inl);
}
int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
- const unsigned char *in, int inl)
+ const unsigned char *in, size_t inl)
{
- int i,j,bl;
+ size_t i;
+ size_t bl;
+ size_t j;
if (inl <= 0)
{
}
int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
- const unsigned char *in, int inl)
+ const unsigned char *in, size_t inl)
{
int fix_len;
unsigned int b;
return 1;
}
-int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen)
+int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, size_t keylen)
{
if(c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH)
- return EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_KEY_LENGTH, keylen, NULL);
+ return EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_KEY_LENGTH, (int)keylen, NULL);
if(c->key_len == keylen) return 1;
if((keylen > 0) && (c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH))
{
}
int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,
- const unsigned char *salt, const unsigned char *data, int datal,
+ const unsigned char *salt, const unsigned char *data, size_t datal,
int count, unsigned char *key, unsigned char *iv)
{
EVP_MD_CTX c;
}
}
-int EVP_CIPHER_block_size(const EVP_CIPHER *e)
+size_t EVP_CIPHER_block_size(const EVP_CIPHER *e)
{
return e->block_size;
}
-int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx)
+size_t EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx)
{
return ctx->cipher->block_size;
}
-int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl)
+size_t EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
+ const unsigned char *in, size_t inl)
{
return ctx->cipher->do_cipher(ctx,out,in,inl);
}
ctx->app_data = data;
}
-int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
+size_t EVP_CIPHER_iv_length(const EVP_CIPHER *cipher)
{
return cipher->iv_len;
}
-int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
+size_t EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx)
{
return ctx->cipher->iv_len;
}
-int EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
+size_t EVP_CIPHER_key_length(const EVP_CIPHER *cipher)
{
return cipher->key_len;
}
-int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)
+size_t EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx)
{
return ctx->key_len;
}
return ctx->cipher->nid;
}
-int EVP_MD_block_size(const EVP_MD *md)
+size_t EVP_MD_block_size(const EVP_MD *md)
{
return md->block_size;
}
return md->pkey_type;
}
-int EVP_MD_size(const EVP_MD *md)
+size_t EVP_MD_size(const EVP_MD *md)
{
if (!md)
return -1;
#include <openssl/rsa.h>
int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
- const unsigned char *ek, int ekl, const unsigned char *iv,
- EVP_PKEY *priv)
+ const unsigned char *ek, size_t ekl, const unsigned char *iv,
+ EVP_PKEY *priv)
{
unsigned char *key=NULL;
int i,size=0,ret=0;
*/
static int old_hmac_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
ASN1_OCTET_STRING *os;
os = ASN1_OCTET_STRING_new();
#include "cryptlib.h"
#include <openssl/hmac.h>
-void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
+void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t len,
const EVP_MD *md, ENGINE *impl)
{
int i,j,reset=0;
EVP_MD_CTX_copy_ex(&ctx->md_ctx,&ctx->i_ctx);
}
-void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
- const EVP_MD *md)
+void HMAC_Init(HMAC_CTX *ctx, const void *key, size_t len, const EVP_MD *md)
{
if(key && md)
HMAC_CTX_init(ctx);
memset(ctx,0,sizeof *ctx);
}
-unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
+unsigned char *HMAC(const EVP_MD *evp_md, const void *key, size_t key_len,
const unsigned char *d, size_t n, unsigned char *md,
unsigned int *md_len)
{
#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */
-void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
+void HMAC_Init(HMAC_CTX *ctx, const void *key, size_t len,
const EVP_MD *md); /* deprecated */
-void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
+void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t len,
const EVP_MD *md, ENGINE *impl);
void HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);
void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
-unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
+unsigned char *HMAC(const EVP_MD *evp_md, const void *key, size_t key_len,
const unsigned char *d, size_t n, unsigned char *md,
unsigned int *md_len);
void HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
{
ASN1_OBJECT *r;
- int i;
+ size_t i;
char *ln=NULL,*sn=NULL;
unsigned char *data=NULL;
#endif
#ifndef OPENSSL_NO_FP_API
-STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u)
+STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,
+ pem_password_cb *cb, void *u)
{
BIO *b;
STACK_OF(X509_INFO) *ret;
}
#endif
-STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u)
+STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
+ pem_password_cb *cb, void *u)
{
X509_INFO *xi=NULL;
char *name=NULL,*header=NULL;
const char RAND_version[]="RAND" OPENSSL_VERSION_PTEXT;
static void ssleay_rand_cleanup(void);
-static void ssleay_rand_seed(const void *buf, int num);
-static void ssleay_rand_add(const void *buf, int num, double add_entropy);
-static int ssleay_rand_bytes(unsigned char *buf, int num);
-static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num);
+static void ssleay_rand_seed(const void *buf, size_t num);
+static void ssleay_rand_add(const void *buf, size_t num, double add_entropy);
+static int ssleay_rand_bytes(unsigned char *buf, size_t num);
+static int ssleay_rand_pseudo_bytes(unsigned char *buf, size_t num);
static int ssleay_rand_status(void);
RAND_METHOD rand_ssleay_meth={
initialized=0;
}
-static void ssleay_rand_add(const void *buf, int num, double add)
+static void ssleay_rand_add(const void *buf, size_t num, double add)
{
- int i,j,k,st_idx;
+ int i,st_idx;
+ size_t j,k;
long md_c[2];
unsigned char local_md[MD_DIGEST_LENGTH];
EVP_MD_CTX m;
#endif
}
-static void ssleay_rand_seed(const void *buf, int num)
+static void ssleay_rand_seed(const void *buf, size_t num)
{
ssleay_rand_add(buf, num, (double)num);
}
-static int ssleay_rand_bytes(unsigned char *buf, int num)
+static int ssleay_rand_bytes(unsigned char *buf, size_t num)
{
static volatile int stirred_pool = 0;
- int i,j,k,st_num,st_idx;
+ int i,st_num,st_idx;
+ size_t j,k;
int num_ceil;
int ok;
long md_c[2];
/* pseudo-random bytes that are guaranteed to be unique but not
unpredictable */
-static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num)
+static int ssleay_rand_pseudo_bytes(unsigned char *buf, size_t num)
{
int ret;
unsigned long err;
struct rand_meth_st
{
- void (*seed)(const void *buf, int num);
- int (*bytes)(unsigned char *buf, int num);
+ void (*seed)(const void *buf, size_t num);
+ int (*bytes)(unsigned char *buf, size_t num);
void (*cleanup)(void);
- void (*add)(const void *buf, int num, double entropy);
- int (*pseudorand)(unsigned char *buf, int num);
+ void (*add)(const void *buf, size_t num, double entropy);
+ int (*pseudorand)(unsigned char *buf, size_t num);
int (*status)(void);
};
#endif
RAND_METHOD *RAND_SSLeay(void);
void RAND_cleanup(void );
-int RAND_bytes(unsigned char *buf,int num);
-int RAND_pseudo_bytes(unsigned char *buf,int num);
-void RAND_seed(const void *buf,int num);
-void RAND_add(const void *buf,int num,double entropy);
+int RAND_bytes(unsigned char *buf,size_t num);
+int RAND_pseudo_bytes(unsigned char *buf,size_t num);
+void RAND_seed(const void *buf,size_t num);
+void RAND_add(const void *buf,size_t num,double entropy);
int RAND_load_file(const char *file,long max_bytes);
int RAND_write_file(const char *file);
const char *RAND_file_name(char *file,size_t num);
int RAND_status(void);
-int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);
+int RAND_query_egd_bytes(const char *path, unsigned char *buf, size_t bytes);
int RAND_egd(const char *path);
-int RAND_egd_bytes(const char *path,int bytes);
+int RAND_egd_bytes(const char *path, size_t bytes);
int RAND_poll(void);
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
-int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
+int RAND_query_egd_bytes(const char *path, unsigned char *buf, size_t bytes)
{
int ret = 0;
struct sockaddr_un addr;
- int len, num, numbytes;
+ size_t len, num, numbytes;
int fd = -1;
int success;
unsigned char egdbuf[2], tempbuf[255], *retrievebuf;
}
-int RAND_egd_bytes(const char *path, int bytes)
+int RAND_egd_bytes(const char *path, size_t bytes)
{
int num, ret = 0;
RAND_set_rand_method(NULL);
}
-void RAND_seed(const void *buf, int num)
+void RAND_seed(const void *buf, size_t num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth && meth->seed)
meth->seed(buf,num);
}
-void RAND_add(const void *buf, int num, double entropy)
+void RAND_add(const void *buf, size_t num, double entropy)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth && meth->add)
meth->add(buf,num,entropy);
}
-int RAND_bytes(unsigned char *buf, int num)
+int RAND_bytes(unsigned char *buf, size_t num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth && meth->bytes)
return(-1);
}
-int RAND_pseudo_bytes(unsigned char *buf, int num)
+int RAND_pseudo_bytes(unsigned char *buf, size_t num)
{
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth && meth->pseudorand)
pid_t curr_pid = getpid();
#if defined(DEVRANDOM) || defined(DEVRANDOM_EGD)
unsigned char tmpbuf[ENTROPY_NEEDED];
- int n = 0;
+ size_t n = 0;
#endif
#ifdef DEVRANDOM
static const char *randomfiles[] = { DEVRANDOM };
if (try_read)
{
- r = read(fd,(unsigned char *)tmpbuf+n, ENTROPY_NEEDED-n);
+ r = read(fd,tmpbuf+n,ENTROPY_NEEDED-n);
if (r > 0)
n += r;
#if defined(OPENSSL_SYS_BEOS_R5)
#ifndef OPENSSL_NO_POSIX_IO
struct stat sb;
#endif
- int i,ret=0,n;
+ int i,ret=0;
+ size_t n;
FILE *in;
if (file == NULL) return(0);
int RAND_write_file(const char *file)
{
unsigned char buf[BUFSIZE];
- int i,ret=0,rand_err=0;
+ int ret=0,rand_err=0;
+ size_t i;
FILE *out = NULL;
int n;
#ifndef OPENSSL_NO_POSIX_IO
if (out == NULL) goto err;
#ifndef NO_CHMOD
- chmod(file,0600);
+ chmod(file,(mode_t)0600);
#endif
n=RAND_DATA;
for (;;)
if (RAND_bytes(buf,i) <= 0)
rand_err=1;
i=fwrite(buf,1,i,out);
- if (i <= 0)
+ if (i == 0)
{
ret=0;
break;
}
static int old_rsa_priv_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
RSA *rsa;
if (!(rsa = d2i_RSAPrivateKey (NULL, pder, derlen)))
TS_REQ *TS_REQ_new(void);
void TS_REQ_free(TS_REQ *a);
int i2d_TS_REQ(const TS_REQ *a, unsigned char **pp);
-TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length);
+TS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, size_t length);
TS_REQ *TS_REQ_dup(TS_REQ *a);
void TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a);
int i2d_TS_MSG_IMPRINT(const TS_MSG_IMPRINT *a, unsigned char **pp);
TS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a,
- const unsigned char **pp, long length);
+ const unsigned char **pp, size_t length);
TS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a);
TS_RESP *TS_RESP_new(void);
void TS_RESP_free(TS_RESP *a);
int i2d_TS_RESP(const TS_RESP *a, unsigned char **pp);
-TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length);
+TS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, size_t length);
TS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token);
TS_RESP *TS_RESP_dup(TS_RESP *a);
void TS_STATUS_INFO_free(TS_STATUS_INFO *a);
int i2d_TS_STATUS_INFO(const TS_STATUS_INFO *a, unsigned char **pp);
TS_STATUS_INFO *d2i_TS_STATUS_INFO(TS_STATUS_INFO **a,
- const unsigned char **pp, long length);
+ const unsigned char **pp, size_t length);
TS_STATUS_INFO *TS_STATUS_INFO_dup(TS_STATUS_INFO *a);
TS_TST_INFO *TS_TST_INFO_new(void);
void TS_TST_INFO_free(TS_TST_INFO *a);
int i2d_TS_TST_INFO(const TS_TST_INFO *a, unsigned char **pp);
TS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp,
- long length);
+ size_t length);
TS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a);
TS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a);
void TS_ACCURACY_free(TS_ACCURACY *a);
int i2d_TS_ACCURACY(const TS_ACCURACY *a, unsigned char **pp);
TS_ACCURACY *d2i_TS_ACCURACY(TS_ACCURACY **a, const unsigned char **pp,
- long length);
+ size_t length);
TS_ACCURACY *TS_ACCURACY_dup(TS_ACCURACY *a);
ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void);
int i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a,
unsigned char **pp);
ESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a,
- const unsigned char **pp, long length);
+ const unsigned char **pp,
+ size_t length);
ESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a);
ESS_CERT_ID *ESS_CERT_ID_new(void);
void ESS_CERT_ID_free(ESS_CERT_ID *a);
int i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp);
ESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp,
- long length);
+ size_t length);
ESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a);
ESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void);
int i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a,
unsigned char **pp);
ESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a,
- const unsigned char **pp, long length);
+ const unsigned char **pp, size_t length);
ESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a);
void ERR_load_TS_strings(void);
STACK_OF(X509) *chain);
int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp,
- long length);
+ size_t length);
#ifndef OPENSSL_NO_RSA
int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp,
- long length);
+ size_t length);
#endif
#ifndef OPENSSL_NO_DSA
int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp,
- long length);
+ size_t length);
#endif
#ifndef OPENSSL_NO_EC
int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp,
- long length);
+ size_t length);
#endif
DECLARE_ASN1_FUNCTIONS(X509_SIG)
X509_PKEY * X509_PKEY_new(void );
void X509_PKEY_free(X509_PKEY *a);
-int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
-X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
+int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp);
+X509_PKEY * d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp,
+ size_t length);
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
/* RAND number functions */
/*-----------------------*/
-static int cca_get_random_bytes(unsigned char*, int );
+static int cca_get_random_bytes(unsigned char*, size_t);
static int cca_random_status(void);
#ifndef OPENSSL_NO_RSA
return 1;
}
-static int cca_get_random_bytes(unsigned char* buf, int num)
+static int cca_get_random_bytes(unsigned char* buf, size_t num)
{
long ret_code;
long reason_code;
#endif
/* RAND stuff */
-static int hwcrhk_rand_bytes(unsigned char *buf, int num);
+static int hwcrhk_rand_bytes(unsigned char *buf, size_t num);
static int hwcrhk_rand_status(void);
/* KM stuff */
#endif
/* Random bytes are good */
-static int hwcrhk_rand_bytes(unsigned char *buf, int num)
+static int hwcrhk_rand_bytes(unsigned char *buf, size_t num)
{
char tempbuf[1024];
HWCryptoHook_ErrMsgBuf rmsg;
#endif
/* RAND stuff */
-static int cswift_rand_bytes(unsigned char *buf, int num);
+static int cswift_rand_bytes(unsigned char *buf, size_t num);
static int cswift_rand_status(void);
/* The definitions for control commands specific to this engine */
#endif
/* Random bytes are good */
-static int cswift_rand_bytes(unsigned char *buf, int num)
+static int cswift_rand_bytes(unsigned char *buf, size_t num)
{
SW_CONTEXT_HANDLE hac;
SW_STATUS swrc;
#endif
/* RAND stuff */
-static int surewarehk_rand_bytes(unsigned char *buf, int num);
-static void surewarehk_rand_seed(const void *buf, int num);
-static void surewarehk_rand_add(const void *buf, int num, double entropy);
+static int surewarehk_rand_bytes(unsigned char *buf, size_t num);
+static void surewarehk_rand_seed(const void *buf, size_t num);
+static void surewarehk_rand_add(const void *buf, size_t num, double entropy);
/* KM stuff */
static EVP_PKEY *surewarehk_load_privkey(ENGINE *e, const char *key_id,
}
}
-static int surewarehk_rand_bytes(unsigned char *buf, int num)
+static int surewarehk_rand_bytes(unsigned char *buf, size_t num)
{
int ret=0;
char msg[64]="ENGINE_rand_bytes";
return ret==1 ? 1 : 0;
}
-static void surewarehk_rand_seed(const void *buf, int num)
+static void surewarehk_rand_seed(const void *buf, size_t num)
{
int ret=0;
char msg[64]="ENGINE_rand_seed";
}
}
-static void surewarehk_rand_add(const void *buf, int num, double entropy)
+static void surewarehk_rand_add(const void *buf, size_t num, double entropy)
{
surewarehk_rand_seed(buf,num);
}
int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
- unsigned int id_len);
+ size_t id_len);
SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,const unsigned char **pp,
- long length);
+ size_t length);
#ifdef HEADER_X509_H
X509 * SSL_get_peer_certificate(const SSL *s);
}
SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
- long length)
+ size_t length)
{
int version,ssl_version=0,i;
long id;