Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Side by Side Diff: media/cdm/aes_decryptor_unittest.cc

Issue 934423002: Encode JSON key IDs and keys as base64url (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/cdm/json_web_key.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 " {" 740 " {"
741 " \"kty\": \"oct\"," 741 " \"kty\": \"oct\","
742 " \"alg\": \"A128KW\"," 742 " \"alg\": \"A128KW\","
743 " \"kid\": \"AAECAwQFBgcICQoLDA0ODxAREhM\"," 743 " \"kid\": \"AAECAwQFBgcICQoLDA0ODxAREhM\","
744 " \"k\": \"FBUWFxgZGhscHR4fICEiIw\"" 744 " \"k\": \"FBUWFxgZGhscHR4fICEiIw\""
745 " }," 745 " },"
746 " {" 746 " {"
747 " \"kty\": \"oct\"," 747 " \"kty\": \"oct\","
748 " \"alg\": \"A128KW\"," 748 " \"alg\": \"A128KW\","
749 " \"kid\": \"JCUmJygpKissLS4vMA\"," 749 " \"kid\": \"JCUmJygpKissLS4vMA\","
750 " \"k\":\"MTIzNDU2Nzg5Ojs8PT4/QA\"" 750 " \"k\":\"MTIzNDU2Nzg5Ojs8PT4_QA\""
751 " }" 751 " }"
752 " ]" 752 " ]"
753 "}"; 753 "}";
754 UpdateSessionAndExpect(session_id, kJwksMultipleEntries, RESOLVED); 754 UpdateSessionAndExpect(session_id, kJwksMultipleEntries, RESOLVED);
755 755
756 // Try a key with no spaces and some \n plus additional fields. 756 // Try a key with no spaces and some \n plus additional fields.
757 const std::string kJwksNoSpaces = 757 const std::string kJwksNoSpaces =
758 "\n\n{\"something\":1,\"keys\":[{\n\n\"kty\":\"oct\",\"alg\":\"A128KW\"," 758 "\n\n{\"something\":1,\"keys\":[{\n\n\"kty\":\"oct\",\"alg\":\"A128KW\","
759 "\"kid\":\"AAECAwQFBgcICQoLDA0ODxAREhM\",\"k\":\"GawgguFyGrWKav7AX4VKUg" 759 "\"kid\":\"AAECAwQFBgcICQoLDA0ODxAREhM\",\"k\":\"GawgguFyGrWKav7AX4VKUg"
760 "\",\"foo\":\"bar\"}]}\n\n"; 760 "\",\"foo\":\"bar\"}]}\n\n";
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 EXPECT_TRUE(KeysInfoContains(key_id1)); 871 EXPECT_TRUE(KeysInfoContains(key_id1));
872 EXPECT_FALSE(KeysInfoContains(key_id2)); 872 EXPECT_FALSE(KeysInfoContains(key_id2));
873 873
874 // Add second key, verify both IDs returned. 874 // Add second key, verify both IDs returned.
875 UpdateSessionAndExpect(session_id, kKey2AsJWK, RESOLVED); 875 UpdateSessionAndExpect(session_id, kKey2AsJWK, RESOLVED);
876 EXPECT_TRUE(KeysInfoContains(key_id1)); 876 EXPECT_TRUE(KeysInfoContains(key_id1));
877 EXPECT_TRUE(KeysInfoContains(key_id2)); 877 EXPECT_TRUE(KeysInfoContains(key_id2));
878 } 878 }
879 879
880 } // namespace media 880 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/cdm/json_web_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698