<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>45181</bug_id>
          
          <creation_ts>2004-03-19 18:25 0000</creation_ts>
          <short_desc>dev-libs/cyrus-sasl: Add crypted password support for Auxprop SQL plugin</short_desc>
          <delta_ts>2005-11-08 08:28:26 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          <bug_file_loc>http://frost.ath.cx/software/cyrus-sasl-patches/</bug_file_loc>
          
          
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>me@alessandrorossini.org</reporter>
          <assigned_to>net-mail@gentoo.org</assigned_to>
          <cc>darren@shelbrook.com</cc>
    
    <cc>heretic@clanhk.org</cc>
    
    <cc>steeeeeveee@gmx.net</cc>
    
    <cc>winckler@campogeral.com.br</cc>

      

      
          <long_desc isprivate="0">
            <who>me@alessandrorossini.org</who>
            <bug_when>2004-03-19 18:25:20 0000</bug_when>
            <thetext>Current Cyrus-SASL lacks of crypted password support for Auxprop SQL plugin, it only support clear password.
This feature is useful when we want to make an authenticated SMTP server using an SQL server for the user accounts.
My new ebuild include a patch for this feature. I&apos;ve tested it with versions 2.1.17 and 2.1.18.
More informations are available in the URL.

Reproducible: Always
Steps to Reproduce:

Actual Results:  
 

Expected Results:</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>me@alessandrorossini.org</who>
            <bug_when>2004-03-19 18:28:54 0000</bug_when>
            <thetext>Created an attachment (id=27667)
My new ebuild and crypted password patch
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>max@gentoo.org</who>
            <bug_when>2004-04-01 09:11:35 0000</bug_when>
            <thetext>Please post each file as text/plain individually as specified in the bug-posting howto.  I haven&apos;t had a chance to look at this yet, but I have some questions first.  This sounds like it will prevent APOP, CRAM-MD5 and DIGEST-MD5 mechanisms from working as those need access to the plaintext password.  Is this true?

Aside from this, the way I store encrypted passwords in the database is using mysql&apos;s ENCODE() function.  This allows you two way encryption such that the password is stored encrypted in the database, but can be decoded when authenticating.  To do this, add another field to your users table of type TEXT.  To add a user, this field would be set as something like:

  INSERT INTO users (user_login, sasl_passwd)
  VALUES (&apos;login&apos;, ENCODE(&apos;plaintext&apos;, &apos;secretsalt&apos;))

Or if you&apos;re using saslpasswd2 to manage your user passwords, add this to your /etc/sasl2/saslpasswd.conf:

  sql_insert:  INSERT INTO users (user_login, sasl_passwd) VALUES (&apos;%u&apos;, ENCODE(&apos;%v&apos;, &apos;secretsalt&apos;))
  sql_update:  UPDATE users SET sasl_passwd = ENCODE(&apos;%v&apos;, &apos;secretsalt&apos;) WHERE user_login = &apos;%u&apos;

Then in all the services you&apos;d configure the following in the .conf files:

  sql_select:  SELECT DECODE(sasl_passwd, &apos;secretsalt&apos;) FROM users WHERE user_login = &apos;%u&apos;

Where &apos;secretsalt&apos; is something you come up with for encoding/decoding the password field and (obviously) keep a secret.  This setup has the added benefit of allowing APOP, {CRAM,DIGEST}-MD5 mechanisms and no extra patches needed for the sasl package.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>langthang@gentoo.org</who>
            <bug_when>2004-07-18 22:12:52 0000</bug_when>
            <thetext>Since upstream do not want to add this patch themself, I am sure we don&apos;t want to support it either. Upstream ML discussion about this patch here: 
http://www.viperstrike.com/~lopaka/sysadmin/cyrus-sasl-mysql-encrypt/software-sources/patch</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>langthang@gentoo.org</who>
            <bug_when>2004-08-01 14:14:10 0000</bug_when>
            <thetext>*** Bug 58622 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>langthang@gentoo.org</who>
            <bug_when>2004-08-01 14:15:32 0000</bug_when>
            <thetext>*** Bug 51320 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>langthang@gentoo.org</who>
            <bug_when>2004-11-17 10:15:13 0000</bug_when>
            <thetext>*** Bug 71567 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>langthang@gentoo.org</who>
            <bug_when>2004-11-17 10:17:25 0000</bug_when>
            <thetext>the reference in comment #3 is wrong. This is the one: 
http://asg.web.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&amp;msg=5683</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>langthang@gentoo.org</who>
            <bug_when>2005-01-02 11:36:33 0000</bug_when>
            <thetext>*** Bug 76390 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferdy@gentoo.org</who>
            <bug_when>2005-02-15 11:43:07 0000</bug_when>
            <thetext>Added in cyrus-sasl-2.1.20-r2. Just commited to CVS.

Cheers,
Ferdy</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>klgalway@gmail.com</who>
            <bug_when>2005-10-27 14:34:57 0000</bug_when>
            <thetext>There is a spelling error in the ebuild:

# Sypport for crypted passwords. Bug #45181

Secondly, if crypted password support is going to be added and seeing as there
is already support for mysql, then I think that the
http://frost.ath.cx/software/cyrus-sasl-patches/dist/2.1.19/cyrus-sasl-2.1.19-checkpw.c+sql.c.patch
should be an option for building. I have tested that this works on my system
with cyrus-sasl-2.1.21-r1.ebuild and mysql version 4.1.14</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferdy@gentoo.org</who>
            <bug_when>2005-11-06 03:48:00 0000</bug_when>
            <thetext>Typo fixed in 2.1.21-r1.

As for the mysql patch, I&apos;d rather not include more patches. This should
*really* be pushed upstream. If they don&apos;t include them, normally we don&apos;t.

Thanks,
Ferdy</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>klgalway@gmail.com</who>
            <bug_when>2005-11-08 08:00:02 0000</bug_when>
            <thetext>(In reply to comment #11)
&gt; Typo fixed in 2.1.21-r1.
&gt; 
&gt; As for the mysql patch, I&apos;d rather not include more patches. This should
&gt; *really* be pushed upstream. If they don&apos;t include them, normally we don&apos;t.
&gt; 
&gt; Thanks,
&gt; Ferdy

*shrug* I disagree as I feel that it would be helping to make things more secure
seeing how sending passwords in cleartext is just stupid.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>klgalway@gmail.com</who>
            <bug_when>2005-11-08 08:28:26 0000</bug_when>
            <thetext>(In reply to comment #11)
&gt; Typo fixed in 2.1.21-r1.
&gt; 
&gt; As for the mysql patch, I&apos;d rather not include more patches. This should
&gt; *really* be pushed upstream. If they don&apos;t include them, normally we don&apos;t.
&gt; 
&gt; Thanks,
&gt; Ferdy

*shrug* I disagree as I feel that it would be helping to make things more secure
seeing how sending passwords in cleartext is just stupid.(In reply to comment #12)
&gt; (In reply to comment #11)
&gt; &gt; Typo fixed in 2.1.21-r1.
&gt; &gt; 
&gt; &gt; As for the mysql patch, I&apos;d rather not include more patches. This should
&gt; &gt; *really* be pushed upstream. If they don&apos;t include them, normally we don&apos;t.
&gt; &gt; 
&gt; &gt; Thanks,
&gt; &gt; Ferdy
&gt; 
&gt; *shrug* I disagree as I feel that it would be helping to make things more secure
&gt; seeing how sending passwords in cleartext is just stupid.

After finding the ML discussion mentioned previously in this bug report, I
withdraw my request and comment regarding security. I am in agreement with Ferdy
that the cyrus-sasl maintainers should deal with this instead of us patching the
code to death anymore than it already is.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>27667</attachid>
            <date>2004-03-19 18:28 0000</date>
            <desc>My new ebuild and crypted password patch</desc>
            <filename>cyrus-sasl-2.1.18.ebuild.tar.bz2</filename>
            <type>application/x-tbz</type>
            <data encoding="base64">QlpoOTFBWSZTWTSHWCoAC+z/hPzwAgB9///7/////v////8AAQAIYBCOB3Y+vOjdrvXvT223pmvS
1e8eAFtoV3MGgVbdaAAoAdDogkimiaaANCZqYhppqn6MphJ6nphJ5R6nqY1Gmj1DaTRpieTRBoIA
gaTSmmmIxNG0hiNGIMIAA0yAGgAAyBFNo1SeCCemk00NGCGQNNAaAAAAAAASakgp6mQMJT1PSemJ
pNqfqQDRkANNAA0GgaDQAHAA0BoGgAaaZAAaNMgA0ZMEBiAABIkEBNMgJpo0TTTJNHpTYqPU9JmU
AM1NNGmINDEZNH0+Kbs9WHEZPcrNJADU0gFbSZWg2pSKCQ6yop5egu1VUxmIxCGUZAokBgFhCVVW
hDrFHPIBZmcCqFFYwoqlFolFMWNVS3VKIsaWpVVCqWqiKFCSpYIgWZaMqiiwfj9XgLGUvkqY1ilp
Igwjaw0WBtUKBCKigttqN1VcjLpctQtUV/w+ght+BXh5q2iGWOnd2YmCM8bL8M15en9pjnQuzMon
te6QbZ+CCyYAX7RcjB6Bdyt5xAtSaG7Bu1RkXouWg6ShOvsWozlfFEzcm2Zim2yEDQwUL8UxSucj
2C2SxfgXS8tMuGYjLgeWhaosUxsenKq/oNNw4S1DfMjrxlxgmAK3xVsmKoKFqq5aGlDk7bVuxo8o
15VrwMdQ55Y0dFp0336nNYN+1fdldgY6V4y7PFpjGHZ4S5LWgSKGaYoBH7EwFAtJrGIkRQSLpqoC
isqr+rdKsMGKTsRqJOyhDG1Bq+GXHUIt4L98acznsXvhrjs4V18KRy6Y5lrp3Ze6g0GWOqEnQmnW
sAyvelzAXnEcNvLTU6CYaMSjux1Qa3lhnPol6zcgfIzz1EsoBDLa3zyJ9trDYZbqK9PVDRWGKdvF
EeuP0m1mWPdq+ImR5ApvN3ZiWDNguyVL+DJFRyBTOuzW3A7cCPzdaLD7ttAUjOh03ILZs3PPdtqV
gn3z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