Skip to content

Commit 5a6a935

Browse files
committed
Add license header. Minor cleanups.
1 parent 40c5e0e commit 5a6a935

File tree

11 files changed

+164
-8
lines changed

11 files changed

+164
-8
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,22 @@ PASS evp encryptDecryptPipes
4141
PASS hmac hmac
4242
PASS hmac hmacStream
4343
PASS hmac hmacPipe
44+
PASS rsa keyToDer
45+
PASS rsa keyToPublicDer
46+
PASS rsa privateKeyDecode
47+
PASS rsa publicKeyDecode
48+
PASS rsa encryptDecrypt
49+
PASS rsa signVerify
4450
PASS sha sha
4551
PASS sha sha224
4652
PASS sha sha256
4753
PASS sha sha384
4854
PASS sha sha512
4955
PASS sha sha512_224
5056
PASS sha sha512_256
57+
PASS ecc makeKey
58+
PASS ecc sharedSecret32
59+
PASS ecc sharedSecret64
60+
PASS ecc signVerify
61+
PASS ecc importExport
5162
```

WolfSSLEVP.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
/* WolfSSLEVP.js
2+
*
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSL.
6+
*
7+
* wolfSSL is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSL is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
21+
122
"use strict";
223
var __extends = (this && this.__extends) || (function () {
324
var extendStatics = function (d, b) {

WolfSSLEVP.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
/* WolfSSLEVP.ts
2+
*
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSL.
6+
*
7+
* wolfSSL is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSL is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
21+
122
const wolfcrypt = require( './build/Release/wolfcrypt' );
223
const stream = require( 'stream' );
324

WolfSSLHmac.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
/* WolfSSLHmac.js
2+
*
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSL.
6+
*
7+
* wolfSSL is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSL is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
121
"use strict";
222
var __extends = (this && this.__extends) || (function () {
323
var extendStatics = function (d, b) {

WolfSSLHmac.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
/* WolfSSLHmac.ts
2+
*
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSL.
6+
*
7+
* wolfSSL is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSL is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
121
const wolfcrypt = require( './build/Release/wolfcrypt' );
222
const stream = require( 'stream' );
323

addon/wolfcrypt/ecc.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ Napi::Number bind_wc_ecc_sign_hash(const Napi::CallbackInfo& info)
167167
unsigned int out_len = info[3].As<Napi::Number>().Int32Value();
168168
ecc_key* ecc = (ecc_key*)( info[4].As<Napi::Uint8Array>().Data() );
169169

170-
wc_InitRng( &rng );
171-
172-
ret = wc_ecc_sign_hash( in, in_len, out, &out_len, &rng, ecc );
170+
ret = wc_InitRng( &rng );
171+
if (ret == 0)
172+
{
173+
ret = wc_ecc_sign_hash( in, in_len, out, &out_len, &rng, ecc );
174+
}
173175

174176
if ( ret < 0 )
175177
{
@@ -191,7 +193,6 @@ Napi::Number bind_wc_ecc_verify_hash(const Napi::CallbackInfo& info)
191193
int res;
192194

193195
ret = wc_ecc_verify_hash( sig, sig_len, hash, hash_len, &res, ecc );
194-
195196
if ( ret < 0 )
196197
{
197198
res = ret;

crypto_template.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
/* crypto_template.ts
2+
*
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSL.
6+
*
7+
* wolfSSL is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSL is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
21+
122
import wolfssl from '@src/addon/wolfssl';
223

324
import Events from 'events';

main.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
/* main.js
2+
*
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSL.
6+
*
7+
* wolfSSL is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSL is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
21+
122
"use strict";
223
exports.__esModule = true;
324
var WolfSSLEVP_1 = require("./WolfSSLEVP");

main.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
/* main.ts
2+
*
3+
* Copyright (C) 2006-2022 wolfSSL Inc.
4+
*
5+
* This file is part of wolfSSL.
6+
*
7+
* wolfSSL is free software; you can redistribute it and/or modify
8+
* it under the terms of the GNU General Public License as published by
9+
* the Free Software Foundation; either version 2 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* wolfSSL is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* along with this program; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20+
*/
21+
122
import { WolfSSLEncryptor, WolfSSLDecryptor, WolfSSLEncryptionStream, WolfSSLDecryptionStream } from './WolfSSLEVP'
223
import { WolfSSLHmac, WolfSSLHmacStream } from './WolfSSLHmac'
324

tests/ecc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const ecc_tests =
104104
ecc0.free()
105105
},
106106

107-
// Vandaly Industries
107+
// Validate Industries
108108
importExport: function()
109109
{
110110
let ecc0 = new WolfSSLEcc()

0 commit comments

Comments
 (0)