0

I have a REST web service running an RPG program, as I need to encrypt some data using Openssl I have built a shell script that receives the data via ENV vars and sends out the data in data areas.

Rest_RPG calls a CLP that runs the qsh script, and retrieves the data from the data area. If I run the cl interactively it works perfectly and it retrieves the data from the data area but when called from the REST web service it doesn't retrieve anything, I have gave authority to QTMHHTTP and QTMHHTP1 to QGPL and no luck, any ideas?

script: print -nr $PASS | openssl enc -aes-128-ecb -K $KEY_HEX -nosalt -base64 | datarea -wl $DTAPASS

CLP: CRTDTAARA DTAARA(QGPL/DTAPASS) TYPE(*CHAR) LEN(512) AUT(*ALL) ADDENVVAR ENVVAR(PASS) VALUE(&PPASS) CCSID(*JOB) REPLACE(*YES) qsh('/tmp/script.sh') RTVDTAARA DTAARAQGPL/DTAPASS) RTNVAR(&ENC_PASS)

2 Answers2

0

seems issue is with relative path name (QGPL library) and -wl combination. Please try creating dataarea in another library which is part of library list of job or use datarea -w option.

Mani
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 12 '21 at 22:57
0

I've tried other libraries, gave up, I'm using the IBM Cryptographic APIs now.

https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_74/apis/catcrypt.htm?fbclid=IwAR0-BGP-6wdBQPMXP3lp-EPSARpfcIcdCuEE5RzcGYBIdbnVFCno0qVjyBU

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 14 '21 at 12:53