Adam Heath
6cd099d6fd
FEATURE: Key-encrypting-key(kek) support is now enabled. To enable
...
support for this, run:
java org.ofbiz.base.crypto.Main -kek
and paste that value as a new attribute in entityengine.xml, <delegator
key-encrypting-key="$kekText"/>. Make certain to add that attribute to
*all* delegators that share the same datasources.
ps: That java command should really be added to build.xml.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335268 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 21:27:32 +00:00
Adam Heath
31b721aaa6
FIX: Bare passwords(circa 595296) comparisons were broken; they actually
...
used the oldFunnyHex encoding, not the fixed correct hex encoding.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335267 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 21:27:25 +00:00
Adam Heath
48062a3c41
FIX: There is a problem with tenant kek support, this should fix it.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335064 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 15:29:28 +00:00
Jacopo Cappellato
5b528efa2d
First pass in fixing the buggy code for captcha support; this is a first pass (the next one will probably be to save the image in the session rather than in the file system); the main problems fixed are related to concurrent access: the class was not thread safe and this, especially in servers with high traffic, could cause a series of issues like:
...
* captcha images created and then lost
* captcha images created in the wrong location (for example out of the OFBiz folder)
* the folder runtime/tempfiles/captcha could be locked
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335047 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 14:46:07 +00:00
Adrian Crum
3aba61d402
Oops, forgot to include schema changes in my last commit.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335025 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 13:53:50 +00:00
Adrian Crum
832eb766ea
Overhauled Mini-language <return> element.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335020 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 13:50:41 +00:00
Adrian Crum
615c04ec63
Moved some classes out of the org.ofbiz.minilang.method.callops package. The classes might have been intended for call/return operations originally, but now they are used in a generic way - so I moved them to the org.ofbiz.minilang.method.envops package.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1335018 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 13:48:41 +00:00
Adrian Crum
778871216f
Moved some classes out of the org.ofbiz.minilang.method.conditional package that didn't belong there.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334997 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 12:59:21 +00:00
Adrian Crum
782b312b1a
Small fix for the Mini-language <set> element validation - allow scripts in the "from" attribute.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334996 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 12:56:36 +00:00
Adrian Crum
e288d47d0c
More work on Mini-language: API fixes, overhauled <if-regexp>, <if-validate-method>, and <check-id> elements.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334971 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 12:26:01 +00:00
Hans Bakker
7f14038f90
fix duplicate relation name
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334927 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 08:58:06 +00:00
Adrian Crum
643d47d4ac
Overhauled a bunch of Mini-language conditional elements.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334915 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 08:28:47 +00:00
Adrian Crum
1a9c764f4e
Minor code cleanup in ObjectType.java.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334840 13f79535-47bb-0310-9956-ffa450edef68
2012-05-07 00:13:35 +00:00
Adrian Crum
315b486c47
Overhauled Mini-language <assert> element.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334579 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 09:28:14 +00:00
Adrian Crum
11ccf4ebcb
Some code cleanups/fixes for the Mini-language <add-error> element.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334578 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 09:27:20 +00:00
Adrian Crum
a854aa7d55
Added a convenience method to MiniLangValidate.java.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334577 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 09:25:49 +00:00
Jacques Le Roux
80af13f2c1
Non functional changes. Removes useless exceptions catches.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334576 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 09:06:39 +00:00
Adrian Crum
ae64f8dfc8
FlexibleStringExpander performance improvement - eliminate costly call to UtilValidate.isEmpty(Object).
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334575 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 08:59:24 +00:00
Adrian Crum
b968e62da5
Overhauled Mini-language <iterate-map>, <loop>, and <while> elements.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334536 13f79535-47bb-0310-9956-ffa450edef68
2012-05-06 00:43:58 +00:00
Adrian Crum
40b48b9a34
Overhauled Mini-language <iterate> element.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334502 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 20:53:13 +00:00
Adrian Crum
96145d0819
Mini-language validation bug fix - allow nested expressions.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334501 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 20:52:35 +00:00
Jacques Le Roux
c4ca1b90fc
Simplify code, non functional changes
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334483 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 20:23:39 +00:00
Adrian Crum
e0313918de
Reverting my previous commit because it breaks nested expressions.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334473 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 19:45:19 +00:00
Adrian Crum
272d627686
Improved Mini-language <set-service-fields> auto-correction.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334469 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 19:09:26 +00:00
Adrian Crum
d1cd637f11
Bug fix in Mini-language <iterate> element - the <break> and <continue> elements were ignored for collections and iterators.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334459 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 17:36:13 +00:00
Adrian Crum
7ea995a955
Small fixup for my previous commit.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334452 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 17:06:36 +00:00
Adrian Crum
a3d9a9d004
Overhauled Mini-language <set-service-fields> element. This commit includes some minor behavior changes.
...
In the previous version, if the source Map was not found, the target Map was not created. Now the target Map is always created if it doesn't already exist.
In the previous version, any errors encountered during the copying process were added to the error message list and script execution continued. Now the error messages are added to the error message list and script execution is stopped.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334450 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 17:00:36 +00:00
Adrian Crum
8c35d76140
More work on the Mini-language <simple-method> element: Simplified script caching. This prepares the way to have simple methods cached individually, instead of caching the entire file.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334427 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 15:05:40 +00:00
Adrian Crum
a14a4384ab
Refactored FlexibleLocation.java - removed unnecessary synchronized lazy-load code (LocationResolvers don't cost anything to build), and made the class thread-safe. No functional change.
...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1334426 13f79535-47bb-0310-9956-ffa450edef68
2012-05-05 15:02:36 +00:00
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