Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Update webcrypto-local
Browse files Browse the repository at this point in the history
  • Loading branch information
microshine committed Feb 28, 2019
1 parent 8fd176f commit 74dbe1a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store

/build
.vscode
out
node_modules
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"dependencies": {
"@babel/polyfill": "^7.2.5",
"@webcrypto-local/server": "^1.0.5",
"@webcrypto-local/server": "^1.0.7",
"asn1js": "^2.0.21",
"jose-jwe-jws": "github:microshine/js-jose",
"node-webcrypto-ossl": "^1.0.41",
Expand Down
17 changes: 17 additions & 0 deletions src/main/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,26 @@ LoggingSwitch(!!configure.logging);

export function load(options: wsServer.IServerOptions) {
setEngine("node-webcrypto-ossl", (global as any).crypto);
fillPvPKCS11(options);
server = new wsServer.LocalServer(options);
}

function fillPvPKCS11(options: wsServer.IServerOptions) {
let libPath = "";
switch (os.platform()) {
case "win32":
libPath = path.join(__dirname, "..", "..", "..", "pvpkcs11.dll");
break;
case "darwin":
libPath = path.join(__dirname, "..", "libpvpkcs11.dylib");
break;
}
const libs = options.config.pvpkcs11 = options.config.pvpkcs11 || [];
if (libPath) {
libs.push(libPath);
}
}

function createFirefoxProviders() {
const providers: IConfigureProvider[] = [];
// Get User's Firefox profile
Expand Down
3 changes: 0 additions & 3 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ async function InitService() {
})
.on("notify", (p: any) => {
const { width, height } = screen.getPrimaryDisplay().workAreaSize;

switch (p.type) {
case "2key": {
p.accept = false;
Expand All @@ -273,7 +272,6 @@ async function InitService() {
height: 300,
x: width - 400,
y: height - 300,
// alwaysOnTop: true,
resizable: false,
minimizable: false,
autoHideMenuBar: true,
Expand Down Expand Up @@ -542,7 +540,6 @@ interface Identity {
*/
function PrepareIdentity(identity: wsServer.RemoteIdentity) {
const userAgent = identity.userAgent!;
/** @type {Identity} */
const res: Identity = {} as any;
if (/edge\/([\d\.]+)/i.exec(userAgent)) {
res.browser = "edge";
Expand Down

0 comments on commit 74dbe1a

Please sign in to comment.