NativeScript / NativeScript/NativeScript

crypto broken?

Đang mở
#8,806 22 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
TypeScript
Star
25.7k
Fork
1.7k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
35

Mô tả

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.8.0
  • Cross-platform modules: 6.5.15
  • Android Runtime: 6.5.3
  • iOS Runtime: 6.5.2
  • Plugin(s):

Describe the bug
Trying to use the http-client-auth module for digest authentication brought me an error for missing function crypto.getHash.
Adding a require for crypto or crypto-browserify to my code results in a long exception stacktrace at the require point:

System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
System.err: TypeError: Cannot read property 'split' of undefined
System.err: File: (file: node_modules\pbkdf2\lib\default-encoding.js:6:47)
System.err:
System.err: StackTrace:
System.err: ../node_modules/pbkdf2/lib/default-encoding.js(file: node_modules\pbkdf2\lib\default-encoding.js:6:47)
System.err:     at __webpack_require__(file: app\webpack\bootstrap:750:0)
System.err:     at fn(file: app\webpack\bootstrap:120:0)
System.err:     at ../node_modules/pbkdf2/lib/sync.js(file: node_modules\pbkdf2\lib\sync.js:14:22)
System.err:     at __webpack_require__(file: app\webpack\bootstrap:750:0)
System.err:     at fn(file: app\webpack\bootstrap:120:0)
System.err:     at ../node_modules/pbkdf2/index.js(file: node_modules\pbkdf2\index.js:24:23)
System.err:     at __webpack_require__(file: app\webpack\bootstrap:750:0)
System.err:     at fn(file: app\webpack\bootstrap:120:0)
System.err:     at ../node_modules/crypto-browserify/index.js(file: node_modules\crypto-browserify\index.js:14:8)
System.err:     at __webpack_require__(file: app\webpack\bootstrap:750:0)
System.err:     at fn(file: app\webpack\bootstrap:120:0)
System.err:     at ./lib/tnsSrvConn.js(file: app\lib\tnsSrvConn.js:4:15)
System.err:     at __webpack_require__(file: app\webpack\bootstrap:750:0)
System.err:     at fn(file: app\webpack\bootstrap:120:0)
System.err:     at ../node_modules/babel-loader/lib/index.js!../node_modules/vue-loader/lib/index.js?!./components/MyComponent.vue?vue&type=script&lang=js&(file:///data/data/com.loytec.lweb804/files/app/bundle.js:1352:73)
...

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện lỗi với các phiên bản NativeScript được báo cáo và kiểm tra app/lib/tnsSrvConn.js cùng với node_modules/pbkdf2/lib/default-encoding.js và node_modules/crypto-browserify/index.js. Xác nhận cách crypto.getHash bị thiếu và ngoại lệ split-of-undefined phát sinh; hoàn tất khi xác thực digest có thể được tải mà không xảy ra crash khi require.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, javascript
Lĩnh vực
authentication, mobile, security
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.