Skip to content

Commit

Permalink
Redesigned the framework to make it less vulnerable to native excepti…
Browse files Browse the repository at this point in the history
…ons. (#955)

* redesigned the framework to make it less vulnerable to native exceptions. Second try.

* restore previous format

* no more short names
  • Loading branch information
radetsky committed Nov 1, 2022
1 parent 5d4a0b7 commit 6bad342
Show file tree
Hide file tree
Showing 8 changed files with 664 additions and 882 deletions.

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/wrappers/themis/react-native-themis/android/src/main/main.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
18 changes: 11 additions & 7 deletions src/wrappers/themis/react-native-themis/ios/RCTThemis.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@

#import <React/RCTBridgeModule.h>

#define BYTEOVERFLOW 255
#define CONTEXTREQUIRED 254
#define PUBLICKEYREQUIRED 253
#define PRIVATEKEYREQUIRED 252

#define BYTEOVERFLOW 255
#define CONTEXTREQUIRED 254
#define PUBLICKEYREQUIRED 253
#define PRIVATEKEYREQUIRED 252
#define DESERIALIZE_ERROR 251
#define DESERIALIZE_MEMORY 250

#define BYTEOVERFLOWREASON "Byte overflow: value is out of range"
#define CONTEXTREQUIREDREASON "Context required"
#define PUBLICKEYREQUIREDREASON "Public key can not be null or blank"
#define PRIVATEKEYREQUIREDREASON "Private key can not be null or blank"
#define DESERIALIZE_ERRORREASON "Deserialize error: empty input data"
#define DESERIALIZE_MEMORYREASON "Deserialize error: can not allocate memory"

#define KEYTYPE_EC 0
#define KEYTYPE_EC 0
#define KEYTYPE_RSA 1


@interface RCTThemis : NSObject <RCTBridgeModule>
@end

Expand Down
Loading

0 comments on commit 6bad342

Please sign in to comment.