Closed Bug 466087 Opened 16 years ago Closed 16 years ago

Weave server does not store newly generated RSA keys

Categories

(Cloud Services :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: anant, Assigned: telliott)

Details

Attachments

(1 file)

PUT requests to http://server/weave/0.3/user/keys/pubkey and http://server/weave/0.3/user/keys/privkey does not result in the storage of the keys in the DB (I'm using the SQLite backend).

The PUT request contains a payload that is an array as described in the API. However, store_object() in weave_storage.inc assumes that the payload is either an object or a string and the following warning is generated:

[Fri Nov 21 03:17:40 2008] [error] [client ::1] PHP Notice:  Array to string conversion in /Users/anant/Code/weave/server/server/weave_storage.inc on line 437

A subsequent check on the store database reveals that the pubkey and privkey payloads are incorrectly stored as 'Array'. The fix attached adds a case where the payload is an Array and stores its JSON equivalent in the DB.
Odd. I would have expected that to decode to an object.

Consolidated it down to

if (is_object($payload) || is_array($payload))
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Umm, I don't that would really work because the statement inside the if is:

json_encode($payload())

"$payload()" doesn't make sense if $payload is an Array :)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
it doesn't make sense if $payload is an object, either :)

It's a typo and I've pulled it. Should just be json_encode($payload)
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
Component: Weave → General
Product: Mozilla Labs → Weave
Target Milestone: -- → ---
QA Contact: weave → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: