Utimaco HSM cxitool return error "NO_DEVICE_AVAILABLE" - hardware-security-module

i have error when login using the cxitool.
this the command i used "cxitool Dev=3005#localhost LogonSign=CRYPTO_USER,CRYPTO_USER.key#123456 ListKeys"
it return this error
"HSM::ConnectionException
thrown in login
Error::NO_DEVICE_AVAILABLE"
There's no error when i used csadm to login.
"csadm Dev=3005#localhost LogonSign=CRYPTO_USER,CRYPTO_USER.key#123456 ListUsers"
[update]
i realize User with CXI_GROUP able to use the cxitool. When i use user USR_0000 i able to use the cxitool without the error NO_DEVICE_AVAILABLE

Related

How to test both, the error class and the error message for a rejected promise in one step?

I changed certain promises to return not just an error message but additional info (e.g. error code). For this I switched from plain rejection messages to an own error class. Now I would like to test both: the error class in the rejection and its message. Previously I had:
await expect(core.createDatabaseFile("non-existing/test.sqlite3")).rejects
.toBe("No permissions to access the directory.");
I could change that to:
await expect(core.createDatabaseFile("non-existing/test.sqlite3")).rejects
.toBeInstanceOf(ResponseError);
await expect(core.createDatabaseFile("non-existing/test.sqlite3")).rejects
.toBe("No permissions to access the directory.");
but that would require to execute the test twice, which can become expensive. Is there a way to do the check in one step, similar to chai's rejectedWith?

Integrate GeeTestTask(python3_anticaptcha) with selenium in python3

I have a problem about python3_anticaptcha (api provided by anti-captcha.com), search on web, find support and try over a month but no luck.
API doc:
https://anticaptcha.atlassian.net/wiki/spaces/API/pages/416972814/GeeTestTaskProxyless+-+captcha+from+geetest.com+without+proxy
I am doing a auto login on a website, and copy the api on anti-captcha's doc:
def runGee(self, challenge):
print("start gee")
try:
# Enter the key to the AntiCaptcha service from your account. Anticaptcha service key.
ANTICAPTCHA_KEY = "mycode"
# обязательные параметры
websiteURL = "https:\/\/www.nike.com.hk"
gt = "2328764cdf162e8e60cc0b04383fef81"
print("sloving1")
print("challenge:" ,challenge)
# пример работы с GeeTestTask без прокси
result = GeeTestTaskProxyless.GeeTestTaskProxyless(anticaptcha_key=ANTICAPTCHA_KEY,
websiteURL=websiteURL,
gt=gt).captcha_handler(challenge=challenge)
print("sloving2")
print(result)
print("--end gee--")
except Exception as err:
print(err)
print("--end with error--")
However, the geetask start over 3 minute(or more), and got error everytime. usually error code like:
{'errorId': 34, 'errorCode': 'ERROR_TOKEN_EXPIRED', 'errorDescription': 'Captcha provider
reported that additional variable token has expired.', 'taskId': 1204556667}
or
{'errorId': 12, 'errorCode': 'ERROR_CAPTCHA_UNSOLVABLE', 'errorDescription': ' Captcha
could not be solved by 5 different workers.', 'taskId': 1204060350}
..etc
depends on what parameter i passed.
May i know am i passing the right value to geetask? or some wrong on the code?
Moreover, if geetest return the correct value, i need to do any else to pass capcha(or pass code to geetest server) or GeeTestTaskProxyless already done(not to do anything)?
it is extremely hard to me, does anyone had used this api successfully? Thanks
The problem is not in the anticaptcha but in the geetest provider.
The token challenger can only be used once, when your browser loads the geetest captcha it expires the token.
To fix this problem, you only need to block the request that consumes the token in your browser.
go to devtools and add the block for the geestest captcha API in the browser, like this:
You can automatically integrate this into the selenium with the following command:
driver.execute_cdp_cmd('Network.setBlockedURLs', {"urls": ["api.geetest.com/get.php"]})
driver.execute_cdp_cmd('Network.enable', {})
It seems for me that those errors are because of proxy (if you use any) or just bad IP.
Personally, I use another captcha service and I didn't have such problems with it.
I advice you to try it, it's actually much easier: https://2captcha.com/2captcha-api#solving_geetest
You should send a request like this one:
https://2captcha.com/in.php?key=1abc234de56fab7c89012d34e56fa7b8&method=geetest&gt=f1ab2cdefa3456789012345b6c78d90e&challenge=12345678abc90123d45678ef90123a456b&api_server=api-na.geetest.com&pageurl=https://www.example.com/page/
What you need to archieve is to get correct answer from it, like this one:
{
"challenge":"1a2b3456cd67890e12345fab678901c2de",
"validate":"09fe8d7c6ba54f32e1dcb0a9fedc8765",
"seccode":"12fe3d4c56789ba01f2e345d6789c012|jordan" }
Then you just need to implement that answer on a site. Just read the first link I gave you.
Cheers.

How to deal with pdo errors

I have a question, in the PDO manuial somewhere I read that errors reveal the db connect with username and password (due to a flaw in the zend engine). I see several examples of catching the pdo like this:
catch(PDOException $exception){
return $exception;
}
if the exception is returned, doesn't the user see the error?
Is it better to have disabled the error reporting in the php.ini file, or even do something like
setAttribute(PDO::ERRMODE_SILENT)
instead of the catch statement, or is it better to do a combination of above and redo the catch statement so it doesn't return the error to the user.
This is referring to the pink paragraph on the manual page that says: Warning: If your application does not catch the exception thrown from the PDO constructor, the default action taken by the zend engine is to terminate the script and display a back trace. This back trace will likely reveal the full database connection details, including the username and password. It is your responsibility to catch this exception, either explicitly (via a catch statement) or implicitly via set_exception_handler(). php.net/manual/en/pdo.connections.php.
The user "YOUR COMMON SENSE" marked this as duplicate which is not correct. I don't have an issue with using PDO, Its just a question of dealing with error responses, and correct methodology of error handling.

steamcommunity does not return error code

I'm using node-steamcommunity to get user's inventory
The module responded "[Error: malformed response]"
After doing some debugging I've managed to see the raw response from steamcommunity server (request to: https://steamcommunity.com/profiles/STEAM_ID/inventory/json/570/1/):
The response is
{"success": false}
The problem is that the normal response should contain the error like this:
{"success": false, "Error": "The profile is private"}
So now I can neither get the user's inventory nor the reason why I can't do this.
Could some one point me to the right way of getting the user's inventory from steam
Update:
after doing some investigation I've found something interesting:
When I login as a normal user, i get a sessionid.
With that key I can access to profile inventory
When I start bot I get also get sessionId but when I'm trying to request with bot's session id I get the { success: false} response without any explanation.
Does anyone has an idea what is wrong?
1 is not a correct contextid for Dota 2 (570).
You're looking for https://steamcommunity.com/profiles/STEAM_ID/inventory/json/570/2/ (notice the 2 at the end instead of 1).
You tried accepting trade? If yes then maybe need use:
let key = SteamTotp.getConfirmationKey(identity_secret, time, 'allow');
key is argument for response function

User Exit CONFPP05 (T-code co11n) Exception condition "DUPREC" raised

I'm currently working on the user exit CONFPP05 (T-code co11n)
and I'm facing a problem, when i give error message with type E.
When the program execute that error, the program succesfully run the error message, but after that, when I press ENTER or SAVE button, it gives me a runtime error
here I catch some error
Exception condition "DUPREC" raised.
Error analysis
A RAISE statement in the program "SAPLCORB" raised the exception
condition "DUPREC".
Since the exception was not intercepted by a superior
program, processing was terminated.
Short description of exception condition:
For detailed documentation of the exception condition, use
Transaction SE37 (Function Library). You can take the called
function module from the display of active calls.
-
Trigger Location of Runtime Error
Program SAPLCORB
Include LCORBU08
Row 100
Module type (FUNCTION)
Module Name CO_RU_DI_AFRU_INSERT
It would be easier to confirm if we had access to your code.
However, the export parameters for the user exit are CAUVD_TAB (table of orders) and AFRUD_TAB (table of confirmations). I think that when you are showing your error message, you are not exiting the function properly and are still appending either or both of these tables. This means that when the database tries to update, it ends up with a duplicate key which results in the runtime error.

Resources