mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
crypto: Implement encrypt/decrypt for AES-CBC + JWK support (#33795)
* Add support for raw importKey with AES-CBC Signed-off-by: Daniel Adams <msub2official@gmail.com> * Support JWK import/export, importKey for AES-CBC Signed-off-by: Daniel Adams <msub2official@gmail.com> * Implement encrypt/decrypt for AES-CBC Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update Cargo.lock Signed-off-by: Daniel Adams <msub2official@gmail.com> * Pass MutableHandleObject as arg instead of returning raw pointer Signed-off-by: Daniel Adams <msub2official@gmail.com> * Swap order of checks in generate_key_aes_cbc - Fixes WPT tests that expect to error on algorithm first before usages Signed-off-by: Daniel Adams <msub2official@gmail.com> * Avoid potential GC hazard with array_buffer_ptr Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations for discards context Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
This commit is contained in:
parent
397c5adf79
commit
45267c9f28
55 changed files with 163938 additions and 2799 deletions
|
@ -281,6 +281,10 @@ DOMInterfaces = {
|
|||
'weakReferenceable': True,
|
||||
},
|
||||
|
||||
'SubtleCrypto': {
|
||||
'inRealms': ['Encrypt', 'Decrypt', 'GenerateKey', 'ImportKey', 'ExportKey']
|
||||
},
|
||||
|
||||
#FIXME(jdm): This should be 'register': False, but then we don't generate enum types
|
||||
'TestBinding': {
|
||||
'inRealms': ['PromiseAttribute', 'PromiseNativeHandler'],
|
||||
|
@ -323,31 +327,10 @@ DOMInterfaces = {
|
|||
'canGc': ['Abort', 'GetResponseXML', 'Response'],
|
||||
},
|
||||
|
||||
'XRSession': {
|
||||
'inRealms': ['RequestReferenceSpace', 'UpdateRenderState', 'UpdateTargetFrameRate'],
|
||||
'canGc': ['End', 'RequestReferenceSpace'],
|
||||
},
|
||||
|
||||
'XRSystem': {
|
||||
'inRealms': ['RequestSession', 'SupportsSessionMode'],
|
||||
},
|
||||
|
||||
'XRBoundedReferenceSpace': {
|
||||
'canGc': ['BoundsGeometry'],
|
||||
},
|
||||
|
||||
'XRRay': {
|
||||
'canGc': ['Origin', 'Direction'],
|
||||
},
|
||||
|
||||
'XRRigidTransform': {
|
||||
'canGc': ['Position', 'Orientation', 'Inverse'],
|
||||
},
|
||||
|
||||
'XRReferenceSpace': {
|
||||
'canGc': ['GetOffsetReferenceSpace'],
|
||||
},
|
||||
|
||||
'XRFrame': {
|
||||
'canGc': ['GetViewerPose', 'GetPose', 'GetJointPose'],
|
||||
},
|
||||
|
@ -356,8 +339,25 @@ DOMInterfaces = {
|
|||
'canGc': ['GetPose'],
|
||||
},
|
||||
|
||||
'SubtleCrypto': {
|
||||
'inRealms': ['GenerateKey', 'ExportKey']
|
||||
}
|
||||
'XRRay': {
|
||||
'canGc': ['Origin', 'Direction'],
|
||||
},
|
||||
|
||||
'XRReferenceSpace': {
|
||||
'canGc': ['GetOffsetReferenceSpace'],
|
||||
},
|
||||
|
||||
'XRRigidTransform': {
|
||||
'canGc': ['Position', 'Orientation', 'Inverse'],
|
||||
},
|
||||
|
||||
'XRSession': {
|
||||
'inRealms': ['RequestReferenceSpace', 'UpdateRenderState', 'UpdateTargetFrameRate'],
|
||||
'canGc': ['End', 'RequestReferenceSpace'],
|
||||
},
|
||||
|
||||
'XRSystem': {
|
||||
'inRealms': ['RequestSession', 'SupportsSessionMode'],
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
@ -85,6 +85,8 @@ pub enum Error {
|
|||
InvalidModification,
|
||||
/// NotReadableError DOMException
|
||||
NotReadable,
|
||||
/// DataError DOMException
|
||||
Data,
|
||||
/// OperationError DOMException
|
||||
Operation,
|
||||
|
||||
|
@ -139,6 +141,7 @@ pub fn throw_dom_exception(cx: SafeJSContext, global: &GlobalScope, result: Erro
|
|||
Error::TypeMismatch => DOMErrorName::TypeMismatchError,
|
||||
Error::InvalidModification => DOMErrorName::InvalidModificationError,
|
||||
Error::NotReadable => DOMErrorName::NotReadableError,
|
||||
Error::Data => DOMErrorName::DataError,
|
||||
Error::Operation => DOMErrorName::OperationError,
|
||||
Error::Type(message) => unsafe {
|
||||
assert!(!JS_IsExceptionPending(*cx));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue