Commit Graph
6568 Commits
Author SHA1 Message Date
Adrian Crum 02e87f4e51 More work on the Mini-language <simple-method> element: I added the SimpleMethod object to the environment (bindings) to permit introspection.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334404 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 11:39:55 +00:00
Adrian Crum ea8ef272d5 More work on the Mini-language <simple-method> element: I removed the attributes that specify some of the environment map (bindings) keys. Those keys should be under the control of the framework so they are consistent across scripting languages.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334402 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 11:34:12 +00:00
Adrian Crum 2044f8779a Small fixup for my previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334382 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 10:17:44 +00:00
Adrian Crum 38430074c5 Added UTF-8 encoding to UtilPropertiesTests, simplified the code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334370 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 09:53:16 +00:00
Adrian Crum 91d1f4f982 More work on the Mini-language <simple-method> element: moved convenience methods from MethodOperation.java to SimpleMethod.java - so all sub-elements can use them (not just operations elements), simplified some code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334358 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 09:25:03 +00:00
Jacques Le Roux 2bd37215c5 Better way to read the distributable element from web.xml files.
I did not put any distributable elements in web.xml files. So people still needs to follow the advice in catalina-container element in ofbiz-containers.xml

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334336 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 07:59:34 +00:00
Hans Bakker 32b7ee65bf reverting 1334331: unwanted commit
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334333 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 07:52:25 +00:00
Hans Bakker 42341068ec set memory back to 640k and add demo message
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334331 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 07:43:19 +00:00
Adam Heath f1be0a1e0c FEATURE: Add key-encrypting-key support; this is to bring ofbiz *much*
closer to PCI compliance.  This key handler is *still* not active.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334257 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:37:06 +00:00
Adam Heath 48a8ed8b34 OPTIMIZE: Move delegatorInfo assignment into the constructor; in all
cases, this will always be configured, so might as well do it early.
This really should be final, but that change will come later.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334256 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:56 +00:00
Adam Heath a1f182fe02 FEATURE: Add SaltedBase64StorageHandler to EntityCrypto; key names are
base-64 crypted({hashType}$text), key values are base64 encoded,
encrypted row values are $salt$encoded.  Note, however, that this code
is not yet active, as it hasn't been added to the list of key handlers.

This new handler is *not* active yet.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334255 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:50 +00:00
Adam Heath 31f3253361 OPTIMIZE/FEATURE: Move a bunch of code around, into a set of abstract
classes and concrete instances.  This allows for adding new types of key
management blocks, so that enhanced features can be added.  No
functional changes have actually been implemented yet; all existing
systems should behave *exactly* the same.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334254 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:44 +00:00
Adam Heath 53d1aa5762 OPTIMIZE: Remove the use of a few internal variables, and return results
directly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334253 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:37 +00:00
Adam Heath 53492a9a9a OPTIMIZE: Now that safe locking/threading is supported, there is no
longer a need to pre-populate the EntityKeyStore table with 20 random
keys; in reality, these 20 keys were enought to expand the keyMap
HashMap's internal structure, to a size that wouldn't normally be
auto-expanded during production.  And it was this lack of auto-expanding
that was keeping the map from becoming corrupted in very rare
circumstances.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334252 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:31 +00:00
Adam Heath 1db44dbbd7 FEATURE: Use a ConcurrentHashMap to store the keys loaded from the
database; as such, there is no longer any synchronization on the keyMap.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334251 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 23:36:25 +00:00
Adam Heath 4e8ed7763d FEATURE: Make EntityCrypto final.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334218 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:51 +00:00
Adam Heath b7572e89b8 FEATURE: call UtilObject.getObjectException, and rethrow any exceptions,
so that the exception doesn't get logged multiple times.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334217 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:45 +00:00
Adam Heath 486f43495b FIX: When decrypting a value from the database, throw a useful exception
if the key couldn't be found; previously, an NPE would be thrown.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334215 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:37 +00:00
Adam Heath 2a05c1a04e OPTIMIZE: Rename secretKey variable to key; this makes it just like the
rest of the code.  The key stored in the database is not only just for
decrypting or encrypting, it's just a key.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334214 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:30 +00:00
Adam Heath b69f181a54 OPTIMIZE: Move the 2 similiar blocks of key/value decryption code in
decrypt() into a separate internal helper method.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334213 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:24 +00:00
Adam Heath cc85b5e604 OPTIMIZE/FIX: Split the creation and searching of keys in the database
into two separate methods; a find for an old-style hashed key will no
longer create the old-style key.  This commit does not fix the existing
issue when multiplle threads try to encrypt a value with a key that
hasn't been created or loaded from the database yet; that is still to
come.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334212 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:17 +00:00
Adam Heath 2774841b66 OPTIMIZE: Use TransactionUtil.doNewTransaction, instead of suspending it
locally; makes the code simpler to follow.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334211 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 21:58:10 +00:00
Adam Heath da8bf922fc FIX: Properly fix 1327736, which was reverted in 1327866. I have no
idea where those bad digest password values came from.  Really, I have
no clue.  Everything worked in testing.  I'm very confused.  I have
verified that I can log in now with the demo accounts.  Sorry about the
breakage.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334173 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:57 +00:00
Adam Heath a0108243f5 FIX/DEPRECATION: Fix all the HashCrypt deprecated uses. All proper methods in HashCrypt
now follow the same form: (String hashType, ..., String valueToHash).
Some methods also follow a polish notation suffix.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334172 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:45 +00:00
Adam Heath ad92b98bd9 FIX: Handle the case of a field being encrypted that is currently null;
this is really just moving the null check into the local toString().

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334171 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:34 +00:00
Adam Heath 33101dbaa2 FEATURE/DEPRECATION: Deprecate HashCrypt.cryptPassword; previously,
it would call String.getBytes(), without specifying an encoding.  That
meant that the platform default encoding would be used, which might
change between different installs(if someone changed an environment
variable, for instance).  Now, there are explicit variants to be called.

When creating a new value, use cryptValueUTF8.  If, for some reason,
calling code is doing it's own comparison, it must continue to use
cryptValueBytes(password.getBytes()).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334170 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:42:26 +00:00
Adam Heath ad75e931eb FEATURE: Add HashCrypt.digestHash64.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334166 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 20:40:17 +00:00
Adrian Crum 24e8b0f3b1 Overhauled Mini-language <simple-method> element. Cleaned up the code, made the class thread-safe, removed unnecessary DCL synchronization.
This is a first pass - there are more things that need to be fixed, but I didn't want to rewrite the whole thing in one commit.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333960 13f79535-47bb-0310-9956-ffa450edef68
2012-05-04 13:44:05 +00:00
Adam Heath 08349e57aa OPTIMIZE: Move the oldFunnyHex logic into a single internal helper function.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333665 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:30 +00:00
Adam Heath b767ef1868 OPTIMIZE: Remove cryptPassword(String, String); it is not nescessary to
go thru a deprecation cycle for this, as this method was only recently
added, and has never been officially released.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333664 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:24 +00:00
Adam Heath f9aca541c4 OPTIMIZE: s/getCrypted/getCryptedValue/; this is an internal function
only.  Functions that deal with byte[] should be named as fooBytes.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333663 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:11 +00:00
Adam Heath 3f4d7dfbd8 OPTIMIZE: Move the 3 if/elseif/else bodies into separate functions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333662 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:20:05 +00:00
Adam Heath c8de3a22aa OPTIMIZE: Add a getMessageDigest static helper function.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333661 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:19:58 +00:00
Adam Heath d22dd8d05f OPTIMIZE/FEATURE: Factor getObject into another helper,
getObjectException; the latter doesn't catch any exceptions, and doesn't
log them.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333655 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:13:11 +00:00
Adam Heath 565db82f80 OPTIMIZE: Switch internal getCrypted to take a byte array, and use
String.getBytes(Charset) to fetch the bytes.  Also switches the one case
of getBytes("UTF-8") to the Charset version.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333654 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 22:13:04 +00:00
Adam Heath 4f966b5ef2 OPTIMIZE: s/encHex/encValue/, this is a more accurate variable name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333623 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:33 +00:00
Adam Heath 030144565f FEATURE: Add a -digest variant, that uses the deprecated password
digesting code.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333622 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:27 +00:00
Adam Heath 9459906808 FEATURE: Improve warning when an oldFunnyHex hash is detected on a
password.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333621 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:21 +00:00
Adam Heath d192773e13 OPTIMIZE: Remove andCacheFieldSets from GenericDelegator; this variable
hasn't been used in like forever, man.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333620 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:14 +00:00
Adam Heath 589ae262f7 FIX: Oops, my bad. Originally, this was never meant to actually be committed
upstream.  However, I decided that it might be generally useful, so
committed it anyways.  I forgot that I needed to add the copyright
header to it.  I suppose I should add a pre-commit hook somehow either
in svn or git.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333619 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 21:13:08 +00:00
Adrian Crum 644502daca Minor code change in Mini-language <set> element. No Functional change.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333492 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 15:01:01 +00:00
Adrian Crum 055d164b4d Overhauled Mini-language <call-class-method> <call-object-method> <field> and <string> elements.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333491 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 14:59:56 +00:00
Adrian Crum ed29e24544 Created a base class - MiniLangElement - for all Mini-language elements, modified exception handling to accommodate the new base class. This change will provide a means for non-operation elements to throw exceptions.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333489 13f79535-47bb-0310-9956-ffa450edef68
2012-05-03 14:57:40 +00:00
Adrian Crum a9a16a1c0f Updated Mini-language schema.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333042 13f79535-47bb-0310-9956-ffa450edef68
2012-05-02 13:38:31 +00:00
Adrian Crum f4c6457daa Oops, forgot to include null check in previous commit.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333034 13f79535-47bb-0310-9956-ffa450edef68
2012-05-02 13:22:50 +00:00
Adrian Crum e41512f7cd Overhauled Mini-language <call-bsh> element.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333031 13f79535-47bb-0310-9956-ffa450edef68
2012-05-02 13:17:54 +00:00
Adrian Crum a636524386 Improved Mini-language <script> element - now supports inline scripts in the element body.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333030 13f79535-47bb-0310-9956-ffa450edef68
2012-05-02 13:13:10 +00:00
Adrian Crum 5c4009e4c8 Added some convenience methods to MethodOperation.java.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1333028 13f79535-47bb-0310-9956-ffa450edef68
2012-05-02 13:11:00 +00:00
Jacques Le Roux 232dd652be https://issues.apache.org/jira/browse/OFBIZ-4602 "Null values are not synchronized in http mode"
This is not a complete solution and induces more problem than it solves (notably in RuntimeData for jobs), to be continued...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331996 13f79535-47bb-0310-9956-ffa450edef68
2012-04-29 21:02:53 +00:00
Jacques Le Roux 289837001e Fixes "View Calendar Broken in Party Manager > Relationships" https://issues.apache.org/jira/browse/OFBIZ-4739
This was due to MacroScreenRenderer.renderScreenletSubWidget() calling HtmlFormRenderer instead of MacroFormRenderer. So there was still a call to the old, now inexistent, call_cal js function.

So this not only fixes this case but also all other similar cases, when a navigation-form-name screenlet attribute was used and a date field used in the related form.

I have also checked there are no other uses of HtmlFormRenderer in MacroScreenRenderer. So I think w are safe from other side effects...



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1331898 13f79535-47bb-0310-9956-ffa450edef68
2012-04-29 12:07:08 +00:00