summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-08-23 16:43:07 +0200
committerMichael Schroeder <mls@suse.de>2013-08-23 16:43:07 +0200
commitb9db844fb85fe0da2a4a5b985b459f216d019507 (patch)
tree162292bdce94c5c502b443b47c2e865be13952d7 /ext
parentb6570f2aa0ea0527e2adfad2c69044f7116b55e6 (diff)
downloadlibsolv-b9db844fb85fe0da2a4a5b985b459f216d019507.tar.gz
libsolv-b9db844fb85fe0da2a4a5b985b459f216d019507.tar.bz2
libsolv-b9db844fb85fe0da2a4a5b985b459f216d019507.zip
constify solv_pgpvrfy
Diffstat (limited to 'ext')
-rw-r--r--ext/solv_pgpvrfy.c17
-rw-r--r--ext/solv_pgpvrfy.h2
2 files changed, 10 insertions, 9 deletions
diff --git a/ext/solv_pgpvrfy.c b/ext/solv_pgpvrfy.c
index f1b9aaa..a62ca13 100644
--- a/ext/solv_pgpvrfy.c
+++ b/ext/solv_pgpvrfy.c
@@ -345,7 +345,7 @@ mprsa(int nl, mp_t *n, int el, mp_t *e, mp_t *m, mp_t *c)
/* create mp with size tbits from data with size dbits */
static mp_t *
-mpbuild(unsigned char *d, int dbits, int tbits, int *mplp)
+mpbuild(const unsigned char *d, int dbits, int tbits, int *mplp)
{
int l = (tbits + MP_T_BITS - 1) / MP_T_BITS;
int dl, i;
@@ -365,11 +365,11 @@ mpbuild(unsigned char *d, int dbits, int tbits, int *mplp)
return out;
}
-static unsigned char *
-findmpi(unsigned char **mpip, int *mpilp, int maxbits, int *outlen)
+static const unsigned char *
+findmpi(const unsigned char **mpip, int *mpilp, int maxbits, int *outlen)
{
int mpil = *mpilp;
- unsigned char *mpi = *mpip;
+ const unsigned char *mpi = *mpip;
int bits, l;
*outlen = 0;
@@ -389,11 +389,11 @@ findmpi(unsigned char **mpip, int *mpilp, int maxbits, int *outlen)
}
int
-solv_pgpvrfy(unsigned char *pub, int publ, unsigned char *sig, int sigl)
+solv_pgpvrfy(const unsigned char *pub, int publ, const unsigned char *sig, int sigl)
{
int hashl;
unsigned char *oid = 0;
- unsigned char *mpi;
+ const unsigned char *mpi;
int mpil;
int res = 0;
@@ -428,7 +428,8 @@ solv_pgpvrfy(unsigned char *pub, int publ, unsigned char *sig, int sigl)
{
case 1: /* RSA */
{
- unsigned char *n, *e, *m, *c;
+ const unsigned char *n, *e, *m;
+ unsigned char *c;
int nlen, elen, mlen, clen;
mp_t *nx, *ex, *mx, *cx;
int nxl, exl;
@@ -467,7 +468,7 @@ solv_pgpvrfy(unsigned char *pub, int publ, unsigned char *sig, int sigl)
}
case 17: /* DSA */
{
- unsigned char *p, *q, *g, *y, *r, *s;
+ const unsigned char *p, *q, *g, *y, *r, *s;
int plen, qlen, glen, ylen, rlen, slen, hlen;
mp_t *px, *qx, *gx, *yx, *rx, *sx, *hx;
int pxl, qxl, hxl;
diff --git a/ext/solv_pgpvrfy.h b/ext/solv_pgpvrfy.h
index 9959ddd..a623e85 100644
--- a/ext/solv_pgpvrfy.h
+++ b/ext/solv_pgpvrfy.h
@@ -5,5 +5,5 @@
* for further information
*/
-extern int solv_pgpvrfy(unsigned char *pub, int publ, unsigned char *sig, int sigl);
+extern int solv_pgpvrfy(const unsigned char *pub, int publ, const unsigned char *sig, int sigl);