X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/02dfbd5b7af7816959dbd39c1fe628451204e35f..20fa0f6976d598481208c0583d72b2ccef637be9:/cc-kem.c diff --git a/cc-kem.c b/cc-kem.c index 1766c8e..63199fc 100644 --- a/cc-kem.c +++ b/cc-kem.c @@ -7,7 +7,7 @@ * (c) 2004 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,12 +15,12 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, @@ -29,6 +29,8 @@ /*----- Header files ------------------------------------------------------*/ +#define _FILE_OFFSET_BITS 64 + #include #include @@ -169,7 +171,7 @@ typedef struct dh_encctx { ge *y; } dh_encctx; -static dh_encctx *dh_doinit(key *k, const gprime_param *gp, mp *y, +static dh_encctx *dh_doinit(key *k, const gprime_param *gp, mp *y, group *(*makegroup)(const gprime_param *), const char *what) { @@ -235,7 +237,7 @@ static int dh_encdoit(kem *k, dstr *d, ghash *h) ge *y = G_CREATE(de->g); size_t n = de->g->noctets; buf b; - + G_EXP(de->g, x, de->g->g, r); G_EXP(de->g, y, de->y, r); dstr_ensure(d, n); @@ -502,6 +504,7 @@ k_found:; if (!ko->kf) { kd = k->k; key_incref(kd); + kp = 0; } else { kd = xmalloc(ko->kdsz); kp = key_fetchinit(ko->kf, 0, kd); @@ -540,7 +543,7 @@ k_found:; die(EXIT_FAILURE, "encryption scheme (KDF) `%s' not found in key `%s'", q, t.buf); } - + dstr_reset(&d); if ((q = key_getattr(0, k, "mac")) == 0) { dstr_putf(&d, "%s-hmac", kk->h->name);