mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: dean gaudet <dean-list-linux-kernel@arctic.org>
Cc: Matt Mackall <mpm@selenic.com>,
	Erlend Aasland <erlend-a@ux.his.no>,
	Steven French <sfrench@us.ibm.com>,
	James Morris <jmorris@intercode.com.au>,
	Samba Technical Mailing List <samba-technical@samba.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH CIFS] use CryptoAPI MD4/MD5
Date: Sat, 4 Oct 2003 22:08:05 +0200	[thread overview]
Message-ID: <20031004220805.A22185@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0310041127020.5954@twinlark.arctic.org>; from dean-list-linux-kernel@arctic.org on Sat, Oct 04, 2003 at 11:51:57AM -0700

dean gaudet <dean-list-linux-kernel@arctic.org> :
[...]
> this really sounds like two steps backwards and one step forward.
> 
> this CIFS patch alone replaces 89 lines with 250 lines of code!  the new

It could factor this sequence for example:
       xxx.page = virt_to_page(key);
       xxx.offset = offset_in_page(key);
       xxx.length = foo;
(appears 19 times in the patch)

Btw, the patch add things like this (fs/cifs/connect.c::cifs_mount):

@@ -917,7 +918,18 @@
                        sprintf(pSesInfo->serverName, "%u.%u.%u.%u",
                                NIPQUAD(sin_server.sin_addr.s_addr));
                }
-
+               if (!rc) {
+                       pSesInfo->md5_tfm = crypto_alloc_tfm("md5", 0);
+                       if (unlikely(pSesInfo->md5_tfm == NULL)) {
+                               printk(KERN_WARNING "failed to load transform
for md5\n");
+                               rc = -ENOMEM;
+                       }
+                       pSesInfo->md4_tfm = crypto_alloc_tfm("md4", 0);
+                       if (unlikely(pSesInfo->md4_tfm == NULL)) {
+                               printk(KERN_WARNING "failed to load transform
for md4\n");
+                               rc = -ENOMEM;
+                       }
+               }
                if (!rc){
                        if (volume_info.password)
                                strncpy(pSesInfo->password_with_pad,
@@ -999,6 +1011,14 @@

 /* on error free sesinfo and tcon struct if needed */
        if (rc) {
+               if (pSesInfo->md5_tfm != NULL) {
+                       crypto_free_tfm(pSesInfo->md5_tfm);
+                       pSesInfo->md5_tfm = NULL;
+               }
+               if (pSesInfo->md4_tfm != NULL) {
+                       crypto_free_tfm(pSesInfo->md4_tfm);
+                       pSesInfo->md4_tfm = NULL;
+               }
                           /* If find_unc succeeded then rc == 0 so we can not
end */
                if (tcon)  /* up here accidently freeing someone elses tcon
struct */
                        tconInfoFree(tcon);
@@ -2422,6 +2442,14 @@

The code doesn't remember what failed and must do extra checks. This adds
lines of code rather fast. Not a surprise in a function with a pile of 
"if (rc)" and multiple exit paths.

> code does not look anywhere near as readable as the original.  but perhaps

fs/cifs/connect.c::CIFSNTLMSSPNegotiateSessSetup):
[...]
                                                        ses-> 
                                                            serverDomain[1
                                                                         +
                                                                         (2
                                                                          *
                                                                          len)]
                                                            = 0;

              Imho
CryptoAPI
                      is
not
         the                                   biggest
                 problem
               here

--
Ueimor

  reply	other threads:[~2003-10-04 20:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OF9C1504BB.5FB00D5A-ON87256DB3.0015672E-86256DB3.001798AE@us.ibm.com>
2003-10-02 11:37 ` Erlend Aasland
2003-10-04 18:00   ` dean gaudet
2003-10-04 18:24     ` Matt Mackall
2003-10-04 18:51       ` dean gaudet
2003-10-04 20:08         ` Francois Romieu [this message]
2003-10-05  0:08         ` Matt Mackall
2003-10-05 12:29         ` Erlend Aasland
2003-09-02 20:30 [RFC][PATCH] 2nd try to convert cifs to use CryptoAPI Erlend Aasland
2003-10-01 13:30 ` [PATCH CIFS] use CryptoAPI MD4/MD5 Erlend Aasland
2003-10-01 19:55   ` Matt Mackall
2003-10-01 23:26     ` Erlend Aasland
2003-10-01 23:42       ` Matt Mackall
2003-10-01 23:52         ` Erlend Aasland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031004220805.A22185@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=dean-list-linux-kernel@arctic.org \
    --cc=erlend-a@ux.his.no \
    --cc=jmorris@intercode.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=samba-technical@samba.org \
    --cc=sfrench@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®