Commit b7deaa08 authored by eroman@chromium.org's avatar eroman@chromium.org

[webcrypto] exportKey() now returns dictionary when format='jwk' (CL 1 of 2).

Previously it would return an array buffer of the JSON.

This corresponds with the recent spec update:
https://dvcs.w3.org/hg/webcrypto-api/rev/f61017a76a5d

BUG=373917, 245025
R=rsleevi@chromium.org

Review URL: https://codereview.chromium.org/334333004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277884 0039d316-1c4b-4281-b951-d872f2087c98
parent 426ccf89
......@@ -457,7 +457,24 @@ void DoImportKey(scoped_ptr<ImportKeyState> passed_state) {
}
void DoExportKeyReply(scoped_ptr<ExportKeyState> state) {
#ifndef WEBCRYPTO_RESULT_ACCEPTS_JSON
// TODO(eroman): Remove idfef once blink rolls.
CompleteWithBufferOrError(state->status, state->buffer, &state->result);
#else
if (state->format != blink::WebCryptoKeyFormatJwk) {
CompleteWithBufferOrError(state->status, state->buffer, &state->result);
return;
}
if (state->status.IsError()) {
CompleteWithError(state->status, &state->result);
} else {
state->result.completeWithJson(
reinterpret_cast<const char*>(
webcrypto::Uint8VectorStart(&state->buffer)),
state->buffer.size());
}
#endif
}
void DoExportKey(scoped_ptr<ExportKeyState> passed_state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment