Closed w4r10-b0b closed 3 years ago
Nothing in the documentation says we support PBKDF2_SHA256.
As always, patches are welcome.
We do actually have full support for this but only in master branch.
Supported formats are:
/*
* If it doesn't begin with a $ assume
* It's Crypt::PBKDF2 LDAP format
*
* {X-PBKDF2}<digest>:<b64 rounds>:<b64_salt>:<b64_hash>
*/
/*
* Crypt::PBKDF2 Crypt format
*
* $PBKDF2$<digest>:<rounds>:<b64_salt>$<b64_hash>
*/
/*
* Python's passlib format
*
* $pbkdf2-<digest>$<rounds>$<alt_b64_salt>$<alt_b64_hash>
*
* Note: Our base64 functions also work with alt_b64
*/
If you can provide some documentation for your LDAP based format I'd be happy to add something to parse it
Hi,
It appears to be using the following method from the latest Password Vault from FreeIPA: https://www.freeipa.org/page/V4/Password_Vault_2.0
Which is:
DK = PBKDF2(PRF, Password, Salt, c, dkLen) where:
PRF is a pseudorandom function of two parameters with output length hLen (e.g., a keyed HMAC) Password is the master password from which a derived key is generated Salt is a sequence of bits, known as a cryptographic salt c is the number of iterations desired dkLen is the desired bit-length of the derived key DK is the generated derived key
The site has documentation on how to do in C.
That site has no information on how to turn {PBKDF2_SHA256}AAAIAElQ9+kOExv12HALK9/ta+VKE79Jz9Eky+Ta0/FJZlHaAnuQm8V8ClGhX5scnZOOBriMTPAS3wnhNbKbqsybfSArRl7cFnJMeFXKhqB7aZYtk0uEWthtja+u0ZPBUvQwPrWtr2mgF6MWU5pW2qdd0VW7EJeY3bm4uaoPxFOXM5zOBNAFGgO2nYLN75I6/Wh1IESMeWp5eJ2+tNDafOwTAGOXggViGAufjkOyLYw9eS+9MkafntEHYStlUUSi16YCO+s/hvNzp9VpF0sFDDaaL7mlhevls+jG1y9FLvCSsgOHm4Frn6iACsenHwD5xaBm5nqNCXS9BIg/qCq8lxnMbOqCx7gfAGHQ84yS8MXsNbS79dXFYt2QDNFDX7M9vdKgcQumcniwlBunIbL/kB85yv7AkmjPcQ68eiEltzD9HWlJ
into parameters for the PBKDF2 function, which was what I was asking for.
Closing due to lack of response.
Sorry, just saw this issue. If you're still interested in adding support...
Password Vault isn't where this is coming from. This is actually coming from 389ds
's password hashing function. The contents above are the base64 encoded form of the following structure:
PBKDF2_HASH_LENGTH
== 256 bytes).See the pbkdf2_sha256_pw_enc_rounds
function in the 389ds source.
In the above example (converted to hex for ease):
00000800
= 20484950f7e90e131bf5d8700b2bdfed6be54a13bf49cfd124cbe4dad3f1496651da027b909bc57c0a51a15f9b1c9d938e06b88c4cf012df09e135b29baacc9b7d20
2b465edc16724c7855ca86a07b69962d934b845ad86d8dafaed193c152f4303eb5adaf69a017a316539a56daa75dd155bb109798ddb9b8b9aa0fc45397339cce04d0051a03b69d82cdef923afd687520448c796a79789dbeb4d0da7cec13006397820562180b9f8e43b22d8c3d792fbd32469f9ed107612b655144a2d7a6023beb3f86f373a7d569174b050c369a2fb9a585ebe5b3e8c6d72f452ef092b203879b816b9fa8800ac7a71f00f9c5a066e67a8d0974bd04883fa82abc9719cc6cea82c7b81f0061d0f38c92f0c5ec35b4bbf5d5c562dd900cd1435fb33dbdd2a0710ba67278b0941ba721b2ff901f39cafec09268cf710ebc7a2125b730fd1d6949
(Thanks @tiran for your help figuring out that this wasn't Vault's problem and pointing me to 389ds).
Perfect, thanks for the info.
Looked into this more. Probably should split PBKDF2 string into components in authorize and feed that through to authenticate.
Hi all! FreeIPA use PBKDF2_SHA256 hashes for passwords. Is there way to use FreeRADIUS with FreeIPA? How I can tune FreeRADIUS for use PBKDF2_SHA256? Now I use FreeRADIUS 3.0.17 on centos 8 and I got this error
pap: Unknown header {{PBKDF2_SHA256}} in Password-With-Header = "{PBKDF2_SHA256} <HASH_HERE>", re-writing to Cleartext-Password
Mon Jun 29 17:37:27 2020 : Debug: (0) pap: Removing &control:Password-With-Header
FreeIPA use PBKDF2_SHA256 hashes for passwords. Is there way to use FreeRADIUS with FreeIPA? How I can tune FreeRADIUS for use PBKDF2_SHA256? Now I use FreeRADIUS 3.0.17 on centos 8 and I got this error
v3 does not (yet) support PBKDF2_SHA256. However, that functionality is in the "master" branch.
It can probably be back-ported at some point.
Hi, When will this be back ported ? its been a year, and I am now just running into this issue.
Alternatively are there any workarounds ?
When will this be back ported ? its been a year, and I am now just running into this issue.
We're happy to accept patches.
Until then, it's on our list of things to do.
Thanks for the response. Id love to support the project and apply a patch but unfortunately I don't know C.
In the meantime i'm looking for a work around. You mentioned above that the Docs don't mention support for PBKDF2_SHA256.
FreeIPA supports the following hashes. CLEAR, CRYPT, CRYPT-MD5, CRYPT-SHA256, CRYPT-SHA512, MD5, PBKDF2_SHA256, SHA, SHA256, SHA384, SHA512, SMD5, SSHA, SSHA256, SSHA384, SSHA512
I don't mind downgrading the hashing algorithm FreeIPA uses to store passwords until support for this has been implemented if required but I'd prefer not to.
At the moment from what I've read from various places, im leaning towards a configuration error on my end as i'm currently upgrading from an older version of FreeRadius and integrating it with the latest release of FreeIPA.
I'll check on Monday when I'm fresh and back in the office.
Would it be better to move and further questions to the mailing list ?
Cheers
Hi @k-s-dean,
We appreciate if you can perform your tests against the branch https://github.com/jpereira/freeradius-server/tree/v3/pbkfd2 mentioned in https://github.com/FreeRADIUS/freeradius-server/pull/3660
Thanks for the response. Id love to support the project and apply a patch but unfortunately I don't know C.
In the meantime i'm looking for a work around. You mentioned above that the Docs don't mention support for PBKDF2_SHA256.
FreeIPA supports the following hashes. CLEAR, CRYPT, CRYPT-MD5, CRYPT-SHA256, CRYPT-SHA512, MD5, PBKDF2_SHA256, SHA, SHA256, SHA384, SHA512, SMD5, SSHA, SSHA256, SSHA384, SSHA512
I don't mind downgrading the hashing algorithm FreeIPA uses to store passwords until support for this has been implemented if required but I'd prefer not to.
At the moment from what I've read from various places, im leaning towards a configuration error on my end as i'm currently upgrading from an older version of FreeRadius and integrating it with the latest release of FreeIPA.
I'll check on Monday when I'm fresh and back in the office.
Would it be better to move and further questions to the mailing list ?
Cheers
@jpereira
I'll get on that ASAP.
Cheers
btw, @k-s-dean the support was merged into the v3.0.x branch. Please, if you don't mind perform your tests against branch v3.0.x https://github.com/FreeRADIUS/freeradius-server/archive/v3.0.x.zip
@jpereira Hi there,
how is the latest status on this? Is it implemented in the latest Github release version (3.0.21)?
We are also using FreeIPA as LDAP and we need to authenticate users against "PBKDF2_SHA256". The Debian package (version: 3.0.17+dfsg-1.1) does not support this.
If it is supported by 3.0.21 I'd compile a newer version myself.
Cheers
@flymia you can grab the 3.0.21 docker image and use that. I don't think the support for it is in that version as that is what I'm running, but someone else might be able to give you an exact answer.
I never got round to testing this due to other commitments, but my time has now been freed up so I'll hopefully be able to test this very soon.
Jorge's comment was September 2020. 3.0.21 was released months earlier, in March 2020. The resulting math should be straightforward.
According to http://lists.freeradius.org/pipermail/freeradius-users/2021-April/099715.html, PBKDF2_SHA256
is still not supported as of version 3.0.23.
As precisely this password hash function is interesting for FreeIPA integration (and the title of this issue specifies PBKDF2_SHA256
), I would propose to re-open this issue.
@stertingen We're happy to take patches. Until then, there are unfortunately higher priority items.
I just stumbled across this rather old ticket and while some PBKDF2 for HMAC SHA2/SHA3 has been added, the IPA default of PBKDF2_SHA512 (and ..._SHA256 etc.) is still not supported. We are also using IPA/389 directory server and have a user database with this method and tried to use it has a backend for WPA2 Enterprise, but as it seems it would require adding another PW with a different hash.
Any chance that those get added?
@B5JohnSheridan Patches are always welcome. It's likely <100 lines of code.
Issue type
REMOVE THOSE WHICH DO NOT APPLY
See here for debugging instructions and how to obtain backtraces.
Defect
How to reproduce the issue
When attempting to authenticate to the FreeIPA server which uses encrypted password. Still uses PAP and does not recognise the encryption type header used.
Output of
[radiusd|freeradius] -X
showing issue occurring(you may need to run
[radiusd|freeradius] -fxx -l stdout
if using eg RADIUS with TLS)Full backtrace from LLDB or GDB
mschap.log pap.log chap.log eap.log ldap.log default.log inner-tunnel.log radconf.log