diff options
author | Joerg Jung <jung@cvs.openbsd.org> | 2015-11-05 12:35:59 +0000 |
---|---|---|
committer | Joerg Jung <jung@cvs.openbsd.org> | 2015-11-05 12:35:59 +0000 |
commit | f5250d325c8f34b0e9ebff31af117c00401e850c (patch) | |
tree | 568a93035e72b9d31cf43311cfdde6a3a9534b91 /usr.sbin/smtpd/ca.c | |
parent | 6dfd3af68480ab941f223e1270ce81a578bd23ca (diff) |
replace u_char and u_int* with standard stdint.h types to ease portable version
also remove trailing whitespaces while here
no binary change
ok sunil millert gilles
Diffstat (limited to 'usr.sbin/smtpd/ca.c')
-rw-r--r-- | usr.sbin/smtpd/ca.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/usr.sbin/smtpd/ca.c b/usr.sbin/smtpd/ca.c index 6608845fddc..648af85ec4f 100644 --- a/usr.sbin/smtpd/ca.c +++ b/usr.sbin/smtpd/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.17 2015/10/17 13:06:03 gilles Exp $ */ +/* $OpenBSD: ca.c,v 1.18 2015/11/05 12:35:58 jung Exp $ */ /* * Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> @@ -44,21 +44,25 @@ static int ca_verify_cb(int, X509_STORE_CTX *); -static int rsae_send_imsg(int, const u_char *, u_char *, RSA *, - int, u_int); -static int rsae_pub_enc(int, const u_char *, u_char *, RSA *, int); -static int rsae_pub_dec(int,const u_char *, u_char *, RSA *, int); -static int rsae_priv_enc(int, const u_char *, u_char *, RSA *, int); -static int rsae_priv_dec(int, const u_char *, u_char *, RSA *, int); +static int rsae_send_imsg(int, const unsigned char *, unsigned char *, + RSA *, int, unsigned int); +static int rsae_pub_enc(int, const unsigned char *, unsigned char *, + RSA *, int); +static int rsae_pub_dec(int,const unsigned char *, unsigned char *, + RSA *, int); +static int rsae_priv_enc(int, const unsigned char *, unsigned char *, + RSA *, int); +static int rsae_priv_dec(int, const unsigned char *, unsigned char *, + RSA *, int); static int rsae_mod_exp(BIGNUM *, const BIGNUM *, RSA *, BN_CTX *); static int rsae_bn_mod_exp(BIGNUM *, const BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *, BN_MONT_CTX *); static int rsae_init(RSA *); static int rsae_finish(RSA *); -static int rsae_sign(int, const u_char *, u_int, u_char *, u_int *, - const RSA *); -static int rsae_verify(int dtype, const u_char *m, u_int, const u_char *, - u_int, const RSA *); +static int rsae_sign(int, const unsigned char *, unsigned int, + unsigned char *, unsigned int *, const RSA *); +static int rsae_verify(int dtype, const unsigned char *m, unsigned int, + const unsigned char *, unsigned int, const RSA *); static int rsae_keygen(RSA *, int, BIGNUM *, BN_GENCB *); static uint64_t rsae_reqid = 0; @@ -247,7 +251,7 @@ ca_imsg(struct mproc *p, struct imsg *imsg) { RSA *rsa; const void *from = NULL; - u_char *to = NULL; + unsigned char *to = NULL; struct msg m; const char *pkiname; size_t flen, tlen, padding; @@ -358,8 +362,8 @@ static RSA_METHOD rsae_method = { }; static int -rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa, - int padding, u_int cmd) +rsae_send_imsg(int flen, const unsigned char *from, unsigned char *to, + RSA *rsa, int padding, unsigned int cmd) { int ret = 0; struct imsgbuf *ibuf; @@ -436,21 +440,24 @@ rsae_send_imsg(int flen, const u_char *from, u_char *to, RSA *rsa, } static int -rsae_pub_enc(int flen,const u_char *from, u_char *to, RSA *rsa,int padding) +rsae_pub_enc(int flen,const unsigned char *from, unsigned char *to, RSA *rsa, + int padding) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); return (rsa_default->rsa_pub_enc(flen, from, to, rsa, padding)); } static int -rsae_pub_dec(int flen,const u_char *from, u_char *to, RSA *rsa,int padding) +rsae_pub_dec(int flen,const unsigned char *from, unsigned char *to, RSA *rsa, + int padding) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); return (rsa_default->rsa_pub_dec(flen, from, to, rsa, padding)); } static int -rsae_priv_enc(int flen, const u_char *from, u_char *to, RSA *rsa, int padding) +rsae_priv_enc(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, + int padding) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); if (RSA_get_ex_data(rsa, 0) != NULL) { @@ -461,7 +468,8 @@ rsae_priv_enc(int flen, const u_char *from, u_char *to, RSA *rsa, int padding) } static int -rsae_priv_dec(int flen, const u_char *from, u_char *to, RSA *rsa, int padding) +rsae_priv_dec(int flen, const unsigned char *from, unsigned char *to, RSA *rsa, + int padding) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); if (RSA_get_ex_data(rsa, 0) != NULL) { @@ -505,8 +513,8 @@ rsae_finish(RSA *rsa) } static int -rsae_sign(int type, const u_char *m, u_int m_length, u_char *sigret, - u_int *siglen, const RSA *rsa) +rsae_sign(int type, const unsigned char *m, unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, const RSA *rsa) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); return (rsa_default->rsa_sign(type, m, m_length, @@ -514,8 +522,8 @@ rsae_sign(int type, const u_char *m, u_int m_length, u_char *sigret, } static int -rsae_verify(int dtype, const u_char *m, u_int m_length, const u_char *sigbuf, - u_int siglen, const RSA *rsa) +rsae_verify(int dtype, const unsigned char *m, unsigned int m_length, + const unsigned char *sigbuf, unsigned int siglen, const RSA *rsa) { log_debug("debug: %s: %s", proc_name(smtpd_process), __func__); return (rsa_default->rsa_verify(dtype, m, m_length, |