speke-reference-server icon indicating copy to clipboard operation
speke-reference-server copied to clipboard

Failing tests due to missing setup

Open purplepangolin opened this issue 5 years ago • 0 comments

Hello,

I have followed the steps in the installation guide to create an instance of the SPEKE Reference Server using the hosted template and pre-built binaries.

When I run the manual test for the lambda Server, I get a successful response, but the encoded value in the <pskc:PlainValue element does not match that given in the Readme:

<pskc:PlainValue>IakD9BOe/LWABBMy43GXZw==</pskc:PlainValue>

rather than:

<pskc:PlainValue>ALzP1aOTJvzfqg9I12k2Vw==</pskc:PlainValue>

Similarly, if I run the automated tests, the assertions for the server tests fail:

======================================================================
FAIL: test_server (__main__.TestSPEKELambdas)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lambda_tests.py", line 107, in test_server
    self.assertEqual(EXPECTED_SERVER_KEY, base64.b64decode(key.text))
AssertionError: b'\x00\xbc\xcf\xd5\xa3\x93&\xfc\xdf\xaa\x0fH\xd7i6W' != b'!\xa9\x03\xf4\x13\x9e\xfc\xb5\x80\x04\x132\xe3q\x97g'

Looking at the code in key_generator.py, it seems that the keys are generated as a function of a secret per contentId and the keyId itself. The secret values are randomly generated rather than set to a known value by the test setup which I think accounts for the different results. I presume that these tests must have either been added/amended after the secrets had been generated in the original environment so will work fine there, but not in a new environment with different generated secrets.

purplepangolin avatar Feb 24 '20 13:02 purplepangolin