Skip to content

Commit

Permalink
move Argon2 to an extension
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Apr 22, 2024
1 parent ae1f877 commit ac52f01
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ant/build-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
<!-- Compress -->
<not><isset property="extCompress"/></not>
<not><isset property="extCompressVersion"/></not>
<!-- Argon2 -->
<not><isset property="extArgon2"/></not>
<not><isset property="extArgon2Version"/></not>
</or>
</condition>
</fail>
Expand Down Expand Up @@ -238,7 +241,7 @@
</sequential>
</macrodef>

<target name="check" depends="check-mysql,check-mssql,check-postgre,check-jdts,check-s3,check-ehcache,check-pdf,check-admin,check-doc,check-image,check-esapi,check-compress,check-testbox,check-lucee-loader-jar,download-lucee-loader-jar">
<target name="check" depends="check-mysql,check-mssql,check-postgre,check-jdts,check-s3,check-ehcache,check-pdf,check-admin,check-doc,check-image,check-esapi,check-compress,check-argon2,check-testbox,check-lucee-loader-jar,download-lucee-loader-jar">
<mkdir dir="${temp}/loader/extensions/"/>
</target>

Expand Down
17 changes: 16 additions & 1 deletion ant/build-extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<available file="${cache}/${extImage}-${extImageVersion}.lex" property="image.present"/>
<available file="${cache}/${extEsapi}-${extEsapiVersion}.lex" property="esapi.present"/>
<available file="${cache}/${extCompress}-${extCompressVersion}.lex" property="compress.present"/>
<available file="${cache}/${extArgon2}-${extArgon2Version}.lex" property="argon2.present"/>
</target>

<target name="check-mysql" depends="check-cache" unless="mysql.present">
Expand Down Expand Up @@ -194,10 +195,12 @@
<target name="check-compress" depends="check-cache" unless="compress.present">
<get src="${extURL}${extCompress}?version=${extCompressVersion}" dest="${cache}/${extCompress}-${extCompressVersion}.lex"/>
</target>
<target name="check-argon2" depends="check-cache" unless="argon2.present">
<get src="${extURL}${extArgon2}?version=${extArgon2Version}" dest="${cache}/${extArgon2}-${extArgon2Version}.lex"/>
</target>
<target name="check-testbox" depends="check-cache" unless="testbox.present">
<get src="${testboxURL}" dest="${cache}/testbox-${testboxVersion}.zip"/>
</target>

<target name="addExtensions" if="buildLoaderJar">
<echots message="add extensions"/>

Expand Down Expand Up @@ -348,6 +351,18 @@
<echo level="info">add:${goal}/extensions/${ext_compress.filename}</echo>
<echo file="${goal}/extensions/.index" append="true">${ext_compress.filename};</echo>

<!-- add extension Argon2 -->
<loadmf jar="${cache}/${extArgon2}-${extArgon2Version}.lex" prefix="ext_argon2."/>
<toFileName id="${ext_argon2.id}" name="${ext_argon2.name}" version="${ext_argon2.version}" property="ext_argon2.filename"/>
<copy
file="${cache}/${extArgon2}-${extArgon2Version}.lex"
todir="${goal}/extensions/"/>
<move
file="${goal}/extensions/${extArgon2}-${extArgon2Version}.lex"
tofile="${goal}/extensions/${ext_argon2.filename}"/>
<echo level="info">add:${goal}/extensions/${ext_argon2.filename}</echo>
<echo file="${goal}/extensions/.index" append="true">${ext_argon2.filename};</echo>

</target>

<target name="check-lucee-loader-jar">
Expand Down
2 changes: 1 addition & 1 deletion test/functions/Argon2CheckHash.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" {

function run( testResults , testBox ) {
describe( title = "Testcase for Argon2CheckHash function", body = function() {
it( title = "checking Argon2CheckHash function", skip=getJavaVersion()>20, body = function( currentSpec ) {
it( title = "checking Argon2CheckHash function", body = function( currentSpec ) { // skip=getJavaVersion()>20
secret = createUUID();
generateHash = generateArgon2Hash(secret);
expect( argon2checkhash(secret, generateHash)).toBeTrue();
Expand Down

0 comments on commit ac52f01

Please sign in to comment.