Mantis - Quercus
Viewing Issue Advanced Details
4137 minor always 07-23-10 07:47 07-23-10 07:48
sblommers Linux  
Ubuntu  
normal 10.04  
new 4.0.9  
SVN open  
none    
none  
0004137: hash_hmac always returning false
Reason: Mac.getInstance always fails because it resolves the sha* to SHA-* which is incorrect (HashModule.java)

  static {
    _algorithmMap.put("md2", "MD2");
    _algorithmMap.put("md5", "MD5");
    _algorithmMap.put("sha1", "SHA");
    _algorithmMap.put("sha256", "SHA-256");
    _algorithmMap.put("sha384", "SHA-384");
    _algorithmMap.put("sha512", "SHA-512");
  }
Run drupal services with APIKEY check on, the hash_mac(sha256 always fails because the context in HashModule won't ever be filled.
  static {
    _algorithmMap.put("md2", "MD2");
    _algorithmMap.put("md5", "MD5");
    _algorithmMap.put("sha1", "SHA");
    _algorithmMap.put("sha256", "SHA256");
    _algorithmMap.put("sha384", "SHA384");
    _algorithmMap.put("sha512", "SHA512");
  }

fixed it

Notes
(0004681)
sblommers   
07-23-10 07:48   
See http://bitbucket.org/sblommers/resin [^] for patchbranches