You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Tudor Raneti (Created) (JIRA)" <ji...@apache.org> on 2011/09/28 09:28:45 UTC

[jira] [Created] (SHIRO-327) HashedCredentialsMatcher getCredentials() bug

HashedCredentialsMatcher getCredentials() bug
---------------------------------------------

                 Key: SHIRO-327
                 URL: https://issues.apache.org/jira/browse/SHIRO-327
             Project: Shiro
          Issue Type: Bug
          Components: Authorization (access control) , Cryptography & Hashing
    Affects Versions: 1.1.0
         Environment: irrelevant
            Reporter: Tudor Raneti


isStoredCredentialsHexEncoded() always returns true, no matter if I store a hex or a base64 password or credential. Hex is Base16. Authentication fails if I store Base64 with an IllegalArgumentException because Hex.decode(...) doesn't recognize but the 0..9 and a..f alphabet

Code quote:

//account.credentials were a char[] or String, so
            //we need to do text decoding first:
            if (isStoredCredentialsHexEncoded()) {
                storedBytes = Hex.decode(storedBytes);
            } else {
                storedBytes = Base64.decode(storedBytes);
            }

...
from my ini:
# password hashing specification
sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher
sha256Matcher.hashAlgorithmName=SHA-256 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (SHIRO-327) HashedCredentialsMatcher getCredentials() bug

Posted by "Tudor Raneti (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHIRO-327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tudor Raneti updated SHIRO-327:
-------------------------------

    Comment: was deleted

(was: I see it's a feature not a bug :) 
(see comments))
    
> HashedCredentialsMatcher getCredentials() bug
> ---------------------------------------------
>
>                 Key: SHIRO-327
>                 URL: https://issues.apache.org/jira/browse/SHIRO-327
>             Project: Shiro
>          Issue Type: Bug
>          Components: Authorization (access control) , Cryptography & Hashing
>    Affects Versions: 1.1.0
>         Environment: irrelevant
>            Reporter: Tudor Raneti
>             Fix For: 1.1.0
>
>
> isStoredCredentialsHexEncoded() always returns true, no matter if I store a hex or a base64 password or credential. Hex is Base16. Authentication fails if I store Base64 with an IllegalArgumentException because Hex.decode(...) doesn't recognize but the 0..9 and a..f alphabet
> Code quote:
> //account.credentials were a char[] or String, so
>             //we need to do text decoding first:
>             if (isStoredCredentialsHexEncoded()) {
>                 storedBytes = Hex.decode(storedBytes);
>             } else {
>                 storedBytes = Base64.decode(storedBytes);
>             }
> ...
> from my ini:
> # password hashing specification
> sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher
> sha256Matcher.hashAlgorithmName=SHA-256 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (SHIRO-327) HashedCredentialsMatcher getCredentials() bug

Posted by "Tudor Raneti (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHIRO-327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tudor Raneti resolved SHIRO-327.
--------------------------------

       Resolution: Not A Problem
    Fix Version/s: 1.1.0

I see it's a feature not a bug :) 
(see comments)
                
> HashedCredentialsMatcher getCredentials() bug
> ---------------------------------------------
>
>                 Key: SHIRO-327
>                 URL: https://issues.apache.org/jira/browse/SHIRO-327
>             Project: Shiro
>          Issue Type: Bug
>          Components: Authorization (access control) , Cryptography & Hashing
>    Affects Versions: 1.1.0
>         Environment: irrelevant
>            Reporter: Tudor Raneti
>             Fix For: 1.1.0
>
>
> isStoredCredentialsHexEncoded() always returns true, no matter if I store a hex or a base64 password or credential. Hex is Base16. Authentication fails if I store Base64 with an IllegalArgumentException because Hex.decode(...) doesn't recognize but the 0..9 and a..f alphabet
> Code quote:
> //account.credentials were a char[] or String, so
>             //we need to do text decoding first:
>             if (isStoredCredentialsHexEncoded()) {
>                 storedBytes = Hex.decode(storedBytes);
>             } else {
>                 storedBytes = Base64.decode(storedBytes);
>             }
> ...
> from my ini:
> # password hashing specification
> sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher
> sha256Matcher.hashAlgorithmName=SHA-256 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHIRO-327) HashedCredentialsMatcher getCredentials() bug

Posted by "Jared Bunting (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116369#comment-13116369 ] 

Jared Bunting commented on SHIRO-327:
-------------------------------------

Try adding:

sha256Matcher.storedCredentialsHexEncoded=false

                
> HashedCredentialsMatcher getCredentials() bug
> ---------------------------------------------
>
>                 Key: SHIRO-327
>                 URL: https://issues.apache.org/jira/browse/SHIRO-327
>             Project: Shiro
>          Issue Type: Bug
>          Components: Authorization (access control) , Cryptography & Hashing
>    Affects Versions: 1.1.0
>         Environment: irrelevant
>            Reporter: Tudor Raneti
>
> isStoredCredentialsHexEncoded() always returns true, no matter if I store a hex or a base64 password or credential. Hex is Base16. Authentication fails if I store Base64 with an IllegalArgumentException because Hex.decode(...) doesn't recognize but the 0..9 and a..f alphabet
> Code quote:
> //account.credentials were a char[] or String, so
>             //we need to do text decoding first:
>             if (isStoredCredentialsHexEncoded()) {
>                 storedBytes = Hex.decode(storedBytes);
>             } else {
>                 storedBytes = Base64.decode(storedBytes);
>             }
> ...
> from my ini:
> # password hashing specification
> sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher
> sha256Matcher.hashAlgorithmName=SHA-256 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (SHIRO-327) HashedCredentialsMatcher getCredentials() bug

Posted by "Tudor Raneti (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116535#comment-13116535 ] 

Tudor Raneti commented on SHIRO-327:
------------------------------------

Thanks. I see it's a feature not a bug :)
I haven't looked any deeper at the time
                
> HashedCredentialsMatcher getCredentials() bug
> ---------------------------------------------
>
>                 Key: SHIRO-327
>                 URL: https://issues.apache.org/jira/browse/SHIRO-327
>             Project: Shiro
>          Issue Type: Bug
>          Components: Authorization (access control) , Cryptography & Hashing
>    Affects Versions: 1.1.0
>         Environment: irrelevant
>            Reporter: Tudor Raneti
>             Fix For: 1.1.0
>
>
> isStoredCredentialsHexEncoded() always returns true, no matter if I store a hex or a base64 password or credential. Hex is Base16. Authentication fails if I store Base64 with an IllegalArgumentException because Hex.decode(...) doesn't recognize but the 0..9 and a..f alphabet
> Code quote:
> //account.credentials were a char[] or String, so
>             //we need to do text decoding first:
>             if (isStoredCredentialsHexEncoded()) {
>                 storedBytes = Hex.decode(storedBytes);
>             } else {
>                 storedBytes = Base64.decode(storedBytes);
>             }
> ...
> from my ini:
> # password hashing specification
> sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher
> sha256Matcher.hashAlgorithmName=SHA-256 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira