Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1351555

Re: [PATCH 1/3] crypto: authenc - add TLS type encryption

From Cristian Stoica <cristian.stoica@nxp.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] crypto: authenc - add TLS type encryption
Date 2016-03-07 12:40 +0100
Message-ID <ra1G2-2fN-17@gated-at.bofh.it> (permalink)
References <ra1G2-2fN-19@gated-at.bofh.it> <r9vGa-6nu-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Tadeusz,


+static int crypto_encauth_dgst_verify(struct aead_request *req,
+                                     unsigned int flags)
+{
+       struct crypto_aead *tfm = crypto_aead_reqtfm(req);
+       unsigned int authsize = crypto_aead_authsize(tfm);
+       struct aead_instance *inst = aead_alg_instance(tfm);
+       struct crypto_encauth_ctx *ctx = crypto_aead_ctx(tfm);
+       struct encauth_instance_ctx *ictx = aead_instance_ctx(inst);
+       struct crypto_ahash *auth = ctx->auth;
+       struct encauth_request_ctx *areq_ctx = aead_request_ctx(req);
+       struct ahash_request *ahreq = (void *)(areq_ctx->tail + ictx->reqoff);
+       u8 *hash = areq_ctx->tail;
+       int i, err = 0, padd_err = 0;
+       u8 paddlen, *ihash;
+       u8 padd[255];
+
+       scatterwalk_map_and_copy(&paddlen, req->dst, req->assoclen +
+                                req->cryptlen - 1, 1, 0);
+
+       if (paddlen > 255 || paddlen > req->cryptlen) {
+               paddlen = 1;
+               padd_err = -EBADMSG;
+       }
+
+       scatterwalk_map_and_copy(padd, req->dst, req->assoclen +
+                                req->cryptlen - paddlen, paddlen, 0);
+
+       for (i = 0; i < paddlen; i++) {
+               if (padd[i] != paddlen)
+                       padd_err = -EBADMSG;
+       }


This part seems to have the same issue my TLS patch has.
See for reference what Andy Lutomirski had to say about it:

http://www.mail-archive.com/linux-crypto%40vger.kernel.org/msg11719.html


Cristian S.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] crypto: af_alg - add TLS type encryption Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-06 02:30 +0100
  [PATCH 2/3] crypto: af_alg - add AEAD operation type Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-06 02:30 +0100
  [PATCH 3/3] crypto: algif_aead - modify algif aead interface to  work with encauth Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-06 02:30 +0100
  [PATCH 1/3] crypto: authenc - add TLS type encryption Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-06 02:30 +0100
    Re: [PATCH 1/3] crypto: authenc - add TLS type encryption Cristian Stoica <cristian.stoica@nxp.com> - 2016-03-07 12:40 +0100
      Re: [PATCH 1/3] crypto: authenc - add TLS type encryption Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-07 15:40 +0100
        Re: [PATCH 1/3] crypto: authenc - add TLS type encryption Cristian Stoica <cristian.stoica@nxp.com> - 2016-03-08 09:40 +0100
          Re: [PATCH 1/3] crypto: authenc - add TLS type encryption Tadeusz Struk <tadeusz.struk@intel.com> - 2016-03-08 18:00 +0100

csiph-web