0% found this document useful (0 votes)
419 views2,241 pages

Refman

Uploaded by

Benny Langston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
419 views2,241 pages

Refman

Uploaded by

Benny Langston
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2241

Developers Guide, API and Production Deployment

NetBurner 3.3.9

Wed Oct 26 2022


i

1 NetBurner 3.3.9 1

2 Command Line Tools 5


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Command Line Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Create a New Project From an Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3.1 Edit the makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3.2 Edit main.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Modifying System Files with Overload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4.1 Important Overload Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 GNU Debugger (GDB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5.1 Example GDB Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Device Discovery and Configuration 11


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.1 Device Discovery Methods: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.2 Device Configuration methods: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Configuration Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 The JSON Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3.1 Developer Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4 Configuration Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 Serial Port Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4 Migration Guides 23
4.1 Release 2.x to 3.x Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.1.1 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1.2 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1.3 RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1.4 TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1.5 Network Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1.6 SSL/TLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1.7 System Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1.8 NBEclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1.9 GCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2 Release 2.x to 3.x Porting Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.1 Device Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.2 Configuration Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.3 Recommended Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2.4 Configuration Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2.4.1 Cautions When Using the Jumper Recover Procedure on a Device . . . . . . . . . 28
4.2.5 Device Application Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.2.6 Eclipse and Development Tools Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.2.7 SSL/TLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

NetBurner, Inc.
ii

4.2.8 Notes on Porting From Previous Revisions . . . . . . . . . . . . . . . . . . . . . . . . . . . 29


4.2.9 Porting I2C From MCF52xx Based Products to MODM7AE70 . . . . . . . . . . . . . . . . . 30
4.3 Upgrade 5441x Platforms to 3.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3.2 5441x Product Models Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3.3 3.x Update Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3.3.1 3.x Update Using Alternate Monitor . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.3.4 Procedure to Revert Back to 2.x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5 NBEclipse 33
5.1 Getting Started Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.1.1.1 How to Use This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.1.1.2 Source Code for Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1.1.3 Hardware Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1.1.4 Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1.1.5 Upgrading From a Previous Installation . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1.1.6 Java Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.1.1.7 Debug Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.1.2 Platform Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.1.2.1 NetBurner Development Platform Choices . . . . . . . . . . . . . . . . . . . . . . 35
5.1.3 Project Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.1.3.1 NBEclipse Key Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.1.4 Creating Projects and Importing Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.1.4.1 Create a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.1.4.2 Select the NetBurner Project Type . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.1.4.3 Specify Project Name and Executable Option . . . . . . . . . . . . . . . . . . . . 38
5.1.4.4 Project Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.1.4.5 Select Your NetBurner Target Device . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.1.4.6 Application Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.1.4.7 New Project Created . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1.4.8 Import Example Source Files to the Project SRC Folder . . . . . . . . . . . . . . . 44
5.1.4.9 Open your main.cpp source file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.1.4.10 Project Import Complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.1.4.11 Download the Application to Your Device . . . . . . . . . . . . . . . . . . . . . . 51
5.1.4.12 View the Device Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.1.4.13 View Serial Port Status Messages with MTTTY . . . . . . . . . . . . . . . . . . . 54
5.1.5 Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.1.5.1 Starting a Debug Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.1.6 Rebuilding Projects & Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.1.6.1 Rebuild Project Source Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.1.6.2 Rebuild Library Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

NetBurner, Inc.
iii

5.2 Add a Library to a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60


5.3 Change The IP Targeted By A Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.4 Change CompCode Settings for EFFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

6 PC Tools and Utilities 65


6.1 Multi-threaded TTY Serial Terminal (MTTTY) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
6.1.1 MTTTY FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.2 Wget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.3 NBUpdate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.4 Smart Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
6.4.1 Trap Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
6.4.2 Register Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.4.3 RTOS Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.4.4 Task Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.5 Task Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
6.5.1 TaskScan FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.6 WinAddr2Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6.6.1 Using WinAddr2Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.7 IPSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.8 AutoUpdate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
6.9 Virtual Comm Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.10 CompHtml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.11 CompCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
6.12 flashpack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

7 Platform References 75
7.1 MODM7AE70 Platform Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.1.2 MODM7AE70 Processor Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.1.3 Datasheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.1.4 Development Board Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.1.5 Memory Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
7.1.6 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
7.1.7 External Bus Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
7.2 MOD54415, MOD54417 Platform Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
7.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
7.2.2 MCF5441x Processor Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.2.3 Datasheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.2.4 Development Board Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.2.5 Memory Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
7.2.6 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.3 NANO54415 Platform Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

NetBurner, Inc.
iv

7.3.2 MCF54415 Processor Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78


7.3.3 Datasheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
7.3.4 Development Board Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.3.5 Memory Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.3.6 Processor Runtime Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
7.3.7 Application SPI Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4 SB800EX Platform Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4.2 MCF54415 Processor Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4.3 Datasheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4.4 Memory Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
7.4.5 Processor Runtime Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.4.6 Application SPI Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
7.5 SBE70LC Platform Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5.2 SBE70LC Processor Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5.3 Datasheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5.4 Development Board Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5.5 Memory Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.5.6 Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
7.6 Recovery: MODM7AE70, SBE70LC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.6.2 Repeating Traps or Resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.6.2.1 Step 1: Abort to the Configuration Server . . . . . . . . . . . . . . . . . . . . . . 83
7.6.2.2 Step 2: Download a New Application . . . . . . . . . . . . . . . . . . . . . . . . . 83
7.6.3 Unresponsive Device or No Serial Port Access . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.7 Recovery: MOD5441x, NANO54415, SB800EX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.7.1 Step 1: Abort to the Alternate Boot Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7.7.2 Recovery Jumper Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.7.2.1 NANO54415 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.7.2.2 MOD5441x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
7.7.2.3 SB800EX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
7.7.3 Step 2: Download a New Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.7.3.1 Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
7.7.3.2 Serial Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

8 Production & Deployment 89


8.1 Production Releases and Customer Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8.2 Finding a Device on a Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8.3 Application Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
8.3.1 Configuration Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
8.3.2 nbupdate Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

NetBurner, Inc.
v

8.3.3 wget Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90


8.3.3.1 Program an Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
8.3.3.2 Read The Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.3.3.3 Program New Configuration Settings . . . . . . . . . . . . . . . . . . . . . . . . . 91
8.4 Customer Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

9 Programmers Guide 93
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
9.1.1 Source Code for Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
9.1.2 Tools and Library Version Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
9.1.3 Application Wizard Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
9.2 Config Server Programming Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.2.2 Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.2.2.1 Config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9.2.2.2 Config.AppData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.2.2.3 Config.Sys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.2.3 The Configuration Web Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
9.2.4 Serial Configuration Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
9.2.5 Creating a Custom Web Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
9.2.6 Configuration API Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
9.3 EFFS Programming Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
9.3.1 Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9.3.2 Reference Manuals for the EFFS API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9.3.3 Supported Hardware Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9.3.4 Debug Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9.3.5 Flash Card Hardware Interface Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
9.3.5.1 Flash Card Hardware Interface Design . . . . . . . . . . . . . . . . . . . . . . . . 101
9.3.6 EFFS-FAT File System Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
9.3.6.1 EFFS-FAT File System Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 103
9.3.7 EFFS-STD File System with On-chip Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.3.7.1 Using the EFFS-STD File System with On-chip Flash . . . . . . . . . . . . . . . . 105
9.4 File Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
9.4.1 Creating Custom I/O Drivers Using File Descriptors . . . . . . . . . . . . . . . . . . . . . . 107
9.4.2 Using File Descriptors to Pend on Multiple Events . . . . . . . . . . . . . . . . . . . . . . . 108
9.5 HTML Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
9.5.2 Dynamic Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
9.5.3 HTML Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
9.5.3.1 Configuration System Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
9.5.3.2 The CPPCALL Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
9.5.3.3 The VARIABLE Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

NetBurner, Inc.
vi

9.5.3.4 The INCLUDE Tag and htmlvar.h Header File . . . . . . . . . . . . . . . . . . . . 112


9.5.3.5 The VARIABLE() Tag With Parameters . . . . . . . . . . . . . . . . . . . . . . . . 112
9.5.3.6 Extending the VARIABLE Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.5.3.7 The CONFIGVALUE Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.5.4 HTTP GET Request Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
9.5.5 HTTP Form POST Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
9.6 IPv4/IPv6 Dual Stack Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
9.6.1 Obtaining IPv6 addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
9.6.1.1 Link-Local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
9.6.1.2 Router Auto-Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
9.6.1.3 DHCPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
9.6.1.4 Static IP Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
9.6.2 IPADDR Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
9.6.3 IPADDR Member Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
9.6.3.1 Setting IP Address Values with Member Functions . . . . . . . . . . . . . . . . . . 119
9.6.3.2 Member functions to set an IP address: . . . . . . . . . . . . . . . . . . . . . . . 119
9.6.3.3 Setting IP Address Values with Static Functions . . . . . . . . . . . . . . . . . . . 119
9.6.3.4 Reading and Checking IP Address Values . . . . . . . . . . . . . . . . . . . . . . 119
9.6.3.5 Output an IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
9.6.4 Domain Name Service (DNS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
9.6.5 Note for OSX Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
9.7 NetBurner RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
9.7.1 What is a Preemptive RTOS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
9.7.2 Preemptive Operation, Priorities and Blocking . . . . . . . . . . . . . . . . . . . . . . . . . 121
9.7.2.1 RTOS Blocking Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
9.7.2.2 I/O Functions That Can Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
9.7.2.3 Network Functions That Can Block . . . . . . . . . . . . . . . . . . . . . . . . . . 122
9.7.2.4 Functions That Can Enable a Task To Be "Ready To Run" . . . . . . . . . . . . . . 122
9.7.2.5 System Task Priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
9.7.3 Task Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
9.7.4 Protecting Shared Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
9.7.5 Semaphore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
9.7.6 Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
9.7.7 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
9.7.8 Critical Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
9.7.9 OS Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
9.8 Network Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
9.8.1 TCP vs UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
9.8.1.1 TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
9.8.2 TCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
9.8.2.1 NetBurner TCP Server Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
9.8.2.2 Simple TCP Server Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

NetBurner, Inc.
vii

9.8.2.3 Advanced TCP Server for Multiple Connections . . . . . . . . . . . . . . . . . . . 129


9.8.3 TCP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
9.8.3.1 Application Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
9.8.4 UDP Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
9.8.4.1 Receiving UDP Packets Using the UDP Class . . . . . . . . . . . . . . . . . . . . 136
9.8.4.2 Sending a UDP Packet Using the UDP Class . . . . . . . . . . . . . . . . . . . . 136
9.8.4.3 UDP Send/Receive Example with UDP Class . . . . . . . . . . . . . . . . . . . . 136
9.8.5 UDP Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
9.8.5.1 Receiving UDP Packets using UDP Sockets . . . . . . . . . . . . . . . . . . . . . 138
9.8.5.2 Sending UDP Packets using UDP Sockets . . . . . . . . . . . . . . . . . . . . . . 138
9.8.5.3 UDP Send/Receive Example Using Sockets . . . . . . . . . . . . . . . . . . . . . 138
9.9 SSL/TLS Programming Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
9.9.1 SSL/TLS Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
9.9.1.1 What do I need to do to make SSL/TLS work? . . . . . . . . . . . . . . . . . . . . 141
9.9.1.2 How do I find or create a certificate authority? . . . . . . . . . . . . . . . . . . . . 141
9.9.1.3 How do I know whom my browser trusts? . . . . . . . . . . . . . . . . . . . . . . 141
9.9.1.4 Recommended Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
9.9.2 Onboard Self Signed Certificate Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
9.9.3 Creating Self-Signed Certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
9.9.3.1 Creating a Certificate Authority (CA) Certificate and Key . . . . . . . . . . . . . . . 144
9.9.3.2 Creating a Server Certificate and Key for Your Device . . . . . . . . . . . . . . . . 144
9.9.3.3 Converting a Certificate and Key to Code with <tt>compfile</tt> . . . . . . . . . 144
9.9.3.4 Adding the Module to your Code Set . . . . . . . . . . . . . . . . . . . . . . . . . 145
9.9.3.5 Using a Recognized Certificate Authority . . . . . . . . . . . . . . . . . . . . . . . 145
9.9.3.6 Testing Your Certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
9.9.4 Creating Certificate Authority Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
9.9.4.1 Creating a CA List file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
9.10 SSH Programming Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
9.10.1 SSH Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
9.10.1.1 Supported Key Types, Sizes, and Formats . . . . . . . . . . . . . . . . . . . . . 146
9.10.1.2 Migrating from NNDK 3.3.5 and earlier to 3.3.6 or later . . . . . . . . . . . . . . . 146
9.10.1.3 Onboard Generated Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
9.10.1.4 Order of Key Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
9.10.1.5 User Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
9.11 Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
9.11.1 Basic Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
9.11.2 Dynamic Web Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
9.11.2.1 Dynamic Content Using the CPPCALL Tag . . . . . . . . . . . . . . . . . . . . . 150
9.11.2.2 Displaying Variables Using the VARIABLE Tag . . . . . . . . . . . . . . . . . . . 150
9.11.2.3 Linking to Variables Using the INCLUDE Tag and htmlvar.h Header File . . . . . . 151
9.11.2.4 Function Callbacks With Variables Using the VARIABLE Tag . . . . . . . . . . . . 151
9.11.2.5 Extending the VARIABLE tag for User Defined Types . . . . . . . . . . . . . . . . 151

NetBurner, Inc.
viii

9.12 JSON Lexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152


9.12.1 Using the JSON Lexer Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
9.12.2 Earthquake Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
9.12.2.1 Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
9.12.2.2 Earthquake Summary Serial Output . . . . . . . . . . . . . . . . . . . . . . . . 154
9.12.2.3 JSON Data Parsed From Web Site . . . . . . . . . . . . . . . . . . . . . . . . . 154
9.13 Custom Branding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

10 System Diagnostics 165


10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
10.2 Configuration Server Page with Diagnostics Enabled . . . . . . . . . . . . . . . . . . . . . . . . . 165
10.3 System Configuration Web Page Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
10.4 Adding Your Own Diagnostic Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

11 Example Applications 171


11.1 AES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
11.2 Board Lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
11.2.1 Key Blob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.2.2 Sign Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.2.3 Check Lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.3 Clear Configuration Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.4 Clear User Parameter Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.5 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.5.1 Application Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
11.5.2 Basic Config Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
11.5.3 Config Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
11.5.4 Nesting Config Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
11.5.5 Config and System Params . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
11.5.6 Modify Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
11.5.7 Modify Ethernet Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
11.5.8 Show Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
11.5.9 Config Web Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
11.5.10 Basic Web Config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
11.5.11 Basic Web Config with SSL/TLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
11.5.12 Config Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
11.5.13 Custom Web Config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
11.5.14 Custom Web System Config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
11.6 DNS Device Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
11.7 DHCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
11.7.1 DHCP Client - Change IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
11.7.2 DHCP Client - Test DHCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
11.7.2.1 Example of advanced DHCP functionality . . . . . . . . . . . . . . . . . . . . . . 180
11.7.3 DHCP Server (DHCPD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180

NetBurner, Inc.
ix

11.7.4 DHCP Client - Change IP Address Via Webpage . . . . . . . . . . . . . . . . . . . . . . . 181


11.8 DNS Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
11.9 Embedded Flash File System (EFFS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
11.9.1 FAT File System (EFFS-FAT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
11.9.2 Appplication Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
11.9.3 Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
11.9.4 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
11.9.5 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
11.9.6 HTML Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
11.9.7 Multiple Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
11.9.8 Performance Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
11.9.9 RAM Drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
11.9.10 Standard File System (EFFS-STD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
11.9.11 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
11.10 Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
11.10.1 Manual Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
11.11 Exception Try/Catch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
11.12 Extra FD Circular Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
11.13 fdprintf - printf to file descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
11.14 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
11.14.1 FTP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
11.14.2 FTP Server (FTPD) App Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
11.14.3 Display HTML Files (FTPD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
11.14.4 Simple FTP Server (FTPD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
11.15 GDB Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
11.16 General Purpose I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
11.16.1 GPIO Blink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
11.16.2 General Purpose I/O Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
11.17 IP Address Object (IPADDR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
11.18 IPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
11.18.1 DHCPv6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
11.19 JSON Lexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
11.19.1 JSON Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
11.19.2 JSON Array with Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
11.19.3 Parse Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
11.20 JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
11.20.1 NetBurner Demo Server for JSON Client Examples . . . . . . . . . . . . . . . . . . . . . 190
11.20.2 Get JSON Object From Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
11.20.3 Get Non-JSON Object From Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
11.20.4 Post JSON to Server and Display Result . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
11.20.5 Post JSON to Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
11.20.6 Get Application Image and Load it From a Web Server . . . . . . . . . . . . . . . . . . . 191

NetBurner, Inc.
x

11.20.7 Simple JSON HTML Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191


11.20.8 Simple JSON Post Receiver Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
11.21 malloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
11.22 Multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
11.23 Multihome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
11.24 NB Approve Shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
11.25 NBString Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
11.26 NetBios Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
11.27 Network Time Server (NTP) Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
11.28 NTP & Real-Time Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
11.29 Overload Directory & System Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
11.30 Platform Specific . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
11.30.1 MOD5441x, NANO54415, SB800EX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
11.30.2 1-Wire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
11.30.3 Analog to Digital . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
11.30.4 Simple ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
11.30.5 Periodic ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
11.30.6 CAN to Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
11.30.7 Digital to Analog (DAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
11.30.8 DSPI to Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
11.30.9 Load Application From Flash Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
11.30.10 SDHC Flash Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
11.30.11 External IRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
11.30.12 External NMI IRQ 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
11.30.13 RTC - External . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
11.30.14 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
11.30.15 I2C Address Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
11.30.16 I2C PicKit Demo Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
11.30.17 RTC - On Chip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
11.30.18 Periodic Interrupt Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
11.30.19 Pulse Generator and Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
11.30.20 PWM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
11.30.21 Core Watchdog Timer (CWT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
11.30.22 WAV File Audio Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
11.30.23 MOD5441x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
11.30.24 Multiple EFFS Flash Card Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
11.30.25 Factory application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
11.30.26 Rapid GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
11.30.27 USB Mass Storage Device Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
11.30.28 MODM7AE70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
11.30.29 Analog to Digital (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
11.30.30 CAN Send and Receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

NetBurner, Inc.
xi

11.30.31 EBI Page Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204


11.30.32 EBI Page Control - Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
11.30.33 GPIO - Simple . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
11.30.34 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
11.30.35 I2C Address Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.30.36 I2C PicKit Demo Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.30.37 Factory Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.30.38 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.30.39 External Pin IRQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.30.40 Pin Interrupt Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
11.30.41 PWM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
11.30.42 NTP & Real-Time Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
11.30.43 Serial Callback Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11.30.44 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11.30.45 Serial-to-SPI QuadSPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11.30.46 Serial-to-SPI USART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11.30.47 SSC I2S Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11.30.48 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11.30.49 Timer Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
11.30.50 Timer Waveform Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
11.30.51 Chaining SAME70 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
11.30.52 DACC Tone Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
11.30.53 Watchdog Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
11.30.54 NANO54415 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.55 NANO54415 Factory App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.56 MODM7AE70, SBE70LC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.57 GPIO Command Server (SAME70) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.58 SB800EX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.59 Serial Transceiver Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.60 Diagnostic Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.61 SOMRT1061 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
11.30.62 Analog to Digital (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
11.31 PPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
11.32 Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
11.33 RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
11.33.1 OSCrit - Critical Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
11.33.2 OSFifo - FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
11.33.3 OSFlags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
11.33.4 OSMailbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
11.33.5 Multiple Task User Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
11.33.6 OSQueue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
11.33.7 OSSemaphore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212

NetBurner, Inc.
xii

11.33.8 OSTaskCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212


11.34 Save to User Parameter Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
11.35 Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
11.35.1 Dual TCP To Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
11.35.2 Serial To Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
11.35.3 Serial HTTP Get Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
11.35.4 Serial Receive Callback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
11.35.5 Serial to Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
11.35.6 TCP to Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
11.36 Serial Webserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
11.37 SHA1 Digest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
11.38 Show Network Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
11.39 SOCKS5 Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
11.40 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
11.40.1 DSPI Multiplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
11.40.2 Serial to SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
11.41 SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
11.41.1 SSH Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
11.41.2 SSH Server with User Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
11.41.3 SSH Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
11.41.4 SSH Server with User Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
11.41.5 SecureSerToEthFactoryApp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
11.42 SSL/TLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
11.42.1 FTPS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
11.42.2 HTML File Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
11.42.3 HTML Form Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
11.42.4 HTTPS Dual Cert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
11.42.5 HTTPS Upload Cert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
11.42.6 HTTPS Web Server Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
11.42.7 HTTPS GET Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
11.42.8 SSL/TLS Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
11.42.9 SSL/TLS Client Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
11.42.10 SSL/TLS Client Verify Peer - Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11.42.11 SSL/TLS Client Verify Peer - EFFS-STD . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11.42.12 SSL/TLS Onboard Self-signed Certificate Generation . . . . . . . . . . . . . . . . . . . 221
11.42.12.1 On-board Cert Generation - Simple . . . . . . . . . . . . . . . . . . . . . . . 221
11.42.12.2 On-board Cert Generation - Advanced . . . . . . . . . . . . . . . . . . . . . . 222
11.42.12.3 On-board Cert Generation - Compiled Certificate Authority . . . . . . . . . . . 222
11.42.13 SSL/TLS Receive Mail (POP3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
11.42.14 SSL/TLS Send Mail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
11.42.15 SSL/TLS Send Mail w/ Attachment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
11.42.16 SSL/TLS Send Mail w/ EFFS Attchment . . . . . . . . . . . . . . . . . . . . . . . . . . 223

NetBurner, Inc.
xiii

11.42.17 SSL/TLS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224


11.42.18 HTTPS Configuration Mirror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
11.43 Stack Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
11.44 Syslog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
11.45 System Diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
11.46 TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
11.46.1 TCP No Block Connect Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
11.46.2 TCP Keepalive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
11.46.3 TCP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.46.4 Multiple TCP Interface Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.46.5 TCP Multi-Socket Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.46.6 TCP Resource Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.46.7 TCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.46.8 TCP Server Using Via . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.46.9 TCP Speed Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
11.46.10 TCP Stress Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.47 Telnet Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.48 TFTP - Trivial File Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.49 Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.50 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.50.1 Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.50.2 Interval Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.50.3 Stopwatch Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.51 UDP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.51.1 UDP to Serial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.51.2 UDP Notify Callback Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.51.3 UDP C++ Packet Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.51.4 UDP Echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.51.5 UDP Send/Receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.51.6 UDP Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.51.7 UDP Sockets Via . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
11.52 VLAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.53 Web Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.53.1 Ajax Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
11.53.2 Bootstrap Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
11.53.3 HTML File Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
11.53.4 Flash Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
11.53.5 GIF Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
11.53.6 HTML Application File Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
11.53.7 HTML Cookie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
11.53.8 HTML Form Post . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.53.9 HTML Form Post 2.X Compatible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

NetBurner, Inc.
xiv

11.53.10 HTML Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232


11.53.11 HTML Server GET Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.53.12 HTMLVariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.53.13 Serial Webserver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
11.53.14 Signed Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
11.53.15 Simple HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.53.16 TicTacToe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.54 Web Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.54.1 Earthquake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.54.2 Find My IP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.54.3 Find My IP Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.54.4 Message Passer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.54.5 MessagePasserTask JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.55 Web Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.55.1 Web Socket Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.55.2 Web Socket Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.55.3 Web Socket DIP Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.55.4 Web Socket Echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.56 Wifi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.56.1 Wifi Config AP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
11.56.2 Configure AP with JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
11.56.3 Wifi Firmware Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
11.56.4 Wifi Access Point . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
11.56.5 Wifi Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
11.56.6 Wifi Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

12 License 237

13 Deprecated List 239

14 Module Index 241


14.1 NetBurner API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

15 Namespace Index 245


15.1 Namespace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245

16 Hierarchical Index 247


16.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

17 Class Index 249


17.1 Class List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

18 File Index 253


18.1 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

NetBurner, Inc.
xv

19 Module Documentation 265


19.1 ARP - Address Resolution Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
19.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
19.1.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
19.1.2.1 fShowArp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
19.1.2.2 GetArpMacFromIp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
19.1.2.3 sendGratuitousArp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
19.1.2.4 ShowArp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
19.2 Authorization Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
19.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
19.2.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
19.2.2.1 AuthResponse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
19.3 Authorization Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
19.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
19.3.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
19.3.2.1 AuthType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
19.4 BSS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
19.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
19.5 Buffers - System Buffer Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
19.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
19.5.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
19.5.2.1 FreeBufferList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
19.5.2.2 GetFreeCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
19.6 CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.7 Certificate Generation Alternate Name Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.7.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.7.2.1 AltNameType_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.8 Certificate Generation Key Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
19.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
19.8.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
19.8.2.1 SslKeyType_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
19.9 Cipher Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
19.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
19.10 ColdFire MCF5441x (DSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
19.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
19.10.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
19.10.2.1 csReturnType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
19.10.2.2 spiChipSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
19.10.2.3 spiChipSelectPolarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
19.10.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

NetBurner, Inc.
xvi

19.10.3.1 DSPIInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273


19.11 ColdFire MCF5441x Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
19.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
19.12 Command Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
19.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
19.12.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
19.12.2.1 CmdAddCommandFd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
19.12.2.2 CmdListenOnSshPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
19.12.2.3 CmdListenOnTcpPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
19.12.2.4 CmdListenQuietOnSshPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
19.12.2.5 CmdListenQuietOnTcpPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
19.12.2.6 CmdRemoveCommandFd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
19.12.2.7 CmdStartCommandProcessor() . . . . . . . . . . . . . . . . . . . . . . . . . . 278
19.12.2.8 CmdStopListeningOnSshPort() . . . . . . . . . . . . . . . . . . . . . . . . . . 278
19.12.2.9 CmdStopListeningOnTcpPort() . . . . . . . . . . . . . . . . . . . . . . . . . . 278
19.12.2.10 SendToAll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
19.12.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
19.12.3.1 CmdAuthenticateFunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
19.12.3.2 CmdAuthenticateSshFunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
19.12.3.3 CmdChar_func . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
19.12.3.4 CmdCmd_func . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
19.12.3.5 CmdConnect_func . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
19.12.3.6 CmdDisConnect_func . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
19.12.3.7 CmdIdleTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.12.3.8 CmdPrompt_func . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.13 Command Processor Disconnect Causes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.14 Command Processor Listen Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.14.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.14.2.1 ListenOn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
19.15 Command Processor Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
19.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
19.16 Configuration Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
19.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
19.17 Configuration Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
19.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
19.17.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
19.17.2.1 ConfigMaxSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
19.17.2.2 ConfigSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
19.17.2.3 EnableConfigMirror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
19.17.2.4 SaveConfigToStorage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

NetBurner, Inc.
xvii

19.18 Configuration Variable Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285


19.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
19.19 Configuration Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
19.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
19.20 Connect Request Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
19.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
19.21 DHCP - IPv4 DHCP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
19.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
19.21.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
19.21.2.1 GetIntefaceDHCPState() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
19.21.2.2 WaitForDHCPInterface() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
19.22 DHCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
19.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
19.22.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
19.22.2.1 AddStandardDHCPServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
19.23 DHCP State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
19.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
19.24 DNS - Domain Name System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
19.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
19.24.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
19.24.2.1 GetHostByName4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
19.24.2.2 GetHostByName6() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
19.25 DNS Record Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
19.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
19.26 DNS Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
19.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.27 DSPI state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.28 DspiModuleNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.28.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.29 DspiState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.29.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.30 EFFS - Embedded Flash File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
19.30.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
19.31 EFFS-STD Flash File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
19.31.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
19.31.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
19.31.2.1 fs_chdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
19.31.2.2 fs_close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
19.31.2.3 fs_delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
19.31.2.4 fs_eof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
19.31.2.5 fs_findfirst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

NetBurner, Inc.
xviii

19.31.2.6 fs_findnext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295


19.31.2.7 fs_getfreespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
19.31.2.8 fs_gettimedate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
19.31.2.9 fs_mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
19.31.2.10 fs_open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
19.31.2.11 fs_read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
19.31.2.12 fs_rewind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
19.31.2.13 fs_rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
19.31.2.14 fs_seek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
19.31.2.15 fs_settimedate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
19.31.2.16 fs_write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
19.32 Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
19.32.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
19.32.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
19.32.2.1 NO_AUTOMATIC_2ND_ETHERNET . . . . . . . . . . . . . . . . . . . . . . . 301
19.32.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
19.32.3.1 AddEthernetInterfaces() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
19.32.3.2 DisablePHY() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
19.32.3.3 EnablePHY() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
19.32.3.4 ManualEthernetConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
19.33 Ethernet Interface Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
19.33.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
19.34 External Bus Interface (EBI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
19.34.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
19.34.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
19.34.2.1 EBI_CS_BusWidth_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
19.34.2.2 EBI_CS_ByteAccess_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
19.34.2.3 EBI_CS_NWait_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
19.34.2.4 EBI_CS_RdMode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
19.34.2.5 EBI_CS_WrMode_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
19.34.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
19.34.3.1 ConfigureEBI_CS() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
19.34.3.2 ConfigureEBI_CS() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.3.3 ConfigureEBI_CSPin() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.4 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.4.1 busWidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.4.2 byteAccess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.4.3 ncs_rd_pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.4.4 ncs_rd_setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.4.5 ncs_wr_pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
19.34.4.6 ncs_wr_setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.7 nrd_cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307

NetBurner, Inc.
xix

19.34.4.8 nrd_pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307


19.34.4.9 nrd_setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.10 nWait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.11 nwe_cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.12 nwe_pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.13 nwe_setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.14 rdMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.15 tdf_cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.34.4.16 wrMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
19.35 Extra File Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
19.35.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
19.35.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
19.35.2.1 FreeExtraFd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
19.35.2.2 GetExtraData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
19.35.2.3 GetExtraFD() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
19.35.2.4 GetFreeExtraFDCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
19.36 FAT File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
19.36.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
19.36.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
19.36.2.1 f_chdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
19.36.2.2 f_close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
19.36.2.3 f_delete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
19.36.2.4 f_delvolume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
19.36.2.5 f_eof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
19.36.2.6 f_findfirst . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
19.36.2.7 f_findnext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
19.36.2.8 f_getfreespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
19.36.2.9 f_gettimedate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
19.36.2.10 f_mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
19.36.2.11 f_open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
19.36.2.12 f_read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
19.36.2.13 f_rewind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
19.36.2.14 f_rmdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
19.36.2.15 f_seek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
19.36.2.16 f_settimedate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
19.36.2.17 f_write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
19.36.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
19.36.3.1 f_enterFS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
19.36.3.2 f_releaseFS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
19.37 FAT File System Seek Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
19.37.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
19.38 FD Change Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318

NetBurner, Inc.
xx

19.38.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318


19.38.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
19.38.2.1 FDChangeType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
19.39 FTP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
19.39.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
19.39.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
19.39.2.1 FTP_CloseSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
19.39.2.2 FTP_InitializeSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
19.39.2.3 FTPActiveMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
19.39.2.4 FTPDeleteDir() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
19.39.2.5 FTPDeleteFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
19.39.2.6 FTPGetCommandResult() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
19.39.2.7 FTPGetDir() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
19.39.2.8 FTPGetFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
19.39.2.9 FTPGetFileNames() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
19.39.2.10 FTPGetList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
19.39.2.11 FTPMakeDir() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
19.39.2.12 FTPPassiveMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
19.39.2.13 FTPRawCommand() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
19.39.2.14 FTPRawStreamCommand() . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
19.39.2.15 FTPRenameFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
19.39.2.16 FTPSendFile() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
19.39.2.17 FTPSetDir() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
19.39.2.18 FTPUpDir() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
19.40 FTP Client Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
19.40.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
19.41 Function Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
19.41.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
19.41.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
19.41.2.1 CertGenReturnCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
19.42 HAL - Hardware Abstraction Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
19.42.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
19.42.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
19.42.2.1 FlashErase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
19.42.2.2 FlashProgram() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
19.42.2.3 FlashProgramAppImage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
19.42.2.4 HalGetTickFraction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
19.42.2.5 HalStorage_AddressOffset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
19.42.2.6 HalStorage_Erase() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
19.42.2.7 HalStorage_Finalize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
19.42.2.8 HalStorage_GetAllocated() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
19.42.2.9 HalStorage_GetMaxAllocation() . . . . . . . . . . . . . . . . . . . . . . . . . . 332

NetBurner, Inc.
xxi

19.42.2.10 HalStorage_Prepare() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332


19.42.2.11 HalStorage_RemainingSpace() . . . . . . . . . . . . . . . . . . . . . . . . . . 333
19.42.2.12 HalStorage_Save() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
19.42.2.13 HalStorage_SavePartial() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
19.42.2.14 HalStorage_WriteOffset() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
19.42.2.15 spaceleft() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
19.42.2.16 StdioCheckIntc() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
19.42.2.17 SysLogCheckIntc() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
19.42.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
19.42.3.1 HalTickMaxCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
19.42.3.2 watchdog_service_function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
19.43 HTTP and HTML Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
19.43.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
19.43.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
19.43.2.1 http_gethandlerfunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
19.43.2.2 http_posthandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
19.43.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
19.43.3.1 HTTP_RequestTypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
19.43.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
19.43.4.1 BadRequestResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
19.43.4.2 CheckHttpAccess() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
19.43.4.3 ConfigRenderFunc() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
19.43.4.4 ConfigRenderFunc() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
19.43.4.5 EmptyResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
19.43.4.6 ForbiddenResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
19.43.4.7 GetRecordFromName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
19.43.4.8 httpstricmp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
19.43.4.9 NoContentResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
19.43.4.10 NotAvailableResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
19.43.4.11 NotFoundResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
19.43.4.12 RedirectResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
19.43.4.13 SendEmailResponse() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
19.43.4.14 SendFileFragment() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
19.43.4.15 SendFullResponse() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
19.43.4.16 SendFullResponse() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
19.43.4.17 SendGifHeader() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
19.43.4.18 SendHeaderResponse() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . 344
19.43.4.19 SendHeaderResponse() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . 345
19.43.4.20 SendHTMLHeader() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
19.43.4.21 SendHTMLHeaderWCookie() . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
19.43.4.22 SendTextHeader() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
19.43.4.23 StartHttp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

NetBurner, Inc.
xxii

19.43.4.24 StartHttps() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347


19.43.4.25 StopHttp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
19.43.4.26 writeallsafestring() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
19.43.4.27 WriteHtmlVariable() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
19.43.4.28 writesafestring() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
19.44 High Resolution Delay Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
19.44.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
19.45 I/O Control Command Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
19.45.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
19.46 I/O Control Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
19.46.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
19.47 I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
19.47.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
19.48 IOSYS - I/O System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
19.48.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
19.48.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
19.48.2.1 FDCallBack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
19.48.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
19.48.3.1 charavail() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
19.48.3.2 close() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
19.48.3.3 CurrentStdioFD() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
19.48.3.4 dataavail() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
19.48.3.5 FD_CLR() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
19.48.3.6 FD_ISSET() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
19.48.3.7 FD_SET() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
19.48.3.8 FD_ZERO() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
19.48.3.9 haserror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
19.48.3.10 ioctl() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
19.48.3.11 peek() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
19.48.3.12 PeekWithTimeout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
19.48.3.13 read() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
19.48.3.14 readall() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
19.48.3.15 ReadAllWithTimeout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
19.48.3.16 ReadWithTimeout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
19.48.3.17 RegisterFDCallBack() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
19.48.3.18 ReplaceStdio() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
19.48.3.19 select() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
19.48.3.20 write() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
19.48.3.21 writeall() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
19.48.3.22 writeavail() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
19.48.3.23 writestring() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
19.48.3.24 ZeroWaitSelect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

NetBurner, Inc.
xxiii

19.49 IPADDR4 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365


19.49.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
19.49.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
19.49.2.1 IPADDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
19.50 IPADDR6 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
19.50.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
19.51 Initialization - System Initialization Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
19.51.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
19.51.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
19.51.2.1 EnableSecureConfigServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
19.51.2.2 EnableSystemDiagnostics() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
19.51.2.3 init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
19.51.2.4 StartHttp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
19.51.2.5 StartHttps() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
19.51.2.6 WaitForActiveNetwork() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
19.52 Interval Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
19.52.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
19.52.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
19.52.2.1 IntervalInterruptCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
19.52.2.2 IntervalOSFlag() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
19.52.2.3 IntervalOSSem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
19.52.2.4 IntervalStop() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
19.53 JSON Lexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
19.53.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
19.53.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
19.53.2.1 CharOutputFn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
19.54 JsonRef and ParsedJsonDataSet Valid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
19.54.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
19.54.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
19.54.2.1 IsArray() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
19.54.2.2 IsBool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
19.54.2.3 IsNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
19.54.2.4 IsNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
19.54.2.5 IsObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
19.54.2.6 IsString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
19.54.2.7 Valid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
19.55 JsonRef and ParsedJsonDataSet types and operators . . . . . . . . . . . . . . . . . . . . . . . . 373
19.55.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
19.55.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
19.55.2.1 operator bool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
19.55.2.2 operator const char ∗() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
19.55.2.3 operator double() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374

NetBurner, Inc.
xxiv

19.55.2.4 operator float() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374


19.55.2.5 operator int() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
19.55.2.6 operator int16_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
19.55.2.7 operator int32_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
19.55.2.8 operator int8_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
19.55.2.9 operator NBString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.55.2.10 operator time_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.55.2.11 operator uint16_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.55.2.12 operator uint32_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.55.2.13 operator uint8_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.56 MIME Content Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.57 MOD5441x and NANO54415 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
19.57.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
19.57.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
19.57.2.1 I2CMultiChannelResetPeripheral() . . . . . . . . . . . . . . . . . . . . . . . . . 377
19.57.2.2 MultiChannel_I2CInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
19.57.2.3 MultiChannel_I2CRead() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
19.57.2.4 MultiChannel_I2CReadBuf() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
19.57.2.5 MultiChannel_I2CRestart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
19.57.2.6 MultiChannel_I2CSend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
19.57.2.7 MultiChannel_I2CSendBuf() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
19.57.2.8 MultiChannel_I2CStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
19.57.2.9 MultiChannel_I2CStop() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
19.58 MODM7AE70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
19.58.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
19.58.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
19.58.2.1 CONF_MCAN_RX_BUFFER_NUM . . . . . . . . . . . . . . . . . . . . . . . . 381
19.58.2.2 CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM . . . . . . . . . . . . . . . . 381
19.58.2.3 CONF_MCAN_RX_FIFO_0_NUM . . . . . . . . . . . . . . . . . . . . . . . . . 381
19.58.2.4 CONF_MCAN_RX_FIFO_1_NUM . . . . . . . . . . . . . . . . . . . . . . . . . 381
19.58.2.5 CONF_MCAN_RX_STANDARD_ID_FILTER_NUM . . . . . . . . . . . . . . . . 381
19.58.2.6 CONF_MCAN_TX_BUFFER_NUM . . . . . . . . . . . . . . . . . . . . . . . . 381
19.58.2.7 CONF_MCAN_TX_EVENT_FIFO . . . . . . . . . . . . . . . . . . . . . . . . . 381
19.58.2.8 CONF_MCAN_TX_FIFO_QUEUE_NUM . . . . . . . . . . . . . . . . . . . . . 381
19.59 MODM7AE70 (SAME70) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
19.59.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
19.60 Multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
19.60.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
19.60.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
19.60.2.1 RegisterMulticastFifo4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
19.60.2.2 RegisterMulticastFifo6() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
19.60.2.3 UnregisterMulticastFifo4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383

NetBurner, Inc.
xxv

19.60.2.4 UnregisterMulticastFifo6() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384


19.61 Multichannel I2C Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
19.61.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
19.62 Multichannel I2C Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
19.62.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
19.63 Multihome and VLAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
19.63.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
19.63.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
19.63.2.1 AddInterface() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
19.63.2.2 AddInterface() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
19.63.2.3 AddInterface() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
19.63.2.4 AddVlanInterface() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
19.63.2.5 AddVlanInterface() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
19.63.2.6 AddVlanInterface() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
19.64 NBRTOS Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
19.64.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
19.65 NBRTOS Real Time Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
19.65.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
19.65.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
19.65.2.1 OSSimpleTaskCreateLambda . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
19.65.2.2 OSSimpleTaskCreatewName . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
19.65.2.3 WAIT_FOREVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
19.65.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
19.65.3.1 OSChangePrio() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392
19.65.3.2 OSChangeTaskDly() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
19.65.3.3 OSCritEnter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
19.65.3.4 OSCritEnterNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
19.65.3.5 OSCritInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
19.65.3.6 OSCritLeave() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
19.65.3.7 OSDumpTasks() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
19.65.3.8 OSDumpTCBStacks() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
19.65.3.9 OSFifoInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
19.65.3.10 OSFifoPend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
19.65.3.11 OSFifoPendNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
19.65.3.12 OSFifoPost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
19.65.3.13 OSFifoPostFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
19.65.3.14 OSFlagClear() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
19.65.3.15 OSFlagPendAll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
19.65.3.16 OSFlagPendAllNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
19.65.3.17 OSFlagPendAny() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
19.65.3.18 OSFlagPendAnyNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
19.65.3.19 OSFlagSet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400

NetBurner, Inc.
xxvi

19.65.3.20 OSFlagState() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400


19.65.3.21 OSLock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
19.65.3.22 OSMboxInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
19.65.3.23 OSMboxPend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
19.65.3.24 OSMboxPendNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
19.65.3.25 OSMboxPost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
19.65.3.26 OSQInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
19.65.3.27 OSQPend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
19.65.3.28 OSQPendNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
19.65.3.29 OSQPost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
19.65.3.30 OSQPostFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
19.65.3.31 OSQPostUnique() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
19.65.3.32 OSQPostUniqueFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
19.65.3.33 OSSemInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
19.65.3.34 OSSemPend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
19.65.3.35 OSSemPendNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
19.65.3.36 OSSemPost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
19.65.3.37 OSTaskCreatewName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
19.65.3.38 OSTaskDelete() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
19.65.3.39 OSTimeDly() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
19.65.3.40 OSTimeWaitUntil() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
19.65.3.41 OSUnlock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
19.65.3.42 ShowTaskList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
19.66 NBRTOS Task Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
19.66.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
19.67 NBString - NetBurner String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
19.67.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
19.68 NBUpdate Function Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
19.68.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
19.69 Onboard Certificate Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
19.69.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
19.69.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
19.69.2.1 EnableOnboardCertificateCreation() . . . . . . . . . . . . . . . . . . . . . . . . 411
19.69.2.2 SSL_CreateNewSelfSignedCert() . . . . . . . . . . . . . . . . . . . . . . . . . 412
19.70 POP3 - Post Office Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
19.70.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
19.70.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
19.70.2.1 GetPOPErrorString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
19.70.2.2 POP3_CloseSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
19.70.2.3 POP3_DeleteCmd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
19.70.2.4 POP3_InitializeSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
19.70.2.5 POP3_ListCmd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414

NetBurner, Inc.
xxvii

19.70.2.6 POP3_RetrieveMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414


19.70.2.7 POP3_StatCmd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
19.70.2.8 POPGetResultCode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
19.70.2.9 SSL_POP3_InitializeSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
19.71 POP3 Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
19.71.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
19.72 PPP - Point to Point Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
19.72.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
19.73 PPP Connection State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
19.73.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
19.73.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
19.73.2.1 enum_PPPState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
19.74 PPP Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
19.74.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
19.75 Primitive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
19.75.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
19.75.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
19.75.2.1 json_primitive_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
19.76 QuadSpiModuleNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
19.76.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
19.77 SAME70 GPIO (MODM7AE70) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
19.77.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
19.77.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
19.77.2.1 mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
19.77.2.2 pio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
19.78 SMTP - Send Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
19.78.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
19.78.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
19.78.2.1 CONTENT_TYPE_ENUM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
19.78.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
19.78.3.1 IsMailError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
19.78.3.2 PrintNBError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
19.78.3.3 PrintServerLog() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
19.78.3.4 SendMail() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
19.78.3.5 SendMailAuth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
19.78.3.6 SendMailAuthAddMIME() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
19.78.3.7 SendMailAuthEndMIME() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
19.78.3.8 SendMailAuthStartMIME() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
19.78.3.9 SendMailEx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
19.79 SMTP Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
19.79.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
19.80 SOCKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426

NetBurner, Inc.
xxviii

19.80.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427


19.80.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
19.80.2.1 SocksAdrType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
19.80.2.2 SocksAuthType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
19.80.2.3 SocksClientCmd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
19.80.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
19.80.3.1 AuthWithGssApi() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
19.80.3.2 GetSocksProxySettings() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
19.80.3.3 SetSocksProxySettings() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
19.81 SOCKS Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
19.81.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
19.82 SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
19.82.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
19.83 SPI - MODM7AE70 (DSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
19.83.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
19.83.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.83.2.1 csReturnType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.83.2.2 spiChipSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.83.2.3 spiChipSelectPolarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
19.83.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
19.83.3.1 DSPIdone() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
19.83.3.2 DSPIInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
19.83.3.3 DSPIStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
19.83.3.4 QSPIdone() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
19.83.3.5 QSPIInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
19.83.3.6 QSPIStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
19.84 SPI - MODM7AE70 (QSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
19.84.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
19.85 SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
19.85.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
19.85.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
19.85.2.1 sshGetUserKeyFn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
19.85.2.2 sshGetUserPwFn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
19.85.2.3 sshUserAuthenticateFn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
19.85.2.4 sshUserAuthenticateWithTypeFn . . . . . . . . . . . . . . . . . . . . . . . . . 438
19.85.2.5 sshUserGetKeyFn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
19.85.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
19.85.3.1 NbSshInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
19.85.3.2 SshAccept() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
19.85.3.3 SshClientGetUserKeyFn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.85.3.4 SshClientGetUserPaswordFn() . . . . . . . . . . . . . . . . . . . . . . . . . . 440
19.85.3.5 SshClientSetGetUserKeyFn() . . . . . . . . . . . . . . . . . . . . . . . . . . . 441

NetBurner, Inc.
xxix

19.85.3.6 SshClientSetGetUserPaswordFn() . . . . . . . . . . . . . . . . . . . . . . . . . 441


19.85.3.7 SshClrSockOption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
19.85.3.8 SshConnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
19.85.3.9 SshGetKeySize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
19.85.3.10 SshGetSockOption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
19.85.3.11 SshGetUserAuthenticate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
19.85.3.12 SshGetUserAuthenticateWithType() . . . . . . . . . . . . . . . . . . . . . . . 443
19.85.3.13 SshGetUserGetKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
19.85.3.14 SshNegotiateSession() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
19.85.3.15 SshNegotiateSessionClient() . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
19.85.3.16 SshPrintStatistics() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
19.85.3.17 SshSetBannerText() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
19.85.3.18 SshSetSockOption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
19.85.3.19 SshSetUserAuthenticate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
19.85.3.20 SshSetUserAuthenticateWithType() . . . . . . . . . . . . . . . . . . . . . . . 445
19.85.3.21 SshSetUserGetKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
19.85.3.22 SshValidateKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
19.85.3.23 SshWritePublicKey() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
19.86 SSH Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.86.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.86.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.86.2.1 SSH_FAILED_KEY_CHECK . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.87 SSL Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
19.87.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
19.88 SSL SMTP Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
19.88.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
19.88.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
19.88.2.1 SSL_SendMail() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
19.88.2.2 SSL_SendMailHTML() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
19.88.2.3 SSL_SendMailStartMIME() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
19.89 SSL/TLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
19.89.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
19.89.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
19.89.2.1 ExpireRetCodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
19.89.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
19.89.3.1 FreeSSLSockets() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
19.89.3.2 GetCertificateLen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
19.89.3.3 GetCertificatePEM() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
19.89.3.4 GetPrivateKeyLen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
19.89.3.5 GetPrivateKeyPEM() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
19.89.3.6 IsSSL_CertNKeyValid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
19.89.3.7 SetMaxSessionReuseTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457

NetBurner, Inc.
xxx

19.89.3.8 SSL_accept() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457


19.89.3.9 SSL_AddCertToClientCaList() . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
19.89.3.10 SSL_AddCertToServerCaList() . . . . . . . . . . . . . . . . . . . . . . . . . . 458
19.89.3.11 SSL_ClearClientCaList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
19.89.3.12 SSL_ClearServerCaList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
19.89.3.13 SSL_ClientReadyCert() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
19.89.3.14 SSL_clrsockoption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
19.89.3.15 SSL_connect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
19.89.3.16 SSL_GetAltNameFromCert() . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
19.89.3.17 SSL_GetCnFromCert() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
19.89.3.18 SSL_GetExpirationDate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
19.89.3.19 SSL_GetIssuerFromCert() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
19.89.3.20 SSL_getsocketerror() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
19.89.3.21 SSL_getsockoption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
19.89.3.22 SSL_GetSubjectNameFromCert() . . . . . . . . . . . . . . . . . . . . . . . . 463
19.89.3.23 SSL_GetTimeToExpire() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
19.89.3.24 SSL_IsCertAddedToClientCaList() . . . . . . . . . . . . . . . . . . . . . . . . 464
19.89.3.25 SSL_IsCertAddedToServerCaList() . . . . . . . . . . . . . . . . . . . . . . . . 465
19.89.3.26 SSL_IsCertExpired() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
19.89.3.27 SSL_makeSecure() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
19.89.3.28 SSL_negotiate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
19.89.3.29 SSL_ServerReadyCert() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
19.89.3.30 SSL_setsockoption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
19.89.3.31 SSLGetRxBufferSpaceUsed() . . . . . . . . . . . . . . . . . . . . . . . . . . 468
19.89.3.32 SSLGetTxBufferAvailSpace() . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
19.89.3.33 SslInit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
19.89.3.34 SSLReadWithTimeout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
19.89.3.35 SslSetVerifyPeerClient() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
19.89.3.36 SslSetVerifyPeerServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
19.89.3.37 SSLSocketsAvail() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
19.89.4 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
19.89.4.1 IsSSLfd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
19.89.4.2 SSL_GetRawSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
19.89.4.3 SSL_GetSocketInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
19.89.4.4 SSL_GetSocketLocalAddr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
19.89.4.5 SSL_GetSocketLocalPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
19.89.4.6 SSL_GetSocketRemoteAddr . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
19.89.4.7 SSL_GetSocketRemotePort . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
19.89.4.8 SSL_GetTcpRtxCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
19.89.4.9 SSL_TcpGetLastRxTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
19.89.4.10 SSL_TcpGetSocketState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
19.89.4.11 SSL_TcpSendKeepAlive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474

NetBurner, Inc.
xxxi

19.90 STD File System Seek Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474


19.90.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
19.91 Save Config Record Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
19.91.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
19.92 Scan Request Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
19.92.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
19.93 Security Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
19.93.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
19.94 Serial Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
19.94.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
19.94.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
19.94.2.1 SimpleOpenSerial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
19.94.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
19.94.3.1 parity_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
19.94.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
19.94.4.1 GetUartErrorReg() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
19.94.4.2 OpenDefaultSerial() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
19.94.4.3 OpenSerial() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
19.94.4.4 SendBreak() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
19.94.4.5 Serial485HalfDupMode() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
19.94.4.6 SerialClose() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
19.94.4.7 SerialEnableHwRxFlow() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
19.94.4.8 SerialEnableHwTxFlow() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
19.94.4.9 SerialEnableRxFlow() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
19.94.4.10 SerialEnableTxFlow() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
19.94.4.11 SerialExpandRxBuffer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
19.94.4.12 SerialSendComplete() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
19.94.4.13 serwriteaddress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
19.94.4.14 SetRTS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
19.95 Serial Port Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
19.95.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
19.96 Shutdown Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
19.96.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
19.96.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
19.96.2.1 NBApproveShutdown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
19.96.2.2 NBFaultNotify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
19.97 ShutdownReasons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
19.97.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
19.98 Signed Application Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
19.98.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
19.98.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
19.98.2.1 ProgramApplication() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483

NetBurner, Inc.
xxxii

19.98.2.2 RegisterAppSigningPublicKey() . . . . . . . . . . . . . . . . . . . . . . . . . . 484


19.98.2.3 UpdateFromStream() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
19.99 Stopwatch Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
19.99.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
19.100 Stream Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
19.100.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
19.100.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
19.100.2.1 ReadBinaryApplicationCodeFromStream() . . . . . . . . . . . . . . . . . . . . 485
19.100.2.2 ReadS19ApplicationCodeFromStream() . . . . . . . . . . . . . . . . . . . . . 486
19.101 Stream Update Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
19.101.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
19.102 System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
19.102.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
19.102.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
19.102.2.1 GetReleaseTag() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
19.102.2.2 GetUserParameters() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
19.102.2.3 SaveUserParameters() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
19.103 TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
19.103.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
19.103.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
19.103.2.1 abortsocket() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
19.103.2.2 accept() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
19.103.2.3 clrsockoption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
19.103.2.4 connect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
19.103.2.5 connectvia() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
19.103.2.6 connectvia() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
19.103.2.7 connectwlocal() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
19.103.2.8 GetSocketLocalAddr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
19.103.2.9 GetSocketLocalPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
19.103.2.10 GetSocketRemoteAddr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
19.103.2.11 GetSocketRemotePort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
19.103.2.12 getsockoption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
19.103.2.13 GetTcpRtxCount() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
19.103.2.14 listen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
19.103.2.15 listenvia() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
19.103.2.16 listenvia() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
19.103.2.17 NoBlockConnect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
19.103.2.18 NoBlockConnectVia() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . 497
19.103.2.19 NoBlockConnectVia() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . 497
19.103.2.20 NoBlockConnectwlocal() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
19.103.2.21 SetOutOfOrderBuffers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
19.103.2.22 SetSocketRxBuffers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499

NetBurner, Inc.
xxxiii

19.103.2.23 SetSocketTxBuffers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500


19.103.2.24 SetSocketUnackBuffers() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
19.103.2.25 setsockoption() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
19.103.2.26 SocketPeek() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
19.103.2.27 SockReadWithTimeout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
19.103.2.28 TcpAllDataAcked() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
19.103.2.29 TcpGetLastRxInterval() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
19.103.2.30 TcpGetLastRxTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
19.103.2.31 TcpGetRxBufferSpaceUsed() . . . . . . . . . . . . . . . . . . . . . . . . . . 503
19.103.2.32 TcpGetSocketInterface() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
19.103.2.33 TcpGetSocketState() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
19.103.2.34 TcpGetTxBufferAvailSpace() . . . . . . . . . . . . . . . . . . . . . . . . . . 504
19.103.2.35 TcpSendKeepAlive() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
19.103.2.36 WaitForSocketFlush() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
19.104 TCP Notify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
19.104.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
19.104.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
19.104.2.1 tcp_notify_handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
19.104.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
19.104.3.1 RegisterTCPReadNotify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
19.104.3.2 RegisterTCPWriteNotify() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
19.105 TCP Socket Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
19.105.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
19.106 TCP Socket State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
19.106.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
19.107 TCP Socket Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
19.107.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
19.108 TFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
19.108.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
19.108.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
19.108.2.1 GetTFTP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
19.108.2.2 SendTFTP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
19.109 TFTP Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
19.109.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
19.110 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
19.110.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
19.110.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
19.110.2.1 set_time() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
19.110.2.2 time() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
19.110.2.3 timegm() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
19.110.2.4 tzsetchar() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
19.111 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511

NetBurner, Inc.
xxxiv

19.111.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512


19.112 UDP Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
19.112.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
19.113 UDP Packet Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
19.113.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
19.113.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
19.113.2.1 RegisterEphemeralFifo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
19.113.2.2 RegisterUDPFifo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
19.113.2.3 RegisterUDPFifoVia() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
19.113.2.4 RegisterUDPFifoWithNotify() . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
19.113.2.5 RegisterUDPFifoWithNotifyVia() . . . . . . . . . . . . . . . . . . . . . . . . . 514
19.113.2.6 UnregisterUDPFifo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
19.114 UDP Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
19.114.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
19.114.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
19.114.2.1 CreateRxTxUdpSocket() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
19.114.2.2 CreateRxTxUdpSocketVia() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . 516
19.114.2.3 CreateRxTxUdpSocketVia() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . 517
19.114.2.4 CreateRxUdpSocket() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
19.114.2.5 CreateRxUdpSocketVia() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . 518
19.114.2.6 CreateRxUdpSocketVia() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . 518
19.114.2.7 CreateTxUdpSocket() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
19.114.2.8 CreateTxUdpSocketVia() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . 519
19.114.2.9 CreateTxUdpSocketVia() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . 519
19.114.2.10 recvfrom() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
19.114.2.11 SendFragmentedUdpPacket() . . . . . . . . . . . . . . . . . . . . . . . . . . 520
19.114.2.12 sendto() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
19.114.2.13 sendtovia() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
19.115 User Authorization Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
19.115.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
19.115.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
19.115.2.1 LoadAuthRecordsFn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
19.115.2.2 SaveAuthRecordsFn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
19.116 Web Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
19.116.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
19.116.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
19.116.2.1 DoGet() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
19.116.2.2 DoGet() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
19.116.2.3 DoGet() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
19.116.2.4 DoGet() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
19.116.2.5 DoGetEx() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
19.116.2.6 DoGetEx() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528

NetBurner, Inc.
xxxv

19.116.2.7 DoGetEx() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528


19.116.2.8 DoGetEx() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
19.116.2.9 DoGetUpdate() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
19.116.2.10 DoGetUpdate() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
19.116.2.11 DoJsonPost() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
19.116.2.12 DoJsonPost() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
19.116.2.13 DoJsonPost() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
19.116.2.14 DoJsonPost() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
19.116.2.15 DoJsonPostHttpFile() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
19.116.2.16 DoJsonPostHttpFile() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
19.116.2.17 DoMultipartBoundary() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
19.116.2.18 DoMultipartFinished() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
19.116.2.19 DoMultipartItem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
19.116.2.20 DoMultipartStartPost() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . 533
19.116.2.21 DoMultipartStartPost() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . 534
19.116.2.22 DoUrlEncodedFormPost() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . 534
19.116.2.23 DoUrlEncodedFormPost() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . 535
19.116.2.24 PopulateAuthHeader() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
19.116.2.25 SetHttpDiag() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
19.116.2.26 StartWebClient() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
19.116.2.27 StartWebClient() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
19.116.2.28 StartWebClient() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536
19.117 Web Client Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
19.117.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
19.118 Wifi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
19.118.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
19.118.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
19.118.2.1 InitAP_SPI() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
19.118.2.2 InitWifi_Serial() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
19.118.2.3 InitWifi_SPI() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
19.118.2.4 ScanAndShowNetworks() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
19.118.2.5 ScanForNetworks() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
19.118.2.6 SetWifiSPISpeed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
19.118.2.7 WifiInitScan_Serial() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
19.118.2.8 WifiInitScan_SPI() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
19.118.2.9 WifiInitScanAndShow_Serial() . . . . . . . . . . . . . . . . . . . . . . . . . . 541
19.118.2.10 WifiInitScanAndShow_SPI() . . . . . . . . . . . . . . . . . . . . . . . . . . . 542

20 Namespace Documentation 543


20.1 canMCF5441x Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
20.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
20.2 mcanMODM7AE70 Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543

NetBurner, Inc.
xxxvi

20.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543


20.3 NB::Error Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
20.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
20.3.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
20.3.2.1 GeneralErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
20.3.3 GeneralErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
20.4 NB::Error::Connect Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
20.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
20.4.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.4.2.1 ConnectErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.4.3 ConnectErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.5 NB::Error::Init Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.5.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.5.2.1 InitializationErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.5.3 InitializationErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
20.6 NB::Error::Scan Namespace Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
20.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
20.6.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
20.6.2.1 ScanErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
20.6.3 ScanErrors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546

21 Class Documentation 547


21.1 _PinVector Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
21.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
21.1.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
21.1.2.1 config() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
21.1.2.2 config() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
21.1.2.3 operator uint32_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
21.1.2.4 operator=() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
21.1.2.5 operator[]() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
21.2 aes_context Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
21.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
21.2.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
21.2.2.1 drk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
21.2.2.2 erk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
21.2.2.3 nr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
21.3 AltNameEntry Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
21.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
21.3.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
21.3.2.1 m_value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
21.4 CallBackFunctionPostHandler Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550

NetBurner, Inc.
xxxvii

21.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550


21.4.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
21.4.2.1 ProcessRaw() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
21.5 canMCF5441x::CanRxMessage Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
21.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
21.5.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
21.5.2.1 CanRxMessage() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
21.5.2.2 CanRxMessage() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
21.5.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
21.5.3.1 GetData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
21.5.3.2 GetNewMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
21.5.3.3 IsValid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
21.6 mcanMODM7AE70::CanRxMessage Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 553
21.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
21.6.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
21.6.2.1 CanRxMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
21.6.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
21.6.3.1 CopyData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
21.6.3.2 GetData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
21.6.3.3 GetNewMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
21.6.3.4 IsValid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
21.7 CertGenData Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
21.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
21.8 config_bool Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
21.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
21.8.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
21.8.2.1 config_bool() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
21.8.2.2 config_bool() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
21.8.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
21.8.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
21.8.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
21.8.3.3 operator bool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
21.8.3.4 operator=() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
21.8.3.5 operator=() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
21.8.3.6 operator=() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
21.9 config_chooser Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
21.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
21.9.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
21.9.2.1 config_chooser() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
21.9.2.2 config_chooser() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
21.9.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
21.9.3.1 GetChoices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560

NetBurner, Inc.
xxxviii

21.9.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560


21.9.3.3 IsInChoices() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
21.9.3.4 IsInChoices() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
21.9.3.5 IsSelected() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
21.9.3.6 IsSelected() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
21.9.3.7 operator NBString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
21.9.3.8 operator=() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
21.9.3.9 operator=() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
21.9.3.10 operator=() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
21.9.3.11 SetChoices() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
21.10 config_double Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
21.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
21.10.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 563
21.10.2.1 config_double() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
21.10.2.2 config_double() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
21.10.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
21.10.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
21.10.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
21.10.3.3 operator double() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
21.10.3.4 operator float() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
21.10.3.5 operator int() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
21.10.3.6 operator=() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
21.10.3.7 operator=() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
21.11 config_int Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
21.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
21.11.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 566
21.11.2.1 config_int() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
21.11.2.2 config_int() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
21.11.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
21.11.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
21.11.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
21.11.3.3 operator int() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
21.11.3.4 operator=() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
21.11.3.5 operator=() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
21.12 config_IPADDR Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
21.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
21.12.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 569
21.12.2.1 config_IPADDR() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
21.12.2.2 config_IPADDR() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
21.12.2.3 config_IPADDR() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
21.12.2.4 config_IPADDR() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
21.12.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570

NetBurner, Inc.
xxxix

21.12.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570


21.12.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570
21.12.3.3 IsNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
21.12.3.4 NotNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
21.12.3.5 operator IPADDR() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
21.12.3.6 operator=() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 571
21.12.3.7 operator=() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
21.13 config_IPADDR4 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
21.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
21.13.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 573
21.13.2.1 config_IPADDR4() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
21.13.2.2 config_IPADDR4() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
21.13.2.3 config_IPADDR4() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573
21.13.2.4 config_IPADDR4() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
21.13.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
21.13.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
21.13.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
21.13.3.3 IsNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
21.13.3.4 NotNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
21.13.3.5 operator IPADDR4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
21.13.3.6 operator=() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
21.13.3.7 operator=() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
21.13.3.8 SetNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
21.14 config_MACADR Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
21.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
21.14.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 577
21.14.2.1 config_MACADR() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
21.14.2.2 config_MACADR() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
21.14.2.3 config_MACADR() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
21.14.2.4 config_MACADR() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
21.14.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
21.14.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
21.14.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
21.14.3.3 operator MACADR() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
21.14.3.4 operator=() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
21.14.3.5 operator=() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
21.15 config_obj Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
21.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
21.15.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 580
21.15.2.1 config_obj() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
21.15.2.2 config_obj() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
21.15.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581

NetBurner, Inc.
xl

21.15.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581


21.15.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
21.16 config_pass Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
21.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
21.16.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 582
21.16.2.1 config_pass() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
21.16.2.2 config_pass() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
21.16.2.3 config_pass() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
21.16.2.4 config_pass() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
21.16.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
21.16.3.1 GetRawValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
21.16.3.2 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
21.16.3.3 operator NBString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
21.16.3.4 operator=() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
21.16.3.5 operator=() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
21.16.3.6 operator=() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
21.16.3.7 operator=() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
21.17 config_string Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
21.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
21.17.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 586
21.17.2.1 config_string() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
21.17.2.2 config_string() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
21.17.2.3 config_string() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
21.17.2.4 config_string() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
21.17.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
21.17.3.1 c_str() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
21.17.3.2 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
21.17.3.3 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
21.17.3.4 length() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
21.17.3.5 operator NBString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
21.17.3.6 operator=() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
21.17.3.7 operator=() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
21.17.3.8 operator=() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
21.17.3.9 operator[]() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
21.17.3.10 SetEnumList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
21.18 config_uint Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
21.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
21.18.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 590
21.18.2.1 config_uint() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
21.18.2.2 config_uint() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
21.18.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
21.18.3.1 GetTextValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591

NetBurner, Inc.
xli

21.18.3.2 GetTypeValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591


21.18.3.3 operator uint32_t() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
21.18.3.4 operator=() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
21.18.3.5 operator=() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
21.19 config_value Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
21.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
21.19.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 593
21.19.2.1 config_value() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
21.19.2.2 config_value() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
21.20 DelayObject Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
21.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
21.20.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 594
21.20.2.1 DelayObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
21.20.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
21.20.3.1 DelayUsec() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
21.20.3.2 valid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
21.21 DhcpObject Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
21.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
21.21.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
21.21.2.1 bDoFallBack() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
21.21.2.2 GetDhcpExpirationTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
21.21.2.3 GetDhcpRebindTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
21.21.2.4 GetDhcpRenewTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
21.21.2.5 GetDHCPState() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
21.21.2.6 GetRemainingDhcpLeaseTime() . . . . . . . . . . . . . . . . . . . . . . . . . . 597
21.21.2.7 RebindDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
21.21.2.8 RenewDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
21.21.2.9 RestartDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
21.21.2.10 StartDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
21.21.2.11 StopDHCP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
21.21.2.12 ValidDhcpLease() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
21.22 NB::Wifi::driverStatusStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
21.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
21.23 DSPIModule Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
21.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
21.23.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 600
21.23.2.1 DSPIModule() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
21.23.2.2 DSPIModule() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
21.23.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
21.23.3.1 ClrSem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
21.23.3.2 DisableDMA() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
21.23.3.3 Done() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602

NetBurner, Inc.
xlii

21.23.3.4 Done() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602


21.23.3.5 EnableDMA() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
21.23.3.6 GetActualBaudrate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
21.23.3.7 GetSem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
21.23.3.8 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
21.23.3.9 RegisterSem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
21.23.3.10 Rx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
21.23.3.11 SetCS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
21.23.3.12 Start() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
21.23.3.13 Tx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
21.23.4 Friends And Related Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . 605
21.23.4.1 DSPIInit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
21.24 EBI_CS_cfg_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
21.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
21.25 HtmlPageHandler Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
21.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
21.25.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 608
21.25.2.1 HtmlPageHandler() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
21.25.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
21.25.3.1 GetGroup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
21.25.3.2 ProcessRaw() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
21.26 HtmlPostVariableListCallback Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
21.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
21.26.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 609
21.26.2.1 HtmlPostVariableListCallback() . . . . . . . . . . . . . . . . . . . . . . . . . . 609
21.27 HTTP_Request Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
21.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
21.28 I2C Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
21.28.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
21.28.2 Member Enumeration Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
21.28.2.1 Result_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
21.28.3 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 612
21.28.3.1 I2C() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
21.28.4 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
21.28.4.1 DoTransaction() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
21.28.4.2 readReg8() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
21.28.4.3 readRegN() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
21.28.4.4 setNumAddressBytes() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
21.28.4.5 setup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
21.28.4.6 writeReg8() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613
21.28.4.7 writeRegN() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
21.29 I2CDevice Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614

NetBurner, Inc.
xliii

21.29.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615


21.29.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 615
21.29.2.1 I2CDevice() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
21.29.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
21.29.3.1 getI2CAddress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615
21.29.3.2 readReg8() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
21.29.3.3 readRegN() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
21.29.3.4 setup() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
21.29.3.5 writeReg8() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
21.29.3.6 writeRegN() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
21.30 IPADDR4 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
21.30.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
21.30.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 618
21.30.2.1 IPADDR4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
21.30.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
21.30.3.1 fdprint() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
21.30.3.2 IsAutoIP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.30.3.3 IsGlobalBroadCast() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.30.3.4 IsLoopBack() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.30.3.5 IsmDns() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
21.30.3.6 IsMultiCast() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
21.30.3.7 IsNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
21.30.3.8 NotNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
21.30.3.9 SetFromAscii() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620
21.30.3.10 SetNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
21.30.3.11 sprintf() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
21.31 IPADDR6 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
21.31.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
21.31.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
21.31.2.1 AsciiToIp6() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
21.31.2.2 Extract4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
21.31.2.3 fdprint() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
21.31.2.4 IsEmbeddedIPV4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
21.31.2.5 IsLinkLocal() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
21.31.2.6 IsLoopBack() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.31.2.7 IsMultiCast() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.31.2.8 IsNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.31.2.9 McastMac() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
21.31.2.10 NotNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.31.2.11 NullIP() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.31.2.12 print() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
21.31.2.13 SetFromAscii() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627

NetBurner, Inc.
xliv

21.31.2.14 SetFromIP4() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627


21.31.2.15 SetFromUint32Shortcut() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
21.31.2.16 SetNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
21.31.2.17 sprintf() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
21.32 JsonAllocString Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
21.32.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
21.33 JsonRef Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
21.33.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.33.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.33.2.1 name() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.33.2.2 object() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
21.33.2.3 operator()() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.33.2.4 operator[]() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.34 mcanMODM7AE70::mcan_config Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . 631
21.34.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.34.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.34.2.1 set_config_defaults() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
21.34.3 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.34.3.1 automatic_retransmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.34.3.2 clock_stop_acknowledge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.34.3.3 clock_stop_request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.34.3.4 delay_compensation_filter_window_length . . . . . . . . . . . . . . . . . . . . 633
21.34.3.5 delay_compensation_offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
21.34.3.6 edge_filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.7 extended_id_mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.8 nonmatching_frames_action_extended . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.9 nonmatching_frames_action_standard . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.10 protocol_exception_handling . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.11 remote_frames_extended_reject . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.12 remote_frames_standard_reject . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.13 run_in_standby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.14 rx_fifo_0_overwrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.15 rx_fifo_0_watermark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.16 rx_fifo_1_overwrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.17 rx_fifo_1_watermark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
21.34.3.18 tdc_enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.34.3.19 timeout_enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.34.3.20 timeout_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.34.3.21 timeout_period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.34.3.22 timestamp_prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.34.3.23 transmit_pause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.34.3.24 tx_event_fifo_watermark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635

NetBurner, Inc.
xlv

21.34.3.25 tx_queue_mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635


21.34.3.26 watchdog_configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
21.35 mcanMODM7AE70::mcan_module Class Reference . . . . . . . . . . . . . . . . . . . . . . . . 635
21.35.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.35.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.35.2.1 mcan_module() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.35.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.35.3.1 blocking_send_message() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
21.35.3.2 MultiCanReplaceRTRMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . 637
21.35.3.3 MultiCanSetRTRMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
21.35.3.4 MultiCanStopRTRMessage() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
21.35.3.5 RegisterRxFifo() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
21.35.3.6 send_message() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
21.36 NBRtosInitObj Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
21.36.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
21.37 NBString Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
21.37.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
21.37.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 640
21.37.2.1 NBString() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
21.37.2.2 NBString() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
21.37.2.3 NBString() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
21.37.2.4 NBString() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
21.37.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
21.37.3.1 Append() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
21.37.3.2 c_str() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
21.37.3.3 clear() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
21.37.3.4 compare() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
21.37.3.5 compare() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
21.37.3.6 copy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
21.37.3.7 empty() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
21.37.3.8 find() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
21.37.3.9 find() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
21.37.3.10 find() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
21.37.3.11 find() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
21.37.3.12 length() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
21.37.3.13 siprintf() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
21.37.3.14 siprintf() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
21.37.3.15 size() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
21.37.3.16 sprintf() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
21.37.3.17 sprintf() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
21.37.3.18 stod() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
21.37.3.19 stoi() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646

NetBurner, Inc.
xlvi

21.37.3.20 stol() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646


21.37.3.21 stoui() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.37.3.22 stoul() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.37.3.23 strcopy() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.37.3.24 substr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
21.37.3.25 to_ipaddr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.37.3.26 vsiprintf() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.37.4 Friends And Related Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . 648
21.37.4.1 swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.38 NV_SettingsStruct Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.38.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
21.39 OS_CRIT Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.39.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.39.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
21.39.2.1 Enter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.39.2.2 EnterNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.39.2.3 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650
21.39.2.4 Leave() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
21.39.2.5 LeaveAndUnlock() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
21.39.2.6 LockAndEnter() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
21.40 OS_FIFO Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.40.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.40.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.40.2.1 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
21.40.2.2 Pend() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
21.40.2.3 Pend() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
21.40.2.4 PendNoWait() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
21.40.2.5 PendNoWait() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
21.40.2.6 Post() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
21.40.2.7 PostFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
21.41 OS_FLAGS Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
21.41.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
21.41.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
21.41.2.1 Clear() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
21.41.2.2 PendAll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656
21.41.2.3 PendAllNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
21.41.2.4 PendAny() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
21.41.2.5 PendAnyNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657
21.41.2.6 Set() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
21.41.2.7 State() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
21.41.2.8 Write() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
21.42 OS_MBOX Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659

NetBurner, Inc.
xlvii

21.42.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659


21.42.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 659
21.42.2.1 OS_MBOX() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
21.42.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
21.42.3.1 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
21.42.3.2 Pend() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
21.42.3.3 Pend() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
21.42.3.4 PendNoWait() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
21.42.3.5 PendNoWait() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
21.42.3.6 Post() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
21.43 OS_Q Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
21.43.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.43.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.43.2.1 OS_Q() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.43.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.43.3.1 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
21.43.3.2 Pend() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
21.43.3.3 Pend() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
21.43.3.4 PendNoWait() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
21.43.3.5 PendNoWait() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
21.43.3.6 Post() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
21.43.3.7 PostFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
21.43.3.8 PostUnique() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
21.43.3.9 PostUniqueFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
21.44 OS_SEM Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
21.44.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.44.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.44.2.1 OS_SEM() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.44.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.44.3.1 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.44.3.2 Pend() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 668
21.44.3.3 PendNoWait() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
21.44.3.4 Post() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
21.45 OSCriticalSectionObj Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
21.45.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
21.45.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 670
21.45.2.1 OSCriticalSectionObj() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
21.46 OSLockAndCritObj Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
21.46.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
21.46.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 671
21.46.2.1 OSLockAndCritObj() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
21.47 OSLockObj Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671

NetBurner, Inc.
xlviii

21.47.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671


21.48 OSSpinCrit Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
21.48.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
21.48.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 672
21.48.2.1 OSSpinCrit() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
21.49 ParsedJsonDataSet Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
21.49.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
21.49.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
21.49.2.1 Add() [1/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
21.49.2.2 Add() [2/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676
21.49.2.3 Add() [3/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
21.49.2.4 Add() [4/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
21.49.2.5 Add() [5/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
21.49.2.6 Add() [6/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
21.49.2.7 Add() [7/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
21.49.2.8 Add() [8/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
21.49.2.9 Add() [9/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
21.49.2.10 Add() [10/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
21.49.2.11 Add() [11/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
21.49.2.12 Add() [12/12] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
21.49.2.13 AddArrayElement() [1/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
21.49.2.14 AddArrayElement() [2/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
21.49.2.15 AddArrayElement() [3/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
21.49.2.16 AddArrayElement() [4/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
21.49.2.17 AddArrayElement() [5/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
21.49.2.18 AddArrayElement() [6/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
21.49.2.19 AddArrayElement() [7/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
21.49.2.20 AddArrayElement() [8/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
21.49.2.21 AddArrayElement() [9/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
21.49.2.22 AddArrayElement() [10/10] . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
21.49.2.23 AddArrayStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
21.49.2.24 AddMyMac() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
21.49.2.25 AddNull() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
21.49.2.26 AddObjectStart() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
21.49.2.27 CopyObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
21.49.2.28 CurrentBool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
21.49.2.29 CurrentName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682
21.49.2.30 CurrentNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
21.49.2.31 CurrentString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
21.49.2.32 FindBoolean() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
21.49.2.33 FindBooleanInCurentObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
21.49.2.34 FindElementAfterName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684

NetBurner, Inc.
xlix

21.49.2.35 FindElementAfterNameInCurrentArray() . . . . . . . . . . . . . . . . . . . . . 684


21.49.2.36 FindElementAfterNameInCurrentObject() . . . . . . . . . . . . . . . . . . . . 684
21.49.2.37 FindFullAtName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
21.49.2.38 FindFullName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
21.49.2.39 FindFullNameBoolean() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
21.49.2.40 FindFullNameNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
21.49.2.41 FindFullNamePermissiveBoolean() . . . . . . . . . . . . . . . . . . . . . . . . 686
21.49.2.42 FindFullNameString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
21.49.2.43 FindGlobalBoolean() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
21.49.2.44 FindGlobalElementAfterName() . . . . . . . . . . . . . . . . . . . . . . . . . 687
21.49.2.45 FindGlobalNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
21.49.2.46 FindGlobalObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688
21.49.2.47 FindGlobalPermissiveBoolean() . . . . . . . . . . . . . . . . . . . . . . . . . 688
21.49.2.48 FindGlobalString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
21.49.2.49 FindNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
21.49.2.50 FindNumberInCurentObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
21.49.2.51 FindObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
21.49.2.52 FindObjectInCurentObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
21.49.2.53 FindPermissiveBoolean() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
21.49.2.54 FindPermissiveBooleanInCurentObject() . . . . . . . . . . . . . . . . . . . . . 690
21.49.2.55 FindString() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
21.49.2.56 FindStringInCurentObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
21.49.2.57 GetCurrent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
21.49.2.58 GetFirst() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
21.49.2.59 GetNext() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
21.49.2.60 GetNextArray() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
21.49.2.61 GetNextBoolInCurrentArray() . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
21.49.2.62 GetNextName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
21.49.2.63 GetNextNameInCurrentArray() . . . . . . . . . . . . . . . . . . . . . . . . . . 694
21.49.2.64 GetNextNameInCurrentObject() . . . . . . . . . . . . . . . . . . . . . . . . . 694
21.49.2.65 GetNextNumberInCurrentArray() . . . . . . . . . . . . . . . . . . . . . . . . . 694
21.49.2.66 GetNextObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
21.49.2.67 GetNextObjectInCurrentArray() . . . . . . . . . . . . . . . . . . . . . . . . . . 695
21.49.2.68 GetNextStringInCurrentArray() . . . . . . . . . . . . . . . . . . . . . . . . . . 695
21.49.2.69 GetParsePosition() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
21.49.2.70 GetPrintSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
21.49.2.71 GetRawCurrent() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
21.49.2.72 PermissiveCurrentBool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
21.49.2.73 PrintObject() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
21.49.2.74 PrintObjectToBuffer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
21.49.2.75 PrintObjectToFd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
21.49.2.76 ReadFrom() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697

NetBurner, Inc.
l

21.49.2.77 ResetPosition() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698


21.49.2.78 SetParsePosition() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
21.49.2.79 SkipCurrentValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
21.49.2.80 WriteData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
21.50 ParsedURI Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
21.50.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
21.50.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 700
21.50.2.1 ParsedURI() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
21.50.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
21.50.3.1 GetAddr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
21.50.3.2 GetHost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
21.50.3.3 GetPath() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
21.50.3.4 GetPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
21.50.3.5 IsSecure() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
21.50.3.6 NewUri() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
21.50.3.7 valid() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
21.51 PinIO Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
21.51.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.51.2 Member Enumeration Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.51.2.1 pin_fn_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.51.3 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.51.3.1 PinIO() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.51.3.2 PinIO() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.51.4 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
21.51.4.1 function() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.51.4.2 getFn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.51.4.3 multidrv() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.51.4.4 operator bool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.51.4.5 operator"!() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.51.4.6 operator=() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
21.51.4.7 operator=() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
21.51.4.8 PullDown() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
21.51.4.9 PullUp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
21.51.4.10 read() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
21.51.4.11 readBack() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.51.4.12 setFn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.51.4.13 setHighStrength() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.51.4.14 tgl() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.51.4.15 toggle() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.52 PINS::PinIO Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
21.52.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
21.53 PinVector< n > Class Template Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707

NetBurner, Inc.
li

21.53.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707


21.53.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 707
21.53.2.1 PinVector() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
21.53.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.53.3.1 operator=() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.54 SerialRecord Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.54.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.54.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
21.54.2.1 AssignUartNumber() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.2 CloseListenPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.3 GetCurrentChannelStatus() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.4 MakeTcpConnection() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.5 MakeUdpConnection() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.6 OkToListen() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.7 OpenListenPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.8 OpenSerialPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.9 ProcessAccept() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.10 ProcessListenError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
21.54.2.11 ProcessNetworkError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.54.2.12 ProcessReadNetworkData() . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.54.2.13 ProcessSerialError() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.54.2.14 ProcessSpecialFrameTCPReadSerialData() . . . . . . . . . . . . . . . . . . . 710
21.54.2.15 ProcessSpecialFrameWriteNetworkData() . . . . . . . . . . . . . . . . . . . . 710
21.54.2.16 ProcessSpecialFrameWriteTimeout() . . . . . . . . . . . . . . . . . . . . . . . 710
21.54.2.17 ProcessTCPReadSerialData() . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.54.2.18 ProcessTimeouts() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.54.2.19 ProcessWriteNetworkData() . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
21.54.2.20 ProcessWriteSerialData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
21.55 SPI_QSPI Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
21.55.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
21.55.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 711
21.55.2.1 SPI_QSPI() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
21.55.2.2 SPI_QSPI() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
21.55.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
21.55.3.1 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
21.55.3.2 Rx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
21.55.3.3 SetBusSpeed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
21.55.3.4 SetCS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
21.55.3.5 Start() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714
21.55.3.6 Tx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
21.56 SPIModule Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
21.56.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716

NetBurner, Inc.
lii

21.56.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 716


21.56.2.1 SPIModule() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
21.56.2.2 SPIModule() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716
21.56.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
21.56.3.1 ClrSem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
21.56.3.2 Done() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
21.56.3.3 Done() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
21.56.3.4 GetActualBaudrate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
21.56.3.5 GetSem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
21.56.3.6 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
21.56.3.7 RegisterSem() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
21.56.3.8 Rx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
21.56.3.9 SetBusSpeed() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
21.56.3.10 SetCS() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
21.56.3.11 Start() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720
21.56.3.12 Tx() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.57 SSC_cfg_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.57.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.57.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.57.2.1 clkDiv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.57.2.2 rx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
21.57.2.3 tx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.58 SSC_rxtx_cfg_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.58.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.58.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.58.2.1 bitOrder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.58.2.2 bitsPerWord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.58.2.3 clkGate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
21.58.2.4 clkOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.5 clkSrc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.6 dataValid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.7 depletionBehavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.8 enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.9 lineIdleState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.10 period . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.11 startCond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.12 startDly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.13 syncDataEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.14 syncEdge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.15 syncLen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723
21.58.2.16 syncOut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
21.58.2.17 wordsPerFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724

NetBurner, Inc.
liii

21.59 SSCCtx_t Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724


21.59.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
21.59.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
21.59.2.1 getCurrentConfig() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
21.59.2.2 getState() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.59.2.3 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.59.2.4 ReadyReceiveBuffer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.59.2.5 TransmitBuffer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
21.60 StopWatch Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.60.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.60.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.60.2.1 StopWatch() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
21.60.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.60.3.1 Clear() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.60.3.2 Convert() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.60.3.3 CountResolution() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.60.3.4 GetTime() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.60.3.5 Start() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.60.3.6 Stop() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
21.61 TicketNonce Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.61.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.62 TickTimeout Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.62.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
21.62.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.62.2.1 TickTimeout() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.62.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.62.3.1 expired() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.62.3.2 operator bool() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.62.3.3 val() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
21.62.4 Friends And Related Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . 731
21.62.4.1 OSTimeWaitUntil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
21.63 UDPPacket Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
21.63.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732
21.63.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 733
21.63.2.1 UDPPacket() [1/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
21.63.2.2 UDPPacket() [2/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733
21.63.2.3 UDPPacket() [3/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
21.63.2.4 UDPPacket() [4/4] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
21.63.2.5 ∼UDPPacket() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
21.63.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
21.63.3.1 AddData() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
21.63.3.2 AddData() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735

NetBurner, Inc.
liv

21.63.3.3 AddDataByte() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735


21.63.3.4 AddDataWord() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
21.63.3.5 bIsIPV6() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
21.63.3.6 GetDataBuffer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
21.63.3.7 GetDataSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
21.63.3.8 GetDestinationAddress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
21.63.3.9 GetDestinationPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
21.63.3.10 GetMacSource() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
21.63.3.11 GetPacketId() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
21.63.3.12 GetSourceAddress() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
21.63.3.13 GetSourcePort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
21.63.3.14 Send() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
21.63.3.15 SendAndKeep() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
21.63.3.16 SendAndKeepViaIfAddr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
21.63.3.17 SendAndKeepViaInterfaceNum() . . . . . . . . . . . . . . . . . . . . . . . . . 738
21.63.3.18 SendViaIfAddr() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
21.63.3.19 SendViaInterfaceNum() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
21.63.3.20 SetDataSize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
21.63.3.21 SetDestinationPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
21.63.3.22 SetSourcePort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
21.63.3.23 Validate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
21.64 UserAuthManager Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
21.64.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
21.64.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
21.64.2.1 AddUserAuth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
21.64.2.2 CheckUserAuth() [1/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
21.64.2.3 CheckUserAuth() [2/2] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
21.64.2.4 CheckUserAuthLevel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
21.64.2.5 ClrUserAuthLevel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
21.64.2.6 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
21.64.2.7 RemoveUserAuth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
21.64.2.8 SetUserAuthLevel() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
21.64.2.9 UpdateUserAuth() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745
21.64.2.10 UserExists() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745
21.65 UserAuthRecord Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
21.65.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
21.65.2 Member Data Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
21.65.2.1 m_authLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
21.66 wifi_init Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
21.66.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
21.67 WireIntf Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
21.67.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747

NetBurner, Inc.
lv

21.67.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747


21.67.2.1 available() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 747
21.67.2.2 beginTransmission() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
21.67.2.3 endTransmission() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
21.67.2.4 flush() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
21.67.2.5 read() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
21.67.2.6 requestFrom() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748
21.67.2.7 write() [1/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
21.67.2.8 write() [2/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
21.67.2.9 write() [3/3] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
21.68 WM8904 Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750
21.68.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
21.68.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . 751
21.68.2.1 WM8904() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
21.68.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
21.68.3.1 GetMicGain() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
21.68.3.2 GetVolume() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
21.68.3.3 Init() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
21.68.3.4 Mute() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
21.68.3.5 MuteMic() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
21.68.3.6 ReadReg() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
21.68.3.7 ReadyReceiveBuffer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
21.68.3.8 SendCmd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
21.68.3.9 SendCmdList() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
21.68.3.10 SetMicGain() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
21.68.3.11 SetVolume() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
21.68.3.12 TransmitBuffer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
21.68.3.13 UpdateCmd() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755
21.68.3.14 WriteReg() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755

22 File Documentation 757


22.1 multican.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
22.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
22.2 multican.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
22.3 multichanneli2c.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
22.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
22.4 multichanneli2c.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764
22.5 cpu_pins.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
22.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
22.6 cpu_pins.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
22.7 dspi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
22.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770

NetBurner, Inc.
lvi

22.8 coldfire/cpu/MCF5441X/include/dspi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770


22.9 dspi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
22.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
22.10 cortex-m7/cpu/SAME70/include/dspi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776
22.11 ebi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
22.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
22.12 ebi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
22.13 i2c.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
22.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
22.14 i2c.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
22.15 mcan.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
22.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
22.16 mcan.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
22.17 quadspi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
22.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
22.18 quadspi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
22.19 EFFS/FAT/src/ftp_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
22.20 MultiPlatform/EffsSDHC/src/ftp_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
22.21 MultiPlatform/WavPlayer/src/ftp_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
22.22 ow.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
22.23 PeriodicAD.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
22.24 PeriodicAD_DMA.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
22.25 wavWriter.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
22.26 dev_test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
22.27 edma.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
22.28 wavPlayer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
22.29 htmlvars.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
22.30 _common/IpUtil/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
22.31 _common/MultiPlatform/RTC-OnChip/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . 801
22.32 DHCP/ChangeIP/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
22.33 DHCP/ChangeIPViaWebpage/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
22.34 Ethernet/ManualConfig/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
22.35 IPv6/IPv6-DHCPv6/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
22.36 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/ip_util.h . . . . . . . . . . . . . . . . . . 802
22.37 PlatformSpecific/MODM7AE70/MODM7AE70FactoryApp/src/ip_util.h . . . . . . . . . . . . . . . . 802
22.38 PlatformSpecific/NANO54415/NANO54415FactoryApp/src/ip_util.h . . . . . . . . . . . . . . . . . 802
22.39 ShowInterfaces/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
22.40 VLan/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
22.41 MyAlloc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
22.42 fileup.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
22.43 ExtraFdCircBuffer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
22.44 JSON/DemoNetBurner/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804

NetBurner, Inc.
lvii

22.45 JSON/SimpleJSONHtml/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804


22.46 JSON/SimplePostReceiver/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
22.47 PlatformSpecific/SB800EX/SB800AsDiagMonitor/src/htmlvar.h . . . . . . . . . . . . . . . . . . . 804
22.48 SSL/SSLConfigMirror/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
22.49 Web/HtmlPostDateTime/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
22.50 Web/HtmlServerGetRequest/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
22.51 Web/HtmlVariables/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
22.52 Web/SignedApp/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
22.53 WebSockets/Console/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
22.54 WebSockets/Echo/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
22.55 NANOL7.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
22.56 _common/EFFS/STD/src/effs_std.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
22.57 Parallax/src/effs_std.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
22.58 _common/EFFS/FAT/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
22.59 _common/EFFS/STD/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
22.60 _common/MultiPlatform/EffsLoadAppFromFlashCard/src/effs_time.h . . . . . . . . . . . . . . . . 809
22.61 _common/MultiPlatform/EffsSDHC/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . 809
22.62 _common/MultiPlatform/WavPlayer/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . 810
22.63 Parallax/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
22.64 PlatformSpecific/MOD5441X/EffsMultipleMmc/src/effs_time.h . . . . . . . . . . . . . . . . . . . . 811
22.65 _common/EFFS/FAT/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
22.66 _common/EFFS/STD/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
22.67 _common/MultiPlatform/EffsLoadAppFromFlashCard/src/FileSystemUtils.h . . . . . . . . . . . . . 812
22.68 _common/MultiPlatform/EffsSDHC/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . 813
22.69 _common/MultiPlatform/WavPlayer/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . 813
22.70 Parallax/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
22.71 PlatformSpecific/MOD5441X/EffsMultipleMmc/src/FileSystemUtils.h . . . . . . . . . . . . . . . . 814
22.72 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/FileSystemUtils.h . . . . . . . . . . . . . 815
22.73 _common/EFFS/STD/src/flashChip/AM29LV160B.h . . . . . . . . . . . . . . . . . . . . . . . . . 816
22.74 Parallax/src/flashChip/AM29LV160B.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
22.75 _common/EFFS/STD/src/flashChip/AT49BV163D.h . . . . . . . . . . . . . . . . . . . . . . . . . 818
22.76 Parallax/src/flashChip/AT49BV163D.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
22.77 _common/EFFS/STD/src/flashChip/MCF5282Flash.h . . . . . . . . . . . . . . . . . . . . . . . . 820
22.78 Parallax/src/flashChip/MCF5282Flash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821
22.79 _common/EFFS/STD/src/flashChip/MX25L6406E.h . . . . . . . . . . . . . . . . . . . . . . . . . 822
22.80 Parallax/src/flashChip/MX25L6406E.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
22.81 _common/EFFS/STD/src/flashChip/MX29GL256F.h . . . . . . . . . . . . . . . . . . . . . . . . . 824
22.82 Parallax/src/flashChip/MX29GL256F.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
22.83 _common/EFFS/STD/src/flashChip/S29GL032.h . . . . . . . . . . . . . . . . . . . . . . . . . . 828
22.84 Parallax/src/flashChip/S29GL032.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
22.85 _common/EFFS/STD/src/flashChip/SAME70Q21.h . . . . . . . . . . . . . . . . . . . . . . . . . 830
22.86 Parallax/src/flashChip/SAME70Q21.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831

NetBurner, Inc.
lviii

22.87 _common/EFFS/STD/src/flashChip/SST39VF040.h . . . . . . . . . . . . . . . . . . . . . . . . . 833


22.88 Parallax/src/flashChip/SST39VF040.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
22.89 Parallax/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
22.90 serial/SerialBurner/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
22.91 SSH/SecureSerToEthFactoryApp/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . 836
22.92 SSL/HttpsUploadCert/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
22.93 _common/EFFS/STD/src/fs_main.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
22.94 Parallax/src/fs_main.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
22.95 _common/EFFS/STD/src/ftp_fs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
22.96 Parallax/src/ftp_fs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
22.97 _common/EFFS/FAT/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
22.98 _common/EFFS/STD/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
22.99 _common/MultiPlatform/WavPlayer/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
22.100 Parallax/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
22.101 Parallax/src/nvsettings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
22.102 serial/SerialBurner/src/nvsettings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
22.103 SSH/SshServerUserKey/src/nvsettings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
22.104 _common/EFFS/FAT/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
22.105 _common/MultiPlatform/EffsLoadAppFromFlashCard/src/cardtype.h . . . . . . . . . . . . . . . . 844
22.106 _common/MultiPlatform/EffsSDHC/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . 844
22.107 _common/MultiPlatform/WavPlayer/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . 845
22.108 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/cardtype.h . . . . . . . . . . . . . . . . 845
22.109 SSH/SecureSerToEthFactoryApp/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . . 846
22.110 _common/MultiPlatform/ADC/SimpleADC/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . . . 846
22.111 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/SimpleAD.h . . . . . . . . . . . . . . . . 846
22.112 PlatformSpecific/MODM7AE70/ADC_Simple/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . 846
22.113 PlatformSpecific/NANO54415/NANO54415FactoryApp/src/SimpleAD.h . . . . . . . . . . . . . . 847
22.114 PlatformSpecific/SOMRT1061/ADC_Simple/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . . 847
22.115 WebSockets/DIPSwitches/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
22.116 tests.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
22.117 webfuncs.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848
22.117.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
22.117.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
22.117.2.1 HandleGetMailPost() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
22.117.2.2 HandleMailGet() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
22.117.2.3 LastResult() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 849
22.117.2.4 POP3_GetMessages() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
22.117.2.5 WebDisplayDhcpSelect() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
22.117.2.6 WebShowDeviceName() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
22.117.2.7 WebShowDhcpDeviceDnsServer() . . . . . . . . . . . . . . . . . . . . . . . . 850
22.117.2.8 WebShowDhcpDeviceGateway() . . . . . . . . . . . . . . . . . . . . . . . . . 851
22.117.2.9 WebShowDhcpDeviceIpAddress() . . . . . . . . . . . . . . . . . . . . . . . . 851

NetBurner, Inc.
lix

22.117.2.10 WebShowDhcpDeviceIpMask() . . . . . . . . . . . . . . . . . . . . . . . . . 851


22.117.2.11 WebShowServer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 851
22.117.2.12 WebShowStaticDeviceDnsServer() . . . . . . . . . . . . . . . . . . . . . . . 852
22.117.2.13 WebShowStaticDeviceGateway() . . . . . . . . . . . . . . . . . . . . . . . . 852
22.117.2.14 WebShowStaticDeviceIpAddress() . . . . . . . . . . . . . . . . . . . . . . . 852
22.117.2.15 WebShowStaticDeviceIpMask() . . . . . . . . . . . . . . . . . . . . . . . . . 852
22.117.2.16 WebShowUserPass() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
22.117.2.17 WebShowUserValue() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853
22.118 _common/MultiPlatform/PulseGenerator-Counter/src/webfuncs.h . . . . . . . . . . . . . . . . . 853
22.119 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/webfuncs.h . . . . . . . . . . . . . . . . 853
22.120 PlatformSpecific/MODM7AE70/MODM7AE70FactoryApp/src/webfuncs.h . . . . . . . . . . . . . 853
22.121 PlatformSpecific/NANO54415/NANO54415FactoryApp/src/webfuncs.h . . . . . . . . . . . . . . 854
22.122 ebi_pager.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
22.123 examples/_common/MultiPlatform/RTC-External/src/rtc.h . . . . . . . . . . . . . . . . . . . . . 854
22.124 examples/PlatformSpecific/MODM7AE70/RTC-External/src/rtc.h . . . . . . . . . . . . . . . . . 855
22.125 platform/MOD5441X/include/rtc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
22.126 hd44780.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
22.127 ssc_i2s.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
22.128 wm8904.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
22.129 wm8904_reg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
22.130 datapump.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
22.131 _common/MultiPlatform/GpioServer/src/analog.h . . . . . . . . . . . . . . . . . . . . . . . . . . 866
22.132 SSH/SecureSerToEthFactoryApp/src/analog.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 866
22.133 fdtimer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
22.134 _common/MultiPlatform/GpioServer/src/gpioserver.h . . . . . . . . . . . . . . . . . . . . . . . . 867
22.135 SSH/SecureSerToEthFactoryApp/src/gpioserver.h . . . . . . . . . . . . . . . . . . . . . . . . . 868
22.136 i2cfuncs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
22.137 i2crecord.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
22.138 i2cserver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
22.139 SSH/SecureSerToEthFactoryApp/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . 872
22.140 SSH/SshServerUserKey/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
22.141 SSL/HttpsUploadCert/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
22.142 SSL/SslClientVerifyPeerEffs/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
22.143 permanentcert.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.144 permanentcertkey.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.145 permanentkeyecdsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.146 SecureSerToEthFactoryApp/src/permanentkeyrsa.h . . . . . . . . . . . . . . . . . . . . . . . . 880
22.147 SshServerUserKey/src/permanentkeyrsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.148 SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h . . . . . . . . . . . . . . . . . . . . . . 881
22.149 SSL/HttpsUploadCert/src/serialburnerdata.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
22.150 SSL/SslClientVerifyPeerEffs/src/serialburnerdata.h . . . . . . . . . . . . . . . . . . . . . . . . . 894
22.151 serialrecord.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895

NetBurner, Inc.
lx

22.152 SecureSerToEthFactoryApp/src/sshuser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896


22.153 SshServerUserKey/src/sshuser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898
22.154 SSH/SecureSerToEthFactoryApp/src/ssluser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
22.155 SSL/HttpsUploadCert/src/ssluser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901
22.156 UserAuth.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
22.157 permanentkeyecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
22.158 caList.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
22.159 Advanced/src/TimeUtil.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
22.160 CompiledCa/src/TimeUtil.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
22.161 Simple/src/TimeUtil.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
22.162 TcpClientSimple/src/clientweb.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
22.163 TcpMultiInterfaceTest/src/clientweb.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
22.164 webif.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
22.164.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
22.164.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
22.164.2.1 CheckNVSettings() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
22.164.2.2 WebDestIp() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
22.164.2.3 WebDestPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
22.164.2.4 WebLocalPort() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
22.165 webif.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
22.166 webif.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
22.167 datagenerator.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
22.168 datalog.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
22.169 drawimage.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
22.169.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
22.169.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
22.169.2.1 FlushData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
22.169.2.2 OutputGifChar() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
22.169.2.3 WriteData() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
22.169.2.4 WriteOneChar() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
22.170 drawimage.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
22.171 gifCompress.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
22.172 webFormValues.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
22.173 WebFunctions.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
22.174 certgen.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
22.174.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911
22.175 certgen.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 911
22.176 CryptoServer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913
22.177 CryptoSocket.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913
22.178 NbSslCtx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915
22.179 NbWolfSsl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916
22.180 SslClientSession.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916

NetBurner, Inc.
lxi

22.181 SslSocket.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917


22.182 E70_RAM/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917
22.183 IC_D20/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
22.184 MOD5441X/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933
22.185 MODM7AE70/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 937
22.186 MODRT1171/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
22.187 MON_RT10xx/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953
22.188 MON_SAME70/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961
22.189 NANO54415/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969
22.190 RT10XX_RAM/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
22.191 SB800EX/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981
22.192 SBE70LC/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
22.193 SOMRT1061/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994
22.194 ssl_internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1001
22.195 ssl.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1005
22.195.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008
22.196 ssl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008
22.197 wolfssl/openssl/ssl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1011
22.198 ssl.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1030
22.198.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1030
22.199 wolfssl/ssl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1030
22.200 ssl_mailto.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1090
22.200.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1090
22.201 ssl_mailto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1090
22.202 ssl_pop3.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091
22.202.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1092
22.203 ssl_pop3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1092
22.204 callbacks.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1092
22.205 certs_test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1093
22.206 crl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1190
22.207 error-ssl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1191
22.208 internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1193
22.209 ocsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1260
22.210 openssl/ocsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1262
22.211 asn1.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263
22.212 asn1t.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265
22.213 bio.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265
22.214 bn.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1267
22.214.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1267
22.215 bn.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1267
22.216 buffer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1270
22.217 openssl/camellia.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271

NetBurner, Inc.
lxii

22.218 camellia.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271


22.219 wolfcrypt/camellia.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271
22.220 openssl/cmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1272
22.221 wolfcrypt/cmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1273
22.222 cms.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1274
22.223 compat_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1274
22.224 conf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1275
22.225 crypto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1276
22.226 des.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1278
22.227 openssl/dh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1279
22.228 dh.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1281
22.229 wolfcrypt/dh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1281
22.230 openssl/dsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1283
22.231 dsa.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1285
22.232 wolfcrypt/dsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1285
22.233 ec.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286
22.234 ec25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291
22.235 ec448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291
22.236 ecdh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1292
22.237 ecdsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1292
22.238 openssl/ed25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1293
22.239 ed25519.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1294
22.240 wolfcrypt/ed25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1294
22.241 openssl/ed448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296
22.242 ed448.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1297
22.243 wolfcrypt/ed448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1297
22.244 engine.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299
22.245 err.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299
22.246 evp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1300
22.246.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1300
22.247 evp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1300
22.248 fips_rand.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1314
22.249 openssl/hmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1315
22.250 hmac.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1316
22.251 wolfcrypt/hmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1316
22.252 openssl/kdf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319
22.253 kdf.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319
22.254 wolfcrypt/kdf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319
22.255 lhash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321
22.256 openssl/md4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321
22.257 md4.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1322
22.258 wolfcrypt/md4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1322

NetBurner, Inc.
lxiii

22.259 modes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1323


22.260 obj_mac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1323
22.261 objects.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1324
22.262 opensslconf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1325
22.263 opensslv.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1325
22.264 ossl_typ.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1325
22.265 ossl_typ.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1325
22.266 pem.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1326
22.267 pem.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1326
22.268 openssl/pkcs12.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1329
22.269 wolfcrypt/pkcs12.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1329
22.270 openssl/pkcs7.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1330
22.271 pkcs7.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1332
22.272 wolfcrypt/pkcs7.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1332
22.273 rand.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1337
22.274 rc4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1338
22.275 openssl/ripemd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1338
22.276 ripemd.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1339
22.277 wolfcrypt/ripemd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1339
22.278 openssl/rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1340
22.279 rsa.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1342
22.280 wolfcrypt/rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1343
22.281 openssl/sha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1347
22.282 sha.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351
22.283 wolfcrypt/sha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351
22.284 openssl/sha3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1353
22.285 wolfcrypt/sha3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1355
22.286 openssl/srp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1357
22.287 srp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1357
22.288 wolfcrypt/srp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1357
22.289 ssl23.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1359
22.290 stack.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1359
22.291 tls1.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360
22.292 txt_db.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360
22.293 ui.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361
22.294 x509.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361
22.295 x509_vfy.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1362
22.296 x509v3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1362
22.297 options.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1364
22.298 quic.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1365
22.299 sniffer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1366
22.300 sniffer_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1370

NetBurner, Inc.
lxiv

22.301 test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1372


22.302 version.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1434
22.303 arc4.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1434
22.304 arc4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1435
22.305 asn.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1435
22.306 asn.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1435
22.307 asn_public.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1465
22.308 asn_public.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1465
22.309 async.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1475
22.310 blake2-impl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1475
22.311 blake2-int.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1477
22.312 blake2.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1479
22.313 blake2.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1479
22.314 chacha.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1480
22.315 chacha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1480
22.316 chacha20_poly1305.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1481
22.317 chacha20_poly1305.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1481
22.318 coding.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1483
22.319 coding.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1483
22.320 compress.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1484
22.321 compress.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1484
22.322 cpuid.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1485
22.323 cryptocb.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1486
22.324 curve25519.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1492
22.325 curve25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1492
22.326 curve448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1494
22.327 des3.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1496
22.328 des3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1496
22.329 dilithium.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1497
22.330 dilithium.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1498
22.331 ecc.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1499
22.332 ecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1499
22.333 eccsi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1510
22.334 eccsi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1510
22.335 error-crypt.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1511
22.336 error-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1512
22.337 falcon.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1515
22.338 falcon.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1515
22.339 fe_448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1516
22.340 fe_operations.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1518
22.341 fips.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1520
22.342 fips_test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1520

NetBurner, Inc.
lxv

22.343 ge_448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1521


22.344 ge_operations.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1522
22.345 hc128.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1523
22.346 hc128.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1523
22.347 idea.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1524
22.348 idea.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1524
22.349 integer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1525
22.350 logging.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1530
22.351 logging.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1530
22.352 md2.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1532
22.353 md2.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1532
22.354 mem_track.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1533
22.355 memory.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1538
22.356 memory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1538
22.357 misc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1541
22.358 mpi_class.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1543
22.359 mpi_superclass.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1554
22.360 pkcs11.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1555
22.361 poly1305.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1561
22.362 poly1305.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1562
22.363 afalg_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1563
22.364 wc_afalg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1564
22.365 cryptoCell.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1564
22.366 atmel.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1565
22.367 caam_driver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1567
22.368 caam_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1572
22.369 caam_qnx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1572
22.370 wolfcaam.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573
22.371 wolfcaam_aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1575
22.372 wolfcaam_cmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576
22.373 wolfcaam_ecdsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576
22.374 wolfcaam_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576
22.375 wolfcaam_qnx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1577
22.376 wolfcaam_rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1578
22.377 wolfcaam_seco.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1578
22.378 wolfcaam_sha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1580
22.379 wolfcaam_x25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
22.380 cavium_nitrox.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
22.381 cavium_octeon_sync.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
22.382 psoc6_crypto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1582
22.383 wc_devcrypto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1582
22.384 esp32-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1583

NetBurner, Inc.
lxvi

22.385 quickassist.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586


22.386 quickassist_mem.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586
22.387 quickassist_sync.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586
22.388 iotsafe.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586
22.389 kcapi_dh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589
22.390 kcapi_ecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589
22.391 kcapi_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1590
22.392 kcapi_hmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1590
22.393 kcapi_rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591
22.394 wc_kcapi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591
22.395 nrf51.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591
22.396 dcp_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1592
22.397 ksdk_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1592
22.398 se050_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1594
22.399 pic32mz-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1595
22.400 psa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1598
22.401 renesas-sce-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1599
22.402 renesas-tsip-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1602
22.403 renesas_cmn.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1608
22.404 renesas_sync.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1609
22.405 renesas_tsip_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1609
22.406 silabs_aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1610
22.407 silabs_ecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1611
22.408 silabs_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1611
22.409 silabs_random.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1612
22.410 stm32.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1612
22.411 stsafe.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1614
22.412 ti-ccm.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1615
22.413 ti-hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1616
22.414 xil-sha3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1617
22.415 pwdbased.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1617
22.416 pwdbased.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1617
22.417 rabbit.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1618
22.418 rabbit.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1618
22.419 rc2.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1619
22.420 sakke.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1620
22.421 sakke.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1620
22.422 selftest.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1622
22.423 settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1622
22.424 sha256.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1655
22.425 sha256.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1655
22.426 sha512.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1659

NetBurner, Inc.
lxvii

22.427 sha512.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1659


22.428 signature.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1663
22.429 signature.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1663
22.430 siphash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1664
22.431 sp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1665
22.432 sp_int.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1669
22.433 tfm.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1680
22.433.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1680
22.433.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1681
22.433.2.1 MP_LT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1681
22.434 tfm.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1681
22.435 types.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1691
22.436 types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1691
22.437 visibility.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1707
22.438 wc_encrypt.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1708
22.439 wc_encrypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1708
22.440 wc_pkcs11.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1710
22.441 wc_port.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1711
22.442 wc_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1711
22.443 wolfevent.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723
22.444 wolfmath.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1724
22.445 wolfio.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1725
22.446 wolfio.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1726
22.447 NbWolfSsh.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1735
22.447.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1736
22.448 NbWolfSsh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1737
22.449 SshSocket.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1738
22.450 UserAuthManager.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1739
22.450.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1740
22.451 UserAuthManager.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1740
22.452 nbWifiApi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741
22.453 nbWifiApi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741
22.454 nbWifiDriver.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1742
22.455 nbWifiDriver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1743
22.456 nbWifiMsgStructs.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1746
22.457 nbWifiMsgStructs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1746
22.458 nbWifiSerial.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1750
22.459 nbWifiSerial.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751
22.460 nbWifiSpi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751
22.461 nbWifiSpi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751
22.462 nbWifiConstants.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1752
22.462.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1755

NetBurner, Inc.
lxviii

22.462.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1755


22.462.2.1 BssType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1755
22.462.2.2 ConnectResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1756
22.462.2.3 RadioBand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1756
22.462.2.4 ScanMethods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1756
22.462.2.5 TaskKillError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1756
22.462.2.6 TaskStartError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1756
22.463 nbWifiConstants.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1757
22.464 nbWifiDebug.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1763
22.465 nbWifiDebug.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1763
22.466 wifi.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1765
22.466.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1765
22.467 wifi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1766
22.468 wifiBsp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1767
22.469 wifiBsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1767
22.470 wifiDriver.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1767
22.470.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1768
22.470.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1768
22.470.2.1 ConvertScanResultsToJSON() . . . . . . . . . . . . . . . . . . . . . . . . . . 1768
22.470.2.2 PrintScanResult() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1768
22.471 wifiDriver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1768
22.472 libraries/include/crypto/wolfssl/openssl/aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1772
22.473 aes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1773
22.474 libraries/include/crypto/wolfssl/wolfcrypt/aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 1773
22.475 nbrtos/include/aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1780
22.476 arp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1780
22.476.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1781
22.477 arp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1781
22.478 arpinternal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1782
22.479 atcommand.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1783
22.480 autoip.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1783
22.481 base64.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1784
22.482 buffers.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1785
22.482.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1785
22.483 buffers.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1785
22.484 cc_attrs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1790
22.485 command.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1790
22.485.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1792
22.486 command.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1792
22.487 config_netobj.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1793
22.488 config_obj.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1796
22.488.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1797

NetBurner, Inc.
lxix

22.489 config_obj.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1797


22.490 config_server.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1810
22.490.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1811
22.491 config_server.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1811
22.492 config_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1812
22.493 constants.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1813
22.493.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1813
22.494 constants.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1813
22.495 convert.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1817
22.496 counters.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1818
22.497 dbgmon.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1819
22.498 debugalloc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1819
22.499 debugiprintf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1821
22.500 debugprintblock.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1822
22.501 defer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1822
22.502 device.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1823
22.503 dhcpclient.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1826
22.503.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1826
22.504 dhcpclient.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1827
22.505 dhcpd.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1828
22.505.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1828
22.506 dhcpd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1829
22.507 dhcpinternals.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1832
22.508 diagnostics.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1834
22.509 discoveryservlet.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1836
22.510 dns.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1837
22.510.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1837
22.511 dns.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1838
22.512 api_f.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1838
22.512.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1839
22.513 api_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1839
22.514 cfc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1846
22.515 chkdsk.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1847
22.516 common.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1848
22.517 debug.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1849
22.518 effs_utils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1850
22.519 fat.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1851
22.520 fat_m.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1857
22.521 effs_fat/fwerr.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1858
22.522 file/fwerr.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1859
22.523 mmc_dsc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861
22.524 mmc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1862

NetBurner, Inc.
lxx

22.525 multi_drive_mmc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1863


22.526 port_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1865
22.527 ramdrv_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1865
22.528 sdhc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1866
22.529 udefs_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1868
22.530 endian.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1871
22.531 ethernet.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1871
22.531.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1872
22.532 ethernet.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1872
22.533 fd_adapter.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1873
22.534 fd_dns.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
22.535 fd_drivers.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
22.536 fdiprintf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
22.537 fdprintf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
22.538 effsstd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
22.539 flashdrv.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1875
22.540 fsf.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1876
22.540.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1877
22.541 fsf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1877
22.542 fsm.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1880
22.543 fsmf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1885
22.544 fstaticw.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1887
22.545 port_s.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1888
22.546 ramdrv_s.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1889
22.547 udefs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1889
22.548 ftp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1891
22.548.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1892
22.549 ftp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1892
22.550 ftpd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1893
22.551 gdbstub.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1898
22.552 hal.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1898
22.552.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1900
22.553 hal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1900
22.554 hash.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1901
22.555 libraries/include/crypto/wolfssl/wolfcrypt/hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 1901
22.556 nbrtos/include/hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1904
22.557 HiResDelay.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905
22.557.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905
22.558 HiResDelay.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905
22.559 htmlfiles.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905
22.559.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1906
22.560 htmlfiles.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1906

NetBurner, Inc.
lxxi

22.561 http.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1908


22.561.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1909
22.562 http.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1909
22.563 httppass.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912
22.564 httppost.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912
22.564.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912
22.565 httppost.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912
22.566 https.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1915
22.566.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1915
22.567 https.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1915
22.568 ieee802.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1915
22.569 includes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1917
22.570 init.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1918
22.570.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1918
22.571 init.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1918
22.572 IntervalTimer.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1919
22.572.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1919
22.573 IntervalTimer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1919
22.574 iointernal.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1919
22.574.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1920
22.575 iointernal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1920
22.576 iosys.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1921
22.576.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1923
22.577 iosys.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1923
22.578 ip.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1925
22.579 ip_negotiation.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1931
22.580 ipshow.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1932
22.581 dhcpv6_const.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1932
22.582 dhcpv6_internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1933
22.583 dhcpv6_msg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1935
22.584 ipv6_addr.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1939
22.584.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1939
22.585 ipv6_addr.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1940
22.586 ipv6_constants.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1942
22.587 ipv6_diag.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1943
22.588 ipv6_frames.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1943
22.589 ipv6_interface.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1946
22.590 json_lexer.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1953
22.590.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1953
22.591 json_lexer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1954
22.592 lldp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1961
22.593 logme.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1961

NetBurner, Inc.
lxxii

22.594 mailto.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1962


22.594.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1963
22.595 mailto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1963
22.596 libraries/include/crypto/wolfssl/openssl/md5.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 1965
22.597 md5.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1966
22.598 libraries/include/crypto/wolfssl/wolfcrypt/md5.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 1966
22.599 nbrtos/include/md5.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1967
22.600 mDNS.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1968
22.601 multicast.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1969
22.601.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1969
22.602 multicast.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1969
22.603 multihome.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1970
22.603.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1970
22.604 multihome.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1970
22.605 nbprintfinternal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1971
22.606 nbrtos.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1972
22.606.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1975
22.607 nbrtos.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1976
22.608 nbssh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1987
22.609 nbstring.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1987
22.609.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1988
22.610 nbstring.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1988
22.611 nbtime.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1991
22.611.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1992
22.612 nbtime.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1992
22.613 nbupdate.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1993
22.613.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1993
22.614 nbupdate.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1993
22.615 netbios.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1995
22.616 netDevice.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2000
22.617 netinterface.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2005
22.618 netrx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2012
22.619 nettimer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2013
22.620 nettypes.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2014
22.620.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2015
22.621 nettypes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2015
22.622 pop3.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2019
22.622.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2020
22.623 pop3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2020
22.624 ppp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2021
22.624.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2022
22.625 ppp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2022

NetBurner, Inc.
lxxiii

22.626 examples/JSON/DemoNetBurner/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . 2025


22.627 examples/MultiHome/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . 2025
22.628 examples/OverloadDirectory/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . 2025
22.629 examples/Profile/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . . . 2025
22.630 examples/SSH/SecureSerToEthFactoryApp/overload/nbrtos/include/predef-overload.h . . . . . . 2025
22.631 examples/SSH/sshMinimalClient/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . 2025
22.632 examples/SSH/sshMinimalServer/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . 2025
22.633 examples/SSH/sshServerUserAuth/overload/nbrtos/include/predef-overload.h . . . . . . . . . . 2025
22.634 examples/SSH/SshServerUserKey/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . 2026
22.635 examples/SSL/FTPSServer/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . 2026
22.636 examples/SSL/HttpsUploadCert/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . 2026
22.637 examples/StackProtection/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . 2026
22.638 examples/telnetcmd/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . 2026
22.639 nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2026
22.640 examples/VLan/overload/nbrtos/include/predef.h . . . . . . . . . . . . . . . . . . . . . . . . . . 2026
22.641 nbrtos/include/predef.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2030
22.642 qspiBsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2034
22.643 qspiShared.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2039
22.644 random.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2044
22.645 libraries/include/crypto/wolfssl/wolfcrypt/random.h . . . . . . . . . . . . . . . . . . . . . . . . . 2044
22.646 nbrtos/include/random.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
22.647 randseed.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
22.648 sdio.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
22.649 sdioBsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2060
22.650 sdioBus.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2060
22.651 serial.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2063
22.651.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2064
22.652 serial.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2064
22.653 serial_extensions.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2065
22.654 serinternal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2066
22.655 servlets.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2067
22.656 sha1.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2068
22.657 ShutDownNotifications.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2068
22.657.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
22.658 ShutDownNotifications.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
22.659 smarttrap.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
22.660 snmp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
22.661 Socks.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
22.661.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2071
22.662 Socks.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2071
22.663 stackFns.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2073
22.664 startnet.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2073

NetBurner, Inc.
lxxiv

22.665 stopwatch.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2073


22.665.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2074
22.666 stopwatch.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2074
22.667 StreamUpdate.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2074
22.667.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2074
22.668 StreamUpdate.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2075
22.669 syslog.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2076
22.670 system.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2077
22.670.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2077
22.671 system.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2077
22.672 taskmon.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2078
22.673 tcp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2078
22.673.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2081
22.674 tcp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2082
22.675 tcp_private.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2087
22.676 tftp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2088
22.676.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2089
22.677 tftp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2089
22.678 timezones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2089
22.679 udp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2090
22.679.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2091
22.680 udp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2091
22.681 utils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2098
22.682 vjhc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2102
22.683 http_funcs.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2103
22.683.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2105
22.684 http_funcs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2105
22.685 web_buffers.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2107
22.686 web_client.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2108
22.686.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2109
22.687 web_client.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2109
22.688 websockets.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2109
22.689 mDNS.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2112
22.689.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2112
22.690 tcp_internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2112
22.691 bsp.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2119
22.691.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2119
22.691.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2119
22.691.2.1 SpreadSpectrumOscillator() . . . . . . . . . . . . . . . . . . . . . . . . . . . 2119
22.692 bsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2119
22.693 bsp_devboard.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2120
22.693.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2120

NetBurner, Inc.
lxxv

22.694 bsp_devboard.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2120


22.695 pinconstant.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2121
22.696 pins.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2124
22.697 plat_cfg_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2125
22.698 nbWifiDefs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2125

Index 2127

NetBurner, Inc.
Chapter 1

NetBurner 3.3.9

Welcome to NetBurner Version 3! This documentation package details the capabilities of your NetBurner Develop-
ment Software and Tools. Please refer to the overview described below. The recommended starting points at the
bottom of this page will help you get your system up and running quickly.

For the latest version of this manual please visit the Docs and Support section at
www.netburner.com

The NBEclipse Getting Started Guide

Describes how to create projects and build applications.

Migration Guides

Migration guides for those moving from tools revision 2.x.

The NetBurner Application Programming Interface (API)

Description of the classes, structures and function calls provided in the NetBurner libraries.

Example Programs

Examples demonstrating the use of the hardware and software. Source code is located in "\nburn\examples"

NetBurner, Inc.
2 NetBurner 3.3.9

Programmers Guides

Programmers Guides detail how to use various system capabilities

• Device configuration and the Configuration Server

• HTML Processing and Web Server

• NetBurner Real-Time Operating System (NBRTOS)

• Network Protocols such as TCP and UDP

• Security using SSL/TLS

• Embedded Flash File System (EFFS)

Platform References

The Platform References of this guide provide hardware information such as memory maps and device recovery
should your application crash in a way that is not easily reset. Schematics for your NetBurner devices are located
in the \nburn\docs\NetBurner\platform folder.

Utilities

Tools and Utilities that are run on a client computer, such as discover, configuration, and application updates.

Production and Deployment

Utilities that you can use in your production environment to program and configure modules in volume

Recommended Starting Point for New Developers

• Configure the development kit hardware as described in the Quick Start Guide.

• Connect both your development computer and your NetBurner device to a network with Internet access.
Internet access is not required for development, but will make initial the configuration of the device easier.

• Connect the USB interface from the development board to your computer. It will provide both power and a
console/debug serial port. To view status and debug information, run a serial terminal program such as the
included MTTTY for Windows.

• Your NetBurner device should be running a pre-programmed factory application. Open a web browser and
type "discover.netburner.com" to identify your device. Links on the web page are available to go directly to
the device's web page, and it's configuration page. Note: if you are unable to see your device, but know it's
IP address, you can type the IP address into your browser manually. You can also try the Windows IPSetup
utility to identify an IP address.

• Refer to the NBEclipse Getting Started Guide section of this document to learn how to create, build and
download applications.

• Create a new project for the Factory Application example for your platform. The example will be located in the
"\nburn\examples\PlatformSpecific" directory. You should be able to easily modify and experiment with the
example code.

• Refer to the Programmers Guide and NetBurner API documents for additional information.

NetBurner, Inc.
3

Additional Suggested Starting Examples

Over 100 examples are located in the \nburn\examples folder:

• ShowInterfaces: Displays all available network interface information on a web page and serial port

• SimpleHtml: Minimal web server

• IPADDR-IP Address: IPADDR object operations for assignment and display

• PlatformSpecific: Unique peripherals for each hardware platform, such as timers, ADC, DAC and unique I2C
and SPI peripherals

• RTOS: How to use the various system RTOS capabilities

Location of Original Factory Program

If at any time you wish to restore the original factory program that was running on your device, the pre-built ap-
plication image is located in the \nburn\platform\<your platform>\original folder. For example,
\nburn\platform\MODM7AE70\original. This path assumes a default install to a folder named nburn.

Experienced NetBurner Customers

A significant change you will notice is how the device configuration is accomplished using a web interface. Please
refer to the Migration Guide for a detailed description of the differences between release version 3 and previous
releases.

Useful Topics:
Device Discovery and Configuration
NBEclipse
Command Line Tools
Migration Guides
Programmers Guide
Example Applications
Platform References
System Diagnostics
PC Tools and Utilities
Production & Deployment

NetBurner, Inc.
4 NetBurner 3.3.9

NetBurner, Inc.
Chapter 2

Command Line Tools

2.1 Introduction

As an alternative to NBEclipse, you can use the command line tools to build your NetBurner projects. In fact, all the
example programs are built and tested internally with command line tools. You will find a makefile in each example
folder, so any of the examples can be used as a demonstration of how to use command line tools. Windows,
Mac and Linux are supported. The command line tools can also be used to invoke the NetBurner tools from the
development environment of your choice.

2.2 Command Line Summary

Command Description
make Build a project using the makefile in the project directory
make -j Make using multiple cores to speed up the process
make clean Delete a project's libraries and object files

2.3 Create a New Project From an Example

The easiest way to create a new project is to copy an existing one and modify it:

• Open a command prompt at the location where you keep your projects, such as \NetBurner\Projects

• Create a folder for your project, lets use HelloWorld as an example

• Move to the HelloWorld folder

• Copy an example, such as \nburn\examples\web\SimpleHtml

NetBurner, Inc.
6 Command Line Tools

• At this point your project structure will look like:


\NetBurner\Projects
\- HelloWorld
\- html
|- index.html
\- src
|- main.cpp
| makefile

• Run "make -j" to build the project. The "-j" options uses multiple cores for the build

• When the build completes, an obj folder is created with the object files and .bin application image file←-
: \NetBurner\Projects\HelloWorld\obj\release\SimpleHtml.bin (and also .s19 for
SREC platforms).
\NetBurner\Projects
\- HelloWorld
\- html
|- index.html
\- obj
\- release
|- SimpleHtml.bin
\- src
|- main.cpp
| makefile

• To load the application into your device, use the "make -j load" command.

There are many files and folders under the obj folder, including the compiled libraries and object files.

Note

Each project has its own build of the libraries and system files. That way if any changes need to be made
(which is rare), it can be done on a per-project basis. This will be discussed in the overload section of this
document.

We named our project HelloWorld, but are running SimpleHtml at this point. To customize the project:

• Edit the makefile to change the application image file name to HelloWorld

• Edit main.cpp to change the application name to HelloWorld

• Run "make -j load" to build and load the application into the device

2.3.1 Edit the makefile

The example makefile is shown below:


NAME = SimpleHtml
CPP_SRC = src/main.cpp
CREATEDTARGS += src/htmldata.cpp
CPP_SRC += src/htmldata.cpp
src/htmldata.cpp : $(wildcard html/*.*)
comphtml html -osrc/htmldata.cpp

include $(NNDK_ROOT)/make/boilerplate.mk

Changing the NAME from SimpleHtml to HelloWorld will create the image file as HelloWorld.bin (and .s19)

The CPP_SRC is a list of all .cpp files to build. In this case there is only one, but if there were more it would look
like:
CPP_SRC = src/main.cpp \
+= src/file2.cpp \
+= src/file3.cpp \
+= src/file4.cpp

If you have .c source files you can add them with C_SRC in the same manor.

The html related lines auto-generate a cpp file from the code in the project's html directory.

The final line calls the boilerplate makefile which includes the platform specific make instructions. While you can
drill down into the details, this type of makefile structure makes creating projects much easier since you only need
to list the source files of your project.

NetBurner, Inc.
2.4 Modifying System Files with Overload 7

2.3.2 Edit main.cpp

A fully functional application with the web server enables is actually very few lines of code:
#include <init.h>
#include <nbrtos.h>
#include <system.h>
const char *AppName = "Simple HTML Example";
void UserMain(void *pd)
{
init(); // Initialize network stack
StartHttp(); // Start web server, default port 80
WaitForActiveNetwork();
iprintf("Web Application: %s\r\nNNDK Revision: %s\r\n", AppName, GetReleaseTag());
while (1)
{
OSTimeDly(TICKS_PER_SECOND);
}
}

This example just initializes the system, starts the web server, prints out some information, and loops forever with
a 1 second delay. Changing the AppName to HelloWorld will change the name that shows up in the find and
configuration utilities.

2.4 Modifying System Files with Overload

There can be instances in which you need to modify a NetBurner system file. This is accomplished using the
Oveload feature. NBEclipse creates an overload folder automatically, but with command line it must be created
manually.

Note

The overload example is located in \nburn\examples\Overload

Adding an overload folder to our HelloWorld project:


\NetBurner\Projects
\- HelloWorld
\- html
|- index.html
\- obj
\- release
|- SimpleHtml.bin
\- overload
\- src
|- main.cpp
| makefile

Once you know which file you want to overload, the path in the overload folder must exactly match the system file
path. For example, if we want to overload the predef.h include file located in the \nburn\nbrtos\include
folder:
\NetBurner\Projects
\- HelloWorld
\- html
|- index.html
\- obj
\- release
|- SimpleHtml.bin
\- overload
\- nbrtos
\- include
|- predef.h
\- src
|- main.cpp
| makefile

Now the project's predef.h will be used along with any changes made to it.

NetBurner, Inc.
8 Command Line Tools

2.4.1 Important Overload Rules

• The first time a file is added to the overload folder, a "make clean" is required. From that point on, any
modifications to that file will automatically handle building all necessary system files.

If a system include folder is overloaded, this folder should be added to your project include paths. Right click on the
project and select project properties. Under C/C++ Build->Settings, select GNU C++ Compiler->Includes and add
the overload include folder. If utilizing C code, then GNU C Compiler->Includes should also be added.

2.5 GNU Debugger (GDB)

To load an application and start GDB from the command line:

• Build and load a debug build of the application make loaddebug -j.

• Start GDB:

– For ARM devices such as the MODM7AE70 and SBE70LC: arm-eabi-gdb -se obj/debug/<elf.←-
file>
– For MODM7AE70, SBE70LC, and SOMRT1061 platforms: m68k-elf-gdb -se obj/debug/<elf.←-
file>
• Connect to the target device with: target remote <ipaddress>:2159

To end the GDB session and leave the target running use detach. To end the GDB session use quit. The GDB
command reference is located here: http://www.gnu.org/software/gdb/documentation/.

2.5.1 Example GDB Session

An GDB session running the SimpleHtml example on a MOD54417 is shown below. The example has been modified
to add some variables that do simple counting.

void UserMain(void *pd)


{
init(); // Initialize network stack
StartHttp(); // Start web server, default port 80
WaitForActiveNetwork(TICKS_PER_SECOND * 5);
iprintf("Web Application: %s\r\nNNDK Revision: %s\r\n", AppName, GetReleaseTag());
uint32_t i = 0;
uint32_t j = 0;
while (1)
{
OSTimeDly(TICKS_PER_SECOND);
i++;
j = j + 1;
iprintf("i: %ld, j: %ld\r\n", i, j);
}
}

Load the application. Note that the DEVIP environment variable is set to the device's IP address 10.1.1.169. The
application will begin execution and wait for GDB to connect.

NetBurner, Inc.
2.5 GNU Debugger (GDB) 9

C:\NetBurner\projects\SimpleHtml>make loaddebug -j
C:/nburn/pcbin/nbupdate obj/debug/DBSimpleHtml.bin 10.1.1.169
uriReq: http://10.1.1.169:20034/appupdate.htm
urlStr: http://10.1.1.169:20034/appupdate.htm
200
C:\NetBurner\projects\SimpleHtml>

Start GDB:

C:\NetBurner\projects\SimpleHtml>m68k-elf-gdb -se obj/debug/DBSimpleHtml.elf


GNU gdb (GDB) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=m68k-unknown-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from obj/debug/DBSimpleHtml.elf...done.
(gdb)

Connect to the MOD54417 target on port 2159. This will pause the application at whatever line of code it happens
to be on. For simple examples that will typically be the NBRTOS idle task.

(gdb) target remote 10.1.1.169:2159


Remote debugging using 10.1.1.169:2159
OSTaskIdle (data=0x0) at C:/nburn/arch/coldfire/source/nbrtosmain.cpp:425
425 asm ( " NOP" );
(gdb)

At this point you can do whatever type of GDB commands you wish. To set a break point at the i++; at line 29 of
main.cpp and use the continue command to executee until the break point is reached:

(gdb) break main.cpp:29


Breakpoint 1 at 0x40009282: file src/main.cpp, line 29.
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x40009282 in UserMain(void*) at src/main.cpp:29
(gdb) continue
Continuing.
[Switching to Thread 2]
Thread 2 hit Breakpoint 1, UserMain (pd=0x0) at src/main.cpp:29
29 i++;
(gdb)

The list command can be used to view the source code around the breakpoint:

NetBurner, Inc.
10 Command Line Tools

Thread 2 hit Breakpoint 1, UserMain (pd=0x0) at src/main.cpp:29


29 i++;
(gdb) list
24 uint32_t i = 0;
25 uint32_t j = 0;
26 while (1)
27 {
28 OSTimeDly(TICKS_PER_SECOND);
29 i++;
30 j = j + 1;
31 iprintf("i: %ld, j: %ld\r\n", i, j);
32 }
33 }
(gdb)
\code
\latexonly \end{tcolorbox} \endlatexonly
\n
Now view the variables with print, as well as all local variables:
\latexonly \begin{tcolorbox} \endlatexonly
\code
(gdb) print i
$1 = 2
(gdb) info local
i = 2
j = 2
(gdb)

Use next to go to the next line without stepping into a function (the step command steps into a function). GDB
commands can typically use just the first letter, in this case n:

(gdb) n
30 j = j + 1;
(gdb) info local
i = 3
j = 2
(gdb)

To make changes to your code use the detach command do that the application can resume and will be ready for
your next code download:

(gdb) detach
Detaching from program: C:\NetBurner\projects\SimpleHtml\obj\debug\DBSimpleHtml.elf, Remote target
Ending remote debugging.
[Inferior 1 (Remote target) detached]
(gdb)

To exit GDB, use the quit command:

(gdb) quit
C:\NetBurner\projects\SimpleHtml>

NetBurner, Inc.
Chapter 3

Device Discovery and Configuration

3.1 Introduction

Device discovery and configuration can be accomplished in a number of ways, including methods that are platform
independent, including Windows, macOS, Linux, tablets and mobile phones.

Note

Please refer to the Production and Deployment section of this document for methods and utilities designed to
program and configure devices in a production environment.

3.1.1 Device Discovery Methods:

• If the device and computer have Internet access, open a web browser and go to discover.netburner.com

• Use the localdiscover utility. This is a multi-platform utility written in Golang for windows, osx and linux. The
compiled version can be distributed to your customers, but not the Golang source code.

• The Python find utility, located in \nburn\pctools\find.

• Use the debug/console serial port

3.1.2 Device Configuration methods:

• Interactively using a web browser to access device's Configuration Server

• Sending a JSON object and a utility such as wget (See Production and Deployment)

• The device's serial interface to the Configuration Server

The primary configuration method is through the device's Configuration Web Server. By utilizing a web server,
a device can be configured from any platform or operating system. The underlying configuration mechanism is
handled through a JavaScript Object Notation (JSON) object. This will be described in more detail later, but the
important point is that it provides a simple interface that can be used by non-embedded developers (e.g. web
developers) to interact and configure the device. The implementation is also designed to enable you to add any
application specific information to be stored and accessed in the same manor, such as calibration values, set
points, etc.

You are also able to create your own configuration web interface that will appear in place of the default interface.
In this way you can organize and present data in the appropriate way for your customers, as well as add your own
custom logo, images and descriptions. Examples are provided.

NetBurner, Inc.
12 Device Discovery and Configuration

3.2 Configuration Procedure

• Connect your NetBurner device to a network with Internet access.

• Open a web browser on your host computer and go to discover.netburner.com. You will see a list of
devices on your network. (If the device does not have Internet access, use the localdiscover utility instead).

All system and application settings can now be viewed and/or modified by navigating the tree structure.

Using discover.netburner.com:

Figure 3.1 Discover using discover.netburner.com

Using localdiscover utility:

Figure 3.2 LocalDiscover Utility

NetBurner, Inc.
3.2 Configuration Procedure 13

The "Device" link will take you to the device application web page. The "ConfigPage" link will take you to the device
configuration web page, as shown below:

Figure 3.3 Configuration Web Page

NetBurner, Inc.
14 Device Discovery and Configuration

3.3 The JSON Object

It is not necessary to understand the underlying JSON implementation, but for those that are interested a sample
JSON object is shown below. It identifies each configuration field, which can range from a string, boolean, or a
selection of values. For developers, the programmers guide and examples provide the operational details.

Warning

If you do decided to use any of the JSON configuration methods, you must first download a JSON object from
your specific device. Under no circumstances should you use the example below as you actual device will
likely be different in some respects.

The root of the object is Config. The next levels are AppData and Sys. AppData is available for your application to
store information. Sys is used for the system configuration such as IP settings.
{
"Config":{
"AppData":{},
"Sys":{
"Application":"Simple HTML Example",
"Boot":{
"Abort":"A",
"BootBaud":115200,
"BootDelay":2,
"BootQuiet":false,
"BootUart":0,
"Password":"",
"SerialConfig":{
"Choices":"DuringBoot, AlwaysEnabled, PauseAfterBoot, Disabled", "Value":"DuringBoot"
},
"User":""
},
"NetIf":{
"Ethernet0":{
"DeviceName":"",
"DhcpDiscoverSec":1,
"DiscoveryObfuscate":true,
"DiscoveryReportInterval":900,
"DiscoveryReportUrl":"discover.netburner.com/DevicePost",
"IPv4":{
"ActiveAddr":"10.1.1.73",
"ActiveDNS1":"10.1.1.1",
"ActiveDNS2":"0.0.0.0",
"ActiveGate":"10.1.1.1",
"ActiveMask":"255.255.252.0",
"AutoIPAddr":"169.254.131.245",
"AutoIPEn":true,
"Mode":{
"Choices":"DHCP,DHCP w Fallback,Static,Disabled", "Value":"DHCP"
},
"StaticAddr":"0.0.0.0",
"StaticDNS1":"0.0.0.0",
"StaticDNS2":"0.0.0.0",
"StaticGate":"0.0.0.0",
"StaticMask":"0.0.0.0"
},
"IPv6":{

"ActiveAddr":["2602:306:b8e9:c83f::14c0","2602:306:b8e9:c83f:203:f4ff:fe0b:83f5","fe80::203:f4ff:fe0b:83f5"],

"ActiveDNS":["2602:306:b8e9:c83f:208:a2ff:fe0c:b081","2602:306:b8e9:c83f:208:a2ff:fe0c:b081"],
"ActiveRoute":["fe80::1:1"],
"Mode":{
"Choices":"DHCP,DHCP w Fallback,Static,Disabled", "Value":"DHCP"
},
"StaticAddr":"::",
"StaticDNS1":"::",
"StaticDNS2":"::"
},
"MAC":"00:03:F4:0B:83:F5"
}
},

NetBurner, Inc.
3.4 Configuration Security 15

"Platform":"MODM7AE70"
},
"Version":8,
"Reboot":false
}
}

3.3.1 Developer Notes

If you were writing a web interface and need only the data under Ethernet in the tree, it can be accessed by:
http://10.1.1.71:20034/UI.html?CONFIG/SYS/NETIF/Ethernet

To obtain just the IP address: http://10.1.1.71:20034/UI.html?CONFIG/SYS/NETIF/←-


Ethernet/IPv4/ActiveAddr

Recommended Examples: The following examples are recommended to begin evaluating the platform. They are
located in the \nburn\examples directory.

• ShowInterfaces

• \Configuration\Web\BasicWebConfig

3.4 Configuration Security

One of the features of NetBurner 3.0 is that each device is configured though its own configuration web interface.
Data sent and received through the network interface has three options for security:

• Open: No security, plain text

• Obfuscated: Encrypted, but without TLS and a secure certificate and private key

• Secure: Encrypted with TLS and a certificate and private key

NetBurner, Inc.
16 Device Discovery and Configuration

3.5 Serial Port Configuration

If enabled, the Configuration Server can be accessed through the device serial port. The configuration tree is exactly
the same as what you see on the web interface and in the JSON object. For example, the Ethernet0 settings are
located at Config > Sys > NetIf > Ethernet0.

The serial port interface is located on UART0 by default. It can be modified and enabled/disabled in the Config
> Sys > Boot level of the Configuration Server.

Figure 3.4 Config Boot Level

To access the serial port configuration:

• Connect a cable to the serial port selected as the BootUart

• Run a serial terminal program such as MTTTY

• Reset the device, and type a 'A' when prompted to Abort the boot sequence

NetBurner, Inc.
3.5 Serial Port Configuration 17

Figure 3.5 Abort Boot Sequence

You are now in the serial configuration mode as indicated by the '>' character. Typing "help" will display the help
menu.

Figure 3.6 Serial Help Menu

If we type the "ls" command we can see the next level of the tree is Config, since we are at the root level. In this
example we will set the Static IP values. Note that to change from DHCP to static, we must also change the Mode

NetBurner, Inc.
18 Device Discovery and Configuration

option from DHCP to Static. To navigate to the next level you type in the name of that level. For example, to go to
the Config level:

Figure 3.7 Config Level

The prompt will show the current location, in this case Config>. In the same manor to navigate to the IPv4
settings the level names are typed into the terminal. Note that tabbed auto-completion is also available.

Figure 3.8 IPv4 Level

NetBurner, Inc.
3.5 Serial Port Configuration 19

At any level, typing a "?" will display the current values of that level and all levels beneath in the JSON object format.
For example:

Figure 3.9 Display IPv4 Level

In this example we are interested in the static IP settings. There are two choices to set them: from the IPv4 level by
including the name of the next level and the value, or by going down to each level individually and entering just the
value. In this case we will stay at the IPv4 level and include the name of the static item we want to set. To set the
StaticAddr type: StaticAddr="10.1.1.99". We will also type a "?" to see the changed value:

NetBurner, Inc.
20 Device Discovery and Configuration

Figure 3.10 Set StaticAddr Value

In the same manor we will set the Mask, Gateway and DNS. To set the Mode we will need to either include the
Mode level in the setting string or go to the Mode level, since the setting is a Choices selection and not a simple
string like the static IP settings. To accomplish this from the IPv4 level type: Mode.Choices="Static". If you
navigate the to Mode level, the command would be: Choices="Static". At this point the unsaved settings
are:

NetBurner, Inc.
3.5 Serial Port Configuration 21

Figure 3.11 Static Summary

Warning

From the settings display you can see that the Mode selector control has two settings: Choices and Value.
The Choices are values that appear in the web page selector control and you do not want to modify them.
Only modify the Value to one of the Choices values.

To store the modified values in the Configuration Record in Flash memory, type #save. This will store the values,
but the IP settings will not take effect until the device is rebooted.

NetBurner, Inc.
22 Device Discovery and Configuration

NetBurner, Inc.
Chapter 4

Migration Guides

There are currently three NetBurner development tool branches:

• 2.7.x, IPv4 only for all products except ARM.

• 2.9.x, IPv4/IPv6 dual stack for all products except ARM. This release will continue to be fully supported for
ColdFire devices.

• 3.x, Latest release including IoT enhancements. Supports 5441x (MOD5441x, NANO54415, SB800EX) and
ARM (MODM7AE70) platforms.

Note

If you are updating from a 2.7.x release to a 2.9.x release, please see the IPv6 guide in the \nburn\docs
folder.

The following sections will describe the migration path in more detail.

• Release 2.x to 3.x Overview

• Release 2.x to 3.x Porting Guide

• Upgrade 5441x Platforms to 3.x

4.1 Release 2.x to 3.x Overview

When developing NetBurner 3.x we incorporated customer requests to enable the use of the latest ARM base
processors, security protocols, and IoT capabilities. For existing customers we have done our best to balance the
additional capabilities with ease of migration.

NetBurner, Inc.
24 Migration Guides

4.1.1 Hardware

• Support for ARM processors, starting with the 300MHz M7.

• Support for NXP/Freescale 5441x based products: MOD54415, MOD54417, SB800EX, NANO54415. For
other NetBurner platforms we will fully maintain the 2.9.x branch.

• Applications easily scale from single chip solutions to large memory platforms.

4.1.2 Configuration

A new configuration and update system has been created:

• Updates, discovery and configuration are now platform independent and do not require any computer OS
specific utilities.

• Devices can be discovered by going to "discover.netburner.com" in a web browser.

• Applications can be updated from a web browser, the nbupdate utility, NBEclipse, WGET, or the serial inter-
face.

• Configuration can now be done with a JSON object. These objects can be saved or uploaded, making
configuration in a production environment much easier and faster.

• Developers can easily crease their own configuration objects.

• The IPSetup windows utility can be used to locate a device, but not configure it.

4.1.3 RTOS

The low level code of the RTOS has been modified to support new features including:

• Increased the number of tasks from 64 to a user defined value.

• OS functions are now managed as C++ objects.

NetBurner, Inc.
4.1 Release 2.x to 3.x Overview 25

4.1.4 TCP

• Increased the maximum number of sockets from 32 to a user defined value. A Maximum value over 256 may
have an impact on performance.

4.1.5 Network Interfaces

• Many new interfaces supported

• Access to interfaces now requires looking at an Interface Object, rather than global variables such as ETHER-
NETIP. This was needed to support additional interfaces, a larger number of interfaces, and IPv6 capability.

4.1.6 SSL/TLS

• Updated to the latest protocols and ciphers (2.9.x also has the SSL/TLS updates).

• The process for generating compiled-in certificates has been made easier, but is slightly different.

• Devices can now generate certificates.

4.1.7 System Initialization

• A new function, init(), is now used to initialize stack, all interfaces, and network debugging.

4.1.8 NBEclipse

• Updated to Oxygen

• Can generate makefiles that can be used on command line builds.

NetBurner, Inc.
26 Migration Guides

4.1.9 GCC

• Updated to 8.1

4.2 Release 2.x to 3.x Porting Guide

4.2.1 Device Configuration

Previously device configuration was accomplished with IPSetup, a windows based program. In 3.x there are a
number of ways to configure the device that are independent of the host computer type. The primary method is
through the device's own configuration web server. In this way the device can be configured by a web browser on
any platform. There is also a serial interface configuration method.

• Can be configured by any web browser, and applications can be programmed into the device. Note: Autoup-
date and IPSetup are no longer used to download applications or configure the device. However, you can still
use IPSetup to discover a device's IP address.

• Devices can be found by typing discover.netburner.com in the web browser URL field.

• The underlying configuration mechanism is handled through a JavaScript Object Notation (JSON) object.
This will be described in more detail later, but the important point is that it provides a simple interface that
can be used by non-embedded developers (e.g. web developers) to interact and configure the device. The
implementation is also designed to enable you to add any application specific information to be stored and
accessed in the same manor, such as calibration values, set points, etc.

• You are able to create your own configuration web interface that will appear in place of the default interface.
In this way you can organize and present data in the appropriate way for your customers, as well as add your
own custom logo, images and descriptions. Examples are provided.

4.2.2 Configuration Procedure

• Connect your NetBurner device to a network with Internet access.

• Open a web browser on your host computer and go to discover.netburner.com. You will see a list of
devices on your network.

• The "Device" link will take you to the device's web page. The "ConfigPage" link will take you to the device's
configuration web page as shown below:

A sample JSON object is shown below:


{
"Config":{
"AppData":{},
"Sys":{
"Application":"Simple HTML Example",
"Boot":{
"Abort":"A",
"BootBaud":115200,
"BootDelay":2,
"BootQuiet":false,
"BootUart":0,
"Password":"",
"SerialConfig":{
"Choices":"DuringBoot, AlwaysEnabled, PauseAfterBoot, Disabled", "Value":"DuringBoot"
},
"User":""
},
"NetIf":{
"Ethernet0":{

NetBurner, Inc.
4.2 Release 2.x to 3.x Porting Guide 27

"DeviceName":"",
"DhcpDiscoverSec":1,
"DiscoveryObfuscate":true,
"DiscoveryReportInterval":900,
"DiscoveryReportUrl":"discover.netburner.com/DevicePost",
"IPv4":{
"ActiveAddr":"10.1.1.73",
"ActiveDNS1":"10.1.1.1",
"ActiveDNS2":"0.0.0.0",
"ActiveGate":"10.1.1.1",
"ActiveMask":"255.255.252.0",
"AutoIPAddr":"169.254.131.245",
"AutoIPEn":true,
"Mode":{
"Choices":"DHCP,DHCP w Fallback,Static,Disabled", "Value":"DHCP"
},
"StaticAddr":"0.0.0.0",
"StaticDNS1":"0.0.0.0",
"StaticDNS2":"0.0.0.0",
"StaticGate":"0.0.0.0",
"StaticMask":"0.0.0.0"
},
"IPv6":{

"ActiveAddr":["2602:306:b8e9:c83f::14c0","2602:306:b8e9:c83f:203:f4ff:fe0b:83f5","fe80::203:f4ff:fe0b:83f5"],

"ActiveDNS":["2602:306:b8e9:c83f:208:a2ff:fe0c:b081","2602:306:b8e9:c83f:208:a2ff:fe0c:b081"],
"ActiveRoute":["fe80::1:1"],
"Mode":{
"Choices":"DHCP,DHCP w Fallback,Static,Disabled", "Value":"DHCP"
},
"StaticAddr":"::",
"StaticDNS1":"::",
"StaticDNS2":"::"
},
"MAC":"00:03:F4:0B:83:F5"
}
},
"Platform":"MODM7AE70"
},
"Version":8,
"Reboot":false
}
}

If you were writing a web interface and need only the data under Ethernet in the tree, it can be accessed by:
http://10.1.1.71:20034/UI.html?CONFIG/SYS/NETIF/Ethernet
To obtain just the IP address: http://10.1.1.71:20034/UI.html?CONFIG/SYS/NETIF/←-
Ethernet/IPv4/ActiveAddr

4.2.3 Recommended Examples

The following examples are recommended to begin evaluating the platform. They are located in the
\nburn\examples directory.

• ShowInterfaces

• \Configuration\Web\BasicWebConfig

4.2.4 Configuration Security

One of the features of NetBurner 3.0 is that each device is configured though its own configuration web interface.
Data sent and received through the network interface has three options for security:

• Open: No security, plain text

• Obfuscated: Encrypted, but without TLS and a secure certificate and private key

• Secure: Encrypted with TLS and a certificate and private key

Each NetBurner device generates a default certificate and private key, which is stored in its internal flash memory,
which can be used to secure the connection as a self-signed certificate. You can also use the device’s private key
to create your own externally self-signed certificate, or have a certificate issued by a recognized third party. The
externally signed certificate can then be installed by overwriting the device's default key.

NetBurner, Inc.
28 Migration Guides

4.2.4.1 Cautions When Using the Jumper Recover Procedure on a Device

Each device has a location to insert a shorting jumper to reset the module in the event of a catastrophic software
problem, such as downloading an application image that corrupts flash memory or crashes. This recovery procedure
will erase all of flash memory and download a recovery image. A new private key and certificate will then be
generated. In such a case, any external self-signed or third party certificates will no longer be valid since the private
key will have changed. A new certificate will have to be created from the new private key.

4.2.5 Device Application Updates

Note

The AutoUpdate utility is no longer used for download application to your device.

You will notice there is an Update Application on the web page. Application are now uploaded using the
web interface. Alternatively, there is a windows executable that can be run from the command line in
\nburn\pcbin\nbupdate.exe. Application images are now .bin files, they are no longer .s19 files.
If building in NBEclipse the .bin file will be located in your workspace project's release folder. The format using
nbupdate.exe is as follows: nbupdate <application .bin file> <device IP>

4.2.6 Eclipse and Development Tools Updates

Summary of new and improved features:

• Eclipse has been updated to the Oxygen version. It also takes advantage of multiple processor cores on the
host computer to greatly speed up compile times. Note: if using the command line to build you can use make
-j to use multiple cores.
• GCC has been updated to version 8.1.

• Each project now has its own NetBurner library. Now any system changes you make will be specific to the
project, and each project can have its own modifications.

• The makefile implementation is now identical for NBEclipse and command line builds.

NetBurner, Inc.
4.2 Release 2.x to 3.x Porting Guide 29

4.2.7 SSL/TLS

Improvements include:

• Moving from NetBurnerSSL to wolfSSL

• Support for a much broader range of ciphers

• Support for DER encoded certificates

• Support for server-side peer verification

• Support for onboard certificate generation

• Substantial improvements to SSL stability

• Support for client side certificate authority lists

• A cleaner interface for using certificate authority lists, as well as the ability to dynamically alter them
during runtime

• Faster key generation for onboard certificate generation

• Lays the groundwork for future improvements

– TLS v1.3
– FIPS 140 Ready
– DTLS

4.2.8 Notes on Porting From Previous Revisions

• Big endian vs. little endian. The ColdFire processors have a bin endian architecture, while ARM processors
are little endian. If you have code that manipulates 16-bit or 32-bit numbers that relay on a big endian format
you will need to ensure it works for both types.

• The typical startup sequence of function calls: IntializeStack(), GetDhcpIfNecessary,


EnableAutoUpdate(), etc have been replaced with a single call: init() which is declared in
the header file init.h. You will need to remove header files such as:
#include <startnet.h>
#include <autoupdate.h>
#include <dhcpclient.h>
#include <NetworkDebug.h>

• The real-time operating system has been modified to increase performance and capabilities. The header file
ucos.h is now nbrtos.h. Any RTOS function calls that had UCOS in related names have been modified
to reflect this.

• UCOS_ENTER_CRITICAL has been replaced with NBRTOS_ENTER_CRITICAL.

• The StartHTTP() function is now StartHttp() and StartHttps().

• Callbacks have been added to replace the MyDoGet() and MyDoPost() functions. See HTML Processing for
examples on usage.

• A new function has been added to wait for an active network connection, meaning the device has link. A
typical startup sequence will be:
init();
WaitForActiveNetwork(TICKS_PER_SECOND * 10);
StartHttp(); // or StartHttps();

NetBurner, Inc.
30 Migration Guides

• Types such as WORD, DWORD, etc have been replaced with uint16_t, int16_t, uint32_t, int32_t,
etc.

• Registering a name with a DHCP server is no longer done by assigning a string to extern const char
pDHCPOfferName. It is now set by assigning a name to the configuration tree JSON object element:
CONFIG:SYS:NETIF:Ethernet:DeviceName.
• Runtime calls to the network interface such as EthernetIP() have been removed. Please refer to the
ShowInterfaces example for methods to obtain runtime interface data.

4.2.9 Porting I2C From MCF52xx Based Products to MODM7AE70

Applicable Platforms:

• MOD5234

• MOD5270

• MOD5272

• MOD5282

• PK70EX

• SB70

• SB70LC

• SB72

MCF52xx platforms have a singe I2C peripheral, therefore the I2C driver API knew which signal pins to use and the
set of functions to send/receive data only had to consider a single peripheral. ARM based platforms have many I2C
peripherals, so a different type of driver/API is required. For example, with just a single I2C peripheral, an I2CSend()
function is all that is needed. If there are many I2C peripherals, the driver must be able to send on any of them.
This applies to all I2C functions: read, write, status, error detection, etc.

The most robust and scalable implementation is to use I2C peripheral C++ objects. You do not need to be a C++
programmer to use these objects in your application, other than to understand the format to call a member function
of the object instead of a global C function call. For example, if in C you had a global function named GetI2CStatus(),
it would now be a member function of a specific I2C object/peripheral and the call would be MyI2CObject.GetI2←-
CStatus(). This method enables your application to handle multiple I2C peripherals, and the status function knows
which peripheral to use because it operates on the object. Note that since the status function is called as a member
function of the object, it is common to take that into consideration in the member function name, so it would likely
be MyI2CObject.GetStatus().

In this way you can easily handle multiple I2C peripherals: MyI2CObject1, MyI2CObject2, MyI2CObject3, etc. Your
application code does not need to manage and continuously check for which peripheral is being used, such as
having a C style array of I2C peripherals.

The I2C driver for MCF52xx devices in the NNDK 2.x tools has the interface listed below. Note that there is a bit
of C++ even in the old driver in terms of the function prototypes. You are likely calling some of these functions
without any parameters, or with less than all the parameters listed. In C++ default parameters are specified in the
function prototype with the '=' sign. So you can call I2CInit() with no parameters in your application, and the default
parameters in the function prototype will be used.

NetBurner, Inc.
4.2 Release 2.x to 3.x Porting Guide 31

void I2CInit( BYTE slave_Addr = 0x08, BYTE freqdiv = 0x3C )


BYTE I2CSend( BYTE val, DWORD ticks_to_wait = I2C_RX_TX_TIMEOUT )
BYTE I2CSendBuf(BYTE addr, PBYTE buf, int num, bool stop = true)
BYTE I2CRead( PBYTE val, DWORD ticks_to_wait = I2C_RX_TX_TIMEOUT )
BYTE I2CReadBuf( BYTE addr, PBYTE buf, int num, bool stop = true )
BYTE I2CStart( BYTE addr, bool Read_Not_Write, DWORD ticks_to_wait = I2C_RX_TX_TIMEOUT )
BYTE I2CStop( DWORD ticks_to_wait = I2C_RX_TX_TIMEOUT )
BYTE I2CRestart( BYTE addr, bool Read_Not_Write, DWORD ticks_to_wait = I2C_RX_TX_TIMEOUT )
void I2CResetPeripheral()
bool I2CRXAvail()
DWORD I2CTXAvail()
BYTE I2CGetByte()

The I2C implementation in the 3.x tools for ARM platform uses the I2CDevice Class. For example, on the MODM7←-
AE70, an I2C object to select an I2C peripheral to interface with an EEPROM can be declared as (code taken from
the I2C Pic Kit example):
#define I2C_MODULE_NUM 0 // use I2C0/TW0
#define I2C_EEPROM_ADDRESS (0xA0 » 1) // Microchip 24LC0B EEPROM, 2Kbit (256 x 8)
I2CDevice EepromDevice(i2c[I2C_MODULE_NUM], I2C_EEPROM_ADDRESS);

The declaration of the I2CDevice creates an I2C object for I2C peripheral module 0 at the specified EEPROM I2C
address. Creating the object also handles the initialization, so the equivalent of I2CInit() is not needed. Once we
have created the object, all we need to do is call the member functions to control it in the format: Eeprom←-
Device.<member function>. For example, to send/write a single byte value of 0x60 to address 0x01 of the
EEPROM: EepromDevice.writeReg8(0x01, 0x60);. Note that in ARM terms, the I2C addresses are referred to as
registers. writeReg8() refers to 8-bits.

You will also note that the return values use the C++ operator "::". Whereas the 2.x driver returned an unsigned
8-bit value (BYTE), the 3.x driver returns a typed value of Result_t. Using typed values will result in more robust
application code since the compiler can detect when a return value is used incorrectly. the "I2C::" result types are
(be sure to view the latest information in the 3.x NetBurner API manual):
I2C_RES_ACK Acknowledged
I2C_RES_NACK Not acknowledged
I2C_RES_ARB_LST Arbitration listening
I2C_RES_BUSY Bus is busy
I2C_RES_ARG Bad argument

The corresponding functions to the MCF52xx I2CDevice driver are below. This is the recommended driver.
// Constructor to create object, also initializes the I2C peripheral. The pInterface
// parameter will be i2c[0], i2c[1] or i2c[2], representing the 3 I2C peripherals.
// The optional 3rd parameter is normally left as a default. It can be used to set the
// number of register address byte to send, from 0 to 3.
// Example: I2Cdevice EepromDevice(i2c[0], address);
I2CDevice(I2C & pInterface, uint8_t deviceAddress, uint8_t numAddressBytes = 1)
Result_t writeReg8(uint32_t reg, uint8_t dat)
Result_t writeRegN(uint32_t reg, uint8_t *buf, uint32_t blen)
Result_t readReg8(uint32_t reg, uint8_t &dat)
Result_t readRegN(uint32_t reg, uint8_t *buf, uint32_t blen)
Start, Stop and Restart are taken care of in the writeRegN and readRegN functions.
In situations in which a restart was used for sending more than 1 byte as an address,
the numAddressBytes parameter in the I2CDevive constructor can be used.
void resetBus()
void setup(uint32_t busSpeed) // change bus speed

If you wish to have more manual control over the I2C transactions, you can create an I2C object instead of an
I2CDevice object:
// Create an I2C peripheral object. The module parameter for the MODM7AE70 can be 0, 1 or 2.
I2C(int module)
Result_t writeReg8(uint8_t devAddr, uint32_t reg, uint8_t data)
Result_t writeRegN(uint8_t devAddr, uint32_t reg, uint8_t *buf, uint32_t blen)
Result_t readReg8(uint8_t devAddr, uint32_t reg, uint8_t &data)
Result_t readRegN(uint8_t devAddr, uint32_t reg, uint8_t *buf, uint32_t blen)
void setup(uint32_t busSpeed)
Result_t DoTransaction(I2CTxn_t *pTransaction, bool bRepeatedStart = false);
void resetBus()

In NNDK 3.x there is also a third option. ARM refers to the I2C as a two-wire interface, or a wire interface in general.
A WireIntf class is available for even more manual control. It was written for those familiar with Arduino drivers, but
can be used for more detailed control in general. Please refer to the NNDK 3.x documentation for details.

NetBurner, Inc.
32 Migration Guides

4.3 Upgrade 5441x Platforms to 3.x

4.3.1 Introduction

The ColdFire 5441x platforms were created before NetBurner 3.x, but they can be easily upgraded. The primary
difference is in the device configuration. For reverse compatibility with prior tool sets, all 5441x devices are shipped
with a factory application built with the 2.x release so they work with the IPSetup and AutoUpdate utilities. Once you
download an application created in NetBurner 3.x, the device will then have the advantages of the 3.x features. The
upgrade procedure consists of first loading a conversion application as described below, thereafter you can load 3.x
applications directly.

4.3.2 5441x Product Models Numbers

• MOD54415

• MOD54417

• NANO54415

• SB800EX

4.3.3 3.x Update Procedure

• Connect the NetBurner device to the network and verify you can see the device's IP address with Autoupdate.

• Download your 3.x application. The current shipping factory application can process a 2.x or 3.x image file.
Note: If you have a device prior to March 2021, it may have an application that can only process a 2.x image
file. In that case, use the Autoupdate utility to first load the appropriate application located in the folder:
\nburn\platform\<platform name>\original\. For example: "MOD5441X-3p0-Update_←-
APP.s19", and execute the update. You will now be able to create and run 3.0 applications on the device.

4.3.3.1 3.x Update Using Alternate Monitor

As of April 2021, the Alternate Boot Monitor has the ability to process a 3.x image file (older revisions must use the
previous procedure by loading the update application). Alternate Boot Monitor revisions must be the revision shown
below or later:

Platform Revision
MOD5441x 1.11
NANO54415 1.05
SB800EX 1.05

If you have a device with an earlier Alternate Boot Monitor revision and wish to update it, please contact NetBurner
Support at https://support.netburner.com.

4.3.4 Procedure to Revert Back to 2.x

If you wish to revert back to 2.x, use the jumper recover procedure. It will erase all configuration information and
boot to the Alternate Boot Monitor. From there you can download applications from the 2.x tool sets.

NetBurner, Inc.
Chapter 5

NBEclipse

There are three different ways to develop with the NetBurner Tools:

1. Install NBEclipse, which provides project management, a make system, and an editing environment.

2. From the command line using the make utility. Each example in the \nburn\examples folder provides
and example makefile.

3. Use your own editing environment, and have that environment call the makefile for the project.

The documents in this section will describe how to use the NBEclipse environment and command line.

Getting Started Guide


Add a Library to a Project
Change The IP Targeted By A Project
Change CompCode Settings for EFFS

5.1 Getting Started Guide

5.1.1 Introduction

5.1.1.1 How to Use This Guide

The goal of the NetBurner Eclipse Getting Started Guide is to familiarize new users with the NetBurner Eclipse
(NBEclipse) interface and basic operation. NBEclipse is based on the standard Eclipse release with additional
features to support development with NetBurner hardware, such as the ability to locate your NetBurner device on
the network, and download an application to the device’s flash memory. Topics include:

• How to create a new project

• Import, compile, and execute example programs

• Debug an example program

• Use the application wizard to create a new program

• Various tips on useful features of the NBEclipse environment

NetBurner, Inc.
34 NBEclipse

5.1.1.2 Source Code for Example Programs

Source code for the examples in this document are located in the \nburn\examples directory of your NetBurner
tools installation.

5.1.1.3 Hardware Setup

This document assumes you have a working hardware platform on which you can run the examples. Your Net←-
Burner development kit hardware is pre-programmed with an example application at the factory. Before executing
the examples in this document, it would be a good idea to connect your NetBurner device to your computer and
verify you have serial and network communication with the device as described in the NNDK Quick Start Guide.

5.1.1.4 Software Installation

NetBurner software tools run on Microsoft Windows and OSX. When you receive your development kit there will
be a bright red card with a keycode. Register this keycode at https://support.netburner.com to
download the development tools.

5.1.1.5 Upgrading From a Previous Installation

Do not install over an existing version when upgrading from a previous version of the NetBurner tools. The upgrade
requires that you either rename or uninstall the existing installation directory. The recommended procedure is as
follows:

1. Backup any existing projects you want to save, especially if they are in the NetBurner tools installation direc-
tory.

2. Rename the existing tools installation folder. For example, if upgrading from revision 2.8.8, rename \nburn
to \nburn2p8p8, then install the new version to \nburn. This way you can always get back to the
previous installation and environment by renaming \nburn2p8p8 to \nburn.

5.1.1.6 Java Installation

NBEclipse requires the 64-bit Java Runtime Environment (JRE) revision 1.8 or higher. If there is no JRE installed,
then you will receive an error message when starting NBEclipse stating that it cannot find the JRE executable. The
JRE is free from http://java.sun.com. Download either the Java SE (Standard Edition) Development Kit
(JDK) or Runtime Environment and follow the installation prompts. You may need to restart your computer after
installation is complete.

Note

NBEclipse tools version prior to 3.0 require the 32-bit JRE.

NetBurner, Inc.
5.1 Getting Started Guide 35

5.1.1.7 Debug Port

Throughout this guide, we will refer to the "serial debug port". The serial debug port is one of the RS-232 ports
that can be used to interact with your NetBurner device in the example programs. Stdout, stdin, and stderr are
mapped to the debug port by default, so when you use functions like printf(), scanf(), gets(), they read and write
to the serial debug port. Mapping of the stdio is configurable, as you can disable the serial debug port and use
it as a general purpose UART, or reassign the stdio file descriptors to use other serial or network interfaces.
Debugging in NBEclipse on network-enabled platforms will occur through the Ethernet connection, while debugging
on non-network platforms will use the serial port.

5.1.2 Platform Overview

5.1.2.1 NetBurner Development Platform Choices

Your NetBurner Network Development Kit provides two options for development:

1. NBEclipse Integrated Development Environment (IDE)

2. Command line tools using the GNU make utility.

The choice of what platform you wish to use depends on personal preferences. The command line tools use
makefiles, which are included for every example program and can be used as a starting point for your own makefiles.
The make utility can also be invoked from within other IDEs and code editors such as Microsoft Visual Studio.

5.1.3 Project Management

The following points are useful to users who have not used a similar type of project manager. There are three
primary methods to maintain and build a project:

1. Use NBEclipse to manage the project with the project files located in the NBEclipse workspace. This is the
recommended method.

2. Use NBEclipse to manage the project with the project files located in an existing directory outside the NBE-
clipse workspace.

3. Configure NBEclipse to use an external makefile that you maintain.

NetBurner, Inc.
36 NBEclipse

5.1.3.1 NBEclipse Key Points

1. NBEclipse uses a "workspace" in which projects are created and source files are copied.

2. All source code files must reside in the project's "src" folder.

3. If using the web server, all HTML and associated files must reside in the project's "html" folder.

4. All recognized files in a project directory will be compiled. Recognized files have extensions of .c, .cpp, and
.s (.s is an assembly language file).

5. The Project Explorer tab on the left side of the NBEclipse IDE is a navigation window like a file browser, it is
not a file project manager. All recognized files will be built as part of the application. If you have non-project
related files in your project directory and wish to see only the project files in the tab, you can select a filter to
display only source code files.

6. To download an application to you NetBurner device, select "Run as NetBurner Application" from the project's
Build Targets folder.

7. Application build output files such as .o, .elf, .map,.bin and .s19, and .bin will be written to project sub-
directories named "Release" and "Debug" that correspond to the type of build executed. The .bin and .s19
files are the application image files.

8. The keyboard shortcut <cntl> b will build the active project.

9. The keyboard combination of <cntl> <space> invokes function auto-complete.

5.1.4 Creating Projects and Importing Files

This is the most common type of project creation. It will be used to build and run example programs, and is a good
starting point for your own projects. By "empty project" we are referring to creating a project without running the
Application Wizard to auto-generate a minimal application. After we create the project we will use the project import
feature to import source code files from an example into the project.

1. Create an empty project.

2. Import source files by right-clicking on the project name and using the Import feature from the drop down
menu.

3. Build the application and download to your NetBurner device.

NetBurner, Inc.
5.1 Getting Started Guide 37

5.1.4.1 Create a New Project

From the main menu, select File->New->Project:

Figure 5.1 Create a New Project

5.1.4.2 Select the NetBurner Project Type

Select the NetBurner project type, then select Next:

NetBurner, Inc.
38 NBEclipse

Figure 5.2 Select Product Type

5.1.4.3 Specify Project Name and Executable Option

Enter your project name in the Project Name field (it is best not to use spaces with gcc tool chains). In this example
we entered "SimplHtml", since that is the example we will import. Make sure the Executable is set to: "NetBurner
C++ Project".

Warning

Be sure to select NetBurner Device Executable, do not select the C/C++ option.

Note

You can create a project in a directory outside of your workspace by unchecking the Use Default Location
checkbox, and using the Browse button to select the directory containing the source files.

NetBurner, Inc.
5.1 Getting Started Guide 39

Figure 5.3 Select NetBurner Device Executable

5.1.4.4 Project Configurations

The default options for the project configurations are both Release and Debug. Leave the defaults and select Next.

NetBurner, Inc.
40 NBEclipse

Figure 5.4 Project Configurations

5.1.4.5 Select Your NetBurner Target Device

There are two ways to select your target NetBurner device:

1. Click on the Search button to bring up a list of NetBurner devices on your network (device must be opera-
tional).

2. Manually: Click on the Target Platform drop down box to select your platform, then type in the IP address.

NetBurner, Inc.
5.1 Getting Started Guide 41

Figure 5.5 Search for devices

When using the Search feature, select the device in the list that corresponds to the MAC address printed on
the label of your NetBurner device. In the image below we can see the device type, MODM7AE70, it's MAC
address, and it's IP address. It will then fill in the platform and IP address for you. When done select Next.

NetBurner, Inc.
42 NBEclipse

Figure 5.6 Successful search entry

5.1.4.6 Application Wizard

Since we are creating an empty project and will be importing our own source files we do not want to select any items
here. However, if you wish to generate a minimal application using the Application Wizard, select both Standard
Initialization and Web Server. This will generate a main.cpp source file to use as a starting point for your application.

Select Finish to complete the project creation.

NetBurner, Inc.
5.1 Getting Started Guide 43

Figure 5.7 Skip Application Wizard code generation

5.1.4.7 New Project Created

You will now see your new project in the Project Explorer pane. At this point we have a project, but still need to
import our source files (if you did not use the Application Wizard).

Figure 5.8 A new project has been created

NetBurner, Inc.
44 NBEclipse

5.1.4.8 Import Example Source Files to the Project SRC Folder

The next step is to import the source files of an example. NBEclipse uses a make utility to manage projects, and
will attempt to build all source files in your project directory. Do not import non-source code files, such as .o, .elf,
.map, .mk, auto-generated htmldata.cpp files, etc. NBEclipse will store all output files similar to these in project
subdirectories named "Release" and "Debug" corresponding to the build type preformed.

For this demonstration we will use "\nburn\examples\Web\SimpleHtml". The first step is to right-click on your project
in the NBEclipse Project Explorer pane:

Figure 5.9 Select Import

Next select the General->File System, then select Next:

NetBurner, Inc.
5.1 Getting Started Guide 45

Figure 5.10 Select File System

Select the Browse button to bring up a file selection window, navigate to \nburn\examples\Web\Simple←-
Html, and select the OK button:

NetBurner, Inc.
46 NBEclipse

Figure 5.11 Select the Simple HTML Example

Once back at the File System dialog box, click on the ">" symbol next to the SimpleHtml name to open the
tree structure. You can see that there is a folder named src and a folder named html. We want the files in both
folders, so select the checkbox next to the name "SimpleHtml", which will select all folders underneath it. Note: the
makefile you see is only used for command line builds, but it does no harm to import it as well.

NetBurner, Inc.
5.1 Getting Started Guide 47

Figure 5.12 Select all SimpleHtml files for import

Select Finish, which will import the files and automatically build the project. You can view the status of the build
process in the console window, located in the lower right corner of your screen. In the Project Explorer, click on the
">" symbol next to SimpleHtml. Some important items of note:

• Build Targets has two functions: downloading code to your device, and rebuilding the system libraries if
needed.

• The src folder contains all your source code files, such as main.cpp.

• The html folder contains all your web based code.

• The overload directory is used to override any system library files. See the example in \nburn\examples\Overload←-
Directory for more details.

NetBurner, Inc.
48 NBEclipse

Figure 5.13 Import complete

5.1.4.9 Open your main.cpp source file

Clicking on the ">" symbol next to the src folder, you can open main.cpp in the editor

NetBurner, Inc.
5.1 Getting Started Guide 49

Figure 5.14 Open main.cpp

5.1.4.10 Project Import Complete

At this point you have a project complete with source code files. You can use the editor to modify both src and html
files. If you wish to open a html file in text mode to do things like add dynamic content tags such as CPPCALL,
VARIABLE, etc, right-click on the html file and use the Open With option to select the text editor:

NetBurner, Inc.
50 NBEclipse

Figure 5.15 Open HTML files in text mode

By default, any time you modify and save a source file, the system will automatically build the application. If
you prefer to turn off the auto-build option, to build the project: from the main menu select Project->Build Project,
or use the <cntl> b keyboard shortcut.

NetBurner, Inc.
5.1 Getting Started Guide 51

Figure 5.16 Build the Project

5.1.4.11 Download the Application to Your Device

Now that an application image has been built, the next step is to download the binary image to your NetBurner
device. NBEclipse can simultaneously handle multiple NetBurner hardware platforms of the same or different types.
For example, multiple MODM7AE70 core modules, or a mix with some MOD54415 modules. Targeting a project to
a specific hardware device, is accomplished by creating a Run Configuration for release mode project builds, or a
Debug Configuration for project debug builds. An important part of such a configuration is associating the device's
IP address with the project so NBEclipse knows where to download the project's binary image.

When you create a new project and select the download option for the first time, NBEclipse will create a Run
Configuration for you (Run and Debug Configurations can also be created manually). First select your project by left
clicking on it in the Project Window:

NetBurner, Inc.
52 NBEclipse

Figure 5.17 Select Project

Then click on the Run button in the upper right corner of NBEclipse:

Figure 5.18 Select Run Button

The Run As dialog box will appear. Select NetBurner Application, which will run the application on the re-
mote system: When you click the OK button, NBEclipse will download the binary image to the remote device and
reboot it.

NetBurner, Inc.
5.1 Getting Started Guide 53

Figure 5.19 Select Run Application

The application should now running on the device. If you do not remember the IP address of the device, you
can find it using the "Find" window in the lower left of NBEclipse. In the screen shot below there are 3 devices. The
device running SimpleHtml has IP address 10.1.1.196.

Figure 5.20 Find Device IP

NetBurner, Inc.
54 NBEclipse

5.1.4.12 View the Device Web Page

Opening a web browser and typing 10.1.1.196 in the URL field:

Figure 5.21 HTML Page

If you now look at the upper left side of NBEclipse, you will see the configuration set to Run, and the project
set to SimpleHtml for the configuration.

Figure 5.22 Run Configuration

5.1.4.13 View Serial Port Status Messages with MTTTY

All NetBurner examples make use of the debug/console serial port to provide status messages. You will need to
have a serial connection to your device either through USB or the DB9 on the development board, depending on
your hardware configuration. You can then use the MTTTY serial terminal application to view the serial output. To
open MTTTY:

NetBurner, Inc.
5.1 Getting Started Guide 55

Figure 5.23 Open MTTTY

When the device boots the SimpleHtml application you will see:

Figure 5.24 MTTTY Output

5.1.5 Debugger

In the previous section we created and ran a project in release mode. To use a debugger, the application must be
built in debug mode. All debuggers require the code be built in a different manor than a release build:

NetBurner, Inc.
56 NBEclipse

• Code optimization is disabled

• If the platform uses external SDRAM with the internal SRAM acceleration for stacks, buffers and variables, it
is disabled
NBEclipse uses a network debugger. This means that an application must be able to at least boot through
network initialization so the NBEclipse agent can connect to the GDB stub on the target device.

5.1.5.1 Starting a Debug Session

We will pick up right where we left off for the SimpleHtml example project in the previous section. First, lets open
main.cpp and add a variable. UserMain() is shown below:
void UserMain(void *pd)
{
init(); // Initialize network stack
StartHttp(); // Start web server, default port 80
WaitForActiveNetwork();
iprintf("Application: %s\r\nNNDK Revision: %s\r\n", AppName, GetReleaseTag());
while (1)
{
OSTimeDly(TICKS_PER_SECOND);
}
}

Add two lines of code to create an integer and increment it:


int i = 0; and i++;

So UserMain() becomes:

void UserMain(void *pd)


{
init(); // Initialize network stack
StartHttp(); // Start web server, default port 80
WaitForActiveNetwork();
iprintf("Application: %s\r\nNNDK Revision: %s\r\n", AppName, GetReleaseTag());
int i = 0; // <--- Declare variable
while (1)
{
OSTimeDly(TICKS_PER_SECOND);
i++; // <--- Increment variable
}
}

Previously for the Run Configuration and download we clicked on the green play button in the upper right corner of
NBEclipse. This time we will click on the debug button, which is next to it on the left:

Figure 5.25 Select Debug Configuration

It will take a few seconds for the debugger to connect, and the NBEclipse Perspective will change from the
NetBurner perspective to the Debug perspective:

NetBurner, Inc.
5.1 Getting Started Guide 57

Figure 5.26 Debug Perspective

At this point the code is running. To set a breakpoint on our new variable, double click to the left of the line
of code. In this example it is just to the left of line 29:

Figure 5.27 Set Breakpoint

The screen shot below shows the program stopped at line 29. The Variables window in the upper right shows the
variable 'i', which has incremented 7 times so far.

NetBurner, Inc.
58 NBEclipse

Figure 5.28 Stopped at Breakpoint

The debugger operations are controlled with the tool bar at the top of the screen. If you hover the cursor
over the icon the tool tip will describe what it does. Common features are:

• Resume: Available when stopped at a breakpoint. Selecting it will resume the application and stop at the next
breakpoint.

• Terminate: Disconnects the debugger from the target device. The device will resume execution without any
breakpoints.

• Disconnect: Identical to Terminate.

• Step Into: Single step into a function call.

• Step Over: Single step to the next line of code in the current function.

• Step Return: Execute until current function returns.


Notes on debugging:

• You can switch between the Debug perspective and NetBurner perspective using the NetBurner and Debug
icons in the upper right corner of the screen.

• You can edit and build your application from either perspective.

• Hovering the cursor over variables, macros and functions in the source code window will display information
on that item.

• The upper left window displays the RTOS task stack.

• It is recommended to terminate a debug session before starting a new one.

• The three icons at the top left of the screen: build, debug and stop, are not used by either perspective.

NetBurner, Inc.
5.1 Getting Started Guide 59

5.1.6 Rebuilding Projects & Libraries

5.1.6.1 Rebuild Project Source Files

A project "clean" will rebuild all of the project's source code files. It does not effect the library system files associated
with the project. From the Project Explorer pane, right-click on your project, then select Clean Project:

Figure 5.29 Rebuild project files

5.1.6.2 Rebuild Library Files

This is normally not necessary, but to force a rebuild of the NetBurner library files associated with a project,
double-click on Clean Project Library in the Build Targets tree:

NetBurner, Inc.
60 NBEclipse

Figure 5.30 Rebuild a project library

5.2 Add a Library to a Project

NBEclipse includes the most common libraries by default. However, there are times you will need to tell the build
system to include additional libraries, such as if your application uses the Embedded Flash File System (EFFS) for
flash memory cards, in which case you need to add the FatFile library.

Note: If you are building a project that uses EFFS functions, and have not added the FatFile library, you will see
many link errors for functions that start with f_ and fm_.

To add a library:

• In NBEclipse, right-click on your project, and select "Properties".

• Select "C/C++ Builds -> Settings" on the left-hand side.

NetBurner, Inc.
5.3 Change The IP Targeted By A Project 61

• Select "GNU C/C++ Linker -> Libraries" under the "Tool Settings".

• In the "Libraries" list box, add "FatFile" by using the add icon in top-right corner of the list.

• In the "Libraries Search Path" list box, add the path to the library. For example, for MOD5441x device, the
path is: \nburn\platform\MOD5441X\original\lib. Note: the naming convention for gcc is as
follows: the name of the library is actually libFatFile.a, but in the Libraries entry box you only use what comes
after "lib" and do not use the .a suffix. In this case, we just use "FatFile".

Note

The other common library to add is the EFFS-STD library: StdfFile. EFFS-FAT is a FAT32 library for flash
memory cards. EFFS-STD is used to create a file system in the flash memory chip on the device.

5.3 Change The IP Targeted By A Project

If the IP of your device changes (for example, if you unplug it and it is assigned a different IP when you plug it back
in), you will need to tell the build system to target a different IP.

To change the targeted IP:

• In NBEclipse, click on "Project" from the top menu, then click "Properties".

• In the left-hand panel of the Properties menu, click "NetBurner Options".

• Change the targeted IP address in the right-hand side of the panel.

5.4 Change CompCode Settings for EFFS

The CompCode utility is used in the final stage of a build to compress an application image. The COMPCODE
memory address range defines the amount of space available as application space so programming an application
in flash memory does not overwrite any of the space allocated for the EFFS-STD file system. Documentation on
the memory map for your particular device can be found in the Platform Reference section of this document.

To change the CompCode memory address range for the application in NBEclipse:

1. Right-click on your project, and select "Properties".

2. Select "C/C++ Builds > Settings" on the left-hand side.

3. Select "NB Compcode". In the All Options section the current value of the application memory range is
displayed. In this example it is a NANO54415 platform. To make the next step easier, highlight and copy the
memory address range.

NetBurner, Inc.
62 NBEclipse

Figure 5.31 Compcode default values

4. Select the NB Compcode > General tab. If the current value is the factory default, you will see the macro
${COMPCODEFLAGS} displayed. This is the value that is read from the factory default file.

NetBurner, Inc.
5.4 Change CompCode Settings for EFFS 63

Figure 5.32 Compcode default values

5. Delete ${COMPCODEFLAGS} and paste the memory range you copied in the previous step, then edit it
to specify the desired memory range. In this example we will change 0x800000 to 0x700000. So you end
up with: 0x04000 0x700000. This would be used to allocate 0x100000 bytes to the EFFS-STD file system
space. When you are finished editing, click on Apply or Apply and Close.

NetBurner, Inc.
64 NBEclipse

Figure 5.33 Compcode default values

NetBurner, Inc.
Chapter 6

PC Tools and Utilities

This guide describes the PC tools and utilities that run as stand-alone programs, as well as automatically as part of
the NetBurner development tools suite. The executable version of the tools are located in \nburn\pcbin, and
the source code is located in \nburn\pctools.

6.1 Multi-threaded TTY Serial Terminal (MTTTY)

Multi-Threaded TTY (MTTTY) is a serial terminal utility that you can use to communicate with the RS-232 serial
ports on your NetBurner device or development kit. It is multi-threaded in that you can run multiple instances of
MTTTY for each serial port.

MTTTY is commonly used for:

• Displaying status messages sent from the NetBurner device, such as when using iprintf()

• As a serial interface to any application

MTTTY can be started from:

• Inside NBEclipse by clicking on the MTTTY icon

• From the Windows NetBurner program group

• From a command line. The path is: \nburn\pcbin\mttty.exe

NetBurner, Inc.
66 PC Tools and Utilities

6.1.1 MTTTY FAQ

• The default serial port used for stdio for NetBurner devices is UART0.

• The DB9 connector pinout on NetBurner development boards will have the RS-232 rx and tx signals reversed,
so that a null-modem adapter is not required and you can use a straight-through serial cable.

• The DB9 connector pinout on NetBurner Serial-To-Ethernet devices, such as the SB700EX and SB800EX,
will be identical to a standard PC type pinout, so a null-modem adapter will be required. (The serial cable
that comes with the NetBurner development kits for these specific devices is a null-modem cable)

6.2 Wget

Primary method to program an application into a NetBurner device by posting the application file to the device's
config server. It is used automatically by both NBEclipse and the Makefile command line tools. The default flags
to call wget are as follows: wget -nv -O- --progress=dot:micro --post-file=<file name>
<Device IP>:20034/appupdate.htm
Wget also supports loading code onto a device that has been protected by username/password authentication. On
the command line, the device username and password are configured by setting the environment flags NBUSER
and NBPASSWORD. For example, in a make load, set the username and password as follows: make load
NBUSER=foo NBPASSWORD=bar. In NBEclipse, username and password are set via the project options.
Right click on a project and select Properties. Username and password text input boxes can be found under
NetBurner Options. Finally, if manually utilizing wget, use the following wget flags to set a username and
password: --user=foo --password=bar.

NetBurner, Inc.
6.3 NBUpdate 67

6.3 NBUpdate

Alternative method used to program an application into a NetBurner device by posting the application file to the
device's config server. It is invoked as part of the make system for NetBurner development kit NBEclipse and
command line builds. It can be replaced with WGET. The format is nbupdate <file name> <device
IP>

6.4 Smart Traps

While smart traps is not a specific PC application, the interface is accomplished by running the MTTTY serial
terminal. During software development it is possible for a software developer to download an application with a
coding error severe enough to cause an application to crash. Common causes of a system crash are: task stack
overflow, indexing an array out of bounds and bad pointer assignments. When a system crash occurs a device will
usually recover by a reboot of the system. The purpose of the SmartTrap utility is to provide more information about
the system when the crash occurred to assist with debugging the problem. Smart traps are automatically enabled
by the init() function. Note that smart traps are disabled when building an application in debug mode.

• SmartTraps are commonly used for debugging an application crash

• SmartTraps are used in conjunction with the MTTTY serial terminal program. The SmartTraps information
will be displayed on the debug serial port

NetBurner, Inc.
68 PC Tools and Utilities

Figure 6.1 Example Smart Traps Output

The output has four sections. It is beyond the scope of this document to go into detail on each of the pro-
cessor registers, please refer to the processor manual for more information, located in the \nburn\docs
directory of your development tools installation.

6.4.1 Trap Information

This section displays the processor status and error registers. The most significant is the Faulted PC, with is the
Program Counter register indicating the area where the fault occurred. In this example the program counter value
at the time a trap was detected is 0x02000152.

NetBurner, Inc.
6.5 Task Scan 69

6.4.2 Register Information

This section displays the processor's Address and Data registers.

6.4.3 RTOS Information

Identifies the RTOS Task Control Block and the current running task. The priority number is in hexadecimal. Traps
caused by stack overflows may corrupt this section of the report.

6.4.4 Task Information

This is a very useful section of the report. It identifies each task, as well as its current state, wait time, and call stack.
If you look at the Main task, you can see 6 entries with 0x02000152 (the faulted pc) at the left, and 0 at the right.
The value of 0 is the start of the call stack. Each hexadecimal address between those two numbers represents each
function that was called.

Each address can be related to the corresponding line number in the source code by using the WinAddr2Line utility.
By selecting the .elf file location and each address in the call stack you can determine the calling sequence starting
from 0 on the right and moving to the left. The last line signifies the end of the SmartTrap output. Since the boot
monitor is configured to "boot to application", the device reboots after the trap occurs.

6.5 Task Scan

TaskScan is an network connected debugging tool that can be used to view the RTOS tasks and status of your
running NetBurner application. This tool is unique in that it is active in the release build of your code, rather than the
debug build which is compiled without optimization. It is very useful to determine such things as why a specific task
is not running the way you had anticipated, if it is waiting on other tasks, and its call stack. TaskScan is only active
when the PC program generates a request, so it will not impact your release code execution speed otherwise.

The init() function will automatically include taskmon.h and call EnableTaskMonitor(). TaskScan requires that you
have the Executable and Linking Format (ELF) file for the specific application that is running on your NetBurner
device. The .elf file is created by the compiler each time you build your application. It contains information TaskScan
needs to link the application executable to the source code and task information. For example, if you have a project
named MyProject, a file named MyProject.elf will be created.

TaskScan is commonly used for:

• Determining which tasks are running, their state and call stack.

• Looking for blocked tasks.

TaskScan can be started from:

• From the Windows NetBurner program group

• From a command line. The path is: \nburn\pcbin\taskscan.exe

NetBurner, Inc.
70 PC Tools and Utilities

6.5.1 TaskScan FAQ

• You must have a valid IP address and mask that can communicate with your PC that is running TaskScan

• TaskScan essentially takes a snapshot picture of what your application is doing at the time your press the
Scan button. It does not otherwise impact the application

• You must have the exact .elf file used to create the application that is running on your NetBurner device to get
valid information
After starting the Task Scan application use the Browse button to locate your project's elf file, and the Find
button to locate the IP address.

Figure 6.2 Starting Task Scan

Then select the Scan button:

NetBurner, Inc.
6.6 WinAddr2Line 71

Figure 6.3 Scan Results

Figure 6.4 Task Scan Icons

6.6 WinAddr2Line

Utility to determine the source code location for a specified memory address and .elf file. This application is typically
used in conjunction with the SmartTraps utility when debugging an application that is crashing.

WinAddr2Line is commonly used for:

• Determining the source code address using a faulted program counter memory address from SmartTraps.

• If the cause of a crash is severe memory corruption due to bad pointers, it is possible for the Faulted Program
Counter to be pointing to an address in which not code exists. In this case WinAddr2Line will not be able to
provide a source code reference because no source code exists at that location.

WinAddr2Line can be started from:

NetBurner, Inc.
72 PC Tools and Utilities

• NBEclipse main tool bar

• The Windows NetBurner program group.

• The command line. The path is: \nburn\pcbin\winaddr2line.exe.

6.6.1 Using WinAddr2Line

• Use the Browse button to select the .elf file for your application and type in the hexadecimal memory address,
usually obtained by SmartTraps as the Faulted PC.

• Click on the Decode button.

Figure 6.5 Select file and enter address in hexadecimal

6.7 IPSetup

The Windows IPSetup utility was used for network configuration in releases prior to 3.x. Network configuration is
now down through the network configuration server on the NetBurner device.

6.8 AutoUpdate

Autoupdate was used for loading applications to a device in releases prior to 3.x. Updating code is now done
through the configuration server, nbupdate utility, or WGET.

NetBurner, Inc.
6.9 Virtual Comm Port 73

6.9 Virtual Comm Port

The virtual comm port driver for Windows creates a virtual serial port and associates it with a network IP address
and port number. It is typically used for legacy Windows applications without the ability to communicate over a
network.

6.10 CompHtml

This utility is used by the NetBurner make system. It takes the contents of a project's html directory, implements the
NetBurner dynamic web content scheme, callbacks, variables, access priorities, and mime types, and creates a file
named htmldata.cpp.

6.11 CompCode
This utility is used by the NetBurner make system for 5441x platforms. It processes a .s19 file into a compressed
binary with checksum and header.

6.12 flashpack
This utility is used by the NetBurner make system for ARM platforms. It processes the application.elf file into a
compressed binary with checksum and header.

NetBurner, Inc.
74 PC Tools and Utilities

NetBurner, Inc.
Chapter 7

Platform References

This section provides the hardware reference information for your NetBurner platform, including memory maps, boot
monitor and module recovery procedures in the event you download an application that is crashing the device.

• MODM7AE70 Platform Reference

• MOD54415, MOD54417 Platform Reference

• NANO54415 Platform Reference

• SB800EX Platform Reference

• SBE70LC Platform Reference

• Recovery: MODM7AE70, SBE70LC

• Recovery: MOD5441x, NANO54415, SB800EX

7.1 MODM7AE70 Platform Reference


7.1.1 Introduction
This document provides the memory map and locations of reference materials for those who wish to add additional
hardware to their NetBurner device.

7.1.2 MODM7AE70 Processor Information


The MODM7AE70 uses the Microchip ARM SAME70 microprocessor. The reference manual and datasheet provide
in-depth information on the processor, including register settings, bus configuration and timing information. It is
located in the <nburn_install>\docs\Arm directory of your NetBurner installation.

7.1.3 Datasheet
The datasheet for the MODM7AE70 module includes information on connectors, signal names, and operational
parameters. It is located on the MODM7AE70 product page: MODM7AE70 Datasheet.

7.1.4 Development Board Schematic


The MOD-DEV-70CR development board schematic is located in the <nburn_install>\docs\Net←-
Burner\platform\Schematics directory. This schematic can be used for design ideas in your own
hardware implementation for power, RS-232, RS-485, and SD Flash card implementation.

NetBurner, Inc.
76 Platform References

7.1.5 Memory Operation


The MODM7AE70 uses 3 types of memory:

• 2MB Flash memory for non-volatile system configuration storage, user application storage, the application in
a compressed format, and the optional EFFS-STD file system (note this is different from the EFFS-FAT flash
card file system).

• 8MB SDRAM containing the uncompressed application as well as any application data.

• 384KB on-chip SRAM located in the SAME70 microprocessor.

At power-up the application is decompressed from Flash memory to SDRAM and execution begins. If the application
is continuously trapping the device can be recovered using the jumper recovery method as described in the Recover
section, or if you have serial communication enabled the boot sequence can be aborted by sending the appropriate
serial command when prompted after a power cycle.

7.1.6 Memory Map

Region Size Address Range Description


Boot Loader 6k 0x00400000 to 0x004017FF Initial boot and application extraction
Config Record 10k 0x00401800 to 0x00403FFF System and User Configuration Data Flash
Cert. Storage 8k 0x00404000 to 0x00405FFF Optional Security certificate storage
User Flash 8k 0x00406000 to 0x00407FFF Unstructured binary User Flash Storage
App Flash 1.97M 0x00408000 to 0x005FFFFF Compressed Application and opt file system
Vector Table - 0x20400000 to 0x2040013F SRAM - Interrupt Vector Table
Fast App RAM 384k 0x20400180 to 0x2045FFFF SRAM - Fast Application RAM
Backup RAM 1k 0x40074000 to 0x400743FF Low power backup RAM
External Bus - 0x60000000 to 0x60FFFFFF Chip Select 0
External Bus 16M 0x61000000 to 0x61FFFFFF Chip Select 1
External Bus 16M 0x62000000 to 0x62FFFFFF Chip Select 2
External Bus 16M 0x63000000 to 0x63FFFFFF Chip Select 3
App RAM 8M 0x70000000 to 0x707FFFFF SDRAM - Standard Application RAM where code is
decompressed and variables are allocated
QSPI XIP - 0x80000000 to 0x80FFFFFF QSPI (User add-on) - For utilizing memory Mapped
Quad SPI memories

7.1.7 External Bus Interface


The MODM7AE70 provides 17 address lines (A0-A16) and a 16-bit data bus line (D0-D15). The data and address
lines shared with the SDRAM are buffered to the module's P1 header pins. Please refer to the MODM7AE70
schematic and datasheet for connector and signal locations. The Microchip SAME70 datasheet, section 33 on
External Bus Interface (EBI) and section 34 on Static Memory Controller (SMC), provide details on peripheral
functionality and configuration.

7.2 MOD54415, MOD54417 Platform Reference


7.2.1 Introduction
This document provides the memory map and locations of reference materials for those who wish to add addi-
tional hardware to their NetBurner device. The MOD54415 and MOD54417 are very similar. The difference is the

NetBurner, Inc.
7.2 MOD54415, MOD54417 Platform Reference 77

MOD54417 provides two hardware network interfaces. The designation MOD5441x in this document applies to
both modules.

7.2.2 MCF5441x Processor Information


The MOD54415 uses the NXP MCF54415 microprocessor, and the MOD54417 uses the MCF54417 micropro-
cessor. The NXP MCF5441x reference manual and datasheet provide in-depth information on both processors
and is located in the <nburn_install>\docs\NXP directory of your NetBurner Network Development Kit
installation.

7.2.3 Datasheet
The datasheet for the MOD5441x module can be found on the NetBurner website: MOD5441x Datasheet.
The datasheet is the primary control document for connector pin-outs and signal functions.

7.2.4 Development Board Schematic


The MOD-DEV-70CR development board schematic is located in the <nburn_install>\docs\Net←-
Burner\platform\Schematics directory. This schematic can be used for design ideas in your own
hardware implementation for power, RS-232, RS-485, and SD Flash card implementation.

7.2.5 Memory Operation


The MOD5441x uses 4 types of memory:

• A 4MB write protected serial SPI Flash chip containing the Boot Monitor and Alternate Boot monitor. This pro-
vides a recovery method should events such as a bad application that causes continuous traps, or application
Flash memory corruption.

• A 32MB parallel Flash chip containing non-volatile system configuration storage, user application storage, the
application in a compressed format, and the optional EFFS-STD file system (note this is different from the
EFFS-FAT flash card file system).

• A 64MB DDR2 Memory chip that contains the uncompressed application as well as any application data.

• 64KB on-chip SRAM located on the MCF5441x microprocessor.

Note

The reference to "2.x" is there for customers migrating from the NetBurner 2.x development tools. 2.x System
Configuration is not used when running 3.x applications.

4MB SPI Boot Flash 32MB Parallel Flash 64MB DDR2 RAM
Boot Monitor 2.x System Configuration Application (decompressed)
Alternate Boot Monitor User Parameters System Stack
Application (compressed)
3.x System Configuration

The Boot Monitor executes at power-up and attempts to decompress the application into DDR2 RAM and be-
gin execution. If the application is corrupted or does not exist, it will attempt to run the Alternate Boot Monitor. If
the Alternate Boot Monitor cannot be run, the system will remain in the Boot Monitor. The Alternate Boot Monitor
provides network communication to enable an application download, and is the normal recovery method should

NetBurner, Inc.
78 Platform References

unrecoverable application errors occur. The Boot Monitor only provides serial communication.

7.2.6 Memory Map


The MOD5441x provides 16 address lines (A0-A15) and a 16-bit data bus (D16-D31) running in mode 2. An address
bus latch is included on the MOD5441x so external latch is not required for this mode. If you are adding peripherals
to your NetBurner device's address/data bus, you can choose unused memory locations from the table below.
Once a range has been selected, you will need to configure the appropriate chip select address and option registers
in the MCF5451x processor. Please refer to the chip select sections of the NXP MCF5441x processor manual for
details on the register configuration. Unlike many ColdFire processors, you are not free to use any unused address
for chip selects. The range is restricted. In this table we have used "undefined" for restricted ranges and "unused"
for ranges that are valid for additional chip selects. Please see the MCF5441x Manual Section 20.3.1 and the Note
above Figure 20-1 for additional details.

Memory Region Address Range Description


Undefined 0x00000000 to 0x01FFFFFF Undefined area to catch null pointers
Unused 0x02000000 to 0x3FFFFFFF Available to applications
DDR2 RAM 0x40000000 to 0x43FFFFFF 64MB of DDR2 RAM
VBR 0x40000000 to 0x400003FF 1kB processor vector base register
RAMBAR 0x80000000 to 0x8000FFFF 64kB Processor internal SRAM
Parallel Flash 0xC0000000 to 0xC1FFFFFF 32MB parallel flash memory
System Config 0xC0000000 to 0xC001FFFF 128kB system configuration flash sector
2.x Config Rec 0xC0000000 to 0xC0000400 1kB 2.x configuration storage
3.x Certificate 0xC0000400 to 0xC0002400 8kB 3.x certificate storage
3.x System Config. 0xC0002400 to 0xC001FFFF 119kB 3.x system configuration
User Params 0xC0020000 to 0xC003FFFF 128kB user parameter storage
Application Code 0xC0040000 to 0xC1FFFFFF Compressed application code
Unused 0xC2000000 to 0xDFFFFFFF Available to applications
IPSBAR 0xE0000000 to 0xFFFFFFFF Processor internal device registers - accessible using the
SIM structure defined in sim5441x.h

7.3 NANO54415 Platform Reference


7.3.1 Introduction
This document provides the memory map and locations of reference materials for those who wish to add additional
hardware to their NetBurner device.

7.3.2 MCF54415 Processor Information


The NANO54415 uses the NXP MCF54415 microprocessor. The reference manual and datasheet provide in-depth
information on the microprocessor, including register settings, bus configuration and timing information. It is located
in the <nburn_install>\docs\NXP directory of your NetBurner installation.

7.3.3 Datasheet
The datasheet for the NANO54415 module includes information on connectors, signal names, and operational
parameters. It is located on the NANO54415 product page: NANO54415 Datasheet.

NetBurner, Inc.
7.3 NANO54415 Platform Reference 79

7.3.4 Development Board Schematic


The NANO54415 development board schematic is located in the <nburn_install>\docs\Net←-
Burner\Platform\Schematics directory. This schematic can be used for design ideas in your own
hardware implementation for power, RS-232, RS-485, and SD Flash card implementation.

7.3.5 Memory Operation


The NANO54415 uses 4 types of memory:

• A 4MB write protected serial SPI Flash chip containing the Boot Monitor and Alternate Boot monitor. This pro-
vides a recovery method should events such as a bad application that causes continuous traps, or application
Flash memory corruption.

• A 8MB serial SPI Flash chip containing non-volatile system configuration storage, user application storage,
the application in a compressed format, and the optional EFFS-STD file system (note this is different from the
EFFS-FAT flash card file system).

• A 64MB DDR2 memory chip that contains the uncompressed application as well as any application data.

• 64KB on-chip SRAM located on the MCF54415 microprocessor.

The Boot Monitor executes at power-up and attempts to decompress the application into DDR2 RAM and begin
execution. If the application is corrupted or does not exist, it will attempt to run the Alternate Boot Monitor. If
the Alternate Boot Monitor cannot be run, the system will remain in the Boot Monitor. The Alternate Boot Monitor
provides network communication to enable an application download, and is the normal recovery method should
unrecoverable application errors occur. The Boot Monitor only provides serial communication.

Note

The reference to "2.x" is there for customers migrating from the NetBurner 2.x development tools. 2.x System
Configuration is not used when running 3.x applications.

4MB SPI Boot Flash 8MB SPI Flash 64MB DDR2 RAM
Boot Monitor 2.x System Configuration Application (decompressed)
Alternate Boot Monitor User Parameters System Stack
Application (compressed)
3.x System Configuration

7.3.6 Processor Runtime Memory Map


The runtime memory map for the location of the microprocessors onboard SRAM and DDR2 RAM is shown below:

Memory Region Address Range Description


Undefined 0x00000000 to 0x01FFFFFF Undefined area to detect null pointers
DDR2 RAM 0x40000000 to 0x43FFFFFF 64MB of DDR2 RAM
VBR 0x40000000 to 0x400003FF 1kB Processor Vector Base Register
RAMBAR 0x80000000 to 0x8000FFFF 64kB Processor internal SRAM
IPSBAR 0xE0000000 to 0xFFFFFFFF Processor internal device registers

NetBurner, Inc.
80 Platform References

7.3.7 Application SPI Flash Memory


There is a total of 8MB SPI Flash memory used to store the compressed application and non-volatile parameters.
Read/write operations are only accessible through system API functions. The memory does not appear in the
microprocessor's address map.

SPI Address Description


0x000000 8kB 2.x System Configuration Record storage
0x002000 8kB User Parameter Storage
0x004000 7.9MB Compressed Application Code
0x7EE000 8kB 3.x Reserved System Configuration Storage
0x7F0000 64kB 3.x System Configuration

7.4 SB800EX Platform Reference


7.4.1 Introduction
This document provides the memory map and locations of reference materials for those who wish to add additional
hardware to their NetBurner device.

7.4.2 MCF54415 Processor Information


The SB800EX uses the NXP MCF54415 microprocessor. The reference manual and datasheet provide in-depth
information on the microprocessor, including register settings, bus configuration and timing information. It is located
in the <nburn_install>\docs\NXP directory of your NetBurner installation.

7.4.3 Datasheet
The datasheet for the SB800EX module includes information on connectors, signal names, and operational param-
eters. It is located on the SB800EX product page: SB800EX Datasheet.

7.4.4 Memory Operation


The SB800EX uses 4 types of memory:

• A 4MB write protected serial SPI Flash chip containing the Boot Monitor and Alternate Boot monitor. This pro-
vides a recovery method should events such as a bad application that causes continuous traps, or application
Flash memory corruption.

• An 8MB serial SPI Flash chip containing non-volatile system configuration storage, user application storage,
the application in a compressed format, and the optional EFFS-STD file system (note this is different from the
EFFS-FAT flash card file system).

• A 64MB DDR2 memory chip that contains the uncompressed application as well as any application data.

• 64K on-chip SRAM located on the MCF54415 microprocessor.

NetBurner, Inc.
7.4 SB800EX Platform Reference 81

The Boot Monitor executes at power-up and attempts to decompress the application into DDR2 RAM and begin
execution. If the application is corrupted or does not exist, it will attempt to run the Alternate Boot Monitor. If
the Alternate Boot Monitor cannot be run, the system will remain in the Boot Monitor. The Alternate Boot Monitor
provides network communication to enable an application download, and is the normal recovery method should
unrecoverable application errors occur. The Boot Monitor only provides serial communication.

Note

The reference to "2.x" is there for customers migrating from the NetBurner 2.x development tools. 2.x System
Configuration is not used when running 3.x applications.

4MB SPI Boot Flash 8MB SPI Flash 64MB DDR2 RAM
Boot Monitor 2.x System Configuration Application (decompressed)
Alternate Boot Monitor User Parameters System Stack
Application (compressed)
3.x System Configuration

7.4.5 Processor Runtime Memory Map


The runtime memory map for the location of the microprocessors onboard SRAM and DDR2 RAM is shown below:

Memory Region Address Range Description


Undefined 0x00000000 to 0x01FFFFFF Undefined area to detect null pointers
DDR2 RAM 0x40000000 to 0x43FFFFFF 64MB of DDR2 RAM
VBR 0x40000000 to 0x400003FF 1kB Processor Vector Base Register
RAMBAR 0x80000000 to 0x8000FFFF 64kB Processor internal SRAM
IPSBAR 0xE0000000 to 0xFFFFFFFF Processor internal device registers

7.4.6 Application SPI Flash Memory


There is a total of 8MB SPI Flash memory used to store the compressed application and non-volatile parameters.
Read/write operations are only accessible through system API functions. The memory does not appear in the
microprocessor's address map.

SPI Address Description


0x000000 8kB 2.x System Configuration Record storage
0x002000 8kB User Parameter Storage
0x004000 7.9MB Compressed Application Code
0x7EE000 8kB 3.x Reserved System Configuration Storage
0x7F0000 64kB 3.x System Configuration

NetBurner, Inc.
82 Platform References

7.5 SBE70LC Platform Reference


7.5.1 Introduction
This document provides the memory map and locations of reference materials for those who wish to add additional
hardware to their NetBurner device.

7.5.2 SBE70LC Processor Information


The SBE70LC uses the Microchip ARM SAME70 microprocessor. The reference manual and datasheet provide
in-depth information on the processor, including register settings, bus configuration and timing information. It is
located in the <nburn_install>\docs\Arm directory of your NetBurner installation.

7.5.3 Datasheet
The datasheet for the SBE70LC module includes information on connectors, signal names, and operational param-
eters. It is located on the SBE70LC product page: SBE70LC Datasheet.

7.5.4 Development Board Schematic


The SB70LC-ADPT-100 development board schematic is located in the <nburn_install>\docs\Net←-
Burner\platform\Schematics directory. This schematic can be used for design ideas in your own
hardware implementation for power, RS-232, RS-485, and SD Flash card implementation.

7.5.5 Memory Operation


The SBE70LC uses 3 types of memory:

• 2MB Flash memory for non-volatile system configuration storage, user application storage, the application in
a compressed format, and the optional EFFS-STD file system (note this is different from the EFFS-FAT flash
card file system).

• 8MB SDRAM containing the uncompressed application as well as any application data.

• 384KB on-chip SRAM located in the SAME70 microprocessor.

At power-up the application is decompressed from Flash memory to SDRAM and execution begins. If the application
is continuously trapping the device can be recovered using the jumper recovery method as described in the Recover
section, or if you have serial communication enabled the boot sequence can be aborted by sending the appropriate
serial command when prompted after a power cycle.

7.5.6 Memory Map

Region Size Address Range Description


Boot Loader 6k 0x00400000 to 0x004017FF Initial boot and application extraction
Config Record 10k 0x00401800 to 0x00403FFF System and User Configuration Data Flash
Cert. Storage 8k 0x00404000 to 0x00405FFF Optional Security certificate storage
User Flash 8k 0x00406000 to 0x00407FFF Unstructured binary User Flash Storage
App Flash 1.97M 0x00408000 to 0x005FFFFF Compressed Application and opt file system
Vector Table - 0x20400000 to 0x2040013F SRAM - Interrupt Vector Table
Fast App RAM 384k 0x20400180 to 0x2045FFFF SRAM - Fast Application RAM
Backup RAM 1k 0x40074000 to 0x400743FF Low power backup RAM
External Bus - 0x60000000 to 0x60FFFFFF Chip Select 0
External Bus 16M 0x61000000 to 0x61FFFFFF Chip Select 1
External Bus 16M 0x62000000 to 0x62FFFFFF Chip Select 2

NetBurner, Inc.
7.6 Recovery: MODM7AE70, SBE70LC 83

Region Size Address Range Description


External Bus 16M 0x63000000 to 0x63FFFFFF Chip Select 3
App RAM 8M 0x70000000 to 0x707FFFFF SDRAM - Standard Application RAM where code is
decompressed and variables are allocated
QSPI XIP - 0x80000000 to 0x80FFFFFF QSPI (User add-on) - For utilizing memory Mapped
Quad SPI memories

7.6 Recovery: MODM7AE70, SBE70LC


7.6.1 Introduction
Applicable Hardware Platforms: MODM7AE70 and SBE70LC.
Device recovery in the event of an errant application running on the device is an important part of the development
process. This document describes recovery procedures for a device stuck in a repeating trap/reset condition, or a
totally unresponsive device.

7.6.2 Repeating Traps or Resets


The easiest method of recovery is to abort the user application boot process and run only the Configuration Server.
The Configuration server will enable a new application to be downloaded using:

• The Configuration Server web page at <device IP>:20034

• The nbupdate utility

• The wget utility

• The device serial port

7.6.2.1 Step 1: Abort to the Configuration Server

1. Run a serial terminal such as MTTTY and connect to the device serial port.

2. Power cycle the module.

3. Press "A" when the message, Type "A" to Abort boot is displayed. Note that "A" is the default
abort command, but the command is configurable in the Configuration Server settings. If the abort command
is different, use that command instead of "A".

4. Wait for the > prompt to display.

The Configuration Server is now active on both network and the device serial port.

7.6.2.2 Step 2: Download a New Application

At this point a new application can downloaded through the device web page, nbupdate or serial port.

7.6.2.2.1 Web Page

1. Locate the device using discover.netburner.com, the localdiscover utility, or open a web browser and type the
device address in the URL field: <device IP>:20034. For example, 192.168.1.10:20034.

2. In the Update Application section, select the new .bin file to download and select the Send File button.

NetBurner, Inc.
84 Platform References

7.6.2.2.2 NBUpdate

1. Open a command prompt.

2. Type nbupdate <file name> <device IP>

7.6.2.2.3 Serial Port


Note

MTTTY is a serial terminal program. You should be able to use any serial terminal program of your choice.
When starting the download the binary file must be sent as text or raw data.

Warning

The .bin file is a binary file. You must have serial software flow control disabled. If using MTTTY, from the
main menu select TTY > Flow Control and uncheck both Xon/Xoff Input Control and Xon/Xoff Input
Control. Otherwise the data stream will be corrupted.

1. At the > prompt, type fla into the serial prompt and then hit enter.

2. At the message 'Begin Download', start the file download (if using MTTTY, type the F5 key).

3. When the file window opens, navigate to the .bin application file that you want to load.

4. Hit 'Open', and the application will start the load process.

7.6.3 Unresponsive Device or No Serial Port Access


In a situation in which the device is completely unresponsive and aborting to the Configuration Server is not
possible, or if there is no access to the device serial port, shorting two hole locations on the device PCB (also
called "jumper recovery") will reset it to a factory default state. The PCB hole locations are 0.1" apart so that a
shorting jumper can be used. This procedure will erase flash memory including the configuration and application.
The device will then be ready to receive a new application using any of the procedures described in the download
a New Application section. -# Power off the device. -# Short the jumper recovery PCB locations with a shorting
jumper or wire. -# Power on the device. -# Wait for the device to finish erasing the flash and loading the default
application. Progress is indicated by the two blinking LEDs on the device (D1 and D2). When the LEDs stop
blinking the reset is complete. -# Remove the short jumper or wire. \n\n @subsection autotoc_md89 Recovery
Jumper Locations @subsubsection autotoc_md90 MODM7AE70 The reset jumper location is labeled "Recovery",
located on the end of the board opposite the RJ-45 connector. \n @htmlonly <img src="MODM7AE70Jumper.←-
png"> \endhtmlonly @image latex MODM7AE70Jumper.png "MODM7AE70 Recovery Jumper Location" width=5in

7.7 Recovery: MOD5441x, NANO54415, SB800EX


NetBurner 5441x based devices include: MOD54415, MOD54417, NANO54415 and the SB800EX. These devices
have a Recovery Jumper. This is a 2 hole pin location on the circuit board. When shorted during the boot process,
the device will boot to the Alternate Boot Monitor rather than the application. If the configuration section of flash has
been corrupted, it will also use a safe default version instead of what is in flash memory.

7.7.1 Step 1: Abort to the Alternate Boot Monitor


There is the primary boot monitor, accessible by entering the 'A' (0x41) character immediately on boot. This should
allow you to recover the module normally. If for some reason that fails, or you cannot enter the 'A' character, the
have a secondary boot monitor to allow the user to recover from (virtually) all software or configuration faults. The
procedure is:

1. Power off the module.

NetBurner, Inc.
7.7 Recovery: MOD5441x, NANO54415, SB800EX 85

2. Short the 2 pins at the alternate boot jumper location (see below).

3. Power on the module.

4. Wait for the module to finish boot and enter the monitor.

5. Remove the short on the alternate boot jumper location.

7.7.2 Recovery Jumper Locations


7.7.2.1 NANO54415

The boot jumper is a pair of circular pads located near the middle line of the board near the connector.

Figure 7.1 NANO54415 Recovery Jumper Location

7.7.2.2 MOD5441x

The boot jumper is the unpopulated header 'TP1', located near the Ethernet jack.

NetBurner, Inc.
86 Platform References

Figure 7.2 MOD5441x Recovery Jumper Location

7.7.2.3 SB800EX

The boot jumper is the unpopulated header 'JP1', located near the center of the board.

NetBurner, Inc.
7.7 Recovery: MOD5441x, NANO54415, SB800EX 87

Figure 7.3 SB800EX Recovery Jumper Location

7.7.3 Step 2: Download a New Application


Once the Alternate Boot Monitor is running you should be able to locate your device using:

7.7.3.1 Network

The 5441x devices predate the NetBurner 3.x Development Tools and network recovery requires the use of the
AutoUpdate utility. Run the AutoUpdate utility and select the device and new application to download. Autoupdate
requires _APP.s19 file format. The original, factory application is a safe application to load on to a device that needs
to be recovered. It can be found in the platform\<PLATFORM>\original directory.

7.7.3.2 Serial Port


Note

MTTTY is a serial terminal program. You should be able to use any serial terminal program of your choice.
When starting the download the binary file must be sent as text or raw data.

Warning

The .bin file is a binary file. You must have serial software flow control disabled. If using MTTTY, from the
main menu select TTY > Flow Control and uncheck both Xon/Xoff Input Control and Xon/Xoff Input
Control. Otherwise the data stream will be corrupted.

1. At the NB> prompt type fla then hit enter.

2. At the message 'Begin Download', start the file download (if using MTTTY, type the F5 key).

3. When the file window opens, navigate to the .bin application file that you want to load.

4. Hit 'Open', and the application will start the load process.

Once the download is complete the device will reboot and run the new application.

NetBurner, Inc.
88 Platform References

NetBurner, Inc.
Chapter 8

Production & Deployment

8.1 Production Releases and Customer Deployment


Once product development is complete, there are a number of choices for device location and configuration:

• How to find the device on a network

• How to program the application into devices in production

• How to configure devices in production

• How Customers can change configuration settings

Note

Utility source code is located in \nburn\pctools, and built versions are in \nburn\pcbin. You
may modify or rebrand these utilities and distribute to your end customers, so long as they are only run
with NetBurner target hardware.

8.2 Finding a Device on a Network


A device can be located the following ways:

• If the device and computer have Internet access, open a web browser and go to discover.netburner.com

• Use the localdiscover utility. This is a multi-platform utility written in Golang for windows, osx and linux. The
compiled version can be distributed to your customers, but not the Golang source code.

• The Python find utility, located in \nburn\pctools\find.

• Use the debug/console serial port

8.3 Application Programming


Applications are programmed into flash memory by sending an application image to the device's configuration
server, located at its IP address on port 20034. This can be done in a number of ways, all of which are multi-
platform (win, osx, linux):

NetBurner, Inc.
90 Production & Deployment

• A web browser from the device's configuration server web page

• The nbupdate command-line utility

• The WGET command-line utility

• A serial port using the serial command processor

8.3.1 Configuration Web Page


To send a file from a web browser, enter the URL of your device. The URL format is "<ip address>:<port
number>", such as: "10.1.1.100:20034". Once at the web page, browse for the application image file and select
"Update".

8.3.2 nbupdate Utility


nbupdate is a multi-platform command-line utility written by NetBurner. The format is: nbupdate <filename>
<ip address>. For example, nbupdate myApp.bin 10.1.1.196, or nbupdate myApp.s19
10.1.1.196.
If the environment variable DEVIP is set the IP address parameter is not required. For example, SET
DEVIP=10.1.1.196. Now you can call nbupdate with only the application file name. To determine the
current setting of DEVIP, type "SET DEVIP".

8.3.3 wget Utility


WGET is an industry standard utility that allows you to download files over TCP/IP protocols FTP, HTTP and HTTPS.
If you are using OSX or Linux, WGET is usually already installed (or can using your package manager). Windows
users will need to install it, please refer to https://www.gnu.org/software/wget/.
The WGET utility can be used for a number of things:

• Updating the device application image

• Retrieving device configuration information in JASON

• Updating device configuration information in JASON


In the examples below we use an example device IP address of 10.1.1.60, and an application name of
myApplication.bin.

8.3.3.1 Program an Application

To program a new application into the device:


wget --post-file=myApplication.bin 10.1.1.60:20034/appupdate.html
All updates are processed by the Configuration Server running on the device. The --post-file specifies a
POST operation is to be performed. The IP address and configuration port number are next, along with the server
post destination that will always be appupdate.html.

If using authentication with a username of "user", and password of "pass":


wget --auth-no-challenge --user=user --password=pass --post-file=myApplication.←-
bin 10.1.1.60:20034/appupdate.html

NetBurner, Inc.
8.4 Customer Configuration 91

8.3.3.2 Read The Configuration

Read the current configuration into a file named config.txt: wget 10.1.1.60:20034/Config.
In this case the destination is Config, rather than appupdate.html.
If you would like to specify a directory to store the file, use the -P option: wget 10.1.1.60:20034/Config
-P \myDir

8.3.3.3 Program New Configuration Settings

The easiest way to do this is to first read the configuration and save to a file so you have a template to work with,
then edit the settings you need. Then post the configuration file to each new device:
wget --post-file=newconfig 10.1.1.60:20034/Config

8.4 Customer Configuration


Once deployed, your customers can modify the configuration by:

• Using the interactive web interface at 10.1.1.60:20034. Note that you can create your own web interface to
override the default NetBurner interface, and use your custom brand.

• If connected to the Internet, a web browser at: discover.netburner.com, which provides a link to the device
configuration page and also the device's main web page on port 80.

• The NetBurner localdiscover utility, which provides a link to the device configuration page, and also the de-
vice's main web page on port 80.

• Using WGET

• Your application can provide the means to change configuration

NetBurner, Inc.
92 Production & Deployment

NetBurner, Inc.
Chapter 9

Programmers Guide

The documents in this section are provide Programmers with background information and examples on the various
aspects of the NetBurner development system.
Topic Links:

• Introduction

• Config Server Programming Guide

• EFFS Programming Guide

• File Descriptors

• HTML Processing

• IPv4/IPv6 Dual Stack Guide

• NetBurner RTOS

• Network Protocols

• SSL/TLS Programming Guide

• SSH Programming Guide

• Web Server

• JSON Lexer

• Custom Branding

9.1 Introduction
The NetBurner Programming Guide is intended to provide an overview of the features and capabilities of the Net←-
Burner Network Development Kit. The primary goal of this guide is to provide a brief explanation of common
network applications and illustrate how you can implement these applications using NetBurner hardware, software
and development tools. Prerequisites for this guide:

• You have installed the NetBurner Network Development kit

• You have a running NetBurner device that is configured for your network, and you are familiar with the NBE-
clipese development (ref: NBEclipse Getting Started Guide), or you are using your own environment and the
command line tools.

• You are familiar with the network configuration of your target device

• You have successfully created a project and can run applications on your target device

NetBurner, Inc.
94 Programmers Guide

The approach of this guide is to learn by example. The first program example, called Template, can be used as a
starting point for most applications, and each application in this guide uses it as a base.

9.1.1 Source Code for Example Programs


Source code for the examples in this document are located in the \nburn\examples directory of your NetBurner
tools installation.

9.1.2 Tools and Library Version Information


This documentation applies to the following version of the NNDK, which utilizes the listed external tools and libraries.
NetBurner Network Development Kit Tools 3.3.2
wolfSSL 4.3 Utilized by the SSL/TLS library.
GNU GCC 8.1 The documentation for this compiler can be found can be found here.

9.1.3 Application Wizard Project


We will start with a basic application created with the NBEclipse Application Wizard. If you are not familiar with
creating an application or NBEclipse please refer to the NBEclipse Getting Started Guide before continuing. When
running the Application Wizard select the Standard Initialization and Web server options. Once the project is com-
plete, you should have a main.cpp file as shown below:
#include <predef.h> // System level options and definitions
#include <stdio.h> // Standard I/O functions
#include <nbrtos.h> // NetBurner Real Time Operating System (RTOS)
#include <http.h> // HTTP functions
#include <init.h> // Initialization functions
const char * AppName = "AppWizard"; // Name of application. Will be displayed by discovery programs
void UserMain(void * pd)
{
init(); // Initialize system
WaitForActiveNetwork(TICKS_PER_SECOND * 5); // Wait up to 5 seconds for active network activity
StartHttp(); // Start HTTP web server. Note StartHttps() starts
secure web server
iprintf("Application %s started\n", AppName ); // Print message to stdout, which is the debug serial
port by default
while (1) // Infinite loop
{
OSTimeDly(TICKS_PER_SECOND);
}
}
The system will automatically start the RTOS and UserMain() as a its own task. This simple application is a fully
functional network application with a web server.
The init() function will do the following:

• Initialize stdio to be the debug/console port.

• Read and process the system configuration information. This includes things such as network interface
settings, serial port settings and boot options.

• Initialize the network stack.

• Set the RTOS task priority of UserMain() to MAIN_PRIO.

• Enable the Task Monitor utility support.

• Whenever the project is built in debug mode, enable the GDB debugger.

NetBurner, Inc.
9.2 Config Server Programming Guide 95

The WaitForActiveNetwork() function will wait for an active network link before proceeding, up until the specified
timeout.
StartHttp() starts the web server. The default port is 80. If you wish to start on a different port you can specify the
port number as a parameter to the function.
The system supports printf() and iprintf(). The iprintf() function (i = integer only) will consume less
system resources if you do not need floating point support.
Your application should never return from UserMain(); the while() loop will run forever. The
#define TICKS_PER_SECOND
should be used with the delay function in case the system ticks per second value is ever modified.

9.2 Config Server Programming Guide


9.2.1 Introduction
The NetBurner configuration system is used to configure and store system and application defined values and data
in flash memory. These values can be accessed and modified through:

• The System Configuration Web Server (port 20034)

• Your application

• Your web page interface

• Serially through the Serial Config Server

The web interface also provides a convenient way of uploading a new application onto the module. While the web
interface provided is fully functional, it is possible override this with a custom web interface in your application for
purposes such as branding or adding/removing features.
The configuration data itself is stored and presented as JSON blobs. It's possible to access, modify, and send the
entire JSON blob, or any subsection of the data, down to individual components.

9.2.2 Configuration Parameters


The configuration server holds the module's boot settings, network interface settings, and any custom application
information you wish to save, display or modify. Your application can view and/or modify these parameters a variety
of ways:

• The system configuration server web page

• Your own custom configuration server web page

• Any type of web interface in your application

• In your application code directly

The configuration system has a tree structure with "leafs". There are a number of built-in leafs described below,
such as "Config", "AppData", and "Boot".

9.2.2.1 Config

Config is the top level object that contains everything else. Underneath are the AppData and Sys settings.
There is also a Version field that is updated automatically when new settings are saved. The Reboot option,
when checked, will force the module to reboot when the configuration record is updated.

NetBurner, Inc.
96 Programmers Guide

9.2.2.2 Config.AppData

The AppData leaf is set aside at the top leaf for user application data. The application can select from the many
configuration objects to store strings, integers, list boxes, etc. More information on how to use these can be found
in the BasicConfigVariable NetBurner Basic Config Demo.

9.2.2.3 Config.Sys

The Sys leaf contains the device system settings such as boot parameters, application name, and network interface
settings.

9.2.2.3.1 Config.Sys.Boot Boot settings include:

• Abort: This specifies the keys that needs to be pressed in order to break out of the normal boot sequence.
This prevents anything after the init() function from running in UserMain(). This will load the serial
configuration server, enable the config web interface and effectively stops the user's application from running.
The default value for this is "A".

• BootBaud: The baud rate that the BootUart will use.

• BootDelay: How long the application will delay to wait for the Abort characters before continuing.

• BootQuiet: Whether or not to display the boot output data on the BootUart.

• BootUart: The UART used by the system to display output related to the device booting.

• Password: When this is set along with User, both will be required when making changes to the congif
settings, or when updating the user application.

• Serial Config: There are four different options for this, which are outlined below.

– DuringBoot: This will make the serial configuration server available during the boot process by using
the Abort characters set above.
– AlwaysEnabled: This will set the serial configuration server to always be available through the Boot←-
Uart. Note that if this is selected, attempting to receive other serial input through the BootUart
(such as debug commands, etc.) has the potential to break the configuration record.
– PauseAfterBoot: This option will cause the boot process to pause indefinitely before the user's appli-
cation is launched (specifically after init() is called), and will cause the serial configuration server to
be enabled over the BootUart. The user's application can be resumed by typing boot.
– Disabled: This prevents the serial config server from being enabled, and does not pause during the
boot process, which stops the user from being able to enter the Abort character sequence.

• User: When this is set along with Password, it must be entered when trying to make changes to the
configuration record's values or uploading a new application to the module.

9.2.2.3.2 Config.Sys.NetIf The settings underneath NetIf deal with the different network interfaces available on
the module. This will include all of the Ethernet ports, as well as any Wifi ports available. What is actually listed
underneath these interfaces will depend on the interface itself. Common settings are listed below:

9.2.2.3.2.1 Config.Sys.NetIf.Ethernet0 Ethernet settings include:

• DeviceName: A name given to the interface, which is used to register for DDNS and NetBIOS.

• DhcpDiscoverSec: How long to wait after boot before sending a DHCP Discover message.

• DiscoveryReportInterval: How often a device should report itself to the discovery server.

• DiscoveryReportUrl: The location of the discovery server. By default, this points to NetBurner's dis-
covery server. However, if desired, this field can changed to be blank so that the device does not report itself.
It can also be set to another URL if the user wishes to run their own discovery server.

• MAC: The MAC address of the interface.

NetBurner, Inc.
9.2 Config Server Programming Guide 97

Config.Sys.NetIf.Ethernet0.IPv4 IPv4 Settings include:

• ActiveAddr: The current IPv4 IP address in use.

• ActiveDNS1: The current IPv4 DNS server (1) in use.

• ActiveDNS2: The current IPv4 DNS server (2) in use.

• ActiveGate: The current IPv4 gateway in use.

• ActiveMask: The current IPv4 mask in use.

• AutoIPAddr: The current IPv4 auto address in use.

• AutoIPEn:

• Mode: Specifies which method to use to acquire IPv4 active values. The options are as follows:

– DHCP: Use the values provided by the DHCP server.


– DHCP w Fallback: Try to get values from the DHCP server, and use the static values as a backup.
– Static: Use the static values defined in the interface's config record.
– Disabled: Disable the interface.

• StaticAddr: The manually configured IPv4 IP address.

• StaticDNS1: The manually configured IPv4 DNS(1).

• StaticDNS2: The manually configured IPv4 DNS(2).

• StaticGate: The manually configured IPv4 gateway.

• StaticMask: The manually configured IPv4 mask.

Config.Sys.NetIf.Ethernet0.IPv6 IPv6 settings include:

• ActiveAddr: Lists the current IPv6 addresses in use.

• ActiveDNS: Lists the current IPv6 DNS servers in use.

• ActiveRoutes: Lists the current IPv6 routes in use.

• Mode: Specifies which method to use to acquire IPv4 active values. The options are as follows:

– DHCP: Use the values provided by the DHCP server.


– DHCP w Fallback: Try to get values from the DHCP server, and use the static values as a backup.
– Static: Use the static values defined in the interface's config record.
– Disabled: Disable the interface.

• StaticAddr: The manually configured IPv6 IP address.

• StaticDNS1: The manually configured IPv6 DNS(1).

• StaticDNS2: The manually configured IPv6 DNS(2).

NetBurner, Inc.
98 Programmers Guide

9.2.3 The Configuration Web Interface


The device's configuration web server is available on port number 20034. To view in a web browser, type the device's
IP address followed by the port number. For example, "10.1.1.100:20034". The default system configuration server
web page is shown below. Note that you can easily create your own custom web page for things as simple as
branding with your own logo, to formatting and adding fields in any way you wish. Clicking on the tree structure leafs
will navigate through the settings.

Figure 9.1 Config Web Interface

Located on the right side of the interface, you will also notice that there are several buttons. These provide
the following functionality:

• Expand All: This expands the entire config tree structure.

• Collapse All: This collapses the entire config tree structure.

• Update Record: This updates the config record with the values that are currently entered in config struc-
ture on the web page.

• Download Config: Download the configuration object in JSON.

• Restore Config: Upload a JSON configuration object.

• Raw Config Page: Display a non-stylized version of the web interface, which can be edited.

• NB Discover: This takes you to NetBurner's Discover page.

• Discover Local: Discover device on the local network, Internet access in not required.

The Update Application section provides for an application update by selecting a .bin file. Use the Choose File
button to select the image, followed by selecting Send File.

NetBurner, Inc.
9.2 Config Server Programming Guide 99

9.2.4 Serial Configuration Interface


In addition to the web interface, it's possible to navigate and modify the config record through a serial terminal.
To do this, you will need to enter the serial config server through the BootUart using a method defined by the
SerialConfig option in the Boot settings outlined above.
The most common method will be to type in the string specified by the Abort setting listed in the Boot configuration
section. Reset the module and send the abort string before the boot timeout expires. The boot delay text is:
Type \<Abort Value>\ to Abort boot...
The default Abort Value is a capital 'A'. Upon successfully entering the serial configuration monitor, the > prompt
will be displayed:

Figure 9.2 Serial Config Prompt

Navigating through the config data via the serial menu has been designed to operate much like a standard
file system. Typing the name of a config object will move you into that section of the config data, much like
navigating into a directory through a command prompt. Where you are in the config structure will be displayed at
the prompt. For example, from the initial prompt, >, if you were to type Config.Sys and hit enter, the prompt
would then read Config.Sys.>, illustrating that you are currently at the system settings for the config object.
In addition, several commands have been added to aid in navigating and modifying the config data, as well updating
the device. Typing "help" at the prompt will display a list of these commands. Each of these is explained below:

• help: Displays the commands that can be used in the serial config system.

• boot: This will exit the serial config server, and continue to boot the user's application.

• reboot: This will reboot the module.

• flash: This will allow to you upload a new application serially. To do this in MTTTY, after typing this
command hit "F5" to open a file dialog box and select a new .bin file to upload.

• <configvar>?: Type the name of a config variable followed by a "?" to list the config structure underneath
the config variable specified. For example, typing Config? will show the entire contents of the config
structure, while Config.Sys will show all of the system settings.

• <configvar>=<value>: This will assign a value to a specific config variable.

• ..: This will take you up one level in the config object structure from the current position.

NetBurner, Inc.
100 Programmers Guide

• ls: This will show the current level of the config object.

• save: This will save any changes made to the values stored in the config object.

9.2.5 Creating a Custom Web Interface


The config web interface was designed so that it could be easily replaced by customers with their own web interfaces
and logos. To do this, simply replace <NNDK Install Directory>\nbrtos\source\ROOT.html with
your own file, and rebuild the system libraries as outlined in the Rebuilding Projects & Libraries NBEclipse Guide.
If you simply want to replace the logo show in the config web interface, replace LOGO.gif with your own image,
and rebuild the system libraries as mentioned above.
An example has been setup that shows how the current config web interface has been structured and built. It can be
found in the examples folder of your NNDK install at <NNDK Install Directory>\examples\Configuration\Basic←
WebConfig.

9.2.6 Configuration API Examples


There are several examples that outline how to properly use NetBurner's config objects. These can all be found in
the examples folder of your NNDK install at <NNDK Install Directory>\examples\Configuration\.
They are listed here with brief descriptions for your convenience.

• BasicConfigVariable Basic Config Variable: This program shows the basics of using NetBurner's
config system objects.

• BasicWebConfig Basic Web Config: This program shows the basics of using NetBurner's config system
and presenting the information through a dynamically generated web interface.

• CustomWebConfig Custom Web Config: This program shows how to use NetBurner's config system
combined with a more complicated web interface featuring BootStrap and jQuery.

9.3 EFFS Programming Guide


This guide covers the NetBurner implementation of the HCC Embedded Flash File System (EFFS) and NetBurner
flash card hardware interface. The EFFS is just one part of the NetBurner suite of tools and software. You may
need to reference other documents for configuration and hardware specifics for your particular NetBurner platform.
Topics Covered:

• An overview of examples, supported platforms and debugging information

• Overview of the flash card EFFS-FAT File System Operation

• Overview of the on-chip EFFS-STD File System Operation

• Hardware interface design for external flash cards

NetBurner, Inc.
9.3 EFFS Programming Guide 101

9.3.1 Example Programs


A list of examples is provided in the Example Applications section of this document.

9.3.2 Reference Manuals for the EFFS API


The function call reference manuals for the EFFS-FAT and EFFS-STD file systems are located in the
\nburn\docs\NetBurner\EFFS folder.

9.3.3 Supported Hardware Platforms


All platforms support the on-board flash chip EFFS-STD file system. The implementation of the flash card EFFS-←-
FAT file system is as described below. All devices can implement an external flash card design, while some
platforms also have a flash card socket located on the device itself. There are two types of external flash card
implementations:

• SPI: operates in native SPI mode with a single data channel

• SDIO: operated with four data channels

Platform External On-board


MODM7AE70 SPI N/A
MOD54415 SPI SPI
MOD54417 SPI SPI
SB800EX SDIO
NANO54415 SPI SDIO

The flash card sockets on the MOD-DEV-70CR and NANO development boards support SPI mode.

Topic Links:

• Flash Card Hardware Interface Design

• EFFS-FAT File System Operation

• EFFS-STD File System with On-chip Flash

9.3.4 Debug Port


Throughout this guide, we will refer to the "debug port". The debug port is one of the RS-232 ports that can be
used to interact with your NetBurner device in the example programs. By default stdout, stdin and stderr
are mapped to the debug port, so when you use functions like printf(), scanf(), gets(), etc. they read
and write to the debug port. All of this is configurable. You can also disable the debug port and use the port as a
general purpose UART, or you can reassign the stdio file descriptors to use other serial or network interfaces.

9.3.5 Flash Card Hardware Interface Design


9.3.5.1 Flash Card Hardware Interface Design

9.3.5.1.1 MMC/SD Hardware Interface

9.3.5.1.1.1 Schematic Representation The SD/MMC flash card interface is installed on NetBurner Network
Development Kit (NNDK) development board. The schematic representation is shown below:

NetBurner, Inc.
102 Programmers Guide

Figure 9.3 Development Board Schematic

SD/MMC Pin SD/MMC Signal Name Modxxxx Signal Connection


1 /CS, Chip Select J2-35 - with 10k pull-up∗
2 DI, Data In J2-28 - QSPI DOUT
3 GND Ground
4 VCC VCC 3.3V
5 CLK J2-J5 - QSPI CLK
6 GND Ground
7 DO, Data Out J2-J7 - QSPI DIN
8 NC, No Connection No Connection
9 NC, No Connection No Connection
D CD, Card Detect J2-47 - with 10k pull-up∗
W WP, Write Protect J2-40 - with 10k pull-up∗
Com Common Ground
Com Common Ground

9.3.5.1.1.2 Signal Description These signals can be any available GPIO pins on the NetBurner module, with a
corresponding software change in mmc_m7.cpp for the MODM7AE70 or mmc_mcf.cpp for the other platforms
to specify the signal name.

NetBurner, Inc.
9.3 EFFS Programming Guide 103

9.3.5.1.1.3 SD/MMC Connector Part Number The SD/MMC flash card connector used on the NetBurner
development board is available from Mouser Electronics, part number 688-SCDA1A0901.

9.3.5.1.1.4 SD/MMC Card Compatibility The SD/MMC must support native SPI mode transfers, which is com-
mon for most SD/MMC cards. Up to 2GB is supported for standard SD/MMC and up to 32GB is supported for
SDHC.

9.3.5.1.1.5 Exclusive Use of the SPI The EFFS normally requires exclusive use of the SPI interface. The
standard software and drivers operate in this mode. There are also performance reasons for exclusive use. While
it may be possible to share the SPI with other peripherals, it is not supported in the development tool suite.

9.3.5.1.1.6 SD/MMC Interface Control Pins You can modify the default pin selections for the inter-
face control signals in \nburn\platform\<platform>\mmc_m7.cpp for the MODM7AE70, or
nburn\platform\<platform>\mmc_mcf.cpp for the other platforms. The relevant functions in this
file are lsited below. Note that the values in these functions must be used on the NetBurner development board
since the board is wired in this configuration.

void MMC_BaseInit(int CurrentDrive) // Configure pins to be used for SD/MMC interface control
int get_cd(int currentDrive) // Get the Card Detect state
int get_wp( void ) // Get the Write Protect state
void spi_cs_lo( void ) // Set SPI chip select low
void spi_cs_hi( void ) // Set SPI chip select high

9.3.5.1.1.7 Interrupt Driven SPI For the ColdFire based platforms (MOD5441X, SB800EX, and NANO54415),
you can enable the SD/MMC SPI interface to work with the NetBurner interrupt driven SPI driver instead of the
default polling mode driver. This will result in slightly lower SD/MMC performance but overall higher system perfor-
mance. This is useful if you find that your network performance or user tasks run poorly during file system accesses.
A modification must be made in nburn\platform\<platform>\mmc_mcf.cpp, followed by a rebuild of
the platform system directory. Near to top of this file, the following line should be uncommented:
define SD_IRQ_SPI

9.3.6 EFFS-FAT File System Operation


9.3.6.1 EFFS-FAT File System Operation

Typical file system operation will involve mounting a drive, opening and closing files, and reading and writing files.
The following is a list of the most common function calls used to perform these operations. For a complete list of
functions refer to the EFFS Programming Guide.

9.3.6.1.1 Common EFFS FAT Function Calls Create/delete working directory for current task priority:

int f_enterFS(void)
void f_releaseFS(void)

Mount/dismount a flash card:

int f_mountfat(MMC_DRV_NUM, mmc_initfunc, F_MMC_DRIVE0)


int f_delvolume(int drivenum)

NetBurner, Inc.
104 Programmers Guide

Open/Close a file

F_FILE *f_open(const char *filename, const char *mode)


int f_close(F_FILE *filehandle)

Read, write, and related functions:

int f_getfreespace(int drivenum, F_SPACE *pspace)


long f_write(const void *buf, long size,long size_st, F_FILE *filehandle)
long f_read( void *buf, long size,long size_st, F_FILE *filehandle)
long f_seek(F_FILE *filehandle,long offset, long whence)
int f_eof(F_FILE *filehandle)
int f_rewind(F_FILE *filehandle)
int f_delete(const char *filename)

Directory functions:

int f_findfirst(const char *filename, F_FIND *find)


int f_findnext(F_FIND *find)
int f_chdir(const char *dirname)
int f_mkdir(const char *dirname)

File time functions

int f_settimedate(const char *filename, unsigned short ctime, unsigned short cdate)
int f_gettimedate(const char *filename, unsigned short *pctime, unsigned short *pcdate)

9.3.6.1.2 File Time and Date Stamps The EFFS supports file time and date stamps. There are a number of
ways to obtain the current world time for an embedded system, including a Network Time Server (NTP), Real-time
clock (RTC), and setting it manually. For simplicity the first two examples concentrate on file system calls. The third
example includes methods to set the time and date through all the aforementioned methods. If no time or date is
set, the file time stamp will be January 1, 1980.

9.3.6.1.3 File System Utils All of the NetBurner EFFS examples include a helpful utility file called File←-
SystemUtils.cpp. This file provides an easy use interface for initializing, getting status, testing, reading
and writing to a CF or SD/MMC card. To select between the types of cards, edit the header file cardtype.h.
This file also demonstrates many of the commonly used EFFS function calls. These utility files are located
in <nburn_install>\examples\_common\EFFS\FAT or <nburn_install>\examples\←-
_common\EFFS\STD, depending on if you want to use an SD card (FAT), or the on chip file system
(STD). The examples for EFFS that take advantage of these utility files can be found in <nburn_←-
install>\examples\EFFS\FAT or <nburn_install>\examples\EFFS\STD, again, depending
on which file system you wish to use.

9.3.6.1.4 EFFS FAT Example Programs

9.3.6.1.4.1 EFFS FAT Example applications for using the file system as simple storage, with FTP,
HTTP, HTTP with Variable tags, multiple tasks, RAM drive, and application updates are located at←-
: \nburn\examples\EFFS\Fat

NetBurner, Inc.
9.3 EFFS Programming Guide 105

9.3.6.1.4.2 EFFS FAT Used In Security Applications Example applications using the file system in security
applications are:

• HttpsDualCert to demonstrate how to have both a permanent compiled-in certificate and key, as well as one
that can be loaded from an SD/MMD flash card using the EFFS FAT file system for a web server.

• SSL_pop3 to demonstrate how to implement retrieving email from a server that requires SSL, and then saves
it to an SD/MMD flash card using the EFFS FAT file system.

• SendMailAttach demonstrates how to attach files from the EFFS FAT file system to an email and send it
securely using SSL/TLS encryption.

9.3.6.1.5 Project Settings To create a project that uses the EFFS-FAT file system, you will need to complete a
few extra steps in addition to your normal project setup.
For NBEclipse users:

• Add the EFFS-FAT library, FatFile.a, to the linker path

• Import the source files found here into your project: <nburn_install>examples\_common\EFFS\FAT

For projects that use the command line tools, add the following lines to your makefile:

XTRALIB = $(NNDK_ROOT)/platform/$(PLATFORM)/original/lib/libFatFFile.a
include $(NNDK_ROOT)/examples/_common/EFFS/FAT/common.mak

9.3.7 EFFS-STD File System with On-chip Flash


9.3.7.1 Using the EFFS-STD File System with On-chip Flash

9.3.7.1.1 EFFS-FAT vs. EFFS-STD The previous sections of this guide have focused on the EFFS-FAT file
system, which is a FAT32 file system used for external flash cards. The EFFS-STD file system uses the on-chip
flash memory of your NetBurner device. It has a different set of libraries and functions than the EFFS-FAT file
system. In most cases the differences between the EFFS-STD and EFFS-FAT are simply a change in functioncall
prefix from f_ to fs_. For example, the EFFS-FAT function call f_open() is fs_open() for EFFS-STD. A list
of the documented functions can be found at EFFS-STD Flash File System.

9.3.7.1.2 Overview When using the on-chip flash you need to be aware that the flash will be shared between
your application and the file system. You will need to specify the amount of space to be used by the file system,
while making sure you leave enough room for your application. The amount of flash used by your application is
displayed each time you compile. You want to use the compressed number, not the uncompressed. You certainly
want to leave enough additional space so your application can grow.
The flash memory chip will be divided into sectors, typically 4k or 64k bytes in size. The EFFS-STD file system
requires that you allocate a number of these sectors to be used by the file system. Please review the data sheet
for the flash memory used on your NetBurner device so you are familiar with the architecture. The configuration
settings are dependent on the specific flash chip you are using.

9.3.7.1.3 Examples

NetBurner, Inc.
106 Programmers Guide

9.3.7.1.3.1 EFFS STD Examples The HTTP example located at \nburn\examples\EFFS\Std demon-
strates HTTP access to the STD file system. Web pages can be served from the application itself, or overridden if
the same file name exists in the file system.

9.3.7.1.3.2 EFFS STD With NetBurner's Security Library Example are located at \nburn\examples\SSL
HttpsUploadCert - This program will demonstrate how to upload certificates and keys to support SSL/TLS web
page access and store them in the EFFS-STD file system.
SslVerifyPeerEffs - This program will demonstrate how to upload CA Lists to use in support of verify peer, and store
them in the EFFS-STD file system.

9.3.7.1.4 Project Settings To create a project that uses the EFFS-STD file system, you will need to complete a
few extra steps in addition to your normal project setup.
For NBEclipse users:

• Modify the COMPCODEFLAGS to match the new memory space of the application. The remaining space will
be used for the file system. The format of the COMPCODEFLAGS setting is: COMPCODEFLAGS <start
address> <end address>.
• Add the EFFS-STD library StdFFile.a to the linker path

• Import the source files found here into your project <nburn_install>\examples\_common\EFFS\STD

For projects that use the command line tools:

• Add the following lines to your makefile:

XTRALIB = $(NNDK_ROOT)/platform/$(PLATFORM)/original/lib/libStdFFile.a
include $(NNDK_ROOT)/examples/_common/EFFS/STD/common.mak

9.3.7.1.5 Flash Memory Addresses The flash memory on your NetBurner device is used for the Boot Monitor,
System Parameter Storage, User Parameter Storage, Application, and now the EFFS-STD file system. A table of
memory sizes for NetBurner platforms at the time of this writing is shown below. The example column illustrates one
possible configuration. You can modify the parameters to suit your requirements. The COMPCODE flag starting
address specifies the starting memory location of your application. The end address specifies the end location of
the application. You should not modify the starting address! The Boot Monitor, Configuration Record and User
Parameters occupy the space between the start of flash memory address and the start of the application memory
address. You will only need to modify the end address to represent the amount of memory allocated for the flash
file system.

NetBurner, Inc.
9.4 File Descriptors 107

Platform Total Size in Bytes Start Address End Address Configuration Definition
Example
MODM7AE70 2MB 0x00400000 0x005FFFFF Example for 512K flash file
system
Application must begin at
0x0040600
COMPCODEFLAGS =
0x00406004 0x005A0000

#define FLASH_SIZE ( 2*1024*1024


) // Total flash
size<br>#define FS_SIZE (
256*512 ) // Size of
filesystem

9.3.7.1.5.1 Configuration File for SAME70Q21 Please refer to the SAME70Q21.h file located at
\nburn\examples\_common\EFFS\STD\src\flashChip

9.4 File Descriptors


The NetBurner environment integrates the RTOS, TCP/IP stack, and other peripherals with a file I/O system based
on file descriptors. A file descriptor can be described as a handle to a network socket, serial port, system peripheral,
or any other object that can be read or written to. Most of the API functions pass a file descriptor as a parameter to
such an object
By default there are a maximum of 255 file descriptors:

• 0 – 2 for stdin, stdout and stderr

• 3 – 4 for the first two UART serial ports, 0 and 1.

• 5 – 128 for TCP (32 in total)

• 129 – 250 for expansion (additional UARTs, TCP sockets, or custom)

The expansion file descriptor positions can be used for many things, including additional serial ports, such as an
external UART, TCP ports, or even buffers.

9.4.1 Creating Custom I/O Drivers Using File Descriptors


The header file in \nburn\include\iointernal.h defines the programming interface functions to create a
custom file descriptor.

• SetDataAvail()

• ClrDataAvail()

• SetWriteAvail()

• ClrWriteAvail()

• SetHaveError()

• ClrHaveError()

NetBurner, Inc.
108 Programmers Guide

struct IoExpandStruct
{
int ( * read ) ( int fd, char *buf, int nbytes );
int ( * write ) ( int fd, const char *buf, int nbytes );
int ( * close ) ( int fd );
void *extra;
}
int GetExtraFD( void *extra_data, struct IoExpandStruct *pFuncs );
void *GetExtraData( int fd );
void FreeExtraFd( int fd );
The TCP state call back, fd = socket has new data, fd < 0 means error typedef void ( tcp_read_←-
notify_handler )( int tcp_fd );
When data comes in or the TCP connection enters an error state, register a callback to handle the event void
RegisterTCPReadNotify( int tcp_fd, tcp_read_notify_handler ∗newhandler );
The Set and Clr functions are used to update the state of your fd device for file I/O functions such as select(),
read() and write(). The IoExpandStruct is used to declare function pointers for the read(),
write() and close() functions that will be implemented in your application, as well as an “extra” void pointer
that you can use for whatever you wish.
GetExtraFD() is the function that will return a fd for the object passed as the IoExpandStruct. The extra←-
_data void pointer is optional, and can be used to pass data into your fd. You can read the extra_data value at any
time with the GetExtraData() function. FreeExtraFd() will release the fd back to the pool of available fds.
The tcp_read_notify_handler and RegisterTCPReadNotify() are callback functions. These func-
tions will get called by the system if you define them for the corresponding TCP event.

9.4.2 Using File Descriptors to Pend on Multiple Events


Once you have created a file descriptor you can use the select() function call just as you would for network or
serial file descriptors. In fact, you can pend on a mixture of them all at the same time.

9.5 HTML Processing


9.5.1 Introduction
The Web Server will process all content in a project's "html" folder. If you are using any of the html examples or the
application wizard, the html folder will have been created for you. If adding html and web server functionality to a
project without a html folder, simply create one, and add the corresponding StartHttp() or StartHttps() function call
to your application to start web server services.
You can add whatever content you wish to the html folder: HTML, CSS, java script, java, images, etc. The NetBurner
tools will automatically compile and link them into the application image that you download into your NetBurner
device. You can use whatever web development tools you wish to create content, or write content with a text editor.
The content in the html folder can be static pages or take advantage of dynamic content using function callback
and variable tags. Static content can also be delivered from the onboard EFFS-STD file system and the external
EFFS-FAT file system used by flash cards.

Note

When using NBEclipse, you can view web content source by right-clicking on the file and selecting Open With
-> Text Editor

The function StartHttp() with no parameters will default to port 80. To use a different port number add a pa-
rameter, such as StartHttp(2000). Similarly, StartHttps() will default to port 443. The function can have
up to 2 parameters, one for HTTPS and one for HTTP. StartHttps(527) changes the HTTPS port number.
StartHttps(442, 80) enables both HTTPS and HTTP on the standard ports.

NetBurner, Inc.
9.5 HTML Processing 109

9.5.2 Dynamic Content


Dynamic content is generated at run-time on your NetBurner device. For example, you can a web page for an in-
strument in which the content changes to match the current state of the instrument, such as gauges, light indicators,
and switches. Or you can provide a graph showing data by creating an image or using any of the advanced tool
such as Bootstrap. There are many examples of this in the \nburn\examples\web folder.
Dynamic content can be created in a number of ways:

• Function callback tags in HTML code to call a C/C++ function in real time as the web page is being rendered,
such as CPPCALL

• Variable tags in HTML code to insert application variable values in real time as the web page is being ren-
dered, such as VARIABLE

• Languages such as Javascript that runs in the browser

• A HTTP GET request handler that will be called when a web page is requested from the web browser

• A HTTP POST handler that will be called when a web page FORM post data to the web browser

• Web Sockets for two-way communication

• Web content can be delivered from multiple sources: content compiled into the application, generated by
application code, internal file system (EFFS-STD in on-chip memory), or an external file system (EFFS-FAT)
such as microSD flash cards.

9.5.3 HTML Tags


You can think of web server operation as receiving a request from a web browser for a file, and responding by
sending that file as a data stream back to the browser. One method to create dynamic content is to embed a "tag"
in the HTML source code file so that when the web server encounters it while streaming the content to the web
browser, it takes some type of action in real-time. The NetBurner web server uses a number of tags to accomplish
real-time dynamic content.

Tag Description
CPPCALL Call a C++ function in the application without parameters
VARIABLE() Call a C++ function with parameters
VARIABLE Insert the value of an application variable

The tags are used inside a HTML comment so they do not interfere with standard HTML processing. For example,
a function callback could be used to format and display client information from the web browser:
Client Info: <!--CPPCALL webShowClientInfo -->

Warning

The space characters in the HTML comment block are important. there should be no space between "!--" and
CPPCALL, and there must be a space between the end of the function name and "-->": <!--CPPCALL
YourFunctionName -->

9.5.3.1 Configuration System Tags

While the previously mentioned tags can be used to display and/or modify any type of system configuration or
application variables, the CONFIG tags are another option and can greatly simplify the interface. The CONFIG tags
are designed to operate on the variables in the Configuration Record, which holds system configuration variables
as well as any application variables in the AppData leaf of the configuration tree structure.

NetBurner, Inc.
110 Programmers Guide

Tag Description
CONFIGVALUE Display a configuration or application variable value.
CONFIGINPUT Display a configuration or application variable value and create a HTML "<input>" field. The
current variable value will be displayed.
CONFIGTABLE Create a table of the object and all sub-objects

9.5.3.2 The CPPCALL Tag

When the web server encounters a CPPCALL tag, it executes the corresponding C++ function in the application
code. The function is passed the file descriptor to the open TCP socket and a pointer to the URL of the web
page. The function then has control and can do whatever is desired by the application: create web content, perform
operations such as controlling hardware, change software options, etc.

Note

The FUNCTIONCALL tag is is a 2.x tools tag and deprecated. The difference is the CPPCALL does not
require extern "C" declarations in application source code to prevent C++ name mangling.

The screen shot below shows the usage for CPPCALL, VARIABLE and VARIABLE(x, y) tags:

NetBurner, Inc.
9.5 HTML Processing 111

Figure 9.4 HTML Page with CPPCALL and VARIABLE Tags

The CPPCALL function signature is:


void YourFunctionName( int sock, PCSTR url )
{
// add code here
}
For example, to display the IP address and port number of the client that made the web page request:
HTML Code:

<html>
<body>
Client Address: <!--CPPCALL webShowClientInfo -->
</body>
</html>

The corresponding C++ function in the application:

void webShowClientInfo( int sock, PCSTR url )


{
IPADDR localIP = GetSocketLocalAddr(socket);
uint32_t remotePort = GetSocketRemotePort(socket);
localIP.fdprint(socket); // Write IP address
fdprintf(sock, ": %d<br>\r\n", remotePort);} // Write port number
}

9.5.3.3 The VARIABLE Tag

The VARIABLE tag has two uses:

NetBurner, Inc.
112 Programmers Guide

1. Simply inserting a variable or expression

2. Calling an application function with variable parameters (essentially a CPPCALL with function parameters)
To display a variable the format is: <!--VARIABLE <name> -->
Where <name> is the name of the application variable or an expression. For example, the system time tick
variable, TimeTick can be displayed with <!--VARIABLE TimeTick -->
Or you can display the time in seconds with the equation: <!--VARIABLE TimeTick/TICKS_PER_SECOND
-->
The VARIABLE tag is processed during the compilation of the application by parsing the text between “<!--←-
VARIABLE” and the trailing “ -->”, then the NetBurner tools automatically convert it into a function call with
a signature that contains a file descriptor and variable. For example, WriteHtmlVariable( fd, Time←-
Tick/TICKS_PER_SECOND );
The following parameter types are available and defined in \nburn\include\htmlfiles.h:

void WriteHtmlVariable(int fd, char c);


void WriteHtmlVariable(int fd, int i);
void WriteHtmlVariable(int fd, short i);
void WriteHtmlVariable(int fd, long i);
void WriteHtmlVariable(int fd, uint8_t b);
void WriteHtmlVariable(int fd, uint16_t w);
void WriteHtmlVariable(int fd, unsigned long dw);
void WriteHtmlVariable(int fd, const char *);
void WriteHtmlVariable(int fd, MACADR ip);

9.5.3.4 The INCLUDE Tag and htmlvar.h Header File

The functions that are created from the VARIABLE tags are located in an auto-generated file named htmldata.cpp.
Since these functions reference the variable names, there must be a way for the linker to resolve them. For example,
to display TimeTick the application would need to include <nbrtos.h>, otherwise a linker error will occur.
Include files for the HTML code/files to enable linking can be handled two ways:
1. An include HTML tag, <INCLUDE headername.h> in the HTML code

2. Create a header file in the project with the name "htmlvar.h". The tools will automatically look for a file of this
name if <INCLUDE> tags are not detected in the HTML source files.
Example of a HTML file using the INCLUDE tag with a user defined header file name:

<html>
<body>
<!--INCLUDE myIncludeFile.h -->
Value = <!--VARIABLE MyVar --><br>
</body>
</html>

Example of htmlvar.h header file that exposes two variables, the <nbrtos.h> header file, and a function
that takes an integer parameter:

#ifndef HTMLVARS_H_
#define HTMLVARS_H_
#include <nbrtos.h> // For access to TimeTick
extern int gIntVal;
extern char gStrVal[];
const char *FooWithParameters(int fd, int v);
#endif /*HTMLVARS_H_*/

9.5.3.5 The VARIABLE() Tag With Parameters

If you need to specify a function callback but need to pass a parameter, the CPPCALL tag will not work because
the function signature parameters are fixed as the socket file descriptor and URL. In this case we can use the
VARIABLE tag to achieve the functionality of calling a function with a variable.
The include file (e.g. htmlvar.h) must specify the function definition in the format below. In this case we are passing
an integer value ‘v’. The first parameter must always be the socket file descriptor: const char ∗ myInt←-
Function(int fd,int v);

NetBurner, Inc.
9.5 HTML Processing 113

The HTML source code then uses the VARIABLE tag with the function definition. In this example we are passing
the integer value of TimeTick. <!--VARIABLE MyIntFunction(fd,TimeTick) -->
When the application is compiled, the function definition will be created as: WriteHtmlVariable( fd, My←-
Function(fd,TimeTick) );
This function returns an empty string, which will have no effect on the web page. An example of what a function
might do is shown below:
const char *FooWithParameters(int fd, int v)
{
fdprintf(fd, "This function was called with parameter v = %d\r\n", v);
return "\0"; // Return a const char * here of zero length so it will
not print anything
}

9.5.3.6 Extending the VARIABLE Tag

The VARIABLE functionality can be extended to support user defined types, such as displaying a user defined
structure or class. Let’s say you have a structure you want to display on a web page called myStruct:

struct my_struct {
int i;
char buf[80];
uint32_t dVal;
} MY_STRUCT;
MY_STRUCT myStruct;

In your include file add the function definition: void WriteHtmlVariable(int fd, MY_STRUCT my←-
Struct);
Now you can display it on the web page with the VARIABLE tag: <!--VARIABLE myStruct -->
Which will compile to: WriteHtmlVariable( fd, myStruct );
Note that you still have to write the implementation of the above function. The function below is the source code for
the MAC address type already defined by the system:

void WriteHtmlVariable(int fd, MACADR ma)


{
PBYTE lpb = ( PBYTE ) &ma;
for (int I = 0; I < 5; i++)
{
fd_writehex( fd, lpb[i] );
write(fd,":",1);
}
fd_writehex( fd, lpb[6] );
}

9.5.3.7 The CONFIGVALUE Tag

9.5.4 HTTP GET Request Handler


When you click on a link or enter an address in the URL field of a web browser, it sends a GET request to the
web server. At its most basic level a GET request is the word "GET" and the requested file name. A GET handler
is a mechanism by which an application can take control of the GET request instead of it being handled by the
normal web server processing. For example, if an application implemented a GET handler for a HTML page named
"showstatus.html", the GET handler could create whatever type of status output it wanted instead of the web server
delivering a file named "showstatus.html".
A GET handler is also useful for URL encoding. Two common methods for delivering data from a client (eg. web
browser) to a web server are URL encoding and HTML forms using a POST submission. URL encoding involves
sending data to the web server by adding it to the end of the URL. For example, an e-commerce application might
store product information such as: http://www.store.com/orderform?type=order123. The data
sent to the web server to be processed "type=order123" in the URL. Everything following the "?" character is ignored

NetBurner, Inc.
114 Programmers Guide

by the browser, so your application can store information there. Another advantage of this method is that the
application can be stateful, meaning multiple users can access the same application and each user’s session is
maintained by the data encoding in the URL.
When a web browser requests something from a web server, such as an HTML page or image, it makes a GET
request. The web server normally handles static web pages and dynamic web pages with the CPPCALL and
VARIABLE tags, but your application can intercept the request and take control of the processing using a callback
function object called CallBackFunctionPageHandler. When you declare the instance of the object you specify the
name of the request to intercept and a pointer to the function in your application to process the request. For example,
to take control of processing for a HTML page named setcookie.html:
To create a HTTP GET handler:

1. Create an application callback function to process the GET request

2. Create a CallBackFunctionPageHandler declaration to specify the URL mask, application callback function,
and additional configuration parameters

A GET handler consists of a callback function to handle the actual processing, and a page handler declaration
specify the conditions in which the callback function should be executed. The callback function sends an HTML
header to identify the content, in this case it is HTML, determines if the system seconds timer is odd or even, then
sends the appropriate HTML file as a response. Note that OddEven.html does not exist as a file. The GET request
for OddEven.html is intercepted by the callback.
The callback has the function signature: ‘int callbackGetOddEven(int sock, HTTP_Request &pHttpRequest)’
The page handler declaration has the signature:

CallBackFunctionPageHandler(const char *pUrl,


http_gethandlerfunc *pFunction,
HTTP_RequestTypes reqType = tGet,
int accessGroup = 0,
bool beforeFiles = false)

/*---------------------------------------------------------------------------------------
* Callback to intercept a GET request for URL OddEven.html. The purpose of this callback
* example is to demonstrate how to add custom processing and send an existing HTML file.
* The URL OddEven.html does not exist as a file. If the page is requested by a browser,
* this callback function is executed, which does some processing and decides which web
* page file to send to the browser based on the current system seconds timer value.
*
* - Sends a HTML header to the browser to specify the content that follows is HTML
* - Reads the system seconds timer, and sends the file odd.html or even.html
* - A return value of 1 tells the system the HTML request was handled by the callback
*
* Notes:
* - HTTP_Request is a structure containing detailed information of the request
*--------------------------------------------------------------------------------------*/
int callbackGetOddEven(int sock, HTTP_Request &pHttpRequest)
{
// Send the web page header telling the browser we are sending HTML content
SendHTMLHeader(sock);
//----- Add custom processing here -----
// Display message to serial terminal showing requested URL
iprintf("Executing GET request callback function: callbackGetOddEven\r\n");
iprintf("Request URL: %s, from: %I\r\n", pHttpRequest.pURL, pHttpRequest.client_IPaddr);
if ( (Secs % 2) == 0)
SendFileFragment("even.html", sock);
else
SendFileFragment("odd.html", sock);
// Notify system we handled the GET request
return 1;
}
/*
* Declare the callback function. Parameters:
* OddEven.html URL to intercept
* callbackGetOddEven Pointer to the callback function
* tGet HTTP Request Type (ref HTTP_RequestTypes)
* 0 User Access Group, 0 = no password
* true When to call (beforeFiles parameter):
* true: Always called for the specified URL
* false: Only called if the if the requested URL cannot be satisfied elsewhere
*/
CallBackFunctionPageHandler getHandlerOddEven("OddEven.html", callbackGetOddEven, tGet, 0, true);

A key component is the CallBackFunctionPageHandler declaration. Lets look at each parameter:

NetBurner, Inc.
9.5 HTML Processing 115

pURL: is the URL name to match. In this case it is fully defined as "OddEven.html", but wildcards can also be used.
Although not very useful in this case, it could have been "Odd∗", which would result in the callback being executed
for anything beginning with "Odd".
pFunction: is a pointer to the function callback.
tGet: is the request type, in this case it is a GET, which has a request type of tGet.
accessGroup: is used for security/password access. Not the subject of this example, so a 0 for no access
restriction is used.
beforeFiles: refers to the html content in the html folder of the project. If true, the callback will be executed
without the web server first checking to see if a file by that name exists. If false, if a file by the pURL name is found,
it will be sent to the client first.

9.5.5 HTTP Form POST Handler


You have probably encountered forms many times on the web, such as e-commerce and feedback forms. The
format is typically some number of text fields, check boxes, radio buttons, combo boxes and a submit button. When
you click on the submit button, the data from the form is sent to the web server as a HTTP POST. The web server
then parses the data and takes appropriate action.
A form is declared in HTML by the <form> tag. User input is controlled by various <input> tags. For example,
the web page below creates a form with a text field. NetBurner tags such as CPPCALL, VARIABLE and CONFIG
tags can be used to populate input fields with their current value.
To create a HTTP POST form handler:

1. Create a HTML web page with a form

2. Create a corresponding application callback function to process the posted data

3. Create a HtmlPostVariableListCallback declaration to specify the matching callback mask and attach the
application callback function

The example below creates a HTML page with four input fields, and a POST handler callback function to process
them.

NetBurner, Inc.
116 Programmers Guide

Figure 9.5 HTML form with four variables

HTML Code:

<html>
<title>HTML Post Example</title>
<body>
<img src="images/netburner-logo.gif">
<h1><font face=arial>HTML Form Post Example, Second Form</font></h1>
<br>
<form action="form2" method=post>
Enter data to post var0: <input type="text" name="Var0" value="Var0"><br><br>
Enter data to post var1: <input type="text" name="Var1" value="Var1"><br><br>
Enter data to post var2: <input type="text" name="Var2" value="Var2"><br><br>
Enter data to post var3: <input type="text" name="Var3" value="Var3"><br><br>
<br><input type="submit" value="Submit"><br>
</form>
</body>
</html>

Corresponding Application Source Code:

/*
* Callback function for Form2. This function will be called once for each variable
* in the form.
*/
void form2PostCallBack(int sock, PostEvents event, const char * pName, const char * pValue)
{
// Received a call back with an event, check for event type
switch (event)
{
// Called at the beginning of the post before any data is sent
case eStartingPost:
for (int i = 0; i < numVars; i++)
strVar[i][0] = ’\0’;
form2ParseError = false;
break;
// Called once for each variable in the form
case eVariable:
if (strcmp("Var0", pName) == 0)
{
strncpy(strVar[0], pValue, varLen - 1);
iprintf("strVar0 set to: \"%s\"\r\n", strVar[0]);
}
else if (strcmp("Var1", pName) == 0)
{
strncpy(strVar[1], pValue, varLen - 1);
iprintf("strVar1 set to: \"%s\"\r\n", strVar[1]);

NetBurner, Inc.
9.6 IPv4/IPv6 Dual Stack Guide 117

}
else if (strcmp("Var2", pName) == 0)
{
strncpy(strVar[2], pValue, varLen - 1);
iprintf("strVar2 set to: \"%s\"\r\n", strVar[2]);
}
else if (strcmp("Var3", pName) == 0)
{
strncpy(strVar[3], pValue, varLen - 1);
iprintf("strVar3 set to: \"%s\"\r\n", strVar[3]);
}
else
{
iprintf("*** Error: Form variable name not found\r\n");
form2ParseError = true;
}
break;
//Called back with a file handle if the post had a file
case eFile:
break; //No file type here so we do nothing
// Called back when the post is complete. You should send your response here.
case eEndOfPost:
{
iprintf("Variable Summary:\r\n");
for (int i = 0; i < numVars; i++)
iprintf(" Var%d = \"%s\" \r\n", i, strVar[i]);
if (form2ParseError)
iprintf("*** Error: Form variable name not found\r\n");
RedirectResponse(sock, "complete.html");
}
break;
} //switch
}
// Create a global static post handling object that responds to the specified html page.
// A separate post handler can be created for each form in your application.
HtmlPostVariableListCallback postForm2("form2*", form2PostCallBack);

When a post is submitted the callback post handler will be executed a number times for the following events:

Event Description
eStartingPost Occurs once at the first event of a post
eVariable Occurs once for each variable in the form
eFile Occurs if a file is being posted
eEndOfPost Occurs once at the end of post processing

In this example the following events will occur:

• eStartingPost is called first and enables the application to initialize the array.

• eVariable is called once for each variable (input field). In this example it will be called 4 times. The callback
function must parse for the input field name on each call.

• eFile is called. Since we are not posting a file no action is taken.

• eEndOfPost is called last. In this example it is used to print a summary of the input field values

The HtmlPostVariableListCallback declaration is used to specify the URL name and mask, as well as a pointer to
the post handler callback. Full URL names can be specified with and multiple callback functions, or a wildcard can
be used and the post handler callback must parse the URL information to determine the correct action.

9.6 IPv4/IPv6 Dual Stack Guide


Releases prior to 2.8.0 use a type of IPADDR that was a 32-bit number. The most significant change for 2.8.0 and
beyond is that the IPADDR type is now an object that can hold IPv4 or IPv6 address information. This document will
provide more information on this issue in the IPADDR class section.

NetBurner, Inc.
118 Programmers Guide

9.6.1 Obtaining IPv6 addresses


IPv6 addressing is quite a bit different than IPv4, in which there is typically one IP address per network interface
which is assigned by DHCP or set to a static address. In order for an interface to have more than one IP address it
can use the Multihome feature. For example, a host's IPv4 AutoIP address.

9.6.1.1 Link-Local

When using IPv6, all interfaces have multiple IP addresses. For starters there is the ‘link-local’ address (fe80:←-
:/64). This is an address that is valid only for the local link that the device is connected to, and is used to negotiate
the other addresses for the interface. While it can be used for any communication on the link, it is not a routable
address. The link-local address is derived from the MAC address of the interface. As a result it is fixed for a given
interface and determined without having to be explicitly set. For example, a device with the mac 00:03:f4:01:23:47
would have the link-local address fe80::203:f4ff:fe01:2347.

9.6.1.2 Router Auto-Configuration

In addition to the link-local address, IPv6 routers can tell the device to auto-configure based on the router’s assigned
prefix. To configure the end address, the device takes a number of bits of the router's prefix (usually 64), and
combines this with its auto-configure address (the calculated portion of link-local) to obtain the prefix address. In
our previous case, let’s assume a router advertised a prefix of 2001:db8:1:2::. In this case, the full prefix address
would be 2001:db8:1:2:203:f4ff:fe01:2347. This applies for all routers on the link that advertise auto-configuration.
It’s entirely possible (and reasonable in large corporate networks!) for an interface to have multiple prefix addresses
from multiple routers.

9.6.1.3 DHCPv6

IPv6 addresses can also be assigned by a DHCPv6 server. Like DHCP for IPv4, this is used for assigning addresses
to devices, along with passing other information like DNS and NTP servers. It is also possible for routers to notify
devices that there is a DHCP server present on the network. In the case where such notification occurs, the Net←-
Burner will automatically configure to obtain the relevant information. There are two types of DHCP servers in IPv6
networks: Information-only and full Stateful Configuration. Information-only servers exist solely to provide additional
information about the network, but do not assign IP addresses. These will allow for the auto-configuration of DNS,
NTP servers, or other desired information. Full Stateful configuration additionally assigns addresses for use on the
device’s link. It is possible to manually start the DHCP client as well, for use on networks without a router.

9.6.1.4 Static IP Addresses

Finally, if all of these methods are insufficient, it is possible to manually assign and address to the device’s interface
as well.

9.6.2 IPADDR Class


The IPADDR type in NetBurner tool releases prior to 2.8.0 was a 32-bit unsigned integer. In order to be able to
handle IPv6 addresses with the least impact to existing applications, it is now a C++ object. You will not need to
know C++ in order to use these objects. Most function calls will not have to change, and the system will do the
appropriate action for both IPv4 and IPv6 addresses. One major change for users that have created custom storage
structures that store IPADDRs in UserParams or a file on a file system is that when compiled for IPv6, the IPADDR is
now 128 bits instead of 32. This means that unless plans are made for this, reading back stored IPADDRs will cause
a problem for the application configuration in previously deployed devices that are updated. One way to address
this issue is to use something like a 32-bit storage "key". Whenever reading the configuration structure check that
the key in the application matches the key stored in memory. If different, then you must initialize the values. Any
time you make a change to the stored information, such as adding a variable, increment the key.
The most significant difference is that while an unsigned 32-bit integer can be checked for a value of 0, an object
cannot. For example, many applications check for a static IP address setting with if (EthernetIP == 0). If
EthernetIP is now an IPADDR object, the test should now be: if (EthernetIP.IsNull()).
For function parameters that were previously set to 0 to represent a null value, you can use IPADDR::NullIP().
For example, in previous releases a 0 was used for parameter 3, the DNS Server IP address, to tell the system to
use the current runtime system DNS IP address value. This will generate an error in the new tools release since the

NetBurner, Inc.
9.6 IPv4/IPv6 Dual Stack Guide 119

3rd parameter must be a typed object rather than an integer value. You may also use the INADDR_ANY, which is
defined as IPADDR::NullIP() in the system files.
DNSResult = GetHostByName( serverName, &serverIp, 0, TICKS_PER_SECOND ∗ 20
);
Becomes
DNSResult = GetHostByName( serverName, &serverIp, IPADDR::NullIP(), TICKS_←-
PER_SECOND ∗ 20 );

9.6.3 IPADDR Member Functions


C programmers are used to creating structures that contain variables. A very simplistic way to look at a C++ object
is that it is a structure that contains both variables and function declarations. These functions are called member
functions. They are called using a dot notation instead of calling the function by itself. For example, in prior releases
to print an IP address to the debug serial port (stdout) you might use the function: ShowIP(EthernetIP). In
the new release this becomes: EthernetIP.printf(). To print to a file descriptor such as a TCP socket, you
can use: EthernetIP.fdprintf(fd).

Some common functions are described below in their simplest form. Many of the functions have optional parame-
ters, and experienced C++ programmers may want to know more detailed information, such as which are static and
default parameters. Please refer to the NetBurner API documents for more information: IPADDR6

9.6.3.1 Setting IP Address Values with Member Functions

Member functions are called using a “.” after the object instance name. For example:
IPADDR myIpObject;
myIpObject.SetNull(); // set the IP address to null

9.6.3.2 Member functions to set an IP address:

• void SetNull() Set the IP address of an existing IPADDR object to null

• void SetFromAscii(const char ∗pStr), Set the IP address to the value of the ASCII represen-
tation in the string pointed to by pStr

• void SetFromIP4(IPADDR4 ip), Set the IP address of an IPADDR4 object from an existing IPADDR4
object

9.6.3.3 Setting IP Address Values with Static Functions

A “static” function is one that is not attached to any particular instance of an object. They are invoked with a double
colon “::”. For example, IPADDR::NullIP() is used to represent an object instance with an IP address of null.

• static IPADDR6 NullIP(), Return an IPADDR6 object whose IP address is NULL. For example,
IPADDR::NullIP();

• IPADDR AsciiToIp(const char ∗ pStr), Sets the IP address to the value represented by
the ASCII string pointed to by pStr. For example, IPADDR myIpAddr = IPADDR::AsciiTo←-
Ip(“192.168.1.1”);

9.6.3.4 Reading and Checking IP Address Values

• bool IsNull(), Returns true if the IP address is null

• bool IsLoopBack() Returns true if the IP address is the loopback address

• bool IsMultiCast() Returns true if the IP address is a multicast address

• bool IsLinkLocal() Returns true if the IP address is the IPv6 link local address. A link local address
is of the format
FE80::/10

NetBurner, Inc.
120 Programmers Guide

• bool IsEmbeddedIPV4() The same storage space is used to represent an IPv4 or IPv6 address. The
function returns true if the address is
::FFFF:xx.xx.xx.xx

, where the x’s represent the IPv4 address.

• MACADR McastMac() Returns the MAC address for multicasts at this IP address, or null if not a multicast
address.

9.6.3.5 Output an IP Address

• void printf() Print the IP address value to stdout. The default stdout is the debug serial port

• void fdprintf(int fd) Print the IP address value to the specified file descriptor

• int sprintf(char ∗pStr, int maxl) Sends output to the string pointed to by pStr. maxL = Max-
imum number of characters to write. Returns the number of characters written.

9.6.4 Domain Name Service (DNS)


The function signature for DNS changes slightly between IPv4 and IPv6. However, if you use the default parameters,
your code can be identical in both cases.

• GetHostByName4() IPv4 only and always available

• GetHostByName6() Available when IPV6 is enabled

• GetHostByName() Defined to GetHostByName4() in IPv4 mode and GetHostByName6() in IPv6 mode

The following code example will work in both cases:


GetHostByName(“thename.com”, &resultIP, IPADDR::NullIP(), 10 ∗ TICKS_PER_←-
SECOND);
This will put the IP address of “thename.com” in the resultIP. If you need DNS records other than just the name you
can add additional type parameters. The types are:

• DNS_A, IPv4 address record

• DNS_CNAME, Canonical name record

• DNS_MB, Mailbox resource record

• DNS_MG, Mail group resource record

• DNS_MX, Mail exchange record

• DNS_AAAA IPv6 address record

When using DNS in IPv6 you need to decide which address to choose if the server has both an IPv6 and IPv4
address. The function GetHostByName6() has two default value types:
int GetHostByName6( const char *name, // Name to resolve
IPADDR *pResultIP, // Stores resultant IP
const IPADDR &dnsServerIP, // DNS server IP address to use, or IPADDR::NullIP() for
system
WORD timeout, // Timeout in system time ticks
WORD TYPE1 = DNS_A, // Defaults to IPv4 address
WORD TYPE2 =DNS_AAAA ); // Defaults to IPv6 address
The function will first try to get the TYPE1 value. If that fails, it will try to get the TYPE2 value. In the default case as
defined in the header file it tries to get an IPv4 address, and if that fails it gets an IPv6. If you want to reverse this
priority and try to get the IPV6 first then add the additional types in the function call:

‘GetHostByName(“thename.com”, &resultIP, IPADDR::NullIP(), 10 * TICKS_PER_SECOND, DNS_AAAA, DNS_A);‘

9.6.5 Note for OSX Users


At the time of this writing, BSD derived network stacks (including Apple’s OS X) are not able to navigate to link-local
addresses in a browser. You must use something refer to as a scope ID.

NetBurner, Inc.
9.7 NetBurner RTOS 121

9.7 NetBurner RTOS


The NetBurner Real-Time Operating System (NBRTOS) a full featured preemptive multitasking real-time operating
system, supporting multiple tasks, semaphores, mail boxes, FIFOs, queues, and critical sections just to name a few.
As part of the NetBurner development package, the RTOS is pre-configured and running. The task you will normally
start with is named UserMain().
There are 255 priority levels (1 through 255). The lower the number, the higher the priority. Some of these tasks are
reserved by the system, such as the idle task. You can specify a priority when the task is created, and change the
priority later if you wish. A priority level can only be used by one task at a time. Be sure to check the return values
when creating a task or changing a task priority to verify that the operation was successful.

9.7.1 What is a Preemptive RTOS?


9.7.2 Preemptive Operation, Priorities and Blocking
In a preemptive operating system the highest priority task ready to run will always run. This is an extremely important
point, so we will mention it again: the highest priority task ready to run will always run. This is different than a
Windows or Unix system that employs a round-robin in which each task will run based on its time slice. If you create
a high priority task that can always run and never blocks, then no lower priority tasks will ever run. Lower priority
tasks can only run when a higher priority task blocks on a resource or blocking function call.
For example, there are two tasks A and B. Task A has priority 50 and Task B has priority 51. Since Task A is of
higher priority, it will always run (and Task B will never run) unless it calls a blocking function. Task B will then run
for as long as Task A blocks; this could be 1 second due to a call to OSTimeDly(TICKS_PER_SECOND), until
a shared resource is available due to a call to OSSemPend(), or until data is available from a network connection
due to a select() or read(). It both tasks are in a blocking state, then the RTOS idle task will run.

9.7.2.1 RTOS Blocking Functions

Generally any function that pends on a resource or creates a time delay:

• OSTimeDly()

• OSSemPend()

• OSMboxPend()

• OSQPend()

• OSFlagPendAny()

• OSFlagPendAll()

9.7.2.2 I/O Functions That Can Block

Generally any function that does a read operation or pends on a file descriptor

• select()

• read(), including variants with timeouts

• write(), blocks until at least one char can be written

• gets()

• getchar()

• fgets()

NetBurner, Inc.
122 Programmers Guide

9.7.2.3 Network Functions That Can Block

Generally calls that will pend on an incoming connection or received data

• accept()

• Creation of a UDPPacket packet object when initialized to receive data

9.7.2.4 Functions That Can Enable a Task To Be "Ready To Run"

Generally functions that post to pending objects

• OSMboxPost()

• OSQPost()

• OSSemPost()

9.7.2.5 System Task Priorities

The number and type of system tasks and priorities used by the system will depend on your platform and the system
features used by your application. For example, if your application calls StartHTTP( ) to enable web services, then
a system task will be created that handles web server requests. The system task priority levels are defined in
\nburn\nbrtos\include\constants.h.

9.7.3 Task Creation


Whether you use the Application Wizard in NBEclipse to create a new application, or start with one of the example
programs, you will notice that the point at which your application takes control is a function named UserMain().
UserMain() is a task created by the system. The first few lines will consist of system initialization functions such
as init() and StartHttp().
Additional tasks are created with the OSTaskCreatewName() or OSSimpleTaskCreatewName() func-
tions. The following is an example program that demonstrates the use of each function. When using OSTask←-
CreaewName() you specify all parameters:
• Task function name

• Optional parameter to pass to the task, NULL if not used

• Top of the task stack

• Bottom of the task stack

• Task priority

• Task name

A significant benefit of the full function call is that it returns the status of the task creation process. For example,
one possible error is that you cannot create a second task at the same priority as any other task.
The 'OSSimpleTaskCreatewName()' implementation lets you specify just the task function, priority, and name.
/*
* This example demonstrates how to use two of the task creation
* functions:
* - OSSimpleTaskCreatewName()
* - OSTaskCreatewName()
*
*/
#include <init.h>
#include <stdlib.h>
#include <nbrtos.h>
#include <system.h>
#include <utils.h>
const char *AppName = "OSTaskCreate Example";
// Allocate stack space
uint32_t TaskAllParamsStack[USER_TASK_STK_SIZE];
/*-----------------------------------------------------------------------------

NetBurner, Inc.
9.7 NetBurner RTOS 123

* Task created with OSTaskCreatewName() using all function parameters.


* The void *pd parameter can be cast to any type of data you wish to send to
* the task, or NULL if not used.
*----------------------------------------------------------------------------*/
void TaskAllParams(void *pd)
{
uint32_t loopCount = 0;
uint32_t delayTime = (uint32_t)pd;
iprintf("TaskAllParams delay time set to: %ld seconds\r\n", delayTime);
while (1)
{
iprintf("TaskAllParams, %ld\r\n", loopCount);
loopCount++;
OSTimeDly(TICKS_PER_SECOND * delayTime);
}
}
/*-----------------------------------------------------------------------------
* Task created with OSSimpleTaskCreatewName(). The primary difference from the
* full version is that it allocates the task stack for you.
*----------------------------------------------------------------------------*/
void TaskSimple(void *pd)
{
uint32_t loopCount = 0;
uint32_t delayTime = 6;
iprintf("TaskSimple delay time set to: %ld seconds\r\n", delayTime);
while (1)
{
iprintf("TaskSimple, %ld\r\n", loopCount);
loopCount++;
OSTimeDly(TICKS_PER_SECOND * delayTime);
}
}
/*-----------------------------------------------------------------------------
* UserMain
*----------------------------------------------------------------------------*/
void UserMain(void *pd)
{
uint32_t delayTime = 3;
int returnCode;
init(); // Initialize network stack
WaitForActiveNetwork(TICKS_PER_SECOND * 5); // Wait for DHCP address
iprintf("Creating TaskAllParams....");
returnCode = OSTaskCreatewName( TaskAllParams, // Task function name
(void *)delayTime, // Optional parameter to
pass to the task function
&TaskAllParamsStack[USER_TASK_STK_SIZE], // Top of stack
TaskAllParamsStack, // Bottom of stack
MAIN_PRIO - 1, // Task priority
"TaskAllParams" ); // Task name
if (returnCode == OS_NO_ERR)
iprintf("Task creation successful\r\n");
else
iprintf("*** Error: status = %d\r\n", returnCode);
iprintf("Creating TaskSimple\r\n");
OSSimpleTaskCreatewName(TaskSimple, MAIN_PRIO - 2, "TaskSimple");
while (1)
{
OSTimeDly(TICKS_PER_SECOND * 1);
}
}

9.7.4 Protecting Shared Data


The following RTOS mechanisms can be used to protect shared data resources. They are listed in a decreasing
order of severity as regarding system latency (all pend and post functions are at the same level).

OSSemPend() OSSemPost() Protects an area of memory or resource. A task calls


OSSemPend, which will block until the resource is
available. OSSemPost releases the resource.
OSMboxPend() OSMboxPost() Same as semaphore, except a pointer variable is
passed as the “message”. A task or ISR can post a
message, but only a task can pend on a message.
Both the posting task and pending task must agree on
what the pointer points to.

NetBurner, Inc.
124 Programmers Guide

OSQPend() OSQPost() A Queue is basically an array of mailboxes. It is used


to post one or more messages. When you initialize
a Queue, you must specify the maximum number of
messages. The first message posted to the queue will
be the first message extracted from the queue (FIFO).
OSFifoPend() OSFifoPost() A FIFO is similar to a queue, but is specifically de-
OSFifoPostFirst() OSFifoPendNoWait() signed to pass pointers to OS_FIFO structures. The
first parameter of the structure must be a (void ∗) ele-
ment, which is used by the operating system to create
a linked list of FIFOs. When initializing a FIFO, you do
not specify the maximum number of entries as with a
queue. Instead, your application has the ability (and
responsibility) to allocate memory (static or dynamic)
in which to store the structures. This can be done stat-
ically by declaring global variables, or dynamically by
allocating memory from the heap. As with a queue,
the first message posted to the FIFO will be the first
message extracted from the queue.
OSCritEnter OSCritExit OSCritObj This is a counted critical section that restricts access
to resources to one task at a time, sometimes called a
“mutex”. For example, you have a linked list that is
maintained by 3 separate tasks. If one task is ma-
nipulating the list, you could first call OSCirtEnter for
that object (the list). If any other task tries to manip-
ulate the list, it will block at the OSCritEnter until the
task that previously called OSCritEnter, calls OSCrit←-
Exit. Note that the number of enter calls must match
number of exit calls. OSCritObj is a C++ implemen-
tation that uses scoping to automatically call the enter
and exit functions. See example below.
OSLock() OSUnlock() OSLockObj Disables other tasks, but not interrupts. Increments for
each OSLock, decrements for each OSUnlock. The
C++ object OSLockObj was created to assist in mak-
ing sure that an unlock is called for each lock. When an
OSLockObj is created, the constructor calls OSLock( ).
When the object goes out of scope, OSUnlock( ) is au-
tomatically called by the destructor.
USER_ENTER_CRITICAL() USER_EXIT_←- Macro that disables other tasks and interrupts. Incre-
CRITICAL() ments count on enter, decrements on exit.

How do you decide which type of mechanism to use? Some guidelines are:

• If you need some type of signal, but do not need to pass any data, use a Semaphore. A semaphore is a
single 32-bit integer that increments and decrements for each pend or post.

• If you want to pass a single 32-bit number, you can use a Mailbox or Queue. Most applications use the
32-bit number as the data, but it could also be a pointer to a structure or object. A queue is like an array of
mailboxes. You declare the number of queue entries a compile time.

• If you want to pass a structure or object, then use a FIFO. You may be wondering how a FIFO differs from a
Queue. The difference is that a Queue has a predefined number of entries. The FIFO implementation uses
a linked list, so the only limit to the number of entries is available memory. Using a FIFO is not as simple as
any of the other mechanisms, because your application must implement some type of memory management
to allocate and deallocate the FIFO objects. This is usually done by managing a predeclared array of objects,
or through dynamic memory allocation. We encourage all embedded designers to avoid dynamic memory
allocation if at all possible, since in any embedded system memory fragmentation could eventually occur and
the call to allocate a new object could fail. If you create an array of objects at compile time you will always be
guaranteed the maximum number can exist.

NetBurner, Inc.
9.7 NetBurner RTOS 125

9.7.5 Semaphore
A semaphore is a protected variable that is used to control access to shared system resources (such as memory
or serial ports), to signal the occurrence of events and task synchronization. A task can request a semaphore and
wait until the resource or event takes place (called pending). A task can also post to a semaphore to indicate it
no longer needs a resource, or to signal an event has taken place. To create a semaphore you declare one of
type OS_SEM and initialize with OSSemInit(): OS_SEM MySemaphore; OSSemInit( &MySemaphore,
0 ); // set initial value to 0
Your application tasks can now use the post and pend functions on the semaphore: OSSemPost( &My←-
Semaphore ); // post to a semaphore OSSemPend( &MySemaphore, 0 ); // pend on
a semaphore
The second parameter in the OSSemPend() function specifies the number of time ticks to wait. A value of 0 waits
forever. A good way to express a wait value is to use the TICKS_PER_SECOND definition provided by the RTOS:
OSSemPend( &MySemaphore, TICKS_PER_SECOND ∗ 5) to wait 5 seconds.

9.7.6 Queues
A message queue is an object that enables tasks and interrupt service routines to pend and post pointer sized
messages. The pointer values typically point to some type of object or structure that contains the actual message
or data.

9.7.7 FIFO
A FIFO is similar to a queue, but is specifically designed to pass pointers to OS_FIFO structures. The first param-
eter of the structure must be a (void ∗) element, which is used by the operating system to create a linked list of
FIFOs. When initializing a FIFO, you do not specify the maximum number of entries as with a queue. Instead, your
application has the ability (and responsibility) to allocate memory (static or dynamic) in which to store the structures.
This can be done statically by declaring global variables, or dynamically by allocating memory from the heap. As
with a queue, the first message posted to the FIFO will be the first message extracted from the queue.

9.7.8 Critical Section


OSCritEnter(), OSCritExit() and an OSCritObj enable an application to use counted critical sections
that restrict resource access to one task at a time (also called a “mutex”). For example, you have a linked list that is
maintained by 3 separate tasks. If one task is manipulating the list, you call OSCritEnter() before modifying the
list. If any other task tries to access the list, the task will block at the OSCritEnter() call until the task that previously
called OSCritEnter(), calls OSCritExit(). Since this is a counting critical section implementation, the
number of enter calls must match number of exit calls for each task.
OSCritObj is a C++ implementation that uses scoping to automatically call the enter and exit functions so you do
not need to manually match each enter with an ext. In comparison with OsLock(), OsCritEnter() does not
restrict task swapping unless two tasks want to access the same resource. OsLock() prevents all task swapping.

NetBurner, Inc.
126 Programmers Guide

9.7.9 OS Flags
OSFlags enables a function or task to pend on multiple flags or events, in contrast to a OSSemaphore which can
pend on only a single event. The OSFlag implementation is essentially a 32-bit bitmap in which each bit position
represents a “flag”. You create a OSFlag object with OSFlagCreate(), then set, clean and read the flags with
the appropriate function. There are a number of functions used to monitor or pend on the flags, and provide the
ability to pend on any one or more of the flags being set, or pending on all of flags being set at one time.
Flag Functions

• OSFlagSet() Set the bits asserted with bits_to_set

• OSFlagState() Return the current value of the flags

• OSFlagClear() Clear the bits asserted in bits_to_clr

• OSFlagPendAll() Wait until all of the flags indicated by mask are set

• OSFlagPendNoWait() Check (but do not wait) if all of the flags indicated by the mask are set

• OSFlagPendAny() Wait until any of the flags indicated by the bit mask are set

• OSFlagPendAnyNoWait() Check (but do not wait) if any of the flags indicated by the mask are set

9.8 Network Protocols


This section describes the NetBurner TCP and UDP protocols.
Topic Links:

• TCP vs UDP

• TCP Server

• TCP Client

• UDP Class

• UDP Sockets

9.8.1 TCP vs UDP


A very common question that arises when designing a network application is whether to use TCP (Transmission
Control Protocol) or UDP (User Datagram Protocol). There are a few guidelines and features that can determine
which would be the preferred protocol.

TCP is a point to point stream based protocol. It is used in applications where reliability and data sequencing
is needed: acknowledgments, error detection, re-transmission of data, and will guarantee the data received will be
sequenced in the same order as it was sent.

UDP is a connectionless protocol that does not guarantee delivery or data packet sequence (although each
segment is numbered). It is a send and forget protocol that does not use acknowledgments. A common comparison
is that TCP is similar to a phone call and UDP is similar to a post card. With TCP, you connect to a specific
destination phone number. When that person answers, they say "hello", you say "Hi, my name is Bob", and then
the conversation continues with each side speaking and responding (in a well-behaved conversation!). With UDP
you essentially transmit a datagram, like writing on a post card, and send it without verifying it was received.

When choosing between TCP and UDP, some major concerns are the overhead it takes to establish a TCP
connection, speed and the reliability of data transmission. For example, SNMP uses UDP. SNMP is used to
monitor networks, and many messages are sent and received for status updates and alerts. If TCP were used, the

NetBurner, Inc.
9.8 Network Protocols 127

overhead of establishing, maintaining and closing a connection for each message and each host would create a lot
of unnecessary traffic. A second example of when UDP is a better choice is when an application handles its own
reliability at the application layer. Using TCP in this instance would be redundant.

As mentioned previously, TCP is a stream based protocol and UDP is a datagram based protocol. Let's take
an example of an application in which a NetBurner device takes A/D readings and sends them to another network
device or host PC. Using UDP, each output operation (i.e. creating and sending a UDP packet) results in exactly
one IP packet being created and sent. The result of taking and sending 10 A/D readings is that the host will receive
10 individual packets, each containing one reading.
The host PC can then easily identify each reading, although each reading will have to be sent with a sequence
number so that the reading order can be recreated. If TCP is used with a single continuous network connection (i.e.
the connection is not closed and reestablished for each reading), you do not have control over how many readings
are send with each IP packet. You would need to add start message and stop message identifiers to separate the
data from each reading.

Some applications that use TCP are: HTTP, FTP, Telnet and SMTP. Some applications that use UDP are←-
: DHCP, BOOTP, SNMP and DNS.

9.8.1.1 TCP

TCP is used to create a reliable byte stream connection between two network hosts. The host that listens for
incoming connections is referred to as the server, and the host that initiates a connection the client. Although TCP
and UDP both use IP, TCP sends information as a stream of data. There are no record markers to delimit the
data. For example, if a server is sending analog-to-digital (A/D) readings to a client, the client will see a stream
of digits; TCP will not automatically insert delimiters to allow the client to determine where one measurement
ends and the next begins. To the client, the stream may look like: 98273129323424. Even if the client knew
each reading was 4 digits, it would not know where one ended and the next began. Four parameters are required
for a TCP connection: source IP address, source port number, destination IP address, and destination port number.

In contrast to TCP, UDP (covered in the next chapter) is an unreliable, datagram-oriented connectionless pro-
tocol. Delivery is not guaranteed, but each output operation creates and sends one UDP datagram. In the above
A/D example, each reading (or some number of multiple readings) could be sent as a single datagram and the
client could then process one datagram at a time.

9.8.2 TCP Server


A TCP server is basically an application that creates a listening socket, and then listens on the socket for incoming
connections. When an incoming connection request is received, tit must be accepted before communication
can begin. A web server is an example of a TCP server. A web server listens on port number 80 for incoming
connections. Once a connection is established, the web browser sends a GET request to the web server, which
then sends the requested information and terminates the connection.

To connect to a TCP server you must specify a port number. A port number is a 16-bit value. Since you
must know the port number before connecting, many port numbers have been defined for common protocols, and
are called well-known port numbers. Some of these values are shown below:

FTP 21
Telnet 23
SMTP 25
DNS 53
TFTP 69
HTTP 80
POP3 110
NTP 123

NetBurner, Inc.
128 Programmers Guide

9.8.2.1 NetBurner TCP Server Basics

When creating a TCP server with the NetBurner you will use the following functions:

• listen(): Open a listening socket on a specific port number

• accept(): Accept a connection request on a listening port

• I/O functions to send and receive data such as read(), write(), fdprintf(), writestring(),
etc.

• close(): Close a network socket

9.8.2.2 Simple TCP Server Example

This example is located in \nburn\examples\TCP. It will listen on port 23 for incoming connections, send a
sign on message to the client when a connection is made, and display all received data to the debug serial port. A
telnet program on a host PC can be used to connect to the server.

#include <predef.h>
#include <stdio.h>
#include <tcp.h>
#include <nbrtos.h>
#include <iosys.h>
#include <init.h>
#include <fdprintf.h>
const char *AppName = "Simple TCP Server Example";
#define TCP_LISTEN_PORT 23 // Telnet port number
#define RX_BUFSIZE (4096)
char RXBuffer[RX_BUFSIZE];
// Allocate task stack for TCP listen task
uint32_t TcpServerTaskStack[USER_TASK_STK_SIZE];
/*-------------------------------------------------------------------
* TCP Server Task
*------------------------------------------------------------------*/
void TcpServerTask(void * pd)
{
int listenPort = (int) pd;
// Set up the listening TCP socket
int fdListen = listen(INADDR_ANY, listenPort, 5);
if (fdListen > 0)
{
IPADDR clientAddress;
uint16_t clientPort;
while(1)
{
/* The accept() function will block until a TCP client requests a connection. Once a client
* connection is accepting, the file descriptor fdAccept is used to read/write to it.
*/
iprintf( "Waiting for connection on port %d...\n", listenPort );
int32_t fdAccept = accept(fdListen, &clientAddress, &clientPort, 0);
iprintf("Connected to: %I\r\n", GetSocketRemoteAddr(fdAccept));
writestring(fdAccept, "Welcome to the NetBurner TCP Server\r\n");
fdprintf(fdAccept, "You are connected to IP Address %I:%d\r\n", GetSocketRemoteAddr(fdAccept),
GetSocketRemotePort(fdAccept) );
while (fdAccept > 0)
{
/* Loop while connection is valid. The read() function will return 0 or a negative number if
the
* client closes the connection, so we test the return value in the loop. Note: you can also
use
* ReadWithTimout() in place of read to enable the connection to terminate after a period of
inactivity.
*/
int n = 0;
do
{
n = read( fdAccept, RXBuffer, RX_BUFSIZE );
RXBuffer[n] = ’\0’;
iprintf( "Read %d bytes: %s\n", n, RXBuffer );
} while ( n > 0 );
iprintf("Closing client connection: %I\r\n", GetSocketRemoteAddr(fdAccept) );
close(fdAccept);
fdAccept = 0;
}
} // while(1)
} // while listen

NetBurner, Inc.
9.8 Network Protocols 129

}
/*-------------------------------------------------------------------
User Main
------------------------------------------------------------------*/
void UserMain(void * pd)
{
init();
// Create TCP Server task
OSTaskCreatewName( TcpServerTask,
(void *)TCP_LISTEN_PORT,
&TcpServerTaskStack[USER_TASK_STK_SIZE] ,
TcpServerTaskStack,
MAIN_PRIO - 1, // higher priority than UserMain
"TCP Server" );
while (1)
{
OSTimeDly( TICKS_PER_SECOND * 5 );
}
}

This is an extremely simple example designed to illustrate how the accept() and listen() calls can be
used. It only listens to a single port number, and processes a single connection at a time. Any information sent
from the Client will be displayed in the MTTTY window. The application does not have the capability to terminate
the incoming connection.

There are #define options for the TCP listen port number and the incoming TCP buffer storage array size.
RXBuffer[] is then declared and will hold the received data. The listen() function call sets up a socket to
listen for an incoming connection from any IP address on port number 23, the telnet port number.

If the listen() succeeds in creating a listening socket, we then enter a second while loop. The applica-
tion will block at the accept() function call until an incoming connection request is received, such as when the
telnet program on a PC attempts to connect. When the connection is established, the accept() function returns
and the sign-on message is sent to the telnet application.

We now enter the do loop: while(n > 0). The read() function will block until data is received or an
error occurs such as the client terminating the connection. When data is sent from the telnet application, the
read() function will return with the data in the RXBuffer[] array. The application will stay in this while loop
until the connection is terminated by the telnet client (or you reset the NetBurner device). If the connection is broken
by the telnet client, the application will then loop back to the accept() function call and wait for another incoming
connection.

9.8.2.3 Advanced TCP Server for Multiple Connections

In the previous example the TCP server processed only a single incoming connection. The select() function
has the ability to pend on multiple file descriptors, which can used for TCP or serial connections. The example
below demonstrates how the TCP Server can be written using select().

/*---------------------------------------------------------------------------
This example creates a TCP server that listens on the specified TCP port
number and can handle multiple TCP connections simultaneously (10 in this
example). The select() function is a great way method to pend and process
multiple connections.

An easy way to test the example is to use multiple Telnet sessions to create
simultaneous connections to the NetBurner device. Status messages are sent
out stdio to the debug serial port, and to the client TCP connections.
*-----------------------------------------------------------------------------*/
#include <predef.h>
#include <constants.h>
#include <utils.h>
#include <system.h>
#include <iosys.h>
#include <stdio.h>
#include <ctype.h>
#include <tcp.h>
#include <init.h>
#include <ipshow.h>

NetBurner, Inc.
130 Programmers Guide

const char* AppName = "TCP Multiple Sockets Example";


#define listenPort (23) // TCP port number to listen on
#define maxConnections (10) // Max number of file descriptors/connections
#define readBufferSize (1024) // Connection read buffer size
int32_t fdArray[maxConnections]; // Array of TCP file descriptors
/*-----------------------------------------------------------------------------
* User Main
*------------------------------------------------------------------------------*/
void UserMain( void* pd )
{
init();
WaitForActiveNetwork(TICKS_PER_SECOND * 10);
showIpAddresses();
// Listen for incoming TCP connections. You only need to call listen() one time.
// Any incoming IP address is allowed, queue up to 5 connection requests at one time
int32_t fdListen = listen( INADDR_ANY, listenPort, 5 );
iprintf( "Listening for incoming connections on port %d\r\n", listenPort );
while ( 1 )
{
// Declare file descriptor sets for select()
fd_set readFds;
fd_set errorFds;
// Init the fd sets
FD_ZERO( &readFds );
FD_ZERO( &errorFds );
// Configure the fd sets so select() knows what to process. In this case any fd data to be read, or
an error
for ( int32_t i = 0; i < maxConnections; i++ )
{
if ( fdArray[i] ) // The fd in the array will be > 0 if open and valid, so reset the file
descriptor sets
{
FD_SET( fdArray[i], &readFds );
FD_SET( fdArray[i], &errorFds );
}
}
// select() should also process the listen fd
FD_SET( fdListen, &readFds );
FD_SET( fdListen, &errorFds );
// select() will block until any fd has data to be read, or has an error. When select() returns,
// readFds and/or errorFds variables will have been modified to reflect the events.
select( FD_SETSIZE, &readFds, ( fd_set * )0, &errorFds, 0 );
// If the listen fd has a connection request, accept it.
if ( FD_ISSET( fdListen, &readFds ) )
{
IPADDR clientIp;
uint16_t clientPort;
int fdAccept = accept( fdListen, &clientIp, &clientPort, 0 );
// If accept() returned, find an open fd array slot
if ( fdAccept > 0 )
{
for ( int32_t i = 0; i < maxConnections; i++ )
{
if ( fdArray[i] == 0 )
{
fdArray[i] = fdAccept;
writestring( fdAccept, "Welcome to the NetBurner Multi-Socket TCP Server! ’Q’ to
quit." );
iprintf( "Added connection on fd[%d] = %d, Client IP: %I:%d\r\n",
i, fdAccept, GetSocketRemoteAddr(fdAccept), GetSocketRemotePort(fdAccept) );
fdAccept = 0;
break;
}
}
}
// If no array positions are open, close the connection
if ( fdAccept )
{
writestring( fdAccept, "I am sorry, but the server is full\r\n" );
iprintf("Server Full\r\n");
close( fdAccept );
}
}
// If the listen fd has an error, close it and reopen
if ( FD_ISSET( fdListen, &errorFds ) )
{
close( fdListen );
fdListen = listen( INADDR_ANY, listenPort, 5 );
}
// Process each fd array element and check it against readFds and errorFds.
for ( int32_t i = 0; i < maxConnections; i++ )
{
if ( fdArray[i] )
{
// Check for data to be read
if ( FD_ISSET( fdArray[i], &readFds ) )
{

NetBurner, Inc.
9.8 Network Protocols 131

char buffer[readBufferSize];
int rv = read( fdArray[i], buffer, readBufferSize );
if ( rv > 0 )
{
buffer[rv] = 0;
if ( buffer[0] == ’Q’ )
{
iprintf( "Closing connection fd[%d]\r\n", i );
writestring( fdArray[i], "Bye\r\n" );
close( fdArray[i] );
fdArray[i] = 0;
}
else
{
iprintf( "Read \"%s\" from fd[%d]\r\n", buffer, i );
sniprintf( buffer, readBufferSize, "Server read %d byte(s)\r\n", rv );
writestring( fdArray[i], buffer );
}
}
else
{
iprintf( "Read Error on fd[%d]\r\n", fdArray[i] );
FD_SET( fdArray[i], &errorFds );
}
} // data available to read
// Check for errors
if ( FD_ISSET( fdArray[i], &errorFds ) )
{
iprintf( "Error on fd[%d], closing connection\r\n", i );
close( fdArray[i] );
fdArray[i] = 0;
}
} // if fd is valid
} // process each connection in the array
} // while (1)
} // UserMain

9.8.3 TCP Client


The previous section demonstrated how a TCP Server waits for incoming connections from a TCP client. This
section will demonstrate how a TCP client initiates a connection using the connect() function. Features of this
example:

• A web page interface is created with input fields for the destination IP address, destination port number, and
the message to send to the server

• Demonstrates how to use HTML forms to submit user data

• The web page interface will use the connect() function to create an outgoing connection to a TCP Server,
send the message, and close the socket

A screen shot of the running application is shown below:

NetBurner, Inc.
132 Programmers Guide

Figure 9.6 TCP Client Web Interface

9.8.3.1 Application Source Code

The application consists of the following source files:

File Name Description


main.cpp Application initialization, starts the web server
clientweb.h Header file for clientweb.cpp
clientweb.cpp Handles the user interface interaction, makes the outgoing connection
index.html HTML code for the user interface

9.8.3.1.1 main.cpp This is a very simple source file that initializes the system. All the action occurs in
clientweb.cpp when a user posts web form data. The purpose of the RegisterPost() function is to use our
own POST handler instead of just calling the system POST handler.

NetBurner, Inc.
9.8 Network Protocols 133

/*-------------------------------------------------------------------
This program demonstrates how to create a TCP Client. All interaction is
through the web page interface, which enables you to type a message as
well as the IP address and port number of the destination TCP server.
You should be able to use any TCP server. If you do not have one,
we have a windows example TCP server in the \nburn\pctools\TCP\TcpServerWin
directory (as well as source code).
-------------------------------------------------------------------*/
#include <predef.h>
#include <stdio.h>
#include <startnet.h>
#include <init.h>
#include <ipshow.h>
#include "clientweb.h"
void UserMain(void * pd)
{
init(); // Initialize system
StartHttp(); // Start web server
WaitForActiveNetwork(TICKS_PER_SECOND * 10);
showIpAddresses(); // Display IP information to serial port
RegisterPost(); // Register custom HTML Post function
while (1)
{
OSTimeDly( TICKS_PER_SECOND );
}
}

9.8.3.1.2 clientweb.h The only function we need to call outside of clientweb.cpp is RegisterPost()
#ifndef _NB_CLIENTWEB_H
#define _NB_CLIENTWEB_H
void RegisterPost();
#endif

9.8.3.1.3 index.html Web page implements a form to send data to the TCP server using a web POST. Inside the
HTML <form> tags there is a table for formatting, with three HTML <input> fields. The message input field
is straight HTML and any data entered in the text box will be sent to the server as data in the POST. The second
and third input fields make use of the NetBurner CPPCALL function callback tag to execute functions that provide
default values in the input fields when the page is displayed.
<html>
<head>
<title>NetBurner TCP Client Example Program</title>
</head>
<img src="logo.jpg">
<br>
<h1>TCP Client Example Program</h1>
This example program will open a TCP connection to a TCP Server at
the specified IP address and send a message. A simple TCP Server,
TcpServerWin.exe, is included in the \nburn\pctools directory.
<form ACTION="nothing.html" METHOD=POST><br>
<table>
<tr>
<td>Enter Message to send: </td>
<td><input NAME="tfMessage" TYPE="text" SIZE="30"></td>
</tr>
<tr>
<td>Destination Port: </td>
<td><input NAME="tfDestPortNum" <!--CPPCALL WebDestPort --> TYPE="text" SIZE="6"></td>
</tr>
<tr>
<td>Destination IP: </td>
<td><input NAME="tfDestIpAddr" <!--CPPCALL WebDestIp --> TYPE="text" SIZE="15">
(Your IP address is: <!--CPPCALL WebShowClientIp --> )
</td>
</tr>
<tr>
<td> <br></td>
</tr>
<tr>
<td><input NAME="SendMessage" TYPE="submit" VALUE="Send Message"></td>
</tr>
<br><br>
</table>
</form>
</body>
</html>

9.8.3.1.4 clientweb.cpp This code module handles the dynamic content and web server interface. When the
web page is displayed, current values for the port numbers and IP addresses are filled in as default values.

NetBurner, Inc.
134 Programmers Guide

/*-------------------------------------------------------------------
* This code implements the web page entries for the message,
* destination IP address and destination port number. When the
* web page first loads it will automatically fill in the IP
* address from the source requesting the web page, because in
* most cases it will also be the address of the TCP Server.
* The web page is a form, and when a user presses the submit
* button the SendMsg() function will open a TCP connection to
* the server, send the message, and close the connection.
* Any error messages will be sent to stdout and can be viewed
* with MTTTY.
*
* A TCP server program must already be listening at the specified
* IP address and port number for the message to be sent. A simple
* TCP Server called TcpServerWin.exe is located in the
* \nburn\pctools directory of your NetBurner installation.
-------------------------------------------------------------------*/
#include <predef.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <http.h>
#include <iosys.h>
#include <utils.h>
#include <tcp.h>
#include <string.h>
#include <fdprintf.h>
#include "clientweb.h"
#define APP_VERSION "Version 1.2 9/1/2018"
#define POST_BUFSIZE (4096) // form post buffer size
int gDestPort;
IPADDR gDestIp;
/*-------------------------------------------------------------------
Sends a message to the specified host.
------------------------------------------------------------------*/
void SendMsg( IPADDR destIp, int destPort, char *msg )
{
iprintf( "Connecting to: %I:%d\r\n", destIp, destPort );
int fd = connect( destIp, destPort, TICKS_PER_SECOND * 5 );
if (fd < 0)
{
iprintf("Error: Connection failed\r\n");
}
else
{
iprintf( "Attempting to write: \"%s\" \r\n", msg );
int n = write( fd, msg, strlen(msg) );
iprintf( "Wrote %d bytes\r\n", n );
close( fd );
}
}
/*-------------------------------------------------------------------
* Show destination port number on web page
* ----------------------------------------------------------------*/
void WebDestPort(int sock, PCSTR url)
{
if ( gDestPort == 0 ) // If no dest port is specified, use a default
gDestPort = 2000;
fdprintf(sock, "VALUE=\"%d\" ", gDestPort);
}
/*-------------------------------------------------------------------
Show destination ip address on web page
------------------------------------------------------------------*/
void WebDestIp(int sock, PCSTR url)
{
if ( gDestIp.IsNull() ) // If no dest ip address has been entered, use the one that requested the
web page.
fdprintf( sock, "VALUE=\"%I\" ", GetSocketRemoteAddr(sock) );
else
fdprintf( sock, "VALUE=\"%I\" ", gDestIp );
}
/*-------------------------------------------------------------------
* Show destination ip address on web page
*------------------------------------------------------------------*/
void WebShowClientIp(int sock, PCSTR url)
{
fdprintf( sock, "%I", GetSocketRemoteAddr(sock));
}
/*-------------------------------------------------------------------
* Process HTTP Post
*------------------------------------------------------------------*/
int MyDoPost(int sock, char * url, char * pData, char * rxBuffer)
{
int max_chars = 40;
// The buffer is 4096 bytes, make it static so that it does

NetBurner, Inc.
9.8 Network Protocols 135

// not take up task stack space, but instead uses global space.
static char buf[POST_BUFSIZE];
iprintf( "Post Data: %s\r\n", pData ); // print all data sent from app
// The SendMessage button on the web page initiates a form POST to send the message to the TCP server.
if ( ExtractPostData( "SendMessage", pData, buf, max_chars) > 0 )
{
iprintf( "Processing SendMessage Post\r\n" );
if (ExtractPostData("tfDestPortNum", pData, buf, max_chars) == -1)
iprintf("Error reading post data: tfDestPortNum\r\n");
else
gDestPort = (int)atoi(buf);
if (ExtractPostData("tfDestIpAddr", pData, buf, max_chars) == -1)
iprintf( "Error reading post data: tfDestIpAddr\r\n");
else
gDestIp = AsciiToIp( buf );
if ( ExtractPostData( "tfMessage", pData, buf, max_chars ) < 0 )
iprintf("Error reading post data: tfMessage\r\n");
else
SendMsg( gDestIp, gDestPort, buf );
}
// We have to respond to the post with a new HTML page. In this case we
// will redirect so the browser will go to that URL for the response.
RedirectResponse( sock, "index.htm" );
return 0;
}
/*-------------------------------------------------------------------
Specify the function to call when a user clicks Submit on the
web page form.
------------------------------------------------------------------*/
void RegisterPost()
{
SetNewPostHandler( MyDoPost );
}

9.8.3.1.5 TCP Client Program Operation The application boots and executes the initialization functions in
main.cpp. From that point forward all interaction occurs through the web interface. When a client web browser
connects to the device's web server, the CPPCALL functions WebDestPort() and WebDestIp() fill in the
current values in the input text fields. A port number of 2000 is specified as the default port. The WebDestIp()
function will default to the last value entered by the user, or if no value has been entered yet, it will enter the IP
address of the host running the web browser. It extracts the IP address from the TCP connection request.

The message to send it is just a temporary string displayed in the web browser. To send a message, the
user clicks on the Send Message submit button. This is a HTML command that sends a web POST to the web
server containing all the information contained in the form. This is where the MyDoPost() function in clientweb.←-
cpp comes into play. It parses the POST data, assigns data tot he runtime variables, extracts the message data,
and calls SendMsg(). SendMsg() in clientweb.cpp makes a connect() call using the passed message
and the values of the destination port number and IP address. Once the connection is made, SendMsg() calls
write() to send the message followed by close() to terminate the connection.

Note

The "%I" parameter in the iprintf() functions will display an IP addresses for an IPADDR object in dotted
notation (eg. 192.168.1.1). An IPADDR object can hold an IPv4 or IPv6 address. For IPADDR4 objects, use
"%hI".

9.8.4 UDP Class


The NetBurner API provides two mechanisms to implement UDP: sockets and a C++ class. The choice of which to
use is Dependent of which method you find most comfortable using. There is not a performance difference.

NetBurner, Inc.
136 Programmers Guide

9.8.4.1 Receiving UDP Packets Using the UDP Class

To receive UDP Packets:

• Create an OS_FIFO to hold incoming UDP packets

• Register a UDP FIFO with RegisterUDPFifo() to listen for and store incoming packets. If listening on
more than one port number, a separate OS_FIFO can be used for each port, or one OS_FIFO can be used
to listen on multiple ports by calling RegisterUDPFifo() for each port number and specifying the same
OS_FIFO.

• Call a UDP constructor such as: UDPPacket upkt(&fifo, timeout), which will block until a packet
is received, then accept and store the packet.

• Call the Validate() member function to verify the packet

• Call the GetDataBuffer() member function to obtain the data in the packet

9.8.4.2 Sending a UDP Packet Using the UDP Class

To send a UDP packet:

• Declare an instance of a UDP object

• Specify the source and destination port numbers

• Add data to the packet using the class member functions

• Call the Send() member function to send the packet

Note

Unlike TCP, there is no connection between the client and sever, so I/O functions such as read() and write()
cannot be used. When sending, a UDP packet must be created for each transmission.

9.8.4.3 UDP Send/Receive Example with UDP Class


Note

You can use the NetBurner UDPTerminal utility on Windows platforms to send/receive UDP packets on your
PC.

/*
* This example program will receive a UDP packet from another device or
* host computer, and then send a response. To run the example, connect a serial
* port from your PC to the debug serial port on your NetBurner device and run a
* terminal program such as MTTTY. On the PC, run the NetBurner UDP Terminal
* (be sure to set the IP address and port numbers to match). You will then
* be able to type characters in the UDP Terminal and see them in MTTTY,
* and vice versa.
*
* You will be prompted for the port number to send/receive data and the
* destination IP address of the other device or host. Note that the application
* uses the same port number to send and receive data, but you can use any other
* port number you wish.
*
* The application will create a thread to receive packets and display them
* on the debug port, while the main task will take any data you type in
* to the MTTTY terminal and send it as a UDP packet to the destination IP
* address.
*/
#include <init.h>
#include <stdlib.h>

NetBurner, Inc.
9.8 Network Protocols 137

#include <system.h>
#include <udp.h>
#include <utils.h>
const char *AppName = "UDP Send/Receive Example";
// Allocate stack space for the listen task
uint32_t UdpReceiveTaskStack[USER_TASK_STK_SIZE];
/*
* This UDP task will wait for incoming packets on the specified port number,
* which is passed as a OSTaskCreate() void * parameter.
*/
void UdpReceiveTask(void *pd)
{
static OS_FIFO fifo; // Create a FIFO for the UDP packet and initialize it
int listenPort = (int)pd;
iprintf("Listening on UDP port: %d\r\n", listenPort);
// Register the OS_FIFO. Received packets will be stored in the OS_FIFO.
RegisterUDPFifo(listenPort, &fifo);
while (1)
{
// Construct a UDP packet object using the previously declared FIFO.
// The UDP constructor will block until a packet has been received.
// The second parameter is a timeout value (time in ticks). A value of 0 will
// wait forever.
UDPPacket upkt(&fifo, 0 * TICKS_PER_SECOND);
// Did we get a valid packet, or just time out?
if (upkt.Validate())
{
uint16_t len = upkt.GetDataSize();
iprintf("Received UDP packet with %d bytes from: %I\r\n", (int)len, upkt.GetSourceAddress());
ShowData(upkt.GetDataBuffer(), len); // hex dump function
iprintf("\r\n");
}
}
}
/*
* UserMain
*/
void UserMain(void *pd)
{
int portNumber;
IPADDR destIpAddress;
char buffer[80];
init(); // Initialize network stack
WaitForActiveNetwork(TICKS_PER_SECOND * 5); // Wait for DHCP address
iprintf("Application: %s\r\nNNDK Revision: %s\r\n", AppName, GetReleaseTag());
iprintf("Enter the UDP port number (will be used for send & receive): ");
gets(buffer);
portNumber = atoi(buffer);
iprintf("\r\nEnter the destination IP Address: ");
gets(buffer);
destIpAddress = AsciiToIp(buffer);
iprintf("Listening/Sending on UDP Port %d, Sending to IP address: %I\r\n", portNumber, destIpAddress);
// Create UDP listen task
OSTaskCreatewName( UdpReceiveTask,
(void *)portNumber,
&UdpReceiveTaskStack[USER_TASK_STK_SIZE] ,
UdpReceiveTaskStack,
MAIN_PRIO - 1, // higher priority than UserMain
"UDP Receive" );
// while loop to process user input and send as a UDP packet
iprintf("Enter data and hit return to send.\r\n");
while (1)
{
gets(buffer);
UDPPacket pkt;
pkt.SetSourcePort(portNumber);
pkt.SetDestinationPort(portNumber);
pkt.AddData(buffer);
pkt.AddDataByte(0);
pkt.Send(destIpAddress);
iprintf("\r\n");
iprintf("Sent \"%s\" to %I:%d\r\n", buffer, destIpAddress, portNumber);
}
}

9.8.4.3.1 Sending Packets In the while loop of UserMain() you can see that a UDPPacket object named
"pkt" is created. Member functions are then called to specify the source port number, destination port number, add
the message data, add a null string terminator, and finally to send the packet. In practice it is a good idea to choose
random source port numbers.

NetBurner, Inc.
138 Programmers Guide

9.8.4.3.2 Receiving Packets UserMain() creates a task named UdpReceiveTask(). The task declares
an OS_FIFO to use to store incoming packets. Note that it is static so the FIFO is located in global variable space.
A UDPPacket object constructor is then called for upkt. It will block until a packet is received. When one does arrive
it is verified with the Validate() member function. If it is a valid packet the ShowData() utility function is used
to display the data in hex format to the debug serial port.

9.8.5 UDP Sockets


The NetBurner API provides two mechanisms to implement UDP: sockets and a C++ class. The choice of which to
use is Dependant of which method you find most comfortable using. There is not a performance difference.

9.8.5.1 Receiving UDP Packets using UDP Sockets

To receive UDP Packets:

• Use the CreateRxUdpSocket() function to open a listening socket. It will return a file descriptor.

• Use the recvfrom() function to receive packets. The industry standard behavior of this function is to block
forever until a packet is received. If you want to allow your application to have better control, you can wrap
the recvfrom() function inside a select() function using the UDP file descriptor and a timeout.

9.8.5.2 Sending UDP Packets using UDP Sockets

To send UDP Packets:

• Use the CreateTxUdpSocket() function to open a socket. It will return a file descriptor.

• Use the sendto() function to send packets.

9.8.5.3 UDP Send/Receive Example Using Sockets


/*
* This application will send/receive UDP packets with another host on a network,
* such as a PC. Use the MTTTY serial port program to access the menu and
* prompts to specify the destination IP address and port number.
*
* NetBurner also supplies an API for handling UDP as a C++ Class using UDPPacket.
*
* For an external UDP host you can use the NetBurner Java example, or the
* NetBurner UDP terminal program.
*/
#include <init.h>
#include <stdlib.h>
#include <string.h>
#include <system.h>
#include <udp.h>
#include <utils.h>
const char *AppName = "UDP Sockets Example";
// Allocate stack space for the listen task
uint32_t UdpReceiveTaskStack[USER_TASK_STK_SIZE];
/*
* This task will wait for incoming UDP packets and process them.
*/
void UdpReceiveTask(void *pd)
{
int listenPort = (int)pd;
iprintf("UdpReceiveTask monitoring port %d\r\n", listenPort);
// Create a UDP socket for receiving
int udpFd = CreateRxUdpSocket(listenPort);
if (udpFd <= 0)
{
iprintf("Error Creating UDP Listen Socket: %d\r\n", udpFd);
while (1)

NetBurner, Inc.
9.8 Network Protocols 139

{
OSTimeDly(TICKS_PER_SECOND);
}
}
else
{
iprintf("Listening for UDP packets on port %d\r\n", listenPort);
}
while (1)
{
IPADDR sourceIpAddress; // UDP packet source IP address
uint16_t localPort; // Port number UDP packet was sent to
uint16_t sourcePort; // UDP packet source port number
char buffer[80];
int len = recvfrom(udpFd, (uint8_t *)buffer, 80, &sourceIpAddress, &localPort, &sourcePort);
buffer[len] = ’\0’;
iprintf("\r\nReceived a UDP packet with %d bytes from : %I\r\n%s\r\n", len, sourceIpAddress,
buffer);
}
}
/*
* UserMain
*/
void UserMain(void *pd)
{
int portNumber;
IPADDR destIpAddress;
char buffer[80];
init(); // Initialize network stack
WaitForActiveNetwork(TICKS_PER_SECOND * 5); // Wait for DHCP address
iprintf("Application: %s\r\nNNDK Revision: %s\r\n", AppName, GetReleaseTag());
// Get destination IP address
iprintf("Enter the UDP Server destination IP address: ");
gets(buffer);
destIpAddress = AsciiToIp(buffer);
iprintf("\r\n");
// Get the port number. This application uses the same port number for send and receive
iprintf("Enter the source/destination port number: ");
gets(buffer);
portNumber = atoi(buffer);
iprintf("\r\n");
// Create a UDP socket for sending
int udpFd = CreateTxUdpSocket(destIpAddress, portNumber, portNumber);
if (udpFd <= 0)
{
iprintf("Error Creating UDP Socket: %d\r\n", udpFd);
while (1)
{
OSTimeDly(TICKS_PER_SECOND);
}
}
else
{
iprintf("Sending/Receiving with host %I: %d\r\n", destIpAddress, portNumber);
}
// Create UDP receive task. The priority is higher than UserMain() so packets get processed as they are
received
OSTaskCreatewName( UdpReceiveTask,
(void *)portNumber,
&UdpReceiveTaskStack[USER_TASK_STK_SIZE] ,
UdpReceiveTaskStack,
MAIN_PRIO - 1, // higher priority than UserMain
"UDP Receive" );
iprintf("Enter data and hit enter to send.\r\n");
while (1) // Loop forever displaying UDP data
{
gets(buffer);
iprintf("\r\n");
iprintf("Sending \"%s\" using UDP to %I : %d\r\n", buffer, destIpAddress, portNumber);
sendto(udpFd, (uint8_t *)buffer, strlen(buffer), destIpAddress, portNumber);
iprintf("\r\n");
}
}

NetBurner, Inc.
140 Programmers Guide

9.9 SSL/TLS Programming Guide


9.9.1 SSL/TLS Overview
The NetBurner SSL/TLS library makes SSL/TLS as easy as possible. However, if this is your first experience with
SSL/TLS, some outside reading on how public key cryptography works is extremely helpful.

When you use SSL/TLS to connect to http://www.amazon.com (for example) with a normal web browser,
you will not need to know anything about certificates. This is because Amazon purchased a certificate from Verisign
and your browser vendor preinstalled Verisign, as an entity that can sign trusted certificates.

Figure 9.7 A Normal SSL/TLS Connection

Above, is a picture of a perfectly normal TCP or SSL/TLS connection; the client (most often a browser) has
connected through the network to a server. If we do not have any entities doing bad things on our network then
there is no need for SSL/TLS. However, if the data we are sending is worth stealing, we might have a very different
network picture (below).

Figure 9.8 An Unsecure Connection

If our connection is routed through a third party (a normal TCP connection), we have no guarantee that this
third party is not a "bad guy" trying to steal or modify our data. The SSL/TLS protocol was designed to eliminate
this man in the middle attack. SSL/TLS is designed not only to make sure that the data we send over the network
is hidden from snooping eyes, but it is also designed to make sure we are connected to the proper server without
any "bad guys" in the middle. This verification is done with Public Key (PK) Cryptography and a hierarchy of trust.
Why do we trust a doctor when we go to the emergency room? We trust the doctor we have never met because
we trust the hospital to employ qualified doctors. The hospital vouches for his skills and we trust the hospital. His
medical school also vouches for him by giving him a diploma with his name and the schools seal or signature. We
trust the school, we trust the hospital, and thus we trust the doctor.
SSL/TLS works in a very similar way. When a client connects to the server sends the client a certificate. This
certificate has three major elements:

• A name (i.e. who is this server)

• A public key (e.g. think of an open padlock)

NetBurner, Inc.
9.9 SSL/TLS Programming Guide 141

• A signature (by a trusted third party that vouches for the name and the public key)

A doctor's diploma is very similar; it also has three major elements: The doctor's name, the type of degree and the
medical school (that vouches for the doctor). For example, Bob and George both graduate from Harvard Medical
School. They both have Harvard diplomas. However, the diplomas are unique to each doctor. The diplomas are
not interchangeable. Bob's diploma would be of no use to George and vice versa. This illustrates the first key point
about SSL/TLS.

Key Point #1: Each and every SSL/TLS server must have a unique certificate. Note: You cannot reuse an
SSL/TLS server certificate. The certificates are distinguished by the "common name" or "CN" on the certificate.

If you went into a new doctor's office and saw a diploma from Harvard medical school, you would feel com-
fortable with the doctor's skills. You trust Harvard and Harvard will vouch for this doctor. If instead, the diploma
were from the Medical School of Zaire, you would probably be more skeptical. We do not have the same inherent
trust of this school as we did with Harvard.

In SSL/TLS as a client, we have to decide who we will trust to sign our certificates. This list of trusted certifi-
cate authorities must be explicitly configured into the client. When the web browser or OS was installed on your PC,
it probably installed a list of trusted certificate authorities. With the NetBurner SSL/TLS library, we have to explicitly
decide whom we are going to trust to sign server certificates. This leads to key point #2.

Key Point #2: An SSL/TLS client must be pre-configured with a list of Certificate Authorities (CAs) that it will
trust to sign server certificates. This list can be common across all the clients and does not have to be unique.

9.9.1.1 What do I need to do to make SSL/TLS work?

• You must create or choose a certificate authority. Note: If you create a certificate authority, you will also have
to create a set of public/private keys for this authority.

• You must create public/private keys and a certificate for each SSL/TLS server and have the certificate signed
by the certificate authority you have chosen.

• You must configure the clients with the list of certificate authorities it should trust.

9.9.1.2 How do I find or create a certificate authority?

Using the medical school example, you can go to Harvard pay lots of $$$ and get a diploma that is trusted by
everyone. You can also choose to start your own medical school and issue diplomas. Almost everyone in the world
would trust a Harvard diploma. Almost no one will trust a "Bob's Medical School" diploma, unless you spend the
time convincing them that it is a quality medical school. In the end, you will likely only be able to convince your
family, and then only for non-life threatening needs.

SSL/TLS certificates are a lot like medical schools; you can go and purchase server certificates. To see what
a certificate looks like, open your web browser (e.g. Internet Explorer), and connect to https://www.Net←-
Burner.com (notice the s on the end of https). On Internet Explorer's menu, choose File then Properties. Now,
click the Certificates button, and look at all the tabs shown in this section.

9.9.1.3 How do I know whom my browser trusts?

On your (Internet Explorer) browser's menu - choose Tools then Internet Options. Open the Content tab, click
the Certificates button, and open the Trusted Root Certificate Authorities tab. Add Verisign or Thawte and every
browser in the world will trust your certificate and your server.

NetBurner, Inc.
142 Programmers Guide

If you want to save some money and create your own certificate authority then you can do so. However, none of the
clients will accept your certificate until you convince them to add "Bob's Certificate Authority" to their list of trusted
certificate authorities. If, the users using the embedded SSL/TLS system you are deploying are all in one business
entity, then it is relatively simple to add your own certificate authority to the list of trusted authorities. If you are
responsible for both the client and server end of the connection, it is even easier; you can configure the clients to
accept a single server authority - yours.

SSL/TLS is based on Public Key Cryptography (PK) and a little bit of background on PK is necessary in order
to deploy a secure SSL/TLS solution. Public Key Cryptography is different from Symmetric Key Cryptography. In
PK, the keys used for encryption are broken into two parts, much like a padlock (the public part) and a key (the
private part). If you give someone an open padlock and a steel box, they can put things into the box, close the lid,
and lock the lock. Unless they have the key to the lock, they cannot open the box. They can be confident that if they
mail you the box, none of the mailmen along the way can look inside. Only the person who holds the (private) key to
the padlock can open the box. For additional information on Public Key Cryptography, please read the Cryptography
FAQ ( http://isc.faqs.org/faqs/cryptography-faq).

When the SSL/TLS client connects to a server, the server sends back a certificate with a public key (open
padlock). This certificate also includes the name of the server and a signature vouching for both the public key and
the name. If any part of the certificate is changed, the signature will compute to be invalid.

So, if we have a "bad guy" in the middle, he can watch the padlock going from the server to the client. But,
when the client puts his secret information into the box and locks it, the "bad guy" cannot see inside. He only knows
that the client sent something in the box to the server. The secrets in the box are safe from the prying eyes of the
"bad guy". This safety only exists if the server has done a good job of protecting the private key. If the "bad guy"
sneaks into the server room, logs on the server console, and makes a copy of the private key, he can intercept all
of the traffic. He can also change the content at will. This leads to key point #3.

Key Point #3: When using Public Key Cryptography (as SSL/TLS does), the system is only as secure as the
security of the private key. Since a server needs access to the private key to unlock the data from the client, the
private key must exist on the server.

Key Point #3 Corollary: If the private key exists on the server, then the system is only as secure as the
physical security of the server. If the server is not physically secure, then someone (i.e. the "bad guy") can attach
an emulator or other hardware to the server and read out the private key.

For example, suppose the "bad guy" wants to intercept your credit card number when you send it to Amazon
to order a book. We have already shown that he cannot read the data unless he has Amazon's private key.
However, he has one other option - he can pretend to be Amazon and offer his own certificate to you, the client. If
this certificate is properly signed by a Certificate Authority the client trusts, then client will accept the connection.
If any "Certificate Authority" in the list of trusted authorities is compromised, then the system is insecure. If the
"bad guy" has the ability to add a new "Certificate Authority" to the client, then he can completely compromise the
system. This leads to key point #4.

Key Point #4: If the ability to add a "Certificate Authority" to the client's list of trusted authorities is not se-
cure, then system is not secure.

Key Point #4 Corollary: If the list of trusted "Certificate Authorities" exists on the client, then the system is
only as secure as the physical security of the client. If the client is not physically secure, then someone (i.e. the
"bad guy") can attach an emulator or other hardware to the client and add a "trusted" authority.

These last two key points imply that it is not possible to build a system that is more secure than the physical
security of the device being secured.

Important: All the cryptography in the world will not help if someone can gain access to your computer and
hide a bug inside the keyboard; or even easier, add or modify a system file to record your keystrokes and periodi-
cally send them over the internet to some nefarious foe.

NetBurner, Inc.
9.9 SSL/TLS Programming Guide 143

9.9.1.4 Recommended Reading

For an excellent overview of computer security:

• Secrets and Lies by Bruce Schneier (ISBN 0-471-25311-1)

For a detailed review of cryptography:

• Applied Cryptography by Bruce Schneier (ISBN 0-471-11709-9)

For a detailed description of the SSL/TLS protocol:

• SSL and TLS by Eric Rescorla (ISBN 0-201-61598-3)

For a reference on the math and methods in cryptography (this is a heavy duty book):

• Handbook of Applied Cryptography by Menezes, Oorschot and Vanstone (ISBN 0-8493-8523-7)

9.9.2 Onboard Self Signed Certificate Creation


To help developers tackle the growing burden of implementing and managing security on embedded and IoT de-
vices, NetBurner now offers the ability for onboard self-signed certificate generation. This means that with very little
effort (a single line of code, in fact), NetBurner modules acting as a server and running NNDK 3.x can automatically
generate a self-signed certificate that can be used in secure SSL/TLS communications.

This feature is designed to allow engineers to have maximum control over the certificates that are used by
their devices and can be modified in several different ways. Currently, the default behavior is as follows:
1) If a certificate is manually loaded on the module prior to the initialization of the SSL/TLS server, that certificate
will be used, and the device will generate nothing.
2) If a TLS connection is attempted, either through SSL_connect(), SSL_accept(), or StartHttps(), and the device
does not have a certificate loaded already, one will be generated automatically.
3) If a certificate has been generated previously and a new certificate is manually loaded on the device, the newly
loaded certificate will be used in place of the automatically generated one. This will take place once the device has
gone through a power cycle. The automatically-generated certificate will still be available on the module.
4) If ENABLE_AUTOCERT_REGEN is defined (found in predef.h), then the module will periodically check to see if
the auautomatically-generated cert has expired, and if it has, it will automatically generate a new one. How often it
is checked is defined by AUTO_CERT_GEN_CHECK (also in predef.h), and defaults to once per minute.

Certificates generated with this functionality are good for one year. These certificates live in non-volatile memory
and will survive if the device is powered off. The auto-generated certificate creation system has been extended
substantially since it was first introduced. The following examples are available to demonstrate the capabilities of
the system, including several examples for advanced users who need more control over how the certificates are
generated. The are located in <nndk_install>\examples\SSL\SslOnboardCertGeneration:

• Simple: Shows how to initialize the system to enable onboard certificate generation.

• Advanced: Shows how to manually call SSL_CreateNewSelfSignedCert() with properly formatted alt
names.

• CompiledCa: Shows how to create a custom self signed cert function that uses a compiled in Certificate
Authority to sign the generated certificate.

When generating the certificate, the random number generator will need to be properly seeded. This is
done by analyzing serial and network traffic. Pinging the device or visiting the device's config page from a
browser will speed this process up.

By default, the certificate is generated using ECC with SECP384R1. This can be changed to an RSA key by
undefining ENABLE_ECCKEY_CREATE in nburn\libraries\crypto\platform\<platform
name>\user_settings.h, and then rebuilding your application. To specify what curve or RSA key

NetBurner, Inc.
144 Programmers Guide

length is used in certificate generation, define DEFAULT_KEY_TYPE as one of the values defined by
SslKeyType_t.

9.9.3 Creating Self-Signed Certificates


The NetBurner SSL/TLS library provides some open source tools for the generation and maintenance of SSL/←-
TLS self-signed keys and certificates. These tools are based on OpenSSL and subject to OpenSSL License. The
NetBurner SSL/TLS library code subject to the standard NetBurner License (located by default in \Nburn\docs).

• openssl.exe: Creates certificates and keys

• compfile: Creates .cpp files from certificates and keys

There is a readme.txt file in \nburn\CreateCerts that provides information on .bat and .sh files used
to make the creation process easier. Please refer to the script files if you want more information on the OpenSSL
options used to create the certificates and keys. Certificates should use the PEM format.

9.9.3.1 Creating a Certificate Authority (CA) Certificate and Key

This step creates a CA you can use to sign certificates. Important: You should only have to do this step once. The
key file created in this step should be protected as the security of all your certificates depend on it. You have two
choices to protect this key file. Note: If you want the key to not be protected by a pass phrase then leave the -des
off the genrsa command.

• Open a command prompt in \nburn\CreateCerts\ECDSA or \nburn\CreateCerts\RSA, de-


pending on the type of certificate you want to create.

• Run makeca to create CA.crt and CA.key, which will be used by other script files to sign server and
client certificates and keys.

• You will be prompted to answer some questions. If you require more detailed information please refer to the
OpenSSL website and documentation.

9.9.3.2 Creating a Server Certificate and Key for Your Device

You will need to create a certificate and key for each device you deploy, and the Common Name in the certificate
must match each of your device's name. For example, if I have 2 devices and am using DNS, then I could name
them Device1 and Device2, and the certificate would need the CN to match. If I did not have DNS, I could use their
IP addresses as the CN. However, if their IP address changes, the certificate would no longer be valid because the
CN would not match.

• Open a command prompt in \nburn\CreateCerts\ECDSA or \nburn\CreateCerts\RSA, de-


pending on the type of certificate you want to create.

• Run 'makeserver' to create device.crt and device.key. The script will also invoke compfile to
create cert.cpp and key.cpp in case you desire to use a compiled-in cert and key.

• This certificate will be signed with the CA certificate created previously.

9.9.3.3 Converting a Certificate and Key to Code with <tt>compfile</tt>

The compfile utility converts .crt and .key files to C++ source code files that can be built into your application
(note this implies that each device needs its own application image). It is already part of in the batch and shell files
mentioned previously. This section is included in the event you wish to run it separately against your .crt and
.key files.

NetBurner, Inc.
9.9 SSL/TLS Programming Guide 145

• Open a command prompt in \nburn\CreateCerts\ECDSA or \nburn\CreateCerts\RSA, de-


pending on the type of certificate you are converting.

• Executethe commands: compfile device.key comp_key comp_key_len key.cpp


compfile device.crt comp_cert comp_cert_len cert.cpp

Note

comp_key, comp_key_len, comp_cert, and comp_cert_len all refer to global variables available
in the application that represent the key data, the length of the key data, the cert data, and the length of the
cert data respectively.

9.9.3.4 Adding the Module to your Code Set

Take the key.cpp and cert.cpp files previously created and import it into your project directory. If you are
using command line tools, copy it to your project directory and add it to your makefile.

9.9.3.5 Using a Recognized Certificate Authority

If you are going to have your certificates signed by an external entity, they will need a Certificate Request file. Note:
The common name you enter in this step must match the deployed DNS name or IP Address of the Server it will be
used on.

• Open a command prompt/DOS window

• Navigate to the directory that you want to house your device files

• To make a Device Certificate Request file, execute the command (and press the Enter key when finished)←-
: openssl genrsa -out Server.key 1024 openssl req -new -key Server.key
-out Server.csr
• Send this Server.csr to the CA that will create your certificate.

Warning: If you lose the Server.key file associated with this particular device, then you will not be able to use
the certificate file they send back.

9.9.3.6 Testing Your Certificates

The batch and shell files checkcert and checkkey can be found in \nburn\CreateCerts\ECDSA or
\nburn\CreateCerts\RSA. For example: checkcert device.crt checkkey device.key

9.9.4 Creating Certificate Authority Lists


9.9.4.1 Creating a CA List file

To create a CA List that will hold all of the CA certificates you are willing to accept, you can either compile the
certificate data into your project, or you can load it dynamically from a flash drive.

To use the compiled in data, create a header file in your project directory that will hold the certificate data. In
this file, create a const char array for each certificate that is initialized as a string literal with each corresponding
CA certificates’ data. Make sure to take note of the length of the array, as it will passed into SSL_connect() as
function parameters. The example nburn\examples\SSL\SslClientVerifyPeerBasic demonstrates
this method.

NetBurner, Inc.
146 Programmers Guide

To use an SD card or onchip flash to store the certificate data, please see the example nburn\examples\SSL\Ssl←-
ClientVerifyPeerEffs for further guidance. In that example, we initialize the SSL/TLS system with
a call to SslInit() before we start the HTTPS server so that we might add the certificates with calls to
SSL_AddCertToClientCaList() for each certificate that we want to load. In this examplewe do this before
the calls to SSL_connect() so that we can add multiple certificates stored on the SD card or onchip flash.

9.10 SSH Programming Guide


9.10.1 SSH Overview
The Secure Shell Protocol (SSH) is a secure network protocol that has been around since 1995. It was designed to
facilitate operating network services over an encrypted connection, and is still widely used today.
SSH has been a part of NetBurner's offerings for quite awhile now, starting with NNDK version 2.0. Up until recently,
we utilized Dropbear to provide the SSH capability to our library. As of NNDK 3.3.6, however, we have migrated to
wolfSSH. This change provides our library with several benefits. First, it provides better security with an updated list
of ciphers compared to the version of Dropbear we were utilizing previously. It also allowed us to provide additional
features, such as the capability to support running an SSH client on our devices, where we had been unable to do
so before. Finally, because it shares the same underlying library with our SSL/TLS library, wolfCrypt, we were able
to reduce the amount of code required to run both libraries simultaneously.

9.10.1.1 Supported Key Types, Sizes, and Formats

The SSH library currently supports both ECC and RSA keys, though we recommend ECC. The default key
size for RSA is 2024, but support for a 4096 key can be enabled by defining ENABLE_RSA_4K in <nndk_←-
install>\nbrtos\include\predef.h. ECC key sizes can range from 160 to 512.
Both ECC and RSA keys can be presented in either PEM or ASN1 formats.

9.10.1.2 Migrating from NNDK 3.3.5 and earlier to 3.3.6 or later

We've made every effort to make sure that the updates to the SSH library would be backward compatible. How-
ever, in some cases change was unavoidable, and in others, developers would be better served to update their
applications to use newer versions of existing functions.
When building applications that use the SSH libraries in NBEclipse, the following include paths need to be added to
projects:

${NNDK_ROOT}/libraries/include/ssh
${NNDK_ROOT}/libraries/include/crypto
To do this, first right click on your project in NBEclipse, and select the properties option at the bottom of the menu.
The following window will be displayed.

NetBurner, Inc.
9.10 SSH Programming Guide 147

Figure 9.9 Adding the SSH Include Paths

From the left side menu, select "C/C++ Build" (1) followed by "Settings" (2). In the main window, you'll want to select
the "Includes" (3) folder under both the "GNU C Compiler" and "GNU C++ Compiler". Once here, hit the icon with
the green plus on it (4), and then add the paths so that they are listed above (5). Finally, hit "Apply", and then clean
the project. It should find the required files during the build and complete successfully.

9.10.1.2.1 Removed and Updated Functions The following functions have been removed from our API. They
were specific to the Dropbear library and no longer make sense to have in our current API.

• SshConvertDecodedOpenSSLKey This function converted a PEM formatted SSL key to the Dropbear
format. The new API supports both PEM and ASN1 formatted keys, and we no longer support the Dropbear
format.

• SshSetchansessionrequest This function set a user callback routine for handling server side channel
requests. These requests are handled internally by wolfSSH.

• SshSetTaskPriority This function set the task priority for the SSH session. Where each SSH ses-
sion had its own task previously, both SSH and SSL/TLS sessions are now managed by the Crypto←-
Server object. This object runs a task of priority SECURITY_TASK_PRIO, which is defined in <nndk←-
_install>\nbrtos\include\constants.h.

The following functions and function pointers have updated versions that we encourage developers to take advan-
tage of.

NetBurner, Inc.
148 Programmers Guide

• sshUserAuthenticateFn An updated version of this function pointer, sshUserAuthenticateWithTypeFn,


has been added to the API. Instead of just taking a pointer to the username and password as its parameters,
it now additionally takes a parameter of AuthType that specifies if the authentication value passed in is a
password or a key.

• SshSetUserAuthenticate This function should be replaced with SshSetUserAuthenticateWithType(),


and takes as it's parameter a function pointer of type sshUserAuthenticateWithTypeFn.

• SshGetUserAuthenticate This function should be replaced with SshGetUserAuthenticateWithType(),


and returns a function pointer of type sshUserAuthenticateWithTypeFn, if it has been set with a call to
SshSetUserAuthenticateWithType().

9.10.1.3 Onboard Generated Keys

As is the case with our updated SSL/TLS library, SSH can now take advantage of onboard generated keys. This
means that SSH keys can be automatically generated on the device if required. The mechanism for this is exactly
the same, and in fact, the SSH key is the same key that is generated as part of generating an SSL/TLS certificate.
To understand how to use the functionality, we encourage developers to look at the appropriate examples, found in
<nndk_install>\examples\SSL\SslOnboardCertGeneration.
Auto-regeneration of this key can be enabled by defining ENABLE_AUTOCERT_REGEN, found in <nndk_←-
install>\nbrtos\include\predef.h.

9.10.1.4 Order of Key Use

There are several methods in which a key could be installed on the device. In order of consideration during runtime,
these are:

• Set a function callback with SshSetUserGetKey() that will return the server key via the passed in parameters.

• Using a compiled in key, and overriding the weak function GetPrivateKeyPEM().

• Using an onboard generated key.

9.10.1.5 User Authorization

To assist with storing and managing user authentication data, we've provided a simple class, UserAuthManager.
This class provided the methods required to store, retrieve, and compare user credentials for authentication and
authorization purposes. Two callbacks signatures are provided, LoadAuthRecordsFn and SaveAuthRecordsFn, that
can be used to load and save user authorization into the UserAuthManager object. This allows the developer to use
any type of storage device or location to save the data.
Passwords and keys are hashed when added to the manager, so there is no possibility for leaking plain text data
that could potentially compromise the security of the system. Our provided example, sshServerUserAuth,
demonstrates this using the devices User Param space to save the data as a JSON blob.

9.11 Web Server


Topic Links:

• Basic Web Server

• Dynamic Web Content

9.11.1 Basic Web Server


The Application Wizard creates a main.cpp file, and also a directory in your project named "html" with a file named
index.html:

<html>
<body>
The main page for the AppWizard project.
</body>

NetBurner, Inc.
9.11 Web Server 149

</html>

In NBEclipse you can open a HTML file in text edit mode by right-clicking on the file and selecting the text
editor option:

Figure 9.10 Open with text editor

The project html folder is where you can all the files you need for your application, including images, javascript, html
files, etc. You can also add folders. For example adding a folder for images is very common. For example, if you
created a folder in the html directory named images and added the file logo.jpg, you could add it to your index page
by adding the img tag:

<html>
<body>
The main page for the AppWizard project.
<img src = images/logo.jpg>
</body>
</html>

9.11.2 Dynamic Web Content


Dynamic web content (web content created at run-time) can be created using the following NetBurner HTML tags:

• A C++ callback function CPPCALL:


<!--CPPCALL YourCppFunction -->

When the web server delivers the web page it will call your C++ function.

• The VARIABLE tag:


<!--VARIABLE YourVariable -->

. When the web server delivery the web page it will insert the specified variable.

• A C callback function FUNCTIONCALL. This tag is included for those porting from older tool sets. FUNC-
TIONCALL is a C only tag, and is deprecated.

NetBurner, Inc.
150 Programmers Guide

9.11.2.1 Dynamic Content Using the CPPCALL Tag

To add a C++ callback we can add a function to main.cpp such as:


void webHelloWorld( int sock, PCSTR url )
{
writestring( sock, "Hello World" );
}

And modify index.html to add the tag:


<html>
<body>
The main page for the AppWizard project.
<!--CPPCALL webHelloWorld -->
</body>
</html>

When a web client requests the index.html page, the web server will begin steaming the static content. When it gets
to the CPPCALL, it will call the webHelloWorld() function, which will send "Hello World" to the client using the open
TCP socket. When the function returns, the web server will continue sending the index.html web page. A web page
can have any number of CPPCALL and VARIABLE tags. The parameters passed to the CPPCALL function are the
open TCP socket handle, and a pointer to a constant string containing the entire URL of the client web browser. In
this way your function can parse the URL if that is important to your application. For example, anything after a '?'
character is application specific.

9.11.2.2 Displaying Variables Using the VARIABLE Tag

Variables in an application can be displayed on a web page using the VARIABLE tag. This can be useful for
displaying information such as time, an IP address, temperature, etc. The format of the tag is:
<!--VARIABLE <name> -->

Where "name" is the name of the application variable or an expression. For example, the system time tick
variable TimeTick can be displayed with
<!--VARIABLE TimeTick -->
Or you can display the time in seconds with the equation:
<!--VARIABLE TimeTick/TICKS_PER_SECOND -->
The VARIABLE tag is processed during the compilation of the application by parsing the text between <!--←-
VARIABLE and the trailing --> and converting it into a function call such as: WriteHtmlVariable( fd,
TimeTick/TICKS_PER_SECOND ); In this function fd is a file descriptor to the current TCP connection to
the web client.

Variable types are handled with C++, but you do not need to know anything about C++ to use this feature.
The parameter types are defined by the function definitions located in \nburn\include\htmlfiles.h:

void WriteHtmlVariable(int fd, char c);


void WriteHtmlVariable(int fd, int i);
void WriteHtmlVariable(int fd, short i);
void WriteHtmlVariable(int fd, long i);
void WriteHtmlVariable(int fd, BYTE b);
void WriteHtmlVariable(int fd, WORD w);
void WriteHtmlVariable(int fd, unsigned long dw);
void WriteHtmlVariable(int fd, const char *);
void WriteHtmlVariable(int fd, MACADR ip);
In addition, we have included a class named IPCAST() that takes a 32-bit value and converts it into an IP address
format (e.g. 192.168.1.2). This example will display the IP address in dotted notation, rather than a 32-bit integer:
IP address: <!--VARIABLE IPCAST(IpAddress) !-->

NetBurner, Inc.
9.11 Web Server 151

9.11.2.3 Linking to Variables Using the INCLUDE Tag and htmlvar.h Header File

When an application with web content is built by the NetBurner tools, a file named htmldata.cpp is created. When
using the VARIABLE tag for dynamic data, the application must be able to link to the variable. This can be achieved
in either of two ways:

• Create a header file in your project named htmlvar.h.

• Use the INCLUDE HTML tag in the .html folder.

An example of a htmlvar.h file to display a variable named Temperature, and a VARIABLE function call-
back named webMyVarFunction() to display an integer:
#ifndef HTMLVARS_H_
#define HTMLVARS_H_
#include <startnet.h>
extern int Temperature;
const char *webMyVarFunction(int fd, int v);
#endif // HTMLVARS_H_

9.11.2.4 Function Callbacks With Variables Using the VARIABLE Tag

If you need to use a function that can take a parameter, the CPPCALL tag will not work because the parameters
are fixed as the socket fd and URL. However, the VARIABLE tag be used for both the function call and variable
parameter. The htmlvar.h include file must specify the function definition in one of the formats described in the
previous section. the format below. For example, to pass an integer variable webMyInteger in a callback function
named webMyFunction:

const char * webMyVarFunction(int fd, int webMyInteger);


The HTML file calls the function with:
<!--VARIABLE MyFunction(fd, webMyInteger) -->
When the application is compiled the resultant function call will be:
WriteHtmlVariable( fd, MyFunction(fd, webMyInteger) );
In your .cpp source code the function could look something like this:
const char * webMyVarFunction(int fd, int v)
{
char buffer[255];
siprintf( buffer, "MyFunction() was called with v = %d\r\n", v );
writestring( fd, buffer );
return "\0"; // Return a const char * of zero length so it will not print to the HTML page
}

9.11.2.5 Extending the VARIABLE tag for User Defined Types

The VARIABLE functionality can be extended to support user defined types, such as a user defined structure or
class. Lets say you have a structure you want to display on a web page called MySTruct:
struct my_struct {
int i;
char buf[80];
uint32_t dVal;
} MY_STRUCT;
MY_STRUCT MyStruct;
In your include file add the function definition: void WriteHtmlVariable(int fd, MY_STRUCT My←-
Struct); You then need to implement the function to display the data. For example:
void WriteHtmlVariable(int fd, MY_STRUCT MyStruct)
{
fdprintf(fd, "int: %d<br>", i);
fdprintf(fd, "buf: %s<br>", buf);
fdprintf(fd, "uint32_t: %ld<br>", dVal);
}
You can then display it on the web page with the VARIABLE tag:
<!--VARIABLE MyStruct -->

NetBurner, Inc.
152 Programmers Guide

9.12 JSON Lexer


9.12.1 Using the JSON Lexer Interface
Note

This application note applies to NNDK tools version 3.3.9 and later. The many additional features added will
not build in earlier tools versions.

The Json Lexer interface is in json_lexer.h. The two object types that are of interest are:

1. ParsedJsonDataSet: represents a complete JSON object parsed and stored internally.

2. JsonRef: represents a positional reference of location inside a ParsedJsonDataSet. It can be used as a


pointer to a variable or sub object inside a ParsedJsonDataSet object to make decoding the hierarchy much
simpler and easier to understand. A JsonRef is not limited to just pointing at internal objects; it can point to
any JSON parsed token/type.

The ParsedJsonDataSet has two decoding interfaces. The previous interface prior to 3.3.9 should be considered
deprecated. If you have used this class in the past this code will still work, but we have added a new much clearer
easier to understand interface based on the JsonRef object and the associated overloaded operators. This interface
should be used for all decoding going forward.
Before we can practice decoding JSON, we need to get the JSON content into a ParsedJsonDataSet object. There
are multiple methods to accomplish this:

1. Load from a text blob as demonstrated in the example: \nburn\examples\JsonLexer\ParseTest.


Calling the function ParsedJsonDataSet pjd((const char ∗)jdata, jlen, true); will
construct an object from plain text.

2. Load from an external web page as demonstrated in the examples:

• \nburn\examples\JSON\GetJsonFromServer

• \nburn\examples\JSON\PostAndGetJsonExternalServer

• \nburn\examples\WebClient\EarthQuake

1. Load from some type of external interface, web socket, serial port, etc.

• ParsedJsonDataSet pjds; // declare the object

• pjds.ReadFrom(int fd); // read the content from a file descriptor

Once you have a complete ParsedJsonDataSet, you can operate on it and decode the JSON content.
For example, we have a simple JSON structure:
{ “Anumber”: 1234,
“AString”:“ImaString”,
“AnObject”:{“Item1”:1,
“Item2”:”TheItem2”
},
“AnArray” : [1,2,3,4]
}
Using one of the three methods listed above will convert the JSON content into a ParsedJsonDataSet object named
pjds. Internally, the ParsedJsonDataSet toekenizes the JSON it is loaded with and stores the results in minimized
form in NetBurner poolBuffers. None of these internals really matter to the user.
To extract values from the parsed data set:
int i = pjds(“ANumber”); // Read an integer
// Strings can be accessed as a NBString object or const char *.
// The const char * is only valid until the dataset is destroyed or cleaned up.
NBString s = pjds(“AString”);
const char * pStr = pjs(“AString”);
// JsonRef can be used as a pointer to reference interior variables and objects
// in the data set and access them in the same manor.
JsonRef jr = pjds(“AnObject”);
int i1 = jr(“Item1”);
NBString s2 = jr(“Item2”);
// Arrays can be indexed using the array operator
for(int i = 0; I < 4; i++)
printf(“Item[%d] = %d\n”, i, pjds(“AnArray”)[i]);

NetBurner, Inc.
9.12 JSON Lexer 153

In general, you can use (“name”) to find an element and [i] to index in an array. You can then assign the result to the
desired object or variable.
ParsedJsonDataSet types:
operator bool () const {return PermissiveCurrentBool(); };
operator float () const {return (float)CurrentNumber(); };
operator double () const {return CurrentNumber(); };
operator uint8_t() const {return (uint8_t)CurrentNumber(); };
operator int() const {return (int)CurrentNumber(); };
operator uint16_t() const {return (uint16_t)CurrentNumber(); };
operator uint32_t() const {return (uint32_t)CurrentNumber(); };
operator int8_t() const {return (int8_t)CurrentNumber(); };
operator int16_t() const {return (int16_t)CurrentNumber(); };
operator int32_t() const {return (uint32_t)CurrentNumber(); };
operator time_t() const {return (time_t)CurrentNumber(); };
operator const char *() const {return CurrentString(); };
operator NBString() const {return (NBString)CurrentString(); };
There are corresponding check functions as well in the form of: bool IsValid(); to determine if the derefer-
enced ParsedJsonDataSet element or JsonRef point to something valid.
Continuing from the example above:
pjds(“AnArray”)[3].IsValid(); // returns true, a valid decode
pjs(“AnArray”)[4].IsValid(); // returns false as there are only array elements 0 - 3
Additonal Check Functions:
IsNumber()
IsObject()
IsString()
IsBool()
IsNull()
IsArray()
These functions are demonstrated very well in: \nburn\examples\JsonLexer\ParseTest. The example
\nburn\examples\webclient\Earthquake uses these functions to extract various fields from inside a
very large complicated JSON blob and is an interesting example to see the simplification these methods provide.

9.12.2 Earthquake Example


Note

If you wish to use any of this code, do not copy from this document. Get the latest code from the example
source: \nburn\examples\webclient\Earthquake

9.12.2.1 Source Code


/*NB_REVISION*/
/*NB_COPYRIGHT*/
#include <init.h>
#include <stdio.h>
#include <ctype.h>
#include <buffers.h>
#include <json_lexer.h>
#include <webclient/http_funcs.h>
#include <nbtime.h> // Include for NTP functions
const char *url = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_day.geojson";
const char *AppName = "EarthQuake";
void UserMain(void *pd)
{
init(); // Initialize network stack
// Enable system diagnostics. Probably should remove for production code.
EnableSystemDiagnostics();
WaitForActiveNetwork(TICKS_PER_SECOND * 5); // Wait for DHCP address
iprintf("Application started\n");
bool bTimeSet = SetTimeNTPFromPool();
if(bTimeSet)
{
printf("Time Set\r\n");
}
ParsedJsonDataSet JsonResult;
bool result = DoGet(url, JsonResult);
if (result)
{
// JsonResult.PrintObject(true);
int32_t nQuakes = JsonResult("metadata")("count");
printf("In the last Day we have had %ld Earthquakes > 4.5\r\n", nQuakes);
for (int i = 0; i < nQuakes; i++)
{ // A JsonRef is a pointer into a ParsedJsonDataSet object varible or object to simplify access.
// The following code creates a pointer into the event array to capture the properties object.
JsonRef OneQuakeProperties = JsonResult("features")[i]("properties");
if (OneQuakeProperties.Valid())
{
double magnitude = OneQuakeProperties("mag");
NBString place_name = OneQuakeProperties("place");

NetBurner, Inc.
154 Programmers Guide

printf("Magnitude :%2.1f at %s", magnitude, place_name.c_str());


if (bTimeSet)
{
time_t when = OneQuakeProperties("time");
when /= 1000;
time_t now = time(NULL);
time_t delta = (now - when);
int sec = delta % 60;
int mins = (delta / 60) % 60;
int hour = (delta / 3600);
printf(" %02d:%02d:%02d ago", hour, mins, sec);
}
printf("\r\n");
} //Array object look up is valid
else
{
printf("Parse error failed to find array element %d\r\n", i);
}
} // for
} // valid result
else
{
iprintf("Failed to contact server\r\n");
}
while (1)
{
OSTimeDly(TICKS_PER_SECOND * 1);
}
}

9.12.2.2 Earthquake Summary Serial Output

This is the summary output from the example:


In the last Day we have had 17 Earthquakes > 4.5 Magnitude :4.5 at Fiji region 01:44:12 ago Magnitude :4.6 at 128
km W of San Juan, Peru 10:06:35 ago Magnitude :4.5 at 7 km NW of Papayal, Peru 10:32:50 ago Magnitude :4.9 at
56 km SSE of Sand Point, Alaska 10:47:22 ago Magnitude :4.9 at 22 km SSE of Padong, Philippines 11:05:28 ago
Magnitude :5.1 at 70 km WNW of San Antonio de los Cobres, Argentina 12:25:58 ago Magnitude :5.3 at 116 km
SSE of Kushiro, Japan 13:12:09 ago Magnitude :4.6 at 112 km SSE of Kushiro, Japan 13:13:00 ago Magnitude :4.8
at 129 km WNW of Pangai, Tonga 13:49:43 ago Magnitude :4.9 at 256 km ESE of Ust’-Kamchatsk Staryy, Russia
20:15:25 ago Magnitude :4.6 at 120 km NNE of Tobelo, Indonesia 20:23:53 ago Magnitude :4.9 at 57 km ESE of
Koseda, Japan 21:28:56 ago Magnitude :4.8 at 24 km NE of La Paz, Philippines 22:38:44 ago Magnitude :4.5 at
northern Qinghai, China 23:10:02 ago Magnitude :4.6 at 8 km S of Padong, Philippines 23:13:24 ago Magnitude
:4.5 at Fiji region 23:19:04 ago Magnitude :5.1 at 108 km SSE of Hihifo, Tonga 23:39:10 ago

9.12.2.3 JSON Data Parsed From Web Site

The raw JSON content is shown below. This is a good example of how a very complex JSON blob can be easily
parsed with the ParsedJsonDataSet object. To view this data when running the example, uncomment the line: //
JsonResult.PrintObject(true); in the source code.
{
"type": "FeatureCollection",
"metadata": {
"generated": 1666815488000,
"url": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_day.geojson",
"title": "USGS Magnitude 4.5+ Earthquakes, Past Day",
"status": 200,
"api": "1.10.3",
"count": 17
},
"features": [
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "Fiji region",
"time": 1666809240464,
"updated": 1666814388040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikie",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikie.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",

NetBurner, Inc.
9.12 JSON Lexer 155

"code": "7000ikie",
"ids": ",us7000ikie,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 60,
"dmin": 3.053,
"rms": 1,
"gap": 74,
"magType": "mb",
"type": "earthquake",
"title": "M 4.5 - Fiji region"
},
"geometry": {
"type": "Point",
"coordinates": [
-178.3577,
-20.3848,
551.981
]
},
"id": "us7000ikie"
},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "128 km W of San Juan, Peru",
"time": 1666779097415,
"updated": 1666779906040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikgd",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikgd.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikgd",
"ids": ",us7000ikgd,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 36,
"dmin": 3.395,
"rms": 0.54,
"gap": 174,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 128 km W of San Juan, Peru"
},
"geometry": {
"type": "Point",
"coordinates": [
-76.3603,
-15.3705,
10
]
},
"id": "us7000ikgd"
},
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "7 km NW of Papayal, Peru",
"time": 1666777522132,
"updated": 1666779183255,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikg9",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikg9.geojson",
"felt": 1,
"cdi": 2.7,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",
"code": "7000ikg9",
"ids": ",us7000ikg9,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 33,
"dmin": 0.862,
"rms": 0.85,

NetBurner, Inc.
156 Programmers Guide

"gap": 165,
"magType": "mb",
"type": "earthquake",
"title": "M 4.5 - 7 km NW of Papayal, Peru"
},
"geometry": {
"type": "Point",
"coordinates": [
-80.7874,
-4.027,
44.425
]
},
"id": "us7000ikg9"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "56 km SSE of Sand Point, Alaska",
"time": 1666776650887,
"updated": 1666803216746,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikg1",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikg1.geojson",
"felt": 2,
"cdi": 3.6,
"mmi": 3.716,
"alert": null,
"status": "reviewed",
"tsunami": 1,
"sig": 370,
"net": "us",
"code": "7000ikg1",
"ids": ",us7000ikg1,at00rkct3e,ak022dqn87rq,",
"sources": ",us,at,ak,",
"types": ",dyfi,impact-link,moment-tensor,origin,phase-data,shakemap,",
"nst": 232,
"dmin": 0.369,
"rms": 0.6,
"gap": 127,
"magType": "mww",
"type": "earthquake",
"title": "M 4.9 - 56 km SSE of Sand Point, Alaska"
},
"geometry": {
"type": "Point",
"coordinates": [
-160.2254,
54.8564,
41.855
]
},
"id": "us7000ikg1"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "22 km SSE of Padong, Philippines",
"time": 1666775564622,
"updated": 1666776869040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfz",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfz.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 369,
"net": "us",
"code": "7000ikfz",
"ids": ",us7000ikfz,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 73,
"dmin": 4.915,
"rms": 0.54,
"gap": 117,
"magType": "mb",
"type": "earthquake",
"title": "M 4.9 - 22 km SSE of Padong, Philippines"
},
"geometry": {
"type": "Point",

NetBurner, Inc.
9.12 JSON Lexer 157

"coordinates": [
120.8605,
17.8819,
36.251
]
},
"id": "us7000ikfz"
},
{
"type": "Feature",
"properties": {
"mag": 5.1,
"place": "70 km WNW of San Antonio de los Cobres, Argentina",
"time": 1666770734080,
"updated": 1666775309650,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfn",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfn.geojson",
"felt": 1,
"cdi": 2.7,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 400,
"net": "us",
"code": "7000ikfn",
"ids": ",us7000ikfn,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 55,
"dmin": 1.573,
"rms": 1,
"gap": 40,
"magType": "mww",
"type": "earthquake",
"title": "M 5.1 - 70 km WNW of San Antonio de los Cobres, Argentina"
},
"geometry": {
"type": "Point",
"coordinates": [
-66.9953,
-24.0942,
185.017
]
},
"id": "us7000ikfn"
},
{
"type": "Feature",
"properties": {
"mag": 5.3,
"place": "116 km SSE of Kushiro, Japan",
"time": 1666767963104,
"updated": 1666790561040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfi",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfi.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 432,
"net": "us",
"code": "7000ikfi",
"ids": ",us7000ikfi,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 90,
"dmin": 1.178,
"rms": 1.04,
"gap": 99,
"magType": "mww",
"type": "earthquake",
"title": "M 5.3 - 116 km SSE of Kushiro, Japan"
},
"geometry": {
"type": "Point",
"coordinates": [
144.7352,
41.9619,
35.062
]
},
"id": "us7000ikfi"

NetBurner, Inc.
158 Programmers Guide

},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "112 km SSE of Kushiro, Japan",
"time": 1666767912312,
"updated": 1666769828040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikfl",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikfl.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikfl",
"ids": ",us7000ikfl,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 27,
"dmin": 1.163,
"rms": 0.38,
"gap": 176,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 112 km SSE of Kushiro, Japan"
},
"geometry": {
"type": "Point",
"coordinates": [
144.7166,
41.9912,
37.754
]
},
"id": "us7000ikfl"
},
{
"type": "Feature",
"properties": {
"mag": 4.8,
"place": "129 km WNW of Pangai, Tonga",
"time": 1666765709390,
"updated": 1666767075040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikff",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikff.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 354,
"net": "us",
"code": "7000ikff",
"ids": ",us7000ikff,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 32,
"dmin": 1.175,
"rms": 1.12,
"gap": 64,
"magType": "mb",
"type": "earthquake",
"title": "M 4.8 - 129 km WNW of Pangai, Tonga"
},
"geometry": {
"type": "Point",
"coordinates": [
-175.5083,
-19.3888,
235.932
]
},
"id": "us7000ikff"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "256 km ESE of Ust’-Kamchatsk Staryy, Russia",
"time": 1666742567939,

NetBurner, Inc.
9.12 JSON Lexer 159

"updated": 1666743756040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikdk",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikdk.geojson",
"felt": null,
"cdi": null,
"mmi": 3.339,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 369,
"net": "us",
"code": "7000ikdk",
"ids": ",us7000ikdk,ak022dqhpbfw,",
"sources": ",us,ak,",
"types": ",origin,phase-data,shakemap,",
"nst": 69,
"dmin": 5.174,
"rms": 0.38,
"gap": 83,
"magType": "mb",
"type": "earthquake",
"title": "M 4.9 - 256 km ESE of Ust’-Kamchatsk Staryy, Russia"
},
"geometry": {
"type": "Point",
"coordinates": [
166.3788,
55.5213,
10
]
},
"id": "us7000ikdk"
},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "120 km NNE of Tobelo, Indonesia",
"time": 1666742059732,
"updated": 1666743214040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikde",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikde.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikde",
"ids": ",us7000ikde,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 37,
"dmin": 2.209,
"rms": 0.9,
"gap": 117,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 120 km NNE of Tobelo, Indonesia"
},
"geometry": {
"type": "Point",
"coordinates": [
128.3655,
2.756,
212.676
]
},
"id": "us7000ikde"
},
{
"type": "Feature",
"properties": {
"mag": 4.9,
"place": "57 km ESE of Koseda, Japan",
"time": 1666738156180,
"updated": 1666741703040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikcv",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikcv.geojson",
"felt": null,
"cdi": null,
"mmi": null,

NetBurner, Inc.
160 Programmers Guide

"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 369,
"net": "us",
"code": "7000ikcv",
"ids": ",us7000ikcv,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 65,
"dmin": 1.465,
"rms": 0.66,
"gap": 122,
"magType": "mb",
"type": "earthquake",
"title": "M 4.9 - 57 km ESE of Koseda, Japan"
},
"geometry": {
"type": "Point",
"coordinates": [
131.2036,
30.1903,
32.26
]
},
"id": "us7000ikcv"
},
{
"type": "Feature",
"properties": {
"mag": 4.8,
"place": "24 km NE of La Paz, Philippines",
"time": 1666733968988,
"updated": 1666735447870,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikch",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikch.geojson",
"felt": 1,
"cdi": 3.8,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 355,
"net": "us",
"code": "7000ikch",
"ids": ",us7000ikch,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 73,
"dmin": 4.996,
"rms": 0.56,
"gap": 117,
"magType": "mb",
"type": "earthquake",
"title": "M 4.8 - 24 km NE of La Paz, Philippines"
},
"geometry": {
"type": "Point",
"coordinates": [
120.8722,
17.8003,
35.567
]
},
"id": "us7000ikch"
},
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "northern Qinghai, China",
"time": 1666732090914,
"updated": 1666733158040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc3",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc3.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",
"code": "7000ikc3",
"ids": ",us7000ikc3,",

NetBurner, Inc.
9.12 JSON Lexer 161

"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 61,
"dmin": 10.77,
"rms": 0.67,
"gap": 64,
"magType": "mb",
"type": "earthquake",
"title": "M 4.5 - northern Qinghai, China"
},
"geometry": {
"type": "Point",
"coordinates": [
92.2784,
37.7294,
10
]
},
"id": "us7000ikc3"
},
{
"type": "Feature",
"properties": {
"mag": 4.6,
"place": "8 km S of Padong, Philippines",
"time": 1666731888656,
"updated": 1666735766443,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc6",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc6.geojson",
"felt": 0,
"cdi": 1,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 326,
"net": "us",
"code": "7000ikc6",
"ids": ",us7000ikc6,",
"sources": ",us,",
"types": ",dyfi,origin,phase-data,",
"nst": 54,
"dmin": 4.828,
"rms": 0.78,
"gap": 127,
"magType": "mb",
"type": "earthquake",
"title": "M 4.6 - 8 km S of Padong, Philippines"
},
"geometry": {
"type": "Point",
"coordinates": [
120.7462,
17.975,
48.754
]
},
"id": "us7000ikc6"
},
{
"type": "Feature",
"properties": {
"mag": 4.5,
"place": "Fiji region",
"time": 1666731548904,
"updated": 1666734071040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc1",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc1.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 312,
"net": "us",
"code": "7000ikc1",
"ids": ",us7000ikc1,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 26,
"dmin": 3.012,
"rms": 0.4,
"gap": 124,
"magType": "mb",

NetBurner, Inc.
162 Programmers Guide

"type": "earthquake",
"title": "M 4.5 - Fiji region"
},
"geometry": {
"type": "Point",
"coordinates": [
-178.3447,
-20.5028,
590.211
]
},
"id": "us7000ikc1"
},
{
"type": "Feature",
"properties": {
"mag": 5.1,
"place": "108 km SSE of Hihifo, Tonga",
"time": 1666730342483,
"updated": 1666733344040,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/us7000ikc5",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/us7000ikc5.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "reviewed",
"tsunami": 0,
"sig": 400,
"net": "us",
"code": "7000ikc5",
"ids": ",us7000ikc5,",
"sources": ",us,",
"types": ",origin,phase-data,",
"nst": 52,
"dmin": 1.882,
"rms": 1.07,
"gap": 69,
"magType": "mb",
"type": "earthquake",
"title": "M 5.1 - 108 km SSE of Hihifo, Tonga"
},
"geometry": {
"type": "Point",
"coordinates": [
-173.386,
-16.8501,
19.916
]
},
"id": "us7000ikc5"
}
],
"bbox": [
-178.3577,
-24.0942,
10,
166.3788,
55.5213,
590.211
]
}

9.13 Custom Branding


NetBurner is an OEM manufacturer and our products can be customized to present your custom brand to your
customers. Some customizations are very simple such as changing the logo on the configuration screens, to more
complex such as having your own cloud server instead of using discover.netburner.com. Some suggestions for
customization and branding are:

• Replace the company logo on the configuration server page. Please refer to the CustomWebConfigSystem
example.

• Create your own configuration interface as part of your application. Examples are located in the

NetBurner, Inc.
9.13 Custom Branding 163

\nburn\examples\web folder. The configuration server is not required to change system settings.
An application has full access to display, change and save any configuration setting through a web interface,
or within the application code itself.

• Order your NetBurner device without a NetBurner label. We also provide label templates so that you can
change just the logo and part number.

• Customize the NetBurner utilities, such as localdiscover or find. Source code for these utilities are
located in \nburn\pctools.

• Create your own cloud server in place of discover.netburner.com. This is very advanced.

NetBurner, Inc.
164 Programmers Guide

NetBurner, Inc.
Chapter 10

System Diagnostics

10.1 Introduction
System Diagnostics can be viewed from a device's Configuration Server web page (port 20034) by calling the
EnableSystemDiagnostics() function in your application. Diagnostic information includes items such as system
definitions, variables, TCP stack status, and RTOS state information.

10.2 Configuration Server Page with Diagnostics Enabled


When system diagnostics are enabled, an additional button will appear on the configuration server web page in the
lower right corner:

NetBurner, Inc.
166 System Diagnostics

Figure 10.1 Configuration Server With Diagnostics Button

10.3 System Configuration Web Page Display


Clicking on the Diagnostics button will display system information. An example of the raw data is shown below:
{
"Active":0 day 01:18:04,
"Buffers":401,
"Config":{"ConfigUsed":749,
"ConfigMaxSpaceAvailible":10240
}
,
"EXtraIO":120,
"FreeMem":7577316,
"My Int":4677,
"My String":"My String",
"NNDKVer":"3.3.8",
"System Macros":{
"_DEBUG":"not defined",
"TICKS_PER_SECOND":20,
"TICK_IRQ_LEVEL":5,
"SERIAL_IRQ_LEVEL":3,
"TCP_SOCKET_OFFSET":5,
"TCP_SOCKET_STRUCTS":128,
"OS_MAX_IRQ":"not defined",
"NBRTOS_STACKCHECK":"not defined",
"NBRTOS_STACKOVERFLOW":"not defined",
"NBRTOS_TASKLIST":"not defined",
"NBRTOS_TASK_LOG":"not defined",
"NBRTOS_TIME":"not defined",
"BUFFER_DIAG":"not defined",
"BUFFER_DIAG_LOG":"not defined",

NetBurner, Inc.
10.3 System Configuration Web Page Display 167

"BUFFER_SANITY":"not defined",
"_DEBUG_PRINT":"not defined",
"ENABLE_SMARTTRAP":"defined",
"MULTIHOME":"not defined",
"IPV6":"defined",
"IPV6_COUNTERS":"defined",
"AUTOIP":"defined",
"ALLOW_CUSTOM_NET_DO_RX":"not defined",
"TCP_NOCOPY_TX":"defined",
"UDP_FRAGMENTS":"not defined",
"GATHER_RANDOM":"defined",
"NB_SSL_SUPPORTED":"defined",
"SSL_V3_DISABLED":"not defined",
"SSL_TLS_SUPPORT":"defined",
"WEB_CLIENT_SSL_SUPPORT":"defined",
"SSL_DEFAULT_MAX_SESSION_AGE_TICKS":"defined",
"TLS_CACHE_PEER_CERT_VALIDATIONS":"defined",
"NB_SSL_CLIENT_CERTIFICATE_CHECKING_ENABLED":"not defined",
"NB_SSH_SUPPORTED":"not defined",
"NB_ENABLE_USER_QSPI":"defined",
"SUPPORT_LEGACY_FIND":"defined",
"NO_SYMETRIC_ROUTING":"not defined",
"FEC_ISR_ERROR_COUNTERS":"not defined"
},
"TCP":{"FreeSockets":124,
"Sockets":{"Socket129":{"State":"ESTABLISED","Flags":"0x81","myIP":"192.168.1.140","theirIP":"192.168.1.26","myPort":20034,"th
"myWindow":871968320,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":93681},
"Socket130":{"State":"ESTABLISED","Flags":"0x80","myIP":"192.168.1.140","theirIP":"192.168.1.26","myPort":20034,"theirPort":59
"myWindow":2744612803,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":93681},
"Socket131":{"State":"LISTEN","Flags":"0x00","myIP":"::","theirIP":"::","myPort":80,"theirPort":0,"max_listen":5,"cur_listen":
"myWindow":0,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":0},
"Socket132":{"State":"LISTEN","Flags":"0x00","myIP":"::","theirIP":"::","myPort":20034,"theirPort":0,"max_listen":5,"cur_liste
"myWindow":0,"TxBuffDepth":0, "RxBuffDepth": 0,"lastRxTime":93681}}},
"Tasks":{
"Task38":{"Name":"Enet", "Prio":38,"State":"Fifo","Time":40,
"Stack":["70005b26","7002d6d4","70005f30","7000ed1c","000004a4"]},
"Task44":{"Name":"Config Server", "Prio":44,"State":"Running","Time":600,
"Stack":["7002d54a","700061be","70023f82","700249ec","70020de4","7002178e","700218e8","7003143e","700213e6","000004a4"]
"Task45":{"Name":"HTTP", "Prio":45,"State":"Semaphore","Time":19,
"Stack":["70005b26","7002d6d4","70005e48","7000465a","70004694","700245e4","000004a4"]},
"Task50":{"Name":"Main", "Prio":50,"State":"Timer","Time":20,
"Stack":["70005b26","7002d6d4","70005b96","7001e05a","000004a4"]},
"Task63":{"Name":"Idle", "Prio":63,"State":"Ready","Time":"FOREVER", "Stack":["7002c424","000004a4"]}
},
"Ticks":93681,
"UpTime":4684
}

If you are using Firefox or have the Pretty Print extension in Chrome, the JSON data will be formatted and
much easier to read. If the output you see looks identical to the previous raw information, it means the browser you
are using does not support JSON data formatting. The image below shows a snippet of a formatted file displayed
in Firefox:

NetBurner, Inc.
168 System Diagnostics

Figure 10.2 Formatted JSON displayed with Firefox


NetBurner, Inc.
10.4 Adding Your Own Diagnostic Information 169

10.4 Adding Your Own Diagnostic Information


You can add your own diagnostic information using the MyVarMon() functions. Please refer to the System Diagnos-
tics example for more details. In the example output in the previous section, the variables below were added to the
standard system output:
"My Int":4677,
"My String":"My String",
The application code to implement the display from the example is:
// Variables to monitor
int myInt;
char myString[80];
// Declarations to add variables to Diagnostic Web page
static DiagVarMon MyIntMon("My Int", myInt);
static DiagVarMon MyStrMon("My String", myString);

NetBurner, Inc.
170 System Diagnostics

NetBurner, Inc.
Chapter 11

Example Applications

Example Applications Main Page

• AES

• Board Lock

• Clear Configuration Flash

• Clear User Parameter Flash

• Configuration

• DNS Device Name

• DHCP

• DNS Client

• Embedded Flash File System (EFFS)

• Ethernet

• Exception Try/Catch

• Extra FD Circular Buffer

• fdprintf - printf to file descriptor

• FTP

• GDB Debugger

• General Purpose I/O

• IP Address Object (IPADDR)

• IPv6

• JSON Lexer

• JSON

• malloc

• Multicast

• Multihome

• NB Approve Shutdown

• NBString Class

• NetBios Name

NetBurner, Inc.
172 Example Applications

• Network Time Server (NTP) Client

• NTP & Real-Time Clock

• Overload Directory & System Files

• Platform Specific

• PPP

• Profiler

• RTOS

• Save to User Parameter Flash

• Serial

• Serial Webserver

• SHA1 Digest

• Show Network Interfaces

• SOCKS5 Client

• SPI

• SSH

• SSL/TLS

• Stack Protection

• Syslog

• System Diagnostics

• TCP

• Telnet Command

• TFTP - Trivial File Transfer Protocol

• Time Functions

• Timers

• UDP

• VLAN

• Web Server

• Web Client

• Web Sockets

• Wifi

NetBurner, Inc.
11.1 AES 173

11.1 AES
A basic description of AES can be obtained from Wikipedia, and if you are new to AES, you should definitely do
some research to understand the implementation. The description below is from Wikipedia:
In cryptography, a block cipher is a symmetric key cipher which operates on fixed-length groups of bits, termed
blocks, with an unvarying transformation. When encrypting, a block cipher might take a (for example) 16-bit block
of plaintext as input, and output a corresponding 16-bit block of ciphertext. The exact transformation is controlled
using a second input - the secret key. Decryption is similar: the decryption algorithm takes, in this example, a 16-bit
block of ciphertext together with the secret key, and yields the original 16-bit block of plaintext.
To encrypt messages longer than the block size, a mode of operation is used. Block ciphers can be contrasted with
stream ciphers; a stream cipher operates on individual digits one at a time, and the transformation varies during
the encryption. The distinction between the two types is not always clear-cut: a block cipher, when used in certain
modes of operation, acts effectively as a stream cipher.
This example demonstrates how to use the AES key, encryption, and decryption function calls on a 16 byte block of
data. Since AES is a block cipher, all data must be encrypted in 16 byte blocks. If you have more than 16 bytes to
transfer, you must break the data into 16 byte blocks, encrypt them (you can use the same key for all blocks), send
them, then decrypt them in 16 byte blocks on the other end.

11.2 Board Lock


This set of examples implements a scheme to lock an application to a specific device (board). The application will
only run on a device with a specific MAC address. The implementation uses a secret message that is run through
a MD5 hash function. The secret message is padded to a multiple of 64 bytes, and the MD5 context is saved.
The board is then signed by combining the partial MD5 context with the board's MAC address to generate a 16 byte
digest specific to both the board and secret message. The 16 byte digest is then stored in flash memory. In this
example it is stored in the User Parameters area, but you can choose a different location if you wish.
To verify the application is authorized to run on the device, you recompute the digest and compare it to the stored
value.
Procedure to Create a Secret Message:

• Go to the keyblob project.

• Edit the text: const char ∗ YourSecretSigningText = "This should be your


company secret message";

• Compile and run the application on your NetBurner device.

• Capture the last message, your keyblob should be :

const MD5_CTX YourCompanySecret = {{2106921824u,3945495657u,2391356351u,2780313164u},{512u,0u},


{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

-Be sure to save the message someplace safe. This is your company's secret message.

• Copy this message/text to the signboard project.

• Compile and run the signboard project on the target board to be permitted/locked. This application computes
and stores a signature in UserParam space.

• Now copy the company secret into the checkboard project main.cpp.

• Compile and run the application. It will check to see if the application is authorized to run on the device.

Things to modify or enhance:

• The sign function and check function do not need to be in separate programs. They could be in the same
program with the sign function hidden by some secret command.

• In most real or significant apps your code will want to use the UserParam space for storing additional infor-
mation,. so you need to modify the sign and check functions to store and retrieve the 16 byte digest from your
storage structures.

NetBurner, Inc.
174 Example Applications

• Key Blob

• Sign Board

• Check Lock

11.2.1 Key Blob


Create a MD5 context to save a a key to lock an application to a device.

11.2.2 Sign Board


Sign an application to lock it to a specific device (board) using a key and the MAC address of the device.

11.2.3 Check Lock


Check to verify a locked device is authorized to run the application.

11.3 Clear Configuration Flash


Simple program used to clear the NetBurner 3.0 configuration flash area. Once the flash area is erased, resetting
the NetBurner device will re-initialize the configuration parameters. Note: on 5441x based devices this program will
not clear the configuration parameters used by the Alternate Boot Monitor.

11.4 Clear User Parameter Flash


Small program to clear the User Parameter area in flash memory. In practice, your application should have the
ability to reset any non-volatile settings, rather than a full erase. This utility is useful if switching between exam-
ples/applications that use User Parameter storage in different ways, without having to create code to do a default
reset.

11.5 Configuration
Examples to demonstrate how to:

• Customize the configuration server

• Set configuration parameters via web page and through the application code

Examples:

• Application Data

• Config and System Params

• Config Web Interfaces

11.5.1 Application Data


The examples in this directory show how to use the configuration system to create, modify, and store persistent data
values that can be used in user applications.

• BasicConfigVariables - Shows how to create, modify and store basic config variable types with the config
system

• ConfigClass - Expands on BasicConfigVariables, and shows how to create new class types that inherit from
base config objects, and how they can be combined together to create complex objects

• NestingConfigObjects - Expands on ConfigClass, and shows how config objects can be grouped together to
create a nested hierarchy of data

NetBurner, Inc.
11.5 Configuration 175

Examples:

• Basic Config Variables

• Config Class

• Nesting Config Objects

11.5.2 Basic Config Variables


The config system stores system-defined boot and interface information, such as default BaudRate and current IP
settings, and also provides a system for the user to define and store their own persistent variables.
In this example, we've created some very basic config objects to represent the basic data types that are created
when the device first boots, and whose values persist after the device has been power cycled. The currently
available config objects that can be used are as follows:

• config_obj // base object, used as a container for other objects

• config_bool // bool

• config_int // int

• config_double // double

• config_string // string

• config_chooser // multiple choice option

• config_pass // password

• config_IPADDR4 // IP4 Address

• config_IPADDR6 // IP6 Address

• config_MACADR // MAC Address

11.5.3 Config Class


This program shows the basics of using NetBurner's config system. The config system stores system-defined boot
and interface information, such as default BaudRate and current IP settings, and also provides a system for the user
to define and store their own persistent variables.
In this example, which expands on the BasicConfigVariable example, we create some custom classes that inherit
from an empty config object type. We then use these classes to group additional config data together. The objects
of these types are created when the device first boots, and their values persist after the device has been power
cycled. The currently available config objects that can be used are as follows:

• config_obj // base object, used as a container for other objects

• config_bool // bool

• config_int // int

• config_double // double

• config_string // string

• config_chooser // multiple choice option

• config_pass // password

• config_IPADDR4 // IP4 Address

• config_IPADDR6 // IP6 Address

• config_MACADR // MAC Address

NetBurner, Inc.
176 Example Applications

11.5.4 Nesting Config Objects


This program shows the basics of using NetBurner's config system, specifically, how config objects can be nested
inside each other. The config system stores boot and interface information, such as default BaudRate and current
IP settings, and also provides a system for the user to define and store their own persistent variables.
In this example, we have expanded on the ConfigClass example, and created an additional config class that is used
to nest several instances of our previously defined class. This nesting allows for control over the structure and
hierarchy of the data when it is saved in the flash as a JSON blob. The currently available config objects that can be
used are as follows:

• config_obj // base object, used as a container for other objects

• config_bool // bool

• config_int // int

• config_double // double

• config_string // string

• config_chooser // multiple choice option

• config_pass // password

• config_IPADDR4 // IP4 Address

• config_IPADDR6 // IP6 Address

• config_MACADR // MAC Address

11.5.5 Config and System Params


The examples in this directory show how to access and modify system values through the configuration system.

• ShowConfig - Shows how to view the entire JSON config blob

• ModifyBoot - Shows how to view and modify the Boot system values through the global config variable
monitor_config
• ModifyEthernet - Shows how to view and modify the interface system values (default is typically Ethernet0)
through the config system

Examples

• Modify Boot

• Modify Ethernet Interface

• Show Configuration

11.5.6 Modify Boot


The config system stores system-defined boot and interface information, such as default BaudRate and current IP
settings, and also provides a system for the user to define and store their own persistent variables.
This program shows how to view and modify the values of the "Boot" config record.

11.5.7 Modify Ethernet Interface


The config system stores boot and interface information, such as default BaudRate and current IP settings, and also
provides a system for the user to define and store their own persistent variables.
This program shows how to view and modify the values of the Ethernet interface in the config record.

NetBurner, Inc.
11.5 Configuration 177

11.5.8 Show Configuration


The configuration system stores settings controlling how the device boots, as well as network and serial interface
settings, in a JSON format. This example demonstrates how to:

• Read the system configuration and display on the serial port

• Display the amount of memory used by the configuration settings and total available space

11.5.9 Config Web Interfaces


The system configuration web page interface is located on network port number 20034. These example demon-
strate how to provide the same configuration interface as part of the application web server (default port numbers
are 80 or 443 for SSL/TLS), so that the configuration web pages are consistent with the rest of the application web
interface.
Examples:

• Basic Web Config

• Basic Web Config with SSL/TLS

• Config Tags

• Custom Web Config

• Custom Web System Config

11.5.10 Basic Web Config


The system configuration web page interface is located on network port number 20034. This example demonstrates
how to provide the same configuration interface as part of the application web server on port 80 (or 443 for SSL/←-
TLS), so that the configuration web pages are consistent with the rest of the application web interface.
The web page is dynamically generated, and provides access to view and/or modify boot and interface settings,
such as default serial port baud rates and IP addresses, as well as application specific data.
The code used to generate and process the web form is in html/index.html. This example does not use any
external JavaScript libraries, and all of the form generation code is located at the bottom of index.html. For a more
advanced example that utilized Bootstrap and jQuery, please see the CustomWebConfig example.
Currently available config objects that can be used are as follows:

• config_obj // base object, used as a container for other objects

• config_bool // boolean

• config_int // integer

• config_double // double float

• config_string // string

• config_chooser // multiple choice option

• config_pass // password

• config_IPADDR4 // IP4 Address

• config_IPADDR6 // IP6 Address

• config_MACADR // MAC Address

Note that because we are only processing the config object, we are able to avoid writing a custom POST handler
that is used in the other examples. If you include more to your web interface than is provided here, that will need to
be incorporated as well.

NetBurner, Inc.
178 Example Applications

11.5.11 Basic Web Config with SSL/TLS


This example is identical to the BasicWebConfig example with the addition of SSL/TLS. Please refer to that docu-
mentation for a description of how the configuration server operates.
Certificates can be handled a number of ways: auto-generated, self-signed, compiled into the application, or up-
loaded to a file system. To simplify things, this example provides files for a compiled certificate and key, named
ServerCert.cpp and ServerKey.cpp.
To generate your own self-signed certificates, use the script files in the \nburn\CreateCerts folder:

• makeca.bat to generate a Certificate Authority certificate and key

• makeserver.bat to generate the HTTPS server certificate and key

For the common name (CN), use the IP address of your device, then copy the generated .cpp files to your project's
src folder.
Please refer to the \nburn\examples\ssl folder for more advanced SSL/TLS certificate handling.

11.5.12 Config Tags


This program demonstrates the use of the following dynamic web content tags that can be used to display and
modify configuration variables:

• CONFIGVALUE

• CONFIGINPUT

• CONFIGTABLE

The example shows how to just get the raw data from the board, as well as how it can be styled using Bootstrap
and CSS. While VARIABLE and CPPCALL HTML tags can be used to present the same information, the CONFIG
tags simplify things by combining the data with HTML code to create input fields, tables and value displays.

11.5.13 Custom Web Config


This example is an advanced version BasicWebConfig example that implements the content with JavaScript and
jQuery. It also demonstrates how to store and display custom application data in the AppData section.
Configuration objects are created when the device first boots, then they are stored so they are persist after the
device has been power cycled. The web interface adds custom styling beyond the basic server presentation to view
and set the values. The currently available configuration objects are:

• config_obj // base object, used as a container for other objects

• config_bool // bool

• config_int // int

• config_double // double

• config_string // string

• config_chooser // multiple choice option

• config_pass // password

• config_IPADDR4 // IP4 Address

• config_IPADDR6 // IP6 Address

• config_MACADR // MAC Address

Note that because we are only processing the config object, we are able to avoid writing a custom POST handler
that is used in the other examples .If you include more to your web interface than is provided here, that will need to
be incorporated as well.

NetBurner, Inc.
11.6 DNS Device Name 179

11.5.14 Custom Web System Config


The majority of examples for creating a custom configuration interface create a configuration page in the application
code so that it will be part of the application's web interface. This enables the configuration interface to be consistent
with the rest of the web pages. In contrast, this example will demonstrate how to change the device's system
configuration server that appears on network port number 20034. The change can be as simple as branding with
your logo, or modification to the web page content.
You can combine both the custom application and custom system configuration to brand your product
The logo and html files are converted to .cpp files and compiled into the application. The files involved are located
in \nburn\nbrtos\source:

• LOGO.gif, the logo displayed on the configuraiton page.

• ROOT.html, the javascript root configuration page.

• RAW.html, Low level HTML only page with links to configuration and the UI.html page that displays the
entire JSON object.

• UI.html, displays the entire JSON object.

To customize, follow the overload procedure in which you copy and modify the desired files into your project's
overload directory. For example, to change just the logo, create a folder in the overload directory where the
file is located: \nbrots\source, and copy your LOGO.gif file there. The majority of customizations will
only need to change the logo, but the html overrides are there to suppor any type of customizaton an appli-
cation requres. A sample LOGO.gif file is provided for you in this application's src folder. Copy this gif to the
override\nbrtos\source folder to see the modification.
Running the Example: The example is based on SimpleHtml and provides a basic web page on port 80. Viewing the
system configuration page on port 20034 will show the custom modifications. A LOGO.gif file is already provided
to demonstrate the use of a custom logo, so you can build and run the example as-is before adding your own
customizations.

11.6 DNS Device Name


The device name is stored in the device's flash configuration. There are two ways to give your device a name:

1. Use the configuration web interface, which is your device's <device ip address>:20034.

2. You can change the configuration flash setting in your application. You will then need to reboot the device for
the name to take effect.

This example demonstrates how to change the device name in an application.


Additional information on DNS naming
When a network device (such as the NetBurner module) requests an IP address from a DHCP Server, the device
sends it MAC address and an optional device name (this is supported by your NetBurner device). The DHCP Server
supplies the dynamic IP address and maintains a table containing the MAC address, IP address and device name
for each device that has accepted a DHCP lease.
The purpose of a DNS server is to convert a name into an IP address. To do this it must get the information from your
DHCP Server. On windows server platforms that run both a DHCP server and DNS server, this can be configured
in a dialog box. On Linux/Unix it may be more complicated. Basically, every time the DHCP server gives out a new
dynamic IP address it updates the DNS server. If you are not using DHCP, and are assigning static IP addresses,
then you must update the DNS server with the entries manually (i.e. name and IP address).
If you do not have a DNS server, you can modify the lmhosts file on your PC to add the IP address and name of
each network device you want to address by name. You would need to do this on every PC that wants to use the
name.
Windows has a proprietary protocol called WINS (only Microsoft products can use it). Windows machines can have
a name, and the protocol enables windows machines to talk to one another. This is achieved by having one windows
PC maintain the table of MAC address, IP address and names.

11.7 DHCP
DHCP Examples:

NetBurner, Inc.
180 Example Applications

• DHCP Client - Change IP Address

• DHCP Client - Test DHCP

• DHCP Server (DHCPD)

• DHCP Client - Change IP Address Via Webpage

11.7.1 DHCP Client - Change IP Address


Demonstrate how to view IP address and change between DHCP and static IPv4 IP settings.
To change from DHCP to Static:

• Read the Static settings from the configuration record

• Set address mode to "Static"

• save to the configuration flash

• Option to reboot or change runtime settings

To change from Static to DHCP:

• You can leeave the static settings intact if you wish, it will not affect DHCP

• Set address mode to "DHCP" or "DHCP w Fallback"

• Save to the configuration flash

• Option to reboot or change runtime settings

11.7.2 DHCP Client - Test DHCP


11.7.2.1 Example of advanced DHCP functionality

Most applications can simply use the GetDhcpAddress() function call to automatically handle obtaining a DHCP
address and configuration. If you need finer control, you can create a DHCP Object and manage the DHCP functions
from within your application. This example shows how you can create a DHCP object and use a pointer to the object
to monitor and control DHCP services.
It also will show you the internal workings of DHCP by displaying UDP packet information and DHCP variables on
stdio, which is UART0 by default (view with MTTTY). It is not the intent of the example to be a tutorial on DHCP. For
detailed DHCP information please refer to RFC 2131.
For the purposes of education/demonstration, this application will access the C++ private class variables of a DHCP
object. This is NOT required for end applications, it is just used here for education.
To obtain access to private class variables in the DHCP object, you will need to enable debugging in the
\nburn\system\dhcpc.cpp file by removing the comments from the following line:
#define DHCP_DEBUG 1
Warning

COMMENT OUT THE #define DHCP_DEBUG 1 when you are done with this example, it should not be
enabled in normal applications.

This example will:

• Create a DHCP object global variable

• Start DHCP and monitor a semaphore for completion

• Provide an interactive menu to start and stop dhcp services, modify the system timer, and display dhcp status.

11.7.3 DHCP Server (DHCPD)


Demonstrates how to create a DHCP Server on your NetBurner device

NetBurner, Inc.
11.8 DNS Client 181

11.7.4 DHCP Client - Change IP Address Via Webpage


Demonstrate how to view IP address and change between DHCP and static IPv4 IP settings using a webpage
interface. After submitting IP setting changes through the webpage form, the webserver will redirect the webpage
to the new address of the device if necessary. The webpage also handles multiple interfaces, in case the module
supports multiple interfaces (such as dual-ethernet and/or WiFi).
To change from DHCP to Static:

• Read the Static settings from the configuration record

• Set address mode to "Static"

• save to the configuration flash

• Option to reboot or change runtime settings

To change from Static to DHCP:

• You can leave the static settings intact if you wish, it will not affect DHCP

• Set address mode to "DHCP" or "DHCP w Fallback"

• Save to the configuration flash

• Option to reboot or change runtime settings

11.8 DNS Client


DNS Client Example
DNS example using GetHostByName(), GetHostByName4() and GetHostByName6() to resolve a name to an IP
address for both IPv4 and IPv6.
To run this program:

• Start MTTTY and connect to the debug serial port

• You will be prompted to enter a name, such as www.netburner.com

• The DNS IP address resolution will be displayed

For this example to function, your NetBurner device must have access to the Internet, with a working configuration
for the IP address, mask and gateway.

11.9 Embedded Flash File System (EFFS)


Embedded Flash File System (EFFS) examples. There are two types of file systems:

• EFFS FAT: A FAT 32 file system used for flash memory cards

• EFFS STD: A power fail-safe file system that resides in the flash memory of the module itself

Example Catagories:

• FAT File System (EFFS-FAT)

• Standard File System (EFFS-STD)

11.9.1 FAT File System (EFFS-FAT)


EFFS FAT32 Examples:

• Appplication Update

• Basic

• FTP FTP

NetBurner, Inc.
182 Example Applications

• HTTP

• HTML Variables

• Multiple Tasks

• Performance Tests

• RAM Drive

11.9.2 Appplication Update


This application demonstrates how to update a NetBurner application in onboard flash memory from an external
SD flash card. The application will look for a file on the flash card with the name specified by APPFILENAME. Use
MTTTY to monitor the serial output of your NetBurner device. If this file is found, an application update can be
performed by typing a character in response to the MTTTY prompt.

Note

All EFFS FAT examples require that you add the Embedded Flash File System File Allocation Table (EFFS
FAT) library to your project: Add a Library to a Project

11.9.3 Basic
This program illustrates basic file system operations for SD/MMC and Compact Flash cards:

• Mounting a drive

• Determining amount of used and free file space

• Creating files

• Writing data

• Reading data

• Unmounting a drive

When the program executes it will display program status information through the debug serial port. This application
has web server support for onboard flash/ram only, web pages cannot be run from external flash cards. This
capability is demonstrated in the EFFS-HTTP example to illustrate the difference between the two operations.

Note

All EFFS FAT examples require that you add the Embedded Flash File System File Allocation Table (EFFS
FAT) library to your project: Add a Library to a Project

11.9.4 FTP
This program illustrates file system and FTP operations for SD Flash cards:

• Mounting a flash drive

• Determining amount of used and free file space

• FTP access. We recommend Filezilla or WinScp

Status messages will be sent out the debug serial port.


Modules with an onboard microSD flash socket should use the multi MMC header files and functions because the
modules are capable of supporting both onboard and external flash cards (even if you application only uses one).

Note

All EFFS FAT examples require that you add the Embedded Flash File System File Allocation Table (EFFS
FAT) library to your project: Add a Library to a Project

NetBurner, Inc.
11.9 Embedded Flash File System (EFFS) 183

11.9.5 HTTP
This example program sets up HTTP access to the FAT file system on either MultiMedia Cards (MMC) or Compact←-
Flash Cards (CFC).
To run this example:

1. Compile the example for your chosen flash card in cardtype.h. The NetBurner development board supports
SD Flash cards.

2. Copy index.html and and MIME.txt from the example's root directory to your flashcard, or put your own there.

3. When the program runs, status messages will be displayed on the module debug serial port.

4. You can view the files on the flash card with any web browser by typing the IP address of the module at the
"/DIR" folder For example: "http://10.1.1.57/DIR").

5. When accessing the module via browser, what web pages will be displayed depends on the following order
and their availability on the flash card:

• index.html files

• The first available .html file

• A web page list of all directories and files that exist on the flash card

Note

If ∗.html files exist on the flash card, then the program will always access the first available web page file by
default. If you wish to access the web page list of all existing directories and files on the flash card, then enter
the URL of the module, followed by "/dir", for example: "http://10.1.1.57/dir".
All EFFS FAT examples require that you add the Embedded Flash File System File Allocation Table (EFFS
FAT) library to your project: Add a Library to a Project

11.9.6 HTML Variables


This example program sets up HTTP access to the FAT file system on SD Flash cards.
To run this example:

1. Compile the example for your chosen flash card in cardtype.h. The NetBurner development board supports
SD Flash cards.

2. Copy index.html and and MIME.txt from the example's root directory onto your flashcard, or put your own
there.

3. When the program runs, status messages will be displayed on the module debug serial port.

4. You can view the files on the flash card with any web browser by typing in the IP address of the module at the
"/DIR" folder Example: "http://10.1.1.57/DIR").

5. When accessing the module via browser, what web pages will be displayed depends on the following order
and their availability on the flash card:

• index.html files

• The first available .html file

• A web page list of all directories and files that exist on the flash card

Note

If .html files exist on the flash card, then the program will always access the first available web page file by
default. If you want to access the web page list of all existing directories and files on the flash card, then you
type in the URL of the module, followed by "/dir" (Example: "http://10.1.1.57/dir").

NetBurner, Inc.
184 Example Applications

11.9.7 Multiple Tasks


This program illustrates basic file system operations for SD Flash cards for multiple tasks:

• Mounting a drive

• Determining amount of used and free file space

• Creating files

• Writing data

• Reading data

• Unmounting a drive
When the program executes it will display program status information through the debug serial port.

Note

All EFFS FAT examples require that you add the Embedded Flash File System File Allocation Table (EFFS
FAT) library to your project: Add a Library to a Project

11.9.8 Performance Tests


This example is used to test the speed of the EFFS FAT file system for operations such as file creation and data
storage speed. All testing was done on a MOD54415.
Hardware:

• MOD54415-100IR on MOD-DEV-70 development board

• Kingston microSDHC 32GB Class 4, with MidroSC Adapter

Software: NetBurner tools revision 2.8.6 Date: February 7, 2018


Test results for file creation:

• 1 file: 15ms

• 100 files:32ms

• 1,000 files:93ms

Test results for data transfer, using 1MB of data:

• Write speed: 0.61 MBytes per second

• Read speed: 2.18 MBytes per second

11.9.9 RAM Drive


This program illustrates basic file system operations for RAM drives:

• Mounting a drive

• Determining amount of used and free file space

• Creating files

• Writing data

• Reading data

• Un-mounting a drive

When the program executes it will display program status information through the debug serial port.
This example is primarily different from the EFFS-BASIC example in that it by default uses the RAM drive for the file
system and is used to show what is necessary to use the RAM drive. Namely, the project must include the content
contained within the 'ramdrvMcf.cpp' source file.To build any of the EFFS- examples to use the RAM drive, simply
add the 'ramdrvMcf.cpp' file to the build list and modify 'cardType.h' to define USE_RAM instead of USE_MMC or
USE_CFC and set the EXT_FLASH_DRV_NUM to the correct RAM drive number.

NetBurner, Inc.
11.10 Ethernet 185

Note

All EFFS FAT examples require that you add the Embedded Flash File System File Allocation Table (EFFS
FAT) library to your project: Add a Library to a Project

11.9.10 Standard File System (EFFS-STD)


Examples for on-chip flash file system:

• HTTP

11.9.11 HTTP
This example program sets up HTTP access to the EFFS-STD on-chip flash file system. To run this example:

• When the program runs, status messages will be displayed on the module debug serial port.

• You can view the files on the flash card with any web browser by typing in the IP address of the module,
followed by "/DIR" (not case-sensitive). Example: http://10.1.1.57/DIR
• When accessing the module via browser, what web pages will be displayed depends on the following order
and their availability on the flash card:

– The index.html file


– The first available ∗.html file
– A web page list of all directories and files that exist on the flash card

• If ∗.html files exist on the flash chip, then the program will always access the first available web page file
by default. If you want to access the web page list of all existing directories and files, type in the URL of the
module, followed by /DIR.

Note

All EFFS STD examples require that you add the Embedded Flash File System (EFFS STD) library to your
project: Add a Library to a Project

11.10 Ethernet
Ethernet examples:

• Manual Configuration

11.10.1 Manual Configuration


Demonstrates how to set Ethernet speed and duplex manually instead of the default of autonegotiate.

11.11 Exception Try/Catch


This example program illustrates how to use C++ exceptions. It will throw an exception and verify it can be caught.
The output is displayed to stdout, which can be viewed with MTTTY on the debug serial port.
COMPILATION INSTRUCTIONS To keep the application size small for users who do not need C++ exceptions, this
feature is disabled by default. To enable exceptions you need to add the "-fexceptions" and flag to the C++ build
options. In addition, "-frtti" also needs to be added. If these options are not enabled, the compiler output console
window will notify you.
In this example, exceptions have already been enabled. To enable in your own application:

• Right-click on your project and select Properties

• Select "GNU C++ Compiler"

• Select "Miscellaneous"

• In the Other Flags field, add "-fexceptions -frtti"

NetBurner, Inc.
186 Example Applications

11.12 Extra FD Circular Buffer


The NetBurner system software has support for implementing your own custom I/O device using a File Descriptor.
It is Extra File Descriptors are defines in the 'iointernal.h' header file.
This is a simple example that creates a circular buffer and treats it as an I/O device by using a file descriptor. The
I/O device is a 256 byte circular buffer that you can than write() to and read() from. The 256 byte buffer size makes
the circular buffer wrap around simple for a byte array.
The 6 fd status functions are interrupt safe:
void SetDataAvail( int fd ); void ClrDataAvail( int fd ); void SetWriteAvail( int fd ); void ClrWriteAvail( int fd ); void
SetHaveError( int fd ); void ClrHaveError( int fd );
Side note: If you have an I/O device and wish to use interrupts, after adding the appropriate interrupt code that
is specific to your device, you would use USER_ENTER_CRITICAL and USER_EXIT_CRITICAL to protect the
internal data structures.

11.13 fdprintf - printf to file descriptor


Application that demonstrates the ability to close, open, and print to file descriptors

11.14 FTP
FTP can be run with or without a file system. The examples in this section do not use a file system. These are
useful for applications such as:

• Simple download of data as a file by a FTP client, such as measurement readings.

• Updating an application image.

• Viewing web or interface data in a file format.

Since there is no file system, these examples use callback functions to handle the various FTP transactions, such
as reading, writing and listing a file. If you do not wish to use the callback scheme, please refer to the file system
examples described below.
Examples of FTP using a file system take advantage of the Embedded Flash File System (EFFS). There examples
are located in the "\nburn\examples\EFFS" folder. There are two types of file systems:

• EFFS FAT (File Allocation Table), which is a FAT32 file system used by external flash cards.

• EFFS STD (Standard File System), which is a custom file system that runs in the onboard flash memory of
the NetBurner device.

FTP in this section:

• FTP Client

• FTP Server (FTPD) App Update

• Display HTML Files (FTPD)

• Simple FTP Server (FTPD)

11.14.1 FTP Client


This program will run a FTP Client program on the NetBurner board to do the following:

• Connect to a FTP Server

• Change to a remote directory called "test1"

• Obtain a directory listing and print the listing to stdout

• Create a file on the FTP Server called WriteTest.txt

• Read back contents of WriteTest.txt and send to stdout

NetBurner, Inc.
11.14 FTP 187

Setup Requirements:

1. Access to a FTP Server

2. User name and password for the FTP Server

3. A directory called "test1" must exist on the FTP Server

4. Write permissions to the test1 directory

5. You must modify the #define values in this file to match your FTP server.

11.14.2 FTP Server (FTPD) App Update


This program is an example of how you can use the FTP server to allow application firmware updates via FTP. To
run the example:

1. Compile this example program

2. Download the image file to the NetBurner board

3. Run a FTP client program from a host computer on the network. In this example, we use the Windows FTP
program called "ftp.exe" which is run from a command prompt. Type ftp <ip address> where <ip
address> is the IP address of the NetBurner board. For example, ftp 10.1.1.21
4. You will be prompted for a user name and password. You can enter anything here.

5. In the FTP client program, type "ls" and hit the return key to see a list of files. Below is an example of a FTP
session showing commands and responses so far:

ftp 10.1.1.21
Connected to 10.1.1.21.
220 Welcome to the NetBurner FTP server.
User (10.1.1.21:(none)): asdf
331 User name okay, need password.
Password:
230 User logged in, proceed.
ftp> ls
200 Port Command okay.
125 Data connection already open; transfer starting.
UserFlash.s19
UserFlash.bin
Application_APP.s19
226 Closing data connection. Listing complete.
ftp: 51 bytes received in 0.00Seconds 51000.00Kbytes/sec.

1. The file name we are interested in is "Application_APP.s19". Uploading an image file with this file name will
program that application into flash memory.

2. Choose any valid image file to upload, and rename it to Appliation_APP.s19.

3. Now that you have the file Application_APP.s19 in the same directory you are running ftp.exe from, at the
ftp> prompt type "put Application_APP.s19". After this command executes, the tic-tac-toe application will be
programmed in flash. However, the board is still running the ftp application in SDRAM, so you won't see a
change until the board reboots.

4. All that's left is to reboot the board so the tic-tac-toe application starts up. The example is written so that
closing the Windows client ftp session will reboot the board. At the Windows ftp> prompt, type "quit" and
press the enter key. An example session is shown below:

ftp> put Application_APP.s19


200 Port Command okay.
125 Data connection already open; transfer starting.
226 Closing data connection. File transfer complete.
ftp: 184620 bytes sent in 1.16Seconds 159.16Kbytes/sec.
ftp> quit
221 Service closing control connection.

1. Use a web browser and go to the board's IP address. You should see the tic-tac-toe application running.

NetBurner, Inc.
188 Example Applications

11.14.3 Display HTML Files (FTPD)


Example to display the files in a project's HTML directory as a read-only file system.

• Serial port output displays status information

• Device web page provides example information and a link to display files, using the CPPCALL HTML tag

• Files can also be accessed with FTP clients such as Filezilla

This is an advanced application and requires knowledge of FTP and FTP applications. A significant part of the
complexity involved concerns navigating and displaying file names and directories.
Starting in 2020 some browsers have begun to block FTP access. In such a case FTP client programs can be used
instead.

11.14.4 Simple FTP Server (FTPD)


Simple example of a FTP server implementation without a file system. It can be very useful for a lightweight method
to download system information and data, and upload configuration information. Interaction with the FTP server in
an application is accomplished using callback functions to handle events, such as listing the files, sending a file, and
receiving a file. Please refer to the additional FTP examples for use with a file system.

• Status messages and data are sent out the debug serial port and can be viewed with a terminal such as mttty.

• Enables the FTP client to download a file named ReadFile.txt. While this is fixed content, it can contain
whatever dynamic content you wish.

• Enables the FTP Client to upload an ASCII text file named WriteFile.txt. The file is not stored in memory, but
is sent out the debug serial port.

11.15 GDB Debugger


This is a very simple application to run with the debugger on a NetBurner network-enabled hardware platform. The
application will boot and stay in a while() loop that displays how long the program has been running to the default
serial port.

11.16 General Purpose I/O


These general GPIO examples apply to multiple NetBurner platforms. Please refer to the "Example Applications
> Platform Specific" section of this document for addional GPIO examples specific to your particular NetBurner
platform.
Examples in this section:

• GPIO Blink

• General Purpose I/O Service

11.16.1 GPIO Blink


This example demonstrates the basic operation of GPIO pins using the PinIO class. It blinks one of the indicator
LED on the device carrier board.
This example is purposely simple and does not demonstrate all the PinIO capabilities. For further information on
what the PinIO class can be used for or how to use it, see the GpioServer example or refer to the PinIO documenta-
tion. Additionally, most platforms have additional GPIO examples in the Platform Specific example directory which
focus on GPIO specifics.
Please refer to the "Example Applications > Platform Specific" section of the NetBurner Documentation for addi-
tional GPIO examples specific to your particular NetBurner platform.

NetBurner, Inc.
11.17 IP Address Object (IPADDR) 189

11.16.2 General Purpose I/O Service


Example to control GPIO pins though command interface.
This is a general purpose GPIO example and a large portion of the code is dedicated to a parser and command
structure. Most platforms have additional GPIO examples in the Platform Specific example directory which focus on
GPIO specifics.
This example sets up a command parser on the default serial port to configure and control GPIO signals on the
NetBurner module. For devices with multiple connectors the example uses the peripheral connector, such as P2 or
J2, or the main connector for devices with a single connector. Depending on your specific device, not all signals can
be GPIO. Please consult the device data sheet for additional information.
To run the example build and load the project into your device. Then run the MTTTY serial terminal and connect to
your device's debug/status port.
The menu options are:

• HI Set a pin high

• LO Set a pin low

• TGL Toggle a pin

• OUT Configure a pin to be an output

• IN Configure a pin to be an input

• RD Tristate and read a pin

For example, to set pin 5 high use the command: "HI 5".
Please refer to the "Example Applications > Platform Specific" section of the NetBurner Documentation for addi-
tional GPIO examples specific to your particular NetBurner platform.

11.17 IP Address Object (IPADDR)


IPADDR IP Address Object Example
An IPADDR object is a C++ object that can contain either an IPv4 or IPv6 IP address. An object is used to enable
application support both IPv4 and IPv6 without having to change source code. Once you assign an address to the
object, it's member functions will automatically call the appropriate member function for the task to be performed.
For example, if you have an IPADDR object named myIPaddr and assign it a value of 192.168.1.10, then calling
myIPaddr.print() will print the address in IPv4 notation. If you assign it an IPv6 address, calling my←-
IPaddr.print() will print the address in IPv6 notation.
The NetBurner system has added a printf formatting option of "%I", enabling you to easily display IP addresses
with formatting. For example, iprintf("My IP address is %I\r\n", myIPaddr); This formatting
option works for all printf variants, such as printf, iprintf, sprintf, etc.
In rare cases in which you want to create an object of a specific type, you can create objects as IPADDR4 or
IPADDR6. However, we highly recommend using IPADDR for all your IP addresses. Note that if you are using a
printf style format specifier, you must use "%HI" instead of "%I" and pass in a IPADDR4 object, otherwise the
value displayed will be 0.0.0.0.

11.18 IPv6
IPv6 Examples:

• DHCPv6

11.18.1 DHCPv6
This example demonstrates the various callback functions of the DHCPv6 Client for requesting, adding, and pro-
cessing DHCPv6 options.
The DHCP offer name is set by the DEVICE_NAME parameter in the configuration settings for each network inter-
face.

NetBurner, Inc.
190 Example Applications

11.19 JSON Lexer


The examples here show how to user the JSON Lexer class, ParsedJsonDataSet, to build and interact with JSON
data sets. JSON Lexer Examples:

• JSON Array

• JSON Array with Objects

• Parse Test

11.19.1 JSON Array


This program shows how to use the JSON Lexer class, ParsedJsonDataSet, to create and access array information.

11.19.2 JSON Array with Objects


This program shows how to use the JSON Lexer class, ParsedJsonDataSet, to create and access arrays containing
sub-objects.

11.19.3 Parse Test


This program shows how to use the JSON Lexer class ParsedJsonDataSet, to create and access json information.

11.20 JSON
These series of examples provide code for a JSON server running on a NetBurner device, "demo.netburner.com",
and JSON client examples for GET, POST, loading applications and HTML. If you type "demo.netburner.com" in you
web browser and can see a JSON server, you can run the client examples againt it.
JSON Examples:

• NetBurner Demo Server for JSON Client Examples

• Get JSON Object From Server

• Get Non-JSON Object From Server

• Get JSON Object From Server

• Post JSON to Server and Display Result

• Post JSON to Server

• Get Application Image and Load it From a Web Server

• Simple JSON HTML Example

• Simple JSON Post Receiver Example

11.20.1 NetBurner Demo Server for JSON Client Examples


This is the source code for the application running on the demo.netburner.com web site. The JSON Client examples
in this section interface to this server to demonstrate each of the features. The source code for this server is here
for refereance and completeness rather than something you need to implement on your own. All of the techniquies
used here and more clearly ilistrated with the other JSON examples.
Warning

This project requires a certificate and private key to build

11.20.2 Get JSON Object From Server


Simple program that demonstrates retrieving a JSON object from a site and using it to present the user with dynamic
output

NetBurner, Inc.
11.21 malloc 191

11.20.3 Get Non-JSON Object From Server


Simple program that demonstrates retrieving non-JSON object from a site and using it to present the user with
dynamic output

11.20.4 Post JSON to Server and Display Result


Simple program that demonstrates POSTing a JSON object to a server and then displaying the returned JSON
result.

11.20.5 Post JSON to Server


Simple program that demonstrates POSTing a JSON object to a server and then displaying the returned result as
text.

11.20.6 Get Application Image and Load it From a Web Server


Simple program that demonstrates retrieving a new code image from the web.

11.20.7 Simple JSON HTML Example


Shows several methods to have a NetBurner respond to web requests with JSON objects. Shows how to:

• Respond and generate the text directly

• Respond and generate the response with a JSON lever object.

• Respond and generate the response using configuration variables.

• Respond and generate the response using a pre-built page stored in with web pages and using the dynamic
web page capabilities.

11.20.8 Simple JSON Post Receiver Example


Simple JSON Post Receiver Example shows how to recieve a JSON object as a post from an external Restful API
or from Javascript within a web page.

11.21 malloc
This example demonstrates the usage of malloc and free. It identifies way's to track your heap space used by calling
spaceleft() and mallinfo(), which can help prevent an applications from running out of dynamic memory.
It is important to use both spaceleft() and mallinfo() to calculate the size of your heap. As this application demon-
strates, spaceleft() alone will not always give the total space available to malloc.
In this example, the application will allocate 3 chunks of space. The first is 1MB, then a 3MB, then a 512KB chunk.
It will then free the data in a different order.
After every malloc and free, a heapinfo print will occur. This shows the current heap space used, heap space free,
and space reported by spaceleft().

11.22 Multicast
This example program enables you to add a NetBurner device to a multicast group by specifying the multicast ip
address and port number in MTTTY when prompted. You can then send data by typing it in MTTTY, or view received
data.
This example only supports IPv4

NetBurner, Inc.
192 Example Applications

11.23 Multihome
Multihome application example (IPv4 only)
This program will demonstrate how to implement both a DHCP address and static IP address using the Multihome
functionality of the NetBurner TCP/IP Stack. The NetBurner device will try to obtain a dynamic IP address from a
DHCP Server for the first Network Interface, and set a static IP address for the second Network Interface. The end
result is that the NetBurner device will respond to either IP address. The example will print debug information out
the debug serial port, and display the IP address information on a web page that can be accessed from either IP
address.
To enable multihome capability, you must uncomment the MULTIHOME definition in the include file
\nburn\nbrtos\include\predef.h and rebuild the system files.

11.24 NB Approve Shutdown


The NBApproveShutdown callback function can be used by an application to put the system in a safe state before
an application update, configuration update, or reboot event occurs. For example, closing active TCP sockets,
ensuring Flash and/or file system write operations are complete, and putting critical peripherals in a safe state. The
NBApproveShutdown() function as a weak reference to a system function that always returns true by default. If an
application creates it's own function using the same signature, that function will be used instead.
A reason for the reboot request is passed to the function. The system will automatically call NBapproveShutdown()
for the following reasons:
#define SHUTDOWN_CODEUPDATE (1) // A code update is requested
#define SHUTDOWN_CONFIGURE_REBOOT (2) // Configuration values have been modified with a requested reboot
An application can choose to ignore the parameters or add it's own. For custom reasons, the application should call
NBApproveShutdown() with the appropriate reason:
// Custom reboot reason. System reasons start at 1, so pick something much larger
#define SHUTDOWN_CUSTOM_REBOOT 100
if( NBApproveShutdown(SHUTDOWN_CUSTOM_REBOOT))
{
OSTimeDly(TICKS_PER_SECOND * 5);
ForceReboot();
}
This example provides a serial port menu with options enable or disable a reboot for application or settings updates.
For testing purposes you can select reboot from the serial menu, or attempt an application code update.

11.25 NBString Class


This example program demonstrates the functionality NBString class.

11.26 NetBios Name


The example demonstrates how to use NetBIOS naming, so you can access your NetBurner device by name as
well as IP address on a local area network. The name can be changed on the web page.
The NetBios Name can contain any alphanumeric character except spaces and \ : / ∗ ? ; | . It must be 15 characters
or less.

11.27 Network Time Server (NTP) Client


A simple example that will get the time from a NTP server and display the UTC and PDT time through the debug
serial port. Use MTTTY to monitor the output.
For this example to function, your NetBurner device must have access to the Internet, with a working configuration
for the IP address, mask and gateway.

11.28 NTP & Real-Time Clock


NTP-SYSTEM-RTC DEMO APPLICATION
HARDWARE SETUP: Tested with MOD54415 on a MOD-DEV-70 hardware rev 1.93.
This example demonstrates the following features:

NetBurner, Inc.
11.29 Overload Directory & System Files 193

• Updates the system time with the current UTC time pulled from an available NTP server (pool.ntp.org). If your
module is set to static IP address settings, then you will need to manually assign a DNS server address for
this feature to work.

• Take the current system time and save it to the real-time clock (RTC). The RTC will then be running in sync
with the system time.

• Take the current time in the RTC and set the system time information. The system time will then be running
in sync with the RTC.

• When the device or module is reset or powered on again after a recent power loss, the system time will be
reset, but the RTC can continue running until the super-capacitor is discharged. The software-reset option is
available to demonstrate the RTC's ability to retain saved time information once it is properly set.

• Set the local time zone information with a call to tzsetchar(). For more more information on this function, refer
to "Chapter 14 - NBTime Library" of the NetBurner Runtime Libraries PDF document. In this example, Pacific
time zone information is used as a demonstration.

• Display the current system and RTC times, and local time zone information if applicable. It is preferred that
the RTC store the UTC time, not local time.

• In order to take advantage of setting and getting time information from the real-time clock (RTC), a device that
contains an RTC component or a module that is mounted on a development board with an RTC component
must be used. Current RTC components supported in this example at the time of this writing are the Intersil
X1226 and NXP PCF8563.

11.29 Overload Directory & System Files


The Overload Directory Example is a basic demonstration of the overload directory in a project. The overload
directory is used to override any system file by including local copies of system source files or headers. This allows
the user to make changes to system files exclusively for a project. The overload directory provides an alternative to
modifying the original system files, which would affect all projects.
To use this feature, the file to be overloaded should be placed in the overload directory under a directory structure
that matches the file's location relative to the NNDK install directory.
This example application utilizes the overload directory to override predef.h (a NetBurner configuration header file).
The overloaded predef.h defines the macro NBRTOS_TIME, which is not defined by default.
To overload the predef.h header, the directory structure is replicated inside the overload directory. For example,
predef.h is located in the following directory in the NNDK install:

/nburn/nbrtos/include/predef.h

Therefore, the directory structure is replicated inside the overload directory with the following structure:

<project root>/overload/nbrtos/include/predef.h

Additional instructions if the overload directory is used in an NBEclipse project:


After adding the file to be overloaded, clean and rebuild the NetBurner Archive by selecting "Clean NetBurner
Archive" under the Build Targets pull-down in the project. From that point on, modifying predef.h (or any overloaded
source/header) will automatically rebuild the necessary files in the NetBurner Archive when then project builds.
If a system include folder is overloaded, this folder should be added to your project include paths. Right click on the
project and select project properties. Under C/C++ Build->Settings, select GNU C++ Compiler->Includes and add
the overload include folder. If utilizing C code, then GNU C Compiler->Includes should also be added.

11.30 Platform Specific


With the exception of the Platform Specific examples, all examples in the \nburn\examples directory can be
run on any of the NetBurner 3.x platforms: MODM7AE70, MOD5441x, NANO54415 and SB800EX. The Platform
Specific examples in this section have specific hardware requirements.
The example categories are:

• Examples designed for only one platform: MODM7AE70, MOD5441x, NANO54415 or SB800EX

NetBurner, Inc.
194 Example Applications

• Multi-Platform: Some examples for platforms that use the same microprocessor take advantage of that fact
and share the same application source code. In these instances the section will be labeled with the supported
platforms, such as the section labeled: "MOD5441x, NANO54415, SB800EX".

Platform specific examples

• MOD5441x, NANO54415, SB800EX

• MOD5441x

• MODM7AE70

• NANO54415

• MODM7AE70, SBE70LC

• SB800EX

• SOMRT1061

11.30.1 MOD5441x, NANO54415, SB800EX


Platform specific examples for ColdFire MCF5441x based products: MOD5441x, NANO54415 and SB800EX.

• 1-Wire

• Analog to Digital

• CAN to Serial

• Digital to Analog (DAC)

• DSPI to Serial

• Load Application From Flash Card

• SDHC Flash Card

• External IRQ

• External NMI IRQ 7

• RTC - External

• I2C

• RTC - On Chip

• Periodic Interrupt Timer

• Pulse Generator and Counter

• PWM

• Core Watchdog Timer (CWT)

• WAV File Audio Player

11.30.2 1-Wire
This program used the 1-wire peripheral to read a registration number from the DS2401 Silicon Serial Number chip.
Supported Platforms: MOD5441x, NANO54415

11.30.3 Analog to Digital


MOD5441x and NANO54415 Analog to Digital Platform Examples

• Simple ADC

• Periodic ADC

NetBurner, Inc.
11.30 Platform Specific 195

11.30.4 Simple ADC


Simple Analog to Digital converter example
Supported Platforms: MOD5441x, NANO54415
This example demonstrates how to read all 8 ADC inputs. The ADC register values will be displayed on the serial
port interface, as well as the floating point conversion values.
Please refer to the data sheet for your specific platform to determine which of the 8 ADC channels are routes to
interface connectors.

11.30.5 Periodic ADC


PeriodicAD - DMA Driven, periodic sampling Analog to Digital example
Supported Platforms: MOD5441x, NANO54415
This example shows how to setup a periodic sampling Analog to Digital conversion with buffering. It uses the
onboard Analog to Digital Converter in loop mode to continuously sample. It then utilizes the DMA Timer to trigger
a dma transfer from the selected ADC channel, to the next location in the sample buffer. The example includes
interrupt triggers at a half-full and completely full buffer. Finally, the specific result of the application is to sample for
some period of time, record the data to an output .wav file, and repeat.
This example requires an external SD Flash card, such as the one on the NetBurner development board.
To build and run this example:

• Create a new project.

• Import the example source files to the src directory

• Import the following EFFS support files from \nburn\examples\_common\EFFS\FAT: cardtype.h,


FileSystemUtils.cpp, FileSystemUtils.h.

• If you are using NBEclipse, then you will also need to tell the linker to include the FatFile library:

– In NBEclipse, right-click on your project, and select "Properties"


– Select "C/C++ Builds -> Settings" on the left-hand side
– Select "GNU C/C++ Linker -> Libraries" under the "Tool Settings" tab
– In the "Libraries" list box, add "FatFile" by using the action icons provided in top-right corner of the list

11.30.6 CAN to Serial


CAN TO SERIAL EXAMPLE PROGRAM
The Controller Area Network (CAN) bus is a twisted pair multidrop cable is specified with a length ranging from
1,000m at 40Kbps to 40m at 1Mbps. The maximum payload of a message is 8 bytes, and all messages carry a
cyclic redundancy code (CRC). Each message has an identifier, which can be interpreted differently depending on
the application or higher-level protocols used. All nodes on the network receive each message and then decide
whether that identifier value is of interest.
The NetBurner CAN to Serial example program uses the NetBurner CAN API to send and receive CAN messages
though a serial port interface. It will listen for frames using the RegisterCanRxFifo() function. Frames are received
using the CanRxMessage class, and are sent out the RS-232 debug port of your NetBurner CB34EX module. Note
that you must have at least two CAN devices run any CAN programs.
RS-232 |----------| CAN |----------|
<--------->| Dev 1 |<--------->| Analyzer |
|----------| |----------|
SETUP This application has been tested on the SB800EX, MOD54415, MOD54417 and NANO54415. The CAN
signals were connected to a CAN analyzer. MTTTY was run on a PC to enter the data to the RS-232 serial port that
is ten transmitted out the CAN interface. If you have 2 NetBurner devices you can connect them together (in place
of the CAN analyzer) and send data in both directions.
PLATFORM NOTES

• This example was written to run on multiple platforms.

• The MCF5441x processor has 2 CAN modules, 0 and 1. Some platforms bring out both, but others with
limited pin count only bring out only one.

NetBurner, Inc.
196 Example Applications

• Please refer to the data sheet to determine which CAN signals correspond to which module or development
board pin.

• The MOD5441x devices were tested in a MOD-DEV-100 development board which has a CAN transceiver

• The SB800EX comes in 2 versions: CAN 0 on the 5-pin terminal strip, or CAN 1 on the DB9 connector.

RUNNING THE EXAMPLE

• A minimum of TWO CAN devices are required for CAN to operate

• This example application sets the CanInit() mask to 0, which will listen for all packets and display the info on
MTTTY.

• This example application will send data you type in MTTTY with an id of 101 (0x65).

• If you receive a message indicating the CAN message could not be sent, it usually means the other device
did not acknowledge the CAN packet.

11.30.7 Digital to Analog (DAC)


This example demonstrates how to use the DAC0 signal in two modes:

1. Step up the output from 0 to 0xFFF by writing to the DAC data register.

2. Use the auto waveform generator feature synced to DMA timer 0 to step up the output.

You must have a voltage reference as described below

11.30.7.0.0.1 MOD5441x Platforms The DAC0 signal is on pin on pin J2.9. You must also have the analog
reference voltage pin connected to something between 0 and 3.3VDC. The easiest way is to connect 3.3VDC by
jumpering J2.2 (Vcc) to J2.5 (Analog ref. input)

11.30.7.0.0.2 NANO54415 Platforms The DAC0 signal in on pin on pin J2.9. You must have the analog ref-
erence voltage pin connected to something between 0 and 3.3VDC. On the NANO Development board you can
jumper P3.2 (Vcc) to P2.8 (Analog ref. input)

11.30.8 DSPI to Serial


DSPI TO SERIAL EXAMPLE
Supported Platforms: MOD5441x, NANO54415
This program will illustrate how to use the NetBurner DSPI driver. The driver provides most of the standard DSPI
options while providing some extra features, including:

• 4-32 bit transfers instead of the standard 4-16 bit

• Automation of the queuing system

• Interrupt driven transfers

In this example we demonstrate how to take advantage of the interrupt feature by using a Semaphore. This will
allow any other lower priority tasks to run during the transfer. There is also an option to not use a semaphore and
poll the transfer using the bool DSPIdone(); function provided in qspi.h.
This example can be used with no external SPI device by placing a jumper across J2[27]-J2[28] on the DEV-70/100
carrier board or Pins[33]-Pins[35] for the Nano54415 dev board. This will loop-back the DSPI data and echo the
sent character back to the serial terminal.
The DSPI2Serial example can easily be expanded to DSPI2TCP by creating a TCP socket file descriptor similar to
the TCP2Serial example. This TCP file descriptor would then used in place of the serial file descriptor.

NetBurner, Inc.
11.30 Platform Specific 197

11.30.9 Load Application From Flash Card


Example of how to update an application from a binary image file on a flash card.
Supported Platforms: MOD5441x
This application uses the Extra File Descriptor (ExtraFD) mechanism to read a binary application image as an input
stream from a flash card to the FD. This image is then programmed into flash memory as an application. As with
any application update, a reboot is required to run the new application.
As with any Extra FD object, you must create and assign callback functions for read, write, close and peek. There
is another example of using the Extra FD with a circular buffer in the \nburn\examples directory.
This application was created and tested on a MOD5441x platform using the onboard microSD Flash card. There
are also comments on how to use the external Flash card interface as well.

11.30.10 SDHC Flash Card


Supported Platforms: MOD5441x, NANO54415, SB800EX
This program demonstrates the EFFS FAT file system and FTP operations for SD/MMC/SDHC Flash cards on 5441x
platforms:

• Mounting a flash drive

• Determining amount of used and free file space

• Using FTP to upload and download files

NetBurner 5441x based platforms have two types of flash card interfaces:

1. Native SPI

2. SDHC

These types are mutually exclusive and the flash card connector on the device must be wired one way or the other.
As of the writing of this example: MOD54415, MOD54417:

• Onboard microSD connector is SPI.

• MOD-DEV-70 development board is wired for SPI.

• Signals are available on the module headers to wire for SDHC or SPI

NANO54415:

• Onboard microSD wired for SDHC

• NANO development board wired for SPI

SB800EX

• Onboard microSD connector is wired for SDHC

Any SPI connected card is able to run any of the EFFS FAT examples located in the EFFS directory of
\nburn\examples.
To run the speed test you will need to place a file named TEST.BIN on the flash card. You can do this with FTP
to the device directly, or copy it onto the flash drive from another device. Test results will be displayed through the
debug serial port.
Modules with an onboard microSD flash socket should use the multi mmc header files and functions because the
modules are capable of supporting both onboard and external flash cards (even if you application only uses one).

11.30.11 External IRQ


Supported Platforms: MOD5441x, NANO54415
This example program uses a GPIO pin to trigger an external interrupt pin. A jumper must be placed from the GPIO
pin to the desired interrupt input. To run the example use MTTTY or some other serial terminal to interact with the
menu to trigger the interrupt and view the interrupt counter.
The MCF5441x processor is used on the MOD54415, MOD54417 and NANO54415 modules. The table below list
the available interrupts and GPIO jumper configuration.
MOD54415:

NetBurner, Inc.
198 Example Applications

• GPIO signal pin: J2.33

• IRQ 1: pin 45

• IRQ 2: pin 43

• IRQ 3: pin 26

• IRQ 6: pin 47

NANO54415:

• GPIO signal: Nano pin 12 = Dev board pin P2.12

• IRQ 2: Nano pin 50 = Dev board pin P1.50

• IRQ 3: Nano pin 49 = Dev board pin P1.49

11.30.12 External NMI IRQ 7


MCF441X NON-MASKABLE IRQ 7 EXAMPLE
Supported Platforms: MOD5441x, NANO54415
This example program uses a GPIO pin to trigger a level 7 interrupt. A jumper must be placed from the GPIO pin
to the interrupt input pin. To run the example, use MTTTY or some other serial terminal to interact with the menu to
trigger the interrupt and view the interrupt counter.
The MCF54415 processor is used on both the MOD54415 and NANO54415 modules. The table below list the GPIO
jumper configuration:
MOD54415:

• GPIO signal pin: J2.33

• IRQ 7: pin 48

NANO54415, and dev board revision 1.3:

• GPIO signal: Nano pin 12 = Dev board pin P2.12

• IRQ 7: Nano pin 9 = Dev board pin P1.9

Examples of assembly language and C/C++ ISR processing functions are provided.

11.30.13 RTC - External


External I2C RTC example
Supported Platforms: MOD5441x, NANO54415
HARDWARE SETUP: Tested with MOD54415 on a MOD-DEV-70 hardware rev 1.93.
This example demonstrates the following features:

• Updates the system time with the current UTC time pulled from an available NTP server (pool.ntp.org). If your
module is set to static IP address settings, then you will need to manually assign a DNS server address for
this feature to work.

• Take the current system time and save it to the real-time clock (RTC). The RTC will then be running in sync
with the system time.

• Take the current time in the RTC and set the system time information. The system time will then be running
in sync with the RTC.

• When the device or module is reset or powered on again after a recent power loss, the system time will be
reset, but the RTC can continue running until the super-capacitor is discharged. The software-reset option is
available to demonstrate the RTC's ability to retain saved time information once it is properly set.

• Set the local time zone information with a call to tzsetchar(). For more more information on this function, refer
to "Chapter 14 - NBTime Library" of the NetBurner Runtime Libraries PDF document. In this example, Pacific
time zone information is used as a demonstration.

NetBurner, Inc.
11.30 Platform Specific 199

• Display the current system and RTC times, and local time zone information if applicable. It is preferred that
the RTC store the UTC time, not local time.

• In order to take advantage of setting and getting time information from the real-time clock (RTC), a device that
contains an RTC component or a module that is mounted on a development board with an RTC component
must be used. Current RTC components supported in this example at the time of this writing are the Intersil
X1226 and NXP PCF8563.

11.30.14 I2C
MCF5441x I2C Platform Examples

• I2C Address Scan

• I2C PicKit Demo Board

11.30.15 I2C Address Scan


Scan the I2C bus for devices and display their addresses.
Supported Platforms: MOD5441x, NANO54415
ScanI2CBus sends out a request on the I2C bus and waits for an ack, scanning each address in the address space.
If a device responds, the device address is reported.
This utility is very helpful to:

• Verify the hardware is connected correctly.

• Understanding the addressing in I2C device data sheets. Some data sheets include the read/write bit as part
of the address, and some do not.

Notes when using a MOD5441x and the MOD-DEV-70 development board:

• The MOD5441x has up to 5 I2C ports that can be used: 0, 1, 2, 4 and 5.

• I2C0, J2-39 and J2-42: This is the default I2C peripheral. It has 4.7k pull up resistors on SDA and SCL, and
is connected to a real time clock chip.

• I2C1, J2-41 and J2-44: Sgnals are not connected to anything, but you will need to add pull up resistors.

• I2C2, J2-17 and J2-18, are used for USB, but can be converted to I2C2 by moving 2 resistors on the
MOD5441x. The ordering model number is MOD54415-100IR-I2C2. Refer to PCN 001 on the MOD5441x
product page.

• I2C4, J2-3 and J2-4: Signals are used for UART0 serial port

• I2C5, J2-21 and J2-22: Signals are used for UART1 serial port

11.30.16 I2C PicKit Demo Board


Microchip Pickit Serial I2C Demo Board Driver
Supported Platforms: MOD5441x, NANO54415
Demonstrates the use of 5 Microchip I2C Peripherals:

• 24LC0B EEPROM, 2Kbit (256 x 8)

• MCP9800 Temperature sensor

• MCP23008 GPIO port expander, connected to LEDs

• TC1321 10-bit DAC

• MCP3221 12-bit ADC

NetBurner, Inc.
200 Example Applications

11.30.17 RTC - On Chip


Supported Platforms: MOD5441x, NANO54415
A simple Real Time Clock (RTC) example using the RTC on the MCF5441x microprocessor. Demonstrates how to
get and set time through NTP, RTC and manually. An interactive menu is accessed through MTTTY.
For this example to function, your NetBurner device must have access to the Internet, with a working configuration
for the IP address, mask, gateway and DNS server.

11.30.18 Periodic Interrupt Timer


Periodic Interrupt Timer (PIT) Example
Supported Platforms: MOD5441x, NANO54415 SB800EX
There are a total of 4 PIT timers on the MCF54415 processor, numbered 0 - 3:

• 0 is reserved for the RTOS system clock

• 3 is reserved for the network debugger

• 1 and 2 are available for customer use

The PIT functions below are part of the 54415 system libraries, and defined in pitr_sem.cpp and pitr_sem.h, located
in the include and system folders of your MOD54415 or NANO54415 platform directories.
In this example a semaphore will be set in the PIT interrupt routine, and the semaphore count will be displayed
through the serial port.

11.30.19 Pulse Generator and Counter


Supported Platforms: MOD5441x, NANO54415
Demonstrates how to use the DMA Timers to generate a waveform output on one timer, and use the timer capture
feature to count the waveform pulses on a second timer. Features include:

• Programmable frequency output

• Measurement of frequency input

• Timer count display

• Values also displayed on the web page interface

The application will work on the MOD54415, MOD54417 and NANO5441. The selected timer channels must be
jumpered together on the development board so that the waveform output is connected to the capture input.
MOD5441x: Timer J2 Pin
0 36 1 34 2 33 3 32
NANO54415: Timer Pin
0 19 1 21 2 23 3 25

11.30.20 PWM
Example program for ColdFire MCF5441x PWM capability on the MOD5441x core module.
Supported Platforms: MOD5441x, NANO54415
Description: Toggles a PWM signal on pin 35 on the NetBurner NANO or MOD54415 module using two different
settings. While each PWM module on the 5441x core is capable of producing multiple output signals for use in
controlling motors as well as other applications, this example sets the output for one pin only.
There are 2 functions illustrating different methods to create the pulses:

1. Center-Aligned pulses

2. Edge-Aligned pulses

NetBurner, Inc.
11.30 Platform Specific 201

11.30.21 Core Watchdog Timer (CWT)


This example demonstrates how to enable the watchdog, set the timeout value, and service the watchdog. An
interactive menu and status messages are displayed through the debug serial port. If the watchdog is not serviced
before the timeout expires, events such as a system reset or interrupt service request (IRQ) can occur. The following
watchdog timeout modes are supported by the 5441x processor:

• System reset

• IRQ only

• IRQ on first timeout, then system reset on the second timeout

• Windowed mode, this is an advanced mode of operation that processes a timeout in 25% increments. Please
refer to the MCF5441X Users Manual for more information. This mode is not covered in the example.

Servicing the watchdog can be accomplished in a number of ways:

1. A higher priority task that uses a timer, such as the Periodic Interrupt Timer (PIT). This is the most common
method.

2. In an Interrupt Service Routine (ISR). A drawback here is that interrupts can still occur, even if a specific task
is not functioning correctly.

3. Servicing throughout an application with specific function calls. This is very difficult to cover all of the edge
cases.

A good system implementation would be to use the task and timer method, along with flags, counters or some other
indication in each critical task that is evaluated in the watchdog service task to ensure the system is functioning
properly.
The example includes code for both the task with timer method and interrupt method; you will only need one of
these in your application.
Example Features:

• Demonstrates 3 service methods: task with timer, interrupt and manual

• Interactive menu on serial port provides options for enabling, disabling and servicing modes

This example does not enable the watchdog in the Flash memory system configuration so that a power cycle will
reset the system with the watchdog disabled. This is done to make it easier to experiment with the various watchdog
modes of operation. If you wish to have the watchdog persistently enabled through power cycles without explicitly
enabling it in your application, the watchdog must be enabled in the configuration system.

11.30.22 WAV File Audio Player


Supported Platforms: MOD5441x, NANO54415
This example demonstrates how to play audio files (uncompressed WAV) using the onboard Digital to Analog
Converters (DAC) on the MCF5441X processor. It is fully capable of playing 8 bit and down converted 16 and
32 bit stereo audio at 44100 samples per second. It has minimal support for 24 bit samples, treating it as 8 bit data
with sample padding.
Before attempting to build the application, you will first need to extract the "wav\_data\_srcs.zip" archive, containing
the sample audio files converted to data arrays. The originals used to create these source files are found in the
archive 'SD_card.zip'. This contents directory are also intended to be placed directly onto an (micro)SD card and
files be played from it.
IMPORTANT: Since these files are external references in main.cpp, they must be aligned on an even boundary.
One way to do this is the aligned attribute. For example: uint8_t sinewav_440[] attribute(( aligned( 16 ))) = { ..... }
You can see the full declaration in the nbwav_44k .cpp file

11.30.23 MOD5441x
MOD5441x Platform Examples

• Multiple EFFS Flash Card Test

NetBurner, Inc.
202 Example Applications

• Factory application

• Rapid GPIO

• USB Mass Storage Device Simple

11.30.24 Multiple EFFS Flash Card Test


Application to demonstrate how to access both the microSD flash card on the module, and the external flash card
on the NetBurner development board.

11.30.25 Factory application


Supported Platforms: MOD5441x
Application that is pre-loaded on MOD5441x modules at the factory. Features include:

• Web server

• FTP server

• EFFS flash file system access to the development board flash card socket

This example requires that you edit the project properties to add the FatFile library.

11.30.26 Rapid GPIO


Supported Platforms: MOD5441x
Example program for ColdFire MCF5441x Rapid GPIO capability on the MOD5441x core module.
The RGPIO module provides 16-bits of high-speed GPIO functionality, mapped to the processor’s bus. The key
features of this module include:

• 16 bits of high-speed GPIO functionality connected to the processor’s local 32-bit bus

• Memory-mapped device connected to the ColdFire core’s local bus

• Support for all access sizes: byte, word, and longword

• All reads and writes complete in a single data phase cycle for zero wait-state response

• Data bits can be accessed directly or via alternate addresses to provide set, clear, and toggle functions

• Alternate addresses allow set, clear, toggle functions using simple store operations without the need for
read-modify-write references

• Unique data direction and pin enable control registers

• Pin toggle rates typically 1.5–3.5x faster than comparable pin mapped onto peripheral bus

This example:

• Toggles RGPIO signal 0 (module pin 37) 50 times as fast as possible at 1 second intervals.

• The time from rising edge to rising edge of a pulse measures 16ns (62.5MHz).

• The processor slew rate must be set to maximum to acheive a speed this fast and you will

• need a fast scope and probe with a very short (1 inch) ground connection to measure it.

There are 3 functions illustrating the various methods to create the pulses in order of fastest to slowest:

• Assembly code

• Hybrid of assembly and C

• C/C++ code

NetBurner, Inc.
11.30 Platform Specific 203

11.30.27 USB Mass Storage Device Simple


Supported Platforms: MOD5441x
Required Hardware: -MOD54415 or MOD54417 -NBUSB-ADPT-100R: USB development adapter -MOD-DEV-70←-
CR: development board
Example program for ColdFire MCF5441x that demonstrates USB Mass Storage Device functionality.
This example demonstrates:

• Using USB Mass Storage Device Host Mode to connect to external USB flash drives

• Reading files and directories from a USB flash drive

• Writing files to USB flash drives

• Deleting files on USB flash drives

11.30.28 MODM7AE70
MODM7AE70 Platform Examples

• Analog to Digital (ADC)

• CAN Send and Receive

• EBI Page Control

• EBI Page Control - Simple

• GPIO - Simple

• I2C

• Factory Application

• Interrupts

• PWM

• NTP & Real-Time Clock

• Serial Callback Function

• SPI

• SSC I2S Interface

• Timers

• DACC Tone Generator

• Watchdog Timer

11.30.29 Analog to Digital (ADC)


Supported Platforms: MODM7AE70
The Simple ADC example implements basic analog input functions of the MODM7AE70.
The MODM7AE70 offers two Analog Front-End Controllers (AFEC) that are based on an Analog Front-End (AFE)
cell. The MODM7AE70 provides seven 12-bit Analog-to-Digital (ADC) lines available through the P2 header. The
SBE70LC provides 8 12-bit ADC lines available between the JP1 and JP3 headers. Both platform's have one
additional ADC line that is connected to the CPU's internal temperature sensor – it cannot be reconfigured for other
applications.
An ADC voltage reference is required for accurate ADC readings. The MODM7AE70 ADC voltage reference is
accessible through pin P2[5]. If using the MODM7AE70 with a MOD-DEV-70 development board, a jumper can be
applied to the JP5 header on the MOD-DEV-70 to apply a 3.3V reference. The SBE70LC ADC voltage reference is
accessible through the JP3[1] pin.

NetBurner, Inc.
204 Example Applications

The following table maps the available ADC lines on the MODM7AE70 to the corresponding pins on the P2 header:
+-----—+---------—+----------—+ | Pin | AFE Module | ADC Channel | +-----—+---------—+----------—+ | P2[3] | 0 | 10 |
+-----—+---------—+----------—+ | P2[6] | 1 | 3 | +-----—+---------—+----------—+ | P2[7] | 0 | 0 | +-----—+---------—+-----
-----—+ | P2[8] | 0 | 6 | +-----—+---------—+----------—+ | P2[21] | 0 | 1 | +-----—+---------—+----------—+ | P2[29] | 0 |
5 | +-----—+---------—+----------—+ | P2[38] | 0 | 2 | +-----—+---------—+----------—+ | ∗Temp | 0 | 11 | +-----—+---------
—+----------—+ Temperature sensor internal to the CPU, not available through the pin header
Note that AFE module 0, channel 1 (P2[3]) collides with serial port 0 receive. If using this ADC channel (like this
example does), the application will not be able to receive data on serial port 0. It can still print to serial port 0,
though.
The following table maps the available ADC lines on the SBE70LC to the corresponding pins on the JP1 and JP3
headers: +------—+---------—+----------—+ | Pin | AFE Module | ADC Channel | +------—+---------—+----------—+ |
JP1[5] | 0 | 2 | +------—+---------—+----------—+ | JP1[10] | 1 | 0 | +------—+---------—+----------—+ | JP1[11] | 0 | 10 |
+------—+---------—+----------—+ | JP1[13] | 0 | 1 | +------—+---------—+----------—+ | JP1[14] | 0 | 5 | +------—+-------
--—+----------—+ | JP3[3] | 1 | 3 | +------—+---------—+----------—+ | JP3[5] | 0 | 0 | +------—+---------—+----------—+ |
JP3[7] | 0 | 6 | +------—+---------—+----------—+ | ∗Temp | 0 | 11 | +------—+---------—+----------—+ Temperature sensor
internal to the CPU, not available through the pin header

11.30.30 CAN Send and Receive


Supported Platforms: MODM7AE70
A very simple CAN example to send and receive packets:

• Creates a CAN receive task

• Serial port menu with options to send, receive, manipulate RTR filters

• CAN communication requires 2 CAN devices. As a test you can send/receive by jumpering the CAN pins
together

11.30.31 EBI Page Control


Supported Platforms: MODM7AE70
The EBI Page Control example implements a transparent Page Fault based page manager for the SAME70's Exter-
nal Bus Interface. It is primarily intended for use with systems requiring a full 24-bit address bus or for multiplexing
a specific chip select against multiple identical devices.

11.30.32 EBI Page Control - Simple


Supported Platforms: MODM7AE70
This example demonstrates basic use of the SAME70's External Bus Interface (EBI). To implement a bus interface
requires an understanding of the EBI signals, which are provided in the Microchip SAME70 Reference Manual and
Data Sheet location in the "\nburn\docs" folder of your installation. Section 33 "External Bus Interface" provides an
overview of EBI operation. The most common interface is desribed in section 35 "Static Memory Controller (SMC).
The example demonstrates configuration of the EBI via the NetBurner EBI driver, performing a single read or write
operation on the bus.

11.30.33 GPIO - Simple


Supported Platforms: MODM7AE70
Very simple GPIO example that blinks a LED on P215 of the MOD-DEV-70 development board. There is a more
advanced multi-platform example in the \nburn\examples folder.

11.30.34 I2C
MODM7AE70 I2C Platform Examples

• I2C Address Scan

• I2C PicKit Demo Board

NetBurner, Inc.
11.30 Platform Specific 205

11.30.35 I2C Address Scan


Supported Platforms: MODM7AE70
Scans the I2C bus for devices and display their addresses.
ScanI2CBus sends out a request on the I2C bus and waits for an ack, scanning each address in the address space.
If a device responds, the device address is reported.
This utility is very helpful to:

• Verify the hardware is connected correctly.

• Understanding the addressing in I2C device data sheets. Some data sheets include the read/write bit as part
of the address, and some do not.

11.30.36 I2C PicKit Demo Board


Supported Platforms: MODM7AE70
Microchip Pickit Serial I2C Demo Board Driver
Demonstrates the use of 5 Microchip I2C Peripherals:

• 24LC0B EEPROM, 2Kbit (256 x 8)

• MCP9800 Temperature sensor

• MCP23008 GPIO port expander, connected to LEDs

• TC1321 10-bit DAC

• MCP3221 12-bit ADC

11.30.37 Factory Application


Supported Platforms: MODM7AE70
Application that is pre-loaded on MODM7AE70 modules at the factory. Features include:

• Web server

• FTP server

• EFFS flash file system access to the development board flash card socket

This example requires that you edit the project properties to add the FatFile library.

11.30.38 Interrupts
MODM7AE70 Interrupt Platform Examples

• External Pin IRQ

• Pin Interrupt Request

11.30.39 External Pin IRQ


Supported Platforms: MODM7AE70
This example is based on the PinIrq example, which shows how to use the interrupt capabilities of the PIO controller
and the PinIrq functions for the MODM7AE70.
This example is much simpler. It uses a single pin as a IRQ input, and a second pin to generate IRQ requests once
every second. These 2 pins will need to be jumpered on the development board in order for the example to run.
When configuring the IRQ priority for a pin, the configuration affects the entire port that the GPIO pin belongs to.
For example, this application configures pin P2[8] for an IRQ input. As can be seen in the table below, P2[8] belongs
to PIO_PORT_A. Therefore, the IRQ priority configuration will also affect pins P2[9], P2[12] and so on. The other
ports are unaffected by the IRQ priority configuration of PIO_PORT_A in this example.
The table below maps the pins on the P1 and P2 headers of the MODM7AE70 to the port that they belong to.
+================================================================+ | PIO_PORT_A | PIO_←-
PORT_B | PIO_PORT_C | PIO_PORT_D | PIO_PORT_E | +========================================================

NetBurner, Inc.
206 Example Applications

| P2[8] | P2[3] | P2[6] | P2[7] | P1[20] | +---------—+---------—+---------—+---------—+---------—+ | P2[9] | P2[4] | P1[4]


| P2[10] | P1[22] | +---------—+---------—+---------—+---------—+---------—+ | P2[12] | P2[11] | P1[6] | P2[15] | P1[23] |
+---------—+---------—+---------—+---------—+---------—+ | P2[13] | P2[12] | P1[11] | P2[23] | P1[24] | +---------—+--------
-—+---------—+---------—+---------—+ | P2[16] | P2[22] | P1[12] | P2[24] | P1[25] | +---------—+---------—+---------—+----
-----—+---------—+ | P2[17] | P2[29] | P1[13] | P2[25] | P1[27] | +---------—+---------—+---------—+---------—+---------—+
| P2[18] | P2[38] | P1[14] | P2[26] | | +---------—+---------—+---------—+---------—+---------—+ | P2[19] | | P1[15] |
P2[27] | | +---------—+---------—+---------—+---------—+---------—+ | P2[20] | | P1[16] | P2[28] | | +---------—+---------—
+---------—+---------—+---------—+ | P2[21] | | P1[17] | P2[30] | | +---------—+---------—+---------—+---------—+---------—+
| P2[31] | | P1[18] | P2[37] | | +---------—+---------—+---------—+---------—+---------—+ | P2[32] | | P1[19] | P2[41] | |
+---------—+---------—+---------—+---------—+---------—+ | P2[33] | | P1[21] | P2[44] | | +---------—+---------—+---------—
+---------—+---------—+ | P2[34] | | P1[32] | P1[7] | | +---------—+---------—+---------—+---------—+---------—+ | P2[35] |
| P1[33] | P1[9] | | +---------—+---------—+---------—+---------—+---------—+ | P2[36] | | P1[34] | | | +---------—+--------
-—+---------—+---------—+---------—+ | P2[39] | | P1[35] | | | +---------—+---------—+---------—+---------—+---------—+ |
P2[40] | | P1[36] | | | +---------—+---------—+---------—+---------—+---------—+ | P2[42] | | P1[37] | | | +---------—+-------
--—+---------—+---------—+---------—+ | P2[43] | | P1[38] | | | +---------—+---------—+---------—+---------—+---------—+ |
P2[45] | | P1[39] | | | +---------—+---------—+---------—+---------—+---------—+ | P2[47] | | P1[40] | | | +---------—+-------
--—+---------—+---------—+---------—+ | P2[48] | | P1[41] | | | +---------—+---------—+---------—+---------—+---------—+ |
P1[5] | | P1[42] | | | +---------—+---------—+---------—+---------—+---------—+ | P1[10] | | P1[43] | | | +---------—+--------
-—+---------—+---------—+---------—+ | P1[26] | | P1[44] | | | +---------—+---------—+---------—+---------—+---------—+ |
P1[29] | | P1[45] | | | +---------—+---------—+---------—+---------—+---------—+ | P1[31] | | | | | +---------—+---------—+---
------—+---------—+---------—+ | P1[46] | | | | | +---------—+---------—+---------—+---------—+---------—+ | P1[47] | | | | |
+---------—+---------—+---------—+---------—+---------—+

11.30.40 Pin Interrupt Request


Supported Platforms: MODM7AE70
The PinIrq example shows how to use the interrupt capabilities of the PIO controller and the PinIrq functions for the
MODM7AE70.

11.30.41 PWM
Supported Platforms: MODM7AE70
Demonstrates the use of the PWM peripheral.

11.30.42 NTP & Real-Time Clock


Supported Platforms: MODM7AE70
NTP-SYSTEM-RTC DEMO APPLICATION
HARDWARE SETUP: Tested with MODM7AE70 on a MOD-DEV-70 hardware rev 1.93.
This example demonstrates the following features:

• Updates the system time with the current UTC time pulled from an available NTP server (pool.ntp.org). If your
module is set to static IP address settings, then you will need to manually assign a DNS server address for
this feature to work.

• Take the current system time and save it to the real-time clock (RTC). The RTC will then be running in sync
with the system time.

• Take the current time in the RTC and set the system time information. The system time will then be running
in sync with the RTC.

• When the device or module is reset or powered on again after a recent power loss, the system time will be
reset, but the RTC can continue running until the super-capacitor is discharged. The software-reset option is
available to demonstrate the RTC's ability to retain saved time information once it is properly set.

• Set the local time zone information with a call to tzsetchar(). For more more information on this function, refer
to "Chapter 14 - NBTime Library" of the NetBurner Runtime Libraries PDF document. In this example, Pacific
time zone information is used as a demonstration.

• Display the current system and RTC times, and local time zone information if applicable. It is preferred that
the RTC store the UTC time, not local time.

NetBurner, Inc.
11.30 Platform Specific 207

• In order to take advantage of setting and getting time information from the real-time clock (RTC), a device that
contains an RTC component or a module that is mounted on a development board with an RTC component
must be used. Current RTC components supported in this example at the time of this writing are the Intersil
X1226 and NXP PCF8563.

11.30.43 Serial Callback Function


Supported Platforms: MODM7AE70
The Serial Empty Callback example demonstrates a robust process for triggering a specified action upon complete
transmission of all data written to a specified serial port. The expected use case for this would be disabling a
transmitter connected to a shared physical layer such as with RS485 or a wireless link (when using one of the
device's UART serial ports).
As an aside, it should be noted that when enabling the Serial485HalfDupMode for one of the MODM7AE70s USART
serial ports, the underlying hardware module will automatically toggle the RTS line for enabling and disabling the
transmitter.

11.30.44 SPI
MODM7AE70 SPI Platform Examples

• Serial-to-SPI QuadSPI

• Serial-to-SPI USART

11.30.45 Serial-to-SPI QuadSPI


Supported Platforms: MODM7AE70
The Serial-to-SPI example demonstrates the basic configuration of the SPI driver and sending/receiving data over
an SPI interface. This example demonstrates how to use the driver for the QuadSPI peripheral in single-bit, master
mode SPI.

11.30.46 Serial-to-SPI USART


Supported Platforms: MODM7AE70
The Serial-to-SPI example demonstrates the basic configuration of the SPI driver and sending/receiving data over
an SPI interface. This example demonstrates how to use the driver for the USART peripheral in single-bit, master
mode SPI.

11.30.47 SSC I2S Interface


Supported Platforms: MODM7AE70
SSC_I2S implements an I2S interface using the Synchronous Serial Controller and uses it to communicate with a
WM8904 Audio Codec.

11.30.48 Timers
MODM7AE70 Timer Platform Examples

• Timer Capture

• Timer Waveform Output

• Chaining SAME70 Timers

11.30.49 Timer Capture


Supported Platforms: MODM7AE70
Timer Counter Capture Example

NetBurner, Inc.
208 Example Applications

This example will generate a pulse waveform on Timer 11, and capture the waveform on Timer 7. The timer 11
output is on P2.28, and the timer 7 capture is on P1.4. You will need to add a jumper between these two pins. After
the capture is complete, the frequency and duty cycle of the captured waveform will be displayed.
This is a good example to demonstrate how to:

• Learn the structure of the SAME70 Timer Counter peripheral

• Produce a pulse output waveform of various frequencies and duty cycles

• Capture and count waveform pulses

• Implement a peripheral interrupt service routine

SAME70 Timer Architecture

• There are a total of 12 16-bit timers, numbered 0 - 11.

• They are divided up into 4 blocks. Each block is called a Timer Counter: TC0, TC1, TC2, TC3.

• Each timer within a Timer Counter block is called a Timer Counter Channel. While the timers number from
0 to 11, each Timer Counter Channel within a Timer Counter block is numbered from 0 to 2. For example,
Timer Counter Channel 11 is in Timer Counter group TC3, with Timer Counter Channel number 2.

• While all Timer Counter Channels can be used, not all signal pins are brought out to the headers on the
MODM7AE70. The table below describes the header pinout.

• The diagrams in the Timer Counter (TC) section of the SAME70 Reference Manual describe the structure of
the Timer Counters.

11.30.50 Timer Waveform Output


Supported Platforms: MODM7AE70
Timer Counter Waveform Output Example
This example will generate a pulse waveform on Timer 11. The timer 11 output is on P2.28.
See also: Timer Waveform Capture example.
This is a good example to demonstrate how to:

• Learn the structure of the SAME70 Timer Counter peripheral

• Produce a pulse output waveform of various frequencies and duty cycles

SAME70 Timer Architecture

• There are a total of 12 16-bit timers, numbered 0 - 11.

• They are divided up into 4 blocks. Each block is called a Timer Counter: TC0, TC1, TC2, TC3.

• Each timer within a Timer Counter block is called a Timer Counter Channel. While the timers number from
0 to 11, each Timer Counter Channel within a Timer Counter block is numbered from 0 to 2. For example,
Timer Counter Channel 11 is in Timer Counter group TC3, with Timer Counter Channel number 2.

• While all Timer Counter Channels can be used, not all signal pins are brought out to the headers on the
MODM7AE70. The table below describes the header pinout.

• The diagrams in the Timer Counter (TC) section of the SAME70 Reference Manual describe the structure of
the Timer Counters.

11.30.51 Chaining SAME70 Timers


Supported Platforms: MODM7AE70
Timer Chaining Example
This example will chain timers 9, 10 and 11 to create a 48-bit timer. The output pulse waveform will appear on timer
11, P2.28 on the MODM7AE70.

NetBurner, Inc.
11.30 Platform Specific 209

Warning

P2.28 on the NetBurner MOD-DEV-70 development board also goes to the SD Flash socket. The socket must
be empty for this example to run properly.

See also: Timer Waveform Capture example.


This is a good example to demonstrate how to:

• Learn the structure of the SAME70 Timer Counter peripheral

• Produce a pulse output waveform of various frequencies and duty cycles

SAME70 Timer Architecture

• There are a total of 12 16-bit timers, numbered 0 - 11.

• They are divided up into 4 blocks. Each block is called a Timer Counter: TC0, TC1, TC2, TC3.

• Each timer within a Timer Counter block is called a Timer Counter Channel. While the timers number from
0 to 11, each Timer Counter Channel within a Timer Counter block is numbered from 0 to 2. For example,
Timer Counter Channel 11 is in Timer Counter group TC3, with Timer Counter Channel number 2.

• While all Timer Counter Channels can be used, not all signal pins are brought out to the headers on the
MODM7AE70. The table below describes the header pinout.

• The diagrams in the Timer Counter (TC) section of the SAME70 Reference Manual describe the structure of
the Timer Counters.

Timer signals on MODM7AE70 header pins:

Timer 0
P2.19 LineB TIOB0
P2.42 Clock TCLK0

Timer 1
P2.16 Clock TCLK1

Timer 2
P2.17 LineA TIOA2
P2.18 LineB TIOB2
P2.20 Clock TCLK2

Timer 5
P1.7 LineB TIOB5

Timer 7
P1.4 LineA TIOA7

Timer 8
P1.6 Clock TCLK8 Note: cannot be used if EBI is enabled
P1.8 LineA TIOA8 Note: cannot be used if EBI is enabled
P2.6 LineB TIOB8

Timer 11
P2.15 Clock TCLK11
P2.28 LineA TIOA11
P2.25 LineB TIOB11

11.30.52 DACC Tone Generator


Supported Platforms: MODM7AE70
Digital to Analog converter (referred to as "DACC" in the SAME70 manuals) example implementing basic DACC
interface and timer triggered conversions.

11.30.53 Watchdog Timer


Supported Platforms: MODM7AE70
The Watchdog example shows how to use the watchdog on the MODM7AE70.

NetBurner, Inc.
210 Example Applications

11.30.54 NANO54415
NANO54415 Platform Examples

• NANO54415 Factory App

11.30.55 NANO54415 Factory App


Supported Platforms: NANO54415
Application that is pre-loaded at the factory. Features include:

• Web server

• FTP server

• EFFS flash file system access to the development board flash card socket

This example requires that you edit the project properties linker settings to add the FatFile library.

11.30.56 MODM7AE70, SBE70LC


Platform specific examples for Microchip ARM SAME70 based products: MODM7AE70 and SBE70LC.

• GPIO Command Server (SAME70)

11.30.57 GPIO Command Server (SAME70)


SUPPORTED_PLATFORMS = MODM7AE70 SBE70LC
This example uses the Command Processor Library to establish a GPIO server that provides external control and
readback functionality for general purpose input/outputs.
The example establishes the GPIO server using a telnet server by default, but it can also be configured to operate
through the serial port or a TCP connection.
A detailed description of the applications features and command set can be found on the application's webpage.
That can be accessed by running the application and accessing the device with a web browser.

11.30.58 SB800EX
SB800EX Platform Examples

• Serial Transceiver Test

• Diagnostic Monitor

11.30.59 Serial Transceiver Test


Supported Platforms: SB800EX
Application to demonstrate how to configure the SB800EX software programmable transceivers.
The SB800EX has the ability to switch between RS-232, RS-422 and RS-485 in software. This means customers
do not need to remove the cover and manually configure jumpers. This is a very simple program demonstrating how
you can modify these settings in your application.

11.30.60 Diagnostic Monitor


Diagnostic Monitor

11.30.61 SOMRT1061
SOMRT1061 Platform Examples

• Analog to Digital (ADC)

NetBurner, Inc.
11.31 PPP 211

11.30.62 Analog to Digital (ADC)


Supported Platforms: SOMRT1061
Simple ADC example implementing basic analog input functions of the SOMRT1061

11.31 PPP
This PPP example shows how to create two PPP server instances.
There are two types of high level connections that can be made with PPP is either direct or modem. A direct
connection is usually performed with only a serial cable connection and will jump right into the PPP negotiations
with the host or client. A modem connection is one where there is a modem between the PC and NetBurner. The
modem PPP functions will send AT commands before any PPP negotiation to initialize the modem.
A good way to test PPP is to create a PPP interface on a computer and make a direct PPP connection to the server.

11.32 Profiler
This is a very simple profiler program. The way the NBRTOS_TIME functions operate is that there is an additional
routine that runs during task switching to record the tick and tickfraction since the task swapped in (runtime since
last change).
This feature has overhead and you normally only use it for development. By default, this example enabled profiling
through the overload folder functionality. To enable profiling in your own application, you can copy the overload
folder in to your application, or following these steps:

1. Edit \nburn\nbrtos\include\prefef.h and uncomment: #define NBRTOS_TIME(1)

2. Rebuild the system libraries


The following functions are now available:
uint32_t GetCurrentTaskTime( uint32_tconst TotalTicks ); Returns the number of time ticks the current task
has run. TotalTicks = the total number of ticks recorded.

void ShowTaskTimes( void );

Print a list of tasks, times and percentages to stdout (normally uart0)

void ClearTaskTimes( void );

Resets all task times to 0

11.33 RTOS
NetBurner RTOS (NBRTOS) Examples:

• OSCrit - Critical Section

• OSFifo - FIFO

• OSFlags

• OSMailbox

• Multiple Task User Input

• OSQueue

• OSSemaphore

• OSTaskCreate

NetBurner, Inc.
212 Example Applications

11.33.1 OSCrit - Critical Section


This example will show how to create critical sections with the standard C type function calls OSCritEnter()
and OSCritLeave(), and compare them to the C++ object type which eliminates the problem of matching each
OSCritEnter() to a corresponding OSCritLeave().
While this example is trivial with only a simple global variable, critical sections need to be used for objects, such as
linked lists, that could be changed by multiple tasks. In such cases, each task would use a critical section to ensure
the modifications could be completed before a task switch occurred.

11.33.2 OSFifo - FIFO


This program creates two tasks and a FIFO. Messages are sentfrom one task to another using the FIFO. A timeout
value for the pend function is used to illustrate the timeout feature of the FIFO.

11.33.3 OSFlags
This illustrates how OSFlags can be used to pend on multiple events. UserMain() creates 3 tasks, each of which
will set a OSFlag after a time delay of some number of seconds. UserMain will then pend and block until ANY of the
3 flags are set. You can also modify the example to pend until ALL of the 3 flags are set.

11.33.4 OSMailbox
This program will create 2 tasks and a mailbox. The UserMain task will block for a mailbox message posted from
MyTask. The output for this example is displayed through the serial debug port, which can be viewed with the
MTTTY program.

11.33.5 Multiple Task User Input


This program illustrates how to create a task and use a mailbox to accept user input from a serial port. This example
also illustrates how to terminate a task

1. UserMain task will wait pend on a mailbox for user input

2. UserInput task will block waiting for a user to type in data from the serial port

11.33.6 OSQueue
Queue Example Program
This program creates two tasks and a Queue. Messages are sentfrom one task to another using the Queue. A
timeout value for the pend function is used to illustrate the timeout feature of the FIFO.

11.33.7 OSSemaphore
This program will create 2 tasks and a semaphore. The UserMain task will block for a semaphore posted from My←-
Task. The output for this example is displayed through the serial debug port, which can be viewed with the MTTTY
program.

11.33.8 OSTaskCreate
This example demonstrates how to use two of the task creation functions:

• OSSimpleTaskCreatewName()

• OSTaskCreatewName()

NetBurner, Inc.
11.34 Save to User Parameter Flash 213

11.34 Save to User Parameter Flash


The User Parameter Flash functionality was introduced in the NetBurner 2.x tools. The preferred method for non-
volatile storage and settings in the 3.x tool set is the Configuration Server, which provides for multi-platform web
access, application access and JSON capabilities. All of these methods are configurable. Please see the configu-
ration users guide and the configuration examples for more information.
In contrast, the User Parameter Flash is a sector of flash memory set aside to be used as raw bulk storage. In
situations such as bulk binary storage, or porting a 2.x application to 3.x with minimal changes, this method of
storage can be useful.
This example to demonstrates how to read and write data to the on-board flash memory User Parameter Area. The
amount of flash space is equal to one flash sector, which will vary from 8k bytes to 64k bytes depending on your
platform.
Warning: Data corruption can occur under the following circumstances:

1. If power is interrupted during the flash programming process. We strongly recommend that UserParameters
are not written immediately upon power-up, since it is not uncommon for a user to cycle a power switch on/off
quickly every once in a while.

2. Your application writes beyond the UserParameter size allocated for your platform (8k or 64k). In this situation
the application may be corrupted.

Important notes on packed versus integer alignment when using structures and classes: This example uses a
structure named NV_SettingsStruct, which consists of types that are 8, 16 and 32 bits long. If you do not add an
attribute tag at the end of the structure, the default will be integer-aligned (32-bits in this case). This means that
padding will be added to ensure each member will be on an integer boundary.
While this can increase execution speed, it also means that the stored data will be a bit larger, and doing something
like an overlay or indexing into the structure with a pointer will not work correctly. To tell the compiler not to use
any padding, add __attribute__((packed)); to the end of the structure definition as demonstrated in this
example. Be aware that when using a packed structure elsewhere in your application, access is packed as well.

11.35 Serial
Serial Port Examples:

• Dual TCP To Serial

• Serial To Ethernet

• Serial HTTP Get Request

• Serial Receive Callback

• Serial to Serial

• TCP to Serial

11.35.1 Dual TCP To Serial


This sample application connects two serial ports to two different TCP ports, and continuously transfers data be-
tween them. In other words, you have a dual serial-to-Ethernet device. An easy way to test this operation is to open
two telnet sessions and two MTTTY sessions as shown below. To start a telnet session on a windows pc, open a
command prompt and type telnet 10.1.1.2 2000, where you would replace 10.1.1.2 with the IP address of
your NetBurner device.
Telnet on port 2000 >--------—< MTTTY on serial port 0
Telnet on port 2001 >--------—< MTTTY on serial port 1
Now anything you type in the first telnet session will be sent to serial port 0, and vice versa. Anything you type in
the second telnet session will be sent to serial port 1 and vice versa.

NetBurner, Inc.
214 Example Applications

11.35.2 Serial To Ethernet


This program is designed to connect a RS-232 device to a network. It opens a serial port and an Ethernet port, then
connect them.This allows any data sent to the Ethernet port to be forwarded to the serial port, and vice versa.
A connection timeout is used to check for link activity, and the connection will be closed if the timout expires. The
timeout value is set with TIMEOUT_LIMIT. A value of 0 will disable the timeout feature.
Only one connection is allowed at a time. Additional client connections will be queued, and serviced as the active
connection completes.
Override Timeout: When a new TCP connection is attempted while there is already an active connection, one of 3
actions can be taken:

1. Don't ever disconnect the active connection. Set OVERRIDE_TIMEOUT to 0xFFFFFFFF.

2. Only disconnect the existing connection if it has been idle for x seconds. Set OVERRIDE_TIMEOUT to the
number of seconds.

3. Always disconnect the existing connection. Set OVERRIDE_TIMEOUT to 0.

11.35.3 Serial HTTP Get Request


Example of sending a HTTP GET request through serial port when running a serial to Ethernet application.
Hardware Configuration:
Serial Device <–serial--> NetBurner Serial to Ethernet Device <–ethernet--> Internet
In this example we will be using a SB800EX as the "Serial Device", but this would typically be a microprocessor or
FPGA with a UART that needs to communicate over a network. The source code in this file is an example of what
you would need to implement in your own microprocessor to send a GET request through a NetBurner device to
some other device on the network/Internet runnig a web server.
The code in the main.cpp source file was tested with the SB800EX, but should work with any of the NetBurner
standard devices. A serial cable was connected from port 1 of the SB800EX to port 1 of the SBL2e development
board. Since the SBL2e development board DB9 connector is cross-wired for RX and TX, all you need is a straight
through serial cable.
SB800EX <–serial--> SBL2e <–ethernet--> Internet
The web page contacted is myip.dnsdynamic.com, which return the IP address of the HTTP GET request.
Software Configuration for SBL2e, serial port 1:
Running the SBL2e factory serial to Ethernet application. This was done through the web page, but you can also
do it through serial AT commands.

1. Incoming TCP Settings: Uncheck Listen for Incoming Network Connections

2. Outgoing TCP Settings: Make outgoing connections: If serial data received

3. Outgoing TCP Settings: Connect on network port: 80

4. Outgoing TCP Settings: Connect to this address: myip.dnsdynamic.com

11.35.4 Serial Receive Callback


Demonstrates how to register a callback function to intercept system serial port receive processing.

11.35.5 Serial to Serial


This simple program opens both serial ports and sends data from one to another using the select() function, which
can pend on multiple file descriptors at one time.
The serial ports are initialized by the monitor in polled mode. To enable buffered interrupt driven mode, the serial
ports are closed and then reopened with OpenSerial().

11.35.6 TCP to Serial


This is a very simple TCP to Serial example. It listens on a TCP port for a single incoming connection. Once a TCP
connection is accepted, all data recevied will be sent out the serial port, and all data recevied by the serial port will
be sent out the TCP connection.

NetBurner, Inc.
11.36 Serial Webserver 215

A simple way to test this program is to use the Telnet program on a PC and connect to the NetBurner device. Telnet
is available to run from a command prompt, or with a program such as PUTTY.
If you would like to extend this example and create a robust Serial To Ethernet application, the next step would be
to add error detection and timeouts to handle a situation such as the TCP client crashing or going away without a
proper TCP close connection sequence. That would result in a half open socket condition and the NetBurner device
would have no way of knowing what happened.
To help combat situations such as these this application takes a simple approach of closing the connection is no
activity has taken place for a period of time.

11.36 Serial Webserver


The Serial Webserver is a simple example demonstrating receiving and replying to HTTP requests over a serial
port, using the NetBurner web server implementation. The example will display a "Hello World" type message on
the device's index page: index.html.
An valid HTTP GET request that is compatible with this application is the following:

Note

The webserver expects a double carriage return line feed

‘GET /INDEX.HTML HTTP/1.1\r\n\r\n‘

The expected response should look similar to the following:


HTTP/1.0 200 OK
Pragma: no-cache
MIME-version: 1.0
Content-Type: text/html
Content-length: 231
<html>
<head><link rel="stylesheet" type="text/css" href="style.css"></head>
<body>
<a href="http://www.netburner.com"><img src="logo.jpg" width="200" height="104" border="0"></a>
<h1>Thank you for NetBurning!</h1>
</body>
</html>

11.37 SHA1 Digest


Calculate the SHA1 128-bit digest on an application. To display the digest when building the application in NBE-
clipse, go to the project properties and add -D to the compcode flags.

11.38 Show Network Interfaces


Example program to display IPv4 and IPv6 address information on both the serial port and on a web page. The web
page will also display the addresses as links that can be clicked on to view the web page using the respective IP
addresses, such as IPv4, IPv6 and AutoIP.

11.39 SOCKS5 Client


This program demonstrates how to create a client connection using the SOCKS5 protocol. This protocol is detailed
in RFC 1928. The NetBurner libraries support no authorization and plain text username/password options, and
provide a callback for the user to implement their own version of GSSAPI, AuthWithGssApi(). This function can be
overridden to implement GSSAPI according to specific requirements.
To test this, you can use a Docker image that will run a SOCK5 server, found here: https://hub.←-
docker.com/r/serjs/go-socks5-proxy/

11.40 SPI
These SPI examples are common to all the 3.x platforms. However, there are additional SPI examples in the
Platform Specific examples section. such as the MODM7AE70 QuadSPI and USART SPI peripherals.

NetBurner, Inc.
216 Example Applications

• DSPI Multiplex

• Serial to SPI

11.40.1 DSPI Multiplex


This example demonstrates how to use the DSPIModule, object based DSPI driver, to use multiple bus config-
urations on the same DSPI hardware module without having to re-initialize the driver every time when switching
configurations.

11.40.2 Serial to SPI


The Serial to SPI example demonstrates the basic configuration of the SPI driver and sending and receiving data
over an SPI interface.

11.41 SSH
Secure Shell (SSH) Examples:

• SSH Server

• SSH Server with User Key

• SSH Client

• SSH Server with User Authorization

• SecureSerToEthFactoryApp

11.41.1 SSH Server


SSH Minimal Server Example
A SSH Server task is created that will listen for incoming SSH connections on TCP port 22. This simple example
uses the SSH key stored in the NetBurner library.
To use the example:

• Compile and load the application into your NetBurner device.

• Run MTTTY and connect to USB or Serial port to view status messages and send data to the SSH Client.

• Run a SSH Client like Putty, and connect to the NetBurner device.

11.41.2 SSH Server with User Key


This example demonstrates how to use the NetBurner SSH library to create a SSH server that can utilize the SSH
library key, user application compiled-in key and upload a user supplied key.
Please refer to the pdf documentation in the example directory for detailed information.

11.41.3 SSH Client


This example shows how to run a minimal SSH client application. This application will try to create an SSH connec-
tion to the server with the IP address defined by SSH_SERVER_NAME. Upon connection, it will read data from the
server until the connection is closed.
To use the example:

• Find an SSH server that you'd like to connect to, and set the IP address as SSH_SERVER_NAME.

• Compile and load the application into your NetBurner device.

• Run MTTTY and connect to USB or Serial port to view status messages and send data to the SSH Client.

NetBurner, Inc.
11.42 SSL/TLS 217

11.41.4 SSH Server with User Authorization


SSH Server with User Authorization Example
A SSH Server task is created that will listen for incoming SSH connections on TCP port 22. This simple example
uses a key that is generated onboard the device the first time it is powered on. This key will be valid for one year.
To allow the certificate to automatically renew when it's expired, enable ENABLE_AUTOCERT_REGEN, found in
nbrtos\include\predef.h.
This example demonstrates how to user the UserAuthManager, which will let you maintain user password/key
information that can be used when authenticating users trying to log on to your device. In this example, we store
the data in the UserParam space, but the UserAuthManager will let you determine where that information is saved
and loaded from with the callbacks that are passed into the object during construction.
To use the example:

• Compile and load the application into your NetBurner device.

• Run MTTTY and connect to USB or Serial port to view status messages and send data to the SSH Client.

• Run a SSH Client like Putty, and connect to the NetBurner device.

11.41.5 SecureSerToEthFactoryApp
This program is designed to connect a serial device to a network. When using RS-232 or RS-485, the application
basically opens a serial port and an Ethernet port, then connects them. This allows any data sent to the Ethernet
port to be forwarded to the serial port, and vice versa. When using I2C, the program creates a dedicated TCP
server for Ethernet-to-I2C communication.

1. Only 1 connection is allowed at a time on each serial port. Additional client connections will be queued and
serviced as the active connection completes.

2. Override time-out: When a new TCP connection is attempted while there is already an active connection, one
of 3 actions can be taken:

(a) Do not disconnect the active connection.


(b) Only disconnect the existing connection if it has been idle for a number number of seconds, as specified
by the "Allow new connection... X seconds" field.
(c) Always disconnect the existing connection. Configure "Allow new connection..." to '0'.

11.42 SSL/TLS
SSL/TLS examples. Note that all references to SSL represent TLS.

• FTPS Server

• HTML File Post

• HTML Form Post

• HTTPS Dual Cert

• HTTPS Upload Cert

• HTTPS Web Server Demo

• HTTPS GET Request

• SSL/TLS Client

• SSL/TLS Client Certificate

• SSL/TLS Client Verify Peer - Basic

• SSL/TLS Client Verify Peer - EFFS-STD

• SSL/TLS Onboard Self-signed Certificate Generation

NetBurner, Inc.
218 Example Applications

• SSL/TLS Receive Mail (POP3)

• SSL/TLS Send Mail

• SSL/TLS Send Mail w/ Attachment

• SSL/TLS Send Mail w/ EFFS Attchment

• SSL/TLS Server

• HTTPS Configuration Mirror

11.42.1 FTPS Server


This example will create a simple FTPS Server running on the NetBurner device. The server will start and wait for a
FTPS client connection on port 990. The goal of this example is strictly the encryption aspect; it can be extended to
use the file systemZby combining it with the Embedded Flash File System (EFFS) examples, EFFS-FAT or EFFS-
STD.
The server provides two functions:

1. Allows the FTPS Client to download a single file named ReadFile.txt

2. Allows the FTPS Client to upload a text file named WriteFile.txt, which will be displayed on the serial port. It
is not stored since this simple examle does not use the file system.

The server uses a built in self-signed certificate and key. Status messages, including sockets in use, are displayed
on the serial port.
To run the example:

• Run MTTTY and connect to the debug serial port

• Run a program such as WinSCP that supports FTPS (not SFTP)

• Connect to the FTPS Server on the NetBurner device

• Select the ReadFile.txt file to download or view it

• Select the WriteFile.txt file in the FTPS Client and send it to the FTPS Server on the NetBurner device. It will
be displayed on the serial port

11.42.2 HTML File Post


This example presents a web page with a field for selecting a file to upload to the NetBurner device. When the
"Send File" button is selected, the upload is performed. The uploaded file is then displayed on the web page. A
quick test is to send this example's ReadMe.txt file.
This example is similar to the examples\web\HtmlFilePost, with the addition of SSL/TLS capability.
Browsers are starting to require a valid certificate on the device, as well as the installation of the Certificate Authority
(CA) certificate installed in the browser for self-signed certs. Receiving a warning message in the browser and
selecting the option to continue anyway may work for variables posted in a form, but it will not work when posting a
file.

11.42.3 HTML Form Post


• Similar to the HtmlFormPost in the examples\web folder, but works with SSL/TLS

• Uses the HTML POST command (the other is HTML GET) to send HTML form data from a web browser to
the NetBurner device.

• Illustrates the use of the NetBurner POST callback objects, named postForm1 and postForm2 in this
example, to intercept and process HTML Post data.

• Demonstrates how to handle multiple web pages with HTML forms and content delivery using the library
functions SendFullResponse() and RedirectResponse().

NetBurner, Inc.
11.42 SSL/TLS 219

11.42.4 HTTPS Dual Cert


HTTPS Server Example for multiple certificates
Supported Platforms: MODM7AE70, SBE70LC, MOD5441X, NANO54415, SBE70LC
This example creates a web page that can be viewed as normal or encrypted with SSL/TLS. An example certificate
is included in DEVICE.CRT and DEVICE.KEY. Load these files on the flash card prior to the device booting up.
Since this is an example cert, the web browser will display warning messages to this effect. For this example select
the "continue to page" options to allow the HTTPS for a single session.
In addition this example illustrates how to have both a permanent compiled-in certificate and key, as well as one that
can be loaded from an external Flash card using the EFFS FAT file system. If a certificate and key are present on
the Flash card named DEVICE.CRT and DEVICE.KEY, they will be used instead of the local, compiled-in certificate
and key.
If you are using NBEclipse, then you will also need to tell the linker to include the FatFile.a library. To do this,
complete the following steps:

• In NBEclipse, right-click on your project, and select "Properties"

• Select "C/C++ Builds -> Settings" on the left-hand side

• Select "GNU C/C++ Linker -> Libraries" under the "Tool Settings" tab

• In the "Libraries" list box, add "FatFile" by using the action icons provided in top-right corner of the list box

Example Features:

• Compiled-in certificate and key

• Optional Flash card certificate and key

• NTP client to set the time

• FTP to enable the upload of a certificate and key to a Flash card

• Flash card test code to verify the card can be read/written to

• Web page and links to load a HTTPS or HTTP version

11.42.5 HTTPS Upload Cert


This program demonstrates how to upload a user certificate and key to support SSL/TLS web page access. The
uploaded certificate and key are stored in the on-chip flash memory using the standard file system (EFFS-STD).
The serial port provides status messages on the application operation.
The application has a built-in certificate and key, ServerCert.cpp and ServerKey.cpp, to provide security before
before a user certificate and key are installed. You can generate a certificate and key by your own method, or
using the makeca and makeserver scripts found in <nndk_install>\CreateCerts\<ECDSA or RSA>.
The Certificate Authority is createed by makeca, which is then used to sign the server certificate and key with
makeserver.
The display on the web interface will indicate whether you are using the compiled certificate and key (listed as
"Default"), or the uploaded version (listed as "User Installed").
To run the example:

• Create a server certificate and key

• Run MTTTY to view status messages on the serial port

• Open the web page in a browser, which will be using the compiled in certificate and key if this is the first time

• Use the web interface to upload your own certificate and key

Note

Browsers are starting to require a valid certificate on the device, as well as the installation of the Certificate
Authority (CA) certificate installed in the browser for self-signed certs. Receiving a warning message in the
browser and selecting the option to continue anyway may work for variables posted in a form, but it will not
work when posting a file.

NetBurner, Inc.
220 Example Applications

11.42.6 HTTPS Web Server Demo


SSL/TLS Server example program with web page redirection for unauthorized access. The example demonstrates
how you can have both secure and non-secure access to files and directories.
The application starts the web server with SSL/TLS capability. The directory structure is such that index.html and
the files in the images subdirectory can be viewed with a http or https connection. However, files in the httpsdir
directory (ie repeat.html) can only be viewed with a secure https connection.

html
|-- index.html
|-- images
|-- (various image files)
|-- httpsdir
|-- repeat.html

The HTTP_ACCESS CheckHttpAccess(int sock, int access_level, HTTP_Request &Req)


function is used to authenticate the web page access. It will allow access or redirect depending on the file and
access rights.

11.42.7 HTTPS GET Request


This example demonstrates how a SSL/TLS Client can retrieve a web page from a HTTPS server.

• Run the MTTTY serial terminal

• When the application starts there will be a prompt to enter a HTTPS web site name (eg. www.google.com)

• The retrieved web site data will be displayed as text in MTTTY

11.42.8 SSL/TLS Client


SSL/TLS Client Example
This example demonstrates how SSL/TLS Client connections can be made. It will attempt to connect to the specified
SSL Server and keep track of the number successful and failed attempts. Status messages will be sent to both the
SSL/TLS Server, and to the serial debug port on the NetBurner device.
You must modify the SSL_SERVER_NAME to match your SSL Server device.
Testing: One method of testing a SSL/TLS client is to use openssl s_client. A typical command to start the
server at the time of this writing is: openssl s_server -accept 4433 -cert Server.crt -key
Server.key
Where you supply the .crt and .key files created by the NetBurner tools, OpenSSL, or through a Certificate Authority.
For more information please refer to the openssl s_server documentation online.
Certificate checking is disabled by default. To enable certificate checking you must:

1. Include a CA certificate list in your project

2. Uncomment #define NB_SSL_CLIENT_CERTIFICATE_CHECKING_ENABLED in sslclient.cpp

3. Rebuild the system libraries

11.42.9 SSL/TLS Client Certificate


PROGRAM DESCRIPTION: SSL Client Certificate Example
This example demonstrates:

1. How SSL Client connections can be made.

2. How to load and use Client Certificates.

3. This example will only work if you are connecting to a SSL server that is configured to request and receive
client certificates. In this example the client certificate is compiled as part of the application.

The application will attempt to connect to the specified SSL Server and keep track of the number successful and
failed attempts. Status messages will be sent to both the SSL Server, and to the serial debug serial port on the
NetBurner device.

NetBurner, Inc.
11.42 SSL/TLS 221

IMPORTANT: A Client Certificate is a very different thing than when a client checks a server certificate against a list
of Certificate Authorities (CA):
Certificate Checking against a CA: In this mode the Client will check the CA portion of the server certificate against a
list of CA's maintained by the client. If the CA's match, the connection is allowed. This mode requires a modification
to predef.h to enable client certificate checking. This is NOTthe purpose of this example application.
Sending a Client Certificate to the Server: In this mode, in addition to the server sending a certificate to the client
as in the above case, the client is required to send a certificate to the server. That is the purpose of this example
application.
CREATING A CERTIFICATE AND CA: Please refer to the NetBurner Security Library documentation for a detailed
description. For the convenient of this example, we have created one for you.

11.42.10 SSL/TLS Client Verify Peer - Basic


This program will demonstrate how to use CA Lists for use in support of peer verification. One certificate is defined
in caList.h. This is the root certificate for GitHub. They are passed into the call to SSL_connect(), and the verify
peer parameter in that function is set to true.
To test this example, use the command 'C' at the debug prompt, and then type the name of the site that you wish to
test a connection to.

11.42.11 SSL/TLS Client Verify Peer - EFFS-STD


This program will demonstrate how to upload CA Lists to use in support of verify peer. The uploaded information is
stored in the onchip flash memory using the standard file system. The serial port provides a debug menu.
We include github.pem with this example to use for your testing. Load this file onto the device through the web
interface and then try to connect to GitHub.com through the serial menu. You should see a message stating that
there's a good SSL connection if it's successful.

11.42.12 SSL/TLS Onboard Self-signed Certificate Generation


SSL/TLS Examples for Onboard Certificate Generation

• On-board Cert Generation - Simple

• On-board Cert Generation - Advanced

• On-board Cert Generation - Compiled Certificate Authority

11.42.12.1 On-board Cert Generation - Simple

This example shows how to enable auto-generation of self-signed certificates. The certificate will enable secure
communication to the system configuration web server and the HTTPS web server of the application. On-board
generation of certificates are an alternative to creating your own self-signed certificates and uploading them to
your NetBurner device. This simple example should cover most use cases. Please refer to the other examples for
additional functionality.
Auto-generated certificates will operate as follows:

• If enabled and no certificate exists, a certificate will be created on first call to SSL_accept() or SslInitServer().

• The Common Name (CN) will be the IP address of the device. Alternate names are also supported.

• The application must ensure it has the correct system time, otherwise the certificate dates will be invalid.

• Calling the function EnableOnboardCertificateCreation() enables certificate generation.

• If ENABLE_AUTOCERT_REGEN is defined in predef.h, the certificate will update when it expires, creating a
new 1 year certificate. Generation will occur on next SSL/TLS access.

• If ENABLE_AUTO_CERT_REGEN is defined in predef.h, AUTO_CERT_GEN_CHECK will dictate how fre-


quently a certificate is checked for expiration. The default value is one minute.

• The certificate will update if the IP address changes to handle environments such as DHCP address assign-
ments.

NetBurner, Inc.
222 Example Applications

If the system time is incorrect, the certificate will be invalid.


Additional Examples:
Examples of a HTTPS server with a compiled-in certificate:

• <NNDK install>\examples\ssl\sslserver

• <NNDK install>\examples\ssl\SslWebDemo

Examples of uploading a certificate/key pair manually:

• <NNDK install>\examples\ssl\HttpsDualCert

• <NNDK install>\examples\ssl\HttpsUploadCert

11.42.12.2 On-board Cert Generation - Advanced

Please refer to the ReadMe.txt for the Simple version of this example for an operational description of the On-board
certificate generation feature.
The simple auto-generate self-signed certificate example is what is normally used in applications. This example
provide advanced options, such as interactive control to:

• Generate the certificate

• Delete the certificate

• View certificate expiration date

• Check for a valid certificate

• Manually enter the system time

11.42.12.3 On-board Cert Generation - Compiled Certificate Authority

Please refer to the ReadMe.txt for the Simple version of this example and for an operational description of the
On-board certificate generation feature.
The simple auto-generate self-signed certificate example is what is normally used in applications. This example pro-
vides advanced users with a demonstration of how to write their own onboard certificate generation function. This
includes signing the generated certificate with a compiled in Certificate Authority cert. To understand how to gener-
ate Certificate Authority certificate as well as how to compile it into your program, please see our documentation on
creating self-signed certificates, found in the Programmers Guide.
For any network device, if you generate your own Certificate Authority (CA), you must accept responsibility for the
security of the CA certificate. If a malicious party obtains your CA from the device or any other means, they would
be able to use it to create their own "trusted" certificate and access your devices. This may be less of an issue if
you are operating on a closed/private network, rather than devices on the Internet.
Taking full advantage of this example will also require some familiarity with the wolfSSL API.

11.42.13 SSL/TLS Receive Mail (POP3)


This example demonstrates how to implement retrieving email from a server that requires SSL/TLS.
When trying to connect to a Google Account, you will likely need to enable less secure application access.
If you use two-factor authentication with your account, you will need to setup an application password for the
account being connected to. This can be done at the following URL: https://myaccount.google.←-
com/apppasswords
Note that when setting this up, it will tell you that you do not need to save the password. For this example, this is not
the case. The application password is not stored anywhere, and will need to be reentered for every request.

11.42.14 SSL/TLS Send Mail


This program illustrates how to send an email message to a server that uses SSL/TLS.
All the magic happens in the webfuncs.cpp file, this code just initializes the app
Note that this application uses a secure SSL/TLS connection when accessing the web server. All connections made
through it will need to take place via HTTPS.

NetBurner, Inc.
11.42 SSL/TLS 223

There are two ways the SSL/TLS SMTP handshake can happen, with or without "STARTTLS". With servers that
don't require STARTTLS, all that needs to be done differently than a regular SMTP handshake is to connect using
"SSL_connect" to port 465 or 587 (instead of a regular connect to port 25), and from there proceed like a normal
SMTP handshake. This method is used when we know for sure the server accepts SSL/TLS mail and we definitely
want to use SLL (since some server like Yahoo allow you to connect in both ways).
If we are not sure if a server supports SSL/TLS, or, we only want to use SSL/TLS if it is required, we use the
STARTTLS method. With this method, the send_mail function first opens a connection to the regular SMTP port 25
and does an "EHLO". if the server has the key word "STARTTLS" in its response, it means that it supports TLS, from
there, the client says "STARTTLS" and then calls the SSL_negotiate function which establishes a secure connection
with the server. After the secure connection is established, we say "EHLO" again and proceed as normal.
Gmail requires SSL/TLS, so if we try to connect to it on port 25 (the non SLL port) it will say STARTTLS without
giving the option AUTH, which means SSL/TLS is required and we must start the SSL/TLS negotiation. Yahoo
allows both, but but does not offer STARTTLS. This means that it doesn't let you know that SSL/TLS is available if
connected to on the regular SMTP port, it expects you to connect to port 465 or 587 if you want to use SSL/TLS,
and port 25 for non SSL/TLS.
When trying to connect to a Google Account, you will likely need to enable less secure application access.
If you use two-factor authentication with your account, you will need to setup an application password for the
account being connected to. This can be done at the following URL: https://myaccount.google.←-
com/apppasswords
If you are using NBEclipse, then you will also need to tell the linker to include the /nburn/platform/<platform>/original/
StdFFile.a library. To do this, complete the following steps:

• In NBEclipse, right-click on your project, and select "Properties"

• Select "C/C++ Builds -> Settings" on the left-hand side

• Select "GNU C/C++ Linker -> Libraries" under the "Tool Settings" tab

• In the "Libraries" list box, add "StdFFile" by using the action icons provided in top-right corner of the list box

11.42.15 SSL/TLS Send Mail w/ Attachment


Send an email with a plain text attachment
Note that this application uses a secure SSL/TLS connection when accessing the web server. All connections made
through it will need to take place via HTTPS.
This example illustrates how to send a MIME email attachment in plain text, without using the EFFS FAT32 file
system (there is a different example for EFFS). Once the example is running, all interaction is done through the web
page.
When trying to connect to a Google Account, you will likely need to enable less secure application access.
If you use two-factor authentication with your account, you will need to setup an application password for the
account being connected to. This can be done at the following URL: https://myaccount.google.←-
com/apppasswords
The default STMP port value will be set to 465 for a connection using SSL/TLS. This example is not structured to
handle a STARTTLS response. Please see the SslSendMail example for more information.

11.42.16 SSL/TLS Send Mail w/ EFFS Attchment


Supported Platforms: MOD5551X, NANO54415, MODM7AE70, SBE70LC
This example demonstrates how to attach files from the EFFS FAT32 file system to an email. Once the program
starts, all interaction is done from the web page.
Note that this application uses a secure SSL connection when accessing the web server. All connections made
through it will need to take place via HTTPS.
When trying to connect to a Google Account, you will likely need to enable less secure application access.
If you use two-factor authentication with your account, you will need to setup an application password for the
account being connected to. This can be done at the following URL: https://myaccount.google.←-
com/apppasswords
The default STMP port value will be set to 465 for a connection using SSL/TLS. This example is not structured to
handle a STARTTLS response. Please see the SslSendMail example for more information.

NetBurner, Inc.
224 Example Applications

11.42.17 SSL/TLS Server


This program will create a SSL/TLS server task that uses Elliptic Curve Cryptographic (ECC) keys. To test the
application you can use another NetBurner device configured as a client, or openssl. The command line options for
openssl as of 13-Nov-2018 are: openssl s_client -cipher ECDHE-ECDSA-AES256-GCM-SHA384
-connect <ip address>:<port>
For example: openssl s_client -cipher ECDHE-ECDSA-AES256-GCM-SHA384 -connect
10.1.1.191:8883
If you need an RSA key for your specific application needs, you can generate them using the scripts found in
\nburn\CreateCerts\RSA. Just replace ServerKey.cpp and ServerCert.cpp in this example with those that
you generate from the scripts and rebuild the application. You can test this with the following OpenSSL commands.
openssl s_client -connect <ip address>:<port>
For example: openssl s_client -connect 10.1.1.191:8883
This example uses a simple read() function to receive data from a TCP client.

11.42.18 HTTPS Configuration Mirror


SSL/TLS Server example program with web page redirection for unauthorized access. The example demonstrates
how you can have both secure and non-secure access to files and directories.
The application starts the web server with SSL/TLS capability. The directory structure is such that index.html and
the files in the images subdirectory can be viewed with a http or https connection. However, files in the httpsdir
directory (ie repeat.html) can only be viewed with a secure https connection.

html
|-- index.html
|-- images
|-- (various image files)
|-- httpsdir
|-- repeat.html

The HTTP_ACCESS CheckHttpAccess(int sock, int access_level, HTTP_Request &Req)


function is used to authenticate the web page access. It will allow access or redirect depending on the file and
access rights.

11.43 Stack Protection


Demonstrate various stack overflow/underflow protection methods.
To run this example, the following lines must be uncommented in \nburn\nbrtos\include\predef.h to
enable stack checking features:

#define NBRTOS_STACKCHECK (1)


#define NBRTOS_STACKOVERFLOW (1)
#define NBRTOS_STACKUNDERFLOW (1)

11.44 Syslog
The Syslog utility enables you to send logging information to a destination host computer using UDP (port number
514). This example uses syslog to send a simple counting variable to a host computer.
To run the example:

1. Verify you have proper network communication with you NetBurner device. It must have an IP address and
mask.

2. Modify the source code line: SysLogAddress = AsciiToIp("10.1.1.191"); so that it specifies


the address of your computer. If this line is commented out and no SysLogAddress is specified, then the
syslog data will be sent as a UDP broadcast.

3. Run the NetBurner "UDP Terminal Tool" application. Make sure the local listening port field is set to 514, the
default syslog port.

4. Download and run the application on your NetBurner device.

NetBurner, Inc.
11.45 System Diagnostics 225

11.45 System Diagnostics


By including the function EnableSystemDiagnostics() in your application, you can view system diagnostic
information by going to the device's Configuration Server web page and clicking on the "Diagnostics" button.
This example demonstrates how to add your own additional variables to the diagnostic display, such as application
integers, floats, strings, definitions, etc. To do so:

• Add #include <diagnostics.h>

• Declare the corresponding DiagVarMon() function. For example, to add an integer variable myInt you
would declare: static DiagVarMon MyIntMon("My Int", myInt); The first parameter is the
name or description you wish to use to identify the variable.

11.46 TCP
TCP Examples:

• TCP No Block Connect Test

• TCP Keepalive

• TCP Client

• Multiple TCP Interface Test

• TCP Multi-Socket Server

• TCP Resource Information

• TCP Server

• TCP Server Using Via

• TCP Speed Test

• TCP Stress Test

11.46.1 TCP No Block Connect Test


The standard TCP connect call will block until the connection is either made or fails. The non-blocking connect call
will initiate a TCP connection and return immediately.

11.46.2 TCP Keepalive


This example program will create a TCP server that also implements keep alive functionality with the TCP client.
Keep-alive is implemented with the TcpGetLastRxTime() and TcpSendKeepAlive() functions.
TcpGetLastRxTime() returns the number of time ticks since the last time a packet was received.
TcpSendKeepAlive() sends a keep-alive packet to the client, which is used when no data is has been
transmitted within the timeout period.
The general concept is to call TcpGetLastRxTime(), call TcpSendKeepAlive(), wait a bit, then call
TcpSendKeepAlive() a second time and verify the number of time ticks is different. If not, no packets were
received and the client is not responding. Make sure to allow time for the client to respond to the keep alive packet.
Do not call TcpGetLastRxTime more often than once every second to avoid performance issues.
This example creates a TCP server task that listens on port 23 by default. The server blocks with "ReadWithTime←-
Out" until data is received or the timer times out. If a timeout occurs the time of the last received packet is recorded
and a keep-alive packet is sent. Then, the server goes back to waiting for a read again. If ReadWithTimeOut times
out a second time, the value of the last received TCP packet is checked again. If the client is still active the value of
lastRxTime will be different than the previous value (due to the keep-alive packet that was sent). If the client did not
respond to the keep-alive packet the number will remain the same and the client is assumed to be non-responsive,
and the connection is closed.
To test the application you can use a TCP client such as telnet or putty. For example, from a windows command
prompt, type telnet <ip address of NetBurner>. Status messages are sent to the debug/console
serial port.

NetBurner, Inc.
226 Example Applications

11.46.3 TCP Client


This program demonstrates how to create a TCP Client. All interaction is through the web page interface, which
enables you to type a message as well as the IP address and port number of the destination TCP server. You
should be able to use any TCP server. If you do not have one, we have a windows example TCP server in the
\nburn\pctools\TCP\TcpServerWin directory (as well as source code).

11.46.4 Multiple TCP Interface Test


TCP Multiple Interface Test

11.46.5 TCP Multi-Socket Server


This example creates a TCP server that listens on the specified TCP port number and can handle multiple TCP
connections simultaneously (10 in this example). The select() function is a great way method to pend and process
multiple connections.
An easy way to test the example is to use multiple Telnet sessions to create simultaneous connections to the Net←-
Burner device. Status messages are sent out stdio to the debug serial port, and to the client TCP connections.

11.46.6 TCP Resource Information


This example demonstrates the use of functions to obtain the number of free system buffers and the number of free
network sockets. A socket will be consumed when you listen or connect. For example, the web server will consume
one socket listening to port 80 for incoming connections.
If the system is out of buffers or sockets, it will not be able to accept any incoming connections or make any outgoing
connections.
int32_t GetFreeCount() returns the number of free system buffers int32_t GetFreeScoket←-
Count() returns the number of free sockets/file descriptors, not included extra fds int32_t GetFreeExtraFDCount()
returns the number of extra file descriptors

11.46.7 TCP Server


This program will create a TCP server task, which listens on port 23 by default. To test the application you can use
Telnet. For example, from a windows command prompt, type: telnet <ip address>
This example uses a simple read() function to receive data from a TCP client. Refer to the TCP Multi Socket Server
example to handle multiple client connections.

11.46.8 TCP Server Using Via


This example is based on the TCP Multi-Socket Server example, with the addition of the listenvia() function call to
specify a specific network interface for multi-interface devices.
This program will create a TCP server task, with multiple listening sockets, one listening on all interfaces, and an
additional socket each listening on a specific network interface. By default, these sockets listen on port 23 and
incrementing from there. To test the application you can use Telnet. For example, from the command line, type:
telnet <ip address> <port>
This example uses the select() method to handle the multiple sockets within the context of a single task.

11.46.9 TCP Speed Test


This program will test the receive speed of the NetBurner device. To run the program:

• Run MTTTY and connect to the debug serial port

• Build and download this example application

• Run the TcpSpeedTest.exe PC application, found in the "pc" subdir in this example in a windows command
prompt window

• The test results will be displayed in MTTTY and in the command prompt window

NetBurner, Inc.
11.47 Telnet Command 227

Executing TcpSpeedTest.exe from a PC:

• Need a NetBurner device running it's speed test code on the same LAN

• Open a command prompt, type "./TcpSpeedTest <ip address>" where "ip address" is the address of the
NetBurner device.

• The "-r" command line option will repeat forever or until you use cntl-c to exit.

11.46.10 TCP Stress Test


Example to test various response times. Work in conjunction with a windows program to exercise the test cases:

• Listen for an incomeing connection and exchange data

• Listen for an incomeing request, then make an outgoing request and exchange data

• Worse case time for sending and receiving one byte at a time both directions

• Response time of the select() function to block on multiple fds

• Bulk data transfer time

Time for the various tests will be in multiples of a time tick, which is by default 20 ticks per second (TICKS_PER_←-
SECOND).
Be sure not to include the pc folder in your NetBurner project. It is a windows program.

11.47 Telnet Command


This example shows how to use the Command Processor Library, which will accept and process user commands.←-
Connections can be made to the command processor through the serial port, or through a telnet connection.TCP
connections may also be used.
To use the Command Processor Library, a set of callback functions are defined to accept user connections, handle
authentication, handle disconnections, provide a prompt, and of course to process the commands.

11.48 TFTP - Trivial File Transfer Protocol


This example program will use a NetBurner device to communicate with the NetBurner TFTP Server running on a
PC. To run the example:

1. The TFTP Server on the PC must be started and configured to handle both reads and writes.

2. You must specify the TFTP server in the NetBurner device using IPSetp or through the monitor

11.49 Time Functions


Example of how to set and read system time.
Example of system time functions:

• Set system time from a NTP server or manual entry (see also: RTC example)

• Use of time functions such as time(), mktime(), localtime(), etc

• How to display date and time

• Time zones and use of tzsetchar() to set a time zone

• Use of time_t and tm structure

NetBurner, Inc.
228 Example Applications

11.50 Timers
System timer examples:

• Timer

• Interval Timer

• Stopwatch Timer

11.50.1 Timer
The HiResDelay class uses a hardware timer to provide a microsecond delay function.

11.50.2 Interval Timer


The Interval Timer user a processor hardware timer to schedule periodic interrupts. This can be useful for applica-
tions that need to do something as a reliable interval.
The example demonstrates how to:

• Create an IntervalTimer object

• Trigger an interrupt and access an interrupt service routine

• Post a semaphore

• Post a flag

11.50.3 Stopwatch Timer


A StopWatch object is used to time events. Once the object has been created, the Start and Stop member functions
are used to control timing events.

11.51 UDP
The UDP API includes both socket based and object based (UDP Packet) implementations.
UDP Examples:

• UDP to Serial

• UDP Notify Callback Function

• UDP C++ Packet Class

• UDP Echo

• UDP Send/Receive

• UDP Sockets

• UDP Sockets Via

11.51.1 UDP to Serial


This program will send/receive data between a UDP program, such as the NetBurner UDP Terminal, and a serial port
(such as the MTTTY program). The UDP configuration parameters are handled through the web page configuration
interface.

NetBurner, Inc.
11.51 UDP 229

11.51.2 UDP Notify Callback Function


This example illustrates how to use a callback function to be notified of any incoming UDP packets. The key
components are:

• Standard UDP packet class

• A callback function to be executed when data is available

• Using the RegisterUDPFifoWithNotify() instead of RegisterUDPFifo()

11.51.3 UDP C++ Packet Class


This application will send/receive UDP packets with another host on a network, such as a PC. Use the MTTTY serial
port program to access the menu and prompts to specify the destination IP address and port number.
NetBurner supplies an API for handling UDP as a C++ Class using UDPPacket, or you can use a UDP sockets API
(see UDP socket example).
For an external UDP host you can use the NetBurner Java example, or the NetBurner UDP terminal program.

11.51.4 UDP Echo


This example program will receive a UDP packet from another device or host computer, and then send a response.
To run the example, connect a serial port from your PC to the debug serial port on your NetBurner device and run a
terminal program such as MTTTY. On the PC, run the NetBurner UDP Terminal (be sure to set the IP address and
port numbers to match). Send data from the NetBurner UDP Terminal, and observe that the packet is received in
MTTTY. Then observe the response from the device in the NetBurner UDP Terminal.

11.51.5 UDP Send/Receive


This example program will receive a UDP packet from another device or host computer, and then send a response.
UDP is handles using the UDP C++ Class.
Note there is also an API for handling UDP using a socket interface.
To run the example, connect a serial port from your PC to the debug serial port on your NetBurner device and run
a terminal program such as MTTTY.
On the PC, run the NetBurner UDP Terminal (be sure to set the IP address and port numbers to match) or some
other UDP program of your choice. You will then be able to type characters in the UDP Terminal and see them in
MTTTY, and vice versa.
You will be prompted for the port number to send/receive data and the destination IP address of the other device or
host. Note that the application uses the same port number to send and receive data, but you can use any other port
number you wish.
The application will create a thread to receive packets and display them on the debug port, while the main task will
take any data you type in to the MTTTY terminal and send it as a UDP packet to the destination IP address.

11.51.6 UDP Sockets


This application will send/receive UDP packets with another host on a network using the UDP Sockets API. Use the
MTTTY serial port program to access the menu and prompts to specify the destination IP address and port number.
Note ther is also an API an API for handling UDP as a C++ Class using UDPPacket.
For an external UDP host you can use the NetBurner Java example, or the NetBurner UDP terminal program.

11.51.7 UDP Sockets Via


This application will send/receive UDP packets with another host on a network using the UDP Sockets API. This
opens multiple sockets for all different interfaces. Use the MTTTY serial port program to access the menu and
prompts to specify the destination IP address. It also demonstrates using Select for UDP receive.
There is also an API an API for handling UDP as a C++ Class using UDPPacket
For an external UDP host you can use the NetBurner Java example, or the NetBurner UDP terminal program.

NetBurner, Inc.
230 Example Applications

11.52 VLAN
Creates 3 VLAN interfaces:

• Ethernet 0, DHCP, VLAN ID 1

• Ethernet 0, DHCP, VLAN ID 2

• Ethernet 0, Static IP, VLAN ID 10

The serial port interface provides an interactive menu to display interface and VLAN information, as well as other
system parameters.
To build this example MULTIHOME must be enabled in predef.h. Rather than change the file in \nburn\nbrtos\include,
use the override feature and add predef.h to your project.

11.53 Web Server


Web Server Examples:

• Ajax Graph

• Bootstrap Hello World

• HTML File Post

• Flash Form

• GIF Canvas

• HTML Application File Post

• HTML Cookie

• HTML Form Post

• HTML Form Post 2.X Compatible

• HTML Password

• HTML Server GET Request

• HTMLVariables

• Serial Webserver

• Signed Application

• Simple HTML

• TicTacToe

11.53.1 Ajax Graph


This example demonstrates the code to create a webpage with a dynamic graph, generated by data from the Net←-
Burner device. Specifically, it has been designed to imitate the data formats found in log files, where ordering and
frequency are varied between data sources.
The vast majority of the example is simply the support code needed to generate the random data. This code is
located in the other support files. The locations that actually are relevant to the AJAX portion of the example are:
main.cpp: getSensorData() DumpLogData()

ticks.html: <!--FUNCTIONCALL getHTMLTicks -->

data.html: <!--CPPCALL getSensorData() -->

index.html: Basically, all the Javascript.

NetBurner, Inc.
11.53 Web Server 231

11.53.2 Bootstrap Hello World


The Bootstrap HelloWorld Example demonstrates how easy it is to utilize Twitter Bootstrap ( http←-
://twitter.github.io/bootstrap/ ) on a NetBurner device. This example loads a simple "Hello
World" web page on to the device, along with the Twitter Bootstrap framework (version 4.0).

11.53.3 HTML File Post


This example presents a web page with a field for selecting a file to upload to the NetBurner device. When the
"Send File" button is selected, the upload is performed. The uploaded file is then displayed on the web page.

11.53.4 Flash Form


The FlashForm example demonstrates three different capabilities:

1. Dynamic HTML

2. HTML Form processing

3. User Flash parameter storage. Note that as of the 3.x release, we recommend you use the configuration
server/storage.

All the processing happens when a web browser posts a form, and all the comments are in the formcode.cpp source
file.

11.53.5 GIF Canvas


This example program describes how to programmatically create images and text. This file, main.cpp, starts the
application, network services and web server. The functions that create the images and interact with the web
browser are located in drawimage.cpp.
To run this application compile and download the program file, then use your web browser to connect to the Net←-
Burner device.

11.53.6 HTML Application File Post


This example presents a web page where the user can post a file to update the code in the device.
Optionally you can uncomment:

#define I_WANT_TO_AUTHENTICATE_UPDATE
to enforce a username password.

11.53.7 HTML Cookie


This example shows how to implement cookies with the NetBurner web server. The example program works as
follows:

• Three web pages are created: an index page, a page to set the cookie value to "MyCookie", and a page to
view the cookie value.

• When you run the program open a web browser and go to the index page.

• Select the "set cookie" link to set the cookie. Note that if you select "show cookie" before setting the value,
no value will be displayed.

• Select the "show cookie" link to view the cookie

A cookie will apply to a "site". In this example a "site" will probably be the IP address of your NetBurner device. The
cookie will be sent as part of the HTML header for any page requested from the "site".

NetBurner, Inc.
232 Example Applications

11.53.8 HTML Form Post


• Uses the HTML POST command (the other is HTML GET) to send HTML form data from a web browser to
the NetBurner device.

• Illustrates the use of the NetBurner POST callback objects, named postForm1 and postForm2 in this
example, to intercept and process HTML Post data.

• Demonstrates how to handle multiple web pages with HTML forms and content delivery using the library
functions SendFullResponse() and RedirectResponse().

11.53.9 HTML Form Post 2.X Compatible


The standard HTTP POST methodology in 3.x should be used whenever creating a new project. The 3.X methods
enable cleaner code, less URL parsing, and better performance.
For customers migrating large and complex applications from legacy NNDK 2.X tools and platforms to NNDK 3.X, it
is possible to create a HTTP POST callback function that in turn calls a MyDoPost() style 2.X function. This example
assumes familiarity with the NNDK 3.X HTTP POST methods.

• A NNDK 3.X HTTP POST callback function is declared with a wildcard mask ("∗") so that it is called for all
HTTP POST operations.

• Strings are created for the URL containing the form action name and the posted form data

• The 2.X style MyDoPost() function is called with the URL and data strings

• The ExtractPostData() function is copied from the 2.X tools an included as a function in the application

Once the example has been loaded, interaction is through the device's web page. There are two web pages with
forms for data entry, and a summary page at the end to display the assigned values from the post. Status messages
are displayed on the serial port that can be viewed with a serial terminal, such as the MTTTY utility.
While every attempt has been made to ensure compatibility, every application must be tested to verify proper
operation. Also, this example will not work with multi-part forms.

11.53.10 HTML Password


Demonstrates how to use user names, passwords and access groups. The application consists of an index page
with links to three additional pages with access group numbers 0, 1 and 2.

• Group 0 = Open access

• Group 1 = Admin access

• Group 2 = User access

The function HTTP_ACCESS CheckHttpAccess(int sock, int access_level, HTTP_Request & Req)
is used to authenticate the user names and passwords.
Note: A web browser will cache the username and password once entered. To force a password request again you
will need to clear the browser cache, restart the browser, or open a new private browsing session.

11.53.11 HTML Server GET Request


Demonstrates how to use web server GET function callbacks to intercept browser GET requests. This mechanism
can be used to enable the application to add custom processing and dynamic web content when a specific web
page our URL is requested, or to add custom processing for all GET requests.

11.53.12 HTMLVariables
This example illustrates how to use dynamic HTML content with variables and function call parameters embedded
in HTML code. The HTML tags VARIABLE and FUNCTIONCALL enable you to display application variables and
call application functions directly from the HTML code.
In this example, the device's IP, Mask, Gateway, and DNS Server are displayed dynamically on the web page. The
page also displays an uptime counter which updates when the page is refreshed.

NetBurner, Inc.
11.53 Web Server 233

Note for NBEclipse Users: This example requires that the auto-generated file htmldata.cpp have a path to include
the htmlvar.h header file. To add the path in NBEclipse:
Right-click on your project and select properties Select "C/C++ Build" options Select "GNU C++ Compiler" ->
Directories Use the "+" in the include path box to add the project's "HtmlVariables\html" folder to the list of include
paths.

11.53.13 Serial Webserver


The Serial Webserver is a simple example demonstrating receiving and replying to HTTP requests over a serial
port, using the NetBurner web server implementation. The example will display a "Hello World" type message on
the device's index page: index.html.
An valid HTTP GET request that is compatible with this application is the following:

Note

The webserver expects a double carriage return line feed

‘GET /INDEX.HTML HTTP/1.1\r\n\r\n‘

The expected response should look similar to the following:


HTTP/1.0 200 OK
Pragma: no-cache
MIME-version: 1.0
Content-Type: text/html
Content-length: 231
<html>
<head><link rel="stylesheet" type="text/css" href="style.css"></head>
<body>
<a href="http://www.netburner.com"><img src="logo.jpg" width="200" height="104" border="0"></a>
<h1>Thank you for NetBurning!</h1>
</body>
</html>

11.53.14 Signed Application


Demonstrates the signed application update capability.
To use this you need to create a public/private key pair. It is VERY important that the private key is not stored on the
device in order to be secure. The signing key needs to be different than all other certs and keys used on the device
as a server, such as those for HTTPS.
From this public/private key pair, the public key needs to be stored in the application, and the private key needs to
be stored in some other secure location. If the private key is lost, you will be unable to ever again update the device.
To create the public key and compile it into the application, from the command line:

• openssl genrsa -out signkey.pem 1024

• openssl rsa -in signkey.pem -pubout -out src/public.key

• set NB_SIGN_KEY = WHERE_EVER_THE_KEY_LIVES\signkey.pem

This example includes a batch file named makekey.bat that executes the above steps.
Once the public key has been created, the following commands can be used from the command line to create the
signed application and load it into the device:

• make sign

• make loadsign

When using NBEclipse:

• Make the public/private key pair as described above.

• In the directory where you have the public key, run compfile public.key codekey_array
codekey_len codekey.cpp.
• Now include the codekey.cpp in your NBEclipse project.

After NBEclipse has built your project:

1. Create an External Tool Configuration with Run->External Tools->External Tools Configurations.

NetBurner, Inc.
234 Example Applications

2. In the new external tool configuration, specify the following: – Name: Sign – Location: "${env_var:NNDK_←-
ROOT}\pcbin\nbsign.exe" – Working Directory: Browse Workspace and select your project – Arguments: -k
<full path to private key.pem> -in Release${project_name}.bin -o Release${project_name}.signed.bin

3. Project can now be signed by running the Sign External Tool

11.53.15 Simple HTML


The Simple HTML Example is a basic demonstration of the NetBurner web server implementation, and is a good
starting point for custom applications. The example will display a "Hello World" type message on the device's index
page: index.html.

11.53.16 TicTacToe
The TicTacToe application provides a number of simple examples:

• Play tic tac toe, of course

• Manipulate the LEDs on the NetBurner development board. This is an example of URL Encoding.

• Echo web browser requests, so you can see what is sent to the web server.

• Example of a meta tag to create a "reloading web page", which refreshes itself at 1 second intervals.

11.54 Web Client


Web Socket Examples:

• Earthquake

• Find My IP

• Find My IP Task

• Message Passer

• MessagePasserTask JSON

11.54.1 Earthquake
Simple program that demonstrates retrieving a JSON object from a site and using it to present the user with dynamic
output; in this case obtaining the number of earthquakes that have occurred today and their details.

11.54.2 Find My IP
This program starts a separate, higher-priority task that navigates to a website and retrieves information; in this
case we navigate to a site and retrieve the IP address that we connected with.

11.54.3 Find My IP Task


This program starts a separate, higher-priority task that navigates to a website and retrieves information; in this
case we navigate to a site and retrieve the IP address that we connected with.

11.54.4 Message Passer


Message Passer example that checks the current time.

11.54.5 MessagePasserTask JSON


Message Passer Task to send a JSON object.

NetBurner, Inc.
11.55 Web Sockets 235

11.55 Web Sockets


Web Socket Examples:

• Web Socket Connect

• Web Socket Console

• Web Socket DIP Switch

• Web Socket Echo

11.55.1 Web Socket Connect


This is an example that demonstrates websocket connections.

11.55.2 Web Socket Console


Web Sockets Console example

11.55.3 Web Socket DIP Switch


Supported Platforms: MODM7AE70, MOD5441x, NANO54415
This program illustrates how to use the NetBurner WebSocket class to display the state of the DIP switches on the
MOD-DEV-70CR in real-time on a webpage. That means as soon as you flip the DIP switches on the development
board, the state will change on the webpage without having to refresh the page.
The application continuously polls the DIP switches and sends the state of the DIP switches via a websocket to the
client. It's not the most efficient implementation when considering CPU utilization but this app demonstrates the ca-
pabilities of a WebSocket to allow the server(NetBurner device) to send the state of a variable to the client(webpage)
with low latency and minimal packet size. This app also illustrates how to use the NetBurner JSON library to build
and send JSON objects from the NetBurner device to the client. In this case, JSON objects are used to pass the
state of the DIP switches to the webpage.

11.55.4 Web Socket Echo


Web Sockets Echo example

11.56 Wifi
Wifi Examples:

• Wifi Config AP

• Configure AP with JSON

• Wifi Firmware Update

• Wifi Access Point

• Wifi Client

• Wifi Scan

11.56.1 Wifi Config AP


Configure the wifi as an access point.

NetBurner, Inc.
236 Example Applications

11.56.2 Configure AP with JSON


Configure the WiFi interface as an access point to provide the user a means to connect to local networks.
If no network SSID is provided to connect to upon boot, the application will start a WiFi Access Point. The Net←-
Burner's WiFi Access Point can be used to scan for local networks. The NetBurner device hosts a webpage that
allows the user to establish a connection to local networks after performing a scan.
The default WiFi access point SSID will be of the form "NB_<last 6 bytes of MAC>". For example, a NetBurner
access point may look like "NB_012345". If you would like modify the prefix of the access point to include custom
product branding, the prefix can be re-defined by un-commenting and modifying the following line located at the top
of main.cpp:
extern const NB::SSID_t default_SSID_Prefix = { 4, "FOO_" };
For the user's convenience, the device's SSID and WiFi Interface IP address are printed out the serial port. These
can be used to access the device's webpage, which allows the user to connect to a local network.
This list of networks is generated using JavaScript. JavaScript is used to parse a JSON object sent by the NetBurner,
which contains the access point scan results.

11.56.3 Wifi Firmware Update


Update the firmware in the wifi module.

11.56.4 Wifi Access Point


This example shows how to run the wifi module in Access Point mode. It also launches a DHCP Server running on
the wifi interface, making it easier for a client to configure when connecting to the access point.
To setup your access point properly, you will need to configure the IP address and Mask of the Wifi interface. This
can be done using IPSetup. You will also need to set the start address for the DHCP server to begin assigning IP
addresses to connected devices. The variable 'startAddr' is used to so in this application.
For example, a proper AP configuration would be a WiFi interface with an IP address of 192.168.0.1, Mask of
255.255.255.0, and a DHCP server start address of 192.168.0.2

11.56.5 Wifi Client


This example demonstrates how to connect to a wifi network and use the wifi driver object to access the status
information of the wifi connection.
If you are using a 5270 or 5234 processor based design it also enables spread spectrum mode to reduce emissions
that can interfere with the wifi radio. These platforms should be using a wifi module with an external antenna.

11.56.6 Wifi Scan


Scan for access points

NetBurner, Inc.
Chapter 12

License

Subject to your compliance with these terms, you may use Microchip software and any derivatives exclusively with
Microchip products. It is your responsibility to comply with third party license terms applicable to your use of third
party software (including open source software) that may accompany Microchip software.
THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IM-
PLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-←-
INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MI-
CROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL LOSS,
DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER
CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORE-
SEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS
IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU
HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
asf_license_stop

NetBurner, Inc.
238 License

NetBurner, Inc.
Chapter 13

Deprecated List

Member OSCritEnter (OS_CRIT ∗pCrit, uint16_t timeout)


This function is now deprecated. Please see OS_CRIT for current usage.
Member OSCritEnterNoWait (OS_CRIT ∗pCrit)
This function is now deprecated. Please see OS_CRIT for current usage.
Member OSCritInit (OS_CRIT ∗pCrit)
This function is now deprecated. Please see OS_CRIT for current usage.
Member OSCritLeave (OS_CRIT ∗pCrit)
This function is now deprecated. Please see OS_CRIT for current usage.
Member OSFifoInit (OS_FIFO ∗pFifo)
This function is now deprecated. Please see OS_FIFO for current usage.
Member OSFifoPend (OS_FIFO ∗pFifo, uint16_t timeout)
This function is now deprecated. Please see OS_FIFO for current usage.
Member OSFifoPost (OS_FIFO ∗pFifo, OS_FIFO_EL ∗pToPost)
This function is now deprecated. Please see OS_FIFO for current usage.
Member OSFifoPostFirst (OS_FIFO ∗pFifo, OS_FIFO_EL ∗pToPost)
This function is now deprecated. Please see OS_FIFO for current usage.
Member OSFlagClear (OS_FLAGS ∗flags, uint32_t bits_to_clr)
This function is now deprecated. Please see OS_FLAGS for current usage.
Member OSFlagPendAll (OS_FLAGS ∗flags, uint32_t bit_mask, uint16_t timeout)
This function is now deprecated. Please see OS_FLAGS for current usage.
Member OSFlagPendAllNoWait (OS_FLAGS ∗flags, uint32_t bit_mask)
This function is now deprecated. Please see OS_FLAGS for current usage.
Member OSFlagPendAny (OS_FLAGS ∗flags, uint32_t bit_mask, uint16_t timeout)
This function is now deprecated. Please see OS_FLAGS for current usage.
Member OSFlagPendAnyNoWait (OS_FLAGS ∗flags, uint32_t bit_mask)
This function is now deprecated. Please see OS_FLAGS for current usage.
Member OSFlagSet (OS_FLAGS ∗flags, uint32_t bits_to_set)
This function is now deprecated. Please see OS_FLAGS for current usage.
Member OSFlagState (OS_FLAGS ∗flags)
This function is now deprecated. Please see OS_FLAGS for current usage.
Member OSMboxInit (OS_MBOX ∗pmbox, void ∗msg)
This function is now deprecated. Please see OS_MBOX for current usage.
Member OSMboxPend (OS_MBOX ∗pmbox, uint16_t timeout, uint8_t ∗err)
This function is now deprecated. Please see OS_MBOX for current usage.

NetBurner, Inc.
240 Deprecated List

Member OSMboxPendNoWait (OS_MBOX ∗pmbox, uint8_t ∗err)


This function is now deprecated. Please see OS_MBOX for current usage.
Member OSMboxPost (OS_MBOX ∗pmbox, void ∗msg)
This function is now deprecated. Please see OS_MBOX for current usage.
Member OSQInit (OS_Q ∗pq, void ∗∗start, uint8_t size)
This function is now deprecated. Please see OS_Q for current usage.
Member OSQPend (OS_Q ∗pq, uint16_t timeout, uint8_t ∗err)
This function is now deprecated. Please see OS_Q for current usage.
Member OSQPendNoWait (OS_Q ∗pq, uint8_t ∗err)
This function is now deprecated. Please see OS_Q for current usage.
Member OSQPost (OS_Q ∗pq, void ∗msg)
This function is now deprecated. Please see OS_Q for current usage.
Member OSQPostFirst (OS_Q ∗pq, void ∗msg)
This function is now deprecated. Please see OS_Q for current usage.
Member OSQPostUnique (OS_Q ∗pq, void ∗msg)
This function is now deprecated. Please see OS_Q for current usage.
Member OSQPostUniqueFirst (OS_Q ∗pq, void ∗msg)
This function is now deprecated. Please see OS_Q for current usage.
Member OSSemInit (OS_SEM ∗psem, long value)
This function is now deprecated. Please see OS_SEM for current usage.
Member OSSemPend (OS_SEM ∗psem, uint16_t timeout)
This function is now deprecated. Please see OS_SEM for current usage.
Member OSSemPendNoWait (OS_SEM ∗psem)
This function is now deprecated. Please see OS_SEM for current usage.
Member OSSemPost (OS_SEM ∗psem)
This function is now deprecated. Please see OS_SEM for current usage.

NetBurner, Inc.
Chapter 14

Module Index

14.1 NetBurner API


Here is a list of all modules:
ARP - Address Resolution Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Buffers - System Buffer Pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
ColdFire MCF5441x Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
MODM7AE70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Command Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Command Processor Disconnect Causes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Command Processor Listen Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Command Processor Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Configuration Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Configuration Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Configuration Variable Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
DHCP - IPv4 DHCP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
DHCP State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
DHCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
DNS - Domain Name System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
DNS Record Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
DNS Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
EFFS - Embedded Flash File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
EFFS-STD Flash File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
STD File System Seek Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
FAT File System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
FAT File System Seek Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Ethernet Interface Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
External Bus Interface (EBI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Extra File Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
FTP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
FTP Client Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
HAL - Hardware Abstraction Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
HTTP and HTML Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
MOD5441x and NANO54415 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Multichannel I2C Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Multichannel I2C Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
MODM7AE70 (SAME70) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
IOSYS - I/O System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350

NetBurner, Inc.
242 Module Index

FD Change Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318


I/O Control Command Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
I/O Control Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
IPADDR4 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
IPADDR6 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Initialization - System Initialization Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
JSON Lexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Primitive Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
JsonRef and ParsedJsonDataSet Valid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
JsonRef and ParsedJsonDataSet types and operators . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Multicast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Multihome and VLAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
NBRTOS Real Time Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
NBRTOS Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
NBRTOS Task Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
NBString - NetBurner String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
POP3 - Post Office Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
POP3 Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
PPP - Point to Point Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
PPP Connection State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
PPP Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
SAME70 GPIO (MODM7AE70) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
SMTP - Send Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
MIME Content Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
SMTP Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
SSL SMTP Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
SOCKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
SOCKS Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
ColdFire MCF5441x (DSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
DSPI state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
SPI - MODM7AE70 (DSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
DspiModuleNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
DspiState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
SPI - MODM7AE70 (QSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
QuadSpiModuleNumber . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
SSH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
SSH Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
SSL/TLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Onboard Certificate Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Certificate Generation Alternate Name Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Certificate Generation Key Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Function Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
SSL Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Serial Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Serial Port Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Shutdown Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
ShutdownReasons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Signed Application Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
NBUpdate Function Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
Stream Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 485
Stream Update Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487

NetBurner, Inc.
14.1 NetBurner API 243

TCP Notify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505


TCP Socket Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
TCP Socket State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
TCP Socket Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
TFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
TFTP Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
High Resolution Delay Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Interval Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Stopwatch Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
UDP Packet Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
UDP Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
UDP Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
User Authorization Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Authorization Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Authorization Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Web Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
Web Client Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Wifi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
BSS Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Cipher Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Configuration Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Connect Request Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Save Config Record Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Scan Request Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Security Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475

NetBurner, Inc.
244 Module Index

NetBurner, Inc.
Chapter 15

Namespace Index

15.1 Namespace List


Here is a list of all documented namespaces with brief descriptions:
canMCF5441x
CanMCF5441x namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
mcanMODM7AE70
McanMODM7AE70 namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
NB::Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
NB::Error::Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
NB::Error::Init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
NB::Error::Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546

NetBurner, Inc.
246 Namespace Index

NetBurner, Inc.
Chapter 16

Hierarchical Index

16.1 Class Hierarchy


This inheritance list is sorted roughly, but not completely, alphabetically:
_PinVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
PinVector< n > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
aes_context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
AltNameEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
canMCF5441x::CanRxMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
mcanMODM7AE70::CanRxMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
CertGenData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
config_obj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
NV_SettingsStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
config_chooser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
config_value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
config_IPADDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
config_IPADDR4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
config_MACADR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
config_bool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
config_double . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
config_int . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
config_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
config_pass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
config_uint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
DelayObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
DhcpObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
NB::Wifi::driverStatusStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
DSPIModule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
EBI_CS_cfg_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 606
HtmlPageHandler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
HTTP_Request . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
I2CDevice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
IPADDR4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
IPADDR6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
JsonAllocString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
JsonRef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
mcanMODM7AE70::mcan_config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
mcanMODM7AE70::mcan_module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
NBRtosInitObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
NBString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
OS_CRIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
OS_FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652

NetBurner, Inc.
248 Hierarchical Index

OS_FLAGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
OS_MBOX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
OS_Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 662
OS_SEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
OSCriticalSectionObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
OSLockAndCritObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
OSLockObj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
OSSpinCrit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
ParsedJsonDataSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 672
ParsedURI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
PinIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
PINS::PinIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
SerialRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
SPIModule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
SPI_QSPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711
SSC_cfg_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
SSC_rxtx_cfg_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
SSCCtx_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
StopWatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
TicketNonce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
TickTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
UDPPacket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
UserAuthManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
UserAuthRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
wifi_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
WireIntf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
WM8904 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750

NetBurner, Inc.
Chapter 17

Class Index

17.1 Class List


Here are the classes, structs, unions and interfaces with brief descriptions:
_PinVector
GPIO Pin Vector Base Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
aes_context
AES context structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
AltNameEntry
The AltNameEntry struct holds all of the information required to add a single alternate name
entry to a certificate that's generated onboard the module . . . . . . . . . . . . . . . . . . . . 549
CallBackFunctionPostHandler
Implements the HtmlPostHandler class as a function pointer callback for POST requests . . . 550
canMCF5441x::CanRxMessage
Class to hold received CAN messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
mcanMODM7AE70::CanRxMessage
Class to hold received CAN messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
CertGenData
Used to store the information that is passed in when enabling onboard generated certificates, as
well as the information needed to determine when they need to be regenerated . . . . . . . . 554
config_bool
Boolean Configuration Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
config_chooser
Chooser Configuration Variable - Select From a List of Items . . . . . . . . . . . . . . . . . . 558
config_double
Double Float Configuration Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
config_int
Signed 32-bit Integer Configuration Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
config_IPADDR
Configuration Variable for IPADDR (IPv6) object type . . . . . . . . . . . . . . . . . . . . . . 568
config_IPADDR4
Configuration Variable for IPADDR4 (IPv4) object types . . . . . . . . . . . . . . . . . . . . . 572
config_MACADR
Configuration Variable for MACADR object type . . . . . . . . . . . . . . . . . . . . . . . . . 576
config_obj
Base class used to create configuration objects . . . . . . . . . . . . . . . . . . . . . . . . . 579
config_pass
Password string Configuration Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
config_string
String Configuration Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
config_uint
Unsigned 32-bit Integer Configuration Variable . . . . . . . . . . . . . . . . . . . . . . . . . . 590
config_value
Base class used to create a configuration value . . . . . . . . . . . . . . . . . . . . . . . . . 592

NetBurner, Inc.
250 Class Index

DelayObject
Microsecond Delay Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593
DhcpObject
DHCP client class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
NB::Wifi::driverStatusStruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
DSPIModule
DSPIModule is a SPI communications driver. It is an object based driver, which allows for low
overhead multiplexing between peripherals with different bus configurations . . . . . . . . . . 599
EBI_CS_cfg_t
Configuration structure for an External Bus Interface (EBI) chip select . . . . . . . . . . . . . 606
HtmlPageHandler
Base class for all GET handlers. To handle GET requests for a specific URL in your application,
build a GET handler object for that specifif URL. A NULL name will be a catch all for all GET
requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
HtmlPostVariableListCallback
Implements the HtmlPostVariableListHandler class as a function pointer callback for HTTP POST
submissions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
HTTP_Request
HTTP Request Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609
I2C
I2C Peripheral Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
I2CDevice
I2C Device Class (recommended) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
IPADDR4
Used to store and manipulate IPv4 addresses in dual stack mode . . . . . . . . . . . . . . . . 617
IPADDR6
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode . . . . . . . . . . . 622
JsonAllocString
A list of large strings that are created with malloc . . . . . . . . . . . . . . . . . . . . . . . . 628
JsonRef
Represents a positional reference (pointer) of a location inside a ParsedJsonDataSet object
629
mcanMODM7AE70::mcan_config
MCAN configuration structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
mcanMODM7AE70::mcan_module
MCAN Module Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
NBRtosInitObj
A simple class to derive from if you are creating taks that are constructed at global scope and
need to do RTOS initalization. The vistural function Notify will be called once the RTOS internals
are setup so you can create a task, allocate buffers,etc.. if you need to do network I/O then you
this will not be sufficent as you will need register to be notifyied when link is active on the interface 638
NBString
Lightweight alternative to C++ CString class . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
NV_SettingsStruct
Configuration Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
OS_CRIT
An OS_CRIT object is used to establish critical sections of code that can only be run by one task
at a time. Tasks that try to claim a critical section which is currently claimed by another task will
stop and wait for that task to leave the critical section before continuing execution . . . . . . . 649
OS_FIFO
A FIFO is used to pass structures from one task to another. Note: Structures to be passed must
have an unused (void ∗) pointer as its first element. This precludes passing C++ objects with
virtual member functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
OS_FLAGS
An OS_FLAGS object is used to set, clear, and pend on a set of flags that is held and maintained
by the object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 655
OS_MBOX
Mailboxes are used to communicate between tasks . . . . . . . . . . . . . . . . . . . . . . . 659

NetBurner, Inc.
17.1 Class List 251

OS_Q
A queue functions as a fixed size FIFO for communication between tasks . . . . . . . . . . . 662
OS_SEM
Semaphores are used to control access to shared resource critical section, or to communicate
between tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
OSCriticalSectionObj
A simple wrapper class that helps utilize OS_CRIT objects more effectively . . . . . . . . . . . 669
OSLockAndCritObj
A simple wrapper class that helps utilize OS_CRIT objects to lock tasks and enter critical sections
more effectively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 670
OSLockObj
A simple wrapper class that helps use OS locks effectively . . . . . . . . . . . . . . . . . . . 671
OSSpinCrit
A simple wrapper class that uses an OS_CRIT object to try and claim a critical section, and will
continue the attempt until it is able to do so . . . . . . . . . . . . . . . . . . . . . . . . . . . 671
ParsedJsonDataSet
A class to create, read, and modify a JSON object . . . . . . . . . . . . . . . . . . . . . . . . 672
ParsedURI
Parsed Uniform Resource Identifier Class (URI) . . . . . . . . . . . . . . . . . . . . . . . . . 699
PinIO
GPIO Pin Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701
PINS::PinIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706
PinVector< n >
GPIO Pin Vector Class PinVector is a template instantiation of the _PinVector class, allowing for
minimal storage requirements for potentially large vectors, without heavy code duplication due to
template copies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707
SerialRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 708
SPI_QSPI
The Single-Bit SPI mode QSPI Peripheral Class . . . . . . . . . . . . . . . . . . . . . . . . . 711
SPIModule
SPI Peripheral Module Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
SSC_cfg_t
Configuration structure for the SSC driver. Passed to the initialize function to configure the hard-
ware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721
SSC_rxtx_cfg_t
Configuration structure for a given direction (rx or tx) of the SSC module. Passed to the initialize
function to configure the hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722
SSCCtx_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724
StopWatch
Stopwatch for timing events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
TicketNonce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
TickTimeout
TickTimeouts are used to facilitate sequential function calls with timeout parameters that need to
index from an initial start time and be proof against TimeTick rollover . . . . . . . . . . . . . . 729
UDPPacket
UDP Packet Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
UserAuthManager
The user authorization manager class allows application developers the ability to manage user
authorization records. The can be loaded and saved to any storage space, including the config
system or UserParams. Authorization values are hashed before being saved. Validation com-
pares both the hash as well as the authorization type. Adding, updating, and removing records
will automatically call the user devined save functions. For usage, please see the example found
in examples/SSH/sshServerUserAuth . . . . . . . . . . . . . . . . . . . . . . . . . 741
UserAuthRecord
A stored record of a user's authorization credentials. The value is hashed when saved so it can't
be read directly. User's can currently only have one authorization record per user name . . . . 746
wifi_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746

NetBurner, Inc.
252 Class Index

WireIntf
Wire Interface Class for I2C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746
WM8904 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 750

NetBurner, Inc.
Chapter 18

File Index

18.1 File List


Here is a list of all documented files with brief descriptions:
multican.h
ColdFire MCF5441x Control Area Network (CAN) . . . . . . . . . . . . . . . . . . . . . . . . 757
multichanneli2c.h
NetBurner I2C API for MOD5441x and NANO54415 . . . . . . . . . . . . . . . . . . . . . . . 762
cpu_pins.h
GPIO pin driver class for the ARM SAME70 (MODM7AE70) . . . . . . . . . . . . . . . . . . 767
coldfire/cpu/MCF5441X/include/dspi.h
NetBurner MCF5441x DSPI API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770
cortex-m7/cpu/SAME70/include/dspi.h
NetBurner DMA SPI (DSPI) API for ARM SAME70 (MODM7AE70, SBE70LC) . . . . . . . . . 775
ebi.h
External Bus Interface (EBI) Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
i2c.h
NetBurner I2C API for ARM SAME70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780
mcan.h
SAM Control Area Network (MCAN) Low Level Driver . . . . . . . . . . . . . . . . . . . . . . 784
quadspi.h
NetBurner DMA Quad SPI (QSPI) API for ARM SAME70 (MODM7AE70) . . . . . . . . . . . . 790
EFFS/FAT/src/ftp_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
MultiPlatform/EffsSDHC/src/ftp_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
MultiPlatform/WavPlayer/src/ftp_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
ow.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
PeriodicAD.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
PeriodicAD_DMA.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
wavWriter.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
dev_test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
edma.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
wavPlayer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796
htmlvars.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
_common/IpUtil/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
_common/MultiPlatform/RTC-OnChip/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
DHCP/ChangeIP/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
DHCP/ChangeIPViaWebpage/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
Ethernet/ManualConfig/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
IPv6/IPv6-DHCPv6/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . 802
PlatformSpecific/MODM7AE70/MODM7AE70FactoryApp/src/ip_util.h . . . . . . . . . . . . . . . . . . . 802
PlatformSpecific/NANO54415/NANO54415FactoryApp/src/ip_util.h . . . . . . . . . . . . . . . . . . . . 802
ShowInterfaces/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
VLan/src/ip_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803

NetBurner, Inc.
254 File Index

MyAlloc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
fileup.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
ExtraFdCircBuffer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
JSON/DemoNetBurner/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
JSON/SimpleJSONHtml/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
JSON/SimplePostReceiver/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
PlatformSpecific/SB800EX/SB800AsDiagMonitor/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . 804
SSL/SSLConfigMirror/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804
Web/HtmlPostDateTime/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
Web/HtmlServerGetRequest/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
Web/HtmlVariables/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
Web/SignedApp/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
WebSockets/Console/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
WebSockets/Echo/src/htmlvar.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
NANOL7.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
_common/EFFS/STD/src/effs_std.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
Parallax/src/effs_std.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
_common/EFFS/FAT/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 808
_common/EFFS/STD/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
_common/MultiPlatform/EffsLoadAppFromFlashCard/src/effs_time.h . . . . . . . . . . . . . . . . . . . 809
_common/MultiPlatform/EffsSDHC/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
_common/MultiPlatform/WavPlayer/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
Parallax/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 810
PlatformSpecific/MOD5441X/EffsMultipleMmc/src/effs_time.h . . . . . . . . . . . . . . . . . . . . . . . 811
_common/EFFS/FAT/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
_common/EFFS/STD/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
_common/MultiPlatform/EffsLoadAppFromFlashCard/src/FileSystemUtils.h . . . . . . . . . . . . . . . . 812
_common/MultiPlatform/EffsSDHC/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . 813
_common/MultiPlatform/WavPlayer/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . 813
Parallax/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814
PlatformSpecific/MOD5441X/EffsMultipleMmc/src/FileSystemUtils.h . . . . . . . . . . . . . . . . . . . 814
PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/FileSystemUtils.h . . . . . . . . . . . . . . . . 815
_common/EFFS/STD/src/flashChip/AM29LV160B.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
Parallax/src/flashChip/AM29LV160B.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816
_common/EFFS/STD/src/flashChip/AT49BV163D.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
Parallax/src/flashChip/AT49BV163D.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 819
_common/EFFS/STD/src/flashChip/MCF5282Flash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 820
Parallax/src/flashChip/MCF5282Flash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821
_common/EFFS/STD/src/flashChip/MX25L6406E.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 822
Parallax/src/flashChip/MX25L6406E.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
_common/EFFS/STD/src/flashChip/MX29GL256F.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824
Parallax/src/flashChip/MX29GL256F.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826
_common/EFFS/STD/src/flashChip/S29GL032.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
Parallax/src/flashChip/S29GL032.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
_common/EFFS/STD/src/flashChip/SAME70Q21.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 830
Parallax/src/flashChip/SAME70Q21.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 831
_common/EFFS/STD/src/flashChip/SST39VF040.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833
Parallax/src/flashChip/SST39VF040.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
Parallax/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
serial/SerialBurner/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
SSH/SecureSerToEthFactoryApp/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836
SSL/HttpsUploadCert/src/formtools.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 837
_common/EFFS/STD/src/fs_main.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
Parallax/src/fs_main.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
_common/EFFS/STD/src/ftp_fs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 839
Parallax/src/ftp_fs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
_common/EFFS/FAT/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840
_common/EFFS/STD/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 840

NetBurner, Inc.
18.1 File List 255

_common/MultiPlatform/WavPlayer/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
Parallax/src/http_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
Parallax/src/nvsettings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
serial/SerialBurner/src/nvsettings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
SSH/SshServerUserKey/src/nvsettings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
_common/EFFS/FAT/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
_common/MultiPlatform/EffsLoadAppFromFlashCard/src/cardtype.h . . . . . . . . . . . . . . . . . . . 844
_common/MultiPlatform/EffsSDHC/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
_common/MultiPlatform/WavPlayer/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845
PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/cardtype.h . . . . . . . . . . . . . . . . . . . . 845
SSH/SecureSerToEthFactoryApp/src/cardtype.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846
_common/MultiPlatform/ADC/SimpleADC/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . . . . . . . 846
PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . 846
PlatformSpecific/MODM7AE70/ADC_Simple/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . . . . . 846
PlatformSpecific/NANO54415/NANO54415FactoryApp/src/SimpleAD.h . . . . . . . . . . . . . . . . . . 847
PlatformSpecific/SOMRT1061/ADC_Simple/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . . . . . 847
WebSockets/DIPSwitches/src/SimpleAD.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
tests.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847
SSL/SslPop3/src/webfuncs.cpp
This code module contains the web functions for the POP3 mail using SSL example program . 848
_common/MultiPlatform/PulseGenerator-Counter/src/webfuncs.h . . . . . . . . . . . . . . . . . . . . . 853
PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/webfuncs.h . . . . . . . . . . . . . . . . . . . . 853
PlatformSpecific/MODM7AE70/MODM7AE70FactoryApp/src/webfuncs.h . . . . . . . . . . . . . . . . . 853
PlatformSpecific/NANO54415/NANO54415FactoryApp/src/webfuncs.h . . . . . . . . . . . . . . . . . . 854
ebi_pager.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854
examples/_common/MultiPlatform/RTC-External/src/rtc.h . . . . . . . . . . . . . . . . . . . . . . . . . 854
examples/PlatformSpecific/MODM7AE70/RTC-External/src/rtc.h . . . . . . . . . . . . . . . . . . . . . 855
platform/MOD5441X/include/rtc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 855
hd44780.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856
ssc_i2s.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 857
wm8904.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860
wm8904_reg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 862
datapump.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 865
_common/MultiPlatform/GpioServer/src/analog.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866
SSH/SecureSerToEthFactoryApp/src/analog.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866
fdtimer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
_common/MultiPlatform/GpioServer/src/gpioserver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 867
SSH/SecureSerToEthFactoryApp/src/gpioserver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
i2cfuncs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
i2crecord.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
i2cserver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
SSH/SecureSerToEthFactoryApp/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
SSH/SshServerUserKey/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876
SSL/HttpsUploadCert/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
SSL/SslClientVerifyPeerEffs/src/nbfactory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878
permanentcert.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
permanentcertkey.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
permanentkeyecdsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
SecureSerToEthFactoryApp/src/permanentkeyrsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
SshServerUserKey/src/permanentkeyrsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h . . . . . . . . . . . . . . . . . . . . . . . . . . 881
SSL/HttpsUploadCert/src/serialburnerdata.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
SSL/SslClientVerifyPeerEffs/src/serialburnerdata.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 894
serialrecord.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 895
SecureSerToEthFactoryApp/src/sshuser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896
SshServerUserKey/src/sshuser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 898
SSH/SecureSerToEthFactoryApp/src/ssluser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
SSL/HttpsUploadCert/src/ssluser.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901

NetBurner, Inc.
256 File Index

UserAuth.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
permanentkeyecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
caList.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 902
Advanced/src/TimeUtil.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
CompiledCa/src/TimeUtil.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
Simple/src/TimeUtil.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
TcpClientSimple/src/clientweb.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
TcpMultiInterfaceTest/src/clientweb.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
webif.cpp
This module handles the web page interface to the UDP to Serial program example . . . . . . 904
webif.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
datagenerator.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
datalog.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
drawimage.cpp
Function definitions for the DrawImageObject class . . . . . . . . . . . . . . . . . . . . . . . 906
drawimage.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
gifCompress.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
webFormValues.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
WebFunctions.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
certgen.h
Onboard Certificate Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
CryptoServer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913
CryptoSocket.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913
NbSslCtx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 915
NbWolfSsl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916
SslClientSession.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916
SslSocket.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917
E70_RAM/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 917
IC_D20/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
MOD5441X/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933
MODM7AE70/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 937
MODRT1171/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 945
MON_RT10xx/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953
MON_SAME70/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 961
NANO54415/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 969
RT10XX_RAM/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
SB800EX/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981
SBE70LC/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 986
SOMRT1061/user_settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 994
ssl_internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1001
ssl.h
NetBurner SSL/TLS API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1005
wolfssl/openssl/ssl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1011
wolfssl/ssl.h
Header file containing key wolfSSL API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1030
ssl_mailto.h
NetBurner SSL SMTP API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1090
ssl_pop3.h
NetBurner SSL POP3 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1091
callbacks.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1092
certs_test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1093
crl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1190
error-ssl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1191
internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1193
ocsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1260
openssl/ocsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1262
asn1.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263
asn1t.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265

NetBurner, Inc.
18.1 File List 257

bio.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265
bn.h
Bn.h for openssl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1267
buffer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1270
openssl/camellia.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271
wolfcrypt/camellia.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1271
openssl/cmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1272
wolfcrypt/cmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1273
cms.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1274
compat_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1274
conf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1275
crypto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1276
des.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1278
openssl/dh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1279
wolfcrypt/dh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1281
openssl/dsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1283
wolfcrypt/dsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1285
ec.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1286
ec25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291
ec448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1291
ecdh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1292
ecdsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1292
openssl/ed25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1293
wolfcrypt/ed25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1294
openssl/ed448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1296
wolfcrypt/ed448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1297
engine.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299
err.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1299
evp.h
Evp.h defines mini evp openssl compatibility layer . . . . . . . . . . . . . . . . . . . . . . . . 1300
fips_rand.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1314
openssl/hmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1315
wolfcrypt/hmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1316
openssl/kdf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319
wolfcrypt/kdf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319
lhash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321
openssl/md4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1321
wolfcrypt/md4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1322
modes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1323
obj_mac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1323
objects.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1324
opensslconf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1325
opensslv.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1325
ossl_typ.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1325
pem.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1326
openssl/pkcs12.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1329
wolfcrypt/pkcs12.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1329
openssl/pkcs7.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1330
wolfcrypt/pkcs7.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1332
rand.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1337
rc4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1338
openssl/ripemd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1338
wolfcrypt/ripemd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1339
openssl/rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1340
wolfcrypt/rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1342
openssl/sha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1347
wolfcrypt/sha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351
openssl/sha3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1353

NetBurner, Inc.
258 File Index

wolfcrypt/sha3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1355
openssl/srp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1357
wolfcrypt/srp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1357
ssl23.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1359
stack.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1359
tls1.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360
txt_db.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360
ui.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361
x509.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361
x509_vfy.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1362
x509v3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1362
options.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1364
quic.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1365
sniffer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1366
sniffer_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1370
test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1372
version.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1434
arc4.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1434
asn.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1435
asn_public.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1465
async.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1475
blake2-impl.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1475
blake2-int.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1477
blake2.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1479
chacha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1480
chacha20_poly1305.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1481
coding.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1483
compress.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1484
cpuid.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1485
cryptocb.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1486
curve25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1492
curve448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1494
des3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1496
dilithium.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1497
ecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1499
eccsi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1510
error-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1511
falcon.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1515
fe_448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1516
fe_operations.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1518
fips.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1520
fips_test.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1520
ge_448.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1521
ge_operations.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1522
hc128.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1523
idea.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1524
integer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1525
logging.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1530
md2.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1532
mem_track.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1533
memory.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1538
misc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1541
mpi_class.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1543
mpi_superclass.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1554
pkcs11.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1555
poly1305.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1561
afalg_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1563
wc_afalg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1564

NetBurner, Inc.
18.1 File List 259

cryptoCell.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1564
atmel.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1565
caam_driver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1567
caam_error.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1572
caam_qnx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1572
wolfcaam.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573
wolfcaam_aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1575
wolfcaam_cmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576
wolfcaam_ecdsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576
wolfcaam_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576
wolfcaam_qnx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1577
wolfcaam_rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1578
wolfcaam_seco.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1578
wolfcaam_sha.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1580
wolfcaam_x25519.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
cavium_nitrox.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
cavium_octeon_sync.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
psoc6_crypto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1582
wc_devcrypto.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1582
esp32-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1583
quickassist.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586
quickassist_mem.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586
quickassist_sync.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586
iotsafe.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1586
kcapi_dh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589
kcapi_ecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589
kcapi_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1590
kcapi_hmac.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1590
kcapi_rsa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591
wc_kcapi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591
nrf51.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1591
dcp_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1592
ksdk_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1592
se050_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1594
pic32mz-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1595
psa.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1598
renesas-sce-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1599
renesas-tsip-crypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1602
renesas_cmn.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1608
renesas_sync.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1609
renesas_tsip_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1609
silabs_aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1610
silabs_ecc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1611
silabs_hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1611
silabs_random.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1612
stm32.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1612
stsafe.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1614
ti-ccm.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1615
ti-hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1616
xil-sha3.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1617
pwdbased.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1617
rabbit.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1618
rc2.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1619
sakke.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1620
selftest.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1622
settings.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1622
sha256.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1655
sha512.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1659

NetBurner, Inc.
260 File Index

signature.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1663
siphash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1664
sp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1665
sp_int.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1669
tfm.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1680
types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1691
visibility.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1707
wc_encrypt.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1708
wc_pkcs11.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1710
wc_port.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1711
wolfevent.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723
wolfmath.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1724
wolfio.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1725
NbWolfSsh.h
NetBurner SSH API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1735
SshSocket.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1738
UserAuthManager.h
NetBurner User Authorization Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1739
nbWifiApi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741
nbWifiDriver.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1742
nbWifiMsgStructs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1746
nbWifiSerial.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1750
nbWifiSpi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751
nbWifiConstants.h
Wifi Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1752
nbWifiDebug.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1763
wifi.h
NetBurner Wifi API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1765
wifiBsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1767
wifiDriver.h
NetBurner Wifi API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1767
libraries/include/crypto/wolfssl/openssl/aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1772
libraries/include/crypto/wolfssl/wolfcrypt/aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1773
nbrtos/include/aes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1780
arp.h
ARP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1780
arpinternal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1782
atcommand.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1783
autoip.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1783
base64.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1784
buffers.h
NetBurner Buffers API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1785
cc_attrs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1790
command.h
NetBurner Command Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1790
config_netobj.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1793
config_obj.h
Configuration object header file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1796
config_server.h
Configuration Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1810
config_time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1812
constants.h
NetBurner System Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1813
convert.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1817
counters.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1818
dbgmon.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1819
debugalloc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1819
debugiprintf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1821

NetBurner, Inc.
18.1 File List 261

debugprintblock.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1822
defer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1822
device.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1823
dhcpclient.h
NetBurner IPv4 DHCP Client Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1826
dhcpd.h
NetBurner DHCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1828
dhcpinternals.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1832
diagnostics.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1834
discoveryservlet.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1836
dns.h
NetBurner Domain Name Server Header File . . . . . . . . . . . . . . . . . . . . . . . . . . 1837
api_f.h
Embedded Flash File System - FAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1838
cfc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1846
chkdsk.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1847
common.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1848
debug.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1849
effs_utils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1850
fat.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1851
fat_m.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1857
effs_fat/fwerr.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1858
file/fwerr.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1859
mmc_dsc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861
mmc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1862
multi_drive_mmc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1863
port_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1865
ramdrv_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1865
sdhc_mcf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1866
udefs_f.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1868
endian.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1871
ethernet.h
NetBurner Ethernet API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1871
fd_adapter.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1873
fd_dns.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
fd_drivers.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
fdiprintf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
fdprintf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
effsstd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
flashdrv.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1875
fsf.h
Embedded Flash File System, EFFS-STD . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1876
fsm.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1880
fsmf.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1885
fstaticw.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1887
port_s.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1888
ramdrv_s.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1889
udefs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1889
ftp.h
NetBurner FTP Client API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1891
ftpd.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1893
gdbstub.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1898
hal.h
NetBurner Hardware Abstraction Layer (HAL) . . . . . . . . . . . . . . . . . . . . . . . . . . 1898
libraries/include/crypto/wolfssl/wolfcrypt/hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1901
nbrtos/include/hash.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1904
HiResDelay.h
NetBurner High resolution delay Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905

NetBurner, Inc.
262 File Index

htmlfiles.h
NetBurner HTTP Web Server File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905
http.h
NetBurner HTTP Web Server Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1908
httppass.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912
httppost.h
NetBurner HTTP Web Server Post handling Header File . . . . . . . . . . . . . . . . . . . . 1912
https.h
NetBurner HTTPS Secure Web Server Header File . . . . . . . . . . . . . . . . . . . . . . . 1915
ieee802.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1915
includes.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1917
init.h
NetBurner System Initialization Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . 1918
IntervalTimer.h
NetBurner Interval Timer API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1919
iointernal.h
Extra File Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1919
iosys.h
NetBurner I/O System Library API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1921
ip.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1925
ip_negotiation.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1931
ipshow.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1932
dhcpv6_const.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1932
dhcpv6_internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1933
dhcpv6_msg.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1935
ipv6_addr.h
NetBurner IPADDR6 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1939
ipv6_constants.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1942
ipv6_diag.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1943
ipv6_frames.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1943
ipv6_interface.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1946
json_lexer.h
NetBurner JSON Lexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1953
lldp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1961
logme.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1961
mailto.h
Send Emails with SMTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1962
libraries/include/crypto/wolfssl/openssl/md5.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1965
libraries/include/crypto/wolfssl/wolfcrypt/md5.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1966
nbrtos/include/md5.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1967
mDNS.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1968
multicast.h
NetBurner Multicast API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1969
multihome.h
Create Multihome and VLAN Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1970
nbprintfinternal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1971
nbrtos.h
NetBurner Real-Time Operating System API . . . . . . . . . . . . . . . . . . . . . . . . . . . 1972
nbssh.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1987
nbstring.h
NetBurner String Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1987
nbtime.h
NetBurner Time Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1991
nbupdate.h
Signed Application Update API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1993
netbios.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1995
netDevice.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2000
netinterface.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2005

NetBurner, Inc.
18.1 File List 263

netrx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2012
nettimer.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2013
nettypes.h
NetBurner IPADDR4 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2014
pop3.h
NetBurner POP3 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2019
ppp.h
PPP - Point to Point Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2021
examples/JSON/DemoNetBurner/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . 2025
examples/MultiHome/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . . . . . 2025
examples/OverloadDirectory/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . 2025
examples/Profile/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . . . . . . . 2025
examples/SSH/SecureSerToEthFactoryApp/overload/nbrtos/include/predef-overload.h . . . . . . . . . . 2025
examples/SSH/sshMinimalClient/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . 2025
examples/SSH/sshMinimalServer/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . 2025
examples/SSH/sshServerUserAuth/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . 2025
examples/SSH/SshServerUserKey/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . 2026
examples/SSL/FTPSServer/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . 2026
examples/SSL/HttpsUploadCert/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . 2026
examples/StackProtection/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . . 2026
examples/telnetcmd/overload/nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . . . . . 2026
nbrtos/include/predef-overload.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2026
examples/VLan/overload/nbrtos/include/predef.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2026
nbrtos/include/predef.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2030
qspiBsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2034
qspiShared.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2039
libraries/include/crypto/wolfssl/wolfcrypt/random.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2044
nbrtos/include/random.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
randseed.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
sdio.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
sdioBsp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2060
sdioBus.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2060
serial.h
NetBurner Serial API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2063
serial_extensions.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2065
serinternal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2066
servlets.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2067
sha1.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2068
ShutDownNotifications.h
NetBurner Shutdown Notification Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 2068
smarttrap.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
snmp.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
Socks.h
NetBurner SOCKS5 API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2069
stackFns.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2073
startnet.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2073
stopwatch.h
NetBurner Stopwatch Timer API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2073
StreamUpdate.h
Read an Application File from an Input Stream . . . . . . . . . . . . . . . . . . . . . . . . . 2074
syslog.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2076
system.h
NetBurner System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2077
taskmon.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2078
tcp.h
NetBurner TCP API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2078
tcp_private.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2087

NetBurner, Inc.
264 File Index

tftp.h
NetBurner TFTP API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2088
timezones.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2089
udp.h
NetBurner User Datagram Protocol Header File . . . . . . . . . . . . . . . . . . . . . . . . . 2090
utils.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2098
vjhc.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2102
http_funcs.h
JSON HTTP functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2103
web_buffers.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2107
web_client.h
Web Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2108
websockets.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2109
mDNS.cpp
NetBurner mDNS implimentaion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2112
tcp_internal.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2112
bsp.h
Low level hardware functions for the MOD5441x platform . . . . . . . . . . . . . . . . . . . . 2119
bsp_devboard.h
Hardware definitions related to the standard NNDK carrier board that are unique to a specific
platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2120
pinconstant.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2121
pins.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2124
plat_cfg_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2125
nbWifiDefs.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2125

NetBurner, Inc.
Chapter 19

Module Documentation

19.1 ARP - Address Resolution Protocol


Functions
• void ShowArp ()
Display ARP cache, output will be the stdio serial port.
• void fShowArp (FILE ∗fp)
Display ARP cache, output will be sent to the specified file pointer.
• BOOL GetArpMacFromIp (IPADDR4 ip, MACADR &ma)
Check to see if the specified IP address is in the ARP cache.
• void sendGratuitousArp (int interfaceNumber, IPADDR4 ip)
Send Gratuitous ARP Request.

19.1.1 Detailed Description


The Address Resolution Protocol (ARP) is a protocol for mapping an Internet Protocol address (IP Address) to a
physical machine address called the Media Access Control (MAC), that is recognized on the local network. An local
ARP cache correlating machine IP address to MAC address is maintained on each local machine.
When a host such as a PC computer attempts to communicate with another device, ARP is used to resolve the IP
address to the corresponding MAC address.

19.1.2 Function Documentation

19.1.2.1 fShowArp()

void fShowArp (
FILE ∗ fp )
Display ARP cache, output will be sent to the specified file pointer.

Parameters

∗fp pointer to type FILE.

NetBurner, Inc.
266 Module Documentation

See also

ShowArp()

19.1.2.2 GetArpMacFromIp()

BOOL GetArpMacFromIp (
IPADDR4 ip,
MACADR & ma )
Check to see if the specified IP address is in the ARP cache.
This function does not send and arp request, it only checks the arp cache. If you want it to send an arp you could
do something like send a ping to the IP address before calling this function.

Parameters

ip IP address to check for


&ma MACADR structuire to hold the result (C++ pass by reference)

Return values

TRUE if found, otherwise FALSE.

19.1.2.3 sendGratuitousArp()

void sendGratuitousArp (
int interfaceNumber,
IPADDR4 ip )
Send Gratuitous ARP Request.
Used after adding an interface or changing an IP address to update the ARP caches of other hosts on the network.
Ensure the interface has a valid IP address before sending.

Parameters

interfaceNumber Specified which network interface to send on.


ip The interface's IP address

19.1.2.4 ShowArp()

void ShowArp ( )
Display ARP cache, output will be the stdio serial port.

See also

fShowArp()

19.2 Authorization Responses


Enumerations
• enum AuthResponse : int16_t {
eAuthSuccess = 1 , eAuthErrorUserExists = -1 , eAuthErrorUserDoesNotExist = -2 , eAuthErrorNoEmptyUserAuthRecords
= -3 ,

NetBurner, Inc.
19.3 Authorization Types 267

eAuthErrorUnableToCreateHash = -4 , eAuthErrorAuthCheckFailed = -5 , eAuthErrorAuthTypeMismatch = -6


, eAuthErrorFailedRecordUpdate = -7 ,
eAuthErrorUnableToAddUser = -8 , eAuthErrorSaveFailed = -9 }
Response return codes when checking for the authorization status of a user.

19.2.1 Detailed Description


19.2.2 Enumeration Type Documentation

19.2.2.1 AuthResponse

enum AuthResponse : int16_t


Response return codes when checking for the authorization status of a user.

Enumerator

eAuthSuccess The authorization request or function was successful.


eAuthErrorUserExists The user already exists.
eAuthErrorUserDoesNotExist The user does not exist.
eAuthErrorNoEmptyUserAuthRecords The authorization records are full.
eAuthErrorUnableToCreateHash There was an error hashing the authorization value.
eAuthErrorAuthCheckFailed The authorization check failed.
eAuthErrorAuthTypeMismatch The authorization type didn't match the request.
eAuthErrorFailedRecordUpdate The record update failed.
eAuthErrorUnableToAddUser The user was not added successfully.
eAuthErrorSaveFailed Unable to save user authorization records.

19.3 Authorization Types


Enumerations
• enum AuthType : int8_t { eAuthTypeDefault = 0 , eAuthTypePassword = 1 , eAuthTypeKey = 2 }
The types of authorization requests that are managed. These just indicate what the has value is, and don't provide
any specific processing logic.

19.3.1 Detailed Description


19.3.2 Enumeration Type Documentation

19.3.2.1 AuthType

enum AuthType : int8_t


The types of authorization requests that are managed. These just indicate what the has value is, and don't provide
any specific processing logic.

Enumerator

eAuthTypeDefault Default value, should be considered an invalid type.


eAuthTypePassword Password.
eAuthTypeKey Key.

NetBurner, Inc.
268 Module Documentation

19.4 BSS Options


Option list BSS type values.

Macros
• #define BSSTYPE_VALUE_INFR (0x00)
Infrastructure.
• #define BSSTYPE_VALUE_ADHOC (0x01)
ADHOC.
• #define BSSTYPE_VALUE_ANY (0x02)
Any.
• #define BSSTYPE_VALUE_UNKNOWN (0xFF)
Unknown.

19.4.1 Detailed Description


Option list BSS type values.

19.5 Buffers - System Buffer Pool


Functions
• void FreeBufferList (PoolPtr nbuf)
FreeBufferList Frees a linked list of pool buffers. The buffers must be linked by the pNextFifo_El Pointer.
• uint16_t GetFreeCount ()
Returns the number of free buffers in the system. Buffers are used for both serial and network interfaces.
• void ShowBuffer (PoolPtr p)
Prints a pool buffer to stdout.

19.5.1 Detailed Description


Functions associated with the buffers allocated for use by network interfaces and serial ports. If a system runs out
of buffers it will no longer be able to send or receive network data.

19.5.2 Function Documentation

19.5.2.1 FreeBufferList()

void FreeBufferList (
PoolPtr pp )
FreeBufferList Frees a linked list of pool buffers. The buffers must be linked by the pNextFifo_El Pointer.

Parameters

pp The first PoolPtr in the list to be freed

19.5.2.2 GetFreeCount()

uint16_t GetFreeCount ( )
Returns the number of free buffers in the system. Buffers are used for both serial and network interfaces.

NetBurner, Inc.
19.8 Certificate Generation Key Types 269

This function returns the number of free pool buffers, which are used for network and serial communication. The
maximum number of buffers is defined in \nburn\nbrtos\include\constants.h:
#define BUFFER_POOL_SIZE (128)
The size of each buffer is defined as:
#define ETHER_BUFFER_SIZE 1548
If the number of free buffers reaches zero, then no further network communication will be possible until some buffers
are freed. This is a good function to use as a debug tool for detecting buffer leaks in your application.
Serial ports also use buffers, which are allocated in constants.h:
#define SERIAL_TX_BUFFERS (2)
#define SERIAL_RX_BUFFERS (2)
Each serial port buffer is equal in size to an Ethernet buffer.

Returns

The number of free buffers in the system.

19.6 CAN
Modules
• ColdFire MCF5441x Platforms
• MODM7AE70

19.6.1 Detailed Description


Controller Area Network (CAN) API for NetBurner Platforms

19.7 Certificate Generation Alternate Name Types


Enumerations
• enum AltNameType_t : char { ALT_NAME_TYPE_NONE = 0 , ALT_NAME_TYPE_DNS = (char)0x82 ,
ALT_NAME_TYPE_IP = (char)0x87 }
Certificate Generation Alternate Name Types.

19.7.1 Detailed Description


19.7.2 Enumeration Type Documentation

19.7.2.1 AltNameType_t

enum AltNameType_t : char


Certificate Generation Alternate Name Types.

Enumerator

ALT_NAME_TYPE_NONE None.
ALT_NAME_TYPE_DNS DNS Name.
ALT_NAME_TYPE_IP IP Address.

19.8 Certificate Generation Key Types


Enumerations
• enum SslKeyType_t {
SSL_KEY_NONE = 0 , SSL_KEY_RSA_1024 = 1 , SSL_KEY_RSA_2048 , SSL_KEY_RSA_4096 ,

NetBurner, Inc.
270 Module Documentation

SSL_KEY_ECC_SECP192R1 = ECC_SECP192R1 , SSL_KEY_ECC_SECP224R1 = ECC_SECP224R1 ,


SSL_KEY_ECC_SECP256R1 = ECC_SECP256R1 , SSL_KEY_ECC_SECP384R1 = ECC_SECP384R1 ,
SSL_KEY_ECC_SECP521R1 = ECC_SECP521R1 }
Certificate Generation Key Types.

19.8.1 Detailed Description


19.8.2 Enumeration Type Documentation

19.8.2.1 SslKeyType_t

enum SslKeyType_t
Certificate Generation Key Types.

Enumerator

SSL_KEY_NONE None.
SSL_KEY_RSA_1024 RSA 1024.
SSL_KEY_RSA_2048 RSA 2048.
SSL_KEY_RSA_4096 RSA 4096.
SSL_KEY_ECC_SECP192R1 Defined in wolfssl/wolfcrypt/ecc.h.
SSL_KEY_ECC_SECP224R1 Defined in wolfssl/wolfcrypt/ecc.h.
SSL_KEY_ECC_SECP256R1 Defined in wolfssl/wolfcrypt/ecc.h.
SSL_KEY_ECC_SECP384R1 Defined in wolfssl/wolfcrypt/ecc.h.
SSL_KEY_ECC_SECP521R1 Defined in wolfssl/wolfcrypt/ecc.h.

19.9 Cipher Options


Macros
• #define CIPH_VALUE_NONE (0x00)
Option list cipher value: No cipher.
• #define CIPH_VALUE_TKIP (0x01)
Option list cipher value: TKIP.
• #define CIPH_VALUE_AES (0x02)
Option list cipher value: AES.
• #define CIPH_VALUE_MIXED (0x03)
Option list cipher value: Mixed TKIP/AES.
• #define CIPH_VALUE_UNKNOWN (0xFF)
Option list cipher value: Unkown cipher.

19.9.1 Detailed Description

19.10 ColdFire MCF5441x (DSPI)


Modules
• DSPI state

NetBurner, Inc.
19.10 ColdFire MCF5441x (DSPI) 271

Classes
• class DSPIModule
DSPIModule is a SPI communications driver. It is an object based driver, which allows for low overhead multiplexing
between peripherals with different bus configurations.

Enumerations
• enum csReturnType {
DEASSERT_NEVER = 0 , DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 ,
DEASSERT_NEVER = 0 ,
DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 }
Chip select return types.
• enum spiChipSelect {
CHIP_SELECT_0 = 0 , CHIP_SELECT_1 = 1 , CHIP_SELECT_2 = 2 , CHIP_SELECT_3 = 3 ,
CHIP_SELECT_DISABLED = 0xFF , CHIP_SELECT_0 = 0xFE , CHIP_SELECT_1 = 0xFD , CHIP_SELECT_2
= 0xFB ,
CHIP_SELECT_3 = 0xF7 , CHIP_SELECT_DISABLED = 0xFF }
Chip select number.
• enum spiChipSelectPolarity { CS_ASSERT_LOW = 0 , CS_ASSERT_HIGH = 1 , CS_ASSERT_LOW = 0x00
, CS_ASSERT_HIGH = 0xFF }
Chip select polarity.

Functions
• uint8_t DSPIInit (uint8_t SPIModule=DEFAULT_DSPI_MODULE, uint32_t Baudrate=2000000, uint8_←-
t QueueBitSize=8, uint8_t CS=0x00, uint8_t CSPol=0x0F, uint8_t ClkPolarity=0, uint8_t ClkPhase=1, BOOL
DoutHiz=TRUE, uint8_t QCD=0, uint8_t DTL=0)
Initialize a DSPI module.

19.10.1 Detailed Description


The DMA serial peripheral interface (DSPI) interfaces (up to 3 depending on your platform) provide a synchronous
serial bus for communication between the processor and an external peripheral device. DSPI interface modules are
numbered from 0 to 3. DSPI 0 is reserved for system use. The DSPI supports up to 32 queued SPI transfers (16
receive and 16 transmit) in the DSPI resident FIFOs eliminating CPU intervention between transfers.
The DSPI specification allows for sharing the SPI bus with multiple devices. However, when designing your system,
you must consider what devices are connected and the desired throughput. For example, if you are using the
Embedded Flash File System (EFFS) with external Flash cards, or the WiFi module, they will require exclusive use
of the DSPI interface.
The DSPI uses the following hardware signals:

• SCLK Serial clock output from master.

• MOSI Master data output (transmit), slave data input (receive).

• MISO Master data input (receive), slave data output (transmit).

• QSPI_CSn Optional QSPI chip selects. Note that you can also use GPIO signals and control them manually
for the chip select functionality. In some cases, there are advantages to doinig it this way.

DSPI Configuration and Initialization


Use of the DSPI requires:

1. Identify which pins on your NetBurner device provide primary or secondary QSPI functionality. Use the Net←-
Burner Pins class functions to configure these pins for QSPI operation.

2. Single task applications: you can choose to call the DSPIdone() function to determine when the DSPI transfer
is complete, or use a semaphore and pend for completion.

NetBurner, Inc.
272 Module Documentation

3. Multi-task applications: If your application has more than one task that will access the same DSPI, you must
create a semaphore to control access to the DSPI resource, just as you would with any shared resource.

4. Initialize the DSPI with the DSPIInit() function.

5. When you have data to send, or want to read data from the DSPI slave device, call the QSPIStart() function
to initiate the data transfer.

6. The semaphore will post when the data transfer is complete.

19.10.2 Enumeration Type Documentation

19.10.2.1 csReturnType

enum csReturnType
Chip select return types.
Chip select deassertion modes. Used to determine when the driver should deassert chip selects during SPI transfer.

Enumerator

DEASSERT_NEVER The chip select used for the transaction should remain asserted, even
after the transaction is complete.
DEASSERT_AFTER_LAST The chip select should remain asserted for the full duration of the
transaction, and only be deasserted after the final transfer.
DEASSERT_EVERY_TRANSFER The chip select should be deasserted between every transfer within the
transaction.Deassert chip select After every transfer.
DEASSERT_NEVER The chip select used for the transaction should remain asserted, even
after the transaction is complete.
DEASSERT_AFTER_LAST The chip select should remain asserted for the full duration of the
transaction, and only be deasserted after the final transfer.
DEASSERT_EVERY_TRANSFER The chip select should be deasserted between every transfer within the
transaction.

19.10.2.2 spiChipSelect

enum spiChipSelect
Chip select number.
If supported by the SPI peripheral, these values can be used to configure the chip select to be used during a SPI
transfer.

Enumerator

CHIP_SELECT_0 Configure the SPI peripheral to use chip select 0.


CHIP_SELECT_1 Configure the SPI peripheral to use chip select 1.
CHIP_SELECT_2 Configure the SPI peripheral to use chip select 2.
CHIP_SELECT_3 Configure the SPI peripheral to use chip select 3.
CHIP_SELECT_DISABLED Configure the SPI peripheral to disable chip select.
CHIP_SELECT_0 Configure bit mask for SPI chip select 0.
CHIP_SELECT_1 Configure bit mask for SPI chip select 1.
CHIP_SELECT_2 Configure bit mask for SPI chip select 2.
CHIP_SELECT_3 Configure bit mask for SPI chip select 3.
CHIP_SELECT_DISABLED Configure bit mask to disable chip select.

NetBurner, Inc.
19.10 ColdFire MCF5441x (DSPI) 273

19.10.2.3 spiChipSelectPolarity

enum spiChipSelectPolarity
Chip select polarity.
These values can be used to configure the chip select's asserted/deasserted logic level. These values will configure
all chip selects to the same configuration. If you intend on using an SPI peripheral with multiple chip selects with
different polarities, these values cannot not be used.

Enumerator

CS_ASSERT_LOW Assert all chip selects to logic level LOW during a SPI transaction.
CS_ASSERT_HIGH Assert all chip selects to logic level HIGH during a SPI transaction.
CS_ASSERT_LOW Bit mask configures all active chip selects as active low, inactive high.
CS_ASSERT_HIGH Bit mask configures all active chip selects as inactive low, active high.

19.10.3 Function Documentation

19.10.3.1 DSPIInit()

uint8_t DSPIInit (
uint8_t SPIModule = DEFAULT_DSPI_MODULE,
uint32_t Baudrate = 2000000,
uint8_t QueueBitSize = 8,
uint8_t CS = 0x00,
uint8_t CSPol = 0x0F,
uint8_t ClkPolarity = 0,
uint8_t ClkPhase = 1,
BOOL DoutHiz = TRUE,
uint8_t QCD = 0,
uint8_t DTL = 0 )
Initialize a DSPI module.
Notes:

• The maximum baud rate is CPU_CLOCK / 3

• Will initialize to the highest available baud rate that does not exceed the maximum

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for greater than 8 bits per transfer then the data must be uint16_t aligned

• If configured for greater than 16 bits per transfer then the data must be uint32_t aligned

• Chip select is based on chipSelectPolarity

• 0 data captured leading edge of DSPI_CLK, changed following edge.

• 1 data changed leading edge of DSPI_CLK, captured following edge.

• 0 default is as close to 1/2 DSPI_CLK without going under, keeping with the interface to SPI

• 0 default is 17/(system clock / 2), in keeping with interface to QSPI

Parameters

SPIModule SPI module number, 0 - 1

NetBurner, Inc.
274 Module Documentation

Parameters
Baudrate Maximum baud rate requested
QueueBitSize Number of bits per transfer: 8, 16 or 32
CS SPI chip selects to use for transfer
CSPol 0 = inactive logic level low, 1 = high
ClkPolarity 0 = inactive logic level low, 1 = high
ClkPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed leading edge
clock, captured following edge.
DoutHiz Data output high impedance between transfers
QCD Delay from chip select to valid clock (default is 0)
DTL Chip select mode dspiChipSelectMode

Returns

Current stat of DSPI bus dspiState

19.11 ColdFire MCF5441x Platforms


Classes
• class canMCF5441x::CanRxMessage
Class to hold received CAN messages.

19.11.1 Detailed Description


Control Area Network (CAN) for ColdFire MCF5441x platforms including MOD54415, MOD54417, NANO54415 and
SB800EX.

19.12 Command Processor


Modules
• Command Processor Disconnect Causes
• Command Processor Listen Channels
• Command Processor Response Codes

Functions
• int CmdStartCommandProcessor (int priority)
Start the command processor.
• int CmdAddCommandFd (int fd, bool require_auth, bool time_out_conn, bool local_echo=true)
Add an established FD connection to the list of fd's managed by the command processor.
• int CmdRemoveCommandFd (int fd)
Remove an established FD (either a TCP session, a serial connection, or an SSH session).
• int CmdListenOnTcpPort (uint16_t port, int do_telnet_processing, int max_connections)
Start listening for a connection over TCP.
• int CmdListenQuietOnTcpPort (uint16_t port, int do_telnet_processing, int max_connections)
Start listening for a connection over TCP, but without the siggnon or password.
• int CmdListenOnSshPort (uint16_t port, int max_connections)
Start listening for a connection over SSH.
• int CmdListenQuietOnSshPort (uint16_t port, int max_connections)
Start listening for a connection over SSH, but without the siggnon or password.

NetBurner, Inc.
19.12 Command Processor 275

• int CmdStopListeningOnTcpPort (uint16_t port)


Stop Listening for connections on the specified port. Also closes all open connections that were based on that port.
• int CmdStopListeningOnSshPort (uint16_t port)
Stop Listening for connections on the specified port. Also closes all open connections that were based on that port.
• void SendToAll (const char ∗buffer, int len, bool include_serial_ports)
Send a message to all connected sockets, excluding "Listening sockets".

Variables
• int(∗ CmdAuthenticateFunc )(const char ∗name, const char ∗passwd)
External Authentication function CALLBACK for TCP connections, used to verify username and password. If this
function pointer is not NULL then each new Telnet session will be asked to authenticate.
• int(∗ CmdAuthenticateSshFunc )(const char ∗name, const char ∗authVal, AuthType authType)
External Authentication function CALLBACK for SSH connections, used to verify username and password. If this
function pointer is not NULL then each new SSH session will be asked to authenticate. If this function pointer is
NULL, it tries to use CmdAuthenticateFunc instead.
• int(∗ CmdCmd_func )(const char ∗command, FILE ∗fRespondto, void ∗pData)
The command processing callback function for handling string commands.
• int(∗ CmdChar_func )(char command, FILE ∗fRespondto, void ∗pData)
The command processing callback function for handling single character commands. If this is implemented does not
do echo or line editing this is the responsibility of the application programmer.
• void ∗(∗ CmdConnect_func )(FILE ∗fRespondto)
Connect callback function. If this function is not NULL, then the system will call this function every time a new session
is started.
• void(∗ CmdPrompt_func )(FILE ∗fRespondto, void ∗pData)
Prompt callback function. If this function is not NULL, then the system will call this function every time a new prompt
line needs to be displayed.
• void(∗ CmdDisConnect_func )(FILE ∗fRespondto, int cause, void ∗pData)
Dis-Connect callback function, if this function is not NULL then the system will call this function every time a session
is terminated.
• int CmdIdleTimeout
• const char ∗ Cmdlogin_prompt
If this is defined, then it will be sent to the socket on connection before Authentication is tried.

19.12.1 Detailed Description


This is is NetBurner's Command Processor Library. It operates as a task and reads input one line at a time from
multiple sources. When it has gathered a whole line, it sends it to a command processor that is defined by the user.

19.12.2 Function Documentation

19.12.2.1 CmdAddCommandFd()

int CmdAddCommandFd (
int fd,
bool require_auth,
bool time_out_conn,
bool local_echo = true )
Add an established FD connection to the list of fd's managed by the command processor.

Parameters

fd The file descriptor.


require_auth Do we Authenticate the connection on this FD?

NetBurner, Inc.
276 Module Documentation

Parameters

time_out_conn Do we time out the connection on this FD?


local_echo Do we provide a local echo for this FD (default is true)?

Return values

CMD_OK Command processor task started properly.


CMD_FAIL Command processor task failed to start.
CMD_TO_MANY_FDS Too many file descriptors are currently in use.

19.12.2.2 CmdListenOnSshPort()

int CmdListenOnSshPort (
uint16_t port,
int max_connections )
Start listening for a connection over SSH.

Parameters
port The port number to listen on.
max_connections What are the max number of connections we should allow on this port?

Return values

CMD_OK Successfully removed the file descriptor.


CMD_TO_MANY_FDS Too many file descriptors are currently in use.
CMD_FAILED_SSH_KEY_GEN Unable to generate the key needed for SSH communication.

19.12.2.3 CmdListenOnTcpPort()

int CmdListenOnTcpPort (
uint16_t port,
int do_telnet_processing,
int max_connections )
Start listening for a connection over TCP.

Parameters
port The port number to listen on.
do_telnet_processing Should we treat the port as telnet and process telnet negotiations?
max_connections What are the max number of connections we should allow on this port?

Return values

CMD_OK Successfully removed the file descriptor.


CMD_TO_MANY_FDS Too many file descriptors are currently in use.

NetBurner, Inc.
19.12 Command Processor 277

19.12.2.4 CmdListenQuietOnSshPort()

int CmdListenQuietOnSshPort (
uint16_t port,
int max_connections )
Start listening for a connection over SSH, but without the siggnon or password.

Parameters
port The port number to listen on.
max_connections What are the max number of connections we should allow on this port?

Return values

CMD_OK Successfully removed the file descriptor.


CMD_TO_MANY_FDS Too many file descriptors are currently in use.
CMD_FAILED_SSH_KEY_GEN Unable to generate the key needed for SSH communication.

19.12.2.5 CmdListenQuietOnTcpPort()

int CmdListenQuietOnTcpPort (
uint16_t port,
int do_telnet_processing,
int max_connections )
Start listening for a connection over TCP, but without the siggnon or password.

Parameters
port The port number to listen on.
do_telnet_processing Should we treat the port as telnet and process telnet negotiations?
max_connections What are the max number of connections we should allow on this port?

Return values

CMD_OK Successfully removed the file descriptor.


CMD_TO_MANY_FDS Too many file descriptors are currently in use.

19.12.2.6 CmdRemoveCommandFd()

int CmdRemoveCommandFd (
int fd )
Remove an established FD (either a TCP session, a serial connection, or an SSH session).

Parameters

fd The file descriptor to remove.

NetBurner, Inc.
278 Module Documentation

Return values

CMD_OK Successfully removed the file descriptor.


CMD_FAIL Failed to remove the file descriptor.

19.12.2.7 CmdStartCommandProcessor()

int CmdStartCommandProcessor (
int priority )
Start the command processor.

Parameters

priority The NBRTOS task priority to run at.

Return values

CMD_OK Command processor task started properly.


CMD_FAIL Command processor task failed to start.

19.12.2.8 CmdStopListeningOnSshPort()

int CmdStopListeningOnSshPort (
uint16_t port )
Stop Listening for connections on the specified port. Also closes all open connections that were based on that port.

Parameters
port The port number to listen on.

Return values

CMD_OK Successfully removed the file descriptor.


CMD_FAIL Port requested wasn't listening for a connection.

19.12.2.9 CmdStopListeningOnTcpPort()

int CmdStopListeningOnTcpPort (
uint16_t port )
Stop Listening for connections on the specified port. Also closes all open connections that were based on that port.

Parameters
port The port number to listen on.

Return values

CMD_OK Successfully removed the file descriptor.

NetBurner, Inc.
19.12 Command Processor 279

Return values

CMD_FAIL Port requested wasn't listening for a connection.

19.12.2.10 SendToAll()

void SendToAll (
const char ∗ buffer,
int len,
bool include_serial_ports )
Send a message to all connected sockets, excluding "Listening sockets".

Parameters

buffer A buffer holding the message to send.


len The length of the buffer to send.
include_serial_ports Also send to serial ports?

19.12.3 Variable Documentation

19.12.3.1 CmdAuthenticateFunc

int(∗ CmdAuthenticateFunc) (const char ∗name, const char ∗passwd) (


const char ∗ name,
const char ∗ passwd ) [extern]
External Authentication function CALLBACK for TCP connections, used to verify username and password. If this
function pointer is not NULL then each new Telnet session will be asked to authenticate.

Parameters
name The user name trying to authenticate.
passwd The password provided for the user.

Return values

CMD_OK If the authentication was successful.


CMD_CLOSE If the authentication was not successful.

19.12.3.2 CmdAuthenticateSshFunc

int(∗ CmdAuthenticateSshFunc) (const char ∗name, const char ∗authVal, AuthType authType) (
const char ∗ name,
const char ∗ authVal,
AuthType authType ) [extern]
External Authentication function CALLBACK for SSH connections, used to verify username and password. If this
function pointer is not NULL then each new SSH session will be asked to authenticate. If this function pointer is
NULL, it tries to use CmdAuthenticateFunc instead.

NetBurner, Inc.
280 Module Documentation

Parameters
name The user name trying to authenticate.
authVal The authorization value provided for the user.
authType The type of authorization value passed in.

Return values

CMD_OK If the authentication was successful.


CMD_CLOSE If the authentication was not successful.

19.12.3.3 CmdChar_func

int(∗ CmdChar_func) (char command, FILE ∗fRespondto, void ∗pData) (


char command,
FILE ∗ fRespondto,
void ∗ pData ) [extern]
The command processing callback function for handling single character commands. If this is implemented does
not do echo or line editing this is the responsibility of the application programmer.

Parameters
command The single command character.
fRespondto The FILE ∗ all responses should be set to (use fprintf).
pData Any data that is associated from the session. This is returned by CmdConnect_func.

Return values

CMD_OK If the command was okay.


CMD_CLOSE If the command causes the session to terminate (Close).

See also

CmdCmd_func
CmdConnect_func

19.12.3.4 CmdCmd_func

int(∗ CmdCmd_func) (const char ∗command, FILE ∗fRespondto, void ∗pData) (


const char ∗ command,
FILE ∗ fRespondto,
void ∗ pData ) [extern]
The command processing callback function for handling string commands.

Parameters

command A pointer to the null terminated ASCII text of the command.


fRespondto The FILE ∗ all responses should be set to (use fprintf).
pData Any data that is associated from the session and is returned by CmdConnect_func.

NetBurner, Inc.
19.12 Command Processor 281

Return values

CMD_OK If the command was okay.


CMD_CLOSE If the command causes the session to terminate (Close).

See also

CmdChar_func
CmdConnect_func

19.12.3.5 CmdConnect_func

void ∗(∗ CmdConnect_func) (FILE ∗fRespondto) (


FILE ∗ fRespondto ) [extern]
Connect callback function. If this function is not NULL, then the system will call this function every time a new
session is started.

Parameters

fRespondto The FILE ∗ all responses should be set to (use fprintf).

Return values
Returns an arbitrary void∗ data item to be associated with the session. This data item is the same pData
item used in other callback functions such as CmdPrompt_func.

See also

CmdCmd_func
CmdChar_func

19.12.3.6 CmdDisConnect_func

void(∗ CmdDisConnect_func) (FILE ∗fRespondto, int cause, void ∗pData) (


FILE ∗ fRespondto,
int cause,
void ∗ pData ) [extern]
Dis-Connect callback function, if this function is not NULL then the system will call this function every time a session
is terminated.

Parameters

fRespondto The FILE ∗ all responses should be set to (use fprintf).


cause Why it disconnected. Can be any value from Command Processor Disconnect Causes.
pData Any data that is associated from the session. This is returned by CmdConnect_func.

See also

CmdConnect_func

NetBurner, Inc.
282 Module Documentation

19.12.3.7 CmdIdleTimeout

int CmdIdleTimeout [extern]


User defined value that specifies the number of seconds a connection is idle before it is terminated due to inactivity.

19.12.3.8 CmdPrompt_func

void(∗ CmdPrompt_func) (FILE ∗fRespondto, void ∗pData) (


FILE ∗ fRespondto,
void ∗ pData ) [extern]
Prompt callback function. If this function is not NULL, then the system will call this function every time a new prompt
line needs to be displayed.

Parameters

fRespondto The FILE ∗ all responses should be set to (use fprintf).


pData Any data that is associated from the session. This is returned by CmdConnect_func.

See also

CmdConnect_func

19.13 Command Processor Disconnect Causes


Macros
• #define CMD_DIS_CAUSE_TIMEOUT (1)
Connection timed out.
• #define CMD_DIS_CAUSE_CLOSED (2)
Connection closed.
• #define CMD_DIS_SOCKET_CLOSED (3)
Socket closed. Don't send a response for this case.
• #define CMD_DIS_AUTH_FAILED (4)
Authorization failed. Don't send a response for this case.

19.13.1 Detailed Description


Possible causes given for disconnects.

19.14 Command Processor Listen Channels


Enumerations
• enum ListenOn : int8_t { eListenOnTcp = 1 , eListenOnSsh = 2 }
The various remote channels that the command processor can listen to.

19.14.1 Detailed Description


19.14.2 Enumeration Type Documentation

19.14.2.1 ListenOn

enum ListenOn : int8_t


The various remote channels that the command processor can listen to.

NetBurner, Inc.
19.15 Command Processor Response Codes 283

Enumerator

eListenOnTcp Listen on TCP.


eListenOnSsh Listen on SSH.

19.15 Command Processor Response Codes


Macros
• #define CMD_OK (0)
Function was excecuted properly.
• #define CMD_CLOSE (1)
Connection closed.
• #define CMD_FAIL (2)
General function failed.
• #define CMD_AUTH_FAIL (3)
Authorization failed.
• #define CMD_TO_MANY_FDS (4)
Too many file descriptors currently in use.
• #define CMD_FAILED_SSH_KEY_GEN (5)
Unable to correctly generate key needed for SSH connections.

19.15.1 Detailed Description


Valid return codes that can be returned by the NetBurner Command Processor functions.

19.16 Configuration Errors


Macros
• #define CONFIG_ERR_SUCCESS 0
Success.
• #define CONFIG_ERR_MSG_LENGTH -1
Message length.
• #define CONFIG_ERR_SSID_LEN_SHORT -2
SSID length too short.
• #define CONFIG_ERR_SSID_LEN_LONG -3
SSID length too long.
• #define CONFIG_ERR_PASSWD_LEN_LONG -4
Password length too long.
• #define CONFIG_ERR_INVALID_TABLE -5
Invalid table.
• #define CONFIG_ERR_INVALID_OPTION -6
Invalid option.
• #define CONFIG_ERR_BSSID_OVERRUN -7
BSSID overrun.
• #define CONFIG_ERR_BSSID_UNDERRUN -8
BSSID underrun.
• #define CONFIG_ERR_MULTI_CHANNEL -9
Multi-channel.
• #define CONFIG_ERR_CONNECTED -10

NetBurner, Inc.
284 Module Documentation

Already connected.
• #define CONFIG_ERR_UNKNOWN 1
Unknown.

19.16.1 Detailed Description

19.17 Configuration Server


Functions
• void EnableConfigMirror ()
Enable the configuration mirror.
• void SaveConfigToStorage ()
Write all pending data to flash memory.
• size_t ConfigSize ()
Returns the number of bytes currently in use by configuration flash.
• size_t ConfigMaxSize ()
Returns the number of bytes available in configuration flash.

19.17.1 Detailed Description


The configuration server manages the configuration variables, which can be used internally, or optionally presented
on a configuration server web page. Please refer to the configuration object section for more details.
There is a default factory web interface that is normally running on the device as a user interface to set configuration
options. Enabling the Configuration Mirror provides a method to replace the factory interface with your own custom
interface. The is an easy way to use your company brand on the device.
Any time a configuration variable is modified, it is marked as pending. Modified values will not be written to flash
memory until a call to SaveConfigToStorage() is executed. Note that if a user clicks on the Update button on the
configuration web page, values will be written to flash.

19.17.2 Function Documentation

19.17.2.1 ConfigMaxSize()

size_t ConfigMaxSize ( )
Returns the number of bytes available in configuration flash.

Returns

The maximum number of bytes available. This function is implemented in hal.cpp

19.17.2.2 ConfigSize()

size_t ConfigSize ( )
Returns the number of bytes currently in use by configuration flash.

Returns

Number of bytes in use

NetBurner, Inc.
19.18 Configuration Variable Flags 285

19.17.2.3 EnableConfigMirror()

void EnableConfigMirror ( )
Enable the configuration mirror.
When enabled, the application configuration web interface will replace the default system web interface. In this way
you can easily customize and brand the configuration web interface for your company.

Note

This is an empty function. To enable the config mirror, it needs to be called within the application code, which
in turn forces the function to be linked during compilation. The linking is what enables the config mirror.

19.17.2.4 SaveConfigToStorage()

void SaveConfigToStorage ( )
Write all pending data to flash memory.
Checks the pending flag of all configuration system objects and writes updates to flash memory
Write all pending data to flash memory.

19.18 Configuration Variable Flags


Variables
• const uint32_t fConfigValueLeaf = 0x01
Value is a leaf.
• const uint32_t fConfigReadOnly = 0x02
Variable is read-only.
• const uint32_t fConfigModified = 0x04
Variable has been modified, but not yet saved.
• const uint32_t fConfigHidden = 0x08
Not visible to configuration web server display.
• const uint32_t fConfigNoSave = 0x10
Do not save to flash memory when save functions are called.
• const uint32_t fConfigNoObscure = 0x20
Do not obscure the value.
• const uint32_t fConfigNeedReboot = 0x40
System reboot required for changes to take effect.

19.18.1 Detailed Description


Specifies the characteristics of a configuration variable, such as read-only, hidden, etc.

19.19 Configuration Variables


Configuration System Variables.

Modules
• Configuration Variable Flags

NetBurner, Inc.
286 Module Documentation

Classes
• class config_obj
Base class used to create configuration objects.
• class config_value
Base class used to create a configuration value.
• class config_uint
Unsigned 32-bit Integer Configuration Variable.
• class config_int
Signed 32-bit Integer Configuration Variable.
• class config_double
Double Float Configuration Variable.
• class config_bool
Boolean Configuration Variable.
• class config_string
String Configuration Variable.
• class config_pass
Password string Configuration Variable.
• class config_IPADDR4
Configuration Variable for IPADDR4 (IPv4) object types.
• class config_IPADDR
Configuration Variable for IPADDR (IPv6) object type.
• class config_MACADR
Configuration Variable for MACADR object type.
• class config_chooser
Chooser Configuration Variable - Select From a List of Items.

Functions
• void SaveConfigToStorage ()
Save configuration to flash storage.

19.19.1 Detailed Description


Configuration System Variables.
Configuration variable objects are part of the NetBurner 3.x configuration system. The use of configuration objects
facilitates a much easier method to create and store non-volatile information for both system configuration and for
user application configuration and storage. They use a JSON interface so the information can be easily downloaded
to save a configuration, or uploaded to configure the entire device at one time, such as in production bring-up. This
includes system configuration such as IP addresses, and also any settings specific to your application.
The JSON value types include: integer, unsigned integer, float, boolean and string. There are also objects for IPv4
IP, IPv6 IP, MAC addresses, passwords, and selection lists options. In JSON everything is represented as a string,
so there are object member functions to convert between values. These functions make use of the NBString class.
For customers using the 2.x tools, the User Parameter flash sector method is still available, but we do recommend
converting to the new configuration system. In 3.x you have the ability to access the data through a web configuration
page and also through JSON, but you can certainly choose not to use those features and treat the configuration
system as internal storage, and any configuration can be done through your application just as with the 2.x tool set.

Note

All modifications to configuration objects are marked as pending. A call to SaveConfigToStorage is required
to save changes to flash memory.

NetBurner, Inc.
19.20 Connect Request Errors 287

19.20 Connect Request Errors


Macros
• #define CONNECT_ERR_SUCCESS 0
Successfull connect request.
• #define CONNECT_ERR_NOT_CONFIG -1
Paramaters not configured.
• #define CONNECT_ERR_INVALID_CONFIG_NUM -2
Invalid config number.
• #define CONNECT_ERR_CONNECTED -3
Already connected.
• #define CONNECT_ERR_SSID_NOT_FOUND -4
SSID not found.
• #define CONNECT_ERR_BSSID_NOT_FOUND -5
BSSID not found.
• #define CONNECT_ERR_SEC_MISMATCH -6
Security mismatch.
• #define CONNECT_ERR_CIPH_MISMATCH -7
Cipher mismatch.
• #define CONNECT_ERR_INVALID_KEY -8
Invalid password.
• #define CONNECT_ERR_UNKNOWN 1
Unknown error.

19.20.1 Detailed Description

19.21 DHCP - IPv4 DHCP Client


Modules
• DHCP State

Classes
• class DhcpObject
DHCP client class.

Functions
• int32_t GetIntefaceDHCPState (int interface=0)
Returns current state of the DHCP lease, with optional interface parameter.
• int32_t WaitForDHCPInterface (int interface=0, uint16_t TicksToWait=10 ∗TICKS_PER_SECOND)
Wait until a DHCP lease is obtained, or the timeout occurs.

19.21.1 Detailed Description


IPv4 DHCP Client functions. Refer to the IPv6 documents for DHCPv6.
The DHCP client services are automatically controlled by the configuration option when the init() function is called
in an application. Options are:
• DHCP

• DHCP with Static Fallback

• Static
You may also create your own DHCP objects.

NetBurner, Inc.
288 Module Documentation

19.21.2 Function Documentation

19.21.2.1 GetIntefaceDHCPState()

int32_t GetIntefaceDHCPState (
int interface = 0 )
Returns current state of the DHCP lease, with optional interface parameter.
The GetDHCPState() function is a member function of the DHCP client class.

Returns

DHCP State

See also

GetDHCPState()

19.21.2.2 WaitForDHCPInterface()

int32_t WaitForDHCPInterface (
int interface = 0,
uint16_t TicksToWait = 10 ∗TICKS_PER_SECOND )
Wait until a DHCP lease is obtained, or the timeout occurs.

Parameters

interface The network interface to wait on.


TicksToWait The number of system Time Ticks to wait. The TICKS_PER_SECOND constant can be used to
more easily specify a number of seconds. If not specified, the default timeout is 10 seconds.

Returns

DHCP State

See also

GetDHCPState()

19.22 DHCP Server


Functions
• bool AddStandardDHCPServer (int intf=0, IPADDR4 startAddr=IPADDR4::NullIP())
Starts a standard allocator DHCP server.

19.22.1 Detailed Description


Adding a DHCP server will enable your NetBurner device to serve IPv4 addresses. This can be useful in circum-
stances such as direct connections between 2 devices.

19.22.2 Function Documentation

NetBurner, Inc.
19.23 DHCP State 289

19.22.2.1 AddStandardDHCPServer()

bool AddStandardDHCPServer (
int intf = 0,
IPADDR4 startAddr = IPADDR4::NullIP() )
Starts a standard allocator DHCP server.
Also checks for existing DHCP servers on the specified network interface.

Parameters

intf The interface to use. If no parameter is specified the default value is 0 which will use the first
system interface.
startAddr The starting IP address. If no parameter is specified the default range of 192.168.1.100 to
192.168.1.249 will be used.

Return values

true Success
false A server already exists or error starting the server

19.23 DHCP State


Macros
• #define SDHCP_NOTSTARTED 0
The System has not been initialized.
• #define SDHCP_DISCOVER 1
The system is discovering the DHCP servers.
• #define SDHCP_OFFER 2
The system has responded to an OFFER.
• #define SDHCP_ACK 3
The System has Acknowledged the OFFER.
• #define SDHCP_INIT 4
The System is reinitalzing.
• #define SDHCP_CMPL 5
The System has obtained a valid DHCP lease.
• #define SDHCP_RENEW 6
The System is in the process of renewing.
• #define SDHCP_REBIND 7
The System has failed the Renew and is trying to Rebind.
• #define SDHCP_RELEASE 8
The System is trying to release the Lease.
• #define SBOOTP_TRANSMITTING 9
Trying BOOTP.
• #define SBOOTP_DONE 10
BOOTP complete.
• #define SDHCP_FAILED 11
DHCP attempt failed - could not obtain a DHCP lease.

NetBurner, Inc.
290 Module Documentation

19.23.1 Detailed Description

19.24 DNS - Domain Name System


Modules
• DNS Record Types
• DNS Return Codes

Functions
• int GetHostByName4 (const char ∗name, IPADDR4 ∗pIpaddr, IPADDR4 dns_server, uint16_t timeout,
uint16_t TYPE=DNS_A)
Get the IPv4 address associated with the specified domain name.
• int GetHostByName6 (const char ∗name, IPADDR ∗pIpaddr, const IPADDR &dns_server, uint16_t timeout,
uint16_t TYPE1=DNS_A, uint16_t TYPE2=DNS_AAAA)
Get the IPv6 address associated with the specified domain name.

19.24.1 Detailed Description


The Doman Name System (DNS) is used to look up the IP address for a DNS name, such as www.mysite.←-
com. Applications normally use IPADDR objects as opposed to IPADDR4 and IPADDR, because it can hold either
a IPv4 or IPv6 address. You can then use the GetHostByName() function instead of the GetHostByName4() or
GetHostByName6().

19.24.2 Function Documentation

19.24.2.1 GetHostByName4()

int GetHostByName4 (
const char ∗ name,
IPADDR4 ∗ pIpaddr,
IPADDR4 dns_server,
uint16_t timeout,
uint16_t TYPE = DNS_A )
Get the IPv4 address associated with the specified domain name.
Calling GetHostByName() in dual stack mode will automatically call the correct IPv4 or IPv6 function

Parameters
∗name Pointer to domain name to resolve
∗pIpaddr Pointer to variable of type IPADDR4 to store resultant IP address
&dns_server Specified the DNS server to use. Pass INADDR_ANY to use the DNS server associated with
the interface
timeout Time to wait for the DNS response, specified in TICKS_PER_SECOND
TYPE Optional DNS record type. If no type is specified the default is IPv4 DNS_A

Returns

DNS Return Codes

See also

GetHostByName6()

NetBurner, Inc.
19.25 DNS Record Types 291

19.24.2.2 GetHostByName6()

int GetHostByName6 (
const char ∗ name,
IPADDR ∗ pIpaddr,
const IPADDR & dns_server,
uint16_t timeout,
uint16_t TYPE1 = DNS_A,
uint16_t TYPE2 = DNS_AAAA )
Get the IPv6 address associated with the specified domain name.
Calling GetHostByName() in dual stack mode will automatically call the correct IPv4 or IPv6 function.
The function will attempt to retrieve record type 1 first. If successful the function returns. If if the attempt using type
1 fails, the function will attempt to get a record using the type 2 parameter. For example, lets say you wish your code
to use IPv6, but its OK to fall back to IPv4. You can set type 1 to DNS_AAAA and type2 to DNS_A.

Parameters
∗name Pointer to domain name to resolve
∗pIpaddr Pointer to variable of type IPADDR4 to store resultant IP address
&dns_server Specified the DNS server to use. Pass INADDR_ANY to use the DNS server associated with
the interface.
timeout Time to wait for the DNS response, specified in TICKS_PER_SECOND
TYPE1 Optional record type. If not specified will default to IPv4 DNS_A
TYPE2 Optional record type. If not specified will default to IPv6 DNS_AAAA

Returns

DNS Return Codes

See also

GetHostByName4()

19.25 DNS Record Types


Macros
• #define DNS_A 1
32-bit IPv4 address
• #define DNS_CNAME 5
Canonical name record.
• #define DNS_MB 7
Mailing list subscriber list.
• #define DNS_MG 8
Mailing list subscriber list.
• #define DNS_MX 15
Mail exchange record.
• #define DNS_AAAA 28
128-bit IPv6 address

19.25.1 Detailed Description

19.26 DNS Return Codes


Macros
• #define DNS_OK (0)

NetBurner, Inc.
292 Module Documentation

Success.
• #define DNS_TIMEOUT (1)
Request timed out.
• #define DNS_NOSUCHNAME (2)
Name not found.
• #define DNS_ERR (3)
Other error.

19.26.1 Detailed Description

19.27 DSPI state


19.27.1 Detailed Description

19.28 DspiModuleNumber
DSPI Peripheral Module.

Macros
• #define DEFAULT_DSPI_MODULE 0
Default DSPI module.
• #define DSPI_MODULE_COUNT 1
Number of modules: 0, 1.

19.28.1 Detailed Description


DSPI Peripheral Module.

19.29 DspiState
DSPI Bus State .

Macros
• #define DSPI_OK ( 0 )
DSPI OK.
• #define DSPI_BUSY ( 1 )
DSPI Busy.
• #define DSPI_ERROR ( 2 )
DSPI Error.

19.29.1 Detailed Description


DSPI Bus State .

19.30 EFFS - Embedded Flash File System


Modules
• EFFS-STD Flash File System
• FAT File System

NetBurner, Inc.
19.31 EFFS-STD Flash File System 293

19.30.1 Detailed Description


Two Embedded Flash File Systems are supported:

• FAT32 File System (EFFS-FAT), a FAT32 file system used on external flash memory cards and ram drives.

• Standard File System (EFFS-STD), a power-fail safe file system that resides in the flash on the module.

19.31 EFFS-STD Flash File System


Modules
• STD File System Seek Codes

Macros
• #define fs_getfreespace(drivenum, space) fsm_getfreespace(drivenum, space)
Provides information about the drive space usage.
• #define fs_mkdir(dirname) fsm_mkdir(dirname)
Makes a new directory.
• #define fs_chdir(dirname) fsm_chdir(dirname)
Change the directory.
• #define fs_rmdir(dirname) fsm_rmdir(dirname)
Removes a directory.
• #define fs_delete(filename) fsm_delete(filename)
Deletes a file.
• #define fs_findfirst(filename, find) fsm_findfirst(filename, find)
Find the first file or subdirectory in a specified directory.
• #define fs_findnext(find) fsm_findnext(find)
Finds the next file or subdirectory in a specified directory after a previous call to fs_findfirst() or
fs_findnext().
• #define fs_open(filename, mode) fsm_open(filename, mode)
Opens a file in the file system.
• #define fs_close(filehandle) fsm_close(filehandle)
Closes an opened file.
• #define fs_write(buf, size, size_st, filehandle) fsm_write(buf, size, size_st, filehandle)
Write data to the file at the current position.
• #define fs_read(buf, size, size_st, filehandle) fsm_read(buf, size, size_st, filehandle)
Read data from the current position in a file.
• #define fs_seek(filehandle, offset, whence) fsm_seek(filehandle, offset, whence)
Move the stream position of an open file.
• #define fs_eof(filehandle) fsm_eof(filehandle)
Check whether the current position in the open target file is the end of the file.
• #define fs_rewind(filehandle) fsm_rewind(filehandle)
Sets the file position in the open target file to the start of the file.
• #define fs_settimedate(filename, ctime, cdate) fsm_settimedate(filename, ctime, cdate)
Set the time and date of a file or directory.
• #define fs_gettimedate(filename, pctime, pcdate) fsm_gettimedate(filename, pctime, pcdate)
Get the time and date of a file or directory.

19.31.1 Detailed Description


The Standard Embedded Flash File System, EFFS-STD

NetBurner, Inc.
294 Module Documentation

19.31.2 Macro Definition Documentation

19.31.2.1 fs_chdir

#define fs_chdir(
dirname ) fsm_chdir(dirname)
Change the directory.

Parameters
dirname The directory to change to.

Return values

FS_NOERR If able to change to the directory


!FS_NOERR If unable to change to the directory

See also

fs_mkdir()
fs_rmdir()

19.31.2.2 fs_close

#define fs_close(
filehandle ) fsm_close(filehandle)
Closes an opened file.

Parameters

filehandle A handle to the file to close.

Return values

FS_NOERR If able to close the file


!FS_NOERR If unable to close the file

19.31.2.3 fs_delete

#define fs_delete(
filename ) fsm_delete(filename)
Deletes a file.
A read-only or open file cannot be deleted.

Parameters

filename The name of the file to be deleted.

NetBurner, Inc.
19.31 EFFS-STD Flash File System 295

Return values

FS_NOERR If able to delete the file


!FS_NOERR If unable to delete the file

19.31.2.4 fs_eof

#define fs_eof(
filehandle ) fsm_eof(filehandle)
Check whether the current position in the open target file is the end of the file.

Parameters

filehandle A handle to the file to check.

Return values

0 Nothing at the end of the file


!0 The end of the file, or an error

19.31.2.5 fs_findfirst

#define fs_findfirst(
filename,
find ) fsm_findfirst(filename, find)
Find the first file or subdirectory in a specified directory.
Note: If this is called with "∗.∗" and this is not the root directory, the first entry found will be ".", which is the current
directory.

Parameters

filename The name of the file to find.


find Where to store the found information.

Return values

FS_NOERR If the file was found


!FS_NOERR If the file wasn't found or there are errors

See also

fs_findnext()

19.31.2.6 fs_findnext

#define fs_findnext(
find ) fsm_findnext(find)
Finds the next file or subdirectory in a specified directory after a previous call to fs_findfirst() or
fs_findnext().

NetBurner, Inc.
296 Module Documentation

Note: If this is called with "∗.∗" and this is not the root directory, the first entry found will be ".", which is the current
directory.

Parameters

find Where to store the found information.

Return values

FS_NOERR If the file was found


!FS_NOERR If the file wasn't found or there are errors

See also

fs_findfirst()

19.31.2.7 fs_getfreespace

#define fs_getfreespace(
drivenum,
space ) fsm_getfreespace(drivenum, space)
Provides information about the drive space usage.

Parameters

drivenum The drive number to get space usage for.


space The structure to store the usage information in.

Return values

FS_NOERR If able to get the drive space usage


!FS_NOERR If unable to get the drive space usage

19.31.2.8 fs_gettimedate

#define fs_gettimedate(
filename,
pctime,
pcdate ) fsm_gettimedate(filename, pctime, pcdate)
Get the time and date of a file or directory.

Parameters

filename The name of the file or directory to modify.


pctime A pointer to store the creation time of the file or directory.
pcdate A pointer to store the creation date of the file or directory.

Return values

FS_NOERR If able to get time and date

NetBurner, Inc.
19.31 EFFS-STD Flash File System 297

Return values

!FS_NOERR If unable to get time and date

19.31.2.9 fs_mkdir

#define fs_mkdir(
dirname ) fsm_mkdir(dirname)
Makes a new directory.

Parameters

dirname The name to use for the new directory.

Return values

FS_NOERR If able to make the directory


!FS_NOERR If unable to make the directory

See also

fs_chdir()
fs_rmdir()

19.31.2.10 fs_open

#define fs_open(
filename,
mode ) fsm_open(filename, mode)
Opens a file in the file system.

Parameters

filename The name of the file to open.


mode The mode to open the file in. The following options are available:

• "r": Reading. The stream is positioned at the beginning of the file.

• "r+": Reading and writing. The stream is positioned at the beginning of the file.

• "w": Truncate file to 0 length or create for writing. The stream is positioned at the beginning of
the file.

• "w+": Reading and writing. Create if it doesn't exist, or truncate if it does. The stream is
positioned at the beginning of the file.

• "a": Append, and create if it doesn't exist. The stream is positioned at the end of the file.

• "a+": Reading and appending, and create if it doesn't exist. The stream is positioned at the
end of the file.

NetBurner, Inc.
298 Module Documentation

Return values

FS_FILE∗ Pointer to the file if it could be opened


0 If it a file could not be opened

See also

fs_close()

19.31.2.11 fs_read

#define fs_read(
buf,
size,
size_st,
filehandle ) fsm_read(buf, size, size_st, filehandle)
Read data from the current position in a file.

Parameters

buf A pointer where the data should be read.


size The size of the items to be read.
size_st The number of items to be read.
filehandle A handle to the file to read to.

Returns

The number of items read.

19.31.2.12 fs_rewind

#define fs_rewind(
filehandle ) fsm_rewind(filehandle)
Sets the file position in the open target file to the start of the file.

Parameters

filehandle A handle to the file operate on.

Return values

FS_NOERR If successful
!FS_NOERR If there was an error

19.31.2.13 fs_rmdir

#define fs_rmdir(
dirname ) fsm_rmdir(dirname)
Removes a directory.
Note: The target directory must be empty, otherwise an error code is returned.

NetBurner, Inc.
19.31 EFFS-STD Flash File System 299

Parameters

dirname The name of the directory to remove.

Return values

FS_NOERR If able to get the drive space usage


!FS_NOERR If unable to get the drive space usage

See also

fs_chdir()
fs_mkdir()

19.31.2.14 fs_seek

#define fs_seek(
filehandle,
offset,
whence ) fsm_seek(filehandle, offset, whence)
Move the stream position of an open file.

Parameters

filehandle A handle to the file to move the position of.


offset The relative byte position according to whence.
whence Where to calculate the offset from. Can be a value from fSeekCodeGroup.

Return values

FS_NOERR If the seek operation was successful


!FS_NOERR If there was an error

19.31.2.15 fs_settimedate

#define fs_settimedate(
filename,
ctime,
cdate ) fsm_settimedate(filename, ctime, cdate)
Set the time and date of a file or directory.

Parameters

filename The name of the file or directory to modify.


ctime The creation time of the file or directory.
cdate The creation date of the file or directory.

Return values

FS_NOERR If able to set time and date

NetBurner, Inc.
300 Module Documentation

Return values

!FS_NOERR If unable to set time and date

19.31.2.16 fs_write

#define fs_write(
buf,
size,
size_st,
filehandle ) fsm_write(buf, size, size_st, filehandle)
Write data to the file at the current position.

Parameters

buf A pointer to the data to write.


size The size of the items to write.
size_st The number of items to write.
filehandle A handle to the file to write to.

Returns

The number of items written.

19.32 Ethernet
Modules
• Ethernet Interface Types

Macros
• #define NO_AUTOMATIC_2ND_ETHERNET extern const bool bAutomatic2ndEther = false;
Disable automatic initialization of second Ethernet interface.

Functions
• void AddEthernetInterfaces ()
Add an Ethernet interface.
• void ManualEthernetConfig (int interface, BOOL speed100Mbit, BOOL fullDuplex, BOOL autoNegotiate)
Manually configure Ethernet speed and duplex settings.
• void DisablePHY (int ifn)
Disable the specified Ethernet PHY.
• void EnablePHY (int ifn)
Disable the specified Ethernet PHY.

19.32.1 Detailed Description


Functions to add, configure and disable Ethernet interfaces

19.32.2 Macro Definition Documentation

NetBurner, Inc.
19.32 Ethernet 301

19.32.2.1 NO_AUTOMATIC_2ND_ETHERNET

#define NO_AUTOMATIC_2ND_ETHERNET extern const bool bAutomatic2ndEther = false;


Disable automatic initialization of second Ethernet interface.
Include this macro in UserMain to prevent automatic system addition and initialization of the second Ethernet inter-
face on dual Ethenet devices.

19.32.3 Function Documentation

19.32.3.1 AddEthernetInterfaces()

void AddEthernetInterfaces ( )
Add an Ethernet interface.
The default system behavior is all Ethernet interfaces will automatically be added and initialized. Interface numbers
range from 1 to ( MAX_INTERFACES - 1 )

19.32.3.2 DisablePHY()

void DisablePHY (
int ifn )
Disable the specified Ethernet PHY.
Typically used for low power mode.

Parameters

ifn Interface number to disable

See also

EnablePHY

19.32.3.3 EnablePHY()

void EnablePHY (
int ifn )
Disable the specified Ethernet PHY.
Enable an Ethernet PHY previously disabled by DisablePHY()

Parameters

ifn Interface number to ensable

See also

DisablePHY()

19.32.3.4 ManualEthernetConfig()

void ManualEthernetConfig (
int interface,
BOOL speed100Mbit,
BOOL fullDuplex,
BOOL autoNegotiate )
Manually configure Ethernet speed and duplex settings.

NetBurner, Inc.
302 Module Documentation

The default setting to establish an Ethernet link is autonegotiate. This function can be used to disable autonegotiate
and set the Ethernet link speed and duplex.

Warning

With autonegotiate disabled, the other Ethernet host must also be configured manually with the same settings.
If the other host is set to autonegotiate, the link will have undefined behavior and data loss.

Parameters

interface The network interface to modify. The first interface number is 1


speed100Mbit True = 100Mbps, False = 10Mbps
fullDuplex True = full duplex, False = half duplex
autoNegotiate True = enabled, False = disabled. If enabled, will override manual settings.

19.33 Ethernet Interface Types


Macros
• #define ETHERNET_ETHERTYPE_IPv4 (uint16_t)(0x0800)
Internet Protocol, Version 4 (IPv4)
• #define ETHERNET_ETHERTYPE_ARP (uint16_t)(0x0806)
Address Resolution Protocol (ARP)
• #define ETHERNET_ETHERTYPE_IPv6 (uint16_t)(0x86DD)
Internet Protocol, Version 6 (IPv6)
• #define ETHERNET_ETHERTYPE_AARP (uint16_t)(0x80F3)
AppleTalk Address Resolution Prot. (AARP)
• #define ETHERNET_ETHERTYPE_IPX (uint16_t)(0x8137)
Novell Internet Packet Exchange (IPX) (alt.)
• #define ETHERNET_ETHERTYPE_EAPOL (uint16_t)(0x888E)
Extensible Authorization Protocol (EAP) over LAN.
• #define ETHERNET_ETHERTYPE_VLAN (uint16_t)(0x8100)
Virtual Private Network (VLAN)

19.33.1 Detailed Description


EtherType Field ( Ethernet Version II )

19.34 External Bus Interface (EBI)


Classes
• struct EBI_CS_cfg_t
Configuration structure for an External Bus Interface (EBI) chip select.

Enumerations
• enum EBI_CS_BusWidth_t { EBI_BUS_WIDTH_8 = 0 , EBI_BUS_WIDTH_16 = 1 }
• enum EBI_CS_ByteAccess_t { EBI_BYTE_ACCESS_SELECT = 0 , EBI_BYTE_ACCESS_WRITE = 1 }
• enum EBI_CS_NWait_t { EBI_NWAIT_DISABLED = 0 , EBI_NWAIT_FROZEN = 2 , EBI_NWAIT_READY =
3}
• enum EBI_CS_WrMode_t
• enum EBI_CS_RdMode_t

NetBurner, Inc.
19.34 External Bus Interface (EBI) 303

Functions
• void ConfigureEBI_CSPin (int csNum)
Configure the I/O pin for a given Chip Select for the external data bus.
• void ConfigureEBI_NWRPin ()
Configure the I/O pin for the active low write/read (NWR) bus signal.
• void ConfigureEBI_NRDPin ()
Configure the I/O pin for the active low read (NRD) bus signal.
• void ConfigureEBI_CS (uint32_t csNum, const EBI_CS_cfg_t &&cfg)
Configure the given Chip Select for the external data bus.
• void ConfigureEBI_CS (uint32_t csNum, const EBI_CS_cfg_t &cfg)
Configure the given Chip Select for the external data bus.

Variables
• uint8_t EBI_CS_cfg_t::ncs_rd_setup
• uint8_t EBI_CS_cfg_t::nrd_setup
• uint8_t EBI_CS_cfg_t::ncs_wr_setup
• uint8_t EBI_CS_cfg_t::nwe_setup
• uint8_t EBI_CS_cfg_t::ncs_rd_pulse
• uint8_t EBI_CS_cfg_t::nrd_pulse
• uint8_t EBI_CS_cfg_t::ncs_wr_pulse
• uint8_t EBI_CS_cfg_t::nwe_pulse
• uint16_t EBI_CS_cfg_t::nrd_cycles
• uint16_t EBI_CS_cfg_t::nwe_cycles
• uint8_t EBI_CS_cfg_t::tdf_cycles
• EBI_CS_BusWidth_t EBI_CS_cfg_t::busWidth
• EBI_CS_ByteAccess_t EBI_CS_cfg_t::byteAccess
• EBI_CS_NWait_t EBI_CS_cfg_t::nWait
• EBI_CS_WrMode_t EBI_CS_cfg_t::wrMode
• EBI_CS_RdMode_t EBI_CS_cfg_t::rdMode

19.34.1 Detailed Description


The Microchip SAME70 EBI peripheral is a parallel communication port that can only operate in "host" mode to
communicate with "slave" devices. The EBI peripheral consists of a set of up to 16 data signals, up to 24 address
signals and up to 10 different control signals. Some of the benefits of using the EBI bus are that it has high
performance in both throughput and latency. It is directly memory mapped to the processor so it is very easy to
use in software once configured. The downsides are mostly that it has many signals which will greatly complicate
hardware designs and increase the size of external peripheral chips.
The EBI peripheral is highly configurable to fit the specifications of many types of external devices.
A consequence to this high configurablity is that there are many timing parameters which makes configuration
complicated. The NetBurner examples specify a conservative set of timing parameters with the goal of being
compatible with a wide range of peripherals such as FPGAs, CPLDs, buffers, latches displays, flash memory and
SRAM. Once successful communication is obtained with the slave target device, these default settings should be
refined to increase the performance to match the device you are interfacing with.
Advanced EBI functionality is currently not supported by this examples or this driver. Advaced functionality includes
interfacing with SDRAM or NAND memories. Page mode, burst operations and scrambling functionality are all not
currently configurable via this driver.

In most applications you will only need to verify the last 5 parameters meet your peripheral requirements: bus width
(8 or 16), byte Access 16-bit mode only), timing parameters, read mode (chip select or read signal) and write mode
(chip select or write signal).
There are 3 sources of information that are very useful for understanding the EBI:

NetBurner, Inc.
304 Module Documentation

1. The EBI section of the Microchip SAME70 manual located in "\nburn\docs". It is very important to do this as
the first step to understand the signal terminology in the examples and header files. Additionally the Static
Memory Controller chapter in this processor manual is essential as it explains all the settings and timing
parameters exposed by this driver.

2. The NetBurner EBI examples described in the manual and located in "\nburn\examples\PlatformSpecific\←-
MODM7AE70"

3. The SAME70 ebi.h header file located in "\nburn\arch\cortex-m7\cpu\SAME70\include"

The EBI supports Chip Selects as well as Read and Write signals to interface with peripherals. The basic procedure
for configuring the bus is:

• As noted in the examples, the MODM7AE70 has onboard bus buffers to reduce noise and help signal integrity.
The following 4 signals must always be configured for EBI functionality as they are control the enable/disable
and direction control of the bus buffer ICs:
P1[5].function(PINP1_5_NCS2); // chip select 2, active low
P1[6].function(PINP1_6_NCS0); // chip select 0, active low
P1[7].function(PINP1_7_NCS3); // chip select 3, active low
P1[8].function(PINP1_8_NRD); // Bus read, active low

• Declare a Configuration Structure of type EBI_CS_cfg_t. An easy way is to copy one from the examples.
Then modify any parameters necessary to meet your specific peripheral requirements, such as bus width,
byte access in 16-bit mode, timing parameters, etc.

• Configure the desired chip select using the ConfigureEBI_CS()function. Note that when enabling the EBI, the
MODM7AE70 module requires all three chip selects (NCS0, NCS02, NCS03) to be assigned as chip selects.
Addtionally the NRD signal must also be configured for NRD bus operation. All of these signals are used
for controlling the enable/direction logic of the external bus buffer hardware - they cannot use their alternate
functions. Each chip select has a predefined fixed 16MB address range ( MODM7AE70 Memory Map). The
NetBurner API supplied predefined base address variables to make access easier as demonstrated in the
EBI examples:
extern volatile uint8_t ebi_0_base[]; // Chip select 0
extern volatile uint8_t ebi_1_base[]; // Chip select 1
extern volatile uint8_t ebi_2_base[]; // Chip select 2
extern volatile uint8_t ebi_3_base[]; // Chip select 3

In this way you can do a bus write with code such as (please refer to EBI examples for latest code):
const uint8_t EBITestData8 = 0x5A; // Data byte for testing
const uint32_t EBITestAddressOffset = 0xA5A5; // Address offset from chip select base address
ebi_0_base[EBITestAddressOffset] = EBITestData8; // Write data to EBI, chip select 0
ebi_0_base[0xA5A5] = 0X5A; // Same write with hard coded values
uint32_t EBIdata = ebi_0_base[EBITestAddressOffset]; // Read data from EBI, chip select 0

Warning

When enabling the EBI for the MODM7AE70 module, NCS0, NCS2, NCS3 and NRD must all be configured
for their bus functionality as chip selects or nRead signals, even if not used by your application - they cannot
be assigned their alternate functions. Additionally the "void EnableExtBusBuff(bool enable);" function from
bsp.h must be used to enable the external bus buffer hardware.

19.34.2 Enumeration Type Documentation

19.34.2.1 EBI_CS_BusWidth_t

enum EBI_CS_BusWidth_t
Data bus width, 8 or 16 bits.

Enumerator

EBI_BUS_WIDTH_8 8-bit bus


EBI_BUS_WIDTH_16 16-bit bus

NetBurner, Inc.
19.34 External Bus Interface (EBI) 305

19.34.2.2 EBI_CS_ByteAccess_t

enum EBI_CS_ByteAccess_t
Byte Access. Used only in 16-bit mode to access low or high byte on data bus.

Enumerator

EBI_BYTE_ACCESS_SELECT Use chip select for 8-bit access.


EBI_BYTE_ACCESS_WRITE Use write signal for 8-bit access.

19.34.2.3 EBI_CS_NWait_t

enum EBI_CS_NWait_t
NWAIT signal mode. Used to extend read/write pulse by the bus device. Normally used with slow flash memory,
otherwise disabled.
Any access can be extended by an external device using the NWAIT input signal of the SMC. The SMC_MODE.←-
EXNW_MODE field on the corresponding chip select must be set either to “10” (Frozen mode) or “11” (Ready
mode). When SMC_MODE.EXNW_MODE is set to “00” (disabled), the NWAIT signal is simply ignored on the
corresponding chip select. The NWAIT signal delays the read or write operation in regards to the read or write
controlling signal, depending on the Read and Write modes of the corresponding chip select.

Enumerator

EBI_NWAIT_DISABLED Disabled.
EBI_NWAIT_FROZEN Frozen mode.
EBI_NWAIT_READY Ready mode.

19.34.2.4 EBI_CS_RdMode_t

enum EBI_CS_RdMode_t
Read signal selection. NCS for chip select, or NRD for write enable signal.

19.34.2.5 EBI_CS_WrMode_t

enum EBI_CS_WrMode_t
Write signal selection. NCS for chip select, or NWE for write enable signal.

19.34.3 Function Documentation

19.34.3.1 ConfigureEBI_CS() [1/2]

void ConfigureEBI_CS (
uint32_t csNum,
const EBI_CS_cfg_t && cfg )
Configure the given Chip Select for the external data bus.

Parameters

csNum The EBI Chip Select to configure.


cfg The structure containing the configuration to use.

NetBurner, Inc.
306 Module Documentation

19.34.3.2 ConfigureEBI_CS() [2/2]

void ConfigureEBI_CS (
uint32_t csNum,
const EBI_CS_cfg_t & cfg )
Configure the given Chip Select for the external data bus.

Parameters

csNum The EBI Chip Select to configure.


cfg The structure containing the configuration to use.

19.34.3.3 ConfigureEBI_CSPin()

void ConfigureEBI_CSPin (
int csNum )
Configure the I/O pin for a given Chip Select for the external data bus.

Parameters

csNum The chip select to configure.

19.34.4 Variable Documentation

19.34.4.1 busWidth

EBI_CS_cfg_t::busWidth
Data bus width

19.34.4.2 byteAccess

EBI_CS_cfg_t::byteAccess
Byte Access mode, only used for 16-bit bus

19.34.4.3 ncs_rd_pulse

EBI_CS_cfg_t::ncs_rd_pulse
NCS pulse length = (256∗ ncs_rd_pulse[6] + ncs_rd_pulse[5:0]) clock cycles

19.34.4.4 ncs_rd_setup

EBI_CS_cfg_t::ncs_rd_setup
NCS setup length = (128∗ ncs_rd_setup[5] + ncs_rd_setup[4:0]) clock cycles

19.34.4.5 ncs_wr_pulse

EBI_CS_cfg_t::ncs_wr_pulse
NCS pulse length = (256∗ ncs_wr_pulse[6] + ncs_wr_pulse[5:0]) clock cycles

NetBurner, Inc.
19.34 External Bus Interface (EBI) 307

19.34.4.6 ncs_wr_setup

EBI_CS_cfg_t::ncs_wr_setup
NCS setup length = (128∗ ncs_wr_setup[5] + ncs_wr_setup[4:0]) clock cycles

19.34.4.7 nrd_cycles

EBI_CS_cfg_t::nrd_cycles
The total read cycle length is the total duration in clock cycles of the read cycle. It is equal to the sum of the setup,
pulse and hold steps of the NRD and NCS signals. It is defined as: Read cycle length = (nrd_cycles[8:7]∗256 +
nrd_cycles[6:0]) clock cycles

19.34.4.8 nrd_pulse

EBI_CS_cfg_t::nrd_pulse
NRD pulse length = (256∗ nrd_pulse[6] + nrd_pulse[5:0]) clock cycles

19.34.4.9 nrd_setup

EBI_CS_cfg_t::nrd_setup
NRD setup length = (128∗ nrd_setup[5] + nrd_setup[4:0]) clock cycles

19.34.4.10 nWait

EBI_CS_cfg_t::nWait
NWAIT signal mode. Used to extend read/write pulse by the bus device.

19.34.4.11 nwe_cycles

EBI_CS_cfg_t::nwe_cycles
The total write cycle length is the total duration in clock cycles of the write cycle. It is equal to the sum of the setup,
pulse and hold steps of the NWE and NCS signals. It is defined as: Write cycle length = (nwe_cycles[8:7]∗256 +
nwe_cycles[6:0]) clock cycles

19.34.4.12 nwe_pulse

EBI_CS_cfg_t::nwe_pulse
NWE pulse length = (256∗ nwe_pulse[6] + nwe_pulse[5:0]) clock cycles

19.34.4.13 nwe_setup

EBI_CS_cfg_t::nwe_setup
NWE setup length = (128∗ nwe_setup[5] + nwe_setup[4:0]) clock cycles

19.34.4.14 rdMode

EBI_CS_cfg_t::rdMode
Configures which signal is used to signal a bus read.

19.34.4.15 tdf_cycles

EBI_CS_cfg_t::tdf_cycles
The number of clock cycles required by the external device to release the data after the rising edge of the read
controlling signal. The SMC always provide one full cycle of bus turnaround after the TDF_CYCLES period. Note:
Valid range => 0-15

19.34.4.16 wrMode

EBI_CS_cfg_t::wrMode
Configures which signal is used to signal a bus write.

NetBurner, Inc.
308 Module Documentation

19.35 Extra File Descriptors


Functions
• int GetExtraFD (void ∗extra_data, struct IoExpandStruct ∗pFuncs)
Returns a file descriptor for the structure passed as the IoExpandStruct. FreeExtraFd( ) will release the fd back
to the pool of available fds.
• void ∗ GetExtraData (int fd)
Returns the extra structure value from IoExpandStruct associated with the file descriptor.
• void FreeExtraFd (int fd)
Free a file descriptor and associated resources.
• int GetFreeExtraFDCount ()
Returns the number of free file descriptors.

19.35.1 Detailed Description


The NetBurner environment integrates the RTOS, TCP/IP stack, and other peripherals with a file I/O system based
on file descriptors. A file descriptor can be described as a handle to a network socket, serial port, system peripheral,
or any other object that can be read or written to. Most of the API functions pass a file descriptor as a parameter to
such an object. These function are available if you wish to use the file descritpor system capabilities for your own
application purposes. Please refer to the File Descriptor section in the Programmers Guide.

19.35.2 Function Documentation

19.35.2.1 FreeExtraFd()

void FreeExtraFd (
int fd )
Free a file descriptor and associated resources.

Parameters

fd File descriptor

19.35.2.2 GetExtraData()

void ∗ GetExtraData (
int fd )
Returns the extra structure value from IoExpandStruct associated with the file descriptor.

Parameters

fd File descriptor

Return values

Value of the extra member of the structure

NetBurner, Inc.
19.36 FAT File System 309

19.35.2.3 GetExtraFD()

int GetExtraFD (
void ∗ extra_data,
struct IoExpandStruct ∗ pFuncs )
Returns a file descriptor for the structure passed as the IoExpandStruct. FreeExtraFd( ) will release the fd
back to the pool of available fds.

Parameters

extra_data The optional extra_data void pointer can be used to pass data into the file descriptor
∗pFuncs Structure containing callback functions for such things as read, write, close, and the extra_data
variable

Return values

Value greater than 0, representing the file descriptor on success


-1 on failure

19.35.2.4 GetFreeExtraFDCount()

int GetFreeExtraFDCount ( )
Returns the number of free file descriptors.

Return values

Number of free extra file descriptors

19.36 FAT File System


Modules
• FAT File System Seek Codes

Macros
• #define f_delvolume(drvnumber) fm_delvolume(drvnumber)
Un-mounts a flash card.
• #define f_getfreespace(drivenum, pspace) fm_getfreespace(drivenum, pspace)
Provides information about the drive space usage.
• #define f_chdir(dirname) fm_chdir(dirname)
Change the directory.
• #define f_mkdir(dirname) fm_mkdir(dirname)
Makes a new directory.
• #define f_rmdir(dirname) fm_rmdir(dirname)
Removes a directory.
• #define f_findfirst(filename, find) fm_findfirst(filename, find)
Find the first file or subdirectory in a specified directory.
• #define f_findnext(find) fm_findnext(find)
Finds the next file or subdirectory in a specified directory after a previous call to f_findfirst() or
f_findnext().

NetBurner, Inc.
310 Module Documentation

• #define f_close(filehandle) fm_close(filehandle)


Closes an opened file.
• #define f_open(filename, mode) fm_open(filename, mode)
Opens a file in the file system.
• #define f_read(buf, size, size_st, filehandle) fm_read(buf, size, size_st, filehandle)
Read data from the current position in a file.
• #define f_write(buf, size, size_st, filehandle) fm_write(buf, size, size_st, filehandle)
Write data to the file at the current position.
• #define f_seek(filehandle, offset, whence) fm_seek(filehandle, offset, whence)
Move the stream position of an open file.
• #define f_rewind(filehandle) fm_rewind(filehandle)
Sets the file position in the open target file to the start of the file.
• #define f_eof(filehandle) fm_eof(filehandle)
Check whether the current position in the open target file is the end of the file.
• #define f_gettimedate(filename, pctime, pcdate) fm_gettimedate(filename, pctime, pcdate)
Get the time and date of a file or directory.
• #define f_settimedate(filename, ctime, cdate) fm_settimedate(filename, ctime, cdate)
Set the time and date of a file or directory.
• #define f_delete(filename) fm_delete(filename)
Deletes a file.

Functions
• int f_enterFS (void)
Adds a new task priority to the task list used by the file system.
• void f_releaseFS (void)
Removes a task priority from the task list used by the file system.

19.36.1 Detailed Description


The FAT32 Embedded Flash File System for Flash Cards, EFFS-FAT

19.36.2 Macro Definition Documentation

19.36.2.1 f_chdir

#define f_chdir(
dirname ) fm_chdir(dirname)
Change the directory.

Parameters
dirname The directory to change to.

Return values

F_NO_ERROR If able to change to the directory


!F_NO_ERROR If unable to change to the directory

NetBurner, Inc.
19.36 FAT File System 311

See also

f_mkdir()
f_rmdir()

19.36.2.2 f_close

#define f_close(
filehandle ) fm_close(filehandle)
Closes an opened file.

Parameters

filehandle A handle to the file to close.

Return values

F_NO_ERROR If able to close the file


!F_NO_ERROR If unable to close the file

19.36.2.3 f_delete

#define f_delete(
filename ) fm_delete(filename)
Deletes a file.
A read-only or open file cannot be deleted.

Parameters

filename The name of the file to be deleted.

Return values

F_NO_ERROR If able to delete the file


!F_NO_ERROR If unable to delete the file

19.36.2.4 f_delvolume

#define f_delvolume(
drvnumber ) fm_delvolume(drvnumber)
Un-mounts a flash card.

Parameters
drvnumber The drive to be un-mount.

19.36.2.5 f_eof

#define f_eof(

NetBurner, Inc.
312 Module Documentation

filehandle ) fm_eof(filehandle)
Check whether the current position in the open target file is the end of the file.

Parameters

filehandle A handle to the file to check.

Return values

0 Nothing at the end of the file


!0 The end of the file, or an error

19.36.2.6 f_findfirst

#define f_findfirst(
filename,
find ) fm_findfirst(filename, find)
Find the first file or subdirectory in a specified directory.
Note: If this is called with "∗.∗" and this is not the root directory, the first entry found will be ".", which is the current
directory.

Parameters

filename The name of the file to find.


find Where to store the found information.

Return values

F_NO_ERROR If the file was found


!F_NO_ERROR If the file wasn't found or there are errors

See also

f_findnext()

19.36.2.7 f_findnext

#define f_findnext(
find ) fm_findnext(find)
Finds the next file or subdirectory in a specified directory after a previous call to f_findfirst() or
f_findnext().
Note: If this is called with "∗.∗" and this is not the root directory, the first entry found will be ".", which is the current
directory.

Parameters

find Where to store the found information.

Return values

F_NO_ERROR If the file was found

NetBurner, Inc.
19.36 FAT File System 313

Return values

!F_NO_ERROR If the file wasn't found or there are errors

See also

f_findfirst()

19.36.2.8 f_getfreespace

#define f_getfreespace(
drivenum,
pspace ) fm_getfreespace(drivenum, pspace)
Provides information about the drive space usage.

Parameters

drivenum The drive number to get space usage for.


pspace The structure to store the usage information in.

Return values

F_NO_ERROR If able to get the drive space usage


!F_NO_ERROR If unable to get the drive space usage

19.36.2.9 f_gettimedate

#define f_gettimedate(
filename,
pctime,
pcdate ) fm_gettimedate(filename, pctime, pcdate)
Get the time and date of a file or directory.

Parameters

filename The name of the file or directory to modify.


out pctime A pointer to store the creation time of the file or directory.
out pcdate A pointer to store the creation date of the file or directory.

Return values

F_NO_ERROR If able to get time and date


!F_NO_ERROR If unable to get time and date

19.36.2.10 f_mkdir

#define f_mkdir(
dirname ) fm_mkdir(dirname)
Makes a new directory.

NetBurner, Inc.
314 Module Documentation

Parameters

dirname The name to use for the new directory.

Return values

F_NO_ERROR If able to make the directory


!F_NO_ERROR If unable to make the directory

See also

f_chdir()
f_rmdir()

19.36.2.11 f_open

#define f_open(
filename,
mode ) fm_open(filename, mode)
Opens a file in the file system.

Parameters

filename The name of the file to open.


mode The mode to open the file in. The following options are available:

• "r": Reading. The stream is positioned at the beginning of the file.

• "r+": Reading and writing. The stream is positioned at the beginning of the file.

• "w": Truncate file to 0 length or create for writing. The stream is positioned at the beginning of
the file.

• "w+": Reading and writing. Create if it doesn't exist, or truncate if it does. The stream is
positioned at the beginning of the file.

• "a": Append, and create if it doesn't exist. The stream is positioned at the end of the file.

• "a+": Reading and appending, and create if it doesn't exist. The stream is positioned at the
end of the file.

Return values

F_FILE∗ Pointer to the file if it could be opened


0 If it a file could not be opened

See also

f_close()

19.36.2.12 f_read

#define f_read(

NetBurner, Inc.
19.36 FAT File System 315

buf,
size,
size_st,
filehandle ) fm_read(buf, size, size_st, filehandle)
Read data from the current position in a file.

Parameters

buf A pointer where the data should be read.


size The size of the items to be read.
size_st The number of items to be read.
filehandle A handle to the file to read to.

Returns

The number of items read.

19.36.2.13 f_rewind

#define f_rewind(
filehandle ) fm_rewind(filehandle)
Sets the file position in the open target file to the start of the file.

Parameters

filehandle A handle to the file operate on.

Return values

F_NO_ERROR If successful
!F_NO_ERROR If there was an error

19.36.2.14 f_rmdir

#define f_rmdir(
dirname ) fm_rmdir(dirname)
Removes a directory.
Note: The target directory must be empty, otherwise an error code is returned.

Parameters

dirname The name of the directory to remove.

Return values

F_NO_ERROR If able to remove the directory


!F_NO_ERROR If unable to remove the directory

NetBurner, Inc.
316 Module Documentation

See also

f_chdir()
f_mkdir()

19.36.2.15 f_seek

#define f_seek(
filehandle,
offset,
whence ) fm_seek(filehandle, offset, whence)
Move the stream position of an open file.

Parameters

filehandle A handle to the file to move the position of.


offset The relative byte position according to whence.
whence Where to calculate the offset from. Can be a value from FAT File System Seek Codes.

Return values

F_NO_ERROR If the seek operation was successful


!F_NO_ERROR If there was an error

19.36.2.16 f_settimedate

#define f_settimedate(
filename,
ctime,
cdate ) fm_settimedate(filename, ctime, cdate)
Set the time and date of a file or directory.

Parameters

filename The name of the file or directory to modify.


ctime The creation time of the file or directory.
cdate The creation date of the file or directory.

Return values

F_NO_ERROR If able to set time and date


!F_NO_ERROR If unable to set time and date

19.36.2.17 f_write

#define f_write(
buf,
size,
size_st,

NetBurner, Inc.
19.37 FAT File System Seek Codes 317

filehandle ) fm_write(buf, size, size_st, filehandle)


Write data to the file at the current position.

Parameters

buf A pointer to the data to write.


size The size of the items to write.
size_st The number of items to write.
filehandle A handle to the file to write to.

Returns

The number of items written.

19.36.3 Function Documentation

19.36.3.1 f_enterFS()

int f_enterFS (
void )
Adds a new task priority to the task list used by the file system.
This function needs to be called when a new task wants to use the file system, before any other calls to other file
system functions. Up to 10 tasks can be assigned to use the file system at any given time.
Note: The task priority level is associated with the task list, not the task itself. This means that a task switched
priority levels and still wants to use the file system, it will need to be called again.

Return values

0 If successful
!0 If there were errors

See also

f_releaseFS()

19.36.3.2 f_releaseFS()

void f_releaseFS (
void )
Removes a task priority from the task list used by the file system.
When a task no longer needs to use the file system, or prior to task changing priorities, this should be called. In the
case of a task changing priorities, if access to the file system is still desired, another call to f_enterFS() should
be made.
See also

f_releaseFS()

19.37 FAT File System Seek Codes


Macros
• #define F_SEEK_SET FN_SEEK_SET
Beginning of file.

NetBurner, Inc.
318 Module Documentation

• #define F_SEEK_END FN_SEEK_END


End of file.
• #define F_SEEK_CUR FN_SEEK_CUR
Current position of the file pointer.

19.37.1 Detailed Description


The codes used when calling f_seek().

19.38 FD Change Type


Enumerations
• enum FDChangeType { eReadSet , eWriteSet , eErrorSet }
The notifications that a registered FD monitor can receive.

19.38.1 Detailed Description


The notifications that a registered FD monitor can receive.

19.38.2 Enumeration Type Documentation

19.38.2.1 FDChangeType

enum FDChangeType
The notifications that a registered FD monitor can receive.

Enumerator

eReadSet When read data changes from not available to available.


eWriteSet When an FD changes from not writable to writeable.
eErrorSet When an FD goes from no error to having an error.

19.39 FTP Client


Modules
• FTP Client Return Codes

Functions
• int FTP_InitializeSession (IPADDR4 server_address, uint16_t port, PCSTR UserName, PCSTR Password,
uint32_t time_out)
Initialize a FTP session with a FTP server.
• int FTP_CloseSession (int session)
Close a FTP session.
• int FTPGetDir (int ftp_Session, char ∗dir_buf, int nbytes, uint16_t timeout)
Get the current working directory.
• int FTPSetDir (int ftp_Session, const char ∗new_dir, uint16_t timeout)
Set the current working directory.
• int FTPDeleteDir (int ftp_Session, const char ∗dir_to_delete, uint16_t timeout)

NetBurner, Inc.
19.39 FTP Client 319

Delete a directory.
• int FTPMakeDir (int ftp_Session, const char ∗dir_to_make, uint16_t timeout)
Create a new directory.
• int FTPUpDir (int ftp_Session, uint16_t timeout)
Move up one directory level.
• int FTPDeleteFile (int ftp_Session, const char ∗file_name, uint16_t timeout)
Delete a file.
• int FTPRenameFile (int ftp_Session, const char ∗old_file_name, const char ∗new_file_name, uint16_t time-
out)
Rename a file.
• int FTPSendFile (int ftp_Session, const char ∗full_file_name, BOOL bBinaryMode, uint16_t timeout)
Initialize the process to send a file to s FTP server.
• int FTPGetFile (int ftp_Session, const char ∗full_file_name, BOOL bBinaryMode, uint16_t timeout)
Initialize the process to get a file from a FTP server.
• int FTPGetList (int ftp_Session, const char ∗full_dir_name, uint16_t timeout)
Initialize the process to receive a directory listing from a FTP server.
• int FTPGetFileNames (int ftp_Session, const char ∗full_dir_name, uint16_t timeout)
Initialize the process to receive just the file names in a directory from a FTP server.
• int FTPRawCommand (int ftp_Session, const char ∗cmd, char ∗cmd_buf, int nbytes, uint16_t timeout)
Send a FTP command to the FTP server.
• int FTPGetCommandResult (int ftp_Session, char ∗cmd_buf, int nbytes, uint16_t timeout)
Returns the result of the last FTP operation.
• int FTPRawStreamCommand (int ftp_Session, const char ∗cmd, int ∗pResult, char ∗cmd_buf, int nbytes,
uint16_t timeout)
Send a command and receive a response over a stream connection.
• void FTPActiveMode (int ftp_Session)
Set mode to active.
• void FTPPassiveMode (int ftp_Session)
Set mode to passive.

19.39.1 Detailed Description


The NetBurner FTP Client Group

19.39.2 Function Documentation

19.39.2.1 FTP_CloseSession()

int FTP_CloseSession (
int session )
Close a FTP session.

Parameters
session FTP session number to close

Returns

FTP Client Return Codes

NetBurner, Inc.
320 Module Documentation

See also

FTP_InitializeSession()

19.39.2.2 FTP_InitializeSession()

int FTP_InitializeSession (
IPADDR4 server_address,
uint16_t port,
PCSTR UserName,
PCSTR Password,
uint32_t time_out )
Initialize a FTP session with a FTP server.
Open a connection to a FTP server and log in with the specified username and password. The session number
returned from this call can be used with the file and directory functions.

Parameters

server_address The IP address of the FTP server


port The listen port number of the FTP server. Typically 21.
UserName Log-in username
Password Log-in password
time_out Timeout in system Time Ticks

Returns

A value greater than 0 is a FTP session handle, otherwise FTP Client Return Codes

See also

FTP_CloseSession()

19.39.2.3 FTPActiveMode()

void FTPActiveMode (
int ftp_Session )
Set mode to active.

Parameters

ftp_Session FTP session number

19.39.2.4 FTPDeleteDir()

int FTPDeleteDir (
int ftp_Session,
const char ∗ dir_to_delete,
uint16_t timeout )
Delete a directory.

Parameters

ftp_Session FTP session number

NetBurner, Inc.
19.39 FTP Client 321

Parameters
dir_to_delete Directory to delete
timeout Timeout in system Time Ticks

Returns

FTP Client Return Codes

19.39.2.5 FTPDeleteFile()

int FTPDeleteFile (
int ftp_Session,
const char ∗ file_name,
uint16_t timeout )
Delete a file.

Parameters

ftp_Session FTP session number


file_name Name of file to delete
timeout Timeout in system Time Ticks

Returns

FTP Client Return Codes

19.39.2.6 FTPGetCommandResult()

int FTPGetCommandResult (
int ftp_Session,
char ∗ cmd_buf,
int nbytes,
uint16_t timeout )
Returns the result of the last FTP operation.
Queries the FTP server for the last FTP operation status.
Must be called after the following functions are used:

• FTPGetList()

• FTPFileNames()

• FTPGetFile()

• FTPSendFile()

Parameters

ftp_Session FTP session number


cmd_buf The buffer to hold the ASCII FTP server response. See FTP Server return codes for details.
nbytes The maximum number of bytes cmd_buf can hold
timeout Timeout in system Time Ticks

NetBurner, Inc.
322 Module Documentation

Returns

The FTP server response number on success, otherwise ftpClientReturnCodes

19.39.2.7 FTPGetDir()

int FTPGetDir (
int ftp_Session,
char ∗ dir_buf,
int nbytes,
uint16_t timeout )
Get the current working directory.

Parameters

ftp_Session FTP session number


dir_buf The buffer to copy the directory information into
nbytes Maximum number of bytes in the dir_buf
timeout Timeout in system Time Ticks

Returns

FTP Client Return Codes

19.39.2.8 FTPGetFile()

int FTPGetFile (
int ftp_Session,
const char ∗ full_file_name,
BOOL bBinaryMode,
uint16_t timeout )
Initialize the process to get a file from a FTP server.
This function opens a TCP connection to a FTP server so that a file may be read. it will return a file descriptor that
can then be used to read the file data using file I/O functions such as: read() and ReadWithTimeout().
IMPORTANT After reading the file data you must do 2 things:

• The TCP connection must be closed with the close() function.

• FTPGetCommandResult() must be called to check the result of the operation.

Parameters

ftp_Session FTP session number


full_file_name Full file name being read, including the path
bBinaryMode True = read file as binary data, False = read file as ASCII data
timeout Timeout in system Time Ticks

Returns

TCP file descriptor if greater than 0, otherwise FTP Client Return Codes

int fd = FTPGetFile(ftp, "testfile.txt", FALSE, 5 * TICKS_PER_SECOND); // Send file in ASCII mode


if (fd > 0)
{
// Code to read all data from the file descriptor goes here
close(fd);

NetBurner, Inc.
19.39 FTP Client 323

int rv = FTPGetCommandResult(ftpSession, resultBuffer, 80, 5 * TICKS_PER*SECOND );


if ( rv != 226) // Return code 226 = Closing data connection. Requested file action successful.
iprintf("Read error result = %d %s\r\n", rv, resultBuffer);
}
else
{
iprintf("Failed to read file\r\n");
}

19.39.2.9 FTPGetFileNames()

int FTPGetFileNames (
int ftp_Session,
const char ∗ full_dir_name,
uint16_t timeout )
Initialize the process to receive just the file names in a directory from a FTP server.
This function opens a TCP connection to a FTP server so that a list of file names may be read. it will return a file
descriptor that can then be used to read the file data using file I/O functions such as: read() and ReadWithTimeout().
IMPORTANT After reading the file data you must do 2 things:

• The TCP connection must be closed with the close() function.

• FTPGetCommandResult() must be called to check the result of the operation.

Parameters

ftp_Session FTP session number


full_dir_name Full directory name to read, including the path
timeout Timeout in system Time Ticks

Returns

TCP file descriptor if greater than 0, otherwise ftpClientReturnCodes

19.39.2.10 FTPGetList()

int FTPGetList (
int ftp_Session,
const char ∗ full_dir_name,
uint16_t timeout )
Initialize the process to receive a directory listing from a FTP server.
This function opens a TCP connection to a FTP server so that a directory list may be read. it will return a file
descriptor that can then be used to read the file data using file I/O functions such as: read() and ReadWithTimeout().
IMPORTANT After reading the file data you must do 2 things:

• The TCP connection must be closed with the close() function.

• FTPGetCommandResult() must be called to check the result of the operation.

Parameters

ftp_Session FTP session number


full_dir_name Full directory name to read, including the path
timeout Timeout in system Time Ticks

NetBurner, Inc.
324 Module Documentation

Returns

TCP file descriptor if greater than 0, otherwise ftpClientReturnCodes

19.39.2.11 FTPMakeDir()

int FTPMakeDir (
int ftp_Session,
const char ∗ dir_to_make,
uint16_t timeout )
Create a new directory.

Parameters

ftp_Session FTP session number


dir_to_make Directory to create
timeout Timeout in system Time Ticks

Returns

FTP Client Return Codes

19.39.2.12 FTPPassiveMode()

void FTPPassiveMode (
int ftp_Session )
Set mode to passive.

Parameters

ftp_Session FTP session number

19.39.2.13 FTPRawCommand()

int FTPRawCommand (
int ftp_Session,
const char ∗ cmd,
char ∗ cmd_buf,
int nbytes,
uint16_t timeout )
Send a FTP command to the FTP server.

Parameters

ftp_Session FTP session number.


cmd The command to send. Do not include termination such as
\r\n
.
cmd_buf The buffer to hold the FTP server response, in ASCII.
nbytes The maximum number of bytes the cmd_buf can hold.
timeout Timeout in system Time Ticks.

NetBurner, Inc.
19.39 FTP Client 325

Returns

The FTP server response code if greater than 0, otherwise ftpClientReturnCodes

19.39.2.14 FTPRawStreamCommand()

int FTPRawStreamCommand (
int ftp_Session,
const char ∗ cmd,
int ∗ pResult,
char ∗ cmd_buf,
int nbytes,
uint16_t timeout )
Send a command and receive a response over a stream connection.
The FTP server will close the connection after all the data has been read. This function is the basis for such
functions as FTPGetList() and FTPGetFiles().
IMPORTANT After reading the file data you must call FTPGetCommandResult() to check the result of the operation.

Parameters

ftp_Session FTP session number


cmd Command to send
pResult The server response code integer value
cmd_buf The server response code ASCII value (include
\r\n
)
nbytes Maximum number of bytes cmd_buf can hold
timeout Timeout in system Time Ticks

Returns

TCP file descriptor if greater than 0, otherwise ftpClientReturnCodes

19.39.2.15 FTPRenameFile()

int FTPRenameFile (
int ftp_Session,
const char ∗ old_file_name,
const char ∗ new_file_name,
uint16_t timeout )
Rename a file.

Parameters

ftp_Session FTP session number


old_file_name Name of file to rename
new_file_name New name of file
timeout Timeout in system Time Ticks

Returns

FTP Client Return Codes

NetBurner, Inc.
326 Module Documentation

19.39.2.16 FTPSendFile()

int FTPSendFile (
int ftp_Session,
const char ∗ full_file_name,
BOOL bBinaryMode,
uint16_t timeout )
Initialize the process to send a file to s FTP server.
This function opens a TCP connection to a FTP server so that a file may be sent. it will return a file descriptor that
can then be used to send the file data using file I/O write functions such as: write(), writeall(), writestring(), etc.
IMPORTANT After sending the file data you must do 2 things:

• The TCP connection must be closed with the close() function.

• FTPGetCommandResult() must be called to check the result of the operation.

Parameters

ftp_Session FTP session number


full_file_name Name of the file being sent
bBinaryMode True = send file as binary data, False = send file as ASCII data
timeout Timeout in system Time Ticks

Returns

TCP file descriptor if greater than 0, otherwise FTP Client Return Codes

int fd = FTPSendFile(ftp, "testfile.txt", FALSE, 5 * TICKS_PER_SECOND); // Send file in ASCII mode


if (fd > 0)
{
writestring(fd, "This is a test file\r\n");
writestring(fd, "This is line 2 of the test file\r\n");
writestring(fd, "Last Line\r\n");
close(fd);
int rv = FTPGetCommandResult(ftpSession, resultBuffer, 80, 5 * TICKS_PER*SECOND );
if ( rv != 226) // Return code 226 = Closing data connection. Requested file action successful.
iprintf("Write error result = %d %s\r\n", rv, resultBuffer);
}
else
{
iprintf("Failed to send file\r\n");
}

19.39.2.17 FTPSetDir()

int FTPSetDir (
int ftp_Session,
const char ∗ new_dir,
uint16_t timeout )
Set the current working directory.

Parameters

ftp_Session FTP session number


new_dir Directory path to set
timeout Timeout in system Time Ticks

Returns

FTP Client Return Codes

NetBurner, Inc.
19.40 FTP Client Return Codes 327

19.39.2.18 FTPUpDir()

int FTPUpDir (
int ftp_Session,
uint16_t timeout )
Move up one directory level.

Parameters

ftp_Session FTP session number


timeout Timeout in system Time Ticks

Returns

FTP Client Return Codes

19.40 FTP Client Return Codes


Macros
• #define FTP_OK (0)
OK.
• #define FTP_TIMEOUT (-1)
Timeout.
• #define FTP_PASSWORDERROR (-2)
Password error.
• #define FTP_CONNECTFAIL (-3)
Connection failed.
• #define FTP_COMMANDFAIL (-4)
Command failed.
• #define FTP_COMMANDERROR (-4)
Command error.
• #define FTP_BADSESSION (-5)
Bad session.
• #define FTP_NETWORKERROR (-6)
Network error.

19.40.1 Detailed Description

19.41 Function Return Codes


Enumerations
• enum CertGenReturnCode : int {
CERT_GEN_RETURN_SUCCESS = 1 , CERT_GEN_RETURN_NOT_REQUIRED = 2 , CERT_GEN_RETURN_INVALID_RAN
= -1 , CERT_GEN_RETURN_MALLOC_ERROR = -2 ,
CERT_GEN_RETURN_ECC_INIT_ERROR = -3 , CERT_GEN_RETURN_ECC_CREATE_ERROR = -4 ,
CERT_GEN_RETURN_RSA_INIT_ERROR = -5 , CERT_GEN_RETURN_RSA_CREATE_ERROR = -6 ,
CERT_GEN_RETURN_CERT_INIT_ERROR = -7 , CERT_GEN_RETURN_CERT_CREATE_ERROR = -8 ,
CERT_GEN_RETURN_CERT_SIGNING_ERROR = -9 , CERT_GEN_RETURN_CERT_SAVING_ERROR =
-10 ,
CERT_GEN_RETURN_KEY_CONVERT_ERROR = -11 , CERT_GEN_RETURN_KEY_SAVING_ERROR =
-12 , CERT_GEN_RETURN_SET_ISSUER_ERROR = -13 }
Certificate Generation Function Return Codes.

NetBurner, Inc.
328 Module Documentation

19.41.1 Detailed Description


19.41.2 Enumeration Type Documentation

19.41.2.1 CertGenReturnCode

enum CertGenReturnCode : int


Certificate Generation Function Return Codes.

Enumerator

CERT_GEN_RETURN_SUCCESS Returned when the certificate was successfully


generated.
CERT_GEN_RETURN_NOT_REQUIRED Returned when the a new certificate was not required
to be generated.
CERT_GEN_RETURN_INVALID_RANDOM Returned when the device was unable to generate a
valid random number.
CERT_GEN_RETURN_MALLOC_ERROR Returned when the device is unable to malloc enough
space to generate the certificate.
CERT_GEN_RETURN_ECC_INIT_ERROR Returned when the device was unable to initialize the
required ECC object.
CERT_GEN_RETURN_ECC_CREATE_ERROR Returned when the device was unable to create the
ECC key.
CERT_GEN_RETURN_RSA_INIT_ERROR Returned when the device was unable to initialize the
required RSA object.
CERT_GEN_RETURN_RSA_CREATE_ERROR Returned when the device was unable to create the
RSA key.
CERT_GEN_RETURN_CERT_INIT_ERROR Returned when the device was unable to initialize the
required certificate object.
CERT_GEN_RETURN_CERT_CREATE_ERROR Returned when the device was unable to create the
certificate.
CERT_GEN_RETURN_CERT_SIGNING_ERROR Returned when the device was unable to sign the
created certificate.
CERT_GEN_RETURN_CERT_SAVING_ERROR Returned when the device was unable to properly
save the certificate.
CERT_GEN_RETURN_KEY_CONVERT_ERROR Returned when the device was unable to convert the
certificate from PEM to DER format.
CERT_GEN_RETURN_KEY_SAVING_ERROR Returned when the device was unable to save the key.
CERT_GEN_RETURN_SET_ISSUER_ERROR Returned when the device was unable to set the
issuer if a CA was used.

19.42 HAL - Hardware Abstraction Layer


Functions
• void HardwareSetup ()
Initializes the system hardware such as the timer, cache and clock speed.
• void PostConfigHardwareInit ()
Initializes the system hardware that depend on config variables such as the watchdog.
• void ForceReboot (bool bFromException=false)
Forces the system hardware to perform a soft reset.
• int HalStorage_Save (uint8_t area, void ∗pData, int len, int offset=0)

NetBurner, Inc.
19.42 HAL - Hardware Abstraction Layer 329

Save a blob to a specific persistent storage area as defined by the platform. This routine will perform all storage
maintenance routines necessary to ensure a valid write.
• int HalStorage_SavePartial (uint8_t area, void ∗pData, int len, int offset)
Save a blob to a specific persistent storage area as defined by the platform. This routine requires that any mainte-
nance required for a valid write be explicitly performed prior to being called.
• int HalStorage_Prepare (uint8_t area, int len, int offset=0)
Prepare a storage area for writing new data. For platforms with direct flash mapping this function is an alias for
HalStorage_Erase.
• int HalStorage_Finalize (uint8_t area)
Finalize a storage area after writing new data. This will perform any final completion or cleanup routines required to
persist the previously saved data from HalStorage_SavePartial calls.
• int HalStorage_Erase (uint8_t area, int len=-1, int offset=0)
Erase all or part of a storage area. Note: due to physical storage granularities, the total area erased may extend
beyond the requested area.
• int HalStorage_GetAllocated (uint8_t area)
Obtain the total size allocated to the given persistent storage area.
• int HalStorage_GetMaxAllocation (uint8_t area)
Obtain the maximum size that may be allocated to the given persistent storage area. For direct flash mapped plat-
forms, this is aliased to HalStorage_GetAllocated.
• int HalStorage_RemainingSpace (uint8_t area)
Obtain the number of remaining bytes available to be written in the given persistent storage area.
• int HalStorage_WriteOffset (uint8_t area)
Get the offset of the next byte that can be written in the given persistent storage area.
• int HalStorage_AddressOffset (uint8_t area, void ∗pWhere)
Get the offset within a persistent storage area of an address. A platform may map any address to any offset of its
choosing for a given storage area, and my modify its behavior on an area by area basis.
• void FlashErase (void ∗pWhere, int len)
Erases the flash memory.
• void FlashProgram (void ∗pWhere, void ∗pWhat, int len)
Program flash memory.
• void FlashProgramAppImage (void ∗pWhere, void ∗pWhat, int len)
Write an application image to flash memory.
• void DisableCache ()
Disable the instruction and data cache.
• void EnableCache ()
Enable the instruction and data cache.
• uint32_t spaceleft ()
Report how much free unallocated space is left in dynamic memory.
• uint16_t HalGetTickFraction (void)
Returns the fraction of the current system time tick.
• void StdioCheckIntc (void)
Check STDIO interrupt sources.
• void SysLogCheckIntc (void)
This is just like the StdioCheckIntc() function, except that the results are displayed via UDP.

Variables
• void(∗ watchdog_service_function )(void)
Watchdog callback service function.
• uint32_t HalTickMaxCount
Rollover value for the system hardware tick timer.

NetBurner, Inc.
330 Module Documentation

19.42.1 Detailed Description


The HAL provides a common function name interface to the various NetBurner hardware platforms. Other than
the ForceReboot() and spaceleft() functions, these are advanced functions that should only be used by developers
experienced with NetBurner hardware, firmware and memory maps.

19.42.2 Function Documentation

19.42.2.1 FlashErase()

void FlashErase (
void ∗ pWhere,
int len )
Erases the flash memory.

Parameters

pWhere The starting location in flash memory to begin the erasure


len Specified the number of bytes to erase

19.42.2.2 FlashProgram()

void FlashProgram (
void ∗ pWhere,
void ∗ pWhat,
int len )
Program flash memory.

Parameters

pWhere Pointer to the starting location in flash to begin programming


pWhat Pointer to the content that will be programmed into flash
len Number of bytes to program

19.42.2.3 FlashProgramAppImage()

void FlashProgramAppImage (
void ∗ pWhere,
void ∗ pWhat,
int len )
Write an application image to flash memory.
On some platforms writing the application image may require calling ProgramImage even though it may only call
FlashErase and FlashProgram. As a result, ProgramImage should always be used when updating the application
image.

Parameters

pWhere Pointer to the starting location in flash to begin the programming


pWhat Pointer to the content that will be programmed into flash
len Number of bytes to write

NetBurner, Inc.
19.42 HAL - Hardware Abstraction Layer 331

19.42.2.4 HalGetTickFraction()

uint16_t HalGetTickFraction (
void )
Returns the fraction of the current system time tick.
return - The current counter value used to generate tick count

19.42.2.5 HalStorage_AddressOffset()

int HalStorage_AddressOffset (
uint8_t area,
void ∗ pWhere )
Get the offset within a persistent storage area of an address. A platform may map any address to any offset of its
choosing for a given storage area, and my modify its behavior on an area by area basis.

Parameters
area The storage area being queried
pWhere An address value to be translated

Returns

Offset of the requested address within the storage area. Returns negative on error.

19.42.2.6 HalStorage_Erase()

int HalStorage_Erase (
uint8_t area,
int len = -1,
int offset = 0 )
Erase all or part of a storage area. Note: due to physical storage granularities, the total area erased may extend
beyond the requested area.

Parameters
area The storage area to be erased
len Number of bytes to be erased (a negative length will erase the entire area)
offset The location within the area that the erasure should begin

Returns

Number of bytes erased. Returns negative on error.

19.42.2.7 HalStorage_Finalize()

int HalStorage_Finalize (
uint8_t area )
Finalize a storage area after writing new data. This will perform any final completion or cleanup routines required to
persist the previously saved data from HalStorage_SavePartial calls.

Parameters

area The storage area to finalize

NetBurner, Inc.
332 Module Documentation

Returns

Returns negative on error.

19.42.2.8 HalStorage_GetAllocated()

int HalStorage_GetAllocated (
uint8_t area )
Obtain the total size allocated to the given persistent storage area.

Parameters
area The storage area being queried

Returns

Number of bytes allocated. Returns negative on error.

19.42.2.9 HalStorage_GetMaxAllocation()

int HalStorage_GetMaxAllocation (
uint8_t area )
Obtain the maximum size that may be allocated to the given persistent storage area. For direct flash mapped
platforms, this is aliased to HalStorage_GetAllocated.

Parameters
area The storage area being queried

Returns

Number of bytes allocated. Returns negative on error.

19.42.2.10 HalStorage_Prepare()

int HalStorage_Prepare (
uint8_t area,
int len,
int offset = 0 )
Prepare a storage area for writing new data. For platforms with direct flash mapping this function is an alias for
HalStorage_Erase.

Parameters
area The storage area to be readied
len Number of bytes to be written by later HalStorage_SavePartial calls
offset The location within the area that the readying should begin

Returns

Number of bytes readied. Returns negative on error.

NetBurner, Inc.
19.42 HAL - Hardware Abstraction Layer 333

19.42.2.11 HalStorage_RemainingSpace()

int HalStorage_RemainingSpace (
uint8_t area )
Obtain the number of remaining bytes available to be written in the given persistent storage area.

Parameters
area The storage area being queried

Returns

Number of bytes available. Returns negative on error.

19.42.2.12 HalStorage_Save()

int HalStorage_Save (
uint8_t area,
void ∗ pData,
int len,
int offset = 0 )
Save a blob to a specific persistent storage area as defined by the platform. This routine will perform all storage
maintenance routines necessary to ensure a valid write.

Parameters

area The storage area to be used. A platform is only required to support the areas as defined by
HalStorage_t, however it may define additional areas as needed
pData Pointer to the data to be written
len Number of bytes to be written to the storage area
offset Where in the storage area the first byte should be written. Default is 0.

Returns

Number of bytes written. Returns negative on error.

19.42.2.13 HalStorage_SavePartial()

int HalStorage_SavePartial (
uint8_t area,
void ∗ pData,
int len,
int offset )
Save a blob to a specific persistent storage area as defined by the platform. This routine requires that any mainte-
nance required for a valid write be explicitly performed prior to being called.

Parameters

area The storage area to be used. A platform is only required to support the areas as defined by
HalStorage_t, however it may define additional areas as needed.
pData Pointer to the data to be written
len Number of bytes to be written to the storage area
offset Where in the storage area the first byte should be written.

NetBurner, Inc.
334 Module Documentation

Returns

Number of bytes written. Returns negative on error.

19.42.2.14 HalStorage_WriteOffset()

int HalStorage_WriteOffset (
uint8_t area )
Get the offset of the next byte that can be written in the given persistent storage area.

Parameters
area The storage area being queried

Returns

Offset of the next byte that can be written. Returns negative on error.

19.42.2.15 spaceleft()

uint32_t spaceleft ( )
Report how much free unallocated space is left in dynamic memory.

Returns

Number of bytes unallocated in dynamic memory

19.42.2.16 StdioCheckIntc()

void StdioCheckIntc (
void )
Check STDIO interrupt sources.
Checks the interrupt sources used in the system along with their associated interrupt level and priority, and also
checks for any conflicts in using the same level and priority between different sources. These results are sent to
stdout.
See also

SysLogCheckIntc()

19.42.2.17 SysLogCheckIntc()

void SysLogCheckIntc (
void )
This is just like the StdioCheckIntc() function, except that the results are displayed via UDP.

See also

StdioCheckIntc()

19.42.3 Variable Documentation

NetBurner, Inc.
19.43 HTTP and HTML Functions 335

19.42.3.1 HalTickMaxCount

uint32_t HalTickMaxCount [extern]


Rollover value for the system hardware tick timer.

Returns

The max/rollover counter value used to generate the tick count

19.42.3.2 watchdog_service_function

void(∗ watchdog_service_function) (void) (


void ) [extern]
Watchdog callback service function.
If the following function pointer is set to point at a function of the form:
void YourFunc( void );
Then the system will call this function throughout the AutoUpdate/TCPUpdate process to make sure that the watch-
dog timer is serviced.

19.43 HTTP and HTML Functions


Classes
• struct HTTP_Request
HTTP Request Structure.
• class HtmlPageHandler
Base class for all GET handlers. To handle GET requests for a specific URL in your application, build a GET handler
object for that specifif URL. A NULL name will be a catch all for all GET requests.
• class CallBackFunctionPostHandler
Implements the HtmlPostHandler class as a function pointer callback for POST requests.
• class HtmlPostVariableListCallback
Implements the HtmlPostVariableListHandler class as a function pointer callback for HTTP POST submissions.

Typedefs
• typedef int() http_gethandlerfunc(int sock, HTTP_Request &pd)
Implements the HtmlPageHandler class as a function pointer callback for GET requests.
• typedef int() http_posthandler(int sock, HTTP_Request &httpReqInfo)
Type definition of the HtmlPostHandler callback for POST requests.

Enumerations
• enum HTTP_RequestTypes { tUnknown , tGet , tPost , tHead }
HTTP request types for HTTP page handler callback functions.
• enum HTTP_ACCESS
HTTP page access return values.

Functions
• int SendEmailResponse (int sock, const char ∗name, const char ∗attachment)
Send an email with HTML formatting.
• int SendFullResponse (char const ∗name, int fd)
Send a file with the proper HTTP header, file specified by file name.
• int SendFullResponse (HTML_FILE_RECORD ∗fr, int fd, const char ∗pUrl)

NetBurner, Inc.
336 Module Documentation

Send a file with the proper HTTP header, file specified by HTML_FILE_RECORD.
• int SendHeaderResponse (char const ∗name, int fd)
Send a HTTP header response for the specified file type.
• int SendHeaderResponse (HTML_FILE_RECORD ∗fr, int fd)
Send a HTTP header response for the specified HTML_FILE_RECORD type.
• int32_t SendFileFragment (char const ∗name, int32_t fd, PCSTR url=NULL)
Send a file fragment without a header.
• HTML_FILE_RECORD ∗ GetRecordFromName (char const ∗name)
Returns a pointer to a HTML_FILE_RECORD for the specified file name.
• CONFIG_RENDER_OBJ ConfigRenderFunc (int mode, const char ∗pobj, int len=20, const char ∗extra=0)
Render a configuration object as HTML for the specified configuration object.
• CONFIG_RENDER_OBJ ConfigRenderFunc (int mode, config_leaf &cl, int len=20, const char ∗extra=0)
Render a configuration object as HTML for the specified configuration leaf object.
• void WriteHtmlVariable (int fd, CONFIG_RENDER_OBJ co)
Send a CONFIG_RENDER_OBJ to the client.
• HTTP_Request ∗ GetActiveHttpRequest ()
Get thc curent active running http request. Only valid fromwithing http get or post handeling. Also valid during page
fill in operations.
• HTTP_ACCESS CheckHttpAccess (int sock, int access_level, HTTP_Request &Req)
All HTTP requests go though this function.
• void StartHttp (uint16_t port, bool RunConfigMirror)
Start the HTTP web server. Further documentation in the Initialization section Initialization - System Initialization Functions.
• void StopHttp ()
Stop the HTTP web server.
• void SendHTMLHeader (int sock)
Send a HTML response header.
• void SendHTMLHeaderWCookie (int sock, char ∗cookie)
Send a HTML response header and cookie.
• void SendTextHeader (int sock)
Send a HTML plain text header.
• void SendGifHeader (int sock)
Send a HTML GIF header.
• void EmptyResponse (int sock)
Send an empty response back.
• void NoContentResponse (int sock)
Send a no content response back.
• void RedirectResponse (int sock, PCSTR new_page)
Redirect a HTTP request to a different page.
• void NotFoundResponse (int sock, PCSTR new_page)
Send a page not found response.
• void ForbiddenResponse (int sock, PCSTR new_page)
Send a page is forbidden response.
• void NotAvailableResponse (int sock, PCSTR new_page)
Send a response indicating that the requested resource is not available at this time.
• void BadRequestResponse (int sock, PCSTR url, PCSTR data)
Send a response indicating that the client request itself is faulty in some manner.
• int writeallsafestring (int fd, PCSTR str)
Send a string and escape all special characters.
• int writesafestring (int fd, PCSTR str, size_t strLength)
Send a string with a specified length and escape all special characters.
• int httpstricmp (PCSTR str1, PCSTR strIsUpper2)
Special string compare. Returns 1 if the strings match until one string ends with a null (0).
• void StartHttps (uint16_t ssl_port, uint16_t http_port)
Start the HTTPS secure web server.

NetBurner, Inc.
19.43 HTTP and HTML Functions 337

19.43.1 Detailed Description


API to process and delivery files from the web server to clients. In particular, processing of files in a project's html
folder.
For the majority of applications these functions will not be necessary; the web server system will automatically
handle both static and dynamic content. This API is available if more advances processing is required, such as
sending custom response headers or very large amounts of data.
In addition to the functions to start a web server, StartHttp(), this module provides functions used to create a custom
web interface. Please refer to the Programmers Guide for additional details on web interface programming and
dynamic content.

See also

StartHttps()

19.43.2 Typedef Documentation

19.43.2.1 http_gethandlerfunc

typedef int() http_gethandlerfunc(int sock, HTTP_Request &pd)


Implements the HtmlPageHandler class as a function pointer callback for GET requests.

Return values
0 Not handled, no changes are made
1 Handled
2 TCP socket will be kept. Socket will get closed by some other method. For example, a large file could be
sent from a different task. Any return value other than 2 means the page was processed normally.

19.43.2.2 http_posthandler

typedef int() http_posthandler(int sock, HTTP_Request &httpReqInfo)


Type definition of the HtmlPostHandler callback for POST requests.
This should only be used if the specific variable callback implementions will not work in your application. This is
mostly an internal use function.

Parameters
sock The socket the request came in on.
httpReqInfo Information about the request HTTP_Request.

Return values
0 Not handled, no changes are made
1 Handled
2 TCP socket will be kept. Socket will get closed by some other method. For example, a large file could be
sent from a different task. Any return value other than 2 means the page was processed normally.

See also

HtmlPostVariableListCallback
HtmlPostVariableListHandler

NetBurner, Inc.
338 Module Documentation

19.43.3 Enumeration Type Documentation

19.43.3.1 HTTP_RequestTypes

enum HTTP_RequestTypes
HTTP request types for HTTP page handler callback functions.

Enumerator

tUnknown The type of request is not yet known.


tGet GET request.
tPost POST request.
tHead Header request, does not include content.

19.43.4 Function Documentation

19.43.4.1 BadRequestResponse()

void BadRequestResponse (
int sock,
PCSTR url,
PCSTR data )
Send a response indicating that the client request itself is faulty in some manner.

Parameters

sock Socket to send response


url The URL of the page to display
data An explanation or segment of data to display indicating the fault

See also

RedirectResponse(), NotFoundResponse(), ForbiddenResponse()


NotAvailableResponse()

19.43.4.2 CheckHttpAccess()

HTTP_ACCESS CheckHttpAccess (
int sock,
int access_level,
HTTP_Request & Req )
All HTTP requests go though this function.
By default the library provides a weak reference implimentaion that approves all transactions. To provide your own
just add an implmentaion of this function to your code.

Parameters
sock The socket the request came in on.
access_level The user defined access level for this request. See HtmlPageHandler
Req The HTTP request where one can extract the URL , access type, password, etc

NetBurner, Inc.
19.43 HTTP and HTML Functions 339

Returns

The desired response.

19.43.4.3 ConfigRenderFunc() [1/2]

CONFIG_RENDER_OBJ ConfigRenderFunc (
int mode,
config_leaf & cl,
int len = 20,
const char ∗ extra = 0 )
Render a configuration object as HTML for the specified configuration leaf object.

Parameters

mode CONFIG_RENDER_OBJ eMode value


cl Reference to the config_leaf object to render
len Optional length parameter for text input elements
extra Pointer to any additional information to be added to the HTML input element. Will be added to the end
of the <input> tag.

Returns

A CONFIG_RENDER_OBJ that can be sent to the client using WriteHtmlVariable()

19.43.4.4 ConfigRenderFunc() [2/2]

CONFIG_RENDER_OBJ ConfigRenderFunc (
int mode,
const char ∗ pobj,
int len = 20,
const char ∗ extra = 0 )
Render a configuration object as HTML for the specified configuration object.

Parameters

mode CONFIG_RENDER_OBJ eMode value


pobj Pointer to a configuration object. Can be specified as the JSON configuration path. For example,
"Config/Sys/NetIf/Ethernet0/StaticAddr".
len Optional length parameter for text input elements
extra Pointer to any additional information to be added to the HTML input element. Will be added to the end
of the <input> tag.

Returns

A CONFIG_RENDER_OBJ that can be sent to the client using WriteHtmlVariable()

19.43.4.5 EmptyResponse()

void EmptyResponse (
int sock )
Send an empty response back.

NetBurner, Inc.
340 Module Documentation

Parameters

sock Socket to send response

See also

ForbiddenResponse(), ForbiddenResponse(), SendHTMLHeaderWCookie()


NotAvailableResponse(), BadRequestResponse(), RedirectResponse()

19.43.4.6 ForbiddenResponse()

void ForbiddenResponse (
int sock,
PCSTR new_page )
Send a page is forbidden response.

Parameters

sock Socket to send response


new_page The URL of the page to display

See also

RedirectResponse(), NotFoundResponse()
NotAvailableResponse(), BadRequestResponse()

19.43.4.7 GetRecordFromName()

HTML_FILE_RECORD ∗ GetRecordFromName (
char const ∗ name )
Returns a pointer to a HTML_FILE_RECORD for the specified file name.

Parameters

name Name of file in htmldata.cpp to search for

Return values

A pointer to a HTML_FILE_RECORD if found


NULL if file name not found

19.43.4.8 httpstricmp()

int httpstricmp (
PCSTR str1,
PCSTR strIsUpper2 )
Special string compare. Returns 1 if the strings match until one string ends with a null (0).
strIsUpper2 must be specified in upper case
Used to match URL with stored file prefixes.

NetBurner, Inc.
19.43 HTTP and HTML Functions 341

Parameters
str1 The string to search
strIsUpper2 The string to search for, must be specified in upper case

Return values

0 if the prefixes do not match


1 if the prefixes match

Example: httpstricmp( str1, "LED.HTML");

str1 Return Value


LED 1
led.HTML 1
led.html 1
LED.HTM? 0

19.43.4.9 NoContentResponse()

void NoContentResponse (
int sock )
Send a no content response back.

Parameters

sock Socket to send response

See also

ForbiddenResponse(), ForbiddenResponse(), SendHTMLHeaderWCookie()


NotAvailableResponse(), BadRequestResponse(), RedirectResponse()

19.43.4.10 NotAvailableResponse()

void NotAvailableResponse (
int sock,
PCSTR new_page )
Send a response indicating that the requested resource is not available at this time.

Parameters

sock Socket to send response


new_page The URL of the page to display

See also

RedirectResponse(), NotFoundResponse(), ForbiddenResponse()


BadRequestResponse()

NetBurner, Inc.
342 Module Documentation

19.43.4.11 NotFoundResponse()

void NotFoundResponse (
int sock,
PCSTR new_page )
Send a page not found response.

Parameters

sock Socket to send response


new_page The URL of the page to display

See also

ForbiddenResponse(), RedirectResponse()
NotAvailableResponse(), BadRequestResponse()

19.43.4.12 RedirectResponse()

void RedirectResponse (
int sock,
PCSTR new_page )
Redirect a HTTP request to a different page.

Parameters

sock Socket to send response


new_page The URL of the new page

See also

ForbiddenResponse(), ForbiddenResponse(), SendHTMLHeaderWCookie()


NotAvailableResponse(), BadRequestResponse(), EmptyResponse()

19.43.4.13 SendEmailResponse()

int SendEmailResponse (
int sock,
const char ∗ name,
const char ∗ attachment )
Send an email with HTML formatting.

Parameters
sock Network socket in which to send the data
name Name of file from project's html folder, this is the email body
attachment

Return values

1 Success, the file specified the name parameter was found


0 File does not exist

NetBurner, Inc.
19.43 HTTP and HTML Functions 343

19.43.4.14 SendFileFragment()

int32_t SendFileFragment (
char const ∗ name,
int32_t fd,
PCSTR url = NULL )
Send a file fragment without a header.
Search through the files stored in the system by comphtml in the project's html folder for the specified file name. If
found, the file content is sent as a file fragment. A SendHeaderRespose function must be sent prior to sending file
fragments.
This function is useful when building HTML responses with large amounts of data. If the file has embedded dynamic
HTML function tags and/or variable tags, such a CPPCALL and VARIABLE, they will be processed as the content
is delivered.

Parameters

name Name of the file


fd File descriptor used to send the file fragment
url Optional URL string in fragment header

Return values

1 if the file was found


0 otherwise

19.43.4.15 SendFullResponse() [1/2]

int SendFullResponse (
char const ∗ name,
int fd )
Send a file with the proper HTTP header, file specified by file name.
This function searches through the files stored in the system by comphtml in the project's html folder for the specified
file name. If found, it sends the proper HTTP header and file to the client. If the file has embedded dynamic HTML
function tags and/or variable tags, such a CPPCALL and VARIABLE, they will be processed as the content is
delivered.

Parameters

name Name of the file


fd File descriptor used to send the file

Return values

1 Succes, file was found


0 File does not exist

See also

SendFullResponse(HTML_FILE_RECORD ∗fr, int fd, const char ∗pUrl)

NetBurner, Inc.
344 Module Documentation

19.43.4.16 SendFullResponse() [2/2]

int SendFullResponse (
HTML_FILE_RECORD ∗ fr,
int fd,
const char ∗ pUrl )
Send a file with the proper HTTP header, file specified by HTML_FILE_RECORD.
While the SendFullResponse(char const ∗name, int fd) function will resolve the file name, this lower level function
requires knowledge of the file pointer to the HTML_FILE_RECORD in htmldata.cpp.

Parameters

fr Pointer to the HTML_FILE_RECORD in htmldata.cpp


fd File descriptor used to send the file
pUrl Pointer to a URL string used by response functions such a CPPCALL and VARIABLE callbacks. In
default web server processing the URL is automatically set to what the client requested. When
processing web requests manually you must specify the URL string. If you are not using dynamic
content that relies on the URL, this can be set to NULL.

Return values

1 if the file was found


0 otherwise

See also

SendFullResponse(char const ∗name, int fd)

19.43.4.17 SendGifHeader()

void SendGifHeader (
int sock )
Send a HTML GIF header.
Sends a GIF response header. Can be useful when dynamically creating your own GIF images.

Parameters

sock Socket to send response

See also

SendHTMLHeader(), SendTextHeader(), SendHTMLHeaderWCookie()

19.43.4.18 SendHeaderResponse() [1/2]

int SendHeaderResponse (
char const ∗ name,
int fd )
Send a HTTP header response for the specified file type.
This function searches through the files stored in the system by comphtml in the project's html folder for the specified
file name. If found, it sends the proper HTTP header only to the client. Unlike a full response, only the header is
sent.

NetBurner, Inc.
19.43 HTTP and HTML Functions 345

Parameters

name Name of the file


fd File descriptor used to send the file

Return values

1 Succes, file was found


0 File does not exist

See also

SendHeaderResponse(HTML_FILE_RECORD ∗fr, int fd)

19.43.4.19 SendHeaderResponse() [2/2]

int SendHeaderResponse (
HTML_FILE_RECORD ∗ fr,
int fd )
Send a HTTP header response for the specified HTML_FILE_RECORD type.
While the SendFullResponse(HTML_FILE_RECORD ∗fr, int fd, const char ∗pUrl); function will resolve the file
name, this lower level function requires knowledge of the file pointer to the HTML_FILE_RECORD array in
htmldata.cpp.

Parameters

fr Pointer to the HTML_FILE_RECORD in htmldata.cpp


fd File descriptor used to send the file

Return values

1 Succes, file was found


0 File does not exist

See also

SendHeaderResponse(char const ∗name, int fd)

19.43.4.20 SendHTMLHeader()

void SendHTMLHeader (
int sock )
Send a HTML response header.
Used to build your own HTML response

Parameters

sock Socket to send response

NetBurner, Inc.
346 Module Documentation

See also

SendHTMLHeaderWCookie(), SendTextHeader(), SendGifHeader()

19.43.4.21 SendHTMLHeaderWCookie()

void SendHTMLHeaderWCookie (
int sock,
char ∗ cookie )
Send a HTML response header and cookie.
Sends a header as well as a cookie to be stored by the client browser.

Parameters

sock Socket to send response


cookie Pointer to the cookie

See also

SendHTMLHeader(), SendGifHeader(), SendTextHeader()

19.43.4.22 SendTextHeader()

void SendTextHeader (
int sock )
Send a HTML plain text header.
Use as the first part of building your own plain text response.

Parameters

sock Socket to send response

See also

SendHTMLHeader(), SendGifHeader(), SendHTMLHeaderWCookie()

19.43.4.23 StartHttp()

void StartHttp (
uint16_t port,
bool RunConfigMirror )
Start the HTTP web server. Further documentation in the Initialization section Initialization - System Initialization Functions.
If no parameters are specified it will listen on port 80, and enable the configuration mirror feature so an application
can create its own custom configuration web page.

Parameters

port Listen port, defaults to port 80


RunConfigMirror Enable configuration mirror, default is true

NetBurner, Inc.
19.43 HTTP and HTML Functions 347

See also

StopHttp(), StartHttps()

19.43.4.24 StartHttps()

void StartHttps (
uint16_t ssl_port,
uint16_t http_port )
Start the HTTPS secure web server.
If no parameters are specified, the web server will listen on ports 443 and 80, and enable the configuration mirror
feature so an application can create its own custom configuration web page. If no user certificate/key is installed,
the default system key will be used.
Default parameter values defined in init.h

Parameters

ssl_port Secure listen port, defaults to port 443


http_port Non-secure listen port, defaults to port 80

See also

StartHttp(), StopHttp()

19.43.4.25 StopHttp()

void StopHttp ( )
Stop the HTTP web server.

See also

StartHttp()

19.43.4.26 writeallsafestring()

int writeallsafestring (
int fd,
PCSTR str )
Send a string and escape all special characters.
When sending a HTML text response, certain characters (e.g. '<') are interpreted by the browser as formatting.
This function properly escapes the text so it will appear as intended.

Parameters

fd File descriptor used to send response


str String to send

NetBurner, Inc.
348 Module Documentation

Returns

The number of characters sent

19.43.4.27 WriteHtmlVariable()

void WriteHtmlVariable (
int fd,
CONFIG_RENDER_OBJ co )
Send a CONFIG_RENDER_OBJ to the client.
The CONFIG_RENDER_OBJ must have been previously created with a ConfigRenderFunc() function.

Parameters

fd File descriptor to send data to


co CONFIG_RENDER_OBJ to send

19.43.4.28 writesafestring()

int writesafestring (
int fd,
PCSTR str,
size_t strLength )
Send a string with a specified length and escape all special characters.
When sending a HTML text response, certain characters (e.g. '<') are interpreted by the browser as formatting.
This function properly escapes the text so it will appear as intended.

Parameters

fd File descriptor used to send response


str String to send
strLength number of characters from str to send

Returns

The number of characters sent

19.44 High Resolution Delay Timer


Classes
• class DelayObject
Microsecond Delay Class.

19.44.1 Detailed Description


The OSTimeDly() system function has a 20ms tick count, but if you need more precision timing The High Resolution
Delay timer provides delays in microseconds.
When a DelayObject is created, it allocates an available hardware system timer. Once the delay time has expired,
and when the object goes out of scope, the hardware timer is freed.
Example Usage:
static DelayObject myHiResDelay; // Create the object
myHiDrsDelay.DelayUsec(100); // Delay 100 us
myHiDrsDelay.DelayUsec(200); // Delay 200 us
myHiDrsDelay.DelayUsec(300); // Delay 300 us

NetBurner, Inc.
19.45 I/O Control Command Flags 349

See also

Interval Timer
Stopwatch Timer
OSTimeDly()

19.45 I/O Control Command Flags


Macros
• #define IOCTL_SET (0x4000)
Set an option.
• #define IOCTL_CLR (0x2000)
Clear an option.

19.45.1 Detailed Description


The command flags to use in contuction with ioctl() and I/O Control Options

19.46 I/O Control Options


Macros
• #define IOCTL_TX_CHANGE_CRLF (1)
When set, transmitted char \n gets converted to \r\n
• #define IOCTL_RX_CHANGE_CRLF (2)
When set, received \r\n get turned into \n
• #define IOCTL_RX_PROCESS_EDITS (4)
When set, process backspace and do simple line editing.
• #define IOCTL_RX_ECHO (8)
When set, echo chars received to tx.
• #define IOCTL_TX_NO_BLOCK (32)
When set, stdout and stderr will drop output instead of blocking.
• #define IOCTL_ALL_OPTIONS (15)
When set, turns on all options.

19.46.1 Detailed Description


The legal options for use with ioctl() and in conjunction with I/O Control Command Flags

19.47 I2C
Modules
• MOD5441x and NANO54415
NetBurner I2C API for MOD5441x and NANO54415.
• MODM7AE70 (SAME70)

19.47.1 Detailed Description


I2C API for NetBurner Platforms

NetBurner, Inc.
350 Module Documentation

19.48 IOSYS - I/O System


Modules
• FD Change Type
• I/O Control Command Flags
• I/O Control Options

Typedefs
• typedef void FDCallBack(int fd, FDChangeType change, void ∗pData)
Define the function signature for file descriptor notification callbacks.

Functions
• int close (int fd)
Close the specified file descriptor and free the associated resources.
• int read (int fd, char ∗buf, int nbytes)
Read data from a file descriptor (fd). This function will block forever until at least one byte is available to be read (as
opposed to the ReadWithTimeout() function which reads data from a file descriptor with a specified time-out value).
This function can be used to read from stdio, TCP sockets, or Serial ports.
• int peek (int fd, char ∗c)
Peek at the data for the specified file descriptor (fd). Will block forever until at least one byte is available to be read.
The byte returned is not removed from the fd buffer, it will be the first byte of data returned on any subsequent read
operation.
• int write (int fd, const char ∗buf, int nbytes)
Write data to the stream associated with a file descriptor (fd). Can be used to write data to stdio, a TCP socket, or a
Serial port.
• int writestring (int fd, const char ∗str)
Write a null terminated ascii string to the stream associated with a file descriptor (fd). Can be used to write data to
stdio, a TCP socket, or a Serial port.
• int writeall (int fd, const char ∗buf, int nbytes=0)
Write the specified number of bytes to a file descriptor. Will block until all bytes are sent, or a file descriptor error
occurs (such as a TCP socket error). Can be used to write data to stdio, a TCP socket, or a Serial port.
• int ReadWithTimeout (int fd, char ∗buf, int nbytes, unsigned long timeout)
Read data from a file descriptor (fd), or return if at least one byte is not read within the specified timeout. Can be used
instead of the read() function, which will block forever until at least one byte is read. Can be used to read from stdio,
TCP sockets, or Serial ports.
• int ReadAllWithTimeout (int fd, char ∗buf, int nbytes, unsigned long timeout)
Attempt to read the specified number of bytes from a file descriptor, or return with the number of bytes read if the
timeout value has expired.
• int readall (int fd, char ∗buf, int nbytes)
Read the specified number of bytes from a file descriptor (fd). This function will block until either the requested number
of bytes have been read, or a file descriptor error occurs. It can be used to read from stdio, TCP sockets, or Serial
ports.
• int PeekWithTimeout (int fd, char ∗c, unsigned long timeout)
This function peeks at data from a file descriptor (fd), with a specified timeout value (as opposed to the peek function
which will block forever until at least one byte is available to be read). This function can be used to peek from stdio,
TCP sockets, or Serial ports.
• int dataavail (int fd)
Check the specified file descriptor to detmeine if data is available to be read.
• int writeavail (int fd)
Check the specified file descriptor to determine data can be written.
• int haserror (int fd)
Check if a file descriptor has an error.

NetBurner, Inc.
19.48 IOSYS - I/O System 351

• int charavail ()
Checks to see if data is available for read on stdin. By default, stdin is the boot/debug serial port.
• void RegisterFDCallBack (int fd, FDCallBack ∗fp, void ∗pData)
Register a callback function to receive notification when an FD state changes. Register a NULL fp to remove the
notification.
• void FD_ZERO (fd_set ∗pfds)
Clear (set to 0) a fd_set (file descriptor set) so no file descriptors (fds) are selected.
• void FD_CLR (int fd, fd_set ∗pfds)
A fd_set (file descriptor set) holds a set of file descriptors (fds). This function clears or removes a specific file descriptor
in an fd_set.
• void FD_SET (int fd, fd_set ∗pfds)
A fd_set (file descriptor set) holds a set of file descriptors (fds). This function sets or adds a specific file descriptor to
an fd_set.
• int FD_ISSET (int fd, fd_set ∗pfds)
A fd_set (file descriptor set) holds a set of file descriptors (fds). This function checks whether or not a particular fd is
set in the specified fd_set.
• int select (int nfds, fd_set ∗readfds, fd_set ∗writefds, fd_set ∗errorfds, unsigned long timeout)
Wait for events to occur on one or more I/O resources associated with a set of file descriptors (fds), such as data
available to be read, a resource is available to write data, or an error has occurred.
• int ZeroWaitSelect (int nfds, fd_set ∗readfds, fd_set ∗writefds, fd_set ∗errorfds)
Returns whether events have occurred on one or more I/O resources associated with a set of file descriptors (fds),
and returns immediately.
• int ioctl (int fd, int cmd)
This function controls the selection of input/output control options for stdio: stdin = 0, stdout = 1 and stderr = 2.
• int ReplaceStdio (int stdio_fd, int new_fd)
Maps stdio to any file descriptor (fd).
• int CurrentStdioFD (int stdio_fd)
Returns the current file descriptor mapped to the stdio file descriptor.
• void IrqStdio ()
Open the system default serial port in interrupt mode using the system default baud rate, and assign this serial port
to stdin, stdout and stderr.

19.48.1 Detailed Description


I/O system functions use file descriptors for communication and status of network interfaces, serial interfaces, and
any custom file descriptors created by an application.

19.48.2 Typedef Documentation

19.48.2.1 FDCallBack

typedef void FDCallBack(int fd, FDChangeType change, void ∗pData)


Define the function signature for file descriptor notification callbacks.

Parameters

fd The file descriptor number


change The reason for the call back, FDChangeType
∗pData A void pointer passed into the register function. Can be used to reference objects or other data

NetBurner, Inc.
352 Module Documentation

See also

FDChangeType
RegisterFDCallBack

19.48.3 Function Documentation

19.48.3.1 charavail()

int charavail ( )
Checks to see if data is available for read on stdin. By default, stdin is the boot/debug serial port.

Return values
1 Data available
0 No data available

See also

dataavail()
writeavail()
read()

19.48.3.2 close()

int close (
int fd )
Close the specified file descriptor and free the associated resources.

Parameters

fd The file descriptor number

Returns

0 on success, or a resource specific error on failure.

See also

peek()
PeekWithTimeout()
read()
ReadWithTimeout()
write()

19.48.3.3 CurrentStdioFD()

int CurrentStdioFD (
int stdio_fd )
Returns the current file descriptor mapped to the stdio file descriptor.

NetBurner, Inc.
19.48 IOSYS - I/O System 353

Parameters

stdio←- The stdio file descriptor to check. Options are stdin (0), stdout (1), and stderr (2).
_fd

Returns

The current file descriptor mapped to stdio_fd

19.48.3.4 dataavail()

int dataavail (
int fd )
Check the specified file descriptor to detmeine if data is available to be read.

Parameters

fd The file descriptor number

Return values
1 Data available
0 No data available

See also

charavail()
peek()
read()
ReadWithTimeout()

19.48.3.5 FD_CLR()

void FD_CLR (
int fd,
fd_set ∗ pfds )
A fd_set (file descriptor set) holds a set of file descriptors (fds). This function clears or removes a specific file
descriptor in an fd_set.

Parameters

fd The file descriptor number


∗pfds Pointer to the fd_set to modify

See also

FD_ZERO()
FD_SET()
FD_ISSET()
select()

NetBurner, Inc.
354 Module Documentation

19.48.3.6 FD_ISSET()

int FD_ISSET (
int fd,
fd_set ∗ pfds )
A fd_set (file descriptor set) holds a set of file descriptors (fds). This function checks whether or not a particular fd
is set in the specified fd_set.
For example:
if ( FD_ISSET( fdListen, &readFds ) )
{
// do processing for fdListen
}

Parameters

fd The file descriptor number


∗pfds A pointer to the fd_set to test

Return values

0 File descriptor is not set in the file descriptor set


>0 File descriptor is set in the file descriptor set

See also

FD_ZERO()
FD_CLR()
FD_SET()
select()

19.48.3.7 FD_SET()

void FD_SET (
int fd,
fd_set ∗ pfds )
A fd_set (file descriptor set) holds a set of file descriptors (fds). This function sets or adds a specific file descriptor
to an fd_set.

Parameters

fd The file descriptor number


∗pfds Pointer to the fd_set to modify

See also

FD_ZERO()
FD_CLR()
FD_ISSET()
select()

19.48.3.8 FD_ZERO()

void FD_ZERO (
fd_set ∗ pfds )

NetBurner, Inc.
19.48 IOSYS - I/O System 355

Clear (set to 0) a fd_set (file descriptor set) so no file descriptors (fds) are selected.

Parameters

∗pfds Pointer to the file descriptor set

See also

FD_CLR()
FD_SET()
FD_ISSET()
select()

19.48.3.9 haserror()

int haserror (
int fd )
Check if a file descriptor has an error.

Parameters

fd File descriptor number

Return values

1 The file descriptor has an error


0 The file descriptor does not have an error

See also

dataavail()
writeavail()
charavail()

19.48.3.10 ioctl()

int ioctl (
int fd,
int cmd )
This function controls the selection of input/output control options for stdio: stdin = 0, stdout = 1 and stderr = 2.
The legal options are listed in I/O Control Options.

Parameters

fd The file descriptor number. The three options are stdin (0), stdout (1), and stderr (2).
cmd The ioctl command options are I/O Control Command Flags and the bit of the associated options as
defined by I/O Control Options.

NetBurner, Inc.
356 Module Documentation

Returns

The old option value.

ioctl(0,IOCTL_SET| IOCTL_ALL_OPTIONS); // Sets all options


ioctl(1,IOCTL_CLR| IOCTL_ALL_OPTIONS); // Clears all options
ioctl(1,IOCTL_SET| IOCTL_RX_CHANGE_CRLF|IOCTL_RX_PROCESS_EDITS); // Sets some options
ioctl(2,IOCTL_CLR| IOCTL_RX_CHANGE_CRLF|IOCTL_RX_PROCESS_EDITS); // Clears some options

See also

ReplaceStdio()

19.48.3.11 peek()

int peek (
int fd,
char ∗ c )
Peek at the data for the specified file descriptor (fd). Will block forever until at least one byte is available to be read.
The byte returned is not removed from the fd buffer, it will be the first byte of data returned on any subsequent read
operation.

Parameters

fd File descriptor
∗c Pointer to the read destination character string

Return values

1 Number of bytes peeked


<0 Error when reading from file descriptor

See also

TCP Socket Status


close()
read()
PeekWithTimeout()
ReadWithTimeout()
write()

19.48.3.12 PeekWithTimeout()

int PeekWithTimeout (
int fd,
char ∗ c,
unsigned long timeout )
This function peeks at data from a file descriptor (fd), with a specified timeout value (as opposed to the peek function
which will block forever until at least one byte is available to be read). This function can be used to peek from stdio,
TCP sockets, or Serial ports.
The byte returned is not removed from the fd. The byte returned will be the first byte of data returned on the first
subsequent read().

NetBurner, Inc.
19.48 IOSYS - I/O System 357

Parameters

fd The file descriptor number


∗c A pointer to the read destination
timeout The number if time ticks to wait for at least 1 byte of data

Return values

0 Timeout, but the file descriptor is still valid


1 Number of bytes peeked
< 0 Error when reading from file descriptor

See also

TCP Socket Status


close()
peek()
read()
ReadWithTimeout()
write()

19.48.3.13 read()

int read (
int fd,
char ∗ buf,
int nbytes )
Read data from a file descriptor (fd). This function will block forever until at least one byte is available to be read (as
opposed to the ReadWithTimeout() function which reads data from a file descriptor with a specified time-out value).
This function can be used to read from stdio, TCP sockets, or Serial ports.

Parameters

fd The file descriptor number.


∗buf A pointer to the read destination.
nbytes Maximum number of bytes to read.

Return values

>0 Number of bytes read


<0 Error when reading from file descriptor

See also

TCP Socket Status


close()
peek()
PeekWithTimeout()
ReadWithTimeout()

NetBurner, Inc.
358 Module Documentation

ReadAllWithTimeout()
readall()
write()

19.48.3.14 readall()

int readall (
int fd,
char ∗ buf,
int nbytes )
Read the specified number of bytes from a file descriptor (fd). This function will block until either the requested
number of bytes have been read, or a file descriptor error occurs. It can be used to read from stdio, TCP sockets,
or Serial ports.

Parameters

fd File descriptor
∗buf Pointer to the read destination buffer
nbytes Number of bytes to read

Return values
0 Timeout
>0 The number of bytes read
-1 File descriptor error, such a TCP socket error

See also

close()
peek()
read()
PeekWithTimeout()
ReadWithTimeout()
ReadAllWithTimeout()
write()

19.48.3.15 ReadAllWithTimeout()

int ReadAllWithTimeout (
int fd,
char ∗ buf,
int nbytes,
unsigned long timeout )
Attempt to read the specified number of bytes from a file descriptor, or return with the number of bytes read if the
timeout value has expired.
This function can be used to read from stdio, TCP sockets, or Serial ports. This function will block until on of the
following conditions occurs:

• The requested number of bytes have been read.

• The timeout expires. The number of bytes read are returned, and buf contains the data.

NetBurner, Inc.
19.48 IOSYS - I/O System 359

• An error occurs on the file descripor, such as a TCP socet error.

Note

The return value must be checked to verify the number of bytes read and that a timeout or error did not occur.

Parameters

fd The file descriptor number


∗buf A pointer to the read destination
nbytes Number of bytes to read
timeout The number of timer ticks to wait for data

Returns

• <0: File descriptor error, such as an invalid TCP socket


• >=0 but less than nbytes: Timeout occurred, returns number of bytes read.
• nbytes: Successfully read the specified number of bytes within the timeout period

See also

close()
peek()
read()
PeekWithTimeout()
ReadWithTimeout()
readall()
write()

19.48.3.16 ReadWithTimeout()

int ReadWithTimeout (
int fd,
char ∗ buf,
int nbytes,
unsigned long timeout )
Read data from a file descriptor (fd), or return if at least one byte is not read within the specified timeout. Can be
used instead of the read() function, which will block forever until at least one byte is read. Can be used to read from
stdio, TCP sockets, or Serial ports.

Note

This function operates like the read function in that it reads all available bytes up to the maximum and returns.
The addition of a timeout does not cause the function to block until the specified maximum number of bytes
are available. As with read, the application must use the return value of the ReadWithTimeout function to
determine how many bytes were read, and call the function again if necessary.

Parameters

fd The file descriptor number.


∗buf A pointer to the read destination.
nbytes Maximum number of bytes to read.
timeout The number of timer ticks to wait for data.

NetBurner, Inc.
360 Module Documentation

Return values
0 Timeout
>0 The number of bytes read
-1 Invalid file descriptor, such as if a TCP connection is no longer valid

See also

close()
peek()
read()
PeekWithTimeout()
ReadWithTimeout()
ReadAllWithTimeout()
readall()
write()

19.48.3.17 RegisterFDCallBack()

void RegisterFDCallBack (
int fd,
FDCallBack ∗ fp,
void ∗ pData )
Register a callback function to receive notification when an FD state changes. Register a NULL fp to remove the
notification.

Parameters

fd The file descriptor number


∗fp The function pointer to call back
∗pData A void ∗ passed to the callback function, can be used for any purpose, such as object references

See also

FDChangeType
FDCCallBack

19.48.3.18 ReplaceStdio()

int ReplaceStdio (
int stdio_fd,
int new_fd )
Maps stdio to any file descriptor (fd).
If the file descriptor generates an error (such as a closed TCP connection), then stdio will be remapped to a negative
fd (this will cause stdio to generate errors). When this function is used to remap a stdio channel that has errored,
then the error will be cleared.

Parameters

stdio←- The stdio file descriptor to map to. Options are stdin (0), stdout (1), and stderr (2).
_fd
new_fd The file descriptor to replace stdio with. A value of 0 returns stdio to the default debug monitor based
traps.
NetBurner, Inc.
19.48 IOSYS - I/O System 361

Return values

0 If stdio had not been previously mapped


>0 The value of the fd for the previous stdio override

See also

ioctl()

19.48.3.19 select()

int select (
int nfds,
fd_set ∗ readfds,
fd_set ∗ writefds,
fd_set ∗ errorfds,
unsigned long timeout )
Wait for events to occur on one or more I/O resources associated with a set of file descriptors (fds), such as data
available to be read, a resource is available to write data, or an error has occurred.
The most common use for this function is to monitor multiple serial and/or TCP file descriptors at one time to read
incoming data. For example, an application could use a single RTOS task and a select() to process incoming data
on multiple TCP sockets at one time, instead of using multiple tasks or looping through each fd sequentially.
The file descriptors of interest are specified with file descriptor sets (fds) for read, write and error conditions. select()
will block until one of the fd conditions are true, or the specified timeout occurs (a value of 0 blocks forever). For
example, if the readfds is used for multiple TCP sockets, select() will return if data is available to read on one or
more of them. The application would then use macros such as FD_ISSET() to handle reading the data.

Note

A timeout value can be used to cause select() to return periodically for any type of processing an application
would like to do in the event no activity is occurring on the fd sets.

Parameters

nfds The number of file descriptors to examine (This parameter is currently ignored)
∗readfds Pointer to the fd_set to select for read events, or null if no read events are to be monitored. It is
modified on exit to reflect the read availability of the selected fds in the set.
∗writefds Pointer to the fd_set to select for write availability events, or null if no events are to be monitored. If
non-null, it is modified on exit to reflect the write availability of the selected fds in the set.
∗errorfds Pointer to the fd_set to select for error events, or null if no error events are to be monitored. It is
modified on exit to reflect the error state of the selected fds in the set.
timeout The number of system time ticks to wait before timing out if no events occurred in the selected fd
sets. Note: The TICKS_PER_SECOND multiplier should be used to specify the timeout in
seconds. For example, TICKS_PER_SECOND ∗ 5 to specify a timeout of 5 seconds.

Return values
0 Timeout occurred
>0 The number of fds in all of the non-null fd_sets

NetBurner, Inc.
362 Module Documentation

See also

FD_ZERO()
FD_CLR()
FD_SET()
FD_ISSET()

19.48.3.20 write()

int write (
int fd,
const char ∗ buf,
int nbytes )
Write data to the stream associated with a file descriptor (fd). Can be used to write data to stdio, a TCP socket, or
a Serial port.

Note

The write function will block until at least one byte is written, but may not write all the bytes requested. For
example, if you want to write 100 bytes, and there was only room in the buffer for 5, then the write() function
would return 5.

Parameters

fd File descriptor
∗buf Pointer to the buffer to write
nbytes Maximum number of bytes to write

Return values
0 Timeout
>0 The actual number of bytes written (Note: Can be less than the number of bytes requested)
<0 Error occurred, such as a TCP socket error

See also

close()
peek()
read()
PeekWithTimeout()
ReadWithTimeout()
writestring()
writeall()

19.48.3.21 writeall()

int writeall (
int fd,
const char ∗ buf,
int nbytes = 0 )
Write the specified number of bytes to a file descriptor. Will block until all bytes are sent, or a file descriptor error
occurs (such as a TCP socket error). Can be used to write data to stdio, a TCP socket, or a Serial port.

NetBurner, Inc.
19.48 IOSYS - I/O System 363

Parameters

fd File descriptor
∗buf Pointer to the buffer to write
nbytes Maximum number of bytes to write

Return values

>=0 The number of bytes written


<0 Error occurred

See also

close()
peek()
read()
PeekWithTimeout()
ReadWithTimeout()
write()
writestring()

19.48.3.22 writeavail()

int writeavail (
int fd )
Check the specified file descriptor to determine data can be written.

Parameters

fd File descriptor number

Return values
1 Data can be written
0 Data cannot be written, such as when an output buffer if full

See also

dataavail()
charavail()
haserror()

19.48.3.23 writestring()

int writestring (
int fd,
const char ∗ str )
Write a null terminated ascii string to the stream associated with a file descriptor (fd). Can be used to write data to
stdio, a TCP socket, or a Serial port.

NetBurner, Inc.
364 Module Documentation

Parameters

fd File descriptor
∗str Pointer to the null terminated string to write

Return values
0 Timeout occurred
>0 The number of bytes written (Note: Can be less than the number of bytes requested)
<0 Error occurred, such as a TCP socket error

See also

close()
peek()
read()
PeekWithTimeout()
ReadWithTimeout()
write()
writeall()

19.48.3.24 ZeroWaitSelect()

int ZeroWaitSelect (
int nfds,
fd_set ∗ readfds,
fd_set ∗ writefds,
fd_set ∗ errorfds )
Returns whether events have occurred on one or more I/O resources associated with a set of file descriptors (fds),
and returns immediately.

Parameters

nfds The number of file descriptors to examine. Note: This parameter is currently ignored.
∗readfds A pointer to the fd_set to select for read events. Note: This parameter can be NULL. It is modified
on exit to reflect the read availability of the selected fds in the set.
∗writefds A pointer to the fd_set to select for write availability events. Note: This parameter can be NULL. It
is modified on exit to reflect the write availability of the selected fds in the set.
∗errorfds A pointer to the fd_set to select for error events. Note: This parameter can be NULL. It is modified
on exit to reflect the error state of the selected fds in the set.

Return values

0 If there is no valid fds


>0 The number of fds in all of the non null fd_sets

See also

select()
FD_ZERO()

NetBurner, Inc.
19.49 IPADDR4 Class 365

FD_CLR()
FD_SET()
FD_ISSET()

19.49 IPADDR4 Class


Classes
• class IPADDR4
Used to store and manipulate IPv4 addresses in dual stack mode.

Typedefs
• typedef IPADDR6 IPADDR
IPADDR Object Type.

19.49.1 Detailed Description


The IPADDR C++ objects were created to provide a portable and easy implementation to support IPv4 and IPv6 IP
addresses. There are 3 types of IPADDR objects:

• IPADDR4: Used exclusively for IPv4 addresses

• IPADDR: Used for either an IPv6 or IPv4 address

• IPADDR: The typedef IPADDR is defines a type IPADDR. Its purpose is to provide clarity that an IPADDR
object can be used for both IPv4 and IPv6 addresses. Any functions called with a parameter of type IPADDR
will automatically execute the correct IPv4 or IPv6 underling function.

19.49.2 Typedef Documentation

19.49.2.1 IPADDR

typedef IPADDR6 IPADDR


IPADDR Object Type.
The IPADDR C++ objects were created to provide a portable and easy implementation to support IPv4 and IPv6 IP
addresses. There are 3 types of IPADDR objects:

• IPADDR4: Used exclusively for IPv4 addresses

• IPADDR: Used for either an IPv6 or IPv4 address

• IPADDR: The typedef IPADDR is defines a type IPADDR. Its purpose is to provide clarity that an IPADDR
object can be used for both IPv4 and IPv6 addresses. Any functions called with a parameter of type IPADDR
will automatically execute the correct IPv4 or IPv6 underling function.

19.50 IPADDR6 Class


Classes
• class IPADDR6
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.

NetBurner, Inc.
366 Module Documentation

19.50.1 Detailed Description


The IPADDR C++ objects were created to provide a portable and easy implementation to support IPv4 and IPv6 IP
addresses. There are 3 types of IPADDR objects:

• IPADDR4: Used exclusively for IPv4 addresses

• IPADDR6: Used for either an IPv6 or IPv4 address

• IPADDR: The typedef IPADDR is defines a type IPADDR6. Its purpose is to provide clarity that an IPADDR
object can be used for both IPv4 and IPv6 addresses. Any functions called with a parameter of type IPADDR
will automatically execute the correct IPv4 or IPv6 underling function.

19.51 Initialization - System Initialization Functions


Functions
• void init ()
System initialization. Normally called at the beginning of all applications.
• void StartHttp (uint16_t port=80)
Start the HTTP web server.
• void StartHttps (uint16_t ssl_port=443, uint16_t http_port=80)
Start the HTTPS secure web server.
• bool WaitForActiveNetwork (uint32_t ticks_to_wait=120 ∗TICKS_PER_SECOND, int interface=-1)
Wait for an active network connection on at least one interface.
• void EnableSystemDiagnostics ()
Turn on the diagnostic reports from the config page.
• void EnableSecureConfigServer (bool bSec_Only)
Enable the minimal http config server to operate over TLS.

19.51.1 Detailed Description


19.51.2 Function Documentation

19.51.2.1 EnableSecureConfigServer()

void EnableSecureConfigServer (
bool bSec_Only )
Enable the minimal http config server to operate over TLS.
Due to the nature of the server operating on a non-standard HTTP port, a client (such as a webbrowser) cannot infer
whether to utilize TLS unless explicitly told to do so. Therefore, the secure configuration server has two modes it
can operate in: a less secure, more compliant manner that allows both plaintext and TLS secured transactions and
a HSTS (Http Strict Transport Security) mode that will only respond to plaintext requests with a redirect indicating
the TLS requirement.

Parameters

bSec_Only Whether the SecureConfigServer should disallow non-secure requests

19.51.2.2 EnableSystemDiagnostics()

void EnableSystemDiagnostics ( )
Turn on the diagnostic reports from the config page.

NetBurner, Inc.
19.51 Initialization - System Initialization Functions 367

This should be used under development. It production it has no performance impact, but could leak possibly
sensitive information.

19.51.2.3 init()

void init ( )
System initialization. Normally called at the beginning of all applications.
Initialize the system including the following:

• Enable interrupt driven stdio

• Read the configuration record and set parameters accordingly. If the configuration speficies DHCP, start the
DHCP Client. All interfaces will be checked.

• Initialize the network stack

• Start the configuration server for both web and serial

• Assign the UserMain() task priority to MAIN_PRIO

• Enable the Task Monitor diagnostic tool

• Initialize the GDB stub if in debug mode

19.51.2.4 StartHttp()

void StartHttp (
uint16_t port = 80 )
Start the HTTP web server.
If no parameters are specified it will listen on port 80, and enable the configuration mirror feature so an application
can create its own custom configuration web page.

Parameters

port Listen port, defaults to port 80

See also

StartHttps(), StopHttp()

19.51.2.5 StartHttps()

void StartHttps (
uint16_t ssl_port = 443,
uint16_t http_port = 80 )
Start the HTTPS secure web server.
If no parameters are specified the web server will listen on ports 443 and 80, and enable the configuration mirror
feature so an application can create its own custom configuration web page. If no user key is installed the default
system key will be used.

Parameters

ssl_port Secure listen port, defaults to port 443


http_port Non-secure listen port, defaults to port 80

NetBurner, Inc.
368 Module Documentation

See also

StartHttp(), StopHttp()

If no parameters are specified, the web server will listen on ports 443 and 80, and enable the configuration mirror
feature so an application can create its own custom configuration web page. If no user certificate/key is installed,
the default system key will be used.
Default parameter values defined in init.h

Parameters

ssl_port Secure listen port, defaults to port 443


http_port Non-secure listen port, defaults to port 80

See also

StartHttp(), StopHttp()

19.51.2.6 WaitForActiveNetwork()

bool WaitForActiveNetwork (
uint32_t ticks_to_wait = 120 ∗TICKS_PER_SECOND,
int interface = -1 )
Wait for an active network connection on at least one interface.
If DHCP is enabled it will wait for a lease. If static IP parameters are configured it will wait for link.

Parameters

ticks_to_wait Number of system time ticks to wait. Default is 120 seconds.


interface Interface number to check. Default is -1, which checks all interfaces.

19.52 Interval Timer


Functions
• int IntervalOSSem (OS_SEM ∗p_toSem, int num_per_sec, int timer=FIRST_UNUSED_TIMER)
Posts to a semaphore at the requested interval.
• int IntervalOSFlag (OS_FLAGS ∗p_toFlag, uint32_t flag_value, int num_per_sec, int timer=FIRST_←-
UNUSED_TIMER)
Sets a flag at requested interval.
• int IntervalInterruptCallback (void(∗p_toCallbackFunc)(), int num_per_sec, int timer=FIRST_UNUSED_←-
TIMER)
Calls a function at requested interval. Note that the callback function is called from within the timer's interrupt handler
so you should treat your callback function as an interrupt.
• void IntervalStop (int timer_number)
Stops an existing Interval Timer and frees the resource.

19.52.1 Detailed Description


The Interval Timer is used to create a periodic interrupt (IRQ) that can trigger the following:

• Call an Interrupt Service Routine (ISR). An example of this is located in \nburn\examples

• Post an OS semaphore

NetBurner, Inc.
19.52 Interval Timer 369

• Post an OS flag

Example: Create an interval timer that posts 20 times per second


OS_SEM timerSem;
timerSem.Init();
int timerNumer = IntervalOSSem(&timerSem, 20);
if(timerNumer < 0)
{
iprintf("Error %d\r\n", timerNumer);
break;
}
When you have no further use for the interval timer, call IntervalStop() so that the hardware timer is released.

See also

High Resolution Delay Timer


Stopwatch Timer
OSTimeDly()

19.52.2 Function Documentation

19.52.2.1 IntervalInterruptCallback()

int IntervalInterruptCallback (
void(∗)() p_toCallbackFunc,
int num_per_sec,
int timer = FIRST_UNUSED_TIMER )
Calls a function at requested interval. Note that the callback function is called from within the timer's interrupt
handler so you should treat your callback function as an interrupt.

Parameters

p_toCallbackFunc Pointer to the callback function


num_per_sec Number of posts per second, minimum is 20 posts per second.
timer Optional parameter, timer number of -1 for first unused timer

Returns

The timer number, -1 if no timer is available, or -2 if num_per_sec is invalid.

19.52.2.2 IntervalOSFlag()

int IntervalOSFlag (
OS_FLAGS ∗ p_toFlag,
uint32_t flag_value,
int num_per_sec,
int timer = FIRST_UNUSED_TIMER )
Sets a flag at requested interval.

Parameters
p_toFlag Pointer to the semaphore
flag_value OS Flag value to set
num_per_sec Number of posts per second, minimum is 20 posts per second.
timer Optional parameter, timer number of -1 for first unused timer

NetBurner, Inc.
370 Module Documentation

Returns

The timer number, -1 if no timer is available, or -2 if num_per_sec is invalid.

19.52.2.3 IntervalOSSem()

int IntervalOSSem (
OS_SEM ∗ p_toSem,
int num_per_sec,
int timer = FIRST_UNUSED_TIMER )
Posts to a semaphore at the requested interval.

Parameters

p_toSem Pointer to the semaphore


num_per_sec Number of posts per second, minimum is 20 posts per second
timer Optional parameter, timer number of -1 for first unused timer

Returns

The timer number, -1 if no timer is available, or -2 if num_per_sec is invalid.

19.52.2.4 IntervalStop()

void IntervalStop (
int timer_number )
Stops an existing Interval Timer and frees the resource.

Parameters

timer_number Number of the timer to stop.

19.53 JSON Lexer


Modules
• Primitive Types

Classes
• struct JsonAllocString
A list of large strings that are created with malloc.
• class JsonRef
Represents a positional reference (pointer) of a location inside a ParsedJsonDataSet object

• class ParsedJsonDataSet
A class to create, read, and modify a JSON object.

Typedefs
• typedef void() CharOutputFn(const char ∗chars, int len, void ∗blob)
Helper function typedef for print functions.

NetBurner, Inc.
19.54 JsonRef and ParsedJsonDataSet Valid 371

19.53.1 Detailed Description


The NetBurner JSON Lexer

19.53.2 Typedef Documentation

19.53.2.1 CharOutputFn

typedef void() CharOutputFn(const char ∗chars, int len, void ∗blob)


Helper function typedef for print functions.

Parameters
chars The characters to print.
len The length of the characters to print.
blob A pointer to where they should be printed.

19.54 JsonRef and ParsedJsonDataSet Valid


Returns NBString object.

Functions
• bool JsonRef::IsNumber ()
Check for a JSON number element.
• bool JsonRef::IsObject ()
Check for a JSON object element.
• bool JsonRef::IsString ()
Check for a JSON string element.
• bool JsonRef::IsBool ()
Check for a JSON boolean element.
• bool JsonRef::IsNull ()
Check for a JSON null element.
• bool JsonRef::IsArray ()
Check for a JSON array element.
• bool JsonRef::Valid () const
Check for a valid JSON position.

19.54.1 Detailed Description


Returns NBString object.

19.54.2 Function Documentation

19.54.2.1 IsArray()

bool JsonRef::IsArray ( ) [inline]


Check for a JSON array element.
Returns

True if parsed JSON element is an array, otherwise false.

NetBurner, Inc.
372 Module Documentation

19.54.2.2 IsBool()

bool JsonRef::IsBool ( ) [inline]


Check for a JSON boolean element.
Returns

True if parsed JSON element is an boolean, otherwise false.

19.54.2.3 IsNull()

bool JsonRef::IsNull ( ) [inline]


Check for a JSON null element.
Returns

True if parsed JSON element is a null, otherwise false.

19.54.2.4 IsNumber()

bool JsonRef::IsNumber ( ) [inline]


Check for a JSON number element.
Returns

True if parsed JSON element is an number, otherwise false.

19.54.2.5 IsObject()

bool JsonRef::IsObject ( ) [inline]


Check for a JSON object element.

Returns

True if parsed JSON element is an object, otherwise false.

19.54.2.6 IsString()

bool JsonRef::IsString ( ) [inline]


Check for a JSON string element.

Returns

True if parsed JSON element is an string, otherwise false. A string can be of type char ∗, or a NBString object.

19.54.2.7 Valid()

bool JsonRef::Valid ( ) const [inline]


Check for a valid JSON position.

Returns

True if a JSON element exists, otherwise false.

NetBurner, Inc.
19.55 JsonRef and ParsedJsonDataSet types and operators 373

19.55 JsonRef and ParsedJsonDataSet types and operators


Functions
• JsonRef::operator bool () const
Operator to return a JSON element of type boolean.
• JsonRef::operator float () const
Returns boolean.
• JsonRef::operator double () const
Returns floating point.
• JsonRef::operator uint8_t () const
Returns double float.
• JsonRef::operator int () const
Returns uint8_t.
• JsonRef::operator uint16_t () const
Returns int.
• JsonRef::operator uint32_t () const
Returns uint16_t.
• JsonRef::operator int8_t () const
Returns uint32_t.
• JsonRef::operator int16_t () const
Returns int8_t.
• JsonRef::operator int32_t () const
Returns int16_t.
• JsonRef::operator time_t () const
Returns int32_t.
• JsonRef::operator const char ∗ () const
Returns time_t.
• JsonRef::operator NBString () const
Returns const char ∗.

19.55.1 Detailed Description


19.55.2 Function Documentation

19.55.2.1 operator bool()

JsonRef::operator bool ( ) const [inline]


Operator to return a JSON element of type boolean.
Returns

Boolean value

19.55.2.2 operator const char ∗()

JsonRef::operator const char ∗ ( ) const [inline]


Returns time_t.
Operator to return a JSON element of type const char ∗
Returns

const char ∗ value

NetBurner, Inc.
374 Module Documentation

19.55.2.3 operator double()

JsonRef::operator double ( ) const [inline]


Returns floating point.
Operator to return a JSON element of type double
Returns

double value

19.55.2.4 operator float()

JsonRef::operator float ( ) const [inline]


Returns boolean.
Operator to return a JSON element of type float
Returns

float value

19.55.2.5 operator int()

JsonRef::operator int ( ) const [inline]


Returns uint8_t.
Operator to return a JSON element of type int
Returns

integer value

19.55.2.6 operator int16_t()

JsonRef::operator int16_t ( ) const [inline]


Returns int8_t.
Operator to return a JSON element of type int16_t
Returns

int16_t value

19.55.2.7 operator int32_t()

JsonRef::operator int32_t ( ) const [inline]


Returns int16_t.
Operator to return a JSON element of type int32_t
Returns

int32_t value

19.55.2.8 operator int8_t()

JsonRef::operator int8_t ( ) const [inline]


Returns uint32_t.
Operator to return a JSON element of type int8_t
Returns

int8_t value

NetBurner, Inc.
19.56 MIME Content Types 375

19.55.2.9 operator NBString()

JsonRef::operator NBString ( ) const [inline]


Returns const char ∗.
Operator to return a JSON element of type NBString

Returns

NBString object

19.55.2.10 operator time_t()

JsonRef::operator time_t ( ) const [inline]


Returns int32_t.
Operator to return a JSON element of type time_t

Returns

time_t value

19.55.2.11 operator uint16_t()

JsonRef::operator uint16_t ( ) const [inline]


Returns int.
Operator to return a JSON element of type uint16_t

Returns

uint16_t value

19.55.2.12 operator uint32_t()

JsonRef::operator uint32_t ( ) const [inline]


Returns uint16_t.
Operator to return a JSON element of type uint32_t

Returns

uint32_t value

19.55.2.13 operator uint8_t()

JsonRef::operator uint8_t ( ) const [inline]


Returns double float.
Operator to return a JSON element of type uint8_t

Returns

uint8_t value

19.56 MIME Content Types

19.57 MOD5441x and NANO54415


NetBurner I2C API for MOD5441x and NANO54415.

NetBurner, Inc.
376 Module Documentation

Modules
• Multichannel I2C Macros
I2C Macros.
• Multichannel I2C Return Values
Function return values.

Functions
• void MultiChannel_I2CInit (int moduleNum=DEFAULT_I2C_MODULE, uint8_t slave_Addr=0x08, uint8_t fre-
qdiv=0x3C)
Initialize the I2C peripheral module.
• uint8_t MultiChannel_I2CSendBuf (int moduleNum, uint8_t addr, puint8_t buf, int num, bool stop=true)
Send a buffer of bytes to an I2C device.
• uint8_t MultiChannel_I2CReadBuf (int moduleNum, uint8_t addr, puint8_t buf, int num, bool stop=true)
Read a number of bytes from an I2C device and store in the specified buffer.
• void I2CMultiChannelResetPeripheral (int moduleNum)
Reset the specified I2C peripheral module.
• uint8_t MultiChannel_I2CRestart (int moduleNum, uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_←-
wait=I2C_RX_TX_TIMEOUT)
Restart communication with a I2C device.
• uint8_t MultiChannel_I2CStart (int moduleNum, uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_←-
wait=I2C_START_TIMEOUT)
Send an I2C start to an I2C device to begin communication.
• uint8_t MultiChannel_I2CStop (int moduleNum=DEFAULT_I2C_MODULE, uint32_t ticks_to_wait=I2C_RX←-
_TX_TIMEOUT)
Issue an I2C stop terminate communication with an I2C device and release the bus.
• uint8_t MultiChannel_I2CSend (int moduleNum, uint8_t val, uint32_t ticks_to_wait=I2C_RX_TX_TIMEOUT)
Send a single byte on the I2C bus.
• uint8_t MultiChannel_I2CRead (int moduleNum, puint8_t val, uint32_t ticks_to_wait=I2C_RX_TX_TIMEOUT)
Read a single byte from the I2C bus.

19.57.1 Detailed Description


NetBurner I2C API for MOD5441x and NANO54415.
The platforms have multiple I2C interfaces called "modules". The available I2C modules available on a particular
platform are determined by the connector configuration of that platform. Available I2C module numbers are defined
below. Since the processor pins are multiplexed with many other functions, the modules chosen are not sequential.
The default module number is 0.
I2C MODULE NUMBERS BY PLATFORM:

• MOD5441x: 0, 1, 2, 4, 5.

• NANO54415: 0, 1, 4, 5.

The most common I2C functions used are listed below. They automatically handle I2C start and stop conditions, as
well as checking for I2C bus errors and recovery:

• MultiChannel_I2CInit ()

• MultiChannel_I2CSendBuf ()

• MultiChannel_I2CReadBuf ()

• I2CMultiChannelResetPeripheral()

19.57.2 Function Documentation

NetBurner, Inc.
19.57 MOD5441x and NANO54415 377

19.57.2.1 I2CMultiChannelResetPeripheral()

void I2CMultiChannelResetPeripheral (
int moduleNum )
Reset the specified I2C peripheral module.
Clears all interrupts, I2C conditions, and releases the bus.

Parameters

moduleNum I2C peripheral module number.

19.57.2.2 MultiChannel_I2CInit()

void MultiChannel_I2CInit (
int moduleNum = DEFAULT_I2C_MODULE,
uint8_t slave_Addr = 0x08,
uint8_t freqdiv = 0x3C )
Initialize the I2C peripheral module.
The frequency is based on the internal bus clock of the processor. The formula is: Freq = (250MHZ (sys clock)/2) /
freqdiv to give max baud rate of the master mode I2C bus clock. Values for freqdiv are found in the i2fdr section of
the NXP MCF5441x User Manual.

Parameters

moduleNum I2C peripheral module number.


slave_Addr I2C address of the module. If not specified, default value is 0x08.
freqdiv I2C module frequency divider. If not specified, default value is 0x3C, which is the maximum
value of 100KHz.

19.57.2.3 MultiChannel_I2CRead()

uint8_t MultiChannel_I2CRead (
int moduleNum,
puint8_t val,
uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT )
Read a single byte from the I2C bus.
Reads a single byte from the I2C bus and stores it in val. A start or restart must have been previously issued to
become the bus master, and a stop must be issued to release the bus when you are finished reading the desired
number of bytes.
Does not handle no Ack of last byte, which needs to have a I2C_SET_NO_ACK called before the last read.

Parameters

moduleNum I2C peripheral module number.


val Location to store the byte read.
ticks_to_wait Amount of time to wait for a start transmission to complete, specified as system time ticks. The
TICKS_PER_SECOND macro can be used with a multiplier or dividor. Includes the time to
receive an ack from the I2C device. If not specified, the default time of I2C_RX_TX_TIMEOUT
will be used.

Returns

The state of the I2C bus: I2C Return Values

NetBurner, Inc.
378 Module Documentation

19.57.2.4 MultiChannel_I2CReadBuf()

uint8_t MultiChannel_I2CReadBuf (
int moduleNum,
uint8_t addr,
puint8_t buf,
int num,
bool stop = true )
Read a number of bytes from an I2C device and store in the specified buffer.
Sends an I2C start, reads the specified number of bytes into buf, and and finishes with our without an I2C stop
(default is stop). If a stop is not issued, for purposes such as a restart, a stop must be called manually.

Parameters

moduleNum I2C peripheral module number.


addr I2C device address.
buf The buffer to store the data.
num The number of bytes to read.
stop Send a stop signal at the end of the transaction. If not specified, the default value is true.

Returns

The state of the I2C bus: I2C Return Values

19.57.2.5 MultiChannel_I2CRestart()

uint8_t MultiChannel_I2CRestart (
int moduleNum,
uint8_t addr,
bool Read_Not_Write,
uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT )
Restart communication with a I2C device.
Restarts communication with an I2C device after completion of a read or write command in which a stop was not
issued. Enables communicate on bus again without giving up control as the I2C bus master.

Parameters

moduleNum I2C peripheral module number.


addr I2C device address.
Read_Not_Write Specifies the next bus operation: true = read, false = write.
ticks_to_wait Amount of time to wait for a start transmission to complete, specified as system time ticks.
The TICKS_PER_SECOND macro can be used with a multiplier or dividor. Includes the
time to receive an ack from the I2C device. If not specified, the default time of
I2C_RX_TX_TIMEOUT will be used.

Returns

The state of the I2C bus: I2C Return Values

19.57.2.6 MultiChannel_I2CSend()

uint8_t MultiChannel_I2CSend (
int moduleNum,

NetBurner, Inc.
19.57 MOD5441x and NANO54415 379

uint8_t val,
uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT )
Send a single byte on the I2C bus.
Sends a single byte on the I2C bus. A start or restart must have been previously issued to become the bus master,
and a stop must be issued to release the bus when you are finished with writing the desired number of bytes.

Parameters

moduleNum I2C peripheral module number.


val Byte to send
ticks_to_wait Amount of time to wait for a start transmission to complete, specified as system time ticks. The
TICKS_PER_SECOND macro can be used with a multiplier or dividor. Includes the time to
receive an ack from the I2C device. If not specified, the default time of I2C_RX_TX_TIMEOUT
will be used.

Returns

The state of the I2C bus: I2C Return Values

19.57.2.7 MultiChannel_I2CSendBuf()

uint8_t MultiChannel_I2CSendBuf (
int moduleNum,
uint8_t addr,
puint8_t buf,
int num,
bool stop = true )
Send a buffer of bytes to an I2C device.
Sends an I2C start, the bytes in buf, and and finishes with our without an I2C stop (default is stop). If a stop is not
issued, for purposes such as a restart, a stop must be called manually.

Parameters

moduleNum I2C peripheral module number.


addr I2C device address.
buf The buffer to send.
num The number of bytes in the buffer.
stop Send a stop signal at the end of transmission. If not specified, the default value is true.

Returns

The state of the I2C bus: I2C Return Values

19.57.2.8 MultiChannel_I2CStart()

uint8_t MultiChannel_I2CStart (
int moduleNum,
uint8_t addr,
bool Read_Not_Write,
uint32_t ticks_to_wait = I2C_START_TIMEOUT )
Send an I2C start to an I2C device to begin communication.
Restarts communication with an I2C device after completion of a read or write command in which a stop was not
issued. Enables communicate on bus again without giving up control as the I2C bus master.

NetBurner, Inc.
380 Module Documentation

Parameters

moduleNum I2C peripheral module number.


addr I2C device address.
Read_Not_Write Specifies the next bus operation: true = read, false = write.
ticks_to_wait Amount of time to wait for a start transmission to complete, specified as system time ticks.
The TICKS_PER_SECOND macro can be used with a multiplier or dividor. Includes the
time to receive an ack from the I2C device. If not specified, the default time of
I2C_START_TIMEOUT will be used.

Returns

The state of the I2C bus: I2C Return Values

19.57.2.9 MultiChannel_I2CStop()

uint8_t MultiChannel_I2CStop (
int moduleNum = DEFAULT_I2C_MODULE,
uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT )
Issue an I2C stop terminate communication with an I2C device and release the bus.
Terminate any communication and release the I2C bus.

Parameters

moduleNum I2C peripheral module number.


ticks_to_wait Amount of time to wait for a start transmission to complete, specified as system time ticks. The
TICKS_PER_SECOND macro can be used with a multiplier or dividor. Includes the time to
receive an ack from the I2C device. If not specified, the default time of I2C_RX_TX_TIMEOUT
will be used.

Returns

The state of the I2C bus: I2C Return Values

19.58 MODM7AE70
Classes
• class mcanMODM7AE70::mcan_module
MCAN Module Class.
• class mcanMODM7AE70::mcan_config
MCAN configuration structure.
• class mcanMODM7AE70::CanRxMessage
Class to hold received CAN messages.

Macros
• #define CAN_DATA_STORE_SIZE (512)
Receive OS_FIFO Buffer Size.

Variables
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_FIFO_0_NUM = 32
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_FIFO_1_NUM = 0

NetBurner, Inc.
19.58 MODM7AE70 381

• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_BUFFER_NUM = 0


• const uint32_t mcanMODM7AE70::CONF_MCAN_TX_BUFFER_NUM = 8
• const uint32_t mcanMODM7AE70::CONF_MCAN_TX_FIFO_QUEUE_NUM = 0
• const uint32_t mcanMODM7AE70::CONF_MCAN_TX_EVENT_FIFO = 8
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_STANDARD_ID_FILTER_NUM = 32
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM = 32

19.58.1 Detailed Description


Control Area Network (MCAN) Low Level Driver for MODM7AE70

19.58.2 Variable Documentation

19.58.2.1 CONF_MCAN_RX_BUFFER_NUM

const uint32_t mcanMODM7AE70::CONF_MCAN_RX_BUFFER_NUM = 0


Range: 1..64

19.58.2.2 CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM

const uint32_t mcanMODM7AE70::CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM = 32


Range: 1..64

19.58.2.3 CONF_MCAN_RX_FIFO_0_NUM

const uint32_t mcanMODM7AE70::CONF_MCAN_RX_FIFO_0_NUM = 32


Range: 1..64

19.58.2.4 CONF_MCAN_RX_FIFO_1_NUM

const uint32_t mcanMODM7AE70::CONF_MCAN_RX_FIFO_1_NUM = 0


Range: 1..64

19.58.2.5 CONF_MCAN_RX_STANDARD_ID_FILTER_NUM

const uint32_t mcanMODM7AE70::CONF_MCAN_RX_STANDARD_ID_FILTER_NUM = 32


Range: 1..128

19.58.2.6 CONF_MCAN_TX_BUFFER_NUM

const uint32_t mcanMODM7AE70::CONF_MCAN_TX_BUFFER_NUM = 8


Range: 1..16

19.58.2.7 CONF_MCAN_TX_EVENT_FIFO

const uint32_t mcanMODM7AE70::CONF_MCAN_TX_EVENT_FIFO = 8


Range: 1..32

19.58.2.8 CONF_MCAN_TX_FIFO_QUEUE_NUM

const uint32_t mcanMODM7AE70::CONF_MCAN_TX_FIFO_QUEUE_NUM = 0


Range: 1..16

NetBurner, Inc.
382 Module Documentation

19.59 MODM7AE70 (SAME70)


Classes
• class WireIntf
Wire Interface Class for I2C.
• class I2C
I2C Peripheral Class.
• class I2CDevice
I2C Device Class (recommended)

19.59.1 Detailed Description


The I2C peripheral interfaces can be controlled three ways:

• The I2C Device class (recommended): I2CDevice

• The I2C Class, which offers additional low level control I2C

• The Wire Interface Class, which offers a Two Wire Interface API WireIntf

19.60 Multicast
Functions
• void RegisterMulticastFifo4 (IPADDR4 group, uint16_t dest_port, OS_FIFO ∗pfifo, int interface=0)
Register to join a Multicast group.
• void UnregisterMulticastFifo4 (IPADDR4 group, uint16_t destination_port, int interface=0)
Unregister from a Multicast group.
• void RegisterMulticastFifo6 (IPADDR group, uint16_t dest_port, OS_FIFO ∗pfifo, int interface=0)
Register to join a Multicast group.
• void UnregisterMulticastFifo6 (IPADDR group, uint16_t destination_port, int interface=0)
Unregister from a Multicast group.

19.60.1 Detailed Description


The NetBurner Multicast API

19.60.2 Function Documentation

19.60.2.1 RegisterMulticastFifo4()

void RegisterMulticastFifo4 (
IPADDR4 group,
uint16_t dest_port,
OS_FIFO ∗ pfifo,
int interface = 0 )
Register to join a Multicast group.
Calling RegisterMulticastFifo() in dual stack mode will automatically select the correct IPv4/IPv6 function.
IGMP Multicast is a method for distributing UDP packets within a group of hosts and servers. The NetBurner
Multicast functions extend the NetBurner UDP interface. Instead of RegisterUDPFifo(), the RegisterMulticastFifo()
function is used to listen for Multicast UDP packets. To transmit Multicast packets, use the UDP Send function with
a multicast IP address.

NetBurner, Inc.
19.60 Multicast 383

Parameters

group The IP address of the group to join


dest_port The port number of the group to join
pfifo Pointer to the FIFO to store incoming packets
interface Optional interface number. If not specified or 0, the first system interface will be used.

See also

UnregisterMulticastFifo4()

19.60.2.2 RegisterMulticastFifo6()

void RegisterMulticastFifo6 (
IPADDR group,
uint16_t dest_port,
OS_FIFO ∗ pfifo,
int interface = 0 )
Register to join a Multicast group.
Calling RegisterMulticastFifo() in dual stack mode will automatically select the correct IPv4/IPv6 function.
IGMP Multicast is a method for distributing UDP packets within a group of hosts and servers. The NetBurner
Multicast functions extend the NetBurner UDP interface. Instead of RegisterUDPFifo(), the RegisterMulticastFifo()
function is used to listen for Multicast UDP packets. To transmit Multicast packets, use the UDP Send function with
a multicast IP address.

Parameters

group The IP address of the group to join


dest_port The port number of the group to join
pfifo Pointer to the FIFO to store incoming packets
interface Optional interface number. If not specified or 0, the first system interface will be used.

See also

UnregisterMulticastFifo4()

19.60.2.3 UnregisterMulticastFifo4()

void UnregisterMulticastFifo4 (
IPADDR4 group,
uint16_t destination_port,
int interface = 0 )
Unregister from a Multicast group.
Calling UnregisterMulticastFifo() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters

group The IP address of the group to leave


destination_port The port number of the group to leave
interface Specifies the interface number, the default is 0

NetBurner, Inc.
384 Module Documentation

See also

RegisterMulticastFifo4()

19.60.2.4 UnregisterMulticastFifo6()

void UnregisterMulticastFifo6 (
IPADDR group,
uint16_t destination_port,
int interface = 0 )
Unregister from a Multicast group.
Calling UnregisterMulticastFifo() in dual stack mode will automatically select the correct IPv4/IPv6 function.

Parameters

group The IP address of the group to leave


destination_port The port number of the group to leave
interface Optional interface number. If not specified or 0, the first system interface will be used.

See also

RegisterMulticastFifo4()

19.61 Multichannel I2C Macros


I2C Macros.

Macros
• #define I2C_SR_BUSY (((0x20 & I2C_SR) == 0x20))
Bus is busy (bit 5 of I2SR)
• #define I2C_CR_SLAVE (((0x20 & I2C_CR) == 0x00))
Bus set as slave (bit 5 of I2CR)
• #define I2C_SR_ARB_LOST (((0x10 & I2C_SR) == 0x10))
Bus arbitration was lost (bit 4 of I2SR)
• #define I2C_SR_ADRES_AS_SLAVE (((0x40 & I2C_SR) == 0x40))
Addressed as a slave (bit 6 of I2SR)
• #define I2C_SR_SLAVE_TX (((0x04 & I2C_SR) == 0x04))
State of read/write bit of the received address command (bit 2 of I2SR)
• #define I2C_CR_TX (((0x10 & I2C_CR) == 0x10))
Configured for transmit (bit 4 of I2CR)
• #define I2C_SR_RX_ACK (((0x01 & I2C_SR) == 0x00))
Received a RX ACK after last transmit (bit 0 of I2SR)
• #define I2C_CR_RX_ACK (((0x08 & I2C_CR) == 0x00))
Configured to RX Ack.
• #define I2C_SET_NO_ACK ((I2C_CR |= 0x08))
Configure I2C module not to send a RX ACK (bit 3 of I2CR)
• #define I2C_SET_ACK ((I2C_CR &= 0xF7))
Configure I2C module to send a RX ACK (bit 3 of I2CR)
• #define I2C_SET_TX ((I2C_CR |= 0x10))
Configure I2C module to be in TX mode (bit 4 of I2CR)
• #define I2C_SET_RX ((I2C_CR &= 0xEF))

NetBurner, Inc.
19.62 Multichannel I2C Return Values 385

Configure I2C module to be in RX mode (bit 4 of I2CR)


• #define I2C_SET_REPEAT_START ((I2C_CR |= 0x04))
Configure I2C to send a repeated start signal.
• #define I2C_CLR_ARB_LOST ((I2C_SR &= 0xEF))
Clear Arbitration lost error condition.

19.61.1 Detailed Description


I2C Macros.

19.62 Multichannel I2C Return Values


Function return values.

Macros
• #define I2C_OK (0)
Last instruction terminated correctly.
• #define I2C_NEXT_WRITE_OK (1)
I2C bus is OK for a write.
• #define I2C_NEXT_READ_OK (2)
I2C bus is OK for a read.
• #define I2C_MASTER_OK (3)
I2C finished transmission but still owns but (need to stop or restart)
• #define I2C_TIMEOUT (4)
A timeout occurred while trying communicate on I2C bus.
• #define I2C_BUS_NOT_AVAIL (5)
A timeout occurred while trying gain I2C bus control.
• #define I2C_NOT_READY (6)
A read or write was attempted before I2C ready or during a slave transmission.
• #define I2C_LOST_ARB (7)
Lost arbitration during start.
• #define I2C_LOST_ARB_ADD (8)
Lost arbitration and then winner addressed our slave address.
• #define I2C_NO_LINK_RX_ACK (9)
We are in Master TX mode and received no ACK from slave device, possibly during start.

19.62.1 Detailed Description


Function return values.

19.63 Multihome and VLAN


Functions
• int AddVlanInterface (IPADDR4 addr, IPADDR4 mask, IPADDR4 gateway, uint16_t vlan_tag, const char
∗ParentName)
Add a VLAN interface with a Parent Name.
• int AddVlanInterface (IPADDR4 addr, IPADDR4 mask, IPADDR4 gateway, uint16_t vlan_tag, InterfaceBlock
&parent)
Add a VLAN interface with a Partent InterfaceBlock reference.
• int AddVlanInterface (IPADDR4 addr, IPADDR4 mask, IPADDR4 gateway, uint16_t vlan_tag, int root_if=0)

NetBurner, Inc.
386 Module Documentation

Add a VLAN interface with an interface number.


• int AddInterface (IPADDR4 addr, IPADDR4 mask, IPADDR4 gateway, const char ∗ParentName)
Add an interface with a Parent Name.
• int AddInterface (IPADDR4 addr, IPADDR4 mask, IPADDR4 gateway, InterfaceBlock &parent)
Add an interface with a Partent InterfaceBlock reference.
• int AddInterface (IPADDR4 addr, IPADDR4 mask, IPADDR4 gateway, int root_if=0)
Add an interface with an interface number.

19.63.1 Detailed Description


Create Multihome and VLAN Interfaces

19.63.2 Function Documentation

19.63.2.1 AddInterface() [1/3]

int AddInterface (
IPADDR4 addr,
IPADDR4 mask,
IPADDR4 gateway,
const char ∗ ParentName ) [inline]
Add an interface with a Parent Name.

Parameters

addr IP address of new interface


mask IP mask
gateway IP gateway
ParentName Name of parent physical interface, such as Ethernet0.

returns Interface number of newly created interface

19.63.2.2 AddInterface() [2/3]

int AddInterface (
IPADDR4 addr,
IPADDR4 mask,
IPADDR4 gateway,
int root_if = 0 ) [inline]
Add an interface with an interface number.

Parameters

addr IP address of new interface


mask IP mask
gateway IP gateway
root_if Optional root physical interface number. If not specified the default is 0, for Ethernt 0.

returns Interface number of newly created interface

19.63.2.3 AddInterface() [3/3]

int AddInterface (
IPADDR4 addr,
IPADDR4 mask,

NetBurner, Inc.
19.63 Multihome and VLAN 387

IPADDR4 gateway,
InterfaceBlock & parent ) [inline]
Add an interface with a Partent InterfaceBlock reference.

Parameters

addr IP address of new interface


mask IP mask
gateway IP gateway
parent Reference to parent physical interface of type InterfaceBlock.

returns Interface number of newly created interface

19.63.2.4 AddVlanInterface() [1/3]

int AddVlanInterface (
IPADDR4 addr,
IPADDR4 mask,
IPADDR4 gateway,
uint16_t vlan_tag,
const char ∗ ParentName )
Add a VLAN interface with a Parent Name.

Parameters

addr IP address of new interface


mask IP mask
gateway IP gateway
vlan_tag VLAN tag/id for interface
ParentName Name of parent physical interface, such as Ethernet0.

returns Interface number of newly created VLAN interface

19.63.2.5 AddVlanInterface() [2/3]

int AddVlanInterface (
IPADDR4 addr,
IPADDR4 mask,
IPADDR4 gateway,
uint16_t vlan_tag,
int root_if = 0 )
Add a VLAN interface with an interface number.

Parameters

addr IP address of new interface


mask IP mask
gateway IP gateway
vlan_tag VLAN tag/id for interface
root_if Optional root physical interface number. If not specified the default is 0 for Ethernet 0.

returns Interface number of newly created VLAN interface

19.63.2.6 AddVlanInterface() [3/3]

int AddVlanInterface (
IPADDR4 addr,

NetBurner, Inc.
388 Module Documentation

IPADDR4 mask,
IPADDR4 gateway,
uint16_t vlan_tag,
InterfaceBlock & parent )
Add a VLAN interface with a Partent InterfaceBlock reference.

Parameters

addr IP address of new interface


mask IP mask
gateway IP gateway
vlan_tag VLAN tag/id for interface
parent Reference to parent physical interface of type InterfaceBlock

returns Interface number of newly created VLAN interface

19.64 NBRTOS Error Codes


Macros
• #define OS_NO_ERR 0
No Error.
• #define OS_TIMEOUT 10
Timeout.
• #define OS_MBOX_FULL 20
Mailbox Full.

19.64.1 Detailed Description


NBRTOS function return codes

19.65 NBRTOS Real Time Operating System


Modules
• NBRTOS Error Codes
• NBRTOS Task Status

Classes
• class TickTimeout
TickTimeouts are used to facilitate sequential function calls with timeout parameters that need to index from an initial
start time and be proof against TimeTick rollover.
• class OS_SEM
Semaphores are used to control access to shared resource critical section, or to communicate between tasks.
• class OS_MBOX
Mailboxes are used to communicate between tasks.
• class OS_Q
A queue functions as a fixed size FIFO for communication between tasks.
• class OS_FIFO
A FIFO is used to pass structures from one task to another. Note: Structures to be passed must have an unused
(void ∗) pointer as its first element. This precludes passing C++ objects with virtual member functions.
• class OS_CRIT

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 389

An OS_CRIT object is used to establish critical sections of code that can only be run by one task at a time. Tasks
that try to claim a critical section which is currently claimed by another task will stop and wait for that task to leave the
critical section before continuing execution.
• class OS_FLAGS
An OS_FLAGS object is used to set, clear, and pend on a set of flags that is held and maintained by the object.
• class OSLockObj
A simple wrapper class that helps use OS locks effectively.
• class OSCriticalSectionObj
A simple wrapper class that helps utilize OS_CRIT objects more effectively.
• class OSLockAndCritObj
A simple wrapper class that helps utilize OS_CRIT objects to lock tasks and enter critical sections more effectively.
• class OSSpinCrit
A simple wrapper class that uses an OS_CRIT object to try and claim a critical section, and will continue the attempt
until it is able to do so.
• class NBRtosInitObj
A simple class to derive from if you are creating taks that are constructed at global scope and need to do RTOS
initalization. The vistural function Notify will be called once the RTOS internals are setup so you can create a task,
allocate buffers,etc.. if you need to do network I/O then you this will not be sufficent as you will need register to be
notifyied when link is active on the interface.

Macros
• #define WAIT_FOREVER 0
• #define OSSimpleTaskCreatewName(x, p, n)
This macro functions the same as OSTaskCreatewName().
• #define OSSimpleTaskCreateLambda(p, n, f) LambdaTask2(p,n,[ ]( void ∗ pv)f,__COUNTER__)
This macro functions the same as OSTaskCreatewName().

Functions
• void OSFlagSet (OS_FLAGS ∗flags, uint32_t bits_to_set)
This function sets the corresponding bits asserted in bits_to_set of an OS_FLAGS object pointed to by ∗flags.
• void OSFlagClear (OS_FLAGS ∗flags, uint32_t bits_to_clr)
This function clears the bits asserted in bits_to_clr of an OS_FLAGS object pointed to by ∗flags..
• uint8_t OSFlagPendAny (OS_FLAGS ∗flags, uint32_t bit_mask, uint16_t timeout)
This function waits a number of time ticks specified by timeout until any of the flags indicated by bit_mask are
set.
• uint8_t OSFlagPendAnyNoWait (OS_FLAGS ∗flags, uint32_t bit_mask)
This function immediately checks to see if any of the flag bits indicated by bit_mask are set; it does not wait.
• uint8_t OSFlagPendAll (OS_FLAGS ∗flags, uint32_t bit_mask, uint16_t timeout)
This function waits a number of time ticks specified by timeout until all the flags indicated by bit_mask are set.
• uint8_t OSFlagPendAllNoWait (OS_FLAGS ∗flags, uint32_t bit_mask)
This function immediately checks to see if all the flag bits indicated by bit_mask are set; it does not wait.
• uint32_t OSFlagState (OS_FLAGS ∗flags)
This function returns the current values of the flags stored in the OS_FLAGS object structure.
• uint8_t OSTaskCreatewName (void(∗task)(void ∗dptr), void ∗data, void ∗pstktop, void ∗pstkbot, uint8_t prio,
const char ∗name)
This function creates a new task.
• void OSTimeWaitUntil (uint32_t to_when)
Delay the task until the specified value of the system timer tick. The number of system ticks per second is defined
by the constant: TICKS_PER_SECOND in <nburn_install>/nbrtos/include/constants.h. The
default value is 20 ticks per second.
• void OSTimeDly (uint32_t to_count)

NetBurner, Inc.
390 Module Documentation

Delay the task until the specified value of the system timer ticks. The number of system ticks per second is defined
by the constant: TICKS_PER_SECOND in <nburn_install>/nbrtos/include/constants.h. The
default value is 20 ticks per second.
• void OSTaskDelete (void)
This function deletes the current calling task, but we do not recommend the use of this function because it can cause
memory leaks.
• uint8_t OSChangePrio (uint32_t newp)
This function changes the priority of the calling task.
• void OSLock (void)
Calling the OSLock function will prevent the OS from changing tasks.
• void OSUnlock (void)
This function unlocks the OS.
• uint8_t OSSemInit (OS_SEM ∗psem, long value)
Initializes a semaphore.
• uint8_t OSSemPost (OS_SEM ∗psem)
Increases the value of the semaphore by one. Note: If any higher priority tasks were waiting on the semaphore - it
releases them.
• uint8_t OSSemPend (OS_SEM ∗psem, uint16_t timeout)
Wait timeout ticks for the value of the semaphore to be non zero. Note: A timeout value of 0 (zero) waits forever.
• uint8_t OSSemPendNoWait (OS_SEM ∗psem)
OSSemPendNoWait() is identical to OSSemPend(), but it does not wait.
• uint8_t OSMboxInit (OS_MBOX ∗pmbox, void ∗msg)
This function is used to initialize an OS_MBOX structure.
• uint8_t OSMboxPost (OS_MBOX ∗pmbox, void ∗msg)
This function posts a message to a Mail box.
• void ∗ OSMboxPend (OS_MBOX ∗pmbox, uint16_t timeout, uint8_t ∗err)
Wait timeout ticks for some other task to post to the Mailbox.
• void ∗ OSMboxPendNoWait (OS_MBOX ∗pmbox, uint8_t ∗err)
OSMboxPendNoWait() is identical to OSMboxPend(), but it does not wait.
• uint8_t OSQInit (OS_Q ∗pq, void ∗∗start, uint8_t size)
A queue functions as a fixed size FIFO for communication between tasks. This function initializes an OS_Q structure.
• uint8_t OSQPost (OS_Q ∗pq, void ∗msg)
This function posts a message to a Queue.
• uint8_t OSQPostFirst (OS_Q ∗pq, void ∗msg)
This function posts a message like OSQPost, but posts the message at the head of the queue.
• uint8_t OSQPostUnique (OS_Q ∗pq, void ∗msg)
This function posts a message like OSQPost, but only if the message isn't already in the queue The function performs
a brute force check to see if the message is already in the queue.
• uint8_t OSQPostUniqueFirst (OS_Q ∗pq, void ∗msg)
This function posts a message like OSQPostFirst, but only if the message isn't already in the queue The function
performs a brute force check to see if the message is already in the queue.
• void ∗ OSQPend (OS_Q ∗pq, uint16_t timeout, uint8_t ∗err)
Wait timeout ticks for another task to post to the queue.
• void ∗ OSQPendNoWait (OS_Q ∗pq, uint8_t ∗err)
OSQPendNoWait() is identical to the OSQPend() function but it does not wait.
• uint8_t OSFifoInit (OS_FIFO ∗pFifo)
Initialize a FIFO, which is used to pass structures from one task to another.
• uint8_t OSFifoPost (OS_FIFO ∗pFifo, OS_FIFO_EL ∗pToPost)
This function posts to a FIFO.
• uint8_t OSFifoPostFirst (OS_FIFO ∗pFifo, OS_FIFO_EL ∗pToPost)
This function is identical to OSFifoPost(), but the element posted is put at the beginning of the FIFO list.
• OS_FIFO_EL ∗ OSFifoPend (OS_FIFO ∗pFifo, uint16_t timeout)

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 391

This function pends on a FIFO.


• OS_FIFO_EL ∗ OSFifoPendNoWait (OS_FIFO ∗pFifo)
This function is identical to the OSFifoPen() function, but it does not wait.
• uint8_t OSCritInit (OS_CRIT ∗pCrit)
This function initializes the critical section.
• uint8_t OSCritEnter (OS_CRIT ∗pCrit, uint16_t timeout)
This function tries to enter or claim the critical section.
• uint8_t OSCritEnterNoWait (OS_CRIT ∗pCrit)
This function tries to enter or claim the critical section.
• uint8_t OSCritLeave (OS_CRIT ∗pCrit)
This function releases the critical section.
• void OSChangeTaskDly (uint16_t task_prio, uint32_t to_count)
This function allows the User to modify the timeout delay for a task that is waiting.
• void OSDumpTCBStacks (void)
This function dumps information about the UCOS stacks and tasks to stdout. This function is useful for debugging.
Note: This function is only valid when NBRTOS_STACKCHECK is defined.
• void OSDumpTasks (void)
This function dumps the state and call stack for every task to stdout. This function is useful for debugging. Note: This
function is only valid when NBRTOS_STACKCHECK is defined.
• void ShowTaskList (void)
This functions dumps the current RTOS task states to stdio.

19.65.1 Detailed Description


The NetBurner Real-Time OS

19.65.2 Macro Definition Documentation

19.65.2.1 OSSimpleTaskCreateLambda

#define OSSimpleTaskCreateLambda(
p,
n,
f ) LambdaTask2(p,n,[ ]( void ∗ pv)f,__COUNTER__)
This macro functions the same as OSTaskCreatewName().

Parameters

p The priority for this new task (OS_MAX_PRIOS is lowest priority and 1 is highest). Look in
<nburn_install>/nbrtos/include/constants.h to see which priorities are used by the OS.
n The optional name of the task.
f The function to run as the task....

Example: OSSimpleTaskCreateLambda(MAIN_PRIO-1,"MyLambdaTask",{ Code to run goes here });


See also

OSTaskCreatewName()
OSSimpleTaskCreatewName()

19.65.2.2 OSSimpleTaskCreatewName

#define OSSimpleTaskCreatewName(

NetBurner, Inc.
392 Module Documentation

x,
p,
n )
Value:
{ \
static uint32_t func_##x_Stk[USER_TASK_STK_SIZE] __attribute__((aligned(4))); \
OSTaskCreatewName(x, NULL, (void *)&func_##x_Stk[USER_TASK_STK_SIZE], (void *)func_##x_Stk, p, n); \
}
This macro functions the same as OSTaskCreatewName().

Parameters

x The address of the function where this task will start executing.
p The priority for this new task (OS_MAX_PRIOS is lowest priority and 1 is highest). Look in
<nburn_install>/nbrtos/include/constants.h to see which priorities are used by the OS.
n The optional name of the task.

See also

OSTaskCreatewName()
OSTaskDelete()
OSChangePrio()

19.65.2.3 WAIT_FOREVER

#define WAIT_FOREVER 0
Can be used for parameters that have a 0 value

19.65.3 Function Documentation

19.65.3.1 OSChangePrio()

uint8_t OSChangePrio (
uint32_t newp )
This function changes the priority of the calling task.
Note: The uC/OS can only have one task at each priority level. Task priorities can range from 1 to OS_MAX←-
_PRIOS, where OS_MAX_PRIOS is the lowest priority level and 1 is highest priority level. Priorities 1-4 and the
NetBurner system priority levels are reserved as described below. The recommended user priority levels for your
application are in the range of 46 to OS_MAX_PRIOS-1. This avoids any conflicts with network communications.
System priorities are defined in <nburn_install>/nbrtos/include/constants.h for all platforms.

Parameters

newp The new priority of the calling task

Return values

OS_NO_ERR If successful
OS_PRIO_EXIST If the requested priority already exists

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 393

See also

NBRTOS Error Codes


OSTaskCreatewName()

19.65.3.2 OSChangeTaskDly()

void OSChangeTaskDly (
uint16_t task_prio,
uint32_t to_count ) [inline]
This function allows the User to modify the timeout delay for a task that is waiting.
Warning: Use of this function is discouraged.

Parameters

task_prio The task's priority


to_count The new number of ticks to delay

See also

OSTimeDly() - Delay or Sleep for a fixed interval

19.65.3.3 OSCritEnter()

uint8_t OSCritEnter (
OS_CRIT ∗ pCrit,
uint16_t timeout ) [inline]
This function tries to enter or claim the critical section.

Parameters

pCrit A pointer to the critical section.


timeout How many time ticks do we want to wait for this critical section? Note: A timeout of 0 (zero) waits
forever.

Returns

OS_NO_ERR - If we were successful in claiming the critical section, or if our task owns it
OS_TIMEOUT - If we were unable to claim the section

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_CRIT for current usage.

19.65.3.4 OSCritEnterNoWait()

uint8_t OSCritEnterNoWait (
OS_CRIT ∗ pCrit ) [inline]
This function tries to enter or claim the critical section.

NetBurner, Inc.
394 Module Documentation

Parameters

pCrit A pointer to the critical section.

Returns

OS_NO_ERR - If we were successful in claiming the critical section, or if our task owns it
OS_TIMEOUT - If we were unable to claim the section

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_CRIT for current usage.

19.65.3.5 OSCritInit()

uint8_t OSCritInit (
OS_CRIT ∗ pCrit ) [inline]
This function initializes the critical section.

Parameters

pCrit A pointer to the critical section.

Returns

OS_NO_ERR - If successful

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_CRIT for current usage.

19.65.3.6 OSCritLeave()

uint8_t OSCritLeave (
OS_CRIT ∗ pCrit ) [inline]
This function releases the critical section.

Parameters

pCrit A pointer to the critical section we want to leave/release.

Returns

OS_NO_ERR - If we were successful in releasing the critical section


OS_CRIT_ERR - If we are trying to release a critical section that we do not own

See also

NBRTOS Error Codes


Deprecated This function is now deprecated. Please see OS_CRIT for current usage.

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 395

19.65.3.7 OSDumpTasks()

void OSDumpTasks (
void )
This function dumps the state and call stack for every task to stdout. This function is useful for debugging. Note:
This function is only valid when NBRTOS_STACKCHECK is defined.

See also

OSDumpTCBStacks()

19.65.3.8 OSDumpTCBStacks()

void OSDumpTCBStacks (
void )
This function dumps information about the UCOS stacks and tasks to stdout. This function is useful for debugging.
Note: This function is only valid when NBRTOS_STACKCHECK is defined.

See also

OSDumpTasks()

19.65.3.9 OSFifoInit()

uint8_t OSFifoInit (
OS_FIFO ∗ pFifo ) [inline]
Initialize a FIFO, which is used to pass structures from one task to another.

Parameters

pFifo A pointer to an OS_FIFO structure.

Returns

OS_NO_ERR - If successful
OS_CRIT_ERR - If pFifo is NULL

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_FIFO for current usage.

19.65.3.10 OSFifoPend()

OS_FIFO_EL ∗ OSFifoPend (
OS_FIFO ∗ pFifo,
uint16_t timeout ) [inline]
This function pends on a FIFO.

Parameters

pFifo A pointer to an OS_FIFO structure.


timeout The number of ticks to wait on the FIFO.

NetBurner, Inc.
396 Module Documentation

Returns

A pointer to the posted structure if successful, or NULL if it timed out.

Deprecated This function is now deprecated. Please see OS_FIFO for current usage.

19.65.3.11 OSFifoPendNoWait()

OS_FIFO_EL ∗ OSFifoPendNoWait (
OS_FIFO ∗ pFifo ) [inline]
This function is identical to the OSFifoPen() function, but it does not wait.

Parameters

pFifo A pointer to an OS_FIFO structure.

Returns

A pointer to the posted structure if successful, or NULL if it timed out.

19.65.3.12 OSFifoPost()

uint8_t OSFifoPost (
OS_FIFO ∗ pFifo,
OS_FIFO_EL ∗ pToPost ) [inline]
This function posts to a FIFO.

Parameters

pFifo A pointer to an OS_FIFO structure.


pToPost A pointer to the user's structure cast as an OS_FIFO_EL to be posted to the FIFO.

Returns

OS_NO_ERR - If successful

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_FIFO for current usage.

19.65.3.13 OSFifoPostFirst()

uint8_t OSFifoPostFirst (
OS_FIFO ∗ pFifo,
OS_FIFO_EL ∗ pToPost ) [inline]
This function is identical to OSFifoPost(), but the element posted is put at the beginning of the FIFO list.

Parameters

pFifo A pointer to an OS_FIFO structure.


pToPost A pointer to the user's structure cast as an OS_FIFO_EL to be posted to the FIFO.

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 397

Returns

OS_NO_ERR - If successful

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_FIFO for current usage.

19.65.3.14 OSFlagClear()

void OSFlagClear (
OS_FLAGS ∗ flags,
uint32_t bits_to_clr ) [inline]
This function clears the bits asserted in bits_to_clr of an OS_FLAGS object pointed to by ∗flags..

Parameters

flags A pointer to the OS_FLAGS object to be configured.


bits_to_clr A bit or set of bits to be cleared.

Deprecated This function is now deprecated. Please see OS_FLAGS for current usage.

19.65.3.15 OSFlagPendAll()

uint8_t OSFlagPendAll (
OS_FLAGS ∗ flags,
uint32_t bit_mask,
uint16_t timeout ) [inline]
This function waits a number of time ticks specified by timeout until all the flags indicated by bit_mask are set.

Parameters

flags A pointer to the OS_FLAGS object with the desired flag bits.
bit_mask A bit or set of bits to wait on.
timeout Number of time ticks to wait for all specified flag bits to be set.

Return values

OS_NO_ERR If the flags condition is satisfied


OS_TIMEOUT If the timeout expired

Deprecated This function is now deprecated. Please see OS_FLAGS for current usage.

19.65.3.16 OSFlagPendAllNoWait()

uint8_t OSFlagPendAllNoWait (
OS_FLAGS ∗ flags,
uint32_t bit_mask ) [inline]

NetBurner, Inc.
398 Module Documentation

This function immediately checks to see if all the flag bits indicated by bit_mask are set; it does not wait.

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 399

Parameters

flags A pointer to the OS_FLAGS object with the desired flag bits.
bit_mask A bit or set of bits to wait on.

Return values

OS_NO_ERR All flags indicated by bit_mask are set.


OS_TIMEOUT Not all of the flags indicated by bit_mask are set.

Deprecated This function is now deprecated. Please see OS_FLAGS for current usage.

19.65.3.17 OSFlagPendAny()

uint8_t OSFlagPendAny (
OS_FLAGS ∗ flags,
uint32_t bit_mask,
uint16_t timeout ) [inline]
This function waits a number of time ticks specified by timeout until any of the flags indicated by bit_mask are
set.

Parameters

flags A pointer to the OS_FLAGS object with the desired flag bits.
bit_mask A bit or set of bits to wait on.
timeout Number of time ticks to wait for all specified flag bits to be set.

Return values

OS_NO_ERR At least one of the flag bits are set before timeout expires.
OS_TIMEOUT None of the flag bits are set before timeout expires.

Deprecated This function is now deprecated. Please see OS_FLAGS for current usage.

19.65.3.18 OSFlagPendAnyNoWait()

uint8_t OSFlagPendAnyNoWait (
OS_FLAGS ∗ flags,
uint32_t bit_mask ) [inline]
This function immediately checks to see if any of the flag bits indicated by bit_mask are set; it does not wait.

Parameters

flags A pointer to the OS_FLAGS object with the desired flag bits.
bit_mask A bit or set of bits to wait on.

Return values

OS_NO_ERR At least one of the flags indicated by bit_mask are set.

NetBurner, Inc.
400 Module Documentation

Return values

OS_TIMEOUT None of the flags indicated by bit_mask are set.

Deprecated This function is now deprecated. Please see OS_FLAGS for current usage.

19.65.3.19 OSFlagSet()

void OSFlagSet (
OS_FLAGS ∗ flags,
uint32_t bits_to_set ) [inline]
This function sets the corresponding bits asserted in bits_to_set of an OS_FLAGS object pointed to by
∗flags.

Parameters

flags A pointer to the OS_FLAGS object to be configured.


bits_to_set A bit or set of bits to be set.

Deprecated This function is now deprecated. Please see OS_FLAGS for current usage.

19.65.3.20 OSFlagState()

uint32_t OSFlagState (
OS_FLAGS ∗ flags ) [inline]
This function returns the current values of the flags stored in the OS_FLAGS object structure.

Parameters

flags A pointer to the OS_FLAGS object whose flag states are to be returned.

Returns

The state of the OS_FLAGS object.

Deprecated This function is now deprecated. Please see OS_FLAGS for current usage.

19.65.3.21 OSLock()

void OSLock (
void )
Calling the OSLock function will prevent the OS from changing tasks.
This is used to protect critical variables that must be accessed one task at a time. Use the OSUnlock function to
release your lock. Important: You must call OSUnlock() once for each call to OSLock.
Warning: Do not keep a task locked for a long period of time, or the performance of the network subsystem will
degrade, and eventually loose packets.
See also

OSUnlock()
OSLockObj()

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 401

19.65.3.22 OSMboxInit()

uint8_t OSMboxInit (
OS_MBOX ∗ pmbox,
void ∗ msg ) [inline]
This function is used to initialize an OS_MBOX structure.

Parameters
pmbox A pointer to the OS_MBOX structure to initialize.
msg The initial mail box message (NULL) for none.

Returns

OS_NO_ERR - If successful
OS_CRIT_ERR - If pmbox is NULL

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_MBOX for current usage.

19.65.3.23 OSMboxPend()

void ∗ OSMboxPend (
OS_MBOX ∗ pmbox,
uint16_t timeout,
uint8_t ∗ err ) [inline]
Wait timeout ticks for some other task to post to the Mailbox.

Parameters
pmbox A pointer to the OS_MBOX structure.
timeout The number of time ticks to wait.
out err A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).

Returns

The posted message if successful, or NULL if timed out.

Deprecated This function is now deprecated. Please see OS_MBOX for current usage.

19.65.3.24 OSMboxPendNoWait()

void ∗ OSMboxPendNoWait (
OS_MBOX ∗ pmbox,
uint8_t ∗ err ) [inline]
OSMboxPendNoWait() is identical to OSMboxPend(), but it does not wait.

Parameters
pmbox A pointer to the OS_MBOX structure.
err A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).

NetBurner, Inc.
402 Module Documentation

Returns

The posted message if successful, or NULL if it fails.

Deprecated This function is now deprecated. Please see OS_MBOX for current usage.

19.65.3.25 OSMboxPost()

uint8_t OSMboxPost (
OS_MBOX ∗ pmbox,
void ∗ msg ) [inline]
This function posts a message to a Mail box.

Parameters
pmbox A pointer to the OS_MBOX structure.
msg The message to post.

Returns

OS_NO_ERR - If successful
OS_MBOX_FULL - If the mailbox is full

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_MBOX for current usage.

19.65.3.26 OSQInit()

uint8_t OSQInit (
OS_Q ∗ pq,
void ∗∗ start,
uint8_t size ) [inline]
A queue functions as a fixed size FIFO for communication between tasks. This function initializes an OS_Q structure.

Parameters
pq A pointer to the OS_Q structure.
start A pointer to an array of (void ∗) pointers to hold queue messages.
size The number of pointers in the Q data storage area.

Returns

OS_NO_ERR - If Successful
OS_CRIT_ERR - If start or pq is NULL

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_Q for current usage.

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 403

19.65.3.27 OSQPend()

void ∗ OSQPend (
OS_Q ∗ pq,
uint16_t timeout,
uint8_t ∗ err ) [inline]
Wait timeout ticks for another task to post to the queue.

Parameters
pq A pointer to the OS_Q structure.
timeout The number of ticks to wait.
out err A variable to receive the result code, either OS_NO_ERR on receiving a posted message,
or OS_TIMEOUT on a timeout.

Returns

The posted message, or NULL if the function failed

Deprecated This function is now deprecated. Please see OS_Q for current usage.

19.65.3.28 OSQPendNoWait()

void ∗ OSQPendNoWait (
OS_Q ∗ pq,
uint8_t ∗ err ) [inline]
OSQPendNoWait() is identical to the OSQPend() function but it does not wait.

Parameters
pq A pointer to the OS_Q structure.
out err A variable to receive the result code, either OS_NO_ERR on receiving a posted message, or
OS_TIMEOUT on a timeout.

Returns

The posted message, or NULL if the function failed

Deprecated This function is now deprecated. Please see OS_Q for current usage.

19.65.3.29 OSQPost()

uint8_t OSQPost (
OS_Q ∗ pq,
void ∗ msg ) [inline]
This function posts a message to a Queue.

Parameters
pq A pointer to the OS_Q structure.
msg The message to be posted to the queue.

NetBurner, Inc.
404 Module Documentation

Returns

OS_NO_ERR - If Successful
OS_Q_FULL - If the queue is full and has no more room

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_Q for current usage.

19.65.3.30 OSQPostFirst()

uint8_t OSQPostFirst (
OS_Q ∗ pq,
void ∗ msg ) [inline]
This function posts a message like OSQPost, but posts the message at the head of the queue.

Parameters
pq A pointer to the OS_Q structure.
msg The message to post at the head of the queue.

Returns

OS_NO_ERR - If Successful
OS_Q_FULL - If the queue is full and has no more room

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_Q for current usage.

19.65.3.31 OSQPostUnique()

uint8_t OSQPostUnique (
OS_Q ∗ pq,
void ∗ msg ) [inline]
This function posts a message like OSQPost, but only if the message isn't already in the queue The function
performs a brute force check to see if the message is already in the queue.

Parameters
pq A pointer to the OS_Q structure.
msg The message to post at the head of the queue.

Returns

OS_NO_ERR - If Successful
OS_Q_FULL - If the queue is full and has no more room
OS_Q_EXISTS - If the message already exists in the queue

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 405

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_Q for current usage.

19.65.3.32 OSQPostUniqueFirst()

uint8_t OSQPostUniqueFirst (
OS_Q ∗ pq,
void ∗ msg ) [inline]
This function posts a message like OSQPostFirst, but only if the message isn't already in the queue The function
performs a brute force check to see if the message is already in the queue.

Parameters
pq A pointer to the OS_Q structure.
msg The message to post at the head of the queue.

Returns

OS_NO_ERR - If Successful
OS_Q_FULL - If the queue is full and has no more room
OS_Q_EXISTS - If the message already exists in the queue

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_Q for current usage.

19.65.3.33 OSSemInit()

uint8_t OSSemInit (
OS_SEM ∗ psem,
long value ) [inline]
Initializes a semaphore.

Parameters
psem A pointer to the OS_SEM structure to initialize.
value The initial count value for the semaphore.

Returns

OS_NO_ERR - If successful
OS_SEM_ERR - If value is < 0 (zero), it cannot initialize
OS_CRIT_ERR - If psem is NULL

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_SEM for current usage.

NetBurner, Inc.
406 Module Documentation

19.65.3.34 OSSemPend()

uint8_t OSSemPend (
OS_SEM ∗ psem,
uint16_t timeout ) [inline]
Wait timeout ticks for the value of the semaphore to be non zero. Note: A timeout value of 0 (zero) waits forever.

Parameters
psem A pointer to the OS_SEM structure.
timeout The number of time ticks to wait

Returns

OS_NO_ERR - If successful
OS_TIMEOUT - If the function timed out or if the NoWait function failed

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_SEM for current usage.

19.65.3.35 OSSemPendNoWait()

uint8_t OSSemPendNoWait (
OS_SEM ∗ psem ) [inline]
OSSemPendNoWait() is identical to OSSemPend(), but it does not wait.

Parameters
psem A pointer to the OS_SEM structure

Returns

OS_NO_ERR - If successful
OS_TIMEOUT - If it fails

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_SEM for current usage.

19.65.3.36 OSSemPost()

uint8_t OSSemPost (
OS_SEM ∗ psem ) [inline]
Increases the value of the semaphore by one. Note: If any higher priority tasks were waiting on the semaphore - it
releases them.

Parameters
psem A pointer to the OS_SEM structure.

NetBurner, Inc.
19.65 NBRTOS Real Time Operating System 407

Returns

OS_NO_ERR - If successful
OS_SEM_OVF - If the value of the semaphore overflows

See also

NBRTOS Error Codes

Deprecated This function is now deprecated. Please see OS_SEM for current usage.

19.65.3.37 OSTaskCreatewName()

uint8_t OSTaskCreatewName (
void(∗)(void ∗dptr) task,
void ∗ data,
void ∗ pstktop,
void ∗ pstkbot,
uint8_t prio,
const char ∗ name )
This function creates a new task.
You must allocate storage for the stack that this new task will use and it must be 4 byte aligned. Task priori-
ties can range from 1 to OS_MAX_PRIOS, where OS_MAX_PRIOS is the lowest priority level and 1 is highest
priority level. The recommended user priority levels for your application are in the range of 46 to OS_MAX_PRIOS-
1. This avoids any conflicts with network communications. The maximum number of tasks your application can
run is defined by OS_MAX_TASKS. Both OS_MAX_PRIOS and OS_MAX_TASKS are defined in <nburn_←-
install>/nbrtos/include/constants.h.
Important:The uC/OS can only have one task at each priority.

Parameters

task The address of the function where this task will start executing.
data The data to pass to the task function.
pstktop The highest address of the stack space.
pstkbot The lowest address of the stack space.
prio The priority for this new task (OS_MAX_PRIOS is lowest priority and 1 is highest). Look in
<nburn_install>/nbrtos/include/constants.h to see which priorities are used by
the OS.
name The name of the task

Return values

OS_NO_ERR If successful
OS_PRIO_EXIST If the requested priority already exists

See also

OSTaskDelete()
OSChangePrio()
NBRTOS Error Codes

19.65.3.38 OSTaskDelete()

void OSTaskDelete (

NetBurner, Inc.
408 Module Documentation

void )
This function deletes the current calling task, but we do not recommend the use of this function because it can
cause memory leaks.
The preferred method for terminating a task is to set a flag or semaphore that the task is listening for. The flag can
then be set by an outside task, which enables the task to be deleted to free any resources and terminate gracefully
by simply returning.

See also

OSTaskCreatewName()
OSChangePrio()

19.65.3.39 OSTimeDly()

void OSTimeDly (
uint32_t to_count ) [inline]
Delay the task until the specified value of the system timer ticks. The number of system ticks per second is defined
by the constant: TICKS_PER_SECOND in <nburn_install>/nbrtos/include/constants.h. The
default value is 20 ticks per second.

Parameters

to_count The number of system ticks to delay.

See also

OSChangeTaskDly(), OSTimeWaitUntil()

19.65.3.40 OSTimeWaitUntil()

void OSTimeWaitUntil (
uint32_t systemTickValue )
Delay the task until the specified value of the system timer tick. The number of system ticks per second is defined
by the constant: TICKS_PER_SECOND in <nburn_install>/nbrtos/include/constants.h. The
default value is 20 ticks per second.

Parameters

systemTickValue The system time tick to wait for

uint32_t Now = TimeTick;


while(1)
{
Now += 60 * TICKS_PER_SECOND;
OSTimeWaitUntil(Now);
// Do whatever every 60 seconds, no mater how long this takes to run the interval will have a consistant
spacing
}

See also

OSChangeTaskDly(), OSTimeDly()

19.65.3.41 OSUnlock()

void OSUnlock (
void )

NetBurner, Inc.
19.66 NBRTOS Task Status 409

This function unlocks the OS.


Important: You must call OSUnlock() once for each call to OSLock().

See also

OSLock()
OSLockObj()

19.65.3.42 ShowTaskList()

void ShowTaskList (
void )
This functions dumps the current RTOS task states to stdio.
The output takes on multiple lines of the following format for each logged state:

at t= [T] [Message]

Followed by a tally of the number of task states logged since system start:

Total messages: [N]

[T] represents the number of ticks in hexadecimal since system start; [N] represents the number of task state
messages in decimal logged since system start; [Message] represents one of the output messages listed in the
below table.

Message Description
Wait for Semaphore Task is asleep and pending for semaphore
Wake from Semaphore Task gets a semaphore and wakes up
Task locked Task becomes locked
Task lock++ Task gets an added nested lock
Task lock- Task get a nested lock unlocked
Task unlocked Task becomes completely unlocked
Task priority changed The task's priority level is changed
Unknown flag [F] The flag value defining the task's state is undefined
Switched to Task [P] Task priority [P] (in decimal) gets control
Switched to Task [P] PC=[X] Task priority [P] gets control with the program counter containing
the address [X] (in hexadecimal) of the instruction being executed

Note: Usage of this function is valid only when defining NBRTOS_TASKLIST in debug mode. In order to enable
this macro definition, it must be uncommented in \Nburn\include\predef.h, followed by rebuilding the
system files to incorporate the modification. Attempting to load a compiled non-debug application image with the
macro defined will cause a trap error.

19.66 NBRTOS Task Status


Macros
• #define OS_STAT_RDY 0x00
Ready to run.
• #define OS_STAT_MBOX 0x01

NetBurner, Inc.
410 Module Documentation

Pending on mailbox.
• #define OS_STAT_SEM 0x02
Pending on semaphore.
• #define OS_STAT_Q 0x04
Pending on queue.
• #define OS_STAT_FIFO 0x08
Pending on FIFO.
• #define OS_STAT_CRIT 0x10
Pending on Critical Section.
• #define OS_STAT_DELAY 0x20
Reserved.
• #define OS_STAT_RES4 0x40
Reserved.
• #define OS_STAT_RES5 0x80
Reserved.

19.66.1 Detailed Description


The current state of running tasks.

19.67 NBString - NetBurner String Class


Classes
• class NBString
Lightweight alternative to C++ CString class.

19.67.1 Detailed Description


The NetBurner lightweight String Class alternative to Cstring.

19.68 NBUpdate Function Return Values


Macros
• #define NBUP_ERR_NO_ERR 0
No errors.
• #define NBUP_ERR_BAD_SOCK -1
File descriptor socket is invlaid.
• #define NBUP_ERR_TIMEOUT -2
Timeout.
• #define NBUP_ERR_TOO_LARGE -3
Application update record is too large.
• #define NBUP_ERR_WRONG_PLAT -4
Device platform name does not match.
• #define NBUP_ERR_BAD_PROG -5
Programming failed, invalid checksum.
• #define NBUP_ERR_BAD_AUTH -6
Application update record authentication failed.

NetBurner, Inc.
19.69 Onboard Certificate Generation 411

19.68.1 Detailed Description

19.69 Onboard Certificate Generation


Modules
• Certificate Generation Alternate Name Types
• Certificate Generation Key Types
• Function Return Codes

Classes
• struct AltNameEntry
The AltNameEntry struct holds all of the information required to add a single alternate name entry to a certificate
that's generated onboard the module.
• struct CertGenData
Used to store the information that is passed in when enabling onboard generated certificates, as well as the informa-
tion needed to determine when they need to be regenerated.

Functions
• CertGenReturnCode SSL_CreateNewSelfSignedCert (const char ∗common_name=nullptr, int yearsValid=1,
AltNameEntry altNames[ ]=nullptr, int altNameCnt=0)
Generates a new self-signed certificate that will be stored on the device.
• void EnableOnboardCertificateCreation (char ∗common_name=nullptr, int yearsValid=1, AltNameEntry alt←-
Names[ ]=nullptr, int altNameCnt=0, CertGenReturnCode(∗createCertFunc)(const char ∗, int, AltNameEntry[ ],
int)=SSL_CreateNewSelfSignedCert)
Enables the ability for the module to automatically generate self-signed certificates for use in SSL/TLS connections
when acting as the server.

19.69.1 Detailed Description


19.69.2 Function Documentation

19.69.2.1 EnableOnboardCertificateCreation()

void EnableOnboardCertificateCreation (
char ∗ common_name = nullptr,
int yearsValid = 1,
AltNameEntry altNames[ ] = nullptr,
int altNameCnt = 0,
CertGenReturnCode(∗)(const char ∗, int, AltNameEntry[ ], int) createCertFunc =
SSL_CreateNewSelfSignedCert )
Enables the ability for the module to automatically generate self-signed certificates for use in SSL/TLS connections
when acting as the server.
If a certificate is manually loaded on the module prior to the SSL server being intialized, that certificate will be use
and nothing will be generated. If a certificate had been previously generated and a new certificate is manually
loaded on the device, the newly loaded certificate will be used in place of the automatically generated one, though
the automatically generated one will still be availabe on the module.

Parameters

common_name The common_name used for the certificate. If nullptr is passed in, it defaults to the device
name. If the device name is empty, it defaults to the IP address.
yearsValid How long the certificate will be valid for. The default is 1 year.
altNames The formatted alternate names. Please see the example on proper usage.

NetBurner, Inc.
412 Module Documentation

Parameters

altNameCnt How many alternate names are being passed in.


createCertFunc Optional parameter to specify a custom create certificate function.

19.69.2.2 SSL_CreateNewSelfSignedCert()

CertGenReturnCode SSL_CreateNewSelfSignedCert (
const char ∗ common_name = nullptr,
int yearsValid = 1,
AltNameEntry altNames[ ] = nullptr,
int altNameCnt = 0 )
Generates a new self-signed certificate that will be stored on the device.
The common name and alternative names used are taken from the parameters passed in.
By default, the certificate is generated using ECC with SECP384R1. This can be changed to an RSA key by undefin-
ing ENABLE_ECCKEY_CREATE in <nndk_install>\libraries\crypto\platform\<module
name>\user_settings.h, and then rebuilding your application. To specify what curve or RSA key length is
used in certificate generation, define DEFAULT_KEY_TYPE as one of the values defined by SslKeyType_t.

Parameters

common_name A pointer to the buffer containing the common name to be used in the certificate
yearsValid How long the certificate will be valid for. The default is 1 year.
altNames An array of alternate name entries to add
altNameCnt The number of alternate names entries being added by altNames

Returns

CertGenReturnCode

19.70 POP3 - Post Office Protocol


Modules
• POP3 Return Codes

Functions
• int POPGetResultCode (int fd, uint32_t timeout)
Returns the result code of the previous POP3 operation.
• int POP3_InitializeSession (IPADDR server_address, uint16_t port, PCSTR UserName, PCSTR Password,
uint32_t timeout)
Create a connection to the POP3 server and log in.
• int POP3_CloseSession (int session)
Close a POP3 session.
• int POP3_StatCmd (int session, uint32_t ∗num_messages, uint32_t ∗total_bytes, uint32_t timeout)
Returns the status of the mailstore on the POP3 server.
• int POP3_ListCmd (int session, uint32_t message_number, uint32_t ∗total_bytes, uint32_t timeout)
Get the size of a message on the server.
• int POP3_DeleteCmd (int session, uint32_t message_number, uint32_t timeout)
Delete a pending message on the server.
• int POP3_RetrieveMessage (int session, uint32_t message_number, char ∗buffer, char ∗∗subject_ptr, char
∗∗body_ptr, int max_bufferlen, uint32_t timeout)

NetBurner, Inc.
19.70 POP3 - Post Office Protocol 413

Retrieve a message from the server.


• PCSTR GetPOPErrorString (int err)
Returns the error text for an error code.
• int SSL_POP3_InitializeSession (IPADDR server_address, uint16_t port, PCSTR UserName, PCSTR Pass←-
Word, uint32_t time_out)
Initialize Post Office Protocol Version 3 (POP3) on a SSL socket.

19.70.1 Detailed Description


19.70.2 Function Documentation

19.70.2.1 GetPOPErrorString()

PCSTR GetPOPErrorString (
int err )
Returns the error text for an error code.

Parameters
err Error number to decode

Returns

Pointer to a string containing the error code text

19.70.2.2 POP3_CloseSession()

int POP3_CloseSession (
int session )
Close a POP3 session.

Parameters

session The session number returned by POP3_InitializeSession()

Returns

POP3 Return Codes

19.70.2.3 POP3_DeleteCmd()

int POP3_DeleteCmd (
int session,
uint32_t message_number,
uint32_t timeout )
Delete a pending message on the server.
Note: the server will not actually delete the message until the session is closed.

Parameters

session The session number returned by POP3_InitializeSession().


message_number The message number to delete. The message number can be obtained by POP3_StatCmd().
timeout Timeout in system Time Ticks.

NetBurner, Inc.
414 Module Documentation

Returns

Return code POP3 Return Codes

19.70.2.4 POP3_InitializeSession()

int POP3_InitializeSession (
IPADDR server_address,
uint16_t port,
PCSTR UserName,
PCSTR Password,
uint32_t timeout )
Create a connection to the POP3 server and log in.

Parameters

server_address Server IP address


port Server port number
UserName Account username
Password Account password
timeout Timeout in system Time Ticks

Returns

The POP3 session number if greater than 0, otherwise error code POP3 Return Codes

See also

SSL_POP3_InitializeSession

19.70.2.5 POP3_ListCmd()

int POP3_ListCmd (
int session,
uint32_t message_number,
uint32_t ∗ total_bytes,
uint32_t timeout )
Get the size of a message on the server.

Parameters

session The session number returned by POP3_InitializeSession().


message_number The message number to query. The message number can be obtained by POP3_StatCmd().
total_bytes Pointer to the variable in which to store the total number of bytes of the pending message.
timeout Timeout in system Time Ticks.

Returns

Return code POP3 Return Codes

19.70.2.6 POP3_RetrieveMessage()

int POP3_RetrieveMessage (

NetBurner, Inc.
19.70 POP3 - Post Office Protocol 415

int session,
uint32_t message_number,
char ∗ buffer,
char ∗∗ subject_ptr,
char ∗∗ body_ptr,
int max_bufferlen,
uint32_t timeout )
Retrieve a message from the server.
The message is retrieved as a block of bytes including the header, subject, etc. The headers will appear first. Note
that the message is left on the server and will not be deleted until the POP3_DeleteCmd() function is called for the
message number.

Parameters

session The session number returned by POP3_InitializeSession().


message_number The message number to retrieve. The message number can be obtained by
POP3_StatCmd().
buffer Pointer to the buffer to store the entire message, including headers
subject_ptr If not NULL, a pointer to the start of the subject in the message buffer
body_ptr If not NULL, a pointer to the start of the body in the message buffer
max_bufferlen Maximum length of the buffer
timeout Timeout in system Time Ticks.

Returns

Return code POP3 Return Codes

19.70.2.7 POP3_StatCmd()

int POP3_StatCmd (
int session,
uint32_t ∗ num_messages,
uint32_t ∗ total_bytes,
uint32_t timeout )
Returns the status of the mailstore on the POP3 server.

Parameters

session The session number returned by POP3_InitializeSession()


num_messages Pointer to the variable in which to store the number of pending messages
total_bytes Pointer to the variable in which to store the total number of bytes of the pending messages
timeout Timeout in system Time Ticks

Returns

Return code POP3 Return Codes

19.70.2.8 POPGetResultCode()

int POPGetResultCode (
int fd,
uint32_t timeout )
Returns the result code of the previous POP3 operation.

NetBurner, Inc.
416 Module Documentation

Parameters

fd TCP socket file descriptor for the active session


timeout Timeout in system Time Ticks

Returns

POP3 Return Codes

19.70.2.9 SSL_POP3_InitializeSession()

int SSL_POP3_InitializeSession (
IPADDR server_address,
uint16_t port,
PCSTR UserName,
PCSTR PassWord,
uint32_t time_out )
Initialize Post Office Protocol Version 3 (POP3) on a SSL socket.
Note: Routine makes the connection to the POP server and logs in with the provided UserName and PassWord.
Session is release with POP3_CloseSession in pop3.h.
Post Office Protocol, Version 3 (POP3) is defined in RFC1939.

Parameters

server_address IP address of the server.


port Port to connect to the server.
UserName Account user name string.
PassWord Account password string.
time_out Number of ticks to wait.

Return values
>=0 The session handle
<0 Error code from POP3 Return Codes

See also

POP3_InitializeSession

19.71 POP3 Return Codes


Macros
• #define POP_OK (0)
No errors occurred.
• #define POP_TIMEOUT (-1)
Time out.
• #define POP_PASSWORDERROR (-2)
Password error.
• #define POP_CONNECTFAIL (-3)
Connection failed.
• #define POP_COMMANDFAIL (-4)

NetBurner, Inc.
19.72 PPP - Point to Point Protocol 417

Command failed.
• #define POP_BADSESSION (-5)
Session error.
• #define POP_NETWORKERROR (-6)
Network error.
• #define POP_BUFFER_FULL (-7)
Receive buffer full.

19.71.1 Detailed Description

19.72 PPP - Point to Point Protocol


Modules
• PPP Connection State
• PPP Return Codes

19.72.1 Detailed Description


Like Ethernet, Point to Point Protocol (PPP) is a data link layer which transfers data between nodes on a network.
The main difference is that PPP is used between two end points, whereas Ethernet is a multidrop configuration.
PPP can be used over many types of physical networks, including: fiber, phone line, serial cable and cellular
telephone. Once you have created a PPP connection to or from your NetBurner device you can use it with all the
standard network applications such as the web server, tcp, udp, ftp, email, etc.
Internet Service Providers (ISP) can implement PPP with many different options that vary from ISP to ISP. The PPP
example program included in the development kit examples directory specifies the most common ISP options and
can be used as a code example to specify any specific options you may need in your application.

19.73 PPP Connection State


Enumerations
• enum enum_PPPState {
eClosed , eInitializingModem , eDialing , eWait4Ring ,
eAnswering , eWaitForTrain , eLCPNegotiate , ePAPAuthenticate ,
eCHAPAuthenticate , eNCPNegotiate , eOpen , eClosing }
PPP States.

19.73.1 Detailed Description


19.73.2 Enumeration Type Documentation

19.73.2.1 enum_PPPState

enum enum_PPPState
PPP States.

Enumerator

eClosed Connection closed.


eInitializingModem Initializing modem.
eDialing Dialing.
eWait4Ring Waiting for ring indicator.
eAnswering Answering incoming connection.

NetBurner, Inc.
418 Module Documentation

Enumerator

eWaitForTrain Waiting for train.


eLCPNegotiate LCP negotiation.
ePAPAuthenticate PAP authentication.
eCHAPAuthenticate CHAP authentication.
eNCPNegotiate NCP negotiation.
eOpen Connection open.
eClosing Connection closing.

19.74 PPP Return Codes


Macros
• #define ERR_PPP_SUCCESS (0)
Success.
• #define ERR_PPP_ALREADY_OPEN (-1)
A session is already open.
• #define ERR_PPP_NO_DIALTONE (-2)
No dial tone.
• #define ERR_PPP_NO_ANSWER (-3)
The remote client did not answer.
• #define ERR_PPP_BUSY (-4)
The remote client is sending a busy signal.
• #define ERR_PPP_FAIL (-5)
The attempted action has failed.
• #define ERR_PPP_PASSFAIL (-6)
Pass/Fail.
• #define ERR_PPP_LOSTCARRIER (-7)
Lost connection carrier signal.
• #define ERR_PPP_NO_MODEM (-8)
No modem detected.
• #define ERR_PPP_LCP_FAILED (-9)
LCP negotiation has failed.
• #define ERR_PPP_CHAPFAIL (-10)
CHAP negotiation has failed.

19.74.1 Detailed Description

19.75 Primitive Types


Enumerations
• enum json_primitive_type {
UNDEFINED , BEGIN_ARRAY , BEGIN_OBJECT , END_ARRAY ,
END_OBJECT , NAME , STRING , VALUE_SEPERATOR ,
NUMBER , FALSE_EL , TRUE_EL , NULL_EL ,
STRING_TOO_BIG , ALLOC_STRING , NOTFOUND , EOF_EL }
The following types define the basic building blocks that make up a JSON data set. These are the values that will be
returned from the functions used to parse the data set. Member functions include operators to return specific data
type, as well as type validity checks.

NetBurner, Inc.
19.76 QuadSpiModuleNumber 419

19.75.1 Detailed Description


19.75.2 Enumeration Type Documentation

19.75.2.1 json_primitive_type

enum json_primitive_type
The following types define the basic building blocks that make up a JSON data set. These are the values that will
be returned from the functions used to parse the data set. Member functions include operators to return specific
data type, as well as type validity checks.

Enumerator

UNDEFINED Not a defined primitive type. This indicates an error somewhere.


BEGIN_ARRAY [ - Signals the start of an array.
BEGIN_OBJECT { - Signals the start of an object.
END_ARRAY ] - Signals the end of an array.
END_OBJECT } - Signals the end of an object.
NAME "xxx": - Signals the name of a name/value pair.
STRING "xxx" - An element with a string value.
VALUE_SEPERATOR , - Signals the separation between to arrays, objects, or values.
NUMBER An element with a number value.
FALSE_EL An element with the value false.
TRUE_EL An element with the value true.
NULL_EL An element with the null value.
STRING_TOO_BIG Error, we got a sting but it was too big to fit in the storage scheme (1500 bytes).
ALLOC_STRING We allocated a large string.
NOTFOUND Return value when we don't find what we are looking for.
EOF_EL Last token in the data set.

19.76 QuadSpiModuleNumber
QuadSPI Peripheral Module.

Macros
• #define DEFAULT_QUADSPI_MODULE 0
Default QUADSPI module.
• #define QUADSPI_MODULE_COUNT 1
Number of modules: 0, 1.

19.76.1 Detailed Description


QuadSPI Peripheral Module.

19.77 SAME70 GPIO (MODM7AE70)


Classes
• class PinIO
GPIO Pin Class.

NetBurner, Inc.
420 Module Documentation

• class _PinVector
GPIO Pin Vector Base Class.
• class PinVector< n >
GPIO Pin Vector Class PinVector is a template instantiation of the _PinVector class, allowing for minimal storage
requirements for potentially large vectors, without heavy code duplication due to template copies.

Variables
• volatile Pio & PinIO::pio
• uint32_t PinIO::mask

19.77.1 Detailed Description


The Netburner ARM SAME70 GPIO Pins class driver.

19.77.2 Variable Documentation

19.77.2.1 mask

PinIO::mask
Bit mask setting which pins in the given Pio hardware module the PinIO object will manage.

19.77.2.2 pio

PinIO::pio
Reference to the Pio hardware module that this PinIO will manage. Combines with the mask to manage a single
pin or multiple within the module.

19.78 SMTP - Send Email


Modules
• MIME Content Types
• SMTP Error Codes
• SSL SMTP Functions

Functions
• int SendMail (IPADDR smtp_server, PCSTR userid, PCSTR from_addr, PCSTR to_addr, PCSTR subject,
PCSTR textbody)
Send an email message. The function will open a TCP connection to the specified SMTP server, create a message
based on the parameters, and send the message.
• int SendMailAuth (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_addr,
PCSTR subject, PCSTR textbody)
Send an email message with plain text authentication. The function will open a TCP connection to the specified SMTP
server, create a message based on the parameters, and send the message.
• int SendMailEx (IPADDR smtp_server, PCSTR userid, PCSTR from_addr_rev_path, PCSTR from_addr_←-
memo_hdr, PCSTR to_addr, PCSTR subject, PCSTR textbody)
Send an email message function, extended version.
• int IsMailError ()
Returns the error status of the last send mail transaction.
• void PrintNBError (int fd=0)
If an error occurred, prints the error information received from the SMTP server.
• void PrintServerLog (int fd=0)

NetBurner, Inc.
19.78 SMTP - Send Email 421

Prints the server log of the last send mail transaction.


• int SendMailAuthStartMIME (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR
to_addr, PCSTR subject, int &fd)
Start a Multi-purpose Internet Mail Extension (MIME)session.
• int SendMailAuthAddMIME (int fd, int ContentType, const char ∗pContent, const char ∗FileName)
Add a MIME part or attachment to an open MIME Session.
• int SendMailAuthEndMIME (int fd, PCSTR userid)
Send a MIME email message and close the SMTP session.

• enum CONTENT_TYPE_ENUM {
CONTENT_TYPE_PLAIN_TEXT , CONTENT_TYPE_PLAIN_TEXT_ATTACH , CONTENT_TYPE_BINARY_ATTACH
, CONTENT_TYPE_HTML_DECOMP ,
CONTENT_TYPE_END }
SMTP MIME Conetnet Types.

19.78.1 Detailed Description


Send emails using the SMTP specification. The Send Mail functions provide a variety of sending options for simple
sending an email, or sending with authentication. The IsMailError function is used to check for errors after an email
is sent.

19.78.2 Enumeration Type Documentation

19.78.2.1 CONTENT_TYPE_ENUM

enum CONTENT_TYPE_ENUM
SMTP MIME Conetnet Types.

Enumerator

CONTENT_TYPE_PLAIN_TEXT Plain text.


CONTENT_TYPE_PLAIN_TEXT_ATTACH Plain text attachment.
CONTENT_TYPE_BINARY_ATTACH Binary attachment.
CONTENT_TYPE_HTML_DECOMP HTML.
CONTENT_TYPE_END Additional content types can be added above this line.

19.78.3 Function Documentation

19.78.3.1 IsMailError()

int IsMailError ( )
Returns the error status of the last send mail transaction.
Returns

0 if no error occurred, SMTP Error Codes.

See also

PrintNBError(), PrintServerLog()

NetBurner, Inc.
422 Module Documentation

19.78.3.2 PrintNBError()

void PrintNBError (
int fd = 0 )
If an error occurred, prints the error information received from the SMTP server.
If an error occurs when sending an email, the system will record the error information received from the SMTP
server. The information is only valid for the last transaction.

Parameters

fd If no parameter is specified information will be sent to stdout. Otherwise it will be sent to the specified file
descriptor.

See also

IsMailError(), PrintServerLog()

19.78.3.3 PrintServerLog()

void PrintServerLog (
int fd = 0 )
Prints the server log of the last send mail transaction.
The results of each send mail transaction are logged to a buffer. This function will send the results of the last
transaction to stdout, or the specified file descriptor. The information is only valid for the last transaction.

Parameters

fd If no parameter is specified information will be sent to stdout. Otherwise it will be sent to the specified file
descriptor.

See also

IsMailError(), PrintNBError()

19.78.3.4 SendMail()

int SendMail (
IPADDR smtp_server,
PCSTR userid,
PCSTR from_addr,
PCSTR to_addr,
PCSTR subject,
PCSTR textbody )
Send an email message. The function will open a TCP connection to the specified SMTP server, create a message
based on the parameters, and send the message.

Parameters

smtp_server IP address of the destination SMTP server.


userid ASCII string representing the RFC 931 identification.
from_addr "From" email address
to_addr Destination email address
subject Email subject
textbody Body of email message

NetBurner, Inc.
19.78 SMTP - Send Email 423

Returns

0 on failure, 1 on success.

See also

SendMailAuth()

Send mail without authentication.

19.78.3.5 SendMailAuth()

int SendMailAuth (
IPADDR smtp_server,
PCSTR userid,
PCSTR pass,
PCSTR from_addr,
PCSTR to_addr,
PCSTR subject,
PCSTR textbody )
Send an email message with plain text authentication. The function will open a TCP connection to the specified
SMTP server, create a message based on the parameters, and send the message.
Send an email message with SMTP plain text authentication per RFC 931. The function will open a TCP connection
to the specified SMTP server, authenticate the connection with the specified username and password, create a
message based on the parameters, and send the message.

Parameters

smtp_server IP address of the destination SMTP server.


userid ASCII string representing the RFC 931 identification.
pass ASCII string to provide for AUTH identification.
from_addr "From" email address
to_addr Destination email address
subject Email subject
textbody Body of email message

Returns

0 on failure, 1 on success.

See also

SendMail()

Send mail with plain text username and password authentication.

19.78.3.6 SendMailAuthAddMIME()

int SendMailAuthAddMIME (
int fd,
int ContentType,
const char ∗ pContent,
const char ∗ FileName )
Add a MIME part or attachment to an open MIME Session.
Must only be called for an open session started with SendMailAuthStartMIME(). It can be called as many times as
needed to add each MIME part or attachment to the message.

NetBurner, Inc.
424 Module Documentation

Parameters

fd The file descriptor of the open MIME session.


ContentType The MIME content type, such as: CONTENT_TYPE_PLAIN_TEXT,
CONTENT_TYPE_PLAIN_TEXT_ATTACH, CONTENT_TYPE_BINARY_ATTACH.
∗pContent Pointer to the content to add.
∗FileName File name for the attachment.

Returns

0 on failure, 1 on success.

See also

SendMailAuthStartMIME(), SendMailAuthEndMIME()

19.78.3.7 SendMailAuthEndMIME()

int SendMailAuthEndMIME (
int fd,
PCSTR userid )
Send a MIME email message and close the SMTP session.
Must only be called for an open session started with SendMailAuthStartMIME().

Parameters

fd The file descriptor of the open MIME session.


∗userid The user ID that was used by SendMailAuthStartMIME() to open the session.

Returns

0 on failure, 1 on success.

See also

SendMailAuthStartMIME(), SendMailAuthAddMIME()

19.78.3.8 SendMailAuthStartMIME()

int SendMailAuthStartMIME (
IPADDR smtp_server,
PCSTR userid,
PCSTR pass,
PCSTR from_addr,
PCSTR to_addr,
PCSTR subject,
int & fd )
Start a Multi-purpose Internet Mail Extension (MIME)session.
Start a MIME session with plain text password authentication. This function will open a TCP connection to the SMTP
server, authenticate, then return while leaving the TCP connection open. The Session file descriptor is returned in
the "int &fd" reference variable. This function must be called before any other SendMail MIME function.
Sending an E-Mail message with Multipurpose Internet Mail Extensions (MIME) is a multi step process:

• Call SendMailAuthStartMIME( ) to begin a Session with the SMTP server, connection will remain open.

NetBurner, Inc.
19.78 SMTP - Send Email 425

• Call SendMailAuthAddMIME( ) for each MIME attachment you want to add.

• Call SendMailAuthEndMIME( ) to send the email message and close the Session.

The following MIME types are supported by default. The binary attachment should cover most types such as jpg,
gif, etc. The types are defined in \nburn\nbrtos\include\mailto.h, and the functions are implemented
in \nburn\system\mailto.cpp.
MIME Content Types defined by MIME Content Types.

Parameters

smtp_server IP address of the destination SMTP server.


userid ASCII string representing the RFC 931 identification.
pass Password.
from_addr Reverse path per RFC 821, reverse source route.
to_addr Destination email address.
subject Email subject.
fd A ? reference ? (or pointer) to an integer value of the calling function. The value of fd is modified

by this function and will contain the file descriptor for the open SMTP Session. This value must
always be checked to be greater than 0 for a valid Session. The fd is passed to other MIME
functions to identify the open Session.

Returns

0 on failure, 1 on success.

See also

SendMailAuthAddMIME(), SendMailAuthEndMIME()

19.78.3.9 SendMailEx()

int SendMailEx (
IPADDR smtp_server,
PCSTR userid,
PCSTR from_addr_rev_path,
PCSTR from_addr_memo_hdr,
PCSTR to_addr,
PCSTR subject,
PCSTR textbody )
Send an email message function, extended version.
Send an email message with extended parameters. The function will open a TCP connection to the specified SMTP
server, create a message based on the parameters, and send the message. This function is identical to SendMail( ),
with the addition of the from_addr_rev_path and from_addr_memo_hdr parameters.

Parameters

smtp_server IP address of the destination SMTP server.


userid ASCII string representing the RFC 931 identification.
from_addr_rev_path Reverse path per RFC 821, reverse source route.
from_addr_memo_hdr From address memo header per RFC 821. Contains items such as date, subject, to:,
CC: and from:.
to_addr Destination email address
subject Email subject
textbody Body of email message

NetBurner, Inc.
426 Module Documentation

Returns

0 on failure, 1 on success.

See also

SendMail()

Send mail with additional parameters, no authentication.

19.79 SMTP Error Codes


Macros
• #define STATUS_OK (0)
OK, no errors.
• #define CONNECT_TO_SMTP_SERVER_FAILED (-1)
Could not connect to SMTP server.
• #define INITIAL_SERVER_REPLY_FAILED (-2)
Initial server reply failed.
• #define HELO_SERVER_REPLY_FAILED (-3)
Server HELO reply failed.
• #define MAIL_FROM_SERVER_REPLY_FAILED (-4)
Mail From server reply failed.
• #define RCPT_TO_SERVER_REPLY_FAILED (-5)
Receipt To server reply failed.
• #define DATA_SERVER_REPLY_FAILED (-6)
Data server reply failed.
• #define DATA_END_SERVER_REPLY_FAILED (-7)
Date end server reply failed.
• #define AUTH_LOGIN_SERVER_REPLY_FAILED (-8)
AUTH login server reply failed.
• #define USER_ID_SERVER_REPLY_FAILED (-9)
User ID server reply failed.
• #define PASSWORD_SERVER_REPLY_FAILED (-10)
Password server reply failed.
• #define CONNECT931_SMTP_SERVER_FAILED (-11)
SMTP connection failed.

19.79.1 Detailed Description

19.80 SOCKS
Modules
• SOCKS Error Codes

Macros
• #define SOCKS_MAX_UNAME_SIZE 255
Max character length for usernames. Defined in RFC 1929.
• #define SOCKS_MAX_PASSWD_SIZE 255
Max character length for passwords. Defined in RFC 1929.

NetBurner, Inc.
19.80 SOCKS 427

Enumerations
• enum SocksAuthType : unsigned char { eSocksAuthTypeGssApi = 0x01 , eSocksAuthTypeUnPw = 0x02 ,
eSocksAuthTypeNoAuth = 0x04 }
SOCKS Autherization Types.
• enum SocksClientCmd : unsigned char { eSocksClientCmdConnect = 1 , eSocksClientCmdBind = 2 ,
eSocksClientCmdUdpAssoc = 3 }
SOCKS Client Commands.
• enum SocksAdrType : unsigned char { eSocksAdrTypeNone = 0x00 , eSocksAdrTypeIpv4 = 0x01 ,
eSocksAdrTypeDomain = 0x03 , eSocksAdrTypeIpv6 = 0x04 }
SOCKS Address Types.

Functions
• bool AuthWithGssApi ()
A weak function that should be overriden by the developer in order to support GSSAPI authorization.
• void SetSocksProxySettings (SocksProxy ∗socksProxy)
Set the system level SOCKS proxy settings object to the one that is passed in. If this object is set and is marked as
enabled, calls to CoreConnect() (made from connect(), DoGet(), etc), will all initially connect to the proxy server using
the SOCKS5 protocol.
• SocksProxy ∗ GetSocksProxySettings ()
Get a pointer to the currnetly set Socks proxy settings object.

19.80.1 Detailed Description


The NetBurner SOCKS Library

19.80.2 Enumeration Type Documentation

19.80.2.1 SocksAdrType

enum SocksAdrType : unsigned char


SOCKS Address Types.

Enumerator

eSocksAdrTypeNone None.
eSocksAdrTypeIpv4 IPv4.
eSocksAdrTypeDomain Domain.
eSocksAdrTypeIpv6 IPv6.

19.80.2.2 SocksAuthType

enum SocksAuthType : unsigned char


SOCKS Autherization Types.

Enumerator

eSocksAuthTypeGssApi GSS API.


eSocksAuthTypeUnPw User name and password.
eSocksAuthTypeNoAuth Not as defined in RFC so that it could be propery tested against when being set by
user.

NetBurner, Inc.
428 Module Documentation

19.80.2.3 SocksClientCmd

enum SocksClientCmd : unsigned char


SOCKS Client Commands.

Enumerator

eSocksClientCmdConnect Connect.
eSocksClientCmdBind Not currently supported, see RFC 1928.
eSocksClientCmdUdpAssoc Not currently supported, see RFC 1928.

19.80.3 Function Documentation

19.80.3.1 AuthWithGssApi()

bool AuthWithGssApi ( )
A weak function that should be overriden by the developer in order to support GSSAPI authorization.

Return values

true The GSSAPI authorization succeeded.


false The GSSAPI authorization failed.

19.80.3.2 GetSocksProxySettings()

SocksProxy ∗ GetSocksProxySettings ( )
Get a pointer to the currnetly set Socks proxy settings object.

Returns

SocksProxy∗

19.80.3.3 SetSocksProxySettings()

void SetSocksProxySettings (
SocksProxy ∗ socksProxy )
Set the system level SOCKS proxy settings object to the one that is passed in. If this object is set and is marked
as enabled, calls to CoreConnect() (made from connect(), DoGet(), etc), will all initially connect to the proxy server
using the SOCKS5 protocol.

Parameters

socksProxy The proxy object that the system should reference.

NetBurner, Inc.
19.81 SOCKS Error Codes 429

19.81 SOCKS Error Codes


Macros
• #define SOCKS_SUCCESS (0)
The connection was successful.
• #define SOCKS_ERR_TIMEOUT (-500)
The connection timed out.
• #define SOCKS_BAD_ADR_TYPE (-501)
Address type specified does not match the address provided.
• #define SOCKS_CONN_ABORTED (-502)
The other side aborted the connection.
• #define SOCKS_BAD_AUTH_TYPE (-503)
The server doesn't support the requested authorization types.
• #define SOCKS_BAD_UN_PW (-504)
The server did not approve the username and password provided.
• #define SOCKS_UN_TOO_LONG (-505)
The specified username is too long.
• #define SOCKS_PW_TOO_LONG (-506)
The specified password is too long.
• #define SOCKS_BAD_REPLY (-507)
The server reply was not successful.
• #define SOCKS_BAD_DOMAIN (-508)
Unable to resolve domain name passed.
• #define SOCKS_CMD_NOT_SUPPORTED (-509)
The requested command aren't supported.
• #define SOCKS_BAD_PARAM (-510)
The passed in parameters are not valid.

19.81.1 Detailed Description


Error codes that can be returned by SOCKS related functions.

19.82 SPI
Modules
• ColdFire MCF5441x (DSPI)
• SPI - MODM7AE70 (DSPI)
• SPI - MODM7AE70 (QSPI)

19.82.1 Detailed Description


SPI API for NetBurner Platforms

19.83 SPI - MODM7AE70 (DSPI)


Modules
• DspiModuleNumber
DSPI Peripheral Module.
• DspiState
DSPI Bus State .

NetBurner, Inc.
430 Module Documentation

Classes
• class SPIModule
SPI Peripheral Module Class.

Enumerations
• enum csReturnType {
DEASSERT_NEVER = 0 , DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 ,
DEASSERT_NEVER = 0 ,
DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 }
Chip select deassertion modes. Used to determine when the driver should deassert chip selects during SPI transfer.
• enum spiChipSelect {
CHIP_SELECT_0 = 0 , CHIP_SELECT_1 = 1 , CHIP_SELECT_2 = 2 , CHIP_SELECT_3 = 3 ,
CHIP_SELECT_DISABLED = 0xFF , CHIP_SELECT_0 = 0xFE , CHIP_SELECT_1 = 0xFD , CHIP_SELECT_2
= 0xFB ,
CHIP_SELECT_3 = 0xF7 , CHIP_SELECT_DISABLED = 0xFF }
Chip select number.
• enum spiChipSelectPolarity { CS_ASSERT_LOW = 0 , CS_ASSERT_HIGH = 1 , CS_ASSERT_LOW = 0x00
, CS_ASSERT_HIGH = 0xFF }
Chip select polarity.

Functions
• uint8_t DSPIInit (uint8_t SPIModule=DEFAULT_DSPI_MODULE, uint32_t Baudrate=2000000, uint8_←-
t QueueBitSize=8, uint8_t CS=0x00, uint8_t CSPol=0x0F, uint8_t ClkPolarity=0, uint8_t ClkPhase=1, BOOL
DoutHiz=TRUE, uint8_t QCD=0, uint8_t DTL=0)
Initialize a DSPI module.
• uint8_t DSPIStart (uint8_t SPIModule, puint8_t transmitBufferPtr, volatile uint8_t ∗receiveBuffer←-
Ptr, uint32_t byteCount, OS_SEM ∗finishedSem=NULL, uint8_t enableDMA=TRUE, int csReturnTo←-
Inactive=DEASSERT_AFTER_LAST)
Start a DSPI transfer.
• BOOL DSPIdone (uint8_t SPIModule=DEFAULT_DSPI_MODULE)
Check SPI status.
• uint8_t QSPIInit (uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, uint8_t peripheralChip←-
Selects=0x0F, uint8_t chipSelectPolarity=1, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL dout←-
Hiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
Compatibility function for previous drivers. Initialize SPI module.
• uint8_t QSPIStart (puint8_t transmitBufferPtr, volatile uint8_t ∗receiveBufferPtr, uint32_t byteCount, OS_SEM
∗finishedSem=NULL)
Compatibility function for previous drivers. Start a SPI transfer.
• BOOL QSPIdone ()
Compatibility function for previous drivers. Check SPI status.

19.83.1 Detailed Description


The NetBurner ARM SAME70 DSPI Group. Note that for the ARM SAME70 there are 3 types of SPI peripherals:

• SPI using the SPI peripheral: Provides the most configuration options. Used in single data channel mode:
SCLK, MISO, MOSI, Chip Selects.

• SPI using the QSPI peripheral: Single data channel as with SPI, but fewer configuration options.

• SPI using the USART peripheral: Single data channel as with SPI, but fewer configuration options.

NetBurner, Inc.
19.83 SPI - MODM7AE70 (DSPI) 431

19.83.2 Enumeration Type Documentation

19.83.2.1 csReturnType

enum csReturnType
Chip select deassertion modes. Used to determine when the driver should deassert chip selects during SPI transfer.

Enumerator

DEASSERT_NEVER The chip select used for the transaction should remain asserted, even
after the transaction is complete.
DEASSERT_AFTER_LAST The chip select should remain asserted for the full duration of the
transaction, and only be deasserted after the final transfer.
DEASSERT_EVERY_TRANSFER The chip select should be deasserted between every transfer within the
transaction.Deassert chip select After every transfer.
DEASSERT_NEVER The chip select used for the transaction should remain asserted, even
after the transaction is complete.
DEASSERT_AFTER_LAST The chip select should remain asserted for the full duration of the
transaction, and only be deasserted after the final transfer.
DEASSERT_EVERY_TRANSFER The chip select should be deasserted between every transfer within the
transaction.

19.83.2.2 spiChipSelect

enum spiChipSelect
Chip select number.
If supported by the SPI peripheral, these values can be used to configure the chip select to be used during a SPI
transfer.

Enumerator

CHIP_SELECT_0 Configure the SPI peripheral to use chip select 0.


CHIP_SELECT_1 Configure the SPI peripheral to use chip select 1.
CHIP_SELECT_2 Configure the SPI peripheral to use chip select 2.
CHIP_SELECT_3 Configure the SPI peripheral to use chip select 3.
CHIP_SELECT_DISABLED Configure the SPI peripheral to disable chip select.
CHIP_SELECT_0 Configure bit mask for SPI chip select 0.
CHIP_SELECT_1 Configure bit mask for SPI chip select 1.
CHIP_SELECT_2 Configure bit mask for SPI chip select 2.
CHIP_SELECT_3 Configure bit mask for SPI chip select 3.
CHIP_SELECT_DISABLED Configure bit mask to disable chip select.

19.83.2.3 spiChipSelectPolarity

enum spiChipSelectPolarity
Chip select polarity.
This enum exists for API compatibility between platforms. The SAME70's SPI peripheral does not support modifying
chip select polarity. The SPI peripheral only supports asserting chip select to logic level LOW during a transaction.
If you need to assert the chip select to logic level HIGH during a transaction, your alternative is to use a GPIO for
chip select.

NetBurner, Inc.
432 Module Documentation

Enumerator

CS_ASSERT_LOW Assert all chip selects to logic level LOW during a SPI transaction.
CS_ASSERT_HIGH Assert all chip selects to logic level HIGH during a SPI transaction.
CS_ASSERT_LOW Bit mask configures all active chip selects as active low, inactive high.
CS_ASSERT_HIGH Bit mask configures all active chip selects as inactive low, active high.

19.83.3 Function Documentation

19.83.3.1 DSPIdone()

BOOL DSPIdone (
uint8_t SPIModule = DEFAULT_DSPI_MODULE )
Check SPI status.
Returns

true if DSPI is finished, false if active

19.83.3.2 DSPIInit()

uint8_t DSPIInit (
uint8_t SPIModule = DEFAULT_DSPI_MODULE,
uint32_t Baudrate = 2000000,
uint8_t QueueBitSize = 8,
uint8_t CS = 0x00,
uint8_t CSPol = 0x0F,
uint8_t ClkPolarity = 0,
uint8_t ClkPhase = 1,
BOOL DoutHiz = TRUE,
uint8_t QCD = 0,
uint8_t DTL = 0 )
Initialize a DSPI module.
Notes:

• The maximum baud rate is CPU_CLOCK / 3

• Will initialize to the highest available baud rate that does not exceed the maximum

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for greater than 8 bits per transfer then the data must be uint16_t aligned

• If configured for greater than 16 bits per transfer then the data must be uint32_t aligned

• Chip select is based on chipSelectPolarity

• 0 data captured leading edge of DSPI_CLK, changed following edge.

• 1 data changed leading edge of DSPI_CLK, captured following edge.

• 0 default is as close to 1/2 DSPI_CLK without going under, keeping with the interface to SPI

• 0 default is 17/(system clock / 2), in keeping with interface to QSPI

NetBurner, Inc.
19.83 SPI - MODM7AE70 (DSPI) 433

Parameters

SPIModule SPI module number, 0 - 1


Baudrate Maximum baud rate requested
QueueBitSize Number of bits per transfer: 8, 16 or 32
CS SPI chip selects to use for transfer
CSPol 0 = inactive logic level low, 1 = high
ClkPolarity 0 = inactive logic level low, 1 = high
ClkPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed leading edge
clock, captured following edge.
DoutHiz Data output high impedance between transfers
QCD Delay from chip select to valid clock (default is 0)
DTL Chip select mode dspiChipSelectMode

Returns

Current stat of DSPI bus dspiState

19.83.3.3 DSPIStart()

uint8_t DSPIStart (
uint8_t SPIModule,
puint8_t transmitBufferPtr,
volatile uint8_t ∗ receiveBufferPtr,
uint32_t byteCount,
OS_SEM ∗ finishedSem = NULL,
uint8_t enableDMA = TRUE,
int csReturnToInactive = DEASSERT_AFTER_LAST )
Start a DSPI transfer.

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for > than 8 bits per transfer then the data must be uint16_t aligned

• If configured for > than 16 bits per transfer then the data must be uint32_t aligned

• If either RX or TX pointer is assigned 'null' then that communication direction will not occur.

• If DSPI_Finished points to a semaphore, then the DSPI will POST to it when the transfer is complete.

• The semaphore is optional, but it can increase efficiency.

Parameters

SPIModule DSPI module to use, 0 - 1


transmitBufferPtr Pointer to the buffer containing the data to transmit
receiveBufferPtr Pointer to the buffer to store the received data
byteCount Number of bytes to transmit
finishedSem Optional semaphore to post to when finished
enableDMA Enable DMA transfers
csReturnToInactive Chip select state

NetBurner, Inc.
434 Module Documentation

Returns

The current state of the SPI bus dspiState

19.83.3.4 QSPIdone()

BOOL QSPIdone ( ) [inline]


Compatibility function for previous drivers. Check SPI status.
Note that the 'Q' stands for Queued SPI
Returns

true if DSPI is finished, false if active

19.83.3.5 QSPIInit()

uint8_t QSPIInit (
uint32_t baudRateInBps = 2000000,
uint8_t transferSizeInBits = 8,
uint8_t peripheralChipSelects = 0x0F,
uint8_t chipSelectPolarity = 1,
uint8_t clockPolarity = 0,
uint8_t clockPhase = 1,
BOOL doutHiz = TRUE,
uint8_t csToClockDelay = 0,
uint8_t delayAfterTransfer = 0 ) [inline]
Compatibility function for previous drivers. Initialize SPI module.
Note that the 'Q' stands for Queued SPI
Will use the default SPI module, 0.

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for > than 8 bits per transfer then the data must be uint16_t aligned

• If configured for > than 16 bits per transfer then the data must be uint32_t aligned

• If either RX or TX pointer is assigned 'null' then that communication direction will not occur.

• If DSPI_Finished points to a semaphore, then the DSPI will POST to it when the transfer is complete.

• The semaphore is optional, but it can increase efficiency.

Parameters
baudRateInBps Maximum baud rate requested
transferSizeInBits Number of bits per transfer: 8, 16 or 32
peripheralChipSelects SPI chip selects to use for transfer
chipSelectPolarity 0 = inactive logic level low, 1 = high
clockPolarity 0 = inactive logic level low, 1 = high
clockPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed
leading edge clock, captured following edge.
doutHiz Data output high impedance between transfers
csToClockDelay Delay from chip select to valid clock (default is 0)
delayAfterTransfer Chip select mode spiChipSelect

NetBurner, Inc.
19.84 SPI - MODM7AE70 (QSPI) 435

Returns

The current state of the SPI bus dspiState

19.83.3.6 QSPIStart()

uint8_t QSPIStart (
puint8_t transmitBufferPtr,
volatile uint8_t ∗ receiveBufferPtr,
uint32_t byteCount,
OS_SEM ∗ finishedSem = NULL ) [inline]
Compatibility function for previous drivers. Start a SPI transfer.
Note that the 'Q' stands for Queued SPI

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for > than 8 bits per transfer then the data must be uint16_t aligned

• If configured for > than 16 bits per transfer then the data must be uint32_t aligned

• If either RX or TX pointer is assigned 'null' then that communication direction will not occur.

• If DSPI_Finished points to a semaphore, then the DSPI will POST to it when the transfer is complete.

• The semaphore is optional, but it can increase efficiency.

Parameters

transmitBufferPtr Pointer to the buffer containing the data to transmit


receiveBufferPtr Pointer to the buffer to store the received data
byteCount Number of bytes to transmit
finishedSem Optional semaphore to post to when finished

Returns

The current state of the SPI bus dspiState

19.84 SPI - MODM7AE70 (QSPI)


Modules
• QuadSpiModuleNumber
QuadSPI Peripheral Module.

Classes
• class SPI_QSPI
The Single-Bit SPI mode QSPI Peripheral Class.

19.84.1 Detailed Description


The NetBurner ARM SAME70 Quad SPI (QSPI) API. Note that there are 3 types of SPI peripherals:
• SPI using the SPI peripheral: Provides the most configuration options. Used in single data channel mode:
SCLK, MISO, MOSI, Chip Selects.

• SPI using the QuadSPI peripheral: Single data channel as with SPI, but fewer configuration options.

• SPI using the USART peripheral: Single data channel as with SPI, but fewer configuration options.

NetBurner, Inc.
436 Module Documentation

19.85 SSH
Modules
• SSH Error Codes

Typedefs
• typedef int(∗ sshUserAuthenticateFn) (const char ∗usernamePtr, const char ∗passwordPtr)
[DEPRECATED] User provided SSH username and password authenticate routine for a server. Please consider
sshUserAuthenticateWithTypeFn.
• typedef int(∗ sshUserAuthenticateWithTypeFn) (const char ∗usernamePtr, const char ∗authValPtr, AuthType
authType)
User provided SSH user authenticate routine for a server.
• typedef int(∗ sshGetUserPwFn) (const NBString &usernamePtr, NBString &passwordPtr)
User provided SSH user password authentication routine for clients.
• typedef int(∗ sshGetUserKeyFn) (const NBString &usernamePtr, NBString &publicKey, NBString &privateKey,
NBString &keyType)
User provided SSH user key authenticate routine for clients.
• typedef int(∗ sshUserGetKeyFn) (int keyRequested, const unsigned char ∗∗keyBufferPtr, int ∗keyLengthPtr)
The user defined callback to get the server key used during the initial SSH negotiation.

Functions
• void SshSetUserAuthenticate (sshUserAuthenticateFn sshUserAuthenticateFnPtr)
[DEPRECATED] Sets the user defined server authentication function. Please consider sshUserAuthenticateWith←-
TypeFn.
• sshUserAuthenticateFn SshGetUserAuthenticate (void)
[DEPRECATED] Gets the user defined server authentication function. Please consider SshGetUserAuthenticate←-
WithType.
• void SshSetUserAuthenticateWithType (sshUserAuthenticateWithTypeFn sshUserAuthenticateFnPtr)
Sets the user defined server authentication function.
• sshUserAuthenticateWithTypeFn SshGetUserAuthenticateWithType (void)
Gets the user defined server authentication function..
• void SshClientSetGetUserPaswordFn (sshGetUserPwFn sshGetUserPwFnPtr)
Sets the user defined client authentication function for getting user passwords during SSH authentication.
• sshGetUserPwFn SshClientGetUserPaswordFn (void)
Gets the user defined client authentication function for getting a user password during authentication.
• void SshClientSetGetUserKeyFn (sshGetUserKeyFn sshGetUserKeyFnPtr)
Sets the user defined client authentication function for getting user keys during SSH authentication.
• sshGetUserKeyFn SshClientGetUserKeyFn (void)
Gets the user defined client authentication function for getting a user key during authentication.
• void SshSetUserGetKey (sshUserGetKeyFn sshUserGetKeyFnPtr)
Sets the user defined callback method to provide the server key.
• sshUserGetKeyFn SshGetUserGetKey (void)
Gets the user defined callback method to provide the server key.
• bool SshValidateKey (const char ∗candidateKey, int candidateKeySize, int ∗keyTypePtr, int key←-
Format=WOLFSSH_FORMAT_ASN1)
Takes a key and returns if it's valid or not.
• bool SshWritePublicKey (int publicKeyFd, unsigned char ∗candidateKey, int candidateKeySize)
Write public key to file descriptor. Takes both PEM and ANS1 formats.
• int NbSshInit ()

NetBurner, Inc.
19.85 SSH 437

Initializes the underlying SSH framework. This will start a background task used to handle negotiations and SSH
traffic. This is automatically called by SshAccept and SshConnect, and doesn't need to be called directly except in
special circumstances.
• int SshAccept (int listenFd, IPADDR ∗clientAddress, uint16_t ∗securePort, uint16_t timeout)
Accepts and negotiates SSH session. Automatically calls NbSshInit() if required.
• int SshConnect (IPADDR clientAddress, uint16_t securePort, uint16_t localPort, uint16_t timeout, const char
∗username)
Issues a connect request to negotiates an SSH session. Automatically calls NbSshInit() if required.
• SshSocket ∗ SshNegotiateSession (int fd)
Negotiates an SSH server session on an open file descriptor.
• SshSocket ∗ SshNegotiateSessionClient (int secureFd, const char ∗username)
Negotiates an SSH client session on an open file descriptor.
• void SshPrintStatistics (int secureFd)
Negotiates an SSH client session on an open file descriptor.
• int SshGetKeySize ()
Determins and returns SSH's installed key size.
• int SshSetBannerText (const char ∗banner)
Sets the banner text displayed by the SSH server on connection.
• int SshSetSockOption (int fd, int option)
Set SSH TCP socket options.
• int SshClrSockOption (int fd, int option)
Clear SSH TCP socket options.
• int SshGetSockOption (int fd)
Returns the options for the specified SSH TCP socket.

19.85.1 Detailed Description


The NetBurner SSH Library

19.85.2 Typedef Documentation

19.85.2.1 sshGetUserKeyFn

typedef int(∗ sshGetUserKeyFn) (const NBString &usernamePtr, NBString &publicKey, NBString


&privateKey, NBString &keyType)
User provided SSH user key authenticate routine for clients.

Parameters
usernamePtr Username in plain text
out publicKey Used to return the corresponding public key for the user
out privateKey Used to return the corresponding pviate key for the user
out keyType Used to return the corresponding key type (ECC or RSA) for the user

Return values

>0 Pasword available for the user


<=0 Authentication failed

NetBurner, Inc.
438 Module Documentation

19.85.2.2 sshGetUserPwFn

typedef int(∗ sshGetUserPwFn) (const NBString &usernamePtr, NBString &passwordPtr)


User provided SSH user password authentication routine for clients.

Parameters
usernamePtr Username in plain text
out passwordPtr Used to return the corresponding password for the user

Return values

>0 Pasword available for the user


<=0 Authentication failed

19.85.2.3 sshUserAuthenticateFn

typedef int(∗ sshUserAuthenticateFn) (const char ∗usernamePtr, const char ∗passwordPtr)


[DEPRECATED] User provided SSH username and password authenticate routine for a server. Please consider
sshUserAuthenticateWithTypeFn.

Parameters
usernamePtr Username in plain text
passwordPtr Password in plain text

Return values
1 Authentication passed
!1 Authentication failed

19.85.2.4 sshUserAuthenticateWithTypeFn

typedef int(∗ sshUserAuthenticateWithTypeFn) (const char ∗usernamePtr, const char ∗authValPtr,


AuthType authType)
User provided SSH user authenticate routine for a server.

Parameters
usernamePtr Username in plain text
authValPtr The value that is being passed in for authentication
authType Either a password or a key

Return values
1 Authentication passed
!1 Authentication failed

NetBurner, Inc.
19.85 SSH 439

19.85.2.5 sshUserGetKeyFn

typedef int(∗ sshUserGetKeyFn) (int keyRequested, const unsigned char ∗∗keyBufferPtr, int ∗key←-
LengthPtr)
The user defined callback to get the server key used during the initial SSH negotiation.

Parameters

keyRequested Type key requested (ECC or RSA)


keyBufferPtr Buffer containing the key (ASN1 or PEM format supported)
keyLengthPtr Size of the key in 8 bit bytes

Return values
0 Key and length are valid
-1 Key requested is not available

See also

SshSetUserGetKey()
SshGetUserGetKey()

19.85.3 Function Documentation

19.85.3.1 NbSshInit()

int NbSshInit ( )
Initializes the underlying SSH framework. This will start a background task used to handle negotiations and SSH
traffic. This is automatically called by SshAccept and SshConnect, and doesn't need to be called directly except in
special circumstances.

Return values

SSH_SUCCESS if SSH system has been correctly initialized.


Other SSH error code if initialization was unsuccessful.

See also

SshAccept()
SshConnect()

19.85.3.2 SshAccept()

int SshAccept (
int listenFd,
IPADDR ∗ clientAddress,
uint16_t ∗ securePort,
uint16_t timeout )
Accepts and negotiates SSH session. Automatically calls NbSshInit() if required.

Parameters

listenFd File descriptor of listening socket

NetBurner, Inc.
440 Module Documentation

Parameters

clientAddress Address of client


securePort Secure port of negotiated socket
timeout Ticks to wait for connection, 0 is infinite

Return values

>0 The secure file descriptor if successful.


Other A TCP or SSH error code, depending on the error..

See also

NbSshInit()
SshConnect()

19.85.3.3 SshClientGetUserKeyFn()

sshGetUserKeyFn SshClientGetUserKeyFn (
void )
Gets the user defined client authentication function for getting a user key during authentication.

Return values

sshGetUserPwFnPtr Sets the user defined server authentication function.

See also

SshClientSetGetUserPaswordFn()
SshClientGetUserPaswordFn()
SshClientSetGetUserKeyFn()

19.85.3.4 SshClientGetUserPaswordFn()

sshGetUserPwFn SshClientGetUserPaswordFn (
void )
Gets the user defined client authentication function for getting a user password during authentication.

Return values

A pointer to the fuction that is currently set for passing in a user's password during authentication.

See also

SshClientSetGetUserPaswordFn()
SshClientSetGetUserKeyFn()
SshClientGetUserKeyFn()

NetBurner, Inc.
19.85 SSH 441

19.85.3.5 SshClientSetGetUserKeyFn()

void SshClientSetGetUserKeyFn (
sshGetUserKeyFn sshGetUserKeyFnPtr )
Sets the user defined client authentication function for getting user keys during SSH authentication.

Parameters

sshGetUserKeyFnPtr Sets the user defined server authentication function.

See also

SshClientSetGetUserPaswordFn()
SshClientGetUserPaswordFn()
SshClientGetUserKeyFn()

19.85.3.6 SshClientSetGetUserPaswordFn()

void SshClientSetGetUserPaswordFn (
sshGetUserPwFn sshGetUserPwFnPtr )
Sets the user defined client authentication function for getting user passwords during SSH authentication.

Parameters

sshGetUserPwFnPtr Sets the user defined client authentication function.

See also

SshClientGetUserPaswordFn()
SshClientSetGetUserKeyFn()
SshClientGetUserKeyFn()

19.85.3.7 SshClrSockOption()

int SshClrSockOption (
int fd,
int option )
Clear SSH TCP socket options.

Parameters

fd Socket file descriptor.


option Socket option to clear: TCP Socket Options.

Returns

A bitmask of the options for the specified socket

See also

SshSetSockOption()
SshGetSockOption()

NetBurner, Inc.
442 Module Documentation

19.85.3.8 SshConnect()

int SshConnect (
IPADDR clientAddress,
uint16_t securePort,
uint16_t localPort,
uint16_t timeout,
const char ∗ username )
Issues a connect request to negotiates an SSH session. Automatically calls NbSshInit() if required.

Parameters

clientAddress Address of client


securePort Secure port of negotiated socket
localPort Optional parameter to specify a Local port number. Recommend this always be set to a value
of 0 so a random local port number is used.
timeout Ticks to wait for connection, 0 is infinite
username Username to use in negotiation process of secure connection

Return values

>0 The secure file descriptor if successful.


0 Request timed out.
<0 A TCP or SSH error code, depending on the error..

See also

SshAccept()
NbSshInit()

19.85.3.9 SshGetKeySize()

int SshGetKeySize ( )
Determins and returns SSH's installed key size.

Returns

The installed key's size

19.85.3.10 SshGetSockOption()

int SshGetSockOption (
int fd )
Returns the options for the specified SSH TCP socket.

Parameters

fd Socket file descriptor.

Returns

A bitmask of the options for the specified socket

NetBurner, Inc.
19.85 SSH 443

See also

SshSetSockOption()
SshClrSockOption()

19.85.3.11 SshGetUserAuthenticate()

sshUserAuthenticateFn SshGetUserAuthenticate (
void )
[DEPRECATED] Gets the user defined server authentication function. Please consider SshGetUserAuthenticate←-
WithType.

Return values

Returns a pointer to the function fuction that is currently set for server user authentication.

See also

SshGetUserAuthenticateWithType

19.85.3.12 SshGetUserAuthenticateWithType()

sshUserAuthenticateWithTypeFn SshGetUserAuthenticateWithType (
void )
Gets the user defined server authentication function..

Return values

A pointer to the fuction that is currently set for server user authentication.

See also

SshGetUserAuthenticateWithType()

19.85.3.13 SshGetUserGetKey()

sshUserGetKeyFn SshGetUserGetKey (
void )
Gets the user defined callback method to provide the server key.

Return values

sshUserGetKeyFn The user defined callback

See also

sshUserGetKeyFn()
SshSetUserGetKey()

19.85.3.14 SshNegotiateSession()

SshSocket ∗ SshNegotiateSession (

NetBurner, Inc.
444 Module Documentation

int fd )
Negotiates an SSH server session on an open file descriptor.

Parameters

fd File descriptor to use in the SSN negotiation, usually obtained with a call to accept()

Returns

A pointer to the SSH socket created on a successfull connection, or a nullptr if not successful.

19.85.3.15 SshNegotiateSessionClient()

SshSocket ∗ SshNegotiateSessionClient (
int secureFd,
const char ∗ username )
Negotiates an SSH client session on an open file descriptor.

Parameters

secureFd File descriptor to use in the SSN negotiation


username Username to use in negotiation process of secure connection

Returns

A pointer to the SSH socket created on a successfull connection, or a nullptr if not successful.

19.85.3.16 SshPrintStatistics()

void SshPrintStatistics (
int secureFd )
Negotiates an SSH client session on an open file descriptor.

Parameters

secureFd Secure file descriptor

19.85.3.17 SshSetBannerText()

int SshSetBannerText (
const char ∗ banner )
Sets the banner text displayed by the SSH server on connection.

Parameters
banner The text to display to any connected clients

Return values

SSH_SUCCESS If successful
<0 Error code on failure

NetBurner, Inc.
19.85 SSH 445

19.85.3.18 SshSetSockOption()

int SshSetSockOption (
int fd,
int option )
Set SSH TCP socket options.

Parameters

fd Socket file descriptor.


option Socket option to set: TCP Socket Options.

Returns

A bitmask of the options for the specified socket

See also

SshClrSockOption()
SshGetSockOption()

19.85.3.19 SshSetUserAuthenticate()

void SshSetUserAuthenticate (
sshUserAuthenticateFn sshUserAuthenticateFnPtr )
[DEPRECATED] Sets the user defined server authentication function. Please consider sshUserAuthenticateWith←-
TypeFn.

Parameters
sshUserAuthenticateFnPtr Fuction to set

See also

SshSetUserAuthenticateWithType()

19.85.3.20 SshSetUserAuthenticateWithType()

void SshSetUserAuthenticateWithType (
sshUserAuthenticateWithTypeFn sshUserAuthenticateFnPtr )
Sets the user defined server authentication function.

Parameters
sshUserAuthenticateFnPtr Fuction to set

NetBurner, Inc.
446 Module Documentation

See also

SshSetUserAuthenticateWithType()

19.85.3.21 SshSetUserGetKey()

void SshSetUserGetKey (
sshUserGetKeyFn sshUserGetKeyFnPtr )
Sets the user defined callback method to provide the server key.

Parameters

sshUserGetKeyFnPtr The user defined callback

See also

sshUserGetKeyFn()
SshGetUserGetKey()

19.85.3.22 SshValidateKey()

bool SshValidateKey (
const char ∗ candidateKey,
int candidateKeySize,
int ∗ keyTypePtr,
int keyFormat = WOLFSSH_FORMAT_ASN1 )
Takes a key and returns if it's valid or not.

Parameters

candidateKey A pointer to a buffer containing the key


candidateKeySize The size of the key in bytes
out keyTypePtr Is set to what kind of key is passed it (ECC and RSA are valid)
keyFormat The key format (ASN1 or PEM)

Return values
true The key is valid
false The key is not valid

19.85.3.23 SshWritePublicKey()

bool SshWritePublicKey (
int publicKeyFd,
unsigned char ∗ candidateKey,
int candidateKeySize )
Write public key to file descriptor. Takes both PEM and ANS1 formats.

Parameters

publicKeyFd Open target file descriptor

NetBurner, Inc.
19.86 SSH Error Codes 447

Parameters

candidateKey key in buffer


candidateKeySize Size of key in bytes

Return values

true A valid key was written to the file descriptor


false An error occurred

19.86 SSH Error Codes


Macros
• #define SSH_SUCCESS (0)
The function completed successfully.
• #define SSH_ERROR_FAILED_SESSION_FAILED (-300)
Not currently used, kept for backward compatibility.
• #define SSH_ERROR_FAILED_NEGOTIATION (-301)
The connection failed the SSH negotiation.
• #define SSH_ERROR_FAILED_INITIALIZATION (-302)
The SSH system failed to initialize.
• #define SSH_ERROR_FAILED_CONTEXT_INIT (-303)
Unable to instantiate SSH client/server context.
• #define SSH_ERROR_BAD_KEY (-304)
The key provided was invalid.
• #define SSH_ERROR_BAD_ARGUMENT (-305)
A bad argument was provided to the function.
• #define SSH_FAILED_KEY_CHECK (-306)

19.86.1 Detailed Description


Error codes that can be returned by the NetBurner SSH functions.

19.86.2 Macro Definition Documentation

19.86.2.1 SSH_FAILED_KEY_CHECK

#define SSH_FAILED_KEY_CHECK (-306)


There were no keys designated to use for the SSH library, the onboard generated key is not valid, and auto-cert
generation is not enabled or the cert generation function failed.

19.87 SSL Error Codes


Macros
• #define SSL_ERROR_FAILED_NEGOTIATION (-256)
The SSL system failed to successfully negotiate a connection.
• #define SSL_ERROR_CERTIFICATE_UNKNOWN (-258)
The received certificate could not be decoded.

NetBurner, Inc.
448 Module Documentation

• #define SSL_ERROR_CERTIFICATE_NAME_FAILED (-260)


The connected name did not match common_name.
• #define SSL_ERROR_CERTIFICATE_VERIFY_FAILED (-261)
The server returned a certificate that we did not trust.
• #define SSL_ERROR_NO_BUFFER (-262)
Unable to get a buffer from the pool.
• #define SSL_ERROR_HANDSHAKE_INCOMPLETE (-265)
The SSL handshake is not complete yet.
• #define SSL_ERROR_NO_SERVER_CERTIFICATE (-257)
The server wasn't able to load the certificate.
• #define SSL_ERROR_NO_SERVER_KEY (-258)
The server wasn't able to load the key.
• #define SSL_ERROR_UNABLE_TO_LOAD_CIPHERS (-259)
The client was unable to load the cipher list.
• #define SSL_ERROR_CERTIFICATE_CHECK (-260)
The server was unable to check the certificate.

19.87.1 Detailed Description


Error codes that can be returned by the NetBurner SSL functions.

19.88 SSL SMTP Functions


Functions
• int SSL_SendMail (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_←-
addr, PCSTR subject, PCSTR textbody, BOOL STARTTLS=false, int remotePort=-1, const char ∗server←-
Name=nullptr, bool verifyPeer=false, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16←-
_t certBuffFormat=SSL_FILETYPE_PEM)
Send an email message using SSL encryption.
• int SSL_SendMailHTML (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR
to_addr, PCSTR subject, const char ∗filename, BOOL STARTTLS=false, int remotePort=-1, const char
∗serverName=nullptr, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Send an HTML email message from a file using SSL encryption.
• int SSL_SendMailStartMIME (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PC-
STR to_addr, PCSTR subject, BOOL STARTTLS=false, int remotePort=-1, const char ∗serverName=nullptr,
bool verifyPeer=false, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Start a Multi-purpose Internet Mail Extension (MIME)session using SSL encryption.

19.88.1 Detailed Description


The following functions is very similar to the unencrypted SendMail() function. The initial connection of the SMTP
server can happen in one of two ways:
1) An SSL connection is negotiated immediately. 2) A TCP connection is opened first, and a SSL connection is
negotiated when the SMTP server sends a STARTTLS command to the NetBurner device.
Setting STARTTLS = TRUE enables the second mode of operation.

19.88.2 Function Documentation

NetBurner, Inc.
19.88 SSL SMTP Functions 449

19.88.2.1 SSL_SendMail()

int SSL_SendMail (
IPADDR smtp_server,
PCSTR userid,
PCSTR pass,
PCSTR from_addr,
PCSTR to_addr,
PCSTR subject,
PCSTR textbody,
BOOL STARTTLS = false,
int remotePort = -1,
const char ∗ serverName = nullptr,
bool verifyPeer = false,
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Send an email message using SSL encryption.

Parameters

smtp_server IP address of the SMTP server.


userid AscII String to provide for RFC931 IDentification.
pass AscII String to provide for AUTH IDentification.
from_addr From email address.
to_addr To email address.
subject The email subject.
textbody The email body.
STARTTLS Enable/disable STARTTLS functionality. Default is disabled.
remotePort Port number to connect to on the SMTP server.
serverName Server common name to use for certificate name verification and when sending SNI extensions.
verifyPeer Set true to verify the server's certificate against a Certificate Authority list. Default if false.
certBuff Buffer containing the certificate data.Default is null.
certBuffSize Size of the buffer containing the certificate data.
certBuffFormat The format of the certificate buffer. Default is SSL_FILETYPE_PEM.

Return values

0 Send failed
1 Send was successful

See also

SSL_SendMailHTML()
SSL_SendMailStartMIME()
SendMail()

19.88.2.2 SSL_SendMailHTML()

int SSL_SendMailHTML (
IPADDR smtp_server,
PCSTR userid,
PCSTR pass,

NetBurner, Inc.
450 Module Documentation

PCSTR from_addr,
PCSTR to_addr,
PCSTR subject,
const char ∗ filename,
BOOL STARTTLS = false,
int remotePort = -1,
const char ∗ serverName = nullptr,
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Send an HTML email message from a file using SSL encryption.

Parameters

smtp_server IP address of the SMTP server.


userid Ascii string to provide for RFC931 IDentification.
pass Ascii string to provide for AUTH IDentification.
from_addr From email address.
to_addr To email address.
subject The email subject.
filename HTTP server filename to send.
STARTTLS Enable/disable STARTTLS functionality. Default is disabled.
remotePort Port number to connect to on the SMTP server.
serverName Server name to use for certificate name verification and when sending SNI extensions.
certBuff Buffer containing the certificate data. Default is null.
certBuffSize Size of the buffer containing the certificate data.
certBuffFormat The format of the certificate buffer. Default is SSL_FILETYPE_PEM.

Return values

0 Send failed
1 Send was successful

See also

SSL_SendMail()
SSL_SendMailStartMIME()
SendMail()

19.88.2.3 SSL_SendMailStartMIME()

int SSL_SendMailStartMIME (
IPADDR smtp_server,
PCSTR userid,
PCSTR pass,
PCSTR from_addr,
PCSTR to_addr,
PCSTR subject,
BOOL STARTTLS = false,
int remotePort = -1,
const char ∗ serverName = nullptr,
bool verifyPeer = false,
const unsigned char ∗ certBuff = nullptr,

NetBurner, Inc.
19.89 SSL/TLS 451

uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Start a Multi-purpose Internet Mail Extension (MIME)session using SSL encryption.
Sending an E-Mail message with Multipurpose Internet Mail Extensions (MIME) is a multi step process:

• Call SSL_SendMailStartMIME( ) to begin a Session with the SMTP server, connection will remain open.

• Call SendMailAuthAddMIME( ) for each MIME attachment you want to add.

• Call SendMailAuthEndMIME( ) to send the email message and close the Session.

The following MIME types are supported by default. The binary attachment should cover most types such as jpg,
gif, etc. The types are defined by MIME Content Types.

Parameters

smtp_server IP address of the SMTP server.


userid Ascii string to provide for RFC931 IDentification.
pass Ascii string to provide for AUTH IDentification.
from_addr From email address.
to_addr To email address.
subject The email subject.
STARTTLS Enable/disable STARTTLS functionality. Default is disabled.
remotePort Port number to connect to on the SMTP server.
serverName Server name to use for certificate name verification and when sending SNI extensions.
verifyPeer Set true to verify the server's certificate against a Certificate Authority list. Default if false.
certBuff Buffer containing the certificate data. Default is null.
certBuffSize Size of the buffer containing the certificate data.
certBuffFormat The format of the certificate buffer.

Return values

0 Send failed
1 Send was successful

See also

SendMailAuthStartMIME()
SendMailAuthAddMIME()
SendMailAuthEndMIME()

19.89 SSL/TLS
Modules
• Onboard Certificate Generation
• SSL Error Codes

Enumerations
• enum class ExpireRetCodes : unsigned char { ExpireRetCodes::E_CERT_VALID = 0 , ExpireRetCodes::E_CERT_EXPIRED
= 1 , ExpireRetCodes::E_BAD_EXPIRATION_VALUE = 2 , ExpireRetCodes::E_NO_SYSTEM_TIME = 3 }
Return values for SSL_IsCertExpired().

NetBurner, Inc.
452 Module Documentation

Functions
• int SSL_accept (int fdListen, IPADDR ∗address, uint16_t ∗port, uint16_t timeout, bool waitFor←-
Negotiation=true, bool verifyPeer=false, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0,
uint16_t certBuffFormat=SSL_FILETYPE_PEM, const char ∗commonName=nullptr)
This call is a mirror of the TCP::accept() call.
• bool SSLSocketsAvail ()
Returns whether or not there are any sockets available.
• int FreeSSLSockets ()
Returns the number of currently free SSL sockets.
• int SSL_setsockoption (int fd, int option)
Set SSL TCP socket options.
• int SSL_clrsockoption (int fd, int option)
Clear SSL TCP socket options.
• int SSL_getsockoption (int fd)
Returns the options for the specified SSL TCP socket.
• int SSL_getsocketerror (int fd)
Returns the socket error state for the specified SSL socket.
• int SSL_connect (IPADDR ip, uint16_t localPort, uint16_t remotePort, uint32_t timeout, const char
∗commonName, bool verifyPeer=false, bool waitForNegotiation=true, const unsigned char ∗certBuff=nullptr,
uint32_t certBuffSize=0, uint16_t certBuffFormat=SSL_FILETYPE_PEM, int intf=-1)
SSL mirror of the TCP::connect() call.
• int SSL_makeSecure (int tcpFd, const char ∗commonName, bool verifyPeer=false, bool waitFor←-
Negotiation=true, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM, bool bIsClient=true, uint32_t timeout=WAIT_FOREVER)
SSL mirror of the TCP::connect() call, but uses an existing TCP file descriptor.
• int SSL_negotiate (int tcpFd, const char ∗common_name, bool reuseSessionPort=true, bool verifyPeer=false,
const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuffFormat=SSL_FILETYPE_←-
PEM, bool bIsClient=true)
Executes the TLS negotiation over a given socket, to establish a secure communication channel through that socket.
• int SSLReadWithTimeout (int fd, char ∗cp, int size, uint32_t timeout)
SSL mirror of the ReadWithTiemout() function.
• uint32_t SetMaxSessionReuseTime (uint32_t newLifetimeTicks)
Allows one to specify at runtime what the longest duration that an established session can be used for before new
connections must be fully renegotiated.
• bool IsSSL_CertNKeyValid (const char ∗keyPEM, ssize_t keylen, const char ∗certPEM, ssize_t certlen,
uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Validate candidate certificate and private key.
• bool SSL_AddCertToClientCaList (const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t
certBuffFormat=SSL_FILETYPE_PEM)
Attempts to add a cert to the Certificate Authority List to the client SSL context.
• bool SSL_AddCertToServerCaList (const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t
certBuffFormat=SSL_FILETYPE_PEM)
Attempts to add a cert to the Certificate Authority List to the client SSL context.
• bool SSL_ClearClientCaList ()
Clears certs that have been added to the client's Certificate Authority list.
• bool SSL_ClearServerCaList ()
Clears certs that have been added to the server's Certificate Authority list.
• uint16_t SSLGetRxBufferSpaceUsed (int fd)
Returns the amount of data buffered to be read from the socket.
• uint16_t SSLGetTxBufferAvailSpace (int fd)
Returns the amount of data buffered to be read from the socket.
• void SslInit ()

NetBurner, Inc.
19.89 SSL/TLS 453

This function initializes the SSL library.


• void SSL_DumpSSLSockets ()
Prints the current state of all used sockets to stdio.
• void SSL_ClientReadyCert (const unsigned char ∗cert, const unsigned char ∗key, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Add a key and certificate to the client.
• void SSL_ServerReadyCert (const unsigned char ∗cert, const unsigned char ∗key, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Add a key and certificate to the server.
• ExpireRetCodes SSL_IsCertExpired (unsigned char ∗certBuff, int certLen, uint16_t certBuffFormat=SSL_←-
FILETYPE_PEM)
Returns whether the given certificate has expired or not.
• bool SSL_GetIssuerFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗issBuf, int issBufLen,
uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the issuer from a certificate blob in the PEM format.
• bool SSL_GetSubjectNameFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗subNamBuf, int
subNamBufLen, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the subject name from a certificate blob in the PEM format.
• bool SSL_GetAltNameFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗altNamBuf, int alt←-
NamBufLen, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns an alternate name from a certificate blob in the PEM format.
• bool SSL_GetExpirationDate (unsigned char ∗certBuff, int certLen, unsigned char ∗expBuf, int expBufLen,
uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the expiration data of the certificate in question.
• bool SSL_GetTimeToExpire (unsigned char ∗certBuff, int certLen, uint16_t certBuffFormat, time_t &timeTo←-
Exp)
Returns whether the given certificate has expired or not.
• bool SSL_GetCnFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗comNamBuf, int comNam←-
BufLen, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the common name from a certificate blob in the PEM format.
• const char ∗ GetCertificatePEM ()
Function that returns a pointer to the compiled in server certificate.
• int GetCertificateLen ()
Function that the length of the compiled in server certificate.
• const char ∗ GetPrivateKeyPEM ()
Function that returns a pointer to the compiled in server key.
• int GetPrivateKeyLen ()
Function that the length of the compiled in server key.
• void SslSetVerifyPeerClient (bool verifyPeer)
Sets whether or not verify peer should be enabled on the global SSL client context.
• void SslSetVerifyPeerServer (bool verifyPeer)
Sets whether or not verify peer should be enabled on the global SSL server context.
• bool SSL_IsCertAddedToClientCaList ()
Checks to see if any certificates have been added to the global SSL client context.
• bool SSL_IsCertAddedToServerCaList ()
Checks to see if any certificates have been added to the global SSL server context.

NetBurner, Inc.
454 Module Documentation

Variables
• BOOL(∗ IsSSLfd )(int fd)
Returns whether or not a file descriptor is an SSL file descriptor.
• IPADDR(∗ SSL_GetSocketRemoteAddr )(int fd)
Returns the remote address of this connected socket.
• uint16_t(∗ SSL_GetSocketRemotePort )(int fd)
Returns the remote port of this connected socket.
• IPADDR(∗ SSL_GetSocketLocalAddr )(int fd)
Returns the local address of this connected socket.
• uint16_t(∗ SSL_GetSocketLocalPort )(int fd)
Returns the local port of this connected socket.
• int(∗ SSL_GetSocketInterface )(int fd)
Return the network interface associated with an SSL TCP socket.
• int(∗ SSL_GetRawSocket )(int sslSocketFd)
Returns the TCP file descriptor associated with an SSL socket file descriptor.
• uint16_t(∗ SSL_GetTcpRtxCount )(int i)
Returns the number of re-transmits that have occurred on the specified SSL connection.
• uint32_t(∗ SSL_TcpGetLastRxTime )(int fd)
SSL mirror of TcpGetLastRxTime().
• void(∗ SSL_TcpSendKeepAlive )(int fd)
SSL mirror of TcpSendKeepAlive().
• short(∗ SSL_TcpGetSocketState )(int fd)
Return the current state of a SSL TCP socket.

19.89.1 Detailed Description


The NetBurner SSL/TLS Library

19.89.2 Enumeration Type Documentation

19.89.2.1 ExpireRetCodes

enum class ExpireRetCodes : unsigned char [strong]


Return values for SSL_IsCertExpired().

Enumerator

E_CERT_VALID Certificate not expired.


E_CERT_EXPIRED Certificate expired.
E_BAD_EXPIRATION_VALUE Unable to read the expiration information from the certificate.
E_NO_SYSTEM_TIME The system time has not been set.

19.89.3 Function Documentation

19.89.3.1 FreeSSLSockets()

int FreeSSLSockets ( )
Returns the number of currently free SSL sockets.

NetBurner, Inc.
19.89 SSL/TLS 455

Returns

The number of free SSL sockets.

19.89.3.2 GetCertificateLen()

int GetCertificateLen ( )
Function that the length of the compiled in server certificate.
See the SSL documentation and examples for information on generating a self signed certificate and key. This
function can be overridden to provide the ability to install uploaded certificates.

Returns

The length of the compiled in certificate.

See also

GetCertificatePEM()
GetPrivateKeyLen()

Function that the length of the compiled in server certificate.

Return values

Pointer to the found cert

Function that the length of the compiled in server certificate.

19.89.3.3 GetCertificatePEM()

const char ∗ GetCertificatePEM ( )


Function that returns a pointer to the compiled in server certificate.
See the SSL documentation and examples for information on generating a self signed certificate and key.

Returns

A pointer to the compiled in certificate.

See also

GetPrivateKeyPEM()
GetCertificateLen()

Function that returns a pointer to the compiled in server certificate.

Return values

Pointer to the found cert

Function that returns a pointer to the compiled in server certificate.

19.89.3.4 GetPrivateKeyLen()

int GetPrivateKeyLen ( )
Function that the length of the compiled in server key.
See the SSL documentation and examples for information on generating a self signed certificate and key. This
function can be overridden to provide the ability to install uploaded keys.

NetBurner, Inc.
456 Module Documentation

Returns

The length of the compiled in key.

See also

GetPrivateKeyPEM()
GetCertificateLen()

Function that the length of the compiled in server key.

Return values

Pointer to the found key

Function that the length of the compiled in server key.

19.89.3.5 GetPrivateKeyPEM()

const char ∗ GetPrivateKeyPEM ( )


Function that returns a pointer to the compiled in server key.
See the SSL documentation and examples for information on generating a self signed certificate and key.

Returns

A pointer to the compiled in server key.

See also

GetCertificatePEM()
GetPrivateKeyLen()

Function that returns a pointer to the compiled in server key.

Return values

Pointer to the found key

Function that returns a pointer to the compiled in server key.

19.89.3.6 IsSSL_CertNKeyValid()

bool IsSSL_CertNKeyValid (
const char ∗ keyPEM,
ssize_t keylen,
const char ∗ certPEM,
ssize_t certlen,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Validate candidate certificate and private key.
Determines if the passed in certificate and private key are valid or note.

Parameters

keyPEM A buffer containing the private key


keylen The length of the buffer containing the private key
certPEM A buffer containing the certificate
certlen The length of the buffer containing the certificate
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

NetBurner, Inc.
19.89 SSL/TLS 457

Return values

<code>true</code> Certificate and key passed in are valid


<code>false</code> Certificate and/or key passed in are not valid

19.89.3.7 SetMaxSessionReuseTime()

uint32_t SetMaxSessionReuseTime (
uint32_t newLifetimeTicks )
Allows one to specify at runtime what the longest duration that an established session can be used for before new
connections must be fully renegotiated.
This is a security trade-off feature. It will negatively impact performance to decrease this value. To disable maximum
reuse lifetime, pass the argument as 0. This will force a new negotiation on every connection. Calling this functhyion
will not affect sessions that are currently stored until they have been used to establish a new connection.
The default value used for this purpose on startup is defined in predef.h as the macro SSL_DEFAULT_MAX_←-
SESSION_AGE_TICKS and is set to one hour.

Parameters

newLifetimeTicks How long (in ticks) to allow an established session to be used.

Returns

Returns previously assigned reuse maximum.

19.89.3.8 SSL_accept()

int SSL_accept (
int fdListen,
IPADDR ∗ address,
uint16_t ∗ port,
uint16_t timeout,
bool waitForNegotiation = true,
bool verifyPeer = false,
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM,
const char ∗ commonName = nullptr )
This call is a mirror of the TCP::accept() call.

Parameters

fdListen File descriptor of the TCP listening socket.


∗address IPADDR variable to hold the address of the connecting computer.
∗port Variable to receive the remote port of this connection.
timeout Number of system time ticks to wait for a connection (regular TCP::accept()).
waitForNegotiation Wait for negotiation to complete. Default is true.
verifyPeer Default is false. Set to true to verify the client certificate on connect.
certBuff Buffer containing the certificate data. Default is null.
certBuffSize Size of the buffer containing the certificate data. Default is 0.
certBuffFormat Format of the certificate buffer. Default is SSL_FILETYPE_PEM.
commonName Common name to use for checking certificate validity. Default is null, which will accept
any connection.

NetBurner, Inc.
458 Module Documentation

Return values

>0 The file descriptor of the connected SSL socket


<0 The error code for the failure from SSL Error Codes or TCP Socket Status

See also

SSL_connect()
SSL_GetSocketRemoteAddr()
SSL_GetSocketRemotePort()
SSL_GetSocketLocalAddr()
SSL_GetSocketLocalPort()
IsSSLfd()
SSL_setsockoption()
SSL_clrsockoption()
SSL_getsockoption()

19.89.3.9 SSL_AddCertToClientCaList()

bool SSL_AddCertToClientCaList (
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Attempts to add a cert to the Certificate Authority List to the client SSL context.

Parameters

certBuff A buffer containing the certificate to add.


certBuffSize The size of the cert being passed in.
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>true</code> Successfully add the certificate to the CA List


<code>false</code> Was not able to add the certificate to the CA List

19.89.3.10 SSL_AddCertToServerCaList()

bool SSL_AddCertToServerCaList (
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Attempts to add a cert to the Certificate Authority List to the client SSL context.

Parameters

certBuff A buffer containing the certificate to add.


certBuffSize The size of the cert being passed in.

NetBurner, Inc.
19.89 SSL/TLS 459

Parameters

certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>true</code> Successfully add the certificate to the CA List


<code>false</code> Was not able to add the certificate to the CA List

19.89.3.11 SSL_ClearClientCaList()

bool SSL_ClearClientCaList ( )
Clears certs that have been added to the client's Certificate Authority list.

Return values

<code>true</code> Successfully cleared the Certificate Authority list


<code>false</code> Failed to clear the Certificate Authority list

19.89.3.12 SSL_ClearServerCaList()

bool SSL_ClearServerCaList ( )
Clears certs that have been added to the server's Certificate Authority list.

Return values

<code>true</code> Successfully cleared the Certificate Authority list


<code>false</code> Failed to clear the Certificate Authority list

19.89.3.13 SSL_ClientReadyCert()

void SSL_ClientReadyCert (
const unsigned char ∗ cert,
const unsigned char ∗ key,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Add a key and certificate to the client.

Parameters

cert Pointer to the buffer holding the PEM certificate data


key Pointer to the buffer holding the PEM key data
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

19.89.3.14 SSL_clrsockoption()

int SSL_clrsockoption (

NetBurner, Inc.
460 Module Documentation

int fd,
int option )
Clear SSL TCP socket options.

Parameters

fd Socket file descriptor.


option Socket option to clear: TCP Socket Options.

Returns

A bitmask of the options for the specified socket

See also

SSL_setsockoption()
SSL_getsockoption()

19.89.3.15 SSL_connect()

int SSL_connect (
IPADDR ip,
uint16_t localPort,
uint16_t remotePort,
uint32_t timeout,
const char ∗ commonName,
bool verifyPeer = false,
bool waitForNegotiation = true,
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM,
int intf = -1 )
SSL mirror of the TCP::connect() call.

Parameters
ip The address to connect to.
localPort The local port to use. 0 will pick one
remotePort The remote port to connect to.
timeout The number of ticks to wait for a connection.
∗commonName The common name to use for checking certificate validity passing in NULL will accept any
connection.
verifyPeer Should the client verify the server's certificate against a Certificate Authority list?
waitForNegotiation Should the function wait until the negotiation is complete before returning?
certBuff Buffer containing the certificate data
certBuffSize Size of the buffer containing the certificate data
certBuffFormat The format of the certificate buffer
intf Optional local interface number to use for connection

Return values

>0 The file descriptor of the connected SSL socket


<0 The error code for the failure from SSL Error Codes or TCP Socket Status

NetBurner, Inc.
19.89 SSL/TLS 461

See also

SSL_accept()
SSL_GetSocketRemoteAddr()
SSL_GetSocketRemotePort()
SSL_GetSocketLocalAddr()
SSL_GetSocketLocalPort()
IsSSLfd()
SSL_setsockoption()
SSL_clrsockoption()
SSL_getsockoption()

19.89.3.16 SSL_GetAltNameFromCert()

bool SSL_GetAltNameFromCert (
unsigned char ∗ certBuff,
int certLen,
unsigned char ∗ altNamBuf,
int altNamBufLen,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Returns an alternate name from a certificate blob in the PEM format.

Parameters

certBuff The buffer containing the certificate data


certLen The length of the certificate
altNamBuf The buffer to store the alternate name in
altNamBufLen The length of the buffer where the alternate name will be placed
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>true</code> If successfully retrieved the alternate name from the cert


<code>false</code> If unable to retrieved the alternate name from the cert

19.89.3.17 SSL_GetCnFromCert()

bool SSL_GetCnFromCert (
unsigned char ∗ certBuff,
int certLen,
unsigned char ∗ comNamBuf,
int comNamBufLen,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Returns the common name from a certificate blob in the PEM format.

Parameters

certBuff The buffer containing the certificate data


certLen The length of the certificate
comNamBuf The buffer to store the common name in

NetBurner, Inc.
462 Module Documentation

Parameters

comNamBufLen The length of the buffer where the common name will be placed
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>true</code> If successfully retrieved the common name from the cert


<code>false</code> If unable to retrieved the common name from the cert

19.89.3.18 SSL_GetExpirationDate()

bool SSL_GetExpirationDate (
unsigned char ∗ certBuff,
int certLen,
unsigned char ∗ expBuf,
int expBufLen,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Returns the expiration data of the certificate in question.

Parameters

certBuff The buffer containing the certificate data


certLen The length of the certificate
expBuf The buffer to store the expiration date in
expBufLen The length of the buffer where the expiration date will be placed
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>true</code> If successfully retrieved the alternate name from the cert


<code>false</code> If unable to retrieved the alternate name from the cert

19.89.3.19 SSL_GetIssuerFromCert()

bool SSL_GetIssuerFromCert (
unsigned char ∗ certBuff,
int certLen,
unsigned char ∗ issBuf,
int issBufLen,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Returns the issuer from a certificate blob in the PEM format.

Parameters

certBuff The buffer containing the certificate data


certLen The length of the certificate
issBuf The buffer to store the issuer in

NetBurner, Inc.
19.89 SSL/TLS 463

Parameters

issBufLen The length of the buffer where the issuer will be placed
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>true</code> If successfully retrieved the issuer from the cert


<code>false</code> If unable to retrieved the issuer from the cert

19.89.3.20 SSL_getsocketerror()

int SSL_getsocketerror (
int fd )
Returns the socket error state for the specified SSL socket.

Parameters

fd Socket file descriptor.

Returns

The error state for the specified socket

19.89.3.21 SSL_getsockoption()

int SSL_getsockoption (
int fd )
Returns the options for the specified SSL TCP socket.

Parameters

fd Socket file descriptor.

Returns

A bitmask of the options for the specified socket

See also

SSL_setsockoption()
SSL_clrsockoption()

19.89.3.22 SSL_GetSubjectNameFromCert()

bool SSL_GetSubjectNameFromCert (
unsigned char ∗ certBuff,
int certLen,
unsigned char ∗ subNamBuf,

NetBurner, Inc.
464 Module Documentation

int subNamBufLen,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Returns the subject name from a certificate blob in the PEM format.

Parameters

certBuff The buffer containing the certificate data


certLen The length of the certificate
subNamBuf The buffer to store the subject name in
subNamBufLen The length of the buffer where the subject name will be placed
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>true</code> If successfully retrieved the subject name from the cert


<code>false</code> If unable to retrieved the subject name from the cert

19.89.3.23 SSL_GetTimeToExpire()

bool SSL_GetTimeToExpire (
unsigned char ∗ certBuff,
int certLen,
uint16_t certBuffFormat,
time_t & timeToExp )
Returns whether the given certificate has expired or not.

Parameters

certBuff The buffer containing the certificate data


certLen The length of the certificate
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.
out timeToExp The time the certificate is set to expire

Return values

<code>true</code> If the certificate expiration was found


<code>false</code> If the certificate expiration was not found

19.89.3.24 SSL_IsCertAddedToClientCaList()

bool SSL_IsCertAddedToClientCaList ( )
Checks to see if any certificates have been added to the global SSL client context.
Certificate Authority certificates can be added to the client context during calls to SSL_connect() or with calls to
SSL_AddCertToClientCaList().

NetBurner, Inc.
19.89 SSL/TLS 465

Returns

true If a certificate has been added to the certificate authority list.


false If a certificate has not been added to the certificate authority list.

19.89.3.25 SSL_IsCertAddedToServerCaList()

bool SSL_IsCertAddedToServerCaList ( )
Checks to see if any certificates have been added to the global SSL server context.
Certificate Authority certificates can be added to the server context during calls to SSL_connect() or with calls to
SSL_AddCertToServerCaList().

Returns

true If a certificate has been added to the certificate authority list.


false If a certificate has not been added to the certificate authority list.

19.89.3.26 SSL_IsCertExpired()

ExpireRetCodes SSL_IsCertExpired (
unsigned char ∗ certBuff,
int certLen,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Returns whether the given certificate has expired or not.

Parameters

certBuff The buffer containing the certificate data


certLen The length of the certificate
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

Return values

<code>ExpireRetCodes::E_CERT_←- If the certificate has expired


EXPIRED</code>
<code>ExpireRetCodes::E_CERT_VALID</code> If the certificate has not expired
<code>ExpireRetCodes::E_BAD_EXPIRATION_←- If unable to get the expiration data from the certificate
VALUE</code>
<code>ExpireRetCodes::E_NO_SYSTEM_←- If the system time has not been set
TIME</code>

19.89.3.27 SSL_makeSecure()

int SSL_makeSecure (
int tcpFd,
const char ∗ commonName,
bool verifyPeer = false,
bool waitForNegotiation = true,
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM,

NetBurner, Inc.
466 Module Documentation

bool bIsClient = true,


uint32_t timeout = WAIT_FOREVER )
SSL mirror of the TCP::connect() call, but uses an existing TCP file descriptor.

Parameters

tcpFd The file descriptor for the socket to be secured.


∗commonName The common name to use for checking certificate validity passing in NULL will accept any
connection.
verifyPeer Should the client verify the server's certificate against a Certificate Authority list?
waitForNegotiation Should the function wait until the negotiation is complete before returning?
certBuff Buffer containing the certificate data
certBuffSize Size of the buffer containing the certificate data
certBuffFormat The format of the certificate buffer
bIsClient Perform the TLS negotiation as the Client and not the Server?
timeout The number of timeticks to wait for completion

Return values

>0 The file descriptor of the connected SSL socket


<0 The error code for the failure from SSL Error Codes or TCP Socket Status

See also

SSL_accept()
SSL_GetSocketRemoteAddr()
SSL_GetSocketRemotePort()
SSL_GetSocketLocalAddr()
SSL_GetSocketLocalPort()
IsSSLfd()
SSL_setsockoption()
SSL_clrsockoption()
SSL_getsockoption()

19.89.3.28 SSL_negotiate()

int SSL_negotiate (
int tcpFd,
const char ∗ common_name,
bool reuseSessionPort = true,
bool verifyPeer = false,
const unsigned char ∗ certBuff = nullptr,
uint32_t certBuffSize = 0,
uint16_t certBuffFormat = SSL_FILETYPE_PEM,
bool bIsClient = true )
Executes the TLS negotiation over a given socket, to establish a secure communication channel through that socket.

Parameters

tcpFd The TCP file descriptor to associate the connection with.


∗common_name The comman name to use for checking certificate validity passing in NULL will accept any
connection.

NetBurner, Inc.
19.89 SSL/TLS 467

Parameters

reuseSessionPort Should we look at the port for reuse lookup?


verifyPeer Should the client verify the server's certificate against a Certificate Authority list?
certBuff Buffer containing the certificate data
certBuffSize Size of the buffer containing the certificate data
certBuffFormat The format of the certificate buffer
bIsClient Perform the TLS negotiation as the Client and not the Server?

Return values

>0 The file descriptor of the connected SSL socket


<0 The error code for the failure from SSL Error Codes or TCP Socket Status

See also

SSL_accept()
SSL_GetSocketRemoteAddr()
SSL_GetSocketRemotePort()
SSL_GetSocketLocalAddr()
SSL_GetSocketLocalPort()
IsSSLfd()
SSL_setsockoption()
SSL_clrsockoption()
SSL_getsockoption()

19.89.3.29 SSL_ServerReadyCert()

void SSL_ServerReadyCert (
const unsigned char ∗ cert,
const unsigned char ∗ key,
uint16_t certBuffFormat = SSL_FILETYPE_PEM )
Add a key and certificate to the server.

Parameters

cert Pointer to the buffer holding the PEM certificate data


key Pointer to the buffer holding the PEM key data
certBuffFormat The format of the cert being passed in. Either SSL_FILETYPE_PEM or
WOLFSSL_FILETYPE_ASN1.

19.89.3.30 SSL_setsockoption()

int SSL_setsockoption (
int fd,
int option )
Set SSL TCP socket options.

NetBurner, Inc.
468 Module Documentation

Parameters

fd Socket file descriptor.


option Socket option to set: TCP Socket Options.

Returns

A bitmask of the options for the specified socket

See also

SSL_clrsockoption()
SSL_getsockoption()

19.89.3.31 SSLGetRxBufferSpaceUsed()

uint16_t SSLGetRxBufferSpaceUsed (
int fd )
Returns the amount of data buffered to be read from the socket.

Parameters

fd The socket's file descriptor

Return values

>=0 The number of bytes available to be read


< 0 The requested socket does not exist

19.89.3.32 SSLGetTxBufferAvailSpace()

uint16_t SSLGetTxBufferAvailSpace (
int fd )
Returns the amount of data buffered to be read from the socket.

Parameters

fd The socket's file descriptor

Return values

>=0 The number of bytes available to be read


< 0 The requested socket does not exist

19.89.3.33 SslInit()

void SslInit ( )
This function initializes the SSL library.
Note: It should only be called in the case that you want to verify peer certificates as a client and need to add the

NetBurner, Inc.
19.89 SSL/TLS 469

certificates individually. Otherwise, calls to SSL_connect() will automatically call this function for you.

19.89.3.34 SSLReadWithTimeout()

int SSLReadWithTimeout (
int fd,
char ∗ cp,
int size,
uint32_t timeout )
SSL mirror of the ReadWithTiemout() function.
This function will block until either the time-out expires or at least one byte is available to be read. This function can
be used to read from stdio, TCP sockets, or Serial ports.
Important: This function operates like a read function in that it reads all available bytes and returns. The addition
of a time-out does not cause the function to block until the maximum number of bytes specified in the function call
is available. The application must use the return value of the function to determine how many bytes were read, and
call the function again if necessary.

Parameters

fd The file descriptor number.


∗cp A pointer to the read destination.
size Maximum number of bytes to read.
timeout The number of timer ticks to wait for data.

Return values

0 Invalid buf or size parameters were passed


>0 The number of bytes read
TCP_ERR_TIMEOUT No bytes were read before timeout
TCP_ERR_CLOSING TCP connection is no longer valid, or the SSLSocket_Record no longer exists

See also

ReadWithTimeout()
SSL_negotiate()

19.89.3.35 SslSetVerifyPeerClient()

void SslSetVerifyPeerClient (
bool verifyPeer )
Sets whether or not verify peer should be enabled on the global SSL client context.

Parameters

verifyPeer True if verify should be enabled, or false otherwise.

19.89.3.36 SslSetVerifyPeerServer()

void SslSetVerifyPeerServer (
bool verifyPeer )
Sets whether or not verify peer should be enabled on the global SSL server context.

NetBurner, Inc.
470 Module Documentation

Parameters

verifyPeer True if verify should be enabled, or false otherwise.

19.89.3.37 SSLSocketsAvail()

bool SSLSocketsAvail ( )
Returns whether or not there are any sockets available.

Return values

true If there are sockets available.


false If there are not any sockets available

See also

FreeSSLSockets()

19.89.4 Variable Documentation

19.89.4.1 IsSSLfd

BOOL(∗ IsSSLfd) (int fd) (


int fd ) [extern]
Returns whether or not a file descriptor is an SSL file descriptor.
This function is used to determine if the fd is an SSL connection. It can be used by things like the callback functions
of the web server to determine how secure the fd is before sending sensitive information over it.

Parameters

fd The file descriptor to test.

Return values

TRUE If it is an SSL fd
FALSE If it is not an SSL fd or if there was an error

See also

SSL_GetSocketRemoteAddr()
SSL_GetSocketRemotePort()
SSL_GetSocketLocalAddr()
SSL_GetSocketLocalPort()

19.89.4.2 SSL_GetRawSocket

int(∗ SSL_GetRawSocket) (int sslSocketFd) (


int sslSocketFd ) [extern]
Returns the TCP file descriptor associated with an SSL socket file descriptor.

NetBurner, Inc.
19.89 SSL/TLS 471

Parameters

sslSocketFd The socket file descriptor.

Returns

The TCP file descriptor associated with the SSL socket.

See also

SSL_GetSocketInterface()

19.89.4.3 SSL_GetSocketInterface

int(∗ SSL_GetSocketInterface) (int fd) (


int fd ) [extern]
Return the network interface associated with an SSL TCP socket.

Parameters

fd The socket file descriptor.

Returns

The network interface number (undefined for listening sockets)

See also

TcpGetSocketInterface()

19.89.4.4 SSL_GetSocketLocalAddr

IPADDR(∗ SSL_GetSocketLocalAddr) (int fd) (


int fd ) [extern]
Returns the local address of this connected socket.
This function is used to retrieve the local address of an SSL fd. This function will also work correctly if you pass in
an fd that is a TCP connection. This allows you to use one set of code for both normal TCP and SSL connections.

Parameters

fd The file descriptor to test.

Returns

The local IP address of the TCP or SSL connection, or 0 otherwise.

See also

IsSSLfd()
SSL_GetSocketRemotePort()
SSL_GetSocketRemoteAddr()
SSL_GetSocketLocalPort()

NetBurner, Inc.
472 Module Documentation

19.89.4.5 SSL_GetSocketLocalPort

uint16_t(∗ SSL_GetSocketLocalPort) (int fd) (


int fd ) [extern]
Returns the local port of this connected socket.
This function is used to retrieve the local port of an SSL fd. This function will also work correctly if you pass in an fd
that is a TCP connection. This allows you to use one set of code for both normal TCP and SSL connections.

Parameters

fd The file descriptor to test.

Returns

The local port number of TCP or SSL connection, or 0 otherwise.

See also

IsSSLfd()
SSL_GetSocketRemoteAddr()
SSL_GetSocketRemotePort()
SSL_GetSocketLocalPort()

19.89.4.6 SSL_GetSocketRemoteAddr

IPADDR(∗ SSL_GetSocketRemoteAddr) (int fd) (


int fd ) [extern]
Returns the remote address of this connected socket.
This function is used to retrieve the remote address of an SSL fd. This function will also work correctly if you pass in
an fd that is a TCP connection. This allows you to use one set of code for both normal TCP and SSL connections.

Parameters

fd The file descriptor to test.

Returns

IP address of the TCP or SSL connection, or 0 otherwise.

See also

IsSSLfd()
SSL_GetSocketRemotePort()
SSL_GetSocketLocalAddr()
SSL_GetSocketLocalPort()

19.89.4.7 SSL_GetSocketRemotePort

uint16_t(∗ SSL_GetSocketRemotePort) (int fd) (


int fd ) [extern]
Returns the remote port of this connected socket.
This function is used to retrieve the remote port of an SSL fd. This function will also work correctly if you pass in an
fd that is a TCP connection. This allows you to use one set of code for both normal TCP and SSL connections.

NetBurner, Inc.
19.89 SSL/TLS 473

Parameters

fd The file descriptor to test.

Returns

The remote port number of TCP or SSL connection, or 0 otherwise.

See also

IsSSLfd()
SSL_GetSocketRemoteAddr()
SSL_GetSocketLocalAddr()
SSL_GetSocketLocalPort()

19.89.4.8 SSL_GetTcpRtxCount

uint16_t(∗ SSL_GetTcpRtxCount) (int i) (


int i ) [extern]
Returns the number of re-transmits that have occurred on the specified SSL connection.

Parameters

i The socket file descriptor.

Returns

The number of system time ticks since the last packet was received on the connection.

See also

GetTcpRtxCount();

19.89.4.9 SSL_TcpGetLastRxTime

uint32_t(∗ SSL_TcpGetLastRxTime) (int fd) (


int fd ) [extern]
SSL mirror of TcpGetLastRxTime().

Parameters

fd The socket file descriptor.

Returns

The value of system Time Ticks when the last packet was received on the connection.

See also

SSL_TcpSendKeepAlive()
TcpGetLastRxTime()

NetBurner, Inc.
474 Module Documentation

19.89.4.10 SSL_TcpGetSocketState

short(∗ SSL_TcpGetSocketState) (int fd) (


int fd ) [extern]
Return the current state of a SSL TCP socket.

Parameters

fd Socket file descriptor.

Returns

The current state of the socket: TCP Socket State

See also

TcpGetSocketState()

19.89.4.11 SSL_TcpSendKeepAlive

void(∗ SSL_TcpSendKeepAlive) (int fd) (


int fd ) [extern]
SSL mirror of TcpSendKeepAlive().

Parameters

fd The socket file descriptor.

See also

SSL_TcpGetLastRxTime()
TcpSendKeepAlive()

19.90 STD File System Seek Codes


Macros
• #define FS_SEEK_SET 0
Beginning of file.
• #define FS_SEEK_CUR 1
Current position of the file pointer.
• #define FS_SEEK_END 2
End of file.

19.90.1 Detailed Description


The codes used when calling f_seek().

19.91 Save Config Record Errors


Macros
• #define SAVE_CONF_ERR_SUCCESS 0
Success.

NetBurner, Inc.
19.92 Scan Request Errors 475

• #define SAVE_CONF_ERR_INVALID_CONFIG_NUM -1
Invalid configuration number.
• #define SAVE_CONF_ERR_NOT_CONFIGURED -2
Not configured.
• #define SAVE_CONF_ERR_UNKNOWN 1
Unknown error.

19.91.1 Detailed Description

19.92 Scan Request Errors


Macros
• #define SCAN_ERR_SUCCESS 0
Success.
• #define SCAN_ERR_MSG_LENGTH -1
Invalid message length.
• #define SCAN_ERR_IN_PROGRESS -2
Scan in progress.
• #define SCAN_ERR_SSID_LEN_LONG -3
SSID length too long.
• #define SCAN_ERR_INVALID_TABLE -4
Invalid table.
• #define SCAN_ERR_INVALID_OPTION -5
Invalid option.
• #define SCAN_ERR_TOO_MANY_CHANNELS -6
Too many channels.
• #define SCAN_ERR_UNKNOWN 1
Unknown error.

19.92.1 Detailed Description

19.93 Security Options


Macros
• #define SEC_VALUE_OPEN (0x00)
Option list security value: Open network.
• #define SEC_VALUE_WEP (0x01)
Option list security value: WEP.
• #define SEC_VALUE_WPA (0x02)
Option list security value: WPA.
• #define SEC_VALUE_WPA2 (0x03)
Option list security value: WPA2.
• #define SEC_VALUE_WPS (0x04)
Option list security value: WPS.
• #define SEC_VALUE_ANY (0xFE)
Option list security value: Any, used to connect as a client regardless of how security is configured for AP.
• #define SEC_VALUE_UNKNOWN (0xFF)
Option list security value: Unknown security.

NetBurner, Inc.
476 Module Documentation

19.93.1 Detailed Description

19.94 Serial Interfaces


Modules
• Serial Port Error Codes

Macros
• #define ADDR_ESCAPE_CHAR (0xFF)
Address escape character.
• #define SimpleOpenSerial(p, b) OpenSerial(p, b, 1, 8, eParityNone)
Simple open a serial port.

Enumerations
• enum parity_mode {
eParityNone , eParityOdd , eParityEven , eParityMulti ,
eParityMultiOdd , eParityMultiEven }
Serial Parity Modes.

Functions
• int OpenSerial (int portnum, unsigned int baudrate, int stop_bits, int data_bits, parity_mode parity)
Open a serial port.
• int OpenDefaultSerial ()
Opens the Default serial port as defined by the Boot Config settings.
• void SerialExpandRxBuffer (int fd, int nb)
Expand the received serial buffer.
• int SerialClose (int portnum)
Close a serial port.
• void SerialEnableTxFlow (int port, int enab)
Enable transmit software flow control on the specified UART.
• void SerialEnableRxFlow (int port, int enab)
• void SerialEnableHwTxFlow (int port, int enab)
• void SerialEnableHwRxFlow (int port, int enab)
• void Serial485HalfDupMode (int port, int enab)
• void SendBreak (int port, uint32_t time)
• int serwriteaddress (int fd, const char c)
• int GetUartErrorReg (int fd)
• void SetRTS (int port, bool val)
• BOOL SerialSendComplete (int fd)

19.94.1 Detailed Description


The NetBurner Serial

19.94.2 Macro Definition Documentation

NetBurner, Inc.
19.94 Serial Interfaces 477

19.94.2.1 SimpleOpenSerial

#define SimpleOpenSerial(
p,
b ) OpenSerial(p, b, 1, 8, eParityNone)
Simple open a serial port.
Select the UART number and baud rate, default parameters will be 1 stop bit, no parity, 8 data bits.

Parameters

p The UART to open. First port is 0. The maximum number is platform dependent
b The speed of the serial port in bits per second

See also

OpenSerial()

19.94.3 Enumeration Type Documentation

19.94.3.1 parity_mode

enum parity_mode
Serial Parity Modes.

Enumerator
eParityNone No parity.
eParityOdd Odd parity.
eParityEven Even parity.
eParityMulti Multi parity.
eParityMultiOdd Multi mode, Odd parity.
eParityMultiEven Multi mode, Even parity.

19.94.4 Function Documentation

19.94.4.1 GetUartErrorReg()

int GetUartErrorReg (
int fd )
Gets the UART error register. This is only applicable on select platforms. Any errors are added to this register in a
logical OR operation. Calling this function to read the error status will clear the register.
Bit Description
3 Received break 2 Framing error 1 Parity error 0 Overrun error
fd - The file descriptor associated with the UART serial port whose error register is to be retrieved.
return - The value of the error register if successful (positive int - the bitwise values are represented by the UART←-
_ERR_∗ definitions found near the top of this file); otherwise, one of the error codes is returned: SERIAL_ERR_←-
NOSUCH_PORT (-1) SERIAL_ERR_PORT_NOTOPEN (-2)

19.94.4.2 OpenDefaultSerial()

int OpenDefaultSerial ( )
Opens the Default serial port as defined by the Boot Config settings.

NetBurner, Inc.
478 Module Documentation

This function opens the Default serial port as defined by the Boot Config settings. It is called automatically by the
system as part of the system initialization process. Unlike OpenSerial and SimpleOpenSerial, OpenDefaultSerial
will configure the Tx and Rx pins to the Boot Config settings.

Returns

The file descriptor of the default serial port ( > 0), or Serial Port Error Codes

See also

OpenSerial()

19.94.4.3 OpenSerial()

int OpenSerial (
int portnum,
unsigned int baudrate,
int stop_bits,
int data_bits,
parity_mode parity )
Open a serial port.
This function opens a serial port. Note that functions to open a serial port, such as OpenSerial() and
SimpleOpenSerial(), must be called before any functions or pin assignments that configure the operation of
the serial port. You must also configure all pins that have the same UART capability. For example, if UART 1 TX
can be configured to come out on more than one pin (as a second or third alternate function), you must set those
pins to some function other than UART 1 TX. This is because the functions that open a serial port will configure all
serial port functions to default operation and default pins. For example, hardware flow control will be off, and the
default pin assignments will be used on those platform that have multiple outputs.

Parameters

portnum The UART to open. First port is 0. The maximum number is platform dependent
baudrate The speed of the serial port in bits per second
stop_bits The number of stop bits, 1 or 2
data_bits The number of data bits sent per character or frame: 5, 6, 7 or 8
parity The type of parity checking to use: eParityNone, eParityEven, eParityOdd or eParityMulti

Returns

The file descriptor of the serial port ( > 0), or Serial Port Error Codes

See also

SimpleOpenSerial()

19.94.4.4 SendBreak()

void SendBreak (
int port,
uint32_t time )
Sets a break in the UART transmission for a given period of time. The break starts when character transmission
completes. The break is delayed until any character in the transmitter shift register is sent. Any character in the
transmitter holding register is sent after the break.
Note: This feature may not be supported on all UART modules. Please refer to the processor's datasheet for details
on supported features.

NetBurner, Inc.
19.94 Serial Interfaces 479

port - The UART whose transmitter will be forced low (start break). time - Specifies the amount of time in ticks that
the break will hold; when time expires, the break will be stopped; 20 ticks equal 1 second by default.
return - Nothing to return.

19.94.4.5 Serial485HalfDupMode()

void Serial485HalfDupMode (
int port,
int enab )
Enables or disables RS-485 half-duplex mode. Full-duplex mode is automatically enabled when half-duplex mode
is disabled. This must be explicitly called before RS-485 functionality can be used. Jumpers may also be needed
depending on the hardware device and/or development board used.
port - The UART port to use; the UART that can only be used for RS-485 depends on the platform (e.g., MOD52xx
mounted on the MOD-DEV-100 development board use only UART 0 for RS-485, CB34-EX use only UART 1 for
RS-485). enab - '0' disables half-duplex (enables full-duplex); '1' enables half- duplex (disables full-duplex)
return - Nothing to return.

19.94.4.6 SerialClose()

int SerialClose (
int portnum )
Close a serial port.

Parameters

portnum The UART to close. First port is 0. The maximum number is platform dependent

Returns

0 if successful, otherwise Serial Port Error Codes

See also

OpenSerial()

19.94.4.7 SerialEnableHwRxFlow()

void SerialEnableHwRxFlow (
int port,
int enab )
Enables or disables request-to-send hardware flow control on receive (RxRTS). When enabled, receive throttles
the transmitter on the other end. Jumpers may also be needed to enable the RxRTS line depending on the device
and/or development board used.
(NB Device) Rx <–<–< Tx (Other Device) (NB Device) RxRTS >-->--> TxCTS (Other Device)
port - The UART whose flow control will be toggled. enab - '0' disables flow control; '1' (or any non-zero number)
will enable it.
return - Nothing to return.

19.94.4.8 SerialEnableHwTxFlow()

void SerialEnableHwTxFlow (
int port,
int enab )
Enables or disables clear-to-send hardware flow control on transmit (TxCTS). When enabled, transmit is throttled
by the receiver on the other end. Jumpers may also be needed to enable the TxCTS line depending on the device
and/or development board used.
(NB Device) Tx >-->--> Rx (Other Device) (NB Device) TxCTS <–<–< RxRTS (Other Device)

NetBurner, Inc.
480 Module Documentation

Note: Calling this function to disable Tx hardware flow control after enabling RS-485 full-duplex mode configures for
RS-422 mode (Tx stays actively driven).
port - The UART whose flow control will be toggled. enab - '0' disables flow control; '1' (or any non-zero number)
will enable it.
return - Nothing to return.

19.94.4.9 SerialEnableRxFlow()

void SerialEnableRxFlow (
int port,
int enab )
Enables or disables software flow control (XON/XOFF) on receive. When enabled, the NetBurner device will send
special XON and XOFF characters to another device in order to control the flow of incoming data.
port - The UART whose flow control will be toggled. enab - '0' disables flow control; '1' (or any non-zero number)
will enable it.
return - Nothing to return.

19.94.4.10 SerialEnableTxFlow()

void SerialEnableTxFlow (
int port,
int enab )
Enable transmit software flow control on the specified UART.
Enables or disables software flow control (XON/XOFF) on transmit. When enabled, the NetBurner device will
recognize the special XON and XOFF characters being sent from another device in order to throttle the output.

Parameters
port UART number
enab 0 disables flow control, 1 enables flow control

19.94.4.11 SerialExpandRxBuffer()

void SerialExpandRxBuffer (
int fd,
int nb )
Expand the received serial buffer.
This function expands the number of buffer descriptors the specific serial port is allowed to use. Each buffer
descriptor counts for 1500 bytes fo setting this to 10 would make the serial Rx buffer 15000 bytes.

19.94.4.12 SerialSendComplete()

BOOL SerialSendComplete (
int fd )
Determines if data waiting in transmitter holding/shift registers are already sent out.
return - True if finished, false if data still sending

19.94.4.13 serwriteaddress()

int serwriteaddress (
int fd,
const char c )
Sends an address character via the UART port number associated with the given file descriptor. This function can
only be utilized if the UART is initialized in multidrop mode.
fd - The file descriptor associated with the UART serial port that will be used. c - The address character to be sent.

NetBurner, Inc.
19.95 Serial Port Error Codes 481

return - '1' if successful; otherwise, one of the error codes is returned (note that SERIAL_ERR_PORT_NOTOPEN
is also returned if UART is not initialized to be in multidrop mode): SERIAL_ERR_NOSUCH_PORT (-1) SERIAL←-
_ERR_PORT_NOTOPEN (-2)

19.94.4.14 SetRTS()

void SetRTS (
int port,
bool val )
Sets or clears the Request To Send signal for the specified serial port.
port - The UART port whose RTS signal will be set or cleared. (0 or 1) val - The Boolean value to configure the
signal; TRUE sets it, while FALSE clears it.
return - Nothing to return.

19.95 Serial Port Error Codes


Macros
• #define SERIAL_ERR_NOSUCH_PORT (-1)
Port number does not exist.
• #define SERIAL_ERR_PORT_NOTOPEN (-2)
Port is not open.
• #define SERIAL_ERR_PORT_ALREADYOPEN (-3)
Port is already open.
• #define SERIAL_ERR_PARAM_ERROR (-4)
Parameter error.

19.95.1 Detailed Description

19.96 Shutdown Notifications


Modules
• ShutdownReasons
Shutdown Reasons.

Functions
• bool NBApproveShutdown (int reason)
Approve action that will result in a reboot.
• void NBFaultNotify ()
Emergency notification of a fault shutdown.

19.96.1 Detailed Description


The NBApproveShutdown callback function can be used by an application to put the system in a safe state before
an application update, configuration update, or reboot event occurs. For example, closing active TCP sockets,
ensuring Flash and/or file system write operations are complete, and putting critical peripherals in a safe state. The
NBApproveShutdown() function as a weak reference to a system function that always returns true by default. If an
application creates its own function using the same signature, that function will be used instead.
A reason for the reboot request is passed to the function. The system will automatically call NBapproveShutdown()
for the following reasons:
#define SHUTDOWN_CODEUPDATE (1) // A code update is requested
#define SHUTDOWN_CONFIGURE_REBOOT (2) // Configuration values have been modified with a requested reboot
An application can choose to ignore the parameters or add its own. For custom reasons, the application should call
NBApproveShutdown() with the appropriate reason:
// Custom reboot reason. System reasons start at 1, so pick something much larger

NetBurner, Inc.
482 Module Documentation

#define SHUTDOWN_CUSTOM_REBOOT 100


if( NBApproveShutdown(SHUTDOWN_CUSTOM_REBOOT))
{
OSTimeDly(TICKS_PER_SECOND * 5);
ForceReboot();
}

19.96.2 Function Documentation

19.96.2.1 NBApproveShutdown()

bool NBApproveShutdown (
int reason )
Approve action that will result in a reboot.

Note

Called for application updates or configuration changes that include the reboot option

This function will be called when the configuration values have changed with the option to reboot, or for an applica-
tion update (always requires a reboot).
If the process fails at some time after this notification is approved, the system may not execute a reboot. This
function is satisfied as a weak reference in the NetBurner library. In order to use it in your application, create a
function of the same name (callback function).

Parameters

reason The reason for the shutdown request (ShutdownReasons )

Return values

true Ok to proceed with the modification and reboot


false Abort the update

19.96.2.2 NBFaultNotify()

void NBFaultNotify ( )
Emergency notification of a fault shutdown.

Note

Called after a critical error, such as a trap or memory fault before a reboot

If the system has a critical fault of some kind it will call this function before rebooting. Since this is a sever critical
fault, the function is being called in an exception context with a very small stack. It should execute whatever is
necessary and return immediately with a minimal number of variables.
It is extremely limited in the actions it can perform. It cannot execute:

• Any RTOS functions

• printf family functions

• Writes to network sockets

• TCP or UDP functions

• Writes to serial ports

• RTOS delay functions

NetBurner, Inc.
19.98 Signed Application Update 483

• Writes to Flash memory

• File system operations

Since this is a critical fault condition and the system is unstable, writing directly to I/O registers has the most chance
of success.

19.97 ShutdownReasons
Shutdown Reasons.

Macros
• #define SHUTDOWN_CODEUPDATE (1)
A code update is requested.
• #define SHUTDOWN_CONFIGURE_REBOOT (2)
Configuration values have been modified with a requested reboot.

19.97.1 Detailed Description


Shutdown Reasons.

19.98 Signed Application Update


Modules
• NBUpdate Function Return Values

Functions
• void RegisterAppSigningPublicKey (const char ∗pKey)
Enable APP Signing by registering a RSA PEM or DER format public key.
• int ProgramApplication (uint32_t where, uint8_t ∗pAppImage)
Program an appliction image into Flash memory.
• int UpdateFromStream (int fd, AppUpdateRecord ∗&pu, uint32_t timeout)
Program/update an appliction image from a data stream.

19.98.1 Detailed Description


19.98.2 Function Documentation

19.98.2.1 ProgramApplication()

int ProgramApplication (
uint32_t where,
uint8_t ∗ pAppImage )
Program an appliction image into Flash memory.

Parameters
where Location in Flash memory
pAppImage Pointer to the application image to program

NetBurner, Inc.
484 Module Documentation

Return values

0 Success
-1 Application image pointer invalid
-2 Invalid platform header

19.98.2.2 RegisterAppSigningPublicKey()

void RegisterAppSigningPublicKey (
const char ∗ pKey )
Enable APP Signing by registering a RSA PEM or DER format public key.
This function should be called BEFORE the init() function if you want to guarantee security. It is ok to register a
temporary text blob early, then overwrite it once the key via other means.

Parameters
pKey Pointer to the public key to register

19.98.2.3 UpdateFromStream()

int UpdateFromStream (
int fd,
AppUpdateRecord ∗& pu,
uint32_t timeout )
Program/update an appliction image from a data stream.

Parameters

fd File descriptor of data stream


pu Application record
timeout Timeout value in system time ticks (eg TICKS_PER∗SECOND ∗ 10)

Return values

0 Success
-1 Application image pointer invalid
-2 Invalid platform header

19.99 Stopwatch Timer


Classes
• class StopWatch
Stopwatch for timing events.

19.99.1 Detailed Description


The StopWatch class can be used to create a StopWatch object that can time events. Please refer to the Stopwatch
example in \nburn\examples
Example

NetBurner, Inc.
19.100 Stream Update 485

StopWatch myStopwatch;
myStopwatch.Start();
for ( volatile int i = 0; i < numLoop; i++ )
{
count++;
}
myStopwatch.Stop();

See also

Interval Timer
High Resolution Delay Timer
OSTimeDly()

19.100 Stream Update


Modules
• Stream Update Return Values

Functions
• int ReadBinaryApplicationCodeFromStream (int fd)
Read a binary application image from an input stream and program flash memory.
• int ReadS19ApplicationCodeFromStream (int fd)
Read an ASCII application image in s-record .s19 format from an input stream and program flash memory.

19.100.1 Detailed Description


Functions to read an application form a source with a file descriptor. Useful for programming/updating an application
image from sources such as flash memory cards, posts from other devices, and files received from FTP.

19.100.2 Function Documentation

19.100.2.1 ReadBinaryApplicationCodeFromStream()

int ReadBinaryApplicationCodeFromStream (
int fd )
Read a binary application image from an input stream and program flash memory.
Read a binary application image from an input stream and program the application image in flash memory. Flash
memory will not be modified unless the entire application is received without error.
A reboot is required to run the new application. Before any reboot, the running application should free, close and
clean up any items necessary to put the device in a safe state. For example, it would be better to close active TCP
or FTP connections rather than just reset so that any connected clients can close normally. If you wish to reboot
from a running application you can use the
void ForceReboot()
function ForceReboot().

Parameters

fd The File Descriptor to read the input data stream from

Returns

Stream Update Return Values

NetBurner, Inc.
486 Module Documentation

19.100.2.2 ReadS19ApplicationCodeFromStream()

int ReadS19ApplicationCodeFromStream (
int fd )
Read an ASCII application image in s-record .s19 format from an input stream and program flash memory.
Read a ASCII application image in s-record .s19 format from an input stream and program the application image in
flash memory. Flash memory will not be modified unless the entire application is received without error.
A reboot is required to run the new application. Before any reboot, the running application should free, close and
clean up any items necessary to put the device in a safe state. For example, it would be better to close active TCP
or FTP connections rather than just reset so that any connected clients can close normally. If you wish to reboot
from a running application you can use the
void ForceReboot()
function ForceReboot().

Parameters

fd The File Descriptor to read the input data stream from

Returns

Stream Update Return Values

19.101 Stream Update Return Values


Macros
• #define STREAM_UP_FAIL (0)
Action failed.
• #define STREAM_UP_OK (1)
Action succeeded.

19.101.1 Detailed Description

19.102 System Functions


NetBurner General System Functions.

Functions
• int SaveUserParameters (void ∗pCopyFrom, int len)
Save data to the on-chip flash memory User Parameter area.
• void ∗ GetUserParameters (void)
Returns a void pointer to the user parameter area.
• const char ∗ GetReleaseTag ()
Returns the NNDK release tag information.

19.102.1 Detailed Description


NetBurner General System Functions.

19.102.2 Function Documentation

NetBurner, Inc.
19.103 TCP 487

19.102.2.1 GetReleaseTag()

const char ∗ GetReleaseTag ( )


Returns the NNDK release tag information.

Returns

Pointer to a string representing the development tools release tag

19.102.2.2 GetUserParameters()

void ∗ GetUserParameters (
void )
Returns a void pointer to the user parameter area.
On most platforms the total amount of space is 8k bytes. Typically used to retrieve a structure.
This function is here for reverse compatibility with releases prior to NetBurner 3.0. Alternatives are to use the 3.0
configuration tree, or the EFFS STD file system.

Returns

Void pointer to the User Parameter area in flash memory

See also

SaveUserParameters()

19.102.2.3 SaveUserParameters()

int SaveUserParameters (
void ∗ pCopyFrom,
int len )
Save data to the on-chip flash memory User Parameter area.
On most platforms the total amount of space is 8k bytes. Typically used to save a structure.
This function is here for reverse compatibility with releases prior to NetBurner 3.0. Alternatives are to use the 3.0
configuration tree, or the EFFS STD file system.

Parameters

pCopyFrom Pointer to the data to copy and save


len Length of data

Returns

The number of items copied, or <= 0 on failure

See also

GetUserParameters()

19.103 TCP
Modules
• TCP Notify
• TCP Socket Options
• TCP Socket State
• TCP Socket Status

NetBurner, Inc.
488 Module Documentation

Functions
• int accept (int listening_socket, IPADDR ∗address, uint16_t ∗port, uint16_t timeout)
Accept an incoming connection from a listening socket.
• int connect (const IPADDR &ipAddress, uint16_t remotePort, uint32_t timeout)
Make an outgoing TCP connection to a remote host.
• int connectvia (const IPADDR &ipAddress, uint16_t remotePort, uint32_t timeout, const IPADDR &localIp←-
Address)
Make an outgoing TCP connection to a remote host using the specified local interface IP address.
• int connectvia (const IPADDR &ipAddress, uint16_t remotePort, uint32_t timeout, int ifnum)
Make an outgoing TCP connection to a remote host using the specified local interface number.
• int connectwlocal (const IPADDR &ipAddress, uint16_t localPort, uint16_t remotePort, uint32_t timeout, const
IPADDR &localIpAddress=IPADDR::NullIP(), int intf=-1)
Make an outgoing TCP connection to a remote host using the specified local interface number or IP address.
• int listen (const IPADDR &addr, uint16_t port, uint8_t maxpend=5)
Listen for incoming connections on the specified network interface IP address.
• int listenvia (const IPADDR &addr, uint16_t port, int ifn, uint8_t maxpend=5)
Listen for incoming connections on the specified network interface IP address.
• int listenvia (const IPADDR &addr, uint16_t port, const IPADDR &localIpAddress, uint8_t maxpend=5)
Listen for incoming connections on the specified network interface IP address.
• int NoBlockConnect (const IPADDR &ipAddress, uint16_t remotePort)
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.
• int NoBlockConnectVia (const IPADDR &ipAddress, uint16_t remotePort, const IPADDR &interfaceIp←-
Address=IPADDR::NullIP())
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.
• int NoBlockConnectVia (const IPADDR &ipAddress, uint16_t remotePort, int ifnum)
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.
• int NoBlockConnectwlocal (const IPADDR &ipAddress, uint16_t localPort, uint16_t remotePort, IPADDR
interfaceIpAddress=IPADDR::NullIP(), int ifn=-1)
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.
• IPADDR GetSocketRemoteAddr (int fd)
Returns the IP address of the remote host associated with the specified file descriptor.
• IPADDR GetSocketLocalAddr (int fd)
Returns the IP address of the local interface associated with the connection.
• uint16_t GetSocketRemotePort (int fd)
Returns the port number of the remote host associated with the connection.
• uint16_t GetSocketLocalPort (int fd)
Returns the local port number associated with the connection.
• uint32_t TcpGetLastRxTime (int fd)
Returns the value of system Time Ticks when the last packet was received. Used for the TCP Keep Alive feature.
• void TcpSendKeepAlive (int fd)
Send a TCP keep alive packet to a remote host.

NetBurner, Inc.
19.103 TCP 489

• uint32_t TcpGetLastRxInterval (int fd)


Returns the number of system Time Ticks since the last packet was received. This is the difference between the
current system time and lastRxTime of the socket.
• int GetTcpRtxCount (int fd)
Returns the number of re-transmits that have occurred on the specified connection.
• uint8_t SetOutOfOrderBuffers (int fd, uint8_t max)
Set the maximum number of out-of-order TCP buffers for the specified TCP socket.
• int setsockoption (int fd, int option)
Set TCP socket options.
• int clrsockoption (int fd, int option)
Clear TCP socket options.
• int getsockoption (int fd)
Returns the options for the specified TCP socket.
• int SetSocketUnackBuffers (int fd, uint8_t val)
Set the maximum number of outbound TCP buffers in the transmit un-acknowledged list for the specified TCP socket.
• int SetSocketRxBuffers (int fd, int n)
Set the number of TCP receive buffers for the specified TCP socket.
• int SetSocketTxBuffers (int fd, int n)
Set the number of TCP transmit buffers for the specified TCP socket.
• int abortsocket (int fd)
Execute an abort on the specified TCP socket.
• int SockReadWithTimeout (int fd, char ∗buf, int nbytes, uint32_t timeout)
Attempt to read from a TCP socket until the timeout expires.
• char SocketPeek (int fd)
Returns the next char that would be read, 0 if no data.
• int TcpGetSocketInterface (int fd)
Return the network interface associated with a TCP socket.
• uint8_t TcpGetSocketState (int fd)
Return the current state of a TCP socket.
• uint16_t TcpGetRxBufferSpaceUsed (int fd)
Returns the number of bytes used in a socket's RX buffer.
• uint16_t TcpGetTxBufferAvailSpace (int fd)
Returns the number of bytes available in a socket's TX buffer.
• BOOL TcpAllDataAcked (int socket)
Check the data acknowledged state of a socket.
• BOOL WaitForSocketFlush (int fd, uint32_t ticks)
Wait for a socket flush operation to complete. A socket is flushed if all sent data has been acknowledged.

19.103.1 Detailed Description


19.103.2 Function Documentation

19.103.2.1 abortsocket()

int abortsocket (
int fd )
Execute an abort on the specified TCP socket.

Parameters

fd Socket file descriptor

NetBurner, Inc.
490 Module Documentation

Returns

TCP Socket Status

19.103.2.2 accept()

int accept (
int listening_socket,
IPADDR ∗ address,
uint16_t ∗ port,
uint16_t timeout )
Accept an incoming connection from a listening socket.
A socket must be listening in order to accept a TCP connection, and a connection request must be accepted before
it can be used. Each time a connection request is accepted, a slot is freed in the listen pending queue for that
socket.

Parameters

listening_socket The listening socket from which to accept the connection.


∗address Pointer to an IPADDR object that can store the source IP address of the connection. Can be
NULL.
∗port Pointer to a variable to store the source port number of the connection. Can be NULL.
timeout Number of system Time Ticks to wait. A value of 0 waits forever. For example,
TICKS_PER_SECOND ∗ 5 waits five seconds.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

listen(), close()

19.103.2.3 clrsockoption()

int clrsockoption (
int fd,
int option )
Clear TCP socket options.

Parameters

fd Socket file descriptor.


option Socket option to clear: TCP Socket Options.

Returns

A bitmask of the options for the specified socket.

See also

setsockoption(), getsockoption(), SetSocketUnackBuffers(), SetSocketRxBuffers(), SetSocketTxBuffers()

NetBurner, Inc.
19.103 TCP 491

19.103.2.4 connect()

int connect (
const IPADDR & ipAddress,
uint16_t remotePort,
uint32_t timeout ) [inline]
Make an outgoing TCP connection to a remote host.

Parameters
ipAddress Remote IP address.
remotePort Remote port number.
timeout Timeout in system time ticks (use TICKS_PER_SECOND macro).

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

connectvia(), connectwlocal()

19.103.2.5 connectvia() [1/2]

int connectvia (
const IPADDR & ipAddress,
uint16_t remotePort,
uint32_t timeout,
const IPADDR & localIpAddress ) [inline]
Make an outgoing TCP connection to a remote host using the specified local interface IP address.
The connect() function automatically uses the default network interface. The connectvia() function enables the
application to specify a particular local network interface.

Parameters
ipAddress Remote IP address .
remotePort Remote port number.
timeout Timeout in system time ticks (use TICKS_PER_SECOND macro).
localIpAddress IP address of the local interface. If a value of IPADDR::NULL() is used, it will attempt to use
the local interface associated with the remote IP address.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

connect(), connectwlocal()

19.103.2.6 connectvia() [2/2]

int connectvia (
const IPADDR & ipAddress,

NetBurner, Inc.
492 Module Documentation

uint16_t remotePort,
uint32_t timeout,
int ifnum ) [inline]
Make an outgoing TCP connection to a remote host using the specified local interface number.
The connect() function automatically uses the default network interface. The connectvia() function enables the
application to specify a particular local network interface.

Parameters
ipAddress Remote IP address.
remotePort Remote port number.
timeout Timeout in system time ticks (use TICKS_PER_SECOND macro).
ifnum The local interface number. The interface number will override all routing based on the source
and destination IP address.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

connect(), connectwlocal()

19.103.2.7 connectwlocal()

int connectwlocal (
const IPADDR & ipAddress,
uint16_t localPort,
uint16_t remotePort,
uint32_t timeout,
const IPADDR & localIpAddress = IPADDR::NullIP(),
int intf = -1 ) [inline]
Make an outgoing TCP connection to a remote host using the specified local interface number or IP address.

Warning

Although this function that allows a local port number parameter for extreme edge cases, local port numbers
should be avoided. Local port numbers create connectivity failures when a remote host has a half open socket
condition.

Parameters
ipAddress Remote IP address.
localPort Optional parameter to specify a Local port number. Recommend this always be set to a value
of 0 so a random local port number is used. Warning! Specifying a local port number will
create connectivity failures if the remote host has a half open socket condition.
remotePort Remote port number.
timeout Timeout in system time ticks (use TICKS_PER_SECOND macro).
localIpAddress Optional IP address of local interface to use for connection. If not used, such as when
specifying the intf parameter, set to IPADDR::NullIP().
intf Optional local interface number to use for connection. Do not specify if the interfaceIpAddress
parameter is used.

NetBurner, Inc.
19.103 TCP 493

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

connect(), connectvia()

19.103.2.8 GetSocketLocalAddr()

IPADDR GetSocketLocalAddr (
int fd ) [inline]
Returns the IP address of the local interface associated with the connection.

Parameters

fd The socket file descriptor.

Returns

The IP address of the remote host.

See also

GetSocketRemoteAddr()

19.103.2.9 GetSocketLocalPort()

uint16_t GetSocketLocalPort (
int fd )
Returns the local port number associated with the connection.

Parameters

fd The socket file descriptor.

Returns

The local port number for the connection.

See also

GetSocketRemotePort()

19.103.2.10 GetSocketRemoteAddr()

IPADDR GetSocketRemoteAddr (
int fd ) [inline]
Returns the IP address of the remote host associated with the specified file descriptor.

Parameters

fd The socket file descriptor.

NetBurner, Inc.
494 Module Documentation

Returns

The IP address of the remote host.

See also

GetSocketLocalAddr()

19.103.2.11 GetSocketRemotePort()

uint16_t GetSocketRemotePort (
int fd )
Returns the port number of the remote host associated with the connection.

Parameters

fd The socket file descriptor.

Returns

The remote host port number.

See also

GetSocketLocalPort()

19.103.2.12 getsockoption()

int getsockoption (
int fd )
Returns the options for the specified TCP socket.

Parameters

fd Socket file descriptor.

Returns

A bitmask of the options for the specified socket.

See also

setsockoption(), clrsockoption(), SetSocketUnackBuffers(), SetSocketRxBuffers(), SetSocketTxBuffers()

19.103.2.13 GetTcpRtxCount()

int GetTcpRtxCount (
int fd )
Returns the number of re-transmits that have occurred on the specified connection.

Parameters

fd The socket file descriptor.

NetBurner, Inc.
19.103 TCP 495

Returns

The number of system Time Ticks since the last packet was received on the connection.

19.103.2.14 listen()

int listen (
const IPADDR & addr,
uint16_t port,
uint8_t maxpend = 5 ) [inline]
Listen for incoming connections on the specified network interface IP address.
Begin listening for incoming connections. A connection must be accepted with the accept() function before they can
be used. Each time a connection request is accepted is frees up another slot in the pending queue.

Parameters

addr The address from which to accept connections. INADDR_ANY will accept all connections.
port The network port number to listen on.
maxpend The maximum number of pending connection requests allowed for the listen socket.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.
int32_t fdListen = listen(INADDR_ANY, 1234);

See also

accept(), listenvia(), close()

19.103.2.15 listenvia() [1/2]

int listenvia (
const IPADDR & addr,
uint16_t port,
const IPADDR & localIpAddress,
uint8_t maxpend = 5 ) [inline]
Listen for incoming connections on the specified network interface IP address.
Begin listening for incoming connections. A connection must be accepted with the accept() function before they can
be used. Each time a connection request is accepted is frees up another slot in the pending queue.

Parameters

addr The address from which to accept connections. INADDR_ANY will accept all connections.
port The network port number to listen on.
maxpend The maximum number of pending connection requests allowed for the listen socket.
localIpAddress The IP address of the network interface to listen on. If two interfaces have the same address,
the lower numbered interface will be used.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

NetBurner, Inc.
496 Module Documentation

See also

accept(), listen(), close()

19.103.2.16 listenvia() [2/2]

int listenvia (
const IPADDR & addr,
uint16_t port,
int ifn,
uint8_t maxpend = 5 ) [inline]
Listen for incoming connections on the specified network interface IP address.
Begin listening for incoming connections. A connection must be accepted with the accept() function before they can
be used. Each time a connection request is accepted is frees up another slot in the pending queue.

Parameters

addr The address from which to accept connections. INADDR_ANY will accept all connections.
port The network port number to listen on.
maxpend The maximum number of pending connection requests allowed for the listen socket.
ifn Interface Number of the network Interface to be used.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

accept(), listen(), close()

19.103.2.17 NoBlockConnect()

int NoBlockConnect (
const IPADDR & ipAddress,
uint16_t remotePort ) [inline]
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.

Warning

To free system resources a close() must be called, even if the current state is TCP_STATE_CLOSING. Other-
wise a resource leak will occur.

Parameters
ipAddress Remote IP address.
remotePort Remote port number.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

NetBurner, Inc.
19.103 TCP 497

See also

NoBlockConnectVia(), TcpGetSocketState(), writeavail(), connect(), connectvia(), connectwlocal()

19.103.2.18 NoBlockConnectVia() [1/2]

int NoBlockConnectVia (
const IPADDR & ipAddress,
uint16_t remotePort,
const IPADDR & interfaceIpAddress = IPADDR::NullIP() ) [inline]
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.
This function is the similar to NoBlockConnect(), with the additional capability of specifying the local interface IP
address to use the for connection.
Warning

To free system resources a close() must be called, even if the current state is TCP_STATE_CLOSING. Other-
wise a resource leak will occur.

Parameters
ipAddress Remote IP address
remotePort Remote port of socket
interfaceIpAddress Optional parameter to specify which local network interface to use for the connection.
The default is IPADDR::NullIP(), which will use the default local interface.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

NoBlockConnect(), TcpGetSocketState(), writeavail(), connect(), connectvia(), connectwlocal()

19.103.2.19 NoBlockConnectVia() [2/2]

int NoBlockConnectVia (
const IPADDR & ipAddress,
uint16_t remotePort,
int ifnum ) [inline]
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.
This function is the similar to NoBlockConnect(), with the additional capability of specifying the local interface number
to use the for connection.
Warning

To free system resources a close() must be called, even if the current state is TCP_STATE_CLOSING. Other-
wise a resource leak will occur.

NetBurner, Inc.
498 Module Documentation

Parameters
ipAddress Remote IP address.
remotePort Remote port number.
ifnum Optional parameter to specify which local network interface to use for the connection by Interface
Number. Will override any routing based on destination.

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

NoBlockConnect(), TcpGetSocketState(), writeavail(), connect(), connectvia(), connectwlocal()

19.103.2.20 NoBlockConnectwlocal()

int NoBlockConnectwlocal (
const IPADDR & ipAddress,
uint16_t localPort,
uint16_t remotePort,
IPADDR interfaceIpAddress = IPADDR::NullIP(),
int ifn = -1 ) [inline]
Create a file descriptor for a TCP connection and return immediately. This function does not wait for a connection
to be established. Before using the file descriptor, the application must verify the connection was successful with
TcpGetSocketState(fd). The state will be TCP_STATE_ESTABLISHED when the connection has been successfully
established. Note: The connection status can also be obtained with the wireavail() function.
This function is the similar to NoBlockConnect(), with the additional capability of specifying the local interface number
or IP address to use the for connection. If not specified, it will the default local interface.

Warning

To free system resources a close() must be called, even if the current state is TCP_STATE_CLOSING. Other-
wise a resource leak will occur.
Although this function that allows a local port number parameter for extreme edge cases, local port numbers
should be avoided. Local port numbers create connectivity failures when a remote host has a half open socket
condition.

Parameters

ipAddress IP address of the remote host.


localPort Optional parameter to specify a Local port number. Recommend this always be set to a
value of 0 so a random local port number is used. Warning! Specifying a local port
number will create connectivity failures if the remote host has a half open socket
condition.
remotePort Remote port number.
interfaceIpAddress Optional IP address of local interface to use for connection. If not used, such as when
specifying the ifn parameter, set to IPADDR::NullIP().
ifn Optional parameter to specify which local network interface to use for the connection by
Interface Number. Will override any routing based on destination or interface IP address.

NetBurner, Inc.
19.103 TCP 499

Returns

A value greater than 0 on success, representing the socket file descriptor. A value less than 0 on error,
TCP Socket Status.

See also

TcpGetSocketState(), NoBlockConnect(), NoBlockConnectVia()

19.103.2.21 SetOutOfOrderBuffers()

uint8_t SetOutOfOrderBuffers (
int fd,
uint8_t max ) [inline]
Set the maximum number of out-of-order TCP buffers for the specified TCP socket.
There are three types of buffers assigned to a TCP socket: receive, transmit and out of order. TCP packets may be
received in sequence, or out of order. If out of order, they must be either stored for use later, or retransmitted by
the sending host. The default value is 5 buffer of approximately 1500 bytes each. The maximum number is 43. A
higher number of buffers can increase bulk data throughput, but will increase TCP latency if there is a problem with
the connection, such as a reset.

Parameters

fd Socket file descriptor


max Maximum number of buffers

Returns

TCP Socket Status

See also

setsockoption(), getsockoption(), clrsockoption(), SetSocketRxBuffers(), SetSocketTxBuffers()

19.103.2.22 SetSocketRxBuffers()

int SetSocketRxBuffers (
int fd,
int n )
Set the number of TCP receive buffers for the specified TCP socket.
Sets the number of TCP buffers that can be accumulated on the receive socket receive buffer. Each buffer is 1548
bytes. The amount of free space in the receive buffer sets the TCP window size, controlling how much data the
other side of the TCP connection is allowed to send.
When data is read from a socket, it frees up space in a buffer, allowing the other side of the TCP connection to
send more data. Since the maximum window size is 65536, raising this value beyond 43 buffers has no benefit.
The system default value is defined in constants.h with a value of 5 to conserve network buffers. Unless you are
transferring large amounts of bulk data into your NetBurner device, the default provides more than enough space.

Parameters

fd Socket file descriptor


n Number of buffers

NetBurner, Inc.
500 Module Documentation

Returns

TCP Socket Status

See also

setsockoption(), getsockoption(), clrsockoption(), SetSocketUnackBuffers(), SetSocketTxBuffers()

19.103.2.23 SetSocketTxBuffers()

int SetSocketTxBuffers (
int fd,
int n )
Set the number of TCP transmit buffers for the specified TCP socket.
Sets the number of buffers that can be put in the transmit queue. Each buffer is 1548 bytes. The transmit queue
accumulates data up to this limit regardless of the state of acknowledged buffers, or window size, from the other
side of the TCP connection. This value sets the maximum size for a TCP write operation. Note: you must always
check the return value of any write function to determine how many bytes were written.

Parameters

fd Socket file descriptor


n Number of buffers

Returns

TCP Socket Status

See also

setsockoption(), getsockoption(), clrsockoption(), SetSocketRxBuffers(), SetSocketUnackBuffers(), write(),


writeall()

19.103.2.24 SetSocketUnackBuffers()

int SetSocketUnackBuffers (
int fd,
uint8_t val ) [inline]
Set the maximum number of outbound TCP buffers in the transmit un-acknowledged list for the specified TCP
socket.
Sets the number of outbound TCP buffers allowed as un-acknowledged on a TCP socket. When transmitting, data
moves from the TCP transmit queue to the list of un-acknowledged TCP packets once it is sent. When the other
side of the TCP connection acknowledges the packet, it is removed from the un-acknowledged list. TCP can only
send as many un-acknowledged buffers as the other side's TCP window size will allow.
Increasng this value will increase bulk data throughput on a fast network. Increasing the value could decreate perfor-
mance on a lossy network without selective acknowledgement. Note: most PC's have selective acknowledgement
enabled, many NAT routers do not.

Parameters

fd Socket file descriptor


val Number of buffers

NetBurner, Inc.
19.103 TCP 501

Returns

TCP Socket Status

See also

setsockoption(), getsockoption(), clrsockoption(), SetSocketRxBuffers(), SetSocketTxBuffers()

19.103.2.25 setsockoption()

int setsockoption (
int fd,
int option )
Set TCP socket options.

Parameters

fd Socket file descriptor.


option Socket option to set: TCP Socket Options.

Returns

A bitmask of the options for the specified socket.

See also

clrsockoption(), getsockoption(), SetSocketUnackBuffers(), SetSocketRxBuffers(), SetSocketTxBuffers()

19.103.2.26 SocketPeek()

char SocketPeek (
int fd )
Returns the next char that would be read, 0 if no data.

Parameters

fd Socket file descriptor

Returns

The next char that would be read.

19.103.2.27 SockReadWithTimeout()

int SockReadWithTimeout (
int fd,
char ∗ buf,
int nbytes,
uint32_t timeout )
Attempt to read from a TCP socket until the timeout expires.
The number of bytes parameter is the maximum to read. The function will return when at least 1 byte is available,
so the return value must always be checked.

NetBurner, Inc.
502 Module Documentation

Parameters

fd Socket file descriptor


buf Point to buffer to store received data
nbytes Maximum number of bytes to read
timeout Time out in ticks per second. Recommended use is the TICKS_PER_SECOND macro. For example:
TICKS_PER_SECOND ∗ 5 for a 5 second delay.

Returns

Number of bytes read, or error TCP Socket Status

19.103.2.28 TcpAllDataAcked()

BOOL TcpAllDataAcked (
int socket )
Check the data acknowledged state of a socket.

Parameters

socket Socket file descriptor.

Returns

True if all the sent data has been acknowledged by the other side of TCP connection.

See also

WaitForSocketFlush

19.103.2.29 TcpGetLastRxInterval()

uint32_t TcpGetLastRxInterval (
int fd )
Returns the number of system Time Ticks since the last packet was received. This is the difference between the
current system time and lastRxTime of the socket.

Parameters

fd The socket file descriptor.

Returns

The number of system Time Ticks since the last packet was received on the connection.

See also

TcpGetLastRxTime()

19.103.2.30 TcpGetLastRxTime()

uint32_t TcpGetLastRxTime (
int fd )

NetBurner, Inc.
19.103 TCP 503

Returns the value of system Time Ticks when the last packet was received. Used for the TCP Keep Alive feature.
Each TCP connection has a corresponding Socket_struct. One of the elements of this struct is a variable called
lastRxTime, which stores the current system time tick every time a packet is received. This function enables you to
find out when the last packet was received by returning LastRxTime.
This function is used in conjunction with TcpSendKeepAlive() to implement the TCP keepalive feature.

• If lastRxTime is the same before and after a keepalive packet is sent, the client has not responded to the
keepalive packet and it can be assumed that connection is lost.

• Make sure to allow enough time for the client to respond to the keep alive packet before checking the time.

• Do not call TcpGetLastRxTime() more often than once every second.

Parameters

fd The socket file descriptor.

Returns

The value of system Time Ticks when the last packet was received on the connection.

See also

TcpSendKeepAlive()

19.103.2.31 TcpGetRxBufferSpaceUsed()

uint16_t TcpGetRxBufferSpaceUsed (
int fd )
Returns the number of bytes used in a socket's RX buffer.

Parameters

fd Socket file descriptor.

Returns

The number of bytes used

See also

TcpGetTxBufferAvailSpace

19.103.2.32 TcpGetSocketInterface()

int TcpGetSocketInterface (
int fd )
Return the network interface associated with a TCP socket.

Parameters

fd Socket file descriptor

NetBurner, Inc.
504 Module Documentation

Returns

The network interface number (undefined for listening sockets)

19.103.2.33 TcpGetSocketState()

uint8_t TcpGetSocketState (
int fd )
Return the current state of a TCP socket.

Parameters

fd Socket file descriptor.

Returns

The current state of the socket: TCP Socket State

19.103.2.34 TcpGetTxBufferAvailSpace()

uint16_t TcpGetTxBufferAvailSpace (
int fd )
Returns the number of bytes available in a socket's TX buffer.

Parameters

fd Socket file descriptor.

Returns

The number of bytes available

See also

TcpGetRxBufferSpaceUsed

19.103.2.35 TcpSendKeepAlive()

void TcpSendKeepAlive (
int fd )
Send a TCP keep alive packet to a remote host.
Sends an empty packet with a decremented sequence number to a remote host. The sequence number will be one
less than the last time a packet was sent. The remote host will respond with a TCP acknowledgment (ACK). This
function is used in conjunction with TcpGetLastRxTime() to implement the TCP keepalive feature.

Parameters

fd The socket file descriptor

See also

TcpGetLastRxTime()

NetBurner, Inc.
19.104 TCP Notify 505

19.103.2.36 WaitForSocketFlush()

BOOL WaitForSocketFlush (
int fd,
uint32_t ticks )
Wait for a socket flush operation to complete. A socket is flushed if all sent data has been acknowledged.

Parameters

fd Socket file descriptor.


ticks The maximum number of system time ticks to wait.

Return values

true All the sent data has been acknowledged by the other side of TCP connection.
false A timeout occurred.

See also

TcpAllDataAcked

19.104 TCP Notify


Typedefs
• typedef void() tcp_notify_handler(int tcpFd)
TCP notification callback type.

Functions
• void RegisterTCPReadNotify (int tcpFd, tcp_notify_handler ∗notifyHandler)
Register a TCP socket and callback function for read notifications.
• void RegisterTCPWriteNotify (int tcpFd, tcp_notify_handler ∗notifyHandler)
Register a TCP socket and callback function for write notifications.

19.104.1 Detailed Description


Advanced function for notification of read or write activivty on a TCP socket. Callback functions can operate on a
TCP socket as they would normally. This functionality provides a method of notification when read or write activities
occur:

• A read notification calls the callback function when data is received.

• A write notification calls the callback function when the TCP write buffer can accept more data.

19.104.2 Typedef Documentation

19.104.2.1 tcp_notify_handler

typedef void() tcp_notify_handler(int tcpFd)


TCP notification callback type.
An application creates a callback function of this type to process TCP read and/or write notifications.

NetBurner, Inc.
506 Module Documentation

Parameters

tcpFd TCP socket file descriptor of the socket that generated the notification

See also

RegisterTCPReadNotify(), RegisterTCPWriteNotify()

19.104.3 Function Documentation

19.104.3.1 RegisterTCPReadNotify()

void RegisterTCPReadNotify (
int tcpFd,
tcp_notify_handler ∗ notifyHandler )
Register a TCP socket and callback function for read notifications.
The callback function will be called whenever data is read from the TCP socket

Parameters

tcpFd Existing TCP socket file descriptor to monitor


notifyHandler Pointer to callback function to process the notification

See also

RegisterTCPWriteNotify()

19.104.3.2 RegisterTCPWriteNotify()

void RegisterTCPWriteNotify (
int tcpFd,
tcp_notify_handler ∗ notifyHandler )
Register a TCP socket and callback function for write notifications.
The callback function will be called whenever data can be written to the TCP socket buffer

Parameters

tcpFd Existing TCP socket file descriptor to monitor


notifyHandler Pointer to callback function to process the notification

See also

RegisterTCPReadNotify()

19.105 TCP Socket Options


Macros
• #define SO_DEBUG 1
Reserved.
• #define SO_NONAGLE 2
Disable the Nagle algorithm.
• #define SO_NOPUSH 4

NetBurner, Inc.
19.106 TCP Socket State 507

Disable TCP PUSH feature.

19.105.1 Detailed Description


Socket options for use with setsocketoptions().

19.106 TCP Socket State


Macros
• #define TCP_STATE_CLOSED (0)
Socket Closed.
• #define TCP_STATE_LISTEN (1)
Listen Socket.
• #define TCP_STATE_SYN_SENT (2)
Packet with synchronization flag sent.
• #define TCP_STATE_SYN_RCVD (3)
Packet with synchronisation flag received.
• #define TCP_STATE_WAIT_FOR_ACCEPT (4)
Socket waiting for accept.
• #define TCP_STATE_ESTABLISHED (5)
TCP session established.
• #define TCP_STATE_CLOSE_WAIT (6)
FIN received from client and socet is in the process of closing.
• #define TCP_STATE_LAST_ACK (7)
Server is in the process of sending its own FIN signal.
• #define TCP_STATE_FIN_WAIT_1 (8)
Connection is active but not currently being used.
• #define TCP_STATE_FIN_WAIT_2 (9)
Client has received first ACK of the first FIN signal from server.
• #define TCP_STATE_CLOSING (10)
Session is closing, but data may still be processed.
• #define TCP_STATE_TIME_WAIT (11)
Client recognizes connection still open, but not currently being used.

19.106.1 Detailed Description


The current state of a TCP socket.

19.107 TCP Socket Status


Macros
• #define TCP_ERR_NORMAL (0)
No errors.
• #define TCP_ERR_TIMEOUT (-1)
Socket timed out.
• #define TCP_ERR_NOCON (-2)
No connection exists.
• #define TCP_ERR_CLOSING (-3)
Socket is in the process of closing.
• #define TCP_ERR_NOSUCH_SOCKET (-4)

NetBurner, Inc.
508 Module Documentation

No such socket exists.


• #define TCP_ERR_NONE_AVAIL (-5)
No new sockets are available.
• #define TCP_ERR_CON_RESET (-6)
Connection has been reset.
• #define TCP_ERR_CON_ABORT (-7)
Connection has been aborted.

19.107.1 Detailed Description


The current status of a TCP socket. When calling API functions that return a file descriptor, such as listen(),
accept(), connect(), etc., a negative value represents an error, while a value greater than 0 represents the file
descriptor number.

19.108 TFTP
Modules
• TFTP Return Codes

Functions
• int GetTFTP (PCSTR fileName, PCSTR mode, puint8_t buffer, int &len, uint32_t timeout, IPADDR4 server,
uint16_t port=IANA_TFTP_PORT)
Get a file from a TFTP server.
• int SendTFTP (PCSTR fileName, PCSTR mode, puint8_t buffer, int len, uint32_t timeout, uint32_t packet←-
Timeout, IPADDR4 server, uint16_t port=IANA_TFTP_PORT)
Send a file to a TFTP server.

19.108.1 Detailed Description


The NetBurner TFTP Group

19.108.2 Function Documentation

19.108.2.1 GetTFTP()

int GetTFTP (
PCSTR fileName,
PCSTR mode,
puint8_t buffer,
int & len,
uint32_t timeout,
IPADDR4 server,
uint16_t port = IANA_TFTP_PORT )
Get a file from a TFTP server.

Parameters

fileName Name of file to retrieve


mode Transfer mode. 'b' = binary, 't' = text
buffer Data destination buffer
len Maximum length when function is called, bytes read upon function return.
timeout Total amount of time for file transfer, in system TimeTicks

NetBurner, Inc.
19.109 TFTP Return Codes 509

Parameters

server IPv4 address of TFTP server


port Optional TFTP server port number. If not specified the default TFTP port number 69 will be used.

Returns

TFTP Return Codes

See also

SendTFTP

19.108.2.2 SendTFTP()

int SendTFTP (
PCSTR fileName,
PCSTR mode,
puint8_t buffer,
int len,
uint32_t timeout,
uint32_t packetTimeout,
IPADDR4 server,
uint16_t port = IANA_TFTP_PORT )
Send a file to a TFTP server.

Parameters

fileName Name of file to retrieve


mode Transfer mode. 'b' = binary, 't' = text
buffer Data destination buffer
len Length of file to transfer, in bytes
timeout Total amount of time for file transfer, in system TimeTicks
packetTimeout Timeout for any single UDP packet to successfully transfer and be acknowledged, in system
Time Ticks
server IPv4 address of TFTP server
port Optional TFTP server port number. If not specified the default TFTP port number 69 will be
used.

Returns

TFTP Return Codes

See also

SendTFTP

19.109 TFTP Return Codes


Macros
• #define TFTP_OK (0)
Success.
• #define TFTP_TIMEOUT (1)
TFTP Timeout.

NetBurner, Inc.
510 Module Documentation

• #define TFTP_ERROR (2)


TFTP Error.

19.109.1 Detailed Description

19.110 Time
Functions
• time_t time (time_t ∗pt)
• time_t set_time (time_t time_to_set)
Set the system time to the value passed in the time_t parameter.
• time_t timegm (struct tm ∗bts)
Returns the value of type time_t that represents the GMT time described by the tm structure pointed by bts.
• void tzsetchar (char ∗tzenv)
Set the system local time.

19.110.1 Detailed Description


The NBTime library provides methods to set and read the system time. The system time will reset whenever power
is lost or the system is reset. On power-up, system time can be set:

• With a NTP server (most common)

• From a real time clock (RTC)j

• Manually

Examples are provided in the example section for each of these methods.
Time is always stored as GMT. If you are using an internal or external real-time clock, it should also be set to GMT.
Example application function calls are shown below. Refer to the examples for your specific NetBurner platform for
RTC functions. Functions with an "_r" are reentrant.
List of common standard Time library functions include:

• time_t time() Returns current system GMT time.

• gmtime_r(time_t &timeT, tm &stmUTC) Converts given time since epoch (a time_t value pointed to by timeT)
to calendar time, expressed in Coordinated Universal Time (UTC) in the struct tm format. The result is stored
in the struct tm pointed to by stmUTC.

• localtime_r(time_t &tv, tm &tm_struct) Converts given time since epoch (time_t) to calendar time, expressed
in local time, in the struct tm format. The result is stored in the tm struct.

• strftime() Creates a formatted time string and stores it in a buffer.

• double difftime(time_t t1, time_t t2) Returns the difference between two time_t values.

19.110.2 Function Documentation

19.110.2.1 set_time()

time_t set_time (
time_t time_to_set )
Set the system time to the value passed in the time_t parameter.

Parameters
time_to_set time_t value to set the system time.

NetBurner, Inc.
19.111 Timers 511

Returns

The system time time_t value

Sets the system time with the value given by "time_to_set"

19.110.2.2 time()

time_t time (
time_t ∗ pt )
Gets the current system time - time can be stored at the location pointed to by "pt" or returned by call

19.110.2.3 timegm()

time_t timegm (
struct tm ∗ bts )
Returns the value of type time_t that represents the GMT time described by the tm structure pointed by bts.
Performs the reverse conversion gmtime(). This is not to be confused with the mktime() function, which performs
the reverse conversion of the localtime() function.

Parameters
bts Pointer to a tm structure

Returns

time_t value of tm

Converts a tm structure to time_t. This returns the value of type time_t that represents the UTC time described by
the tm structure pointed by bts. This function performs the reverse translation that is done by gmtime()

19.110.2.4 tzsetchar()

void tzsetchar (
char ∗ tzenv )
Set the system local time.
This function initializes the TZ environment variable to contain the local time zone offset information from the stan-
dard time (UTC) and, if applicable, daylight saving time (DST). This does not overwrite the system time to the local
time. The TZ environment variable is used by the ctime(), localtime(), mktime(), and strftime() functions of the
standard time.h library to calculate the local time.
Once the TZ variable is set, the time library functions use it to determine when DST is in effect, when type conver-
sions are made, or what time zone string is provided in the case of the strftime() function.
The system provides time zones around the world that can be referenced in the TZRecords variable in timezones.h.
The time zone strings are located in timezones.cpp. Please refer to the timezones and RTC example programs for
methods on utilizing these time zone settings.

Parameters

tzenv The time zone string. For example: tzsetchar( "EST5EDT4,M3.2.0/02:00:00,M11.1.0/02:00:00" ); Eastern

Sets the TZ environment variables for standard time and daylight savings time in the system.

19.111 Timers
Modules
• High Resolution Delay Timer
• Interval Timer
• Stopwatch Timer

NetBurner, Inc.
512 Module Documentation

19.111.1 Detailed Description


Hardware based high resolution timers:

• StopWatch to time events

• Interval Timer for periodic semaphore posts or interrupts

• HiResDelay (DelayObject) providing microsecond delay functions

19.112 UDP Error Codes


Macros
• #define UDP_ERR_NOSUCH_SOCKET (-1)
Socket does not exist.
• #define UDP_ERR_NOTOPEN_TO_WRITE (-2)
Socket not open for write.
• #define UDP_ERR_NOTOPEN_TO_READ (-3)
Socket not open for read.

19.112.1 Detailed Description

19.113 UDP Packet Object


The NetBurner UDP protocol API is implemented in two ways:

Modules
• UDP Error Codes

Classes
• class UDPPacket
UDP Packet Class.

Functions
• void RegisterUDPFifo (uint16_t listenPort, OS_FIFO ∗pFifo)
Register a FIFO to receive incoming UDP packets.
• void RegisterUDPFifoVia (uint16_t listenPort, OS_FIFO ∗pFifo, int interface)
Register a FIFO to receive incoming UDP packets on the specified network interface.
• uint16_t RegisterEphemeralFifo (OS_FIFO ∗pfifo, int ifn=-1)
Register a UDP FIFO with a random port number to receive incoming UDP packets.
• void RegisterUDPFifoWithNotify (uint16_t listenPort, OS_FIFO ∗pFifo, udp_data_notify ∗pNotifyFunction)
Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is
received.
• void RegisterUDPFifoWithNotifyVia (uint16_t listenPort, OS_FIFO ∗pFifo, udp_data_notify ∗pNotifyFunction,
int interface)
Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is
received. Same as RegisterUDPFifoWithNotify() with the additional parameter to specify the local network interface.
• void UnregisterUDPFifo (uint16_t listenPort, bool drain=false)
Unregister a UDP FIFO.

NetBurner, Inc.
19.113 UDP Packet Object 513

19.113.1 Detailed Description


The NetBurner UDP protocol API is implemented in two ways:

1. As a C++ class, which makes memory management easier UDPPacket.

2. Wrapper functions that implement a standard UDP sockets interface. For example, sendto() and recvfrom().

19.113.2 Function Documentation

19.113.2.1 RegisterEphemeralFifo()

uint16_t RegisterEphemeralFifo (
OS_FIFO ∗ pfifo,
int ifn = -1 )
Register a UDP FIFO with a random port number to receive incoming UDP packets.
A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen on a random
unused UDP port number, which can be useful when sending a UDP packet to a remote host that will respond to
the received packet source port number.

Parameters

pfifo Pointer to the OS_FIFO to register


ifn Optional local interface number to listen on

Returns

The registered port number of success, 0 on failure.

See also

RegisterUDPFifoWithNotify(), UnregisterUDPFifo()

19.113.2.2 RegisterUDPFifo()

void RegisterUDPFifo (
uint16_t listenPort,
OS_FIFO ∗ pFifo )
Register a FIFO to receive incoming UDP packets.
A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific
UDP port number.

Parameters

listenPort Port to listen on for incoming packets


pFifo Pointer to the OS_FIFO to register

See also

RegisterUDPFifoWithNotify(), UnregisterUDPFifo(), RegisterEphemeralFifo()

19.113.2.3 RegisterUDPFifoVia()

void RegisterUDPFifoVia (

NetBurner, Inc.
514 Module Documentation

uint16_t listenPort,
OS_FIFO ∗ pFifo,
int interface )
Register a FIFO to receive incoming UDP packets on the specified network interface.
A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific
UDP port number and local network interface.

Parameters

listenPort Port to listen on for incoming packets


pFifo Pointer to the OS_FIFO to register
interface Local network interface number

See also

RegisterUDPFifo(), RegisterUDPFifoWithNotify(), UnregisterUDPFifo(), RegisterEphemeralFifo()

19.113.2.4 RegisterUDPFifoWithNotify()

void RegisterUDPFifoWithNotify (
uint16_t listenPort,
OS_FIFO ∗ pFifo,
udp_data_notify ∗ pNotifyFunction )
Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is
received.
A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific
UDP port number and a notification callback function.

Parameters

listenPort Port to listen on for incoming packets


pFifo Pointer to the OS_FIFO to register
pNotifyFunction Pointer to callback function to receive notification

See also

RegisterUDPFifo(), UnregisterUDPFifo()

19.113.2.5 RegisterUDPFifoWithNotifyVia()

void RegisterUDPFifoWithNotifyVia (
uint16_t listenPort,
OS_FIFO ∗ pFifo,
udp_data_notify ∗ pNotifyFunction,
int interface )
Register a FIFO to receive incoming UDP packets and a callback function to receive a notification when a packet is
received. Same as RegisterUDPFifoWithNotify() with the additional parameter to specify the local network interface.
A OS_FIFO is used to receive incoming UDP Packets. This function registers an OS_FIFO to listen to a specific
UDP port number and a notification callback function.

Parameters

listenPort Port to listen on for incoming packets


pFifo Pointer to the OS_FIFO to register

NetBurner, Inc.
19.114 UDP Socket 515

Parameters

pNotifyFunction Pointer to callback function to receive notification


interface Local network interface number

See also

RegisterUDPFifo(), UnregisterUDPFifo()

19.113.2.6 UnregisterUDPFifo()

void UnregisterUDPFifo (
uint16_t listenPort,
bool drain = false )
Unregister a UDP FIFO.

Parameters

listenPort Port to listen on for incoming packets.


drain Optional, default if false. If set to true, will free all queued pool pointers.

See also

RegisterUDPFifo(), RegisterUDPFifoWithNotify()

19.114 UDP Socket


The NetBurner UDP protocol Socket API.

Functions
• int CreateRxUdpSocket (uint16_t listening_port)
Open a UDP socket for receiving incoming UDP packets.
• int CreateTxUdpSocket (const IPADDR &send_to_addr, uint16_t remote_port, uint16_t local_port)
Open a UDP socket for transmitting UDP packets.
• int CreateRxTxUdpSocket (const IPADDR &send_to_addr, uint16_t send_to_remote_port, uint16_t local_←-
port)
Open a UDP socket that can transmit and receive UDP packets.
• int sendto (int sock, puint8_t what_to_send, int len_to_send, const IPADDR &to_addr, uint16_t remote_port)
Send a UDP packet.
• int sendtovia (int sock, puint8_t what_to_send, int len_to_send, const IPADDR &to_addr, uint16_t remote_←-
port, int intfnum)
Send a UDP packet on the specified interface.
• int recvfrom (int sock, puint8_t buffer, int len, IPADDR ∗pAddr, uint16_t ∗pLocal_port, uint16_t ∗pRemote_←-
port)
Receive a UDP packet.
• int SendFragmentedUdpPacket (const IPADDR &to, uint16_t source_port, uint16_t dest_port, puint8_t data,
int length)
Send a large fragmented UDP packet.
• int CreateRxUdpSocketVia (uint16_t listening_port, int interfacenum)
Open a UDP socket for receiving incoming UDP packets on the specified network interface, by interface number.
• int CreateRxUdpSocketVia (uint16_t listening_port, const IPADDR interfaceIp)

NetBurner, Inc.
516 Module Documentation

Open a UDP socket for receiving incoming UDP packets on the network interface with the specified IP address. If
more than one interface has the same IP address, the lower interface number is used.
• int CreateRxTxUdpSocketVia (const IPADDR send_to_addr, uint16_t send_to_remote_port, uint16_t local←-
_port, int interfacenum)
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an interface
number.
• int CreateRxTxUdpSocketVia (const IPADDR send_to_addr, uint16_t send_to_remote_port, uint16_t local←-
_port, IPADDR interfaceIp)
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an IP
address.
• int CreateTxUdpSocketVia (const IPADDR send_to_addr, uint16_t remote_port, uint16_t local_port, int inter-
facenum)
Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface number.
• int CreateTxUdpSocketVia (const IPADDR send_to_addr, uint16_t remote_port, uint16_t local_port, IPADDR
interfaceIp)
Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface IP address.

19.114.1 Detailed Description


The NetBurner UDP protocol Socket API.

1. As a C++ class, which makes memory management easier UDPPacket.

2. Wrapper functions that implement a standard UDP sockets interface.For example, sendto() and recvfrom().

19.114.2 Function Documentation

19.114.2.1 CreateRxTxUdpSocket()

int CreateRxTxUdpSocket (
const IPADDR & send_to_addr,
uint16_t send_to_remote_port,
uint16_t local_port ) [inline]
Open a UDP socket that can transmit and receive UDP packets.

Parameters
send_to_addr Destination IP address
send_to_remote_port Destination port number
local_port Local port number. A value of 0 will select a random port number (recommended)

Returns

The file descriptor for the UDP socket

See also

CreateRxUdpSocket(), CreateTxUdpSocket()

19.114.2.2 CreateRxTxUdpSocketVia() [1/2]

int CreateRxTxUdpSocketVia (
const IPADDR send_to_addr,
uint16_t send_to_remote_port,

NetBurner, Inc.
19.114 UDP Socket 517

uint16_t local_port,
int interfacenum ) [inline]
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an
interface number.

Parameters
send_to_addr Destination IP address
send_to_remote_port Destination port number
local_port Local port number. A value of 0 will select a random port number (recommended)
interfacenum Local network interface number

Returns

The file descriptor for the UDP socket

See also

CreateRxUdpSocketVia(), CreateTxUdpSocketVia()

19.114.2.3 CreateRxTxUdpSocketVia() [2/2]

int CreateRxTxUdpSocketVia (
const IPADDR send_to_addr,
uint16_t send_to_remote_port,
uint16_t local_port,
IPADDR interfaceIp ) [inline]
Open a UDP socket that can transmit and receive UDP packets on the local network interface specified by an IP
address.

Parameters
send_to_addr Destination IP address
send_to_remote_port Destination port number
local_port Local port number. A value of 0 will select a random port number (recommended)
interfaceIp IP address of local network interface to use

Returns

The file descriptor for the UDP socket

See also

CreateRxUdpSocketVia(), CreateTxUdpSocketVia()

19.114.2.4 CreateRxUdpSocket()

int CreateRxUdpSocket (
uint16_t listening_port )
Open a UDP socket for receiving incoming UDP packets.
Returns a file descriptor that can be used by read functions such as: read() and select() to process multiple file
descriptors at one time.

NetBurner, Inc.
518 Module Documentation

Parameters

listening_port Port to listen on for incoming packets

Returns

The file descriptor for the UDP socket

See also

CreateTxUdpSocket(), CreateRxTxUdpSocket()

19.114.2.5 CreateRxUdpSocketVia() [1/2]

int CreateRxUdpSocketVia (
uint16_t listening_port,
const IPADDR interfaceIp )
Open a UDP socket for receiving incoming UDP packets on the network interface with the specified IP address. If
more than one interface has the same IP address, the lower interface number is used.
Returns a file descriptor that can be used by read functions such as read() and select().

Parameters

listening_port Port to listen on for incoming packets


interfaceIp IP address of the network interface

Returns

The file descriptor for the UDP socket

See also

CreateRxUdpSocketVia(), CreateTxUdpSocketVia()

19.114.2.6 CreateRxUdpSocketVia() [2/2]

int CreateRxUdpSocketVia (
uint16_t listening_port,
int interfacenum )
Open a UDP socket for receiving incoming UDP packets on the specified network interface, by interface number.
Returns a file descriptor that can be used by read functions such as read() and select().

Parameters

listening_port Port to listen on for incoming packets


interfacenum Network interface number

Returns

The file descriptor for the UDP socket

See also

CreateTxUdpSocketVia(), CreateRxTxUdpSocketVia()

NetBurner, Inc.
19.114 UDP Socket 519

19.114.2.7 CreateTxUdpSocket()

int CreateTxUdpSocket (
const IPADDR & send_to_addr,
uint16_t remote_port,
uint16_t local_port ) [inline]
Open a UDP socket for transmitting UDP packets.
Returns a file descriptor that can be used by transmit functions such as sendto().

Parameters
send_to_addr Destination IP address
remote_port Destination port number
local_port Local port number. A value of 0 will select a random port number (recommended)

Returns

The file descriptor for the UDP socket

See also

CreateRxUdpSocket(), CreateRxTxUdpSocket()

19.114.2.8 CreateTxUdpSocketVia() [1/2]

int CreateTxUdpSocketVia (
const IPADDR send_to_addr,
uint16_t remote_port,
uint16_t local_port,
int interfacenum ) [inline]
Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface number.
Returns a file descriptor that can be used by transmit functions such as sendto().

Parameters
send_to_addr Destination IP address
remote_port Destination port number
local_port Local port number. A value of 0 will select a random port number (recommended)
interfacenum Local network interface number

Returns

The file descriptor for the UDP socket

See also

CreateRxUdpSocketVia(), CreateRxTxUdpSocketVia()

19.114.2.9 CreateTxUdpSocketVia() [2/2]

int CreateTxUdpSocketVia (
const IPADDR send_to_addr,
uint16_t remote_port,
uint16_t local_port,
IPADDR interfaceIp ) [inline]

NetBurner, Inc.
520 Module Documentation

Open a UDP socket for transmitting UDP packets on the local network interface specified by the interface IP address.
Returns a file descriptor that can be used by transmit functions such as sendto().

Parameters
send_to_addr Destination IP address
remote_port Destination port number
local_port Local port number. A value of 0 will select a random port number (recommended)
interfaceIp IP address of the local network interface

Returns

The file descriptor for the UDP socket

See also

CreateRxUdpSocketVia(), CreateRxTxUdpSocketVia()

19.114.2.10 recvfrom()

int recvfrom (
int sock,
puint8_t buffer,
int len,
IPADDR ∗ pAddr,
uint16_t ∗ pLocal_port,
uint16_t ∗ pRemote_port ) [inline]
Receive a UDP packet.

Parameters

sock File descriptor from a previous call to CreateRxUdpSocket() or CreateRxTxSocket()


buffer Pointer to BYTE array buffer to store received UDP packet data
len Maximum number of bytes to receive
pAddr Pointer to an IPADDR variable to store the sender's IP address of the packet
pLocal_port Pointer to WORD variable to store the local port number of the packet
pRemote_port Pointer to WORD variable to store the sender's port number of the packet

Returns

The number of bytes received, or a negative number if an error occurred UDP Error Codes

See also

sendto(), sendtovia()

19.114.2.11 SendFragmentedUdpPacket()

int SendFragmentedUdpPacket (
const IPADDR & to,
uint16_t source_port,
uint16_t dest_port,
puint8_t data,
int length ) [inline]

NetBurner, Inc.
19.114 UDP Socket 521

Send a large fragmented UDP packet.

NetBurner, Inc.
522 Module Documentation

Parameters
to Destination IP address
source_port Source port number, a value of 0 selects a random source port number (recommended)
dest_port Destination port number
data Pointer to data to send
length Number of bytes to send

Returns

The number of bytes sent, or 0 if an error occurred.

19.114.2.12 sendto()

int sendto (
int sock,
puint8_t what_to_send,
int len_to_send,
const IPADDR & to_addr,
uint16_t remote_port ) [inline]
Send a UDP packet.

Parameters

sock Socket to send packet to


what_to_send Pointer to data to be sent
len_to_send Number of data bytes to send
to_addr Destination IP address
remote_port Destination port number

Returns

The number of bytes sent, or a negative number if an error occurred UDP Error Codes

See also

sendtovia(), recvfrom()

19.114.2.13 sendtovia()

int sendtovia (
int sock,
puint8_t what_to_send,
int len_to_send,
const IPADDR & to_addr,
uint16_t remote_port,
int intfnum ) [inline]
Send a UDP packet on the specified interface.

Parameters

sock Socket to send packet to


what_to_send Pointer to data to be sent

NetBurner, Inc.
19.115 User Authorization Manager 523

Parameters

len_to_send Number of data bytes to send


to_addr Destination IP address
remote_port Destination port number
intfnum Interface number

Returns

The number of bytes sent, or a negative number if an error occurred UDP Error Codes

See also

sendto(), recvfrom()

19.115 User Authorization Manager


Modules
• Authorization Responses
• Authorization Types

Classes
• struct UserAuthRecord
A stored record of a user's authorization credentials. The value is hashed when saved so it can't be read directly.
User's can currently only have one authorization record per user name.
• class UserAuthManager
The user authorization manager class allows application developers the ability to manage user authorization records.
The can be loaded and saved to any storage space, including the config system or UserParams. Authorization
values are hashed before being saved. Validation compares both the hash as well as the authorization type. Adding,
updating, and removing records will automatically call the user devined save functions. For usage, please see the
example found in examples/SSH/sshServerUserAuth.

Typedefs
• typedef int(∗ SaveAuthRecordsFn) (const UserAuthRecord ∗authRec)
User provided function for saving user authorization records. This allows the users to dictate where their authorization
records are stored.
• typedef int(∗ LoadAuthRecordsFn) (UserAuthRecord ∗authRec)
User provided function for loading user authorization records. This allows the users to dictate where their authorization
records are stored.

19.115.1 Detailed Description


The NetBurner User Authorization Manager

19.115.2 Typedef Documentation

19.115.2.1 LoadAuthRecordsFn

typedef int(∗ LoadAuthRecordsFn) (UserAuthRecord ∗authRec)


User provided function for loading user authorization records. This allows the users to dictate where their authoriza-
tion records are stored.

NetBurner, Inc.
524 Module Documentation

Parameters

authRec A pointer to an array of UserAuthRecords where the data will be loaded.

Return values

0 If the authorization records were loaded correctly.


!0 If there was an error loading the authorization records. Error codes are left to application developers to define.

19.115.2.2 SaveAuthRecordsFn

typedef int(∗ SaveAuthRecordsFn) (const UserAuthRecord ∗authRec)


User provided function for saving user authorization records. This allows the users to dictate where their authoriza-
tion records are stored.

Parameters

authRec A pointer to an array of UserAuthRecords that should be saved.

Return values

0 If the authorization records were saved correctly.


!0 If there was an error saving the authorization records. Error codes are left to application developers to define.

19.116 Web Client


Modules
• Web Client Error Codes

Classes
• class ParsedURI
Parsed Uniform Resource Identifier Class (URI)

Functions
• void SetHttpDiag (bool b)
Enable/disable Web Client HTTP diagnostics to the console port.
• int DoMultipartStartPost (ParsedURI &TheUri, const char ∗separator, uint16_t TIMEOUT_WAIT=10
∗TICKS_PER_SECOND, uint32_t contentLength=0)
Start a multipart HTTP post using a pre-parsed URI object.
• int DoMultipartStartPost (const char ∗pUrl, const char ∗separator, uint16_t TIMEOUT_WAIT=10 ∗TICKS_←-
PER_SECOND, uint32_t contentLength=0)
Start a multipart HTTP post using a pointer to a URL.
• void DoMultipartItem (int tcpfd, const char ∗Disposition, const char ∗separator, const unsigned char ∗data,
int len)
Send a multipart item.
• void DoMultipartBoundary (int tcpfd, const char ∗Disposition, const char ∗separator)
Send a multipart boundary.

NetBurner, Inc.
19.116 Web Client 525

• bool DoMultipartFinished (int tcpfd, const char ∗separator, buffer_object &result_buffer, uint16_t TIMEOUT←-
_WAIT=10 ∗TICKS_PER_SECOND)
Send a multipart item.
• bool DoUrlEncodedFormPost (ParsedURI &TheUri, char ∗headers, char ∗form_data, buffer_object &result←-
_buffer, uint16_t TIMEOUT_WAIT)
Post a JSON file using a HTTP Form Post and a a ParsedURI object.
• bool DoUrlEncodedFormPost (const char ∗pUrl, char ∗headers, char ∗form_data, buffer_object &result_←-
buffer, uint16_t TIMEOUT_WAIT)
Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.
• bool DoJsonPost (const char ∗pUrl, const char ∗Json_Data_To_Post, buffer_object &result_buffer, char
∗AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.
• bool DoJsonPost (ParsedURI &TheUri, const char ∗Json_Data_To_Post, buffer_object &result_buffer, char
∗AdditionalHeaders=NULL, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Post a JSON file using a HTTP POST and a ParsedURI object.
• bool DoJsonPost (const char ∗pUrl, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, char
∗AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Post a JSON file using a HTTP POST and a URL string.
• bool DoJsonPost (ParsedURI &TheUri, ParsedJsonDataSet &jsonout, buffer_object &result_buffer, char
∗AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Post a JSON file using HTTP and a ParsedURI object.
• bool DoJsonPostHttpFile (const char ∗pUrl, const char ∗FragmentName, buffer_object &result_buffer, char
∗AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Post a JSON file using HTTP and a URL string.
• bool DoJsonPostHttpFile (ParsedURI &TheUri, const char ∗FragmentName, buffer_object &result_buffer,
char ∗AdditionalHeaders, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Post a JSON file using HTTP and a ParsedURI object.
• bool DoGet (ParsedURI &TheUri, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER←-
_SECOND)
• bool DoGetEx (ParsedURI &TheUri, const char ∗headers, buffer_object &result_buffer, uint16_t TIMEOUT←-
_WAIT=10 ∗TICKS_PER_SECOND)
• bool DoGet (const char ∗pUrl, buffer_object &result_buffer, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_←-
SECOND)
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
• bool DoGetEx (const char ∗pUrl, const char ∗headers, buffer_object &result_buffer, uint16_t TIMEOUT_←-
WAIT=10 ∗TICKS_PER_SECOND)
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
• int DoGet (ParsedURI &TheUri, unsigned char ∗result, int maxl, uint16_t TIMEOUT_WAIT=10 ∗TICKS_←-
PER_SECOND)
Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)
• int DoGetEx (ParsedURI &TheUri, const char ∗headers, unsigned char ∗result, int maxl, uint16_t TIMEOUT←-
_WAIT=10 ∗TICKS_PER_SECOND)
Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)
• int DoGet (const char ∗pUrl, unsigned char ∗result, int maxl, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_←-
SECOND)
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
• int DoGetEx (const char ∗pUrl, const char ∗headers, unsigned char ∗result, int maxl, uint16_t TIMEOUT_←-
WAIT=10 ∗TICKS_PER_SECOND)
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
• int DoGetUpdate (ParsedURI &TheUri, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Execute a firmware update from the specified URI.
• int DoGetUpdate (const char ∗pUrl, uint16_t TIMEOUT_WAIT=10 ∗TICKS_PER_SECOND)
Execute a firmware update from the specified URI.

NetBurner, Inc.
526 Module Documentation

• int PopulateAuthHeader (const char ∗user, const char ∗password, char ∗buffer, int maxlen)
Fill in a username and password into a buffer for use as an extra header.
• bool StartWebClient (int prio, const char ∗url1, const char ∗url2=NULL, bool bDoNtp=false)
Start the web client using a URL string.
• bool StartWebClient (int prio, const NBString &url1, const NBString &url2, bool bDoNtp=false)
Start the web client using a NBString.
• bool StartWebClient (int prio, const NBString &url1, bool bDoNtp=false)
Start the web client using a NBString.

19.116.1 Detailed Description


The Web Client Group

19.116.2 Function Documentation

19.116.2.1 DoGet() [1/4]

bool DoGet (
const char ∗ pUrl,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
This function will parse the URL string to connect to the host.

Parameters

pUrl Pointer to a URL string. A DNS lookup will be done if necessary.


&result_buffer Reference to the memory buffer in which to store the result.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

19.116.2.2 DoGet() [2/4]

int DoGet (
const char ∗ pUrl,
unsigned char ∗ result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
This function will parse the URL string to connect to the host.

Parameters

pUrl Pointer to a URL string. A DNS lookup will be done if necessary.


result Pointer to the buffer in which to store the result.
maxl Maximum length of the result buffer.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

NetBurner, Inc.
19.116 Web Client 527

Returns

19.116.2.3 DoGet() [3/4]

bool DoGet (
ParsedURI & TheUri,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )

Parameters

&TheUri Reference to the pre-parsed URI.


&result_buffer Reference to the location to store the result.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

19.116.2.4 DoGet() [4/4]

int DoGet (
ParsedURI & TheUri,
unsigned char ∗ result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)
This function uses a reference to a parsed URI, providing faster execution and avoiding parsing a URL, DNS, etc.

Parameters

TheUri Reference to the ParsedURI object.


result Pointer to the buffer in which to store the result.
maxl Maximum length of the result buffer.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

19.116.2.5 DoGetEx() [1/4]

bool DoGetEx (
const char ∗ pUrl,
const char ∗ headers,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
This function will parse the URL string to connect to the host.

NetBurner, Inc.
528 Module Documentation

Parameters

pUrl Pointer to a URL string. A DNS lookup will be done if necessary.


headers Additional HTTP header fields. Multiple header fields should be concatenated together and
separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
&result_buffer Reference to the memory buffer in which to store the result.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

19.116.2.6 DoGetEx() [2/4]

int DoGetEx (
const char ∗ pUrl,
const char ∗ headers,
unsigned char ∗ result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a HTTP/HTTPS GET request using a pointer to a URL string.
This function will parse the URL string to connect to the host.

Parameters

pUrl Pointer to a URL string. A DNS lookup will be done if necessary.


headers Additional HTTP header fields. Multiple header fields should be concatenated together and
separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
result Pointer to the buffer in which to store the result.
maxl Maximum length of the result buffer.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

19.116.2.7 DoGetEx() [3/4]

bool DoGetEx (
ParsedURI & TheUri,
const char ∗ headers,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )

Parameters

&TheUri Reference to the pre-parsed URI.


headers Additional HTTP header fields. Multiple header fields should be concatenated together and
separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
&result_buffer Reference to the location to store the result.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

NetBurner, Inc.
19.116 Web Client 529

Returns

True on success, false on failure.

19.116.2.8 DoGetEx() [4/4]

int DoGetEx (
ParsedURI & TheUri,
const char ∗ headers,
unsigned char ∗ result,
int maxl,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a HTTP/HTTPS GET request using a reference to a parsed Uniform Resource Identifier (URI)
This function uses a reference to a parsed URI, providing faster execution and avoiding parsing a URL, DNS, etc.

Parameters

TheUri Reference to the ParsedURI object.


headers Additional HTTP header fields. Multiple header fields should be concatenated together and
separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
result Pointer to the buffer in which to store the result.
maxl Maximum length of the result buffer.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

19.116.2.9 DoGetUpdate() [1/2]

int DoGetUpdate (
const char ∗ pUrl,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a firmware update from the specified URI.

Parameters

pUrl Pointer to a URL string. A DNS lookup will be done if necessary.


TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

19.116.2.10 DoGetUpdate() [2/2]

int DoGetUpdate (
ParsedURI & TheUri,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Execute a firmware update from the specified URI.

NetBurner, Inc.
530 Module Documentation

Parameters

TheUri Reference to the ParsedURI object.


TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

19.116.2.11 DoJsonPost() [1/4]

bool DoJsonPost (
const char ∗ pUrl,
const char ∗ Json_Data_To_Post,
buffer_object & result_buffer,
char ∗ AdditionalHeaders = NULL,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.

Parameters
pUrl Pointer to a URL string.
Json_Data_To_Post Pointer to serialized JSON data
&result_buffer Reference to the location in which to store the result.
AdditionalHeaders Additional HTTP header fields. Multiple header fields should be concatenated together
and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

19.116.2.12 DoJsonPost() [2/4]

bool DoJsonPost (
const char ∗ pUrl,
ParsedJsonDataSet & jsonout,
buffer_object & result_buffer,
char ∗ AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Post a JSON file using a HTTP POST and a URL string.

Parameters
pUrl Pointer to a URL string.
jsonout Reference to NetBurner data object. Please ref JSON lexer.
&result_buffer Reference to the location in which to store the result.
AdditionalHeaders Additional HTTP header fields. Multiple header fields should be concatenated together
and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

NetBurner, Inc.
19.116 Web Client 531

Returns

True on success, false on failure.

19.116.2.13 DoJsonPost() [3/4]

bool DoJsonPost (
ParsedURI & TheUri,
const char ∗ Json_Data_To_Post,
buffer_object & result_buffer,
char ∗ AdditionalHeaders,
uint16_t TIMEOUT_WAIT )
Post a JSON file using a HTTP POST and a ParsedURI object.

Parameters

&TheUri Reference to the pre-parsed URI.


Json_Data_To_Post Serialized JSON data\
&result_buffer Reference to the location in which to store the result.
AdditionalHeaders Additional HTTP header fields. Multiple header fields should be concatenated together
and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

AdditionalHeaders - A null-terminated string containing any additional headers required by the post. The individual
entries should be separated by "\r\n". The string should finish with "\r\n". It may be NULL, and, if it is not provided,
it will be set to NULL.

19.116.2.14 DoJsonPost() [4/4]

bool DoJsonPost (
ParsedURI & TheUri,
ParsedJsonDataSet & jsonout,
buffer_object & result_buffer,
char ∗ AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Post a JSON file using HTTP and a ParsedURI object.

Parameters

&TheUri Reference to the pre-parsed URI.


jsonout Reference to NetBurner data object. Please ref JSON lexer.
&result_buffer Reference to the location in which to store the result.
AdditionalHeaders Additional HTTP header fields. Multiple header fields should be concatenated together
and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

NetBurner, Inc.
532 Module Documentation

19.116.2.15 DoJsonPostHttpFile() [1/2]

bool DoJsonPostHttpFile (
const char ∗ pUrl,
const char ∗ FragmentName,
buffer_object & result_buffer,
char ∗ AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Post a JSON file using HTTP and a URL string.

Parameters
pUrl Pointer to a URL string.
FragmentName
&result_buffer Reference to the location in which to store the result.
AdditionalHeaders Additional HTTP header fields. Multiple header fields should be concatenated together
and separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

19.116.2.16 DoJsonPostHttpFile() [2/2]

bool DoJsonPostHttpFile (
ParsedURI & TheUri,
const char ∗ FragmentName,
buffer_object & result_buffer,
char ∗ AdditionalHeaders,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Post a JSON file using HTTP and a ParsedURI object.

Parameters

&TheUri Reference to the pre-parsed URI.


FragmentName
&result_buffer Reference to the location in which to store the result.
AdditionalHeaders
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

19.116.2.17 DoMultipartBoundary()

void DoMultipartBoundary (
int tcpfd,
const char ∗ Disposition,
const char ∗ separator )
Send a multipart boundary.

NetBurner, Inc.
19.116 Web Client 533

Parameters

tcpfd TCP file descriptor returned from DoMultipartStartPost()


Disposition Content disposition field of multipart body
separator Separator string to use as the part delimiter between multipart posts.

19.116.2.18 DoMultipartFinished()

bool DoMultipartFinished (
int tcpfd,
const char ∗ separator,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND )
Send a multipart item.

Parameters

tcpfd TCP file descriptor returned from DoMultipartStartPost()


separator Separator string to use as the part delimiter between multipart posts.
result_buffer Reference to buffer to store result of xxxxx
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

∗∗∗∗∗∗ Need to understand in http_funcs.cpp

19.116.2.19 DoMultipartItem()

void DoMultipartItem (
int tcpfd,
const char ∗ Disposition,
const char ∗ separator,
const unsigned char ∗ data,
int len )
Send a multipart item.

Parameters

tcpfd TCP file descriptor returned from DoMultipartStartPost()


Disposition Content disposition field of multipart body
separator Separator string to use as the part delimiter between multipart posts.
data Item data
len Data length

19.116.2.20 DoMultipartStartPost() [1/2]

int DoMultipartStartPost (
const char ∗ pUrl,
const char ∗ separator,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND,

NetBurner, Inc.
534 Module Documentation

uint32_t contentLength = 0 )
Start a multipart HTTP post using a pointer to a URL.

Parameters
pUrl Pointer to a URL string.
separator Separator string to use as the part delimiter between multipart posts.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.
contentLength If given, content length for the entire multipart post.

Returns

A TCP/TLS file descriptor greater than 0 if a socket was successfully opened, or TCP Socket Status on failure.

19.116.2.21 DoMultipartStartPost() [2/2]

int DoMultipartStartPost (
ParsedURI & TheUri,
const char ∗ separator,
uint16_t TIMEOUT_WAIT = 10 ∗TICKS_PER_SECOND,
uint32_t contentLength = 0 )
Start a multipart HTTP post using a pre-parsed URI object.

Parameters

&TheUri Reference to the pre-parsed URI object.


separator Separator string to use as the part delimiter between multipart posts.
TIMEOUT_WAIT Timeout in seconds to wait for a response.
contentLength If given, content length for the entire multipart post.

Returns

A TCP/TLS file descriptor greater than 0 if a socket was successfully opened, or TCP Socket Status on failure.

19.116.2.22 DoUrlEncodedFormPost() [1/2]

bool DoUrlEncodedFormPost (
const char ∗ pUrl,
char ∗ headers,
char ∗ form_data,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT )
Post a JSON file using a HTTP POST and a URL string and pointer to JSON data.

Parameters
pUrl Pointer to a URL string.
headers Additional HTTP header fields. Multiple header fields should be concatenated together and
separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
form_data Pointer to the JSON data you are posting.
&result_buffer Reference to the location in which to store the result.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

NetBurner, Inc.
19.116 Web Client 535

Returns

True on success, false on failure.

19.116.2.23 DoUrlEncodedFormPost() [2/2]

bool DoUrlEncodedFormPost (
ParsedURI & TheUri,
char ∗ headers,
char ∗ form_data,
buffer_object & result_buffer,
uint16_t TIMEOUT_WAIT )
Post a JSON file using a HTTP Form Post and a a ParsedURI object.

Parameters

&TheUri Reference to the pre-parsed URI.


headers Additional HTTP header fields. Multiple header fields should be concatenated together and
separated by by \r\n Do not put \r\n for last header (no trailing \r\n)
form_data Pointer to the JSON data you are posting.
&result_buffer Reference to the location in which to store the result.
TIMEOUT_WAIT Timeout in in system time ticks to wait for a response.

Returns

True on success, false on failure.

19.116.2.24 PopulateAuthHeader()

int PopulateAuthHeader (
const char ∗ user,
const char ∗ password,
char ∗ buffer,
int maxlen )
Fill in a username and password into a buffer for use as an extra header.

Parameters
user Pointer to username
password Pointer to password
buffer Destination buffer to put the authenticate header in.
maxlen Maximum number of chars to put in buffer

Returns

number of chars written, negative if the buffer was too small.

19.116.2.25 SetHttpDiag()

void SetHttpDiag (
bool b )
Enable/disable Web Client HTTP diagnostics to the console port.

NetBurner, Inc.
536 Module Documentation

Parameters

b Set true to enable, false to disable.

19.116.2.26 StartWebClient() [1/3]

bool StartWebClient (
int prio,
const char ∗ url1,
const char ∗ url2 = NULL,
bool bDoNtp = false )
Start the web client using a URL string.

Parameters
prio Priority
url1 Pointer to a string representing the URL.
url2 Pointer to a second URL. Optional parameter, default is NULL.
bDoNtp Enable the Network Time Protocol (NTP). Optional parameter, default is false.

Returns

True on success, false on failure.

19.116.2.27 StartWebClient() [2/3]

bool StartWebClient (
int prio,
const NBString & url1,
bool bDoNtp = false )
Start the web client using a NBString.

Parameters
prio Priority
url1 Reference to a NBString representing the URL.
bDoNtp Enable the Network Time Protocol (NTP). Optional parameter, default is false.

Returns

True on success, false on failure.

19.116.2.28 StartWebClient() [3/3]

bool StartWebClient (
int prio,
const NBString & url1,
const NBString & url2,
bool bDoNtp = false )
Start the web client using a NBString.

NetBurner, Inc.
19.117 Web Client Error Codes 537

Parameters
prio Priority
url1 Reference to a string representing the URL.
url2 Reference to a second URL. Optional parameter, default is NULL.
bDoNtp Enable the Network Time Protocol (NTP). Optional parameter, default is false.

Returns

True on success, false on failure.

19.117 Web Client Error Codes


Macros
• #define WEB_CLIENT_ERROR_NO_ETHERNET (1)
No Ethernet connection.
• #define WEB_CLIENT_ERROR_NO_ADDRESS (2)
Interface has no IP address.
• #define WEB_CLIENT_ERROR_NO_GATEWAY (3)
Interface has no gateway IP address.
• #define WEB_CLIENT_ERROR_GATEWAY_WRONG (4)
Interface has incorrect gateway IP address.
• #define WEB_CLIENT_ERROR_NO_DNS_ADDR (5)
Interface has a DNS errror.
• #define WEB_CLIENT_ERROR_NO_DNS_RESOLVE (6)
DNS was not able to resolve the URL name.
• #define WEB_CLIENT_ERROR_NO_NTP (7)
NTP failed.
• #define WEB_CLIENT_ERROR_NO_SERVER_RESPONSE (8)
No response from server.
• #define WEB_CLIENT_ERROR_NO_SERVER_CONNECT (9)
Unable to connect to server.
• #define WEB_CLIENT_ERROR_NO_ERROR (10)
No error.

19.117.1 Detailed Description


Web Client error codes

19.118 Wifi
Modules
• BSS Options
Option list BSS type values.
• Cipher Options
• Configuration Errors
• Connect Request Errors
• Save Config Record Errors
• Scan Request Errors
• Security Options

NetBurner, Inc.
538 Module Documentation

Classes
• struct wifi_init

Functions
• nbWifiScanResult ∗ WifiInitScan_SPI (int irqNum=-1, int moduleNum=-1, int csNum=-1, int connectorNum=-
1, int gpioPinNum=-1, int resetPinNum=-1)
Initializes the WiFi hardware, initializes the driver over the SPI bus, and performs an AP scan.
• int WifiInitScanAndShow_SPI (int irqNum=-1, int moduleNum=-1, int csNum=-1, int connectorNum=-1, int
gpioPinNum=-1, int resetPinNum=-1)
Initializes the WiFi hardware, initializes the driver using the SPI bus, performs an AP scan, and prints the scan results
via serial output.
• int InitWifi_SPI (const char ∗SSID="", const char ∗password="", int irqNum=-1, int moduleNum=-1, int cs←-
Num=-1, int connectorNum=-1, int gpioPinNum=-1, int resetPinNum=-1)
Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified connec-
tion.
• int InitAP_SPI (const char ∗SSID="", const char ∗password="", uint8_t channel=NBWIFI_DEFAULT_←-
WIFICHANNEL, int irqNum=-1, int moduleNum=-1, int csNum=-1, int connectorNum=-1, int gpioPinNum=-1,
int resetPinNum=-1)
Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified access
point.
• nbWifiScanResult ∗ WifiInitScan_Serial (int portNum=-1, int resetPinNum=-1, int connectorNum=-1)
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the scan
results via serial output.
• int WifiInitScanAndShow_Serial (int portNum=-1, int resetPinNum=-1, int connectorNum=-1)
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the scan
results via serial output.
• int InitWifi_Serial (const char ∗SSID="", const char ∗password="", int portNum=-1, int resetPinNum=-1, int
connectorNum=-1)
Initializes the WiFi hardware, initializes the driver using the UART interface, and attempts to establish the specified
access point.
• void SetWifiSPISpeed (int busSpeed)
Set SPI bus speed.
• void ScanAndShowNetworks ()
Scan for surrounding access points and print the results via iprintf.
• nbWifiScanResult ∗ ScanForNetworks ()
Scan for surrounding access points.

19.118.1 Detailed Description


19.118.2 Function Documentation

19.118.2.1 InitAP_SPI()

int InitAP_SPI (
const char ∗ SSID = "",
const char ∗ password = "",
uint8_t channel = NBWIFI_DEFAULT_WIFICHANNEL,
int irqNum = -1,
int moduleNum = -1,
int csNum = -1,
int connectorNum = -1,
int gpioPinNum = -1,
int resetPinNum = -1 )

NetBurner, Inc.
19.118 Wifi 539

Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified access
point.

Parameters

in SSID Service Set Identity (SSID), nullptr uses SSID stored in the configuration record.
in password key shared with access point/peer; nullptr uses the key stored in the configuration
record.
in channel 802.11 channel to establish an access point on.
in irqNum IRQ signal used to communicate with the WiFi module.
in moduleNum SPI module number used to communicate with the WiFi module.
in csNum Chip Select signal used for SPI communication.
in connectorNum physical header number of the NetBurner module used.
in gpioPinNum GPIO pin number to use for the SPI chip select if not using the SPI module's native
chip select signal.
in resetPinNum pin number to use as an reset signal output to the wifi module.

Returns

returns the Wifi interface number, if successful. Otherwise, returns NB::Error::GeneralErrors or


NB::Error::Init::InitializationErrors

19.118.2.2 InitWifi_Serial()

int InitWifi_Serial (
const char ∗ SSID = "",
const char ∗ password = "",
int portNum = -1,
int resetPinNum = -1,
int connectorNum = -1 )
Initializes the WiFi hardware, initializes the driver using the UART interface, and attempts to establish the specified
access point.
NOTE: Serial functions pertaining to WiFi are only available for the NBWIFIIN.

Parameters

in SSID Service Set Identity (SSID), nullptr uses SSID stored in the configuration record.
in password key shared with access point/peer; nullptr uses the key stored in the configuration record.
in portNum UART number
in resetPinNum pin number to use as an reset signal output to the wifi module.
in connectorNum physical header number of the NetBurner module used.

Returns

returns zero if successful, otherwise returns NB::Error::GeneralErrors or NB::Error::Init::InitializationErrors

19.118.2.3 InitWifi_SPI()

int InitWifi_SPI (
const char ∗ SSID = "",
const char ∗ password = "",
int irqNum = -1,

NetBurner, Inc.
540 Module Documentation

int moduleNum = -1,


int csNum = -1,
int connectorNum = -1,
int gpioPinNum = -1,
int resetPinNum = -1 )
Initializes the WiFi hardware, initializes the driver using the SPI bus, and attempts to establish the specified connec-
tion.

Parameters

in SSID Service Set Identity (SSID), nullptr uses SSID stored in the configuration record.
in password key shared with access point/peer; nullptr uses the key stored in the configuration
record.
in irqNum IRQ signal used to communicate with the WiFi module.
in moduleNum SPI module number used to communicate with the WiFi module.
in csNum Chip Select signal used for SPI communication.
in connectorNum physical header number of the NetBurner module used.
in gpioPinNum GPIO pin number to use for the SPI chip select, if not using the SPI's native chip
select signal.
in resetPinNum pin number to use as an reset signal output to the wifi module.

Returns

returns the Wifi interface number, if successful. Otherwise, returns NB::Error::GeneralErrors or


NB::Error::Init::InitializationErrors

19.118.2.4 ScanAndShowNetworks()

void ScanAndShowNetworks ( )
Scan for surrounding access points and print the results via iprintf.
This function is bus interface agnostic.

19.118.2.5 ScanForNetworks()

nbWifiScanResult ∗ ScanForNetworks ( )
Scan for surrounding access points.

Returns

nbWifiScanResult Head of linked list containing the AP scan results. nullptr if scan failed or no access points
were found

This function is bus interface agnostic.

19.118.2.6 SetWifiSPISpeed()

void SetWifiSPISpeed (
int busSpeed )
Set SPI bus speed.

Parameters

in busSpeed Bus speed in Hz.

NetBurner, Inc.
19.118 Wifi 541

19.118.2.7 WifiInitScan_Serial()

nbWifiScanResult ∗ WifiInitScan_Serial (
int portNum = -1,
int resetPinNum = -1,
int connectorNum = -1 )
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the
scan results via serial output.
NOTE: Serial functions pertaining to WiFi are only available for the NBWIFIIN.

Parameters
in portNum UART number
in resetPinNum pin number to use as an reset signal output to the wifi module.
in connectorNum physical header number of the NetBurner module used.

Returns

nbWifiScanResult Head of linked list containing the AP scan results. nullptr if scan failed or no access points
were found

19.118.2.8 WifiInitScan_SPI()

nbWifiScanResult ∗ WifiInitScan_SPI (
int irqNum = -1,
int moduleNum = -1,
int csNum = -1,
int connectorNum = -1,
int gpioPinNum = -1,
int resetPinNum = -1 )
Initializes the WiFi hardware, initializes the driver over the SPI bus, and performs an AP scan.

Parameters

in irqNum IRQ signal used to communicate with the WiFi module.


in moduleNum SPI module number used to communicate with the WiFi module.
in csNum Chip Select signal used for SPI communication.
in connectorNum physical header number of the NetBurner module used.
in gpioPinNum GPIO pin number to use for the SPI chip select if not using the SPI's native chip select
signal.
in resetPinNum pin number to use as an reset signal output to the wifi module.

Returns

nbWifiScanResult Head of linked list containing the AP scan results. nullptr if scan failed or no access points
were found

Initializes the WiFi Driver to communicate with the WiFi module over the SPI bus and performs a scan for surrounding
access points (AP). The result of the scan is returned as the head of a linked list that contains the scan results. If
the WiFi driver has already been initialized by a previous call to one of the WifiInit function variations, then only a
scan will be performed.

19.118.2.9 WifiInitScanAndShow_Serial()

int WifiInitScanAndShow_Serial (
int portNum = -1,

NetBurner, Inc.
542 Module Documentation

int resetPinNum = -1,


int connectorNum = -1 )
Initializes the WiFi hardware, initializes the driver using the UART interface, performs an AP scan, and prints the
scan results via serial output.
NOTE: Serial functions pertaining to WiFi are only available for the NBWIFIIN.

Parameters
in portNum UART number
in resetPinNum pin number to use as an reset signal output to the wifi module.
in connectorNum physical header number of the NetBurner module used.

Returns

the Wifi interface number if successful. Otherwise, returns NB::Error::GeneralErrors or NB::Error::Init::InitializationErrors

19.118.2.10 WifiInitScanAndShow_SPI()

int WifiInitScanAndShow_SPI (
int irqNum = -1,
int moduleNum = -1,
int csNum = -1,
int connectorNum = -1,
int gpioPinNum = -1,
int resetPinNum = -1 )
Initializes the WiFi hardware, initializes the driver using the SPI bus, performs an AP scan, and prints the scan
results via serial output.

Parameters

in irqNum IRQ signal used to communicate with the WiFi module.


in moduleNum SPI module number used to communicate with the WiFi module.
in csNum Chip Select signal used for SPI communication.
in connectorNum physical header number of the NetBurner module used.
in gpioPinNum GPIO pin number to use for the SPI chip select if not using the SPI's native chip select
signal.
in resetPinNum pin number to use as an reset signal output to the wifi module.

Returns

returns the Wifi interface number, if successful. Otherwise, returns NB::Error::GeneralErrors or


NB::Error::Init::InitializationErrors

NetBurner, Inc.
Chapter 20

Namespace Documentation

20.1 canMCF5441x Namespace Reference


canMCF5441x namespace

Classes
• class CanRxMessage
Class to hold received CAN messages.

20.1.1 Detailed Description


canMCF5441x namespace

20.2 mcanMODM7AE70 Namespace Reference


mcanMODM7AE70 namespace

Classes
• class CanRxMessage
Class to hold received CAN messages.
• class mcan_config
MCAN configuration structure.
• class mcan_module
MCAN Module Class.

Variables
• const uint32_t CONF_MCAN_RX_FIFO_0_NUM = 32
• const uint32_t CONF_MCAN_RX_FIFO_1_NUM = 0
• const uint32_t CONF_MCAN_RX_BUFFER_NUM = 0
• const uint32_t CONF_MCAN_TX_BUFFER_NUM = 8
• const uint32_t CONF_MCAN_TX_FIFO_QUEUE_NUM = 0
• const uint32_t CONF_MCAN_TX_EVENT_FIFO = 8
• const uint32_t CONF_MCAN_RX_STANDARD_ID_FILTER_NUM = 32
• const uint32_t CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM = 32

20.2.1 Detailed Description


mcanMODM7AE70 namespace

NetBurner, Inc.
544 Namespace Documentation

20.3 NB::Error Namespace Reference


Namespaces
• namespace Connect
• namespace Init
• namespace Scan

Enumerations
• enum GeneralErrors {
NoError = 0 , Timeout = -256 , BusTimeout = -257 , InvalidArgument = -258 ,
TooManyPendingCommands = -259 , InvalidRequest = -512 }

20.3.1 Detailed Description


NB::Error namespace that describes WiFi request errors. See also InitWifi_SPI(), InitAP_SPI(), InitWifi_Serial(),
NB::Master::ConnectToAP(), NB::Master::StartAP(), WifiInitScanAndShow_SPI(), WifiInitScanAndShow_Serial()

20.3.2 Enumeration Type Documentation

20.3.2.1 GeneralErrors

enum NB::Error::GeneralErrors

20.3.3 GeneralErrors
8 bit values reserved for command specific errors

Enumerator

NoError Successful execution.


Timeout Request timed out.
BusTimeout Request timed out on the bus.
InvalidArgument Parameter/arguement not defined or is invalid.
TooManyPendingCommands Too many pending commands.
InvalidRequest Invalid request.

20.4 NB::Error::Connect Namespace Reference


Enumerations
• enum ConnectErrors {
Success = 0 , NotInitialized = -1 , AlreadyConnected = -2 , Option = -3 ,
CouldNotConfig = -4 , SSID_NotFound = -5 , BSSID_NotFound = -6 , Sec_NotFound = -7 ,
Cipher_NotFound = -8 , ConnectFailed = -9 }

20.4.1 Detailed Description


NB::Error::Connect namespace that describes WiFi connect request errors. See also InitWifi_SPI(), InitAP_SPI(),
InitWifi_Serial(), NB::Master::ConnectToAP(), NB::Master::StartAP()

NetBurner, Inc.
20.5 NB::Error::Init Namespace Reference 545

20.4.2 Enumeration Type Documentation

20.4.2.1 ConnectErrors

enum NB::Error::Connect::ConnectErrors

20.4.3 ConnectErrors

Enumerator

Success Success.
NotInitialized Not Initialized.
AlreadyConnected Already Connected.
Option Option.
CouldNotConfig Could Not Configure.
SSID_NotFound SSID Not Found.
BSSID_NotFound BSSID Not Found.
Sec_NotFound Sec Not Found.
Cipher_NotFound Cipher Not Found.
ConnectFailed Connect Failed.

20.5 NB::Error::Init Namespace Reference


Enumerations
• enum InitializationErrors {
Success = 0 , AlreadyInit = -1 , NoDevice = -2 , InvalidInfo = -3 ,
DevFirmVer = -4 , DevHwVer = -5 , OptionTables = -6 }

20.5.1 Detailed Description


NB::Error::Init namespace that describes WiFi initialization request errors. See also WifiInitScanAndShow_SPI(),
WifiInitScanAndShow_Serial(), InitWifi_SPI(), InitAP_SPI(), InitWifi_Serial()

20.5.2 Enumeration Type Documentation

20.5.2.1 InitializationErrors

enum NB::Error::Init::InitializationErrors

20.5.3 InitializationErrors

Enumerator

Success Success.
AlreadyInit Already Inittialized.
NoDevice No Device detected or attempting to use WiFi functions on an un-initialized device.
InvalidInfo Invalid Info.
DevFirmVer Device Firmware Version.
DevHwVer Device Hardware Version.
OptionTables Option Tables.

NetBurner, Inc.
546 Namespace Documentation

20.6 NB::Error::Scan Namespace Reference


Enumerations
• enum ScanErrors { Success = 0 , NotInitialized = -1 , InProgress = -2 , Option = -3 }

20.6.1 Detailed Description


NB::Error::Scan namespace that describes WiFi access point scan request errors. See also WifiInitScanAndShow_SPI(),
WifiInitScanAndShow_Serial()

20.6.2 Enumeration Type Documentation

20.6.2.1 ScanErrors

enum NB::Error::Scan::ScanErrors

20.6.3 ScanErrors

Enumerator

Success Success.
NotInitialized Not Initialized.
InProgress In Progress.
Option Option.

NetBurner, Inc.
Chapter 21

Class Documentation

21.1 _PinVector Class Reference


GPIO Pin Vector Base Class.
#include <cpu_pins.h>
Inherited by PinVector< n >.

Public Member Functions


• uint32_t operator= (uint32_t val)
Assign a value to the _PinVector Bus.
• PinIO operator[ ] (int idx)
Access the PinIO for a specific bit position in the _PinVector.
• void config (uint32_t idx, PinIO cfg)
Set the PinIO that will be used for a given bit position in the _PinVector.
• void config (PinIO ∗pinCfgs, uint32_t count)
Configure the _PinVector based on an array of PinIOs. The index of the PinIO in the configuration array will determine
the bit position within the _PinVector that that PinIO represents.
• operator uint32_t () const
Read the line state of the _PinVector bus.

21.1.1 Detailed Description


GPIO Pin Vector Base Class.
This class is for building semi-parallel buses using GPIO pins. It facilitates driving a numeric value across a parallel
bus of GPIO pins. It should not be confused with a true parallel bus, as each individual pin in the bus is modified
sequentially/independently during a bus assignment.

Parameters

_Pin::len Number of pins managed by the _PinVector.

21.1.2 Member Function Documentation

21.1.2.1 config() [1/2]

void _PinVector::config (
PinIO ∗ pinCfgs,
uint32_t count )

NetBurner, Inc.
548 Class Documentation

Configure the _PinVector based on an array of PinIOs. The index of the PinIO in the configuration array will deter-
mine the bit position within the _PinVector that that PinIO represents.

Parameters

pinCfgs The configuration to be used.


count The number of PinIOs in the configuration array to be used.

21.1.2.2 config() [2/2]

void _PinVector::config (
uint32_t idx,
PinIO cfg )
Set the PinIO that will be used for a given bit position in the _PinVector.

Parameters

idx The bit position to be configured.


cfg The PinIO that bit position will represent.

21.1.2.3 operator uint32_t()

_PinVector::operator uint32_t ( ) const


Read the line state of the _PinVector bus.

Returns

The current bus value as read from the line state.

21.1.2.4 operator=()

uint32_t _PinVector::operator= (
uint32_t val )
Assign a value to the _PinVector Bus.

Parameters
val The value to assign to the bus.

Returns

The value driven on the bus.

21.1.2.5 operator[]()

PinIO _PinVector::operator[ ] (
int idx )
Access the PinIO for a specific bit position in the _PinVector.

Parameters
idx The bit index to access in the _PinVector.

NetBurner, Inc.
21.2 aes_context Struct Reference 549

Returns

The PinIO for the given bit position.

The documentation for this class was generated from the following file:

• cpu_pins.h

21.2 aes_context Struct Reference


AES context structure.
#include <aes.h>

Public Attributes
• unsigned long erk [64]
• unsigned long drk [64]
• int nr

21.2.1 Detailed Description


AES context structure.

21.2.2 Member Data Documentation

21.2.2.1 drk

unsigned long aes_context::drk[64]


decryption round keys

21.2.2.2 erk

unsigned long aes_context::erk[64]


encryption round keys

21.2.2.3 nr

int aes_context::nr
number of rounds

The documentation for this struct was generated from the following file:

• nbrtos/include/aes.h

21.3 AltNameEntry Struct Reference


The AltNameEntry struct holds all of the information required to add a single alternate name entry to a certificate
that's generated onboard the module.
#include <certgen.h>

Public Attributes
• AltNameType_t m_type
This is the type of alternate name entry, either DNS or IP.
• char ∗ m_value
• int m_len
How long m_value is. We can't use strlen() here because 0 is a valid value for entries of the IP type.

NetBurner, Inc.
550 Class Documentation

21.3.1 Detailed Description


The AltNameEntry struct holds all of the information required to add a single alternate name entry to a certificate
that's generated onboard the module.

21.3.2 Member Data Documentation

21.3.2.1 m_value

char∗ AltNameEntry::m_value
This is an octet string that contains the data of the alternate name entry. For entries of the IP type, each character
should represent the actual numerical value of an IP address segment.
The documentation for this struct was generated from the following file:

• certgen.h

21.4 CallBackFunctionPostHandler Class Reference


Implements the HtmlPostHandler class as a function pointer callback for POST requests.
#include <httppost.h>
Inherits HtmlPostHandler.

Public Member Functions


• virtual int ProcessRaw (int sock, HTTP_Request &pdt)
This class will do a callback with data for each request to the specified url.

21.4.1 Detailed Description


Implements the HtmlPostHandler class as a function pointer callback for POST requests.

21.4.2 Member Function Documentation

21.4.2.1 ProcessRaw()

virtual int CallBackFunctionPostHandler::ProcessRaw (


int sock,
HTTP_Request & pd ) [inline], [virtual]
This class will do a callback with data for each request to the specified url.

Returns

0 if the request was not processed.

Implements HtmlPageHandler.
The documentation for this class was generated from the following file:

• httppost.h

21.5 canMCF5441x::CanRxMessage Class Reference


Class to hold received CAN messages.
#include <multican.h>

NetBurner, Inc.
21.5 canMCF5441x::CanRxMessage Class Reference 551

Public Member Functions


• uint8_t GetLength ()
Returns the amount of data stored in the message.
• uint8_t GetData (uint8_t ∗buffer, uint8_t max_len)
Copy the data in the message up to max_len.
• uint32_t GetId ()
Returns the ID of the message.
• uint16_t GetTimeStamp ()
Returns the time stamp of the message.
• BOOL IsValid ()
Check to verify the CanRxMessage is a valid message.
• CanRxMessage (OS_FIFO ∗pFifo, uint16_t timeout)
Build a CanRxMessage from a FIFO.
• CanRxMessage (int moduleNum, uint32_t id, uint16_t timeout)
Constructor that sends out a RTR request to ID and waits for a response.
• ∼CanRxMessage ()
Destructor.
• BOOL GetNewMessage (OS_FIFO ∗pFifo, uint16_t timeout)
Get a new message from the FIFO. If no message is available, wait up to the timeout for one to be received.

21.5.1 Detailed Description


Class to hold received CAN messages.

21.5.2 Constructor & Destructor Documentation

21.5.2.1 CanRxMessage() [1/2]

canMCF5441x::CanRxMessage::CanRxMessage (
OS_FIFO ∗ pFifo,
uint16_t timeout )
Build a CanRxMessage from a FIFO.
The FIFO must be registered to listen for incoming messages. If no messages are received in the timeout interval,
the returned CanRxMessage will be marked as not valid. A Timeout value of 0 will wait forever.

Parameters

pFifo Pointer to an OS_FIFO to store the message


timeout Message timeout in TICKS_PER_SECOND

21.5.2.2 CanRxMessage() [2/2]

canMCF5441x::CanRxMessage::CanRxMessage (
int moduleNum,
uint32_t id,
uint16_t timeout )
Constructor that sends out a RTR request to ID and waits for a response.
The CAN system uses any unused channel to send and receive the buffer. The constructor can return an invalid
message for two reasons:

1. The timeout interval has expired

NetBurner, Inc.
552 Class Documentation

2. There were no free CAN channels available to send the request

Parameters

moduleNum CAN module number


id CAN ID number
timeout Message timeout in TICKS_PER_SECOND. A value of 0 will wait forever.

21.5.3 Member Function Documentation

21.5.3.1 GetData()

uint8_t canMCF5441x::CanRxMessage::GetData (
uint8_t ∗ buffer,
uint8_t max_len )
Copy the data in the message up to max_len.

Parameters

buffer Pointer to destination storage buffer


max_len Maximum number of bytes to copy

Returns

The number of bytes copied

21.5.3.2 GetNewMessage()

BOOL canMCF5441x::CanRxMessage::GetNewMessage (
OS_FIFO ∗ pFifo,
uint16_t timeout )
Get a new message from the FIFO. If no message is available, wait up to the timeout for one to be received.

Parameters

pFifo Pointer to the OS_FIFO.


timeout Timeout to wait if no messages are currently available. Value is in TICKS_PER_SECOND, a value of
0 will wait forever.

21.5.3.3 IsValid()

BOOL canMCF5441x::CanRxMessage::IsValid ( )
Check to verify the CanRxMessage is a valid message.
Please refer to the CanRxMessage() constructor for further information on valid messages.
The documentation for this class was generated from the following file:

• multican.h

NetBurner, Inc.
21.6 mcanMODM7AE70::CanRxMessage Class Reference 553

21.6 mcanMODM7AE70::CanRxMessage Class Reference


Class to hold received CAN messages.
#include <mcan.h>

Public Member Functions


• uint8_t GetLength ()
Returns the amount of data stored in the message.
• uint8_t CopyData (uint8_t ∗buffer, uint8_t max_len)
Copy the data in the message up to max_len.
• const uint8_t ∗ GetData ()
Returns a pointer to the message data.
• uint32_t GetId ()
Returns the ID of the message.
• uint16_t GetTimeStamp ()
Returns the time stamp of the message.
• BOOL IsValid ()
Check to verify the CanRxMessage is a valid message.
• CanRxMessage (OS_FIFO ∗pFifo, uint32_t timeout=WAIT_FOREVER)
Build a CanRxMessage from a FIFO.
• ∼CanRxMessage ()
Destructor.
• BOOL GetNewMessage (OS_FIFO ∗pFifo, uint32_t timeout=WAIT_FOREVER)
Get a new message from the FIFO. If no message is available, wait up to the timeout for one to be received.

21.6.1 Detailed Description


Class to hold received CAN messages.

21.6.2 Constructor & Destructor Documentation

21.6.2.1 CanRxMessage()

mcanMODM7AE70::CanRxMessage::CanRxMessage (
OS_FIFO ∗ pFifo,
uint32_t timeout = WAIT_FOREVER )
Build a CanRxMessage from a FIFO.
The FIFO must be registered to listen for incoming messages. If no messages are received in the timeout interval,
the returned CanRxMessage will be marked as not valid. A Timeout value of 0 will wait forever.

Parameters

pFifo Pointer to an OS_FIFO to store the message


timeout Optional message timeout in TICKS_PER_SECOND

21.6.3 Member Function Documentation

NetBurner, Inc.
554 Class Documentation

21.6.3.1 CopyData()

uint8_t mcanMODM7AE70::CanRxMessage::CopyData (
uint8_t ∗ buffer,
uint8_t max_len )
Copy the data in the message up to max_len.

Parameters

buffer Pointer to destination storage buffer


max_len Maximum number of bytes to copy

Returns

The number of bytes copied

21.6.3.2 GetData()

const uint8_t ∗ mcanMODM7AE70::CanRxMessage::GetData ( )


Returns a pointer to the message data.

Warning

Invalid after destructor is called

21.6.3.3 GetNewMessage()

BOOL mcanMODM7AE70::CanRxMessage::GetNewMessage (
OS_FIFO ∗ pFifo,
uint32_t timeout = WAIT_FOREVER )
Get a new message from the FIFO. If no message is available, wait up to the timeout for one to be received.

Parameters

pFifo Pointer to the OS_FIFO


timeout Optional parameter to wait if no messages are currently available. Value is in
TICKS_PER_SECOND, a value of 0 will wait forever.

21.6.3.4 IsValid()

BOOL mcanMODM7AE70::CanRxMessage::IsValid ( )
Check to verify the CanRxMessage is a valid message.
Please refer to the CanRxMessage() constructor for further information on valid messages.
The documentation for this class was generated from the following file:

• mcan.h

21.7 CertGenData Struct Reference


Used to store the information that is passed in when enabling onboard generated certificates, as well as the infor-
mation needed to determine when they need to be regenerated.
#include <certgen.h>

NetBurner, Inc.
21.8 config_bool Class Reference 555

Public Attributes
• char ∗ m_commonName
Common Name.
• int m_yrsValid
Number of years.
• AltNameEntry ∗ m_altNames
Alternate names.
• int m_altNameCnt
Number of alternate names.
• time_t m_certExpTime
Certificate expiration time.
• bool m_certExpTimeSet
Flag to indicate certificate expiration time has been set.

21.7.1 Detailed Description


Used to store the information that is passed in when enabling onboard generated certificates, as well as the infor-
mation needed to determine when they need to be regenerated.
The documentation for this struct was generated from the following file:

• certgen.h

21.8 config_bool Class Reference


Boolean Configuration Variable.
#include <config_obj.h>
Inherits config_value.
Inherited by reboot_obj.

Public Member Functions


• virtual void GetTextValue (NBString &s)
Copy the object value as a text string to the specified NBString object.
• config_bool (config_obj &owner, bool def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_bool (bool def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• operator bool () const
Return the object value.
• config_bool & operator= (const bool v)
Assign the config_bool object value to the specified bool value.
• config_bool & operator= (const config_bool &cb)
Copy one config_bool object to another.
• config_bool & operator= (const int i)
Assign a config_bool object value to the specified integer value.
• virtual void GetTypeValue (NBString &s)
Copy the object type value to the specified NBString object.

NetBurner, Inc.
556 Class Documentation

Additional Inherited Members


21.8.1 Detailed Description
Boolean Configuration Variable.

Note

All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to
save changes to flash memory.

21.8.2 Constructor & Destructor Documentation

21.8.2.1 config_bool() [1/2]

config_bool::config_bool (
config_obj & owner,
bool def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.

Parameters

owner Reference to parent leaf


def_val Default value
name Field name assigned to the value
desc Description used for info/tool tip

21.8.2.2 config_bool() [2/2]

config_bool::config_bool (
bool def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.

Parameters

def_val Default value


name Field name assigned to the value
desc Description, used for info/tool tips

21.8.3 Member Function Documentation

21.8.3.1 GetTextValue()

virtual void config_bool::GetTextValue (


NBString & s ) [inline], [virtual]
Copy the object value as a text string to the specified NBString object.
Writes either "true" or "false". This is a virtual function that can be overridden in a derived class.

NetBurner, Inc.
21.8 config_bool Class Reference 557

Parameters

s Reference to a NBString object to store the result

Implements config_value.

21.8.3.2 GetTypeValue()

virtual void config_bool::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value to the specified NBString object.

Parameters

s NBString object to hold the type value string

21.8.3.3 operator bool()

config_bool::operator bool ( ) const [inline]


Return the object value.

Returns

The object value as a bool

Example: for a variable named configInt of type config_double:


bool boolValue = bool(NV_Settings.m_nvBool);
iprintf("boolValue: %d\r\n", boolValue);

21.8.3.4 operator=() [1/3]

config_bool & config_bool::operator= (


const bool v ) [inline]
Assign the config_bool object value to the specified bool value.

Parameters

v Value of type bool

21.8.3.5 operator=() [2/3]

config_bool & config_bool::operator= (


const config_bool & cb ) [inline]
Copy one config_bool object to another.

Parameters

cb Reference to a config_bool object

21.8.3.6 operator=() [3/3]

config_bool & config_bool::operator= (

NetBurner, Inc.
558 Class Documentation

const int i ) [inline]


Assign a config_bool object value to the specified integer value.

Parameters

i Integer value, either 0 (false) or 1 (true)

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.9 config_chooser Class Reference


Chooser Configuration Variable - Select From a List of Items.
#include <config_obj.h>
Inherits config_obj.

Public Member Functions


• config_chooser (config_obj &owner, const char ∗name, const char ∗in_value, const char ∗in_choices, const
char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_chooser (const char ∗name, const char ∗in_value, const char ∗in_choices, const char ∗desc=NULL)
Object constructor.
• bool IsSelected (const char ∗choice)
Check if a particular choice option is selected.
• bool IsSelected (const NBString &s)
Check if a particular choice option is selected.
• bool IsInChoices (const char ∗str, size_t strLen)
Check if a string is in the list of possible choices. A comparison will continue until a null character is found, or the
length of the longer of the two strings being compared is reached (strLen is used to determine if str is longer than the
current element being compared.)
• bool IsInChoices (const NBString &str, size_t strLen)
Check if a string is in the list of possible choices. A comparison will continue until a null character is found, or the
length of the longer of the two strings being compared is reached (strLen is used to determine if str is longer than the
current element being compared.)
• const config_string & GetChoices ()
Get the list of choices.
• const config_string & SetChoices (const char ∗in_choices)
Set the list of choices.
• operator NBString () const
Returns the object value.
• config_chooser & operator= (const char ∗p)
Assign the selected list item from a const char∗ value.
• config_chooser & operator= (const NBString &s)
Assign the config_string object value from a NBString object.
• config_chooser & operator= (const config_chooser &ci)
Copy one config_chooser object to another.
• virtual void GetTypeValue (NBString &s)
Assigns the object type value to the specified NBString object.

NetBurner, Inc.
21.9 config_chooser Class Reference 559

21.9.1 Detailed Description


Chooser Configuration Variable - Select From a List of Items.
The config_chooser class provides a list of options with the ability to select one. If used on a web page it would
appear as a drop down box. For example, the choices could be "one", "two", or "three", and "two" could be the item
selected. Since the items are JSON, the selected item is identified by the option name, not a list index.

Note

All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to
save changes to flash memory.

21.9.2 Constructor & Destructor Documentation

21.9.2.1 config_chooser() [1/2]

config_chooser::config_chooser (
config_obj & owner,
const char ∗ name,
const char ∗ in_value,
const char ∗ in_choices,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.

Parameters

owner Reference to owner/parent leaf


name Field name assigned to the value
in_value The option value selected
in_choices The list of option choices
desc Description used for info/tool tip

21.9.2.2 config_chooser() [2/2]

config_chooser::config_chooser (
const char ∗ name,
const char ∗ in_value,
const char ∗ in_choices,
const char ∗ desc = NULL ) [inline]
Object constructor.

Parameters
name Field name assigned to the value
in_value The option value selected
in_choices The list of option choices
desc Description used for info/tool tip

21.9.3 Member Function Documentation

NetBurner, Inc.
560 Class Documentation

21.9.3.1 GetChoices()

const config_string & config_chooser::GetChoices ( ) [inline]


Get the list of choices.
Returns

A config_string object containing the list of choices

21.9.3.2 GetTypeValue()

virtual void config_chooser::GetTypeValue (


NBString & s ) [inline], [virtual]
Assigns the object type value to the specified NBString object.
The type value "object" is written to the NBString object.

Parameters

s NBString object to hold the type value string

Reimplemented from config_obj.

21.9.3.3 IsInChoices() [1/2]

bool config_chooser::IsInChoices (
const char ∗ str,
size_t strLen ) [inline]
Check if a string is in the list of possible choices. A comparison will continue until a null character is found, or the
length of the longer of the two strings being compared is reached (strLen is used to determine if str is longer than
the current element being compared.)

Parameters

str NBString to attempt to find inside the list of choices


strLen Length of str. This value is used to determine the amount of characters to compare for each element
in the list of choices.

Return values

true if str is found as an option in list of choices


false if str is not found in the list of choices

21.9.3.4 IsInChoices() [2/2]

bool config_chooser::IsInChoices (
const NBString & str,
size_t strLen ) [inline]
Check if a string is in the list of possible choices. A comparison will continue until a null character is found, or the
length of the longer of the two strings being compared is reached (strLen is used to determine if str is longer than
the current element being compared.)

Parameters

str NBString to attempt to find inside the list of choices

NetBurner, Inc.
21.9 config_chooser Class Reference 561

Parameters

strLen Length of str. This value is used to determine the amount of characters to compare for each element
in the list of choices.

Return values

true if str is found as an option in list of choices


false if str is not found in the list of choices

21.9.3.5 IsSelected() [1/2]

bool config_chooser::IsSelected (
const char ∗ choice ) [inline]
Check if a particular choice option is selected.

Parameters

choice Choice to test as a string type

Return values

true Selected
false Not Selected

21.9.3.6 IsSelected() [2/2]

bool config_chooser::IsSelected (
const NBString & s ) [inline]
Check if a particular choice option is selected.

Parameters

s Choice to test as a NBString type

Return values

true Selected
false Not Selected

21.9.3.7 operator NBString()

config_chooser::operator NBString ( ) const [inline]


Returns the object value.
Returns

The currently selected list option as a NBString

NetBurner, Inc.
562 Class Documentation

21.9.3.8 operator=() [1/3]

config_chooser & config_chooser::operator= (


const char ∗ p ) [inline]
Assign the selected list item from a const char∗ value.

Parameters

p Selected list item to assign

21.9.3.9 operator=() [2/3]

config_chooser & config_chooser::operator= (


const config_chooser & ci ) [inline]
Copy one config_chooser object to another.

Parameters

ci Reference to a config_chooser object

21.9.3.10 operator=() [3/3]

config_chooser & config_chooser::operator= (


const NBString & s ) [inline]
Assign the config_string object value from a NBString object.

Parameters

s Reference to a NBString object

21.9.3.11 SetChoices()

const config_string & config_chooser::SetChoices (


const char ∗ in_choices ) [inline]
Set the list of choices.

Parameters

in_choices The list of option choices

Returns

A config_string object containing the list of choices

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.10 config_double Class Reference


Double Float Configuration Variable.

NetBurner, Inc.
21.10 config_double Class Reference 563

#include <config_obj.h>
Inherits config_value.

Public Member Functions


• virtual void GetTextValue (NBString &s)
Copy the object value as a text string to the specified NBString object.
• config_double (config_obj &owner, double def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_double (double def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• operator int () const
Return the object value as an int.
• operator float () const
Return the object value as a float.
• operator double () const
Returns the object value as a double float.
• config_double & operator= (const double d)
Assign the config_double object value from a double value.
• config_double & operator= (const config_double &ci)
Copy one config_double object to another.
• virtual void GetTypeValue (NBString &s)
Copy the object type value in the specified NBString object.

Additional Inherited Members


21.10.1 Detailed Description
Double Float Configuration Variable.

Note

All modifications to configuration objects are marked as pending. A call to SaveConfigToStorage is required
to save changes to flash memory.

21.10.2 Constructor & Destructor Documentation

21.10.2.1 config_double() [1/2]

config_double::config_double (
config_obj & owner,
double def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.

Parameters

owner Reference to parent leaf


def_val Default value
name Field name assigned to the value
desc Description used for info/tool tip

NetBurner, Inc.
564 Class Documentation

21.10.2.2 config_double() [2/2]

config_double::config_double (
double def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.

Parameters

def_val Default value


name Field name assigned to the value
desc Description used for info/tool tip

21.10.3 Member Function Documentation

21.10.3.1 GetTextValue()

virtual void config_double::GetTextValue (


NBString & s ) [inline], [virtual]
Copy the object value as a text string to the specified NBString object.
This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

Implements config_value.

21.10.3.2 GetTypeValue()

virtual void config_double::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value in the specified NBString object.
The type value "float" is written to the NBString object.

Parameters

s Reference to a NBString object

21.10.3.3 operator double()

config_double::operator double ( ) const [inline]


Returns the object value as a double float.

Returns

The double float value of the object

Example: for a variable named configInt of type config_double:


double value = double(configInt);
iprintf("int = %f\r\n", value);

NetBurner, Inc.
21.11 config_int Class Reference 565

21.10.3.4 operator float()

config_double::operator float ( ) const [inline]


Return the object value as a float.

Returns

The float value of the object

Example: for a variable named configFloat of type config_double:


float value = float(configFloat);
iprintf("int = %f\r\n", value);

21.10.3.5 operator int()

config_double::operator int ( ) const [inline]


Return the object value as an int.

Returns

The integer value of the object

Example: for a variable named configInt of type config_double:


int value = int(configInt);
iprintf("int = %d\r\n", value);

21.10.3.6 operator=() [1/2]

config_double & config_double::operator= (


const config_double & ci ) [inline]
Copy one config_double object to another.

Parameters

ci Reference to a config_double object

21.10.3.7 operator=() [2/2]

config_double & config_double::operator= (


const double d ) [inline]
Assign the config_double object value from a double value.

Parameters

d Value of type double

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.11 config_int Class Reference


Signed 32-bit Integer Configuration Variable.
#include <config_obj.h>
Inherits config_value.
Inherited by version_obj.

NetBurner, Inc.
566 Class Documentation

Public Member Functions


• virtual void GetTextValue (NBString &s)
Copy the object value to the specified NBString object.
• config_int (config_obj &owner, int def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_int (int def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• operator int () const
Return the object value as an int.
• config_int & operator= (const int i)
Assign the config_int object value to the specified int value.
• config_int & operator= (const config_int &ci)
Copy one config_int object to another.
• virtual void GetTypeValue (NBString &s)
Copy the object type value in the specified NBString object.

Additional Inherited Members


21.11.1 Detailed Description
Signed 32-bit Integer Configuration Variable.

Note

All modifications to configuration objects are marked as pending. A call to SaveConfigToStorage is required
to save changes to flash memory.

21.11.2 Constructor & Destructor Documentation

21.11.2.1 config_int() [1/2]

config_int::config_int (
config_obj & owner,
int def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.

Parameters

owner Reference to owner/parent leaf


def_val Default value
name Field name assigned to the value
desc Description used for info/tool tip

21.11.2.2 config_int() [2/2]

config_int::config_int (
int def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.

NetBurner, Inc.
21.11 config_int Class Reference 567

Parameters

def_val Default value


name Field name assigned to the value
desc Description used for info/tool tip

21.11.3 Member Function Documentation

21.11.3.1 GetTextValue()

virtual void config_int::GetTextValue (


NBString & s ) [inline], [virtual]
Copy the object value to the specified NBString object.
This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

Implements config_value.

21.11.3.2 GetTypeValue()

virtual void config_int::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value in the specified NBString object.
The type value "integer" is written to the NBString object.

Parameters

s Reference to a NBString object

21.11.3.3 operator int()

config_int::operator int ( ) const [inline]


Return the object value as an int.

Returns

The integer value of the object

Example: for a variable named configInt of type config_int:


int value = int(configInt);
iprintf("int = %d\r\n", value);

21.11.3.4 operator=() [1/2]

config_int & config_int::operator= (


const config_int & ci ) [inline]
Copy one config_int object to another.

NetBurner, Inc.
568 Class Documentation

Parameters

ci Reference to a config_int object

21.11.3.5 operator=() [2/2]

config_int & config_int::operator= (


const int i ) [inline]
Assign the config_int object value to the specified int value.

Parameters
i Integer value

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.12 config_IPADDR Class Reference


Configuration Variable for IPADDR (IPv6) object type.
#include <config_obj.h>
Inherits config_value.

Public Member Functions


• virtual void GetTextValue (NBString &s)
Get the object value as a text string with quotations to the specified NBString object.
• config_IPADDR (config_obj &owner, IPADDR def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_IPADDR (IPADDR def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• config_IPADDR (config_obj &owner, const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_IPADDR (const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• operator IPADDR () const
Returns the object value.
• bool IsNull () const
Check if the IP address is null.
• bool NotNull () const
Check if the IP address is not null.
• void SetNull ()
Set the IP address value of an config_IPADDR object to null.
• config_IPADDR & operator= (const IPADDR &i6)
Copy an IPADDR object value to a config_IPADDR object.
• config_IPADDR & operator= (const config_IPADDR &ci)
Copy one config_IPADDR object to another.
• virtual void GetTypeValue (NBString &s)
Copy the object type value to the specified NBString object.

NetBurner, Inc.
21.12 config_IPADDR Class Reference 569

Additional Inherited Members


21.12.1 Detailed Description
Configuration Variable for IPADDR (IPv6) object type.

See also

config_IPADDR4

Note

All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to
save changes to flash memory.

21.12.2 Constructor & Destructor Documentation

21.12.2.1 config_IPADDR() [1/4]

config_IPADDR::config_IPADDR (
config_obj & owner,
IPADDR def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value assigned with an IPADDR object

Parameters

owner Reference to owner/parent leaf


def_val Default value of type IPADDR
name Field name assigned to the value
desc Description used for info/tool tip

21.12.2.2 config_IPADDR() [2/4]

config_IPADDR::config_IPADDR (
IPADDR def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value assigned with an IPADDR object

Parameters

def_val Default value of type NBString


name Field name assigned to the value
desc Description used for info/tool tip

21.12.2.3 config_IPADDR() [3/4]

config_IPADDR::config_IPADDR (
config_obj & owner,

NetBurner, Inc.
570 Class Documentation

const char ∗ def_val,


const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value assigned with an const char ∗ string. IP address is converted using the SetFromAscii() IPADDR
member function.

Parameters

owner Reference to owner/parent leaf


def_val Default value of type char ∗ in IPv6 format
name Field name assigned to the value
desc Description used for info/tool tip

21.12.2.4 config_IPADDR() [4/4]

config_IPADDR::config_IPADDR (
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value assigned with an const char ∗ string. IP address is converted using the SetFromAscii() IPADDR
member function.

Parameters

def_val Default value of type char ∗ in IPv6 format


name Field name assigned to the value
desc Description used for info/tool tip

21.12.3 Member Function Documentation

21.12.3.1 GetTextValue()

virtual void config_IPADDR::GetTextValue (


NBString & s ) [inline], [virtual]
Get the object value as a text string with quotations to the specified NBString object.
This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

Implements config_value.

21.12.3.2 GetTypeValue()

virtual void config_IPADDR::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value to the specified NBString object.
The type value "string" is written to the NBString object.

NetBurner, Inc.
21.12 config_IPADDR Class Reference 571

Parameters

s NBString object to hold the type value string

21.12.3.3 IsNull()

bool config_IPADDR::IsNull ( ) const [inline]


Check if the IP address is null.

Return values

true if the IP address value is null

See also

NotNull()

21.12.3.4 NotNull()

bool config_IPADDR::NotNull ( ) const [inline]


Check if the IP address is not null.

Return values

true if the IP address value is not null

See also

IsNull()

21.12.3.5 operator IPADDR()

config_IPADDR::operator IPADDR ( ) const [inline]


Returns the object value.

Returns

The value of the object as an IPADDR object

21.12.3.6 operator=() [1/2]

config_IPADDR & config_IPADDR::operator= (


const config_IPADDR & ci ) [inline]
Copy one config_IPADDR object to another.

Parameters

ci Reference to a config_IPADDR object

NetBurner, Inc.
572 Class Documentation

21.12.3.7 operator=() [2/2]

config_IPADDR & config_IPADDR::operator= (


const IPADDR & i6 ) [inline]
Copy an IPADDR object value to a config_IPADDR object.

Parameters

i6 Reference to an IPADDR object

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.13 config_IPADDR4 Class Reference


Configuration Variable for IPADDR4 (IPv4) object types.
#include <config_obj.h>
Inherits config_value.

Public Member Functions


• virtual void GetTextValue (NBString &s)
Get the object value as a text string with quotations to the specified NBString object.
• config_IPADDR4 (config_obj &owner, IPADDR4 def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_IPADDR4 (IPADDR4 def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• config_IPADDR4 (config_obj &owner, const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_IPADDR4 (const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• operator IPADDR4 () const
Returns the object value.
• bool IsNull () const
Check if the IP address is null.
• bool NotNull () const
Check if the IP address is not null.
• void SetNull ()
Set the IP address to null.
• config_IPADDR4 & operator= (const IPADDR4 &i4)
Copy an IPADDR4 object value to a config_IPADDR4 object.
• config_IPADDR4 & operator= (const config_IPADDR4 &ci)
Copy one config_IPADDR4 object to another.
• virtual void GetTypeValue (NBString &s)
Copy the object type value to the specified NBString object.

Additional Inherited Members


21.13.1 Detailed Description
Configuration Variable for IPADDR4 (IPv4) object types.

NetBurner, Inc.
21.13 config_IPADDR4 Class Reference 573

See also

config_IPADDR

Note

All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to
save changes to flash memory.

21.13.2 Constructor & Destructor Documentation

21.13.2.1 config_IPADDR4() [1/4]

config_IPADDR4::config_IPADDR4 (
config_obj & owner,
IPADDR4 def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value assigned with an IPADDR4 object

Parameters

owner Reference to owner/parent leaf


def_val Default value of type IPADDR4
name Field name assigned to the value
desc Description used for info/tool tip

21.13.2.2 config_IPADDR4() [2/4]

config_IPADDR4::config_IPADDR4 (
IPADDR4 def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value assigned with an IPADDR4 object

Parameters

def_val Default value of type NBString


name Field name assigned to the value
desc Description used for info/tool tip

21.13.2.3 config_IPADDR4() [3/4]

config_IPADDR4::config_IPADDR4 (
config_obj & owner,
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.

NetBurner, Inc.
574 Class Documentation

Default value assigned with an const char ∗ string. IP address is converted using the IPADDR4 SetFromAscii()
member function.

Parameters

owner Reference to owner/parent leaf


def_val Default value of type char ∗. Format is: "xxx.xxx.xxx.xxx". For example, "10.1.1.100"
name Field name assigned to the value
desc Description used for info/tool tip

21.13.2.4 config_IPADDR4() [4/4]

config_IPADDR4::config_IPADDR4 (
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value assigned with an const char ∗ string. IP address is converted using the IPADDR4 SetFromAscii()
member function.

Parameters

def_val Default value of type char ∗. Format is: "xxx.xxx.xxx.xxx". For example, "10.1.1.100"
name Field name assigned to the value
desc Description used for info/tool tip

21.13.3 Member Function Documentation

21.13.3.1 GetTextValue()

virtual void config_IPADDR4::GetTextValue (


NBString & s ) [inline], [virtual]
Get the object value as a text string with quotations to the specified NBString object.
The format of the string is: "xxx.xxx.xxx.xxx". This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

Implements config_value.

21.13.3.2 GetTypeValue()

virtual void config_IPADDR4::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value to the specified NBString object.
The type value "string" is written to the NBString object.

Parameters

s NBString object to hold the type value string

NetBurner, Inc.
21.13 config_IPADDR4 Class Reference 575

21.13.3.3 IsNull()

bool config_IPADDR4::IsNull ( ) const [inline]


Check if the IP address is null.

Return values

true if the IP address value is null

See also

NotNull(), SetNull()

21.13.3.4 NotNull()

bool config_IPADDR4::NotNull ( ) const [inline]


Check if the IP address is not null.

Return values

true if the IP address value is not null

See also

IsNull(), SetNull()

21.13.3.5 operator IPADDR4()

config_IPADDR4::operator IPADDR4 ( ) const [inline]


Returns the object value.

Returns

The value of the object as an IPADDR4

21.13.3.6 operator=() [1/2]

config_IPADDR4 & config_IPADDR4::operator= (


const config_IPADDR4 & ci ) [inline]
Copy one config_IPADDR4 object to another.

Parameters

ci Reference to a config_IPADDR4 object

21.13.3.7 operator=() [2/2]

config_IPADDR4 & config_IPADDR4::operator= (


const IPADDR4 & i4 ) [inline]
Copy an IPADDR4 object value to a config_IPADDR4 object.

NetBurner, Inc.
576 Class Documentation

Parameters

i4 Reference to an IPADDR4 object

21.13.3.8 SetNull()

void config_IPADDR4::SetNull ( ) [inline]


Set the IP address to null.
See also

IsNull(), NotNull()

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.14 config_MACADR Class Reference


Configuration Variable for MACADR object type.
#include <config_obj.h>
Inherits config_value.

Public Member Functions


• virtual void GetTextValue (NBString &s)
Get the object value as a text string with quotations to the specified NBString object.
• config_MACADR (config_obj &owner, MACADR def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_MACADR (MACADR def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• config_MACADR (config_obj &owner, const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_MACADR (const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• operator MACADR () const
Returns the object value.
• config_MACADR & operator= (const config_MACADR &ci)
Copy one config_MACADR object to another.
• config_MACADR & operator= (const MACADR &ci)
Copy a MACADR object value to a MACADR object.
• virtual void GetTypeValue (NBString &s)
Copy the object type value to the specified NBString object.

Additional Inherited Members


21.14.1 Detailed Description
Configuration Variable for MACADR object type.

Note

All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to
save changes to flash memory.

NetBurner, Inc.
21.14 config_MACADR Class Reference 577

21.14.2 Constructor & Destructor Documentation

21.14.2.1 config_MACADR() [1/4]

config_MACADR::config_MACADR (
config_obj & owner,
MACADR def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value assigned with an MACADR object

Parameters

owner Reference to owner/parent leaf


def_val Default value of type MACADR
name Field name assigned to the value
desc Description used for info/tool tip

21.14.2.2 config_MACADR() [2/4]

config_MACADR::config_MACADR (
MACADR def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value assigned with an MACADR object

Parameters

def_val Default value of type MACADR


name Field name assigned to the value
desc Description used for info/tool tip

21.14.2.3 config_MACADR() [3/4]

config_MACADR::config_MACADR (
config_obj & owner,
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value is assigned with a const char ∗ string. The AsciiToMac() function is used to convert the string to a
MACADR.

Parameters

owner Reference to owner/parent leaf


def_val Default MAC Address value of type char ∗. The hexidical format must be 6 octets, with or without ':'
separators. For example, "0123456789AB", or "01:23:45:67:89:AB"
name Field name assigned to the value
desc Description used for info/tool tip

NetBurner, Inc.
578 Class Documentation

21.14.2.4 config_MACADR() [4/4]

config_MACADR::config_MACADR (
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value is assigned with a const char ∗ string. The AsciiToMac() function is used to convert the string to a
MACADR.

Parameters

def_val Default MAC Address value of type char ∗. The hexidical format must be 6 octets, with or without ':'
separators. For example, "0123456789AB", or "01:23:45:67:89:AB"
name Field name assigned to the value
desc Description used for info/tool tip

21.14.3 Member Function Documentation

21.14.3.1 GetTextValue()

virtual void config_MACADR::GetTextValue (


NBString & s ) [inline], [virtual]
Get the object value as a text string with quotations to the specified NBString object.
The format is the hexadecimal address: "xx:xx:xx:xx:xx:xx" This is a virtual function that can be overridden in any
derived class.

Parameters

s Reference to a NBString object to store the result

Implements config_value.

21.14.3.2 GetTypeValue()

virtual void config_MACADR::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value to the specified NBString object.
The type value "string" is written to the NBString object.

Parameters

s NBString object to hold the type value string

21.14.3.3 operator MACADR()

config_MACADR::operator MACADR ( ) const [inline]


Returns the object value.

NetBurner, Inc.
21.15 config_obj Class Reference 579

Returns

The value of the object as a MACADR

21.14.3.4 operator=() [1/2]

config_MACADR & config_MACADR::operator= (


const config_MACADR & ci ) [inline]
Copy one config_MACADR object to another.

Parameters

ci Reference to a config_IPADDR object

21.14.3.5 operator=() [2/2]

config_MACADR & config_MACADR::operator= (


const MACADR & ci ) [inline]
Copy a MACADR object value to a MACADR object.

Parameters

ci Reference to an MACADR object

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.15 config_obj Class Reference


Base class used to create configuration objects.
#include <config_obj.h>
Inherits config_leaf.
Inherited by EmailNotify, I4Record, I6Record, InterfaceBlock, LLDPEntity, MonitorRecord, NV_OneI2CPortSetting,
NV_OnePortSetting, NV_SettingsStruct, OneConfigRecord, SysRecord, TempRange, TempRange, ThermoGroup,
Thermostat1, config_chooser, config_preserver_obj, empty_config_obj, and root_obj.

Public Member Functions


• config_obj (config_obj &owner, const char ∗name, const char ∗desc)
Object constructor with the parent/owner leaf parameter.
• config_obj (const char ∗name, const char ∗desc)
Object constructor.
• virtual void GetTextValue (NBString &s)
Get the object value as a text string to the specified NBString object.
• virtual void GetTypeValue (NBString &s)
Assigns the object type value to the specified NBString object.

21.15.1 Detailed Description


Base class used to create configuration objects.
Base that can be used to create your own custom configuration objects in a JSON compatible format. The object
can hold any number of JSON compatible types: integer, boolean, null, string, object or array.

NetBurner, Inc.
580 Class Documentation

A config_obj can hold multiple values in a JSON object. A config_value holds only a single JSON value.

See also

config_value

The example below demonstrates how to create a thermostat object with a temperature range derived from a
config_obj:

Note

Please check the Configuration Class example in the \nburn\examples folder for the latest code updates.

The use of config objects should be done at a global scope. They can contain any number of members,
which should be given a default value and a name used as an identifier. The name value for each
member variable should be unique, otherwise it can lead to issues inside the config tree.
class TempRange : public config_obj
{
public:
// Class variables
config_int m_maxTemp{100, "MaxTemp"};
config_int m_setTemp{30, "SetTemp"};
config_int m_minTemp{10, "MinTemp"};
ConfigEndMarker; // No new data members below this line
// Class constructors
TempRange(const char *name, const char *desc = nullptr) : config_obj(name, desc){};
TempRange(config_obj &owner, const char *name, const char *desc = nullptr) : config_obj(owner, name,
desc){};
};
class Thermostat : public TempRange
{
public:
config_int m_tempRec1{101, "TempRecord_1"};
config_int m_tempRec2{102, "TempRecord_2"};
config_bool m_active{true, "Active"};
config_string m_location{"Warehouse 1", "Thermostat Location"};
config_chooser m_tempScale{"Temperature Scale", "Fahrenheit", "Fahrenheit,Celsius,Kelvin"};
ConfigEndMarker; // No new data members below this line
Thermostat(const char *name, const char *desc = nullptr) : TempRange(name, desc){};
Thermostat(config_obj &owner, const char *name, const char *desc = nullptr) : TempRange(owner, name,
desc){};
};
static Thermostat thermo(appdata, "Thermostat", "The primary thermostat");

Note

All modifications to configuration objects are marked as pending. A call to SaveConfigToStorage is required
to save changes to flash memory.

21.15.2 Constructor & Destructor Documentation

21.15.2.1 config_obj() [1/2]

config_obj::config_obj (
config_obj & owner,
const char ∗ name,
const char ∗ desc ) [inline]
Object constructor with the parent/owner leaf parameter.
For example,
myObject(config_obj &owner, const char *name, const char *desc = nullptr) : config_obj(owner, name, desc){};

Parameters

owner Reference to owner/parent leaf


name Field name
desc Description used for info/tool tip

NetBurner, Inc.
21.16 config_pass Class Reference 581

21.15.2.2 config_obj() [2/2]

config_obj::config_obj (
const char ∗ name,
const char ∗ desc ) [inline]
Object constructor.
This constructor should be called as part of the derived class constructor. For example,
myObject(const char *name, const char *desc = nullptr) : config_obj(name, desc){}

Parameters
name Field name
desc Description used for info/tool tip

21.15.3 Member Function Documentation

21.15.3.1 GetTextValue()

void config_obj::GetTextValue (
NBString & s ) [virtual]
Get the object value as a text string to the specified NBString object.
This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

21.15.3.2 GetTypeValue()

virtual void config_obj::GetTypeValue (


NBString & s ) [inline], [virtual]
Assigns the object type value to the specified NBString object.
The type value "object" is written to the NBString object.

Parameters

s NBString object to hold the type value string

Reimplemented in config_chooser.
The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.16 config_pass Class Reference


Password string Configuration Variable.
#include <config_obj.h>
Inherits config_string.

Public Member Functions


• config_pass (config_obj &owner, NBString def_val, const char ∗name, const char ∗desc=NULL)

NetBurner, Inc.
582 Class Documentation

Object constructor with the parent/owner leaf parameter.


• config_pass (NBString def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• config_pass (config_obj &owner, const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_pass (const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• virtual void GetTextValue (NBString &s)
Get the config_pass object value as a text string.
• virtual void GetRawValue (NBString &s)
Copy the raw config_string object value to the NBString object.
• operator NBString () const
Returns the object value.
• config_pass & operator= (const char ∗p)
Assign the config_pass object value from a const char∗ value.
• config_pass & operator= (const NBString &s)
Assign the config_pass object value from a NBString object.
• config_pass & operator= (const config_string &ci)
Copy a config_string object to a config_pass object.
• config_pass & operator= (const config_pass &ci)
Copy one config_pass object to another.

Additional Inherited Members


21.16.1 Detailed Description
Password string Configuration Variable.
A config_pass is like a config_string, but the data is hidden by '∗' characters.

Note

All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to
save changes to flash memory.

21.16.2 Constructor & Destructor Documentation

21.16.2.1 config_pass() [1/4]

config_pass::config_pass (
config_obj & owner,
NBString def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value is assigned with a NBString

Parameters

owner Reference to owner/parent leaf


def_val Default value of type NBString
name Field name assigned to the value
desc Description used for info/tool tip

NetBurner, Inc.
21.16 config_pass Class Reference 583

21.16.2.2 config_pass() [2/4]

config_pass::config_pass (
NBString def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value is assigned with a NBString

Parameters

def_val Default value of type NBString


name Field name assigned to the value
desc Description used for info/tool tip

21.16.2.3 config_pass() [3/4]

config_pass::config_pass (
config_obj & owner,
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value is assigned with a character string

Parameters

owner Reference to owner/parent leaf


def_val Default value of type char ∗
name Field name assigned to the value
desc Description used for info/tool tip

21.16.2.4 config_pass() [4/4]

config_pass::config_pass (
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value is assigned with a character string

Parameters

def_val Default value of type char ∗


name Field name assigned to the value
desc Description used for info/tool tip

NetBurner, Inc.
584 Class Documentation

21.16.3 Member Function Documentation

21.16.3.1 GetRawValue()

void config_pass::GetRawValue (
NBString & s ) [virtual]
Copy the raw config_string object value to the NBString object.

Parameters

s Reference to a NBString object

This is a virtual function that can be overridden in any derived class.

21.16.3.2 GetTextValue()

void config_pass::GetTextValue (
NBString & s ) [virtual]
Get the config_pass object value as a text string.
This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

Reimplemented from config_string.

21.16.3.3 operator NBString()

config_pass::operator NBString ( ) const [inline]


Returns the object value.

Returns

The value of the object as a NBString

21.16.3.4 operator=() [1/4]

config_pass & config_pass::operator= (


const char ∗ p ) [inline]
Assign the config_pass object value from a const char∗ value.

Parameters

p String to assign

21.16.3.5 operator=() [2/4]

config_pass & config_pass::operator= (


const config_pass & ci ) [inline]
Copy one config_pass object to another.

NetBurner, Inc.
21.17 config_string Class Reference 585

Parameters

ci Reference to a config_pass object

21.16.3.6 operator=() [3/4]

config_pass & config_pass::operator= (


const config_string & ci ) [inline]
Copy a config_string object to a config_pass object.

Parameters

ci Reference to a config_string object

21.16.3.7 operator=() [4/4]

config_pass & config_pass::operator= (


const NBString & s ) [inline]
Assign the config_pass object value from a NBString object.

Parameters

s Reference to a NBString object

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.17 config_string Class Reference


String Configuration Variable.
#include <config_obj.h>
Inherits config_value.
Inherited by config_localname, config_pass, and config_time_t.

Public Member Functions


• virtual void GetTextValue (NBString &s)
Get the object value (as a text string with quotations) to the specified NBString object.
• config_string (config_obj &owner, NBString def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_string (NBString def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• config_string (config_obj &owner, const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_string (const char ∗def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• void SetEnumList (NBString s)
Renders the data used to explain the schema/descriptions for the list of choices.
• operator NBString () const

NetBurner, Inc.
586 Class Documentation

Return the object value.


• config_string & operator= (const char ∗p)
Assign the config_string object value from a const char∗ string.
• config_string & operator= (const NBString &s)
Assign the config_string object value from a NBString object.
• config_string & operator= (const config_string &ci)
Copy one config_string object to another.
• const char ∗ c_str () const
Returns the object value as a string.
• size_t length () const
Returns the string length in bytes.
• const char & operator[ ] (size_t pos) const
Return the value of a character in the string.
• virtual void GetTypeValue (NBString &s)
Copy the object type value to the specified NBString object.

Friends
• class config_pass
• class config_chooser

Additional Inherited Members


21.17.1 Detailed Description
String Configuration Variable.

Note

All modifictions to configuration objects are marked as pending. A call to SaveConfigToStorage is required to
save changes to flash memory.

21.17.2 Constructor & Destructor Documentation

21.17.2.1 config_string() [1/4]

config_string::config_string (
config_obj & owner,
NBString def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value assigned with a NBString

Parameters

owner Reference to owner/parent leaf


def_val Default value of type NBString
name Field name assigned to the value
desc Description used for info/tool tip

NetBurner, Inc.
21.17 config_string Class Reference 587

21.17.2.2 config_string() [2/4]

config_string::config_string (
NBString def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value assigned with a NBString

Parameters

def_val Default value of type NBString


name Field name assigned to the value
desc Description used for info/tool tip

21.17.2.3 config_string() [3/4]

config_string::config_string (
config_obj & owner,
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.
Default value assigned with a character string

Parameters

owner Reference to owner/parent leaf


def_val Default value of type char ∗
name Field name assigned to the value
desc Description used for info/tool tip

21.17.2.4 config_string() [4/4]

config_string::config_string (
const char ∗ def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.
Default value assigned with a character string

Parameters

def_val Default value of type char ∗


name Field name assigned to the value
desc Description used for info/tool tip

21.17.3 Member Function Documentation

NetBurner, Inc.
588 Class Documentation

21.17.3.1 c_str()

const char ∗ config_string::c_str ( ) const [inline]


Returns the object value as a string.

Returns

String value of object

21.17.3.2 GetTextValue()

virtual void config_string::GetTextValue (


NBString & s ) [inline], [virtual]
Get the object value (as a text string with quotations) to the specified NBString object.
This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

Implements config_value.
Reimplemented in config_pass.

21.17.3.3 GetTypeValue()

virtual void config_string::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value to the specified NBString object.
The type value "string" is written to the NBString object.

Parameters

s NBString object to hold the type value string

21.17.3.4 length()

size_t config_string::length ( ) const [inline]


Returns the string length in bytes.

Returns

String length

21.17.3.5 operator NBString()

config_string::operator NBString ( ) const [inline]


Return the object value.

Returns

The value of the object as a NBString

NetBurner, Inc.
21.17 config_string Class Reference 589

21.17.3.6 operator=() [1/3]

config_string & config_string::operator= (


const char ∗ p ) [inline]
Assign the config_string object value from a const char∗ string.

Parameters

p String to assign

21.17.3.7 operator=() [2/3]

config_string & config_string::operator= (


const config_string & ci ) [inline]
Copy one config_string object to another.

Parameters

ci Reference to a config_string object

21.17.3.8 operator=() [3/3]

config_string & config_string::operator= (


const NBString & s ) [inline]
Assign the config_string object value from a NBString object.

Parameters

s Reference to a NBString object

21.17.3.9 operator[]()

const char & config_string::operator[ ] (


size_t pos ) const [inline]
Return the value of a character in the string.

Parameters

pos Character index/position in the string

Returns

Character value at the specified index

21.17.3.10 SetEnumList()

void config_string::SetEnumList (
NBString s ) [inline]
Renders the data used to explain the schema/descriptions for the list of choices.

NetBurner, Inc.
590 Class Documentation

Parameters

s Enumerated list that is a string with choices separated by commas (',') with no spaces. For example,
"one,two,three"

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.18 config_uint Class Reference


Unsigned 32-bit Integer Configuration Variable.
#include <config_obj.h>
Inherits config_value.

Public Member Functions


• virtual void GetTextValue (NBString &s)
Copy the object value to the specified NBString object.
• config_uint (config_obj &owner, uint32_t def_val, const char ∗name, const char ∗desc=NULL)
Object constructor with the parent/owner leaf parameter.
• config_uint (uint32_t def_val, const char ∗name, const char ∗desc=NULL)
Object constructor.
• operator uint32_t () const
Return the object value.
• config_uint & operator= (const uint32_t i)
Assign the config_uint object value from a uint32_t value.
• config_uint & operator= (const config_uint &ci)
Copy one config_uint object to another.
• virtual void GetTypeValue (NBString &s)
Copy the object type value to the specified NBString object.

Additional Inherited Members


21.18.1 Detailed Description
Unsigned 32-bit Integer Configuration Variable.

Note

All modifications to configuration objects are marked as pending. A call to SaveConfigToStorage is required
to save changes to flash memory.

21.18.2 Constructor & Destructor Documentation

21.18.2.1 config_uint() [1/2]

config_uint::config_uint (
config_obj & owner,
uint32_t def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor with the parent/owner leaf parameter.

NetBurner, Inc.
21.18 config_uint Class Reference 591

Parameters

owner Reference to owner/parent leaf


def_val Default value
name Field name assigned to the value
desc Description used for info/tool tip

21.18.2.2 config_uint() [2/2]

config_uint::config_uint (
uint32_t def_val,
const char ∗ name,
const char ∗ desc = NULL ) [inline]
Object constructor.

Parameters

def_val Default value


name Field name assigned to the value
desc Description used for info/tool tip

21.18.3 Member Function Documentation

21.18.3.1 GetTextValue()

virtual void config_uint::GetTextValue (


NBString & s ) [inline], [virtual]
Copy the object value to the specified NBString object.
This is a virtual function that can be overridden in any derived class.

Parameters

s Reference to a NBString object to store the result

Implements config_value.

21.18.3.2 GetTypeValue()

virtual void config_uint::GetTypeValue (


NBString & s ) [inline], [virtual]
Copy the object type value to the specified NBString object.
The type value "integer" is written to the NBString object.

Parameters

s NBString object to hold the type value string

NetBurner, Inc.
592 Class Documentation

21.18.3.3 operator uint32_t()

config_uint::operator uint32_t ( ) const [inline]


Return the object value.

Returns

The value of the object as a uint32_t

Example: for a variable named configuInt of type config_uint:


uint32_t value = uint32_t(configuInt);
iprintf("int = %ld\r\n", value);

21.18.3.4 operator=() [1/2]

config_uint & config_uint::operator= (


const config_uint & ci ) [inline]
Copy one config_uint object to another.

Parameters

ci Reference to a config_uint object

21.18.3.5 operator=() [2/2]

config_uint & config_uint::operator= (


const uint32_t i ) [inline]
Assign the config_uint object value from a uint32_t value.

Parameters
i uint32_t value

The documentation for this class was generated from the following files:

• config_obj.h
• config_obj.cpp

21.19 config_value Class Reference


Base class used to create a configuration value.
#include <config_obj.h>
Inherits config_leaf.
Inherited by CUR_IPADDR4, Dynamic_IPADDR, config_IPADDR, config_IPADDR4, config_MACADR, config_bool,
config_double, config_int, config_report, config_string, and config_uint.

Protected Member Functions


• config_value (config_obj &owner, const char ∗name, const char ∗desc)
Object constructor with the parent/owner leaf parameter.
• config_value (const char ∗name, const char ∗desc)
Object constructor.

21.19.1 Detailed Description


Base class used to create a configuration value.

NetBurner, Inc.
21.20 DelayObject Class Reference 593

Base class that can be used to create custom configuration values in a JSON compatible format. The JSON
compatible types are: integer, boolean, null, string, object or array.

The system already provides the common JSON value types, including: config_int, config_uint, config_bool,
config_chooser, config_string, config_pass, config_IPADDR4, config_IPADDR, config_MACADR,
A config_obj can hold multiple values in a JSON object. A config_value holds only a single JSON value.

See also

config_obj

21.19.2 Constructor & Destructor Documentation

21.19.2.1 config_value() [1/2]

config_value::config_value (
config_obj & owner,
const char ∗ name,
const char ∗ desc ) [inline], [protected]
Object constructor with the parent/owner leaf parameter.
For example,
myValue(config_obj &owner, const char *name, const char *desc = nullptr) : config_value(owner, name,
desc){};

Parameters

owner Reference to owner/parent leaf


name Field name
desc Description used for info/tool tip

21.19.2.2 config_value() [2/2]

config_value::config_value (
const char ∗ name,
const char ∗ desc ) [inline], [protected]
Object constructor.
This constructor should be called as part of the derived class constructor. For example,
myValue(const char *name, const char *desc = nullptr) : config_value(name, desc){}

Parameters
name Field name
desc Description used for info/tool tip

The documentation for this class was generated from the following file:
• config_obj.h

21.20 DelayObject Class Reference


Microsecond Delay Class.
#include <HiResDelay.h>

Public Member Functions


• DelayObject (int Timer=FIRST_UNUSED_TIMER)

NetBurner, Inc.
594 Class Documentation

Microsecond Delay Timer Constructor.


• void DelayUsec (uint32_t usec)
Microsecond Delay Timer.
• bool valid ()
Verify a valid delay object was constructed.

21.20.1 Detailed Description


Microsecond Delay Class.
Creates a high resolution microsecond timer object by allocating one a free processor system timer. Once the delay
has expired, the system timer is releaed back to the free pool.
Example Usage:
static DelayObject myHiResDelay; // Create the object
myHiDrsDelay.DelayUsec(100); // Delay 100 us
myHiDrsDelay.DelayUsec(200); // Delay 200 us
myHiDrsDelay.DelayUsec(300); // Delay 300 us

See also

Interval Timer
Stopwatch Timer
OSTimeDly()

21.20.2 Constructor & Destructor Documentation

21.20.2.1 DelayObject()

DelayObject::DelayObject (
int Timer = FIRST_UNUSED_TIMER )
Microsecond Delay Timer Constructor.

Parameters

Timer Optional parameter to select a specific time. Recommend use is the to not specify a timer so the first
free timer will be used.

21.20.3 Member Function Documentation

21.20.3.1 DelayUsec()

void DelayObject::DelayUsec (
uint32_t usec )
Microsecond Delay Timer.

Parameters

usec The number of microseconds to delay

21.20.3.2 valid()

bool DelayObject::valid ( ) [inline]


Verify a valid delay object was constructed.

NetBurner, Inc.
21.21 DhcpObject Class Reference 595

Return values
True - A timer was correctly allocated and initialized
False - No free timers were available

The documentation for this class was generated from the following file:

• HiResDelay.h

21.21 DhcpObject Class Reference


DHCP client class.
#include <dhcpclient.h>
Inherits TimeOutElement.

Public Member Functions


• void StartDHCP ()
Manually start the DHCP Client.
• void StopDHCP ()
Manually stop the DHCP client and release the DHCP lease.
• void RestartDHCP ()
Manually stop are resetart the DHCP client.
• bool bDoFallBack ()
Returns true if a DHCP fallback event has occurred.
• void RenewDHCP ()
Manually force a DHCP renew of a lease.
• void RebindDHCP ()
Manually force a DHCP rebind of a lease.
• BOOL ValidDhcpLease ()
Returns the status of a DHCP lease.
• uint32_t GetRemainingDhcpLeaseTime ()
Returns number of seconds remaining for current lease.
• uint32_t GetDhcpRenewTime ()
Returns number of seconds remaining before the lease will be renewed.
• uint32_t GetDhcpRebindTime ()
Returns number of seconds remaining before the current lease will have to rebind.
• uint32_t GetDhcpExpirationTime ()
Returns number of seconds remaining before the current lease will expire.
• int32_t GetDHCPState ()
Returns current state of the DHCP lease.

21.21.1 Detailed Description


DHCP client class.

21.21.2 Member Function Documentation

NetBurner, Inc.
596 Class Documentation

21.21.2.1 bDoFallBack()

bool DhcpObject::bDoFallBack ( )
Returns true if a DHCP fallback event has occurred.
The init() function called at the beginning of an application will handle DHCP client services for all network interfaces.
It is rare that you would need to call these functions manually.
If the fallback functionality has been enabled in the device configuration, this function can be used to determine if a
fallback to a static IP settings has occurred.

Returns

True if a fallback condition has occurred.

21.21.2.2 GetDhcpExpirationTime()

uint32_t DhcpObject::GetDhcpExpirationTime ( ) [inline]


Returns number of seconds remaining before the current lease will expire.

Returns

The number of seconds remaining before the current lease will expire.

See also

GetRemainingDhcpLeaseTime(), GetDhcpRenewTime(), GetDhcpRebindTime()

21.21.2.3 GetDhcpRebindTime()

uint32_t DhcpObject::GetDhcpRebindTime ( ) [inline]


Returns number of seconds remaining before the current lease will have to rebind.

Returns

The number of seconds remaining before the current lease will have to rebind.

See also

GetRemainingDhcpLeaseTime(), GetDhcpRenewTime(), GetDhcpExpirationTime()

21.21.2.4 GetDhcpRenewTime()

uint32_t DhcpObject::GetDhcpRenewTime ( ) [inline]


Returns number of seconds remaining before the lease will be renewed.

Returns

The number of seconds remaining before the lease will be renewed.

See also

GetRemainingDhcpLeaseTime(), GetDhcpRebindTime(), GetDhcpExpirationTime()

NetBurner, Inc.
21.21 DhcpObject Class Reference 597

21.21.2.5 GetDHCPState()

int32_t DhcpObject::GetDHCPState ( )
Returns current state of the DHCP lease.
Returns

DHCP State

See also

ValidDhcpLease()

21.21.2.6 GetRemainingDhcpLeaseTime()

uint32_t DhcpObject::GetRemainingDhcpLeaseTime ( )
Returns number of seconds remaining for current lease.
Returns

The number of seconds remaining for current lease.

See also

GetDhcpRenewTime(), GetDhcpRebindTime(), GetDhcpExpirationTime()

21.21.2.7 RebindDHCP()

void DhcpObject::RebindDHCP ( )
Manually force a DHCP rebind of a lease.
The init() function called at the beginning of an application will handle DHCP client services for all network interfaces.
It is rare that you would need to call these functions manually.
See also

RenewDHCP()

21.21.2.8 RenewDHCP()

void DhcpObject::RenewDHCP ( )
Manually force a DHCP renew of a lease.
The init() function called at the beginning of an application will handle DHCP client services for all network interfaces.
It is rare that you would need to call these functions manually.
See also

RebindDHCP()

21.21.2.9 RestartDHCP()

void DhcpObject::RestartDHCP ( )
Manually stop are resetart the DHCP client.
The init() function called at the beginning of an application will handle DHCP client services for all network interfaces.
It is rare that you would need to call these functions manually.
See also

DhcpObject::StartDHCP(), DhcpObject::StopDHCP()

NetBurner, Inc.
598 Class Documentation

21.21.2.10 StartDHCP()

void DhcpObject::StartDHCP ( )
Manually start the DHCP Client.
The init() function called at the beginning of an application will handle DHCP client services for all network interfaces.
It is rare that you would need to call these functions manually.
This function will start the DHCP client and return immediately. Check the DHCP status to verify you have success-
fully obtained a lease. GetDHCPState()

See also

DhcpObject::StopDHCP()

21.21.2.11 StopDHCP()

void DhcpObject::StopDHCP ( )
Manually stop the DHCP client and release the DHCP lease.
The init() function called at the beginning of an application will handle DHCP client services for all network interfaces.
It is rare that you would need to call these functions manually.

See also

DhcpObject::StartDHCP()

21.21.2.12 ValidDhcpLease()

BOOL DhcpObject::ValidDhcpLease ( )
Returns the status of a DHCP lease.
Returns

True if the interface has a valid lease.

See also

RenewDHCP()

The documentation for this class was generated from the following files:

• dhcpclient.h
• dhcpc.cpp

21.22 NB::Wifi::driverStatusStruct Struct Reference


#include <wifiDriver.h>

Public Attributes
• uint8_t connected
1 if connected, 0 if disconnected
• uint8_t ssidLength
Length of the SSID string.
• uint16_t txPower
Transmit power.
• int16_t rssi
Recieved Signal Strength Indicator.
• uint8_t band

NetBurner, Inc.
21.23 DSPIModule Class Reference 599

Frequency band.
• uint8_t channel
802.11 channel
• uint32_t maxTxRate
Max transmit data throughput.
• uint8_t security
Security used: WEP, WPA, WPA2, open, uknown.
• uint8_t cipher
refer to OPTIONLISTCIPH for defenitions
• MACADR bssid
Basic Service Set Identifier.
• uint8_t bssType
refer to OPTIONLISTBSSTYPE for defenitions
• char ssid [SSID_MAX_LEN+1]
Placeholder for char array pointer.
• uint32_t tickLastUpdated
CPU tick count of when this struct was last updated.

21.22.1 Detailed Description


A struct used to describe the status of the current network connection.
The documentation for this struct was generated from the following file:

• wifiDriver.h

21.23 DSPIModule Class Reference


DSPIModule is a SPI communications driver. It is an object based driver, which allows for low overhead multiplexing
between peripherals with different bus configurations.
#include <dspi.h>

Public Member Functions


• DSPIModule (uint8_t SPIModule)
The minimum DSPIModule Constructor. Requires that configuration settings be applied after construction before use.
• DSPIModule (uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits=8, uint8_t peripheral←-
ChipSelects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL
doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
DSPIModule Full DSPIModule Constructor. Will initialize all hardware settings.
• uint8_t Init (uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, uint8_t peripheralChip←-
Selects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL dout←-
Hiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
DSPIModule Full DSPIModule Constructor. Will initialize all hardware settings.
• uint8_t Start (uint8_t ∗transmitBufferPtr, volatile uint8_t ∗receiveBufferPtr, uint32_t byteCount, int csReturn←-
ToInactive=DEASSERT_AFTER_LAST)
Start begins a SPI transaction using the provided buffers.
• uint8_t Tx (uint8_t ∗transmitBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST)
Tx begins a transmit only SPI transaction using the provided buffer. Silently discards the received data.
• uint8_t Rx (uint8_t ∗receiveBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST)
Rx begins a receive only SPI transaction using the provided buffer. Holds output line low during transfers.
• bool EnableDMA (bool enableDMA=true)
EnableDMA configures whether DMA is allowed for qualifying transactions.
• bool DisableDMA ()

NetBurner, Inc.
600 Class Documentation

DisableDMA disables DMA for all transactions.


• bool RegisterSem (OS_SEM ∗finishedSem)
Registers a semaphore to be posted to upon completion of transactions.
• bool ClrSem ()
Clears the semaphore registration.
• OS_SEM ∗ GetSem ()
Gets a pointer to the registered Semaphore.
• bool Done ()
Returns whether the previously started transaction is complete.
• uint32_t GetActualBaudrate ()
Returns the actual bus speed to be used.
• bool SetCS (uint8_t CS)
Modifies the chip select configuration for the driver context such that only the requested chip select is active during
transfers.

Static Public Member Functions


• static BOOL Done (uint8_t SPIModule)
Returns whether the previously started transaction for a given hardware module is complete.

Friends
• uint8_t DSPIInit (uint8_t SPIModule, uint32_t Baudrate, uint8_t QueueBitSize, uint8_t CS, uint8_t CSPol,
uint8_t ClkPolarity, uint8_t ClkPhase, BOOL DoutHiz, uint8_t QCD, uint8_t DTL)
Initialize a DSPI module.

21.23.1 Detailed Description


DSPIModule is a SPI communications driver. It is an object based driver, which allows for low overhead multiplexing
between peripherals with different bus configurations.

21.23.2 Constructor & Destructor Documentation

21.23.2.1 DSPIModule() [1/2]

DSPIModule::DSPIModule (
uint8_t SPIModule )
The minimum DSPIModule Constructor. Requires that configuration settings be applied after construction before
use.

Parameters

SPIModule The DSPI module to use, from 1 to 3. Default is 1.

See also

DSPIModule::DSPIModule( uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits, uint8_t peripheralChipSelec

21.23.2.2 DSPIModule() [2/2]

DSPIModule::DSPIModule (
uint8_t SPIModule,

NetBurner, Inc.
21.23 DSPIModule Class Reference 601

uint32_t baudRateInBps,
uint8_t transferSizeInBits = 8,
uint8_t peripheralChipSelects = 0x00,
uint8_t chipSelectPolarity = 0x0F,
uint8_t clockPolarity = 0,
uint8_t clockPhase = 1,
BOOL doutHiz = TRUE,
uint8_t csToClockDelay = 0,
uint8_t delayAfterTransfer = 0 )
DSPIModule Full DSPIModule Constructor. Will initialize all hardware settings.

Parameters

SPIModule The DSPI module to use, from 1 to 3. Default is 1.


baudRateInBps Maximum master clock frequency for SPI Bus in bits per second.
transferSizeInBits Bit width of the transfers to be made.
peripheralChipSelects Bit mask of which chipselects are active during transfers.
chipSelectPolarity Bit mask of the inactive state of chipselects.
clockPolarity Inactive level for the clock signal.
clockPhase Clock phase:

• 0: data captured on leading edge of DSPI_CLK, changed on following edge.

• 1: data changed on leading edge of DSPI_CLK, captured on following edge.

Parameters

doutHiz Data output is high impedance between transfers (instead of driven).


csToClockDelay Delay from chip select to valid clock. The default of 0 will set the delay as close to 1/2
DSPI_CLK without going under, keeping with the interface to QSPI driver.
delayAfterTransfer Delay between data transfers. The default of 0 is 17/(system clock / 2), in keeping with
interface to QSPI

See also

DSPIModule::DSPIModule( uint8_t SPIModule )


DSPIModule::Init( uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits, uint8_t peripheral←-
ChipSelects, uint8_t chipSelectPolarity, uint8_t clockPolarity, uint8_t clockPhase, BOOL doutHiz, uint8_t cs←-
ToClockDelay, uint8_t delayAfterTransfer )

21.23.3 Member Function Documentation

21.23.3.1 ClrSem()

bool DSPIModule::ClrSem ( ) [inline]


Clears the semaphore registration.

Returns

Returns whether the registration was successfully cleared.

NetBurner, Inc.
602 Class Documentation

21.23.3.2 DisableDMA()

bool DSPIModule::DisableDMA ( ) [inline]


DisableDMA disables DMA for all transactions.
Returns

Returns whether DMA is allowed

21.23.3.3 Done() [1/2]

bool DSPIModule::Done ( ) [inline]


Returns whether the previously started transaction is complete.

Returns

Whether the previously started transaction is complete

21.23.3.4 Done() [2/2]

static BOOL DSPIModule::Done (


uint8_t SPIModule ) [static]
Returns whether the previously started transaction for a given hardware module is complete.

Parameters

SPIModule The hardware instance to check the transaction state for.

Returns

Whether the previously started transaction is complete

21.23.3.5 EnableDMA()

bool DSPIModule::EnableDMA (
bool enableDMA = true )
EnableDMA configures whether DMA is allowed for qualifying transactions.

Parameters
enableDMA Whether DMA is allowed

Returns

Returns whether DMA is allowed

21.23.3.6 GetActualBaudrate()

uint32_t DSPIModule::GetActualBaudrate ( ) [inline]


Returns the actual bus speed to be used.
Returns

The actual bus speed to be used.

NetBurner, Inc.
21.23 DSPIModule Class Reference 603

21.23.3.7 GetSem()

OS_SEM ∗ DSPIModule::GetSem ( ) [inline]


Gets a pointer to the registered Semaphore.

Returns

Pointer to the registered Semaphore

21.23.3.8 Init()

uint8_t DSPIModule::Init (
uint32_t baudRateInBps = 2000000,
uint8_t transferSizeInBits = 8,
uint8_t peripheralChipSelects = 0x00,
uint8_t chipSelectPolarity = 0x0F,
uint8_t clockPolarity = 0,
uint8_t clockPhase = 1,
BOOL doutHiz = TRUE,
uint8_t csToClockDelay = 0,
uint8_t delayAfterTransfer = 0 )
DSPIModule Full DSPIModule Constructor. Will initialize all hardware settings.
param SPIModule The instance number of the hardware module to use with this driver context.

Parameters

baudRateInBps Maximum master clock frequency for SPI Bus


transferSizeInBits Bit width of the transfers to be made
peripheralChipSelects Bit mask of which chipselects are active during transfers
chipSelectPolarity Bit mask of the inactive state of chipselects
clockPolarity Inactive level for the clock signal
clockPhase
• 0: data captured on leading edge of DSPI_CLK, changed on following edge

• 1: data changed on leading edge of DSPI_CLK, captured on following edge

Parameters

doutHiz Data output is high impedance between transfers (instead of driven)


csToClockDelay Delay form chip select to valid clock. The default of 0 will set the delay as close to 1/2
DSPI_CLK without going under, keeping with the interface to QSPI driver.
delayAfterTransfer Delay between data transfers. The default of 0 is 17/(system clock / 2), in keepin with
interface to QSPI

See also

DSPIModule::DSPIModule( uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits, uint8_t peripheralChipSelec

21.23.3.9 RegisterSem()

bool DSPIModule::RegisterSem (
OS_SEM ∗ finishedSem )
Registers a semaphore to be posted to upon completion of transactions.

NetBurner, Inc.
604 Class Documentation

Parameters

finishedSem A pointer to the semaphore to be posted to.

Returns

Returns whether the semaphore was successfully registered.

21.23.3.10 Rx()

uint8_t DSPIModule::Rx (
uint8_t ∗ receiveBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [inline]
Rx begins a receive only SPI transaction using the provided buffer. Holds output line low during transfers.

Parameters

receiveBufferPtr A pointer to the buffer to write received data to. If the buffer is NULL, then receive data
will silently be discarded.
byteCount The number of bytes to send and receive in this transaction. The value must be a
multiple of the number of bytes in each individual transfer.
csReturnToInactive Configures when the ChipSelect that is used for the transaction should be deasserted
and return to being inactive.

See also

csReturnType

Returns

Non-zero on error

21.23.3.11 SetCS()

bool DSPIModule::SetCS (
uint8_t CS ) [inline]
Modifies the chip select configuration for the driver context such that only the requested chip select is active during
transfers.

Parameters

CS The chip select number to assert during transfers.

Returns

Whether the active chip select was successfully updated.

21.23.3.12 Start()

uint8_t DSPIModule::Start (
uint8_t ∗ transmitBufferPtr,

NetBurner, Inc.
21.23 DSPIModule Class Reference 605

volatile uint8_t ∗ receiveBufferPtr,


uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST )
Start begins a SPI transaction using the provided buffers.

Parameters

transmitBufferPtr A pointer to the buffer containing data to be sent out. If the buffer is NULL, the bus will be
held low instead.
receiveBufferPtr A pointer to the buffer to write received data to. If the buffer is NULL, then receive data
will silently be discarded.
byteCount The number of bytes to send and receive in this transaction. The value must be a
multiple of the number of bytes in each individual transfer.
csReturnToInactive Configures when the ChipSelect that is used for the transaction should be deasserted
and return to being inactive.

See also

csReturnType

Returns

Non-zero on error

21.23.3.13 Tx()

uint8_t DSPIModule::Tx (
uint8_t ∗ transmitBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [inline]
Tx begins a transmit only SPI transaction using the provided buffer. Silently discards the received data.

Parameters

transmitBufferPtr A pointer to the buffer containing data to be sent out. If the buffer is NULL, the bus will be
held low instead.
byteCount The number of bytes to send and receive in this transaction. The value must be a
multiple of the number of bytes in each individual transfer.
csReturnToInactive Configures when the ChipSelect that is used for the transaction should be deasserted
and return to being inactive.

See also

csReturnType

Returns

Non-zero on error

21.23.4 Friends And Related Function Documentation

21.23.4.1 DSPIInit

uint8_t DSPIInit (
uint8_t SPIModule,

NetBurner, Inc.
606 Class Documentation

uint32_t Baudrate,
uint8_t QueueBitSize,
uint8_t CS,
uint8_t CSPol,
uint8_t ClkPolarity,
uint8_t ClkPhase,
BOOL DoutHiz,
uint8_t QCD,
uint8_t DTL ) [friend]
Initialize a DSPI module.
Notes:

• The maximum baud rate is CPU_CLOCK / 3

• Will initialize to the highest available baud rate that does not exceed the maximum

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for greater than 8 bits per transfer then the data must be uint16_t aligned

• If configured for greater than 16 bits per transfer then the data must be uint32_t aligned

• Chip select is based on chipSelectPolarity

• 0 data captured leading edge of DSPI_CLK, changed following edge.

• 1 data changed leading edge of DSPI_CLK, captured following edge.

• 0 default is as close to 1/2 DSPI_CLK without going under, keeping with the interface to SPI

• 0 default is 17/(system clock / 2), in keeping with interface to QSPI

Parameters

SPIModule SPI module number, 0 - 1


Baudrate Maximum baud rate requested
QueueBitSize Number of bits per transfer: 8, 16 or 32
CS SPI chip selects to use for transfer
CSPol 0 = inactive logic level low, 1 = high
ClkPolarity 0 = inactive logic level low, 1 = high
ClkPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed leading edge
clock, captured following edge.
DoutHiz Data output high impedance between transfers
QCD Delay from chip select to valid clock (default is 0)
DTL Chip select mode dspiChipSelectMode

Returns

Current stat of DSPI bus dspiState

The documentation for this class was generated from the following file:

• coldfire/cpu/MCF5441X/include/dspi.h

21.24 EBI_CS_cfg_t Struct Reference


Configuration structure for an External Bus Interface (EBI) chip select.
#include <ebi.h>

NetBurner, Inc.
21.25 HtmlPageHandler Class Reference 607

Public Attributes
• uint8_t ncs_rd_setup
• uint8_t nrd_setup
• uint8_t ncs_wr_setup
• uint8_t nwe_setup
• uint8_t ncs_rd_pulse
• uint8_t nrd_pulse
• uint8_t ncs_wr_pulse
• uint8_t nwe_pulse
• uint16_t nrd_cycles
• uint16_t nwe_cycles
• uint8_t tdf_cycles
• EBI_CS_BusWidth_t busWidth
• EBI_CS_ByteAccess_t byteAccess
• EBI_CS_NWait_t nWait
• EBI_CS_WrMode_t wrMode
• EBI_CS_RdMode_t rdMode

21.24.1 Detailed Description


Configuration structure for an External Bus Interface (EBI) chip select.
The documentation for this struct was generated from the following file:

• ebi.h

21.25 HtmlPageHandler Class Reference


Base class for all GET handlers. To handle GET requests for a specific URL in your application, build a GET handler
object for that specifif URL. A NULL name will be a catch all for all GET requests.
#include <http.h>
Inherited by CallBackFunctionPageHandler, FileResponseHandler, and HtmlPostHandler.

Public Member Functions


• HtmlPageHandler (const char ∗url, HTTP_RequestTypes rt=tGet, int accessGroup=0, bool Before_←-
Files=false)
Register handler.
• virtual int ProcessRaw (int sock, HTTP_Request &pd)=0
This class will do a callback with data for each request to the specified url.
• int GetGroup ()
Returns access group setting.

Protected Member Functions


• void InsertSort (HtmlPageHandler ∗&ph)
Insert sort.
• int SortValue (HtmlPageHandler ∗pv)
Returns the value of the sort compare: -1, 0, 1.

NetBurner, Inc.
608 Class Documentation

Protected Attributes
• HtmlPageHandler ∗ m_pNextHandler
Pointer to next page handle object.
• const char ∗ m_pUrlName
Pointer to URL. Performs a length match, an empty string matches everything.
• int m_access_group
The access group for this request see CheckHttpAccess.
• HTTP_RequestTypes m_requestTypes
Type of request, HTTP_RequestTypes.

21.25.1 Detailed Description


Base class for all GET handlers. To handle GET requests for a specific URL in your application, build a GET handler
object for that specifif URL. A NULL name will be a catch all for all GET requests.

21.25.2 Constructor & Destructor Documentation

21.25.2.1 HtmlPageHandler()

HtmlPageHandler::HtmlPageHandler (
const char ∗ url,
HTTP_RequestTypes rt = tGet,
int accessGroup = 0,
bool Before_Files = false )
Register handler.

Parameters
url The URL name to register. A NULL string matches everything
rt The GET request type to respond to
accessGroup Access group of the URL
Before_Files Specify if the response should be before or after the compiled in HTML files

21.25.3 Member Function Documentation

21.25.3.1 GetGroup()

int HtmlPageHandler::GetGroup ( ) [inline]


Returns access group setting.

Returns

HTTP_ACCESS

21.25.3.2 ProcessRaw()

virtual int HtmlPageHandler::ProcessRaw (


int sock,
HTTP_Request & pd ) [pure virtual]
This class will do a callback with data for each request to the specified url.

NetBurner, Inc.
21.27 HTTP_Request Struct Reference 609

Returns

0 if the request was not processed.

Implemented in CallBackFunctionPostHandler.
The documentation for this class was generated from the following files:

• http.h
• httpinternal.cpp

21.26 HtmlPostVariableListCallback Class Reference


Implements the HtmlPostVariableListHandler class as a function pointer callback for HTTP POST submissions.
#include <httppost.h>
Inherits HtmlPostVariableListHandler.

Public Member Functions


• HtmlPostVariableListCallback (const char ∗pUrl, postvarhandler ∗pCallback, int accessGroup=0)
Custom HTTP POST handler callback function constructor.

21.26.1 Detailed Description


Implements the HtmlPostVariableListHandler class as a function pointer callback for HTTP POST submissions.

21.26.2 Constructor & Destructor Documentation

21.26.2.1 HtmlPostVariableListCallback()

HtmlPostVariableListCallback::HtmlPostVariableListCallback (
const char ∗ pUrl,
postvarhandler ∗ pCallback,
int accessGroup = 0 ) [inline]
Custom HTTP POST handler callback function constructor.

Parameters
pUrl Pointer to URL character string
pCallback Pointer to callback function that will process the POST
accessGroup Password group access

The documentation for this class was generated from the following file:

• httppost.h

21.27 HTTP_Request Struct Reference


HTTP Request Structure.
#include <http.h>

Public Member Functions


• void ProcessLine (PSTR startofline)
internal function
• int Respond (int socket)

NetBurner, Inc.
610 Class Documentation

internal function
• bool ExtractAuthentication (char ∗∗pPassword, char ∗∗pUser)
used to extract user name and password in authentication test

Public Attributes
• PSTR pURL
Request URL.
• PSTR pAuthorization
Authorization header if present, otherwise null.
• PSTR pFirstCookie
First cookie if present, otherwise null. More may follow.
• PSTR pData
Pointer to entire data set. Note: not null terminated.
• PSTR pSep
Separator for multipart forms, null if not present.
• PSTR pHost
Pointer to host record null if not present.
• PSTR last_datarx
Pointer to last data read, internal use only.
• PSTR wsKey
Web socket ket, internal use only.
• PSTR wsProtocol
Web socket prototocl, internal use only.
• uint16_t sep_len
Length of separator for multipart forms.
• uint32_t content_length
Content length field from HTML header.
• uint32_t rx_length
Total bytes receive from request, internal use only.
• IPADDR client_IPaddr
IP address of client.
• uint8_t websocketFlags
Web socket flags.
• HTTP_RequestTypes req
Type of request HTTP_RequestTypes.

21.27.1 Detailed Description


HTTP Request Structure.
This structure is populated before a HTTP request is sent out.
The documentation for this struct was generated from the following files:

• http.h
• httpinternal.cpp

21.28 I2C Class Reference


I2C Peripheral Class.
#include <i2c.h>

NetBurner, Inc.
21.28 I2C Class Reference 611

Public Types

• enum Result_t {
I2C_RES_ACK , I2C_RES_NACK , I2C_RES_ARB_LST , I2C_RES_BUSY ,
I2C_RES_ARG }
Return result types.

Public Member Functions


• I2C (int module)
Constructor for the I2C peripheral module.
• void setup (uint32_t busSpeed)
Setup the I2C peripheral interface.
• void resetBus ()
Reset the I2C bus.
• Result_t DoTransaction (I2CTxn_t ∗pTransaction, bool bRepeatedStart=false)
Start an I2C transaction.
• void setNumAddressBytes (uint8_t numAddressBytes=1)
Specify the register address size for a read or write transaction. A number of bytes, from 0 to 3, can be sent to specify
an address up to 24-bit (3 bytes): 0 = none, 1 = 8-bits, 2 = 16-bits, 3 = 24-bits.
• Result_t writeReg8 (uint8_t devAddr, uint32_t reg, uint8_t data)
Write an 8-bit value to a I2C slave device register.
• Result_t readReg8 (uint8_t devAddr, uint32_t reg, uint8_t &data)
Read an 8-bit value form an I2C slave device register.
• Result_t writeRegN (uint8_t devAddr, uint32_t reg, const uint8_t ∗buf, uint32_t blen)
Write a number of 8-bit values to an I2C slave to the specified register address.
• Result_t readRegN (uint8_t devAddr, uint32_t reg, uint8_t ∗buf, uint32_t blen)
Read a number of 8-bit values from an I2C slave at the specified register address.

Friends
• class WireIntf

21.28.1 Detailed Description


I2C Peripheral Class.
For I2C communication, you can choose the WireIntf class, or the I2C class. The WireIntf class is simpler to use,
while the I2C class provides more low level control.
Note that the system automatically instantiates I2C and WireIntf objects for each of the I2C peripheral modules. The
WireIntf objects can be accessed with: Wire, Wire1 and Wire2. The I2C objects can be accesses with I2C[0], I2C[1]
and I2C[2].

21.28.2 Member Enumeration Documentation

21.28.2.1 Result_t

enum I2C::Result_t
Return result types.

Enumerator

I2C_RES_ACK Acknowledged.
I2C_RES_NACK Not acknowledged.

NetBurner, Inc.
612 Class Documentation

Enumerator

I2C_RES_ARB_LST Arbitration listening.


I2C_RES_BUSY Bus is busy.
I2C_RES_ARG Bad argument.

21.28.3 Constructor & Destructor Documentation

21.28.3.1 I2C()

I2C::I2C (
int module )
Constructor for the I2C peripheral module.

Parameters

module The I2C module to instantiate (0, 1 or 2)

21.28.4 Member Function Documentation

21.28.4.1 DoTransaction()

Result_t I2C::DoTransaction (
I2CTxn_t ∗ pTransaction,
bool bRepeatedStart = false )
Start an I2C transaction.
Execute the transaction pointed to by pTransaction

Parameters
∗pTransaction Pointer to the transaction to execute
bRepeatedStart Repeat the I2C start sequence

Returns

Result_t

21.28.4.2 readReg8()

Result_t I2C::readReg8 (
uint8_t devAddr,
uint32_t reg,
uint8_t & data )
Read an 8-bit value form an I2C slave device register.

Parameters

devAddr Address of I2C device


reg Register address to read
data Reference to variable in which to store the register data

NetBurner, Inc.
21.28 I2C Class Reference 613

Returns

Result_t

21.28.4.3 readRegN()

Result_t I2C::readRegN (
uint8_t devAddr,
uint32_t reg,
uint8_t ∗ buf,
uint32_t blen )
Read a number of 8-bit values from an I2C slave at the specified register address.

Parameters

devAddr Address of I2C device


reg Register address to read
∗buf Pointer to buffer to store received data
blen Number of bytes to read

Returns

Result_t

21.28.4.4 setNumAddressBytes()

void I2C::setNumAddressBytes (
uint8_t numAddressBytes = 1 ) [inline]
Specify the register address size for a read or write transaction. A number of bytes, from 0 to 3, can be sent to
specify an address up to 24-bit (3 bytes): 0 = none, 1 = 8-bits, 2 = 16-bits, 3 = 24-bits.
If you are using a single I2C device, or all devices use the same address size, this function only needs to be called
once. If you have multiple I2C devices with different address/register bit sizes, then this function should be called
before each read/write operation for each different device.

Parameters

numAddressBytes The number of address bytes to send: 0 - 3. The default value is 1 byte.

21.28.4.5 setup()

void I2C::setup (
uint32_t busSpeed )
Setup the I2C peripheral interface.

Parameters

busSpeed Target bus speed. It the specified speed cannot be achieved, a lower bus speed may be enabled.

21.28.4.6 writeReg8()

Result_t I2C::writeReg8 (

NetBurner, Inc.
614 Class Documentation

uint8_t devAddr,
uint32_t reg,
uint8_t data )
Write an 8-bit value to a I2C slave device register.

Parameters

devAddr Address of I2C device


reg Register address to write
data Data to write to register

Returns

Result_t

21.28.4.7 writeRegN()

Result_t I2C::writeRegN (
uint8_t devAddr,
uint32_t reg,
const uint8_t ∗ buf,
uint32_t blen )
Write a number of 8-bit values to an I2C slave to the specified register address.
Executing this function will send the following: a start bit, the slave device address and read/write bit, the 8-bit data
bytes, and finally a stop bit. Note that the address is not incremented with each 8-bit data value.

Parameters

devAddr Address of I2C device


reg Register address to write
∗buf Pointer to buffer containing data to write
blen Number of bytes to write

Returns

Result_t

The documentation for this class was generated from the following file:

• i2c.h

21.29 I2CDevice Class Reference


I2C Device Class (recommended)
#include <i2c.h>

Public Member Functions


• I2CDevice (I2C &pInterface, uint8_t deviceAddress, uint8_t numAddressBytes=1)
Initialize the I2C module.
• uint8_t getI2CAddress ()
Get device's I2C address.
• void setup (uint32_t busSpeed)
Setup the I2C peripheral module.

NetBurner, Inc.
21.29 I2CDevice Class Reference 615

• void resetBus ()
Reset the I2C bus.
• I2C::Result_t writeReg8 (uint32_t reg, uint8_t data)
Write an 8-bit value to an I2C slave device register.
• I2C::Result_t readReg8 (uint32_t reg, uint8_t &data)
Read an 8-bit value form an I2C slave device register.
• I2C::Result_t writeRegN (uint32_t reg, const uint8_t ∗buf, uint32_t blen)
Write a number of 8-bit values to an I2C slave to the specified register address.
• I2C::Result_t readRegN (uint32_t reg, uint8_t ∗buf, uint32_t blen)
Read a number of 8-bit values from an I2C slave at the specified register address.

21.29.1 Detailed Description


I2C Device Class (recommended)
For I2C communication, you can choose the I2CDevice class, the I2C class, or the WireIntf class. The recommended
interface is the I2CDevice class.
For example, to create an object for an analog to digital converter:
I2CDevice AdcDevice(i2c[I2C_MODULE_NUM], I2C_ADC_ADDRESS);
To read a 16 bit value:
uint8_t I2CStat = AdcDevice.readRegN(0x00, buf, 2);

21.29.2 Constructor & Destructor Documentation

21.29.2.1 I2CDevice()

I2CDevice::I2CDevice (
I2C & pInterface,
uint8_t deviceAddress,
uint8_t numAddressBytes = 1 ) [inline]
Initialize the I2C module.

Parameters

pInterface Pointer to the I2C interface to use. This will normally be one of the preallocated I2C
modules in the i2c[] array: i2c[0] (default), i2c[1] or i2c[2].
deviceAddress I2C device address
numAddressBytes Number of address bytes to send to specify the register or address to access for a read or
write operation. Refer to your I2C device data sheet to determine the correct number. The
I2C address range is 24-bits maximum (3 bytes). The default value is 1 byte, representing
an address range of 0 to 255.

21.29.3 Member Function Documentation

21.29.3.1 getI2CAddress()

uint8_t I2CDevice::getI2CAddress ( ) [inline]


Get device's I2C address.
Note that the return address will be just the I2C address bits, not including the read/write bit. If your device data
sheet specifies the address byte to include the read/write bit, that value would be this address left shifted by 1. For
example, if a device data sheet specifies the address as 0xA2 and includes the read/write bit, the actual address
would be 0x51.

NetBurner, Inc.
616 Class Documentation

Returns

The device's I2C address

21.29.3.2 readReg8()

I2C::Result_t I2CDevice::readReg8 (
uint32_t reg,
uint8_t & data ) [inline]
Read an 8-bit value form an I2C slave device register.

Parameters
reg Register address to read
data Reference to variable in which to store the register data

Returns

I2C::Result_t

21.29.3.3 readRegN()

I2C::Result_t I2CDevice::readRegN (
uint32_t reg,
uint8_t ∗ buf,
uint32_t blen ) [inline]
Read a number of 8-bit values from an I2C slave at the specified register address.

Parameters
reg Register address to read
∗buf Pointer to buffer to store received data
blen Number of bytes to read

Returns

I2C::Result_t

21.29.3.4 setup()

void I2CDevice::setup (
uint32_t busSpeed ) [inline]
Setup the I2C peripheral module.

Parameters

busSpeed Target bus speed. It the specified speed cannot be achieved, a lower bus speed may be enabled.

21.29.3.5 writeReg8()

I2C::Result_t I2CDevice::writeReg8 (

NetBurner, Inc.
21.30 IPADDR4 Class Reference 617

uint32_t reg,
uint8_t data ) [inline]
Write an 8-bit value to an I2C slave device register.

Parameters
reg Register address to write
data Data to write to register

Returns

I2C::Result_t

21.29.3.6 writeRegN()

I2C::Result_t I2CDevice::writeRegN (
uint32_t reg,
const uint8_t ∗ buf,
uint32_t blen ) [inline]
Write a number of 8-bit values to an I2C slave to the specified register address.
Executing this function will send the following: a start bit, the slave device address and read/write bit, the 8-bit data
bytes, and finally a stop bit. Note that the address is not incremented with each 8-bit data value.

Parameters
reg Register address to write
∗buf Pointer to buffer containing data to write
blen Number of bytes to write

Returns

I2C::Result_t

The documentation for this class was generated from the following file:

• i2c.h

21.30 IPADDR4 Class Reference


Used to store and manipulate IPv4 addresses in dual stack mode.
#include <nettypes.h>

Public Member Functions


• IPADDR4 ()=default
Constructor to create an IPv4 object initialized to null.
• IPADDR4 (const IPADDR4 &v)=default
Constructor to create an IPv4 object initialized to to the specified IPADDR4 IP address.
• bool IsNull () const
Check if the IP address is null.
• bool NotNull () const
Check if the IP address is not null.
• void SetNull ()
Set the IP address to null.

NetBurner, Inc.
618 Class Documentation

• bool IsLoopBack () const


Check if the IP address is the loopback address for the interface.
• bool IsMultiCast () const
Check if the IPADDR4 object contains a Multicast IP address the interface.
• bool IsmDns ()
Check if the IPADDR4 object contains a mDNS IP address the interface.
• bool IsGlobalBroadCast () const
Check if the IPADDR4 object contains a global broadcast address: 255.255.255.255.
• bool IsAutoIP ()
Check if the IPADDR4 object contains an AutoIP address.
• void print () const
Print an IPv4 address to the stdout serial port.
• void fdprint (int fd) const
Print an IPv4 address to the specified file descriptor.
• int sprintf (char ∗cp, int maxl) const
sprintf an IPv4 address to the specified buffer
• void SetFromAscii (const char ∗cp)
Set the IPv4 address from a character string.

Static Public Member Functions


• static IPADDR4 NullIP ()
C++ static function for a null IP address.
• static IPADDR4 GlobalBroadCast ()
C++ static function for a global broadcast IP address.

21.30.1 Detailed Description


Used to store and manipulate IPv4 addresses in dual stack mode.
It is recommended to use the IPADDR object, which can hold either an IPv4 or IPv6 address, rather than explicitly
specifying IPv4.

21.30.2 Constructor & Destructor Documentation

21.30.2.1 IPADDR4()

IPADDR4::IPADDR4 (
const IPADDR4 & v ) [default]
Constructor to create an IPv4 object initialized to to the specified IPADDR4 IP address.

Parameters

v IPADDR4 object used for initialization.

21.30.3 Member Function Documentation

21.30.3.1 fdprint()

void IPADDR4::fdprint (
int fd ) const

NetBurner, Inc.
21.30 IPADDR4 Class Reference 619

Print an IPv4 address to the specified file descriptor.

Parameters

fd File descriptor used to send IP address

21.30.3.2 IsAutoIP()

bool IPADDR4::IsAutoIP ( ) [inline]


Check if the IPADDR4 object contains an AutoIP address.

Return values

true if the IP address value is an AutoIP address

See also

IsLoopBack(), IsLinkLocal()

21.30.3.3 IsGlobalBroadCast()

bool IPADDR4::IsGlobalBroadCast ( ) const [inline]


Check if the IPADDR4 object contains a global broadcast address: 255.255.255.255.

Return values

true if the IP address value is a global broadcast

See also

IsLoopBack(), IsLinkLocal()

21.30.3.4 IsLoopBack()

bool IPADDR4::IsLoopBack ( ) const [inline]


Check if the IP address is the loopback address for the interface.

Return values

true if the IP address value is the loopback address

See also

IsMultiCast(), IsLinkLocal()

21.30.3.5 IsmDns()

bool IPADDR4::IsmDns ( ) [inline]


Check if the IPADDR4 object contains a mDNS IP address the interface.

NetBurner, Inc.
620 Class Documentation

Return values

true if the IP address value is a mDNS address

See also

IsLoopBack(), IsLinkLocal()

21.30.3.6 IsMultiCast()

bool IPADDR4::IsMultiCast ( ) const [inline]


Check if the IPADDR4 object contains a Multicast IP address the interface.

Return values

true if the IP address value is a Multicast address

See also

IsLoopBack(), IsLinkLocal()

21.30.3.7 IsNull()

bool IPADDR4::IsNull ( ) const [inline]


Check if the IP address is null.

Return values

true if the IP address value is null

See also

NotNull(), SetNull()

21.30.3.8 NotNull()

bool IPADDR4::NotNull ( ) const [inline]


Check if the IP address is not null.

Return values

true if the IP address value is not null

See also

IsNull(), SetNull()

21.30.3.9 SetFromAscii()

void IPADDR4::SetFromAscii (
const char ∗ cp )

NetBurner, Inc.
21.30 IPADDR4 Class Reference 621

Set the IPv4 address from a character string.

NetBurner, Inc.
622 Class Documentation

Parameters

cp Character string. For example, "192.168.1.10"

21.30.3.10 SetNull()

void IPADDR4::SetNull ( ) [inline]


Set the IP address to null.
See also

IsNull(), NotNull()

21.30.3.11 sprintf()

int IPADDR4::sprintf (
char ∗ cp,
int maxl ) const
sprintf an IPv4 address to the specified buffer

Parameters

cp Destination character buffer


maxl Maximum number of characters

Returns

Number of characters

The documentation for this class was generated from the following files:

• nettypes.h
• utils.cpp

21.31 IPADDR6 Class Reference


Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
#include <ipv6_addr.h>

Public Member Functions


• bool IsEmbeddedIPV4 () const
An IPADDR6 object can store a IPv4 or IPv6 address. This function returns true if the instance contains an IPv4
address.
• IPADDR4 Extract4 () const
Extracts an IPv4 address from the object.
• bool IsNull () const
Check if the IP address is null.
• bool NotNull () const
Check if the IP address is not null.
• bool IsLoopBack () const
Check if the IP address is the loopback address for the interface.
• bool IsMultiCast () const

NetBurner, Inc.
21.31 IPADDR6 Class Reference 623

Check if the IPADDR6 object contains a Multicast IP address the interface.


• bool IsLinkLocal () const
Check if the IP address is the link-local address for the interface.
• MACADR McastMac () const
Return the MAC address used for Multicasts for the interface.
• void print (bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address value to stdout.
• void fdprint (int fd, bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address to the specified file descriptor.
• int sprintf (char ∗cp, int maxl, bool bCompact=true, bool bShowV4Raw=false) const
Print the IP address to the specified buffer.
• void SetFromAscii (const char ∗cp, bool bembed_v4addresses=true)
Set the IP address value of an IPADDR6 object.
• void SetFromIP4 (IPADDR4 ip)
Set the IP address value of an IPADDR6 object from an IPADD4 object.
• void SetFromUint32Shortcut (uint32_t w0, uint32_t w1, uint32_t w2, uint32_t w3)
Set the IP address value of an IPADDR6 object from 4 discrete uint32_t values.
• void SetNull ()
Set the IP address value of an IPADDR6 object to null.

Static Public Member Functions


• static IPADDR6 AsciiToIp6 (const char ∗cp, bool bembed_v4addresses=true)
Static function to return an IPADDR6 object created from an ASCII value IPv4 or IPv6 address.
• static IPADDR6 NullIP ()
Static function to return a null IPADDR6 object.

21.31.1 Detailed Description


Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
It is recommended to use the IPADDR object, which can hold either an IPv4 or IPv6 address, rather than explicitly
specifying IPv6.

21.31.2 Member Function Documentation

21.31.2.1 AsciiToIp6()

IPADDR6 IPADDR6::AsciiToIp6 (
const char ∗ cp,
bool bembed_v4addresses = true ) [static]
Static function to return an IPADDR6 object created from an ASCII value IPv4 or IPv6 address.

Parameters

∗cp Pointer to the ASCII string representing an IPv4 or IPv6 address


bembed_v4addresses If false function will only process an IPv6 address

Return values
IPADDR6 object

NetBurner, Inc.
624 Class Documentation

See also

NullIP()

21.31.2.2 Extract4()

IPADDR4 IPADDR6::Extract4 ( ) const [inline]


Extracts an IPv4 address from the object.

Return values

IPADDR4 Value of the IPv4 address

21.31.2.3 fdprint()

void IPADDR6::fdprint (
int fd,
bool bCompact = true,
bool bShowV4Raw = false ) const
Print the IP address to the specified file descriptor.

Parameters

fd Valid file descriptor to send the data


bCompact Display IPv6 address in compact notation
bShowV4Raw Normally set to false. If set to true, will display the IPv4 address 128-bits of the IP address
object in the raw format
::FFFF:xx.xx.xx.xx

See also

print(), sprintf()

21.31.2.4 IsEmbeddedIPV4()

bool IPADDR6::IsEmbeddedIPV4 ( ) const [inline]


An IPADDR6 object can store a IPv4 or IPv6 address. This function returns true if the instance contains an IPv4
address.
Internally, an IPv4 address is stored in the format
::FFFF:xx.xx.xx.xx

Return values

true If the IPADDR6 object contains and IPv4 address


false Otherwise

21.31.2.5 IsLinkLocal()

bool IPADDR6::IsLinkLocal ( ) const [inline]


Check if the IP address is the link-local address for the interface.

NetBurner, Inc.
21.31 IPADDR6 Class Reference 625

Return values

true if the IP address value is the link-local address

See also

IsLoopBack(), IsMultiCast()

21.31.2.6 IsLoopBack()

bool IPADDR6::IsLoopBack ( ) const [inline]


Check if the IP address is the loopback address for the interface.

Return values

true if the IP address value is the loopback address

See also

IsMultiCast(), IsLinkLocal()

21.31.2.7 IsMultiCast()

bool IPADDR6::IsMultiCast ( ) const [inline]


Check if the IPADDR6 object contains a Multicast IP address the interface.

Return values

true if the IP address value is a Multicast address

See also

IsLoopBack(), IsLinkLocal()

21.31.2.8 IsNull()

bool IPADDR6::IsNull ( ) const [inline]


Check if the IP address is null.

Return values

true if the IP address value is null

See also

NotNull()

21.31.2.9 McastMac()

MACADR IPADDR6::McastMac ( ) const


Return the MAC address used for Multicasts for the interface.

NetBurner, Inc.
626 Class Documentation

Return values

MACADR if a Multicast address exists


null otherwise

21.31.2.10 NotNull()

bool IPADDR6::NotNull ( ) const [inline]


Check if the IP address is not null.

Return values

true if the IP address value is not null

See also

IsNull()

21.31.2.11 NullIP()

IPADDR6 IPADDR6::NullIP ( ) [static]


Static function to return a null IPADDR6 object.
Static functions can be called without a specific C++ object. For example,
if ( myIPAddress == IPADDR6::NullIP() )
iprintf("myIPAddress is null\r\n");
else
iprintf("myIPAddress = %I\r\n", myIPAddress);
IPADDR6::NullIP() can be used on IPADDR, IPADDR4 and IPADDR6 objects.

Return values
null IPADDR6 object

See also

AsciiToIp6()

21.31.2.12 print()

void IPADDR6::print (
bool bCompact = true,
bool bShowV4Raw = false ) const
Print the IP address value to stdout.

Parameters

bCompact Display IPv6 address in compact notation


bShowV4Raw Normally set to false. if set to true, will display the IPv4 address 128-bits of the IP address
object in the raw format
::FFFF:xx.xx.xx.xx

NetBurner, Inc.
21.31 IPADDR6 Class Reference 627

See also

fdprint(), sprintf()

21.31.2.13 SetFromAscii()

void IPADDR6::SetFromAscii (
const char ∗ cp,
bool bembed_v4addresses = true )
Set the IP address value of an IPADDR6 object.

Parameters

∗cp Pointer to the ASCII string representing an IPv4 or IPv6 address


bembed_v4addresses If false function will only process an IPv6 address

See also

SetFromIP4(), SetNull()

21.31.2.14 SetFromIP4()

void IPADDR6::SetFromIP4 (
IPADDR4 ip )
Set the IP address value of an IPADDR6 object from an IPADD4 object.

Parameters
ip IPADDR4 object

See also

SetFromAscii(), SetNull()

21.31.2.15 SetFromUint32Shortcut()

void IPADDR6::SetFromUint32Shortcut (
uint32_t w0,
uint32_t w1,
uint32_t w2,
uint32_t w3 ) [inline]
Set the IP address value of an IPADDR6 object from 4 discrete uint32_t values.

Parameters
w0 Unsigned 32-bit integer
w1 Unsigned 32-bit integer
w2 Unsigned 32-bit integer
w3 Unsigned 32-bit integer

NetBurner, Inc.
628 Class Documentation

See also

SetFromAscii(), SetFromIP4(), SetNull()

21.31.2.16 SetNull()

void IPADDR6::SetNull ( ) [inline]


Set the IP address value of an IPADDR6 object to null.

See also

SetFromAscii(), SetFromIP4()

21.31.2.17 sprintf()

int IPADDR6::sprintf (
char ∗ cp,
int maxl,
bool bCompact = true,
bool bShowV4Raw = false ) const
Print the IP address to the specified buffer.

Parameters

∗cp Pointer to the destination buffer to store the data


maxl Maximum number of bytes to write to buffer
bCompact Display IPv6 address in compact notation
bShowV4Raw Normally set to false. if set to true, will display the IPv4 address 128-bits of the IP address
object in the raw format
::FFFF:xx.xx.xx.xx

Returns

Number of bytes copied to buffer

See also

print(), fdprint()

The documentation for this class was generated from the following files:

• ipv6_addr.h
• ipv6_addr.cpp
• ipv6_printhelp.cpp

21.32 JsonAllocString Struct Reference


A list of large strings that are created with malloc.
#include <json_lexer.h>

Public Attributes
• JsonAllocString ∗ pNext
A pointer to the next string.
• char data [ ]
The current string data.

NetBurner, Inc.
21.33 JsonRef Class Reference 629

21.32.1 Detailed Description


A list of large strings that are created with malloc.
The documentation for this struct was generated from the following file:

• json_lexer.h

21.33 JsonRef Class Reference


Represents a positional reference (pointer) of a location inside a ParsedJsonDataSet object

#include <json_lexer.h>

Public Member Functions


• operator bool () const
Operator to return a JSON element of type boolean.
• operator float () const
Returns boolean.
• operator double () const
Returns floating point.
• operator uint8_t () const
Returns double float.
• operator int () const
Returns uint8_t.
• operator uint16_t () const
Returns int.
• operator uint32_t () const
Returns uint16_t.
• operator int8_t () const
Returns uint32_t.
• operator int16_t () const
Returns int8_t.
• operator int32_t () const
Returns int16_t.
• operator time_t () const
Returns int32_t.
• operator const char ∗ () const
Returns time_t.
• operator NBString () const
Returns const char ∗.
• bool IsNumber ()
Check for a JSON number element.
• bool IsObject ()
Check for a JSON object element.
• bool IsString ()
Check for a JSON string element.
• bool IsBool ()
Check for a JSON boolean element.
• bool IsNull ()
Check for a JSON null element.
• bool IsArray ()
Check for a JSON array element.

NetBurner, Inc.
630 Class Documentation

• bool Valid () const


Check for a valid JSON position.
• void ResetPosition ()
Reset the position index of the ParsedJsonDataSet to the beginning.
• JsonRef operator[ ] (int i)
Parse into a JSON array.
• JsonRef object (const char ∗name)
Find a JSON object name in the current JSON data set.
• JsonRef name (const char ∗name)
Find the next JSON object name in the current JSON data set.
• JsonRef operator() (const char ∗name)
Function operator shortcut to find a JSON object name in the current JSON data set.

Friends
• class ParsedJsonDataSet

21.33.1 Detailed Description


Represents a positional reference (pointer) of a location inside a ParsedJsonDataSet object

A JsonRef can be used as a pointer to a variable or sub object inside a ParsedJsonDataSet object to make decoding
the hierarchy much simpler and easier to understand. A JsonRef is not limited to just pointing at internal objects; it
can point to any JSON parsed token/type.

21.33.2 Member Function Documentation

21.33.2.1 name()

JsonRef JsonRef::name (
const char ∗ name ) [inline]
Find the next JSON object name in the current JSON data set.
Useful if more than one JSON object/element has the same name.

Parameters

∗name Pointer to name of object to find

Returns

The reference to the object of type JsonRef

See also

JsonRef::object(), JsonRef::operator()()

21.33.2.2 object()

JsonRef JsonRef::object (
const char ∗ name ) [inline]
Find a JSON object name in the current JSON data set.

NetBurner, Inc.
21.34 mcanMODM7AE70::mcan_config Class Reference 631

Parameters

∗name Pointer to name of object to find

Returns

The reference to the object of type JsonRef

See also

JsonRef::name(), JsonRef::operator()()

21.33.2.3 operator()()

JsonRef JsonRef::operator() (
const char ∗ name ) [inline]
Function operator shortcut to find a JSON object name in the current JSON data set.
Equivelent to JsonRef object function.

Parameters

∗name Pointer to name of object to find

Returns

The reference to the object of type JsonRef

See also

JsonRef::name(), JsonRef::object()()

21.33.2.4 operator[]()

JsonRef JsonRef::operator[ ] (
int i )
Parse into a JSON array.

Returns

A JsonRef if array element is found

The documentation for this class was generated from the following files:

• json_lexer.h
• json_lexer.cpp

21.34 mcanMODM7AE70::mcan_config Class Reference


MCAN configuration structure.
#include <mcan.h>

Public Member Functions


• void set_config_defaults ()
Initializes an MCAN configuration structure to defaults.

NetBurner, Inc.
632 Class Documentation

Public Attributes
• bool run_in_standby
• uint8_t watchdog_configuration
• bool transmit_pause
• bool edge_filtering
• bool protocol_exception_handling
• bool automatic_retransmission
• bool clock_stop_request
• bool clock_stop_acknowledge
• uint8_t timestamp_prescaler
• uint16_t timeout_period
• enum mcan_timeout_mode timeout_mode
• bool timeout_enable
• bool tdc_enable
• uint8_t delay_compensation_offset
• uint8_t delay_compensation_filter_window_length
• enum mcan_nonmatching_frames_action nonmatching_frames_action_standard
• enum mcan_nonmatching_frames_action nonmatching_frames_action_extended
• bool remote_frames_standard_reject
• bool remote_frames_extended_reject
• uint32_t extended_id_mask
• bool rx_fifo_0_overwrite
• uint8_t rx_fifo_0_watermark
• bool rx_fifo_1_overwrite
• uint8_t rx_fifo_1_watermark
• bool tx_queue_mode
• uint8_t tx_event_fifo_watermark

21.34.1 Detailed Description


MCAN configuration structure.
Configuration structure for an MCAN instance. This structure should be initialized by the mcan_get_config_defaults()
function before being modified by the user application.

21.34.2 Member Function Documentation

21.34.2.1 set_config_defaults()

void mcanMODM7AE70::mcan_config::set_config_defaults ( ) [inline]


Initializes an MCAN configuration structure to defaults.
Initializes a given MCAN configuration struct to a set of known default values. This function should be called on any
new instance of the configuration struct before being modified by the user application.
The default configuration is as follows:

• Not run in standby mode

• Disable Watchdog

• Transmit pause enabled

• Edge filtering during bus integration enabled

• Protocol exception handling enabled

• Automatic retransmission enabled

• Clock stop request disabled

NetBurner, Inc.
21.34 mcanMODM7AE70::mcan_config Class Reference 633

• Clock stop acknowledge disabled

• Timestamp Counter Prescaler 1

• Timeout Period with 0xFFFF

• Timeout Mode: Continuous operation

• Disable Timeout

• Transmitter Delay Compensation Offset is 0

• Transmitter Delay Compensation Filter Window Length is 0

• Reject nonmatching standard frames

• Reject nonmatching extended frames

• Reject remote standard frames

• Reject remote extended frames

• Extended ID Mask is 0x1FFFFFFF

• Rx FIFO 0 Operation Mode: overwrite

• Disable Rx FIFO 0 Watermark

• Rx FIFO 1 Operation Mode: overwrite

• Disable Rx FIFO 1 Watermark

• Tx FIFO/Queue Mode: FIFO

• Disable Tx Event FIFO Watermark

21.34.3 Member Data Documentation

21.34.3.1 automatic_retransmission

bool mcanMODM7AE70::mcan_config::automatic_retransmission
Automatic Retransmission.

21.34.3.2 clock_stop_acknowledge

bool mcanMODM7AE70::mcan_config::clock_stop_acknowledge
Clock Stop Acknowledge.

21.34.3.3 clock_stop_request

bool mcanMODM7AE70::mcan_config::clock_stop_request
Clock Stop Request.

21.34.3.4 delay_compensation_filter_window_length

uint8_t mcanMODM7AE70::mcan_config::delay_compensation_filter_window_length
Transmitter Delay Compensation Filter Window Length : 0x0-0x7F

21.34.3.5 delay_compensation_offset

uint8_t mcanMODM7AE70::mcan_config::delay_compensation_offset
Transmitter Delay Compensation Offset : 0x0-0x7F

NetBurner, Inc.
634 Class Documentation

21.34.3.6 edge_filtering

bool mcanMODM7AE70::mcan_config::edge_filtering
Edge Filtering during Bus Integration.

21.34.3.7 extended_id_mask

uint32_t mcanMODM7AE70::mcan_config::extended_id_mask
Extended ID Mask: 0x0-0x1FFFFFFF.

21.34.3.8 nonmatching_frames_action_extended

enum mcan_nonmatching_frames_action mcanMODM7AE70::mcan_config::nonmatching_frames_action_←-


extended
Nonmatching frames action for extended frames.

21.34.3.9 nonmatching_frames_action_standard

enum mcan_nonmatching_frames_action mcanMODM7AE70::mcan_config::nonmatching_frames_action_←-


standard
Nonmatching frames action for standard frames.

21.34.3.10 protocol_exception_handling

bool mcanMODM7AE70::mcan_config::protocol_exception_handling
Protocol Exception Handling.

21.34.3.11 remote_frames_extended_reject

bool mcanMODM7AE70::mcan_config::remote_frames_extended_reject
Reject Remote Extended Frames.

21.34.3.12 remote_frames_standard_reject

bool mcanMODM7AE70::mcan_config::remote_frames_standard_reject
Reject Remote Standard Frames.

21.34.3.13 run_in_standby

bool mcanMODM7AE70::mcan_config::run_in_standby
MCAN run in standby control.

21.34.3.14 rx_fifo_0_overwrite

bool mcanMODM7AE70::mcan_config::rx_fifo_0_overwrite
Rx FIFO 0 Operation Mode.

21.34.3.15 rx_fifo_0_watermark

uint8_t mcanMODM7AE70::mcan_config::rx_fifo_0_watermark
Rx FIFO 0 Watermark: 1-64, other value disable it.

21.34.3.16 rx_fifo_1_overwrite

bool mcanMODM7AE70::mcan_config::rx_fifo_1_overwrite
Rx FIFO 1 Operation Mode.

21.34.3.17 rx_fifo_1_watermark

uint8_t mcanMODM7AE70::mcan_config::rx_fifo_1_watermark
Rx FIFO 1 Watermark: 1-64, other value disable it.

NetBurner, Inc.
21.35 mcanMODM7AE70::mcan_module Class Reference 635

21.34.3.18 tdc_enable

bool mcanMODM7AE70::mcan_config::tdc_enable
Transceiver Delay Compensation enable.

21.34.3.19 timeout_enable

bool mcanMODM7AE70::mcan_config::timeout_enable
Timeout enable.

21.34.3.20 timeout_mode

enum mcan_timeout_mode mcanMODM7AE70::mcan_config::timeout_mode


Timeout Mode.

21.34.3.21 timeout_period

uint16_t mcanMODM7AE70::mcan_config::timeout_period
Timeout Period.

21.34.3.22 timestamp_prescaler

uint8_t mcanMODM7AE70::mcan_config::timestamp_prescaler
Timestamp Counter Prescaler: 0x0-0xF

21.34.3.23 transmit_pause

bool mcanMODM7AE70::mcan_config::transmit_pause
Transmit Pause.

21.34.3.24 tx_event_fifo_watermark

uint8_t mcanMODM7AE70::mcan_config::tx_event_fifo_watermark
Tx Event FIFO Watermark: 1-32, other value disable it.

21.34.3.25 tx_queue_mode

bool mcanMODM7AE70::mcan_config::tx_queue_mode
Tx FIFO/Queue Mode, 0 for FIFO and 1 for Queue.

21.34.3.26 watchdog_configuration

uint8_t mcanMODM7AE70::mcan_config::watchdog_configuration
Start value of the Message RAM Watchdog Counter
The documentation for this class was generated from the following file:

• mcan.h

21.35 mcanMODM7AE70::mcan_module Class Reference


MCAN Module Class.
#include <mcan.h>

Public Member Functions


• mcan_module (Mcan ∗hw, uint32_t baud)
Create a MCAN module instance.
• void send_message (uint32_t id_value, uint8_t ∗data, uint32_t data_length, OS_SEM ∗pSem=0)
Send a MCAN message.

NetBurner, Inc.
636 Class Documentation

• bool blocking_send_message (uint32_t id_value, uint8_t ∗data, uint32_t data_length, uint32_t TimeOut)
Send a MCAN message and block until sent.
• int RegisterRxFifo (uint32_t composite_id, OS_FIFO ∗pFifo, int channel=-1)
Register a FIFO to receive CAN messages.
• int RegisterRxFifoMask (uint32_t composite_id, uint32_t mask, OS_FIFO ∗pFifo, int channel=-1)
Register a FIFO to receive messages as specified by the address bit mask. A value of 1 = match, a value of 0 = don't
match.
• int RegisterRxFifoRange (uint32_t composite_id_low, uint32_t composite_id_hi, OS_FIFO ∗pFifo, int
channel=-1)
Register a FIFO to receive messages in the specified numeric range of addresses from low to high.
• int UnRegisterFifo (int channel)
Unregister the FIFO for the specified CAN channel.
• int MultiCanSetRTRMessage (uint32_t id, uint8_t ∗data, uint8_t len, int channel=-1)
Enable an auto-reply to a CAN RTR message for the specified CAN ID. The reply message is specified by the data
parameter.
• int MultiCanReplaceRTRMessage (int channel, uint8_t ∗data, uint8_t len)
Modifies/updates the response for the RTR message registered wotj MultiCanSetRTRMessage().
• int MultiCanStopRTRMessage (int channel)
Unregister the RTR message for the specified channel.

21.35.1 Detailed Description


MCAN Module Class.
Class to control a SAME70 MCAN peripheral

21.35.2 Constructor & Destructor Documentation

21.35.2.1 mcan_module()

mcanMODM7AE70::mcan_module::mcan_module (
Mcan ∗ hw,
uint32_t baud )
Create a MCAN module instance.

Parameters

hw MCAN hardware peripheral, MCAN0 or MCAN 1


baud MCAN baud rate. For example, 500000

21.35.3 Member Function Documentation

21.35.3.1 blocking_send_message()

bool mcanMODM7AE70::mcan_module::blocking_send_message (
uint32_t id_value,
uint8_t ∗ data,
uint32_t data_length,
uint32_t TimeOut )
Send a MCAN message and block until sent.

NetBurner, Inc.
21.35 mcanMODM7AE70::mcan_module Class Reference 637

Parameters

id_value CAN id
data Pointer to message data
data_length Length of data in bytes
TimeOut Time out value in system time ticks. For example, TICKS_PER_SECOND ∗ 1

21.35.3.2 MultiCanReplaceRTRMessage()

int mcanMODM7AE70::mcan_module::MultiCanReplaceRTRMessage (
int channel,
uint8_t ∗ data,
uint8_t len )
Modifies/updates the response for the RTR message registered wotj MultiCanSetRTRMessage().

Returns

The channel number registered for the RTR message.

See also

MultiCanSetRTRMessage(), MultiCanStopRTRMessage()

21.35.3.3 MultiCanSetRTRMessage()

int mcanMODM7AE70::mcan_module::MultiCanSetRTRMessage (
uint32_t id,
uint8_t ∗ data,
uint8_t len,
int channel = -1 )
Enable an auto-reply to a CAN RTR message for the specified CAN ID. The reply message is specified by the data
parameter.
The response message can be modified with MultiCanReplaceRTRMessage().

Returns

The channel number corresponding to the ID and RTR message.

See also

MultiCanReplaceRTRMessage(), MultiCanStopRTRMessage()

21.35.3.4 MultiCanStopRTRMessage()

int mcanMODM7AE70::mcan_module::MultiCanStopRTRMessage (
int channel )
Unregister the RTR message for the specified channel.

See also

MultiCanSetRTRMessage(), MultiCanReplaceRTRMessage()

NetBurner, Inc.
638 Class Documentation

21.35.3.5 RegisterRxFifo()

int mcanMODM7AE70::mcan_module::RegisterRxFifo (
uint32_t composite_id,
OS_FIFO ∗ pFifo,
int channel = -1 )
Register a FIFO to receive CAN messages.

Parameters
composite←-
_id
pFifo Pointer to OS_FIFO for received data
channel Optional CAN channel

Returns

OS_NO_ERR on success

21.35.3.6 send_message()

void mcanMODM7AE70::mcan_module::send_message (
uint32_t id_value,
uint8_t ∗ data,
uint32_t data_length,
OS_SEM ∗ pSem = 0 )
Send a MCAN message.

Parameters

id_value CAN id
data Pointer to message data
data_length Length of data in bytes
pSem Optional pointer to semaphore to post to, default is no post

The documentation for this class was generated from the following file:
• mcan.h

21.36 NBRtosInitObj Class Reference


A simple class to derive from if you are creating taks that are constructed at global scope and need to do RTOS
initalization. The vistural function Notify will be called once the RTOS internals are setup so you can create a task,
allocate buffers,etc.. if you need to do network I/O then you this will not be sufficent as you will need register to be
notifyied when link is active on the interface.
#include <nbrtos.h>

Public Member Functions


• virtual void Notify ()=0
This will be called when the RTOS has been setup in initalization.

21.36.1 Detailed Description


A simple class to derive from if you are creating taks that are constructed at global scope and need to do RTOS
initalization. The vistural function Notify will be called once the RTOS internals are setup so you can create a task,

NetBurner, Inc.
21.37 NBString Class Reference 639

allocate buffers,etc.. if you need to do network I/O then you this will not be sufficent as you will need register to be
notifyied when link is active on the interface.

See also

NetInterface::LinkActiveFuncPtr

The documentation for this class was generated from the following files:

• nbrtos.h
• cppmain.cpp

21.37 NBString Class Reference


Lightweight alternative to C++ CString class.
#include <nbstring.h>

Public Member Functions


• NBString ()
Construct a NBString object.
• NBString (const NBString &str)
Construct a new NBString object from an existing NBString object.
• NBString (const NBString &str, size_t pos, size_t len=npos)
Construct a new NBString object from a substring of an existing NBString object.
• NBString (const char ∗s)
Construct a NBString object from a character string (null terminated array of characters)
• NBString (const char ∗s, size_t n)
Construct a NBString object from a character string up to the specified amount.
• ∼NBString ()
NBString destructor.
• const char ∗ c_str () const
Method to pass a NBString as a constant char ∗.
• NBString substr (size_t pos=0, size_t len=npos) const
Creates a new NBString object from a substring of the existing NBString object.
• int compare (const NBString &str) const
Compares two NBString objects.
• int compare (const char ∗s) const
Compares the NBString object to a character string.
• size_t find (const NBString str, size_t pos=0) const
Find a substring within a NBString object.
• size_t find (const char ∗str, size_t pos=0) const
Find a substring within a character string.
• size_t find (const char ∗s, size_t pos, size_t n) const
Find a substring within a character string.
• size_t find (char c, size_t pos=0) const
Find the first occurence of a character within the NBString object.
• size_t size () const
Returns the current size of memory allocated for the string.
• size_t length () const
Returns the length of the string.
• void clear ()
Clear a NBString object and free allocated memory.
• bool empty () const

NetBurner, Inc.
640 Class Documentation

Check if a string is empty.


• NBString & Append (const char ∗str, size_t len)
Append a string to an existing NBString object.
• int vsiprintf (const char ∗format, va_list &vl)
Print a string with formatting.
• int sprintf (const char ∗format,...)
sprintf a string with formatting to a character array
• int sprintf (NBString const format,...)
sprintf a string with formatting to a NBString object
• int siprintf (const char ∗format,...)
isprintf (integer) a string with formatting to a character array
• int siprintf (NBString const format,...)
isprintf (integer) a string with formatting to a NBString object
• int stoi () const
Parse the string and convert to an integer number.
• long stol () const
Parse the string value and convert to a long integer number.
• unsigned int stoui () const
Parse the string value and convert to a const integer number.
• unsigned long stoul () const
Parse the string value and convert to a const unsigned long integer number.
• double stod () const
Parse the string value and convert to a const double float number.
• IPADDR to_ipaddr () const
Parse the string value and convert to an IPADDR IP address.
• size_t copy (char ∗s, size_t len, size_t pos=0) const
Copy a substring, does not null terminate.
• size_t strcopy (char ∗s, size_t len, size_t pos=0) const
Copy a substring, with null termination.

Friends
• void swap (NBString &x, NBString &y)
Swaps the contents of two NBString objects.

21.37.1 Detailed Description


Lightweight alternative to C++ CString class.

21.37.2 Constructor & Destructor Documentation

21.37.2.1 NBString() [1/4]

NBString::NBString (
const NBString & str )
Construct a new NBString object from an existing NBString object.

Parameters

str Existing NBString object

NetBurner, Inc.
21.37 NBString Class Reference 641

21.37.2.2 NBString() [2/4]

NBString::NBString (
const NBString & str,
size_t pos,
size_t len = npos )
Construct a new NBString object from a substring of an existing NBString object.

Parameters

str Existing NBString object


pos Starting position to copy
len Ending position to copy

21.37.2.3 NBString() [3/4]

NBString::NBString (
const char ∗ s )
Construct a NBString object from a character string (null terminated array of characters)

Parameters

s String to initialize object

21.37.2.4 NBString() [4/4]

NBString::NBString (
const char ∗ s,
size_t n )
Construct a NBString object from a character string up to the specified amount.

Parameters

s String to initialize object


n Number of characters to copy

21.37.3 Member Function Documentation

21.37.3.1 Append()

NBString & NBString::Append (


const char ∗ str,
size_t len )
Append a string to an existing NBString object.
Append a string to an existing NBString object

Parameters

str String to append

NetBurner, Inc.
642 Class Documentation

Parameters

len Number of characters to append

Returns

The updated NBString object

21.37.3.2 c_str()

const char ∗ NBString::c_str ( ) const


Method to pass a NBString as a constant char ∗.
Will cause an allocation if it is pointing to a constant string longer than the currently allocated length.

Returns

A null terminated character array representing the string

21.37.3.3 clear()

void NBString::clear ( )
Clear a NBString object and free allocated memory.
Clear a NBString object and free allocated memory

21.37.3.4 compare() [1/2]

int NBString::compare (
const char ∗ s ) const
Compares the NBString object to a character string.

Parameters

s String to compare

Return values

0 If identical
-1 If NBString object is less than str
1 If NBString object is greater than str

21.37.3.5 compare() [2/2]

int NBString::compare (
const NBString & str ) const
Compares two NBString objects.

Parameters

str NBString object to compare

NetBurner, Inc.
21.37 NBString Class Reference 643

Return values

0 If identical
-1 If NBString object is less than str
1 If NBString object is greater than str

21.37.3.6 copy()

size_t NBString::copy (
char ∗ s,
size_t len,
size_t pos = 0 ) const
Copy a substring, does not null terminate.

Parameters
s Destination
len Size of destination
pos Starting position of copy

Returns

Number of bytes copied

21.37.3.7 empty()

bool NBString::empty ( ) const


Check if a string is empty.
Check if a NBString object is empty

Return values

true String is null


false String contains data

21.37.3.8 find() [1/4]

size_t NBString::find (
char c,
size_t pos = 0 ) const
Find the first occurence of a character within the NBString object.

Parameters

c Character to search for


pos Starting position to start search

Return values
>=0 Position in string

NetBurner, Inc.
644 Class Documentation

Return values

-1 If character not found

21.37.3.9 find() [2/4]

size_t NBString::find (
const char ∗ s,
size_t pos,
size_t n ) const
Find a substring within a character string.

Parameters

s String to search
pos Starting position to start search
n Number of characters that have to match

Return values
>=0 Position in searched string
-1 If substring not found

21.37.3.10 find() [3/4]

size_t NBString::find (
const char ∗ str,
size_t pos = 0 ) const
Find a substring within a character string.

Parameters

str String to search


pos Starting position to start search

Return values
>=0 Position in searched string
-1 If substring not found

21.37.3.11 find() [4/4]

size_t NBString::find (
const NBString str,
size_t pos = 0 ) const
Find a substring within a NBString object.

NetBurner, Inc.
21.37 NBString Class Reference 645

Parameters

str NString object to search


pos Starting position to start search

Return values
>=0 Position in searched string
-1 If substring not found

21.37.3.12 length()

size_t NBString::length ( ) const


Returns the length of the string.

Returns

The length of the string

21.37.3.13 siprintf() [1/2]

int NBString::siprintf (
const char ∗ format,
... )
isprintf (integer) a string with formatting to a character array

Parameters

format printf style formatting

21.37.3.14 siprintf() [2/2]

int NBString::siprintf (
NBString const format,
... )
isprintf (integer) a string with formatting to a NBString object

Parameters

format printf style formatting

21.37.3.15 size()

size_t NBString::size ( ) const


Returns the current size of memory allocated for the string.
Returns

Total size of the object in bytes

NetBurner, Inc.
646 Class Documentation

21.37.3.16 sprintf() [1/2]

int NBString::sprintf (
const char ∗ format,
... )
sprintf a string with formatting to a character array

Parameters

format printf style formatting

21.37.3.17 sprintf() [2/2]

int NBString::sprintf (
NBString const format,
... )
sprintf a string with formatting to a NBString object

Parameters

format printf style formatting

21.37.3.18 stod()

double NBString::stod ( ) const


Parse the string value and convert to a const double float number.

Returns

const double float value

21.37.3.19 stoi()

int NBString::stoi ( ) const


Parse the string and convert to an integer number.

Returns

integer value

21.37.3.20 stol()

long NBString::stol ( ) const


Parse the string value and convert to a long integer number.

Returns

long integer value

NetBurner, Inc.
21.37 NBString Class Reference 647

21.37.3.21 stoui()

unsigned int NBString::stoui ( ) const


Parse the string value and convert to a const integer number.

Returns

unsigned integer value

21.37.3.22 stoul()

unsigned long NBString::stoul ( ) const


Parse the string value and convert to a const unsigned long integer number.

Returns

unsigned long integer value

21.37.3.23 strcopy()

size_t NBString::strcopy (
char ∗ s,
size_t len,
size_t pos = 0 ) const
Copy a substring, with null termination.

Parameters
s Destination
len Size of destination
pos Starting position of copy

Returns

Number of bytes copied

21.37.3.24 substr()

NBString NBString::substr (
size_t pos = 0,
size_t len = npos ) const
Creates a new NBString object from a substring of the existing NBString object.

Parameters

pos Starting position of substring


len Number of characters to copy

NetBurner, Inc.
648 Class Documentation

Returns

A NBString object

21.37.3.25 to_ipaddr()

IPADDR NBString::to_ipaddr ( ) const


Parse the string value and convert to an IPADDR IP address.

Returns

const double float value

21.37.3.26 vsiprintf()

int NBString::vsiprintf (
const char ∗ format,
va_list & vl )
Print a string with formatting.

Parameters

format printf style formatting


vl Variable argument list

21.37.4 Friends And Related Function Documentation

21.37.4.1 swap

void swap (
NBString & x,
NBString & y ) [friend]
Swaps the contents of two NBString objects.
Useful for optimizing sorts. Friend function that takes two NBString objects as parameters and swaps their contents.
The documentation for this class was generated from the following files:

• nbstring.h
• nbstring.cpp

21.38 NV_SettingsStruct Struct Reference


Configuration Settings.
#include <serialburnerdata.h>
Inherits config_obj.

Additional Inherited Members


21.38.1 Detailed Description
Configuration Settings.
DeviceName - Device name for DHCP NetBIOSName - NetBIOS name

NetBurner, Inc.
21.39 OS_CRIT Class Reference 649

• SSL and SSH ∗ CertificateRsaLength - Certificate length CertificateData - Certificate KeyHttpsRsaLength -


RSA key for HTTPS length, 0 is none KeyHttpsRsaData - RSA key for HTTPS KeyRsaLength - RSA key
length, 0 is none KeyRsaData - RSA key KeyDsaLength - DSA key length, 0 is none KeyDsaData - DSA key

• Version change key ∗ VerifyKey - Version change key

The documentation for this struct was generated from the following files:

• Parallax/src/nvsettings.h
• SaveUserParameters/src/main.cpp
• serial/SerialBurner/src/nvsettings.h
• SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h
• SSH/SshServerUserKey/src/nvsettings.h
• SSL/HttpsUploadCert/src/serialburnerdata.h
• SSL/SslClientVerifyPeerEffs/src/serialburnerdata.h
• webif.h

21.39 OS_CRIT Class Reference


An OS_CRIT object is used to establish critical sections of code that can only be run by one task at a time. Tasks
that try to claim a critical section which is currently claimed by another task will stop and wait for that task to leave
the critical section before continuing execution.
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.

Public Member Functions


• OS_CRIT ()
Create and initialize an OS_CRIT object.
• uint8_t Init ()
Initialize an OS_CRIT object to its default state.
• uint8_t LockAndEnter (uint32_t timeoutTicks=WAIT_FOREVER)
Locks the current task to prevent task switching, and claims a critical section.
• uint8_t Enter (uint32_t timeoutTicks=WAIT_FOREVER)
This function tries to enter or claim the critical section.
• uint8_t EnterNoWait ()
This function tries to enter or claim the critical section. However, this function does not wait if it is unable to enter or
claim the critical section.
• uint8_t Leave ()
This function releases the critical section.
• uint8_t LeaveAndUnlock ()
This function unlocks the task and releases the critical section.

Friends
• void ForceReboot (bool fromIRQ)
Forces the system hardware to perform a soft reset.

21.39.1 Detailed Description


An OS_CRIT object is used to establish critical sections of code that can only be run by one task at a time. Tasks
that try to claim a critical section which is currently claimed by another task will stop and wait for that task to leave
the critical section before continuing execution.

21.39.2 Member Function Documentation

NetBurner, Inc.
650 Class Documentation

21.39.2.1 Enter()

uint8_t OS_CRIT::Enter (
uint32_t timeoutTicks = WAIT_FOREVER )
This function tries to enter or claim the critical section.
Important: You must call Leave() once for each successful Enter() call to release the critical section so that another
task can run it.

Parameters

timeoutTicks How many time ticks do we want to wait for this critical section? Note: A timeout of 0 (zero)
waits forever.

Return values

OS_NO_ERR - If we were successful in claiming the critical section or if our task owns it
OS_TIMEOUT - If we were unable to claim the section

See also

NBRTOS Error Codes


EnterNoWait()
Leave()

21.39.2.2 EnterNoWait()

uint8_t OS_CRIT::EnterNoWait ( )
This function tries to enter or claim the critical section. However, this function does not wait if it is unable to enter or
claim the critical section.
Important: You must call Leave() once for each successful Enter() call to release the critical section so that another
task can run it.

Return values

OS_NO_ERR - If we were successful in claiming the critical section or if our task owns it
OS_TIMEOUT - If we were unable to claim the section

See also

NBRTOS Error Codes


Enter()
Leave()

21.39.2.3 Init()

uint8_t OS_CRIT::Init ( )
Initialize an OS_CRIT object to its default state.

Return values

OS_NO_ERR - If successful

NetBurner, Inc.
21.39 OS_CRIT Class Reference 651

See also

NBRTOS Error Codes

21.39.2.4 Leave()

uint8_t OS_CRIT::Leave ( )
This function releases the critical section.
Important: This function must be called once for each successful Enter() or EnterNoWait() call to release the critical
section so another task can run it.

Return values

OS_NO_ERR - If we were successful in releasing the critical section


OS_CRIT_ERR - If we are trying to release a critical section that we do not own

See also

NBRTOS Error Codes


Enter()
EnterNoWait()

21.39.2.5 LeaveAndUnlock()

uint8_t OS_CRIT::LeaveAndUnlock ( )
This function unlocks the task and releases the critical section.
Important: This function must be called once for each successful LockAndEnter() call to both unlock and release
the critical section so another task can run it.

Return values

OS_NO_ERR - If we were successful in releasing the critical section

See also

NBRTOS Error Codes


LockAndEnter()

21.39.2.6 LockAndEnter()

uint8_t OS_CRIT::LockAndEnter (
uint32_t timeoutTicks = WAIT_FOREVER )
Locks the current task to prevent task switching, and claims a critical section.
Important:If it is unable to claim the critical section and times out, then the lock will be released. Otherwise
LeaveAndUnlock() must be called once for each successful LockAndEnter() call to both unlock and release the
critical section so that another task might run it.

Parameters

timeoutTicks How many time ticks do we want to wait for this critical section? Note: A timeout of 0 (zero)
waits forever.

NetBurner, Inc.
652 Class Documentation

Return values

OS_NO_ERR - If we were successful in claiming the critical section or if our task owns it
OS_TIMEOUT - If we were unable to claim the section

See also

NBRTOS Error Codes


LeaveAndUnlock()
Enter()
The documentation for this class was generated from the following files:
• nbrtos.h
• nbrtos.cpp

21.40 OS_FIFO Class Reference


A FIFO is used to pass structures from one task to another. Note: Structures to be passed must have an unused
(void ∗) pointer as its first element. This precludes passing C++ objects with virtual member functions.
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.

Public Member Functions


• OS_FIFO ()
Create and initialize a FIFO object.
• uint8_t Init ()
Sets the FIFO object to its initial state.
• uint8_t Post (OS_FIFO_EL ∗pToPost)
This function posts to a FIFO object.
• uint8_t PostFirst (OS_FIFO_EL ∗pToPost)
This function is identical to Post(), but the element posted is put on the beginning of the FIFO list.
• OS_FIFO_EL ∗ Pend (uint32_t timeoutTicks, uint8_t &result)
This function pends on a FIFO for a specified number of ticks.
• OS_FIFO_EL ∗ PendNoWait (uint8_t &result)
Checks to see if a structure has been posted to a FIFO, but does not wait.
• OS_FIFO_EL ∗ Pend (uint32_t timeoutTicks=WAIT_FOREVER)
This function pends on a FIFO for a specified number of ticks. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result),
but does not provide a result code.
• OS_FIFO_EL ∗ PendNoWait ()
Checks to see if a structure has been posted to a FIFO, but does not wait. This is the same as
PendNoWait(uint8_t &result), but does not provide a result code.

21.40.1 Detailed Description


A FIFO is used to pass structures from one task to another. Note: Structures to be passed must have an unused
(void ∗) pointer as its first element. This precludes passing C++ objects with virtual member functions.

21.40.2 Member Function Documentation

21.40.2.1 Init()

uint8_t OS_FIFO::Init ( )
Sets the FIFO object to its initial state.

NetBurner, Inc.
21.40 OS_FIFO Class Reference 653

Return values

OS_NO_ERR - If successful

See also

NBRTOS Error Codes

21.40.2.2 Pend() [1/2]

OS_FIFO_EL ∗ OS_FIFO::Pend (
uint32_t timeoutTicks,
uint8_t & result ) [inline]
This function pends on a FIFO for a specified number of ticks.

Parameters

timeoutTicks The number of time ticks to wait.


out result A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it
fails).

Return values

Structure If successful
NULL If it timed out

See also

NBRTOS Error Codes


PendNoWait(uint8_t &result)
Pend(uint32_t timeoutTicks)

21.40.2.3 Pend() [2/2]

OS_FIFO_EL ∗ OS_FIFO::Pend (
uint32_t timeoutTicks = WAIT_FOREVER ) [inline]
This function pends on a FIFO for a specified number of ticks. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result),
but does not provide a result code.

Parameters

timeoutTicks The number of time ticks to wait.

Return values

Structure If successful
NULL If it timed out

NetBurner, Inc.
654 Class Documentation

See also

PendNoWait()
Pend(uint32_t timeoutTicks, uint8_t &result)

21.40.2.4 PendNoWait() [1/2]

OS_FIFO_EL ∗ OS_FIFO::PendNoWait ( ) [inline]


Checks to see if a structure has been posted to a FIFO, but does not wait. This is the same as
PendNoWait(uint8_t &result), but does not provide a result code.

Return values

Structure If successful
NULL If it failed

See also

Pend(uint32_t timeoutTicks)
PendNoWait(uint8_t &result)

21.40.2.5 PendNoWait() [2/2]

OS_FIFO_EL ∗ OS_FIFO::PendNoWait (
uint8_t & result )
Checks to see if a structure has been posted to a FIFO, but does not wait.

Parameters

out result A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).

Return values

Structure If successful
NULL If it failed

See also

NBRTOS Error Codes


Pend(uint32_t timeoutTicks, uint8_t &result)
PendNoWait()

21.40.2.6 Post()

uint8_t OS_FIFO::Post (
OS_FIFO_EL ∗ pToPost )
This function posts to a FIFO object.

Parameters

pToPost A pointer to the user's structure cast as an OS_FIFO_EL to be posted to the FIFO.

NetBurner, Inc.
21.41 OS_FLAGS Class Reference 655

Return values

OS_NO_ERR - If successful

See also

NBRTOS Error Codes


PostFirst(OS_FIFO_EL ∗pToPost)

21.40.2.7 PostFirst()

uint8_t OS_FIFO::PostFirst (
OS_FIFO_EL ∗ pToPost )
This function is identical to Post(), but the element posted is put on the beginning of the FIFO list.
The task that pends next will get the structure/object posted here, instead of any prior objects posted to the FIFO.

Parameters

pToPost A pointer to the user's structure cast as an OS_FIFO_EL to be posted to the FIFO.

Return values

OS_NO_ERR - If successful

See also

NBRTOS Error Codes


Post(OS_FIFO_EL ∗pToPost)

The documentation for this class was generated from the following files:

• nbrtos.h
• nbrtos.cpp

21.41 OS_FLAGS Class Reference


An OS_FLAGS object is used to set, clear, and pend on a set of flags that is held and maintained by the object.
#include <nbrtos.h>

Public Member Functions


• OS_FLAGS ()
Create and initialize an OS_FLAG object.
• void Init ()
Initialize an OS_FLAG object to its default value.
• void Set (uint32_t bits_to_set)
This function sets the corresponding bits asserted in bits_to_set.
• void Clear (uint32_t bits_to_clr)
This function clears the bits asserted in bits_to_clr.
• void Write (uint32_t bits_to_force)
This function forces the bits to match the passe din bits`.
• uint8_t PendAny (uint32_t bit_mask, uint16_t timeout=WAIT_FOREVER)

NetBurner, Inc.
656 Class Documentation

This function waits a number of time ticks specified by timeout until any of the flags indicated by bit_mask are
set.
• uint8_t PendAnyNoWait (uint32_t bit_mask)
This function immediately checks to see if any of the flag bits indicated by bit_mask are set; it does not wait.
• uint8_t PendAll (uint32_t bit_mask, uint16_t timeout=WAIT_FOREVER)
This function waits a number of time ticks specified by timeout until all the flags indicated by bit_mask are set.
• uint8_t PendAllNoWait (uint32_t bit_mask)
This function immediately checks to see if all the flag bits indicated by bit_mask are set; it does not wait.
• uint32_t State ()
This function returns the current values of the flags stored in the OS_FLAGS object structure.

21.41.1 Detailed Description


An OS_FLAGS object is used to set, clear, and pend on a set of flags that is held and maintained by the object.

21.41.2 Member Function Documentation

21.41.2.1 Clear()

void OS_FLAGS::Clear (
uint32_t bits_to_clr )
This function clears the bits asserted in bits_to_clr.

Parameters

bits_to_clr A bit or set of bits to be cleared.

See also

Set()
State()

21.41.2.2 PendAll()

uint8_t OS_FLAGS::PendAll (
uint32_t bit_mask,
uint16_t timeout = WAIT_FOREVER ) [inline]
This function waits a number of time ticks specified by timeout until all the flags indicated by bit_mask are set.

Parameters

bit_mask A bit or set of bits to wait on.


timeout Number of time ticks to wait for all specified flag bits to be set.

Return values

OS_NO_ERR If the flags condition is satisfied


OS_TIMEOUT If the timeout expired

NetBurner, Inc.
21.41 OS_FLAGS Class Reference 657

See also

PendAllNoWait()
PendAny()

21.41.2.3 PendAllNoWait()

uint8_t OS_FLAGS::PendAllNoWait (
uint32_t bit_mask )
This function immediately checks to see if all the flag bits indicated by bit_mask are set; it does not wait.

Parameters

bit_mask A bit or set of bits to wait on.

Return values

OS_NO_ERR All flags indicated by bit_mask are set.


OS_TIMEOUT Not all of the flags indicated by bit_mask are set.

See also

PendAll()
PendAnyNoWait()

21.41.2.4 PendAny()

uint8_t OS_FLAGS::PendAny (
uint32_t bit_mask,
uint16_t timeout = WAIT_FOREVER ) [inline]
This function waits a number of time ticks specified by timeout until any of the flags indicated by bit_mask are
set.

Parameters

bit_mask A bit or set of bits to wait on.


timeout Number of time ticks to wait for all specified flag bits to be set.

Return values

OS_NO_ERR At least one of the flag bits are set before timeout expires.
OS_TIMEOUT None of the flag bits are set before timeout expires.

See also

PendAnyNoWait()
PendAll()

21.41.2.5 PendAnyNoWait()

uint8_t OS_FLAGS::PendAnyNoWait (

NetBurner, Inc.
658 Class Documentation

uint32_t bit_mask )
This function immediately checks to see if any of the flag bits indicated by bit_mask are set; it does not wait.

Parameters

bit_mask A bit or set of bits to wait on.

Return values

OS_NO_ERR At least one of the flags indicated by bit_mask are set.


OS_TIMEOUT None of the flags indicated by bit_mask are set.

See also

PendAny()
PendAllNoWait()

21.41.2.6 Set()

void OS_FLAGS::Set (
uint32_t bits_to_set )
This function sets the corresponding bits asserted in bits_to_set.

Parameters

bits_to_set A bit or set of bits to be set.

See also

Clear()
State()

21.41.2.7 State()

uint32_t OS_FLAGS::State ( )
This function returns the current values of the flags stored in the OS_FLAGS object structure.

Returns

The state of the OS_FLAGS object.

See also

Set()
Clear()

21.41.2.8 Write()

void OS_FLAGS::Write (
uint32_t bits_to_force )
This function forces the bits to match the passe din bits`.

NetBurner, Inc.
21.42 OS_MBOX Class Reference 659

Parameters

bits_to_force Value to set all flags to.

See also

Set()
Clear()
State()

The documentation for this class was generated from the following files:
• nbrtos.h
• nbrtosflags.cpp

21.42 OS_MBOX Class Reference


Mailboxes are used to communicate between tasks.
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.

Public Member Functions


• OS_MBOX ()
Create and initialize a mailbox object.
• OS_MBOX (void ∗msg)
Create and initialize a mailbox object with a given message.
• uint8_t Init (void ∗msg=NULL)
Sets the mailbox object to its initial state.
• uint8_t Post (void ∗msg)
This function posts a message to the mailbox.
• void ∗ Pend (uint32_t timeoutTicks, uint8_t &result)
Wait timeout ticks for some other task to post to the mailbox. Note: Pend will wait forever if 0 is passed in as the
timeout value.
• void ∗ PendNoWait (uint8_t &result)
Checks to see if a message has been posted to a mailbox, but does not wait.
• void ∗ Pend (uint32_t timeoutTicks=WAIT_FOREVER)
Wait timeout ticks for some other task to post to the mailbox. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result),
but does not provide a return code. Note: Pend will wait forever if 0 is passed in as the timeout value.
• void ∗ PendNoWait ()
Checks to see if a message has been posted to a mailbox, but does not wait. This is the same as
PendNoWait(uint8_t &result), but does not provide a return code.

21.42.1 Detailed Description


Mailboxes are used to communicate between tasks.

21.42.2 Constructor & Destructor Documentation

21.42.2.1 OS_MBOX()

OS_MBOX::OS_MBOX (
void ∗ msg ) [inline]
Create and initialize a mailbox object with a given message.

NetBurner, Inc.
660 Class Documentation

Parameters
msg Message that the mailbox should be initialized with

21.42.3 Member Function Documentation

21.42.3.1 Init()

uint8_t OS_MBOX::Init (
void ∗ msg = NULL )
Sets the mailbox object to its initial state.

Parameters
msg Message that the mailbox should be initialized with

Return values

OS_NO_ERR If successful

See also

NBRTOS Error Codes

21.42.3.2 Pend() [1/2]

void ∗ OS_MBOX::Pend (
uint32_t timeoutTicks,
uint8_t & result ) [inline]
Wait timeout ticks for some other task to post to the mailbox. Note: Pend will wait forever if 0 is passed in as the
timeout value.

Parameters

timeoutTicks The number of system ticks to wait


out result The result status of the function: OS_NO_ERR if successful, OS_TIMEOUT if it timed out.

Return values

Message If successful
NULL If it timed out

See also

NBRTOS Error Codes


PendNoWait(uint8_t &result)
Pend(uint32_t timeoutTicks)

NetBurner, Inc.
21.42 OS_MBOX Class Reference 661

21.42.3.3 Pend() [2/2]

void ∗ OS_MBOX::Pend (
uint32_t timeoutTicks = WAIT_FOREVER ) [inline]
Wait timeout ticks for some other task to post to the mailbox. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result),
but does not provide a return code. Note: Pend will wait forever if 0 is passed in as the timeout value.

Parameters

timeoutTicks The number of system ticks to wait

Return values

Message If successful
NULL If it timed out

See also

PendNoWait()
Pend(uint32_t timeoutTicks, uint8_t &result)

21.42.3.4 PendNoWait() [1/2]

void ∗ OS_MBOX::PendNoWait ( ) [inline]


Checks to see if a message has been posted to a mailbox, but does not wait. This is the same as
PendNoWait(uint8_t &result), but does not provide a return code.

Return values

Message If successful
NULL If it failed

See also

NBRTOS Error Codes


Pend(uint32_t timeoutTicks)
PendNoWait(uint8_t &result)

21.42.3.5 PendNoWait() [2/2]

void ∗ OS_MBOX::PendNoWait (
uint8_t & result )
Checks to see if a message has been posted to a mailbox, but does not wait.

Parameters

out result The result status of the function: OS_NO_ERR if successful, OS_TIMEOUT if there was no
message.

Return values

Message If successful

NetBurner, Inc.
662 Class Documentation

Return values

NULL If it failed

See also

NBRTOS Error Codes


Pend(uint32_t timeoutTicks, uint8_t &result)
PendNoWait()

21.42.3.6 Post()

uint8_t OS_MBOX::Post (
void ∗ msg )
This function posts a message to the mailbox.

Parameters
msg Message that the mailbox should post

Return values

OS_NO_ERR If successful
OS_MBOX_FULL If the mailbox is full

See also

NBRTOS Error Codes

The documentation for this class was generated from the following files:

• nbrtos.h
• nbrtos.cpp

21.43 OS_Q Class Reference


A queue functions as a fixed size FIFO for communication between tasks.
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.

Public Member Functions


• OS_Q (void ∗∗pQueueStorage, uint8_t size)
Create and initialize a queue object.
• uint8_t Init (void ∗∗pQueueStorage, uint8_t size)
Sets the queue object to its initial state.
• uint8_t Post (void ∗pItem)
This function posts a message to a Queue. Note: Any higher priority task waiting on this queue will be started.
• uint8_t PostFirst (void ∗pItem)
This function posts a message like OSQPost, but posts the message at the head of the queue. Note: Any higher
priority task waiting on this queue will be started.
• uint8_t PostUnique (void ∗pItem)

NetBurner, Inc.
21.43 OS_Q Class Reference 663

This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it. Note: Any higher
priority task waiting on this queue will be started.
• uint8_t PostUniqueFirst (void ∗msg)
This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it at the head of the
queue. Note: Any higher priority task waiting on this queue will be started.
• void ∗ Pend (uint32_t timeoutTicks, uint8_t &result)
Wait timeout ticks for another task to post to the queue. Note: A timeout value of 0 (zero) waits forever. An err holds
the error code if the function fails.
• void ∗ PendNoWait (uint8_t &result)
Checks to see if a message has been posted to a queue, but does not wait. An err holds the error code if the function
fails.
• void ∗ Pend (uint32_t timeoutTicks=WAIT_FOREVER)
Wait timeout ticks for another task to post to the queue. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result),
but does not provide a result code. Note: A timeout value of 0 (zero) waits forever.
• void ∗ PendNoWait ()
Checks to see if a message has been posted to a queue, but does not wait. This is the same as
PendNoWait(uint8_t &result), but does not provide an result code.

21.43.1 Detailed Description


A queue functions as a fixed size FIFO for communication between tasks.

21.43.2 Constructor & Destructor Documentation

21.43.2.1 OS_Q()

OS_Q::OS_Q (
void ∗∗ pQueueStorage,
uint8_t size ) [inline]
Create and initialize a queue object.

Parameters

pQueueStorage A pointer to an array of (void ∗) pointers to hold queue messages.


size The number of pointers in the Q data storage area.

21.43.3 Member Function Documentation

21.43.3.1 Init()

uint8_t OS_Q::Init (
void ∗∗ pQueueStorage,
uint8_t size )
Sets the queue object to its initial state.

Parameters

pQueueStorage A pointer to an array of (void ∗) pointers to hold queue messages.


size The number of pointers in the Q data storage area.

NetBurner, Inc.
664 Class Documentation

Return values

OS_NO_ERR - If successful

See also

NBRTOS Error Codes

21.43.3.2 Pend() [1/2]

void ∗ OS_Q::Pend (
uint32_t timeoutTicks,
uint8_t & result ) [inline]
Wait timeout ticks for another task to post to the queue. Note: A timeout value of 0 (zero) waits forever. An err
holds the error code if the function fails.

Parameters

timeoutTicks The number of time ticks to wait.


&result A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).

Return values

Message If successful
NULL If it timed out

See also

NBRTOS Error Codes


PendNoWait(uint8_t &result)
Pend(uint32_t timeoutTicks)

21.43.3.3 Pend() [2/2]

void ∗ OS_Q::Pend (
uint32_t timeoutTicks = WAIT_FOREVER ) [inline]
Wait timeout ticks for another task to post to the queue. This is the same as Pend(uint32_t timeoutTicks, uint8_t &result),
but does not provide a result code. Note: A timeout value of 0 (zero) waits forever.

Parameters

timeoutTicks The number of time ticks to wait.

Return values

Message If successful
NULL If it timed out

NetBurner, Inc.
21.43 OS_Q Class Reference 665

See also

PendNoWait()
Pend(uint32_t timeoutTicks, uint8_t &result)

21.43.3.4 PendNoWait() [1/2]

void ∗ OS_Q::PendNoWait ( ) [inline]


Checks to see if a message has been posted to a queue, but does not wait. This is the same as
PendNoWait(uint8_t &result), but does not provide an result code.

Return values

Message If successful
NULL If it failed

See also

Pend(uint32_t timeoutTicks)
PendNoWait(uint8_t &result)

21.43.3.5 PendNoWait() [2/2]

void ∗ OS_Q::PendNoWait (
uint8_t & result )
Checks to see if a message has been posted to a queue, but does not wait. An err holds the error code if the
function fails.

Parameters

&result A variable to receive the result code (OS_NO_ERR if successful or OS_TIMEOUT if it fails).

Return values

Message If successful
NULL If it failed

See also

NBRTOS Error Codes


Pend(uint32_t timeoutTicks, uint8_t &result)
PendNoWait()

21.43.3.6 Post()

uint8_t OS_Q::Post (
void ∗ pItem )
This function posts a message to a Queue. Note: Any higher priority task waiting on this queue will be started.

Parameters
pItem The message to be posted to the queue.

NetBurner, Inc.
666 Class Documentation

Return values

OS_NO_ERR - If successful
OS_Q_FULL - If the queue is full and has no more room

See also

NBRTOS Error Codes


PostFirst(void ∗pItem)
PostUnique(void ∗pItem)

21.43.3.7 PostFirst()

uint8_t OS_Q::PostFirst (
void ∗ pItem )
This function posts a message like OSQPost, but posts the message at the head of the queue. Note: Any higher
priority task waiting on this queue will be started.

Parameters
pItem The message to be posted to the queue.

Return values

OS_NO_ERR - Successfully posted at the head of the queue


OS_Q_FULL - The queue is already full; cannot post message

See also

NBRTOS Error Codes


Post(void ∗pItem)
PostUniqueFirst(void ∗msg)

21.43.3.8 PostUnique()

uint8_t OS_Q::PostUnique (
void ∗ pItem )
This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it. Note: Any
higher priority task waiting on this queue will be started.

Parameters
∗pItem The message to be posted to the queue

Return values

OS_NO_ERR If successful
OS_Q_EXISTS If the message already exists in the queue
OS_Q_FULL If the queue is full and has no more room

NetBurner, Inc.
21.44 OS_SEM Class Reference 667

See also

NBRTOS Error Codes


Post(void ∗pItem)
PostUniqueFirst(void ∗msg)

21.43.3.9 PostUniqueFirst()

uint8_t OS_Q::PostUniqueFirst (
void ∗ msg )
This function checks to see if a message already exists in a queue, and if it doesn't, it then posts it at the head of
the queue. Note: Any higher priority task waiting on this queue will be started.

Parameters
∗msg Pointer to the message to be posted to the queue

Return values

OS_NO_ERR If successful
OS_Q_EXISTS If the message already exists in the queue
OS_Q_FULL If the queue is full and has no more room

See also

NBRTOS Error Codes


PostUnique(void ∗pItem)
PostFirst(void ∗pItem)

The documentation for this class was generated from the following files:

• nbrtos.h
• nbrtos.cpp

21.44 OS_SEM Class Reference


Semaphores are used to control access to shared resource critical section, or to communicate between tasks.
#include <nbrtos.h>
Inherits OS_TASK_DLY_OBJ.

Public Member Functions


• OS_SEM (int32_t cnt=0)
Create and initialize a semaphore.
• uint8_t Init (int32_t cnt=0)
This function is used to initialize a semaphore structure. Note: This must be done before using a semaphore.
• uint8_t Post ()
This function increases the value of the semaphore by one. Note: If any higher priority tasks were waiting on the
semaphore - it releases them.
• uint8_t Pend (uint32_t timeoutTicks=WAIT_FOREVER)
Wait timeout ticks for the value of the semaphore to be non zero. Note: A timeout value of 0 (zero) waits forever.
• uint8_t PendNoWait ()
Pend on a semaphore with no waiting period.

NetBurner, Inc.
668 Class Documentation

21.44.1 Detailed Description


Semaphores are used to control access to shared resource critical section, or to communicate between tasks.

21.44.2 Constructor & Destructor Documentation

21.44.2.1 OS_SEM()

OS_SEM::OS_SEM (
int32_t cnt = 0 ) [inline]
Create and initialize a semaphore.

Parameters

cnt Starting count

21.44.3 Member Function Documentation

21.44.3.1 Init()

uint8_t OS_SEM::Init (
int32_t cnt = 0 )
This function is used to initialize a semaphore structure. Note: This must be done before using a semaphore.

Parameters

cnt Starting count

Return values

OS_NO_ERR If successful
OS_SEM_ERR If it fails

See also

NBRTOS Error Codes

21.44.3.2 Pend()

uint8_t OS_SEM::Pend (
uint32_t timeoutTicks = WAIT_FOREVER ) [inline]
Wait timeout ticks for the value of the semaphore to be non zero. Note: A timeout value of 0 (zero) waits forever.

Parameters

timeoutTicks Number of system time ticks to wait. If no value is specified, it will wait forever.

Return values

OS_NO_ERR If successful

NetBurner, Inc.
21.45 OSCriticalSectionObj Class Reference 669

Return values

OS_TIMEOUT If it timed out

See also

NBRTOS Error Codes


PendNoWait()

21.44.3.3 PendNoWait()

uint8_t OS_SEM::PendNoWait ( )
Pend on a semaphore with no waiting period.
Identical to the Pend() function, but it does not wait.

Return values

OS_NO_ERR If successful
OS_TIMEOUT If it failed

See also

NBRTOS Error Codes


Pend(uint32_t timeoutTicks)

21.44.3.4 Post()

uint8_t OS_SEM::Post ( )
This function increases the value of the semaphore by one. Note: If any higher priority tasks were waiting on the
semaphore - it releases them.

Return values

OS_NO_ERR If successful

See also

NBRTOS Error Codes

The documentation for this class was generated from the following files:

• nbrtos.h
• nbrtos.cpp

21.45 OSCriticalSectionObj Class Reference


A simple wrapper class that helps utilize OS_CRIT objects more effectively.
#include <nbrtos.h>

Public Member Functions


• OSCriticalSectionObj (OS_CRIT &ocrit)
Initialize the OSCriticalSectionObj object, and then call Enter() on the OS_CRIT object that is passed in.

NetBurner, Inc.
670 Class Documentation

• ∼OSCriticalSectionObj ()
Destructs the OSCriticalSectionObj object, and call Leave() on the OS_CRIT object that was passed into the con-
structor.

21.45.1 Detailed Description


A simple wrapper class that helps utilize OS_CRIT objects more effectively.
When an OSCriticalSectionObj is constructed calls Enter() on the OS_CRIT object that is passed in, and will wait
indefinitely to claim the section. When the object is deconstructed, it calls Leave() on the OS_CRIT object.

See also

OS_CRIT::Enter()
OS_CRIT::Leave()

21.45.2 Constructor & Destructor Documentation

21.45.2.1 OSCriticalSectionObj()

OSCriticalSectionObj::OSCriticalSectionObj (
OS_CRIT & ocrit ) [inline]
Initialize the OSCriticalSectionObj object, and then call Enter() on the OS_CRIT object that is passed in.

Parameters
ocrit The object that will be used to enter and leave the critical section.

The documentation for this class was generated from the following file:

• nbrtos.h

21.46 OSLockAndCritObj Class Reference


A simple wrapper class that helps utilize OS_CRIT objects to lock tasks and enter critical sections more effectively.
#include <nbrtos.h>

Public Member Functions


• OSLockAndCritObj (OS_CRIT &ocrit)
Initialize the OSCriticalSectionObj object, and then call LockAndEnter() on the OS_CRIT object that is passed in.
• ∼OSLockAndCritObj ()
Call LeaveAndUnlock() on the OSCriticalSectionObj object, then destruct.

21.46.1 Detailed Description


A simple wrapper class that helps utilize OS_CRIT objects to lock tasks and enter critical sections more effectively.
When an OSCriticalSectionObj is constructed it calls LockAndEnter() on the OS_CRIT object that is passed in,
and will wait indefinitely to claim the section. When the object is deconstructed, it calls LeaveAndUnlock() on the
OS_CRIT object.

See also

OS_CRIT::LockAndEnter()
OS_CRIT::LeaveAndUnlock()

NetBurner, Inc.
21.47 OSLockObj Class Reference 671

21.46.2 Constructor & Destructor Documentation

21.46.2.1 OSLockAndCritObj()

OSLockAndCritObj::OSLockAndCritObj (
OS_CRIT & ocrit ) [inline]
Initialize the OSCriticalSectionObj object, and then call LockAndEnter() on the OS_CRIT object that is passed in.

Parameters
ocrit The object that will be used to enter and leave the critical section.

The documentation for this class was generated from the following file:
• nbrtos.h

21.47 OSLockObj Class Reference


A simple wrapper class that helps use OS locks effectively.
#include <nbrtos.h>

Public Member Functions


• OSLockObj ()
Initialize the OSLockObj and calls OSLock().
• ∼OSLockObj ()
Destructs the OSLockObj and calls OSUnlock().

21.47.1 Detailed Description


A simple wrapper class that helps use OS locks effectively.
When an OSLockObj is constructed it locks the OS. When it is destructed it unlocks the OS. If you have a function
that needs an OS lock and has multiple points of exit, create an OSLockObj at the beginning of the function.
Important: No matter how you leave the function, the destructor will release the lock.
See also

OSLock()
OSUnlock()

The documentation for this class was generated from the following file:
• nbrtos.h

21.48 OSSpinCrit Class Reference


A simple wrapper class that uses an OS_CRIT object to try and claim a critical section, and will continue the attempt
until it is able to do so.
#include <nbrtos.h>

Public Member Functions


• OSSpinCrit (OS_CRIT &ocrit)
Initialize the OSSpinCrit object, and then call EnterNoWait() repeatedly on the OS_CRIT object that is passed in until
it is able to claim the critical section.
• ∼OSSpinCrit ()
Call Leave() on the OS_CRIT object, and then destruct/.

NetBurner, Inc.
672 Class Documentation

21.48.1 Detailed Description


A simple wrapper class that uses an OS_CRIT object to try and claim a critical section, and will continue the attempt
until it is able to do so.
The way this class is implemented allows the task to continue to be made active by the scheduler. When an
OSSpinCrit is constructed, it calls EnterNoWait() repeatedly on the OS_CRIT object passed in until it is able to
claim the critical section. When the object is deconstructed, it calls Leave() on the OS_CRIT object.

See also

OS_CRIT::EnterNoWait()
OS_CRIT::Leave()

21.48.2 Constructor & Destructor Documentation

21.48.2.1 OSSpinCrit()

OSSpinCrit::OSSpinCrit (
OS_CRIT & ocrit ) [inline]
Initialize the OSSpinCrit object, and then call EnterNoWait() repeatedly on the OS_CRIT object that is passed in
until it is able to claim the critical section.

Parameters
&ocrit The object that will be used to enter and leave the critical section.

The documentation for this class was generated from the following file:

• nbrtos.h

21.49 ParsedJsonDataSet Class Reference


A class to create, read, and modify a JSON object.
#include <json_lexer.h>
Inherits buffer_object.

Public Member Functions


• void EnableLargeStrings (bool b)
Call to allow allocation of strings larger than 1500 bytes.
• virtual int WriteData (const unsigned char ∗pCopyFrom, int numBytes)
Writes the passed in data to the JSON data set.
• virtual int ReadFrom (int fd)
Reads in data from the specified file descriptor and parses it into the JSON data set.
• json_primitive_type GetFirst ()
Get the first element of the JSON data set.
• json_primitive_type GetNext ()
Get the element at the next position of the JSON data set.
• json_primitive_type GetCurrent ()
Get the element at the current position of the JSON data set.
• json_primitive_type GetRawCurrent ()
Get the element at the current position of the JSON data set, including non-public types.
• json_primitive_type GetNextName ()
Iterates the current element of the JSON data set until it finds one of type NAME.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 673

• json_primitive_type GetNextObject ()
Get the next element of type name that exists in the current OBJECT after the current position.
• json_primitive_type GetNextArray ()
Iterates the current element of the JSON data set until it finds one of type BEGIN_ARRAY.
• json_primitive_type GetNextNameInCurrentObject ()
Get the next element of type NAME that exists in the current OBJECT after the current position.
• json_primitive_type GetNextNameInCurrentArray ()
Get the next element of type NAME that exists in the current ARRAY after the current position.
• json_primitive_type GetNextNumberInCurrentArray ()
Get the next element of type NUMBER that exists in the current ARRAY after the current position.
• json_primitive_type GetNextStringInCurrentArray ()
Get the next element of type STRING that exists in the current ARRAY after the current position.
• json_primitive_type GetNextBoolInCurrentArray ()
Get the next element of type TRUE_EL that exists in the current ARRAY after the current position.
• json_primitive_type GetNextObjectInCurrentArray ()
Get the next element of type BEGIN_OBJECT that exists in the current ARRAY after the current position.
• json_primitive_type SkipCurrentValue ()
Skips over the current value, and get the next element. If called inside an ARRAY or OBJECT, it will walk to the end
of the ARRAY or OJBECT and return the next element it finds. If it reaches the end of the ARRAY or OBJECT before
it finds a value, it will return NOTFOUND.
• void ResetPosition ()
Resets the parser position to the beginning of the JSON data set.
• JsonRef GetParsePosition ()
Gets the current parse position object for the JSON data set.
• JsonRef SetParsePosition (JsonRef pos)
Sets the current parse position object for the JSON data set.
• json_primitive_type FindFullName (const char ∗name)
Find the element in the data set with the given name and move the parser to the next element. This searches a full
name path, such as ob1.ob2.ob3.ob4.
• json_primitive_type FindFullAtName (const char ∗name)
Find the element in the data set with the given name and move the parser to that element. This searches a full name
path, such as ob1.ob2.ob3.ob4.
• json_primitive_type FindElementAfterName (const char ∗name)
Finds name in current object points at element after name. This only supports simple, single element names. This
searches from the current position to the end.
• json_primitive_type FindGlobalElementAfterName (const char ∗name)
Finds name in current object points at element after name. This only supports simple, single element names. It starts
the search from the parser's current position, and if it doesn't find it, it will start the search over from the beginning.
• json_primitive_type FindElementAfterNameInCurrentObject (const char ∗name)
Looks for elements with the current name in the current OBJECT only. Does not search sub objects.
• json_primitive_type FindElementAfterNameInCurrentArray (const char ∗name)
Looks for elements with the current name in the current ARRAY only. Does not search sub arrays.
• bool CurrentBool ()
Returns true if the current element a TRUE_EL primitive type.
• bool PermissiveCurrentBool ()
Returns true if the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.
• double CurrentNumber ()
Get the number value of the current element.
• const char ∗ CurrentString ()
Get the string value of the current element.
• const char ∗ CurrentName ()
Get the name of the current element.

NetBurner, Inc.
674 Class Documentation

• bool FindFullNameBoolean (const char ∗name)


Find the boolean value of a given element.
• bool FindGlobalBoolean (const char ∗name)
Find the boolean value of a given element. Starts at the current position and then starts again at the beginning of the
data set if the element isn't found. This supports only simple, single element names.
• bool FindBoolean (const char ∗name)
Find the boolean value of the element after the element with the given name.
• bool FindBooleanInCurentObject (const char ∗name)
Find the boolean value of the element within the current object. Does not search sub-objects.
• bool FindFullNamePermissiveBoolean (const char ∗name)
Find the permissive boolean value of a given element.
• bool FindGlobalPermissiveBoolean (const char ∗name)
Find the permissive boolean value of a given element. Starts at the current position and then starts again at the
beginning of the data set if the element isn't found. This supports only simple, single element names.
• bool FindPermissiveBoolean (const char ∗name)
Find the permissive boolean value of the element after the element with the provided name.
• bool FindPermissiveBooleanInCurentObject (const char ∗name)
Find the permissive boolean value of the element with the given name in the current object. Does not search sub-
objects.
• const char ∗ FindFullNameString (const char ∗name)
Find the string value of the element with the given name in the current object.
• const char ∗ FindGlobalString (const char ∗name)
Find the string value of a given element. Starts at the current position and then starts again at the beginning of the
data set if the element isn't found. This supports only simple, single element names.
• const char ∗ FindString (const char ∗name)
Find the string value of the element after the element with the given name.
• const char ∗ FindStringInCurentObject (const char ∗name)
Find the string value of the element with the given name in the current object. Does not search sub-objects.
• double FindFullNameNumber (const char ∗name)
Find the number value of the element with the given name in the current object.
• double FindGlobalNumber (const char ∗name)
Find the number value of a given element. Starts at the current position and then starts again at the beginning of the
data set if the element isn't found. This supports only simple, single element names.
• double FindNumber (const char ∗name)
Find the number value of the element after the element with the given name.
• double FindNumberInCurentObject (const char ∗name)
Find the number value of the element with the given name in the current object. Does not search sub-objects.
• bool FindGlobalObject (const char ∗name)
Find the OBJECT with the given name. Starts at the current position and then starts again at the beginning of the
data set if the element isn't found. This supports only simple, single element names.
• bool FindObject (const char ∗name)
Find the OBJECT of the element after the element with the given name.
• bool FindObjectInCurentObject (const char ∗name)
Find the OBJECT of the element with the given name in the current OBJECT. Does not search sub-objects.
• bool CopyObject (ParsedJsonDataSet &src_set)
Copies the provided JSON data set into the current one.
• void ClearObject ()
Clears all data from the object and resets it to its initial state.
• void DumpState ()
Displays what's in the parse tree.
• void PrintObject (bool pretty=false)
Prints out the JSON data set.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 675

• int PrintObjectToBuffer (char ∗buffer, int maxlen, bool pretty=false)


Prints the JSON data set to a provided buffer.
• void PrintObjectToFd (int fd, bool pretty=false)
Prints the JSON data set to a specified file descriptor.
• int GetPrintSize (bool pretty=false)
Calculates how many characters the JSON data set would take to print.
• void StartBuilding ()
Use to start building the JSON data set.
• void AddObjectStart (const char ∗name)
Use to start an object in the JSON data set.
• void AddMyMac (const char ∗name)
Add the device MAC address to the JSON data set.
• void Add (const char ∗name, int i)
Add a name/value pair to the JSON data set where the value is an int.
• void Add (const char ∗name, short i)
Add a name/value pair to the JSON data set where the value is a short.
• void Add (const char ∗name, long i)
Add a name/value pair to the JSON data set where the value is a long.
• void Add (const char ∗name, unsigned int i)
Add a name/value pair to the JSON data set where the value is an unsigned int.
• void Add (const char ∗name, unsigned short i)
Add a name/value pair to the JSON data set where the value is a unsigned short.
• void Add (const char ∗name, unsigned long i)
Add a name/value pair to the JSON data set where the value is a unsigned long.
• void Add (const char ∗name, double d)
Add a name/value pair to the JSON data set where the value is a double.
• void Add (const char ∗name, const char ∗str)
Add a name/value pair to the JSON data set where the value is a string.
• void Add (const char ∗name, bool b)
Add a name/value pair to the JSON data set where the value is a bool.
• void Add (const char ∗name, IPADDR4 i4)
Add a name/value pair to the JSON data set where the value is an IPv4 address.
• void Add (const char ∗name, const IPADDR &i)
Add a name/value pair to the JSON data set where the value is an IP address.
• void Add (const char ∗name, const MACADR &ma)
Add a name/value pair to the JSON data set where the value is a MAC address.
• void AddNull (const char ∗name)
Add a name/value pair to the JSON data set where the value is null.
• void AddArrayStart (const char ∗name)
Add an ARRAY start to the JSON data set.
• void EndArray ()
Add an ARRAY end to the JSON data set.
• void AddArrayElement (int i)
Add an integer value to the current array.
• void AddArrayElement (short i)
Add a short value to the current array.
• void AddArrayElement (long i)
Add a long value to the current array.
• void AddArrayElement (unsigned int i)
Add an unsigned int value to the current array.
• void AddArrayElement (unsigned short i)

NetBurner, Inc.
676 Class Documentation

Add an unsigned short value to the current array.


• void AddArrayElement (unsigned long i)
Add an unsigned long value to the current array.
• void AddArrayElement (double d)
Add a double to the current array.
• void AddArrayElement (const char ∗str)
Add a string to the current array.
• void AddArrayElement (bool b)
Add a bool to the current array.
• void AddArrayElement (const IPADDR &i)
Add an IP address to the current array.
• void AddArrayElementArray ()
Add the start of an array element to the current array.
• void AddArrayObjectStart ()
Add the start of an object element to the current array.
• void AddNullArrayElement ()
Add a null element to the current array.
• void EndObject ()
Add an end to the current object.
• void DoneBuilding ()
Add an end JSON data set and finish building.

Friends
• class JsonRef

21.49.1 Detailed Description


A class to create, read, and modify a JSON object.

21.49.2 Member Function Documentation

21.49.2.1 Add() [1/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
bool b )
Add a name/value pair to the JSON data set where the value is a bool.

Parameters

name The name of the pair.


b The value for the pair.

21.49.2.2 Add() [2/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
const char ∗ str )
Add a name/value pair to the JSON data set where the value is a string.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 677

Parameters

name The name of the pair.


str A pointer to the value for the pair.

21.49.2.3 Add() [3/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
const IPADDR & i )
Add a name/value pair to the JSON data set where the value is an IP address.

Parameters

name The name of the pair.


i The IP address to add.

21.49.2.4 Add() [4/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
const MACADR & ma )
Add a name/value pair to the JSON data set where the value is a MAC address.

Parameters

name The name of the pair.


ma The MAC address to add.

21.49.2.5 Add() [5/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
double d )
Add a name/value pair to the JSON data set where the value is a double.

Parameters

name The name of the pair.


d The value for the pair.

21.49.2.6 Add() [6/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
int i )
Add a name/value pair to the JSON data set where the value is an int.

NetBurner, Inc.
678 Class Documentation

Parameters

name The name of the pair.


i The value for the pair.

21.49.2.7 Add() [7/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
IPADDR4 i4 )
Add a name/value pair to the JSON data set where the value is an IPv4 address.

Parameters

name The name of the pair.


i4 The IPv4 address to add.

21.49.2.8 Add() [8/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
long i )
Add a name/value pair to the JSON data set where the value is a long.

Parameters

name The name of the pair.


i The value for the pair.

21.49.2.9 Add() [9/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
short i )
Add a name/value pair to the JSON data set where the value is a short.

Parameters

name The name of the pair.


i The value for the pair.

21.49.2.10 Add() [10/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
unsigned int i )
Add a name/value pair to the JSON data set where the value is an unsigned int.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 679

Parameters

name The name of the pair.


i The value for the pair.

21.49.2.11 Add() [11/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
unsigned long i )
Add a name/value pair to the JSON data set where the value is a unsigned long.

Parameters

name The name of the pair.


i The value for the pair.

21.49.2.12 Add() [12/12]

void ParsedJsonDataSet::Add (
const char ∗ name,
unsigned short i )
Add a name/value pair to the JSON data set where the value is a unsigned short.

Parameters

name The name of the pair.


i The value for the pair.

21.49.2.13 AddArrayElement() [1/10]

void ParsedJsonDataSet::AddArrayElement (
bool b )
Add a bool to the current array.

Parameters
b The bool value to add.

21.49.2.14 AddArrayElement() [2/10]

void ParsedJsonDataSet::AddArrayElement (
const char ∗ str )
Add a string to the current array.

Parameters
str A char∗ pointing to the string value to add.

NetBurner, Inc.
680 Class Documentation

21.49.2.15 AddArrayElement() [3/10]

void ParsedJsonDataSet::AddArrayElement (
const IPADDR & i )
Add an IP address to the current array.

Parameters
i The IP address to add.

21.49.2.16 AddArrayElement() [4/10]

void ParsedJsonDataSet::AddArrayElement (
double d )
Add a double to the current array.

Parameters
d The double value to add.

21.49.2.17 AddArrayElement() [5/10]

void ParsedJsonDataSet::AddArrayElement (
int i )
Add an integer value to the current array.

Parameters
i The integer value to add.

21.49.2.18 AddArrayElement() [6/10]

void ParsedJsonDataSet::AddArrayElement (
long i )
Add a long value to the current array.

Parameters
i The long value to add.

21.49.2.19 AddArrayElement() [7/10]

void ParsedJsonDataSet::AddArrayElement (
short i )
Add a short value to the current array.

Parameters
i The short value to add.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 681

21.49.2.20 AddArrayElement() [8/10]

void ParsedJsonDataSet::AddArrayElement (
unsigned int i )
Add an unsigned int value to the current array.

Parameters
i The unsigned int value to add.

21.49.2.21 AddArrayElement() [9/10]

void ParsedJsonDataSet::AddArrayElement (
unsigned long i )
Add an unsigned long value to the current array.

Parameters
i The unsigned long value to add.

21.49.2.22 AddArrayElement() [10/10]

void ParsedJsonDataSet::AddArrayElement (
unsigned short i )
Add an unsigned short value to the current array.

Parameters
i The unsigned short value to add.

21.49.2.23 AddArrayStart()

void ParsedJsonDataSet::AddArrayStart (
const char ∗ name )
Add an ARRAY start to the JSON data set.

Parameters

name The name of the array to start.

21.49.2.24 AddMyMac()

void ParsedJsonDataSet::AddMyMac (
const char ∗ name )
Add the device MAC address to the JSON data set.

Parameters

name The name of the field containing the MAC address.

NetBurner, Inc.
682 Class Documentation

21.49.2.25 AddNull()

void ParsedJsonDataSet::AddNull (
const char ∗ name )
Add a name/value pair to the JSON data set where the value is null.

Parameters

name The name of the pair.

21.49.2.26 AddObjectStart()

void ParsedJsonDataSet::AddObjectStart (
const char ∗ name )
Use to start an object in the JSON data set.

Parameters

name The name of the object to start.

21.49.2.27 CopyObject()

bool ParsedJsonDataSet::CopyObject (
ParsedJsonDataSet & src_set )
Copies the provided JSON data set into the current one.

Return values
true The copy succeeded.
false The copy failed.

21.49.2.28 CurrentBool()

bool ParsedJsonDataSet::CurrentBool ( ) [inline]


Returns true if the current element a TRUE_EL primitive type.

Return values

true If the current element is a TRUE_EL primitive type.


false If the current element is not a TRUE_EL primitive type.

21.49.2.29 CurrentName()

const char ∗ ParsedJsonDataSet::CurrentName ( ) [inline]


Get the name of the current element.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 683

Returns

A pointer to the name of the current element, if it has one. If it does not, it returns a 0.

21.49.2.30 CurrentNumber()

double ParsedJsonDataSet::CurrentNumber ( ) [inline]


Get the number value of the current element.
Returns

The number value if the current element's primitive type is NUMBER. Otherwise it returns a quite NAN.

21.49.2.31 CurrentString()

const char ∗ ParsedJsonDataSet::CurrentString ( ) [inline]


Get the string value of the current element.

Returns

The a pointer to the string value of the current element if it is of primitive type STRING or ALLOC_STRING.
Otherwise it returns a 0.

21.49.2.32 FindBoolean()

bool ParsedJsonDataSet::FindBoolean (
const char ∗ name ) [inline]
Find the boolean value of the element after the element with the given name.

Parameters

name The name of the element to find.

Return values

true If the element is of the TRUE_EL primitive type.


false If the element is not of the TRUE_EL primitive type.

21.49.2.33 FindBooleanInCurentObject()

bool ParsedJsonDataSet::FindBooleanInCurentObject (
const char ∗ name ) [inline]
Find the boolean value of the element within the current object. Does not search sub-objects.

Parameters

name The name of the element to find.

Return values

true If the element is of the TRUE_EL primitive type.


false If the element is not of the TRUE_EL primitive type.

NetBurner, Inc.
684 Class Documentation

21.49.2.34 FindElementAfterName()

json_primitive_type ParsedJsonDataSet::FindElementAfterName (
const char ∗ name ) [inline]
Finds name in current object points at element after name. This only supports simple, single element names. This
searches from the current position to the end.

Parameters

name The name to look for.

Returns

The type that the parser is now currently set to.

Return values

NOTFOUND If the an element with the name wasn't found.

21.49.2.35 FindElementAfterNameInCurrentArray()

json_primitive_type ParsedJsonDataSet::FindElementAfterNameInCurrentArray (
const char ∗ name ) [inline]
Looks for elements with the current name in the current ARRAY only. Does not search sub arrays.

Parameters

name The name to look for.

Returns

The type that the parser is now currently set to.

Return values

NOTFOUND If the an element with the name wasn't found.

21.49.2.36 FindElementAfterNameInCurrentObject()

json_primitive_type ParsedJsonDataSet::FindElementAfterNameInCurrentObject (
const char ∗ name ) [inline]
Looks for elements with the current name in the current OBJECT only. Does not search sub objects.

Parameters

name The name to look for.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 685

Returns

The type that the parser is now currently set to.

Return values

NOTFOUND If the an element with the name wasn't found.

21.49.2.37 FindFullAtName()

json_primitive_type ParsedJsonDataSet::FindFullAtName (
const char ∗ name ) [inline]
Find the element in the data set with the given name and move the parser to that element. This searches a full
name path, such as ob1.ob2.ob3.ob4.

Parameters

name The full name to look for.

Returns

The type that the parser is now currently set to.

Return values

NOTFOUND If the an element with the name wasn't found.

21.49.2.38 FindFullName()

json_primitive_type ParsedJsonDataSet::FindFullName (
const char ∗ name ) [inline]
Find the element in the data set with the given name and move the parser to the next element. This searches a full
name path, such as ob1.ob2.ob3.ob4.

Parameters

name The full name to look for.

Returns

The type that the parser is now currently set to.

Return values

NOTFOUND If the an element with the name wasn't found, or there is no element after the named element.

21.49.2.39 FindFullNameBoolean()

bool ParsedJsonDataSet::FindFullNameBoolean (
const char ∗ name ) [inline]

NetBurner, Inc.
686 Class Documentation

Find the boolean value of a given element.

Parameters

name The full name of the element to find.

Return values

true If the element is of the TRUE_EL primitive type.


false If the element is not of the TRUE_EL primitive type.

21.49.2.40 FindFullNameNumber()

double ParsedJsonDataSet::FindFullNameNumber (
const char ∗ name ) [inline]
Find the number value of the element with the given name in the current object.

Parameters

name The full name of the element to find.

Returns

The number value of the element if found, otherwise a quiet nan.

21.49.2.41 FindFullNamePermissiveBoolean()

bool ParsedJsonDataSet::FindFullNamePermissiveBoolean (
const char ∗ name ) [inline]
Find the permissive boolean value of a given element.

Parameters

name The full name of the element to find.

Return values

true If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.
false If the current element is not a TRUE_EL primitive type, "True", "true", or is 0.

21.49.2.42 FindFullNameString()

const char ∗ ParsedJsonDataSet::FindFullNameString (


const char ∗ name ) [inline]
Find the string value of the element with the given name in the current object.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 687

Parameters

name The full name of the element to find.

Returns

A pointer to the buffer if the string is found, or null otherwise.

21.49.2.43 FindGlobalBoolean()

bool ParsedJsonDataSet::FindGlobalBoolean (
const char ∗ name ) [inline]
Find the boolean value of a given element. Starts at the current position and then starts again at the beginning of
the data set if the element isn't found. This supports only simple, single element names.

Parameters

name The name of the element to find.

Return values

true If the element is of the TRUE_EL primitive type.


false If the element is not of the TRUE_EL primitive type.

21.49.2.44 FindGlobalElementAfterName()

json_primitive_type ParsedJsonDataSet::FindGlobalElementAfterName (
const char ∗ name ) [inline]
Finds name in current object points at element after name. This only supports simple, single element names. It
starts the search from the parser's current position, and if it doesn't find it, it will start the search over from the
beginning.

Parameters

name The name to look for.

Returns

The type that the parser is now currently set to.

Return values

NOTFOUND If the an element with the name wasn't found.

21.49.2.45 FindGlobalNumber()

double ParsedJsonDataSet::FindGlobalNumber (
const char ∗ name ) [inline]

NetBurner, Inc.
688 Class Documentation

Find the number value of a given element. Starts at the current position and then starts again at the beginning of
the data set if the element isn't found. This supports only simple, single element names.

Parameters

name The name of the element to find.

Returns

The number value of the element if found, otherwise a quiet nan.

21.49.2.46 FindGlobalObject()

bool ParsedJsonDataSet::FindGlobalObject (
const char ∗ name ) [inline]
Find the OBJECT with the given name. Starts at the current position and then starts again at the beginning of the
data set if the element isn't found. This supports only simple, single element names.

Parameters

name The name of the OBJECT to find.

Return values

true If the OBJECT was found. The current position will be set to the start of the OBJECT.
false If the OBJECT was not found.

21.49.2.47 FindGlobalPermissiveBoolean()

bool ParsedJsonDataSet::FindGlobalPermissiveBoolean (
const char ∗ name ) [inline]
Find the permissive boolean value of a given element. Starts at the current position and then starts again at the
beginning of the data set if the element isn't found. This supports only simple, single element names.

Parameters

name The name of the element to find.

Return values

true If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.
false If the current element is not a TRUE_EL primitive type, "True", "true", or is 0.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 689

21.49.2.48 FindGlobalString()

const char ∗ ParsedJsonDataSet::FindGlobalString (


const char ∗ name ) [inline]
Find the string value of a given element. Starts at the current position and then starts again at the beginning of the
data set if the element isn't found. This supports only simple, single element names.

Parameters

name The name of the element to find.

Returns

A pointer to the buffer if the string is found, or null otherwise.

21.49.2.49 FindNumber()

double ParsedJsonDataSet::FindNumber (
const char ∗ name ) [inline]
Find the number value of the element after the element with the given name.

Parameters

name The name of the element to find.

Returns

The number value of the element if found, otherwise a quiet nan.

21.49.2.50 FindNumberInCurentObject()

double ParsedJsonDataSet::FindNumberInCurentObject (
const char ∗ name ) [inline]
Find the number value of the element with the given name in the current object. Does not search sub-objects.

Parameters

name The name of the element to find.

Returns

The number value of the element if found, otherwise a quiet nan.

21.49.2.51 FindObject()

bool ParsedJsonDataSet::FindObject (
const char ∗ name ) [inline]
Find the OBJECT of the element after the element with the given name.

Parameters

name The name of the OBJECT to find.

NetBurner, Inc.
690 Class Documentation

Return values

true If the OBJECT was found. The current position will be set to the start of the OBJECT.
false If the OBJECT was not found.

21.49.2.52 FindObjectInCurentObject()

bool ParsedJsonDataSet::FindObjectInCurentObject (
const char ∗ name ) [inline]
Find the OBJECT of the element with the given name in the current OBJECT. Does not search sub-objects.

Parameters

name The name of the OBJECT to find.

Return values

true If the OBJECT was found. The current position will be set to the start of the OBJECT.
false If the OBJECT was not found.

21.49.2.53 FindPermissiveBoolean()

bool ParsedJsonDataSet::FindPermissiveBoolean (
const char ∗ name ) [inline]
Find the permissive boolean value of the element after the element with the provided name.

Parameters

name The name of element to search on.

Return values

true If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.
false If the current element is not a TRUE_EL primitive type, "True", "true", or is 0.

21.49.2.54 FindPermissiveBooleanInCurentObject()

bool ParsedJsonDataSet::FindPermissiveBooleanInCurentObject (
const char ∗ name ) [inline]
Find the permissive boolean value of the element with the given name in the current object. Does not search
sub-objects.

Parameters

name The name of the element to find.

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 691

Return values

true If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.
false If the current element is not a TRUE_EL primitive type, "True", "true", or is 0.

21.49.2.55 FindString()

const char ∗ ParsedJsonDataSet::FindString (


const char ∗ name ) [inline]
Find the string value of the element after the element with the given name.

Parameters

name The name of the element to find.

Returns

A pointer to the buffer if the string is found, or null otherwise.

21.49.2.56 FindStringInCurentObject()

const char ∗ ParsedJsonDataSet::FindStringInCurentObject (


const char ∗ name ) [inline]
Find the string value of the element with the given name in the current object. Does not search sub-objects.

Parameters

name The name of the element to find.

Returns

A pointer to the buffer if the string is found, or null otherwise.

21.49.2.57 GetCurrent()

json_primitive_type ParsedJsonDataSet::GetCurrent ( ) [inline]


Get the element at the current position of the JSON data set.

Returns

The current element of the JSON data set.

Return values

UNDEFINED If there is an error in the parsing or if the parsing is not complete.


EOF_EL If it's the last element in the data set.

NetBurner, Inc.
692 Class Documentation

See also

GetFirst()
GetNext()
GetRawCurrent()
SkipCurrentValue()
ResetPosition()

21.49.2.58 GetFirst()

json_primitive_type ParsedJsonDataSet::GetFirst ( ) [inline]


Get the first element of the JSON data set.
Returns

The first element of the JSON data set.

Return values

UNDEFINED If there is an error in the parsing or if the parsing is not complete.


EOF_EL If it's the last element in the data set.

See also

GetNext()
GetCurrent()
GetRawCurrent()
ResetPosition()
SkipCurrentValue()

21.49.2.59 GetNext()

json_primitive_type ParsedJsonDataSet::GetNext ( ) [inline]


Get the element at the next position of the JSON data set.

Returns

The next element of the JSON data set.

Return values

UNDEFINED If there is an error in the parsing or if the parsing is not complete.


EOF_EL If it's the last element in the data set.

See also

GetFirst()
GetCurrent()
GetRawCurrent()
ResetPosition()
SkipCurrentValue()

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 693

21.49.2.60 GetNextArray()

json_primitive_type ParsedJsonDataSet::GetNextArray ( )
Iterates the current element of the JSON data set until it finds one of type BEGIN_ARRAY.

Returns

The next element with type BEGIN_ARRAY after the current position.

Return values

NOTFOUND If there is no BEGIN_ARRAY element after the current position.

See also

GetNextNameInCurrentObject()
GetNextNameInCurrentArray()

21.49.2.61 GetNextBoolInCurrentArray()

json_primitive_type ParsedJsonDataSet::GetNextBoolInCurrentArray ( )
Get the next element of type TRUE_EL that exists in the current ARRAY after the current position.

Returns

The next element with type TRUE_EL in the current ARRAY after the current position.

Return values

NOTFOUND If there is no NAME element after the current position.

See also

CurrentBool()
PermissiveCurrentBool()

21.49.2.62 GetNextName()

json_primitive_type ParsedJsonDataSet::GetNextName ( ) [inline]


Iterates the current element of the JSON data set until it finds one of type NAME.

Returns

The next element with type NAME after the current position.

Return values

NOTFOUND If there is no NAME element after the current position.

See also

GetNextNameInCurrentObject()
GetNextNameInCurrentArray()

NetBurner, Inc.
694 Class Documentation

21.49.2.63 GetNextNameInCurrentArray()

json_primitive_type ParsedJsonDataSet::GetNextNameInCurrentArray ( ) [inline]


Get the next element of type NAME that exists in the current ARRAY after the current position.

Returns

The next element with type NAME in the current ARRAY after the current position.

Return values

NOTFOUND If there is no NAME element after the current position.

See also

GetNextName()
GetNextNameInCurrentObject()

21.49.2.64 GetNextNameInCurrentObject()

json_primitive_type ParsedJsonDataSet::GetNextNameInCurrentObject ( ) [inline]


Get the next element of type NAME that exists in the current OBJECT after the current position.

Returns

The next element with type NAME in the current OBJECT after the current position.

Return values

NOTFOUND If there is no NAME element after the current position.

See also

GetNextName()
GetNextNameInCurrentArray()

21.49.2.65 GetNextNumberInCurrentArray()

json_primitive_type ParsedJsonDataSet::GetNextNumberInCurrentArray ( )
Get the next element of type NUMBER that exists in the current ARRAY after the current position.

Returns

The next element with type NUMBER in the current ARRAY after the current position.

Return values

NOTFOUND If there is no NAME element after the current position.

See also

CurrentNumber()

NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 695

21.49.2.66 GetNextObject()

json_primitive_type ParsedJsonDataSet::GetNextObject ( )
Get the next element of type name that exists in the current OBJECT after the current position.

Returns

The next element with type BEGIN_OBJECT after the current position.

Return values

NOTFOUND If there is no BEGIN_OBJECT element after the current position.

See also

GetNextNameInCurrentObject()
GetNextNameInCurrentArray()

21.49.2.67 GetNextObjectInCurrentArray()

json_primitive_type ParsedJsonDataSet::GetNextObjectInCurrentArray ( )
Get the next element of type BEGIN_OBJECT that exists in the current ARRAY after the current position.

Returns

The next element with type BEGIN_OBJECT in the current ARRAY after the current position.

Return values

NOTFOUND If there is no BEGIN_OBJECT element after the current position.

See also

GetNextName()
GetNextNameInCurrentObject()

21.49.2.68 GetNextStringInCurrentArray()

json_primitive_type ParsedJsonDataSet::GetNextStringInCurrentArray ( )
Get the next element of type STRING that exists in the current ARRAY after the current position.

Returns

The next element with type STRING in the current ARRAY after the current position.

Return values

NOTFOUND If there is no NAME element after the current position.

See also

CurrentString()

NetBurner, Inc.
696 Class Documentation

21.49.2.69 GetParsePosition()

JsonRef ParsedJsonDataSet::GetParsePosition ( )
Gets the current parse position object for the JSON data set.

Returns

The current parse position object.

21.49.2.70 GetPrintSize()

int ParsedJsonDataSet::GetPrintSize (
bool pretty = false )
Calculates how many characters the JSON data set would take to print.

Parameters
pretty Whether indentation and new lines should be provided between elements.

Returns

The number of characters needed to print the JSON data set.

21.49.2.71 GetRawCurrent()

json_primitive_type ParsedJsonDataSet::GetRawCurrent ( ) [inline]


Get the element at the current position of the JSON data set, including non-public types.

Returns

The current element of the JSON data set.

Return values

UNDEFINED If there is an error in the parsing or if the parsing is not complete.


EOF_EL If it's the last element in the data set.

See also

GetFirst()
GetNext()
GetCurrent()
ResetPosition()
SkipCurrentValue()

21.49.2.72 PermissiveCurrentBool()

bool ParsedJsonDataSet::PermissiveCurrentBool ( ) [inline]


Returns true if the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.

Return values

true If the current element a TRUE_EL primitive type, is "True", "true", or is a non-zero number.
false If the current element does not meet the true condition..
NetBurner, Inc.
21.49 ParsedJsonDataSet Class Reference 697

21.49.2.73 PrintObject()

void ParsedJsonDataSet::PrintObject (
bool pretty = false )
Prints out the JSON data set.

Parameters

pretty Whether to show indentation and new lines between JSON elements.

21.49.2.74 PrintObjectToBuffer()

int ParsedJsonDataSet::PrintObjectToBuffer (
char ∗ buffer,
int maxlen,
bool pretty = false )
Prints the JSON data set to a provided buffer.

Parameters

buffer The buffer to print to.


maxlen The max length of the buffer.
pretty Whether indentation and new lines should be provided between elements.

Returns

The number of characters printed.

21.49.2.75 PrintObjectToFd()

void ParsedJsonDataSet::PrintObjectToFd (
int fd,
bool pretty = false )
Prints the JSON data set to a specified file descriptor.

Parameters

fd The file descriptor to print to.


pretty Whether indentation and new lines should be provided between elements.

21.49.2.76 ReadFrom()

int ParsedJsonDataSet::ReadFrom (
int fd ) [virtual]
Reads in data from the specified file descriptor and parses it into the JSON data set.

Parameters

fd The file descriptor to read data from.

NetBurner, Inc.
698 Class Documentation

Returns

The number of bytes read

21.49.2.77 ResetPosition()

void ParsedJsonDataSet::ResetPosition ( ) [inline]


Resets the parser position to the beginning of the JSON data set.

See also

GetFirst()
GetNext()
GetCurrent()
SkipCurrentValue()

21.49.2.78 SetParsePosition()

JsonRef ParsedJsonDataSet::SetParsePosition (
JsonRef pos )
Sets the current parse position object for the JSON data set.

Parameters

pos The JsonRef that you want to set the current position to.

Returns

The current parse ref position for the JSON data set.

21.49.2.79 SkipCurrentValue()

json_primitive_type ParsedJsonDataSet::SkipCurrentValue ( ) [inline]


Skips over the current value, and get the next element. If called inside an ARRAY or OBJECT, it will walk to the
end of the ARRAY or OJBECT and return the next element it finds. If it reaches the end of the ARRAY or OBJECT
before it finds a value, it will return NOTFOUND.

Returns

The next element.

Return values

NOTFOUND If there are no other elements after the current one.

See also

GetFirst()
GetCurrent()
GetNext()
ResetPosition()
SkipCurrentValue()

NetBurner, Inc.
21.50 ParsedURI Class Reference 699

21.49.2.80 WriteData()

int ParsedJsonDataSet::WriteData (
const unsigned char ∗ pCopyFrom,
int numBytes ) [virtual]
Writes the passed in data to the JSON data set.

Parameters

pCopyFrom What data to write.


numBytes How many bytes to copy.

Returns

The number of bytes written


The documentation for this class was generated from the following files:
• json_lexer.h
• json_builder.cpp
• json_lexer.cpp

21.50 ParsedURI Class Reference


Parsed Uniform Resource Identifier Class (URI)
#include <http_funcs.h>

Public Member Functions


• void NewUri (const char ∗uri, uint16_t timeout=10 ∗TICKS_PER_SECOND)
Replace the existing (URI) object with new information.
• ParsedURI ()
Constructor to create a new blank URI object. For rare cases.
• ParsedURI (const char ∗uri, uint16_t timeout=10 ∗TICKS_PER_SECOND)
Constructor to create a new URI object.
• bool valid ()
Check to see if URI is valid.
• const char ∗ GetPath ()
Get the cached URI path.
• const char ∗ GetHost ()
Get the cached URI Host name.
• IPADDR GetAddr ()
Get the resolved host Address.
• uint16_t GetPort ()
Get the cached URI network port number.
• bool IsSecure ()
Check the security state of the cached URI object. Requires WEB_CLIENT_SSL_SUPPORT be defined in predef.h.
• void Invalidate ()
Set the state of the cached URI object to invalid.

21.50.1 Detailed Description


Parsed Uniform Resource Identifier Class (URI)
Web Client HTTP functions can pass a URL, which has to be parsed and use DNS to resolve if necessary. This
class provides an object with the parsed and DNS results that can be used for future transactions. The intent of
using this class is to cache the parsed results and dns lookup for communication to the same resource.
Enabling WEB_CLIENT_SSL_SUPPORT in predef.h adds TLS support.
The maximum size of the cached URI, path and hose are 256 bytes each.

NetBurner, Inc.
700 Class Documentation

21.50.2 Constructor & Destructor Documentation

21.50.2.1 ParsedURI()

ParsedURI::ParsedURI (
const char ∗ uri,
uint16_t timeout = 10 ∗ TICKS_PER_SECOND ) [inline]
Constructor to create a new URI object.

Parameters
uri Pointer to a URI.
timeout Number of sysem time tick to wait.

21.50.3 Member Function Documentation

21.50.3.1 GetAddr()

IPADDR ParsedURI::GetAddr ( ) [inline]


Get the resolved host Address.
Returns

The resolved host address.

21.50.3.2 GetHost()

const char ∗ ParsedURI::GetHost ( ) [inline]


Get the cached URI Host name.
Returns

Pointer to the cached host name if the cached URI is valid, otherwise NULL.

21.50.3.3 GetPath()

const char ∗ ParsedURI::GetPath ( ) [inline]


Get the cached URI path.

Returns

Pointer to the cached path string if the cached URI is valid, otherwise NULL.

21.50.3.4 GetPort()

uint16_t ParsedURI::GetPort ( ) [inline]


Get the cached URI network port number.

Returns

The cached URI port number if the cached URI is valid, otherwise 0.

NetBurner, Inc.
21.51 PinIO Class Reference 701

21.50.3.5 IsSecure()

bool ParsedURI::IsSecure ( ) [inline]


Check the security state of the cached URI object. Requires WEB_CLIENT_SSL_SUPPORT be defined in predef.h.

Return values

true Secure.
false URI object is invalid.

21.50.3.6 NewUri()

void ParsedURI::NewUri (
const char ∗ uri,
uint16_t timeout = 10 ∗ TICKS_PER_SECOND )
Replace the existing (URI) object with new information.
Update the existing URI with a new value.

Parameters
uri Pointer to URI string.
timeout Number of sysem time tick to wait.

21.50.3.7 valid()

bool ParsedURI::valid ( ) [inline]


Check to see if URI is valid.

Return values

true if valid
false if not valid

The documentation for this class was generated from the following files:

• http_funcs.h
• http_funcs.cpp

21.51 PinIO Class Reference


GPIO Pin Class.
#include <cpu_pins.h>

Public Types
• enum pin_fn_t {
PIN_FN_IN = 0 , PIN_FN_OUT , PIN_FN_A , PIN_FN_B ,
PIN_FN_C , PIN_FN_D }
Pin Function modes to configure the managed pin(s).

Public Member Functions


• PinIO ()

NetBurner, Inc.
702 Class Documentation

Construct an empty PinIO. Exists for bootstrap compatibility; not intended for general use.
• constexpr PinIO (uint32_t port, uint32_t pin)
Construct a PinIO for a specific cpu pin.
• constexpr PinIO (const PinIO &rhs)
Construct a copy of another PinIO.
• void setFn (pin_fn_t fn) const
Set the pin function for the managed pin(s).
• int8_t getFn ()
Get the pin function for the managed pin(s).
• void function (pin_fn_t fn) const
Set the pin function for the managed pin(s).
• void hiz () const
Configure the pin(s) to Input.
• void drive () const
Configure the pin(s) to Output, without modifying the driven value.
• void set () const
Drive the pin(s) High.
• void clr () const
Drive the pin(s) Low.
• bool tgl () const
Toggle the driven value for the pin(s).
• bool toggle () const
Toggle the driven value for the pin(s).
• bool readBack () const
Read the state of the pin(s) line state without changing the pin function or direction.
• bool read () const
Configure the pin as an input then return the line state.
• bool operator= (bool val)
Assign a driven value to the pin(s).
• PinIO & operator= (const PinIO &rhs)
Assign a driven value to the pin(s) based on the line state of another pin(s).
• operator bool () const
Read the line state of the pin(s).
• bool operator! () const
Return the opposite of the driven value of the pin(s).
• void multidrv (bool enable) const
Configure the multidrive/open-drain driver for the pin(s).
• void setHighStrength (bool bHighDrive)
Configure the drive strength of the output driver for the pin(s).
• void PullUp (bool enable) const
Configure the pad Pull Up resistor for the pin(s).
• void PullDown (bool enable) const
Configure the pad Pull Down resistor for the pin(s).
• uint16_t analogRead () const
Read an analog voltage on the given Pin. Only available for pins connected to the ADC.

Public Attributes
• volatile Pio & pio
• uint32_t mask

NetBurner, Inc.
21.51 PinIO Class Reference 703

21.51.1 Detailed Description


GPIO Pin Class.

21.51.2 Member Enumeration Documentation

21.51.2.1 pin_fn_t

enum PinIO::pin_fn_t
Pin Function modes to configure the managed pin(s).

Enumerator
PIN_FN_IN Input.
PIN_FN_OUT Output.
PIN_FN_A Peripheral A.
PIN_FN_B Peripheral B.
PIN_FN_C Peripheral C.
PIN_FN_D Peripheral D.

21.51.3 Constructor & Destructor Documentation

21.51.3.1 PinIO() [1/2]

constexpr PinIO::PinIO (
uint32_t port,
uint32_t pin ) [inline], [constexpr]
Construct a PinIO for a specific cpu pin.

Parameters

port The zero-indexed numeric instance number of the desired Pio module. (PIOA=0, PIOB=1, PIOC=2, etc.)
pin The zero-indexed pin number within the requested port that the new PinIO is to manage.

Example usage for pin 'PIOD_24'


PinIO LED1(3, 24);

21.51.3.2 PinIO() [2/2]

constexpr PinIO::PinIO (
const PinIO & rhs ) [inline], [constexpr]
Construct a copy of another PinIO.

Parameters

rhs The PinIO to construct a copy of.

21.51.4 Member Function Documentation

NetBurner, Inc.
704 Class Documentation

21.51.4.1 function()

void PinIO::function (
pin_fn_t fn ) const [inline]
Set the pin function for the managed pin(s).

Parameters

fn The pin function to be assigned to the managed pin(s).

21.51.4.2 getFn()

int8_t PinIO::getFn ( ) [inline]


Get the pin function for the managed pin(s).

Returns

The pin function as a pin_fn_t of the managed pin(s). Returns -1 if pin is not an I/O (ex: GND, VCC)

21.51.4.3 multidrv()

void PinIO::multidrv (
bool enable ) const [inline]
Configure the multidrive/open-drain driver for the pin(s).

Parameters

enable True: configure the output driver as Open Drain. False: configure the output driver as Push-Pull.

21.51.4.4 operator bool()

PinIO::operator bool ( ) const [inline]


Read the line state of the pin(s).
Returns

The line state of the pin(s): true = High, false = Low

21.51.4.5 operator"!()

bool PinIO::operator! ( ) const [inline]


Return the opposite of the driven value of the pin(s).
Returns

The opposite of the driven value of the pin(s).

21.51.4.6 operator=() [1/2]

bool PinIO::operator= (
bool val ) [inline]
Assign a driven value to the pin(s).

NetBurner, Inc.
21.51 PinIO Class Reference 705

Parameters

val The value to be driven on the pin(s): true = High, false = Low

Returns

The driven value for the pin(s).

21.51.4.7 operator=() [2/2]

PinIO & PinIO::operator= (


const PinIO & rhs ) [inline]
Assign a driven value to the pin(s) based on the line state of another pin(s).

Parameters

rhs The pin(s) who's line state will be assigned to this pin.

Returns

A copy of the PinIO being assigned to.

21.51.4.8 PullDown()

void PinIO::PullDown (
bool enable ) const [inline]
Configure the pad Pull Down resistor for the pin(s).

Parameters
enable True: enable the pad Pull Down. False: disable the pad Pull Down.

21.51.4.9 PullUp()

void PinIO::PullUp (
bool enable ) const [inline]
Configure the pad Pull Up resistor for the pin(s).

Parameters
enable True: enable the pad Pull Up. False: disable the pad Pull Up.

21.51.4.10 read()

bool PinIO::read ( ) const [inline]


Configure the pin as an input then return the line state.
Returns

The line state of the pin(s).

NetBurner, Inc.
706 Class Documentation

21.51.4.11 readBack()

bool PinIO::readBack ( ) const [inline]


Read the state of the pin(s) line state without changing the pin function or direction.

Returns

The line state of the pin(s).

21.51.4.12 setFn()

void PinIO::setFn (
pin_fn_t fn ) const [inline]
Set the pin function for the managed pin(s).

Parameters

fn The pin function to be assigned to the managed pin(s).

21.51.4.13 setHighStrength()

void PinIO::setHighStrength (
bool bHighDrive ) [inline]
Configure the drive strength of the output driver for the pin(s).

Parameters

bHighDrive True: configure the output driver for High Drive strength. False: configure the output driver for
Low Drive strength.

21.51.4.14 tgl()

bool PinIO::tgl ( ) const [inline]


Toggle the driven value for the pin(s).
Returns

The previously driven value for the pin(s).

21.51.4.15 toggle()

bool PinIO::toggle ( ) const [inline]


Toggle the driven value for the pin(s).
Returns

The previously driven value for the pin(s).

The documentation for this class was generated from the following file:
• cpu_pins.h

21.52 PINS::PinIO Class Reference


#include <pins.h>

NetBurner, Inc.
21.53 PinVector< n > Class Template Reference 707

21.52.1 Detailed Description


The following class is created to assist in processor pin configuration and operation for GPIO and
special functions. Each pin is defined by the system in the \Nburn\<Platform>\system and
\Nburn\<Platform>\include directories for the specific platform you are using.
Examples: J1[5] = 1; Set pin J1-5 high J2[30] = 0; Set pin J2-30 low J1[5].hiz(); Set pin J1-5 to be a high impedance
input BOOL bpinstate = J2[30]; Set the pin to be an input and read if ( !J2[30] ) iprintf( "The pin is low" );
The documentation for this class was generated from the following file:

• pins.h

21.53 PinVector< n > Class Template Reference


GPIO Pin Vector Class PinVector is a template instantiation of the _PinVector class, allowing for minimal storage
requirements for potentially large vectors, without heavy code duplication due to template copies.
#include <cpu_pins.h>
Inherits _PinVector.

Public Member Functions


• PinVector ()
Bare constructor for a PinVector, where the bit configurations will be made later.
• PinVector (PinIO ∗initpins, uint32_t pinCount)
PinVector Constructor, where pin configurations will be made at the time of construction.
• uint32_t operator= (uint32_t val)
Assign a value to the PinVector Bus.

21.53.1 Detailed Description


template<uint8_t n>
class PinVector< n >

GPIO Pin Vector Class PinVector is a template instantiation of the _PinVector class, allowing for minimal storage
requirements for potentially large vectors, without heavy code duplication due to template copies.

Parameters

PinVector::pinStore pinStore is the actual storage allocation for large PinVector's PinIO configurations.

21.53.2 Constructor & Destructor Documentation

21.53.2.1 PinVector()

template<uint8_t n>
PinVector< n >::PinVector (
PinIO ∗ initpins,
uint32_t pinCount ) [inline]
PinVector Constructor, where pin configurations will be made at the time of construction.

Parameters

initpins The array of PinIOs to be used to configure the PinVector.


pinCount The number of PinIOs in the configuration array to be used.

NetBurner, Inc.
708 Class Documentation

21.53.3 Member Function Documentation

21.53.3.1 operator=()

template<uint8_t n>
uint32_t PinVector< n >::operator= (
uint32_t val ) [inline]
Assign a value to the PinVector Bus.

Parameters
val The value to assign to the bus.

Returns

The value driven on the bus.

The documentation for this class was generated from the following file:

• cpu_pins.h

21.54 SerialRecord Struct Reference


#include <serialrecord.h>

Public Member Functions


• void AssignUartNumber (void)
• void ProcessTCPReadSerialData (void)
• void ProcessSpecialFrameTCPReadSerialData (void)
• void ProcessSpecialFrameWriteNetworkData (void)
• void ProcessSpecialFrameWriteTimeout (void)
• void MakeTcpConnection (void)
• void CloseListenPort (void)
• void MakeUdpConnection (void)
• bool OkToListen (void)
• void ProcessTimeouts (void)
• void ProcessAccept (void)
• void OpenSerialPort (void)
• void ProcessReadNetworkData (void)
• void OpenListenPort (void)
• void ProcessWriteNetworkData (void)
• void ProcessWriteSerialData (void)
• void ProcessSerialError (void)
• void ProcessListenError (void)
• void ProcessNetworkError (void)
• void GetCurrentChannelStatus (char ∗buffer)

21.54.1 Detailed Description


Class Definition (struct is class with all members public)

21.54.2 Member Function Documentation

NetBurner, Inc.
21.54 SerialRecord Struct Reference 709

21.54.2.1 AssignUartNumber()

void SerialRecord::AssignUartNumber (
void )
Methods
Assign physical UART number to PortRecord array index member

21.54.2.2 CloseListenPort()

void SerialRecord::CloseListenPort (
void )
Close the listening port

21.54.2.3 GetCurrentChannelStatus()

void SerialRecord::GetCurrentChannelStatus (
char ∗ buffer )
" Connected to IP xx.xx.xx.xx " Listening on port xx " UDP mode with learned send-to IP Address : xx.xx.xx.xx "
UDP mode send to Address : xx.xx.xx.xx " Idle

21.54.2.4 MakeTcpConnection()

void SerialRecord::MakeTcpConnection (
void )
Initiate a TCP connection

21.54.2.5 MakeUdpConnection()

void SerialRecord::MakeUdpConnection (
void )
Initiate a UDP connection

21.54.2.6 OkToListen()

bool SerialRecord::OkToListen (
void )
Check if conditions are right to establish a listening port

21.54.2.7 OpenListenPort()

void SerialRecord::OpenListenPort (
void )
Open the listening port

21.54.2.8 OpenSerialPort()

void SerialRecord::OpenSerialPort (
void )
Open a serial port

21.54.2.9 ProcessAccept()

void SerialRecord::ProcessAccept (
void )
Called when connections are waiting to be accepted

21.54.2.10 ProcessListenError()

void SerialRecord::ProcessListenError (
void )
Process listening errors

NetBurner, Inc.
710 Class Documentation

21.54.2.11 ProcessNetworkError()

void SerialRecord::ProcessNetworkError (
void )
Process network errors

21.54.2.12 ProcessReadNetworkData()

void SerialRecord::ProcessReadNetworkData (
void )
Called when data is received on the network port side

21.54.2.13 ProcessSerialError()

void SerialRecord::ProcessSerialError (
void )
Process serial errors

21.54.2.14 ProcessSpecialFrameTCPReadSerialData()

void SerialRecord::ProcessSpecialFrameTCPReadSerialData (
void )
Called to initiate an outgoing TCP connection when data is received on the serial data port side (this version for
TCP packet customization logic)

21.54.2.15 ProcessSpecialFrameWriteNetworkData()

void SerialRecord::ProcessSpecialFrameWriteNetworkData (
void )
Called when write space has just opened up on network port (this version for TCP packet customization logic)

21.54.2.16 ProcessSpecialFrameWriteTimeout()

void SerialRecord::ProcessSpecialFrameWriteTimeout (
void )
Time-out function used with TCP packet customization logic - waits for a given time to accumulate serial characters
before flushing them out the network side

21.54.2.17 ProcessTCPReadSerialData()

void SerialRecord::ProcessTCPReadSerialData (
void )
Called to initiate an outgoing TCP connection when data is received on the serial data port side

21.54.2.18 ProcessTimeouts()

void SerialRecord::ProcessTimeouts (
void )
Test all of the communication time-outs Periodically check for live connection at a user-specified interval by sending
an empty packet to the target device.
Wait at least two seconds for ACK to return after sending keep-alive packet. Target is lost if ACK was not the last
packet received.

21.54.2.19 ProcessWriteNetworkData()

void SerialRecord::ProcessWriteNetworkData (
void )
Called when write space has just opened up on network port

NetBurner, Inc.
21.55 SPI_QSPI Class Reference 711

21.54.2.20 ProcessWriteSerialData()

void SerialRecord::ProcessWriteSerialData (
void )
Called when write space has just opened up serial port
The documentation for this struct was generated from the following files:

• serialrecord.h
• serialrecord.cpp

21.55 SPI_QSPI Class Reference


The Single-Bit SPI mode QSPI Peripheral Class.
#include <quadspi.h>
Inherits SPIModule.

Public Member Functions


• SPI_QSPI (uint8_t QuadSPIModule=DEFAULT_QUADSPI_MODULE)
Create a SPI object.
• SPI_QSPI (uint8_t QuadSPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits=8, uint8_←-
t peripheralChipSelects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clock←-
Phase=1, BOOL doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
Create a SPI object and Initialize with parameters.
• virtual uint8_t Init (uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, uint8_t peripheralChip←-
Selects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL dout←-
Hiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0) override
Initialize an existing SPI object.
• virtual uint32_t SetBusSpeed (uint32_t maxSpeed) override
Set the SPI bus speed Will attempt to set the desired bus speed. It may be different based on the available system
characteristics.
• virtual uint8_t Start (uint8_t ∗transmitBufferPtr, volatile uint8_t ∗receiveBufferPtr, uint32_t byteCount, int cs←-
ReturnToInactive=DEASSERT_AFTER_LAST) override
Start a SPI transfer.
• virtual uint8_t Tx (uint8_t ∗transmitBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST)
override
Convenience function for unidirectional transmit.
• uint8_t Rx (uint8_t ∗receiveBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST)
Convenience function for unidirectional receive.
• virtual bool SetCS (uint8_t CS) override
Set the chip select configuration for the SPI object's bus transactions.

Additional Inherited Members


21.55.1 Detailed Description
The Single-Bit SPI mode QSPI Peripheral Class.
Class definition for SPI module objects

21.55.2 Constructor & Destructor Documentation

NetBurner, Inc.
712 Class Documentation

21.55.2.1 SPI_QSPI() [1/2]

SPI_QSPI::SPI_QSPI (
uint8_t QuadSPIModule = DEFAULT_QUADSPI_MODULE )
Create a SPI object.
This constructor will create the object, but will not initialize the SPI module. You must call the Init() member function
to initialize.

Parameters

QuadSPIModule QSPI module number (0). The SAME70 only has one QuadSPI module.

21.55.2.2 SPI_QSPI() [2/2]

SPI_QSPI::SPI_QSPI (
uint8_t QuadSPIModule,
uint32_t baudRateInBps,
uint8_t transferSizeInBits = 8,
uint8_t peripheralChipSelects = 0x00,
uint8_t chipSelectPolarity = 0x0F,
uint8_t clockPolarity = 0,
uint8_t clockPhase = 1,
BOOL doutHiz = TRUE,
uint8_t csToClockDelay = 0,
uint8_t delayAfterTransfer = 0 )
Create a SPI object and Initialize with parameters.
Creates a SPI object and initializes the SPI module. You do not need to call the Init() member function.

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for > than 8 bits per transfer then the data must be uint16_t aligned

Parameters

QuadSPIModule QSPI module number (0). The SAME70 has only one QuadSPI module
baudRateInBps Maximum baud rate requested
transferSizeInBits Number of bits per transfer: 8-bit up to 16-bit transfer sizes are valid
peripheralChipSelects SPI chip selects to use for transfer. Only one chip select is available to the QuadSPI
peripheral on pin P2[48].
chipSelectPolarity 0 = inactive logic level low, 1 = high
clockPolarity 0 = inactive logic level low, 1 = high
clockPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed
leading edge clock, captured following edge.
doutHiz Data output high impedance between transfers
csToClockDelay Delay from chip select to valid clock (default is 0). When 0, the delay is half the clock
period.
delayAfterTransfer When 0, no delay between consecutive transfers is inserted and the clock keeps its
duty cycle over the character transfers.

21.55.3 Member Function Documentation

NetBurner, Inc.
21.55 SPI_QSPI Class Reference 713

21.55.3.1 Init()

virtual uint8_t SPI_QSPI::Init (


uint32_t baudRateInBps = 2000000,
uint8_t transferSizeInBits = 8,
uint8_t peripheralChipSelects = 0x00,
uint8_t chipSelectPolarity = 0x0F,
uint8_t clockPolarity = 0,
uint8_t clockPhase = 1,
BOOL doutHiz = TRUE,
uint8_t csToClockDelay = 0,
uint8_t delayAfterTransfer = 0 ) [override], [virtual]
Initialize an existing SPI object.

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for > than 8 bits per transfer then the data must be uint16_t aligned

Parameters
baudRateInBps Maximum baud rate requested
transferSizeInBits Number of bits per transfer: 8-bit up to 16-bit transfer sizes are valid
peripheralChipSelects SPI chip selects to use for transfer. Only one chip select is available to the QuadSPI
peripheral on pin P2[48].
chipSelectPolarity 0 = inactive logic level low, 1 = high
clockPolarity 0 = inactive logic level low, 1 = high
clockPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed
leading edge clock, captured following edge.
doutHiz Data output high impedance between transfers
csToClockDelay Delay from chip select to valid clock (default is 0). When 0, the delay is half the clock
period.
delayAfterTransfer When 0, no delay between consecutive transfers is inserted and the clock keeps its
duty cycle over the character transfers.

Returns

The current state of the SPI bus dspiState

Reimplemented from SPIModule.

21.55.3.2 Rx()

uint8_t SPI_QSPI::Rx (
uint8_t ∗ receiveBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [inline], [virtual]
Convenience function for unidirectional receive.

Parameters

receiveBufferPtr Pointer to the buffer to write the received data


byteCount Number of bytes to transmit
csReturnToInactive Chip select state

NetBurner, Inc.
714 Class Documentation

Returns

The current state of the SPI bus dspiState

Reimplemented from SPIModule.

21.55.3.3 SetBusSpeed()

virtual uint32_t SPI_QSPI::SetBusSpeed (


uint32_t maxSpeed ) [override], [virtual]
Set the SPI bus speed Will attempt to set the desired bus speed. It may be different based on the available system
characteristics.

Parameters

maxSpeed The maximum desired bus speed

Returns

The actual bus speed

Reimplemented from SPIModule.

21.55.3.4 SetCS()

virtual bool SPI_QSPI::SetCS (


uint8_t CS ) [inline], [override], [virtual]
Set the chip select configuration for the SPI object's bus transactions.
Single-bit SPI mode for the QuadSPI peripheral only supports one chip select. This function is defined for compati-
bility between SPI drivers.

Parameters

CS The QuadSPI module has only one chip select.

Returns

true if successful, false if SPI is currently active

Reimplemented from SPIModule.

21.55.3.5 Start()

virtual uint8_t SPI_QSPI::Start (


uint8_t ∗ transmitBufferPtr,
volatile uint8_t ∗ receiveBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [override], [virtual]
Start a SPI transfer.

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for > than 8 bits per transfer then the data must be uint16_t aligned

• If either RX or TX pointer is assigned 'null' then that communication direction will not occur.

NetBurner, Inc.
21.56 SPIModule Class Reference 715

Parameters

transmitBufferPtr Pointer to the buffer containing the data to transmit


receiveBufferPtr Pointer to the buffer to store the received data
byteCount Number of bytes to transmit
csReturnToInactive Chip select state dspiChipSelectMode

Returns

The current state of the SPI bus dspiState

Reimplemented from SPIModule.

21.55.3.6 Tx()

virtual uint8_t SPI_QSPI::Tx (


uint8_t ∗ transmitBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [inline], [override], [virtual]
Convenience function for unidirectional transmit.

Parameters

transmitBufferPtr Pointer to the buffer containing the data to transmit


byteCount Number of bytes to transmit
csReturnToInactive Chip select state

Returns

The current state of the SPI bus dspiState

Reimplemented from SPIModule.


The documentation for this class was generated from the following file:

• quadspi.h

21.56 SPIModule Class Reference


SPI Peripheral Module Class.
#include <dspi.h>
Inherited by SPI_QSPI.

Public Member Functions


• SPIModule (uint8_t SPIModule)
Create a SPI object.
• SPIModule (uint8_t SPIModule, uint32_t baudRateInBps, uint8_t transferSizeInBits=8, uint8_t peripheral←-
ChipSelects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL
doutHiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
Create a SPI object and Initialize with parameters.
• virtual uint8_t Init (uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, uint8_t peripheralChip←-
Selects=0x00, uint8_t chipSelectPolarity=0x0F, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL dout←-
Hiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
Initialize an existing SPI object.
• virtual uint32_t SetBusSpeed (uint32_t maxSpeed)

NetBurner, Inc.
716 Class Documentation

Set the SPI bus speed Will attempt to set the desired bus speed. It may be different based on the available system
characteristics.
• virtual uint8_t Start (uint8_t ∗transmitBufferPtr, volatile uint8_t ∗receiveBufferPtr, uint32_t byteCount, int cs←-
ReturnToInactive=DEASSERT_AFTER_LAST)
Start a SPI transfer.
• virtual uint8_t Tx (uint8_t ∗transmitBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST)
Convenience function for unidirectional transmit.
• virtual uint8_t Rx (uint8_t ∗receiveBufferPtr, uint32_t byteCount, int csReturnToInactive=DEASSERT_AFTER_LAST)
Convenience function for unidirectional receive.
• virtual bool RegisterSem (OS_SEM ∗finishedSem)
Register a semaphore for the SPI module.
• virtual bool ClrSem ()
Clear a semaphore registration.
• virtual OS_SEM ∗ GetSem ()
Obtain a pointer to the SPI finished semaphore.
• virtual bool Done ()
Function to check SPI status.
• virtual uint32_t GetActualBaudrate ()
Returns the active baud rate.
• virtual bool SetCS (uint8_t CS)
Set the chip select configuration for the SPI object's bus transactions.

Static Public Member Functions


• static BOOL Done (uint8_t SPIModule)
Static function to check SPI status.

21.56.1 Detailed Description


SPI Peripheral Module Class.
Class definition for SPI module objects

21.56.2 Constructor & Destructor Documentation

21.56.2.1 SPIModule() [1/2]

SPIModule::SPIModule (
uint8_t SPIModule )
Create a SPI object.
This constructor will create the object, but will not initialize the SPI module. You must call the Init() member function
to initialize.

Parameters

SPIModule SPI module number (0 or 1)

21.56.2.2 SPIModule() [2/2]

SPIModule::SPIModule (
uint8_t SPIModule,
uint32_t baudRateInBps,

NetBurner, Inc.
21.56 SPIModule Class Reference 717

uint8_t transferSizeInBits = 8,
uint8_t peripheralChipSelects = 0x00,
uint8_t chipSelectPolarity = 0x0F,
uint8_t clockPolarity = 0,
uint8_t clockPhase = 1,
BOOL doutHiz = TRUE,
uint8_t csToClockDelay = 0,
uint8_t delayAfterTransfer = 0 )
Create a SPI object and Initialize with parameters.
Creaets a SPI object and initializes the SPI module. You do not need to call the Init() member function.

Parameters

SPIModule SPI module number (0 or 1)


baudRateInBps Maximum baud rate requested
transferSizeInBits Number of bits per transfer: 8, 16 or 32
peripheralChipSelects SPI chip selects to use for transfer spiChipSelect
chipSelectPolarity Parameter not supported on the MODM7AE70. Chip select asserts with logic level
low. spiChipSelectPolarity
clockPolarity 0 = inactive logic level low, 1 = high
clockPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed
leading edge clock, captured following edge.
doutHiz Data output high impedance between transfers
csToClockDelay Delay from chip select to valid clock (default is 0)
delayAfterTransfer Chip select mode dspiChipSelectMode

21.56.3 Member Function Documentation

21.56.3.1 ClrSem()

virtual bool SPIModule::ClrSem ( ) [inline], [virtual]


Clear a semaphore registration.
Returns

true if the clear was successful, false if a SPI transaction is in progress

21.56.3.2 Done() [1/2]

virtual bool SPIModule::Done ( ) [inline], [virtual]


Function to check SPI status.
Called as a class method on a specific SPI object. For example: MySpi.Done()
Returns

true if SPI is finished, false if active

21.56.3.3 Done() [2/2]

static BOOL SPIModule::Done (


uint8_t SPIModule ) [static]
Static function to check SPI status.
Is called as a class wide static method. For example: SPIModule::Done(0)

NetBurner, Inc.
718 Class Documentation

Parameters

SPIModule The SPI module to check, 0, 1 or 2

Returns

true if SPI is finished, false if active

21.56.3.4 GetActualBaudrate()

virtual uint32_t SPIModule::GetActualBaudrate ( ) [inline], [virtual]


Returns the active baud rate.
The baud rate will be set to the value specified when the SPI module is initialized. If that value is not possible, the
next lowest baud rate will be chosen.
Returns

The actual SPI module baud rate

21.56.3.5 GetSem()

virtual OS_SEM ∗ SPIModule::GetSem ( ) [inline], [virtual]


Obtain a pointer to the SPI finished semaphore.

Returns

A pointer to the semaphore

21.56.3.6 Init()

virtual uint8_t SPIModule::Init (


uint32_t baudRateInBps = 2000000,
uint8_t transferSizeInBits = 8,
uint8_t peripheralChipSelects = 0x00,
uint8_t chipSelectPolarity = 0x0F,
uint8_t clockPolarity = 0,
uint8_t clockPhase = 1,
BOOL doutHiz = TRUE,
uint8_t csToClockDelay = 0,
uint8_t delayAfterTransfer = 0 ) [virtual]
Initialize an existing SPI object.

Parameters
baudRateInBps Maximum baud rate requested
transferSizeInBits Number of bits per transfer: 8, 16 or 32
peripheralChipSelects SPI chip selects to use for transfer spiChipSelect
chipSelectPolarity Parameter not supported on the MODM7AE70. Chip select asserts with logic level
low. spiChipSelectPolarity
clockPolarity 0 = inactive logic level low, 1 = high
clockPhase 0 = data captured leading edge clock, changed following edge. 1 = data changed
leading edge clock, captured following edge.
doutHiz Data output high impedance between transfers
csToClockDelay Delay from chip select to valid clock (default is 0)
delayAfterTransfer Chip select mode dspiChipSelectMode
NetBurner, Inc.
21.56 SPIModule Class Reference 719

Returns

The current state of the SPI bus dspiState

Reimplemented in SPI_QSPI.

21.56.3.7 RegisterSem()

virtual bool SPIModule::RegisterSem (


OS_SEM ∗ finishedSem ) [virtual]
Register a semaphore for the SPI module.
The SPI module will post to this semaphore when a transaction is complete

Parameters

finishedSem Pointer to the semaphore

Returns

true if the registration was successful, false if a SPI transaction is in progress

21.56.3.8 Rx()

virtual uint8_t SPIModule::Rx (


uint8_t ∗ receiveBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [inline], [virtual]
Convenience function for unidirectional receive.

Parameters

∗receiveBufferPtr Pointer to the buffer to store incomeing data


byteCount Number of bytes to transmit
csReturnToInactive Chip select state

Returns

The current state of the SPI bus dspiState

Reimplemented in SPI_QSPI.

21.56.3.9 SetBusSpeed()

virtual uint32_t SPIModule::SetBusSpeed (


uint32_t maxSpeed ) [virtual]
Set the SPI bus speed Will attempt to set the desired bus speed. It may be different based on the available system
characteristics.

Parameters

maxSpeed The maximum desired bus speed

NetBurner, Inc.
720 Class Documentation

Returns

The actual bus speed

Reimplemented in SPI_QSPI.

21.56.3.10 SetCS()

virtual bool SPIModule::SetCS (


uint8_t CS ) [inline], [virtual]
Set the chip select configuration for the SPI object's bus transactions.

Parameters

CS Chip select to set, 0 - 3.

Returns

true if successful, false if SPI is currently active

Reimplemented in SPI_QSPI.

21.56.3.11 Start()

virtual uint8_t SPIModule::Start (


uint8_t ∗ transmitBufferPtr,
volatile uint8_t ∗ receiveBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [virtual]
Start a SPI transfer.

• If configured for 8 bits per transfer then the data must be uint8_t aligned

• If configured for > than 8 bits per transfer then the data must be uint16_t aligned

• If configured for > than 16 bits per transfer then the data must be uint32_t aligned

• If either RX or TX pointer is assigned 'null' then that communication direction will not occur.

• If DSPI_Finished points to a semaphore, then the DSPI will POST to it when the transfer is complete.

• The semaphore is optional, but it can increase efficiency.

Parameters

transmitBufferPtr Pointer to the buffer containing the data to transmit


receiveBufferPtr Pointer to the buffer to store the received data
byteCount Number of bytes to transmit
csReturnToInactive Chip select state

NetBurner, Inc.
21.57 SSC_cfg_t Struct Reference 721

Returns

The current state of the SPI bus dspiState

Reimplemented in SPI_QSPI.

21.56.3.12 Tx()

virtual uint8_t SPIModule::Tx (


uint8_t ∗ transmitBufferPtr,
uint32_t byteCount,
int csReturnToInactive = DEASSERT_AFTER_LAST ) [inline], [virtual]
Convenience function for unidirectional transmit.

Parameters

∗transmitBufferPtr Pointer to the buffer containing the data to transmit


byteCount Number of bytes to transmit
csReturnToInactive Chip select state

Returns

The current state of the SPI bus dspiState

Reimplemented in SPI_QSPI.
The documentation for this class was generated from the following file:

• cortex-m7/cpu/SAME70/include/dspi.h

21.57 SSC_cfg_t Struct Reference


Configuration structure for the SSC driver. Passed to the initialize function to configure the hardware.
#include <ssc_i2s.h>

Public Attributes
• uint16_t clkDiv {150}
• SSC_rxtx_cfg_t rx
• SSC_rxtx_cfg_t tx

21.57.1 Detailed Description


Configuration structure for the SSC driver. Passed to the initialize function to configure the hardware.

21.57.2 Member Data Documentation

21.57.2.1 clkDiv

SSC_cfg_t::clkDiv {150}
The divider value for the peripheral clock used to generate the bit clock when CLK_SRC_MCK is selected.

21.57.2.2 rx

SSC_cfg_t::rx
The receive configuration.

NetBurner, Inc.
722 Class Documentation

21.57.2.3 tx

SSC_cfg_t::tx
The transmit configuration.
The documentation for this struct was generated from the following file:

• ssc_i2s.h

21.58 SSC_rxtx_cfg_t Struct Reference


Configuration structure for a given direction (rx or tx) of the SSC module. Passed to the initialize function to configure
the hardware.
#include <ssc_i2s.h>

Public Attributes
• bool enable {false}
• uint8_t period {64}
• uint8_t startDly {1}
• startCond_t startCond {START_FRAME_EDGE}
• clkGate_t clkGate {CLK_GATE_CONTINUOUS}
• dataValid_t dataValid {DATA_VALID_RISING}
• clkOut_t clkOut {CLK_OUT_INPUT}
• clkSrc_t clkSrc {CLK_SRC_RK}
• uint8_t syncLen {0}
• frameEdge_t syncEdge {FRAME_SYNC_FALLING}
• bool syncDataEnabled {false}
• frameSyncOut_t syncOut {FRAME_SYNC_INPUT}
• uint8_t wordsPerFrame {1}
• bitOrder_t bitOrder {MOST_SIG_FIRST}
• bool lineIdleState {1}
• uint8_t bitsPerWord {24}
• bufferDepletionBehavior_t depletionBehavior {DEPLETED_PAUSE}

21.58.1 Detailed Description


Configuration structure for a given direction (rx or tx) of the SSC module. Passed to the initialize function to configure
the hardware.

21.58.2 Member Data Documentation

21.58.2.1 bitOrder

SSC_rxtx_cfg_t::bitOrder {MOST_SIG_FIRST}
The bit order of transitions.

21.58.2.2 bitsPerWord

SSC_rxtx_cfg_t::bitsPerWord {24}
The bit width of words to be transferred.

21.58.2.3 clkGate

SSC_rxtx_cfg_t::clkGate {CLK_GATE_CONTINUOUS}
The clock gating condition for this channel.

NetBurner, Inc.
21.58 SSC_rxtx_cfg_t Struct Reference 723

21.58.2.4 clkOut

SSC_rxtx_cfg_t::clkOut {CLK_OUT_INPUT}
The clock out condition for this channel.

21.58.2.5 clkSrc

SSC_rxtx_cfg_t::clkSrc {CLK_SRC_RK}
The clock source for this channel.

21.58.2.6 dataValid

SSC_rxtx_cfg_t::dataValid {DATA_VALID_RISING}
The data valid condition for this channel.

21.58.2.7 depletionBehavior

SSC_rxtx_cfg_t::depletionBehavior {DEPLETED_PAUSE}
The depletion behavior that should be used for driver DMA transfers.

21.58.2.8 enable

SSC_rxtx_cfg_t::enable {false}
Whether this direction should be enabled.

21.58.2.9 lineIdleState

SSC_rxtx_cfg_t::lineIdleState {1}
The state the line should be driven to when not transmitting a word.

21.58.2.10 period

SSC_rxtx_cfg_t::period {64}
The period of each frame, in terms of the bit clock.

21.58.2.11 startCond

SSC_rxtx_cfg_t::startCond {START_FRAME_EDGE}
The starting condition for this channel.

21.58.2.12 startDly

SSC_rxtx_cfg_t::startDly {1}
How many bit periods should data be delayed by at the start of the frame.

21.58.2.13 syncDataEnabled

SSC_rxtx_cfg_t::syncDataEnabled {false}
Whether synchronizing data is used.

21.58.2.14 syncEdge

SSC_rxtx_cfg_t::syncEdge {FRAME_SYNC_FALLING}
The frame sync edge defining frame start.

21.58.2.15 syncLen

SSC_rxtx_cfg_t::syncLen {0}
The bit length of the synchronization data (when used).

NetBurner, Inc.
724 Class Documentation

21.58.2.16 syncOut

SSC_rxtx_cfg_t::syncOut {FRAME_SYNC_INPUT}
The frame sync output configuration.

21.58.2.17 wordsPerFrame

SSC_rxtx_cfg_t::wordsPerFrame {1}
Number of words contained in a frame.
The documentation for this struct was generated from the following file:

• ssc_i2s.h

21.59 SSCCtx_t Class Reference


#include <ssc_i2s.h>

Public Member Functions


• int Init (const SSC_cfg_t &cfg)
Initializes the SSC hardware and driver context.
• void Shutdown ()
Shuts down the SSC hardware and driver.
• int getCurrentConfig (SSC_cfg_t &cfg)
Fills in the config object with the current active configuration.
• ctxState_t getState ()
Returns the current driver state.
• int TransmitBuffer (void ∗buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be transmitted by the SSC driver.
• int ReadyReceiveBuffer (void ∗buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be written to by the SSC driver.
• void RegisterTxBufferDoneCB (SSC_BufferDoneFn_t cb)
Registers a callback for when a transmit buffer is finished.
• void RegisterRxBufferDoneCB (SSC_BufferDoneFn_t cb)
Registers a callback for when a receive buffer is finished.

21.59.1 Detailed Description


SSCtcx_t is a driver for the Synchronous Serial Controller. It operates on a buffer level, where buffers are handed
to the system and either transmitted or filled with received data as appropriate.

21.59.2 Member Function Documentation

21.59.2.1 getCurrentConfig()

int SSCCtx_t::getCurrentConfig (
SSC_cfg_t & cfg )
Fills in the config object with the current active configuration.

Parameters

out cfg The configuration object to populate.

NetBurner, Inc.
21.59 SSCCtx_t Class Reference 725

Returns

Negative on failure.

21.59.2.2 getState()

ctxState_t SSCCtx_t::getState ( )
Returns the current driver state.
Returns

The current driver state.

21.59.2.3 Init()

int SSCCtx_t::Init (
const SSC_cfg_t & cfg )
Initializes the SSC hardware and driver context.

Parameters

in cfg The configuration to use.

Returns

Negative on failure.

21.59.2.4 ReadyReceiveBuffer()

int SSCCtx_t::ReadyReceiveBuffer (
void ∗ buffer,
uint32_t bufferLen,
bool waitIfNeeded )
Hands off a buffer to be written to by the SSC driver.

Parameters

buffer A pointer to the buffer to be written to.


bufferLen The length of the buffer to be written. (Must be multiples of 1, 2, or 4 bytes depending on word
bit width)
waitIfNeeded Whether the driver should wait for space to receive or fail immediately upon exhausting the
queue depth.

Returns

Negative on failure.

21.59.2.5 TransmitBuffer()

int SSCCtx_t::TransmitBuffer (
void ∗ buffer,
uint32_t bufferLen,
bool waitIfNeeded )

NetBurner, Inc.
726 Class Documentation

Hands off a buffer to be transmitted by the SSC driver.

NetBurner, Inc.
21.60 StopWatch Class Reference 727

Parameters

buffer A pointer to the buffer to be transmit.


bufferLen The length of the buffer to be transmit. (Must be multiples of 1, 2, or 4 bytes depending on word
bit width)
waitIfNeeded Whether the driver should wait for space to transmit or fail immediately upon exhausting the
queue depth.

Returns

Negative on failure.

The documentation for this class was generated from the following files:

• ssc_i2s.h
• ssc_i2s.cpp

21.60 StopWatch Class Reference


Stopwatch for timing events.
#include <stopwatch.h>

Public Member Functions


• StopWatch (int timer_number=FIRST_UNUSED_TIMER)
Create a stopwatch object.
• void Start ()
Start the stopwatch.
• void Clear ()
Clear the stopwatch count.
• unsigned long long Stop ()
Stop the StopWatch.
• unsigned long long GetTime ()
Get the StopWatch time.
• double CountResolution ()
Returns the value of one StopWatch tick time.
• double Convert (unsigned long long)
Convert a time or interval from an unsigned long long to double floatl.

21.60.1 Detailed Description


Stopwatch for timing events.

21.60.2 Constructor & Destructor Documentation

21.60.2.1 StopWatch()

StopWatch::StopWatch (
int timer_number = FIRST_UNUSED_TIMER )
Create a stopwatch object.
The timer number can be ignored on platforms that have a permanently allocated timer for the RTOS and CPU
frequency.

NetBurner, Inc.
728 Class Documentation

Parameters

timer_number Optional. Specifies the timer to use. If no timer is specified, the first unused timer will be selected.

21.60.3 Member Function Documentation

21.60.3.1 Clear()

void StopWatch::Clear ( )
Clear the stopwatch count.
Clear the StopWatch count

21.60.3.2 Convert()

double StopWatch::Convert (
unsigned long long )
Convert a time or interval from an unsigned long long to double floatl.

Return values

Elapsed time as a floating point number

21.60.3.3 CountResolution()

double StopWatch::CountResolution ( )
Returns the value of one StopWatch tick time.

Return values

The value of one stopwatch tick

21.60.3.4 GetTime()

unsigned long long StopWatch::GetTime ( )


Get the StopWatch time.

Return values

Elapsed time. Will work even if stopwatch is running.

21.60.3.5 Start()

void StopWatch::Start ( )
Start the stopwatch.
Start the StopWatch timer

21.60.3.6 Stop()

unsigned long long StopWatch::Stop ( )

NetBurner, Inc.
21.61 TicketNonce Struct Reference 729

Stop the StopWatch.

Return values
Elapsed time

The documentation for this class was generated from the following file:

• stopwatch.h

21.61 TicketNonce Struct Reference


#include <internal.h>

21.61.1 Detailed Description


TLS Extensions - RFC 6066 Server Name Indication - RFC 6066 (session 3) Maximum Fragment Length Negotiation
- RFC 6066 (session 4) Truncated HMAC - RFC 6066 (session 7) Certificate Status Request - RFC 6066 (session
8) Certificate Status Request v2 - RFC 6961 Supported Elliptic Curves - RFC 4492 (session 4) Renegotiation
Indication - RFC 5746 Session Ticket - RFC 5077 (session 3.2)
The documentation for this struct was generated from the following file:

• internal.h

21.62 TickTimeout Class Reference


TickTimeouts are used to facilitate sequential function calls with timeout parameters that need to index from an
initial start time and be proof against TimeTick rollover.
#include <nbrtos.h>

Public Member Functions


• TickTimeout (uint32_t timeout)
Create and initialize the Timeout.
• uint32_t val () const
Get the timeout duration to be passed to a function utilizing timeout ticks.
• bool expired () const
Determine whether the timeout duration has elapsed.
• operator bool () const
Use the Timeout as a boolean (such as in a branch condition). Since the intention is to be used for 'while' or in a
precondition check, the boolean value represents whether the duration is still valid and has not expired. As a result
this is the express opposite behavior of the 'expired' method.

Friends
• void OSTimeWaitUntil (uint32_t systemTickValue)
Delay the task until the specified value of the system timer tick. The number of system ticks per second is defined
by the constant: TICKS_PER_SECOND in <nburn_install>/nbrtos/include/constants.h. The
default value is 20 ticks per second.

21.62.1 Detailed Description


TickTimeouts are used to facilitate sequential function calls with timeout parameters that need to index from an
initial start time and be proof against TimeTick rollover.

NetBurner, Inc.
730 Class Documentation

21.62.2 Constructor & Destructor Documentation

21.62.2.1 TickTimeout()

TickTimeout::TickTimeout (
uint32_t timeout ) [inline], [explicit]
Create and initialize the Timeout.

Parameters
timeout The maximum allowed time duration in ticks. Note: The maximum delay that can be used is
INT32_MAX

21.62.3 Member Function Documentation

21.62.3.1 expired()

bool TickTimeout::expired ( ) const [inline]


Determine whether the timeout duration has elapsed.

Return values
true The timeout has expired
false The timeout has not expired

21.62.3.2 operator bool()

TickTimeout::operator bool ( ) const [inline]


Use the Timeout as a boolean (such as in a branch condition). Since the intention is to be used for 'while' or in a
precondition check, the boolean value represents whether the duration is still valid and has not expired. As a result
this is the express opposite behavior of the 'expired' method.

Return values
true The Timeout duration is still valid
false The Timeout duration is expired

21.62.3.3 val()

uint32_t TickTimeout::val ( ) const [inline]


Get the timeout duration to be passed to a function utilizing timeout ticks.

Return values
uint32←- The timeout duration
_t

NetBurner, Inc.
21.63 UDPPacket Class Reference 731

21.62.4 Friends And Related Function Documentation

21.62.4.1 OSTimeWaitUntil

void OSTimeWaitUntil (
uint32_t systemTickValue ) [friend]
Delay the task until the specified value of the system timer tick. The number of system ticks per second is defined
by the constant: TICKS_PER_SECOND in <nburn_install>/nbrtos/include/constants.h. The
default value is 20 ticks per second.

Parameters

systemTickValue The system time tick to wait for

uint32_t Now = TimeTick;


while(1)
{
Now += 60 * TICKS_PER_SECOND;
OSTimeWaitUntil(Now);
// Do whatever every 60 seconds, no mater how long this takes to run the interval will have a consistant
spacing
}

See also

OSChangeTaskDly(), OSTimeDly()

The documentation for this class was generated from the following file:

• nbrtos.h

21.63 UDPPacket Class Reference


UDP Packet Class.
#include <udp.h>

Public Member Functions


• UDPPacket (OS_FIFO ∗pFifo, uint32_t timeout)
Constructor to create a UDP Packet object from a UDP FIFO entry.
• UDPPacket (int sock)
Constructor to create a UDP Packet object from an open UDP socket.
• UDPPacket (PoolPtr p)
Constructor to create a UDP packet from a system pool buffer.
• UDPPacket (UDPPacket &pkt)
Constructor to create a new UDP packet from an existing UDP packet.
• ∼UDPPacket ()
UDP packet object destructor. Frees any associated memory.
• void SetSourcePort (uint16_t port)
Set the source port number of a UDP Packet object.
• uint16_t GetSourcePort (void) const
Get the source port number of a UDP Packet object.
• MACADR GetMacSource ()
Get the source MAC address a UDP Packet object.
• IPADDR GetSourceAddress (void)
Get the source IP address a UDP Packet object.
• IPADDR GetDestinationAddress (void)

NetBurner, Inc.
732 Class Documentation

Get the destination IP address a UDP Packet object.


• bool bIsIPV6 ()
Check if the IPADDR holds an IPv6 IP address.
• void SetDestinationPort (uint16_t port)
Set the destination port number of a UDP Packet object.
• uint16_t GetDestinationPort (void) const
Get the destination port number of a UDP Packet object.
• uint16_t GetPacketId (void)
Get UDP packet ID.
• puint8_t GetDataBuffer (bool bReAllocateIfNeeded=false)
Get a pointer to the UDP Packet object's data buffer.
• void SetDataSize (uint16_t numBytes)
Set the UDP Packet data size.
• uint16_t GetDataSize (void) const
Get the UDP Packet object data size.
• void AddData (puint8_t pData, uint16_t len)
Add a number of data bytes to a UDP Packet object.
• void AddData (PCSTR pData)
Add data to a UDP Packet object as a NULL terminated ASCII string.
• void AddDataWord (uint16_t w)
Add a 16-bit unsigned integer to a UDP Packet object.
• void AddDataByte (uint8_t b)
Add an 8-bit unsigned integer to a UDP Packet object.
• BOOL Validate (void)
Verify a received UDP packet is valid.
• void ResetData (void)
Set the data size of a UDP Packet object to 0.
• void SendAndKeep (const IPADDR &to, uint8_t ttl=0)
Make a copy of a UDP Packet and send it. The original packet will remain intact.
• void Send (const IPADDR &to, uint8_t ttl=0)
Send the UDP Packet and free the pool buffer.
• void SendAndKeepViaInterfaceNum (const IPADDR &to, int interface, uint8_t ttl=0)
Make a copy of a UDP Packet and send it using the specified network interface. The original packet will remain intact.
• void SendViaInterfaceNum (const IPADDR &to, int interface, uint8_t ttl=0)
Send the UDP Packet using the specified network interface and free the pool buffer.
• void SendAndKeepViaIfAddr (const IPADDR &to, const IPADDR &from_ip, uint8_t ttl=0)
Make a copy of a UDP Packet and send it through the network interface specified by the from_ip IP address parameter.
If more than one interface has the same IP address, the lower interface number will be used. The original packet will
remain intact.
• void SendViaIfAddr (const IPADDR &to, const IPADDR &from_ip, uint8_t ttl=0)
Send a UDP packet through the network interface specified by the from_ip IP address parameter. If more than one
interface has the same IP address, the lower interface number will be used. The UDP pool buffer will be freed.

21.63.1 Detailed Description


UDP Packet Class.
This class holds PoolBuffers and treats them as UDP Packets. The process for sending a UDP packet is as follows:
UDPPacket myUdpPacket; // Create a UDPPacket object
myUdpPacket.SetSourcePort(123); // Set the source port number
myUdpPacket.SetDestinatioPort(456); // Set destination port number
Data can be put in the packet two ways:

1. Obtain a pointer to the object's data buffer and copy the data in. Be certain to set the data length.
uint16_t len = siprintf( myUdpPacket.GetDataBuffer(), "Using sprintf() to copy data at time = %ld",
TickCount );
myUdpPacket.SetDataSize(len);

NetBurner, Inc.
21.63 UDPPacket Class Reference 733

2. Copy the data directly to the packet buffer:


AddData("This is the data to add"); // Add a constant ASCII null terminated string
AddData(pData, len); // Add with a pointer to the data and the data length

When the UDP packet has been configured it can be sent two ways:

1. Send and keep the packet and keep the constructed pool buffer: SendAndKeep(IPADDR destination←-
IP);. You must free the buffer manually.
2. Send and automatically free the pool buffer (recommended and more efficient): Send(IPADDR4
destinationIP);

There are many UDP examples, and we recommend reviewing them to determine the best method to use for your
application.

21.63.2 Constructor & Destructor Documentation

21.63.2.1 UDPPacket() [1/4]

UDPPacket::UDPPacket (
OS_FIFO ∗ pFifo,
uint32_t timeout )
Constructor to create a UDP Packet object from a UDP FIFO entry.
UDP packets are received in a OS_FIFO. This constructor create a UDP packet from the next entry in the FIFO,
which also removes the entry from the FIFO. If there is not a packet in the FIFO, this constructor will block until one
is available, or the specified timeout occurs. If a timeout occurs, an invalid UDP packet will be created. The UDP
Validate() function must always be called after this constructor to verify a valid UDP packet has been created.

Parameters

pFifo Pointer to an OS_FIFO object


timeout Timeout in system Time Ticks

See also

UDPPacket(int sock), UDPPacket( PoolPtr p )

21.63.2.2 UDPPacket() [2/4]

UDPPacket::UDPPacket (
int sock )
Constructor to create a UDP Packet object from an open UDP socket.
This constructor will block until a UDP packet is received. It is useful for situations such as a select() call that will
block on a UDP file descriptor until a packet is received. After the select() returns, this constructor can be used to
create the packet.

Parameters

sock Open UDP socket

NetBurner, Inc.
734 Class Documentation

See also

UDPPacket( OS_FIFO ∗pFifo, uint32_t timeout ), UDPPacket( PoolPtr p )

21.63.2.3 UDPPacket() [3/4]

UDPPacket::UDPPacket (
PoolPtr p )
Constructor to create a UDP packet from a system pool buffer.
This constructor can be used in unique situations in which an application is operating directly on the system pool
buffers. This is a rare situation.

Parameters

p Pointer to a pool buffer

See also

UDPPacket( OS_FIFO ∗pFifo, uint32_t timeout ), UDPPacket(int sock)

21.63.2.4 UDPPacket() [4/4]

UDPPacket::UDPPacket (
UDPPacket & pkt )
Constructor to create a new UDP packet from an existing UDP packet.
The UDP packet passed in the argument will be destroyed.

Parameters
pkt UDP packet object

See also

UDPPacket( OS_FIFO ∗pFifo, uint32_t timeout ), UDPPacket(int sock)

21.63.2.5 ∼UDPPacket()

UDPPacket::∼UDPPacket ( )
UDP packet object destructor. Frees any associated memory.

See also

UDPPacket( OS_FIFO ∗pFifo, uint32_t timeout ), UDPPacket(int sock), UDPPacket( PoolPtr p )

21.63.3 Member Function Documentation

21.63.3.1 AddData() [1/2]

void UDPPacket::AddData (
PCSTR pData )
Add data to a UDP Packet object as a NULL terminated ASCII string.

NetBurner, Inc.
21.63 UDPPacket Class Reference 735

Parameters
pData Pointer to the null terminated string

See also

AddDataByte(), AddDataWord()

21.63.3.2 AddData() [2/2]

void UDPPacket::AddData (
puint8_t pData,
uint16_t len )
Add a number of data bytes to a UDP Packet object.

Parameters
pData Pointer to the data to add
len Number of bytes

See also

AddDataByte(), AddDataWord()

21.63.3.3 AddDataByte()

void UDPPacket::AddDataByte (
uint8_t b )
Add an 8-bit unsigned integer to a UDP Packet object.

Parameters
b 8-bit unsigned integer

See also

AddDataWord(), AddData()

21.63.3.4 AddDataWord()

void UDPPacket::AddDataWord (
uint16_t w )
Add a 16-bit unsigned integer to a UDP Packet object.

Parameters
w 16 bit unsigned integer

See also

AddDataByte(), AddData()

NetBurner, Inc.
736 Class Documentation

21.63.3.5 bIsIPV6()

bool UDPPacket::bIsIPV6 ( ) [inline]


Check if the IPADDR holds an IPv6 IP address.
Returns

true if the IP address is an IPv6 address

21.63.3.6 GetDataBuffer()

puint8_t UDPPacket::GetDataBuffer (
bool bReAllocateIfNeeded = false )
Get a pointer to the UDP Packet object's data buffer.

Returns

Pointer to the data buffer

21.63.3.7 GetDataSize()

uint16_t UDPPacket::GetDataSize (
void ) const
Get the UDP Packet object data size.

Returns

The data size as number of bytes

See also

SetDataSize()

21.63.3.8 GetDestinationAddress()

IPADDR UDPPacket::GetDestinationAddress (
void ) [inline]
Get the destination IP address a UDP Packet object.

Returns

The destination IP address

21.63.3.9 GetDestinationPort()

uint16_t UDPPacket::GetDestinationPort (
void ) const
Get the destination port number of a UDP Packet object.

Returns

The destination port number

See also

SetDestinationPort()

NetBurner, Inc.
21.63 UDPPacket Class Reference 737

21.63.3.10 GetMacSource()

MACADR UDPPacket::GetMacSource ( )
Get the source MAC address a UDP Packet object.

Returns

The source MAC address

21.63.3.11 GetPacketId()

uint16_t UDPPacket::GetPacketId (
void )
Get UDP packet ID.

Returns

The UDP packet ID

21.63.3.12 GetSourceAddress()

IPADDR UDPPacket::GetSourceAddress (
void ) [inline]
Get the source IP address a UDP Packet object.

Returns

The source IP address

21.63.3.13 GetSourcePort()

uint16_t UDPPacket::GetSourcePort (
void ) const
Get the source port number of a UDP Packet object.

Returns

The source port number

See also

SetSourcePort()

21.63.3.14 Send()

void UDPPacket::Send (
const IPADDR & to,
uint8_t ttl = 0 ) [inline]
Send the UDP Packet and free the pool buffer.

Parameters
to Destination IP address
ttl Optional. If not specified the system default will be used

NetBurner, Inc.
738 Class Documentation

See also

SendAndKeep(), SendViaInterfaceNum(), SendViaIfAddr()

21.63.3.15 SendAndKeep()

void UDPPacket::SendAndKeep (
const IPADDR & to,
uint8_t ttl = 0 ) [inline]
Make a copy of a UDP Packet and send it. The original packet will remain intact.

Parameters
to Destination IP address
ttl Optional. If not specified the system default will be used

See also

Send(), SendViaInterfaceNum(), SendAndKeepViaIfAddr()

21.63.3.16 SendAndKeepViaIfAddr()

void UDPPacket::SendAndKeepViaIfAddr (
const IPADDR & to,
const IPADDR & from_ip,
uint8_t ttl = 0 ) [inline]
Make a copy of a UDP Packet and send it through the network interface specified by the from_ip IP address
parameter. If more than one interface has the same IP address, the lower interface number will be used. The
original packet will remain intact.

Parameters
to Destination IP address
from←- IP address to identify the local network interface as the source
_ip
ttl Optional. If not specified the system default will be used

See also

Send(), SendViaInterfaceNum()

21.63.3.17 SendAndKeepViaInterfaceNum()

void UDPPacket::SendAndKeepViaInterfaceNum (
const IPADDR & to,
int interface,
uint8_t ttl = 0 ) [inline]
Make a copy of a UDP Packet and send it using the specified network interface. The original packet will remain
intact.

Parameters
to Destination IP address
interface Interface number

NetBurner, Inc.
21.63 UDPPacket Class Reference 739

Parameters

ttl Optional. If not specified the system default will be used

See also

Send(), SendAndKeep(), SendViaInterfaceNum(), SendAndKeepViaIfAddr()

21.63.3.18 SendViaIfAddr()

void UDPPacket::SendViaIfAddr (
const IPADDR & to,
const IPADDR & from_ip,
uint8_t ttl = 0 ) [inline]
Send a UDP packet through the network interface specified by the from_ip IP address parameter. If more than one
interface has the same IP address, the lower interface number will be used. The UDP pool buffer will be freed.

Parameters
to Destination IP address
from←- IP address to identify the local network interface as the source
_ip
ttl Optional. If not specified the system default will be used

See also

Send(), SendAndKeep(), SendAndKeepViaIfAddr()

21.63.3.19 SendViaInterfaceNum()

void UDPPacket::SendViaInterfaceNum (
const IPADDR & to,
int interface,
uint8_t ttl = 0 ) [inline]
Send the UDP Packet using the specified network interface and free the pool buffer.

Parameters
to Destination IP address
interface Interface number
ttl Optional. If not specified the system default will be used

See also

Send(), SendAndKeep(), SendAndKeepViaIfAddr()

21.63.3.20 SetDataSize()

void UDPPacket::SetDataSize (
uint16_t numBytes )
Set the UDP Packet data size.

NetBurner, Inc.
740 Class Documentation

Parameters

numBytes Data size as number of bytes

See also

GetDataSize()

21.63.3.21 SetDestinationPort()

void UDPPacket::SetDestinationPort (
uint16_t port )
Set the destination port number of a UDP Packet object.

Parameters
port Destination port number

See also

GetDestinationPort()

21.63.3.22 SetSourcePort()

void UDPPacket::SetSourcePort (
uint16_t port )
Set the source port number of a UDP Packet object.

Parameters

port Source port number

See also

GetSourcePort()

21.63.3.23 Validate()

BOOL UDPPacket::Validate (
void )
Verify a received UDP packet is valid.
Verifies a received UDP packet has data and validates the checksum. This function should be called anytime a UDP
packet is received.

Returns

true if packet is valid, otherwise false

The documentation for this class was generated from the following files:

• udp.h
• ipv6_udp.cpp
• udp.cpp
• udpsocket.cpp

NetBurner, Inc.
21.64 UserAuthManager Class Reference 741

21.64 UserAuthManager Class Reference


The user authorization manager class allows application developers the ability to manage user authorization
records. The can be loaded and saved to any storage space, including the config system or UserParams. Au-
thorization values are hashed before being saved. Validation compares both the hash as well as the authorization
type. Adding, updating, and removing records will automatically call the user devined save functions. For usage,
please see the example found in examples/SSH/sshServerUserAuth.
#include <UserAuthManager.h>

Public Member Functions


• UserAuthManager ()
Default constructor.
• ∼UserAuthManager ()
Default destructor.
• bool Init (SaveAuthRecordsFn svRcFn, LoadAuthRecordsFn ldRcFn)
Initialization function. Must be called before use.
• bool UserExists (const NBString &userName)
Determines if a user record exists.
• AuthResponse AddUserAuth (const NBString &userName, const NBString &auth, AuthType authType)
Attempts to add a user authorization record. This will automatically call the save record function if the user is added.
• AuthResponse CheckUserAuth (const NBString &userName, const NBString &auth, AuthType authType)
Checks the for a user and compares the authorization value to what is stored.
• AuthResponse CheckUserAuth (const NBString &userName, byte ∗auth, AuthType authType)
Checks the for a user and compares the authorization value to what is stored.
• AuthResponse UpdateUserAuth (const NBString &userName, const NBString &newAuth, AuthType auth←-
Type)
Updates a user authorization record with the information provided. This function will automatically save all user
records if the changes are successful.
• AuthResponse RemoveUserAuth (const NBString &userName)
Remove a user authorization record. This function will automatically save all user records if the removal is successful.
• AuthResponse CheckUserAuthLevel (const NBString &userName, uint32_t authLevel, bool hasAll=true)
Checks the user against the specific authLevel.
• AuthResponse SetUserAuthLevel (const NBString &userName, uint32_t authLevel)
This adds the authorization levels passed in to the user's current authorization level.
• AuthResponse ClrUserAuthLevel (const NBString &userName, uint32_t authLevel)
Clears the authorization for the specified user.
• void ListUsers ()
Lists the users currently in the User Authorization Record system, along with their saved authorization type and level.
• int GetMaxAuthRecords ()
Gets the maximum number of authorization records available to the system. This can be changed with the macro
MAX_AUTH_RECORDS.

21.64.1 Detailed Description


The user authorization manager class allows application developers the ability to manage user authorization
records. The can be loaded and saved to any storage space, including the config system or UserParams. Au-
thorization values are hashed before being saved. Validation compares both the hash as well as the authorization
type. Adding, updating, and removing records will automatically call the user devined save functions. For usage,
please see the example found in examples/SSH/sshServerUserAuth.

21.64.2 Member Function Documentation

NetBurner, Inc.
742 Class Documentation

21.64.2.1 AddUserAuth()

AuthResponse UserAuthManager::AddUserAuth (
const NBString & userName,
const NBString & auth,
AuthType authType )
Attempts to add a user authorization record. This will automatically call the save record function if the user is added.

Parameters
userName The username to add.
auth The authorization value to hash and store.
authType The authorization type of the authorization value.

Return values

eAuthSuccess If the user was successfully added.


!eAuthSuccess If the user was not added successfully. The AuthResponse error code returned will indicate why.

21.64.2.2 CheckUserAuth() [1/2]

AuthResponse UserAuthManager::CheckUserAuth (
const NBString & userName,
byte ∗ auth,
AuthType authType )
Checks the for a user and compares the authorization value to what is stored.

Parameters
userName The username to check against.
auth The authorization value to compare as hashed value. This will be compared directly to what is
stored in the record.
authType The authorization type of the authorization value.

Return values

eAuthSuccess If the user exists and the authorization value matches what was stored
!eAuthSuccess If the user does not exist or the authorization comparison fails. The AuthResponse error code
returned will indicate why.

21.64.2.3 CheckUserAuth() [2/2]

AuthResponse UserAuthManager::CheckUserAuth (
const NBString & userName,
const NBString & auth,
AuthType authType )
Checks the for a user and compares the authorization value to what is stored.

Parameters
userName The username to check against.

NetBurner, Inc.
21.64 UserAuthManager Class Reference 743

Parameters

auth The authorization value to compare as a plain string. This value will be hashed before getting
compared.
authType The authorization type of the authorization value.

Return values

eAuthSuccess If the user exists and the authorization value matches what was stored
!eAuthSuccess If the user does not exist or the authorization comparison fails. The AuthResponse error code
returned will indicate why.

21.64.2.4 CheckUserAuthLevel()

AuthResponse UserAuthManager::CheckUserAuthLevel (
const NBString & userName,
uint32_t authLevel,
bool hasAll = true )
Checks the user against the specific authLevel.

Parameters
userName The username to check.
authLevel The authorization level to check against. This check compares the bits passed in against the bits
set on the user's authLevel.
hasAll Used to establish the conditions for the check to pass. If hasAll is true, then every bit passed in
must be set on the user's authLevel for the check to pass. If hasAll is false, then only one bit
needs to match for the check to pass.

Return values

eAuthSuccess If the check passed and the user has the proper authorization level.
!eAuthSuccess If the user does not have the proper authorization level.

21.64.2.5 ClrUserAuthLevel()

AuthResponse UserAuthManager::ClrUserAuthLevel (
const NBString & userName,
uint32_t authLevel )
Clears the authorization for the specified user.

Parameters
userName The username to check.
authLevel The authorization level to clear.

Return values

eAuthSuccess If the specified authorization level was successfully cleared and saved.

NetBurner, Inc.
744 Class Documentation

Return values

!eAuthSuccess If the authorization level could not be cleared and saved. The AuthResponse error code
returned will indicate why.

21.64.2.6 Init()

bool UserAuthManager::Init (
SaveAuthRecordsFn svRcFn,
LoadAuthRecordsFn ldRcFn )
Initialization function. Must be called before use.

Parameters

svRcFn The user defined function that will save authorization records.
ldRcFn The user defined function that will load the authorization records from storage. Called inside init().

Return values

true If successfully initialzed, and the users are properly loaded.


!0 If there was an error initializing the object, or the users were not successfully loaded. Error code will

21.64.2.7 RemoveUserAuth()

AuthResponse UserAuthManager::RemoveUserAuth (
const NBString & userName )
Remove a user authorization record. This function will automatically save all user records if the removal is success-
ful.

Parameters
userName The username to remove.

Return values

eAuthSuccess If the user record was successfully removed.


!eAuthSuccess If the user record could not be removed. The AuthResponse error code returned will indicate
why.

21.64.2.8 SetUserAuthLevel()

AuthResponse UserAuthManager::SetUserAuthLevel (
const NBString & userName,
uint32_t authLevel )
This adds the authorization levels passed in to the user's current authorization level.

Parameters
userName The username to check.

NetBurner, Inc.
21.64 UserAuthManager Class Reference 745

Parameters
authLevel The authorization level to check against. This check compares the bits passed in against the bits
set on the user's authLevel.

Return values

eAuthSuccess If the the user authorization level was properly set and saved.
!eAuthSuccess If the user's authorization level could not be set and saved. The AuthResponse error code
returned will indicate why.

21.64.2.9 UpdateUserAuth()

AuthResponse UserAuthManager::UpdateUserAuth (
const NBString & userName,
const NBString & newAuth,
AuthType authType )
Updates a user authorization record with the information provided. This function will automatically save all user
records if the changes are successful.

Parameters
userName The username to check against.
newAuth The new authorization value to assign to the user.
authType The authorization type of the authorization value.

Return values

eAuthSuccess If the user record was successfully updated.


!eAuthSuccess If the user record could not be updated. The AuthResponse error code returned will indicate why.

21.64.2.10 UserExists()

bool UserAuthManager::UserExists (
const NBString & userName )
Determines if a user record exists.

Parameters
userName The username to check.

Return values

true If the user exists.


false If the user does not exist.

The documentation for this class was generated from the following file:

• UserAuthManager.h

NetBurner, Inc.
746 Class Documentation

21.65 UserAuthRecord Struct Reference


A stored record of a user's authorization credentials. The value is hashed when saved so it can't be read directly.
User's can currently only have one authorization record per user name.
#include <UserAuthManager.h>

Public Attributes
• NBString m_userName
The username for the record. This value must be unique across all records.
• uint8_t m_authHash [WC_SHA256_DIGEST_SIZE]
The hashed representation of the authentication value.
• AuthType m_authType
The type of authentication hashes. Currently supported are keys and passwords.
• uint32_t m_authLevel

21.65.1 Detailed Description


A stored record of a user's authorization credentials. The value is hashed when saved so it can't be read directly.
User's can currently only have one authorization record per user name.

21.65.2 Member Data Documentation

21.65.2.1 m_authLevel

uint32_t UserAuthRecord::m_authLevel
The authorization level granted to this user. This is treated as a bit field, and authorization checks look for specific
bits being set.
The documentation for this struct was generated from the following file:

• UserAuthManager.h

21.66 wifi_init Struct Reference


#include <wifiDriver.h>

21.66.1 Detailed Description


This structure is used as a WiFi initialization structure for defining pins, IRQ, and type of WiFi module being used
with a specific bus type. the GetDriver function pointer must be defined to one of the supported WiFi module
option's static driver function. The options are GetNewWicedSPIDriver(), GetNewWicedSerialDriver(), or GetNew←-
WilcDriver(). Default WiFiInit structures are defined using macros for each of the NBWIFI development kit options.
If the user is using pin/IRQ settings that differ from the default values, the user must either define their own wifiInit
structure in their project or pass in the custom values to the WiFi initialization functions as parameters.
The documentation for this struct was generated from the following file:

• wifiDriver.h

21.67 WireIntf Class Reference


Wire Interface Class for I2C.
#include <i2c.h>

NetBurner, Inc.
21.67 WireIntf Class Reference 747

Public Member Functions


• void begin ()
Initialize the WireIntf driver object as a master with a bus speed of 100 kHz. This normally only needs to be called
once.
• uint32_t requestFrom (uint8_t addr, uint32_t len, bool stop=true)
Request a number of bytes from a slave device. The bytes can then be retrieved from the slave device with the read()
and available() functions.
• void beginTransmission (uint8_t addr)
Begin a transmission to a I2C slave device at the provided address. Bytes can be queued for transmission with the
write() functions, and are transmitted by calling endTransmission().
• void endTransmission (bool stop=true)
Transmits the bytes of data queued by using the write() functions, and ends a transmission to a slave device that was
started using beginTransmission().
• uint32_t write (uint8_t dat)
Queues bytes of data to be transmitted to the slave device. This function can be called after a call to
beginTransmission(). The data will not be transmitted on the I2C bus until a call to endTransmission() or flush()
is performed.
• uint32_t write (char ∗str)
Queues bytes of data to be transmitted to the slave device. This function can be called after a call to
beginTransmission(). The data will not be transmitted on the I2C bus until a call to endTransmission() or flush()
is performed.
• uint32_t write (uint8_t ∗buf, uint32_t len)
Queues bytes of data to be transmitted to the slave device. This function can be called after a call to
beginTransmission(). The data will not be transmitted on the I2C bus until a call to endTransmission() or flush()
is performed.
• uint32_t available ()
Get the number of bytes available to be read from the slave device with read(). This function can be called after a call
to requestFrom().
• uint8_t read ()
Reads a byte of data that was transmitted from a slave I2C device after a call to requestFrom().
• void flush (bool bIssueStop=false)
Force the data that were queued to be transmitted using the write() functions to be transmitted on the I2C bus.

21.67.1 Detailed Description


Wire Interface Class for I2C.
For I2C communication, you can choose the WireIntf class, or the I2C class. The WireIntf class is simpler to use,
while the I2C class provides more low level control.
Note that the system automatically instantiates I2C and WireIntf objects for each of the I2C peripheral modules. The
WireIntf objects can be accessed with: Wire, Wire1 and Wire2. The I2C objects can be accesses with I2C[0], I2C[1]
and I2C[2].

21.67.2 Member Function Documentation

21.67.2.1 available()

uint32_t WireIntf::available ( )
Get the number of bytes available to be read from the slave device with read(). This function can be called after a
call to requestFrom().

Returns

The number of bytes available for reading from the slave device.

NetBurner, Inc.
748 Class Documentation

21.67.2.2 beginTransmission()

void WireIntf::beginTransmission (
uint8_t addr )
Begin a transmission to a I2C slave device at the provided address. Bytes can be queued for transmission with the
write() functions, and are transmitted by calling endTransmission().

Parameters

addr the address of the device to transmit data to.

21.67.2.3 endTransmission()

void WireIntf::endTransmission (
bool stop = true )
Transmits the bytes of data queued by using the write() functions, and ends a transmission to a slave device that
was started using beginTransmission().

Parameters

stop If true, sends a stop message after the request, releasing the I2C bus. If false, the driver will send a
restart request, keeping the connection alive. This prevents other I2C master devices from transmitting
between messages. This allows one master to transmit multiple transmissions uninterrupted.

21.67.2.4 flush()

void WireIntf::flush (
bool bIssueStop = false )
Force the data that were queued to be transmitted using the write() functions to be transmitted on the I2C bus.
If you need to know exactly when a transaction will occur, call flush(). If accessing a register, be sure to write all
address bytes before the call.

Parameters

bIssueStop If true, sends a stop message after the request, releasing the I2C bus. If false, the driver will
send a restart request, keeping the connection alive. This prevents other I2C master devices
from transmitting between messages. This allows one master to transmit multiple transmissions
uninterrupted.

21.67.2.5 read()

uint8_t WireIntf::read ( )
Reads a byte of data that was transmitted from a slave I2C device after a call to requestFrom().

Returns

The byte of data received from the slave I2C device.

21.67.2.6 requestFrom()

uint32_t WireIntf::requestFrom (
uint8_t addr,

NetBurner, Inc.
21.67 WireIntf Class Reference 749

uint32_t len,
bool stop = true )
Request a number of bytes from a slave device. The bytes can then be retrieved from the slave device with the
read() and available() functions.

Parameters

addr the address of the slave to request data from.


len the number of bytes to request from the slave.
stop If true, sends a stop message after the request, releasing the I2C bus. If false, the driver will send a
restart request, keeping the connection alive. This prevents other I2C master devices from transmitting
between messages. This allows one master to transmit multiple transmissions uninterrupted.

Returns

The number of bytes returned from the slave I2C device.

21.67.2.7 write() [1/3]

uint32_t WireIntf::write (
char ∗ str )
Queues bytes of data to be transmitted to the slave device. This function can be called after a call to
beginTransmission(). The data will not be transmitted on the I2C bus until a call to endTransmission() or flush()
is performed.

Parameters

str A string to send as a series of bytes to the I2C slave device.

Returns

The number of of bytes written to the transmit queue buffer.

21.67.2.8 write() [2/3]

uint32_t WireIntf::write (
uint8_t ∗ buf,
uint32_t len )
Queues bytes of data to be transmitted to the slave device. This function can be called after a call to
beginTransmission(). The data will not be transmitted on the I2C bus until a call to endTransmission() or flush()
is performed.

Parameters

buf An array of data to send as bytes to the I2C slave device.


len The number of bytes to be written from the buf parameter.

NetBurner, Inc.
750 Class Documentation

Returns

The number of of bytes written to the transmit queue buffer.

21.67.2.9 write() [3/3]

uint32_t WireIntf::write (
uint8_t dat )
Queues bytes of data to be transmitted to the slave device. This function can be called after a call to
beginTransmission(). The data will not be transmitted on the I2C bus until a call to endTransmission() or flush()
is performed.

Parameters

dat A byte of data to be transmitted to the I2C slave device.

Returns

The number of of bytes written to the transmit queue buffer.

The documentation for this class was generated from the following file:

• i2c.h

21.68 WM8904 Class Reference


#include <wm8904.h>

Public Member Functions


• WM8904 (I2C &module)
The constructor for the WM8904 context.
• void Init (const cfg_t &cfg, const SSC_cfg_t &ssc_cfg)
Configures and initializes both the driver and the codec.
• void Shutdown ()
Shuts down the WM8904 codec driver.
• void WriteReg (Reg::RegAddr_t reg, uint16_t dat)
Write a register on the WM8904.
• uint16_t ReadReg (Reg::RegAddr_t reg)
Read a register on the WM8904.
• void SendCmd (Reg::cmd_t cmd)
Execute codec Command. A command is: a register to write, a value to write, and a delay of time required for
command execution.
• void SendCmdList (Reg::cmd_t ∗cmds, uint32_t len)
Execute an array of codec Commands. A command is: a register to write, a value to write, and a delay of time
required for command execution.
• void UpdateCmd (Reg::cmd_t cmd, uint16_t updateMask)
Execute a codec Command to update a register. A command is: a register to write, a value to write, and a delay of
time required for command execution.
• void SetVolume (AudioOutSelect_t out, AudioChSelect_t channel, uint8_t volume)
Set the volume of the selected audio output and channel.
• uint8_t GetVolume (AudioOutSelect_t out, AudioChSelect_t channel)
Get the volume of the selected audio output and channel.
• void Mute (AudioOutSelect_t out, AudioChSelect_t channel, bool mute)

NetBurner, Inc.
21.68 WM8904 Class Reference 751

Mute or unmute the selected audio output and channel.


• void SetMicGain (AudioChSelect_t channel, uint8_t gain)
Set the microphone gain of the selected input channel.
• uint8_t GetMicGain (AudioChSelect_t channel)
Get the microphone gain of the selected input channel.
• void MuteMic (AudioChSelect_t channel, bool mute)
Mute or unmute the selected input channel.
• int TransmitBuffer (void ∗buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be transmitted to the codec.
• int ReadyReceiveBuffer (void ∗buffer, uint32_t bufferLen, bool waitIfNeeded)
Hands off a buffer to be written to by the codec.
• void RegisterTxBufferDoneCB (SSC_BufferDoneFn_t cb)
Registers a callback for when a transmit buffer is finished.
• void RegisterRxBufferDoneCB (SSC_BufferDoneFn_t cb)
Registers a callback for when a receive buffer is finished.

21.68.1 Detailed Description


WM8904 is a driver for the WM8904 Audio Codec.

21.68.2 Constructor & Destructor Documentation

21.68.2.1 WM8904()

WM8904::WM8904 (
I2C & module )
The constructor for the WM8904 context.

Parameters

module A reference to the I2C module to be used for configuring the codec.

21.68.3 Member Function Documentation

21.68.3.1 GetMicGain()

uint8_t WM8904::GetMicGain (
AudioChSelect_t channel )
Get the microphone gain of the selected input channel.

Parameters

channel Input Channel to select.

NetBurner, Inc.
752 Class Documentation

Returns

Gain the channel is set to.

21.68.3.2 GetVolume()

uint8_t WM8904::GetVolume (
AudioOutSelect_t out,
AudioChSelect_t channel )
Get the volume of the selected audio output and channel.

Parameters

out Audio Output to select.


channel Output Channel to select.

Returns

Volume the channel is set to.

21.68.3.3 Init()

void WM8904::Init (
const cfg_t & cfg,
const SSC_cfg_t & ssc_cfg )
Configures and initializes both the driver and the codec.

Parameters

cfg The driver configuration to use.


ssc_cfg The SSC driver configuration to use.

21.68.3.4 Mute()

void WM8904::Mute (
AudioOutSelect_t out,
AudioChSelect_t channel,
bool mute )
Mute or unmute the selected audio output and channel.

Parameters

out Audio Output to select.


channel Output Channel to select.
mute Whether the channel is to be muted.

21.68.3.5 MuteMic()

void WM8904::MuteMic (
AudioChSelect_t channel,

NetBurner, Inc.
21.68 WM8904 Class Reference 753

bool mute )
Mute or unmute the selected input channel.

Parameters

channel Input Channel to select.


mute Whether the channel is to be muted.

21.68.3.6 ReadReg()

uint16_t WM8904::ReadReg (
Reg::RegAddr_t reg )
Read a register on the WM8904.

Parameters
reg Register to write.

Returns

Data read.

21.68.3.7 ReadyReceiveBuffer()

int WM8904::ReadyReceiveBuffer (
void ∗ buffer,
uint32_t bufferLen,
bool waitIfNeeded )
Hands off a buffer to be written to by the codec.

Parameters

buffer A pointer to the buffer to be written to.


bufferLen The length of the buffer to be written. (Must be multiples of 1, 2, or 4 bytes depending on word
bit width)
waitIfNeeded Whether the driver should wait for space to receive or fail immediately upon exhausting the
queue depth.

Returns

Negative on failure.

21.68.3.8 SendCmd()

void WM8904::SendCmd (
Reg::cmd_t cmd )
Execute codec Command. A command is: a register to write, a value to write, and a delay of time required for
command execution.

Parameters

cmd Command to execute

NetBurner, Inc.
754 Class Documentation

21.68.3.9 SendCmdList()

void WM8904::SendCmdList (
Reg::cmd_t ∗ cmds,
uint32_t len )
Execute an array of codec Commands. A command is: a register to write, a value to write, and a delay of time
required for command execution.

Parameters

cmds Commands to execute


len Number of commands to execute.

21.68.3.10 SetMicGain()

void WM8904::SetMicGain (
WM8904::AudioChSelect_t channel,
uint8_t gain )
Set the microphone gain of the selected input channel.

Parameters

channel Input Channel to select.


gain Gain to set channel to.

21.68.3.11 SetVolume()

void WM8904::SetVolume (
WM8904::AudioOutSelect_t out,
WM8904::AudioChSelect_t channel,
uint8_t volume )
Set the volume of the selected audio output and channel.

Parameters

out Audio Output to select.


channel Output Channel to select.
volume Volume to set channel to.

21.68.3.12 TransmitBuffer()

int WM8904::TransmitBuffer (
void ∗ buffer,
uint32_t bufferLen,
bool waitIfNeeded )
Hands off a buffer to be transmitted to the codec.

Parameters

buffer A pointer to the buffer to be transmit.

NetBurner, Inc.
21.68 WM8904 Class Reference 755

Parameters

bufferLen The length of the buffer to be transmit. (Must be multiples of 1, 2, or 4 bytes depending on word
bit width)
waitIfNeeded Whether the driver should wait for space to transmit or fail immediately upon exhausting the
queue depth.

Returns

Negative on failure.

21.68.3.13 UpdateCmd()

void WM8904::UpdateCmd (
Reg::cmd_t cmd,
uint16_t updateMask )
Execute a codec Command to update a register. A command is: a register to write, a value to write, and a delay of
time required for command execution.

Parameters

cmd Command to execute


updateMask A Positive bit mask of bits to update in the target register

21.68.3.14 WriteReg()

void WM8904::WriteReg (
Reg::RegAddr_t reg,
uint16_t dat )
Write a register on the WM8904.

Parameters
reg Register to write.
dat Data to write.

The documentation for this class was generated from the following files:

• wm8904.h
• wm8904.cpp

NetBurner, Inc.
756 Class Documentation

NetBurner, Inc.
Chapter 22

File Documentation

22.1 multican.h File Reference


ColdFire MCF5441x Control Area Network (CAN)

Classes
• class canMCF5441x::CanRxMessage
Class to hold received CAN messages.

Namespaces
• namespace canMCF5441x
canMCF5441x namespace

22.1.1 Detailed Description


ColdFire MCF5441x Control Area Network (CAN)

22.2 multican.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
12 #ifndef _MULTICAN_H
13 #define _MULTICAN_H
14
15 #ifdef DOXYGEN_STUFF
19 namespace canMCF5441x
20 {
21 #endif
22
33 #if (defined MOD5441X)
34 #define DEFAULT_CAN_MOD (0)
35 #elif (defined NANO54415)
36 #define DEFAULT_CAN_MOD (1)
37 #elif (defined SB800EX)
38 #define DEFAULT_CAN_MOD (0)
39 #endif
40
41 #define CAN_OK (0)
42 #define CAN_RATE_FAIL (-1)
43 #define CAN_ALREAD_OPEN (-2)
44 #define CAN_CHANNEL_USED (-3)
45 #define CAN_CHANNEL_NOT_USED (-4)
46 #define CAN_TIMEOUT (-5)
47
48 #define DONT_WAIT (0xFFFF)
49
50 struct PrivateCanData;
51
55 class CanRxMessage

NetBurner, Inc.
758 File Documentation

56 {
57 private:
58 PrivateCanData *pData;
59 /* Private constructor used for received frames */
60 CanRxMessage(PrivateCanData *pData);
61
62 /* Helper method for the RTR constructors */
63 void MultiCanSendRTR(int moduleNum, uint32_t id, uint16_t timeout, uint8_t length);
64
65 inline void CanSendRTR(uint32_t id, uint16_t timeout, uint8_t length) { return
MultiCanSendRTR(DEFAULT_CAN_MOD, id, timeout, length); }
66
67 public:
71 uint8_t GetLength();
72
81 uint8_t GetData(uint8_t *buffer, uint8_t max_len);
82
86 uint32_t GetId();
87
91 uint16_t GetTimeStamp();
92
99 BOOL IsValid();
100
101 /* Constructors */
102
113 CanRxMessage(OS_FIFO *pFifo, uint16_t timeout);
114
127 CanRxMessage(int moduleNum, uint32_t id, uint16_t timeout);
128
129 CanRxMessage(int moduleNum, uint32_t id, uint16_t timeout, uint8_t length);
130
134 ~CanRxMessage();
135
144 BOOL GetNewMessage(OS_FIFO *pFifo, uint16_t timeout);
145 };
146
147 /**********************************************************************************
148
149 A special note about CAN identifiers
150
151 **********************************************************************************
152 Can identifiers come in two flavors, Normal (11 bits ) and Extended. (29 bits)
153 In this software API we always refer to can identifiers as 32 bit uint32_tS.
154 A 32 bit uint32_t is bigger than either Identifier.
155
156 A Normal identifier will always have bits 0 to 17 as zero
157
158 An extended identifier can have bits 0 to 17 low. So extended identifiers
159 that are received will have bit 29 set to 1. Any ID input into the
160 system will be treated as extended if bit 29 is set or if bits
161 0 to 17 are not zero.
162
163 The following MACROS can help work with this ID scheme.
164 */
165
166 /* The single bit used by this API to indicate an extended ID */
167 #define CAN_EXTENDED_ID_BIT (0x20000000)
168
169 /* This macro takes and id and returs an ID that is guarenteed
170 to be treated as an extended ID by the system
171 Make an id that is extended from either extended or normal */
172 #define ExtToNbId(id) (id | CAN_EXTENDED_ID_BIT)
173
174 /*Make Normal Id make an ID set from a normal id in the range 0 to 2048 */
175 #define NormToNbId(id) ((id & 0x7ff) « 18)
176
177 /* Is the ID extended ? returns non zero if the id passed in was an extended ID */
178 #define IsNBIdExt(id) ((id & (CAN_EXTENDED_ID_BIT | 0x3FFFF)) != 0)
179
180 /* Strip the extra flag remove the API extended flage from the ID*/
181 #define NbToExtId(id) (id & 0x1FFFFFFF)
182
183 /* Shift a Normal ID so it hase value 0 to 1023
184 Some CAN systems will treat normal ID’s as an integer from 0 to 2048
185 Other systems may treat normal ID’s as 28 bit values wheer the bottom 17 bits are zero
186 This MACRO will convert our Normal ID format into the 0 to 2048 format.*/
187 #define NbToNormId(id) ((id » 18) & 0x7FF)
188
189 /* Initialize the CAN system
190 parameters:
191
192 bit_rate is the bitrate to run the CAN system at.
193 The system will get as close as possible, but 1000000, 500000, 250000 and 125000 are
194 the only values that are known to work.
195
196 Global_Mask is the mask used to mask received ID’s a bit =0 is don’t care, 1= care.
197

NetBurner, Inc.
22.2 multican.h 759

198 irq_level The interrupt level you want the CAN system to operate at.
199
200 Returns
201 CAN_OK on success.
202 CAN_RATE_FAIL if the bit rate could not be set withing 1.5%
203 CAN_ALREADOPEN if the CAN system is already running. Youmust call CanShutDown first.
204 */
205 int MultiCanInit(int moduleNum, uint32_t bit_rate, uint32_t Global_Mask, uint8_t irq_level = 4);
206
207 /* Shut down the CAN system */
208 void MultiCanShutDown(int moduleNum);
209
210 /* Change the global receive mask after the CAN system is started. */
211 void MultiCanChangeGlobalMask(int moduleNum, uint32_t Global_Mask);
212
213 /* The CAN system has 16 availible channels this tells how many are currently in use */
214 int MultiCanFreeCanChannels(int moduleNum);
215
216 /* This tells if a specific channel is currently free */
217 BOOL MultiCanIsChannelFree(int moduleNum, int channel);
218
219 /* RegisterCanRxFifo and RegisterCanSpecialRxFifo
220 Tell the CAN system to start listening for a specific CAN ID.
221 Any incoming CAN frames that match the id as set by the apropriate mask will
222 be placed into the fifo.
223
224 Parameters:
225 uint32_t id The identifer to match on received frames. This is modified by
226 the global mask, or in the case of the RegisterCanSpecial
227 the passed in mask.
228
229 uint32_t spl_mask Only used by RegisterCanSpecialRxFifo. There are only
230 two channels availible for use with the speical mask
231 so use this call sparinging and only if really needed.
232
233 OSFifo * pFifo The Fifo used to communicate between the CAN subsystem and
234 the CanRxMessageClass. This FIFO must be initialized before use.
235 The same fifo can be passed to multiple receive regestration functions.
236
237 int channel The Channel to place the receive request. A value of -1 allows the system to
238 select an unused channel.
239
240
241 Returns
242 Any value >=0 the channel this request is assigned to. This value must be stored to
243 later call UnRegisterCanFifo.
244 CAN_CHANNEL_USED If the channel is used or there are no free channels.
245
246 */
247 int RegisterMultiCanRxFifo(int moduleNum, uint32_t id, OS_FIFO *pFifo, int channel = -1);
248 int RegisterMultiCanSpecialRxFifo(int moduleNum, uint32_t id, uint32_t spl_mask, OS_FIFO *pFifo, int
channel = -1);
249
250 /* disconnect a receiver channel form a Fifo
251 Parameters:
252 int channel The channel to remove.
253
254 returns
255 CAN_OK if succesful.
256 CAN_CHANNEL_NOT_USED if the channel was not currently in use
257 */
258 int UnRegisterMultiCanFifo(int moduleNum, int channel);
259
260 /* Send a message
261 Parameters:
262 uint32_t id The Identifier to send. See the earlier discussion of identifiers.
263 and the identifier macros.
264
265 uint8_t * data A pointer to the data to send
266
267 uint8_t len The length of the Data must be <=8.
268
269 uint16_t timeout How lont to wait for confirmation it sent.
270 0 = wait forevver.
271 0xFFFF = don’t wait at all.
272
273 int channel The channel to use. A value of -1
274 will allow the system to pick and unused channel.
275
276 Returns
277 CAN_OK If the message was sent
278 CAN_CHANNEL_USED Can’t send because the channel was already in use or no channels availible.
279 CAN_TIMEOUT Did not send in the time alotted
280 */
281 int MultiCanSendMessage(int moduleNum, uint32_t id, uint8_t *data, uint8_t len, uint16_t timeout, int
channel = -1);
282

NetBurner, Inc.
760 File Documentation

283 /*RTR messages


284 Can can be configured to send messages in response to memessage requests.
285 The next three functions handle that functionality */
286
287 /* Set RTRMessage
288 This sets up a message to be sent in response to an incoming message that matches the
289 RTR message id. The system will continue to respond with this message forever.
290
291 Parameters:
292 uint32_t id. The id to respond to and the id responded with.
293 uint8_t * data The data to respond with
294 uint8_t len The length of the responding data.
295 int channel The channel to use, or -1 to let the system pic one.
296
297 Returns:
298 value >0 the channel assigned to this tsk or the channel requested.
299 CAN_CHANNEL_USED if the channel is already used or no free channels are availible.
300 */
301 int MultiCanSetRTRMessage(int moduleNum, uint32_t id, uint8_t *data, uint8_t len, int channel = -1);
302
303 /*ReplaceRTRMessage
304 Replace the outgoing message in an RTR channel already set up
305 with a call to SetRTRMessage. Use of this function can
306 cause a brief instant (a few uSec.) when no message response would be sent
307 to an incoming request. If this is unacceptible register two identical RTR
308 messages and change them in sequence.
309
310
311 Parameters:
312 int channel The channel value returned from the SetRTRMessage call
313 uint8_t * data the data to send.
314 uint8_t len the length of the data.
315
316
317 Returns
318 CAN_OK if the replacement succeded.
319 CAN_CHANNEL_NOT_USED if the passed in channed was not set up for RTR messages
320
321 */
322 int MultiCanReplaceRTRMessage(int moduleNum, int channel, uint8_t *data, uint8_t len);
323
324 /* Stop an RTR message
325 Parameters:
326 int channel The channel value returned from the SetRTRMessage call
327
328 Returns
329 CAN_OK if the replacement succeded.
330 CAN_CHANNEL_NOT_USED if the passed in channed was not set up for RTR messages
331
332 */
333 int MultiCanStopRTRMessage(int moduleNum, int channel);
334
335 // Should a user include functions used in the canif.h file, these inline functions
336 // will call the MultiCan module function associated with that function.
337
338 inline int CanInit(uint32_t bit_rate, uint32_t Global_Mask, uint8_t irq_level = 4)
339 {
340 return MultiCanInit(DEFAULT_CAN_MOD, bit_rate, Global_Mask, irq_level);
341 }
342
343 inline void CanShutDown(void)
344 {
345 return MultiCanShutDown(DEFAULT_CAN_MOD);
346 }
347
348 inline void ChangeGlobalMask(uint32_t Global_Mask)
349 {
350 return MultiCanChangeGlobalMask(DEFAULT_CAN_MOD, Global_Mask);
351 }
352
353 inline int RegisterCanRxFifo(uint32_t id, OS_FIFO *pFifo, int channel = -1)
354 {
355 return RegisterMultiCanRxFifo(DEFAULT_CAN_MOD, id, pFifo, channel);
356 }
357
358 inline int RegisterCanSpecialRxFifo(uint32_t id, uint32_t spl_mask, OS_FIFO *pFifo, int channel = -1)
359 {
360 return RegisterMultiCanSpecialRxFifo(DEFAULT_CAN_MOD, id, spl_mask, pFifo, channel);
361 }
362
363 inline int UnRegisterCanFifo(int channel)
364 {
365 return UnRegisterMultiCanFifo(DEFAULT_CAN_MOD, channel);
366 }
367
368 inline int SendMessage(uint32_t id, uint8_t *data, uint8_t len, uint16_t timeout, int channel = -1)
369 {

NetBurner, Inc.
22.2 multican.h 761

370 return MultiCanSendMessage(DEFAULT_CAN_MOD, id, data, len, timeout, channel);


371 }
372
373 inline int SetRTRMessage(uint32_t id, uint8_t *data, uint8_t len, int channel = -1)
374 {
375 return MultiCanSetRTRMessage(DEFAULT_CAN_MOD, id, data, len, channel);
376 }
377
378 inline int ReplaceRTRMessage(int channel, uint8_t *data, uint8_t len)
379 {
380 return MultiCanReplaceRTRMessage(DEFAULT_CAN_MOD, channel, data, len);
381 }
382
383 inline int StopRTRMessage(int channel)
384 {
385 return MultiCanStopRTRMessage(DEFAULT_CAN_MOD, channel);
386 }
387
388 /* The CAN system has 16 availible channels this tells how many are currently in use */
389 inline int FreeCanChannels()
390 {
391 return MultiCanFreeCanChannels(DEFAULT_CAN_MOD);
392 }
393
394 /* This tells if a specific channel is currently free */
395 inline BOOL IsChannelFree(int channel)
396 {
397 return MultiCanIsChannelFree(DEFAULT_CAN_MOD, channel);
398 }
399
400 /*******************************************************************************
401 Example #1
402
403 To set up to receive frames:
404
405
406 OS_FIFO fifo;
407 OSFifoInit(&fifo);
408
409 //REgister to listen for CAN data
410 //We will listed for frames with a normal is of 123
411 int chan1=RegisterCanRxFifo( MakeIdFromNormal(123),& fifoifo);
412
413 //We will also listen for the extended frame id of 0x1234
414 int chan2=RegisterCanRxFifo( ox1234,& fifoifo);
415
416 if ((chan1 >0) || (chan2> 0)_
417 {//We succeded in registering the fifo
418 while(1)
419 {
420 CanRxMessage can_msg(&fifo,30*TICKS_PER_SECOND); //Wait up to 20 seconds
421 if (can_msg.IsValid())
422 {uint8_t buffer[8];
423 uint8_t len;
424 len=can_msg.GetData(buffer,8);
425
426 iprintf("got a can message of %d bytes from ID %08X \r\n",len ,can_msg.GetId());
427 iprintf("Data = [");
428 for (int i=0; i<len; i++)
429 iprintf("%02X ",buffer[i]);
430 iprintf("]\r\n");
431 }
432 else
433 iprintf("CAN received timed out ");
434 }
435 }
436
437 **************************************************************************************
438 End of example #1
439 **************************************************************************************/
440
441 /*******************************************************************************
442 Example #2
443 Setup an automatic response buffer (an RTR buffer)
444
445 // we want to setup an automatic response message (RTR
446 //We will update it every 5 seconds
447 uint16_t value=GetValue();
448 int RTRChan=SetRTRMessage(0x5678,(puint8_t),&value,sizeof(value));
449
450
451 while (1)
452 {
453 //Every 5 seconds update the value stored in the message
454 OSTimeDly(5 * TICKS_PER_SECOND);
455
456 //Get the new value

NetBurner, Inc.
762 File Documentation

457 value=GetValue();
458 //Store it in the automatic response channel
459 ReplaceRTRMessage(RTRChan,(puint8_t),&value,sizeof(value) );
460 }
461
462
463 **************************************************************************************
464 End of example #2
465 **************************************************************************************/
466
469 #ifdef DOXYGEN_STUFF
470 } // namespace
471 #endif
472
473 #endif

22.3 multichanneli2c.h File Reference


NetBurner I2C API for MOD5441x and NANO54415.
#include <basictypes.h>
#include <nbrtos.h>
#include <i2c_class.h>

Macros
• #define I2C_OK (0)
Last instruction terminated correctly.
• #define I2C_NEXT_WRITE_OK (1)
I2C bus is OK for a write.
• #define I2C_NEXT_READ_OK (2)
I2C bus is OK for a read.
• #define I2C_MASTER_OK (3)
I2C finished transmission but still owns but (need to stop or restart)
• #define I2C_TIMEOUT (4)
A timeout occurred while trying communicate on I2C bus.
• #define I2C_BUS_NOT_AVAIL (5)
A timeout occurred while trying gain I2C bus control.
• #define I2C_NOT_READY (6)
A read or write was attempted before I2C ready or during a slave transmission.
• #define I2C_LOST_ARB (7)
Lost arbitration during start.
• #define I2C_LOST_ARB_ADD (8)
Lost arbitration and then winner addressed our slave address.
• #define I2C_NO_LINK_RX_ACK (9)
We are in Master TX mode and received no ACK from slave device, possibly during start.
• #define I2C_SR_BUSY (((0x20 & I2C_SR) == 0x20))
Bus is busy (bit 5 of I2SR)
• #define I2C_CR_SLAVE (((0x20 & I2C_CR) == 0x00))
Bus set as slave (bit 5 of I2CR)
• #define I2C_SR_ARB_LOST (((0x10 & I2C_SR) == 0x10))
Bus arbitration was lost (bit 4 of I2SR)
• #define I2C_SR_ADRES_AS_SLAVE (((0x40 & I2C_SR) == 0x40))
Addressed as a slave (bit 6 of I2SR)
• #define I2C_SR_SLAVE_TX (((0x04 & I2C_SR) == 0x04))
State of read/write bit of the received address command (bit 2 of I2SR)
• #define I2C_CR_TX (((0x10 & I2C_CR) == 0x10))

NetBurner, Inc.
22.3 multichanneli2c.h File Reference 763

Configured for transmit (bit 4 of I2CR)


• #define I2C_SR_RX_ACK (((0x01 & I2C_SR) == 0x00))
Received a RX ACK after last transmit (bit 0 of I2SR)
• #define I2C_CR_RX_ACK (((0x08 & I2C_CR) == 0x00))
Configured to RX Ack.
• #define I2C_SET_NO_ACK ((I2C_CR |= 0x08))
Configure I2C module not to send a RX ACK (bit 3 of I2CR)
• #define I2C_SET_ACK ((I2C_CR &= 0xF7))
Configure I2C module to send a RX ACK (bit 3 of I2CR)
• #define I2C_SET_TX ((I2C_CR |= 0x10))
Configure I2C module to be in TX mode (bit 4 of I2CR)
• #define I2C_SET_RX ((I2C_CR &= 0xEF))
Configure I2C module to be in RX mode (bit 4 of I2CR)
• #define I2C_SET_REPEAT_START ((I2C_CR |= 0x04))
Configure I2C to send a repeated start signal.
• #define I2C_CLR_ARB_LOST ((I2C_SR &= 0xEF))
Clear Arbitration lost error condition.

Functions
• void MultiChannel_I2CInit (int moduleNum=DEFAULT_I2C_MODULE, uint8_t slave_Addr=0x08, uint8_t fre-
qdiv=0x3C)
Initialize the I2C peripheral module.
• uint8_t MultiChannel_I2CSendBuf (int moduleNum, uint8_t addr, puint8_t buf, int num, bool stop=true)
Send a buffer of bytes to an I2C device.
• uint8_t MultiChannel_I2CReadBuf (int moduleNum, uint8_t addr, puint8_t buf, int num, bool stop=true)
Read a number of bytes from an I2C device and store in the specified buffer.
• void I2CMultiChannelResetPeripheral (int moduleNum)
Reset the specified I2C peripheral module.
• uint8_t MultiChannel_I2CRestart (int moduleNum, uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_←-
wait=I2C_RX_TX_TIMEOUT)
Restart communication with a I2C device.
• uint8_t MultiChannel_I2CStart (int moduleNum, uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_←-
wait=I2C_START_TIMEOUT)
Send an I2C start to an I2C device to begin communication.
• uint8_t MultiChannel_I2CStop (int moduleNum=DEFAULT_I2C_MODULE, uint32_t ticks_to_wait=I2C_RX←-
_TX_TIMEOUT)
Issue an I2C stop terminate communication with an I2C device and release the bus.
• uint8_t MultiChannel_I2CSend (int moduleNum, uint8_t val, uint32_t ticks_to_wait=I2C_RX_TX_TIMEOUT)
Send a single byte on the I2C bus.
• uint8_t MultiChannel_I2CRead (int moduleNum, puint8_t val, uint32_t ticks_to_wait=I2C_RX_TX_TIMEOUT)
Read a single byte from the I2C bus.

22.3.1 Detailed Description


NetBurner I2C API for MOD5441x and NANO54415.

NetBurner, Inc.
764 File Documentation

22.4 multichanneli2c.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*-----------------------------------------------------------------------------
6 NetBurner I2C Multi-Master I2C Driver.
7 Multi-Master I2C will enable operation as a master device on the I2C bus when
8 activly seeking to communicate. When idle, the NetBurner will act as a slave
9 device so other I2C masters can use the bus.
10
11 Note: If your NetBurner device is the only master on the I2C bus, you may
12 choose to use the Master-Only I2C driver to conserve system resources
13 -------------------------------------------------------------------------------*/
14
47 #ifndef _MULTICHANNELI2C_H
48 #define _MULTICHANNELI2C_H
49 #include <basictypes.h>
50 #include <nbrtos.h>
51 #include <i2c_class.h>
52
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57
58 #define I2C_MAX_BUF_SIZE (64) // Size allocated to input and output buffers in slave mode I2C
59
60 #define DEFAULT_I2C_MODULE (0)
61
62 /* defined I2C Timeout values will be used if user does not include the ’ticks_to_wait’
63 parameter when calling I2C functions */
64 #define I2C_RX_TX_TIMEOUT (5) // Ticks allowed before timeout of a single byte transmission
65 #define I2C_START_TIMEOUT (20) // Ticks allowed before timeout when attempting start on I2C bus
66
67 #define I2C_SLAVE_TX_TERM_CHAR (0) // Terminating char to be sent when Slave TX buffer is empty
68
74 #define I2C_OK (0)
75 #define I2C_NEXT_WRITE_OK (1)
76 #define I2C_NEXT_READ_OK (2)
77 #define I2C_MASTER_OK (3)
78 #define I2C_TIMEOUT (4)
79 #define I2C_BUS_NOT_AVAIL (5)
80 #define I2C_NOT_READY (6)
81 #define I2C_LOST_ARB (7)
82 #define I2C_LOST_ARB_ADD (8)
83 #define I2C_NO_LINK_RX_ACK (9)
86 // The following defines were created to allow the multi and master-only drivers to
87 // have the same function calls. i.e. Multi_I2CInit(); is the same as calling I2CInit();
88 //#define I2CInit MultiChannel_I2CInit
89 //#define I2CSendBuf MultiChannel_I2CSendBuf
90 //#define I2CReadBuf MultiChannel_I2CReadBuf
91 //#define I2CRestart MultiChannel_I2CRestart
92 //#define I2CStart MultiChannel_I2CStart
93 //#define I2CStop MultiChannel_I2CStop
94 //#define I2CSend MultiChannel_I2CSend
95 //#define I2CRead MultiChannel_I2CRead
96
97 // Setup sim references to i2c struct
98 #define I2C_SR i2cModule->i2sr
99 #define I2C_CR i2cModule->i2cr
100 #define I2C_DR i2cModule->i2dr
101 #define I2C_FDR i2cModule->i2fdr
102 #define I2C_ADR i2cModule->i2adr
103
117 void MultiChannel_I2CInit(int moduleNum = DEFAULT_I2C_MODULE, uint8_t slave_Addr = 0x08, uint8_t
freqdiv = 0x3C);
118
135 uint8_t MultiChannel_I2CSendBuf(int moduleNum, uint8_t addr, puint8_t buf, int num, bool stop =
true);
136
153 uint8_t MultiChannel_I2CReadBuf(int moduleNum, uint8_t addr, puint8_t buf, int num, bool stop =
true);
154
162 void I2CMultiChannelResetPeripheral(int moduleNum);
163
164 /*----------------------------------------------------------------------------
165 bool I2CRXAvail();
166
167 returns true if data is available in the Slave RX buffer
168 */
169 bool I2CRXAvail();
170
171 /*----------------------------------------------------------------------------

NetBurner, Inc.
22.4 multichanneli2c.h 765

172 uint32_t I2CTXAvail();


173
174 returns amount of free space available in Slave TX buffer
175 */
176 uint32_t I2CTXAvail();
177
178 /*----------------------------------------------------------------------------
179 uint8_t I2CGetByte();
180
181 This function will pend on a slave recieve I2C semaphore
182
183 returns last unread uint8_t received as a I2C Slave
184 */
185 uint8_t I2CGetByte();
186
187 /*----------------------------------------------------------------------------
188 bool I2CFillSlaveTXBuf(puint8_t buf, uint32_t num, bool restart = true);
189
190 This will put the first ’num’ BYTES from the buffer ’buf’ into the
191 I2C Slave TX buffer and clear the previously-read contents of the buffer.
192 The ’restart’ parameter tells the slave transmitter how to terminate
193 if ’restart’ = true then restart next tx from begining TX buffer (A new slave fill replaces buffer);
194 if ’false’ continue next tx from last slave tx,(A new slave fill adds to buffer at last read byte);
195 In I2C multi.h there is a I2C_SLAVE_TX_TERM_CHAR defined that will decide the terminating char (if
any) to send
196 when the slave tx buffer is empty
197
198 returns false if failed to copy data
199 */
200 uint8_t I2CFillSlaveTXBuf(puint8_t buf, uint32_t num, bool restart = true);
201
202 /*----------------------------------------------------------------------------
203 uint8_t ( *I2C_SlaveTX_Callback )( );
204
205 If this callback is pointed to a function then it will be called when
206 retreiving the data to be sent to the master. This will bypass the circular
207 buffer functions "I2CTXAvail" and "I2CFillSlaveTXBuf" used when transmitting
208 data as a slave.
209
210 returns the data to be sent to the master
211 */
212 extern uint8_t (*I2C_SlaveTX_Callback)();
213
214 /*----------------------------------------------------------------------------
215 void ( *I2C_SlaveTX_NAK_Callback )( );
216
217 If this callback is pointed to a function then it will be called when
218 the recieving master device sends a NAK. This indicates that the master
219 device will not be reading any more data from the slave transmitter.
220
221 */
222 extern void (*I2C_SlaveTX_NAK_Callback)();
223
224 /*----------------------------------------------------------------------------
225 void ( *I2C_SlaveRX_Callback )( uint8_t RX_Data);
226
227 If this callback is pointed to a function then it will be called when
228 storing the data received from the master. This will bypass the circular
229 buffer functions "I2CRXAvail" and "I2CGetByte" used when receiving
230 data as a slave.
231
232 uint8_t RX_Data - Passes the received data to the callback function
233
234 returns nothing
235 */
236 extern void (*I2C_SlaveRX_Callback)(uint8_t RX_Data);
237
238 #define I2C_START_READ (1) // defines to be used for bRead_Not_Write
239 #define I2C_START_WRITE (0)
257 uint8_t MultiChannel_I2CRestart(int moduleNum, uint8_t addr, bool Read_Not_Write, uint32_t
ticks_to_wait = I2C_RX_TX_TIMEOUT);
258
259 /*------------------------------------------------------------------------------------------
260 Advanced NetBurner I2C Functions
261
262 The following functions are used for advanced communications on using the I2C bus. These
263 functions are useful if user wishes to talk to a device that does not follow the Phillips
264 I2C standard. One example is an eeprom that first must be addressed and then read from
265 with no restart in between.
266 Data must be sent or received a byte at a time. Also user must check function returns
267 to verify the status of the bus before performing the next option.
268 -------------------------------------------------------------------------------------------
269 ===========================================================================================*/
270
288 uint8_t MultiChannel_I2CStart(int moduleNum, uint8_t addr, bool Read_Not_Write, uint32_t
ticks_to_wait = I2C_START_TIMEOUT);
289

NetBurner, Inc.
766 File Documentation

303 uint8_t MultiChannel_I2CStop(int moduleNum = DEFAULT_I2C_MODULE, uint32_t ticks_to_wait =


I2C_RX_TX_TIMEOUT);
304
321 uint8_t MultiChannel_I2CSend(int moduleNum, uint8_t val, uint32_t ticks_to_wait =
I2C_RX_TX_TIMEOUT);
322
343 uint8_t MultiChannel_I2CRead(int moduleNum, puint8_t val, uint32_t ticks_to_wait =
I2C_RX_TX_TIMEOUT);
344
345 // Struct that contains I2C Slave I/O Buffers
346 struct I2C_Slave_Record
347 {
348 OS_SEM I2C_Slave_RX_Semaphore; // semaphore used to determine when a slave RX interrupt occurs
349
350 volatile uint8_t *pI2CRxbuf;
351 volatile uint8_t *pI2CTxbuf;
352
353 volatile uint32_t I2Crx_put;
354 volatile uint32_t I2Crx_get;
355
356 volatile uint32_t I2Ctx_put;
357 volatile uint32_t I2Ctx_get;
358 };
359
360 /*---------------------------------------------------------------------------
361 Useful I2C macros
362 ----------------------------------------------------------------------------*/
368 #define I2C_SR_BUSY (((0x20 & I2C_SR) == 0x20))
369 #define I2C_CR_SLAVE (((0x20 & I2C_CR) == 0x00))
370 #define I2C_SR_ARB_LOST (((0x10 & I2C_SR) == 0x10))
371 #define I2C_SR_ADRES_AS_SLAVE (((0x40 & I2C_SR) == 0x40))
372 #define I2C_SR_SLAVE_TX (((0x04 & I2C_SR) == 0x04))
373
374 #define I2C_CR_TX (((0x10 & I2C_CR) == 0x10))
375 #define I2C_SR_RX_ACK (((0x01 & I2C_SR) == 0x00))
376 #define I2C_CR_RX_ACK (((0x08 & I2C_CR) == 0x00))
377
378 #define I2C_SET_NO_ACK ((I2C_CR |= 0x08))
379 #define I2C_SET_ACK ((I2C_CR &= 0xF7))
380 #define I2C_SET_TX ((I2C_CR |= 0x10))
381 #define I2C_SET_RX ((I2C_CR &= 0xEF))
382 #define I2C_SET_REPEAT_START ((I2C_CR |= 0x04))
383 #define I2C_CLR_ARB_LOST ((I2C_SR &= 0xEF))
386 //----------------------------------------------------------------------------
387
388 inline void I2CInit(uint8_t slave_Addr = 0x08, uint8_t freqdiv = 0x3C)
389 {
390 MultiChannel_I2CInit(DEFAULT_I2C_MODULE, slave_Addr, freqdiv);
391 }
392
393 inline void Mulit_I2CInit(uint8_t slave_Addr = 0x08, uint8_t freqdiv = 0x3C)
394 {
395 MultiChannel_I2CInit(DEFAULT_I2C_MODULE, slave_Addr, freqdiv);
396 }
397
398 inline uint8_t I2CSendBuf(uint8_t addr, puint8_t buf, int num, bool stop = true)
399 {
400 return MultiChannel_I2CSendBuf(DEFAULT_I2C_MODULE, addr, buf, num, stop);
401 }
402
403 inline uint8_t Multi_I2CSendBuf(uint8_t addr, puint8_t buf, int num, bool stop = true)
404 {
405 return MultiChannel_I2CSendBuf(DEFAULT_I2C_MODULE, addr, buf, num, stop);
406 }
407
408 inline uint8_t I2CReadBuf(uint8_t addr, puint8_t buf, int num, bool stop = true)
409 {
410 return MultiChannel_I2CReadBuf(DEFAULT_I2C_MODULE, addr, buf, num, stop);
411 }
412
413 inline uint8_t Multi_I2CReadBuf(uint8_t addr, puint8_t buf, int num, bool stop = true)
414 {
415 return MultiChannel_I2CReadBuf(DEFAULT_I2C_MODULE, addr, buf, num, stop);
416 }
417
418 inline uint8_t I2CRestart(uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_wait =
I2C_RX_TX_TIMEOUT)
419 {
420 return MultiChannel_I2CRestart(DEFAULT_I2C_MODULE, addr, Read_Not_Write, ticks_to_wait);
421 }
422
423 inline uint8_t Multi_I2CRestart(uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_wait =
I2C_RX_TX_TIMEOUT)
424 {
425 return MultiChannel_I2CRestart(DEFAULT_I2C_MODULE, addr, Read_Not_Write, ticks_to_wait);
426 }
427

NetBurner, Inc.
22.5 cpu_pins.h File Reference 767

428 inline uint8_t I2CStart(uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_wait =


I2C_RX_TX_TIMEOUT)
429 {
430 return MultiChannel_I2CStart(DEFAULT_I2C_MODULE, addr, Read_Not_Write, ticks_to_wait);
431 }
432
433 inline uint8_t Multi_I2CStart(uint8_t addr, bool Read_Not_Write, uint32_t ticks_to_wait =
I2C_RX_TX_TIMEOUT)
434 {
435 return MultiChannel_I2CStart(DEFAULT_I2C_MODULE, addr, Read_Not_Write, ticks_to_wait);
436 }
437
438 inline uint8_t I2CStop(uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT) { return
MultiChannel_I2CStop(DEFAULT_I2C_MODULE, ticks_to_wait); }
439
440 inline uint8_t Multi_I2CStop(uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT)
441 {
442 return MultiChannel_I2CStop(DEFAULT_I2C_MODULE, ticks_to_wait);
443 }
444
445 inline uint8_t I2CSend(uint8_t val, uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT)
446 {
447 return MultiChannel_I2CSend(DEFAULT_I2C_MODULE, val, ticks_to_wait);
448 }
449
450 inline uint8_t Multi_I2CSend(uint8_t val, uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT)
451 {
452 return MultiChannel_I2CSend(DEFAULT_I2C_MODULE, val, ticks_to_wait);
453 }
454
455 inline uint8_t I2CRead(puint8_t val, uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT)
456 {
457 return MultiChannel_I2CRead(DEFAULT_I2C_MODULE, val, ticks_to_wait);
458 }
459
460 inline uint8_t Multi_I2CRead(puint8_t val, uint32_t ticks_to_wait = I2C_RX_TX_TIMEOUT)
461 {
462 return MultiChannel_I2CRead(DEFAULT_I2C_MODULE, val, ticks_to_wait);
463 }
464
465 #ifdef __cplusplus
466 }
467 #endif
468
469 #endif
470

22.5 cpu_pins.h File Reference


GPIO pin driver class for the ARM SAME70 (MODM7AE70)
#include <sim.h>
#include <basictypes.h>

Classes
• class PinIO
GPIO Pin Class.
• class _PinVector
GPIO Pin Vector Base Class.
• class PinVector< n >
GPIO Pin Vector Class PinVector is a template instantiation of the _PinVector class, allowing for minimal storage
requirements for potentially large vectors, without heavy code duplication due to template copies.

22.5.1 Detailed Description


GPIO pin driver class for the ARM SAME70 (MODM7AE70)

22.6 cpu_pins.h
Go to the documentation of this file.

NetBurner, Inc.
768 File Documentation

1 #ifndef __CPU_PINS_H
2 #define __CPU_PINS_H
3 /*NB_REVISION*/
4
5 /*NB_COPYRIGHT*/
6
17 #include <sim.h>
18 #include <basictypes.h>
19
20
32 class PinIO {
33 public:
34 volatile Pio &pio;
35 uint32_t mask;
36
40 typedef enum {
41 PIN_FN_IN = 0,
42 PIN_FN_OUT,
43 PIN_FN_A,
44 PIN_FN_B,
45 PIN_FN_C,
46 PIN_FN_D
47 } pin_fn_t;
48
53 PinIO() : pio(*((volatile Pio*)PIOA)), mask(0) {}
65 constexpr PinIO(uint32_t port, uint32_t pin) : pio(*((volatile Pio*)PIOA+port)), mask(1 « pin) {}
70 constexpr PinIO(const PinIO &rhs): pio(rhs.pio), mask(rhs.mask) {}
71
76 void setFn(pin_fn_t fn) const {
77 if (fn > PIN_FN_OUT) {
78 uint8_t bits = ((uint8_t)fn)-2;
79 if (bits & 0x1) { pio.PIO_ABCDSR[0] |= mask; }
80 else { pio.PIO_ABCDSR[0] &= ~mask; }
81 if (bits & 0x2) { pio.PIO_ABCDSR[1] |= mask; }
82 else { pio.PIO_ABCDSR[1] &= ~mask; }
83
84 pio.PIO_PDR = mask;
85 }
86 else {
87 if (fn) { pio.PIO_OER = mask; }
88 else { pio.PIO_ODR = mask; }
89 pio.PIO_PER = mask;
90 }
91 }
92
97 int8_t getFn()
98 {
99 // TODO: check if PIO_LOCKSR is set. if it’s set, a peripheral has locked the I/O line
100 // The only way to unlock it is to apply a hardware reset to the PIO controller
101 if(mask == 0) { return -1; } // pin is not valid
102
103 if(pio.PIO_PSR & mask) // if PIO_PSR bit is set, PIO is active on corresponding I/O line
(peripheral is inactive)
104 {
105 // Determine if I/O line is configured for an input or output
106 // Read output status register (PIO_OSR). If 0, I/O is an input. If 1, I/O is an output
107 return ((pio.PIO_OSR & mask) ? PIN_FN_OUT : PIN_FN_IN);
108 }
109 else // if PIO_PSR bit is clear, PIO is inactive on corresponding I/O line
(peripheral is active)
110 {
111 // Determine which peripheral function is set
112 uint32_t abcdsr0 = (pio.PIO_ABCDSR[0] & mask);
113 uint32_t abcdsr1 = (pio.PIO_ABCDSR[1] & mask);
114
115 if (abcdsr0 & mask)
116 {
117 if (abcdsr1 & mask) { return PIN_FN_D; }
118 else { return PIN_FN_B; }
119 }
120 else
121 {
122 if (abcdsr1 & mask) { return PIN_FN_C; }
123 else { return PIN_FN_A; }
124 }
125 }
126 }
127
132 void function(pin_fn_t fn) const { setFn(fn); }
136 void hiz() const { setFn(PIN_FN_IN); }
140 void drive() const { setFn(PIN_FN_OUT); }
144 inline void set() const { pio.PIO_SODR = mask; }
148 inline void clr() const { pio.PIO_CODR = mask; }
153 inline bool tgl() const {bool val = pio.PIO_ODSR & mask;(&(pio.PIO_SODR))[val] = mask;return val;}
158 inline bool toggle() const { return tgl(); }
164 inline bool readBack() const { return (pio.PIO_PDSR & mask); }
169 inline bool read() const { hiz(); return readBack(); }

NetBurner, Inc.
22.6 cpu_pins.h 769

175 inline bool operator=( bool val ) { (&(pio.PIO_SODR))[!val] = mask; return val;}
182 inline PinIO& operator=(const PinIO& rhs)
183 {
184 bool val = rhs;
185 (&(pio.PIO_SODR))[!val] = mask; return *this;
186 }
187
192 inline operator bool() const { return (pio.PIO_PDSR & mask); }
193
198 inline bool operator!() const { return ((pio.PIO_ODR & mask) == 0); }
199
206 void multidrv(bool enable) const { (&(pio.PIO_MDER))[!enable] = mask; }
207
214 void setHighStrength( bool bHighDrive )
215 {
216 if (bHighDrive) { pio.PIO_DRIVER |= mask; }
217 else { pio.PIO_DRIVER &= ~mask;}
218 }
219
226 void PullUp(bool enable) const {if (enable) {pio.PIO_PUER =mask;} else {pio.PIO_PUDR =mask;}};
233 void PullDown(bool enable) const {if (enable) {pio.PIO_PPDER =mask;} else {pio.PIO_PPDDR =mask;}};
234
240 uint16_t analogRead() const;
241
242 //friend class PinIOArray2;
243
244 };
245
246
259 class _PinVector {
260 protected:
261 struct pinCfg {
262 uint8_t port : 3;
263 uint8_t num : 5;
264 };
265 const uint8_t len;
266 union {
267 pinCfg _pins[4];
268 pinCfg *const pinArr;
269 };
270 // _PinVector constructors are protected to prevent the construction of the
271 // base class, as the base class has no allocated storage for the pin
272 // confuguration settings.
273 _PinVector(uint8_t _len, pinCfg *arr);
274 _PinVector(uint8_t len, pinCfg *arr,
275 PinIO *initpins, uint32_t pinCount);
276 public:
282 uint32_t operator=(uint32_t val);
288 PinIO operator[](int idx);
289
296 void config(uint32_t idx, PinIO cfg);
304 void config(PinIO *pinCfgs, uint32_t count);
305
310 operator uint32_t() const;
311 };
312
313
323 template<uint8_t n> class PinVector : public _PinVector {
324 _PinVector::pinCfg pinStore[n];
325 public:
330 inline PinVector(): _PinVector(n, pinStore) {}
331
338 inline PinVector(PinIO *initpins, uint32_t pinCount)
339 : _PinVector(n, pinStore, initpins, pinCount)
340 { }
346 inline uint32_t operator=(uint32_t val) {return (*(_PinVector*)this) = val; }
347 };
348
349 // TinyPinVectors are a template specialization made for vector lengths where
350 // the entire configuration list can fit within the memory space of the
351 // storage pointer, thereby reducing the storage requirements to an absolute
352 // minimum, while preventing the duplication of code.
353 #define TinyPinVector(n) \
354 template<> class PinVector<n> : public _PinVector { \
355 public: \
356 inline PinVector(): _PinVector((n), nullptr) {} \
357 \
358 inline PinVector(PinIO *initpins, uint32_t pinCount) \
359 : _PinVector((n), nullptr, initpins, pinCount) \
360 { } \
361 };
362
363 TinyPinVector(1);
364 TinyPinVector(2);
365 TinyPinVector(3);
366 TinyPinVector(4);
367

NetBurner, Inc.
770 File Documentation

368
369
370 // end of groupGPIO
372 #endif /* ----- #ifndef __CPU_PINS_H ----- */

22.7 dspi.h File Reference


NetBurner MCF5441x DSPI API.
#include <nbrtos.h>
#include <basictypes.h>
#include <sim5441x.h>

Classes
• class DSPIModule
DSPIModule is a SPI communications driver. It is an object based driver, which allows for low overhead multiplexing
between peripherals with different bus configurations.

Enumerations
• enum csReturnType {
DEASSERT_NEVER = 0 , DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 ,
DEASSERT_NEVER = 0 ,
DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 }
Chip select return types.
• enum spiChipSelect {
CHIP_SELECT_0 = 0 , CHIP_SELECT_1 = 1 , CHIP_SELECT_2 = 2 , CHIP_SELECT_3 = 3 ,
CHIP_SELECT_DISABLED = 0xFF , CHIP_SELECT_0 = 0xFE , CHIP_SELECT_1 = 0xFD , CHIP_SELECT_2
= 0xFB ,
CHIP_SELECT_3 = 0xF7 , CHIP_SELECT_DISABLED = 0xFF }
Chip select number.
• enum spiChipSelectPolarity { CS_ASSERT_LOW = 0 , CS_ASSERT_HIGH = 1 , CS_ASSERT_LOW = 0x00
, CS_ASSERT_HIGH = 0xFF }
Chip select polarity.

Functions
• uint8_t DSPIInit (uint8_t SPIModule=DEFAULT_DSPI_MODULE, uint32_t Baudrate=2000000, uint8_←-
t QueueBitSize=8, uint8_t CS=0x00, uint8_t CSPol=0x0F, uint8_t ClkPolarity=0, uint8_t ClkPhase=1, BOOL
DoutHiz=TRUE, uint8_t QCD=0, uint8_t DTL=0)
Initialize a DSPI module.

22.7.1 Detailed Description


NetBurner MCF5441x DSPI API.

22.8 coldfire/cpu/MCF5441X/include/dspi.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
48 #ifndef _DMA_SPI_H_INC
49 #define _DMA_SPI_H_INC
50 #include <nbrtos.h>
51 #include <basictypes.h>
52 #include <sim5441x.h>
53

NetBurner, Inc.
22.8 coldfire/cpu/MCF5441X/include/dspi.h 771

54 #ifndef __cplusplus
55 #error DSPI driver is a C++ only library
56 #endif
57
58 /*
59 DSPI state
60 */
65 #define DSPI_OK (0)
66 #define DSPI_BUSY (1)
67 #define DSPI_ERROR (2)
70 // MCR Register masks
71 #define MCR_MASTER_INIT 0x80000C01
72 #define MCR_HALT_BIT 0x00000001
73 #define MCR_DIS_TXF 0x00002000
74 #define MCR_DIS_RXF 0x00001000
75 #define MCR_CLR_FIFOS 0x00000C00
76
77 // CTAR Register masks
78 #define CTAR_CLOCK_POLARITY 0x04000000
79 #define CTAR_CLOCK_PHASE 0x02000000
80 #define CTAR_FRAME_16BIT 0x78000000
81 #define CTAR_FRAME_4BIT 0x18000000
82
83 // SR Register masks
84 #define SR_EOQF_MASK 0x10000000
85 #define SR_CLR_FLAGS 0x8A0A0000
86
87 // RSER (Interrupt/DMA enable) Register masks
88 #define RSER_EOQF_IRQ_ONLY ~0x8B0B0000
89 #define RSER_DMA_IRQ_ONLY 0x03030000
90
91 // PUSHR (command) Register masks
92 #define PUSHR_CONT_BIT 0x80000000
93 #define PUSHR_EOQ_BIT 0x08000000
94
96 //
97 // DMA CHANNEL NUMBERS
98 #define DMA_CH_DSPI_0_RX 0x0C // (12)
99 #define DMA_CH_DSPI_0_TX 0x0D // (13)
100 #define DMA_CH_DSPI_1_RX 0x0E // (14)
101 #define DMA_CH_DSPI_1_TX 0x0F // (15)
102 #define DMA_CH_DSPI_2_RX 0x1C // (28)
103 #define DMA_CH_DSPI_2_TX 0x1D // (29)
104 #define DMA_CH_DSPI_3_RX 0x2C // (44)
105 #define DMA_CH_DSPI_3_TX 0x2D // (45)
106
107 // EDMA CR Register masks
108 #define CR_CLEAR_NON_GRP_PRIO ~0x000300FF
109 #define CR_SET_RR_CH_ARB 0x00000004
110
112 // EDMA TCD masks
113 #define TCD_ATTR_8BIT_TRANS 0x0000
114 #define TCD_ATTR_16BIT_TRANS 0x0101
115
116 #define TCD_XOFF_0uint8_t 0x0000
117 #define TCD_XOFF_1uint8_t 0x0001
118 #define TCD_XOFF_2uint8_t 0x0002
119
120 #define TCD_XITER_CNT_MASK 0x7FFF
121
122 #define TCD_CSR_DONE_BIT 0x0080
123 #define TCD_CSR_DISABLE_REQ 0xC008
124 #define TCD_CSR_DREQ_INT_MAJOR 0xC00A
125 // end EDMA TCD masks
127
128 #define DEFAULT_DSPI_MODULE 1
129 #define DSPI_MODULE_COUNT 4
130
138 enum csReturnType
139 {
140 DEASSERT_NEVER = 0,
141 DEASSERT_AFTER_LAST = 1,
143 DEASSERT_EVERY_TRANSFER = 2,
144 };
145
153 enum spiChipSelect
154 {
155 CHIP_SELECT_0 = 0xFE,
156 CHIP_SELECT_1 = 0xFD,
157 CHIP_SELECT_2 = 0xFB,
158 CHIP_SELECT_3 = 0xF7,
159 CHIP_SELECT_DISABLED = 0xFF,
160 };
161
171 enum spiChipSelectPolarity
172 {
173 CS_ASSERT_LOW = 0x00,

NetBurner, Inc.
772 File Documentation

174 CS_ASSERT_HIGH = 0xFF,


175 };
176
177 /*
178 *****************************************************************************-
179 *
180 * dspiDMAStruct
181 *
182 * bool enabled - whether or not the driver is using DMA for the transfer
183 *
184 * uint8_t byteCount - the bytes transfer per dma call
185 *
186 * uint32_t savedMCR - the actual MCR value, saved when doing DMA based transfer
187 * as the CS inactive state is inverted on the active CS
188 *
189 *****************************************************************************-
190 */
191 typedef struct
192 {
193 bool enabled;
194 uint8_t byteCount;
195 bool rxPresent;
196 bool txPresent;
197 dspistruct savedDSPI;
198 bool csState;
199 } dspiDMAStruct;
200
201 /*
202 *****************************************************************************-
203 *
204 * dspiDriverStruct
205 *
206 * This struct contains the major variables/configurations used for a DSPI transfer
207 *
208 * volatile uint8_t* pDSPIRxbuf/pDSPITxbuf -
209 * These pointers are used to track the locations in memory where data will be
210 * read or written to the peripheral
211 *
212 * uint8_t BitsPerQueue - This is the number if bits per transfer, (value = 8 - 32)
213 *
214 * uint32_t DSPI_SizeLeft - This is the number if bytes left in the transfer
215 *
216 * uint16_t Command_Mask - This is a partial configuration for the queue’s command reg
217 *
218 * OS_SEM* DSPI_Sem - This is a pointer to an external semaphore provided by DSPIStart()
219 *
220 * uint8_t DSPI_INT_STATUS - Status of the spi device
221 *
222 * uint32_t WordsToWrite - Number of words to write to the command/TX Queues and Read from RX
223 *
224 * uint32_t LastWordsToWrite - the amount from the previous ISR
225 *
226 *****************************************************************************-
227 */
228 typedef struct
229 {
230 volatile uint8_t *pDSPIRxbuf;
231 volatile uint8_t *pDSPITxbuf;
232 uint8_t BitsPerQueue;
233 uint32_t DSPI_SizeLeft;
234 uint16_t Command_Mask;
235 csReturnType csReturnToInactive;
236 OS_SEM *DSPI_Sem;
237 volatile uint8_t DSPI_INT_STATUS;
238 uint32_t WordsToWrite;
239 uint32_t LastWordsToWrite;
240 volatile BOOL DSPIfinished;
241 dspiDMAStruct dma;
242 } dspiDriverStruct;
243
244 // uint8_t DSPIInit( uint8_t SPIModule, uint32_t Baudrate, uint8_t QueueBitSize, uint8_t CS,
245 // uint8_t CSPol, uint8_t ClkPolarity, uint8_t ClkPhase, BOOL DoutHiz, uint8_t QCD,
uint8_t DTL );
246
253 class DSPIModule
254 {
255 uint32_t m_moduleNum;
256 uint32_t m_mcr;
257 uint32_t m_ctar0;
258 uint32_t m_ctar1;
259 bool m_enableDMA;
260 uint16_t m_CommandMask;
261 uint8_t m_BitsPerQueue;
262 OS_SEM *m_finishedSem;
263 uint32_t m_actualBaudrate;
264
265 public:

NetBurner, Inc.
22.8 coldfire/cpu/MCF5441X/include/dspi.h 773

266 bool m_inProgress;


267
268 static DSPIModule *lastCxts[DSPI_MODULE_COUNT];
269 static dspiDriverStruct driverCxt[DSPI_MODULE_COUNT];
270
283 DSPIModule(uint8_t SPIModule);
284
315 DSPIModule(uint8_t SPIModule,
316 uint32_t baudRateInBps,
317 uint8_t transferSizeInBits = 8,
318 uint8_t peripheralChipSelects = 0x00,
319 uint8_t chipSelectPolarity = 0x0F,
320 uint8_t clockPolarity = 0,
321 uint8_t clockPhase = 1,
322 BOOL doutHiz = TRUE,
323 uint8_t csToClockDelay = 0,
324 uint8_t delayAfterTransfer = 0);
325
354 uint8_t Init(uint32_t baudRateInBps = 2000000,
355 uint8_t transferSizeInBits = 8,
356 uint8_t peripheralChipSelects = 0x00,
357 uint8_t chipSelectPolarity = 0x0F,
358 uint8_t clockPolarity = 0,
359 uint8_t clockPhase = 1,
360 BOOL doutHiz = TRUE,
361 uint8_t csToClockDelay = 0,
362 uint8_t delayAfterTransfer = 0);
363
380 uint8_t Start(uint8_t *transmitBufferPtr,
381 volatile uint8_t *receiveBufferPtr,
382 uint32_t byteCount,
383 int csReturnToInactive = DEASSERT_AFTER_LAST);
384
400 inline uint8_t Tx(uint8_t *transmitBufferPtr, uint32_t byteCount, int csReturnToInactive =
DEASSERT_AFTER_LAST)
401 {
402 return Start(transmitBufferPtr, NULL, byteCount, csReturnToInactive);
403 }
404
420 inline uint8_t Rx(uint8_t *receiveBufferPtr, uint32_t byteCount, int csReturnToInactive =
DEASSERT_AFTER_LAST)
421 {
422 return Start(NULL, receiveBufferPtr, byteCount, csReturnToInactive);
423 }
424
431 bool EnableDMA(bool enableDMA = true);
436 inline bool DisableDMA() { return EnableDMA(false); }
437
444 bool RegisterSem(OS_SEM *finishedSem);
449 inline bool ClrSem() { return RegisterSem(NULL); }
454 inline OS_SEM *GetSem() { return m_finishedSem; }
455
461 inline bool Done() { return !m_inProgress; }
462
470 static BOOL Done(uint8_t SPIModule);
471
477 inline uint32_t GetActualBaudrate() { return m_actualBaudrate; }
478
487 inline bool SetCS(uint8_t CS)
488 {
489 OSLockObj lock;
490 if (m_inProgress) { return false; }
491 m_CommandMask = (((m_mcr » 16) ^ CS) & 0xFF);
492 return true;
493 }
494
524 friend uint8_t DSPIInit(uint8_t SPIModule,
525 uint32_t Baudrate,
526 uint8_t QueueBitSize,
527 uint8_t CS,
528 uint8_t CSPol,
529 uint8_t ClkPolarity,
530 uint8_t ClkPhase,
531 BOOL DoutHiz,
532 uint8_t QCD,
533 uint8_t DTL);
534 };
535
536 /*----------------------------------------------------------------------------------
537 *
538 * Initialize DMA Serial Peripheral Interface (DSPI)
539 *
540 * Parameters:
541 * baudRateInBps - Maximum speed requested. (1) (2)
542 * transferSizeInBits - 8 thru 32 valid (3)
543 * SPIModule - the dspi module to target on the processor
544 * peripheralChipSelects - DSPI_CS[7:0] (4)

NetBurner, Inc.
774 File Documentation

545 * chipSelectPolarity - CS[7:0] 0 inactive logic level low, 1 high


546 * clockPolarity - 0 inactive logic level low, 1 high
547 * clockPhase - 0 (5) or 1 (6)
548 * doutHiz - Data output high impedance between transfers
549 * csToClockDelay - Delay form chip select to valid clock (7)
550 * delayAfterTransfer - Delay between data transfers (8)
551 *
552 * Return:
553 * Current DSPI state - DSPI_OK success or DSPI_BUSY busy
554 *
555 * Notes:
556 * (1) Maximum BAUD rate is CPU_CLOCK / 3
557 * (2) Will select highest BAUD rate available that does not exceed.
558 * (3) Transfers > 8 must be word aligned
559 * (4) Select based on chipSelectPolarity
560 * (5) 0 data captured leading edge of DSPI_CLK, changed following edge.
561 * (6) 1 data changed leading edge of DSPI_CLK, captured following edge.
562 * (7) 0 default is as close to 1/2 DSPI_CLK without going under,
563 * keeping with the interface to QSPI
564 * (8) 0 default is 17/(system clock / 2), in keepin with interface to QSPI
565 *
566 ---------------------------------------------------------------------------------------*/
567
597 uint8_t DSPIInit(uint8_t SPIModule = DEFAULT_DSPI_MODULE,
598 uint32_t Baudrate = 2000000,
599 uint8_t QueueBitSize = 8,
600 uint8_t CS = 0x00,
601 uint8_t CSPol = 0x0F,
602 uint8_t ClkPolarity = 0,
603 uint8_t ClkPhase = 1,
604 BOOL DoutHiz = TRUE,
605 uint8_t QCD = 0,
606 uint8_t DTL = 0);
607
608 /*
609 *****************************************************************************-
610 *
611 * Start DSPI Data Transfer
612 *
613 * Parameters:
614 * transmitBufferPtr - Buffer with data to send, NULL for receiving
615 * receiveBufferPtr - Buffer to receive data, NULL for sending
616 * byteCount - Count of bytes to send or receive
617 * SPIModule - Selects the dspi module to use
618 * finishedSem - Optional semaphore to set when completed
619 *
620 * Return:
621 * Current DSPI state - DSPI_OK success or DSPI_BUSY busy
622 *
623 * Notes:
624 * None
625 *
626 *****************************************************************************-
627 */
628
629 uint8_t DSPIStart(uint8_t SPIModule,
630 puint8_t transmitBufferPtr,
631 volatile uint8_t *receiveBufferPtr,
632 uint32_t byteCount,
633 OS_SEM *finishedSem = NULL,
634 uint8_t enableDMA = TRUE,
635 int csReturnToInactive = DEASSERT_AFTER_LAST);
636
637 /*------------------------------------------------------------------------------
638 *
639 * Check current DSPI Data Transfer
640 *
641 * Parameters:
642 * None
643 *
644 * Return:
645 * Progress of transfer - TRUE is finished, FALSE is active
646 *
647 * Notes:
648 * None
649 *
650 -------------------------------------------------------------------------------*/
651 BOOL DSPIdone(uint8_t SPIModule = DEFAULT_DSPI_MODULE);
652
653 // QSPI to DSPITranslation macros
654 // Translates QSPI calls to DSPI calls
655
656 inline uint8_t QSPIInit(uint32_t baudRateInBps = 2000000,
657 uint8_t transferSizeInBits = 8,
658 uint8_t peripheralChipSelects = 0x0F,
659 uint8_t chipSelectPolarity = 1,
660 uint8_t clockPolarity = 0,

NetBurner, Inc.
22.9 dspi.h File Reference 775

661 uint8_t clockPhase = 1,


662 BOOL doutHiz = TRUE,
663 uint8_t csToClockDelay = 0,
664 uint8_t delayAfterTransfer = 0)
665 {
666 return DSPIInit(DEFAULT_DSPI_MODULE, baudRateInBps, transferSizeInBits, peripheralChipSelects,
chipSelectPolarity, clockPolarity,
667 clockPhase, doutHiz, csToClockDelay, delayAfterTransfer);
668 }
669
670 inline uint8_t QSPIStart(puint8_t transmitBufferPtr, volatile uint8_t *receiveBufferPtr, uint32_t
byteCount, OS_SEM *finishedSem = NULL)
671 {
672 return DSPIStart(DEFAULT_DSPI_MODULE, transmitBufferPtr, receiveBufferPtr, byteCount, finishedSem);
673 }
674
675 inline BOOL QSPIdone()
676 {
677 return DSPIdone();
678 }
679
680 #endif /* ----- #ifndef _DMA_SPI_H_INC ----- */
681

22.9 dspi.h File Reference


NetBurner DMA SPI (DSPI) API for ARM SAME70 (MODM7AE70, SBE70LC)
#include <nbrtos.h>
#include <basictypes.h>
#include <xdmac.h>

Classes
• class SPIModule
SPI Peripheral Module Class.

Macros
• #define DSPI_OK ( 0 )
DSPI OK.
• #define DSPI_BUSY ( 1 )
DSPI Busy.
• #define DSPI_ERROR ( 2 )
DSPI Error.
• #define DEFAULT_DSPI_MODULE 0
Default DSPI module.
• #define DSPI_MODULE_COUNT 1
Number of modules: 0, 1.

Enumerations
• enum csReturnType {
DEASSERT_NEVER = 0 , DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 ,
DEASSERT_NEVER = 0 ,
DEASSERT_AFTER_LAST = 1 , DEASSERT_EVERY_TRANSFER = 2 }
Chip select deassertion modes. Used to determine when the driver should deassert chip selects during SPI transfer.
• enum spiChipSelect {
CHIP_SELECT_0 = 0 , CHIP_SELECT_1 = 1 , CHIP_SELECT_2 = 2 , CHIP_SELECT_3 = 3 ,
CHIP_SELECT_DISABLED = 0xFF , CHIP_SELECT_0 = 0xFE , CHIP_SELECT_1 = 0xFD , CHIP_SELECT_2
= 0xFB ,
CHIP_SELECT_3 = 0xF7 , CHIP_SELECT_DISABLED = 0xFF }
Chip select number.

NetBurner, Inc.
776 File Documentation

• enum spiChipSelectPolarity { CS_ASSERT_LOW = 0 , CS_ASSERT_HIGH = 1 , CS_ASSERT_LOW = 0x00


, CS_ASSERT_HIGH = 0xFF }
Chip select polarity.

Functions
• uint8_t DSPIInit (uint8_t SPIModule=DEFAULT_DSPI_MODULE, uint32_t Baudrate=2000000, uint8_←-
t QueueBitSize=8, uint8_t CS=0x00, uint8_t CSPol=0x0F, uint8_t ClkPolarity=0, uint8_t ClkPhase=1, BOOL
DoutHiz=TRUE, uint8_t QCD=0, uint8_t DTL=0)
Initialize a DSPI module.
• uint8_t DSPIStart (uint8_t SPIModule, puint8_t transmitBufferPtr, volatile uint8_t ∗receiveBuffer←-
Ptr, uint32_t byteCount, OS_SEM ∗finishedSem=NULL, uint8_t enableDMA=TRUE, int csReturnTo←-
Inactive=DEASSERT_AFTER_LAST)
Start a DSPI transfer.
• BOOL DSPIdone (uint8_t SPIModule=DEFAULT_DSPI_MODULE)
Check SPI status.
• uint8_t QSPIInit (uint32_t baudRateInBps=2000000, uint8_t transferSizeInBits=8, uint8_t peripheralChip←-
Selects=0x0F, uint8_t chipSelectPolarity=1, uint8_t clockPolarity=0, uint8_t clockPhase=1, BOOL dout←-
Hiz=TRUE, uint8_t csToClockDelay=0, uint8_t delayAfterTransfer=0)
Compatibility function for previous drivers. Initialize SPI module.
• uint8_t QSPIStart (puint8_t transmitBufferPtr, volatile uint8_t ∗receiveBufferPtr, uint32_t byteCount, OS_SEM
∗finishedSem=NULL)
Compatibility function for previous drivers. Start a SPI transfer.
• BOOL QSPIdone ()
Compatibility function for previous drivers. Check SPI status.

22.9.1 Detailed Description


NetBurner DMA SPI (DSPI) API for ARM SAME70 (MODM7AE70, SBE70LC)

22.10 cortex-m7/cpu/SAME70/include/dspi.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
19 #ifndef _DMA_SPI_H_INC
20 #define _DMA_SPI_H_INC
21
22 #include <nbrtos.h>
23 #include <basictypes.h>
24 #include <xdmac.h>
25
26 #ifndef __cplusplus
27 #error DSPI driver is a C++ only library
28 #endif
29
30 //#define __DEBUG_DSPI 1
31
38 #define DSPI_OK ( 0 )
39 #define DSPI_BUSY ( 1 )
40 #define DSPI_ERROR ( 2 )
48 #define DEFAULT_DSPI_MODULE 0
49 #define DSPI_MODULE_COUNT 1
59 enum csReturnType {
60 DEASSERT_NEVER = 0,
61 DEASSERT_AFTER_LAST = 1,
62 DEASSERT_EVERY_TRANSFER = 2
63 };
64
72 enum spiChipSelect {
73 CHIP_SELECT_0 = 0,
74 CHIP_SELECT_1 = 1,
75 CHIP_SELECT_2 = 2,
76 CHIP_SELECT_3 = 3,
77 CHIP_SELECT_DISABLED = 0xFF

NetBurner, Inc.
22.10 cortex-m7/cpu/SAME70/include/dspi.h 777

78 };
79
89 enum spiChipSelectPolarity {
90 CS_ASSERT_LOW = 0,
91 CS_ASSERT_HIGH = 1,
92 };
93
94 // * spiDriverStruct
95 //*
96 // * This structure contains the major variables/configurations used for a DSPI transfer
97 // *
98 // * volatile uint8_t* pDSPIRxbuf/pDSPITxbuf -
99 // * These pointers are used to track the locations in memory where data will be
100 // * read or written to the peripheral
101 // *
102 // * uint8_t BitsPerQueue This is the number if bits per transfer, (value = 8 - 32)
103 // * uint32_t DSPI_SizeLeft This is the number if bytes left in the transfer
104 // * uint16_t Command_Mask This is a partial configuration for the queue’s command reg
105 // * OS_SEM* DSPI_Sem This is a pointer to an external semaphore provided by DSPIStart()
106 // * uint8_t DSPI_INT_STATUS Status of the SPI device
107 // * uint32_t WordsToWrite Number of words to write to the command/TX Queues and Read from RX
108 // * uint32_t LastWordsToWrite the amount from the previous ISR
109
110 typedef struct
111 {
112 csReturnType csReturnToInactive;
113 volatile uint8_t SPI_INT_STATUS;
114 volatile BOOL SPIfinished;
115 XdmaCh_t *txCh;
116 XdmaCh_t *rxCh;
117 dma_descview_1 last_TxDesc; // descriptor setting the ’lastxfer’ transfer
118 dma_descview_1 last16_TxDesc; // descriptor setting the ’lastxfer’ transfer - 16bit
119 uint32_t last_cr; // buffer to allow DMA to set the ’lastxfer’ at completion
120 uint32_t lastTxISR;
121 uint32_t lastRxISR;
122 volatile uint8_t *rxBuf;
123 uint32_t rxLen;
124 } spiDriverStruct;
125
126 //uint8_t DSPIInit( uint8_t SPIModule, uint32_t Baudrate, uint8_t QueueBitSize, uint8_t CS,
127 // uint8_t CSPol, uint8_t ClkPolarity, uint8_t ClkPhase, BOOL DoutHiz, uint8_t QCD,
uint8_t DTL );
128
135 class SPIModule
136 {
137 public:
138 // static SPIModule *lastCtxs[DSPI_MODULE_COUNT];
139 // static spiDriverStruct driverCtx[DSPI_MODULE_COUNT];
140
141 protected:
142 static SPIModule *lastCtxs[DSPI_MODULE_COUNT];
143 static spiDriverStruct driverCtx[DSPI_MODULE_COUNT];
144
145 uint32_t m_moduleNum;
146 uint32_t m_regMR;
147 uint32_t m_regCSR;
148 OS_SEM *m_finishedSem;
149 uint32_t m_busSpeed;
150 uint8_t m_CSNum;
151 volatile bool m_inProgress;
152
153 virtual void ReadyHW();
154 virtual spiDriverStruct *getCtx() { return driverCtx + m_moduleNum; }
155 inline Spi * spi() { return SPI0 + m_moduleNum; }
156
157 public:
158
159 #ifdef __DEBUG_DSPI
160 virtual void dumpRegs();
161 #endif
162
171 SPIModule( uint8_t SPIModule );
172
190 SPIModule( uint8_t SPIModule, uint32_t baudRateInBps,
191 uint8_t transferSizeInBits = 8, uint8_t peripheralChipSelects = 0x00,
192 uint8_t chipSelectPolarity = 0x0F, uint8_t clockPolarity = 0,
193 uint8_t clockPhase = 1, BOOL doutHiz = TRUE,
194 uint8_t csToClockDelay = 0, uint8_t delayAfterTransfer = 0 );
195
211 virtual uint8_t Init( uint32_t baudRateInBps = 2000000,
212 uint8_t transferSizeInBits = 8, uint8_t peripheralChipSelects = 0x00,
213 uint8_t chipSelectPolarity = 0x0F, uint8_t clockPolarity = 0,
214 uint8_t clockPhase = 1, BOOL doutHiz = TRUE,
215 uint8_t csToClockDelay = 0, uint8_t delayAfterTransfer = 0 );
216
226 virtual uint32_t SetBusSpeed(uint32_t maxSpeed);
227

NetBurner, Inc.
778 File Documentation

247 virtual uint8_t Start( uint8_t *transmitBufferPtr, volatile uint8_t *receiveBufferPtr,


248 uint32_t byteCount, int csReturnToInactive = DEASSERT_AFTER_LAST );
249
259 virtual inline uint8_t Tx( uint8_t *transmitBufferPtr, uint32_t byteCount,
260 int csReturnToInactive = DEASSERT_AFTER_LAST )
261 { return Start(transmitBufferPtr, NULL, byteCount, csReturnToInactive); }
262
272 virtual inline uint8_t Rx( uint8_t *receiveBufferPtr, uint32_t byteCount,
273 int csReturnToInactive = DEASSERT_AFTER_LAST )
274 { return Start(NULL, receiveBufferPtr, byteCount, csReturnToInactive); }
275
276 // The SAME70 always uses DMA. These functions kept here for reference to other platforms
277 // bool EnableDMA(bool enableDMA = true);
278 // inline bool DisableDMA() { return EnableDMA(false); }
279
289 virtual bool RegisterSem( OS_SEM *finishedSem );
290
296 virtual inline bool ClrSem() { return RegisterSem(NULL); }
297
303 virtual inline OS_SEM * GetSem() { return m_finishedSem; }
304
312 virtual inline bool Done() { return !m_inProgress; }
313
323 static BOOL Done( uint8_t SPIModule );
324
333 virtual inline uint32_t GetActualBaudrate() { return m_busSpeed; }
334
342 virtual inline bool SetCS( uint8_t CS )
343 {
344 OSLockObj lock;
345 if (m_inProgress) { return false; }
346 m_regMR = (m_regMR & ~SPI_MR_PCS_Msk);
347 switch(CS)
348 {
349 case 0:
350 m_regMR |= SPI_MR_PCS(0xE);
351 break;
352 case 1:
353 m_regMR |= SPI_MR_PCS(0xD);
354 break;
355 case 2:
356 m_regMR |= SPI_MR_PCS(0xB);
357 break;
358 case 3:
359 m_regMR |= SPI_MR_PCS(0x7);
360 break;
361 default:
362 m_regMR |= SPI_MR_PCS(0xF);
363 }
364
365
366 return true;
367 }
368
369 // The ISR used by the DSPI driver. Internal use only (dspi.cpp).
370 friend void SPI_DMA_Isr(XdmaCh_t *dma, int module);
371 };
372
373 typedef SPIModule DSPIModule;
374 typedef SPIModule SPI_SPI;
375
405 uint8_t DSPIInit( uint8_t SPIModule = DEFAULT_DSPI_MODULE, uint32_t Baudrate = 2000000,
406 uint8_t QueueBitSize = 8, uint8_t CS = 0x00,
407 uint8_t CSPol = 0x0F, uint8_t ClkPolarity = 0,
408 uint8_t ClkPhase = 1, BOOL DoutHiz = TRUE,
409 uint8_t QCD = 0, uint8_t DTL = 0 );
410 // Note: csToClockDelay: 0 default is 17/(system clock / 2), in keeping with interface to QSPI
411
412
435 uint8_t DSPIStart( uint8_t SPIModule, puint8_t transmitBufferPtr, volatile uint8_t* receiveBufferPtr,
436 uint32_t byteCount, OS_SEM* finishedSem = NULL, uint8_t enableDMA = TRUE,
437 int csReturnToInactive = DEASSERT_AFTER_LAST );
438
444 BOOL DSPIdone( uint8_t SPIModule = DEFAULT_DSPI_MODULE );
445
446 // QSPI to DSPI Translation macros. Note that the ’Q’ stands for Queued SPI
447
476 inline uint8_t QSPIInit( uint32_t baudRateInBps = 2000000, uint8_t transferSizeInBits = 8,
477 uint8_t peripheralChipSelects = 0x0F, uint8_t chipSelectPolarity = 1,
478 uint8_t clockPolarity = 0, uint8_t clockPhase = 1, BOOL doutHiz = TRUE,
479 uint8_t csToClockDelay = 0, uint8_t delayAfterTransfer = 0 )
480 {
481 return DSPIInit( DEFAULT_DSPI_MODULE, baudRateInBps, transferSizeInBits,
482 peripheralChipSelects, chipSelectPolarity, clockPolarity, clockPhase,
483 doutHiz, csToClockDelay, delayAfterTransfer );
484 }
485

NetBurner, Inc.
22.11 ebi.h File Reference 779

507 inline uint8_t QSPIStart( puint8_t transmitBufferPtr, volatile uint8_t* receiveBufferPtr,


508 uint32_t byteCount, OS_SEM* finishedSem = NULL )
509 {
510 return DSPIStart( DEFAULT_DSPI_MODULE, transmitBufferPtr, receiveBufferPtr, byteCount, finishedSem
);
511 }
512
520 inline BOOL QSPIdone()
521 {
522 return DSPIdone();
523 }
524
525 #endif /* ----- #ifndef _DMA_SPI_H_INC ----- */
526

22.11 ebi.h File Reference


External Bus Interface (EBI) Header File.
#include <predef.h>
#include <stdint.h>

Classes
• struct EBI_CS_cfg_t
Configuration structure for an External Bus Interface (EBI) chip select.

Enumerations
• enum EBI_CS_BusWidth_t { EBI_BUS_WIDTH_8 = 0 , EBI_BUS_WIDTH_16 = 1 }
• enum EBI_CS_ByteAccess_t { EBI_BYTE_ACCESS_SELECT = 0 , EBI_BYTE_ACCESS_WRITE = 1 }
• enum EBI_CS_NWait_t { EBI_NWAIT_DISABLED = 0 , EBI_NWAIT_FROZEN = 2 , EBI_NWAIT_READY =
3}
• enum EBI_CS_WrMode_t
• enum EBI_CS_RdMode_t

Functions
• void ConfigureEBI_CSPin (int csNum)
Configure the I/O pin for a given Chip Select for the external data bus.
• void ConfigureEBI_NWRPin ()
Configure the I/O pin for the active low write/read (NWR) bus signal.
• void ConfigureEBI_NRDPin ()
Configure the I/O pin for the active low read (NRD) bus signal.
• void ConfigureEBI_CS (uint32_t csNum, const EBI_CS_cfg_t &&cfg)
Configure the given Chip Select for the external data bus.
• void ConfigureEBI_CS (uint32_t csNum, const EBI_CS_cfg_t &cfg)
Configure the given Chip Select for the external data bus.

22.11.1 Detailed Description


External Bus Interface (EBI) Header File.

22.12 ebi.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
88 #ifndef __EBI_H

NetBurner, Inc.
780 File Documentation

89 #define __EBI_H
90 #include <predef.h>
91 #include <stdint.h>
92
97 void ConfigureEBI_CSPin(int csNum);
98
102 void ConfigureEBI_NWRPin();
103
107 void ConfigureEBI_NRDPin();
108
112 enum EBI_CS_BusWidth_t {
113 EBI_BUS_WIDTH_8 = 0,
114 EBI_BUS_WIDTH_16 = 1,
115 };
116
120 enum EBI_CS_ByteAccess_t {
121 EBI_BYTE_ACCESS_SELECT = 0,
122 EBI_BYTE_ACCESS_WRITE = 1,
123 };
124
135 enum EBI_CS_NWait_t {
136 EBI_NWAIT_DISABLED = 0,
137 EBI_NWAIT_FROZEN = 2,
138 EBI_NWAIT_READY = 3,
139 };
140
144 enum EBI_CS_WrMode_t {
145 EBI_WRITE_MODE_NCS = 0,
146 EBI_WRITE_MODE_NWE = 1,
147 };
148
152 enum EBI_CS_RdMode_t {
153 EBI_READ_MODE_NCS = 0,
154 EBI_READ_MODE_NRD = 1,
155 };
156
208 struct EBI_CS_cfg_t {
209 uint8_t ncs_rd_setup;
210 uint8_t nrd_setup;
211 uint8_t ncs_wr_setup;
212 uint8_t nwe_setup;
213
214 uint8_t ncs_rd_pulse;
215 uint8_t nrd_pulse;
216 uint8_t ncs_wr_pulse;
217 uint8_t nwe_pulse;
218
219 uint16_t nrd_cycles;
220 uint16_t nwe_cycles;
221
222 uint8_t tdf_cycles;
223 EBI_CS_BusWidth_t busWidth;
224 EBI_CS_ByteAccess_t byteAccess;
225 EBI_CS_NWait_t nWait;
226 EBI_CS_WrMode_t wrMode;
227 EBI_CS_RdMode_t rdMode;
228 };
229
236 void ConfigureEBI_CS(uint32_t csNum, const EBI_CS_cfg_t &&cfg);
237
244 void ConfigureEBI_CS(uint32_t csNum, const EBI_CS_cfg_t &cfg);
245
246 #endif /* ----- #ifndef __EBI_H ----- */
247
248

22.13 i2c.h File Reference


NetBurner I2C API for ARM SAME70.
#include <predef.h>
#include <ctype.h>
#include <sim.h>
#include <nbrtos.h>

Classes
• class WireIntf
Wire Interface Class for I2C.

NetBurner, Inc.
22.14 i2c.h 781

• class I2C
I2C Peripheral Class.
• class I2CDevice
I2C Device Class (recommended)

22.13.1 Detailed Description


NetBurner I2C API for ARM SAME70.

22.14 i2c.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
20 #ifndef __I2C_H
21 #define __I2C_H
22
23 #include <predef.h>
24 #include <ctype.h>
25 #include <sim.h>
26 #include <nbrtos.h>
27
28
29 #define TWIHS_SR_IOS (TWIHS_SR_SCL | TWIHS_SR_SDA)
30
31 struct I2CTxn_t {
32 uint8_t *buf;
33 uint32_t blen;
34 uint8_t regAddr[3];
35 uint8_t devAddr : 7;
36 bool RnW : 1;
37 uint8_t regAddrLen : 3;
38 bool bIssueStop : 1;
39
40 void dump(uint32_t line);
41 };
42
43 class I2C;
44
45
46 /*-------------------------------------------------------------------------------------------------
47 * Wire Interface Class
48 *------------------------------------------------------------------------------------------------*/
49
61 class WireIntf {
62 I2C &i2c; // I2C instance of this wire interface
63 uint8_t txnBuf[128]; // Transaction buffer. Build up transaction before being flushed to the I2C
bus
64 uint8_t txnLen; // Current transaction length
65 uint8_t devAddr; // I2C slave device adddress to be accessed
66 uint8_t bytesRead; // Number of bytes read, returned by requestFrom(). Provides number of bytes
available to read()
67 uint8_t readIdx; // Read index. Location in the transaction buffer of next byte to be read
68 bool bTxnStarted; // Whether or not the wire interface is in an active transaction
69 bool bBusStarted; // Whether or not the bus is active (h/w signal state)
70
71 public:
72 WireIntf(I2C &module);
73
79 void begin();
80
94 uint32_t requestFrom(uint8_t addr, uint32_t len, bool stop = true);
95
103 void beginTransmission(uint8_t addr);
104
115 void endTransmission(bool stop = true);
116
127 uint32_t write(uint8_t dat);
128
139 uint32_t write(char * str);
140
151 uint32_t write(uint8_t * buf, uint32_t len);
152
160 uint32_t available();
161
168 uint8_t read();
169
181 void flush(bool bIssueStop = false);

NetBurner, Inc.
782 File Documentation

182 };
183
184
185 /*
186 * I2C WireIntf objects instantiated by the system.
187 *
188 * Provides access to the all the I2C peripherals on the processor. The I2C peripherals available will
vary by platform.
189 * For example, Wire.read(); will exectute a read opeeration on I2C module 0.
190 */
191 extern WireIntf Wire; // I2C module 0
192 extern WireIntf Wire1; // I2C module 1
193 extern WireIntf Wire2; // I2C module 2
194
195
196
197 /*-------------------------------------------------------------------------------------------------
198 * I2C Class
199 *------------------------------------------------------------------------------------------------*/
200
212 class I2C {
213 public:
218 enum Result_t {
219 I2C_RES_ACK,
220 I2C_RES_NACK,
221 I2C_RES_ARB_LST,
222 I2C_RES_BUSY,
223 I2C_RES_ARG
224 };
227 private:
228 enum TxnStat {
229 TXN_RDY,
230 TXN_IN_PROGRESS,
231 TXN_WAITING
232 };
233
234 Twihs &twi;
235 int modNum;
236 TxnStat txnStatus;
237 Result_t txnResult;
238 uint32_t sticky_sr;
239 uint8_t iadrAddressSize; // Number of address register bytes, 0 - 3
240
241 volatile I2CTxn_t *pTxn;
242 OS_SEM txnSem;
243
244 void isr();
245 void isr_rx(uint32_t sr);
246 void isr_tx(uint32_t sr);
247
248 inline uint32_t getStatus()
249 { uint32_t sr = twi.TWIHS_SR; sticky_sr |= sr; return sr; }
250 inline uint32_t getStickyStatus()
251 { uint32_t sr = twi.TWIHS_SR; sticky_sr |= sr; return sticky_sr; }
252 inline void clrStickyStatus() { sticky_sr = 0; }
253
254 inline bool busBusy()
255 { return ((getStatus() & TWIHS_SR_IOS) != TWIHS_SR_IOS); }
256
257 void start(uint8_t deviceAddr, bool rnw, uint8_t regAddrlen = 0, bool bIssueStop = false);
258 void restart(uint8_t deviceAddr, bool rnw, uint8_t regAddrlen = 0, bool bIssueStop = false);
259 void stop();
260
261 Result_t write8(uint8_t dat);
262 Result_t read8(uint8_t &dat);
263
264 public:
271 I2C(int module);
272
273 // Copy constructor
274 I2C(const I2C & rhs)
275 : twi(rhs.twi), modNum(rhs.modNum), txnStatus(rhs.txnStatus)
276 {}
277
284 void setup(uint32_t busSpeed);
285
290 void resetBus();
291
303 Result_t DoTransaction(I2CTxn_t *pTransaction, bool bRepeatedStart = false);
304
319 inline void setNumAddressBytes(uint8_t numAddressBytes = 1) { iadrAddressSize = numAddressBytes; }
320
330 Result_t writeReg8(uint8_t devAddr, uint32_t reg, uint8_t data);
331
341 Result_t readReg8(uint8_t devAddr, uint32_t reg, uint8_t &data);
342
357 Result_t writeRegN(uint8_t devAddr, uint32_t reg, const uint8_t *buf, uint32_t blen);

NetBurner, Inc.
22.14 i2c.h 783

358
369 Result_t readRegN(uint8_t devAddr, uint32_t reg, uint8_t *buf, uint32_t blen);
370
371 // Static implementations of the C++ class that can be used if you prefer a C style interface
372 static Result_t writeReg8(int module, uint8_t devAddr, uint32_t reg, uint8_t dat);
373 static Result_t readReg8(int module, uint8_t devAddr, uint32_t reg, uint8_t &dat);
374 static Result_t writeRegN(int module, uint8_t devAddr, uint32_t reg, const uint8_t *buf, uint32_t
blen);
375 static Result_t readRegN(int module, uint8_t devAddr, uint32_t reg, uint8_t *buf, uint32_t blen);
376
377 // These functions are for internal use only.
378 void dump(uint32_t line);
379 friend void TWIHS0_Handler();
380 friend void TWIHS1_Handler();
381 friend void TWIHS2_Handler();
382
383 friend class WireIntf;
384
385 }; // end class I2C
386
387
388 // I2C instantions exist for all I2C (TWIHS) peripherals. They are accessed as array: i2c[0], i2c[1],
i2c[2]
389 extern I2C i2c[];
390
391 inline I2C::Result_t I2C::writeReg8(int module, uint8_t devAddr, uint32_t reg, uint8_t dat)
392 {
393 if (module < 0) { return I2C_RES_NACK; }
394 if (module > 2) { return I2C_RES_NACK; }
395 return i2c[module].writeReg8(devAddr, reg, dat);
396 }
397
398 inline I2C::Result_t I2C::readReg8(int module, uint8_t devAddr, uint32_t reg, uint8_t &dat)
399 {
400 if (module < 0) { return I2C_RES_NACK; }
401 if (module > 2) { return I2C_RES_NACK; }
402 return i2c[module].readReg8(devAddr, reg, dat);
403 }
404
405 inline I2C::Result_t I2C::writeRegN(int module, uint8_t devAddr, uint32_t reg, const uint8_t *buf,
uint32_t blen)
406 {
407 if (module < 0) { return I2C_RES_NACK; }
408 if (module > 2) { return I2C_RES_NACK; }
409 return i2c[module].writeRegN(devAddr, reg, buf, blen);
410 }
411 inline I2C::Result_t I2C::readRegN(int module, uint8_t devAddr, uint32_t reg, uint8_t *buf, uint32_t
blen)
412 {
413 if (module < 0) { return I2C_RES_NACK; }
414 if (module > 2) { return I2C_RES_NACK; }
415 return i2c[module].readRegN(devAddr, reg, buf, blen);
416 }
417
418
419 /*-------------------------------------------------------------------------------------------------
420 * I2C Device Class
421 *------------------------------------------------------------------------------------------------*/
438 class I2CDevice {
439
440 private:
441 I2C *pI2CInterface; // Pointer to I2C class object for peripheral/interface
442 uint8_t devAddress; // I2C device address, 1 byte, 1 to 127
443 uint8_t numRegAddrBytes; // Number of register address bytes to send to device, 0 to 3
444
445 public:
446
461 inline I2CDevice(I2C & pInterface, uint8_t deviceAddress, uint8_t numAddressBytes = 1)
462 {
463 pI2CInterface = &pInterface; // Pointer to the I2C peripheral module object
464 devAddress = deviceAddress; // Device I2C address
465 numRegAddrBytes = numAddressBytes; // Number of bytes to send for register address: 0 - 3
466 }
467
480 inline uint8_t getI2CAddress() { return devAddress; }
481
482
489 inline void setup(uint32_t busSpeed);
490
495 inline void resetBus();
496
497
506 inline I2C::Result_t writeReg8(uint32_t reg, uint8_t data)
507 {
508 pI2CInterface->setNumAddressBytes(numRegAddrBytes);
509 return pI2CInterface->writeReg8(devAddress, reg, data);
510 }

NetBurner, Inc.
784 File Documentation

511
520 inline I2C::Result_t readReg8(uint32_t reg, uint8_t &data)
521 {
522 pI2CInterface->setNumAddressBytes(numRegAddrBytes);
523 return pI2CInterface->readReg8(devAddress, reg, data);
524 }
525
539 inline I2C::Result_t writeRegN(uint32_t reg, const uint8_t *buf, uint32_t blen)
540 {
541 pI2CInterface->setNumAddressBytes(numRegAddrBytes);
542 return pI2CInterface->writeRegN(devAddress, reg, buf, blen);
543 }
544
554 inline I2C::Result_t readRegN(uint32_t reg, uint8_t *buf, uint32_t blen)
555 {
556 pI2CInterface->setNumAddressBytes(numRegAddrBytes);
557 return pI2CInterface->readRegN(devAddress, reg, buf, blen);
558 }
559 };
560
561
562
563 #endif /* ----- #ifndef __I2C_H ----- */
564

22.15 mcan.h File Reference


SAM Control Area Network (MCAN) Low Level Driver.
#include <conf_mcan.h>
#include <mcan_internal.h>

Classes
• class mcanMODM7AE70::mcan_module
MCAN Module Class.
• class mcanMODM7AE70::mcan_config
MCAN configuration structure.
• class mcanMODM7AE70::CanRxMessage
Class to hold received CAN messages.

Namespaces
• namespace mcanMODM7AE70
mcanMODM7AE70 namespace

Macros
• #define CAN_DATA_STORE_SIZE (512)
Receive OS_FIFO Buffer Size.

Variables
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_FIFO_0_NUM = 32
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_FIFO_1_NUM = 0
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_BUFFER_NUM = 0
• const uint32_t mcanMODM7AE70::CONF_MCAN_TX_BUFFER_NUM = 8
• const uint32_t mcanMODM7AE70::CONF_MCAN_TX_FIFO_QUEUE_NUM = 0
• const uint32_t mcanMODM7AE70::CONF_MCAN_TX_EVENT_FIFO = 8
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_STANDARD_ID_FILTER_NUM = 32
• const uint32_t mcanMODM7AE70::CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM = 32

NetBurner, Inc.
22.16 mcan.h 785

22.15.1 Detailed Description


SAM Control Area Network (MCAN) Low Level Driver.
This driver derived from
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
asf_license_start

22.16 mcan.h
Go to the documentation of this file.
1
36 /*
37 * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
38 */
39
40 #ifndef MCAN_H_INCLUDED
41 #define MCAN_H_INCLUDED
42
43 #include <conf_mcan.h>
44 #include <mcan_internal.h>
45
46 #ifdef DOXYGEN_STUFF
50 namespace mcanMODM7AE70
51 {
52 #endif
53
63 #define SAME70B 1
64
65
67 const uint32_t CONF_MCAN_RX_FIFO_0_NUM = 32; //16
69 const uint32_t CONF_MCAN_RX_FIFO_1_NUM = 0; //16
71 const uint32_t CONF_MCAN_RX_BUFFER_NUM = 0; //16
73 const uint32_t CONF_MCAN_TX_BUFFER_NUM = 8; // 4
75 const uint32_t CONF_MCAN_TX_FIFO_QUEUE_NUM = 0; // 4
77 const uint32_t CONF_MCAN_TX_EVENT_FIFO = 8; // 8
79 const uint32_t CONF_MCAN_RX_STANDARD_ID_FILTER_NUM = 32; //32
81 const uint32_t CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM = 32; //16
82
83
84 /****************WARNING **********************/
85 /* This is added to
86 CONF_MCAN_RX_STANDARD_ID_FILTER_NUM
87 and
88 CONF_MCAN_RX_EXTENDED_ID_FILTER_NUMc
89 and
90 CONF_MCAN_TX_BUFFER_NUM
91
92 and the limits above must be ok with the added values.
93 */
94 const uint32_t CONF_MCAN_RTR_CHANNELS = 8;
95
96
103 class mcan_module
104 {
105 private:
106 Mcan *hw;
107 uint32_t TxBufferIndex;
108 OS_SEM TxSem;
109 volatile uint32_t standard_receive_index = 0;
110 volatile uint32_t extended_receive_index = 0;
111
112 __attribute__((__aligned__(0x0800)))
113 struct mcan_rx_element_buffer mcan_rx_buffer[CONF_MCAN_RX_BUFFER_NUM];
114 struct mcan_rx_element_buffer mcan_rx_fifo_0[CONF_MCAN_RX_FIFO_0_NUM];
115 struct mcan_rx_element_buffer mcan_rx_fifo_1[CONF_MCAN_RX_FIFO_1_NUM];
116 struct mcan_tx_element mcan_tx_buffer[CONF_MCAN_TX_BUFFER_NUM +
CONF_MCAN_TX_FIFO_QUEUE_NUM+CONF_MCAN_RTR_CHANNELS];
117 struct mcan_tx_event_element mcan_tx_event_fifo[CONF_MCAN_TX_EVENT_FIFO+CONF_MCAN_RTR_CHANNELS];
118 struct mcan_standard_message_filter_element
mcan_rx_standard_filter[CONF_MCAN_RX_STANDARD_ID_FILTER_NUM+CONF_MCAN_RTR_CHANNELS];
119 struct mcan_extended_message_filter_element
mcan_rx_extended_filter[CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM+CONF_MCAN_RTR_CHANNELS];
120
121 tx_record mcan_tx_record[CONF_MCAN_TX_BUFFER_NUM];
122
123 OS_FIFO * Extended_Fifos[CONF_MCAN_RX_EXTENDED_ID_FILTER_NUM];
124 OS_FIFO * Standard_Fifos[CONF_MCAN_RX_STANDARD_ID_FILTER_NUM];
125
126 void enable_peripheral_clock();
127 void message_memory_init();
128 void set_configuration(struct mcan_config *config);
129 void clean_up_pending_tx();

NetBurner, Inc.
786 File Documentation

130
131 void process_isr(void);
132
133 void PushToFifo(mcan_rx_element_buffer * pBuffer, OS_FIFO * pFifo);
134 void ack_tx(uint32_t index);
135 void process_rx(mcan_rx_element_buffer * pBuffer);
136
137 static mcan_module * this_Ref[2];
138 static inline void dispatch_isr(int n) {if(this_Ref[n]) this_Ref[n]->process_isr(); };
139 friend void MCAN0_Handler( void );
140 friend void MCAN1_Handler( void );
141
142 void set_baudrate(uint32_t baudrate);
143 void fd_set_baudrate(uint32_t baudrate);
144 void start();
145 void stop();
146 void enable_fd_mode();
147 void disable_fd_mode();
148 void enable_restricted_operation_mode();
149 void disable_restricted_operation_mode();
150 void enable_bus_monitor_mode();
151 void disable_bus_monitor_mode();
152 void enable_sleep_mode();
153 void disable_sleep_mode();
154 void enable_test_mode();
155 void disable_test_mode();
156 enum status_code set_rx_standard_filter(struct mcan_standard_message_filter_element *sd_filter,
uint32_t index);
157 enum status_code set_rx_extended_filter(struct mcan_extended_message_filter_element *et_filter,
uint32_t index);
158 enum status_code get_rx_buffer_element (struct mcan_rx_element_buffer *rx_element, uint32_t
index);
159 enum status_code get_rx_fifo_0_element (struct mcan_rx_element_buffer *rx_element, uint32_t
index);
160 enum status_code get_rx_fifo_1_element (struct mcan_rx_element_buffer *rx_element, uint32_t
index);
161 enum status_code set_tx_buffer_element (struct mcan_tx_element *tx_element, uint32_t index);
162 enum status_code get_tx_event_fifo_element(struct mcan_tx_event_element *tx_event_element,
uint32_t index);
163
171 inline uint16_t read_timestamp_count_value(){return hw->MCAN_TSCV;};
172
180 inline uint16_t read_timeout_count_value(){return hw->MCAN_TOCV;};
181
189 inline uint32_t read_error_count(){return hw->MCAN_ECR;};
190
198 inline uint32_t read_protocal_status(){ return hw->MCAN_PSR;};
199
207 inline uint32_t read_high_priority_message_status(){return hw->MCAN_HPMS;}
208
220 inline bool rx_get_buffer_status(uint32_t index)
221 {
222 if (index < 32)
223 {
224 if (hw->MCAN_NDAT1 & (1 « index))
225 {
226 return true;
227 } else
228 {
229 return false;
230 }
231 } else
232 {
233 index -= 32;
234 if (hw->MCAN_NDAT2 & (1 « index))
235 {
236 return true;
237 } else
238 {
239 return false;
240 }
241 }
242 };
243
250 inline void rx_clear_buffer_status(uint32_t index)
251 {
252 if (index < 32)
253 {
254 hw->MCAN_NDAT1 = (1 « index);
255 } else
256 {
257 index -= 32;
258 hw->MCAN_NDAT2 = (1 « index);
259 }
260 }
261
270 inline uint32_t rx_get_fifo_status(bool fifo_number)

NetBurner, Inc.
22.16 mcan.h 787

271 {
272 if (!fifo_number)
273 {
274 return hw->MCAN_RXF0S;
275 } else
276 {
277 return hw->MCAN_RXF1S;
278 }
279 }
280
288 inline void rx_fifo_acknowledge(bool fifo_number, uint32_t index)
289 {
290 if (!fifo_number)
291 {
292 hw->MCAN_RXF0A = MCAN_RXF0A_F0AI(index);
293 } else
294 {
295 hw->MCAN_RXF1A = MCAN_RXF1A_F1AI(index);
296 }
297 }
298
306 inline uint32_t tx_get_fifo_queue_status()
307 {
308 return hw->MCAN_TXFQS;
309 }
310
318 inline uint32_t tx_get_pending_status()
319 {
320 return hw->MCAN_TXBRP;
321 }
322
334 inline enum status_code tx_transfer_request( uint32_t trig_mask)
335 {
336 if (hw->MCAN_CCCR & MCAN_CCCR_CCE)
337 {
338 return ERR_BUSY;
339 }
340 hw->MCAN_TXBAR = trig_mask;
341 return STATUS_OK;
342 }
343
355 inline enum status_code tx_cancel_request( uint32_t trig_mask)
356 {
357 if (hw->MCAN_CCCR & MCAN_CCCR_CCE)
358 {
359 return STATUS_ERR_BUSY;
360 }
361 hw->MCAN_TXBCR = trig_mask;
362 return STATUS_OK;
363 }
364
372 inline uint32_t tx_get_transmission_status()
373 {
374 return hw->MCAN_TXBTO;
375 }
376
384 inline uint32_t tx_get_cancellation_status()
385 {
386 return hw->MCAN_TXBCF;
387 }
388
396 inline uint32_t tx_get_event_fifo_status()
397 {
398 return hw->MCAN_TXEFS;
399 }
400
407 inline void tx_event_fifo_acknowledge( uint32_t index)
408 {
409 hw->MCAN_TXEFA = MCAN_TXEFA_EFAI(index);
410 }
411
412
413
420 inline void enable_interrupt(const enum mcan_interrupt_source source)
421 {
422 hw->MCAN_IE |= source;
423 }
424
431 inline void disable_interrupt(const enum mcan_interrupt_source source)
432 {
433 hw->MCAN_IE &= ~source;
434 }
435
441 inline uint32_t read_interrupt_status()
442 {
443 return hw->MCAN_IR;
444 }

NetBurner, Inc.
788 File Documentation

445
454 inline void clear_interrupt_status(const enum mcan_interrupt_source source)
455 {
456 hw->MCAN_IR = source;
457 }
458
459
460 public:
468 mcan_module(Mcan *hw, uint32_t baud);
469
470 mcan_module(){};
471
472 void init(Mcan *hw,struct mcan_config *config, uint32_t baud);
473
483 void send_message(uint32_t id_value, uint8_t *data,uint32_t data_length, OS_SEM * pSem=0);
484
494 bool blocking_send_message(uint32_t id_value, uint8_t *data,uint32_t data_length,uint32_t
TimeOut);
495
496
506 int RegisterRxFifo(uint32_t composite_id, OS_FIFO *pFifo, int channel = -1 );
507
512 int RegisterRxFifoMask(uint32_t composite_id, uint32_t mask, OS_FIFO *pFifo, int channel = -1 );
513
517 int RegisterRxFifoRange(uint32_t composite_id_low,uint32_t composite_id_hi, OS_FIFO *pFifo, int
channel = -1 );
518
522 int UnRegisterFifo(int channel );
523
534 int MultiCanSetRTRMessage(uint32_t id, uint8_t *data, uint8_t len, int channel = -1 );
535
543 int MultiCanReplaceRTRMessage(int channel, uint8_t *data, uint8_t len );
544
550 int MultiCanStopRTRMessage(int channel );
551
552 // Toggle the TX line hi/low and print the result of the RX line.
553 void IOTest();
554
555 }; // end class mcan_module
556
557
558
559
560
561
562 /* The single bit used by this API to indicate an extended ID */
563 #define CAN_EXTENDED_ID_BIT (0x20000000)
564
565 /* This macro takes and id and returs an ID that is guarenteed to be treated as an extended ID by the
system
566 * Make an id that is extended from either extended or normal
567 */
568 #define ExtToNbId(id ) (id | CAN_EXTENDED_ID_BIT)
569
570 /* Make Normal Id make an ID set from a normal id in the range 0 to 2048 */
571 #define NormToNbId(id) (id & 0x7ff)
572
573 /* Is the ID extended ? returns non zero if the id passed in was an extended ID */
574 #define IsNBIdExt(id) ( (id & CAN_EXTENDED_ID_BIT)!=0)
575
576 /* Strip the extra flag remove the API extended flage from the ID */
577 #define NbToExtId(id) (id & 0x1FFFFFFF)
578
579 /* Shift a Normal ID so it hase value 0 to 1023. Some CAN systems will treat normal ID’s as an integer
from 0 to 2048
580 * Other systems may treat normal ID’s as 28 bit values where the bottom 17 bits are zero. This MACRO
will convert our
581 * Normal ID format into the 0 to 2048 format.
582 */
583 #define NbToNormId(id) (id & 0x7FF)
584
585
586
587
595 class mcan_config
596 {
597 public:
599 bool run_in_standby;
601 uint8_t watchdog_configuration;
603 bool transmit_pause;
605 bool edge_filtering;
607 bool protocol_exception_handling;
609 bool automatic_retransmission;
611 bool clock_stop_request;
613 bool clock_stop_acknowledge;
615 uint8_t timestamp_prescaler;
617 uint16_t timeout_period;

NetBurner, Inc.
22.16 mcan.h 789

619 enum mcan_timeout_mode timeout_mode;


621 bool timeout_enable;
623 bool tdc_enable;
625 uint8_t delay_compensation_offset;
627 uint8_t delay_compensation_filter_window_length;
629 enum mcan_nonmatching_frames_action nonmatching_frames_action_standard;
631 enum mcan_nonmatching_frames_action nonmatching_frames_action_extended;
633 bool remote_frames_standard_reject;
635 bool remote_frames_extended_reject;
637 uint32_t extended_id_mask;
639 bool rx_fifo_0_overwrite;
641 uint8_t rx_fifo_0_watermark;
643 bool rx_fifo_1_overwrite;
645 uint8_t rx_fifo_1_watermark;
647 bool tx_queue_mode;
649 uint8_t tx_event_fifo_watermark;
650
686 inline void set_config_defaults()
687 {
688
689 /* Default configuration values */
690 run_in_standby = false;
691 watchdog_configuration = 0x00;
692 transmit_pause = true;
693 edge_filtering = true;
694 protocol_exception_handling = true;
695 automatic_retransmission = true; //was true
696 clock_stop_request = false;
697 clock_stop_acknowledge = false;
698 timestamp_prescaler = 0;
699 timeout_period = 0xFFFF;
700 timeout_mode = MCAN_TIMEOUT_CONTINUES;
701 timeout_enable = false;
702 tdc_enable = false;
703 delay_compensation_offset = 0;
704 delay_compensation_filter_window_length = 0;
705 nonmatching_frames_action_standard = MCAN_NONMATCHING_FRAMES_REJECT;
706 nonmatching_frames_action_extended = MCAN_NONMATCHING_FRAMES_REJECT;
707 remote_frames_standard_reject = false;
708 remote_frames_extended_reject = false;
709 extended_id_mask = 0x1FFFFFFF;
710 rx_fifo_0_overwrite = true;
711 rx_fifo_0_watermark = 0;
712 rx_fifo_1_overwrite = true;
713 rx_fifo_1_watermark = 0;
714 tx_queue_mode = false;
715 tx_event_fifo_watermark = 0;
716 }
717
718 }; // end mcan_config class
719
720
721
725 #define CAN_DATA_STORE_SIZE (512)
726
727 struct PrivateCanData;
728
732 class CanRxMessage
733 {
734 private:
735 PrivateCanData *pData;
736 /* Private constructor used for received frames */
737 CanRxMessage( PrivateCanData *pData );
738
739 public:
743 uint8_t GetLength();
744
753 uint8_t CopyData( uint8_t *buffer, uint8_t max_len );
754
761 const uint8_t * GetData();
762
766 uint32_t GetId();
767
771 uint16_t GetTimeStamp();
772
779 BOOL IsValid();
780
781 /* Constructors */
782
793 CanRxMessage( OS_FIFO *pFifo, uint32_t timeout = WAIT_FOREVER );
794
798 ~CanRxMessage();
799
808 BOOL GetNewMessage( OS_FIFO *pFifo, uint32_t timeout = WAIT_FOREVER );
809 };
810
811

NetBurner, Inc.
790 File Documentation

814 #ifdef DOXYGEN_STUFF


815 } // namespace
816 #endif
817
818
819 #endif /* MCAN_H_INCLUDED */
820
821
822

22.17 quadspi.h File Reference


NetBurner DMA Quad SPI (QSPI) API for ARM SAME70 (MODM7AE70)
#include <nbrtos.h>
#include <basictypes.h>
#include <xdmac.h>
#include <dspi.h>

Classes
• class SPI_QSPI
The Single-Bit SPI mode QSPI Peripheral Class.

Macros
• #define DEFAULT_QUADSPI_MODULE 0
Default QUADSPI module.
• #define QUADSPI_MODULE_COUNT 1
Number of modules: 0, 1.

22.17.1 Detailed Description


NetBurner DMA Quad SPI (QSPI) API for ARM SAME70 (MODM7AE70)

22.18 quadspi.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
19 #ifndef _DMA_QUADSPI_H_INC
20 #define _DMA_QUADSPI_H_INC
21
22 #include <nbrtos.h>
23 #include <basictypes.h>
24 #include <xdmac.h>
25 #include <dspi.h>
26
27 #ifndef __cplusplus
28 #error QuadSPI driver is a C++ only library
29 #endif
30
31 // #define __DEBUG_QUADSPI 1
32
33
39 #define DEFAULT_QUADSPI_MODULE 0
40 #define QUADSPI_MODULE_COUNT 1
49 class SPI_QSPI : public SPI_SPI
50 {
51 protected:
52 static SPI_QSPI *lastQuadSPICtxs[QUADSPI_MODULE_COUNT];
53 static spiDriverStruct QuadSPIDriverCtx[QUADSPI_MODULE_COUNT];
54
55 private:
56 uint32_t m_regSCR;
57
58 virtual void ReadyHW() override;

NetBurner, Inc.
22.18 quadspi.h 791

59 virtual spiDriverStruct *getCtx() override { return QuadSPIDriverCtx + m_moduleNum; }


60 inline Qspi * quadSpi() { return QSPI + m_moduleNum; }
61
62 public:
63
64 #ifdef __DEBUG_QUADSPI
65 virtual void dumpRegs() override;
66 #endif
67
68
77 SPI_QSPI( uint8_t QuadSPIModule = DEFAULT_QUADSPI_MODULE);
78
99 SPI_QSPI( uint8_t QuadSPIModule, uint32_t baudRateInBps,
100 uint8_t transferSizeInBits = 8, uint8_t peripheralChipSelects = 0x00,
101 uint8_t chipSelectPolarity = 0x0F, uint8_t clockPolarity = 0,
102 uint8_t clockPhase = 1, BOOL doutHiz = TRUE,
103 uint8_t csToClockDelay = 0, uint8_t delayAfterTransfer = 0 );
104
123 virtual uint8_t Init( uint32_t baudRateInBps = 2000000,
124 uint8_t transferSizeInBits = 8, uint8_t peripheralChipSelects = 0x00,
125 uint8_t chipSelectPolarity = 0x0F, uint8_t clockPolarity = 0,
126 uint8_t clockPhase = 1, BOOL doutHiz = TRUE,
127 uint8_t csToClockDelay = 0, uint8_t delayAfterTransfer = 0 ) override;
128
138 virtual uint32_t SetBusSpeed(uint32_t maxSpeed) override;
139
155 virtual uint8_t Start( uint8_t *transmitBufferPtr, volatile uint8_t *receiveBufferPtr,
156 uint32_t byteCount, int csReturnToInactive = DEASSERT_AFTER_LAST ) override;
157
167 virtual inline uint8_t Tx( uint8_t *transmitBufferPtr, uint32_t byteCount,
168 int csReturnToInactive = DEASSERT_AFTER_LAST ) override
169 { return Start(transmitBufferPtr, NULL, byteCount, csReturnToInactive); }
170
180 inline uint8_t Rx( uint8_t *receiveBufferPtr, uint32_t byteCount, int csReturnToInactive =
DEASSERT_AFTER_LAST )
181 { return Start(NULL, receiveBufferPtr, byteCount, csReturnToInactive); }
182
183 // The SAME70 always uses DMA. These functions kept here for reference to other platforms
184 // bool EnableDMA(bool enableDMA = true);
185 // inline bool DisableDMA() { return EnableDMA(false); }
186
187 /*
188 * @brief Register a semaphore for the SPI module.
189 *
190 * The SPI module will post to this semaphore when a transaction is complete
191 *
192 * @param finishedSem Pointer to the semaphore
193 *
194 * @return true if the registration was successful, false if a SPI transaction is in progress
195 */
196 // bool RegisterSem( OS_SEM *finishedSem );
197
198 /*
199 * @brief Clear a semaphore registration
200 *
201 * @return true if the clear was successful, false if a SPI transaction is in progress
202 */
203 // inline bool ClrSem() { return RegisterSem(NULL); }
204
205 /*
206 * @brief Obtain a pointer to the SPI finished semaphore
207 *
208 * @return A pointer to the semaphore
209 */
210 // inline OS_SEM * GetSem() { return m_finishedSem; }
211
212 /*
213 * @brief Function to check SPI status
214 *
215 * Called as a class method on a specific SPI object. For example: MySpi.Done()
216 *
217 * @return true if SPI is finished, false if active
218 */
219 // inline bool Done() { return !m_inProgress; }
220 // virtual inline bool Done() { return !m_inProgress; }
221
222 /*
223 * @brief Returns the active baud rate
224 *
225 * The baud rate will be set to the value specified when the SPI module is initialized.
226 * If that value is not possible, the next lowest baud rate will be chosen.
227 *
228 * @return m_busSpeed The actual SPI module baud rate
229 */
230 // inline uint32_t GetActualBaudrate() { return m_busSpeed; }
231
242 virtual inline bool SetCS( uint8_t CS ) override

NetBurner, Inc.
792 File Documentation

243 {
244 OSLockObj lock;
245 return true;
246 }
247
248 // The ISR used by the QuadSPI driver. Internal use only (qspi.cpp).
249 friend void QuadSPI_DMA_Isr(XdmaCh_t *dma, int module);
250 };
251
252 #endif /* ----- #ifndef _DMA_QUADSPI_H_INC ----- */
253

22.19 EFFS/FAT/src/ftp_f.h
1 /*NB_REVISION*/
2
3 /*******************************************************************************
4 *
5 * Copyright (c) 2003 by HCC Embedded
6 *
7 * This software is copyrighted by and is the sole property of HCC. All
8 * rights, title, ownership, or other interests in the software remain the
9 * property of HCC. This software may only be used in accordance with the
10 * corresponding license agreement. Any unauthorized use, duplication,
11 * transmission, distribution, or disclosure of this software is expressly
12 * forbidden.
13 *
14 * This copyright notice may not be removed or modified without prior written
15 * consent of HCC.
16 *
17 * HCC reserves the right to modify this software without notice.
18 *
19 * HCC Embedded
20 * Budapest 1132
21 * Victor Hugo Utca 11-15
22 * Hungary
23 *
24 * Tel: +36 (1) 450 1302
25 * Fax: +36 (1) 450 1303
26 * http: www.hcc-embedded.com
27 * E-mail: [email protected]
28 *
29 ******************************************************************************/
30
31 #ifndef _FTP_F_H
32 #define _FTP_F_H
33
34 #if ((defined USE_NOR) | (defined USE_STDRAM)) & ((defined USE_CFC) | (defined USE_HDD) | (defined
USE_MMC) | (defined USE_FATRAM))
35 #define FS_WRAPPER
36 #elif (defined USE_NOR) | (defined USE_STDRAM)
37 #define FS_STD
38 #elif (defined USE_CFC) | (defined USE_HDD) | (defined USE_MMC) | (defined USE_FATRAM)
39 #define FS_FAT
40 #endif
41
42 #endif /* _FTP_F_H */

22.20 MultiPlatform/EffsSDHC/src/ftp_f.h
1 /*NB_REVISION*/
2
3 /*******************************************************************************
4 *
5 * Copyright (c) 2003 by HCC Embedded
6 *
7 * This software is copyrighted by and is the sole property of HCC. All
8 * rights, title, ownership, or other interests in the software remain the
9 * property of HCC. This software may only be used in accordance with the
10 * corresponding license agreement. Any unauthorized use, duplication,
11 * transmission, distribution, or disclosure of this software is expressly
12 * forbidden.
13 *
14 * This copyright notice may not be removed or modified without prior written
15 * consent of HCC.
16 *
17 * HCC reserves the right to modify this software without notice.
18 *
19 * HCC Embedded
20 * Budapest 1132
21 * Victor Hugo Utca 11-15
22 * Hungary

NetBurner, Inc.
22.21 MultiPlatform/WavPlayer/src/ftp_f.h 793

23 *
24 * Tel: +36 (1) 450 1302
25 * Fax: +36 (1) 450 1303
26 * http: www.hcc-embedded.com
27 * E-mail: [email protected]
28 *
29 ******************************************************************************/
30
31 #ifndef _FTP_F_H
32 #define _FTP_F_H
33
34 #if ((defined USE_NOR) | (defined USE_STDRAM)) & ((defined USE_CFC) | (defined USE_HDD) | (defined
USE_MMC) | (defined USE_FATRAM))
35 #define FS_WRAPPER
36 #elif (defined USE_NOR) | (defined USE_STDRAM)
37 #define FS_STD
38 #elif (defined USE_CFC) | (defined USE_HDD) | (defined USE_MMC) | (defined USE_FATRAM)
39 #define FS_FAT
40 #endif
41
42 #endif /* _FTP_F_H */

22.21 MultiPlatform/WavPlayer/src/ftp_f.h
1 /*NB_REVISION*/
2
3 /*******************************************************************************
4 *
5 * Copyright (c) 2003 by HCC Embedded
6 *
7 * This software is copyrighted by and is the sole property of HCC. All
8 * rights, title, ownership, or other interests in the software remain the
9 * property of HCC. This software may only be used in accordance with the
10 * corresponding license agreement. Any unauthorized use, duplication,
11 * transmission, distribution, or disclosure of this software is expressly
12 * forbidden.
13 *
14 * This copyright notice may not be removed or modified without prior written
15 * consent of HCC.
16 *
17 * HCC reserves the right to modify this software without notice.
18 *
19 * HCC Embedded
20 * Budapest 1132
21 * Victor Hugo Utca 11-15
22 * Hungary
23 *
24 * Tel: +36 (1) 450 1302
25 * Fax: +36 (1) 450 1303
26 * http: www.hcc-embedded.com
27 * E-mail: [email protected]
28 *
29 ******************************************************************************/
30
31 #ifndef _FTP_F_H
32 #define _FTP_F_H
33
34 #if ((defined USE_NOR) | (defined USE_STDRAM)) & ((defined USE_CFC) | (defined USE_HDD) | (defined
USE_MMC) | (defined USE_FATRAM))
35 #define FS_WRAPPER
36 #elif (defined USE_NOR) | (defined USE_STDRAM)
37 #define FS_STD
38 #elif (defined USE_CFC) | (defined USE_HDD) | (defined USE_MMC) | (defined USE_FATRAM)
39 #define FS_FAT
40 #endif
41
42 #endif /* _FTP_F_H */

22.22 ow.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #include <predef.h>
6 #include <nbrtos.h>
7 #include <init.h>
8 #include <stdio.h>
9 #include <ctype.h>
10 #include <sim.h>
11 #include <pins.h>
12 #include <cfinter.h>

NetBurner, Inc.
794 File Documentation

13
14 #define OW_CR_PST 0x40 // Presence Set bit
15 #define OW_CR_RPP 0x80 // Reset/Presence-detect pulse
16 #define OW_IER_ERBF \
17 0x10 // Enable receiver buffer full interrupt, and
18 // Receive buffer full flag
19 #define OW_IER_ETSE 0x08 // Enable transmit shift register empty interrupt
20 #define OW_IER_ETBE 0x04 // Enable transmit buffer empty interrupt
21
22 #ifndef OW_HPP_
23 #define OW_HPP_
24
25 /*
26 * OWState
27 * An enum type that defines the possible states of the 1-Wire module.
28 */
29 enum OWState
30 {
31 NOT_INIT = 0,
32 OK = 1,
33 READ = 2,
34 WRITE = 3
35 };
36
37 /*
38 * owDriverStruct
39 * This struct contains the state variables used for the 1-Wire driver.
40 *
41 * OW_State state - The state of the 1-Wire module. See the enumerated type
42 * above.
43 *
44 * uint8_t* buf - Points to the data buffer. This is the memory location
45 * from which data will be read or written to the peripheral.
46 *
47 * 8int8_t remLength - Counter that keeps track of the number of bytes
48 * that still need to be read or written.
49 *
50 * OS_SEM* sem - Pointer to the external semaphore for the OW_read and
51 * OW_write functions.
52 */
53 struct owDriverStruct
54 {
55 volatile OWState state;
56 volatile uint8_t *buf;
57 volatile int remLength;
58 OS_SEM *sem;
59
60 // Default constructor
61 owDriverStruct() : state(NOT_INIT), buf(NULL), remLength(0), sem(NULL) {}
62 };
63
64 /*
65 * 1-Wire interrupt service routine.
66 * Called by hardware when event occurs on the 1-Wire Module
67 */
68 void OWMasterIsr();
69
70 /*
71 * OWInit()
72 * This function initializes the 1-Wire module registers and sets up the
73 * interrupt service routine
74 */
75 void OWInit();
76
77 /*
78 * OWDetectDevices()
79 * Generates a reset pulse and listens for a response from external
80 * devices. Returns true if a device is detected, false otherwise
81 */
82 bool OWDetectDevices();
83
84 /*
85 * OWRead(uint8_t* data, int len, OS_SEM *sem)
86 * Reads len bytes from the 1-Wire Bus. Data points to the buffer
87 * to which the bytes are read. The function posts to the semaphore
88 * sem when complete (optional).
89 */
90 OWState OWRead(uint8_t *data, int len, OS_SEM *sem = NULL);
91
92 /*
93 * OWWrite(uint8_t* data, int len, OS_SEM *sem)
94 * Writes len bytes to the 1-Wire Bus. Data points to the buffer from
95 * which bytes are written. The function posts to the semaphore
96 * sem when complete (optional).
97 */
98 OWState OWWrite(uint8_t *data, int len, OS_SEM *sem = NULL);
99

NetBurner, Inc.
22.23 PeriodicAD.h 795

100 /*
101 * OWDone()
102 * Returns true if the driver is ready to be used/read/write data on the bus
103 */
104 bool OWDone();
105
106 #endif /* OW_HPP_ */

22.23 PeriodicAD.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #define ADC_CR1_STOP 0x4000
6 #define ADC_CR1_START 0x2000
7 #define ADC_CR1_LOOP 0x0002
8 #define ADC_CR2_INIT_OFF 0x0000
9 #define ADC_ZCCR_OFF 0x0000
10 #define ADC_SDIS_ENABLE_ALL 0x0000
11 #define ADC_SDIS_DISABLE_ALL 0x0000
12
13 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
14
15 void StartAD(); // Start A/D conversion set.
16
17 void StartADLoop(); // Start A/D conversion set, continuous loop mode.
18
19 void StopAD(); // Stop A/D conversion set.
20
21 bool ADDone(); // Return true if the conversion is complete
22
23 uint16_t GetADResult(int ch); // Return the AD Result

22.24 PeriodicAD_DMA.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #include <basictypes.h>
6
7 #define DMA_CH_DTER_0 8
8 #define DMA_CH_DTER_1 9
9 #define DMA_CH_DTER_2 10
10 #define DMA_CH_DTER_3 11
11
12 #define DMA_ERR_NOERR 0
13 #define DMA_ERR_CHNOTSET 1
14 #define DMA_ERR_TMRNOTSET 2
15 #define DMA_ERR_TMRRUNNING 3
16
17 // Initialize the dma timer to sample the ADC
18 int initADC_DMA(int channel = 0, int timerNum = 3);
19
20 // Set the sample period for the ADC (in us)
21 double setSamplePeriod(uint32_t period);
22
23 // Set the sample frequency (in Hz)
24 double setSampleFreq(uint32_t freq);
25
26 // Start logging the ADC using DMA. The period is in units of 1 us
27 int startADC_DMA(void *buffer, uint32_t bufferSize, void (*isrfunc)(void *, void *));
28
29 // Stop the DMA Timer and ADC
30 void stopADC_DMA();

22.25 wavWriter.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #include <basictypes.h>
6
7 #define NUM_WAV_WRITERS 5
8 #define SWPBUFFSIZE 512
9
10 // wavWriter expects data from onboard ADC straight from the result reg, with offset 0

NetBurner, Inc.
796 File Documentation

11 int openNewWav(char *fileName, uint16_t channels, uint32_t sampleRate);

22.26 dev_test.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* Device tests implementation */
6 #ifndef _DEV_TEST_H
7 #define _DEV_TEST_H
8
9 #include <effs_fat/fat.h>
10
11 #ifdef __cplusplus
12 extern "C"
13 {
14 #endif
15
16 int SpeedTest(char *pFileName, unsigned int size = 1024);
17
18 #ifdef __cplusplus
19 }
20 #endif
21
22 #endif /* _DEV_TEST_H */

22.27 edma.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef ___EDMA_H
6 #define ___EDMA_H
7
8 #define TCD_ATTR_8BIT_TRANS 0x0000
9 #define TCD_ATTR_16BIT_TRANS 0x0101
10
11 #define TCD_XOFF_0BYTE 0x0000
12 #define TCD_XOFF_1BYTE 0x0001
13 #define TCD_XOFF_2BYTE 0x0002
14
15 #define TCD_XITER_CNT_MASK 0x7FFF
16
17 #define TCD_CSR_DONE 0x0080
18 #define TCD_CSR_ACTIVE 0x0040
19 #define TCD_CSR_MAJ_LINK 0x0020
20 #define TCD_CSR_EN_SG 0x0010
21 #define TCD_CSR_DREQ 0x0008
22 #define TCD_CSR_INT_HALF 0x0004
23 #define TCD_CSR_INT_MAJOR 0x0002
24 #define TCD_CSR_START 0x0001
25
26 #define TCD_CSR_DISABLE_REQ 0xC008
27 #define TCD_CSR_DREQ_INT_MAJOR 0xC00A
28
29 #define TCD_CITER_MAX_COUNT 0x7FFF
30
31 #endif /* ----- #ifndef ___EDMA_H ----- */

22.28 wavPlayer.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef ___WAV_PLAYER_H
6 #define ___WAV_PLAYER_H
7
8 #include <nbrtos.h>
9 #include <sim.h>
10
11 // Comment out this macro to remove filesystem requirement
12 #define WAV_PLAYER_FILESYSTEM (1)
13
14 // Sim1 Miscellaneous Control Register
15 #define MISCCR2_DAC1SEL 0x0040 // Enable DAC1 drive output
16 #define MISCCR2_DAC0SEL 0x0020 // Enable DAC0 drive output

NetBurner, Inc.
22.28 wavPlayer.h 797

17 #define MISCCR2_ADCEN 0x0010 // Enable ADC 6-4 and 2-0


18 #define MISCCR2_ADC7EN 0x0008 // Enable ADC 7
19 #define MISCCR2_ADC3EN 0x0004 // Enable ADC 3
20
21 // ADC Calibration Register
22 #define ADC_CAL_DAC1 0x0002 // Selects the source of the ADCA7 input as DAC1 output.
23 #define ADC_CAL_DAC0 0x0001 // Selects the source of the ADCA3 input as DAC0 output.
24
25 // DAC Control Register
26 #define DAC_CR_RESET 0x1101
27 #define DAC_CR_FILT 0x1000
28 #define DAC_CR_WMLVL_M 0x0300
29 #define DAC_CR_WMLVL_S 8
30 #define DAC_CR_DMA 0x0080
31 #define DAC_CR_HSLS 0x0040
32 #define DAC_CR_UP 0x0020
33 #define DAC_CR_DOWN 0x0010
34 #define DAC_CR_AUTO 0x0008
35 #define DAC_CR_SYNC 0x0004
36 #define DAC_CR_FMT 0x0002
37 #define DAC_CR_PDN 0x0001 // Power down. 0 = power on, 1 = power down
38
39 // DAC Trigger Select Register DACTSR
40 // Channels
41 #define DAC1_CH0 0x0000 // Source channel 0
42 #define DAC1_CH1 0x0800 // Source channel 1
43 #define DAC1_CH2 0x1000 // Source channel 2
44 #define DAC1_CH3 0x1800 // Source channel 3
45
46 #define DAC0_CH0 0x0000 // Source channel 0
47 #define DAC0_CH1 0x0008 // Source channel 1
48 #define DAC0_CH2 0x0010 // Source channel 2
49 #define DAC0_CH3 0x0018 // Source channel 3
50
51 // DAC Trigger Sources
52 #define DAC1_SRC_PWMA 0x0000 // PWMs
53 #define DAC1_SRC_PWMB 0x0100
54 #define DAC1_SRC_PWMX 0x0200
55 #define DAC1_SRC_PWMTRIG1 0x0300
56 #define DAC1_SRC_PWMTRIG0 0x0400
57 #define DAC1_SRC_TnOUT 0x0500 // Timers
58 #define DAC1_SRC_TnIN 0x0600
59
60 #define DAC0_SRC_PWMA 0x0000 // PWMs
61 #define DAC0_SRC_PWMB 0x0001
62 #define DAC0_SRC_PWMX 0x0002
63 #define DAC0_SRC_PWMTRIG1 0x0003
64 #define DAC0_SRC_PWMTRIG0 0x0004
65 #define DAC0_SRC_TnOUT 0x0005 // Timers
66 #define DAC0_SRC_TnIN 0x0006
67
68 #define EDMA_CH_DAC0 62
69 #define EDMA_CH_DAC1 63
70 #define EDMA_CH_DAC0_INT 0x40000000
71 #define EDMA_CH_DAC1_INT 0x80000000
72
73 #define TCD_POOL_SIZE 20
74 #define DAC_COUNT 2
75 #define MAX_SAMPLE_RATE 100000
76
77 namespace WAVFILE
78 {
79 struct Chunk
80 {
81 char id[4];
82 uint32_t size;
83 };
84 struct RIFFChunk
85 {
86 char ChunkID[4]; // ’R’, ’I’, ’F’, ’F’
87 uint32_t ChunkSize;
88 char Format[4]; // ’W’, ’A’, ’V’, ’E’
89 };
90 struct formatChunk
91 {
92 char ChunkID[4]; // ’f’, ’m’, ’t’, ’ ’
93 uint32_t SubChunkSize;
94 uint16_t AudioFormat; // 1 = PCM, others are handled
95 uint16_t ChannelCount; // How many channels are recorded in this file?
96 uint32_t SampleRate; // Samples per second
97 uint32_t ByteRate; // Bytes per second = Sample Rate * ChannelCount * BitsPerSample
98 uint16_t BlockAlign; // Bytes per sample set = BitsPerSample * ChannelCount
99 uint16_t BitsPerSample; // Bits of data per sample
100 // Note: this is rounded up to multiples of 8-bits
101 // for BlockAlign and ByteRate
102 };
103 struct dataChunk

NetBurner, Inc.
798 File Documentation

104 {
105 char ChunkID[4]; // ’d’, ’a’, ’t’, ’a’
106 uint32_t SubChunkSize;
107 uint8_t data[]; // Arbitrary length array definition
108 };
109
110 // Structure definition for the ’canonical’ WAV file
111 struct WavFile
112 {
113 RIFFChunk riff; // Leading chunk defining the data block as a RIFF chunk
114 formatChunk fmt; // First subchunk, describing the format of the data section
115 dataChunk data; // The actual data section
116 };
117 } // namespace WAVFILE
118
119 class WavPlayer
120 {
121 public:
122 // Public enum definitions
123 enum playState
124 {
125 STATE_NO_DAC,
126 STATE_NO_TIMER,
127 STATE_NOT_LOADED,
128 STATE_NOT_PROCESSED,
129 STATE_BUFFER_RESET,
130 STATE_PROCESSED,
131 STATE_READY,
132 STATE_PLAYING,
133 STATE_UNMUTE,
134 STATE_MUTE,
135 STATE_PAUSED_UNMUTE,
136 STATE_PAUSED_MUTE,
137 STATE_PAUSED,
138 STATE_FINISHED
139 };
140
141 enum wavError
142 {
143 ERROR_NONE,
144 ERROR_PLAYING,
145 ERROR_FILE,
146 ERROR_FILE_SIZE,
147 ERROR_TYPE,
148 ERROR_SHORT,
149 ERROR_LONG,
150 ERROR_FORMAT,
151 ERROR_RATE,
152 ERROR_BITSIZE,
153 ERROR_SIZE_MISMATCH,
154 ERROR_CHANNEL,
155 ERROR_DACNUM,
156 ERROR_TIMER,
157 ERROR_IN_USE,
158 ERROR_OTHER
159 };
160
161 private:
162 enum readMode
163 {
164 MODE_FILE,
165 MODE_BUFFER,
166 MODE_NONE
167 };
168
169 struct channelControl
170 {
171 int dacNum;
172 uint32_t dataRem;
173 uint16_t transfersRem;
174 uint16_t finalTransferSize;
175 bool finished;
176 volatile dacstruct *dac;
177 volatile edma_tcdstruct *tcd;
178 };
179
180 struct wavData
181 {
182 uint32_t SampleRate;
183 uint16_t BitsPerSample;
184 uint16_t ChannelCount;
185 uint32_t dataSize;
186 };
187
188 struct initialPlaySettings
189 {
190 uint16_t channel;

NetBurner, Inc.
22.28 wavPlayer.h 799

191 uint16_t transfersRem;


192 uint16_t transferSize;
193 };
194
195 static WavPlayer *s_players[DAC_COUNT];
196
197 readMode m_mode;
198 playState m_state;
199 wavData m_wavInfo;
200 channelControl m_channel[DAC_COUNT];
201 initialPlaySettings m_initSettings[DAC_COUNT];
202 uint32_t m_timer;
203 int m_playsRem[DAC_COUNT];
204 timerstruct timerSettings;
205 WAVFILE::WavFile *m_pWav;
206 WAVFILE::RIFFChunk *m_pWav_riff; // Leading chunk defining the data block as a RIFF chunk
207 WAVFILE::formatChunk *m_pWav_fmt; // First subchunk, describing the format of the data section
208 WAVFILE::dataChunk *m_pWav_data; // The actual data section
209 OS_SEM *m_finishedSem;
210
211 // Prepare the data for sending to DAC
212 wavError PrepareData();
213
214 const uint8_t *FindChunk(const char *chunkID, const uint8_t *data, uint32_t dataLen);
215 wavError ParseHeader();
216 // Helper functions for swapping endianess of header segments
217 void PrepChunk_RIFF();
218 void PrepChunk_fmt();
219 void PrepChunk_data();
220
221 void SetLengths();
222 void ConfigDAC();
223 void ConfigDMA();
224 void ConfigTimer();
225 void ISR(int channelNum);
226 void SoftMuteISR();
227
228 public:
229 WavPlayer();
230 ~WavPlayer();
231
232 static void RunISR();
233 static void RunSoftMuteISR(uint32_t vector);
234
235 #ifdef WAV_PLAYER_FILESYSTEM
236 /* OpenFile
237 * Opens and readies a WAV file from disk
238 *
239 * Args:
240 * - fileName: pointer to C string containing the name of the file to be opened
241 * - dataBuffer: pointer to a buffer to load the file into
242 * - bufferSize: the size of the buffer being used
243 *
244 * Returns:
245 * - ERROR_NONE: File loaded successfully
246 * - Other: Failure while loading file, value indicates type
247 */
248 wavError OpenFile(const char *fileName, uint8_t *dataBuffer, uint32_t bufferSize);
249 #endif /* #ifdef WAV_PLAYER_FILESYSTEM */
250 /* OpenBuffer
251 * Readies a WAV file stored in a buffer.
252 * WARNING: This function mutates the passed buffer if successful. Until
253 * either a new WAV file is loaded, ResetBuffer() is called, or the
254 * WavPlayer is destroyed, the buffer should not be read or modified.
255 *
256 * Args:
257 * - data: pointer to a buffer containing a WAV file
258 *
259 * Returns:
260 * - ERROR_NONE: File loaded successfully
261 * - Other: Failure while loading file, value indicates type
262 */
263 wavError OpenBuffer(uint8_t *data);
264
265 /* SetChannelDAC
266 * Sets the association between an audio channel and the DAC that is used
267 * to play it. Note: Only 2 channel WAVs are supported.
268 *
269 * Args:
270 * - channel: WAV sample channel to read from
271 * - dacNum: DAC channel to output to
272 *
273 * Returns:
274 * - ERROR_NONE: Channel Associated
275 * - Other: Failure, value indicates type
276 */
277 wavError SetChannelDAC(int channel = 0, int dacNum = 0);

NetBurner, Inc.
800 File Documentation

278 /* SetTimer
279 * Selects which DMA Timer is used as the trigger source for the DAC(s)
280 *
281 * Args:
282 * - timerNum: the dma timer to use
283 *
284 * Returns:
285 * - ERROR_NONE: Channel Associated
286 * - Other: Failure, value indicates type
287 */
288 wavError SetTimer(int timerNum = 3);
289
290 /* Play
291 * Plays the previously loaded WAV file
292 *
293 * Args:
294 * - wavFinishedSem: Optional semaphore posted to upon completion
295 *
296 * Returns:
297 * NONE
298 */
299 wavError Play(OS_SEM *wavFinishedSem = NULL);
300
301 /* Loop
302 * Repeatedly plays the open file.
303 *
304 * Args:
305 * - playCount: the number of times to play the file, 0 = loop forever
306 *
307 * Returns:
308 *
309 */
310 wavError Loop(uint32_t playCount = 0, OS_SEM *wavFinishedSem = NULL);
311
312 /* Stop
313 * Immediately stops playback
314 *
315 */
316 wavError Stop();
317
318 /* StopGraceful
319 * Stops playback once current loop iteration is finished.
320 */
321 wavError StopGraceful();
322
323 wavError Pause();
324
325 wavError Resume();
326
327 /* ResetBuffer
328 * Reset the data buffer back to its unmutated state. Only needed when the
329 * WAV file was loaded using OpenBuffer and the buffer is not reverted from
330 * other sources.
331 *
332 * Args:
333 * NONE
334 *
335 * Returns:
336 * NONE
337 */
338 wavError ResetBuffer();
339
340 /* GetState
341 * Gets the current state of the WavPlayer.
342 *
343 * Args:
344 * NONE
345 *
346 * Returns:
347 * NONE
348 */
349 playState GetState();
350 };
351
352 #endif /* ----- #ifndef ___WAV_PLAYER_H ----- */

22.29 htmlvars.h
1 extern config_uint gMyOwnuVal;
2 extern config_string gMyOwnStrVal;

NetBurner, Inc.
22.30 _common/IpUtil/src/ip_util.h 801

22.30 _common/IpUtil/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _IP_UTIL_H_
6 #define _IP_UTIL_H_
7
8 void showIpAddressesSerial();
9 void showLinkStatus();
10
11 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
12 extern "C"
13 {
14 void showIpAddressesWeb(int socket, char *url);
15 }
16
17 #endif

22.31 _common/MultiPlatform/RTC-OnChip/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
9 extern "C"
10 {
11 void showIpAddressesWeb(int socket, char *url);
12 }

22.32 DHCP/ChangeIP/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
9 extern "C"
10 {
11 void showIpAddressesWeb(int socket, char *url);
12 }

22.33 DHCP/ChangeIPViaWebpage/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
9 extern "C"
10 {
11 void showIpAddressesWeb(int socket, char *url);
12 }

22.34 Ethernet/ManualConfig/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
9 extern "C"

NetBurner, Inc.
802 File Documentation

10 {
11 void showIpAddressesWeb(int socket, char *url);
12 }

22.35 IPv6/IPv6-DHCPv6/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
9 extern "C"
10 {
11 void showIpAddressesWeb(int socket, char *url);
12 }

22.36 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
9 extern "C"
10 {
11 void showIpAddressesWeb(int socket, char *url);
12 }

22.37 PlatformSpecific/MODM7AE70/MODM7AE70FactoryApp/src/ip_←-
util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _IP_UTIL_H_
6 #define _IP_UTIL_H_
7
8 void showIpAddressesSerial();
9 void showLinkStatus();
10
11 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
12 extern "C"
13 {
14 void showIpAddressesWeb(int socket, char *url);
15 }
16
17 #endif

22.38 PlatformSpecific/NANO54415/NANO54415FactoryApp/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _IP_UTIL_H_
6 #define _IP_UTIL_H_
7
8 void showIpAddressesSerial();
9 void showLinkStatus();
10
11 // Functions called by web server with FUNCTIONCALL tag need to be extern"C" to link
12 extern "C"
13 {
14 void showIpAddressesWeb(int socket, char *url);
15 }
16
17 #endif

NetBurner, Inc.
22.39 ShowInterfaces/src/ip_util.h 803

22.39 ShowInterfaces/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 void showIpAddressesWeb(int socket, char *url);

22.40 VLan/src/ip_util.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void showIpAddressesSerial();
6 void showLinkStatus();
7
8 void showIpAddressesWeb(int socket, char *url);

22.41 MyAlloc.h
1
2 class MyModAlloc : public DHCP::BlockAllocator
3 {
4 public:
5 MyModAlloc();
6 ~MyModAlloc();
7 virtual bool OfferLease(DHCP::DhcpLeaseRequest *pLease, int intfNum);
8 virtual bool RequestLease(DHCP::DhcpLeaseRequest *pLease, int intfNum);
9 virtual bool SetStaticLease(DHCP::DhcpLeaseRequest *pLease);
10 };

22.42 fileup.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #define FAT_UPDATE_OK (0)
6 #define FAT_UPDATE_SAMEVERSION (-1)
7 #define FAT_UPDATE_WRONG_PLATFORM (-2)
8 #define FAT_UPDATE_BAD_FORMAT (-3)
9 #define FAT_UPDATE_NO_MEM (-4)
10
11 /* This is the structure of an APP File */
12 struct FlashStartUpStruct
13 {
14 unsigned long dwBlockRamStart;
15 unsigned long dwExecutionAddr;
16 unsigned long dwBlockSize;
17 unsigned long dwSrcBlockSize;
18 unsigned long dwBlockSum;
19 unsigned long dwStructSum;
20 };
21
22 int UpdateFromFat(F_FILE *f, BOOL bUpdateEvenIfCurrent);

22.43 ExtraFdCircBuffer.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #include <predef.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <iosys.h>
9 #include <nbrtos.h>
10 #include <iointernal.h>
11
12 #ifndef _EXTRAFD_CIRC_BUFFER_H
13 #define _EXTRAFD_CIRC_BUFFER_H
14

NetBurner, Inc.
804 File Documentation

15 // A circular buffer object, referred to as a "cbo"


16 struct CircularBufferObject
17 {
18 OS_CRIT criticalSection; // Critical section to make it task safe
19
20 uint32_t readIndex; // Buffer index of next char to get
21 uint32_t writeIndex; // Buffer index of next char to put
22
23 uint32_t dataBufferSize; // Size of data buffer
24 char *dataBuffer; // Data storage space
25
26 bool enableOverwrite; // Continuously overwrite buffer instead of setting full flag
27 char overwriteTermByte; // When in overwrite mode and buffer is full, bytes will be
28 // flushed up to the terminator instead of one at a time.
29 // Useful for lines/strings terminated with \r\n
30 };
31
32 // int CircularBufferInit(CircularBufferObject *pCbo, char *pBuffer, uint32_t bufferSize);
33 int CircularBufferInit(CircularBufferObject *pCbo, char *pBuffer, uint32_t bufferSize, bool
enableOverwrite, uint8_t overwriteTermByte);
34 int CircularBufferRead(int fd, char *buf, int nbytes);
35 int CircularBufferWrite(int fd, char *buf, int nbytes);
36 void CircularBufferRawPrint(int fdCircBuffer, int fdDestination);
37
38 #endif

22.44 JSON/DemoNetBurner/src/htmlvar.h
1 #ifndef HTMLVARS_H_
2 #define HTMLVARS_H_
3
4 #include <nbrtos.h> // For access to TimeTick
5
6 extern vuint32_t Secs;
7 extern const char * gBuildDate;
8 extern const char * gBuildTime;
9 extern char gBootTime[];
10 extern char gBootDate[];
11 const char * GetReleaseTag();
12 const char * ShowHost();
13
14
15 #endif

22.45 JSON/SimpleJSONHtml/src/htmlvar.h
1 //Define the variables the web page will need to render the results
2 extern vuint32_t Secs;
3 extern const char * gBuildDate;
4 extern const char * gBuildTime;
5 const char * GetReleaseTag();

22.46 JSON/SimplePostReceiver/src/htmlvar.h
1 const char * GetHost();
2

22.47 PlatformSpecific/SB800EX/SB800AsDiagMonitor/src/htmlvar.h
1 #include <config_obj.h>
2 extern config_chooser Ch1;
3 extern config_chooser Ch2;

22.48 SSL/SSLConfigMirror/src/htmlvar.h
1 #ifndef HTMLVARS_H_
2 #define HTMLVARS_H_
3
4 #include <nbrtos.h> // For access to TimeTick
5
6 extern vuint32_t Secs;
7 extern const char * gBuildDate;
8 extern const char * gBuildTime;
9 extern char gBootTime[];

NetBurner, Inc.
22.49 Web/HtmlPostDateTime/src/htmlvar.h 805

10 extern char gBootDate[];


11 const char * GetReleaseTag();
12
13
14 #endif

22.49 Web/HtmlPostDateTime/src/htmlvar.h
1 //Nothing here

22.50 Web/HtmlServerGetRequest/src/htmlvar.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef HTMLVARS_H_
6 #define HTMLVARS_H_
7
8 #include <nbrtos.h> // For access to TimeTick
9
10 extern vuint32_t Secs;
11
12 #endif /*HTMLVARS_H_*/

22.51 Web/HtmlVariables/src/htmlvar.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef HTMLVARS_H_
6 #define HTMLVARS_H_
7
8 #include <nbrtos.h> // For access to TimeTick
9
10 extern int gIntVal;
11 extern char gStrVal[];
12
13 const char *FooWithParameters(int fd, int v);
14
15 #endif /*HTMLVARS_H_*/

22.52 Web/SignedApp/src/htmlvar.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef HTMLVARS_H_
6 #define HTMLVARS_H_
7
8 #include <tcp.h>
9
10 #endif /*HTMLVARS_H_*/

22.53 WebSockets/Console/src/htmlvar.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4 #ifndef HTMLVARS_H_
5 #define HTMLVARS_H_
6
7 #include <tcp.h>
8
9 #endif /*HTMLVARS_H_*/

22.54 WebSockets/Echo/src/htmlvar.h
1 /*NB_REVISION*/

NetBurner, Inc.
806 File Documentation

2
3 /*NB_COPYRIGHT*/
4 #ifndef HTMLVARS_H_
5 #define HTMLVARS_H_
6
7 #include <tcp.h>
8
9 #endif /*HTMLVARS_H_*/

22.55 NANOL7.h
1 void L7OutByte(char c);
2 void L7OutHex(uint32_t val, int bytes);
3 void L7OutString(const char *cp);
4 void OpenIrq7(int port);
5 void RunL7StdoutPump();
6

22.56 _common/EFFS/STD/src/effs_std.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
22 #ifndef _EFFSSTD_H_
23 #define _EFFSSTD_H_
24
25 /*******************************************************************
26 * Definitions
27 *******************************************************************/
28 /* On-chip Flash NOR */
29 #define USE_NOR
30
31 /* Drive numbers */
32 #define NOR_DRV_NUM 0
33 #define STDRAM_DRV_NUM 1
34 #define MMC_DRV_NUM 2
35 #define CFC_DRV_NUM 3
36 #define HDD_DRV_NUM 3
37 #define FATRAM_DRV_NUM 4
38
39 #define FS_NO_ERROR FS_NOERR
40
41 /* Routine definitions */
42 #include <file/fsf.h>
43 #include <file/fwerr.h>
44
45 /*
46 ******************************************************************************
47 *
48 * "C" Routines
49 *
50 ******************************************************************************
51 */
52 #ifdef __cplusplus
53 extern "C"
54 {
55 #endif
56
57 /*
58 ******************************************************************************
59
60 Start EFFS
61
62 Parameters:
63 deviceNamePtr - Device name
64
65 Return:
66 None
67
68 Notes:
69 Starts EFFS-STD file system, formats if necessary.
70
71 ******************************************************************************
72 */
73 void EffsStart(char *deviceNamePtr);
74
75 /*
76 ******************************************************************************
77
78 Lists files and directories starting with the current directory
79

NetBurner, Inc.
22.57 Parallax/src/effs_std.h 807

80 Parameters:
81 deviceNamePtr - Device name
82
83 Return:
84 None
85
86 Notes:
87 None
88
89 ******************************************************************************
90 */
91 void EffsListCurrentDirectory(char *deviceNamePtr);
92
93 /*
94 ******************************************************************************
95
96 Display space used, total and bad
97
98 Parameters:
99 deviceNamePtr - Device name
100
101 Return:
102 None
103
104 Notes:
105 None
106
107 ******************************************************************************
108 */
109 void EffsDisplayStatistics(char *deviceNamePtr);
110
111 /* Format the EFFS Flash file system */
112 uint8_t EffsFormat();
113
114 #ifdef __cplusplus
115 };
116 #endif
117
118 #endif /* #ifndef _EFFSSTD_H_ */

22.57 Parallax/src/effs_std.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
44 #ifndef _EFFSSTD_H_
45 #define _EFFSSTD_H_
46
47 /*******************************************************************
48 * Definitions
49 *******************************************************************/
50 /* On-chip Flash NOR */
51 #define USE_NOR
52
53 /* Drive numbers */
54 #define NOR_DRV_NUM 0
55 #define STDRAM_DRV_NUM 1
56 #define MMC_DRV_NUM 2
57 #define CFC_DRV_NUM 3
58 #define HDD_DRV_NUM 3
59 #define FATRAM_DRV_NUM 4
60

NetBurner, Inc.
808 File Documentation

61 #define FS_NO_ERROR FS_NOERR


62
63 /* Routine definitions */
64 #include <file/fsf.h>
65 #include <file/fwerr.h>
66
67 /*
68 ******************************************************************************
69 *
70 * "C" Routines
71 *
72 ******************************************************************************
73 */
74 #ifdef __cplusplus
75 extern "C"
76 {
77 #endif
78
79 /*
80 ******************************************************************************
81
82 Start EFFS
83
84 Parameters:
85 deviceNamePtr - Device name
86
87 Return:
88 None
89
90 Notes:
91 Starts EFFS-STD file system, formats if necessary.
92
93 ******************************************************************************
94 */
95 void EffsStart(char *deviceNamePtr);
96
97 /*
98 ******************************************************************************
99
100 Lists files and directories starting with the current directory
101
102 Parameters:
103 deviceNamePtr - Device name
104
105 Return:
106 None
107
108 Notes:
109 None
110
111 ******************************************************************************
112 */
113 void EffsListCurrentDirectory(char *deviceNamePtr);
114
115 /*
116 ******************************************************************************
117
118 Display space used, total and bad
119
120 Parameters:
121 deviceNamePtr - Device name
122
123 Return:
124 None
125
126 Notes:
127 None
128
129 ******************************************************************************
130 */
131 void EffsDisplayStatistics(char *deviceNamePtr);
132
133 /* Format the EFFS Flash file system */
134 uint8_t EffsFormat();
135
136 #ifdef __cplusplus
137 };
138 #endif
139
140 #endif /* #ifndef _EFFSSTD_H_ */

22.58 _common/EFFS/FAT/src/effs_time.h
1 /*NB_REVISION*/
2

NetBurner, Inc.
22.59 _common/EFFS/STD/src/effs_time.h 809

3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 // Set the system time using a Network Time Server
9 uint32_t SetTimeNTP();
10
11 // Set the system time manually
12 void SetTimeManual(int month, int day, int weekday, int year, int hour, int min, int sec);
13
14 // Set the system time using a Real-Time clock
15 void SetTimeRTC();
16
17 void DisplaySystemTime();
18
19 // This function is deprecated. Use tzsetchar for proper timezone management
20 void SetTimeZone(int hour_offset, int isdst) __attribute__((deprecated));
21 void WasSetTimeZone(int hour_offset, int isdst);
22
23 #endif /* _EFFS_TIME_H */

22.59 _common/EFFS/STD/src/effs_time.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 // Set the system time using a Network Time Server
9 uint32_t SetTimeNTP();
10
11 // Set the system time manually
12 void SetTimeManual(int month, int day, int weekday, int year, int hour, int min, int sec);
13
14 // Set the system time using a Real-Time clock
15 void SetTimeRTC();
16
17 void DisplaySystemTime();
18
19 // This function is deprecated. Use tzsetchar for proper timezone management
20 void SetTimeZone(int hour_offset, int isdst) __attribute__((deprecated));
21 void WasSetTimeZone(int hour_offset, int isdst);
22
23 #endif /* _EFFS_TIME_H */

22.60 _common/MultiPlatform/EffsLoadAppFromFlashCard/src/effs_←-
time.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 // Set the system time using a Network Time Server
9 uint32_t SetTimeNTP();
10
11 // Set the system time manually
12 void SetTimeManual(int month, int day, int weekday, int year, int hour, int min, int sec);
13
14 // Set the system time using a Real-Time clock
15 void SetTimeRTC();
16
17 void DisplaySystemTime();
18
19 // This function is deprecated. Use tzsetchar for proper timezone management
20 void SetTimeZone(int hour_offset, int isdst) __attribute__((deprecated));
21 void WasSetTimeZone(int hour_offset, int isdst);
22
23 #endif /* _EFFS_TIME_H */

22.61 _common/MultiPlatform/EffsSDHC/src/effs_time.h
1 /*NB_REVISION*/

NetBurner, Inc.
810 File Documentation

2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 // Set the system time using a Network Time Server
9 uint32_t SetTimeNTP();
10
11 // Set the system time manually
12 void SetTimeManual(int month, int day, int weekday, int year, int hour, int min, int sec);
13
14 // Set the system time using a Real-Time clock
15 void SetTimeRTC();
16
17 void DisplaySystemTime();
18
19 // This function is deprecated. Use tzsetchar for proper timezone management
20 void SetTimeZone(int hour_offset, int isdst) __attribute__((deprecated));
21 void WasSetTimeZone(int hour_offset, int isdst);
22
23 #endif /* _EFFS_TIME_H */

22.62 _common/MultiPlatform/WavPlayer/src/effs_time.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 // Set the system time using a Network Time Server
9 uint32_t SetTimeNTP();
10
11 // Set the system time manually
12 void SetTimeManual(int month, int day, int weekday, int year, int hour, int min, int sec);
13
14 // Set the system time using a Real-Time clock
15 void SetTimeRTC();
16
17 void DisplaySystemTime();
18
19 // This function is deprecated. Use tzsetchar for proper timezone management
20 void SetTimeZone(int hour_offset, int isdst) __attribute__((deprecated));
21 void WasSetTimeZone(int hour_offset, int isdst);
22
23 #endif /* _EFFS_TIME_H */

22.63 Parallax/src/effs_time.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 #ifndef _EFFS_TIME_H
28 #define _EFFS_TIME_H
29
30 // Set the system time using a Network Time Server
31 uint32_t SetTimeNTP();

NetBurner, Inc.
22.64 PlatformSpecific/MOD5441X/EffsMultipleMmc/src/effs_time.h 811

32
33 // Set the system time manually
34 void SetTimeManual(int month, int day, int weekday, int year, int hour, int min, int sec);
35
36 // Set the system time using a Real-Time clock
37 void SetTimeRTC();
38
39 void DisplaySystemTime();
40
41 // This function is deprecated. Use tzsetchar for proper timezone management
42 void SetTimeZone(int hour_offset, int isdst) __attribute__((deprecated));
43 void WasSetTimeZone(int hour_offset, int isdst);
44
45 #endif /* _EFFS_TIME_H */

22.64 PlatformSpecific/MOD5441X/EffsMultipleMmc/src/effs_time.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 bool SetTimeNTP(); // Set the system time using a Network Time Server
9 // Set the system time manually
10 void SetTimeManual(int month, int day, int weekday, int year, int hour, int min, int sec);
11 void SetTimeRTC(); // Set the system time using a Real-Time clock
12
13 void DisplaySystemTime();
14
15 // extern "C"
16 //{
17 // void tzsetchar(char * tzenv);
18 // }
19
20 #endif /* _EFFS_TIME_H */

22.65 _common/EFFS/FAT/src/FileSystemUtils.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FILESYSUTIL_H
6 #define _FILESYSUTIL_H
7
8 #include <effs_fat/fat.h>
9
10 #include "cardtype.h"
11
12 #define MAX_EFFS_ERRORCODE (38)
13 extern char EffsErrorCode[][80];
14
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19
20 // FAT Media Types for Format
21 #define F_FAT12_FORMAT (1)
22 #define F_FAT16_FORMAT (2)
23 #define F_FAT32_FORMAT (3)
24
25 void DisplayEffsErrorCode(int code);
26 uint8_t InitExtFlash();
27 uint8_t UnmountExtFlash();
28 uint8_t FormatExtFlash(long FATtype = F_FAT32_FORMAT);
29 uint8_t DisplayEffsSpaceStats();
30 uint8_t DumpDir();
31 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
32 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
33 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t NumBytes);
34 uint8_t DeleteFile(char *pFileName);
35 int DeleteAllFiles();
36 void ReadWriteTest(char *FileName = "TestFile.txt");
37 void DisplayTextFile(char *FileName);
38 void fgets_test(char *FileName);
39 void fprintf_test();
40 void fputs_test(char *FileName);
41
42 #ifdef __cplusplus

NetBurner, Inc.
812 File Documentation

43 }
44 #endif
45
46 #endif

22.66 _common/EFFS/STD/src/FileSystemUtils.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FILESYSUTIL_H
6 #define _FILESYSUTIL_H
7
8 #include <effs_fat/fat.h>
9
10 #define MAX_EFFS_ERRORCODE (38)
11 extern char EffsErrorCode[][80];
12
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17
18 void DisplayEffsErrorCode(int code);
19 uint8_t FormatEffsStdFlash();
20 uint8_t DisplayEffsSpaceStats();
21 uint8_t DumpDir();
22 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
23 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
24 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t NumBytes);
25 uint8_t DeleteFile(char *pFileName);
26 void ReadWriteTest();
27 void DisplayTextFile(char *FileName);
28 void fgets_test(char *FileName);
29 void fprintf_test();
30 void fputs_test(char *FileName);
31
32 #ifdef __cplusplus
33 }
34 #endif
35
36 #endif

22.67 _common/MultiPlatform/EffsLoadAppFromFlashCard/src/File←-
SystemUtils.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FILESYSUTIL_H
6 #define _FILESYSUTIL_H
7
8 #include <effs_fat/fat.h>
9
10 extern char EffsErrorCode[][80];
11
12 // FAT Media Types for Format
13 #define F_FAT12_FORMAT (1)
14 #define F_FAT16_FORMAT (2)
15 #define F_FAT32_FORMAT (3)
16
17 int OpenOnBoardFlash();
18 int OpenOffBoardFlash();
19 int UnmountFlash(int drv);
20
21 void DisplayEffsErrorCode(int code);
22 uint8_t FormatExtFlash(int drv, long FATtype = F_FAT32_FORMAT);
23 uint8_t DisplayEffsSpaceStats(int drv);
24 uint8_t DumpDir();
25
26 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);
27 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);
28 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t Numuint8_ts);
29 uint8_t DeleteFile(char *pFileName);
30
31 void ReadWriteTest(const char *FileName = "TestFile.txt");
32 void DisplayTextFile(char *FileName);
33 void fgets_test(char *FileName);
34 void fprintf_test();

NetBurner, Inc.
22.68 _common/MultiPlatform/EffsSDHC/src/FileSystemUtils.h 813

35 void fputs_test(char *FileName);


36
37 #endif

22.68 _common/MultiPlatform/EffsSDHC/src/FileSystemUtils.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FILESYSUTIL_H
6 #define _FILESYSUTIL_H
7
8 #include <effs_fat/fat.h>
9
10 #include "cardtype.h"
11
12 #define MAX_EFFS_ERRORCODE (38)
13 extern char EffsErrorCode[][80];
14
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19
20 // FAT Media Types for Format
21 #define F_FAT12_FORMAT (1)
22 #define F_FAT16_FORMAT (2)
23 #define F_FAT32_FORMAT (3)
24
25 void DisplayEffsErrorCode(int code);
26 uint8_t InitExtFlash();
27 uint8_t UnmountExtFlash();
28 uint8_t FormatExtFlash(long FATtype = F_FAT32_FORMAT);
29 uint8_t DisplayEffsSpaceStats();
30 uint8_t DumpDir();
31 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
32 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
33 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t NumBytes);
34 uint8_t DeleteFile(char *pFileName);
35 int DeleteAllFiles();
36 void ReadWriteTest(char *FileName = "TestFile.txt");
37 void DisplayTextFile(char *FileName);
38 void fgets_test(char *FileName);
39 void fprintf_test();
40 void fputs_test(char *FileName);
41
42 #ifdef __cplusplus
43 }
44 #endif
45
46 #endif

22.69 _common/MultiPlatform/WavPlayer/src/FileSystemUtils.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FILESYSUTIL_H
6 #define _FILESYSUTIL_H
7
8 #include <effs_fat/fat.h>
9
10 extern char EffsErrorCode[][80];
11
12 // FAT Media Types for Format
13 #define F_FAT12_FORMAT (1)
14 #define F_FAT16_FORMAT (2)
15 #define F_FAT32_FORMAT (3)
16
17 int OpenOnBoardFlash();
18 int OpenOffBoardFlash();
19 int UnmountFlash(int drv);
20
21 void DisplayEffsErrorCode(int code);
22 uint8_t FormatExtFlash(int drv, long FATtype = F_FAT32_FORMAT);
23 uint8_t DisplayEffsSpaceStats(int drv);
24 uint8_t DumpDir();
25
26 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);
27 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);

NetBurner, Inc.
814 File Documentation

28 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t Numuint8_ts);


29 uint8_t DeleteFile(char *pFileName);
30
31 void ReadWriteTest(const char *FileName = "TestFile.txt");
32 void DisplayTextFile(char *FileName);
33 void fgets_test(char *FileName);
34 void fprintf_test();
35 void fputs_test(char *FileName);
36
37 #endif

22.70 Parallax/src/FileSystemUtils.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 #ifndef _FILESYSUTIL_H
28 #define _FILESYSUTIL_H
29
30 #include <effs_fat/fat.h>
31
32 #define MAX_EFFS_ERRORCODE (38)
33 extern char EffsErrorCode[][80];
34
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39
40 void DisplayEffsErrorCode(int code);
41 uint8_t FormatEffsStdFlash();
42 uint8_t DisplayEffsSpaceStats();
43 uint8_t DumpDir();
44 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
45 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t NumBytes);
46 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t NumBytes);
47 uint8_t DeleteFile(char *pFileName);
48 void ReadWriteTest();
49 void DisplayTextFile(char *FileName);
50 void fgets_test(char *FileName);
51 void fprintf_test();
52 void fputs_test(char *FileName);
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif

22.71 PlatformSpecific/MOD5441X/EffsMultipleMmc/src/FileSystem←-
Utils.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FILESYSUTIL_H
6 #define _FILESYSUTIL_H

NetBurner, Inc.
22.72 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/FileSystemUtils.h 815

7
8 #include <effs_fat/fat.h>
9
10 extern char EffsErrorCode[][80];
11
12 // FAT Media Types for Format
13 #define F_FAT12_FORMAT (1)
14 #define F_FAT16_FORMAT (2)
15 #define F_FAT32_FORMAT (3)
16
17 int OpenOnBoardFlash();
18 int OpenOffBoardFlash();
19 int UnmountFlash(int drv);
20
21 void DisplayEffsErrorCode(int code);
22 uint8_t FormatExtFlash(int drv, long FATtype = F_FAT32_FORMAT);
23 uint8_t DisplayEffsSpaceStats(int drv);
24 uint8_t DumpDir();
25
26 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);
27 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);
28 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t Numuint8_ts);
29 uint8_t DeleteFile(char *pFileName);
30
31 void ReadWriteTest(const char *FileName = "TestFile.txt");
32 void DisplayTextFile(char *FileName);
33 void fgets_test(char *FileName);
34 void fprintf_test();
35 void fputs_test(char *FileName);
36
37 #endif

22.72 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/File←-
SystemUtils.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FILESYSUTIL_H
6 #define _FILESYSUTIL_H
7
8 #include <effs_fat/fat.h>
9
10 #define MAX_EFFS_ERRORCODE (38)
11 extern char EffsErrorCode[][80];
12
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17
18 // FAT Media Types for Format
19 #define F_FAT12_FORMAT (1)
20 #define F_FAT16_FORMAT (2)
21 #define F_FAT32_FORMAT (3)
22
23 int OpenOnBoardFlash();
24 int OpenOffBoardFlash();
25 int UnmountFlash(int drv);
26
27 void DisplayEffsErrorCode(int code);
28 uint8_t FormatExtFlash(int drv, long FATtype = F_FAT32_FORMAT);
29 uint8_t DisplayEffsSpaceStats(int drv);
30 uint8_t DumpDir();
31 uint32_t WriteFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);
32 uint32_t AppendFile(uint8_t *pDataToWrite, char *pFileName, uint32_t Numuint8_ts);
33 uint32_t ReadFile(uint8_t *pReadBuffer, char *pFileName, uint32_t Numuint8_ts);
34 uint8_t DeleteFile(char *pFileName);
35 void ReadWriteTest(const char *FileName = "TestFile.txt");
36 void DisplayTextFile(char *FileName);
37 void fgets_test(char *FileName);
38 void fprintf_test();
39 void fputs_test(char *FileName);
40
41 #ifdef __cplusplus
42 }
43 #endif
44
45 #endif

NetBurner, Inc.
816 File Documentation

22.73 _common/EFFS/STD/src/flashChip/AM29LV160B.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*------------------------------------------------------------------------------
6 * EFFS-STD configuration file for Spansion AM29LV160B flash chip. This file is
7 * part of an example that allocates 512kB of flash space to the file system,
8 * and the rest to the application.
9 *
10 * Note: The AM29LV160B is identical to the Spansion S29AL016D.
11 *
12 * To modify the amount of space allocated to the file system:
13 *
14 * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
15 * 2. Change the compcode memory address range for the application in your
16 * NBEclipse project settings so that the end of the application space does
17 * not exceed the start of the file system space. See the EFFS Programmer’s
18 * Guide for details, and the header comments in main.cpp of this example
19 * on how to make the changes in the NBEclipse project.
20 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
21 * to your NBEclipse project C/C++ build linker library options. See the header
22 * comments in main.cpp for this example on how to add the library in the
23 * NBEclipse project.
24 *----------------------------------------------------------------------------*/
25
26 #ifndef _ONCHIPFLASH_H_
27 #define _ONCHIPFLASH_H_
28
29 #include "file/fsf.h"
30 #include "basictypes.h"
31 #include "hal.h"
32
36 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
37
38 #define FLASH_NAME "S29AL016/AMDLV160"
39
43 #define FS_FLASHBASE (0xFFC00000)
44
103 #define BLOCKSIZE (64 * 1024) // Use only the 64k sectors
104 #define SECTORSIZE (16 * 1024) // 4 sectors per block
105 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
106
107 /*
108 * Specify the total amount of flash memory in the system, and the amount
109 * allocated to be used by the file system (the rest is used by the
110 * application).
111 */
112 #define FLASH_SIZE \
113 (2 * 1024 * 1024) // Size of total flash in the
114 // system, 2MB
115 #define FS_SIZE \
116 (512 * 1024) // Amount allocated to file
117 // system, 512kB
118 //#define FS_SIZE ( 1024 * 1024 ) // Amount allocated to file
119 // system, 1MB
120 #define FIRST_ADDR \
121 (FLASH_SIZE - FS_SIZE) // First file system address to
122 // use in the flash
123 #define BLOCKSTART \
124 (2) // First block where file system
125 // data starts (first 2
126 // blocks are DESCRIPTORS)
127
128 /*
129 * Descriptor Blocks:
130 * These blocks contain critical information about the file system, block
131 * allocation, wear information, and file/directory information. At least two
132 * descriptor blocks must be included in the system, which can be erased
133 * independently. An optional descriptor write cache may be configured which
134 * improves the performance of the file system. Please refer to the EFFS-STD
135 * implementation guide for additional information.
136 */
137 #define DESCSIZE (8 * 1024) // Size of one descriptor
138 #define DESCBLOCKSTART (0) // Position of first descriptor
139 #define DESCBLOCKEND (1) // Position of last descriptor
140 #define DESCCACHE (2048)
141
142 #endif /* _ONCHIPFLASH_H_ */

22.74 Parallax/src/flashChip/AM29LV160B.h
1 /* Revision: 3.3.8 */

NetBurner, Inc.
22.74 Parallax/src/flashChip/AM29LV160B.h 817

2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*------------------------------------------------------------------------------
28 * EFFS-STD configuration file for Spansion AM29LV160B flash chip. This file is
29 * part of an example that allocates 512kB of flash space to the file system,
30 * and the rest to the application.
31 *
32 * Note: The AM29LV160B is identical to the Spansion S29AL016D.
33 *
34 * To modify the amount of space allocated to the file system:
35 *
36 * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
37 * 2. Change the compcode memory address range for the application in your
38 * NBEclipse project settings so that the end of the application space does
39 * not exceed the start of the file system space. See the EFFS Programmer’s
40 * Guide for details, and the header comments in main.cpp of this example
41 * on how to make the changes in the NBEclipse project.
42 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
43 * to your NBEclipse project C/C++ build linker library options. See the header
44 * comments in main.cpp for this example on how to add the library in the
45 * NBEclipse project.
46 *----------------------------------------------------------------------------*/
47
48 #ifndef _ONCHIPFLASH_H_
49 #define _ONCHIPFLASH_H_
50
51 #include "file/fsf.h"
52 #include "basictypes.h"
53 #include "hal.h"
54
58 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
59
60 #define FLASH_NAME "S29AL016/AMDLV160"
61
65 #define FS_FLASHBASE (0xFFC00000)
66
125 #define BLOCKSIZE (64 * 1024) // Use only the 64k sectors
126 #define SECTORSIZE (16 * 1024) // 4 sectors per block
127 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
128
129 /*
130 * Specify the total amount of flash memory in the system, and the amount
131 * allocated to be used by the file system (the rest is used by the
132 * application).
133 */
134 #define FLASH_SIZE \
135 (2 * 1024 * 1024) // Size of total flash in the
136 // system, 2MB
137 #define FS_SIZE \
138 (512 * 1024) // Amount allocated to file
139 // system, 512kB
140 //#define FS_SIZE ( 1024 * 1024 ) // Amount allocated to file
141 // system, 1MB
142 #define FIRST_ADDR \
143 (FLASH_SIZE - FS_SIZE) // First file system address to
144 // use in the flash
145 #define BLOCKSTART \
146 (2) // First block where file system
147 // data starts (first 2
148 // blocks are DESCRIPTORS)
149
150 /*
151 * Descriptor Blocks:
152 * These blocks contain critical information about the file system, block

NetBurner, Inc.
818 File Documentation

153 * allocation, wear information, and file/directory information. At least two


154 * descriptor blocks must be included in the system, which can be erased
155 * independently. An optional descriptor write cache may be configured which
156 * improves the performance of the file system. Please refer to the EFFS-STD
157 * implementation guide for additional information.
158 */
159 #define DESCSIZE (8 * 1024) // Size of one descriptor
160 #define DESCBLOCKSTART (0) // Position of first descriptor
161 #define DESCBLOCKEND (1) // Position of last descriptor
162 #define DESCCACHE (2048)
163
164 #endif /* _ONCHIPFLASH_H_ */

22.75 _common/EFFS/STD/src/flashChip/AT49BV163D.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*------------------------------------------------------------------------------
6 * EFFS-STD configuration file for Atmel AT49BV163D flash chip. This file is
7 * part of an example that allocates 512kB of flash space to the file system,
8 * and the rest to the application.
9 *
10 * To modify the amount of space allocated to the file system:
11 *
12 * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
13 * 2. Change the compcode memory address range for the application in your
14 * NBEclipse project settings so that the end of the application space does
15 * not exceed the start of the file system space. See the EFFS Programmer’s
16 * Guide for details, and the header comments in main.cpp of this example
17 * on how to make the changes in the NBEclipse project.
18 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
19 * to your NBEclipse project C/C++ build linker library options. See the header
20 * comments in main.cpp for this example on how to add the library in the
21 * NBEclipse project.
22 *----------------------------------------------------------------------------*/
23
24 #ifndef _ONCHIPFLASH_H_
25 #define _ONCHIPFLASH_H_
26
27 #include "basictypes.h"
28 #include "hal.h"
29 #include "file/fsf.h"
30
34 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
35
36 #define FLASH_NAME "AT49BV163"
37
41 #define FS_FLASHBASE (0xFFC00000)
42
101 #define BLOCKSIZE (64 * 1024) // Use only the 64k sectors
102 #define SECTORSIZE (16 * 1024) // 4 sectors per block
103 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
104
105 /*
106 * Specify the total amount of flash memory in the system, and the amount
107 * allocated to be used by the file system (the rest is used by the
108 * application).
109 */
110 #define FLASH_SIZE \
111 (2 * 1024 * 1024) // Size of total flash in the
112 // system, 2MB
113 #define FS_SIZE \
114 (512 * 1024) // Amount allocated to file
115 // system, 512kB
116 #define FIRST_ADDR \
117 (FLASH_SIZE - FS_SIZE) // First file system address to
118 // use in the flash
119 #define BLOCKSTART \
120 (2) // First block where file system
121 // data starts (first 2
122 // blocks are DESCRIPTORS)
123
124 /*
125 * Descriptor Blocks:
126 * These blocks contain critical information about the file system, block
127 * allocation, wear information, and file/directory information. At least two
128 * descriptor blocks must be included in the system, which can be erased
129 * independently. An optional descriptor write cache may be configured which
130 * improves the performance of the file system. Please refer to the EFFS-STD
131 * implementation guide for additional information.
132 */
133 #define DESCSIZE (8 * 1024) // Size of one descriptor
134 #define DESCBLOCKSTART (0) // Position of first descriptor

NetBurner, Inc.
22.76 Parallax/src/flashChip/AT49BV163D.h 819

135 #define DESCBLOCKEND (1) // Position of last descriptor


136 #define DESCCACHE (2048)
137
138 #endif /* _ONCHIPFLASH_H_ */

22.76 Parallax/src/flashChip/AT49BV163D.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*------------------------------------------------------------------------------
28 * EFFS-STD configuration file for Atmel AT49BV163D flash chip. This file is
29 * part of an example that allocates 512kB of flash space to the file system,
30 * and the rest to the application.
31 *
32 * To modify the amount of space allocated to the file system:
33 *
34 * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
35 * 2. Change the compcode memory address range for the application in your
36 * NBEclipse project settings so that the end of the application space does
37 * not exceed the start of the file system space. See the EFFS Programmer’s
38 * Guide for details, and the header comments in main.cpp of this example
39 * on how to make the changes in the NBEclipse project.
40 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
41 * to your NBEclipse project C/C++ build linker library options. See the header
42 * comments in main.cpp for this example on how to add the library in the
43 * NBEclipse project.
44 *----------------------------------------------------------------------------*/
45
46 #ifndef _ONCHIPFLASH_H_
47 #define _ONCHIPFLASH_H_
48
49 #include "basictypes.h"
50 #include "hal.h"
51 #include "file/fsf.h"
52
56 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
57
58 #define FLASH_NAME "AT49BV163"
59
63 #define FS_FLASHBASE (0xFFC00000)
64
123 #define BLOCKSIZE (64 * 1024) // Use only the 64k sectors
124 #define SECTORSIZE (16 * 1024) // 4 sectors per block
125 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
126
127 /*
128 * Specify the total amount of flash memory in the system, and the amount
129 * allocated to be used by the file system (the rest is used by the
130 * application).
131 */
132 #define FLASH_SIZE \
133 (2 * 1024 * 1024) // Size of total flash in the
134 // system, 2MB
135 #define FS_SIZE \
136 (512 * 1024) // Amount allocated to file
137 // system, 512kB
138 #define FIRST_ADDR \
139 (FLASH_SIZE - FS_SIZE) // First file system address to
140 // use in the flash
141 #define BLOCKSTART \
142 (2) // First block where file system

NetBurner, Inc.
820 File Documentation

143 // data starts (first 2


144 // blocks are DESCRIPTORS)
145
146 /*
147 * Descriptor Blocks:
148 * These blocks contain critical information about the file system, block
149 * allocation, wear information, and file/directory information. At least two
150 * descriptor blocks must be included in the system, which can be erased
151 * independently. An optional descriptor write cache may be configured which
152 * improves the performance of the file system. Please refer to the EFFS-STD
153 * implementation guide for additional information.
154 */
155 #define DESCSIZE (8 * 1024) // Size of one descriptor
156 #define DESCBLOCKSTART (0) // Position of first descriptor
157 #define DESCBLOCKEND (1) // Position of last descriptor
158 #define DESCCACHE (2048)
159
160 #endif /* _ONCHIPFLASH_H_ */

22.77 _common/EFFS/STD/src/flashChip/MCF5282Flash.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*------------------------------------------------------------------------------
6 * EFFS-STD configuration file for MOD5282 processor flash memory. This file is part
7 * of an example that allocates 64kB of flash space to the file system, and the
8 * rest to the application.
9 *
10 * To modify the amount of space allocated to the file system:
11 *
12 * 1. Change the definition in this file: #define FS_SIZE ( 64 * 1024 )
13 * 2. Change the compcode memory address range for the application in your
14 * NBEclipse project settings so that the end of the application space does
15 * not exceed the start of the file system space. See the EFFS Programmer’s
16 * Guide for details, and the header comments in main.cpp of this example
17 * on how to make the changes in the NBEclipse project.
18 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
19 * to your NBEclipse project C/C++ build linker library options. See the header
20 * comments in main.cpp for this example on how to add the library in the
21 * NBEclipse project.
22 *----------------------------------------------------------------------------*/
23
24 #ifndef _ONCHIPFLASH_H_
25 #define _ONCHIPFLASH_H_
26
27 #include "basictypes.h"
28 #include "hal.h"
29 #include "file/fsf.h"
30
34 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
35
36 #define FLASH_NAME "MCF5282" // Processor name, not module name
37
41 #define FS_FLASHBASE (0xFFC00000)
42
98 #define BLOCKSIZE (4 * 1024) // All sectors are 4KB
99 #define SECTORSIZE (512) // 8 sectors per block
100 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
101
102 /*
103 * Specify the total amount of flash memory in the system, and the amount
104 * allocated to be used by the file system (the rest is used by the
105 * application).
106 */
107 #define FLASH_SIZE \
108 (512 * 1024) // Size of total flash in the
109 // system, 512kB
110 #define FS_SIZE \
111 (64 * 1024) // Amount allocated to file
112 // system, 64kB
113 #define FIRST_ADDR \
114 (FLASH_SIZE - FS_SIZE) // First file system address to
115 // use in the flash
116 #define BLOCKSTART \
117 (2) // First block where file system
118 // data starts (first 2
119 // blocks are DESCRIPTORS)
120
121 /*
122 * Descriptor Blocks:
123 * These blocks contain critical information about the file system, block
124 * allocation, wear information, and file/directory information. At least two
125 * descriptor blocks must be included in the system, which can be erased

NetBurner, Inc.
22.78 Parallax/src/flashChip/MCF5282Flash.h 821

126 * independently. An optional descriptor write cache may be configured which


127 * improves the performance of the file system. Please refer to the EFFS-STD
128 * implementation guide for additional information.
129 */
130 #define DESCSIZE (4 * 1024) // Size of one descriptor
131 #define DESCBLOCKSTART (0) // Position of first descriptor
132 #define DESCBLOCKEND (1) // Position of last descriptor
133 #define DESCCACHE (1024)
134
135 #endif /* _ONCHIPFLASH_H_ */

22.78 Parallax/src/flashChip/MCF5282Flash.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*------------------------------------------------------------------------------
28 * EFFS-STD configuration file for MOD5282 processor flash memory. This file is part
29 * of an example that allocates 64kB of flash space to the file system, and the
30 * rest to the application.
31 *
32 * To modify the amount of space allocated to the file system:
33 *
34 * 1. Change the definition in this file: #define FS_SIZE ( 64 * 1024 )
35 * 2. Change the compcode memory address range for the application in your
36 * NBEclipse project settings so that the end of the application space does
37 * not exceed the start of the file system space. See the EFFS Programmer’s
38 * Guide for details, and the header comments in main.cpp of this example
39 * on how to make the changes in the NBEclipse project.
40 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
41 * to your NBEclipse project C/C++ build linker library options. See the header
42 * comments in main.cpp for this example on how to add the library in the
43 * NBEclipse project.
44 *----------------------------------------------------------------------------*/
45
46 #ifndef _ONCHIPFLASH_H_
47 #define _ONCHIPFLASH_H_
48
49 #include "basictypes.h"
50 #include "hal.h"
51 #include "file/fsf.h"
52
56 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
57
58 #define FLASH_NAME "MCF5282" // Processor name, not module name
59
63 #define FS_FLASHBASE (0xFFC00000)
64
120 #define BLOCKSIZE (4 * 1024) // All sectors are 4KB
121 #define SECTORSIZE (512) // 8 sectors per block
122 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
123
124 /*
125 * Specify the total amount of flash memory in the system, and the amount
126 * allocated to be used by the file system (the rest is used by the
127 * application).
128 */
129 #define FLASH_SIZE \
130 (512 * 1024) // Size of total flash in the
131 // system, 512kB
132 #define FS_SIZE \
133 (64 * 1024) // Amount allocated to file

NetBurner, Inc.
822 File Documentation

134 // system, 64kB


135 #define FIRST_ADDR \
136 (FLASH_SIZE - FS_SIZE) // First file system address to
137 // use in the flash
138 #define BLOCKSTART \
139 (2) // First block where file system
140 // data starts (first 2
141 // blocks are DESCRIPTORS)
142
143 /*
144 * Descriptor Blocks:
145 * These blocks contain critical information about the file system, block
146 * allocation, wear information, and file/directory information. At least two
147 * descriptor blocks must be included in the system, which can be erased
148 * independently. An optional descriptor write cache may be configured which
149 * improves the performance of the file system. Please refer to the EFFS-STD
150 * implementation guide for additional information.
151 */
152 #define DESCSIZE (4 * 1024) // Size of one descriptor
153 #define DESCBLOCKSTART (0) // Position of first descriptor
154 #define DESCBLOCKEND (1) // Position of last descriptor
155 #define DESCCACHE (1024)
156
157 #endif /* _ONCHIPFLASH_H_ */

22.79 _common/EFFS/STD/src/flashChip/MX25L6406E.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*------------------------------------------------------------------------------
6 * EFFS-STD configuration file for 8MB SPI flash chip used on the NANO54415 and
7 * SB800EX.
8 *
9 * To modify the amount of space allocated to the file system:
10 *
11 * 1. Change the definition in this file: #define FS_SIZE ( 64 * 1024 )
12 * 2. Change the compcode memory address range for the application in your
13 * NBEclipse project settings (or makefile) so that the end of the
14 * application space does not exceed the start of the file system space.
15 * Refer to the EFFS Programming Guide section of the manual for more details.
16 * 3. Be sure to add the \Nburn\lib\StdFFile.a library to your NBEclipse project
17 * C/C++ build linker library options. See the header comments in main.cpp
18 * for this example on how to add the library in the NBEclipse project.
19 *----------------------------------------------------------------------------*/
20
21 #ifndef _ONCHIPFLASH_H_
22 #define _ONCHIPFLASH_H_
23
24 #include "basictypes.h"
25 #include "hal.h"
26 #include "file/fsf.h"
27
31 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
32
33 #define FLASH_NAME "MX25L6406E"
34
86 //#define FS_FLASHBASE ( 0x00000000 )
87
88 /*
89 * CHANGES TO COMPCODE FLAGS
90 * In NBEclipse, or your command line makefile, change the following line
91 * so the application will only occupy the specified application space.
92 * The first parameter is the start of application space, and the second
93 * is the address just below the file system space.
94 *
95 * COMPCODEFLAGS = 0x04000 0x800000 // Original
96 *
97 * COMPCODEFLAGS = 0x04000 0x700000 // space for file system
98 */
99
100 #define BLOCKSIZE (4 * 1024) // All sectors are 4KB
101 #define SECTORSIZE (512) // 8 sectors per block
102 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
103
104 /*
105 * Specify the total amount of flash memory in the system, and the amount
106 * allocated to be used by the file system (the rest is used by the
107 * application).
108 */
109 /* Example for a 64k file system */
110 //#define FLASH_SIZE ( 8*1024 * 1024 ) // Total flash space
111 //#define FS_SIZE ( 64 * 1024 ) // Amount of Flash allocated to file system
112 //#define FIRST_ADDR ( FLASH_SIZE - FS_SIZE ) // First Flash file system address

NetBurner, Inc.
22.80 Parallax/src/flashChip/MX25L6406E.h 823

113 //#define BLOCKSTART ( 2 ) // First block where file system data starts (first 2
blocks are DESCRIPTORS)
114
115 /* Example for a 1MB file system */
116 #define FLASH_SIZE (8 * 1024 * 1024) // Total flash space
117 #define FS_SIZE (1 * 1024 * 1024) // Amount of Flash allocated to file system
118 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // First Flash file system address
119 #define BLOCKSTART (16) // First block where file system data starts, after blocks
reserved for Descriptors
120
121 /*
122 * Descriptor Blocks:
123 * These blocks contain critical information about the file system, block
124 * allocation, wear information, and file/directory information. At least two
125 * descriptor blocks must be included in the system, which can be erased
126 * independently. An optional descriptor write cache may be configured which
127 * improves the performance of the file system. Please refer to the EFFS-STD
128 * implementation guide for additional information.
129 */
130 /* Example for a 64k file system */
131 //#define DESCSIZE ( 4 * 1024 ) // Size of one descriptor
132 //#define DESCBLOCKSTART ( 0 ) // Position of first descriptor
133 //#define DESCBLOCKEND ( 1 ) // Position of last descriptor
134 //#define DESCCACHE ( 1024 )
135
136 /* Example for a 1MB file system */
137 #define DESCSIZE (64 * 1024) // Size of one descriptor, 8 BLOCKS
138 #define DESCBLOCKSTART (0) // Position of first descriptor
139 #define DESCBLOCKEND (1) // Position of last descriptor
140 #define DESCCACHE (1024)
141
142 #endif /* _ONCHIPFLASH_H_ */

22.80 Parallax/src/flashChip/MX25L6406E.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*------------------------------------------------------------------------------
28 * EFFS-STD configuration file for 8MB SPI flash chip used on the NANO54415 and
29 * SB800EX.
30 *
31 * To modify the amount of space allocated to the file system:
32 *
33 * 1. Change the definition in this file: #define FS_SIZE ( 64 * 1024 )
34 * 2. Change the compcode memory address range for the application in your
35 * NBEclipse project settings (or makefile) so that the end of the
36 * application space does not exceed the start of the file system space.
37 * Refer to the EFFS Programming Guide section of the manual for more details.
38 * 3. Be sure to add the \Nburn\lib\StdFFile.a library to your NBEclipse project
39 * C/C++ build linker library options. See the header comments in main.cpp
40 * for this example on how to add the library in the NBEclipse project.
41 *----------------------------------------------------------------------------*/
42
43 #ifndef _ONCHIPFLASH_H_
44 #define _ONCHIPFLASH_H_
45
46 #include "basictypes.h"
47 #include "hal.h"
48 #include "file/fsf.h"
49
53 extern int fs_phy_OnChipFlash(FS_FLASH *flash);

NetBurner, Inc.
824 File Documentation

54
55 #define FLASH_NAME "MX25L6406E"
56
108 //#define FS_FLASHBASE ( 0x00000000 )
109
110 /*
111 * CHANGES TO COMPCODE FLAGS
112 * In NBEclipse, or your command line makefile, change the following line
113 * so the application will only occupy the specified application space.
114 * The first parameter is the start of application space, and the second
115 * is the address just below the file system space.
116 *
117 * COMPCODEFLAGS = 0x04000 0x800000 // Original
118 *
119 * COMPCODEFLAGS = 0x04000 0x700000 // space for file system
120 */
121
122 #define BLOCKSIZE (4 * 1024) // All sectors are 4KB
123 #define SECTORSIZE (512) // 8 sectors per block
124 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
125
126 /*
127 * Specify the total amount of flash memory in the system, and the amount
128 * allocated to be used by the file system (the rest is used by the
129 * application).
130 */
131 /* Example for a 64k file system */
132 //#define FLASH_SIZE ( 8*1024 * 1024 ) // Total flash space
133 //#define FS_SIZE ( 64 * 1024 ) // Amount of Flash allocated to file system
134 //#define FIRST_ADDR ( FLASH_SIZE - FS_SIZE ) // First Flash file system address
135 //#define BLOCKSTART ( 2 ) // First block where file system data starts (first 2
blocks are DESCRIPTORS)
136
137 /* Example for a 1MB file system */
138 #define FLASH_SIZE (8 * 1024 * 1024) // Total flash space
139 #define FS_SIZE (1 * 1024 * 1024) // Amount of Flash allocated to file system
140 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // First Flash file system address
141 #define BLOCKSTART (16) // First block where file system data starts, after blocks
reserved for Descriptors
142
143 /*
144 * Descriptor Blocks:
145 * These blocks contain critical information about the file system, block
146 * allocation, wear information, and file/directory information. At least two
147 * descriptor blocks must be included in the system, which can be erased
148 * independently. An optional descriptor write cache may be configured which
149 * improves the performance of the file system. Please refer to the EFFS-STD
150 * implementation guide for additional information.
151 */
152 /* Example for a 64k file system */
153 //#define DESCSIZE ( 4 * 1024 ) // Size of one descriptor
154 //#define DESCBLOCKSTART ( 0 ) // Position of first descriptor
155 //#define DESCBLOCKEND ( 1 ) // Position of last descriptor
156 //#define DESCCACHE ( 1024 )
157
158 /* Example for a 1MB file system */
159 #define DESCSIZE (64 * 1024) // Size of one descriptor, 8 BLOCKS
160 #define DESCBLOCKSTART (0) // Position of first descriptor
161 #define DESCBLOCKEND (1) // Position of last descriptor
162 #define DESCCACHE (1024)
163
164 #endif /* _ONCHIPFLASH_H_ */

22.81 _common/EFFS/STD/src/flashChip/MX29GL256F.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*-------------------------------------------------------------------
6 * EFFS-STD configuration file for Macronix MX29GL256F Flash Chip.
7 * This file is part of an example that allocats 512K of flash space
8 * to the file system, and the rest to the application.
9 *-----------------------------------------------------------------*/
10
11 #ifndef _ONCHIPFLASH_H_
12 #define _ONCHIPFLASH_H_
13
14 #include "file/fsf.h"
15 #include "basictypes.h"
16 #include "hal.h"
17
18 #define FLASH_NAME "MX29GL256"
19
20 /*functions implemented*/

NetBurner, Inc.
22.81 _common/EFFS/STD/src/flashChip/MX29GL256F.h 825

21 extern int fs_phy_OnChipFlash(FS_FLASH *flash);


22
23 // Start of Flash memory base address
24 #define FS_FLASHBASE (0xC0000000)
25
26 /*
27 * BLOCKSIZE
28 * This defines the size of the blocks to be used in the file storage area.
29 * This must be an erasable unit of the flash chip. All blocks in the file
30 * storage area must be the same size. This maybe different from the DESCSIZE
31 * where the flash chip has different size erasable units available.
32 *
33 * SECTORSIZE
34 * This defines the sector size. Each block is divided into a number of sectors.
35 * This number is the smallest usable unit in the system and thus represents the
36 * minimum file storage area. For best usage of the flash blocks the sector size
37 * should always be a power of 2. For more information see sector section below.
38 *
39 * SECTORPERBLOCK
40 * This defines the number of sectors in a block. It must always be true that:
41 * SECTORPERBLOCK = BLOCKSIZE/SECTORSIZE
42 *
43 *
44 * The memory map below is for a MOD5441x with a 32MB bottom boot block flash.
45 * This example will allocate 1.3MB for the file system.
46 * - 2 blocks are reserved for the file descriptors
47 * - 1 block is reserved as a free sector for the file system to operate
48 *
49 * A total of 10 blocks are allocated for the file system. Subtracting the 3 reserved
50 * as described above, the total file system free space is: 7 * 128k = 896k (917,504 bytes).
51 *
52 * Macronix MX29GL256F, 256 blocks of 128KB each, Total of 32MBytes
53 *
54 * Note: this header file is also valid for the Spansion/Cypress 32MB flash
55 *
56 * Address
57 * ----------
58 * ---------------------- C1FFF FFFF (End of flash space)
59 * | File System Data |
60 * | 1MB |
61 * | 128K x 8 Blocks |
62 * |--------------------| C1F0 0000 (Start of File System Data)
63 * | DESC BLOCK 0/1 |
64 * | 128K x 2 Blocks |
65 * |--------------------| C1EC 0000 (Start of File System)
66 * | |
67 * | Application |
68 * | 31.232MB |
69 * | 128K x 244 Blocks |
70 * | |
71 * |--------------------| C004 0000
72 * | 128K User Params |
73 * |--------------------| C002 0000
74 * | 128K System Params |
75 * |--------------------| C000 0000 (Start of Flash space)
76 *
77 *
78 * CHANGES TO COMPCODE FLAGS
79 * In NBEclipse, or your command line makefile, change the following line
80 * so the application will only occupy the specified application space.
81 * The first parameter is the start of application space, and the second
82 * is the address just below the file system space.
83 *
84 * COMPCODEFLAGS = 0xC0040000 0xC1FC0000
85 *
86 * If using NBEclipse:
87 * - Right-click on the project and select "Properties"
88 * - Select "NetBurner" in the left side of the dialog box
89 * - Verify the Platform is set to Mod5234, then check the "Use Custom Platform Settings" checkbox
90 * - Modify the "Compcode Memory Range" to the above values
91 *
92 *
93 * If using NBEclipse, you will also need to tell the linker to include the
94 * /nburn/platform/<platform>/original/lib/libStdFFile.a library. To do this right-click on your
95 * project, select properties, GNU Linker, then add the library.
96 *
97 */
98
99 /* WARNING: These settings are for MX29GL256F bottom boot block flash
100 * components used on the Mod54415
101 */
102 #define BLOCKSIZE (128 * 1024) // flash physical "sector" size
103 #define SECTORSIZE (1 * 1024) // file system sectors per BLOCK
104 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
105
106 /*
107 * Specify the total amount of flash memory in the system, and the amount

NetBurner, Inc.
826 File Documentation

108 * allocated to be used by the file system (the rest is used by the
109 * application.
110 */
111 #define FLASH_SIZE (32 * 1024 * 1024) // size of total flash in the system, 32MB
112 #define FS_SIZE \
113 (1280 * 1024) // amount allocated to file system: 2 Desc. plus 1MB for
data (8 x 128k)
114 // note that 1 block of file data will be reserved for the
file system
115 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // first file system address to use in the flash
116 #define BLOCKSTART \
117 2 // first block where file system data starts
118 // (first 2 blocks are DESCRIPTORS)
119
120 /*
121 * Descriptor Blocks:
122 * These blocks contain critical information about the file system, block allocation,
123 * wear information and file/directory information. At least two descriptor blocks
124 * must be included in the system, which can be erased independently. An optional
125 * descriptor write cache may be configured which improves the performance of the
126 * file system. Please refer to the EFFS-STD implementation guide for additional
127 * information.
128 */
129 #define DESCSIZE (128 * 1024) // size of one descriptor
130 #define DESCBLOCKSTART 0 // position of first descriptor
131 #define DESCBLOCKEND 1 // position of last descriptor
132 #define DESCCACHE 2048
133
134 #endif /* _ONCHIPFLASH_H_ */

22.82 Parallax/src/flashChip/MX29GL256F.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*-------------------------------------------------------------------
28 * EFFS-STD configuration file for Macronix MX29GL256F Flash Chip.
29 * This file is part of an example that allocats 512K of flash space
30 * to the file system, and the rest to the application.
31 *-----------------------------------------------------------------*/
32
33 #ifndef _ONCHIPFLASH_H_
34 #define _ONCHIPFLASH_H_
35
36 #include "file/fsf.h"
37 #include "basictypes.h"
38 #include "hal.h"
39
40 #define FLASH_NAME "MX29GL256"
41
42 /*functions implemented*/
43 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
44
45 // Start of Flash memory base address
46 #define FS_FLASHBASE (0xC0000000)
47
48 /*
49 * BLOCKSIZE
50 * This defines the size of the blocks to be used in the file storage area.
51 * This must be an erasable unit of the flash chip. All blocks in the file
52 * storage area must be the same size. This maybe different from the DESCSIZE
53 * where the flash chip has different size erasable units available.

NetBurner, Inc.
22.82 Parallax/src/flashChip/MX29GL256F.h 827

54 *
55 * SECTORSIZE
56 * This defines the sector size. Each block is divided into a number of sectors.
57 * This number is the smallest usable unit in the system and thus represents the
58 * minimum file storage area. For best usage of the flash blocks the sector size
59 * should always be a power of 2. For more information see sector section below.
60 *
61 * SECTORPERBLOCK
62 * This defines the number of sectors in a block. It must always be true that:
63 * SECTORPERBLOCK = BLOCKSIZE/SECTORSIZE
64 *
65 *
66 * The memory map below is for a MOD5441x with a 32MB bottom boot block flash.
67 * This example will allocate 1.3MB for the file system.
68 * - 2 blocks are reserved for the file descriptors
69 * - 1 block is reserved as a free sector for the file system to operate
70 *
71 * A total of 10 blocks are allocated for the file system. Subtracting the 3 reserved
72 * as described above, the total file system free space is: 7 * 128k = 896k (917,504 bytes).
73 *
74 * Macronix MX29GL256F, 256 blocks of 128KB each, Total of 32MBytes
75 *
76 * Note: this header file is also valid for the Spansion/Cypress 32MB flash
77 *
78 * Address
79 * ----------
80 * ---------------------- C1FFF FFFF (End of flash space)
81 * | File System Data |
82 * | 1MB |
83 * | 128K x 8 Blocks |
84 * |--------------------| C1F0 0000 (Start of File System Data)
85 * | DESC BLOCK 0/1 |
86 * | 128K x 2 Blocks |
87 * |--------------------| C1EC 0000 (Start of File System)
88 * | |
89 * | Application |
90 * | 31.232MB |
91 * | 128K x 244 Blocks |
92 * | |
93 * |--------------------| C004 0000
94 * | 128K User Params |
95 * |--------------------| C002 0000
96 * | 128K System Params |
97 * |--------------------| C000 0000 (Start of Flash space)
98 *
99 *
100 * CHANGES TO COMPCODE FLAGS
101 * In NBEclipse, or your command line makefile, change the following line
102 * so the application will only occupy the specified application space.
103 * The first parameter is the start of application space, and the second
104 * is the address just below the file system space.
105 *
106 * COMPCODEFLAGS = 0xC0040000 0xC1FC0000
107 *
108 * If using NBEclipse:
109 * - Right-click on the project and select "Properties"
110 * - Select "NetBurner" in the left side of the dialog box
111 * - Verify the Platform is set to Mod5234, then check the "Use Custom Platform Settings" checkbox
112 * - Modify the "Compcode Memory Range" to the above values
113 *
114 *
115 * If using NBEclipse, you will also need to tell the linker to include the
116 * /nburn/platform/<platform>/original/lib/libStdFFile.a library. To do this right-click on your
117 * project, select properties, GNU Linker, then add the library.
118 *
119 */
120
121 /* WARNING: These settings are for MX29GL256F bottom boot block flash
122 * components used on the Mod54415
123 */
124 #define BLOCKSIZE (128 * 1024) // flash physical "sector" size
125 #define SECTORSIZE (1 * 1024) // file system sectors per BLOCK
126 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
127
128 /*
129 * Specify the total amount of flash memory in the system, and the amount
130 * allocated to be used by the file system (the rest is used by the
131 * application.
132 */
133 #define FLASH_SIZE (32 * 1024 * 1024) // size of total flash in the system, 32MB
134 #define FS_SIZE \
135 (1280 * 1024) // amount allocated to file system: 2 Desc. plus 1MB for
data (8 x 128k)
136 // note that 1 block of file data will be reserved for the
file system
137 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // first file system address to use in the flash
138 #define BLOCKSTART \

NetBurner, Inc.
828 File Documentation

139 2 // first block where file system data starts


140 // (first 2 blocks are DESCRIPTORS)
141
142 /*
143 * Descriptor Blocks:
144 * These blocks contain critical information about the file system, block allocation,
145 * wear information and file/directory information. At least two descriptor blocks
146 * must be included in the system, which can be erased independently. An optional
147 * descriptor write cache may be configured which improves the performance of the
148 * file system. Please refer to the EFFS-STD implementation guide for additional
149 * information.
150 */
151 #define DESCSIZE (128 * 1024) // size of one descriptor
152 #define DESCBLOCKSTART 0 // position of first descriptor
153 #define DESCBLOCKEND 1 // position of last descriptor
154 #define DESCCACHE 2048
155
156 #endif /* _ONCHIPFLASH_H_ */

22.83 _common/EFFS/STD/src/flashChip/S29GL032.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*------------------------------------------------------------------------------
6 * EFFS-STD configuration file for Spansion S29GL032A 4MByte flash chip. This file is
7 * part of an example that allocates 1MB of flash space to the file system,
8 * and the rest to the application.
9 *
10 * To modify the amount of space allocated to the file system:
11 *
12 * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
13 * 2. Change the compcode memory address range for the application in your
14 * NBEclipse project settings so that the end of the application space does
15 * not exceed the start of the file system space. See the EFFS Programmer’s
16 * Guide for details, and the header comments in main.cpp of this example
17 * on how to make the changes in the NBEclipse project.
18 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
19 * to your NBEclipse project C/C++ build linker library options. See the header
20 * comments in main.cpp for this example on how to add the library in the
21 * NBEclipse project.
22 *----------------------------------------------------------------------------*/
23
24 #ifndef _ONCHIPFLASH_H_
25 #define _ONCHIPFLASH_H_
26
27 #include "file/fsf.h"
28 #include "basictypes.h"
29 #include "hal.h"
30
31 #define FLASH_NAME "S29GL032A"
32
33 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
34
35 /* Start of flash memory base address */
36 #define FS_FLASHBASE (0xFF800000)
37
93 #define BLOCKSIZE (64 * 1024) // Use only the 64k sectors
94 #define SECTORSIZE (16 * 1024) // 4 sectors per block
95 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
96
97 /*
98 * Specify the total amount of flash memory in the system, and the amount
99 * allocated to be used by the file system (the rest is used by the
100 * application).
101 */
102 #define FLASH_SIZE (4 * 1024 * 1024) // Size of total flash in the system, 4MB
103 #define FS_SIZE (1024 * 1024) // Amount allocated to file system, 1MB
104 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // First file system address to use in the flash
105 #define BLOCKSTART (2) // First block where file system data starts (first 2 blocks
are DESCRIPTORS)
106
107 /*
108 * Descriptor Blocks:
109 * These blocks contain critical information about the file system, block
110 * allocation, wear information, and file/directory information. At least two
111 * descriptor blocks must be included in the system, which can be erased
112 * independently. An optional descriptor write cache may be configured which
113 * improves the performance of the file system. Please refer to the EFFS-STD
114 * implementation guide for additional information.
115 */
116 #define DESCSIZE (8 * 1024) // Size of one descriptor
117 #define DESCBLOCKSTART (0) // Position of first descriptor
118 #define DESCBLOCKEND (1) // Position of last descriptor

NetBurner, Inc.
22.84 Parallax/src/flashChip/S29GL032.h 829

119 #define DESCCACHE (2048)


120
121 #endif /* _ONCHIPFLASH_H_ */

22.84 Parallax/src/flashChip/S29GL032.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*------------------------------------------------------------------------------
28 * EFFS-STD configuration file for Spansion S29GL032A 4MByte flash chip. This file is
29 * part of an example that allocates 1MB of flash space to the file system,
30 * and the rest to the application.
31 *
32 * To modify the amount of space allocated to the file system:
33 *
34 * 1. Change the definition in this file: #define FS_SIZE ( 1024 * 1024 )
35 * 2. Change the compcode memory address range for the application in your
36 * NBEclipse project settings so that the end of the application space does
37 * not exceed the start of the file system space. See the EFFS Programmer’s
38 * Guide for details, and the header comments in main.cpp of this example
39 * on how to make the changes in the NBEclipse project.
40 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
41 * to your NBEclipse project C/C++ build linker library options. See the header
42 * comments in main.cpp for this example on how to add the library in the
43 * NBEclipse project.
44 *----------------------------------------------------------------------------*/
45
46 #ifndef _ONCHIPFLASH_H_
47 #define _ONCHIPFLASH_H_
48
49 #include "file/fsf.h"
50 #include "basictypes.h"
51 #include "hal.h"
52
53 #define FLASH_NAME "S29GL032A"
54
55 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
56
57 /* Start of flash memory base address */
58 #define FS_FLASHBASE (0xFF800000)
59
115 #define BLOCKSIZE (64 * 1024) // Use only the 64k sectors
116 #define SECTORSIZE (16 * 1024) // 4 sectors per block
117 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
118
119 /*
120 * Specify the total amount of flash memory in the system, and the amount
121 * allocated to be used by the file system (the rest is used by the
122 * application).
123 */
124 #define FLASH_SIZE (4 * 1024 * 1024) // Size of total flash in the system, 4MB
125 #define FS_SIZE (1024 * 1024) // Amount allocated to file system, 1MB
126 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // First file system address to use in the flash
127 #define BLOCKSTART (2) // First block where file system data starts (first 2 blocks
are DESCRIPTORS)
128
129 /*
130 * Descriptor Blocks:
131 * These blocks contain critical information about the file system, block
132 * allocation, wear information, and file/directory information. At least two
133 * descriptor blocks must be included in the system, which can be erased

NetBurner, Inc.
830 File Documentation

134 * independently. An optional descriptor write cache may be configured which


135 * improves the performance of the file system. Please refer to the EFFS-STD
136 * implementation guide for additional information.
137 */
138 #define DESCSIZE (8 * 1024) // Size of one descriptor
139 #define DESCBLOCKSTART (0) // Position of first descriptor
140 #define DESCBLOCKEND (1) // Position of last descriptor
141 #define DESCCACHE (2048)
142
143 #endif /* _ONCHIPFLASH_H_ */

22.85 _common/EFFS/STD/src/flashChip/SAME70Q21.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*-------------------------------------------------------------------
6 * EFFS-STD configuration file for MicroChip SAME70Q21 Flash Chip.
7 * This file is part of an example that allocates 512K of flash space
8 * to the file system, and the rest to the application.
9 *-----------------------------------------------------------------*/
10
11 #ifndef _ONCHIPFLASH_H_
12 #define _ONCHIPFLASH_H_
13
14 #include "file/fsf.h"
15 #include "basictypes.h"
16 #include "hal.h"
17
18 #define FLASH_NAME "SAME70Q21"
19
20 /*functions implemented*/
21 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
22
23 // Start of Flash memory base address
24 #define FS_FLASHBASE (0x00400000)
25
26 /*
27 * BLOCKSIZE
28 * This defines the size of the blocks to be used in the file storage area.
29 * This must be an erasable unit of the flash chip. All blocks in the file
30 * storage area must be the same size. This maybe different from the DESCSIZE
31 * where the flash chip has different size erasable units available.
32 *
33 * SECTORSIZE
34 * This defines the sector size. Each block is divided into a number of sectors.
35 * This number is the smallest usable unit in the system and thus represents the
36 * minimum file storage area. For best usage of the flash blocks the sector size
37 * should always be a power of 2. For more information see sector section below.
38 *
39 * SECTORPERBLOCK
40 * This defines the number of sectors in a block. It must always be true that:
41 * SECTORPERBLOCK = BLOCKSIZE/SECTORSIZE
42 *
43 *
44 * The memory map below is for a MODM7AE70 with a 2MB bottom boot block flash.
45 * This example will allocate 1.5MB for the application space, and 512KB for
46 * the file system.
47 *
48 * Microchip SAME70Q21:
49 * The memory is organized in sectors. Each sector has a size of 128KB. The
50 * first sector is divided into 3 smaller sectors. The three smaller sectors are
51 * organized in 2 sectors of 8KB and 1 sector of 112KB.
52 * Total number of bytes for storage: 2,097,152. Application space: 1.97MB max.
53 *
54 * Address
55 * ----------
56 * ---------------------- 005F FFFF (End of flash space)
57 * | File System Data |
58 * | 256KB |
59 * | 128K x 2 Blocks |
60 * |--------------------| 005C 0000 (Start of File System Data)
61 * | DESC BLOCK 0/1 |
62 * | 128K x 2 Blocks |
63 * |--------------------| 0058 0000 (Start of File System)
64 * | |
65 * | Application |
66 * | 1.375MB |
67 * | 128K x 11 Blocks |
68 * | |
69 * |--------------------| 0040 6004
70 * | 8K User Params |
71 * |--------------------| 0040 4000
72 * | 10K Configuration |

NetBurner, Inc.
22.86 Parallax/src/flashChip/SAME70Q21.h 831

73 * |--------------------| 0040 1800


74 * | 6K Monitor |
75 * |--------------------| 0040 0000 (Start of Flash space)
76 *
77 *
78 * CHANGES TO COMPCODE FLAGS
79 * In NBEclipse, or your command line makefile, change the following line
80 * so the application will only occupy the specified application space.
81 * The first parameter is the start of application space, and the second
82 * is the address just below the file system space.
83 *
84 * COMPCODEFLAGS = 0x00406004 0x00580000
85 *
86 * If using NBEclipse:
87 * - Right-click on the project and select "Properties"
88 * - Select "NetBurner" in the left side of the dialog box
89 * - Verify the Platform is set to Mod5234, then check the "Use Custom Platform Settings" checkbox
90 * - Modify the "Compcode Memory Range" to the above values
91 *
92 *
93 * If using NBEclipse, you will also need to tell the linker to include the
94 * /nburn/platform/<platform>/original/lib/libStdFFile.a library. To do this right-click on your
95 * project, select properties, GNU Linker, then add the library.
96 *
97 */
98
99 /* WARNING: These settings are for MX29GL256F bottom boot block flash
100 * components used on the Mod54415
101 */
102 #define BLOCKSIZE (16 * 512) // flash physical "sector" size
103 #define SECTORSIZE (512) // file system sectors per BLOCK
104 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
105
106 /*
107 * Specify the total amount of flash memory in the system, and the amount
108 * allocated to be used by the file system (the rest is used by the
109 * application.
110 */
111 #define FLASH_SIZE (2 * 1024 * 1024) // size of total flash in the system, 2MB
112 #define FS_SIZE \
113 (256 * 512) // amount allocated to file system: 2 Desc. plus 1MB for
data (8 x 128k)
114 // note that 1 block of file data will be reserved for the
file system
115 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // first file system address to use in the flash
116 #define BLOCKSTART \
117 2 // first block where file system data starts
118 // (first 2 blocks are DESCRIPTORS)
119
120 /*
121 * Descriptor Blocks:
122 * These blocks contain critical information about the file system, block allocation,
123 * wear information and file/directory information. At least two descriptor blocks
124 * must be included in the system, which can be erased independently. An optional
125 * descriptor write cache may be configured which improves the performance of the
126 * file system. Please refer to the EFFS-STD implementation guide for additional
127 * information.
128 */
129 #define DESCSIZE (16 * 512) // size of one descriptor
130 #define DESCBLOCKSTART 0 // position of first descriptor
131 #define DESCBLOCKEND 1 // position of last descriptor
132 #define DESCCACHE 1024
133
134 #endif /* _ONCHIPFLASH_H_ */

22.86 Parallax/src/flashChip/SAME70Q21.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with

NetBurner, Inc.
832 File Documentation

19 * the use of this program.


20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*-------------------------------------------------------------------
28 * EFFS-STD configuration file for MicroChip SAME70Q21 Flash Chip.
29 * This file is part of an example that allocates 512K of flash space
30 * to the file system, and the rest to the application.
31 *-----------------------------------------------------------------*/
32
33 #ifndef _ONCHIPFLASH_H_
34 #define _ONCHIPFLASH_H_
35
36 #include "file/fsf.h"
37 #include "basictypes.h"
38 #include "hal.h"
39
40 #define FLASH_NAME "SAME70Q21"
41
42 /*functions implemented*/
43 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
44
45 // Start of Flash memory base address
46 #define FS_FLASHBASE (0x00400000)
47
48 /*
49 * BLOCKSIZE
50 * This defines the size of the blocks to be used in the file storage area.
51 * This must be an erasable unit of the flash chip. All blocks in the file
52 * storage area must be the same size. This maybe different from the DESCSIZE
53 * where the flash chip has different size erasable units available.
54 *
55 * SECTORSIZE
56 * This defines the sector size. Each block is divided into a number of sectors.
57 * This number is the smallest usable unit in the system and thus represents the
58 * minimum file storage area. For best usage of the flash blocks the sector size
59 * should always be a power of 2. For more information see sector section below.
60 *
61 * SECTORPERBLOCK
62 * This defines the number of sectors in a block. It must always be true that:
63 * SECTORPERBLOCK = BLOCKSIZE/SECTORSIZE
64 *
65 *
66 * The memory map below is for a MODM7AE70 with a 2MB bottom boot block flash.
67 * This example will allocate 1.5MB for the application space, and 512KB for
68 * the file system.
69 *
70 * Microchip SAME70Q21:
71 * The memory is organized in sectors. Each sector has a size of 128KB. The
72 * first sector is divided into 3 smaller sectors. The three smaller sectors are
73 * organized in 2 sectors of 8KB and 1 sector of 112KB.
74 * Each 128k sector is organized in pages of 512 bytes. so each 128k sector has 256 pages of 512 bytes.
75 * Total number of bytes for storage: 2,097,152. Application space: 1.97MB max.
76 *
77 * Address
78 * ----------
79 * ---------------------- 005F FFFF (End of flash space)
80 * | File System Data |
81 * | 256KB |
82 * | 128K x 2 Blocks |
83 * |--------------------| 005C 0000 (Start of File System Data)
84 * | DESC BLOCK 0/1 |
85 * | 128K x 2 Blocks |
86 * |--------------------| 0058 0000 (Start of File System)
87 * | |
88 * | Application |
89 * | 1.375MB |
90 * | 128K x 11 Blocks |
91 * | |
92 * |--------------------| 0040 6004
93 * | 8K User Params |
94 * |--------------------| 0040 4000
95 * | 10K Configuration |
96 * |--------------------| 0040 1800
97 * | 6K Monitor |
98 * |--------------------| 0040 0000 (Start of Flash space)
99 *
100 *
101 * CHANGES TO COMPCODE FLAGS
102 * In NBEclipse, or your command line makefile, change the following line
103 * so the application will only occupy the specified application space.
104 * The first parameter is the start of application space, and the second
105 * is the address just below the file system space.

NetBurner, Inc.
22.87 _common/EFFS/STD/src/flashChip/SST39VF040.h 833

106 *
107 * COMPCODEFLAGS = 0x00406004 0x00580000
108 *
109 * If using NBEclipse:
110 * - Right-click on the project and select "Properties"
111 * - Select "NetBurner" in the left side of the dialog box
112 * - Verify the Platform is set to Mod5234, then check the "Use Custom Platform Settings" checkbox
113 * - Modify the "Compcode Memory Range" to the above values
114 *
115 *
116 * If using NBEclipse, you will also need to tell the linker to include the
117 * /nburn/platform/<platform>/original/lib/libStdFFile.a library. To do this right-click on your
118 * project, select properties, GNU Linker, then add the library.
119 *
120 */
121
122 /* WARNING: These settings are for MX29GL256F bottom boot block flash
123 * components used on the Mod54415
124 */
125 #define BLOCKSIZE (16 * 512) // flash physical "sector" size
126 #define SECTORSIZE (512) // file system sectors per BLOCK
127 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
128
129 /*
130 * Specify the total amount of flash memory in the system, and the amount
131 * allocated to be used by the file system (the rest is used by the
132 * application.
133 */
134 #define FLASH_SIZE (2 * 1024 * 1024) // size of total flash in the system, 2MB
135 #define FS_SIZE (7 * 256 * 512) // amount allocated to file system: 2 Descriptor blocks +
file storage
136 // note that 1 block of file data will be reserved for the
file system
137 #define FIRST_ADDR (FLASH_SIZE - FS_SIZE) // first file system address to use in the flash
138 #define BLOCKSTART 2 // first block where file system data starts
139 // (first 2 blocks are DESCRIPTORS)
140
141 /*
142 * Descriptor Blocks:
143 * These blocks contain critical information about the file system, block allocation,
144 * wear information and file/directory information. At least two descriptor blocks
145 * must be included in the system, which can be erased independently. An optional
146 * descriptor write cache may be configured which improves the performance of the
147 * file system. Please refer to the EFFS-STD implementation guide for additional
148 * information.
149 */
150 #define DESCSIZE (16 * 512) // size of one descriptor
151 #define DESCBLOCKSTART 0 // position of first descriptor
152 #define DESCBLOCKEND 1 // position of last descriptor
153 #define DESCCACHE 1024
154
155 #endif /* _ONCHIPFLASH_H_ */

22.87 _common/EFFS/STD/src/flashChip/SST39VF040.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*------------------------------------------------------------------------------
6 * EFFS-STD configuration file for SST39V040 flash memory chip. This file is part
7 * of an example that allocates 64KB of flash space to the file system, and the
8 * rest to the application.
9 *
10 * To modify the amount of space allocated to the file system:
11 *
12 * 1. Change the definition in this file: #define FS_SIZE ( 64 * 1024 )
13 * 2. Change the compcode memory address range for the application in your
14 * NBEclipse project settings so that the end of the application space does
15 * not exceed the start of the file system space. See the EFFS Programmer’s
16 * Guide for details, and the header comments in main.cpp of this example
17 * on how to make the changes in the NBEclipse project.
18 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
19 * to your NBEclipse project C/C++ build linker library options. See the header
20 * comments in main.cpp for this example on how to add the library in the
21 * NBEclipse project.
22 *----------------------------------------------------------------------------*/
23
24 #ifndef _ONCHIPFLASH_H_
25 #define _ONCHIPFLASH_H_
26
27 #include "basictypes.h"
28 #include "hal.h"
29 #include "file/fsf.h"
30

NetBurner, Inc.
834 File Documentation

34 extern int fs_phy_OnChipFlash(FS_FLASH *flash);


35
36 #define FLASH_NAME "SST39VF040"
37
41 #define FS_FLASHBASE (0xFFC00000)
42
99 #define BLOCKSIZE (4 * 1024) // Use only the 64k sectors
100 #define SECTORSIZE (512) // 8 sectors per block
101 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
102
103 /*
104 * Specify the total amount of flash memory in the system, and the amount
105 * allocated to be used by the file system (the rest is used by the
106 * application).
107 */
108 #define FLASH_SIZE \
109 (512 * 1024) // Size of total flash in the
110 // system, 512kB
111 #define FS_SIZE \
112 (64 * 1024) // Amount allocated to file
113 // system, 64kB
114 #define FIRST_ADDR \
115 (FLASH_SIZE - FS_SIZE) // First file system address to
116 // use in the flash
117 #define BLOCKSTART \
118 (2) // First block where file system
119 // data starts (first 2
120 // blocks are DESCRIPTORS)
121
122 /*
123 * Descriptor Blocks:
124 * These blocks contain critical information about the file system, block
125 * allocation, wear information, and file/directory information. At least two
126 * descriptor blocks must be included in the system, which can be erased
127 * independently. An optional descriptor write cache may be configured which
128 * improves the performance of the file system. Please refer to the EFFS-STD
129 * implementation guide for additional information.
130 */
131 #define DESCSIZE (4 * 1024) // Size of one descriptor
132 #define DESCBLOCKSTART (0) // Position of first descriptor
133 #define DESCBLOCKEND (1) // Position of last descriptor
134 #define DESCCACHE (1024)
135
136 #endif /* _ONCHIPFLASH_H_ */

22.88 Parallax/src/flashChip/SST39VF040.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 /*------------------------------------------------------------------------------
28 * EFFS-STD configuration file for SST39V040 flash memory chip. This file is part
29 * of an example that allocates 64KB of flash space to the file system, and the
30 * rest to the application.
31 *
32 * To modify the amount of space allocated to the file system:
33 *
34 * 1. Change the definition in this file: #define FS_SIZE ( 64 * 1024 )
35 * 2. Change the compcode memory address range for the application in your
36 * NBEclipse project settings so that the end of the application space does
37 * not exceed the start of the file system space. See the EFFS Programmer’s
38 * Guide for details, and the header comments in main.cpp of this example

NetBurner, Inc.
22.89 Parallax/src/formtools.h 835

39 * on how to make the changes in the NBEclipse project.


40 * 3. Be sure to add the /nburn/platform/<platform>/original/lib/libStdFFile.a library
41 * to your NBEclipse project C/C++ build linker library options. See the header
42 * comments in main.cpp for this example on how to add the library in the
43 * NBEclipse project.
44 *----------------------------------------------------------------------------*/
45
46 #ifndef _ONCHIPFLASH_H_
47 #define _ONCHIPFLASH_H_
48
49 #include "basictypes.h"
50 #include "hal.h"
51 #include "file/fsf.h"
52
56 extern int fs_phy_OnChipFlash(FS_FLASH *flash);
57
58 #define FLASH_NAME "SST39VF040"
59
63 #define FS_FLASHBASE (0xFFC00000)
64
121 #define BLOCKSIZE (4 * 1024) // Use only the 64k sectors
122 #define SECTORSIZE (512) // 8 sectors per block
123 #define SECTORPERBLOCK (BLOCKSIZE / SECTORSIZE)
124
125 /*
126 * Specify the total amount of flash memory in the system, and the amount
127 * allocated to be used by the file system (the rest is used by the
128 * application).
129 */
130 #define FLASH_SIZE \
131 (512 * 1024) // Size of total flash in the
132 // system, 512kB
133 #define FS_SIZE \
134 (64 * 1024) // Amount allocated to file
135 // system, 64kB
136 #define FIRST_ADDR \
137 (FLASH_SIZE - FS_SIZE) // First file system address to
138 // use in the flash
139 #define BLOCKSTART \
140 (2) // First block where file system
141 // data starts (first 2
142 // blocks are DESCRIPTORS)
143
144 /*
145 * Descriptor Blocks:
146 * These blocks contain critical information about the file system, block
147 * allocation, wear information, and file/directory information. At least two
148 * descriptor blocks must be included in the system, which can be erased
149 * independently. An optional descriptor write cache may be configured which
150 * improves the performance of the file system. Please refer to the EFFS-STD
151 * implementation guide for additional information.
152 */
153 #define DESCSIZE (4 * 1024) // Size of one descriptor
154 #define DESCBLOCKSTART (0) // Position of first descriptor
155 #define DESCBLOCKEND (1) // Position of last descriptor
156 #define DESCCACHE (1024)
157
158 #endif /* _ONCHIPFLASH_H_ */

22.89 Parallax/src/formtools.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef FORM_TOOL_H
6 #define FORM_TOOL_H
7
8
9 /* Functiosn to manage HTML form creation and data extraction */
10
11 /* Output a select */
12 /* Item 1 = first selection item !!! */
13 void FormOutputSelect( int sock, const char *name, int selnum, const char **list );
14
15
16 /* Outout a Check box */
17 void FormOutputCheckbox( int sock, const char *name, BOOL checked );
18
19 /* Output an input box */
20 void FormOutputInput( int sock, const char *name, int siz, const char *val );
21
22 /* Output an input box for numbers */
23 void FormOutputNumInput( int sock, const char *name, int siz, int val );
24

NetBurner, Inc.
836 File Documentation

25 /*Output an input box for IP addresses */


26 void FormOutputIPInput( int sock, const char *name, IPADDR ip );
27
28
29 void ShowIP2Sock( int sock, IPADDR ip );
30
31 #endif
32

22.90 serial/SerialBurner/src/formtools.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FORM_TOOL_H_
6 #define _FORM_TOOL_H_
7
8 void ShowIP2Sock(int sock, IPADDR ip);
9
10 /* -----------------------------------------------------------------------------
11 * Functions to manage HTML form creation.
12 * -------------------------------------------------------------------------- */
13
14 // Output a selection
15 // Item 1 = First selection item!
16 void FormOutputSelect(int sock, const char *name, int selnum, const char **list);
17 void FormOutputSelectValueOnClick(int sock,
18 const char *name,
19 int selnum,
20 const char **labellist,
21 const char **valuelist,
22 const char **onclicklist);
23
24 // Output a check box
25 void FormOutputCheckbox(int sock, const char *name, BOOL checked);
26
27 // Output an input box
28 void FormOutputInput(int sock, const char *name, int siz, const char *val);
29
30 // Output an input box for numbers
31 void FormOutputNumInput(int sock, const char *name, int siz, int val);
32
33 // Output an input box for IP addresses
34 void FormOutputIPInput(int sock, const char *name, IPADDR ip);
35
36 /* -----------------------------------------------------------------------------
37 * Functions to manage HTML data extraction.
38 *--------------------------------------------------------------------------- */
39
40 // Extract an IP address from the post data
41 IPADDR FormExtractIP(const char *name, char *pData, IPADDR def_val);
42
43 // Extract a number from the post data
44 long FormExtractNum(const char *name, char *pData, long def_val);
45
46 // Extract a check box state from the post data
47 BOOL FormExtractCheck(const char *name, char *pData, BOOL def_val);
48
49 // Extract a selection from a select box
50 // Item 1 = First selection item!
51 int FormExtractSel(const char *name, char *pdata, const char **pList, int defsel);
52
53 #endif /* _FORM_TOOL_H_ */

22.91 SSH/SecureSerToEthFactoryApp/src/formtools.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FORM_TOOL_H_
6 #define _FORM_TOOL_H_
7
8 #include <config_obj.h>
9 #include <nettypes.h>
10
11 #define PROTOCOL_HTML_INPUT_NAME "Protocol"
12 #define DEVICE_ADDRESS_HTML_INPUT_NAME "DeviceAddress"
13 #define DEVICE_MASK_HTML_INPUT_NAME "DeviceMask"
14 #define DEVICE_GATE_HTML_INPUT_NAME "DeviceGate"
15 #define DEVICE_DNS_HTML_INPUT_NAME "DeviceDns"

NetBurner, Inc.
22.92 SSL/HttpsUploadCert/src/formtools.h 837

16 #define DEVICE_NAME_HTML_INPUT_NAME "DeviceName"


17 #define NTP_NAME_HTML_INPUT_NAME "NTPName"
18
19 void ShowIP2Sock(int sock, IPADDR ip);
20
21 /* -----------------------------------------------------------------------------
22 * Functions to manage HTML form creation.
23 * -------------------------------------------------------------------------- */
24
25 unsigned char asciiString2Byte(unsigned char *value);
26 // Output a selection
27 // Item 1 = First selection item!
28 void FormOutputSelect(int sock, const char *name, int selnum, const char **list);
29 void FormOutputSelectValueOnClick(int sock,
30 const char *name,
31 int selnum,
32 const char **labellist,
33 const char **valuelist,
34 const char **onclicklist);
35
36 // Output a check box
37 void FormOutputCheckbox(int sock, const char *name, bool checked);
38
39 // // Output an input box
40 // void FormOutputInput( int sock, const char* name, int siz, const char* val );
41
42 // // Output an input box for numbers
43 // void FormOutputNumInput( int sock, const char* name, int siz, int val );
44
45 // // Output an input box for bytes
46 // void FormOutputByteInput(int sock, const char* name, int siz, int val);
47
48 // // Output an input box for IP addresses
49 // void FormOutputIPInput( int sock, const char* name, IPADDR4 ip );
50
51 // Output value and choices of a config_chooser as a drop down select box
52 // void FormOutputConfigChooser(int sock, const char* name, config_chooser chooser);
53
54 /* -----------------------------------------------------------------------------
55 * Functions to manage HTML data extraction.
56 *--------------------------------------------------------------------------- */
57
58 // // Extract an IP address from the post data
59 // IPADDR4 FormExtractIP( const char* name, char* pData, IPADDR4 def_val );
60
61 // // Extract a number from the post data
62 // long FormExtractNum( const char* name, char* pData, long def_val );
63
64 // // Extract a byte from the post data
65 // long FormExtractByte(const char* name, char* pData, long def_val);
66
67 // // Extract a check box state from the post data
68 // bool FormExtractCheck( const char* name, char* pData, bool def_val );
69
70 int ExtractPostData(PCSTR name, PCSTR data, PSTR dest_buffer, int maxlen);
71
72 #endif /* _FORM_TOOL_H_ */

22.92 SSL/HttpsUploadCert/src/formtools.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FORM_TOOL_H_
6 #define _FORM_TOOL_H_
7
14 void ShowIP2Sock(int sock, IPADDR ip);
15
30 void FormOutputSelect(int sock, const char *name, int selnum, const char **list);
31
42 void FormOutputSelectValueOnClick(int sock,
43 const char *name,
44 int selnum,
45 const char **labellist,
46 const char **valuelist,
47 const char **onclicklist);
48
56 void FormOutputCheckbox(int sock, const char *name, BOOL checked);
57
66 void FormOutputInput(int sock, const char *name, int siz, const char *val);
67
76 void FormOutputNumInput(int sock, const char *name, int siz, int val);
77
85 void FormOutputIPInput(int sock, const char *name, IPADDR ip);

NetBurner, Inc.
838 File Documentation

86
87 #endif /* _FORM_TOOL_H_ */

22.93 _common/EFFS/STD/src/fs_main.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef __FS_MAIN_H
6 #define __FS_MAIN_H
7
8 #define USE_NOR
9
10 /* Drive numbers */
11 #define NOR_DRV_NUM 0
12 #define STDRAM_DRV_NUM 1
13 #define MMC_DRV_NUM 2
14 #define CFC_DRV_NUM 3
15 #define HDD_DRV_NUM 3
16 #define FATRAM_DRV_NUM 4
17
18 #if ((defined USE_NOR) | (defined USE_STDRAM)) & ((defined USE_CFC) | (defined USE_HDD) | (defined
USE_MMC) | (defined USE_FATRAM))
19 #define FS_WRAPPER
20 #elif (defined USE_NOR) | (defined USE_STDRAM)
21 #define FS_STD
22 #elif (defined USE_CFC) | (defined USE_HDD) | (defined USE_MMC) | (defined USE_FATRAM)
23 #define FS_FAT
24 #endif
25
26 #include "file/fsf.h"
27 #define fd_mountstd fs_mountdrive
28 #define fd_format(d, t) fs_format(d)
29 #define fd_hardformat(d, t) fs_format(d)
30 #define fd_getdrive fs_getdrive
31 #define fd_chdrive fs_chdrive
32 #define fd_getcwd fs_getcwd
33 #define fd_chdir fs_chdir
34 #define fd_mkdir fs_mkdir
35 #define fd_rmdir fs_rmdir
36 #define fd_getfreespace fs_getfreespace
37 #define fd_findfirst fs_findfirst
38 #define fd_findnext fs_findnext
39 #define fd_filelength fs_filelength
40 #define fd_delete fs_delete
41 #define fd_rename fs_rename
42 #define fd_open fs_open
43 #define fd_close fs_close
44 #define fd_read fs_read
45 #define fd_write fs_write
46 #define FD_FIND FS_FIND
47 #define FD_FILE FS_FILE
48 #define FD_SPACE FS_SPACE
49 #define FD_ATTR_DIR FS_ATTR_DIR
50
51 #endif /* __FS_MAIN_H */

22.94 Parallax/src/fs_main.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr

NetBurner, Inc.
22.95 _common/EFFS/STD/src/ftp_fs.h 839

23 * San Diego, CA 92127


24 * www.netburner.com
25 ******************************************************************************/
26
27 #ifndef __FS_MAIN_H
28 #define __FS_MAIN_H
29
30 #define USE_NOR
31
32 /* Drive numbers */
33 #define NOR_DRV_NUM 0
34 #define STDRAM_DRV_NUM 1
35 #define MMC_DRV_NUM 2
36 #define CFC_DRV_NUM 3
37 #define HDD_DRV_NUM 3
38 #define FATRAM_DRV_NUM 4
39
40 #if ((defined USE_NOR) | (defined USE_STDRAM)) & ((defined USE_CFC) | (defined USE_HDD) | (defined
USE_MMC) | (defined USE_FATRAM))
41 #define FS_WRAPPER
42 #elif (defined USE_NOR) | (defined USE_STDRAM)
43 #define FS_STD
44 #elif (defined USE_CFC) | (defined USE_HDD) | (defined USE_MMC) | (defined USE_FATRAM)
45 #define FS_FAT
46 #endif
47
48 #include "file/fsf.h"
49 #define fd_mountstd fs_mountdrive
50 #define fd_format(d, t) fs_format(d)
51 #define fd_hardformat(d, t) fs_format(d)
52 #define fd_getdrive fs_getdrive
53 #define fd_chdrive fs_chdrive
54 #define fd_getcwd fs_getcwd
55 #define fd_chdir fs_chdir
56 #define fd_mkdir fs_mkdir
57 #define fd_rmdir fs_rmdir
58 #define fd_getfreespace fs_getfreespace
59 #define fd_findfirst fs_findfirst
60 #define fd_findnext fs_findnext
61 #define fd_filelength fs_filelength
62 #define fd_delete fs_delete
63 #define fd_rename fs_rename
64 #define fd_open fs_open
65 #define fd_close fs_close
66 #define fd_read fs_read
67 #define fd_write fs_write
68 #define FD_FIND FS_FIND
69 #define FD_FILE FS_FILE
70 #define FD_SPACE FS_SPACE
71 #define FD_ATTR_DIR FS_ATTR_DIR
72
73 #endif /* __FS_MAIN_H */

22.95 _common/EFFS/STD/src/ftp_fs.h
1 /*NB_REVISION*/
2
3 /*******************************************************************************
4 *
5 * Copyright (c) 2003 by HCC Embedded
6 *
7 * This software is copyrighted by and is the sole property of HCC. All
8 * rights, title, ownership, or other interests in the software remain the
9 * property of HCC. This software may only be used in accordance with the
10 * corresponding license agreement. Any unauthorized use, duplication,
11 * transmission, distribution, or disclosure of this software is expressly
12 * forbidden.
13 *
14 * This copyright notice may not be removed or modified without prior written
15 * consent of HCC.
16 *
17 * HCC reserves the right to modify this software without notice.
18 *
19 * HCC Embedded
20 * Budapest 1132
21 * Victor Hugo Utca 11-15
22 * Hungary
23 *
24 * Tel: +36 (1) 450 1302
25 * Fax: +36 (1) 450 1303
26 * http: www.hcc-embedded.com
27 * E-mail: [email protected]
28 *
29 ******************************************************************************/
30

NetBurner, Inc.
840 File Documentation

31 #ifndef _FTP_F_H
32 #define _FTP_F_H
33
34 #if ((defined USE_NOR) | (defined USE_STDRAM)) & ((defined USE_CFC) | (defined USE_HDD) | (defined
USE_MMC) | (defined USE_FATRAM))
35 #define FS_WRAPPER
36 #elif (defined USE_NOR) | (defined USE_STDRAM)
37 #define FS_STD
38 #elif (defined USE_CFC) | (defined USE_HDD) | (defined USE_MMC) | (defined USE_FATRAM)
39 #define FS_FAT
40 #endif
41
42 #endif /* _FTP_F_H */

22.96 Parallax/src/ftp_fs.h
1 /* Revision: 3.3.8 */
2
3 /*******************************************************************************
4 *
5 * Copyright (c) 2003 by HCC Embedded
6 *
7 * This software is copyrighted by and is the sole property of HCC. All
8 * rights, title, ownership, or other interests in the software remain the
9 * property of HCC. This software may only be used in accordance with the
10 * corresponding license agreement. Any unauthorized use, duplication,
11 * transmission, distribution, or disclosure of this software is expressly
12 * forbidden.
13 *
14 * This copyright notice may not be removed or modified without prior written
15 * consent of HCC.
16 *
17 * HCC reserves the right to modify this software without notice.
18 *
19 * HCC Embedded
20 * Budapest 1132
21 * Victor Hugo Utca 11-15
22 * Hungary
23 *
24 * Tel: +36 (1) 450 1302
25 * Fax: +36 (1) 450 1303
26 * http: www.hcc-embedded.com
27 * E-mail: [email protected]
28 *
29 ******************************************************************************/
30
31 #ifndef _FTP_F_H
32 #define _FTP_F_H
33
34 #if ((defined USE_NOR) | (defined USE_STDRAM)) & ((defined USE_CFC) | (defined USE_HDD) | (defined
USE_MMC) | (defined USE_FATRAM))
35 #define FS_WRAPPER
36 #elif (defined USE_NOR) | (defined USE_STDRAM)
37 #define FS_STD
38 #elif (defined USE_CFC) | (defined USE_HDD) | (defined USE_MMC) | (defined USE_FATRAM)
39 #define FS_FAT
40 #endif
41
42 #endif /* _FTP_F_H */

22.97 _common/EFFS/FAT/src/http_f.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _HTTP_F_H
6 #define _HTTP_F_H
7
8 void RegisterWebFuncs();
9
10 #endif /* _HTTP_F_H */

22.98 _common/EFFS/STD/src/http_f.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4

NetBurner, Inc.
22.99 _common/MultiPlatform/WavPlayer/src/http_f.h 841

5 #ifndef _HTTP_F_H
6 #define _HTTP_F_H
7
8 void RegisterWebFuncs();
9
10 #endif /* _HTTP_F_H */

22.99 _common/MultiPlatform/WavPlayer/src/http_f.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _HTTP_F_H
6 #define _HTTP_F_H
7
8 void RegisterWebFuncs();
9
10 #endif /* _HTTP_F_H */

22.100 Parallax/src/http_f.h
1 /* Revision: 3.3.8 */
2
3 /******************************************************************************
4 * Copyright 1998-2022 NetBurner, Inc. ALL RIGHTS RESERVED
5 *
6 * Permission is hereby granted to purchasers of NetBurner Hardware to use or
7 * modify this computer program for any use as long as the resultant program
8 * is only executed on NetBurner provided hardware.
9 *
10 * No other rights to use this program or its derivatives in part or in
11 * whole are granted.
12 *
13 * It may be possible to license this or other NetBurner software for use on
14 * non-NetBurner Hardware. Contact [email protected] for more information.
15 *
16 * NetBurner makes no representation or warranties with respect to the
17 * performance of this computer program, and specifically disclaims any
18 * responsibility for any damages, special or consequential, connected with
19 * the use of this program.
20 *
21 * NetBurner
22 * 16855 W Bernardo Dr
23 * San Diego, CA 92127
24 * www.netburner.com
25 ******************************************************************************/
26
27 #ifndef _HTTP_F_H
28 #define _HTTP_F_H
29
30 void RegisterWebFuncs();
31
32 #endif /* _HTTP_F_H */

22.101 Parallax/src/nvsettings.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5
6 #define REG_VAR_SIZE 64 // Standard register variable size in bytes
7 #define DEV_NAME_SIZE 40 // Device name size in bytes
8 #define HTTP_PORT_SIZE 10 // HTTP port size in bytes
9
10
11 /* The structure that holds the configuration data */
12 struct NV_SettingsStruct
13 {
14 uint32_t DataBaudRate;
15 char DeviceName[DEV_NAME_SIZE];
16 uint8_t Output_Bits;
17 uint8_t Output_Stop;
18 uint8_t Output_Parity;
19 uint8_t IP_Addr_mode;
20 uint8_t Var_ET[REG_VAR_SIZE];
21 uint8_t Var_EF[REG_VAR_SIZE];
22 uint8_t Var_ES[REG_VAR_SIZE];

NetBurner, Inc.
842 File Documentation

23 uint8_t Var_EC[REG_VAR_SIZE];
24 uint8_t Var_EV[REG_VAR_SIZE];
25 uint8_t Var_EU[REG_VAR_SIZE];
26 uint8_t Var_EP[REG_VAR_SIZE];
27 uint8_t Var_EA[REG_VAR_SIZE];
28 uint8_t Var_EW[REG_VAR_SIZE];
29 uint8_t Var_BI[REG_VAR_SIZE];
30 uint8_t Var_BM[REG_VAR_SIZE];
31 uint8_t Var_BP[REG_VAR_SIZE];
32 uint8_t Var_XX[20][REG_VAR_SIZE];
33 uint8_t Config_User[20];
34 uint8_t Config_Pass[20];
35 uint8_t Web_User[20];
36 uint8_t Web_Pass[20];
37 uint8_t Web_Text[20];
38 uint8_t Var_HP[HTTP_PORT_SIZE]; // HTTP port number for var interface
39 uint32_t VerifyKey;
40 };
41
42
43 /* Declare global variable */
44 extern struct NV_SettingsStruct NV_Settings;
45 extern volatile BOOL Settings_Changed;
46
47
48 /* Constants that go with IP_Addr_mode */
49 #define IP_ADDR_MODE_DHCP (1)
50 #define IP_ADDR_MODE_STATIC (2)
51
52 /* Number of NB_Vars */
53 #define NB_VAR_CNT 250
54
55 extern uint8_t Var_ET[REG_VAR_SIZE];
56 extern uint8_t Var_EF[REG_VAR_SIZE];
57 extern uint8_t Var_ES[REG_VAR_SIZE];
58 extern uint8_t Var_EC[REG_VAR_SIZE];
59 extern uint8_t Var_EV[REG_VAR_SIZE];
60 extern uint8_t Var_EU[REG_VAR_SIZE];
61 extern uint8_t Var_EP[REG_VAR_SIZE];
62 extern uint8_t Var_EA[REG_VAR_SIZE];
63 extern uint8_t Var_EW[REG_VAR_SIZE];
64 extern uint8_t Var_BI[REG_VAR_SIZE];
65 extern uint8_t Var_BM[REG_VAR_SIZE];
66 extern uint8_t Var_BP[REG_VAR_SIZE];
67 extern uint8_t Var_XX[NB_VAR_CNT][REG_VAR_SIZE];
68
69 extern uint8_t Var_SI[REG_VAR_SIZE]; // Current IP Address
70 extern uint8_t Var_SN[REG_VAR_SIZE]; // Current Network MASK
71 extern uint8_t Var_SG[REG_VAR_SIZE]; // Current Gateway Address
72 extern uint8_t Var_SD[REG_VAR_SIZE]; // Current DNS Server Address
73 extern uint8_t Var_SU[REG_VAR_SIZE]; // Last UDP IP received
74 extern uint8_t Var_HP[REG_VAR_SIZE]; // HTTP port number
75 extern uint8_t PostVar;
76 extern uint8_t StatusVar;
77
78 #define BIT_VALID_LINK (1)
79 #define BIT_POST_UPDATE (2)
80 #define BIT_READY_TO_SEND_EMAIL (4)
81 #define BIT_EMAIL_SUCCESS (16)
82 #define BIT_UDP_RECEIVED (32);
83
84 #define PARALLAX_UDP_PORT (10000)
85
86
87 /*-------------------------------------------------------------------
88 Check NV Settings. Assign default values if VerifyKey is not
89 valid.
90 ------------------------------------------------------------------*/
91 void CheckNVSettings();
92

22.102 serial/SerialBurner/src/nvsettings.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NVSETTINGS_H_
6 #define _NVSETTINGS_H_
7
8 #define VERIFY_KEY (0x48666050) // NV Settings key code
9
10 /*
11 * The default number of seconds between receiving TCP chars before a timeout occurs.
12 * The system default timeout, TCP_WRITE_TIMEOUT, is 10 seconds, which is the minimum

NetBurner, Inc.
22.103 SSH/SshServerUserKey/src/nvsettings.h 843

13 * timeout value. A timeout value of 0 will disable the timeout feature.


14 * */
15 #define DEF_INACTIVITY_TIMEOUT (60) // inactivity timeout in seconds
16
17 /* If a new client TCP connection is attempted while one is active,
18 * one of the following three actions can be taken:
19 * a) Ignore the incoming connection (leave current connection active)
20 * (set override timeout to 0xFFFFFFFF)
21 * b) Replace the existing connection if it has been idle for a specified number of seconds.
22 * (set override to the number of seconds to wait)
23 * c) Always replace the existing connection.
24 * (set override to 0 seconds)
25 *
26 * This is done with the override timeout setting below:
27 * The default number of seconds to wait before a new connection can override an
28 * existing connection.
29 */
30 #define DEF_OVERRIDE_TIMEOUT (20)
31
32 struct NV_SettingsStruct
33 {
34 uint32_t VerifyKey;
35 uint16_t ServerListenPort;
36 uint16_t ClientTimeout;
37 uint16_t ClientOverrideTimeout;
38 uint32_t DataBaudRate;
39 uint16_t SerialDataFlowControl;
40 };
41
42 extern NV_SettingsStruct NV_Settings; // Non-volatile settings to store in flash memory
43
44 #endif

22.103 SSH/SshServerUserKey/src/nvsettings.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef NVSETTINGS_H_
6 #define NVSETTINGS_H_
7
8 #include <basictypes.h>
9 #include "nbfactory.h"
10
11 // Configuration verify key (increment if data changed, added, reorganized)
12 #define NB_FACTORY_VERIFY_KEY (0x5e545064)
13 #define NTP_NAME_LENGTH (35)
14 #define DEVICE_NAME_LENGTH (15)
15
16 struct NV_SettingsStruct
17 {
18 char DeviceName[(DEVICE_NAME_LENGTH + 1)];
19 char NTPName[NTP_NAME_LENGTH + 1];
20 // IPADDR NTP_Addr;
21
22 /* SSH key source and lengths (default and user installed) */
23 uint8_t SshKeyEccSource; // Library default, app default, or user installed
24 uint16_t SshKeyEccLength;
25 uint8_t SshKeyRsaSource; // Library default, app default, or user installed
26 uint16_t SshKeyRsaLength;
27
28 /* Version verification key */
29 uint32_t VerifyKey;
30 };
31
32 extern void CheckNVSettings(BOOL returnToFactory);
33
34 #endif /* NVSETTINGS_H_ */

22.104 _common/EFFS/FAT/src/cardtype.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* Select the card type */
6 #ifndef _CARDTYPE_H
7 #define _CARDTYPE_H
8
9 /*
10 Change between devices by uncommenting one or the other. You cannot

NetBurner, Inc.
844 File Documentation

11 use both types at the same time. Whenever you change card types, you
12 should do a make clean on your project.
13
14 Warning! You must have CFC bus interface hardware on your platform or
15 the code will repeatedly trap. If you are getting traps you will need to
16 perform an application download using the monitor program to recover.
17 */
18 // #define USE_SDHC // SD/SDHC cards
19 #define USE_MMC // SD/MMC cards
20 //#define USE_CFC // Compact Flash cards
21 //#define USE_RAM // RAM FileSystem, See EFFS-RAM-minimal for details
22
23 #if (defined USE_CFC)
24 #define EXT_FLASH_DRV_NUM (CFC_DRV_NUM)
25 #elif (defined USE_RAM)
26 #define EXT_FLASH_DRV_NUM (F_RAM_DRIVE0)
27 #elif (defined USE_MMC)
28 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
29 #elif (defined USE_SDHC)
30 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
31 #else
32 #define EXT_FLASH_DRV_NUM (-1)
33 #endif
34
35 #endif /* _CARDTYPE_H */

22.105 _common/MultiPlatform/EffsLoadAppFromFlash←-
Card/src/cardtype.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* Select the card type */
6 #ifndef _CARDTYPE_H
7 #define _CARDTYPE_H
8
9 /*
10 Change between devices by uncommenting one or the other. You cannot
11 use both types at the same time. Whenever you change card types, you
12 should do a make clean on your project.
13
14 Warning! You must have CFC bus interface hardware on your platform or
15 the code will repeatedly trap. If you are getting traps you will need to
16 perform an application download using the monitor program to recover.
17 */
18 // #define USE_SDHC // SD/SDHC cards
19 #define USE_MMC // SD/MMC cards
20 //#define USE_CFC // Compact Flash cards
21 //#define USE_RAM // RAM FileSystem, See EFFS-RAM-minimal for details
22
23 #if (defined USE_CFC)
24 #define EXT_FLASH_DRV_NUM (CFC_DRV_NUM)
25 #elif (defined USE_RAM)
26 #define EXT_FLASH_DRV_NUM (F_RAM_DRIVE0)
27 #elif (defined USE_MMC)
28 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
29 #elif (defined USE_SDHC)
30 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
31 #else
32 #define EXT_FLASH_DRV_NUM (-1)
33 #endif
34
35 #endif /* _CARDTYPE_H */

22.106 _common/MultiPlatform/EffsSDHC/src/cardtype.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* Select the card type */
6 #ifndef _CARDTYPE_H
7 #define _CARDTYPE_H
8
9 /*
10 Change between devices by uncommenting one or the other. You cannot
11 use both types at the same time. Whenever you change card types, you
12 should do a make clean on your project.
13
14 Warning! You must have CFC bus interface hardware on your platform or

NetBurner, Inc.
22.107 _common/MultiPlatform/WavPlayer/src/cardtype.h 845

15 the code will repeatedly trap. If you are getting traps you will need to
16 perform an application download using the monitor program to recover.
17 */
18 // #define USE_SDHC // SD/SDHC cards
19 #define USE_MMC // SD/MMC cards
20 //#define USE_CFC // Compact Flash cards
21 //#define USE_RAM // RAM FileSystem, See EFFS-RAM-minimal for details
22
23 #if (defined USE_CFC)
24 #define EXT_FLASH_DRV_NUM (CFC_DRV_NUM)
25 #elif (defined USE_RAM)
26 #define EXT_FLASH_DRV_NUM (F_RAM_DRIVE0)
27 #elif (defined USE_MMC)
28 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
29 #elif (defined USE_SDHC)
30 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
31 #else
32 #define EXT_FLASH_DRV_NUM (-1)
33 #endif
34
35 #endif /* _CARDTYPE_H */

22.107 _common/MultiPlatform/WavPlayer/src/cardtype.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* Select the card type */
6 #ifndef _CARDTYPE_H
7 #define _CARDTYPE_H
8
9 /*
10 Change between devices by uncommenting one or the other. You cannot
11 use both types at the same time. Whenever you change card types, you
12 should do a make clean on your project.
13
14 Warning! You must have CFC bus interface hardware on your platform or
15 the code will repeatedly trap. If you are getting traps you will need to
16 perform an application download using the monitor program to recover.
17 */
18 #define USE_MMC // SD/MMC cards
19 //#define USE_CFC // Compact Flash cards
20 //#define USE_RAM // RAM FileSystem, See EFFS-RAM-minimal for details
21 //#define EXT_FLASH_DRV_NUM (F_RAM_DRIVE0)
22
23 #if (defined USE_CFC)
24 #define EXT_FLASH_DRV_NUM (CFC_DRV_NUM)
25 #else
26 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
27 #endif
28
29 #endif /* _CARDTYPE_H */

22.108 PlatformSpecific/MOD5441X/Mod5441xFactory←-
App/src/cardtype.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* Select the card type */
6 #ifndef _CARDTYPE_H
7 #define _CARDTYPE_H
8
9 /*
10 Change between devices by uncommenting one or the other. You cannot
11 use both types at the same time. Whenever you change card types, you
12 should do a make clean on your project.
13
14 Warning! You must have CFC bus interface hardware on your platform or
15 the code will repeatedly trap. If you are getting traps you will need to
16 perform an application download using the monitor program to recover.
17 */
18 #define USE_MMC // SD/MMC cards
19 //#define USE_CFC // Compact Flash cards
20 //#define USE_RAM // RAM FileSystem, See EFFS-RAM-minimal for details
21 //#define EXT_FLASH_DRV_NUM (F_RAM_DRIVE0)
22
23 #if (defined USE_CFC)
24 #define EXT_FLASH_DRV_NUM (CFC_DRV_NUM)

NetBurner, Inc.
846 File Documentation

25 #else
26 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
27 #endif
28
29 #endif /* _CARDTYPE_H */

22.109 SSH/SecureSerToEthFactoryApp/src/cardtype.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* Select the card type */
6 #ifndef _CARDTYPE_H
7 #define _CARDTYPE_H
8
9 /*
10 Change between devices by uncommenting one or the other. You cannot
11 use both types at the same time. Whenever you change card types, you
12 should do a make clean on your project.
13
14 Warning! You must have CFC bus interface hardware on your platform or
15 the code will repeatedly trap. If you are getting traps you will need to
16 perform an application download using the monitor program to recover.
17 */
18 // #define USE_SDHC // SD/SDHC cards
19 #define USE_MMC // SD/MMC cards
20 //#define USE_CFC // Compact Flash cards
21 //#define USE_RAM // RAM FileSystem, See EFFS-RAM-minimal for details
22
23 #if (defined USE_CFC)
24 #define EXT_FLASH_DRV_NUM (CFC_DRV_NUM)
25 #elif (defined USE_RAM)
26 #define EXT_FLASH_DRV_NUM (F_RAM_DRIVE0)
27 #elif (defined USE_MMC)
28 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
29 #elif (defined USE_SDHC)
30 #define EXT_FLASH_DRV_NUM (MMC_DRV_NUM)
31 #else
32 #define EXT_FLASH_DRV_NUM (-1)
33 #endif
34
35 #endif /* _CARDTYPE_H */

22.110 _common/MultiPlatform/ADC/SimpleADC/src/SimpleAD.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
6
7 void StartAD(); // Start A/D conversion set.
8
9 bool ADDone(); // Return true if the conversion is complete
10
11 uint16_t GetADResult(int ch); // Return the AD Result

22.111 PlatformSpecific/MOD5441X/Mod5441xFactoryApp/src/Simple←-
AD.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
6 void StartAD(); // Start A/D conversion set
7 bool ADDone(); // Return true if the conversion is complete
8 uint16_t GetADResult(int ch); // Return the AD Result

22.112 PlatformSpecific/MODM7AE70/ADC_Simple/src/SimpleAD.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/

NetBurner, Inc.
22.113 PlatformSpecific/NANO54415/NANO54415FactoryApp/src/SimpleAD.h 847

4
5 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
6
7 // Enable or disable individual AFEC channels
8 void ADConfigCh(unsigned nAfec, unsigned ch, bool enable);
9
10 void StartAD(); // Start A/D conversion set.
11
12 bool ADDone(); // Return true if the conversion is complete
13
14 uint16_t GetADResult(unsigned nAfec, unsigned ch); // Return the AD Result

22.113 PlatformSpecific/NANO54415/NANO54415FactoryApp/src/←-
SimpleAD.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
6
7 void StartAD(); // Start A/D conversion set.
8
9 bool ADDone(); // Return true if the conversion is complete
10
11 uint16_t GetADResult(int ch); // Return the AD Result

22.114 PlatformSpecific/SOMRT1061/ADC_Simple/src/SimpleAD.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
6
7 // Enable or disable individual AFEC channels
8 void ADConfigCh(unsigned nAfec, unsigned ch, bool enable);
9
10 void StartAD(); // Start A/D conversion set.
11
12 bool ADDone(); // Return true if the conversion is complete
13
14 uint16_t GetADResult(unsigned nAfec, unsigned ch); // Return the AD Result

22.115 WebSockets/DIPSwitches/src/SimpleAD.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #include <basictypes.h>
6
7 // Setup the A/D converter to be ready to run
8 void InitSingleEndAD();
9
10 // Start A/D conversion set.
11 void StartAD();
12
13 // Return true if the conversion is complete
14 bool ADDone();
15
16 // Return the AD Result
17 uint16_t GetADResult(int ch);

22.116 tests.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _TESTS_H_
6 #define _TESTS_H_
7
8 void displayEffsErrorCode(int code);
9 void doSingleMemCardTest(int mmc_drive);

NetBurner, Inc.
848 File Documentation

10 void doDualMemCardTest(void);
11 void doManfTest(void);
12
13 #endif /* _TESTS_H_ */

22.117 webfuncs.cpp File Reference


This code module contains the web functions for the POP3 mail using SSL example program.
#include <crypto/ssl_pop3.h>
#include <dns.h>
#include <effs_fat/fat.h>
#include <httppost.h>
#include <mailto.h>
#include <netinterface.h>
#include <stdlib.h>
#include "FileSystemUtils.h"
#include "cardtype.h"

Functions
• void WebDisplayDhcpSelect (int sock, PCSTR url)
Displays if the network values are statically set or assigned by DHCP.
• void WebShowDhcpDeviceIpAddress (int sock, PCSTR url)
Displays the active IP value.
• void WebShowStaticDeviceIpAddress (int sock, PCSTR url)
Displays the static IP value.
• void WebShowDhcpDeviceIpMask (int sock, PCSTR url)
Displays the active IP mask value.
• void WebShowStaticDeviceIpMask (int sock, PCSTR url)
Displays the static IP mask value.
• void WebShowDhcpDeviceGateway (int sock, PCSTR url)
Displays the active gateway value.
• void WebShowStaticDeviceGateway (int sock, PCSTR url)
Displays the static gateway value.
• void WebShowDhcpDeviceDnsServer (int sock, PCSTR url)
Displays the active DNS server value.
• void WebShowStaticDeviceDnsServer (int sock, PCSTR url)
Displays the static DNS server value.
• void WebShowDeviceName (int sock, PCSTR url)
Displays the device's name form value.
• void WebShowUserValue (int sock, PCSTR url)
Displays the current username form value.
• void WebShowUserPass (int sock, PCSTR url)
Displays the current user password form value.
• void WebShowServer (int sock, PCSTR url)
Displays the current destination server form value.
• void LastResult (int sock, PCSTR url)
Displays the results of the request and any associated information with the request. If email messages were success-
fully returned, then links to those pages will be added to the page.
• void POP3_GetMessages (int session)
POP3_GetMessages.
• void HandleGetMailPost (int sock, PostEvents event, const char ∗pName, const char ∗pValue)
Handles the post for the get mail post request. This callback is called for each field of a post form.
• int HandleMailGet (int sock, HTTP_Request &pr)
A GET callback function that displays the email saved on the file system in the browser.

NetBurner, Inc.
22.117 webfuncs.cpp File Reference 849

22.117.1 Detailed Description


This code module contains the web functions for the POP3 mail using SSL example program.

22.117.2 Function Documentation

22.117.2.1 HandleGetMailPost()

void HandleGetMailPost (
int sock,
PostEvents event,
const char ∗ pName,
const char ∗ pValue )
Handles the post for the get mail post request. This callback is called for each field of a post form.

Parameters
sock HTTP socket.
event The kind of post event that is currently being handled with this callback.
pName The name of the post element that is currently being handled.
pValue The value of the post element that is currently being handled.

22.117.2.2 HandleMailGet()

int HandleMailGet (
int sock,
HTTP_Request & pr )
A GET callback function that displays the email saved on the file system in the browser.

Parameters
sock HTTP socket.
pr The HTTP request object associated with the request.

Return values

0 If the file was found and sent.


-1 If the file was not found or unable to be sent.

22.117.2.3 LastResult()

void LastResult (
int sock,
PCSTR url )
Displays the results of the request and any associated information with the request. If email messages were suc-
cessfully returned, then links to those pages will be added to the page.

Parameters

sock HTTP Socket


url Calling page

NetBurner, Inc.
850 File Documentation

22.117.2.4 POP3_GetMessages()

void POP3_GetMessages (
int session )
POP3_GetMessages.

Parameters
session The session number associated with the connection.

22.117.2.5 WebDisplayDhcpSelect()

void WebDisplayDhcpSelect (
int sock,
PCSTR url )
Displays if the network values are statically set or assigned by DHCP.

Parameters

sock HTTP Socket


url Calling page

22.117.2.6 WebShowDeviceName()

void WebShowDeviceName (
int sock,
PCSTR url )
Displays the device's name form value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.7 WebShowDhcpDeviceDnsServer()

void WebShowDhcpDeviceDnsServer (
int sock,
PCSTR url )
Displays the active DNS server value.

Parameters

sock HTTP Socket


url Calling page

NetBurner, Inc.
22.117 webfuncs.cpp File Reference 851

22.117.2.8 WebShowDhcpDeviceGateway()

void WebShowDhcpDeviceGateway (
int sock,
PCSTR url )
Displays the active gateway value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.9 WebShowDhcpDeviceIpAddress()

void WebShowDhcpDeviceIpAddress (
int sock,
PCSTR url )
Displays the active IP value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.10 WebShowDhcpDeviceIpMask()

void WebShowDhcpDeviceIpMask (
int sock,
PCSTR url )
Displays the active IP mask value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.11 WebShowServer()

void WebShowServer (
int sock,
PCSTR url )
Displays the current destination server form value.

Parameters

sock HTTP Socket


url Calling page

NetBurner, Inc.
852 File Documentation

22.117.2.12 WebShowStaticDeviceDnsServer()

void WebShowStaticDeviceDnsServer (
int sock,
PCSTR url )
Displays the static DNS server value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.13 WebShowStaticDeviceGateway()

void WebShowStaticDeviceGateway (
int sock,
PCSTR url )
Displays the static gateway value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.14 WebShowStaticDeviceIpAddress()

void WebShowStaticDeviceIpAddress (
int sock,
PCSTR url )
Displays the static IP value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.15 WebShowStaticDeviceIpMask()

void WebShowStaticDeviceIpMask (
int sock,
PCSTR url )
Displays the static IP mask value.

Parameters

sock HTTP Socket


url Calling page

NetBurner, Inc.
22.118 _common/MultiPlatform/PulseGenerator-Counter/src/webfuncs.h 853

22.117.2.16 WebShowUserPass()

void WebShowUserPass (
int sock,
PCSTR url )
Displays the current user password form value.

Parameters

sock HTTP Socket


url Calling page

22.117.2.17 WebShowUserValue()

void WebShowUserValue (
int sock,
PCSTR url )
Displays the current username form value.

Parameters

sock HTTP Socket


url Calling page

22.118 _common/MultiPlatform/PulseGenerator-Counter/src/webfuncs.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _WEBFUNCS_H_
6 #define _WEBFUNCS_H_
7
8 const char FirmwareVersion[] = "v1.0 " __DATE__ "";
9
10 #endif /* _WEBFUNCS_H_ */

22.119 PlatformSpecific/MOD5441X/Mod5441xFactory←-
App/src/webfuncs.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _WEBFUNCS_H_
6 #define _WEBFUNCS_H_
7
8 const char FirmwareVersion[] = "MOD54415 Factory Demo Program v1.13 " __DATE__ "";
9
10 #endif /* _WEBFUNCS_H_ */

22.120 PlatformSpecific/MODM7AE70/MODM7AE70Factory←-
App/src/webfuncs.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _WEBFUNCS_H_
6 #define _WEBFUNCS_H_
7

NetBurner, Inc.
854 File Documentation

8 const char FirmwareVersion[] =


9 "MODM7AE70 Factory Demo Program v1.3 "__DATE__
10 "";
11
12 #endif /* _WEBFUNCS_H_ */

22.121 PlatformSpecific/NANO54415/NANO54415Factory←-
App/src/webfuncs.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _WEBFUNCS_H_
6 #define _WEBFUNCS_H_
7
8 const char FirmwareVersion[] = "NANO54415 Factory Demo Program v1.0 " __DATE__ "";
9
10 #endif /* _WEBFUNCS_H_ */

22.122 ebi_pager.h
1 #ifndef __EBI_PAGER_H
2 #define __EBI_PAGER_H
3
4 #include <predef.h>
5 #include <pins.h>
6
7 extern volatile uint8_t ebi_0_base[];
8 extern volatile uint8_t ebi_1_base[];
9 extern volatile uint8_t ebi_2_base[];
10 extern volatile uint8_t ebi_3_base[];
11
25 void ConfigAddressPager(uint32_t csNum, uint32_t pageSize, PinIO *pageSelectPins, uint32_t
pageSelectPinCount);
26
27 #endif /* ----- #ifndef __EBI_PAGER_H ----- */

22.123 examples/_common/MultiPlatform/RTC-External/src/rtc.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*******************************************************************************
6 * The following is a description of the basic time structure defined in the
7 * time.h standard C library, which is used by the RTC functions.
8 *
9 * struct tm
10 * {
11 * int tm_sec; // Second (0-59)
12 * int tm_min; // Minute (0-59)
13 * int tm_hour; // Hour (0-23)
14 * int tm_mday; // Day of the month (1-31)
15 * int tm_mon; // Month of the year [January(0)-December(11)]
16 * int tm_year; // Years since 1900
17 * int tm_wday; // Day of the week [Sunday(0)-Saturday(6)]
18 * int tm_yday; // Days since January 1st (0-365)
19 * int tm_isdst; // Daylight Saving Time flag (in effect if greater than
20 * // zero, not in effect if equal to zero, information not
21 * // available if less than zero)
22 * };
23 ******************************************************************************/
24
25 #ifndef _RTC_H
26 #define _RTC_H
27
28 #include <time.h>
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif /* __cplusplus */
34
41 int8_t rtcInitExternalRtc(uint8_t i2cModuleNum);
42
51 int rtcGetTime(struct tm &bts);
52

NetBurner, Inc.
22.124 examples/PlatformSpecific/MODM7AE70/RTC-External/src/rtc.h 855

60 int rtcSetTime(struct tm &bts);


61
67 int rtcSetSystemTimeFromRtc(void);
68
74 int rtcSetRtcFromSystemTime(void);
75
76 void rtcSetRtcManual(int sec, int min, int hour, int mday, int mon, int year); // , int wday, int
yday);
77
78 #ifdef __cplusplus
79 }
80 #endif /* __cplusplus */
81
82 #endif /* _RTC_H */

22.124 examples/PlatformSpecific/MODM7AE70/RTC-External/src/rtc.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*******************************************************************************
6 * The following is a description of the basic time structure defined in the
7 * time.h standard C library, which is used by the RTC functions.
8 *
9 * struct tm
10 * {
11 * int tm_sec; // Second (0-59)
12 * int tm_min; // Minute (0-59)
13 * int tm_hour; // Hour (0-23)
14 * int tm_mday; // Day of the month (1-31)
15 * int tm_mon; // Month of the year [January(0)-December(11)]
16 * int tm_year; // Years since 1900
17 * int tm_wday; // Day of the week [Sunday(0)-Saturday(6)]
18 * int tm_yday; // Days since January 1st (0-365)
19 * int tm_isdst; // Daylight Saving Time flag (in effect if greater than
20 * // zero, not in effect if equal to zero, information not
21 * // available if less than zero)
22 * };
23 ******************************************************************************/
24
25 #ifndef _RTC_H
26 #define _RTC_H
27
28 #include <time.h>
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif /* __cplusplus */
34
41 int8_t rtcInitExternalRtc(uint8_t i2cModuleNum);
42
51 int rtcGetTime(struct tm &bts);
52
60 int rtcSetTime(struct tm &bts);
61
67 int rtcSetSystemTimeFromRtc(void);
68
74 int rtcSetRtcFromSystemTime(void);
75
76 void rtcSetRtcManual(int sec, int min, int hour, int mday, int mon, int year); // , int wday, int
yday);
77
78 #ifdef __cplusplus
79 }
80 #endif /* __cplusplus */
81
82 #endif /* _RTC_H */

22.125 platform/MOD5441X/include/rtc.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*******************************************************************************
6 * The following is a description of the basic time structure defined in the
7 * time.h standard C library, which is used by the RTC functions.
8 *
9 * struct tm
10 * {

NetBurner, Inc.
856 File Documentation

11 * int tm_sec; // Second (0-59)


12 * int tm_min; // Minute (0-59)
13 * int tm_hour; // Hour (0-23)
14 * int tm_mday; // Day of the month (1-31)
15 * int tm_mon; // Month of the year [January(0)-December(11)]
16 * int tm_year; // Years since 1900
17 * int tm_wday; // Day of the week [Sunday(0)-Saturday(6)]
18 * int tm_yday; // Days since January 1st (0-365)
19 * int tm_isdst; // Daylight Saving Time flag (in effect if greater than
20 * // zero, not in effect if equal to zero, information not
21 * // available if less than zero)
22 * };
23 ******************************************************************************/
24
25 #ifndef _RTC_H
26 #define _RTC_H
27
28 #include <time.h>
29
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif /* __cplusplus */
34
43 int RTCGetTime(struct tm &bts);
44
52 int RTCSetTime(struct tm &bts);
53
59 int RTCSetSystemFromRTCTime(void);
60
66 int RTCSetRTCfromSystemTime(void);
67
68 #ifdef __cplusplus
69 }
70 #endif /* __cplusplus */
71
72 #endif /* _RTC_H */

22.126 hd44780.h
1 #ifndef __HD44780_H
2 #define __HD44780_H
3 /*NB_REVISION*/
4
5 /*NB_COPYRIGHT*/
6
7 #include <predef.h>
8
9 class HD44780_LCD_Bus
10 {
11 volatile uint8_t bus[2];
12 class reg
13 {
14 uint8_t addr;
15 volatile uint8_t *lcd;
16
17 public:
18 reg(uint8_t addr, volatile uint8_t *lcd) : addr(addr), lcd(lcd) {}
19 operator uint8_t() { return read(); }
20 uint8_t operator=(uint8_t val)
21 {
22 write(val);
23 return val;
24 }
25
26 uint8_t read() { return lcd[addr]; }
27 void write(uint8_t val)
28 {
29 while (lcd[0] & 0x80)
30 {
31 asm("dsb");
32 }
33 lcd[addr] = val;
34 }
35 };
36
37 public:
38 HD44780_LCD_Bus();
39
40 void init(uint8_t cols, uint8_t rows);
41 void putchar(char c);
42 void putstr(const char *str);
43 void setCursor(int row, int col);
44 void clr();
45

NetBurner, Inc.
22.127 ssc_i2s.h 857

46 reg operator[](int i) { return reg(i & 0x1, bus); }


47 friend class HD44780_LCD;
48 };
49
50 class HD44780_LCD
51 {
52 public:
53 enum cursorDisp_t
54 {
55 CURSOR_OFF = 0,
56 CURSOR_ON = 2,
57 CURSOR_BLINK = 3
58 };
59
60 private:
61 HD44780_LCD_Bus &bus;
62 uint8_t cols;
63 uint8_t rows;
64 cursorDisp_t cursorDisp;
65 bool dispState;
66
67 public:
68 HD44780_LCD(HD44780_LCD_Bus &bus, uint8_t cols, uint8_t rows);
69
70 void init() { bus.init(cols, rows); }
71 void putchar(char c) { bus.putchar(c); }
72 void putstr(const char *str) { bus.putstr(str); }
73 void setCursor(int row, int col) { bus.setCursor(row, col); }
74 void enableCursor(cursorDisp_t disp);
75 void enableDisplay(bool enable);
76 void clr();
77
78 HD44780_LCD_Bus::reg operator[](int i) { return bus[i]; }
79 };
80
81 #endif /* ----- #ifndef __HD44780_H ----- */

22.127 ssc_i2s.h
1 #ifndef __SSC_I2S_H
2 #define __SSC_I2S_H
3 /*NB_REVISION*/
4
5 /*NB_COPYRIGHT*/
6
7 #include <predef.h>
8 #include <sim.h> /*on-chip register definitions*/
9 #include <pins.h>
10 #include <nbrtos.h>
11 #include <xdmac.h>
12
13 // class SSC_I2S : private Ssc {
14 //
15 //
16 // public:
17 // inline void Reset() { SSC_CR = SSC_CR_SWRST; }
18 // inline void EnableTx(bool enable) {
19 // SSC_CR = (enable ? SSC_CR_TXEN : SSC_CR_TXDIS);
20 // }
21 // inline void EnableRx(bool enable) {
22 // SSC_CR = (enable ? SSC_CR_RXEN : SSC_CR_RXDIS);
23 // }
24 // inline uint16_t SetClkDiv(uint16_t div) {
25 // return SSC_CMR = div & SSC_CMR_DIV_Msk;
26 // }
27 //
28 // static Ssc *get() { return reinterpret_cast<SSC_I2S*>(SSC); }
29 // Ssc &GetRegisers() { return *this; }
30 //
31 // } __attribute__((packed));
32 //
33 // static_assert( sizeof (SSC_I2S == sizeof(Ssc) );
34 //
35
36 typedef void (*SSC_BufferDoneFn_t)(void *buffer, bool valid);
37 /****************************************/
38 /* SSC Configuration Enums */
39 /****************************************/
43 enum clkSrc_t
44 {
45 CLK_SRC_MCK,
46 CLK_SRC_RK,
47 CLK_SRC_TK
48 };
49

NetBurner, Inc.
858 File Documentation

73 enum startCond_t
74 {
75 START_CONTINUOUS,
76 START_SYNC_RX_TX,
77 START_FRAME_LOW,
78 START_FRAME_HIGH,
79 START_FRAME_FALLING,
80 START_FRAME_RISING,
81 START_FRAME_LEVEL,
82 START_FRAME_EDGE,
83 START_CMP_0
84 };
85
89 enum clkGate_t
90 {
91 CLK_GATE_CONTINUOUS,
92 CLK_GATE_FRAME_LOW,
93 CLK_GATE_FRAME_HIGH,
94 };
95
99 enum dataValid_t
100 {
101 DATA_VALID_RISING,
102 DATA_VALID_FALLING,
103 };
104
108 enum frameEdge_t
109 {
110 FRAME_SYNC_RISING,
111 FRAME_SYNC_FALLING
112 };
113
117 enum clkOut_t
118 {
119 CLK_OUT_INPUT,
121 CLK_OUT_CONTINUOUS,
122 CLK_OUT_TRANSFER
123 };
124
128 enum frameSyncOut_t
129 {
130 FRAME_SYNC_INPUT,
132 FRAME_SYNC_NEGATIVE,
134 FRAME_SYNC_POSITIVE,
136 FRAME_SYNC_LOW,
137 FRAME_SYNC_HIGH,
138 FRAME_SYNC_TOGGLE
139 };
140
144 enum bitOrder_t
145 {
146 LEAST_SIG_FIRST,
147 MOST_SIG_FIRST
148 };
149
160 enum bufferDepletionBehavior_t
161 {
162 DEPLETED_PAUSE,
163 DEPLETED_REPEAT_LAST,
164 };
165
166 /****************************************/
167 /* SSC Configuration Struct */
168 /****************************************/
169
212 struct SSC_rxtx_cfg_t
213 {
214 bool enable{false};
215 uint8_t period{64};
216 uint8_t startDly{1};
217 startCond_t startCond{START_FRAME_EDGE};
218 clkGate_t clkGate{CLK_GATE_CONTINUOUS};
219 dataValid_t dataValid{DATA_VALID_RISING};
220 clkOut_t clkOut{CLK_OUT_INPUT};
221 clkSrc_t clkSrc{CLK_SRC_RK};
222
223 uint8_t syncLen{0};
224 frameEdge_t syncEdge{FRAME_SYNC_FALLING};
225 bool syncDataEnabled{false};
226 frameSyncOut_t syncOut{FRAME_SYNC_INPUT};
227 uint8_t wordsPerFrame{1};
228 bitOrder_t bitOrder{MOST_SIG_FIRST};
229 bool lineIdleState{1};
230 uint8_t bitsPerWord{24};
231
232 bufferDepletionBehavior_t depletionBehavior{DEPLETED_PAUSE};
233 };

NetBurner, Inc.
22.127 ssc_i2s.h 859

234
248 struct SSC_cfg_t
249 {
250 uint16_t clkDiv{150};
251
252 SSC_rxtx_cfg_t rx;
253 SSC_rxtx_cfg_t tx;
254 };
255
296 extern const SSC_cfg_t SSC_I2S_SLAVE_24_TXRX_RK;
297 extern const SSC_cfg_t SSC_I2S_SLAVE_24_TXRX_TK;
298 extern const SSC_cfg_t SSC_I2S_SLAVE_24_TXRX_TKRK;
299 extern const SSC_cfg_t SSC_I2S_SLAVE_16_TXRX_RK;
300 extern const SSC_cfg_t SSC_I2S_SLAVE_16_TXRX_TK;
301 extern const SSC_cfg_t SSC_I2S_SLAVE_16_TXRX_TKRK;
302 extern const SSC_cfg_t SSC_I2S_SLAVE_8_TXRX_RK;
303 extern const SSC_cfg_t SSC_I2S_SLAVE_8_TXRX_TK;
304 extern const SSC_cfg_t SSC_I2S_SLAVE_8_TXRX_TKRK;
305
306 extern const SSC_cfg_t SSC_LJUST_SLAVE_24_TXRX_RK;
307 extern const SSC_cfg_t SSC_LJUST_SLAVE_24_TXRX_TK;
308 extern const SSC_cfg_t SSC_LJUST_SLAVE_24_TXRX_TKRK;
309 extern const SSC_cfg_t SSC_LJUST_SLAVE_16_TXRX_RK;
310 extern const SSC_cfg_t SSC_LJUST_SLAVE_16_TXRX_TK;
311 extern const SSC_cfg_t SSC_LJUST_SLAVE_16_TXRX_TKRK;
312 extern const SSC_cfg_t SSC_LJUST_SLAVE_8_TXRX_RK;
313 extern const SSC_cfg_t SSC_LJUST_SLAVE_8_TXRX_TK;
314 extern const SSC_cfg_t SSC_LJUST_SLAVE_8_TXRX_TKRK;
315
316 /****************************************/
317 /* SSC Driver Context Object */
318 /****************************************/
319
326 class SSCCtx_t
327 {
328 public:
329 enum ctxState_t
330 {
331 CTX_STATE_STOPPED,
332 CTX_STATE_INIT,
333 CTX_STATE_TX,
334 CTX_STATE_RX,
335 CTX_STATE_TXRX,
336 };
337
338 private:
339 XdmaCh_t *txCh;
340 XdmaCh_t *rxCh;
341 OS_SEM txSem;
342 OS_SEM rxSem;
343 SSC_BufferDoneFn_t txBufDone;
344 SSC_BufferDoneFn_t rxBufDone;
345 uint32_t txReadyCount;
346 uint32_t rxReadyCount;
347 uint32_t nTxIrq;
348 uint32_t nTxErr;
349 uint32_t nTxPost;
350 uint32_t nTxCall;
351 uint32_t nTxStart;
352 uint32_t nTxAdd;
353
354 uint32_t nRxIrq;
355 uint32_t nRxErr;
356 uint32_t nRxPost;
357 uint32_t nRxCall;
358 uint32_t nRxStart;
359 uint32_t nRxAdd;
360
361 Desc0Ring TxRing;
362 Desc0Ring RxRing;
363 uint8_t rxByteWidth;
364 uint8_t txByteWidth;
365
366 ctxState_t state;
367 void initBDs(bool loopRx, bool loopTx);
368 void initHw_Pins(const SSC_cfg_t &cfg);
369 void initHw_SSC(const SSC_cfg_t &cfg);
370 void initHw_DMA(const SSC_cfg_t &cfg);
371
372 public:
379 int Init(const SSC_cfg_t &cfg);
383 void Shutdown();
384
391 int getCurrentConfig(SSC_cfg_t &cfg);
396 ctxState_t getState();
397
409 int TransmitBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded);

NetBurner, Inc.
860 File Documentation

421 int ReadyReceiveBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded);


422
426 void RegisterTxBufferDoneCB(SSC_BufferDoneFn_t cb);
430 void RegisterRxBufferDoneCB(SSC_BufferDoneFn_t cb);
431
432 void TxIsr();
433 void RxIsr();
434
435 void dump();
436 };
437
438 extern SSCCtx_t ssc;
439
440 #endif /* ----- #ifndef __SSC_I2S_H ----- */

22.128 wm8904.h
1 #ifndef __WM8904_H
2 #define __WM8904_H
3 /*NB_REVISION*/
4
5 /*NB_COPYRIGHT*/
6
7 #include <predef.h>
8 #include <stdio.h>
9 #include <init.h>
10 #include <sim.h> /*on-chip register definitions*/
11 #include <pins.h>
12 #include <nbrtos.h>
13 #include <i2c.h>
14 #include "ssc_i2s.h"
15
16 #include "wm8904_reg.h"
17
22 class WM8904
23 {
24 public:
25 struct Reg
26 {
27 enum RegAddr_t
28 {
29 SWRST_ID = 0x00,
30 BIAS_CTL0 = 0x04,
31 VMID_CTL0 = 0x05,
32 MIC_BIAS_CTL0 = 0x06,
33 MIC_BIAS_CTL1 = 0x07,
34 ANA_ADC0 = 0x0A,
35 PWR_MGMNT0 = 0x0C,
36 PWR_MGMNT2 = 0x0E,
37 PWR_MGMNT3 = 0x0F,
38 PWR_MGMNT6 = 0x12,
39 CLK_RATES0 = 0x14,
40 CLK_RATES1 = 0x15,
41 CLK_RATES2 = 0x16,
42 AUDIO_INTF0 = 0x18,
43 AUDIO_INTF1 = 0x19,
44 AUDIO_INTF2 = 0x1A,
45 AUDIO_INTF3 = 0x1B,
46 DAC_DGTL_VOL_L = 0x1E,
47 DAC_DGTL_VOL_R = 0x1F,
48 DAC_DGTL0 = 0x20,
49 DAC_DGTL1 = 0x21,
50 ADC_DGTL_VOL_L = 0x24,
51 ADC_DGTL_VOL_R = 0x25,
52 ADC_DGTL0 = 0x26,
53 DGTL_MIC0 = 0x27,
54 DRC0 = 0x28,
55 DRC1 = 0x29,
56 DRC2 = 0x2A,
57 DRC3 = 0x2B,
58 ANA_L_IN0 = 0x2C,
59 ANA_R_IN0 = 0x2D,
60 ANA_L_IN1 = 0x2E,
61 ANA_R_IN1 = 0x2F,
62 ANA_OUT1_L = 0x39,
63 ANA_OUT1_R = 0x3A,
64 ANA_OUT2_L = 0x3B,
65 ANA_OUT2_R = 0x3C,
66 ANA_OUT12_ZC = 0x3D,
67 DC_SERVO0 = 0x43,
68 DC_SERVO1 = 0x44,
69 DC_SERVO2 = 0x45,
70 DC_SERVO4 = 0x47,
71 DC_SERVO5 = 0x48,
72 DC_SERVO6 = 0x49,

NetBurner, Inc.
22.128 wm8904.h 861

73 DC_SERVO7 = 0x4A,
74 DC_SERVO8 = 0x4B,
75 DC_SERVO9 = 0x4C,
76 DC_SERVO_RDBK0 = 0x4D,
77 ANA_HP0 = 0x5A,
78 ANA_LINEOUT0 = 0x5E,
79 CHARGE_PUMP0 = 0x62,
80 CLASS_W0 = 0x68,
81 WR_SEQ0 = 0x6C,
82 WR_SEQ1 = 0x6D,
83 WR_SEQ2 = 0x6E,
84 WR_SEQ3 = 0x6F,
85 WR_SEQ4 = 0x70,
86 FLL_CTL1 = 0x74,
87 FLL_CTL2 = 0x75,
88 FLL_CTL3 = 0x76,
89 FLL_CTL4 = 0x77,
90 FLL_CTL5 = 0x78,
91 GPIO_CTL1 = 0x79,
92 GPIO_CTL2 = 0x7A,
93 GPIO_CTL3 = 0x7B,
94 GPIO_CTL4 = 0x7C,
95 DGTL_PULLS = 0x7E,
96 IRQ_STAT = 0x7F,
97 IRQ_STAT_MASK = 0x80,
98 IRQ_POL = 0x81,
99 IRQ_DEBOUNCE = 0x82,
100 EQ1 = 0x86,
101 EQ2 = 0x87,
102 EQ3 = 0x88,
103 EQ4 = 0x89,
104 EQ5 = 0x8A,
105 EQ6 = 0x8B,
106 EQ7 = 0x8C,
107 EQ8 = 0x8D,
108 EQ9 = 0x8E,
109 EQ10 = 0x8F,
110 EQ11 = 0x90,
111 EQ12 = 0x91,
112 EQ13 = 0x92,
113 EQ14 = 0x93,
114 EQ15 = 0x94,
115 EQ16 = 0x95,
116 EQ17 = 0x96,
117 EQ18 = 0x97,
118 EQ19 = 0x98,
119 EQ20 = 0x99,
120 EQ21 = 0x9A,
121 EQ22 = 0x9B,
122 EQ23 = 0x9C,
123 EQ24 = 0x9D,
124 ADC_TEST0 = 0xC6,
125 FLL_NCO_TEST0 = 0xF7,
126 FLL_NCO_TEST1 = 0xF8
127 };
128 struct cmd_t
129 {
130 RegAddr_t reg;
131 uint16_t val;
132 uint16_t dly;
133 cmd_t &operator=(const cmd_t rhs)
134 {
135 reg = rhs.reg;
136 val = rhs.val;
137 dly = rhs.dly;
138 return *this;
139 }
140 };
141 static cmd_t init_cmds_0[];
142 static cmd_t init_cmds_1[];
143 static cmd_t init_cmds_2[];
144 static cmd_t init_cmds_3[];
145 static cmd_t init_cmds_4[];
146 static cmd_t init_cmds_5[];
147 static cmd_t init_cmds_6[];
148 };
149
150 enum DataLen_t
151 {
152 DATA_LEN_16,
153 DATA_LEN_24,
154 DATA_LEN_32
155 };
156
157 enum DataFmt_t
158 {
159 DATA_FMT_16_L_JUSTIFIED,

NetBurner, Inc.
862 File Documentation

160 DATA_FMT_16_I2S,
161 DATA_FMT_32_L_JUSTIFIED,
162 DATA_FMT_32_I2S
163 };
164
165 enum AudioChSelect_t
166 {
167 CH_SELECT_LEFT,
168 CH_SELECT_RIGHT,
169 CH_SELECT_LEFT_RIGHT
170 };
171
172 enum AudioOutSelect_t
173 {
174 AUDIO_OUT_NONE,
175 AUDIO_OUT_HP,
176 AUDIO_OUT_LINE,
177 AUDIO_OUT_SPKR
178 };
179
180 enum AudioInSelect_t
181 {
182 AUDIO_IN_NONE,
183 AUDIO_IN_1,
184 AUDIO_IN_2,
185 AUDIO_IN_3,
186 };
187
188 struct cfg_t
189 {
190 uint16_t sampleRate;
191 uint32_t refClkRate;
192 DataFmt_t dataFormat;
193 AudioChSelect_t inCh;
194 AudioChSelect_t outCh;
195 AudioInSelect_t inSrc;
196 AudioOutSelect_t outSrc;
197
198 uint8_t initMicGain;
199 uint8_t initOutVol;
200 };
201
202 private:
203 I2C &twi;
204
205 void InitInput(const cfg_t &cfg);
206 void ConfigFLL(const cfg_t &cfg);
207
208 public:
214 WM8904(I2C &module);
220 void Init(const cfg_t &cfg, const SSC_cfg_t &ssc_cfg);
224 void Shutdown();
230 void WriteReg(Reg::RegAddr_t reg, uint16_t dat);
236 uint16_t ReadReg(Reg::RegAddr_t reg);
237
243 void SendCmd(Reg::cmd_t cmd);
251 void SendCmdList(Reg::cmd_t *cmds, uint32_t len);
260 void UpdateCmd(Reg::cmd_t cmd, uint16_t updateMask);
261
268 void SetVolume(AudioOutSelect_t out, AudioChSelect_t channel, uint8_t volume);
275 uint8_t GetVolume(AudioOutSelect_t out, AudioChSelect_t channel);
282 void Mute(AudioOutSelect_t out, AudioChSelect_t channel, bool mute);
283
289 void SetMicGain(AudioChSelect_t channel, uint8_t gain);
295 uint8_t GetMicGain(AudioChSelect_t channel);
301 void MuteMic(AudioChSelect_t channel, bool mute);
302
314 int TransmitBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded);
326 int ReadyReceiveBuffer(void *buffer, uint32_t bufferLen, bool waitIfNeeded);
327
331 void RegisterTxBufferDoneCB(SSC_BufferDoneFn_t cb);
335 void RegisterRxBufferDoneCB(SSC_BufferDoneFn_t cb);
336 };
337 #endif /* ----- #ifndef __WM8904_H ----- */

22.129 wm8904_reg.h
1 #ifndef __WM8904_REG_H
2 #define __WM8904_REG_H
3 /*NB_REVISION*/
4
5 /*NB_COPYRIGHT*/
6
7 #define WM8904_I2C_ID 0x1A
8

NetBurner, Inc.
22.129 wm8904_reg.h 863

9 #define BIAS_CTL0_ISEL_HI (0x2 « 2)


10 #define BIAS_CTL0_ISEL_LO (0x0 « 2)
11 #define BIAS_CTL0_BIAS_ENA (1 « 0)
12
13 #define VMID_CTL0_BUF_ENA (1 « 6)
14 #define VMID_CTL0_RES_DIS (0 « 1)
15 #define VMID_CTL0_RES_MID (1 « 1)
16 #define VMID_CTL0_RES_SLOW (2 « 1)
17 #define VMID_CTL0_RES_FAST (3 « 1)
18 #define VMID_CTL0_ENA (1 « 0)
19
20 #define PWR_MGMNT0_INL_ENA (1 « 1)
21 #define PWR_MGMNT0_INR_ENA (1 « 0)
22
23 #define PWR_MGMNT2_HPL_PGA_ENA (1 « 1)
24 #define PWR_MGMNT2_HPR_PGA_ENA (1 « 0)
25
26 #define PWR_MGMNT6_DACL_ENA (1 « 3)
27 #define PWR_MGMNT6_DACR_ENA (1 « 2)
28 #define PWR_MGMNT6_ADCL_ENA (1 « 1)
29 #define PWR_MGMNT6_ADCR_ENA (1 « 0)
30
31 #define CHARGE_PUMP0_CP_ENA (1 « 0)
32
33 #define CLK_SYS_RATE_64 (0 « 10)
34 #define CLK_SYS_RATE_128 (1 « 10)
35 #define CLK_SYS_RATE_192 (2 « 10)
36 #define CLK_SYS_RATE_256 (3 « 10)
37 #define CLK_SYS_RATE_384 (4 « 10)
38 #define CLK_SYS_RATE_512 (5 « 10)
39 #define CLK_SYS_RATE_768 (6 « 10)
40 #define CLK_SYS_RATE_1024 (7 « 10)
41 #define CLK_SYS_RATE_1408 (8 « 10)
42 #define CLK_SYS_RATE_1536 (9 « 10)
43 #define CLK_SAMPLE_RATE_8K (0 « 10)
44 #define CLK_SAMPLE_RATE_12K (1 « 10)
45 #define CLK_SAMPLE_RATE_16K (2 « 10)
46 #define CLK_SAMPLE_RATE_24K (3 « 10)
47 #define CLK_SAMPLE_RATE_32K (4 « 10)
48 #define CLK_SAMPLE_RATE_48K (5 « 10)
49
50 #define CLK_MCLK_INV (1 « 15)
51 #define CLK_SYSCLK_SRC_MCLK (0 « 14)
52 #define CLK_SYSCLK_SRC_FLL (1 « 14)
53 #define CLK_TOCLK_RATE_DIV2 (0 « 12)
54 #define CLK_TOCLK_RATE_DIV1 (1 « 12)
55 #define CLK_OPCLK_ENA (1 « 3)
56 #define CLK_CLK_SYS_ENA (1 « 2)
57 #define CLK_CLK_DSP_ENA (1 « 1)
58 #define CLK_TOCLK_ENA (1 « 0)
59
60 #define AUDIO_INTF0_DACL_DATINV (1 « 12)
61 #define AUDIO_INTF0_DACR_DATINV (1 « 11)
62 #define AUDIO_INTF0_DAC_BOOST(x) ((x & 3) « 9)
63 #define AUDIO_INTF0_LOOPBACK (1 « 8)
64 #define AUDIO_INTF0_ADC_SRCL (1 « 7)
65 #define AUDIO_INTF0_ADC_SRCR (1 « 6)
66 #define AUDIO_INTF0_DAC_SRCL (1 « 5)
67 #define AUDIO_INTF0_DAC_SRCR (1 « 4)
68 #define AUDIO_INTF0_ADC_COMP (1 « 3)
69 #define AUDIO_INTF0_ADC_COMPMODE (1 « 2)
70 #define AUDIO_INTF0_DAC_COMP (1 « 1)
71 #define AUDIO_INTF0_DAC_COMPMODE (1 « 0)
72
73 #define AUDIO_INTF2_OPCLK_DIV_1 (0 « 8)
74 #define AUDIO_INTF2_OPCLK_DIV_2 (1 « 8)
75 #define AUDIO_INTF2_OPCLK_DIV_3 (2 « 8)
76 #define AUDIO_INTF2_OPCLK_DIV_4 (3 « 8)
77 #define AUDIO_INTF2_OPCLK_DIV_5_5 (4 « 8)
78 #define AUDIO_INTF2_OPCLK_DIV_6 (5 « 8)
79 #define AUDIO_INTF2_OPCLK_DIV_8 (6 « 8)
80 #define AUDIO_INTF2_OPCLK_DIV_12 (7 « 8)
81 #define AUDIO_INTF2_OPCLK_DIV_16 (8 « 8)
82 #define AUDIO_INTF2_BCLK_DIV_1 (0 « 0)
83 #define AUDIO_INTF2_BCLK_DIV_1_5 (1 « 0)
84 #define AUDIO_INTF2_BCLK_DIV_2 (2 « 0)
85 #define AUDIO_INTF2_BCLK_DIV_3 (3 « 0)
86 #define AUDIO_INTF2_BCLK_DIV_4 (4 « 0)
87 #define AUDIO_INTF2_BCLK_DIV_5 (5 « 0)
88 #define AUDIO_INTF2_BCLK_DIV_5_5 (6 « 0)
89 #define AUDIO_INTF2_BCLK_DIV_6 (7 « 0)
90 #define AUDIO_INTF2_BCLK_DIV_8 (8 « 0)
91 #define AUDIO_INTF2_BCLK_DIV_10 (9 « 0)
92 #define AUDIO_INTF2_BCLK_DIV_11 (10 « 0)
93 #define AUDIO_INTF2_BCLK_DIV_12 (11 « 0)
94 #define AUDIO_INTF2_BCLK_DIV_16 (12 « 0)
95 #define AUDIO_INTF2_BCLK_DIV_20 (13 « 0)

NetBurner, Inc.
864 File Documentation

96 #define AUDIO_INTF2_BCLK_DIV_22 (14 « 0)


97 #define AUDIO_INTF2_BCLK_DIV_24 (15 « 0)
98 #define AUDIO_INTF2_BCLK_DIV_25 (16 « 0)
99 #define AUDIO_INTF2_BCLK_DIV_30 (17 « 0)
100 #define AUDIO_INTF2_BCLK_DIV_32 (18 « 0)
101 #define AUDIO_INTF2_BCLK_DIV_44 (19 « 0)
102 #define AUDIO_INTF2_BCLK_DIV_48 (20 « 0)
103
104 #define AUDIO_INTF1_AIFDAC_TDM_NORM (0 « 13)
105 #define AUDIO_INTF1_AIFDAC_TDM_TDM (1 « 13)
106 #define AUDIO_INTF1_AIFDAC_TDM_CHAN0 (0 « 12)
107 #define AUDIO_INTF1_AIFDAC_TDM_CHAN1 (1 « 12)
108 #define AUDIO_INTF1_AIFADC_TDM_NORM (0 « 11)
109 #define AUDIO_INTF1_AIFADC_TDM_TDM (1 « 11)
110 #define AUDIO_INTF1_AIFADC_TDM_CHAN0 (0 « 10)
111 #define AUDIO_INTF1_AIFADC_TDM_CHAN1 (1 « 10)
112 #define AUDIO_INTF1_AIF_TRIS (1 « 8)
113 #define AUDIO_INTF1_BCLK_INV (1 « 7)
114 #define AUDIO_INTF1_BCLK_DIR_IN (0 « 6)
115 #define AUDIO_INTF1_BCLK_DIR_OUT (1 « 6)
116 #define AUDIO_INTF1_LRCLK_INV (1 « 6)
117 #define AUDIO_INTF1_WL_16BIT (0 « 2)
118 #define AUDIO_INTF1_WL_20BIT (1 « 2)
119 #define AUDIO_INTF1_WL_24BIT (2 « 2)
120 #define AUDIO_INTF1_WL_32BIT (3 « 2)
121 #define AUDIO_INTF1_FMT_RIGHT (0 « 0)
122 #define AUDIO_INTF1_FMT_LEFT (1 « 0)
123 #define AUDIO_INTF1_FMT_I2S (2 « 0)
124 #define AUDIO_INTF1_FMT_DSP (3 « 0)
125
126 #define AUDIO_INTF3_LRCLK_DIR_IN (0 « 11)
127 #define AUDIO_INTF3_LRCLK_DIR_OUT (1 « 11)
128 #define AUDIO_INTF3_LRCLK_RATE(x) ((x)&0x7FF)
129
130 #define DC_SERVO0_ENA_LNR (1 « 3)
131 #define DC_SERVO0_ENA_LNL (1 « 2)
132 #define DC_SERVO0_ENA_HPR (1 « 1)
133 #define DC_SERVO0_ENA_HPL (1 « 0)
134
135 #define DC_SERVO1_TRIG_1_LNR (1 « 15)
136 #define DC_SERVO1_TRIG_1_LNL (1 « 14)
137 #define DC_SERVO1_TRIG_1_HPR (1 « 13)
138 #define DC_SERVO1_TRIG_1_HPL (1 « 12)
139 #define DC_SERVO1_TRIG_n_LNR (1 « 11)
140 #define DC_SERVO1_TRIG_n_LNL (1 « 10)
141 #define DC_SERVO1_TRIG_n_HPR (1 « 9)
142 #define DC_SERVO1_TRIG_n_HPL (1 « 8)
143 #define DC_SERVO1_TRIG_START_LNR (1 « 7)
144 #define DC_SERVO1_TRIG_START_LNL (1 « 6)
145 #define DC_SERVO1_TRIG_START_HPR (1 « 5)
146 #define DC_SERVO1_TRIG_START_HPL (1 « 4)
147 #define DC_SERVO1_TRIG_DAC_WR_LNR (1 « 3)
148 #define DC_SERVO1_TRIG_DAC_WR_LNL (1 « 2)
149 #define DC_SERVO1_TRIG_DAC_WR_HPR (1 « 1)
150 #define DC_SERVO1_TRIG_DAC_WR_HPL (1 « 0)
151
152 #define FLL_FRACN_ENA_INT (0 « 2)
153 #define FLL_FRACN_ENA_FRAC (1 « 2)
154 #define FLL_OSC_ENA_DIS (0 « 1)
155 #define FLL_OSC_ENA_EN (1 « 1)
156 #define FLL_ENA_DIS (0 « 0)
157 #define FLL_ENA_EN (1 « 0)
158
159 #define FLL_OUTDIV(x) ((uint16_t)(((x - 1) & 0x3F) « 8))
160 #define FLL_CTRL_RATE_FVCO_1 (0 « 4)
161 #define FLL_CTRL_RATE_FVCO_2 (1 « 4)
162 #define FLL_CTRL_RATE_FVCO_3 (2 « 4)
163 #define FLL_CTRL_RATE_FVCO_4 (3 « 4)
164 #define FLL_CTRL_RATE_FVCO_5 (4 « 4)
165 #define FLL_CTRL_RATE_FVCO_6 (5 « 4)
166 #define FLL_CTRL_RATE_FVCO_7 (6 « 4)
167 #define FLL_CTRL_RATE_FVCO_8 (7 « 4)
168 #define FLL_FRATIO_DIV_1 (0 « 0)
169 #define FLL_FRATIO_DIV_2 (1 « 0)
170 #define FLL_FRATIO_DIV_4 (2 « 0)
171 #define FLL_FRATIO_DIV_8 (3 « 0)
172 #define FLL_FRATIO_DIV_16 (7 « 0)
173
174 #define FLL_K(x) ((uint16_t)(((x)&0xFFFF) « 0))
175
176 #define FLL_N(x) ((uint16_t)(((x)&0x3FF) « 5))
177 #define FLL_GAIN_1 (0 « 0)
178 #define FLL_GAIN_2 (1 « 0)
179 #define FLL_GAIN_4 (2 « 0)
180 #define FLL_GAIN_8 (3 « 0)
181 #define FLL_GAIN_16 (4 « 0)
182 #define FLL_GAIN_32 (5 « 0)

NetBurner, Inc.
22.130 datapump.h 865

183 #define FLL_GAIN_64 (6 « 0)


184 #define FLL_GAIN_128 (7 « 0)
185 #define FLL_GAIN_256 (8 « 0)
186
187 #define FLL_CLK_REF_DIV_1 (0 « 3)
188 #define FLL_CLK_REF_DIV_2 (1 « 3)
189 #define FLL_CLK_REF_DIV_4 (2 « 3)
190 #define FLL_CLK_REF_DIV_8 (3 « 3)
191 #define FLL_CLK_REF_DIV_16 (4 « 3)
192 #define FLL_CLK_REF_SRC_MCLK (0 « 0)
193 #define FLL_CLK_REF_SRC_BCLK (1 « 0)
194 #define FLL_CLK_REF_SRC_LRCLK (2 « 0)
195
196 #define GPIO_CTL_GPIO_PU (1 « 5)
197 #define GPIO_CTL_GPIO_PD (1 « 4)
198 #define GPIO_CTL_GPIO_IN (0 « 0)
199 #define GPIO_CTL_GPIO_CLK_OUT (1 « 0)
200 #define GPIO_CTL_GPIO_LO (2 « 0)
201 #define GPIO_CTL_GPIO_HI (3 « 0)
202 #define GPIO_CTL_GPIO_IRQ (4 « 0)
203 #define GPIO_CTL_GPIO_FLL_LOCK (5 « 0)
204 #define GPIO_CTL_GPIO_MIC_DET (6 « 0)
205 #define GPIO_CTL_GPIO_MIC_SHORT (7 « 0)
206 #define GPIO_CTL_GPIO_DMIC_CLKO (8 « 0)
207 #define GPIO_CTL_GPIO_FLL_CLKO (9 « 0)
208
209 #define ANA_IN_MUTE (1 « 7)
210 #define ANA_IN_VOLUME(x) ((uint16_t)(((x)&0x1F) « 0))
211
212 #define ANA_HP0_HPL_RM_SHORT (1 « 7)
213 #define ANA_HP0_HPL_ENA_OUTP (1 « 6)
214 #define ANA_HP0_HPL_ENA_DLY (1 « 5)
215 #define ANA_HP0_HPL_ENA (1 « 4)
216 #define ANA_HP0_HPR_RM_SHORT (1 « 3)
217 #define ANA_HP0_HPR_ENA_OUTP (1 « 2)
218 #define ANA_HP0_HPR_ENA_DLY (1 « 1)
219 #define ANA_HP0_HPR_ENA (1 « 0)
220
221 #define ANA_OUT_MUTE (1 « 8)
222 #define ANA_OUT_VOL_UPDATE (1 « 7)
223 #define ANA_OUT_ZERO_CROSS (1 « 6)
224 #define ANA_OUT_VOLUME(x) ((uint16_t)((x & 0x3F) « 0))
225
226 #define DGTL_PULLS_MCLK_PU (1 « 7)
227 #define DGTL_PULLS_MCLK_PD (1 « 6)
228 #define DGTL_PULLS_DACDAT_PU (1 « 5)
229 #define DGTL_PULLS_DACDAT_PD (1 « 4)
230 #define DGTL_PULLS_LRCLK_PU (1 « 3)
231 #define DGTL_PULLS_LRCLK_PD (1 « 2)
232 #define DGTL_PULLS_BCLK_PU (1 « 1)
233 #define DGTL_PULLS_BCLK_PD (1 « 0)
234
235 #define FLL_NCO_FRC_NCO_EN (1 « 0)
236 #define FLL_NCO_FRC_NCO_DIS (0 « 0)
237
238 #endif /* ----- #ifndef __WM8904_REG_H ----- */

22.130 datapump.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _DATAPUMP_H_
6 #define _DATAPUMP_H_
7
8 /*
9 * Since this program may be used for machine to machine connections you
10 * can configure the messages that are sent.
11 *
12 * MTS messages are Message To Serial
13 * MTN messages are Messages to the Network
14 */
15 #define MTS_WHEN_NOTCONNECTED "Waiting for connection \r\n"
16 #define MTS_WHEN_CONNECTION_OPENED "New Connection Opened\r\n"
17 #define MTS_WHEN_CONNECTION_CLOSED "Connection Closed by Network \r\n"
18 #define MTS_WHEN_CONNECTION_TIMEDOUT "Connection Timed out and Closed\r\n"
19 #define MTS_WHEN_CONNECTION_OVERIDDEN "This Connection is being Overidden.\r\n"
20
21 #define MTN_WHEN_CONNECTION_OVERIDDEN "Your Connection was just Overidden\r\n"
22 #define MTN_WHEN_CONNECTION_OPENED "Connection Opened \r\n"
23 #define MTN_WHEN_CONNECTION_TIMEDOUT "Your Connection Timed out and will be Closed\r\n"
24
25 #define BUFFER_SIZE (1500)
26 #define CLIENT_WRITE_BUF_SIZE (256)

NetBurner, Inc.
866 File Documentation

27
28 int DataPump(int fd1, int fd2, int serverfd); // file descriptor data pump
29
30 #endif

22.131 _common/MultiPlatform/GpioServer/src/analog.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef __ANALOG_H__
6 #define __ANALOG_H__
7
8 struct ch_t
9 {
10 uint8_t pinNum; // assumes P2 header for MODM7AE70, and J1 header for SBE70LC
11 uint8_t module;
12 uint8_t ch;
13 };
14
15 #ifdef SBE70LC
16 #define ADC_CH_COUNT (5)
17 ch_t ch[ADC_CH_COUNT] = {{13, 0, 1}, {11, 0, 10}, {5, 0, 2}, {14, 0, 5}, {10, 1, 0}};
18 #elif (defined MODM7AE70)
19 #define ADC_CH_COUNT (7)
20 ch_t ch[ADC_CH_COUNT] = {{7, 0, 0}, {21, 0, 1}, {38, 0, 2}, {29, 0, 5}, {8, 0, 6}, {3, 0, 10}, {6, 1,
3}};
21 #endif
22
23 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
24
25 // Enable or disable individual AFEC channels
26 void ADConfigCh(unsigned nAfec, unsigned ch, bool enable);
27
28 void StartAD(); // Start A/D conversion set.
29
30 bool ADDone(); // Return true if the conversion is complete
31
32 uint16_t GetADResult(unsigned nAfec, unsigned ch); // Return the AD Result
33
34 #endif // end __ANALOG_H__

22.132 SSH/SecureSerToEthFactoryApp/src/analog.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef __ANALOG_H__
6 #define __ANALOG_H__
7
8 #ifdef SAME70
9 struct ch_t
10 {
11 uint8_t pinNum; // assumes P2 header for MODM7AE70, and J1 header for SBE70LC
12 uint8_t module;
13 uint8_t ch;
14 };
15
16 #ifdef SBE70LC
17 #define ADC_CH_COUNT (5)
18 ch_t ch[ADC_CH_COUNT] = {{13, 0, 1}, {11, 0, 10}, {5, 0, 2}, {14, 0, 5}, {10, 1, 0}};
19 #elif (defined MODM7AE70)
20 #define ADC_CH_COUNT (7)
21 ch_t ch[ADC_CH_COUNT] = {{7, 0, 0}, {21, 0, 1}, {38, 0, 2}, {29, 0, 5}, {8, 0, 6}, {3, 0, 10}, {6, 1,
3}};
22 #endif
23
24 void InitSingleEndAD(); // Setup the A/D converter to be ready to run
25
26 // Enable or disable individual AFEC channels
27 void ADConfigCh(unsigned nAfec, unsigned ch, bool enable);
28
29 void StartAD(); // Start A/D conversion set.
30
31 bool ADDone(); // Return true if the conversion is complete
32
33 uint16_t GetADResult(unsigned nAfec, unsigned ch); // Return the AD Result
34 #endif // SAME70
35
36 #endif // end __ANALOG_H__

NetBurner, Inc.
22.133 fdtimer.h 867

22.133 fdtimer.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _FDTIMER_H_
6 #define _FDTIMER_H_
7
8 /*
9 ******************************************************************************
10 *
11 * Global data definitions
12 *
13 ******************************************************************************
14 */
15 extern volatile int fd_notify[NB_FACTORY_SERIAL_PORTS];
16 extern volatile int fd_tick_left[NB_FACTORY_SERIAL_PORTS];
17 extern volatile int FD_shutdown;
18
19 /*
20 ******************************************************************************
21 *
22 * Functions
23 *
24 ******************************************************************************
25 */
26 void SetUpFdtimer(void);
27 void SetTicks(int n, int ticks);
28
29 #endif /* _FDTIMER_H_ */

22.134 _common/MultiPlatform/GpioServer/src/gpioserver.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef __GPIO_SERVER_H__
6 #define __GPIO_SERVER_H__
7
8 #include <string.h>
9 #include <stdlib.h>
10 #include <tcp.h>
11 #include <command.h>
12 #include <pins.h>
13 #include <cpu_pins.h>
14 #include <fdprintf.h>
15
16 #define CMD_ERR_NOT_GPIO_MODE -1
17 #define CMD_ERR_BAD_PIN_NUM -2
18 #define CMD_ERR_SYNTAX -3
19
20 extern const char *AppName;
21 extern const char *VersionNumber;
22
23 /* returns true if the pin number is valid within the pin header, retruns false if the pin is not valid
*/
24 bool pinIsValid(uint8_t pinNumber);
25
26 /* returns the index in the analog "ch" struct cooresponding to the analogPinNum, returns -1 if the
27 analogPinNum is not found within the "ch" struct (therefore is not a valid analog pin number). */
28 int8_t getAnalogPinIndex(uint8_t analogPinNum);
29
30 /* returns true if the pin output was set, false if the pin output was not set */
31 bool SetPinOutput(uint8_t pinNumber, uint8_t output, FILE *fp);
32
33 /* Set the pin as a digital input */
34 bool SetPinAsInput(uint8_t pinNumber, FILE *fp);
35
36 /* Read the digital pin value */
37 uint32_t ReadPin(uint8_t pinNumber);
38
39 /* Read the analog value of the cooresponding ADC channel in the "ch" struct. The index is
40 obtained by using the getAnalogPinIndex() function. */
41 uint16_t ReadAnalogPin(uint8_t channelIndex);
42
43 /* Parse a whole command string for the pin number. returns the number to the pinNumber variable by
reference.
44 returns true if parsing the pin number was successful. returns false otherwise. The function
45 prints the error response to the fp variable in the case that parsing fails.
46 */
47 bool parsePinNumber(const char *command, uint8_t &pinNumber, FILE *fp);
48

NetBurner, Inc.
868 File Documentation

49 /* Command parser. returns CMD_CLOSE if requested to close the connection, returns CMD_OK otherwise */
50 int32_t ProcessGpioCommand(const char *command, FILE *fp);
51
52 /* The User Authentication Callback */
53 int ProcessAuth(const char *name, const char *pass);
54
55 /* The Command Processing Callback */
56 int ProcessCommand(const char *command, FILE *fp, void *pData);
57
58 /* The Connection Processing Callback */
59 void *ProcessConnect(FILE *fp);
60
61 /* The Prompt Processing Callback */
62 void ProcessPrompt(FILE *fp, void *pData);
63
64 /* The Disconnect Processing Callback */
65 void ProcessDisconnect(FILE *fp, int cause, void *pData);
66
67 #endif // end __GPIO_SERVER_H__

22.135 SSH/SecureSerToEthFactoryApp/src/gpioserver.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef __GPIO_SERVER_H__
6 #define __GPIO_SERVER_H__
7
8 #include <string.h>
9 #include <stdlib.h>
10 #include <tcp.h>
11 #include <command.h>
12 #include <pins.h>
13 #include <cpu_pins.h>
14 #include <fdprintf.h>
15
16 #define SERIALPORT_TO_USE (0)
17 #define BAUDRATE_TO_USE (115200)
18 #define STOP_BITS (1)
19 #define DATA_BITS (8)
20 #define TCP_PORT_TO_USE (23) // The Telnet port
21 #define IDLE_TIMEOUT (60 * TICKS_PER_SECOND)
22 #define DO_TELNET_PROCESSING (true)
23 #define MAX_TCP_CONNECTIONS (5)
24
25 #define CMD_ERR_NOT_GPIO_MODE -1
26 #define CMD_ERR_BAD_PIN_NUM -2
27 #define CMD_ERR_SYNTAX -3
28
29 extern const char FirmwareVersion[];
30
31 #ifdef SUPPORTED_GPIO_SERVER_PLATFORM
32 /* returns true if the pin number is valid within the pin header, retruns false if the pin is not valid
*/
33 bool pinIsValid(uint8_t pinNumber);
34
35 /* returns the index in the analog "ch" struct cooresponding to the analogPinNum, returns -1 if the
36 analogPinNum is not found within the "ch" struct (therefore is not a valid analog pin number). */
37 int8_t getAnalogPinIndex(uint8_t analogPinNum);
38
39 /* returns true if the pin output was set, false if the pin output was not set */
40 bool SetPinOutput(uint8_t pinNumber, uint8_t output, FILE *fp);
41
42 /* Set the pin as a digital input */
43 bool SetPinAsInput(uint8_t pinNumber, FILE *fp);
44
45 /* Read the digital pin value */
46 uint32_t ReadPin(uint8_t pinNumber);
47
48 /* Read the analog value of the cooresponding ADC channel in the "ch" struct. The index is
49 obtained by using the getAnalogPinIndex() function. */
50 uint16_t ReadAnalogPin(uint8_t channelIndex);
51
52 /* Parse a whole command string for the pin number. returns the number to the pinNumber variable by
reference.
53 returns true if parsing the pin number was successful. returns false otherwise. The function
54 prints the error response to the fp variable in the case that parsing fails.
55 */
56 bool parsePinNumber(const char *command, uint8_t &pinNumber, FILE *fp);
57
58 /* Command parser. returns CMD_CLOSE if requested to close the connection, returns CMD_OK otherwise */
59 int ProcessGpioCommand(const char *command, FILE *fp, void *pData);
60
61 /* The User Authentication Callback */

NetBurner, Inc.
22.136 i2cfuncs.h 869

62 int ProcessAuth(const char *name, const char *pass);


63
64 /* The Command Processing Callback */
65 int ProcessCommand(const char *command, FILE *fp, void *pData);
66
67 /* The Connection Processing Callback */
68 void *ProcessConnect(FILE *fp);
69
70 /* The Prompt Processing Callback */
71 void ProcessPrompt(FILE *fp, void *pData);
72
73 /* The Disconnect Processing Callback */
74 void ProcessDisconnect(FILE *fp, int cause, void *pData);
75 #endif // SUPPORTED_GPIO_SERVER_PLATFORM
76
77 #endif // end __GPIO_SERVER_H__

22.136 i2cfuncs.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _I2CFUNCS_H_
6 #define _I2CFUNCS_H_
7
8 #ifdef SUPPORTED_I2C_PLATFORM
9
10 #if (defined NANO54415 || defined MOD5441X || defined SB800EX)
11 #include <multichanneli2c.h>
12 #elif (defined SAME70)
13 #include <i2c.h>
14 #else
15 #warning I2C features not supported for this platform
16 #endif
17
18 #ifdef __cplusplus
19 extern "C"
20 {
21 #endif
22
23 #define I2C_MODULE_NUM 0 // use I2C0/TW0
24 #define I2C_BUS_SPEED (100000) // bus speed of 100kHz
25
26 #define MAX_I2C_BUS_SPEED (400000) // SAME70 specific value. Max bus speed for the TWI is 400 kHz in
Fast Mode
27 #define I2C_LOW_ADDR_LIMIT (0x07)
28 #define I2C_HIGH_ADDR_LIMIT (0x78)
29
30 #define I2C_MAX_BUF_SIZE (64) // Size allocated to input and output buffers in slave mode I2C
31 #define I2C_SLAVE_TX_TERM_CHAR (0) // Terminating char to be sent when Slave TX buffer is empty
32 #define NB_FACTORY_I2C_ERR_VALUE (0) // Error value if there is a failure to extract webpage form data
33
34 /* defined I2C Timeout values will be used if user does not include the ’ticks_to_wait’
35 parameter when calling I2C functions */
36 #define I2C_RX_TX_TIMEOUT (5) // Ticks allowed before timeout of a single byte transmission
37 #define I2C_START_TIMEOUT (20) // Ticks allowed before timeout when attempting start on I2C bus
38
39 #define I2C_MAX_WRITE_LEN (255)
40 #define I2C_MAX_READ_LEN (255)
41 // *2 to account for inputting values in a 2-digit hex format
42 #define MAX_BUFFER_LEN ((I2C_MAX_WRITE_LEN > I2C_MAX_READ_LEN) ? I2C_MAX_WRITE_LEN * 2 : I2C_MAX_READ_LEN
* 2)
43 #define MAX_I2C_DEVICES (128)
44
45 // These are the values the NetBurner I2C functions will return
46 #define I2C_OK (0) // Last instruction terminated correctly
47 #define I2C_NEXT_WRITE_OK (1) // I2C bus is OK for a write
48 #define I2C_NEXT_READ_OK (2) // I2C bus is OK for a read
49 #define I2C_MASTER_OK (3) // I2C finished transmission but still owns but (need to stop or
restart)
50 #define I2C_TIMEOUT (4) // A timeout occurred while trying communicate on I2C bus
51 #define I2C_BUS_NOT_AVAIL (5) // A timeout occurred while trying gain I2C bus control
52 #define I2C_NOT_READY (6) // A read or write was attempted before I2C ready or during a slave
transmission
53 #define I2C_LOST_ARB (7) // Lost arbitration during start
54 #define I2C_LOST_ARB_ADD (8) // Lost arbitration and then winner addressed our slave address
55 #define I2C_NO_LINK_RX_ACK (9) // We are in Master TX mode and received no ACK from slave device,
possibly during start
56
57
58 struct ModuleI2CAddress_Struct
59 {
60 unsigned char byteAddress;
61 unsigned char asciiAddress[3];

NetBurner, Inc.
870 File Documentation

62 };
63
64 // This structure stores the I2C address retrieved from Non-volatile memory
65 // typedef struct NVSettings_Struct
66 //{
67 // char slaveI2CAddress[3];
68 //};
69
70 // Stores ascii and byte versions of I2C parameters
71 struct I2CParam_Struct
72 {
73 char asciiAddress[3];
74 char asciiData[MAX_BUFFER_LEN];
75 char asciiLength[3];
76 unsigned char byteAddress;
77 unsigned char byteData;
78 unsigned char byteBuffer[MAX_BUFFER_LEN];
79 int length;
80 };
81
82 // Used for handling the web I2C functions
83 struct I2CWebFuncs_Struct
84 {
85 I2CParam_Struct WriteReadByteParams;
86 I2CParam_Struct WriteReadBufferParams;
87 I2CParam_Struct WriteByteParams;
88 I2CParam_Struct ReadByteParams;
89 I2CParam_Struct WriteBufferParams;
90 I2CParam_Struct ReadBufferParams;
91 };
92
93 // Used for handling the serial I2C functions
94 struct SerialParams_Struct
95 {
96 // int strLen;
97 unsigned char buf[3];
98 unsigned char byteData;
99 unsigned char length;
100 unsigned char addr;
101 unsigned char byteToWrite;
102 unsigned char commBuffer[MAX_BUFFER_LEN];
103 };
104
105 struct I2CBusStatus_Struct
106 {
107 volatile uint8_t status;
108 const char *statusMsgs[7];
109 };
110
111 #if (defined SAME70)
112 void InitI2C(uint32_t busSpeed = 0);
113 #else
114 #error Multi_I2CInit declaration missing for defined platform
115 #endif
116
117 unsigned char Ascii2Byte(char *buf);
118 int I2CScan(bool *discovered, unsigned char slaveAddress);
119 void I2CStatus();
120
121 #ifdef __cplusplus
122 }
123
124 #endif // __cplusplus
125 #endif // SUPPORTED_I2C_PLATFORM
126 #endif // _I2CFUNCS_H_

22.137 i2crecord.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _I2C_RECORD_H_
6 #define _I2C_RECORD_H_
7 #pragma once
8
9 #include <basictypes.h>
10
11 /*
12 ******************************************************************************
13 *
14 * Class Definition (struct is class with all members public)
15 *
16 ******************************************************************************
17 */

NetBurner, Inc.
22.138 i2cserver.h 871

18 struct I2CRecord
19 {
20 /*
21 * Data
22 */
23 // File descriptor of listening socket
24 int FD_ListeningSocket;
25
26 // File descriptor of connected socket
27 int FD_ConnectedSocket;
28
29 // TRUE if we established the connection
30 bool bWeInitiatedConnection;
31
32 // Time of last network sourced data in seconds since last boot
33 uint32_t LastNetWorkDataRxed;
34
35 // Time of last transmitted data in seconds since last boot
36 uint32_t LastNetWorkDataTxed;
37
38 /*
39 * Methods
40 */
41 void ProcessI2CTimeouts(void);
42 };
43
44 #endif

22.138 i2cserver.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _I2CSERVER_H_
6 #define _I2CSERVER_H_
7
8 #define TCP_LISTEN_PORT 23 // Telnet port number
9 #define FDNET_RX_BUFSIZE 1024
10 #define MAX_CMD_LEN 1024 // Maximum command buffer length
11 #define BEGIN_CMD_CHAR ’#’
12 #define END_CMD_CHAR ’\n’
13 #define EOT_CHAR 4
14 #define MENU_CHAR ’?’
15
16 #define BEGIN_CMD_CHARS 1 // represented by ’#’
17 #define END_CMD_CHARS 1 // represented by ’\n’
18 #define CMD_CHARS 2 // represented by the two cmd chars, ex: WA, WB, etc
19 #define NON_PARAM_CHARS BEGIN_CMD_CHARS + END_CMD_CHARS + CMD_CHARS
20 #define FDNET_READ_CHARS 1
21 #define MAX_FDNET_READ_CHARS 8
22
23 // Character count for each command. Used for verifying the correct input
24 #define WR_PARAM_CHARS 4 // 2 address chars + 2 data chars
25 #define WA_PARAM_CHARS 6 // 2 address chars + 2 data chars + 2 length chars
26 #define WW_PARAM_CHARS 4 // 2 address chars + 2 length chars, need to add data seperately
27 #define WB_PARAM_CHARS 4 // 2 address chars + 2 data chars
28 #define RB_PARAM_CHARS 2 // 2 address chars
29 #define RR_PARAM_CHARS 4 // 2 address chars + 2 length chars
30 #define SE_PARAM_CHARS 2 // 2 new address chars
31 #define SV_PARAM_CHARS 2 // 2 new address chars
32 #define ST_PARAM_CHARS 0 // no parameters required
33 #define RE_PARAM_CHARS 0 // no parameters required
34 #define SC_PARAM_CHARS 0 // no parameters required
35 #define TM_PARAM_CHARS 0 // no parameters required
36
37 extern const char *statusMsgs[];
38
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #endif
43
44 void checkCmdBuf(char *cmdBuf);
45 bool checkCmdLength(char *cmdBuf, int cmdParamChars);
46 bool checkEndCmdChar(char *cmdBuf, int nTotalBytesRead, int nBytesRead);
47 bool checkEOTChar(int nTotalBytesRead, int &nBytesRead);
48 bool checkMenuChar(char *cmdBuf, int nTotalBytesRead, volatile int &nBytesRead);
49 void checkRXBuffer(int nTotalBytesRead, int nBytesRead);
50 bool checkStartCmdChar(char *cmdBuf, int nTotalBytesRead, int nBytesRead);
51 void IPtoString(IPADDR ia, char *s);
52 void MainMenu(int fdnet);
53 void I2CServerTask(void *pd);
54 bool parseTelnetInput(char *cmdBuf, int nTotalBytesRead, int &nBytesRead);
55 void printI2CStatusErrorMsg();

NetBurner, Inc.
872 File Documentation

56 int processCmd(int fdnet, char *cmdBuf);


57 unsigned char processI2CAddress(char *cmdBuf, unsigned char *asciiBuf);
58 unsigned char processI2CDataByte(char *cmdBuf, unsigned char *asciiBuf);
59 bool processI2CReadLength(char *cmdBuf, unsigned char *asciiBuf, unsigned char &length);
60 bool processI2CWriteLength(char *cmdBuf, unsigned char *asciiBuf, unsigned char &length);
61 unsigned char processWR(int fdnet, char *cmdBuf);
62 unsigned char processWA(int fdnet, char *cmdBuf);
63 unsigned char processWW(int fdnet, char *cmdBuf);
64 unsigned char processWB(int fdnet, char *cmdBuf);
65 unsigned char processRB(int fdnet, char *cmdBuf);
66 unsigned char processRR(int fdnet, char *cmdBuf);
67 unsigned char processSE(int fdnet, char *cmdBuf);
68 unsigned char processSV(int fdnet, char *cmdBuf);
69 unsigned char processST(int fdnet, char *cmdBuf);
70 unsigned char processRE(int fdnet, char *cmdBuf);
71 unsigned char processSC(int fdnet, char *cmdBuf);
72 void storeCmdChars(char *cmdBuf, int nTotalBytesRead, int nBytesRead);
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif // _TCPSERVER_H_

22.139 SSH/SecureSerToEthFactoryApp/src/nbfactory.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_FACTORY_H_
6 #define _NB_FACTORY_H_
7
8 /*
9 ******************************************************************************
10 *
11 * Factory defaults for this factory application
12 *
13 ******************************************************************************
14 */
15 /* Configuration verify key (increment if data changed, added, reorganized) */
16 #define NB_FACTORY_VERIFY_KEY (0x7E545093)
17 /* STD-EFFS verify key (increment to format file system, required for 1.6-1.9 STD EFFS Upgrade) */
18 #define STD_EFFS_VERIFY_KEY (0x15A58104)
19
20 /* Version VV.NN.vvvv ( 0xVVNNvvvv ), string must match constant */
21 #define NB_FACTORY_DEFAULTS_VERSION (uint32_t)(0x03010002)
22 #define NB_FACTORY_DEFAULTS_VERSION_STRING "03.01.02"
23
24 /* Module Base Name */
25 #if defined MOD5441X
26 #define NB_FACTORY_MODULE_BASE_NAME "MOD5441x"
27 #elif defined SB800EX
28 #define NB_FACTORY_MODULE_BASE_NAME "SB800EX"
29 #elif defined NANO54415
30 #define NB_FACTORY_MODULE_BASE_NAME "NANO54415"
31 #elif defined MODM7AE70
32 #define NB_FACTORY_MODULE_BASE_NAME "MODM7AE70"
33 #elif defined SBE70LC
34 #define NB_FACTORY_MODULE_BASE_NAME "SBE70LC"
35 #else
36 #error Module not supported
37 #endif
38
39 /*
40 * This enables the application to work with the PK70 platform and any one of
41 * the following quad-UART blade boards:
42 *
43 * - NBPKBU-100/232CR - use PK70_QUAD_232 definition
44 * - NBPKBU-485CR - use PK70_QUAD_485 definition
45 * - NBPKBU-MMSCR - use PK70_QUAD_MMS definition
46 *
47 * Only one definition can be un-commented at a time.
48 */
49 //#define PK70_QUAD_232 (1)
50 //#define PK70_QUAD_485 ( 1 )
51 //#define PK70_QUAD_MMS ( 1 )
52
53 /* Module Description */
54 #define NB_FACTORY_BASE_DESC "Network to Serial"
55
56 /* Feature Name and Description */
57 #define NB_FACTORY_FEATURE_NAME "SX"
58 #define NB_FACTORY_FEATURE_DESC "Securable Network to Serial"
59

NetBurner, Inc.
22.139 SSH/SecureSerToEthFactoryApp/src/nbfactory.h 873

60 #define WIFI_INSTALLED ( 1 ) // Applies to general wifi functionality


61
62 #if (defined SBE70LC)
63 #define SUPPORTED_I2C_PLATFORM
64 #endif
65
66 #ifdef SUPPORTED_I2C_PLATFORM
67 #define NB_FACTORY_I2C_PORTS (1)
68 #else
69 #define NB_FACTORY_I2C_PORTS (0)
70 #endif
71
72 /* The GPIO server can interfere with pins needed by other features such as I2C.
73 * Only use the GPIO server when not using other features that require use of pins
74 * on the J1 header such as the Ethernet-to-I2C server. */
75 #if ((defined SBE70LC) && !(defined SUPPORTED_I2C_PLATFORM))
76 #define SUPPORTED_GPIO_SERVER_PLATFORM
77 #endif
78
79 /* The GPIO server can take control of pins from other features such as I2C and WiFi.
80 * Only use the GPIO server when not using other features that require use of pins
81 * on the P1 header such as WiFi and the Ethernet-to-I2C server. */
82 #if ((defined MODM7AE70) && !(defined SUPPORTED_I2C_PLATFORM) && !(defined WIFI_INSTALLED))
83 #define SUPPORTED_GPIO_SERVER_PLATFORM
84 #endif
85
86 /* Use all 7 serial ports (USARTS+UARTS) on the MODM7AE70 instead of just 2 (USART only).
87 * Using all 7 serial ports will increase the use of config memory space.
88 */
89 // #define USE_E70_UART_SERIAL_PORTS
90
91 /* Number of serial ports */
92 // If you change this to allow other platforms to use more than 2,
93 // a fair bit of logic will need to change
94 #if (defined NANO54415)
95 #define NB_FACTORY_SERIAL_PORTS (5)
96 #elif (defined MODM7AE70 && defined USE_E70_UART_SERIAL_PORTS)
97 #define NB_FACTORY_SERIAL_PORTS (7)
98 #else
99 #define NB_FACTORY_SERIAL_PORTS (2)
100 #endif
101
102 /* SSL */
103 #define NB_FACTORY_INCLUDE_SSL (1)
104
105 /* SSH */
106 #define NB_FACTORY_INCLUDE_SSH (1)
107
108 /*** Network Defaults ***/
109
110 /* PROTOCOL_TCP_TO_SERIAL is 2 in serialburnerdata.h */
111 #define NB_FACTORY_PROTOCOL_DEFAULT "TCP/SSL"
112 #define NB_FACTORY_LISTEN_PORT_DEFAULT IANA_TELNET_PORT // Port 23
113 #define NB_FACTORY_INACTIVITY_TIMEOUT_DEFAULT (60)
114 #define NB_FACTORY_NEW_CONNECTION_TIMEOUT_DEFAULT (30)
115
116 /* I2C to Ethernet default port */
117 #define NB_FACTORY_I2C_LISTEN_PORT_DEFAULT (26)
118
119 /* SERIAL_CONNECT_CONNECT_NEVER is 1 serialburnerdata.h */
120 #define NB_FACTORY_CONNECT_MODE_DEFAULT SERIAL_CONNECT_CONNECT_NEVER
121
122 /* Near the end of well known ports (1023) */
123 #define NB_FACTORY_CONNECT_PORT_DEFAULT (1000)
124
125 /* IP address 0.0.0.0 is zero */
126 #define NB_FACTORY_CONNECT_ADDRESS (0)
127
128 #define NB_CONNECT_IDLE_TIMEOUT_DEFAULT (60)
129 #define NB_CONNECT_RETRY_TIMEOUT_DEFAULT (360)
130 #define NB_CONENCT_KEEP_ALIVE_INTERVAL_DEFAULT (0)
131 #define NB_MAX_TCP_CONNECTIONS (5)
132
133 #define NB_FACTORY_NTPSERVERNAME_DEFAULT "pool.ntp.org"
134
135 /*** Serial defaults ***/
136
137 /* SERIAL_MODE_RS232 is 1 serialburnerdata.h */
138 #define NB_FACTORY_DEFAULT_SERIAL_MODE SERIAL_MODE_RS232
139
140 /* Serial mode capability sets */
141 #define NB_FACTORY_SERIAL_CAPABILITY_FULL SERIAL_MODE_RS232 "," SERIAL_MODE_DEBUG "," SERIAL_MODE_485H
"," SERIAL_MODE_485F "," SERIAL_MODE_422F
142 #define NB_FACTORY_SERIAL_CAPABILITY_RS232 SERIAL_MODE_RS232 "," SERIAL_MODE_DEBUG
143
144 /*
145 * Serial port fully capable RS-232 & RS-485 and debug default

NetBurner, Inc.
874 File Documentation

146 * Assuming default configurations or development boards


147 */
148 #if ( defined SBE70LC )
149 #define NB_FACTORY_SERIAL_PORT_0_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
150 #define NB_FACTORY_SERIAL_PORT_1_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
151 #elif ( defined MODM7AE70 )
152 #define NB_FACTORY_SERIAL_PORT_0_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
153 #define NB_FACTORY_SERIAL_PORT_1_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
154 #define NB_FACTORY_SERIAL_PORT_2_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
155 #define NB_FACTORY_SERIAL_PORT_3_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
156 #define NB_FACTORY_SERIAL_PORT_4_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
157 #define NB_FACTORY_SERIAL_PORT_5_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
158 #define NB_FACTORY_SERIAL_PORT_6_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
159 #elif ( defined MOD5441X )
160 #define NB_FACTORY_SERIAL_PORT_0_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
161 #define NB_FACTORY_SERIAL_PORT_1_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
162 #elif ( defined SB800EX )
163 #define NB_FACTORY_SERIAL_PORT_0_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
164 #define NB_FACTORY_SERIAL_PORT_1_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
165 #elif ( defined NANO54415 )
166 #define NB_FACTORY_SERIAL_PORT_0_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
167 #define NB_FACTORY_SERIAL_PORT_1_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_FULL
168 #define NB_FACTORY_SERIAL_PORT_2_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
169 #define NB_FACTORY_SERIAL_PORT_3_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
170 #define NB_FACTORY_SERIAL_PORT_4_MODE_CAPABILITY NB_FACTORY_SERIAL_CAPABILITY_RS232
171 #else
172 #error Module not supported
173 #endif
174
175 /*
176 * Use the system defined default boot UART port as the debug port.
177 * The value of plat_def_com can be found in the platform’s hal.cpp
178 */
179 #define NB_FACTORY_DEBUG_SERIAL_PORT_DEFAULT (int)(plat_def_com)
180
181 #if (defined SB800EX)
182 #define WIFI_INSTALLED ( 1 ) // Applies to general wifi functionality
183 #define ACTIVITY_LEDS ( 1 )
184 #endif
185
186 /*
187 * NetBurner MAC OUI definitions. These are used for confirming the MAC address
188 * of a NBWIFI module.
189 */
190 #define NB_OUI_OCTET_0 (uint8_t)(0x00)
191 #define NB_OUI_OCTET_1 (uint8_t)(0x03)
192 #define NB_OUI_OCTET_2 (uint8_t)(0xf4)
193
194 /* Serial data settings defaults */
195 #define NB_FACTORY_SERIAL_DATA_RATE_DEFAULT "115200"
196 #define NB_FACTORY_SERIAL_CUSTOM_DATA_RATE_DEFAULT (0)
197 #define NB_FACTORY_SERIAL_DATA_BITS_DEFAULT "8"
198 #define NB_FACTORY_SERIAL_STOP_BITS_DEFAULT "1"
199
200 /* I2C data settings defaults */
201 #define NB_FACTORY_I2C_BUS_SPEED_DEFAULT (100000)
202 #define NB_FACTORY_I2C_IC_DEFAULT (0x16)
203 #define NB_FACTORY_I2C_FREQ_DIVIDER_DEFAULT (768)
204 #define NB_FACTORY_I2C_CUSTOM_DATA_RATE_DEFAULT (0)
205 #define NB_FACTORY_I2C_ADDRESS_DEFAULT (0x08)
206 #define NB_FACTORY_I2C_TCP_AS_SSL_DEFAULT (false)
207
208 /* None is 1 serialburnerdata.h */
209 #define NB_FACTORY_SERIAL_PARITY_DEFAULT "None"
210
211 /* SERIAL_FLOW_MODE_NONE is 1 serialburnerdata.h */
212 #define NB_FACTORY_SERIAL_FLOW_CONTROL_DEFAULT "None"
213
214 #define NB_FACTORY_DO_AT_COMMANDS_DEFAULT (false)
215
216 #define NB_FACTORY_ENABLE_GPIO_HI_DRIVE_DEFAULT (false)
217 #define NB_FACTORY_DO_GPIO_COMMANDS_DEFAULT (true)
218 #define NB_FACTORY_GPIO_PORT_DEFAULT (1000)
219 #define NB_FACTORY_GPIO_OVER_SSL_DEFAULT (false)
220 #define NB_FACTORY_GPIO_SAVE_TO_FLASH_DEFAULT (true)
221
222 /* Serial Port Settings jumper page enabled */
223 #define NB_FACTORY_USE_CONNECT_MSG_DEFAULT (false)
224 #define NB_FACTORY_USE_CONNECTION_LOST_MSG_DEFAULT (false)
225 #define NB_FACTORY_BREAK_ON_CONNECT_DEFAULT (false)
226 #define NB_FACTORY_BREAK_INTERVAL_DEFAULT (20)
227 #define NB_FACTORY_BREAK_KEY_FLAG_DEFAULT (false)
228 #define NB_FACTORY_BREAK_KEY_VALUE_DEFAULT "02"
229
230 /* SSL */
231 #define NB_FACTORY_SSL_PERMANENT_DESC_DEFAULT "NetBurner Library Default "
232 #define NB_FACTORY_SSL_INCLUDED_DESC_DEFAULT "Default "

NetBurner, Inc.
22.139 SSH/SecureSerToEthFactoryApp/src/nbfactory.h 875

233 #define NB_FACTORY_SSL_INSTALLED_DESC_DEFAULT "User Installed "


234
235 #define NB_FACTORY_SSL_FILE_NAME_CERT "cert.crt"
236 #define NB_FACTORY_SSL_FILE_NAME_KEY "cert.key"
237
238 /* SSH */
239 #define NB_FACTORY_INACTIVITY_TIMEOUT_SSH_DEFAULT (360)
240 #define NB_FACTORY_NEW_CONNECTION_TIMEOUT_SSH_DEFAULT (180)
241
242 #define NB_FACTORY_SSH_PERMANENT_KEY_DESC_DEFAULT "NetBurner Library Default "
243 #define NB_FACTORY_SSH_INCLUDED_KEY_DESC_DEFAULT "Default "
244 #define NB_FACTORY_SSH_INSTALLED_KEY_DESC_DEFAULT "User Installed "
245
246 #define NB_FACTORY_SSH_FILE_NAME_KEY_RSA "rsa.key"
247 #define NB_FACTORY_SSH_FILE_NAME_KEY_ECDSA "ecdsa.key"
248
249 /* UDP */
250 #define NB_FACTORY_ACCUMULATED_CHARS_UDP_DEFAULT (32)
251 #define NB_FACTORY_WAIT_UDP_IN_TICKS_DEFAULT (100)
252 #define NB_FACTORY_TRIGGER_CHAR_UDP_DEFAULT ("NA")
253 #define NB_FACTORY_LEARN_UDP_DEFAULT (false)
254 #define NB_FACTORY_CHECK_FRAMING_CHAR_UDP_DEFAULT (false)
255
256 /* TCP */
257 #define NB_FACTORY_ACCUMULATED_CHARS_TCP_DEFAULT (32)
258 #define NB_FACTORY_WAIT_TCP_IN_TICKS_DEFAULT (100)
259 #define NB_FACTORY_TRIGGER_CHAR_TCP_DEFAULT ("NA")
260 #define NB_FACTORY_LISTEN_FOR_TCP_CONNECT_DEFAULT (true)
261 #define NB_FACTORY_CUSTOM_FRAME_TCP_DEFAULT (false)
262 #define NB_FACTORY_CHECK_FRAMING_CHAR_TCP_DEFAULT (false)
263
264 /* DHCP timeout */
265 #define NB_FACTORY_DHCP_TIMEOUT_IN_TICKS (10 * TICKS_PER_SECOND)
266
267 /*
268 * Maximum size of certificate or key files in bytes
269 * Must the maximum of
270 * SERIAL_BURNER_CERTIFICATE_SIZE_MAX
271 * SERIAL_BURNER_RSA_KEY_SIZE_MAX
272 * SERIAL_BURNER_ECC_KEY_SIZE_MAX
273 */
274 #define NB_FACTORY_FILE_SIZE_MAXIMUM (4 * 1024)
275
276 /*
277 * On-chip file system EFFS-STD
278 * COMPCODEFLAGS end address must be set to file system start
279 * (FIRST_ADDR)
280 */
281
282 /* Module unique flash parameters */
283 #if (defined MOD5441X)
284 /* Flash */
285 #define NB_FACTORY_FLASH_32MB_128KB_SECTORS (1)
286 /* Base address */
287 #define NB_FACTORY_FS_FLASHBASE (0xC0000000)
288 /* See makefile for COMPCODEFLAGS */
289
290 #elif (defined SB800EX)
291 /* Flash */
292 #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS (1)
293 /* Base address */
294 // #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 ) // not used for spi flash
295 /* See makefile for COMPCODEFLAGS */
296
297 #elif (defined NANO54415)
298 /* Flash */
299 #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS (1)
300 /* Base address */
301 //#define NB_FACTORY_FS_FLASHBASE ( 0x040000 ) // not used for spi flash
302 /* See makefile for COMPCODEFLAGS */
303
304 #elif ((defined MODM7AE70) || (defined SBE70LC))
305 /* Flash */
306 #define NB_FACTORY_FLASH_2MB_8KB_SECTORS (1)
307 /* Base address */
308 #define NB_FACTORY_FS_FLASHBASE (0x00400000)
309 #include "flashChip/SAME70Q21.h"
310 #else
311 #error Module not supported
312 #endif
313
314 #if (defined WIFI_INSTALLED)
315 #define SYSTEM_CONFIG_RECORD_KEY_PSK_MAX_SIZE SYSTEM_CONFIG_RECORD_WPA_PSK_SIZE_MAX
316 #endif
317
318 #endif /* #ifdef _NB_FACTORY_H_ */

NetBurner, Inc.
876 File Documentation

22.140 SSH/SshServerUserKey/src/nbfactory.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_FACTORY_H_
6 #define _NB_FACTORY_H_
7
8 /******************************************************************************
9 *
10 * Factory defaults for this factory application
11 *
12 *****************************************************************************/
13
14 // Version VV.NN.vvvv ( 0xVVNNvvvv ), string must match constant
15 #define NB_FACTORY_DEFAULTS_VERSION (DWORD)(0x01110000)
16 #define NB_FACTORY_DEFAULTS_VERSION_STRING "01.00"
17
18 // Module Base Name
19 #if defined MOD5441X
20 #define NB_FACTORY_MODULE_BASE_NAME "MOD5441X"
21 #elif defined NANO54415
22 #define NB_FACTORY_MODULE_BASE_NAME "NANO54415"
23 #elif defined SB800EX
24 #define NB_FACTORY_MODULE_BASE_NAME "SB800EX"
25 #elif defined MODM7AE70
26 #define NB_FACTORY_MODULE_BASE_NAME "MODM7AE70"
27 #elif defined SBE70LC
28 #define NB_FACTORY_MODULE_BASE_NAME "SBE70LC"
29 #else
30 #error Module not supported
31 #endif
32 // Module Description
33 #define NB_FACTORY_BASE_DESC "SSH User Key Example"
34
35 /* Feature Name and Description */
36 #define NB_FACTORY_FEATURE_NAME ""
37 #define NB_FACTORY_FEATURE_DESC "Upload SSH Key Example"
38
39 #define NB_FACTORY_INCLUDE_SSH (1)
40 #define SSH_KEY_SIZE_MAX_PEM ((4 * 1024) - 1)
41
42 #define NB_FACTORY_INACTIVITY_TIMEOUT_SSH_DEFAULT (180)
43 #define NB_FACTORY_NEW_CONNECTION_TIMEOUT_SSH_DEFAULT (360)
44
45 #define NB_FACTORY_SSH_PERMANENT_KEY_DESC_DEFAULT "NetBurner Library Default "
46 #define NB_FACTORY_SSH_INCLUDED_KEY_DESC_DEFAULT "Application Default "
47 #define NB_FACTORY_SSH_INSTALLED_KEY_DESC_DEFAULT "User Installed "
48
49 #define NB_FACTORY_SSH_FILE_NAME_KEY_RSA "rsa.key"
50 #define NB_FACTORY_SSH_FILE_NAME_KEY_ECC "ecc.key"
51
52 // DHCP timeout
53 #define NB_FACTORY_DHCP_TIMEOUT_IN_TICKS (10 * TICKS_PER_SECOND)
54
55 /*
56 * Maximum size of certificate or key files in bytes
57 * Must the maximum of
58 * SERIAL_BURNER_CERTIFICATE_SIZE_MAX
59 * SERIAL_BURNER_RSA_KEY_SIZE_MAX
60 * SERIAL_BURNER_ECC_KEY_SIZE_MAX
61 */
62 #define NB_FACTORY_FILE_SIZE_MAXIMUM (4 * 1024)
63
64 /*
65 * On-chip file system EFFS-STD
66 * COMPCODEFLAGS end address must be set to file system start
67 * (FIRST_ADDR)
68 */
69
70 /* Module unique flash parameters */
71 #if defined MOD5441X
72 /* Flash */
73 #define NB_FACTORY_FLASH_32MB_128KB_SECTORS (1)
74 /* Base address */
75 #define NB_FACTORY_FS_FLASHBASE (0xC0000000)
76 /* See makefile for COMPCODEFLAGS */
77
78 #elif defined NANO54415
79 /* Flash */
80 #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS (1)
81 /* Base address */
82 //#define NB_FACTORY_FS_FLASHBASE ( 0x040000 ) // not used for spi flash
83 /* See makefile for COMPCODEFLAGS */
84
85 #elif defined SB800EX

NetBurner, Inc.
22.141 SSL/HttpsUploadCert/src/nbfactory.h 877

86 /* Flash */
87 #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS (1)
88 /* Base address */
89 // #define NB_FACTORY_FS_FLASHBASE ( 0xFFC00000 ) // not used for spi flash
90 /* See makefile for COMPCODEFLAGS */
91
92 #elif ((defined MODM7AE70) || (defined SBE70LC))
93 /* Flash */
94 #define NB_FACTORY_FLASH_2MB_8KB_SECTORS (1)
95 /* Base address */
96 #define NB_FACTORY_FS_FLASHBASE (0x00400000)
97
98 #else
99 #error Module not supported
100 #endif
101
102 #define debug_iprintf(...) \
103 { \
104 if (bShowDebug == TRUE) { iprintf(__VA_ARGS__); } \
105 }
106
107 #endif /* #ifdef _NB_FACTORY_H_ */

22.141 SSL/HttpsUploadCert/src/nbfactory.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_FACTORY_H_
6 #define _NB_FACTORY_H_
7
8 /*
9 ******************************************************************************
10 *
11 * Factory defaults for this factory application
12 *
13 ******************************************************************************
14 */
15 /* Configuration verify key (increment if data changed, added, reorganized) */
16 #define NB_FACTORY_VERIFY_KEY (0x7E545085)
17 /* STD-EFFS verify key (increment to format file system, required for 1.6-1.9 STD EFFS Upgrade) */
18 #define STD_EFFS_VERIFY_KEY (0x15A58101)
19
20 /* Version VV.NN.vvvv ( 0xVVNNvvvv ), string must match constant */
21 #define NB_FACTORY_DEFAULTS_VERSION (uint32_t)(0x01000000)
22 #define NB_FACTORY_DEFAULTS_VERSION_STRING "01.00.0000"
23
24 /* Module Base Name */
25 #if defined MOD5441X
26 #define NB_FACTORY_MODULE_BASE_NAME "MOD5441X"
27 #elif defined NANO54415
28 #define NB_FACTORY_MODULE_BASE_NAME "NANO54415"
29 #elif defined SB800EX
30 #define NB_FACTORY_MODULE_BASE_NAME "SB800EX"
31 #elif defined MODM7AE70
32 #define NB_FACTORY_MODULE_BASE_NAME "MODM7AE70"
33 #elif defined SBE70LC
34 #define NB_FACTORY_MODULE_BASE_NAME "SBE70LC"
35 #else
36 #error Module not supported
37 #endif
38
39 /* Module Description */
40 #define NB_FACTORY_BASE_DESC "SSL/TLS"
41
42 /* Feature Name and Description */
43 #define NB_FACTORY_FEATURE_NAME "SX"
44 #define NB_FACTORY_FEATURE_DESC "Certificate Upload Example"
45
46 /* SSH */
47 #define NB_FACTORY_INCLUDE_SSH (1)
48
49 /* SSL */
50 #define NB_FACTORY_SSL_PERMANENT_DESC_DEFAULT "Not Installed"
51 #define NB_FACTORY_SSL_INCLUDED_DESC_DEFAULT "Default "
52 #define NB_FACTORY_SSL_INSTALLED_DESC_DEFAULT "User Installed "
53
54 #define NB_FACTORY_SSL_FILE_NAME_CERT "cert.crt"
55 #define NB_FACTORY_SSL_FILE_NAME_KEY "cert.key"
56
57 /* DHCP timeout */
58 #define NB_FACTORY_DHCP_TIMEOUT_IN_TICKS (10 * TICKS_PER_SECOND)
59
60 /*

NetBurner, Inc.
878 File Documentation

61 * Maximum size of certificate or key files in bytes


62 * Must the maximum of
63 * SERIAL_BURNER_CERTIFICATE_SIZE_MAX
64 * SERIAL_BURNER_RSA_KEY_SIZE_MAX
65 * SERIAL_BURNER_DSA_KEY_SIZE_MAX
66 */
67 #define NB_FACTORY_FILE_SIZE_MAXIMUM (4 * 1024)
68
69 /*
70 * On-chip file system EFFS-STD
71 * COMPCODEFLAGS end address must be set to file system start
72 * (FIRST_ADDR)
73 */
74
75 /* Module unique flash parameters */
76 #if defined MOD5441X
77 /* Flash */
78 #define NB_FACTORY_FLASH_32MB_128KB_SECTORS (1)
79 /* Base address */
80 #define NB_FACTORY_FS_FLASHBASE (0xC0000000)
81 /* See makefile for COMPCODEFLAGS */
82
83 #elif (defined NANO54415) || (defined SB800EX)
84 /* Flash */
85 #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS (1)
86 /* Base address */
87 //#define NB_FACTORY_FS_FLASHBASE ( 0x040000 ) // not used for spi flash
88 /* See makefile for COMPCODEFLAGS */
89
90 #elif ((defined MODM7AE70) || (defined SBE70LC))
91 /* Flash */
92 #define NB_FACTORY_FLASH_2MB_8KB_SECTORS (1)
93 /* Base address */
94 #define NB_FACTORY_FS_FLASHBASE (0x00400000)
95
96 #else
97 #error Module not supported
98 #endif
99
100 #endif /* #ifdef _NB_FACTORY_H_ */

22.142 SSL/SslClientVerifyPeerEffs/src/nbfactory.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_FACTORY_H_
6 #define _NB_FACTORY_H_
7
8 /*
9 ******************************************************************************
10 *
11 * Factory defaults for this factory application
12 *
13 ******************************************************************************
14 */
15 /* Configuration verify key (increment if data changed, added, reorganized) */
16 #define NB_FACTORY_VERIFY_KEY (0x7E545085)
17 /* STD-EFFS verify key (increment to format file system, required for 1.6-1.9 STD EFFS Upgrade) */
18 #define STD_EFFS_VERIFY_KEY (0x15A58101)
19
20 /* Version VV.NN.vvvv ( 0xVVNNvvvv ), string must match constant */
21 #define NB_FACTORY_DEFAULTS_VERSION (DWORD)(0x01000000)
22 #define NB_FACTORY_DEFAULTS_VERSION_STRING "01.00.0000"
23
24 /* Module Base Name */
25 #if defined MOD5441X
26 #define NB_FACTORY_MODULE_BASE_NAME "MOD5441X"
27 #elif defined NANO54415
28 #define NB_FACTORY_MODULE_BASE_NAME "NANO54415"
29 #elif defined MODM7AE70
30 #define NB_FACTORY_MODULE_BASE_NAME "MODM7AE70"
31 #elif defined SB800EX
32 #define NB_FACTORY_MODULE_BASE_NAME "SB800EX"
33 #elif defined SBE70LC
34 #define NB_FACTORY_MODULE_BASE_NAME "SBE70LC"
35 #else
36 #error Module not supported
37 #endif
38
39 /* Module Description */
40 #define NB_FACTORY_BASE_DESC "SSL/TLS"
41
42 /* Feature Name and Description */

NetBurner, Inc.
22.143 permanentcert.h 879

43 #define NB_FACTORY_FEATURE_NAME "SX"


44 #define NB_FACTORY_FEATURE_DESC "Verify Peer Effs Example"
45
46 /* SSL */
47 #define NB_FACTORY_INCLUDE_SSL (1)
48
49 /* SSL */
50 #define NB_FACTORY_SSL_PERMANENT_DESC_DEFAULT "NetBurner Library Default "
51 #define NB_FACTORY_SSL_INCLUDED_DESC_DEFAULT "Default "
52 #define NB_FACTORY_SSL_INSTALLED_DESC_DEFAULT "User Installed "
53
54 #define NB_FACTORY_SSL_FILE_NAME_CERT "cert.crt"
55 #define NB_FACTORY_SSL_FILE_NAME_KEY "cert.key"
56
57 /* DHCP timeout */
58 #define NB_FACTORY_DHCP_TIMEOUT_IN_TICKS (10 * TICKS_PER_SECOND)
59
60 /*
61 * Maximum size of certificate or key files in bytes
62 * Must the maximum of
63 * SERIAL_BURNER_CERTIFICATE_SIZE_MAX
64 * SERIAL_BURNER_RSA_KEY_SIZE_MAX
65 * SERIAL_BURNER_DSA_KEY_SIZE_MAX
66 */
67 #define NB_FACTORY_FILE_SIZE_MAXIMUM (5 * 1024)
68
69 /*
70 * On-chip file system EFFS-STD
71 * COMPCODEFLAGS end address must be set to file system start
72 * (FIRST_ADDR)
73 */
74
75 /* Module unique flash parameters */
76
77 #if defined MOD5441X
78 /* Flash */
79 #define NB_FACTORY_FLASH_32MB_128KB_SECTORS (1)
80 /* Base address */
81 #define NB_FACTORY_FS_FLASHBASE (0xC0000000)
82 /* See makefile for COMPCODEFLAGS */
83
84 #elif ((defined NANO54415) || (defined SB800EX))
85 /* Flash */
86 #define NB_FACTORY_FLASH_SPI_8MB_4KB_SECTORS (1)
87 /* Base address */
88 //#define NB_FACTORY_FS_FLASHBASE ( 0x040000 ) // not used for spi flash
89 /* See makefile for COMPCODEFLAGS */
90
91 #elif ((defined MODM7AE70) || (defined SBE70LC))
92 /* Flash */
93 #define NB_FACTORY_FLASH_2MB_8KB_SECTORS (1)
94 /* Base address */
95 #define NB_FACTORY_FS_FLASHBASE (0x00400000)
96
97 #else
98 #error Module not supported
99 #endif
100
101 #endif /* #ifdef _NB_FACTORY_H_ */

22.143 permanentcert.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*
6 * Permanent certificate
7 * Must be paired with permanent certificate key (permanentcertkey.h)
8 *
9 */
10
11 #ifndef _PERMANENTCERT_H_
12 #define _PERMANENTCERT_H_
13
14 "-----BEGIN CERTIFICATE-----\r\
15 MIIC7DCCApagAwIBAgIBADANBgkqhkiG9w0BAQQFADCBiDELMAkGA1UEBhMCVVMx\r\
16 EzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcTCVNhbiBEaWVnbzEYMBYGA1UE\r\
17 ChMPTmV0QnVybmVyLCBJbmMuMRIwEAYDVQQDEwlOZXRCdXJuZXIxIjAgBgkqhkiG\r\
18 9w0BCQEWE3NhbGVzQG5ldGJ1cm5lci5jb20wHhcNMDgwODI3MTcxMDQxWhcNMTgw\r\
19 ODI1MTcxMDQxWjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWEx\r\
20 EjAQBgNVBAcTCVNhbiBEaWVnbzEYMBYGA1UEChMPTmV0QnVybmVyLCBJbmMuMRIw\r\
21 EAYDVQQDEwlOZXRCdXJuZXIxIjAgBgkqhkiG9w0BCQEWE3NhbGVzQG5ldGJ1cm5l\r\
22 ci5jb20wXDANBgkqhkiG9w0BAQEFAANLADBIAkEA7hC9uEH7Bv/Jj2WZVIYqxSht\r\
23 nb27TszV7o+kMJgBN744Er5l1GN1LDpDuuiN3uTwdVnrwj8TCLAQeIjLE6DHUQID\r\

NetBurner, Inc.
880 File Documentation

24 AQABo4HoMIHlMB0GA1UdDgQWBBRQpzLTD0kF5FyAu8iIBV7uk2jKWzCBtQYDVR0j\r\
25 BIGtMIGqgBRQpzLTD0kF5FyAu8iIBV7uk2jKW6GBjqSBizCBiDELMAkGA1UEBhMC\r\
26 VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAcTCVNhbiBEaWVnbzEYMBYG\r\
27 A1UEChMPTmV0QnVybmVyLCBJbmMuMRIwEAYDVQQDEwlOZXRCdXJuZXIxIjAgBgkq\r\
28 hkiG9w0BCQEWE3NhbGVzQG5ldGJ1cm5lci5jb22CAQAwDAYDVR0TBAUwAwEB/zAN\r\
29 BgkqhkiG9w0BAQQFAANBAC3mhcTjlaRWQZF0fSW5Au9BKuQqxL4x/d84DzeLtH3X\r\
30 oAzAvYlyCh451FyMokod8RqyWT4j8Nmxya2fPKl+FRk=\r\
31 -----END CERTIFICATE-----\r"
32
33 #endif /*_PERMANENTCERT_H_*/

22.144 permanentcertkey.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*
6 * Permanent key accompanying cetificate
7 * Must be paired with permanent certificate (permanentcert.h)
8 *
9 */
10
11 #ifndef _PERMANENTCERTKEY_H_
12 #define _PERMANENTCERTKEY_H_
13
14 "-----BEGIN RSA PRIVATE KEY-----\r\
15 MIIBOwIBAAJBAO4QvbhB+wb/yY9lmVSGKsUobZ29u07M1e6PpDCYATe+OBK+ZdRj\r\
16 dSw6Q7rojd7k8HVZ68I/EwiwEHiIyxOgx1ECAwEAAQJBAIwRH36sm2Rn1JBhB5C6\r\
17 i6mKeswHWJApZmlA7CqHFJhVWSn7VJvgOpV7LudSlF8sbu3y6JLiYxOolS98qDKc\r\
18 PB0CIQD4DmNuYfnbJL/GPBSQvrH+ZtKQwLp5BtVe8DYdxk7q1wIhAPWwcjaLVkkG\r\
19 y9L/ffrzI+TShK7d4sI2ux5chn2+bAIXAiEA5VT4HF88jpxFKNL2+HM1QExztBxa\r\
20 yfXFYsaWYaSr5XUCIEWb4EAj6iZ2jnkRehgHmzvRiVYh94UfDJTlkhU+RkuxAiBY\r\
21 Y2roCSCyewcHGCAIaJn/RnDovcw479QXrqTD+YXQ1w==\r\
22 -----END RSA PRIVATE KEY-----\r"
23
24 #endif /*_PERMANENTCERTKEY_H_*/

22.145 permanentkeyecdsa.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*
6 * Default SSH ECDSA key in openSSL (openSSH) format
7 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
8 *
9 */
10
11 #ifndef _PERMANENTKEYECDSA_H_
12 #define _PERMANENTKEYECDSA_H_
13
14 "-----BEGIN EC PRIVATE KEY-----\r\
15 MHcCAQEEIJQCd0y9U8mFVUWqJUNRX2FYkPTBuuYu1MFSm6QaGxA7oAoGCCqGSM49\r\
16 AwEHoUQDQgAE++54xjrZKCfpmMYqaEdP2w0fTkXC6FEuWp1sg/uuOXiF2cS7GHY/\r\
17 6PYVqh7SjIH+1QUxaRKlsIhXsIguY0tW3w==\r\
18 -----END EC PRIVATE KEY-----\r"
19
20 #endif /*_PERMANENTKEYECDSA_H_*/

22.146 SecureSerToEthFactoryApp/src/permanentkeyrsa.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*
6 * Default SSH RSA key in openSSL (openSSH) format
7 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
8 *
9 */
10
11 #ifndef _PERMANENTKEYRSA_H_
12 #define _PERMANENTKEYRSA_H_
13
14 "-----BEGIN RSA PRIVATE KEY-----\r\
15 MIIBOgIBAAJBAOrfRkFnPMI0K41ufL1HLzlpf2yieGLSGE8kL2OQjX0Pp4Qq+91F\r\
16 DRYD1YuKiPfjxsAkVBqlY7v23ZvzEfNcgDUCAwEAAQJAaFT2KGdrnfj+v7ysvIe6\r\

NetBurner, Inc.
22.147 SshServerUserKey/src/permanentkeyrsa.h 881

17 eo5ahC9Hut4I3l78jgXQVBSeMhatb+RMyuSshgGq3+2ph6EQQABBstvuWwl5AAkU\r\
18 oQIhAPtpCjpqiAQtqo1u64T/Pr5fX2IuzmbOhIvW8czDdKF3AiEA7yjxoEGMl+8o\r\
19 4v8pLFZqR0s4P4G/wgScuqtCPLtjtrMCICrH5QWruxl669rFVS58gKDEeearMFQu\r\
20 MD/bg6nkWKRhAiBTMuwz8vnFFUclCN069mkMmkdcGHgsN8yKR+/IDuyWbwIhAKZ9\r\
21 KgZz3UZCnWHDXaelDFJI+Xdstx5XwBdTAlqwOU+L\r\
22 -----END RSA PRIVATE KEY-----\r"
23
24 #endif /*_PERMANENTKEYRSA_H_*/

22.147 SshServerUserKey/src/permanentkeyrsa.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*
6 * Default SSH RSA key in openSSL (openSSH) format
7 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
8 *
9 */
10
11 #ifndef _PERMANENTKEYRSA_H_
12 #define _PERMANENTKEYRSA_H_
13
14 "-----BEGIN RSA PRIVATE KEY-----\r\
15 MIIBOgIBAAJBAOrfRkFnPMI0K41ufL1HLzlpf2yieGLSGE8kL2OQjX0Pp4Qq+91F\r\
16 DRYD1YuKiPfjxsAkVBqlY7v23ZvzEfNcgDUCAwEAAQJAaFT2KGdrnfj+v7ysvIe6\r\
17 eo5ahC9Hut4I3l78jgXQVBSeMhatb+RMyuSshgGq3+2ph6EQQABBstvuWwl5AAkU\r\
18 oQIhAPtpCjpqiAQtqo1u64T/Pr5fX2IuzmbOhIvW8czDdKF3AiEA7yjxoEGMl+8o\r\
19 4v8pLFZqR0s4P4G/wgScuqtCPLtjtrMCICrH5QWruxl669rFVS58gKDEeearMFQu\r\
20 MD/bg6nkWKRhAiBTMuwz8vnFFUclCN069mkMmkdcGHgsN8yKR+/IDuyWbwIhAKZ9\r\
21 KgZz3UZCnWHDXaelDFJI+Xdstx5XwBdTAlqwOU+L\r\
22 -----END RSA PRIVATE KEY-----\r"
23
24 #endif /*_PERMANENTKEYRSA_H_*/

22.148 SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SERIALBURNERDATA_H_
6 #define _SERIALBURNERDATA_H_
7
8 /*
9 ******************************************************************************
10 *
11 * Include Files
12 *
13 ******************************************************************************
14 */
15 #include <snmp.h>
16 #include <netbios.h>
17 #include <config_obj.h>
18 #include <netinterface.h>
19 #include <fdprintf.h>
20 #include "nbfactory.h"
21 #include "serialburnerdata.h"
22
23 /*
24 ******************************************************************************
25 *
26 * Definitions
27 *
28 ******************************************************************************
29 */
30 /* Constants that go with Protocol and selection list ProtocolList */
31 #define PROTOCOL_UDP_TO_SERIAL "UDP"
32 #define PROTOCOL_TCP_SSL_TO_SERIAL "TCP/SSL"
33 #define PROTOCOL_TCP_TO_SERIAL "TCP"
34 #define PROTOCOL_SSH "SSH"
35
36 /* Constants that go with SerialMode and selection list SerialModeList */
37 #define SERIAL_MODE_RS232 "RS-232"
38 #define SERIAL_MODE_DEBUG "DEBUG"
39 #define SERIAL_MODE_485H "RS-485 Half Duplex"
40 #define SERIAL_MODE_485F "RS-485 Full Duplex"
41 #define SERIAL_MODE_422F "RS-422 Full Duplex"
42 #define SERIAL_MODE_485H_ECHO "RS-485 Half Duplex with Echo" // Used by PK70 quad UART blade board
- S/W configurable

NetBurner, Inc.
882 File Documentation

43 #define SERIAL_MODE_485H_NOECHO "RS-485 Half Duplex without Echo" // Used by PK70 quad UART blade board
- S/W configurable
44
45 /* Constants that go with serial FlowMode and selection list FlowModeList */
46 #define SERIAL_FLOW_MODE_NONE "None"
47 #define SERIAL_FLOW_MODE_XON_OFF "XON/XOFF"
48 #define SERIAL_FLOW_MODE_RTS_CTS "RTS/CTS"
49
50 /* Constants that go with serial ConnectMode */
51 #define SERIAL_CONNECT_CONNECT_NEVER "Never"
52 #define SERIAL_CONNECT_CONNECT_AT_POWERUP "On power-up"
53 #define SERIAL_CONNECT_CONNECT_WHEN_DATARX "If serial data received"
54
55 /* Constants that go with IP_Addr_mode */
56 /* These strings need to match the string defined in the ip4.mode config_chooser variable defined in the
InterfaceBlock */
57 #define IP_ADDR_MODE_DHCP "DHCP"
58 #define IP_ADDR_MODE_DHCP_W_FALLBACK "DHCP w Fallback"
59 #define IP_ADDR_MODE_STATIC "Static"
60 #define IP_ADDR_MODE_DISABLED "Disabled"
61
62 /* Constants that go with character strings */
63 #define CONNECT_NAME_LENGTH (79)
64 #define CONNECT_MESSAGE_LENGTH (79)
65 #define CONNECT_LOSS_MESSAGE_LENGTH (79)
66 #define DEVICE_NAME_LENGTH (15)
67 #define NTP_NAME_LENGTH (35)
68 #define USERNAME_LENGTH (39)
69 #define PASSWORD_LENGTH (39)
70 #define MAX_NUMERICAL_USER_INPUT_LENTH (32)
71 #define MAX_STRING_USER_INPUT_LENTH (64)
72
73 /* Constants that define buffer sizes */
74 #define MAX_UDP_RX_BUFFER (1500)
75 #define BUFFER_SIZE (20000)
76
77 /* Constants that define task priorities */
78 #define LED_TASK_PRIO (MAIN_PRIO - 1)
79 #define SNMP_PRIO (MAIN_PRIO - 2)
80 #define AT_COM_PRIO (MAIN_PRIO - 3)
81 #define I2C_SERVER_TASK_PRIO (MAIN_PRIO + 1)
82 #define GPIO_SERVER_TASK_PRIO (MAIN_PRIO + 2)
83 #define START_WIFI_TASK_PRIO (OS_MAX_PRIOS - 2)
84
85 #ifdef NB_FACTORY_INCLUDE_SSH
86
87 /* Constants that go with SSH character strings */
88 #define SSH_USERNAME_LENGTH (39)
89 #define SSH_PASSWORD_LENGTH (39)
90
91 #endif /* #ifdef NB_FACTORY_INCLUDE_SSH */
92
93 extern MonitorRecord monitor_config;
94
95 #ifdef NB_FACTORY_INCLUDE_SSL
96
97 /*
98 ******************************************************************************
99 * Key or certificate size
100 * SSL Certificate size 2200 (empirical)
101 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
102 * NULL terminated for conversion
103 *
104 ******************************************************************************
105 */
106 #define SERIAL_BURNER_CERTIFICATE_SIZE_MAX ((2 * 1024) - 1)
107 #define SERIAL_BURNER_CERTIFICATE_SIZE_MAX_PEM ((3 * 1024) - 1)
108
109 #endif /* #ifdef NB_FACTORY_INCLUDE_SSL */
110
111 #if defined(NB_FACTORY_INCLUDE_SSH) || defined(NB_FACTORY_INCLUDE_SSL)
112
113 /* Certificate and key status */
114 #define SERIAL_BURNER_LIBRARY_DEFAULT ((uint8_t)0x00)
115 #define SERIAL_BURNER_DEFAULT ((uint8_t)0x01)
116 #define SERIAL_BURNER_USER_INSTALLED ((uint8_t)0x02)
117
118 /*
119 ******************************************************************************
120 * Key size
121 * SSH MAX_PRIVKEY_SIZE 1700 (options.h)
122 * SSH key size (PEM) < 4K (empirical)
123 * NULL terminated for conversion
124 *
125 ******************************************************************************
126 */
127 #define SERIAL_BURNER_KEY_SIZE_MAX_PEM ((4 * 1024) - 1)

NetBurner, Inc.
22.148 SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h 883

128
129 #endif /* #if defined(NB_FACTORY_INCLUDE_SSH) || defined(NB_FACTORY_INCLUDE_SSL) */
130 /*
131 ******************************************************************************
132 * HTML support
133 ******************************************************************************
134 */
135 /* HTML data sizes */
136 #define SERIAL_BURNER_HTML_INPUT_NUMBER_SIZE (5)
137
138 /* HTML data sizes */
139 #define SERIAL_BURNER_HTML_HEX_NUMBER_LENGTH (2)
140
141 /* The following defines the webpage table width in percentage of the column that
142 * includes text description of each input field. It allows platforms with two
143 * ports or less to use more of the table width to fit text, improving readability.
144 */
145 #if ((NB_FACTORY_SERIAL_PORTS + NB_FACTORY_I2C_PORTS) <= 2)
146 #define SERIAL_BURNER_DESCRIPTION_COLUMN_WIDTH_PERCENT (40)
147 #else
148 #define SERIAL_BURNER_DESCRIPTION_COLUMN_WIDTH_PERCENT (30)
149 #endif
150
151 #define SERIAL_BURNER_PORT_COLUMN_WIDTH_PERCENT ((100 - SERIAL_BURNER_DESCRIPTION_COLUMN_WIDTH_PERCENT)
/ (NB_FACTORY_SERIAL_PORTS + NB_FACTORY_I2C_PORTS))
152
153 /* HTML I2C column width percentage */
154 #define SERIAL_BURNER_HTML_I2C_WIDTH (70)
155
156 /* HTML input name maximum size */
157 #define SERIAL_BURNER_HTML_INPUT_SIZE (39)
158
159 /* HTML IP address string size */
160 #define SERIAL_BURNER_HTML_IP_STRING_SIZE (20)
161
162 /* Password protection string (SSH_PASSWORD_LENGTH length ) */
163 #define SERIAL_BURNER_PASSWORD_STRING "*******************"
164
165 /*
166 ******************************************************************************
167 * Booting support
168 ******************************************************************************
169 */
170 #define boot_iprintf(...) \
171 { \
172 if (monitor_config.Quiet == 0) \
173 { \
174 int ifNum = GetFirstInterface(); \
175 InterfaceBlock *pIfB = GetInterfaceBlock(ifNum); \
176 if (pIfB != nullptr) \
177 { \
178 iprintf("%s : ", pIfB->device_name.c_str()); \
179 iprintf(__VA_ARGS__); \
180 iprintf("\r\n"); \
181 } \
182 } \
183 }
184
185 /*
186 ******************************************************************************
187 * Debug support
188 ******************************************************************************
189 */
190 #define debug_iprintf(...) \
191 { \
192 if (bShowDebug == true) \
193 { \
194 int ifNum = GetFirstInterface(); \
195 InterfaceBlock *pIfB = GetInterfaceBlock(ifNum); \
196 if (pIfB != nullptr) \
197 { \
198 iprintf("%s [debug] : ", pIfB->device_name.c_str()); \
199 iprintf(__VA_ARGS__); \
200 iprintf("\r\n"); \
201 } \
202 } \
203 }
204
205 /*
206 ******************************************************************************
207 *
208 * Structures
209 *
210 ******************************************************************************
211 */
212 // #ifndef SNMP
213 // #include <snmp.h>

NetBurner, Inc.
884 File Documentation

214 // struct SysInfo


215 // {
216 // char SysContact[ 256 ];
217 // char SysName[ 256 ];
218 // char SysLocation[ 256 ];
219 // unsigned char ReadCommunity[ 40 ];
220 // unsigned char WriteCommunity[ 40 ];
221 // IPADDR trap_destination;
222 // uint32_t trap_enable_flags;
223 // uint32_t valid;
224 // };
225 // #endif /* SNMP */
226
227 #ifndef SNMP
228 #include <snmp.h>
229 class SysInfo : public config_obj
230 {
231 public:
232 config_string SysContact{"", "Sys Contact"};
233 config_string SysName{"", "Sys Name"};
234 config_string SysLocation{"", "Sys Location"};
235 config_string ReadCommunity{"", "Read Community"};
236 config_string WriteCommunity{"", "Write Community"};
237 config_IPADDR4 trap_destination{"", "Trap Destination"};
238 config_uint trap_enable_flags{0, "Trap Enable Flags"};
239 config_uint valid{0, "Valid"};
240 ConfigEndMarker;
241
242 SysInfo(const char *name, const char *desc = nullptr) : config_obj(name, desc){};
243 SysInfo(config_obj &owner, const char *name, const char *desc = nullptr) : config_obj(owner, name,
desc){};
244 };
245 #endif /* SNMP */
246
247 /*
248 Port Setting (Protocol)
249
250 * Listening socket (All) *
251 ListenPort - Listen port
252 InactivityTimeoutInSecs - Inactivity timeout in seconds
253 New_connection_timeout - Connection timeout
254 ConnectMode - Serial connect mode
255
256 * Connect on power-up and received serial data choices (TCP) *
257 ConnectPort - Port
258 ConnectName - Target name for GetHostByName
259 ConnectAddress - Target IP address
260 ConnectIdleTimeout - Idle timeout in seconds
261 Connection_retry_timeout- Retry interval in seconds
262 keepAliveInterval - Check and maintain the connection in second intervals
263
264 * Primary connection settings - serial port settings (All) *
265 SerialMode - Type port
266 DataBaudRate - Baud rate
267 Output_Bits - Data bits per byte
268 Output_Parity - Parity
269 Output_Stop - Stop bits
270 FlowMode - Flow control
271
272 * Primary connection settings - serial data notification settings (TCP, UDP) *
273 ConnectMessage - Serial message upon connection
274 ConnectLossMessage - Serial message upon connection loss
275 BreakOnConnect - Send serial break on connection
276 BreakInterval - Break interval
277 BreakKeyFlag - Send data then a break
278 BreakKeyValue - Data prior to break
279
280 * UDP *
281 UdpAccumulatedChars - Char. to accumulate before sending packet
282 UdpWait - Accumulation wait in ticks
283 UdpTriggerChar - Flushing character
284 bLearnUdp - Learn IP address from connection
285 bUdpCheckFramingChar - UDP framing character to check
286
287 * Custom Framing (TCP, SSH) *
288 bTcpCustomFrame - Enabled?
289 TcpAccumulatedChars - Char. to accumulate before sending packet
290 TcpWait - Accumulation wait in ticks
291 TcpTriggerChar - Serial flushing character
292
293 * Framing (TCP) *
294 bTcpCheckFramingChar - TCP framing character to check
295
296 */
297 class NV_OnePortSetting : public config_obj
298 {
299 public:

NetBurner, Inc.
22.148 SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h 885

300 config_uint ListenPort{NB_FACTORY_LISTEN_PORT_DEFAULT, "Listen Port"};


301 config_uint InactivityTimeoutInSecs{NB_FACTORY_INACTIVITY_TIMEOUT_DEFAULT, "Inactivity
Timeout(seconds)"};
302 config_uint New_connection_timeout{NB_FACTORY_NEW_CONNECTION_TIMEOUT_DEFAULT, "New Connection
Timeout(seconds)"};
303 config_chooser ConnectMode{"Connect Mode", "Never", "Never,On power-up,If serial data received"};
304 config_uint ConnectPort{NB_FACTORY_CONNECT_PORT_DEFAULT, "Connect Port"};
305 config_string ConnectName1{"", "Connect Name 1"};
306 config_string ConnectName2{"", "Connect Name 2"};
307 config_IPADDR4 ConnectAddress1{"0.0.0.0", "Connect Address 1"};
308 config_IPADDR4 ConnectAddress2{"0.0.0.0", "Connect Address 2"};
309 config_uint ConnectIdleTimeout{NB_CONNECT_IDLE_TIMEOUT_DEFAULT, "Connect Idle Timeout(seconds)"};
310 config_uint Connection_retry_timeout{NB_CONNECT_RETRY_TIMEOUT_DEFAULT, "Connection Retry
Timeout(seconds)"};
311 config_uint keepAliveInterval{NB_CONENCT_KEEP_ALIVE_INTERVAL_DEFAULT, "Keep Alive
Interval(seconds)"};
312 // Port-TODO: Hook in system serial port configurations so that any change made in the Factory App
also change the system’s serial port
313 // config variable.
314 config_chooser SerialMode{"Serial Mode", NB_FACTORY_DEFAULT_SERIAL_MODE,
NB_FACTORY_SERIAL_CAPABILITY_RS232};
315 config_chooser DataBaudRate{
316 "Data Baud Rate", NB_FACTORY_SERIAL_DATA_RATE_DEFAULT,
317
"921600,500000,460800,345600,256000,230400,128000,115200,57600,38400,32000,19200,9600,4800,2400,1200,Custom"};
318 config_uint CustomBaudRate{NB_FACTORY_SERIAL_CUSTOM_DATA_RATE_DEFAULT, "Custom Baudrate"};
319 config_chooser Output_Bits{"Output Bits", NB_FACTORY_SERIAL_DATA_BITS_DEFAULT, "8,7,6,5"};
320 config_chooser Output_Parity{"Output Parity", NB_FACTORY_SERIAL_PARITY_DEFAULT, "None,Odd,Even"};
321 config_chooser Output_Stop{"Output Stop", NB_FACTORY_SERIAL_STOP_BITS_DEFAULT, "1,2"};
322 config_chooser FlowMode{"Flow Control Mode", NB_FACTORY_SERIAL_FLOW_CONTROL_DEFAULT,
"None,XON/XOFF,RTS/CTS"};
323 config_bool bDoAtCommand{NB_FACTORY_DO_AT_COMMANDS_DEFAULT, "Do AT Commands"};
324 config_string ConnectMessage{"", "Connect Message"};
325 config_bool bUseConnectMessage{NB_FACTORY_USE_CONNECT_MSG_DEFAULT, "Use the Configured Connect
Message"};
326 config_string ConnectLossMessage{"", "Lost Connection Message"};
327 config_bool bUseConnectLossMessage{NB_FACTORY_USE_CONNECTION_LOST_MSG_DEFAULT, "Use the Configured
Lost Connection Message"};
328 config_bool BreakOnConnect{NB_FACTORY_BREAK_ON_CONNECT_DEFAULT, "Break On Connect"};
329 config_uint BreakInterval{NB_FACTORY_BREAK_INTERVAL_DEFAULT, "Break Interval"};
330 config_bool BreakKeyFlag{NB_FACTORY_BREAK_KEY_FLAG_DEFAULT, "Break Key Flag"};
331 config_string BreakKeyValue{NB_FACTORY_BREAK_KEY_VALUE_DEFAULT, "Break Key Value"};
332 config_uint UdpAccumulatedChars{NB_FACTORY_ACCUMULATED_CHARS_UDP_DEFAULT, "UDP Accumulated Chars"};
333 config_uint UdpWait{NB_FACTORY_WAIT_UDP_IN_TICKS_DEFAULT, "UDP Wait(ticks)"};
334 config_uint TcpAccumulatedChars{NB_FACTORY_ACCUMULATED_CHARS_TCP_DEFAULT, "TCP Accumulated Chars"};
335 config_uint TcpWait{NB_FACTORY_WAIT_TCP_IN_TICKS_DEFAULT, "TCP Wait(ticks)"};
336 config_string UdpTriggerChar{NB_FACTORY_TRIGGER_CHAR_UDP_DEFAULT,
337 "UDP Trigger Character"};
338 config_string TcpTriggerChar{NB_FACTORY_TRIGGER_CHAR_TCP_DEFAULT,
339 "TCP Trigger Character"}; // Port-TODO: need to test char to
config_uint comparison when parsing
340 config_bool bListenForTCPConnections{NB_FACTORY_LISTEN_FOR_TCP_CONNECT_DEFAULT, "Listen for incoming
network connections"};
341 config_bool bTcpCustomFrame{NB_FACTORY_CUSTOM_FRAME_TCP_DEFAULT, "TCP Custom Frame"};
342 config_bool bLearnUdp{NB_FACTORY_LEARN_UDP_DEFAULT, "Learn UDP"};
343 config_bool bUdpCheckFramingChar{NB_FACTORY_CHECK_FRAMING_CHAR_UDP_DEFAULT, "Check UDP Framing
Character"};
344 config_bool bTcpCheckFramingChar{NB_FACTORY_CHECK_FRAMING_CHAR_TCP_DEFAULT, "Check TCP Framing
Character"};
345 config_bool bAlwaysStoreSerialChars{false, "Always Store Serial Characters"};
346 #ifdef SB800EX
347 config_bool bDTRReflectsConnection{false, "DTR Reflects Connection"}; // Port-TODO: requires logic
based on port number to initialize. See setDefaultsForUDP()
348 #endif /* SB800EX */
349 config_bool bTCPasSSL{false, "Allow SSL on TCP Socket"};
350 ConfigEndMarker;
351
352 NV_OnePortSetting(const char *name,
353 const char *desc = nullptr,
354 const char *serialMode = nullptr,
355 const char *serialModeChoices = nullptr)
356 : config_obj(name, desc)
357 {
358 if (serialModeChoices != nullptr) { SerialMode.SetChoices(serialModeChoices); }
359 if (serialMode != nullptr)
360 {
361 SerialMode = serialMode;
362
363 if (strncmp(serialMode, SERIAL_MODE_DEBUG, sizeof(SERIAL_MODE_DEBUG)) == 0)
364 {
365 // Disable AT command parser on a debug serial port
366 bDoAtCommand = false;
367 }
368 }
369 };
370
371 NV_OnePortSetting(config_obj &owner,

NetBurner, Inc.
886 File Documentation

372 const char *name,


373 const char *desc = nullptr,
374 const char *serialMode = nullptr,
375 const char *serialModeChoices = nullptr)
376 : config_obj(owner, name, desc)
377 {
378 if (serialModeChoices != nullptr) { SerialMode.SetChoices(serialModeChoices); }
379 if (serialMode != nullptr)
380 {
381 SerialMode = serialMode;
382
383 if (strncmp(serialMode, SERIAL_MODE_DEBUG, sizeof(SERIAL_MODE_DEBUG)) == 0)
384 {
385 // Disable AT command parser on a debug serial port
386 bDoAtCommand = false;
387 }
388 }
389 };
390 };
391
392 /* ic - The byte value written to the I2FDR register of the processor
393 * to reach a desired frequency divider. Used with InitI2C() to
394 * initialize the bus to a particular I2C bus speed
395 * FreqDivider - The frequency divider that corresponds to the byte value in ic.
396 * For a table of ic-frequency divider pairs, refer to the reference manual for the
397 * processor - specifically, refer to the I2FDR section of the
398 * I2C chapter.
399 */
400 class NV_OneI2CPortSetting : public config_obj
401 {
402 public:
403 // I2C parameters
404 config_uint ic{NB_FACTORY_I2C_IC_DEFAULT, "ic"};
405 config_uint FreqDivider{NB_FACTORY_I2C_FREQ_DIVIDER_DEFAULT, "Frequency Divider"};
406 config_uint CustomBaudRate{0, "Custom Baud Rate"};
407 config_uint BusSpeed{100000, "I2C Bus Speed"};
408 config_uint SetMasterAddress{NB_FACTORY_I2C_ADDRESS_DEFAULT, "Set Master Address"};
409 config_uint SaveMasterAddress{NB_FACTORY_I2C_ADDRESS_DEFAULT, "Save Master Address"};
410
411 // TCP parameters
412 config_uint ListenPort{NB_FACTORY_I2C_LISTEN_PORT_DEFAULT, "Listen Port"};
413 config_bool bListenCheck{NB_FACTORY_LISTEN_FOR_TCP_CONNECT_DEFAULT, "Listen for incoming network
connections"};
414 config_uint InactivityTimeoutInSecs{NB_FACTORY_INACTIVITY_TIMEOUT_DEFAULT, "Inactivity
Timeout(seconds)"};
415 config_uint New_connection_timeout{NB_FACTORY_NEW_CONNECTION_TIMEOUT_DEFAULT, "New Connection
Timeout(seconds)"};
416 config_uint ConnectIdleTimeout{NB_CONNECT_IDLE_TIMEOUT_DEFAULT, "Connect Idle Timeout(seconds)"};
417 config_bool bTCPasSSL{false, "Allow TCP as SSL"};
418 ConfigEndMarker;
419
420 NV_OneI2CPortSetting(const char *name, const char *desc = nullptr) : config_obj(name, desc){};
421 NV_OneI2CPortSetting(config_obj &owner, const char *name, const char *desc = nullptr) :
config_obj(owner, name, desc){};
422 };
423
424 /* Refer to the I2FDR section of the reference manual for the processor in use
425 * for a table of dividers and the respective ICs’s */
426 struct BaudRate
427 {
428 unsigned char ic;
429 int divider;
430 };
431
432
433 class NV_SettingsStruct : public config_obj
434 {
435 public:
436 /* NetBurner protocol */
437 config_chooser Protocol{"Protocol", "TCP/SSL", "UDP,TCP/SSL,SSH,TCP"};
438 config_chooser ConnectMode{"Connect Mode", "Never", "Never,On power-up,If serial data received"};
439
440 /* NetBurner address configuration */
441 config_string NetBIOSName{"", "NetBIOS Name"};
442 config_string NTPName{NB_FACTORY_NTPSERVERNAME_DEFAULT, "NTP Name"}; // NTPName[ NTP_NAME_LENGTH+
1 ];
443 config_IPADDR4 NTP_Addr{"0.0.0.0", "NTP IPv4 Address"};
444
445 NV_OnePortSetting port0{"Serial Port 0", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_0_MODE_CAPABILITY};
446 NV_OnePortSetting port1{"Serial Port 1", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_1_MODE_CAPABILITY};
447 #if (defined NANO54415)
448 NV_OnePortSetting port2{"Serial Port 2", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_2_MODE_CAPABILITY};
449 NV_OnePortSetting port3{"Serial Port 3", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_3_MODE_CAPABILITY};

NetBurner, Inc.
22.148 SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h 887

450 NV_OnePortSetting port4{"Serial Port 4", nullptr, SERIAL_MODE_RS232,


NB_FACTORY_SERIAL_PORT_4_MODE_CAPABILITY};
451 #elif (defined MODM7AE70 && defined USE_E70_UART_SERIAL_PORTS)
452 NV_OnePortSetting port2{"Serial Port 2", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_2_MODE_CAPABILITY};
453 NV_OnePortSetting port3{"Serial Port 3", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_3_MODE_CAPABILITY};
454 NV_OnePortSetting port4{"Serial Port 4", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_4_MODE_CAPABILITY};
455 NV_OnePortSetting port5{"Serial Port 5", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_5_MODE_CAPABILITY};
456 NV_OnePortSetting port6{"Serial Port 6", nullptr, SERIAL_MODE_RS232,
NB_FACTORY_SERIAL_PORT_6_MODE_CAPABILITY};
457 #endif
458
459 #ifdef SUPPORTED_GPIO_SERVER_PLATFORM
460 config_bool bEnableGpioProcess{NB_FACTORY_DO_GPIO_COMMANDS_DEFAULT, "bEnableGpioProcess"};
461 config_bool bEnableHighDrive{NB_FACTORY_ENABLE_GPIO_HI_DRIVE_DEFAULT, "bEnableHighDrive"};
462 config_uint GpioProcessPort{NB_FACTORY_GPIO_PORT_DEFAULT, "GpioProcessPort"};
463 config_uint GpioInactivityTimeoutInSecs{NB_CONNECT_IDLE_TIMEOUT_DEFAULT, "Inactivity timeout in
seconds"};
464 config_uint GpioMaxConnections{NB_MAX_TCP_CONNECTIONS, "Max simultaneous connections"};
465 config_bool bSaveGpioToFlash{
466 NB_FACTORY_GPIO_SAVE_TO_FLASH_DEFAULT,
467 "Save every change to a pin’s setting/state to flash. This will use more flash write cycles if a
pin is modified often."};
468 #endif
469
470 SysInfo SysInfoData{"SNMP_SysInfo"};
471
472 /* I2C address */
473 config_string slaveI2CAddress{"", "I2C Slave Address"}; // char slaveI2CAddress[3];
474
475 #if (defined SUPPORTED_I2C_PLATFORM)
476 NV_OneI2CPortSetting i2c_port{"I2C Configuration"};
477 #endif
478
479 #ifdef NB_FACTORY_INCLUDE_SSL
480
481 /* SSL certificate and keys file lengths */
482 config_uint SslCertificateSource{SERIAL_BURNER_LIBRARY_DEFAULT, "SSL Certificate Source"};
483 config_uint SslCertificateLength{0, "SSL Certificate Length"};
484 config_uint SslKeyLength{0, "SSL Key Length"};
485
486 #endif /* #ifdef NB_FACTORY_INCLUDE_SSL */
487
488 #ifdef NB_FACTORY_INCLUDE_SSH
489
490 /* SSH user name and password */
491 config_pass SshUserName{"", "SSH User Name"};
492 config_pass SshPassword{"", "SSH Password"};
493
494 /* SSH key source and lengths (default and user installed) */
495 config_uint SshKeyRsaSource{SERIAL_BURNER_LIBRARY_DEFAULT, "SSH Key RSA Source"};
496 config_uint SshKeyRsaLength{0, "SSH Key RSA Length"};
497 config_uint SshKeyEcdsaSource{SERIAL_BURNER_LIBRARY_DEFAULT, "SSH Key ECDSA Source"};
498 config_uint SshKeyEcdsaLength{0, "SSH Key ECDSA Length"};
499
500 #endif /* #ifdef NB_FACTORY_INCLUDE_SSH */
501
502 config_bool bAllowAtToAccessAPassword{true, "Allow AT to Access A Password"};
503 config_bool bAllowAtToAccessSPassword{true, "Allow AT to Access S Password"};
504
505 /* Version verification key */
506 config_uint VerifyKey{NB_FACTORY_VERIFY_KEY, "App Version Verification Key"};
507
508 /* Flash File System Version verification key */
509 config_uint STDEFFSVerifyKey{STD_EFFS_VERIFY_KEY, "File System Version Verification Key"};
510
511 config_bool bFirstRun{true, "First time loading the SS2E Factory app on this device"};
512 ConfigEndMarker;
513
514 NV_OnePortSetting *ports[NB_FACTORY_SERIAL_PORTS];
515
516 NV_SettingsStruct(const char *name, const char *desc = nullptr, uint32_t configFlag = 0) :
config_obj(name, desc)
517 {
518 if (configFlag > 0) { SetFlag(configFlag); }
519 // SetFlag(fConfigHidden); // hide from the config server
520
521 ports[0] = &port0;
522 ports[1] = &port1;
523
524 #if (defined NANO54415)
525 ports[2] = &port2;
526 ports[3] = &port3;
527 ports[4] = &port4;

NetBurner, Inc.
888 File Documentation

528 #elif (defined MODM7AE70 && defined USE_E70_UART_SERIAL_PORTS)


529 ports[2] = &port2;
530 ports[3] = &port3;
531 ports[4] = &port4;
532 ports[5] = &port5;
533 ports[6] = &port6;
534 #endif
535
536 #ifdef SB800EX
537 // SB800EX serial ports are numbered 1 and 2, not 0 and 1
538 ports[(int)(monitor_config.Uart) - 1]->SerialMode = SERIAL_MODE_DEBUG;
539 #else
540 ports[(int)(monitor_config.Uart)]->SerialMode = SERIAL_MODE_DEBUG;
541 #endif
542
543 for (uint8_t i = 1; i < NB_FACTORY_SERIAL_PORTS; i++)
544 {
545 // intentionally skip port 0 since it’s initialized with a default value
546 ports[i]->ListenPort = ports[i]->ListenPort + i;
547 ports[i]->ConnectPort = ports[i]->ConnectPort + i;
548 }
549 };
550
551 NV_SettingsStruct(config_obj &owner, const char *name, const char *desc = nullptr, uint32_t
configFlag = 0)
552 : config_obj(owner, name, desc)
553 {
554 if (configFlag > 0) { SetFlag(configFlag); }
555 // SetFlag(fConfigHidden);
556
557 ports[0] = &port0;
558 ports[1] = &port1;
559
560 #if (defined NANO54415)
561 ports[2] = &port2;
562 ports[3] = &port3;
563 ports[4] = &port4;
564 #elif (defined MODM7AE70 && defined USE_E70_UART_SERIAL_PORTS)
565 ports[2] = &port2;
566 ports[3] = &port3;
567 ports[4] = &port4;
568 ports[5] = &port5;
569 ports[6] = &port6;
570 #endif
571
572 #ifdef SB800EX
573 // SB800EX serial ports are numbered 1 and 2, not 0 and 1
574 ports[(int)(monitor_config.Uart) - 1]->SerialMode = SERIAL_MODE_DEBUG;
575 #else
576 ports[(int)(monitor_config.Uart)]->SerialMode = SERIAL_MODE_DEBUG;
577 #endif
578
579 for (uint8_t i = 1; i < NB_FACTORY_SERIAL_PORTS; i++)
580 {
581 // intentionally skip port 0 since it’s initialized with a default value
582 ports[i]->ListenPort = ports[i]->ListenPort + i;
583 ports[i]->ConnectPort = ports[i]->ConnectPort + i;
584 }
585 };
586 };
587
588 #ifdef SUPPORTED_GPIO_SERVER_PLATFORM
589 #include <cpu_pins.h>
590 #include <pins.h>
591 #include <htmlfiles.h>
592 class NV_PinIOConfig : public config_obj
593 {
594 public:
595 config_chooser cc_pinFunction{"Function", "Not Configured", "Not Configured,GPIO Input,GPIO Output
0,GPIO Output 1"};
596 config_string cs_currentState{"Not Configured", "Current State"};
597
598 ConfigEndMarker;
599
600 typedef enum
601 {
602 PIN_FN_NO_CONFIG = 0,
603 PIN_FN_IN,
604 PIN_FN_OUT_0,
605 PIN_FN_OUT_1,
606 PIN_FN_A,
607 PIN_FN_B,
608 PIN_FN_C,
609 PIN_FN_D
610 } pin_fn_t;
611
612 uint8_t m_headerNum;

NetBurner, Inc.
22.148 SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h 889

613 uint8_t m_pinNum;


614 uint32_t m_configFlags;
615 PinIO m_pinIO;
616
617 NV_PinIOConfig(const char *name,
618 PinIO pin,
619 const char *desc = nullptr,
620 uint8_t headerNumber = 0,
621 uint8_t pinNumber = 0,
622 const char *pinFuncSelection = nullptr,
623 const char *pinFunctionChoices = nullptr,
624 uint32_t configFlag = 0)
625 : m_pinIO(pin), config_obj(name, desc)
626 {
627 if (configFlag) { SetFlag(configFlag); }
628 if (pinFunctionChoices != nullptr) { cc_pinFunction.SetChoices(pinFunctionChoices); }
629 if (pinFuncSelection != nullptr) { cc_pinFunction = pinFuncSelection; }
630
631 m_headerNum = headerNumber;
632 m_pinNum = pinNumber;
633 m_configFlags = configFlag;
634
635 if (m_pinIO.mask == 0) // pin is not modifiable. Ex: GND, VCC, or not a valid header pin
636 {
637 SetFlag(fConfigReadOnly);
638 cc_pinFunction.SetChoices("Fixed");
639 cc_pinFunction = "Fixed";
640 }
641 }
642
643 NV_PinIOConfig(config_obj &owner,
644 const char *name,
645 PinIO pin,
646 const char *desc = nullptr,
647 uint8_t headerNumber = 0,
648 uint8_t pinNumber = 0,
649 const char *pinFuncSelection = nullptr,
650 const char *pinFunctionChoices = nullptr,
651 uint32_t configFlag = 0)
652 : m_pinIO(pin), config_obj(owner, name, desc)
653 {
654 if (configFlag > 0) { SetFlag(configFlag); }
655 if (pinFunctionChoices != nullptr) { cc_pinFunction.SetChoices(pinFunctionChoices); }
656 if (pinFuncSelection != nullptr) { cc_pinFunction = pinFuncSelection; }
657
658 m_headerNum = headerNumber;
659 m_pinNum = pinNumber;
660 m_configFlags = configFlag;
661
662 if (m_pinIO.mask == 0) // pin is not modifiable. Ex: GND, VCC, or not a valid header pin
663 {
664 SetFlag(fConfigReadOnly);
665 cc_pinFunction.SetChoices("Fixed");
666 cc_pinFunction = "Fixed";
667 }
668 }
669
670 /* It is assumed that a valid NV_PinIOConfig will have a name. An invalid
671 * NV_PinIOConfig, like an end marker, will have a nullptr name value */
672 inline bool valid() { return pName != nullptr; }
673
674 bool ConfigureFromPinIOFunction()
675 {
676 int8_t pin_fn = m_pinIO.getFn();
677 if (pin_fn < 0) { return false; }
678
679 // check if the pin has already been configured for a function other than GPIO
680 // if the PinIO is not configured for a peripheral function, allow it to be configured
681
682 // if the PinIO is already configured for a peripheral function, what should we do?
683 // option 1: don’t allow it to be configured via the gpio webpage
684 // option 2: display which peripheral function (A,B,C,D) and allow it to be reconfigured for
GPIO
685 }
686
687 void DisplayPinFunctionToWeb(int sock)
688 {
689 fdprintf(sock, "\r\n\t\t<td><font size=\"2\">");
690 WriteHtmlVariable(sock, ConfigRenderFunc(2, cc_pinFunction));
691 fdprintf(sock, "\r\n\t\t</font></td>\r\n");
692 }
693
694 void DisplayPinDriveToWeb(int sock)
695 {
696 if (!valid() || m_pinIO.mask == 0)
697 {
698 // The pin has not been initialized

NetBurner, Inc.
890 File Documentation

699 cs_currentState = "N/A";


700 }
701 else
702 {
703 if (cc_pinFunction.IsSelected("GPIO Input")) // if the pis an input, read and display the
input
704 {
705 if (m_pinIO.readBack()) { cs_currentState = "GPIO Input = 1"; }
706 else
707 {
708 cs_currentState = "GPIO Input = 0";
709 }
710 }
711 else if (cc_pinFunction.IsSelected("GPIO Output 0")) // if the pin is an output, display
the configured output
712 {
713 cs_currentState = "GPIO Output = 0";
714 }
715 else if (cc_pinFunction.IsSelected("GPIO Output 1"))
716 {
717 cs_currentState = "GPIO Output = 1";
718 }
719 else if (cc_pinFunction.IsSelected("Pin State"))
720 {
721 cs_currentState = "Not Configured";
722 }
723 else
724 {
725 cs_currentState = "Not Configured";
726 }
727 }
728
729 fdprintf(sock, "\r\n\t\t<td><font size=\"2\">");
730 WriteHtmlVariable(sock, ConfigRenderFunc(1, cs_currentState));
731 fdprintf(sock, "\r\n\t\t</font></td>\r\n");
732 }
733
734 void DisplayFunction(int sock)
735 {
736 static char rowLine[sizeof("\r\n\t\t<td><font size=\"2\">")];
737 writestring(sock, rowLine);
738 WriteHtmlVariable(sock, ConfigRenderFunc(2, cc_pinFunction));
739 writestring(sock, "</td>");
740 }
741
742 // void DisplayCurrentState(int sock)
743 // {
744 // if( !valid() )
745 // {
746 // // The pin has not been initialized
747 // cs_currentState = "Not Configured";
748 // }
749 // else
750 // {
751 // if( m_pinIO.readBack() ) { cs_currentState = "1"; }
752 // else { cs_currentState = "0"; }
753 // }
754
755 // static char rowLine[ sizeof( "\r\n\t\t<td><font size=\"2\">") ];
756 // writestring( sock, rowLine );
757 // WriteHtmlVariable(sock,ConfigRenderFunc(1, cs_currentState));
758 // writestring( sock, "</td>" );
759 // }
760
761 uint8_t GetPinFunctionIndex()
762 {
763 NBString pinFuncs(cc_pinFunction.GetChoices());
764
765 // find the position of the cc_pinFunction value within the choices to find the index
766 size_t position = pinFuncs.find(((NBString)cc_pinFunction).c_str());
767
768 uint8_t commaCount = 0;
769 for (size_t start = position; start > 0; start--)
770 {
771 if (pinFuncs[start] == ’,’) { commaCount++; }
772 }
773
774 return commaCount;
775 }
776
777 // returns < 0 if failed or the NV_PinIOConfig::pin_fn_t configuration that the pin was initialized
to.
778 uint8_t InitPinFunction()
779 {
780 if (!valid() || m_pinIO.mask == 0) { return -1; }
781 // Don’t initialize pins that are marked as Read Only
782 if (GetFlags() & fConfigReadOnly) { return -2; }

NetBurner, Inc.
22.148 SSH/SecureSerToEthFactoryApp/src/serialburnerdata.h 891

783
784 uint8_t cc_pinFunctionVal = GetPinFunctionIndex();
785
786 switch (cc_pinFunctionVal)
787 {
788 case NV_PinIOConfig::PIN_FN_NO_CONFIG: m_pinIO.function(PinIO::PIN_FN_IN); return
NV_PinIOConfig::PIN_FN_IN;
789
790 case NV_PinIOConfig::PIN_FN_IN: m_pinIO.function(PinIO::PIN_FN_IN); return
NV_PinIOConfig::PIN_FN_IN;
791
792 case NV_PinIOConfig::NV_PinIOConfig::PIN_FN_OUT_0:
793 m_pinIO.function(PinIO::PIN_FN_OUT);
794 m_pinIO.clr();
795 return NV_PinIOConfig::NV_PinIOConfig::PIN_FN_OUT_0;
796
797 case NV_PinIOConfig::PIN_FN_OUT_1:
798 m_pinIO.function(PinIO::PIN_FN_OUT);
799 m_pinIO.set();
800 return NV_PinIOConfig::PIN_FN_OUT_1;
801
802 case NV_PinIOConfig::PIN_FN_A: m_pinIO.function(PinIO::PIN_FN_A); return
NV_PinIOConfig::PIN_FN_A;
803
804 case NV_PinIOConfig::PIN_FN_B: m_pinIO.function(PinIO::PIN_FN_B); return
NV_PinIOConfig::PIN_FN_B;
805
806 case NV_PinIOConfig::PIN_FN_C: m_pinIO.function(PinIO::PIN_FN_C); return
NV_PinIOConfig::PIN_FN_C;
807
808 case NV_PinIOConfig::PIN_FN_D: m_pinIO.function(PinIO::PIN_FN_D); return
NV_PinIOConfig::PIN_FN_D;
809
810 default: return -3;
811 }
812 }
813 };
814
815 #ifdef SBE70LC
816 #define PIN_HEADER_SIZE 20 // J1 Header
817 #else
818 #define PIN_HEADER_SIZE 50
819 #endif
820
821 extern NV_PinIOConfig pinHeaderArray[];
822 bool InitPinArrayFunctions();
823 bool SetGpioConfigToReadOnly(bool bSetToReadOnly);
824 bool SetGpioHighCurrentDrive(bool bEnableHighDrive);
825 #endif // end SUPPORTED_GPIO_SERVER_PLATFORM
826
827 /*
828 ******************************************************************************
829 *
830 * Global Data Declarations
831 *
832 ******************************************************************************
833 */
834 /* DHCP object */
835 // extern DhcpObject* gDHCPObjPtr;
836
837 /* Settings changed flag */
838 extern volatile bool Settings_Changed;
839 extern volatile int old_config_ver;
840
841 /* User parameters */
842 extern NV_SettingsStruct NV_Settings;
843
844 /* User parameters change candidate */
845 extern NV_SettingsStruct gNV_SettingsChangeCopy;
846
847 /* User parameters change flag */
848 extern volatile bool gChangedUserParameters;
849
850 /* Debugging flag */
851 extern bool bShowDebug;
852
853 /*
854 * Selection lists for the web page configuration
855 */
856 extern const char *IPModeList[];
857 extern const char *IPValueList[];
858 extern const char *IPOnClickList[];
859 extern const char *BaudList[];
860 extern const char *BitList[];
861 extern const char *ParityList[];
862 extern const char *StopList[];
863 extern const char *FlowModeList[];

NetBurner, Inc.
892 File Documentation

864 extern const char *SerialModeListFull[];


865 extern const char *SerialModeListRS232[];
866 extern const char *SerialModeListRS485[];
867 extern const char *SerialModeListHybrid[];
868 extern const char *SerialModeListQuad485[];
869 extern const char *SerialModeListQuadMMS[];
870 extern const char *ConnectMode[];
871 extern const char *ProtocolList[];
872 /*
873 ******************************************************************************
874 *
875 * Routines
876 *
877 ******************************************************************************
878 */
879 /* Save data to file */
880 extern bool UserSaveData(char *dataPtr, int dataSize, const char *fileName);
881
882 /* Get saved data */
883 extern bool UserGetData(char *dataPtr, char *fileName, int dataSize);
884
885 extern void RegisterPost(void);
886
887 extern void CheckNVSettings(bool returnToFactory = FALSE);
888
889 extern void SetAndSaveDefaults(void);
890
891 /* For processing hexadecimal break key value */
892 extern uint8_t GetHexByte(const char *cp);
893
894 #endif /* _SERIALBURNERDATA_H_ */

22.149 SSL/HttpsUploadCert/src/serialburnerdata.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SERIALBURNERDATA_H_
6 #define _SERIALBURNERDATA_H_
7
8 #include <config_obj.h>
9 extern MonitorRecord monitor_config;
10
11 #define DEVICE_NAME_LENGTH (15)
12
13 /*
14 ******************************************************************************
15 * Key or certificate size
16 * SSL Certificate size 2200 (empirical)
17 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
18 * NULL terminated for conversion
19 *
20 ******************************************************************************
21 */
22 #define SERIAL_BURNER_CERTIFICATE_SIZE_MAX ((2 * 1024) - 1)
23 #define SERIAL_BURNER_CERTIFICATE_SIZE_MAX_PEM ((3 * 1024) - 1)
24
25 /* Certificate and key status */
26 #define SERIAL_BURNER_LIBRARY_DEFAULT ((uint8_t)0x00)
27 #define SERIAL_BURNER_DEFAULT ((uint8_t)0x01)
28 #define SERIAL_BURNER_USER_INSTALLED ((uint8_t)0x02)
29
30 /*
31 ******************************************************************************
32 * Key size
33 * SSL key size (PEM) < 4K (empirical)
34 * NULL terminated for conversion
35 *
36 ******************************************************************************
37 */
38 #define SERIAL_BURNER_KEY_SIZE_MAX_PEM ((4 * 1024) - 1)
39
40 /*
41 ******************************************************************************
42 * Booting support
43 ******************************************************************************
44 */
45 #define boot_iprintf(...) \
46 { \
47 if (monitor_config.Quiet == 0) \
48 { \
49 iprintf("%s : ", NV_Settings.DeviceName); \
50 iprintf(__VA_ARGS__); \
51 iprintf("\r\n"); \

NetBurner, Inc.
22.149 SSL/HttpsUploadCert/src/serialburnerdata.h 893

52 } \
53 }
54
55 /*
56 ******************************************************************************
57 * Debug support
58 ******************************************************************************
59 */
60 #define debug_iprintf(...) \
61 { \
62 if (bShowDebug == TRUE) \
63 { \
64 iprintf("%s : ", NV_Settings.DeviceName); \
65 iprintf(__VA_ARGS__); \
66 iprintf("\r\n"); \
67 } \
68 }
69
70 /*
71 ******************************************************************************
72 *
73 * Structures
74 *
75 ******************************************************************************
76 */
77
78 /*
79 Configuration Settings
80
81 DeviceName - Device name for DHCP
82 NetBIOSName - NetBIOS name
83
84 * SSL *
85 CertificateRsaLength - Certificate length
86 CertificateData - Certificate
87 KeyHttpsRsaLength - RSA key for HTTPS length, 0 is none
88 KeyHttpsRsaData - RSA key for HTTPS
89 KeyRsaLength - RSA key length, 0 is none
90 KeyRsaData - RSA key
91 KeyDsaLength - DSA key length, 0 is none
92 KeyDsaData - DSA key
93
94 * Version change key *
95 VerifyKey - Version change key
96
97 */
98 struct NV_SettingsStruct
99 {
100 /* NetBurner address configuration */
101 char DeviceName[(DEVICE_NAME_LENGTH + 1)];
102 char NetBIOSName[(NETBIOS_NAME_SIZE_IN_CHARS + 1)];
103
104 /* SSL certificate and keys file lengths */
105 uint8_t SslCertificateSource;
106 uint16_t SslCertificateLength;
107 uint16_t SslKeyLength;
108
109 /* Version verification key */
110 uint32_t VerifyKey;
111 /* Flash File System Version verification key */
112 uint32_t STDEFFSVerifyKey;
113 };
114
115 /*
116 ******************************************************************************
117 *
118 * Global Data Declarations
119 *
120 ******************************************************************************
121 */
122
123 /* User parameters */
124 extern NV_SettingsStruct NV_Settings;
125
126 /* User parameters change candidate */
127 extern NV_SettingsStruct gNV_SettingsChangeCopy;
128
129 /* User parameters change flag */
130 extern volatile BOOL gChangedUserParameters;
131
132 /* Debugging flag */
133 extern BOOL bShowDebug;
134
135 /*
136 ******************************************************************************
137 *
138 * Routines

NetBurner, Inc.
894 File Documentation

139 *
140 ******************************************************************************
141 */
142
143 extern void RegisterPost(void);
144
145 /* Save data to file */
146 extern BOOL UserSaveData(char *dataPtr, int dataSize, const char *fileName);
147
148 /* Get saved data */
149 extern BOOL UserGetData(char *dataPtr, char *fileName, int dataSize);
150
151 extern void CheckNVSettings(BOOL returnToFactory = FALSE);
152
153 extern void SetAndSaveDefaults(void);
154
155 /* For processing hexadecimal break key value */
156 extern char GetHexByte(const char *cp);
157
158 #endif /* _SERIALBURNERDATA_H_ */

22.150 SSL/SslClientVerifyPeerEffs/src/serialburnerdata.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SERIALBURNERDATA_H_
6 #define _SERIALBURNERDATA_H_
7
8 #include <config_obj.h>
9 #include <netbios.h>
10
11 extern MonitorRecord monitor_config;
12
13 #define DEVICE_NAME_LENGTH (15)
14
21 #define SERIAL_BURNER_CERTIFICATE_SIZE_MAX ((5 * 1024) - 1)
22 #define SERIAL_BURNER_CERTIFICATE_SIZE_MAX_PEM ((5 * 1024) - 1)
23
24 /* Certificate and key status */
25 #define SERIAL_BURNER_LIBRARY_DEFAULT ((uint8_t)0x00)
26 #define SERIAL_BURNER_DEFAULT ((uint8_t)0x01)
27 #define SERIAL_BURNER_USER_INSTALLED ((uint8_t)0x02)
28
35 #define SERIAL_BURNER_KEY_SIZE_MAX_PEM ((4 * 1024) - 1)
36
40 #define boot_iprintf(...) \
41 { \
42 if (monitor_config.Quiet == 0) \
43 { \
44 iprintf("%s : ", NV_Settings.DeviceName); \
45 iprintf(__VA_ARGS__); \
46 iprintf("\r\n"); \
47 } \
48 }
49
53 #define debug_iprintf(...) \
54 { \
55 if (bShowDebug == true) \
56 { \
57 iprintf("%s : ", NV_Settings.DeviceName); \
58 iprintf(__VA_ARGS__); \
59 iprintf("\r\n"); \
60 } \
61 }
62
82 struct NV_SettingsStruct
83 {
84 /* NetBurner address configuration */
85 char DeviceName[(DEVICE_NAME_LENGTH + 1)];
86 char NetBIOSName[(NETBIOS_NAME_SIZE_IN_CHARS + 1)];
87
88 /* SSL certificate and keys file lengths */
89 uint8_t SslCertificateSource;
90 uint16_t SslCertificateLength;
91 uint16_t SslKeyLength;
92
93 /* Version verification key */
94 uint32_t VerifyKey;
95 /* Flash File System Version verification key */
96 uint32_t STDEFFSVerifyKey;
97 };
98
99 /* User parameters */

NetBurner, Inc.
22.151 serialrecord.h 895

100 extern NV_SettingsStruct NV_Settings;


101
102 /* User parameters change candidate */
103 extern NV_SettingsStruct gNV_SettingsChangeCopy;
104
105 /* User parameters change flag */
106 extern volatile bool gChangedUserParameters;
107
108 /* Debugging flag */
109 extern bool bShowDebug;
110
111 /* Register a post */
112 extern void RegisterPost(void);
113
114 extern void CheckNVSettings(bool returnToFactory = false);
115
116 extern void SetAndSaveDefaults(void);
117
118 /* For processing hexadecimal break key value */
119 extern char GetHexByte(const char *cp);
120
121 #endif /* _SERIALBURNERDATA_H_ */

22.151 serialrecord.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SERIAL_RECORD_H_
6 #define _SERIAL_RECORD_H_
7 #pragma once
8
9 #include <basictypes.h>
10 #include <buffers.h>
11 #include <iosys.h>
12 #include <nettypes.h>
13 #include <system.h>
14
15 #include "nbfactory.h"
16 #include "serialburnerdata.h"
17
22 struct SerialRecord
23 {
24 /*
25 * Data
26 */
27 // File descriptor of serial port
28 int FD_SerialPort;
29
30 // File descriptor of listening socket
31 int FD_ListeningSocket;
32
33 // File descriptor of connected socket
34 int FD_ConnectedSocket;
35
36 // TRUE if we established the connection
37 bool bWeInitiatedConnection;
38
39 // Time of last network sourced data in seconds since last boot
40 uint32_t LastNetWorkDataRxed;
41
42 // Time of last transmitted data in seconds since last boot
43 uint32_t LastNetWorkDataTxed;
44
45 // Time of last attempted outgoing connection in seconds since last boot
46 uint32_t LastConnectTry;
47
48 bool bSerialBoundDataBlocked;
49 bool bNetWorkBoundDataBlocked;
50
51 // Circular buffer from serial port to network
52 char Buffer_From_S2N[BUFFER_SIZE];
53 int Buf_S2N_Start;
54 int Buf_S2N_End;
55
56 // Circular buffer from network to serial port
57 char Buffer_From_N2S[BUFFER_SIZE];
58 int Buf_N2S_Start;
59 int Buf_N2S_End;
60
61 IPADDR LearnedUdp;
62 uint32_t RxBufferCount;
63 int port_index; // A global PortRecord array will be declared
64 int uart_num; // Physical UART number

NetBurner, Inc.
896 File Documentation

65 int conn_try;
66
67 // Flag verification and tick time-stamping for keep-alive implementation
68 bool tcpKeepAliveSent;
69 uint32_t tcpLastRxTicks;
70 uint32_t tcpkeepAliveTicks;
71
75 void AssignUartNumber(void);
76
77 void ProcessUdpSerialRead(void);
78 void ProcessUdpRead(void);
79 void ProcessUdpTxTo(void);
80 void SetUdpReadFD(fd_set &fd_rd);
81
82 void SetTcpFDs(fd_set &fd_rd, fd_set &fd_wr, fd_set &fd_err);
83 void ProcessTcpFDs(fd_set &fd_rd, fd_set &fd_wr, fd_set &fd_err);
84 void ProcessTCPReadSerialData(void);
85 void ProcessSpecialFrameTCPReadSerialData(void);
86
87 void ProcessSpecialFrameWriteNetworkData(void);
88 void ProcessSpecialFrameWriteTimeout(void);
89 void MakeTcpConnection(void);
90
91 #ifdef SB800EX
92 void TestDSR(void);
93 void TestCD(void);
94 #endif // SB800EX
95
96 void SendSerialMessage(const char *msg);
97 int SerialBreakWrite(char *start, int len);
98 void CloseListenPort(void);
99 void MakeUdpConnection(void);
100 bool OkToListen(void);
101 void ProcessTimeouts(void);
102 void ProcessAccept(void);
103 void OpenSerialPort(void);
104 void ProcessReadNetworkData(void);
105 void OpenListenPort(void);
106 void ProcessWriteNetworkData(void);
107 void ProcessWriteSerialData(void);
108
109 void ProcessSerialError(void);
110 void ProcessListenError(void);
111 void ProcessNetworkError(void);
112 void EnableATCommands();
113 void DisableATCommands();
114 void GetCurrentChannelStatus(char *buffer);
115 };
116
117 #endif

22.152 SecureSerToEthFactoryApp/src/sshuser.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SSHUSER_H_
6 #define _SSHUSER_H_
7
8 #include "serialburnerdata.h"
9 /*
10 ******************************************************************************
11 ******************************************************************************
12 *
13 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
14 *
15 ******************************************************************************
16 ******************************************************************************
17 */
18
19 /*
20 ******************************************************************************
21 *
22 * Global data definitions (declared in sshuser.cpp)
23 *
24 ******************************************************************************
25 */
26
27 /* SSH keys PEM encoded (sshuser.cpp) */
28 extern char *gSshRsaKeyPemEncoded[(SERIAL_BURNER_KEY_SIZE_MAX_PEM + 1)];
29 extern char *gSshEcdsaKeyPemEncoded[(SERIAL_BURNER_KEY_SIZE_MAX_PEM + 1)];
30
31 /*
32 ******************************************************************************

NetBurner, Inc.
22.152 SecureSerToEthFactoryApp/src/sshuser.h 897

33 *
34 * Functions
35 *
36 ******************************************************************************
37 */
38 /*
39 ******************************************************************************
40 *
41 * "C" Routines
42 *
43 ******************************************************************************
44 */
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #endif
49
50 /*
51 ******************************************************************************
52
53 User provided SSH username and password authenticate routine.
54
55 Parameters:
56 usernamePtr - Username in plain text
57 passwordPtr - Password in plain text
58
59 Return:
60 1 - Authenticated, all else error
61
62 Notes:
63 None
64
65 ******************************************************************************
66 */
67 int SshUserAuthenticate(const char *usernamePtr, const char *passwordPtr, AuthType authType);
68
69 /*
70 ******************************************************************************
71
72 User provided SSH key retrieval
73
74 Parameters:
75 keyRequested - Type key requested
76 SSH_KEY_RSA
77 SSH_KEY_ECC
78 keyBufferPtr - Key from user storage
79 keyLengthPtr - Size of key in 8 bit bytes
80
81 Return:
82 0 - key and length is valid, -1 - key requested not available
83
84 Notes:
85 openSS(L|H) key pair, PEM encoded, no encrypted or with passphrase.
86 Key must be valid. Each type asked for once at at startup.
87 The buffer containing the key will NOT be deallocated.
88 Server will disable task scheduling calling OSLock, copy contents, then
89 call OSUnlock
90
91 ******************************************************************************
92 */
93 int SshUserGetKey(int keyRequested, const unsigned char **keyBufferPtr, int *keyLengthPtr);
94
95 /*
96 ******************************************************************************
97
98 Verifies SSH key
99
100 Parameters:
101 pemKeyPtr - PEM encoded key data
102 pemKeySize - PEM encoded key size in bytes
103 keyTypePtr - Pointer for key type
104
105 Return:
106 TRUE - OK, FALSE invalid.
107
108 Notes:
109 None
110
111 ******************************************************************************
112 */
113 bool SshUserVerifyKey(char *pemKeyPtr, int pemKeySize, int *keyTypePtr);
114
115 /*
116 ******************************************************************************
117
118 Checks and installs SSH keys permanent defaults
119

NetBurner, Inc.
898 File Documentation

120 Parameters:
121 None
122
123 Return:
124 None
125
126 Notes:
127 Sets NV_Settings elements:
128 SshKeyRsaSource;
129 SshKeyRsaLength;
130 SshKeyEcdsaSource;
131 SshKeyEcdsaLength;
132
133 ******************************************************************************
134 */
135 void SshUserSetDefault(void);
136
137 /*
138 ******************************************************************************
139
140 Retrieves and set keys
141
142 Parameters:
143 None
144
145 Return:
146 None
147
148 Notes:
149 Clears SSH settings for CertificateNKeysDataStatus element of
150 struct NV_SettingsStruct if retrieval error occurs
151
152 ******************************************************************************
153 */
154 void SshUserRetrieveKeys(void);
155
156 #ifdef __cplusplus
157 };
158 #endif
159
160 /*
161 ******************************************************************************
162 *
163 * "C++" Routines
164 *
165 ******************************************************************************
166 */
167
168 #endif /* _SSHUSER_H_ */

22.153 SshServerUserKey/src/sshuser.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SSHUSER_H_
6 #define _SSHUSER_H_
7
8 #include <ssh/NetBurner/UserAuthManager.h>
9
10 /* Certificate and key status */
11 #define SSH_KEY_LIBRARY_DEFAULT ((uint8_t)0x00)
12 #define SSH_KEY_DEFAULT ((uint8_t)0x01)
13 #define SSH_KEY_USER_INSTALLED ((uint8_t)0x02)
14
15 /* HTML Certificate and Key file status */
16 #define SSH_KEY_VALID (0)
17 #define SSH_KEY_NOT_FOUND (1)
18 #define SSH_KEY_FILE_INVALID (2)
19 #define SSH_KEY_CERTIFICATE_INVALID (3)
20 #define SSH_KEY_INVALID (4)
21
22 /*
23 ******************************************************************************
24 * Key size
25 * SSH MAX_PRIVKEY_SIZE 1700 (options.h)
26 * SSH key size (PEM) < 4K (empirical)
27 * NULL terminated for conversion
28 *
29 ******************************************************************************
30 */
31 #define SSH_KEY_SIZE_MAX_PEM ((4 * 1024) - 1)
32
33 /*

NetBurner, Inc.
22.153 SshServerUserKey/src/sshuser.h 899

34 ******************************************************************************
35 *
36 * Global data definitions (declared in sshuser.cpp)
37 *
38 ******************************************************************************
39 */
40
41 /* SSH keys PEM encoded (sshuser.cpp) */
42 extern char *gSshRsaKeyPemEncoded[(SSH_KEY_SIZE_MAX_PEM + 1)];
43 extern char *gSshEccKeyPemEncoded[(SSH_KEY_SIZE_MAX_PEM + 1)];
44
45 /*
46 ******************************************************************************
47 *
48 * "C" Routines
49 *
50 ******************************************************************************
51 */
52 #ifdef __cplusplus
53 extern "C"
54 {
55 #endif
56
57 /*
58 ******************************************************************************
59
60 User provided SSH username and passuint16_t authenticate routine.
61
62 Parameters:
63 usernamePtr - Username in plain text
64 authValPtr - Password or Key in plain text
65 authType - Specify if the authorization value is a password or key
66
67 Return:
68 1 - Authenticated, all else error
69
70 Notes:
71 None
72
73 ******************************************************************************
74 */
75 int SshUserAuthenticate(const char *usernamePtr, const char *authValPtr, AuthType authType);
76
77 /*
78 ******************************************************************************
79
80 User provided SSH key retrieval
81
82 Parameters:
83 keyRequested - Type key requested
84 SSH_KEY_ECC
85 SSH_KEY_RSA
86 keyBufferPtr - Key from user storage
87 keyLengthPtr - Size of key in 8 bit uint8_ts
88
89 Return:
90 0 - key and length is valid, -1 - key requested not available
91
92 Notes:
93 openSS(L|H) key pair, PEM encoded, no encrypted or with passphrase.
94 Key must be valid. Each type asked for once at at startup.
95 The buffer containing the key will NOT be deallocated.
96 Server will disable task scheduling calling OSLock, copy contents, then
97 call OSUnlock
98
99 ******************************************************************************
100 */
101 int SshUserGetKey(int keyRequested, const unsigned char **keyBufferPtr, int *keyLengthPtr);
102
103 /*
104 ******************************************************************************
105
106 Verifies SSH key
107
108 Parameters:
109 pemKeyPtr - PEM encoded key data
110 pemKeySize - PEM encoded key size in uint8_ts
111 keyTypePtr - Pointer for key type
112
113 Return:
114 TRUE - OK, FALSE invalid.
115
116 Notes:
117 None
118
119 ******************************************************************************
120 */

NetBurner, Inc.
900 File Documentation

121 BOOL SshUserVerifyKey(char *pemKeyPtr, int pemKeySize, int *keyTypePtr);


122
123 /*
124 ******************************************************************************
125
126 Checks and installs SSH keys permanent defaults
127
128 Parameters:
129 None
130
131 Return:
132 None
133
134 Notes:
135 Sets NV_Settings elements:
136 SshKeyEccSource;
137 SshKeyEccLength;
138 SshKeyRsaSource;
139 SshKeyRsaLength;
140
141 ******************************************************************************
142 */
143 void SshUserSetDefault(void);
144
145 /*
146 ******************************************************************************
147
148 Retrieves and set keys
149
150 Parameters:
151 None
152
153 Return:
154 None
155
156 Notes:
157 Clears SSH settings for CertificateNKeysDataStatus element of
158 struct NV_SettingsStruct if retrieval error occurs
159
160 ******************************************************************************
161 */
162 void SshUserRetrieveKeys(void);
163
164 #ifdef __cplusplus
165 };
166 #endif
167
168 /*
169 ******************************************************************************
170 *
171 * "C++" Routines
172 *
173 ******************************************************************************
174 */
175
176 #endif /* _SSHUSER_H_ */

22.154 SSH/SecureSerToEthFactoryApp/src/ssluser.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SSLUSER_H_
6 #define _SSLUSER_H_
7
8 /* NB Secure Sockets Layer (SSL) */
9 #include <crypto/ssl.h>
10
11 /*
12 ******************************************************************************
13 ******************************************************************************
14 *
15 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
16 *
17 ******************************************************************************
18 ******************************************************************************
19 */
20
21 /*
22 ******************************************************************************
23 *
24 * Global data definitions
25 *
26 ******************************************************************************

NetBurner, Inc.
22.155 SSL/HttpsUploadCert/src/ssluser.h 901

27 */
28 /* Default or installed user PEM encoded certificate */
29 extern char gSslCert[(SERIAL_BURNER_CERTIFICATE_SIZE_MAX_PEM + 1)];
30 extern char gSslKey[(SERIAL_BURNER_KEY_SIZE_MAX_PEM + 1)];
31
32 /*
33 ******************************************************************************
34 *
35 * Functions
36 *
37 ******************************************************************************
38 */
39 /*
40 ******************************************************************************
41 *
42 * "C" Routines
43 *
44 ******************************************************************************
45 */
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 /*
51 ******************************************************************************
52
53 Checks and installs SSL default certificate and key
54
55 Parameters:
56 None
57
58 Return:
59 None
60
61 Notes:
62 Sets NV_Settings elements:
63 SslCertificateSource;
64 SslCertificateLength;
65 SslKeyLength;
66
67
68 ******************************************************************************
69 */
70 void SslUserSetDefault(void);
71
72 /*
73 ******************************************************************************
74
75 Retrieves and set certificate and key
76
77 Parameters:
78 None
79
80 Return:
81 None
82
83 Notes:
84 Clears SSL settings for CertificateNKeysDataStatus element of
85 struct NV_SettingsStruct if retrieval error occurs
86
87 ******************************************************************************
88 */
89 void SslUserRetrieveCertificateNKey(void);
90
91 #ifdef __cplusplus
92 };
93 #endif
94
95 /*
96 ******************************************************************************
97 *
98 * "C++" Routines
99 *
100 ******************************************************************************
101 */
102
103 #endif /* _SSLUSER_H_ */

22.155 SSL/HttpsUploadCert/src/ssluser.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SSLUSER_H_

NetBurner, Inc.
902 File Documentation

6 #define _SSLUSER_H_
7
8 /* NB Secure Sockets Layer (SSL) */
9 #include <crypto/ssl.h>
10
11 /* Default or installed user PEM encoded certificate */
12 extern char gSslCert[(SERIAL_BURNER_CERTIFICATE_SIZE_MAX_PEM + 1)];
13 extern char gSslKey[(SERIAL_BURNER_KEY_SIZE_MAX_PEM + 1)];
14
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19
28 void SslUserSetDefault(void);
29
36 void SslUserRetrieveCertificateNKey(void);
37
38 #ifdef __cplusplus
39 };
40 #endif
41
42 #endif /* _SSLUSER_H_ */

22.156 UserAuth.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _USER_AUTH_H_
6 #define _USER_AUTH_H_
7
8 #include <predef.h>
9
10 #include <ssh/NetBurner/UserAuthManager.h>
11
12 int SaveAuthRecordsUserParam(const UserAuthRecord *authRec);
13 int LoadAuthRecordsUserParam(UserAuthRecord *authRec);
14 int AuthenticateUser(const char *usernamePtr, const char *authPtr, AuthType authType);
15
16 AuthResponse ProcessAddNewUser();
17 AuthResponse ProcessDeleteUser();
18
19 #endif /* _USER_AUTH_H_ */

22.157 permanentkeyecc.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*
6 * Default SSH ECC key in openSSL (openSSH) format
7 * OpenSSL format is Privacy-enhanced Electronic Mail (PEM) encoded
8 *
9 */
10
11 #ifndef _PERMANENTKEYECC_H_
12 #define _PERMANENTKEYECC_H_
13
14 "-----BEGIN EC PRIVATE KEY-----\r\
15 MHcCAQEEIJQCd0y9U8mFVUWqJUNRX2FYkPTBuuYu1MFSm6QaGxA7oAoGCCqGSM49\r\
16 AwEHoUQDQgAE++54xjrZKCfpmMYqaEdP2w0fTkXC6FEuWp1sg/uuOXiF2cS7GHY/\r\
17 6PYVqh7SjIH+1QUxaRKlsIhXsIguY0tW3w==\r\
18 -----END EC PRIVATE KEY-----\r"
19
20 #endif /*_PERMANENTKEYECC_H_*/

22.158 caList.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 const uint32_t GithubCertLen = 1345;
6 const unsigned char GithubCert[GithubCertLen] = {
7 "-----BEGIN CERTIFICATE-----"
8 "MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG"

NetBurner, Inc.
22.159 Advanced/src/TimeUtil.h 903

9 "EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw"
10 "KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw"
11 "MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ"
12 "MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu"
13 "Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t"
14 "Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS"
15 "OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3"
16 "MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ"
17 "NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe"
18 "h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB"
19 "Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY"
20 "JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ"
21 "V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp"
22 "myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK"
23 "mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe"
24 "vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K"
25 "-----END CERTIFICATE-----"};

22.159 Advanced/src/TimeUtil.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 void setSystemTime(char *timeZoneName);
9 void displaySystemTime();
10
11 #endif

22.160 CompiledCa/src/TimeUtil.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 void setSystemTime(char *timeZoneName);
9 void displaySystemTime();
10
11 #endif

22.161 Simple/src/TimeUtil.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _EFFS_TIME_H
6 #define _EFFS_TIME_H
7
8 void setSystemTime(char *timeZoneName);
9 void displaySystemTime();
10
11 #endif

22.162 TcpClientSimple/src/clientweb.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_CLIENTWEB_H
6 #define _NB_CLIENTWEB_H
7
8 //----- Function Prototypes -----
9 void RegisterPost();
10
11 #endif

NetBurner, Inc.
904 File Documentation

22.163 TcpMultiInterfaceTest/src/clientweb.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_CLIENTWEB_H
6 #define _NB_CLIENTWEB_H
7
8 //----- Function Prototypes -----
9 void RegisterPost();
10
11 #endif

22.164 webif.cpp File Reference


This module handles the web page interface to the UDP to Serial program example.
#include <basictypes.h>
#include <http.h>
#include <iosys.h>
#include <stdlib.h>
#include <string.h>
#include <system.h>
#include <httppost.h>
#include "webif.h"

Functions
• void WebLocalPort (int sock, PCSTR url)
• void WebDestPort (int sock, PCSTR url)
• void WebDestIp (int sock, PCSTR url)
• void CheckNVSettings ()

22.164.1 Detailed Description


This module handles the web page interface to the UDP to Serial program example.

22.164.2 Function Documentation

22.164.2.1 CheckNVSettings()

void CheckNVSettings ( )
Check NV Settings. This function will check the flash memory user parameter storage area for valid stored values.
If the values are invalid (VerifyKey), it will assign default values.

22.164.2.2 WebDestIp()

void WebDestIp (
int sock,
PCSTR url )
Function to display current destination IP address

22.164.2.3 WebDestPort()

void WebDestPort (
int sock,
PCSTR url )
Function to display destination port number

NetBurner, Inc.
22.165 webif.h File Reference 905

22.164.2.4 WebLocalPort()

void WebLocalPort (
int sock,
PCSTR url )
Function to display destination port number

22.165 webif.h File Reference


Classes
• struct NV_SettingsStruct
Configuration Settings.

22.166 webif.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
9 #define APP_VERSION "Version 1.1 11-Jan-2018"
10 #define LOCAL_PORT 3333
11 #define DEST_PORT 3334
12 #define DEST_IPADDR "10.1.1.104"
13
14 #define POST_BUFSIZE (4096)
15
16 #define VERIFY_KEY (0x18256052) // NV Settings key code
17 #define MAX_IPADDR_LEN (20)
18
19 struct NV_SettingsStruct // Non-volatile storage structure
20 {
21 uint32_t VerifyKey = 0; // Flash memory key for initialization
22 int nLocalPort = 0; // Local UDP port to listen on
23 int nDestPort = 0; // Destination UDP port to send serial data
24 char szDestIpAddr[MAX_IPADDR_LEN]; // Destination UDP ip address
25 };

22.167 datagenerator.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef __DATAGENERATOR_H
6 #define __DATAGENERATOR_H
7
8 #include "datalog.h"
9
10 #define LOG_SIZE 1000
11 #define SENSOR_1_PERIOD 13
12 #define SENSOR_2_PERIOD 11
13 #define SENSOR_1_INIT 44.23
14 #define SENSOR_2_INIT -10.0
15
16 extern RingLog dataLog;
17
18 int32_t SeedLog();
19 void LogSensor(int id, int32_t tick);
20
21 #endif /* __DATAGENERATOR_H */

22.168 datalog.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef __DATALOG_H
6 #define __DATALOG_H
7

NetBurner, Inc.
906 File Documentation

8 #include <stdint.h>
9
10 struct dataStruct
11 {
12 int sensorID = 0;
13 uint32_t timeStamp = 0;
14 float value = 0.0;
15 };
16
17 typedef void (*RingLogSerializer)(dataStruct *item, void *args);
18
19 class RingLog
20 {
21 private:
22 dataStruct *pHead = nullptr;
23 dataStruct *pTail = nullptr;
24 int32_t count = 0;
25
26 const dataStruct *pStart = nullptr;
27 const dataStruct *pEnd = nullptr;
28 const int32_t maxSize = 0;
29
30 void IncrementTail();
31 void IncrementHead();
32 void IncrementPtr(dataStruct *&ptr);
33
34 public:
35 RingLog(dataStruct *buffer, uint32_t bufferSize);
36 ~RingLog();
37
38 void Add(dataStruct *item);
39 void Remove(dataStruct *item);
40 void Clear();
41 int32_t GetCount();
42 void Dump();
43 void Serialize(RingLogSerializer serializer, void *args);
44 };
45
46 #endif /* #ifndef __DATALOG_H */

22.169 drawimage.cpp File Reference


Function definitions for the DrawImageObject class.
#include <iosys.h>
#include <malloc.h>
#include <string.h>
#include "drawimage.h"
#include "gifCompress.h"

Functions
• int writeall (int fd, const char ∗c, int siz)
Write the specified number of bytes to a file descriptor. Will block until all bytes are sent, or a file descriptor error
occurs (such as a TCP socket error). Can be used to write data to stdio, a TCP socket, or a Serial port.
• void FlushData (int fd)
• void WriteData (int fd, const char ∗c, int siz)
• void OutputGifChar (const char c, int fd)
• void WriteOneChar (const FontData ∗pf, char c, int xp, int yp, uint8_t color, DrawImageObject &doi)

22.169.1 Detailed Description


Function definitions for the DrawImageObject class.
This class hold the data associated with and draws GIF images with text to a given file descriptor

22.169.2 Function Documentation

NetBurner, Inc.
22.170 drawimage.h 907

22.169.2.1 FlushData()

void FlushData (
int fd )
FlushData
Flush any unwritten data to the output

22.169.2.2 OutputGifChar()

void OutputGifChar (
const char c,
int fd )
OutputGifChar
Writes a GIF char to the given fd

22.169.2.3 WriteData()

void WriteData (
int fd,
const char ∗ c,
int siz )
WriteData
This is the function that writes data to the output socket

22.169.2.4 WriteOneChar()

void WriteOneChar (
const FontData ∗ pf,
char c,
int xp,
int yp,
uint8_t color,
DrawImageObject & doi )
WriteOneChar
Writes a single character

22.170 drawimage.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /* This file contains a simple class for drawing Graphics into a GIF image */
6
7 #ifndef _DRAWIMAGE_H_
8 #define _DRAWIMAGE_H_
9
10 #include <basictypes.h>
11
12 #include "gifCompress.h"
13
14 class GitCompress;
15
16 class DrawImageObject
17 {
18 uint8_t *m_pImageBuffer = nullptr;
19 uint8_t *m_pColorArray = nullptr;
20
21 int m_xSize = 0;
22 int m_ySize = 0;
23 int m_nColors = 0;
24
25 int m_curx = 0;
26 int m_cury = 0;
27
28 bool m_trans = false;
29 uint8_t m_transIndex = 0;
30
31 GitCompress m_gitCompress;

NetBurner, Inc.
908 File Documentation

32
33 friend class GitCompress;
34
35 private:
36 int GIFNextPixel();
37 void compress(int init_bits, int fd);
38
39 public:
40 /* You must specify the size and color depth of the GIF object in the constructor */
41 DrawImageObject(int x, int y, int ncolors, bool transparent, uint8_t transIndex);
42 ~DrawImageObject();
43
44 /* Set a specific pixel to a specific color */
45 void PutPixel(int x, int y, uint8_t color);
46
47 /* Get the color of a specific pixel */
48 uint8_t GetPixel(int x, int y);
49
50 /* All colors are index based. You must define the color for each index */
51 void SetColor(uint8_t index, uint8_t red, uint8_t green, uint8_t blue);
52
53 /* Draw a line */
54 void Line(int x1, int y1, int x2, int y2, uint8_t colorindex);
55
56 /* Draw a box */
57 void Box(int x1, int y1, int x2, int y2, uint8_t colorindex);
58
59 /* Draw a filled box */
60 void FilledBox(int x1, int y1, int x2, int y2, uint8_t fillc, uint8_t outlinec);
61
62 /* Draw text */
63 void Text(const char *pText, int x1, int x2, const char *fontrecord, uint8_t color);
64 int TextXsize(const char *pText, const char *fontrecord);
65 int TextYsize(const char *pText, const char *fontrecord);
66
67 /* After you have done all of your drawing you must call this function to send the GIF */
68 void WriteGIF(int fd);
69 };
70
71 extern const char GiantFont[];
72 extern const char LargeFont[];
73 extern const char MediumFont[];
74 extern const char SmallFont[];
75 extern const char TinyFont[];
76
77 #endif /* _DRAWIMAGE_H_ */

22.171 gifCompress.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 /*-----------------------------------------------------------------------
6 *
7 * miGIF Compression - mouse and ivo’s GIF-compatible compression
8 *
9 * -run length encoding compression routines-
10 *
11 * Copyright (C) 1998 Hutchison Avenue Software Corporation
12 * http://www.hasc.com
13 * [email protected]
14 *
15 * Permission to use, copy, modify, and distribute this software and its
16 * documentation for any purpose and without fee is hereby granted, provided
17 * that the above copyright notice appear in all copies and that both that
18 * copyright notice and this permission notice appear in supporting
19 * documentation. This software is provided "AS IS." The Hutchison Avenue
20 * Software Corporation disclaims all warranties, either express or implied,
21 * including but not limited to implied warranties of merchantability and
22 * fitness for a particular purpose, with respect to this code and accompanying
23 * documentation.
24 *
25 * The miGIF compression routines do not, strictly speaking, generate files
26 * conforming to the GIF spec, since the image data is not LZW-compressed
27 * (this is the point: in order to avoid transgression of the Unisys patent
28 * on the LZW algorithm.) However, miGIF generates data streams that any
29 * reasonably sane LZW decompresser will decompress to what we want.
30 *
31 * miGIF compression uses run length encoding. It compresses horizontal runs
32 * of pixels of the same color. This type of compression gives good results
33 * on images with many runs, for example images with lines, text and solid
34 * shapes on a solid-colored background. It gives little or no compression
35 * on images with few runs, for example digital or scanned photos.
36 *

NetBurner, Inc.
22.172 webFormValues.h 909

37 * der Mouse
38 * [email protected]
39 * 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
40 *
41 * [email protected]
42 *
43 * The Graphics Interchange Format(c) is the Copyright property of
44 * CompuServe Incorporated. GIF(sm) is a Service Mark property of
45 * CompuServe Incorporated.
46 */
47
48 #ifndef _GIT_COMPRESS_H_
49 #define _GIT_COMPRESS_H_
50 #pragma once
51
52 #define GIFBITS 12
53
54 //#include "drawimage.h"
55
56 class DrawImageObject;
57
58 class GitCompress
59 {
60 public:
61 GitCompress();
62 void ResetStatistics();
63 void compress(DrawImageObject &dio, int init_bits, int fd);
64
65 private:
66 void write_block(void);
67 void block_out(unsigned char c);
68 void block_flush(void);
69 void output(int val);
70 void output_flush(void);
71 void did_clear(void);
72 void output_plain(int c);
73 unsigned int isqrt(unsigned int x);
74 unsigned int compute_triangle_count(unsigned int count, unsigned int nrepcodes);
75 void max_out_clear(void);
76 void reset_out_clear(void);
77 void rl_flush_fromclear(int count);
78 void rl_flush_clearorrep(int count);
79 void rl_flush_withtable(int count);
80 void rl_flush(void);
81
82 int rl_pixel = 0;
83 int rl_basecode = 0;
84 int rl_count = 0;
85 int rl_table_pixel = 0;
86 int rl_table_max = 0;
87 int just_cleared = 0;
88 int out_bits = 0;
89 int out_bits_init = 0;
90 int out_count = 0;
91 int out_bump = 0;
92 int out_bump_init = 0;
93 int out_clear = 0;
94 int out_clear_init = 0;
95 int max_ocodes = 0;
96 int code_clear = 0;
97 int code_eof = 0;
98 unsigned int obuf = 0;
99 int obits = 0;
100 int ofd = 0;
101 int oblen = 0;
102 unsigned char oblock[256];
103 bool m_transparent = false;
104 };
105
106 #endif /* _GIT_COMPRESS_H_ */
107
108 /*-----------------------------------------------------------------------
109 *
110 * End of miGIF section - See copyright notice at start of section.
111 *
112 *-----------------------------------------------------------------------*/

22.172 webFormValues.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _WEB_FORM_VALUES_H_
6 #define _WEB_FORM_VALUES_H_

NetBurner, Inc.
910 File Documentation

7 #pragma once
8
9 #define DEF_WIDTH (250)
10 #define DEF_HT (250)
11 #define DEF_FRED (150)
12 #define DEF_FGREEN (0)
13 #define DEF_FBLUE (250)
14 #define DEF_BRED (250)
15 #define DEF_BGREEN (150)
16 #define DEF_BBLUE (0)
17 #define DEF_TRED (255)
18 #define DEF_TGREEN (255)
19 #define DEF_TBLUE (255)
20
21 /* This class defines a BAR size width etc... */
22
23 class WebFormValues
24 {
25 public:
26 uint16_t m_ht = DEF_HT;
27 uint16_t m_wid = DEF_WIDTH;
28 uint8_t m_fillRed = DEF_FRED;
29 uint8_t m_fillGreen = DEF_FGREEN;
30 uint8_t m_fillBlue = DEF_FBLUE;
31 uint8_t m_borderRed = DEF_BRED;
32 uint8_t m_borderGreen = DEF_BGREEN;
33 uint8_t m_borderBlue = DEF_BBLUE;
34 uint8_t m_textRed = DEF_TRED;
35 uint8_t m_textGreen = DEF_TGREEN;
36 uint8_t m_textBlue = DEF_TBLUE;
37
38 WebFormValues();
39 WebFormValues(PCSTR url);
40 void WriteUrl(int sock, PCSTR Prefix);
41 };
42
43 #endif /* _BAR_DEFINITION_H_ */

22.173 WebFunctions.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef WEBFUNCTIONS_H_
6 #define WEBFUNCTIONS_H_
7
8 extern void RegisterWebHandler();
9 extern bool WifiInitComplete;
10
11 #endif /*WEBFUNCTIONS_H_*/

22.174 certgen.h File Reference


Onboard Certificate Generation.
#include <predef.h>
#include <nettypes.h>
#include <nbstring.h>
#include <crypto/ssl.h>
#include <crypto/wolfssl/wolfcrypt/ecc.h>
#include <random.h>

Classes
• struct AltNameEntry
The AltNameEntry struct holds all of the information required to add a single alternate name entry to a certificate
that's generated onboard the module.
• struct CertGenData
Used to store the information that is passed in when enabling onboard generated certificates, as well as the informa-
tion needed to determine when they need to be regenerated.

NetBurner, Inc.
22.175 certgen.h 911

Enumerations
• enum SslKeyType_t {
SSL_KEY_NONE = 0 , SSL_KEY_RSA_1024 = 1 , SSL_KEY_RSA_2048 , SSL_KEY_RSA_4096 ,
SSL_KEY_ECC_SECP192R1 = ECC_SECP192R1 , SSL_KEY_ECC_SECP224R1 = ECC_SECP224R1 ,
SSL_KEY_ECC_SECP256R1 = ECC_SECP256R1 , SSL_KEY_ECC_SECP384R1 = ECC_SECP384R1 ,
SSL_KEY_ECC_SECP521R1 = ECC_SECP521R1 }
Certificate Generation Key Types.
• enum AltNameType_t : char { ALT_NAME_TYPE_NONE = 0 , ALT_NAME_TYPE_DNS = (char)0x82 ,
ALT_NAME_TYPE_IP = (char)0x87 }
Certificate Generation Alternate Name Types.
• enum CertGenReturnCode : int {
CERT_GEN_RETURN_SUCCESS = 1 , CERT_GEN_RETURN_NOT_REQUIRED = 2 , CERT_GEN_RETURN_INVALID_RAN
= -1 , CERT_GEN_RETURN_MALLOC_ERROR = -2 ,
CERT_GEN_RETURN_ECC_INIT_ERROR = -3 , CERT_GEN_RETURN_ECC_CREATE_ERROR = -4 ,
CERT_GEN_RETURN_RSA_INIT_ERROR = -5 , CERT_GEN_RETURN_RSA_CREATE_ERROR = -6 ,
CERT_GEN_RETURN_CERT_INIT_ERROR = -7 , CERT_GEN_RETURN_CERT_CREATE_ERROR = -8 ,
CERT_GEN_RETURN_CERT_SIGNING_ERROR = -9 , CERT_GEN_RETURN_CERT_SAVING_ERROR =
-10 ,
CERT_GEN_RETURN_KEY_CONVERT_ERROR = -11 , CERT_GEN_RETURN_KEY_SAVING_ERROR =
-12 , CERT_GEN_RETURN_SET_ISSUER_ERROR = -13 }
Certificate Generation Function Return Codes.

Functions
• CertGenReturnCode SSL_CreateNewSelfSignedCert (const char ∗common_name=nullptr, int yearsValid=1,
AltNameEntry altNames[ ]=nullptr, int altNameCnt=0)
Generates a new self-signed certificate that will be stored on the device.
• void EnableOnboardCertificateCreation (char ∗common_name=nullptr, int yearsValid=1, AltNameEntry alt←-
Names[ ]=nullptr, int altNameCnt=0, CertGenReturnCode(∗createCertFunc)(const char ∗, int, AltNameEntry[ ],
int)=SSL_CreateNewSelfSignedCert)
Enables the ability for the module to automatically generate self-signed certificates for use in SSL/TLS connections
when acting as the server.

22.174.1 Detailed Description


Onboard Certificate Generation.

22.175 certgen.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
17 #ifndef _CERT_GEN_H
18 #define _CERT_GEN_H
19 #include <predef.h>
20 #include <nettypes.h>
21 #include <nbstring.h>
22
23 #if defined(NB_SSL_SUPPORTED) || defined(NB_SSH_SUPPORTED)
24
25 #include <crypto/ssl.h>
26 #include <crypto/wolfssl/wolfcrypt/ecc.h>
27 #include <random.h>
28
29 #define NB_SSC_ISS "NetBurner, Inc. (ASSC)" // Autogenerated Self-Signed Cert
30
31 #define MAX_CERT_SNAME_LEN 64
32
33 #if defined(HAVE_ECC) && defined(ENABLE_ECCKEY_CREATE)
34 #define SSL_KEY_ECC
35
36 #if defined(HAVE_ECC384)

NetBurner, Inc.
912 File Documentation

37 #define DEFAULT_KEY_TYPE SSL_KEY_ECC_SECP384R1


38 #elif !defined(NO_ECC256)
39 #define DEFAULT_KEY_TYPE SSL_KEY_ECC_SECP256R1
40 #elif defined(HAVE_ECC224)
41 #define DEFAULT_KEY_TYPE SSL_KEY_ECC_SECP224R1
42 #elif defined(HAVE_ECC192)
43 #define DEFAULT_KEY_TYPE SSL_KEY_ECC_SECP192R1
44 #elif defined(HAVE_ECC521)
45 #define DEFAULT_KEY_TYPE SSL_KEY_ECC_SECP521R1
46 #endif
47 #elif defined(ENABLE_RSAKEY_CREATE)
48 #define SSL_KEY_RSA
49 #define DEFAULT_KEY_TYPE SSL_KEY_RSA_2048
50 #else
51 #define SSL_KEY_RSA
52 #define DEFAULT_KEY_TYPE SSL_KEY_RSA_2048
53 #endif
54
64 enum SslKeyType_t
65 {
66 SSL_KEY_NONE = 0,
67 SSL_KEY_RSA_1024 = 1,
68 SSL_KEY_RSA_2048,
69 SSL_KEY_RSA_4096,
70 SSL_KEY_ECC_SECP192R1 = ECC_SECP192R1,
71 SSL_KEY_ECC_SECP224R1 = ECC_SECP224R1,
72 SSL_KEY_ECC_SECP256R1 = ECC_SECP256R1,
73 SSL_KEY_ECC_SECP384R1 = ECC_SECP384R1,
74 SSL_KEY_ECC_SECP521R1 = ECC_SECP521R1,
75 };
86 enum AltNameType_t : char
87 {
88 ALT_NAME_TYPE_NONE = 0,
89 ALT_NAME_TYPE_DNS = (char)0x82,
90 ALT_NAME_TYPE_IP = (char)0x87
91 };
102 enum CertGenReturnCode : int
103 {
104 CERT_GEN_RETURN_SUCCESS = 1,
105 CERT_GEN_RETURN_NOT_REQUIRED = 2,
106 CERT_GEN_RETURN_INVALID_RANDOM = -1,
107 CERT_GEN_RETURN_MALLOC_ERROR = -2,
108 CERT_GEN_RETURN_ECC_INIT_ERROR = -3,
109 CERT_GEN_RETURN_ECC_CREATE_ERROR = -4,
110 CERT_GEN_RETURN_RSA_INIT_ERROR = -5,
111 CERT_GEN_RETURN_RSA_CREATE_ERROR = -6,
112 CERT_GEN_RETURN_CERT_INIT_ERROR = -7,
113 CERT_GEN_RETURN_CERT_CREATE_ERROR = -8,
114 CERT_GEN_RETURN_CERT_SIGNING_ERROR = -9,
115 CERT_GEN_RETURN_CERT_SAVING_ERROR = -10,
116 CERT_GEN_RETURN_KEY_CONVERT_ERROR = -11,
117 CERT_GEN_RETURN_KEY_SAVING_ERROR = -12,
118 CERT_GEN_RETURN_SET_ISSUER_ERROR = -13,
119 };
126 struct AltNameEntry
127 {
128 AltNameEntry() : m_type(ALT_NAME_TYPE_NONE), m_value(nullptr), m_len(0) {}
129
130 AltNameType_t m_type;
131 char *m_value;
133 int m_len;
134 };
135
140 struct CertGenData
141 {
142 CertGenData() : m_commonName(nullptr), m_yrsValid(1), m_altNameCnt(0), m_altNames(nullptr),
m_certExpTime(0), m_certExpTimeSet(false) {}
143
144 // Values passed in by EnableOnboardCertificateCreation() and set by the user
145 char *m_commonName;
146 int m_yrsValid;
147 AltNameEntry *m_altNames;
148 int m_altNameCnt;
149
150 // Values set when a cert is generated to monitor its expiration
151 time_t m_certExpTime;
152 bool m_certExpTimeSet;
153 };
154
172 extern "C" CertGenReturnCode SSL_CreateNewSelfSignedCert(const char *common_name = nullptr,
173 int yearsValid = 1,
174 AltNameEntry altNames[] = nullptr,
175 int altNameCnt = 0);
176
177 extern CertGenReturnCode (*SSL_CreateNewCert)(const char *common_name, int yearsValid, AltNameEntry
altNames[], int altNameCnt);
178

NetBurner, Inc.
22.176 CryptoServer.h 913

195 void EnableOnboardCertificateCreation(


196 char *common_name = nullptr,
197 int yearsValid = 1,
198 AltNameEntry altNames[] = nullptr,
199 int altNameCnt = 0,
200 CertGenReturnCode (*createCertFunc)(const char *, int, AltNameEntry[], int) =
SSL_CreateNewSelfSignedCert);
201
202 CertGenReturnCode CheckAndCreateHalCertAndKey();
203
204 #endif /* NB_SSL_SUPPORTED */
205 #endif /* #ifdef _CERT_GEN_H */
206

22.176 CryptoServer.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _CRYPTO_SERVER_H_
6 #define _CRYPTO_SERVER_H_
7
8 #include <predef.h>
9 #if defined(NB_SSL_SUPPORTED) || defined(NB_SSH_SUPPORTED)
10
11 enum CryptoServerErrors : int16_t
12 {
13 eCryptoServerErrorInvalidSocketType = -1
14 };
15
16 enum CryptoQueueAction : unsigned char
17 {
18 eCryptoQueueActionError = 1,
19 eCryptoQueueActionTcpRead = 2,
20 eCryptoQueueActionTcpClose = 3,
21 eCryptoQueueActionExtraFdClose = 4
22 };
23
24 int ioReturnCode(int n, int tcpFd, SocketType_t sockType);
25
26 void InitCryptoServer();
27 void PostCryptoQueueData(CryptoSocket *sck, CryptoQueueAction action);
28
29 void CryptoReadNotify(int fd);
30 void CryptoWriteNotify(int fd);
31
32 int WolfCryptoCbIoRecv(int tcp, char *buf, int len, void *ctx, SocketType_t sckType);
33 int WolfCryptoCbIoSend(int tcp, char *buf, int len, void *ctx, SocketType_t sckType);
34
35 int WolfCryptoExtraFdRead(int fd, char *buf, int nbytes);
36 int WolfCryptoExtraFdWrite(int fd, const char *buf, int nbytes);
37 int WolfCryptoExtraFdClose(int extra_fd);
38
39 #endif // NB_SSL_SUPPORTED || NB_SSH_SUPPORTED
40 #endif //_CRYPTO_SERVER_H_

22.177 CryptoSocket.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _CRYPTO_SOCKET_H_
6 #define _CRYPTO_SOCKET_H_
7
8 #include <basictypes.h>
9 #include <buffers.h>
10 #include <netinterface.h>
11 #include <iointernal.h>
12
13 #define NUM_WOLF_CRYPTO_SOCKETS (16)
14 #define NUM_WOLF_CRYPTO_SESSIONS (16)
15 #define CRYPTO_BUFFER_SEGMENTS TCP_BUFFER_SEGMENTS
16
17 #define CRYPTO_OBJ_FLAG_WNOTIFY_IGNORE (0x0001)
18 #define CRYPTO_OBJ_FLAG_USER_CLOSED (0x0002) // User program called close on the SSL/ExtraFd.
19 #define CRYPTO_OBJ_FLAG_DOINGSHUTDOWN (0x0004)
20 #define CRYPTO_OBJ_FLAG_DOINGCONNECT (0x0008)
21 #define CRYPTO_OBJ_FLAG_DOINGACCEPT (0x0010)
22 #define CRYPTO_OBJ_FLAG_HAVEERROR (0x0020)
23 #define CRYPTO_OBJ_FLAG_OTHER_SIDE_CLOSED (0x0040)

NetBurner, Inc.
914 File Documentation

24 #define CRYPTO_OBJ_FLAG_RESET_SOCKET \
25 (0x0080) // If we fail during negotiation, we need to go ahead and reset the full socket as the
user won’t get
26 // a valid FD to close, which will result in a socket leak.
27 #define CRYPTO_OBJ_FLAG_ERROR_RETURNED \
28 (0x0100) // If we are resetting the socket in the asynch task, we want to make sure we don’t do so
until the
29 // connection has returned any errors.
30 #define CRYPTO_OBJ_FLAG_TCP_RESET (0x0200) // We recieved a reset or abort on the tcp conneciton.
31
32 // Time stuff
33 #define SHUTDOWN_RETRY_INTERVAL_IMMEDIATE \
34 (1) // Because of our asynchronous connections, we will generally have to try at least twice to
completely
35 // shutdown with WolfSSL. However, the time between these calls can be extremely short.
36 #define SHUTDOWN_RETRY_INTERVAL (TICKS_PER_SECOND)
37 #define CONNECT_RETRY_INTERVAL (TICKS_PER_SECOND)
38
39 enum SocketType_t : unsigned char
40 {
41 SocketType_Default = 0,
42 SocketType_Tls = 1,
43 SocketType_Ssh = 2,
44 };
45
46 enum SocketHasData_t : int
47 {
48 SocketHasData_NoData = 0,
49 SocketHasData_HasData = 1,
50 SocketHasData_PendingData = 2
51 };
52
53 class CryptoSocket
54 {
55 public:
56 // Member variables
57 SocketType_t m_socketType = SocketType_Default;
58
59 OS_CRIT m_Crit; // Critical seciton to keep wolf multithread safe
60 int m_error = 0; // The error value
61 int m_options = 0; // Options like push etc ...
62
63 PoolPtr m_NoPushbuffer;
64 fifo_buffer_storage m_dataTcpOverflow; // Used to hold overflow on outbound data to tcp
65
66 // Will either be a WOLFSSL* or WOLFSSH*
67 void *m_wolfCtx = nullptr;
68
69 // Volatile becasue they can be touched from multiple places
70 volatile int m_tcpFd = 0; // The underlyign tcp socket
71 volatile int m_cryptoExtraFd = 0; // The ExtraFd the user code uses to interact with
thei socket
72 OS_FLAGS m_OS_Flags; //State flags
73
74 volatile uint32_t m_TimeTickOfNextAction = 0; // Time tick to do some time releated thing
75
76 // This is an index that gets incrmented every time a socket is reset.
77 // This is used to detect race conditions on the worker queue to keep
78 // messages from sockets already closed from getting reused.
79 volatile uint8_t m_IndexOfReuse;
80 volatile uint8_t m_RetryCount;
81
82 CryptoSocket();
83 virtual ~CryptoSocket();
84
85 SocketType_t GetSocketType() { return m_socketType; }
86 bool InUse();
87
88 // Virtual Fuctions
89 // when push gets turned off or the socket gets closed with data to be written we cleanup here
90 void CleanupUnWritten();
91
92 // Called from wolf loop mostly to handle notifications and
93 // time out stuff for all async process except read. Needs to be
94 // defined for each socket type.
95 virtual void ProcessAsyncStuff() = 0;
96
97 virtual int CheckSocketRecv() = 0;
98
99 // Final clean up when we are done usign this socket.
100 virtual void ResetSocket();
101
102 // Called when the underlying TCP socket got closed
103 virtual void CleanupTcpClose();
104
105 // Flag Functions
106 inline void SetFlag(uint32_t flag) { m_OS_Flags.Set(flag); }

NetBurner, Inc.
22.178 NbSslCtx.h 915

107 inline void ClrFlag(uint32_t flag) { m_OS_Flags.Clear(flag); }


108 inline bool GetFlag(uint32_t flag) { return (m_OS_Flags.State()&flag)!=0;}
109 inline uint32_t GetFlags() { return m_OS_Flags.State();}
110 inline void ClrAllFlags() { m_OS_Flags.Clear(0xFFFFFFFF); }
111 inline bool PendFlagUntil(uint32_t flag, uint32_t Time) {return
(m_OS_Flags.PendAnyUntil(flag,Time)!=OS_TIMEOUT);}
112 inline bool PendFlagDly(uint32_t flag, uint32_t Delay){return
(m_OS_Flags.PendAny(flag,Delay)!=OS_TIMEOUT);};
113
114 // Options functions
115 inline int GetOptions() { return m_options; }
116 inline void SetOptions(int option) { m_options |= option; }
117 inline void ClrOptions(int option) { m_options &= ~option; }
118
119 virtual uint32_t GetCheckableIndexFromSocket() = 0;
120 virtual uint32_t SocketRead(char *buf, uint32_t len) = 0;
121 virtual uint32_t SocketWrite(const char *buf, uint32_t len) = 0;
122 virtual SocketHasData_t SocketHasData() = 0;
123
124 inline int GetTcpFd() { return m_tcpFd; }
125 inline int GetCryptoExtraFd() { return m_cryptoExtraFd; }
126 inline int GetError() { return m_error; }
127 inline void SetError(int err) { m_error = err; }
128 inline uint32_t GetTimeOfNextAction() { return m_TimeTickOfNextAction; }
129 inline OS_CRIT &GetSockCrit() { return m_Crit; }
130
131 // Buffer Handling
132 inline fifo_buffer_storage &GetTcpOverflow() { return m_dataTcpOverflow; }
133 inline PoolPtr GetNoPushBuffer() { return m_NoPushbuffer; }
134 inline void SetNewNoPushBuffer() { m_NoPushbuffer = GetBuffer(); }
135 inline bool IsNoPushBufferEmpty() { return (m_NoPushbuffer == 0); }
136
137 void SetCryptoExtraFd(int cpExFd) { m_cryptoExtraFd = cpExFd; }
138
139 static CryptoSocket *GetSocketFromTcpFd(int tcpFd);
140 static CryptoSocket *GetSocketFromIndex(uint32_t index);
141 static CryptoSocket *GetSocketFromCryptoFd(int cryptoFd);
142
143 protected:
144 void InitSocket(int tcpFd, IoExpandStruct *ioExpStr);
145
146 bool CloseTcpFd(IPADDR &remoteAddr, int &remotePort);
147
148 // Static Member Functions
149 // Need to add a GetNewSocket() for each derived type
150 static CryptoSocket *GetSocketFromIndex(CryptoSocket *cryptoSockets, uint32_t index);
151 static CryptoSocket *GetSocketFromTcpFd(CryptoSocket *cryptoSockets, int tcpFd);
152 static CryptoSocket *GetSocketFromCryptoFd(CryptoSocket *cryptoSockets, int cryptoFd);
153
154 uint32_t GetCheckableIndexFromSocket(CryptoSocket *cryptoSockets);
155
156 // The following should be defined for each class type
157 virtual void WriteUnwrittenData() = 0;
158 virtual bool PendOnHandshake() { return false; }
159
160 void ClearNextActionTimeTick() { m_TimeTickOfNextAction = 0; };
161 void SetNextActionTimeTick(uint32_t time);
162 void SetSocketError(int error, bool setTcpClose, bool resetSocket);
163 void ResetSequence(bool success);
164
165 static CryptoSocket *FindNextEmptySocket(CryptoSocket *cryptoSockets);
166 };
167
168 #endif // _CRYPTO_SOCKET_H_

22.178 NbSslCtx.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_SSL_CTX_H_
6 #define _NB_SSL_CTX_H_
7
8 #include <crypto/wolfssl/internal.h>
9
10 enum SslCtxVerifyPeer
11 {
12 SslCtxVerifyPeer_default = 0,
13 SslCtxVerifyPeer_on,
14 SslCtxVerifyPeer_off,
15 };
16
17 class NbSslCtx
18 {

NetBurner, Inc.
916 File Documentation

19 public:
20 bool Create( bool isServer );
21
22 WOLFSSL_CTX* GetCtx(){ return m_wolfCtx; }
23
24 void SetInit(bool init){ m_ctxInit = init; }
25 bool GetInit(){ return m_ctxInit; }
26
27 bool GetCaSet(){ return m_ctxCaSet; }
28 void SetCaSet(bool set){ m_ctxCaSet = set; }
29
30 SslCtxVerifyPeer GetVerifyPeer(){ return m_verifyPeer; }
31 void SetVerifyPeer( SslCtxVerifyPeer verifYPeer ){ m_verifyPeer = verifYPeer; }
32
33 private:
34 WOLFSSL_CTX* m_wolfCtx = nullptr;
35 bool m_ctxInit = false;
36 bool m_ctxCaSet = false;
37 SslCtxVerifyPeer m_verifyPeer = SslCtxVerifyPeer_default;
38 };
39
40 #endif /* _NB_SSL_CTX_H_ */

22.179 NbWolfSsl.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _NB_WOLF_SSL_H_
6 #define _NB_WOLF_SSL_H_
7
8 #include <predef.h>
9 #ifdef NB_SSL_SUPPORTED
10
11 #include <crypto/wolfssl/ssl.h>
12 #include <crypto/wolfssl/callbacks.h>
13
14 void CheckGenerateNewCert();
15
16 #endif /* NB_SSL_SUPPORTED */
17 #endif

22.180 SslClientSession.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SSL_SESSION_ID_H_
6 #define _SSL_SESSION_ID_H_
7
8 #include <predef.h>
9 #ifdef NB_SSL_SUPPORTED
10
11 #include <buffers.h>
12 #include <tcp.h>
13 #include <netinterface.h>
14
15 #include <crypto/wolfssl/ssl.h>
16 #include <crypto/NetBurner/SslSocket.h>
17
18 // Used for session resumption with session ID’s
19 class SslClientSession
20 {
21 public:
22 ~SslClientSession();
23
24 inline void SetSession(IPADDR &ip, int port, WOLFSSL_SESSION *session);
25 void ClearSession();
26
27 IPADDR m_ipAddr = IPADDR::NullIP();
28 int m_port = 0;
29 OS_CRIT m_Crit; // Critical seciton to keep wolf multithread safe
30 WOLFSSL_SESSION *m_session = nullptr;
31 };
32
33 WOLFSSL_SESSION *FindSession(IPADDR &ipAddr, int port);
34 bool SaveSession(IPADDR &ipAddr, int port, WOLFSSL_SESSION *session);
35
36 #endif /* NB_SSL_SUPPORTED */
37 #endif // _SSL_SESSION_ID_H_

NetBurner, Inc.
22.181 SslSocket.h 917

22.181 SslSocket.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef _SSL_SOCKET_H_
6 #define _SSL_SOCKET_H_
7
8 #ifdef NB_SSL_SUPPORTED
9
10 #include <buffers.h>
11 #include <netinterface.h>
12
13 #include <crypto/wolfssl/ssl.h>
14 #include <crypto/NetBurner/CryptoSocket.h>
15 #include <crypto/ssl.h>
16
17 // Time stuff
18 #define SHUTDOWN_RETRY_INTERVAL_IMMEDIATE \
19 (1) // Because of our asynchronous connections, we will generally have to try at least twice to
completely
20 // shutdown with WolfSSL. However, the time between these calls can be extremely short.
21 #define SHUTDOWN_RETRY_INTERVAL (TICKS_PER_SECOND)
22 #define CONNECT_RETRY_INTERVAL (TICKS_PER_SECOND)
23
24 class SslSocket : public CryptoSocket
25 {
26 public:
27 SslSocket();
28 ~SslSocket();
29
30 uint16_t InitSocket(int tcpFd, WOLFSSL_CTX *ctx, const char *commonName, uint32_t sockFlags = 0);
31
32 void CleanupTcpClose();
33
34 // Called from wolf ssl loop mostly to handle notifications and
35 // time out stuff for all async process except read
36 void ProcessAsyncStuff() override;
37 int CheckSocketRecv() override;
38 uint32_t GetCheckableIndexFromSocket() override;
39 uint32_t SocketRead(char *buf, uint32_t len) override;
40 uint32_t SocketWrite(const char *buf, uint32_t len) override;
41 SocketHasData_t SocketHasData() override;
42
43 // Need to add a GetNewSocket() for each derived type
44 static SslSocket *GetSocketFromIndex(uint32_t index);
45 static SslSocket *GetSocketFromTcpFd(int tcpFd);
46 static SslSocket *GetSocketFromCryptoFd(int cryptoFd);
47 static SslSocket *GetNewSocket(int tcpFd, WOLFSSL_CTX *ctx, const char *commonName, uint32_t
sockFlags = 0);
48
49 inline WOLFSSL *GetWolfSsl() { return (WOLFSSL *)m_wolfCtx; }
50
51 private:
52 void WriteUnwrittenData() override;
53 virtual bool PendOnHandshake() { return (m_error == SSL_ERROR_HANDSHAKE_INCOMPLETE); }
54 };
55
56 extern SslSocket gSslSockets[];
57
58 #endif /* NB_SSL_SUPPORTED */
59 #endif

22.182 E70_RAM/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #include <predef.h>
6
7 #ifdef __cplusplus
8 extern "C"
9 {
10 #endif
11
12 //#define DEBUG_WOLFSSL
13
14 #include <endian.h>
15 #define XHTONS(a) __htons(a)
16
17 //#define WOLFSSL_CALLBACKS
18

NetBurner, Inc.
918 File Documentation

19 /* ------------------------------------------------------------------------- */
20 /* Platform */
21 /* ------------------------------------------------------------------------- */
22 #undef WOLFSSL_GENERAL_ALIGNMENT
23 #define WOLFSSL_GENERAL_ALIGNMENT 4
24
25 #undef SINGLE_THREADED
26 //#define SINGLE_THREADED
27
28 #undef WOLFSSL_SMALL_STACK
29 #define WOLFSSL_SMALL_STACK
30
31 #undef WOLFSSL_USER_IO
32 #define WOLFSSL_USER_IO
33
34 /* ------------------------------------------------------------------------- */
35 /* Math Configuration */
36 /* ------------------------------------------------------------------------- */
37 #undef SIZEOF_LONG_LONG
38 #define SIZEOF_LONG_LONG 8
39
40 #undef USE_FAST_MATH
41 #if 1
42 #define USE_FAST_MATH
43
44 #undef TFM_TIMING_RESISTANT
45 #define TFM_TIMING_RESISTANT
46
47 /* Optimizations */
48 //#define TFM_ARM
49 #endif
50
51 /* Wolf Single Precision Math */
52 #undef WOLFSSL_SP
53 #if 0
54 #define WOLFSSL_SP
55 #define WOLFSSL_SP_SMALL /* use smaller version of code */
56 #define WOLFSSL_HAVE_SP_RSA
57 #define WOLFSSL_HAVE_SP_DH
58 #define WOLFSSL_HAVE_SP_ECC
59 #define WOLFSSL_SP_CACHE_RESISTANT
60 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
61
62 /* 64 or 32 bit version */
63 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
64 //#define WOLFSSL_SP_ARM32_ASM
65 //#define WOLFSSL_SP_ARM64_ASM
66 #endif
67
68 /* ------------------------------------------------------------------------- */
69 /* FIPS - Requires eval or license from wolfSSL */
70 /* ------------------------------------------------------------------------- */
71 #undef HAVE_FIPS
72 #if 0
73 #define HAVE_FIPS
74
75 #undef HAVE_FIPS_VERSION
76 #define HAVE_FIPS_VERSION 2
77
78 #ifdef SINGLE_THREADED
79 #undef NO_THREAD_LS
80 #define NO_THREAD_LS
81 #endif
82 #endif
83
84 /* ------------------------------------------------------------------------- */
85 /* Crypto */
86 /* ------------------------------------------------------------------------- */
87 /* RSA */
88 #undef NO_RSA
89 #if 1
90 #ifdef USE_FAST_MATH
91 /* Maximum math bits (Max RSA key bits * 2) */
92 #undef FP_MAX_BITS
93 #define FP_MAX_BITS 8192
94 #endif
95
96 /* half as much memory but twice as slow */
97 #undef RSA_LOW_MEM
98 //#define RSA_LOW_MEM
99
100 /* Enables blinding mode, to prevent timing attacks */
101 #if 1
102 #undef WC_RSA_BLINDING
103 #define WC_RSA_BLINDING
104 #else
105 #undef WC_NO_HARDEN

NetBurner, Inc.
22.182 E70_RAM/user_settings.h 919

106 #define WC_NO_HARDEN


107 #endif
108
109 /* RSA PSS Support */
110 #if 1
111 #define WC_RSA_PSS
112 #endif
113
114 #if 1
115 #define WC_RSA_NO_PADDING
116 #endif
117 #else
118 #define NO_RSA
119 #endif
120
121 /* ECC */
122 #undef HAVE_ECC
123 #if 1
124 #define HAVE_ECC
125
126 // Manually add support for curves.
127 #undef ECC_USER_CURVES
128 #define ECC_USER_CURVES
129
130 #ifdef ECC_USER_CURVES
131 /* Manual Curve Selection */
132 #define HAVE_ECC192 // For WolfSSL
133 #define HAVE_ECC224 // For WolfSSL
134 #undef NO_ECC256
135
136 // Added for specific curve support for WolfSSH
137 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
138 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
139 #define ECC192
140 #define ECC224
141 #undef NO_ECC_SECP
142 #define HAVE_ECC_SECPR2
143 #define HAVE_ECC_SECPR3
144
145 #ifdef ENABLE_ECC384 // predef.h
146 #define HAVE_ECC384 // - Disabled until we can get better performance
147 #endif
148
149 #ifdef ENABLE_ECC521 // predef.h
150 #define HAVE_ECC521 // - Disabled until we can get better performance
151 #endif
152
153 #ifdef ENABLE_ED25519 // predef.h
154 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
155 #define HAVE_CURVE25519
156
157 /* Optionally use small math (less flash usage, but much slower) */
158 //#define CURVED25519_SMALL
159 #endif
160 #endif
161
162 /* Fixed point cache (speeds repeated operations against same private key) */
163 #undef FP_ECC
164 #define FP_ECC
165 #ifdef FP_ECC
166 /* Bits / Entries */
167 #undef FP_ENTRIES
168 #define FP_ENTRIES 15
169 #undef FP_LUT
170 #define FP_LUT 4
171 #endif
172
173 /* Optional ECC calculation method */
174 /* Note: doubles heap usage, but slightly faster */
175 #undef ECC_SHAMIR
176 #define ECC_SHAMIR
177
178 /* Reduces heap usage, but slower */
179 #undef ECC_TIMING_RESISTANT
180 //#define ECC_TIMING_RESISTANT // - Disabled for performance
181
182 /* Enable cofactor support */
183 #ifdef HAVE_FIPS
184 #undef HAVE_ECC_CDH
185 #define HAVE_ECC_CDH
186 #endif
187
188 /* Validate import */
189 #ifdef HAVE_FIPS
190 #undef WOLFSSL_VALIDATE_ECC_IMPORT
191 #define WOLFSSL_VALIDATE_ECC_IMPORT
192 #endif

NetBurner, Inc.
920 File Documentation

193
194 /* Compressed Key Support */
195 #undef HAVE_COMP_KEY
196 //#define HAVE_COMP_KEY
197
198 /* Use alternate ECC size for ECC math */
199 #ifdef USE_FAST_MATH
200 #ifdef NO_RSA
201 /* Custom fastmath size if not using RSA */
202 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
203 #undef FP_MAX_BITS
204 #define FP_MAX_BITS (256 + 32)
205 #else
206 #undef ALT_ECC_SIZE
207 #define ALT_ECC_SIZE
208 #endif
209
210 /* Speedups specific to curve */
211 #ifndef NO_ECC256
212 #undef TFM_ECC256
213 #define TFM_ECC256
214 #endif
215 #endif
216 #endif
217
218 /* DH */
219 #undef NO_DH
220 #if 1
221 /* Use table for DH instead of -lm (math) lib dependency */
222 #if 1
223 #define WOLFSSL_DH_CONST
224 #define HAVE_FFDHE_2048
225 #define HAVE_FFDHE_4096
226 //#define HAVE_FFDHE_6144
227 //#define HAVE_FFDHE_8192
228 #endif
229
230 #ifdef HAVE_FIPS
231 #define WOLFSSL_VALIDATE_FFC_IMPORT
232 #define HAVE_FFDHE_Q
233 #endif
234 #else
235 #define NO_DH
236 #endif
237
238 /* AES */
239 #undef NO_AES
240 #if 1
241 #undef HAVE_AES_CBC
242 #define HAVE_AES_CBC
243
244 #undef HAVE_AESGCM
245 #define HAVE_AESGCM
246
247 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
248 #define GCM_SMALL
249
250 #undef WOLFSSL_AES_DIRECT
251 //#define WOLFSSL_AES_DIRECT
252
253 #undef HAVE_AES_ECB
254 //#define HAVE_AES_ECB
255
256 #undef WOLFSSL_AES_COUNTER
257 //#define WOLFSSL_AES_COUNTER
258
259 #undef HAVE_AESCCM
260 #define HAVE_AESCCM
261 #else
262 #define NO_AES
263 #endif
264
265 /* DES3 */
266 #undef NO_DES3
267 #if 1
268 #else
269 #define NO_DES3
270 #endif
271
272 /* ChaCha20 / Poly1305 */
273 //#undef HAVE_CHACHA
274 //#undef HAVE_POLY1305
275 //#if 0
276 #define HAVE_CHACHA
277 #define HAVE_POLY1305
278
279 /* Needed for Poly1305 */

NetBurner, Inc.
22.182 E70_RAM/user_settings.h 921

280 #undef HAVE_ONE_TIME_AUTH


281 #define HAVE_ONE_TIME_AUTH
282 //#endif
283
284 /* Ed25519 / Curve25519 */
285 //#undef HAVE_CURVE25519
286 //#undef HAVE_ED25519
287 //#if 0
288 #define HAVE_CURVE25519
289 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
290
291 /* Optionally use small math (less flash usage, but much slower) */
292 #if 1
293 #define CURVED25519_SMALL
294 #endif
295 //#endif
296
297 /* ------------------------------------------------------------------------- */
298 /* Hashing */
299 /* ------------------------------------------------------------------------- */
300 /* Sha */
301 //#undef WOLFSSL_STATIC_RSA
302 #if 1
303 /* 1k smaller, but 25% slower */
304 //#define USE_SLOW_SHA
305 #else
306 #define NO_SHA
307 #endif
308
309 /* Sha256 */
310 #undef NO_SHA256
311 #if 1
312 /* not unrolled - ~2k smaller and ~25% slower */
313 //#define USE_SLOW_SHA256
314
315 /* Sha224 */
316 #if 0
317 #define WOLFSSL_SHA224
318 #endif
319 #else
320 #define NO_SHA256
321 #endif
322
323 /* Sha512 */
324 //#undef WOLFSSL_SHA512
325 //#if 0
326 #define WOLFSSL_SHA512
327
328 /* Sha384 */
329 //#undef WOLFSSL_SHA384
330 //#if 0
331 #define WOLFSSL_SHA384
332 //#endif
333
334 /* over twice as small, but 50% slower */
335 //#define USE_SLOW_SHA512
336 //#endif
337
338 /* Sha3 */
339 #undef WOLFSSL_SHA3
340 #if 0
341 #define WOLFSSL_SHA3
342 #endif
343
344 /* MD5 */
345 #undef NO_MD5
346 #if 0
347
348 #else
349 #define NO_MD5
350 #endif
351
352 /* HKDF */
353 #undef HAVE_HKDF
354 #if 1
355 #define HAVE_HKDF
356 #endif
357
358 /* CMAC */
359 #undef WOLFSSL_CMAC
360 #if 0
361 #define WOLFSSL_CMAC
362 #endif
363
364 /* ------------------------------------------------------------------------- */
365 /* Benchmark / Test */
366 /* ------------------------------------------------------------------------- */

NetBurner, Inc.
922 File Documentation

367 /* Use reduced benchmark / test sizes */


368 #undef BENCH_EMBEDDED
369 //#define BENCH_EMBEDDED
370
371 #undef USE_CERT_BUFFERS_2048
372 //#define USE_CERT_BUFFERS_2048
373
374 #undef USE_CERT_BUFFERS_1024
375 //#define USE_CERT_BUFFERS_1024
376
377 #undef USE_CERT_BUFFERS_256
378 //#define USE_CERT_BUFFERS_256
379
380 /* ------------------------------------------------------------------------- */
381 /* Debugging */
382 /* ------------------------------------------------------------------------- */
383
384 #undef DEBUG_WOLFSSL
385 #undef NO_ERROR_STRINGS
386 #if 0
387 #define DEBUG_WOLFSSL
388 #else
389 #if 0
390 #define NO_ERROR_STRINGS
391 #endif
392 #endif
393
394 /* ------------------------------------------------------------------------- */
395 /* Memory */
396 /* ------------------------------------------------------------------------- */
397
398 /* Override Memory API’s */
399 #if 0
400 #undef XMALLOC_OVERRIDE
401 #define XMALLOC_OVERRIDE
402
403 /* prototypes for user heap override functions */
404 /* Note: Realloc only required for normal math */
405 #include <stddef.h> /* for size_t */
406 extern void *myMalloc(size_t n, void* heap, int type);
407 extern void myFree(void *p, void* heap, int type);
408 extern void *myRealloc(void *p, size_t n, void* heap, int type);
409
410 #define XMALLOC(n, h, t) myMalloc(n, h, t)
411 #define XFREE(p, h, t) myFree(p, h, t)
412 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
413 #endif
414
415 #if 0
416 /* Static memory requires fast math */
417 #define WOLFSSL_STATIC_MEMORY
418
419 /* Disable fallback malloc/free */
420 #define WOLFSSL_NO_MALLOC
421 #if 1
422 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
423 #endif
424 #endif
425
426 /* Memory callbacks */
427 #if 0
428 #undef USE_WOLFSSL_MEMORY
429 #define USE_WOLFSSL_MEMORY
430
431 /* Use this to measure / print heap usage */
432 #if 1
433 #undef WOLFSSL_TRACK_MEMORY
434 #define WOLFSSL_TRACK_MEMORY
435
436 #undef WOLFSSL_DEBUG_MEMORY
437 #define WOLFSSL_DEBUG_MEMORY
438 #endif
439 #else
440 #ifndef WOLFSSL_STATIC_MEMORY
441 #define NO_WOLFSSL_MEMORY
442 /* Otherwise we will use stdlib malloc, free and realloc */
443 #endif
444 #endif
445
446 /* ------------------------------------------------------------------------- */
447 /* Port */
448 /* ------------------------------------------------------------------------- */
449
450 /* Override Current Time */
451 /* Allows custom "custom_time()" function to be used for benchmark */
452 #define WOLFSSL_USER_CURRTIME
453 #define WOLFSSL_GMTIME

NetBurner, Inc.
22.182 E70_RAM/user_settings.h 923

454 #define USER_TICKS


455 #include <time.h>
456 extern unsigned long my_time(time_t *timer);
457 #define XTIME my_time
458
459 /* ------------------------------------------------------------------------- */
460 /* RNG */
461 /* ------------------------------------------------------------------------- */
462
463 /* Seed Source */
464 /* Size of returned HW RNG value */
465 #define CUSTOM_RAND_TYPE unsigned int
466 extern unsigned int my_rng_seed_gen(void);
467 #undef CUSTOM_RAND_GENERATE
468 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
469
470 // NetBurner specific define for enabling hardware random number generation for M7
471 #define GATHER_RANDOM_USE_HW
472
473 /* Choose RNG method */
474 #if 1
475 /* Use built-in P-RNG (SHA256 based) with HW RNG */
476 /* P-RNG + HW RNG (P-RNG is ~8K) */
477 #undef HAVE_HASHDRBG
478 //#define HAVE_HASHDRBG
479 #else
480 #undef WC_NO_HASHDRBG
481 #define WC_NO_HASHDRBG
482
483 /* Bypass P-RNG and use only HW RNG */
484 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
485 #undef CUSTOM_RAND_GENERATE_BLOCK
486 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
487 #endif
488
489 /* ------------------------------------------------------------------------- */
490 /* Custom Standard Lib */
491 /* ------------------------------------------------------------------------- */
492 /* Allows override of all standard library functions */
493 #undef STRING_USER
494 #if 0
495 #define STRING_USER
496
497 #include <string.h>
498
499 #undef USE_WOLF_STRSEP
500 #define USE_WOLF_STRSEP
501 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
502
503 #undef USE_WOLF_STRTOK
504 #define USE_WOLF_STRTOK
505 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
506
507 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
508
509 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
510 #define XMEMSET(b, c, l) memset((b), (c), (l))
511 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
512 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
513
514 #define XSTRLEN(s1) strlen((s1))
515 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
516 #define XSTRSTR(s1, s2) strstr((s1), (s2))
517
518 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
519 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
520 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
521
522 #define XSNPRINTF snprintf
523 #endif
524
525 /* ------------------------------------------------------------------------- */
526 /* Enable Features */
527 /* ------------------------------------------------------------------------- */
528 #undef WOLFSSL_TLS13
529 #if 1
530 #define WOLFSSL_TLS13
531 #endif
532
533 #undef WOLFSSL_KEY_GEN
534 #if 1
535 #define WOLFSSL_KEY_GEN
536 #endif
537
538 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
539 #define WOLFSSL_OLD_PRIME_CHECK
540 #endif

NetBurner, Inc.
924 File Documentation

541
542 #undef KEEP_PEER_CERT
543 #define KEEP_PEER_CERT
544
545 #undef HAVE_COMP_KEY
546 //#define HAVE_COMP_KEY
547
548 #undef HAVE_TLS_EXTENSIONS
549 #define HAVE_TLS_EXTENSIONS
550
551 #undef HAVE_SUPPORTED_CURVES
552 #define HAVE_SUPPORTED_CURVES
553
554 #undef WOLFSSL_BASE64_ENCODE
555 #define WOLFSSL_BASE64_ENCODE
556
557 #define SMALL_SESSION_CACHE
558 #define HAVE_SESSION_TICKET
559
560 /* ------------------------------------------------------------------------- */
561 /* Disable Features */
562 /* ------------------------------------------------------------------------- */
563 #undef NO_WOLFSSL_SERVER
564 //#define NO_WOLFSSL_SERVER
565
566 #undef NO_WOLFSSL_CLIENT
567 //#define NO_WOLFSSL_CLIENT
568
569 #undef NO_CRYPT_TEST
570 //#define NO_CRYPT_TEST
571
572 #undef NO_CRYPT_BENCHMARK
573 //#define NO_CRYPT_BENCHMARK
574
575 #undef WOLFCRYPT_ONLY
576 //#define WOLFCRYPT_ONLY
577
578 /* In-lining of misc.c functions */
579 /* If defined, must include wolfcrypt/src/misc.c in build */
580 /* Slower, but about 1k smaller */
581 #undef NO_INLINE
582 //#define NO_INLINE
583
584 #undef WOLFSSL_NO_SOCK
585 #define WOLFSSL_NO_SOCK
586
587 #undef NO_WOLFSSL_DIR
588 #define NO_WOLFSSL_DIR
589
590 #undef NO_FILESYSTEM
591 #define NO_FILESYSTEM
592
593 #undef NO_WRITEV
594 #define NO_WRITEV
595
596 #undef NO_MAIN_DRIVER
597 #define NO_MAIN_DRIVER
598
599 #undef NO_DEV_RANDOM
600 #define NO_DEV_RANDOM
601
602 #undef NO_DSA
603 #define NO_DSA
604
605 #undef NO_RC4
606 //#define NO_RC4
607
608 #undef NO_OLD_TLS
609 #define NO_OLD_TLS
610
611 #undef NO_HC128
612 #define NO_HC128
613
614 #undef NO_RABBIT
615 #define NO_RABBIT
616
617 #undef NO_PSK
618 #define NO_PSK
619
620 #undef NO_MD4
621 #define NO_MD4
622
623 #undef NO_PWDBASED
624 #define NO_PWDBASED
625
626 #undef NO_CODING
627 //#define NO_CODING

NetBurner, Inc.
22.183 IC_D20/user_settings.h 925

628
629 #undef NO_ASN_TIME
630 //#define NO_ASN_TIME
631
632 #undef NO_CERTS
633 //#define NO_CERTS
634
635 #undef NO_SIG_WRAPPER
636 //#define NO_SIG_WRAPPER
637
638 #undef WOLFSSL_IGNORE_FILE_WARN
639 #define WOLFSSL_IGNORE_FILE_WARN
640
641 #undef NO_TLS
642
643 #define HAVE_SNI
644
645 // Settings made for compatibility
646 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
647 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
648 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
649 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
650
651 #define WOLFSSL_CERT_REQ
652 #define WOLFSSL_CERT_GEN
653 #define WOLFSSL_ALT_NAMES
654 #define WOLFSSL_DER_TO_PEM
655 #define WOLFSSL_KEY_GEN
656
657 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
658 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
659
660 // For wolfSSH
661 //#undef WOLFSSH_SFTP
662 //#define WOLFSSH_SFTP
663
664 //#undef WOLFSSH_SCP
665 //#define WOLFSSH_SCP
666
667 #undef WOLFSSH_USER_IO
668 #define WOLFSSH_USER_IO
669
670 #ifdef __cplusplus
671 }
672 #endif
673
674 #endif /* WOLFSSL_USER_SETTINGS_H */

22.183 IC_D20/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #include <predef.h>
6
7 #ifdef __cplusplus
8 extern "C"
9 {
10 #endif
11
12 //#define DEBUG_WOLFSSL
13 #include <endian.h>
14 #define XHTONS(a) __htons(a)
15
16 //#define WOLFSSL_CALLBACKS
17
18 /* ------------------------------------------------------------------------- */
19 /* Platform */
20 /* ------------------------------------------------------------------------- */
21 #undef WOLFSSL_GENERAL_ALIGNMENT
22 #define WOLFSSL_GENERAL_ALIGNMENT 4
23
24 #undef SINGLE_THREADED
25 //#define SINGLE_THREADED
26
27 #undef WOLFSSL_SMALL_STACK
28 #define WOLFSSL_SMALL_STACK
29
30 #undef WOLFSSL_USER_IO
31 #define WOLFSSL_USER_IO
32
33 /* ------------------------------------------------------------------------- */
34 /* Math Configuration */

NetBurner, Inc.
926 File Documentation

35 /* ------------------------------------------------------------------------- */
36 #undef SIZEOF_LONG_LONG
37 #define SIZEOF_LONG_LONG 8
38
39 #undef USE_FAST_MATH
40 #if 1
41 #define USE_FAST_MATH
42
43 #undef TFM_TIMING_RESISTANT
44 #define TFM_TIMING_RESISTANT
45
46 /* Optimizations */
47 //#define TFM_ARM
48 #endif
49
50 /* Wolf Single Precision Math */
51 #undef WOLFSSL_SP
52 #if 0
53 #define WOLFSSL_SP
54 #define WOLFSSL_SP_SMALL /* use smaller version of code */
55 #define WOLFSSL_HAVE_SP_RSA
56 #define WOLFSSL_HAVE_SP_DH
57 #define WOLFSSL_HAVE_SP_ECC
58 #define WOLFSSL_SP_CACHE_RESISTANT
59 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
60
61 /* 64 or 32 bit version */
62 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
63 //#define WOLFSSL_SP_ARM32_ASM
64 //#define WOLFSSL_SP_ARM64_ASM
65 #endif
66
67 /* ------------------------------------------------------------------------- */
68 /* FIPS - Requires eval or license from wolfSSL */
69 /* ------------------------------------------------------------------------- */
70 #undef HAVE_FIPS
71 #if 0
72 #define HAVE_FIPS
73
74 #undef HAVE_FIPS_VERSION
75 #define HAVE_FIPS_VERSION 2
76
77 #ifdef SINGLE_THREADED
78 #undef NO_THREAD_LS
79 #define NO_THREAD_LS
80 #endif
81 #endif
82
83 /* ------------------------------------------------------------------------- */
84 /* Crypto */
85 /* ------------------------------------------------------------------------- */
86 /* RSA */
87 #undef NO_RSA
88 #if 1
89 #ifdef USE_FAST_MATH
90 /* Maximum math bits (Max RSA key bits * 2) */
91 #undef FP_MAX_BITS
92 #define FP_MAX_BITS 8192
93 #endif
94
95 /* half as much memory but twice as slow */
96 #undef RSA_LOW_MEM
97 //#define RSA_LOW_MEM
98
99 /* Enables blinding mode, to prevent timing attacks */
100 #if 1
101 #undef WC_RSA_BLINDING
102 #define WC_RSA_BLINDING
103 #else
104 #undef WC_NO_HARDEN
105 #define WC_NO_HARDEN
106 #endif
107
108 /* RSA PSS Support */
109 #if 1
110 #define WC_RSA_PSS
111 #endif
112
113 #if 1
114 #define WC_RSA_NO_PADDING
115 #endif
116 #else
117 #define NO_RSA
118 #endif
119
120 /* ECC */
121 #undef HAVE_ECC

NetBurner, Inc.
22.183 IC_D20/user_settings.h 927

122 #if 1
123 #define HAVE_ECC
124
125 // Manually add support for curves.
126 #undef ECC_USER_CURVES
127 #define ECC_USER_CURVES
128
129 #ifdef ECC_USER_CURVES
130 /* Manual Curve Selection */
131 #define HAVE_ECC192 // For WolfSSL
132 #define HAVE_ECC224 // For WolfSSL
133 #undef NO_ECC256
134
135 // Added for specific curve support for WolfSSH
136 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
137 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
138 #define ECC192
139 #define ECC224
140 #undef NO_ECC_SECP
141 #define HAVE_ECC_SECPR2
142 #define HAVE_ECC_SECPR3
143
144 #ifdef ENABLE_ECC384 // predef.h
145 #define HAVE_ECC384 // - Disabled until we can get better performance
146 #endif
147
148 #ifdef ENABLE_ECC521 // predef.h
149 #define HAVE_ECC521 // - Disabled until we can get better performance
150 #endif
151
152 #ifdef ENABLE_ED25519 // predef.h
153 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
154 #define HAVE_CURVE25519
155
156 /* Optionally use small math (less flash usage, but much slower) */
157 //#define CURVED25519_SMALL
158 #endif
159 #endif
160
161 /* Fixed point cache (speeds repeated operations against same private key) */
162 #undef FP_ECC
163 #define FP_ECC
164 #ifdef FP_ECC
165 /* Bits / Entries */
166 #undef FP_ENTRIES
167 #define FP_ENTRIES 15
168 #undef FP_LUT
169 #define FP_LUT 4
170 #endif
171
172 /* Optional ECC calculation method */
173 /* Note: doubles heap usage, but slightly faster */
174 #undef ECC_SHAMIR
175 #define ECC_SHAMIR
176
177 /* Reduces heap usage, but slower */
178 #undef ECC_TIMING_RESISTANT
179 //#define ECC_TIMING_RESISTANT // - Disabled for performance
180
181 /* Enable cofactor support */
182 #ifdef HAVE_FIPS
183 #undef HAVE_ECC_CDH
184 #define HAVE_ECC_CDH
185 #endif
186
187 /* Validate import */
188 #ifdef HAVE_FIPS
189 #undef WOLFSSL_VALIDATE_ECC_IMPORT
190 #define WOLFSSL_VALIDATE_ECC_IMPORT
191 #endif
192
193 /* Compressed Key Support */
194 #undef HAVE_COMP_KEY
195 //#define HAVE_COMP_KEY
196
197 /* Use alternate ECC size for ECC math */
198 #ifdef USE_FAST_MATH
199 #ifdef NO_RSA
200 /* Custom fastmath size if not using RSA */
201 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
202 #undef FP_MAX_BITS
203 #define FP_MAX_BITS (256 + 32)
204 #else
205 #undef ALT_ECC_SIZE
206 #define ALT_ECC_SIZE
207 #endif
208

NetBurner, Inc.
928 File Documentation

209 /* Speedups specific to curve */


210 #ifndef NO_ECC256
211 #undef TFM_ECC256
212 #define TFM_ECC256
213 #endif
214 #endif
215 #endif
216
217 /* DH */
218 #undef NO_DH
219 #if 1
220 /* Use table for DH instead of -lm (math) lib dependency */
221 #if 1
222 #define WOLFSSL_DH_CONST
223 #define HAVE_FFDHE_2048
224 #define HAVE_FFDHE_4096
225 //#define HAVE_FFDHE_6144
226 //#define HAVE_FFDHE_8192
227 #endif
228
229 #ifdef HAVE_FIPS
230 #define WOLFSSL_VALIDATE_FFC_IMPORT
231 #define HAVE_FFDHE_Q
232 #endif
233 #else
234 #define NO_DH
235 #endif
236
237 /* AES */
238 #undef NO_AES
239 #if 1
240 #undef HAVE_AES_CBC
241 #define HAVE_AES_CBC
242
243 #undef HAVE_AESGCM
244 #define HAVE_AESGCM
245
246 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
247 #define GCM_SMALL
248
249 #undef WOLFSSL_AES_DIRECT
250 //#define WOLFSSL_AES_DIRECT
251
252 #undef HAVE_AES_ECB
253 //#define HAVE_AES_ECB
254
255 #undef WOLFSSL_AES_COUNTER
256 //#define WOLFSSL_AES_COUNTER
257
258 #undef HAVE_AESCCM
259 #define HAVE_AESCCM
260 #else
261 #define NO_AES
262 #endif
263
264 /* DES3 */
265 #undef NO_DES3
266 #if 1
267 #else
268 #define NO_DES3
269 #endif
270
271 /* ChaCha20 / Poly1305 */
272 //#undef HAVE_CHACHA
273 //#undef HAVE_POLY1305
274 //#if 0
275 #define HAVE_CHACHA
276 #define HAVE_POLY1305
277
278 /* Needed for Poly1305 */
279 #undef HAVE_ONE_TIME_AUTH
280 #define HAVE_ONE_TIME_AUTH
281 //#endif
282
283 /* Ed25519 / Curve25519 */
284 //#undef HAVE_CURVE25519
285 //#undef HAVE_ED25519
286 //#if 0
287 #define HAVE_CURVE25519
288 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
289
290 /* Optionally use small math (less flash usage, but much slower) */
291 #if 1
292 #define CURVED25519_SMALL
293 #endif
294 //#endif
295

NetBurner, Inc.
22.183 IC_D20/user_settings.h 929

296 /* ------------------------------------------------------------------------- */
297 /* Hashing */
298 /* ------------------------------------------------------------------------- */
299 /* Sha */
300 //#undef WOLFSSL_STATIC_RSA
301 #if 1
302 /* 1k smaller, but 25% slower */
303 //#define USE_SLOW_SHA
304 #else
305 #define NO_SHA
306 #endif
307
308 /* Sha256 */
309 #undef NO_SHA256
310 #if 1
311 /* not unrolled - ~2k smaller and ~25% slower */
312 //#define USE_SLOW_SHA256
313
314 /* Sha224 */
315 #if 0
316 #define WOLFSSL_SHA224
317 #endif
318 #else
319 #define NO_SHA256
320 #endif
321
322 /* Sha512 */
323 //#undef WOLFSSL_SHA512
324 //#if 0
325 #define WOLFSSL_SHA512
326
327 /* Sha384 */
328 //#undef WOLFSSL_SHA384
329 //#if 0
330 #define WOLFSSL_SHA384
331 //#endif
332
333 /* over twice as small, but 50% slower */
334 //#define USE_SLOW_SHA512
335 //#endif
336
337 /* Sha3 */
338 #undef WOLFSSL_SHA3
339 #if 0
340 #define WOLFSSL_SHA3
341 #endif
342
343 /* MD5 */
344 #undef NO_MD5
345 #if 0
346
347 #else
348 #define NO_MD5
349 #endif
350
351 /* HKDF */
352 #undef HAVE_HKDF
353 #if 1
354 #define HAVE_HKDF
355 #endif
356
357 /* CMAC */
358 #undef WOLFSSL_CMAC
359 #if 0
360 #define WOLFSSL_CMAC
361 #endif
362
363 /* ------------------------------------------------------------------------- */
364 /* Benchmark / Test */
365 /* ------------------------------------------------------------------------- */
366 /* Use reduced benchmark / test sizes */
367 #undef BENCH_EMBEDDED
368 //#define BENCH_EMBEDDED
369
370 #undef USE_CERT_BUFFERS_2048
371 //#define USE_CERT_BUFFERS_2048
372
373 #undef USE_CERT_BUFFERS_1024
374 //#define USE_CERT_BUFFERS_1024
375
376 #undef USE_CERT_BUFFERS_256
377 //#define USE_CERT_BUFFERS_256
378
379 /* ------------------------------------------------------------------------- */
380 /* Debugging */
381 /* ------------------------------------------------------------------------- */
382

NetBurner, Inc.
930 File Documentation

383 #undef DEBUG_WOLFSSL


384 #undef NO_ERROR_STRINGS
385 #if 0
386 #define DEBUG_WOLFSSL
387 #else
388 #if 0
389 #define NO_ERROR_STRINGS
390 #endif
391 #endif
392
393 /* ------------------------------------------------------------------------- */
394 /* Memory */
395 /* ------------------------------------------------------------------------- */
396
397 /* Override Memory API’s */
398 #if 0
399 #undef XMALLOC_OVERRIDE
400 #define XMALLOC_OVERRIDE
401
402 /* prototypes for user heap override functions */
403 /* Note: Realloc only required for normal math */
404 #include <stddef.h> /* for size_t */
405 extern void *myMalloc(size_t n, void* heap, int type);
406 extern void myFree(void *p, void* heap, int type);
407 extern void *myRealloc(void *p, size_t n, void* heap, int type);
408
409 #define XMALLOC(n, h, t) myMalloc(n, h, t)
410 #define XFREE(p, h, t) myFree(p, h, t)
411 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
412 #endif
413
414 #if 0
415 /* Static memory requires fast math */
416 #define WOLFSSL_STATIC_MEMORY
417
418 /* Disable fallback malloc/free */
419 #define WOLFSSL_NO_MALLOC
420 #if 1
421 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
422 #endif
423 #endif
424
425 /* Memory callbacks */
426 #if 0
427 #undef USE_WOLFSSL_MEMORY
428 #define USE_WOLFSSL_MEMORY
429
430 /* Use this to measure / print heap usage */
431 #if 1
432 #undef WOLFSSL_TRACK_MEMORY
433 #define WOLFSSL_TRACK_MEMORY
434
435 #undef WOLFSSL_DEBUG_MEMORY
436 #define WOLFSSL_DEBUG_MEMORY
437 #endif
438 #else
439 #ifndef WOLFSSL_STATIC_MEMORY
440 #define NO_WOLFSSL_MEMORY
441 /* Otherwise we will use stdlib malloc, free and realloc */
442 #endif
443 #endif
444
445 /* ------------------------------------------------------------------------- */
446 /* Port */
447 /* ------------------------------------------------------------------------- */
448
449 /* Override Current Time */
450 /* Allows custom "custom_time()" function to be used for benchmark */
451 #define WOLFSSL_USER_CURRTIME
452 #define WOLFSSL_GMTIME
453 #define USER_TICKS
454 #include <time.h>
455 extern unsigned long my_time(time_t *timer);
456 #define XTIME my_time
457
458 /* ------------------------------------------------------------------------- */
459 /* RNG */
460 /* ------------------------------------------------------------------------- */
461
462 /* Seed Source */
463 /* Size of returned HW RNG value */
464 #define CUSTOM_RAND_TYPE unsigned int
465 extern unsigned int my_rng_seed_gen(void);
466 #undef CUSTOM_RAND_GENERATE
467 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
468
469 // NetBurner specific define for enabling hardware random number generation for M7

NetBurner, Inc.
22.183 IC_D20/user_settings.h 931

470 #define GATHER_RANDOM_USE_HW


471
472 /* Choose RNG method */
473 #if 1
474 /* Use built-in P-RNG (SHA256 based) with HW RNG */
475 /* P-RNG + HW RNG (P-RNG is ~8K) */
476 #undef HAVE_HASHDRBG
477 //#define HAVE_HASHDRBG
478 #else
479 #undef WC_NO_HASHDRBG
480 #define WC_NO_HASHDRBG
481
482 /* Bypass P-RNG and use only HW RNG */
483 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
484 #undef CUSTOM_RAND_GENERATE_BLOCK
485 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
486 #endif
487
488 /* ------------------------------------------------------------------------- */
489 /* Custom Standard Lib */
490 /* ------------------------------------------------------------------------- */
491 /* Allows override of all standard library functions */
492 #undef STRING_USER
493 #if 0
494 #define STRING_USER
495
496 #include <string.h>
497
498 #undef USE_WOLF_STRSEP
499 #define USE_WOLF_STRSEP
500 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
501
502 #undef USE_WOLF_STRTOK
503 #define USE_WOLF_STRTOK
504 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
505
506 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
507
508 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
509 #define XMEMSET(b, c, l) memset((b), (c), (l))
510 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
511 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
512
513 #define XSTRLEN(s1) strlen((s1))
514 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
515 #define XSTRSTR(s1, s2) strstr((s1), (s2))
516
517 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
518 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
519 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
520
521 #define XSNPRINTF snprintf
522 #endif
523
524 /* ------------------------------------------------------------------------- */
525 /* Enable Features */
526 /* ------------------------------------------------------------------------- */
527 #undef WOLFSSL_TLS13
528 #if 0
529 #define WOLFSSL_TLS13
530 #endif
531
532 #undef WOLFSSL_KEY_GEN
533 #if 0
534 #define WOLFSSL_KEY_GEN
535 #endif
536
537 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
538 #define WOLFSSL_OLD_PRIME_CHECK
539 #endif
540
541 #undef KEEP_PEER_CERT
542 #define KEEP_PEER_CERT
543
544 #undef HAVE_COMP_KEY
545 //#define HAVE_COMP_KEY
546
547 #undef HAVE_TLS_EXTENSIONS
548 #define HAVE_TLS_EXTENSIONS
549
550 #undef HAVE_SUPPORTED_CURVES
551 #define HAVE_SUPPORTED_CURVES
552
553 #undef WOLFSSL_BASE64_ENCODE
554 #define WOLFSSL_BASE64_ENCODE
555
556 #define SMALL_SESSION_CACHE

NetBurner, Inc.
932 File Documentation

557 #define HAVE_SESSION_TICKET


558
559 /* ------------------------------------------------------------------------- */
560 /* Disable Features */
561 /* ------------------------------------------------------------------------- */
562 #undef NO_WOLFSSL_SERVER
563 //#define NO_WOLFSSL_SERVER
564
565 #undef NO_WOLFSSL_CLIENT
566 //#define NO_WOLFSSL_CLIENT
567
568 #undef NO_CRYPT_TEST
569 //#define NO_CRYPT_TEST
570
571 #undef NO_CRYPT_BENCHMARK
572 //#define NO_CRYPT_BENCHMARK
573
574 #undef WOLFCRYPT_ONLY
575 //#define WOLFCRYPT_ONLY
576
577 /* In-lining of misc.c functions */
578 /* If defined, must include wolfcrypt/src/misc.c in build */
579 /* Slower, but about 1k smaller */
580 #undef NO_INLINE
581 //#define NO_INLINE
582
583 #undef WOLFSSL_NO_SOCK
584 #define WOLFSSL_NO_SOCK
585
586 #undef NO_WOLFSSL_DIR
587 #define NO_WOLFSSL_DIR
588
589 #undef NO_FILESYSTEM
590 #define NO_FILESYSTEM
591
592 #undef NO_WRITEV
593 #define NO_WRITEV
594
595 #undef NO_MAIN_DRIVER
596 #define NO_MAIN_DRIVER
597
598 #undef NO_DEV_RANDOM
599 #define NO_DEV_RANDOM
600
601 #undef NO_DSA
602 #define NO_DSA
603
604 #undef NO_RC4
605 //#define NO_RC4
606
607 #undef NO_OLD_TLS
608 #define NO_OLD_TLS
609
610 #undef NO_HC128
611 #define NO_HC128
612
613 #undef NO_RABBIT
614 #define NO_RABBIT
615
616 #undef NO_PSK
617 #define NO_PSK
618
619 #undef NO_MD4
620 #define NO_MD4
621
622 #undef NO_PWDBASED
623 #define NO_PWDBASED
624
625 #undef NO_CODING
626 //#define NO_CODING
627
628 #undef NO_ASN_TIME
629 //#define NO_ASN_TIME
630
631 #undef NO_CERTS
632 //#define NO_CERTS
633
634 #undef NO_SIG_WRAPPER
635 //#define NO_SIG_WRAPPER
636
637 #undef WOLFSSL_IGNORE_FILE_WARN
638 #define WOLFSSL_IGNORE_FILE_WARN
639
640 #undef NO_TLS
641
642 #define HAVE_SNI
643

NetBurner, Inc.
22.184 MOD5441X/user_settings.h 933

644 // Settings made for compatibility


645 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
646 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
647 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
648 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
649
650 #define WOLFSSL_CERT_REQ
651 #define WOLFSSL_CERT_GEN
652 #define WOLFSSL_ALT_NAMES
653 #define WOLFSSL_DER_TO_PEM
654 #define WOLFSSL_KEY_GEN
655
656 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
657 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
658
659 // For wolfSSH
660 //#undef WOLFSSH_SFTP
661 //#define WOLFSSH_SFTP
662
663 //#undef WOLFSSH_SCP
664 //#define WOLFSSH_SCP
665
666 #undef WOLFSSH_USER_IO
667 #define WOLFSSH_USER_IO
668
669 #ifdef __cplusplus
670 }
671 #endif
672
673 #endif /* WOLFSSL_USER_SETTINGS_H */

22.184 MOD5441X/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 /* Default build with fast math */
11
12 // uncomment and add wolfSSL_Debugging_ON() to app for debug messages
13 #undef DEBUG_WOLFSSL
14 #undef NO_ERROR_STRINGS
15 //#define DEBUG_WOLFSSL
16
17 #include <predef.h>
18 #include <endian.h>
19 #define XHTONS(a) __htons(a)
20
21 //#define WOLFSSL_CALLBACKS
22
23 //#define NO_TIMEVAL
24
25 /* ------------------------------------------------------------------------- */
26 /* Platform */
27 /* ------------------------------------------------------------------------- */
28
29 /* Properly sets endian order and data type sizes */
30 #define BIG_ENDIAN_ORDER
31
32 #undef SINGLE_THREADED
33
34 // We provide IO callbacks
35 #define WOLFSSL_USER_IO
36
37 /* ------------------------------------------------------------------------- */
38 /* Math Configuration */
39 /* ------------------------------------------------------------------------- */
40 #ifndef SIZEOF_LONG
41 #define SIZEOF_LONG 4
42 #endif
43 #ifndef SIZEOF_LONG_LONG
44 #define SIZEOF_LONG_LONG 8
45 #endif
46
47 #define ULLONG_MAX 4294967295UL
48 #define SP_WORD_SIZE 16
49
50 #define WOLFSSL_SP
51 #define WOLFSSL_SP_SMALL

NetBurner, Inc.
934 File Documentation

52
53 #define USE_FAST_MATH
54 #define WOLFSSL_SMALL_STACK
55
56 /* hardening against side channel attacks */
57 #if defined(USE_FAST_MATH)
58 #define TFM_TIMING_RESISTANT
59 #endif /* USE_FAST_MATH */
60
61 /* enable features - added to match MODM7AE70 */
62
63 // additional RSA padding schemes
64 #undef NO_RSA
65 #ifndef NO_RSA
66 #if defined(USE_FAST_MATH)
67 /* Maximum math bits (Max RSA key bits * 2) */
68 #undef FP_MAX_BITS
69 #ifdef ENABLE_RSA_4K // predef.h
70 #define FP_MAX_BITS 8192
71 #else
72 #define FP_MAX_BITS 4096
73 #endif
74 #endif
75
76 /* this slows down RSA operations but increases side channel resistance */
77 #define WC_RSA_BLINDING
78
79 /* RSA PSS Support */
80 #define WC_RSA_NO_PADDING
81 #define WC_RSA_PSS
82 #endif
83
84 #undef NO_AES
85 #ifndef NO_AES
86 #define HAVE_AES_CBC
87 #define HAVE_AESGCM
88 #define GCM_SMALL
89 #define HAVE_AESCCM
90 #endif
91
92 #define HAVE_ECC
93 #ifdef HAVE_ECC
94 #undef ECC_TIMING_RESISTANT
95 //#define ECC_TIMING_RESISTANT // Currently disabled for performance
96
97 // Manually add support for curves.
98 #undef ECC_USER_CURVES
99 #define ECC_USER_CURVES
100
101 #ifdef ECC_USER_CURVES
102 /* Manual Curve Selection */
103 #define HAVE_ECC192 // For WolfSSL
104 #define HAVE_ECC224 // For WolfSSL
105 #undef NO_ECC256
106
107 // Added for specific curve support for WolfSSH
108 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
109 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
110 #define ECC192
111 #define ECC224
112 #undef NO_ECC_SECP
113 #define HAVE_ECC_SECPR2
114 #define HAVE_ECC_SECPR3
115
116 #ifdef ENABLE_ECC384 // predef.h
117 #define HAVE_ECC384 // - Disabled until we can get better performance
118 #endif
119
120 #ifdef ENABLE_ECC521 // predef.h
121 #define HAVE_ECC521 // - Disabled until we can get better performance
122 #endif
123
124 #ifdef ENABLE_ED25519 // predef.h
125 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
126 #define HAVE_CURVE25519
127
128 /* Optionally use small math (less flash usage, but much slower) */
129 //#define CURVED25519_SMALL
130 #endif
131 #endif
132
133 /* Fixed point cache (speeds repeated operations against same private key) */
134 #undef FP_ECC
135 #define FP_ECC
136 #ifdef FP_ECC
137 /* Bits / Entries */
138 #undef FP_ENTRIES

NetBurner, Inc.
22.184 MOD5441X/user_settings.h 935

139 #define FP_ENTRIES 15


140 #undef FP_LUT
141 #define FP_LUT 4
142 #endif
143
144 #define ECC_SHAMIR
145
146 #if defined(USE_FAST_MATH)
147 #define ALT_ECC_SIZE
148 #endif
149
150 #ifndef NO_ECC256
151 #define TFM_ECC256
152 #endif
153 #endif
154
155 /* DH */
156 #undef NO_DH
157 #if 1
158 /* Use table for DH instead of -lm (math) lib dependency */
159 #if 1
160 #define WOLFSSL_DH_CONST
161 #define HAVE_FFDHE_2048
162 #ifdef ENABLE_RSA_4K
163 #define HAVE_FFDHE_4096
164 #endif
165 //#define HAVE_FFDHE_6144
166 //#define HAVE_FFDHE_8192
167 #endif
168
169 #ifdef HAVE_FIPS
170 #define WOLFSSL_VALIDATE_FFC_IMPORT
171 #define HAVE_FFDHE_Q
172 #endif
173 #else
174 #define NO_DH
175 #endif
176
177 /* AES */
178 #undef NO_AES
179 #if 1
180 #undef HAVE_AES_CBC
181 #define HAVE_AES_CBC
182
183 #undef HAVE_AESGCM
184 #define HAVE_AESGCM
185
186 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
187 #define GCM_SMALL
188
189 #undef WOLFSSL_AES_DIRECT
190 //#define WOLFSSL_AES_DIRECT
191
192 #undef HAVE_AES_ECB
193 //#define HAVE_AES_ECB
194
195 #undef WOLFSSL_AES_COUNTER
196 //#define WOLFSSL_AES_COUNTER
197
198 #undef HAVE_AESCCM
199 #define HAVE_AESCCM
200 #else
201 #define NO_AES
202 #endif
203
204 #define HAVE_CHACHA
205 #define HAVE_POLY1305
206 #define HAVE_ONE_TIME_AUTH
207
208 /* Hashing */
209
210 #undef NO_SHA256
211 #define WOLFSSL_SHA512
212 #define WOLFSSL_SHA384
213 #undef WOLFSSL_SHA3
214 #define NO_MD5
215 #undef HAVE_HKDF
216 #define HAVE_HKDF
217 #undef WOLFSSL_CMAC
218
219 /* ------------------------------------------------------------------------- */
220 /* Port */
221 /* ------------------------------------------------------------------------- */
222
223 /* Override Current Time */
224 /* Allows custom "custom_time()" function to be used for benchmark */
225 #define WOLFSSL_USER_CURRTIME

NetBurner, Inc.
936 File Documentation

226 #define HAVE_GMTIME_R


227 //#define WOLFSSL_GMTIME
228 #define USER_TICKS
229 #include <time.h>
230 extern unsigned long my_time(time_t *timer);
231 #define XTIME my_time
232
233 /* ------------------------------------------------------------------------- */
234 /* RNG */
235 /* ------------------------------------------------------------------------- */
236
237 /* Seed Source */
238 /* Size of returned HW RNG value */
239 #define CUSTOM_RAND_TYPE unsigned int
240 extern unsigned int my_rng_seed_gen(void);
241 #undef CUSTOM_RAND_GENERATE
242 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
243
244 // From MODM7 User Settings
245 /* ------------------------------------------------------------------------- */
246 /* Enable Features */
247 /* ------------------------------------------------------------------------- */
248 #undef WOLFSSL_TLS13
249 #if 1
250 #define WOLFSSL_TLS13
251 #endif
252
253 #define KEEP_PEER_CERT
254
255 #undef HAVE_COMP_KEY
256 //#define HAVE_COMP_KEY
257
258 #define HAVE_TLS_EXTENSIONS
259
260 #define HAVE_SUPPORTED_CURVES
261
262 #define WOLFSSL_BASE64_ENCODE
263
264 #define SMALL_SESSION_CACHE
265 #define HAVE_SESSION_TICKET
266
267 /* ------------------------------------------------------------------------- */
268 /* Disable Features */
269 /* ------------------------------------------------------------------------- */
270 #undef NO_WOLFSSL_SERVER
271 //#define NO_WOLFSSL_SERVER
272
273 #undef NO_WOLFSSL_CLIENT
274 //#define NO_WOLFSSL_CLIENT
275
276 #undef NO_CRYPT_TEST
277 //#define NO_CRYPT_TEST
278
279 #undef NO_CRYPT_BENCHMARK
280 //#define NO_CRYPT_BENCHMARK
281
282 #undef WOLFCRYPT_ONLY
283 //#define WOLFCRYPT_ONLY
284
285 //#define WOLFSSL_STATIC_MEMORY
286 #ifndef WOLFSSL_STATIC_MEMORY
287 #define NO_WOLFSSL_MEMORY
288 #endif
289
290 #undef STRING_USER
291
292 /* In-lining of misc.c functions */
293 /* If defined, must include wolfcrypt/src/misc.c in build */
294 /* Slower, but about 1k smaller */
295 #undef NO_INLINE
296 //#define NO_INLINE
297
298 #undef WOLFSSL_NO_SOCK
299 #define WOLFSSL_NO_SOCK
300
301 #undef NO_WOLFSSL_DIR
302 #define NO_WOLFSSL_DIR
303
304 #undef NO_FILESYSTEM
305 #define NO_FILESYSTEM
306
307 #undef NO_WRITEV
308 #define NO_WRITEV
309
310 #undef NO_MAIN_DRIVER
311 #define NO_MAIN_DRIVER
312

NetBurner, Inc.
22.185 MODM7AE70/user_settings.h 937

313 #undef NO_DEV_RANDOM


314 #define NO_DEV_RANDOM
315
316 #undef NO_DSA
317 #define NO_DSA
318
319 #undef NO_RC4
320 //#define NO_RC4
321
322 #undef NO_OLD_TLS
323 #define NO_OLD_TLS
324
325 #undef NO_HC128
326 #define NO_HC128
327
328 #undef NO_RABBIT
329 #define NO_RABBIT
330
331 #undef NO_PSK
332 #define NO_PSK
333
334 #undef NO_MD4
335 #define NO_MD4
336
337 #undef NO_PWDBASED
338 #define NO_PWDBASED
339
340 #undef NO_CODING
341 //#define NO_CODING
342
343 #undef NO_ASN_TIME
344 //#define NO_ASN_TIME
345
346 #undef NO_CERTS
347 //#define NO_CERTS
348
349 #undef NO_SIG_WRAPPER
350 //#define NO_SIG_WRAPPER
351
352 #undef WOLFSSL_IGNORE_FILE_WARN
353 #define WOLFSSL_IGNORE_FILE_WARN
354
355 #undef NO_TLS
356
357 #undef NO_DES3
358
359 #undef NO_DH
360
361 #define HAVE_SNI
362
363 // Settings made for compatibility
364 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
365 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
366 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
367 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
368
369 #define WOLFSSL_CERT_REQ
370 #define WOLFSSL_CERT_GEN
371 #define WOLFSSL_ALT_NAMES
372 #define WOLFSSL_DER_TO_PEM
373 #define WOLFSSL_KEY_GEN
374
375 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
376 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
377
378 // For wolfSSH
379 //#undef WOLFSSH_SFTP
380 //#define WOLFSSH_SFTP
381
382 //#undef WOLFSSH_SCP
383 //#define WOLFSSH_SCP
384
385 #undef WOLFSSH_USER_IO
386 #define WOLFSSH_USER_IO
387
388 #ifdef __cplusplus
389 }
390 #endif
391
392 #endif /* USER_SETTINGS_H */

22.185 MODM7AE70/user_settings.h
1 /* user_settings.h

NetBurner, Inc.
938 File Documentation

2 *
3 * Copyright (C) 2006-2019 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* Custom wolfSSL user settings for GCC ARM */
13
14 #ifndef USER_SETTINGS_H
15 #define USER_SETTINGS_H
16
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif
21
22 //#define DEBUG_WOLFSSL
23
24 #include <predef.h>
25 #define XHTONS(a) __htons(a)
26
27 /* ------------------------------------------------------------------------- */
28 /* Platform */
29 /* ------------------------------------------------------------------------- */
30 #undef WOLFSSL_GENERAL_ALIGNMENT
31 #define WOLFSSL_GENERAL_ALIGNMENT 4
32
33 #undef SINGLE_THREADED
34 //#define SINGLE_THREADED
35
36 #undef WOLFSSL_SMALL_STACK
37 #define WOLFSSL_SMALL_STACK
38
39 #undef WOLFSSL_USER_IO
40 #define WOLFSSL_USER_IO
41
42 /* ------------------------------------------------------------------------- */
43 /* Math Configuration */
44 /* ------------------------------------------------------------------------- */
45 #undef SIZEOF_LONG_LONG
46 #define SIZEOF_LONG_LONG 8
47
48 #undef USE_FAST_MATH
49 #if 1
50 #define USE_FAST_MATH
51
52 #undef TFM_TIMING_RESISTANT
53 #define TFM_TIMING_RESISTANT
54
55 /* Optimizations */
56 //#define TFM_ARM
57 #endif
58
59 #define ULLONG_MAX 4294967295UL
60 #define SP_WORD_SIZE 16
61
62 #define WOLFSSL_SP
63 #define WOLFSSL_SP_SMALL
64
65 /* Wolf Single Precision Math */
66 //#undef WOLFSSL_SP
67 #if 0
68 #define WOLFSSL_SP
69 #define WOLFSSL_SP_SMALL /* use smaller version of code */
70 #define WOLFSSL_HAVE_SP_RSA
71 #define WOLFSSL_HAVE_SP_DH
72 #define WOLFSSL_HAVE_SP_ECC
73 #define WOLFSSL_SP_CACHE_RESISTANT
74 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
75
76 /* 64 or 32 bit version */
77 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
78 //#define WOLFSSL_SP_ARM32_ASM
79 //#define WOLFSSL_SP_ARM64_ASM
80 #endif
81
82 /* ------------------------------------------------------------------------- */
83 /* FIPS - Requires eval or license from wolfSSL */
84 /* ------------------------------------------------------------------------- */
85 #undef HAVE_FIPS
86 #if 0
87 #define HAVE_FIPS
88

NetBurner, Inc.
22.185 MODM7AE70/user_settings.h 939

89 #undef HAVE_FIPS_VERSION
90 #define HAVE_FIPS_VERSION 2
91
92 #ifdef SINGLE_THREADED
93 #undef NO_THREAD_LS
94 #define NO_THREAD_LS
95 #endif
96 #endif
97
98 /* ------------------------------------------------------------------------- */
99 /* Crypto */
100 /* ------------------------------------------------------------------------- */
101 /* RSA */
102 #undef NO_RSA
103 #if 1
104 #ifdef USE_FAST_MATH
105 /* Maximum math bits (Max RSA key bits * 2) */
106 #undef FP_MAX_BITS
107 #ifdef ENABLE_RSA_4K // predef.h
108 #define FP_MAX_BITS 8192
109 #else
110 #define FP_MAX_BITS 4096
111 #endif
112 #endif
113
114 /* half as much memory but twice as slow */
115 #undef RSA_LOW_MEM
116 //#define RSA_LOW_MEM
117
118 /* Enables blinding mode, to prevent timing attacks */
119 #if 1
120 #undef WC_RSA_BLINDING
121 #define WC_RSA_BLINDING
122 #else
123 #undef WC_NO_HARDEN
124 #define WC_NO_HARDEN
125 #endif
126
127 /* RSA PSS Support */
128 #if 1
129 #define WC_RSA_PSS
130 #endif
131
132 #if 1
133 #define WC_RSA_NO_PADDING
134 #endif
135 #else
136 #define NO_RSA
137 #endif
138
139 /* ECC */
140 #undef HAVE_ECC
141 #if 1
142 #define HAVE_ECC
143
144 // Manually add support for curves.
145 #undef ECC_USER_CURVES
146 #define ECC_USER_CURVES
147
148 #ifdef ECC_USER_CURVES
149 /* Manual Curve Selection */
150 #define HAVE_ECC192 // For WolfSSL
151 #define HAVE_ECC224 // For WolfSSL
152 #undef NO_ECC256
153
154 // Added for specific curve support for WolfSSH
155 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
156 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
157 #define ECC192
158 #define ECC224
159 #undef NO_ECC_SECP
160 #define HAVE_ECC_SECPR2
161 #define HAVE_ECC_SECPR3
162
163 #ifdef ENABLE_ECC384 // predef.h
164 #define HAVE_ECC384 // - Disabled until we can get better performance
165 #endif
166
167 #ifdef ENABLE_ECC521 // predef.h
168 #define HAVE_ECC521 // - Disabled until we can get better performance
169 #endif
170
171 #ifdef ENABLE_ED25519 // predef.h
172 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
173 #define HAVE_CURVE25519
174
175 /* Optionally use small math (less flash usage, but much slower) */

NetBurner, Inc.
940 File Documentation

176 //#define CURVED25519_SMALL


177 #endif
178 #endif
179
180 /* Fixed point cache (speeds repeated operations against same private key) */
181 #undef FP_ECC
182 #define FP_ECC
183 #ifdef FP_ECC
184 /* Bits / Entries */
185 #undef FP_ENTRIES
186 #define FP_ENTRIES 15
187 #undef FP_LUT
188 #define FP_LUT 4
189 #endif
190
191 /* Optional ECC calculation method */
192 /* Note: doubles heap usage, but slightly faster */
193 #undef ECC_SHAMIR
194 #define ECC_SHAMIR
195
196 /* Reduces heap usage, but slower */
197 #undef ECC_TIMING_RESISTANT
198 //#define ECC_TIMING_RESISTANT // - Disabled for performance
199
200 /* Enable cofactor support */
201 #ifdef HAVE_FIPS
202 #undef HAVE_ECC_CDH
203 #define HAVE_ECC_CDH
204 #endif
205
206 /* Validate import */
207 #ifdef HAVE_FIPS
208 #undef WOLFSSL_VALIDATE_ECC_IMPORT
209 #define WOLFSSL_VALIDATE_ECC_IMPORT
210 #endif
211
212 /* Compressed Key Support */
213 #undef HAVE_COMP_KEY
214 //#define HAVE_COMP_KEY
215
216 /* Use alternate ECC size for ECC math */
217 #ifdef USE_FAST_MATH
218 #ifdef NO_RSA
219 /* Custom fastmath size if not using RSA */
220 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
221 #undef FP_MAX_BITS
222 #define FP_MAX_BITS (256 + 32)
223 #else
224 #undef ALT_ECC_SIZE
225 #define ALT_ECC_SIZE
226 #endif
227
228 /* Speedups specific to curve */
229 #ifndef NO_ECC256
230 #undef TFM_ECC256
231 #define TFM_ECC256
232 #endif
233 #endif
234 #endif
235
236 /* DH */
237 #undef NO_DH
238 #if 1
239 /* Use table for DH instead of -lm (math) lib dependency */
240 #if 1
241 #define WOLFSSL_DH_CONST
242 #define HAVE_FFDHE_2048
243 #ifdef ENABLE_RSA_4K
244 #define HAVE_FFDHE_4096
245 #endif
246 //#define HAVE_FFDHE_6144
247 //#define HAVE_FFDHE_8192
248 #endif
249
250 #ifdef HAVE_FIPS
251 #define WOLFSSL_VALIDATE_FFC_IMPORT
252 #define HAVE_FFDHE_Q
253 #endif
254 #else
255 #define NO_DH
256 #endif
257
258 /* AES */
259 #undef NO_AES
260 #if 1
261 #undef HAVE_AES_CBC
262 #define HAVE_AES_CBC

NetBurner, Inc.
22.185 MODM7AE70/user_settings.h 941

263
264 #undef HAVE_AESGCM
265 #define HAVE_AESGCM
266
267 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
268 #define GCM_SMALL
269
270 #undef WOLFSSL_AES_DIRECT
271 //#define WOLFSSL_AES_DIRECT
272
273 #undef HAVE_AES_ECB
274 //#define HAVE_AES_ECB
275
276 #undef WOLFSSL_AES_COUNTER
277 //#define WOLFSSL_AES_COUNTER
278
279 #undef HAVE_AESCCM
280 #define HAVE_AESCCM
281 #else
282 #define NO_AES
283 #endif
284
285 /* DES3 */
286 #undef NO_DES3
287 #if 1
288 #else
289 #define NO_DES3
290 #endif
291
292 /* ChaCha20 / Poly1305 */
293 //#undef HAVE_CHACHA
294 //#undef HAVE_POLY1305
295 //#if 0
296 #define HAVE_CHACHA
297 #define HAVE_POLY1305
298
299 /* Needed for Poly1305 */
300 #undef HAVE_ONE_TIME_AUTH
301 #define HAVE_ONE_TIME_AUTH
302 //#endif
303
304 /* ------------------------------------------------------------------------- */
305 /* Hashing */
306 /* ------------------------------------------------------------------------- */
307 /* Sha */
308 //#undef WOLFSSL_STATIC_RSA
309 #if 1
310 /* 1k smaller, but 25% slower */
311 //#define USE_SLOW_SHA
312 #else
313 #define NO_SHA
314 #endif
315
316 /* Sha256 */
317 #undef NO_SHA256
318 #if 1
319 /* not unrolled - ~2k smaller and ~25% slower */
320 //#define USE_SLOW_SHA256
321
322 /* Sha224 */
323 #if 0
324 #define WOLFSSL_SHA224
325 #endif
326 #else
327 #define NO_SHA256
328 #endif
329
330 /* Sha512 */
331 //#undef WOLFSSL_SHA512
332 //#if 0
333 #define WOLFSSL_SHA512
334
335 /* Sha384 */
336 //#undef WOLFSSL_SHA384
337 //#if 0
338 #define WOLFSSL_SHA384
339 //#endif
340
341 /* over twice as small, but 50% slower */
342 //#define USE_SLOW_SHA512
343 //#endif
344
345 /* Sha3 */
346 #undef WOLFSSL_SHA3
347 #if 0
348 #define WOLFSSL_SHA3
349 #endif

NetBurner, Inc.
942 File Documentation

350
351 /* MD5 */
352 #undef NO_MD5
353 #if 0
354
355 #else
356 #define NO_MD5
357 #endif
358
359 /* HKDF */
360 #undef HAVE_HKDF
361 #if 1
362 #define HAVE_HKDF
363 #endif
364
365 /* CMAC */
366 #undef WOLFSSL_CMAC
367 #if 0
368 #define WOLFSSL_CMAC
369 #endif
370
371 /* ------------------------------------------------------------------------- */
372 /* Benchmark / Test */
373 /* ------------------------------------------------------------------------- */
374 /* Use reduced benchmark / test sizes */
375 #undef BENCH_EMBEDDED
376 //#define BENCH_EMBEDDED
377
378 #undef USE_CERT_BUFFERS_2048
379 //#define USE_CERT_BUFFERS_2048
380
381 #undef USE_CERT_BUFFERS_1024
382 //#define USE_CERT_BUFFERS_1024
383
384 #undef USE_CERT_BUFFERS_256
385 //#define USE_CERT_BUFFERS_256
386
387 /* ------------------------------------------------------------------------- */
388 /* Debugging */
389 /* ------------------------------------------------------------------------- */
390
391 #undef DEBUG_WOLFSSL
392 #undef NO_ERROR_STRINGS
393 #if 0
394 #define DEBUG_WOLFSSL
395 #else
396 #if 0
397 #define NO_ERROR_STRINGS
398 #endif
399 #endif
400
401 /* ------------------------------------------------------------------------- */
402 /* Memory */
403 /* ------------------------------------------------------------------------- */
404
405 /* Override Memory API’s */
406 #if 0
407 #undef XMALLOC_OVERRIDE
408 #define XMALLOC_OVERRIDE
409
410 /* prototypes for user heap override functions */
411 /* Note: Realloc only required for normal math */
412 #include <stddef.h> /* for size_t */
413 extern void *myMalloc(size_t n, void* heap, int type);
414 extern void myFree(void *p, void* heap, int type);
415 extern void *myRealloc(void *p, size_t n, void* heap, int type);
416
417 #define XMALLOC(n, h, t) myMalloc(n, h, t)
418 #define XFREE(p, h, t) myFree(p, h, t)
419 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
420 #endif
421
422 #if 0
423 /* Static memory requires fast math */
424 #define WOLFSSL_STATIC_MEMORY
425
426 /* Disable fallback malloc/free */
427 #define WOLFSSL_NO_MALLOC
428 #if 1
429 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
430 #endif
431 #endif
432
433 /* Memory callbacks */
434 #if 0
435 #undef USE_WOLFSSL_MEMORY
436 #define USE_WOLFSSL_MEMORY

NetBurner, Inc.
22.185 MODM7AE70/user_settings.h 943

437
438 /* Use this to measure / print heap usage */
439 #if 1
440 #undef WOLFSSL_TRACK_MEMORY
441 #define WOLFSSL_TRACK_MEMORY
442
443 #undef WOLFSSL_DEBUG_MEMORY
444 #define WOLFSSL_DEBUG_MEMORY
445 #endif
446 #else
447 #ifndef WOLFSSL_STATIC_MEMORY
448 #define NO_WOLFSSL_MEMORY
449 /* Otherwise we will use stdlib malloc, free and realloc */
450 #endif
451 #endif
452
453 /* ------------------------------------------------------------------------- */
454 /* Port */
455 /* ------------------------------------------------------------------------- */
456
457 /* Override Current Time */
458 /* Allows custom "custom_time()" function to be used for benchmark */
459 #define WOLFSSL_USER_CURRTIME
460 #define HAVE_GMTIME_R
461 //#define WOLFSSL_GMTIME
462 #define USER_TICKS
463 #include <time.h>
464 extern unsigned long my_time(time_t *timer);
465 #define XTIME my_time
466
467 /* ------------------------------------------------------------------------- */
468 /* RNG */
469 /* ------------------------------------------------------------------------- */
470
471 /* Seed Source */
472 /* Size of returned HW RNG value */
473 #define CUSTOM_RAND_TYPE unsigned int
474 extern unsigned int my_rng_seed_gen(void);
475 #undef CUSTOM_RAND_GENERATE
476 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
477
478 // NetBurner specific define for enabling hardware random number generation for M7
479 #define GATHER_RANDOM_USE_HW
480
481 /* Choose RNG method */
482 #if 1
483 /* Use built-in P-RNG (SHA256 based) with HW RNG */
484 /* P-RNG + HW RNG (P-RNG is ~8K) */
485 #undef HAVE_HASHDRBG
486 //#define HAVE_HASHDRBG
487 #else
488 #undef WC_NO_HASHDRBG
489 #define WC_NO_HASHDRBG
490
491 /* Bypass P-RNG and use only HW RNG */
492 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
493 #undef CUSTOM_RAND_GENERATE_BLOCK
494 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
495 #endif
496
497 /* ------------------------------------------------------------------------- */
498 /* Custom Standard Lib */
499 /* ------------------------------------------------------------------------- */
500 /* Allows override of all standard library functions */
501 #undef STRING_USER
502 #if 0
503 #define STRING_USER
504
505 #include <string.h>
506
507 #undef USE_WOLF_STRSEP
508 #define USE_WOLF_STRSEP
509 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
510
511 #undef USE_WOLF_STRTOK
512 #define USE_WOLF_STRTOK
513 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
514
515 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
516
517 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
518 #define XMEMSET(b, c, l) memset((b), (c), (l))
519 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
520 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
521
522 #define XSTRLEN(s1) strlen((s1))
523 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))

NetBurner, Inc.
944 File Documentation

524 #define XSTRSTR(s1, s2) strstr((s1), (s2))


525
526 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
527 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
528 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
529
530 #define XSNPRINTF snprintf
531 #endif
532
533 /* ------------------------------------------------------------------------- */
534 /* Enable Features */
535 /* ------------------------------------------------------------------------- */
536 #undef WOLFSSL_TLS13
537 #if 1
538 #define WOLFSSL_TLS13
539 #endif
540
541 #undef WOLFSSL_KEY_GEN
542 #if 1
543 #define WOLFSSL_KEY_GEN
544 #endif
545
546 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
547 #define WOLFSSL_OLD_PRIME_CHECK
548 #endif
549
550 #undef KEEP_PEER_CERT
551 #define KEEP_PEER_CERT
552
553 #undef HAVE_COMP_KEY
554 //#define HAVE_COMP_KEY
555
556 #undef HAVE_TLS_EXTENSIONS
557 #define HAVE_TLS_EXTENSIONS
558
559 #undef HAVE_SUPPORTED_CURVES
560 #define HAVE_SUPPORTED_CURVES
561
562 #undef WOLFSSL_BASE64_ENCODE
563 #define WOLFSSL_BASE64_ENCODE
564
565 #define SMALL_SESSION_CACHE
566 #define HAVE_SESSION_TICKET
567
568 /* ------------------------------------------------------------------------- */
569 /* Disable Features */
570 /* ------------------------------------------------------------------------- */
571 #undef NO_WOLFSSL_SERVER
572 //#define NO_WOLFSSL_SERVER
573
574 #undef NO_WOLFSSL_CLIENT
575 //#define NO_WOLFSSL_CLIENT
576
577 #undef NO_CRYPT_TEST
578 //#define NO_CRYPT_TEST
579
580 #undef NO_CRYPT_BENCHMARK
581 //#define NO_CRYPT_BENCHMARK
582
583 #undef WOLFCRYPT_ONLY
584 //#define WOLFCRYPT_ONLY
585
586 /* In-lining of misc.c functions */
587 /* If defined, must include wolfcrypt/src/misc.c in build */
588 /* Slower, but about 1k smaller */
589 #undef NO_INLINE
590 //#define NO_INLINE
591
592 #undef WOLFSSL_NO_SOCK
593 #define WOLFSSL_NO_SOCK
594
595 #undef NO_WOLFSSL_DIR
596 #define NO_WOLFSSL_DIR
597
598 #undef NO_FILESYSTEM
599 #define NO_FILESYSTEM
600
601 #undef NO_WRITEV
602 #define NO_WRITEV
603
604 #undef NO_MAIN_DRIVER
605 #define NO_MAIN_DRIVER
606
607 #undef NO_DEV_RANDOM
608 #define NO_DEV_RANDOM
609
610 #undef NO_DSA

NetBurner, Inc.
22.186 MODRT1171/user_settings.h 945

611 #define NO_DSA


612
613 #undef NO_RC4
614 //#define NO_RC4
615
616 #undef NO_OLD_TLS
617 #define NO_OLD_TLS
618
619 #undef NO_HC128
620 #define NO_HC128
621
622 #undef NO_RABBIT
623 #define NO_RABBIT
624
625 #undef NO_PSK
626 #define NO_PSK
627
628 #undef NO_MD4
629 #define NO_MD4
630
631 #undef NO_PWDBASED
632 #define NO_PWDBASED
633
634 #undef NO_CODING
635 //#define NO_CODING
636
637 #undef NO_ASN_TIME
638 //#define NO_ASN_TIME
639
640 #undef NO_CERTS
641 //#define NO_CERTS
642
643 #undef NO_SIG_WRAPPER
644 //#define NO_SIG_WRAPPER
645
646 #undef WOLFSSL_IGNORE_FILE_WARN
647 #define WOLFSSL_IGNORE_FILE_WARN
648
649 #undef NO_TLS
650
651 #define HAVE_SNI
652
653 // Settings made for compatibility
654 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
655 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
656 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
657 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
658
659 #define WOLFSSL_CERT_REQ
660 #define WOLFSSL_CERT_GEN
661 #define WOLFSSL_ALT_NAMES
662 #define WOLFSSL_DER_TO_PEM
663 #define WOLFSSL_KEY_GEN
664
665 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
666 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
667
668 // For wolfSSH
669 //#undef WOLFSSH_SFTP
670 //#define WOLFSSH_SFTP
671
672 //#undef WOLFSSH_SCP
673 //#define WOLFSSH_SCP
674
675 #undef WOLFSSH_USER_IO
676 #define WOLFSSH_USER_IO
677
678 #ifdef __cplusplus
679 }
680 #endif
681
682 #endif /* WOLFSSL_USER_SETTINGS_H */

22.186 MODRT1171/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9

NetBurner, Inc.
946 File Documentation

10 //#define DEBUG_WOLFSSL
11
12 #include <predef.h>
13 #include <endian.h>
14 #define XHTONS(a) __htons(a)
15
16 //#define WOLFSSL_CALLBACKS
17
18 /* ------------------------------------------------------------------------- */
19 /* Platform */
20 /* ------------------------------------------------------------------------- */
21 #undef WOLFSSL_GENERAL_ALIGNMENT
22 #define WOLFSSL_GENERAL_ALIGNMENT 4
23
24 #undef SINGLE_THREADED
25 //#define SINGLE_THREADED
26
27 #undef WOLFSSL_SMALL_STACK
28 #define WOLFSSL_SMALL_STACK
29
30 #undef WOLFSSL_USER_IO
31 #define WOLFSSL_USER_IO
32
33 /* ------------------------------------------------------------------------- */
34 /* Math Configuration */
35 /* ------------------------------------------------------------------------- */
36 #undef SIZEOF_LONG_LONG
37 #define SIZEOF_LONG_LONG 8
38
39 #undef USE_FAST_MATH
40 #if 1
41 #define USE_FAST_MATH
42
43 #undef TFM_TIMING_RESISTANT
44 #define TFM_TIMING_RESISTANT
45
46 /* Optimizations */
47 //#define TFM_ARM
48 #endif
49
50 /* Wolf Single Precision Math */
51 #define ULLONG_MAX 4294967295UL
52 #define SP_WORD_SIZE 16
53
54 #define WOLFSSL_SP
55 #define WOLFSSL_SP_SMALL
56
57 //#undef WOLFSSL_SP
58 #if 0
59 #define WOLFSSL_SP
60 #define WOLFSSL_SP_SMALL /* use smaller version of code */
61 #define WOLFSSL_HAVE_SP_RSA
62 #define WOLFSSL_HAVE_SP_DH
63 #define WOLFSSL_HAVE_SP_ECC
64 #define WOLFSSL_SP_CACHE_RESISTANT
65 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
66
67 /* 64 or 32 bit version */
68 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
69 //#define WOLFSSL_SP_ARM32_ASM
70 //#define WOLFSSL_SP_ARM64_ASM
71 #endif
72
73 /* ------------------------------------------------------------------------- */
74 /* FIPS - Requires eval or license from wolfSSL */
75 /* ------------------------------------------------------------------------- */
76 #undef HAVE_FIPS
77 #if 0
78 #define HAVE_FIPS
79
80 #undef HAVE_FIPS_VERSION
81 #define HAVE_FIPS_VERSION 2
82
83 #ifdef SINGLE_THREADED
84 #undef NO_THREAD_LS
85 #define NO_THREAD_LS
86 #endif
87 #endif
88
89 /* ------------------------------------------------------------------------- */
90 /* Crypto */
91 /* ------------------------------------------------------------------------- */
92 /* RSA */
93 #undef NO_RSA
94 #if 1
95 #ifdef USE_FAST_MATH
96 /* Maximum math bits (Max RSA key bits * 2) */

NetBurner, Inc.
22.186 MODRT1171/user_settings.h 947

97 #undef FP_MAX_BITS
98 #ifdef ENABLE_RSA_4K // predef.h
99 #define FP_MAX_BITS 8192
100 #else
101 #define FP_MAX_BITS 4096
102 #endif
103 #endif
104
105 /* half as much memory but twice as slow */
106 #undef RSA_LOW_MEM
107 //#define RSA_LOW_MEM
108
109 /* Enables blinding mode, to prevent timing attacks */
110 #if 1
111 #undef WC_RSA_BLINDING
112 #define WC_RSA_BLINDING
113 #else
114 #undef WC_NO_HARDEN
115 #define WC_NO_HARDEN
116 #endif
117
118 /* RSA PSS Support */
119 #if 1
120 #define WC_RSA_PSS
121 #endif
122
123 #if 1
124 #define WC_RSA_NO_PADDING
125 #endif
126 #else
127 #define NO_RSA
128 #endif
129
130 /* ECC */
131 #undef HAVE_ECC
132 #if 1
133 #define HAVE_ECC
134
135 /* Manually define enabled curves */
136 #undef ECC_USER_CURVES
137 #define ECC_USER_CURVES
138
139 #ifdef ECC_USER_CURVES
140 /* Manual Curve Selection */
141 #define HAVE_ECC192
142 #define HAVE_ECC128
143 #define HAVE_ECC224
144 #undef NO_ECC256
145
146 #ifdef ENABLE_ECC384 // predef.h
147 #define HAVE_ECC384 // - Disabled until we can get better performance
148 #endif
149
150 #ifdef ENABLE_ECC521 // predef.h
151 #define HAVE_ECC521 // - Disabled until we can get better performance
152 #endif
153
154 #ifdef ENABLE_ED25519 // predef.h
155 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
156 #define HAVE_CURVE25519
157
158 /* Optionally use small math (less flash usage, but much slower) */
159 //#define CURVED25519_SMALL
160 #endif
161 #endif
162
163 /* Fixed point cache (speeds repeated operations against same private key) */
164 #undef FP_ECC
165 #define FP_ECC
166 #ifdef FP_ECC
167 /* Bits / Entries */
168 #undef FP_ENTRIES
169 #define FP_ENTRIES 15
170 #undef FP_LUT
171 #define FP_LUT 4
172 #endif
173
174 /* Optional ECC calculation method */
175 /* Note: doubles heap usage, but slightly faster */
176 #undef ECC_SHAMIR
177 #define ECC_SHAMIR
178
179 /* Reduces heap usage, but slower */
180 #undef ECC_TIMING_RESISTANT
181 //#define ECC_TIMING_RESISTANT // - Disabled for performance
182
183 /* Enable cofactor support */

NetBurner, Inc.
948 File Documentation

184 #ifdef HAVE_FIPS


185 #undef HAVE_ECC_CDH
186 #define HAVE_ECC_CDH
187 #endif
188
189 /* Validate import */
190 #ifdef HAVE_FIPS
191 #undef WOLFSSL_VALIDATE_ECC_IMPORT
192 #define WOLFSSL_VALIDATE_ECC_IMPORT
193 #endif
194
195 /* Compressed Key Support */
196 #undef HAVE_COMP_KEY
197 //#define HAVE_COMP_KEY
198
199 /* Use alternate ECC size for ECC math */
200 #ifdef USE_FAST_MATH
201 #ifdef NO_RSA
202 /* Custom fastmath size if not using RSA */
203 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
204 #undef FP_MAX_BITS
205 #define FP_MAX_BITS (256 + 32)
206 #else
207 #undef ALT_ECC_SIZE
208 #define ALT_ECC_SIZE
209 #endif
210
211 /* Speedups specific to curve */
212 #ifndef NO_ECC256
213 #undef TFM_ECC256
214 #define TFM_ECC256
215 #endif
216 #endif
217 #endif
218
219 /* DH */
220 #undef NO_DH
221 #if 1
222 /* Use table for DH instead of -lm (math) lib dependency */
223 #if 1
224 #define WOLFSSL_DH_CONST
225 #define HAVE_FFDHE_2048
226 #ifdef ENABLE_RSA_4K
227 #define HAVE_FFDHE_4096
228 #endif
229 //#define HAVE_FFDHE_6144
230 //#define HAVE_FFDHE_8192
231 #endif
232
233 #ifdef HAVE_FIPS
234 #define WOLFSSL_VALIDATE_FFC_IMPORT
235 #define HAVE_FFDHE_Q
236 #endif
237 #else
238 #define NO_DH
239 #endif
240
241 /* AES */
242 #undef NO_AES
243 #if 1
244 #undef HAVE_AES_CBC
245 #define HAVE_AES_CBC
246
247 #undef HAVE_AESGCM
248 #define HAVE_AESGCM
249
250 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
251 #define GCM_SMALL
252
253 #undef WOLFSSL_AES_DIRECT
254 //#define WOLFSSL_AES_DIRECT
255
256 #undef HAVE_AES_ECB
257 //#define HAVE_AES_ECB
258
259 #undef WOLFSSL_AES_COUNTER
260 //#define WOLFSSL_AES_COUNTER
261
262 #undef HAVE_AESCCM
263 #define HAVE_AESCCM
264 #else
265 #define NO_AES
266 #endif
267
268 /* DES3 */
269 #undef NO_DES3
270 #if 1

NetBurner, Inc.
22.186 MODRT1171/user_settings.h 949

271 #else
272 #define NO_DES3
273 #endif
274
275 /* ChaCha20 / Poly1305 */
276 //#undef HAVE_CHACHA
277 //#undef HAVE_POLY1305
278 //#if 0
279 #define HAVE_CHACHA
280 #define HAVE_POLY1305
281
282 /* Needed for Poly1305 */
283 #undef HAVE_ONE_TIME_AUTH
284 #define HAVE_ONE_TIME_AUTH
285 //#endif
286
287 /* ------------------------------------------------------------------------- */
288 /* Hashing */
289 /* ------------------------------------------------------------------------- */
290 /* Sha */
291 //#undef WOLFSSL_STATIC_RSA
292 #if 1
293 /* 1k smaller, but 25% slower */
294 //#define USE_SLOW_SHA
295 #else
296 #define NO_SHA
297 #endif
298
299 /* Sha256 */
300 #undef NO_SHA256
301 #if 1
302 /* not unrolled - ~2k smaller and ~25% slower */
303 //#define USE_SLOW_SHA256
304
305 /* Sha224 */
306 #if 0
307 #define WOLFSSL_SHA224
308 #endif
309 #else
310 #define NO_SHA256
311 #endif
312
313 /* Sha512 */
314 //#undef WOLFSSL_SHA512
315 //#if 0
316 #define WOLFSSL_SHA512
317
318 /* Sha384 */
319 //#undef WOLFSSL_SHA384
320 //#if 0
321 #define WOLFSSL_SHA384
322 //#endif
323
324 /* over twice as small, but 50% slower */
325 //#define USE_SLOW_SHA512
326 //#endif
327
328 /* Sha3 */
329 #undef WOLFSSL_SHA3
330 #if 0
331 #define WOLFSSL_SHA3
332 #endif
333
334 /* MD5 */
335 #undef NO_MD5
336 #if 0
337
338 #else
339 #define NO_MD5
340 #endif
341
342 /* HKDF */
343 #undef HAVE_HKDF
344 #if 1
345 #define HAVE_HKDF
346 #endif
347
348 /* CMAC */
349 #undef WOLFSSL_CMAC
350 #if 0
351 #define WOLFSSL_CMAC
352 #endif
353
354 /* ------------------------------------------------------------------------- */
355 /* Benchmark / Test */
356 /* ------------------------------------------------------------------------- */
357 /* Use reduced benchmark / test sizes */

NetBurner, Inc.
950 File Documentation

358 #undef BENCH_EMBEDDED


359 //#define BENCH_EMBEDDED
360
361 #undef USE_CERT_BUFFERS_2048
362 //#define USE_CERT_BUFFERS_2048
363
364 #undef USE_CERT_BUFFERS_1024
365 //#define USE_CERT_BUFFERS_1024
366
367 #undef USE_CERT_BUFFERS_256
368 //#define USE_CERT_BUFFERS_256
369
370 /* ------------------------------------------------------------------------- */
371 /* Debugging */
372 /* ------------------------------------------------------------------------- */
373
374 #undef DEBUG_WOLFSSL
375 #undef NO_ERROR_STRINGS
376 #if 0
377 #define DEBUG_WOLFSSL
378 #else
379 #if 0
380 #define NO_ERROR_STRINGS
381 #endif
382 #endif
383
384 /* ------------------------------------------------------------------------- */
385 /* Memory */
386 /* ------------------------------------------------------------------------- */
387
388 /* Override Memory API’s */
389 #if 0
390 #undef XMALLOC_OVERRIDE
391 #define XMALLOC_OVERRIDE
392
393 /* prototypes for user heap override functions */
394 /* Note: Realloc only required for normal math */
395 #include <stddef.h> /* for size_t */
396 extern void *myMalloc(size_t n, void* heap, int type);
397 extern void myFree(void *p, void* heap, int type);
398 extern void *myRealloc(void *p, size_t n, void* heap, int type);
399
400 #define XMALLOC(n, h, t) myMalloc(n, h, t)
401 #define XFREE(p, h, t) myFree(p, h, t)
402 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
403 #endif
404
405 #if 0
406 /* Static memory requires fast math */
407 #define WOLFSSL_STATIC_MEMORY
408
409 /* Disable fallback malloc/free */
410 #define WOLFSSL_NO_MALLOC
411 #if 1
412 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
413 #endif
414 #endif
415
416 /* Memory callbacks */
417 #if 0
418 #undef USE_WOLFSSL_MEMORY
419 #define USE_WOLFSSL_MEMORY
420
421 /* Use this to measure / print heap usage */
422 #if 1
423 #undef WOLFSSL_TRACK_MEMORY
424 #define WOLFSSL_TRACK_MEMORY
425
426 #undef WOLFSSL_DEBUG_MEMORY
427 #define WOLFSSL_DEBUG_MEMORY
428 #endif
429 #else
430 #ifndef WOLFSSL_STATIC_MEMORY
431 #define NO_WOLFSSL_MEMORY
432 /* Otherwise we will use stdlib malloc, free and realloc */
433 #endif
434 #endif
435
436 /* ------------------------------------------------------------------------- */
437 /* Port */
438 /* ------------------------------------------------------------------------- */
439
440 /* Override Current Time */
441 /* Allows custom "custom_time()" function to be used for benchmark */
442 #define WOLFSSL_USER_CURRTIME
443 //#define WOLFSSL_GMTIME
444 #define HAVE_GMTIME_R

NetBurner, Inc.
22.186 MODRT1171/user_settings.h 951

445 #define USER_TICKS


446 #include <time.h>
447 extern unsigned long my_time(time_t *timer);
448 #define XTIME my_time
449
450 /* ------------------------------------------------------------------------- */
451 /* RNG */
452 /* ------------------------------------------------------------------------- */
453
454 /* Seed Source */
455 /* Size of returned HW RNG value */
456 #define CUSTOM_RAND_TYPE unsigned int
457 extern unsigned int my_rng_seed_gen(void);
458 #undef CUSTOM_RAND_GENERATE
459 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
460
461 // NetBurner specific define for enabling hardware random number generation for M7
462 #define GATHER_RANDOM_USE_HW
463
464 /* Choose RNG method */
465 #if 1
466 /* Use built-in P-RNG (SHA256 based) with HW RNG */
467 /* P-RNG + HW RNG (P-RNG is ~8K) */
468 #undef HAVE_HASHDRBG
469 //#define HAVE_HASHDRBG
470 #else
471 #undef WC_NO_HASHDRBG
472 #define WC_NO_HASHDRBG
473
474 /* Bypass P-RNG and use only HW RNG */
475 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
476 #undef CUSTOM_RAND_GENERATE_BLOCK
477 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
478 #endif
479
480 /* ------------------------------------------------------------------------- */
481 /* Custom Standard Lib */
482 /* ------------------------------------------------------------------------- */
483 /* Allows override of all standard library functions */
484 #undef STRING_USER
485 #if 0
486 #define STRING_USER
487
488 #include <string.h>
489
490 #undef USE_WOLF_STRSEP
491 #define USE_WOLF_STRSEP
492 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
493
494 #undef USE_WOLF_STRTOK
495 #define USE_WOLF_STRTOK
496 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
497
498 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
499
500 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
501 #define XMEMSET(b, c, l) memset((b), (c), (l))
502 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
503 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
504
505 #define XSTRLEN(s1) strlen((s1))
506 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
507 #define XSTRSTR(s1, s2) strstr((s1), (s2))
508
509 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
510 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
511 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
512
513 #define XSNPRINTF snprintf
514 #endif
515
516 /* ------------------------------------------------------------------------- */
517 /* Enable Features */
518 /* ------------------------------------------------------------------------- */
519 #undef WOLFSSL_TLS13
520 #if 1
521 #define WOLFSSL_TLS13
522 #endif
523
524 #undef WOLFSSL_KEY_GEN
525 #if 1
526 #define WOLFSSL_KEY_GEN
527 #endif
528
529 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
530 #define WOLFSSL_OLD_PRIME_CHECK
531 #endif

NetBurner, Inc.
952 File Documentation

532
533 #undef KEEP_PEER_CERT
534 #define KEEP_PEER_CERT
535
536 #undef HAVE_COMP_KEY
537 //#define HAVE_COMP_KEY
538
539 #undef HAVE_TLS_EXTENSIONS
540 #define HAVE_TLS_EXTENSIONS
541
542 #undef HAVE_SUPPORTED_CURVES
543 #define HAVE_SUPPORTED_CURVES
544
545 #undef WOLFSSL_BASE64_ENCODE
546 #define WOLFSSL_BASE64_ENCODE
547
548 #define SMALL_SESSION_CACHE
549 #define HAVE_SESSION_TICKET
550
551 /* ------------------------------------------------------------------------- */
552 /* Disable Features */
553 /* ------------------------------------------------------------------------- */
554 #undef NO_WOLFSSL_SERVER
555 //#define NO_WOLFSSL_SERVER
556
557 #undef NO_WOLFSSL_CLIENT
558 //#define NO_WOLFSSL_CLIENT
559
560 #undef NO_CRYPT_TEST
561 //#define NO_CRYPT_TEST
562
563 #undef NO_CRYPT_BENCHMARK
564 //#define NO_CRYPT_BENCHMARK
565
566 #undef WOLFCRYPT_ONLY
567 //#define WOLFCRYPT_ONLY
568
569 /* In-lining of misc.c functions */
570 /* If defined, must include wolfcrypt/src/misc.c in build */
571 /* Slower, but about 1k smaller */
572 #undef NO_INLINE
573 //#define NO_INLINE
574
575 #undef WOLFSSL_NO_SOCK
576 #define WOLFSSL_NO_SOCK
577
578 #undef NO_WOLFSSL_DIR
579 #define NO_WOLFSSL_DIR
580
581 #undef NO_FILESYSTEM
582 #define NO_FILESYSTEM
583
584 #undef NO_WRITEV
585 #define NO_WRITEV
586
587 #undef NO_MAIN_DRIVER
588 #define NO_MAIN_DRIVER
589
590 #undef NO_DEV_RANDOM
591 #define NO_DEV_RANDOM
592
593 #undef NO_DSA
594 #define NO_DSA
595
596 #undef NO_RC4
597 //#define NO_RC4
598
599 #undef NO_OLD_TLS
600 #define NO_OLD_TLS
601
602 #undef NO_HC128
603 #define NO_HC128
604
605 #undef NO_RABBIT
606 #define NO_RABBIT
607
608 #undef NO_PSK
609 #define NO_PSK
610
611 #undef NO_MD4
612 #define NO_MD4
613
614 #undef NO_PWDBASED
615 #define NO_PWDBASED
616
617 #undef NO_CODING
618 //#define NO_CODING

NetBurner, Inc.
22.187 MON_RT10xx/user_settings.h 953

619
620 #undef NO_ASN_TIME
621 //#define NO_ASN_TIME
622
623 #undef NO_CERTS
624 //#define NO_CERTS
625
626 #undef NO_SIG_WRAPPER
627 //#define NO_SIG_WRAPPER
628
629 #undef WOLFSSL_IGNORE_FILE_WARN
630 #define WOLFSSL_IGNORE_FILE_WARN
631
632 #undef NO_TLS
633
634 #define HAVE_SNI
635
636 // Settings made for compatibility
637 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
638 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
639 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
640 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
641
642 #define WOLFSSL_CERT_REQ
643 #define WOLFSSL_CERT_GEN
644 #define WOLFSSL_ALT_NAMES
645 #define WOLFSSL_DER_TO_PEM
646 #define WOLFSSL_KEY_GEN
647
648 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
649 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
650
651 // For wolfSSH
652 //#undef WOLFSSH_SFTP
653 //#define WOLFSSH_SFTP
654
655 //#undef WOLFSSH_SCP
656 //#define WOLFSSH_SCP
657
658 #undef WOLFSSH_USER_IO
659 #define WOLFSSH_USER_IO
660
661 #ifdef __cplusplus
662 }
663 #endif
664
665 #endif /* WOLFSSL_USER_SETTINGS_H */

22.187 MON_RT10xx/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 //#define DEBUG_WOLFSSL
11 #include <predef.h>
12 #include <endian.h>
13 #define XHTONS(a) __htons(a)
14
15 //#define WOLFSSL_CALLBACKS
16
17 /* ------------------------------------------------------------------------- */
18 /* Platform */
19 /* ------------------------------------------------------------------------- */
20 #undef WOLFSSL_GENERAL_ALIGNMENT
21 #define WOLFSSL_GENERAL_ALIGNMENT 4
22
23 #undef SINGLE_THREADED
24 //#define SINGLE_THREADED
25
26 #undef WOLFSSL_SMALL_STACK
27 #define WOLFSSL_SMALL_STACK
28
29 #undef WOLFSSL_USER_IO
30 #define WOLFSSL_USER_IO
31
32 /* ------------------------------------------------------------------------- */
33 /* Math Configuration */
34 /* ------------------------------------------------------------------------- */

NetBurner, Inc.
954 File Documentation

35 #undef SIZEOF_LONG_LONG
36 #define SIZEOF_LONG_LONG 8
37
38 #undef USE_FAST_MATH
39 #if 1
40 #define USE_FAST_MATH
41
42 #undef TFM_TIMING_RESISTANT
43 #define TFM_TIMING_RESISTANT
44
45 /* Optimizations */
46 //#define TFM_ARM
47 #endif
48
49 /* Wolf Single Precision Math */
50 #undef WOLFSSL_SP
51 #if 0
52 #define WOLFSSL_SP
53 #define WOLFSSL_SP_SMALL /* use smaller version of code */
54 #define WOLFSSL_HAVE_SP_RSA
55 #define WOLFSSL_HAVE_SP_DH
56 #define WOLFSSL_HAVE_SP_ECC
57 #define WOLFSSL_SP_CACHE_RESISTANT
58 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
59
60 /* 64 or 32 bit version */
61 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
62 //#define WOLFSSL_SP_ARM32_ASM
63 //#define WOLFSSL_SP_ARM64_ASM
64 #endif
65
66 /* ------------------------------------------------------------------------- */
67 /* FIPS - Requires eval or license from wolfSSL */
68 /* ------------------------------------------------------------------------- */
69 #undef HAVE_FIPS
70 #if 0
71 #define HAVE_FIPS
72
73 #undef HAVE_FIPS_VERSION
74 #define HAVE_FIPS_VERSION 2
75
76 #ifdef SINGLE_THREADED
77 #undef NO_THREAD_LS
78 #define NO_THREAD_LS
79 #endif
80 #endif
81
82 /* ------------------------------------------------------------------------- */
83 /* Crypto */
84 /* ------------------------------------------------------------------------- */
85 /* RSA */
86 #undef NO_RSA
87 #if 1
88 #ifdef USE_FAST_MATH
89 /* Maximum math bits (Max RSA key bits * 2) */
90 #undef FP_MAX_BITS
91 #define FP_MAX_BITS 8192
92 #endif
93
94 /* half as much memory but twice as slow */
95 #undef RSA_LOW_MEM
96 //#define RSA_LOW_MEM
97
98 /* Enables blinding mode, to prevent timing attacks */
99 #if 1
100 #undef WC_RSA_BLINDING
101 #define WC_RSA_BLINDING
102 #else
103 #undef WC_NO_HARDEN
104 #define WC_NO_HARDEN
105 #endif
106
107 /* RSA PSS Support */
108 #if 1
109 #define WC_RSA_PSS
110 #endif
111
112 #if 1
113 #define WC_RSA_NO_PADDING
114 #endif
115 #else
116 #define NO_RSA
117 #endif
118
119 /* ECC */
120 #undef HAVE_ECC
121 #if 1

NetBurner, Inc.
22.187 MON_RT10xx/user_settings.h 955

122 #define HAVE_ECC


123
124 // Manually add support for curves.
125 #undef ECC_USER_CURVES
126 #define ECC_USER_CURVES
127
128 #ifdef ECC_USER_CURVES
129 /* Manual Curve Selection */
130 #define HAVE_ECC192 // For WolfSSL
131 #define HAVE_ECC224 // For WolfSSL
132 #undef NO_ECC256
133
134 // Added for specific curve support for WolfSSH
135 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
136 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
137 #define ECC192
138 #define ECC224
139 #undef NO_ECC_SECP
140 #define HAVE_ECC_SECPR2
141 #define HAVE_ECC_SECPR3
142
143 #ifdef ENABLE_ECC384 // predef.h
144 #define HAVE_ECC384 // - Disabled until we can get better performance
145 #endif
146
147 #ifdef ENABLE_ECC521 // predef.h
148 #define HAVE_ECC521 // - Disabled until we can get better performance
149 #endif
150
151 #ifdef ENABLE_ED25519 // predef.h
152 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
153 #define HAVE_CURVE25519
154
155 /* Optionally use small math (less flash usage, but much slower) */
156 //#define CURVED25519_SMALL
157 #endif
158 #endif
159
160 /* Fixed point cache (speeds repeated operations against same private key) */
161 #undef FP_ECC
162 #define FP_ECC
163 #ifdef FP_ECC
164 /* Bits / Entries */
165 #undef FP_ENTRIES
166 #define FP_ENTRIES 15
167 #undef FP_LUT
168 #define FP_LUT 4
169 #endif
170
171 /* Optional ECC calculation method */
172 /* Note: doubles heap usage, but slightly faster */
173 #undef ECC_SHAMIR
174 #define ECC_SHAMIR
175
176 /* Reduces heap usage, but slower */
177 #undef ECC_TIMING_RESISTANT
178 //#define ECC_TIMING_RESISTANT // - Disabled for performance
179
180 /* Enable cofactor support */
181 #ifdef HAVE_FIPS
182 #undef HAVE_ECC_CDH
183 #define HAVE_ECC_CDH
184 #endif
185
186 /* Validate import */
187 #ifdef HAVE_FIPS
188 #undef WOLFSSL_VALIDATE_ECC_IMPORT
189 #define WOLFSSL_VALIDATE_ECC_IMPORT
190 #endif
191
192 /* Compressed Key Support */
193 #undef HAVE_COMP_KEY
194 //#define HAVE_COMP_KEY
195
196 /* Use alternate ECC size for ECC math */
197 #ifdef USE_FAST_MATH
198 #ifdef NO_RSA
199 /* Custom fastmath size if not using RSA */
200 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
201 #undef FP_MAX_BITS
202 #define FP_MAX_BITS (256 + 32)
203 #else
204 #undef ALT_ECC_SIZE
205 #define ALT_ECC_SIZE
206 #endif
207
208 /* Speedups specific to curve */

NetBurner, Inc.
956 File Documentation

209 #ifndef NO_ECC256


210 #undef TFM_ECC256
211 #define TFM_ECC256
212 #endif
213 #endif
214 #endif
215
216 /* DH */
217 #undef NO_DH
218 #if 1
219 /* Use table for DH instead of -lm (math) lib dependency */
220 #if 1
221 #define WOLFSSL_DH_CONST
222 #define HAVE_FFDHE_2048
223 #define HAVE_FFDHE_4096
224 //#define HAVE_FFDHE_6144
225 //#define HAVE_FFDHE_8192
226 #endif
227
228 #ifdef HAVE_FIPS
229 #define WOLFSSL_VALIDATE_FFC_IMPORT
230 #define HAVE_FFDHE_Q
231 #endif
232 #else
233 #define NO_DH
234 #endif
235
236 /* AES */
237 #undef NO_AES
238 #if 1
239 #undef HAVE_AES_CBC
240 #define HAVE_AES_CBC
241
242 #undef HAVE_AESGCM
243 #define HAVE_AESGCM
244
245 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
246 #define GCM_SMALL
247
248 #undef WOLFSSL_AES_DIRECT
249 //#define WOLFSSL_AES_DIRECT
250
251 #undef HAVE_AES_ECB
252 //#define HAVE_AES_ECB
253
254 #undef WOLFSSL_AES_COUNTER
255 //#define WOLFSSL_AES_COUNTER
256
257 #undef HAVE_AESCCM
258 #define HAVE_AESCCM
259 #else
260 #define NO_AES
261 #endif
262
263 /* DES3 */
264 #undef NO_DES3
265 #if 1
266 #else
267 #define NO_DES3
268 #endif
269
270 /* ChaCha20 / Poly1305 */
271 //#undef HAVE_CHACHA
272 //#undef HAVE_POLY1305
273 //#if 0
274 #define HAVE_CHACHA
275 #define HAVE_POLY1305
276
277 /* Needed for Poly1305 */
278 #undef HAVE_ONE_TIME_AUTH
279 #define HAVE_ONE_TIME_AUTH
280 //#endif
281
282 /* Ed25519 / Curve25519 */
283 //#undef HAVE_CURVE25519
284 //#undef HAVE_ED25519
285 //#if 0
286 #define HAVE_CURVE25519
287 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
288
289 /* Optionally use small math (less flash usage, but much slower) */
290 #if 1
291 #define CURVED25519_SMALL
292 #endif
293 //#endif
294
295 /* ------------------------------------------------------------------------- */

NetBurner, Inc.
22.187 MON_RT10xx/user_settings.h 957

296 /* Hashing */
297 /* ------------------------------------------------------------------------- */
298 /* Sha */
299 //#undef WOLFSSL_STATIC_RSA
300 #if 1
301 /* 1k smaller, but 25% slower */
302 //#define USE_SLOW_SHA
303 #else
304 #define NO_SHA
305 #endif
306
307 /* Sha256 */
308 #undef NO_SHA256
309 #if 1
310 /* not unrolled - ~2k smaller and ~25% slower */
311 //#define USE_SLOW_SHA256
312
313 /* Sha224 */
314 #if 0
315 #define WOLFSSL_SHA224
316 #endif
317 #else
318 #define NO_SHA256
319 #endif
320
321 /* Sha512 */
322 //#undef WOLFSSL_SHA512
323 //#if 0
324 #define WOLFSSL_SHA512
325
326 /* Sha384 */
327 //#undef WOLFSSL_SHA384
328 //#if 0
329 #define WOLFSSL_SHA384
330 //#endif
331
332 /* over twice as small, but 50% slower */
333 //#define USE_SLOW_SHA512
334 //#endif
335
336 /* Sha3 */
337 #undef WOLFSSL_SHA3
338 #if 0
339 #define WOLFSSL_SHA3
340 #endif
341
342 /* MD5 */
343 #undef NO_MD5
344 #if 0
345
346 #else
347 #define NO_MD5
348 #endif
349
350 /* HKDF */
351 #undef HAVE_HKDF
352 #if 1
353 #define HAVE_HKDF
354 #endif
355
356 /* CMAC */
357 #undef WOLFSSL_CMAC
358 #if 0
359 #define WOLFSSL_CMAC
360 #endif
361
362 /* ------------------------------------------------------------------------- */
363 /* Benchmark / Test */
364 /* ------------------------------------------------------------------------- */
365 /* Use reduced benchmark / test sizes */
366 #undef BENCH_EMBEDDED
367 //#define BENCH_EMBEDDED
368
369 #undef USE_CERT_BUFFERS_2048
370 //#define USE_CERT_BUFFERS_2048
371
372 #undef USE_CERT_BUFFERS_1024
373 //#define USE_CERT_BUFFERS_1024
374
375 #undef USE_CERT_BUFFERS_256
376 //#define USE_CERT_BUFFERS_256
377
378 /* ------------------------------------------------------------------------- */
379 /* Debugging */
380 /* ------------------------------------------------------------------------- */
381
382 #undef DEBUG_WOLFSSL

NetBurner, Inc.
958 File Documentation

383 #undef NO_ERROR_STRINGS


384 #if 0
385 #define DEBUG_WOLFSSL
386 #else
387 #if 0
388 #define NO_ERROR_STRINGS
389 #endif
390 #endif
391
392 /* ------------------------------------------------------------------------- */
393 /* Memory */
394 /* ------------------------------------------------------------------------- */
395
396 /* Override Memory API’s */
397 #if 0
398 #undef XMALLOC_OVERRIDE
399 #define XMALLOC_OVERRIDE
400
401 /* prototypes for user heap override functions */
402 /* Note: Realloc only required for normal math */
403 #include <stddef.h> /* for size_t */
404 extern void *myMalloc(size_t n, void* heap, int type);
405 extern void myFree(void *p, void* heap, int type);
406 extern void *myRealloc(void *p, size_t n, void* heap, int type);
407
408 #define XMALLOC(n, h, t) myMalloc(n, h, t)
409 #define XFREE(p, h, t) myFree(p, h, t)
410 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
411 #endif
412
413 #if 0
414 /* Static memory requires fast math */
415 #define WOLFSSL_STATIC_MEMORY
416
417 /* Disable fallback malloc/free */
418 #define WOLFSSL_NO_MALLOC
419 #if 1
420 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
421 #endif
422 #endif
423
424 /* Memory callbacks */
425 #if 0
426 #undef USE_WOLFSSL_MEMORY
427 #define USE_WOLFSSL_MEMORY
428
429 /* Use this to measure / print heap usage */
430 #if 1
431 #undef WOLFSSL_TRACK_MEMORY
432 #define WOLFSSL_TRACK_MEMORY
433
434 #undef WOLFSSL_DEBUG_MEMORY
435 #define WOLFSSL_DEBUG_MEMORY
436 #endif
437 #else
438 #ifndef WOLFSSL_STATIC_MEMORY
439 #define NO_WOLFSSL_MEMORY
440 /* Otherwise we will use stdlib malloc, free and realloc */
441 #endif
442 #endif
443
444 /* ------------------------------------------------------------------------- */
445 /* Port */
446 /* ------------------------------------------------------------------------- */
447
448 /* Override Current Time */
449 /* Allows custom "custom_time()" function to be used for benchmark */
450 #define WOLFSSL_USER_CURRTIME
451 #define WOLFSSL_GMTIME
452 #define USER_TICKS
453 #include <time.h>
454 extern unsigned long my_time(time_t *timer);
455 #define XTIME my_time
456
457 /* ------------------------------------------------------------------------- */
458 /* RNG */
459 /* ------------------------------------------------------------------------- */
460
461 /* Seed Source */
462 /* Size of returned HW RNG value */
463 #define CUSTOM_RAND_TYPE unsigned int
464 extern unsigned int my_rng_seed_gen(void);
465 #undef CUSTOM_RAND_GENERATE
466 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
467
468 // NetBurner specific define for enabling hardware random number generation for M7
469 #define GATHER_RANDOM_USE_HW

NetBurner, Inc.
22.187 MON_RT10xx/user_settings.h 959

470
471 /* Choose RNG method */
472 #if 1
473 /* Use built-in P-RNG (SHA256 based) with HW RNG */
474 /* P-RNG + HW RNG (P-RNG is ~8K) */
475 #undef HAVE_HASHDRBG
476 //#define HAVE_HASHDRBG
477 #else
478 #undef WC_NO_HASHDRBG
479 #define WC_NO_HASHDRBG
480
481 /* Bypass P-RNG and use only HW RNG */
482 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
483 #undef CUSTOM_RAND_GENERATE_BLOCK
484 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
485 #endif
486
487 /* ------------------------------------------------------------------------- */
488 /* Custom Standard Lib */
489 /* ------------------------------------------------------------------------- */
490 /* Allows override of all standard library functions */
491 #undef STRING_USER
492 #if 0
493 #define STRING_USER
494
495 #include <string.h>
496
497 #undef USE_WOLF_STRSEP
498 #define USE_WOLF_STRSEP
499 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
500
501 #undef USE_WOLF_STRTOK
502 #define USE_WOLF_STRTOK
503 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
504
505 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
506
507 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
508 #define XMEMSET(b, c, l) memset((b), (c), (l))
509 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
510 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
511
512 #define XSTRLEN(s1) strlen((s1))
513 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
514 #define XSTRSTR(s1, s2) strstr((s1), (s2))
515
516 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
517 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
518 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
519
520 #define XSNPRINTF snprintf
521 #endif
522
523 /* ------------------------------------------------------------------------- */
524 /* Enable Features */
525 /* ------------------------------------------------------------------------- */
526 #undef WOLFSSL_TLS13
527 #if 1
528 #define WOLFSSL_TLS13
529 #endif
530
531 #undef WOLFSSL_KEY_GEN
532 #if 1
533 #define WOLFSSL_KEY_GEN
534 #endif
535
536 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
537 #define WOLFSSL_OLD_PRIME_CHECK
538 #endif
539
540 #undef KEEP_PEER_CERT
541 #define KEEP_PEER_CERT
542
543 #undef HAVE_COMP_KEY
544 //#define HAVE_COMP_KEY
545
546 #undef HAVE_TLS_EXTENSIONS
547 #define HAVE_TLS_EXTENSIONS
548
549 #undef HAVE_SUPPORTED_CURVES
550 #define HAVE_SUPPORTED_CURVES
551
552 #undef WOLFSSL_BASE64_ENCODE
553 #define WOLFSSL_BASE64_ENCODE
554
555 #define SMALL_SESSION_CACHE
556 #define HAVE_SESSION_TICKET

NetBurner, Inc.
960 File Documentation

557
558 /* ------------------------------------------------------------------------- */
559 /* Disable Features */
560 /* ------------------------------------------------------------------------- */
561 #undef NO_WOLFSSL_SERVER
562 //#define NO_WOLFSSL_SERVER
563
564 #undef NO_WOLFSSL_CLIENT
565 //#define NO_WOLFSSL_CLIENT
566
567 #undef NO_CRYPT_TEST
568 //#define NO_CRYPT_TEST
569
570 #undef NO_CRYPT_BENCHMARK
571 //#define NO_CRYPT_BENCHMARK
572
573 #undef WOLFCRYPT_ONLY
574 //#define WOLFCRYPT_ONLY
575
576 /* In-lining of misc.c functions */
577 /* If defined, must include wolfcrypt/src/misc.c in build */
578 /* Slower, but about 1k smaller */
579 #undef NO_INLINE
580 //#define NO_INLINE
581
582 #undef WOLFSSL_NO_SOCK
583 #define WOLFSSL_NO_SOCK
584
585 #undef NO_WOLFSSL_DIR
586 #define NO_WOLFSSL_DIR
587
588 #undef NO_FILESYSTEM
589 #define NO_FILESYSTEM
590
591 #undef NO_WRITEV
592 #define NO_WRITEV
593
594 #undef NO_MAIN_DRIVER
595 #define NO_MAIN_DRIVER
596
597 #undef NO_DEV_RANDOM
598 #define NO_DEV_RANDOM
599
600 #undef NO_DSA
601 #define NO_DSA
602
603 #undef NO_RC4
604 //#define NO_RC4
605
606 #undef NO_OLD_TLS
607 #define NO_OLD_TLS
608
609 #undef NO_HC128
610 #define NO_HC128
611
612 #undef NO_RABBIT
613 #define NO_RABBIT
614
615 #undef NO_PSK
616 #define NO_PSK
617
618 #undef NO_MD4
619 #define NO_MD4
620
621 #undef NO_PWDBASED
622 #define NO_PWDBASED
623
624 #undef NO_CODING
625 //#define NO_CODING
626
627 #undef NO_ASN_TIME
628 //#define NO_ASN_TIME
629
630 #undef NO_CERTS
631 //#define NO_CERTS
632
633 #undef NO_SIG_WRAPPER
634 //#define NO_SIG_WRAPPER
635
636 #undef WOLFSSL_IGNORE_FILE_WARN
637 #define WOLFSSL_IGNORE_FILE_WARN
638
639 #undef NO_TLS
640
641 #define HAVE_SNI
642
643 // Settings made for compatibility

NetBurner, Inc.
22.188 MON_SAME70/user_settings.h 961

644 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA


645 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
646 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
647 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
648
649 #define WOLFSSL_CERT_REQ
650 #define WOLFSSL_CERT_GEN
651 #define WOLFSSL_ALT_NAMES
652 #define WOLFSSL_DER_TO_PEM
653 #define WOLFSSL_KEY_GEN
654
655 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
656 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
657
658 // For wolfSSH
659 //#undef WOLFSSH_SFTP
660 //#define WOLFSSH_SFTP
661
662 //#undef WOLFSSH_SCP
663 //#define WOLFSSH_SCP
664
665 #undef WOLFSSH_USER_IO
666 #define WOLFSSH_USER_IO
667
668 #ifdef __cplusplus
669 }
670 #endif
671
672 #endif /* WOLFSSL_USER_SETTINGS_H */

22.188 MON_SAME70/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 //#define DEBUG_WOLFSSL
11 #include <predef.h>
12 #include <endian.h>
13 #define XHTONS(a) __htons(a)
14
15 //#define WOLFSSL_CALLBACKS
16
17 /* ------------------------------------------------------------------------- */
18 /* Platform */
19 /* ------------------------------------------------------------------------- */
20 #undef WOLFSSL_GENERAL_ALIGNMENT
21 #define WOLFSSL_GENERAL_ALIGNMENT 4
22
23 #undef SINGLE_THREADED
24 //#define SINGLE_THREADED
25
26 #undef WOLFSSL_SMALL_STACK
27 #define WOLFSSL_SMALL_STACK
28
29 #undef WOLFSSL_USER_IO
30 #define WOLFSSL_USER_IO
31
32 /* ------------------------------------------------------------------------- */
33 /* Math Configuration */
34 /* ------------------------------------------------------------------------- */
35 #undef SIZEOF_LONG_LONG
36 #define SIZEOF_LONG_LONG 8
37
38 #undef USE_FAST_MATH
39 #if 1
40 #define USE_FAST_MATH
41
42 #undef TFM_TIMING_RESISTANT
43 #define TFM_TIMING_RESISTANT
44
45 /* Optimizations */
46 //#define TFM_ARM
47 #endif
48
49 /* Wolf Single Precision Math */
50 #undef WOLFSSL_SP
51 #if 0
52 #define WOLFSSL_SP

NetBurner, Inc.
962 File Documentation

53 #define WOLFSSL_SP_SMALL /* use smaller version of code */


54 #define WOLFSSL_HAVE_SP_RSA
55 #define WOLFSSL_HAVE_SP_DH
56 #define WOLFSSL_HAVE_SP_ECC
57 #define WOLFSSL_SP_CACHE_RESISTANT
58 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
59
60 /* 64 or 32 bit version */
61 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
62 //#define WOLFSSL_SP_ARM32_ASM
63 //#define WOLFSSL_SP_ARM64_ASM
64 #endif
65
66 /* ------------------------------------------------------------------------- */
67 /* FIPS - Requires eval or license from wolfSSL */
68 /* ------------------------------------------------------------------------- */
69 #undef HAVE_FIPS
70 #if 0
71 #define HAVE_FIPS
72
73 #undef HAVE_FIPS_VERSION
74 #define HAVE_FIPS_VERSION 2
75
76 #ifdef SINGLE_THREADED
77 #undef NO_THREAD_LS
78 #define NO_THREAD_LS
79 #endif
80 #endif
81
82 /* ------------------------------------------------------------------------- */
83 /* Crypto */
84 /* ------------------------------------------------------------------------- */
85 /* RSA */
86 #undef NO_RSA
87 #if 1
88 #ifdef USE_FAST_MATH
89 /* Maximum math bits (Max RSA key bits * 2) */
90 #undef FP_MAX_BITS
91 #define FP_MAX_BITS 8192
92 #endif
93
94 /* half as much memory but twice as slow */
95 #undef RSA_LOW_MEM
96 //#define RSA_LOW_MEM
97
98 /* Enables blinding mode, to prevent timing attacks */
99 #if 1
100 #undef WC_RSA_BLINDING
101 #define WC_RSA_BLINDING
102 #else
103 #undef WC_NO_HARDEN
104 #define WC_NO_HARDEN
105 #endif
106
107 /* RSA PSS Support */
108 #if 1
109 #define WC_RSA_PSS
110 #endif
111
112 #if 1
113 #define WC_RSA_NO_PADDING
114 #endif
115 #else
116 #define NO_RSA
117 #endif
118
119 /* ECC */
120 #undef HAVE_ECC
121 #if 1
122 #define HAVE_ECC
123
124 // Manually add support for curves.
125 #undef ECC_USER_CURVES
126 #define ECC_USER_CURVES
127
128 #ifdef ECC_USER_CURVES
129 /* Manual Curve Selection */
130 #define HAVE_ECC192 // For WolfSSL
131 #define HAVE_ECC224 // For WolfSSL
132 #undef NO_ECC256
133
134 // Added for specific curve support for WolfSSH
135 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
136 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
137 #define ECC192
138 #define ECC224
139 #undef NO_ECC_SECP

NetBurner, Inc.
22.188 MON_SAME70/user_settings.h 963

140 #define HAVE_ECC_SECPR2


141 #define HAVE_ECC_SECPR3
142
143 #ifdef ENABLE_ECC384 // predef.h
144 #define HAVE_ECC384 // - Disabled until we can get better performance
145 #endif
146
147 #ifdef ENABLE_ECC521 // predef.h
148 #define HAVE_ECC521 // - Disabled until we can get better performance
149 #endif
150
151 #ifdef ENABLE_ED25519 // predef.h
152 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
153 #define HAVE_CURVE25519
154
155 /* Optionally use small math (less flash usage, but much slower) */
156 //#define CURVED25519_SMALL
157 #endif
158 #endif
159
160 /* Fixed point cache (speeds repeated operations against same private key) */
161 #undef FP_ECC
162 #define FP_ECC
163 #ifdef FP_ECC
164 /* Bits / Entries */
165 #undef FP_ENTRIES
166 #define FP_ENTRIES 15
167 #undef FP_LUT
168 #define FP_LUT 4
169 #endif
170
171 /* Optional ECC calculation method */
172 /* Note: doubles heap usage, but slightly faster */
173 #undef ECC_SHAMIR
174 #define ECC_SHAMIR
175
176 /* Reduces heap usage, but slower */
177 #undef ECC_TIMING_RESISTANT
178 //#define ECC_TIMING_RESISTANT // - Disabled for performance
179
180 /* Enable cofactor support */
181 #ifdef HAVE_FIPS
182 #undef HAVE_ECC_CDH
183 #define HAVE_ECC_CDH
184 #endif
185
186 /* Validate import */
187 #ifdef HAVE_FIPS
188 #undef WOLFSSL_VALIDATE_ECC_IMPORT
189 #define WOLFSSL_VALIDATE_ECC_IMPORT
190 #endif
191
192 /* Compressed Key Support */
193 #undef HAVE_COMP_KEY
194 //#define HAVE_COMP_KEY
195
196 /* Use alternate ECC size for ECC math */
197 #ifdef USE_FAST_MATH
198 #ifdef NO_RSA
199 /* Custom fastmath size if not using RSA */
200 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
201 #undef FP_MAX_BITS
202 #define FP_MAX_BITS (256 + 32)
203 #else
204 #undef ALT_ECC_SIZE
205 #define ALT_ECC_SIZE
206 #endif
207
208 /* Speedups specific to curve */
209 #ifndef NO_ECC256
210 #undef TFM_ECC256
211 #define TFM_ECC256
212 #endif
213 #endif
214 #endif
215
216 /* DH */
217 #undef NO_DH
218 #if 1
219 /* Use table for DH instead of -lm (math) lib dependency */
220 #if 1
221 #define WOLFSSL_DH_CONST
222 #define HAVE_FFDHE_2048
223 #define HAVE_FFDHE_4096
224 //#define HAVE_FFDHE_6144
225 //#define HAVE_FFDHE_8192
226 #endif

NetBurner, Inc.
964 File Documentation

227
228 #ifdef HAVE_FIPS
229 #define WOLFSSL_VALIDATE_FFC_IMPORT
230 #define HAVE_FFDHE_Q
231 #endif
232 #else
233 #define NO_DH
234 #endif
235
236 /* AES */
237 #undef NO_AES
238 #if 1
239 #undef HAVE_AES_CBC
240 #define HAVE_AES_CBC
241
242 #undef HAVE_AESGCM
243 #define HAVE_AESGCM
244
245 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
246 #define GCM_SMALL
247
248 #undef WOLFSSL_AES_DIRECT
249 //#define WOLFSSL_AES_DIRECT
250
251 #undef HAVE_AES_ECB
252 //#define HAVE_AES_ECB
253
254 #undef WOLFSSL_AES_COUNTER
255 //#define WOLFSSL_AES_COUNTER
256
257 #undef HAVE_AESCCM
258 #define HAVE_AESCCM
259 #else
260 #define NO_AES
261 #endif
262
263 /* DES3 */
264 #undef NO_DES3
265 #if 1
266 #else
267 #define NO_DES3
268 #endif
269
270 /* ChaCha20 / Poly1305 */
271 //#undef HAVE_CHACHA
272 //#undef HAVE_POLY1305
273 //#if 0
274 #define HAVE_CHACHA
275 #define HAVE_POLY1305
276
277 /* Needed for Poly1305 */
278 #undef HAVE_ONE_TIME_AUTH
279 #define HAVE_ONE_TIME_AUTH
280 //#endif
281
282 /* Ed25519 / Curve25519 */
283 //#undef HAVE_CURVE25519
284 //#undef HAVE_ED25519
285 //#if 0
286 #define HAVE_CURVE25519
287 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
288
289 /* Optionally use small math (less flash usage, but much slower) */
290 #if 1
291 #define CURVED25519_SMALL
292 #endif
293 //#endif
294
295 /* ------------------------------------------------------------------------- */
296 /* Hashing */
297 /* ------------------------------------------------------------------------- */
298 /* Sha */
299 //#undef WOLFSSL_STATIC_RSA
300 #if 1
301 /* 1k smaller, but 25% slower */
302 //#define USE_SLOW_SHA
303 #else
304 #define NO_SHA
305 #endif
306
307 /* Sha256 */
308 #undef NO_SHA256
309 #if 1
310 /* not unrolled - ~2k smaller and ~25% slower */
311 //#define USE_SLOW_SHA256
312
313 /* Sha224 */

NetBurner, Inc.
22.188 MON_SAME70/user_settings.h 965

314 #if 0
315 #define WOLFSSL_SHA224
316 #endif
317 #else
318 #define NO_SHA256
319 #endif
320
321 /* Sha512 */
322 //#undef WOLFSSL_SHA512
323 //#if 0
324 #define WOLFSSL_SHA512
325
326 /* Sha384 */
327 //#undef WOLFSSL_SHA384
328 //#if 0
329 #define WOLFSSL_SHA384
330 //#endif
331
332 /* over twice as small, but 50% slower */
333 //#define USE_SLOW_SHA512
334 //#endif
335
336 /* Sha3 */
337 #undef WOLFSSL_SHA3
338 #if 0
339 #define WOLFSSL_SHA3
340 #endif
341
342 /* MD5 */
343 #undef NO_MD5
344 #if 0
345
346 #else
347 #define NO_MD5
348 #endif
349
350 /* HKDF */
351 #undef HAVE_HKDF
352 #if 1
353 #define HAVE_HKDF
354 #endif
355
356 /* CMAC */
357 #undef WOLFSSL_CMAC
358 #if 0
359 #define WOLFSSL_CMAC
360 #endif
361
362 /* ------------------------------------------------------------------------- */
363 /* Benchmark / Test */
364 /* ------------------------------------------------------------------------- */
365 /* Use reduced benchmark / test sizes */
366 #undef BENCH_EMBEDDED
367 //#define BENCH_EMBEDDED
368
369 #undef USE_CERT_BUFFERS_2048
370 //#define USE_CERT_BUFFERS_2048
371
372 #undef USE_CERT_BUFFERS_1024
373 //#define USE_CERT_BUFFERS_1024
374
375 #undef USE_CERT_BUFFERS_256
376 //#define USE_CERT_BUFFERS_256
377
378 /* ------------------------------------------------------------------------- */
379 /* Debugging */
380 /* ------------------------------------------------------------------------- */
381
382 #undef DEBUG_WOLFSSL
383 #undef NO_ERROR_STRINGS
384 #if 0
385 #define DEBUG_WOLFSSL
386 #else
387 #if 0
388 #define NO_ERROR_STRINGS
389 #endif
390 #endif
391
392 /* ------------------------------------------------------------------------- */
393 /* Memory */
394 /* ------------------------------------------------------------------------- */
395
396 /* Override Memory API’s */
397 #if 0
398 #undef XMALLOC_OVERRIDE
399 #define XMALLOC_OVERRIDE
400

NetBurner, Inc.
966 File Documentation

401 /* prototypes for user heap override functions */


402 /* Note: Realloc only required for normal math */
403 #include <stddef.h> /* for size_t */
404 extern void *myMalloc(size_t n, void* heap, int type);
405 extern void myFree(void *p, void* heap, int type);
406 extern void *myRealloc(void *p, size_t n, void* heap, int type);
407
408 #define XMALLOC(n, h, t) myMalloc(n, h, t)
409 #define XFREE(p, h, t) myFree(p, h, t)
410 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
411 #endif
412
413 #if 0
414 /* Static memory requires fast math */
415 #define WOLFSSL_STATIC_MEMORY
416
417 /* Disable fallback malloc/free */
418 #define WOLFSSL_NO_MALLOC
419 #if 1
420 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
421 #endif
422 #endif
423
424 /* Memory callbacks */
425 #if 0
426 #undef USE_WOLFSSL_MEMORY
427 #define USE_WOLFSSL_MEMORY
428
429 /* Use this to measure / print heap usage */
430 #if 1
431 #undef WOLFSSL_TRACK_MEMORY
432 #define WOLFSSL_TRACK_MEMORY
433
434 #undef WOLFSSL_DEBUG_MEMORY
435 #define WOLFSSL_DEBUG_MEMORY
436 #endif
437 #else
438 #ifndef WOLFSSL_STATIC_MEMORY
439 #define NO_WOLFSSL_MEMORY
440 /* Otherwise we will use stdlib malloc, free and realloc */
441 #endif
442 #endif
443
444 /* ------------------------------------------------------------------------- */
445 /* Port */
446 /* ------------------------------------------------------------------------- */
447
448 /* Override Current Time */
449 /* Allows custom "custom_time()" function to be used for benchmark */
450 #define WOLFSSL_USER_CURRTIME
451 #define WOLFSSL_GMTIME
452 #define USER_TICKS
453 #include <time.h>
454 extern unsigned long my_time(time_t *timer);
455 #define XTIME my_time
456
457 /* ------------------------------------------------------------------------- */
458 /* RNG */
459 /* ------------------------------------------------------------------------- */
460
461 /* Seed Source */
462 /* Size of returned HW RNG value */
463 #define CUSTOM_RAND_TYPE unsigned int
464 extern unsigned int my_rng_seed_gen(void);
465 #undef CUSTOM_RAND_GENERATE
466 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
467
468 // NetBurner specific define for enabling hardware random number generation for M7
469 #define GATHER_RANDOM_USE_HW
470
471 /* Choose RNG method */
472 #if 1
473 /* Use built-in P-RNG (SHA256 based) with HW RNG */
474 /* P-RNG + HW RNG (P-RNG is ~8K) */
475 #undef HAVE_HASHDRBG
476 //#define HAVE_HASHDRBG
477 #else
478 #undef WC_NO_HASHDRBG
479 #define WC_NO_HASHDRBG
480
481 /* Bypass P-RNG and use only HW RNG */
482 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
483 #undef CUSTOM_RAND_GENERATE_BLOCK
484 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
485 #endif
486
487 /* ------------------------------------------------------------------------- */

NetBurner, Inc.
22.188 MON_SAME70/user_settings.h 967

488 /* Custom Standard Lib */


489 /* ------------------------------------------------------------------------- */
490 /* Allows override of all standard library functions */
491 #undef STRING_USER
492 #if 0
493 #define STRING_USER
494
495 #include <string.h>
496
497 #undef USE_WOLF_STRSEP
498 #define USE_WOLF_STRSEP
499 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
500
501 #undef USE_WOLF_STRTOK
502 #define USE_WOLF_STRTOK
503 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
504
505 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
506
507 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
508 #define XMEMSET(b, c, l) memset((b), (c), (l))
509 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
510 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
511
512 #define XSTRLEN(s1) strlen((s1))
513 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
514 #define XSTRSTR(s1, s2) strstr((s1), (s2))
515
516 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
517 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
518 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
519
520 #define XSNPRINTF snprintf
521 #endif
522
523 /* ------------------------------------------------------------------------- */
524 /* Enable Features */
525 /* ------------------------------------------------------------------------- */
526 #undef WOLFSSL_TLS13
527 #if 1
528 #define WOLFSSL_TLS13
529 #endif
530
531 #undef WOLFSSL_KEY_GEN
532 #if 1
533 #define WOLFSSL_KEY_GEN
534 #endif
535
536 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
537 #define WOLFSSL_OLD_PRIME_CHECK
538 #endif
539
540 #undef KEEP_PEER_CERT
541 #define KEEP_PEER_CERT
542
543 #undef HAVE_COMP_KEY
544 //#define HAVE_COMP_KEY
545
546 #undef HAVE_TLS_EXTENSIONS
547 #define HAVE_TLS_EXTENSIONS
548
549 #undef HAVE_SUPPORTED_CURVES
550 #define HAVE_SUPPORTED_CURVES
551
552 #undef WOLFSSL_BASE64_ENCODE
553 #define WOLFSSL_BASE64_ENCODE
554
555 #define SMALL_SESSION_CACHE
556 #define HAVE_SESSION_TICKET
557
558 /* ------------------------------------------------------------------------- */
559 /* Disable Features */
560 /* ------------------------------------------------------------------------- */
561 #undef NO_WOLFSSL_SERVER
562 //#define NO_WOLFSSL_SERVER
563
564 #undef NO_WOLFSSL_CLIENT
565 //#define NO_WOLFSSL_CLIENT
566
567 #undef NO_CRYPT_TEST
568 //#define NO_CRYPT_TEST
569
570 #undef NO_CRYPT_BENCHMARK
571 //#define NO_CRYPT_BENCHMARK
572
573 #undef WOLFCRYPT_ONLY
574 //#define WOLFCRYPT_ONLY

NetBurner, Inc.
968 File Documentation

575
576 /* In-lining of misc.c functions */
577 /* If defined, must include wolfcrypt/src/misc.c in build */
578 /* Slower, but about 1k smaller */
579 #undef NO_INLINE
580 //#define NO_INLINE
581
582 #undef WOLFSSL_NO_SOCK
583 #define WOLFSSL_NO_SOCK
584
585 #undef NO_WOLFSSL_DIR
586 #define NO_WOLFSSL_DIR
587
588 #undef NO_FILESYSTEM
589 #define NO_FILESYSTEM
590
591 #undef NO_WRITEV
592 #define NO_WRITEV
593
594 #undef NO_MAIN_DRIVER
595 #define NO_MAIN_DRIVER
596
597 #undef NO_DEV_RANDOM
598 #define NO_DEV_RANDOM
599
600 #undef NO_DSA
601 #define NO_DSA
602
603 #undef NO_RC4
604 //#define NO_RC4
605
606 #undef NO_OLD_TLS
607 #define NO_OLD_TLS
608
609 #undef NO_HC128
610 #define NO_HC128
611
612 #undef NO_RABBIT
613 #define NO_RABBIT
614
615 #undef NO_PSK
616 #define NO_PSK
617
618 #undef NO_MD4
619 #define NO_MD4
620
621 #undef NO_PWDBASED
622 #define NO_PWDBASED
623
624 #undef NO_CODING
625 //#define NO_CODING
626
627 #undef NO_ASN_TIME
628 //#define NO_ASN_TIME
629
630 #undef NO_CERTS
631 //#define NO_CERTS
632
633 #undef NO_SIG_WRAPPER
634 //#define NO_SIG_WRAPPER
635
636 #undef WOLFSSL_IGNORE_FILE_WARN
637 #define WOLFSSL_IGNORE_FILE_WARN
638
639 #undef NO_TLS
640
641 #define HAVE_SNI
642
643 // Settings made for compatibility
644 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
645 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
646 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
647 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
648
649 #define WOLFSSL_CERT_REQ
650 #define WOLFSSL_CERT_GEN
651 #define WOLFSSL_ALT_NAMES
652 #define WOLFSSL_DER_TO_PEM
653 #define WOLFSSL_KEY_GEN
654
655 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
656 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
657
658 // For wolfSSH
659 //#undef WOLFSSH_SFTP
660 //#define WOLFSSH_SFTP

NetBurner, Inc.
22.189 NANO54415/user_settings.h 969

661
662 //#undef WOLFSSH_SCP
663 //#define WOLFSSH_SCP
664
665 #undef WOLFSSH_USER_IO
666 #define WOLFSSH_USER_IO
667
668 #ifdef __cplusplus
669 }
670 #endif
671
672 #endif /* WOLFSSL_USER_SETTINGS_H */

22.189 NANO54415/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 /* Default build with fast math */
11
12 // uncomment and add wolfSSL_Debugging_ON() to app for debug messages
13 #undef DEBUG_WOLFSSL
14 #undef NO_ERROR_STRINGS
15 //#define DEBUG_WOLFSSL
16
17 #include <predef.h>
18 #include <endian.h>
19 #define XHTONS(a) __htons(a)
20
21 //#define WOLFSSL_CALLBACKS
22
23 //#define NO_TIMEVAL
24
25 /* ------------------------------------------------------------------------- */
26 /* Platform */
27 /* ------------------------------------------------------------------------- */
28 /* Used for getting random value for seeding RNG */
29 //#define WOLFSSL_NETBURNER
30
31 /* Properly sets endian order and data type sizes */
32 #define BIG_ENDIAN_ORDER
33
34 #undef SINGLE_THREADED
35
36 // We provide IO callbacks
37 #define WOLFSSL_USER_IO
38
39 /* ------------------------------------------------------------------------- */
40 /* Math Configuration */
41 /* ------------------------------------------------------------------------- */
42 #ifndef SIZEOF_LONG
43 #define SIZEOF_LONG 4
44 #endif
45 #ifndef SIZEOF_LONG_LONG
46 #define SIZEOF_LONG_LONG 8
47 #endif
48
49 #define ULLONG_MAX 4294967295UL
50 #define SP_WORD_SIZE 16
51
52 #define WOLFSSL_SP
53 #define WOLFSSL_SP_SMALL
54
55 #define USE_FAST_MATH
56 #define WOLFSSL_SMALL_STACK
57
58 /* hardening against side channel attacks */
59 #if defined(USE_FAST_MATH)
60 #define TFM_TIMING_RESISTANT
61 #endif /* USE_FAST_MATH */
62
63 // OPENSSL_EXTRA uses a lot more memory but is needed in order to enable
64 // compatibility layer API
65 //#define OPENSSL_EXTRA
66
67 /* enable features - added to match MODM7AE70 */
68
69 // additional RSA padding schemes
70 #undef NO_RSA

NetBurner, Inc.
970 File Documentation

71 #ifndef NO_RSA
72 #if defined(USE_FAST_MATH)
73 /* Maximum math bits (Max RSA key bits * 2) */
74 #undef FP_MAX_BITS
75 #ifdef ENABLE_RSA_4K // predef.h
76 #define FP_MAX_BITS 8192
77 #else
78 #define FP_MAX_BITS 4096
79 #endif
80 #endif
81
82 /* this slows down RSA operations but increases side channel resistance */
83 #define WC_RSA_BLINDING
84
85 /* RSA PSS Support */
86 #define WC_RSA_NO_PADDING
87 #define WC_RSA_PSS
88 #endif
89
90 #undef NO_AES
91 #ifndef NO_AES
92 #define HAVE_AES_CBC
93 #define HAVE_AESGCM
94 #define GCM_SMALL
95 #define HAVE_AESCCM
96 #endif
97
98 #define HAVE_ECC
99 #ifdef HAVE_ECC
100 #undef ECC_TIMING_RESISTANT
101 //#define ECC_TIMING_RESISTANT // - Disabled until we can get better performance
102
103 // Manually add support for curves.
104 #undef ECC_USER_CURVES
105 #define ECC_USER_CURVES
106
107 #ifdef ECC_USER_CURVES
108 /* Manual Curve Selection */
109 #define HAVE_ECC192 // For WolfSSL
110 #define HAVE_ECC224 // For WolfSSL
111 #undef NO_ECC256
112
113 // Added for specific curve support for WolfSSH
114 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
115 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
116 #define ECC192
117 #define ECC224
118 #undef NO_ECC_SECP
119 #define HAVE_ECC_SECPR2
120 #define HAVE_ECC_SECPR3
121
122 #ifdef ENABLE_ECC384 // predef.h
123 #define HAVE_ECC384 // - Disabled until we can get better performance
124 #endif
125
126 #ifdef ENABLE_ECC521 // predef.h
127 #define HAVE_ECC521 // - Disabled until we can get better performance
128 #endif
129
130 #ifdef ENABLE_ED25519 // predef.h
131 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
132 #define HAVE_CURVE25519
133
134 /* Optionally use small math (less flash usage, but much slower) */
135 //#define CURVED25519_SMALL
136 #endif
137 #endif
138
139 /* Fixed point cache (speeds repeated operations against same private key) */
140 #undef FP_ECC
141 #define FP_ECC
142 #ifdef FP_ECC
143 /* Bits / Entries */
144 #undef FP_ENTRIES
145 #define FP_ENTRIES 15
146 #undef FP_LUT
147 #define FP_LUT 4
148 #endif
149
150 #define ECC_SHAMIR
151 #if defined(USE_FAST_MATH)
152 #define ALT_ECC_SIZE
153 #endif
154
155 #ifndef NO_ECC256
156 #define TFM_ECC256
157 #endif

NetBurner, Inc.
22.189 NANO54415/user_settings.h 971

158 #endif
159
160 /* DH */
161 #undef NO_DH
162 #if 1
163 /* Use table for DH instead of -lm (math) lib dependency */
164 #if 1
165 #define WOLFSSL_DH_CONST
166 #define HAVE_FFDHE_2048
167 #ifdef ENABLE_RSA_4K
168 #define HAVE_FFDHE_4096
169 #endif
170 //#define HAVE_FFDHE_6144
171 //#define HAVE_FFDHE_8192
172 #endif
173
174 #ifdef HAVE_FIPS
175 #define WOLFSSL_VALIDATE_FFC_IMPORT
176 #define HAVE_FFDHE_Q
177 #endif
178 #else
179 #define NO_DH
180 #endif
181
182 /* AES */
183 #undef NO_AES
184 #if 1
185 #undef HAVE_AES_CBC
186 #define HAVE_AES_CBC
187
188 #undef HAVE_AESGCM
189 #define HAVE_AESGCM
190
191 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
192 #define GCM_SMALL
193
194 #undef WOLFSSL_AES_DIRECT
195 //#define WOLFSSL_AES_DIRECT
196
197 #undef HAVE_AES_ECB
198 //#define HAVE_AES_ECB
199
200 #undef WOLFSSL_AES_COUNTER
201 //#define WOLFSSL_AES_COUNTER
202
203 #undef HAVE_AESCCM
204 #define HAVE_AESCCM
205 #else
206 #define NO_AES
207 #endif
208
209 #define HAVE_CHACHA
210 #define HAVE_POLY1305
211 #define HAVE_ONE_TIME_AUTH
212
213 /* Hashing */
214 #undef NO_SHA256
215 #define WOLFSSL_SHA512
216 #define WOLFSSL_SHA384
217 #undef WOLFSSL_SHA3
218 #define NO_MD5
219 #undef HAVE_HKDF
220 #define HAVE_HKDF
221 #undef WOLFSSL_CMAC
222
223 /* ------------------------------------------------------------------------- */
224 /* Port */
225 /* ------------------------------------------------------------------------- */
226
227 /* Override Current Time */
228 /* Allows custom "custom_time()" function to be used for benchmark */
229 #define WOLFSSL_USER_CURRTIME
230 //#define WOLFSSL_GMTIME
231 #define HAVE_GMTIME_R
232 #define USER_TICKS
233 #include <time.h>
234 extern unsigned long my_time(time_t *timer);
235 #define XTIME my_time
236
237 /* ------------------------------------------------------------------------- */
238 /* RNG */
239 /* ------------------------------------------------------------------------- */
240
241 /* Seed Source */
242 /* Size of returned HW RNG value */
243 #define CUSTOM_RAND_TYPE unsigned int
244 extern unsigned int my_rng_seed_gen(void);

NetBurner, Inc.
972 File Documentation

245 #undef CUSTOM_RAND_GENERATE


246 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
247
248 // From MODM7 User Settings
249 /* ------------------------------------------------------------------------- */
250 /* Enable Features */
251 /* ------------------------------------------------------------------------- */
252 #undef WOLFSSL_TLS13
253 #if 1
254 #define WOLFSSL_TLS13
255 #endif
256
257 #define KEEP_PEER_CERT
258
259 #undef HAVE_COMP_KEY
260 //#define HAVE_COMP_KEY
261
262 #define HAVE_TLS_EXTENSIONS
263
264 #define HAVE_SUPPORTED_CURVES
265
266 #define WOLFSSL_BASE64_ENCODE
267
268 #define SMALL_SESSION_CACHE
269 #define HAVE_SESSION_TICKET
270
271 /* ------------------------------------------------------------------------- */
272 /* Disable Features */
273 /* ------------------------------------------------------------------------- */
274 #undef NO_WOLFSSL_SERVER
275 //#define NO_WOLFSSL_SERVER
276
277 #undef NO_WOLFSSL_CLIENT
278 //#define NO_WOLFSSL_CLIENT
279
280 #undef NO_CRYPT_TEST
281 //#define NO_CRYPT_TEST
282
283 #undef NO_CRYPT_BENCHMARK
284 //#define NO_CRYPT_BENCHMARK
285
286 #undef WOLFCRYPT_ONLY
287 //#define WOLFCRYPT_ONLY
288
289 #ifndef WOLFSSL_STATIC_MEMORY
290 #define NO_WOLFSSL_MEMORY
291 #endif
292
293 #undef STRING_USER
294
295 /* In-lining of misc.c functions */
296 /* If defined, must include wolfcrypt/src/misc.c in build */
297 /* Slower, but about 1k smaller */
298 #undef NO_INLINE
299 //#define NO_INLINE
300
301 #undef WOLFSSL_NO_SOCK
302 #define WOLFSSL_NO_SOCK
303
304 #undef NO_WOLFSSL_DIR
305 #define NO_WOLFSSL_DIR
306
307 #undef NO_FILESYSTEM
308 #define NO_FILESYSTEM
309
310 #undef NO_WRITEV
311 #define NO_WRITEV
312
313 #undef NO_MAIN_DRIVER
314 #define NO_MAIN_DRIVER
315
316 #undef NO_DEV_RANDOM
317 #define NO_DEV_RANDOM
318
319 #undef NO_DSA
320 #define NO_DSA
321
322 #undef NO_RC4
323 //#define NO_RC4
324
325 #undef NO_OLD_TLS
326 #define NO_OLD_TLS
327
328 #undef NO_HC128
329 #define NO_HC128
330
331 #undef NO_RABBIT

NetBurner, Inc.
22.190 RT10XX_RAM/user_settings.h 973

332 #define NO_RABBIT


333
334 #undef NO_PSK
335 #define NO_PSK
336
337 #undef NO_MD4
338 #define NO_MD4
339
340 #undef NO_PWDBASED
341 #define NO_PWDBASED
342
343 #undef NO_CODING
344 //#define NO_CODING
345
346 #undef NO_ASN_TIME
347 //#define NO_ASN_TIME
348
349 #undef NO_CERTS
350 //#define NO_CERTS
351
352 #undef NO_SIG_WRAPPER
353 //#define NO_SIG_WRAPPER
354
355 #undef WOLFSSL_IGNORE_FILE_WARN
356 #define WOLFSSL_IGNORE_FILE_WARN
357
358 #undef NO_TLS
359
360 #undef NO_DES3
361
362 #undef NO_DH
363
364 #define HAVE_SNI
365
366 // Settings made for compatibility
367 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
368 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
369 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
370 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
371
372 #define WOLFSSL_CERT_REQ
373 #define WOLFSSL_CERT_GEN
374 #define WOLFSSL_ALT_NAMES
375 #define WOLFSSL_DER_TO_PEM
376 #define WOLFSSL_KEY_GEN
377
378 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
379 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
380
381 // For wolfSSH
382 //#undef WOLFSSH_SFTP
383 //#define WOLFSSH_SFTP
384
385 //#undef WOLFSSH_SCP
386 //#define WOLFSSH_SCP
387
388 #undef WOLFSSH_USER_IO
389 #define WOLFSSH_USER_IO
390
391 #ifdef __cplusplus
392 }
393 #endif
394
395 #endif /* USER_SETTINGS_H */

22.190 RT10XX_RAM/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 //#define DEBUG_WOLFSSL
11 #include <predef.h>
12 #include <endian.h>
13 #define XHTONS(a) __htons(a)
14
15 //#define WOLFSSL_CALLBACKS
16
17 /* ------------------------------------------------------------------------- */

NetBurner, Inc.
974 File Documentation

18 /* Platform */
19 /* ------------------------------------------------------------------------- */
20 #undef WOLFSSL_GENERAL_ALIGNMENT
21 #define WOLFSSL_GENERAL_ALIGNMENT 4
22
23 #undef SINGLE_THREADED
24 //#define SINGLE_THREADED
25
26 #undef WOLFSSL_SMALL_STACK
27 #define WOLFSSL_SMALL_STACK
28
29 #undef WOLFSSL_USER_IO
30 #define WOLFSSL_USER_IO
31
32 /* ------------------------------------------------------------------------- */
33 /* Math Configuration */
34 /* ------------------------------------------------------------------------- */
35 #undef SIZEOF_LONG_LONG
36 #define SIZEOF_LONG_LONG 8
37
38 #undef USE_FAST_MATH
39 #if 1
40 #define USE_FAST_MATH
41
42 #undef TFM_TIMING_RESISTANT
43 #define TFM_TIMING_RESISTANT
44
45 /* Optimizations */
46 //#define TFM_ARM
47 #endif
48
49 /* Wolf Single Precision Math */
50 #undef WOLFSSL_SP
51 #if 0
52 #define WOLFSSL_SP
53 #define WOLFSSL_SP_SMALL /* use smaller version of code */
54 #define WOLFSSL_HAVE_SP_RSA
55 #define WOLFSSL_HAVE_SP_DH
56 #define WOLFSSL_HAVE_SP_ECC
57 #define WOLFSSL_SP_CACHE_RESISTANT
58 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
59
60 /* 64 or 32 bit version */
61 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
62 //#define WOLFSSL_SP_ARM32_ASM
63 //#define WOLFSSL_SP_ARM64_ASM
64 #endif
65
66 /* ------------------------------------------------------------------------- */
67 /* FIPS - Requires eval or license from wolfSSL */
68 /* ------------------------------------------------------------------------- */
69 #undef HAVE_FIPS
70 #if 0
71 #define HAVE_FIPS
72
73 #undef HAVE_FIPS_VERSION
74 #define HAVE_FIPS_VERSION 2
75
76 #ifdef SINGLE_THREADED
77 #undef NO_THREAD_LS
78 #define NO_THREAD_LS
79 #endif
80 #endif
81
82 /* ------------------------------------------------------------------------- */
83 /* Crypto */
84 /* ------------------------------------------------------------------------- */
85 /* RSA */
86 #undef NO_RSA
87 #if 1
88 #ifdef USE_FAST_MATH
89 /* Maximum math bits (Max RSA key bits * 2) */
90 #undef FP_MAX_BITS
91 #define FP_MAX_BITS 8192
92 #endif
93
94 /* half as much memory but twice as slow */
95 #undef RSA_LOW_MEM
96 //#define RSA_LOW_MEM
97
98 /* Enables blinding mode, to prevent timing attacks */
99 #if 1
100 #undef WC_RSA_BLINDING
101 #define WC_RSA_BLINDING
102 #else
103 #undef WC_NO_HARDEN
104 #define WC_NO_HARDEN

NetBurner, Inc.
22.190 RT10XX_RAM/user_settings.h 975

105 #endif
106
107 /* RSA PSS Support */
108 #if 1
109 #define WC_RSA_PSS
110 #endif
111
112 #if 1
113 #define WC_RSA_NO_PADDING
114 #endif
115 #else
116 #define NO_RSA
117 #endif
118
119 /* ECC */
120 #undef HAVE_ECC
121 #if 1
122 #define HAVE_ECC
123
124 // Manually add support for curves.
125 #undef ECC_USER_CURVES
126 #define ECC_USER_CURVES
127
128 #ifdef ECC_USER_CURVES
129 /* Manual Curve Selection */
130 #define HAVE_ECC192 // For WolfSSL
131 #define HAVE_ECC224 // For WolfSSL
132 #undef NO_ECC256
133
134 // Added for specific curve support for WolfSSH
135 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
136 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
137 #define ECC192
138 #define ECC224
139 #undef NO_ECC_SECP
140 #define HAVE_ECC_SECPR2
141 #define HAVE_ECC_SECPR3
142
143 #ifdef ENABLE_ECC384 // predef.h
144 #define HAVE_ECC384 // - Disabled until we can get better performance
145 #endif
146
147 #ifdef ENABLE_ECC521 // predef.h
148 #define HAVE_ECC521 // - Disabled until we can get better performance
149 #endif
150
151 #ifdef ENABLE_ED25519 // predef.h
152 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
153 #define HAVE_CURVE25519
154
155 /* Optionally use small math (less flash usage, but much slower) */
156 //#define CURVED25519_SMALL
157 #endif
158 #endif
159
160 /* Fixed point cache (speeds repeated operations against same private key) */
161 #undef FP_ECC
162 #define FP_ECC
163 #ifdef FP_ECC
164 /* Bits / Entries */
165 #undef FP_ENTRIES
166 #define FP_ENTRIES 15
167 #undef FP_LUT
168 #define FP_LUT 4
169 #endif
170
171 /* Optional ECC calculation method */
172 /* Note: doubles heap usage, but slightly faster */
173 #undef ECC_SHAMIR
174 #define ECC_SHAMIR
175
176 /* Reduces heap usage, but slower */
177 #undef ECC_TIMING_RESISTANT
178 //#define ECC_TIMING_RESISTANT // - Disabled for performance
179
180 /* Enable cofactor support */
181 #ifdef HAVE_FIPS
182 #undef HAVE_ECC_CDH
183 #define HAVE_ECC_CDH
184 #endif
185
186 /* Validate import */
187 #ifdef HAVE_FIPS
188 #undef WOLFSSL_VALIDATE_ECC_IMPORT
189 #define WOLFSSL_VALIDATE_ECC_IMPORT
190 #endif
191

NetBurner, Inc.
976 File Documentation

192 /* Compressed Key Support */


193 #undef HAVE_COMP_KEY
194 //#define HAVE_COMP_KEY
195
196 /* Use alternate ECC size for ECC math */
197 #ifdef USE_FAST_MATH
198 #ifdef NO_RSA
199 /* Custom fastmath size if not using RSA */
200 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
201 #undef FP_MAX_BITS
202 #define FP_MAX_BITS (256 + 32)
203 #else
204 #undef ALT_ECC_SIZE
205 #define ALT_ECC_SIZE
206 #endif
207
208 /* Speedups specific to curve */
209 #ifndef NO_ECC256
210 #undef TFM_ECC256
211 #define TFM_ECC256
212 #endif
213 #endif
214 #endif
215
216 /* DH */
217 #undef NO_DH
218 #if 1
219 /* Use table for DH instead of -lm (math) lib dependency */
220 #if 1
221 #define WOLFSSL_DH_CONST
222 #define HAVE_FFDHE_2048
223 #define HAVE_FFDHE_4096
224 //#define HAVE_FFDHE_6144
225 //#define HAVE_FFDHE_8192
226 #endif
227
228 #ifdef HAVE_FIPS
229 #define WOLFSSL_VALIDATE_FFC_IMPORT
230 #define HAVE_FFDHE_Q
231 #endif
232 #else
233 #define NO_DH
234 #endif
235
236 /* AES */
237 #undef NO_AES
238 #if 1
239 #undef HAVE_AES_CBC
240 #define HAVE_AES_CBC
241
242 #undef HAVE_AESGCM
243 #define HAVE_AESGCM
244
245 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
246 #define GCM_SMALL
247
248 #undef WOLFSSL_AES_DIRECT
249 //#define WOLFSSL_AES_DIRECT
250
251 #undef HAVE_AES_ECB
252 //#define HAVE_AES_ECB
253
254 #undef WOLFSSL_AES_COUNTER
255 //#define WOLFSSL_AES_COUNTER
256
257 #undef HAVE_AESCCM
258 #define HAVE_AESCCM
259 #else
260 #define NO_AES
261 #endif
262
263 /* DES3 */
264 #undef NO_DES3
265 #if 1
266 #else
267 #define NO_DES3
268 #endif
269
270 /* ChaCha20 / Poly1305 */
271 //#undef HAVE_CHACHA
272 //#undef HAVE_POLY1305
273 //#if 0
274 #define HAVE_CHACHA
275 #define HAVE_POLY1305
276
277 /* Needed for Poly1305 */
278 #undef HAVE_ONE_TIME_AUTH

NetBurner, Inc.
22.190 RT10XX_RAM/user_settings.h 977

279 #define HAVE_ONE_TIME_AUTH


280 //#endif
281
282 /* Ed25519 / Curve25519 */
283 //#undef HAVE_CURVE25519
284 //#undef HAVE_ED25519
285 //#if 0
286 #define HAVE_CURVE25519
287 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
288
289 /* Optionally use small math (less flash usage, but much slower) */
290 #if 1
291 #define CURVED25519_SMALL
292 #endif
293 //#endif
294
295 /* ------------------------------------------------------------------------- */
296 /* Hashing */
297 /* ------------------------------------------------------------------------- */
298 /* Sha */
299 //#undef WOLFSSL_STATIC_RSA
300 #if 1
301 /* 1k smaller, but 25% slower */
302 //#define USE_SLOW_SHA
303 #else
304 #define NO_SHA
305 #endif
306
307 /* Sha256 */
308 #undef NO_SHA256
309 #if 1
310 /* not unrolled - ~2k smaller and ~25% slower */
311 //#define USE_SLOW_SHA256
312
313 /* Sha224 */
314 #if 0
315 #define WOLFSSL_SHA224
316 #endif
317 #else
318 #define NO_SHA256
319 #endif
320
321 /* Sha512 */
322 //#undef WOLFSSL_SHA512
323 //#if 0
324 #define WOLFSSL_SHA512
325
326 /* Sha384 */
327 //#undef WOLFSSL_SHA384
328 //#if 0
329 #define WOLFSSL_SHA384
330 //#endif
331
332 /* over twice as small, but 50% slower */
333 //#define USE_SLOW_SHA512
334 //#endif
335
336 /* Sha3 */
337 #undef WOLFSSL_SHA3
338 #if 0
339 #define WOLFSSL_SHA3
340 #endif
341
342 /* MD5 */
343 #undef NO_MD5
344 #if 0
345
346 #else
347 #define NO_MD5
348 #endif
349
350 /* HKDF */
351 #undef HAVE_HKDF
352 #if 1
353 #define HAVE_HKDF
354 #endif
355
356 /* CMAC */
357 #undef WOLFSSL_CMAC
358 #if 0
359 #define WOLFSSL_CMAC
360 #endif
361
362 /* ------------------------------------------------------------------------- */
363 /* Benchmark / Test */
364 /* ------------------------------------------------------------------------- */
365 /* Use reduced benchmark / test sizes */

NetBurner, Inc.
978 File Documentation

366 #undef BENCH_EMBEDDED


367 //#define BENCH_EMBEDDED
368
369 #undef USE_CERT_BUFFERS_2048
370 //#define USE_CERT_BUFFERS_2048
371
372 #undef USE_CERT_BUFFERS_1024
373 //#define USE_CERT_BUFFERS_1024
374
375 #undef USE_CERT_BUFFERS_256
376 //#define USE_CERT_BUFFERS_256
377
378 /* ------------------------------------------------------------------------- */
379 /* Debugging */
380 /* ------------------------------------------------------------------------- */
381
382 #undef DEBUG_WOLFSSL
383 #undef NO_ERROR_STRINGS
384 #if 0
385 #define DEBUG_WOLFSSL
386 #else
387 #if 0
388 #define NO_ERROR_STRINGS
389 #endif
390 #endif
391
392 /* ------------------------------------------------------------------------- */
393 /* Memory */
394 /* ------------------------------------------------------------------------- */
395
396 /* Override Memory API’s */
397 #if 0
398 #undef XMALLOC_OVERRIDE
399 #define XMALLOC_OVERRIDE
400
401 /* prototypes for user heap override functions */
402 /* Note: Realloc only required for normal math */
403 #include <stddef.h> /* for size_t */
404 extern void *myMalloc(size_t n, void* heap, int type);
405 extern void myFree(void *p, void* heap, int type);
406 extern void *myRealloc(void *p, size_t n, void* heap, int type);
407
408 #define XMALLOC(n, h, t) myMalloc(n, h, t)
409 #define XFREE(p, h, t) myFree(p, h, t)
410 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
411 #endif
412
413 #if 0
414 /* Static memory requires fast math */
415 #define WOLFSSL_STATIC_MEMORY
416
417 /* Disable fallback malloc/free */
418 #define WOLFSSL_NO_MALLOC
419 #if 1
420 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
421 #endif
422 #endif
423
424 /* Memory callbacks */
425 #if 0
426 #undef USE_WOLFSSL_MEMORY
427 #define USE_WOLFSSL_MEMORY
428
429 /* Use this to measure / print heap usage */
430 #if 1
431 #undef WOLFSSL_TRACK_MEMORY
432 #define WOLFSSL_TRACK_MEMORY
433
434 #undef WOLFSSL_DEBUG_MEMORY
435 #define WOLFSSL_DEBUG_MEMORY
436 #endif
437 #else
438 #ifndef WOLFSSL_STATIC_MEMORY
439 #define NO_WOLFSSL_MEMORY
440 /* Otherwise we will use stdlib malloc, free and realloc */
441 #endif
442 #endif
443
444 /* ------------------------------------------------------------------------- */
445 /* Port */
446 /* ------------------------------------------------------------------------- */
447
448 /* Override Current Time */
449 /* Allows custom "custom_time()" function to be used for benchmark */
450 #define WOLFSSL_USER_CURRTIME
451 #define WOLFSSL_GMTIME
452 #define USER_TICKS

NetBurner, Inc.
22.190 RT10XX_RAM/user_settings.h 979

453 #include <time.h>


454 extern unsigned long my_time(time_t *timer);
455 #define XTIME my_time
456
457 /* ------------------------------------------------------------------------- */
458 /* RNG */
459 /* ------------------------------------------------------------------------- */
460
461 /* Seed Source */
462 /* Size of returned HW RNG value */
463 #define CUSTOM_RAND_TYPE unsigned int
464 extern unsigned int my_rng_seed_gen(void);
465 #undef CUSTOM_RAND_GENERATE
466 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
467
468 // NetBurner specific define for enabling hardware random number generation for M7
469 #define GATHER_RANDOM_USE_HW
470
471 /* Choose RNG method */
472 #if 1
473 /* Use built-in P-RNG (SHA256 based) with HW RNG */
474 /* P-RNG + HW RNG (P-RNG is ~8K) */
475 #undef HAVE_HASHDRBG
476 //#define HAVE_HASHDRBG
477 #else
478 #undef WC_NO_HASHDRBG
479 #define WC_NO_HASHDRBG
480
481 /* Bypass P-RNG and use only HW RNG */
482 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
483 #undef CUSTOM_RAND_GENERATE_BLOCK
484 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
485 #endif
486
487 /* ------------------------------------------------------------------------- */
488 /* Custom Standard Lib */
489 /* ------------------------------------------------------------------------- */
490 /* Allows override of all standard library functions */
491 #undef STRING_USER
492 #if 0
493 #define STRING_USER
494
495 #include <string.h>
496
497 #undef USE_WOLF_STRSEP
498 #define USE_WOLF_STRSEP
499 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
500
501 #undef USE_WOLF_STRTOK
502 #define USE_WOLF_STRTOK
503 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
504
505 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
506
507 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
508 #define XMEMSET(b, c, l) memset((b), (c), (l))
509 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
510 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
511
512 #define XSTRLEN(s1) strlen((s1))
513 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
514 #define XSTRSTR(s1, s2) strstr((s1), (s2))
515
516 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
517 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
518 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
519
520 #define XSNPRINTF snprintf
521 #endif
522
523 /* ------------------------------------------------------------------------- */
524 /* Enable Features */
525 /* ------------------------------------------------------------------------- */
526 #undef WOLFSSL_TLS13
527 #if 1
528 #define WOLFSSL_TLS13
529 #endif
530
531 #undef WOLFSSL_KEY_GEN
532 #if 1
533 #define WOLFSSL_KEY_GEN
534 #endif
535
536 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
537 #define WOLFSSL_OLD_PRIME_CHECK
538 #endif
539

NetBurner, Inc.
980 File Documentation

540 #undef KEEP_PEER_CERT


541 #define KEEP_PEER_CERT
542
543 #undef HAVE_COMP_KEY
544 //#define HAVE_COMP_KEY
545
546 #undef HAVE_TLS_EXTENSIONS
547 #define HAVE_TLS_EXTENSIONS
548
549 #undef HAVE_SUPPORTED_CURVES
550 #define HAVE_SUPPORTED_CURVES
551
552 #undef WOLFSSL_BASE64_ENCODE
553 #define WOLFSSL_BASE64_ENCODE
554
555 #define SMALL_SESSION_CACHE
556
557 /* ------------------------------------------------------------------------- */
558 /* Disable Features */
559 /* ------------------------------------------------------------------------- */
560 #undef NO_WOLFSSL_SERVER
561 //#define NO_WOLFSSL_SERVER
562
563 #undef NO_WOLFSSL_CLIENT
564 //#define NO_WOLFSSL_CLIENT
565
566 #undef NO_CRYPT_TEST
567 //#define NO_CRYPT_TEST
568
569 #undef NO_CRYPT_BENCHMARK
570 //#define NO_CRYPT_BENCHMARK
571
572 #undef WOLFCRYPT_ONLY
573 //#define WOLFCRYPT_ONLY
574
575 /* In-lining of misc.c functions */
576 /* If defined, must include wolfcrypt/src/misc.c in build */
577 /* Slower, but about 1k smaller */
578 #undef NO_INLINE
579 //#define NO_INLINE
580
581 #undef WOLFSSL_NO_SOCK
582 #define WOLFSSL_NO_SOCK
583
584 #undef NO_WOLFSSL_DIR
585 #define NO_WOLFSSL_DIR
586
587 #undef NO_FILESYSTEM
588 #define NO_FILESYSTEM
589
590 #undef NO_WRITEV
591 #define NO_WRITEV
592
593 #undef NO_MAIN_DRIVER
594 #define NO_MAIN_DRIVER
595
596 #undef NO_DEV_RANDOM
597 #define NO_DEV_RANDOM
598
599 #undef NO_DSA
600 #define NO_DSA
601
602 #undef NO_RC4
603 //#define NO_RC4
604
605 #undef NO_OLD_TLS
606 #define NO_OLD_TLS
607
608 #undef NO_HC128
609 #define NO_HC128
610
611 #undef NO_RABBIT
612 #define NO_RABBIT
613
614 #undef NO_PSK
615 #define NO_PSK
616
617 #undef NO_MD4
618 #define NO_MD4
619
620 #undef NO_PWDBASED
621 #define NO_PWDBASED
622
623 #undef NO_CODING
624 //#define NO_CODING
625
626 #undef NO_ASN_TIME

NetBurner, Inc.
22.191 SB800EX/user_settings.h 981

627 //#define NO_ASN_TIME


628
629 #undef NO_CERTS
630 //#define NO_CERTS
631
632 #undef NO_SIG_WRAPPER
633 //#define NO_SIG_WRAPPER
634
635 #undef WOLFSSL_IGNORE_FILE_WARN
636 #define WOLFSSL_IGNORE_FILE_WARN
637
638 #undef NO_TLS
639
640 #define HAVE_SNI
641
642 // Settings made for compatibility
643 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
644 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
645 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
646 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
647
648 #define WOLFSSL_CERT_REQ
649 #define WOLFSSL_CERT_GEN
650 #define WOLFSSL_ALT_NAMES
651 #define WOLFSSL_DER_TO_PEM
652 #define WOLFSSL_KEY_GEN
653
654 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
655 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
656
657 // For wolfSSH
658 //#undef WOLFSSH_SFTP
659 //#define WOLFSSH_SFTP
660
661 //#undef WOLFSSH_SCP
662 //#define WOLFSSH_SCP
663
664 #undef WOLFSSH_USER_IO
665 #define WOLFSSH_USER_IO
666
667 #ifdef __cplusplus
668 }
669 #endif
670
671 #endif /* WOLFSSL_USER_SETTINGS_H */

22.191 SB800EX/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 /* Default build with fast math */
11
12 // uncomment and add wolfSSL_Debugging_ON() to app for debug messages
13 #undef DEBUG_WOLFSSL
14 #undef NO_ERROR_STRINGS
15 //#define DEBUG_WOLFSSL
16
17 #include <predef.h>
18 #include <endian.h>
19 #define XHTONS(a) __htons(a)
20
21 //#define WOLFSSL_CALLBACKS
22
23 //#define NO_TIMEVAL
24
25 /* ------------------------------------------------------------------------- */
26 /* Platform */
27 /* ------------------------------------------------------------------------- */
28 /* Used for getting random value for seeding RNG */
29 //#define WOLFSSL_NETBURNER
30
31 /* Properly sets endian order and data type sizes */
32 #define BIG_ENDIAN_ORDER
33
34 #undef SINGLE_THREADED
35
36 // We provide IO callbacks

NetBurner, Inc.
982 File Documentation

37 #define WOLFSSL_USER_IO
38
39 /* ------------------------------------------------------------------------- */
40 /* Math Configuration */
41 /* ------------------------------------------------------------------------- */
42 #ifndef SIZEOF_LONG
43 #define SIZEOF_LONG 4
44 #endif
45 #ifndef SIZEOF_LONG_LONG
46 #define SIZEOF_LONG_LONG 8
47 #endif
48
49 #define ULLONG_MAX 4294967295UL
50 #define SP_WORD_SIZE 16
51
52 #define WOLFSSL_SP
53 #define WOLFSSL_SP_SMALL
54
55 #define USE_FAST_MATH
56 #define WOLFSSL_SMALL_STACK
57
58 /* hardening against side channel attacks */
59 #if defined(USE_FAST_MATH)
60 #define TFM_TIMING_RESISTANT
61 #endif /* USE_FAST_MATH */
62
63 // OPENSSL_EXTRA uses a lot more memory but is needed in order to enable
64 // compatibility layer API
65 //#define OPENSSL_EXTRA
66
67 /* enable features - added to match MODM7AE70 */
68
69 // additional RSA padding schemes
70 #undef NO_RSA
71 #ifndef NO_RSA
72 #if defined(USE_FAST_MATH)
73 /* Maximum math bits (Max RSA key bits * 2) */
74 #undef FP_MAX_BITS
75 #ifdef ENABLE_RSA_4K // predef.h
76 #define FP_MAX_BITS 8192
77 #else
78 #define FP_MAX_BITS 4096
79 #endif
80 #endif
81
82 /* this slows down RSA operations but increases side channel resistance */
83 #define WC_RSA_BLINDING
84
85 /* RSA PSS Support */
86 #define WC_RSA_NO_PADDING
87 #define WC_RSA_PSS
88 #endif
89
90 #undef NO_AES
91 #ifndef NO_AES
92 #define HAVE_AES_CBC
93 #define HAVE_AESGCM
94 #define GCM_SMALL
95 #define HAVE_AESCCM
96 #endif
97
98 #define HAVE_ECC
99 #ifdef HAVE_ECC
100 #undef ECC_TIMING_RESISTANT
101 //#define ECC_TIMING_RESISTANT // - Disabled until we can get better performance
102
103 // Manually add support for curves.
104 #undef ECC_USER_CURVES
105 #define ECC_USER_CURVES
106
107 #ifdef ECC_USER_CURVES
108 /* Manual Curve Selection */
109 #define HAVE_ECC192
110 #define HAVE_ECC128
111 #define HAVE_ECC224
112 #undef NO_ECC256
113
114 // Added for specific curve support for WolfSSH
115 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
116 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
117 #define ECC192
118 #define ECC224
119 #undef NO_ECC_SECP
120 #define HAVE_ECC_SECPR2
121 #define HAVE_ECC_SECPR3
122
123 #ifdef ENABLE_ECC384 // predef.h

NetBurner, Inc.
22.191 SB800EX/user_settings.h 983

124 #define HAVE_ECC384 // - Disabled until we can get better performance


125 #endif
126
127 #ifdef ENABLE_ECC521 // predef.h
128 #define HAVE_ECC521 // - Disabled until we can get better performance
129 #endif
130
131 #ifdef ENABLE_ED25519 // predef.h
132 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
133 #define HAVE_CURVE25519
134
135 /* Optionally use small math (less flash usage, but much slower) */
136 //#define CURVED25519_SMALL
137 #endif
138 #endif
139
140 /* Fixed point cache (speeds repeated operations against same private key) */
141 #undef FP_ECC
142 #define FP_ECC
143 #ifdef FP_ECC
144 /* Bits / Entries */
145 #undef FP_ENTRIES
146 #define FP_ENTRIES 15
147 #undef FP_LUT
148 #define FP_LUT 4
149 #endif
150
151 #define ECC_SHAMIR
152 #if defined(USE_FAST_MATH)
153 #define ALT_ECC_SIZE
154 #endif
155
156 #ifndef NO_ECC256
157 #define TFM_ECC256
158 #endif
159 #endif
160
161 /* DH */
162 #undef NO_DH
163 #if 1
164 /* Use table for DH instead of -lm (math) lib dependency */
165 #if 1
166 #define WOLFSSL_DH_CONST
167 #define HAVE_FFDHE_2048
168 #ifdef ENABLE_RSA_4K
169 #define HAVE_FFDHE_4096
170 #endif
171 //#define HAVE_FFDHE_6144
172 //#define HAVE_FFDHE_8192
173 #endif
174
175 #ifdef HAVE_FIPS
176 #define WOLFSSL_VALIDATE_FFC_IMPORT
177 #define HAVE_FFDHE_Q
178 #endif
179 #else
180 #define NO_DH
181 #endif
182
183 /* AES */
184 #undef NO_AES
185 #if 1
186 #undef HAVE_AES_CBC
187 #define HAVE_AES_CBC
188
189 #undef HAVE_AESGCM
190 #define HAVE_AESGCM
191
192 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
193 #define GCM_SMALL
194
195 #undef WOLFSSL_AES_DIRECT
196 //#define WOLFSSL_AES_DIRECT
197
198 #undef HAVE_AES_ECB
199 //#define HAVE_AES_ECB
200
201 #undef WOLFSSL_AES_COUNTER
202 //#define WOLFSSL_AES_COUNTER
203
204 #undef HAVE_AESCCM
205 #define HAVE_AESCCM
206 #else
207 #define NO_AES
208 #endif
209
210 #define HAVE_CHACHA

NetBurner, Inc.
984 File Documentation

211 #define HAVE_POLY1305


212 #define HAVE_ONE_TIME_AUTH
213
214 /* Hashing */
215
216 #undef NO_SHA256
217 #define WOLFSSL_SHA512
218 #define WOLFSSL_SHA384
219 #undef WOLFSSL_SHA3
220 #define NO_MD5
221 #undef HAVE_HKDF
222 #define HAVE_HKDF
223 #undef WOLFSSL_CMAC
224
225 /* ------------------------------------------------------------------------- */
226 /* Port */
227 /* ------------------------------------------------------------------------- */
228
229 /* Override Current Time */
230 /* Allows custom "custom_time()" function to be used for benchmark */
231 #define WOLFSSL_USER_CURRTIME
232 #define HAVE_GMTIME_R
233 //#define WOLFSSL_GMTIME
234 #define USER_TICKS
235 #include <time.h>
236 extern unsigned long my_time(time_t *timer);
237 #define XTIME my_time
238
239 /* ------------------------------------------------------------------------- */
240 /* RNG */
241 /* ------------------------------------------------------------------------- */
242
243 /* Seed Source */
244 /* Size of returned HW RNG value */
245 #define CUSTOM_RAND_TYPE unsigned int
246 extern unsigned int my_rng_seed_gen(void);
247 #undef CUSTOM_RAND_GENERATE
248 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
249
250 // From MODM7 User Settings
251 /* ------------------------------------------------------------------------- */
252 /* Enable Features */
253 /* ------------------------------------------------------------------------- */
254 #undef WOLFSSL_TLS13
255 #if 1
256 #define WOLFSSL_TLS13
257 #endif
258
259 #define KEEP_PEER_CERT
260
261 #undef HAVE_COMP_KEY
262 //#define HAVE_COMP_KEY
263
264 #define HAVE_TLS_EXTENSIONS
265
266 #define HAVE_SUPPORTED_CURVES
267
268 #define WOLFSSL_BASE64_ENCODE
269
270 #define SMALL_SESSION_CACHE
271 #define HAVE_SESSION_TICKET
272
273 /* ------------------------------------------------------------------------- */
274 /* Disable Features */
275 /* ------------------------------------------------------------------------- */
276 #undef NO_WOLFSSL_SERVER
277 //#define NO_WOLFSSL_SERVER
278
279 #undef NO_WOLFSSL_CLIENT
280 //#define NO_WOLFSSL_CLIENT
281
282 #undef NO_CRYPT_TEST
283 //#define NO_CRYPT_TEST
284
285 #undef NO_CRYPT_BENCHMARK
286 //#define NO_CRYPT_BENCHMARK
287
288 #undef WOLFCRYPT_ONLY
289 //#define WOLFCRYPT_ONLY
290
291 #ifndef WOLFSSL_STATIC_MEMORY
292 #define NO_WOLFSSL_MEMORY
293 #endif
294
295 #undef STRING_USER
296
297 #undef WOLFSSL_KEY_GEN

NetBurner, Inc.
22.191 SB800EX/user_settings.h 985

298
299 /* In-lining of misc.c functions */
300 /* If defined, must include wolfcrypt/src/misc.c in build */
301 /* Slower, but about 1k smaller */
302 #undef NO_INLINE
303 //#define NO_INLINE
304
305 #undef WOLFSSL_NO_SOCK
306 #define WOLFSSL_NO_SOCK
307
308 #undef NO_WOLFSSL_DIR
309 #define NO_WOLFSSL_DIR
310
311 #undef NO_FILESYSTEM
312 #define NO_FILESYSTEM
313
314 #undef NO_WRITEV
315 #define NO_WRITEV
316
317 #undef NO_MAIN_DRIVER
318 #define NO_MAIN_DRIVER
319
320 #undef NO_DEV_RANDOM
321 #define NO_DEV_RANDOM
322
323 #undef NO_DSA
324 #define NO_DSA
325
326 #undef NO_RC4
327 //#define NO_RC4
328
329 #undef NO_OLD_TLS
330 #define NO_OLD_TLS
331
332 #undef NO_HC128
333 #define NO_HC128
334
335 #undef NO_RABBIT
336 #define NO_RABBIT
337
338 #undef NO_PSK
339 #define NO_PSK
340
341 #undef NO_MD4
342 #define NO_MD4
343
344 #undef NO_PWDBASED
345 #define NO_PWDBASED
346
347 #undef NO_CODING
348 //#define NO_CODING
349
350 #undef NO_ASN_TIME
351 //#define NO_ASN_TIME
352
353 #undef NO_CERTS
354 //#define NO_CERTS
355
356 #undef NO_SIG_WRAPPER
357 //#define NO_SIG_WRAPPER
358
359 #undef WOLFSSL_IGNORE_FILE_WARN
360 #define WOLFSSL_IGNORE_FILE_WARN
361
362 #undef NO_TLS
363
364 #undef NO_DES3
365
366 #undef NO_DH
367
368 #define HAVE_SNI
369
370 // Settings made for compatibility
371 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
372 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
373 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
374 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
375
376 #define WOLFSSL_CERT_REQ
377 #define WOLFSSL_CERT_GEN
378 #define WOLFSSL_ALT_NAMES
379 #define WOLFSSL_DER_TO_PEM
380 #define WOLFSSL_KEY_GEN
381
382 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
383 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?

NetBurner, Inc.
986 File Documentation

384
385 // For wolfSSH
386 //#undef WOLFSSH_SFTP
387 //#define WOLFSSH_SFTP
388
389 //#undef WOLFSSH_SCP
390 //#define WOLFSSH_SCP
391
392 #undef WOLFSSH_USER_IO
393 #define WOLFSSH_USER_IO
394
395 #ifdef __cplusplus
396 }
397 #endif
398
399 #endif /* USER_SETTINGS_H */

22.192 SBE70LC/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 //#define DEBUG_WOLFSSL
11
12 #include <predef.h>
13 #define XHTONS(a) __htons(a)
14
15 /* ------------------------------------------------------------------------- */
16 /* Platform */
17 /* ------------------------------------------------------------------------- */
18 #undef WOLFSSL_GENERAL_ALIGNMENT
19 #define WOLFSSL_GENERAL_ALIGNMENT 4
20
21 #undef SINGLE_THREADED
22 //#define SINGLE_THREADED
23
24 #undef WOLFSSL_SMALL_STACK
25 #define WOLFSSL_SMALL_STACK
26
27 #undef WOLFSSL_USER_IO
28 #define WOLFSSL_USER_IO
29
30 /* ------------------------------------------------------------------------- */
31 /* Math Configuration */
32 /* ------------------------------------------------------------------------- */
33 #undef SIZEOF_LONG_LONG
34 #define SIZEOF_LONG_LONG 8
35
36 #undef USE_FAST_MATH
37 #if 1
38 #define USE_FAST_MATH
39
40 #undef TFM_TIMING_RESISTANT
41 #define TFM_TIMING_RESISTANT
42
43 /* Optimizations */
44 //#define TFM_ARM
45 #endif
46
47 /* Wolf Single Precision Math */
48 #define ULLONG_MAX 4294967295UL
49 #define SP_WORD_SIZE 16
50
51 #define WOLFSSL_SP
52 #define WOLFSSL_SP_SMALL
53
54 //#undef WOLFSSL_SP
55 #if 0
56 #define WOLFSSL_SP
57 #define WOLFSSL_SP_SMALL /* use smaller version of code */
58 #define WOLFSSL_HAVE_SP_RSA
59 #define WOLFSSL_HAVE_SP_DH
60 #define WOLFSSL_HAVE_SP_ECC
61 #define WOLFSSL_SP_CACHE_RESISTANT
62 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
63
64 /* 64 or 32 bit version */
65 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
66 //#define WOLFSSL_SP_ARM32_ASM

NetBurner, Inc.
22.192 SBE70LC/user_settings.h 987

67 //#define WOLFSSL_SP_ARM64_ASM
68 #endif
69
70 /* ------------------------------------------------------------------------- */
71 /* FIPS - Requires eval or license from wolfSSL */
72 /* ------------------------------------------------------------------------- */
73 #undef HAVE_FIPS
74 #if 0
75 #define HAVE_FIPS
76
77 #undef HAVE_FIPS_VERSION
78 #define HAVE_FIPS_VERSION 2
79
80 #ifdef SINGLE_THREADED
81 #undef NO_THREAD_LS
82 #define NO_THREAD_LS
83 #endif
84 #endif
85
86 /* ------------------------------------------------------------------------- */
87 /* Crypto */
88 /* ------------------------------------------------------------------------- */
89 /* RSA */
90 #undef NO_RSA
91 #if 1
92 #ifdef USE_FAST_MATH
93 /* Maximum math bits (Max RSA key bits * 2) */
94 #undef FP_MAX_BITS
95 #ifdef ENABLE_RSA_4K // predef.h
96 #define FP_MAX_BITS 8192
97 #else
98 #define FP_MAX_BITS 4096
99 #endif
100 #endif
101
102 /* half as much memory but twice as slow */
103 #undef RSA_LOW_MEM
104 //#define RSA_LOW_MEM
105
106 /* Enables blinding mode, to prevent timing attacks */
107 #if 1
108 #undef WC_RSA_BLINDING
109 #define WC_RSA_BLINDING
110 #else
111 #undef WC_NO_HARDEN
112 #define WC_NO_HARDEN
113 #endif
114
115 /* RSA PSS Support */
116 #if 1
117 #define WC_RSA_PSS
118 #endif
119
120 #if 1
121 #define WC_RSA_NO_PADDING
122 #endif
123 #else
124 #define NO_RSA
125 #endif
126
127 /* ECC */
128 #undef HAVE_ECC
129 #if 1
130 #define HAVE_ECC
131
132 /* Manually define enabled curves */
133 #undef ECC_USER_CURVES
134 #define ECC_USER_CURVES
135
136 #ifdef ECC_USER_CURVES
137 /* Manual Curve Selection */
138 #define HAVE_ECC192
139 #define HAVE_ECC128
140 #define HAVE_ECC224
141 #undef NO_ECC256
142
143 // Added for specific curve support for WolfSSH
144 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
145 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
146 #define ECC192
147 #define ECC224
148 #undef NO_ECC_SECP
149 #define HAVE_ECC_SECPR2
150 #define HAVE_ECC_SECPR3
151
152 #ifdef ENABLE_ECC384 // predef.h
153 #define HAVE_ECC384 // - Disabled until we can get better performance

NetBurner, Inc.
988 File Documentation

154 #endif
155
156 #ifdef ENABLE_ECC521 // predef.h
157 #define HAVE_ECC521 // - Disabled until we can get better performance
158 #endif
159
160 #ifdef ENABLE_ED25519 // predef.h
161 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
162 #define HAVE_CURVE25519
163
164 /* Optionally use small math (less flash usage, but much slower) */
165 //#define CURVED25519_SMALL
166 #endif
167 #endif
168
169 /* Fixed point cache (speeds repeated operations against same private key) */
170 #undef FP_ECC
171 #define FP_ECC
172 #ifdef FP_ECC
173 /* Bits / Entries */
174 #undef FP_ENTRIES
175 #define FP_ENTRIES 15
176 #undef FP_LUT
177 #define FP_LUT 4
178 #endif
179
180 /* Optional ECC calculation method */
181 /* Note: doubles heap usage, but slightly faster */
182 #undef ECC_SHAMIR
183 #define ECC_SHAMIR
184
185 #if defined(USE_FAST_MATH)
186 #define ALT_ECC_SIZE
187 #endif
188
189 /* Reduces heap usage, but slower */
190 #undef ECC_TIMING_RESISTANT
191 //#define ECC_TIMING_RESISTANT // - Disabled for performance
192
193 /* Enable cofactor support */
194 #ifdef HAVE_FIPS
195 #undef HAVE_ECC_CDH
196 #define HAVE_ECC_CDH
197 #endif
198
199 /* Validate import */
200 #ifdef HAVE_FIPS
201 #undef WOLFSSL_VALIDATE_ECC_IMPORT
202 #define WOLFSSL_VALIDATE_ECC_IMPORT
203 #endif
204
205 /* Compressed Key Support */
206 #undef HAVE_COMP_KEY
207 //#define HAVE_COMP_KEY
208
209 /* Use alternate ECC size for ECC math */
210 #ifdef USE_FAST_MATH
211 #ifdef NO_RSA
212 /* Custom fastmath size if not using RSA */
213 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
214 #undef FP_MAX_BITS
215 #define FP_MAX_BITS (256 + 32)
216 #else
217 #undef ALT_ECC_SIZE
218 #define ALT_ECC_SIZE
219 #endif
220
221 /* Speedups specific to curve */
222 #ifndef NO_ECC256
223 #undef TFM_ECC256
224 #define TFM_ECC256
225 #endif
226 #endif
227 #endif
228
229 /* DH */
230 #undef NO_DH
231 #if 1
232 /* Use table for DH instead of -lm (math) lib dependency */
233 #if 1
234 #define WOLFSSL_DH_CONST
235 #define HAVE_FFDHE_2048
236 #ifdef ENABLE_RSA_4K
237 #define HAVE_FFDHE_4096
238 #endif
239 //#define HAVE_FFDHE_6144
240 //#define HAVE_FFDHE_8192

NetBurner, Inc.
22.192 SBE70LC/user_settings.h 989

241 #endif
242
243 #ifdef HAVE_FIPS
244 #define WOLFSSL_VALIDATE_FFC_IMPORT
245 #define HAVE_FFDHE_Q
246 #endif
247 #else
248 #define NO_DH
249 #endif
250
251 /* AES */
252 #undef NO_AES
253 #if 1
254 #undef HAVE_AES_CBC
255 #define HAVE_AES_CBC
256
257 #undef HAVE_AESGCM
258 #define HAVE_AESGCM
259
260 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
261 #define GCM_SMALL
262
263 #undef WOLFSSL_AES_DIRECT
264 //#define WOLFSSL_AES_DIRECT
265
266 #undef HAVE_AES_ECB
267 //#define HAVE_AES_ECB
268
269 #undef WOLFSSL_AES_COUNTER
270 //#define WOLFSSL_AES_COUNTER
271
272 #undef HAVE_AESCCM
273 #define HAVE_AESCCM
274 #else
275 #define NO_AES
276 #endif
277
278 /* DES3 */
279 #undef NO_DES3
280 #if 1
281 #else
282 #define NO_DES3
283 #endif
284
285 /* ChaCha20 / Poly1305 */
286 //#undef HAVE_CHACHA
287 //#undef HAVE_POLY1305
288 //#if 0
289 #define HAVE_CHACHA
290 #define HAVE_POLY1305
291
292 /* Needed for Poly1305 */
293 #undef HAVE_ONE_TIME_AUTH
294 #define HAVE_ONE_TIME_AUTH
295 //#endif
296
297 /* ------------------------------------------------------------------------- */
298 /* Hashing */
299 /* ------------------------------------------------------------------------- */
300 /* Sha */
301 //#undef WOLFSSL_STATIC_RSA
302 #if 1
303 /* 1k smaller, but 25% slower */
304 //#define USE_SLOW_SHA
305 #else
306 #define NO_SHA
307 #endif
308
309 /* Sha256 */
310 #undef NO_SHA256
311 #if 1
312 /* not unrolled - ~2k smaller and ~25% slower */
313 //#define USE_SLOW_SHA256
314
315 /* Sha224 */
316 #if 0
317 #define WOLFSSL_SHA224
318 #endif
319 #else
320 #define NO_SHA256
321 #endif
322
323 /* Sha512 */
324 //#undef WOLFSSL_SHA512
325 //#if 0
326 #define WOLFSSL_SHA512
327

NetBurner, Inc.
990 File Documentation

328 /* Sha384 */
329 //#undef WOLFSSL_SHA384
330 //#if 0
331 #define WOLFSSL_SHA384
332 //#endif
333
334 /* over twice as small, but 50% slower */
335 //#define USE_SLOW_SHA512
336 //#endif
337
338 /* Sha3 */
339 #undef WOLFSSL_SHA3
340 #if 0
341 #define WOLFSSL_SHA3
342 #endif
343
344 /* MD5 */
345 #undef NO_MD5
346 #if 0
347
348 #else
349 #define NO_MD5
350 #endif
351
352 /* HKDF */
353 #undef HAVE_HKDF
354 #if 1
355 #define HAVE_HKDF
356 #endif
357
358 /* CMAC */
359 #undef WOLFSSL_CMAC
360 #if 0
361 #define WOLFSSL_CMAC
362 #endif
363
364 /* ------------------------------------------------------------------------- */
365 /* Benchmark / Test */
366 /* ------------------------------------------------------------------------- */
367 /* Use reduced benchmark / test sizes */
368 #undef BENCH_EMBEDDED
369 //#define BENCH_EMBEDDED
370
371 #undef USE_CERT_BUFFERS_2048
372 //#define USE_CERT_BUFFERS_2048
373
374 #undef USE_CERT_BUFFERS_1024
375 //#define USE_CERT_BUFFERS_1024
376
377 #undef USE_CERT_BUFFERS_256
378 //#define USE_CERT_BUFFERS_256
379
380 /* ------------------------------------------------------------------------- */
381 /* Debugging */
382 /* ------------------------------------------------------------------------- */
383
384 #undef DEBUG_WOLFSSL
385 #undef NO_ERROR_STRINGS
386 #if 0
387 #define DEBUG_WOLFSSL
388 #else
389 #if 0
390 #define NO_ERROR_STRINGS
391 #endif
392 #endif
393
394 /* ------------------------------------------------------------------------- */
395 /* Memory */
396 /* ------------------------------------------------------------------------- */
397
398 /* Override Memory API’s */
399 #if 0
400 #undef XMALLOC_OVERRIDE
401 #define XMALLOC_OVERRIDE
402
403 /* prototypes for user heap override functions */
404 /* Note: Realloc only required for normal math */
405 #include <stddef.h> /* for size_t */
406 extern void *myMalloc(size_t n, void* heap, int type);
407 extern void myFree(void *p, void* heap, int type);
408 extern void *myRealloc(void *p, size_t n, void* heap, int type);
409
410 #define XMALLOC(n, h, t) myMalloc(n, h, t)
411 #define XFREE(p, h, t) myFree(p, h, t)
412 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
413 #endif
414

NetBurner, Inc.
22.192 SBE70LC/user_settings.h 991

415 #if 0
416 /* Static memory requires fast math */
417 #define WOLFSSL_STATIC_MEMORY
418
419 /* Disable fallback malloc/free */
420 #define WOLFSSL_NO_MALLOC
421 #if 1
422 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
423 #endif
424 #endif
425
426 /* Memory callbacks */
427 #if 0
428 #undef USE_WOLFSSL_MEMORY
429 #define USE_WOLFSSL_MEMORY
430
431 /* Use this to measure / print heap usage */
432 #if 1
433 #undef WOLFSSL_TRACK_MEMORY
434 #define WOLFSSL_TRACK_MEMORY
435
436 #undef WOLFSSL_DEBUG_MEMORY
437 #define WOLFSSL_DEBUG_MEMORY
438 #endif
439 #else
440 #ifndef WOLFSSL_STATIC_MEMORY
441 #define NO_WOLFSSL_MEMORY
442 /* Otherwise we will use stdlib malloc, free and realloc */
443 #endif
444 #endif
445
446 /* ------------------------------------------------------------------------- */
447 /* Port */
448 /* ------------------------------------------------------------------------- */
449
450 /* Override Current Time */
451 /* Allows custom "custom_time()" function to be used for benchmark */
452 #define WOLFSSL_USER_CURRTIME
453 #define HAVE_GMTIME_R
454 //#define WOLFSSL_GMTIME
455 #define USER_TICKS
456 #include <time.h>
457 extern unsigned long my_time(time_t *timer);
458 #define XTIME my_time
459
460 /* ------------------------------------------------------------------------- */
461 /* RNG */
462 /* ------------------------------------------------------------------------- */
463
464 /* Seed Source */
465 /* Size of returned HW RNG value */
466 #define CUSTOM_RAND_TYPE unsigned int
467 extern unsigned int my_rng_seed_gen(void);
468 #undef CUSTOM_RAND_GENERATE
469 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
470
471 // NetBurner specific define for enabling hardware random number generation for M7
472 #define GATHER_RANDOM_USE_HW
473
474 /* Choose RNG method */
475 #if 1
476 /* Use built-in P-RNG (SHA256 based) with HW RNG */
477 /* P-RNG + HW RNG (P-RNG is ~8K) */
478 #undef HAVE_HASHDRBG
479 //#define HAVE_HASHDRBG
480 #else
481 #undef WC_NO_HASHDRBG
482 #define WC_NO_HASHDRBG
483
484 /* Bypass P-RNG and use only HW RNG */
485 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
486 #undef CUSTOM_RAND_GENERATE_BLOCK
487 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
488 #endif
489
490 /* ------------------------------------------------------------------------- */
491 /* Custom Standard Lib */
492 /* ------------------------------------------------------------------------- */
493 /* Allows override of all standard library functions */
494 #undef STRING_USER
495 #if 0
496 #define STRING_USER
497
498 #include <string.h>
499
500 #undef USE_WOLF_STRSEP
501 #define USE_WOLF_STRSEP

NetBurner, Inc.
992 File Documentation

502 #define XSTRSEP(s1, d) wc_strsep((s1), (d))


503
504 #undef USE_WOLF_STRTOK
505 #define USE_WOLF_STRTOK
506 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
507
508 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
509
510 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
511 #define XMEMSET(b, c, l) memset((b), (c), (l))
512 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
513 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
514
515 #define XSTRLEN(s1) strlen((s1))
516 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
517 #define XSTRSTR(s1, s2) strstr((s1), (s2))
518
519 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
520 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
521 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
522
523 #define XSNPRINTF snprintf
524 #endif
525
526 /* ------------------------------------------------------------------------- */
527 /* Enable Features */
528 /* ------------------------------------------------------------------------- */
529 #undef WOLFSSL_TLS13
530 #if 1
531 #define WOLFSSL_TLS13
532 #endif
533
534 #undef WOLFSSL_KEY_GEN
535 #if 1
536 #define WOLFSSL_KEY_GEN
537 #endif
538
539 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
540 #define WOLFSSL_OLD_PRIME_CHECK
541 #endif
542
543 #undef KEEP_PEER_CERT
544 #define KEEP_PEER_CERT
545
546 #undef HAVE_COMP_KEY
547 //#define HAVE_COMP_KEY
548
549 #undef HAVE_TLS_EXTENSIONS
550 #define HAVE_TLS_EXTENSIONS
551
552 #undef HAVE_SUPPORTED_CURVES
553 #define HAVE_SUPPORTED_CURVES
554
555 #undef WOLFSSL_BASE64_ENCODE
556 #define WOLFSSL_BASE64_ENCODE
557
558 #define SMALL_SESSION_CACHE
559 #define HAVE_SESSION_TICKET
560
561 /* ------------------------------------------------------------------------- */
562 /* Disable Features */
563 /* ------------------------------------------------------------------------- */
564 #undef NO_WOLFSSL_SERVER
565 //#define NO_WOLFSSL_SERVER
566
567 #undef NO_WOLFSSL_CLIENT
568 //#define NO_WOLFSSL_CLIENT
569
570 #undef NO_CRYPT_TEST
571 //#define NO_CRYPT_TEST
572
573 #undef NO_CRYPT_BENCHMARK
574 //#define NO_CRYPT_BENCHMARK
575
576 #undef WOLFCRYPT_ONLY
577 //#define WOLFCRYPT_ONLY
578
579 /* In-lining of misc.c functions */
580 /* If defined, must include wolfcrypt/src/misc.c in build */
581 /* Slower, but about 1k smaller */
582 #undef NO_INLINE
583 //#define NO_INLINE
584
585 #undef WOLFSSL_NO_SOCK
586 #define WOLFSSL_NO_SOCK
587
588 #undef NO_WOLFSSL_DIR

NetBurner, Inc.
22.192 SBE70LC/user_settings.h 993

589 #define NO_WOLFSSL_DIR


590
591 #undef NO_FILESYSTEM
592 #define NO_FILESYSTEM
593
594 #undef NO_WRITEV
595 #define NO_WRITEV
596
597 #undef NO_MAIN_DRIVER
598 #define NO_MAIN_DRIVER
599
600 #undef NO_DEV_RANDOM
601 #define NO_DEV_RANDOM
602
603 #undef NO_DSA
604 #define NO_DSA
605
606 #undef NO_RC4
607 //#define NO_RC4
608
609 #undef NO_OLD_TLS
610 #define NO_OLD_TLS
611
612 #undef NO_HC128
613 #define NO_HC128
614
615 #undef NO_RABBIT
616 #define NO_RABBIT
617
618 #undef NO_PSK
619 #define NO_PSK
620
621 #undef NO_MD4
622 #define NO_MD4
623
624 #undef NO_PWDBASED
625 #define NO_PWDBASED
626
627 #undef NO_CODING
628 //#define NO_CODING
629
630 #undef NO_ASN_TIME
631 //#define NO_ASN_TIME
632
633 #undef NO_CERTS
634 //#define NO_CERTS
635
636 #undef NO_SIG_WRAPPER
637 //#define NO_SIG_WRAPPER
638
639 #undef WOLFSSL_IGNORE_FILE_WARN
640 #define WOLFSSL_IGNORE_FILE_WARN
641
642 #undef NO_TLS
643
644 #define HAVE_SNI
645
646 // Settings made for compatibility
647 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
648 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
649 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
650 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
651
652 #define WOLFSSL_CERT_REQ
653 #define WOLFSSL_CERT_GEN
654 #define WOLFSSL_ALT_NAMES
655 #define WOLFSSL_DER_TO_PEM
656 #define WOLFSSL_KEY_GEN
657
658 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
659 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
660
661 // For wolfSSH
662 //#undef WOLFSSH_SFTP
663 //#define WOLFSSH_SFTP
664
665 //#undef WOLFSSH_SCP
666 //#define WOLFSSH_SCP
667
668 #undef WOLFSSH_USER_IO
669 #define WOLFSSH_USER_IO
670
671 #ifdef __cplusplus
672 }
673 #endif
674

NetBurner, Inc.
994 File Documentation

675 #endif /* WOLFSSL_USER_SETTINGS_H */

22.193 SOMRT1061/user_settings.h
1
2 #ifndef USER_SETTINGS_H
3 #define USER_SETTINGS_H
4
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif
9
10 //#define DEBUG_WOLFSSL
11
12 #include <predef.h>
13 #include <endian.h>
14 #define XHTONS(a) __htons(a)
15
16 //#define WOLFSSL_CALLBACKS
17
18 /* ------------------------------------------------------------------------- */
19 /* Platform */
20 /* ------------------------------------------------------------------------- */
21 #undef WOLFSSL_GENERAL_ALIGNMENT
22 #define WOLFSSL_GENERAL_ALIGNMENT 4
23
24 #undef SINGLE_THREADED
25 //#define SINGLE_THREADED
26
27 #undef WOLFSSL_SMALL_STACK
28 #define WOLFSSL_SMALL_STACK
29
30 #undef WOLFSSL_USER_IO
31 #define WOLFSSL_USER_IO
32
33 /* ------------------------------------------------------------------------- */
34 /* Math Configuration */
35 /* ------------------------------------------------------------------------- */
36 #undef SIZEOF_LONG_LONG
37 #define SIZEOF_LONG_LONG 8
38
39 #undef USE_FAST_MATH
40 #if 1
41 #define USE_FAST_MATH
42
43 #undef TFM_TIMING_RESISTANT
44 #define TFM_TIMING_RESISTANT
45
46 /* Optimizations */
47 //#define TFM_ARM
48 #endif
49
50 /* Wolf Single Precision Math */
51 #define ULLONG_MAX 4294967295UL
52 #define SP_WORD_SIZE 16
53
54 #define WOLFSSL_SP
55 #define WOLFSSL_SP_SMALL
56
57 //#undef WOLFSSL_SP
58 #if 0
59 #define WOLFSSL_SP
60 #define WOLFSSL_SP_SMALL /* use smaller version of code */
61 #define WOLFSSL_HAVE_SP_RSA
62 #define WOLFSSL_HAVE_SP_DH
63 #define WOLFSSL_HAVE_SP_ECC
64 #define WOLFSSL_SP_CACHE_RESISTANT
65 //#define WOLFSSL_SP_MATH /* only SP math - eliminates fast math code */
66
67 /* 64 or 32 bit version */
68 //#define WOLFSSL_SP_ASM /* required if using the ASM versions */
69 //#define WOLFSSL_SP_ARM32_ASM
70 //#define WOLFSSL_SP_ARM64_ASM
71 #endif
72
73 /* ------------------------------------------------------------------------- */
74 /* FIPS - Requires eval or license from wolfSSL */
75 /* ------------------------------------------------------------------------- */
76 #undef HAVE_FIPS
77 #if 0
78 #define HAVE_FIPS
79
80 #undef HAVE_FIPS_VERSION
81 #define HAVE_FIPS_VERSION 2

NetBurner, Inc.
22.193 SOMRT1061/user_settings.h 995

82
83 #ifdef SINGLE_THREADED
84 #undef NO_THREAD_LS
85 #define NO_THREAD_LS
86 #endif
87 #endif
88
89 /* ------------------------------------------------------------------------- */
90 /* Crypto */
91 /* ------------------------------------------------------------------------- */
92 /* RSA */
93 #undef NO_RSA
94 #if 1
95 #ifdef USE_FAST_MATH
96 /* Maximum math bits (Max RSA key bits * 2) */
97 #undef FP_MAX_BITS
98 #ifdef ENABLE_RSA_4K // predef.h
99 #define FP_MAX_BITS 8192
100 #else
101 #define FP_MAX_BITS 4096
102 #endif
103 #endif
104
105 /* half as much memory but twice as slow */
106 #undef RSA_LOW_MEM
107 //#define RSA_LOW_MEM
108
109 /* Enables blinding mode, to prevent timing attacks */
110 #if 1
111 #undef WC_RSA_BLINDING
112 #define WC_RSA_BLINDING
113 #else
114 #undef WC_NO_HARDEN
115 #define WC_NO_HARDEN
116 #endif
117
118 /* RSA PSS Support */
119 #if 1
120 #define WC_RSA_PSS
121 #endif
122
123 #if 1
124 #define WC_RSA_NO_PADDING
125 #endif
126 #else
127 #define NO_RSA
128 #endif
129
130 /* ECC */
131 #undef HAVE_ECC
132 #if 1
133 #define HAVE_ECC
134
135 /* Manually define enabled curves */
136 #undef ECC_USER_CURVES
137 #define ECC_USER_CURVES
138
139 #ifdef ECC_USER_CURVES
140 /* Manual Curve Selection */
141 #define HAVE_ECC192
142 #define HAVE_ECC128
143 #define HAVE_ECC224
144 #undef NO_ECC256
145
146 // Added for specific curve support for WolfSSH
147 // To enable other curves, look at ecc_sets in wolfcrypt/src/ecc.c and add required defines.
148 // You will also need to make adjustments to wolfSSH_ProcessBuffer() where the curveId is checked.
149 #define ECC192
150 #define ECC224
151 #undef NO_ECC_SECP
152 #define HAVE_ECC_SECPR2
153 #define HAVE_ECC_SECPR3
154
155 #ifdef ENABLE_ECC384 // predef.h
156 #define HAVE_ECC384 // - Disabled until we can get better performance
157 #endif
158
159 #ifdef ENABLE_ECC521 // predef.h
160 #define HAVE_ECC521 // - Disabled until we can get better performance
161 #endif
162
163 #ifdef ENABLE_ED25519 // predef.h
164 #define HAVE_ED25519 /* ED25519 Requires SHA512 */
165 #define HAVE_CURVE25519
166
167 /* Optionally use small math (less flash usage, but much slower) */
168 //#define CURVED25519_SMALL

NetBurner, Inc.
996 File Documentation

169 #endif
170 #endif
171
172 /* Fixed point cache (speeds repeated operations against same private key) */
173 #undef FP_ECC
174 #define FP_ECC
175 #ifdef FP_ECC
176 /* Bits / Entries */
177 #undef FP_ENTRIES
178 #define FP_ENTRIES 15
179 #undef FP_LUT
180 #define FP_LUT 4
181 #endif
182
183 /* Optional ECC calculation method */
184 /* Note: doubles heap usage, but slightly faster */
185 #undef ECC_SHAMIR
186 #define ECC_SHAMIR
187
188 /* Reduces heap usage, but slower */
189 #undef ECC_TIMING_RESISTANT
190 //#define ECC_TIMING_RESISTANT // - Disabled for performance
191
192 /* Enable cofactor support */
193 #ifdef HAVE_FIPS
194 #undef HAVE_ECC_CDH
195 #define HAVE_ECC_CDH
196 #endif
197
198 /* Validate import */
199 #ifdef HAVE_FIPS
200 #undef WOLFSSL_VALIDATE_ECC_IMPORT
201 #define WOLFSSL_VALIDATE_ECC_IMPORT
202 #endif
203
204 /* Compressed Key Support */
205 #undef HAVE_COMP_KEY
206 //#define HAVE_COMP_KEY
207
208 /* Use alternate ECC size for ECC math */
209 #ifdef USE_FAST_MATH
210 #ifdef NO_RSA
211 /* Custom fastmath size if not using RSA */
212 /* MAX = ROUND32(ECC BITS 256) + SIZE_OF_MP_DIGIT(32) */
213 #undef FP_MAX_BITS
214 #define FP_MAX_BITS (256 + 32)
215 #else
216 #undef ALT_ECC_SIZE
217 #define ALT_ECC_SIZE
218 #endif
219
220 /* Speedups specific to curve */
221 #ifndef NO_ECC256
222 #undef TFM_ECC256
223 #define TFM_ECC256
224 #endif
225 #endif
226 #endif
227
228 /* DH */
229 #undef NO_DH
230 #if 1
231 /* Use table for DH instead of -lm (math) lib dependency */
232 #if 1
233 #define WOLFSSL_DH_CONST
234 #define HAVE_FFDHE_2048
235 #ifdef ENABLE_RSA_4K
236 #define HAVE_FFDHE_4096
237 #endif
238 //#define HAVE_FFDHE_6144
239 //#define HAVE_FFDHE_8192
240 #endif
241
242 #ifdef HAVE_FIPS
243 #define WOLFSSL_VALIDATE_FFC_IMPORT
244 #define HAVE_FFDHE_Q
245 #endif
246 #else
247 #define NO_DH
248 #endif
249
250 /* AES */
251 #undef NO_AES
252 #if 1
253 #undef HAVE_AES_CBC
254 #define HAVE_AES_CBC
255

NetBurner, Inc.
22.193 SOMRT1061/user_settings.h 997

256 #undef HAVE_AESGCM


257 #define HAVE_AESGCM
258
259 /* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
260 #define GCM_SMALL
261
262 #undef WOLFSSL_AES_DIRECT
263 //#define WOLFSSL_AES_DIRECT
264
265 #undef HAVE_AES_ECB
266 //#define HAVE_AES_ECB
267
268 #undef WOLFSSL_AES_COUNTER
269 //#define WOLFSSL_AES_COUNTER
270
271 #undef HAVE_AESCCM
272 #define HAVE_AESCCM
273 #else
274 #define NO_AES
275 #endif
276
277 /* DES3 */
278 #undef NO_DES3
279 #if 1
280 #else
281 #define NO_DES3
282 #endif
283
284 /* ChaCha20 / Poly1305 */
285 //#undef HAVE_CHACHA
286 //#undef HAVE_POLY1305
287 //#if 0
288 #define HAVE_CHACHA
289 #define HAVE_POLY1305
290
291 /* Needed for Poly1305 */
292 #undef HAVE_ONE_TIME_AUTH
293 #define HAVE_ONE_TIME_AUTH
294 //#endif
295
296 /* ------------------------------------------------------------------------- */
297 /* Hashing */
298 /* ------------------------------------------------------------------------- */
299 /* Sha */
300 //#undef WOLFSSL_STATIC_RSA
301 #if 1
302 /* 1k smaller, but 25% slower */
303 //#define USE_SLOW_SHA
304 #else
305 #define NO_SHA
306 #endif
307
308 /* Sha256 */
309 #undef NO_SHA256
310 #if 1
311 /* not unrolled - ~2k smaller and ~25% slower */
312 //#define USE_SLOW_SHA256
313
314 /* Sha224 */
315 #if 0
316 #define WOLFSSL_SHA224
317 #endif
318 #else
319 #define NO_SHA256
320 #endif
321
322 /* Sha512 */
323 //#undef WOLFSSL_SHA512
324 //#if 0
325 #define WOLFSSL_SHA512
326
327 /* Sha384 */
328 //#undef WOLFSSL_SHA384
329 //#if 0
330 #define WOLFSSL_SHA384
331 //#endif
332
333 /* over twice as small, but 50% slower */
334 //#define USE_SLOW_SHA512
335 //#endif
336
337 /* Sha3 */
338 #undef WOLFSSL_SHA3
339 #if 0
340 #define WOLFSSL_SHA3
341 #endif
342

NetBurner, Inc.
998 File Documentation

343 /* MD5 */
344 #undef NO_MD5
345 #if 0
346
347 #else
348 #define NO_MD5
349 #endif
350
351 /* HKDF */
352 #undef HAVE_HKDF
353 #if 1
354 #define HAVE_HKDF
355 #endif
356
357 /* CMAC */
358 #undef WOLFSSL_CMAC
359 #if 0
360 #define WOLFSSL_CMAC
361 #endif
362
363 /* ------------------------------------------------------------------------- */
364 /* Benchmark / Test */
365 /* ------------------------------------------------------------------------- */
366 /* Use reduced benchmark / test sizes */
367 #undef BENCH_EMBEDDED
368 //#define BENCH_EMBEDDED
369
370 #undef USE_CERT_BUFFERS_2048
371 //#define USE_CERT_BUFFERS_2048
372
373 #undef USE_CERT_BUFFERS_1024
374 //#define USE_CERT_BUFFERS_1024
375
376 #undef USE_CERT_BUFFERS_256
377 //#define USE_CERT_BUFFERS_256
378
379 /* ------------------------------------------------------------------------- */
380 /* Debugging */
381 /* ------------------------------------------------------------------------- */
382
383 #undef DEBUG_WOLFSSL
384 #undef NO_ERROR_STRINGS
385 #if 0
386 #define DEBUG_WOLFSSL
387 #else
388 #if 0
389 #define NO_ERROR_STRINGS
390 #endif
391 #endif
392
393 /* ------------------------------------------------------------------------- */
394 /* Memory */
395 /* ------------------------------------------------------------------------- */
396
397 /* Override Memory API’s */
398 #if 0
399 #undef XMALLOC_OVERRIDE
400 #define XMALLOC_OVERRIDE
401
402 /* prototypes for user heap override functions */
403 /* Note: Realloc only required for normal math */
404 #include <stddef.h> /* for size_t */
405 extern void *myMalloc(size_t n, void* heap, int type);
406 extern void myFree(void *p, void* heap, int type);
407 extern void *myRealloc(void *p, size_t n, void* heap, int type);
408
409 #define XMALLOC(n, h, t) myMalloc(n, h, t)
410 #define XFREE(p, h, t) myFree(p, h, t)
411 #define XREALLOC(p, n, h, t) myRealloc(p, n, h, t)
412 #endif
413
414 #if 0
415 /* Static memory requires fast math */
416 #define WOLFSSL_STATIC_MEMORY
417
418 /* Disable fallback malloc/free */
419 #define WOLFSSL_NO_MALLOC
420 #if 1
421 #define WOLFSSL_MALLOC_CHECK /* trap malloc failure */
422 #endif
423 #endif
424
425 /* Memory callbacks */
426 #if 0
427 #undef USE_WOLFSSL_MEMORY
428 #define USE_WOLFSSL_MEMORY
429

NetBurner, Inc.
22.193 SOMRT1061/user_settings.h 999

430 /* Use this to measure / print heap usage */


431 #if 1
432 #undef WOLFSSL_TRACK_MEMORY
433 #define WOLFSSL_TRACK_MEMORY
434
435 #undef WOLFSSL_DEBUG_MEMORY
436 #define WOLFSSL_DEBUG_MEMORY
437 #endif
438 #else
439 #ifndef WOLFSSL_STATIC_MEMORY
440 #define NO_WOLFSSL_MEMORY
441 /* Otherwise we will use stdlib malloc, free and realloc */
442 #endif
443 #endif
444
445 /* ------------------------------------------------------------------------- */
446 /* Port */
447 /* ------------------------------------------------------------------------- */
448
449 /* Override Current Time */
450 /* Allows custom "custom_time()" function to be used for benchmark */
451 #define WOLFSSL_USER_CURRTIME
452 //#define WOLFSSL_GMTIME
453 #define HAVE_GMTIME_R
454 #define USER_TICKS
455 #include <time.h>
456 extern unsigned long my_time(time_t *timer);
457 #define XTIME my_time
458
459 /* ------------------------------------------------------------------------- */
460 /* RNG */
461 /* ------------------------------------------------------------------------- */
462
463 /* Seed Source */
464 /* Size of returned HW RNG value */
465 #define CUSTOM_RAND_TYPE unsigned int
466 extern unsigned int my_rng_seed_gen(void);
467 #undef CUSTOM_RAND_GENERATE
468 #define CUSTOM_RAND_GENERATE my_rng_seed_gen
469
470 // NetBurner specific define for enabling hardware random number generation for M7
471 #define GATHER_RANDOM_USE_HW
472
473 /* Choose RNG method */
474 #if 1
475 /* Use built-in P-RNG (SHA256 based) with HW RNG */
476 /* P-RNG + HW RNG (P-RNG is ~8K) */
477 #undef HAVE_HASHDRBG
478 //#define HAVE_HASHDRBG
479 #else
480 #undef WC_NO_HASHDRBG
481 #define WC_NO_HASHDRBG
482
483 /* Bypass P-RNG and use only HW RNG */
484 extern int my_rng_gen_block(unsigned char *output, unsigned int sz);
485 #undef CUSTOM_RAND_GENERATE_BLOCK
486 #define CUSTOM_RAND_GENERATE_BLOCK my_rng_gen_block
487 #endif
488
489 /* ------------------------------------------------------------------------- */
490 /* Custom Standard Lib */
491 /* ------------------------------------------------------------------------- */
492 /* Allows override of all standard library functions */
493 #undef STRING_USER
494 #if 0
495 #define STRING_USER
496
497 #include <string.h>
498
499 #undef USE_WOLF_STRSEP
500 #define USE_WOLF_STRSEP
501 #define XSTRSEP(s1, d) wc_strsep((s1), (d))
502
503 #undef USE_WOLF_STRTOK
504 #define USE_WOLF_STRTOK
505 #define XSTRTOK(s1, d, ptr) wc_strtok((s1), (d), (ptr))
506
507 #define XSTRNSTR(s1, s2, n) mystrnstr((s1), (s2), (n))
508
509 #define XMEMCPY(d, s, l) memcpy((d), (s), (l))
510 #define XMEMSET(b, c, l) memset((b), (c), (l))
511 #define XMEMCMP(s1, s2, n) memcmp((s1), (s2), (n))
512 #define XMEMMOVE(d, s, l) memmove((d), (s), (l))
513
514 #define XSTRLEN(s1) strlen((s1))
515 #define XSTRNCPY(s1, s2, n) strncpy((s1), (s2), (n))
516 #define XSTRSTR(s1, s2) strstr((s1), (s2))

NetBurner, Inc.
1000 File Documentation

517
518 #define XSTRNCMP(s1, s2, n) strncmp((s1), (s2), (n))
519 #define XSTRNCAT(s1, s2, n) strncat((s1), (s2), (n))
520 #define XSTRNCASECMP(s1, s2, n) strncasecmp((s1), (s2), (n))
521
522 #define XSNPRINTF snprintf
523 #endif
524
525 /* ------------------------------------------------------------------------- */
526 /* Enable Features */
527 /* ------------------------------------------------------------------------- */
528 #undef WOLFSSL_TLS13
529 #if 1
530 #define WOLFSSL_TLS13
531 #endif
532
533 #undef WOLFSSL_KEY_GEN
534 #if 1
535 #define WOLFSSL_KEY_GEN
536 #endif
537
538 #if defined(HAVE_FIPS) && !defined(WOLFSSL_KEY_GEN)
539 #define WOLFSSL_OLD_PRIME_CHECK
540 #endif
541
542 #undef KEEP_PEER_CERT
543 #define KEEP_PEER_CERT
544
545 #undef HAVE_COMP_KEY
546 //#define HAVE_COMP_KEY
547
548 #undef HAVE_TLS_EXTENSIONS
549 #define HAVE_TLS_EXTENSIONS
550
551 #undef HAVE_SUPPORTED_CURVES
552 #define HAVE_SUPPORTED_CURVES
553
554 #undef WOLFSSL_BASE64_ENCODE
555 #define WOLFSSL_BASE64_ENCODE
556
557 #define SMALL_SESSION_CACHE
558 #define HAVE_SESSION_TICKET
559
560 /* ------------------------------------------------------------------------- */
561 /* Disable Features */
562 /* ------------------------------------------------------------------------- */
563 #undef NO_WOLFSSL_SERVER
564 //#define NO_WOLFSSL_SERVER
565
566 #undef NO_WOLFSSL_CLIENT
567 //#define NO_WOLFSSL_CLIENT
568
569 #undef NO_CRYPT_TEST
570 //#define NO_CRYPT_TEST
571
572 #undef NO_CRYPT_BENCHMARK
573 //#define NO_CRYPT_BENCHMARK
574
575 #undef WOLFCRYPT_ONLY
576 //#define WOLFCRYPT_ONLY
577
578 /* In-lining of misc.c functions */
579 /* If defined, must include wolfcrypt/src/misc.c in build */
580 /* Slower, but about 1k smaller */
581 #undef NO_INLINE
582 //#define NO_INLINE
583
584 #undef WOLFSSL_NO_SOCK
585 #define WOLFSSL_NO_SOCK
586
587 #undef NO_WOLFSSL_DIR
588 #define NO_WOLFSSL_DIR
589
590 #undef NO_FILESYSTEM
591 #define NO_FILESYSTEM
592
593 #undef NO_WRITEV
594 #define NO_WRITEV
595
596 #undef NO_MAIN_DRIVER
597 #define NO_MAIN_DRIVER
598
599 #undef NO_DEV_RANDOM
600 #define NO_DEV_RANDOM
601
602 #undef NO_DSA
603 #define NO_DSA

NetBurner, Inc.
22.194 ssl_internal.h 1001

604
605 #undef NO_RC4
606 //#define NO_RC4
607
608 #undef NO_OLD_TLS
609 #define NO_OLD_TLS
610
611 #undef NO_HC128
612 #define NO_HC128
613
614 #undef NO_RABBIT
615 #define NO_RABBIT
616
617 #undef NO_PSK
618 #define NO_PSK
619
620 #undef NO_MD4
621 #define NO_MD4
622
623 #undef NO_PWDBASED
624 #define NO_PWDBASED
625
626 #undef NO_CODING
627 //#define NO_CODING
628
629 #undef NO_ASN_TIME
630 //#define NO_ASN_TIME
631
632 #undef NO_CERTS
633 //#define NO_CERTS
634
635 #undef NO_SIG_WRAPPER
636 //#define NO_SIG_WRAPPER
637
638 #undef WOLFSSL_IGNORE_FILE_WARN
639 #define WOLFSSL_IGNORE_FILE_WARN
640
641 #undef NO_TLS
642
643 #define HAVE_SNI
644
645 // Settings made for compatibility
646 #define WOLFSSL_STATIC_RSA // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA
647 #define WOLFSSL_AES_128 // Needed to support TLS_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256
648 #define WOLFSSL_AES_256 // Needed to support TLS_RSA_WITH_AES_256_CBC_SHA256
649 #define WOLFSSL_STATIC_DH // Needed to support TLS_ECDH_ECDSA_WITH_RC4_128_SHA
650
651 #define WOLFSSL_CERT_REQ
652 #define WOLFSSL_CERT_GEN
653 #define WOLFSSL_ALT_NAMES
654 #define WOLFSSL_DER_TO_PEM
655 #define WOLFSSL_KEY_GEN
656
657 #define ENABLE_ECCKEY_CREATE // Custom define, maybe should move to predef?
658 #define ENABLE_RSAKEY_CREATE // Custom define, maybe should move to predef?
659
660 // For wolfSSH
661 //#undef WOLFSSH_SFTP
662 //#define WOLFSSH_SFTP
663
664 //#undef WOLFSSH_SCP
665 //#define WOLFSSH_SCP
666
667 #undef WOLFSSH_USER_IO
668 #define WOLFSSH_USER_IO
669
670 #ifdef __cplusplus
671 }
672 #endif
673
674 #endif /* WOLFSSL_USER_SETTINGS_H */

22.194 ssl_internal.h
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
5 #ifndef SSL_INTERNAL
6 #define SSL_INTERNAL
7 #include <aes.h>
8 #include <basictypes.h>
9 #include <ctype.h>
10 #include <hash.h>

NetBurner, Inc.
1002 File Documentation

11 #include <predef.h>
12 #include <random.h>
13 #include <startnet.h>
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <string.h>
17 #include <tcp.h>
18 #include <utils.h>
19
20 /*
21 * SSL_VERSIONS
22 */
23 #define SSL_MAJOR_VERSION_3 3
24 #define SSL_MINOR_VERSION_0 0 /*SSL v3.0 */
25 #define TLS_MINOR_VERSION_10 1 /*TLS v1.0 */
26 #define TLS_MINOR_VERSION_11 2 /*TLS v1.1 */
27 #define TLS_MINOR_VERSION_12 3 /*TLS v1.2 */
28 #define TLS_MINOR_VERSION_MAX TLS_MINOR_VERSION_12 /*Update this with new versions*/
29
30 #define TLS_HEADER_LENGTH 5
31 #define TLS_HANDSHAKE_HEADER_LENGTH 4
32 #define TLS_APP_DATA_OFFSET TLS_HEADER_LENGTH + TLS_HANDSHAKE_HEADER_LENGTH
33 #define TLS_SESSION_ID_SIZE 32
34
35 #define TLS_SIG_INFO_LENGTH 2
36
37 #define MAX_PUBLIC_KEY_LEN 512
38 #define TLS_PEER_CERT_CACHE_SIZE 10
39 #define NUM_SESS_TKT_KEYS 4
40
41 /* Content types */
42 #define SSL_CONTENT_CHANGE_CIPHER (20)
43 #define SSL_CONTENT_ALERT (21)
44 #define SSL_CONTENT_HANDSHAKE (22)
45 #define SSL_CONTENT_APP_DATA (23)
46
47 #define SSL_ALERT_LEVEL_WARNING (1)
48 #define SSL_ALERT_LEVEL_FATAL (2)
49
50 #define SSL_ALERT_MSG_CLOSE_NOTIFY (0)
51 #define SSL_ALERT_MSG_UNEXPECTED_MESSAGE (10)
52 #define SSL_ALERT_MSG_BAD_RECORD_MAC (20)
53 #define SSL_ALERT_MSG_DECRYPTION_FAILED (21)
54 #define SSL_ALERT_MSG_RECORD_OVERFLOW (22)
55 #define SSL_ALERT_MSG_DECOMPRESSION_FAILURE (30)
56 #define SSL_ALERT_MSG_HANDSHAKE_FAILURE (40)
57 #define SSL_ALERT_MSG_NO_CERT (41)
58 #define SSL_ALERT_MSG_BAD_CERT (42)
59 #define SSL_ALERT_MSG_UNSUPPORTED_CERT (43)
60 #define SSL_ALERT_MSG_CERT_REVOKED (44)
61 #define SSL_ALERT_MSG_CERT_EXPIRED (45)
62 #define SSL_ALERT_MSG_CERT_UNKNOWN (46)
63 #define SSL_ALERT_MSG_ILLEGAL_PARAMETER (47)
64 #define SSL_ALERT_MSG_UNKNOWN_CA (48)
65 #define SSL_ALERT_MSG_ACCESS_DENIED (49)
66 #define SSL_ALERT_MSG_DECODE_ERROR (50)
67 #define SSL_ALERT_MSG_DECRYPT_ERROR (51)
68 #define SSL_ALERT_MSG_EXPORT_RESTRICTION (60)
69 #define SSL_ALERT_MSG_PROTOCOL_VERSION (70)
70 #define SSL_ALERT_MSG_INSUFFICIENT_SECURITY (71)
71 #define SSL_ALERT_MSG_INTERNAL_ERROR (80)
72 #define SSL_ALERT_MSG_USER_CANCELED (90)
73 #define SSL_ALERT_MSG_NO_RENEGOTIATION (100)
74 #define SSL_ALERT_UNSUPPORTED_EXTENSION (110)
75
76 /* Handshake msgs */
77 #define SSL_HSTYPE_HELLO_REQUEST (0)
78 #define SSL_HSTYPE_CLIENT_HELLO (1)
79 #define SSL_HSTYPE_SERVER_HELLO (2)
80 #define SSL_HSTYPE_NEWSESSION_TICKET (4)
81 #define SSL_HSTYPE_CERTIFICATE (11)
82 #define SSL_HSTYPE_SERVER_KEY_EXCH (12)
83 #define SSL_HSTYPE_CERTIFICATE_REQ (13)
84 #define SSL_HSTYPE_SERVER_DONE (14)
85 #define SSL_HSTYPE_CERTIFICATE_VFY (15)
86 #define SSL_HSTYPE_CLIENT_KEY_EXCH (16)
87 #define SSL_HSTYPE_FINISHED (20)
88
89 #define SSL_PARSE_FAIL (0)
90 #define SSL_PARSE_OK (1)
91
92 //#define SSL_RSA_WITH_RC4_128_MD5 (0x0004)
93
94 #if (defined NB70 || NB270 || NB470)
95 #define NUM_SSL_SOCKETS (16)
96 #define NUM_SSL_SESSIONS (128)
97 #else

NetBurner, Inc.
22.194 ssl_internal.h 1003

98 #define NUM_SSL_SOCKETS (16)


99 #define NUM_SSL_SESSIONS (16)
100 #endif
101 #define SSL_MAX_BLOCK (ETHER_BUFFER_SIZE - 18)
102 #define NUM_SYSTEM_SOCKETS (64)
103
104 #ifdef _DEBUG
105 #define DBSHOWERROR(x, y) \
106 if (DB_FLAGS & DB_SSL) { iprintf("Error:[%s] = %d at line %d\r\n", x, y, __LINE__); }
107 #else
108 #define DBSHOWERROR(x, y) ((void)0)
109 #endif
110
111 #define SSL_BUFFER_SEGMENTS TCP_BUFFER_SEGMENTS
112
113 /*#define SSL_BUFFER_DIAGNOSTICS (1)*/
114 #ifdef SSL_BUFFER_DIAGNOSTICS
115 #define BUFFER_EXTRA (5000)
116 #endif
117
118 /* Library debugging switch */
119 #ifdef _DEBUG
120 #define SSL_DEBUG (0x1000)
121 #endif /* #ifdef _DEBUG */
122
123 /*
124 Define to enable debugging support
125 */
126 // #define SSL_DEBUG ( 0x1000 )
127 // extern unsigned int DB_FLAGS;
128
129 #ifdef SSL_DEBUG
130 #define SSL_DEBUG_WITH_LINE
131
135 //#define SSL_CAPTURE_REMOTE_IP
136
137 #define SSL_DEBUG_PRINT_IP(OIP) \
138 { \
139 if (DB_FLAGS & DB_SSL) \
140 { \
141 puint8_t ipb = (puint8_t)&OIP; \
142 iprintf("IP: %d.%d.%d.%d\r\n", (int)ipb[0], (int)ipb[1], (int)ipb[2], (int)ipb[3]); \
143 } \
144 }
145
146 #ifdef SSL_DEBUG_WITH_LINE
147 #define SSL_DEBUG_IPRINTF(...) \
148 { \
149 if (DB_FLAGS & DB_SSL) \
150 { \
151 iprintf("\n[T:%d-%ld]%s:%s:%d::", OSTaskID(), TimeTick, __FILE__, __FUNCTION__, __LINE__); \
152 iprintf(__VA_ARGS__); \
153 } \
154 }
155 #else
156 #define SSL_DEBUG_IPRINTF(...) \
157 { \
158 if (DB_FLAGS & DB_SSL) \
159 { \
160 iprintf("\n"); \
161 iprintf(__VA_ARGS__); \
162 } \
163 }
164 #endif
165 #define SSL_DUMP_ARRAY(__tag, __array, __length) \
166 { \
167 if (DB_FLAGS & DB_SSL) \
168 { \
169 SSL_DEBUG_IPRINTF("***%s - ctx: %p\n", __tag, __array); \
170 for (int __i = 0; __i < __length;) \
171 { \
172 if ((__i % 16) == 0) { iprintf(" "); } \
173 iprintf("%02X ", (__array)[__i++]); \
174 if ((__i % 16) == 0) { iprintf("\n"); } \
175 } \
176 iprintf("\n"); \
177 } \
178 }
179 #define SSL_DUMP_ARRAY32(__tag, __array, __length) \
180 { \
181 if (DB_FLAGS & DB_SSL) \
182 { \
183 SSL_DEBUG_IPRINTF("***%s - ctx: %p\n", __tag, __array); \
184 for (int __i = 0; __i < __length;) \
185 { \
186 if ((__i % 16) == 0) { iprintf(" "); } \
187 iprintf("%08X ", (__array)[__i++]); \

NetBurner, Inc.
1004 File Documentation

188 if ((__i % 16) == 0) { iprintf("\n"); } \


189 } \
190 iprintf("\n"); \
191 } \
192 }
193 #define SSL_DUMP_STRING(tag, array, length) \
194 { \
195 if (DB_FLAGS & DB_SSL) \
196 { \
197 SSL_DEBUG_IPRINTF("***%s:\n", tag); \
198 for (int i = 0; i < length; i++) \
199 iprintf("%c", array[i]); \
200 iprintf("\n"); \
201 } \
202 }
203 #else /* #ifdef SSL_DEBUG */
204
205 #define SSL_DEBUG_PRINT_IP(OIP) ((void)0)
206 #define SSL_DEBUG_IPRINTF(...) ((void)0)
207 #define SSL_DUMP_ARRAY(tag, array, length) ((void)0)
208 #define SSL_DUMP_ARRAY32(tag, array, length) ((void)0)
209 #define SSL_DUMP_STRING(tag, array, length) ((void)0)
210
211 #endif /* #ifdef SSL_DEBUG */
212
213 /* Froward delclare all of the functions that will be registered in various places*/
214 int SSL_Private_close(int fd);
215 int SSL_Private_read(int fd, char *buf, int nBYTEs);
216 int SSL_Private_write(int fd, const char *buf, int nBYTEs);
217 void SSL_read_notify(int fd);
218
219 extern volatile BOOL bBasicSSLInit; /* Flag to know if we have initialized the SSL stuff */
220
221 void BasicSSLInit();
222
223 int SockReadWithTimeover(int fds, char *buf, int len, uint32_t timeover);
224
225 void Get32ByteRandom(puint8_t pb);
226 void Get16ByteRandom(puint8_t pb);
227 void GetNByteRandom(puint8_t pb, int bytes);
228
229 inline uint32_t Get3ByteLength(unsigned char *cp)
230 {
231 uint32_t rv = cp[0];
232 rv = (rv « 8) | cp[1];
233 rv = (rv « 8) | cp[2];
234 return rv;
235 }
236
237 inline uint32_t Get3ByteLength(char *cp)
238 {
239 uint32_t rv = cp[0];
240 rv = (rv « 8) | cp[1];
241 rv = (rv « 8) | cp[2];
242 return rv;
243 }
244
245 inline void Get32ByteRandom(puint8_t pb)
246 {
247 puint32_t pd = (puint32_t)pb;
248 for (int i = 0; i < 8; i++)
249 {
250 pd[i] = GetRandomDword();
251 }
252 }
253
254 inline void Get16ByteRandom(puint8_t pb)
255 {
256 puint32_t pd = (puint32_t)pb;
257 for (int i = 0; i < 4; i++)
258 {
259 pd[i] = GetRandomDword();
260 }
261 }
262
263 /* OVerride this function with your own code if you have a better random number generator */
264 uint32_t GetRandomDword();
265
266 extern OS_CRIT SSL_critical_section;
267
268 void FixSkippedCallBack();
269 extern volatile bool bReadCallBackSkipped;
270
271 class SSLCritObj
272 {
273 OS_CRIT *pcrit;
274

NetBurner, Inc.
22.195 ssl.h File Reference 1005

275 public:
276 SSLCritObj(OS_CRIT &ocrit)
277 {
278 pcrit = &ocrit;
279 ocrit.Enter(0);
280 };
281
282 ~SSLCritObj()
283 {
284 if (pcrit->OSCritDepthCount == 1)
285 {
286 while (bReadCallBackSkipped)
287 {
288 bReadCallBackSkipped = false;
289 FixSkippedCallBack();
290 }
291 }
292 pcrit->Leave();
293 }
294 } __attribute__((aligned(4)));
295
296 bool SSLSocketsAvail();
297
298 #endif

22.195 ssl.h File Reference


NetBurner SSL/TLS API.
#include <nettypes.h>
#include <predef.h>
#include <nbrtos.h>
#include <crypto/wolfssl/ssl.h>
#include <crypto/wolfssl/error-ssl.h>
#include <random.h>

Macros
• #define SSL_ERROR_FAILED_NEGOTIATION (-256)
The SSL system failed to successfully negotiate a connection.
• #define SSL_ERROR_CERTIFICATE_UNKNOWN (-258)
The received certificate could not be decoded.
• #define SSL_ERROR_CERTIFICATE_NAME_FAILED (-260)
The connected name did not match common_name.
• #define SSL_ERROR_CERTIFICATE_VERIFY_FAILED (-261)
The server returned a certificate that we did not trust.
• #define SSL_ERROR_NO_BUFFER (-262)
Unable to get a buffer from the pool.
• #define SSL_ERROR_HANDSHAKE_INCOMPLETE (-265)
The SSL handshake is not complete yet.
• #define SSL_ERROR_NO_SERVER_CERTIFICATE (-257)
The server wasn't able to load the certificate.
• #define SSL_ERROR_NO_SERVER_KEY (-258)
The server wasn't able to load the key.
• #define SSL_ERROR_UNABLE_TO_LOAD_CIPHERS (-259)
The client was unable to load the cipher list.
• #define SSL_ERROR_CERTIFICATE_CHECK (-260)
The server was unable to check the certificate.

NetBurner, Inc.
1006 File Documentation

Enumerations
• enum class ExpireRetCodes : unsigned char { ExpireRetCodes::E_CERT_VALID = 0 , ExpireRetCodes::E_CERT_EXPIRED
= 1 , ExpireRetCodes::E_BAD_EXPIRATION_VALUE = 2 , ExpireRetCodes::E_NO_SYSTEM_TIME = 3 }
Return values for SSL_IsCertExpired().

Functions
• int SSL_accept (int fdListen, IPADDR ∗address, uint16_t ∗port, uint16_t timeout, bool waitFor←-
Negotiation=true, bool verifyPeer=false, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0,
uint16_t certBuffFormat=SSL_FILETYPE_PEM, const char ∗commonName=nullptr)
This call is a mirror of the TCP::accept() call.
• bool SSLSocketsAvail ()
Returns whether or not there are any sockets available.
• int FreeSSLSockets ()
Returns the number of currently free SSL sockets.
• int SSL_setsockoption (int fd, int option)
Set SSL TCP socket options.
• int SSL_clrsockoption (int fd, int option)
Clear SSL TCP socket options.
• int SSL_getsockoption (int fd)
Returns the options for the specified SSL TCP socket.
• int SSL_getsocketerror (int fd)
Returns the socket error state for the specified SSL socket.
• int SSL_connect (IPADDR ip, uint16_t localPort, uint16_t remotePort, uint32_t timeout, const char
∗commonName, bool verifyPeer=false, bool waitForNegotiation=true, const unsigned char ∗certBuff=nullptr,
uint32_t certBuffSize=0, uint16_t certBuffFormat=SSL_FILETYPE_PEM, int intf=-1)
SSL mirror of the TCP::connect() call.
• int SSL_makeSecure (int tcpFd, const char ∗commonName, bool verifyPeer=false, bool waitFor←-
Negotiation=true, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM, bool bIsClient=true, uint32_t timeout=WAIT_FOREVER)
SSL mirror of the TCP::connect() call, but uses an existing TCP file descriptor.
• int SSL_negotiate (int tcpFd, const char ∗common_name, bool reuseSessionPort=true, bool verifyPeer=false,
const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuffFormat=SSL_FILETYPE_←-
PEM, bool bIsClient=true)
Executes the TLS negotiation over a given socket, to establish a secure communication channel through that socket.
• int SSLReadWithTimeout (int fd, char ∗cp, int size, uint32_t timeout)
SSL mirror of the ReadWithTiemout() function.
• uint32_t SetMaxSessionReuseTime (uint32_t newLifetimeTicks)
Allows one to specify at runtime what the longest duration that an established session can be used for before new
connections must be fully renegotiated.
• bool IsSSL_CertNKeyValid (const char ∗keyPEM, ssize_t keylen, const char ∗certPEM, ssize_t certlen,
uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Validate candidate certificate and private key.
• bool SSL_AddCertToClientCaList (const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t
certBuffFormat=SSL_FILETYPE_PEM)
Attempts to add a cert to the Certificate Authority List to the client SSL context.
• bool SSL_AddCertToServerCaList (const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t
certBuffFormat=SSL_FILETYPE_PEM)
Attempts to add a cert to the Certificate Authority List to the client SSL context.
• bool SSL_ClearClientCaList ()
Clears certs that have been added to the client's Certificate Authority list.
• bool SSL_ClearServerCaList ()

NetBurner, Inc.
22.195 ssl.h File Reference 1007

Clears certs that have been added to the server's Certificate Authority list.
• uint16_t SSLGetRxBufferSpaceUsed (int fd)
Returns the amount of data buffered to be read from the socket.
• uint16_t SSLGetTxBufferAvailSpace (int fd)
Returns the amount of data buffered to be read from the socket.
• void SslInit ()
This function initializes the SSL library.
• void SSL_DumpSSLSockets ()
Prints the current state of all used sockets to stdio.
• void SSL_ClientReadyCert (const unsigned char ∗cert, const unsigned char ∗key, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Add a key and certificate to the client.
• void SSL_ServerReadyCert (const unsigned char ∗cert, const unsigned char ∗key, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Add a key and certificate to the server.
• ExpireRetCodes SSL_IsCertExpired (unsigned char ∗certBuff, int certLen, uint16_t certBuffFormat=SSL_←-
FILETYPE_PEM)
Returns whether the given certificate has expired or not.
• bool SSL_GetIssuerFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗issBuf, int issBufLen,
uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the issuer from a certificate blob in the PEM format.
• bool SSL_GetSubjectNameFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗subNamBuf, int
subNamBufLen, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the subject name from a certificate blob in the PEM format.
• bool SSL_GetAltNameFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗altNamBuf, int alt←-
NamBufLen, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns an alternate name from a certificate blob in the PEM format.
• bool SSL_GetExpirationDate (unsigned char ∗certBuff, int certLen, unsigned char ∗expBuf, int expBufLen,
uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the expiration data of the certificate in question.
• bool SSL_GetTimeToExpire (unsigned char ∗certBuff, int certLen, uint16_t certBuffFormat, time_t &timeTo←-
Exp)
Returns whether the given certificate has expired or not.
• bool SSL_GetCnFromCert (unsigned char ∗certBuff, int certLen, unsigned char ∗comNamBuf, int comNam←-
BufLen, uint16_t certBuffFormat=SSL_FILETYPE_PEM)
Returns the common name from a certificate blob in the PEM format.
• const char ∗ GetCertificatePEM ()
Function that returns a pointer to the compiled in server certificate.
• int GetCertificateLen ()
Function that the length of the compiled in server certificate.
• const char ∗ GetPrivateKeyPEM ()
Function that returns a pointer to the compiled in server key.
• int GetPrivateKeyLen ()
Function that the length of the compiled in server key.
• void SslSetVerifyPeerClient (bool verifyPeer)
Sets whether or not verify peer should be enabled on the global SSL client context.
• void SslSetVerifyPeerServer (bool verifyPeer)
Sets whether or not verify peer should be enabled on the global SSL server context.
• bool SSL_IsCertAddedToClientCaList ()
Checks to see if any certificates have been added to the global SSL client context.
• bool SSL_IsCertAddedToServerCaList ()
Checks to see if any certificates have been added to the global SSL server context.

NetBurner, Inc.
1008 File Documentation

Variables
• BOOL(∗ IsSSLfd )(int fd)
Returns whether or not a file descriptor is an SSL file descriptor.
• IPADDR(∗ SSL_GetSocketRemoteAddr )(int fd)
Returns the remote address of this connected socket.
• uint16_t(∗ SSL_GetSocketRemotePort )(int fd)
Returns the remote port of this connected socket.
• IPADDR(∗ SSL_GetSocketLocalAddr )(int fd)
Returns the local address of this connected socket.
• uint16_t(∗ SSL_GetSocketLocalPort )(int fd)
Returns the local port of this connected socket.
• int(∗ SSL_GetSocketInterface )(int fd)
Return the network interface associated with an SSL TCP socket.
• int(∗ SSL_GetRawSocket )(int sslSocketFd)
Returns the TCP file descriptor associated with an SSL socket file descriptor.
• uint16_t(∗ SSL_GetTcpRtxCount )(int i)
Returns the number of re-transmits that have occurred on the specified SSL connection.
• uint32_t(∗ SSL_TcpGetLastRxTime )(int fd)
SSL mirror of TcpGetLastRxTime().
• void(∗ SSL_TcpSendKeepAlive )(int fd)
SSL mirror of TcpSendKeepAlive().
• short(∗ SSL_TcpGetSocketState )(int fd)
Return the current state of a SSL TCP socket.

22.195.1 Detailed Description


NetBurner SSL/TLS API.

22.196 ssl.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
16 #ifndef _SSL_H_
17 #define _SSL_H_
18
19 #include <nettypes.h>
20 #include <predef.h>
21 #include <nbrtos.h>
22
23 #ifndef WOLFSSL_USER_SETTINGS
24 #define WOLFSSL_USER_SETTINGS // This wasn’t getting defined in the project source files in NBEclipse
25 #endif
26
27 #if defined(NB_SSL_SUPPORTED) || defined(NB_SSH_SUPPORTED)
28 #include <crypto/wolfssl/ssl.h>
29 #endif
30
31 #ifdef NB_SSL_SUPPORTED
32 #include <crypto/wolfssl/error-ssl.h>
33 #include <random.h>
34
35
36 /*
37 * Module: SSL library
38 * Implementing SSL in an embedded system will require some knowledge of SSL
39 * certificates. Please see the NetBurner SSL overview doc for what you need
40 * to know to get started.
41 */
42 /*
43 * SSL network functions can return all of the standard TCP errors:
44 * TCP_ERR_TIMEOUT
45 * TCP_ERR_NOCON

NetBurner, Inc.
22.196 ssl.h 1009

46 * TCP_ERR_CLOSING
47 * TCP_ERR_NOSUCH_SOCKET
48 * TCP_ERR_NONE_AVAIL
49 * TCP_ERR_CON_RESET
50 * TCP_ERR_CON_ABORT
51 */
52
58 #define SSL_ERROR_FAILED_NEGOTIATION (-256)
59 #define SSL_ERROR_CERTIFICATE_UNKNOWN (-258)
60 #define SSL_ERROR_CERTIFICATE_NAME_FAILED (-260)
61 #define SSL_ERROR_CERTIFICATE_VERIFY_FAILED (-261)
62 #define SSL_ERROR_NO_BUFFER (-262)
63 #define SSL_ERROR_HANDSHAKE_INCOMPLETE (-265)
64 #define SSL_ERROR_NO_SERVER_CERTIFICATE (-257)
65 #define SSL_ERROR_NO_SERVER_KEY (-258)
66 #define SSL_ERROR_UNABLE_TO_LOAD_CIPHERS (-259)
67 #define SSL_ERROR_CERTIFICATE_CHECK (-260)
70 #ifndef SSL_LIB_REPLACEMENT
71 /* Set this to true to see the names being tested in the certificate tests */
72 extern BOOL bPrintNamesTested;
73 #endif
74
75 /*Functions:*/
76 /*Group:SSL server function*/
77
78 /*SSL mirror of the TCP accept function*/
107 int SSL_accept(int fdListen,
108 IPADDR *address,
109 uint16_t *port,
110 uint16_t timeout,
111 bool waitForNegotiation = true,
112 bool verifyPeer = false,
113 const unsigned char *certBuff = nullptr,
114 uint32_t certBuffSize = 0,
115 uint16_t certBuffFormat = SSL_FILETYPE_PEM,
116 const char *commonName = nullptr);
117 #endif
134 extern BOOL (*IsSSLfd)(int fd);
135
136 /*
137 * brief Return the network interface associated with a TCP socket.
138 *
139 * param fd Socket file descriptor
140 *
141 * return The network interface number (undefined for listening sockets)
142 */
143 // int SSL_GetSocketInterface(int fd); This appears to be a duplication (see below)
144
161 extern IPADDR (*SSL_GetSocketRemoteAddr)(int fd);
162
179 extern uint16_t (*SSL_GetSocketRemotePort)(int fd);
180
197 extern IPADDR (*SSL_GetSocketLocalAddr)(int fd);
198
215 extern uint16_t (*SSL_GetSocketLocalPort)(int fd);
216
226 extern int (*SSL_GetSocketInterface)(int fd);
227
237 extern int (*SSL_GetRawSocket)(int sslSocketFd);
238
239 #ifdef NB_SSL_SUPPORTED
249 extern uint16_t (*SSL_GetTcpRtxCount)(int i);
250
261 extern uint32_t (*SSL_TcpGetLastRxTime)(int fd);
262
271 extern void (*SSL_TcpSendKeepAlive)(int fd);
272
281 bool SSLSocketsAvail();
282
288 int FreeSSLSockets();
289
290 /*Group: SSL socket option functions */
302 int SSL_setsockoption(int fd, int option);
303
315 int SSL_clrsockoption(int fd, int option);
316
327 int SSL_getsockoption(int fd);
328
338 extern short (*SSL_TcpGetSocketState)(int fd);
339
347 int SSL_getsocketerror(int fd);
348
377 int SSL_connect(IPADDR ip,
378 uint16_t localPort,
379 uint16_t remotePort,
380 uint32_t timeout,
381 const char *commonName,

NetBurner, Inc.
1010 File Documentation

382 bool verifyPeer = false,


383 bool waitForNegotiation = true,
384 const unsigned char *certBuff = nullptr,
385 uint32_t certBuffSize = 0,
386 uint16_t certBuffFormat = SSL_FILETYPE_PEM,
387 int intf = -1);
388
416 int SSL_makeSecure(int tcpFd,
417 const char *commonName,
418 bool verifyPeer = false,
419 bool waitForNegotiation = true,
420 const unsigned char *certBuff = nullptr,
421 uint32_t certBuffSize = 0,
422 uint16_t certBuffFormat = SSL_FILETYPE_PEM,
423 bool bIsClient = true,
424 uint32_t timeout=WAIT_FOREVER);
425
451 int SSL_negotiate(int tcpFd,
452 const char *common_name,
453 bool reuseSessionPort = true,
454 bool verifyPeer = false,
455 const unsigned char *certBuff = nullptr,
456 uint32_t certBuffSize = 0,
457 uint16_t certBuffFormat = SSL_FILETYPE_PEM,
458 bool bIsClient = true);
459
484 int SSLReadWithTimeout(int fd, char *cp, int size, uint32_t timeout);
485
502 uint32_t SetMaxSessionReuseTime(uint32_t newLifetimeTicks);
503
518 bool IsSSL_CertNKeyValid(const char *keyPEM,
519 ssize_t keylen,
520 const char *certPEM,
521 ssize_t certlen,
522 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
523
534 bool SSL_AddCertToClientCaList(const unsigned char *certBuff = nullptr,
535 uint32_t certBuffSize = 0,
536 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
537
548 bool SSL_AddCertToServerCaList(const unsigned char *certBuff = nullptr,
549 uint32_t certBuffSize = 0,
550 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
551
558 bool SSL_ClearClientCaList();
559
566 bool SSL_ClearServerCaList();
567
576 uint16_t SSLGetRxBufferSpaceUsed(int fd);
577
586 uint16_t SSLGetTxBufferAvailSpace(int fd);
587
596 void SslInit();
597
601 void SSL_DumpSSLSockets();
602
610 void SSL_ClientReadyCert(const unsigned char *cert, const unsigned char *key, uint16_t certBuffFormat =
SSL_FILETYPE_PEM);
611
619 void SSL_ServerReadyCert(const unsigned char *cert, const unsigned char *key, uint16_t certBuffFormat =
SSL_FILETYPE_PEM);
620 #endif /* NB_SSL_SUPPORTED */
621
622 // These functions can also be used with SSH, so needed to be exposed there
623 #if defined(NB_SSL_SUPPORTED) || defined(NB_SSH_SUPPORTED)
627 enum class ExpireRetCodes : unsigned char
628 {
629 E_CERT_VALID = 0,
630 E_CERT_EXPIRED = 1,
631 E_BAD_EXPIRATION_VALUE = 2,
632 E_NO_SYSTEM_TIME = 3
633 };
634
647 ExpireRetCodes SSL_IsCertExpired(unsigned char *certBuff, int certLen, uint16_t certBuffFormat =
SSL_FILETYPE_PEM);
648
661 bool SSL_GetIssuerFromCert(unsigned char *certBuff,
662 int certLen,
663 unsigned char *issBuf,
664 int issBufLen,
665 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
666
679 bool SSL_GetSubjectNameFromCert(unsigned char *certBuff,
680 int certLen,
681 unsigned char *subNamBuf,
682 int subNamBufLen,
683 uint16_t certBuffFormat = SSL_FILETYPE_PEM);

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1011

684
697 bool SSL_GetAltNameFromCert(unsigned char *certBuff,
698 int certLen,
699 unsigned char *altNamBuf,
700 int altNamBufLen,
701 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
702
715 bool SSL_GetExpirationDate(unsigned char *certBuff,
716 int certLen,
717 unsigned char *expBuf,
718 int expBufLen,
719 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
720
732 bool SSL_GetTimeToExpire(unsigned char *certBuff, int certLen, uint16_t certBuffFormat, time_t
&timeToExp);
733
746 bool SSL_GetCnFromCert(unsigned char *certBuff,
747 int certLen,
748 unsigned char *comNamBuf,
749 int comNamBufLen,
750 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
751
763 const char *GetCertificatePEM();
764
776 int GetCertificateLen();
777
789 const char *GetPrivateKeyPEM();
790
802 int GetPrivateKeyLen();
803
809 void SslSetVerifyPeerClient(bool verifyPeer);
810
816 void SslSetVerifyPeerServer(bool verifyPeer);
817
827 bool SSL_IsCertAddedToClientCaList();
828
838 bool SSL_IsCertAddedToServerCaList();
839 #endif /*defined(NB_SSL_SUPPORT) || defined(NB_SSH_SUPPORT)*/
840
841 #endif /* #ifndef _SSL_H_ */
842

22.197 wolfssl/openssl/ssl.h
1 /* ssl.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 /* ssl.h defines wolfssl_openssl compatibility layer
15 *
16 */
17
18
19 #ifndef WOLFSSL_OPENSSL_H_
20 #define WOLFSSL_OPENSSL_H_
21
22 /* wolfssl_openssl compatibility layer */
23 #ifndef OPENSSL_EXTRA_SSL_GUARD
24 #define OPENSSL_EXTRA_SSL_GUARD
25 #include <wolfssl/ssl.h>
26 #endif /* OPENSSL_EXTRA_SSL_GUARD */
27
28 #include <wolfssl/openssl/tls1.h>
29 #ifndef WOLFCRYPT_ONLY
30 #include <wolfssl/openssl/evp.h>
31 #endif
32 #include <wolfssl/openssl/bio.h>
33 #ifdef OPENSSL_EXTRA
34 #include <wolfssl/openssl/crypto.h>
35 #endif
36
37 #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
38 #include <wolfssl/openssl/dh.h>
39 #include <wolfssl/openssl/objects.h>
40 #endif
41

NetBurner, Inc.
1012 File Documentation

42 /* need MIN_CODE_E to determine wolfSSL error range */


43 #include <wolfssl/wolfcrypt/error-crypt.h>
44
45 /* all NID_* values are in asn.h */
46 #include <wolfssl/wolfcrypt/asn.h>
47
48 #include <wolfssl/openssl/x509.h>
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54 #ifdef _WIN32
55 /* wincrypt.h clashes */
56 #undef X509_NAME
57 #endif
58
59 #ifdef WOLFSSL_UTASKER
60 /* tcpip.h clashes */
61 #undef ASN1_INTEGER
62 #endif
63
64 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
65
66 typedef WOLFSSL SSL;
67 typedef WOLFSSL_SESSION SSL_SESSION;
68 typedef WOLFSSL_METHOD SSL_METHOD;
69 typedef WOLFSSL_CTX SSL_CTX;
70
71 typedef WOLFSSL_X509 X509;
72 typedef WOLFSSL_X509 X509_REQ;
73 typedef WOLFSSL_X509_NAME X509_NAME;
74 typedef WOLFSSL_X509_INFO X509_INFO;
75 typedef WOLFSSL_X509_CHAIN X509_CHAIN;
76
77 /* STACK_OF(ASN1_OBJECT) */
78 typedef WOLFSSL_STACK EXTENDED_KEY_USAGE;
79
80
81 /* redeclare guard */
82 #define WOLFSSL_TYPES_DEFINED
83
84 typedef WOLFSSL_BIO BIO;
85 typedef WOLFSSL_BIO_METHOD BIO_METHOD;
86 typedef WOLFSSL_CIPHER SSL_CIPHER;
87 typedef WOLFSSL_X509_LOOKUP X509_LOOKUP;
88 typedef WOLFSSL_X509_LOOKUP_METHOD X509_LOOKUP_METHOD;
89 typedef WOLFSSL_X509_CRL X509_CRL;
90 typedef WOLFSSL_X509_EXTENSION X509_EXTENSION;
91 typedef WOLFSSL_X509_PUBKEY X509_PUBKEY;
92 typedef WOLFSSL_X509_ALGOR X509_ALGOR;
93 typedef WOLFSSL_ASN1_TIME ASN1_TIME;
94 typedef WOLFSSL_ASN1_INTEGER ASN1_INTEGER;
95 typedef WOLFSSL_ASN1_OBJECT ASN1_OBJECT;
96 typedef WOLFSSL_ASN1_STRING ASN1_STRING;
97 typedef WOLFSSL_ASN1_TYPE ASN1_TYPE;
98 typedef WOLFSSL_X509_ATTRIBUTE X509_ATTRIBUTE;
99 typedef WOLFSSL_ASN1_BIT_STRING ASN1_BIT_STRING;
100 typedef WOLFSSL_dynlock_value CRYPTO_dynlock_value;
101 typedef WOLFSSL_BUF_MEM BUF_MEM;
102 typedef WOLFSSL_GENERAL_NAMES GENERAL_NAMES;
103 typedef WOLFSSL_GENERAL_NAME GENERAL_NAME;
104 typedef WOLFSSL_OBJ_NAME OBJ_NAME;
105 typedef WOLFSSL_DIST_POINT_NAME DIST_POINT_NAME;
106 typedef WOLFSSL_DIST_POINT DIST_POINT;
107
108 #define X509_L_FILE_LOAD WOLFSSL_X509_L_FILE_LOAD
109 #define X509_L_ADD_DIR WOLFSSL_X509_L_ADD_DIR
110 #define X509_L_ADD_STORE WOLFSSL_X509_L_ADD_STORE
111 #define X509_L_LOAD_STORE WOLFSSL_X509_L_LOAD_STORE
112
113 #define ASN1_UTCTIME WOLFSSL_ASN1_TIME
114 #define ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TIME
115
116 typedef WOLFSSL_COMP_METHOD COMP_METHOD;
117 typedef WOLFSSL_COMP SSL_COMP;
118 typedef WOLFSSL_X509_REVOKED X509_REVOKED;
119 typedef WOLFSSL_X509_LOOKUP_TYPE X509_LOOKUP_TYPE;
120 typedef WOLFSSL_X509_OBJECT X509_OBJECT;
121 typedef WOLFSSL_X509_STORE X509_STORE;
122 typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX;
123 typedef WOLFSSL_X509_VERIFY_PARAM X509_VERIFY_PARAM;
124
125 typedef int OSSL_HANDSHAKE_STATE;
126 #define TLS_ST_BEFORE 0 /* NULL_STATE from enum states */
127
128 #define EVP_CIPHER_INFO EncryptedInfo

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1013

129
130 #define STACK_OF(x) WOLFSSL_STACK
131 #define OPENSSL_STACK WOLFSSL_STACK
132 #define _STACK OPENSSL_STACK
133
134 #define CONF_get1_default_config_file wolfSSL_CONF_get1_default_config_file
135 typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
136
137 #define CRYPTO_free wolfSSL_CRYPTO_free
138 #define CRYPTO_malloc wolfSSL_CRYPTO_malloc
139 #define CRYPTO_EX_new WOLFSSL_CRYPTO_EX_new
140 #define CRYPTO_EX_dup WOLFSSL_CRYPTO_EX_dup
141 #define CRYPTO_EX_free WOLFSSL_CRYPTO_EX_free
142 #ifdef HAVE_EX_DATA
143 #define CRYPTO_EX_DATA WOLFSSL_CRYPTO_EX_DATA
144 #endif
145
146 #define CRYPTO_set_mem_functions wolfSSL_CRYPTO_set_mem_functions
147
148 /* depreciated */
149 #define CRYPTO_thread_id wolfSSL_thread_id
150 #define CRYPTO_set_id_callback wolfSSL_set_id_callback
151
152 #define CRYPTO_LOCK 0x01
153 #define CRYPTO_UNLOCK 0x02
154 #define CRYPTO_READ 0x04
155 #define CRYPTO_WRITE 0x08
156
157 #define CRYPTO_set_locking_callback wolfSSL_set_locking_callback
158 #define CRYPTO_set_dynlock_create_callback wolfSSL_set_dynlock_create_callback
159 #define CRYPTO_set_dynlock_lock_callback wolfSSL_set_dynlock_lock_callback
160 #define CRYPTO_set_dynlock_destroy_callback wolfSSL_set_dynlock_destroy_callback
161 #define CRYPTO_num_locks wolfSSL_num_locks
162 #define CRYPTO_dynlock_value WOLFSSL_dynlock_value
163
164 #define CRYPTO_cleanup_all_ex_data wolfSSL_cleanup_all_ex_data
165 #define set_ex_data wolfSSL_CRYPTO_set_ex_data
166 #define get_ex_data wolfSSL_CRYPTO_get_ex_data
167 #define CRYPTO_memcmp wolfSSL_CRYPTO_memcmp
168 #define CRYPTO_get_ex_new_index wolfSSL_CRYPTO_get_ex_new_index
169
170 #define CRYPTO_get_ex_new_index wolfSSL_CRYPTO_get_ex_new_index
171
172 /* this function was used to set the default malloc, free, and realloc */
173 #define CRYPTO_malloc_init() 0 /* CRYPTO_malloc_init is not needed */
174 #define OPENSSL_malloc_init() 0 /* OPENSSL_malloc_init is not needed */
175
176 #define SSL_get_client_random(ssl,out,outSz) \
177 wolfSSL_get_client_random((ssl),(out),(outSz))
178 #define SSL_get_cipher_list(ctx,i) wolfSSL_get_cipher_list_ex((ctx),(i))
179 #define SSL_get_cipher_name(ctx) wolfSSL_get_cipher((ctx))
180 #define SSL_get_shared_ciphers(ctx,buf,len) \
181 wolfSSL_get_shared_ciphers((ctx),(buf),(len))
182
183 /* at the moment only returns ok */
184 #define SSL_get_verify_result wolfSSL_get_verify_result
185 #define SSL_get_verify_mode wolfSSL_get_verify_mode
186 #define SSL_get_verify_depth wolfSSL_get_verify_depth
187 #define SSL_CTX_get_verify_mode wolfSSL_CTX_get_verify_mode
188 #define SSL_CTX_get_verify_depth wolfSSL_CTX_get_verify_depth
189 #define SSL_get_certificate wolfSSL_get_certificate
190 #define SSL_CTX_get0_certificate wolfSSL_CTX_get0_certificate
191 #define SSL_use_certificate wolfSSL_use_certificate
192 #define SSL_use_certificate_ASN1 wolfSSL_use_certificate_ASN1
193 #define d2i_PKCS8_PRIV_KEY_INFO_bio wolfSSL_d2i_PKCS8_PKEY_bio
194 #define d2i_PKCS8_PRIV_KEY_INFO wolfSSL_d2i_PKCS8_PKEY
195 #define i2d_PKCS8_PRIV_KEY_INFO wolfSSL_i2d_PrivateKey
196 #define d2i_PKCS8PrivateKey_bio wolfSSL_d2i_PKCS8PrivateKey_bio
197 #define i2d_PKCS8PrivateKey_bio wolfSSL_PEM_write_bio_PKCS8PrivateKey
198 #define PKCS8_PRIV_KEY_INFO_free wolfSSL_EVP_PKEY_free
199 #define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
200 #define SSL_CTX_set_ecdh_auto wolfSSL_CTX_set_ecdh_auto
201
202 #define i2d_PUBKEY wolfSSL_i2d_PUBKEY
203 #define d2i_PUBKEY wolfSSL_d2i_PUBKEY
204 #define d2i_PUBKEY_bio wolfSSL_d2i_PUBKEY_bio
205 #define d2i_PublicKey wolfSSL_d2i_PublicKey
206 #define d2i_PrivateKey wolfSSL_d2i_PrivateKey
207 #define d2i_AutoPrivateKey wolfSSL_d2i_AutoPrivateKey
208 #define SSL_use_PrivateKey wolfSSL_use_PrivateKey
209 #define SSL_use_PrivateKey_ASN1 wolfSSL_use_PrivateKey_ASN1
210 #define SSL_use_RSAPrivateKey_ASN1 wolfSSL_use_RSAPrivateKey_ASN1
211 #define SSL_get_privatekey wolfSSL_get_privatekey
212 #define SSL_CTX_use_PrivateKey_ASN1 wolfSSL_CTX_use_PrivateKey_ASN1
213
214 #define SSLv23_method wolfSSLv23_method
215 #define SSLv23_client_method wolfSSLv23_client_method

NetBurner, Inc.
1014 File Documentation

216 #define SSLv2_client_method wolfSSLv2_client_method


217 #define SSLv2_server_method wolfSSLv2_server_method
218 #define SSLv3_server_method wolfSSLv3_server_method
219 #define SSLv3_client_method wolfSSLv3_client_method
220 #define TLS_client_method wolfTLS_client_method
221 #define TLS_server_method wolfTLS_server_method
222 #define TLSv1_method wolfTLSv1_method
223 #define TLSv1_server_method wolfTLSv1_server_method
224 #define TLSv1_client_method wolfTLSv1_client_method
225 #define TLSv1_1_method wolfTLSv1_1_method
226 #define TLSv1_1_server_method wolfTLSv1_1_server_method
227 #define TLSv1_1_client_method wolfTLSv1_1_client_method
228 #define TLSv1_2_method wolfTLSv1_2_method
229 #define TLSv1_2_server_method wolfTLSv1_2_server_method
230 #define TLSv1_2_client_method wolfTLSv1_2_client_method
231 #define TLSv1_3_method wolfTLSv1_3_method
232 #define TLSv1_3_server_method wolfTLSv1_3_server_method
233 #define TLSv1_3_client_method wolfTLSv1_3_client_method
234 #define TLS_method wolfSSLv23_method
235
236 #define X509_FILETYPE_ASN1 WOLFSSL_FILETYPE_ASN1
237 #define X509_FILETYPE_DEFAULT WOLFSSL_FILETYPE_DEFAULT
238
239 #define X509_F_X509_CHECK_PRIVATE_KEY 128
240
241 #ifdef WOLFSSL_DTLS
242 #define DTLSv1_client_method wolfDTLSv1_client_method
243 #define DTLSv1_server_method wolfDTLSv1_server_method
244 #define DTLSv1_2_client_method wolfDTLSv1_2_client_method
245 #define DTLSv1_2_server_method wolfDTLSv1_2_server_method
246 #define DTLS_method wolfDTLS_method
247 #endif
248
249
250 #ifndef NO_FILESYSTEM
251 #define SSL_CTX_use_certificate_file wolfSSL_CTX_use_certificate_file
252 #define SSL_CTX_use_PrivateKey_file wolfSSL_CTX_use_PrivateKey_file
253 #ifdef WOLFSSL_APACHE_HTTPD
254 #define SSL_CTX_load_verify_locations(ctx,file,path) \
255 wolfSSL_CTX_load_verify_locations_ex(ctx,file,path,\
256 WOLFSSL_LOAD_FLAG_IGNORE_ERR)
257 #else
258 #define SSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations
259 #endif
260 #define SSL_CTX_use_certificate_chain_file wolfSSL_CTX_use_certificate_chain_file
261 #define SSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file
262
263 #define SSL_use_certificate_file wolfSSL_use_certificate_file
264 #define SSL_use_PrivateKey_file wolfSSL_use_PrivateKey_file
265 #define SSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file
266 #define SSL_use_RSAPrivateKey_file wolfSSL_use_RSAPrivateKey_file
267 #endif
268
269 #define SSL_CTX_new(method) wolfSSL_CTX_new((WOLFSSL_METHOD*)(method))
270 #ifdef OPENSSL_EXTRA
271 #define SSL_CTX_up_ref wolfSSL_CTX_up_ref
272 #endif
273 #define SSL_new wolfSSL_new
274 #define SSL_set_fd wolfSSL_set_fd
275 #define SSL_get_fd wolfSSL_get_fd
276 #define SSL_connect wolfSSL_connect
277 #define SSL_clear wolfSSL_clear
278 #define SSL_state wolfSSL_state
279 #define SSL_read_early_data(ssl, d, dLen, len) wolfSSL_read_early_data(ssl, d, (int)(dLen), (int
*)(len))
280 #define SSL_write_early_data(ssl, d, dLen, len) wolfSSL_write_early_data(ssl, d, (int)(dLen), (int
*)(len))
281
282 #define SSL_write wolfSSL_write
283 #define SSL_read wolfSSL_read
284 #define SSL_peek wolfSSL_peek
285 #define SSL_accept wolfSSL_accept
286 #define SSL_CTX_free wolfSSL_CTX_free
287 #define SSL_free wolfSSL_free
288 #define SSL_shutdown wolfSSL_shutdown
289 #define SSL_set_timeout wolfSSL_SSL_SESSION_set_timeout
290
291 #define SSL_CTX_set_quiet_shutdown wolfSSL_CTX_set_quiet_shutdown
292 #define SSL_set_quiet_shutdown wolfSSL_set_quiet_shutdown
293 #define SSL_get_error wolfSSL_get_error
294 #define SSL_set_session wolfSSL_set_session
295 #define SSL_get_session(x) wolfSSL_get_session((WOLFSSL*) (x))
296 #define SSL_SESSION_get0_peer wolfSSL_SESSION_get0_peer
297 #define SSL_flush_sessions wolfSSL_flush_sessions
298 /* assume unlimited temporarily */
299 #define SSL_CTX_get_session_cache_mode(ctx) 0
300

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1015

301 #define SSL_CTX_set_verify wolfSSL_CTX_set_verify


302 #define SSL_CTX_set_cert_verify_callback wolfSSL_CTX_set_cert_verify_callback
303 #define SSL_CTX_set_cert_cb wolfSSL_CTX_set_cert_cb
304 #define SSL_set_verify wolfSSL_set_verify
305 #define SSL_set_verify_result wolfSSL_set_verify_result
306 #define SSL_verify_client_post_handshake wolfSSL_verify_client_post_handshake
307 #define SSL_set_post_handshake_auth wolfSSL_set_post_handshake_auth
308 #define SSL_CTX_set_post_handshake_auth wolfSSL_CTX_set_post_handshake_auth
309 #define SSL_pending(x) wolfSSL_pending((WOLFSSL*)(x))
310 #define SSL_has_pending wolfSSL_has_pending
311 #define SSL_load_error_strings wolfSSL_load_error_strings
312 #define SSL_library_init wolfSSL_library_init
313 #define OPENSSL_cleanup (void)wolfSSL_Cleanup
314 #define OPENSSL_init_ssl wolfSSL_OPENSSL_init_ssl
315 #define OpenSSL_add_ssl_algorithms wolfSSL_library_init
316 #define SSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode
317 #define SSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list
318 #define SSL_CTX_set_ciphersuites wolfSSL_CTX_set_cipher_list
319 #define SSL_set_cipher_list wolfSSL_set_cipher_list
320 /* wolfSSL does not support security levels */
321 #define SSL_CTX_set_security_level wolfSSL_CTX_set_security_level
322 #define SSL_CTX_get_security_level wolfSSL_CTX_get_security_level
323 #define SSL_export_keying_material wolfSSL_export_keying_material
324
325 #define SSL_CTX_set1_sigalgs_list wolfSSL_CTX_set1_sigalgs_list
326 #define SSL_set1_sigalgs_list wolfSSL_set1_sigalgs_list
327 #define SSL_get_signature_nid wolfSSL_get_signature_nid
328
329 #define SSL_CTX_set1_groups wolfSSL_CTX_set1_groups
330 #define SSL_set1_groups wolfSSL_set1_groups
331
332 #define SSL_CTX_set1_groups_list wolfSSL_CTX_set1_groups_list
333 #define SSL_set1_groups_list wolfSSL_set1_groups_list
334
335 #define SSL_set_ex_data wolfSSL_set_ex_data
336 #define SSL_get_shutdown wolfSSL_get_shutdown
337 #define SSL_get_finished wolfSSL_get_finished
338 #define SSL_get_peer_finished wolfSSL_get_peer_finished
339 #define SSL_set_rfd wolfSSL_set_rfd
340 #define SSL_set_wfd wolfSSL_set_wfd
341 #define SSL_set_shutdown wolfSSL_set_shutdown
342 #define SSL_set_session_id_context wolfSSL_set_session_id_context
343 #define SSL_set_connect_state wolfSSL_set_connect_state
344 #define SSL_set_accept_state wolfSSL_set_accept_state
345 #define SSL_SESSION_new wolfSSL_SESSION_new
346 #define SSL_session_reused wolfSSL_session_reused
347 #define SSL_SESSION_up_ref wolfSSL_SESSION_up_ref
348 #define SSL_SESSION_dup wolfSSL_SESSION_dup
349 #define SSL_SESSION_free wolfSSL_SESSION_free
350 #define SSL_SESSION_set_cipher wolfSSL_SESSION_set_cipher
351 #define SSL_is_init_finished wolfSSL_is_init_finished
352
353 #define SSL_get_version wolfSSL_get_version
354 #define SSL_get_current_cipher wolfSSL_get_current_cipher
355
356 /* use wolfSSL_get_cipher_name for its return format */
357 #define SSL_get_cipher wolfSSL_get_cipher_name
358 #define SSL_CIPHER_description wolfSSL_CIPHER_description
359 #define SSL_CIPHER_get_name wolfSSL_CIPHER_get_name
360 #define SSL_CIPHER_get_version wolfSSL_CIPHER_get_version
361 #define SSL_CIPHER_get_id wolfSSL_CIPHER_get_id
362 #define SSL_CIPHER_get_rfc_name wolfSSL_CIPHER_get_name
363 #define SSL_CIPHER_standard_name wolfSSL_CIPHER_get_name
364 #define SSL_CIPHER_get_auth_nid wolfSSL_CIPHER_get_auth_nid
365 #define SSL_CIPHER_get_cipher_nid wolfSSL_CIPHER_get_cipher_nid
366 #define SSL_CIPHER_get_digest_nid wolfSSL_CIPHER_get_digest_nid
367 #define SSL_CIPHER_get_kx_nid wolfSSL_CIPHER_get_kx_nid
368 #define SSL_CIPHER_is_aead wolfSSL_CIPHER_is_aead
369 #define SSL_get_cipher_by_value wolfSSL_get_cipher_by_value
370
371 #define SSL_get1_session wolfSSL_get1_session
372
373 #define SSL_get_keyblock_size wolfSSL_get_keyblock_size
374 #define SSL_get_keys wolfSSL_get_keys
375 #define SSL_SESSION_get_master_key wolfSSL_SESSION_get_master_key
376 #define SSL_SESSION_get_master_key_length wolfSSL_SESSION_get_master_key_length
377 #define SSL_SESSION_get_max_early_data wolfSSL_SESSION_get_max_early_data
378
379 #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
380 #define SSL_MODE_RELEASE_BUFFERS 0x00000010U
381 #define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
382 #define X509_get_ext wolfSSL_X509_get_ext
383 #define X509_get_ext_by_OBJ wolfSSL_X509_get_ext_by_OBJ
384 #define X509_cmp wolfSSL_X509_cmp
385 #define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
386 #define X509_EXTENSION_get_critical wolfSSL_X509_EXTENSION_get_critical
387 #define X509_EXTENSION_get_data wolfSSL_X509_EXTENSION_get_data

NetBurner, Inc.
1016 File Documentation

388 #define X509_EXTENSION_new wolfSSL_X509_EXTENSION_new


389 #define X509_EXTENSION_free wolfSSL_X509_EXTENSION_free
390 #endif
391
392 #define DSA_dup_DH wolfSSL_DSA_dup_DH
393 /* wolfSSL does not support DSA as the cert public key */
394 #define EVP_PKEY_get0_DSA wolfSSL_EVP_PKEY_get0_DSA
395 #define EVP_PKEY_param_check wolfSSL_EVP_PKEY_param_check
396 #define EVP_PKEY_CTX_free wolfSSL_EVP_PKEY_CTX_free
397 #define DSA_bits wolfSSL_DSA_bits
398
399 #define i2d_X509_bio wolfSSL_i2d_X509_bio
400 #define i2d_X509_REQ_bio wolfSSL_i2d_X509_REQ_bio
401 #define d2i_X509_bio wolfSSL_d2i_X509_bio
402 #define d2i_X509_REQ_bio wolfSSL_d2i_X509_REQ_bio
403 #define d2i_X509_fp wolfSSL_d2i_X509_fp
404 #define i2d_X509 wolfSSL_i2d_X509
405 #define d2i_X509 wolfSSL_d2i_X509
406 #define PEM_read_bio_X509 wolfSSL_PEM_read_bio_X509
407 #define PEM_read_bio_X509_REQ wolfSSL_PEM_read_bio_X509_REQ
408 #define PEM_read_X509_REQ wolfSSL_PEM_read_X509_REQ
409 #define PEM_read_bio_X509_CRL wolfSSL_PEM_read_bio_X509_CRL
410 #define PEM_read_bio_X509_AUX wolfSSL_PEM_read_bio_X509_AUX
411 #define PEM_read_X509 wolfSSL_PEM_read_X509
412 #define PEM_write_bio_X509 wolfSSL_PEM_write_bio_X509
413 #define PEM_write_bio_X509_AUX wolfSSL_PEM_write_bio_X509_AUX
414 #define PEM_X509_INFO_read_bio wolfSSL_PEM_X509_INFO_read_bio
415 #define PEM_X509_INFO_read wolfSSL_PEM_X509_INFO_read
416 #define i2d_PrivateKey wolfSSL_i2d_PrivateKey
417 #define i2d_PublicKey wolfSSL_i2d_PublicKey
418
419 #define i2d_X509_REQ wolfSSL_i2d_X509_REQ
420 #define d2i_X509_REQ wolfSSL_d2i_X509_REQ
421 #define X509_REQ_new wolfSSL_X509_REQ_new
422 #define X509_REQ_free wolfSSL_X509_REQ_free
423 #define X509_REQ_sign wolfSSL_X509_REQ_sign
424 #define X509_REQ_sign_ctx wolfSSL_X509_REQ_sign_ctx
425 #define X509_REQ_add_extensions wolfSSL_X509_REQ_add_extensions
426 #define X509_REQ_add1_attr_by_NID wolfSSL_X509_REQ_add1_attr_by_NID
427 #define X509_REQ_add1_attr_by_txt wolfSSL_X509_REQ_add1_attr_by_txt
428 #define X509_REQ_get_attr_by_NID wolfSSL_X509_REQ_get_attr_by_NID
429 #define X509_REQ_get_attr wolfSSL_X509_REQ_get_attr
430 #define X509_ATTRIBUTE_get0_type wolfSSL_X509_ATTRIBUTE_get0_type
431 #define X509_to_X509_REQ wolfSSL_X509_to_X509_REQ
432 #define X509_REQ_set_subject_name wolfSSL_X509_REQ_set_subject_name
433 #define X509_REQ_set_pubkey wolfSSL_X509_REQ_set_pubkey
434 #define PEM_write_bio_X509_REQ wolfSSL_PEM_write_bio_X509_REQ
435
436 #define X509_new wolfSSL_X509_new
437 #define X509_up_ref wolfSSL_X509_up_ref
438 #define X509_free wolfSSL_X509_free
439 #define X509_load_certificate_file wolfSSL_X509_load_certificate_file
440 #define X509_digest wolfSSL_X509_digest
441 #define X509_pubkey_digest wolfSSL_X509_pubkey_digest
442 #define X509_get_extension_flags wolfSSL_X509_get_extension_flags
443 #define X509_get_key_usage wolfSSL_X509_get_key_usage
444 #define X509_get_extended_key_usage wolfSSL_X509_get_extended_key_usage
445 #define X509_get_ext_count wolfSSL_X509_get_ext_count
446 #define X509_get_ext_d2i wolfSSL_X509_get_ext_d2i
447 #define X509V3_EXT_i2d wolfSSL_X509V3_EXT_i2d
448 #define X509_get0_extensions wolfSSL_X509_get0_extensions
449 #define X509_get_extensions wolfSSL_X509_get0_extensions
450 #define X509_REQ_get_extensions wolfSSL_X509_REQ_get_extensions
451 #define X509_get_ext wolfSSL_X509_get_ext
452 #define X509_get_ext_by_NID wolfSSL_X509_get_ext_by_NID
453 #define X509_get_issuer_name wolfSSL_X509_get_issuer_name
454 #define X509_issuer_name_hash wolfSSL_X509_issuer_name_hash
455 #define X509_subject_name_hash wolfSSL_X509_subject_name_hash
456 #define X509_get_subject_name(x) wolfSSL_X509_get_subject_name((WOLFSSL_X509*)(x))
457 #define X509_REQ_get_subject_name wolfSSL_X509_get_subject_name
458 #define X509_get_pubkey wolfSSL_X509_get_pubkey
459 #define X509_get0_pubkey wolfSSL_X509_get_pubkey
460 #define X509_REQ_get_pubkey wolfSSL_X509_get_pubkey
461 #define X509_get_notBefore wolfSSL_X509_get_notBefore
462 #define X509_get0_notBefore wolfSSL_X509_get_notBefore
463 #define X509_getm_notBefore wolfSSL_X509_get_notBefore
464 #define X509_get_notAfter wolfSSL_X509_get_notAfter
465 #define X509_get0_notAfter wolfSSL_X509_get_notAfter
466 #define X509_getm_notAfter wolfSSL_X509_get_notAfter
467 #define X509_get_serialNumber wolfSSL_X509_get_serialNumber
468 #define X509_get0_pubkey_bitstr wolfSSL_X509_get0_pubkey_bitstr
469 #define X509_get_ex_new_index wolfSSL_X509_get_ex_new_index
470 #define X509_get_ex_data wolfSSL_X509_get_ex_data
471 #define X509_set_ex_data wolfSSL_X509_set_ex_data
472 #define X509_get1_ocsp wolfSSL_X509_get1_ocsp
473 #define X509_get_version wolfSSL_X509_get_version
474 #define X509_get_signature_nid wolfSSL_X509_get_signature_nid

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1017

475 #define X509_set_subject_name wolfSSL_X509_set_subject_name


476 #define X509_set_issuer_name wolfSSL_X509_set_issuer_name
477 #define X509_set_pubkey wolfSSL_X509_set_pubkey
478 #define X509_set_notAfter wolfSSL_X509_set_notAfter
479 #define X509_set_notBefore wolfSSL_X509_set_notBefore
480 #define X509_set_serialNumber wolfSSL_X509_set_serialNumber
481 #define X509_set_version wolfSSL_X509_set_version
482 #define X509_REQ_set_version wolfSSL_X509_set_version
483 #define X509_sign wolfSSL_X509_sign
484 #define X509_sign_ctx wolfSSL_X509_sign_ctx
485 #define X509_print wolfSSL_X509_print
486 #define X509_REQ_print wolfSSL_X509_print
487 #define X509_print_ex wolfSSL_X509_print_ex
488 #define X509_print_fp wolfSSL_X509_print_fp
489 #define X509_CRL_print wolfSSL_X509_CRL_print
490 #define X509_REQ_print_fp wolfSSL_X509_print_fp
491 #define X509_signature_print wolfSSL_X509_signature_print
492 #define X509_get0_signature wolfSSL_X509_get0_signature
493 #define X509_verify_cert_error_string wolfSSL_X509_verify_cert_error_string
494 #define X509_verify_cert wolfSSL_X509_verify_cert
495 #define X509_verify wolfSSL_X509_verify
496 #define X509_REQ_verify wolfSSL_X509_REQ_verify
497 #define X509_check_private_key wolfSSL_X509_check_private_key
498 #define X509_REQ_check_private_key wolfSSL_X509_check_private_key
499 #define X509_check_ca wolfSSL_X509_check_ca
500 #define X509_check_host wolfSSL_X509_check_host
501 #define X509_check_email wolfSSL_X509_check_email
502 #define X509_check_ip_asc wolfSSL_X509_check_ip_asc
503 #define X509_email_free wolfSSL_X509_email_free
504 #define X509_check_issued wolfSSL_X509_check_issued
505 #define X509_dup wolfSSL_X509_dup
506 #define X509_add_ext wolfSSL_X509_add_ext
507 #define X509_delete_ext wolfSSL_X509_delete_ext
508
509 #define X509_EXTENSION_get_object wolfSSL_X509_EXTENSION_get_object
510 #define X509_EXTENSION_get_data wolfSSL_X509_EXTENSION_get_data
511 #define X509_EXTENSION_dup wolfSSL_X509_EXTENSION_dup
512
513 #define sk_X509_new wolfSSL_sk_X509_new
514 #define sk_X509_new_null wolfSSL_sk_X509_new
515 #define sk_X509_num wolfSSL_sk_X509_num
516 #define sk_X509_value wolfSSL_sk_X509_value
517 #define sk_X509_shift wolfSSL_sk_X509_shift
518 #define sk_X509_push wolfSSL_sk_X509_push
519 #define sk_X509_pop wolfSSL_sk_X509_pop
520 #define sk_X509_pop_free wolfSSL_sk_X509_pop_free
521 #define sk_X509_dup wolfSSL_sk_dup
522 #define sk_X509_free wolfSSL_sk_X509_free
523 #define X509_chain_up_ref wolfSSL_X509_chain_up_ref
524
525 #define sk_X509_CRL_new wolfSSL_sk_X509_CRL_new
526 #define sk_X509_CRL_pop_free wolfSSL_sk_X509_CRL_pop_free
527 #define sk_X509_CRL_free wolfSSL_sk_X509_CRL_free
528 #define sk_X509_CRL_push wolfSSL_sk_X509_CRL_push
529 #define sk_X509_CRL_value wolfSSL_sk_X509_CRL_value
530 #define sk_X509_CRL_num wolfSSL_sk_X509_CRL_num
531
532 #define sk_X509_OBJECT_new wolfSSL_sk_X509_OBJECT_new
533 #define sk_X509_OBJECT_free wolfSSL_sk_X509_OBJECT_free
534 #define sk_X509_OBJECT_pop_free wolfSSL_sk_X509_OBJECT_pop_free
535
536 #define sk_X509_EXTENSION_num wolfSSL_sk_X509_EXTENSION_num
537 #define sk_X509_EXTENSION_value wolfSSL_sk_X509_EXTENSION_value
538 #define sk_X509_EXTENSION_new_null wolfSSL_sk_X509_EXTENSION_new_null
539 #define sk_X509_EXTENSION_pop_free wolfSSL_sk_X509_EXTENSION_pop_free
540 #define sk_X509_EXTENSION_push wolfSSL_sk_X509_EXTENSION_push
541
542 #define X509_INFO_new wolfSSL_X509_INFO_new
543 #define X509_INFO_free wolfSSL_X509_INFO_free
544
545 #define sk_X509_INFO_new_null wolfSSL_sk_X509_INFO_new_null
546 #define sk_X509_INFO_num wolfSSL_sk_X509_INFO_num
547 #define sk_X509_INFO_value wolfSSL_sk_X509_INFO_value
548 #define sk_X509_INFO_push wolfSSL_sk_X509_INFO_push
549 #define sk_X509_INFO_pop wolfSSL_sk_X509_INFO_pop
550 #define sk_X509_INFO_pop_free wolfSSL_sk_X509_INFO_pop_free
551 #define sk_X509_INFO_free wolfSSL_sk_X509_INFO_free
552 #define sk_X509_INFO_shift wolfSSL_sk_X509_INFO_pop
553
554 #define i2d_X509_NAME wolfSSL_i2d_X509_NAME
555 #define d2i_X509_NAME wolfSSL_d2i_X509_NAME
556 #define X509_NAME_new wolfSSL_X509_NAME_new
557 #define X509_NAME_free wolfSSL_X509_NAME_free
558 #define X509_NAME_dup wolfSSL_X509_NAME_dup
559 #define X509_NAME_get_sz wolfSSL_X509_NAME_get_sz
560 #define X509_NAME_get_text_by_NID wolfSSL_X509_NAME_get_text_by_NID
561 #define X509_NAME_get_index_by_OBJ wolfSSL_X509_NAME_get_index_by_OBJ

NetBurner, Inc.
1018 File Documentation

562 #define X509_NAME_cmp wolfSSL_X509_NAME_cmp


563 #define X509_NAME_ENTRY_new wolfSSL_X509_NAME_ENTRY_new
564 #define X509_NAME_ENTRY_free wolfSSL_X509_NAME_ENTRY_free
565 #define X509_NAME_ENTRY_create_by_NID wolfSSL_X509_NAME_ENTRY_create_by_NID
566 #define X509_NAME_ENTRY_create_by_txt wolfSSL_X509_NAME_ENTRY_create_by_txt
567 #define X509_NAME_add_entry wolfSSL_X509_NAME_add_entry
568 #define X509_NAME_add_entry_by_txt wolfSSL_X509_NAME_add_entry_by_txt
569 #define X509_NAME_add_entry_by_NID wolfSSL_X509_NAME_add_entry_by_NID
570 #define X509_NAME_delete_entry wolfSSL_X509_NAME_delete_entry
571 #define X509_NAME_hash wolfSSL_X509_NAME_hash
572 #define X509_NAME_oneline wolfSSL_X509_NAME_oneline
573 #define X509_NAME_get_index_by_NID wolfSSL_X509_NAME_get_index_by_NID
574 #define X509_NAME_print_ex wolfSSL_X509_NAME_print_ex
575 #define X509_NAME_print_ex_fp wolfSSL_X509_NAME_print_ex_fp
576 #define X509_NAME_digest wolfSSL_X509_NAME_digest
577 #define X509_cmp_current_time wolfSSL_X509_cmp_current_time
578 #define X509_cmp_time wolfSSL_X509_cmp_time
579 #define X509_time_adj wolfSSL_X509_time_adj
580 #define X509_time_adj_ex wolfSSL_X509_time_adj_ex
581 #define X509_gmtime_adj wolfSSL_X509_gmtime_adj
582
583 #define sk_ACCESS_DESCRIPTION_num wolfSSL_sk_ACCESS_DESCRIPTION_num
584 #define sk_ACCESS_DESCRIPTION_value wolfSSL_sk_ACCESS_DESCRIPTION_value
585
586 #define sk_X509_NAME_new wolfSSL_sk_X509_NAME_new
587 #define sk_X509_NAME_new_null() wolfSSL_sk_X509_NAME_new(NULL)
588 #define sk_X509_NAME_push wolfSSL_sk_X509_NAME_push
589 #define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
590 #define sk_X509_NAME_set_cmp_func wolfSSL_sk_X509_NAME_set_cmp_func
591 #define sk_X509_NAME_num wolfSSL_sk_X509_NAME_num
592 #define sk_X509_NAME_value wolfSSL_sk_X509_NAME_value
593 #define sk_X509_NAME_pop wolfSSL_sk_X509_NAME_pop
594 #define sk_X509_NAME_pop_free wolfSSL_sk_X509_NAME_pop_free
595 #define sk_X509_NAME_free wolfSSL_sk_X509_NAME_free
596
597 typedef WOLFSSL_X509_NAME_ENTRY X509_NAME_ENTRY;
598
599 #define X509_NAME_entry_count wolfSSL_X509_NAME_entry_count
600 #define X509_NAME_get_entry wolfSSL_X509_NAME_get_entry
601 #define X509_NAME_ENTRY_get_object wolfSSL_X509_NAME_ENTRY_get_object
602 #define X509_NAME_ENTRY_get_data wolfSSL_X509_NAME_ENTRY_get_data
603 #define X509_NAME_ENTRY_get_object wolfSSL_X509_NAME_ENTRY_get_object
604
605 #define sk_X509_NAME_ENTRY_new wolfSSL_sk_X509_NAME_ENTRY_new
606 #define sk_X509_NAME_ENTRY_push wolfSSL_sk_X509_NAME_ENTRY_push
607 #define sk_X509_NAME_ENTRY_num wolfSSL_sk_X509_NAME_ENTRY_num
608 #define sk_X509_NAME_ENTRY_value wolfSSL_sk_X509_NAME_ENTRY_value
609 #define sk_X509_NAME_ENTRY_free wolfSSL_sk_X509_NAME_ENTRY_free
610
611 #define X509_V_FLAG_CRL_CHECK WOLFSSL_CRL_CHECK
612 #define X509_V_FLAG_CRL_CHECK_ALL WOLFSSL_CRL_CHECKALL
613
614 #define X509_V_FLAG_USE_CHECK_TIME WOLFSSL_USE_CHECK_TIME
615 #define X509_V_FLAG_NO_CHECK_TIME WOLFSSL_NO_CHECK_TIME
616 #define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT WOLFSSL_ALWAYS_CHECK_SUBJECT
617 #define X509_CHECK_FLAG_NO_WILDCARDS WOLFSSL_NO_WILDCARDS
618 #define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS WOLFSSL_NO_PARTIAL_WILDCARDS
619
620 #define X509_VP_FLAG_DEFAULT WOLFSSL_VPARAM_DEFAULT
621 #define X509_VP_FLAG_OVERWRITE WOLFSSL_VPARAM_OVERWRITE
622 #define X509_VP_FLAG_RESET_FLAGS WOLFSSL_VPARAM_RESET_FLAGS
623 #define X509_VP_FLAG_LOCKED WOLFSSL_VPARAM_LOCKED
624 #define X509_VP_FLAG_ONCE WOLFSSL_VPARAM_ONCE
625
626 #define X509_STORE_CTX_get_current_cert wolfSSL_X509_STORE_CTX_get_current_cert
627 #define X509_STORE_CTX_set_verify_cb wolfSSL_X509_STORE_CTX_set_verify_cb
628 #define X509_STORE_CTX_new wolfSSL_X509_STORE_CTX_new
629 #define X509_STORE_CTX_free wolfSSL_X509_STORE_CTX_free
630 #define X509_STORE_CTX_get_chain wolfSSL_X509_STORE_CTX_get_chain
631 #define X509_STORE_CTX_get0_chain wolfSSL_X509_STORE_CTX_get_chain
632 #define X509_STORE_CTX_get1_chain wolfSSL_X509_STORE_CTX_get1_chain
633 #define X509_STORE_CTX_get0_parent_ctx wolfSSL_X509_STORE_CTX_get0_parent_ctx
634 #define X509_STORE_CTX_get_error wolfSSL_X509_STORE_CTX_get_error
635 #define X509_STORE_CTX_get_error_depth wolfSSL_X509_STORE_CTX_get_error_depth
636 #define X509_STORE_CTX_init wolfSSL_X509_STORE_CTX_init
637 #define X509_STORE_CTX_cleanup wolfSSL_X509_STORE_CTX_cleanup
638 #define X509_STORE_CTX_set_error wolfSSL_X509_STORE_CTX_set_error
639 #define X509_STORE_CTX_set_error_depth wolfSSL_X509_STORE_CTX_set_error_depth
640 #define X509_STORE_CTX_get_ex_data wolfSSL_X509_STORE_CTX_get_ex_data
641 #define X509_STORE_CTX_set_ex_data wolfSSL_X509_STORE_CTX_set_ex_data
642 #define X509_STORE_CTX_set_depth wolfSSL_X509_STORE_CTX_set_depth
643 #define X509_STORE_CTX_verify_cb WOLFSSL_X509_STORE_CTX_verify_cb
644 #define X509_STORE_CTX_get0_current_issuer \
645 wolfSSL_X509_STORE_CTX_get0_current_issuer
646 #define X509_STORE_CTX_get0_store wolfSSL_X509_STORE_CTX_get0_store
647 #define X509_STORE_CTX_get0_cert wolfSSL_X509_STORE_CTX_get0_cert
648 #define X509_STORE_CTX_trusted_stack wolfSSL_X509_STORE_CTX_trusted_stack

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1019

649
650 #define X509_STORE_set_verify_cb(s, c) \
651 wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_CTX_verify_cb)(c))
652 #define X509_STORE_set_verify_cb_func(s, c) \
653 wolfSSL_X509_STORE_set_verify_cb((WOLFSSL_X509_STORE *)(s), (WOLFSSL_X509_STORE_CTX_verify_cb)(c))
654
655
656 #define X509_STORE_new wolfSSL_X509_STORE_new
657 #define X509_STORE_free wolfSSL_X509_STORE_free
658 #define X509_STORE_add_lookup wolfSSL_X509_STORE_add_lookup
659 #define X509_STORE_add_cert wolfSSL_X509_STORE_add_cert
660 #define X509_STORE_add_crl wolfSSL_X509_STORE_add_crl
661 #define X509_STORE_set_flags wolfSSL_X509_STORE_set_flags
662 #define X509_STORE_get1_certs wolfSSL_X509_STORE_get1_certs
663 #define X509_STORE_get_by_subject wolfSSL_X509_STORE_get_by_subject
664 #define X509_STORE_set_ex_data wolfSSL_X509_STORE_set_ex_data
665 #define X509_STORE_get_ex_data wolfSSL_X509_STORE_get_ex_data
666 #define X509_STORE_CTX_get1_issuer wolfSSL_X509_STORE_CTX_get1_issuer
667 #define X509_STORE_CTX_set_time wolfSSL_X509_STORE_CTX_set_time
668 #define X509_VERIFY_PARAM_new wolfSSL_X509_VERIFY_PARAM_new
669 #define X509_VERIFY_PARAM_free wolfSSL_X509_VERIFY_PARAM_free
670 #define X509_VERIFY_PARAM_set_flags wolfSSL_X509_VERIFY_PARAM_set_flags
671 #define X509_VERIFY_PARAM_get_flags wolfSSL_X509_VERIFY_PARAM_get_flags
672 #define X509_VERIFY_PARAM_clear_flags wolfSSL_X509_VERIFY_PARAM_clear_flags
673 #define X509_VERIFY_PARAM_set_hostflags wolfSSL_X509_VERIFY_PARAM_set_hostflags
674 #define X509_VERIFY_PARAM_set1_host wolfSSL_X509_VERIFY_PARAM_set1_host
675 #define X509_VERIFY_PARAM_set1_ip_asc wolfSSL_X509_VERIFY_PARAM_set1_ip_asc
676 #define X509_VERIFY_PARAM_set1_ip wolfSSL_X509_VERIFY_PARAM_set1_ip
677 #define X509_VERIFY_PARAM_set1 wolfSSL_X509_VERIFY_PARAM_set1
678 #define X509_STORE_load_locations wolfSSL_X509_STORE_load_locations
679
680 #define X509_LOOKUP_add_dir wolfSSL_X509_LOOKUP_add_dir
681 #define X509_LOOKUP_load_file wolfSSL_X509_LOOKUP_load_file
682 #define X509_LOOKUP_hash_dir wolfSSL_X509_LOOKUP_hash_dir
683 #define X509_LOOKUP_file wolfSSL_X509_LOOKUP_file
684 #define X509_LOOKUP_ctrl wolfSSL_X509_LOOKUP_ctrl
685
686 #define d2i_X509_CRL wolfSSL_d2i_X509_CRL
687 #define d2i_X509_CRL_fp wolfSSL_d2i_X509_CRL_fp
688 #define PEM_read_X509_CRL wolfSSL_PEM_read_X509_CRL
689
690 #define X509_CRL_free wolfSSL_X509_CRL_free
691 #define X509_CRL_get_lastUpdate wolfSSL_X509_CRL_get_lastUpdate
692 #define X509_CRL_get_nextUpdate wolfSSL_X509_CRL_get_nextUpdate
693 #define X509_CRL_verify wolfSSL_X509_CRL_verify
694 #define X509_CRL_get_REVOKED wolfSSL_X509_CRL_get_REVOKED
695 #define X509_load_crl_file wolfSSL_X509_load_crl_file
696
697 #define X509_get_X509_PUBKEY wolfSSL_X509_get_X509_PUBKEY
698 #define X509_REQ_get_X509_PUBKEY wolfSSL_X509_get_X509_PUBKEY
699 #define X509_get0_tbs_sigalg wolfSSL_X509_get0_tbs_sigalg
700 #define X509_PUBKEY_get0_param wolfSSL_X509_PUBKEY_get0_param
701 #define X509_PUBKEY_get wolfSSL_X509_PUBKEY_get
702 #define X509_PUBKEY_set wolfSSL_X509_PUBKEY_set
703 #define X509_ALGOR_get0 wolfSSL_X509_ALGOR_get0
704 #define X509_ALGOR_set0 wolfSSL_X509_ALGOR_set0
705
706 #define X509_ALGOR_new wolfSSL_X509_ALGOR_new
707 #define X509_ALGOR_free wolfSSL_X509_ALGOR_free
708 #define X509_PUBKEY_new wolfSSL_X509_PUBKEY_new
709 #define X509_PUBKEY_free wolfSSL_X509_PUBKEY_free
710
711 #define sk_X509_REVOKED_num wolfSSL_sk_X509_REVOKED_num
712 #define sk_X509_REVOKED_value wolfSSL_sk_X509_REVOKED_value
713
714 #define X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents
715
716 #define X509_OBJECT_get0_X509 wolfSSL_X509_OBJECT_get0_X509
717 #define X509_OBJECT_get0_X509_CRL wolfSSL_X509_OBJECT_get0_X509_CRL
718
719 #define X509_check_purpose(...) 0
720
721 #define OCSP_parse_url wolfSSL_OCSP_parse_url
722
723 #define MD4_Init wolfSSL_MD4_Init
724 #define MD4_Update wolfSSL_MD4_Update
725 #define MD4_Final wolfSSL_MD4_Final
726
727 #define BIO_new wolfSSL_BIO_new
728 #define BIO_free wolfSSL_BIO_free
729 #define BIO_vfree wolfSSL_BIO_vfree
730 #define BIO_free_all wolfSSL_BIO_free_all
731 #define BIO_nread0 wolfSSL_BIO_nread0
732 #define BIO_nread wolfSSL_BIO_nread
733 #define BIO_read wolfSSL_BIO_read
734 #define BIO_nwrite0 wolfSSL_BIO_nwrite0
735 #define BIO_nwrite wolfSSL_BIO_nwrite

NetBurner, Inc.
1020 File Documentation

736 #define BIO_write wolfSSL_BIO_write


737 #define BIO_push wolfSSL_BIO_push
738 #define BIO_pop wolfSSL_BIO_pop
739 #define BIO_flush wolfSSL_BIO_flush
740 #define BIO_pending wolfSSL_BIO_pending
741
742 #define BIO_get_mem_data wolfSSL_BIO_get_mem_data
743 #define BIO_new_mem_buf wolfSSL_BIO_new_mem_buf
744
745 #define BIO_f_buffer wolfSSL_BIO_f_buffer
746 #define BIO_set_write_buffer_size wolfSSL_BIO_set_write_buffer_size
747 #define BIO_f_ssl wolfSSL_BIO_f_ssl
748 #define BIO_new_socket wolfSSL_BIO_new_socket
749 #define BIO_new_connect wolfSSL_BIO_new_connect
750 #define BIO_new_accept wolfSSL_BIO_new_accept
751 #define BIO_set_conn_port wolfSSL_BIO_set_conn_port
752 #define BIO_do_connect wolfSSL_BIO_do_connect
753 #define BIO_do_accept wolfSSL_BIO_do_accept
754 #define BIO_do_handshake wolfSSL_BIO_do_handshake
755 #define BIO_ssl_shutdown wolfSSL_BIO_ssl_shutdown
756 #define SSL_set_bio wolfSSL_set_bio
757 #define BIO_method_type wolfSSL_BIO_method_type
758 #define BIO_set_ssl wolfSSL_BIO_set_ssl
759 #define BIO_get_ssl wolfSSL_BIO_get_ssl
760 #define BIO_new_ssl_connect wolfSSL_BIO_new_ssl_connect
761 #define BIO_set_conn_hostname wolfSSL_BIO_set_conn_hostname
762 #define BIO_eof wolfSSL_BIO_eof
763 #define BIO_set_ss wolfSSL_BIO_set_ss
764
765 #define BIO_f_md wolfSSL_BIO_f_md
766 #define BIO_get_md_ctx wolfSSL_BIO_get_md_ctx
767 #define BIO_s_mem wolfSSL_BIO_s_mem
768 #define BIO_f_base64 wolfSSL_BIO_f_base64
769 #define BIO_set_flags wolfSSL_BIO_set_flags
770 #define BIO_set_nbio wolfSSL_BIO_set_nbio
771
772 #define SSLeay_add_ssl_algorithms wolfSSL_add_all_algorithms
773 #define SSLeay_add_all_algorithms wolfSSL_add_all_algorithms
774
775 #define RAND_screen wolfSSL_RAND_screen
776 #define RAND_file_name wolfSSL_RAND_file_name
777 #define RAND_write_file wolfSSL_RAND_write_file
778 #define RAND_load_file wolfSSL_RAND_load_file
779 #define RAND_egd wolfSSL_RAND_egd
780 #define RAND_seed wolfSSL_RAND_seed
781 #define RAND_cleanup wolfSSL_RAND_Cleanup
782 #define RAND_add wolfSSL_RAND_add
783 #define RAND_poll wolfSSL_RAND_poll
784 #define RAND_status wolfSSL_RAND_status
785 #define RAND_bytes wolfSSL_RAND_bytes
786 #define RAND_pseudo_bytes wolfSSL_RAND_pseudo_bytes
787
788 #define COMP_zlib wolfSSL_COMP_zlib
789 #define COMP_rle wolfSSL_COMP_rle
790 #define SSL_COMP_add_compression_method wolfSSL_COMP_add_compression_method
791
792 #define SSL_get_ex_new_index wolfSSL_get_ex_new_index
793 #define RSA_get_ex_new_index wolfSSL_get_ex_new_index
794
795 #define ASN1_BIT_STRING_new wolfSSL_ASN1_BIT_STRING_new
796 #define ASN1_BIT_STRING_free wolfSSL_ASN1_BIT_STRING_free
797 #define ASN1_BIT_STRING_get_bit wolfSSL_ASN1_BIT_STRING_get_bit
798 #define ASN1_BIT_STRING_set_bit wolfSSL_ASN1_BIT_STRING_set_bit
799
800 #define sk_ASN1_OBJECT_free wolfSSL_sk_ASN1_OBJECT_free
801
802 #define ASN1_TIME_new wolfSSL_ASN1_TIME_new
803 #define ASN1_UTCTIME_new wolfSSL_ASN1_TIME_new
804 #define ASN1_TIME_free wolfSSL_ASN1_TIME_free
805 #define ASN1_UTCTIME_free wolfSSL_ASN1_TIME_free
806 #define ASN1_TIME_adj wolfSSL_ASN1_TIME_adj
807 #define ASN1_TIME_print wolfSSL_ASN1_TIME_print
808 #define ASN1_TIME_to_generalizedtime wolfSSL_ASN1_TIME_to_generalizedtime
809 #define ASN1_TIME_set wolfSSL_ASN1_TIME_set
810 #define ASN1_TIME_set_string wolfSSL_ASN1_TIME_set_string
811 #define ASN1_TIME_to_string wolfSSL_ASN1_TIME_to_string
812 #define ASN1_TIME_to_tm wolfSSL_ASN1_TIME_to_tm
813 #define ASN1_GENERALIZEDTIME_print wolfSSL_ASN1_GENERALIZEDTIME_print
814 #define ASN1_GENERALIZEDTIME_free wolfSSL_ASN1_GENERALIZEDTIME_free
815
816 #define ASN1_tag2str wolfSSL_ASN1_tag2str
817
818 #define a2i_ASN1_INTEGER wolfSSL_a2i_ASN1_INTEGER
819 #define i2a_ASN1_INTEGER wolfSSL_i2a_ASN1_INTEGER
820 #define i2c_ASN1_INTEGER wolfSSL_i2c_ASN1_INTEGER
821 #define ASN1_INTEGER_new wolfSSL_ASN1_INTEGER_new
822 #define ASN1_INTEGER_free wolfSSL_ASN1_INTEGER_free

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1021

823 #define ASN1_INTEGER_cmp wolfSSL_ASN1_INTEGER_cmp


824 #define ASN1_INTEGER_get wolfSSL_ASN1_INTEGER_get
825 #define ASN1_INTEGER_set wolfSSL_ASN1_INTEGER_set
826 #define ASN1_INTEGER_to_BN wolfSSL_ASN1_INTEGER_to_BN
827 #define d2i_ASN1_INTEGER wolfSSL_d2i_ASN1_INTEGER
828 #define i2d_ASN1_INTEGER wolfSSL_i2d_ASN1_INTEGER
829
830 #define i2a_ASN1_OBJECT wolfSSL_i2a_ASN1_OBJECT
831 #define i2d_ASN1_OBJECT wolfSSL_i2d_ASN1_OBJECT
832
833 #define ASN1_STRING_new wolfSSL_ASN1_STRING_new
834 #define ASN1_OCTET_STRING_new wolfSSL_ASN1_STRING_new
835 #define ASN1_STRING_free wolfSSL_ASN1_STRING_free
836 #define ASN1_STRING_cmp wolfSSL_ASN1_STRING_cmp
837 #define ASN1_OCTET_STRING_cmp wolfSSL_ASN1_STRING_cmp
838 #define ASN1_STRING_data wolfSSL_ASN1_STRING_data
839 #define ASN1_STRING_get0_data wolfSSL_ASN1_STRING_get0_data
840 #define ASN1_STRING_length wolfSSL_ASN1_STRING_length
841 #define ASN1_STRING_to_UTF8 wolfSSL_ASN1_STRING_to_UTF8
842 #define ASN1_UNIVERSALSTRING_to_string wolfSSL_ASN1_UNIVERSALSTRING_to_string
843 #define ASN1_STRING_print_ex wolfSSL_ASN1_STRING_print_ex
844 #define ASN1_STRING_print(x, y) wolfSSL_ASN1_STRING_print ((WOLFSSL_BIO*)(x),
(WOLFSSL_ASN1_STRING*)(y))
845 #define d2i_DISPLAYTEXT wolfSSL_d2i_DISPLAYTEXT
846 #ifndef NO_WOLFSSL_STUB
847 #define ASN1_STRING_set_default_mask_asc(...) 1
848 #endif
849
850 #define ASN1_OCTET_STRING WOLFSSL_ASN1_STRING
851 #define ASN1_OCTET_STRING_new wolfSSL_ASN1_STRING_new
852 #define ASN1_OCTET_STRING_free wolfSSL_ASN1_STRING_free
853 #define ASN1_OCTET_STRING_set wolfSSL_ASN1_STRING_set
854
855 #define ASN1_PRINTABLE_type(...) V_ASN1_PRINTABLESTRING
856
857 #define ASN1_UTCTIME_pr wolfSSL_ASN1_UTCTIME_pr
858
859 #define ASN1_IA5STRING WOLFSSL_ASN1_STRING
860
861 #define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
862
863 #define SSL_load_client_CA_file wolfSSL_load_client_CA_file
864
865 #define SSL_CTX_get_client_CA_list wolfSSL_CTX_get_client_CA_list
866 #define SSL_CTX_set_client_CA_list wolfSSL_CTX_set_client_CA_list
867 #define SSL_CTX_set_client_cert_cb wolfSSL_CTX_set_client_cert_cb
868 #define SSL_CTX_set_cert_store wolfSSL_CTX_set_cert_store
869 #define SSL_set0_verify_cert_store wolfSSL_set0_verify_cert_store
870 #define SSL_set1_verify_cert_store wolfSSL_set1_verify_cert_store
871 #define SSL_CTX_get_cert_store(x) wolfSSL_CTX_get_cert_store ((WOLFSSL_CTX*) (x))
872 #define SSL_get_client_CA_list wolfSSL_get_client_CA_list
873 #define SSL_set_client_CA_list wolfSSL_set_client_CA_list
874 #define SSL_get_ex_data_X509_STORE_CTX_idx wolfSSL_get_ex_data_X509_STORE_CTX_idx
875 #define SSL_get_ex_data wolfSSL_get_ex_data
876
877 #define SSL_CTX_set_default_passwd_cb_userdata wolfSSL_CTX_set_default_passwd_cb_userdata
878 #define SSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb
879
880 #define SSL_CTX_set_timeout(ctx, to) \
881 wolfSSL_CTX_set_timeout(ctx, (unsigned int)(to))
882 #define SSL_CTX_set_info_callback wolfSSL_CTX_set_info_callback
883 #define SSL_CTX_set_alpn_protos wolfSSL_CTX_set_alpn_protos
884
885 #define SSL_CTX_keylog_cb_func wolfSSL_CTX_keylog_cb_func
886 #define SSL_CTX_set_keylog_callback wolfSSL_CTX_set_keylog_callback
887 #define SSL_CTX_get_keylog_callback wolfSSL_CTX_get_keylog_callback
888
889 #define SSL_alert_type_string wolfSSL_alert_type_string
890 #define SSL_alert_desc_string wolfSSL_alert_desc_string
891 #define SSL_state_string wolfSSL_state_string
892
893 #define RSA_free wolfSSL_RSA_free
894 #define RSA_generate_key wolfSSL_RSA_generate_key
895 #define SSL_CTX_set_tmp_rsa_callback wolfSSL_CTX_set_tmp_rsa_callback
896 #define RSA_print wolfSSL_RSA_print
897 #define RSA_print_fp wolfSSL_RSA_print_fp
898 #define RSA_bits wolfSSL_RSA_bits
899 #define RSA_up_ref wolfSSL_RSA_up_ref
900 #define RSA_padding_add_PKCS1_PSS wolfSSL_RSA_padding_add_PKCS1_PSS
901 #define RSA_verify_PKCS1_PSS wolfSSL_RSA_verify_PKCS1_PSS
902
903 #define PEM_def_callback wolfSSL_PEM_def_callback
904
905 #define SSL_CTX_sess_accept wolfSSL_CTX_sess_accept
906 #define SSL_CTX_sess_connect wolfSSL_CTX_sess_connect
907 #define SSL_CTX_sess_accept_good wolfSSL_CTX_sess_accept_good
908 #define SSL_CTX_sess_connect_good wolfSSL_CTX_sess_connect_good

NetBurner, Inc.
1022 File Documentation

909 #define SSL_CTX_sess_accept_renegotiate wolfSSL_CTX_sess_accept_renegotiate


910 #define SSL_CTX_sess_connect_renegotiate wolfSSL_CTX_sess_connect_renegotiate
911 #define SSL_CTX_sess_hits wolfSSL_CTX_sess_hits
912 #define SSL_CTX_sess_cb_hits wolfSSL_CTX_sess_cb_hits
913 #define SSL_CTX_sess_cache_full wolfSSL_CTX_sess_cache_full
914 #define SSL_CTX_sess_misses wolfSSL_CTX_sess_misses
915 #define SSL_CTX_sess_timeouts wolfSSL_CTX_sess_timeouts
916 #define SSL_CTX_sess_number wolfSSL_CTX_sess_number
917 #define SSL_CTX_sess_get_cache_size wolfSSL_CTX_sess_get_cache_size
918
919
920 #define SSL_DEFAULT_CIPHER_LIST WOLFSSL_DEFAULT_CIPHER_LIST
921
922 #define SSL_CTX_set_psk_client_callback wolfSSL_CTX_set_psk_client_callback
923 #define SSL_set_psk_client_callback wolfSSL_set_psk_client_callback
924
925 #define SSL_get_psk_identity_hint wolfSSL_get_psk_identity_hint
926 #define SSL_get_psk_identity wolfSSL_get_psk_identity
927
928 #define SSL_CTX_use_psk_identity_hint wolfSSL_CTX_use_psk_identity_hint
929 #define SSL_use_psk_identity_hint wolfSSL_use_psk_identity_hint
930
931 #define SSL_CTX_set_psk_server_callback wolfSSL_CTX_set_psk_server_callback
932 #define SSL_set_psk_server_callback wolfSSL_set_psk_server_callback
933
934 /* system file ints for ERR_put_error */
935 #define SYS_F_ACCEPT WOLFSSL_SYS_ACCEPT
936 #define SYS_F_BIND WOLFSSL_SYS_BIND
937 #define SYS_F_CONNECT WOLFSSL_SYS_CONNECT
938 #define SYS_F_FOPEN WOLFSSL_SYS_FOPEN
939 #define SYS_F_FREAD WOLFSSL_SYS_FREAD
940 #define SYS_F_GETADDRINFO WOLFSSL_SYS_GETADDRINFO
941 #define SYS_F_GETSOCKOPT WOLFSSL_SYS_GETSOCKOPT
942 #define SYS_F_GETSOCKNAME WOLFSSL_SYS_GETSOCKNAME
943 #define SYS_F_OPENDIR WOLFSSL_SYS_OPENDIR
944 #define SYS_F_SETSOCKOPT WOLFSSL_SYS_SETSOCKOPT
945 #define SYS_F_SOCKET WOLFSSL_SYS_SOCKET
946 #define SYS_F_GETHOSTBYNAME WOLFSSL_SYS_GETHOSTBYNAME
947 #define SYS_F_GETNAMEINFO WOLFSSL_SYS_GETNAMEINFO
948 #define SYS_F_GETSERVBYNAME WOLFSSL_SYS_GETSERVBYNAME
949 #define SYS_F_IOCTLSOCKET WOLFSSL_SYS_IOCTLSOCKET
950 #define SYS_F_LISTEN WOLFSSL_SYS_LISTEN
951
952 #define ERR_GET_LIB wolfSSL_ERR_GET_LIB
953 #define ERR_GET_REASON wolfSSL_ERR_GET_REASON
954
955 #define ERR_put_error wolfSSL_ERR_put_error
956 #define ERR_peek_error wolfSSL_ERR_peek_error
957 #define ERR_peek_errors_fp wolfSSL_ERR_peek_errors_fp
958 #define ERR_peek_error_line_data wolfSSL_ERR_peek_error_line_data
959 #define ERR_peek_last_error wolfSSL_ERR_peek_last_error
960 #define ERR_peek_last_error_line wolfSSL_ERR_peek_last_error_line
961 #define ERR_get_error_line wolfSSL_ERR_get_error_line
962 #define ERR_get_error_line_data wolfSSL_ERR_get_error_line_data
963 #define ERR_get_error wolfSSL_ERR_get_error
964 #define ERR_print_errors_fp(file) wolfSSL_ERR_dump_errors_fp((file))
965 #define ERR_print_errors_cb wolfSSL_ERR_print_errors_cb
966 #define ERR_print_errors wolfSSL_ERR_print_errors
967 #define ERR_clear_error wolfSSL_ERR_clear_error
968 #define ERR_free_strings wolfSSL_ERR_free_strings
969 #define ERR_remove_state wolfSSL_ERR_remove_state
970 #define ERR_remove_thread_state wolfSSL_ERR_remove_thread_state
971 #define ERR_error_string wolfSSL_ERR_error_string
972 #define ERR_error_string_n wolfSSL_ERR_error_string_n
973 #define ERR_reason_error_string wolfSSL_ERR_reason_error_string
974 #define ERR_func_error_string wolfSSL_ERR_func_error_string
975 #define ERR_lib_error_string wolfSSL_ERR_lib_error_string
976 #define ERR_load_BIO_strings wolfSSL_ERR_load_BIO_strings
977
978 #ifndef WOLFCRYPT_ONLY
979 #define PEMerr(func, reason) wolfSSL_ERR_put_error(ERR_LIB_PEM, \
980 (func), (reason), __FILE__, __LINE__)
981 #else
982 #define PEMerr(func, reason) WOLFSSL_ERROR_LINE((reason), \
983 NULL, __LINE__, __FILE__, NULL)
984 #endif
985 #ifndef WOLFCRYPT_ONLY
986 #define EVPerr(func, reason) wolfSSL_ERR_put_error(ERR_LIB_EVP, \
987 (func), (reason), __FILE__, __LINE__)
988 #else
989 #define EVPerr(func, reason) WOLFSSL_ERROR_LINE((reason), \
990 NULL, __LINE__, __FILE__, NULL)
991 #endif
992
993 #define SSLv23_server_method wolfSSLv23_server_method
994 #define SSL_CTX_set_options wolfSSL_CTX_set_options
995 #define SSL_CTX_get_options wolfSSL_CTX_get_options

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1023

996 #define SSL_CTX_clear_options wolfSSL_CTX_clear_options


997
998 #define SSL_CTX_check_private_key wolfSSL_CTX_check_private_key
999 #define SSL_CTX_get0_privatekey wolfSSL_CTX_get0_privatekey
1000 #define SSL_check_private_key wolfSSL_check_private_key
1001
1002 #define SSL_CTX_set_mode wolfSSL_CTX_set_mode
1003 #define SSL_CTX_clear_mode wolfSSL_CTX_clear_mode
1004 #define SSL_CTX_get_mode wolfSSL_CTX_get_mode
1005 #define SSL_CTX_set_default_read_ahead wolfSSL_CTX_set_default_read_ahead
1006
1007 #define SSL_CTX_sess_set_cache_size wolfSSL_CTX_sess_set_cache_size
1008 #define SSL_CTX_set_default_verify_paths wolfSSL_CTX_set_default_verify_paths
1009 #define X509_get_default_cert_file_env wolfSSL_X509_get_default_cert_file_env
1010 #define X509_get_default_cert_file wolfSSL_X509_get_default_cert_file
1011 #define X509_get_default_cert_dir_env wolfSSL_X509_get_default_cert_dir_env
1012 #define X509_get_default_cert_dir wolfSSL_X509_get_default_cert_dir
1013
1014 #define SSL_CTX_set_session_id_context wolfSSL_CTX_set_session_id_context
1015 #define SSL_get_peer_certificate wolfSSL_get_peer_certificate
1016 #define SSL_get_peer_cert_chain wolfSSL_get_peer_cert_chain
1017
1018 #define SSL_want wolfSSL_want
1019 #define SSL_want_read wolfSSL_want_read
1020 #define SSL_want_write wolfSSL_want_write
1021
1022 #define BIO_prf wolfSSL_BIO_prf
1023
1024 #define sk_num wolfSSL_sk_num
1025 #define sk_ASN1_OBJECT_num wolfSSL_sk_num
1026 #define OPENSSL_sk_num wolfSSL_sk_num
1027 #define sk_value wolfSSL_sk_value
1028 #define sk_ASN1_OBJECT_value wolfSSL_sk_value
1029 #define OPENSSL_sk_value wolfSSL_sk_value
1030
1031 #define d2i_PKCS12_bio wolfSSL_d2i_PKCS12_bio
1032 #define d2i_PKCS12_fp wolfSSL_d2i_PKCS12_fp
1033 #define i2d_PKCS12_bio wolfSSL_i2d_PKCS12_bio
1034
1035 #define d2i_RSAPublicKey wolfSSL_d2i_RSAPublicKey
1036 #define d2i_RSAPrivateKey wolfSSL_d2i_RSAPrivateKey
1037 #define i2d_RSAPrivateKey wolfSSL_i2d_RSAPrivateKey
1038 #define i2d_RSAPublicKey wolfSSL_i2d_RSAPublicKey
1039
1040 #define SSL_CTX_get_ex_data wolfSSL_CTX_get_ex_data
1041 #define SSL_CTX_set_ex_data wolfSSL_CTX_set_ex_data
1042 #define SSL_CTX_sess_set_get_cb wolfSSL_CTX_sess_set_get_cb
1043 #define SSL_CTX_sess_set_new_cb wolfSSL_CTX_sess_set_new_cb
1044 #define SSL_CTX_sess_set_remove_cb wolfSSL_CTX_sess_set_remove_cb
1045
1046 #define i2d_SSL_SESSION wolfSSL_i2d_SSL_SESSION
1047 #define d2i_SSL_SESSION wolfSSL_d2i_SSL_SESSION
1048 #define SSL_SESSION_has_ticket wolfSSL_SESSION_has_ticket
1049 #define SSL_SESSION_get_ticket_lifetime_hint \
1050 wolfSSL_SESSION_get_ticket_lifetime_hint
1051 #define SSL_SESSION_set_timeout wolfSSL_SSL_SESSION_set_timeout
1052 #define SSL_SESSION_get_timeout wolfSSL_SESSION_get_timeout
1053 #define SSL_SESSION_get_time wolfSSL_SESSION_get_time
1054
1055 #define SSL_CTX_get_ex_new_index wolfSSL_CTX_get_ex_new_index
1056 #define PEM_read wolfSSL_PEM_read
1057 #define PEM_write wolfSSL_PEM_write
1058 #define PEM_get_EVP_CIPHER_INFO wolfSSL_PEM_get_EVP_CIPHER_INFO
1059 #define PEM_do_header wolfSSL_PEM_do_header
1060
1061 /*#if OPENSSL_API_COMPAT < 0x10100000L*/
1062 #define CONF_modules_free()
1063 #define ENGINE_cleanup()
1064 #define SSL_CTX_need_tmp_RSA(ctx) 0
1065 #define SSL_CTX_set_tmp_rsa(ctx,rsa) 1
1066 #define SSL_need_tmp_RSA(ssl) 0
1067 #define SSL_set_tmp_rsa(ssl,rsa) 1
1068 /*#endif*/
1069
1070 #define CONF_modules_unload(a)
1071 #define CONF_get1_default_config_file wolfSSL_CONF_get1_default_config_file
1072
1073 #define SSL_get_hit wolfSSL_session_reused
1074
1075 /* yassl had set the default to be 500 */
1076 #define SSL_get_default_timeout(ctx) 500
1077
1078 #define DTLSv1_get_timeout(ssl, timeleft) wolfSSL_DTLSv1_get_timeout((ssl),
(WOLFSSL_TIMEVAL*)(timeleft))
1079 #define DTLSv1_handle_timeout wolfSSL_DTLSv1_handle_timeout
1080 #define DTLSv1_set_initial_timeout_duration wolfSSL_DTLSv1_set_initial_timeout_duration
1081

NetBurner, Inc.
1024 File Documentation

1082 /* DTLS SRTP */


1083 #ifdef WOLFSSL_SRTP
1084 typedef WOLFSSL_SRTP_PROTECTION_PROFILE SRTP_PROTECTION_PROFILE;
1085 #endif
1086 #define SSL_CTX_set_tlsext_use_srtp wolfSSL_CTX_set_tlsext_use_srtp
1087 #define SSL_set_tlsext_use_srtp wolfSSL_set_tlsext_use_srtp
1088 #define SSL_get_selected_srtp_profile wolfSSL_get_selected_srtp_profile
1089 #define SSL_get_srtp_profiles wolfSSL_get_srtp_profiles
1090
1091 #ifndef NO_WOLFSSL_STUB
1092 #define SSL_CTX_set_current_time_cb(ssl, cb) ({ (void)(ssl); (void)(cb); })
1093 #endif
1094
1095 #define SSL_CTX_use_certificate wolfSSL_CTX_use_certificate
1096 #define SSL_CTX_add0_chain_cert wolfSSL_CTX_add0_chain_cert
1097 #define SSL_CTX_add1_chain_cert wolfSSL_CTX_add1_chain_cert
1098 #define SSL_add0_chain_cert wolfSSL_add0_chain_cert
1099 #define SSL_add1_chain_cert wolfSSL_add1_chain_cert
1100 #define SSL_CTX_use_PrivateKey wolfSSL_CTX_use_PrivateKey
1101 #define BIO_read_filename wolfSSL_BIO_read_filename
1102 #define SSL_CTX_set_verify_depth wolfSSL_CTX_set_verify_depth
1103 #define SSL_set_verify_depth wolfSSL_set_verify_depth
1104 #define SSL_get_app_data wolfSSL_get_app_data
1105 #define SSL_set_app_data wolfSSL_set_app_data
1106 #define SHA1 wolfSSL_SHA1
1107
1108 #define SSL_dup_CA_list wolfSSL_dup_CA_list
1109
1110 #define sk_X509_NAME_find wolfSSL_sk_X509_NAME_find
1111
1112 #define DHparams_dup wolfSSL_DH_dup
1113 #define PEM_read_bio_DHparams wolfSSL_PEM_read_bio_DHparams
1114 #define PEM_read_DHparams wolfSSL_PEM_read_DHparams
1115 #define PEM_read_bio_DSAparams wolfSSL_PEM_read_bio_DSAparams
1116
1117 #if defined(OPENSSL_ALL) || defined(WOLFSSL_HAPROXY)
1118 #define SSL_get_rbio wolfSSL_SSL_get_rbio
1119 #define SSL_get_wbio wolfSSL_SSL_get_wbio
1120 #define SSL_do_handshake wolfSSL_SSL_do_handshake
1121 #define SSL_get_ciphers(x) wolfSSL_get_ciphers_compat(x)
1122 #define SSL_SESSION_get_id wolfSSL_SESSION_get_id
1123 #define SSL_get_cipher_bits(s,np) \
1124 wolfSSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
1125 #define sk_SSL_CIPHER_num wolfSSL_sk_SSL_CIPHER_num
1126 #define sk_SSL_COMP_zero wolfSSL_sk_SSL_COMP_zero
1127 #define sk_SSL_CIPHER_value wolfSSL_sk_SSL_CIPHER_value
1128 #endif /* OPENSSL_ALL || WOLFSSL_HAPROXY */
1129 #define sk_SSL_CIPHER_dup wolfSSL_sk_dup
1130 #define sk_SSL_CIPHER_free wolfSSL_sk_SSL_CIPHER_free
1131 #define sk_SSL_CIPHER_find wolfSSL_sk_SSL_CIPHER_find
1132
1133 #if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
1134 || defined(WOLFSSL_NGINX)
1135 #include <wolfssl/openssl/pem.h>
1136
1137 #define SSL_CTRL_CHAIN 88
1138 #define SSL_R_SHORT_READ 10
1139 #define ERR_R_PEM_LIB 9
1140 #define SSL_CTRL_MODE 33
1141
1142 #define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83
1143
1144 #define SSL_CTX_clear_chain_certs(ctx) SSL_CTX_set0_chain(ctx,NULL)
1145 #define d2i_RSAPrivateKey_bio wolfSSL_d2i_RSAPrivateKey_bio
1146 #define SSL_CTX_use_RSAPrivateKey wolfSSL_CTX_use_RSAPrivateKey
1147 #define d2i_PrivateKey_bio wolfSSL_d2i_PrivateKey_bio
1148 #define BIO_new_bio_pair wolfSSL_BIO_new_bio_pair
1149 #define SSL_get_verify_callback wolfSSL_get_verify_callback
1150
1151 #define SSL_set_mode(ssl,op) wolfSSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
1152
1153 #define SSL_CTX_use_certificate_ASN1 wolfSSL_CTX_use_certificate_ASN1
1154 #define SSL_CTX_set0_chain(ctx,sk) \
1155 wolfSSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)(sk))
1156 #define SSL_CTX_get_app_data(ctx) wolfSSL_CTX_get_ex_data(ctx,0)
1157 #define SSL_CTX_set_app_data(ctx,arg) wolfSSL_CTX_set_ex_data(ctx,0, \
1158 (char *)(arg))
1159 #endif /* OPENSSL_ALL || WOLFSSL_ASIO || WOLFSSL_HAPROXY */
1160
1161 #define SSL_CTX_set_tmp_dh wolfSSL_CTX_set_tmp_dh
1162
1163 #define TLSEXT_STATUSTYPE_ocsp 1
1164
1165 #define TLSEXT_max_fragment_length_512 WOLFSSL_MFL_2_9
1166 #define TLSEXT_max_fragment_length_1024 WOLFSSL_MFL_2_10
1167 #define TLSEXT_max_fragment_length_2048 WOLFSSL_MFL_2_11
1168 #define TLSEXT_max_fragment_length_4096 WOLFSSL_MFL_2_12

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1025

1169
1170 #define SSL_set_options wolfSSL_set_options
1171 #define SSL_get_options wolfSSL_get_options
1172 #define SSL_clear_options wolfSSL_clear_options
1173 #define SSL_set_tmp_dh wolfSSL_set_tmp_dh
1174 #define SSL_clear_num_renegotiations wolfSSL_clear_num_renegotiations
1175 #define SSL_total_renegotiations wolfSSL_total_renegotiations
1176 #define SSL_num_renegotiations wolfSSL_num_renegotiations
1177 #define SSL_renegotiate wolfSSL_Rehandshake
1178 #define SSL_get_secure_renegotiation_support wolfSSL_SSL_get_secure_renegotiation_support
1179 #define SSL_renegotiate_pending wolfSSL_SSL_renegotiate_pending
1180 #define SSL_set_tlsext_debug_arg wolfSSL_set_tlsext_debug_arg
1181 #define SSL_set_tlsext_status_type wolfSSL_set_tlsext_status_type
1182 #define SSL_get_tlsext_status_type wolfSSL_get_tlsext_status_type
1183 #define SSL_set_tlsext_status_exts wolfSSL_set_tlsext_status_exts
1184 #define SSL_get_tlsext_status_ids wolfSSL_get_tlsext_status_ids
1185 #define SSL_set_tlsext_status_ids wolfSSL_set_tlsext_status_ids
1186 #define SSL_get_tlsext_status_ocsp_res wolfSSL_get_tlsext_status_ocsp_resp
1187 #define SSL_set_tlsext_status_ocsp_res wolfSSL_set_tlsext_status_ocsp_resp
1188 #define SSL_set_tlsext_status_ocsp_resp wolfSSL_set_tlsext_status_ocsp_resp
1189 #define SSL_get_tlsext_status_ocsp_resp wolfSSL_get_tlsext_status_ocsp_resp
1190 #define SSL_set_tlsext_max_fragment_length wolfSSL_set_tlsext_max_fragment_length
1191
1192 #define SSL_CTX_add_extra_chain_cert wolfSSL_CTX_add_extra_chain_cert
1193 #define SSL_get_read_ahead wolfSSL_get_read_ahead
1194 #define SSL_set_read_ahead wolfSSL_set_read_ahead
1195 #define SSL_CTX_get_read_ahead wolfSSL_CTX_get_read_ahead
1196 #define SSL_CTX_set_read_ahead wolfSSL_CTX_set_read_ahead
1197 #define SSL_CTX_set_tlsext_status_arg wolfSSL_CTX_set_tlsext_status_arg
1198 #define SSL_CTX_set_tlsext_opaque_prf_input_callback_arg \
1199 wolfSSL_CTX_set_tlsext_opaque_prf_input_callback_arg
1200 #define SSL_CTX_set_tlsext_max_fragment_length \
1201 wolfSSL_CTX_set_tlsext_max_fragment_length
1202 #define SSL_get_server_random wolfSSL_get_server_random
1203 #define SSL_get_server_tmp_key wolfSSL_get_server_tmp_key
1204
1205 #define SSL_CTX_set_min_proto_version wolfSSL_CTX_set_min_proto_version
1206 #define SSL_CTX_set_max_proto_version wolfSSL_CTX_set_max_proto_version
1207 #define SSL_set_min_proto_version wolfSSL_set_min_proto_version
1208 #define SSL_set_max_proto_version wolfSSL_set_max_proto_version
1209 #define SSL_CTX_get_min_proto_version wolfSSL_CTX_get_min_proto_version
1210 #define SSL_CTX_get_max_proto_version wolfSSL_CTX_get_max_proto_version
1211
1212 #define SSL_get_tlsext_status_exts wolfSSL_get_tlsext_status_exts
1213
1214 #define SSL_CTX_get_tlsext_ticket_keys wolfSSL_CTX_get_tlsext_ticket_keys
1215 #define SSL_CTX_set_tlsext_ticket_keys wolfSSL_CTX_set_tlsext_ticket_keys
1216 #define SSL_CTX_get_tlsext_status_cb wolfSSL_CTX_get_tlsext_status_cb
1217 #define SSL_CTX_set_tlsext_status_cb wolfSSL_CTX_set_tlsext_status_cb
1218 #define SSL_CTX_set_num_tickets wolfSSL_CTX_set_num_tickets
1219 #define SSL_CTX_get_num_tickets wolfSSL_CTX_get_num_tickets
1220
1221 #define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11
1222 #define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12
1223 #define SSL_CTRL_SET_TMP_DH 3
1224 #define SSL_CTRL_SET_TMP_ECDH 4
1225 #define SSL_CTRL_SET_SESS_CACHE_MODE 44
1226 #define SSL_CTRL_SET_TLSEXT_DEBUG_ARG 57
1227 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE 65
1228 #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 651
1229 #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS 66
1230 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS 67
1231 #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS 68
1232 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS 69
1233 #define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP 70
1234 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71
1235 #define SSL_CTRL_SET_GROUPS 91
1236 #define SSL_CTRL_GET_PEER_TMP_KEY 109
1237 #define SSL_CTRL_GET_SERVER_TMP_KEY SSL_CTRL_GET_PEER_TMP_KEY
1238 #define SSL_CTRL_SET_MIN_PROTO_VERSION 123
1239 #define SSL_CTRL_SET_MAX_PROTO_VERSION 124
1240 #define SSL_CTRL_GET_MIN_PROTO_VERSION 125
1241 #define SSL_CTRL_GET_MAX_PROTO_VERSION 126
1242 #define SSL_CTRL_SET_CURVES SSL_CTRL_SET_GROUPS
1243
1244 #define SSL_CTRL_EXTRA_CHAIN_CERT 14
1245 #define SSL_CTRL_OPTIONS 32
1246
1247 #define SSL_CTRL_SET_SESS_CACHE_SIZE 42
1248 #define SSL_CTRL_GET_READ_AHEAD 40
1249 #define SSL_CTRL_SET_READ_AHEAD 41
1250
1251 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB 63
1252 #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG 64
1253
1254 #define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82
1255 #define SSL_CTRL_GET_SESSION_REUSED 0

NetBurner, Inc.
1026 File Documentation

1256
1257 #define SSL_ctrl wolfSSL_ctrl
1258 #define SSL_CTX_ctrl wolfSSL_CTX_ctrl
1259 #define SSL_CTX_callback_ctrl wolfSSL_CTX_callback_ctrl
1260
1261 #define SSL3_RANDOM_SIZE 32 /* same as RAN_LEN in internal.h */
1262
1263 /* Used as message callback types */
1264 #define SSL3_RT_CHANGE_CIPHER_SPEC 20
1265 #define SSL3_RT_ALERT 21
1266 #define SSL3_RT_HANDSHAKE 22
1267 #define SSL3_RT_APPLICATION_DATA 23
1268
1269 #define OPENSSL_INIT_LOAD_SSL_STRINGS 0x00200000L
1270 #define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
1271
1272 #define TLS_ANY_VERSION 0x10000
1273 #define DTLS1_2_VERSION 0xFEFD
1274 #define DTLS_MAX_VERSION DTLS1_2_VERSION
1275
1276 /* apache and lighty use SSL_CONF_FLAG_FILE to enable conf support */
1277 #define SSL_CONF_FLAG_CMDLINE WOLFSSL_CONF_FLAG_CMDLINE
1278 #define SSL_CONF_FLAG_FILE WOLFSSL_CONF_FLAG_FILE
1279 #define SSL_CONF_FLAG_CERTIFICATE WOLFSSL_CONF_FLAG_CERTIFICATE
1280 #define SSL_CONF_FLAG_SERVER WOLFSSL_CONF_FLAG_SERVER
1281 #define SSL_CONF_FLAG_CLIENT WOLFSSL_CONF_FLAG_CLIENT
1282 #define SSL_CONF_FLAG_SHOW_ERRORS WOLFSSL_CONF_FLAG_SHOW_ERRORS
1283 #define SSL_CONF_TYPE_UNKNOWN WOLFSSL_CONF_TYPE_UNKNOWN
1284 #define SSL_CONF_TYPE_STRING WOLFSSL_CONF_TYPE_STRING
1285 #define SSL_CONF_TYPE_FILE WOLFSSL_CONF_TYPE_FILE
1286 #define SSL_CONF_TYPE_DIR WOLFSSL_CONF_TYPE_DIR
1287
1288 #if defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || defined(OPENSSL_EXTRA) \
1289 || defined(OPENSSL_ALL)
1290
1291 #define SSL23_ST_SR_CLNT_HELLO_A (0x210|0x2000)
1292 #define SSL3_ST_SR_CLNT_HELLO_A (0x110|0x2000)
1293
1294 #define SSL3_AD_BAD_CERTIFICATE bad_certificate
1295 #define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE
1296 #define SSL_AD_UNRECOGNIZED_NAME unrecognized_name
1297 #define SSL_AD_NO_RENEGOTIATION no_renegotiation
1298 #define SSL_AD_INTERNAL_ERROR 80
1299
1300 #define ASN1_STRFLGS_ESC_MSB 4
1301
1302 #define SSL_MAX_MASTER_KEY_LENGTH WOLFSSL_MAX_MASTER_KEY_LENGTH
1303
1304 #define SSL_alert_desc_string_long wolfSSL_alert_desc_string_long
1305 #define SSL_alert_type_string_long wolfSSL_alert_type_string_long
1306 #define SSL_CIPHER_get_bits wolfSSL_CIPHER_get_bits
1307 #define sk_GENERAL_NAME_num wolfSSL_sk_GENERAL_NAME_num
1308 #define SSL_CTX_get_options wolfSSL_CTX_get_options
1309
1310 #define SSL_CTX_flush_sessions wolfSSL_flush_sessions
1311 #define SSL_CTX_add_session wolfSSL_CTX_add_session
1312 #define SSL_version(x) wolfSSL_version ((WOLFSSL*) (x))
1313 #define SSL_get_state wolfSSL_get_state
1314 #define SSL_state_string_long wolfSSL_state_string_long
1315
1316 #define GENERAL_NAME_new wolfSSL_GENERAL_NAME_new
1317 #define GENERAL_NAME_free wolfSSL_GENERAL_NAME_free
1318 #define GENERAL_NAME_dup wolfSSL_GENERAL_NAME_dup
1319 #define GENERAL_NAME_print wolfSSL_GENERAL_NAME_print
1320 #define sk_GENERAL_NAME_push wolfSSL_sk_GENERAL_NAME_push
1321 #define sk_GENERAL_NAME_value wolfSSL_sk_GENERAL_NAME_value
1322
1323 #define DIST_POINT_new wolfSSL_DIST_POINT_new
1324 #define DIST_POINT_free wolfSSL_DIST_POINT_free
1325 #define DIST_POINTS_free wolfSSL_DIST_POINTS_free
1326 #define CRL_DIST_POINTS_free(cdp) wolfSSL_sk_DIST_POINT_pop_free((cdp), NULL)
1327 #define sk_DIST_POINT_push wolfSSL_sk_DIST_POINT_push
1328 #define sk_DIST_POINT_value wolfSSL_sk_DIST_POINT_value
1329 #define sk_DIST_POINT_num wolfSSL_sk_DIST_POINT_num
1330 #define sk_DIST_POINT_pop_free wolfSSL_sk_DIST_POINT_pop_free
1331 #define sk_DIST_POINT_free wolfSSL_sk_DIST_POINT_free
1332
1333 #define SSL_SESSION_get_ex_data wolfSSL_SESSION_get_ex_data
1334 #define SSL_SESSION_set_ex_data wolfSSL_SESSION_set_ex_data
1335 #define SSL_SESSION_get_ex_new_index wolfSSL_SESSION_get_ex_new_index
1336 #define SSL_SESSION_get_id wolfSSL_SESSION_get_id
1337 #define SSL_SESSION_print wolfSSL_SESSION_print
1338 #define sk_GENERAL_NAME_pop_free wolfSSL_sk_GENERAL_NAME_pop_free
1339 #define sk_GENERAL_NAME_free wolfSSL_sk_GENERAL_NAME_free
1340 #define sk_ASN1_OBJECT_pop_free wolfSSL_sk_ASN1_OBJECT_pop_free
1341 #define GENERAL_NAME_free wolfSSL_GENERAL_NAME_free
1342 #define GENERAL_NAMES_free wolfSSL_GENERAL_NAMES_free

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1027

1343
1344 #define AUTHORITY_INFO_ACCESS_free wolfSSL_AUTHORITY_INFO_ACCESS_free
1345 #define AUTHORITY_INFO_ACCESS_pop_free wolfSSL_AUTHORITY_INFO_ACCESS_pop_free
1346 #define sk_ACCESS_DESCRIPTION_pop_free wolfSSL_sk_ACCESS_DESCRIPTION_pop_free
1347 #define sk_ACCESS_DESCRIPTION_free wolfSSL_sk_ACCESS_DESCRIPTION_free
1348 #define ACCESS_DESCRIPTION_free wolfSSL_ACCESS_DESCRIPTION_free
1349
1350 /* Alert types, matched to AlertDescription enum in wolfssl/ssl.h */
1351 #define SSL_AD_CLOSE_NOTIFY close_notify
1352 #define SSL_AD_UNEXPECTED_MESSAGE unexpected_message
1353 #define SSL_AD_BAD_RECORD_MAC bad_record_mac
1354 #define SSL_AD_RECORD_OVERFLOW record_overflow
1355 #define SSL_AD_DECOMPRESSION_FAILURE decompression_failure
1356 #define SSL_AD_HANDSHAKE_FAILURE handshake_failure
1357 #define SSL_AD_UNSUPPORTED_CERTIFICATE unsupported_certificate
1358 #define SSL_AD_CERTIFICATE_REVOKED certificate_revoked
1359 #define SSL_AD_CERTIFICATE_EXPIRED certificate_expired
1360 #define SSL_AD_CERTIFICATE_UNKNOWN certificate_unknown
1361 #define SSL_AD_ILLEGAL_PARAMETER illegal_parameter
1362 #define SSL_AD_UNKNOWN_CA unknown_ca
1363 #define SSL_AD_ACCESS_DENIED access_denied
1364 #define SSL_AD_DECODE_ERROR decode_error
1365 #define SSL_AD_DECRYPT_ERROR decrypt_error
1366 #ifdef WOLFSSL_MYSQL_COMPATIBLE
1367 #define SSL_AD_PROTOCOL_VERSION wc_protocol_version
1368 #else
1369 #define SSL_AD_PROTOCOL_VERSION protocol_version
1370 #endif
1371 #define SSL_AD_INSUFFICIENT_SECURITY insufficient_security
1372 #define SSL_AD_USER_CANCELLED user_canceled
1373
1374 #define SSL3_AL_FATAL 2
1375 #define SSL_TLSEXT_ERR_OK 0
1376 #define SSL_TLSEXT_ERR_ALERT_WARNING warning_return
1377 #define SSL_TLSEXT_ERR_ALERT_FATAL fatal_return
1378 #define SSL_TLSEXT_ERR_NOACK noack_return
1379 #define TLSEXT_NAMETYPE_host_name WOLFSSL_SNI_HOST_NAME
1380
1381 #define SSL_set_tlsext_host_name wolfSSL_set_tlsext_host_name
1382 #define SSL_get_servername wolfSSL_get_servername
1383 #define SSL_set_SSL_CTX wolfSSL_set_SSL_CTX
1384 #define SSL_CTX_get_verify_callback wolfSSL_CTX_get_verify_callback
1385 #define SSL_CTX_set_tlsext_servername_callback wolfSSL_CTX_set_tlsext_servername_callback
1386 #define SSL_CTX_set_tlsext_servername_arg wolfSSL_CTX_set_servername_arg
1387
1388 #define PSK_MAX_PSK_LEN 256
1389 #define PSK_MAX_IDENTITY_LEN 128
1390 #define SSL_CTX_clear_options wolfSSL_CTX_clear_options
1391
1392 #define SSL_CTX_add_server_custom_ext(...) 0
1393
1394 #define SSL_get0_verified_chain wolfSSL_get0_verified_chain
1395 #define X509_chain_up_ref wolfSSL_X509_chain_up_ref
1396
1397 #endif /* HAVE_STUNNEL || WOLFSSL_NGINX */
1398
1399 #ifndef NO_WOLFSSL_STUB
1400 #define b2i_PrivateKey_bio(...) NULL
1401 #define b2i_PVK_bio(...) NULL
1402 #endif
1403
1404 #define SSL_CTX_get_default_passwd_cb wolfSSL_CTX_get_default_passwd_cb
1405 #define SSL_CTX_get_default_passwd_cb_userdata wolfSSL_CTX_get_default_passwd_cb_userdata
1406
1407 #define SSL_CTX_set_msg_callback wolfSSL_CTX_set_msg_callback
1408 #define SSL_set_msg_callback wolfSSL_set_msg_callback
1409 #define SSL_CTX_set_msg_callback_arg wolfSSL_CTX_set_msg_callback_arg
1410 #define SSL_set_msg_callback_arg wolfSSL_set_msg_callback_arg
1411
1412 #define SSL_CTX_clear_extra_chain_certs wolfSSL_CTX_clear_extra_chain_certs
1413
1414 #define SSL_certs_clear wolfSSL_certs_clear
1415
1416 /* Nginx uses this to determine if reached end of certs in file.
1417 * PEM_read_bio_X509 is called and the return error is lost.
1418 * The error that needs to be detected is: SSL_NO_PEM_HEADER.
1419 */
1420 #define ERR_GET_FUNC(l) (int)((((unsigned long)(l)) » 12L) & 0xfffL)
1421
1422 #define PEM_F_PEM_DEF_CALLBACK 100
1423
1424 /* Avoid wolfSSL error code range */
1425 #define PEM_R_NO_START_LINE (-MIN_CODE_E + 1)
1426 #define PEM_R_PROBLEMS_GETTING_PASSWORD (-MIN_CODE_E + 2)
1427 #define PEM_R_BAD_PASSWORD_READ (-MIN_CODE_E + 3)
1428 #define PEM_R_BAD_DECRYPT (-MIN_CODE_E + 4)
1429 #define ASN1_R_HEADER_TOO_LONG (-MIN_CODE_E + 5)

NetBurner, Inc.
1028 File Documentation

1430
1431 #define ERR_LIB_RSA 4
1432 #define ERR_LIB_EC 16
1433 #define ERR_LIB_SSL 20
1434 #define ERR_LIB_PKCS12 35
1435 #define ERR_LIB_PEM 9
1436 #define ERR_LIB_X509 10
1437 #define ERR_LIB_EVP 11
1438 #define ERR_LIB_ASN1 12
1439 #define ERR_LIB_DIGEST 13
1440 #define ERR_LIB_CIPHER 14
1441 #define ERR_LIB_USER 15
1442
1443 #if defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
1444 defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(OPENSSL_EXTRA) || \
1445 defined(HAVE_LIGHTY) || defined(HAVE_STUNNEL) || \
1446 defined(WOLFSSL_WPAS_SMALL)
1447
1448 #include <wolfssl/error-ssl.h>
1449
1450 #define OPENSSL_STRING WOLFSSL_STRING
1451 #define OPENSSL_CSTRING WOLFSSL_STRING
1452
1453 #define TLSEXT_TYPE_application_layer_protocol_negotiation 16
1454
1455 #define OPENSSL_NPN_UNSUPPORTED 0
1456 #define OPENSSL_NPN_NEGOTIATED 1
1457 #define OPENSSL_NPN_NO_OVERLAP 2
1458
1459 /* Nginx checks these to see if the error was a handshake error. */
1460 #define SSL_R_BAD_CHANGE_CIPHER_SPEC LENGTH_ERROR
1461 #define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG BUFFER_E
1462 #define SSL_R_DIGEST_CHECK_FAILED VERIFY_MAC_ERROR
1463 #define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST SUITES_ERROR
1464 #define SSL_R_EXCESSIVE_MESSAGE_SIZE BUFFER_ERROR
1465 #define SSL_R_LENGTH_MISMATCH LENGTH_ERROR
1466 #define SSL_R_NO_CIPHERS_SPECIFIED SUITES_ERROR
1467 #define SSL_R_NO_COMPRESSION_SPECIFIED COMPRESSION_ERROR
1468 #define SSL_R_NO_SHARED_CIPHER MATCH_SUITE_ERROR
1469 #define SSL_R_RECORD_LENGTH_MISMATCH HANDSHAKE_SIZE_ERROR
1470 #define SSL_R_UNEXPECTED_MESSAGE OUT_OF_ORDER_E
1471 #define SSL_R_UNEXPECTED_RECORD SANITY_MSG_E
1472 #define SSL_R_UNKNOWN_ALERT_TYPE BUFFER_ERROR
1473 #define SSL_R_UNKNOWN_PROTOCOL VERSION_ERROR
1474 #define SSL_R_WRONG_VERSION_NUMBER VERSION_ERROR
1475 #define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC ENCRYPT_ERROR
1476 #define SSL_R_HTTPS_PROXY_REQUEST PARSE_ERROR
1477 #define SSL_R_HTTP_REQUEST PARSE_ERROR
1478 #define SSL_R_UNSUPPORTED_PROTOCOL VERSION_ERROR
1479 #define SSL_R_CERTIFICATE_VERIFY_FAILED VERIFY_CERT_ERROR
1480 #define SSL_R_CERT_CB_ERROR CLIENT_CERT_CB_ERROR
1481 #define SSL_R_NULL_SSL_METHOD_PASSED BAD_FUNC_ARG
1482
1483
1484 #ifdef HAVE_SESSION_TICKET
1485 #define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72
1486 #endif
1487
1488 /* Some openssl consumers try to detect these options with ifdef, defining
1489 * here since we use an enum internally instead */
1490 #define SSL_OP_SINGLE_DH_USE WOLFSSL_OP_SINGLE_DH_USE
1491 #define SSL_OP_SINGLE_ECDH_USE WOLFSSL_OP_SINGLE_ECDH_USE
1492 #define SSL_OP_CIPHER_SERVER_PREFERENCE WOLFSSL_OP_CIPHER_SERVER_PREFERENCE
1493
1494 #define OPENSSL_config wolfSSL_OPENSSL_config
1495 #define OPENSSL_memdup wolfSSL_OPENSSL_memdup
1496 #define OPENSSL_cleanse wolfSSL_OPENSSL_cleanse
1497 #define SSL_CTX_get_timeout wolfSSL_SSL_CTX_get_timeout
1498 #define SSL_CTX_set_tmp_ecdh wolfSSL_SSL_CTX_set_tmp_ecdh
1499 #define SSL_CTX_remove_session wolfSSL_SSL_CTX_remove_session
1500 #define SSL_get_rbio wolfSSL_SSL_get_rbio
1501 #define SSL_get_wbio wolfSSL_SSL_get_wbio
1502 #define SSL_do_handshake wolfSSL_SSL_do_handshake
1503 #define SSL_in_init wolfSSL_SSL_in_init
1504 #define SSL_in_connect_init wolfSSL_SSL_in_connect_init
1505 #define SSL_get0_session wolfSSL_SSL_get0_session
1506 #define SSL_CTX_set_tlsext_ticket_key_cb wolfSSL_CTX_set_tlsext_ticket_key_cb
1507 #define SSL_CTX_set_tlsext_status_cb wolfSSL_CTX_set_tlsext_status_cb
1508 #define SSL_CTX_get_extra_chain_certs wolfSSL_CTX_get_extra_chain_certs
1509 #define SSL_CTX_get0_chain_certs wolfSSL_CTX_get0_chain_certs
1510 #define SSL_get0_chain_certs wolfSSL_get0_chain_certs
1511 #define sk_OPENSSL_STRING_num wolfSSL_sk_WOLFSSL_STRING_num
1512 #define sk_OPENSSL_STRING_value wolfSSL_sk_WOLFSSL_STRING_value
1513 #define sk_OPENSSL_PSTRING_num wolfSSL_sk_WOLFSSL_STRING_num
1514 #define sk_OPENSSL_PSTRING_value (WOLFSSL_STRING*)wolfSSL_sk_WOLFSSL_STRING_value
1515 #define sk_OPENSSL_STRING_free wolfSSL_sk_free
1516 #define SSL_get0_alpn_selected wolfSSL_get0_alpn_selected

NetBurner, Inc.
22.197 wolfssl/openssl/ssl.h 1029

1517 #define SSL_select_next_proto wolfSSL_select_next_proto


1518 #define SSL_CTX_set_alpn_select_cb wolfSSL_CTX_set_alpn_select_cb
1519 #define SSL_CTX_set_next_protos_advertised_cb wolfSSL_CTX_set_next_protos_advertised_cb
1520 #define SSL_CTX_set_next_proto_select_cb wolfSSL_CTX_set_next_proto_select_cb
1521 #define SSL_set_alpn_protos wolfSSL_set_alpn_protos
1522 #define SSL_get0_next_proto_negotiated wolfSSL_get0_next_proto_negotiated
1523 #define SSL_is_server wolfSSL_is_server
1524
1525 #endif /* WOLFSSL_NGINX || WOLFSSL_HAPROXY || WOLFSSL_MYSQL_COMPATIBLE ||
1526 OPENSSL_ALL || HAVE_LIGHTY */
1527
1528 #if defined(OPENSSL_EXTRA) && defined(HAVE_ECC)
1529 #define SSL_CTX_set1_curves_list wolfSSL_CTX_set1_curves_list
1530 #define SSL_set1_curves_list wolfSSL_set1_curves_list
1531 #endif
1532
1533 #ifdef OPENSSL_EXTRA
1534 #define SSL_CTX_add_client_CA wolfSSL_CTX_add_client_CA
1535 #define SSL_CTX_set_srp_password wolfSSL_CTX_set_srp_password
1536 #define SSL_CTX_set_srp_username wolfSSL_CTX_set_srp_username
1537 #define SSL_CTX_set_srp_strength wolfSSL_CTX_set_srp_strength
1538 #define SSL_get_SSL_CTX wolfSSL_get_SSL_CTX
1539 #define SSL_get0_param wolfSSL_get0_param
1540 #define SSL_CTX_get0_param wolfSSL_CTX_get0_param
1541 #define SSL_CTX_set1_param wolfSSL_CTX_set1_param
1542 #define SSL_get_srp_username wolfSSL_get_srp_username
1543
1544 #define ERR_NUM_ERRORS 16
1545 #define SN_pkcs9_emailAddress "Email"
1546 #define LN_pkcs9_emailAddress "emailAddress"
1547 #define NID_pkcs9_emailAddress 48
1548 #define OBJ_pkcs9_emailAddress 1L,2L,840L,113539L,1L,9L,1L
1549
1550 #define LN_basic_constraints "X509v3 Basic Constraints"
1551 #define LN_key_usage "X509v3 Key Usage"
1552 #define LN_subject_key_identifier "X509v3 Subject Key Identifier"
1553 #define LN_ext_key_usage "X509v3 Extended Key Usage"
1554
1555 #define SSL_get_rbio wolfSSL_SSL_get_rbio
1556 #define SSL_get_wbio wolfSSL_SSL_get_wbio
1557 #define SSL_do_handshake wolfSSL_SSL_do_handshake
1558
1559 #if defined(WOLFSSL_EARLY_DATA)
1560 #define SSL_EARLY_DATA_NOT_SENT WOLFSSL_EARLY_DATA_NOT_SENT
1561 #define SSL_EARLY_DATA_REJECTED WOLFSSL_EARLY_DATA_REJECTED
1562 #define SSL_EARLY_DATA_ACCEPTED WOLFSSL_EARLY_DATA_ACCEPTED
1563
1564 #define SSL_get_early_data_status wolfSSL_get_early_data_status
1565 #define SSL_set_max_early_data wolfSSL_set_max_early_data
1566 #define SSL_get_max_early_data wolfSSL_get_max_early_data
1567 #define SSL_CTX_set_max_early_data wolfSSL_CTX_set_max_early_data
1568 #define SSL_CTX_get_max_early_data wolfSSL_CTX_get_max_early_data
1569 #endif
1570
1571 #endif /* OPENSSL_EXTRA */
1572
1573 /* cipher suites for compatibility */
1574 #define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013)
1575 #define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)
1576 #define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)
1577 #define TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca8)
1578 #define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009)
1579 #define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)
1580 #define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)
1581 #define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca9)
1582
1583 #define X509_LU_NONE WOLFSSL_X509_LU_NONE
1584 #define X509_LU_X509 WOLFSSL_X509_LU_X509
1585 #define X509_LU_CRL WOLFSSL_X509_LU_CRL
1586
1587 #define X509_STORE_get0_objects wolfSSL_X509_STORE_get0_objects
1588 #define sk_X509_OBJECT_num wolfSSL_sk_X509_OBJECT_num
1589 #define sk_X509_OBJECT_value wolfSSL_sk_X509_OBJECT_value
1590 #define sk_X509_OBJECT_delete wolfSSL_sk_X509_OBJECT_delete
1591 #define X509_OBJECT_new wolfSSL_X509_OBJECT_new
1592 #define X509_OBJECT_free wolfSSL_X509_OBJECT_free
1593 #define X509_OBJECT_get_type wolfSSL_X509_OBJECT_get_type
1594 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
1595 #define OpenSSL_version(x) wolfSSL_OpenSSL_version(x)
1596 #else
1597 #define OpenSSL_version(x) wolfSSL_OpenSSL_version()
1598 #endif
1599
1600 #ifndef NO_WOLFSSL_STUB
1601 #define OBJ_create_objects(...)
1602 #define sk_SSL_COMP_free(...)
1603 #endif

NetBurner, Inc.
1030 File Documentation

1604
1605 #define OBJ_dup wolfSSL_ASN1_OBJECT_dup
1606
1607 #define SSL_set_psk_use_session_callback wolfSSL_set_psk_use_session_callback
1608 #define SSL_SESSION_is_resumable wolfSSL_SESSION_is_resumable
1609 typedef WOLFSSL_CONF_CTX SSL_CONF_CTX;
1610
1611 #define SSL_CONF_CTX_new wolfSSL_CONF_CTX_new
1612 #define SSL_CONF_CTX_free wolfSSL_CONF_CTX_free
1613 #define SSL_CONF_CTX_set_ssl_ctx wolfSSL_CONF_CTX_set_ssl_ctx
1614 #define SSL_CONF_CTX_set_flags wolfSSL_CONF_CTX_set_flags
1615 #define SSL_CONF_CTX_finish wolfSSL_CONF_CTX_finish
1616 #define SSL_CONF_cmd wolfSSL_CONF_cmd
1617 #define SSL_CONF_cmd_value_type wolfSSL_CONF_cmd_value_type
1618
1619 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
1620
1621 #ifdef __cplusplus
1622 } /* extern "C" */
1623 #endif
1624
1625 #endif /* !WOLFSSL_OPENSSL_H_ */

22.198 ssl.h File Reference


Header file containing key wolfSSL API.
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/version.h>
#include <wolfssl/wolfcrypt/asn_public.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#include <wolfssl/wolfcrypt/logging.h>
#include <wolfssl/wolfcrypt/memory.h>
#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/openssl/compat_types.h>
#include <wolfssl/callbacks.h>
#include <wolfssl/wolfio.h>
#include <stdio.h>
#include <stdarg.h>
#include <sys/uio.h>

22.198.1 Detailed Description


Header file containing key wolfSSL API.

22.199 wolfssl/ssl.h
Go to the documentation of this file.
1 /* ssl.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
16 /* wolfSSL API */
17
18 #ifndef WOLFSSL_SSL_H
19 #define WOLFSSL_SSL_H
20
21
22 /* for users not using preprocessor flags*/
23 #include <wolfssl/wolfcrypt/settings.h>
24 #include <wolfssl/version.h>
25 #include <wolfssl/wolfcrypt/asn_public.h>
26 #include <wolfssl/wolfcrypt/error-crypt.h>
27 #include <wolfssl/wolfcrypt/logging.h>
28 #include <wolfssl/wolfcrypt/memory.h>
29 #include <wolfssl/wolfcrypt/types.h>

NetBurner, Inc.
22.199 wolfssl/ssl.h 1031

30
31 /* For the types */
32 #include <wolfssl/openssl/compat_types.h>
33
34 #ifdef HAVE_WOLF_EVENT
35 #include <wolfssl/wolfcrypt/wolfevent.h>
36 #endif
37
38 #ifdef WOLF_CRYPTO_CB
39 #include <wolfssl/wolfcrypt/cryptocb.h>
40 #endif
41
42 /* used internally by wolfSSL while OpenSSL types aren’t */
43 #include <wolfssl/callbacks.h>
44
45 #ifdef WOLFSSL_PREFIX
46 #include "prefix_ssl.h"
47 #endif
48
49 #ifdef LIBWOLFSSL_VERSION_STRING
50 #define WOLFSSL_VERSION LIBWOLFSSL_VERSION_STRING
51 #endif
52
53 #ifdef _WIN32
54 /* wincrypt.h clashes */
55 #undef OCSP_REQUEST
56 #undef OCSP_RESPONSE
57 #endif
58
59 #ifdef OPENSSL_COEXIST
60 /* mode to allow wolfSSL and OpenSSL to exist together */
61 #ifdef TEST_OPENSSL_COEXIST
62 /*
63 ./configure --enable-opensslcoexist \
64 CFLAGS="-I/usr/local/opt/openssl/include -DTEST_OPENSSL_COEXIST" \
65 LDFLAGS="-L/usr/local/opt/openssl/lib -lcrypto"
66 */
67 #include <openssl/ssl.h>
68 #include <openssl/rand.h>
69 #include <openssl/err.h>
70 #include <openssl/ec.h>
71 #include <openssl/hmac.h>
72 #include <openssl/bn.h>
73 #include <openssl/crypto.h>
74 #endif
75
76 #elif (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
77 #include <wolfssl/openssl/bn.h>
78 #include <wolfssl/openssl/rsa.h>
79 #ifndef WOLFCRYPT_ONLY
80 #include <wolfssl/openssl/hmac.h>
81 #endif
82
83 /* We need the old SSL names */
84 #ifdef NO_OLD_SSL_NAMES
85 #undef NO_OLD_SSL_NAMES
86 #endif
87 #ifdef NO_OLD_WC_NAMES
88 #undef NO_OLD_WC_NAMES
89 #endif
90 #endif
91
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95
96
97 #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL)
98 #ifndef WOLFSSL_LOCAL_X509_STORE
99 #define WOLFSSL_LOCAL_X509_STORE
100 #endif
101 #endif
102
103 /* LHASH is implemented as a stack */
104 typedef struct WOLFSSL_STACK WOLFSSL_LHASH;
105 #ifndef WOLF_LHASH_OF
106 #define WOLF_LHASH_OF(x) WOLFSSL_LHASH
107 #endif
108
109 #ifndef WOLF_STACK_OF
110 #define WOLF_STACK_OF(x) WOLFSSL_STACK
111 #endif
112 #ifndef DECLARE_STACK_OF
113 #define DECLARE_STACK_OF(x) WOLF_STACK_OF(x);
114 #endif
115
116 #ifndef WOLFSSL_WOLFSSL_TYPE_DEFINED

NetBurner, Inc.
1032 File Documentation

117 #define WOLFSSL_WOLFSSL_TYPE_DEFINED


118 typedef struct WOLFSSL WOLFSSL;
119 #endif
120 typedef struct WOLFSSL_SESSION WOLFSSL_SESSION;
121 typedef struct WOLFSSL_METHOD WOLFSSL_METHOD;
122 #ifndef WOLFSSL_WOLFSSL_CTX_TYPE_DEFINED
123 #define WOLFSSL_WOLFSSL_CTX_TYPE_DEFINED
124 typedef struct WOLFSSL_CTX WOLFSSL_CTX;
125 #endif
126
127 typedef struct WOLFSSL_STACK WOLFSSL_STACK;
128 typedef struct WOLFSSL_X509 WOLFSSL_X509;
129 typedef struct WOLFSSL_X509_NAME WOLFSSL_X509_NAME;
130 typedef struct WOLFSSL_X509_NAME_ENTRY WOLFSSL_X509_NAME_ENTRY;
131 typedef struct WOLFSSL_X509_PUBKEY WOLFSSL_X509_PUBKEY;
132 typedef struct WOLFSSL_X509_ALGOR WOLFSSL_X509_ALGOR;
133 typedef struct WOLFSSL_X509_CHAIN WOLFSSL_X509_CHAIN;
134 typedef struct WC_PKCS12 WOLFSSL_X509_PKCS12;
135 typedef struct WOLFSSL_X509_INFO WOLFSSL_X509_INFO;
136
137 typedef struct WOLFSSL_CERT_MANAGER WOLFSSL_CERT_MANAGER;
138 typedef struct WOLFSSL_SOCKADDR WOLFSSL_SOCKADDR;
139 typedef struct WOLFSSL_CRL WOLFSSL_CRL;
140 typedef struct WOLFSSL_X509_STORE_CTX WOLFSSL_X509_STORE_CTX;
141
142 typedef int (*WOLFSSL_X509_STORE_CTX_verify_cb)(int, WOLFSSL_X509_STORE_CTX *);
143
144 typedef struct WOLFSSL_BY_DIR_HASH WOLFSSL_BY_DIR_HASH;
145 typedef struct WOLFSSL_BY_DIR_entry WOLFSSL_BY_DIR_entry;
146 typedef struct WOLFSSL_BY_DIR WOLFSSL_BY_DIR;
147
148 /* redeclare guard */
149 #define WOLFSSL_TYPES_DEFINED
150
151 #include <wolfssl/wolfio.h>
152
153
154 #ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */
155 typedef struct WOLFSSL_RSA WOLFSSL_RSA;
156 #define WOLFSSL_RSA_TYPE_DEFINED
157 #endif
158
159 #ifndef WC_RNG_TYPE_DEFINED /* guard on redeclaration */
160 typedef struct WC_RNG WC_RNG;
161 #define WC_RNG_TYPE_DEFINED
162 #endif
163
164 #ifndef WOLFSSL_DSA_TYPE_DEFINED /* guard on redeclaration */
165 typedef struct WOLFSSL_DSA WOLFSSL_DSA;
166 #define WOLFSSL_DSA_TYPE_DEFINED
167 #endif
168
169 #ifndef WOLFSSL_EC_TYPE_DEFINED /* guard on redeclaration */
170 typedef struct WOLFSSL_EC_KEY WOLFSSL_EC_KEY;
171 typedef struct WOLFSSL_EC_POINT WOLFSSL_EC_POINT;
172 typedef struct WOLFSSL_EC_GROUP WOLFSSL_EC_GROUP;
173 typedef struct WOLFSSL_EC_BUILTIN_CURVE WOLFSSL_EC_BUILTIN_CURVE;
174 /* WOLFSSL_EC_METHOD is just an alias of WOLFSSL_EC_GROUP for now */
175 typedef struct WOLFSSL_EC_GROUP WOLFSSL_EC_METHOD;
176 #define WOLFSSL_EC_TYPE_DEFINED
177 #endif
178
179 #ifndef WOLFSSL_ECDSA_TYPE_DEFINED /* guard on redeclaration */
180 typedef struct WOLFSSL_ECDSA_SIG WOLFSSL_ECDSA_SIG;
181 #define WOLFSSL_ECDSA_TYPE_DEFINED
182 #endif
183
184 typedef struct WOLFSSL_CIPHER WOLFSSL_CIPHER;
185 typedef struct WOLFSSL_X509_LOOKUP WOLFSSL_X509_LOOKUP;
186 typedef struct WOLFSSL_X509_LOOKUP_METHOD WOLFSSL_X509_LOOKUP_METHOD;
187 typedef struct WOLFSSL_CRL WOLFSSL_X509_CRL;
188 typedef struct WOLFSSL_X509_STORE WOLFSSL_X509_STORE;
189 typedef struct WOLFSSL_X509_VERIFY_PARAM WOLFSSL_X509_VERIFY_PARAM;
190 typedef struct WOLFSSL_BIO WOLFSSL_BIO;
191 typedef struct WOLFSSL_BIO_METHOD WOLFSSL_BIO_METHOD;
192 typedef struct WOLFSSL_X509_EXTENSION WOLFSSL_X509_EXTENSION;
193 typedef struct WOLFSSL_ASN1_OBJECT WOLFSSL_ASN1_OBJECT;
194 typedef struct WOLFSSL_ASN1_OTHERNAME WOLFSSL_ASN1_OTHERNAME;
195 typedef struct WOLFSSL_X509V3_CTX WOLFSSL_X509V3_CTX;
196 typedef struct WOLFSSL_v3_ext_method WOLFSSL_v3_ext_method;
197 typedef struct WOLFSSL_OBJ_NAME WOLFSSL_OBJ_NAME;
198
199 typedef struct WOLFSSL_ASN1_STRING WOLFSSL_ASN1_STRING;
200 typedef struct WOLFSSL_dynlock_value WOLFSSL_dynlock_value;
201 #ifndef WOLFSSL_DH_TYPE_DEFINED /* guard on redeclaration */
202 typedef struct WOLFSSL_DH WOLFSSL_DH;
203 #define WOLFSSL_DH_TYPE_DEFINED /* guard on redeclaration */

NetBurner, Inc.
22.199 wolfssl/ssl.h 1033

204 #endif
205 typedef struct WOLFSSL_ASN1_BIT_STRING WOLFSSL_ASN1_BIT_STRING;
206 typedef struct WOLFSSL_ASN1_TYPE WOLFSSL_ASN1_TYPE;
207 typedef struct WOLFSSL_X509_ATTRIBUTE WOLFSSL_X509_ATTRIBUTE;
208
209 typedef struct WOLFSSL_GENERAL_NAME WOLFSSL_GENERAL_NAME;
210 typedef struct WOLFSSL_AUTHORITY_KEYID WOLFSSL_AUTHORITY_KEYID;
211 typedef struct WOLFSSL_BASIC_CONSTRAINTS WOLFSSL_BASIC_CONSTRAINTS;
212 typedef struct WOLFSSL_ACCESS_DESCRIPTION WOLFSSL_ACCESS_DESCRIPTION;
213 typedef struct WOLFSSL_DIST_POINT_NAME WOLFSSL_DIST_POINT_NAME;
214 typedef struct WOLFSSL_DIST_POINT WOLFSSL_DIST_POINT;
215
216 typedef struct WOLFSSL_CONF_CTX WOLFSSL_CONF_CTX;
217
218 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
219
220 struct WOLFSSL_OBJ_NAME {
221 int type;
222 };
223
224 struct WOLFSSL_AUTHORITY_KEYID {
225 WOLFSSL_ASN1_STRING *keyid;
226 WOLFSSL_ASN1_OBJECT *issuer;
227 WOLFSSL_ASN1_INTEGER *serial;
228 };
229
230 struct WOLFSSL_BASIC_CONSTRAINTS {
231 int ca;
232 WOLFSSL_ASN1_INTEGER *pathlen;
233 };
234
235 #endif /* OPENSSL_ALL || OPENSSL_EXTRA*/
236
237 #define WOLFSSL_ASN1_UTCTIME WOLFSSL_ASN1_TIME
238 #define WOLFSSL_ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TIME
239
240 struct WOLFSSL_ASN1_STRING {
241 char strData[CTC_NAME_SIZE];
242 int length;
243 int type; /* type of string i.e. CTC_UTF8 */
244 int nid;
245 char* data;
246 long flags;
247 unsigned int isDynamic:1; /* flag for if data pointer dynamic (1 is yes 0 is no) */
248 };
249
250 #define WOLFSSL_MAX_SNAME 40
251
252
253 #define WOLFSSL_ASN1_DYNAMIC 0x1
254 #define WOLFSSL_ASN1_DYNAMIC_DATA 0x2
255
256 struct WOLFSSL_ASN1_OTHERNAME {
257 WOLFSSL_ASN1_OBJECT* type_id;
258 WOLFSSL_ASN1_TYPE* value;
259 };
260
261 struct WOLFSSL_GENERAL_NAME {
262 int type;
263 union {
264 char* ptr;
265 WOLFSSL_ASN1_OTHERNAME* otherName;
266 WOLFSSL_ASN1_STRING* rfc822Name;
267 WOLFSSL_ASN1_STRING* dNSName;
268 WOLFSSL_ASN1_TYPE* x400Address;
269 WOLFSSL_X509_NAME* directoryName;
270 WOLFSSL_ASN1_STRING* uniformResourceIdentifier;
271 WOLFSSL_ASN1_STRING* iPAddress;
272 WOLFSSL_ASN1_OBJECT* registeredID;
273
274 WOLFSSL_ASN1_STRING* ip;
275 WOLFSSL_X509_NAME* dirn;
276 WOLFSSL_ASN1_STRING* ia5;
277 WOLFSSL_ASN1_OBJECT* rid;
278 WOLFSSL_ASN1_TYPE* other;
279 } d; /* dereference */
280 };
281
282 struct WOLFSSL_DIST_POINT_NAME {
283 int type;
284
285 /* name ’name.fullname’ needs to remain the same, in some ports the elements
286 * of the structure are accessed directly */
287 union {
288 WOLF_STACK_OF(WOLFSSL_GENERAL_NAME)* fullname;
289 } name;
290 };

NetBurner, Inc.
1034 File Documentation

291
292 struct WOLFSSL_DIST_POINT {
293 /* name ’distpoint’ needs to remain the same, in some ports the elements of
294 * the structure are accessed directly */
295 WOLFSSL_DIST_POINT_NAME* distpoint;
296 };
297
298 struct WOLFSSL_ACCESS_DESCRIPTION {
299 WOLFSSL_ASN1_OBJECT* method;
300 WOLFSSL_GENERAL_NAME* location;
301 };
302
303 struct WOLFSSL_X509V3_CTX {
304 WOLFSSL_X509* x509;
305 };
306
307 struct WOLFSSL_ASN1_OBJECT {
308 void* heap;
309 const unsigned char* obj;
310 /* sName is short name i.e sha256 rather than oid (null terminated) */
311 char sName[WOLFSSL_MAX_SNAME];
312 int type; /* oid */
313 int grp; /* type of OID, i.e. oidCertPolicyType */
314 int nid;
315 unsigned int objSz;
316 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL) || defined(WOLFSSL_QT) || \
317 defined(WOLFSSL_APACHE_HTTPD)
318 int ca;
319 WOLFSSL_ASN1_INTEGER *pathlen;
320 #endif
321 unsigned char dynamic; /* Use WOLFSSL_ASN1_DYNAMIC and WOLFSSL_ASN1_DYNAMIC_DATA
322 * to determine what needs to be freed. */
323
324 #if defined(WOLFSSL_APACHE_HTTPD)
325 WOLFSSL_GENERAL_NAME* gn;
326 #endif
327
328 struct d { /* dereferenced */
329 WOLFSSL_ASN1_STRING* dNSName;
330 WOLFSSL_ASN1_STRING ia5_internal;
331 WOLFSSL_ASN1_STRING* ia5; /* points to ia5_internal */
332 #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
333 WOLFSSL_ASN1_STRING* uniformResourceIdentifier;
334 WOLFSSL_ASN1_STRING iPAddress_internal;
335 WOLFSSL_ASN1_OTHERNAME* otherName; /* added for Apache httpd */
336 #endif
337 WOLFSSL_ASN1_STRING* iPAddress; /* points to iPAddress_internal */
338 } d;
339 };
340
341 /* wrap ASN1 types */
342 struct WOLFSSL_ASN1_TYPE {
343 int type;
344 union {
345 char *ptr;
346 WOLFSSL_ASN1_STRING* asn1_string;
347 WOLFSSL_ASN1_OBJECT* object;
348 WOLFSSL_ASN1_INTEGER* integer;
349 WOLFSSL_ASN1_BIT_STRING* bit_string;
350 WOLFSSL_ASN1_STRING* octet_string;
351 WOLFSSL_ASN1_STRING* printablestring;
352 WOLFSSL_ASN1_STRING* ia5string;
353 WOLFSSL_ASN1_UTCTIME* utctime;
354 WOLFSSL_ASN1_GENERALIZEDTIME* generalizedtime;
355 WOLFSSL_ASN1_STRING* utf8string;
356 WOLFSSL_ASN1_STRING* set;
357 WOLFSSL_ASN1_STRING* sequence;
358 } value;
359 };
360
361 struct WOLFSSL_X509_ATTRIBUTE {
362 WOLFSSL_ASN1_OBJECT *object;
363 WOLFSSL_ASN1_TYPE *value;
364 WOLF_STACK_OF(WOLFSSL_ASN1_TYPE) *set;
365 };
366
367 struct WOLFSSL_EVP_PKEY {
368 void* heap;
369 int type; /* openssh dereference */
370 int save_type; /* openssh dereference */
371 int pkey_sz;
372 int references; /*number of times free should be called for complete free*/
373 #ifndef SINGLE_THREADED
374 wolfSSL_Mutex refMutex; /* ref count mutex */
375 #endif
376
377 union {

NetBurner, Inc.
22.199 wolfssl/ssl.h 1035

378 char* ptr; /* der format of key */


379 } pkey;
380 #if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
381 #ifndef NO_RSA
382 WOLFSSL_RSA* rsa;
383 #endif
384 #ifndef NO_DSA
385 WOLFSSL_DSA* dsa;
386 #endif
387 #ifdef HAVE_ECC
388 WOLFSSL_EC_KEY* ecc;
389 #endif
390 #ifndef NO_DH
391 WOLFSSL_DH* dh;
392 #endif
393 WC_RNG rng;
394 #ifdef HAVE_HKDF
395 const WOLFSSL_EVP_MD* hkdfMd;
396 byte* hkdfSalt;
397 word32 hkdfSaltSz;
398 byte* hkdfKey;
399 word32 hkdfKeySz;
400 byte* hkdfInfo;
401 word32 hkdfInfoSz;
402 int hkdfMode;
403 #endif
404 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
405 #ifdef HAVE_ECC
406 int pkey_curve;
407 #endif
408 word16 pkcs8HeaderSz;
409
410 /* option bits */
411 byte ownDh:1; /* if struct owns DH and should free it */
412 byte ownEcc:1; /* if struct owns ECC and should free it */
413 byte ownDsa:1; /* if struct owns DSA and should free it */
414 byte ownRsa:1; /* if struct owns RSA and should free it */
415 };
416
417 struct WOLFSSL_X509_PKEY {
418 WOLFSSL_EVP_PKEY* dec_pkey; /* dereferenced by Apache */
419 void* heap;
420 };
421 typedef struct WOLFSSL_X509_PKEY WOLFSSL_X509_PKEY;
422
423 struct WOLFSSL_X509_INFO {
424 WOLFSSL_X509 *x509;
425 WOLFSSL_X509_CRL *crl;
426 WOLFSSL_X509_PKEY *x_pkey; /* dereferenced by Apache */
427 EncryptedInfo enc_cipher;
428 int enc_len;
429 char *enc_data;
430 int num;
431 };
432
433 #define WOLFSSL_EVP_PKEY_DEFAULT EVP_PKEY_RSA /* default key type */
434
435 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
436 #define wolfSSL_SSL_MODE_RELEASE_BUFFERS 0x00000010U
437 #define wolfSSL_SSL_CTRL_SET_TMP_ECDH 4
438 #endif
439
440 struct WOLFSSL_X509_ALGOR {
441 WOLFSSL_ASN1_OBJECT* algorithm;
442 WOLFSSL_ASN1_TYPE* parameter;
443 };
444
445 struct WOLFSSL_X509_PUBKEY {
446 WOLFSSL_X509_ALGOR* algor;
447 WOLFSSL_EVP_PKEY* pkey;
448 int pubKeyOID;
449 };
450
451 enum BIO_TYPE {
452 WOLFSSL_BIO_UNDEF = 0,
453 WOLFSSL_BIO_BUFFER = 1,
454 WOLFSSL_BIO_SOCKET = 2,
455 WOLFSSL_BIO_SSL = 3,
456 WOLFSSL_BIO_MEMORY = 4,
457 WOLFSSL_BIO_BIO = 5,
458 WOLFSSL_BIO_FILE = 6,
459 WOLFSSL_BIO_BASE64 = 7,
460 WOLFSSL_BIO_MD = 8
461 };
462
463 enum BIO_FLAGS {
464 WOLFSSL_BIO_FLAG_BASE64_NO_NL = 0x01,

NetBurner, Inc.
1036 File Documentation

465 WOLFSSL_BIO_FLAG_READ = 0x02,


466 WOLFSSL_BIO_FLAG_WRITE = 0x04,
467 WOLFSSL_BIO_FLAG_IO_SPECIAL = 0x08,
468 WOLFSSL_BIO_FLAG_RETRY = 0x10
469 };
470
471 enum BIO_CB_OPS {
472 WOLFSSL_BIO_CB_FREE = 0x01,
473 WOLFSSL_BIO_CB_READ = 0x02,
474 WOLFSSL_BIO_CB_WRITE = 0x03,
475 WOLFSSL_BIO_CB_PUTS = 0x04,
476 WOLFSSL_BIO_CB_GETS = 0x05,
477 WOLFSSL_BIO_CB_CTRL = 0x06,
478 WOLFSSL_BIO_CB_RETURN = 0x80
479 };
480
481 typedef struct WOLFSSL_BUF_MEM {
482 char* data; /* dereferenced */
483 size_t length; /* current length */
484 size_t max; /* maximum length */
485 } WOLFSSL_BUF_MEM;
486
487 /* custom method with user set callbacks */
488 typedef int (*wolfSSL_BIO_meth_write_cb)(WOLFSSL_BIO*, const char*, int);
489 typedef int (*wolfSSL_BIO_meth_read_cb)(WOLFSSL_BIO *, char *, int);
490 typedef int (*wolfSSL_BIO_meth_puts_cb)(WOLFSSL_BIO*, const char*);
491 typedef int (*wolfSSL_BIO_meth_gets_cb)(WOLFSSL_BIO*, char*, int);
492 typedef long (*wolfSSL_BIO_meth_ctrl_get_cb)(WOLFSSL_BIO*, int, long, void*);
493 typedef int (*wolfSSL_BIO_meth_create_cb)(WOLFSSL_BIO*);
494 typedef int (*wolfSSL_BIO_meth_destroy_cb)(WOLFSSL_BIO*);
495
496 typedef int wolfSSL_BIO_info_cb(WOLFSSL_BIO *, int, int);
497 typedef long (*wolfssl_BIO_meth_ctrl_info_cb)(WOLFSSL_BIO*, int, wolfSSL_BIO_info_cb*);
498
499 /* wolfSSL BIO_METHOD type */
500 #ifndef MAX_BIO_METHOD_NAME
501 #define MAX_BIO_METHOD_NAME 256
502 #endif
503 struct WOLFSSL_BIO_METHOD {
504 byte type; /* method type */
505 char name[MAX_BIO_METHOD_NAME];
506 wolfSSL_BIO_meth_write_cb writeCb;
507 wolfSSL_BIO_meth_read_cb readCb;
508 wolfSSL_BIO_meth_puts_cb putsCb;
509 wolfSSL_BIO_meth_gets_cb getsCb;
510 wolfSSL_BIO_meth_ctrl_get_cb ctrlCb;
511 wolfSSL_BIO_meth_create_cb createCb;
512 wolfSSL_BIO_meth_destroy_cb freeCb;
513 wolfssl_BIO_meth_ctrl_info_cb ctrlInfoCb;
514 };
515
516 /* wolfSSL BIO type */
517 typedef long (*wolf_bio_info_cb)(WOLFSSL_BIO *bio, int event, const char *parg,
518 int iarg, long larg, long return_value);
519
520 struct WOLFSSL_BIO {
521 WOLFSSL_BUF_MEM* mem_buf;
522 WOLFSSL_BIO_METHOD* method;
523 WOLFSSL_BIO* prev; /* previous in chain */
524 WOLFSSL_BIO* next; /* next in chain */
525 WOLFSSL_BIO* pair; /* BIO paired with */
526 void* heap; /* user heap hint */
527 void* ptr; /* WOLFSSL, file descriptor, MD, or mem buf */
528 void* usrCtx; /* user set pointer */
529 char* ip; /* IP address for wolfIO_TcpConnect */
530 word16 port; /* Port for wolfIO_TcpConnect */
531 char* infoArg; /* BIO callback argument */
532 wolf_bio_info_cb infoCb; /* BIO callback */
533 int wrSz; /* write buffer size (mem) */
534 int wrIdx; /* current index for write buffer */
535 int rdIdx; /* current read index */
536 int readRq; /* read request */
537 int num; /* socket num or length */
538 int eof; /* eof flag */
539 int flags;
540 byte type; /* method type */
541 byte init:1; /* bio has been initialized */
542 byte shutdown:1; /* close flag */
543 #ifdef HAVE_EX_DATA
544 WOLFSSL_CRYPTO_EX_DATA ex_data;
545 #endif
546 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
547 #ifndef SINGLE_THREADED
548 wolfSSL_Mutex refMutex; /* ref count mutex */
549 #endif
550 int refCount; /* reference count */
551 #endif

NetBurner, Inc.
22.199 wolfssl/ssl.h 1037

552 };
553
554 typedef struct WOLFSSL_COMP_METHOD {
555 int type; /* stunnel dereference */
556 } WOLFSSL_COMP_METHOD;
557
558 typedef struct WOLFSSL_COMP {
559 int id;
560 const char *name;
561 WOLFSSL_COMP_METHOD *method;
562 } WOLFSSL_COMP;
563
564 #define WOLFSSL_X509_L_FILE_LOAD 0x1
565 #define WOLFSSL_X509_L_ADD_DIR 0x2
566 #define WOLFSSL_X509_L_ADD_STORE 0x3
567 #define WOLFSSL_X509_L_LOAD_STORE 0x4
568
569 struct WOLFSSL_X509_LOOKUP_METHOD {
570 int type;
571 };
572
573 struct WOLFSSL_X509_LOOKUP {
574 WOLFSSL_X509_STORE *store;
575 int type;
576 WOLFSSL_BY_DIR* dirs;
577 };
578
579 struct WOLFSSL_X509_STORE {
580 int cache; /* stunnel dereference */
581 WOLFSSL_CERT_MANAGER* cm;
582 WOLFSSL_X509_LOOKUP lookup;
583 #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || \
584 defined(WOLFSSL_WPAS_SMALL)
585 int isDynamic;
586 WOLFSSL_X509_VERIFY_PARAM* param; /* certificate validation parameter */
587 #endif
588 #ifdef OPENSSL_ALL
589 WOLF_STACK_OF(WOLFSSL_X509_OBJECT)* objs; /* object stack cache */
590 #endif
591 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
592 WOLFSSL_X509_STORE_CTX_verify_cb verify_cb;
593 #endif
594 #ifdef HAVE_EX_DATA
595 WOLFSSL_CRYPTO_EX_DATA ex_data;
596 #endif
597 #if (defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || \
598 defined(WOLFSSL_WPAS_SMALL)) && defined(HAVE_CRL)
599 WOLFSSL_X509_CRL *crl; /* points to cm->crl */
600 #endif
601 #ifndef SINGLE_THREADED
602 wolfSSL_Mutex refMutex; /* reference count mutex */
603 #endif
604 int refCount; /* reference count */
605 };
606
607 #define WOLFSSL_ALWAYS_CHECK_SUBJECT 0x1
608 #define WOLFSSL_NO_WILDCARDS 0x2
609 #define WOLFSSL_NO_PARTIAL_WILDCARDS 0x4
610
611 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
612 #define WOLFSSL_USE_CHECK_TIME 0x2
613 #define WOLFSSL_NO_CHECK_TIME 0x200000
614 #define WOLFSSL_HOST_NAME_MAX 256
615
616 #define WOLFSSL_VPARAM_DEFAULT 0x1
617 #define WOLFSSL_VPARAM_OVERWRITE 0x2
618 #define WOLFSSL_VPARAM_RESET_FLAGS 0x4
619 #define WOLFSSL_VPARAM_LOCKED 0x8
620 #define WOLFSSL_VPARAM_ONCE 0x10
621
622 #ifndef WOLFSSL_MAX_IPSTR
623 #define WOLFSSL_MAX_IPSTR 46 /* max ip size IPv4 mapped IPv6 */
624 #endif
625
626 struct WOLFSSL_X509_VERIFY_PARAM {
627 time_t check_time;
628 unsigned int inherit_flags;
629 unsigned long flags;
630 char hostName[WOLFSSL_HOST_NAME_MAX];
631 unsigned int hostFlags;
632 char ipasc[WOLFSSL_MAX_IPSTR];
633 };
634 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
635
636 typedef struct WOLFSSL_ALERT {
637 int code;
638 int level;

NetBurner, Inc.
1038 File Documentation

639 } WOLFSSL_ALERT;
640
641 typedef struct WOLFSSL_ALERT_HISTORY {
642 WOLFSSL_ALERT last_rx;
643 WOLFSSL_ALERT last_tx;
644 } WOLFSSL_ALERT_HISTORY;
645
646 typedef struct WOLFSSL_X509_REVOKED {
647 WOLFSSL_ASN1_INTEGER* serialNumber; /* stunnel dereference */
648 } WOLFSSL_X509_REVOKED;
649
650 typedef enum {
651 WOLFSSL_X509_LU_NONE = 0,
652 WOLFSSL_X509_LU_X509,
653 WOLFSSL_X509_LU_CRL
654 } WOLFSSL_X509_LOOKUP_TYPE;
655
656 typedef struct WOLFSSL_X509_OBJECT {
657 WOLFSSL_X509_LOOKUP_TYPE type;
658 union {
659 char* ptr;
660 WOLFSSL_X509 *x509;
661 WOLFSSL_X509_CRL* crl; /* stunnel dereference */
662 } data;
663 } WOLFSSL_X509_OBJECT;
664
665 #define WOLFSSL_ASN1_BOOLEAN int
666
667 typedef struct WOLFSSL_BUFFER_INFO {
668 unsigned char* buffer;
669 unsigned int length;
670 } WOLFSSL_BUFFER_INFO;
671
672 struct WOLFSSL_X509_STORE_CTX {
673 WOLFSSL_X509_STORE* store; /* Store full of a CA cert chain */
674 WOLFSSL_X509* current_cert; /* current X509 (OPENSSL_EXTRA) */
675 #ifdef WOLFSSL_ASIO
676 WOLFSSL_X509* current_issuer; /* asio dereference */
677 #endif
678 WOLFSSL_X509_CHAIN* sesChain; /* pointer to WOLFSSL_SESSION peer chain */
679 WOLFSSL_STACK* chain;
680 #ifdef OPENSSL_EXTRA
681 WOLFSSL_X509_VERIFY_PARAM* param; /* certificate validation parameter */
682 #endif
683 char* domain; /* subject CN domain name */
684 #ifdef HAVE_EX_DATA
685 WOLFSSL_CRYPTO_EX_DATA ex_data; /* external data */
686 #endif
687 #if defined(WOLFSSL_APACHE_HTTPD) || defined(OPENSSL_EXTRA)
688 int depth; /* used in X509_STORE_CTX_*_depth */
689 #endif
690 void* userCtx; /* user ctx */
691 int error; /* current error */
692 int error_depth; /* index of cert depth for this error */
693 int discardSessionCerts; /* so verify callback can flag for discard */
694 int totalCerts; /* number of peer cert buffers */
695 WOLFSSL_BUFFER_INFO* certs; /* peer certs */
696 WOLFSSL_X509_STORE_CTX_verify_cb verify_cb; /* verify callback */
697 };
698
699 typedef char* WOLFSSL_STRING;
700
701 typedef struct WOLFSSL_RAND_METHOD {
702 /* seed = Data to mix into the random generator.
703 * len = Number of bytes to mix from seed. */
704 int (*seed)(const void* seed, int len);
705 /* buf = Buffer to store random bytes in.
706 * len = Number of bytes to store in buf. */
707 int (*bytes)(unsigned char* buf, int len);
708 void (*cleanup)(void);
709 /* add = Data to mix into the random generator.
710 * len = Number of bytes to mix from add.
711 * entropy = Estimate of randomness contained in seed.
712 * Should be between 0 and len. */
713 int (*add)(const void* add, int len, double entropy);
714 /* buf = Buffer to store pseudorandom bytes in.
715 * len = Number of bytes to store in buf. */
716 int (*pseudorand)(unsigned char *buf, int len);
717 int (*status)(void);
718 } WOLFSSL_RAND_METHOD;
719
720 /* Valid Alert types from page 16/17
721 * Add alert string to the function wolfSSL_alert_type_string_long in src/ssl.c
722 */
723 enum AlertDescription {
724 close_notify = 0,
725 unexpected_message = 10,

NetBurner, Inc.
22.199 wolfssl/ssl.h 1039

726 bad_record_mac = 20,


727 record_overflow = 22,
728 decompression_failure = 30,
729 handshake_failure = 40,
730 no_certificate = 41,
731 bad_certificate = 42,
732 unsupported_certificate = 43,
733 certificate_revoked = 44,
734 certificate_expired = 45,
735 certificate_unknown = 46,
736 illegal_parameter = 47,
737 unknown_ca = 48,
738 access_denied = 49,
739 decode_error = 50,
740 decrypt_error = 51,
741 #ifdef WOLFSSL_MYSQL_COMPATIBLE
742 /* catch name conflict for enum protocol with MYSQL build */
743 wc_protocol_version = 70,
744 #else
745 protocol_version = 70,
746 #endif
747 insufficient_security = 71,
748 internal_error = 80,
749 inappropriate_fallback = 86,
750 user_canceled = 90,
751 no_renegotiation = 100,
752 missing_extension = 109,
753 unsupported_extension = 110, /* RFC 5246, section 7.2.2 */
754 unrecognized_name = 112, /* RFC 6066, section 3 */
755 bad_certificate_status_response = 113, /* RFC 6066, section 8 */
756 unknown_psk_identity = 115, /* RFC 4279, section 2 */
757 certificate_required = 116, /* RFC 8446, section 8.2 */
758 no_application_protocol = 120
759 };
760
761
762 enum AlertLevel {
763 alert_none = 0, /* Used to indicate no alert level is set */
764 alert_warning = 1,
765 alert_fatal = 2
766 };
767
768 enum SNICbReturn {
769 warning_return = alert_warning,
770 fatal_return = alert_fatal,
771 noack_return,
772 };
773
774 /* WS_RETURN_CODE macro
775 * Some OpenSSL APIs specify "0" as the return value when an error occurs.
776 * However, some corresponding wolfSSL APIs return negative values. Such
777 * functions should use this macro to fill this gap. Users who want them
778 * to return the same return value as OpenSSL can define
779 * WOLFSSL_ERR_CODE_OPENSSL.
780 * Give item1 a variable that contains the potentially negative
781 * wolfSSL-defined return value or the return value itself, and
782 * give item2 the openSSL-defined return value.
783 * Note that this macro replaces only negative return values with the
784 * specified value.
785 * Since wolfSSL 4.7.0, the following functions use this macro:
786 * - wolfSSL_CTX_load_verify_locations
787 * - wolfSSL_X509_LOOKUP_load_file
788 * - wolfSSL_EVP_PKEY_cmp
789 */
790 #if defined(WOLFSSL_ERROR_CODE_OPENSSL)
791 #define WS_RETURN_CODE(item1,item2) \
792 (((item1) < 0) ? (int)(item2) : (int)(item1))
793 #else
794 #define WS_RETURN_CODE(item1,item2) (item1)
795 #endif
796
797 /* Maximum master key length (SECRET_LEN) */
798 #define WOLFSSL_MAX_MASTER_KEY_LENGTH 48
799 /* Maximum number of groups that can be set */
800 #ifdef HAVE_PQC
801 #define WOLFSSL_MAX_GROUP_COUNT 36
802 #else
803 #define WOLFSSL_MAX_GROUP_COUNT 10
804 #endif
805
806 #if defined(HAVE_SECRET_CALLBACK) && defined(WOLFSSL_TLS13)
807 enum Tls13Secret {
808 CLIENT_EARLY_TRAFFIC_SECRET,
809 CLIENT_HANDSHAKE_TRAFFIC_SECRET,
810 SERVER_HANDSHAKE_TRAFFIC_SECRET,
811 CLIENT_TRAFFIC_SECRET,
812 SERVER_TRAFFIC_SECRET,

NetBurner, Inc.
1040 File Documentation

813 EARLY_EXPORTER_SECRET,
814 EXPORTER_SECRET
815 };
816 #endif
817
818 #ifndef WOLFSSL_MODE_AUTO_RETRY_ATTEMPTS
819 #define WOLFSSL_MODE_AUTO_RETRY_ATTEMPTS 10
820 #endif
821
822 typedef WOLFSSL_METHOD* (*wolfSSL_method_func)(void* heap);
823
824 /* CTX Method Constructor Functions */
825
826 #ifndef NO_WOLFSSL_CLIENT
827 WOLFSSL_API WOLFSSL_METHOD *wolfTLS_client_method_ex(void* heap);
828 WOLFSSL_API WOLFSSL_METHOD *wolfTLS_client_method(void);
829 #endif
830 #ifndef NO_WOLFSSL_SERVER
831 WOLFSSL_API WOLFSSL_METHOD *wolfTLS_server_method_ex(void* heap);
832 WOLFSSL_API WOLFSSL_METHOD *wolfTLS_server_method(void);
833 #endif
834 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_method_ex(void* heap);
835 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_method(void);
836 #ifndef NO_WOLFSSL_CLIENT
837 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_client_method_ex(void* heap);
838 WOLFSSL_API WOLFSSL_METHOD* wolfSSLv23_client_method(void);
839 #endif
840 #ifndef NO_WOLFSSL_SERVER
841 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_server_method_ex(void* heap);
842 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_server_method(void);
843 #endif
844
845 #ifndef NO_OLD_TLS
846
847 #ifdef OPENSSL_EXTRA
848 #ifndef NO_WOLFSSL_CLIENT
849 WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_client_method(void);
850 #endif
851 #ifndef NO_WOLFSSL_SERVER
852 WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_server_method(void);
853 #endif
854 #endif /* OPENSSL_EXTRA */
855
856 #ifdef WOLFSSL_ALLOW_SSLV3
857 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_method_ex(void* heap);
858 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_method(void);
859 #ifndef NO_WOLFSSL_CLIENT
860 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_client_method_ex(void* heap);
861 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_client_method(void);
862 #endif
863 #ifndef NO_WOLFSSL_SERVER
864 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method_ex(void* heap);
865 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method(void);
866 #endif
867 #endif /* WOLFSSL_ALLOW_SSLV3 */
868
869 #ifdef WOLFSSL_ALLOW_TLSV10
870 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_method_ex(void* heap);
871 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_method(void);
872 #ifndef NO_WOLFSSL_CLIENT
873 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_client_method_ex(void* heap);
874 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_client_method(void);
875 #endif
876 #ifndef NO_WOLFSSL_SERVER
877 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_server_method_ex(void* heap);
878 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_server_method(void);
879 #endif
880 #endif /* WOLFSSL_ALLOW_TLSV10 */
881
882 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_method_ex(void* heap);
883 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_method(void);
884 #ifndef NO_WOLFSSL_CLIENT
885 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_client_method_ex(void* heap);
886 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_client_method(void);
887 #endif
888 #ifndef NO_WOLFSSL_SERVER
889 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_server_method_ex(void* heap);
890 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_server_method(void);
891 #endif
892
893 #endif /* NO_OLD_TLS */
894
895 #ifndef WOLFSSL_NO_TLS12
896 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_method_ex(void* heap);
897 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_method(void);
898 #ifndef NO_WOLFSSL_CLIENT
899 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_client_method_ex(void* heap);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1041

900 WOLFSSL_ABI WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_client_method(void);


901 #endif
902 #ifndef NO_WOLFSSL_SERVER
903 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_server_method_ex(void* heap);
904 WOLFSSL_ABI WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_server_method(void);
905 #endif
906 #endif /* !WOLFSSL_NO_TLS12 */
907
908 #ifdef WOLFSSL_TLS13
909 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_method_ex(void* heap);
910 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_method(void);
911 #ifndef NO_WOLFSSL_CLIENT
912 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_client_method_ex(void* heap);
913 WOLFSSL_ABI WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_client_method(void);
914 #endif
915 #ifndef NO_WOLFSSL_SERVER
916 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_server_method_ex(void* heap);
917 WOLFSSL_ABI WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_server_method(void);
918 #endif
919 #endif /* WOLFSSL_TLS13 */
920
921 #ifdef WOLFSSL_DTLS
922
923 WOLFSSL_API WOLFSSL_METHOD *wolfDTLS_method_ex(void* heap);
924 WOLFSSL_API WOLFSSL_METHOD *wolfDTLS_method(void);
925 #ifndef NO_WOLFSSL_CLIENT
926 WOLFSSL_API WOLFSSL_METHOD *wolfDTLS_client_method_ex(void* heap);
927 WOLFSSL_API WOLFSSL_METHOD *wolfDTLS_client_method(void);
928 #endif
929 #ifndef NO_WOLFSSL_SERVER
930 WOLFSSL_API WOLFSSL_METHOD *wolfDTLS_server_method_ex(void* heap);
931 WOLFSSL_API WOLFSSL_METHOD *wolfDTLS_server_method(void);
932 #endif
933
934 #ifndef NO_OLD_TLS
935 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_method_ex(void* heap);
936 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_method(void);
937 #ifndef NO_WOLFSSL_CLIENT
938 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_client_method_ex(void* heap);
939 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_client_method(void);
940 #endif
941 #ifndef NO_WOLFSSL_SERVER
942 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_server_method_ex(void* heap);
943 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_server_method(void);
944 #endif
945 #endif /* !NO_OLD_TLS */
946
947 #ifndef WOLFSSL_NO_TLS12
948 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_method_ex(void* heap);
949 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_method(void);
950 #ifndef NO_WOLFSSL_CLIENT
951 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_client_method_ex(void* heap);
952 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_client_method(void);
953 #endif
954 #ifndef NO_WOLFSSL_SERVER
955 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_server_method_ex(void* heap);
956 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_server_method(void);
957 #endif
958 #endif /* !WOLFSSL_NO_TLS12 */
959
960 #ifdef WOLFSSL_DTLS13
961 #ifndef NO_WOLFSSL_CLIENT
962 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_client_method_ex(void* heap);
963 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_client_method(void);
964 #endif
965 #ifndef NO_WOLFSSL_SERVER
966 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_server_method_ex(void* heap);
967 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_3_server_method(void);
968 #endif
969 WOLFSSL_API int wolfSSL_dtls13_has_pending_msg(WOLFSSL *ssl);
970 #endif /* WOLFSSL_DTLS13 */
971
972 #endif /* WOLFSSL_DTLS */
973
974 #ifdef HAVE_POLY1305
975 WOLFSSL_API int wolfSSL_use_old_poly(WOLFSSL* ssl, int value);
976 #endif
977
978 #ifdef WOLFSSL_SESSION_EXPORT
979 WOLFSSL_API int wolfSSL_tls_import(WOLFSSL* ssl, const unsigned char* buf,
980 unsigned int sz);
981 WOLFSSL_API int wolfSSL_tls_export(WOLFSSL* ssl, unsigned char* buf,
982 unsigned int* sz);
983
984 #ifdef WOLFSSL_DTLS
985
986 #ifndef WOLFSSL_DTLS_EXPORT_TYPES

NetBurner, Inc.
1042 File Documentation

987 typedef int (*wc_dtls_export)(WOLFSSL* ssl,


988 unsigned char* exportBuffer, unsigned int sz, void* userCtx);
989 #define WOLFSSL_DTLS_EXPORT_TYPES
990 #endif /* WOLFSSL_DTLS_EXPORT_TYPES */
991
992 WOLFSSL_API int wolfSSL_dtls_import(WOLFSSL* ssl, const unsigned char* buf,
993 unsigned int sz);
994 WOLFSSL_API int wolfSSL_CTX_dtls_set_export(WOLFSSL_CTX* ctx,
995 wc_dtls_export func);
996 WOLFSSL_API int wolfSSL_dtls_set_export(WOLFSSL* ssl, wc_dtls_export func);
997 WOLFSSL_API int wolfSSL_dtls_export(WOLFSSL* ssl, unsigned char* buf,
998 unsigned int* sz);
999 WOLFSSL_API int wolfSSL_dtls_export_state_only(WOLFSSL* ssl, unsigned char* buf,
1000 unsigned int* sz);
1001 #endif /* WOLFSSL_DTLS */
1002 #endif /* WOLFSSL_SESSION_EXPORT */
1003
1004 #ifdef WOLFSSL_STATIC_MEMORY
1005 #ifndef WOLFSSL_MEM_GUARD
1006 #define WOLFSSL_MEM_GUARD
1007 typedef struct WOLFSSL_MEM_STATS WOLFSSL_MEM_STATS;
1008 typedef struct WOLFSSL_MEM_CONN_STATS WOLFSSL_MEM_CONN_STATS;
1009 #endif
1010 WOLFSSL_API int wolfSSL_CTX_load_static_memory(WOLFSSL_CTX** ctx,
1011 wolfSSL_method_func method,
1012 unsigned char* buf, unsigned int sz,
1013 int flag, int max);
1014 WOLFSSL_API int wolfSSL_CTX_is_static_memory(WOLFSSL_CTX* ctx,
1015 WOLFSSL_MEM_STATS* mem_stats);
1016 WOLFSSL_API int wolfSSL_is_static_memory(WOLFSSL* ssl,
1017 WOLFSSL_MEM_CONN_STATS* mem_stats);
1018 #endif
1019
1020 #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS)
1021
1022 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_use_certificate_file(
1023 WOLFSSL_CTX* ctx, const char* file, int format);
1024 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_file(
1025 WOLFSSL_CTX* ctx, const char* file, int format);
1026
1027 #endif
1028
1029 #ifndef NO_CERTS
1030 #define WOLFSSL_LOAD_FLAG_NONE 0x00000000
1031 #define WOLFSSL_LOAD_FLAG_IGNORE_ERR 0x00000001
1032 #define WOLFSSL_LOAD_FLAG_DATE_ERR_OKAY 0x00000002
1033 #define WOLFSSL_LOAD_FLAG_PEM_CA_ONLY 0x00000004
1034 #if defined(WOLFSSL_QT)
1035 #define WOLFSSL_LOAD_FLAG_IGNORE_BAD_PATH_ERR 0x00000008
1036 #define WOLFSSL_LOAD_FLAG_IGNORE_ZEROFILE 0x00000010
1037 #endif
1038
1039 #ifndef WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS
1040 #define WOLFSSL_LOAD_VERIFY_DEFAULT_FLAGS WOLFSSL_LOAD_FLAG_NONE
1041 #endif
1042
1043 WOLFSSL_API long wolfSSL_get_verify_depth(WOLFSSL* ssl);
1044 WOLFSSL_API long wolfSSL_CTX_get_verify_depth(WOLFSSL_CTX* ctx);
1045 WOLFSSL_API void wolfSSL_CTX_set_verify_depth(WOLFSSL_CTX *ctx,int depth);
1046 #endif /* !NO_CERTS */
1047
1048 #define WOLFSSL_CIPHER_SUITE_FLAG_NONE 0x0
1049 #define WOLFSSL_CIPHER_SUITE_FLAG_NAMEALIAS 0x1
1050
1051 #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS)
1052
1053 WOLFSSL_API int wolfSSL_CTX_load_verify_locations_ex(
1054 WOLFSSL_CTX* ctx, const char* file, const char* path, word32 flags);
1055 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_load_verify_locations(
1056 WOLFSSL_CTX* ctx, const char* file, const char* path);
1057 #ifdef WOLFSSL_TRUST_PEER_CERT
1058 WOLFSSL_API int wolfSSL_CTX_trust_peer_cert(
1059 WOLFSSL_CTX* ctx, const char* file, int type);
1060 WOLFSSL_API int wolfSSL_trust_peer_cert(
1061 WOLFSSL* ssl, const char* file, int type);
1062 #endif
1063 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_file(
1064 WOLFSSL_CTX* ctx, const char* file);
1065 WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_file_format(
1066 WOLFSSL_CTX* ctx, const char* file, int format);
1067 WOLFSSL_API int wolfSSL_CTX_use_RSAPrivateKey_file(
1068 WOLFSSL_CTX* ctx,const char* file, int format);
1069
1070 WOLFSSL_ABI WOLFSSL_API int wolfSSL_use_certificate_file(
1071 WOLFSSL* ssl, const char* file, int format);
1072 WOLFSSL_ABI WOLFSSL_API int wolfSSL_use_PrivateKey_file(
1073 WOLFSSL* ssl, const char* file, int format);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1043

1074 WOLFSSL_ABI WOLFSSL_API int wolfSSL_use_certificate_chain_file(


1075 WOLFSSL* ssl, const char* file);
1076 WOLFSSL_API int wolfSSL_use_certificate_chain_file_format(
1077 WOLFSSL* ssl, const char* file, int format);
1078 WOLFSSL_API int wolfSSL_use_RSAPrivateKey_file(
1079 WOLFSSL* ssl, const char* file, int format);
1080
1081 #ifdef WOLFSSL_DER_LOAD
1082 WOLFSSL_API int wolfSSL_CTX_der_load_verify_locations(
1083 WOLFSSL_CTX* ctx, const char* file, int format);
1084 #endif
1085 #endif /* !NO_FILESYSTEM && !NO_CERTS */
1086
1087 WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new_ex(WOLFSSL_METHOD* method, void* heap);
1088 WOLFSSL_ABI WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method);
1089 WOLFSSL_API int wolfSSL_CTX_up_ref(WOLFSSL_CTX* ctx);
1090 #ifdef OPENSSL_EXTRA
1091 WOLFSSL_API int wolfSSL_CTX_set_ecdh_auto(WOLFSSL_CTX* ctx, int onoff);
1092 WOLFSSL_API int wolfSSL_get_signature_nid(WOLFSSL* ssl, int* nid);
1093 WOLFSSL_API int wolfSSL_CTX_set1_sigalgs_list(WOLFSSL_CTX* ctx,
1094 const char* list);
1095 WOLFSSL_API int wolfSSL_set1_sigalgs_list(WOLFSSL* ssl, const char* list);
1096 #endif
1097 WOLFSSL_ABI WOLFSSL_API WOLFSSL* wolfSSL_new(WOLFSSL_CTX* ctx);
1098 WOLFSSL_API WOLFSSL_CTX* wolfSSL_get_SSL_CTX(WOLFSSL* ssl);
1099 WOLFSSL_API WOLFSSL_X509_VERIFY_PARAM* wolfSSL_CTX_get0_param(WOLFSSL_CTX* ctx);
1100 WOLFSSL_API WOLFSSL_X509_VERIFY_PARAM* wolfSSL_get0_param(WOLFSSL* ssl);
1101 WOLFSSL_API int wolfSSL_CTX_set1_param(WOLFSSL_CTX* ctx, WOLFSSL_X509_VERIFY_PARAM *vpm);
1102 WOLFSSL_API int wolfSSL_is_server(WOLFSSL* ssl);
1103 WOLFSSL_API WOLFSSL* wolfSSL_write_dup(WOLFSSL* ssl);
1104 WOLFSSL_ABI WOLFSSL_API int wolfSSL_set_fd(WOLFSSL* ssl, int fd);
1105 #ifdef WOLFSSL_DTLS
1106 WOLFSSL_API int wolfSSL_set_dtls_fd_connected(WOLFSSL* ssl, int fd);
1107 #endif
1108 WOLFSSL_API int wolfSSL_set_write_fd (WOLFSSL* ssl, int fd);
1109 WOLFSSL_API int wolfSSL_set_read_fd (WOLFSSL* ssl, int fd);
1110 WOLFSSL_API char* wolfSSL_get_cipher_list(int priority);
1111 WOLFSSL_API char* wolfSSL_get_cipher_list_ex(WOLFSSL* ssl, int priority);
1112 WOLFSSL_API int wolfSSL_get_ciphers(char* buf, int len);
1113 WOLFSSL_API int wolfSSL_get_ciphers_iana(char* buf, int len);
1114 WOLFSSL_API const char* wolfSSL_get_cipher_name(WOLFSSL* ssl);
1115 WOLFSSL_API const char* wolfSSL_get_cipher_name_from_suite(
1116 unsigned char cipherSuite0, unsigned char cipherSuite);
1117 WOLFSSL_API const char* wolfSSL_get_cipher_name_iana_from_suite(
1118 unsigned char cipherSuite0, unsigned char cipherSuite);
1119 WOLFSSL_API int wolfSSL_get_cipher_suite_from_name(const char* name,
1120 unsigned char* cipherSuite0, unsigned char* cipherSuite, int *flags);
1121 WOLFSSL_API const char* wolfSSL_get_shared_ciphers(WOLFSSL* ssl, char* buf,
1122 int len);
1123 WOLFSSL_API const char* wolfSSL_get_curve_name(WOLFSSL* ssl);
1124 WOLFSSL_API int wolfSSL_get_fd(const WOLFSSL* ssl);
1125 /* please see note at top of README if you get an error from connect */
1126 WOLFSSL_ABI WOLFSSL_API int wolfSSL_connect(WOLFSSL* ssl);
1127 WOLFSSL_ABI WOLFSSL_API int wolfSSL_write(
1128 WOLFSSL* ssl, const void* data, int sz);
1129 WOLFSSL_ABI WOLFSSL_API int wolfSSL_read(WOLFSSL* ssl, void* data, int sz);
1130 WOLFSSL_API int wolfSSL_peek(WOLFSSL* ssl, void* data, int sz);
1131 WOLFSSL_ABI WOLFSSL_API int wolfSSL_accept(WOLFSSL* ssl);
1132 WOLFSSL_API int wolfSSL_CTX_mutual_auth(WOLFSSL_CTX* ctx, int req);
1133 WOLFSSL_API int wolfSSL_mutual_auth(WOLFSSL* ssl, int req);
1134 #ifdef WOLFSSL_TLS13
1135 WOLFSSL_API int wolfSSL_send_hrr_cookie(WOLFSSL* ssl,
1136 const unsigned char* secret, unsigned int secretSz);
1137 WOLFSSL_API int wolfSSL_CTX_no_ticket_TLSv13(WOLFSSL_CTX* ctx);
1138 WOLFSSL_API int wolfSSL_no_ticket_TLSv13(WOLFSSL* ssl);
1139 WOLFSSL_API int wolfSSL_CTX_no_dhe_psk(WOLFSSL_CTX* ctx);
1140 WOLFSSL_API int wolfSSL_no_dhe_psk(WOLFSSL* ssl);
1141 WOLFSSL_API int wolfSSL_update_keys(WOLFSSL* ssl);
1142 WOLFSSL_API int wolfSSL_key_update_response(WOLFSSL* ssl, int* required);
1143 WOLFSSL_API int wolfSSL_CTX_allow_post_handshake_auth(WOLFSSL_CTX* ctx);
1144 WOLFSSL_API int wolfSSL_allow_post_handshake_auth(WOLFSSL* ssl);
1145 WOLFSSL_API int wolfSSL_request_certificate(WOLFSSL* ssl);
1146
1147 WOLFSSL_API int wolfSSL_CTX_set1_groups_list(WOLFSSL_CTX *ctx, char *list);
1148 WOLFSSL_API int wolfSSL_set1_groups_list(WOLFSSL *ssl, char *list);
1149
1150 WOLFSSL_API int wolfSSL_preferred_group(WOLFSSL* ssl);
1151 WOLFSSL_API int wolfSSL_CTX_set_groups(WOLFSSL_CTX* ctx, int* groups,
1152 int count);
1153 WOLFSSL_API int wolfSSL_set_groups(WOLFSSL* ssl, int* groups, int count);
1154
1155 #ifdef OPENSSL_EXTRA
1156 WOLFSSL_API int wolfSSL_CTX_set1_groups(WOLFSSL_CTX* ctx, int* groups,
1157 int count);
1158 WOLFSSL_API int wolfSSL_set1_groups(WOLFSSL* ssl, int* groups, int count);
1159 #endif
1160

NetBurner, Inc.
1044 File Documentation

1161 WOLFSSL_API int wolfSSL_connect_TLSv13(WOLFSSL* ssl);


1162 WOLFSSL_API int wolfSSL_accept_TLSv13(WOLFSSL* ssl);
1163
1164 #ifdef WOLFSSL_EARLY_DATA
1165
1166 #define WOLFSSL_EARLY_DATA_NOT_SENT 0
1167 #define WOLFSSL_EARLY_DATA_REJECTED 1
1168 #define WOLFSSL_EARLY_DATA_ACCEPTED 2
1169
1170 WOLFSSL_API int wolfSSL_CTX_set_max_early_data(WOLFSSL_CTX* ctx,
1171 unsigned int sz);
1172 WOLFSSL_API int wolfSSL_set_max_early_data(WOLFSSL* ssl, unsigned int sz);
1173 WOLFSSL_API int wolfSSL_CTX_get_max_early_data(WOLFSSL_CTX* ctx);
1174 WOLFSSL_API int wolfSSL_get_max_early_data(WOLFSSL* ssl);
1175 WOLFSSL_API int wolfSSL_write_early_data(WOLFSSL* ssl, const void* data,
1176 int sz, int* outSz);
1177 WOLFSSL_API int wolfSSL_read_early_data(WOLFSSL* ssl, void* data, int sz,
1178 int* outSz);
1179 WOLFSSL_API int wolfSSL_get_early_data_status(const WOLFSSL* ssl);
1180 #ifdef OPENSSL_EXTRA
1181 WOLFSSL_API unsigned int wolfSSL_SESSION_get_max_early_data(const WOLFSSL_SESSION *s);
1182 #endif /* OPENSSL_EXTRA */
1183 #endif /* WOLFSSL_EARLY_DATA */
1184 #endif /* WOLFSSL_TLS13 */
1185 WOLFSSL_ABI WOLFSSL_API void wolfSSL_CTX_free(WOLFSSL_CTX* ctx);
1186 WOLFSSL_ABI WOLFSSL_API void wolfSSL_free(WOLFSSL* ssl);
1187 WOLFSSL_ABI WOLFSSL_API int wolfSSL_shutdown(WOLFSSL* ssl);
1188 WOLFSSL_API int wolfSSL_send(WOLFSSL* ssl, const void* data, int sz, int flags);
1189 WOLFSSL_API int wolfSSL_recv(WOLFSSL* ssl, void* data, int sz, int flags);
1190
1191 WOLFSSL_API void wolfSSL_CTX_set_quiet_shutdown(WOLFSSL_CTX* ctx, int mode);
1192 WOLFSSL_API void wolfSSL_set_quiet_shutdown(WOLFSSL* ssl, int mode);
1193
1194 WOLFSSL_ABI WOLFSSL_API int wolfSSL_get_error(WOLFSSL* ssl, int ret);
1195 WOLFSSL_API int wolfSSL_get_alert_history(WOLFSSL* ssl, WOLFSSL_ALERT_HISTORY *h);
1196
1197 WOLFSSL_ABI WOLFSSL_API int wolfSSL_set_session(WOLFSSL* ssl, WOLFSSL_SESSION* session);
1198 WOLFSSL_API long wolfSSL_SSL_SESSION_set_timeout(WOLFSSL_SESSION* ses, long t);
1199 WOLFSSL_ABI WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get_session(WOLFSSL* ssl);
1200 WOLFSSL_ABI WOLFSSL_API void wolfSSL_flush_sessions(WOLFSSL_CTX* ctx, long tm);
1201 WOLFSSL_API int wolfSSL_SetServerID(WOLFSSL* ssl, const unsigned char* id, int len, int newSession);
1202
1203 #if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
1204 || defined(WOLFSSL_NGINX)
1205 WOLFSSL_API int wolfSSL_BIO_new_bio_pair(WOLFSSL_BIO** bio1_p, size_t writebuf1,
1206 WOLFSSL_BIO** bio2_p, size_t writebuf2);
1207
1208 WOLFSSL_API int wolfSSL_RSA_padding_add_PKCS1_PSS(WOLFSSL_RSA *rsa,
1209 unsigned char *EM,
1210 const unsigned char *mHash,
1211 const WOLFSSL_EVP_MD *hashAlg,
1212 int saltLen);
1213 WOLFSSL_API int wolfSSL_RSA_verify_PKCS1_PSS(WOLFSSL_RSA *rsa, const unsigned char *mHash,
1214 const WOLFSSL_EVP_MD *hashAlg,
1215 const unsigned char *EM, int saltLen);
1216 WOLFSSL_API WOLFSSL_RSA* wolfSSL_d2i_RSAPrivateKey_bio(WOLFSSL_BIO* bio, WOLFSSL_RSA** out);
1217 WOLFSSL_API int wolfSSL_CTX_use_certificate_ASN1(WOLFSSL_CTX* ctx,
1218 int derSz, const unsigned char* der);
1219 WOLFSSL_API int wolfSSL_CTX_use_RSAPrivateKey(WOLFSSL_CTX* ctx, WOLFSSL_RSA* rsa);
1220 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey_bio(WOLFSSL_BIO* bio, WOLFSSL_EVP_PKEY** pkey);
1221 #endif /* OPENSSL_ALL || WOLFSSL_ASIO */
1222
1223 #ifdef SESSION_INDEX
1224 WOLFSSL_API int wolfSSL_GetSessionIndex(WOLFSSL* ssl);
1225 WOLFSSL_API int wolfSSL_GetSessionAtIndex(int index, WOLFSSL_SESSION* session);
1226 #endif /* SESSION_INDEX */
1227
1228 #if defined(SESSION_CERTS)
1229 WOLFSSL_API
1230 WOLFSSL_X509_CHAIN* wolfSSL_SESSION_get_peer_chain(WOLFSSL_SESSION* session);
1231 WOLFSSL_API WOLFSSL_X509* wolfSSL_SESSION_get0_peer(WOLFSSL_SESSION* session);
1232 #endif /* SESSION_INDEX && SESSION_CERTS */
1233
1234 typedef int (*VerifyCallback)(int, WOLFSSL_X509_STORE_CTX*);
1235 typedef void (CallbackInfoState)(const WOLFSSL* ssl, int, int);
1236
1237 /* class index for wolfSSL_CRYPTO_get_ex_new_index */
1238 #define WOLF_CRYPTO_EX_INDEX_SSL 0
1239 #define WOLF_CRYPTO_EX_INDEX_SSL_CTX 1
1240 #define WOLF_CRYPTO_EX_INDEX_SSL_SESSION 2
1241 #define WOLF_CRYPTO_EX_INDEX_X509 3
1242 #define WOLF_CRYPTO_EX_INDEX_X509_STORE 4
1243 #define WOLF_CRYPTO_EX_INDEX_X509_STORE_CTX 5
1244 #define WOLF_CRYPTO_EX_INDEX_DH 6
1245 #define WOLF_CRYPTO_EX_INDEX_DSA 7
1246 #define WOLF_CRYPTO_EX_INDEX_EC_KEY 8
1247 #define WOLF_CRYPTO_EX_INDEX_RSA 9

NetBurner, Inc.
22.199 wolfssl/ssl.h 1045

1248 #define WOLF_CRYPTO_EX_INDEX_ENGINE 10


1249 #define WOLF_CRYPTO_EX_INDEX_UI 11
1250 #define WOLF_CRYPTO_EX_INDEX_BIO 12
1251 #define WOLF_CRYPTO_EX_INDEX_APP 13
1252 #define WOLF_CRYPTO_EX_INDEX_UI_METHOD 14
1253 #define WOLF_CRYPTO_EX_INDEX_DRBG 15
1254 #define WOLF_CRYPTO_EX_INDEX__COUNT 16
1255
1256 #ifdef HAVE_EX_DATA
1257 /* Helper macro to log that input arguments should not be used */
1258 #define WOLFSSL_CRYPTO_EX_DATA_IGNORE_PARAMS(a1, a2, a3, a4, a5) \
1259 (void)(a1); \
1260 (void)(a2); \
1261 (void)(a3); \
1262 (void)(a4); \
1263 (void)(a5); \
1264 do { \
1265 if ((a3) != NULL || (a4) != NULL || (a5) != NULL) { \
1266 WOLFSSL_MSG("get_ex_new_index API does not support " \
1267 "new, dup, or free callbacks"); \
1268 } \
1269 } while(0)
1270
1271 typedef int (WOLFSSL_CRYPTO_EX_new)(void* p, void* ptr,
1272 WOLFSSL_CRYPTO_EX_DATA* a, int idx, long argValue, void* arg);
1273 typedef int (WOLFSSL_CRYPTO_EX_dup)(WOLFSSL_CRYPTO_EX_DATA* out,
1274 WOLFSSL_CRYPTO_EX_DATA* in, void* inPtr, int idx, long argV, void* arg);
1275 typedef void (WOLFSSL_CRYPTO_EX_free)(void* p, void* ptr,
1276 WOLFSSL_CRYPTO_EX_DATA* a, int idx, long argValue, void* arg);
1277
1278 WOLFSSL_API int wolfSSL_get_ex_new_index(long argValue, void* arg,
1279 WOLFSSL_CRYPTO_EX_new* a, WOLFSSL_CRYPTO_EX_dup* b,
1280 WOLFSSL_CRYPTO_EX_free* c);
1281
1282 #endif
1283
1284 WOLFSSL_ABI WOLFSSL_API void wolfSSL_CTX_set_verify(WOLFSSL_CTX* ctx, int mode,
1285 VerifyCallback verify_callback);
1286
1287 #ifdef OPENSSL_ALL
1288 typedef int (*CertVerifyCallback)(WOLFSSL_X509_STORE_CTX* store, void* arg);
1289 WOLFSSL_API void wolfSSL_CTX_set_cert_verify_callback(WOLFSSL_CTX* ctx,
1290 CertVerifyCallback cb, void* arg);
1291 #endif
1292
1293 WOLFSSL_API void wolfSSL_set_verify(WOLFSSL* ssl, int mode, VerifyCallback verify_callback);
1294 WOLFSSL_API void wolfSSL_set_verify_result(WOLFSSL* ssl, long v);
1295
1296 #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) && \
1297 defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH)
1298 WOLFSSL_API int wolfSSL_verify_client_post_handshake(WOLFSSL* ssl);
1299 WOLFSSL_API int wolfSSL_CTX_set_post_handshake_auth(WOLFSSL_CTX* ctx, int val);
1300 WOLFSSL_API int wolfSSL_set_post_handshake_auth(WOLFSSL* ssl, int val);
1301 #endif
1302
1303 WOLFSSL_API void wolfSSL_SetCertCbCtx(WOLFSSL* ssl, void* ctx);
1304 WOLFSSL_API void wolfSSL_CTX_SetCertCbCtx(WOLFSSL_CTX* ctx, void* userCtx);
1305
1306 WOLFSSL_ABI WOLFSSL_API int wolfSSL_pending(WOLFSSL* ssl);
1307 WOLFSSL_API int wolfSSL_has_pending(const WOLFSSL* ssl);
1308
1309 WOLFSSL_API void wolfSSL_load_error_strings(void);
1310 WOLFSSL_API int wolfSSL_library_init(void);
1311 WOLFSSL_ABI WOLFSSL_API long wolfSSL_CTX_set_session_cache_mode(WOLFSSL_CTX* ctx,
1312 long mode);
1313
1314 #ifdef HAVE_SECRET_CALLBACK
1315 typedef int (*SessionSecretCb)(WOLFSSL* ssl, void* secret, int* secretSz,
1316 void* ctx);
1317 WOLFSSL_API int wolfSSL_set_session_secret_cb(WOLFSSL* ssl, SessionSecretCb,
1318 void*);
1319 #ifdef WOLFSSL_TLS13
1320 typedef int (*Tls13SecretCb)(WOLFSSL* ssl, int id, const unsigned char* secret,
1321 int secretSz, void* ctx);
1322 WOLFSSL_API int wolfSSL_set_tls13_secret_cb(WOLFSSL* ssl, Tls13SecretCb, void*);
1323 #endif
1324 #endif /* HAVE_SECRET_CALLBACK */
1325
1326 /* session cache persistence */
1327 WOLFSSL_API int wolfSSL_save_session_cache(const char* fname);
1328 WOLFSSL_API int wolfSSL_restore_session_cache(const char* fname);
1329 WOLFSSL_API int wolfSSL_memsave_session_cache(void* mem, int sz);
1330 WOLFSSL_API int wolfSSL_memrestore_session_cache(const void* mem, int sz);
1331 WOLFSSL_API int wolfSSL_get_session_cache_memsize(void);
1332
1333 /* certificate cache persistence, uses ctx since certs are per ctx */
1334 WOLFSSL_API int wolfSSL_CTX_save_cert_cache(WOLFSSL_CTX* ctx, const char* fname);

NetBurner, Inc.
1046 File Documentation

1335 WOLFSSL_API int wolfSSL_CTX_restore_cert_cache(WOLFSSL_CTX* ctx, const char* fname);


1336 WOLFSSL_API int wolfSSL_CTX_memsave_cert_cache(WOLFSSL_CTX* ctx, void* mem, int sz, int* used);
1337 WOLFSSL_API int wolfSSL_CTX_memrestore_cert_cache(WOLFSSL_CTX* ctx, const void* mem, int sz);
1338 WOLFSSL_API int wolfSSL_CTX_get_cert_cache_memsize(WOLFSSL_CTX* ctx);
1339
1340 /* only supports full name from cipher_name[] delimited by : */
1341 WOLFSSL_API int wolfSSL_CTX_set_cipher_list(WOLFSSL_CTX* ctx, const char* list);
1342 WOLFSSL_API int wolfSSL_set_cipher_list(WOLFSSL* ssl, const char* list);
1343
1344 #ifdef HAVE_KEYING_MATERIAL
1345 /* Keying Material Exporter for TLS */
1346 WOLFSSL_API int wolfSSL_export_keying_material(WOLFSSL *ssl,
1347 unsigned char *out, size_t outLen,
1348 const char *label, size_t labelLen,
1349 const unsigned char *context, size_t contextLen,
1350 int use_context);
1351 #endif /* HAVE_KEYING_MATERIAL */
1352
1353 #ifdef WOLFSSL_WOLFSENTRY_HOOKS
1354
1355 typedef enum {
1356 WOLFSSL_NETFILTER_PASS = 0,
1357 WOLFSSL_NETFILTER_ACCEPT = 1,
1358 WOLFSSL_NETFILTER_REJECT = 2
1359 } wolfSSL_netfilter_decision_t;
1360
1361 typedef int (*NetworkFilterCallback_t)(
1362 WOLFSSL *ssl,
1363 void *AcceptFilter_arg,
1364 wolfSSL_netfilter_decision_t *decision);
1365 WOLFSSL_API int wolfSSL_CTX_set_AcceptFilter(
1366 WOLFSSL_CTX *ctx,
1367 NetworkFilterCallback_t AcceptFilter,
1368 void *AcceptFilter_arg);
1369 WOLFSSL_API int wolfSSL_set_AcceptFilter(
1370 WOLFSSL *ssl,
1371 NetworkFilterCallback_t AcceptFilter,
1372 void *AcceptFilter_arg);
1373 WOLFSSL_API int wolfSSL_CTX_set_ConnectFilter(
1374 WOLFSSL_CTX *ctx,
1375 NetworkFilterCallback_t ConnectFilter,
1376 void *ConnectFilter_arg);
1377 WOLFSSL_API int wolfSSL_set_ConnectFilter(
1378 WOLFSSL *ssl,
1379 NetworkFilterCallback_t ConnectFilter,
1380 void *ConnectFilter_arg);
1381
1382 #endif /* WOLFSSL_WOLFSENTRY_HOOKS */
1383
1384 /* Nonblocking DTLS helper functions */
1385 WOLFSSL_API void wolfSSL_dtls_set_using_nonblock(WOLFSSL* ssl, int nonblock);
1386 WOLFSSL_API int wolfSSL_dtls_get_using_nonblock(WOLFSSL* ssl);
1387 #define wolfSSL_set_using_nonblock wolfSSL_dtls_set_using_nonblock
1388 #define wolfSSL_get_using_nonblock wolfSSL_dtls_get_using_nonblock
1389 /* The old names are deprecated. */
1390 WOLFSSL_API int wolfSSL_dtls_get_current_timeout(WOLFSSL* ssl);
1391 WOLFSSL_API int wolfSSL_dtls13_use_quick_timeout(WOLFSSL* ssl);
1392 WOLFSSL_API void wolfSSL_dtls13_set_send_more_acks(WOLFSSL* ssl, int value);
1393 WOLFSSL_API int wolfSSL_DTLSv1_get_timeout(WOLFSSL* ssl,
1394 WOLFSSL_TIMEVAL* timeleft);
1395 WOLFSSL_API void wolfSSL_DTLSv1_set_initial_timeout_duration(WOLFSSL* ssl,
1396 word32 duration_ms);
1397 WOLFSSL_API int wolfSSL_DTLSv1_handle_timeout(WOLFSSL* ssl);
1398
1399 WOLFSSL_API int wolfSSL_dtls_set_timeout_init(WOLFSSL* ssl, int timeout);
1400 WOLFSSL_API int wolfSSL_dtls_set_timeout_max(WOLFSSL* ssl, int timeout);
1401 WOLFSSL_API int wolfSSL_dtls_got_timeout(WOLFSSL* ssl);
1402 WOLFSSL_API int wolfSSL_dtls_retransmit(WOLFSSL* ssl);
1403 WOLFSSL_API int wolfSSL_dtls(WOLFSSL* ssl);
1404
1405 WOLFSSL_API void* wolfSSL_dtls_create_peer(int port, char* ip);
1406 WOLFSSL_API int wolfSSL_dtls_free_peer(void* addr);
1407
1408 WOLFSSL_API int wolfSSL_dtls_set_peer(WOLFSSL* ssl, void* peer, unsigned int peerSz);
1409 WOLFSSL_API int wolfSSL_dtls_get_peer(WOLFSSL* ssl, void* peer, unsigned int* peerSz);
1410
1411 WOLFSSL_API int wolfSSL_CTX_dtls_set_sctp(WOLFSSL_CTX* ctx);
1412 WOLFSSL_API int wolfSSL_dtls_set_sctp(WOLFSSL* ssl);
1413 WOLFSSL_API int wolfSSL_CTX_dtls_set_mtu(WOLFSSL_CTX* ctx, unsigned short);
1414 WOLFSSL_API int wolfSSL_dtls_set_mtu(WOLFSSL* ssl, unsigned short);
1415
1416 #ifdef WOLFSSL_SRTP
1417
1418 /* SRTP Profile ID’s from RFC 5764 and RFC 7714 */
1419 /* For WebRTC support for profile SRTP_AES128_CM_SHA1_80 is required per
1420 * draft-ietf-rtcweb-security-arch) */
1421 #define SRTP_AES128_CM_SHA1_80 0x0001

NetBurner, Inc.
22.199 wolfssl/ssl.h 1047

1422 #define SRTP_AES128_CM_SHA1_32 0x0002


1423 #define SRTP_AES128_F8_SHA1_80 0x0003 /* not supported */
1424 #define SRTP_AES128_F8_SHA1_32 0x0004 /* not supported */
1425 #define SRTP_NULL_SHA1_80 0x0005
1426 #define SRTP_NULL_SHA1_32 0x0006
1427 #define SRTP_AEAD_AES_128_GCM 0x0007
1428 #define SRTP_AEAD_AES_256_GCM 0x0008
1429
1430 typedef struct WOLFSSL_SRTP_PROTECTION_PROFILE {
1431 const char* name;
1432 unsigned long id;
1433 int kdfBits;
1434 } WOLFSSL_SRTP_PROTECTION_PROFILE;
1435
1436 /* Compatibility API’s for SRTP */
1437 WOLFSSL_API int wolfSSL_CTX_set_tlsext_use_srtp(WOLFSSL_CTX* ctx, const char*);
1438 WOLFSSL_API int wolfSSL_set_tlsext_use_srtp(WOLFSSL* ssl, const char*);
1439 WOLFSSL_API const WOLFSSL_SRTP_PROTECTION_PROFILE*
1440 wolfSSL_get_selected_srtp_profile(WOLFSSL* ssl);
1441 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_SRTP_PROTECTION_PROFILE)*
1442 wolfSSL_get_srtp_profiles(WOLFSSL* ssl);
1443
1444 /* Non standard API for getting the SRTP session keys using KDF */
1445 WOLFSSL_API int wolfSSL_export_dtls_srtp_keying_material(WOLFSSL* ssl,
1446 unsigned char*, size_t*);
1447 #endif /* WOLFSSL_SRTP */
1448
1449 WOLFSSL_API int wolfSSL_dtls_get_drop_stats(WOLFSSL* ssl,
1450 unsigned int*, unsigned int*);
1451 WOLFSSL_API int wolfSSL_CTX_mcast_set_member_id(WOLFSSL_CTX* ctx, unsigned short id);
1452 WOLFSSL_API int wolfSSL_set_secret(WOLFSSL* ssl, unsigned short epoch,
1453 const unsigned char* preMasterSecret, unsigned int preMasterSz,
1454 const unsigned char* clientRandom, const unsigned char* serverRandom,
1455 const unsigned char* suite);
1456 WOLFSSL_API int wolfSSL_mcast_read(WOLFSSL* ssl, unsigned short* id, void* data, int sz);
1457 WOLFSSL_API int wolfSSL_mcast_peer_add(WOLFSSL* ssl, unsigned short peerId, int sub);
1458 WOLFSSL_API int wolfSSL_mcast_peer_known(WOLFSSL* ssl, unsigned short peerId);
1459 WOLFSSL_API int wolfSSL_mcast_get_max_peers(void);
1460 typedef int (*CallbackMcastHighwater)(unsigned short peerId,
1461 unsigned int maxSeq,
1462 unsigned int curSeq, void* ctx);
1463 WOLFSSL_API int wolfSSL_CTX_mcast_set_highwater_cb(WOLFSSL_CTX* ctx,
1464 unsigned int maxSeq,
1465 unsigned int first,
1466 unsigned int second,
1467 CallbackMcastHighwater cb);
1468 WOLFSSL_API int wolfSSL_mcast_set_highwater_ctx(WOLFSSL* ssl, void* ctx);
1469
1470 WOLFSSL_API intwolfSSL_ERR_GET_LIB(unsigned long err);
1471 WOLFSSL_API intwolfSSL_ERR_GET_REASON(unsigned long err);
1472 WOLFSSL_API char*
wolfSSL_ERR_error_string(unsigned long errNumber,char* data);
1473 WOLFSSL_API void
wolfSSL_ERR_error_string_n(unsigned long e, char* buf,
1474 unsigned long sz);
1475 WOLFSSL_API const char* wolfSSL_ERR_reason_error_string(unsigned long e);
1476 WOLFSSL_API const char* wolfSSL_ERR_func_error_string(unsigned long e);
1477 WOLFSSL_API const char* wolfSSL_ERR_lib_error_string(unsigned long e);
1478
1479 /* extras */
1480
1481 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_new_node(void* heap);
1482 WOLFSSL_API void wolfSSL_sk_free(WOLFSSL_STACK* sk);
1483 WOLFSSL_API void wolfSSL_sk_free_node(WOLFSSL_STACK* in);
1484 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_dup(WOLFSSL_STACK* sk);
1485 WOLFSSL_API int wolfSSL_sk_push_node(WOLFSSL_STACK** stack, WOLFSSL_STACK* in);
1486 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_get_node(WOLFSSL_STACK* sk, int idx);
1487 WOLFSSL_API int wolfSSL_sk_push(WOLFSSL_STACK *st, const void *data);
1488
1489 #if defined(HAVE_OCSP) || defined(HAVE_CRL)
1490 #include "wolfssl/wolfcrypt/asn.h"
1491 #endif
1492
1493 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(WOLFSSL_QT)
1494 WOLFSSL_API int wolfSSL_sk_ACCESS_DESCRIPTION_push(
1495 WOLF_STACK_OF(ACCESS_DESCRIPTION)* sk,
1496 WOLFSSL_ACCESS_DESCRIPTION* a);
1497 #endif /* defined(OPENSSL_ALL) || OPENSSL_EXTRA || defined(WOLFSSL_QT) */
1498
1499 typedef WOLF_STACK_OF(WOLFSSL_GENERAL_NAME) WOLFSSL_GENERAL_NAMES;
1500 typedef WOLF_STACK_OF(WOLFSSL_DIST_POINT) WOLFSSL_DIST_POINTS;
1501
1502 WOLFSSL_API int wolfSSL_sk_X509_push(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk,
1503 WOLFSSL_X509* x509);
1504 WOLFSSL_API WOLFSSL_X509* wolfSSL_sk_X509_pop(WOLF_STACK_OF(WOLFSSL_X509)* sk);
1505 WOLFSSL_API void wolfSSL_sk_X509_free(WOLF_STACK_OF(WOLFSSL_X509)* sk);
1506
1507 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_X509_CRL_new(void);
1508 WOLFSSL_API void wolfSSL_sk_X509_CRL_pop_free(WOLF_STACK_OF(WOLFSSL_X509_CRL)* sk,

NetBurner, Inc.
1048 File Documentation

1509 void (*f) (WOLFSSL_X509_CRL*));


1510 WOLFSSL_API void wolfSSL_sk_X509_CRL_free(WOLF_STACK_OF(WOLFSSL_X509_CRL)* sk);
1511 WOLFSSL_API int wolfSSL_sk_X509_CRL_push(WOLF_STACK_OF(WOLFSSL_X509_CRL)* sk,
1512 WOLFSSL_X509_CRL* crl);
1513 WOLFSSL_API WOLFSSL_X509_CRL* wolfSSL_sk_X509_CRL_value(
1514 WOLF_STACK_OF(WOLFSSL_X509)* sk, int i);
1515 WOLFSSL_API int wolfSSL_sk_X509_CRL_num(WOLF_STACK_OF(WOLFSSL_X509)* sk);
1516
1517 WOLFSSL_API WOLFSSL_GENERAL_NAME* wolfSSL_GENERAL_NAME_new(void);
1518 WOLFSSL_API void wolfSSL_GENERAL_NAME_free(WOLFSSL_GENERAL_NAME* gn);
1519 WOLFSSL_API WOLFSSL_GENERAL_NAME* wolfSSL_GENERAL_NAME_dup(
1520 WOLFSSL_GENERAL_NAME* gn);
1521 WOLFSSL_API int wolfSSL_GENERAL_NAME_set_type(WOLFSSL_GENERAL_NAME* name,
1522 int typ);
1523 WOLFSSL_API WOLFSSL_GENERAL_NAMES* wolfSSL_GENERAL_NAMES_dup(
1524 WOLFSSL_GENERAL_NAMES* gns);
1525 WOLFSSL_API int wolfSSL_sk_GENERAL_NAME_push(WOLFSSL_GENERAL_NAMES* sk,
1526 WOLFSSL_GENERAL_NAME* gn);
1527 WOLFSSL_API WOLFSSL_GENERAL_NAME* wolfSSL_sk_GENERAL_NAME_value(
1528 WOLFSSL_STACK* sk, int i);
1529 WOLFSSL_API int wolfSSL_sk_GENERAL_NAME_num(WOLFSSL_STACK* sk);
1530 WOLFSSL_API void wolfSSL_sk_GENERAL_NAME_pop_free(WOLFSSL_STACK* sk,
1531 void (*f) (WOLFSSL_GENERAL_NAME*));
1532 WOLFSSL_API void wolfSSL_sk_GENERAL_NAME_free(WOLFSSL_STACK* sk);
1533 WOLFSSL_API void wolfSSL_GENERAL_NAMES_free(WOLFSSL_GENERAL_NAMES* name);
1534 WOLFSSL_API int wolfSSL_GENERAL_NAME_print(WOLFSSL_BIO* out,
1535 WOLFSSL_GENERAL_NAME* name);
1536
1537 WOLFSSL_API WOLFSSL_DIST_POINT* wolfSSL_DIST_POINT_new(void);
1538 WOLFSSL_API void wolfSSL_DIST_POINT_free(WOLFSSL_DIST_POINT* dp);
1539 WOLFSSL_API int wolfSSL_sk_DIST_POINT_push(WOLFSSL_DIST_POINTS* sk,
1540 WOLFSSL_DIST_POINT* dp);
1541 WOLFSSL_API WOLFSSL_DIST_POINT* wolfSSL_sk_DIST_POINT_value(
1542 WOLFSSL_STACK* sk, int i);
1543 WOLFSSL_API int wolfSSL_sk_DIST_POINT_num(WOLFSSL_STACK* sk);
1544 WOLFSSL_API void wolfSSL_sk_DIST_POINT_pop_free(WOLFSSL_STACK* sk,
1545 void (*f) (WOLFSSL_DIST_POINT*));
1546 WOLFSSL_API void wolfSSL_sk_DIST_POINT_free(WOLFSSL_STACK* sk);
1547 WOLFSSL_API void wolfSSL_DIST_POINTS_free(WOLFSSL_DIST_POINTS* dp);
1548
1549 WOLFSSL_API int wolfSSL_sk_ACCESS_DESCRIPTION_num(WOLFSSL_STACK* sk);
1550 WOLFSSL_API void wolfSSL_AUTHORITY_INFO_ACCESS_free(
1551 WOLF_STACK_OF(WOLFSSL_ACCESS_DESCRIPTION)* sk);
1552 WOLFSSL_API void wolfSSL_AUTHORITY_INFO_ACCESS_pop_free(
1553 WOLF_STACK_OF(WOLFSSL_ACCESS_DESCRIPTION)* sk,
1554 void (*f) (WOLFSSL_ACCESS_DESCRIPTION*));
1555 WOLFSSL_API WOLFSSL_ACCESS_DESCRIPTION* wolfSSL_sk_ACCESS_DESCRIPTION_value(
1556 WOLFSSL_STACK* sk, int idx);
1557 WOLFSSL_API void wolfSSL_sk_ACCESS_DESCRIPTION_free(WOLFSSL_STACK* sk);
1558 WOLFSSL_API void wolfSSL_sk_ACCESS_DESCRIPTION_pop_free(WOLFSSL_STACK* sk,
1559 void (*f) (WOLFSSL_ACCESS_DESCRIPTION*));
1560 WOLFSSL_API void wolfSSL_ACCESS_DESCRIPTION_free(WOLFSSL_ACCESS_DESCRIPTION* a);
1561 WOLFSSL_API void wolfSSL_sk_X509_EXTENSION_pop_free(
1562 WOLF_STACK_OF(WOLFSSL_X509_EXTENSION)* sk,
1563 void (*f) (WOLFSSL_X509_EXTENSION*));
1564 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_EXTENSION)* wolfSSL_sk_X509_EXTENSION_new_null(void);
1565 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_ASN1_OBJECT_new(void);
1566 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_ASN1_OBJECT_dup(WOLFSSL_ASN1_OBJECT* obj);
1567 WOLFSSL_API void wolfSSL_ASN1_OBJECT_free(WOLFSSL_ASN1_OBJECT* obj);
1568 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_new_asn1_obj(void);
1569 WOLFSSL_API int wolfSSL_sk_ASN1_OBJECT_push(WOLF_STACK_OF(WOLFSSL_ASN1_OBJEXT)* sk,
1570 WOLFSSL_ASN1_OBJECT* obj);
1571 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_sk_ASN1_OBJECT_pop(
1572 WOLF_STACK_OF(WOLFSSL_ASN1_OBJECT)* sk);
1573 WOLFSSL_API void wolfSSL_sk_ASN1_OBJECT_free(WOLF_STACK_OF(WOLFSSL_ASN1_OBJECT)* sk);
1574 WOLFSSL_API void wolfSSL_sk_ASN1_OBJECT_pop_free(
1575 WOLF_STACK_OF(WOLFSSL_ASN1_OBJECT)* sk,
1576 void (*f)(WOLFSSL_ASN1_OBJECT*));
1577 WOLFSSL_API int wolfSSL_ASN1_STRING_to_UTF8(unsigned char **out, WOLFSSL_ASN1_STRING *in);
1578 WOLFSSL_API int wolfSSL_ASN1_UNIVERSALSTRING_to_string(WOLFSSL_ASN1_STRING *s);
1579 WOLFSSL_API int wolfSSL_sk_X509_EXTENSION_num(WOLF_STACK_OF(WOLFSSL_X509_EXTENSION)* sk);
1580 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_sk_X509_EXTENSION_value(
1581 WOLF_STACK_OF(WOLFSSL_X509_EXTENSION)* sk, int idx);
1582 WOLFSSL_API int wolfSSL_set_ex_data(WOLFSSL* ssl, int idx, void* data);
1583 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
1584 WOLFSSL_API int wolfSSL_set_ex_data_with_cleanup(
1585 WOLFSSL* ssl,
1586 int idx,
1587 void* data,
1588 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
1589 #endif
1590 WOLFSSL_API int wolfSSL_get_shutdown(const WOLFSSL* ssl);
1591 WOLFSSL_API int wolfSSL_set_rfd(WOLFSSL* ssl, int rfd);
1592 WOLFSSL_API int wolfSSL_set_wfd(WOLFSSL* ssl, int wfd);
1593 WOLFSSL_API void wolfSSL_set_shutdown(WOLFSSL* ssl, int opt);
1594 WOLFSSL_API int wolfSSL_set_session_id_context(WOLFSSL* ssl, const unsigned char* id,
1595 unsigned int len);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1049

1596 WOLFSSL_API void wolfSSL_set_connect_state(WOLFSSL* ssl);


1597 WOLFSSL_API void wolfSSL_set_accept_state(WOLFSSL* ssl);
1598 WOLFSSL_API int wolfSSL_session_reused(WOLFSSL* ssl);
1599 WOLFSSL_API int wolfSSL_SESSION_up_ref(WOLFSSL_SESSION* session);
1600 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_dup(WOLFSSL_SESSION* session);
1601 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_new(void);
1602 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_SESSION_new_ex(void* heap);
1603 WOLFSSL_API void wolfSSL_SESSION_free(WOLFSSL_SESSION* session);
1604 WOLFSSL_API int wolfSSL_CTX_add_session(WOLFSSL_CTX* ctx,
1605 WOLFSSL_SESSION* session);
1606 WOLFSSL_API int wolfSSL_SESSION_set_cipher(WOLFSSL_SESSION* session,
1607 const WOLFSSL_CIPHER* cipher);
1608 WOLFSSL_API int wolfSSL_is_init_finished(WOLFSSL* ssl);
1609
1610 WOLFSSL_API const char* wolfSSL_get_version(const WOLFSSL* ssl);
1611 WOLFSSL_API int wolfSSL_get_current_cipher_suite(WOLFSSL* ssl);
1612 WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_get_current_cipher(WOLFSSL* ssl);
1613 WOLFSSL_API char* wolfSSL_CIPHER_description(const WOLFSSL_CIPHER* cipher, char* in, int len);
1614 WOLFSSL_API const char* wolfSSL_CIPHER_get_name(const WOLFSSL_CIPHER* cipher);
1615 WOLFSSL_API const char* wolfSSL_CIPHER_get_version(const WOLFSSL_CIPHER* cipher);
1616 WOLFSSL_API word32 wolfSSL_CIPHER_get_id(const WOLFSSL_CIPHER* cipher);
1617 WOLFSSL_API int wolfSSL_CIPHER_get_auth_nid(const WOLFSSL_CIPHER* cipher);
1618 WOLFSSL_API int wolfSSL_CIPHER_get_cipher_nid(const WOLFSSL_CIPHER* cipher);
1619 WOLFSSL_API int wolfSSL_CIPHER_get_digest_nid(const WOLFSSL_CIPHER* cipher);
1620 WOLFSSL_API int wolfSSL_CIPHER_get_kx_nid(const WOLFSSL_CIPHER* cipher);
1621 WOLFSSL_API int wolfSSL_CIPHER_is_aead(const WOLFSSL_CIPHER* cipher);
1622 WOLFSSL_API const WOLFSSL_CIPHER* wolfSSL_get_cipher_by_value(word16 value);
1623 WOLFSSL_API const char* wolfSSL_SESSION_CIPHER_get_name(const WOLFSSL_SESSION* session);
1624 WOLFSSL_API const char* wolfSSL_get_cipher(WOLFSSL* ssl);
1625 WOLFSSL_API void wolfSSL_sk_CIPHER_free(WOLF_STACK_OF(WOLFSSL_CIPHER)* sk);
1626 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get1_session(WOLFSSL* ssl);
1627
1628 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_new(void);
1629 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_dup(WOLFSSL_X509* x);
1630 #if defined(OPENSSL_EXTRA_X509_SMALL) || defined(OPENSSL_EXTRA)
1631 WOLFSSL_API int wolfSSL_RSA_up_ref(WOLFSSL_RSA* rsa);
1632 WOLFSSL_API int wolfSSL_X509_up_ref(WOLFSSL_X509* x509);
1633 WOLFSSL_API int wolfSSL_EVP_PKEY_up_ref(WOLFSSL_EVP_PKEY* pkey);
1634 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)*
1635 wolfSSL_X509_chain_up_ref(WOLF_STACK_OF(WOLFSSL_X509)* chain);
1636 #endif
1637
1638 WOLFSSL_API int wolfSSL_OCSP_parse_url(char* url, char** host, char** port,
1639 char** path, int* ssl);
1640
1641 #ifndef NO_BIO
1642 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
1643 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new(const WOLFSSL_BIO_METHOD* method);
1644 #else
1645 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new(WOLFSSL_BIO_METHOD*);
1646 #endif
1647 WOLFSSL_API int wolfSSL_BIO_free(WOLFSSL_BIO* bio);
1648 WOLFSSL_API void wolfSSL_BIO_vfree(WOLFSSL_BIO* bio);
1649 WOLFSSL_API void wolfSSL_BIO_free_all(WOLFSSL_BIO* bio);
1650 WOLFSSL_API int wolfSSL_BIO_gets(WOLFSSL_BIO* bio, char* buf, int sz);
1651 WOLFSSL_API int wolfSSL_BIO_puts(WOLFSSL_BIO* bio, const char* buf);
1652 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_next(WOLFSSL_BIO* bio);
1653 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_find_type(WOLFSSL_BIO* bio, int type);
1654 WOLFSSL_API int wolfSSL_BIO_read(WOLFSSL_BIO* bio, void* buf, int len);
1655 WOLFSSL_API int wolfSSL_BIO_write(WOLFSSL_BIO* bio, const void* data, int len);
1656 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_push(WOLFSSL_BIO* top, WOLFSSL_BIO* append);
1657 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_pop(WOLFSSL_BIO* bio);
1658 WOLFSSL_API int wolfSSL_BIO_flush(WOLFSSL_BIO* bio);
1659 WOLFSSL_API int wolfSSL_BIO_pending(WOLFSSL_BIO* bio);
1660 WOLFSSL_API void wolfSSL_BIO_set_callback(WOLFSSL_BIO *bio,
1661 wolf_bio_info_cb callback_func);
1662 WOLFSSL_API wolf_bio_info_cb wolfSSL_BIO_get_callback(WOLFSSL_BIO *bio);
1663 WOLFSSL_API void wolfSSL_BIO_set_callback_arg(WOLFSSL_BIO *bio, char *arg);
1664 WOLFSSL_API char* wolfSSL_BIO_get_callback_arg(const WOLFSSL_BIO *bio);
1665
1666 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_md(void);
1667 WOLFSSL_API int wolfSSL_BIO_get_md_ctx(WOLFSSL_BIO *bio,
1668 WOLFSSL_EVP_MD_CTX **mdcp);
1669
1670 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_buffer(void);
1671 WOLFSSL_API long wolfSSL_BIO_set_write_buffer_size(WOLFSSL_BIO* bio, long size);
1672 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_ssl(void);
1673 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_socket(int sfd, int flag);
1674 WOLFSSL_API int wolfSSL_BIO_eof(WOLFSSL_BIO* b);
1675
1676 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_s_mem(void);
1677 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_base64(void);
1678 WOLFSSL_API void wolfSSL_BIO_set_flags(WOLFSSL_BIO* bio, int flags);
1679 WOLFSSL_API void wolfSSL_BIO_clear_flags(WOLFSSL_BIO *bio, int flags);
1680 WOLFSSL_API int wolfSSL_BIO_get_fd(WOLFSSL_BIO *bio, int* fd);
1681 WOLFSSL_API int wolfSSL_BIO_set_ex_data(WOLFSSL_BIO *bio, int idx, void *data);
1682 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS

NetBurner, Inc.
1050 File Documentation

1683 WOLFSSL_API int wolfSSL_BIO_set_ex_data_with_cleanup(


1684 WOLFSSL_BIO *bio,
1685 int idx,
1686 void *data,
1687 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
1688 #endif
1689 WOLFSSL_API void *wolfSSL_BIO_get_ex_data(WOLFSSL_BIO *bio, int idx);
1690 WOLFSSL_API long wolfSSL_BIO_set_nbio(WOLFSSL_BIO* bio, long on);
1691
1692 WOLFSSL_API int wolfSSL_BIO_get_mem_data(WOLFSSL_BIO* bio,void* p);
1693
1694 WOLFSSL_API void wolfSSL_BIO_set_init(WOLFSSL_BIO* bio, int init);
1695 WOLFSSL_API void wolfSSL_BIO_set_data(WOLFSSL_BIO* bio, void* ptr);
1696 WOLFSSL_API void* wolfSSL_BIO_get_data(WOLFSSL_BIO* bio);
1697 WOLFSSL_API void wolfSSL_BIO_set_shutdown(WOLFSSL_BIO* bio, int shut);
1698 WOLFSSL_API int wolfSSL_BIO_get_shutdown(WOLFSSL_BIO* bio);
1699 WOLFSSL_API void wolfSSL_BIO_clear_retry_flags(WOLFSSL_BIO* bio);
1700 WOLFSSL_API int wolfSSL_BIO_should_retry(WOLFSSL_BIO *bio);
1701
1702 WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_meth_new(int type, const char* name);
1703 WOLFSSL_API void wolfSSL_BIO_meth_free(WOLFSSL_BIO_METHOD* biom);
1704 WOLFSSL_API int wolfSSL_BIO_meth_set_write(WOLFSSL_BIO_METHOD* biom, wolfSSL_BIO_meth_write_cb
biom_write);
1705 WOLFSSL_API int wolfSSL_BIO_meth_set_read(WOLFSSL_BIO_METHOD* biom, wolfSSL_BIO_meth_read_cb
biom_read);
1706 WOLFSSL_API int wolfSSL_BIO_meth_set_puts(WOLFSSL_BIO_METHOD* biom, wolfSSL_BIO_meth_puts_cb
biom_puts);
1707 WOLFSSL_API int wolfSSL_BIO_meth_set_gets(WOLFSSL_BIO_METHOD* biom, wolfSSL_BIO_meth_gets_cb
biom_gets);
1708 WOLFSSL_API int wolfSSL_BIO_meth_set_ctrl(WOLFSSL_BIO_METHOD* biom, wolfSSL_BIO_meth_ctrl_get_cb
biom_ctrl);
1709 WOLFSSL_API int wolfSSL_BIO_meth_set_create(WOLFSSL_BIO_METHOD* biom, wolfSSL_BIO_meth_create_cb
biom_create);
1710 WOLFSSL_API int wolfSSL_BIO_meth_set_destroy(WOLFSSL_BIO_METHOD* biom, wolfSSL_BIO_meth_destroy_cb
biom_destroy);
1711 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_mem_buf(const void* buf, int len);
1712
1713 WOLFSSL_API long wolfSSL_BIO_set_ssl(WOLFSSL_BIO* b, WOLFSSL* ssl, int flag);
1714 WOLFSSL_API long wolfSSL_BIO_get_ssl(WOLFSSL_BIO* bio, WOLFSSL** ssl);
1715 #ifndef NO_FILESYSTEM
1716 WOLFSSL_API long wolfSSL_BIO_set_fd(WOLFSSL_BIO* b, int fd, int flag);
1717 #endif
1718 WOLFSSL_API int wolfSSL_BIO_set_close(WOLFSSL_BIO *b, long flag);
1719 WOLFSSL_API void wolfSSL_set_bio(WOLFSSL* ssl, WOLFSSL_BIO* rd, WOLFSSL_BIO* wr);
1720 WOLFSSL_API int wolfSSL_BIO_method_type(const WOLFSSL_BIO *b);
1721
1722 #ifndef NO_FILESYSTEM
1723 WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_file(void);
1724 WOLFSSL_API WOLFSSL_BIO *wolfSSL_BIO_new_fd(int fd, int close_flag);
1725 #endif
1726
1727 WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_bio(void);
1728 WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_socket(void);
1729
1730 WOLFSSL_API WOLFSSL_BIO *wolfSSL_BIO_new_connect(const char *str);
1731 WOLFSSL_API WOLFSSL_BIO *wolfSSL_BIO_new_accept(const char *port);
1732 WOLFSSL_API long wolfSSL_BIO_set_conn_hostname(WOLFSSL_BIO* b, char* name);
1733 WOLFSSL_API long wolfSSL_BIO_set_conn_port(WOLFSSL_BIO *b, char* port);
1734 WOLFSSL_API long wolfSSL_BIO_do_connect(WOLFSSL_BIO *b);
1735 WOLFSSL_API int wolfSSL_BIO_do_accept(WOLFSSL_BIO *b);
1736 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_ssl_connect(WOLFSSL_CTX* ctx);
1737
1738 WOLFSSL_API long wolfSSL_BIO_do_handshake(WOLFSSL_BIO *b);
1739 WOLFSSL_API void wolfSSL_BIO_ssl_shutdown(WOLFSSL_BIO* b);
1740
1741 WOLFSSL_API long wolfSSL_BIO_ctrl(WOLFSSL_BIO *bp, int cmd, long larg, void *parg);
1742 WOLFSSL_API long wolfSSL_BIO_int_ctrl(WOLFSSL_BIO *bp, int cmd, long larg, int iarg);
1743
1744 WOLFSSL_API int wolfSSL_BIO_set_write_buf_size(WOLFSSL_BIO *b, long size);
1745 WOLFSSL_API int wolfSSL_BIO_make_bio_pair(WOLFSSL_BIO *b1, WOLFSSL_BIO *b2);
1746 WOLFSSL_API int wolfSSL_BIO_up_ref(WOLFSSL_BIO *b);
1747 WOLFSSL_API int wolfSSL_BIO_ctrl_reset_read_request(WOLFSSL_BIO *b);
1748 WOLFSSL_API int wolfSSL_BIO_nread0(WOLFSSL_BIO *bio, char **buf);
1749 WOLFSSL_API int wolfSSL_BIO_nread(WOLFSSL_BIO *bio, char **buf, int num);
1750 WOLFSSL_API int wolfSSL_BIO_nwrite(WOLFSSL_BIO *bio, char **buf, int num);
1751 WOLFSSL_API int wolfSSL_BIO_reset(WOLFSSL_BIO *bio);
1752
1753 WOLFSSL_API int wolfSSL_BIO_seek(WOLFSSL_BIO *bio, int ofs);
1754 WOLFSSL_API int wolfSSL_BIO_tell(WOLFSSL_BIO* bio);
1755 WOLFSSL_API int wolfSSL_BIO_write_filename(WOLFSSL_BIO *bio, char *name);
1756 WOLFSSL_API long wolfSSL_BIO_set_mem_eof_return(WOLFSSL_BIO *bio, int v);
1757 WOLFSSL_API long wolfSSL_BIO_get_mem_ptr(WOLFSSL_BIO *bio, WOLFSSL_BUF_MEM **m);
1758 WOLFSSL_API int wolfSSL_BIO_get_len(WOLFSSL_BIO *bio);
1759 #endif
1760
1761 WOLFSSL_API void wolfSSL_RAND_screen(void);
1762 WOLFSSL_API const char* wolfSSL_RAND_file_name(char* fname, unsigned long len);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1051

1763 WOLFSSL_API int wolfSSL_RAND_write_file(const char* fname);


1764 WOLFSSL_API int wolfSSL_RAND_load_file(const char* fname, long len);
1765 WOLFSSL_API int wolfSSL_RAND_egd(const char* nm);
1766 WOLFSSL_API int wolfSSL_RAND_seed(const void* seed, int len);
1767 WOLFSSL_API void wolfSSL_RAND_Cleanup(void);
1768 WOLFSSL_API void wolfSSL_RAND_add(const void* add, int len, double entropy);
1769 WOLFSSL_API int wolfSSL_RAND_poll(void);
1770
1771 WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_zlib(void);
1772 WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_rle(void);
1773 WOLFSSL_API int wolfSSL_COMP_add_compression_method(int method, void* data);
1774
1775 WOLFSSL_API unsigned long wolfSSL_thread_id(void);
1776 WOLFSSL_API void wolfSSL_set_id_callback(unsigned long (*f)(void));
1777 WOLFSSL_API void wolfSSL_set_locking_callback(void (*f)(int, int, const char*,
1778 int));
1779 WOLFSSL_API void wolfSSL_set_dynlock_create_callback(WOLFSSL_dynlock_value* (*f)
1780 (const char*, int));
1781 WOLFSSL_API void wolfSSL_set_dynlock_lock_callback(void (*f)(int,
1782 WOLFSSL_dynlock_value*, const char*, int));
1783 WOLFSSL_API void wolfSSL_set_dynlock_destroy_callback(void (*f)
1784 (WOLFSSL_dynlock_value*, const char*, int));
1785 WOLFSSL_API int wolfSSL_num_locks(void);
1786
1787 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_STORE_CTX_get_current_cert(
1788 WOLFSSL_X509_STORE_CTX* ctx);
1789 WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error(WOLFSSL_X509_STORE_CTX* ctx);
1790 WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error_depth(WOLFSSL_X509_STORE_CTX* ctx);
1791
1792 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_verify_cb(WOLFSSL_X509_STORE_CTX *ctx,
1793 WOLFSSL_X509_STORE_CTX_verify_cb verify_cb);
1794 WOLFSSL_API void wolfSSL_X509_STORE_set_verify_cb(WOLFSSL_X509_STORE *st,
1795 WOLFSSL_X509_STORE_CTX_verify_cb verify_cb);
1796 WOLFSSL_API int wolfSSL_i2d_X509_NAME(WOLFSSL_X509_NAME* n,
1797 unsigned char** out);
1798 WOLFSSL_API int wolfSSL_i2d_X509_NAME_canon(WOLFSSL_X509_NAME* name,
1799 unsigned char** out);
1800 WOLFSSL_API WOLFSSL_X509_NAME *wolfSSL_d2i_X509_NAME(WOLFSSL_X509_NAME **name,
1801 unsigned char **in, long length);
1802 #ifndef NO_RSA
1803 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
1804 WOLFSSL_API int wolfSSL_RSA_print_fp(XFILE fp, WOLFSSL_RSA* rsa, int indent);
1805 #endif /* !NO_FILESYSTEM && !NO_STDIO_FILESYSTEM */
1806 #ifndef NO_BIO
1807 WOLFSSL_API int wolfSSL_RSA_print(WOLFSSL_BIO* bio, WOLFSSL_RSA* rsa, int offset);
1808 #endif /* !NO_BIO */
1809 #endif /* !NO_RSA */
1810
1811 WOLFSSL_API int wolfSSL_X509_print_ex(WOLFSSL_BIO* bio, WOLFSSL_X509* x509,
1812 unsigned long nmflags, unsigned long cflag);
1813 #ifndef NO_FILESYSTEM
1814 WOLFSSL_API int wolfSSL_X509_print_fp(XFILE fp, WOLFSSL_X509 *x509);
1815 #endif
1816 WOLFSSL_API int wolfSSL_X509_signature_print(WOLFSSL_BIO *bp,
1817 const WOLFSSL_X509_ALGOR *sigalg, const WOLFSSL_ASN1_STRING *sig);
1818 WOLFSSL_API void wolfSSL_X509_get0_signature(const WOLFSSL_ASN1_BIT_STRING **psig,
1819 const WOLFSSL_X509_ALGOR **palg, const WOLFSSL_X509 *x509);
1820 WOLFSSL_API int wolfSSL_X509_print(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
1821 WOLFSSL_API int wolfSSL_X509_REQ_print(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
1822 WOLFSSL_ABI WOLFSSL_API char* wolfSSL_X509_NAME_oneline(WOLFSSL_X509_NAME* name,
1823 char* in, int sz);
1824 WOLFSSL_API unsigned long wolfSSL_X509_NAME_hash(WOLFSSL_X509_NAME* name);
1825 #if defined(OPENSSL_EXTRA) && defined(XSNPRINTF)
1826 WOLFSSL_API char* wolfSSL_X509_get_name_oneline(WOLFSSL_X509_NAME* name, char* in, int sz);
1827 #endif
1828 WOLFSSL_ABI WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_issuer_name(
1829 WOLFSSL_X509* cert);
1830 WOLFSSL_API unsigned long wolfSSL_X509_issuer_name_hash(const WOLFSSL_X509* x509);
1831 WOLFSSL_ABI WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_subject_name(
1832 WOLFSSL_X509* cert);
1833 WOLFSSL_API unsigned long wolfSSL_X509_subject_name_hash(const WOLFSSL_X509* x509);
1834 WOLFSSL_API int wolfSSL_X509_ext_isSet_by_NID(WOLFSSL_X509* x509, int nid);
1835 WOLFSSL_API int wolfSSL_X509_ext_get_critical_by_NID(WOLFSSL_X509* x509, int nid);
1836 WOLFSSL_API int wolfSSL_X509_EXTENSION_set_critical(WOLFSSL_X509_EXTENSION* ex, int crit);
1837 WOLFSSL_API int wolfSSL_X509_get_isCA(WOLFSSL_X509* x509);
1838 WOLFSSL_API int wolfSSL_X509_get_isSet_pathLength(WOLFSSL_X509* x509);
1839 WOLFSSL_API unsigned int wolfSSL_X509_get_pathLength(WOLFSSL_X509* x509);
1840 WOLFSSL_API unsigned int wolfSSL_X509_get_keyUsage(WOLFSSL_X509* x509);
1841 WOLFSSL_API unsigned char* wolfSSL_X509_get_authorityKeyID(
1842 WOLFSSL_X509* x509, unsigned char* dst, int* dstLen);
1843 WOLFSSL_API unsigned char* wolfSSL_X509_get_subjectKeyID(
1844 WOLFSSL_X509* x509, unsigned char* dst, int* dstLen);
1845
1846 WOLFSSL_API int wolfSSL_X509_verify(WOLFSSL_X509* x509, WOLFSSL_EVP_PKEY* pkey);
1847 #ifdef WOLFSSL_CERT_REQ
1848 WOLFSSL_API int wolfSSL_X509_REQ_verify(WOLFSSL_X509* x509, WOLFSSL_EVP_PKEY* pkey);
1849 #endif

NetBurner, Inc.
1052 File Documentation

1850 WOLFSSL_API int wolfSSL_X509_set_subject_name(WOLFSSL_X509* cert,


1851 WOLFSSL_X509_NAME* name);
1852 WOLFSSL_API int wolfSSL_X509_set_issuer_name(WOLFSSL_X509* cert,
1853 WOLFSSL_X509_NAME* name);
1854 WOLFSSL_API int wolfSSL_X509_set_pubkey(WOLFSSL_X509* cert, WOLFSSL_EVP_PKEY* pkey);
1855 WOLFSSL_API int wolfSSL_X509_set_notAfter(WOLFSSL_X509* x509,
1856 const WOLFSSL_ASN1_TIME* t);
1857 WOLFSSL_API int wolfSSL_X509_set_notBefore(WOLFSSL_X509* x509,
1858 const WOLFSSL_ASN1_TIME* t);
1859 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_get_notBefore(const WOLFSSL_X509* x509);
1860 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_get_notAfter(const WOLFSSL_X509* x509);
1861 WOLFSSL_API int wolfSSL_X509_set_serialNumber(WOLFSSL_X509* x509,
1862 WOLFSSL_ASN1_INTEGER* s);
1863 WOLFSSL_API int wolfSSL_X509_set_version(WOLFSSL_X509* x509, long v);
1864 WOLFSSL_API int wolfSSL_X509_sign(WOLFSSL_X509* x509, WOLFSSL_EVP_PKEY* pkey,
1865 const WOLFSSL_EVP_MD* md);
1866 WOLFSSL_API int wolfSSL_X509_sign_ctx(WOLFSSL_X509 *x509, WOLFSSL_EVP_MD_CTX *ctx);
1867
1868
1869 WOLFSSL_API int wolfSSL_X509_NAME_entry_count(WOLFSSL_X509_NAME* name);
1870 WOLFSSL_API int wolfSSL_X509_NAME_get_sz(WOLFSSL_X509_NAME* name);
1871 WOLFSSL_API int wolfSSL_X509_NAME_get_text_by_NID(
1872 WOLFSSL_X509_NAME* name, int nid, char* buf, int len);
1873 WOLFSSL_API int wolfSSL_X509_NAME_get_index_by_NID(
1874 WOLFSSL_X509_NAME* name, int nid, int pos);
1875 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_X509_NAME_ENTRY_get_data(WOLFSSL_X509_NAME_ENTRY* in);
1876
1877 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_ASN1_STRING_new(void);
1878 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_ASN1_STRING_dup(WOLFSSL_ASN1_STRING* asn1);
1879 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_ASN1_STRING_type_new(int type);
1880 WOLFSSL_API int wolfSSL_ASN1_STRING_type(const WOLFSSL_ASN1_STRING* asn1);
1881 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_d2i_DISPLAYTEXT(WOLFSSL_ASN1_STRING **asn, const unsigned char
**in, long len);
1882 WOLFSSL_API int wolfSSL_ASN1_STRING_cmp(const WOLFSSL_ASN1_STRING *a, const WOLFSSL_ASN1_STRING *b);
1883 WOLFSSL_API void wolfSSL_ASN1_STRING_free(WOLFSSL_ASN1_STRING* asn1);
1884 WOLFSSL_API int wolfSSL_ASN1_STRING_set(WOLFSSL_ASN1_STRING* asn1,
1885 const void* data, int dataSz);
1886 WOLFSSL_API unsigned char* wolfSSL_ASN1_STRING_data(WOLFSSL_ASN1_STRING* asn);
1887 WOLFSSL_API const unsigned char* wolfSSL_ASN1_STRING_get0_data(
1888 const WOLFSSL_ASN1_STRING* asn);
1889 WOLFSSL_API int wolfSSL_ASN1_STRING_length(WOLFSSL_ASN1_STRING* asn);
1890 WOLFSSL_API int wolfSSL_ASN1_STRING_copy(WOLFSSL_ASN1_STRING* dst,
1891 const WOLFSSL_ASN1_STRING* src);
1892 WOLFSSL_API int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX* ctx);
1893 WOLFSSL_API const char* wolfSSL_X509_verify_cert_error_string(long err);
1894 WOLFSSL_API int wolfSSL_X509_get_signature_type(WOLFSSL_X509* x509);
1895 WOLFSSL_API int wolfSSL_X509_get_signature(WOLFSSL_X509* x509, unsigned char* buf, int* bufSz);
1896 WOLFSSL_API int wolfSSL_X509_get_pubkey_buffer(WOLFSSL_X509* x509, unsigned char* buf,
1897 int* bufSz);
1898 WOLFSSL_API int wolfSSL_X509_get_pubkey_type(WOLFSSL_X509* x509);
1899
1900 WOLFSSL_API int wolfSSL_X509_LOOKUP_add_dir(WOLFSSL_X509_LOOKUP* lookup,const char* dir,long len);
1901 WOLFSSL_API int wolfSSL_X509_LOOKUP_load_file(WOLFSSL_X509_LOOKUP* lookup, const char* file,
1902 long type);
1903 WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_hash_dir(void);
1904 WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_file(void);
1905 WOLFSSL_API int wolfSSL_X509_LOOKUP_ctrl(WOLFSSL_X509_LOOKUP *ctx, int cmd,
1906 const char *argc, long argl, char **ret);
1907
1908 WOLFSSL_API WOLFSSL_X509_LOOKUP* wolfSSL_X509_STORE_add_lookup(WOLFSSL_X509_STORE* store,
1909 WOLFSSL_X509_LOOKUP_METHOD* m);
1910 WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_X509_STORE_new(void);
1911 WOLFSSL_API void wolfSSL_X509_STORE_free(WOLFSSL_X509_STORE* store);
1912 WOLFSSL_API int wolfSSL_X509_STORE_up_ref(WOLFSSL_X509_STORE* store);
1913 WOLFSSL_API int wolfSSL_X509_STORE_add_cert(
1914 WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509);
1915 WOLFSSL_API WOLFSSL_STACK* wolfSSL_X509_STORE_CTX_get_chain(
1916 WOLFSSL_X509_STORE_CTX* ctx);
1917 WOLFSSL_API WOLFSSL_STACK* wolfSSL_X509_STORE_CTX_get1_chain(
1918 WOLFSSL_X509_STORE_CTX* ctx);
1919 WOLFSSL_API WOLFSSL_X509_STORE_CTX *wolfSSL_X509_STORE_CTX_get0_parent_ctx(
1920 WOLFSSL_X509_STORE_CTX *ctx);
1921 WOLFSSL_API int wolfSSL_X509_STORE_set_flags(WOLFSSL_X509_STORE* store,
1922 unsigned long flag);
1923 WOLFSSL_API int wolfSSL_X509_STORE_set_default_paths(WOLFSSL_X509_STORE* store);
1924 WOLFSSL_API int wolfSSL_X509_STORE_get_by_subject(WOLFSSL_X509_STORE_CTX* ctx,
1925 int idx, WOLFSSL_X509_NAME* name, WOLFSSL_X509_OBJECT* obj);
1926 WOLFSSL_API WOLFSSL_X509_STORE_CTX* wolfSSL_X509_STORE_CTX_new(void);
1927 WOLFSSL_API int wolfSSL_X509_STORE_CTX_init(WOLFSSL_X509_STORE_CTX* ctx,
1928 WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509, WOLF_STACK_OF(WOLFSSL_X509)*);
1929 WOLFSSL_API void wolfSSL_X509_STORE_CTX_free(WOLFSSL_X509_STORE_CTX* ctx);
1930 WOLFSSL_API void wolfSSL_X509_STORE_CTX_cleanup(WOLFSSL_X509_STORE_CTX* ctx);
1931 WOLFSSL_API void wolfSSL_X509_STORE_CTX_trusted_stack(WOLFSSL_X509_STORE_CTX *ctx,
1932 WOLF_STACK_OF(WOLFSSL_X509) *sk);
1933
1934 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_lastUpdate(WOLFSSL_X509_CRL* crl);
1935 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_nextUpdate(WOLFSSL_X509_CRL* crl);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1053

1936
1937 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509* x509);
1938 WOLFSSL_API int wolfSSL_X509_CRL_verify(WOLFSSL_X509_CRL* crl, WOLFSSL_EVP_PKEY* pkey);
1939 WOLFSSL_API void wolfSSL_X509_OBJECT_free_contents(WOLFSSL_X509_OBJECT* obj);
1940 WOLFSSL_API WOLFSSL_PKCS8_PRIV_KEY_INFO* wolfSSL_d2i_PKCS8_PKEY_bio(
1941 WOLFSSL_BIO* bio, WOLFSSL_PKCS8_PRIV_KEY_INFO** pkey);
1942 WOLFSSL_API WOLFSSL_PKCS8_PRIV_KEY_INFO* wolfSSL_d2i_PKCS8_PKEY(
1943 WOLFSSL_PKCS8_PRIV_KEY_INFO** pkey, const unsigned char** keyBuf, long keyLen);
1944 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PUBKEY_bio(WOLFSSL_BIO* bio,
1945 WOLFSSL_EVP_PKEY** out);
1946 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PUBKEY(WOLFSSL_EVP_PKEY** key,
1947 const unsigned char** in, long inSz);
1948 WOLFSSL_API int wolfSSL_i2d_PUBKEY(const WOLFSSL_EVP_PKEY *key, unsigned char **der);
1949 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PublicKey(int type, WOLFSSL_EVP_PKEY** pkey,
1950 const unsigned char ** in, long inSz);
1951 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey(int type,
1952 WOLFSSL_EVP_PKEY** out, const unsigned char **in, long inSz);
1953 #ifdef WOLF_PRIVATE_KEY_ID
1954 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey_id(int type,
1955 WOLFSSL_EVP_PKEY** out, void* heap, int devId);
1956 #endif
1957 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey_EVP(WOLFSSL_EVP_PKEY** key,
1958 unsigned char** in, long inSz);
1959 WOLFSSL_API int wolfSSL_i2d_PrivateKey(const WOLFSSL_EVP_PKEY* key,
1960 unsigned char** der);
1961 WOLFSSL_API int wolfSSL_i2d_PublicKey(const WOLFSSL_EVP_PKEY* key,
1962 unsigned char** der);
1963 #if defined(OPENSSL_EXTRA) && !defined(WOLFCRYPT_ONLY)
1964 WOLFSSL_API int wolfSSL_EVP_PKEY_print_public(WOLFSSL_BIO* out,
1965 const WOLFSSL_EVP_PKEY* pkey,
1966 int indent, WOLFSSL_ASN1_PCTX* pctx);
1967 #endif /* OPENSSL_EXTRA && !WOLFCRYPT_ONLY */
1968 WOLFSSL_API int wolfSSL_X509_cmp_current_time(const WOLFSSL_ASN1_TIME* asnTime);
1969 #ifdef OPENSSL_EXTRA
1970 WOLFSSL_API int wolfSSL_X509_cmp_time(const WOLFSSL_ASN1_TIME* asnTime,
1971 time_t *cmpTime);
1972 WOLFSSL_API WOLFSSL_ASN1_TIME *wolfSSL_X509_time_adj_ex(WOLFSSL_ASN1_TIME *asnTime,
1973 int offset_day, long offset_sec, time_t *in_tm);
1974 WOLFSSL_API WOLFSSL_ASN1_TIME *wolfSSL_X509_time_adj(WOLFSSL_ASN1_TIME *asnTime,
1975 long offset_sec, time_t *in_tm);
1976 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_gmtime_adj(WOLFSSL_ASN1_TIME* s,
1977 long adj);
1978 WOLFSSL_API int wolfSSL_sk_X509_REVOKED_num(WOLFSSL_X509_REVOKED* revoked);
1979 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_time(WOLFSSL_X509_STORE_CTX* ctx,
1980 unsigned long flags,
1981 time_t t);
1982 WOLFSSL_API WOLFSSL_X509_VERIFY_PARAM* wolfSSL_X509_VERIFY_PARAM_new(void);
1983 WOLFSSL_API void wolfSSL_X509_VERIFY_PARAM_free(WOLFSSL_X509_VERIFY_PARAM *param);
1984 WOLFSSL_API int wolfSSL_X509_VERIFY_PARAM_set_flags(WOLFSSL_X509_VERIFY_PARAM *param,
1985 unsigned long flags);
1986 WOLFSSL_API int wolfSSL_X509_VERIFY_PARAM_get_flags(WOLFSSL_X509_VERIFY_PARAM *param);
1987 WOLFSSL_API int wolfSSL_X509_VERIFY_PARAM_clear_flags(WOLFSSL_X509_VERIFY_PARAM *param,
1988 unsigned long flags);
1989 WOLFSSL_API void wolfSSL_X509_VERIFY_PARAM_set_hostflags(
1990 WOLFSSL_X509_VERIFY_PARAM* param, unsigned int flags);
1991 WOLFSSL_API int wolfSSL_X509_VERIFY_PARAM_set1_host(WOLFSSL_X509_VERIFY_PARAM* pParam,
1992 const char* name,
1993 unsigned int nameSz);
1994 WOLFSSL_API int wolfSSL_X509_VERIFY_PARAM_set1_ip_asc(
1995 WOLFSSL_X509_VERIFY_PARAM *param, const char *ipasc);
1996 WOLFSSL_API int wolfSSL_X509_VERIFY_PARAM_set1_ip(
1997 WOLFSSL_X509_VERIFY_PARAM* param, const unsigned char* ip, size_t iplen);
1998 WOLFSSL_API int wolfSSL_X509_VERIFY_PARAM_set1(WOLFSSL_X509_VERIFY_PARAM* to,
1999 const WOLFSSL_X509_VERIFY_PARAM* from);
2000 WOLFSSL_API int wolfSSL_X509_load_crl_file(WOLFSSL_X509_LOOKUP *ctx,
2001 const char *file, int type);
2002 WOLFSSL_API int wolfSSL_X509_load_cert_crl_file(WOLFSSL_X509_LOOKUP *ctx,
2003 const char *file, int type);
2004 #endif
2005 WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_X509_CRL_get_REVOKED(WOLFSSL_X509_CRL* crl);
2006 WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_sk_X509_REVOKED_value(
2007 WOLFSSL_X509_REVOKED* revoked,int value);
2008 WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_X509_get_serialNumber(WOLFSSL_X509* x509);
2009 WOLFSSL_API void wolfSSL_ASN1_INTEGER_free(WOLFSSL_ASN1_INTEGER* in);
2010 WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_ASN1_INTEGER_new(void);
2011 WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_ASN1_INTEGER_dup(
2012 const WOLFSSL_ASN1_INTEGER* src);
2013 WOLFSSL_API int wolfSSL_ASN1_INTEGER_set(WOLFSSL_ASN1_INTEGER *a, long v);
2014 WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_d2i_ASN1_INTEGER(
2015 WOLFSSL_ASN1_INTEGER** a,
2016 const unsigned char** in,
2017 long inSz);
2018 WOLFSSL_API int wolfSSL_i2d_ASN1_INTEGER(WOLFSSL_ASN1_INTEGER* a,
2019 unsigned char** out);
2020
2021 WOLFSSL_API int wolfSSL_ASN1_TIME_print(WOLFSSL_BIO* bio, const WOLFSSL_ASN1_TIME* asnTime);
2022

NetBurner, Inc.
1054 File Documentation

2023 WOLFSSL_API char* wolfSSL_ASN1_TIME_to_string(WOLFSSL_ASN1_TIME* t,


2024 char* buf, int len);
2025 #ifndef NO_ASN_TIME
2026 WOLFSSL_API int wolfSSL_ASN1_TIME_to_tm(const WOLFSSL_ASN1_TIME* asnTime, struct tm* tm);
2027 #endif
2028 WOLFSSL_API int wolfSSL_ASN1_INTEGER_cmp(const WOLFSSL_ASN1_INTEGER* a,
2029 const WOLFSSL_ASN1_INTEGER* b);
2030 WOLFSSL_API long wolfSSL_ASN1_INTEGER_get(const WOLFSSL_ASN1_INTEGER* a);
2031
2032 #ifdef OPENSSL_EXTRA
2033 WOLFSSL_API WOLFSSL_BIGNUM *wolfSSL_ASN1_INTEGER_to_BN(const WOLFSSL_ASN1_INTEGER *ai,
2034 WOLFSSL_BIGNUM *bn);
2035 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_ASN1_TIME_adj(WOLFSSL_ASN1_TIME* s, time_t t,
2036 int offset_day, long offset_sec);
2037 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_ASN1_TIME_new(void);
2038 WOLFSSL_API void wolfSSL_ASN1_TIME_free(WOLFSSL_ASN1_TIME* t);
2039 #endif
2040
2041 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_load_client_CA_file(const char* fname);
2042 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_CTX_get_client_CA_list(
2043 const WOLFSSL_CTX *ctx);
2044 /* deprecated function name */
2045 #define wolfSSL_SSL_CTX_get_client_CA_list wolfSSL_CTX_get_client_CA_list
2046
2047 WOLFSSL_API void wolfSSL_CTX_set_client_CA_list(WOLFSSL_CTX* ctx,
2048 WOLF_STACK_OF(WOLFSSL_X509_NAME)*);
2049 WOLFSSL_API void wolfSSL_set_client_CA_list(WOLFSSL* ssl,
2050 WOLF_STACK_OF(WOLFSSL_X509_NAME)*);
2051 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_get_client_CA_list(
2052 const WOLFSSL* ssl);
2053
2054 typedef int (*client_cert_cb)(WOLFSSL *ssl, WOLFSSL_X509 **x509,
2055 WOLFSSL_EVP_PKEY **pkey);
2056 WOLFSSL_API void wolfSSL_CTX_set_client_cert_cb(WOLFSSL_CTX *ctx, client_cert_cb cb);
2057
2058 typedef int (*CertSetupCallback)(WOLFSSL* ssl, void*);
2059 WOLFSSL_API void wolfSSL_CTX_set_cert_cb(WOLFSSL_CTX* ctx,
2060 CertSetupCallback cb, void *arg);
2061 WOLFSSL_LOCAL int CertSetupCbWrapper(WOLFSSL* ssl);
2062
2063 WOLFSSL_API void* wolfSSL_X509_STORE_CTX_get_ex_data(
2064 WOLFSSL_X509_STORE_CTX* ctx, int idx);
2065 WOLFSSL_API int wolfSSL_X509_STORE_CTX_set_ex_data(WOLFSSL_X509_STORE_CTX* ctx,
2066 int idx, void *data);
2067 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
2068 WOLFSSL_API int wolfSSL_X509_STORE_CTX_set_ex_data_with_cleanup(
2069 WOLFSSL_X509_STORE_CTX* ctx,
2070 int idx,
2071 void *data,
2072 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
2073 #endif
2074 WOLFSSL_API void* wolfSSL_X509_STORE_get_ex_data(
2075 WOLFSSL_X509_STORE* store, int idx);
2076 WOLFSSL_API int wolfSSL_X509_STORE_set_ex_data(WOLFSSL_X509_STORE* store,
2077 int idx, void *data);
2078 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
2079 WOLFSSL_API int wolfSSL_X509_STORE_set_ex_data_with_cleanup(
2080 WOLFSSL_X509_STORE* store,
2081 int idx,
2082 void *data,
2083 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
2084 #endif
2085 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_depth(WOLFSSL_X509_STORE_CTX* ctx,
2086 int depth);
2087 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_STORE_CTX_get0_current_issuer(
2088 WOLFSSL_X509_STORE_CTX* ctx);
2089 WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_X509_STORE_CTX_get0_store(
2090 WOLFSSL_X509_STORE_CTX* ctx);
2091 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_STORE_CTX_get0_cert(
2092 WOLFSSL_X509_STORE_CTX* ctx);
2093 WOLFSSL_API int wolfSSL_get_ex_data_X509_STORE_CTX_idx(void);
2094 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_error(
2095 WOLFSSL_X509_STORE_CTX* ctx, int er);
2096 void wolfSSL_X509_STORE_CTX_set_error_depth(WOLFSSL_X509_STORE_CTX* ctx,
2097 int depth);
2098 WOLFSSL_API void* wolfSSL_get_ex_data(const WOLFSSL* ssl, int idx);
2099
2100 WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb_userdata(WOLFSSL_CTX* ctx,
2101 void* userdata);
2102 WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb(WOLFSSL_CTX* ctx,
2103 wc_pem_password_cb* cb);
2104 WOLFSSL_API wc_pem_password_cb* wolfSSL_CTX_get_default_passwd_cb(WOLFSSL_CTX* ctx);
2105 WOLFSSL_API void *wolfSSL_CTX_get_default_passwd_cb_userdata(WOLFSSL_CTX *ctx);
2106
2107 WOLFSSL_API void wolfSSL_CTX_set_info_callback(WOLFSSL_CTX* ctx,
2108 void (*f)(const WOLFSSL* ssl, int type, int val));
2109

NetBurner, Inc.
22.199 wolfssl/ssl.h 1055

2110 WOLFSSL_API unsigned long wolfSSL_ERR_peek_error(void);


2111 WOLFSSL_API int wolfSSL_GET_REASON(int);
2112
2113 WOLFSSL_API const char* wolfSSL_alert_type_string_long(int alertID);
2114 WOLFSSL_API const char* wolfSSL_alert_desc_string_long(int alertID);
2115 WOLFSSL_API const char* wolfSSL_state_string_long(const WOLFSSL* ssl);
2116
2117 WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_generate_key(int len, unsigned long e,
2118 void(*f)(int, int, void*), void* data);
2119 WOLFSSL_API WOLFSSL_RSA *wolfSSL_d2i_RSAPublicKey(WOLFSSL_RSA **r,
2120 const unsigned char **pp, long len);
2121 WOLFSSL_API WOLFSSL_RSA *wolfSSL_d2i_RSAPrivateKey(WOLFSSL_RSA** r,
2122 const unsigned char** derBuf, long derSz);
2123 WOLFSSL_API int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *r, unsigned char **pp);
2124 WOLFSSL_API int wolfSSL_i2d_RSAPrivateKey(WOLFSSL_RSA *r, unsigned char **pp);
2125 WOLFSSL_API void wolfSSL_CTX_set_tmp_rsa_callback(WOLFSSL_CTX* ctx,
2126 WOLFSSL_RSA *(*f)(WOLFSSL *, int, int));
2127
2128 WOLFSSL_API int wolfSSL_PEM_def_callback(char* name, int num, int w, void* key);
2129
2130 WOLFSSL_API long wolfSSL_CTX_sess_accept(WOLFSSL_CTX* ctx);
2131 WOLFSSL_API long wolfSSL_CTX_sess_connect(WOLFSSL_CTX* ctx);
2132 WOLFSSL_API long wolfSSL_CTX_sess_accept_good(WOLFSSL_CTX* ctx);
2133 WOLFSSL_API long wolfSSL_CTX_sess_connect_good(WOLFSSL_CTX* ctx);
2134 WOLFSSL_API long wolfSSL_CTX_sess_accept_renegotiate(WOLFSSL_CTX* ctx);
2135 WOLFSSL_API long wolfSSL_CTX_sess_connect_renegotiate(WOLFSSL_CTX* ctx);
2136 WOLFSSL_API long wolfSSL_CTX_sess_hits(WOLFSSL_CTX* ctx);
2137 WOLFSSL_API long wolfSSL_CTX_sess_cb_hits(WOLFSSL_CTX* ctx);
2138 WOLFSSL_API long wolfSSL_CTX_sess_cache_full(WOLFSSL_CTX* ctx);
2139 WOLFSSL_API long wolfSSL_CTX_sess_misses(WOLFSSL_CTX* ctx);
2140 WOLFSSL_API long wolfSSL_CTX_sess_timeouts(WOLFSSL_CTX* ctx);
2141 WOLFSSL_API long wolfSSL_CTX_sess_number(WOLFSSL_CTX* ctx);
2142
2143 WOLFSSL_API long wolfSSL_CTX_add_extra_chain_cert(WOLFSSL_CTX* ctx, WOLFSSL_X509* x509);
2144 WOLFSSL_API long wolfSSL_CTX_sess_set_cache_size(WOLFSSL_CTX* ctx, long sz);
2145 WOLFSSL_API long wolfSSL_CTX_sess_get_cache_size(WOLFSSL_CTX* ctx);
2146
2147 WOLFSSL_API long wolfSSL_CTX_get_session_cache_mode(WOLFSSL_CTX* ctx);
2148 WOLFSSL_API int wolfSSL_get_read_ahead(const WOLFSSL* ssl);
2149 WOLFSSL_API int wolfSSL_set_read_ahead(WOLFSSL* ssl, int v);
2150 WOLFSSL_API int wolfSSL_CTX_get_read_ahead(WOLFSSL_CTX* ctx);
2151 WOLFSSL_API int wolfSSL_CTX_set_read_ahead(WOLFSSL_CTX* ctx, int v);
2152 WOLFSSL_API long wolfSSL_CTX_set_tlsext_status_arg(WOLFSSL_CTX* ctx, void* arg);
2153 WOLFSSL_API long wolfSSL_CTX_set_tlsext_opaque_prf_input_callback_arg(
2154 WOLFSSL_CTX* ctx, void* arg);
2155 WOLFSSL_API int wolfSSL_CTX_add_client_CA(WOLFSSL_CTX* ctx, WOLFSSL_X509* x509);
2156 WOLFSSL_API int wolfSSL_CTX_set_srp_password(WOLFSSL_CTX* ctx, char* password);
2157 WOLFSSL_API int wolfSSL_CTX_set_srp_username(WOLFSSL_CTX* ctx, char* username);
2158 WOLFSSL_API int wolfSSL_CTX_set_srp_strength(WOLFSSL_CTX *ctx, int strength);
2159
2160 WOLFSSL_API char* wolfSSL_get_srp_username(WOLFSSL *ssl);
2161
2162 WOLFSSL_API long wolfSSL_set_options(WOLFSSL *s, long op);
2163 WOLFSSL_API long wolfSSL_get_options(const WOLFSSL *s);
2164 WOLFSSL_API long wolfSSL_clear_options(WOLFSSL *s, long op);
2165 WOLFSSL_API long wolfSSL_clear_num_renegotiations(WOLFSSL *s);
2166 WOLFSSL_API long wolfSSL_total_renegotiations(WOLFSSL *s);
2167 WOLFSSL_API long wolfSSL_num_renegotiations(WOLFSSL* s);
2168 WOLFSSL_API int wolfSSL_SSL_renegotiate_pending(WOLFSSL *s);
2169 WOLFSSL_API long wolfSSL_set_tmp_dh(WOLFSSL *s, WOLFSSL_DH *dh);
2170 WOLFSSL_API long wolfSSL_set_tlsext_debug_arg(WOLFSSL *s, void *arg);
2171 WOLFSSL_API long wolfSSL_set_tlsext_status_type(WOLFSSL *s, int type);
2172 WOLFSSL_API long wolfSSL_get_tlsext_status_type(WOLFSSL *s);
2173 WOLFSSL_API long wolfSSL_set_tlsext_status_exts(WOLFSSL *s, void *arg);
2174 WOLFSSL_API long wolfSSL_get_tlsext_status_ids(WOLFSSL *s, void *arg);
2175 WOLFSSL_API long wolfSSL_set_tlsext_status_ids(WOLFSSL *s, void *arg);
2176 WOLFSSL_API long wolfSSL_get_tlsext_status_ocsp_resp(WOLFSSL *s, unsigned char **resp);
2177 WOLFSSL_API long wolfSSL_set_tlsext_status_ocsp_resp(WOLFSSL *s, unsigned char *resp, int len);
2178 WOLFSSL_API int wolfSSL_set_tlsext_max_fragment_length
2179 (WOLFSSL *s, unsigned char mode);
2180 WOLFSSL_API int wolfSSL_CTX_set_tlsext_max_fragment_length
2181 (WOLFSSL_CTX *c, unsigned char mode);
2182 WOLFSSL_API void wolfSSL_CONF_modules_unload(int all);
2183 WOLFSSL_API char* wolfSSL_CONF_get1_default_config_file(void);
2184 WOLFSSL_API long wolfSSL_get_tlsext_status_exts(WOLFSSL *s, void *arg);
2185 WOLFSSL_API long wolfSSL_get_verify_result(const WOLFSSL *ssl);
2186
2187 #define WOLFSSL_DEFAULT_CIPHER_LIST "" /* default all */
2188
2189 /* These are bit-masks */
2190 enum {
2191 WOLFSSL_OCSP_URL_OVERRIDE = 1,
2192 WOLFSSL_OCSP_NO_NONCE = 2,
2193 WOLFSSL_OCSP_CHECKALL = 4,
2194
2195 WOLFSSL_CRL_CHECKALL = 1,
2196 WOLFSSL_CRL_CHECK = 2,

NetBurner, Inc.
1056 File Documentation

2197 };
2198
2199 /* Separated out from other enums because of size */
2200 enum {
2201 WOLFSSL_OP_MICROSOFT_SESS_ID_BUG = 0x00000001,
2202 WOLFSSL_OP_NETSCAPE_CHALLENGE_BUG = 0x00000002,
2203 WOLFSSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 0x00000004,
2204 WOLFSSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 0x00000008,
2205 WOLFSSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 0x00000010,
2206 WOLFSSL_OP_MSIE_SSLV2_RSA_PADDING = 0x00000020,
2207 WOLFSSL_OP_SSLEAY_080_CLIENT_DH_BUG = 0x00000040,
2208 WOLFSSL_OP_TLS_D5_BUG = 0x00000080,
2209 WOLFSSL_OP_TLS_BLOCK_PADDING_BUG = 0x00000100,
2210 WOLFSSL_OP_TLS_ROLLBACK_BUG = 0x00000200,
2211 WOLFSSL_OP_EPHEMERAL_RSA = 0x00000800,
2212 WOLFSSL_OP_NO_SSLv3 = 0x00001000,
2213 WOLFSSL_OP_NO_TLSv1 = 0x00002000,
2214 WOLFSSL_OP_PKCS1_CHECK_1 = 0x00004000,
2215 WOLFSSL_OP_PKCS1_CHECK_2 = 0x00008000,
2216 WOLFSSL_OP_NETSCAPE_CA_DN_BUG = 0x00010000,
2217 WOLFSSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 0x00020000,
2218 WOLFSSL_OP_SINGLE_DH_USE = 0x00040000,
2219 WOLFSSL_OP_NO_TICKET = 0x00080000,
2220 WOLFSSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 0x00100000,
2221 WOLFSSL_OP_NO_QUERY_MTU = 0x00200000,
2222 WOLFSSL_OP_COOKIE_EXCHANGE = 0x00400000,
2223 WOLFSSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 0x00800000,
2224 WOLFSSL_OP_SINGLE_ECDH_USE = 0x01000000,
2225 WOLFSSL_OP_CIPHER_SERVER_PREFERENCE = 0x02000000,
2226 WOLFSSL_OP_NO_TLSv1_1 = 0x04000000,
2227 WOLFSSL_OP_NO_TLSv1_2 = 0x08000000,
2228 WOLFSSL_OP_NO_COMPRESSION = 0x10000000,
2229 WOLFSSL_OP_NO_TLSv1_3 = 0x20000000,
2230 WOLFSSL_OP_NO_SSLv2 = 0x40000000,
2231 WOLFSSL_OP_ALL =
2232 (WOLFSSL_OP_MICROSOFT_SESS_ID_BUG
2233 | WOLFSSL_OP_NETSCAPE_CHALLENGE_BUG
2234 | WOLFSSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
2235 | WOLFSSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
2236 | WOLFSSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
2237 | WOLFSSL_OP_MSIE_SSLV2_RSA_PADDING
2238 | WOLFSSL_OP_SSLEAY_080_CLIENT_DH_BUG
2239 | WOLFSSL_OP_TLS_D5_BUG
2240 | WOLFSSL_OP_TLS_BLOCK_PADDING_BUG
2241 | WOLFSSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
2242 | WOLFSSL_OP_TLS_ROLLBACK_BUG),
2243 };
2244
2245 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
2246 defined(HAVE_WEBSERVER)
2247 /* for compatibility these must be macros */
2248
2249 #define SSL_OP_MICROSOFT_SESS_ID_BUG WOLFSSL_OP_MICROSOFT_SESS_ID_BUG
2250 #define SSL_OP_NETSCAPE_CHALLENGE_BUG WOLFSSL_OP_NETSCAPE_CHALLENGE_BUG
2251 #define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG WOLFSSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
2252 #define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG WOLFSSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
2253 #define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER WOLFSSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
2254 #define SSL_OP_MSIE_SSLV2_RSA_PADDING WOLFSSL_OP_MSIE_SSLV2_RSA_PADDING
2255 #define SSL_OP_SSLEAY_080_CLIENT_DH_BUG WOLFSSL_OP_SSLEAY_080_CLIENT_DH_BUG
2256 #define SSL_OP_TLS_D5_BUG WOLFSSL_OP_TLS_D5_BUG
2257 #define SSL_OP_TLS_BLOCK_PADDING_BUG WOLFSSL_OP_TLS_BLOCK_PADDING_BUG
2258 #define SSL_OP_TLS_ROLLBACK_BUG WOLFSSL_OP_TLS_ROLLBACK_BUG
2259 #define SSL_OP_EPHEMERAL_RSA WOLFSSL_OP_EPHEMERAL_RSA
2260 #define SSL_OP_PKCS1_CHECK_1 WOLFSSL_OP_PKCS1_CHECK_1
2261 #define SSL_OP_PKCS1_CHECK_2 WOLFSSL_OP_PKCS1_CHECK_2
2262 #define SSL_OP_NETSCAPE_CA_DN_BUG WOLFSSL_OP_NETSCAPE_CA_DN_BUG
2263 #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG WOLFSSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
2264 #define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS WOLFSSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
2265 #define SSL_OP_NO_QUERY_MTU WOLFSSL_OP_NO_QUERY_MTU
2266 #define SSL_OP_COOKIE_EXCHANGE WOLFSSL_OP_COOKIE_EXCHANGE
2267 #define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION \
2268 WOLFSSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
2269 #define SSL_OP_ALL WOLFSSL_OP_ALL
2270
2271 #define SSL_OP_NO_SSLv2 WOLFSSL_OP_NO_SSLv2
2272 #define SSL_OP_NO_SSLv3 WOLFSSL_OP_NO_SSLv3
2273 #define SSL_OP_NO_TLSv1 WOLFSSL_OP_NO_TLSv1
2274 #define SSL_OP_NO_TLSv1_1 WOLFSSL_OP_NO_TLSv1_1
2275 #define SSL_OP_NO_TLSv1_2 WOLFSSL_OP_NO_TLSv1_2
2276 #define SSL_OP_NO_COMPRESSION WOLFSSL_OP_NO_COMPRESSION
2277
2278 /* apache uses SSL_OP_NO_TLSv1_3 to determine if TLS 1.3 is enabled */
2279 #if !(!defined(WOLFSSL_TLS13) && defined(WOLFSSL_APACHE_HTTPD))
2280 #define SSL_OP_NO_TLSv1_3 WOLFSSL_OP_NO_TLSv1_3
2281 #endif
2282
2283 #ifdef HAVE_SESSION_TICKET

NetBurner, Inc.
22.199 wolfssl/ssl.h 1057

2284 #define SSL_OP_NO_TICKET WOLFSSL_OP_NO_TICKET


2285 #endif
2286
2287 #define SSL_OP_NO_SSL_MASK (SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | \
2288 SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 | SSL_OP_NO_TLSv1_3)
2289
2290
2291 #define SSL_NOTHING 1
2292 #define SSL_WRITING 2
2293 #define SSL_READING 3
2294
2295 enum {
2296 #ifdef HAVE_OCSP
2297 /* OCSP Flags */
2298 OCSP_NOCERTS = 1,
2299 OCSP_NOINTERN = 2,
2300 OCSP_NOSIGS = 4,
2301 OCSP_NOCHAIN = 8,
2302 OCSP_NOVERIFY = 16,
2303 OCSP_NOEXPLICIT = 32,
2304 OCSP_NOCASIGN = 64,
2305 OCSP_NODELEGATED = 128,
2306 OCSP_NOCHECKS = 256,
2307 OCSP_TRUSTOTHER = 512,
2308 OCSP_RESPID_KEY = 1024,
2309 OCSP_NOTIME = 2048,
2310
2311 /* OCSP Types */
2312 OCSP_CERTID = 2,
2313 OCSP_REQUEST = 4,
2314 OCSP_RESPONSE = 8,
2315 OCSP_BASICRESP = 16,
2316 #endif
2317
2318 ASN1_GENERALIZEDTIME = 4,
2319 SSL_MAX_SSL_SESSION_ID_LENGTH = 32,
2320
2321 SSL_ST_CONNECT = 0x1000,
2322 SSL_ST_ACCEPT = 0x2000,
2323 SSL_ST_MASK = 0x0FFF,
2324
2325 SSL_CB_LOOP = 0x01,
2326 SSL_CB_EXIT = 0x02,
2327 SSL_CB_READ = 0x04,
2328 SSL_CB_WRITE = 0x08,
2329 SSL_CB_HANDSHAKE_START = 0x10,
2330 SSL_CB_HANDSHAKE_DONE = 0x20,
2331 SSL_CB_ALERT = 0x4000,
2332 SSL_CB_READ_ALERT = (SSL_CB_ALERT | SSL_CB_READ),
2333 SSL_CB_WRITE_ALERT = (SSL_CB_ALERT | SSL_CB_WRITE),
2334 SSL_CB_ACCEPT_LOOP = (SSL_ST_ACCEPT | SSL_CB_LOOP),
2335 SSL_CB_ACCEPT_EXIT = (SSL_ST_ACCEPT | SSL_CB_EXIT),
2336 SSL_CB_CONNECT_LOOP = (SSL_ST_CONNECT | SSL_CB_LOOP),
2337 SSL_CB_CONNECT_EXIT = (SSL_ST_CONNECT | SSL_CB_EXIT),
2338 SSL_CB_MODE_READ = 1,
2339 SSL_CB_MODE_WRITE = 2,
2340
2341 SSL_MODE_ENABLE_PARTIAL_WRITE = 2,
2342 SSL_MODE_AUTO_RETRY = 3, /* wolfSSL default is to return WANT_{READ|WRITE}
2343 * to the user. This is set by default with
2344 * OPENSSL_COMPATIBLE_DEFAULTS. The macro
2345 * WOLFSSL_MODE_AUTO_RETRY_ATTEMPTS is used to
2346 * limit the possibility of an infinite retry loop
2347 */
2348 SSL_MODE_RELEASE_BUFFERS = -1, /* For libwebsockets build. No current use. */
2349
2350 X509_FILETYPE_PEM = 8,
2351
2352 /* Not all of these are actually used in wolfSSL. Some are included to
2353 * satisfy OpenSSL compatibility consumers to prevent compilation errors. */
2354 X509_V_OK = 0,
2355 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2,
2356 X509_V_ERR_UNABLE_TO_GET_CRL = 3,
2357 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4,
2358 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5,
2359 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6,
2360 X509_V_ERR_CERT_SIGNATURE_FAILURE = 7,
2361 X509_V_ERR_CRL_SIGNATURE_FAILURE = 8,
2362 X509_V_ERR_CERT_NOT_YET_VALID = 9,
2363 X509_V_ERR_CERT_HAS_EXPIRED = 10,
2364 X509_V_ERR_CRL_NOT_YET_VALID = 11,
2365 X509_V_ERR_CRL_HAS_EXPIRED = 12,
2366 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13,
2367 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14,
2368 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15,
2369 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16,
2370 X509_V_ERR_OUT_OF_MEM = 17,

NetBurner, Inc.
1058 File Documentation

2371 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18,


2372 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19,
2373 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20,
2374 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21,
2375 X509_V_ERR_CERT_CHAIN_TOO_LONG = 22,
2376 X509_V_ERR_CERT_REVOKED = 23,
2377 X509_V_ERR_INVALID_CA = 24,
2378 X509_V_ERR_PATH_LENGTH_EXCEEDED = 25,
2379 X509_V_ERR_INVALID_PURPOSE = 26,
2380 X509_V_ERR_CERT_UNTRUSTED = 27,
2381 X509_V_ERR_CERT_REJECTED = 28,
2382 X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29,
2383 X509_V_ERR_AKID_SKID_MISMATCH = 30,
2384 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = 31,
2385 X509_V_ERR_KEYUSAGE_NO_CERTSIGN = 32,
2386 X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER = 33,
2387 X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION = 34,
2388 X509_V_ERR_KEYUSAGE_NO_CRL_SIGN = 35,
2389 X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION = 36,
2390 X509_V_ERR_INVALID_NON_CA = 37,
2391 X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED = 38,
2392 X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 39,
2393 X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED = 40,
2394 X509_V_ERR_INVALID_EXTENSION = 41,
2395 X509_V_ERR_INVALID_POLICY_EXTENSION = 42,
2396 X509_V_ERR_NO_EXPLICIT_POLICY = 43,
2397 X509_V_ERR_DIFFERENT_CRL_SCOPE = 44,
2398 X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE = 45,
2399 X509_V_ERR_UNNESTED_RESOURCE = 46,
2400 X509_V_ERR_PERMITTED_VIOLATION = 47,
2401 X509_V_ERR_EXCLUDED_VIOLATION = 48,
2402 X509_V_ERR_SUBTREE_MINMAX = 49,
2403 X509_V_ERR_APPLICATION_VERIFICATION = 50,
2404 X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE = 51,
2405 X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX = 52,
2406 X509_V_ERR_UNSUPPORTED_NAME_SYNTAX = 53,
2407 X509_V_ERR_CRL_PATH_VALIDATION_ERROR = 54,
2408
2409 X509_R_CERT_ALREADY_IN_HASH_TABLE = 101,
2410
2411 CRYPTO_LOCK = 1,
2412 CRYPTO_NUM_LOCKS = 10,
2413
2414 ASN1_STRFLGS_ESC_MSB = 4
2415 };
2416 #endif
2417
2418 /* extras end */
2419
2420 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
2421 /* wolfSSL extension, provide last error from SSL_get_error
2422 since not using thread storage error queue */
2423 #ifdef FUSION_RTOS
2424 #include <fclstdio.h>
2425 #else
2426 #include <stdio.h>
2427 #endif
2428 WOLFSSL_API void wolfSSL_ERR_print_errors_fp(XFILE fp, int err);
2429 #if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
2430 WOLFSSL_API void wolfSSL_ERR_dump_errors_fp(XFILE fp);
2431 WOLFSSL_API void wolfSSL_ERR_print_errors_cb(int (*cb)(const char *str,
2432 size_t len, void *u), void *u);
2433 #endif
2434 #endif
2435 WOLFSSL_API void wolfSSL_ERR_print_errors(WOLFSSL_BIO *bio);
2436
2437
2438 #ifndef NO_OLD_SSL_NAMES
2439 #define SSL_ERROR_NONE WOLFSSL_ERROR_NONE
2440 #define SSL_FAILURE WOLFSSL_FAILURE
2441 #define SSL_SUCCESS WOLFSSL_SUCCESS
2442 #define SSL_SHUTDOWN_NOT_DONE WOLFSSL_SHUTDOWN_NOT_DONE
2443
2444 #define SSL_ALPN_NOT_FOUND WOLFSSL_ALPN_NOT_FOUND
2445 #define SSL_BAD_CERTTYPE WOLFSSL_BAD_CERTTYPE
2446 #define SSL_BAD_STAT WOLFSSL_BAD_STAT
2447 #define SSL_BAD_PATH WOLFSSL_BAD_PATH
2448 #define SSL_BAD_FILETYPE WOLFSSL_BAD_FILETYPE
2449 #define SSL_BAD_FILE WOLFSSL_BAD_FILE
2450 #define SSL_NOT_IMPLEMENTED WOLFSSL_NOT_IMPLEMENTED
2451 #define SSL_UNKNOWN WOLFSSL_UNKNOWN
2452 #define SSL_FATAL_ERROR WOLFSSL_FATAL_ERROR
2453
2454 #define SSL_FILETYPE_ASN1 WOLFSSL_FILETYPE_ASN1
2455 #define SSL_FILETYPE_PEM WOLFSSL_FILETYPE_PEM
2456 #define SSL_FILETYPE_DEFAULT WOLFSSL_FILETYPE_DEFAULT
2457

NetBurner, Inc.
22.199 wolfssl/ssl.h 1059

2458 #define SSL_VERIFY_NONE WOLFSSL_VERIFY_NONE


2459 #define SSL_VERIFY_PEER WOLFSSL_VERIFY_PEER
2460 #define SSL_VERIFY_FAIL_IF_NO_PEER_CERT WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT
2461 #define SSL_VERIFY_CLIENT_ONCE WOLFSSL_VERIFY_CLIENT_ONCE
2462 #define SSL_VERIFY_POST_HANDSHAKE WOLFSSL_VERIFY_POST_HANDSHAKE
2463 #define SSL_VERIFY_FAIL_EXCEPT_PSK WOLFSSL_VERIFY_FAIL_EXCEPT_PSK
2464
2465 #define SSL_SESS_CACHE_OFF WOLFSSL_SESS_CACHE_OFF
2466 #define SSL_SESS_CACHE_CLIENT WOLFSSL_SESS_CACHE_CLIENT
2467 #define SSL_SESS_CACHE_SERVER WOLFSSL_SESS_CACHE_SERVER
2468 #define SSL_SESS_CACHE_BOTH WOLFSSL_SESS_CACHE_BOTH
2469 #define SSL_SESS_CACHE_NO_AUTO_CLEAR WOLFSSL_SESS_CACHE_NO_AUTO_CLEAR
2470 #define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP WOLFSSL_SESS_CACHE_NO_INTERNAL_LOOKUP
2471 #define SSL_SESS_CACHE_NO_INTERNAL_STORE WOLFSSL_SESS_CACHE_NO_INTERNAL_STORE
2472 #define SSL_SESS_CACHE_NO_INTERNAL WOLFSSL_SESS_CACHE_NO_INTERNAL
2473
2474 #define SSL_ERROR_WANT_READ WOLFSSL_ERROR_WANT_READ
2475 #define SSL_ERROR_WANT_WRITE WOLFSSL_ERROR_WANT_WRITE
2476 #define SSL_ERROR_WANT_CONNECT WOLFSSL_ERROR_WANT_CONNECT
2477 #define SSL_ERROR_WANT_ACCEPT WOLFSSL_ERROR_WANT_ACCEPT
2478 #define SSL_ERROR_SYSCALL WOLFSSL_ERROR_SYSCALL
2479 #define SSL_ERROR_WANT_X509_LOOKUP WOLFSSL_ERROR_WANT_X509_LOOKUP
2480 #define SSL_ERROR_ZERO_RETURN WOLFSSL_ERROR_ZERO_RETURN
2481 #define SSL_ERROR_SSL WOLFSSL_ERROR_SSL
2482
2483 #define SSL_SENT_SHUTDOWN WOLFSSL_SENT_SHUTDOWN
2484 #define SSL_RECEIVED_SHUTDOWN WOLFSSL_RECEIVED_SHUTDOWN
2485 #define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER WOLFSSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
2486
2487 #define SSL_R_SSL_HANDSHAKE_FAILURE WOLFSSL_R_SSL_HANDSHAKE_FAILURE
2488 #define SSL_R_TLSV1_ALERT_UNKNOWN_CA WOLFSSL_R_TLSV1_ALERT_UNKNOWN_CA
2489 #define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN WOLFSSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
2490 #define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE WOLFSSL_R_SSLV3_ALERT_BAD_CERTIFICATE
2491
2492 #define PEM_BUFSIZE WOLF_PEM_BUFSIZE
2493 #endif
2494
2495 enum { /* ssl Constants */
2496 WOLFSSL_ERROR_NONE = 0, /* for most functions */
2497 WOLFSSL_FAILURE = 0, /* for some functions */
2498 WOLFSSL_SUCCESS = 1,
2499
2500 /* WOLFSSL_SHUTDOWN_NOT_DONE is returned by wolfSSL_shutdown when the other end
2501 * of the connection has yet to send its close notify alert as part of the
2502 * bidirectional shutdown. To complete the shutdown, either keep calling
2503 * wolfSSL_shutdown until it returns WOLFSSL_SUCCESS or call wolfSSL_read until
2504 * it returns <= 0 AND SSL_get_error returns SSL_ERROR_ZERO_RETURN. See OpenSSL
2505 * docs for more: https://www.openssl.org/docs/man1.1.1/man3/SSL_shutdown.html
2506 */
2507 #ifdef WOLFSSL_ERROR_CODE_OPENSSL
2508 /* SSL_shutdown returns 0 when not done, per OpenSSL documentation. */
2509 WOLFSSL_SHUTDOWN_NOT_DONE = 0,
2510 #else
2511 WOLFSSL_SHUTDOWN_NOT_DONE = 2,
2512 #endif
2513
2514 WOLFSSL_ALPN_NOT_FOUND = -9,
2515 WOLFSSL_BAD_CERTTYPE = -8,
2516 WOLFSSL_BAD_STAT = -7,
2517 WOLFSSL_BAD_PATH = -6,
2518 WOLFSSL_BAD_FILETYPE = -5,
2519 WOLFSSL_BAD_FILE = -4,
2520 WOLFSSL_NOT_IMPLEMENTED = -3,
2521 WOLFSSL_UNKNOWN = -2,
2522 WOLFSSL_FATAL_ERROR = -1,
2523
2524 WOLFSSL_FILETYPE_ASN1 = CTC_FILETYPE_ASN1,
2525 WOLFSSL_FILETYPE_PEM = CTC_FILETYPE_PEM,
2526 WOLFSSL_FILETYPE_DEFAULT = CTC_FILETYPE_ASN1, /* ASN1 */
2527
2528 WOLFSSL_VERIFY_NONE = 0,
2529 WOLFSSL_VERIFY_PEER = 1 « 0,
2530 WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT = 1 « 1,
2531 WOLFSSL_VERIFY_CLIENT_ONCE = 1 « 2,
2532 WOLFSSL_VERIFY_POST_HANDSHAKE = 1 « 3,
2533 WOLFSSL_VERIFY_FAIL_EXCEPT_PSK = 1 « 4,
2534 WOLFSSL_VERIFY_DEFAULT = 1 « 9,
2535
2536 WOLFSSL_SESS_CACHE_OFF = 0x0000,
2537 WOLFSSL_SESS_CACHE_CLIENT = 0x0001,
2538 WOLFSSL_SESS_CACHE_SERVER = 0x0002,
2539 WOLFSSL_SESS_CACHE_BOTH = 0x0003,
2540 WOLFSSL_SESS_CACHE_NO_AUTO_CLEAR = 0x0008,
2541 WOLFSSL_SESS_CACHE_NO_INTERNAL_LOOKUP = 0x0100,
2542 WOLFSSL_SESS_CACHE_NO_INTERNAL_STORE = 0x0200,
2543 WOLFSSL_SESS_CACHE_NO_INTERNAL = 0x0300,
2544

NetBurner, Inc.
1060 File Documentation

2545 WOLFSSL_ERROR_WANT_READ = 2,
2546 WOLFSSL_ERROR_WANT_WRITE = 3,
2547 WOLFSSL_ERROR_WANT_CONNECT = 7,
2548 WOLFSSL_ERROR_WANT_ACCEPT = 8,
2549 WOLFSSL_ERROR_SYSCALL = 5,
2550 WOLFSSL_ERROR_WANT_X509_LOOKUP = 83,
2551 WOLFSSL_ERROR_ZERO_RETURN = 6,
2552 WOLFSSL_ERROR_SSL = 85,
2553
2554 WOLFSSL_SENT_SHUTDOWN = 1,
2555 WOLFSSL_RECEIVED_SHUTDOWN = 2,
2556 WOLFSSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 4,
2557
2558 WOLFSSL_R_SSL_HANDSHAKE_FAILURE = 101,
2559 WOLFSSL_R_TLSV1_ALERT_UNKNOWN_CA = 102,
2560 WOLFSSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 103,
2561 WOLFSSL_R_SSLV3_ALERT_BAD_CERTIFICATE = 104,
2562
2563 WOLF_PEM_BUFSIZE = 1024
2564 };
2565
2566 #ifndef NO_PSK
2567 typedef unsigned int (*wc_psk_client_callback)(WOLFSSL* ssl, const char*, char*,
2568 unsigned int, unsigned char*, unsigned int);
2569 WOLFSSL_API void wolfSSL_CTX_set_psk_client_callback(WOLFSSL_CTX* ctx,
2570 wc_psk_client_callback cb);
2571 WOLFSSL_API void wolfSSL_set_psk_client_callback(WOLFSSL* ssl,
2572 wc_psk_client_callback cb);
2573 #ifdef OPENSSL_EXTRA
2574 typedef int (*wc_psk_use_session_cb_func)(WOLFSSL* ssl,
2575 const WOLFSSL_EVP_MD* md, const unsigned char **id,
2576 size_t* idlen, WOLFSSL_SESSION **sess);
2577 WOLFSSL_API void wolfSSL_set_psk_use_session_callback(WOLFSSL* ssl,
2578 wc_psk_use_session_cb_func cb);
2579 #endif
2580 #ifdef WOLFSSL_TLS13
2581 typedef unsigned int (*wc_psk_client_cs_callback)(WOLFSSL* ssl, const char*,
2582 char*, unsigned int, unsigned char*, unsigned int, const char*);
2583 WOLFSSL_API void wolfSSL_CTX_set_psk_client_cs_callback(WOLFSSL_CTX* ctx,
2584 wc_psk_client_cs_callback cb);
2585 WOLFSSL_API void wolfSSL_set_psk_client_cs_callback(WOLFSSL* ssl,
2586 wc_psk_client_cs_callback cb);
2587
2588 typedef unsigned int (*wc_psk_client_tls13_callback)(WOLFSSL* ssl, const char*,
2589 char*, unsigned int, unsigned char*, unsigned int, const char**);
2590 WOLFSSL_API void wolfSSL_CTX_set_psk_client_tls13_callback(WOLFSSL_CTX* ctx,
2591 wc_psk_client_tls13_callback cb);
2592 WOLFSSL_API void wolfSSL_set_psk_client_tls13_callback(WOLFSSL* ssl,
2593 wc_psk_client_tls13_callback cb);
2594 #endif
2595
2596 WOLFSSL_API const char* wolfSSL_get_psk_identity_hint(const WOLFSSL* ssl);
2597 WOLFSSL_API const char* wolfSSL_get_psk_identity(const WOLFSSL* ssl);
2598
2599 WOLFSSL_API int wolfSSL_CTX_use_psk_identity_hint(WOLFSSL_CTX* ctx, const char* hint);
2600 WOLFSSL_API int wolfSSL_use_psk_identity_hint(WOLFSSL* ssl, const char* hint);
2601
2602 typedef unsigned int (*wc_psk_server_callback)(WOLFSSL* ssl, const char*,
2603 unsigned char*, unsigned int);
2604 WOLFSSL_API void wolfSSL_CTX_set_psk_server_callback(WOLFSSL_CTX* ctx,
2605 wc_psk_server_callback cb);
2606 WOLFSSL_API void wolfSSL_set_psk_server_callback(WOLFSSL* ssl,
2607 wc_psk_server_callback cb);
2608 #ifdef WOLFSSL_TLS13
2609 typedef unsigned int (*wc_psk_server_tls13_callback)(WOLFSSL* ssl, const char*,
2610 unsigned char*, unsigned int, const char**);
2611 WOLFSSL_API void wolfSSL_CTX_set_psk_server_tls13_callback(WOLFSSL_CTX* ctx,
2612 wc_psk_server_tls13_callback cb);
2613 WOLFSSL_API void wolfSSL_set_psk_server_tls13_callback(WOLFSSL* ssl,
2614 wc_psk_server_tls13_callback cb);
2615 #endif
2616 WOLFSSL_API void* wolfSSL_get_psk_callback_ctx(WOLFSSL* ssl);
2617 WOLFSSL_API int wolfSSL_set_psk_callback_ctx(WOLFSSL* ssl, void* psk_ctx);
2618
2619 WOLFSSL_API void* wolfSSL_CTX_get_psk_callback_ctx(WOLFSSL_CTX* ctx);
2620 WOLFSSL_API int wolfSSL_CTX_set_psk_callback_ctx(WOLFSSL_CTX* ctx, void* psk_ctx);
2621
2622 #define PSK_TYPES_DEFINED
2623
2624 #ifdef WOLFSSL_TLS13
2625 WOLFSSL_API const char* wolfSSL_get_cipher_name_by_hash(WOLFSSL* ssl,
2626 const char* hash);
2627 #endif
2628 #endif /* NO_PSK */
2629
2630
2631 #ifdef HAVE_ANON

NetBurner, Inc.
22.199 wolfssl/ssl.h 1061

2632 WOLFSSL_API int wolfSSL_CTX_allow_anon_cipher(WOLFSSL_CTX* ctx);


2633 #endif /* HAVE_ANON */
2634
2635
2636 /* extra begins */
2637 #ifdef OPENSSL_EXTRA
2638 enum { /* ERR Constants */
2639 ERR_TXT_STRING = 1
2640 };
2641
2642 /* bio misc */
2643 enum {
2644 WOLFSSL_BIO_ERROR = -1,
2645 WOLFSSL_BIO_UNSET = -2,
2646 WOLFSSL_BIO_SIZE = 17000 /* default BIO write size if not set */
2647 };
2648 #endif
2649
2650 WOLFSSL_API void wolfSSL_ERR_put_error(int lib, int fun, int err,
2651 const char* file, int line);
2652 WOLFSSL_API unsigned long wolfSSL_ERR_get_error_line(const char** file, int* line);
2653 WOLFSSL_API unsigned long wolfSSL_ERR_get_error_line_data(const char** file, int* line,
2654 const char** data, int* flags);
2655
2656 WOLFSSL_API unsigned long wolfSSL_ERR_get_error(void);
2657 WOLFSSL_API void wolfSSL_ERR_clear_error(void);
2658
2659
2660 WOLFSSL_API int wolfSSL_RAND_status(void);
2661 WOLFSSL_API int wolfSSL_RAND_pseudo_bytes(unsigned char* buf, int num);
2662 WOLFSSL_API int wolfSSL_RAND_bytes(unsigned char* buf, int num);
2663 WOLFSSL_API long wolfSSL_CTX_set_options(WOLFSSL_CTX* ctx, long opt);
2664 WOLFSSL_API long wolfSSL_CTX_get_options(WOLFSSL_CTX* ctx);
2665 WOLFSSL_API long wolfSSL_CTX_clear_options(WOLFSSL_CTX* ctx, long opt);
2666
2667 #if !defined(NO_CHECK_PRIVATE_KEY)
2668 WOLFSSL_API int wolfSSL_CTX_check_private_key(const WOLFSSL_CTX* ctx);
2669 #endif
2670 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_CTX_get0_privatekey(const WOLFSSL_CTX* ctx);
2671
2672 WOLFSSL_API void wolfSSL_ERR_free_strings(void);
2673 WOLFSSL_API void wolfSSL_ERR_remove_state(unsigned long id);
2674 WOLFSSL_API int wolfSSL_clear(WOLFSSL* ssl);
2675 WOLFSSL_API int wolfSSL_state(WOLFSSL* ssl);
2676
2677 WOLFSSL_API void wolfSSL_cleanup_all_ex_data(void);
2678 WOLFSSL_API long wolfSSL_CTX_set_mode(WOLFSSL_CTX* ctx, long mode);
2679 WOLFSSL_API long wolfSSL_CTX_clear_mode(WOLFSSL_CTX* ctx, long mode);
2680 WOLFSSL_API long wolfSSL_CTX_get_mode(WOLFSSL_CTX* ctx);
2681 WOLFSSL_API void wolfSSL_CTX_set_default_read_ahead(WOLFSSL_CTX* ctx, int m);
2682 WOLFSSL_API long wolfSSL_SSL_get_mode(WOLFSSL* ssl);
2683
2684
2685 WOLFSSL_API int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX* ctx);
2686 WOLFSSL_API const char* wolfSSL_X509_get_default_cert_file_env(void);
2687 WOLFSSL_API const char* wolfSSL_X509_get_default_cert_file(void);
2688 WOLFSSL_API const char* wolfSSL_X509_get_default_cert_dir_env(void);
2689 WOLFSSL_API const char* wolfSSL_X509_get_default_cert_dir(void);
2690 WOLFSSL_API int wolfSSL_CTX_set_session_id_context(WOLFSSL_CTX* ctx,
2691 const unsigned char* sid_ctx, unsigned int sid_ctx_len);
2692 WOLFSSL_ABI WOLFSSL_API WOLFSSL_X509* wolfSSL_get_peer_certificate(WOLFSSL* ssl);
2693 #ifdef OPENSSL_EXTRA
2694 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_get_peer_cert_chain(const WOLFSSL* ssl);
2695 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_set_peer_cert_chain(WOLFSSL* ssl);
2696 #endif
2697
2698 #ifdef OPENSSL_EXTRA
2699 WOLFSSL_API int wolfSSL_want(WOLFSSL* ssl);
2700 #endif
2701 WOLFSSL_API int wolfSSL_want_read(WOLFSSL* ssl);
2702 WOLFSSL_API int wolfSSL_want_write(WOLFSSL* ssl);
2703
2704 #include <stdarg.h> /* var_arg */
2705 WOLFSSL_API int wolfSSL_BIO_vprintf(WOLFSSL_BIO* bio, const char* format,
2706 va_list args);
2707 WOLFSSL_API int wolfSSL_BIO_printf(WOLFSSL_BIO* bio, const char* format, ...);
2708 WOLFSSL_API int wolfSSL_BIO_dump(WOLFSSL_BIO *bio, const char* buf, int length);
2709 WOLFSSL_API int wolfSSL_ASN1_UTCTIME_print(WOLFSSL_BIO* bio,
2710 const WOLFSSL_ASN1_UTCTIME* a);
2711 WOLFSSL_API int wolfSSL_ASN1_GENERALIZEDTIME_print(WOLFSSL_BIO* bio,
2712 const WOLFSSL_ASN1_GENERALIZEDTIME* asnTime);
2713 WOLFSSL_API void wolfSSL_ASN1_GENERALIZEDTIME_free(WOLFSSL_ASN1_GENERALIZEDTIME*);
2714 WOLFSSL_API int wolfSSL_ASN1_TIME_check(const WOLFSSL_ASN1_TIME* a);
2715 WOLFSSL_API int wolfSSL_ASN1_TIME_diff(int* days, int* secs, const WOLFSSL_ASN1_TIME* from,
2716 const WOLFSSL_ASN1_TIME* to);
2717 WOLFSSL_API int wolfSSL_ASN1_TIME_compare(const WOLFSSL_ASN1_TIME *a,
2718 const WOLFSSL_ASN1_TIME *b);

NetBurner, Inc.
1062 File Documentation

2719 #ifdef OPENSSL_EXTRA


2720 WOLFSSL_API WOLFSSL_ASN1_TIME *wolfSSL_ASN1_TIME_set(WOLFSSL_ASN1_TIME *s, time_t t);
2721 WOLFSSL_API int wolfSSL_ASN1_TIME_set_string(WOLFSSL_ASN1_TIME *s, const char *str);
2722 #endif
2723
2724 WOLFSSL_API int wolfSSL_sk_num(const WOLFSSL_STACK* sk);
2725 WOLFSSL_API void* wolfSSL_sk_value(const WOLFSSL_STACK* sk, int i);
2726
2727 #if defined(HAVE_EX_DATA) || defined(WOLFSSL_WPAS_SMALL)
2728
2729 WOLFSSL_API void* wolfSSL_CRYPTO_get_ex_data(const WOLFSSL_CRYPTO_EX_DATA* ex_data,
2730 int idx);
2731 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
2732 WOLFSSL_API int wolfSSL_CRYPTO_set_ex_data_with_cleanup(
2733 WOLFSSL_CRYPTO_EX_DATA* ex_data,
2734 int idx,
2735 void *data,
2736 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
2737 #endif
2738 WOLFSSL_API int wolfSSL_CRYPTO_set_ex_data(WOLFSSL_CRYPTO_EX_DATA* ex_data, int idx,
2739 void *data);
2740 #endif
2741
2742 /* stunnel 4.28 needs */
2743 WOLFSSL_API void* wolfSSL_CTX_get_ex_data(const WOLFSSL_CTX* ctx, int idx);
2744 WOLFSSL_API int wolfSSL_CTX_set_ex_data(WOLFSSL_CTX* ctx, int idx, void* data);
2745 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
2746 WOLFSSL_API int wolfSSL_CTX_set_ex_data_with_cleanup(
2747 WOLFSSL_CTX* ctx,
2748 int idx,
2749 void* data,
2750 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
2751 #endif
2752 WOLFSSL_API void wolfSSL_CTX_sess_set_get_cb(WOLFSSL_CTX* ctx,
2753 WOLFSSL_SESSION*(*f)(WOLFSSL* ssl, const unsigned char*, int, int*));
2754 WOLFSSL_API void wolfSSL_CTX_sess_set_new_cb(WOLFSSL_CTX* ctx,
2755 int (*f)(WOLFSSL* ssl, WOLFSSL_SESSION*));
2756 WOLFSSL_API void wolfSSL_CTX_sess_set_remove_cb(WOLFSSL_CTX* ctx,
2757 void (*f)(WOLFSSL_CTX* ctx, WOLFSSL_SESSION*));
2758
2759 WOLFSSL_API int wolfSSL_i2d_SSL_SESSION(WOLFSSL_SESSION* sess,unsigned char** p);
2760 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_d2i_SSL_SESSION(WOLFSSL_SESSION** sess,
2761 const unsigned char** p, long i);
2762
2763 WOLFSSL_API int wolfSSL_SESSION_has_ticket(const WOLFSSL_SESSION* session);
2764 WOLFSSL_API unsigned long wolfSSL_SESSION_get_ticket_lifetime_hint(
2765 const WOLFSSL_SESSION* sess);
2766 WOLFSSL_API long wolfSSL_SESSION_get_timeout(const WOLFSSL_SESSION* session);
2767 WOLFSSL_API long wolfSSL_SESSION_get_time(const WOLFSSL_SESSION* session);
2768 WOLFSSL_API int wolfSSL_CTX_get_ex_new_index(long idx, void* arg, void* a, void* b, void* c);
2769
2770
2771 /* extra ends */
2772
2773
2774 /* wolfSSL extensions */
2775
2776 /* call before SSL_connect, if verifying will add name check to
2777 date check and signature check */
2778 WOLFSSL_ABI WOLFSSL_API int wolfSSL_check_domain_name(WOLFSSL* ssl, const char* dn);
2779
2780 /* need to call once to load library (session cache) */
2781 WOLFSSL_ABI WOLFSSL_API int wolfSSL_Init(void);
2782 /* call when done to cleanup/free session cache mutex / resources */
2783 WOLFSSL_ABI WOLFSSL_API int wolfSSL_Cleanup(void);
2784
2785 /* which library version do we have */
2786 WOLFSSL_API const char* wolfSSL_lib_version(void);
2787 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
2788 WOLFSSL_API const char* wolfSSL_OpenSSL_version(int a);
2789 #else
2790 WOLFSSL_API const char* wolfSSL_OpenSSL_version(void);
2791 #endif
2792 /* which library version do we have in hex */
2793 WOLFSSL_API word32 wolfSSL_lib_version_hex(void);
2794
2795 /* do accept or connect depedning on side */
2796 WOLFSSL_API int wolfSSL_negotiate(WOLFSSL* ssl);
2797 /* turn on wolfSSL data compression */
2798 WOLFSSL_API int wolfSSL_set_compression(WOLFSSL* ssl);
2799
2800 WOLFSSL_ABI WOLFSSL_API int wolfSSL_set_timeout(WOLFSSL* ssl, unsigned int to);
2801 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_set_timeout(WOLFSSL_CTX* ctx, unsigned int to);
2802 WOLFSSL_API void wolfSSL_CTX_set_current_time_cb(WOLFSSL_CTX* ctx,
2803 void (*cb)(const WOLFSSL* ssl, WOLFSSL_TIMEVAL* out_clock));
2804
2805 /* get wolfSSL peer X509_CHAIN */

NetBurner, Inc.
22.199 wolfssl/ssl.h 1063

2806 WOLFSSL_API WOLFSSL_X509_CHAIN* wolfSSL_get_peer_chain(WOLFSSL* ssl);


2807 #ifdef WOLFSSL_ALT_CERT_CHAINS
2808 WOLFSSL_API int wolfSSL_is_peer_alt_cert_chain(const WOLFSSL* ssl);
2809 /* get wolfSSL alternate peer X509_CHAIN */
2810 WOLFSSL_API WOLFSSL_X509_CHAIN* wolfSSL_get_peer_alt_chain(WOLFSSL* ssl);
2811 #endif
2812 /* peer chain count */
2813 WOLFSSL_API int wolfSSL_get_chain_count(WOLFSSL_X509_CHAIN* chain);
2814 /* index cert length */
2815 WOLFSSL_API int wolfSSL_get_chain_length(WOLFSSL_X509_CHAIN* chain, int idx);
2816 /* index cert */
2817 WOLFSSL_API unsigned char* wolfSSL_get_chain_cert(WOLFSSL_X509_CHAIN* chain, int idx);
2818 /* index cert in X509 */
2819 WOLFSSL_API WOLFSSL_X509* wolfSSL_get_chain_X509(WOLFSSL_X509_CHAIN* chain, int idx);
2820 /* free X509 */
2821 #define wolfSSL_FreeX509(x509) wolfSSL_X509_free((x509))
2822 WOLFSSL_ABI WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509* x509);
2823 /* get index cert in PEM */
2824 WOLFSSL_API int wolfSSL_get_chain_cert_pem(WOLFSSL_X509_CHAIN* chain, int idx,
2825 unsigned char* buf, int inLen, int* outLen);
2826 WOLFSSL_ABI WOLFSSL_API const unsigned char* wolfSSL_get_sessionID(
2827 const WOLFSSL_SESSION* s);
2828 WOLFSSL_API int wolfSSL_X509_get_serial_number(WOLFSSL_X509* x509,unsigned char* in,int* inOutSz);
2829 WOLFSSL_API char* wolfSSL_X509_get_subjectCN(WOLFSSL_X509* x509);
2830 WOLFSSL_API const unsigned char* wolfSSL_X509_get_der(WOLFSSL_X509* x509, int* outSz);
2831 WOLFSSL_API const unsigned char* wolfSSL_X509_get_tbs(WOLFSSL_X509* x509, int* outSz);
2832 WOLFSSL_ABI WOLFSSL_API const byte* wolfSSL_X509_notBefore(WOLFSSL_X509* x509);
2833 WOLFSSL_ABI WOLFSSL_API const byte* wolfSSL_X509_notAfter(WOLFSSL_X509* x509);
2834 WOLFSSL_API int wolfSSL_X509_version(WOLFSSL_X509* x509);
2835
2836 WOLFSSL_API int wolfSSL_cmp_peer_cert_to_file(WOLFSSL* ssl, const char* fname);
2837
2838 WOLFSSL_ABI WOLFSSL_API char* wolfSSL_X509_get_next_altname(WOLFSSL_X509* cert);
2839 WOLFSSL_API int wolfSSL_X509_add_altname_ex(WOLFSSL_X509* x509, const char* name, word32 nameSz, int
type);
2840 WOLFSSL_API int wolfSSL_X509_add_altname(WOLFSSL_X509* x509, const char* name, int type);
2841
2842 WOLFSSL_API WOLFSSL_X509* wolfSSL_d2i_X509(WOLFSSL_X509** x509,
2843 const unsigned char** in, int len);
2844 WOLFSSL_API WOLFSSL_X509*
2845 wolfSSL_X509_d2i(WOLFSSL_X509** x509, const unsigned char* in, int len);
2846 #ifdef WOLFSSL_CERT_REQ
2847 WOLFSSL_API WOLFSSL_X509*
2848 wolfSSL_X509_REQ_d2i(WOLFSSL_X509** x509, const unsigned char* in, int len);
2849 #endif
2850 WOLFSSL_API int wolfSSL_i2d_X509(WOLFSSL_X509* x509, unsigned char** out);
2851 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_d2i_X509_CRL(WOLFSSL_X509_CRL **crl,
2852 const unsigned char *in, int len);
2853 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_d2i_X509_CRL_bio(WOLFSSL_BIO *bp,
2854 WOLFSSL_X509_CRL **crl);
2855 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
2856 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_d2i_X509_CRL_fp(XFILE file, WOLFSSL_X509_CRL **crl);
2857 #endif
2858 #if defined(HAVE_CRL) && defined(OPENSSL_EXTRA)
2859 WOLFSSL_API int wolfSSL_X509_CRL_version(WOLFSSL_X509_CRL *crl);
2860 WOLFSSL_API int wolfSSL_X509_CRL_get_signature_type(WOLFSSL_X509_CRL* crl);
2861 WOLFSSL_API int wolfSSL_X509_CRL_get_signature_nid(
2862 const WOLFSSL_X509_CRL* crl);
2863 WOLFSSL_API int wolfSSL_X509_CRL_get_signature(WOLFSSL_X509_CRL* crl,
2864 unsigned char* buf, int* bufSz);
2865 WOLFSSL_API int wolfSSL_X509_CRL_print(WOLFSSL_BIO* bio,
2866 WOLFSSL_X509_CRL* crl);
2867 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_CRL_get_issuer_name(
2868 WOLFSSL_X509_CRL *crl);
2869 WOLFSSL_API int wolfSSL_X509_REVOKED_get_serial_number(RevokedCert* rev,
2870 byte* in, int* inOutSz);
2871 WOLFSSL_API void wolfSSL_X509_CRL_free(WOLFSSL_X509_CRL *crl);
2872 #endif
2873
2874 #ifndef NO_FILESYSTEM
2875 #ifndef NO_STDIO_FILESYSTEM
2876 WOLFSSL_API WOLFSSL_X509*
2877 wolfSSL_X509_d2i_fp(WOLFSSL_X509** x509, XFILE file);
2878 #endif
2879 WOLFSSL_ABI WOLFSSL_API WOLFSSL_X509*
2880 wolfSSL_X509_load_certificate_file(const char* fname, int format);
2881 #endif
2882 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_load_certificate_buffer(
2883 const unsigned char* buf, int sz, int format);
2884 #ifdef WOLFSSL_CERT_REQ
2885 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_REQ_load_certificate_buffer(
2886 const unsigned char* buf, int sz, int format);
2887 #endif
2888
2889 #ifdef WOLFSSL_SEP
2890 WOLFSSL_API unsigned char*
2891 wolfSSL_X509_get_device_type(WOLFSSL_X509* x509, unsigned char* in, int* inOutSz);

NetBurner, Inc.
1064 File Documentation

2892 WOLFSSL_API unsigned char*


2893 wolfSSL_X509_get_hw_type(WOLFSSL_X509* x509, unsigned char* in, int* inOutSz);
2894 WOLFSSL_API unsigned char*
2895 wolfSSL_X509_get_hw_serial_number(WOLFSSL_X509* x509, unsigned char* in, int* inOutSz);
2896 #endif
2897
2898 /* connect enough to get peer cert */
2899 WOLFSSL_API int wolfSSL_connect_cert(WOLFSSL* ssl);
2900
2901
2902
2903 /* PKCS12 compatibility */
2904 typedef struct WC_PKCS12 WC_PKCS12;
2905 WOLFSSL_API WC_PKCS12* wolfSSL_d2i_PKCS12_bio(WOLFSSL_BIO* bio,
2906 WC_PKCS12** pkcs12);
2907 WOLFSSL_API int wolfSSL_i2d_PKCS12_bio(WOLFSSL_BIO *bio, WC_PKCS12 *pkcs12);
2908 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
2909 WOLFSSL_API WOLFSSL_X509_PKCS12* wolfSSL_d2i_PKCS12_fp(XFILE fp,
2910 WOLFSSL_X509_PKCS12** pkcs12);
2911 #endif
2912 WOLFSSL_API int wolfSSL_PKCS12_parse(WC_PKCS12* pkcs12, const char* psw,
2913 WOLFSSL_EVP_PKEY** pkey, WOLFSSL_X509** cert,
2914 WOLF_STACK_OF(WOLFSSL_X509)** ca);
2915 WOLFSSL_API int wolfSSL_PKCS12_verify_mac(WC_PKCS12 *pkcs12, const char *psw,
2916 int pswLen);
2917 WOLFSSL_API WC_PKCS12* wolfSSL_PKCS12_create(char* pass, char* name,
2918 WOLFSSL_EVP_PKEY* pkey, WOLFSSL_X509* cert,
2919 WOLF_STACK_OF(WOLFSSL_X509)* ca,
2920 int keyNID, int certNID, int itt, int macItt, int keytype);
2921 WOLFSSL_API void wolfSSL_PKCS12_PBE_add(void);
2922
2923
2924
2925 #ifndef NO_DH
2926 /* server Diffie-Hellman parameters */
2927 WOLFSSL_API int wolfSSL_SetTmpDH(WOLFSSL* ssl, const unsigned char* p, int pSz,
2928 const unsigned char* g, int gSz);
2929 WOLFSSL_API int wolfSSL_SetTmpDH_buffer(WOLFSSL* ssl, const unsigned char* b, long sz,
2930 int format);
2931 WOLFSSL_API int wolfSSL_SetEnableDhKeyTest(WOLFSSL* ssl, int enable);
2932 #ifndef NO_FILESYSTEM
2933 WOLFSSL_API int wolfSSL_SetTmpDH_file(WOLFSSL* ssl, const char* f, int format);
2934 #endif
2935
2936 /* server ctx Diffie-Hellman parameters */
2937 WOLFSSL_API int wolfSSL_CTX_SetTmpDH(WOLFSSL_CTX* ctx, const unsigned char* p,
2938 int pSz, const unsigned char* g, int gSz);
2939 WOLFSSL_API int wolfSSL_CTX_SetTmpDH_buffer(WOLFSSL_CTX* ctx, const unsigned char* b,
2940 long sz, int format);
2941
2942 #ifndef NO_FILESYSTEM
2943 WOLFSSL_API int wolfSSL_CTX_SetTmpDH_file(WOLFSSL_CTX* ctx, const char* f,
2944 int format);
2945 #endif
2946
2947 WOLFSSL_API int wolfSSL_CTX_SetMinDhKey_Sz(WOLFSSL_CTX* ctx, word16 keySz_bits);
2948 WOLFSSL_API int wolfSSL_SetMinDhKey_Sz(WOLFSSL* ssl, word16 keySz_bits);
2949 WOLFSSL_API int wolfSSL_CTX_SetMaxDhKey_Sz(WOLFSSL_CTX* ctx, word16 keySz_bits);
2950 WOLFSSL_API int wolfSSL_SetMaxDhKey_Sz(WOLFSSL* ssl, word16 keySz_bits);
2951 WOLFSSL_API int wolfSSL_GetDhKey_Sz(WOLFSSL* ssl);
2952 #endif /* NO_DH */
2953
2954 #ifndef NO_RSA
2955 WOLFSSL_API int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX* ctx, short keySz);
2956 WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL* ssl, short keySz);
2957 #endif /* NO_RSA */
2958
2959 #ifdef HAVE_ECC
2960 WOLFSSL_API int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX* ctx, short keySz);
2961 WOLFSSL_API int wolfSSL_SetMinEccKey_Sz(WOLFSSL* ssl, short keySz);
2962 #endif /* NO_RSA */
2963
2964 WOLFSSL_API int wolfSSL_SetTmpEC_DHE_Sz(WOLFSSL* ssl, word16 sz);
2965 WOLFSSL_API int wolfSSL_CTX_SetTmpEC_DHE_Sz(WOLFSSL_CTX* ctx, word16 sz);
2966
2967 /* keyblock size in bytes or -1 */
2968 /* need to call wolfSSL_KeepArrays before handshake to save keys */
2969 WOLFSSL_API int wolfSSL_get_keyblock_size(WOLFSSL* ssl);
2970 WOLFSSL_API int wolfSSL_get_keys(WOLFSSL* ssl,unsigned char** ms, unsigned int* msLen,
2971 unsigned char** sr, unsigned int* srLen,
2972 unsigned char** cr, unsigned int* crLen);
2973
2974 /* Computes EAP-TLS and EAP-TTLS keying material from the master_secret. */
2975 WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL* ssl, void* key, unsigned int len,
2976 const char* label);
2977
2978

NetBurner, Inc.
22.199 wolfssl/ssl.h 1065

2979 #ifndef _WIN32


2980 #ifndef NO_WRITEV
2981 #ifdef __PPU
2982 #include <sys/types.h>
2983 #include <sys/socket.h>
2984 #elif !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM) && \
2985 !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) && \
2986 !defined(WOLFSSL_EMBOS) && !defined(WOLFSSL_FROSTED) && \
2987 !defined(WOLFSSL_CHIBIOS) && !defined(WOLFSSL_CONTIKI) && \
2988 !defined(WOLFSSL_ZEPHYR) && !defined(NETOS)
2989 #include <sys/uio.h>
2990 #endif
2991 /* allow writev style writing */
2992 WOLFSSL_API int wolfSSL_writev(WOLFSSL* ssl, const struct iovec* iov,
2993 int iovcnt);
2994 #endif
2995 #endif
2996
2997
2998 #ifndef NO_CERTS
2999 /* SSL_CTX versions */
3000 WOLFSSL_API int wolfSSL_CTX_UnloadCAs(WOLFSSL_CTX* ctx);
3001 #ifdef WOLFSSL_TRUST_PEER_CERT
3002 WOLFSSL_API int wolfSSL_CTX_Unload_trust_peers(WOLFSSL_CTX* ctx);
3003 #ifdef WOLFSSL_LOCAL_X509_STORE
3004 WOLFSSL_API int wolfSSL_Unload_trust_peers(WOLFSSL* ssl);
3005 #endif
3006 WOLFSSL_API int wolfSSL_CTX_trust_peer_buffer(WOLFSSL_CTX* ctx,
3007 const unsigned char* in,
3008 long sz, int format);
3009 #endif
3010 WOLFSSL_API int wolfSSL_CTX_load_verify_buffer_ex(WOLFSSL_CTX* ctx,
3011 const unsigned char* in, long sz, int format,
3012 int userChain, word32 flags);
3013 WOLFSSL_API int wolfSSL_CTX_load_verify_buffer(WOLFSSL_CTX* ctx,
3014 const unsigned char* in, long sz, int format);
3015 WOLFSSL_API int wolfSSL_CTX_load_verify_chain_buffer_format(WOLFSSL_CTX* ctx,
3016 const unsigned char* in, long sz, int format);
3017 WOLFSSL_API int wolfSSL_CTX_use_certificate_buffer(WOLFSSL_CTX* ctx,
3018 const unsigned char* in, long sz, int format);
3019 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_buffer(WOLFSSL_CTX* ctx,
3020 const unsigned char* in, long sz, int format);
3021 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_id(WOLFSSL_CTX* ctx,
3022 const unsigned char* id, long sz,
3023 int devId, long keySz);
3024 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_Id(WOLFSSL_CTX* ctx,
3025 const unsigned char* id, long sz,
3026 int devId);
3027 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_Label(WOLFSSL_CTX* ctx, const char* label,
3028 int devId);
3029 WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer_format(WOLFSSL_CTX* ctx,
3030 const unsigned char* in, long sz, int format);
3031 WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer(WOLFSSL_CTX* ctx,
3032 const unsigned char* in, long sz);
3033
3034 /* SSL versions */
3035 WOLFSSL_API int wolfSSL_use_certificate_buffer(WOLFSSL* ssl, const unsigned char* in,
3036 long sz, int format);
3037 WOLFSSL_API int wolfSSL_use_certificate_ASN1(WOLFSSL* ssl,
3038 const unsigned char* der, int derSz);
3039 WOLFSSL_API int wolfSSL_use_PrivateKey_buffer(WOLFSSL* ssl, const unsigned char* in,
3040 long sz, int format);
3041 WOLFSSL_API int wolfSSL_use_PrivateKey_id(WOLFSSL* ssl, const unsigned char* id,
3042 long sz, int devId, long keySz);
3043 WOLFSSL_API int wolfSSL_use_PrivateKey_Id(WOLFSSL* ssl, const unsigned char* id,
3044 long sz, int devId);
3045 WOLFSSL_API int wolfSSL_use_PrivateKey_Label(WOLFSSL* ssl, const char* label, int devId);
3046 WOLFSSL_API int wolfSSL_use_certificate_chain_buffer_format(WOLFSSL* ssl,
3047 const unsigned char* in, long sz, int format);
3048 WOLFSSL_API int wolfSSL_use_certificate_chain_buffer(WOLFSSL* ssl,
3049 const unsigned char* in, long sz);
3050 WOLFSSL_API int wolfSSL_UnloadCertsKeys(WOLFSSL* ssl);
3051
3052 #if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) && \
3053 defined(KEEP_OUR_CERT)
3054 WOLFSSL_API WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl);
3055 WOLFSSL_API WOLFSSL_X509* wolfSSL_CTX_get0_certificate(WOLFSSL_CTX* ctx);
3056 #endif
3057 #endif
3058
3059 WOLFSSL_API int wolfSSL_CTX_set_group_messages(WOLFSSL_CTX* ctx);
3060 WOLFSSL_API int wolfSSL_set_group_messages(WOLFSSL* ssl);
3061
3062
3063 #ifdef HAVE_FUZZER
3064 enum fuzzer_type {
3065 FUZZ_HMAC = 0,

NetBurner, Inc.
1066 File Documentation

3066 FUZZ_ENCRYPT = 1,
3067 FUZZ_SIGNATURE = 2,
3068 FUZZ_HASH = 3,
3069 FUZZ_HEAD = 4
3070 };
3071
3072 typedef int (*CallbackFuzzer)(WOLFSSL* ssl, const unsigned char* buf, int sz,
3073 int type, void* fuzzCtx);
3074
3075 WOLFSSL_API void wolfSSL_SetFuzzerCb(WOLFSSL* ssl, CallbackFuzzer cbf, void* fCtx);
3076 #endif
3077
3078
3079 WOLFSSL_API int wolfSSL_DTLS_SetCookieSecret(WOLFSSL* ssl, const byte* secret, word32 secretSz);
3080
3081
3082 /* I/O Callback default errors */
3083 enum IOerrors {
3084 WOLFSSL_CBIO_ERR_GENERAL = -1, /* general unexpected err */
3085 WOLFSSL_CBIO_ERR_WANT_READ = -2, /* need to call read again */
3086 WOLFSSL_CBIO_ERR_WANT_WRITE = -2, /* need to call write again */
3087 WOLFSSL_CBIO_ERR_CONN_RST = -3, /* connection reset */
3088 WOLFSSL_CBIO_ERR_ISR = -4, /* interrupt */
3089 WOLFSSL_CBIO_ERR_CONN_CLOSE = -5, /* connection closed or epipe */
3090 WOLFSSL_CBIO_ERR_TIMEOUT = -6 /* socket timeout */
3091 };
3092
3093
3094 /* CA cache callbacks */
3095 enum {
3096 WOLFSSL_SSLV3 = 0,
3097 WOLFSSL_TLSV1 = 1,
3098 WOLFSSL_TLSV1_1 = 2,
3099 WOLFSSL_TLSV1_2 = 3,
3100 WOLFSSL_TLSV1_3 = 4,
3101 WOLFSSL_DTLSV1 = 5,
3102 WOLFSSL_DTLSV1_2 = 6,
3103 WOLFSSL_DTLSV1_3 = 7,
3104
3105 WOLFSSL_USER_CA = 1, /* user added as trusted */
3106 WOLFSSL_CHAIN_CA = 2 /* added to cache from trusted chain */
3107 };
3108
3109 WOLFSSL_ABI WOLFSSL_API WC_RNG* wolfSSL_GetRNG(WOLFSSL* ssl);
3110
3111 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_SetMinVersion(WOLFSSL_CTX* ctx, int version);
3112 WOLFSSL_API int wolfSSL_SetMinVersion(WOLFSSL* ssl, int version);
3113 WOLFSSL_API int wolfSSL_GetObjectSize(void); /* object size based on build */
3114 WOLFSSL_API int wolfSSL_CTX_GetObjectSize(void);
3115 WOLFSSL_API int wolfSSL_METHOD_GetObjectSize(void);
3116 WOLFSSL_API int wolfSSL_GetOutputSize(WOLFSSL* ssl, int inSz);
3117 WOLFSSL_API int wolfSSL_GetMaxOutputSize(WOLFSSL* ssl);
3118 WOLFSSL_API int wolfSSL_GetVersion(const WOLFSSL* ssl);
3119 WOLFSSL_API int wolfSSL_SetVersion(WOLFSSL* ssl, int version);
3120
3121 /* moved to asn.c, old names kept for backwards compatibility */
3122 #define wolfSSL_KeyPemToDer wc_KeyPemToDer
3123 #define wolfSSL_CertPemToDer wc_CertPemToDer
3124 #define wolfSSL_PemPubKeyToDer wc_PemPubKeyToDer
3125 #define wolfSSL_PubKeyPemToDer wc_PubKeyPemToDer
3126 #define wolfSSL_PemCertToDer wc_PemCertToDer
3127
3128
3129 typedef void (*CallbackCACache)(unsigned char* der, int sz, int type);
3130 typedef void (*CbMissingCRL)(const char* url);
3131 typedef int (*CbOCSPIO)(void*, const char*, int,
3132 unsigned char*, int, unsigned char**);
3133 typedef void (*CbOCSPRespFree)(void*,unsigned char*);
3134
3135 #ifdef HAVE_CRL_IO
3136 typedef int (*CbCrlIO)(WOLFSSL_CRL* crl, const char* url, int urlSz);
3137 #endif
3138
3139 /* User Atomic Record Layer CallBacks */
3140 typedef int (*CallbackMacEncrypt)(WOLFSSL* ssl, unsigned char* macOut,
3141 const unsigned char* macIn, unsigned int macInSz, int macContent,
3142 int macVerify, unsigned char* encOut, const unsigned char* encIn,
3143 unsigned int encSz, void* ctx);
3144 WOLFSSL_API void wolfSSL_CTX_SetMacEncryptCb(WOLFSSL_CTX* ctx, CallbackMacEncrypt cb);
3145 WOLFSSL_API void wolfSSL_SetMacEncryptCtx(WOLFSSL* ssl, void *ctx);
3146 WOLFSSL_API void* wolfSSL_GetMacEncryptCtx(WOLFSSL* ssl);
3147
3148 typedef int (*CallbackDecryptVerify)(WOLFSSL* ssl,
3149 unsigned char* decOut, const unsigned char* decIn,
3150 unsigned int decSz, int content, int verify, unsigned int* padSz,
3151 void* ctx);
3152 WOLFSSL_API void wolfSSL_CTX_SetDecryptVerifyCb(WOLFSSL_CTX* ctx,

NetBurner, Inc.
22.199 wolfssl/ssl.h 1067

3153 CallbackDecryptVerify cb);


3154 WOLFSSL_API void wolfSSL_SetDecryptVerifyCtx(WOLFSSL* ssl, void *ctx);
3155 WOLFSSL_API void* wolfSSL_GetDecryptVerifyCtx(WOLFSSL* ssl);
3156
3157 typedef int (*CallbackEncryptMac)(WOLFSSL* ssl, unsigned char* macOut,
3158 int content, int macVerify, unsigned char* encOut,
3159 const unsigned char* encIn, unsigned int encSz, void* ctx);
3160 WOLFSSL_API void wolfSSL_CTX_SetEncryptMacCb(WOLFSSL_CTX* ctx, CallbackEncryptMac cb);
3161 WOLFSSL_API void wolfSSL_SetEncryptMacCtx(WOLFSSL* ssl, void *ctx);
3162 WOLFSSL_API void* wolfSSL_GetEncryptMacCtx(WOLFSSL* ssl);
3163
3164 typedef int (*CallbackVerifyDecrypt)(WOLFSSL* ssl,
3165 unsigned char* decOut, const unsigned char* decIn,
3166 unsigned int decSz, int content, int verify, unsigned int* padSz,
3167 void* ctx);
3168 WOLFSSL_API void wolfSSL_CTX_SetVerifyDecryptCb(WOLFSSL_CTX* ctx,
3169 CallbackVerifyDecrypt cb);
3170 WOLFSSL_API void wolfSSL_SetVerifyDecryptCtx(WOLFSSL* ssl, void *ctx);
3171 WOLFSSL_API void* wolfSSL_GetVerifyDecryptCtx(WOLFSSL* ssl);
3172
3173 WOLFSSL_API const unsigned char* wolfSSL_GetMacSecret(WOLFSSL* ssl, int verify);
3174 WOLFSSL_API const unsigned char* wolfSSL_GetDtlsMacSecret(WOLFSSL* ssl, int verify, int epochOrder);
3175 WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteKey(WOLFSSL* ssl);
3176 WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteIV(WOLFSSL* ssl);
3177 WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteKey(WOLFSSL* ssl);
3178 WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteIV(WOLFSSL* ssl);
3179 WOLFSSL_API int wolfSSL_GetKeySize(WOLFSSL* ssl);
3180 WOLFSSL_API int wolfSSL_GetIVSize(WOLFSSL* ssl);
3181 WOLFSSL_API int wolfSSL_GetSide(WOLFSSL* ssl);
3182 WOLFSSL_API int wolfSSL_IsTLSv1_1(WOLFSSL* ssl);
3183 WOLFSSL_API int wolfSSL_GetBulkCipher(WOLFSSL* ssl);
3184 WOLFSSL_API int wolfSSL_GetCipherBlockSize(WOLFSSL* ssl);
3185 WOLFSSL_API int wolfSSL_GetAeadMacSize(WOLFSSL* ssl);
3186 WOLFSSL_API int wolfSSL_GetHmacSize(WOLFSSL* ssl);
3187 WOLFSSL_API int wolfSSL_GetHmacType(WOLFSSL* ssl);
3188 #ifdef WORD64_AVAILABLE
3189 WOLFSSL_API int wolfSSL_GetPeerSequenceNumber(WOLFSSL* ssl, word64* seq);
3190 WOLFSSL_API int wolfSSL_GetSequenceNumber(WOLFSSL* ssl, word64* seq);
3191 #endif
3192 WOLFSSL_API int wolfSSL_GetCipherType(WOLFSSL* ssl);
3193 WOLFSSL_API int wolfSSL_SetTlsHmacInner(WOLFSSL* ssl,
3194 byte* inner, word32 sz, int content, int verify);
3195
3196 /* Atomic User Needs */
3197 enum {
3198 WOLFSSL_SERVER_END = 0,
3199 WOLFSSL_CLIENT_END = 1,
3200 WOLFSSL_NEITHER_END = 3,
3201 WOLFSSL_BLOCK_TYPE = 2,
3202 WOLFSSL_STREAM_TYPE = 3,
3203 WOLFSSL_AEAD_TYPE = 4,
3204 WOLFSSL_TLS_HMAC_INNER_SZ = 13 /* SEQ_SZ + ENUM + VERSION_SZ + LEN_SZ */
3205 };
3206
3207 /* for GetBulkCipher and internal use
3208 * using explicit values to assist with serialization of a TLS session */
3209 enum BulkCipherAlgorithm {
3210 wolfssl_cipher_null = 0,
3211 wolfssl_rc4 = 1,
3212 wolfssl_rc2 = 2,
3213 wolfssl_des = 3,
3214 wolfssl_triple_des = 4,
3215 wolfssl_des40 = 5,
3216 wolfssl_aes = 6,
3217 wolfssl_aes_gcm = 7,
3218 wolfssl_aes_ccm = 8,
3219 wolfssl_chacha = 9,
3220 wolfssl_camellia = 10
3221 };
3222
3223
3224 /* for KDF TLS 1.2 mac types */
3225 enum KDF_MacAlgorithm {
3226 wolfssl_sha256 = 4, /* needs to match hash.h wc_MACAlgorithm */
3227 wolfssl_sha384,
3228 wolfssl_sha512
3229 };
3230
3231
3232 /* Public Key Callback support */
3233 #ifdef HAVE_PK_CALLBACKS
3234 #ifdef HAVE_ECC
3235
3236 struct ecc_key;
3237
3238 typedef int (*CallbackEccKeyGen)(WOLFSSL* ssl, struct ecc_key* key,
3239 unsigned int keySz, int ecc_curve, void* ctx);

NetBurner, Inc.
1068 File Documentation

3240 WOLFSSL_API void wolfSSL_CTX_SetEccKeyGenCb(WOLFSSL_CTX* ctx, CallbackEccKeyGen cb);


3241 WOLFSSL_API void wolfSSL_SetEccKeyGenCtx(WOLFSSL* ssl, void *ctx);
3242 WOLFSSL_API void* wolfSSL_GetEccKeyGenCtx(WOLFSSL* ssl);
3243
3244 typedef int (*CallbackEccSign)(WOLFSSL* ssl,
3245 const unsigned char* in, unsigned int inSz,
3246 unsigned char* out, word32* outSz,
3247 const unsigned char* keyDer, unsigned int keySz,
3248 void* ctx);
3249 WOLFSSL_ABI WOLFSSL_API void wolfSSL_CTX_SetEccSignCb(WOLFSSL_CTX* ctx,
3250 CallbackEccSign cb);
3251 WOLFSSL_API void wolfSSL_SetEccSignCtx(WOLFSSL* ssl, void *ctx);
3252 WOLFSSL_API void* wolfSSL_GetEccSignCtx(WOLFSSL* ssl);
3253 WOLFSSL_API void wolfSSL_CTX_SetEccSignCtx(WOLFSSL_CTX* ctx, void *userCtx);
3254 WOLFSSL_API void* wolfSSL_CTX_GetEccSignCtx(WOLFSSL_CTX* ctx);
3255
3256 typedef int (*CallbackEccVerify)(WOLFSSL* ssl,
3257 const unsigned char* sig, unsigned int sigSz,
3258 const unsigned char* hash, unsigned int hashSz,
3259 const unsigned char* keyDer, unsigned int keySz,
3260 int* result, void* ctx);
3261 WOLFSSL_API void wolfSSL_CTX_SetEccVerifyCb(WOLFSSL_CTX* ctx, CallbackEccVerify cb);
3262 WOLFSSL_API void wolfSSL_SetEccVerifyCtx(WOLFSSL* ssl, void *ctx);
3263 WOLFSSL_API void* wolfSSL_GetEccVerifyCtx(WOLFSSL* ssl);
3264
3265 typedef int (*CallbackEccSharedSecret)(WOLFSSL* ssl, struct ecc_key* otherKey,
3266 unsigned char* pubKeyDer, word32* pubKeySz,
3267 unsigned char* out, word32* outlen,
3268 int side, void* ctx); /* side is WOLFSSL_CLIENT_END or WOLFSSL_SERVER_END */
3269 WOLFSSL_API void wolfSSL_CTX_SetEccSharedSecretCb(WOLFSSL_CTX* ctx, CallbackEccSharedSecret cb);
3270 WOLFSSL_API void wolfSSL_SetEccSharedSecretCtx(WOLFSSL* ssl, void *ctx);
3271 WOLFSSL_API void* wolfSSL_GetEccSharedSecretCtx(WOLFSSL* ssl);
3272 #endif
3273
3274 #ifdef HAVE_HKDF
3275 #include <wolfssl/wolfcrypt/kdf.h>
3276 typedef int (*CallbackHKDFExtract)(byte* prk, const byte* salt, word32 saltLen,
3277 byte* ikm, word32 ikmLen, int digest, void* ctx);
3278 WOLFSSL_API void wolfSSL_CTX_SetHKDFExtractCb(WOLFSSL_CTX* ctx, CallbackHKDFExtract cb);
3279 WOLFSSL_API void* wolfSSL_GetHKDFExtractCtx(WOLFSSL* ssl);
3280 WOLFSSL_API void wolfSSL_SetHKDFExtractCtx(WOLFSSL* ssl, void *ctx);
3281 #endif
3282
3283 #ifndef NO_DH
3284 /* Public DH Key Callback support */
3285 struct DhKey;
3286 typedef int (*CallbackDhAgree)(WOLFSSL* ssl, struct DhKey* key,
3287 const unsigned char* priv, unsigned int privSz,
3288 const unsigned char* otherPubKeyDer, unsigned int otherPubKeySz,
3289 unsigned char* out, word32* outlen,
3290 void* ctx);
3291 WOLFSSL_API void wolfSSL_CTX_SetDhAgreeCb(WOLFSSL_CTX* ctx, CallbackDhAgree cb);
3292 WOLFSSL_API void wolfSSL_SetDhAgreeCtx(WOLFSSL* ssl, void *ctx);
3293 WOLFSSL_API void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl);
3294 #endif /* !NO_DH */
3295
3296 #ifdef HAVE_ED25519
3297 struct ed25519_key;
3298 typedef int (*CallbackEd25519Sign)(WOLFSSL* ssl,
3299 const unsigned char* in, unsigned int inSz,
3300 unsigned char* out, unsigned int* outSz,
3301 const unsigned char* keyDer, unsigned int keySz,
3302 void* ctx);
3303 WOLFSSL_API void wolfSSL_CTX_SetEd25519SignCb(WOLFSSL_CTX* ctx,
3304 CallbackEd25519Sign cb);
3305 WOLFSSL_API void wolfSSL_SetEd25519SignCtx(WOLFSSL* ssl, void *ctx);
3306 WOLFSSL_API void* wolfSSL_GetEd25519SignCtx(WOLFSSL* ssl);
3307
3308 typedef int (*CallbackEd25519Verify)(WOLFSSL* ssl,
3309 const unsigned char* sig, unsigned int sigSz,
3310 const unsigned char* msg, unsigned int msgSz,
3311 const unsigned char* keyDer, unsigned int keySz,
3312 int* result, void* ctx);
3313 WOLFSSL_API void wolfSSL_CTX_SetEd25519VerifyCb(WOLFSSL_CTX* ctx,
3314 CallbackEd25519Verify cb);
3315 WOLFSSL_API void wolfSSL_SetEd25519VerifyCtx(WOLFSSL* ssl, void *ctx);
3316 WOLFSSL_API void* wolfSSL_GetEd25519VerifyCtx(WOLFSSL* ssl);
3317 #endif
3318
3319 #ifdef HAVE_CURVE25519
3320 struct curve25519_key;
3321
3322 typedef int (*CallbackX25519KeyGen)(WOLFSSL* ssl, struct curve25519_key* key,
3323 unsigned int keySz, void* ctx);
3324 WOLFSSL_API void wolfSSL_CTX_SetX25519KeyGenCb(WOLFSSL_CTX* ctx, CallbackX25519KeyGen cb);
3325 WOLFSSL_API void wolfSSL_SetX25519KeyGenCtx(WOLFSSL* ssl, void *ctx);
3326 WOLFSSL_API void* wolfSSL_GetX25519KeyGenCtx(WOLFSSL* ssl);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1069

3327
3328 typedef int (*CallbackX25519SharedSecret)(WOLFSSL* ssl,
3329 struct curve25519_key* otherKey,
3330 unsigned char* pubKeyDer, unsigned int* pubKeySz,
3331 unsigned char* out, unsigned int* outlen,
3332 int side, void* ctx);
3333 /* side is WOLFSSL_CLIENT_END or WOLFSSL_SERVER_END */
3334 WOLFSSL_API void wolfSSL_CTX_SetX25519SharedSecretCb(WOLFSSL_CTX* ctx,
3335 CallbackX25519SharedSecret cb);
3336 WOLFSSL_API void wolfSSL_SetX25519SharedSecretCtx(WOLFSSL* ssl, void *ctx);
3337 WOLFSSL_API void* wolfSSL_GetX25519SharedSecretCtx(WOLFSSL* ssl);
3338 #endif
3339
3340 #ifdef HAVE_ED448
3341 struct ed448_key;
3342 typedef int (*CallbackEd448Sign)(WOLFSSL* ssl,
3343 const unsigned char* in, unsigned int inSz,
3344 unsigned char* out, unsigned int* outSz,
3345 const unsigned char* keyDer, unsigned int keySz,
3346 void* ctx);
3347 WOLFSSL_API void wolfSSL_CTX_SetEd448SignCb(WOLFSSL_CTX* ctx,
3348 CallbackEd448Sign cb);
3349 WOLFSSL_API void wolfSSL_SetEd448SignCtx(WOLFSSL* ssl, void *ctx);
3350 WOLFSSL_API void* wolfSSL_GetEd448SignCtx(WOLFSSL* ssl);
3351
3352 typedef int (*CallbackEd448Verify)(WOLFSSL* ssl,
3353 const unsigned char* sig, unsigned int sigSz,
3354 const unsigned char* msg, unsigned int msgSz,
3355 const unsigned char* keyDer, unsigned int keySz,
3356 int* result, void* ctx);
3357 WOLFSSL_API void wolfSSL_CTX_SetEd448VerifyCb(WOLFSSL_CTX* ctx,
3358 CallbackEd448Verify cb);
3359 WOLFSSL_API void wolfSSL_SetEd448VerifyCtx(WOLFSSL* ssl, void *ctx);
3360 WOLFSSL_API void* wolfSSL_GetEd448VerifyCtx(WOLFSSL* ssl);
3361 #endif
3362
3363 #ifdef HAVE_CURVE448
3364 struct curve448_key;
3365
3366 typedef int (*CallbackX448KeyGen)(WOLFSSL* ssl, struct curve448_key* key,
3367 unsigned int keySz, void* ctx);
3368 WOLFSSL_API void wolfSSL_CTX_SetX448KeyGenCb(WOLFSSL_CTX* ctx, CallbackX448KeyGen cb);
3369 WOLFSSL_API void wolfSSL_SetX448KeyGenCtx(WOLFSSL* ssl, void *ctx);
3370 WOLFSSL_API void* wolfSSL_GetX448KeyGenCtx(WOLFSSL* ssl);
3371
3372 typedef int (*CallbackX448SharedSecret)(WOLFSSL* ssl,
3373 struct curve448_key* otherKey,
3374 unsigned char* pubKeyDer, unsigned int* pubKeySz,
3375 unsigned char* out, unsigned int* outlen,
3376 int side, void* ctx);
3377 /* side is WOLFSSL_CLIENT_END or WOLFSSL_SERVER_END */
3378 WOLFSSL_API void wolfSSL_CTX_SetX448SharedSecretCb(WOLFSSL_CTX* ctx,
3379 CallbackX448SharedSecret cb);
3380 WOLFSSL_API void wolfSSL_SetX448SharedSecretCtx(WOLFSSL* ssl, void *ctx);
3381 WOLFSSL_API void* wolfSSL_GetX448SharedSecretCtx(WOLFSSL* ssl);
3382 #endif
3383
3384 #ifndef NO_RSA
3385 typedef int (*CallbackRsaSign)(WOLFSSL* ssl,
3386 const unsigned char* in, unsigned int inSz,
3387 unsigned char* out, word32* outSz,
3388 const unsigned char* keyDer, unsigned int keySz,
3389 void* ctx);
3390 WOLFSSL_API void wolfSSL_CTX_SetRsaSignCb(WOLFSSL_CTX* ctx, CallbackRsaSign cb);
3391 WOLFSSL_API void wolfSSL_SetRsaSignCtx(WOLFSSL* ssl, void *ctx);
3392 WOLFSSL_API void* wolfSSL_GetRsaSignCtx(WOLFSSL* ssl);
3393
3394 typedef int (*CallbackRsaVerify)(WOLFSSL* ssl,
3395 unsigned char* sig, unsigned int sigSz,
3396 unsigned char** out,
3397 const unsigned char* keyDer, unsigned int keySz,
3398 void* ctx);
3399 WOLFSSL_API void wolfSSL_CTX_SetRsaVerifyCb(WOLFSSL_CTX* ctx, CallbackRsaVerify cb);
3400 WOLFSSL_API void wolfSSL_CTX_SetRsaSignCheckCb(WOLFSSL_CTX* ctx, CallbackRsaVerify cb);
3401 WOLFSSL_API void wolfSSL_SetRsaVerifyCtx(WOLFSSL* ssl, void *ctx);
3402 WOLFSSL_API void* wolfSSL_GetRsaVerifyCtx(WOLFSSL* ssl);
3403
3404 #ifdef WC_RSA_PSS
3405 typedef int (*CallbackRsaPssSign)(WOLFSSL* ssl,
3406 const unsigned char* in, unsigned int inSz,
3407 unsigned char* out, unsigned int* outSz,
3408 int hash, int mgf,
3409 const unsigned char* keyDer, unsigned int keySz,
3410 void* ctx);
3411 WOLFSSL_API void wolfSSL_CTX_SetRsaPssSignCb(WOLFSSL_CTX* ctx, CallbackRsaPssSign cb);
3412 WOLFSSL_API void wolfSSL_SetRsaPssSignCtx(WOLFSSL* ssl, void *ctx);
3413 WOLFSSL_API void* wolfSSL_GetRsaPssSignCtx(WOLFSSL* ssl);

NetBurner, Inc.
1070 File Documentation

3414
3415 typedef int (*CallbackRsaPssVerify)(WOLFSSL* ssl,
3416 unsigned char* sig, unsigned int sigSz,
3417 unsigned char** out,
3418 int hash, int mgf,
3419 const unsigned char* keyDer, unsigned int keySz,
3420 void* ctx);
3421 WOLFSSL_API void wolfSSL_CTX_SetRsaPssVerifyCb(WOLFSSL_CTX* ctx,
3422 CallbackRsaPssVerify cb);
3423 WOLFSSL_API void wolfSSL_CTX_SetRsaPssSignCheckCb(WOLFSSL_CTX* ctx,
3424 CallbackRsaPssVerify cb);
3425 WOLFSSL_API void wolfSSL_SetRsaPssVerifyCtx(WOLFSSL* ssl, void *ctx);
3426 WOLFSSL_API void* wolfSSL_GetRsaPssVerifyCtx(WOLFSSL* ssl);
3427 #endif
3428
3429 /* RSA Public Encrypt cb */
3430 typedef int (*CallbackRsaEnc)(WOLFSSL* ssl,
3431 const unsigned char* in, unsigned int inSz,
3432 unsigned char* out, word32* outSz,
3433 const unsigned char* keyDer, unsigned int keySz,
3434 void* ctx);
3435 WOLFSSL_API void wolfSSL_CTX_SetRsaEncCb(WOLFSSL_CTX* ctx, CallbackRsaEnc cb);
3436 WOLFSSL_API void wolfSSL_SetRsaEncCtx(WOLFSSL* ssl, void *ctx);
3437 WOLFSSL_API void* wolfSSL_GetRsaEncCtx(WOLFSSL* ssl);
3438
3439 /* RSA Private Decrypt cb */
3440 typedef int (*CallbackRsaDec)(WOLFSSL* ssl,
3441 unsigned char* in, unsigned int inSz,
3442 unsigned char** out,
3443 const unsigned char* keyDer, unsigned int keySz,
3444 void* ctx);
3445 WOLFSSL_API void wolfSSL_CTX_SetRsaDecCb(WOLFSSL_CTX* ctx, CallbackRsaDec cb);
3446 WOLFSSL_API void wolfSSL_SetRsaDecCtx(WOLFSSL* ssl, void *ctx);
3447 WOLFSSL_API void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl);
3448 #endif
3449
3450 /* Protocol Callback */
3451 typedef int (*CallbackGenMasterSecret)(WOLFSSL* ssl, void* ctx);
3452 WOLFSSL_API void wolfSSL_CTX_SetGenMasterSecretCb(WOLFSSL_CTX* ctx,
3453 CallbackGenMasterSecret cb);
3454 WOLFSSL_API void wolfSSL_SetGenMasterSecretCtx(WOLFSSL* ssl, void *ctx);
3455 WOLFSSL_API void* wolfSSL_GetGenMasterSecretCtx(WOLFSSL* ssl);
3456
3457 typedef int (*CallbackGenPreMaster)(WOLFSSL* ssl, byte *premaster,
3458 word32 preSz, void* ctx);
3459 WOLFSSL_API void wolfSSL_CTX_SetGenPreMasterCb(WOLFSSL_CTX* ctx,
3460 CallbackGenPreMaster cb);
3461 WOLFSSL_API void wolfSSL_SetGenPreMasterCtx(WOLFSSL* ssl, void *ctx);
3462 WOLFSSL_API void* wolfSSL_GetGenPreMasterCtx(WOLFSSL* ssl);
3463
3464 typedef int (*CallbackGenSessionKey)(WOLFSSL* ssl, void* ctx);
3465 WOLFSSL_API void wolfSSL_CTX_SetGenSessionKeyCb(WOLFSSL_CTX* ctx,
3466 CallbackGenSessionKey cb);
3467 WOLFSSL_API void wolfSSL_SetGenSessionKeyCtx(WOLFSSL* ssl, void *ctx);
3468 WOLFSSL_API void* wolfSSL_GetGenSessionKeyCtx(WOLFSSL* ssl);
3469
3470 typedef int (*CallbackEncryptKeys)(WOLFSSL* ssl, void* ctx);
3471 WOLFSSL_API void wolfSSL_CTX_SetEncryptKeysCb(WOLFSSL_CTX* ctx,
3472 CallbackEncryptKeys cb);
3473 WOLFSSL_API void wolfSSL_SetEncryptKeysCtx(WOLFSSL* ssl, void *ctx);
3474 WOLFSSL_API void* wolfSSL_GetEncryptKeysCtx(WOLFSSL* ssl);
3475
3476 typedef int (*CallbackTlsFinished)(WOLFSSL* ssl,
3477 const byte *side,
3478 const byte *handshake_hash,
3479 byte *hashes, void* ctx);
3480 WOLFSSL_API void wolfSSL_CTX_SetTlsFinishedCb(WOLFSSL_CTX* ctx, CallbackTlsFinished cb);
3481 WOLFSSL_API void wolfSSL_SetTlsFinishedCtx(WOLFSSL* ssl, void *ctx);
3482 WOLFSSL_API void* wolfSSL_GetTlsFinishedCtx(WOLFSSL* ssl);
3483
3484 #if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
3485 typedef int (*CallbackVerifyMac)(WOLFSSL *ssl, const byte* message,
3486 word32 messageSz, word32 macSz, word32 content, void* ctx);
3487 WOLFSSL_API void wolfSSL_CTX_SetVerifyMacCb(WOLFSSL_CTX* ctx, CallbackVerifyMac cb);
3488 WOLFSSL_API void wolfSSL_SetVerifyMacCtx(WOLFSSL* ssl, void *ctx);
3489 WOLFSSL_API void* wolfSSL_GetVerifyMacCtx(WOLFSSL* ssl);
3490 #endif
3491
3492 #endif /* HAVE_PK_CALLBACKS */
3493
3494 #ifndef NO_CERTS
3495 WOLFSSL_API void wolfSSL_CTX_SetCACb(WOLFSSL_CTX* ctx, CallbackCACache cb);
3496
3497 WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CTX_GetCertManager(WOLFSSL_CTX* ctx);
3498
3499 WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew_ex(void* heap);
3500 WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1071

3501 WOLFSSL_API void wolfSSL_CertManagerFree(WOLFSSL_CERT_MANAGER* cm);


3502 WOLFSSL_API int wolfSSL_CertManager_up_ref(WOLFSSL_CERT_MANAGER* cm);
3503
3504 WOLFSSL_API int wolfSSL_CertManagerLoadCA(WOLFSSL_CERT_MANAGER* cm, const char* f,
3505 const char* d);
3506 WOLFSSL_API int wolfSSL_CertManagerLoadCABuffer(WOLFSSL_CERT_MANAGER* cm,
3507 const unsigned char* in, long sz, int format);
3508 WOLFSSL_API int wolfSSL_CertManagerUnloadCAs(WOLFSSL_CERT_MANAGER* cm);
3509 #ifdef WOLFSSL_TRUST_PEER_CERT
3510 WOLFSSL_API int wolfSSL_CertManagerUnload_trust_peers(WOLFSSL_CERT_MANAGER* cm);
3511 #endif
3512 WOLFSSL_API int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER* cm, const char* f,
3513 int format);
3514 WOLFSSL_API int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm,
3515 const unsigned char* buff, long sz, int format);
3516 WOLFSSL_API int wolfSSL_CertManagerCheckCRL(WOLFSSL_CERT_MANAGER* cm,
3517 unsigned char* der, int sz);
3518 WOLFSSL_API int wolfSSL_CertManagerEnableCRL(WOLFSSL_CERT_MANAGER* cm,
3519 int options);
3520 WOLFSSL_API int wolfSSL_CertManagerDisableCRL(WOLFSSL_CERT_MANAGER* cm);
3521 WOLFSSL_API void wolfSSL_CertManagerSetVerify(WOLFSSL_CERT_MANAGER* cm,
3522 VerifyCallback vc);
3523 WOLFSSL_API int wolfSSL_CertManagerLoadCRL(WOLFSSL_CERT_MANAGER* cm,
3524 const char* path, int type, int monitor);
3525 WOLFSSL_API int wolfSSL_CertManagerLoadCRLFile(WOLFSSL_CERT_MANAGER* cm,
3526 const char* file, int type);
3527 WOLFSSL_API int wolfSSL_CertManagerLoadCRLBuffer(WOLFSSL_CERT_MANAGER* cm,
3528 const unsigned char* buff, long sz, int type);
3529 WOLFSSL_API int wolfSSL_CertManagerSetCRL_Cb(WOLFSSL_CERT_MANAGER* cm,
3530 CbMissingCRL cb);
3531 WOLFSSL_API int wolfSSL_CertManagerFreeCRL(WOLFSSL_CERT_MANAGER* cm);
3532 #ifdef HAVE_CRL_IO
3533 WOLFSSL_API int wolfSSL_CertManagerSetCRL_IOCb(WOLFSSL_CERT_MANAGER* cm,
3534 CbCrlIO cb);
3535 #endif
3536 #if defined(HAVE_OCSP)
3537 WOLFSSL_API int wolfSSL_CertManagerCheckOCSPResponse(WOLFSSL_CERT_MANAGER* cm,
3538 byte *response, int responseSz, WOLFSSL_BUFFER_INFO *responseBuffer,
3539 CertStatus *status, OcspEntry *entry, OcspRequest *ocspRequest);
3540 #endif
3541 WOLFSSL_API int wolfSSL_CertManagerCheckOCSP(WOLFSSL_CERT_MANAGER* cm,
3542 unsigned char* der, int sz);
3543 WOLFSSL_API int wolfSSL_CertManagerEnableOCSP(WOLFSSL_CERT_MANAGER* cm,
3544 int options);
3545 WOLFSSL_API int wolfSSL_CertManagerDisableOCSP(WOLFSSL_CERT_MANAGER* cm);
3546 WOLFSSL_API int wolfSSL_CertManagerSetOCSPOverrideURL(WOLFSSL_CERT_MANAGER* cm,
3547 const char* url);
3548 WOLFSSL_API int wolfSSL_CertManagerSetOCSP_Cb(WOLFSSL_CERT_MANAGER* cm,
3549 CbOCSPIO ioCb, CbOCSPRespFree respFreeCb, void*
ioCbCtx);
3550
3551 WOLFSSL_API int wolfSSL_CertManagerEnableOCSPStapling(
3552 WOLFSSL_CERT_MANAGER* cm);
3553 WOLFSSL_API int wolfSSL_CertManagerDisableOCSPStapling(
3554 WOLFSSL_CERT_MANAGER* cm);
3555 WOLFSSL_API int wolfSSL_CertManagerEnableOCSPMustStaple(
3556 WOLFSSL_CERT_MANAGER* cm);
3557 WOLFSSL_API int wolfSSL_CertManagerDisableOCSPMustStaple(
3558 WOLFSSL_CERT_MANAGER* cm);
3559 #if defined(OPENSSL_EXTRA) && defined(WOLFSSL_SIGNER_DER_CERT) && \
3560 !defined(NO_FILESYSTEM)
3561 WOLFSSL_API WOLFSSL_STACK* wolfSSL_CertManagerGetCerts(WOLFSSL_CERT_MANAGER* cm);
3562 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_X509_STORE_get1_certs(
3563 WOLFSSL_X509_STORE_CTX* ctx, WOLFSSL_X509_NAME* name);
3564 #endif /* OPENSSL_EXTRA && WOLFSSL_SIGNER_DER_CERT && !NO_FILESYSTEM */
3565 WOLFSSL_API int wolfSSL_EnableCRL(WOLFSSL* ssl, int options);
3566 WOLFSSL_API int wolfSSL_DisableCRL(WOLFSSL* ssl);
3567 WOLFSSL_API int wolfSSL_LoadCRL(WOLFSSL* ssl, const char* path, int type, int monitor);
3568 WOLFSSL_API int wolfSSL_LoadCRLFile(WOLFSSL* ssl, const char* file, int type);
3569 WOLFSSL_API int wolfSSL_LoadCRLBuffer(WOLFSSL* ssl,
3570 const unsigned char* buff, long sz, int type);
3571 WOLFSSL_API int wolfSSL_SetCRL_Cb(WOLFSSL* ssl, CbMissingCRL cb);
3572 #ifdef HAVE_CRL_IO
3573 WOLFSSL_API int wolfSSL_SetCRL_IOCb(WOLFSSL* ssl, CbCrlIO cb);
3574 #endif
3575 WOLFSSL_API int wolfSSL_EnableOCSP(WOLFSSL* ssl, int options);
3576 WOLFSSL_API int wolfSSL_DisableOCSP(WOLFSSL* ssl);
3577 WOLFSSL_API int wolfSSL_SetOCSP_OverrideURL(WOLFSSL* ssl, const char* url);
3578 WOLFSSL_API int wolfSSL_SetOCSP_Cb(WOLFSSL* ssl, CbOCSPIO ioCb, CbOCSPRespFree respFreeCb, void*
ioCbCtx);
3579 WOLFSSL_API int wolfSSL_EnableOCSPStapling(WOLFSSL* ssl);
3580 WOLFSSL_API int wolfSSL_DisableOCSPStapling(WOLFSSL* ssl);
3581
3582 WOLFSSL_API int wolfSSL_CTX_EnableCRL(WOLFSSL_CTX* ctx, int options);
3583 WOLFSSL_API int wolfSSL_CTX_DisableCRL(WOLFSSL_CTX* ctx);
3584 WOLFSSL_API int wolfSSL_CTX_LoadCRL(WOLFSSL_CTX* ctx, const char* path, int type, int monitor);
3585 WOLFSSL_API int wolfSSL_CTX_LoadCRLFile(WOLFSSL_CTX* ctx, const char* path, int type);

NetBurner, Inc.
1072 File Documentation

3586 WOLFSSL_API int wolfSSL_CTX_LoadCRLBuffer(WOLFSSL_CTX* ctx,


3587 const unsigned char* buff, long sz, int type);
3588 WOLFSSL_API int wolfSSL_CTX_SetCRL_Cb(WOLFSSL_CTX* ctx, CbMissingCRL cb);
3589 #ifdef HAVE_CRL_IO
3590 WOLFSSL_API int wolfSSL_CTX_SetCRL_IOCb(WOLFSSL_CTX* ctx, CbCrlIO cb);
3591 #endif
3592
3593 WOLFSSL_API int wolfSSL_CTX_EnableOCSP(WOLFSSL_CTX* ctx, int options);
3594 WOLFSSL_API int wolfSSL_CTX_DisableOCSP(WOLFSSL_CTX* ctx);
3595 WOLFSSL_API int wolfSSL_CTX_SetOCSP_OverrideURL(WOLFSSL_CTX* ctx, const char* url);
3596 WOLFSSL_API int wolfSSL_CTX_SetOCSP_Cb(WOLFSSL_CTX* ctx,
3597 CbOCSPIO ioCb, CbOCSPRespFree respFreeCb, void*
ioCbCtx);
3598 WOLFSSL_API int wolfSSL_CTX_EnableOCSPStapling(WOLFSSL_CTX* ctx);
3599 WOLFSSL_API int wolfSSL_CTX_DisableOCSPStapling(WOLFSSL_CTX* ctx);
3600 WOLFSSL_API int wolfSSL_CTX_EnableOCSPMustStaple(WOLFSSL_CTX* ctx);
3601 WOLFSSL_API int wolfSSL_CTX_DisableOCSPMustStaple(WOLFSSL_CTX* ctx);
3602 #endif /* !NO_CERTS */
3603
3604
3605 #ifdef SINGLE_THREADED
3606 WOLFSSL_API int wolfSSL_CTX_new_rng(WOLFSSL_CTX* ctx);
3607 #endif
3608
3609 /* end of handshake frees temporary arrays, if user needs for get_keys or
3610 psk hints, call KeepArrays before handshake and then FreeArrays when done
3611 if don’t want to wait for object free */
3612 WOLFSSL_API void wolfSSL_KeepArrays(WOLFSSL* ssl);
3613 WOLFSSL_API void wolfSSL_FreeArrays(WOLFSSL* ssl);
3614
3615 WOLFSSL_API int wolfSSL_KeepHandshakeResources(WOLFSSL* ssl);
3616 WOLFSSL_API int wolfSSL_FreeHandshakeResources(WOLFSSL* ssl);
3617
3618 WOLFSSL_API int wolfSSL_CTX_UseClientSuites(WOLFSSL_CTX* ctx);
3619 WOLFSSL_API int wolfSSL_UseClientSuites(WOLFSSL* ssl);
3620
3621 /* async additions */
3622 #define wolfSSL_UseAsync wolfSSL_SetDevId
3623 #define wolfSSL_CTX_UseAsync wolfSSL_CTX_SetDevId
3624 WOLFSSL_ABI WOLFSSL_API int wolfSSL_SetDevId(WOLFSSL* ssl, int devId);
3625 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_SetDevId(WOLFSSL_CTX* ctx, int devId);
3626
3627 /* helpers to get device id and heap */
3628 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_GetDevId(WOLFSSL_CTX* ctx, WOLFSSL* ssl);
3629 WOLFSSL_API void* wolfSSL_CTX_GetHeap(WOLFSSL_CTX* ctx, WOLFSSL* ssl);
3630
3631 /* TLS Extensions */
3632
3633 /* Server Name Indication */
3634 #ifdef HAVE_SNI
3635
3636 /* SNI types */
3637 enum {
3638 WOLFSSL_SNI_HOST_NAME = 0
3639 };
3640
3641 WOLFSSL_ABI WOLFSSL_API int wolfSSL_UseSNI(WOLFSSL* ssl, unsigned char type,
3642 const void* data, unsigned short size);
3643 WOLFSSL_ABI WOLFSSL_API int wolfSSL_CTX_UseSNI(WOLFSSL_CTX* ctx, unsigned char type,
3644 const void* data, unsigned short size);
3645
3646 #ifndef NO_WOLFSSL_SERVER
3647
3648 /* SNI options */
3649 enum {
3650 /* Do not abort the handshake if the requested SNI didn’t match. */
3651 WOLFSSL_SNI_CONTINUE_ON_MISMATCH = 0x01,
3652
3653 /* Behave as if the requested SNI matched in a case of mismatch. */
3654 /* In this case, the status will be set to WOLFSSL_SNI_FAKE_MATCH. */
3655 WOLFSSL_SNI_ANSWER_ON_MISMATCH = 0x02,
3656
3657 /* Abort the handshake if the client didn’t send a SNI request. */
3658 WOLFSSL_SNI_ABORT_ON_ABSENCE = 0x04,
3659 };
3660
3661 WOLFSSL_API void wolfSSL_SNI_SetOptions(WOLFSSL* ssl, unsigned char type,
3662 unsigned char options);
3663 WOLFSSL_API void wolfSSL_CTX_SNI_SetOptions(WOLFSSL_CTX* ctx,
3664 unsigned char type, unsigned char options);
3665 WOLFSSL_API int wolfSSL_SNI_GetFromBuffer(
3666 const unsigned char* clientHello, unsigned int helloSz,
3667 unsigned char type, unsigned char* sni, unsigned int* inOutSz);
3668
3669 #endif /* NO_WOLFSSL_SERVER */
3670
3671 /* SNI status */

NetBurner, Inc.
22.199 wolfssl/ssl.h 1073

3672 enum {
3673 WOLFSSL_SNI_NO_MATCH = 0,
3674 WOLFSSL_SNI_FAKE_MATCH = 1,
3675 WOLFSSL_SNI_REAL_MATCH = 2,
3676 WOLFSSL_SNI_FORCE_KEEP = 3
3677 };
3678
3679 WOLFSSL_API unsigned char wolfSSL_SNI_Status(WOLFSSL* ssl, unsigned char type);
3680
3681 WOLFSSL_API unsigned short wolfSSL_SNI_GetRequest(WOLFSSL *ssl,
3682 unsigned char type, void** data);
3683
3684 #endif /* HAVE_SNI */
3685
3686 /* Trusted CA Key Indication - RFC 6066 (Section 6) */
3687 #ifdef HAVE_TRUSTED_CA
3688
3689 /* TCA Identifier Type */
3690 enum {
3691 WOLFSSL_TRUSTED_CA_PRE_AGREED = 0,
3692 WOLFSSL_TRUSTED_CA_KEY_SHA1 = 1,
3693 WOLFSSL_TRUSTED_CA_X509_NAME = 2,
3694 WOLFSSL_TRUSTED_CA_CERT_SHA1 = 3
3695 };
3696
3697 WOLFSSL_API int wolfSSL_UseTrustedCA(WOLFSSL* ssl, unsigned char type,
3698 const unsigned char* certId, unsigned int certIdSz);
3699 #endif /* HAVE_TRUSTED_CA */
3700
3701 /* Application-Layer Protocol Negotiation */
3702 #ifdef HAVE_ALPN
3703
3704 /* ALPN status code */
3705 enum {
3706 WOLFSSL_ALPN_NO_MATCH = 0,
3707 WOLFSSL_ALPN_MATCH = 1,
3708 WOLFSSL_ALPN_CONTINUE_ON_MISMATCH = 2,
3709 WOLFSSL_ALPN_FAILED_ON_MISMATCH = 4,
3710 };
3711
3712 enum {
3713 WOLFSSL_MAX_ALPN_PROTO_NAME_LEN = 255,
3714 WOLFSSL_MAX_ALPN_NUMBER = 257
3715 };
3716
3717 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
3718 defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY) || \
3719 defined(WOLFSSL_QUIC)
3720 typedef int (*CallbackALPNSelect)(WOLFSSL* ssl, const unsigned char** out,
3721 unsigned char* outLen, const unsigned char* in, unsigned int inLen,
3722 void *arg);
3723 #endif
3724
3725 WOLFSSL_ABI WOLFSSL_API int wolfSSL_UseALPN(WOLFSSL* ssl,
3726 char *protocol_name_list,
3727 unsigned int protocol_name_listSz,
3728 unsigned char options);
3729
3730 WOLFSSL_API int wolfSSL_ALPN_GetProtocol(WOLFSSL* ssl, char **protocol_name,
3731 unsigned short *size);
3732
3733 WOLFSSL_API int wolfSSL_ALPN_GetPeerProtocol(WOLFSSL* ssl, char **list,
3734 unsigned short *listSz);
3735 WOLFSSL_API int wolfSSL_ALPN_FreePeerProtocol(WOLFSSL* ssl, char **list);
3736 #endif /* HAVE_ALPN */
3737
3738 /* Maximum Fragment Length */
3739 #ifdef HAVE_MAX_FRAGMENT
3740
3741 /* Fragment lengths */
3742 enum {
3743 WOLFSSL_MFL_2_9 = 1, /* 512 bytes */
3744 WOLFSSL_MFL_2_10 = 2, /* 1024 bytes */
3745 WOLFSSL_MFL_2_11 = 3, /* 2048 bytes */
3746 WOLFSSL_MFL_2_12 = 4, /* 4096 bytes */
3747 WOLFSSL_MFL_2_13 = 5, /* 8192 bytes *//* wolfSSL ONLY!!! */
3748 WOLFSSL_MFL_2_8 = 6, /* 256 bytes *//* wolfSSL ONLY!!! */
3749 WOLFSSL_MFL_MIN = WOLFSSL_MFL_2_9,
3750 WOLFSSL_MFL_MAX = WOLFSSL_MFL_2_8,
3751 };
3752
3753 #ifndef NO_WOLFSSL_CLIENT
3754
3755 WOLFSSL_API int wolfSSL_UseMaxFragment(WOLFSSL* ssl, unsigned char mfl);
3756 WOLFSSL_API int wolfSSL_CTX_UseMaxFragment(WOLFSSL_CTX* ctx, unsigned char mfl);
3757
3758 #endif

NetBurner, Inc.
1074 File Documentation

3759 #endif /* HAVE_MAX_FRAGMENT */


3760
3761 /* Truncated HMAC */
3762 #ifdef HAVE_TRUNCATED_HMAC
3763 #ifndef NO_WOLFSSL_CLIENT
3764
3765 WOLFSSL_API int wolfSSL_UseTruncatedHMAC(WOLFSSL* ssl);
3766 WOLFSSL_API int wolfSSL_CTX_UseTruncatedHMAC(WOLFSSL_CTX* ctx);
3767
3768 #endif
3769 #endif
3770
3771 /* Certificate Status Request */
3772 /* Certificate Status Type */
3773 enum {
3774 WOLFSSL_CSR_OCSP = 1
3775 };
3776
3777 /* Certificate Status Options (flags) */
3778 enum {
3779 WOLFSSL_CSR_OCSP_USE_NONCE = 0x01
3780 };
3781
3782 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST
3783 #ifndef NO_WOLFSSL_CLIENT
3784
3785 WOLFSSL_API int wolfSSL_UseOCSPStapling(WOLFSSL* ssl,
3786 unsigned char status_type, unsigned char options);
3787
3788 WOLFSSL_API int wolfSSL_CTX_UseOCSPStapling(WOLFSSL_CTX* ctx,
3789 unsigned char status_type, unsigned char options);
3790
3791 #endif
3792 #endif
3793
3794 /* Certificate Status Request v2 */
3795 /* Certificate Status Type */
3796 enum {
3797 WOLFSSL_CSR2_OCSP = 1,
3798 WOLFSSL_CSR2_OCSP_MULTI = 2
3799 };
3800
3801 /* Certificate Status v2 Options (flags) */
3802 enum {
3803 WOLFSSL_CSR2_OCSP_USE_NONCE = 0x01
3804 };
3805
3806 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST_V2
3807 #ifndef NO_WOLFSSL_CLIENT
3808
3809 WOLFSSL_API int wolfSSL_UseOCSPStaplingV2(WOLFSSL* ssl,
3810 unsigned char status_type, unsigned char options);
3811
3812 WOLFSSL_API int wolfSSL_CTX_UseOCSPStaplingV2(WOLFSSL_CTX* ctx,
3813 unsigned char status_type, unsigned char options);
3814
3815 #endif
3816 #endif
3817
3818 /* Named Groups */
3819 enum {
3820 WOLFSSL_NAMED_GROUP_INVALID = 0,
3821 #if 0 /* Not Supported */
3822 WOLFSSL_ECC_SECT163K1 = 1,
3823 WOLFSSL_ECC_SECT163R1 = 2,
3824 WOLFSSL_ECC_SECT163R2 = 3,
3825 WOLFSSL_ECC_SECT193R1 = 4,
3826 WOLFSSL_ECC_SECT193R2 = 5,
3827 WOLFSSL_ECC_SECT233K1 = 6,
3828 WOLFSSL_ECC_SECT233R1 = 7,
3829 WOLFSSL_ECC_SECT239K1 = 8,
3830 WOLFSSL_ECC_SECT283K1 = 9,
3831 WOLFSSL_ECC_SECT283R1 = 10,
3832 WOLFSSL_ECC_SECT409K1 = 11,
3833 WOLFSSL_ECC_SECT409R1 = 12,
3834 WOLFSSL_ECC_SECT571K1 = 13,
3835 WOLFSSL_ECC_SECT571R1 = 14,
3836 #endif
3837 WOLFSSL_ECC_SECP160K1 = 15,
3838 WOLFSSL_ECC_SECP160R1 = 16,
3839 WOLFSSL_ECC_SECP160R2 = 17,
3840 WOLFSSL_ECC_SECP192K1 = 18,
3841 WOLFSSL_ECC_SECP192R1 = 19,
3842 WOLFSSL_ECC_SECP224K1 = 20,
3843 WOLFSSL_ECC_SECP224R1 = 21,
3844 WOLFSSL_ECC_SECP256K1 = 22,
3845 WOLFSSL_ECC_SECP256R1 = 23,

NetBurner, Inc.
22.199 wolfssl/ssl.h 1075

3846 WOLFSSL_ECC_SECP384R1 = 24,


3847 WOLFSSL_ECC_SECP521R1 = 25,
3848 WOLFSSL_ECC_BRAINPOOLP256R1 = 26,
3849 WOLFSSL_ECC_BRAINPOOLP384R1 = 27,
3850 WOLFSSL_ECC_BRAINPOOLP512R1 = 28,
3851 WOLFSSL_ECC_X25519 = 29,
3852 WOLFSSL_ECC_X448 = 30,
3853 WOLFSSL_ECC_MAX = 30,
3854
3855 WOLFSSL_FFDHE_2048 = 256,
3856 WOLFSSL_FFDHE_3072 = 257,
3857 WOLFSSL_FFDHE_4096 = 258,
3858 WOLFSSL_FFDHE_6144 = 259,
3859 WOLFSSL_FFDHE_8192 = 260,
3860
3861 #ifdef HAVE_PQC
3862 /* These group numbers were taken from OQS’s openssl fork, see:
3863 * https://github.com/open-quantum-safe/openssl/blob/OQS-OpenSSL_1_1_1-stable/
3864 * oqs-template/oqs-kem-info.md.
3865 *
3866 * The levels in the group name refer to the claimed NIST level of each
3867 * parameter set. The associated parameter set name is listed as a comment
3868 * beside the group number. Please see the NIST PQC Competition’s submitted
3869 * papers for more details.
3870 *
3871 * LEVEL1 means that an attack on that parameter set would reqire the same
3872 * or more resources as a key search on AES 128. LEVEL3 would reqire the
3873 * same or more resources as a key search on AES 192. LEVEL5 would require
3874 * the same or more resources as a key search on AES 256. None of the
3875 * algorithms have LEVEL2 and LEVEL4 because none of these submissions
3876 * included them. */
3877
3878 WOLFSSL_PQC_MIN = 532,
3879 WOLFSSL_PQC_SIMPLE_MIN = 532,
3880 WOLFSSL_NTRU_HPS_LEVEL1 = 532, /* NTRU_HPS2048509 */
3881 WOLFSSL_NTRU_HPS_LEVEL3 = 533, /* NTRU_HPS2048677 */
3882 WOLFSSL_NTRU_HPS_LEVEL5 = 534, /* NTRU_HPS4096821 */
3883 WOLFSSL_NTRU_HRSS_LEVEL3 = 535, /* NTRU_HRSS701 */
3884 WOLFSSL_SABER_LEVEL1 = 536, /* LIGHTSABER */
3885 WOLFSSL_SABER_LEVEL3 = 537, /* SABER */
3886 WOLFSSL_SABER_LEVEL5 = 538, /* FIRESABER */
3887 WOLFSSL_KYBER_LEVEL1 = 570, /* KYBER_512 */
3888 WOLFSSL_KYBER_LEVEL3 = 572, /* KYBER_768 */
3889 WOLFSSL_KYBER_LEVEL5 = 573, /* KYBER_1024 */
3890 WOLFSSL_KYBER_90S_LEVEL1 = 574, /* KYBER_90S_512 */
3891 WOLFSSL_KYBER_90S_LEVEL3 = 575, /* KYBER_90S_768 */
3892 WOLFSSL_KYBER_90S_LEVEL5 = 576, /* KYBER_90S_1024 */
3893 WOLFSSL_PQC_SIMPLE_MAX = 576,
3894
3895 WOLFSSL_PQC_HYBRID_MIN = 12052,
3896 WOLFSSL_P256_NTRU_HPS_LEVEL1 = 12052,
3897 WOLFSSL_P384_NTRU_HPS_LEVEL3 = 12053,
3898 WOLFSSL_P521_NTRU_HPS_LEVEL5 = 12054,
3899 WOLFSSL_P384_NTRU_HRSS_LEVEL3 = 12055,
3900 WOLFSSL_P256_SABER_LEVEL1 = 12056,
3901 WOLFSSL_P384_SABER_LEVEL3 = 12057,
3902 WOLFSSL_P521_SABER_LEVEL5 = 12058,
3903 WOLFSSL_P256_KYBER_LEVEL1 = 12090,
3904 WOLFSSL_P384_KYBER_LEVEL3 = 12092,
3905 WOLFSSL_P521_KYBER_LEVEL5 = 12093,
3906 WOLFSSL_P256_KYBER_90S_LEVEL1 = 12094,
3907 WOLFSSL_P384_KYBER_90S_LEVEL3 = 12095,
3908 WOLFSSL_P521_KYBER_90S_LEVEL5 = 12096,
3909 WOLFSSL_PQC_HYBRID_MAX = 12096,
3910 WOLFSSL_PQC_MAX = 12096,
3911 #endif
3912 };
3913
3914 enum {
3915 WOLFSSL_EC_PF_UNCOMPRESSED = 0,
3916 #if 0 /* Not Supported */
3917 WOLFSSL_EC_PF_X962_COMP_PRIME = 1,
3918 WOLFSSL_EC_PF_X962_COMP_CHAR2 = 2,
3919 #endif
3920 };
3921
3922 #ifdef HAVE_SUPPORTED_CURVES
3923 WOLFSSL_API int wolfSSL_UseSupportedCurve(WOLFSSL* ssl, word16 name);
3924 WOLFSSL_API int wolfSSL_CTX_UseSupportedCurve(WOLFSSL_CTX* ctx,
3925 word16 name);
3926 #endif
3927
3928 #ifdef WOLFSSL_TLS13
3929 WOLFSSL_API int wolfSSL_UseKeyShare(WOLFSSL* ssl, word16 group);
3930 WOLFSSL_API int wolfSSL_NoKeyShares(WOLFSSL* ssl);
3931 #endif
3932

NetBurner, Inc.
1076 File Documentation

3933
3934 /* Secure Renegotiation */
3935 #if defined(HAVE_SECURE_RENEGOTIATION) || defined(HAVE_SERVER_RENEGOTIATION_INFO)
3936
3937 WOLFSSL_API int wolfSSL_UseSecureRenegotiation(WOLFSSL* ssl);
3938 WOLFSSL_API int wolfSSL_CTX_UseSecureRenegotiation(WOLFSSL_CTX* ctx);
3939 WOLFSSL_API int wolfSSL_Rehandshake(WOLFSSL* ssl);
3940 WOLFSSL_API int wolfSSL_SecureResume(WOLFSSL* ssl);
3941 WOLFSSL_API long wolfSSL_SSL_get_secure_renegotiation_support(WOLFSSL* ssl);
3942
3943 #endif
3944
3945 #if defined(HAVE_SELFTEST) && \
3946 (!defined(HAVE_SELFTEST_VERSION) || (HAVE_SELFTEST_VERSION < 2))
3947
3948 /* Needed by session ticket stuff below */
3949 #ifndef WOLFSSL_AES_KEY_SIZE_ENUM
3950 #define WOLFSSL_AES_KEY_SIZE_ENUM
3951 enum SSL_Misc {
3952 AES_IV_SIZE = 16,
3953 AES_128_KEY_SIZE = 16,
3954 AES_192_KEY_SIZE = 24,
3955 AES_256_KEY_SIZE = 32
3956 };
3957 #endif
3958 #endif
3959
3960 /* Session Ticket */
3961 #ifdef HAVE_SESSION_TICKET
3962
3963 #if !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && !defined(NO_WOLFSSL_SERVER)
3964 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && \
3965 !defined(WOLFSSL_TICKET_ENC_AES128_GCM) && \
3966 !defined(WOLFSSL_TICKET_ENC_AES256_GCM)
3967 #define WOLFSSL_TICKET_KEY_SZ CHACHA20_POLY1305_AEAD_KEYSIZE
3968 #elif defined(WOLFSSL_TICKET_ENC_AES256_GCM)
3969 #define WOLFSSL_TICKET_KEY_SZ AES_256_KEY_SIZE
3970 #else
3971 #define WOLFSSL_TICKET_KEY_SZ AES_128_KEY_SIZE
3972 #endif
3973
3974 #define WOLFSSL_TICKET_KEYS_SZ (WOLFSSL_TICKET_NAME_SZ + \
3975 2 * WOLFSSL_TICKET_KEY_SZ + \
3976 sizeof(word32) * 2)
3977 #endif
3978
3979 #ifndef NO_WOLFSSL_CLIENT
3980 WOLFSSL_API int wolfSSL_UseSessionTicket(WOLFSSL* ssl);
3981 WOLFSSL_API int wolfSSL_CTX_UseSessionTicket(WOLFSSL_CTX* ctx);
3982 WOLFSSL_API int wolfSSL_get_SessionTicket(WOLFSSL* ssl, unsigned char* buf, word32* bufSz);
3983 WOLFSSL_API int wolfSSL_set_SessionTicket(WOLFSSL* ssl, const unsigned char* buf, word32 bufSz);
3984 typedef int (*CallbackSessionTicket)(WOLFSSL* ssl, const unsigned char*, int, void*);
3985 WOLFSSL_API int wolfSSL_set_SessionTicket_cb(WOLFSSL* ssl,
3986 CallbackSessionTicket cb, void* ctx);
3987 #endif /* NO_WOLFSSL_CLIENT */
3988 #ifndef NO_WOLFSSL_SERVER
3989 WOLFSSL_API int wolfSSL_send_SessionTicket(WOLFSSL* ssl);
3990 #endif /* !NO_WOLFSSL_SERVER */
3991
3992
3993 #define WOLFSSL_TICKET_NAME_SZ 16
3994 #define WOLFSSL_TICKET_IV_SZ 16
3995 #define WOLFSSL_TICKET_MAC_SZ 32
3996
3997 enum TicketEncRet {
3998 WOLFSSL_TICKET_RET_FATAL = -1, /* fatal error, don’t use ticket */
3999 WOLFSSL_TICKET_RET_OK = 0, /* ok, use ticket */
4000 WOLFSSL_TICKET_RET_REJECT, /* don’t use ticket, but not fatal */
4001 WOLFSSL_TICKET_RET_CREATE /* existing ticket ok and create new one */
4002 };
4003
4004 #ifndef NO_WOLFSSL_SERVER
4005
4006 WOLFSSL_API int wolfSSL_CTX_NoTicketTLSv12(WOLFSSL_CTX* ctx);
4007 WOLFSSL_API int wolfSSL_NoTicketTLSv12(WOLFSSL* ssl);
4008
4009 typedef int (*SessionTicketEncCb)(WOLFSSL* ssl,
4010 unsigned char key_name[WOLFSSL_TICKET_NAME_SZ],
4011 unsigned char iv[WOLFSSL_TICKET_IV_SZ],
4012 unsigned char mac[WOLFSSL_TICKET_MAC_SZ],
4013 int enc, unsigned char*, int, int*, void*);
4014 WOLFSSL_API int wolfSSL_CTX_set_TicketEncCb(WOLFSSL_CTX* ctx,
4015 SessionTicketEncCb cb);
4016 WOLFSSL_API int wolfSSL_CTX_set_TicketHint(WOLFSSL_CTX* ctx, int hint);
4017 WOLFSSL_API int wolfSSL_CTX_set_TicketEncCtx(WOLFSSL_CTX* ctx, void* userCtx);
4018 WOLFSSL_API void* wolfSSL_CTX_get_TicketEncCtx(WOLFSSL_CTX* ctx);
4019 WOLFSSL_API size_t wolfSSL_CTX_get_num_tickets(WOLFSSL_CTX* ctx);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1077

4020 WOLFSSL_API int wolfSSL_CTX_set_num_tickets(WOLFSSL_CTX* ctx, size_t mxTickets);


4021
4022 #endif /* NO_WOLFSSL_SERVER */
4023
4024 #endif /* HAVE_SESSION_TICKET */
4025
4026 /* TLS Extended Master Secret Extension */
4027 WOLFSSL_API int wolfSSL_DisableExtendedMasterSecret(WOLFSSL* ssl);
4028 WOLFSSL_API int wolfSSL_CTX_DisableExtendedMasterSecret(WOLFSSL_CTX* ctx);
4029
4030
4031 #define WOLFSSL_CRL_MONITOR 0x01 /* monitor this dir flag */
4032 #define WOLFSSL_CRL_START_MON 0x02 /* start monitoring flag */
4033
4034
4035 #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_SERVER)
4036 /* notify user we parsed a verified ClientHello is done. This only has an effect
4037 * on the server end. */
4038 typedef int (*ClientHelloGoodCb)(WOLFSSL* ssl, void*);
4039 WOLFSSL_API int wolfDTLS_SetChGoodCb(WOLFSSL* ssl, ClientHelloGoodCb cb, void* user_ctx);
4040 #endif
4041
4042 /* notify user the handshake is done */
4043 typedef int (*HandShakeDoneCb)(WOLFSSL* ssl, void*);
4044 WOLFSSL_API int wolfSSL_SetHsDoneCb(WOLFSSL* ssl, HandShakeDoneCb cb, void* user_ctx);
4045
4046
4047 WOLFSSL_API int wolfSSL_PrintSessionStats(void);
4048 WOLFSSL_API int wolfSSL_get_session_stats(unsigned int* active,
4049 unsigned int* total,
4050 unsigned int* peak,
4051 unsigned int* maxSessions);
4052 /* External facing KDF */
4053 WOLFSSL_API
4054 int wolfSSL_MakeTlsMasterSecret(unsigned char* ms, word32 msLen,
4055 const unsigned char* pms, word32 pmsLen,
4056 const unsigned char* cr, const unsigned char* sr,
4057 int tls1_2, int hash_type);
4058
4059 WOLFSSL_API
4060 int wolfSSL_MakeTlsExtendedMasterSecret(unsigned char* ms, word32 msLen,
4061 const unsigned char* pms, word32 pmsLen,
4062 const unsigned char* sHash, word32 sHashLen,
4063 int tls1_2, int hash_type);
4064
4065 WOLFSSL_API
4066 int wolfSSL_DeriveTlsKeys(unsigned char* key_data, word32 keyLen,
4067 const unsigned char* ms, word32 msLen,
4068 const unsigned char* sr, const unsigned char* cr,
4069 int tls1_2, int hash_type);
4070
4071 #ifdef WOLFSSL_CALLBACKS
4072
4073 typedef int (*HandShakeCallBack)(HandShakeInfo*);
4074 typedef int (*TimeoutCallBack)(TimeoutInfo*);
4075
4076 /* wolfSSL connect extension allowing HandShakeCallBack and/or TimeoutCallBack
4077 for diagnostics */
4078 WOLFSSL_API int wolfSSL_connect_ex(WOLFSSL* ssl, HandShakeCallBack, TimeoutCallBack,
4079 WOLFSSL_TIMEVAL);
4080 WOLFSSL_API int wolfSSL_accept_ex(WOLFSSL* ssl, HandShakeCallBack, TimeoutCallBack,
4081 WOLFSSL_TIMEVAL);
4082
4083 #endif /* WOLFSSL_CALLBACKS */
4084
4085
4086 #ifdef WOLFSSL_HAVE_WOLFSCEP
4087 WOLFSSL_API void wolfSSL_wolfSCEP(void);
4088 #endif /* WOLFSSL_HAVE_WOLFSCEP */
4089
4090 #ifdef WOLFSSL_HAVE_CERT_SERVICE
4091 WOLFSSL_API void wolfSSL_cert_service(void);
4092 #endif
4093
4094 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
4095 /* Smaller subset of X509 compatibility functions. Avoid increasing the size of
4096 * this subset and its memory usage */
4097
4098 #include <wolfssl/openssl/asn1.h>
4099 struct WOLFSSL_X509_NAME_ENTRY {
4100 WOLFSSL_ASN1_OBJECT* object; /* static object just for keeping grp, type */
4101 WOLFSSL_ASN1_STRING* value; /* points to data, for lighttpd port */
4102 int nid; /* i.e. ASN_COMMON_NAME */
4103 int set;
4104 int size;
4105 };
4106

NetBurner, Inc.
1078 File Documentation

4107 WOLFSSL_API int wolfSSL_X509_NAME_get_index_by_OBJ(WOLFSSL_X509_NAME *name,


4108 const WOLFSSL_ASN1_OBJECT *obj,
4109 int idx);
4110
4111
4112
4113 enum {
4114 WOLFSSL_SYS_ACCEPT = 0,
4115 WOLFSSL_SYS_BIND,
4116 WOLFSSL_SYS_CONNECT,
4117 WOLFSSL_SYS_FOPEN,
4118 WOLFSSL_SYS_FREAD,
4119 WOLFSSL_SYS_GETADDRINFO,
4120 WOLFSSL_SYS_GETSOCKOPT,
4121 WOLFSSL_SYS_GETSOCKNAME,
4122 WOLFSSL_SYS_GETHOSTBYNAME,
4123 WOLFSSL_SYS_GETNAMEINFO,
4124 WOLFSSL_SYS_GETSERVBYNAME,
4125 WOLFSSL_SYS_IOCTLSOCKET,
4126 WOLFSSL_SYS_LISTEN,
4127 WOLFSSL_SYS_OPENDIR,
4128 WOLFSSL_SYS_SETSOCKOPT,
4129 WOLFSSL_SYS_SOCKET
4130 };
4131
4132 /* Object functions */
4133 WOLFSSL_API const char* wolfSSL_OBJ_nid2sn(int n);
4134 WOLFSSL_API int wolfSSL_OBJ_obj2nid(const WOLFSSL_ASN1_OBJECT *o);
4135 WOLFSSL_API int wolfSSL_OBJ_get_type(const WOLFSSL_ASN1_OBJECT *o);
4136 WOLFSSL_API int wolfSSL_OBJ_sn2nid(const char *sn);
4137 WOLFSSL_API size_t wolfSSL_OBJ_length(const WOLFSSL_ASN1_OBJECT* o);
4138 WOLFSSL_API const unsigned char* wolfSSL_OBJ_get0_data(
4139 const WOLFSSL_ASN1_OBJECT* o);
4140
4141 WOLFSSL_API const char* wolfSSL_OBJ_nid2ln(int n);
4142 WOLFSSL_API int wolfSSL_OBJ_ln2nid(const char *ln);
4143 WOLFSSL_API int wolfSSL_OBJ_cmp(const WOLFSSL_ASN1_OBJECT* a,
4144 const WOLFSSL_ASN1_OBJECT* b);
4145 WOLFSSL_API int wolfSSL_OBJ_txt2nid(const char *sn);
4146 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_OBJ_txt2obj(const char* s, int no_name);
4147
4148 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_OBJ_nid2obj(int n);
4149 WOLFSSL_LOCAL WOLFSSL_ASN1_OBJECT* wolfSSL_OBJ_nid2obj_ex(int n, WOLFSSL_ASN1_OBJECT *arg_obj);
4150 WOLFSSL_API int wolfSSL_OBJ_obj2txt(char *buf, int buf_len,
4151 const WOLFSSL_ASN1_OBJECT *a, int no_name);
4152
4153 WOLFSSL_API void wolfSSL_OBJ_cleanup(void);
4154 WOLFSSL_API int wolfSSL_OBJ_create(const char *oid, const char *sn, const char *ln);
4155 #ifdef HAVE_ECC
4156 WOLFSSL_LOCAL int NIDToEccEnum(int n);
4157 #endif
4158
4159 #define WOLFSSL_OBJ_NAME_TYPE_UNDEF 0x00
4160 #define WOLFSSL_OBJ_NAME_TYPE_MD_METH 0x01
4161 #define WOLFSSL_OBJ_NAME_TYPE_CIPHER_METH 0x02
4162 #define WOLFSSL_OBJ_NAME_TYPE_PKEY_METH 0x03
4163 #define WOLFSSL_OBJ_NAME_TYPE_COMP_METH 0x04
4164 #define WOLFSSL_OBJ_NAME_TYPE_NUM 0x05
4165 #define WOLFSSL_OBJ_NAME_ALIAS 0x8000
4166
4167 WOLFSSL_API void wolfSSL_OBJ_NAME_do_all(int type,
4168 void (*fn) (const WOLFSSL_OBJ_NAME* , void *arg),
4169 void* arg);
4170 /* end of object functions */
4171
4172 WOLFSSL_API unsigned long wolfSSL_ERR_peek_last_error_line(const char **file, int *line);
4173 WOLFSSL_API long wolfSSL_CTX_ctrl(WOLFSSL_CTX* ctx, int cmd, long opt,void* pt);
4174 WOLFSSL_API long wolfSSL_CTX_callback_ctrl(WOLFSSL_CTX* ctx, int cmd, void (*fp)(void));
4175 WOLFSSL_API long wolfSSL_CTX_clear_extra_chain_certs(WOLFSSL_CTX* ctx);
4176
4177 WOLFSSL_API void wolfSSL_certs_clear(WOLFSSL* ssl);
4178
4179 #ifndef NO_CERTS
4180 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY* wolfSSL_X509_NAME_ENTRY_create_by_NID(
4181 WOLFSSL_X509_NAME_ENTRY** out, int nid, int type,
4182 const unsigned char* data, int dataSz);
4183 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY* wolfSSL_X509_NAME_ENTRY_create_by_txt(
4184 WOLFSSL_X509_NAME_ENTRY **neIn, const char *txt, int format,
4185 const unsigned char *data, int dataSz);
4186 WOLFSSL_API int wolfSSL_X509_NAME_add_entry(WOLFSSL_X509_NAME* name,
4187 WOLFSSL_X509_NAME_ENTRY* entry, int idx, int set);
4188 WOLFSSL_API int wolfSSL_X509_NAME_add_entry_by_txt(WOLFSSL_X509_NAME *name,
4189 const char *field, int type, const unsigned char *bytes, int len, int loc,
4190 int set);
4191 WOLFSSL_API int wolfSSL_X509_NAME_add_entry_by_NID(WOLFSSL_X509_NAME *name, int nid,
4192 int type, const unsigned char *bytes,
4193 int len, int loc, int set);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1079

4194 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY *wolfSSL_X509_NAME_delete_entry(


4195 WOLFSSL_X509_NAME *name, int loc);
4196 WOLFSSL_API int wolfSSL_X509_NAME_cmp(const WOLFSSL_X509_NAME* x,
4197 const WOLFSSL_X509_NAME* y);
4198 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_NAME_new(void);
4199 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_NAME_dup(WOLFSSL_X509_NAME* name);
4200 WOLFSSL_API int wolfSSL_X509_NAME_copy(WOLFSSL_X509_NAME* from, WOLFSSL_X509_NAME* to);
4201 WOLFSSL_API int wolfSSL_check_private_key(const WOLFSSL* ssl);
4202 #endif /* !NO_CERTS */
4203 #endif /* OPENSSL_ALL || OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
4204
4205 #if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) || defined(WOLFSSL_HAPROXY) \
4206 || defined(WOLFSSL_NGINX) || defined(WOLFSSL_QT)
4207 WOLFSSL_API long wolfSSL_ctrl(WOLFSSL* ssl, int cmd, long opt, void* pt);
4208 #endif
4209
4210 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
4211 WOLFSSL_API void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509,
4212 int nid, int* c, int* idx);
4213 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
4214
4215 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL)
4216 #ifndef NO_CERTS
4217 WOLFSSL_API unsigned int wolfSSL_X509_get_extension_flags(WOLFSSL_X509* x509);
4218 WOLFSSL_API unsigned int wolfSSL_X509_get_key_usage(WOLFSSL_X509* x509);
4219 WOLFSSL_API unsigned int wolfSSL_X509_get_extended_key_usage(WOLFSSL_X509* x509);
4220 WOLFSSL_API int wolfSSL_X509_get_ext_count(const WOLFSSL_X509* passedCert);
4221 WOLFSSL_API int wolfSSL_X509_get_ext_by_NID(const WOLFSSL_X509 *x, int nid, int lastpos);
4222 WOLFSSL_API int wolfSSL_X509_add_ext(WOLFSSL_X509 *x, WOLFSSL_X509_EXTENSION *ex, int loc);
4223 WOLFSSL_API WOLFSSL_X509_EXTENSION *wolfSSL_X509V3_EXT_i2d(int nid, int crit,
4224 void *data);
4225 WOLFSSL_API WOLFSSL_X509_EXTENSION *wolfSSL_X509_delete_ext(WOLFSSL_X509 *x509, int loc);
4226 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509V3_EXT_conf_nid(
4227 WOLF_LHASH_OF(CONF_VALUE)* conf, WOLFSSL_X509V3_CTX* ctx, int nid,
4228 char* value);
4229 WOLFSSL_API void wolfSSL_X509V3_set_ctx(WOLFSSL_X509V3_CTX* ctx,
4230 WOLFSSL_X509* issuer, WOLFSSL_X509* subject, WOLFSSL_X509* req,
4231 WOLFSSL_X509_CRL* crl, int flag);
4232 WOLFSSL_API void wolfSSL_X509V3_set_ctx_nodb(WOLFSSL_X509V3_CTX* ctx);
4233 WOLFSSL_API int wolfSSL_X509_digest(const WOLFSSL_X509* x509,
4234 const WOLFSSL_EVP_MD* digest, unsigned char* buf, unsigned int* len);
4235 WOLFSSL_API int wolfSSL_X509_pubkey_digest(const WOLFSSL_X509 *x509,
4236 const WOLFSSL_EVP_MD *digest, unsigned char* buf, unsigned int* len);
4237 WOLFSSL_API int wolfSSL_use_certificate(WOLFSSL* ssl, WOLFSSL_X509* x509);
4238 WOLFSSL_API int wolfSSL_use_PrivateKey(WOLFSSL* ssl, WOLFSSL_EVP_PKEY* pkey);
4239 WOLFSSL_API int wolfSSL_use_PrivateKey_ASN1(int pri, WOLFSSL* ssl,
4240 const unsigned char* der, long derSz);
4241 WOLFSSL_API WOLFSSL_EVP_PKEY *wolfSSL_get_privatekey(const WOLFSSL *ssl);
4242 #ifndef NO_RSA
4243 WOLFSSL_API int wolfSSL_use_RSAPrivateKey_ASN1(WOLFSSL* ssl, unsigned char* der,
4244 long derSz);
4245 #endif
4246 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_ASN1(int pri, WOLFSSL_CTX* ctx,
4247 unsigned char* der, long derSz);
4248
4249 #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
4250 WOLFSSL_API int wolfSSL_X509_cmp(const WOLFSSL_X509* a, const WOLFSSL_X509* b);
4251 WOLFSSL_API const WOLFSSL_STACK *wolfSSL_X509_get0_extensions(const WOLFSSL_X509 *x);
4252 WOLFSSL_API const WOLFSSL_STACK *wolfSSL_X509_REQ_get_extensions(const WOLFSSL_X509 *x);
4253 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509_get_ext(const WOLFSSL_X509* x, int loc);
4254 WOLFSSL_API int wolfSSL_X509_get_ext_by_OBJ(const WOLFSSL_X509 *x,
4255 const WOLFSSL_ASN1_OBJECT *obj, int lastpos);
4256 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509_set_ext(WOLFSSL_X509* x, int loc);
4257 WOLFSSL_API int wolfSSL_X509_EXTENSION_get_critical(const WOLFSSL_X509_EXTENSION* ex);
4258 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509_EXTENSION_new(void);
4259 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509_EXTENSION_dup(
4260 WOLFSSL_X509_EXTENSION* src);
4261 WOLFSSL_API int wolfSSL_sk_X509_EXTENSION_push(WOLFSSL_STACK* sk,
4262 WOLFSSL_X509_EXTENSION* ext);
4263 WOLFSSL_API void wolfSSL_sk_X509_EXTENSION_free(WOLFSSL_STACK* sk);
4264 WOLFSSL_API void wolfSSL_X509_EXTENSION_free(WOLFSSL_X509_EXTENSION* ext_to_free);
4265 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_new_x509_ext(void);
4266 #endif
4267
4268 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_X509_EXTENSION_get_object(WOLFSSL_X509_EXTENSION* ext);
4269 WOLFSSL_API int wolfSSL_X509_EXTENSION_set_object(WOLFSSL_X509_EXTENSION* ext,
4270 const WOLFSSL_ASN1_OBJECT* obj);
4271 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_X509_EXTENSION_get_data(WOLFSSL_X509_EXTENSION* ext);
4272 WOLFSSL_API int wolfSSL_X509_EXTENSION_set_data(WOLFSSL_X509_EXTENSION* ext,
4273 WOLFSSL_ASN1_STRING* data);
4274 #endif /* !NO_CERTS */
4275
4276 WOLFSSL_API WOLFSSL_DH *wolfSSL_DSA_dup_DH(const WOLFSSL_DSA *r);
4277
4278 WOLFSSL_API int wolfSSL_SESSION_get_master_key(const WOLFSSL_SESSION* ses,
4279 unsigned char* out, int outSz);
4280 WOLFSSL_API int wolfSSL_SESSION_get_master_key_length(const WOLFSSL_SESSION* ses);

NetBurner, Inc.
1080 File Documentation

4281
4282 WOLFSSL_API int wolfSSL_i2d_X509_bio(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
4283 #ifdef WOLFSSL_CERT_REQ
4284 WOLFSSL_API int wolfSSL_i2d_X509_REQ_bio(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
4285 #endif
4286 #if !defined(NO_FILESYSTEM)
4287 WOLFSSL_API WOLFSSL_X509* wolfSSL_d2i_X509_fp(XFILE fp,
4288 WOLFSSL_X509** x509);
4289 #endif
4290 WOLFSSL_API WOLFSSL_STACK* wolfSSL_X509_STORE_GetCerts(WOLFSSL_X509_STORE_CTX* s);
4291 WOLFSSL_API WOLFSSL_X509* wolfSSL_d2i_X509_bio(WOLFSSL_BIO* bio,
4292 WOLFSSL_X509** x509);
4293 #ifdef WOLFSSL_CERT_REQ
4294 WOLFSSL_API WOLFSSL_X509* wolfSSL_d2i_X509_REQ_bio(WOLFSSL_BIO* bio,
4295 WOLFSSL_X509** x509);
4296 #endif
4297 #endif /* OPENSSL_EXTRA || OPENSSL_ALL */
4298
4299 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
4300 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509) *wolfSSL_get0_verified_chain(
4301 const WOLFSSL *ssl);
4302 WOLFSSL_API void wolfSSL_CTX_set_cert_store(WOLFSSL_CTX* ctx,
4303 WOLFSSL_X509_STORE* str);
4304 WOLFSSL_API int wolfSSL_set0_verify_cert_store(WOLFSSL *ssl,
4305 WOLFSSL_X509_STORE* str);
4306 WOLFSSL_API int wolfSSL_set1_verify_cert_store(WOLFSSL *ssl,
4307 WOLFSSL_X509_STORE* str);
4308 WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_CTX_get_cert_store(WOLFSSL_CTX* ctx);
4309 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
4310 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) || \
4311 defined(HAVE_SECRET_CALLBACK)
4312 WOLFSSL_API size_t wolfSSL_get_server_random(const WOLFSSL *ssl,
4313 unsigned char *out, size_t outlen);
4314 WOLFSSL_API size_t wolfSSL_get_client_random(const WOLFSSL* ssl,
4315 unsigned char* out, size_t outSz);
4316 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL || HAVE_SECRET_CALLBACK */
4317
4318 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL)
4319 WOLFSSL_API size_t wolfSSL_BIO_wpending(const WOLFSSL_BIO *bio);
4320 /* non-standard API to determine if BIO supports "pending" */
4321 WOLFSSL_API int wolfSSL_BIO_supports_pending(const WOLFSSL_BIO *bio);
4322 WOLFSSL_API size_t wolfSSL_BIO_ctrl_pending(WOLFSSL_BIO *b);
4323
4324 WOLFSSL_API int wolfSSL_get_server_tmp_key(const WOLFSSL* ssl, WOLFSSL_EVP_PKEY** pkey);
4325
4326 WOLFSSL_API int wolfSSL_CTX_set_min_proto_version(WOLFSSL_CTX* ctx, int version);
4327 WOLFSSL_API int wolfSSL_CTX_set_max_proto_version(WOLFSSL_CTX* ctx, int version);
4328 WOLFSSL_API int wolfSSL_set_min_proto_version(WOLFSSL* ssl, int version);
4329 WOLFSSL_API int wolfSSL_set_max_proto_version(WOLFSSL* ssl, int version);
4330 WOLFSSL_API int wolfSSL_CTX_get_min_proto_version(WOLFSSL_CTX* ctx);
4331 WOLFSSL_API int wolfSSL_CTX_get_max_proto_version(WOLFSSL_CTX* ctx);
4332
4333 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey(WOLFSSL_CTX *ctx,
4334 WOLFSSL_EVP_PKEY *pkey);
4335 WOLFSSL_API WOLFSSL_X509 *wolfSSL_PEM_read_bio_X509(WOLFSSL_BIO *bp,
4336 WOLFSSL_X509 **x, wc_pem_password_cb *cb, void *u);
4337 #ifdef WOLFSSL_CERT_REQ
4338 WOLFSSL_API WOLFSSL_X509 *wolfSSL_PEM_read_bio_X509_REQ(WOLFSSL_BIO *bp,
4339 WOLFSSL_X509 **x, wc_pem_password_cb *cb, void *u);
4340 #ifndef NO_FILESYSTEM
4341 WOLFSSL_API WOLFSSL_X509* wolfSSL_PEM_read_X509_REQ(XFILE fp, WOLFSSL_X509** x,
4342 wc_pem_password_cb* cb, void* u);
4343 #endif
4344 #endif
4345 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_PEM_read_bio_X509_CRL(WOLFSSL_BIO *bp,
4346 WOLFSSL_X509_CRL **x, wc_pem_password_cb *cb, void *u);
4347 WOLFSSL_API WOLFSSL_X509 *wolfSSL_PEM_read_bio_X509_AUX
4348 (WOLFSSL_BIO *bp, WOLFSSL_X509 **x, wc_pem_password_cb *cb, void *u);
4349 #ifndef NO_FILESYSTEM
4350 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_INFO)* wolfSSL_PEM_X509_INFO_read(
4351 XFILE fp, WOLF_STACK_OF(WOLFSSL_X509_INFO)* sk,
4352 pem_password_cb* cb, void* u);
4353 #endif
4354 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_INFO)* wolfSSL_PEM_X509_INFO_read_bio(
4355 WOLFSSL_BIO* bio, WOLF_STACK_OF(WOLFSSL_X509_INFO)* sk,
4356 wc_pem_password_cb* cb, void* u);
4357 #ifndef NO_FILESYSTEM
4358 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_PEM_read_X509_CRL(XFILE fp,
4359 WOLFSSL_X509_CRL **x, wc_pem_password_cb *cb, void *u);
4360 #endif
4361 WOLFSSL_API int wolfSSL_PEM_get_EVP_CIPHER_INFO(const char* header,
4362 EncryptedInfo* cipher);
4363 WOLFSSL_API int wolfSSL_PEM_do_header(EncryptedInfo* cipher,
4364 unsigned char* data, long* len,
4365 wc_pem_password_cb* callback, void* ctx);
4366 #endif /* OPENSSL_EXTRA || OPENSSL_ALL */
4367

NetBurner, Inc.
22.199 wolfssl/ssl.h 1081

4368 /*lighttp compatibility */


4369
4370 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) || \
4371 defined(OPENSSL_EXTRA_X509_SMALL)
4372 struct WOLFSSL_ASN1_BIT_STRING {
4373 int length;
4374 int type;
4375 byte* data;
4376 long flags;
4377 };
4378
4379 struct WOLFSSL_CONF_CTX {
4380 unsigned int flags;
4381 WOLFSSL_CTX* ctx;
4382 WOLFSSL* ssl;
4383 };
4384
4385 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY *wolfSSL_X509_NAME_get_entry(WOLFSSL_X509_NAME *name, int loc);
4386 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
4387
4388 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL)|| \
4389 defined(OPENSSL_EXTRA_X509_SMALL)
4390
4391 #if defined(OPENSSL_EXTRA) \
4392 || defined(OPENSSL_ALL) \
4393 || defined(HAVE_LIGHTY) \
4394 || defined(WOLFSSL_MYSQL_COMPATIBLE) \
4395 || defined(HAVE_STUNNEL) \
4396 || defined(WOLFSSL_NGINX) \
4397 || defined(WOLFSSL_HAPROXY) \
4398 || defined(OPENSSL_EXTRA_X509_SMALL)
4399 WOLFSSL_API void wolfSSL_X509_NAME_ENTRY_free(WOLFSSL_X509_NAME_ENTRY* ne);
4400 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY* wolfSSL_X509_NAME_ENTRY_new(void);
4401 WOLFSSL_API void wolfSSL_X509_NAME_free(WOLFSSL_X509_NAME* name);
4402 WOLFSSL_API char wolfSSL_CTX_use_certificate(WOLFSSL_CTX* ctx, WOLFSSL_X509* x);
4403 WOLFSSL_API int wolfSSL_CTX_add0_chain_cert(WOLFSSL_CTX* ctx, WOLFSSL_X509* x509);
4404 WOLFSSL_API int wolfSSL_CTX_add1_chain_cert(WOLFSSL_CTX* ctx, WOLFSSL_X509* x509);
4405 WOLFSSL_API int wolfSSL_add0_chain_cert(WOLFSSL* ssl, WOLFSSL_X509* x509);
4406 WOLFSSL_API int wolfSSL_add1_chain_cert(WOLFSSL* ssl, WOLFSSL_X509* x509);
4407 WOLFSSL_API int wolfSSL_BIO_read_filename(WOLFSSL_BIO *b, const char *name);
4408 /* These are to be merged shortly */
4409 WOLFSSL_API void wolfSSL_set_verify_depth(WOLFSSL *ssl,int depth);
4410 WOLFSSL_API void* wolfSSL_get_app_data( const WOLFSSL *ssl);
4411 WOLFSSL_API int wolfSSL_set_app_data(WOLFSSL *ssl, void *arg);
4412 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_X509_NAME_ENTRY_get_object(WOLFSSL_X509_NAME_ENTRY *ne);
4413 WOLFSSL_API unsigned char *wolfSSL_SHA1(const unsigned char *d, size_t n, unsigned char *md);
4414 WOLFSSL_API unsigned char *wolfSSL_SHA224(const unsigned char *d, size_t n, unsigned char *md);
4415 WOLFSSL_API unsigned char *wolfSSL_SHA256(const unsigned char *d, size_t n, unsigned char *md);
4416 WOLFSSL_API unsigned char *wolfSSL_SHA384(const unsigned char *d, size_t n, unsigned char *md);
4417 WOLFSSL_API unsigned char *wolfSSL_SHA512(const unsigned char *d, size_t n, unsigned char *md);
4418 WOLFSSL_API int wolfSSL_X509_check_private_key(WOLFSSL_X509* x509, WOLFSSL_EVP_PKEY* pkey);
4419 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME) *wolfSSL_dup_CA_list( WOLF_STACK_OF(WOLFSSL_X509_NAME) *sk
);
4420 WOLFSSL_API int wolfSSL_X509_check_ca(WOLFSSL_X509 *x509);
4421
4422 #ifndef NO_FILESYSTEM
4423 WOLFSSL_API long wolfSSL_BIO_set_fp(WOLFSSL_BIO *bio, XFILE fp, int c);
4424 WOLFSSL_API long wolfSSL_BIO_get_fp(WOLFSSL_BIO *bio, XFILE* fp);
4425 #endif
4426
4427 #endif /* OPENSSL_EXTRA || OPENSSL_ALL || HAVE_LIGHTY || WOLFSSL_MYSQL_COMPATIBLE || HAVE_STUNNEL ||
WOLFSSL_NGINX || WOLFSSL_HAPROXY */
4428
4429 #endif /* OPENSSL_EXTRA || OPENSSL_ALL */
4430
4431 #if defined(HAVE_LIGHTY) || defined(HAVE_STUNNEL) \
4432 || defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(OPENSSL_EXTRA)
4433 #ifndef NO_BIO
4434 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_file(const char *filename,
4435 const char *mode);
4436 #ifndef NO_FILESYSTEM
4437 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_fp(XFILE fp, int c);
4438 #endif /* !NO_FILESYSTEM */
4439 #endif /* !NO_BIO */
4440 #endif
4441
4442 #if defined(OPENSSL_ALL) \
4443 || defined(HAVE_STUNNEL) \
4444 || defined(HAVE_LIGHTY) \
4445 || defined(WOLFSSL_MYSQL_COMPATIBLE) \
4446 || defined(WOLFSSL_HAPROXY) \
4447 || defined(OPENSSL_EXTRA)
4448 #define X509_BUFFER_SZ 8192
4449
4450 WOLFSSL_API long wolfSSL_CTX_set_tmp_dh(WOLFSSL_CTX* ctx, WOLFSSL_DH* dh);
4451 WOLFSSL_API WOLFSSL_DH *wolfSSL_PEM_read_bio_DHparams(WOLFSSL_BIO *bp,
4452 WOLFSSL_DH **x, wc_pem_password_cb *cb, void *u);

NetBurner, Inc.
1082 File Documentation

4453 #ifndef NO_FILESYSTEM


4454 WOLFSSL_API WOLFSSL_DH *wolfSSL_PEM_read_DHparams(XFILE fp, WOLFSSL_DH **x,
4455 wc_pem_password_cb *cb, void *u);
4456 #endif
4457 WOLFSSL_API WOLFSSL_DSA *wolfSSL_PEM_read_bio_DSAparams(WOLFSSL_BIO *bp,
4458 WOLFSSL_DSA **x, wc_pem_password_cb *cb, void *u);
4459 WOLFSSL_API int wolfSSL_PEM_write_bio_X509_REQ(WOLFSSL_BIO *bp,WOLFSSL_X509 *x);
4460 WOLFSSL_API int wolfSSL_PEM_write_bio_X509_AUX(WOLFSSL_BIO *bp,WOLFSSL_X509 *x);
4461 WOLFSSL_API int wolfSSL_PEM_write_bio_X509(WOLFSSL_BIO *bp, WOLFSSL_X509 *x);
4462 #endif /* HAVE_STUNNEL || HAVE_LIGHTY */
4463
4464 #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) && defined(WOLFSSL_CERT_GEN) && \
4465 defined(WOLFSSL_CERT_REQ)
4466 WOLFSSL_API int wolfSSL_i2d_X509_REQ(WOLFSSL_X509* req, unsigned char** out);
4467 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_REQ_new(void);
4468 WOLFSSL_API void wolfSSL_X509_REQ_free(WOLFSSL_X509* req);
4469 WOLFSSL_API int wolfSSL_X509_REQ_sign(WOLFSSL_X509 *req, WOLFSSL_EVP_PKEY *pkey,
4470 const WOLFSSL_EVP_MD *md);
4471 WOLFSSL_API int wolfSSL_X509_REQ_sign_ctx(WOLFSSL_X509 *req,
4472 WOLFSSL_EVP_MD_CTX* md_ctx);
4473 WOLFSSL_API int wolfSSL_X509_REQ_add_extensions(WOLFSSL_X509* req,
4474 WOLF_STACK_OF(WOLFSSL_X509_EXTENSION)* ext_sk);
4475 WOLFSSL_API int wolfSSL_X509_REQ_set_subject_name(WOLFSSL_X509 *req,
4476 WOLFSSL_X509_NAME *name);
4477 WOLFSSL_API int wolfSSL_X509_REQ_set_pubkey(WOLFSSL_X509 *req,
4478 WOLFSSL_EVP_PKEY *pkey);
4479 WOLFSSL_API int wolfSSL_X509_REQ_add1_attr_by_NID(WOLFSSL_X509 *req,
4480 int nid, int type,
4481 const unsigned char *bytes,
4482 int len);
4483 WOLFSSL_API int wolfSSL_X509_REQ_add1_attr_by_txt(WOLFSSL_X509 *req,
4484 const char *attrname, int type,
4485 const unsigned char *bytes, int len);
4486 WOLFSSL_API WOLFSSL_X509 *wolfSSL_X509_to_X509_REQ(WOLFSSL_X509 *x,
4487 WOLFSSL_EVP_PKEY *pkey, const WOLFSSL_EVP_MD *md);
4488 #endif
4489
4490 #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) && defined(WOLFSSL_CERT_GEN) || \
4491 defined(WOLFSSL_CERT_REQ)
4492 WOLFSSL_API int wolfSSL_X509_REQ_get_attr_count(const WOLFSSL_X509 *req);
4493 WOLFSSL_API WOLFSSL_X509_ATTRIBUTE *wolfSSL_X509_REQ_get_attr(
4494 const WOLFSSL_X509 *req, int loc);
4495 WOLFSSL_API int wolfSSL_X509_REQ_get_attr_by_NID(const WOLFSSL_X509 *req,
4496 int nid, int lastpos);
4497 WOLFSSL_API WOLFSSL_X509_ATTRIBUTE* wolfSSL_X509_ATTRIBUTE_new(void);
4498 WOLFSSL_API void wolfSSL_X509_ATTRIBUTE_free(WOLFSSL_X509_ATTRIBUTE* attr);
4499 WOLFSSL_API WOLFSSL_ASN1_TYPE *wolfSSL_X509_ATTRIBUTE_get0_type(
4500 WOLFSSL_X509_ATTRIBUTE *attr, int idx);
4501 #endif
4502
4503 #if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) \
4504 || defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY)
4505
4506 #include <wolfssl/openssl/crypto.h>
4507
4508 WOLFSSL_API int wolfSSL_CRYPTO_set_mem_functions(
4509 wolfSSL_OSSL_Malloc_cb m,
4510 wolfSSL_OSSL_Realloc_cb r,
4511 wolfSSL_OSSL_Free_cb f);
4512 WOLFSSL_API int wolfSSL_CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int),
4513 void *(*r) (void *, size_t, const char *, int), void (*f) (void *));
4514
4515 WOLFSSL_API void wolfSSL_CRYPTO_cleanup_all_ex_data(void);
4516
4517 WOLFSSL_API int wolfSSL_CRYPTO_memcmp(const void *a, const void *b, size_t size);
4518
4519 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_768_prime(WOLFSSL_BIGNUM* bn);
4520 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_1024_prime(WOLFSSL_BIGNUM* bn);
4521 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_1536_prime(WOLFSSL_BIGNUM* bn);
4522 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_2048_prime(WOLFSSL_BIGNUM* bn);
4523 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_3072_prime(WOLFSSL_BIGNUM* bn);
4524 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_4096_prime(WOLFSSL_BIGNUM* bn);
4525 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_6144_prime(WOLFSSL_BIGNUM* bn);
4526 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_8192_prime(WOLFSSL_BIGNUM* bn);
4527
4528 WOLFSSL_API WOLFSSL_DH *wolfSSL_DH_generate_parameters(int prime_len, int generator,
4529 void (*callback) (int, int, void *), void *cb_arg);
4530
4531 WOLFSSL_API int wolfSSL_DH_generate_parameters_ex(WOLFSSL_DH* dh, int prime_len, int generator,
4532 void (*callback) (int, int, void *));
4533
4534 WOLFSSL_API int wolfSSL_ERR_load_ERR_strings(void);
4535 WOLFSSL_API void wolfSSL_ERR_load_crypto_strings(void);
4536 WOLFSSL_API unsigned long wolfSSL_ERR_peek_last_error(void);
4537
4538 WOLFSSL_API int wolfSSL_FIPS_mode(void);
4539

NetBurner, Inc.
22.199 wolfssl/ssl.h 1083

4540 WOLFSSL_API int wolfSSL_FIPS_mode_set(int r);


4541
4542 WOLFSSL_API int wolfSSL_RAND_set_rand_method(const WOLFSSL_RAND_METHOD *methods);
4543
4544 WOLFSSL_API int wolfSSL_CIPHER_get_bits(const WOLFSSL_CIPHER *c, int *alg_bits);
4545
4546 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_X509_new(void);
4547 WOLFSSL_API int wolfSSL_sk_X509_num(const WOLF_STACK_OF(WOLFSSL_X509) *s);
4548
4549 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_X509_OBJECT_new(void);
4550 WOLFSSL_API void wolfSSL_sk_X509_OBJECT_free(WOLFSSL_STACK* s);
4551 WOLFSSL_API void wolfSSL_sk_X509_OBJECT_pop_free(WOLFSSL_STACK* s,
4552 void (*f) (WOLFSSL_X509_OBJECT*));
4553 WOLFSSL_API int wolfSSL_sk_X509_OBJECT_push(WOLFSSL_STACK* sk, WOLFSSL_X509_OBJECT* obj);
4554
4555 WOLFSSL_API WOLFSSL_X509_INFO *wolfSSL_X509_INFO_new(void);
4556 WOLFSSL_API void wolfSSL_X509_INFO_free(WOLFSSL_X509_INFO* info);
4557
4558 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_X509_INFO_new_null(void);
4559 WOLFSSL_API int wolfSSL_sk_X509_INFO_num(const WOLF_STACK_OF(WOLFSSL_X509_INFO)* sk);
4560 WOLFSSL_API WOLFSSL_X509_INFO* wolfSSL_sk_X509_INFO_value(
4561 const WOLF_STACK_OF(WOLFSSL_X509_INFO)* sk, int i);
4562 WOLFSSL_API int wolfSSL_sk_X509_INFO_push(WOLF_STACK_OF(WOLFSSL_X509_INFO)*,
4563 WOLFSSL_X509_INFO* in);
4564 WOLFSSL_API WOLFSSL_X509_INFO* wolfSSL_sk_X509_INFO_pop(WOLF_STACK_OF(WOLFSSL_X509_INFO)*);
4565 WOLFSSL_API void wolfSSL_sk_X509_INFO_pop_free(WOLF_STACK_OF(WOLFSSL_X509_INFO)*,
4566 void (*f) (WOLFSSL_X509_INFO*));
4567 WOLFSSL_API void wolfSSL_sk_X509_INFO_free(WOLF_STACK_OF(WOLFSSL_X509_INFO)*);
4568
4569 typedef int (*wolf_sk_compare_cb)(const void* a,
4570 const void* b);
4571 typedef unsigned long (*wolf_sk_hash_cb) (const void *v);
4572 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_sk_X509_NAME_new(
4573 wolf_sk_compare_cb cb);
4574 WOLFSSL_API int wolfSSL_sk_X509_NAME_push(WOLF_STACK_OF(WOLFSSL_X509_NAME)*,
4575 WOLFSSL_X509_NAME* name);
4576 WOLFSSL_API int wolfSSL_sk_X509_NAME_find(const WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk,
4577 WOLFSSL_X509_NAME* name);
4578 WOLFSSL_API int wolfSSL_sk_X509_NAME_set_cmp_func(
4579 WOLF_STACK_OF(WOLFSSL_X509_NAME)*, wolf_sk_compare_cb cb);
4580 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_sk_X509_NAME_value(const WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk,
int i);
4581 WOLFSSL_API int wolfSSL_sk_X509_NAME_num(const WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk);
4582 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_sk_X509_NAME_pop(WOLF_STACK_OF(WOLFSSL_X509_NAME)*);
4583 WOLFSSL_API void wolfSSL_sk_X509_NAME_pop_free(WOLF_STACK_OF(WOLFSSL_X509_NAME)*,
4584 void (*f) (WOLFSSL_X509_NAME*));
4585 WOLFSSL_API void wolfSSL_sk_X509_NAME_free(WOLF_STACK_OF(WOLFSSL_X509_NAME) *);
4586
4587 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME_ENTRY)*
4588 wolfSSL_sk_X509_NAME_ENTRY_new(wolf_sk_compare_cb cb);
4589 WOLFSSL_API int wolfSSL_sk_X509_NAME_ENTRY_push(WOLF_STACK_OF(WOLFSSL_X509_NAME_ENTRY)* sk,
4590 WOLFSSL_X509_NAME_ENTRY* name_entry);
4591 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY*
4592 wolfSSL_sk_X509_NAME_ENTRY_value(const WOLF_STACK_OF(WOLFSSL_X509_NAME_ENTRY)* sk, int
i);
4593 WOLFSSL_API int wolfSSL_sk_X509_NAME_ENTRY_num(const WOLF_STACK_OF(WOLFSSL_X509_NAME_ENTRY)* sk);
4594 WOLFSSL_API void wolfSSL_sk_X509_NAME_ENTRY_free(WOLF_STACK_OF(WOLFSSL_X509_NAME_ENTRY)* sk);
4595
4596
4597 WOLFSSL_API int wolfSSL_sk_X509_OBJECT_num(const WOLF_STACK_OF(WOLFSSL_X509_OBJECT) *s);
4598
4599 WOLFSSL_API int wolfSSL_X509_NAME_print_ex(WOLFSSL_BIO* bio,WOLFSSL_X509_NAME* name,int indent,
4600 unsigned long flags);
4601 #ifndef NO_FILESYSTEM
4602 WOLFSSL_API int wolfSSL_X509_NAME_print_ex_fp(XFILE fp,WOLFSSL_X509_NAME* name,int indent,
4603 unsigned long flags);
4604 #endif
4605
4606 WOLFSSL_API WOLFSSL_STACK *wolfSSL_sk_CONF_VALUE_new(wolf_sk_compare_cb compFunc);
4607 WOLFSSL_API void wolfSSL_sk_CONF_VALUE_free(struct WOLFSSL_STACK *sk);
4608 WOLFSSL_API int wolfSSL_sk_CONF_VALUE_num(const WOLFSSL_STACK *sk);
4609 WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_sk_CONF_VALUE_value(
4610 const struct WOLFSSL_STACK *sk, int i);
4611 WOLFSSL_API int wolfSSL_sk_CONF_VALUE_push(WOLF_STACK_OF(WOLFSSL_CONF_VALUE)* sk,
4612 WOLFSSL_CONF_VALUE* val);
4613 #endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY || OPENSSL_EXTRA ||
HAVE_LIGHTY */
4614
4615 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
4616 WOLFSSL_API WOLFSSL_ASN1_BIT_STRING* wolfSSL_ASN1_BIT_STRING_new(void);
4617 WOLFSSL_API void wolfSSL_ASN1_BIT_STRING_free(WOLFSSL_ASN1_BIT_STRING* str);
4618 WOLFSSL_API WOLFSSL_ASN1_BIT_STRING* wolfSSL_X509_get0_pubkey_bitstr(
4619 const WOLFSSL_X509* x);
4620 WOLFSSL_API int wolfSSL_ASN1_BIT_STRING_get_bit(
4621 const WOLFSSL_ASN1_BIT_STRING* str, int i);
4622 WOLFSSL_API int wolfSSL_ASN1_BIT_STRING_set_bit(
4623 WOLFSSL_ASN1_BIT_STRING* str, int pos, int val);

NetBurner, Inc.
1084 File Documentation

4624 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */


4625
4626 WOLFSSL_API int wolfSSL_version(WOLFSSL* ssl);
4627
4628 #if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) \
4629 || defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY)
4630
4631 WOLFSSL_API int wolfSSL_get_state(const WOLFSSL* ssl);
4632
4633 WOLFSSL_API WOLFSSL_X509* wolfSSL_sk_X509_value(WOLF_STACK_OF(WOLFSSL_X509)*, int i);
4634
4635 WOLFSSL_API WOLFSSL_X509* wolfSSL_sk_X509_shift(WOLF_STACK_OF(WOLFSSL_X509)*);
4636
4637 WOLFSSL_API void* wolfSSL_sk_X509_OBJECT_value(WOLF_STACK_OF(WOLFSSL_X509_OBJECT)*, int i);
4638 #endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY || OPENSSL_EXTRA ||
HAVE_LIGHTY */
4639
4640 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL) || defined(HAVE_EX_DATA)
4641 WOLFSSL_API void* wolfSSL_SESSION_get_ex_data(const WOLFSSL_SESSION* session, int idx);
4642
4643 WOLFSSL_API int wolfSSL_SESSION_set_ex_data(WOLFSSL_SESSION* session, int idx, void* data);
4644 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
4645 WOLFSSL_API int wolfSSL_SESSION_set_ex_data_with_cleanup(
4646 WOLFSSL_SESSION* session,
4647 int idx,
4648 void* data,
4649 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
4650 #endif
4651 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
4652
4653 #if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) \
4654 || defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY)
4655
4656 WOLFSSL_API int wolfSSL_SESSION_get_ex_new_index(long idx,void* data,void* cb1,void* cb2,
4657 CRYPTO_free_func* cb3);
4658
4659 WOLFSSL_API const unsigned char* wolfSSL_SESSION_get_id(
4660 const WOLFSSL_SESSION* sess, unsigned int* idLen);
4661
4662 WOLFSSL_API int wolfSSL_SESSION_print(WOLFSSL_BIO* bp, const WOLFSSL_SESSION* session);
4663
4664 WOLFSSL_API int wolfSSL_set_tlsext_host_name(WOLFSSL* ssl, const char* host_name);
4665
4666 WOLFSSL_API const char* wolfSSL_get_servername(WOLFSSL* ssl, unsigned char type);
4667
4668 WOLFSSL_API WOLFSSL_CTX* wolfSSL_set_SSL_CTX(WOLFSSL* ssl,WOLFSSL_CTX* ctx);
4669
4670 WOLFSSL_API VerifyCallback wolfSSL_CTX_get_verify_callback(WOLFSSL_CTX* ctx);
4671
4672 WOLFSSL_API VerifyCallback wolfSSL_get_verify_callback(WOLFSSL* ssl);
4673
4674 #endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY || HAVE_LIGHTY */
4675
4676 #ifdef HAVE_SNI
4677 /* SNI received callback type */
4678 typedef int (*CallbackSniRecv)(WOLFSSL *ssl, int *ret, void* exArg);
4679
4680 WOLFSSL_API void wolfSSL_CTX_set_servername_callback(WOLFSSL_CTX* ctx,
4681 CallbackSniRecv cb);
4682 WOLFSSL_API int wolfSSL_CTX_set_tlsext_servername_callback(WOLFSSL_CTX* ctx,
4683 CallbackSniRecv cb);
4684
4685 WOLFSSL_API int wolfSSL_CTX_set_servername_arg(WOLFSSL_CTX* ctx, void* arg);
4686 #endif
4687
4688 #if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) \
4689 || defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY)
4690
4691 WOLFSSL_API void wolfSSL_ERR_remove_thread_state(void* pid);
4692
4693 /* support for deprecated old name */
4694 #define WOLFSSL_ERR_remove_thread_state wolfSSL_ERR_remove_thread_state
4695
4696 #ifndef NO_FILESYSTEM
4697 WOLFSSL_API void wolfSSL_print_all_errors_fp(XFILE fp);
4698 #endif
4699
4700 WOLFSSL_API int wolfSSL_THREADID_set_callback(
4701 void (*threadid_func)(WOLFSSL_CRYPTO_THREADID*));
4702
4703 WOLFSSL_API void wolfSSL_THREADID_set_numeric(void* id, unsigned long val);
4704 WOLFSSL_API void wolfSSL_THREADID_current(WOLFSSL_CRYPTO_THREADID* id);
4705 WOLFSSL_API unsigned long wolfSSL_THREADID_hash(
4706 const WOLFSSL_CRYPTO_THREADID* id);
4707
4708 WOLFSSL_API WOLFSSL_X509_LOOKUP_TYPE wolfSSL_X509_OBJECT_get_type(
4709 const WOLFSSL_X509_OBJECT* obj);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1085

4710 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_OBJECT)*


4711 wolfSSL_X509_STORE_get0_objects(WOLFSSL_X509_STORE* store);
4712 WOLFSSL_API WOLFSSL_X509_OBJECT*
4713 wolfSSL_sk_X509_OBJECT_delete(WOLF_STACK_OF(WOLFSSL_X509_OBJECT)* sk, int i);
4714 WOLFSSL_API WOLFSSL_X509_OBJECT* wolfSSL_X509_OBJECT_new(void);
4715 WOLFSSL_API void wolfSSL_X509_OBJECT_free(WOLFSSL_X509_OBJECT *obj);
4716 WOLFSSL_API WOLFSSL_X509 *wolfSSL_X509_OBJECT_get0_X509(const WOLFSSL_X509_OBJECT *obj);
4717 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_X509_OBJECT_get0_X509_CRL(WOLFSSL_X509_OBJECT *obj);
4718 #endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY || HAVE_LIGHTY */
4719
4720 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
4721 #include <wolfssl/openssl/stack.h>
4722 WOLFSSL_API void wolfSSL_sk_X509_pop_free(WOLF_STACK_OF(WOLFSSL_X509)* sk, void (*f) (WOLFSSL_X509*));
4723 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
4724
4725 #if defined(OPENSSL_EXTRA) && defined(HAVE_ECC)
4726 WOLFSSL_API int wolfSSL_CTX_set1_curves_list(WOLFSSL_CTX* ctx, const char* names);
4727 WOLFSSL_API int wolfSSL_set1_curves_list(WOLFSSL* ssl, const char* names);
4728 #endif /* OPENSSL_EXTRA && HAVE_ECC */
4729
4730 #if defined(OPENSSL_ALL) || \
4731 defined(HAVE_STUNNEL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \
4732 defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
4733
4734 WOLFSSL_API int wolfSSL_get_verify_mode(const WOLFSSL* ssl);
4735 WOLFSSL_API int wolfSSL_CTX_get_verify_mode(const WOLFSSL_CTX* ctx);
4736
4737 #endif
4738
4739 #ifdef WOLFSSL_JNI
4740 WOLFSSL_API int wolfSSL_set_jobject(WOLFSSL* ssl, void* objPtr);
4741 WOLFSSL_API void* wolfSSL_get_jobject(WOLFSSL* ssl);
4742 #endif /* WOLFSSL_JNI */
4743
4744
4745 #ifdef WOLFSSL_ASYNC_CRYPT
4746 WOLFSSL_API int wolfSSL_AsyncPoll(WOLFSSL* ssl, WOLF_EVENT_FLAG flags);
4747 WOLFSSL_API int wolfSSL_CTX_AsyncPoll(WOLFSSL_CTX* ctx, WOLF_EVENT** events, int maxEvents,
4748 WOLF_EVENT_FLAG flags, int* eventCount);
4749 #endif /* WOLFSSL_ASYNC_CRYPT */
4750
4751 typedef void (*Rem_Sess_Cb)(WOLFSSL_CTX*, WOLFSSL_SESSION*);
4752
4753 #ifdef OPENSSL_EXTRA
4754 typedef void (*SSL_Msg_Cb)(int write_p, int version, int content_type,
4755 const void *buf, size_t len, WOLFSSL *ssl, void *arg);
4756
4757 #if defined(HAVE_SECRET_CALLBACK)
4758 typedef void (*wolfSSL_CTX_keylog_cb_func)
4759 (const WOLFSSL* ssl, const char* line);
4760 WOLFSSL_API void wolfSSL_CTX_set_keylog_callback(WOLFSSL_CTX* ctx,
4761 wolfSSL_CTX_keylog_cb_func cb);
4762 WOLFSSL_API wolfSSL_CTX_keylog_cb_func wolfSSL_CTX_get_keylog_callback(
4763 const WOLFSSL_CTX* ctx);
4764 #endif /* HAVE_SECRET_CALLBACK */
4765
4766 WOLFSSL_API int wolfSSL_CTX_set_msg_callback(WOLFSSL_CTX *ctx, SSL_Msg_Cb cb);
4767 WOLFSSL_API int wolfSSL_set_msg_callback(WOLFSSL *ssl, SSL_Msg_Cb cb);
4768 WOLFSSL_API int wolfSSL_CTX_set_msg_callback_arg(WOLFSSL_CTX *ctx, void* arg);
4769 WOLFSSL_API int wolfSSL_set_msg_callback_arg(WOLFSSL *ssl, void* arg);
4770 WOLFSSL_API unsigned long wolfSSL_ERR_peek_error_line_data(const char **file,
4771 int *line, const char **data, int *flags);
4772 WOLFSSL_API int wolfSSL_CTX_set_alpn_protos(WOLFSSL_CTX *ctx,
4773 const unsigned char *protos, unsigned int protos_len);
4774 WOLFSSL_API int wolfSSL_set_alpn_protos(WOLFSSL* ssl,
4775 const unsigned char* protos, unsigned int protos_len);
4776 WOLFSSL_API void *wolfSSL_OPENSSL_memdup(const void *data,
4777 size_t siz, const char* file, int line);
4778 WOLFSSL_API void wolfSSL_OPENSSL_cleanse(void *ptr, size_t len);
4779 WOLFSSL_API void wolfSSL_ERR_load_BIO_strings(void);
4780 WOLFSSL_API void wolfSSL_DH_get0_pqg(const WOLFSSL_DH* dh,
4781 const WOLFSSL_BIGNUM** p, const WOLFSSL_BIGNUM** q,
4782 const WOLFSSL_BIGNUM** g);
4783 WOLFSSL_API void wolfSSL_DH_get0_key(const WOLFSSL_DH *dh,
4784 const WOLFSSL_BIGNUM **pub_key, const WOLFSSL_BIGNUM **priv_key);
4785 WOLFSSL_API int wolfSSL_DH_set0_key(WOLFSSL_DH *dh, WOLFSSL_BIGNUM *pub_key,
4786 WOLFSSL_BIGNUM *priv_key);
4787 #endif
4788
4789 #if defined(HAVE_OCSP) && !defined(NO_ASN_TIME)
4790 WOLFSSL_API int wolfSSL_get_ocsp_producedDate(
4791 WOLFSSL *ssl,
4792 byte *producedDate,
4793 size_t producedDate_space,
4794 int *producedDateFormat);
4795 WOLFSSL_API int wolfSSL_get_ocsp_producedDate_tm(WOLFSSL *ssl,
4796 struct tm *produced_tm);

NetBurner, Inc.
1086 File Documentation

4797 #endif
4798
4799 #if defined(OPENSSL_ALL) \
4800 || defined(WOLFSSL_NGINX) \
4801 || defined(WOLFSSL_HAPROXY) \
4802 || defined(OPENSSL_EXTRA) \
4803 || defined(HAVE_STUNNEL)
4804 WOLFSSL_API void wolfSSL_OPENSSL_config(char *config_name);
4805 #endif
4806
4807 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
4808 /* Not an OpenSSL API. */
4809 WOLFSSL_LOCAL int wolfSSL_get_ocsp_response(WOLFSSL* ssl, byte** response);
4810 /* Not an OpenSSL API. */
4811 WOLFSSL_LOCAL char* wolfSSL_get_ocsp_url(WOLFSSL* ssl);
4812 /* Not an OpenSSL API. */
4813 WOLFSSL_API int wolfSSL_set_ocsp_url(WOLFSSL* ssl, char* url);
4814 #endif
4815
4816 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) \
4817 || defined(WOLFSSL_WPAS_SMALL)
4818 WOLFSSL_API void *wolfSSL_X509_get_ex_data(WOLFSSL_X509 *x509, int idx);
4819 WOLFSSL_API int wolfSSL_X509_set_ex_data(WOLFSSL_X509 *x509, int idx,
4820 void *data);
4821 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
4822 WOLFSSL_API int wolfSSL_X509_set_ex_data_with_cleanup(
4823 WOLFSSL_X509 *x509,
4824 int idx,
4825 void *data,
4826 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
4827 #endif
4828 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL || WOLFSSL_WPAS_SMALL */
4829
4830 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) \
4831 || defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY) || defined(HAVE_SECRET_CALLBACK)
4832 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_CIPHER) *wolfSSL_get_ciphers_compat(const WOLFSSL *ssl);
4833 WOLFSSL_API int wolfSSL_X509_get_ex_new_index(int idx, void *arg, void *a,
4834 void *b, void *c);
4835 WOLFSSL_API int wolfSSL_X509_NAME_digest(const WOLFSSL_X509_NAME *data,
4836 const WOLFSSL_EVP_MD *type, unsigned char *md, unsigned int *len);
4837
4838 WOLFSSL_API long wolfSSL_SSL_CTX_get_timeout(const WOLFSSL_CTX *ctx);
4839 WOLFSSL_API long wolfSSL_get_timeout(WOLFSSL* ssl);
4840 WOLFSSL_API int wolfSSL_SSL_CTX_set_tmp_ecdh(WOLFSSL_CTX *ctx,
4841 WOLFSSL_EC_KEY *ecdh);
4842 WOLFSSL_API int wolfSSL_SSL_CTX_remove_session(WOLFSSL_CTX* ctx,
4843 WOLFSSL_SESSION *c);
4844
4845 WOLFSSL_API WOLFSSL_BIO *wolfSSL_SSL_get_rbio(const WOLFSSL *s);
4846 WOLFSSL_API WOLFSSL_BIO *wolfSSL_SSL_get_wbio(const WOLFSSL *s);
4847 WOLFSSL_API int wolfSSL_SSL_do_handshake(WOLFSSL *s);
4848 #ifdef OPENSSL_EXTRA
4849 WOLFSSL_API int wolfSSL_OPENSSL_init_ssl(word64 opts,
4850 const OPENSSL_INIT_SETTINGS *settings);
4851 #endif
4852 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
4853 WOLFSSL_API int wolfSSL_SSL_in_init(const WOLFSSL* ssl);
4854 #else
4855 WOLFSSL_API int wolfSSL_SSL_in_init(WOLFSSL* ssl);
4856 #endif
4857 WOLFSSL_API int wolfSSL_SSL_in_connect_init(WOLFSSL* ssl);
4858
4859 #ifndef NO_SESSION_CACHE
4860 WOLFSSL_API WOLFSSL_SESSION *wolfSSL_SSL_get0_session(const WOLFSSL *s);
4861 #endif
4862
4863 WOLFSSL_API int wolfSSL_i2a_ASN1_INTEGER(WOLFSSL_BIO *bp,
4864 const WOLFSSL_ASN1_INTEGER *a);
4865
4866 #ifdef HAVE_SESSION_TICKET
4867 typedef int (*ticketCompatCb)(WOLFSSL *ssl, unsigned char *name, unsigned char *iv,
4868 WOLFSSL_EVP_CIPHER_CTX *ectx, WOLFSSL_HMAC_CTX *hctx, int enc);
4869 WOLFSSL_API int wolfSSL_CTX_set_tlsext_ticket_key_cb(WOLFSSL_CTX* ctx, ticketCompatCb cb);
4870 #endif
4871
4872 #if defined(HAVE_OCSP) || defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL) || \
4873 defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
4874 WOLFSSL_API int wolfSSL_CTX_get_extra_chain_certs(WOLFSSL_CTX* ctx,
4875 WOLF_STACK_OF(X509)** chain);
4876 typedef int(*tlsextStatusCb)(WOLFSSL* ssl, void*);
4877 WOLFSSL_API int wolfSSL_CTX_get_tlsext_status_cb(WOLFSSL_CTX* ctx, tlsextStatusCb* cb);
4878 WOLFSSL_API int wolfSSL_CTX_set_tlsext_status_cb(WOLFSSL_CTX* ctx, tlsextStatusCb cb);
4879
4880 WOLFSSL_API int wolfSSL_CTX_get0_chain_certs(WOLFSSL_CTX *ctx,
4881 WOLF_STACK_OF(WOLFSSL_X509) **sk);
4882 WOLFSSL_API int wolfSSL_get0_chain_certs(WOLFSSL *ssl,
4883 WOLF_STACK_OF(WOLFSSL_X509) **sk);

NetBurner, Inc.
22.199 wolfssl/ssl.h 1087

4884
4885 WOLFSSL_API int wolfSSL_X509_STORE_CTX_get1_issuer(WOLFSSL_X509 **issuer,
4886 WOLFSSL_X509_STORE_CTX *ctx, WOLFSSL_X509 *x);
4887
4888 WOLFSSL_API void wolfSSL_X509_email_free(WOLF_STACK_OF(WOLFSSL_STRING) *sk);
4889 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_STRING) *wolfSSL_X509_get1_ocsp(WOLFSSL_X509 *x);
4890
4891 WOLFSSL_API int wolfSSL_X509_check_issued(WOLFSSL_X509 *issuer,
4892 WOLFSSL_X509 *subject);
4893
4894 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_STRING)* wolfSSL_sk_WOLFSSL_STRING_new(void);
4895 WOLFSSL_API void wolfSSL_WOLFSSL_STRING_free(WOLFSSL_STRING s);
4896 WOLFSSL_API void wolfSSL_sk_WOLFSSL_STRING_free(WOLF_STACK_OF(WOLFSSL_STRING)* sk);
4897 WOLFSSL_API WOLFSSL_STRING wolfSSL_sk_WOLFSSL_STRING_value(
4898 WOLF_STACK_OF(WOLFSSL_STRING)* strings, int idx);
4899 WOLFSSL_API int wolfSSL_sk_WOLFSSL_STRING_num(
4900 WOLF_STACK_OF(WOLFSSL_STRING)* strings);
4901 #endif /* HAVE_OCSP || OPENSSL_EXTRA || OPENSSL_ALL || WOLFSSL_NGINX || WOLFSSL_HAPROXY */
4902
4903 WOLFSSL_API int PEM_write_bio_WOLFSSL_X509(WOLFSSL_BIO *bio,
4904 WOLFSSL_X509 *cert);
4905
4906 #endif /* OPENSSL_ALL || WOLFSSL_NGINX || WOLFSSL_HAPROXY ||
4907 OPENSSL_EXTRA || HAVE_LIGHTY */
4908
4909 #if defined(HAVE_SESSION_TICKET) && !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && \
4910 !defined(NO_WOLFSSL_SERVER)
4911 WOLFSSL_API long wolfSSL_CTX_get_tlsext_ticket_keys(WOLFSSL_CTX *ctx,
4912 unsigned char *keys, int keylen);
4913 WOLFSSL_API long wolfSSL_CTX_set_tlsext_ticket_keys(WOLFSSL_CTX *ctx,
4914 unsigned char *keys, int keylen);
4915 #endif
4916
4917 WOLFSSL_API void wolfSSL_get0_alpn_selected(const WOLFSSL *ssl,
4918 const unsigned char **data, unsigned int *len);
4919 WOLFSSL_API int wolfSSL_select_next_proto(unsigned char **out,
4920 unsigned char *outlen,
4921 const unsigned char *in, unsigned int inlen,
4922 const unsigned char *client,
4923 unsigned int client_len);
4924 WOLFSSL_API void wolfSSL_CTX_set_alpn_select_cb(WOLFSSL_CTX *ctx,
4925 int (*cb) (WOLFSSL *ssl,
4926 const unsigned char **out,
4927 unsigned char *outlen,
4928 const unsigned char *in,
4929 unsigned int inlen,
4930 void *arg), void *arg);
4931 WOLFSSL_API void wolfSSL_CTX_set_next_protos_advertised_cb(WOLFSSL_CTX *s,
4932 int (*cb) (WOLFSSL *ssl,
4933 const unsigned char **out,
4934 unsigned int *outlen,
4935 void *arg), void *arg);
4936 WOLFSSL_API void wolfSSL_CTX_set_next_proto_select_cb(WOLFSSL_CTX *s,
4937 int (*cb) (WOLFSSL *ssl,
4938 unsigned char **out,
4939 unsigned char *outlen,
4940 const unsigned char *in,
4941 unsigned int inlen,
4942 void *arg), void *arg);
4943 WOLFSSL_API void wolfSSL_get0_next_proto_negotiated(const WOLFSSL *s, const unsigned char **data,
4944 unsigned *len);
4945
4946 #ifndef NO_ASN
4947 WOLFSSL_API int wolfSSL_X509_check_host(WOLFSSL_X509 *x, const char *chk,
4948 size_t chklen, unsigned int flags, char **peername);
4949 WOLFSSL_API int wolfSSL_X509_check_ip_asc(WOLFSSL_X509 *x, const char *ipasc,
4950 unsigned int flags);
4951 #endif
4952 #if defined(OPENSSL_EXTRA) && defined(WOLFSSL_CERT_GEN)
4953 WOLFSSL_API int wolfSSL_X509_check_email(WOLFSSL_X509 *x, const char *chk,
4954 size_t chkLen, unsigned int flags);
4955 #endif /* OPENSSL_EXTRA && WOLFSSL_CERT_GEN */
4956
4957 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
4958 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_WPAS)
4959 WOLFSSL_API const unsigned char *SSL_SESSION_get0_id_context(
4960 const WOLFSSL_SESSION *sess, unsigned int *sid_ctx_length);
4961 #endif
4962 #endif
4963
4964 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
4965 WOLFSSL_API int SSL_SESSION_set1_id(WOLFSSL_SESSION *s, const unsigned char *sid, unsigned int
sid_len);
4966 WOLFSSL_API int SSL_SESSION_set1_id_context(WOLFSSL_SESSION *s, const unsigned char *sid_ctx, unsigned
int sid_ctx_len);
4967 WOLFSSL_API WOLFSSL_X509_ALGOR* wolfSSL_X509_ALGOR_new(void);
4968 WOLFSSL_API void wolfSSL_X509_ALGOR_free(WOLFSSL_X509_ALGOR *alg);

NetBurner, Inc.
1088 File Documentation

4969 WOLFSSL_API const WOLFSSL_X509_ALGOR* wolfSSL_X509_get0_tbs_sigalg(const WOLFSSL_X509 *x);


4970 WOLFSSL_API void wolfSSL_X509_ALGOR_get0(const WOLFSSL_ASN1_OBJECT **paobj, int *pptype, const void
**ppval, const WOLFSSL_X509_ALGOR *algor);
4971 WOLFSSL_API int wolfSSL_X509_ALGOR_set0(WOLFSSL_X509_ALGOR *algor, WOLFSSL_ASN1_OBJECT *aobj, int
ptype, void *pval);
4972 WOLFSSL_API WOLFSSL_ASN1_TYPE* wolfSSL_ASN1_TYPE_new(void);
4973 WOLFSSL_API void wolfSSL_ASN1_TYPE_free(WOLFSSL_ASN1_TYPE* at);
4974 WOLFSSL_API WOLFSSL_X509_PUBKEY *wolfSSL_X509_PUBKEY_new(void);
4975 WOLFSSL_API void wolfSSL_X509_PUBKEY_free(WOLFSSL_X509_PUBKEY *x);
4976 WOLFSSL_API WOLFSSL_X509_PUBKEY *wolfSSL_X509_get_X509_PUBKEY(const WOLFSSL_X509* x509);
4977 WOLFSSL_API int wolfSSL_X509_PUBKEY_get0_param(WOLFSSL_ASN1_OBJECT **ppkalg, const unsigned char **pk,
int *ppklen, WOLFSSL_X509_ALGOR **pa, WOLFSSL_X509_PUBKEY *pub);
4978 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_X509_PUBKEY_get(WOLFSSL_X509_PUBKEY* key);
4979 WOLFSSL_API int wolfSSL_X509_PUBKEY_set(WOLFSSL_X509_PUBKEY **x, WOLFSSL_EVP_PKEY *key);
4980 WOLFSSL_API int wolfSSL_i2t_ASN1_OBJECT(char *buf, int buf_len, WOLFSSL_ASN1_OBJECT *a);
4981 WOLFSSL_API WOLFSSL_ASN1_OBJECT *wolfSSL_d2i_ASN1_OBJECT(WOLFSSL_ASN1_OBJECT **a,
4982 const unsigned char **der,
4983 long length);
4984 WOLFSSL_API int wolfSSL_i2a_ASN1_OBJECT(WOLFSSL_BIO *bp, WOLFSSL_ASN1_OBJECT *a);
4985 WOLFSSL_API int wolfSSL_i2d_ASN1_OBJECT(WOLFSSL_ASN1_OBJECT *a, unsigned char **pp);
4986 WOLFSSL_API void SSL_CTX_set_tmp_dh_callback(WOLFSSL_CTX *ctx, WOLFSSL_DH *(*dh) (WOLFSSL *ssl, int
is_export, int keylength));
4987 WOLFSSL_API WOLF_STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
4988 WOLFSSL_API int wolfSSL_X509_STORE_load_locations(WOLFSSL_X509_STORE *str, const char *file, const char
*dir);
4989 WOLFSSL_API int wolfSSL_X509_STORE_add_crl(WOLFSSL_X509_STORE *ctx, WOLFSSL_X509_CRL *x);
4990 WOLFSSL_API int wolfSSL_sk_SSL_CIPHER_num(const WOLF_STACK_OF(WOLFSSL_CIPHER)* p);
4991 WOLFSSL_API int wolfSSL_sk_SSL_CIPHER_find(
4992 WOLF_STACK_OF(WOLFSSL_CIPHER)* sk, const WOLFSSL_CIPHER* toFind);
4993 WOLFSSL_API void wolfSSL_sk_SSL_CIPHER_free(WOLF_STACK_OF(WOLFSSL_CIPHER)* sk);
4994 WOLFSSL_API int wolfSSL_sk_SSL_COMP_zero(WOLFSSL_STACK* st);
4995 WOLFSSL_API int wolfSSL_sk_SSL_COMP_num(WOLF_STACK_OF(WOLFSSL_COMP)* sk);
4996 WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_sk_SSL_CIPHER_value(WOLFSSL_STACK* sk, int i);
4997 WOLFSSL_API void ERR_load_SSL_strings(void);
4998 WOLFSSL_API void wolfSSL_EC_POINT_dump(const char *msg, const WOLFSSL_EC_POINT *p);
4999
5000 WOLFSSL_API const char *wolfSSL_ASN1_tag2str(int tag);
5001 WOLFSSL_API int wolfSSL_ASN1_STRING_print_ex(WOLFSSL_BIO *out, WOLFSSL_ASN1_STRING *str, unsigned long
flags);
5002 WOLFSSL_API int wolfSSL_ASN1_STRING_print(WOLFSSL_BIO *out, WOLFSSL_ASN1_STRING *str);
5003 WOLFSSL_API int wolfSSL_ASN1_TIME_get_length(WOLFSSL_ASN1_TIME *t);
5004 WOLFSSL_API unsigned char* wolfSSL_ASN1_TIME_get_data(WOLFSSL_ASN1_TIME *t);
5005 WOLFSSL_API WOLFSSL_ASN1_TIME *wolfSSL_ASN1_TIME_to_generalizedtime(WOLFSSL_ASN1_TIME *t,
5006 WOLFSSL_ASN1_TIME **out);
5007 WOLFSSL_API int wolfSSL_i2c_ASN1_INTEGER(WOLFSSL_ASN1_INTEGER *a, unsigned char **pp);
5008 WOLFSSL_API int wolfSSL_a2i_ASN1_INTEGER(WOLFSSL_BIO *bio, WOLFSSL_ASN1_INTEGER *asn1,
5009 char *buf, int size);
5010 WOLFSSL_API int wolfSSL_X509_CA_num(WOLFSSL_X509_STORE *store);
5011 WOLFSSL_API long wolfSSL_X509_get_version(const WOLFSSL_X509 *x);
5012 WOLFSSL_API int wolfSSL_X509_get_signature_nid(const WOLFSSL_X509* x);
5013
5014 #ifndef WOLFCRYPT_ONLY
5015 WOLFSSL_API int wolfSSL_PEM_write_bio_PKCS8PrivateKey(WOLFSSL_BIO* bio,
5016 WOLFSSL_EVP_PKEY* pkey, const WOLFSSL_EVP_CIPHER* enc, char* passwd,
5017 int passwdSz, wc_pem_password_cb* cb, void* ctx);
5018 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
5019 WOLFSSL_API int wolfSSL_PEM_write_PKCS8PrivateKey(
5020 XFILE fp, WOLFSSL_EVP_PKEY* pkey, const WOLFSSL_EVP_CIPHER* enc,
5021 char* passwd, int passwdSz, wc_pem_password_cb* cb, void* ctx);
5022 #endif /* !NO_FILESYSTEM && !NO_STDIO_FILESYSTEM */
5023 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PKCS8PrivateKey_bio(WOLFSSL_BIO* bio,
5024 WOLFSSL_EVP_PKEY** pkey, wc_pem_password_cb* cb, void* u);
5025 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_AutoPrivateKey(
5026 WOLFSSL_EVP_PKEY** pkey, const unsigned char** data, long length);
5027 #endif /* !WOLFCRYPT_ONLY */
5028
5029 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
5030
5031 #ifdef WOLFSSL_HAVE_TLS_UNIQUE
5032 WOLFSSL_API size_t wolfSSL_get_finished(const WOLFSSL *ssl, void *buf, size_t count);
5033 WOLFSSL_API size_t wolfSSL_get_peer_finished(const WOLFSSL *ssl, void *buf, size_t count);
5034 #endif /* WOLFSSL_HAVE_TLS_UNIQUE */
5035
5036 #ifdef HAVE_PK_CALLBACKS
5037 WOLFSSL_API int wolfSSL_IsPrivatePkSet(WOLFSSL* ssl);
5038 WOLFSSL_API int wolfSSL_CTX_IsPrivatePkSet(WOLFSSL_CTX* ctx);
5039 #endif
5040
5041 #ifdef HAVE_ENCRYPT_THEN_MAC
5042 WOLFSSL_API int wolfSSL_CTX_AllowEncryptThenMac(WOLFSSL_CTX* ctx, int set);
5043 WOLFSSL_API int wolfSSL_AllowEncryptThenMac(WOLFSSL *s, int set);
5044 #endif
5045
5046 /* This feature is used to set a fixed ephemeral key and is for testing only */
5047 /* Currently allows ECDHE and DHE only */
5048 #ifdef WOLFSSL_STATIC_EPHEMERAL
5049 WOLFSSL_API int wolfSSL_CTX_set_ephemeral_key(WOLFSSL_CTX* ctx, int keyAlgo,

NetBurner, Inc.
22.199 wolfssl/ssl.h 1089

5050 const char* key, unsigned int keySz, int format);


5051 WOLFSSL_API int wolfSSL_set_ephemeral_key(WOLFSSL* ssl, int keyAlgo,
5052 const char* key, unsigned int keySz, int format);
5053
5054 /* returns pointer to loaded key as ASN.1/DER */
5055 WOLFSSL_API int wolfSSL_CTX_get_ephemeral_key(WOLFSSL_CTX* ctx, int keyAlgo,
5056 const unsigned char** key, unsigned int* keySz);
5057 WOLFSSL_API int wolfSSL_get_ephemeral_key(WOLFSSL* ssl, int keyAlgo,
5058 const unsigned char** key, unsigned int* keySz);
5059 #endif
5060
5061 #if defined(OPENSSL_EXTRA)
5062 #ifndef WOLFCRYPT_ONLY
5063 WOLFSSL_API int wolfSSL_EVP_PKEY_param_check(WOLFSSL_EVP_PKEY_CTX* ctx);
5064 #endif
5065 WOLFSSL_API void wolfSSL_CTX_set_security_level(WOLFSSL_CTX* ctx, int level);
5066 WOLFSSL_API int wolfSSL_CTX_get_security_level(const WOLFSSL_CTX* ctx);
5067
5068 WOLFSSL_API int wolfSSL_SESSION_is_resumable(const WOLFSSL_SESSION *s);
5069
5070 WOLFSSL_API void wolfSSL_CRYPTO_free(void *str, const char *file, int line);
5071 WOLFSSL_API void *wolfSSL_CRYPTO_malloc(size_t num, const char *file, int line);
5072
5073 WOLFSSL_API WOLFSSL_CONF_CTX* wolfSSL_CONF_CTX_new(void);
5074 WOLFSSL_API void wolfSSL_CONF_CTX_free(WOLFSSL_CONF_CTX* cctx);
5075 WOLFSSL_API void wolfSSL_CONF_CTX_set_ssl_ctx(WOLFSSL_CONF_CTX* cctx, WOLFSSL_CTX *ctx);
5076 WOLFSSL_API unsigned int wolfSSL_CONF_CTX_set_flags(WOLFSSL_CONF_CTX* cctx, unsigned int flags);
5077 WOLFSSL_API int wolfSSL_CONF_CTX_finish(WOLFSSL_CONF_CTX* cctx);
5078
5079 #define WOLFSSL_CONF_FLAG_CMDLINE 0x1
5080 #define WOLFSSL_CONF_FLAG_FILE 0x2
5081 #define WOLFSSL_CONF_FLAG_CLIENT 0x4
5082 #define WOLFSSL_CONF_FLAG_SERVER 0x8
5083 #define WOLFSSL_CONF_FLAG_SHOW_ERRORS 0x10
5084 #define WOLFSSL_CONF_FLAG_CERTIFICATE 0x20
5085
5086 #define WOLFSSL_CONF_TYPE_UNKNOWN 0x0
5087 #define WOLFSSL_CONF_TYPE_STRING 0x1
5088 #define WOLFSSL_CONF_TYPE_FILE 0x2
5089 #define WOLFSSL_CONF_TYPE_DIR 0x3
5090
5091 WOLFSSL_API int wolfSSL_CONF_cmd(WOLFSSL_CONF_CTX* cctx, const char* cmd, const char* value);
5092 WOLFSSL_API int wolfSSL_CONF_cmd_value_type(WOLFSSL_CONF_CTX *cctx, const char *cmd);
5093 #endif /* OPENSSL_EXTRA */
5094 #if defined(HAVE_EX_DATA) || defined(WOLFSSL_WPAS_SMALL)
5095 WOLFSSL_API int wolfSSL_CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
5096 WOLFSSL_CRYPTO_EX_new* new_func,
5097 WOLFSSL_CRYPTO_EX_dup* dup_func,
5098 WOLFSSL_CRYPTO_EX_free* free_func);
5099 #endif /* HAVE_EX_DATA || WOLFSSL_WPAS_SMALL */
5100
5101 #if defined(WOLFSSL_DTLS_CID)
5102 WOLFSSL_API int wolfSSL_dtls_cid_use(WOLFSSL* ssl);
5103 WOLFSSL_API int wolfSSL_dtls_cid_is_enabled(WOLFSSL* ssl);
5104 WOLFSSL_API int wolfSSL_dtls_cid_set(WOLFSSL* ssl, unsigned char* cid,
5105 unsigned int size);
5106 WOLFSSL_API int wolfSSL_dtls_cid_get_rx_size(WOLFSSL* ssl,
5107 unsigned int* size);
5108 WOLFSSL_API int wolfSSL_dtls_cid_get_rx(WOLFSSL* ssl, unsigned char* buffer,
5109 unsigned int bufferSz);
5110 WOLFSSL_API int wolfSSL_dtls_cid_get_tx_size(WOLFSSL* ssl,
5111 unsigned int* size);
5112 WOLFSSL_API int wolfSSL_dtls_cid_get_tx(WOLFSSL* ssl, unsigned char* buffer,
5113 unsigned int bufferSz);
5114 #endif /* defined(WOLFSSL_DTLS_CID) */
5115
5116 /* */
5117 #define SSL2_VERSION 0x0002
5118 #define SSL3_VERSION 0x0300
5119 #define TLS1_VERSION 0x0301
5120 #define TLS1_1_VERSION 0x0302
5121 #define TLS1_2_VERSION 0x0303
5122 #define TLS1_3_VERSION 0x0304
5123 #define DTLS1_VERSION 0xFEFF
5124 #define DTLS1_2_VERSION 0xFEFD
5125
5126 #ifdef __cplusplus
5127 } /* extern "C" */
5128 #endif
5129
5130
5131 #endif /* WOLFSSL_SSL_H */

NetBurner, Inc.
1090 File Documentation

22.200 ssl_mailto.h File Reference


NetBurner SSL SMTP API.
#include <predef.h>
#include <mailto.h>
#include <crypto/ssl.h>

Functions
• int SSL_SendMail (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR to_←-
addr, PCSTR subject, PCSTR textbody, BOOL STARTTLS=false, int remotePort=-1, const char ∗server←-
Name=nullptr, bool verifyPeer=false, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16←-
_t certBuffFormat=SSL_FILETYPE_PEM)
Send an email message using SSL encryption.
• int SSL_SendMailHTML (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PCSTR
to_addr, PCSTR subject, const char ∗filename, BOOL STARTTLS=false, int remotePort=-1, const char
∗serverName=nullptr, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Send an HTML email message from a file using SSL encryption.
• int SSL_SendMailStartMIME (IPADDR smtp_server, PCSTR userid, PCSTR pass, PCSTR from_addr, PC-
STR to_addr, PCSTR subject, BOOL STARTTLS=false, int remotePort=-1, const char ∗serverName=nullptr,
bool verifyPeer=false, const unsigned char ∗certBuff=nullptr, uint32_t certBuffSize=0, uint16_t certBuff←-
Format=SSL_FILETYPE_PEM)
Start a Multi-purpose Internet Mail Extension (MIME)session using SSL encryption.

22.200.1 Detailed Description


NetBurner SSL SMTP API.

22.201 ssl_mailto.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
29 #ifndef _NB_SSL_MAILTO
30 #define _NB_SSL_MAILTO
31
32 #include <predef.h>
33 #ifdef NB_SSL_SUPPORTED
34
35 #include <mailto.h>
36 #include <crypto/ssl.h>
37
63 int SSL_SendMail(IPADDR smtp_server,
64 PCSTR userid,
65 PCSTR pass,
66 PCSTR from_addr,
67 PCSTR to_addr,
68 PCSTR subject,
69 PCSTR textbody,
70 BOOL STARTTLS = false,
71 int remotePort = -1,
72 const char *serverName = nullptr,
73 bool verifyPeer = false,
74 const unsigned char *certBuff = nullptr,
75 uint32_t certBuffSize = 0,
76 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
77
102 int SSL_SendMailHTML(IPADDR smtp_server,
103 PCSTR userid,
104 PCSTR pass,
105 PCSTR from_addr,
106 PCSTR to_addr,
107 PCSTR subject,
108 const char *filename,
109 BOOL STARTTLS = false,

NetBurner, Inc.
22.202 ssl_pop3.h File Reference 1091

110 int remotePort = -1,


111 const char *serverName = nullptr,
112 const unsigned char *certBuff = nullptr,
113 uint32_t certBuffSize = 0,
114 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
115
148 int SSL_SendMailStartMIME(IPADDR smtp_server, /* IP address of the SMTP server */
149 PCSTR userid, /* AscII String to provide for RFC931 IDentification */
150 PCSTR pass, /* AscII String to provide for AUTH IDentification */
151 PCSTR from_addr, /* From E-Mail address */
152 PCSTR to_addr, /* To E-Mail Address */
153 PCSTR subject, /* E-Mail subject */
154 BOOL STARTTLS = false,
155 int remotePort = -1,
156 const char *serverName = nullptr,
157 bool verifyPeer = false,
158 const unsigned char *certBuff = nullptr,
159 uint32_t certBuffSize = 0,
160 uint16_t certBuffFormat = SSL_FILETYPE_PEM);
161
162 extern uint16_t SMTP_PORT; // default is 25
163 extern uint16_t RFC931_PORT; // default is 113
164 extern uint16_t LOCAL_MAIL_PORT; // default is 0 to enable selection of random port number
165
166 /*-------------------------------------------------------------------
167 * The following functions, variables and definitions are used for
168 * error reporting of the mail system.
169 * -----------------------------------------------------------------*/
170
171 // Returns 0 or error code
172 extern int NB_Mail_Error_Code;
173
174 // Last error string reported by NetBurner mail library. This is usually
175 // displayed on the debug serial port.
176 extern char NB_Mail_Error_String[];
177
178 // Last error string received from mail server
179 extern char Server_Mail_Log_String[];
180
181 /*
182 * SMTP Error Codes
183 * Previously defined in mailto.h
184 */
185 #define STATUS_OK (0)
186 #define CONNECT_TO_SMTP_SERVER_FAILED (-1)
187 #define INITIAL_SERVER_REPLY_FAILED (-2)
188 #define HELO_SERVER_REPLY_FAILED (-3)
189 #define MAIL_FROM_SERVER_REPLY_FAILED (-4)
190 #define RCPT_TO_SERVER_REPLY_FAILED (-5)
191 #define DATA_SERVER_REPLY_FAILED (-6)
192 #define DATA_END_SERVER_REPLY_FAILED (-7)
193 #define AUTH_LOGIN_SERVER_REPLY_FAILED (-8)
194 #define USER_ID_SERVER_REPLY_FAILED (-9)
195 #define PASSWORD_SERVER_REPLY_FAILED (-10)
196 #define CONNECT931_SMTP_SERVER_FAILED (-11)
197 #define STARTTLS_SERVER_REPLY_FAILED (-12)
198
199 #endif /* NB_SSL_SUPPORTED */
200
201 #endif
202

22.202 ssl_pop3.h File Reference


NetBurner SSL POP3 API.
#include <predef.h>
#include <nettypes.h>
#include <pop3.h>

Functions
• int SSL_POP3_InitializeSession (IPADDR server_address, uint16_t port, PCSTR UserName, PCSTR Pass←-
Word, uint32_t time_out)
Initialize Post Office Protocol Version 3 (POP3) on a SSL socket.

NetBurner, Inc.
1092 File Documentation

22.202.1 Detailed Description


NetBurner SSL POP3 API.

22.203 ssl_pop3.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2
3 /*NB_COPYRIGHT*/
4
15 #ifndef _SSL_POP3_H_
16 #define _SSL_POP3_H_
17
18 #include <predef.h>
19 #ifdef NB_SSL_SUPPORTED
20
21 #include <nettypes.h>
22 #include <pop3.h>
23
24 /*
25 * Debugging
26 */
27 /* Library debugging switch */
28 /* #define SSL_POP3_DEBUG ( 1 ) */
29
30 #ifdef SSL_POP3_DEBUG
31 #define SSL_POP3_DEBUG_IPRINTF(...) \
32 { \
33 iprintf("%s:%d", __FUNCTION__, __LINE__); \
34 iprintf(__VA_ARGS__); \
35 iprintf("\r\n"); \
36 }
37 #else /* #ifdef SSL_POP3_DEBUG */
38 #define SSL_POP3_DEBUG_IPRINTF(...) ((void)0)
39 #endif /* #ifdef SSL_POP3_DEBUG */
40
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #endif
64 int SSL_POP3_InitializeSession(IPADDR server_address, uint16_t port, PCSTR UserName, PCSTR PassWord,
uint32_t time_out);
65
66 #ifdef __cplusplus
67 }
68 #endif
69
70 #endif /* NB_SSL_SUPPORTED */
71 #endif /* #ifndef _SSL_POP3_H_ */
72

22.204 callbacks.h
1 /* callbacks.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 #ifndef WOLFSSL_CALLBACKS_H
15 #define WOLFSSL_CALLBACKS_H
16
17 #include <wolfssl/wolfcrypt/wc_port.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23
24 enum { /* CALLBACK CONSTANTS */
25 MAX_PACKETNAME_SZ = 24,
26 MAX_CIPHERNAME_SZ = 24,
27 MAX_TIMEOUT_NAME_SZ = 24,

NetBurner, Inc.
22.205 certs_test.h 1093

28 MAX_PACKETS_HANDSHAKE = 14, /* 12 for client auth plus 2 alerts */


29 MAX_VALUE_SZ = 128, /* all handshake packets but Cert should
30 fit here */
31 };
32
33 struct WOLFSSL;
34
35 typedef struct handShakeInfo_st {
36 struct WOLFSSL* ssl;
37 char cipherName[MAX_CIPHERNAME_SZ + 1]; /* negotiated cipher */
38 char packetNames[MAX_PACKETS_HANDSHAKE][MAX_PACKETNAME_SZ + 1];
39 /* SSL packet names */
40 int numberPackets; /* actual # of packets */
41 int negotiationError; /* cipher/parameter err */
42 } HandShakeInfo;
43
44
45 #if defined(HAVE_SYS_TIME_H) && !defined(NO_TIMEVAL)
46 typedef struct timeval WOLFSSL_TIMEVAL;
47 #else /* HAVE_SYS_TIME_H */
48 /* Define the timeval explicitly. */
49 typedef struct {
50 long tv_sec; /* Seconds. */
51 long tv_usec; /* Microseconds. */
52 } WOLFSSL_TIMEVAL;
53 #endif /* HAVE_SYS_TIME_H */
54 #if !defined(NO_OLD_TIMEVAL_NAME)
55 #define Timeval WOLFSSL_TIMEVAL
56 #endif
57
58 typedef struct packetInfo_st {
59 char packetName[MAX_PACKETNAME_SZ + 1]; /* SSL packet name */
60 WOLFSSL_TIMEVAL timestamp; /* when it occurred */
61 unsigned char value[MAX_VALUE_SZ]; /* if fits, it’s here */
62 unsigned char* bufferValue; /* otherwise here (non 0) */
63 int valueSz; /* sz of value or buffer */
64 } PacketInfo;
65
66
67 typedef struct timeoutInfo_st {
68 char timeoutName[MAX_TIMEOUT_NAME_SZ + 1]; /* timeout Name */
69 int flags; /* for future use */
70 int numberPackets; /* actual # of packets */
71 PacketInfo packets[MAX_PACKETS_HANDSHAKE]; /* list of all packets */
72 WOLFSSL_TIMEVAL timeoutValue; /* timer that caused it */
73 } TimeoutInfo;
74
75
76
77 #ifdef __cplusplus
78 } /* extern "C" */
79 #endif
80
81
82 #endif /* WOLFSSL_CALLBACKS_H */
83

22.205 certs_test.h
1 /* certs_test.h */
2
3 #ifndef WOLFSSL_CERTS_TEST_H
4 #define WOLFSSL_CERTS_TEST_H
5
6 #ifdef USE_CERT_BUFFERS_1024
7
8 /* ./certs/1024/client-key.der, 1024-bit */
9 static const unsigned char client_key_der_1024[] =
10 {
11 0x30, 0x82, 0x02, 0x5C, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81,
12 0x00, 0xBC, 0x73, 0x0E, 0xA8, 0x49, 0xF3, 0x74, 0xA2, 0xA9,
13 0xEF, 0x18, 0xA5, 0xDA, 0x55, 0x99, 0x21, 0xF9, 0xC8, 0xEC,
14 0xB3, 0x6D, 0x48, 0xE5, 0x35, 0x35, 0x75, 0x77, 0x37, 0xEC,
15 0xD1, 0x61, 0x90, 0x5F, 0x3E, 0xD9, 0xE4, 0xD5, 0xDF, 0x94,
16 0xCA, 0xC1, 0xA9, 0xD7, 0x19, 0xDA, 0x86, 0xC9, 0xE8, 0x4D,
17 0xC4, 0x61, 0x36, 0x82, 0xFE, 0xAB, 0xAD, 0x7E, 0x77, 0x25,
18 0xBB, 0x8D, 0x11, 0xA5, 0xBC, 0x62, 0x3A, 0xA8, 0x38, 0xCC,
19 0x39, 0xA2, 0x04, 0x66, 0xB4, 0xF7, 0xF7, 0xF3, 0xAA, 0xDA,
20 0x4D, 0x02, 0x0E, 0xBB, 0x5E, 0x8D, 0x69, 0x48, 0xDC, 0x77,
21 0xC9, 0x28, 0x0E, 0x22, 0xE9, 0x6B, 0xA4, 0x26, 0xBA, 0x4C,
22 0xE8, 0xC1, 0xFD, 0x4A, 0x6F, 0x2B, 0x1F, 0xEF, 0x8A, 0xAE,
23 0xF6, 0x90, 0x62, 0xE5, 0x64, 0x1E, 0xEB, 0x2B, 0x3C, 0x67,
24 0xC8, 0xDC, 0x27, 0x00, 0xF6, 0x91, 0x68, 0x65, 0xA9, 0x02,
25 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x13, 0x97, 0xEA,
26 0xE8, 0x38, 0x78, 0x25, 0xA2, 0x5C, 0x04, 0xCE, 0x0D, 0x40,

NetBurner, Inc.
1094 File Documentation

27 0x7C, 0x31, 0xE5, 0xC4, 0x70, 0xCD, 0x9B, 0x82, 0x3B, 0x58,
28 0x09, 0x86, 0x3B, 0x66, 0x5F, 0xDC, 0x31, 0x90, 0xF1, 0x4F,
29 0xD5, 0xDB, 0x15, 0xDD, 0xDE, 0xD7, 0x3B, 0x95, 0x93, 0x31,
30 0x18, 0x31, 0x0E, 0x5E, 0xA3, 0xD6, 0xA2, 0x1A, 0x71, 0x6E,
31 0x81, 0x48, 0x1C, 0x4B, 0xCF, 0xDB, 0x8E, 0x7A, 0x86, 0x61,
32 0x32, 0xDC, 0xFB, 0x55, 0xC1, 0x16, 0x6D, 0x27, 0x92, 0x24,
33 0x45, 0x8B, 0xF1, 0xB8, 0x48, 0xB1, 0x4B, 0x1D, 0xAC, 0xDE,
34 0xDA, 0xDD, 0x8E, 0x2F, 0xC2, 0x91, 0xFB, 0xA5, 0xA9, 0x6E,
35 0xF8, 0x3A, 0x6A, 0xF1, 0xFD, 0x50, 0x18, 0xEF, 0x9F, 0xE7,
36 0xC3, 0xCA, 0x78, 0xEA, 0x56, 0xD3, 0xD3, 0x72, 0x5B, 0x96,
37 0xDD, 0x4E, 0x06, 0x4E, 0x3A, 0xC3, 0xD9, 0xBE, 0x72, 0xB6,
38 0x65, 0x07, 0x07, 0x4C, 0x01, 0x02, 0x41, 0x00, 0xFA, 0x47,
39 0xD4, 0x7A, 0x7C, 0x92, 0x3C, 0x55, 0xEF, 0x81, 0xF0, 0x41,
40 0x30, 0x2D, 0xA3, 0xCF, 0x8F, 0x1C, 0xE6, 0x87, 0x27, 0x05,
41 0x70, 0x0D, 0xDF, 0x98, 0x35, 0xD6, 0xF1, 0x8B, 0x38, 0x2F,
42 0x24, 0xB5, 0xD0, 0x84, 0xB6, 0x79, 0x4F, 0x71, 0x29, 0x94,
43 0x5A, 0xF0, 0x64, 0x6A, 0xAC, 0xE7, 0x72, 0xC6, 0xED, 0x4D,
44 0x59, 0x98, 0x3E, 0x67, 0x3A, 0xF3, 0x74, 0x2C, 0xF9, 0x61,
45 0x17, 0x69, 0x02, 0x41, 0x00, 0xC0, 0xC1, 0x82, 0x0D, 0x0C,
46 0xEB, 0xC6, 0x2F, 0xDC, 0x92, 0xF9, 0x9D, 0x82, 0x1A, 0x31,
47 0xE9, 0xE9, 0xF7, 0x4B, 0xF2, 0x82, 0x87, 0x1C, 0xEE, 0x16,
48 0x6A, 0xD1, 0x1D, 0x18, 0x82, 0x70, 0xF3, 0xC0, 0xB6, 0x2F,
49 0xF6, 0xF3, 0xF7, 0x1D, 0xF1, 0x86, 0x23, 0xC8, 0x4E, 0xEB,
50 0x8F, 0x56, 0x8E, 0x8F, 0xF5, 0xBF, 0xF1, 0xF7, 0x2B, 0xB5,
51 0xCC, 0x3D, 0xC6, 0x57, 0x39, 0x0C, 0x1B, 0x54, 0x41, 0x02,
52 0x41, 0x00, 0x9D, 0x7E, 0x05, 0xDE, 0xED, 0xF4, 0xB7, 0xB2,
53 0xFB, 0xFC, 0x30, 0x4B, 0x55, 0x1D, 0xE3, 0x2F, 0x01, 0x47,
54 0x96, 0x69, 0x05, 0xCD, 0x0E, 0x2E, 0x2C, 0xBD, 0x83, 0x63,
55 0xB6, 0xAB, 0x7C, 0xB7, 0x6D, 0xCA, 0x5B, 0x64, 0xA7, 0xCE,
56 0xBE, 0x86, 0xDF, 0x3B, 0x53, 0xDE, 0x61, 0xD2, 0x1E, 0xEB,
57 0xA5, 0xF6, 0x37, 0xED, 0xAC, 0xAB, 0x78, 0xD9, 0x4C, 0xE7,
58 0x55, 0xFB, 0xD7, 0x11, 0x99, 0xC1, 0x02, 0x40, 0x18, 0x98,
59 0x18, 0x29, 0xE6, 0x1E, 0x27, 0x39, 0x70, 0x21, 0x68, 0xAC,
60 0x0A, 0x2F, 0xA1, 0x72, 0xC1, 0x21, 0x86, 0x95, 0x38, 0xC6,
61 0x58, 0x90, 0xA0, 0x57, 0x9C, 0xBA, 0xE3, 0xA7, 0xB1, 0x15,
62 0xC8, 0xDE, 0xF6, 0x1B, 0xC2, 0x61, 0x23, 0x76, 0xEF, 0xB0,
63 0x9D, 0x1C, 0x44, 0xBE, 0x13, 0x43, 0x39, 0x67, 0x17, 0xC8,
64 0x9D, 0xCA, 0xFB, 0xF5, 0x45, 0x64, 0x8B, 0x38, 0x82, 0x2C,
65 0xF2, 0x81, 0x02, 0x40, 0x39, 0x89, 0xE5, 0x9C, 0x19, 0x55,
66 0x30, 0xBA, 0xB7, 0x48, 0x8C, 0x48, 0x14, 0x0E, 0xF4, 0x9F,
67 0x7E, 0x77, 0x97, 0x43, 0xE1, 0xB4, 0x19, 0x35, 0x31, 0x23,
68 0x75, 0x9C, 0x3B, 0x44, 0xAD, 0x69, 0x12, 0x56, 0xEE, 0x00,
69 0x61, 0x64, 0x16, 0x66, 0xD3, 0x7C, 0x74, 0x2B, 0x15, 0xB4,
70 0xA2, 0xFE, 0xBF, 0x08, 0x6B, 0x1A, 0x5D, 0x3F, 0x90, 0x12,
71 0xB1, 0x05, 0x86, 0x31, 0x29, 0xDB, 0xD9, 0xE2
72 };
73 static const int sizeof_client_key_der_1024 = sizeof(client_key_der_1024);
74
75 /* ./certs/1024/client-keyPub.der, 1024-bit */
76 static const unsigned char client_keypub_der_1024[] =
77 {
78 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48,
79 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81,
80 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xBC,
81 0x73, 0x0E, 0xA8, 0x49, 0xF3, 0x74, 0xA2, 0xA9, 0xEF, 0x18,
82 0xA5, 0xDA, 0x55, 0x99, 0x21, 0xF9, 0xC8, 0xEC, 0xB3, 0x6D,
83 0x48, 0xE5, 0x35, 0x35, 0x75, 0x77, 0x37, 0xEC, 0xD1, 0x61,
84 0x90, 0x5F, 0x3E, 0xD9, 0xE4, 0xD5, 0xDF, 0x94, 0xCA, 0xC1,
85 0xA9, 0xD7, 0x19, 0xDA, 0x86, 0xC9, 0xE8, 0x4D, 0xC4, 0x61,
86 0x36, 0x82, 0xFE, 0xAB, 0xAD, 0x7E, 0x77, 0x25, 0xBB, 0x8D,
87 0x11, 0xA5, 0xBC, 0x62, 0x3A, 0xA8, 0x38, 0xCC, 0x39, 0xA2,
88 0x04, 0x66, 0xB4, 0xF7, 0xF7, 0xF3, 0xAA, 0xDA, 0x4D, 0x02,
89 0x0E, 0xBB, 0x5E, 0x8D, 0x69, 0x48, 0xDC, 0x77, 0xC9, 0x28,
90 0x0E, 0x22, 0xE9, 0x6B, 0xA4, 0x26, 0xBA, 0x4C, 0xE8, 0xC1,
91 0xFD, 0x4A, 0x6F, 0x2B, 0x1F, 0xEF, 0x8A, 0xAE, 0xF6, 0x90,
92 0x62, 0xE5, 0x64, 0x1E, 0xEB, 0x2B, 0x3C, 0x67, 0xC8, 0xDC,
93 0x27, 0x00, 0xF6, 0x91, 0x68, 0x65, 0xA9, 0x02, 0x03, 0x01,
94 0x00, 0x01
95 };
96 static const int sizeof_client_keypub_der_1024 = sizeof(client_keypub_der_1024);
97
98 /* ./certs/1024/client-cert.der, 1024-bit */
99 static const unsigned char client_cert_der_1024[] =
100 {
101 0x30, 0x82, 0x04, 0x18, 0x30, 0x82, 0x03, 0x81, 0xA0, 0x03,
102 0x02, 0x01, 0x02, 0x02, 0x14, 0x14, 0x9B, 0x51, 0x15, 0xB7,
103 0x04, 0x28, 0xCE, 0x13, 0x3D, 0x90, 0x2B, 0x85, 0xBD, 0x24,
104 0xD7, 0xA3, 0xE9, 0xBB, 0xB6, 0x30, 0x0D, 0x06, 0x09, 0x2A,
105 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
106 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55,
107 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E,
108 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E,
109 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
110 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D,
111 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
112 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C,
113 0x5F, 0x31, 0x30, 0x32, 0x34, 0x31, 0x19, 0x30, 0x17, 0x06,

NetBurner, Inc.
22.205 certs_test.h 1095

114 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50, 0x72, 0x6F, 0x67,
115 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67, 0x2D, 0x31, 0x30,
116 0x32, 0x34, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
117 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
118 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
119 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
120 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
121 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
122 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
123 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
124 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
125 0x32, 0x34, 0x5A, 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09,
126 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
127 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
128 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
129 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
130 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06,
131 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66,
132 0x53, 0x53, 0x4C, 0x5F, 0x31, 0x30, 0x32, 0x34, 0x31, 0x19,
133 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50,
134 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67,
135 0x2D, 0x31, 0x30, 0x32, 0x34, 0x31, 0x18, 0x30, 0x16, 0x06,
136 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
137 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
138 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
139 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
140 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
141 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06,
142 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01,
143 0x05, 0x00, 0x03, 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02,
144 0x81, 0x81, 0x00, 0xBC, 0x73, 0x0E, 0xA8, 0x49, 0xF3, 0x74,
145 0xA2, 0xA9, 0xEF, 0x18, 0xA5, 0xDA, 0x55, 0x99, 0x21, 0xF9,
146 0xC8, 0xEC, 0xB3, 0x6D, 0x48, 0xE5, 0x35, 0x35, 0x75, 0x77,
147 0x37, 0xEC, 0xD1, 0x61, 0x90, 0x5F, 0x3E, 0xD9, 0xE4, 0xD5,
148 0xDF, 0x94, 0xCA, 0xC1, 0xA9, 0xD7, 0x19, 0xDA, 0x86, 0xC9,
149 0xE8, 0x4D, 0xC4, 0x61, 0x36, 0x82, 0xFE, 0xAB, 0xAD, 0x7E,
150 0x77, 0x25, 0xBB, 0x8D, 0x11, 0xA5, 0xBC, 0x62, 0x3A, 0xA8,
151 0x38, 0xCC, 0x39, 0xA2, 0x04, 0x66, 0xB4, 0xF7, 0xF7, 0xF3,
152 0xAA, 0xDA, 0x4D, 0x02, 0x0E, 0xBB, 0x5E, 0x8D, 0x69, 0x48,
153 0xDC, 0x77, 0xC9, 0x28, 0x0E, 0x22, 0xE9, 0x6B, 0xA4, 0x26,
154 0xBA, 0x4C, 0xE8, 0xC1, 0xFD, 0x4A, 0x6F, 0x2B, 0x1F, 0xEF,
155 0x8A, 0xAE, 0xF6, 0x90, 0x62, 0xE5, 0x64, 0x1E, 0xEB, 0x2B,
156 0x3C, 0x67, 0xC8, 0xDC, 0x27, 0x00, 0xF6, 0x91, 0x68, 0x65,
157 0xA9, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82, 0x01, 0x4F,
158 0x30, 0x82, 0x01, 0x4B, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
159 0x0E, 0x04, 0x16, 0x04, 0x14, 0x81, 0x69, 0x0F, 0xF8, 0xDF,
160 0xDD, 0xCF, 0x34, 0x29, 0xD5, 0x67, 0x75, 0x71, 0x85, 0xC7,
161 0x75, 0x10, 0x69, 0x59, 0xEC, 0x30, 0x81, 0xDE, 0x06, 0x03,
162 0x55, 0x1D, 0x23, 0x04, 0x81, 0xD6, 0x30, 0x81, 0xD3, 0x80,
163 0x14, 0x81, 0x69, 0x0F, 0xF8, 0xDF, 0xDD, 0xCF, 0x34, 0x29,
164 0xD5, 0x67, 0x75, 0x71, 0x85, 0xC7, 0x75, 0x10, 0x69, 0x59,
165 0xEC, 0xA1, 0x81, 0xA4, 0xA4, 0x81, 0xA1, 0x30, 0x81, 0x9E,
166 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
167 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
168 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E,
169 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07,
170 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31,
171 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C,
172 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x5F, 0x31, 0x30,
173 0x32, 0x34, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04,
174 0x0B, 0x0C, 0x10, 0x50, 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D,
175 0x6D, 0x69, 0x6E, 0x67, 0x2D, 0x31, 0x30, 0x32, 0x34, 0x31,
176 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F,
177 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73,
178 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06,
179 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01,
180 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C,
181 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14,
182 0x14, 0x9B, 0x51, 0x15, 0xB7, 0x04, 0x28, 0xCE, 0x13, 0x3D,
183 0x90, 0x2B, 0x85, 0xBD, 0x24, 0xD7, 0xA3, 0xE9, 0xBB, 0xB6,
184 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30,
185 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x1D,
186 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65, 0x78, 0x61,
187 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x87, 0x04,
188 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
189 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, 0x01,
190 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01,
191 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06, 0x09, 0x2A,
192 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
193 0x03, 0x81, 0x81, 0x00, 0x08, 0xC4, 0x3B, 0x1A, 0xE6, 0x71,
194 0x72, 0x54, 0x01, 0x5B, 0x9A, 0x1F, 0x00, 0xA7, 0xD2, 0x57,
195 0x6C, 0xA1, 0x61, 0x31, 0xB3, 0x92, 0x72, 0x69, 0xE3, 0xA2,
196 0x7C, 0x32, 0x88, 0x77, 0x40, 0x2E, 0x8F, 0x64, 0x07, 0x45,
197 0xF0, 0x09, 0x0B, 0xE9, 0xDE, 0x8E, 0xA1, 0x6F, 0xE8, 0x9E,
198 0xF1, 0xCC, 0xB0, 0x95, 0x86, 0x9B, 0xB2, 0x95, 0x73, 0xCF,
199 0xEE, 0x2C, 0xC6, 0x55, 0xAE, 0x1F, 0x95, 0xA8, 0x64, 0x4A,
200 0x1D, 0x30, 0x3F, 0xB6, 0xA6, 0xEE, 0x56, 0x49, 0x2B, 0x0D,

NetBurner, Inc.
1096 File Documentation

201 0x06, 0x79, 0x27, 0x13, 0x77, 0x75, 0x61, 0xA8, 0xB1, 0x50,
202 0x00, 0xB6, 0xD9, 0xC8, 0xA7, 0x1E, 0x04, 0xA0, 0x9E, 0x5D,
203 0x17, 0xAE, 0x43, 0xBD, 0xC5, 0x12, 0x40, 0xDF, 0xD2, 0x4D,
204 0xC6, 0x98, 0xBD, 0x41, 0x10, 0x08, 0xCD, 0x6F, 0x54, 0xB9,
205 0xD6, 0xDB, 0xDF, 0xD2, 0x1A, 0xE7, 0xA4, 0x5F, 0x16, 0xF9,
206 0xE7, 0x22
207 };
208 static const int sizeof_client_cert_der_1024 = sizeof(client_cert_der_1024);
209
210 /* ./certs/1024/dh1024.der, 1024-bit */
211 static const unsigned char dh_key_der_1024[] =
212 {
213 0x30, 0x81, 0x87, 0x02, 0x81, 0x81, 0x00, 0xA4, 0xD2, 0xB8,
214 0x6E, 0x78, 0xF5, 0xD9, 0xED, 0x2D, 0x7C, 0xDD, 0xB6, 0x16,
215 0x86, 0x5A, 0x4B, 0x05, 0x76, 0x90, 0xDD, 0x66, 0x61, 0xB9,
216 0x6D, 0x52, 0xA7, 0x1C, 0xAF, 0x62, 0xC6, 0x69, 0x47, 0x7B,
217 0x39, 0xF2, 0xFB, 0x94, 0xEC, 0xBC, 0x79, 0xFF, 0x24, 0x5E,
218 0xEF, 0x79, 0xBB, 0x59, 0xB2, 0xFC, 0xCA, 0x07, 0xD6, 0xF4,
219 0xE9, 0x34, 0xF7, 0xE8, 0x38, 0xE7, 0xD7, 0x33, 0x44, 0x1D,
220 0xA3, 0x64, 0x76, 0x1A, 0x84, 0x97, 0x54, 0x74, 0x40, 0x84,
221 0x1F, 0x15, 0xFE, 0x7C, 0x25, 0x2A, 0x2B, 0x25, 0xFD, 0x9E,
222 0xC1, 0x89, 0x33, 0x8C, 0x39, 0x25, 0x2B, 0x40, 0xE6, 0xCD,
223 0xF8, 0xA8, 0xA1, 0x8A, 0x53, 0xC6, 0x47, 0xB2, 0xA0, 0xD7,
224 0x8F, 0xEB, 0x2E, 0x60, 0x0A, 0x0D, 0x4B, 0xF8, 0xB4, 0x94,
225 0x8C, 0x63, 0x0A, 0xAD, 0xC7, 0x10, 0xEA, 0xC7, 0xA1, 0xB9,
226 0x9D, 0xF2, 0xA8, 0x37, 0x73, 0x02, 0x01, 0x02
227 };
228 static const int sizeof_dh_key_der_1024 = sizeof(dh_key_der_1024);
229
230 /* ./certs/1024/dsa1024.der, 1024-bit */
231 static const unsigned char dsa_key_der_1024[] =
232 {
233 0x30, 0x82, 0x01, 0xBC, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81,
234 0x00, 0xF7, 0x4B, 0xF9, 0xBB, 0x15, 0x98, 0xEB, 0xDD, 0xDE,
235 0x1E, 0x4E, 0x71, 0x88, 0x85, 0xF2, 0xB7, 0xBA, 0xE2, 0x4A,
236 0xDA, 0x76, 0x40, 0xCD, 0x69, 0x48, 0x9E, 0x83, 0x7C, 0x11,
237 0xF7, 0x65, 0x31, 0x78, 0xF5, 0x25, 0x2D, 0xF7, 0xB7, 0xF8,
238 0x52, 0x3F, 0xBE, 0xD8, 0xB6, 0xC5, 0xFE, 0x18, 0x15, 0x5B,
239 0xB9, 0xD5, 0x92, 0x86, 0xBC, 0xB2, 0x17, 0x7C, 0xD8, 0xB0,
240 0xBE, 0xA0, 0x7C, 0xF2, 0xD5, 0x73, 0x7A, 0x58, 0x8F, 0x8D,
241 0xE5, 0x4A, 0x00, 0x99, 0x83, 0x4A, 0xC0, 0x9E, 0x16, 0x09,
242 0xA1, 0x10, 0x34, 0xD5, 0x19, 0xBB, 0x63, 0xE3, 0xDD, 0x83,
243 0x74, 0x7F, 0x10, 0xCA, 0x73, 0x75, 0xEE, 0x31, 0x4A, 0xDD,
244 0x9F, 0xE0, 0x02, 0x6A, 0x9D, 0xEE, 0xB2, 0x4B, 0xA7, 0x6B,
245 0x2A, 0x6C, 0xC7, 0x86, 0x77, 0xE8, 0x04, 0x15, 0xDC, 0x92,
246 0xB4, 0x7A, 0x29, 0x1F, 0x4E, 0x83, 0x63, 0x85, 0x55, 0x02,
247 0x15, 0x00, 0xD2, 0x05, 0xE4, 0x73, 0xFB, 0xC1, 0x99, 0xC5,
248 0xDC, 0x68, 0xA4, 0x8D, 0x92, 0x27, 0x3D, 0xE2, 0x52, 0x5F,
249 0x89, 0x8B, 0x02, 0x81, 0x81, 0x00, 0xAA, 0x21, 0x02, 0x09,
250 0x43, 0x6E, 0xFB, 0xA2, 0x54, 0x14, 0x85, 0x0A, 0xF4, 0x28,
251 0x7C, 0xCB, 0xCC, 0xDB, 0xF5, 0x1E, 0xA2, 0x18, 0xA9, 0x21,
252 0xDE, 0x88, 0x88, 0x33, 0x8C, 0x2E, 0xEB, 0x8D, 0xA3, 0xF0,
253 0x1D, 0xC8, 0x8F, 0xF6, 0x7E, 0xF8, 0xCF, 0x12, 0xF5, 0xB4,
254 0xA1, 0x11, 0x6F, 0x0C, 0xD4, 0xF0, 0x06, 0xAD, 0xC4, 0xFC,
255 0x14, 0x45, 0xC7, 0x94, 0x15, 0xBC, 0x19, 0x4B, 0xAE, 0xEF,
256 0x93, 0x6A, 0x4F, 0xCC, 0x14, 0xD8, 0x47, 0x8B, 0x39, 0x66,
257 0x87, 0x02, 0xD4, 0x28, 0x0A, 0xB8, 0xEE, 0x09, 0x37, 0xF4,
258 0x00, 0xA0, 0x04, 0xA7, 0x79, 0xA7, 0xD2, 0x3C, 0xF7, 0x34,
259 0x43, 0x56, 0x8E, 0xD0, 0x7C, 0xC2, 0xD8, 0x4D, 0x0F, 0x89,
260 0xED, 0x14, 0xC1, 0x2C, 0x9C, 0x4C, 0x19, 0x9B, 0x9E, 0xDC,
261 0x53, 0x09, 0x9F, 0xDF, 0x2D, 0xF0, 0x0C, 0x27, 0x54, 0x3A,
262 0x77, 0x14, 0x2D, 0xDE, 0x02, 0x81, 0x81, 0x00, 0xE8, 0x1F,
263 0x7C, 0xB7, 0xC0, 0x54, 0x51, 0xA7, 0x28, 0x2D, 0x58, 0x7C,
264 0xDE, 0xD4, 0x5C, 0xDD, 0xD5, 0x76, 0x84, 0x3C, 0x36, 0x20,
265 0xC0, 0xC3, 0x25, 0xD7, 0x3A, 0x38, 0xE1, 0x54, 0xC8, 0xFD,
266 0x40, 0x68, 0x1A, 0x21, 0x54, 0x26, 0x39, 0x14, 0xBF, 0xF6,
267 0xA3, 0x9C, 0x5E, 0xD9, 0x2B, 0xF7, 0xC9, 0x25, 0xBA, 0x00,
268 0x09, 0xCB, 0x7F, 0x0C, 0x4A, 0x24, 0xFD, 0x15, 0x16, 0x15,
269 0x48, 0xCD, 0x0B, 0x52, 0x44, 0x40, 0x7B, 0x90, 0x63, 0x2B,
270 0x90, 0x22, 0xC5, 0x18, 0x05, 0x80, 0x53, 0xAF, 0x83, 0x1F,
271 0x54, 0xE2, 0xB0, 0xA2, 0x0B, 0x5A, 0x92, 0x24, 0xE1, 0x62,
272 0x28, 0x3F, 0xB7, 0xCA, 0xB9, 0x89, 0xD6, 0xA0, 0xB7, 0xAD,
273 0xAE, 0x05, 0xE1, 0xC1, 0x59, 0x40, 0xED, 0x4A, 0x1B, 0x68,
274 0xA7, 0x7B, 0xFB, 0xC3, 0x20, 0x81, 0xEF, 0x4B, 0xF3, 0x69,
275 0x91, 0xB0, 0xCE, 0x3A, 0xB0, 0x38, 0x02, 0x14, 0x25, 0x38,
276 0x3B, 0xA1, 0x19, 0x75, 0xDF, 0x9B, 0xF5, 0x72, 0x53, 0x4F,
277 0x39, 0xE1, 0x1C, 0xEC, 0x13, 0x84, 0x82, 0x18
278 };
279 static const int sizeof_dsa_key_der_1024 = sizeof(dsa_key_der_1024);
280
281 /* ./certs/1024/rsa1024.der, 1024-bit */
282 static const unsigned char rsa_key_der_1024[] =
283 {
284 0x30, 0x82, 0x02, 0x5D, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81,
285 0x00, 0xBE, 0x70, 0x70, 0xB8, 0x04, 0x18, 0xE5, 0x28, 0xFE,
286 0x66, 0xD8, 0x90, 0x88, 0xE0, 0xF1, 0xB7, 0xC3, 0xD0, 0xD2,
287 0x3E, 0xE6, 0x4B, 0x94, 0x74, 0xB0, 0xFF, 0xB0, 0xF7, 0x63,

NetBurner, Inc.
22.205 certs_test.h 1097

288 0xA5, 0xAB, 0x7E, 0xAF, 0xB6, 0x2B, 0xB7, 0x38, 0x16, 0x1A,
289 0x50, 0xBF, 0xF1, 0xCA, 0x87, 0x3A, 0xD5, 0xB0, 0xDA, 0xF8,
290 0x43, 0x7A, 0x15, 0xB9, 0x7E, 0xEA, 0x2A, 0x80, 0xD2, 0x51,
291 0xB0, 0x35, 0xAF, 0x07, 0xF3, 0xF2, 0x5D, 0x24, 0x3A, 0x4B,
292 0x87, 0x56, 0x48, 0x1B, 0x3C, 0x24, 0x9A, 0xDA, 0x70, 0x80,
293 0xBD, 0x3C, 0x8B, 0x03, 0x4A, 0x0C, 0x83, 0x71, 0xDE, 0xE3,
294 0x03, 0x70, 0xA2, 0xB7, 0x60, 0x09, 0x1B, 0x5E, 0xC7, 0x3D,
295 0xA0, 0x64, 0x60, 0xE3, 0xA9, 0x06, 0x8D, 0xD3, 0xFF, 0x42,
296 0xBB, 0x0A, 0x94, 0x27, 0x2D, 0x57, 0x42, 0x0D, 0xB0, 0x2D,
297 0xE0, 0xBA, 0x18, 0x25, 0x60, 0x92, 0x11, 0x92, 0xF3, 0x02,
298 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x0E, 0xEE, 0x1D,
299 0xC8, 0x2F, 0x7A, 0x0C, 0x2D, 0x44, 0x94, 0xA7, 0x91, 0xDD,
300 0x49, 0x55, 0x6A, 0x04, 0xCE, 0x10, 0x4D, 0xA2, 0x1C, 0x76,
301 0xCD, 0x17, 0x3B, 0x54, 0x92, 0x70, 0x9B, 0x82, 0x70, 0x72,
302 0x32, 0x24, 0x07, 0x3F, 0x3C, 0x6C, 0x5F, 0xBC, 0x4C, 0xA6,
303 0x86, 0x27, 0x94, 0xAD, 0x42, 0xDD, 0x87, 0xDC, 0xC0, 0x6B,
304 0x44, 0x89, 0xF3, 0x3F, 0x1A, 0x3E, 0x11, 0x44, 0x84, 0x2E,
305 0x69, 0x4C, 0xBB, 0x4A, 0x71, 0x1A, 0xBB, 0x9A, 0x52, 0x3C,
306 0x6B, 0xDE, 0xBC, 0xB2, 0x7C, 0x51, 0xEF, 0x4F, 0x8F, 0x3A,
307 0xDC, 0x50, 0x04, 0x4E, 0xB6, 0x31, 0x66, 0xA8, 0x8E, 0x06,
308 0x3B, 0x51, 0xA9, 0xC1, 0x8A, 0xCB, 0xC4, 0x81, 0xCA, 0x2D,
309 0x69, 0xEC, 0x88, 0xFC, 0x33, 0x88, 0xD1, 0xD4, 0x29, 0x47,
310 0x87, 0x37, 0xF9, 0x6A, 0x22, 0x69, 0xB9, 0xC9, 0xFE, 0xEB,
311 0x8C, 0xC5, 0x21, 0x41, 0x71, 0x02, 0x41, 0x00, 0xFD, 0x17,
312 0x98, 0x42, 0x54, 0x1C, 0x23, 0xF8, 0xD7, 0x5D, 0xEF, 0x49,
313 0x4F, 0xAF, 0xD9, 0x35, 0x6F, 0x08, 0xC6, 0xC7, 0x40, 0x5C,
314 0x7E, 0x58, 0x86, 0xC2, 0xB2, 0x16, 0x39, 0x24, 0xC5, 0x06,
315 0xB0, 0x3D, 0xAF, 0x02, 0xD2, 0x87, 0x77, 0xD2, 0x76, 0xBA,
316 0xE3, 0x59, 0x60, 0x42, 0xF1, 0x16, 0xEF, 0x33, 0x0B, 0xF2,
317 0x0B, 0xBA, 0x99, 0xCC, 0xB6, 0x4C, 0x46, 0x3F, 0x33, 0xE4,
318 0xD4, 0x67, 0x02, 0x41, 0x00, 0xC0, 0xA0, 0x91, 0x6D, 0xFE,
319 0x28, 0xE0, 0x81, 0x5A, 0x15, 0xA7, 0xC9, 0xA8, 0x98, 0xC6,
320 0x0A, 0xAB, 0x00, 0xC5, 0x40, 0xC9, 0x21, 0xBB, 0xB2, 0x33,
321 0x5A, 0xA7, 0xCB, 0x6E, 0xB8, 0x08, 0x56, 0x4A, 0x76, 0x28,
322 0xE8, 0x6D, 0xBD, 0xF5, 0x26, 0x7B, 0xBF, 0xC5, 0x46, 0x45,
323 0x0D, 0xEC, 0x7D, 0xEE, 0x82, 0xD6, 0xCA, 0x5F, 0x3D, 0x6E,
324 0xCC, 0x94, 0x73, 0xCD, 0xCE, 0x86, 0x6E, 0x95, 0x95, 0x02,
325 0x40, 0x38, 0xFD, 0x28, 0x1E, 0xBF, 0x5B, 0xBA, 0xC9, 0xDC,
326 0x8C, 0xDD, 0x45, 0xAF, 0xB8, 0xD3, 0xFB, 0x11, 0x2E, 0x73,
327 0xBC, 0x08, 0x05, 0x0B, 0xBA, 0x19, 0x56, 0x1B, 0xCD, 0x9F,
328 0x3E, 0x65, 0x53, 0x15, 0x3A, 0x3E, 0x7F, 0x2F, 0x32, 0xAB,
329 0xCB, 0x6B, 0x4A, 0xB7, 0xC8, 0xB7, 0x41, 0x3B, 0x92, 0x43,
330 0x78, 0x46, 0x17, 0x51, 0x86, 0xC9, 0xFC, 0xEB, 0x8B, 0x8F,
331 0x41, 0xCA, 0x08, 0x9B, 0xBF, 0x02, 0x41, 0x00, 0xAD, 0x9B,
332 0x89, 0xB6, 0xF2, 0x8C, 0x70, 0xDA, 0xE4, 0x10, 0x04, 0x6B,
333 0x11, 0x92, 0xAF, 0x5A, 0xCA, 0x08, 0x25, 0xBF, 0x60, 0x07,
334 0x11, 0x1D, 0x68, 0x7F, 0x5A, 0x1F, 0x55, 0x28, 0x74, 0x0B,
335 0x21, 0x8D, 0x21, 0x0D, 0x6A, 0x6A, 0xFB, 0xD9, 0xB5, 0x4A,
336 0x7F, 0x47, 0xF7, 0xD0, 0xB6, 0xC6, 0x41, 0x02, 0x97, 0x07,
337 0x49, 0x93, 0x1A, 0x9B, 0x33, 0x68, 0xB3, 0xA2, 0x61, 0x32,
338 0xA5, 0x89, 0x02, 0x41, 0x00, 0x8F, 0xEF, 0xAD, 0xB5, 0xB0,
339 0xB0, 0x7E, 0x86, 0x03, 0x43, 0x93, 0x6E, 0xDD, 0x3C, 0x2D,
340 0x9B, 0x6A, 0x55, 0xFF, 0x6F, 0x3E, 0x70, 0x2A, 0xD4, 0xBF,
341 0x1F, 0x8C, 0x93, 0x60, 0x9E, 0x6D, 0x2F, 0x18, 0x6C, 0x11,
342 0x36, 0x98, 0x3F, 0x10, 0x78, 0xE8, 0x3E, 0x8F, 0xFE, 0x55,
343 0xB9, 0x9E, 0xD5, 0x5B, 0x2E, 0x87, 0x1C, 0x58, 0xD0, 0x37,
344 0x89, 0x96, 0xEC, 0x48, 0x54, 0xF5, 0x9F, 0x0F, 0xB3
345 };
346 static const int sizeof_rsa_key_der_1024 = sizeof(rsa_key_der_1024);
347
348 /* ./certs/1024/ca-key.der, 1024-bit */
349 static const unsigned char ca_key_der_1024[] =
350 {
351 0x30, 0x82, 0x02, 0x5E, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81,
352 0x00, 0xCD, 0xAC, 0xDD, 0x47, 0xEC, 0xBE, 0xB7, 0x24, 0xC3,
353 0x63, 0x1B, 0x54, 0x98, 0x79, 0xE1, 0xC7, 0x31, 0x16, 0x59,
354 0xD6, 0x9D, 0x77, 0x9D, 0x8D, 0xE2, 0x8B, 0xED, 0x04, 0x17,
355 0xB2, 0xC6, 0xEB, 0xE4, 0x9B, 0x91, 0xBE, 0x31, 0x50, 0x62,
356 0x97, 0x58, 0xB5, 0x7F, 0x29, 0xDE, 0xB3, 0x71, 0x24, 0x0B,
357 0xBF, 0x97, 0x09, 0x7F, 0x26, 0xDC, 0x2D, 0xEC, 0xA8, 0x2E,
358 0xB2, 0x64, 0x2B, 0x7A, 0x2B, 0x35, 0x19, 0x2D, 0xA2, 0x80,
359 0xCB, 0x99, 0xFD, 0x94, 0x71, 0x1B, 0x23, 0x8D, 0x54, 0xDB,
360 0x2E, 0x62, 0x8D, 0x81, 0x08, 0x2D, 0xF4, 0x24, 0x72, 0x27,
361 0x6C, 0xF9, 0xC9, 0x8E, 0xDB, 0x4C, 0x75, 0xBA, 0x9B, 0x01,
362 0xF8, 0x3F, 0x18, 0xF4, 0xE6, 0x7F, 0xFB, 0x57, 0x94, 0x92,
363 0xCC, 0x88, 0xC4, 0xB4, 0x00, 0xC2, 0xAA, 0xD4, 0xE5, 0x88,
364 0x18, 0xB3, 0x11, 0x2F, 0x73, 0xC0, 0xD6, 0x29, 0x09, 0x02,
365 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x52, 0x35, 0x3D,
366 0x01, 0x29, 0xA4, 0x95, 0x29, 0x71, 0x9B, 0x64, 0x6A, 0x2C,
367 0xC3, 0xD2, 0xB5, 0xBE, 0x6E, 0x13, 0x9C, 0x8F, 0xB6, 0x26,
368 0xD8, 0x76, 0x6B, 0xBD, 0x61, 0xBC, 0x63, 0x2D, 0xD5, 0x4D,
369 0xBB, 0xCC, 0xC6, 0x3B, 0x89, 0xC8, 0xCE, 0x7B, 0x9B, 0x97,
370 0xE7, 0x51, 0x67, 0x61, 0xDA, 0xA9, 0x83, 0x7B, 0xC8, 0x44,
371 0xF5, 0x70, 0x5E, 0x3E, 0xD0, 0x7E, 0x51, 0xB9, 0x6E, 0x13,
372 0x57, 0x08, 0x5C, 0xE1, 0x67, 0x4F, 0x61, 0x5E, 0xA5, 0x09,
373 0xEC, 0x11, 0xDD, 0xE4, 0xB8, 0xB4, 0xF4, 0xE0, 0x63, 0x34,
374 0x4C, 0xDA, 0x32, 0x20, 0x1F, 0x85, 0x41, 0x5D, 0xBC, 0xDB,

NetBurner, Inc.
1098 File Documentation

375 0x24, 0xC5, 0xAF, 0xBE, 0x02, 0x5F, 0x22, 0xF1, 0x7C, 0xCC,
376 0x05, 0x56, 0xA6, 0xA6, 0x37, 0x9A, 0xEB, 0xFF, 0x52, 0x2D,
377 0xBF, 0x30, 0x4B, 0x9A, 0x1D, 0xEE, 0xAB, 0x9C, 0x2C, 0xE2,
378 0xC1, 0xB8, 0x9D, 0xC9, 0x31, 0x02, 0x41, 0x00, 0xE9, 0x89,
379 0x16, 0xCD, 0xAC, 0x2E, 0xF2, 0x4D, 0x66, 0x17, 0xBD, 0x78,
380 0x12, 0x12, 0x8D, 0x8E, 0x84, 0x24, 0xDE, 0x2D, 0x50, 0x41,
381 0x85, 0x8C, 0x34, 0x09, 0xFA, 0xFB, 0x6D, 0x87, 0x51, 0x4C,
382 0x13, 0x28, 0xF0, 0x60, 0x11, 0x86, 0x3D, 0xC2, 0xA4, 0xCF,
383 0x5E, 0xC5, 0x6F, 0x5B, 0x11, 0x32, 0x0A, 0xB5, 0x28, 0xD0,
384 0x82, 0x47, 0x44, 0x26, 0x92, 0xE2, 0x78, 0x59, 0xB4, 0x08,
385 0xB3, 0xFD, 0x02, 0x41, 0x00, 0xE1, 0x75, 0xB4, 0x6A, 0xB5,
386 0x8C, 0x11, 0xFB, 0xCC, 0x42, 0x02, 0xC5, 0xDA, 0x48, 0xCE,
387 0x29, 0x43, 0x14, 0x01, 0x9A, 0x2C, 0xB3, 0xA4, 0xCB, 0x73,
388 0xEB, 0xA1, 0x35, 0x57, 0xAD, 0xB5, 0x16, 0x17, 0x80, 0x03,
389 0x5F, 0x32, 0x37, 0xBE, 0xA2, 0x6F, 0xF9, 0x31, 0x84, 0xBF,
390 0x00, 0x6E, 0x8D, 0x03, 0x0E, 0x30, 0x1C, 0xD0, 0x2F, 0x37,
391 0xF0, 0x7E, 0xC2, 0x64, 0xBF, 0xEE, 0x4B, 0xE8, 0xFD, 0x02,
392 0x41, 0x00, 0xE1, 0x99, 0x8B, 0x2B, 0xD8, 0x9F, 0xE9, 0x76,
393 0x97, 0x9F, 0x6B, 0x6B, 0x28, 0x9A, 0x3F, 0xA1, 0x63, 0x4A,
394 0x72, 0x4E, 0xF7, 0xEE, 0xB3, 0xE2, 0x43, 0x0B, 0x39, 0x27,
395 0xD6, 0x21, 0x18, 0x8A, 0x13, 0x20, 0x43, 0x45, 0xAA, 0xE8,
396 0x31, 0x95, 0x6C, 0xBC, 0xDE, 0xE2, 0x7F, 0xB6, 0x4B, 0xA0,
397 0x39, 0xF3, 0xD3, 0x9F, 0xC9, 0x9A, 0xAA, 0xDD, 0x50, 0x9B,
398 0xF2, 0x83, 0x45, 0x85, 0xFA, 0xC9, 0x02, 0x41, 0x00, 0xAF,
399 0xB0, 0xC7, 0x7C, 0xF8, 0x28, 0x44, 0xC3, 0x50, 0xF2, 0x87,
400 0xB2, 0xA2, 0x5D, 0x65, 0xBA, 0x25, 0xB9, 0x6B, 0x5E, 0x37,
401 0x43, 0x6E, 0x41, 0xD4, 0xFD, 0x63, 0x4C, 0x6C, 0x1C, 0xC3,
402 0x26, 0x89, 0xFD, 0x89, 0xA3, 0x1F, 0x40, 0xED, 0x5F, 0x2B,
403 0x9E, 0xA6, 0x85, 0xE9, 0x49, 0x6E, 0xDC, 0x97, 0xEA, 0xF0,
404 0x77, 0x23, 0x8C, 0x08, 0x2D, 0x72, 0xBA, 0x0D, 0x44, 0xBB,
405 0x6F, 0x90, 0x09, 0x02, 0x41, 0x00, 0x91, 0xE4, 0x2E, 0xCA,
406 0x8C, 0x0A, 0x69, 0x2F, 0x62, 0xE2, 0x62, 0x3B, 0xA5, 0x8D,
407 0x5A, 0x2C, 0x56, 0x3E, 0x7F, 0x67, 0x42, 0x92, 0x12, 0x92,
408 0x5F, 0xF3, 0x97, 0xDD, 0xE1, 0xA9, 0x7F, 0xAD, 0x2E, 0x2D,
409 0xF4, 0x4A, 0x57, 0xB3, 0x7A, 0x10, 0xBD, 0xD7, 0xE4, 0xEC,
410 0x6A, 0x08, 0x21, 0xE9, 0xF2, 0x46, 0x49, 0xD2, 0x69, 0x47,
411 0x8A, 0x20, 0x4B, 0xF2, 0xB1, 0x52, 0x83, 0xAB, 0x6F, 0x10
412
413 };
414 static const int sizeof_ca_key_der_1024 = sizeof(ca_key_der_1024);
415
416 /* ./certs/1024/ca-cert.der, 1024-bit */
417 static const unsigned char ca_cert_der_1024[] =
418 {
419 0x30, 0x82, 0x04, 0x09, 0x30, 0x82, 0x03, 0x72, 0xA0, 0x03,
420 0x02, 0x01, 0x02, 0x02, 0x14, 0x24, 0x68, 0x39, 0xB1, 0x3A,
421 0xA2, 0x29, 0x1C, 0x7C, 0x95, 0x9A, 0x41, 0x32, 0xE9, 0xA9,
422 0xB3, 0xB3, 0xAA, 0x87, 0x39, 0x30, 0x0D, 0x06, 0x09, 0x2A,
423 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
424 0x30, 0x81, 0x99, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55,
425 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E,
426 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E,
427 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
428 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D,
429 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04,
430 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74,
431 0x68, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0B,
432 0x0C, 0x0F, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69,
433 0x6E, 0x67, 0x5F, 0x31, 0x30, 0x32, 0x34, 0x31, 0x18, 0x30,
434 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77,
435 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
436 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A,
437 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10,
438 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73,
439 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x1E, 0x17, 0x0D,
440 0x32, 0x32, 0x30, 0x32, 0x31, 0x35, 0x31, 0x32, 0x35, 0x30,
441 0x32, 0x34, 0x5A, 0x17, 0x0D, 0x32, 0x34, 0x31, 0x31, 0x31,
442 0x31, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x30, 0x81,
443 0x99, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
444 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
445 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61,
446 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04,
447 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E,
448 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C,
449 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74, 0x68, 0x31,
450 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0F,
451 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67,
452 0x5F, 0x31, 0x30, 0x32, 0x34, 0x31, 0x18, 0x30, 0x16, 0x06,
453 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
454 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
455 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
456 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
457 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
458 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06,
459 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01,
460 0x05, 0x00, 0x03, 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02,
461 0x81, 0x81, 0x00, 0xCD, 0xAC, 0xDD, 0x47, 0xEC, 0xBE, 0xB7,

NetBurner, Inc.
22.205 certs_test.h 1099

462 0x24, 0xC3, 0x63, 0x1B, 0x54, 0x98, 0x79, 0xE1, 0xC7, 0x31,
463 0x16, 0x59, 0xD6, 0x9D, 0x77, 0x9D, 0x8D, 0xE2, 0x8B, 0xED,
464 0x04, 0x17, 0xB2, 0xC6, 0xEB, 0xE4, 0x9B, 0x91, 0xBE, 0x31,
465 0x50, 0x62, 0x97, 0x58, 0xB5, 0x7F, 0x29, 0xDE, 0xB3, 0x71,
466 0x24, 0x0B, 0xBF, 0x97, 0x09, 0x7F, 0x26, 0xDC, 0x2D, 0xEC,
467 0xA8, 0x2E, 0xB2, 0x64, 0x2B, 0x7A, 0x2B, 0x35, 0x19, 0x2D,
468 0xA2, 0x80, 0xCB, 0x99, 0xFD, 0x94, 0x71, 0x1B, 0x23, 0x8D,
469 0x54, 0xDB, 0x2E, 0x62, 0x8D, 0x81, 0x08, 0x2D, 0xF4, 0x24,
470 0x72, 0x27, 0x6C, 0xF9, 0xC9, 0x8E, 0xDB, 0x4C, 0x75, 0xBA,
471 0x9B, 0x01, 0xF8, 0x3F, 0x18, 0xF4, 0xE6, 0x7F, 0xFB, 0x57,
472 0x94, 0x92, 0xCC, 0x88, 0xC4, 0xB4, 0x00, 0xC2, 0xAA, 0xD4,
473 0xE5, 0x88, 0x18, 0xB3, 0x11, 0x2F, 0x73, 0xC0, 0xD6, 0x29,
474 0x09, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82, 0x01, 0x4A,
475 0x30, 0x82, 0x01, 0x46, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
476 0x0E, 0x04, 0x16, 0x04, 0x14, 0xD3, 0x22, 0x8F, 0x28, 0x2C,
477 0xE0, 0x05, 0xEE, 0xD3, 0xED, 0xC3, 0x71, 0x3D, 0xC9, 0xB2,
478 0x36, 0x3A, 0x1D, 0xBF, 0xA8, 0x30, 0x81, 0xD9, 0x06, 0x03,
479 0x55, 0x1D, 0x23, 0x04, 0x81, 0xD1, 0x30, 0x81, 0xCE, 0x80,
480 0x14, 0xD3, 0x22, 0x8F, 0x28, 0x2C, 0xE0, 0x05, 0xEE, 0xD3,
481 0xED, 0xC3, 0x71, 0x3D, 0xC9, 0xB2, 0x36, 0x3A, 0x1D, 0xBF,
482 0xA8, 0xA1, 0x81, 0x9F, 0xA4, 0x81, 0x9C, 0x30, 0x81, 0x99,
483 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
484 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
485 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E,
486 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07,
487 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31,
488 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x08,
489 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74, 0x68, 0x31, 0x18,
490 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0F, 0x43,
491 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x5F,
492 0x31, 0x30, 0x32, 0x34, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03,
493 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77,
494 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
495 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86,
496 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66,
497 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
498 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x24, 0x68, 0x39, 0xB1, 0x3A,
499 0xA2, 0x29, 0x1C, 0x7C, 0x95, 0x9A, 0x41, 0x32, 0xE9, 0xA9,
500 0xB3, 0xB3, 0xAA, 0x87, 0x39, 0x30, 0x0C, 0x06, 0x03, 0x55,
501 0x1D, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF, 0x30,
502 0x1C, 0x06, 0x03, 0x55, 0x1D, 0x11, 0x04, 0x15, 0x30, 0x13,
503 0x82, 0x0B, 0x65, 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x2E,
504 0x63, 0x6F, 0x6D, 0x87, 0x04, 0x7F, 0x00, 0x00, 0x01, 0x30,
505 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14,
506 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01,
507 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02,
508 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
509 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x5B,
510 0x33, 0xEE, 0x3A, 0x51, 0x8F, 0xC7, 0xB1, 0xBC, 0xD9, 0xD6,
511 0x16, 0xB6, 0x1A, 0x99, 0x78, 0x93, 0x2D, 0x13, 0xF0, 0xA7,
512 0xF8, 0x5D, 0xA9, 0x78, 0xE0, 0x2A, 0xDD, 0xF1, 0x2E, 0xA0,
513 0x31, 0x04, 0x25, 0x84, 0xB2, 0x5C, 0x37, 0xA6, 0xFD, 0x20,
514 0x92, 0xA3, 0x88, 0x63, 0x9F, 0x04, 0x3D, 0xF2, 0x3B, 0x1E,
515 0x0D, 0x8C, 0xC4, 0xB8, 0xD1, 0x49, 0xE6, 0x8E, 0x56, 0x8D,
516 0xC6, 0xAC, 0x00, 0xFA, 0xAB, 0x8B, 0x64, 0x79, 0x90, 0x62,
517 0xFE, 0x7F, 0x41, 0x3B, 0x77, 0xAE, 0x5B, 0x4E, 0xF7, 0xB3,
518 0xA2, 0x68, 0x38, 0x80, 0xED, 0x42, 0x54, 0xB8, 0x3E, 0x94,
519 0x63, 0xA6, 0x45, 0xEB, 0xCD, 0x6E, 0x8D, 0x7D, 0xD5, 0x5E,
520 0xFF, 0x1F, 0x5D, 0xEF, 0x52, 0x2E, 0xCE, 0xE1, 0x70, 0x7E,
521 0x0D, 0x0B, 0x39, 0x20, 0xB1, 0xF3, 0xD3, 0x55, 0xBC, 0x1F,
522 0x95, 0x3B, 0x1E, 0xF6, 0x51, 0x0B, 0xBA
523 };
524 static const int sizeof_ca_cert_der_1024 = sizeof(ca_cert_der_1024);
525
526 /* ./certs/1024/server-key.der, 1024-bit */
527 static const unsigned char server_key_der_1024[] =
528 {
529 0x30, 0x82, 0x02, 0x5D, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81,
530 0x00, 0xAA, 0x3E, 0xA5, 0x9C, 0xD3, 0x17, 0x49, 0x65, 0x43,
531 0xDE, 0xD0, 0xF3, 0x4B, 0x1C, 0xDB, 0x49, 0x0C, 0xFC, 0x7A,
532 0x65, 0x05, 0x6D, 0xDE, 0x6A, 0xC4, 0xE4, 0x73, 0x2C, 0x8A,
533 0x96, 0x82, 0x8F, 0x23, 0xA5, 0x06, 0x71, 0x1C, 0x06, 0x3E,
534 0x2F, 0x92, 0x8D, 0x0B, 0x29, 0x34, 0x45, 0x59, 0xE9, 0xA9,
535 0xBC, 0x61, 0xD7, 0x24, 0x37, 0x5D, 0xB5, 0xC4, 0x37, 0x8D,
536 0xBA, 0x67, 0xB2, 0xEF, 0x03, 0x27, 0xFA, 0xC1, 0xB4, 0xCD,
537 0x6B, 0x00, 0x66, 0xB4, 0xD6, 0x73, 0x70, 0x1F, 0x08, 0x3A,
538 0xCC, 0x77, 0xAD, 0xE9, 0xF9, 0x34, 0xD4, 0xF3, 0xA0, 0x2D,
539 0xA9, 0xE7, 0x58, 0xA9, 0xC0, 0x61, 0x84, 0xB6, 0xEC, 0x3D,
540 0x0A, 0xAD, 0xFD, 0x5C, 0x86, 0x73, 0xAA, 0x6B, 0x47, 0xD8,
541 0x8B, 0x2E, 0x58, 0x4B, 0x69, 0x12, 0x82, 0x26, 0x55, 0xE6,
542 0x14, 0xBF, 0x55, 0x70, 0x88, 0xFE, 0xF9, 0x75, 0xE1, 0x02,
543 0x03, 0x01, 0x00, 0x01, 0x02, 0x81, 0x80, 0x0A, 0x4C, 0xC1,
544 0xFE, 0x4B, 0xF3, 0x23, 0xB8, 0xA1, 0xB3, 0x90, 0x56, 0xB7,
545 0xDB, 0xA6, 0x14, 0xB4, 0x59, 0x6E, 0x1A, 0x40, 0x8A, 0xD6,
546 0x23, 0x05, 0x88, 0x80, 0xC3, 0x58, 0x1B, 0x25, 0x08, 0xFD,
547 0xF2, 0x15, 0x02, 0xB0, 0xDC, 0x5B, 0xD4, 0xCA, 0xFC, 0x07,
548 0x89, 0xD5, 0xA4, 0xC0, 0x7C, 0xD7, 0x8D, 0x13, 0x2A, 0x4E,

NetBurner, Inc.
1100 File Documentation

549 0x01, 0x9F, 0x84, 0xC8, 0xBB, 0x47, 0xB2, 0xD8, 0x65, 0x45,
550 0xFA, 0x84, 0x9F, 0x88, 0xD0, 0xF4, 0xF5, 0x22, 0x35, 0x77,
551 0x11, 0x67, 0x1C, 0xDE, 0x5F, 0x85, 0x6D, 0x55, 0xD8, 0xA7,
552 0x07, 0x15, 0x8C, 0xE1, 0xB0, 0xA7, 0x79, 0xB4, 0x47, 0x9D,
553 0x70, 0xB3, 0xD2, 0xF1, 0x1F, 0x41, 0x4C, 0x65, 0x72, 0x26,
554 0xEB, 0x66, 0xC8, 0x95, 0xF6, 0x6D, 0x87, 0x35, 0x53, 0xFE,
555 0xB1, 0x52, 0x4D, 0x76, 0x5B, 0x61, 0x53, 0x89, 0xB1, 0x20,
556 0x1A, 0x8B, 0xE4, 0x7D, 0xF1, 0x02, 0x41, 0x00, 0xD9, 0x6E,
557 0xE1, 0xD9, 0x06, 0x56, 0xA1, 0xF6, 0xDF, 0x54, 0x45, 0xC5,
558 0xEC, 0x6A, 0xC8, 0x2A, 0x38, 0x4E, 0x6B, 0xC6, 0xE8, 0xEA,
559 0xFB, 0x6F, 0x65, 0x2D, 0xBA, 0xDE, 0x27, 0x63, 0x37, 0x21,
560 0x2E, 0xA4, 0x55, 0xAB, 0xE7, 0xDB, 0xCE, 0x71, 0xE1, 0x08,
561 0xFC, 0xF2, 0xCA, 0x52, 0x33, 0x55, 0xE8, 0x39, 0xB3, 0xDA,
562 0xC5, 0xB0, 0x69, 0x84, 0x6E, 0xE3, 0xCF, 0x47, 0x80, 0xA6,
563 0xB6, 0x85, 0x02, 0x41, 0x00, 0xC8, 0x71, 0x0D, 0x37, 0x47,
564 0xE1, 0x7B, 0x21, 0x2D, 0x11, 0x2D, 0x95, 0x2E, 0xC7, 0xD0,
565 0xB6, 0xD3, 0x7C, 0x5C, 0x93, 0x3C, 0x5B, 0x22, 0xE5, 0xE0,
566 0x8B, 0x6D, 0x47, 0xF9, 0x14, 0x0F, 0x9E, 0x08, 0x1B, 0x53,
567 0xAB, 0x0A, 0xA9, 0xE4, 0x7F, 0x40, 0xD3, 0xDF, 0x62, 0x74,
568 0x10, 0xA2, 0xFE, 0x83, 0x1F, 0xCF, 0x55, 0x66, 0xEB, 0x5D,
569 0xC5, 0x83, 0xBA, 0xEC, 0x9F, 0xD2, 0xB5, 0x06, 0xAD, 0x02,
570 0x41, 0x00, 0xB7, 0x68, 0x19, 0xA7, 0xC7, 0xF9, 0xF1, 0x9A,
571 0xDD, 0x5D, 0x27, 0x91, 0xC1, 0x4F, 0x7D, 0x52, 0x67, 0xB6,
572 0x76, 0xA1, 0x0D, 0x3D, 0x91, 0x23, 0xB0, 0xB3, 0xF7, 0x49,
573 0x86, 0xED, 0xE0, 0xC5, 0xE3, 0xA3, 0x09, 0x04, 0xFD, 0x89,
574 0xE2, 0xC5, 0x1A, 0x6E, 0x4B, 0x77, 0xBD, 0x03, 0xC3, 0x7B,
575 0xB6, 0x6C, 0x5D, 0xF2, 0xAF, 0x08, 0x94, 0xA8, 0xFA, 0x24,
576 0xBD, 0x66, 0x71, 0xF5, 0xAE, 0x45, 0x02, 0x40, 0x15, 0x52,
577 0xD1, 0x91, 0x1B, 0xF8, 0x84, 0xDC, 0xD6, 0xAA, 0x89, 0x2A,
578 0xE1, 0xBB, 0x28, 0x1D, 0x0B, 0x0A, 0xA3, 0xDE, 0x96, 0x01,
579 0x2C, 0x09, 0x40, 0x86, 0x14, 0xAE, 0x1F, 0x75, 0x5E, 0xE3,
580 0xF5, 0x00, 0xD3, 0x39, 0xD2, 0xFC, 0x97, 0xEE, 0x61, 0xBB,
581 0x28, 0x7C, 0x94, 0xD4, 0x60, 0x42, 0xAB, 0x38, 0x6B, 0x1A,
582 0x2E, 0xC4, 0xC3, 0x49, 0x0B, 0xE6, 0x8A, 0xDD, 0xC5, 0xD0,
583 0xB4, 0x51, 0x02, 0x41, 0x00, 0xA9, 0x8B, 0xA7, 0xA9, 0xEE,
584 0xAE, 0xBB, 0x17, 0xCB, 0x72, 0xF2, 0x50, 0x22, 0x9D, 0xB3,
585 0xDF, 0xE0, 0x40, 0x37, 0x08, 0xD5, 0x7F, 0x19, 0x58, 0x80,
586 0x70, 0x79, 0x69, 0x99, 0xDF, 0x62, 0x0D, 0x21, 0xAB, 0xDD,
587 0xB2, 0xCE, 0x68, 0xB3, 0x9F, 0x87, 0xAF, 0x55, 0xF4, 0xAA,
588 0xE1, 0x00, 0x72, 0xBE, 0x6E, 0xC3, 0x94, 0x49, 0xDC, 0xBB,
589 0x8E, 0x1A, 0x78, 0xE5, 0x49, 0x1F, 0x55, 0x41, 0xA1
590 };
591 static const int sizeof_server_key_der_1024 = sizeof(server_key_der_1024);
592
593 /* ./certs/1024/server-cert.der, 1024-bit */
594 static const unsigned char server_cert_der_1024[] =
595 {
596 0x30, 0x82, 0x03, 0xF2, 0x30, 0x82, 0x03, 0x5B, 0xA0, 0x03,
597 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x0D, 0x06, 0x09,
598 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05,
599 0x00, 0x30, 0x81, 0x99, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03,
600 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30,
601 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F,
602 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06,
603 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65,
604 0x6D, 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55,
605 0x04, 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F,
606 0x74, 0x68, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
607 0x0B, 0x0C, 0x0F, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74,
608 0x69, 0x6E, 0x67, 0x5F, 0x31, 0x30, 0x32, 0x34, 0x31, 0x18,
609 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77,
610 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
611 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09,
612 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16,
613 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66,
614 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x1E, 0x17,
615 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31, 0x35, 0x31, 0x32, 0x35,
616 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D, 0x32, 0x34, 0x31, 0x31,
617 0x31, 0x31, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x30,
618 0x81, 0x95, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
619 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06,
620 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74,
621 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
622 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61,
623 0x6E, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A,
624 0x0C, 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x31,
625 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0C,
626 0x53, 0x75, 0x70, 0x70, 0x6F, 0x72, 0x74, 0x5F, 0x31, 0x30,
627 0x32, 0x34, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
628 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
629 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
630 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
631 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
632 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
633 0x6D, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86,
634 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
635 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00,

NetBurner, Inc.
22.205 certs_test.h 1101

636 0xAA, 0x3E, 0xA5, 0x9C, 0xD3, 0x17, 0x49, 0x65, 0x43, 0xDE,
637 0xD0, 0xF3, 0x4B, 0x1C, 0xDB, 0x49, 0x0C, 0xFC, 0x7A, 0x65,
638 0x05, 0x6D, 0xDE, 0x6A, 0xC4, 0xE4, 0x73, 0x2C, 0x8A, 0x96,
639 0x82, 0x8F, 0x23, 0xA5, 0x06, 0x71, 0x1C, 0x06, 0x3E, 0x2F,
640 0x92, 0x8D, 0x0B, 0x29, 0x34, 0x45, 0x59, 0xE9, 0xA9, 0xBC,
641 0x61, 0xD7, 0x24, 0x37, 0x5D, 0xB5, 0xC4, 0x37, 0x8D, 0xBA,
642 0x67, 0xB2, 0xEF, 0x03, 0x27, 0xFA, 0xC1, 0xB4, 0xCD, 0x6B,
643 0x00, 0x66, 0xB4, 0xD6, 0x73, 0x70, 0x1F, 0x08, 0x3A, 0xCC,
644 0x77, 0xAD, 0xE9, 0xF9, 0x34, 0xD4, 0xF3, 0xA0, 0x2D, 0xA9,
645 0xE7, 0x58, 0xA9, 0xC0, 0x61, 0x84, 0xB6, 0xEC, 0x3D, 0x0A,
646 0xAD, 0xFD, 0x5C, 0x86, 0x73, 0xAA, 0x6B, 0x47, 0xD8, 0x8B,
647 0x2E, 0x58, 0x4B, 0x69, 0x12, 0x82, 0x26, 0x55, 0xE6, 0x14,
648 0xBF, 0x55, 0x70, 0x88, 0xFE, 0xF9, 0x75, 0xE1, 0x02, 0x03,
649 0x01, 0x00, 0x01, 0xA3, 0x82, 0x01, 0x4A, 0x30, 0x82, 0x01,
650 0x46, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16,
651 0x04, 0x14, 0xD9, 0x3C, 0x35, 0xEA, 0x74, 0x0E, 0x23, 0xBE,
652 0x9C, 0xFC, 0xFA, 0x29, 0x90, 0x09, 0xC1, 0xE7, 0x84, 0x16,
653 0x9F, 0x7C, 0x30, 0x81, 0xD9, 0x06, 0x03, 0x55, 0x1D, 0x23,
654 0x04, 0x81, 0xD1, 0x30, 0x81, 0xCE, 0x80, 0x14, 0xD3, 0x22,
655 0x8F, 0x28, 0x2C, 0xE0, 0x05, 0xEE, 0xD3, 0xED, 0xC3, 0x71,
656 0x3D, 0xC9, 0xB2, 0x36, 0x3A, 0x1D, 0xBF, 0xA8, 0xA1, 0x81,
657 0x9F, 0xA4, 0x81, 0x9C, 0x30, 0x81, 0x99, 0x31, 0x0B, 0x30,
658 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
659 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C,
660 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10,
661 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42,
662 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F,
663 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77,
664 0x74, 0x6F, 0x6F, 0x74, 0x68, 0x31, 0x18, 0x30, 0x16, 0x06,
665 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0F, 0x43, 0x6F, 0x6E, 0x73,
666 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x5F, 0x31, 0x30, 0x32,
667 0x34, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03,
668 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66,
669 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30,
670 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
671 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
672 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
673 0x82, 0x14, 0x24, 0x68, 0x39, 0xB1, 0x3A, 0xA2, 0x29, 0x1C,
674 0x7C, 0x95, 0x9A, 0x41, 0x32, 0xE9, 0xA9, 0xB3, 0xB3, 0xAA,
675 0x87, 0x39, 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04,
676 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03,
677 0x55, 0x1D, 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65,
678 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D,
679 0x87, 0x04, 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03,
680 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B,
681 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B,
682 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06,
683 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B,
684 0x05, 0x00, 0x03, 0x81, 0x81, 0x00, 0x8F, 0x42, 0xFD, 0x7A,
685 0xD5, 0x67, 0x3F, 0xC4, 0xF5, 0x7B, 0x0F, 0x31, 0xC9, 0x77,
686 0x3F, 0x4F, 0xE7, 0x40, 0x70, 0x87, 0x81, 0xB6, 0x8D, 0xCD,
687 0x88, 0x79, 0x2C, 0x1F, 0x53, 0xA1, 0xE5, 0x89, 0xA2, 0x73,
688 0xCA, 0x53, 0x6B, 0xB8, 0xFB, 0x6B, 0xA8, 0xDB, 0x62, 0xFE,
689 0x7D, 0x49, 0x4C, 0x32, 0xC1, 0xF9, 0xCC, 0xDD, 0x60, 0x92,
690 0x4B, 0xCC, 0x6D, 0x82, 0x56, 0xC6, 0x88, 0x34, 0x96, 0xF7,
691 0xFF, 0x23, 0xA4, 0x67, 0xF0, 0x89, 0xC4, 0x1E, 0xDB, 0xDC,
692 0x65, 0x88, 0x44, 0xB1, 0xD9, 0xEB, 0x5A, 0x69, 0x05, 0xC0,
693 0xD5, 0xDB, 0xB9, 0xD3, 0x2F, 0x6D, 0x64, 0xE3, 0x0F, 0x98,
694 0xB0, 0x17, 0x52, 0x70, 0xBB, 0x49, 0x1B, 0xD4, 0x84, 0x0E,
695 0xEC, 0x4F, 0x4C, 0x97, 0x26, 0xA0, 0x8C, 0x72, 0xA1, 0xAE,
696 0xBF, 0xA9, 0x3A, 0x76, 0x7C, 0xCB, 0xE7, 0x0D, 0x05, 0x1A,
697 0x5C, 0x0C, 0x15, 0xE7
698 };
699 static const int sizeof_server_cert_der_1024 = sizeof(server_cert_der_1024);
700
701 #endif /* USE_CERT_BUFFERS_1024 */
702
703 #ifdef USE_CERT_BUFFERS_2048
704
705 /* ./certs/client-key.der, 2048-bit */
706 static const unsigned char client_key_der_2048[] =
707 {
708 0x30, 0x82, 0x04, 0xA4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
709 0x01, 0x00, 0xC3, 0x03, 0xD1, 0x2B, 0xFE, 0x39, 0xA4, 0x32,
710 0x45, 0x3B, 0x53, 0xC8, 0x84, 0x2B, 0x2A, 0x7C, 0x74, 0x9A,
711 0xBD, 0xAA, 0x2A, 0x52, 0x07, 0x47, 0xD6, 0xA6, 0x36, 0xB2,
712 0x07, 0x32, 0x8E, 0xD0, 0xBA, 0x69, 0x7B, 0xC6, 0xC3, 0x44,
713 0x9E, 0xD4, 0x81, 0x48, 0xFD, 0x2D, 0x68, 0xA2, 0x8B, 0x67,
714 0xBB, 0xA1, 0x75, 0xC8, 0x36, 0x2C, 0x4A, 0xD2, 0x1B, 0xF7,
715 0x8B, 0xBA, 0xCF, 0x0D, 0xF9, 0xEF, 0xEC, 0xF1, 0x81, 0x1E,
716 0x7B, 0x9B, 0x03, 0x47, 0x9A, 0xBF, 0x65, 0xCC, 0x7F, 0x65,
717 0x24, 0x69, 0xA6, 0xE8, 0x14, 0x89, 0x5B, 0xE4, 0x34, 0xF7,
718 0xC5, 0xB0, 0x14, 0x93, 0xF5, 0x67, 0x7B, 0x3A, 0x7A, 0x78,
719 0xE1, 0x01, 0x56, 0x56, 0x91, 0xA6, 0x13, 0x42, 0x8D, 0xD2,
720 0x3C, 0x40, 0x9C, 0x4C, 0xEF, 0xD1, 0x86, 0xDF, 0x37, 0x51,
721 0x1B, 0x0C, 0xA1, 0x3B, 0xF5, 0xF1, 0xA3, 0x4A, 0x35, 0xE4,
722 0xE1, 0xCE, 0x96, 0xDF, 0x1B, 0x7E, 0xBF, 0x4E, 0x97, 0xD0,

NetBurner, Inc.
1102 File Documentation

723 0x10, 0xE8, 0xA8, 0x08, 0x30, 0x81, 0xAF, 0x20, 0x0B, 0x43,
724 0x14, 0xC5, 0x74, 0x67, 0xB4, 0x32, 0x82, 0x6F, 0x8D, 0x86,
725 0xC2, 0x88, 0x40, 0x99, 0x36, 0x83, 0xBA, 0x1E, 0x40, 0x72,
726 0x22, 0x17, 0xD7, 0x52, 0x65, 0x24, 0x73, 0xB0, 0xCE, 0xEF,
727 0x19, 0xCD, 0xAE, 0xFF, 0x78, 0x6C, 0x7B, 0xC0, 0x12, 0x03,
728 0xD4, 0x4E, 0x72, 0x0D, 0x50, 0x6D, 0x3B, 0xA3, 0x3B, 0xA3,
729 0x99, 0x5E, 0x9D, 0xC8, 0xD9, 0x0C, 0x85, 0xB3, 0xD9, 0x8A,
730 0xD9, 0x54, 0x26, 0xDB, 0x6D, 0xFA, 0xAC, 0xBB, 0xFF, 0x25,
731 0x4C, 0xC4, 0xD1, 0x79, 0xF4, 0x71, 0xD3, 0x86, 0x40, 0x18,
732 0x13, 0xB0, 0x63, 0xB5, 0x72, 0x4E, 0x30, 0xC4, 0x97, 0x84,
733 0x86, 0x2D, 0x56, 0x2F, 0xD7, 0x15, 0xF7, 0x7F, 0xC0, 0xAE,
734 0xF5, 0xFC, 0x5B, 0xE5, 0xFB, 0xA1, 0xBA, 0xD3, 0x02, 0x03,
735 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, 0x01, 0x00, 0xA2, 0xE6,
736 0xD8, 0x5F, 0x10, 0x71, 0x64, 0x08, 0x9E, 0x2E, 0x6D, 0xD1,
737 0x6D, 0x1E, 0x85, 0xD2, 0x0A, 0xB1, 0x8C, 0x47, 0xCE, 0x2C,
738 0x51, 0x6A, 0xA0, 0x12, 0x9E, 0x53, 0xDE, 0x91, 0x4C, 0x1D,
739 0x6D, 0xEA, 0x59, 0x7B, 0xF2, 0x77, 0xAA, 0xD9, 0xC6, 0xD9,
740 0x8A, 0xAB, 0xD8, 0xE1, 0x16, 0xE4, 0x63, 0x26, 0xFF, 0xB5,
741 0x6C, 0x13, 0x59, 0xB8, 0xE3, 0xA5, 0xC8, 0x72, 0x17, 0x2E,
742 0x0C, 0x9F, 0x6F, 0xE5, 0x59, 0x3F, 0x76, 0x6F, 0x49, 0xB1,
743 0x11, 0xC2, 0x5A, 0x2E, 0x16, 0x29, 0x0D, 0xDE, 0xB7, 0x8E,
744 0xDC, 0x40, 0xD5, 0xA2, 0xEE, 0xE0, 0x1E, 0xA1, 0xF4, 0xBE,
745 0x97, 0xDB, 0x86, 0x63, 0x96, 0x14, 0xCD, 0x98, 0x09, 0x60,
746 0x2D, 0x30, 0x76, 0x9C, 0x3C, 0xCD, 0xE6, 0x88, 0xEE, 0x47,
747 0x92, 0x79, 0x0B, 0x5A, 0x00, 0xE2, 0x5E, 0x5F, 0x11, 0x7C,
748 0x7D, 0xF9, 0x08, 0xB7, 0x20, 0x06, 0x89, 0x2A, 0x5D, 0xFD,
749 0x00, 0xAB, 0x22, 0xE1, 0xF0, 0xB3, 0xBC, 0x24, 0xA9, 0x5E,
750 0x26, 0x0E, 0x1F, 0x00, 0x2D, 0xFE, 0x21, 0x9A, 0x53, 0x5B,
751 0x6D, 0xD3, 0x2B, 0xAB, 0x94, 0x82, 0x68, 0x43, 0x36, 0xD8,
752 0xF6, 0x2F, 0xC6, 0x22, 0xFC, 0xB5, 0x41, 0x5D, 0x0D, 0x33,
753 0x60, 0xEA, 0xA4, 0x7D, 0x7E, 0xE8, 0x4B, 0x55, 0x91, 0x56,
754 0xD3, 0x5C, 0x57, 0x8F, 0x1F, 0x94, 0x17, 0x2F, 0xAA, 0xDE,
755 0xE9, 0x9E, 0xA8, 0xF4, 0xCF, 0x8A, 0x4C, 0x8E, 0xA0, 0xE4,
756 0x56, 0x73, 0xB2, 0xCF, 0x4F, 0x86, 0xC5, 0x69, 0x3C, 0xF3,
757 0x24, 0x20, 0x8B, 0x5C, 0x96, 0x0C, 0xFA, 0x6B, 0x12, 0x3B,
758 0x9A, 0x67, 0xC1, 0xDF, 0xC6, 0x96, 0xB2, 0xA5, 0xD5, 0x92,
759 0x0D, 0x9B, 0x09, 0x42, 0x68, 0x24, 0x10, 0x45, 0xD4, 0x50,
760 0xE4, 0x17, 0x39, 0x48, 0xD0, 0x35, 0x8B, 0x94, 0x6D, 0x11,
761 0xDE, 0x8F, 0xCA, 0x59, 0x02, 0x81, 0x81, 0x00, 0xEA, 0x24,
762 0xA7, 0xF9, 0x69, 0x33, 0xE9, 0x71, 0xDC, 0x52, 0x7D, 0x88,
763 0x21, 0x28, 0x2F, 0x49, 0xDE, 0xBA, 0x72, 0x16, 0xE9, 0xCC,
764 0x47, 0x7A, 0x88, 0x0D, 0x94, 0x57, 0x84, 0x58, 0x16, 0x3A,
765 0x81, 0xB0, 0x3F, 0xA2, 0xCF, 0xA6, 0x6C, 0x1E, 0xB0, 0x06,
766 0x29, 0x00, 0x8F, 0xE7, 0x77, 0x76, 0xAC, 0xDB, 0xCA, 0xC7,
767 0xD9, 0x5E, 0x9B, 0x3F, 0x26, 0x90, 0x52, 0xAE, 0xFC, 0x38,
768 0x90, 0x00, 0x14, 0xBB, 0xB4, 0x0F, 0x58, 0x94, 0xE7, 0x2F,
769 0x6A, 0x7E, 0x1C, 0x4F, 0x41, 0x21, 0xD4, 0x31, 0x59, 0x1F,
770 0x4E, 0x8A, 0x1A, 0x8D, 0xA7, 0x57, 0x6C, 0x22, 0xD8, 0xE5,
771 0xF4, 0x7E, 0x32, 0xA6, 0x10, 0xCB, 0x64, 0xA5, 0x55, 0x03,
772 0x87, 0xA6, 0x27, 0x05, 0x8C, 0xC3, 0xD7, 0xB6, 0x27, 0xB2,
773 0x4D, 0xBA, 0x30, 0xDA, 0x47, 0x8F, 0x54, 0xD3, 0x3D, 0x8B,
774 0x84, 0x8D, 0x94, 0x98, 0x58, 0xA5, 0x02, 0x81, 0x81, 0x00,
775 0xD5, 0x38, 0x1B, 0xC3, 0x8F, 0xC5, 0x93, 0x0C, 0x47, 0x0B,
776 0x6F, 0x35, 0x92, 0xC5, 0xB0, 0x8D, 0x46, 0xC8, 0x92, 0x18,
777 0x8F, 0xF5, 0x80, 0x0A, 0xF7, 0xEF, 0xA1, 0xFE, 0x80, 0xB9,
778 0xB5, 0x2A, 0xBA, 0xCA, 0x18, 0xB0, 0x5D, 0xA5, 0x07, 0xD0,
779 0x93, 0x8D, 0xD8, 0x9C, 0x04, 0x1C, 0xD4, 0x62, 0x8E, 0xA6,
780 0x26, 0x81, 0x01, 0xFF, 0xCE, 0x8A, 0x2A, 0x63, 0x34, 0x35,
781 0x40, 0xAA, 0x6D, 0x80, 0xDE, 0x89, 0x23, 0x6A, 0x57, 0x4D,
782 0x9E, 0x6E, 0xAD, 0x93, 0x4E, 0x56, 0x90, 0x0B, 0x6D, 0x9D,
783 0x73, 0x8B, 0x0C, 0xAE, 0x27, 0x3D, 0xDE, 0x4E, 0xF0, 0xAA,
784 0xC5, 0x6C, 0x78, 0x67, 0x6C, 0x94, 0x52, 0x9C, 0x37, 0x67,
785 0x6C, 0x2D, 0xEF, 0xBB, 0xAF, 0xDF, 0xA6, 0x90, 0x3C, 0xC4,
786 0x47, 0xCF, 0x8D, 0x96, 0x9E, 0x98, 0xA9, 0xB4, 0x9F, 0xC5,
787 0xA6, 0x50, 0xDC, 0xB3, 0xF0, 0xFB, 0x74, 0x17, 0x02, 0x81,
788 0x80, 0x5E, 0x83, 0x09, 0x62, 0xBD, 0xBA, 0x7C, 0xA2, 0xBF,
789 0x42, 0x74, 0xF5, 0x7C, 0x1C, 0xD2, 0x69, 0xC9, 0x04, 0x0D,
790 0x85, 0x7E, 0x3E, 0x3D, 0x24, 0x12, 0xC3, 0x18, 0x7B, 0xF3,
791 0x29, 0xF3, 0x5F, 0x0E, 0x76, 0x6C, 0x59, 0x75, 0xE4, 0x41,
792 0x84, 0x69, 0x9D, 0x32, 0xF3, 0xCD, 0x22, 0xAB, 0xB0, 0x35,
793 0xBA, 0x4A, 0xB2, 0x3C, 0xE5, 0xD9, 0x58, 0xB6, 0x62, 0x4F,
794 0x5D, 0xDE, 0xE5, 0x9E, 0x0A, 0xCA, 0x53, 0xB2, 0x2C, 0xF7,
795 0x9E, 0xB3, 0x6B, 0x0A, 0x5B, 0x79, 0x65, 0xEC, 0x6E, 0x91,
796 0x4E, 0x92, 0x20, 0xF6, 0xFC, 0xFC, 0x16, 0xED, 0xD3, 0x76,
797 0x0C, 0xE2, 0xEC, 0x7F, 0xB2, 0x69, 0x13, 0x6B, 0x78, 0x0E,
798 0x5A, 0x46, 0x64, 0xB4, 0x5E, 0xB7, 0x25, 0xA0, 0x5A, 0x75,
799 0x3A, 0x4B, 0xEF, 0xC7, 0x3C, 0x3E, 0xF7, 0xFD, 0x26, 0xB8,
800 0x20, 0xC4, 0x99, 0x0A, 0x9A, 0x73, 0xBE, 0xC3, 0x19, 0x02,
801 0x81, 0x81, 0x00, 0xBA, 0x44, 0x93, 0x14, 0xAC, 0x34, 0x19,
802 0x3B, 0x5F, 0x91, 0x60, 0xAC, 0xF7, 0xB4, 0xD6, 0x81, 0x05,
803 0x36, 0x51, 0x53, 0x3D, 0xE8, 0x65, 0xDC, 0xAF, 0x2E, 0xDC,
804 0x61, 0x3E, 0xC9, 0x7D, 0xB8, 0x7F, 0x87, 0xF0, 0x3B, 0x9B,
805 0x03, 0x82, 0x29, 0x37, 0xCE, 0x72, 0x4E, 0x11, 0xD5, 0xB1,
806 0xC1, 0x0C, 0x07, 0xA0, 0x99, 0x91, 0x4A, 0x8D, 0x7F, 0xEC,
807 0x79, 0xCF, 0xF1, 0x39, 0xB5, 0xE9, 0x85, 0xEC, 0x62, 0xF7,
808 0xDA, 0x7D, 0xBC, 0x64, 0x4D, 0x22, 0x3C, 0x0E, 0xF2, 0xD6,
809 0x51, 0xF5, 0x87, 0xD8, 0x99, 0xC0, 0x11, 0x20, 0x5D, 0x0F,

NetBurner, Inc.
22.205 certs_test.h 1103

810 0x29, 0xFD, 0x5B, 0xE2, 0xAE, 0xD9, 0x1C, 0xD9, 0x21, 0x56,
811 0x6D, 0xFC, 0x84, 0xD0, 0x5F, 0xED, 0x10, 0x15, 0x1C, 0x18,
812 0x21, 0xE7, 0xC4, 0x3D, 0x4B, 0xD7, 0xD0, 0x9E, 0x6A, 0x95,
813 0xCF, 0x22, 0xC9, 0x03, 0x7B, 0x9E, 0xE3, 0x60, 0x01, 0xFC,
814 0x2F, 0x02, 0x81, 0x80, 0x11, 0xD0, 0x4B, 0xCF, 0x1B, 0x67,
815 0xB9, 0x9F, 0x10, 0x75, 0x47, 0x86, 0x65, 0xAE, 0x31, 0xC2,
816 0xC6, 0x30, 0xAC, 0x59, 0x06, 0x50, 0xD9, 0x0F, 0xB5, 0x70,
817 0x06, 0xF7, 0xF0, 0xD3, 0xC8, 0x62, 0x7C, 0xA8, 0xDA, 0x6E,
818 0xF6, 0x21, 0x3F, 0xD3, 0x7F, 0x5F, 0xEA, 0x8A, 0xAB, 0x3F,
819 0xD9, 0x2A, 0x5E, 0xF3, 0x51, 0xD2, 0xC2, 0x30, 0x37, 0xE3,
820 0x2D, 0xA3, 0x75, 0x0D, 0x1E, 0x4D, 0x21, 0x34, 0xD5, 0x57,
821 0x70, 0x5C, 0x89, 0xBF, 0x72, 0xEC, 0x4A, 0x6E, 0x68, 0xD5,
822 0xCD, 0x18, 0x74, 0x33, 0x4E, 0x8C, 0x3A, 0x45, 0x8F, 0xE6,
823 0x96, 0x40, 0xEB, 0x63, 0xF9, 0x19, 0x86, 0x3A, 0x51, 0xDD,
824 0x89, 0x4B, 0xB0, 0xF3, 0xF9, 0x9F, 0x5D, 0x28, 0x95, 0x38,
825 0xBE, 0x35, 0xAB, 0xCA, 0x5C, 0xE7, 0x93, 0x53, 0x34, 0xA1,
826 0x45, 0x5D, 0x13, 0x39, 0x65, 0x42, 0x46, 0xA1, 0x9F, 0xCD,
827 0xF5, 0xBF
828 };
829 static const int sizeof_client_key_der_2048 = sizeof(client_key_der_2048);
830
831 /* ./certs/client-keyPub.der, 2048-bit */
832 static const unsigned char client_keypub_der_2048[] =
833 {
834 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86,
835 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
836 0x82, 0x01, 0x0F, 0x00, 0x30, 0x82, 0x01, 0x0A, 0x02, 0x82,
837 0x01, 0x01, 0x00, 0xC3, 0x03, 0xD1, 0x2B, 0xFE, 0x39, 0xA4,
838 0x32, 0x45, 0x3B, 0x53, 0xC8, 0x84, 0x2B, 0x2A, 0x7C, 0x74,
839 0x9A, 0xBD, 0xAA, 0x2A, 0x52, 0x07, 0x47, 0xD6, 0xA6, 0x36,
840 0xB2, 0x07, 0x32, 0x8E, 0xD0, 0xBA, 0x69, 0x7B, 0xC6, 0xC3,
841 0x44, 0x9E, 0xD4, 0x81, 0x48, 0xFD, 0x2D, 0x68, 0xA2, 0x8B,
842 0x67, 0xBB, 0xA1, 0x75, 0xC8, 0x36, 0x2C, 0x4A, 0xD2, 0x1B,
843 0xF7, 0x8B, 0xBA, 0xCF, 0x0D, 0xF9, 0xEF, 0xEC, 0xF1, 0x81,
844 0x1E, 0x7B, 0x9B, 0x03, 0x47, 0x9A, 0xBF, 0x65, 0xCC, 0x7F,
845 0x65, 0x24, 0x69, 0xA6, 0xE8, 0x14, 0x89, 0x5B, 0xE4, 0x34,
846 0xF7, 0xC5, 0xB0, 0x14, 0x93, 0xF5, 0x67, 0x7B, 0x3A, 0x7A,
847 0x78, 0xE1, 0x01, 0x56, 0x56, 0x91, 0xA6, 0x13, 0x42, 0x8D,
848 0xD2, 0x3C, 0x40, 0x9C, 0x4C, 0xEF, 0xD1, 0x86, 0xDF, 0x37,
849 0x51, 0x1B, 0x0C, 0xA1, 0x3B, 0xF5, 0xF1, 0xA3, 0x4A, 0x35,
850 0xE4, 0xE1, 0xCE, 0x96, 0xDF, 0x1B, 0x7E, 0xBF, 0x4E, 0x97,
851 0xD0, 0x10, 0xE8, 0xA8, 0x08, 0x30, 0x81, 0xAF, 0x20, 0x0B,
852 0x43, 0x14, 0xC5, 0x74, 0x67, 0xB4, 0x32, 0x82, 0x6F, 0x8D,
853 0x86, 0xC2, 0x88, 0x40, 0x99, 0x36, 0x83, 0xBA, 0x1E, 0x40,
854 0x72, 0x22, 0x17, 0xD7, 0x52, 0x65, 0x24, 0x73, 0xB0, 0xCE,
855 0xEF, 0x19, 0xCD, 0xAE, 0xFF, 0x78, 0x6C, 0x7B, 0xC0, 0x12,
856 0x03, 0xD4, 0x4E, 0x72, 0x0D, 0x50, 0x6D, 0x3B, 0xA3, 0x3B,
857 0xA3, 0x99, 0x5E, 0x9D, 0xC8, 0xD9, 0x0C, 0x85, 0xB3, 0xD9,
858 0x8A, 0xD9, 0x54, 0x26, 0xDB, 0x6D, 0xFA, 0xAC, 0xBB, 0xFF,
859 0x25, 0x4C, 0xC4, 0xD1, 0x79, 0xF4, 0x71, 0xD3, 0x86, 0x40,
860 0x18, 0x13, 0xB0, 0x63, 0xB5, 0x72, 0x4E, 0x30, 0xC4, 0x97,
861 0x84, 0x86, 0x2D, 0x56, 0x2F, 0xD7, 0x15, 0xF7, 0x7F, 0xC0,
862 0xAE, 0xF5, 0xFC, 0x5B, 0xE5, 0xFB, 0xA1, 0xBA, 0xD3, 0x02,
863 0x03, 0x01, 0x00, 0x01
864 };
865 static const int sizeof_client_keypub_der_2048 = sizeof(client_keypub_der_2048);
866
867 /* ./certs/client-cert.der, 2048-bit */
868 static const unsigned char client_cert_der_2048[] =
869 {
870 0x30, 0x82, 0x05, 0x1D, 0x30, 0x82, 0x04, 0x05, 0xA0, 0x03,
871 0x02, 0x01, 0x02, 0x02, 0x14, 0x01, 0x1A, 0xEB, 0x56, 0xAB,
872 0xDC, 0x8B, 0xF3, 0xA6, 0x1E, 0xF4, 0x93, 0x60, 0x89, 0xB7,
873 0x05, 0x07, 0x29, 0x01, 0x2C, 0x30, 0x0D, 0x06, 0x09, 0x2A,
874 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
875 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55,
876 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E,
877 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E,
878 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
879 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D,
880 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
881 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C,
882 0x5F, 0x32, 0x30, 0x34, 0x38, 0x31, 0x19, 0x30, 0x17, 0x06,
883 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50, 0x72, 0x6F, 0x67,
884 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67, 0x2D, 0x32, 0x30,
885 0x34, 0x38, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
886 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
887 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
888 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
889 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
890 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
891 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
892 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
893 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
894 0x32, 0x34, 0x5A, 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09,
895 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
896 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,

NetBurner, Inc.
1104 File Documentation

897 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
898 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
899 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06,
900 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66,
901 0x53, 0x53, 0x4C, 0x5F, 0x32, 0x30, 0x34, 0x38, 0x31, 0x19,
902 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50,
903 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67,
904 0x2D, 0x32, 0x30, 0x34, 0x38, 0x31, 0x18, 0x30, 0x16, 0x06,
905 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
906 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
907 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
908 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
909 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
910 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D,
911 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01,
912 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30, 0x82,
913 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xC3, 0x03, 0xD1,
914 0x2B, 0xFE, 0x39, 0xA4, 0x32, 0x45, 0x3B, 0x53, 0xC8, 0x84,
915 0x2B, 0x2A, 0x7C, 0x74, 0x9A, 0xBD, 0xAA, 0x2A, 0x52, 0x07,
916 0x47, 0xD6, 0xA6, 0x36, 0xB2, 0x07, 0x32, 0x8E, 0xD0, 0xBA,
917 0x69, 0x7B, 0xC6, 0xC3, 0x44, 0x9E, 0xD4, 0x81, 0x48, 0xFD,
918 0x2D, 0x68, 0xA2, 0x8B, 0x67, 0xBB, 0xA1, 0x75, 0xC8, 0x36,
919 0x2C, 0x4A, 0xD2, 0x1B, 0xF7, 0x8B, 0xBA, 0xCF, 0x0D, 0xF9,
920 0xEF, 0xEC, 0xF1, 0x81, 0x1E, 0x7B, 0x9B, 0x03, 0x47, 0x9A,
921 0xBF, 0x65, 0xCC, 0x7F, 0x65, 0x24, 0x69, 0xA6, 0xE8, 0x14,
922 0x89, 0x5B, 0xE4, 0x34, 0xF7, 0xC5, 0xB0, 0x14, 0x93, 0xF5,
923 0x67, 0x7B, 0x3A, 0x7A, 0x78, 0xE1, 0x01, 0x56, 0x56, 0x91,
924 0xA6, 0x13, 0x42, 0x8D, 0xD2, 0x3C, 0x40, 0x9C, 0x4C, 0xEF,
925 0xD1, 0x86, 0xDF, 0x37, 0x51, 0x1B, 0x0C, 0xA1, 0x3B, 0xF5,
926 0xF1, 0xA3, 0x4A, 0x35, 0xE4, 0xE1, 0xCE, 0x96, 0xDF, 0x1B,
927 0x7E, 0xBF, 0x4E, 0x97, 0xD0, 0x10, 0xE8, 0xA8, 0x08, 0x30,
928 0x81, 0xAF, 0x20, 0x0B, 0x43, 0x14, 0xC5, 0x74, 0x67, 0xB4,
929 0x32, 0x82, 0x6F, 0x8D, 0x86, 0xC2, 0x88, 0x40, 0x99, 0x36,
930 0x83, 0xBA, 0x1E, 0x40, 0x72, 0x22, 0x17, 0xD7, 0x52, 0x65,
931 0x24, 0x73, 0xB0, 0xCE, 0xEF, 0x19, 0xCD, 0xAE, 0xFF, 0x78,
932 0x6C, 0x7B, 0xC0, 0x12, 0x03, 0xD4, 0x4E, 0x72, 0x0D, 0x50,
933 0x6D, 0x3B, 0xA3, 0x3B, 0xA3, 0x99, 0x5E, 0x9D, 0xC8, 0xD9,
934 0x0C, 0x85, 0xB3, 0xD9, 0x8A, 0xD9, 0x54, 0x26, 0xDB, 0x6D,
935 0xFA, 0xAC, 0xBB, 0xFF, 0x25, 0x4C, 0xC4, 0xD1, 0x79, 0xF4,
936 0x71, 0xD3, 0x86, 0x40, 0x18, 0x13, 0xB0, 0x63, 0xB5, 0x72,
937 0x4E, 0x30, 0xC4, 0x97, 0x84, 0x86, 0x2D, 0x56, 0x2F, 0xD7,
938 0x15, 0xF7, 0x7F, 0xC0, 0xAE, 0xF5, 0xFC, 0x5B, 0xE5, 0xFB,
939 0xA1, 0xBA, 0xD3, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82,
940 0x01, 0x4F, 0x30, 0x82, 0x01, 0x4B, 0x30, 0x1D, 0x06, 0x03,
941 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0x33, 0xD8, 0x45,
942 0x66, 0xD7, 0x68, 0x87, 0x18, 0x7E, 0x54, 0x0D, 0x70, 0x27,
943 0x91, 0xC7, 0x26, 0xD7, 0x85, 0x65, 0xC0, 0x30, 0x81, 0xDE,
944 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x81, 0xD6, 0x30, 0x81,
945 0xD3, 0x80, 0x14, 0x33, 0xD8, 0x45, 0x66, 0xD7, 0x68, 0x87,
946 0x18, 0x7E, 0x54, 0x0D, 0x70, 0x27, 0x91, 0xC7, 0x26, 0xD7,
947 0x85, 0x65, 0xC0, 0xA1, 0x81, 0xA4, 0xA4, 0x81, 0xA1, 0x30,
948 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
949 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06,
950 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74,
951 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
952 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61,
953 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0A,
954 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x5F,
955 0x32, 0x30, 0x34, 0x38, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03,
956 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50, 0x72, 0x6F, 0x67, 0x72,
957 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67, 0x2D, 0x32, 0x30, 0x34,
958 0x38, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03,
959 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66,
960 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30,
961 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
962 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
963 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
964 0x82, 0x14, 0x01, 0x1A, 0xEB, 0x56, 0xAB, 0xDC, 0x8B, 0xF3,
965 0xA6, 0x1E, 0xF4, 0x93, 0x60, 0x89, 0xB7, 0x05, 0x07, 0x29,
966 0x01, 0x2C, 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04,
967 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03,
968 0x55, 0x1D, 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65,
969 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D,
970 0x87, 0x04, 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03,
971 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B,
972 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B,
973 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06,
974 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B,
975 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x64, 0x6D, 0xA6,
976 0x4A, 0xA8, 0x9F, 0xA7, 0xE9, 0x75, 0x2C, 0xF3, 0x85, 0x3D,
977 0x3E, 0xAF, 0x38, 0xFB, 0x6C, 0xC7, 0xEB, 0xC7, 0xD0, 0x2B,
978 0xA2, 0x45, 0xB5, 0x65, 0xBE, 0xD0, 0x13, 0x2C, 0xF7, 0xA3,
979 0xC1, 0xEB, 0x3C, 0xB1, 0xF8, 0xB8, 0x3D, 0x63, 0x8F, 0xCA,
980 0x08, 0x4E, 0x65, 0x1D, 0x2C, 0xCE, 0x34, 0x6E, 0x35, 0x96,
981 0x87, 0x93, 0x30, 0x5D, 0xAA, 0xC8, 0xE9, 0xA0, 0x9C, 0x9B,
982 0x84, 0x78, 0x3A, 0x52, 0xA1, 0x33, 0x48, 0x6E, 0x84, 0x66,
983 0x71, 0x9C, 0xCF, 0xD1, 0xC7, 0x7B, 0x02, 0x4C, 0xE1, 0x49,

NetBurner, Inc.
22.205 certs_test.h 1105

984 0x7C, 0x69, 0x47, 0xFC, 0xB7, 0x01, 0xF9, 0xA0, 0x39, 0x3B,
985 0xAB, 0xB9, 0xC6, 0xD9, 0xCA, 0x27, 0x85, 0xF0, 0x5C, 0xB6,
986 0xA4, 0xE6, 0xDC, 0xF2, 0x52, 0xFE, 0x44, 0x00, 0xB6, 0xF0,
987 0x47, 0xF2, 0x6F, 0x3F, 0xD5, 0x0F, 0xFF, 0x31, 0x93, 0x53,
988 0x88, 0x8C, 0xC7, 0xFB, 0x56, 0x10, 0x4B, 0x3B, 0x43, 0xE6,
989 0x8A, 0x9C, 0xB7, 0xB4, 0x9A, 0xDD, 0x5C, 0xE3, 0xCD, 0x9C,
990 0xBD, 0xA7, 0x0C, 0xC1, 0xD9, 0x96, 0xF0, 0x93, 0xF3, 0xAB,
991 0xBD, 0xD2, 0x1E, 0x77, 0x8A, 0x42, 0xCD, 0x0F, 0xFE, 0x48,
992 0xDA, 0x57, 0x34, 0x61, 0x46, 0xA3, 0x89, 0x2E, 0x31, 0xD2,
993 0x4A, 0xD4, 0x43, 0x2F, 0x56, 0x85, 0x44, 0x75, 0xCA, 0x6B,
994 0x36, 0xE2, 0xE8, 0x3A, 0xB2, 0x95, 0x95, 0x3A, 0x28, 0x90,
995 0x8D, 0xC0, 0x23, 0xFB, 0x3C, 0xD2, 0x1A, 0x73, 0x6B, 0xEF,
996 0xFD, 0xD6, 0x1B, 0xEB, 0x6D, 0x67, 0x2A, 0xE1, 0xEB, 0x2A,
997 0x83, 0x22, 0xAD, 0xE3, 0x95, 0x19, 0xE5, 0x93, 0xEE, 0x14,
998 0xDC, 0xB5, 0x7D, 0xE7, 0xCF, 0x89, 0x8C, 0xD7, 0x8F, 0xD2,
999 0x3F, 0x68, 0x7E, 0xA9, 0x74, 0x7C, 0x1B, 0x38, 0x65, 0xF9,
1000 0x28, 0x4D, 0xFF, 0x50, 0xC8, 0xEE, 0x51, 0x3A, 0x8F, 0x1D,
1001 0x9E, 0x55, 0x5E
1002 };
1003 static const int sizeof_client_cert_der_2048 = sizeof(client_cert_der_2048);
1004
1005 /* ./certs/dh2048.der, 2048-bit */
1006 static const unsigned char dh_key_der_2048[] =
1007 {
1008 0x30, 0x82, 0x01, 0x08, 0x02, 0x82, 0x01, 0x01, 0x00, 0xB0,
1009 0xA1, 0x08, 0x06, 0x9C, 0x08, 0x13, 0xBA, 0x59, 0x06, 0x3C,
1010 0xBC, 0x30, 0xD5, 0xF5, 0x00, 0xC1, 0x4F, 0x44, 0xA7, 0xD6,
1011 0xEF, 0x4A, 0xC6, 0x25, 0x27, 0x1C, 0xE8, 0xD2, 0x96, 0x53,
1012 0x0A, 0x5C, 0x91, 0xDD, 0xA2, 0xC2, 0x94, 0x84, 0xBF, 0x7D,
1013 0xB2, 0x44, 0x9F, 0x9B, 0xD2, 0xC1, 0x8A, 0xC5, 0xBE, 0x72,
1014 0x5C, 0xA7, 0xE7, 0x91, 0xE6, 0xD4, 0x9F, 0x73, 0x07, 0x85,
1015 0x5B, 0x66, 0x48, 0xC7, 0x70, 0xFA, 0xB4, 0xEE, 0x02, 0xC9,
1016 0x3D, 0x9A, 0x4A, 0xDA, 0x3D, 0xC1, 0x46, 0x3E, 0x19, 0x69,
1017 0xD1, 0x17, 0x46, 0x07, 0xA3, 0x4D, 0x9F, 0x2B, 0x96, 0x17,
1018 0x39, 0x6D, 0x30, 0x8D, 0x2A, 0xF3, 0x94, 0xD3, 0x75, 0xCF,
1019 0xA0, 0x75, 0xE6, 0xF2, 0x92, 0x1F, 0x1A, 0x70, 0x05, 0xAA,
1020 0x04, 0x83, 0x57, 0x30, 0xFB, 0xDA, 0x76, 0x93, 0x38, 0x50,
1021 0xE8, 0x27, 0xFD, 0x63, 0xEE, 0x3C, 0xE5, 0xB7, 0xC8, 0x09,
1022 0xAE, 0x6F, 0x50, 0x35, 0x8E, 0x84, 0xCE, 0x4A, 0x00, 0xE9,
1023 0x12, 0x7E, 0x5A, 0x31, 0xD7, 0x33, 0xFC, 0x21, 0x13, 0x76,
1024 0xCC, 0x16, 0x30, 0xDB, 0x0C, 0xFC, 0xC5, 0x62, 0xA7, 0x35,
1025 0xB8, 0xEF, 0xB7, 0xB0, 0xAC, 0xC0, 0x36, 0xF6, 0xD9, 0xC9,
1026 0x46, 0x48, 0xF9, 0x40, 0x90, 0x00, 0x2B, 0x1B, 0xAA, 0x6C,
1027 0xE3, 0x1A, 0xC3, 0x0B, 0x03, 0x9E, 0x1B, 0xC2, 0x46, 0xE4,
1028 0x48, 0x4E, 0x22, 0x73, 0x6F, 0xC3, 0x5F, 0xD4, 0x9A, 0xD6,
1029 0x30, 0x07, 0x48, 0xD6, 0x8C, 0x90, 0xAB, 0xD4, 0xF6, 0xF1,
1030 0xE3, 0x48, 0xD3, 0x58, 0x4B, 0xA6, 0xB9, 0xCD, 0x29, 0xBF,
1031 0x68, 0x1F, 0x08, 0x4B, 0x63, 0x86, 0x2F, 0x5C, 0x6B, 0xD6,
1032 0xB6, 0x06, 0x65, 0xF7, 0xA6, 0xDC, 0x00, 0x67, 0x6B, 0xBB,
1033 0xC3, 0xA9, 0x41, 0x83, 0xFB, 0xC7, 0xFA, 0xC8, 0xE2, 0x1E,
1034 0x7E, 0xAF, 0x00, 0x3F, 0x93, 0x02, 0x01, 0x02
1035 };
1036 static const int sizeof_dh_key_der_2048 = sizeof(dh_key_der_2048);
1037
1038 /* ./certs/dh-pubkey-2048.der, 2048-bit */
1039 static const unsigned char dh_pub_key_der_2048[] =
1040 {
1041 0x30, 0x82, 0x02, 0x24, 0x30, 0x82, 0x01, 0x17, 0x06, 0x09,
1042 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x03, 0x01, 0x30,
1043 0x82, 0x01, 0x08, 0x02, 0x82, 0x01, 0x01, 0x00, 0xD3, 0xB2,
1044 0x99, 0x84, 0x5C, 0x0A, 0x4C, 0xE7, 0x37, 0xCC, 0xFC, 0x18,
1045 0x37, 0x01, 0x2F, 0x5D, 0xC1, 0x4C, 0xF4, 0x5C, 0xC9, 0x82,
1046 0x8D, 0xB7, 0xF3, 0xD4, 0xA9, 0x8A, 0x9D, 0x34, 0xD7, 0x76,
1047 0x57, 0xE5, 0xE5, 0xC3, 0xE5, 0x16, 0x85, 0xCA, 0x4D, 0xD6,
1048 0x5B, 0xC1, 0xF8, 0xCF, 0x89, 0x26, 0xD0, 0x38, 0x8A, 0xEE,
1049 0xF3, 0xCD, 0x33, 0xE5, 0x56, 0xBB, 0x90, 0x83, 0x9F, 0x97,
1050 0x8E, 0x71, 0xFB, 0x27, 0xE4, 0x35, 0x15, 0x45, 0x86, 0x09,
1051 0x71, 0xA8, 0x9A, 0xB9, 0x3E, 0x0F, 0x51, 0x8A, 0xC2, 0x75,
1052 0x51, 0x23, 0x12, 0xFB, 0x94, 0x31, 0x44, 0xBF, 0xCE, 0xF6,
1053 0xED, 0xA6, 0x3A, 0xB7, 0x92, 0xCE, 0x16, 0xA9, 0x14, 0xB3,
1054 0x88, 0xB7, 0x13, 0x81, 0x71, 0x83, 0x88, 0xCD, 0xB1, 0xA2,
1055 0x37, 0xE1, 0x59, 0x5C, 0xD0, 0xDC, 0xCA, 0x82, 0x87, 0xFA,
1056 0x43, 0x44, 0xDD, 0x78, 0x3F, 0xCA, 0x27, 0x7E, 0xE1, 0x6B,
1057 0x93, 0x19, 0x7C, 0xD9, 0xA6, 0x96, 0x47, 0x0D, 0x12, 0xC1,
1058 0x13, 0xD7, 0xB9, 0x0A, 0x40, 0xD9, 0x1F, 0xFF, 0xB8, 0xB4,
1059 0x00, 0xC8, 0xAA, 0x5E, 0xD2, 0x66, 0x4A, 0x05, 0x8E, 0x9E,
1060 0xF5, 0x34, 0xE7, 0xD7, 0x09, 0x7B, 0x15, 0x49, 0x1D, 0x76,
1061 0x31, 0xD6, 0x71, 0xEC, 0x13, 0x4E, 0x89, 0x8C, 0x09, 0x22,
1062 0xD8, 0xE7, 0xA3, 0xE9, 0x7D, 0x21, 0x51, 0x26, 0x6E, 0x9F,
1063 0x30, 0x8A, 0xBB, 0xBC, 0x74, 0xC1, 0xC3, 0x27, 0x6A, 0xCE,
1064 0xA3, 0x12, 0x60, 0x68, 0x01, 0xD2, 0x34, 0x07, 0x80, 0xCC,
1065 0x2D, 0x7F, 0x5C, 0xAE, 0xA2, 0x97, 0x40, 0xC8, 0x3C, 0xAC,
1066 0xDB, 0x6F, 0xFE, 0x6C, 0x6D, 0xD2, 0x06, 0x1C, 0x43, 0xA2,
1067 0xB2, 0x2B, 0x82, 0xB7, 0xD0, 0xAB, 0x3F, 0x2C, 0xE7, 0x9C,
1068 0x19, 0x16, 0xD1, 0x5E, 0x26, 0x86, 0xC7, 0x92, 0xF9, 0x16,
1069 0x0B, 0xFA, 0x66, 0x83, 0x02, 0x01, 0x02, 0x03, 0x82, 0x01,
1070 0x05, 0x00, 0x02, 0x82, 0x01, 0x00, 0x34, 0x41, 0xBF, 0xE9,

NetBurner, Inc.
1106 File Documentation

1071 0xF2, 0x11, 0xBF, 0x05, 0xDB, 0xB2, 0x72, 0xA8, 0x29, 0xCC,
1072 0xBD, 0x93, 0xEB, 0x14, 0x5D, 0x2C, 0x6B, 0x84, 0x4E, 0x96,
1073 0x12, 0xB3, 0x38, 0xBA, 0x8A, 0x46, 0x7C, 0x36, 0xCB, 0xE9,
1074 0x97, 0x70, 0xC5, 0xC3, 0x85, 0xB5, 0x51, 0xA5, 0x8B, 0x39,
1075 0xA8, 0xEA, 0x47, 0xD3, 0xD5, 0x11, 0xC0, 0x6D, 0xE3, 0xE3,
1076 0x9E, 0x00, 0x4C, 0x65, 0x41, 0x9B, 0xF6, 0xD0, 0xAC, 0x26,
1077 0x88, 0x01, 0xFC, 0x3C, 0x26, 0x5F, 0x67, 0xF7, 0x77, 0xD7,
1078 0xAC, 0xC5, 0xCA, 0xBB, 0xD8, 0x70, 0x58, 0x41, 0xF5, 0xF1,
1079 0x21, 0x3B, 0x15, 0xD5, 0x31, 0xF2, 0xC4, 0x8E, 0x0C, 0x38,
1080 0x01, 0x93, 0xD3, 0x64, 0x63, 0x57, 0xDC, 0x31, 0xE5, 0xFD,
1081 0x9C, 0x2B, 0xA6, 0xDE, 0x15, 0xB2, 0xC8, 0x8D, 0x65, 0x71,
1082 0x2E, 0xED, 0xF9, 0x1D, 0x2D, 0xA1, 0x17, 0xDD, 0xA3, 0xDA,
1083 0xF3, 0x10, 0x81, 0x40, 0xFA, 0x4F, 0x49, 0xB0, 0xDA, 0x16,
1084 0x64, 0xBE, 0x6F, 0xC5, 0x05, 0xCE, 0xC4, 0x4F, 0x67, 0x80,
1085 0xB3, 0x8A, 0x81, 0x17, 0xEB, 0xF9, 0x6F, 0x6D, 0x9F, 0x7F,
1086 0xDE, 0xEE, 0x08, 0xB8, 0xFA, 0x81, 0x68, 0x66, 0xD6, 0xC6,
1087 0x08, 0x50, 0xAB, 0xF0, 0x29, 0xDE, 0x6B, 0x1D, 0x50, 0x13,
1088 0x7F, 0x54, 0x31, 0x53, 0x89, 0x5F, 0x48, 0x72, 0x24, 0xD4,
1089 0xD2, 0x1D, 0x27, 0x7D, 0x74, 0xCF, 0x51, 0x17, 0xF0, 0xC5,
1090 0x6D, 0x3C, 0x3D, 0x6D, 0x0A, 0x8B, 0xDB, 0xEF, 0x02, 0xD8,
1091 0xC3, 0xCB, 0xCA, 0x21, 0xCA, 0xD6, 0x9C, 0x18, 0x9E, 0x92,
1092 0xBE, 0x6E, 0xE2, 0x16, 0x5E, 0x89, 0x9B, 0xAD, 0xD4, 0x04,
1093 0x5A, 0x24, 0x5A, 0x3F, 0x7C, 0x12, 0xAC, 0xB4, 0x71, 0x51,
1094 0x25, 0x58, 0x74, 0xE4, 0xB2, 0xD4, 0x45, 0xFC, 0x5F, 0xCD,
1095 0x81, 0x8F, 0xE7, 0x96, 0x18, 0xD9, 0xE0, 0x97, 0x08, 0x45,
1096 0x36, 0xC3
1097 };
1098 static const int sizeof_dh_pub_key_der_2048 = sizeof(dh_pub_key_der_2048);
1099
1100 /* ./certs/dsa-pubkey-2048.der, 2048-bit */
1101 static const unsigned char dsa_pub_key_der_2048[] =
1102 {
1103 0x30, 0x82, 0x03, 0x47, 0x30, 0x82, 0x02, 0x39, 0x06, 0x07,
1104 0x2A, 0x86, 0x48, 0xCE, 0x38, 0x04, 0x01, 0x30, 0x82, 0x02,
1105 0x2C, 0x02, 0x82, 0x01, 0x01, 0x00, 0xEB, 0x7E, 0x2C, 0x97,
1106 0x36, 0x67, 0x0E, 0x73, 0x9A, 0xAC, 0xFD, 0xB1, 0x19, 0x03,
1107 0x52, 0x61, 0x25, 0x12, 0xB2, 0x37, 0x3D, 0xEA, 0xCA, 0x80,
1108 0x07, 0x5D, 0x2D, 0x33, 0xA2, 0x4E, 0x6B, 0xB7, 0x62, 0xF8,
1109 0x87, 0x4D, 0x4B, 0x20, 0xDA, 0xEA, 0x6A, 0x96, 0x13, 0xB7,
1110 0xB9, 0x49, 0xC0, 0x86, 0x14, 0x71, 0xCD, 0x8C, 0x60, 0x61,
1111 0x94, 0x71, 0x89, 0x95, 0x1A, 0x0F, 0x38, 0xCC, 0x9C, 0x1F,
1112 0x20, 0xE5, 0xD0, 0x65, 0x75, 0xCD, 0xFE, 0x24, 0x29, 0xE6,
1113 0x60, 0x97, 0x74, 0xEC, 0x4C, 0x42, 0xE8, 0xBA, 0xE9, 0xC2,
1114 0xF7, 0xCB, 0x9B, 0xEA, 0x55, 0xD8, 0x40, 0x50, 0x2E, 0xCF,
1115 0xCD, 0x41, 0x01, 0xA9, 0xE5, 0x29, 0xCA, 0xC3, 0x36, 0x58,
1116 0x7E, 0x2E, 0x11, 0x96, 0x87, 0xC6, 0xFA, 0xE1, 0x27, 0x53,
1117 0x3D, 0x60, 0x93, 0x7B, 0xAD, 0xEE, 0xE7, 0xD4, 0xDC, 0xD6,
1118 0x03, 0x16, 0x92, 0xD4, 0x51, 0x0C, 0xFD, 0xA9, 0x01, 0x3E,
1119 0x6E, 0x27, 0x67, 0x6E, 0x9F, 0x29, 0x63, 0xFD, 0x51, 0x82,
1120 0x79, 0x83, 0x2B, 0xCB, 0x12, 0xCD, 0x50, 0x92, 0xAC, 0x16,
1121 0xC9, 0xEA, 0x9E, 0x68, 0x9E, 0x4B, 0xE1, 0x63, 0xB4, 0x80,
1122 0xE4, 0xDF, 0x75, 0xBC, 0x27, 0xD1, 0x76, 0x03, 0x48, 0x98,
1123 0x1D, 0xE3, 0x29, 0x8A, 0x99, 0x59, 0xF3, 0x75, 0x5B, 0xD9,
1124 0xAC, 0x59, 0x11, 0x52, 0x2F, 0xE0, 0x91, 0x55, 0xB0, 0xF2,
1125 0x5F, 0x0A, 0xF8, 0xD2, 0x7A, 0xDD, 0x8D, 0xE9, 0x92, 0xE2,
1126 0xF3, 0xF7, 0x4A, 0xB1, 0x50, 0xD7, 0xFE, 0x07, 0x8D, 0x27,
1127 0x7D, 0x08, 0x6F, 0x08, 0x7E, 0x25, 0x19, 0x0D, 0xDE, 0x11,
1128 0xD1, 0x63, 0x31, 0x84, 0x18, 0x25, 0xBE, 0x7D, 0x64, 0x77,
1129 0xDB, 0x4A, 0x20, 0xC5, 0x51, 0x75, 0xD8, 0xB1, 0x1B, 0xDF,
1130 0x91, 0x7F, 0xFC, 0x74, 0xBA, 0x9D, 0xD1, 0xFA, 0x8D, 0xBD,
1131 0x59, 0xFD, 0x02, 0x21, 0x00, 0xFA, 0xF7, 0x62, 0x9A, 0x62,
1132 0x19, 0x64, 0x6D, 0xC1, 0xF3, 0xC0, 0x9B, 0xAC, 0x90, 0x28,
1133 0xEA, 0xA1, 0x83, 0xF9, 0xC8, 0xED, 0x31, 0xEE, 0x33, 0x1D,
1134 0x35, 0x22, 0x00, 0x2B, 0x12, 0x84, 0xFF, 0x02, 0x82, 0x01,
1135 0x00, 0x73, 0xC9, 0xED, 0x1F, 0xBC, 0xC7, 0xC4, 0xEF, 0x46,
1136 0x03, 0xD1, 0x72, 0xC3, 0xE5, 0x29, 0xB0, 0x9A, 0x95, 0x13,
1137 0x5B, 0x4E, 0x59, 0x57, 0x0F, 0x80, 0xEB, 0x74, 0x87, 0x11,
1138 0x1B, 0xC8, 0x11, 0xB6, 0x97, 0x4C, 0x48, 0x50, 0x3A, 0xB8,
1139 0x2C, 0x28, 0xF3, 0xB0, 0x9C, 0x7C, 0x3D, 0xFF, 0x8B, 0x43,
1140 0x43, 0x30, 0x85, 0x5F, 0x97, 0xD2, 0x68, 0x85, 0x35, 0x2E,
1141 0xD4, 0x61, 0xF6, 0x3E, 0x05, 0xEC, 0xCD, 0x60, 0x13, 0xE2,
1142 0x16, 0x02, 0x7C, 0x8B, 0x21, 0xCE, 0x36, 0x71, 0xC4, 0xED,
1143 0x0B, 0x47, 0x76, 0x83, 0x23, 0x2F, 0x98, 0xA4, 0x84, 0x98,
1144 0x9C, 0xFB, 0xD0, 0xA8, 0xD9, 0xB9, 0xE3, 0xD7, 0x32, 0xD9,
1145 0xB5, 0x9E, 0x82, 0x93, 0xD0, 0x55, 0x74, 0x5F, 0xDA, 0x87,
1146 0x91, 0x90, 0x0F, 0x85, 0x74, 0x1A, 0x32, 0x76, 0x4F, 0xCC,
1147 0x2A, 0x18, 0x11, 0x5B, 0xB4, 0x78, 0x93, 0xB6, 0xE5, 0xF0,
1148 0xC6, 0x71, 0xE8, 0xD7, 0x31, 0x19, 0x91, 0x27, 0x71, 0x5A,
1149 0x02, 0x1A, 0x1A, 0x3A, 0x55, 0x95, 0xFF, 0xF8, 0xED, 0xD3,
1150 0xE1, 0xAE, 0x8A, 0x1D, 0xFF, 0x53, 0x63, 0x79, 0x13, 0xA1,
1151 0xAD, 0x0A, 0x68, 0x67, 0x43, 0xB2, 0x5B, 0xD5, 0x36, 0xD4,
1152 0x84, 0xD0, 0xCD, 0x34, 0x82, 0x84, 0xA4, 0x89, 0xAE, 0xA1,
1153 0x66, 0x57, 0x89, 0x6F, 0xDC, 0x0C, 0x3B, 0x48, 0x14, 0x7C,
1154 0xCC, 0x63, 0x7C, 0x83, 0x93, 0x55, 0x7D, 0xB4, 0xF3, 0x34,
1155 0x66, 0x72, 0x85, 0xF5, 0x8D, 0xEF, 0x90, 0x1A, 0x66, 0xF8,
1156 0x3B, 0xC6, 0xA4, 0x59, 0xB8, 0x25, 0x4E, 0x5D, 0x84, 0xED,
1157 0x7C, 0x1C, 0xDD, 0x35, 0xA6, 0xBA, 0xED, 0x3B, 0xD6, 0x49,

NetBurner, Inc.
22.205 certs_test.h 1107

1158 0xE6, 0x5A, 0xD1, 0xF8, 0xEA, 0x96, 0x75, 0x92, 0xCF, 0x05,
1159 0x52, 0x05, 0x3D, 0x78, 0x09, 0xCF, 0xCD, 0xE2, 0x1A, 0x99,
1160 0xEB, 0x5E, 0xFA, 0x27, 0x73, 0x89, 0x15, 0x03, 0x82, 0x01,
1161 0x06, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00, 0xC2, 0x35, 0x2D,
1162 0xEC, 0x83, 0x83, 0x6C, 0x73, 0x13, 0x9E, 0x52, 0x7C, 0x74,
1163 0xC8, 0x7B, 0xEE, 0xDF, 0x39, 0xC0, 0x33, 0xCD, 0x9F, 0xB2,
1164 0x22, 0x64, 0x9F, 0xC5, 0xE9, 0xFF, 0xF7, 0x09, 0x47, 0x79,
1165 0x13, 0x96, 0x77, 0x25, 0xF3, 0x5D, 0xAA, 0x9F, 0x97, 0x67,
1166 0x62, 0xBC, 0x94, 0x1D, 0xAE, 0x22, 0x7E, 0x08, 0x03, 0xBD,
1167 0x7E, 0x34, 0x29, 0xCB, 0x62, 0xB7, 0x82, 0x1D, 0xE2, 0xFA,
1168 0x05, 0xC6, 0xC1, 0x68, 0xE7, 0x01, 0x27, 0x63, 0x51, 0x3E,
1169 0x37, 0x59, 0x42, 0x92, 0x4F, 0x99, 0x60, 0xFD, 0x63, 0x94,
1170 0xB7, 0xD0, 0xEE, 0xC1, 0xA0, 0xA5, 0x01, 0x74, 0x4D, 0x0E,
1171 0x14, 0xB2, 0xE2, 0x2C, 0xE7, 0x82, 0x0A, 0x23, 0xC7, 0x39,
1172 0x45, 0x40, 0xE9, 0xE9, 0x9D, 0x36, 0xE0, 0x52, 0x03, 0x99,
1173 0xDC, 0x87, 0x7D, 0x6A, 0x90, 0xE4, 0xDD, 0xA9, 0xC2, 0x57,
1174 0x90, 0xD6, 0xCA, 0xB4, 0x15, 0x80, 0xEE, 0x00, 0xCB, 0x2A,
1175 0xC9, 0x59, 0x4C, 0xA7, 0x7D, 0x33, 0x0A, 0x3E, 0x4A, 0x76,
1176 0xEA, 0x27, 0x89, 0xD8, 0x1A, 0xEA, 0x7E, 0xDB, 0x13, 0x92,
1177 0x93, 0x6A, 0x57, 0x9B, 0x33, 0xFD, 0xCE, 0x09, 0x0A, 0xB0,
1178 0x35, 0x24, 0xE4, 0x7D, 0xD8, 0x9D, 0xFF, 0x80, 0x65, 0x0F,
1179 0x61, 0xF7, 0xF7, 0xED, 0x8B, 0xD5, 0x8F, 0xBF, 0xB3, 0x22,
1180 0x20, 0x39, 0x89, 0x83, 0xB8, 0x83, 0x96, 0x32, 0x20, 0xAD,
1181 0xA1, 0x5D, 0x73, 0x8F, 0xE3, 0x27, 0xD9, 0x5D, 0xDB, 0x00,
1182 0x27, 0xF2, 0xBE, 0x89, 0x13, 0xE2, 0x97, 0x79, 0x10, 0x27,
1183 0x3D, 0xD8, 0x05, 0x96, 0x59, 0x6E, 0xA0, 0xC1, 0x6F, 0x99,
1184 0x4F, 0x28, 0xFA, 0xA6, 0x0B, 0x5C, 0x16, 0xEE, 0xB0, 0x98,
1185 0x8A, 0x06, 0x4A, 0xB0, 0x02, 0x2A, 0x6D, 0xCC, 0xE2, 0xC8,
1186 0x11, 0xF9, 0x1B, 0xF1, 0x3C, 0x68, 0xDF, 0xC2, 0xF4, 0x98,
1187 0x5F, 0x6C, 0xC8
1188 };
1189 static const int sizeof_dsa_pub_key_der_2048 = sizeof(dsa_pub_key_der_2048);
1190
1191 /* ./certs/dsa2048.der, 2048-bit */
1192 static const unsigned char dsa_key_der_2048[] =
1193 {
1194 0x30, 0x82, 0x03, 0x3F, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
1195 0x01, 0x00, 0xCC, 0x8E, 0xC9, 0xA0, 0xD5, 0x9A, 0x27, 0x1C,
1196 0xDA, 0x52, 0xDF, 0xC7, 0xC0, 0xE6, 0x06, 0xA4, 0x3E, 0x8A,
1197 0x66, 0x49, 0xD0, 0x59, 0x33, 0x51, 0x69, 0xC4, 0x9C, 0x5E,
1198 0x64, 0x85, 0xC7, 0xF1, 0xAB, 0xD5, 0xD9, 0x62, 0xAC, 0xFD,
1199 0xA1, 0xE0, 0x1B, 0x57, 0xFF, 0x96, 0xEF, 0x0C, 0x9F, 0xC8,
1200 0x44, 0x87, 0xEB, 0x5C, 0x91, 0xD0, 0x46, 0x42, 0x09, 0x50,
1201 0x6A, 0x23, 0xCB, 0x89, 0x6F, 0x55, 0xE9, 0x6A, 0x11, 0xA9,
1202 0xA8, 0x32, 0xAB, 0x33, 0x0D, 0x51, 0xB5, 0x79, 0x51, 0xB4,
1203 0xAB, 0xA2, 0x25, 0x11, 0x8D, 0xE5, 0x24, 0xBE, 0xD8, 0xF1,
1204 0x9D, 0x4E, 0x12, 0x6F, 0xAC, 0x44, 0x54, 0x80, 0xA9, 0xB4,
1205 0x81, 0x68, 0x4E, 0x44, 0x0E, 0xB8, 0x39, 0xF3, 0xBE, 0x83,
1206 0x08, 0x74, 0xA2, 0xC6, 0x7A, 0xD7, 0x6A, 0x7D, 0x0A, 0x88,
1207 0x57, 0x83, 0x48, 0xDC, 0xCF, 0x5E, 0x6F, 0xEE, 0x68, 0x0C,
1208 0xF7, 0xFF, 0x03, 0x04, 0x90, 0xAA, 0xF7, 0x07, 0x98, 0xF8,
1209 0x67, 0x5A, 0x83, 0x23, 0x66, 0x47, 0x60, 0xC3, 0x43, 0x6E,
1210 0x03, 0x91, 0xAC, 0x28, 0x66, 0xCB, 0xF0, 0xD3, 0x05, 0xC8,
1211 0x09, 0x97, 0xB5, 0xAE, 0x01, 0x5E, 0x80, 0x3B, 0x9D, 0x4F,
1212 0xDE, 0x3E, 0x94, 0xFE, 0xCB, 0x82, 0xB0, 0xB1, 0xFC, 0x91,
1213 0x8B, 0x1D, 0x8A, 0xEE, 0xC6, 0x06, 0x1F, 0x37, 0x91, 0x48,
1214 0xD2, 0xF8, 0x6C, 0x5D, 0x60, 0x13, 0x83, 0xA7, 0x81, 0xAC,
1215 0xCA, 0x8D, 0xD0, 0x6A, 0x04, 0x0A, 0xEA, 0x3E, 0x22, 0x4E,
1216 0x13, 0xF1, 0x0D, 0xBB, 0x60, 0x6B, 0xCD, 0xBC, 0x5C, 0x87,
1217 0xA3, 0x67, 0x2B, 0x42, 0xA1, 0x9F, 0xCD, 0x39, 0x58, 0xBE,
1218 0x55, 0xB1, 0x93, 0x84, 0xCE, 0xB2, 0x10, 0x4E, 0xE4, 0xC3,
1219 0x9F, 0xB2, 0x53, 0x61, 0x01, 0x29, 0xAA, 0x96, 0xCB, 0x20,
1220 0x60, 0x42, 0x1D, 0xBA, 0x75, 0x4B, 0x63, 0xC1, 0x02, 0x15,
1221 0x00, 0xE7, 0xA5, 0x39, 0xD4, 0x6A, 0x37, 0x5E, 0x95, 0x06,
1222 0x39, 0x07, 0x77, 0x0A, 0xEB, 0xA0, 0x03, 0xEB, 0x78, 0x82,
1223 0x9B, 0x02, 0x82, 0x01, 0x01, 0x00, 0x9A, 0xD4, 0x4C, 0x71,
1224 0x2F, 0xEC, 0xFA, 0x32, 0xB2, 0x80, 0x7E, 0x61, 0x4A, 0x6B,
1225 0x5F, 0x18, 0x76, 0x43, 0xC3, 0x69, 0xBA, 0x41, 0xC7, 0xA7,
1226 0x1D, 0x79, 0x01, 0xEC, 0xAF, 0x34, 0x87, 0x67, 0x4F, 0x29,
1227 0x80, 0xA8, 0x3B, 0x87, 0xF6, 0xE8, 0xA1, 0xE8, 0xCD, 0x1B,
1228 0x1C, 0x86, 0x38, 0xF6, 0xD1, 0x0C, 0x46, 0x2E, 0xC8, 0xE0,
1229 0xC9, 0x30, 0x26, 0xD5, 0x2C, 0x7F, 0xC1, 0x08, 0xBF, 0xCC,
1230 0x5A, 0x82, 0x8E, 0xD4, 0xD4, 0x49, 0xAA, 0xA2, 0xFA, 0xE6,
1231 0xC1, 0x9D, 0xF0, 0xD9, 0x96, 0xB0, 0xFF, 0x0C, 0x5B, 0x33,
1232 0x8E, 0x06, 0xDD, 0x9D, 0x28, 0xA9, 0xE9, 0x80, 0x41, 0x3B,
1233 0xD8, 0x7A, 0x94, 0x21, 0x8F, 0x56, 0xF1, 0xA2, 0xB4, 0x2B,
1234 0x89, 0x1C, 0x74, 0xFF, 0x7E, 0x91, 0xDC, 0x1F, 0x91, 0x13,
1235 0x98, 0xAF, 0xC7, 0x06, 0xD2, 0x4C, 0x90, 0xA2, 0xBD, 0xDA,
1236 0x16, 0xBA, 0x65, 0xB0, 0x2D, 0x68, 0x87, 0x3C, 0x6E, 0x25,
1237 0x8D, 0x90, 0xC7, 0xBC, 0x0D, 0xA9, 0x43, 0x03, 0xC9, 0xBE,
1238 0xCF, 0x85, 0x6F, 0xDB, 0x07, 0x7B, 0x8C, 0xF8, 0xB1, 0xC2,
1239 0x49, 0x10, 0x69, 0x63, 0x56, 0x37, 0xC5, 0x30, 0xD2, 0xFB,
1240 0x71, 0x9A, 0xE8, 0x82, 0x07, 0x2E, 0x3E, 0x95, 0x50, 0xF3,
1241 0x73, 0xCF, 0x34, 0x5B, 0xD5, 0xAB, 0x02, 0x15, 0xF2, 0xCC,
1242 0xD7, 0x52, 0xC5, 0x28, 0xD8, 0x41, 0x19, 0x55, 0x6F, 0xB8,
1243 0x5F, 0xF1, 0x99, 0xB3, 0xC7, 0xD9, 0xB3, 0x71, 0xF4, 0x2D,
1244 0xDF, 0x22, 0x59, 0x35, 0x86, 0xDB, 0x39, 0xCA, 0x1B, 0x4D,

NetBurner, Inc.
1108 File Documentation

1245 0x35, 0x90, 0x19, 0x6B, 0x31, 0xE3, 0xC8, 0xC6, 0x09, 0xBF,
1246 0x7C, 0xED, 0x01, 0xB4, 0xB2, 0xF5, 0x6E, 0xDA, 0x63, 0x41,
1247 0x3C, 0xE6, 0x3A, 0x72, 0x2D, 0x65, 0x48, 0xF6, 0x07, 0xCD,
1248 0x92, 0x84, 0x8B, 0x1D, 0xA7, 0x31, 0x6B, 0xD6, 0xF0, 0xFB,
1249 0xD9, 0xF4, 0x02, 0x82, 0x01, 0x00, 0x66, 0x4B, 0xBB, 0xB7,
1250 0xC9, 0x48, 0x95, 0x0D, 0x5A, 0xA6, 0x2D, 0xA1, 0x7F, 0xDF,
1251 0x1F, 0x67, 0x6D, 0xED, 0x52, 0x4B, 0x16, 0x6C, 0x17, 0xC6,
1252 0xAE, 0xF8, 0x6A, 0xC4, 0x57, 0xED, 0x2F, 0xB3, 0xF0, 0x2A,
1253 0x55, 0xAB, 0xBA, 0xCA, 0xEA, 0x17, 0xE8, 0x35, 0x7C, 0xE5,
1254 0x31, 0x0D, 0x4A, 0x95, 0xFC, 0x43, 0x6F, 0x97, 0x3C, 0x5C,
1255 0x67, 0xAC, 0xBE, 0x67, 0x7F, 0xE9, 0x4E, 0xAA, 0x48, 0xB3,
1256 0x92, 0xA1, 0x76, 0x75, 0xEA, 0x04, 0x34, 0x7F, 0x87, 0x33,
1257 0x2D, 0x24, 0xB6, 0x29, 0x97, 0xE3, 0x04, 0x77, 0x93, 0x89,
1258 0x13, 0xDB, 0x1B, 0x93, 0xB8, 0x2C, 0x90, 0x1A, 0x09, 0x3B,
1259 0x26, 0xD9, 0x59, 0xF3, 0x2A, 0x09, 0x58, 0xDC, 0xAC, 0x25,
1260 0xB4, 0xA9, 0x45, 0x3B, 0xA2, 0x3A, 0x6C, 0x61, 0x84, 0xBF,
1261 0x68, 0xD4, 0xEA, 0x9B, 0xC5, 0x29, 0x48, 0x60, 0x15, 0x10,
1262 0x35, 0x2C, 0x44, 0x1D, 0xB5, 0x9A, 0xEE, 0xAC, 0xC1, 0x68,
1263 0xE8, 0x47, 0xB7, 0x41, 0x34, 0x39, 0x9A, 0xF8, 0xA5, 0x20,
1264 0xE9, 0x24, 0xC4, 0x2C, 0x58, 0x3F, 0x4C, 0x41, 0x30, 0x3A,
1265 0x14, 0x6E, 0x8D, 0xEA, 0xAD, 0xBA, 0x9B, 0x43, 0xD3, 0x98,
1266 0x2F, 0x83, 0xD8, 0x14, 0x67, 0xE8, 0xF8, 0xD5, 0x4F, 0xAC,
1267 0xE0, 0x3B, 0xBF, 0xA7, 0x54, 0x16, 0x5E, 0x49, 0x64, 0x26,
1268 0x54, 0xA4, 0x6B, 0x69, 0x7C, 0xBA, 0x8A, 0x83, 0xD9, 0x2E,
1269 0x65, 0x0A, 0xA2, 0x27, 0xEF, 0x99, 0x99, 0x08, 0xD7, 0xB5,
1270 0x9F, 0xA0, 0x01, 0xEF, 0x7E, 0x17, 0xBF, 0x83, 0x6B, 0x2E,
1271 0xDD, 0xC0, 0x39, 0x38, 0x23, 0x68, 0xB4, 0x76, 0x6B, 0xE5,
1272 0xCA, 0xF7, 0x7C, 0xEE, 0xC0, 0x52, 0xE2, 0xDD, 0xAD, 0x59,
1273 0x3A, 0x42, 0x06, 0x45, 0xB0, 0xC7, 0xC1, 0x77, 0x05, 0xB2,
1274 0x0C, 0x32, 0x40, 0x46, 0xAA, 0xDA, 0x79, 0x77, 0x04, 0x71,
1275 0xDF, 0x7A, 0x02, 0x15, 0x00, 0x98, 0xEE, 0xB9, 0x51, 0x37,
1276 0x3E, 0x75, 0x13, 0x13, 0x06, 0x8F, 0x94, 0xD3, 0xE6, 0xE9,
1277 0x00, 0xCB, 0x62, 0x6D, 0x9A
1278 };
1279 static const int sizeof_dsa_key_der_2048 = sizeof(dsa_key_der_2048);
1280
1281 /* ./certs/rsa2048.der, 2048-bit */
1282 static const unsigned char rsa_key_der_2048[] =
1283 {
1284 0x30, 0x82, 0x04, 0xA3, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
1285 0x01, 0x00, 0xE9, 0x8A, 0x5D, 0x15, 0xA4, 0xD4, 0x34, 0xB9,
1286 0x59, 0xA2, 0xDA, 0xAF, 0x74, 0xC8, 0xC9, 0x03, 0x26, 0x38,
1287 0xFA, 0x48, 0xFC, 0x4D, 0x30, 0x6E, 0xEA, 0x76, 0x89, 0xCE,
1288 0x4F, 0xF6, 0x87, 0xDE, 0x32, 0x3A, 0x46, 0x6E, 0x38, 0x12,
1289 0x58, 0x37, 0x22, 0x0D, 0x80, 0xAC, 0x2D, 0xAF, 0x2F, 0x12,
1290 0x3E, 0x62, 0x73, 0x60, 0x66, 0x68, 0x90, 0xB2, 0x6F, 0x47,
1291 0x17, 0x04, 0x2B, 0xCA, 0xB7, 0x26, 0xB7, 0x10, 0xC2, 0x13,
1292 0xF9, 0x7A, 0x62, 0x0A, 0x93, 0x32, 0x90, 0x42, 0x0D, 0x16,
1293 0x2E, 0xFA, 0xD7, 0x29, 0xD7, 0x9F, 0x54, 0xE4, 0xFC, 0x65,
1294 0x74, 0xF8, 0xF6, 0x43, 0x6B, 0x4E, 0x9E, 0x34, 0x7F, 0xCB,
1295 0x6B, 0x1C, 0x1A, 0xDE, 0x82, 0x81, 0xBF, 0x08, 0x5D, 0x3F,
1296 0xC0, 0xB6, 0xB1, 0xA8, 0xA5, 0x9C, 0x81, 0x70, 0xA7, 0x4E,
1297 0x32, 0x87, 0x15, 0x1C, 0x78, 0x0E, 0xF0, 0x18, 0xFE, 0xEB,
1298 0x4B, 0x37, 0x2B, 0xE9, 0xE1, 0xF7, 0xFA, 0x51, 0xC6, 0x58,
1299 0xB9, 0xD8, 0x06, 0x03, 0xED, 0xC0, 0x03, 0x18, 0x55, 0x8B,
1300 0x98, 0xFE, 0xB1, 0xF6, 0xD0, 0x3D, 0xFA, 0x63, 0xC0, 0x38,
1301 0x19, 0xC7, 0x00, 0xEF, 0x4D, 0x99, 0x60, 0xB4, 0xBA, 0xCE,
1302 0xE3, 0xCE, 0xD9, 0x6B, 0x2D, 0x76, 0x94, 0xFF, 0xFB, 0x77,
1303 0x18, 0x4A, 0xFE, 0x65, 0xF0, 0x0A, 0x91, 0x5C, 0x3B, 0x22,
1304 0x94, 0x85, 0xD0, 0x20, 0x18, 0x59, 0x2E, 0xA5, 0x33, 0x03,
1305 0xAC, 0x1B, 0x5F, 0x78, 0x32, 0x11, 0x25, 0xEE, 0x7F, 0x96,
1306 0x21, 0xA9, 0xD6, 0x76, 0x97, 0x8D, 0x66, 0x7E, 0xB2, 0x91,
1307 0xD0, 0x36, 0x2E, 0xA3, 0x1D, 0xBF, 0xF1, 0x85, 0xED, 0xC0,
1308 0x3E, 0x60, 0xB8, 0x5A, 0x9F, 0xAB, 0x80, 0xE0, 0xEA, 0x5D,
1309 0x5F, 0x75, 0x56, 0xC7, 0x4D, 0x51, 0x8E, 0xD4, 0x1F, 0x34,
1310 0xA6, 0x36, 0xF1, 0x30, 0x1F, 0x51, 0x99, 0x2F, 0x02, 0x03,
1311 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, 0x00, 0x52, 0x11, 0x33,
1312 0x40, 0xC5, 0xD9, 0x64, 0x65, 0xB5, 0xE0, 0x0A, 0xA5, 0x19,
1313 0x8E, 0xED, 0x44, 0x54, 0x0C, 0x35, 0xB7, 0xAC, 0x21, 0x9B,
1314 0xE1, 0x7E, 0x37, 0x05, 0x9A, 0x20, 0x73, 0x6B, 0xAF, 0x63,
1315 0x4B, 0x23, 0x30, 0xDC, 0x37, 0x66, 0x14, 0x89, 0xBC, 0xE0,
1316 0xF8, 0xA0, 0x5D, 0x2D, 0x57, 0x65, 0xE0, 0xC6, 0xD6, 0x9B,
1317 0x66, 0x27, 0x62, 0xEC, 0xC3, 0xB8, 0x8C, 0xD8, 0xAE, 0xB5,
1318 0xC9, 0xBF, 0x0E, 0xFE, 0x84, 0x72, 0x68, 0xD5, 0x47, 0x0E,
1319 0x0E, 0xF8, 0xAE, 0x9D, 0x56, 0xAC, 0x4F, 0xAD, 0x88, 0xA0,
1320 0xA2, 0xF6, 0xFC, 0x38, 0xCD, 0x96, 0x5B, 0x5E, 0x7E, 0xB6,
1321 0x98, 0xBB, 0xF3, 0x8A, 0xEC, 0xFA, 0xC8, 0xB7, 0x90, 0x75,
1322 0xA0, 0x0E, 0x77, 0x6B, 0xFD, 0x59, 0x45, 0x5A, 0x0C, 0xFF,
1323 0x95, 0x8D, 0xCE, 0xFE, 0x9B, 0xF6, 0x19, 0x8E, 0x0B, 0xA1,
1324 0x0C, 0xEE, 0xC6, 0x79, 0xDD, 0x9D, 0x61, 0x85, 0x5C, 0x19,
1325 0x6C, 0x47, 0xCC, 0x08, 0xFF, 0xA5, 0x62, 0xDB, 0xE4, 0x2D,
1326 0x2D, 0xDD, 0x14, 0x67, 0xD6, 0x4A, 0x64, 0x2A, 0x66, 0x49,
1327 0x54, 0x9C, 0xE3, 0x85, 0x18, 0xE7, 0x31, 0x42, 0xE2, 0xD0,
1328 0x2C, 0x20, 0xA0, 0x74, 0x0F, 0x1F, 0x20, 0x89, 0xBA, 0xAB,
1329 0x80, 0xD8, 0x38, 0xD9, 0x46, 0x69, 0xBB, 0xEF, 0xCC, 0x8B,
1330 0xA1, 0x73, 0xA7, 0xF2, 0xE4, 0x38, 0x5D, 0xD6, 0x75, 0x9F,
1331 0x88, 0x0E, 0x56, 0xCD, 0xD8, 0x84, 0x59, 0x29, 0x73, 0xF5,

NetBurner, Inc.
22.205 certs_test.h 1109

1332 0xA1, 0x79, 0xDA, 0x7A, 0x1F, 0xBF, 0x73, 0x83, 0xC0, 0x6D,
1333 0x9F, 0x8B, 0x34, 0x15, 0xC0, 0x6D, 0x69, 0x6A, 0x20, 0xE6,
1334 0x51, 0xCF, 0x45, 0x6E, 0xCC, 0x05, 0xC4, 0x3A, 0xC0, 0x9E,
1335 0xAA, 0xC1, 0x06, 0x2F, 0xAB, 0x99, 0x30, 0xE1, 0x6E, 0x9D,
1336 0x45, 0x7A, 0xFF, 0xA9, 0xCE, 0x70, 0xB8, 0x16, 0x1A, 0x0E,
1337 0x20, 0xFA, 0xC1, 0x02, 0x81, 0x81, 0x00, 0xFF, 0x30, 0x11,
1338 0xC2, 0x3C, 0x6B, 0xB4, 0xD6, 0x9E, 0x6B, 0xC1, 0x93, 0xD1,
1339 0x48, 0xCE, 0x80, 0x2D, 0xBE, 0xAF, 0xF7, 0xBA, 0xB2, 0xD7,
1340 0xC3, 0xC4, 0x53, 0x6E, 0x15, 0x02, 0xAA, 0x61, 0xB9, 0xEA,
1341 0x05, 0x9B, 0x79, 0x67, 0x0B, 0xCE, 0xD9, 0xFB, 0x98, 0x8C,
1342 0x1D, 0x6B, 0xF4, 0x5A, 0xA7, 0xA0, 0x5E, 0x54, 0x18, 0xE9,
1343 0x31, 0x44, 0x7C, 0xC7, 0x52, 0xD8, 0x6D, 0xA0, 0x3E, 0xD6,
1344 0x14, 0x2D, 0x7B, 0x15, 0x9D, 0x1E, 0x39, 0x87, 0x96, 0xDD,
1345 0xA8, 0x33, 0x55, 0x2A, 0x8E, 0x32, 0xC0, 0xC4, 0xE5, 0xB8,
1346 0xCB, 0xCD, 0x32, 0x8D, 0xAD, 0x7B, 0xE5, 0xC6, 0x7E, 0x4D,
1347 0x6F, 0xF3, 0xA4, 0xC5, 0xA6, 0x40, 0xBE, 0x90, 0x3A, 0x33,
1348 0x6A, 0x24, 0xB2, 0x80, 0x81, 0x12, 0xAC, 0xE3, 0x7B, 0x26,
1349 0x63, 0xCF, 0x88, 0xB9, 0xFF, 0x74, 0x23, 0x37, 0x52, 0xF0,
1350 0xC4, 0x27, 0x5D, 0x45, 0x1F, 0x02, 0x81, 0x81, 0x00, 0xEA,
1351 0x48, 0xA7, 0xDD, 0x73, 0x41, 0x56, 0x21, 0x15, 0xF7, 0x42,
1352 0x45, 0x4D, 0xA9, 0xE1, 0x66, 0x5B, 0xBD, 0x25, 0x7D, 0xF7,
1353 0xA8, 0x65, 0x13, 0xAE, 0x2D, 0x38, 0x11, 0xCD, 0x93, 0xFC,
1354 0x30, 0xA3, 0x2C, 0x44, 0xBB, 0xCF, 0xD0, 0x21, 0x8F, 0xFB,
1355 0xC1, 0xF9, 0xAD, 0x1D, 0xEE, 0x96, 0xCF, 0x97, 0x49, 0x60,
1356 0x53, 0x80, 0xA5, 0xA2, 0xF8, 0xEE, 0xB9, 0xD5, 0x77, 0x44,
1357 0xDD, 0xFD, 0x19, 0x2A, 0xF1, 0x81, 0xF4, 0xD9, 0x3C, 0xEC,
1358 0x73, 0xD0, 0x2A, 0xD8, 0x3C, 0x27, 0x87, 0x79, 0x12, 0x86,
1359 0xE7, 0x57, 0x0C, 0x59, 0xD1, 0x44, 0x55, 0xAE, 0xC3, 0x4D,
1360 0x42, 0xAD, 0xA9, 0xB3, 0x28, 0x61, 0xB4, 0x9C, 0xA6, 0x63,
1361 0xD3, 0x96, 0xB1, 0x75, 0x9F, 0x2A, 0x78, 0x99, 0xE3, 0x1E,
1362 0x71, 0x47, 0x39, 0xF4, 0x52, 0xE3, 0x66, 0xF1, 0xEB, 0x7F,
1363 0xEF, 0xC6, 0x81, 0x93, 0x4C, 0x99, 0xF1, 0x02, 0x81, 0x81,
1364 0x00, 0xC5, 0xB6, 0x20, 0x8C, 0x34, 0xF3, 0xDD, 0xF0, 0x4A,
1365 0x5D, 0x82, 0x65, 0x5C, 0x48, 0xE4, 0x75, 0x3A, 0xFB, 0xFA,
1366 0xAA, 0x1C, 0xE4, 0x63, 0x77, 0x31, 0xAC, 0xD2, 0x25, 0x45,
1367 0x23, 0x6D, 0x03, 0xF5, 0xE4, 0xD2, 0x48, 0x85, 0x26, 0x08,
1368 0xE5, 0xAA, 0xA0, 0xCE, 0x2E, 0x1D, 0x6D, 0xFC, 0xAE, 0xD2,
1369 0xF9, 0x42, 0x7E, 0xEA, 0x6D, 0x59, 0x7A, 0xB3, 0x93, 0xE4,
1370 0x4B, 0x4B, 0x54, 0x63, 0xD8, 0xCE, 0x44, 0x06, 0xC2, 0xEC,
1371 0x9F, 0xF6, 0x05, 0x55, 0x46, 0xF4, 0x3E, 0x8F, 0xF2, 0x0C,
1372 0x30, 0x7E, 0x5C, 0xDD, 0x88, 0x49, 0x3B, 0x59, 0xB9, 0x87,
1373 0xBC, 0xC6, 0xC5, 0x24, 0x8A, 0x10, 0x63, 0x21, 0x1F, 0x66,
1374 0x1A, 0x3E, 0xF4, 0x58, 0xD1, 0x6C, 0x0D, 0x40, 0xB2, 0xC0,
1375 0x1D, 0x63, 0x42, 0x0E, 0xC4, 0x56, 0x0E, 0xC0, 0xCC, 0xC2,
1376 0xD6, 0x66, 0x0E, 0xC4, 0xAB, 0xB5, 0x33, 0xF6, 0x51, 0x02,
1377 0x81, 0x80, 0x19, 0x7E, 0xE6, 0xA5, 0xB6, 0xD1, 0x39, 0x6A,
1378 0x48, 0x55, 0xAC, 0x24, 0x96, 0x9B, 0x12, 0x28, 0x6D, 0x7B,
1379 0x5C, 0x05, 0x25, 0x5A, 0x72, 0x05, 0x7E, 0x42, 0xF5, 0x83,
1380 0x1A, 0x78, 0x2C, 0x4D, 0xAE, 0xB4, 0x36, 0x96, 0xA9, 0xBA,
1381 0xE0, 0xAC, 0x26, 0x9D, 0xA9, 0x6A, 0x29, 0x83, 0xB9, 0x6D,
1382 0xC5, 0xEC, 0xFA, 0x4A, 0x9C, 0x09, 0x6A, 0x7E, 0xE4, 0x9B,
1383 0xDC, 0x9B, 0x2A, 0x27, 0x6E, 0x4F, 0xBA, 0xD8, 0xA5, 0x67,
1384 0xDB, 0xEC, 0x41, 0x5F, 0x29, 0x1C, 0x40, 0x83, 0xEB, 0x59,
1385 0x56, 0xD7, 0xA9, 0x4E, 0xAB, 0xAE, 0x70, 0x67, 0xD1, 0xA3,
1386 0xF1, 0x6C, 0xD7, 0x8F, 0x96, 0x0E, 0x8D, 0xAC, 0xAB, 0x55,
1387 0x58, 0x66, 0xD3, 0x1E, 0x47, 0x9B, 0xF0, 0x4C, 0xED, 0xF6,
1388 0x49, 0xE8, 0xE9, 0x7B, 0x32, 0x61, 0x20, 0x31, 0x95, 0x05,
1389 0xB2, 0xF6, 0x09, 0xEA, 0x32, 0x14, 0x0F, 0xCF, 0x9A, 0x41,
1390 0x02, 0x81, 0x80, 0x77, 0x3F, 0xB6, 0x14, 0x8D, 0xC5, 0x13,
1391 0x08, 0x7E, 0xC9, 0xC4, 0xEA, 0xD4, 0xBA, 0x0D, 0xA4, 0x9E,
1392 0xB3, 0x6E, 0xDE, 0x1A, 0x7A, 0xF8, 0x89, 0x88, 0xEF, 0x36,
1393 0x3C, 0x11, 0xBC, 0x83, 0xE8, 0x30, 0x6C, 0x81, 0x7C, 0x47,
1394 0xF3, 0x4D, 0xCA, 0xEA, 0x56, 0x01, 0x62, 0x55, 0x2E, 0x4B,
1395 0x89, 0xA9, 0xBD, 0x6F, 0x01, 0xF6, 0x74, 0x02, 0xAA, 0xE3,
1396 0x84, 0x66, 0x06, 0x95, 0x34, 0xA1, 0xE2, 0xCA, 0x65, 0xFE,
1397 0xA3, 0x2D, 0x43, 0x97, 0x95, 0x6C, 0x6F, 0xD5, 0xB4, 0x38,
1398 0xF6, 0xF9, 0x95, 0x30, 0xFA, 0xF8, 0x9C, 0x25, 0x2B, 0xB6,
1399 0x14, 0x51, 0xCC, 0x2E, 0xB3, 0x5B, 0xD6, 0xDC, 0x1A, 0xEC,
1400 0x2D, 0x09, 0x5B, 0x3F, 0x3A, 0xD0, 0xB8, 0x4E, 0x27, 0x1F,
1401 0xDC, 0x2A, 0xEE, 0xAC, 0xA9, 0x59, 0x5D, 0x07, 0x63, 0x11,
1402 0x83, 0x0B, 0xD4, 0x74, 0x80, 0xB6, 0x7D, 0x62, 0x45, 0xBF,
1403 0x56
1404 };
1405 static const int sizeof_rsa_key_der_2048 = sizeof(rsa_key_der_2048);
1406
1407 /* ./certs/ca-key.der, 2048-bit */
1408 static const unsigned char ca_key_der_2048[] =
1409 {
1410 0x30, 0x82, 0x04, 0xA4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
1411 0x01, 0x00, 0xBF, 0x0C, 0xCA, 0x2D, 0x14, 0xB2, 0x1E, 0x84,
1412 0x42, 0x5B, 0xCD, 0x38, 0x1F, 0x4A, 0xF2, 0x4D, 0x75, 0x10,
1413 0xF1, 0xB6, 0x35, 0x9F, 0xDF, 0xCA, 0x7D, 0x03, 0x98, 0xD3,
1414 0xAC, 0xDE, 0x03, 0x66, 0xEE, 0x2A, 0xF1, 0xD8, 0xB0, 0x7D,
1415 0x6E, 0x07, 0x54, 0x0B, 0x10, 0x98, 0x21, 0x4D, 0x80, 0xCB,
1416 0x12, 0x20, 0xE7, 0xCC, 0x4F, 0xDE, 0x45, 0x7D, 0xC9, 0x72,
1417 0x77, 0x32, 0xEA, 0xCA, 0x90, 0xBB, 0x69, 0x52, 0x10, 0x03,
1418 0x2F, 0xA8, 0xF3, 0x95, 0xC5, 0xF1, 0x8B, 0x62, 0x56, 0x1B,

NetBurner, Inc.
1110 File Documentation

1419 0xEF, 0x67, 0x6F, 0xA4, 0x10, 0x41, 0x95, 0xAD, 0x0A, 0x9B,
1420 0xE3, 0xA5, 0xC0, 0xB0, 0xD2, 0x70, 0x76, 0x50, 0x30, 0x5B,
1421 0xA8, 0xE8, 0x08, 0x2C, 0x7C, 0xED, 0xA7, 0xA2, 0x7A, 0x8D,
1422 0x38, 0x29, 0x1C, 0xAC, 0xC7, 0xED, 0xF2, 0x7C, 0x95, 0xB0,
1423 0x95, 0x82, 0x7D, 0x49, 0x5C, 0x38, 0xCD, 0x77, 0x25, 0xEF,
1424 0xBD, 0x80, 0x75, 0x53, 0x94, 0x3C, 0x3D, 0xCA, 0x63, 0x5B,
1425 0x9F, 0x15, 0xB5, 0xD3, 0x1D, 0x13, 0x2F, 0x19, 0xD1, 0x3C,
1426 0xDB, 0x76, 0x3A, 0xCC, 0xB8, 0x7D, 0xC9, 0xE5, 0xC2, 0xD7,
1427 0xDA, 0x40, 0x6F, 0xD8, 0x21, 0xDC, 0x73, 0x1B, 0x42, 0x2D,
1428 0x53, 0x9C, 0xFE, 0x1A, 0xFC, 0x7D, 0xAB, 0x7A, 0x36, 0x3F,
1429 0x98, 0xDE, 0x84, 0x7C, 0x05, 0x67, 0xCE, 0x6A, 0x14, 0x38,
1430 0x87, 0xA9, 0xF1, 0x8C, 0xB5, 0x68, 0xCB, 0x68, 0x7F, 0x71,
1431 0x20, 0x2B, 0xF5, 0xA0, 0x63, 0xF5, 0x56, 0x2F, 0xA3, 0x26,
1432 0xD2, 0xB7, 0x6F, 0xB1, 0x5A, 0x17, 0xD7, 0x38, 0x99, 0x08,
1433 0xFE, 0x93, 0x58, 0x6F, 0xFE, 0xC3, 0x13, 0x49, 0x08, 0x16,
1434 0x0B, 0xA7, 0x4D, 0x67, 0x00, 0x52, 0x31, 0x67, 0x23, 0x4E,
1435 0x98, 0xED, 0x51, 0x45, 0x1D, 0xB9, 0x04, 0xD9, 0x0B, 0xEC,
1436 0xD8, 0x28, 0xB3, 0x4B, 0xBD, 0xED, 0x36, 0x79, 0x02, 0x03,
1437 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, 0x00, 0x3D, 0x6E, 0x4E,
1438 0x60, 0x1A, 0x84, 0x7F, 0x9D, 0x85, 0x7C, 0xE1, 0x4B, 0x07,
1439 0x7C, 0xE0, 0xD6, 0x99, 0x2A, 0xDE, 0x9D, 0xF9, 0x36, 0x34,
1440 0x0E, 0x77, 0x0E, 0x3E, 0x08, 0xEA, 0x4F, 0xE5, 0x06, 0x26,
1441 0xD4, 0xF6, 0x38, 0xF7, 0xDF, 0x0D, 0x0F, 0x1C, 0x2E, 0x06,
1442 0xA2, 0xF4, 0x2A, 0x68, 0x9C, 0x63, 0x72, 0xE3, 0x35, 0xE6,
1443 0x04, 0x91, 0x91, 0xB5, 0xC1, 0xB1, 0xA4, 0x54, 0xAC, 0xD7,
1444 0xC6, 0xFB, 0x41, 0xA0, 0xD6, 0x75, 0x6F, 0xBD, 0x0B, 0x4E,
1445 0xBF, 0xB1, 0x52, 0xE8, 0x5F, 0x49, 0x26, 0x98, 0x56, 0x47,
1446 0xC7, 0xDE, 0xE9, 0xEA, 0x3C, 0x60, 0x01, 0xBF, 0x28, 0xDC,
1447 0x31, 0xBF, 0x49, 0x5F, 0x93, 0x49, 0x87, 0x7A, 0x81, 0x5B,
1448 0x96, 0x4B, 0x4D, 0xCA, 0x5C, 0x38, 0x4F, 0xB7, 0xE1, 0xB2,
1449 0xD3, 0xC7, 0x21, 0xDA, 0x3C, 0x12, 0x87, 0x07, 0xE4, 0x1B,
1450 0xDC, 0x43, 0xEC, 0xE8, 0xEC, 0x54, 0x61, 0xE7, 0xF6, 0xED,
1451 0xA6, 0x0B, 0x2E, 0xF5, 0xDF, 0x82, 0x7F, 0xC6, 0x1F, 0x61,
1452 0x19, 0x9C, 0xA4, 0x83, 0x39, 0xDF, 0x21, 0x85, 0x89, 0x6F,
1453 0x77, 0xAF, 0x86, 0x15, 0x32, 0x08, 0xA2, 0x5A, 0x0B, 0x26,
1454 0x61, 0xFB, 0x70, 0x0C, 0xCA, 0x9C, 0x38, 0x7D, 0xBC, 0x22,
1455 0xEE, 0xEB, 0xA3, 0xA8, 0x16, 0x00, 0xF9, 0x8A, 0x80, 0x1E,
1456 0x00, 0x84, 0xA8, 0x4A, 0x41, 0xF8, 0x84, 0x03, 0x67, 0x2F,
1457 0x23, 0x5B, 0x2F, 0x9B, 0x6B, 0x26, 0xC3, 0x07, 0x34, 0x94,
1458 0xA3, 0x03, 0x3B, 0x72, 0xD5, 0x9F, 0x72, 0xE0, 0xAD, 0xCC,
1459 0x34, 0xAB, 0xBD, 0xC7, 0xD5, 0xF5, 0x26, 0x30, 0x85, 0x0F,
1460 0x30, 0x23, 0x39, 0x52, 0xFF, 0x3C, 0xCB, 0x99, 0x21, 0x4D,
1461 0x88, 0xA5, 0xAB, 0xEE, 0x62, 0xB9, 0xC7, 0xE0, 0xBB, 0x47,
1462 0x87, 0xC1, 0x69, 0xCF, 0x73, 0xF3, 0x30, 0xBE, 0xCE, 0x39,
1463 0x04, 0x9C, 0xE5, 0x02, 0x81, 0x81, 0x00, 0xE1, 0x76, 0x45,
1464 0x80, 0x59, 0xB6, 0xD3, 0x49, 0xDF, 0x0A, 0xEF, 0x12, 0xD6,
1465 0x0F, 0xF0, 0xB7, 0xCB, 0x2A, 0x37, 0xBF, 0xA7, 0xF8, 0xB5,
1466 0x4D, 0xF5, 0x31, 0x35, 0xAD, 0xE4, 0xA3, 0x94, 0xA1, 0xDB,
1467 0xF1, 0x96, 0xAD, 0xB5, 0x05, 0x64, 0x85, 0x83, 0xFC, 0x1B,
1468 0x5B, 0x29, 0xAA, 0xBE, 0xF8, 0x26, 0x3F, 0x76, 0x7E, 0xAD,
1469 0x1C, 0xF0, 0xCB, 0xD7, 0x26, 0xB4, 0x1B, 0x05, 0x8E, 0x56,
1470 0x86, 0x7E, 0x08, 0x62, 0x21, 0xC1, 0x86, 0xD6, 0x47, 0x79,
1471 0x3E, 0xB7, 0x5D, 0xA4, 0xC6, 0x3A, 0xD7, 0xB1, 0x74, 0x20,
1472 0xF6, 0x50, 0x97, 0x41, 0x04, 0x53, 0xED, 0x3F, 0x26, 0xD6,
1473 0x6F, 0x91, 0xFA, 0x68, 0x26, 0xEC, 0x2A, 0xDC, 0x9A, 0xF1,
1474 0xE7, 0xDC, 0xFB, 0x73, 0xF0, 0x79, 0x43, 0x1B, 0x21, 0xA3,
1475 0x59, 0x04, 0x63, 0x52, 0x07, 0xC9, 0xD7, 0xE6, 0xD1, 0x1B,
1476 0x5D, 0x5E, 0x96, 0xFA, 0x53, 0x02, 0x81, 0x81, 0x00, 0xD8,
1477 0xED, 0x4E, 0x64, 0x61, 0x6B, 0x91, 0x0C, 0x61, 0x01, 0xB5,
1478 0x0F, 0xBB, 0x44, 0x67, 0x53, 0x1E, 0xDC, 0x07, 0xC4, 0x24,
1479 0x7E, 0x9E, 0x6C, 0x84, 0x23, 0x91, 0x0C, 0xE4, 0x12, 0x04,
1480 0x16, 0x4D, 0x78, 0x98, 0xCC, 0x96, 0x3D, 0x20, 0x4E, 0x0F,
1481 0x45, 0x9A, 0xB6, 0xF8, 0xB3, 0x93, 0x0D, 0xB2, 0xA2, 0x1B,
1482 0x29, 0xF2, 0x26, 0x79, 0xC8, 0xC5, 0xD2, 0x78, 0x7E, 0x5E,
1483 0x73, 0xF2, 0xD7, 0x70, 0x61, 0xBB, 0x40, 0xCE, 0x61, 0x05,
1484 0xFE, 0x69, 0x1E, 0x82, 0x29, 0xE6, 0x14, 0xB8, 0xA1, 0xE7,
1485 0x96, 0xD0, 0x23, 0x3F, 0x05, 0x93, 0x00, 0xF2, 0xE1, 0x4D,
1486 0x7E, 0xED, 0xB7, 0x96, 0x6C, 0xF7, 0xF0, 0xE4, 0xD1, 0xCF,
1487 0x01, 0x98, 0x4F, 0xDC, 0x74, 0x54, 0xAA, 0x6D, 0x5E, 0x5A,
1488 0x41, 0x31, 0xFE, 0xFF, 0x9A, 0xB6, 0xA0, 0x05, 0xDD, 0xA9,
1489 0x10, 0x54, 0xF8, 0x6B, 0xD0, 0xAA, 0x83, 0x02, 0x81, 0x80,
1490 0x21, 0xD3, 0x04, 0x8A, 0x44, 0xEB, 0x50, 0xB7, 0x7C, 0x66,
1491 0xBF, 0x87, 0x2B, 0xE6, 0x28, 0x4E, 0xEA, 0x83, 0xE2, 0xE9,
1492 0x35, 0xE1, 0xF2, 0x11, 0x47, 0xFF, 0xA1, 0xF5, 0xFC, 0x9F,
1493 0x2D, 0xE5, 0x3A, 0x81, 0xFC, 0x01, 0x03, 0x6F, 0x53, 0xAD,
1494 0x54, 0x27, 0xB6, 0x52, 0xEE, 0xE5, 0x56, 0xD1, 0x13, 0xAB,
1495 0xE1, 0xB3, 0x0F, 0x75, 0x90, 0x0A, 0x84, 0xB4, 0xA1, 0xC0,
1496 0x8C, 0x0C, 0xD6, 0x9E, 0x46, 0xBA, 0x2B, 0x3E, 0xB5, 0x31,
1497 0xED, 0x63, 0xBB, 0xA4, 0xD5, 0x0D, 0x8F, 0x72, 0xCD, 0xD1,
1498 0x1E, 0x26, 0x35, 0xEB, 0xBE, 0x1B, 0x72, 0xFD, 0x9B, 0x39,
1499 0xB4, 0x87, 0xB7, 0x13, 0xF5, 0xEA, 0x83, 0x45, 0x93, 0x98,
1500 0xBA, 0x8F, 0xE4, 0x4A, 0xCC, 0xB4, 0x4C, 0xA8, 0x7F, 0x08,
1501 0xBA, 0x41, 0x49, 0xA8, 0x49, 0x28, 0x3D, 0x5E, 0x3D, 0xC1,
1502 0xCE, 0x37, 0x00, 0xCB, 0xF9, 0x2C, 0xDD, 0x51, 0x02, 0x81,
1503 0x81, 0x00, 0xA1, 0x57, 0x9F, 0x3E, 0xB9, 0xD6, 0xAF, 0x83,
1504 0x6D, 0x83, 0x3F, 0x8F, 0xFB, 0xD0, 0xDC, 0xA8, 0xCE, 0x03,
1505 0x09, 0x23, 0xB1, 0xA1, 0x1B, 0x63, 0xCA, 0xC4, 0x49, 0x56,

NetBurner, Inc.
22.205 certs_test.h 1111

1506 0x35, 0x2B, 0xD1, 0x2E, 0x65, 0x60, 0x95, 0x05, 0x55, 0x99,
1507 0x11, 0x35, 0xFD, 0xD5, 0xDF, 0x44, 0xC7, 0xA5, 0x88, 0x72,
1508 0x5F, 0xB2, 0x82, 0x51, 0xA8, 0x71, 0x45, 0x93, 0x36, 0xCF,
1509 0x5C, 0x1F, 0x61, 0x51, 0x0C, 0x05, 0x80, 0xE8, 0xAF, 0xC5,
1510 0x7B, 0xBA, 0x5E, 0x22, 0xE3, 0x3C, 0x75, 0xC3, 0x84, 0x05,
1511 0x55, 0x6D, 0xD6, 0x3A, 0x2D, 0x84, 0x89, 0x93, 0x33, 0xCB,
1512 0x38, 0xDA, 0xAA, 0x31, 0x05, 0xCD, 0xCE, 0x6C, 0x2D, 0xDD,
1513 0x55, 0xD3, 0x57, 0x0B, 0xF0, 0xA5, 0x35, 0x6A, 0xB0, 0xAE,
1514 0x31, 0xBA, 0x43, 0x96, 0xCA, 0x00, 0xC7, 0x4B, 0xE3, 0x19,
1515 0x12, 0x43, 0xD3, 0x42, 0xFA, 0x6F, 0xEA, 0x80, 0xC0, 0xD1,
1516 0x02, 0x81, 0x81, 0x00, 0xB9, 0xDB, 0x89, 0x20, 0x34, 0x27,
1517 0x70, 0x62, 0x34, 0xEA, 0x5F, 0x25, 0x62, 0x12, 0xF3, 0x9D,
1518 0x81, 0xBF, 0x48, 0xEE, 0x9A, 0x0E, 0xC1, 0x8D, 0x10, 0xFF,
1519 0x65, 0x9A, 0x9D, 0x2D, 0x1A, 0x8A, 0x94, 0x5A, 0xC8, 0xC0,
1520 0xA5, 0xA5, 0x84, 0x61, 0x9E, 0xD4, 0x24, 0xB9, 0xEF, 0xA9,
1521 0x9D, 0xC9, 0x77, 0x0B, 0xC7, 0x70, 0x66, 0x3D, 0xBA, 0xC8,
1522 0x54, 0xDF, 0xD2, 0x33, 0xE1, 0xF5, 0x7F, 0xF9, 0x27, 0x61,
1523 0xBE, 0x57, 0x45, 0xDD, 0xB7, 0x45, 0x17, 0x24, 0xF5, 0x23,
1524 0xE4, 0x38, 0x0E, 0x91, 0x27, 0xEE, 0xE3, 0x20, 0xD8, 0x14,
1525 0xC8, 0x94, 0x47, 0x77, 0x40, 0x77, 0x45, 0x18, 0x9E, 0x0D,
1526 0xCE, 0x79, 0x3F, 0x57, 0x31, 0x56, 0x09, 0x49, 0x67, 0xBE,
1527 0x94, 0x58, 0x4F, 0xF6, 0xC4, 0xAB, 0xE2, 0x89, 0xE3, 0xE3,
1528 0x8A, 0xC0, 0x05, 0x55, 0x2C, 0x24, 0xC0, 0x4A, 0x97, 0x04,
1529 0x27, 0x9A
1530 };
1531 static const int sizeof_ca_key_der_2048 = sizeof(ca_key_der_2048);
1532
1533 /* ./certs/ca-cert.der, 2048-bit */
1534 static const unsigned char ca_cert_der_2048[] =
1535 {
1536 0x30, 0x82, 0x04, 0xFF, 0x30, 0x82, 0x03, 0xE7, 0xA0, 0x03,
1537 0x02, 0x01, 0x02, 0x02, 0x14, 0x26, 0x8C, 0x93, 0xF9, 0xF9,
1538 0xF4, 0x1E, 0xB3, 0x01, 0x72, 0x94, 0x55, 0x67, 0x6D, 0xE2,
1539 0xF8, 0x3D, 0xDA, 0xE9, 0xF4, 0x30, 0x0D, 0x06, 0x09, 0x2A,
1540 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
1541 0x30, 0x81, 0x94, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55,
1542 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E,
1543 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E,
1544 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
1545 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D,
1546 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04,
1547 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74,
1548 0x68, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0B,
1549 0x0C, 0x0A, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69,
1550 0x6E, 0x67, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
1551 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
1552 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
1553 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
1554 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
1555 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
1556 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
1557 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
1558 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
1559 0x32, 0x34, 0x5A, 0x30, 0x81, 0x94, 0x31, 0x0B, 0x30, 0x09,
1560 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
1561 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
1562 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
1563 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
1564 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06,
1565 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74,
1566 0x6F, 0x6F, 0x74, 0x68, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
1567 0x55, 0x04, 0x0B, 0x0C, 0x0A, 0x43, 0x6F, 0x6E, 0x73, 0x75,
1568 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x31, 0x18, 0x30, 0x16, 0x06,
1569 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
1570 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
1571 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
1572 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
1573 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
1574 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D,
1575 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01,
1576 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30, 0x82,
1577 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xBF, 0x0C, 0xCA,
1578 0x2D, 0x14, 0xB2, 0x1E, 0x84, 0x42, 0x5B, 0xCD, 0x38, 0x1F,
1579 0x4A, 0xF2, 0x4D, 0x75, 0x10, 0xF1, 0xB6, 0x35, 0x9F, 0xDF,
1580 0xCA, 0x7D, 0x03, 0x98, 0xD3, 0xAC, 0xDE, 0x03, 0x66, 0xEE,
1581 0x2A, 0xF1, 0xD8, 0xB0, 0x7D, 0x6E, 0x07, 0x54, 0x0B, 0x10,
1582 0x98, 0x21, 0x4D, 0x80, 0xCB, 0x12, 0x20, 0xE7, 0xCC, 0x4F,
1583 0xDE, 0x45, 0x7D, 0xC9, 0x72, 0x77, 0x32, 0xEA, 0xCA, 0x90,
1584 0xBB, 0x69, 0x52, 0x10, 0x03, 0x2F, 0xA8, 0xF3, 0x95, 0xC5,
1585 0xF1, 0x8B, 0x62, 0x56, 0x1B, 0xEF, 0x67, 0x6F, 0xA4, 0x10,
1586 0x41, 0x95, 0xAD, 0x0A, 0x9B, 0xE3, 0xA5, 0xC0, 0xB0, 0xD2,
1587 0x70, 0x76, 0x50, 0x30, 0x5B, 0xA8, 0xE8, 0x08, 0x2C, 0x7C,
1588 0xED, 0xA7, 0xA2, 0x7A, 0x8D, 0x38, 0x29, 0x1C, 0xAC, 0xC7,
1589 0xED, 0xF2, 0x7C, 0x95, 0xB0, 0x95, 0x82, 0x7D, 0x49, 0x5C,
1590 0x38, 0xCD, 0x77, 0x25, 0xEF, 0xBD, 0x80, 0x75, 0x53, 0x94,
1591 0x3C, 0x3D, 0xCA, 0x63, 0x5B, 0x9F, 0x15, 0xB5, 0xD3, 0x1D,
1592 0x13, 0x2F, 0x19, 0xD1, 0x3C, 0xDB, 0x76, 0x3A, 0xCC, 0xB8,

NetBurner, Inc.
1112 File Documentation

1593 0x7D, 0xC9, 0xE5, 0xC2, 0xD7, 0xDA, 0x40, 0x6F, 0xD8, 0x21,
1594 0xDC, 0x73, 0x1B, 0x42, 0x2D, 0x53, 0x9C, 0xFE, 0x1A, 0xFC,
1595 0x7D, 0xAB, 0x7A, 0x36, 0x3F, 0x98, 0xDE, 0x84, 0x7C, 0x05,
1596 0x67, 0xCE, 0x6A, 0x14, 0x38, 0x87, 0xA9, 0xF1, 0x8C, 0xB5,
1597 0x68, 0xCB, 0x68, 0x7F, 0x71, 0x20, 0x2B, 0xF5, 0xA0, 0x63,
1598 0xF5, 0x56, 0x2F, 0xA3, 0x26, 0xD2, 0xB7, 0x6F, 0xB1, 0x5A,
1599 0x17, 0xD7, 0x38, 0x99, 0x08, 0xFE, 0x93, 0x58, 0x6F, 0xFE,
1600 0xC3, 0x13, 0x49, 0x08, 0x16, 0x0B, 0xA7, 0x4D, 0x67, 0x00,
1601 0x52, 0x31, 0x67, 0x23, 0x4E, 0x98, 0xED, 0x51, 0x45, 0x1D,
1602 0xB9, 0x04, 0xD9, 0x0B, 0xEC, 0xD8, 0x28, 0xB3, 0x4B, 0xBD,
1603 0xED, 0x36, 0x79, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82,
1604 0x01, 0x45, 0x30, 0x82, 0x01, 0x41, 0x30, 0x1D, 0x06, 0x03,
1605 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0x27, 0x8E, 0x67,
1606 0x11, 0x74, 0xC3, 0x26, 0x1D, 0x3F, 0xED, 0x33, 0x63, 0xB3,
1607 0xA4, 0xD8, 0x1D, 0x30, 0xE5, 0xE8, 0xD5, 0x30, 0x81, 0xD4,
1608 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x81, 0xCC, 0x30, 0x81,
1609 0xC9, 0x80, 0x14, 0x27, 0x8E, 0x67, 0x11, 0x74, 0xC3, 0x26,
1610 0x1D, 0x3F, 0xED, 0x33, 0x63, 0xB3, 0xA4, 0xD8, 0x1D, 0x30,
1611 0xE5, 0xE8, 0xD5, 0xA1, 0x81, 0x9A, 0xA4, 0x81, 0x97, 0x30,
1612 0x81, 0x94, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
1613 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06,
1614 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74,
1615 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
1616 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61,
1617 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x0A,
1618 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74, 0x68,
1619 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C,
1620 0x0A, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E,
1621 0x67, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03,
1622 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66,
1623 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30,
1624 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
1625 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
1626 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
1627 0x82, 0x14, 0x26, 0x8C, 0x93, 0xF9, 0xF9, 0xF4, 0x1E, 0xB3,
1628 0x01, 0x72, 0x94, 0x55, 0x67, 0x6D, 0xE2, 0xF8, 0x3D, 0xDA,
1629 0xE9, 0xF4, 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04,
1630 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03,
1631 0x55, 0x1D, 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65,
1632 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D,
1633 0x87, 0x04, 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03,
1634 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B,
1635 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B,
1636 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06,
1637 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B,
1638 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x62, 0xE4, 0x1B,
1639 0x28, 0x3C, 0x9D, 0xD2, 0x60, 0xA9, 0x55, 0xBE, 0x6A, 0xF6,
1640 0x20, 0xF2, 0xDA, 0xE8, 0xA1, 0x1A, 0x97, 0xB1, 0x90, 0x77,
1641 0x82, 0xED, 0xC7, 0x77, 0x29, 0x53, 0x33, 0x18, 0x10, 0x62,
1642 0xE0, 0xBD, 0x93, 0x1B, 0xD2, 0xD6, 0xA1, 0x80, 0x43, 0x1D,
1643 0x64, 0xF1, 0x42, 0x92, 0xEC, 0xB7, 0xB8, 0xF0, 0x6B, 0xDA,
1644 0x59, 0x83, 0xF4, 0xB8, 0x87, 0xE6, 0xFC, 0x70, 0x21, 0xEA,
1645 0x62, 0x32, 0x70, 0x68, 0x14, 0x0E, 0xDC, 0xB4, 0xF1, 0x66,
1646 0xE2, 0x6E, 0xAB, 0xD2, 0x72, 0x6F, 0xDA, 0xDF, 0x71, 0xF6,
1647 0x3D, 0x27, 0x97, 0x7D, 0xBE, 0xE1, 0xD1, 0xAC, 0x16, 0xAD,
1648 0xD7, 0x4F, 0xAA, 0x9D, 0x0C, 0x1E, 0x6E, 0xA9, 0x5E, 0x7D,
1649 0x57, 0x5B, 0x3C, 0xC7, 0x6D, 0xD2, 0xF2, 0x5C, 0xC3, 0xDC,
1650 0x3D, 0x36, 0x99, 0x8E, 0xAB, 0xC0, 0x7F, 0x13, 0xA5, 0xF4,
1651 0x67, 0x8B, 0xE2, 0xA6, 0x51, 0x31, 0xF1, 0x03, 0x91, 0x00,
1652 0xA8, 0xC4, 0xC5, 0x1D, 0x7F, 0x35, 0x62, 0xB8, 0x1D, 0xA0,
1653 0xA5, 0xAB, 0xEC, 0x32, 0x68, 0xEE, 0xF3, 0xCA, 0x48, 0x16,
1654 0x9F, 0xF4, 0x1E, 0x7E, 0xEA, 0xFA, 0xB0, 0x86, 0x15, 0x52,
1655 0x36, 0x6C, 0x4B, 0x58, 0x44, 0xA7, 0xEB, 0x20, 0x78, 0x6E,
1656 0x7E, 0xE8, 0x00, 0x40, 0xAC, 0x98, 0xD8, 0x53, 0xF3, 0x13,
1657 0x4B, 0xB8, 0x98, 0x66, 0x50, 0x63, 0xED, 0xAF, 0xE5, 0xA4,
1658 0xF6, 0xC9, 0x90, 0x1C, 0x84, 0x0A, 0x09, 0x45, 0x2F, 0xA1,
1659 0xE1, 0x37, 0x63, 0xB5, 0x43, 0x8C, 0xA0, 0x2E, 0x7F, 0xC4,
1660 0xD4, 0xE1, 0xAE, 0xB7, 0xB9, 0x45, 0x13, 0xF8, 0x70, 0xD5,
1661 0x79, 0x06, 0x4F, 0x82, 0x83, 0x4B, 0x98, 0xD7, 0x56, 0x47,
1662 0x64, 0x9A, 0x6A, 0x6D, 0x8E, 0x7A, 0x9D, 0xEF, 0x83, 0x0F,
1663 0x6B, 0x75, 0x0E, 0x47, 0x22, 0x92, 0xF3, 0xB4, 0xB2, 0x84,
1664 0x61, 0x1F, 0x1C
1665 };
1666 static const int sizeof_ca_cert_der_2048 = sizeof(ca_cert_der_2048);
1667
1668 /* ./certs/ca-cert-chain.der, 2048-bit */
1669 static const unsigned char ca_cert_chain_der[] =
1670 {
1671 0x30, 0x82, 0x03, 0xFA, 0x30, 0x82, 0x03, 0x63, 0xA0, 0x03,
1672 0x02, 0x01, 0x02, 0x02, 0x14, 0x5D, 0x57, 0xA7, 0x0C, 0xC4,
1673 0xFB, 0xD4, 0x5B, 0x3B, 0xB4, 0x58, 0x07, 0x2B, 0xDE, 0xD8,
1674 0xB5, 0xDF, 0xB6, 0x76, 0xCC, 0x30, 0x0D, 0x06, 0x09, 0x2A,
1675 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
1676 0x30, 0x81, 0x94, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55,
1677 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E,
1678 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E,
1679 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,

NetBurner, Inc.
22.205 certs_test.h 1113

1680 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D,
1681 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04,
1682 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74,
1683 0x68, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0B,
1684 0x0C, 0x0A, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69,
1685 0x6E, 0x67, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
1686 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
1687 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
1688 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
1689 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
1690 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
1691 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
1692 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
1693 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
1694 0x32, 0x34, 0x5A, 0x30, 0x81, 0x94, 0x31, 0x0B, 0x30, 0x09,
1695 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
1696 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
1697 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
1698 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
1699 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06,
1700 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74,
1701 0x6F, 0x6F, 0x74, 0x68, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
1702 0x55, 0x04, 0x0B, 0x0C, 0x0A, 0x43, 0x6F, 0x6E, 0x73, 0x75,
1703 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x31, 0x18, 0x30, 0x16, 0x06,
1704 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
1705 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
1706 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
1707 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
1708 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
1709 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06,
1710 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01,
1711 0x05, 0x00, 0x03, 0x81, 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02,
1712 0x81, 0x81, 0x00, 0xCD, 0xAC, 0xDD, 0x47, 0xEC, 0xBE, 0xB7,
1713 0x24, 0xC3, 0x63, 0x1B, 0x54, 0x98, 0x79, 0xE1, 0xC7, 0x31,
1714 0x16, 0x59, 0xD6, 0x9D, 0x77, 0x9D, 0x8D, 0xE2, 0x8B, 0xED,
1715 0x04, 0x17, 0xB2, 0xC6, 0xEB, 0xE4, 0x9B, 0x91, 0xBE, 0x31,
1716 0x50, 0x62, 0x97, 0x58, 0xB5, 0x7F, 0x29, 0xDE, 0xB3, 0x71,
1717 0x24, 0x0B, 0xBF, 0x97, 0x09, 0x7F, 0x26, 0xDC, 0x2D, 0xEC,
1718 0xA8, 0x2E, 0xB2, 0x64, 0x2B, 0x7A, 0x2B, 0x35, 0x19, 0x2D,
1719 0xA2, 0x80, 0xCB, 0x99, 0xFD, 0x94, 0x71, 0x1B, 0x23, 0x8D,
1720 0x54, 0xDB, 0x2E, 0x62, 0x8D, 0x81, 0x08, 0x2D, 0xF4, 0x24,
1721 0x72, 0x27, 0x6C, 0xF9, 0xC9, 0x8E, 0xDB, 0x4C, 0x75, 0xBA,
1722 0x9B, 0x01, 0xF8, 0x3F, 0x18, 0xF4, 0xE6, 0x7F, 0xFB, 0x57,
1723 0x94, 0x92, 0xCC, 0x88, 0xC4, 0xB4, 0x00, 0xC2, 0xAA, 0xD4,
1724 0xE5, 0x88, 0x18, 0xB3, 0x11, 0x2F, 0x73, 0xC0, 0xD6, 0x29,
1725 0x09, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82, 0x01, 0x45,
1726 0x30, 0x82, 0x01, 0x41, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
1727 0x0E, 0x04, 0x16, 0x04, 0x14, 0xD3, 0x22, 0x8F, 0x28, 0x2C,
1728 0xE0, 0x05, 0xEE, 0xD3, 0xED, 0xC3, 0x71, 0x3D, 0xC9, 0xB2,
1729 0x36, 0x3A, 0x1D, 0xBF, 0xA8, 0x30, 0x81, 0xD4, 0x06, 0x03,
1730 0x55, 0x1D, 0x23, 0x04, 0x81, 0xCC, 0x30, 0x81, 0xC9, 0x80,
1731 0x14, 0xD3, 0x22, 0x8F, 0x28, 0x2C, 0xE0, 0x05, 0xEE, 0xD3,
1732 0xED, 0xC3, 0x71, 0x3D, 0xC9, 0xB2, 0x36, 0x3A, 0x1D, 0xBF,
1733 0xA8, 0xA1, 0x81, 0x9A, 0xA4, 0x81, 0x97, 0x30, 0x81, 0x94,
1734 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
1735 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
1736 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E,
1737 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07,
1738 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31,
1739 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x08,
1740 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74, 0x68, 0x31, 0x13,
1741 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0A, 0x43,
1742 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x31,
1743 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F,
1744 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73,
1745 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06,
1746 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01,
1747 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C,
1748 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14,
1749 0x5D, 0x57, 0xA7, 0x0C, 0xC4, 0xFB, 0xD4, 0x5B, 0x3B, 0xB4,
1750 0x58, 0x07, 0x2B, 0xDE, 0xD8, 0xB5, 0xDF, 0xB6, 0x76, 0xCC,
1751 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30,
1752 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x1D,
1753 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65, 0x78, 0x61,
1754 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x87, 0x04,
1755 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
1756 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, 0x01,
1757 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01,
1758 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06, 0x09, 0x2A,
1759 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
1760 0x03, 0x81, 0x81, 0x00, 0x59, 0xB7, 0xAF, 0x2A, 0xEB, 0x53,
1761 0x34, 0x87, 0xCE, 0x90, 0x50, 0x95, 0x50, 0x14, 0x0D, 0x54,
1762 0x73, 0x30, 0x04, 0x6A, 0x91, 0x3A, 0x82, 0xD3, 0xA0, 0xFD,
1763 0x4F, 0xCA, 0x30, 0x66, 0x1E, 0xF3, 0x1E, 0x4F, 0x6A, 0x10,
1764 0x91, 0x7E, 0x9F, 0x37, 0x5B, 0x82, 0x6A, 0x76, 0xAB, 0x46,
1765 0xE7, 0x61, 0x56, 0x11, 0x45, 0x60, 0x9D, 0x57, 0x77, 0xA9,
1766 0x6B, 0xF9, 0x25, 0x75, 0x0C, 0xC2, 0x3C, 0x87, 0xC7, 0x88,

NetBurner, Inc.
1114 File Documentation

1767 0x51, 0x08, 0x63, 0xC8, 0x39, 0xAA, 0x6F, 0xD3, 0x72, 0x36,
1768 0x2A, 0x7F, 0x3E, 0x69, 0x8A, 0xB7, 0xBE, 0x0E, 0xB3, 0x61,
1769 0x1E, 0xA6, 0x38, 0x35, 0x6C, 0xA8, 0x22, 0x74, 0x75, 0x6B,
1770 0x35, 0x79, 0x72, 0x5E, 0x90, 0x7F, 0x9B, 0x45, 0x7E, 0x62,
1771 0xFB, 0x9C, 0xD6, 0x54, 0x64, 0x2B, 0xD6, 0xAA, 0xF3, 0xF0,
1772 0x4C, 0x83, 0x98, 0xA7, 0xC8, 0x99, 0x5F, 0x15, 0xB9, 0xF5,
1773 0x17, 0x32
1774 };
1775 static const int sizeof_ca_cert_chain_der = sizeof(ca_cert_chain_der);
1776
1777 /* ./certs/server-key.der, 2048-bit */
1778 static const unsigned char server_key_der_2048[] =
1779 {
1780 0x30, 0x82, 0x04, 0xA5, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
1781 0x01, 0x00, 0xC0, 0x95, 0x08, 0xE1, 0x57, 0x41, 0xF2, 0x71,
1782 0x6D, 0xB7, 0xD2, 0x45, 0x41, 0x27, 0x01, 0x65, 0xC6, 0x45,
1783 0xAE, 0xF2, 0xBC, 0x24, 0x30, 0xB8, 0x95, 0xCE, 0x2F, 0x4E,
1784 0xD6, 0xF6, 0x1C, 0x88, 0xBC, 0x7C, 0x9F, 0xFB, 0xA8, 0x67,
1785 0x7F, 0xFE, 0x5C, 0x9C, 0x51, 0x75, 0xF7, 0x8A, 0xCA, 0x07,
1786 0xE7, 0x35, 0x2F, 0x8F, 0xE1, 0xBD, 0x7B, 0xC0, 0x2F, 0x7C,
1787 0xAB, 0x64, 0xA8, 0x17, 0xFC, 0xCA, 0x5D, 0x7B, 0xBA, 0xE0,
1788 0x21, 0xE5, 0x72, 0x2E, 0x6F, 0x2E, 0x86, 0xD8, 0x95, 0x73,
1789 0xDA, 0xAC, 0x1B, 0x53, 0xB9, 0x5F, 0x3F, 0xD7, 0x19, 0x0D,
1790 0x25, 0x4F, 0xE1, 0x63, 0x63, 0x51, 0x8B, 0x0B, 0x64, 0x3F,
1791 0xAD, 0x43, 0xB8, 0xA5, 0x1C, 0x5C, 0x34, 0xB3, 0xAE, 0x00,
1792 0xA0, 0x63, 0xC5, 0xF6, 0x7F, 0x0B, 0x59, 0x68, 0x78, 0x73,
1793 0xA6, 0x8C, 0x18, 0xA9, 0x02, 0x6D, 0xAF, 0xC3, 0x19, 0x01,
1794 0x2E, 0xB8, 0x10, 0xE3, 0xC6, 0xCC, 0x40, 0xB4, 0x69, 0xA3,
1795 0x46, 0x33, 0x69, 0x87, 0x6E, 0xC4, 0xBB, 0x17, 0xA6, 0xF3,
1796 0xE8, 0xDD, 0xAD, 0x73, 0xBC, 0x7B, 0x2F, 0x21, 0xB5, 0xFD,
1797 0x66, 0x51, 0x0C, 0xBD, 0x54, 0xB3, 0xE1, 0x6D, 0x5F, 0x1C,
1798 0xBC, 0x23, 0x73, 0xD1, 0x09, 0x03, 0x89, 0x14, 0xD2, 0x10,
1799 0xB9, 0x64, 0xC3, 0x2A, 0xD0, 0xA1, 0x96, 0x4A, 0xBC, 0xE1,
1800 0xD4, 0x1A, 0x5B, 0xC7, 0xA0, 0xC0, 0xC1, 0x63, 0x78, 0x0F,
1801 0x44, 0x37, 0x30, 0x32, 0x96, 0x80, 0x32, 0x23, 0x95, 0xA1,
1802 0x77, 0xBA, 0x13, 0xD2, 0x97, 0x73, 0xE2, 0x5D, 0x25, 0xC9,
1803 0x6A, 0x0D, 0xC3, 0x39, 0x60, 0xA4, 0xB4, 0xB0, 0x69, 0x42,
1804 0x42, 0x09, 0xE9, 0xD8, 0x08, 0xBC, 0x33, 0x20, 0xB3, 0x58,
1805 0x22, 0xA7, 0xAA, 0xEB, 0xC4, 0xE1, 0xE6, 0x61, 0x83, 0xC5,
1806 0xD2, 0x96, 0xDF, 0xD9, 0xD0, 0x4F, 0xAD, 0xD7, 0x02, 0x03,
1807 0x01, 0x00, 0x01, 0x02, 0x82, 0x01, 0x01, 0x00, 0x9A, 0xD0,
1808 0x34, 0x0F, 0x52, 0x62, 0x05, 0x50, 0x01, 0xEF, 0x9F, 0xED,
1809 0x64, 0x6E, 0xC2, 0xC4, 0xDA, 0x1A, 0xF2, 0x84, 0xD7, 0x92,
1810 0x10, 0x48, 0x92, 0xC4, 0xE9, 0x6A, 0xEB, 0x8B, 0x75, 0x6C,
1811 0xC6, 0x79, 0x38, 0xF2, 0xC9, 0x72, 0x4A, 0x86, 0x64, 0x54,
1812 0x95, 0x77, 0xCB, 0xC3, 0x9A, 0x9D, 0xB7, 0xD4, 0x1D, 0xA4,
1813 0x00, 0xC8, 0x9E, 0x4E, 0xE4, 0xDD, 0xC7, 0xBA, 0x67, 0x16,
1814 0xC1, 0x74, 0xBC, 0xA9, 0xD6, 0x94, 0x8F, 0x2B, 0x30, 0x1A,
1815 0xFB, 0xED, 0xDF, 0x21, 0x05, 0x23, 0xD9, 0x4A, 0x39, 0xBD,
1816 0x98, 0x6B, 0x65, 0x9A, 0xB8, 0xDC, 0xC4, 0x7D, 0xEE, 0xA6,
1817 0x43, 0x15, 0x2E, 0x3D, 0xBE, 0x1D, 0x22, 0x60, 0x2A, 0x73,
1818 0x30, 0xD5, 0x3E, 0xD8, 0xA2, 0xAC, 0x86, 0x43, 0x2E, 0xC4,
1819 0xF5, 0x64, 0x5E, 0x3F, 0x89, 0x75, 0x0F, 0x11, 0xD8, 0x51,
1820 0x25, 0x4E, 0x9F, 0xD8, 0xAA, 0xA3, 0xCE, 0x60, 0xB3, 0xE2,
1821 0x8A, 0xD9, 0x7E, 0x1B, 0xF0, 0x64, 0xCA, 0x9A, 0x5B, 0x05,
1822 0x0B, 0x5B, 0xAA, 0xCB, 0xE5, 0xE3, 0x3F, 0x6E, 0x32, 0x22,
1823 0x05, 0xF3, 0xD0, 0xFA, 0xEF, 0x74, 0x52, 0x81, 0xE2, 0x5F,
1824 0x74, 0xD3, 0xBD, 0xFF, 0x31, 0x83, 0x45, 0x75, 0xFA, 0x63,
1825 0x7A, 0x97, 0x2E, 0xD6, 0xB6, 0x19, 0xC6, 0x92, 0x26, 0xE4,
1826 0x28, 0x06, 0x50, 0x50, 0x0E, 0x78, 0x2E, 0xA9, 0x78, 0x0D,
1827 0x14, 0x97, 0xB4, 0x12, 0xD8, 0x31, 0x40, 0xAB, 0xA1, 0x01,
1828 0x41, 0xC2, 0x30, 0xF8, 0x07, 0x5F, 0x16, 0xE4, 0x61, 0x77,
1829 0xD2, 0x60, 0xF2, 0x9F, 0x8D, 0xE8, 0xF4, 0xBA, 0xEB, 0x63,
1830 0xDE, 0x2A, 0x97, 0x81, 0xEF, 0x4C, 0x6C, 0xE6, 0x55, 0x34,
1831 0x51, 0x2B, 0x28, 0x34, 0xF4, 0x53, 0x1C, 0xC4, 0x58, 0x0A,
1832 0x3F, 0xBB, 0xAF, 0xB5, 0xF7, 0x4A, 0x85, 0x43, 0x2D, 0x3C,
1833 0xF1, 0x58, 0x58, 0x81, 0x02, 0x81, 0x81, 0x00, 0xF2, 0x2C,
1834 0x54, 0x76, 0x39, 0x23, 0x63, 0xC9, 0x10, 0x32, 0xB7, 0x93,
1835 0xAD, 0xAF, 0xBE, 0x19, 0x75, 0x96, 0x81, 0x64, 0xE6, 0xB5,
1836 0xB8, 0x89, 0x42, 0x41, 0xD1, 0x6D, 0xD0, 0x1C, 0x1B, 0xF8,
1837 0x1B, 0xAC, 0x69, 0xCB, 0x36, 0x3C, 0x64, 0x7D, 0xDC, 0xF4,
1838 0x19, 0xB8, 0xC3, 0x60, 0xB1, 0x57, 0x48, 0x5F, 0x52, 0x4F,
1839 0x59, 0x3A, 0x55, 0x7F, 0x32, 0xC0, 0x19, 0x43, 0x50, 0x3F,
1840 0xAE, 0xCE, 0x6F, 0x17, 0xF3, 0x0E, 0x9F, 0x40, 0xCA, 0x4E,
1841 0xAD, 0x15, 0x3B, 0xC9, 0x79, 0xE9, 0xC0, 0x59, 0x38, 0x73,
1842 0x70, 0x9C, 0x0A, 0x7C, 0xC9, 0x3A, 0x48, 0x32, 0xA7, 0xD8,
1843 0x49, 0x75, 0x0A, 0x85, 0xC2, 0xC2, 0xFD, 0x15, 0x73, 0xDA,
1844 0x99, 0x09, 0x2A, 0x69, 0x9A, 0x9F, 0x0A, 0x71, 0xBF, 0xB0,
1845 0x04, 0xA6, 0x8C, 0x7A, 0x5A, 0x6F, 0x48, 0x5A, 0x54, 0x3B,
1846 0xC6, 0xB1, 0x53, 0x17, 0xDF, 0xE7, 0x02, 0x81, 0x81, 0x00,
1847 0xCB, 0x93, 0xDE, 0x77, 0x15, 0x5D, 0xB7, 0x5C, 0x5C, 0x7C,
1848 0xD8, 0x90, 0xA9, 0x98, 0x2D, 0xD6, 0x69, 0x0E, 0x63, 0xB3,
1849 0xA3, 0xDC, 0xA6, 0xCC, 0x8B, 0x6A, 0xA4, 0xA2, 0x12, 0x8C,
1850 0x8E, 0x7B, 0x48, 0x2C, 0xB2, 0x4B, 0x37, 0xDC, 0x06, 0x18,
1851 0x7D, 0xEA, 0xFE, 0x76, 0xA1, 0xD4, 0xA1, 0xE9, 0x3F, 0x0D,
1852 0xCD, 0x1B, 0x5F, 0xAF, 0x5F, 0x9E, 0x96, 0x5B, 0x5B, 0x0F,
1853 0xA1, 0x7C, 0xAF, 0xB3, 0x9B, 0x90, 0xDB, 0x57, 0x73, 0x3A,

NetBurner, Inc.
22.205 certs_test.h 1115

1854 0xED, 0xB0, 0x23, 0x44, 0xAE, 0x41, 0x4F, 0x1F, 0x07, 0x42,
1855 0x13, 0x23, 0x4C, 0xCB, 0xFA, 0xF4, 0x14, 0xA4, 0xD5, 0xF7,
1856 0x9E, 0x36, 0x7C, 0x5B, 0x9F, 0xA8, 0x3C, 0xC1, 0x85, 0x5F,
1857 0x74, 0xD2, 0x39, 0x2D, 0xFF, 0xD0, 0x84, 0xDF, 0xFB, 0xB3,
1858 0x20, 0x7A, 0x2E, 0x9B, 0x17, 0xAE, 0xE6, 0xBA, 0x0B, 0xAE,
1859 0x5F, 0x53, 0xA4, 0x52, 0xED, 0x1B, 0xC4, 0x91, 0x02, 0x81,
1860 0x81, 0x00, 0xEC, 0x98, 0xDA, 0xBB, 0xD5, 0xFE, 0xF9, 0x52,
1861 0x4A, 0x7D, 0x02, 0x55, 0x49, 0x6F, 0x55, 0x6E, 0x52, 0x2F,
1862 0x84, 0xA3, 0x2B, 0xB3, 0x86, 0x62, 0xB3, 0x54, 0xD2, 0x63,
1863 0x52, 0xDA, 0xE3, 0x88, 0x76, 0xA0, 0xEF, 0x8B, 0x15, 0xA5,
1864 0xD3, 0x18, 0x14, 0x72, 0x77, 0x5E, 0xC7, 0xA3, 0x04, 0x1F,
1865 0x9E, 0x19, 0x62, 0xB5, 0x1B, 0x1B, 0x9E, 0xC3, 0xF2, 0xB5,
1866 0x32, 0xF9, 0x4C, 0xC1, 0xAA, 0xEB, 0x0C, 0x26, 0x7D, 0xD4,
1867 0x5F, 0x4A, 0x51, 0x5C, 0xA4, 0x45, 0x06, 0x70, 0x44, 0xA7,
1868 0x56, 0xC0, 0xD4, 0x22, 0x14, 0x76, 0x9E, 0xD8, 0x63, 0x50,
1869 0x89, 0x90, 0xD3, 0xE2, 0xBF, 0x81, 0x95, 0x92, 0x31, 0x41,
1870 0x87, 0x39, 0x1A, 0x43, 0x0B, 0x18, 0xA5, 0x53, 0x1F, 0x39,
1871 0x1A, 0x5F, 0x1F, 0x43, 0xBC, 0x87, 0x6A, 0xDF, 0x6E, 0xD3,
1872 0x22, 0x00, 0xFE, 0x22, 0x98, 0x70, 0x4E, 0x1A, 0x19, 0x29,
1873 0x02, 0x81, 0x81, 0x00, 0x8A, 0x41, 0x56, 0x28, 0x51, 0x9E,
1874 0x5F, 0xD4, 0x9E, 0x0B, 0x3B, 0x98, 0xA3, 0x54, 0xF2, 0x6C,
1875 0x56, 0xD4, 0xAA, 0xE9, 0x69, 0x33, 0x85, 0x24, 0x0C, 0xDA,
1876 0xD4, 0x0C, 0x2D, 0xC4, 0xBF, 0x4F, 0x02, 0x69, 0x38, 0x7C,
1877 0xD4, 0xE6, 0xDC, 0x4C, 0xED, 0xD7, 0x16, 0x11, 0xC3, 0x3E,
1878 0x00, 0xE7, 0xC3, 0x26, 0xC0, 0x51, 0x02, 0xDE, 0xBB, 0x75,
1879 0x9C, 0x6F, 0x56, 0x9C, 0x7A, 0xF3, 0x8E, 0xEF, 0xCF, 0x8A,
1880 0xC5, 0x2B, 0xD2, 0xDA, 0x06, 0x6A, 0x44, 0xC9, 0x73, 0xFE,
1881 0x6E, 0x99, 0x87, 0xF8, 0x5B, 0xBE, 0xF1, 0x7C, 0xE6, 0x65,
1882 0xB5, 0x4F, 0x6C, 0xF0, 0xC9, 0xC5, 0xFF, 0x16, 0xCA, 0x8B,
1883 0x1B, 0x17, 0xE2, 0x58, 0x3D, 0xA2, 0x37, 0xAB, 0x01, 0xBC,
1884 0xBF, 0x40, 0xCE, 0x53, 0x8C, 0x8E, 0xED, 0xEF, 0xEE, 0x59,
1885 0x9D, 0xE0, 0x63, 0xE6, 0x7C, 0x5E, 0xF5, 0x8E, 0x4B, 0xF1,
1886 0x3B, 0xC1, 0x02, 0x81, 0x80, 0x4D, 0x45, 0xF9, 0x40, 0x8C,
1887 0xC5, 0x5B, 0xF4, 0x2A, 0x1A, 0x8A, 0xB4, 0xF2, 0x1C, 0xAC,
1888 0x6B, 0xE9, 0x0C, 0x56, 0x36, 0xB7, 0x4E, 0x72, 0x96, 0xD5,
1889 0xE5, 0x8A, 0xD2, 0xE2, 0xFF, 0xF1, 0xF1, 0x18, 0x13, 0x3D,
1890 0x86, 0x09, 0xB8, 0xD8, 0x76, 0xA7, 0xC9, 0x1C, 0x71, 0x52,
1891 0x94, 0x30, 0x43, 0xE0, 0xF1, 0x78, 0x74, 0xFD, 0x61, 0x1B,
1892 0x4C, 0x09, 0xCC, 0xE6, 0x68, 0x2A, 0x71, 0xAD, 0x1C, 0xDF,
1893 0x43, 0xBC, 0x56, 0xDB, 0xA5, 0xA4, 0xBE, 0x35, 0x70, 0xA4,
1894 0x5E, 0xCF, 0x4F, 0xFC, 0x00, 0x55, 0x99, 0x3A, 0x3D, 0x23,
1895 0xCF, 0x67, 0x5A, 0xF5, 0x22, 0xF8, 0xB5, 0x29, 0xD0, 0x44,
1896 0x11, 0xEB, 0x35, 0x2E, 0x46, 0xBE, 0xFD, 0x8E, 0x18, 0xB2,
1897 0x5F, 0xA8, 0xBF, 0x19, 0x32, 0xA1, 0xF5, 0xDC, 0x03, 0xE6,
1898 0x7C, 0x9A, 0x1F, 0x0C, 0x7C, 0xA9, 0xB0, 0x0E, 0x21, 0x37,
1899 0x3B, 0xF1, 0xB0
1900 };
1901 static const int sizeof_server_key_der_2048 = sizeof(server_key_der_2048);
1902
1903 /* ./certs/server-cert.der, 2048-bit */
1904 static const unsigned char server_cert_der_2048[] =
1905 {
1906 0x30, 0x82, 0x04, 0xE8, 0x30, 0x82, 0x03, 0xD0, 0xA0, 0x03,
1907 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x0D, 0x06, 0x09,
1908 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05,
1909 0x00, 0x30, 0x81, 0x94, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03,
1910 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30,
1911 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F,
1912 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06,
1913 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65,
1914 0x6D, 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55,
1915 0x04, 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F,
1916 0x74, 0x68, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
1917 0x0B, 0x0C, 0x0A, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74,
1918 0x69, 0x6E, 0x67, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55,
1919 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F,
1920 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31,
1921 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
1922 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F,
1923 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63,
1924 0x6F, 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32,
1925 0x31, 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17,
1926 0x0D, 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35,
1927 0x30, 0x32, 0x34, 0x5A, 0x30, 0x81, 0x90, 0x31, 0x0B, 0x30,
1928 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
1929 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C,
1930 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10,
1931 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42,
1932 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x10, 0x30, 0x0E,
1933 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x07, 0x77, 0x6F, 0x6C,
1934 0x66, 0x53, 0x53, 0x4C, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
1935 0x55, 0x04, 0x0B, 0x0C, 0x07, 0x53, 0x75, 0x70, 0x70, 0x6F,
1936 0x72, 0x74, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
1937 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
1938 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
1939 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
1940 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,

NetBurner, Inc.
1116 File Documentation

1941 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
1942 0x6D, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A,
1943 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00,
1944 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30, 0x82, 0x01, 0x0A, 0x02,
1945 0x82, 0x01, 0x01, 0x00, 0xC0, 0x95, 0x08, 0xE1, 0x57, 0x41,
1946 0xF2, 0x71, 0x6D, 0xB7, 0xD2, 0x45, 0x41, 0x27, 0x01, 0x65,
1947 0xC6, 0x45, 0xAE, 0xF2, 0xBC, 0x24, 0x30, 0xB8, 0x95, 0xCE,
1948 0x2F, 0x4E, 0xD6, 0xF6, 0x1C, 0x88, 0xBC, 0x7C, 0x9F, 0xFB,
1949 0xA8, 0x67, 0x7F, 0xFE, 0x5C, 0x9C, 0x51, 0x75, 0xF7, 0x8A,
1950 0xCA, 0x07, 0xE7, 0x35, 0x2F, 0x8F, 0xE1, 0xBD, 0x7B, 0xC0,
1951 0x2F, 0x7C, 0xAB, 0x64, 0xA8, 0x17, 0xFC, 0xCA, 0x5D, 0x7B,
1952 0xBA, 0xE0, 0x21, 0xE5, 0x72, 0x2E, 0x6F, 0x2E, 0x86, 0xD8,
1953 0x95, 0x73, 0xDA, 0xAC, 0x1B, 0x53, 0xB9, 0x5F, 0x3F, 0xD7,
1954 0x19, 0x0D, 0x25, 0x4F, 0xE1, 0x63, 0x63, 0x51, 0x8B, 0x0B,
1955 0x64, 0x3F, 0xAD, 0x43, 0xB8, 0xA5, 0x1C, 0x5C, 0x34, 0xB3,
1956 0xAE, 0x00, 0xA0, 0x63, 0xC5, 0xF6, 0x7F, 0x0B, 0x59, 0x68,
1957 0x78, 0x73, 0xA6, 0x8C, 0x18, 0xA9, 0x02, 0x6D, 0xAF, 0xC3,
1958 0x19, 0x01, 0x2E, 0xB8, 0x10, 0xE3, 0xC6, 0xCC, 0x40, 0xB4,
1959 0x69, 0xA3, 0x46, 0x33, 0x69, 0x87, 0x6E, 0xC4, 0xBB, 0x17,
1960 0xA6, 0xF3, 0xE8, 0xDD, 0xAD, 0x73, 0xBC, 0x7B, 0x2F, 0x21,
1961 0xB5, 0xFD, 0x66, 0x51, 0x0C, 0xBD, 0x54, 0xB3, 0xE1, 0x6D,
1962 0x5F, 0x1C, 0xBC, 0x23, 0x73, 0xD1, 0x09, 0x03, 0x89, 0x14,
1963 0xD2, 0x10, 0xB9, 0x64, 0xC3, 0x2A, 0xD0, 0xA1, 0x96, 0x4A,
1964 0xBC, 0xE1, 0xD4, 0x1A, 0x5B, 0xC7, 0xA0, 0xC0, 0xC1, 0x63,
1965 0x78, 0x0F, 0x44, 0x37, 0x30, 0x32, 0x96, 0x80, 0x32, 0x23,
1966 0x95, 0xA1, 0x77, 0xBA, 0x13, 0xD2, 0x97, 0x73, 0xE2, 0x5D,
1967 0x25, 0xC9, 0x6A, 0x0D, 0xC3, 0x39, 0x60, 0xA4, 0xB4, 0xB0,
1968 0x69, 0x42, 0x42, 0x09, 0xE9, 0xD8, 0x08, 0xBC, 0x33, 0x20,
1969 0xB3, 0x58, 0x22, 0xA7, 0xAA, 0xEB, 0xC4, 0xE1, 0xE6, 0x61,
1970 0x83, 0xC5, 0xD2, 0x96, 0xDF, 0xD9, 0xD0, 0x4F, 0xAD, 0xD7,
1971 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82, 0x01, 0x45, 0x30,
1972 0x82, 0x01, 0x41, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E,
1973 0x04, 0x16, 0x04, 0x14, 0xB3, 0x11, 0x32, 0xC9, 0x92, 0x98,
1974 0x84, 0xE2, 0xC9, 0xF8, 0xD0, 0x3B, 0x6E, 0x03, 0x42, 0xCA,
1975 0x1F, 0x0E, 0x8E, 0x3C, 0x30, 0x81, 0xD4, 0x06, 0x03, 0x55,
1976 0x1D, 0x23, 0x04, 0x81, 0xCC, 0x30, 0x81, 0xC9, 0x80, 0x14,
1977 0x27, 0x8E, 0x67, 0x11, 0x74, 0xC3, 0x26, 0x1D, 0x3F, 0xED,
1978 0x33, 0x63, 0xB3, 0xA4, 0xD8, 0x1D, 0x30, 0xE5, 0xE8, 0xD5,
1979 0xA1, 0x81, 0x9A, 0xA4, 0x81, 0x97, 0x30, 0x81, 0x94, 0x31,
1980 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
1981 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04,
1982 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61,
1983 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C,
1984 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x11,
1985 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x08, 0x53,
1986 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74, 0x68, 0x31, 0x13, 0x30,
1987 0x11, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0A, 0x43, 0x6F,
1988 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x31, 0x18,
1989 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77,
1990 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
1991 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09,
1992 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16,
1993 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66,
1994 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x26,
1995 0x8C, 0x93, 0xF9, 0xF9, 0xF4, 0x1E, 0xB3, 0x01, 0x72, 0x94,
1996 0x55, 0x67, 0x6D, 0xE2, 0xF8, 0x3D, 0xDA, 0xE9, 0xF4, 0x30,
1997 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30, 0x03,
1998 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x1D, 0x11,
1999 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65, 0x78, 0x61, 0x6D,
2000 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x87, 0x04, 0x7F,
2001 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x25,
2002 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05,
2003 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05,
2004 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86,
2005 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03,
2006 0x82, 0x01, 0x01, 0x00, 0x4B, 0x88, 0x54, 0xA8, 0x57, 0xF0,
2007 0x62, 0x4D, 0xB3, 0xC5, 0x8C, 0xD2, 0x02, 0x0A, 0x89, 0x19,
2008 0x45, 0x63, 0x8E, 0x37, 0x5C, 0xA9, 0xF7, 0x8C, 0xC5, 0x7C,
2009 0x9D, 0x19, 0xB4, 0x5D, 0xB6, 0xA4, 0x29, 0x4D, 0x97, 0xDA,
2010 0x6E, 0x3C, 0x27, 0xEC, 0x02, 0x5C, 0xFB, 0xE2, 0x93, 0x6F,
2011 0xB6, 0x1A, 0xDC, 0x5E, 0x25, 0x1F, 0xBE, 0xAB, 0x6F, 0x37,
2012 0xFF, 0xD6, 0x98, 0x67, 0x7C, 0xF7, 0x53, 0x84, 0x3B, 0xE6,
2013 0xF7, 0x22, 0xEF, 0x52, 0xB0, 0x8F, 0x9D, 0x4E, 0x2F, 0x41,
2014 0x2A, 0x7D, 0x2F, 0xF8, 0x02, 0x1E, 0xF5, 0xCD, 0x9A, 0xB2,
2015 0x68, 0x68, 0xD6, 0xEF, 0xED, 0x6A, 0x96, 0xA0, 0x84, 0x6F,
2016 0x0C, 0x5E, 0x7B, 0x44, 0xF9, 0x6F, 0xD0, 0x00, 0x6F, 0xDD,
2017 0x83, 0x6A, 0xD9, 0xD9, 0x17, 0x9D, 0x32, 0x9A, 0xEA, 0x4B,
2018 0x87, 0xF9, 0x12, 0x45, 0x3E, 0xB8, 0xDE, 0x20, 0xFE, 0xF4,
2019 0xB8, 0x3F, 0xF4, 0x99, 0x61, 0xA6, 0x2B, 0x97, 0x1B, 0x7C,
2020 0xA0, 0x90, 0xCF, 0xE9, 0x3B, 0xCD, 0x94, 0xCE, 0x85, 0xDF,
2021 0xFB, 0x6A, 0x2B, 0x67, 0x5B, 0x8C, 0x28, 0xDE, 0xE6, 0x0B,
2022 0x4B, 0x68, 0x5B, 0xB3, 0x4A, 0x3E, 0x10, 0x3B, 0x0C, 0xD8,
2023 0xC8, 0xF1, 0x3E, 0x3D, 0xCC, 0x2F, 0x16, 0x76, 0x24, 0x43,
2024 0xB6, 0x3B, 0xFD, 0xCF, 0x2F, 0x07, 0x0F, 0x15, 0x31, 0x59,
2025 0x5E, 0xCD, 0x84, 0xA9, 0x82, 0x05, 0x1F, 0x0C, 0x97, 0x56,
2026 0x5D, 0x90, 0x49, 0xBD, 0x84, 0x47, 0xEC, 0x07, 0xB9, 0xCF,
2027 0xFA, 0xA0, 0x56, 0x9B, 0xAE, 0xE2, 0xA9, 0x96, 0xB2, 0x62,

NetBurner, Inc.
22.205 certs_test.h 1117

2028 0x02, 0x4A, 0xFA, 0x42, 0xD5, 0x23, 0xDC, 0x1C, 0x6B, 0x5C,
2029 0x41, 0x3D, 0xF2, 0x73, 0xE8, 0xED, 0x32, 0x93, 0xCC, 0xF7,
2030 0x02, 0x5A, 0xB4, 0xBE, 0x84, 0xCA, 0x73, 0x26, 0x9F, 0x03,
2031 0x2C, 0xB3, 0x74, 0x96, 0x20, 0x7E, 0x12, 0xEA, 0xE5, 0xEF
2032
2033 };
2034 static const int sizeof_server_cert_der_2048 = sizeof(server_cert_der_2048);
2035
2036 #endif /* USE_CERT_BUFFERS_2048 */
2037
2038 #ifdef USE_CERT_BUFFERS_3072
2039
2040 /* ./certs/dh3072.der, 3072-bit */
2041 static const unsigned char dh_key_der_3072[] =
2042 {
2043 0x30, 0x82, 0x01, 0x88, 0x02, 0x82, 0x01, 0x81, 0x00, 0x89,
2044 0x1B, 0x75, 0x3F, 0x84, 0xB6, 0x11, 0xED, 0x21, 0xF1, 0x08,
2045 0x0F, 0xB8, 0x06, 0xC9, 0xA3, 0xC9, 0x41, 0xDB, 0x5A, 0xC8,
2046 0xF8, 0x82, 0x73, 0x0F, 0xEB, 0x89, 0x1E, 0x54, 0x18, 0xBE,
2047 0xE6, 0x48, 0x41, 0x9E, 0xFA, 0xC2, 0x0C, 0x50, 0x67, 0xC3,
2048 0x5D, 0xB5, 0xF5, 0x0F, 0x23, 0x6A, 0x43, 0x33, 0x91, 0xD9,
2049 0x40, 0xF3, 0x66, 0xC6, 0x99, 0xFF, 0x97, 0xB6, 0x7B, 0xAF,
2050 0x27, 0x72, 0x3B, 0x9F, 0x7E, 0x58, 0x18, 0x14, 0x9F, 0x91,
2051 0x6E, 0x2B, 0x11, 0xC1, 0x57, 0x49, 0x27, 0x36, 0x78, 0xE1,
2052 0x09, 0x68, 0x9C, 0x05, 0x5A, 0xAC, 0xE6, 0x00, 0x38, 0xBE,
2053 0x95, 0x74, 0x81, 0x53, 0x28, 0xF0, 0xAD, 0xDF, 0xB5, 0x87,
2054 0x1C, 0x72, 0x17, 0x4E, 0xEC, 0x00, 0x91, 0x22, 0xAA, 0xE4,
2055 0x88, 0xD7, 0xF5, 0x3D, 0x1F, 0x03, 0x13, 0x2D, 0x1C, 0xFB,
2056 0xDE, 0x59, 0x68, 0xAD, 0xE0, 0x17, 0xA1, 0xEE, 0x8D, 0xCC,
2057 0xBF, 0xFE, 0xCF, 0x24, 0x42, 0xED, 0x26, 0xDD, 0x29, 0xD0,
2058 0x4E, 0x62, 0x3C, 0x85, 0x36, 0x1B, 0x5F, 0x6A, 0x47, 0x88,
2059 0x21, 0xE5, 0x1B, 0x85, 0x0A, 0x2C, 0xE9, 0x2F, 0xE0, 0x20,
2060 0xFC, 0x1D, 0xCD, 0x55, 0x66, 0xF5, 0xAC, 0x32, 0x00, 0x8E,
2061 0xA3, 0xE9, 0xED, 0xFB, 0x35, 0xA7, 0xE6, 0x76, 0x53, 0x42,
2062 0xC6, 0x77, 0x77, 0xAB, 0x90, 0x99, 0x7C, 0xC2, 0xEC, 0xC9,
2063 0x18, 0x4A, 0x3C, 0xF4, 0x11, 0x75, 0x27, 0x83, 0xBD, 0x9E,
2064 0xC2, 0x8F, 0x23, 0xAB, 0x52, 0x46, 0xE2, 0x52, 0x5D, 0x9A,
2065 0x04, 0xC3, 0x15, 0x1F, 0x69, 0x9C, 0x72, 0x69, 0x59, 0x52,
2066 0xD4, 0x69, 0x3D, 0x19, 0x77, 0x36, 0x25, 0xAF, 0x07, 0x71,
2067 0x82, 0xDE, 0xB7, 0x24, 0x60, 0x82, 0x6A, 0x72, 0xBB, 0xED,
2068 0xB6, 0x76, 0xAE, 0x7E, 0xBC, 0x7D, 0x2F, 0x73, 0x4B, 0x04,
2069 0x16, 0xD5, 0xA4, 0xF3, 0x03, 0x26, 0xFB, 0xF3, 0xCD, 0x7B,
2070 0x77, 0x7E, 0x7C, 0x8D, 0x65, 0xAE, 0xA5, 0xDC, 0x6C, 0xE3,
2071 0x70, 0xD2, 0x29, 0x6B, 0xF2, 0xEB, 0x76, 0xC9, 0xE5, 0x46,
2072 0x18, 0x12, 0x57, 0xB0, 0x55, 0xA5, 0x7C, 0xCD, 0x41, 0x93,
2073 0x26, 0x99, 0xF7, 0xA5, 0xC5, 0x34, 0xBE, 0x59, 0x79, 0xDE,
2074 0x0A, 0x57, 0x5F, 0x21, 0xF8, 0x98, 0x52, 0xF0, 0x2F, 0x7B,
2075 0x57, 0xB6, 0x9D, 0xFC, 0x40, 0xA6, 0x55, 0xFB, 0xAF, 0xD9,
2076 0x16, 0x9B, 0x20, 0x4F, 0xA8, 0xA3, 0x0B, 0x04, 0x48, 0xE3,
2077 0x77, 0x22, 0xC4, 0xCC, 0x57, 0x14, 0x33, 0xA2, 0xF0, 0x9A,
2078 0xE3, 0x12, 0xBD, 0xFF, 0x72, 0x8B, 0xEE, 0x52, 0xF3, 0xC9,
2079 0x59, 0xC2, 0xA2, 0x6B, 0xA5, 0x75, 0x48, 0x51, 0x82, 0x0E,
2080 0x7A, 0xFF, 0xFE, 0x41, 0xCD, 0x7C, 0x63, 0xD2, 0x53, 0xA8,
2081 0x11, 0x03, 0xB9, 0x03, 0x07, 0xFE, 0x66, 0x38, 0x5F, 0xA2,
2082 0x3E, 0x9C, 0x1B, 0x02, 0x01, 0x02
2083 };
2084 static const int sizeof_dh_key_der_3072 = sizeof(dh_key_der_3072);
2085
2086 /* ./certs/dsa3072.der, 3072-bit */
2087 static const unsigned char dsa_key_der_3072[] =
2088 {
2089 0x30, 0x82, 0x04, 0xD7, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
2090 0x81, 0x00, 0xB5, 0xD0, 0x2F, 0x55, 0xC1, 0x27, 0x4C, 0x5B,
2091 0x28, 0x81, 0x4E, 0xA4, 0x32, 0x0D, 0x73, 0x54, 0x68, 0x4F,
2092 0x0A, 0x36, 0x68, 0x4A, 0x51, 0xBE, 0xDE, 0x49, 0xD4, 0x9D,
2093 0xCE, 0xC6, 0xF7, 0x01, 0x70, 0xD2, 0x88, 0x90, 0x1D, 0x60,
2094 0x30, 0x9B, 0x0A, 0x9C, 0x23, 0xDA, 0xE0, 0x74, 0x46, 0x5B,
2095 0xC7, 0x41, 0x40, 0x5C, 0xD9, 0x7A, 0xBE, 0x78, 0xCA, 0x49,
2096 0xF5, 0x2D, 0x7B, 0xD7, 0xBF, 0x67, 0x0D, 0x84, 0x28, 0xBB,
2097 0x9D, 0xC2, 0xAB, 0x23, 0x06, 0x28, 0x0C, 0x98, 0x46, 0x43,
2098 0xCE, 0x6F, 0x9E, 0xD0, 0xE9, 0x0E, 0xF3, 0x7E, 0x30, 0x5D,
2099 0xD3, 0x45, 0x44, 0x7B, 0x0C, 0x7A, 0x73, 0xA6, 0x95, 0x65,
2100 0xAA, 0x8B, 0xD8, 0x75, 0x6A, 0x11, 0xB3, 0x10, 0x7C, 0x57,
2101 0xAF, 0xCE, 0xBE, 0x5B, 0xF7, 0xC8, 0xFE, 0x42, 0xA3, 0x77,
2102 0xB7, 0x0B, 0x3D, 0x66, 0xB5, 0x08, 0x74, 0x22, 0x74, 0x26,
2103 0xE6, 0xDB, 0x8E, 0xEF, 0xA3, 0x99, 0xAE, 0x0B, 0x42, 0x8C,
2104 0x5F, 0x7E, 0x48, 0xE9, 0x19, 0x90, 0xA8, 0x35, 0xA9, 0xFC,
2105 0x48, 0x0D, 0xC8, 0xB8, 0xE4, 0x1A, 0x0C, 0x26, 0xC7, 0x1A,
2106 0x20, 0x02, 0xEB, 0x72, 0x2E, 0x94, 0xD6, 0x19, 0x34, 0x39,
2107 0x55, 0x4E, 0xFC, 0x53, 0x48, 0xD8, 0x10, 0x89, 0xA1, 0x6E,
2108 0x22, 0x39, 0x71, 0x15, 0xA6, 0x13, 0xBC, 0x77, 0x49, 0x53,
2109 0xCB, 0x16, 0x4B, 0x56, 0x3D, 0x08, 0xA2, 0x71, 0x0E, 0x06,
2110 0x0C, 0x3A, 0xDE, 0x82, 0xC0, 0xDF, 0xE7, 0x96, 0x57, 0xD7,
2111 0x3F, 0x6B, 0xF0, 0xAE, 0xD1, 0x38, 0xB8, 0x5B, 0x83, 0x77,
2112 0x8B, 0xEB, 0x2B, 0xDA, 0x38, 0xC8, 0x4C, 0xA9, 0x48, 0x52,
2113 0xD8, 0x41, 0x03, 0xD3, 0x11, 0x1C, 0x66, 0x9E, 0xDE, 0xC9,
2114 0x78, 0x5A, 0xE1, 0x7B, 0xEA, 0x6F, 0xD6, 0xCA, 0x6A, 0x2F,

NetBurner, Inc.
1118 File Documentation

2115 0x01, 0xB2, 0x83, 0x37, 0x25, 0xD9, 0x9C, 0xD4, 0xB0, 0x21,
2116 0xD9, 0x8F, 0xA6, 0xF8, 0xD6, 0x21, 0x82, 0xBB, 0x08, 0x64,
2117 0x28, 0x0E, 0x0C, 0x26, 0xE6, 0xA5, 0x69, 0xE0, 0x23, 0xE9,
2118 0xB3, 0xC4, 0xF9, 0xDE, 0xC6, 0xD6, 0x32, 0x00, 0x66, 0x9B,
2119 0x8A, 0x0B, 0x6F, 0xDE, 0xB8, 0xDD, 0x68, 0x7F, 0x9D, 0x68,
2120 0x59, 0x6B, 0x55, 0xD9, 0x53, 0x01, 0x7B, 0x1A, 0x1C, 0x8D,
2121 0xBF, 0xAF, 0xC0, 0xB1, 0x14, 0x9E, 0xC1, 0x8D, 0x3E, 0x1E,
2122 0xFB, 0x40, 0xF9, 0x6D, 0x48, 0x43, 0xCD, 0x6C, 0xE8, 0xBC,
2123 0x3C, 0x7C, 0x35, 0x3C, 0x65, 0x6D, 0xA0, 0x25, 0x87, 0xBF,
2124 0xEC, 0x9B, 0x12, 0x74, 0x48, 0xC8, 0xE4, 0xBF, 0x53, 0x53,
2125 0x47, 0x78, 0xD9, 0x9B, 0x1A, 0xA5, 0x07, 0x46, 0x15, 0x16,
2126 0xD2, 0x33, 0x93, 0xCC, 0x41, 0x9B, 0xB7, 0x22, 0xDF, 0x07,
2127 0xDD, 0x72, 0xC6, 0x1A, 0x9B, 0x92, 0xE7, 0x32, 0x04, 0xAB,
2128 0x94, 0x80, 0xBD, 0x58, 0xF2, 0x35, 0x02, 0x21, 0x00, 0x9A,
2129 0xDD, 0x98, 0x1A, 0x6F, 0xEA, 0xB5, 0x8B, 0xC9, 0x68, 0x18,
2130 0x81, 0xE4, 0x4C, 0xFD, 0x8E, 0x45, 0xCF, 0x5F, 0x0E, 0x62,
2131 0x1E, 0x7D, 0x2D, 0x4A, 0x4C, 0x5D, 0x7F, 0xF8, 0xD8, 0x52,
2132 0xD7, 0x02, 0x82, 0x01, 0x81, 0x00, 0x84, 0xDF, 0xAB, 0x91,
2133 0x61, 0xE4, 0x2B, 0x07, 0x0A, 0x1C, 0xC7, 0x9C, 0xD7, 0xAC,
2134 0x8D, 0xA5, 0xAA, 0x41, 0x65, 0x9E, 0x4A, 0xED, 0x21, 0x45,
2135 0x96, 0xF7, 0xF7, 0xCB, 0x7A, 0x88, 0x19, 0x0F, 0x36, 0x80,
2136 0x25, 0x2F, 0x23, 0x0D, 0xFF, 0x6C, 0x0D, 0x02, 0xBB, 0x6A,
2137 0x79, 0x6A, 0xCB, 0x05, 0x00, 0x9B, 0x77, 0xED, 0x6B, 0xF3,
2138 0xC2, 0xEA, 0x1A, 0xDF, 0xB8, 0x15, 0xA8, 0x92, 0x19, 0x5A,
2139 0x51, 0x3B, 0x76, 0x06, 0x98, 0x47, 0xC7, 0x6F, 0x76, 0x99,
2140 0xAD, 0x50, 0xC5, 0x98, 0xE7, 0xFF, 0x88, 0xBC, 0x49, 0x77,
2141 0xEF, 0x96, 0x75, 0xE2, 0x36, 0x66, 0x1F, 0x0C, 0xFA, 0x57,
2142 0x1E, 0x11, 0xFF, 0x8F, 0x3C, 0xD0, 0xEA, 0x97, 0x25, 0x3F,
2143 0xFA, 0xD1, 0x4F, 0xBA, 0xDF, 0xE3, 0x35, 0xFB, 0x6E, 0x5C,
2144 0x65, 0xF9, 0xA2, 0x26, 0x43, 0xF2, 0xF4, 0xE0, 0x05, 0x3D,
2145 0xC6, 0x5B, 0xC4, 0x21, 0xE7, 0xB1, 0x02, 0xEB, 0xF2, 0xA9,
2146 0x06, 0x5E, 0xB7, 0x1B, 0xC1, 0xD8, 0x86, 0x34, 0xED, 0x84,
2147 0x89, 0xCE, 0xCE, 0xC2, 0x63, 0x78, 0x67, 0xF8, 0xC3, 0xAA,
2148 0x7C, 0x1C, 0x59, 0x32, 0xE4, 0x77, 0xA2, 0x36, 0x31, 0xFE,
2149 0x4B, 0x9C, 0x98, 0xCE, 0x01, 0x55, 0x61, 0xCE, 0x23, 0xAE,
2150 0x0F, 0x7E, 0x24, 0x8B, 0x54, 0x8A, 0xE4, 0xCB, 0x8E, 0xDC,
2151 0x7A, 0x94, 0x4C, 0xF9, 0x3C, 0xF8, 0x67, 0x68, 0x9D, 0x7A,
2152 0x82, 0xA1, 0xA0, 0x01, 0xC7, 0x1B, 0x8D, 0xA0, 0xC0, 0x53,
2153 0x1E, 0x93, 0xC7, 0x86, 0x12, 0xD3, 0x16, 0xDC, 0x28, 0xA0,
2154 0xD1, 0x0D, 0x1E, 0x42, 0x9A, 0xCB, 0x55, 0x8C, 0x22, 0x7F,
2155 0x41, 0xC3, 0xC9, 0x14, 0xF2, 0xB0, 0x73, 0xA1, 0x4D, 0x72,
2156 0xFD, 0x88, 0xB6, 0xDE, 0xE5, 0xF0, 0x3C, 0x3A, 0x7E, 0x68,
2157 0x3E, 0x82, 0x58, 0x60, 0xCD, 0xB4, 0x08, 0x64, 0x18, 0xB2,
2158 0x24, 0x97, 0x13, 0xA6, 0x07, 0x75, 0xBE, 0xE0, 0x14, 0x92,
2159 0x9A, 0x98, 0x6C, 0x08, 0x94, 0xD1, 0x0D, 0x48, 0x44, 0xC3,
2160 0xE3, 0xD5, 0xC0, 0x93, 0x49, 0x79, 0x2F, 0x67, 0x15, 0x76,
2161 0xD8, 0x90, 0x11, 0xDB, 0xEC, 0xA7, 0xE2, 0xDB, 0xD4, 0x4F,
2162 0x49, 0x5E, 0xEF, 0xC5, 0xB9, 0x77, 0x69, 0xDA, 0x02, 0xB7,
2163 0x23, 0xBC, 0xEA, 0xDC, 0x84, 0xD4, 0xA5, 0x5C, 0xA2, 0x6C,
2164 0xAD, 0x4A, 0x9F, 0xF0, 0x65, 0x48, 0xE9, 0xBF, 0xDF, 0xA5,
2165 0xB3, 0x99, 0xD6, 0x76, 0x08, 0x87, 0x2C, 0xF2, 0x29, 0x79,
2166 0xB2, 0x20, 0x7C, 0x6F, 0xC1, 0xC5, 0x3C, 0xB0, 0x50, 0x3F,
2167 0x72, 0xA5, 0x57, 0xE3, 0xB0, 0x62, 0x18, 0x80, 0x71, 0xB9,
2168 0x3F, 0x4D, 0x4E, 0x7C, 0xF6, 0x29, 0xDB, 0xB8, 0xAD, 0xF6,
2169 0x41, 0x69, 0x06, 0x90, 0x45, 0x7B, 0x95, 0x03, 0xE1, 0x9E,
2170 0xA5, 0xA1, 0x5A, 0xE3, 0x08, 0x26, 0x73, 0xFC, 0x2B, 0x20,
2171 0x02, 0x82, 0x01, 0x81, 0x00, 0xA5, 0x52, 0x8F, 0x53, 0xF0,
2172 0xB9, 0x4F, 0x06, 0xB9, 0xC8, 0xB4, 0x50, 0xA4, 0x39, 0xBA,
2173 0x12, 0x92, 0x75, 0x27, 0x43, 0xA8, 0x30, 0xA9, 0xF2, 0x2A,
2174 0xC6, 0x93, 0x26, 0x3C, 0x8C, 0x9F, 0xA2, 0x6F, 0x53, 0xD9,
2175 0x14, 0xAB, 0x3F, 0x00, 0xC6, 0x11, 0x13, 0x90, 0x6A, 0x42,
2176 0xF2, 0x9D, 0xA3, 0x8F, 0x31, 0x32, 0x46, 0x73, 0xA3, 0x93,
2177 0x57, 0x5D, 0x76, 0x45, 0x49, 0x6C, 0xBD, 0xEA, 0xAF, 0xAA,
2178 0xB3, 0x55, 0x25, 0x11, 0x8E, 0xA5, 0x2A, 0xB1, 0xBA, 0xA5,
2179 0x06, 0x4A, 0x66, 0xAA, 0x78, 0x9E, 0xF6, 0x5C, 0x1E, 0xB1,
2180 0x4A, 0xCA, 0x5C, 0x3F, 0x1D, 0x33, 0x75, 0x91, 0xF2, 0xF9,
2181 0x53, 0x14, 0x2F, 0xDC, 0xF0, 0x4C, 0xA4, 0xF4, 0x50, 0x04,
2182 0x1F, 0xFF, 0xC9, 0x0C, 0xC6, 0x8A, 0x04, 0x8B, 0x80, 0x87,
2183 0xA7, 0x70, 0x49, 0xD7, 0xE4, 0xE7, 0x83, 0xF1, 0x86, 0x1A,
2184 0xB0, 0x85, 0x3C, 0x59, 0x04, 0x96, 0xD1, 0x85, 0x47, 0xA1,
2185 0x57, 0x7D, 0xC6, 0x8E, 0x60, 0x7D, 0xC6, 0xE8, 0x18, 0xB3,
2186 0x1F, 0xB8, 0x99, 0xF0, 0xC4, 0xE5, 0x1E, 0xBC, 0x34, 0x07,
2187 0x8E, 0x40, 0x57, 0xA5, 0x8D, 0x3A, 0xA3, 0x88, 0x96, 0xF1,
2188 0xB3, 0x61, 0xF1, 0x1C, 0x96, 0x8A, 0xA4, 0x9E, 0xCD, 0x21,
2189 0xA2, 0x94, 0xAE, 0x5E, 0x1F, 0xCD, 0x5B, 0x5B, 0xE3, 0x88,
2190 0x1E, 0x17, 0x4A, 0x46, 0xAB, 0x9C, 0xE0, 0x59, 0x03, 0x4A,
2191 0xB8, 0xC8, 0x83, 0xE7, 0xFF, 0x39, 0x27, 0x68, 0x80, 0xA0,
2192 0x8E, 0xB3, 0xA2, 0x00, 0xC6, 0x2D, 0x2C, 0x76, 0xBA, 0x90,
2193 0x7C, 0x03, 0x1B, 0x19, 0xC8, 0x33, 0xB2, 0x12, 0x3A, 0xC8,
2194 0x8D, 0x32, 0xFE, 0xC0, 0xF9, 0xA5, 0x6A, 0x63, 0xE2, 0xA4,
2195 0x12, 0x43, 0x19, 0xF5, 0x14, 0xF2, 0x27, 0xF8, 0x0B, 0xBD,
2196 0x1A, 0x22, 0x64, 0x2D, 0xC9, 0x05, 0xFA, 0xD8, 0xDD, 0x11,
2197 0x1A, 0xD3, 0xF2, 0xBC, 0x99, 0x3A, 0xCD, 0x21, 0xCF, 0x10,
2198 0x14, 0x36, 0xDF, 0xED, 0x66, 0x02, 0x03, 0x4A, 0x42, 0x70,
2199 0x71, 0x22, 0xAD, 0xE7, 0x53, 0x91, 0xF4, 0x40, 0x8F, 0x72,
2200 0x7E, 0x54, 0xA0, 0x5D, 0x58, 0x93, 0xD6, 0xF6, 0xBC, 0x87,
2201 0x1A, 0x68, 0x0F, 0xAB, 0x94, 0x20, 0x70, 0xC2, 0x11, 0xA1,

NetBurner, Inc.
22.205 certs_test.h 1119

2202 0x14, 0xBC, 0x06, 0xA8, 0x44, 0xB9, 0x1F, 0x04, 0x49, 0x7E,
2203 0xB3, 0x9A, 0x53, 0x46, 0x05, 0x75, 0x5D, 0x29, 0x77, 0x28,
2204 0xA9, 0xB1, 0xDC, 0xF1, 0x0D, 0x8A, 0x1C, 0x5E, 0xCD, 0xD7,
2205 0x4C, 0x16, 0x6F, 0x88, 0xBF, 0xB3, 0x34, 0xE2, 0xAD, 0x9A,
2206 0xC4, 0x89, 0xE2, 0x2E, 0x5C, 0x20, 0xE1, 0x5F, 0x39, 0xBF,
2207 0xB7, 0x45, 0xD3, 0x0F, 0x98, 0xB0, 0xD8, 0xC9, 0x18, 0x91,
2208 0x17, 0x25, 0xBC, 0x53, 0x62, 0xFF, 0x27, 0x85, 0xBD, 0xE2,
2209 0xE3, 0x9C, 0xA8, 0x06, 0x7A, 0x54, 0xEA, 0xFD, 0xEA, 0x02,
2210 0x20, 0x4C, 0xAC, 0x69, 0x62, 0x08, 0xE5, 0xCD, 0x14, 0xC8,
2211 0x2D, 0x4E, 0xDF, 0x1F, 0x60, 0x1D, 0x93, 0x44, 0x86, 0x5D,
2212 0x73, 0x99, 0x40, 0x1B, 0xDC, 0xA9, 0xBA, 0xC4, 0x1B, 0x12,
2213 0x6C, 0xFF, 0x53
2214 };
2215 static const int sizeof_dsa_key_der_3072 = sizeof(dsa_key_der_3072);
2216
2217 /* ./certs/rsa3072.der, 3072-bit */
2218 static const unsigned char rsa_key_der_3072[] =
2219 {
2220 0x30, 0x82, 0x06, 0xE4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
2221 0x81, 0x00, 0xBC, 0x6D, 0x68, 0xFF, 0xC0, 0x07, 0x0E, 0x0C,
2222 0x4A, 0xE6, 0x76, 0x1F, 0x7A, 0x25, 0x3A, 0x75, 0xA7, 0xE2,
2223 0xF1, 0x17, 0x00, 0xF8, 0x85, 0xE6, 0x8F, 0x59, 0x14, 0xA7,
2224 0xDE, 0x8C, 0x74, 0x4B, 0xEB, 0x85, 0xEC, 0x49, 0x9B, 0xFF,
2225 0x4B, 0x43, 0x0A, 0x08, 0xA1, 0xEC, 0x64, 0x58, 0x47, 0x28,
2226 0xD5, 0xCE, 0x48, 0xE9, 0xCF, 0x34, 0xDF, 0x15, 0x20, 0x37,
2227 0x99, 0x0E, 0x3C, 0x81, 0xBE, 0x2E, 0xE4, 0x6C, 0xBB, 0xDE,
2228 0xD1, 0x93, 0xC5, 0xEC, 0x6C, 0xCC, 0x40, 0x0B, 0x46, 0xA1,
2229 0xE6, 0xCA, 0xA0, 0xD5, 0x3B, 0x44, 0x48, 0x79, 0x67, 0x52,
2230 0x6F, 0xDA, 0xED, 0x73, 0x8B, 0x7C, 0x33, 0xDA, 0x17, 0x96,
2231 0xE8, 0xA2, 0x91, 0x3C, 0x57, 0xDD, 0xC9, 0x2E, 0x01, 0x74,
2232 0x87, 0x33, 0xA0, 0x12, 0x7C, 0xBB, 0xF9, 0x53, 0xF4, 0xC4,
2233 0x31, 0x48, 0x53, 0xCB, 0xBB, 0x3C, 0x42, 0x43, 0x0C, 0x7A,
2234 0x7B, 0xB8, 0x2A, 0xFC, 0xDC, 0x70, 0xD5, 0x64, 0x16, 0x74,
2235 0xA8, 0x80, 0xDE, 0x16, 0xE0, 0xB2, 0x6C, 0x04, 0x47, 0x6C,
2236 0x25, 0xA6, 0x7F, 0xB4, 0x73, 0x49, 0xBC, 0xF3, 0xAE, 0xE3,
2237 0x93, 0x36, 0x87, 0x2B, 0xB7, 0x8F, 0xB5, 0x88, 0x88, 0x22,
2238 0x47, 0xDF, 0xBF, 0x4D, 0x3C, 0x2A, 0xBD, 0x3F, 0x2F, 0x11,
2239 0x29, 0xCC, 0x1C, 0x33, 0x40, 0x4E, 0x23, 0xF6, 0x25, 0xF0,
2240 0xAF, 0x02, 0x16, 0x48, 0xED, 0x1C, 0xD8, 0xC9, 0x92, 0x2F,
2241 0x5B, 0xAF, 0xBA, 0xDB, 0x60, 0x1E, 0x0E, 0xE1, 0x65, 0x91,
2242 0x96, 0xF8, 0x7D, 0x73, 0x4C, 0x72, 0x23, 0x33, 0xD5, 0x32,
2243 0x2B, 0x0F, 0x4F, 0xBC, 0x81, 0x45, 0x9E, 0x31, 0x76, 0xEF,
2244 0xE1, 0x76, 0x2D, 0x3F, 0x8F, 0xC4, 0x19, 0x8F, 0x27, 0x2A,
2245 0x8F, 0x6E, 0x76, 0xCC, 0xE0, 0x5D, 0xB0, 0x86, 0x66, 0xFE,
2246 0x72, 0xD9, 0x06, 0x40, 0xB6, 0xCE, 0x85, 0xC6, 0x2D, 0x34,
2247 0x33, 0xAA, 0x8E, 0xE5, 0x54, 0x8E, 0xB8, 0xBA, 0xEE, 0x92,
2248 0x07, 0x5D, 0xB5, 0xF1, 0x67, 0xBF, 0xCA, 0xE4, 0xCA, 0xCB,
2249 0xD9, 0x01, 0x73, 0x22, 0x01, 0x32, 0x39, 0xF4, 0x0A, 0xEC,
2250 0x5F, 0x4A, 0x00, 0x10, 0x3F, 0x01, 0x3D, 0x15, 0xBB, 0x55,
2251 0x91, 0x80, 0xBE, 0xD8, 0xD3, 0x59, 0xCC, 0xB0, 0x7C, 0x56,
2252 0xF7, 0xFF, 0xE0, 0x28, 0x40, 0x02, 0xB3, 0x98, 0x8A, 0x54,
2253 0x52, 0x60, 0xA5, 0x0B, 0x95, 0x53, 0x86, 0x6B, 0xA4, 0x35,
2254 0xCA, 0x04, 0xC7, 0xFB, 0x0A, 0xC8, 0x9D, 0x5A, 0x11, 0x40,
2255 0xF7, 0x60, 0x07, 0xB1, 0xB3, 0x42, 0xB6, 0x80, 0x8F, 0xE4,
2256 0x25, 0xC9, 0xE8, 0xBC, 0x8E, 0x21, 0x0D, 0x47, 0xCF, 0xB8,
2257 0x37, 0x09, 0xAF, 0xBF, 0x2C, 0x34, 0x09, 0x22, 0xC2, 0x6E,
2258 0x0D, 0x06, 0x30, 0x80, 0x1E, 0xA5, 0x8A, 0x46, 0x2D, 0xDC,
2259 0x57, 0xD4, 0x57, 0x82, 0x6A, 0x11, 0x02, 0x03, 0x01, 0x00,
2260 0x01, 0x02, 0x82, 0x01, 0x81, 0x00, 0xAD, 0x99, 0xAF, 0xCF,
2261 0x51, 0x40, 0x2E, 0xB5, 0x2C, 0x9C, 0xBF, 0xDF, 0xA8, 0x4D,
2262 0x7C, 0x5A, 0xC1, 0xDE, 0xD8, 0x78, 0x75, 0x30, 0x83, 0x4D,
2263 0x34, 0x6C, 0xC2, 0x17, 0x17, 0x77, 0x17, 0xFE, 0x8A, 0x73,
2264 0xCC, 0x8A, 0xD4, 0xEA, 0x94, 0x90, 0xA3, 0x41, 0xE8, 0xCD,
2265 0x3E, 0x76, 0x06, 0xB9, 0x9C, 0xA2, 0x7D, 0x92, 0xCC, 0x90,
2266 0xCD, 0xA7, 0x4D, 0x13, 0x6C, 0x34, 0x2D, 0x92, 0xEB, 0x81,
2267 0x90, 0x7A, 0x8D, 0x6C, 0x70, 0x72, 0x51, 0x3B, 0xCD, 0xD1,
2268 0x30, 0x80, 0x33, 0x07, 0x1E, 0xF7, 0x38, 0xCE, 0xBB, 0xD7,
2269 0xE1, 0x5D, 0xD8, 0xCF, 0x9E, 0xB6, 0x79, 0x66, 0xA6, 0xF0,
2270 0x3B, 0x65, 0x87, 0xAE, 0x45, 0x8E, 0xE1, 0x78, 0x53, 0x0B,
2271 0xC7, 0x3A, 0x57, 0xA4, 0xE0, 0x9B, 0xB3, 0xB2, 0xD4, 0xB0,
2272 0xEA, 0xB9, 0x6B, 0x1D, 0x06, 0xBA, 0xB8, 0x59, 0x4F, 0x9B,
2273 0xE9, 0x00, 0x95, 0x12, 0x93, 0xC1, 0xCD, 0xF9, 0x41, 0xAF,
2274 0xC3, 0x2A, 0x7F, 0x75, 0xE3, 0x79, 0x37, 0x24, 0xA4, 0xC8,
2275 0x3D, 0xB4, 0x83, 0x89, 0x23, 0xF7, 0x0E, 0x59, 0x56, 0x8E,
2276 0x6D, 0x43, 0xA5, 0xB1, 0x8E, 0x04, 0x02, 0xED, 0x48, 0x25,
2277 0x62, 0xFE, 0xF3, 0x4D, 0x82, 0x22, 0xA6, 0xC1, 0xA5, 0xD9,
2278 0x4A, 0x9A, 0x57, 0xE6, 0xDC, 0x37, 0x6D, 0x13, 0xDA, 0xFF,
2279 0x23, 0x2A, 0xB9, 0x31, 0xD2, 0x4B, 0x7D, 0xF3, 0x02, 0x90,
2280 0xF6, 0x28, 0x3D, 0x98, 0x3C, 0xF6, 0x43, 0x45, 0xAE, 0xAB,
2281 0x91, 0x15, 0xC7, 0xC4, 0x90, 0x9C, 0x3E, 0xDA, 0xD4, 0x20,
2282 0x12, 0xB2, 0xE1, 0x2B, 0x56, 0xE2, 0x38, 0x32, 0x9C, 0xE6,
2283 0xA9, 0x1D, 0xFE, 0xA5, 0xEE, 0xD7, 0x52, 0xB4, 0xE3, 0xE4,
2284 0x65, 0xEA, 0x41, 0x9D, 0xD4, 0x91, 0x83, 0x5D, 0xFF, 0x52,
2285 0xA7, 0xC3, 0x42, 0x9F, 0x14, 0x70, 0x9F, 0x98, 0x14, 0xB2,
2286 0x33, 0xEE, 0x4C, 0x5A, 0xC9, 0x5F, 0x16, 0xF6, 0x06, 0xE9,
2287 0xF3, 0x39, 0xD2, 0xC5, 0x31, 0x53, 0x2A, 0x39, 0xED, 0x3A,
2288 0x4D, 0x2A, 0xC1, 0x4C, 0x87, 0x82, 0xC6, 0xCA, 0xCF, 0xF5,

NetBurner, Inc.
1120 File Documentation

2289 0x9A, 0x71, 0x27, 0xAE, 0xFB, 0xFE, 0xD0, 0x66, 0xDB, 0xAA,
2290 0x03, 0x16, 0x4B, 0xEF, 0xB4, 0x28, 0xAB, 0xCF, 0xBE, 0x9B,
2291 0x58, 0xCF, 0xA4, 0x58, 0x82, 0xD2, 0x37, 0x8C, 0xEA, 0x3D,
2292 0x75, 0x4D, 0x0B, 0x46, 0x7A, 0x04, 0xDE, 0xF1, 0x6E, 0xBB,
2293 0x03, 0xBF, 0xF7, 0x8E, 0xE6, 0xF4, 0x9A, 0xE1, 0xCA, 0x26,
2294 0x2C, 0x41, 0x08, 0xAD, 0x21, 0xA7, 0xC2, 0x40, 0xF5, 0x9C,
2295 0xDD, 0xAB, 0xC5, 0x5A, 0x4C, 0xF4, 0xE6, 0x9A, 0x50, 0xFD,
2296 0xAA, 0x47, 0xD6, 0xA6, 0x07, 0x25, 0xB2, 0x4B, 0x9C, 0x1D,
2297 0x90, 0xA2, 0x4A, 0x98, 0xE0, 0x05, 0x8A, 0x5C, 0xD1, 0x2C,
2298 0xC0, 0x28, 0xD1, 0x84, 0x3C, 0x72, 0xFF, 0x83, 0xEA, 0xB1,
2299 0x02, 0x81, 0xC1, 0x00, 0xF8, 0xA0, 0x5F, 0x25, 0x2E, 0x23,
2300 0x73, 0x30, 0xB6, 0x97, 0xAF, 0x08, 0xE7, 0xD2, 0xD8, 0xC3,
2301 0x95, 0xEA, 0x9D, 0x8E, 0x9F, 0xF1, 0x36, 0x81, 0xD7, 0x7A,
2302 0x21, 0x2B, 0x90, 0x38, 0x9C, 0xA6, 0x08, 0x40, 0xEA, 0xD2,
2303 0x6E, 0x29, 0xB5, 0x0B, 0x3E, 0x91, 0xB2, 0x04, 0x92, 0xCF,
2304 0x94, 0xFF, 0xA6, 0xA7, 0x1A, 0x5F, 0x93, 0x0C, 0x86, 0xE6,
2305 0x4B, 0x61, 0xD4, 0x5E, 0xD7, 0xE3, 0x66, 0x0B, 0x83, 0xDB,
2306 0x16, 0x49, 0x27, 0xD5, 0xA3, 0xB3, 0xF5, 0x5D, 0x8F, 0xC9,
2307 0x48, 0x10, 0xD7, 0x77, 0x1E, 0x7B, 0x01, 0xC4, 0xFD, 0x14,
2308 0x0C, 0xAB, 0x40, 0xF7, 0x9B, 0x07, 0xDE, 0x55, 0xEF, 0x36,
2309 0x4C, 0x22, 0x37, 0x37, 0x09, 0x9D, 0x2A, 0x73, 0xA6, 0xA5,
2310 0xF4, 0xAF, 0x39, 0x2B, 0x87, 0xB4, 0xB2, 0x28, 0x9E, 0x08,
2311 0xA6, 0xCA, 0xB4, 0x39, 0x5A, 0x3A, 0xFB, 0x41, 0x93, 0xEC,
2312 0x44, 0xBB, 0xD2, 0x7C, 0x3B, 0x27, 0x3E, 0x26, 0xFD, 0x7B,
2313 0x20, 0xFC, 0x44, 0x67, 0xC0, 0x84, 0xD1, 0xA0, 0xCC, 0xBB,
2314 0x26, 0xC7, 0x32, 0x0E, 0x01, 0x9B, 0x2B, 0x1F, 0x58, 0x85,
2315 0x5A, 0x6C, 0xD0, 0xC1, 0xAC, 0x14, 0x5E, 0x06, 0x07, 0xCA,
2316 0x69, 0x52, 0xF5, 0xA6, 0x16, 0x75, 0x42, 0x8A, 0xE1, 0xBA,
2317 0x8B, 0x46, 0x38, 0x17, 0x7B, 0xF1, 0x7D, 0x79, 0x1F, 0x7E,
2318 0x4C, 0x6A, 0x75, 0xDC, 0xA8, 0x3B, 0x02, 0x81, 0xC1, 0x00,
2319 0xC2, 0x03, 0xFE, 0x57, 0xDF, 0x26, 0xD8, 0x79, 0xDC, 0x2C,
2320 0x47, 0x9B, 0x92, 0x9B, 0x53, 0x40, 0x82, 0xEC, 0xBD, 0x0B,
2321 0xC0, 0x96, 0x89, 0x21, 0xC5, 0x26, 0x7E, 0x7A, 0x59, 0xA7,
2322 0x85, 0x11, 0xCC, 0x39, 0x33, 0xA7, 0xE6, 0x42, 0x9C, 0x12,
2323 0x81, 0xA0, 0x87, 0xBC, 0x57, 0x07, 0xC4, 0x51, 0x93, 0x59,
2324 0xC6, 0xAB, 0x11, 0xCC, 0xCB, 0xC8, 0xC1, 0x40, 0xDF, 0xCB,
2325 0xE8, 0x45, 0x31, 0x20, 0x91, 0x88, 0x5F, 0x76, 0x76, 0xEE,
2326 0x30, 0x37, 0xFA, 0xA7, 0x22, 0x72, 0x82, 0x50, 0x31, 0xE9,
2327 0xA0, 0x44, 0xCA, 0xDD, 0xD6, 0xAC, 0xEC, 0x82, 0xE8, 0x62,
2328 0xD8, 0x43, 0xFD, 0x77, 0x0F, 0x1C, 0x23, 0x12, 0x91, 0x1C,
2329 0xFE, 0x93, 0x2C, 0x87, 0x52, 0xBF, 0x96, 0x79, 0x5E, 0x3A,
2330 0x5A, 0x33, 0x28, 0x27, 0x3F, 0x20, 0x2C, 0xB3, 0x26, 0xE2,
2331 0x0D, 0x44, 0xA9, 0x2F, 0x39, 0x7B, 0x7B, 0xAD, 0xA3, 0x21,
2332 0xD2, 0x7F, 0x3C, 0x89, 0x63, 0xDD, 0x13, 0xB1, 0x2E, 0xD6,
2333 0x34, 0xFB, 0x2A, 0x83, 0x29, 0xE7, 0x8A, 0x88, 0xD7, 0xA3,
2334 0x38, 0x3C, 0x43, 0x62, 0x8F, 0x69, 0xFA, 0x4B, 0x15, 0xB5,
2335 0xF6, 0x59, 0x90, 0x62, 0x7D, 0xCF, 0x1D, 0xDD, 0x49, 0x43,
2336 0x33, 0x96, 0xA9, 0xF7, 0x76, 0x9F, 0xE4, 0x0D, 0x6E, 0x1C,
2337 0xEA, 0x18, 0x5B, 0xBD, 0x5C, 0x98, 0x90, 0x09, 0xCA, 0x59,
2338 0x9E, 0x23, 0x02, 0x81, 0xC0, 0x66, 0xFF, 0x99, 0x2A, 0xFF,
2339 0xF8, 0x33, 0xAA, 0x44, 0x9A, 0x86, 0x2A, 0xBC, 0x4F, 0x3E,
2340 0xF9, 0x97, 0xCB, 0xC0, 0x45, 0xEB, 0xC0, 0xB4, 0x02, 0x0A,
2341 0x50, 0x50, 0x19, 0x89, 0xFF, 0xC9, 0xF5, 0x86, 0x89, 0xCE,
2342 0x3E, 0x2A, 0xE1, 0x20, 0x5D, 0x6E, 0x28, 0x51, 0x85, 0x4F,
2343 0x84, 0xAB, 0x87, 0x55, 0x74, 0xF8, 0x9A, 0x0B, 0x83, 0x2F,
2344 0x07, 0x8C, 0xC7, 0x14, 0x81, 0xCE, 0x12, 0x28, 0x9E, 0x30,
2345 0x9B, 0xBC, 0x99, 0xC5, 0xE4, 0xDD, 0x92, 0x99, 0xDD, 0x8E,
2346 0xC9, 0xA6, 0x0F, 0x44, 0x13, 0xD7, 0x0E, 0xC2, 0x66, 0xE7,
2347 0x29, 0x3D, 0x2E, 0x5D, 0x15, 0xB6, 0xA6, 0x05, 0xD7, 0xB7,
2348 0xE7, 0xD8, 0x96, 0x7C, 0x25, 0x52, 0xD8, 0x47, 0x53, 0xED,
2349 0xFF, 0xE6, 0x64, 0x08, 0xDD, 0x1D, 0xB5, 0x1F, 0xF1, 0x6F,
2350 0xB6, 0xC9, 0xD2, 0x43, 0xE3, 0x56, 0x9C, 0x04, 0xA6, 0xE0,
2351 0x2F, 0x0B, 0x32, 0x7C, 0x3A, 0x77, 0x0F, 0x04, 0xD2, 0x86,
2352 0x44, 0x52, 0x1F, 0xEF, 0xFE, 0xC3, 0x64, 0xC2, 0xAB, 0x48,
2353 0xE5, 0x67, 0x65, 0x32, 0x39, 0x57, 0x34, 0xFF, 0x22, 0x57,
2354 0x3B, 0xB7, 0x80, 0x48, 0xE3, 0x52, 0xF4, 0x85, 0x17, 0x1E,
2355 0x77, 0x1E, 0x36, 0xFE, 0x09, 0x36, 0x58, 0x91, 0x9E, 0x93,
2356 0x71, 0x02, 0x6D, 0xAE, 0xA3, 0x1B, 0xF7, 0xA9, 0x31, 0x5A,
2357 0x78, 0xAA, 0x13, 0x98, 0x8C, 0x37, 0x2D, 0x02, 0x81, 0xC1,
2358 0x00, 0xBE, 0x01, 0xD9, 0x3A, 0xC7, 0x81, 0xAC, 0xAA, 0x13,
2359 0x75, 0x8E, 0x1F, 0x8F, 0x41, 0xED, 0x13, 0x95, 0xE5, 0x31,
2360 0xF3, 0x6B, 0x86, 0x42, 0x00, 0xBF, 0xAA, 0xC6, 0x5D, 0x1E,
2361 0xA6, 0x90, 0x0C, 0xF1, 0x1B, 0xE8, 0x39, 0xFB, 0xA8, 0xAA,
2362 0x5E, 0xF9, 0x72, 0x74, 0xDC, 0x7F, 0xC3, 0x4C, 0x81, 0xB3,
2363 0xB4, 0x4D, 0x7B, 0xC6, 0x2F, 0xF2, 0x37, 0xC7, 0x03, 0xB8,
2364 0xE9, 0x62, 0xAD, 0x38, 0xC2, 0xB3, 0xA4, 0x82, 0x11, 0x6B,
2365 0xC2, 0x33, 0x98, 0xEF, 0x32, 0x75, 0xEA, 0xFD, 0x32, 0x7A,
2366 0xDF, 0x59, 0xA5, 0x65, 0xA4, 0x42, 0x95, 0x11, 0xFF, 0xD6,
2367 0x84, 0xCF, 0x56, 0x2E, 0xCA, 0x46, 0x13, 0x01, 0x4A, 0x32,
2368 0xB1, 0xD9, 0xA3, 0xDB, 0x0D, 0x20, 0x7E, 0x1F, 0x68, 0xF7,
2369 0x5E, 0x60, 0x6E, 0x0F, 0x59, 0xF8, 0x59, 0x93, 0x4D, 0x54,
2370 0xBC, 0x37, 0xD0, 0x51, 0x7C, 0xBD, 0x67, 0xF0, 0xA5, 0x09,
2371 0xC9, 0x9A, 0xF4, 0x1F, 0x1E, 0x52, 0x9D, 0xF5, 0xA6, 0x25,
2372 0xBF, 0x85, 0x1D, 0xA1, 0xF1, 0xD8, 0xBD, 0x39, 0x10, 0x71,
2373 0x57, 0x19, 0x40, 0xF3, 0xA1, 0x77, 0xE0, 0x8B, 0x4E, 0xB3,
2374 0x91, 0x84, 0x15, 0x0C, 0xF1, 0x58, 0x52, 0xD9, 0xE5, 0x98,
2375 0xD5, 0x66, 0x95, 0x9C, 0x19, 0x8D, 0xA4, 0x63, 0x5C, 0xBF,

NetBurner, Inc.
22.205 certs_test.h 1121

2376 0xC5, 0x33, 0x81, 0xED, 0x7E, 0x93, 0x4B, 0x9A, 0x6C, 0xEC,
2377 0x2E, 0x3E, 0x4F, 0x02, 0x81, 0xC0, 0x34, 0xF8, 0xDF, 0x74,
2378 0xC6, 0xC1, 0xD9, 0x03, 0x9B, 0x3B, 0x53, 0x19, 0xEB, 0x43,
2379 0xC4, 0xAA, 0x1E, 0x73, 0xE3, 0x13, 0x25, 0x32, 0x04, 0x22,
2380 0x79, 0x4A, 0x07, 0xF0, 0x06, 0x38, 0xBD, 0x57, 0xE6, 0x01,
2381 0x33, 0x8C, 0xF1, 0x02, 0xCC, 0x34, 0x2C, 0x60, 0x32, 0xA4,
2382 0x22, 0x1D, 0x0E, 0x39, 0x6B, 0xAB, 0xF7, 0xCE, 0xDB, 0xA7,
2383 0xC3, 0xD8, 0xA2, 0x3B, 0x70, 0x31, 0x91, 0x68, 0xB9, 0xBF,
2384 0xE0, 0xA1, 0x39, 0x80, 0xFE, 0x47, 0x99, 0x56, 0x6D, 0x76,
2385 0x90, 0x17, 0xF5, 0x67, 0x41, 0x44, 0x27, 0x10, 0x07, 0x98,
2386 0x4D, 0x4C, 0x53, 0xD4, 0x15, 0xDC, 0x0A, 0x2F, 0xE0, 0x83,
2387 0x28, 0x22, 0x8D, 0x61, 0x3B, 0xE4, 0x8E, 0xE5, 0xE7, 0x24,
2388 0x98, 0x19, 0xA8, 0xA3, 0xED, 0x70, 0x59, 0x06, 0x86, 0x76,
2389 0xC2, 0x4B, 0xCB, 0x17, 0xC5, 0x77, 0x12, 0x07, 0xB8, 0xAB,
2390 0x1A, 0x91, 0xFC, 0x72, 0x8E, 0xB7, 0xB1, 0xE6, 0x74, 0xDD,
2391 0x3D, 0x92, 0xA7, 0xDE, 0x6C, 0x6E, 0xCB, 0x50, 0x44, 0x2F,
2392 0xAC, 0x99, 0xF7, 0x36, 0x4D, 0x62, 0xC7, 0xAC, 0xCE, 0x7D,
2393 0x26, 0xC9, 0xD2, 0x4E, 0x49, 0xD7, 0x8E, 0x66, 0x6C, 0xC1,
2394 0x53, 0xDF, 0x31, 0xAB, 0x25, 0x35, 0xCA, 0xD6, 0xC4, 0xA3,
2395 0xA6, 0x9F, 0x7E, 0x3D, 0x2D, 0x1A, 0x44, 0x31, 0x3D, 0x81,
2396 0x91, 0xB8, 0x36, 0x08, 0x27, 0x42, 0x9E, 0x08
2397 };
2398 static const int sizeof_rsa_key_der_3072 = sizeof(rsa_key_der_3072);
2399
2400 /* ./certs/3072/client-key.der, 3072-bit */
2401 static const unsigned char client_key_der_3072[] =
2402 {
2403 0x30, 0x82, 0x06, 0xE4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01,
2404 0x81, 0x00, 0xAC, 0x39, 0x50, 0x68, 0x8F, 0x78, 0xF8, 0x10,
2405 0x9B, 0x68, 0x96, 0xD3, 0xE1, 0x9C, 0x56, 0x68, 0x5A, 0x41,
2406 0x62, 0xE3, 0xB3, 0x41, 0xB0, 0x55, 0x80, 0x17, 0xB0, 0x88,
2407 0x16, 0x9B, 0xE0, 0x97, 0x74, 0x5F, 0x42, 0x79, 0x73, 0x42,
2408 0xDF, 0x93, 0xF3, 0xAA, 0x9D, 0xEE, 0x2D, 0x6F, 0xAA, 0xBC,
2409 0x27, 0x90, 0x84, 0xC0, 0x5D, 0xC7, 0xEC, 0x49, 0xEA, 0x5C,
2410 0x66, 0x1D, 0x70, 0x9C, 0x53, 0x5C, 0xBA, 0xA1, 0xB3, 0x58,
2411 0xC9, 0x3E, 0x8E, 0x9B, 0x72, 0x3D, 0x6E, 0x02, 0x02, 0x00,
2412 0x9C, 0x65, 0x56, 0x82, 0xA3, 0x22, 0xB4, 0x08, 0x5F, 0x2A,
2413 0xEF, 0xDF, 0x9A, 0xD0, 0xE7, 0x31, 0x59, 0x26, 0x5B, 0x0B,
2414 0x1C, 0x63, 0x61, 0xFF, 0xD5, 0x69, 0x32, 0x19, 0x06, 0x7E,
2415 0x0F, 0x40, 0x3C, 0x7A, 0x1E, 0xC8, 0xFC, 0x58, 0x6C, 0x64,
2416 0xAE, 0x10, 0x3D, 0xA8, 0x23, 0xFF, 0x8E, 0x1A, 0xCA, 0x6A,
2417 0x82, 0xE2, 0xF9, 0x01, 0x64, 0x2C, 0x97, 0xA0, 0x1A, 0x89,
2418 0xA0, 0x74, 0xD3, 0xB6, 0x05, 0x11, 0xF2, 0x62, 0x06, 0x48,
2419 0x2A, 0xF7, 0x66, 0xCE, 0xC1, 0x85, 0xE1, 0xD2, 0x27, 0xEA,
2420 0xCA, 0x12, 0xA5, 0x91, 0x97, 0x3E, 0xFC, 0x94, 0x06, 0x59,
2421 0x51, 0xC0, 0xE7, 0x13, 0xB6, 0x87, 0x7B, 0x5F, 0xD2, 0xC0,
2422 0x56, 0x2F, 0x5E, 0x1D, 0x02, 0xC3, 0x11, 0x2C, 0xDF, 0xF7,
2423 0x01, 0xDA, 0xBD, 0x85, 0x54, 0x35, 0x32, 0x5F, 0xC5, 0xC8,
2424 0xF9, 0x7A, 0x9F, 0x89, 0xF7, 0x03, 0x0E, 0x7E, 0x79, 0x5D,
2425 0x04, 0x82, 0x35, 0x10, 0xFE, 0x6D, 0x9B, 0xBF, 0xB8, 0xEE,
2426 0xE2, 0x62, 0x87, 0x26, 0x5E, 0x2F, 0x50, 0x2F, 0x78, 0x0C,
2427 0xE8, 0x73, 0x4F, 0x88, 0x6A, 0xD6, 0x26, 0xA4, 0xC9, 0xFC,
2428 0xFA, 0x1E, 0x8A, 0xB0, 0xF4, 0x32, 0xCF, 0x57, 0xCD, 0xA1,
2429 0x58, 0x8A, 0x49, 0x0F, 0xBB, 0xA9, 0x1D, 0x86, 0xAB, 0xB9,
2430 0x8F, 0x8D, 0x57, 0x19, 0xB2, 0x5A, 0x7E, 0xA4, 0xEA, 0xCC,
2431 0xB7, 0x96, 0x7A, 0x3B, 0x38, 0xCD, 0xDE, 0xE0, 0x61, 0xFC,
2432 0xC9, 0x06, 0x8F, 0x93, 0x5A, 0xCE, 0xAD, 0x2A, 0xE3, 0x2D,
2433 0x3E, 0x39, 0x5D, 0x41, 0x83, 0x01, 0x1F, 0x0F, 0xE1, 0x7F,
2434 0x76, 0xC7, 0x28, 0xDA, 0x56, 0xEF, 0xBF, 0xDC, 0x26, 0x35,
2435 0x40, 0xBE, 0xAD, 0xC7, 0x38, 0xAD, 0xA4, 0x06, 0xAC, 0xCA,
2436 0xE8, 0x51, 0xEB, 0xC0, 0xF8, 0x68, 0x02, 0x2C, 0x9B, 0xA1,
2437 0x14, 0xBC, 0xF8, 0x61, 0x86, 0xD7, 0x56, 0xD7, 0x73, 0xF4,
2438 0xAB, 0xBB, 0x6A, 0x21, 0xD3, 0x88, 0x22, 0xB4, 0xE7, 0x6F,
2439 0x7F, 0x91, 0xE5, 0x0E, 0xC6, 0x08, 0x49, 0xDE, 0xEA, 0x13,
2440 0x58, 0x72, 0xA0, 0xAA, 0x3A, 0xF9, 0x36, 0x03, 0x45, 0x57,
2441 0x5E, 0x87, 0xD2, 0x73, 0x65, 0xC4, 0x8C, 0xA3, 0xEE, 0xC9,
2442 0xD6, 0x73, 0x7C, 0x96, 0x41, 0x93, 0x02, 0x03, 0x01, 0x00,
2443 0x01, 0x02, 0x82, 0x01, 0x80, 0x40, 0x19, 0x74, 0xDB, 0xF5,
2444 0xCA, 0x48, 0x49, 0xA6, 0x0D, 0xDF, 0x55, 0x2C, 0xFB, 0x4B,
2445 0x0D, 0xBB, 0xC9, 0xEA, 0x4C, 0x65, 0x43, 0x65, 0xA5, 0xEC,
2446 0xEE, 0xE4, 0x3D, 0x42, 0x6C, 0xF1, 0xC2, 0x6D, 0x05, 0xA7,
2447 0x70, 0x1C, 0x7E, 0x1F, 0x48, 0xA9, 0xC0, 0x2E, 0xD7, 0x9F,
2448 0x01, 0x98, 0xC2, 0x3E, 0xD7, 0x83, 0x11, 0x35, 0xD6, 0x5B,
2449 0x13, 0x87, 0xAE, 0xAC, 0x32, 0xF8, 0xDE, 0xB6, 0x08, 0x25,
2450 0x4E, 0x59, 0xBA, 0x09, 0xEC, 0xC6, 0x97, 0x04, 0x85, 0xE8,
2451 0x93, 0xC6, 0xBB, 0x03, 0x7A, 0x94, 0x20, 0x3B, 0x27, 0x87,
2452 0x6A, 0x36, 0x41, 0x7C, 0xD5, 0xF4, 0x81, 0x1C, 0x0B, 0x39,
2453 0xEB, 0x14, 0xA7, 0xA6, 0x01, 0x37, 0x50, 0x48, 0xD5, 0xC6,
2454 0x57, 0x9A, 0x1B, 0x01, 0x02, 0x1F, 0x80, 0x34, 0x45, 0x09,
2455 0xE6, 0xBF, 0x31, 0x19, 0xB7, 0xE1, 0xBA, 0xDA, 0xEB, 0x1A,
2456 0xB0, 0xCD, 0xF5, 0xA6, 0x91, 0x63, 0xAC, 0x28, 0xE4, 0x8F,
2457 0xEA, 0x7E, 0xF6, 0x0A, 0x4A, 0x71, 0x21, 0xA5, 0xF1, 0x70,
2458 0x0D, 0x1B, 0xD9, 0x70, 0x64, 0x74, 0x57, 0x2F, 0x9F, 0xEC,
2459 0xD4, 0x93, 0x16, 0xC7, 0xEE, 0xF8, 0xC0, 0x9F, 0x52, 0x4A,
2460 0x1F, 0xAD, 0xDD, 0x40, 0x98, 0x53, 0x68, 0xFA, 0xDE, 0xA2,
2461 0x04, 0xA0, 0x24, 0x05, 0xEF, 0xCB, 0x4F, 0x70, 0xDF, 0xB9,
2462 0x5C, 0xC2, 0x5E, 0xE4, 0xC9, 0xCD, 0x0F, 0x5E, 0x4B, 0x77,

NetBurner, Inc.
1122 File Documentation

2463 0xBB, 0x84, 0x69, 0x54, 0x98, 0x41, 0xB7, 0x9C, 0x0E, 0x38,
2464 0xD8, 0xF7, 0xF3, 0x9F, 0xEF, 0xE5, 0x9B, 0xB6, 0x4B, 0xD6,
2465 0x7A, 0x65, 0xF5, 0x69, 0xFA, 0xC2, 0x13, 0x70, 0x6C, 0x28,
2466 0xA4, 0x29, 0xAC, 0xD9, 0xBF, 0xEC, 0x6A, 0x2E, 0xED, 0xE4,
2467 0xBA, 0xDF, 0xD0, 0xF1, 0xF3, 0x3C, 0x6C, 0x84, 0xDF, 0xB7,
2468 0x5A, 0x94, 0xCF, 0xD9, 0x2D, 0xEA, 0xEA, 0xB4, 0xD0, 0x91,
2469 0x2E, 0x77, 0x15, 0x18, 0x0D, 0x6B, 0xBA, 0x2A, 0x0C, 0xF1,
2470 0x92, 0x9D, 0xD6, 0x04, 0x05, 0xB6, 0x38, 0xC2, 0xE0, 0xA7,
2471 0x2D, 0x64, 0xF8, 0xDF, 0x0C, 0x3A, 0x93, 0x83, 0xE1, 0x88,
2472 0x83, 0x5F, 0x67, 0x90, 0x9F, 0x2B, 0xE0, 0x60, 0x8E, 0xCA,
2473 0x30, 0x13, 0xCA, 0x9F, 0xCF, 0x7B, 0x6D, 0xD8, 0xCD, 0xEE,
2474 0xF9, 0x96, 0xDD, 0x5E, 0xF4, 0x47, 0xC9, 0x4C, 0xE6, 0x8F,
2475 0x7F, 0x33, 0x2A, 0x38, 0x30, 0xAF, 0xD5, 0x4A, 0x79, 0x47,
2476 0x06, 0xCC, 0x96, 0x44, 0x29, 0x8C, 0x60, 0x2B, 0x08, 0xC7,
2477 0xD0, 0xD3, 0xC3, 0xC5, 0x2C, 0x63, 0x6C, 0x87, 0xD2, 0xAE,
2478 0x2A, 0xA4, 0x86, 0xE7, 0x76, 0x74, 0x90, 0xD1, 0x04, 0x37,
2479 0x64, 0x1A, 0xED, 0x08, 0xD9, 0x98, 0x07, 0x1A, 0x98, 0x0B,
2480 0x89, 0x99, 0xA4, 0xB0, 0x8C, 0x1A, 0x10, 0xEB, 0xEC, 0xF4,
2481 0xEE, 0x3C, 0xC4, 0x00, 0xCC, 0x30, 0x9C, 0x43, 0x01, 0x02,
2482 0x81, 0xC1, 0x00, 0xD9, 0x43, 0xF6, 0x2C, 0x78, 0x26, 0xD2,
2483 0xE7, 0x15, 0xA7, 0x0A, 0x88, 0x5E, 0xDB, 0x2D, 0xAF, 0xC6,
2484 0xA9, 0x6F, 0x73, 0x88, 0x3B, 0x6A, 0x08, 0x1F, 0xF5, 0x80,
2485 0xB5, 0x2E, 0x29, 0x8B, 0x72, 0xF8, 0x35, 0xC8, 0x23, 0x18,
2486 0x1C, 0x0D, 0x0E, 0x38, 0x82, 0xBB, 0x5B, 0x2F, 0xB4, 0x5C,
2487 0x4E, 0x24, 0x05, 0xA7, 0x4C, 0x79, 0x48, 0x89, 0x8D, 0x1C,
2488 0x1D, 0x0A, 0x2C, 0xFE, 0xD9, 0x99, 0xDF, 0x25, 0x8A, 0x2D,
2489 0xF8, 0xEB, 0x2F, 0xDA, 0x1B, 0x63, 0xE1, 0xCD, 0x09, 0x97,
2490 0x64, 0x14, 0xAB, 0xEA, 0x0B, 0xD8, 0xE2, 0xA8, 0x2A, 0x63,
2491 0x35, 0x90, 0xEE, 0x7F, 0xEA, 0xCE, 0xA5, 0xEF, 0x7F, 0xAB,
2492 0x87, 0x47, 0x9B, 0x45, 0x35, 0x9A, 0xDA, 0x8C, 0xF4, 0xD3,
2493 0x8A, 0x0B, 0x9B, 0xE6, 0xEA, 0x92, 0xBB, 0x05, 0xE1, 0xAC,
2494 0x3E, 0x35, 0xDB, 0xED, 0x65, 0x1D, 0xB6, 0x92, 0xEB, 0x29,
2495 0x79, 0xF8, 0x3F, 0xC2, 0x58, 0x40, 0x32, 0x66, 0x87, 0x56,
2496 0x50, 0xFF, 0xBF, 0x3E, 0xBD, 0xE9, 0x94, 0xBF, 0x31, 0xBE,
2497 0x87, 0x2D, 0xEF, 0x64, 0x1E, 0x0E, 0x67, 0x3A, 0x9C, 0x94,
2498 0xDA, 0x5B, 0x0C, 0x8C, 0x3D, 0xEE, 0x9D, 0xCD, 0x92, 0xDE,
2499 0x40, 0x02, 0x65, 0x36, 0xC9, 0x1B, 0xF5, 0x7E, 0x4E, 0x07,
2500 0xB4, 0x7F, 0x14, 0x0E, 0x03, 0x2E, 0x86, 0xF0, 0x45, 0x5F,
2501 0xDC, 0xA2, 0xE8, 0xC7, 0x83, 0x02, 0x81, 0xC1, 0x00, 0xCA,
2502 0xED, 0xA5, 0x3F, 0x59, 0xAC, 0x4C, 0xAD, 0xAB, 0x23, 0x02,
2503 0x95, 0x80, 0xA0, 0xAF, 0x35, 0x17, 0xDB, 0xE7, 0x7F, 0x72,
2504 0x41, 0x2C, 0x5C, 0xB4, 0x43, 0x85, 0x46, 0x73, 0x9F, 0x58,
2505 0xE9, 0x40, 0x8B, 0xEC, 0xB0, 0xEF, 0x86, 0x4C, 0x31, 0xDE,
2506 0xC8, 0x6C, 0x74, 0x75, 0xA2, 0xDB, 0x65, 0xF4, 0x50, 0xC6,
2507 0x99, 0xA2, 0x70, 0xDE, 0xB6, 0x22, 0xC2, 0x01, 0x15, 0x49,
2508 0x13, 0xA0, 0xE2, 0x20, 0x78, 0x44, 0xEC, 0x1F, 0x42, 0xB3,
2509 0x25, 0x09, 0xCE, 0x75, 0x13, 0x75, 0x36, 0x11, 0x47, 0x2C,
2510 0x3C, 0x15, 0x1F, 0xF0, 0x54, 0xD5, 0x18, 0xAE, 0x61, 0x07,
2511 0xAC, 0x3D, 0x83, 0x46, 0x03, 0x8C, 0xBF, 0x63, 0x26, 0xA8,
2512 0x19, 0x7C, 0xFF, 0xDE, 0x20, 0x78, 0xD0, 0xDA, 0x70, 0x2E,
2513 0xBD, 0xFA, 0x96, 0xDD, 0x15, 0x78, 0x9B, 0xEF, 0xED, 0x17,
2514 0x90, 0x6F, 0x14, 0x35, 0x50, 0x8E, 0x1D, 0x78, 0xB0, 0x8A,
2515 0xA0, 0x53, 0x10, 0x15, 0x64, 0xCC, 0x47, 0x05, 0xB6, 0xC6,
2516 0x48, 0xC0, 0x5D, 0xB4, 0x4B, 0x1A, 0x5F, 0xB8, 0x9E, 0x75,
2517 0xCD, 0xC3, 0x64, 0x66, 0x88, 0x10, 0x9C, 0x8B, 0x87, 0x14,
2518 0x34, 0xE6, 0x60, 0x3C, 0xA5, 0xB7, 0x81, 0x1D, 0x0B, 0x79,
2519 0x93, 0x5D, 0x4A, 0x42, 0x7A, 0x7F, 0x33, 0xF0, 0x3E, 0x9E,
2520 0x63, 0xBD, 0xB6, 0x5F, 0xF9, 0x47, 0xA7, 0x0A, 0x49, 0x70,
2521 0xB1, 0x02, 0x81, 0xC0, 0x6F, 0xC6, 0xF4, 0x3E, 0xDA, 0xAD,
2522 0xF6, 0xB1, 0x66, 0xC5, 0x62, 0xB8, 0xD8, 0x3C, 0x61, 0x1B,
2523 0xDE, 0xD4, 0x4A, 0xFF, 0xA0, 0x66, 0x18, 0xDE, 0x07, 0x3B,
2524 0x32, 0x35, 0x84, 0x83, 0x61, 0x38, 0x0C, 0x14, 0xF7, 0x5B,
2525 0x7E, 0xCA, 0xE7, 0xB8, 0x9A, 0x40, 0x40, 0x0D, 0xE0, 0xD4,
2526 0x24, 0xED, 0x1A, 0xC1, 0x41, 0xDA, 0x29, 0x47, 0xB5, 0x64,
2527 0xC0, 0xC2, 0xFB, 0xFA, 0x3C, 0x3F, 0x4D, 0x57, 0xAD, 0xA3,
2528 0x92, 0x95, 0x4E, 0xC2, 0x76, 0xAE, 0xC2, 0xCB, 0x67, 0xC6,
2529 0x78, 0x79, 0xC7, 0xDC, 0xCE, 0x73, 0xBB, 0xE8, 0x98, 0x65,
2530 0xFE, 0x56, 0x8F, 0xB2, 0xF4, 0x62, 0xA4, 0x60, 0x60, 0x80,
2531 0x49, 0x8A, 0x36, 0xBF, 0xDE, 0x72, 0x7E, 0xB1, 0xD3, 0xF5,
2532 0x1D, 0x64, 0x17, 0x26, 0xE5, 0x3D, 0x67, 0xB2, 0x0A, 0x8B,
2533 0x99, 0x27, 0x04, 0x64, 0x9A, 0x94, 0xFC, 0x1D, 0x73, 0x26,
2534 0xC3, 0x56, 0xF9, 0xEE, 0x2B, 0x99, 0x65, 0xA5, 0xC8, 0x73,
2535 0xF6, 0x67, 0x83, 0xBC, 0x2B, 0x96, 0x5F, 0x36, 0xE4, 0xCA,
2536 0xBD, 0xE0, 0x24, 0x34, 0xD6, 0x48, 0x54, 0x56, 0xAD, 0xA3,
2537 0xE3, 0x3D, 0x17, 0xBC, 0xB3, 0xE6, 0x24, 0xFE, 0x50, 0xC6,
2538 0x2F, 0xCB, 0xB4, 0xAF, 0xC7, 0xE8, 0xDD, 0x96, 0x86, 0x9D,
2539 0xB4, 0x7F, 0x1B, 0x26, 0x01, 0x33, 0x87, 0xDB, 0x6A, 0x7F,
2540 0xF6, 0x9A, 0xB7, 0xC1, 0x94, 0xEB, 0x02, 0x81, 0xC1, 0x00,
2541 0xB0, 0x6D, 0x20, 0x68, 0x0D, 0x7C, 0x81, 0x45, 0xD4, 0x2E,
2542 0x22, 0x06, 0xFC, 0xC7, 0xB6, 0xCC, 0x40, 0x2C, 0x0D, 0xFE,
2543 0x7D, 0xC5, 0x2F, 0xDE, 0x81, 0x52, 0xDA, 0xC2, 0x3F, 0xAF,
2544 0xE0, 0x4B, 0x1A, 0xB5, 0x0C, 0x59, 0x60, 0x45, 0xB0, 0x65,
2545 0x03, 0x3D, 0xD9, 0x1C, 0xFF, 0x51, 0x51, 0xD2, 0x38, 0x31,
2546 0x2A, 0x19, 0x54, 0x63, 0x31, 0x1D, 0xC4, 0xE6, 0x4A, 0xAE,
2547 0xC8, 0xD3, 0xE9, 0xE1, 0xEF, 0x3C, 0xE1, 0x1F, 0x30, 0xA6,
2548 0x7A, 0xBD, 0xCE, 0xE2, 0xD2, 0x62, 0xD2, 0x5A, 0xE9, 0x76,
2549 0xA9, 0x7C, 0xAB, 0x19, 0x13, 0x87, 0x8D, 0xA5, 0x61, 0xA6,

NetBurner, Inc.
22.205 certs_test.h 1123

2550 0x36, 0x57, 0x87, 0x3B, 0x64, 0x59, 0x9D, 0xBA, 0x9F, 0x67,
2551 0x72, 0x6A, 0x86, 0x84, 0xA6, 0x08, 0x31, 0x41, 0xD3, 0x48,
2552 0x09, 0x3B, 0x5E, 0x6C, 0x5F, 0x56, 0x55, 0x7F, 0xAD, 0x7E,
2553 0xC2, 0x27, 0xEE, 0x8A, 0xF1, 0x37, 0x51, 0xF7, 0x49, 0x80,
2554 0xA3, 0x65, 0x74, 0x11, 0xDD, 0xA7, 0xBE, 0xFA, 0x58, 0x7B,
2555 0x69, 0xB4, 0xC2, 0x9A, 0x35, 0x2F, 0xBE, 0x84, 0x4E, 0x2C,
2556 0x66, 0x5B, 0x38, 0x6F, 0x47, 0xBD, 0x30, 0x44, 0x0A, 0x02,
2557 0xAC, 0x8C, 0xB9, 0x66, 0x1E, 0x14, 0x2D, 0x90, 0x71, 0x42,
2558 0x12, 0xB7, 0x0E, 0x3A, 0x8B, 0xC5, 0x98, 0x65, 0xFD, 0x8F,
2559 0x53, 0x81, 0x7F, 0xE4, 0xD9, 0x58, 0x0E, 0xF5, 0xA9, 0x39,
2560 0xE4, 0x61, 0x02, 0x81, 0xC1, 0x00, 0xB3, 0x94, 0x8F, 0x2B,
2561 0xFD, 0x84, 0x2E, 0x83, 0x42, 0x86, 0x56, 0x7E, 0xB5, 0xF8,
2562 0x3C, 0xC5, 0x0C, 0xCB, 0xBD, 0x32, 0x0C, 0xD7, 0xAA, 0xA7,
2563 0xB0, 0xE9, 0xA4, 0x6A, 0xD1, 0x01, 0xDB, 0x87, 0x2A, 0xF7,
2564 0xDF, 0xEC, 0xC2, 0x03, 0x5D, 0x55, 0xA8, 0x66, 0x73, 0x79,
2565 0xA9, 0xAB, 0xBD, 0xAF, 0x69, 0x37, 0xFE, 0x41, 0xB5, 0x53,
2566 0xB3, 0xB2, 0xC0, 0xB1, 0x80, 0x34, 0xE6, 0xE1, 0x7B, 0xAE,
2567 0x67, 0xC7, 0xF3, 0x57, 0xFE, 0x12, 0xBC, 0x78, 0xAA, 0x75,
2568 0x0D, 0xAC, 0x79, 0x90, 0x14, 0x49, 0xFE, 0x6B, 0x51, 0xE3,
2569 0xE4, 0x46, 0xB2, 0x10, 0x4D, 0x05, 0x6A, 0x12, 0x80, 0x2A,
2570 0x8F, 0x39, 0x42, 0x0E, 0x3B, 0x24, 0x2B, 0x50, 0x5D, 0xF3,
2571 0xA7, 0x7F, 0x2F, 0x82, 0x89, 0x87, 0x9F, 0xF8, 0x7B, 0x1E,
2572 0x05, 0x6E, 0x75, 0x83, 0x04, 0x35, 0x66, 0x4A, 0x06, 0x57,
2573 0x39, 0xAB, 0x21, 0x0B, 0x94, 0x41, 0x6A, 0x2A, 0xC7, 0xDE,
2574 0x98, 0x45, 0x8F, 0x96, 0x1C, 0xF2, 0xD8, 0xFB, 0x9C, 0x10,
2575 0x8E, 0x41, 0x7A, 0xDD, 0xDD, 0x1D, 0xEF, 0xA5, 0x67, 0xEC,
2576 0xFE, 0xA3, 0x2D, 0xA9, 0xFD, 0xF3, 0xEE, 0x35, 0xF4, 0xA7,
2577 0xBC, 0xF9, 0x71, 0xCC, 0xB9, 0xC0, 0x5F, 0x58, 0x5B, 0xBD,
2578 0x1A, 0x9E, 0xC7, 0x08, 0x67, 0x7C, 0xC7, 0x51, 0x5B, 0xBE,
2579 0xE3, 0xF8, 0xBE, 0x1E, 0xC7, 0xD2, 0x28, 0x97
2580 };
2581 static const int sizeof_client_key_der_3072 = sizeof(client_key_der_3072);
2582
2583 /* ./certs/3072/client-keyPub.der, 3072-bit */
2584 static const unsigned char client_keypub_der_3072[] =
2585 {
2586 0x30, 0x82, 0x01, 0xA2, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86,
2587 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
2588 0x82, 0x01, 0x8F, 0x00, 0x30, 0x82, 0x01, 0x8A, 0x02, 0x82,
2589 0x01, 0x81, 0x00, 0xAC, 0x39, 0x50, 0x68, 0x8F, 0x78, 0xF8,
2590 0x10, 0x9B, 0x68, 0x96, 0xD3, 0xE1, 0x9C, 0x56, 0x68, 0x5A,
2591 0x41, 0x62, 0xE3, 0xB3, 0x41, 0xB0, 0x55, 0x80, 0x17, 0xB0,
2592 0x88, 0x16, 0x9B, 0xE0, 0x97, 0x74, 0x5F, 0x42, 0x79, 0x73,
2593 0x42, 0xDF, 0x93, 0xF3, 0xAA, 0x9D, 0xEE, 0x2D, 0x6F, 0xAA,
2594 0xBC, 0x27, 0x90, 0x84, 0xC0, 0x5D, 0xC7, 0xEC, 0x49, 0xEA,
2595 0x5C, 0x66, 0x1D, 0x70, 0x9C, 0x53, 0x5C, 0xBA, 0xA1, 0xB3,
2596 0x58, 0xC9, 0x3E, 0x8E, 0x9B, 0x72, 0x3D, 0x6E, 0x02, 0x02,
2597 0x00, 0x9C, 0x65, 0x56, 0x82, 0xA3, 0x22, 0xB4, 0x08, 0x5F,
2598 0x2A, 0xEF, 0xDF, 0x9A, 0xD0, 0xE7, 0x31, 0x59, 0x26, 0x5B,
2599 0x0B, 0x1C, 0x63, 0x61, 0xFF, 0xD5, 0x69, 0x32, 0x19, 0x06,
2600 0x7E, 0x0F, 0x40, 0x3C, 0x7A, 0x1E, 0xC8, 0xFC, 0x58, 0x6C,
2601 0x64, 0xAE, 0x10, 0x3D, 0xA8, 0x23, 0xFF, 0x8E, 0x1A, 0xCA,
2602 0x6A, 0x82, 0xE2, 0xF9, 0x01, 0x64, 0x2C, 0x97, 0xA0, 0x1A,
2603 0x89, 0xA0, 0x74, 0xD3, 0xB6, 0x05, 0x11, 0xF2, 0x62, 0x06,
2604 0x48, 0x2A, 0xF7, 0x66, 0xCE, 0xC1, 0x85, 0xE1, 0xD2, 0x27,
2605 0xEA, 0xCA, 0x12, 0xA5, 0x91, 0x97, 0x3E, 0xFC, 0x94, 0x06,
2606 0x59, 0x51, 0xC0, 0xE7, 0x13, 0xB6, 0x87, 0x7B, 0x5F, 0xD2,
2607 0xC0, 0x56, 0x2F, 0x5E, 0x1D, 0x02, 0xC3, 0x11, 0x2C, 0xDF,
2608 0xF7, 0x01, 0xDA, 0xBD, 0x85, 0x54, 0x35, 0x32, 0x5F, 0xC5,
2609 0xC8, 0xF9, 0x7A, 0x9F, 0x89, 0xF7, 0x03, 0x0E, 0x7E, 0x79,
2610 0x5D, 0x04, 0x82, 0x35, 0x10, 0xFE, 0x6D, 0x9B, 0xBF, 0xB8,
2611 0xEE, 0xE2, 0x62, 0x87, 0x26, 0x5E, 0x2F, 0x50, 0x2F, 0x78,
2612 0x0C, 0xE8, 0x73, 0x4F, 0x88, 0x6A, 0xD6, 0x26, 0xA4, 0xC9,
2613 0xFC, 0xFA, 0x1E, 0x8A, 0xB0, 0xF4, 0x32, 0xCF, 0x57, 0xCD,
2614 0xA1, 0x58, 0x8A, 0x49, 0x0F, 0xBB, 0xA9, 0x1D, 0x86, 0xAB,
2615 0xB9, 0x8F, 0x8D, 0x57, 0x19, 0xB2, 0x5A, 0x7E, 0xA4, 0xEA,
2616 0xCC, 0xB7, 0x96, 0x7A, 0x3B, 0x38, 0xCD, 0xDE, 0xE0, 0x61,
2617 0xFC, 0xC9, 0x06, 0x8F, 0x93, 0x5A, 0xCE, 0xAD, 0x2A, 0xE3,
2618 0x2D, 0x3E, 0x39, 0x5D, 0x41, 0x83, 0x01, 0x1F, 0x0F, 0xE1,
2619 0x7F, 0x76, 0xC7, 0x28, 0xDA, 0x56, 0xEF, 0xBF, 0xDC, 0x26,
2620 0x35, 0x40, 0xBE, 0xAD, 0xC7, 0x38, 0xAD, 0xA4, 0x06, 0xAC,
2621 0xCA, 0xE8, 0x51, 0xEB, 0xC0, 0xF8, 0x68, 0x02, 0x2C, 0x9B,
2622 0xA1, 0x14, 0xBC, 0xF8, 0x61, 0x86, 0xD7, 0x56, 0xD7, 0x73,
2623 0xF4, 0xAB, 0xBB, 0x6A, 0x21, 0xD3, 0x88, 0x22, 0xB4, 0xE7,
2624 0x6F, 0x7F, 0x91, 0xE5, 0x0E, 0xC6, 0x08, 0x49, 0xDE, 0xEA,
2625 0x13, 0x58, 0x72, 0xA0, 0xAA, 0x3A, 0xF9, 0x36, 0x03, 0x45,
2626 0x57, 0x5E, 0x87, 0xD2, 0x73, 0x65, 0xC4, 0x8C, 0xA3, 0xEE,
2627 0xC9, 0xD6, 0x73, 0x7C, 0x96, 0x41, 0x93, 0x02, 0x03, 0x01,
2628 0x00, 0x01
2629 };
2630 static const int sizeof_client_keypub_der_3072 = sizeof(client_keypub_der_3072);
2631
2632 /* ./certs/3072/client-cert.der, 3072-bit */
2633 static const unsigned char client_cert_der_3072[] =
2634 {
2635 0x30, 0x82, 0x06, 0x1D, 0x30, 0x82, 0x04, 0x85, 0xA0, 0x03,
2636 0x02, 0x01, 0x02, 0x02, 0x14, 0x56, 0x00, 0x73, 0xE4, 0xFD,

NetBurner, Inc.
1124 File Documentation

2637 0x16, 0x65, 0x63, 0x5E, 0xDE, 0x08, 0xF8, 0x2B, 0x19, 0x06,
2638 0x8D, 0xB4, 0x51, 0x33, 0x61, 0x30, 0x0D, 0x06, 0x09, 0x2A,
2639 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
2640 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55,
2641 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E,
2642 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E,
2643 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
2644 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D,
2645 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
2646 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C,
2647 0x5F, 0x33, 0x30, 0x37, 0x32, 0x31, 0x19, 0x30, 0x17, 0x06,
2648 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50, 0x72, 0x6F, 0x67,
2649 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67, 0x2D, 0x33, 0x30,
2650 0x37, 0x32, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
2651 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
2652 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
2653 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
2654 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
2655 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
2656 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
2657 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
2658 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
2659 0x32, 0x34, 0x5A, 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09,
2660 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
2661 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
2662 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
2663 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
2664 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06,
2665 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66,
2666 0x53, 0x53, 0x4C, 0x5F, 0x33, 0x30, 0x37, 0x32, 0x31, 0x19,
2667 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50,
2668 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67,
2669 0x2D, 0x33, 0x30, 0x37, 0x32, 0x31, 0x18, 0x30, 0x16, 0x06,
2670 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
2671 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
2672 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
2673 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
2674 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
2675 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x82, 0x01, 0xA2, 0x30, 0x0D,
2676 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01,
2677 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x8F, 0x00, 0x30, 0x82,
2678 0x01, 0x8A, 0x02, 0x82, 0x01, 0x81, 0x00, 0xAC, 0x39, 0x50,
2679 0x68, 0x8F, 0x78, 0xF8, 0x10, 0x9B, 0x68, 0x96, 0xD3, 0xE1,
2680 0x9C, 0x56, 0x68, 0x5A, 0x41, 0x62, 0xE3, 0xB3, 0x41, 0xB0,
2681 0x55, 0x80, 0x17, 0xB0, 0x88, 0x16, 0x9B, 0xE0, 0x97, 0x74,
2682 0x5F, 0x42, 0x79, 0x73, 0x42, 0xDF, 0x93, 0xF3, 0xAA, 0x9D,
2683 0xEE, 0x2D, 0x6F, 0xAA, 0xBC, 0x27, 0x90, 0x84, 0xC0, 0x5D,
2684 0xC7, 0xEC, 0x49, 0xEA, 0x5C, 0x66, 0x1D, 0x70, 0x9C, 0x53,
2685 0x5C, 0xBA, 0xA1, 0xB3, 0x58, 0xC9, 0x3E, 0x8E, 0x9B, 0x72,
2686 0x3D, 0x6E, 0x02, 0x02, 0x00, 0x9C, 0x65, 0x56, 0x82, 0xA3,
2687 0x22, 0xB4, 0x08, 0x5F, 0x2A, 0xEF, 0xDF, 0x9A, 0xD0, 0xE7,
2688 0x31, 0x59, 0x26, 0x5B, 0x0B, 0x1C, 0x63, 0x61, 0xFF, 0xD5,
2689 0x69, 0x32, 0x19, 0x06, 0x7E, 0x0F, 0x40, 0x3C, 0x7A, 0x1E,
2690 0xC8, 0xFC, 0x58, 0x6C, 0x64, 0xAE, 0x10, 0x3D, 0xA8, 0x23,
2691 0xFF, 0x8E, 0x1A, 0xCA, 0x6A, 0x82, 0xE2, 0xF9, 0x01, 0x64,
2692 0x2C, 0x97, 0xA0, 0x1A, 0x89, 0xA0, 0x74, 0xD3, 0xB6, 0x05,
2693 0x11, 0xF2, 0x62, 0x06, 0x48, 0x2A, 0xF7, 0x66, 0xCE, 0xC1,
2694 0x85, 0xE1, 0xD2, 0x27, 0xEA, 0xCA, 0x12, 0xA5, 0x91, 0x97,
2695 0x3E, 0xFC, 0x94, 0x06, 0x59, 0x51, 0xC0, 0xE7, 0x13, 0xB6,
2696 0x87, 0x7B, 0x5F, 0xD2, 0xC0, 0x56, 0x2F, 0x5E, 0x1D, 0x02,
2697 0xC3, 0x11, 0x2C, 0xDF, 0xF7, 0x01, 0xDA, 0xBD, 0x85, 0x54,
2698 0x35, 0x32, 0x5F, 0xC5, 0xC8, 0xF9, 0x7A, 0x9F, 0x89, 0xF7,
2699 0x03, 0x0E, 0x7E, 0x79, 0x5D, 0x04, 0x82, 0x35, 0x10, 0xFE,
2700 0x6D, 0x9B, 0xBF, 0xB8, 0xEE, 0xE2, 0x62, 0x87, 0x26, 0x5E,
2701 0x2F, 0x50, 0x2F, 0x78, 0x0C, 0xE8, 0x73, 0x4F, 0x88, 0x6A,
2702 0xD6, 0x26, 0xA4, 0xC9, 0xFC, 0xFA, 0x1E, 0x8A, 0xB0, 0xF4,
2703 0x32, 0xCF, 0x57, 0xCD, 0xA1, 0x58, 0x8A, 0x49, 0x0F, 0xBB,
2704 0xA9, 0x1D, 0x86, 0xAB, 0xB9, 0x8F, 0x8D, 0x57, 0x19, 0xB2,
2705 0x5A, 0x7E, 0xA4, 0xEA, 0xCC, 0xB7, 0x96, 0x7A, 0x3B, 0x38,
2706 0xCD, 0xDE, 0xE0, 0x61, 0xFC, 0xC9, 0x06, 0x8F, 0x93, 0x5A,
2707 0xCE, 0xAD, 0x2A, 0xE3, 0x2D, 0x3E, 0x39, 0x5D, 0x41, 0x83,
2708 0x01, 0x1F, 0x0F, 0xE1, 0x7F, 0x76, 0xC7, 0x28, 0xDA, 0x56,
2709 0xEF, 0xBF, 0xDC, 0x26, 0x35, 0x40, 0xBE, 0xAD, 0xC7, 0x38,
2710 0xAD, 0xA4, 0x06, 0xAC, 0xCA, 0xE8, 0x51, 0xEB, 0xC0, 0xF8,
2711 0x68, 0x02, 0x2C, 0x9B, 0xA1, 0x14, 0xBC, 0xF8, 0x61, 0x86,
2712 0xD7, 0x56, 0xD7, 0x73, 0xF4, 0xAB, 0xBB, 0x6A, 0x21, 0xD3,
2713 0x88, 0x22, 0xB4, 0xE7, 0x6F, 0x7F, 0x91, 0xE5, 0x0E, 0xC6,
2714 0x08, 0x49, 0xDE, 0xEA, 0x13, 0x58, 0x72, 0xA0, 0xAA, 0x3A,
2715 0xF9, 0x36, 0x03, 0x45, 0x57, 0x5E, 0x87, 0xD2, 0x73, 0x65,
2716 0xC4, 0x8C, 0xA3, 0xEE, 0xC9, 0xD6, 0x73, 0x7C, 0x96, 0x41,
2717 0x93, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82, 0x01, 0x4F,
2718 0x30, 0x82, 0x01, 0x4B, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
2719 0x0E, 0x04, 0x16, 0x04, 0x14, 0x3D, 0xD1, 0x84, 0xC2, 0xAF,
2720 0xB0, 0x20, 0x49, 0xBC, 0x74, 0x87, 0x41, 0x38, 0xAB, 0xBA,
2721 0xD2, 0xD4, 0x0C, 0xA3, 0xA8, 0x30, 0x81, 0xDE, 0x06, 0x03,
2722 0x55, 0x1D, 0x23, 0x04, 0x81, 0xD6, 0x30, 0x81, 0xD3, 0x80,
2723 0x14, 0x3D, 0xD1, 0x84, 0xC2, 0xAF, 0xB0, 0x20, 0x49, 0xBC,

NetBurner, Inc.
22.205 certs_test.h 1125

2724 0x74, 0x87, 0x41, 0x38, 0xAB, 0xBA, 0xD2, 0xD4, 0x0C, 0xA3,
2725 0xA8, 0xA1, 0x81, 0xA4, 0xA4, 0x81, 0xA1, 0x30, 0x81, 0x9E,
2726 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
2727 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
2728 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E,
2729 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07,
2730 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31,
2731 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C,
2732 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x5F, 0x33, 0x30,
2733 0x37, 0x32, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04,
2734 0x0B, 0x0C, 0x10, 0x50, 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D,
2735 0x6D, 0x69, 0x6E, 0x67, 0x2D, 0x33, 0x30, 0x37, 0x32, 0x31,
2736 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F,
2737 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73,
2738 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06,
2739 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01,
2740 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C,
2741 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14,
2742 0x56, 0x00, 0x73, 0xE4, 0xFD, 0x16, 0x65, 0x63, 0x5E, 0xDE,
2743 0x08, 0xF8, 0x2B, 0x19, 0x06, 0x8D, 0xB4, 0x51, 0x33, 0x61,
2744 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30,
2745 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x1D,
2746 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65, 0x78, 0x61,
2747 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x87, 0x04,
2748 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
2749 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, 0x01,
2750 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01,
2751 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06, 0x09, 0x2A,
2752 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
2753 0x03, 0x82, 0x01, 0x81, 0x00, 0x4C, 0xA2, 0x6C, 0xFD, 0x0B,
2754 0x7C, 0x96, 0x1B, 0x79, 0xE6, 0xBB, 0x8C, 0xEC, 0x41, 0x8D,
2755 0xA5, 0xF1, 0x23, 0xFE, 0x5D, 0x04, 0x96, 0x29, 0x3D, 0x77,
2756 0x41, 0xA2, 0x66, 0xC2, 0xCB, 0x3F, 0x1B, 0xDA, 0x8F, 0x48,
2757 0x49, 0xF8, 0x5C, 0x34, 0xD4, 0x66, 0x2D, 0x7A, 0x9E, 0xA3,
2758 0x55, 0x7F, 0x7B, 0xA5, 0x08, 0xFA, 0x04, 0xF9, 0x93, 0x1D,
2759 0x36, 0x9C, 0x56, 0x0E, 0x4F, 0x3E, 0xC8, 0x73, 0x72, 0x71,
2760 0x64, 0x8A, 0xDD, 0x95, 0x9F, 0x85, 0x8A, 0x7D, 0x3E, 0x07,
2761 0xA4, 0x50, 0x3B, 0x5C, 0xFA, 0xDE, 0x56, 0x66, 0x8D, 0x5B,
2762 0x8F, 0xAF, 0xCE, 0xFA, 0x2D, 0x51, 0x99, 0xD5, 0x77, 0x3B,
2763 0xAE, 0x92, 0x0B, 0x88, 0x69, 0x09, 0x29, 0xCD, 0x08, 0x11,
2764 0x24, 0x35, 0x82, 0x9E, 0x4B, 0xDA, 0xC0, 0x7D, 0x41, 0x4C,
2765 0x9F, 0x8A, 0xC7, 0x56, 0xCF, 0x60, 0x92, 0x05, 0x18, 0xEB,
2766 0x95, 0x5D, 0xE5, 0x64, 0x24, 0x26, 0xD1, 0x52, 0xCC, 0xC0,
2767 0x24, 0x13, 0xD1, 0x6A, 0x69, 0xB3, 0xC1, 0xB6, 0x17, 0x0F,
2768 0x89, 0xFF, 0x2E, 0x41, 0x0E, 0x27, 0xBE, 0x32, 0xE5, 0x98,
2769 0x9F, 0x72, 0xA6, 0x88, 0xAE, 0x4B, 0xE7, 0xD4, 0xBA, 0x06,
2770 0x81, 0x4A, 0x88, 0xEE, 0x39, 0x45, 0x7A, 0xCE, 0xB7, 0xF6,
2771 0xBC, 0xAA, 0xD6, 0x44, 0xEF, 0x01, 0xE1, 0xD4, 0xAA, 0x24,
2772 0x64, 0xDE, 0x4E, 0xA4, 0x08, 0xD2, 0xB7, 0x8C, 0xDA, 0xFC,
2773 0xA1, 0x95, 0xD1, 0x5B, 0x44, 0x0E, 0xAF, 0xB0, 0xFC, 0x53,
2774 0x3C, 0x80, 0x3F, 0x40, 0x05, 0xB1, 0x18, 0x49, 0xA8, 0xFE,
2775 0xBC, 0xFB, 0x74, 0x25, 0x4A, 0x30, 0xB3, 0xF0, 0x83, 0xBA,
2776 0xFC, 0x95, 0x9C, 0x4D, 0xC1, 0x01, 0x94, 0x94, 0x5A, 0x0C,
2777 0x03, 0xD8, 0x98, 0xB3, 0x95, 0xE0, 0x70, 0x1A, 0x1E, 0xF4,
2778 0x12, 0x74, 0xB5, 0x8C, 0x13, 0x2F, 0x93, 0x8F, 0x5E, 0x0E,
2779 0x70, 0x3F, 0x75, 0xED, 0x52, 0x6F, 0x86, 0xB3, 0xB8, 0xCA,
2780 0x7C, 0xF2, 0xE9, 0x1D, 0x83, 0xBB, 0xA1, 0x90, 0xE7, 0x81,
2781 0x01, 0x48, 0x47, 0x67, 0x6F, 0xEC, 0xE4, 0x6D, 0x8B, 0x90,
2782 0xB8, 0xEE, 0x4D, 0x59, 0x82, 0x0C, 0xB6, 0x7B, 0x4C, 0xD2,
2783 0x3B, 0x70, 0x8E, 0xE5, 0x10, 0x76, 0x88, 0x8E, 0x76, 0x55,
2784 0xDD, 0xBB, 0x39, 0xC3, 0xAF, 0x3E, 0xB5, 0xFB, 0xC7, 0xFB,
2785 0x5E, 0x9B, 0x55, 0xE3, 0x9B, 0x10, 0xF1, 0x91, 0x05, 0x1E,
2786 0x72, 0x8D, 0xF0, 0x51, 0x33, 0x7F, 0x9E, 0x4D, 0xFB, 0xEA,
2787 0x91, 0x27, 0x45, 0x0C, 0xAA, 0x94, 0x94, 0x9E, 0x4E, 0x09,
2788 0xF2, 0x06, 0x17, 0x74, 0xDC, 0x8D, 0x6D, 0xB0, 0x53, 0x13,
2789 0x3F, 0xB3, 0x4E, 0x34, 0xC8, 0x0A, 0x93, 0xB9, 0xCF, 0x22,
2790 0xC3, 0xE2, 0xC9, 0xAD, 0x31, 0xC1, 0xE4, 0x45, 0x58, 0xF4,
2791 0x40, 0x2B, 0xA9, 0xD5, 0xB0, 0xC3, 0x68, 0x74, 0x81
2792 };
2793 static const int sizeof_client_cert_der_3072 = sizeof(client_cert_der_3072);
2794
2795 #endif /* USE_CERT_BUFFERS_3072 */
2796
2797 #ifdef USE_CERT_BUFFERS_4096
2798
2799 /* ./certs/4096/client-key.der, 4096-bit */
2800 static const unsigned char client_key_der_4096[] =
2801 {
2802 0x30, 0x82, 0x09, 0x28, 0x02, 0x01, 0x00, 0x02, 0x82, 0x02,
2803 0x01, 0x00, 0xF5, 0xD0, 0x31, 0xE4, 0x71, 0x59, 0x58, 0xB3,
2804 0x07, 0x50, 0xDD, 0x16, 0x79, 0xFC, 0xC6, 0x95, 0x50, 0xFC,
2805 0x46, 0x0E, 0x57, 0x12, 0x86, 0x71, 0x8D, 0xE3, 0x9B, 0x4A,
2806 0x33, 0xEA, 0x4F, 0xD9, 0x17, 0x13, 0x6D, 0x48, 0x69, 0xDF,
2807 0x59, 0x11, 0x08, 0x02, 0x9D, 0xAF, 0x2B, 0xC7, 0x30, 0xBE,
2808 0x0C, 0xDC, 0x87, 0xD4, 0x5A, 0x12, 0x09, 0x23, 0x5D, 0xE1,
2809 0x76, 0x5A, 0x62, 0x37, 0x46, 0x74, 0xEF, 0x03, 0x05, 0xBB,
2810 0x1E, 0x6D, 0x29, 0x75, 0x6C, 0x2E, 0x9D, 0x87, 0x0D, 0x8F,

NetBurner, Inc.
1126 File Documentation

2811 0x87, 0xCB, 0x14, 0x95, 0x9B, 0xBE, 0x17, 0x6B, 0x51, 0xD1,
2812 0x4C, 0xDA, 0xD7, 0x91, 0x66, 0xC5, 0x36, 0xEB, 0xE0, 0x07,
2813 0x1A, 0x76, 0x4D, 0xB0, 0xFB, 0xC1, 0xF5, 0x5E, 0x05, 0xDB,
2814 0xBA, 0xCB, 0x25, 0xD9, 0x99, 0x13, 0x1C, 0xC0, 0x35, 0xDC,
2815 0x40, 0xE9, 0x36, 0xCD, 0xC4, 0xD5, 0x7A, 0x41, 0x70, 0x0F,
2816 0x36, 0xEB, 0xA5, 0x4E, 0x17, 0x05, 0xD5, 0x75, 0x1B, 0x64,
2817 0x62, 0x7A, 0x3F, 0x0D, 0x28, 0x48, 0x6A, 0xE3, 0xAC, 0x9C,
2818 0xA8, 0x8F, 0xE9, 0xED, 0xF7, 0xCD, 0x24, 0xA0, 0xB1, 0xA0,
2819 0x03, 0xAC, 0xE3, 0x03, 0xF5, 0x3F, 0xD1, 0x96, 0xFF, 0x2A,
2820 0x7E, 0x08, 0xB1, 0xD3, 0xE0, 0x18, 0x14, 0xEC, 0x65, 0x37,
2821 0x50, 0x43, 0xC2, 0x6A, 0x8C, 0xF4, 0x5B, 0xFE, 0xC4, 0xCB,
2822 0x8D, 0x3F, 0x81, 0x02, 0xF7, 0xC2, 0xDD, 0xE4, 0xC1, 0x8E,
2823 0x80, 0x0C, 0x04, 0x25, 0x2D, 0x80, 0x5A, 0x2E, 0x0F, 0x22,
2824 0x35, 0x4A, 0xF4, 0x85, 0xED, 0x51, 0xD8, 0xAB, 0x6D, 0x8F,
2825 0xA2, 0x3B, 0x24, 0x00, 0x6E, 0x81, 0xE2, 0x1E, 0x76, 0xD6,
2826 0xAC, 0x31, 0x12, 0xDB, 0xF3, 0x8E, 0x07, 0xA1, 0xDE, 0x89,
2827 0x4A, 0x39, 0x60, 0x77, 0xC5, 0xAA, 0xF1, 0x51, 0xE6, 0x06,
2828 0xF1, 0x95, 0x56, 0x2A, 0xE1, 0x8E, 0x92, 0x30, 0x9F, 0xFE,
2829 0x58, 0x44, 0xAC, 0x46, 0xF2, 0xFD, 0x9A, 0xFC, 0xA8, 0x1D,
2830 0xA1, 0xD3, 0x55, 0x37, 0x4A, 0x8B, 0xFC, 0x9C, 0x33, 0xF8,
2831 0xA7, 0x61, 0x48, 0x41, 0x7C, 0x9C, 0x77, 0x3F, 0xF5, 0x80,
2832 0x23, 0x7D, 0x43, 0xB4, 0xD5, 0x88, 0x0A, 0xC9, 0x75, 0xD7,
2833 0x44, 0x19, 0x4D, 0x77, 0x6C, 0x0B, 0x0A, 0x49, 0xAA, 0x1C,
2834 0x2F, 0xD6, 0x5A, 0x44, 0xA6, 0x47, 0x4D, 0xE5, 0x36, 0x96,
2835 0x40, 0x99, 0x2C, 0x56, 0x26, 0xB1, 0xF2, 0x92, 0x31, 0x59,
2836 0xD7, 0x2C, 0xD4, 0xB4, 0x21, 0xD6, 0x65, 0x13, 0x0B, 0x3E,
2837 0xFB, 0xFF, 0x04, 0xEB, 0xB9, 0x85, 0xB9, 0xD8, 0xD8, 0x28,
2838 0x4F, 0x5C, 0x17, 0x96, 0xA3, 0x51, 0xBE, 0xFE, 0x7D, 0x0B,
2839 0x1B, 0x48, 0x40, 0x25, 0x76, 0x94, 0xDC, 0x41, 0xFB, 0xBF,
2840 0x73, 0x76, 0xDA, 0xEB, 0xB3, 0x62, 0xE7, 0xC1, 0xC8, 0x54,
2841 0x6A, 0x93, 0xE1, 0x8D, 0x31, 0xE8, 0x3E, 0x3E, 0xDF, 0xBC,
2842 0x87, 0x02, 0x30, 0x22, 0x57, 0xC4, 0xE0, 0x18, 0x7A, 0xD3,
2843 0xAE, 0xE4, 0x02, 0x9B, 0xAA, 0xBD, 0x4E, 0x49, 0x47, 0x72,
2844 0xE9, 0x8D, 0x13, 0x2D, 0x54, 0x9B, 0x00, 0xA7, 0x91, 0x61,
2845 0x71, 0xC9, 0xCC, 0x48, 0x4F, 0xEE, 0xDF, 0x5E, 0x1B, 0x1A,
2846 0xDF, 0x67, 0xD3, 0x20, 0xE6, 0x44, 0x45, 0x98, 0x7E, 0xE7,
2847 0x0E, 0x63, 0x16, 0x83, 0xC9, 0x26, 0x5D, 0x90, 0xC1, 0xE5,
2848 0x2A, 0x5C, 0x45, 0x54, 0x13, 0xB2, 0x81, 0x18, 0x06, 0x20,
2849 0x2E, 0x2E, 0x66, 0x5A, 0xB5, 0x7B, 0x6E, 0xD6, 0x0C, 0x4E,
2850 0x89, 0x01, 0x56, 0x70, 0xBB, 0xAE, 0xDE, 0xE9, 0x99, 0x5E,
2851 0xD1, 0xB9, 0x3A, 0xB7, 0x6C, 0x17, 0xB6, 0x03, 0xA9, 0x08,
2852 0xDD, 0x9C, 0xF4, 0x14, 0xC9, 0xC9, 0x59, 0x39, 0x72, 0xD4,
2853 0x7E, 0x02, 0x37, 0x31, 0xCD, 0x0E, 0xA7, 0x3D, 0xF8, 0xF2,
2854 0xCF, 0x6B, 0x15, 0xAB, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02,
2855 0x82, 0x02, 0x01, 0x00, 0xC5, 0x76, 0x57, 0x7D, 0xF1, 0x68,
2856 0x1A, 0x8E, 0xC6, 0x63, 0xB9, 0x16, 0xA3, 0x2B, 0xE1, 0xC2,
2857 0x74, 0xEA, 0x12, 0xC4, 0xD6, 0x41, 0x75, 0x6A, 0xA6, 0xD6,
2858 0x9E, 0x1A, 0x7F, 0x95, 0xCC, 0x4A, 0xD1, 0xF4, 0xB3, 0x27,
2859 0x26, 0x95, 0x5A, 0x91, 0x09, 0xE4, 0x40, 0x13, 0x45, 0x91,
2860 0x9F, 0xA0, 0x2B, 0xE8, 0xC3, 0xDC, 0x5B, 0xF6, 0x7D, 0x0C,
2861 0xC2, 0x0F, 0xA9, 0xE9, 0x75, 0x58, 0x7D, 0xEA, 0xD5, 0x4D,
2862 0x92, 0x3E, 0xFC, 0x74, 0x28, 0x87, 0xC1, 0x3D, 0xB9, 0x21,
2863 0x92, 0x4D, 0x28, 0x82, 0x84, 0xA8, 0xA2, 0x11, 0x93, 0xF2,
2864 0x8C, 0x29, 0x1C, 0x19, 0xF8, 0x6D, 0x3F, 0x27, 0x51, 0xB5,
2865 0x2D, 0xA3, 0xC7, 0x28, 0x1D, 0xC4, 0xFC, 0x98, 0x94, 0xA8,
2866 0xD0, 0xFF, 0xF0, 0x0F, 0xDC, 0xF9, 0xED, 0xB3, 0xA2, 0xB6,
2867 0xED, 0x0D, 0x5F, 0xBF, 0x78, 0x5C, 0xD7, 0xAF, 0xBD, 0xA3,
2868 0xEF, 0x86, 0xE9, 0x51, 0x66, 0xDB, 0x52, 0x37, 0x47, 0x7F,
2869 0xE9, 0x5F, 0x3C, 0x94, 0x83, 0x2D, 0xE8, 0x9C, 0x33, 0xF1,
2870 0x6C, 0xE9, 0xF3, 0xA6, 0x97, 0xFE, 0xA7, 0xBF, 0x4D, 0x9B,
2871 0x20, 0xD5, 0x2F, 0xDE, 0xA4, 0x06, 0xBB, 0xEE, 0x66, 0x49,
2872 0x6B, 0xF5, 0x10, 0x85, 0x9F, 0x84, 0x5A, 0x52, 0x3E, 0x0C,
2873 0xA0, 0x4A, 0x4C, 0xDA, 0x01, 0xC5, 0x62, 0x31, 0xB1, 0xEC,
2874 0xF8, 0xDD, 0xA3, 0x3B, 0xCE, 0x41, 0x3A, 0x12, 0x79, 0xF9,
2875 0x97, 0x5B, 0x07, 0x95, 0x9F, 0x86, 0xD6, 0x04, 0x73, 0x6C,
2876 0xE8, 0x8F, 0x4C, 0x4C, 0x48, 0x1D, 0x85, 0xC4, 0xE7, 0xCE,
2877 0xDE, 0x16, 0x31, 0xF6, 0x5C, 0x37, 0x54, 0x8E, 0x55, 0xBC,
2878 0xAF, 0x2E, 0x47, 0xE8, 0xAC, 0x03, 0xB0, 0xA4, 0xF9, 0x90,
2879 0x98, 0x99, 0xA4, 0xDC, 0x6E, 0x98, 0x08, 0x5C, 0x07, 0xBB,
2880 0x08, 0x93, 0xAF, 0x61, 0x8D, 0x74, 0xA8, 0xF8, 0xC4, 0x89,
2881 0x64, 0x10, 0xE1, 0xE6, 0xC0, 0xCD, 0x1D, 0x39, 0x20, 0xD6,
2882 0x5A, 0x89, 0x83, 0xFC, 0x37, 0xE2, 0x12, 0x66, 0xA8, 0x12,
2883 0xCC, 0x72, 0xBB, 0x1E, 0xFB, 0x6A, 0xE3, 0x7C, 0x71, 0x7E,
2884 0xB9, 0x2E, 0x8E, 0x84, 0x66, 0xE1, 0xB9, 0xD0, 0x25, 0x9A,
2885 0x6F, 0x9D, 0x19, 0xE6, 0x7E, 0xE8, 0xD8, 0xF0, 0xC5, 0x23,
2886 0x16, 0x9A, 0x68, 0x2C, 0x1D, 0x55, 0xAE, 0x8E, 0x90, 0xEE,
2887 0x8E, 0xEC, 0x5E, 0x46, 0x9D, 0x60, 0x52, 0x32, 0x17, 0x28,
2888 0x59, 0xC4, 0x49, 0x2A, 0x20, 0x3E, 0x95, 0xC5, 0xDF, 0xF6,
2889 0x3D, 0xF7, 0xC5, 0xCF, 0xB1, 0xC2, 0xC9, 0x76, 0xF8, 0x3D,
2890 0xBE, 0xF4, 0x63, 0xFC, 0x2A, 0x00, 0x6F, 0x99, 0xA6, 0xB6,
2891 0xAD, 0x35, 0xEE, 0xDE, 0xC5, 0xE0, 0x97, 0xC6, 0x73, 0xEE,
2892 0x33, 0xA0, 0xA8, 0xFC, 0x4C, 0x8F, 0xF2, 0x8C, 0x61, 0xFB,
2893 0x03, 0x19, 0xA1, 0xE8, 0x17, 0x4E, 0xE3, 0x21, 0x58, 0xCE,
2894 0xFE, 0xF2, 0x5F, 0xBB, 0xDD, 0x4F, 0xF7, 0x18, 0xCB, 0x35,
2895 0x57, 0xDD, 0xE5, 0x50, 0x2A, 0x7B, 0x1A, 0xE9, 0x12, 0xF2,
2896 0x7A, 0x11, 0xB1, 0x43, 0xB9, 0x70, 0x07, 0x0C, 0x8F, 0x69,
2897 0xB9, 0xE5, 0xA5, 0xC9, 0xE2, 0x1B, 0x96, 0x74, 0x11, 0xF5,

NetBurner, Inc.
22.205 certs_test.h 1127

2898 0x95, 0xB9, 0x58, 0xC0, 0xBD, 0x37, 0xFB, 0x28, 0x2A, 0xBD,
2899 0x84, 0xB1, 0x2B, 0x67, 0x42, 0x82, 0xC3, 0x95, 0x55, 0x45,
2900 0xD5, 0xEA, 0xC3, 0x8A, 0x42, 0x3A, 0x43, 0x17, 0x5E, 0xCD,
2901 0xD2, 0xEA, 0xFC, 0xDF, 0x67, 0xEC, 0xE1, 0x6C, 0xA8, 0x03,
2902 0x19, 0xB2, 0x1D, 0x4A, 0x5F, 0x4F, 0xE7, 0xD3, 0xE0, 0x86,
2903 0xC5, 0x1A, 0x10, 0xC3, 0x08, 0xD2, 0xED, 0x85, 0x93, 0x08,
2904 0x51, 0x05, 0xA6, 0x37, 0x15, 0x32, 0xBD, 0x6C, 0x73, 0x63,
2905 0x01, 0x5D, 0x5B, 0x4F, 0x6A, 0xDC, 0x6D, 0x1D, 0x55, 0x91,
2906 0x21, 0xE4, 0x8E, 0xB7, 0xF0, 0x81, 0x02, 0x82, 0x01, 0x01,
2907 0x00, 0xFD, 0x27, 0xC8, 0xFE, 0x76, 0x5C, 0x89, 0x32, 0xCB,
2908 0x8A, 0x22, 0x87, 0x61, 0x48, 0x91, 0x4A, 0x05, 0xAD, 0xA4,
2909 0x5C, 0x8A, 0xCA, 0x5C, 0x02, 0x88, 0x7E, 0x51, 0xC5, 0x66,
2910 0x90, 0x2C, 0xA3, 0xED, 0xA7, 0x43, 0x19, 0x0B, 0xA2, 0x42,
2911 0xB4, 0xE0, 0xE0, 0x45, 0xBF, 0xFE, 0xA0, 0xF2, 0x75, 0x0B,
2912 0x8E, 0x7D, 0x9D, 0x73, 0x67, 0xD3, 0x10, 0x09, 0xC5, 0xD9,
2913 0x8C, 0xAD, 0x3A, 0x64, 0x72, 0xAD, 0x96, 0x35, 0x91, 0x0F,
2914 0x4B, 0xC9, 0xBD, 0x4F, 0x65, 0x47, 0xA6, 0x2D, 0xEB, 0x3F,
2915 0xE2, 0x99, 0x72, 0x66, 0x12, 0xED, 0xEB, 0xD2, 0x7C, 0xFF,
2916 0x3A, 0x20, 0x37, 0x2A, 0xD3, 0x65, 0x51, 0x9B, 0xC3, 0xAA,
2917 0x18, 0xB1, 0x1F, 0x6E, 0x9D, 0x40, 0x47, 0xA4, 0x1F, 0x82,
2918 0x9B, 0xDB, 0x50, 0x6B, 0x86, 0x2F, 0xFB, 0x3F, 0x31, 0xB9,
2919 0x81, 0x11, 0x04, 0x14, 0x63, 0x86, 0x4F, 0x40, 0x2A, 0xF5,
2920 0xF9, 0x7C, 0xA1, 0x78, 0x19, 0x13, 0xD0, 0x51, 0x51, 0x0F,
2921 0x79, 0x88, 0x8D, 0x14, 0xA3, 0xDE, 0xB6, 0x33, 0x29, 0x42,
2922 0xB9, 0xE8, 0x59, 0x76, 0xF7, 0x43, 0x1A, 0xB6, 0xA6, 0xDF,
2923 0x0A, 0xC1, 0x42, 0xC7, 0x3F, 0x1C, 0x7E, 0x5C, 0x2C, 0x91,
2924 0x4B, 0x1E, 0xF8, 0x46, 0x91, 0x1F, 0xEE, 0x56, 0xB3, 0x0E,
2925 0xC8, 0xD0, 0x31, 0xD3, 0x3D, 0xED, 0x3D, 0xD9, 0xC5, 0x30,
2926 0x0C, 0x58, 0xD8, 0xB7, 0xB5, 0xEC, 0x14, 0xAC, 0x41, 0x64,
2927 0x6D, 0xE4, 0xC6, 0x59, 0xFD, 0x14, 0x05, 0x60, 0x65, 0xD8,
2928 0xC4, 0x84, 0x44, 0x7E, 0x1B, 0xB4, 0xA4, 0x16, 0x75, 0xC1,
2929 0x27, 0x96, 0xB2, 0x19, 0xD6, 0x39, 0x54, 0xC0, 0x93, 0xF3,
2930 0xD7, 0x1F, 0xCD, 0x1B, 0xDF, 0xF8, 0x12, 0x88, 0x14, 0x9F,
2931 0x98, 0x05, 0x47, 0x46, 0x71, 0x81, 0x6C, 0xDF, 0x91, 0xEF,
2932 0x53, 0xE3, 0xC5, 0xB1, 0x89, 0x2F, 0xE1, 0x02, 0x82, 0x01,
2933 0x01, 0x00, 0xF8, 0x93, 0x4A, 0x28, 0x77, 0x94, 0xEF, 0xE9,
2934 0xC4, 0x0A, 0xC3, 0xE8, 0x52, 0x59, 0xB6, 0x1D, 0x8D, 0xCE,
2935 0x14, 0xE7, 0x43, 0xC6, 0xED, 0x09, 0x27, 0x5D, 0xF3, 0x8E,
2936 0x08, 0x6A, 0x19, 0x6B, 0x2C, 0x97, 0x9B, 0x88, 0x53, 0x2B,
2937 0xDA, 0xFE, 0x4B, 0x94, 0x66, 0x84, 0xD5, 0xA9, 0xCE, 0xA5,
2938 0x43, 0x70, 0xFB, 0x01, 0x5A, 0x6F, 0xCD, 0xF7, 0xD1, 0x9D,
2939 0x51, 0xEE, 0xA0, 0xDC, 0x46, 0xF5, 0x7D, 0xA7, 0xEE, 0xA0,
2940 0x86, 0xB7, 0x83, 0xFF, 0x21, 0x8B, 0x76, 0x05, 0x7D, 0xDE,
2941 0xC4, 0x26, 0x36, 0xBC, 0xB4, 0x8A, 0x48, 0xC3, 0x06, 0x90,
2942 0x97, 0xE5, 0xA6, 0x38, 0xC3, 0xE6, 0x7C, 0xD0, 0xF8, 0x23,
2943 0xD2, 0x33, 0x1F, 0x81, 0xC3, 0xE3, 0x7D, 0x85, 0x5A, 0x38,
2944 0x10, 0x03, 0xE6, 0x88, 0xDB, 0xC8, 0x4C, 0xD0, 0xF7, 0xB2,
2945 0x4D, 0x27, 0x33, 0x85, 0xCD, 0x3A, 0x74, 0x83, 0x6B, 0x82,
2946 0x58, 0xD9, 0xDF, 0xEE, 0xF5, 0xD3, 0xE9, 0xFE, 0x1C, 0xEF,
2947 0x06, 0x12, 0x16, 0xD1, 0x4C, 0xAE, 0x54, 0x4B, 0x0D, 0x1A,
2948 0xBD, 0xE2, 0xCF, 0x56, 0xB3, 0x74, 0xBE, 0x44, 0x4F, 0xA4,
2949 0x73, 0x0A, 0x98, 0x8D, 0x61, 0x84, 0x38, 0x46, 0xDC, 0x95,
2950 0xCF, 0x3F, 0x6B, 0xE7, 0x65, 0x87, 0x02, 0xBF, 0x4B, 0x57,
2951 0xE2, 0x3D, 0xC4, 0x2B, 0x1C, 0x82, 0x1D, 0xCC, 0x13, 0x7F,
2952 0xC0, 0x06, 0x12, 0x8C, 0x6F, 0x97, 0x50, 0x7B, 0x8C, 0x81,
2953 0xC3, 0x23, 0x15, 0xEB, 0x70, 0x07, 0x8E, 0xA1, 0x07, 0x1E,
2954 0x59, 0xFA, 0x10, 0xCA, 0x7E, 0x0F, 0xE2, 0xBB, 0xEE, 0x86,
2955 0x26, 0x1E, 0x55, 0xB9, 0x98, 0x66, 0x85, 0xEC, 0x27, 0xC5,
2956 0xD9, 0x63, 0x8D, 0x51, 0x77, 0xAA, 0xA0, 0x36, 0x55, 0x33,
2957 0x10, 0x21, 0x5E, 0xEC, 0x47, 0x67, 0x71, 0xD1, 0xAF, 0xFC,
2958 0x3E, 0x50, 0xF5, 0xBE, 0xD6, 0x92, 0xE7, 0x0B, 0x02, 0x82,
2959 0x01, 0x00, 0x21, 0x7C, 0x8A, 0xC4, 0xC6, 0x29, 0x55, 0x68,
2960 0xA7, 0xAD, 0xDD, 0x05, 0x65, 0x63, 0xF0, 0xFC, 0x06, 0xA6,
2961 0x42, 0x70, 0x8F, 0x57, 0x57, 0x36, 0x6A, 0x91, 0xB3, 0x05,
2962 0x56, 0x9C, 0xC9, 0x9A, 0xE1, 0x8B, 0xD7, 0x7F, 0x4F, 0x9F,
2963 0xA6, 0x0D, 0x41, 0x15, 0xC9, 0x84, 0x2D, 0x0D, 0x63, 0x25,
2964 0x02, 0x63, 0x55, 0xD0, 0x66, 0xFC, 0x9B, 0xD9, 0xAA, 0x41,
2965 0x46, 0x96, 0xAA, 0x2F, 0x68, 0x2C, 0x17, 0x34, 0x20, 0x5F,
2966 0xD0, 0xD3, 0x28, 0x9B, 0x67, 0x0E, 0x31, 0x9D, 0x14, 0xC3,
2967 0xE2, 0x8E, 0x79, 0xD7, 0xBD, 0x12, 0xD1, 0xEF, 0xF8, 0xC6,
2968 0xDA, 0x07, 0xF9, 0x4C, 0xF2, 0xD8, 0x45, 0xB5, 0xB6, 0xD1,
2969 0xFA, 0x05, 0x0C, 0x20, 0xE9, 0x43, 0xD9, 0xC5, 0xE0, 0x3A,
2970 0xDE, 0xCE, 0xF9, 0x02, 0xB9, 0x46, 0x65, 0xC0, 0x69, 0x4A,
2971 0x8D, 0x8C, 0x3A, 0x10, 0xFD, 0x15, 0x71, 0x25, 0xB8, 0x8A,
2972 0x36, 0x41, 0x4B, 0x30, 0x1C, 0xAF, 0xCC, 0x84, 0x28, 0xCD,
2973 0x7D, 0x2B, 0x89, 0x59, 0x88, 0x1A, 0x69, 0x12, 0x56, 0xD0,
2974 0x25, 0x68, 0x6C, 0x08, 0xB1, 0x88, 0xE1, 0x92, 0x7E, 0x08,
2975 0xB2, 0xC6, 0x3C, 0x6C, 0x35, 0xE8, 0xEE, 0x3E, 0xF4, 0xB8,
2976 0x5C, 0x7B, 0xC0, 0x5B, 0xFD, 0x11, 0xA3, 0x54, 0xA6, 0x99,
2977 0x46, 0xE2, 0x5F, 0x4F, 0xC7, 0xEE, 0x90, 0x1C, 0x37, 0x5B,
2978 0x33, 0x10, 0xDF, 0x0B, 0xC3, 0xB9, 0x47, 0xC2, 0x30, 0x4A,
2979 0xF2, 0x1A, 0xEB, 0x41, 0x25, 0x94, 0x29, 0x7A, 0xD0, 0x96,
2980 0x88, 0x46, 0xEE, 0x6C, 0x14, 0xF6, 0x5B, 0x3D, 0xBD, 0x4E,
2981 0xD4, 0x3F, 0x05, 0x5B, 0x07, 0xB9, 0xE3, 0x99, 0x87, 0x63,
2982 0xCA, 0xC4, 0x71, 0x0B, 0x73, 0x9D, 0x7B, 0xB6, 0x0F, 0xD4,
2983 0x12, 0x8C, 0x4C, 0x5E, 0x72, 0x3D, 0xFF, 0x6D, 0xC4, 0x61,
2984 0x0C, 0x74, 0x5F, 0x53, 0xBE, 0x39, 0x34, 0x61, 0x02, 0x82,

NetBurner, Inc.
1128 File Documentation

2985 0x01, 0x00, 0x5F, 0xF2, 0xF2, 0xB0, 0x16, 0x20, 0x8E, 0x4E,
2986 0xCC, 0x96, 0x5F, 0x32, 0x80, 0xFF, 0x11, 0xF5, 0xEC, 0x73,
2987 0xBC, 0xCB, 0xDB, 0xF4, 0xA0, 0x30, 0x65, 0x5A, 0xB5, 0x95,
2988 0x80, 0x97, 0xFB, 0xC1, 0xCB, 0xCF, 0xA5, 0x80, 0x84, 0xA2,
2989 0x2C, 0x00, 0xF6, 0x89, 0x8C, 0xDC, 0xFF, 0x60, 0x71, 0x5C,
2990 0x87, 0x60, 0xC7, 0xF2, 0xA8, 0xC6, 0xF9, 0x59, 0x0C, 0x37,
2991 0x4E, 0x95, 0xEE, 0xCF, 0xB8, 0x30, 0x30, 0x55, 0xAF, 0x1D,
2992 0x95, 0x82, 0xA6, 0xD7, 0xC7, 0x49, 0xFE, 0xBF, 0x75, 0xEB,
2993 0x94, 0x09, 0x30, 0x1D, 0xBD, 0x0E, 0x97, 0xB1, 0x78, 0x0A,
2994 0x3E, 0x27, 0xAD, 0xF6, 0xC1, 0x5F, 0x69, 0x94, 0x7C, 0x03,
2995 0xCF, 0xB2, 0x5E, 0x1A, 0x07, 0xD3, 0xFA, 0xF2, 0x8B, 0x75,
2996 0x92, 0x70, 0xFE, 0xFE, 0x9A, 0xDF, 0x81, 0x0F, 0x34, 0x5D,
2997 0x45, 0xBC, 0xB8, 0xFD, 0x8F, 0xCF, 0x5D, 0x84, 0x10, 0xEE,
2998 0x9A, 0x7F, 0x57, 0x19, 0xF5, 0x17, 0xDC, 0x7D, 0x73, 0x0B,
2999 0xAC, 0x6B, 0x35, 0x15, 0x8B, 0x24, 0xCB, 0x72, 0xC0, 0xD7,
3000 0x2E, 0xAE, 0xAA, 0xDB, 0xCB, 0x9F, 0x67, 0x86, 0x14, 0xBB,
3001 0xE4, 0x90, 0x15, 0x7C, 0x95, 0x44, 0xA5, 0x38, 0x6D, 0x13,
3002 0x02, 0x91, 0x77, 0x84, 0x35, 0x43, 0x5D, 0x03, 0x1C, 0x01,
3003 0x0B, 0x5A, 0x4E, 0x2B, 0x59, 0xF0, 0xBB, 0xB1, 0xB7, 0x61,
3004 0x1B, 0x6C, 0xFC, 0xA1, 0xEA, 0xBD, 0x1C, 0x9A, 0xE4, 0x0C,
3005 0x7E, 0x97, 0x3F, 0x71, 0xC6, 0xA7, 0x94, 0x1D, 0x82, 0x12,
3006 0xEC, 0x26, 0x43, 0x6E, 0xF6, 0x24, 0x09, 0xA0, 0x03, 0x1D,
3007 0x12, 0xFF, 0xA8, 0x95, 0x60, 0x47, 0x4A, 0xB0, 0x72, 0x55,
3008 0xC3, 0x68, 0xD2, 0xF6, 0xBC, 0x5B, 0x47, 0x46, 0x51, 0xB2,
3009 0xC9, 0x2A, 0x28, 0x6A, 0xC9, 0xD1, 0x1B, 0x35, 0x16, 0x5A,
3010 0x26, 0x6F, 0xB7, 0xBB, 0xF7, 0x35, 0x73, 0x2B, 0x02, 0x82,
3011 0x01, 0x00, 0x56, 0xBA, 0xD8, 0x02, 0xD7, 0x4B, 0x30, 0x5E,
3012 0x1B, 0x1E, 0x2F, 0xF3, 0x0D, 0xBC, 0xF1, 0x05, 0x6A, 0x68,
3013 0x4A, 0xE1, 0xEA, 0xB3, 0xDE, 0x61, 0x8C, 0x89, 0x44, 0xBA,
3014 0x63, 0x5E, 0xDF, 0x05, 0x24, 0x32, 0x71, 0x65, 0x1A, 0x36,
3015 0x2F, 0xBC, 0x07, 0x75, 0xA3, 0xCE, 0x9E, 0x52, 0x92, 0x95,
3016 0x4D, 0x3F, 0xC9, 0x06, 0xBC, 0xA1, 0x14, 0x33, 0x37, 0x95,
3017 0xAB, 0x9A, 0xEB, 0x04, 0xF6, 0x15, 0xC3, 0x9B, 0x10, 0x56,
3018 0x53, 0xA2, 0x28, 0xF2, 0x68, 0xDA, 0x7D, 0x97, 0x52, 0x63,
3019 0xAC, 0x9B, 0x56, 0xA9, 0xAB, 0x2E, 0x1E, 0x9E, 0x01, 0x70,
3020 0xFF, 0x2B, 0x6D, 0x0C, 0x4B, 0xA6, 0xC3, 0x3A, 0xB3, 0xD1,
3021 0xA7, 0x4B, 0x5E, 0x49, 0x2E, 0x95, 0xD6, 0x6A, 0xAE, 0x58,
3022 0x13, 0x66, 0x8F, 0x2F, 0x93, 0xE4, 0x6E, 0x8B, 0xFA, 0x94,
3023 0x30, 0x3E, 0xEC, 0x96, 0xAB, 0x46, 0x20, 0x3E, 0xC5, 0x30,
3024 0xB4, 0xEB, 0x41, 0x00, 0x39, 0x60, 0x1D, 0xE1, 0x20, 0xCE,
3025 0x31, 0x70, 0x17, 0x39, 0xCB, 0x76, 0x56, 0x6C, 0x55, 0x7B,
3026 0x90, 0x20, 0xBC, 0x39, 0xB2, 0x5B, 0xD1, 0x28, 0x6F, 0x0C,
3027 0x4F, 0x45, 0x6B, 0x82, 0xC4, 0x57, 0x23, 0x0C, 0x3F, 0x3F,
3028 0x2D, 0x83, 0xB3, 0x3D, 0x8E, 0xF9, 0x1A, 0xDA, 0x77, 0x54,
3029 0x2E, 0xFE, 0x16, 0x2E, 0xBA, 0x99, 0xDD, 0xCA, 0xB3, 0xD1,
3030 0xD8, 0xBB, 0x87, 0xE1, 0xD0, 0xA9, 0xD4, 0xE6, 0x8F, 0xE8,
3031 0x00, 0x3E, 0x49, 0x8A, 0xDD, 0xA6, 0x32, 0x91, 0x00, 0x31,
3032 0x31, 0x21, 0x98, 0x18, 0x94, 0xC9, 0x2D, 0x27, 0x05, 0xB7,
3033 0x9B, 0x09, 0x2E, 0xBB, 0x5D, 0xBF, 0x67, 0xE8, 0x0E, 0xD1,
3034 0x44, 0x75, 0x80, 0x1D, 0x0A, 0x21, 0x8F, 0x95, 0x76, 0xB0,
3035 0xFC, 0x19, 0x3C, 0xFF, 0x92, 0xEA, 0x01, 0x45, 0x89, 0xD1,
3036 0x4E, 0xFE, 0x4D, 0x2B, 0x4B, 0x18, 0xE6, 0xCE
3037 };
3038 static const int sizeof_client_key_der_4096 = sizeof(client_key_der_4096);
3039
3040 /* ./certs/4096/client-keyPub.der, 4096-bit */
3041 static const unsigned char client_keypub_der_4096[] =
3042 {
3043 0x30, 0x82, 0x02, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86,
3044 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03,
3045 0x82, 0x02, 0x0F, 0x00, 0x30, 0x82, 0x02, 0x0A, 0x02, 0x82,
3046 0x02, 0x01, 0x00, 0xF5, 0xD0, 0x31, 0xE4, 0x71, 0x59, 0x58,
3047 0xB3, 0x07, 0x50, 0xDD, 0x16, 0x79, 0xFC, 0xC6, 0x95, 0x50,
3048 0xFC, 0x46, 0x0E, 0x57, 0x12, 0x86, 0x71, 0x8D, 0xE3, 0x9B,
3049 0x4A, 0x33, 0xEA, 0x4F, 0xD9, 0x17, 0x13, 0x6D, 0x48, 0x69,
3050 0xDF, 0x59, 0x11, 0x08, 0x02, 0x9D, 0xAF, 0x2B, 0xC7, 0x30,
3051 0xBE, 0x0C, 0xDC, 0x87, 0xD4, 0x5A, 0x12, 0x09, 0x23, 0x5D,
3052 0xE1, 0x76, 0x5A, 0x62, 0x37, 0x46, 0x74, 0xEF, 0x03, 0x05,
3053 0xBB, 0x1E, 0x6D, 0x29, 0x75, 0x6C, 0x2E, 0x9D, 0x87, 0x0D,
3054 0x8F, 0x87, 0xCB, 0x14, 0x95, 0x9B, 0xBE, 0x17, 0x6B, 0x51,
3055 0xD1, 0x4C, 0xDA, 0xD7, 0x91, 0x66, 0xC5, 0x36, 0xEB, 0xE0,
3056 0x07, 0x1A, 0x76, 0x4D, 0xB0, 0xFB, 0xC1, 0xF5, 0x5E, 0x05,
3057 0xDB, 0xBA, 0xCB, 0x25, 0xD9, 0x99, 0x13, 0x1C, 0xC0, 0x35,
3058 0xDC, 0x40, 0xE9, 0x36, 0xCD, 0xC4, 0xD5, 0x7A, 0x41, 0x70,
3059 0x0F, 0x36, 0xEB, 0xA5, 0x4E, 0x17, 0x05, 0xD5, 0x75, 0x1B,
3060 0x64, 0x62, 0x7A, 0x3F, 0x0D, 0x28, 0x48, 0x6A, 0xE3, 0xAC,
3061 0x9C, 0xA8, 0x8F, 0xE9, 0xED, 0xF7, 0xCD, 0x24, 0xA0, 0xB1,
3062 0xA0, 0x03, 0xAC, 0xE3, 0x03, 0xF5, 0x3F, 0xD1, 0x96, 0xFF,
3063 0x2A, 0x7E, 0x08, 0xB1, 0xD3, 0xE0, 0x18, 0x14, 0xEC, 0x65,
3064 0x37, 0x50, 0x43, 0xC2, 0x6A, 0x8C, 0xF4, 0x5B, 0xFE, 0xC4,
3065 0xCB, 0x8D, 0x3F, 0x81, 0x02, 0xF7, 0xC2, 0xDD, 0xE4, 0xC1,
3066 0x8E, 0x80, 0x0C, 0x04, 0x25, 0x2D, 0x80, 0x5A, 0x2E, 0x0F,
3067 0x22, 0x35, 0x4A, 0xF4, 0x85, 0xED, 0x51, 0xD8, 0xAB, 0x6D,
3068 0x8F, 0xA2, 0x3B, 0x24, 0x00, 0x6E, 0x81, 0xE2, 0x1E, 0x76,
3069 0xD6, 0xAC, 0x31, 0x12, 0xDB, 0xF3, 0x8E, 0x07, 0xA1, 0xDE,
3070 0x89, 0x4A, 0x39, 0x60, 0x77, 0xC5, 0xAA, 0xF1, 0x51, 0xE6,
3071 0x06, 0xF1, 0x95, 0x56, 0x2A, 0xE1, 0x8E, 0x92, 0x30, 0x9F,

NetBurner, Inc.
22.205 certs_test.h 1129

3072 0xFE, 0x58, 0x44, 0xAC, 0x46, 0xF2, 0xFD, 0x9A, 0xFC, 0xA8,
3073 0x1D, 0xA1, 0xD3, 0x55, 0x37, 0x4A, 0x8B, 0xFC, 0x9C, 0x33,
3074 0xF8, 0xA7, 0x61, 0x48, 0x41, 0x7C, 0x9C, 0x77, 0x3F, 0xF5,
3075 0x80, 0x23, 0x7D, 0x43, 0xB4, 0xD5, 0x88, 0x0A, 0xC9, 0x75,
3076 0xD7, 0x44, 0x19, 0x4D, 0x77, 0x6C, 0x0B, 0x0A, 0x49, 0xAA,
3077 0x1C, 0x2F, 0xD6, 0x5A, 0x44, 0xA6, 0x47, 0x4D, 0xE5, 0x36,
3078 0x96, 0x40, 0x99, 0x2C, 0x56, 0x26, 0xB1, 0xF2, 0x92, 0x31,
3079 0x59, 0xD7, 0x2C, 0xD4, 0xB4, 0x21, 0xD6, 0x65, 0x13, 0x0B,
3080 0x3E, 0xFB, 0xFF, 0x04, 0xEB, 0xB9, 0x85, 0xB9, 0xD8, 0xD8,
3081 0x28, 0x4F, 0x5C, 0x17, 0x96, 0xA3, 0x51, 0xBE, 0xFE, 0x7D,
3082 0x0B, 0x1B, 0x48, 0x40, 0x25, 0x76, 0x94, 0xDC, 0x41, 0xFB,
3083 0xBF, 0x73, 0x76, 0xDA, 0xEB, 0xB3, 0x62, 0xE7, 0xC1, 0xC8,
3084 0x54, 0x6A, 0x93, 0xE1, 0x8D, 0x31, 0xE8, 0x3E, 0x3E, 0xDF,
3085 0xBC, 0x87, 0x02, 0x30, 0x22, 0x57, 0xC4, 0xE0, 0x18, 0x7A,
3086 0xD3, 0xAE, 0xE4, 0x02, 0x9B, 0xAA, 0xBD, 0x4E, 0x49, 0x47,
3087 0x72, 0xE9, 0x8D, 0x13, 0x2D, 0x54, 0x9B, 0x00, 0xA7, 0x91,
3088 0x61, 0x71, 0xC9, 0xCC, 0x48, 0x4F, 0xEE, 0xDF, 0x5E, 0x1B,
3089 0x1A, 0xDF, 0x67, 0xD3, 0x20, 0xE6, 0x44, 0x45, 0x98, 0x7E,
3090 0xE7, 0x0E, 0x63, 0x16, 0x83, 0xC9, 0x26, 0x5D, 0x90, 0xC1,
3091 0xE5, 0x2A, 0x5C, 0x45, 0x54, 0x13, 0xB2, 0x81, 0x18, 0x06,
3092 0x20, 0x2E, 0x2E, 0x66, 0x5A, 0xB5, 0x7B, 0x6E, 0xD6, 0x0C,
3093 0x4E, 0x89, 0x01, 0x56, 0x70, 0xBB, 0xAE, 0xDE, 0xE9, 0x99,
3094 0x5E, 0xD1, 0xB9, 0x3A, 0xB7, 0x6C, 0x17, 0xB6, 0x03, 0xA9,
3095 0x08, 0xDD, 0x9C, 0xF4, 0x14, 0xC9, 0xC9, 0x59, 0x39, 0x72,
3096 0xD4, 0x7E, 0x02, 0x37, 0x31, 0xCD, 0x0E, 0xA7, 0x3D, 0xF8,
3097 0xF2, 0xCF, 0x6B, 0x15, 0xAB, 0x02, 0x03, 0x01, 0x00, 0x01
3098
3099 };
3100 static const int sizeof_client_keypub_der_4096 = sizeof(client_keypub_der_4096);
3101
3102 /* ./certs/4096/client-cert.der, 4096-bit */
3103 static const unsigned char client_cert_der_4096[] =
3104 {
3105 0x30, 0x82, 0x07, 0x1D, 0x30, 0x82, 0x05, 0x05, 0xA0, 0x03,
3106 0x02, 0x01, 0x02, 0x02, 0x14, 0x1C, 0x51, 0xB2, 0x53, 0x72,
3107 0xE9, 0x2E, 0x9F, 0x6C, 0x07, 0x60, 0xE6, 0xB5, 0x8B, 0xF0,
3108 0xBF, 0xFD, 0x6C, 0x5D, 0x40, 0x30, 0x0D, 0x06, 0x09, 0x2A,
3109 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00,
3110 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55,
3111 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E,
3112 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E,
3113 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
3114 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D,
3115 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
3116 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C,
3117 0x5F, 0x34, 0x30, 0x39, 0x36, 0x31, 0x19, 0x30, 0x17, 0x06,
3118 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50, 0x72, 0x6F, 0x67,
3119 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67, 0x2D, 0x34, 0x30,
3120 0x39, 0x36, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
3121 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
3122 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
3123 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
3124 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
3125 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
3126 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
3127 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
3128 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
3129 0x32, 0x34, 0x5A, 0x30, 0x81, 0x9E, 0x31, 0x0B, 0x30, 0x09,
3130 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
3131 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
3132 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
3133 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
3134 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x15, 0x30, 0x13, 0x06,
3135 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x77, 0x6F, 0x6C, 0x66,
3136 0x53, 0x53, 0x4C, 0x5F, 0x34, 0x30, 0x39, 0x36, 0x31, 0x19,
3137 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x10, 0x50,
3138 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x6D, 0x69, 0x6E, 0x67,
3139 0x2D, 0x34, 0x30, 0x39, 0x36, 0x31, 0x18, 0x30, 0x16, 0x06,
3140 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
3141 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
3142 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
3143 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
3144 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
3145 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x82, 0x02, 0x22, 0x30, 0x0D,
3146 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01,
3147 0x01, 0x05, 0x00, 0x03, 0x82, 0x02, 0x0F, 0x00, 0x30, 0x82,
3148 0x02, 0x0A, 0x02, 0x82, 0x02, 0x01, 0x00, 0xF5, 0xD0, 0x31,
3149 0xE4, 0x71, 0x59, 0x58, 0xB3, 0x07, 0x50, 0xDD, 0x16, 0x79,
3150 0xFC, 0xC6, 0x95, 0x50, 0xFC, 0x46, 0x0E, 0x57, 0x12, 0x86,
3151 0x71, 0x8D, 0xE3, 0x9B, 0x4A, 0x33, 0xEA, 0x4F, 0xD9, 0x17,
3152 0x13, 0x6D, 0x48, 0x69, 0xDF, 0x59, 0x11, 0x08, 0x02, 0x9D,
3153 0xAF, 0x2B, 0xC7, 0x30, 0xBE, 0x0C, 0xDC, 0x87, 0xD4, 0x5A,
3154 0x12, 0x09, 0x23, 0x5D, 0xE1, 0x76, 0x5A, 0x62, 0x37, 0x46,
3155 0x74, 0xEF, 0x03, 0x05, 0xBB, 0x1E, 0x6D, 0x29, 0x75, 0x6C,
3156 0x2E, 0x9D, 0x87, 0x0D, 0x8F, 0x87, 0xCB, 0x14, 0x95, 0x9B,
3157 0xBE, 0x17, 0x6B, 0x51, 0xD1, 0x4C, 0xDA, 0xD7, 0x91, 0x66,
3158 0xC5, 0x36, 0xEB, 0xE0, 0x07, 0x1A, 0x76, 0x4D, 0xB0, 0xFB,

NetBurner, Inc.
1130 File Documentation

3159 0xC1, 0xF5, 0x5E, 0x05, 0xDB, 0xBA, 0xCB, 0x25, 0xD9, 0x99,
3160 0x13, 0x1C, 0xC0, 0x35, 0xDC, 0x40, 0xE9, 0x36, 0xCD, 0xC4,
3161 0xD5, 0x7A, 0x41, 0x70, 0x0F, 0x36, 0xEB, 0xA5, 0x4E, 0x17,
3162 0x05, 0xD5, 0x75, 0x1B, 0x64, 0x62, 0x7A, 0x3F, 0x0D, 0x28,
3163 0x48, 0x6A, 0xE3, 0xAC, 0x9C, 0xA8, 0x8F, 0xE9, 0xED, 0xF7,
3164 0xCD, 0x24, 0xA0, 0xB1, 0xA0, 0x03, 0xAC, 0xE3, 0x03, 0xF5,
3165 0x3F, 0xD1, 0x96, 0xFF, 0x2A, 0x7E, 0x08, 0xB1, 0xD3, 0xE0,
3166 0x18, 0x14, 0xEC, 0x65, 0x37, 0x50, 0x43, 0xC2, 0x6A, 0x8C,
3167 0xF4, 0x5B, 0xFE, 0xC4, 0xCB, 0x8D, 0x3F, 0x81, 0x02, 0xF7,
3168 0xC2, 0xDD, 0xE4, 0xC1, 0x8E, 0x80, 0x0C, 0x04, 0x25, 0x2D,
3169 0x80, 0x5A, 0x2E, 0x0F, 0x22, 0x35, 0x4A, 0xF4, 0x85, 0xED,
3170 0x51, 0xD8, 0xAB, 0x6D, 0x8F, 0xA2, 0x3B, 0x24, 0x00, 0x6E,
3171 0x81, 0xE2, 0x1E, 0x76, 0xD6, 0xAC, 0x31, 0x12, 0xDB, 0xF3,
3172 0x8E, 0x07, 0xA1, 0xDE, 0x89, 0x4A, 0x39, 0x60, 0x77, 0xC5,
3173 0xAA, 0xF1, 0x51, 0xE6, 0x06, 0xF1, 0x95, 0x56, 0x2A, 0xE1,
3174 0x8E, 0x92, 0x30, 0x9F, 0xFE, 0x58, 0x44, 0xAC, 0x46, 0xF2,
3175 0xFD, 0x9A, 0xFC, 0xA8, 0x1D, 0xA1, 0xD3, 0x55, 0x37, 0x4A,
3176 0x8B, 0xFC, 0x9C, 0x33, 0xF8, 0xA7, 0x61, 0x48, 0x41, 0x7C,
3177 0x9C, 0x77, 0x3F, 0xF5, 0x80, 0x23, 0x7D, 0x43, 0xB4, 0xD5,
3178 0x88, 0x0A, 0xC9, 0x75, 0xD7, 0x44, 0x19, 0x4D, 0x77, 0x6C,
3179 0x0B, 0x0A, 0x49, 0xAA, 0x1C, 0x2F, 0xD6, 0x5A, 0x44, 0xA6,
3180 0x47, 0x4D, 0xE5, 0x36, 0x96, 0x40, 0x99, 0x2C, 0x56, 0x26,
3181 0xB1, 0xF2, 0x92, 0x31, 0x59, 0xD7, 0x2C, 0xD4, 0xB4, 0x21,
3182 0xD6, 0x65, 0x13, 0x0B, 0x3E, 0xFB, 0xFF, 0x04, 0xEB, 0xB9,
3183 0x85, 0xB9, 0xD8, 0xD8, 0x28, 0x4F, 0x5C, 0x17, 0x96, 0xA3,
3184 0x51, 0xBE, 0xFE, 0x7D, 0x0B, 0x1B, 0x48, 0x40, 0x25, 0x76,
3185 0x94, 0xDC, 0x41, 0xFB, 0xBF, 0x73, 0x76, 0xDA, 0xEB, 0xB3,
3186 0x62, 0xE7, 0xC1, 0xC8, 0x54, 0x6A, 0x93, 0xE1, 0x8D, 0x31,
3187 0xE8, 0x3E, 0x3E, 0xDF, 0xBC, 0x87, 0x02, 0x30, 0x22, 0x57,
3188 0xC4, 0xE0, 0x18, 0x7A, 0xD3, 0xAE, 0xE4, 0x02, 0x9B, 0xAA,
3189 0xBD, 0x4E, 0x49, 0x47, 0x72, 0xE9, 0x8D, 0x13, 0x2D, 0x54,
3190 0x9B, 0x00, 0xA7, 0x91, 0x61, 0x71, 0xC9, 0xCC, 0x48, 0x4F,
3191 0xEE, 0xDF, 0x5E, 0x1B, 0x1A, 0xDF, 0x67, 0xD3, 0x20, 0xE6,
3192 0x44, 0x45, 0x98, 0x7E, 0xE7, 0x0E, 0x63, 0x16, 0x83, 0xC9,
3193 0x26, 0x5D, 0x90, 0xC1, 0xE5, 0x2A, 0x5C, 0x45, 0x54, 0x13,
3194 0xB2, 0x81, 0x18, 0x06, 0x20, 0x2E, 0x2E, 0x66, 0x5A, 0xB5,
3195 0x7B, 0x6E, 0xD6, 0x0C, 0x4E, 0x89, 0x01, 0x56, 0x70, 0xBB,
3196 0xAE, 0xDE, 0xE9, 0x99, 0x5E, 0xD1, 0xB9, 0x3A, 0xB7, 0x6C,
3197 0x17, 0xB6, 0x03, 0xA9, 0x08, 0xDD, 0x9C, 0xF4, 0x14, 0xC9,
3198 0xC9, 0x59, 0x39, 0x72, 0xD4, 0x7E, 0x02, 0x37, 0x31, 0xCD,
3199 0x0E, 0xA7, 0x3D, 0xF8, 0xF2, 0xCF, 0x6B, 0x15, 0xAB, 0x02,
3200 0x03, 0x01, 0x00, 0x01, 0xA3, 0x82, 0x01, 0x4F, 0x30, 0x82,
3201 0x01, 0x4B, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04,
3202 0x16, 0x04, 0x14, 0xFA, 0x54, 0x89, 0x67, 0xE5, 0x5F, 0xB7,
3203 0x31, 0x40, 0xEA, 0xFD, 0xE7, 0xF6, 0xA3, 0xC6, 0x5A, 0x56,
3204 0x16, 0xA5, 0x6E, 0x30, 0x81, 0xDE, 0x06, 0x03, 0x55, 0x1D,
3205 0x23, 0x04, 0x81, 0xD6, 0x30, 0x81, 0xD3, 0x80, 0x14, 0xFA,
3206 0x54, 0x89, 0x67, 0xE5, 0x5F, 0xB7, 0x31, 0x40, 0xEA, 0xFD,
3207 0xE7, 0xF6, 0xA3, 0xC6, 0x5A, 0x56, 0x16, 0xA5, 0x6E, 0xA1,
3208 0x81, 0xA4, 0xA4, 0x81, 0xA1, 0x30, 0x81, 0x9E, 0x31, 0x0B,
3209 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
3210 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08,
3211 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31,
3212 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07,
3213 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x15, 0x30,
3214 0x13, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x77, 0x6F,
3215 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x5F, 0x34, 0x30, 0x39, 0x36,
3216 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C,
3217 0x10, 0x50, 0x72, 0x6F, 0x67, 0x72, 0x61, 0x6D, 0x6D, 0x69,
3218 0x6E, 0x67, 0x2D, 0x34, 0x30, 0x39, 0x36, 0x31, 0x18, 0x30,
3219 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77,
3220 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
3221 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A,
3222 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10,
3223 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73,
3224 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x1C, 0x51,
3225 0xB2, 0x53, 0x72, 0xE9, 0x2E, 0x9F, 0x6C, 0x07, 0x60, 0xE6,
3226 0xB5, 0x8B, 0xF0, 0xBF, 0xFD, 0x6C, 0x5D, 0x40, 0x30, 0x0C,
3227 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01,
3228 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x1D, 0x11, 0x04,
3229 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65, 0x78, 0x61, 0x6D, 0x70,
3230 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x87, 0x04, 0x7F, 0x00,
3231 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04,
3232 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05,
3233 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05,
3234 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48,
3235 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03, 0x82,
3236 0x02, 0x01, 0x00, 0x17, 0x18, 0x82, 0x26, 0x09, 0x97, 0xDD,
3237 0xAF, 0xEB, 0xA6, 0x55, 0x24, 0x1E, 0xE6, 0xB5, 0x38, 0xAC,
3238 0x38, 0x39, 0xAC, 0x2A, 0x29, 0x6A, 0xD0, 0x5A, 0x7C, 0x38,
3239 0x30, 0xAF, 0xE2, 0x74, 0x8B, 0x3E, 0x36, 0xD1, 0xB9, 0xF8,
3240 0x02, 0xCA, 0x53, 0x35, 0x20, 0x2B, 0xFF, 0x07, 0x6A, 0x47,
3241 0x0E, 0xCF, 0x13, 0x04, 0xC0, 0xC1, 0x7C, 0xD8, 0xFC, 0xD1,
3242 0x54, 0x4E, 0x95, 0xE1, 0xC1, 0x6A, 0x7D, 0x4D, 0xF1, 0x12,
3243 0x82, 0x4D, 0xAF, 0x27, 0x24, 0x39, 0x5A, 0xFD, 0xB4, 0x32,
3244 0xCD, 0x4D, 0x04, 0x39, 0x4C, 0xC9, 0xE2, 0xF6, 0x4D, 0x66,
3245 0xBE, 0x5F, 0x97, 0xD9, 0x4D, 0x11, 0xFF, 0xA4, 0xCD, 0x40,

NetBurner, Inc.
22.205 certs_test.h 1131

3246 0x7D, 0x06, 0x0C, 0x25, 0x93, 0xF9, 0xC7, 0x33, 0x61, 0xF0,
3247 0x41, 0x93, 0x12, 0x8C, 0xC0, 0xF5, 0x16, 0x81, 0xF0, 0x0B,
3248 0x04, 0x07, 0x4C, 0x6F, 0x4A, 0xC6, 0xD1, 0x97, 0x80, 0x3D,
3249 0x4B, 0x5F, 0x20, 0x7B, 0x20, 0x7F, 0x1B, 0x51, 0x09, 0x12,
3250 0xC2, 0x64, 0x08, 0x7E, 0xD6, 0x27, 0x37, 0xDB, 0xB2, 0xA4,
3251 0xEA, 0x0A, 0xF8, 0xF0, 0x0F, 0xE9, 0xD8, 0xA6, 0xCD, 0x12,
3252 0xEA, 0x48, 0x83, 0xE6, 0xD6, 0x6E, 0xE0, 0x56, 0x04, 0xE3,
3253 0xD5, 0xCA, 0x00, 0x6C, 0x67, 0x08, 0x40, 0x73, 0x0B, 0xBE,
3254 0x49, 0x79, 0x25, 0xFA, 0x69, 0x26, 0x74, 0x50, 0x10, 0xC8,
3255 0xE9, 0x02, 0x67, 0x22, 0xD2, 0x2B, 0xB5, 0xFD, 0x2D, 0x30,
3256 0x03, 0xB8, 0x4E, 0xA4, 0x35, 0x9D, 0x7C, 0xF4, 0x43, 0xDA,
3257 0xAA, 0x74, 0xE2, 0xD1, 0x77, 0xD1, 0xEA, 0x0B, 0x78, 0x4D,
3258 0xCE, 0x2E, 0x8E, 0x8C, 0x2E, 0x70, 0xA7, 0x57, 0x38, 0x68,
3259 0x9F, 0x05, 0xBF, 0x5F, 0xCB, 0x78, 0xB5, 0xDD, 0x90, 0x85,
3260 0x50, 0xB6, 0x94, 0xC8, 0xE2, 0xAA, 0x37, 0x25, 0x6A, 0xEC,
3261 0x47, 0x9A, 0xC6, 0x50, 0xCA, 0x3C, 0xBC, 0xEF, 0xF5, 0xF3,
3262 0xA9, 0xE3, 0x5F, 0xE5, 0x0A, 0xA7, 0xE8, 0x58, 0xAB, 0x14,
3263 0xCC, 0xAA, 0x38, 0xFE, 0x9D, 0xA4, 0x8A, 0x26, 0x29, 0xFE,
3264 0x81, 0x05, 0xDC, 0xE2, 0x21, 0xA2, 0x4A, 0x5D, 0xC7, 0x5B,
3265 0x5E, 0x1F, 0x4A, 0x98, 0x27, 0x96, 0x2C, 0xE3, 0xAE, 0xE0,
3266 0xF0, 0x3A, 0x53, 0x17, 0xE8, 0xB5, 0x2A, 0xAD, 0xB3, 0x90,
3267 0x97, 0xED, 0xAA, 0xCB, 0xAF, 0xFA, 0x26, 0x47, 0x70, 0x4A,
3268 0xAB, 0xA7, 0xF1, 0xD7, 0x99, 0x5E, 0xF6, 0xCC, 0xFE, 0xD2,
3269 0x43, 0x76, 0x77, 0x90, 0xAB, 0x83, 0x5E, 0xAC, 0x57, 0x43,
3270 0x69, 0x4E, 0xCB, 0x81, 0x05, 0x4E, 0x88, 0xF3, 0x1C, 0xED,
3271 0x46, 0x12, 0x6B, 0x55, 0xB2, 0xA4, 0x45, 0x18, 0xEE, 0xD8,
3272 0x1B, 0x29, 0x8F, 0x88, 0x71, 0x6A, 0xEC, 0x85, 0xFD, 0x38,
3273 0x4B, 0x08, 0x19, 0x22, 0xC6, 0x96, 0x25, 0x3D, 0xF6, 0x91,
3274 0x27, 0x0A, 0x8D, 0x43, 0x46, 0x9D, 0x52, 0xA7, 0x78, 0xAD,
3275 0x4A, 0x5E, 0x7D, 0x8F, 0x2C, 0xDA, 0x63, 0x28, 0x04, 0x7B,
3276 0x40, 0x40, 0xFA, 0x93, 0x86, 0x21, 0x68, 0x50, 0x3C, 0x35,
3277 0x78, 0xE6, 0x6B, 0xF9, 0x0D, 0x9E, 0x06, 0x02, 0x37, 0xA2,
3278 0x99, 0x0C, 0x58, 0x09, 0xFB, 0xA2, 0x48, 0xEF, 0xE8, 0x68,
3279 0x5C, 0xB7, 0xCC, 0xED, 0xB0, 0xF0, 0x0B, 0xEE, 0x5E, 0xEA,
3280 0x0F, 0xE6, 0xFD, 0xB7, 0x26, 0xB4, 0xCD, 0xC6, 0x27, 0xDF,
3281 0xBE, 0x64, 0x93, 0x1A, 0x64, 0x5C, 0x87, 0xA5, 0x67, 0x1B,
3282 0x4A, 0x06, 0xDD, 0x5B, 0xC9, 0x54, 0x7A, 0x8A, 0xB1, 0x9A,
3283 0xF3, 0x1F, 0xDC, 0xBB, 0xA7, 0x59, 0xAA, 0xE6, 0x68, 0x22,
3284 0x5A, 0x92, 0xC6, 0x12, 0xFB, 0x24, 0x25, 0x84, 0x3F, 0x28,
3285 0x5C, 0xE3, 0x81, 0xDC, 0x34, 0xDA, 0x31, 0x74, 0xD9, 0x4B,
3286 0x2B, 0x1F, 0x6D, 0xFC, 0x3E, 0xA3, 0x6F, 0xCA, 0x1C, 0x92,
3287 0x8C, 0x50, 0xC9, 0xF5, 0x03
3288 };
3289 static const int sizeof_client_cert_der_4096 = sizeof(client_cert_der_4096);
3290
3291 /* ./certs/dh4096.der, 4096-bit */
3292 static const unsigned char dh_key_der_4096[] =
3293 {
3294 0x30, 0x82, 0x02, 0x08, 0x02, 0x82, 0x02, 0x01, 0x00, 0xE9,
3295 0x0E, 0x3E, 0x79, 0x4F, 0xC9, 0xB2, 0xA0, 0xB1, 0xDB, 0x2F,
3296 0x1E, 0x24, 0x21, 0x90, 0x5C, 0x50, 0xA4, 0x34, 0xDB, 0x99,
3297 0x90, 0xAC, 0xF7, 0xBF, 0x2F, 0x01, 0x4B, 0xAC, 0x87, 0x70,
3298 0xBA, 0xEC, 0xD1, 0x64, 0xDE, 0x04, 0xCA, 0xFC, 0xF9, 0x51,
3299 0x69, 0x1E, 0xB7, 0x99, 0xE2, 0xB4, 0x0D, 0xDB, 0x5D, 0x78,
3300 0x38, 0x38, 0x41, 0x05, 0xE8, 0x67, 0x48, 0x65, 0x54, 0x71,
3301 0xCC, 0xC9, 0xAA, 0x95, 0x1E, 0xD4, 0xBF, 0xBC, 0xCA, 0x5D,
3302 0xC2, 0x9C, 0x9E, 0x7E, 0x5E, 0x94, 0x5B, 0x2F, 0x60, 0x72,
3303 0xED, 0xEB, 0x54, 0x0C, 0x48, 0x2B, 0x21, 0x74, 0x4D, 0x37,
3304 0x04, 0x5A, 0x2F, 0x8B, 0x24, 0x4A, 0xDB, 0xEE, 0xFA, 0xA9,
3305 0x94, 0x13, 0x8F, 0x52, 0x4A, 0x1B, 0xAE, 0xE6, 0xC8, 0x7F,
3306 0x99, 0x09, 0x23, 0x84, 0x89, 0xE9, 0xA6, 0x53, 0x82, 0xB6,
3307 0x03, 0x6D, 0x38, 0x5D, 0x2E, 0xEB, 0x0B, 0xF0, 0xE6, 0xAA,
3308 0xB1, 0x8B, 0x51, 0xFC, 0xD6, 0x13, 0xFB, 0x20, 0xCB, 0xDF,
3309 0x79, 0x97, 0xDB, 0x55, 0x74, 0xC2, 0x21, 0xE8, 0xDB, 0x8C,
3310 0x6A, 0x95, 0x2D, 0x51, 0x91, 0xA7, 0xA1, 0x3C, 0x9B, 0xEF,
3311 0xF5, 0x43, 0xAC, 0xA6, 0x69, 0xCE, 0x66, 0x5C, 0xD5, 0xB1,
3312 0xF8, 0xBA, 0xD4, 0x86, 0x25, 0x29, 0x2E, 0x0E, 0x23, 0x05,
3313 0xDA, 0x7C, 0x7C, 0xC2, 0x7B, 0xC8, 0xB5, 0x79, 0x84, 0x6D,
3314 0x68, 0x2D, 0x82, 0x4A, 0x35, 0x9F, 0xDC, 0x0E, 0x63, 0x2B,
3315 0x58, 0x5F, 0x34, 0x7E, 0xA8, 0x73, 0xCE, 0x44, 0x53, 0x11,
3316 0xE3, 0xDB, 0x46, 0xFA, 0x3A, 0xC3, 0xDA, 0x63, 0xA5, 0x65,
3317 0x56, 0x99, 0xA5, 0x91, 0x27, 0xD6, 0xE7, 0xDF, 0x2D, 0xEF,
3318 0xA0, 0x81, 0xB6, 0x07, 0x3A, 0xC6, 0xC1, 0x2B, 0xA1, 0x3A,
3319 0x74, 0xB4, 0xE9, 0xE1, 0x2F, 0x6B, 0x2B, 0xE4, 0xF0, 0x98,
3320 0xBE, 0x6F, 0xCB, 0xBB, 0xAE, 0x8D, 0xD2, 0x7E, 0x1B, 0x6F,
3321 0xBA, 0xF2, 0xB2, 0xB8, 0xB1, 0x5D, 0x9E, 0x79, 0x19, 0xF7,
3322 0x94, 0xB2, 0xC1, 0x17, 0x5E, 0x9B, 0xB3, 0x05, 0x67, 0x6D,
3323 0x5C, 0x62, 0x64, 0xA8, 0x2B, 0xB0, 0x36, 0x3D, 0xF9, 0x4C,
3324 0x65, 0x53, 0xEE, 0x2E, 0x55, 0x69, 0xCC, 0x1C, 0xF5, 0x96,
3325 0xDC, 0xBE, 0x60, 0x5E, 0x37, 0xEE, 0xD4, 0x63, 0x96, 0x51,
3326 0x97, 0x96, 0x14, 0x3C, 0x61, 0xBF, 0x53, 0xAA, 0x24, 0xB5,
3327 0x24, 0x5B, 0x26, 0x67, 0xAD, 0x02, 0x67, 0xB8, 0xD3, 0x05,
3328 0x6E, 0xA4, 0x8F, 0x46, 0x91, 0x9D, 0x84, 0xA6, 0x2C, 0x44,
3329 0x9F, 0x2D, 0x18, 0x2F, 0x73, 0xA5, 0xE5, 0xC4, 0xD9, 0x4F,
3330 0xD9, 0x9F, 0xF5, 0xC0, 0xC5, 0x48, 0xE8, 0x23, 0x32, 0xC4,
3331 0x4A, 0xCE, 0xFF, 0x3B, 0x16, 0x87, 0x85, 0xA5, 0x1F, 0x22,
3332 0xA8, 0x0B, 0x91, 0x97, 0x24, 0x95, 0x07, 0xC8, 0x73, 0xD2,

NetBurner, Inc.
1132 File Documentation

3333 0xB0, 0x01, 0xF8, 0x20, 0xA9, 0xAB, 0x6B, 0x71, 0x79, 0x24,
3334 0xF3, 0x79, 0xB5, 0x9B, 0x00, 0xF5, 0xF9, 0xAE, 0x23, 0xAC,
3335 0xEA, 0xE1, 0x48, 0x88, 0x28, 0x53, 0xE0, 0xC8, 0x76, 0x29,
3336 0xAE, 0x3E, 0x25, 0x9F, 0x1C, 0xC5, 0x8A, 0x86, 0x33, 0x02,
3337 0x21, 0xAB, 0xA5, 0x10, 0xF0, 0x07, 0x1B, 0x56, 0x8F, 0xCD,
3338 0xFC, 0x87, 0x9E, 0x2E, 0xD0, 0x44, 0x98, 0x44, 0x99, 0xB3,
3339 0xC2, 0x14, 0xCE, 0xD8, 0x93, 0xEA, 0xD1, 0x82, 0x3C, 0x1B,
3340 0x49, 0xE8, 0x6F, 0x04, 0xB2, 0xF5, 0xAF, 0x9B, 0x37, 0x7D,
3341 0xE5, 0xE0, 0x56, 0xE9, 0xEE, 0x00, 0x58, 0x25, 0x16, 0x23,
3342 0xC3, 0x8E, 0xF0, 0xB9, 0xE2, 0x98, 0x5D, 0xF2, 0x4F, 0x5C,
3343 0xC3, 0x27, 0x2A, 0x67, 0x7D, 0x43, 0xF6, 0x36, 0x76, 0xD4,
3344 0x2C, 0x7E, 0x16, 0x80, 0xCB, 0xF1, 0x07, 0xDC, 0xB9, 0xF5,
3345 0xF3, 0x56, 0xBD, 0xF0, 0xFC, 0x00, 0x78, 0x00, 0x56, 0xB4,
3346 0x3B, 0x02, 0x01, 0x02
3347 };
3348 static const int sizeof_dh_key_der_4096 = sizeof(dh_key_der_4096);
3349
3350 #endif /* USE_CERT_BUFFERS_4096 */
3351
3352 #ifdef HAVE_PQC
3353
3354 /* certs/falcon/bench_falcon_level1_key.der */
3355 static const unsigned char bench_falcon_level1_key[] =
3356 {
3357 0x30, 0x82, 0x08, 0x96, 0x02, 0x01, 0x00, 0x30, 0x07, 0x06,
3358 0x05, 0x2B, 0xCE, 0x0F, 0x03, 0x01, 0x04, 0x82, 0x08, 0x86,
3359 0x04, 0x82, 0x08, 0x82, 0x59, 0xFC, 0x32, 0x7D, 0x04, 0x41,
3360 0x01, 0xEC, 0x41, 0x7B, 0x04, 0x1F, 0x7F, 0xFC, 0x30, 0xBF,
3361 0x08, 0x80, 0x41, 0x10, 0x3F, 0x81, 0xFB, 0xFF, 0xC6, 0x07,
3362 0xCF, 0xC6, 0x0C, 0x11, 0x79, 0xFC, 0x2F, 0xC1, 0xFB, 0xFF,
3363 0x40, 0x1F, 0xA1, 0x3F, 0x0B, 0xF1, 0xC3, 0x0F, 0xB0, 0x43,
3364 0xFC, 0x61, 0x40, 0x0C, 0x1E, 0xFE, 0x08, 0x5E, 0xBE, 0x00,
3365 0x41, 0x3D, 0x13, 0xA0, 0xC0, 0xDB, 0xCF, 0x80, 0xF0, 0x20,
3366 0x80, 0x1C, 0x5F, 0x07, 0x07, 0xBF, 0xC3, 0x18, 0x5E, 0x85,
3367 0x0C, 0x1F, 0xC7, 0xD8, 0x0F, 0x86, 0x04, 0x10, 0xC0, 0xFC,
3368 0x32, 0x7E, 0xEF, 0xEF, 0x81, 0xF0, 0x2F, 0xC1, 0x04, 0x0E,
3369 0xC3, 0xF3, 0xD1, 0x47, 0xF7, 0xE0, 0xC0, 0xF8, 0x40, 0x42,
3370 0x13, 0xED, 0x82, 0xF0, 0x3E, 0xFB, 0xFF, 0xE0, 0x00, 0xFF,
3371 0xFF, 0xFA, 0x1F, 0xF1, 0x3D, 0x03, 0xCF, 0xBA, 0xFC, 0x90,
3372 0x43, 0x0B, 0x6F, 0xC7, 0xEF, 0xDF, 0x02, 0xFF, 0xCF, 0x41,
3373 0x03, 0xDF, 0xC2, 0x1B, 0xDE, 0xF9, 0x00, 0x90, 0x03, 0xFC,
3374 0x20, 0xBD, 0x04, 0x10, 0x38, 0xEF, 0xF1, 0x07, 0xE8, 0x51,
3375 0x07, 0xF7, 0x9F, 0xC2, 0x14, 0x00, 0x04, 0x04, 0x00, 0x00,
3376 0x04, 0x0F, 0x3F, 0xFF, 0xFF, 0x7D, 0xE0, 0x2F, 0x00, 0xF7,
3377 0xC1, 0x83, 0xFF, 0xBF, 0x87, 0x03, 0xA0, 0xC4, 0xEF, 0xEF,
3378 0xFF, 0xFC, 0x00, 0xFE, 0x20, 0x6F, 0xBE, 0x14, 0x9F, 0x01,
3379 0x17, 0xAE, 0xFE, 0x08, 0x3F, 0x7A, 0x17, 0xFF, 0x80, 0x14,
3380 0x3E, 0xC2, 0x04, 0x1F, 0xFB, 0x08, 0x4F, 0x41, 0xFC, 0x41,
3381 0xC2, 0x0C, 0x20, 0x82, 0x03, 0xC2, 0x43, 0x20, 0x20, 0xF8,
3382 0x07, 0xFF, 0x7E, 0xF8, 0x3E, 0x81, 0xEF, 0xDE, 0xC3, 0x00,
3383 0x4F, 0x85, 0x03, 0xD0, 0x7E, 0xF8, 0x2F, 0x42, 0xDF, 0xB1,
3384 0x3E, 0xFB, 0xF1, 0x45, 0x0B, 0xF1, 0x41, 0x1B, 0xF0, 0xC0,
3385 0x03, 0xEF, 0x03, 0xEB, 0x9E, 0xFE, 0xE8, 0x21, 0x42, 0x14,
3386 0x4E, 0xC4, 0xFC, 0x3E, 0x00, 0xF3, 0xFF, 0xBC, 0x18, 0x40,
3387 0x87, 0x08, 0x51, 0x7D, 0x03, 0xFF, 0x42, 0x18, 0x00, 0x43,
3388 0xF8, 0x6F, 0x7F, 0xFC, 0x21, 0x05, 0xFB, 0xF0, 0xFA, 0x00,
3389 0x2F, 0xC2, 0x04, 0x00, 0x43, 0x1B, 0xE1, 0x07, 0xF0, 0x50,
3390 0x05, 0x00, 0x11, 0x41, 0xF4, 0x4E, 0xC9, 0x0B, 0xDF, 0xBD,
3391 0x20, 0xB0, 0x7B, 0x04, 0xE0, 0xFF, 0xF3, 0xEF, 0x3F, 0x20,
3392 0x5F, 0xC8, 0xFF, 0xF0, 0xFE, 0xFB, 0x9F, 0x3C, 0xFB, 0xFF,
3393 0xC1, 0x13, 0x51, 0x05, 0x03, 0xFF, 0x03, 0xFB, 0xE1, 0xBE,
3394 0x1B, 0xC0, 0x8B, 0x03, 0xF1, 0x7F, 0x10, 0x6E, 0x39, 0x08,
3395 0x3F, 0xC9, 0xFC, 0x40, 0x82, 0xFB, 0xE0, 0xBC, 0xF0, 0x21,
3396 0x03, 0xE4, 0x6F, 0x7E, 0xD8, 0x00, 0x81, 0xF8, 0x41, 0x46,
3397 0x07, 0xC0, 0x45, 0x24, 0x2F, 0x80, 0x0C, 0x3F, 0x05, 0x20,
3398 0x8F, 0x84, 0xF8, 0x6F, 0xFF, 0xEC, 0x30, 0x85, 0xFF, 0xF0,
3399 0xBD, 0xF4, 0x50, 0x87, 0x00, 0x3F, 0xC2, 0xFB, 0xC0, 0xC1,
3400 0x03, 0xEF, 0xB8, 0xFF, 0xFF, 0x45, 0x13, 0xBE, 0xC1, 0x03,
3401 0xC0, 0x40, 0x07, 0x90, 0x3E, 0xE0, 0x0E, 0xFD, 0xFB, 0xA0,
3402 0xFF, 0xF8, 0x0F, 0xC5, 0xFF, 0xFF, 0x43, 0xE3, 0xFF, 0x06,
3403 0x0F, 0xB0, 0x43, 0xF0, 0x90, 0x7B, 0xE7, 0xD1, 0x79, 0x07,
3404 0xDF, 0xFB, 0x03, 0xE0, 0x04, 0xF7, 0xD0, 0x45, 0xFF, 0xEF,
3405 0xBB, 0x20, 0x01, 0x42, 0xD0, 0x7E, 0xC3, 0x13, 0xEF, 0xC8,
3406 0x0B, 0x8E, 0xBE, 0xF8, 0x1F, 0xFE, 0xDF, 0xCF, 0xBE, 0x13,
3407 0xD1, 0xFC, 0x0C, 0x61, 0xC2, 0x04, 0x40, 0x01, 0x00, 0x2F,
3408 0xFC, 0x0B, 0xDF, 0x00, 0x14, 0x61, 0x02, 0xE4, 0x0F, 0x81,
3409 0xF0, 0x3F, 0x81, 0xFC, 0x00, 0x82, 0xF4, 0x21, 0x7E, 0x0B,
3410 0xF0, 0x48, 0x00, 0x00, 0x3A, 0xE8, 0x5F, 0x05, 0x17, 0xF0,
3411 0xC0, 0x00, 0x61, 0x39, 0xF8, 0x4F, 0x81, 0xEB, 0x5F, 0x06,
3412 0x08, 0x2F, 0xC0, 0x04, 0x1F, 0xFF, 0x0B, 0xBF, 0xBA, 0x0B,
3413 0xFF, 0x40, 0x07, 0xCF, 0x42, 0x10, 0x1F, 0x3D, 0xDB, 0xC0,
3414 0x85, 0x03, 0xD1, 0xC0, 0x04, 0x0F, 0x7E, 0x03, 0xBF, 0x81,
3415 0xF7, 0xD0, 0x7D, 0xE8, 0x1E, 0x00, 0x00, 0x31, 0x46, 0x04,
3416 0x21, 0x40, 0xF3, 0xBF, 0x05, 0x03, 0xD1, 0x40, 0xFB, 0xEE,
3417 0xFD, 0x03, 0xF0, 0xBA, 0xE7, 0xFE, 0xBD, 0xE8, 0x6F, 0xBC,
3418 0x07, 0xEF, 0x82, 0x0C, 0x40, 0x3F, 0x00, 0x20, 0x80, 0x0F,
3419 0xB1, 0x42, 0xFC, 0x10, 0x3F, 0x07, 0xEF, 0xBF, 0xF0, 0x1E,

NetBurner, Inc.
22.205 certs_test.h 1133

3420 0x82, 0xFC, 0x3F, 0x80, 0x1C, 0x50, 0xC3, 0x13, 0xD0, 0xFC,
3421 0xEF, 0xEF, 0x7C, 0x0C, 0x6F, 0xBF, 0x1B, 0x90, 0xFF, 0x00,
3422 0x70, 0xC5, 0x04, 0x00, 0x03, 0xEF, 0x8F, 0x80, 0xF8, 0x00,
3423 0x7F, 0x04, 0x01, 0x41, 0xE8, 0x21, 0x43, 0x08, 0x9F, 0x44,
3424 0xF7, 0xF2, 0x7C, 0x0F, 0xC0, 0x3E, 0xEC, 0x4F, 0xFF, 0x00,
3425 0x31, 0x3E, 0x13, 0xEE, 0x40, 0xFB, 0xE0, 0xFA, 0xEB, 0xD0,
3426 0xBF, 0x04, 0x0F, 0x46, 0xFF, 0xE2, 0x7D, 0x03, 0xDE, 0x81,
3427 0xF4, 0x2F, 0xBD, 0x08, 0x0F, 0x42, 0xEF, 0xA0, 0x40, 0xF8,
3428 0x01, 0x41, 0xF3, 0xD1, 0x00, 0x00, 0x01, 0x00, 0x13, 0xB0,
3429 0x7E, 0xE7, 0xE0, 0x7F, 0x08, 0x2F, 0x3E, 0x03, 0xD2, 0xC3,
3430 0x23, 0x9F, 0xFF, 0x17, 0xEE, 0xBB, 0xF0, 0x2E, 0xBE, 0xFC,
3431 0x2F, 0x3F, 0xF4, 0x00, 0x48, 0xE3, 0xDE, 0x7B, 0x0B, 0xFF,
3432 0xC4, 0x04, 0x01, 0x02, 0xFF, 0xB1, 0x84, 0x00, 0x7E, 0xC5,
3433 0x08, 0x11, 0xBE, 0xF7, 0x90, 0xC5, 0xEF, 0xDE, 0x09, 0x0B,
3434 0xD0, 0x86, 0xEC, 0x4F, 0xFC, 0x0B, 0xA1, 0x06, 0xEC, 0x50,
3435 0xC3, 0xFF, 0xA1, 0x3D, 0x20, 0x4F, 0xFF, 0x13, 0x8F, 0x45,
3436 0xF3, 0xF0, 0x83, 0x04, 0x06, 0x09, 0xE4, 0xEB, 0xFA, 0xFD,
3437 0xD6, 0x04, 0x2A, 0x25, 0x0F, 0xF3, 0xE6, 0x10, 0xFD, 0xEB,
3438 0x0C, 0x0B, 0x0C, 0xF3, 0x1F, 0x06, 0x21, 0xFF, 0x2E, 0xDD,
3439 0xFA, 0xF3, 0xF1, 0x21, 0xEE, 0x1B, 0x06, 0xC6, 0x05, 0x21,
3440 0xF7, 0x07, 0xE1, 0x01, 0x19, 0x0D, 0xEE, 0xE2, 0xD2, 0x0F,
3441 0xF9, 0xEE, 0xEC, 0x13, 0xF3, 0xE5, 0x1C, 0xF6, 0xF4, 0xE5,
3442 0x09, 0xF0, 0x32, 0x09, 0x0D, 0xD4, 0x17, 0x1F, 0xE4, 0xDA,
3443 0xF7, 0x08, 0xD9, 0xD6, 0x01, 0xED, 0x07, 0xDD, 0xE4, 0x1A,
3444 0x09, 0x34, 0xE0, 0xFE, 0x0D, 0xD4, 0xF8, 0x03, 0xF8, 0xF6,
3445 0xFB, 0x1C, 0xDF, 0x11, 0x1C, 0x08, 0x13, 0x0F, 0xE8, 0xF5,
3446 0xFA, 0x19, 0x06, 0xEF, 0xFC, 0x09, 0x1B, 0x22, 0xED, 0x02,
3447 0xE6, 0x09, 0x04, 0xD8, 0xF5, 0x10, 0x02, 0x24, 0x15, 0x26,
3448 0xEA, 0xFA, 0x1D, 0x15, 0x09, 0xFD, 0xD1, 0x02, 0x0D, 0xF5,
3449 0xF7, 0xF4, 0x1E, 0x40, 0x0E, 0xFD, 0xEE, 0x19, 0x15, 0xF2,
3450 0xE6, 0xE5, 0xF0, 0xFC, 0x03, 0x07, 0x03, 0xFE, 0xFC, 0x03,
3451 0x09, 0xE8, 0xEF, 0xF9, 0xEF, 0xED, 0x0A, 0x07, 0x0A, 0x02,
3452 0x08, 0xD0, 0xEE, 0x1D, 0xD3, 0xF0, 0xB2, 0xEA, 0x07, 0xFA,
3453 0x39, 0x13, 0x18, 0xF4, 0xEA, 0xF5, 0x0A, 0xE6, 0xE1, 0x1E,
3454 0x0B, 0x14, 0xF3, 0x26, 0xDA, 0xEA, 0x18, 0xE6, 0x10, 0x06,
3455 0xFF, 0xE9, 0x08, 0xE9, 0x10, 0xD0, 0xF7, 0x08, 0xEE, 0xEF,
3456 0x05, 0xEB, 0xF5, 0x10, 0xD5, 0x12, 0x1F, 0xDF, 0xFF, 0xF5,
3457 0x33, 0x05, 0x31, 0xFD, 0x19, 0xF8, 0xEE, 0x2B, 0x08, 0x01,
3458 0x17, 0x0A, 0xF6, 0x21, 0xF7, 0x11, 0x00, 0x23, 0xFF, 0x03,
3459 0xD7, 0xEF, 0x16, 0xF5, 0xED, 0x0A, 0xF7, 0x00, 0x00, 0xDD,
3460 0xF8, 0x07, 0x0A, 0xF0, 0xFB, 0xF1, 0xCC, 0x11, 0x1F, 0xFC,
3461 0xE1, 0x03, 0x46, 0x01, 0x06, 0x0C, 0xE7, 0x36, 0x05, 0xDC,
3462 0xD1, 0x0A, 0x43, 0x09, 0x04, 0xF6, 0xFE, 0x09, 0x1F, 0x06,
3463 0xEB, 0xE7, 0x08, 0xFD, 0xDA, 0x0D, 0x23, 0xC6, 0x13, 0x30,
3464 0x02, 0x23, 0x03, 0xED, 0xE1, 0x0B, 0x12, 0x27, 0x1E, 0x1B,
3465 0x01, 0xF5, 0xF5, 0xF4, 0xED, 0xDC, 0xF7, 0x14, 0xF1, 0x3E,
3466 0x2F, 0x18, 0x04, 0x22, 0x08, 0x03, 0x1F, 0x0E, 0x19, 0xEB,
3467 0x21, 0xDC, 0xCE, 0xD2, 0x23, 0x14, 0xE3, 0x16, 0xF7, 0x29,
3468 0x0A, 0x0F, 0x04, 0xF7, 0xEF, 0x15, 0xFA, 0x30, 0xE7, 0xD3,
3469 0x13, 0x05, 0x0E, 0x06, 0x04, 0x11, 0xF9, 0x2D, 0x1C, 0xEF,
3470 0x0F, 0x03, 0x05, 0xF4, 0x09, 0xE7, 0xE3, 0xFC, 0x04, 0xED,
3471 0x15, 0xF2, 0x2F, 0xF1, 0xF9, 0x1D, 0x08, 0x46, 0xED, 0xF1,
3472 0x0C, 0xF9, 0x38, 0xEF, 0xE6, 0xEB, 0xD1, 0xDE, 0x04, 0xFD,
3473 0x1B, 0xFB, 0x30, 0xE5, 0xCD, 0xF6, 0xDE, 0xEA, 0x09, 0x00,
3474 0xE8, 0x0C, 0x27, 0x01, 0xC1, 0x2A, 0x05, 0xF4, 0xED, 0x11,
3475 0xF9, 0xF7, 0xFD, 0x0A, 0xD6, 0xF8, 0x03, 0x0C, 0x05, 0x16,
3476 0xFB, 0x1F, 0xEC, 0x13, 0x07, 0xF3, 0x04, 0xC6, 0x1E, 0x0A,
3477 0x01, 0x0A, 0x09, 0xDE, 0x0D, 0xDC, 0xDF, 0xD8, 0x0E, 0x25,
3478 0xDF, 0xC3, 0xF4, 0x0C, 0xE9, 0xE5, 0xEC, 0xE9, 0xEE, 0xEC,
3479 0x23, 0xF2, 0xEE, 0x17, 0xF7, 0x1D, 0xE4, 0x0D, 0x0E, 0x0E,
3480 0x0A, 0xF5, 0xFF, 0x0B, 0x0F, 0xF3, 0xF1, 0x18, 0x08, 0xEB,
3481 0x03, 0x01, 0x1E, 0xF7, 0xF2, 0x0E, 0xDF, 0xF8, 0xD3, 0xCB,
3482 0xFB, 0xFE, 0xEF, 0xED, 0x17, 0x24, 0xD9, 0x06, 0xF5, 0xDD,
3483 0xFF, 0xEF, 0x1E, 0xE7, 0xC6, 0xFB, 0x03, 0x14, 0x12, 0x00,
3484 0x1E, 0x2B, 0x2B, 0xEB, 0x0E, 0x2D, 0xE9, 0x17, 0x13, 0x05,
3485 0x2F, 0x23, 0xF5, 0xF6, 0xEE, 0xF1, 0xD3, 0xE3, 0xFC, 0xEC,
3486 0xE4, 0xFE, 0xEA, 0xFC, 0x05, 0x2E, 0x0E, 0xF6, 0x0F, 0xE5,
3487 0xEF, 0x08, 0xEF, 0x01, 0xE1, 0x09, 0x00, 0x81, 0xF2, 0x10,
3488 0x17, 0x97, 0x32, 0xA5, 0x89, 0x54, 0x64, 0xC7, 0x47, 0x1C,
3489 0x52, 0xBC, 0xBF, 0xF6, 0x8A, 0x47, 0x0A, 0x87, 0x1E, 0x61,
3490 0x92, 0xEF, 0x56, 0x48, 0x88, 0x88, 0xAF, 0x14, 0x0B, 0x88,
3491 0xBD, 0x82, 0xB8, 0x32, 0x62, 0xF4, 0xD7, 0x40, 0xAD, 0xA6,
3492 0xE9, 0x1A, 0x03, 0x44, 0x60, 0x71, 0x58, 0xC3, 0x76, 0x2A,
3493 0x8F, 0x5B, 0x9F, 0x24, 0x8A, 0x92, 0x4E, 0xC4, 0x99, 0x3D,
3494 0x39, 0x8B, 0x25, 0xEB, 0xDA, 0x39, 0x91, 0x21, 0x70, 0x2B,
3495 0x77, 0x63, 0x1C, 0xA9, 0xD6, 0xD5, 0x30, 0x26, 0x10, 0xCF,
3496 0x1D, 0xD8, 0x32, 0xB2, 0xE8, 0x5C, 0x88, 0x04, 0x11, 0x9E,
3497 0x7A, 0xB4, 0x6E, 0xF2, 0x4D, 0x78, 0x3C, 0xF1, 0xA7, 0xA5,
3498 0xF3, 0x98, 0xAA, 0x8A, 0x08, 0xED, 0x17, 0xCA, 0xA1, 0x9E,
3499 0x6B, 0xC6, 0xEB, 0x4D, 0x47, 0x7B, 0x04, 0x41, 0x1B, 0x19,
3500 0x61, 0x19, 0x0F, 0xB5, 0xAF, 0x02, 0xE8, 0x8A, 0x43, 0xB8,
3501 0xF9, 0xA6, 0x43, 0x5A, 0xEA, 0x1B, 0x94, 0x8A, 0xD2, 0x71,
3502 0x2B, 0x2F, 0x6A, 0xBF, 0x26, 0x5E, 0x84, 0xAC, 0x4F, 0x03,
3503 0x40, 0x0C, 0x68, 0xA4, 0x36, 0xE3, 0xFD, 0x0B, 0xD0, 0x31,
3504 0xD9, 0x58, 0xD3, 0xC2, 0x76, 0xA2, 0x25, 0x69, 0x59, 0x00,
3505 0xA8, 0x43, 0x12, 0x85, 0x69, 0x16, 0x24, 0x50, 0x15, 0x74,
3506 0x1B, 0x02, 0xB9, 0xC0, 0x7B, 0x81, 0x64, 0x7E, 0x63, 0xB7,

NetBurner, Inc.
1134 File Documentation

3507 0x16, 0x68, 0x49, 0x92, 0x60, 0x7B, 0xC0, 0xC4, 0xFB, 0x9E,
3508 0x7E, 0x23, 0x87, 0x81, 0x48, 0xD4, 0x5F, 0xAD, 0xDA, 0xA7,
3509 0xA3, 0x5C, 0x6C, 0x4E, 0x60, 0x43, 0xB4, 0x48, 0x5B, 0xD1,
3510 0x3C, 0xE4, 0x5C, 0x5A, 0x8A, 0x85, 0xBC, 0x76, 0xEC, 0xA5,
3511 0x40, 0x1E, 0x02, 0xFE, 0x06, 0x8D, 0x60, 0xD6, 0x37, 0x82,
3512 0x47, 0x22, 0xA5, 0x18, 0xA6, 0x62, 0x44, 0x08, 0x0D, 0xE2,
3513 0x46, 0xA6, 0x6C, 0xCB, 0x8D, 0x9B, 0xD5, 0xFA, 0x31, 0x4C,
3514 0xCF, 0x74, 0x6D, 0xAA, 0x93, 0x21, 0xEB, 0xA4, 0xC9, 0xB2,
3515 0x95, 0xFE, 0x42, 0x28, 0xE7, 0x1A, 0x3A, 0xB9, 0xA8, 0x9B,
3516 0x6D, 0x59, 0xFC, 0x38, 0xA6, 0xC9, 0xC6, 0x5D, 0xEC, 0xF2,
3517 0x1D, 0xF0, 0x64, 0x86, 0x63, 0x19, 0x93, 0x57, 0x71, 0xCF,
3518 0x85, 0xA5, 0x27, 0x43, 0xB3, 0x81, 0xF2, 0x14, 0x17, 0x05,
3519 0x2E, 0x26, 0xE2, 0x4C, 0xF3, 0xCB, 0x42, 0xC7, 0x23, 0x91,
3520 0xF2, 0x51, 0x54, 0xDB, 0x95, 0x6B, 0x26, 0x3F, 0xF0, 0xF3,
3521 0x29, 0xDE, 0x64, 0x59, 0x10, 0x5A, 0x70, 0x81, 0x96, 0x0D,
3522 0xD6, 0xBD, 0x9B, 0xBA, 0x52, 0xE4, 0x47, 0xB4, 0xC5, 0x81,
3523 0x4F, 0xA3, 0x1C, 0x53, 0x29, 0xBE, 0xF0, 0x0A, 0x19, 0xA8,
3524 0x79, 0x5A, 0x08, 0x17, 0x9B, 0x1C, 0x54, 0x0C, 0xDD, 0x9F,
3525 0xB0, 0xFE, 0xA2, 0xBD, 0x7E, 0xD1, 0x44, 0xFA, 0x6A, 0x19,
3526 0x15, 0x9B, 0xCA, 0x77, 0x24, 0x8A, 0xC4, 0x6F, 0x02, 0xBC,
3527 0x2C, 0x07, 0x1C, 0x6A, 0x69, 0x89, 0x9D, 0x84, 0xE9, 0x14,
3528 0xE1, 0x8E, 0x49, 0xA0, 0x1D, 0x76, 0x9F, 0x54, 0x49, 0x5E,
3529 0x42, 0x90, 0x1A, 0xE4, 0x2B, 0xF0, 0x36, 0xF6, 0xB7, 0x38,
3530 0x9A, 0xD3, 0xBB, 0x08, 0xFA, 0x96, 0xC9, 0xE8, 0xEF, 0x7E,
3531 0x79, 0xE9, 0xDE, 0xA5, 0xA6, 0x97, 0x15, 0x9E, 0xEA, 0xB4,
3532 0x8B, 0xC8, 0xA1, 0xB7, 0x50, 0x78, 0x04, 0x00, 0xFC, 0x13,
3533 0xF0, 0x96, 0xCC, 0x45, 0xC8, 0x74, 0x2B, 0xCA, 0x98, 0x7E,
3534 0x6C, 0x91, 0x22, 0x0B, 0x49, 0x07, 0xB6, 0xE0, 0x44, 0xD8,
3535 0x44, 0x4A, 0x0E, 0x65, 0x3F, 0x45, 0x90, 0x95, 0x59, 0x72,
3536 0xCD, 0xB3, 0xE7, 0x56, 0x65, 0x23, 0xB0, 0x9D, 0x13, 0x66,
3537 0x13, 0xCC, 0xB9, 0x96, 0xB9, 0xAD, 0x2B, 0x15, 0x48, 0xB3,
3538 0x84, 0xC2, 0x9D, 0xC3, 0xC8, 0x8C, 0x41, 0x32, 0xBE, 0x1A,
3539 0x98, 0xAE, 0xD8, 0x66, 0x5B, 0xA6, 0x4A, 0xA8, 0x75, 0xCC,
3540 0x58, 0x63, 0x34, 0xD6, 0x23, 0xDF, 0xA3, 0x72, 0x07, 0xA2,
3541 0x7B, 0xD5, 0x81, 0x14, 0xDB, 0x56, 0xF4, 0x07, 0x22, 0x0E,
3542 0x2C, 0x03, 0x9A, 0xB8, 0x48, 0x58, 0xB2, 0xE8, 0x21, 0x55,
3543 0x14, 0x2A, 0xA3, 0x45, 0x89, 0xCD, 0x29, 0x76, 0x3F, 0x0A,
3544 0x54, 0x60, 0x06, 0x94, 0x82, 0x53, 0x49, 0x5C, 0x92, 0x2E,
3545 0x0E, 0x7C, 0x10, 0x97, 0x35, 0x25, 0x22, 0xA7, 0x28, 0x24,
3546 0x30, 0x68, 0x2F, 0x46, 0x78, 0xD6, 0x55, 0xCA, 0xE3, 0x88,
3547 0x56, 0x94, 0x78, 0x4D, 0x66, 0x26, 0xD7, 0x9F, 0x7A, 0x36,
3548 0x23, 0x77, 0x35, 0xB0, 0x00, 0x25, 0xB0, 0x41, 0x67, 0x82,
3549 0xCC, 0x61, 0x3D, 0x26, 0x46, 0xC7, 0xB6, 0x95, 0xA5, 0x1F,
3550 0x49, 0x13, 0xB9, 0x7A, 0x91, 0x82, 0x99, 0x06, 0xAE, 0x01,
3551 0x45, 0xAE, 0x53, 0x1B, 0xE6, 0x51, 0x34, 0x96, 0x81, 0x62,
3552 0x06, 0xA9, 0x0E, 0x46, 0xB8, 0x18, 0x1E, 0xAF, 0x24, 0x54,
3553 0x89, 0x80, 0xE3, 0xD2, 0x11, 0x8D, 0xB7, 0x80, 0x31, 0x21,
3554 0xEF, 0x81, 0x9D, 0x22, 0x08, 0xE5, 0x0E, 0x3E, 0x9A, 0x8C,
3555 0xA4, 0xBA, 0xAB, 0x1A, 0xC9, 0x75, 0xD1, 0x6B, 0x16, 0x37,
3556 0x5B, 0x36, 0x12, 0x34, 0x06, 0xA6, 0xD7, 0x4B, 0x82, 0x35,
3557 0xC9, 0x64, 0xC3, 0x66, 0x4E, 0x66, 0x0F, 0x62, 0xA5, 0x2B,
3558 0x71, 0x8A, 0x23, 0x0A, 0xD1, 0x06, 0x94, 0xE1, 0x44, 0x8E,
3559 0x59, 0x41, 0x41, 0x09, 0xC9, 0x4D, 0xB7, 0x1D, 0xEE, 0x2E,
3560 0xB7, 0x35, 0x01, 0x89, 0x6B, 0xF4, 0xE2, 0xB1, 0xE7, 0x94,
3561 0xD3, 0x30, 0x34, 0xB8, 0x36, 0xA4, 0x59, 0xBE, 0x0E, 0xC9,
3562 0x49, 0x34, 0x70, 0x55, 0xDB, 0x87, 0x46, 0x2F, 0x68, 0xED,
3563 0x59, 0xB3, 0x7F, 0x2E, 0x0B, 0x8B, 0x90, 0x1F, 0x51, 0x3D,
3564 0x3E, 0xC2, 0xB5, 0x13, 0xCE, 0xAE, 0x6C, 0x56, 0x0D, 0x4A,
3565 0xAB, 0x99, 0x8B, 0x89, 0xEC, 0xBE, 0xCA, 0x02, 0x47, 0x6C,
3566 0xA8, 0x31, 0xEC, 0x98, 0xAA, 0xC1, 0xE1, 0x36, 0x22, 0x2E,
3567 0x81, 0xB0, 0xA2, 0xD2, 0x27, 0x49, 0xCF, 0x60, 0x9E, 0x8C,
3568 0xC3, 0xA0, 0x6E, 0x98, 0x8A, 0xF7, 0x2C, 0x36, 0x3B, 0x7E,
3569 0x25, 0x90, 0xD6, 0xC2, 0x70, 0x0C, 0xF5, 0xEC, 0x07, 0xA5,
3570 0xAE, 0x55, 0x64, 0x04, 0x03, 0xC3, 0x80, 0x55, 0x3C, 0x37,
3571 0x3E, 0xD1, 0x83, 0x7C, 0x2F, 0x11, 0x4C, 0xDE, 0xB8, 0x44,
3572 0xCA, 0x0F, 0xBF, 0x7B, 0x82, 0x2B, 0xB5, 0xD3, 0x10, 0x66,
3573 0x86, 0x8E, 0x39, 0xF6, 0x33, 0x9D, 0x0D, 0x70, 0xB0, 0x02,
3574 0x50, 0xC5, 0x0F, 0x27, 0x35, 0x2C, 0xEF, 0x53, 0x4E, 0x13,
3575 0x58, 0xB8, 0xA8, 0xC0, 0x4A, 0x95, 0x61, 0xFB, 0x48, 0x05,
3576 0xCB, 0xC9, 0x40, 0xD2, 0x3A, 0xBE, 0xA9, 0xB7, 0x78, 0x76,
3577 0x9F, 0x1E
3578 };
3579 static const int sizeof_bench_falcon_level1_key = sizeof(bench_falcon_level1_key);
3580
3581 /* certs/falcon/bench_falcon_level5_key.der */
3582 static const unsigned char bench_falcon_level5_key[] =
3583 {
3584 0x30, 0x82, 0x10, 0x16, 0x02, 0x01, 0x00, 0x30, 0x07, 0x06,
3585 0x05, 0x2B, 0xCE, 0x0F, 0x03, 0x04, 0x04, 0x82, 0x10, 0x06,
3586 0x04, 0x82, 0x10, 0x02, 0x5A, 0xDF, 0x13, 0xB0, 0x70, 0x81,
3587 0x21, 0x02, 0x3D, 0x7F, 0xFF, 0xD0, 0x47, 0xFE, 0x0F, 0xC2,
3588 0xE6, 0xC5, 0xFF, 0x9F, 0xDB, 0xF0, 0x0D, 0xE0, 0xFC, 0x43,
3589 0x07, 0xFE, 0x01, 0x80, 0x20, 0x00, 0xC3, 0xD0, 0x74, 0x3F,
3590 0x07, 0x41, 0xFF, 0xF7, 0x81, 0xEF, 0xFF, 0xF1, 0x10, 0x04,
3591 0x10, 0x4C, 0x32, 0x7C, 0x42, 0x30, 0x08, 0x42, 0x70, 0x45,
3592 0xFF, 0x3F, 0xCF, 0x07, 0x60, 0x00, 0x82, 0x00, 0x84, 0x01,
3593 0x20, 0x04, 0x00, 0x7B, 0xC0, 0x18, 0x42, 0x11, 0x00, 0x22,

NetBurner, Inc.
22.205 certs_test.h 1135

3594 0x17, 0x46, 0x00, 0x70, 0x43, 0xDF, 0x82, 0x10, 0x0B, 0xDA,
3595 0x17, 0x01, 0xE0, 0x0B, 0xFF, 0xF7, 0xBD, 0xE0, 0x7C, 0x1E,
3596 0xF7, 0x7E, 0x40, 0x78, 0x1E, 0x17, 0xC5, 0xD0, 0x18, 0x3D,
3597 0x19, 0x3E, 0x31, 0x68, 0x3F, 0xF8, 0x87, 0xCF, 0xF8, 0x9F,
3598 0x37, 0x7F, 0xE0, 0x7B, 0xC0, 0xF1, 0x40, 0x1F, 0x04, 0x5F,
3599 0x08, 0x42, 0x2E, 0x03, 0xA5, 0xD8, 0x06, 0x52, 0xF0, 0x24,
3600 0x00, 0x01, 0xEF, 0xE8, 0x42, 0xE9, 0xBD, 0xF2, 0x9B, 0xBA,
3601 0x16, 0xFD, 0xCF, 0x83, 0x81, 0x08, 0x3F, 0xFE, 0x88, 0x40,
3602 0x01, 0xB0, 0x12, 0x8B, 0xA1, 0x10, 0xBD, 0xF1, 0x7C, 0x1F,
3603 0x18, 0x47, 0xC0, 0x13, 0xC1, 0xF7, 0x84, 0x00, 0x03, 0x5F,
3604 0xF8, 0x46, 0x21, 0xF8, 0x1D, 0x17, 0x80, 0x0F, 0x8B, 0xC0,
3605 0x0E, 0xC3, 0xEE, 0x87, 0xBE, 0xF0, 0xF4, 0x01, 0xEC, 0x1D,
3606 0xF7, 0xC6, 0x11, 0xF8, 0x1B, 0x18, 0x7F, 0xCE, 0xFF, 0xBA,
3607 0x10, 0x46, 0x3E, 0xF3, 0xFE, 0x31, 0x3E, 0x40, 0xFB, 0x80,
3608 0x18, 0x43, 0xD0, 0x04, 0xFE, 0x00, 0x70, 0x0E, 0x08, 0x3F,
3609 0xF7, 0xFE, 0x0F, 0x70, 0x22, 0xE7, 0x86, 0x20, 0x94, 0x3F,
3610 0x10, 0xF6, 0x4F, 0x80, 0x00, 0x17, 0x86, 0x3F, 0x6F, 0x41,
3611 0xE8, 0x44, 0x0F, 0x8B, 0xE3, 0xF0, 0x82, 0x2E, 0xEC, 0x00,
3612 0x20, 0xFE, 0x00, 0x78, 0x1B, 0x27, 0xF8, 0x10, 0x8F, 0xBD,
3613 0x17, 0x78, 0x5F, 0xE0, 0x04, 0xF8, 0xC2, 0x0F, 0xFB, 0xFE,
3614 0xF9, 0xF5, 0xF0, 0x8F, 0xC2, 0x01, 0x3D, 0xD1, 0x77, 0x61,
3615 0x10, 0xC4, 0x41, 0x04, 0x9F, 0x0E, 0xC9, 0x9F, 0xFF, 0xC3,
3616 0xD8, 0x7A, 0x00, 0x07, 0x61, 0xF0, 0x04, 0x0F, 0x6F, 0x61,
3617 0xE7, 0x78, 0x1E, 0xFF, 0xDD, 0x31, 0x02, 0x00, 0x84, 0x40,
3618 0xFF, 0x42, 0x00, 0xF8, 0x02, 0x10, 0xFE, 0x71, 0x7C, 0x41,
3619 0x37, 0xC2, 0x22, 0x83, 0x9B, 0xEF, 0xFD, 0xFF, 0x78, 0x5E,
3620 0xF8, 0x05, 0xD0, 0x73, 0xE3, 0xFF, 0x3E, 0x5E, 0xFC, 0x21,
3621 0x1F, 0xBC, 0x00, 0x07, 0xC2, 0xF0, 0xC2, 0x3E, 0x07, 0xE0,
3622 0x08, 0x02, 0x10, 0xFC, 0x63, 0xF0, 0x05, 0xFF, 0xEF, 0x7D,
3623 0x07, 0x86, 0x02, 0x07, 0xE5, 0x08, 0x46, 0x42, 0x0B, 0xA1,
3624 0xE7, 0xFD, 0xEF, 0x6C, 0x42, 0xF0, 0x04, 0x00, 0x84, 0x60,
3625 0xF9, 0x84, 0x1F, 0x0F, 0x98, 0xD8, 0xBF, 0xEF, 0x77, 0xC2,
3626 0x08, 0x41, 0xF1, 0xFB, 0xE0, 0x17, 0x7B, 0xED, 0x78, 0x5C,
3627 0x10, 0x42, 0x2F, 0x83, 0xDE, 0x50, 0xB6, 0x22, 0x07, 0xE3,
3628 0x10, 0x45, 0xE0, 0x7F, 0xA1, 0xE9, 0x00, 0x11, 0x7B, 0xE1,
3629 0xD8, 0xC4, 0x4E, 0xFF, 0xFF, 0x17, 0xFC, 0x31, 0x1B, 0xA2,
3630 0xF8, 0x41, 0xDF, 0x10, 0x3F, 0xE8, 0x3F, 0xFF, 0x87, 0xC2,
3631 0x1F, 0x44, 0x20, 0x83, 0xBF, 0x17, 0x02, 0x20, 0x04, 0x3B,
3632 0xF8, 0x01, 0xC0, 0x83, 0xE2, 0x30, 0x40, 0x5F, 0x80, 0x23,
3633 0x07, 0x83, 0xC0, 0xF0, 0x60, 0x00, 0xC4, 0x10, 0x08, 0x9F,
3634 0xE8, 0xBA, 0x2F, 0xFF, 0xE3, 0x0E, 0x41, 0xA3, 0x7C, 0x62,
3635 0x17, 0x7C, 0x0F, 0xFB, 0xC0, 0x07, 0x7D, 0xD2, 0xEC, 0x82,
3636 0xFF, 0x49, 0xB0, 0x74, 0x9F, 0x07, 0xFC, 0x5F, 0x14, 0x7F,
3637 0x17, 0x3C, 0x42, 0x08, 0x5C, 0xD9, 0x36, 0x50, 0xFB, 0xC1,
3638 0x09, 0x80, 0x41, 0x93, 0xE6, 0xF8, 0xBC, 0x11, 0x0C, 0x05,
3639 0x0E, 0x83, 0xBF, 0xFB, 0x9C, 0xF8, 0x3E, 0x20, 0x7C, 0x3F,
3640 0x09, 0x3E, 0x01, 0x8B, 0xA1, 0xFF, 0xFC, 0x3F, 0x00, 0x24,
3641 0x17, 0x82, 0x23, 0x7C, 0x3D, 0xD7, 0x76, 0x1F, 0x0C, 0x3E,
3642 0x1F, 0xFE, 0x22, 0xFF, 0xFE, 0xE0, 0x82, 0x00, 0x97, 0xC3,
3643 0xE0, 0x45, 0xD1, 0x06, 0xC2, 0x17, 0xF7, 0xEE, 0x7B, 0xA8,
3644 0x00, 0x84, 0x3F, 0xFF, 0x81, 0xF0, 0xB0, 0x11, 0xF4, 0x00,
3645 0x16, 0xB8, 0x5F, 0x7B, 0xDD, 0xEF, 0xC0, 0x3F, 0x08, 0x02,
3646 0x0F, 0xD1, 0xF0, 0x94, 0x42, 0xF0, 0x0D, 0xC0, 0x7C, 0x21,
3647 0x0F, 0xC6, 0x01, 0x7C, 0x7E, 0x0F, 0x01, 0xD1, 0x01, 0x01,
3648 0x1F, 0x39, 0xE0, 0x83, 0xDF, 0x07, 0x7E, 0x1F, 0x0B, 0xFB,
3649 0x2F, 0xC7, 0xE3, 0x70, 0x63, 0x1F, 0xC6, 0x10, 0x7C, 0x5E,
3650 0x00, 0x3E, 0x02, 0x98, 0x41, 0xF7, 0x84, 0x0F, 0xF4, 0x01,
3651 0x07, 0x05, 0xF0, 0x23, 0xBE, 0xF0, 0x46, 0x30, 0x83, 0xE0,
3652 0x00, 0x79, 0xDF, 0x0C, 0xE3, 0x0F, 0x44, 0x00, 0xFF, 0xDF,
3653 0xE8, 0xC4, 0x14, 0x13, 0xBF, 0x08, 0x7D, 0x92, 0x03, 0xE0,
3654 0x20, 0x03, 0x91, 0x10, 0xA1, 0xF1, 0x01, 0xCE, 0x73, 0x84,
3655 0xF7, 0xBA, 0x23, 0x68, 0x3F, 0xF0, 0x7C, 0x2D, 0x03, 0xFF,
3656 0x07, 0xBE, 0x3F, 0x7F, 0xD9, 0x10, 0x03, 0xC1, 0x03, 0xC2,
3657 0xEA, 0x0A, 0x1E, 0x00, 0x03, 0xF8, 0x46, 0x3E, 0xF8, 0x02,
3658 0x18, 0x44, 0x3F, 0x00, 0xA0, 0xF7, 0x3C, 0x0D, 0x73, 0xFF,
3659 0xEE, 0xC0, 0x30, 0x10, 0x5F, 0xFF, 0xCA, 0x3E, 0xF3, 0xE1,
3660 0xE9, 0x02, 0x0D, 0x77, 0xDF, 0xF8, 0xBF, 0xCF, 0xFC, 0x62,
3661 0xE8, 0xBE, 0x40, 0xF4, 0x01, 0x0E, 0xF9, 0xE1, 0x7B, 0xC1,
3662 0x18, 0x7C, 0x3F, 0xF7, 0xE4, 0x10, 0xC2, 0x20, 0x88, 0x41,
3663 0x1F, 0x0F, 0xFF, 0x0C, 0x45, 0x10, 0xFF, 0xCF, 0x7B, 0xA0,
3664 0xFF, 0x4B, 0xF0, 0x78, 0x39, 0x07, 0x84, 0x2F, 0x04, 0xBC,
3665 0xE8, 0x04, 0x0F, 0x00, 0x3E, 0xFF, 0xC1, 0xCF, 0x93, 0xFC,
3666 0xF0, 0x33, 0xCE, 0x80, 0x21, 0x01, 0x4B, 0xD1, 0xF7, 0x9B,
3667 0xD8, 0x44, 0x00, 0x8F, 0xC3, 0x37, 0x38, 0x12, 0x7F, 0xA0,
3668 0x09, 0x00, 0x22, 0x00, 0x7E, 0xF8, 0x44, 0x5F, 0x17, 0xFE,
3669 0xF8, 0x7C, 0x1F, 0x88, 0x82, 0x17, 0x36, 0x0F, 0x0C, 0x24,
3670 0x08, 0x39, 0x80, 0x6F, 0xC1, 0x10, 0x44, 0x1F, 0x9B, 0xFE,
3671 0x27, 0x03, 0xF2, 0x04, 0xBF, 0xE0, 0xCC, 0x0E, 0xFB, 0xC4,
3672 0x00, 0x40, 0x50, 0x74, 0x23, 0x17, 0xBE, 0x0F, 0x7C, 0xDB,
3673 0xE9, 0x00, 0x41, 0x80, 0xBF, 0x20, 0xF8, 0x00, 0x87, 0xFE,
3674 0x08, 0x3F, 0xFF, 0x00, 0x21, 0x18, 0x83, 0x50, 0xF7, 0xC2,
3675 0x09, 0x81, 0xC2, 0x07, 0x9D, 0x27, 0x83, 0xD0, 0x04, 0x1C,
3676 0xE8, 0x06, 0x41, 0xFC, 0x44, 0xD9, 0x3F, 0xFF, 0x04, 0x41,
3677 0x29, 0x80, 0x0B, 0x7F, 0xC0, 0xF0, 0x7C, 0x00, 0x77, 0xA2,
3678 0x08, 0xB7, 0xE0, 0xF7, 0xDD, 0xF7, 0xC7, 0xF1, 0x6B, 0xE1,
3679 0x00, 0x09, 0xF4, 0xFB, 0xDD, 0xF6, 0xC9, 0xE2, 0x0B, 0xE1,
3680 0x00, 0xB9, 0xDD, 0x78, 0x41, 0x18, 0xFF, 0xE1, 0xFC, 0x3F,

NetBurner, Inc.
1136 File Documentation

3681 0xF7, 0xBF, 0xE0, 0x93, 0xBD, 0x28, 0x4D, 0xFF, 0xF8, 0x01,
3682 0x00, 0x09, 0xDE, 0x88, 0x24, 0xE8, 0x85, 0xD0, 0x7B, 0x80,
3683 0xFF, 0xC2, 0x10, 0xF0, 0x5D, 0xEF, 0x7F, 0xFE, 0xF4, 0x1F,
3684 0x0F, 0xC2, 0x10, 0x84, 0x3D, 0xD7, 0x7C, 0x20, 0x80, 0x17,
3685 0xE8, 0x85, 0xED, 0x8C, 0x03, 0xD7, 0x85, 0xDE, 0xF4, 0x9E,
3686 0x00, 0x80, 0x01, 0x08, 0x03, 0x08, 0x3D, 0xFE, 0x08, 0x3F,
3687 0xE8, 0x08, 0x31, 0x08, 0x02, 0x06, 0xFF, 0xFE, 0x8C, 0xC0,
3688 0xF8, 0x40, 0x00, 0x14, 0x60, 0x06, 0xC2, 0x2C, 0x88, 0x01,
3689 0x30, 0x34, 0x20, 0x94, 0x5D, 0x17, 0x7F, 0xBF, 0x9B, 0x62,
3690 0xDF, 0xBE, 0x4F, 0xF4, 0x21, 0xFF, 0xC2, 0x30, 0x88, 0xA1,
3691 0xEF, 0x40, 0x00, 0xFC, 0x43, 0xF8, 0x3B, 0xAF, 0x78, 0x01,
3692 0xF0, 0x45, 0xEC, 0x8B, 0xFE, 0x10, 0x3A, 0x2F, 0xF7, 0xFF,
3693 0x08, 0x00, 0x21, 0x17, 0xBD, 0x07, 0xC2, 0x0E, 0xFC, 0x45,
3694 0x3F, 0xC1, 0xEE, 0xFB, 0x3A, 0xF0, 0xC1, 0xD1, 0x84, 0x5A,
3695 0xE8, 0x09, 0xC1, 0x78, 0x00, 0x0E, 0xF4, 0x1E, 0x7F, 0x3C,
3696 0x18, 0xC1, 0xDE, 0x88, 0xA2, 0x0F, 0x84, 0x10, 0x04, 0x7A,
3697 0x17, 0xBF, 0xC1, 0x74, 0x26, 0x18, 0x81, 0xFF, 0x6C, 0x3B,
3698 0x0F, 0xCC, 0x2F, 0x80, 0x1F, 0xF0, 0x3E, 0x10, 0x88, 0xBD,
3699 0xFE, 0xC9, 0xB0, 0x03, 0xFE, 0xF8, 0x3E, 0x21, 0xFC, 0xC2,
3700 0x3F, 0x80, 0x00, 0x8F, 0xE0, 0x1F, 0x85, 0xCE, 0x8B, 0xC5,
3701 0x0F, 0x41, 0xB1, 0x7F, 0x83, 0x09, 0x02, 0x3E, 0xFC, 0x21,
3702 0xE8, 0x7E, 0x22, 0x07, 0xA1, 0x38, 0x3D, 0xF0, 0x80, 0x3C,
3703 0x10, 0x44, 0x20, 0x0F, 0xDF, 0x0F, 0x7A, 0x01, 0x88, 0x00,
3704 0x0F, 0xFA, 0x0E, 0x73, 0xDF, 0xF0, 0x83, 0xD2, 0x7C, 0xDF,
3705 0xEE, 0xCC, 0x00, 0xF4, 0x43, 0x00, 0x3F, 0xFF, 0x00, 0x3D,
3706 0xFE, 0x83, 0xA0, 0xFC, 0x43, 0x07, 0x81, 0xED, 0xFC, 0x01,
3707 0x20, 0x42, 0x2F, 0x87, 0xFE, 0xF7, 0x47, 0xB1, 0x1B, 0xDE,
3708 0x10, 0x08, 0x10, 0x78, 0xBD, 0xE9, 0xB9, 0xCE, 0x7C, 0x9D,
3709 0x00, 0x36, 0x1F, 0xEF, 0xDE, 0xF7, 0x87, 0xD0, 0x87, 0xC4,
3710 0x0E, 0xB6, 0x8D, 0x8B, 0xE1, 0xF8, 0xCD, 0xDF, 0x0B, 0x3D,
3711 0x0F, 0xCF, 0xEE, 0x80, 0x01, 0x01, 0x3D, 0xE0, 0xFC, 0x62,
3712 0x29, 0x41, 0xF0, 0x07, 0xFF, 0xFF, 0x46, 0x61, 0x80, 0x1D,
3713 0x27, 0xFE, 0x1F, 0xF4, 0x3B, 0x0F, 0xFF, 0xCF, 0x8B, 0xFE,
3714 0xE8, 0x84, 0x4F, 0x84, 0x24, 0x0F, 0x1D, 0xFB, 0xDA, 0xFE,
3715 0x0E, 0x16, 0x10, 0x03, 0x15, 0xE6, 0xE3, 0xF8, 0xFF, 0xD8,
3716 0x4B, 0xC8, 0xE5, 0xF4, 0x26, 0x03, 0xDB, 0x2A, 0xFD, 0x05,
3717 0xE1, 0xEF, 0x0B, 0xFC, 0x20, 0xFB, 0x31, 0x11, 0x1C, 0x03,
3718 0x15, 0xE1, 0xD6, 0x0B, 0xDC, 0xF5, 0x12, 0xED, 0xEA, 0x28,
3719 0x20, 0xE5, 0x21, 0xDC, 0xE7, 0xDF, 0x05, 0xDE, 0xF4, 0xFF,
3720 0x1F, 0xEF, 0x4A, 0xE6, 0x15, 0x0A, 0x07, 0x06, 0xF7, 0xE6,
3721 0xEE, 0xEC, 0x00, 0xF0, 0x03, 0xFF, 0xBB, 0x0D, 0xFB, 0x35,
3722 0xE3, 0xF5, 0xE6, 0xEA, 0x26, 0x00, 0x0E, 0x10, 0xFB, 0xDA,
3723 0x1B, 0xD1, 0xEF, 0x09, 0x02, 0x03, 0x16, 0x1F, 0x06, 0xDC,
3724 0xF8, 0x25, 0x17, 0xE9, 0xEA, 0x0F, 0xD5, 0x15, 0x0B, 0xE3,
3725 0x04, 0x20, 0xF5, 0x09, 0xE9, 0x1A, 0xE8, 0x0F, 0xEB, 0xE4,
3726 0xE9, 0x36, 0x03, 0xF5, 0xFF, 0x42, 0xFD, 0xE7, 0xFA, 0xF7,
3727 0xD2, 0x19, 0xCA, 0xE8, 0x22, 0x00, 0xEE, 0xDB, 0x00, 0xFE,
3728 0x18, 0x19, 0x14, 0x0C, 0x0A, 0xD0, 0x14, 0x21, 0x2E, 0xFD,
3729 0x36, 0xED, 0xAE, 0x1B, 0x00, 0x15, 0xF4, 0x13, 0xDC, 0x12,
3730 0xCB, 0x0A, 0xD4, 0xDD, 0x01, 0xCB, 0xED, 0xC2, 0xE5, 0xF2,
3731 0xD7, 0x02, 0xEF, 0xDB, 0x1D, 0x2F, 0xE2, 0x20, 0x3A, 0xE4,
3732 0x25, 0x1B, 0x14, 0x18, 0xF5, 0x04, 0x06, 0x18, 0x0D, 0x39,
3733 0xFC, 0x06, 0xF9, 0x0A, 0x20, 0xE1, 0xF7, 0x2E, 0xFB, 0xE3,
3734 0xF2, 0x21, 0xF9, 0xD3, 0x04, 0x07, 0xF9, 0x0B, 0xFC, 0xFA,
3735 0x27, 0x05, 0xF8, 0x2A, 0xFA, 0x0B, 0xFB, 0xEF, 0xB9, 0x08,
3736 0xFE, 0x0C, 0x14, 0x05, 0xE2, 0xFA, 0xFD, 0xC9, 0x0C, 0xF4,
3737 0x38, 0xCD, 0xFA, 0xD6, 0xE4, 0x05, 0x05, 0x1E, 0xF8, 0x3B,
3738 0x2E, 0x0E, 0x16, 0x07, 0x2C, 0x10, 0xF3, 0x1B, 0xF1, 0x00,
3739 0x08, 0xF0, 0xC7, 0x14, 0xD7, 0xDD, 0x06, 0xC2, 0xF3, 0xFD,
3740 0x10, 0x05, 0x18, 0x24, 0xE6, 0xDD, 0x0A, 0xDC, 0xDB, 0xEE,
3741 0xFE, 0xF6, 0xF9, 0x19, 0x40, 0x0B, 0x2B, 0x37, 0x28, 0xC7,
3742 0xFD, 0xF7, 0x07, 0xD5, 0x0C, 0x0C, 0x01, 0xDC, 0x2B, 0xD8,
3743 0xFD, 0x0C, 0xD1, 0xFC, 0x12, 0xE8, 0x02, 0xDC, 0x05, 0xDA,
3744 0xEB, 0x00, 0x1C, 0xDC, 0xFF, 0x07, 0xF8, 0x0F, 0xC8, 0x13,
3745 0x06, 0x08, 0x03, 0xEC, 0x11, 0xE8, 0xFD, 0xFD, 0xFF, 0x0D,
3746 0xF2, 0xD8, 0xF7, 0xFF, 0xFB, 0x11, 0xF4, 0xE2, 0xE9, 0x07,
3747 0xE7, 0xF6, 0xE9, 0x53, 0x13, 0x33, 0xEE, 0x1C, 0x15, 0x13,
3748 0x00, 0x24, 0xFC, 0xEA, 0x09, 0x15, 0xEC, 0x28, 0xF5, 0x1F,
3749 0xDB, 0xE3, 0xFC, 0x02, 0xF9, 0x0C, 0x0D, 0x26, 0x05, 0xF6,
3750 0x04, 0x02, 0xE4, 0x2F, 0x02, 0xF1, 0xE9, 0xE6, 0xEC, 0x03,
3751 0xEA, 0x16, 0xFA, 0x09, 0x13, 0xF6, 0x29, 0xE7, 0x13, 0xFB,
3752 0xF9, 0xDD, 0x03, 0xF7, 0xD4, 0x0B, 0xE7, 0xF2, 0x24, 0x2C,
3753 0x24, 0x35, 0x02, 0xFE, 0x21, 0xE9, 0x20, 0x01, 0x2A, 0x10,
3754 0x01, 0x1F, 0x03, 0x28, 0x2D, 0x20, 0xF8, 0x10, 0x0A, 0x09,
3755 0xF5, 0x32, 0xD5, 0xF6, 0xE4, 0x1F, 0xF8, 0xF4, 0xD8, 0xF4,
3756 0xD8, 0x0A, 0x07, 0x16, 0x0A, 0xFD, 0x14, 0xF8, 0x22, 0xDC,
3757 0x03, 0xDD, 0xFA, 0xEB, 0xD3, 0xE4, 0x0D, 0x04, 0xF6, 0x1D,
3758 0x1E, 0xDF, 0xF6, 0x28, 0x25, 0x17, 0x0B, 0xCF, 0xF1, 0x14,
3759 0xD9, 0x17, 0xEB, 0x34, 0xF7, 0xEC, 0xCE, 0x20, 0x1E, 0xD5,
3760 0x20, 0x07, 0xEB, 0xE8, 0x13, 0x04, 0x3D, 0x07, 0xF7, 0xF8,
3761 0xFE, 0xF6, 0xEA, 0xE9, 0xEE, 0xD7, 0xEE, 0xFC, 0xEA, 0xFA,
3762 0xFB, 0xDA, 0x33, 0x0F, 0xED, 0x0B, 0x2B, 0x00, 0x1A, 0xED,
3763 0x12, 0xF4, 0x0D, 0x15, 0x14, 0xFB, 0xF0, 0xF4, 0x0F, 0x0C,
3764 0xEC, 0x27, 0x11, 0x13, 0xF0, 0x0E, 0x2D, 0xE5, 0x00, 0xD2,
3765 0x0F, 0xD5, 0xF5, 0xFA, 0xF3, 0x03, 0x00, 0xDB, 0x17, 0xDD,
3766 0x2C, 0xE8, 0xFE, 0xE7, 0x46, 0xF6, 0xEF, 0xFD, 0x1F, 0xFF,
3767 0x0F, 0xEF, 0xE7, 0xEE, 0x18, 0x02, 0x27, 0x2B, 0xFC, 0x2D,

NetBurner, Inc.
22.205 certs_test.h 1137

3768 0xF6, 0x13, 0xFC, 0xFD, 0xBB, 0xF8, 0xEE, 0xDD, 0x12, 0x0D,
3769 0x01, 0x22, 0x2F, 0xF0, 0xF1, 0x1B, 0x0C, 0x09, 0xE7, 0x33,
3770 0xE5, 0xFF, 0xFA, 0xFC, 0x1E, 0x15, 0x08, 0xF2, 0xDA, 0xE3,
3771 0xF4, 0xEA, 0xEF, 0x29, 0x3A, 0x02, 0x0B, 0x1E, 0xF4, 0x46,
3772 0xC5, 0x1C, 0xBD, 0xFC, 0xE5, 0x05, 0x0E, 0x24, 0xF9, 0xDE,
3773 0xD6, 0x1B, 0x05, 0xFF, 0xD3, 0xF3, 0xF2, 0x0D, 0xF0, 0x03,
3774 0xF5, 0x19, 0xFE, 0xDB, 0x0B, 0x00, 0x02, 0xC5, 0x12, 0x04,
3775 0xED, 0x1A, 0xF0, 0x12, 0x1C, 0x28, 0x1F, 0xEF, 0xDD, 0xCB,
3776 0xFC, 0x02, 0xF2, 0xED, 0xD1, 0xEC, 0xE5, 0xCC, 0xFE, 0xF6,
3777 0x03, 0xEE, 0xDF, 0x3F, 0x0F, 0xFD, 0x04, 0x05, 0x32, 0x11,
3778 0x1C, 0xF2, 0xF0, 0x1E, 0x07, 0xEF, 0x07, 0x1E, 0x17, 0x15,
3779 0x04, 0x01, 0x03, 0xF7, 0xFA, 0x02, 0xD9, 0xEB, 0x19, 0xCD,
3780 0xEA, 0x2B, 0x22, 0xFD, 0xD7, 0x08, 0xF0, 0xF4, 0xF4, 0xF1,
3781 0x44, 0x09, 0xE5, 0x0B, 0xFE, 0xEE, 0x1F, 0x1A, 0xED, 0xFF,
3782 0xFB, 0x07, 0xFD, 0xF6, 0x1E, 0x1D, 0x02, 0xFF, 0xDA, 0x01,
3783 0x1E, 0xEE, 0x04, 0xD2, 0xDF, 0xDA, 0x0D, 0xFC, 0xFA, 0xF9,
3784 0xFE, 0x12, 0x0B, 0x42, 0x26, 0x0E, 0x00, 0xD9, 0xEF, 0x17,
3785 0x02, 0xD3, 0x1B, 0x03, 0xEB, 0xDE, 0x0C, 0x11, 0xFF, 0x0E,
3786 0x1D, 0xCD, 0xF9, 0xEF, 0x12, 0x0E, 0x0F, 0x03, 0xF7, 0x21,
3787 0x16, 0x1F, 0x11, 0xD9, 0x02, 0x01, 0xE4, 0x0D, 0xDB, 0x2D,
3788 0xD6, 0x16, 0xE0, 0xEE, 0x1D, 0xF7, 0xFA, 0xE8, 0x10, 0xF3,
3789 0x39, 0xF0, 0xEA, 0xEC, 0x2D, 0xCE, 0x22, 0xCE, 0x2C, 0xF8,
3790 0x1F, 0xEA, 0xFC, 0xD9, 0x28, 0x14, 0xFC, 0x22, 0x15, 0xE4,
3791 0xCF, 0x19, 0xFD, 0xE0, 0xEC, 0xEE, 0xFC, 0xEE, 0x0F, 0xE4,
3792 0x03, 0xF8, 0xDF, 0xF3, 0x12, 0xF3, 0xF1, 0xED, 0xEB, 0x14,
3793 0xD4, 0x4E, 0x0B, 0x25, 0xC8, 0x14, 0x01, 0x10, 0xFA, 0x18,
3794 0x12, 0x13, 0x0A, 0xE0, 0xED, 0xD7, 0x01, 0xD5, 0xF6, 0xDD,
3795 0xBC, 0x0C, 0xD9, 0xFC, 0xE1, 0x07, 0x06, 0xEE, 0xBD, 0x1F,
3796 0xEC, 0x1A, 0x22, 0x04, 0xFC, 0x18, 0xF2, 0xEA, 0x01, 0x0B,
3797 0xF6, 0xFA, 0x13, 0x26, 0x09, 0x07, 0xEC, 0x0B, 0x08, 0x0F,
3798 0xFE, 0x0E, 0xD2, 0x15, 0xB3, 0xE0, 0xD8, 0x34, 0xE3, 0xEC,
3799 0xF6, 0x21, 0xEB, 0x13, 0x01, 0xF3, 0x0B, 0x02, 0x07, 0xF7,
3800 0x0D, 0xF6, 0x2F, 0x22, 0xFE, 0x21, 0x1F, 0xE7, 0xFA, 0xFF,
3801 0x0F, 0x03, 0xFD, 0xE5, 0xE3, 0x0F, 0xF5, 0x08, 0xF6, 0xFF,
3802 0x02, 0x30, 0xE0, 0x21, 0xEC, 0x21, 0x3A, 0xF6, 0x1F, 0xF4,
3803 0x01, 0xCC, 0x0D, 0xD7, 0x1B, 0x24, 0x1F, 0x0F, 0x0D, 0xFB,
3804 0xFC, 0x16, 0x13, 0x1C, 0xE0, 0xEC, 0xED, 0xE9, 0x07, 0xE0,
3805 0xFC, 0xF1, 0xDB, 0x07, 0x23, 0xF9, 0x10, 0x08, 0xE4, 0xF7,
3806 0xF4, 0xEC, 0xCD, 0xE0, 0xF9, 0xCD, 0xF3, 0x13, 0x02, 0x05,
3807 0x0C, 0xF8, 0xFA, 0xFF, 0x14, 0xE3, 0x01, 0xEA, 0xFB, 0x04,
3808 0x2C, 0xF5, 0xF3, 0x10, 0x19, 0xE7, 0x03, 0xDC, 0x2A, 0xFB,
3809 0x06, 0x0B, 0x05, 0x3D, 0xE8, 0xD4, 0x2F, 0xFD, 0xDE, 0x14,
3810 0x19, 0xD5, 0xEE, 0xFA, 0x0D, 0x06, 0x0B, 0x41, 0x1F, 0xDA,
3811 0x0E, 0x1C, 0xF5, 0xEF, 0x36, 0x0A, 0x1E, 0x0F, 0x07, 0x0D,
3812 0x19, 0x03, 0xDA, 0xE2, 0x12, 0x1C, 0xEA, 0xF7, 0x13, 0xCE,
3813 0x27, 0x18, 0xD2, 0x04, 0xD5, 0xFB, 0xFD, 0xD7, 0xDF, 0xEB,
3814 0x1B, 0xFC, 0xFD, 0x16, 0xEB, 0x1B, 0xF1, 0xDD, 0x34, 0xD7,
3815 0x3D, 0x00, 0x24, 0x04, 0x19, 0xF5, 0x0E, 0x14, 0x1F, 0x06,
3816 0xE4, 0xEF, 0xCF, 0x17, 0xE2, 0x0D, 0x17, 0x06, 0xF7, 0x0A,
3817 0x21, 0xAA, 0xC5, 0xB8, 0x1B, 0x6C, 0xEB, 0x28, 0x70, 0x4A,
3818 0x9A, 0x80, 0x17, 0xDD, 0x39, 0xB2, 0xDA, 0x07, 0x9E, 0xC3,
3819 0xD2, 0x6C, 0xF1, 0x0F, 0x42, 0xB7, 0x48, 0xC4, 0x1A, 0x01,
3820 0xAD, 0x83, 0x05, 0x4D, 0x8A, 0x4D, 0x56, 0xBC, 0x10, 0x38,
3821 0x11, 0xD8, 0x6A, 0x34, 0x02, 0xF4, 0x8F, 0x86, 0x64, 0x70,
3822 0x92, 0xB7, 0xD5, 0xF5, 0xAD, 0x9B, 0x0A, 0x76, 0x8B, 0x42,
3823 0x39, 0xA0, 0x3B, 0x5F, 0xBA, 0x46, 0x27, 0xF3, 0x4C, 0xC7,
3824 0x7F, 0x78, 0xB5, 0xE3, 0xC2, 0x95, 0x67, 0x32, 0x3C, 0x28,
3825 0x88, 0x2A, 0xEE, 0x4F, 0x9E, 0xC2, 0xEC, 0xF5, 0xD7, 0xE2,
3826 0xA1, 0x4D, 0x9C, 0xB1, 0xC3, 0x64, 0x21, 0xD2, 0x19, 0xD8,
3827 0xA6, 0x33, 0x95, 0xC0, 0xD8, 0x07, 0x82, 0xC7, 0xB3, 0xC4,
3828 0x25, 0xCC, 0x24, 0xE8, 0xB7, 0xD2, 0xBA, 0x6F, 0x2B, 0x79,
3829 0x08, 0xF0, 0xF0, 0x47, 0x65, 0xEF, 0x46, 0x65, 0x46, 0xB9,
3830 0xD7, 0x0E, 0xC5, 0x52, 0x5C, 0x75, 0x5B, 0xDB, 0xA8, 0x39,
3831 0x99, 0x4A, 0xA8, 0x47, 0x08, 0xC9, 0xA8, 0x9F, 0x40, 0x1A,
3832 0x67, 0xFB, 0x46, 0x48, 0xB3, 0x82, 0x11, 0xF2, 0x66, 0xA2,
3833 0xF6, 0xBB, 0xCC, 0xC2, 0x08, 0xFA, 0xAF, 0x1F, 0x36, 0x10,
3834 0x9C, 0xF5, 0x5F, 0x6D, 0x54, 0x27, 0xB9, 0x80, 0x88, 0xF8,
3835 0x50, 0x5F, 0x90, 0x05, 0xC1, 0x94, 0xCA, 0xED, 0xAE, 0x59,
3836 0xE8, 0x76, 0x1A, 0x16, 0xDA, 0x88, 0xAA, 0x4D, 0xEA, 0xD5,
3837 0xB6, 0xD3, 0xA1, 0x13, 0x5C, 0xA2, 0x1A, 0x46, 0x47, 0xFC,
3838 0xB5, 0x4A, 0x47, 0x04, 0xD4, 0xEF, 0xBF, 0xBF, 0x61, 0xAC,
3839 0x91, 0x05, 0x59, 0xF6, 0x91, 0x3D, 0x98, 0x90, 0xEB, 0x1E,
3840 0x9A, 0x9D, 0x42, 0x9A, 0xD4, 0x10, 0x21, 0x61, 0x12, 0x66,
3841 0xE4, 0xDB, 0xC6, 0x06, 0x52, 0x77, 0x91, 0xA7, 0x01, 0x09,
3842 0x94, 0x92, 0x5D, 0xB5, 0x3C, 0x29, 0xA5, 0x4D, 0xEE, 0xBD,
3843 0xA6, 0xC8, 0xC7, 0x81, 0x8B, 0x93, 0x64, 0x6C, 0xD6, 0xA8,
3844 0xAC, 0x18, 0x3C, 0x5B, 0x48, 0x69, 0x77, 0xA9, 0x2E, 0x65,
3845 0xA2, 0xE6, 0x26, 0x73, 0xF7, 0x8A, 0x9E, 0x31, 0x56, 0xD6,
3846 0xE6, 0x2F, 0xCD, 0xDD, 0xBF, 0xF2, 0x31, 0xC6, 0x87, 0x2F,
3847 0xE6, 0x2C, 0x68, 0x4F, 0x79, 0xE4, 0xC2, 0x0A, 0x48, 0xFC,
3848 0x4D, 0xF4, 0xF8, 0x40, 0x85, 0x9C, 0xE1, 0x4C, 0x47, 0x4D,
3849 0x16, 0x88, 0xB5, 0xCA, 0x51, 0xBB, 0x6B, 0x12, 0x50, 0x37,
3850 0x6E, 0xBA, 0x06, 0x10, 0x0E, 0x5A, 0x9F, 0x9C, 0xB5, 0x0B,
3851 0x32, 0x81, 0x96, 0x1F, 0xC1, 0x24, 0xE8, 0x85, 0x6E, 0x3F,
3852 0xB9, 0xD8, 0xE4, 0x69, 0x30, 0x1A, 0xF3, 0x12, 0x98, 0x32,
3853 0xF2, 0xB8, 0x5F, 0xA1, 0xB4, 0x71, 0x0B, 0x19, 0x09, 0x22,
3854 0xD5, 0x84, 0x1A, 0x49, 0xE7, 0x10, 0x07, 0xDF, 0x68, 0x8D,

NetBurner, Inc.
1138 File Documentation

3855 0xFB, 0x02, 0xB0, 0x9E, 0xF4, 0x06, 0x36, 0x8C, 0x81, 0x70,
3856 0xD6, 0x5D, 0x31, 0x98, 0x5E, 0xC2, 0xF4, 0x5B, 0xDC, 0xA3,
3857 0x38, 0x7F, 0x82, 0x58, 0x48, 0x50, 0x51, 0x24, 0x2C, 0x80,
3858 0xE0, 0x1A, 0xAA, 0x8C, 0xDC, 0x4F, 0xD0, 0x21, 0x14, 0x6A,
3859 0xBD, 0x2C, 0x5D, 0x51, 0xFA, 0x94, 0x18, 0x89, 0x5C, 0x69,
3860 0xD9, 0xB5, 0x23, 0xCB, 0x00, 0x1C, 0x67, 0x27, 0x58, 0x62,
3861 0xE3, 0xB3, 0xD5, 0x6A, 0x57, 0xE8, 0x6C, 0x18, 0x60, 0xCA,
3862 0x20, 0x14, 0x3E, 0xA2, 0x76, 0xA6, 0xBC, 0xE9, 0x83, 0x3A,
3863 0x20, 0x2E, 0x61, 0x5E, 0xAB, 0x20, 0x1F, 0x0A, 0x32, 0x35,
3864 0x8E, 0x3B, 0x30, 0x4C, 0xEA, 0x74, 0xB8, 0x72, 0xC5, 0x95,
3865 0xD9, 0x4A, 0x36, 0xA0, 0x0D, 0xA1, 0x91, 0x64, 0x89, 0x21,
3866 0x73, 0xC8, 0x8D, 0x08, 0x0F, 0x12, 0xED, 0x85, 0x81, 0xAE,
3867 0xA1, 0xB8, 0x8B, 0xBF, 0x12, 0xDA, 0x30, 0xBB, 0x68, 0xA7,
3868 0xFA, 0xB7, 0xA8, 0x68, 0xC5, 0x97, 0xA2, 0xAD, 0x02, 0x01,
3869 0xE8, 0x11, 0x16, 0x51, 0xF9, 0x3A, 0x39, 0xE4, 0x56, 0x43,
3870 0x5D, 0xC9, 0xA7, 0x01, 0xB2, 0x14, 0x78, 0x85, 0x0B, 0x75,
3871 0x1D, 0x9A, 0x68, 0x0A, 0x9C, 0x77, 0x4A, 0xC0, 0xDD, 0xE4,
3872 0xB4, 0xDE, 0x46, 0x41, 0x8E, 0x00, 0x91, 0xF4, 0xC6, 0xDA,
3873 0xB9, 0xA1, 0x15, 0x64, 0xBC, 0x5A, 0x57, 0x82, 0xDA, 0xF3,
3874 0xB8, 0xEE, 0xDE, 0x69, 0x25, 0x30, 0x84, 0xE8, 0xFF, 0x5E,
3875 0xF2, 0x26, 0xF0, 0x41, 0x02, 0xE9, 0xAA, 0xA7, 0xA1, 0xA8,
3876 0x88, 0x6A, 0xC8, 0x6D, 0x06, 0x3E, 0x86, 0x6B, 0xA9, 0x39,
3877 0x28, 0x40, 0x55, 0xE4, 0xA9, 0x11, 0xDF, 0xE5, 0xB9, 0x98,
3878 0x2D, 0xF2, 0x36, 0x5E, 0xAC, 0x58, 0x54, 0x3A, 0x7C, 0xEA,
3879 0x77, 0x97, 0x00, 0x66, 0xD2, 0x9B, 0x53, 0x73, 0x4C, 0xC1,
3880 0x1F, 0xAC, 0xEE, 0x90, 0x6B, 0xC8, 0xE0, 0xBC, 0x9E, 0x7C,
3881 0xC1, 0x88, 0x1C, 0x90, 0x12, 0x55, 0xE5, 0x17, 0x14, 0xC0,
3882 0xBF, 0x2C, 0x31, 0xCC, 0x74, 0xEF, 0x50, 0xF3, 0xAA, 0xE4,
3883 0x91, 0x15, 0xE6, 0x68, 0x2A, 0x86, 0xE4, 0x39, 0x73, 0x11,
3884 0x93, 0x46, 0x41, 0x22, 0x4B, 0xDB, 0xA7, 0x84, 0x91, 0x6F,
3885 0x68, 0x8C, 0x05, 0x08, 0x69, 0xE3, 0x4F, 0x95, 0x5F, 0x3A,
3886 0x1A, 0xDA, 0x34, 0x4C, 0x44, 0x75, 0x1B, 0x5C, 0x09, 0xEB,
3887 0x2B, 0x6E, 0x9F, 0x18, 0x18, 0x2C, 0x3C, 0x87, 0x7C, 0xA8,
3888 0xEA, 0x7F, 0x4A, 0xB9, 0xB6, 0x6E, 0x67, 0x49, 0xCA, 0xA1,
3889 0x00, 0x77, 0xA6, 0x33, 0xE5, 0x2C, 0xC6, 0xED, 0x66, 0xF4,
3890 0x4E, 0xF4, 0x1F, 0xEB, 0xFD, 0x62, 0x5C, 0xAF, 0x10, 0x3D,
3891 0x8E, 0x2B, 0xAE, 0xF9, 0x46, 0xB6, 0xF6, 0x98, 0x35, 0x77,
3892 0xD0, 0x9C, 0x0A, 0xA9, 0x2C, 0xD7, 0x6F, 0x46, 0x42, 0x45,
3893 0x8B, 0xDF, 0xF7, 0x0A, 0x2C, 0xE6, 0x41, 0xC3, 0xEA, 0xAC,
3894 0x06, 0x30, 0xDA, 0xC9, 0xE7, 0x22, 0x29, 0x0B, 0x2C, 0x70,
3895 0x49, 0x5B, 0x05, 0x29, 0x48, 0x14, 0x32, 0xE6, 0x75, 0x6E,
3896 0x81, 0x35, 0xE4, 0xA0, 0xE2, 0x4C, 0x1E, 0x53, 0xB7, 0x36,
3897 0x19, 0xC1, 0xEF, 0x44, 0xE1, 0x2A, 0x49, 0xC8, 0x0B, 0xC0,
3898 0x43, 0xF6, 0x77, 0x54, 0xD6, 0x80, 0xE0, 0xE5, 0x23, 0x64,
3899 0x4A, 0xF0, 0x18, 0xBF, 0x91, 0x14, 0x71, 0x9A, 0x03, 0x77,
3900 0xF5, 0x52, 0x4E, 0xA0, 0xDC, 0xAB, 0x64, 0x7C, 0xD0, 0xE5,
3901 0x1D, 0x92, 0x4A, 0xDB, 0xE8, 0xD3, 0xF4, 0x01, 0xE0, 0xE6,
3902 0x1B, 0x77, 0x8D, 0x6B, 0x8F, 0xD2, 0x93, 0x0A, 0xE3, 0x5D,
3903 0x60, 0x1C, 0x19, 0xD5, 0xA8, 0x9B, 0xDE, 0x0F, 0x2C, 0xB2,
3904 0xF5, 0x2B, 0x3C, 0x1E, 0x50, 0x42, 0xB4, 0x54, 0xC9, 0x28,
3905 0xE4, 0x2F, 0x3D, 0xD0, 0x6B, 0x24, 0x13, 0x1B, 0xED, 0x85,
3906 0xA2, 0x0C, 0x95, 0x50, 0xD8, 0x5F, 0x73, 0x96, 0xA1, 0x64,
3907 0xEF, 0xA6, 0xE8, 0x65, 0x55, 0xF8, 0xA4, 0xF9, 0x54, 0x24,
3908 0x76, 0x05, 0xD7, 0xE5, 0x35, 0x98, 0xCD, 0x34, 0xE1, 0xF0,
3909 0x36, 0x27, 0x8C, 0x16, 0x1B, 0xB6, 0xE2, 0x73, 0xDA, 0x57,
3910 0xDD, 0x11, 0xE1, 0x15, 0x46, 0xD1, 0xC7, 0xA3, 0x2C, 0x9D,
3911 0xE2, 0xE5, 0xED, 0xAA, 0xB5, 0x70, 0xC5, 0xDD, 0x99, 0x77,
3912 0x0E, 0x50, 0x28, 0xF2, 0xBD, 0xF1, 0xEB, 0x16, 0xAA, 0xB4,
3913 0x99, 0xE8, 0x42, 0xAE, 0x81, 0x96, 0x99, 0x40, 0x0E, 0xF1,
3914 0x30, 0xA8, 0x5C, 0x65, 0x2C, 0x75, 0x21, 0xCA, 0xCC, 0x0E,
3915 0x95, 0x61, 0x04, 0x04, 0xD4, 0x43, 0x11, 0x7D, 0x8E, 0x21,
3916 0x84, 0x7A, 0x5B, 0xF7, 0x1D, 0xEA, 0xB6, 0xC8, 0x54, 0x02,
3917 0xE8, 0x95, 0x26, 0xC3, 0x51, 0xC2, 0x65, 0x14, 0xAB, 0xA9,
3918 0xBF, 0x43, 0x7E, 0x0E, 0x57, 0x68, 0xFC, 0x4D, 0xDA, 0x08,
3919 0xD4, 0x73, 0x38, 0x7C, 0x0A, 0xF4, 0x92, 0xA4, 0xD4, 0x6D,
3920 0x8D, 0xB8, 0xB7, 0xE8, 0xD2, 0x7D, 0x35, 0x4E, 0x44, 0xE2,
3921 0x84, 0xE0, 0xF0, 0x3D, 0xD0, 0x31, 0xB8, 0xED, 0xD4, 0x75,
3922 0x8C, 0x98, 0xED, 0x30, 0xBE, 0xD4, 0xDB, 0xA6, 0x02, 0x2C,
3923 0xEB, 0x9E, 0x6B, 0x83, 0xBE, 0x71, 0x25, 0x9A, 0x8C, 0xDC,
3924 0x5F, 0x86, 0x09, 0x33, 0x74, 0x32, 0x25, 0xD8, 0xA3, 0x29,
3925 0x21, 0x6A, 0xE6, 0x68, 0xDD, 0x82, 0x96, 0x87, 0x62, 0xE6,
3926 0x83, 0xFB, 0x85, 0xD9, 0x00, 0xC8, 0x32, 0x8B, 0xA8, 0x33,
3927 0x86, 0x2C, 0xE0, 0xDF, 0x1F, 0x76, 0x7D, 0x5C, 0xB1, 0x92,
3928 0xE3, 0x84, 0xDB, 0x73, 0xEC, 0x3D, 0x49, 0xEB, 0xD8, 0x62,
3929 0x4A, 0xEE, 0x2D, 0xA1, 0x13, 0xCA, 0x65, 0x7E, 0xBA, 0xAD,
3930 0x61, 0xEE, 0xA2, 0x8E, 0x23, 0x6E, 0xA7, 0x97, 0x75, 0x93,
3931 0x62, 0xBF, 0x40, 0x3E, 0x01, 0xE8, 0xE7, 0x40, 0x19, 0xEC,
3932 0x3F, 0xD2, 0xCE, 0x16, 0x5C, 0xB3, 0x08, 0x29, 0x48, 0xCE,
3933 0x42, 0x81, 0x59, 0x7A, 0x67, 0xB2, 0x03, 0xEB, 0xBC, 0x1E,
3934 0x45, 0x64, 0x8B, 0xED, 0xD0, 0xA5, 0x5C, 0x2D, 0xEA, 0xEA,
3935 0xB5, 0x2A, 0xF2, 0x39, 0x1A, 0x2C, 0xB4, 0x35, 0x4E, 0xC2,
3936 0xBB, 0x98, 0x66, 0x12, 0x8A, 0xC1, 0xE1, 0x26, 0xFE, 0x3C,
3937 0x48, 0x1E, 0x40, 0xE3, 0x58, 0x39, 0xFD, 0x33, 0x1B, 0xE9,
3938 0x91, 0x70, 0x60, 0xD0, 0x22, 0xD0, 0xD6, 0x7D, 0x20, 0x59,
3939 0x08, 0x84, 0x3B, 0x98, 0x99, 0xB5, 0x5C, 0x44, 0x19, 0xE8,
3940 0xA5, 0x99, 0x15, 0x61, 0x98, 0xE2, 0x4E, 0x62, 0x59, 0x97,
3941 0xF9, 0x61, 0x6B, 0xF0, 0x57, 0x89, 0x9F, 0xBD, 0x33, 0xBB,

NetBurner, Inc.
22.205 certs_test.h 1139

3942 0xA9, 0x56, 0xB8, 0x5D, 0x3D, 0x6A, 0x10, 0x35, 0x41, 0xEE,
3943 0x40, 0xAC, 0xF2, 0xAA, 0x34, 0x6A, 0x09, 0xA0, 0x35, 0x83,
3944 0xD2, 0xAB, 0x24, 0xA1, 0x97, 0x70, 0xCE, 0xA1, 0xEE, 0x2F,
3945 0x0D, 0x5D, 0xC9, 0x3E, 0x8B, 0xF6, 0x25, 0xA9, 0xB5, 0xF8,
3946 0x2C, 0xE0, 0x69, 0x43, 0x08, 0x64, 0x19, 0xC5, 0x23, 0x20,
3947 0xEC, 0xD8, 0x04, 0x00, 0xA8, 0x86, 0x61, 0x00, 0x1F, 0x6E,
3948 0x5C, 0x9E, 0xDA, 0x61, 0x68, 0x87, 0x5F, 0xB1, 0x22, 0x49,
3949 0x7B, 0x17, 0x67, 0x7E, 0x51, 0x4A, 0xE1, 0x05, 0x1B, 0x31,
3950 0x39, 0xDD, 0x75, 0x42, 0x4C, 0xE1, 0x10, 0xBB, 0xB8, 0x08,
3951 0xA8, 0x0C, 0x90, 0xC3, 0x59, 0x90, 0xE2, 0x99, 0x83, 0x65,
3952 0xBC, 0x5D, 0xC4, 0x90, 0x87, 0x8B, 0xE4, 0xF3, 0x32, 0x39,
3953 0x9D, 0x46, 0xFF, 0x24, 0x60, 0x1F, 0x32, 0x49, 0xA9, 0x57,
3954 0x97, 0xF7, 0x8C, 0x59, 0x3E, 0x70, 0x09, 0x93, 0x4A, 0x0C,
3955 0xFC, 0x32, 0x51, 0x86, 0x41, 0x65, 0x04, 0x4D, 0xF7, 0x02,
3956 0xB2, 0x6A, 0xB1, 0xAA, 0x18, 0x6B, 0xA2, 0x05, 0xE9, 0xD7,
3957 0x59, 0xC2, 0x93, 0x51, 0x57, 0xC8, 0x42, 0x9A, 0x74, 0xBA,
3958 0x98, 0x51, 0x9E, 0xB9, 0xA7, 0x41, 0x81, 0x71, 0x54, 0x45,
3959 0x51, 0xBE, 0xC5, 0x72, 0x02, 0xEB, 0xA8, 0x97, 0x5B, 0x4E,
3960 0x25, 0xD0, 0x40, 0xD1, 0x45, 0x7D, 0x30, 0xBF, 0x44, 0xBE,
3961 0x1C, 0xE1, 0x4C, 0x9C, 0xDA, 0xA3, 0x54, 0xEC, 0xFF, 0x46,
3962 0x26, 0xE9, 0x97, 0x63, 0x82, 0x4F, 0xA6, 0x9A, 0xA0, 0xF3,
3963 0x89, 0x83, 0x8E, 0x49, 0xAE, 0x21, 0xF4, 0x5C, 0x6E, 0x0D,
3964 0x89, 0x08, 0xCA, 0x34, 0xCC, 0xC2, 0xC3, 0x47, 0x8C, 0xDC,
3965 0xC5, 0x9D, 0xA4, 0xAF, 0xA2, 0x0A, 0x75, 0x3A, 0x72, 0x8A,
3966 0x1D, 0xA0, 0x3A, 0xDA, 0x5B, 0x0F, 0x1A, 0xDC, 0x70, 0x21,
3967 0xC8, 0xE3, 0x3C, 0xD5, 0xCF, 0x48, 0x74, 0x49, 0xF9, 0x6E,
3968 0x8D, 0xD6, 0x9D, 0x8A, 0x9A, 0x32, 0x6B, 0xE0, 0x77, 0xA6,
3969 0x84, 0x54, 0xF5, 0xA3, 0x11, 0x55, 0xB7, 0xA0, 0xA8, 0xF3,
3970 0xBC, 0xED, 0xEC, 0x6F, 0xB8, 0xAF, 0xA3, 0xE4, 0xDC, 0x13,
3971 0xA4, 0x76, 0x63, 0x83, 0x92, 0xC4, 0xC6, 0x22, 0x20, 0x37,
3972 0x58, 0xA3, 0xAC, 0x63, 0x66, 0x88, 0x3B, 0xD8, 0xBA, 0xA4,
3973 0x06, 0x26, 0xBE, 0xA6, 0x23, 0x9E, 0xC0, 0xD1, 0x61, 0x5D,
3974 0xCF, 0x64, 0x34, 0x04, 0x4D, 0x05, 0x9C, 0xD2, 0x03, 0xE8,
3975 0xC8, 0x0B, 0x14, 0xBE, 0x47, 0x45, 0x1E, 0x1B, 0x04, 0x94,
3976 0xDA, 0xAD, 0x72, 0xCA, 0x1B, 0xE2, 0xB3, 0xC5, 0xA1, 0x69,
3977 0x45, 0x07, 0xED, 0x2E, 0xF9, 0x1A, 0xC3, 0x3C, 0xC7, 0xB5,
3978 0x1D, 0xD9, 0x85, 0x27, 0xB8, 0xD4, 0x91, 0x03, 0xD2, 0x35,
3979 0xF3, 0x5F, 0x5D, 0x3F, 0x3E, 0x56, 0x25, 0xBB, 0x37, 0x0C,
3980 0xDC, 0x48, 0x1D, 0xCF, 0x82, 0xFD, 0x24, 0xD0, 0xBF, 0xCA,
3981 0x69, 0x91, 0xC5, 0x8C, 0x7D, 0x7B, 0x78, 0x31, 0xBA, 0xC3,
3982 0x9F, 0x7C, 0x6E, 0x7D, 0x39, 0xF3, 0xEE, 0x46, 0x9C, 0x81,
3983 0xE5, 0xAA, 0xA8, 0xD7, 0x02, 0x17, 0x27, 0x94, 0xF8, 0xF1,
3984 0x54, 0x0A, 0xA2, 0x47, 0x3C, 0xE7, 0xA6, 0xA5, 0x00, 0x31,
3985 0x81, 0xA1, 0xE3, 0x86, 0xEF, 0x56, 0xE3, 0x36, 0x2C, 0x1F,
3986 0x86, 0xED, 0xD3, 0x6D, 0x05, 0xBA, 0x36, 0xF1, 0xF0, 0x2E,
3987 0x84, 0x9A, 0xFA, 0xA7, 0x09, 0x59, 0x14, 0x2B, 0x0A, 0xFC,
3988 0xC0, 0x16, 0x3E, 0xAA, 0x13, 0xAF, 0x25, 0x02, 0x4A, 0x97,
3989 0xD0, 0xAD, 0x7E, 0x2D, 0xC2, 0x4A, 0xFD, 0x1F, 0x2B, 0x4D,
3990 0x46, 0x60, 0x42, 0xB1, 0xAE, 0x12, 0x32, 0x5E, 0x23, 0x19,
3991 0x47, 0x4B, 0x23, 0x7C, 0x1A, 0xA2, 0xC6, 0x4F, 0x03, 0xBE,
3992 0x47, 0x95, 0x97, 0x86, 0xFF, 0x0E, 0xCC, 0x40, 0xB0, 0xCA,
3993 0x45, 0xE5, 0x14, 0x93, 0xA1, 0xD0, 0xC1, 0x37, 0xEE, 0x1E,
3994 0x13, 0x69, 0xB9, 0x8D, 0xE1, 0x86, 0xCC, 0xDD, 0x0D, 0xC2,
3995 0xED, 0xD3, 0x59, 0x13, 0x9D, 0xB5, 0xD0, 0x50, 0x68, 0x1A,
3996 0xA5, 0xA6
3997 };
3998 static const int sizeof_bench_falcon_level5_key = sizeof(bench_falcon_level5_key);
3999
4000 #endif /* HAVE_PQC */
4001
4002 #ifdef HAVE_PQC
4003
4004 /* certs/dilithium/bench_dilithium_level2_key.der */
4005 static const unsigned char bench_dilithium_level2_key[] =
4006 {
4007 0x30, 0x82, 0x0F, 0x1A, 0x02, 0x01, 0x00, 0x30, 0x0D, 0x06,
4008 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x02, 0x82, 0x0B, 0x07,
4009 0x04, 0x04, 0x04, 0x82, 0x0F, 0x04, 0x04, 0x82, 0x0F, 0x00,
4010 0xA2, 0xBD, 0x74, 0xB9, 0x8E, 0x34, 0xF0, 0xEC, 0xF7, 0x40,
4011 0x22, 0x33, 0xE8, 0x50, 0x43, 0x66, 0xF0, 0x25, 0x41, 0x20,
4012 0xD9, 0x3F, 0x8A, 0xC6, 0xAD, 0x69, 0xC6, 0x9C, 0xD9, 0xE0,
4013 0x0D, 0xFF, 0x77, 0x85, 0xCD, 0x88, 0x58, 0x17, 0x6B, 0x85,
4014 0xD2, 0x5D, 0xF0, 0x41, 0xCE, 0x6D, 0x94, 0x7F, 0xF4, 0xDB,
4015 0xD3, 0x60, 0x52, 0x1A, 0x83, 0x42, 0xD8, 0x7C, 0x2D, 0xD9,
4016 0x55, 0x7B, 0xFB, 0xB8, 0x87, 0xAA, 0xDA, 0x75, 0x42, 0x86,
4017 0x3E, 0x5A, 0xE4, 0xD4, 0x7D, 0xC3, 0x38, 0xA2, 0xEE, 0x0D,
4018 0xF5, 0xAD, 0xDA, 0x12, 0x5B, 0xD6, 0x3A, 0x89, 0x87, 0xED,
4019 0x57, 0xD1, 0xA9, 0xC2, 0xB3, 0xC0, 0xDC, 0x90, 0x88, 0x0C,
4020 0x86, 0x48, 0xD2, 0xA6, 0x60, 0x1B, 0x22, 0x8C, 0x03, 0x34,
4021 0x69, 0x19, 0x96, 0x24, 0x04, 0xB3, 0x65, 0x10, 0x34, 0x31,
4022 0x09, 0x38, 0x31, 0x5C, 0x10, 0x8C, 0x02, 0x15, 0x66, 0xD0,
4023 0x48, 0x50, 0x53, 0x22, 0x41, 0xC4, 0x98, 0x41, 0xE2, 0x42,
4024 0x62, 0x42, 0x38, 0x45, 0xC2, 0xB8, 0x08, 0x20, 0x31, 0x21,
4025 0x13, 0x10, 0x88, 0x00, 0xB9, 0x24, 0x93, 0x06, 0x6D, 0x44,
4026 0x20, 0x64, 0x98, 0x84, 0x29, 0x91, 0x12, 0x6A, 0xC9, 0x14,
4027 0x10, 0x11, 0x40, 0x2A, 0x24, 0xC9, 0x85, 0xCC, 0x42, 0x2A,
4028 0x1C, 0x44, 0x28, 0xE0, 0xB4, 0x00, 0x20, 0x99, 0x11, 0x0B,

NetBurner, Inc.
1140 File Documentation

4029 0x09, 0x61, 0x24, 0x14, 0x10, 0x41, 0x94, 0x20, 0xC9, 0x46,
4030 0x64, 0x43, 0x02, 0x6E, 0x08, 0x39, 0x71, 0x81, 0x06, 0x2D,
4031 0x63, 0x14, 0x71, 0x62, 0xC0, 0x11, 0x20, 0xB2, 0x61, 0xD1,
4032 0x30, 0x24, 0x44, 0x06, 0x89, 0x04, 0x16, 0x88, 0x10, 0x33,
4033 0x48, 0x51, 0xB8, 0x00, 0x4A, 0x12, 0x68, 0x14, 0x04, 0x10,
4034 0xD8, 0x92, 0x8D, 0x22, 0x32, 0x61, 0x0C, 0x23, 0x91, 0x10,
4035 0x39, 0x24, 0x51, 0x80, 0x08, 0x0B, 0x30, 0x61, 0x00, 0x89,
4036 0x01, 0x98, 0x34, 0x05, 0x9A, 0xA2, 0x70, 0xC4, 0x46, 0x40,
4037 0x52, 0x38, 0x42, 0xC0, 0x92, 0x6D, 0xCC, 0x08, 0x22, 0xD4,
4038 0x42, 0x4A, 0x02, 0x23, 0x40, 0x40, 0x92, 0x25, 0x12, 0x36,
4039 0x65, 0x42, 0x06, 0x10, 0x02, 0x10, 0x10, 0x20, 0xA3, 0x41,
4040 0x0A, 0x15, 0x10, 0x20, 0x23, 0x80, 0x99, 0xB6, 0x0C, 0x11,
4041 0x26, 0x11, 0x9B, 0xC8, 0x44, 0x1C, 0xC9, 0x05, 0xA4, 0x38,
4042 0x11, 0x1B, 0xB0, 0x05, 0xDC, 0x22, 0x00, 0xC8, 0x22, 0x72,
4043 0xA3, 0x30, 0x2E, 0xC1, 0xA8, 0x41, 0x1C, 0xA6, 0x20, 0xE2,
4044 0xB0, 0x21, 0x9B, 0x10, 0x01, 0x61, 0x32, 0x46, 0xC1, 0x92,
4045 0x61, 0x1C, 0xA4, 0x85, 0x0A, 0xB7, 0x70, 0xE4, 0x26, 0x6C,
4046 0x58, 0xA4, 0x00, 0x19, 0x86, 0x4C, 0xDC, 0xA6, 0x40, 0xA1,
4047 0x32, 0x12, 0x04, 0x81, 0x90, 0x8C, 0x04, 0x05, 0x10, 0x30,
4048 0x26, 0x09, 0x31, 0x2C, 0x50, 0x88, 0x89, 0x82, 0x44, 0x62,
4049 0x10, 0x23, 0x8A, 0x04, 0x44, 0x22, 0x0A, 0x30, 0x4E, 0xA4,
4050 0x34, 0x32, 0x4C, 0x18, 0x8C, 0x21, 0x21, 0x41, 0x23, 0x13,
4051 0x72, 0x08, 0x84, 0x24, 0x1A, 0x04, 0x24, 0x14, 0x06, 0x02,
4052 0xC4, 0x40, 0x70, 0xCA, 0x00, 0x6E, 0xC1, 0xC6, 0x09, 0x83,
4053 0x42, 0x62, 0xA0, 0x30, 0x12, 0x1B, 0x14, 0x0C, 0x08, 0x03,
4054 0x22, 0xCA, 0x46, 0x65, 0x64, 0x46, 0x26, 0x10, 0x39, 0x20,
4055 0xCA, 0x80, 0x28, 0x62, 0x14, 0x6D, 0x10, 0x26, 0x11, 0x49,
4056 0xA2, 0x45, 0x53, 0x98, 0x0D, 0x64, 0x40, 0x05, 0x0C, 0x31,
4057 0x09, 0x13, 0x11, 0x60, 0xD8, 0x02, 0x50, 0x11, 0x41, 0x41,
4058 0x23, 0xC1, 0x4C, 0x22, 0xC6, 0x30, 0x99, 0x06, 0x08, 0xCA,
4059 0x40, 0x81, 0xCC, 0x32, 0x0E, 0x11, 0xC4, 0x20, 0xD9, 0x92,
4060 0x41, 0xC4, 0x20, 0x08, 0xE4, 0xA0, 0x00, 0xCB, 0x88, 0x21,
4061 0x03, 0x03, 0x90, 0x54, 0x00, 0x49, 0x14, 0x98, 0x04, 0xC8,
4062 0xC0, 0x31, 0x11, 0x31, 0x69, 0x04, 0x93, 0x90, 0x00, 0xB9,
4063 0x21, 0x22, 0x38, 0x48, 0x00, 0x34, 0x0C, 0x61, 0x98, 0x00,
4064 0x01, 0xB4, 0x69, 0x60, 0x26, 0x81, 0x1C, 0xA4, 0x10, 0x22,
4065 0xB6, 0x10, 0x21, 0xC6, 0x20, 0x4A, 0x22, 0x26, 0xD0, 0x92,
4066 0x41, 0xDA, 0x84, 0x69, 0x03, 0x42, 0x2A, 0x04, 0x09, 0x02,
4067 0xE1, 0x24, 0x42, 0xA2, 0x46, 0x28, 0x10, 0xB1, 0x08, 0x82,
4068 0x86, 0x84, 0xE0, 0x24, 0x51, 0x0A, 0xC9, 0x28, 0x59, 0x86,
4069 0x20, 0xDB, 0xB6, 0x40, 0x13, 0xC3, 0x40, 0x1C, 0xA9, 0x09,
4070 0x80, 0x34, 0x50, 0xDC, 0x84, 0x2C, 0x53, 0x24, 0x08, 0xC0,
4071 0xB4, 0x6D, 0x88, 0x26, 0x30, 0x82, 0xC8, 0x0D, 0x62, 0x22,
4072 0x28, 0x64, 0xA2, 0x09, 0x10, 0x25, 0x26, 0xDB, 0x34, 0x02,
4073 0x4A, 0x04, 0x11, 0x53, 0xB8, 0x28, 0x82, 0x34, 0x11, 0xC2,
4074 0x12, 0x25, 0x20, 0xB5, 0x40, 0x19, 0xA8, 0x31, 0x80, 0x22,
4075 0x66, 0x21, 0xB2, 0x10, 0x0B, 0x42, 0x2A, 0x61, 0x20, 0x50,
4076 0x40, 0x24, 0x4C, 0x99, 0x12, 0x48, 0x21, 0xB4, 0x11, 0xD1,
4077 0x44, 0x48, 0x00, 0x40, 0x0C, 0x58, 0x46, 0x68, 0x04, 0x12,
4078 0x12, 0x93, 0x22, 0x20, 0xC2, 0x32, 0x4C, 0x01, 0xB0, 0x88,
4079 0xE3, 0x20, 0x8E, 0x03, 0x00, 0x6C, 0x52, 0x14, 0x30, 0xD2,
4080 0x44, 0x88, 0x10, 0x44, 0x4A, 0x61, 0x86, 0x29, 0x14, 0x42,
4081 0x24, 0x24, 0x35, 0x2E, 0x11, 0xC4, 0x0D, 0x23, 0x24, 0x66,
4082 0x0A, 0x90, 0x71, 0xE0, 0xC2, 0x69, 0x48, 0x38, 0x91, 0x82,
4083 0xC8, 0x08, 0x1C, 0x93, 0x31, 0xD9, 0x06, 0x51, 0x8A, 0xA4,
4084 0x6C, 0x50, 0x34, 0x68, 0x5A, 0x18, 0x89, 0x4A, 0x96, 0x85,
4085 0x8A, 0x18, 0x44, 0x4A, 0x34, 0x40, 0x5B, 0x36, 0x80, 0xCC,
4086 0x20, 0x6E, 0x09, 0x19, 0x89, 0x02, 0x38, 0x6A, 0x24, 0xA3,
4087 0x69, 0x58, 0x32, 0x6D, 0x21, 0x01, 0x84, 0x88, 0x86, 0x28,
4088 0xA3, 0x22, 0x89, 0x93, 0xA6, 0x80, 0x00, 0x88, 0x81, 0xE1,
4089 0x48, 0x70, 0xA2, 0x34, 0x60, 0x18, 0x02, 0x04, 0x18, 0x29,
4090 0x01, 0x1B, 0x31, 0x51, 0xD4, 0xA4, 0x49, 0xCC, 0x08, 0x8C,
4091 0xDA, 0x36, 0x11, 0x01, 0x39, 0x26, 0x42, 0x92, 0x88, 0xC8,
4092 0x46, 0x52, 0x8C, 0xA4, 0x08, 0x14, 0x11, 0x52, 0xCA, 0x40,
4093 0x66, 0x8B, 0x32, 0x8E, 0x89, 0x44, 0x02, 0x9B, 0x42, 0x02,
4094 0x93, 0xA4, 0x01, 0x1A, 0x00, 0x50, 0x94, 0x44, 0x42, 0x08,
4095 0x09, 0x8C, 0xE2, 0xA8, 0x81, 0x98, 0x00, 0x48, 0x63, 0x02,
4096 0x85, 0x1B, 0x05, 0x2D, 0xC1, 0xBE, 0x5F, 0xA4, 0xAC, 0xB4,
4097 0xF0, 0xC7, 0x94, 0xBD, 0xEC, 0xFB, 0x09, 0xAF, 0x16, 0xF1,
4098 0x23, 0x58, 0xAB, 0x82, 0xFA, 0x74, 0xD1, 0x84, 0x51, 0xD0,
4099 0x58, 0x9B, 0xFA, 0xF4, 0x11, 0xC1, 0x17, 0x2F, 0xCE, 0xD1,
4100 0xCA, 0xC6, 0xCE, 0x1C, 0x8F, 0x8F, 0x1B, 0x43, 0xBF, 0xB9,
4101 0x43, 0x41, 0x02, 0x3E, 0x5D, 0xFA, 0x24, 0x88, 0x0E, 0xA5,
4102 0x36, 0xA9, 0x9B, 0x25, 0x43, 0xD6, 0xEE, 0xDE, 0xAE, 0x93,
4103 0x54, 0xC8, 0x6C, 0x55, 0xE9, 0x5C, 0xC8, 0xC1, 0xA5, 0xD7,
4104 0xFC, 0xDA, 0xAF, 0xF8, 0x40, 0x1F, 0x02, 0x5C, 0x8E, 0x48,
4105 0x51, 0x4B, 0x3F, 0xFD, 0x76, 0x9A, 0xD0, 0x87, 0xF4, 0xD0,
4106 0x68, 0x9C, 0x44, 0x3B, 0xB4, 0x4A, 0xAB, 0x34, 0x2A, 0xD4,
4107 0x0C, 0xA4, 0x7A, 0xBB, 0x98, 0x7F, 0x8D, 0xF6, 0xA7, 0x6A,
4108 0x42, 0x8C, 0x7A, 0xB4, 0x32, 0xC6, 0x8A, 0xD6, 0x5E, 0x06,
4109 0x50, 0xC0, 0xDD, 0x3E, 0xE2, 0x44, 0x5C, 0xB9, 0x83, 0xCF,
4110 0x92, 0x0C, 0x3C, 0xFB, 0x53, 0x0D, 0xF0, 0xD1, 0xED, 0x77,
4111 0xF3, 0x02, 0x9F, 0xA6, 0xC6, 0xFA, 0x30, 0xA5, 0xC7, 0x42,
4112 0x06, 0x1F, 0x38, 0xE5, 0xE1, 0x56, 0x01, 0x7A, 0xD1, 0xE1,
4113 0xC1, 0x20, 0x44, 0x37, 0xE6, 0x18, 0x8A, 0x7E, 0x70, 0xBA,
4114 0x6B, 0x1C, 0x99, 0x4E, 0xFB, 0xCA, 0xCF, 0x3D, 0x29, 0x26,
4115 0xF4, 0x12, 0x95, 0x74, 0x11, 0x23, 0x0E, 0x2E, 0x31, 0xCF,

NetBurner, Inc.
22.205 certs_test.h 1141

4116 0x73, 0xE6, 0x99, 0xD0, 0x72, 0x23, 0x4A, 0x46, 0x07, 0xA1,
4117 0x03, 0x4C, 0x3A, 0x79, 0x72, 0x3B, 0xD1, 0x79, 0x5A, 0x66,
4118 0x29, 0xCD, 0x34, 0xB6, 0x6A, 0xA5, 0x6A, 0x4C, 0x71, 0xE5,
4119 0xB3, 0xA6, 0xAC, 0x4D, 0x13, 0xDC, 0x70, 0xE4, 0x0C, 0x6A,
4120 0x98, 0x48, 0x1C, 0xA0, 0x6C, 0xFC, 0xDD, 0x6A, 0x3F, 0x10,
4121 0x3B, 0xBD, 0xC9, 0xC8, 0xEA, 0x01, 0x86, 0x5B, 0x3B, 0x19,
4122 0x3E, 0x6F, 0xA9, 0x4A, 0xD4, 0x38, 0x1D, 0x9C, 0x2B, 0x19,
4123 0xAE, 0x47, 0x54, 0xE2, 0x4E, 0xB5, 0xDF, 0xA7, 0xBD, 0x6F,
4124 0x01, 0x8A, 0x10, 0x5B, 0x83, 0x17, 0xB3, 0x77, 0xE1, 0x9D,
4125 0xBF, 0x6B, 0x25, 0xBF, 0x90, 0xC4, 0x92, 0xE1, 0x5E, 0xE1,
4126 0xC3, 0x0C, 0xC5, 0x05, 0x24, 0x40, 0x61, 0xA1, 0x01, 0x4A,
4127 0x7B, 0xE4, 0x65, 0x73, 0x1F, 0x3C, 0xA2, 0xD8, 0x54, 0xA4,
4128 0x64, 0xA3, 0x06, 0xDA, 0x18, 0x9A, 0xD7, 0xE4, 0x90, 0x59,
4129 0xAF, 0xBC, 0x1A, 0x79, 0xC4, 0x08, 0xE9, 0x87, 0x95, 0x04,
4130 0x48, 0x18, 0xD2, 0x33, 0x15, 0x38, 0x9C, 0x00, 0x7B, 0x72,
4131 0x35, 0xC1, 0x03, 0x77, 0xF1, 0x0B, 0xEC, 0x38, 0x33, 0xB7,
4132 0xB4, 0xBC, 0xC4, 0xBD, 0xB3, 0xBB, 0x9C, 0x34, 0x0B, 0x28,
4133 0x03, 0x1D, 0x99, 0x7A, 0x12, 0x0C, 0x95, 0xFE, 0x0D, 0x53,
4134 0x79, 0xE7, 0xE6, 0x99, 0x3F, 0xA1, 0x31, 0x9E, 0xA9, 0xB8,
4135 0x9B, 0xB7, 0xC0, 0x3F, 0x9C, 0x18, 0x1B, 0xA2, 0x73, 0xBC,
4136 0x10, 0xDB, 0x1B, 0x09, 0xE7, 0x5E, 0x67, 0x8E, 0x69, 0x92,
4137 0xCF, 0x99, 0xC3, 0x97, 0x58, 0xE8, 0x9A, 0x40, 0x83, 0xF2,
4138 0x14, 0xA3, 0x25, 0xB5, 0x51, 0x30, 0xDA, 0x91, 0x87, 0x91,
4139 0x1E, 0xF2, 0x5E, 0x55, 0x49, 0x68, 0x5E, 0xC9, 0x21, 0x67,
4140 0x03, 0xBC, 0x21, 0xE4, 0xD1, 0xFC, 0x79, 0xC7, 0xDB, 0x44,
4141 0xB9, 0xAB, 0x1E, 0xB4, 0x65, 0x3D, 0x63, 0xCB, 0x64, 0x76,
4142 0xE4, 0x1B, 0x93, 0x91, 0xB0, 0xF3, 0x4F, 0xBA, 0xD3, 0x20,
4143 0x47, 0x37, 0x5A, 0xCA, 0x1B, 0xDB, 0xCA, 0xA1, 0xE7, 0xED,
4144 0x7D, 0x8D, 0x4E, 0x7C, 0x19, 0xB2, 0x73, 0x67, 0x55, 0x11,
4145 0xE4, 0xA1, 0x98, 0x44, 0x5F, 0x58, 0xF7, 0xAA, 0x09, 0xFD,
4146 0x09, 0x4A, 0x54, 0x68, 0x32, 0xD4, 0xCA, 0xE1, 0x96, 0xFD,
4147 0x27, 0x05, 0x88, 0x78, 0x7B, 0x83, 0x74, 0x78, 0x6F, 0x09,
4148 0xC7, 0x3C, 0x66, 0xA8, 0x17, 0x3A, 0xCF, 0xB3, 0x6E, 0x5A,
4149 0xD7, 0x16, 0xE5, 0x2E, 0x40, 0xD7, 0x30, 0x18, 0x47, 0x5F,
4150 0x95, 0x19, 0x4E, 0x0F, 0x69, 0xD3, 0x11, 0xDE, 0xBB, 0x55,
4151 0x1B, 0xD1, 0x13, 0x71, 0x3D, 0x45, 0x3E, 0xDC, 0x72, 0x4F,
4152 0x89, 0x34, 0x72, 0x96, 0x77, 0xBB, 0x42, 0x29, 0x4A, 0x88,
4153 0x44, 0xFB, 0x05, 0x57, 0x38, 0xA6, 0xAC, 0x3E, 0x03, 0xF6,
4154 0xE1, 0x9D, 0xE3, 0xE9, 0x5A, 0x1B, 0x64, 0xCE, 0xC8, 0x6E,
4155 0x1B, 0xE8, 0xE3, 0x78, 0xF8, 0xE9, 0xF1, 0x47, 0x09, 0x0E,
4156 0x66, 0x50, 0x7A, 0x10, 0x51, 0xE1, 0x60, 0x73, 0x78, 0x95,
4157 0x00, 0x2E, 0xB8, 0x05, 0x8C, 0x22, 0x72, 0xD9, 0x88, 0xC8,
4158 0x8D, 0x16, 0xEF, 0x18, 0x8F, 0xC6, 0x51, 0x1E, 0xC3, 0xBA,
4159 0x27, 0x57, 0xB4, 0xFE, 0x74, 0x0F, 0x54, 0x45, 0x5A, 0x0B,
4160 0xAC, 0x6C, 0xA7, 0x46, 0x95, 0xC7, 0x35, 0x3D, 0x38, 0xBE,
4161 0xC5, 0x4E, 0xE0, 0x83, 0xED, 0x68, 0x8D, 0x01, 0x31, 0x7D,
4162 0x90, 0xA7, 0x38, 0xEE, 0x57, 0x8E, 0xD2, 0xFB, 0x87, 0x08,
4163 0x7A, 0x44, 0x34, 0x0B, 0x99, 0x5E, 0x2F, 0xA8, 0x4E, 0xC0,
4164 0x80, 0xEF, 0x62, 0xFE, 0xFB, 0x3C, 0x73, 0xF1, 0x8C, 0x56,
4165 0x12, 0x08, 0x8C, 0xD3, 0x9F, 0xBA, 0x44, 0x90, 0xB7, 0xDB,
4166 0x9C, 0xD9, 0xB4, 0x91, 0xBA, 0xFF, 0x4A, 0xB0, 0x1C, 0x91,
4167 0x44, 0x34, 0x52, 0xBE, 0x0D, 0xBA, 0x72, 0x33, 0x5C, 0x36,
4168 0xB5, 0x5E, 0x91, 0xB7, 0xE9, 0xCE, 0xD0, 0x01, 0x61, 0x19,
4169 0xEE, 0x2D, 0x1F, 0xBE, 0x97, 0x7C, 0x8C, 0x30, 0x91, 0x8C,
4170 0xB1, 0x8A, 0x04, 0xCA, 0xB8, 0x33, 0xCB, 0xA9, 0x9A, 0x2C,
4171 0x1B, 0x25, 0xD2, 0xDB, 0x73, 0x95, 0x3F, 0x02, 0x67, 0xEB,
4172 0x2C, 0xEC, 0xCC, 0x92, 0xCD, 0x1E, 0x1F, 0xC2, 0xF2, 0xA7,
4173 0x23, 0xAD, 0x7C, 0xA5, 0x50, 0x44, 0x76, 0x7D, 0x74, 0x13,
4174 0x20, 0x21, 0xF2, 0x09, 0xD9, 0x70, 0x82, 0xB0, 0x30, 0xA3,
4175 0x8A, 0xC0, 0x9D, 0xD2, 0x16, 0x4F, 0x65, 0xDF, 0x42, 0x37,
4176 0xC2, 0x63, 0xD6, 0x6C, 0xA9, 0xD1, 0x95, 0x5D, 0x84, 0xD2,
4177 0xB5, 0xC7, 0x7A, 0x87, 0x9B, 0x9B, 0xAF, 0x21, 0x65, 0x64,
4178 0xF7, 0x0B, 0x21, 0xC7, 0xF6, 0xA5, 0x27, 0xEB, 0xAA, 0x8D,
4179 0xF2, 0x10, 0x60, 0xFB, 0xC9, 0xB3, 0xB0, 0x32, 0x7C, 0x9F,
4180 0xC1, 0xDE, 0xA8, 0x77, 0x6F, 0xCC, 0x35, 0x1F, 0xBD, 0x74,
4181 0x0E, 0xA9, 0x84, 0x3C, 0x05, 0x9D, 0xFF, 0xBC, 0x46, 0x9A,
4182 0x8E, 0x43, 0xB5, 0x8B, 0x1C, 0x24, 0xB5, 0xC3, 0xB0, 0xFE,
4183 0x14, 0xCC, 0x3C, 0xCF, 0xF2, 0x26, 0xCE, 0x0B, 0x3A, 0x5B,
4184 0x5C, 0x8E, 0x59, 0xBF, 0x0D, 0xDC, 0xA6, 0xCA, 0x78, 0xE5,
4185 0xD9, 0xC5, 0x46, 0x56, 0x38, 0x98, 0xC4, 0xAC, 0x43, 0x64,
4186 0xB1, 0x78, 0x0A, 0x81, 0x34, 0x7D, 0x3D, 0xC0, 0xF5, 0x25,
4187 0x14, 0x66, 0xA2, 0x2A, 0x81, 0x64, 0x82, 0x62, 0x86, 0xD0,
4188 0x65, 0xCB, 0x2A, 0x09, 0x01, 0xF5, 0x03, 0xEC, 0xB5, 0xD1,
4189 0xED, 0xC7, 0x60, 0x62, 0x3D, 0x38, 0x28, 0x9C, 0x32, 0xEE,
4190 0x9F, 0x45, 0x72, 0x71, 0xA9, 0x6D, 0x9A, 0x54, 0x83, 0xF9,
4191 0xE7, 0x37, 0xC7, 0xCC, 0x28, 0xC0, 0xC2, 0x24, 0x09, 0xC3,
4192 0x96, 0xF6, 0xED, 0x9B, 0x60, 0xF3, 0x24, 0x4C, 0xFC, 0xAB,
4193 0xD0, 0x38, 0x7A, 0x1C, 0x68, 0xED, 0x63, 0x83, 0x5A, 0x28,
4194 0x37, 0x70, 0x31, 0xBB, 0x9D, 0xC7, 0xAA, 0x3A, 0x5B, 0xAF,
4195 0x88, 0x82, 0xE2, 0x30, 0xCB, 0xF5, 0xC1, 0x63, 0x9C, 0x59,
4196 0x41, 0xD3, 0x24, 0x92, 0xB1, 0x71, 0xA4, 0x16, 0x26, 0x0B,
4197 0x9C, 0x96, 0x0B, 0xE9, 0x0B, 0x69, 0xFC, 0x1F, 0xD2, 0x99,
4198 0xC2, 0xB6, 0x7A, 0x24, 0x28, 0x5A, 0x3D, 0x88, 0x2C, 0xF0,
4199 0x76, 0xFC, 0x25, 0x04, 0xBE, 0xB6, 0x19, 0x94, 0xD1, 0xBA,
4200 0x1A, 0x58, 0x0E, 0x9A, 0xFB, 0x4C, 0x9D, 0x21, 0x34, 0x8D,
4201 0x45, 0xEC, 0x50, 0xC6, 0x94, 0x1B, 0x0B, 0x87, 0x36, 0x4E,
4202 0xE4, 0x96, 0xF6, 0x9A, 0x34, 0xEC, 0xD8, 0x65, 0x6A, 0x46,

NetBurner, Inc.
1142 File Documentation

4203 0xFA, 0xC5, 0x40, 0x35, 0xD0, 0x07, 0x74, 0x02, 0xA3, 0xCF,
4204 0x23, 0x60, 0x15, 0xAC, 0x54, 0x98, 0x59, 0xEF, 0x94, 0x17,
4205 0x0A, 0xEF, 0xBB, 0xC2, 0x7B, 0x3B, 0xEF, 0xF5, 0xD1, 0x9C,
4206 0xB7, 0xB1, 0xDF, 0x45, 0xF5, 0x57, 0xD1, 0x18, 0x05, 0x97,
4207 0x8F, 0x8C, 0x30, 0x8C, 0x11, 0xF4, 0x81, 0x4D, 0x75, 0x18,
4208 0x97, 0x9F, 0x30, 0x64, 0xE2, 0x5B, 0x18, 0x95, 0xAC, 0x4E,
4209 0xDC, 0x47, 0xB5, 0x45, 0xAA, 0xD4, 0x7E, 0xF4, 0x70, 0x46,
4210 0x34, 0xF3, 0xB3, 0x85, 0xC2, 0x46, 0x98, 0xB5, 0xB5, 0x33,
4211 0x52, 0xF4, 0x36, 0x39, 0xCA, 0x23, 0xF9, 0x66, 0xB9, 0xA4,
4212 0x63, 0xC6, 0x3D, 0x02, 0xE7, 0x8F, 0x95, 0xF3, 0x25, 0xFD,
4213 0x21, 0xD0, 0x62, 0xC2, 0xEE, 0xE2, 0x2F, 0x69, 0x55, 0x31,
4214 0x42, 0x78, 0x2D, 0x53, 0xDC, 0x7F, 0x0E, 0x93, 0xD5, 0x4D,
4215 0x21, 0x64, 0x8B, 0x9E, 0x2C, 0xBE, 0xBA, 0xD3, 0x39, 0x41,
4216 0xE3, 0x10, 0xE5, 0x07, 0xE4, 0x0E, 0x20, 0x38, 0x63, 0xF7,
4217 0x02, 0xF2, 0x17, 0x99, 0xEB, 0xC6, 0xE7, 0x5F, 0xBE, 0xAE,
4218 0x53, 0xD1, 0x12, 0xB2, 0x9A, 0x90, 0x25, 0x6A, 0xAA, 0xFD,
4219 0x5D, 0x69, 0x2F, 0x32, 0x33, 0x53, 0x57, 0x1B, 0xC4, 0x24,
4220 0xC0, 0xC5, 0x90, 0x04, 0x04, 0x67, 0xCA, 0x85, 0x1E, 0x94,
4221 0x31, 0x95, 0x78, 0x76, 0x5D, 0xCF, 0x15, 0xE6, 0x06, 0x6B,
4222 0x1A, 0x1D, 0x0E, 0xF6, 0x64, 0x91, 0x84, 0xAE, 0xE4, 0xF0,
4223 0x1F, 0x0A, 0x76, 0x1C, 0x74, 0xF3, 0xC1, 0x97, 0x80, 0x5B,
4224 0xD9, 0xC6, 0xB6, 0x2B, 0xA8, 0xD7, 0xD8, 0xD2, 0xB5, 0x8E,
4225 0x05, 0xB5, 0x16, 0x6A, 0xF7, 0xCB, 0xD2, 0xFE, 0xE0, 0xA7,
4226 0x3E, 0x1C, 0x3E, 0x84, 0xDC, 0x89, 0x33, 0xD7, 0x2F, 0x2A,
4227 0x40, 0x41, 0x18, 0xB8, 0x58, 0xB6, 0x54, 0xC6, 0xC9, 0xDF,
4228 0x24, 0x91, 0xCD, 0x62, 0xA0, 0x9D, 0x17, 0xCC, 0xA6, 0xCF,
4229 0xD9, 0x25, 0xA1, 0xBC, 0x63, 0x09, 0xFB, 0xD1, 0x65, 0x5C,
4230 0xFC, 0xB8, 0x3A, 0x3D, 0x50, 0xEC, 0x1A, 0x26, 0x37, 0xCB,
4231 0x9C, 0x29, 0x9E, 0x15, 0x06, 0xC9, 0x14, 0x45, 0x41, 0x5F,
4232 0x6C, 0x41, 0x46, 0xEA, 0xC6, 0xF8, 0x18, 0x01, 0x7D, 0xCD,
4233 0x30, 0xEE, 0x5D, 0xB5, 0xA0, 0x96, 0x19, 0x80, 0x96, 0xB1,
4234 0x03, 0x55, 0x86, 0x57, 0xBE, 0x19, 0x13, 0x46, 0x88, 0x00,
4235 0xCE, 0x5E, 0xD0, 0xBE, 0xEC, 0x13, 0x2B, 0x93, 0x3C, 0xE1,
4236 0xEC, 0xBD, 0x15, 0x6F, 0xA5, 0xF5, 0x20, 0x59, 0x3C, 0xDD,
4237 0xBD, 0xFD, 0xDF, 0x9D, 0x9F, 0x07, 0x73, 0x25, 0x93, 0x42,
4238 0x41, 0xCF, 0x4A, 0xE5, 0x8F, 0x04, 0xAC, 0x5F, 0x6A, 0x56,
4239 0x87, 0x49, 0xD5, 0x64, 0x00, 0x9D, 0xF4, 0xA5, 0x6B, 0xBE,
4240 0x8F, 0xC8, 0xE8, 0xBC, 0xC7, 0x1C, 0x99, 0xC0, 0x2F, 0xA1,
4241 0xDA, 0xDF, 0x6B, 0xE5, 0x62, 0x9D, 0xC9, 0x73, 0x5B, 0x2A,
4242 0x3E, 0xD7, 0x8A, 0xBE, 0x0A, 0x5F, 0x2B, 0x0B, 0x61, 0xEF,
4243 0x4A, 0x09, 0x15, 0x70, 0xE6, 0x5C, 0xA1, 0xB6, 0xDE, 0x54,
4244 0x71, 0x74, 0x55, 0x63, 0x77, 0x8F, 0xC9, 0xAF, 0x22, 0x9A,
4245 0xFE, 0x2C, 0x09, 0x62, 0x3E, 0xA1, 0xAA, 0x89, 0xB8, 0x6B,
4246 0x50, 0x84, 0x20, 0x66, 0x5D, 0x8F, 0x39, 0x7F, 0xC1, 0x2D,
4247 0xFA, 0x78, 0x8F, 0x8E, 0xD0, 0x39, 0x33, 0xD4, 0x9A, 0x40,
4248 0x56, 0xBC, 0x86, 0x22, 0x07, 0xEB, 0x22, 0xB8, 0x52, 0xC0,
4249 0x1A, 0xD2, 0x35, 0x1F, 0x56, 0x7E, 0xDA, 0x2B, 0xC1, 0x08,
4250 0xD2, 0x39, 0x28, 0x46, 0x63, 0x9A, 0xAD, 0x44, 0xB3, 0xEF,
4251 0x1C, 0x2A, 0xD6, 0x68, 0x67, 0xE4, 0x63, 0x73, 0x78, 0x29,
4252 0xA7, 0xA0, 0x70, 0x2E, 0xD9, 0xB4, 0x14, 0x4D, 0x04, 0xD3,
4253 0x2D, 0x8A, 0x70, 0x07, 0xAD, 0x8A, 0xC0, 0xA5, 0x1D, 0xE7,
4254 0x17, 0xD8, 0xBB, 0xAA, 0xB5, 0xF7, 0xC8, 0x8D, 0x29, 0x8E,
4255 0x49, 0x32, 0xA0, 0x40, 0x34, 0xBB, 0x2E, 0x10, 0x30, 0xDD,
4256 0xEA, 0x3E, 0xCC, 0xC1, 0xB9, 0xF2, 0x42, 0xCC, 0x4A, 0xF2,
4257 0xF4, 0x93, 0x2E, 0x3F, 0x0C, 0xE8, 0xE4, 0x96, 0x1F, 0x33,
4258 0x2D, 0x67, 0x4F, 0x8E, 0x1B, 0x01, 0xD6, 0xE2, 0xF2, 0xFD,
4259 0x5D, 0xCC, 0xFD, 0x18, 0x9C, 0xD6, 0x50, 0x1F, 0xE1, 0xC5,
4260 0x7C, 0xBE, 0x59, 0x95, 0x7D, 0x21, 0x25, 0x3E, 0xF3, 0xBC,
4261 0xCE, 0x31, 0x80, 0x79, 0x34, 0x0F, 0x86, 0x78, 0x18, 0xA6,
4262 0x36, 0x17, 0xD9, 0x70, 0xA7, 0x22, 0xA7, 0xE8, 0xA2, 0xBD,
4263 0x74, 0xB9, 0x8E, 0x34, 0xF0, 0xEC, 0xF7, 0x40, 0x22, 0x33,
4264 0xE8, 0x50, 0x43, 0x66, 0xF0, 0x25, 0x41, 0x20, 0xD9, 0x3F,
4265 0x8A, 0xC6, 0xAD, 0x69, 0xC6, 0x9C, 0xD9, 0xE0, 0x0D, 0xFF,
4266 0x93, 0x32, 0x5D, 0x57, 0x45, 0xCC, 0xA4, 0xF9, 0x32, 0xD4,
4267 0x5A, 0x49, 0x17, 0x1B, 0xFB, 0x2F, 0x91, 0xAA, 0x5B, 0xC5,
4268 0xC8, 0xC8, 0x2B, 0x20, 0x30, 0x1B, 0xB2, 0x01, 0xC3, 0xA7,
4269 0x8E, 0x6C, 0xB8, 0xF7, 0xB3, 0x95, 0x4A, 0x28, 0x82, 0xAA,
4270 0x0C, 0x4B, 0xDA, 0x26, 0x4A, 0x34, 0x7F, 0x17, 0x55, 0x4C,
4271 0x5D, 0x3C, 0x0B, 0x16, 0xA2, 0xEB, 0x33, 0xFB, 0x38, 0x63,
4272 0xF2, 0x15, 0x7D, 0xFA, 0x52, 0xA9, 0x58, 0xDD, 0x41, 0x58,
4273 0xA0, 0x13, 0xD2, 0x55, 0x22, 0xF9, 0xC2, 0xF8, 0x4E, 0x3F,
4274 0xAC, 0xDC, 0x11, 0x0A, 0xBB, 0x7C, 0xB1, 0x2B, 0xFB, 0x60,
4275 0xC5, 0x08, 0xB9, 0xB0, 0xED, 0xE8, 0xB9, 0x88, 0xBD, 0x07,
4276 0xDE, 0x53, 0xD0, 0x6B, 0xE5, 0x6E, 0xA0, 0x17, 0x8C, 0xCF,
4277 0x02, 0xF0, 0x64, 0xDE, 0xCE, 0x8C, 0x91, 0xED, 0xB4, 0x4F,
4278 0xB0, 0xEE, 0x12, 0x26, 0xC6, 0x55, 0xA0, 0x4D, 0xCC, 0xF3,
4279 0x1A, 0x86, 0x5A, 0x01, 0x53, 0x01, 0xAA, 0xED, 0x6D, 0x11,
4280 0xCD, 0x8A, 0x4A, 0xCA, 0x85, 0x35, 0x35, 0xFA, 0x22, 0x55,
4281 0xF3, 0xB8, 0xFA, 0x43, 0xD6, 0x9E, 0xB5, 0x0D, 0xD3, 0x85,
4282 0x59, 0xC9, 0xAF, 0xCD, 0xAB, 0xFA, 0xB6, 0x65, 0x20, 0xCC,
4283 0x11, 0xF1, 0xDE, 0x87, 0x6F, 0x58, 0xA1, 0x41, 0xF2, 0x80,
4284 0x75, 0xEA, 0x26, 0x72, 0x8C, 0xE9, 0x17, 0x1C, 0x2B, 0x4D,
4285 0xA4, 0x9C, 0xAA, 0x32, 0xAA, 0x2C, 0x84, 0xBA, 0x87, 0xAA,
4286 0x81, 0x66, 0x56, 0x76, 0x0F, 0x1C, 0x58, 0xFE, 0xD1, 0x7F,
4287 0x33, 0x59, 0xF1, 0xF0, 0x56, 0x50, 0x00, 0x4F, 0x96, 0xF7,
4288 0x1C, 0x11, 0x7C, 0x36, 0xD8, 0xAD, 0x3E, 0x82, 0x15, 0x68,
4289 0x40, 0x83, 0xFE, 0x62, 0x94, 0xD5, 0x2A, 0x43, 0x88, 0xD8,

NetBurner, Inc.
22.205 certs_test.h 1143

4290 0x12, 0xE2, 0x37, 0x8A, 0x3E, 0x9E, 0x24, 0x8B, 0x70, 0x3C,
4291 0xBD, 0x97, 0x0B, 0x59, 0xAC, 0x4B, 0x88, 0x36, 0x2D, 0x2F,
4292 0xE9, 0x49, 0x14, 0xC0, 0x28, 0x7F, 0x0D, 0xE8, 0x93, 0x76,
4293 0x22, 0xF3, 0x08, 0x17, 0x34, 0x91, 0x39, 0xA6, 0x84, 0xCA,
4294 0xF1, 0xD2, 0x8A, 0x9D, 0xF1, 0xD4, 0xA4, 0x85, 0xA6, 0x1E,
4295 0xFB, 0x6B, 0x75, 0x07, 0x80, 0x84, 0x32, 0xF5, 0x51, 0xD6,
4296 0x42, 0xA8, 0x69, 0x96, 0xC3, 0xBD, 0xEF, 0x2F, 0xA4, 0x23,
4297 0x58, 0x07, 0xBC, 0xDE, 0x45, 0xD4, 0x1E, 0x67, 0xF1, 0x00,
4298 0x65, 0xB5, 0x03, 0xF3, 0x83, 0x9D, 0xE8, 0xDE, 0x63, 0x42,
4299 0x2B, 0xB6, 0xED, 0x7F, 0x63, 0xF6, 0xCF, 0x53, 0x1B, 0xBD,
4300 0x9D, 0x6C, 0x26, 0xBC, 0xC2, 0xC3, 0xAF, 0x86, 0x06, 0x5F,
4301 0x49, 0xBF, 0x7E, 0x76, 0xF5, 0x6C, 0x5B, 0x41, 0xF7, 0xAF,
4302 0x02, 0x1F, 0x35, 0x43, 0x0D, 0x64, 0x65, 0xFE, 0xD7, 0x9A,
4303 0x3F, 0x21, 0xD5, 0x74, 0x6E, 0x8A, 0xA8, 0xAF, 0x3B, 0xCE,
4304 0x85, 0xBB, 0xF7, 0x7B, 0xCA, 0xF7, 0x9D, 0x02, 0x52, 0x55,
4305 0xE9, 0x3E, 0x4A, 0x4B, 0x62, 0x85, 0x35, 0xFA, 0xBD, 0xEB,
4306 0x92, 0x25, 0x24, 0x01, 0xFF, 0xEE, 0xFB, 0x94, 0xF6, 0xE6,
4307 0x9F, 0xE3, 0x3D, 0x93, 0xCF, 0x69, 0xEB, 0x3D, 0x8F, 0x1F,
4308 0xBE, 0xAE, 0x85, 0x6F, 0x8F, 0x0B, 0x22, 0x57, 0x00, 0x3D,
4309 0x8E, 0xF4, 0x6B, 0x4D, 0x82, 0x76, 0x91, 0x25, 0x4B, 0x2C,
4310 0xF1, 0xBC, 0x64, 0x96, 0x54, 0x35, 0xFD, 0xBD, 0xFC, 0x71,
4311 0xF7, 0x48, 0x40, 0xEB, 0x4C, 0x1C, 0xC4, 0xAB, 0x4F, 0xC9,
4312 0xC7, 0xB0, 0x8C, 0xBF, 0x27, 0xE2, 0x18, 0xCA, 0x78, 0xAA,
4313 0xA0, 0x04, 0xAB, 0x6B, 0x6D, 0xBC, 0x89, 0xCB, 0x71, 0xA7,
4314 0xF8, 0x81, 0x0D, 0x4F, 0x2A, 0x9A, 0x37, 0x60, 0xA0, 0x6A,
4315 0x14, 0xE7, 0x30, 0x2E, 0x72, 0xF9, 0xE2, 0x39, 0x27, 0xD9,
4316 0xC6, 0xB2, 0x9E, 0xBC, 0x3D, 0xD6, 0x2D, 0xE4, 0xCD, 0xC2,
4317 0x40, 0x15, 0xC5, 0x7B, 0x8A, 0x06, 0x42, 0x46, 0xF2, 0x45,
4318 0x14, 0x83, 0x82, 0xAB, 0x30, 0x6C, 0x73, 0x92, 0x55, 0x51,
4319 0xE7, 0x8B, 0x3C, 0xD1, 0x2C, 0x8A, 0xC0, 0x16, 0x79, 0xC9,
4320 0xFD, 0x7C, 0x78, 0x1E, 0xE9, 0xDF, 0xF4, 0x08, 0xEF, 0x38,
4321 0xEC, 0xCB, 0x81, 0xF1, 0x87, 0x53, 0x8A, 0x0B, 0xF3, 0x56,
4322 0x0C, 0xBC, 0xEE, 0x03, 0xAE, 0xBC, 0xF8, 0x43, 0x3E, 0xA2,
4323 0xEA, 0x84, 0x37, 0x72, 0x8A, 0x80, 0x8D, 0x61, 0x1C, 0x79,
4324 0x3E, 0x4A, 0x5A, 0xC2, 0x73, 0xA0, 0x95, 0xDC, 0x46, 0x2B,
4325 0x5E, 0x4B, 0x89, 0xE3, 0x9F, 0xD7, 0x14, 0x61, 0x8B, 0x59,
4326 0xD1, 0x71, 0xB0, 0x04, 0xAA, 0x4B, 0x2A, 0xCA, 0xEF, 0x8D,
4327 0x3B, 0x4B, 0x52, 0x8F, 0x0B, 0x76, 0xB8, 0x38, 0xF8, 0xDD,
4328 0xD2, 0xE6, 0x46, 0x53, 0x1C, 0xD5, 0xC8, 0x1E, 0x85, 0x54,
4329 0x67, 0xC0, 0x77, 0x7E, 0x28, 0x2F, 0x91, 0xC5, 0xE5, 0x28,
4330 0x54, 0x37, 0xF6, 0x77, 0xEC, 0x6C, 0x36, 0x1D, 0x91, 0xA9,
4331 0x45, 0xCC, 0x85, 0x61, 0xAB, 0x14, 0xBE, 0x81, 0x6C, 0xFF,
4332 0x35, 0x8C, 0x13, 0x61, 0xE7, 0x66, 0x83, 0xFF, 0x67, 0x6C,
4333 0x80, 0x59, 0xD5, 0x6D, 0xAB, 0x5B, 0x81, 0x76, 0x39, 0x1B,
4334 0xBB, 0xD2, 0xFF, 0x1B, 0x7B, 0x66, 0xD6, 0x42, 0xD0, 0x86,
4335 0x62, 0x4A, 0xA1, 0x4F, 0x00, 0x41, 0x7E, 0x9C, 0xE5, 0xD6,
4336 0x82, 0x31, 0xA7, 0x34, 0x16, 0x20, 0x62, 0xFA, 0x1F, 0x6B,
4337 0x21, 0xBE, 0x62, 0x19, 0xE9, 0x56, 0x7A, 0x4C, 0xF0, 0x7B,
4338 0xB4, 0x2E, 0x4A, 0xA7, 0x20, 0xC3, 0x5F, 0x7F, 0x5A, 0xA2,
4339 0xAF, 0xF5, 0xC5, 0xFD, 0x1A, 0x7C, 0xB6, 0x06, 0xCA, 0xE3,
4340 0x74, 0x72, 0x4E, 0x77, 0xC9, 0xDD, 0x3B, 0x44, 0x16, 0x8C,
4341 0x45, 0x46, 0xC5, 0xE3, 0x81, 0x1E, 0x3C, 0x4D, 0xAC, 0x1A,
4342 0x7F, 0xAA, 0x6D, 0xFD, 0xE1, 0x45, 0x59, 0x11, 0x44, 0x48,
4343 0xB5, 0x09, 0xEF, 0x7E, 0xF2, 0x75, 0x0C, 0xBF, 0xC7, 0x17,
4344 0xB4, 0x9E, 0x10, 0xC0, 0x11, 0xDD, 0xB2, 0x59, 0xCF, 0x25,
4345 0x3B, 0xA8, 0x97, 0x56, 0x08, 0xE0, 0x65, 0x27, 0xC5, 0x29,
4346 0x34, 0xBD, 0x38, 0xB1, 0x39, 0xAA, 0x27, 0xFC, 0x96, 0xCB,
4347 0x9A, 0x2B, 0x92, 0x74, 0xDF, 0x0A, 0x52, 0xE4, 0x93, 0xA8,
4348 0x18, 0x15, 0x2C, 0x8C, 0x61, 0xD3, 0xBC, 0xD0, 0x9E, 0x9D,
4349 0x40, 0x1C, 0x69, 0x95, 0x0D, 0x52, 0x76, 0x3F, 0xD7, 0xD7,
4350 0xC1, 0x1C, 0x34, 0xE7, 0xD4, 0xD4, 0x17, 0x2D, 0xF0, 0x6A,
4351 0x1C, 0xE2, 0x53, 0x18, 0x60, 0xC6, 0xA1, 0xCD, 0x4F, 0xAA,
4352 0x16, 0xA0, 0xC3, 0x3B, 0xCE, 0x4D, 0x73, 0x0B, 0x63, 0x02,
4353 0x1C, 0xEE, 0x18, 0xBF, 0xF9, 0x33, 0x24, 0xD3, 0x02, 0x34,
4354 0xCC, 0xB9, 0xD7, 0xC2, 0x00, 0x7F, 0xB4, 0x08, 0x4B, 0xFC,
4355 0x1D, 0xDF, 0x42, 0x8C, 0x75, 0xEE, 0x13, 0x90, 0x37, 0x14,
4356 0x0D, 0xD2, 0xE0, 0x50, 0x90, 0x6A, 0xB9, 0xEF, 0x7F, 0x70,
4357 0x38, 0x2E, 0xCD, 0x39, 0x2E, 0x09, 0x51, 0xDF, 0x58, 0xBE,
4358 0x8E, 0x82, 0x91, 0xEB, 0xBC, 0xB4, 0x6B, 0x12, 0x40, 0x4E,
4359 0x44, 0xB8, 0x08, 0x97, 0x57, 0xF0, 0xFE, 0x61, 0xBD, 0x77,
4360 0xED, 0x46, 0xDA, 0xB7, 0xA4, 0xF5, 0x4F, 0xB2, 0xA6, 0xF1,
4361 0x47, 0x2D, 0x11, 0x26, 0x74, 0x55, 0x81, 0xFF, 0xFB, 0xEA,
4362 0x00, 0x03, 0x96, 0xD8, 0xE6, 0x6B, 0xEA, 0x3F, 0x0B, 0x0C,
4363 0xC0, 0xE4, 0x0A, 0x3D, 0x21, 0x3C, 0x99, 0x51, 0x91, 0x11,
4364 0xF0, 0x91, 0x68, 0xEE, 0xEE, 0xCD, 0x71, 0x42, 0xAD, 0xBA,
4365 0x34, 0x68, 0x9F, 0x67, 0xB1, 0xEE, 0x1C, 0x70, 0x7A, 0xFC,
4366 0x1E, 0x86, 0xF8, 0x96, 0x6C, 0x13, 0xD6, 0x36, 0x57, 0x5F,
4367 0x11, 0x2E, 0x1B, 0x97, 0xAB, 0x8B, 0x65, 0x3E, 0x8E, 0x91,
4368 0x69, 0x1C, 0x76, 0xAD, 0xB5, 0x8C, 0xE6, 0x02, 0x93, 0x16,
4369 0xA4, 0xF5, 0x14, 0x86, 0xB5, 0x16, 0x07, 0xF5, 0x0C, 0x01,
4370 0xE9, 0xDC, 0xEA, 0x86, 0x58, 0x98, 0xBA, 0x2C, 0x04, 0x0A,
4371 0x16, 0x8A, 0xF3, 0x10, 0x25, 0x48, 0x51, 0x21, 0x77, 0x69,
4372 0xF1, 0x22, 0xC3, 0xF4, 0x1D, 0xD5, 0x6D, 0x59, 0x1B, 0x44,
4373 0x88, 0xFC, 0xE5, 0x4B, 0xE1, 0xD6, 0xF4, 0x46, 0x4C, 0x9D,
4374 0x45, 0x93, 0xE1, 0xB5, 0x26, 0xDF, 0x48, 0x90, 0x13, 0xA6,
4375 0x65, 0x7E, 0x18, 0x6A, 0x79, 0x19, 0x81, 0x10, 0x08, 0x80,
4376 0xA4, 0x99, 0xD3, 0x98, 0x3C, 0x9E, 0x91, 0x31, 0xE9, 0x71,

NetBurner, Inc.
1144 File Documentation

4377 0xA0, 0x6A, 0xF9, 0x2F, 0x61, 0xA5, 0x72, 0x13, 0x6C, 0x4C,
4378 0xD2, 0xAF, 0x40, 0x8B, 0x0D, 0x3D, 0xE4, 0x24, 0x7B, 0x30,
4379 0x9C, 0xD0, 0x62, 0x42, 0x67, 0x54, 0xC6, 0x34, 0xF2, 0x55,
4380 0x70, 0x95, 0xAE, 0x16, 0x9F, 0xCC, 0x6F, 0xEA, 0x0B, 0x40,
4381 0x38, 0xAE, 0x74, 0x89, 0xCB, 0x64, 0x79, 0xF7, 0x08, 0x68,
4382 0x2C, 0x1E, 0xEE, 0x28, 0xEA, 0x77, 0xA2, 0xA3, 0x8E, 0xF4,
4383 0xEE, 0xFE, 0x62, 0x25, 0x98, 0xB1, 0xDE, 0x4B, 0x3A, 0x62,
4384 0xD9, 0x12, 0xD6, 0x09, 0x32, 0x6C, 0x80, 0x27, 0x21, 0x0A,
4385 0xFE, 0x4D, 0xBF, 0x29, 0x90, 0xCD, 0x6C, 0xE0, 0xAF, 0x06,
4386 0xB3, 0xC2, 0xDF, 0xB8, 0x50, 0x59, 0xD8, 0x0A, 0xB5, 0x98,
4387 0xC1, 0xA8, 0x80, 0xD7, 0x61, 0xFC, 0x59, 0xDB, 0xB1, 0x2A,
4388 0xA5, 0xD7, 0xFA, 0x9E, 0x93, 0x60, 0xD4, 0xB0, 0x6B, 0x44,
4389 0xB3, 0xC3, 0x3F, 0x9B, 0xEA, 0xD4, 0x8C, 0x08, 0x4B, 0x09,
4390 0x97, 0xC6, 0x2B, 0xC0, 0x8A, 0x92, 0x35, 0xCA, 0x6F, 0x93,
4391 0xD6, 0x71, 0x1E, 0xAB, 0x0F, 0x65, 0x42, 0xC2, 0x97, 0x77,
4392 0x10, 0x6E, 0xD4, 0xEE, 0x2A, 0xDF, 0x54, 0x2A, 0x5F, 0xB4,
4393 0xD4, 0x72, 0x18, 0x90, 0x42, 0x09, 0xAA, 0xC3, 0x31, 0x89
4394
4395 };
4396 static const int sizeof_bench_dilithium_level2_key = sizeof(bench_dilithium_level2_key);
4397
4398 /* certs/dilithium/bench_dilithium_level3_key.der */
4399 static const unsigned char bench_dilithium_level3_key[] =
4400 {
4401 0x30, 0x82, 0x17, 0x5A, 0x02, 0x01, 0x00, 0x30, 0x0D, 0x06,
4402 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x02, 0x82, 0x0B, 0x07,
4403 0x06, 0x05, 0x04, 0x82, 0x17, 0x44, 0x04, 0x82, 0x17, 0x40,
4404 0x2E, 0xFE, 0x07, 0xDF, 0x5E, 0xF9, 0x18, 0xB4, 0x0E, 0xBF,
4405 0x9C, 0x1C, 0xCA, 0x84, 0xBA, 0x62, 0xB9, 0xA2, 0x96, 0x76,
4406 0xB6, 0xB7, 0x77, 0x9C, 0xBE, 0x0C, 0xF8, 0xA5, 0xEF, 0x74,
4407 0xB1, 0xC2, 0x8D, 0x95, 0x6D, 0x38, 0x49, 0x01, 0xA8, 0x3D,
4408 0x63, 0x0B, 0xDF, 0x4B, 0x5D, 0xF4, 0xC4, 0x98, 0x27, 0x77,
4409 0x88, 0xA0, 0xA9, 0xF2, 0x38, 0x32, 0x62, 0x17, 0x11, 0xD6,
4410 0xBE, 0xA0, 0xFD, 0xEB, 0xBF, 0x4A, 0xF2, 0x6C, 0x44, 0x62,
4411 0x2D, 0x87, 0x3D, 0xAD, 0x0C, 0x47, 0x06, 0x00, 0x7E, 0xAF,
4412 0x52, 0xE7, 0xA1, 0x8E, 0x7A, 0xA7, 0x7D, 0x3C, 0xE5, 0xB2,
4413 0x59, 0xDA, 0x89, 0x76, 0xF7, 0xD4, 0x73, 0x16, 0x33, 0x67,
4414 0x88, 0x46, 0x51, 0x13, 0x12, 0x38, 0x64, 0x76, 0x73, 0x40,
4415 0x16, 0x55, 0x70, 0x06, 0x32, 0x84, 0x47, 0x25, 0x33, 0x44,
4416 0x70, 0x68, 0x36, 0x25, 0x62, 0x47, 0x76, 0x65, 0x73, 0x11,
4417 0x28, 0x00, 0x75, 0x33, 0x81, 0x13, 0x62, 0x51, 0x31, 0x33,
4418 0x11, 0x41, 0x51, 0x62, 0x55, 0x33, 0x07, 0x60, 0x14, 0x18,
4419 0x30, 0x58, 0x22, 0x67, 0x26, 0x86, 0x12, 0x78, 0x17, 0x47,
4420 0x30, 0x06, 0x05, 0x36, 0x37, 0x23, 0x08, 0x67, 0x05, 0x05,
4421 0x06, 0x85, 0x33, 0x83, 0x14, 0x63, 0x44, 0x35, 0x00, 0x04,
4422 0x56, 0x03, 0x23, 0x03, 0x33, 0x13, 0x02, 0x23, 0x25, 0x80,
4423 0x22, 0x00, 0x53, 0x73, 0x13, 0x70, 0x03, 0x84, 0x15, 0x50,
4424 0x14, 0x20, 0x06, 0x74, 0x03, 0x41, 0x26, 0x74, 0x63, 0x65,
4425 0x42, 0x03, 0x00, 0x72, 0x66, 0x44, 0x36, 0x88, 0x60, 0x85,
4426 0x76, 0x86, 0x17, 0x72, 0x16, 0x37, 0x23, 0x82, 0x15, 0x84,
4427 0x57, 0x14, 0x20, 0x72, 0x15, 0x55, 0x26, 0x42, 0x82, 0x66,
4428 0x40, 0x54, 0x03, 0x54, 0x62, 0x61, 0x83, 0x35, 0x20, 0x76,
4429 0x62, 0x14, 0x37, 0x35, 0x42, 0x04, 0x32, 0x72, 0x08, 0x35,
4430 0x42, 0x74, 0x51, 0x24, 0x54, 0x86, 0x36, 0x56, 0x11, 0x83,
4431 0x64, 0x44, 0x54, 0x78, 0x80, 0x50, 0x55, 0x72, 0x84, 0x16,
4432 0x48, 0x13, 0x04, 0x17, 0x06, 0x36, 0x25, 0x48, 0x21, 0x33,
4433 0x45, 0x71, 0x21, 0x54, 0x10, 0x26, 0x13, 0x72, 0x12, 0x30,
4434 0x03, 0x73, 0x48, 0x84, 0x16, 0x22, 0x11, 0x38, 0x26, 0x43,
4435 0x53, 0x36, 0x56, 0x12, 0x15, 0x70, 0x07, 0x57, 0x00, 0x65,
4436 0x72, 0x11, 0x73, 0x48, 0x01, 0x13, 0x31, 0x58, 0x82, 0x60,
4437 0x61, 0x17, 0x78, 0x44, 0x48, 0x15, 0x48, 0x26, 0x62, 0x43,
4438 0x72, 0x44, 0x62, 0x76, 0x40, 0x15, 0x63, 0x26, 0x10, 0x51,
4439 0x82, 0x21, 0x05, 0x82, 0x30, 0x56, 0x58, 0x62, 0x76, 0x48,
4440 0x67, 0x82, 0x86, 0x51, 0x32, 0x37, 0x78, 0x38, 0x13, 0x82,
4441 0x55, 0x22, 0x45, 0x22, 0x68, 0x66, 0x15, 0x30, 0x35, 0x77,
4442 0x04, 0x28, 0x45, 0x85, 0x72, 0x48, 0x30, 0x26, 0x06, 0x24,
4443 0x12, 0x75, 0x42, 0x53, 0x88, 0x14, 0x15, 0x07, 0x08, 0x86,
4444 0x05, 0x08, 0x01, 0x56, 0x77, 0x44, 0x38, 0x53, 0x22, 0x21,
4445 0x20, 0x56, 0x25, 0x15, 0x72, 0x68, 0x27, 0x03, 0x71, 0x25,
4446 0x64, 0x11, 0x44, 0x34, 0x77, 0x60, 0x68, 0x58, 0x44, 0x74,
4447 0x76, 0x63, 0x86, 0x16, 0x01, 0x40, 0x68, 0x51, 0x20, 0x12,
4448 0x36, 0x55, 0x01, 0x84, 0x61, 0x80, 0x46, 0x36, 0x28, 0x82,
4449 0x44, 0x66, 0x14, 0x80, 0x50, 0x32, 0x34, 0x46, 0x21, 0x34,
4450 0x63, 0x04, 0x22, 0x20, 0x17, 0x84, 0x88, 0x88, 0x47, 0x02,
4451 0x52, 0x60, 0x45, 0x35, 0x86, 0x72, 0x71, 0x43, 0x30, 0x58,
4452 0x24, 0x11, 0x11, 0x64, 0x45, 0x36, 0x25, 0x18, 0x82, 0x18,
4453 0x16, 0x80, 0x27, 0x76, 0x53, 0x08, 0x70, 0x87, 0x64, 0x43,
4454 0x68, 0x86, 0x07, 0x04, 0x34, 0x10, 0x68, 0x30, 0x21, 0x01,
4455 0x86, 0x66, 0x06, 0x50, 0x41, 0x72, 0x18, 0x00, 0x05, 0x40,
4456 0x36, 0x35, 0x60, 0x50, 0x82, 0x82, 0x24, 0x73, 0x31, 0x35,
4457 0x81, 0x35, 0x02, 0x50, 0x22, 0x76, 0x44, 0x52, 0x27, 0x43,
4458 0x82, 0x66, 0x51, 0x38, 0x86, 0x72, 0x18, 0x54, 0x20, 0x65,
4459 0x45, 0x26, 0x03, 0x42, 0x24, 0x25, 0x27, 0x36, 0x02, 0x04,
4460 0x38, 0x77, 0x18, 0x44, 0x17, 0x78, 0x46, 0x34, 0x68, 0x00,
4461 0x72, 0x57, 0x72, 0x67, 0x53, 0x82, 0x51, 0x06, 0x34, 0x56,
4462 0x71, 0x26, 0x73, 0x55, 0x58, 0x11, 0x44, 0x15, 0x26, 0x81,
4463 0x14, 0x88, 0x25, 0x45, 0x52, 0x84, 0x13, 0x60, 0x12, 0x26,

NetBurner, Inc.
22.205 certs_test.h 1145

4464 0x12, 0x36, 0x11, 0x61, 0x30, 0x25, 0x32, 0x83, 0x00, 0x71,
4465 0x73, 0x04, 0x48, 0x40, 0x70, 0x21, 0x36, 0x54, 0x45, 0x33,
4466 0x43, 0x00, 0x76, 0x62, 0x63, 0x71, 0x15, 0x35, 0x27, 0x50,
4467 0x06, 0x16, 0x30, 0x45, 0x08, 0x12, 0x51, 0x68, 0x38, 0x21,
4468 0x71, 0x61, 0x61, 0x18, 0x35, 0x15, 0x25, 0x47, 0x14, 0x62,
4469 0x51, 0x14, 0x76, 0x12, 0x62, 0x60, 0x63, 0x16, 0x20, 0x68,
4470 0x62, 0x31, 0x56, 0x64, 0x05, 0x84, 0x56, 0x26, 0x40, 0x42,
4471 0x88, 0x05, 0x60, 0x84, 0x82, 0x10, 0x23, 0x87, 0x63, 0x33,
4472 0x60, 0x40, 0x58, 0x12, 0x83, 0x26, 0x03, 0x13, 0x85, 0x23,
4473 0x02, 0x73, 0x05, 0x27, 0x40, 0x02, 0x75, 0x85, 0x46, 0x51,
4474 0x83, 0x71, 0x37, 0x16, 0x05, 0x86, 0x35, 0x01, 0x45, 0x00,
4475 0x53, 0x68, 0x27, 0x11, 0x06, 0x08, 0x82, 0x60, 0x58, 0x28,
4476 0x50, 0x07, 0x32, 0x56, 0x26, 0x46, 0x78, 0x63, 0x71, 0x16,
4477 0x48, 0x46, 0x86, 0x41, 0x37, 0x75, 0x06, 0x01, 0x11, 0x46,
4478 0x45, 0x21, 0x03, 0x82, 0x42, 0x75, 0x83, 0x30, 0x66, 0x00,
4479 0x74, 0x74, 0x46, 0x05, 0x33, 0x82, 0x33, 0x07, 0x34, 0x53,
4480 0x07, 0x78, 0x53, 0x07, 0x41, 0x37, 0x78, 0x54, 0x06, 0x11,
4481 0x42, 0x47, 0x05, 0x02, 0x62, 0x34, 0x27, 0x17, 0x78, 0x70,
4482 0x70, 0x46, 0x00, 0x38, 0x75, 0x48, 0x74, 0x46, 0x83, 0x35,
4483 0x08, 0x46, 0x14, 0x12, 0x20, 0x68, 0x00, 0x73, 0x57, 0x81,
4484 0x84, 0x62, 0x43, 0x11, 0x28, 0x87, 0x13, 0x30, 0x06, 0x70,
4485 0x15, 0x46, 0x51, 0x14, 0x74, 0x13, 0x53, 0x26, 0x84, 0x78,
4486 0x86, 0x15, 0x84, 0x18, 0x70, 0x56, 0x41, 0x33, 0x61, 0x56,
4487 0x28, 0x11, 0x30, 0x73, 0x82, 0x00, 0x57, 0x68, 0x61, 0x44,
4488 0x04, 0x64, 0x78, 0x68, 0x14, 0x02, 0x83, 0x88, 0x86, 0x88,
4489 0x40, 0x16, 0x81, 0x20, 0x68, 0x72, 0x67, 0x05, 0x76, 0x06,
4490 0x54, 0x74, 0x35, 0x71, 0x02, 0x67, 0x45, 0x24, 0x73, 0x64,
4491 0x87, 0x31, 0x60, 0x37, 0x04, 0x11, 0x85, 0x63, 0x40, 0x71,
4492 0x38, 0x46, 0x65, 0x16, 0x10, 0x85, 0x06, 0x37, 0x25, 0x53,
4493 0x05, 0x58, 0x45, 0x87, 0x17, 0x47, 0x78, 0x10, 0x22, 0x26,
4494 0x24, 0x86, 0x44, 0x63, 0x45, 0x00, 0x14, 0x77, 0x60, 0x04,
4495 0x54, 0x45, 0x40, 0x32, 0x45, 0x03, 0x60, 0x87, 0x05, 0x02,
4496 0x18, 0x22, 0x20, 0x61, 0x07, 0x36, 0x72, 0x52, 0x53, 0x65,
4497 0x27, 0x26, 0x37, 0x54, 0x31, 0x34, 0x22, 0x54, 0x37, 0x25,
4498 0x83, 0x14, 0x74, 0x75, 0x17, 0x61, 0x48, 0x74, 0x24, 0x43,
4499 0x80, 0x81, 0x15, 0x06, 0x88, 0x23, 0x84, 0x55, 0x20, 0x11,
4500 0x87, 0x83, 0x64, 0x36, 0x48, 0x88, 0x32, 0x20, 0x28, 0x54,
4501 0x88, 0x85, 0x35, 0x61, 0x00, 0x21, 0x01, 0x31, 0x44, 0x13,
4502 0x71, 0x48, 0x23, 0x47, 0x31, 0x62, 0x40, 0x18, 0x21, 0x78,
4503 0x34, 0x12, 0x88, 0x10, 0x76, 0x46, 0x72, 0x37, 0x70, 0x84,
4504 0x15, 0x41, 0x84, 0x22, 0x20, 0x22, 0x27, 0x44, 0x81, 0x03,
4505 0x46, 0x48, 0x26, 0x16, 0x21, 0x15, 0x31, 0x85, 0x73, 0x74,
4506 0x73, 0x06, 0x55, 0x21, 0x12, 0x53, 0x13, 0x34, 0x01, 0x64,
4507 0x40, 0x83, 0x08, 0x57, 0x24, 0x04, 0x18, 0x33, 0x70, 0x18,
4508 0x17, 0x06, 0x14, 0x28, 0x12, 0x58, 0x00, 0x25, 0x57, 0x20,
4509 0x00, 0x76, 0x73, 0x45, 0x68, 0x16, 0x60, 0x22, 0x17, 0x22,
4510 0x37, 0x75, 0x53, 0x48, 0x40, 0x21, 0x64, 0x27, 0x52, 0x48,
4511 0x53, 0x61, 0x64, 0x87, 0x57, 0x61, 0x13, 0x75, 0x80, 0x08,
4512 0x63, 0x33, 0x60, 0x26, 0x10, 0x25, 0x61, 0x78, 0x47, 0x78,
4513 0x07, 0x16, 0x00, 0x52, 0x31, 0x30, 0x63, 0x66, 0x46, 0x80,
4514 0x07, 0x10, 0x45, 0x11, 0x13, 0x80, 0x25, 0x61, 0x25, 0x53,
4515 0x80, 0x71, 0x38, 0x31, 0x47, 0x55, 0x02, 0x25, 0x50, 0x87,
4516 0x57, 0x35, 0x74, 0x11, 0x46, 0x44, 0x53, 0x24, 0x60, 0x33,
4517 0x15, 0x12, 0x77, 0x20, 0x36, 0x24, 0x70, 0x04, 0x87, 0x05,
4518 0x71, 0x07, 0x77, 0x36, 0x47, 0x01, 0x73, 0x61, 0x32, 0x62,
4519 0x28, 0x81, 0x67, 0x17, 0x38, 0x45, 0x21, 0x03, 0x24, 0x72,
4520 0x82, 0x64, 0x84, 0x43, 0x07, 0x11, 0x20, 0x72, 0x71, 0x04,
4521 0x58, 0x36, 0x22, 0x21, 0x33, 0x67, 0x55, 0x48, 0x03, 0x68,
4522 0x32, 0x70, 0x04, 0x63, 0x11, 0x34, 0x27, 0x82, 0x42, 0x56,
4523 0x28, 0x74, 0x77, 0x72, 0x18, 0x27, 0x35, 0x87, 0x03, 0x18,
4524 0x40, 0x32, 0x78, 0x07, 0x14, 0x43, 0x73, 0x73, 0x84, 0x63,
4525 0x78, 0x68, 0x03, 0x22, 0x55, 0x30, 0x18, 0x88, 0x15, 0x86,
4526 0x18, 0x51, 0x12, 0x42, 0x13, 0x60, 0x22, 0x44, 0x61, 0x44,
4527 0x35, 0x73, 0x08, 0x85, 0x53, 0x02, 0x73, 0x83, 0x25, 0x85,
4528 0x64, 0x78, 0x16, 0x12, 0x13, 0x63, 0x48, 0x35, 0x02, 0x71,
4529 0x72, 0x58, 0x12, 0x10, 0x65, 0x42, 0x22, 0x54, 0x80, 0x60,
4530 0x57, 0x84, 0x72, 0x76, 0x67, 0x35, 0x25, 0x14, 0x73, 0x70,
4531 0x48, 0x03, 0x78, 0x07, 0x74, 0x48, 0x67, 0x48, 0x01, 0x62,
4532 0x78, 0x05, 0x37, 0x66, 0x42, 0x45, 0x33, 0x65, 0x08, 0x70,
4533 0x42, 0x15, 0x72, 0x53, 0x13, 0x20, 0x14, 0x38, 0x05, 0x53,
4534 0x00, 0x45, 0x25, 0x20, 0x80, 0x75, 0x01, 0x65, 0x80, 0x70,
4535 0x61, 0x50, 0x15, 0x10, 0x77, 0x23, 0x38, 0x31, 0x21, 0x51,
4536 0x78, 0x11, 0x88, 0x71, 0x18, 0x06, 0x45, 0x62, 0x47, 0x35,
4537 0x43, 0x00, 0x52, 0x34, 0x41, 0x75, 0x18, 0x13, 0x51, 0x35,
4538 0x72, 0x11, 0x78, 0x17, 0x30, 0x44, 0x83, 0x25, 0x64, 0x42,
4539 0x65, 0x23, 0x50, 0x32, 0x85, 0x30, 0x67, 0x10, 0x70, 0x01,
4540 0x16, 0x62, 0x36, 0x46, 0x18, 0x53, 0x53, 0x80, 0x13, 0x65,
4541 0x66, 0x53, 0x61, 0x55, 0x07, 0x71, 0x34, 0x56, 0x31, 0x67,
4542 0x64, 0x42, 0x64, 0x41, 0x22, 0x56, 0x44, 0x67, 0x25, 0x52,
4543 0x08, 0x17, 0x38, 0x45, 0x76, 0x83, 0x37, 0x15, 0x76, 0x31,
4544 0x83, 0x47, 0x30, 0x21, 0x55, 0x73, 0x37, 0x82, 0x11, 0x56,
4545 0x67, 0x27, 0x23, 0x44, 0x72, 0x82, 0x10, 0x80, 0x43, 0x11,
4546 0x16, 0x02, 0x21, 0x40, 0x42, 0x10, 0x12, 0x74, 0x58, 0x40,
4547 0x74, 0x00, 0x66, 0x02, 0x85, 0x76, 0x21, 0x17, 0x83, 0x78,
4548 0x80, 0x40, 0x46, 0x87, 0x66, 0x24, 0x35, 0x80, 0x31, 0x77,
4549 0x87, 0x10, 0x47, 0x02, 0x20, 0x65, 0x43, 0x73, 0x41, 0x61,
4550 0x72, 0x18, 0x21, 0x52, 0x32, 0x82, 0x08, 0x82, 0x00, 0x57,

NetBurner, Inc.
1146 File Documentation

4551 0x52, 0x41, 0x45, 0x10, 0x51, 0x41, 0x28, 0x37, 0x72, 0x45,
4552 0x77, 0x10, 0x56, 0x06, 0x54, 0x30, 0x03, 0x74, 0x13, 0x56,
4553 0x77, 0x54, 0x04, 0x86, 0x13, 0x77, 0x81, 0x77, 0x57, 0x15,
4554 0x76, 0x13, 0x51, 0x75, 0x4C, 0xD3, 0x8C, 0xF8, 0x0F, 0x87,
4555 0x37, 0xBC, 0x26, 0x1B, 0x7A, 0x1C, 0xDC, 0x05, 0xFD, 0x9B,
4556 0x97, 0x8C, 0x4D, 0xE5, 0x06, 0xFF, 0x57, 0x65, 0xDC, 0xFC,
4557 0xBF, 0x55, 0x20, 0x8F, 0xC9, 0xAB, 0x63, 0x4C, 0x37, 0x02,
4558 0xB5, 0x51, 0x79, 0x6B, 0xC2, 0x02, 0x74, 0xE5, 0x74, 0x72,
4559 0xC4, 0x3C, 0x8F, 0xD2, 0x79, 0xCB, 0x65, 0x3C, 0xBD, 0xA6,
4560 0xC5, 0x19, 0xDF, 0xFC, 0x24, 0xB9, 0x91, 0x81, 0x41, 0x4D,
4561 0xDF, 0x2E, 0x6A, 0xBD, 0x5A, 0xC4, 0x04, 0x03, 0x7F, 0x71,
4562 0x7D, 0x51, 0xDD, 0x2F, 0xAE, 0x4C, 0x9A, 0xF8, 0x98, 0x11,
4563 0xA0, 0xCE, 0xF7, 0xDE, 0xF5, 0xC6, 0x91, 0xD3, 0xDC, 0xE7,
4564 0xAA, 0xD0, 0x7D, 0xDF, 0x5F, 0xF2, 0x5B, 0x55, 0x9C, 0xD6,
4565 0x8D, 0xC9, 0x1E, 0xC7, 0x80, 0xD9, 0xC5, 0xFA, 0x15, 0xEB,
4566 0xCE, 0x6B, 0x99, 0x71, 0xBD, 0xED, 0x0C, 0x24, 0x1B, 0x97,
4567 0x52, 0xFA, 0x54, 0xF5, 0x72, 0x48, 0x97, 0x05, 0x8B, 0x04,
4568 0xE5, 0xAA, 0xE0, 0xDC, 0x98, 0x13, 0xD2, 0x27, 0xB0, 0x0B,
4569 0x49, 0x8B, 0xA0, 0xD1, 0x2C, 0x18, 0xA5, 0xFA, 0x2A, 0x80,
4570 0x4B, 0xF7, 0x4B, 0x8C, 0xE0, 0xA4, 0xCD, 0xD0, 0x75, 0xE9,
4571 0x4A, 0x75, 0x15, 0x1B, 0xB8, 0x51, 0xD8, 0x8D, 0x1E, 0xA4,
4572 0xD1, 0xCD, 0x0E, 0xEE, 0xD4, 0xAA, 0x55, 0x0C, 0x6A, 0xB3,
4573 0xC9, 0x51, 0x66, 0x72, 0x76, 0xF4, 0xF9, 0xA4, 0xC2, 0x56,
4574 0x9D, 0xF9, 0x7C, 0x4C, 0x91, 0x27, 0xAC, 0xB3, 0x3E, 0x6B,
4575 0x2D, 0x5B, 0x84, 0xF3, 0x68, 0xD7, 0x28, 0xAE, 0xB6, 0x75,
4576 0x41, 0x46, 0xF2, 0x50, 0xF4, 0x20, 0x04, 0x4E, 0xB3, 0x0D,
4577 0xC3, 0xAE, 0xA9, 0x87, 0x9E, 0xB2, 0x05, 0xAE, 0x33, 0x76,
4578 0x76, 0x1A, 0x7A, 0xAB, 0xFD, 0x55, 0x77, 0x64, 0xF0, 0x0A,
4579 0x7C, 0x4F, 0x75, 0xE7, 0xBC, 0x09, 0x2D, 0x99, 0x4B, 0x90,
4580 0x13, 0x42, 0x62, 0xBD, 0x70, 0x14, 0x39, 0x23, 0x3A, 0x8A,
4581 0x32, 0x30, 0xEA, 0x66, 0x24, 0x85, 0xAF, 0x0B, 0xD7, 0x72,
4582 0xC4, 0xFC, 0x89, 0xD9, 0xB6, 0x9A, 0x1D, 0xA4, 0x10, 0x50,
4583 0x69, 0x98, 0x8E, 0x00, 0xA1, 0xCF, 0x94, 0x6C, 0x1B, 0x79,
4584 0x3A, 0xB7, 0xD8, 0x86, 0x1C, 0xD1, 0x95, 0x72, 0x0A, 0x3A,
4585 0xDA, 0xEF, 0x26, 0x15, 0xA5, 0xE4, 0x67, 0xD6, 0x04, 0xC5,
4586 0x0A, 0xBA, 0x50, 0x21, 0x9C, 0xB7, 0x1A, 0xF1, 0x1F, 0x1D,
4587 0x90, 0x5A, 0x6E, 0x40, 0xF8, 0xC1, 0xAB, 0xBD, 0x88, 0xA7,
4588 0xB8, 0x25, 0xBD, 0xCB, 0x93, 0xFA, 0x79, 0xAE, 0xAF, 0x1A,
4589 0xBD, 0x7B, 0xC4, 0x9F, 0x89, 0x7C, 0xFF, 0xFB, 0x0E, 0x27,
4590 0x32, 0x20, 0x6D, 0x47, 0x6B, 0x0E, 0x0D, 0xA1, 0x6A, 0x55,
4591 0x7F, 0xFD, 0x73, 0x9B, 0xC5, 0x3F, 0xF8, 0x08, 0xAA, 0xFE,
4592 0x0F, 0x7E, 0xAD, 0xB8, 0x13, 0x50, 0x79, 0x8D, 0x58, 0xAF,
4593 0xB2, 0xC6, 0x66, 0x24, 0xA8, 0x19, 0xD6, 0x90, 0x81, 0x54,
4594 0x92, 0x7B, 0xAF, 0xA8, 0xB8, 0x3D, 0x27, 0xD0, 0xC0, 0x08,
4595 0xB6, 0x45, 0x3D, 0x24, 0x46, 0xA0, 0x04, 0x8A, 0x26, 0x95,
4596 0xCF, 0x3F, 0x3C, 0x31, 0x43, 0x5D, 0xCA, 0x7A, 0xED, 0xF7,
4597 0xD3, 0xB5, 0xA0, 0xEE, 0xDC, 0x97, 0x76, 0xB3, 0x2F, 0x89,
4598 0x18, 0x62, 0xAC, 0x4B, 0x8B, 0xFC, 0x06, 0x1E, 0x15, 0xE5,
4599 0x25, 0x72, 0x46, 0xB9, 0x02, 0xD9, 0x0C, 0x38, 0xCF, 0x82,
4600 0x13, 0x19, 0x6E, 0x18, 0x85, 0xC6, 0x76, 0xF9, 0x10, 0xF9,
4601 0xCD, 0x72, 0x05, 0xED, 0x5E, 0xAE, 0xBB, 0xD2, 0xAB, 0x64,
4602 0x13, 0x3E, 0x9F, 0x20, 0xCF, 0x8C, 0xC0, 0x37, 0x71, 0x38,
4603 0x22, 0x49, 0x38, 0x9C, 0x23, 0xCB, 0x0B, 0xC3, 0xE8, 0xE5,
4604 0xEB, 0x31, 0x61, 0x07, 0xFE, 0x2A, 0xAC, 0xDE, 0x90, 0x35,
4605 0x24, 0xEB, 0x6B, 0xB6, 0x34, 0x51, 0x9C, 0xE2, 0x7D, 0xD0,
4606 0x8B, 0x38, 0xDB, 0x81, 0x7B, 0x24, 0x7B, 0x69, 0x84, 0x1D,
4607 0x17, 0x9F, 0x64, 0x63, 0x6F, 0x3F, 0x43, 0xFC, 0xFE, 0x07,
4608 0x72, 0x66, 0x84, 0xE3, 0xCD, 0x4F, 0x25, 0x70, 0x81, 0x64,
4609 0x66, 0x2C, 0xA8, 0x35, 0x11, 0x1B, 0xF3, 0x03, 0x1B, 0x5B,
4610 0xDC, 0xFB, 0x7D, 0xAD, 0x14, 0x11, 0xC8, 0xB1, 0x0C, 0x7E,
4611 0x36, 0x79, 0x34, 0x79, 0x1A, 0x88, 0x8A, 0x8F, 0xF6, 0x66,
4612 0xB4, 0x95, 0xD4, 0xA1, 0x02, 0xF9, 0x1D, 0x26, 0x53, 0x7A,
4613 0x34, 0x00, 0x36, 0x0E, 0xE7, 0xFB, 0x7A, 0x60, 0xF9, 0xC3,
4614 0xCF, 0x30, 0xCB, 0xF0, 0x27, 0xB5, 0xD6, 0xCF, 0x15, 0x33,
4615 0x53, 0x88, 0x7C, 0x50, 0x07, 0xF4, 0x27, 0xE0, 0x40, 0x47,
4616 0xFE, 0x86, 0x0E, 0xFF, 0x07, 0x5F, 0x55, 0xB8, 0x3B, 0xAA,
4617 0xFB, 0xB0, 0x6B, 0x98, 0x47, 0x59, 0xB8, 0x33, 0xAA, 0x67,
4618 0x6B, 0x36, 0xEB, 0x76, 0x43, 0xAF, 0x31, 0x52, 0x62, 0x3D,
4619 0x7F, 0x64, 0x6A, 0xFC, 0x36, 0x92, 0x96, 0xF8, 0xD9, 0xE7,
4620 0x13, 0x77, 0x1D, 0xD0, 0xFB, 0x0D, 0x70, 0x29, 0x61, 0x52,
4621 0x82, 0xF4, 0xE4, 0xA7, 0x08, 0x47, 0x4C, 0x67, 0xEE, 0x36,
4622 0xD1, 0x1C, 0x18, 0x8B, 0xF1, 0x2D, 0xE2, 0x47, 0x16, 0x4D,
4623 0x1F, 0x05, 0xC6, 0x4E, 0xFB, 0x35, 0x51, 0x3A, 0x9E, 0xF9,
4624 0xE0, 0x1E, 0xC1, 0x64, 0x21, 0x0B, 0x8A, 0xF0, 0x1D, 0x32,
4625 0x78, 0x18, 0xF2, 0xB3, 0xB5, 0xBD, 0x66, 0x6B, 0xAD, 0x92,
4626 0x4F, 0x22, 0xDC, 0xB9, 0xCC, 0xF4, 0x98, 0x22, 0x99, 0xF6,
4627 0x3D, 0xC6, 0x8F, 0x28, 0x77, 0x60, 0x34, 0xD0, 0x73, 0xF5,
4628 0x4D, 0x9F, 0x6C, 0x5D, 0x94, 0xC2, 0x3D, 0x19, 0xCD, 0xC2,
4629 0x18, 0x41, 0x9B, 0x5F, 0x32, 0x2D, 0x5E, 0x3D, 0x92, 0xBE,
4630 0x26, 0x39, 0x85, 0x50, 0xE6, 0xE2, 0x49, 0x17, 0x19, 0xD3,
4631 0x57, 0xAF, 0x45, 0x85, 0x74, 0xF7, 0x16, 0x35, 0x0A, 0x94,
4632 0x54, 0x64, 0x45, 0xD5, 0x31, 0x51, 0x49, 0x8F, 0xA4, 0x4C,
4633 0x33, 0xBB, 0x62, 0x59, 0x6B, 0x08, 0xBD, 0x1C, 0xDD, 0x38,
4634 0x93, 0x22, 0x0B, 0xCF, 0x9B, 0x23, 0x87, 0x30, 0xA2, 0xA0,
4635 0x6D, 0x97, 0x2D, 0xD7, 0x2B, 0x16, 0x88, 0x72, 0x01, 0x9A,
4636 0x51, 0xBA, 0x56, 0xCE, 0xDC, 0xDD, 0xF9, 0x87, 0x41, 0xC8,
4637 0x44, 0xF1, 0xA2, 0x20, 0x9A, 0x11, 0x44, 0x13, 0xDF, 0x49,

NetBurner, Inc.
22.205 certs_test.h 1147

4638 0x04, 0x85, 0x4C, 0x01, 0x46, 0x3E, 0xD6, 0xB8, 0xE2, 0xC2,
4639 0x2E, 0xED, 0xA4, 0x07, 0x29, 0x89, 0xA2, 0x46, 0x23, 0x98,
4640 0xA5, 0xEF, 0x59, 0x1A, 0xE7, 0x67, 0x64, 0x59, 0xF7, 0x2C,
4641 0x5B, 0x30, 0x29, 0x57, 0xE3, 0xDE, 0x5C, 0x84, 0x1B, 0x8F,
4642 0x3E, 0xB3, 0x5B, 0xF5, 0x0C, 0x6E, 0xB1, 0x4E, 0x2F, 0xB6,
4643 0xB6, 0x5B, 0x29, 0xCD, 0xBB, 0xB8, 0xC9, 0xF0, 0x39, 0xF9,
4644 0xB9, 0x11, 0x47, 0xEF, 0xF8, 0x90, 0xE0, 0x0F, 0x91, 0x70,
4645 0x97, 0xB4, 0xFC, 0xFD, 0xB5, 0x69, 0x8C, 0x61, 0x9A, 0x26,
4646 0xD2, 0xC9, 0x47, 0x67, 0xB7, 0xDB, 0x73, 0x11, 0xA3, 0xC1,
4647 0x3B, 0x4E, 0x5F, 0x60, 0xDA, 0x73, 0x39, 0x9B, 0xD4, 0x3D,
4648 0x24, 0xA6, 0x8A, 0xB5, 0x56, 0x5D, 0xBD, 0x27, 0xDE, 0x6C,
4649 0x67, 0xA1, 0x4A, 0x77, 0xB7, 0x44, 0x1D, 0x28, 0x44, 0xA0,
4650 0xA3, 0xF2, 0xEB, 0x3A, 0x9F, 0xE5, 0x5C, 0xF5, 0xE3, 0xFE,
4651 0xD0, 0xC3, 0xCA, 0x2A, 0x1A, 0x72, 0x86, 0xB3, 0x4E, 0x9D,
4652 0x25, 0x0B, 0x4C, 0xFF, 0x45, 0xB7, 0xDE, 0xE8, 0x8C, 0x0A,
4653 0x06, 0xED, 0x30, 0x26, 0x8F, 0xA1, 0xBF, 0x74, 0x22, 0x3D,
4654 0x50, 0x39, 0x17, 0xA9, 0x6B, 0x7C, 0xAC, 0xA0, 0x6A, 0xEA,
4655 0x14, 0x95, 0x5F, 0xAD, 0x3C, 0xB1, 0x4E, 0xE1, 0x30, 0x2F,
4656 0x4A, 0x77, 0x72, 0xC1, 0x1F, 0x4C, 0x91, 0x6B, 0xCF, 0x81,
4657 0x46, 0xAF, 0x2D, 0xEC, 0x59, 0x9E, 0x99, 0xD9, 0x60, 0x23,
4658 0x95, 0x08, 0x0D, 0xBB, 0xFD, 0xEC, 0x2A, 0xF7, 0x7B, 0x73,
4659 0x53, 0xF3, 0x88, 0xB7, 0xAF, 0x51, 0x69, 0xD5, 0x08, 0xFC,
4660 0xCC, 0x03, 0xD3, 0x61, 0x5C, 0xDD, 0x39, 0x56, 0x6B, 0xE4,
4661 0xEE, 0x1F, 0x0A, 0xD6, 0x1A, 0x84, 0x65, 0x45, 0x0C, 0x0A,
4662 0x34, 0xDE, 0x96, 0x24, 0xBB, 0x74, 0xF4, 0xB7, 0xE5, 0x2F,
4663 0xB5, 0x1F, 0x85, 0x9D, 0xD7, 0xEA, 0xB3, 0x33, 0xBE, 0xCF,
4664 0x19, 0x45, 0xCE, 0xF9, 0x13, 0xF5, 0xFD, 0x65, 0x5D, 0xBB,
4665 0xDB, 0x64, 0x94, 0xAC, 0xB8, 0x39, 0xAF, 0x9B, 0x56, 0xE4,
4666 0x5C, 0x95, 0x85, 0xFD, 0xB3, 0xF8, 0x3C, 0x98, 0xD3, 0x58,
4667 0xCE, 0xAB, 0x09, 0x0E, 0xA7, 0x42, 0x9B, 0x16, 0xA7, 0x63,
4668 0xEB, 0xB8, 0x7C, 0x01, 0xA2, 0xD4, 0x3C, 0x2B, 0xA7, 0xA3,
4669 0x52, 0x8C, 0x08, 0xA5, 0xA9, 0xAF, 0x63, 0x07, 0xDA, 0x45,
4670 0x86, 0x91, 0x64, 0xE6, 0x41, 0x75, 0x78, 0x46, 0x6F, 0xB9,
4671 0xB4, 0xEA, 0x6A, 0xDD, 0xC7, 0x1A, 0x1F, 0xC0, 0x8A, 0x00,
4672 0x81, 0x70, 0x74, 0x37, 0xC8, 0x84, 0x3F, 0xA8, 0xC9, 0xC1,
4673 0xC1, 0x60, 0x2B, 0x25, 0x9B, 0x66, 0x5F, 0x73, 0x15, 0x51,
4674 0xE2, 0xE4, 0x49, 0x5B, 0xEE, 0x20, 0xC8, 0x18, 0xE7, 0x65,
4675 0xED, 0x29, 0xEA, 0x96, 0x85, 0xB5, 0x63, 0xFB, 0xA6, 0x23,
4676 0x22, 0xB7, 0x4F, 0x6E, 0xE3, 0xF2, 0x9C, 0x01, 0x23, 0x7A,
4677 0xB9, 0x16, 0x2A, 0x93, 0xAF, 0x4F, 0xEA, 0x05, 0x15, 0x84,
4678 0x46, 0x32, 0x2F, 0x99, 0xB8, 0x78, 0x20, 0x78, 0x93, 0xC9,
4679 0x42, 0x6D, 0xBC, 0x70, 0xCE, 0x88, 0x6F, 0x12, 0x92, 0x3F,
4680 0xDE, 0xFB, 0xDE, 0x8E, 0xD3, 0x69, 0x09, 0x54, 0x7D, 0x0A,
4681 0xE1, 0x93, 0x3D, 0x10, 0x04, 0xDE, 0x66, 0x9D, 0x2D, 0xAD,
4682 0xA4, 0x53, 0x4C, 0xF6, 0xFC, 0x08, 0xE4, 0x58, 0x05, 0x09,
4683 0x78, 0x09, 0xE6, 0xF3, 0xEE, 0x83, 0xC2, 0xD0, 0xA9, 0x04,
4684 0xE6, 0xAC, 0x30, 0xD7, 0x34, 0x52, 0xEB, 0xCD, 0x1A, 0x7E,
4685 0xB9, 0xCF, 0x18, 0x68, 0x16, 0xB9, 0x9A, 0x18, 0xDA, 0xC8,
4686 0xE3, 0x1C, 0xF0, 0x9A, 0x2E, 0x64, 0x28, 0xBE, 0xA4, 0x9F,
4687 0xCB, 0xC0, 0x53, 0xE6, 0x2A, 0x88, 0xB5, 0xE7, 0xF3, 0x6F,
4688 0x46, 0x1C, 0xBA, 0xAD, 0x76, 0x17, 0x85, 0xAE, 0x95, 0x13,
4689 0x7B, 0xF9, 0xB8, 0xD3, 0x08, 0x6A, 0x38, 0x63, 0x67, 0xD8,
4690 0x8B, 0x51, 0x8F, 0x49, 0x44, 0xB4, 0x10, 0xB8, 0x74, 0x38,
4691 0xDD, 0x17, 0xEA, 0x52, 0x67, 0xB2, 0xCC, 0xC9, 0x77, 0xDD,
4692 0x44, 0x2E, 0xDF, 0x03, 0xC7, 0xF4, 0x87, 0xF4, 0xBC, 0x6F,
4693 0x94, 0x9F, 0x58, 0xDB, 0xE2, 0x09, 0xA1, 0x4C, 0xCA, 0x89,
4694 0x9D, 0x04, 0x5A, 0xAB, 0xDF, 0x8B, 0x82, 0x3F, 0x0E, 0xF2,
4695 0xE7, 0xBD, 0x9A, 0x16, 0x3A, 0xAF, 0x72, 0x18, 0xB9, 0x47,
4696 0xB3, 0xBC, 0xFE, 0x84, 0x43, 0x92, 0x98, 0xF4, 0x3A, 0x49,
4697 0x3A, 0x26, 0xB7, 0xF3, 0x37, 0x54, 0x06, 0xD8, 0x92, 0x09,
4698 0xE6, 0xFE, 0x9A, 0xDB, 0x68, 0x16, 0x6F, 0x5D, 0x5D, 0x8E,
4699 0xBB, 0xFC, 0xAC, 0x5A, 0x72, 0xFE, 0x0B, 0xEB, 0xDB, 0x90,
4700 0xA4, 0x6C, 0x37, 0x1A, 0x8B, 0x5A, 0xD8, 0xE9, 0xF6, 0x15,
4701 0xFC, 0x54, 0x1B, 0x95, 0xE3, 0xAE, 0x08, 0x46, 0xB5, 0xFB,
4702 0xC5, 0x66, 0xC5, 0x79, 0x17, 0x9D, 0x5C, 0x45, 0xE5, 0x4E,
4703 0xFF, 0xA2, 0x86, 0xD7, 0x4F, 0xD4, 0x1D, 0x17, 0xA3, 0x77,
4704 0x00, 0x54, 0x70, 0xDF, 0x12, 0xCA, 0xD6, 0x71, 0x05, 0x54,
4705 0xFA, 0x47, 0x96, 0x38, 0x2D, 0x4D, 0x70, 0x3E, 0x2E, 0x40,
4706 0xE7, 0x52, 0x32, 0x66, 0x4D, 0x92, 0x1B, 0x76, 0x66, 0xF1,
4707 0xD4, 0x38, 0x8B, 0x76, 0x47, 0xE1, 0x66, 0xDE, 0xA2, 0x06,
4708 0xD7, 0xA7, 0x96, 0x52, 0xED, 0xC9, 0xF3, 0xD6, 0x99, 0xDF,
4709 0x2F, 0x98, 0xC5, 0xBF, 0x16, 0x95, 0x80, 0x41, 0xE4, 0xEB,
4710 0x8B, 0x16, 0xEF, 0x6A, 0x76, 0x84, 0xE7, 0x5F, 0x6C, 0xBD,
4711 0x1D, 0x2A, 0x74, 0x08, 0x5B, 0x4E, 0xCA, 0xE1, 0xF5, 0xD0,
4712 0x42, 0x2C, 0x03, 0x9B, 0x80, 0xBD, 0x05, 0x5F, 0x87, 0xF0,
4713 0x84, 0x08, 0x96, 0xBE, 0xAC, 0xBF, 0xF1, 0x8F, 0x51, 0x69,
4714 0x9E, 0xC2, 0xE9, 0x96, 0x9D, 0x97, 0xCD, 0x56, 0x32, 0x29,
4715 0xC8, 0x53, 0xC2, 0x1A, 0x5A, 0xD3, 0xDA, 0x31, 0x94, 0x09,
4716 0x35, 0x08, 0x75, 0x27, 0x66, 0xC5, 0x10, 0x5F, 0xD1, 0x94,
4717 0x12, 0x03, 0x8A, 0x1B, 0x69, 0x81, 0xEB, 0xBE, 0xBC, 0x6B,
4718 0xE4, 0xB9, 0x84, 0x65, 0x7D, 0xE3, 0xFE, 0xFB, 0x45, 0x58,
4719 0x31, 0xF3, 0x66, 0x13, 0x64, 0xB2, 0xBD, 0xBC, 0xF6, 0xA5,
4720 0x07, 0x07, 0x8A, 0xC8, 0x43, 0xCA, 0x38, 0x94, 0x70, 0xC0,
4721 0x25, 0xDA, 0xC6, 0xD9, 0x74, 0x5A, 0x60, 0xE3, 0x9D, 0x74,
4722 0x6C, 0x72, 0xF5, 0xAF, 0xD3, 0xD7, 0xF5, 0xBD, 0x17, 0x02,
4723 0xE5, 0x17, 0xEC, 0xBD, 0xCB, 0x5D, 0x1A, 0x8F, 0x39, 0x31,
4724 0x7E, 0x4B, 0x1F, 0x1A, 0x87, 0xE2, 0x69, 0x65, 0x07, 0x42,

NetBurner, Inc.
1148 File Documentation

4725 0x6D, 0xD2, 0x2D, 0x04, 0x52, 0x51, 0xA7, 0xF2, 0x23, 0xC6,
4726 0x01, 0xD1, 0x47, 0x5F, 0x42, 0x44, 0x2A, 0x88, 0x5E, 0xBB,
4727 0x98, 0x5A, 0x34, 0xBB, 0x0E, 0x05, 0xA7, 0x1D, 0x7E, 0xFB,
4728 0x3E, 0x85, 0xD8, 0x74, 0x70, 0xE8, 0x71, 0xC2, 0x31, 0x80,
4729 0x37, 0xF9, 0x15, 0xA4, 0xC1, 0xFC, 0x9B, 0x68, 0x2B, 0x54,
4730 0x9B, 0x37, 0x9C, 0xE7, 0x62, 0x80, 0x20, 0x1E, 0x27, 0x78,
4731 0xBF, 0x11, 0xC4, 0x86, 0xAC, 0x7B, 0x34, 0x57, 0x76, 0x86,
4732 0x77, 0x15, 0x51, 0x7C, 0xDC, 0x32, 0xDF, 0x48, 0xB9, 0xC6,
4733 0x63, 0xC6, 0x9A, 0xDE, 0x5E, 0x9D, 0xAB, 0x4A, 0x92, 0xEE,
4734 0x0C, 0x10, 0x7E, 0xB5, 0x33, 0x17, 0xF6, 0x0C, 0x8D, 0x26,
4735 0x89, 0xCD, 0x2B, 0xB8, 0x49, 0x4A, 0x4D, 0x5D, 0x66, 0x38,
4736 0x86, 0x42, 0x37, 0xC5, 0x1B, 0xE7, 0x78, 0x90, 0x21, 0xAE,
4737 0x8F, 0xE7, 0x0C, 0x01, 0xB9, 0x31, 0x6A, 0x50, 0x1A, 0x2B,
4738 0xDA, 0xC2, 0x99, 0xCB, 0xEB, 0xF9, 0xAE, 0x91, 0x8B, 0xB7,
4739 0x08, 0x01, 0x1E, 0xCC, 0x9E, 0x20, 0x05, 0xEC, 0x45, 0x21,
4740 0xBE, 0xDE, 0xFE, 0x06, 0x7D, 0x92, 0x9C, 0xE7, 0x47, 0xD9,
4741 0x85, 0x63, 0xC3, 0xBB, 0x38, 0x15, 0x2D, 0x94, 0xCA, 0xAF,
4742 0xCF, 0xCA, 0x1D, 0x53, 0x1A, 0xBD, 0x23, 0xF1, 0x87, 0x99,
4743 0x24, 0xF3, 0x16, 0xE9, 0x7F, 0xBE, 0x00, 0x8A, 0x61, 0xA7,
4744 0x65, 0xF7, 0xA9, 0x53, 0x2A, 0x29, 0x20, 0x3E, 0x0B, 0xCF,
4745 0x12, 0x69, 0x22, 0x84, 0x27, 0x5D, 0x1C, 0xC8, 0x45, 0xA1,
4746 0xA5, 0x5A, 0xB0, 0xDB, 0x95, 0x5D, 0xF7, 0xCE, 0xAC, 0x98,
4747 0x44, 0x3B, 0xE1, 0x27, 0x9A, 0x93, 0x5D, 0x2B, 0x8A, 0x20,
4748 0xB1, 0x82, 0x2C, 0xDD, 0xB8, 0xCC, 0xFA, 0x77, 0x0F, 0xA7,
4749 0x80, 0x00, 0x87, 0x54, 0x1C, 0xCC, 0x0B, 0x1E, 0xF6, 0x52,
4750 0x89, 0x03, 0x65, 0x83, 0xF1, 0x97, 0x4E, 0x81, 0x99, 0xE1,
4751 0xDD, 0x73, 0x30, 0x31, 0xEC, 0xA7, 0xD5, 0x76, 0x28, 0xC3,
4752 0xCE, 0x29, 0x30, 0x7B, 0xB1, 0x27, 0x3F, 0xC4, 0x6D, 0x54,
4753 0xAF, 0xE2, 0x84, 0xEA, 0xF5, 0x91, 0xBD, 0xB9, 0x6C, 0x4E,
4754 0x98, 0x0F, 0xFB, 0xDE, 0x7C, 0x32, 0xF8, 0xED, 0xEF, 0xD0,
4755 0xE9, 0xA3, 0x57, 0xC0, 0x91, 0x06, 0x4C, 0x43, 0x3F, 0x32,
4756 0x21, 0xB5, 0xF2, 0x11, 0x5A, 0xDF, 0xFC, 0x7E, 0x91, 0x10,
4757 0xC0, 0x4D, 0xD4, 0x4E, 0xA8, 0x38, 0xD6, 0xE0, 0xB6, 0x27,
4758 0x38, 0x63, 0xF2, 0xD3, 0xFD, 0x68, 0x4C, 0xDD, 0x76, 0xA9,
4759 0x89, 0xCE, 0xBE, 0x7C, 0xAD, 0x45, 0x4C, 0x8C, 0x24, 0xCC,
4760 0x32, 0x66, 0x3A, 0x1A, 0x45, 0xDA, 0x47, 0x5C, 0x4C, 0xC6,
4761 0x8A, 0x9A, 0xC3, 0x99, 0xFB, 0x4C, 0x94, 0xE2, 0x20, 0xD7,
4762 0xE4, 0x37, 0x22, 0x99, 0x32, 0x6F, 0xFB, 0x1C, 0xE5, 0x9B,
4763 0xB5, 0xFC, 0xBD, 0xD2, 0xA1, 0xDD, 0x66, 0xD5, 0x47, 0x2F,
4764 0x6A, 0xAA, 0x50, 0xF5, 0xE8, 0x1A, 0xDC, 0x74, 0x50, 0x6A,
4765 0x92, 0x23, 0x93, 0xED, 0xB0, 0x58, 0x61, 0x7D, 0xB6, 0x5C,
4766 0x22, 0x7B, 0x54, 0x75, 0xF0, 0x69, 0xD4, 0x27, 0x0B, 0x70,
4767 0x3F, 0xBB, 0x76, 0x63, 0xB3, 0x1D, 0x7E, 0x33, 0x96, 0xD6,
4768 0x84, 0x2D, 0x28, 0x4F, 0x97, 0x65, 0xC9, 0x95, 0xCF, 0x30,
4769 0xBA, 0xEA, 0x08, 0xF5, 0xC6, 0x24, 0x45, 0x20, 0x85, 0x67,
4770 0x9F, 0x34, 0x37, 0x72, 0x44, 0x17, 0x98, 0x5F, 0xD0, 0xCE,
4771 0xA8, 0x6E, 0x0E, 0x50, 0x22, 0x14, 0xE1, 0x6B, 0xCB, 0xA5,
4772 0x12, 0x2A, 0x36, 0xF1, 0x6E, 0x81, 0x5C, 0x5A, 0x77, 0x4F,
4773 0xD7, 0xF9, 0xCE, 0x7A, 0xC9, 0x30, 0x2C, 0x1E, 0x7E, 0xFC,
4774 0x24, 0xCB, 0xE4, 0x53, 0xC3, 0x4A, 0x03, 0xED, 0xD5, 0x77,
4775 0xC6, 0x55, 0xEB, 0xA2, 0xB4, 0x92, 0x35, 0xE3, 0x20, 0xDA,
4776 0xD2, 0x58, 0xE2, 0xCC, 0xC4, 0x4E, 0xBB, 0xE3, 0x8F, 0x75,
4777 0xB1, 0xDB, 0x97, 0x15, 0x86, 0x43, 0xE5, 0xD4, 0x4F, 0x44,
4778 0x3F, 0x20, 0xE3, 0xB9, 0xA5, 0xFB, 0x3F, 0x36, 0xC9, 0x9C,
4779 0xEF, 0x8C, 0xD1, 0x46, 0x67, 0x16, 0xB6, 0xA6, 0x24, 0x8A,
4780 0xE9, 0xD7, 0x29, 0x4B, 0x5F, 0x7C, 0x06, 0xEF, 0xD7, 0xBB,
4781 0x88, 0xCB, 0x2C, 0xFB, 0x85, 0x19, 0x9F, 0x97, 0x74, 0xFE,
4782 0x76, 0x46, 0x44, 0x1E, 0xAD, 0xF3, 0x62, 0xD2, 0xAA, 0x24,
4783 0x37, 0xD0, 0x1E, 0xF3, 0xCB, 0x68, 0xE3, 0x17, 0xFF, 0x81,
4784 0x90, 0xA3, 0xD6, 0x28, 0xE6, 0xCE, 0x6D, 0x99, 0xF4, 0x2D,
4785 0xC6, 0xAE, 0x40, 0x52, 0x32, 0xE9, 0xC1, 0xC6, 0x79, 0x5C,
4786 0xF7, 0x69, 0x29, 0x0C, 0x75, 0x9F, 0x48, 0x57, 0x75, 0x1F,
4787 0x2F, 0x71, 0x9F, 0x24, 0x90, 0x14, 0xAE, 0xDC, 0x75, 0x2E,
4788 0x5E, 0xDD, 0x85, 0xE5, 0x6C, 0xC4, 0x72, 0x58, 0xF0, 0x35,
4789 0xDC, 0xFE, 0x03, 0xB7, 0x2F, 0xBD, 0xC3, 0x8A, 0xA3, 0x2C,
4790 0x62, 0xE0, 0xCD, 0x37, 0xFA, 0x9E, 0x11, 0xC0, 0x1D, 0xEF,
4791 0xB0, 0x58, 0x58, 0x12, 0xAF, 0x25, 0x6D, 0x75, 0x0D, 0x2F,
4792 0xBC, 0x89, 0xE9, 0x2E, 0x1E, 0x58, 0x64, 0x35, 0xA8, 0x90,
4793 0xC2, 0x61, 0x4D, 0xCE, 0x96, 0xC5, 0xF2, 0x37, 0xBD, 0xB8,
4794 0xDE, 0xB4, 0x0E, 0xEB, 0xDD, 0xED, 0xE6, 0x47, 0x24, 0xE6,
4795 0x36, 0xC9, 0x22, 0xD3, 0xE7, 0x1A, 0xEF, 0x9E, 0x16, 0x89,
4796 0xB9, 0x5C, 0xF4, 0x3B, 0x09, 0x7E, 0x9B, 0x87, 0x7F, 0xD6,
4797 0x84, 0x06, 0xCA, 0x0E, 0xA8, 0x54, 0x79, 0xCF, 0x02, 0xF6,
4798 0x1B, 0x57, 0x34, 0x9D, 0x97, 0x00, 0x05, 0x8B, 0x75, 0xA3,
4799 0x5C, 0x7C, 0xBA, 0xA7, 0x51, 0x85, 0xBC, 0xE6, 0xAC, 0xD9,
4800 0xD4, 0x31, 0xB3, 0x3A, 0xBD, 0x82, 0xC8, 0x60, 0x74, 0x46,
4801 0xA9, 0x2F, 0xC2, 0x29, 0x08, 0x59, 0x6B, 0x14, 0x19, 0x19,
4802 0x39, 0x7F, 0x8B, 0xA2, 0x2A, 0xFD, 0xE3, 0x09, 0x72, 0x50,
4803 0x74, 0x88, 0xEE, 0xC6, 0xED, 0x28, 0x37, 0xCD, 0xA9, 0xBA,
4804 0x2E, 0xFE, 0x07, 0xDF, 0x5E, 0xF9, 0x18, 0xB4, 0x0E, 0xBF,
4805 0x9C, 0x1C, 0xCA, 0x84, 0xBA, 0x62, 0xB9, 0xA2, 0x96, 0x76,
4806 0xB6, 0xB7, 0x77, 0x9C, 0xBE, 0x0C, 0xF8, 0xA5, 0xEF, 0x74,
4807 0xB1, 0xC2, 0x85, 0xCD, 0xD1, 0x25, 0xD5, 0xFC, 0xFB, 0x2C,
4808 0xC7, 0xD6, 0x2F, 0x30, 0x3F, 0x10, 0xEA, 0xA2, 0x99, 0xC4,
4809 0x22, 0x58, 0xB3, 0xC4, 0x46, 0x3C, 0x41, 0xE9, 0xE9, 0xA0,
4810 0x39, 0x6C, 0x09, 0x89, 0xE3, 0xAE, 0x4E, 0x35, 0xAB, 0x27,
4811 0x71, 0x43, 0xEB, 0xA7, 0xFA, 0x68, 0xA8, 0x42, 0x49, 0x3C,

NetBurner, Inc.
22.205 certs_test.h 1149

4812 0x53, 0x70, 0x35, 0xCA, 0x14, 0xB7, 0x1D, 0xF8, 0x7E, 0x65,
4813 0x05, 0x33, 0xE3, 0x5A, 0x86, 0xCD, 0xA5, 0x18, 0x02, 0x24,
4814 0x23, 0xAD, 0x52, 0x6A, 0x47, 0x13, 0x14, 0x95, 0xD2, 0xF1,
4815 0xE1, 0x6F, 0x61, 0x70, 0x4F, 0xDC, 0x1A, 0x03, 0x0E, 0xD7,
4816 0x07, 0xBD, 0x84, 0x43, 0x65, 0x76, 0x9F, 0xFB, 0x1E, 0x89,
4817 0xEB, 0x92, 0x5E, 0xDE, 0x5B, 0xAA, 0x54, 0xEE, 0x0A, 0xF5,
4818 0x4A, 0x79, 0x46, 0xDA, 0xC1, 0xEC, 0x2F, 0xBC, 0xDD, 0xE5,
4819 0x61, 0xFA, 0xED, 0xB6, 0x97, 0x9C, 0x90, 0xD8, 0xF3, 0x2E,
4820 0x04, 0xCF, 0xB5, 0x89, 0x74, 0xC2, 0xD1, 0x70, 0xE0, 0x0F,
4821 0x53, 0x14, 0x09, 0x6A, 0x19, 0x5A, 0x65, 0xAC, 0xAA, 0x3C,
4822 0x25, 0x79, 0x43, 0x27, 0x47, 0x18, 0x19, 0x7A, 0x74, 0xD7,
4823 0x73, 0x43, 0xBD, 0x50, 0x1F, 0x68, 0xAF, 0xDF, 0x3E, 0x2A,
4824 0xC4, 0xDC, 0x6F, 0x85, 0x2A, 0xBC, 0x0F, 0x39, 0x4B, 0x97,
4825 0x6D, 0x2D, 0x87, 0x5F, 0x9A, 0x07, 0x82, 0xC7, 0x69, 0xB9,
4826 0xF2, 0xEF, 0xE3, 0x3C, 0x3C, 0x74, 0xB2, 0xFD, 0x81, 0x6F,
4827 0xC3, 0xAC, 0x93, 0x22, 0x49, 0xB5, 0x73, 0x5C, 0x58, 0x6E,
4828 0x5F, 0x7A, 0x6B, 0x91, 0x02, 0x25, 0x3B, 0xC8, 0x24, 0xD7,
4829 0xEF, 0xC8, 0x10, 0xD7, 0x54, 0xD4, 0xA7, 0xC1, 0x88, 0x77,
4830 0xDD, 0xCD, 0x3A, 0x92, 0xE5, 0x1D, 0xA1, 0x33, 0x10, 0xA4,
4831 0xF6, 0xB4, 0x43, 0xA4, 0xDB, 0x77, 0x4C, 0x91, 0x7C, 0xED,
4832 0xDD, 0xC7, 0xB9, 0x5A, 0xB4, 0x2A, 0x6C, 0x78, 0x54, 0xCA,
4833 0xBD, 0x16, 0x0C, 0x8C, 0x68, 0xE8, 0xBC, 0xDE, 0x65, 0x2F,
4834 0xAF, 0xEF, 0x09, 0xDC, 0x7C, 0x17, 0x7D, 0x05, 0xF7, 0xB1,
4835 0x8D, 0x09, 0x94, 0xDC, 0xF2, 0xAE, 0xF4, 0x21, 0x54, 0xF9,
4836 0x3E, 0xB0, 0x2A, 0x73, 0xFE, 0x9C, 0x51, 0xEB, 0x1E, 0x7B,
4837 0xFE, 0x65, 0xCB, 0x53, 0x80, 0x5B, 0xD2, 0x05, 0xA1, 0xE9,
4838 0xCB, 0x75, 0x60, 0x46, 0x08, 0x07, 0x83, 0x27, 0x4E, 0xD4,
4839 0xBF, 0x70, 0x83, 0xDE, 0xA9, 0xB4, 0x22, 0x55, 0xF1, 0x5F,
4840 0x91, 0x88, 0x4A, 0x43, 0xC1, 0xBF, 0x0A, 0xEF, 0xA7, 0xFF,
4841 0xE5, 0xA6, 0x50, 0xDD, 0xFD, 0x6E, 0x22, 0xFF, 0xC1, 0x55,
4842 0x82, 0x0B, 0x42, 0x86, 0x42, 0xA7, 0x91, 0xD3, 0x62, 0x69,
4843 0xB2, 0x8D, 0x11, 0xC5, 0xB8, 0x4F, 0xBF, 0x4D, 0xFE, 0x37,
4844 0x12, 0x1F, 0xBF, 0xDE, 0xA5, 0x86, 0xAD, 0xC7, 0x2C, 0x7F,
4845 0x27, 0x01, 0xB0, 0xA1, 0xED, 0x7D, 0xCE, 0x33, 0x68, 0x97,
4846 0x2E, 0xA4, 0xF4, 0xEE, 0xA4, 0x36, 0x67, 0xE3, 0xAB, 0x89,
4847 0xF8, 0xCE, 0xF7, 0x01, 0xB1, 0x83, 0xFB, 0x54, 0xAA, 0x69,
4848 0x05, 0x76, 0x24, 0xD9, 0x76, 0x9F, 0xA3, 0x9C, 0x52, 0x8C,
4849 0x2E, 0x27, 0xB9, 0xA3, 0x6E, 0xE2, 0xC0, 0x02, 0x09, 0xC6,
4850 0x18, 0xAD, 0x42, 0x88, 0x6B, 0x2F, 0x5D, 0xB4, 0xF7, 0xC6,
4851 0xB4, 0x18, 0xB7, 0x88, 0x0B, 0x81, 0x2C, 0x25, 0xCE, 0xC3,
4852 0x7E, 0x9E, 0xAE, 0xBB, 0x35, 0x3C, 0xEC, 0x78, 0x46, 0x8F,
4853 0x03, 0x16, 0x5E, 0x5B, 0x08, 0x63, 0xFB, 0xBC, 0x78, 0x75,
4854 0xAB, 0x07, 0x1A, 0xA7, 0x96, 0x41, 0xCD, 0xDC, 0x3B, 0x59,
4855 0xDB, 0x02, 0xBE, 0x42, 0x09, 0xF5, 0x87, 0x96, 0x5D, 0x63,
4856 0xC9, 0x8E, 0x06, 0xA2, 0xFF, 0xCE, 0xCD, 0xF3, 0xDE, 0x93,
4857 0x79, 0x63, 0x92, 0xD2, 0xB9, 0x1D, 0x76, 0x7E, 0x4F, 0x36,
4858 0x2A, 0x89, 0x7B, 0x93, 0xC1, 0x35, 0x0A, 0x83, 0x8B, 0xD6,
4859 0xF4, 0xEA, 0x2A, 0x72, 0xA9, 0xE7, 0x6A, 0x77, 0x43, 0x14,
4860 0x49, 0x5B, 0x01, 0xD9, 0xE7, 0x72, 0x15, 0xD9, 0x9C, 0xBE,
4861 0x87, 0x90, 0x2A, 0x7F, 0x68, 0x02, 0x1C, 0xB5, 0xA1, 0xC6,
4862 0x7B, 0x24, 0x49, 0xBF, 0x8E, 0x3D, 0xE0, 0xBA, 0x1C, 0x78,
4863 0x0A, 0x7C, 0x69, 0x82, 0xA1, 0x2F, 0xB6, 0x52, 0xC5, 0x25,
4864 0xD8, 0x9D, 0x4B, 0x38, 0xAA, 0xBA, 0xF7, 0x4C, 0xC4, 0xC2,
4865 0xAE, 0xED, 0x6C, 0x28, 0x1C, 0x76, 0xA9, 0x96, 0x08, 0xAB,
4866 0xC4, 0x15, 0xBC, 0x3E, 0xD7, 0xCC, 0xC4, 0xA2, 0xD4, 0x93,
4867 0xD1, 0x3A, 0xF4, 0x2F, 0x17, 0xDB, 0x1C, 0xBD, 0xCA, 0x0D,
4868 0x5C, 0xF9, 0x69, 0x32, 0xAF, 0xC5, 0x27, 0x37, 0xFC, 0x1B,
4869 0xBB, 0x8A, 0x5D, 0x41, 0xA9, 0xC7, 0xE7, 0xC5, 0x2E, 0x78,
4870 0xE3, 0x7A, 0x5A, 0x25, 0x49, 0x2A, 0x06, 0x3D, 0x15, 0x58,
4871 0x56, 0xFB, 0x66, 0xEC, 0x30, 0x7D, 0xF4, 0x02, 0xF3, 0x53,
4872 0x3D, 0x0D, 0xDD, 0xFE, 0xB5, 0x66, 0xB0, 0xD0, 0xAA, 0x0E,
4873 0x6A, 0x76, 0xA6, 0xAB, 0x87, 0x14, 0xFB, 0x47, 0xAC, 0x26,
4874 0x53, 0xA9, 0x2C, 0xF3, 0xD5, 0xA6, 0x4F, 0xF0, 0x3A, 0x7E,
4875 0x78, 0xC5, 0x69, 0x1F, 0xB7, 0xDC, 0xC4, 0xE8, 0xD7, 0x44,
4876 0x7B, 0xB2, 0xC4, 0x50, 0x68, 0xF4, 0x33, 0xFC, 0x65, 0x0D,
4877 0xDC, 0xCD, 0x71, 0xCB, 0x9C, 0x65, 0x3B, 0x72, 0xB7, 0x19,
4878 0x70, 0x45, 0xA7, 0x36, 0xA4, 0xCF, 0xE7, 0x6F, 0xC8, 0xF9,
4879 0x67, 0x52, 0x22, 0x8F, 0x8F, 0x64, 0x89, 0xD3, 0x3E, 0x50,
4880 0xCC, 0xBE, 0x2B, 0xF3, 0x0A, 0x22, 0x96, 0x33, 0x56, 0x30,
4881 0x27, 0x3F, 0x42, 0xDE, 0x69, 0xA3, 0x63, 0xDE, 0x41, 0x94,
4882 0x02, 0x97, 0x9D, 0x58, 0xF3, 0x27, 0xE3, 0xFE, 0x94, 0x10,
4883 0x20, 0x55, 0x52, 0xD2, 0x46, 0xFB, 0x5E, 0x8C, 0xDF, 0x71,
4884 0x9B, 0xBF, 0x33, 0x79, 0x7C, 0xF3, 0x78, 0xA3, 0x75, 0x84,
4885 0x6C, 0x13, 0xEF, 0xC0, 0x43, 0x82, 0xAC, 0xF0, 0x97, 0x7D,
4886 0x2A, 0xBC, 0xA3, 0xB7, 0xCD, 0x4C, 0x99, 0xB9, 0xB1, 0xE9,
4887 0x38, 0x5C, 0x97, 0xB3, 0xC0, 0x2C, 0xBD, 0x6F, 0xF7, 0x14,
4888 0x26, 0x3A, 0x27, 0x31, 0x52, 0x81, 0x04, 0x88, 0xE6, 0xD8,
4889 0x43, 0x21, 0x78, 0x87, 0x7C, 0x7E, 0x28, 0x26, 0x4F, 0x93,
4890 0x9D, 0x7B, 0x2D, 0x02, 0x6E, 0x91, 0x74, 0xD9, 0x2C, 0xF7,
4891 0x43, 0xD8, 0x66, 0x81, 0x91, 0x21, 0xA1, 0xEE, 0xBC, 0x78,
4892 0x71, 0x80, 0x78, 0x54, 0x16, 0x59, 0x37, 0xB8, 0x69, 0xD3,
4893 0x49, 0x40, 0xAB, 0x03, 0x47, 0x36, 0xFD, 0x5D, 0x60, 0x57,
4894 0x8F, 0xBE, 0xA8, 0xA0, 0x21, 0x38, 0x43, 0xA9, 0x5C, 0x9F,
4895 0xAD, 0xD8, 0xAE, 0x97, 0xA3, 0x0F, 0xFC, 0xE4, 0x4A, 0xCF,
4896 0x9F, 0xE9, 0x75, 0x3D, 0x60, 0x91, 0x55, 0x5C, 0x0A, 0xB9,
4897 0x18, 0xEF, 0xD4, 0x08, 0x58, 0x06, 0x64, 0xA1, 0x45, 0xA7,
4898 0x5D, 0x3F, 0x13, 0x87, 0x49, 0x76, 0x8B, 0x1B, 0x54, 0x9C,

NetBurner, Inc.
1150 File Documentation

4899 0x61, 0x05, 0xC6, 0x2C, 0xED, 0x24, 0x1B, 0x7F, 0x9E, 0x9B,
4900 0x17, 0xBB, 0x84, 0xD8, 0xE2, 0x55, 0x69, 0x0E, 0xCF, 0xB2,
4901 0xC3, 0x61, 0x35, 0x0D, 0x86, 0xD7, 0x81, 0x75, 0x43, 0x98,
4902 0x29, 0xDF, 0x19, 0x9C, 0xFB, 0xC0, 0xC0, 0x5A, 0x7E, 0xF7,
4903 0xC6, 0x86, 0xEF, 0x6E, 0xBA, 0x26, 0x1D, 0x07, 0xF9, 0xC0,
4904 0x1F, 0xC0, 0x8E, 0x41, 0x8F, 0x1A, 0xE3, 0x51, 0xE2, 0xD7,
4905 0xCA, 0x28, 0x7D, 0x7A, 0xA7, 0x57, 0xA3, 0x2D, 0x98, 0x56,
4906 0x32, 0x9D, 0xC0, 0xF8, 0x23, 0x1D, 0x2C, 0xF6, 0x64, 0x1E,
4907 0x70, 0x33, 0xD4, 0x8F, 0xF9, 0xB0, 0xF4, 0x57, 0x7F, 0xD1,
4908 0x9A, 0xD4, 0x1A, 0x7E, 0xB6, 0x07, 0xAA, 0x54, 0x19, 0x0D,
4909 0x5D, 0xB8, 0x26, 0x45, 0x1B, 0x38, 0x14, 0x20, 0xFB, 0xAA,
4910 0x09, 0x71, 0xAF, 0x96, 0xB1, 0x17, 0xF3, 0x45, 0xA3, 0xA6,
4911 0x90, 0x52, 0x3C, 0x3B, 0x43, 0x9A, 0x8D, 0xE3, 0xB1, 0xC5,
4912 0xE4, 0x32, 0x6C, 0xE0, 0x17, 0x98, 0x43, 0x34, 0x54, 0x10,
4913 0x17, 0x82, 0x27, 0xE8, 0x8F, 0x99, 0x88, 0x98, 0x26, 0x70,
4914 0x19, 0xD1, 0x2D, 0x23, 0x02, 0x5F, 0x44, 0x71, 0x2A, 0xF6,
4915 0x48, 0x83, 0x34, 0x3A, 0x37, 0x11, 0x9C, 0xA1, 0xCE, 0xF0,
4916 0xD7, 0x6E, 0xF7, 0x2B, 0xA3, 0xFC, 0x07, 0x40, 0x64, 0x1A,
4917 0xF1, 0xF6, 0xF8, 0x90, 0x21, 0x1C, 0x0E, 0x85, 0xAA, 0xC1,
4918 0xF7, 0x16, 0xF5, 0x4D, 0x27, 0x8E, 0x91, 0x4E, 0x84, 0x19,
4919 0xDB, 0x8C, 0xEA, 0x00, 0xEA, 0xA6, 0x86, 0x18, 0x2C, 0x8B,
4920 0x46, 0x5F, 0xED, 0x61, 0x38, 0x28, 0x31, 0x4A, 0x1A, 0x12,
4921 0x19, 0x6C, 0x2D, 0x43, 0x0E, 0xD0, 0xDD, 0x4B, 0xFA, 0xA0,
4922 0x39, 0xC2, 0x4B, 0x31, 0xD9, 0x56, 0xB4, 0x9E, 0xB5, 0xD1,
4923 0x79, 0xA3, 0x35, 0xC7, 0xAF, 0xFD, 0x0E, 0x11, 0xC7, 0x0F,
4924 0x55, 0x1D, 0xCA, 0x71, 0xD1, 0x37, 0x3B, 0xC2, 0x72, 0xA0,
4925 0xDB, 0xEE, 0xA0, 0xF2, 0x28, 0xF4, 0x77, 0x34, 0x7D, 0x9F,
4926 0xE8, 0x38, 0xD0, 0xF1, 0xEB, 0x51, 0x95, 0x93, 0x5D, 0x7B,
4927 0x4F, 0xE7, 0x1A, 0xD5, 0xA1, 0xF1, 0xF1, 0x85, 0xF7, 0x58,
4928 0x5C, 0x2C, 0x49, 0xAF, 0xDC, 0x93, 0xFE, 0x73, 0x0F, 0xC8,
4929 0xC8, 0x26, 0x1B, 0xDE, 0xD8, 0xA6, 0x8A, 0x44, 0xB4, 0x2B,
4930 0x67, 0xBD, 0x8E, 0xFF, 0xA5, 0x8C, 0x18, 0x95, 0xD3, 0x02,
4931 0x7F, 0x28, 0x93, 0xAE, 0x84, 0x1E, 0xB0, 0x5C, 0x70, 0x57,
4932 0x1C, 0xFF, 0x75, 0x95, 0xBF, 0xAD, 0x95, 0xF3, 0x3C, 0x19,
4933 0xA0, 0x7A, 0x0F, 0x62, 0x65, 0xF0, 0x0F, 0x18, 0x1E, 0x48,
4934 0xB3, 0x85, 0x5D, 0x11, 0x47, 0xC9, 0x95, 0x75, 0xBE, 0xFA,
4935 0x2D, 0x56, 0x35, 0xD0, 0x7A, 0x75, 0x68, 0xEA, 0x7D, 0x01,
4936 0x9E, 0xD5, 0x28, 0x9E, 0x80, 0x09, 0xE5, 0xE9, 0xF8, 0xD3,
4937 0x11, 0xA6, 0xC7, 0x5E, 0xD6, 0x38, 0x8B, 0x96, 0x7A, 0xFB,
4938 0xD8, 0x27, 0xD4, 0x47, 0x6B, 0x50, 0xAB, 0x21, 0x4E, 0xFB,
4939 0xC2, 0xA1, 0x8C, 0xB7, 0x50, 0xE2, 0xF7, 0xC3, 0x4C, 0x66,
4940 0x04, 0x28, 0x17, 0x5D, 0x6F, 0x48, 0x39, 0x9A, 0x0B, 0x4A,
4941 0xB0, 0x75, 0xDF, 0xA9, 0x6E, 0xE0, 0x72, 0x20, 0x68, 0xC5,
4942 0x9C, 0xDB, 0x41, 0xA4, 0xF9, 0xA4, 0xF5, 0x1D, 0xDD, 0x89,
4943 0x83, 0x11, 0xDD, 0x3A, 0xA4, 0x76, 0x38, 0x62, 0x75, 0x4C,
4944 0x5D, 0xC7, 0xF5, 0x99, 0x75, 0xFB, 0xB7, 0x87, 0xB8, 0x77,
4945 0x2B, 0x45, 0xEF, 0xC5, 0xE5, 0x10, 0xD9, 0x6B, 0x4C, 0x72,
4946 0x4B, 0x42, 0x13, 0x71, 0x3C, 0x9C, 0x2C, 0x2E, 0xFB, 0xA2,
4947 0x3A, 0xCD, 0x2B, 0x83, 0x12, 0xA7, 0xF3, 0xA5, 0xCE, 0x4B,
4948 0x77, 0x2B, 0xF5, 0x71, 0xA0, 0x1A, 0x40, 0x7F, 0xED, 0x97,
4949 0x4B, 0x0C, 0xA0, 0x55, 0x6B, 0x69, 0x73, 0x52, 0x47, 0x6A,
4950 0x20, 0xCB, 0xEE, 0xE0, 0xBE, 0x97, 0x8F, 0x05, 0xE0, 0x84,
4951 0x4A, 0x6E, 0x40, 0xCC, 0x02, 0x2C, 0xA8, 0x45, 0xD4, 0x6B,
4952 0xD4, 0xCD, 0x41, 0x29, 0xBE, 0x99, 0x3B, 0x51, 0x0F, 0x9C,
4953 0x70, 0x75, 0x83, 0x3D, 0x42, 0xCF, 0xA9, 0x02, 0xF3, 0x68,
4954 0x3C, 0x96, 0xE1, 0x36, 0x46, 0xB7, 0x86, 0x16, 0x03, 0x2C,
4955 0xBB, 0x71, 0x21, 0xBF, 0x13, 0x52, 0x03, 0x42, 0x31, 0xE3,
4956 0xA3, 0x26, 0xEE, 0xD7, 0x86, 0x78, 0xDA, 0x9E, 0x9A, 0x50,
4957 0xD1, 0x9C, 0x5B, 0xB7, 0xEB, 0xCF, 0x0A, 0x6D, 0x10, 0xA0,
4958 0xAB, 0x8C, 0x65, 0x4B, 0xFA, 0x9E, 0xAC, 0x0B, 0x66, 0x56,
4959 0xC7, 0x5D, 0x85, 0x88, 0x53, 0x1B, 0xC2, 0x37, 0xCC, 0x94,
4960 0x2E, 0xE1, 0xB1, 0xF7, 0xCC, 0x1F, 0x59, 0x24, 0xEC, 0x1A,
4961 0x27, 0xFA, 0x8D, 0xE5, 0x86, 0x9E, 0x3F, 0x21, 0xDA, 0x15,
4962 0xAE, 0xC7, 0x6C, 0xFB, 0x17, 0x0D, 0xF5, 0xCB, 0xE3, 0xB8,
4963 0x36, 0x95, 0x0F, 0xBD, 0x84, 0x19, 0x1D, 0xF5, 0x4F, 0x17,
4964 0xB8, 0x71, 0x9C, 0x0E, 0x3D, 0xD8, 0xFD, 0x9B, 0xD4, 0x0D,
4965 0x2D, 0x16, 0x5D, 0x75, 0xE7, 0x25, 0x94, 0x3D, 0xD3, 0x0C,
4966 0x07, 0x3D, 0x04, 0x46, 0xC8, 0x8F, 0x65, 0x06, 0xC7, 0x11,
4967 0xB2, 0xAB, 0x41, 0x5E, 0x96, 0x0C, 0x68, 0x76, 0x7D, 0x6D,
4968 0xB8, 0xB5, 0x27, 0x01, 0x2C, 0x00, 0xC2, 0xA0, 0x40, 0xB8,
4969 0xF7, 0xC6, 0x39, 0x56, 0xCF, 0x25, 0x56, 0xB3, 0x10, 0x04,
4970 0xE9, 0xC3, 0x85, 0x47, 0xE8, 0x6E, 0xC7, 0x89, 0xFE, 0x80,
4971 0x9A, 0x50, 0x9E, 0xBD, 0xF3, 0x2E, 0x5E, 0x96, 0x0A, 0xA8,
4972 0xB7, 0x6C, 0x5B, 0x9E, 0x32, 0x1E, 0x75, 0x68, 0x5E, 0x74,
4973 0x88, 0xFC, 0xC5, 0x3D, 0xB9, 0x21, 0x0A, 0xAD, 0x6D, 0xF6,
4974 0xBE, 0x2D, 0x9A, 0x8A, 0xA5, 0x2A, 0x40, 0x3C, 0xF6, 0x4C,
4975 0xFE, 0x18, 0xE3, 0x44, 0x7A, 0x5F, 0x31, 0x1A, 0xEE, 0x95,
4976 0x07, 0x96, 0xC1, 0x27, 0x7F, 0x64, 0x4E, 0xF0, 0x19, 0x2D,
4977 0x36, 0x33, 0x5D, 0x23, 0xC9, 0xC2, 0x36, 0x91, 0x22, 0xC9,
4978 0x58, 0x8C, 0xE4, 0xF1, 0x19, 0xD0, 0xBF, 0x51, 0xAA, 0x14,
4979 0x4C, 0x15, 0x4A, 0x93, 0xF3, 0x16, 0x6A, 0x21, 0xBE, 0xDE,
4980 0xA5, 0x4C, 0x84, 0xC5, 0x65, 0x06, 0xA7, 0x11, 0xDC, 0x00,
4981 0x5F, 0x0F, 0xF1, 0xDA, 0xA2, 0x11, 0xAB, 0x64, 0xE0, 0x1F,
4982 0x1A, 0x65, 0x32, 0xA7, 0x69, 0x65, 0xAF, 0x64, 0x95, 0x90,
4983 0xF1, 0xA5, 0xFA, 0x32, 0x4C, 0x59, 0x61, 0x87, 0x3D, 0x94,
4984 0x82, 0x7E, 0xE4, 0x04, 0x7B, 0x8A, 0xCD, 0x54, 0x00, 0x2A,
4985 0xC5, 0xC3, 0xB7, 0x2F, 0x8A, 0xA8, 0x19, 0x39, 0x93, 0x53,

NetBurner, Inc.
22.205 certs_test.h 1151

4986 0x3E, 0xEB, 0xE7, 0x8F, 0xF7, 0xCF, 0xDA, 0x8A, 0x4E, 0xAB,
4987 0x91, 0x3D, 0xA3, 0x40, 0x55, 0x64, 0xE7, 0x48, 0x90, 0x03,
4988 0xE5, 0xE6, 0x03, 0xE8, 0x2A, 0x23, 0x78, 0x6F, 0xCA, 0xDE,
4989 0x7C, 0x6E, 0x56, 0x5B, 0xC8, 0x6D, 0x8C, 0x2F, 0xC8, 0x6C,
4990 0x7D, 0xD8, 0x60, 0x43, 0x8C, 0xF3, 0xE9, 0x9E, 0x70, 0x73,
4991 0xAC, 0x85, 0xB4, 0xA3, 0x29, 0x86, 0x88, 0x60, 0x6D, 0xDD,
4992 0x21, 0x07, 0x09, 0x8B, 0xFB, 0xA1, 0x67, 0xA5, 0xDA, 0x9D,
4993 0xCC, 0x2E, 0xE3, 0xBE, 0xAE, 0x06, 0x0E, 0x41, 0x4E, 0xBE,
4994 0x5F, 0xE4, 0x93, 0x81, 0xE8, 0x06, 0xAA, 0x2C, 0xC9, 0x1B,
4995 0x1C, 0x5A, 0x9E, 0x01, 0xEF, 0xFF, 0x82, 0x84, 0xD9, 0x2B,
4996 0x05, 0x20, 0x0D, 0xE1, 0x14, 0x6C, 0x0A, 0x85, 0x16, 0x2E,
4997 0x79, 0xA3, 0x64, 0xBF, 0xFC, 0x89, 0xB8, 0xFD, 0xB0, 0xC8,
4998 0x39, 0x9A, 0x83, 0x1B, 0x74, 0x41, 0x7C, 0xEA, 0xFD, 0x5F,
4999 0x83, 0x19
5000 };
5001 static const int sizeof_bench_dilithium_level3_key = sizeof(bench_dilithium_level3_key);
5002
5003 /* certs/dilithium/bench_dilithium_level5_key.der */
5004 static const unsigned char bench_dilithium_level5_key[] =
5005 {
5006 0x30, 0x82, 0x1D, 0x3A, 0x02, 0x01, 0x00, 0x30, 0x0D, 0x06,
5007 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x02, 0x82, 0x0B, 0x07,
5008 0x08, 0x07, 0x04, 0x82, 0x1D, 0x24, 0x04, 0x82, 0x1D, 0x20,
5009 0x0A, 0xDB, 0x85, 0x3A, 0x41, 0x2C, 0x30, 0x56, 0x65, 0x04,
5010 0x0A, 0x20, 0x31, 0x2A, 0xF3, 0x88, 0x4C, 0x38, 0x64, 0x86,
5011 0x14, 0x06, 0xF5, 0xF0, 0x7F, 0x63, 0xC1, 0x87, 0x24, 0x39,
5012 0xFB, 0xC0, 0x28, 0x0C, 0xBE, 0x81, 0xF7, 0xCD, 0x25, 0x8B,
5013 0x86, 0x42, 0xAD, 0x74, 0x54, 0xCB, 0xA4, 0xDA, 0xC7, 0x94,
5014 0x70, 0xA3, 0x41, 0xDA, 0x1F, 0xD8, 0x4F, 0x94, 0x5C, 0x0B,
5015 0xA5, 0x35, 0x60, 0xB2, 0x8C, 0x50, 0xED, 0x0B, 0xCB, 0x75,
5016 0x6F, 0x14, 0x64, 0x48, 0x86, 0x21, 0xBC, 0x4A, 0x4C, 0xC5,
5017 0x22, 0xBC, 0x2D, 0x28, 0x32, 0x39, 0x13, 0x57, 0xC9, 0xE5,
5018 0x74, 0xF4, 0xE6, 0x3A, 0xC2, 0xE2, 0x49, 0x24, 0x31, 0x88,
5019 0x82, 0x08, 0x03, 0x89, 0x6C, 0x8B, 0x84, 0x08, 0x81, 0xC2,
5020 0x08, 0xDB, 0x44, 0x60, 0xA0, 0xB2, 0x91, 0x88, 0x36, 0x28,
5021 0x12, 0x89, 0x89, 0x4B, 0xA4, 0x01, 0x62, 0x12, 0x4C, 0x08,
5022 0x02, 0x44, 0x19, 0x15, 0x64, 0x8B, 0x04, 0x65, 0xE4, 0x14,
5023 0x06, 0x08, 0xC7, 0x04, 0x5B, 0x28, 0x81, 0x89, 0xC2, 0x70,
5024 0xD0, 0xB4, 0x71, 0x4C, 0x24, 0x80, 0xA1, 0x28, 0x86, 0xD1,
5025 0x06, 0x25, 0x13, 0x03, 0x84, 0x8C, 0x18, 0x41, 0x49, 0x34,
5026 0x09, 0xCB, 0x22, 0x71, 0x0C, 0xA3, 0x90, 0x22, 0x94, 0x51,
5027 0x58, 0x02, 0x2D, 0x53, 0x30, 0x00, 0xC2, 0x06, 0x42, 0x48,
5028 0xC4, 0x70, 0x8A, 0x32, 0x89, 0x80, 0x16, 0x06, 0x90, 0x44,
5029 0x91, 0xCB, 0xC8, 0x71, 0xA2, 0xB6, 0x64, 0xD0, 0x26, 0x0A,
5030 0x21, 0x05, 0x88, 0x0C, 0xB0, 0x6C, 0x03, 0x49, 0x24, 0x80,
5031 0x02, 0x11, 0xD1, 0x36, 0x06, 0x84, 0x32, 0x11, 0x81, 0x44,
5032 0x91, 0x9B, 0xB0, 0x01, 0x91, 0x02, 0x25, 0x44, 0x92, 0x69,
5033 0x5A, 0x08, 0x6C, 0x90, 0x00, 0x0D, 0x09, 0x17, 0x64, 0x89,
5034 0xB2, 0x2D, 0x02, 0x06, 0x2C, 0xDC, 0x92, 0x45, 0xE1, 0x34,
5035 0x31, 0x11, 0x03, 0x2D, 0x00, 0x94, 0x29, 0xCA, 0x34, 0x89,
5036 0xA3, 0x40, 0x22, 0xC4, 0x30, 0x08, 0x02, 0x33, 0x6E, 0x1C,
5037 0x85, 0x10, 0xE4, 0x92, 0x30, 0xC4, 0x46, 0x84, 0xE0, 0x26,
5038 0x28, 0xC3, 0x10, 0x65, 0x51, 0x06, 0x4A, 0x03, 0xC1, 0x11,
5039 0x48, 0x32, 0x4E, 0x9A, 0xC4, 0x6C, 0x91, 0x38, 0x40, 0xC0,
5040 0x92, 0x64, 0xE3, 0xA4, 0x85, 0x22, 0x32, 0x52, 0x92, 0x08,
5041 0x20, 0x82, 0x22, 0x12, 0x49, 0x20, 0x6C, 0x91, 0x06, 0x01,
5042 0x1B, 0x30, 0x06, 0x12, 0xC3, 0x41, 0x4B, 0x40, 0x42, 0x0B,
5043 0xA7, 0x01, 0x60, 0x12, 0x89, 0x24, 0x98, 0x30, 0x99, 0xA6,
5044 0x64, 0x61, 0x26, 0x6A, 0x91, 0xB0, 0x11, 0x03, 0xC2, 0x2D,
5045 0x41, 0xC8, 0x6D, 0xD8, 0x38, 0x28, 0x4B, 0x98, 0x04, 0x98,
5046 0x18, 0x09, 0x18, 0xA6, 0x65, 0x81, 0x38, 0x69, 0x5B, 0xC4,
5047 0x6D, 0x98, 0x26, 0x0D, 0x62, 0xC6, 0x71, 0xC3, 0xC6, 0x4C,
5048 0xC2, 0x02, 0x46, 0x5B, 0x94, 0x65, 0x09, 0x29, 0x0E, 0xA2,
5049 0xA2, 0x41, 0xE4, 0x02, 0x69, 0xA3, 0x90, 0x4D, 0x8B, 0xA6,
5050 0x70, 0xA3, 0x40, 0x85, 0x5C, 0x36, 0x48, 0x22, 0xC5, 0x84,
5051 0x19, 0x91, 0x25, 0x00, 0xC2, 0x65, 0xC4, 0x46, 0x2E, 0xDC,
5052 0xB0, 0x51, 0x94, 0x28, 0x01, 0x9B, 0x22, 0x66, 0x01, 0xA8,
5053 0x90, 0x9A, 0xC4, 0x08, 0xD1, 0x22, 0x41, 0x42, 0x34, 0x62,
5054 0x60, 0x40, 0x92, 0x93, 0xC8, 0x45, 0xD8, 0x04, 0x20, 0x8A,
5055 0x30, 0x25, 0xE1, 0x14, 0x40, 0x11, 0x13, 0x00, 0x54, 0x22,
5056 0x62, 0x50, 0x10, 0x22, 0x03, 0xA9, 0x85, 0x9B, 0x42, 0x4D,
5057 0x50, 0xB2, 0x41, 0x10, 0x13, 0x48, 0x63, 0x38, 0x68, 0xA1,
5058 0xB0, 0x0D, 0x1B, 0x88, 0x84, 0x8A, 0x28, 0x51, 0xD4, 0x38,
5059 0x2A, 0x12, 0x43, 0x61, 0x80, 0x38, 0x32, 0x18, 0xC6, 0x29,
5060 0x22, 0xB5, 0x21, 0x02, 0x99, 0x28, 0xCC, 0x18, 0x85, 0x83,
5061 0xB4, 0x8C, 0x81, 0x24, 0x51, 0x10, 0x83, 0x68, 0x1C, 0x47,
5062 0x71, 0x8C, 0x40, 0x6C, 0x00, 0xB6, 0x0D, 0x88, 0x22, 0x90,
5063 0x0C, 0xC7, 0x49, 0xC0, 0x82, 0x89, 0xDA, 0x22, 0x4A, 0xC8,
5064 0x18, 0x08, 0xD1, 0x00, 0x2C, 0xDA, 0x30, 0x49, 0x49, 0xC8,
5065 0x91, 0x5A, 0x96, 0x64, 0x11, 0x96, 0x20, 0xD2, 0xC4, 0x60,
5066 0xE0, 0x46, 0x6A, 0x02, 0xB5, 0x21, 0x19, 0xB9, 0x81, 0x23,
5067 0x00, 0x22, 0x11, 0x37, 0x32, 0x19, 0xA4, 0x0D, 0x51, 0x96,
5068 0x89, 0x1B, 0x11, 0x11, 0xC3, 0x14, 0x88, 0x4C, 0x96, 0x0C,
5069 0x01, 0x13, 0x72, 0x83, 0x16, 0x12, 0x24, 0x38, 0x51, 0x40,
5070 0x34, 0x89, 0xD9, 0x26, 0x01, 0x54, 0x42, 0x8D, 0x00, 0xC1,
5071 0x85, 0x13, 0x14, 0x84, 0x82, 0x16, 0x25, 0x88, 0xB0, 0x51,
5072 0x11, 0x80, 0x30, 0x23, 0x25, 0x46, 0x04, 0x27, 0x66, 0x11,

NetBurner, Inc.
1152 File Documentation

5073 0x28, 0x30, 0xD4, 0x94, 0x84, 0x10, 0xA0, 0x8C, 0xC1, 0x36,
5074 0x0C, 0x14, 0x98, 0x28, 0x5B, 0x02, 0x90, 0xD9, 0x90, 0x31,
5075 0xD3, 0x28, 0x68, 0x23, 0x90, 0x80, 0x24, 0xC7, 0x84, 0xA1,
5076 0x00, 0x09, 0xC1, 0x36, 0x84, 0x58, 0xB6, 0x28, 0x4A, 0xB0,
5077 0x69, 0x08, 0x10, 0x51, 0x1C, 0xB6, 0x84, 0x83, 0x84, 0x81,
5078 0x03, 0x39, 0x90, 0x81, 0x42, 0x12, 0x13, 0xB4, 0x49, 0x0A,
5079 0x20, 0x09, 0x93, 0x22, 0x42, 0xD4, 0x26, 0x21, 0xA3, 0x32,
5080 0x89, 0x89, 0x84, 0x81, 0x0B, 0x02, 0x21, 0x64, 0x28, 0x90,
5081 0x89, 0xB2, 0x29, 0xE1, 0x36, 0x2C, 0x11, 0x30, 0x51, 0x21,
5082 0x83, 0x2C, 0x04, 0x36, 0x26, 0x61, 0x12, 0x8C, 0x19, 0x43,
5083 0x52, 0x89, 0x90, 0x88, 0x43, 0xB8, 0x71, 0x0C, 0x43, 0x09,
5084 0x84, 0x26, 0x6A, 0x50, 0x36, 0x20, 0x00, 0xC3, 0x68, 0x91,
5085 0x38, 0x0E, 0x12, 0x12, 0x52, 0x82, 0xC4, 0x4D, 0x64, 0x90,
5086 0x4D, 0x8C, 0x30, 0x22, 0x14, 0x26, 0x6E, 0x10, 0x46, 0x8E,
5087 0x58, 0x34, 0x46, 0x22, 0x97, 0x68, 0x02, 0x43, 0x61, 0x41,
5088 0x06, 0x01, 0x88, 0x42, 0x40, 0x08, 0x06, 0x6D, 0x80, 0x42,
5089 0x22, 0x84, 0x48, 0x89, 0xDB, 0x84, 0x90, 0xC0, 0x22, 0x71,
5090 0x43, 0x96, 0x45, 0x0A, 0xA3, 0x30, 0x12, 0x28, 0x44, 0x51,
5091 0x00, 0x52, 0x99, 0xA0, 0x8D, 0xC2, 0x28, 0x00, 0xC8, 0x18,
5092 0x6E, 0xA2, 0x40, 0x8E, 0x03, 0x47, 0x31, 0x61, 0x22, 0x41,
5093 0xD3, 0xB4, 0x01, 0x48, 0x14, 0x40, 0x4C, 0x06, 0x0C, 0x41,
5094 0x06, 0x2A, 0x5B, 0x90, 0x25, 0xCC, 0xC6, 0x41, 0xC3, 0x86,
5095 0x28, 0x99, 0x26, 0x50, 0x11, 0xC4, 0x8D, 0x8C, 0x30, 0x68,
5096 0x8C, 0x08, 0x0C, 0x50, 0x38, 0x86, 0xDC, 0x10, 0x92, 0xD4,
5097 0x18, 0x72, 0x02, 0xA8, 0x2C, 0x42, 0x82, 0x44, 0x53, 0x36,
5098 0x0E, 0x90, 0x32, 0x49, 0x84, 0x24, 0x09, 0x12, 0xA2, 0x41,
5099 0x82, 0x10, 0x4D, 0x01, 0xA0, 0x8C, 0x11, 0xB2, 0x80, 0x21,
5100 0x89, 0x69, 0x24, 0x21, 0x28, 0x02, 0x03, 0x6E, 0x49, 0x32,
5101 0x0C, 0x08, 0x88, 0x84, 0x91, 0x80, 0x10, 0x0C, 0x33, 0x12,
5102 0x43, 0x24, 0x8A, 0x82, 0x26, 0x10, 0x60, 0xC6, 0x60, 0x48,
5103 0xA2, 0x10, 0x12, 0x83, 0x24, 0x0B, 0x03, 0x40, 0xCA, 0x08,
5104 0x20, 0x99, 0x36, 0x86, 0x5B, 0x24, 0x41, 0x10, 0x87, 0x04,
5105 0x0C, 0x15, 0x04, 0x14, 0xB2, 0x68, 0x0B, 0x89, 0x29, 0x99,
5106 0x16, 0x8D, 0x00, 0x42, 0x00, 0x9B, 0x48, 0x44, 0x12, 0x45,
5107 0x6C, 0x0A, 0x25, 0x92, 0xC0, 0xC4, 0x00, 0x1A, 0xC8, 0x31,
5108 0x21, 0x26, 0x8A, 0x81, 0xA0, 0x2C, 0x11, 0x85, 0x65, 0x9A,
5109 0x08, 0x61, 0xD9, 0x22, 0x12, 0xCB, 0x36, 0x71, 0xA2, 0x08,
5110 0x0A, 0xE4, 0x06, 0x32, 0x19, 0x19, 0x4A, 0x1B, 0x34, 0x45,
5111 0x51, 0x06, 0x6E, 0x48, 0x02, 0x68, 0x13, 0xB7, 0x10, 0x44,
5112 0xC8, 0x85, 0x13, 0x81, 0x2C, 0xC4, 0x40, 0x45, 0x42, 0x98,
5113 0x21, 0x62, 0x18, 0x92, 0x9B, 0x44, 0x25, 0xA1, 0x06, 0x28,
5114 0x52, 0x82, 0x11, 0x44, 0x24, 0x32, 0x02, 0xC6, 0x80, 0x10,
5115 0x45, 0x4E, 0x22, 0x93, 0x0D, 0x44, 0x02, 0x68, 0x4A, 0x30,
5116 0x81, 0xC9, 0x94, 0x85, 0x08, 0x07, 0x08, 0x24, 0x39, 0x64,
5117 0xD2, 0x08, 0x22, 0xD0, 0xA0, 0x41, 0x81, 0x92, 0x91, 0x8C,
5118 0x24, 0x6A, 0xCA, 0x36, 0x32, 0x1C, 0x12, 0x45, 0x92, 0x94,
5119 0x80, 0x82, 0x86, 0x4C, 0xDA, 0xA2, 0x84, 0x98, 0x24, 0x49,
5120 0x0A, 0x13, 0x90, 0x1B, 0xC3, 0x01, 0x49, 0x28, 0x60, 0x08,
5121 0x21, 0x92, 0x0B, 0xB0, 0x20, 0x52, 0x90, 0x84, 0x8A, 0x32,
5122 0x11, 0x50, 0x28, 0x8C, 0x5B, 0x38, 0x2E, 0xDC, 0xB4, 0x08,
5123 0x12, 0x20, 0x84, 0xD1, 0x12, 0x22, 0x99, 0x08, 0x11, 0x19,
5124 0x95, 0x10, 0x80, 0x44, 0x6A, 0xE1, 0x12, 0x85, 0xCC, 0xB0,
5125 0x24, 0x23, 0x15, 0x4C, 0x63, 0x34, 0x68, 0x5C, 0xB6, 0x65,
5126 0x42, 0xC2, 0x4D, 0x20, 0x95, 0x84, 0x8A, 0x42, 0x00, 0x4C,
5127 0x24, 0x50, 0x98, 0x02, 0x6C, 0x21, 0x44, 0x84, 0x20, 0x85,
5128 0x21, 0x80, 0x48, 0x6C, 0x9C, 0x14, 0x86, 0x81, 0x86, 0x91,
5129 0x1C, 0x09, 0x04, 0xDC, 0xC6, 0x28, 0x09, 0x27, 0x30, 0x4B,
5130 0x02, 0x64, 0x44, 0x46, 0x30, 0x9C, 0xA2, 0x8C, 0x20, 0x11,
5131 0x68, 0x11, 0x24, 0x51, 0x0B, 0x02, 0x00, 0xD2, 0x82, 0x4D,
5132 0xC3, 0x80, 0x71, 0xE0, 0x48, 0x2C, 0x4A, 0x88, 0x50, 0xA0,
5133 0x20, 0x49, 0x4B, 0xB4, 0x31, 0x08, 0x12, 0x71, 0x90, 0xA2,
5134 0x89, 0xCA, 0x46, 0x85, 0x91, 0x96, 0x91, 0x8A, 0x30, 0x31,
5135 0x0B, 0xC2, 0x21, 0x61, 0x10, 0x49, 0x10, 0x99, 0x81, 0x53,
5136 0x36, 0x0C, 0x23, 0x81, 0x88, 0x62, 0x28, 0x0A, 0x12, 0x43,
5137 0x70, 0x02, 0xC7, 0x51, 0x14, 0x34, 0x88, 0x23, 0x84, 0x49,
5138 0x23, 0x86, 0x08, 0x0C, 0x28, 0x28, 0x94, 0xA0, 0x8D, 0x11,
5139 0x33, 0x60, 0xA3, 0x38, 0x6E, 0xC0, 0x42, 0x2E, 0x52, 0xB4,
5140 0x40, 0x0A, 0x25, 0x4D, 0x1C, 0x10, 0x2A, 0x9A, 0x96, 0x64,
5141 0x10, 0xC1, 0x60, 0x8C, 0x46, 0x60, 0x5A, 0x24, 0x89, 0x42,
5142 0x40, 0x86, 0xD0, 0x34, 0x89, 0x5C, 0x02, 0x02, 0x00, 0x34,
5143 0x21, 0x00, 0x24, 0x00, 0xA0, 0x20, 0x60, 0x03, 0xA6, 0x40,
5144 0xDC, 0x30, 0x80, 0x4B, 0xA8, 0x20, 0x0B, 0xA2, 0x24, 0xE2,
5145 0xB0, 0x89, 0xA2, 0xB2, 0x65, 0xD4, 0xA6, 0x68, 0x20, 0xA3,
5146 0x04, 0x4C, 0xC2, 0x11, 0x4A, 0x38, 0x24, 0x08, 0x17, 0x4D,
5147 0xE2, 0xA2, 0x00, 0x02, 0xC8, 0x00, 0x08, 0x00, 0x30, 0xA4,
5148 0xB6, 0x25, 0x5A, 0x30, 0x01, 0x40, 0x92, 0x4C, 0xC8, 0x44,
5149 0x92, 0x43, 0xC8, 0x60, 0xA3, 0x86, 0x84, 0x18, 0x04, 0x70,
5150 0x53, 0xB2, 0x40, 0x4C, 0x04, 0x84, 0x09, 0xC8, 0x48, 0x21,
5151 0x13, 0x31, 0x04, 0xA5, 0x0D, 0x90, 0x92, 0x88, 0xC1, 0x10,
5152 0x8D, 0xE0, 0x88, 0x28, 0x0B, 0x06, 0x84, 0x23, 0x22, 0x6C,
5153 0xDB, 0xB2, 0x05, 0xC8, 0x08, 0x6E, 0x93, 0x86, 0x4C, 0x0C,
5154 0x37, 0x86, 0xDA, 0x16, 0x51, 0x9B, 0x08, 0x32, 0x00, 0x91,
5155 0x45, 0xA4, 0x00, 0x2D, 0x14, 0x02, 0x0E, 0x60, 0x90, 0x4C,
5156 0x23, 0xB4, 0x09, 0x00, 0xA5, 0x81, 0x19, 0x21, 0x32, 0xC2,
5157 0x00, 0x02, 0x18, 0x10, 0x50, 0x08, 0xA2, 0x6D, 0x20, 0x31,
5158 0x6A, 0x90, 0x46, 0x90, 0x8B, 0x94, 0x30, 0x21, 0x44, 0x52,
5159 0x10, 0x19, 0x51, 0x94, 0xC0, 0x29, 0xC8, 0x20, 0x4E, 0x48,

NetBurner, Inc.
22.205 certs_test.h 1153

5160 0xA6, 0x4C, 0x11, 0xC4, 0x64, 0xDC, 0x34, 0x10, 0x48, 0xC4,
5161 0x84, 0xCA, 0x46, 0x0C, 0x58, 0x12, 0x49, 0x0B, 0x16, 0x00,
5162 0x20, 0x42, 0x50, 0x04, 0x00, 0x46, 0xF8, 0x68, 0xB1, 0xA7,
5163 0x5E, 0xA7, 0xE6, 0xCE, 0xF5, 0x88, 0x8A, 0x5F, 0x79, 0xC9,
5164 0x3A, 0x5F, 0xF2, 0x7F, 0x5A, 0xED, 0xB4, 0xB4, 0x25, 0x44,
5165 0xD2, 0x7E, 0xED, 0xCE, 0x46, 0x40, 0xAC, 0xC2, 0x53, 0xD0,
5166 0xD3, 0xE7, 0xF6, 0x1C, 0xFA, 0x23, 0x4A, 0xB0, 0xEA, 0x32,
5167 0x91, 0xB7, 0xDA, 0x8B, 0x72, 0x35, 0xB7, 0x74, 0xD5, 0x9A,
5168 0x9B, 0x22, 0x3D, 0x49, 0x08, 0xBA, 0xD1, 0x7D, 0x9F, 0x64,
5169 0xD5, 0xAD, 0x7A, 0x37, 0xBD, 0x11, 0xD0, 0xA0, 0x7C, 0x53,
5170 0x05, 0x1A, 0x66, 0x6C, 0x5D, 0x42, 0x45, 0x55, 0x34, 0xC0,
5171 0x1F, 0xCA, 0xDB, 0x0D, 0x4F, 0x75, 0x95, 0x9F, 0x10, 0x9A,
5172 0x8D, 0x54, 0xCE, 0xC2, 0x5C, 0xF0, 0xCE, 0xBD, 0x39, 0x70,
5173 0xB0, 0x52, 0x2E, 0x4B, 0x11, 0x0D, 0x25, 0xD7, 0xE5, 0x4B,
5174 0xF1, 0xE3, 0x4F, 0xBE, 0xF2, 0x73, 0xA6, 0xDE, 0xB6, 0xC4,
5175 0x61, 0x71, 0xCC, 0x5C, 0xFE, 0x55, 0xF0, 0x50, 0xBA, 0x9C,
5176 0x18, 0x44, 0x13, 0xDD, 0xCB, 0x7A, 0xD2, 0xA2, 0xDC, 0xBF,
5177 0xF2, 0xC8, 0x84, 0xFF, 0x5B, 0xA7, 0xFA, 0x8D, 0x18, 0xF2,
5178 0x55, 0xD0, 0x3C, 0x4E, 0xB3, 0x77, 0x7C, 0x95, 0x91, 0x98,
5179 0x52, 0xF2, 0xB6, 0xCF, 0xFC, 0x45, 0xF4, 0x71, 0x62, 0x24,
5180 0xE2, 0x7B, 0xF7, 0x85, 0x08, 0x17, 0x6A, 0x62, 0xB4, 0xE9,
5181 0x08, 0x3E, 0xA1, 0xC6, 0x27, 0x8E, 0xB3, 0x26, 0xA5, 0x95,
5182 0x91, 0x84, 0xD0, 0xA0, 0xCD, 0xBF, 0x45, 0xD0, 0xE2, 0x26,
5183 0x65, 0x74, 0xD6, 0x49, 0x50, 0xF2, 0x6B, 0xAE, 0xF1, 0x8A,
5184 0x2A, 0x18, 0xDA, 0xF0, 0xAD, 0xE7, 0xF3, 0x0A, 0x0E, 0x33,
5185 0xA5, 0xCA, 0x11, 0x16, 0xCC, 0xD6, 0x81, 0x89, 0x83, 0x27,
5186 0x32, 0x97, 0x61, 0x48, 0x0D, 0x89, 0x3E, 0xB7, 0x7E, 0x02,
5187 0xC8, 0x96, 0x93, 0xFA, 0xD0, 0x1D, 0x76, 0xB4, 0xA4, 0x38,
5188 0x4C, 0xE3, 0xB4, 0x6F, 0xCE, 0x66, 0x90, 0x53, 0xDC, 0xCE,
5189 0xD6, 0x10, 0x16, 0x3E, 0xB8, 0xBD, 0xD9, 0x8C, 0xA9, 0x90,
5190 0x54, 0xAF, 0x86, 0x07, 0xB3, 0xC1, 0x82, 0xFB, 0x41, 0x61,
5191 0xB8, 0x6D, 0x8E, 0xA5, 0xA8, 0xEB, 0xE3, 0xC0, 0xCF, 0x51,
5192 0xAA, 0x94, 0x7A, 0x7F, 0x9C, 0x48, 0xA3, 0x40, 0x83, 0x33,
5193 0x22, 0x41, 0x61, 0x4C, 0xD4, 0x62, 0xD7, 0xC6, 0xC6, 0x5B,
5194 0xF3, 0x48, 0x42, 0xA7, 0x18, 0xD5, 0xAF, 0x05, 0xF6, 0x7A,
5195 0xF6, 0x6D, 0x82, 0xFF, 0x89, 0x68, 0x21, 0x13, 0x62, 0xA5,
5196 0x7E, 0xC9, 0x43, 0x03, 0x73, 0xF7, 0xD1, 0x01, 0x7D, 0xD9,
5197 0x13, 0x03, 0x9C, 0x99, 0x74, 0xD4, 0x92, 0x2E, 0xD1, 0xD3,
5198 0xCB, 0x53, 0x6C, 0xF9, 0xFE, 0xB4, 0x3D, 0x51, 0xF1, 0x63,
5199 0x42, 0x5B, 0xB2, 0x5D, 0x70, 0x03, 0xE5, 0x46, 0x5B, 0xC1,
5200 0xEB, 0x27, 0x11, 0x22, 0x15, 0x73, 0x6C, 0xF8, 0x51, 0x0A,
5201 0xFF, 0xD8, 0xFE, 0xB6, 0xE1, 0xBD, 0x42, 0xC0, 0x4C, 0xEB,
5202 0xCD, 0x1E, 0x3C, 0xD5, 0x7C, 0xEA, 0xC6, 0xD4, 0x34, 0xD2,
5203 0x8D, 0x99, 0xC4, 0x99, 0xA8, 0x8E, 0x9F, 0x60, 0xA8, 0xE8,
5204 0x7B, 0x1E, 0x7E, 0x50, 0x14, 0xAD, 0xFC, 0xDB, 0xA6, 0x00,
5205 0xE9, 0x00, 0x7A, 0x5A, 0xCD, 0x01, 0x26, 0xBB, 0x4E, 0x00,
5206 0x9E, 0xCC, 0xD3, 0x2D, 0x49, 0x1B, 0xB8, 0x60, 0x2C, 0x59,
5207 0x2A, 0x95, 0x8C, 0x92, 0x4D, 0x1A, 0x57, 0x3B, 0xEF, 0x6E,
5208 0xC4, 0x91, 0xE4, 0x99, 0x5E, 0xAE, 0x1B, 0xAF, 0x1E, 0x14,
5209 0x51, 0x38, 0x19, 0xBC, 0x33, 0x5C, 0x21, 0x4D, 0xAD, 0xA1,
5210 0x12, 0x17, 0xE6, 0xF5, 0x37, 0x98, 0xF6, 0xE6, 0x38, 0x4D,
5211 0x07, 0x80, 0x1D, 0xD8, 0x5E, 0xCC, 0x58, 0xDB, 0x7E, 0x3A,
5212 0x8F, 0x90, 0xDF, 0x9E, 0x80, 0xFB, 0xFC, 0x10, 0xEC, 0x7E,
5213 0x81, 0x53, 0x37, 0xC1, 0x66, 0xEE, 0xD7, 0x80, 0x0F, 0x0C,
5214 0xEB, 0xE8, 0x85, 0x2E, 0x37, 0x61, 0x8B, 0x9C, 0x63, 0xF6,
5215 0x27, 0x77, 0x16, 0x44, 0x61, 0x66, 0xC9, 0x79, 0x31, 0xDD,
5216 0xB4, 0x94, 0x9D, 0x8C, 0x8B, 0x1D, 0x28, 0xC2, 0x84, 0xC9,
5217 0x30, 0x71, 0xF4, 0x9E, 0xEF, 0x00, 0x2B, 0xA2, 0x9F, 0x38,
5218 0x65, 0xE6, 0xD1, 0x80, 0x26, 0x9B, 0xC4, 0xE8, 0x83, 0xCE,
5219 0x64, 0xD0, 0x8A, 0x9A, 0x1E, 0xEF, 0xA3, 0xB6, 0xD2, 0x0B,
5220 0x9C, 0x14, 0xF3, 0x08, 0xF1, 0x73, 0xD1, 0x34, 0xAE, 0x83,
5221 0xE7, 0x97, 0x5B, 0x97, 0x35, 0x0E, 0x35, 0xDC, 0x22, 0xD5,
5222 0xAA, 0xD1, 0xBC, 0xC7, 0x40, 0x20, 0xAD, 0x43, 0x36, 0x24,
5223 0x66, 0x7A, 0xB7, 0x1F, 0xF9, 0x1A, 0x1F, 0x37, 0xCE, 0xC2,
5224 0xFC, 0x98, 0xB1, 0x6A, 0x9A, 0x81, 0xD9, 0x4B, 0x53, 0x68,
5225 0xC5, 0xF3, 0xE6, 0x69, 0x76, 0xA6, 0x8B, 0x98, 0xFB, 0x84,
5226 0x2E, 0xD3, 0x4F, 0x77, 0xF9, 0x24, 0xF9, 0x13, 0x89, 0x8D,
5227 0xF6, 0x80, 0x2E, 0x0E, 0xA1, 0xCD, 0x90, 0x58, 0xCE, 0x63,
5228 0x36, 0x95, 0x8C, 0xF6, 0x68, 0xC3, 0x84, 0xF8, 0xB4, 0x5E,
5229 0x9E, 0x6C, 0x19, 0x32, 0x90, 0xA7, 0xD0, 0x2D, 0x47, 0x6B,
5230 0xCB, 0xAF, 0x85, 0x65, 0x92, 0x83, 0x11, 0x8E, 0xCC, 0x88,
5231 0xB1, 0x0B, 0xB8, 0x1E, 0x55, 0x4F, 0x18, 0x2A, 0xC4, 0x02,
5232 0xA8, 0x45, 0x6A, 0xCD, 0x75, 0x58, 0x6A, 0xAF, 0x83, 0x94,
5233 0x38, 0x1D, 0xA9, 0x09, 0x29, 0x1E, 0x0E, 0x43, 0xA9, 0x04,
5234 0x26, 0xF6, 0x1C, 0xC7, 0xCB, 0xC1, 0x10, 0xB9, 0x86, 0xC1,
5235 0xA2, 0xEC, 0x03, 0xDE, 0xF7, 0x53, 0x67, 0x2B, 0xDF, 0xEE,
5236 0xAF, 0xD2, 0xF2, 0xA8, 0xBD, 0xD9, 0x21, 0xCC, 0x8C, 0x72,
5237 0x02, 0x44, 0xF5, 0xA5, 0xED, 0x88, 0x5B, 0xAC, 0x5F, 0x5A,
5238 0x15, 0x81, 0xCC, 0x95, 0x15, 0x2E, 0x34, 0x72, 0x59, 0x6C,
5239 0x03, 0x36, 0x5E, 0x22, 0x7E, 0x3F, 0x65, 0xA6, 0x8C, 0x4F,
5240 0x89, 0xC1, 0xE7, 0x63, 0xB6, 0x1B, 0xE5, 0x41, 0xC7, 0xF8,
5241 0x96, 0xA4, 0x8F, 0x4F, 0x47, 0x59, 0x3E, 0x9D, 0x45, 0xCE,
5242 0xE4, 0x1B, 0xF1, 0x69, 0x0C, 0x39, 0x34, 0x16, 0x77, 0x6A,
5243 0xF5, 0xB5, 0x9E, 0x8B, 0x63, 0x86, 0x35, 0xFD, 0x4F, 0x2A,
5244 0x4B, 0x49, 0x21, 0x7C, 0xE3, 0xEA, 0x5C, 0xDE, 0x98, 0xE4,
5245 0x58, 0x32, 0x67, 0x98, 0xFC, 0x8F, 0xAB, 0x01, 0x0E, 0xA4,
5246 0x8B, 0x39, 0xA3, 0x55, 0x4C, 0x8E, 0x98, 0xBA, 0xCD, 0x3B,

NetBurner, Inc.
1154 File Documentation

5247 0xDB, 0x91, 0x8D, 0x94, 0x98, 0xBE, 0x37, 0x7B, 0xDB, 0x58,
5248 0xFC, 0xC1, 0x88, 0x7D, 0xD3, 0xBC, 0x8F, 0xB4, 0x7C, 0xB2,
5249 0xFE, 0x3E, 0x26, 0x36, 0x95, 0x7E, 0xDB, 0xD1, 0x38, 0x29,
5250 0xD9, 0xCF, 0x5D, 0x0E, 0xD1, 0xDF, 0x7F, 0xD1, 0x68, 0x04,
5251 0x70, 0x6F, 0x61, 0x39, 0x49, 0x44, 0xD2, 0x5C, 0x0C, 0xC3,
5252 0xD6, 0xF8, 0x1E, 0x96, 0x36, 0x43, 0x79, 0xB2, 0xE5, 0x1A,
5253 0xF1, 0x32, 0x03, 0xE1, 0x22, 0x45, 0x20, 0x1B, 0x36, 0x6A,
5254 0xB8, 0x62, 0xA5, 0xC5, 0x85, 0x8B, 0xED, 0x42, 0x69, 0xC6,
5255 0x30, 0x36, 0xA1, 0xF6, 0x22, 0x8D, 0x37, 0xD8, 0xE4, 0xBD,
5256 0x26, 0x8B, 0x89, 0xC2, 0xA9, 0x10, 0x82, 0xDD, 0x0C, 0x2D,
5257 0x04, 0x39, 0xB7, 0x59, 0x0B, 0x30, 0x2A, 0x6D, 0x84, 0x4A,
5258 0x74, 0xB9, 0x3F, 0xEA, 0xA5, 0x34, 0x76, 0xFA, 0xAD, 0x99,
5259 0xB0, 0xEF, 0xA0, 0xF1, 0x85, 0x3D, 0x00, 0x76, 0x00, 0xF8,
5260 0xFA, 0x1B, 0xAA, 0xB7, 0x5A, 0x62, 0x0E, 0xFD, 0xDC, 0x7A,
5261 0xCA, 0x18, 0x43, 0x32, 0x02, 0xB7, 0x20, 0x38, 0x0B, 0x50,
5262 0x4E, 0x57, 0xBF, 0x88, 0xBA, 0x09, 0xD3, 0x9D, 0x8B, 0x3A,
5263 0x88, 0x82, 0xD9, 0xC3, 0x60, 0x89, 0x10, 0xF5, 0x09, 0x61,
5264 0x72, 0x41, 0x83, 0xCB, 0x29, 0x38, 0xB3, 0x75, 0xD8, 0xBB,
5265 0x7E, 0x3F, 0x4A, 0x3C, 0x6B, 0xE5, 0xAE, 0xB7, 0x18, 0xC1,
5266 0x52, 0x3C, 0x8D, 0x8B, 0xF3, 0x8B, 0x84, 0x98, 0x3E, 0xE3,
5267 0x5F, 0x5B, 0x89, 0xB7, 0x07, 0x58, 0xD3, 0x7B, 0x84, 0x38,
5268 0x57, 0x3B, 0xF7, 0x59, 0x22, 0x6B, 0xA7, 0x31, 0x1D, 0xAF,
5269 0xBF, 0xFA, 0x15, 0x8B, 0xE0, 0x72, 0xFA, 0xCA, 0xB6, 0xC2,
5270 0xD6, 0x42, 0x43, 0x27, 0xF6, 0xAA, 0x3E, 0x5B, 0x07, 0x12,
5271 0x5C, 0xEF, 0xED, 0xCB, 0xDF, 0xAA, 0x5F, 0xF8, 0x77, 0xD0,
5272 0x8E, 0xC7, 0x03, 0x1E, 0x23, 0x5A, 0xF1, 0x3A, 0xA9, 0x10,
5273 0x6F, 0x05, 0x46, 0x04, 0x72, 0x63, 0xAC, 0xAE, 0x4B, 0x3D,
5274 0x1E, 0x2D, 0xC2, 0xE9, 0x38, 0x6A, 0xA9, 0x11, 0x1E, 0xE0,
5275 0xCA, 0x06, 0x7A, 0x5A, 0x45, 0xB2, 0x82, 0x0C, 0x10, 0xEB,
5276 0x0D, 0x10, 0x26, 0x74, 0xA5, 0x07, 0x1B, 0xBA, 0x61, 0xFD,
5277 0x8C, 0x73, 0xCB, 0x96, 0xFC, 0xF8, 0x98, 0x2D, 0x83, 0x12,
5278 0x0B, 0x6A, 0x9C, 0xA4, 0x70, 0x95, 0x4B, 0xD8, 0x11, 0x71,
5279 0x8F, 0x22, 0x89, 0xA2, 0x6A, 0x0A, 0xB0, 0x17, 0x93, 0x46,
5280 0x89, 0x60, 0x58, 0x2E, 0x1F, 0x3B, 0xE1, 0x6F, 0x49, 0x47,
5281 0xBC, 0x93, 0xD2, 0x14, 0x3D, 0xF2, 0x21, 0xA4, 0xFA, 0x1F,
5282 0x9D, 0x3F, 0x08, 0x40, 0x17, 0x77, 0x58, 0x7F, 0x65, 0xB4,
5283 0xFD, 0x01, 0x67, 0xF1, 0x62, 0x77, 0xD8, 0x6D, 0x46, 0x42,
5284 0x30, 0x52, 0x64, 0x4C, 0x76, 0x64, 0x7E, 0x09, 0xDD, 0x57,
5285 0x04, 0xB8, 0x4A, 0x7F, 0x8A, 0x68, 0xC3, 0x0D, 0xD9, 0xBE,
5286 0xF6, 0x61, 0x1C, 0x4D, 0x30, 0x80, 0x18, 0x83, 0xD6, 0x3F,
5287 0xB9, 0x58, 0x52, 0x20, 0xB9, 0x60, 0xEA, 0x22, 0xD0, 0xD0,
5288 0x61, 0x1A, 0x3B, 0x32, 0x69, 0x35, 0x8B, 0x22, 0x6E, 0x27,
5289 0x2E, 0xE2, 0x6D, 0xBA, 0xC7, 0x17, 0x02, 0xDA, 0x83, 0x22,
5290 0x5C, 0x31, 0x60, 0xD6, 0x78, 0x78, 0xBF, 0x0B, 0xEE, 0xD4,
5291 0x68, 0x32, 0xAE, 0x17, 0x80, 0x04, 0x7F, 0xD9, 0xA9, 0xA0,
5292 0xC9, 0xB7, 0x98, 0xEE, 0x9C, 0x8C, 0x61, 0x70, 0xBB, 0x2F,
5293 0x10, 0x39, 0x3E, 0xCC, 0x6E, 0xC8, 0x0A, 0x0F, 0xA2, 0x1E,
5294 0x31, 0x01, 0x75, 0x1E, 0x41, 0x9E, 0x63, 0x14, 0xC2, 0x3A,
5295 0xD9, 0x1A, 0x8B, 0x52, 0x0D, 0xFD, 0xDC, 0xE6, 0x23, 0x35,
5296 0xF1, 0x17, 0xE4, 0xA6, 0xDB, 0xAC, 0x3F, 0x67, 0x59, 0x02,
5297 0x8E, 0x20, 0x6F, 0x55, 0x69, 0xF8, 0x16, 0xFC, 0x33, 0x53,
5298 0xCA, 0xE8, 0x4E, 0x3F, 0xA4, 0x5C, 0xA6, 0xA4, 0x95, 0xCD,
5299 0xB7, 0x9D, 0x14, 0x79, 0xAE, 0x82, 0xF8, 0x2F, 0xE2, 0x13,
5300 0x0D, 0xDE, 0x75, 0x19, 0xA4, 0x0C, 0x32, 0x83, 0xD0, 0x14,
5301 0x35, 0xE7, 0x77, 0xD0, 0x18, 0x9C, 0xEF, 0xCC, 0xD5, 0xDA,
5302 0x39, 0x3B, 0xFF, 0x11, 0x39, 0x20, 0x3D, 0x5A, 0xB1, 0x16,
5303 0x2A, 0x57, 0x6B, 0x27, 0xC1, 0xB6, 0x69, 0xB5, 0x9B, 0x78,
5304 0x6F, 0x6B, 0x8A, 0xEF, 0x3F, 0x8F, 0xB8, 0x37, 0xBF, 0xCA,
5305 0x2D, 0x27, 0x25, 0x12, 0xC9, 0x81, 0x3A, 0x4C, 0x1A, 0x94,
5306 0xDF, 0x6D, 0x27, 0xF8, 0x85, 0x26, 0xA0, 0x88, 0x56, 0x7B,
5307 0x62, 0x5E, 0x84, 0xCF, 0x84, 0xAB, 0x81, 0xA3, 0xD4, 0xEB,
5308 0xE9, 0x85, 0x96, 0xED, 0x27, 0x42, 0xF6, 0x86, 0x28, 0xF1,
5309 0x8C, 0x69, 0x81, 0xD9, 0xAC, 0x1E, 0x9F, 0x12, 0xA4, 0x9E,
5310 0x78, 0xC5, 0x2E, 0x07, 0x66, 0xFF, 0x2F, 0xED, 0x93, 0xD2,
5311 0x62, 0x30, 0x30, 0x81, 0xE5, 0x76, 0x7A, 0x2A, 0x8E, 0xF3,
5312 0xC0, 0x21, 0x9C, 0xE8, 0xE3, 0x51, 0x4F, 0xDA, 0x96, 0xCF,
5313 0x6A, 0x0A, 0xC9, 0x90, 0x64, 0x93, 0x70, 0xE2, 0xAD, 0x6E,
5314 0x17, 0x06, 0x5E, 0xBD, 0x5C, 0x40, 0x4B, 0x43, 0x78, 0x1F,
5315 0x40, 0x55, 0x36, 0xBD, 0x2B, 0xD6, 0x92, 0x88, 0x02, 0xAA,
5316 0x3E, 0xDF, 0x3B, 0xC9, 0x90, 0x69, 0x28, 0xE6, 0xE1, 0x7D,
5317 0xBD, 0x2A, 0xC1, 0x6F, 0x70, 0x6D, 0xB8, 0x1A, 0xAD, 0x66,
5318 0x4F, 0x78, 0xF7, 0x00, 0x57, 0xED, 0xA8, 0xC3, 0x87, 0x8A,
5319 0x27, 0x2E, 0xFC, 0xC4, 0x37, 0xB9, 0xED, 0xAE, 0x06, 0x05,
5320 0x19, 0x60, 0x53, 0x85, 0x54, 0x83, 0x52, 0xEC, 0xBF, 0xA5,
5321 0x79, 0xFC, 0x18, 0xC3, 0xD8, 0x98, 0xC5, 0xD8, 0x81, 0x78,
5322 0x4F, 0xDA, 0x24, 0xAD, 0x6F, 0xF4, 0x78, 0x56, 0x79, 0x9F,
5323 0x5D, 0xE3, 0x6D, 0x35, 0x93, 0xEA, 0xA8, 0xB5, 0x44, 0x1A,
5324 0xDA, 0x87, 0xBD, 0x06, 0x4D, 0xFF, 0x35, 0x2A, 0x76, 0x51,
5325 0xD3, 0xC2, 0x73, 0x20, 0x93, 0x33, 0xC0, 0xEA, 0x88, 0xA0,
5326 0xCD, 0xE1, 0xEA, 0x79, 0x86, 0x32, 0xA7, 0xCE, 0xBA, 0x73,
5327 0xE9, 0x82, 0x32, 0x64, 0x88, 0x44, 0x66, 0x8A, 0x8C, 0xCB,
5328 0xF1, 0xDB, 0x42, 0x91, 0x3E, 0x78, 0x3A, 0x77, 0xEB, 0x4C,
5329 0xFD, 0xFE, 0x43, 0xD8, 0xEA, 0x9E, 0xED, 0x19, 0xAD, 0xA8,
5330 0x64, 0x1A, 0x12, 0xC3, 0x81, 0x75, 0xA0, 0x61, 0xAF, 0x4F,
5331 0x71, 0x25, 0x94, 0x76, 0x31, 0x9A, 0xF6, 0x14, 0x3F, 0x6D,
5332 0x36, 0xC0, 0x2F, 0x52, 0x3B, 0x4B, 0xCB, 0x2B, 0xCF, 0xB8,
5333 0x70, 0x19, 0x0D, 0x15, 0x1A, 0xF9, 0x48, 0xA8, 0x3A, 0x55,

NetBurner, Inc.
22.205 certs_test.h 1155

5334 0xAF, 0x18, 0x66, 0x50, 0xC8, 0x32, 0x97, 0x43, 0x1E, 0x9F,
5335 0x8B, 0x66, 0xC1, 0x2E, 0x37, 0x69, 0xB8, 0x97, 0xF9, 0x6A,
5336 0x1E, 0x69, 0xBA, 0x5C, 0xEC, 0x6F, 0xFD, 0x99, 0x71, 0xB8,
5337 0xC4, 0x05, 0xB9, 0xB9, 0xE6, 0x4D, 0xA7, 0x01, 0x2D, 0xEB,
5338 0x26, 0x23, 0x40, 0x4D, 0x79, 0x1B, 0xE4, 0xD9, 0xAB, 0x9F,
5339 0xE9, 0x9B, 0x35, 0x78, 0xC0, 0x32, 0x8E, 0xF7, 0x5F, 0x7E,
5340 0xB5, 0x56, 0xD2, 0xA1, 0x35, 0x81, 0x72, 0xD2, 0x6A, 0x0A,
5341 0xC9, 0x6D, 0x0D, 0xDB, 0x2B, 0xA4, 0x02, 0x92, 0x76, 0x26,
5342 0xAF, 0x36, 0x27, 0x01, 0xDF, 0xA5, 0x5B, 0x09, 0x97, 0x06,
5343 0x5E, 0x80, 0xB0, 0x32, 0xFC, 0x1F, 0x72, 0x4E, 0x93, 0x2F,
5344 0x12, 0xF3, 0xA2, 0x60, 0x19, 0x74, 0x69, 0x03, 0x8B, 0x7D,
5345 0x6B, 0x2C, 0xE9, 0x54, 0x91, 0xF1, 0x3F, 0x2B, 0xF1, 0x65,
5346 0x71, 0x0B, 0x24, 0xEF, 0xCC, 0xB8, 0x79, 0x8E, 0x9B, 0x03,
5347 0xC1, 0xFF, 0xAC, 0xF0, 0x04, 0xEA, 0x92, 0xA3, 0x86, 0x64,
5348 0x6B, 0x63, 0x43, 0xA6, 0xC3, 0xCB, 0x43, 0xBE, 0xB0, 0xA9,
5349 0x11, 0x1B, 0x74, 0xC0, 0x87, 0x61, 0x5C, 0xDB, 0xF4, 0xA3,
5350 0x0E, 0xA6, 0x36, 0xEE, 0x41, 0x7F, 0xA8, 0xA6, 0xDF, 0x1B,
5351 0x05, 0xAE, 0x77, 0x90, 0x6A, 0xD4, 0x5B, 0x8E, 0x27, 0xE2,
5352 0xC0, 0x3E, 0x99, 0xAB, 0xFD, 0xFE, 0x6B, 0x71, 0xB4, 0x22,
5353 0x77, 0x7A, 0xB0, 0x43, 0x8B, 0x81, 0x33, 0x4D, 0x51, 0xD4,
5354 0xAB, 0xD9, 0xA0, 0x7C, 0xA7, 0x8A, 0x39, 0x92, 0x45, 0x39,
5355 0xAC, 0x54, 0x13, 0x6E, 0xA5, 0x22, 0x28, 0xC8, 0xAD, 0x3D,
5356 0xB1, 0xB2, 0xF3, 0x6B, 0xF6, 0x51, 0x17, 0xA3, 0x37, 0xE9,
5357 0xC9, 0x94, 0x54, 0xD7, 0x64, 0xC6, 0x04, 0xE7, 0xFA, 0x93,
5358 0xC1, 0xFA, 0xBA, 0xCA, 0x21, 0x1B, 0xF0, 0x6C, 0x99, 0x22,
5359 0x52, 0x53, 0xEF, 0xC2, 0xA2, 0x19, 0xB3, 0xCA, 0xF5, 0x30,
5360 0xC1, 0xD1, 0x24, 0x7F, 0x3A, 0x28, 0x8F, 0xAA, 0x70, 0xD2,
5361 0xBB, 0x7A, 0xF5, 0x8A, 0x23, 0x57, 0xE9, 0x79, 0x00, 0xF4,
5362 0x1C, 0x1D, 0xB1, 0x42, 0x0C, 0x53, 0x99, 0x7B, 0x99, 0x68,
5363 0x6E, 0x71, 0xD9, 0xD4, 0xE9, 0xC1, 0xA7, 0x5B, 0x05, 0xA7,
5364 0x6F, 0xF2, 0xE7, 0x11, 0x3B, 0x70, 0x5F, 0x11, 0x98, 0xBE,
5365 0xB5, 0xF8, 0x78, 0x5F, 0x5C, 0x19, 0xAC, 0x92, 0x4D, 0x18,
5366 0x0D, 0x7B, 0x6F, 0x8C, 0x90, 0xAB, 0x6B, 0x32, 0x3D, 0x51,
5367 0x11, 0xBC, 0x80, 0xC4, 0xCF, 0x4A, 0xF4, 0x7F, 0xCC, 0x68,
5368 0x92, 0x76, 0xF7, 0x9D, 0xF7, 0x07, 0x44, 0x8C, 0xB5, 0x4D,
5369 0x53, 0x7E, 0xE2, 0x58, 0x42, 0xB5, 0x8E, 0xB3, 0xC7, 0x0C,
5370 0x2F, 0xCA, 0x77, 0x2D, 0x56, 0x84, 0xCA, 0x98, 0x05, 0x09,
5371 0x43, 0xA9, 0x0E, 0x92, 0x4B, 0x57, 0x27, 0x46, 0x31, 0xF0,
5372 0xE3, 0xA4, 0x48, 0xD9, 0x42, 0x51, 0x32, 0xF0, 0x70, 0xA1,
5373 0x72, 0xA9, 0x2B, 0x1D, 0xB1, 0x2A, 0x09, 0x96, 0xAE, 0x3E,
5374 0x83, 0x41, 0x7B, 0x9B, 0x28, 0x6E, 0x85, 0xB7, 0xAD, 0x7F,
5375 0x10, 0xA3, 0x54, 0xBF, 0x24, 0xB6, 0xFB, 0x6D, 0xA5, 0x9F,
5376 0xE6, 0xBB, 0x33, 0x8A, 0x04, 0x83, 0x53, 0xFB, 0xB9, 0x79,
5377 0xF7, 0x76, 0xC9, 0x43, 0xC7, 0xE4, 0xB5, 0xE7, 0x19, 0x56,
5378 0x72, 0x55, 0xAC, 0x1D, 0xA8, 0xE4, 0xD8, 0x0C, 0x66, 0x15,
5379 0x7F, 0x17, 0x08, 0xB9, 0x33, 0x4B, 0x9C, 0x84, 0xDA, 0x49,
5380 0x9F, 0x1B, 0x42, 0x85, 0x0F, 0x4B, 0xC0, 0x70, 0x35, 0x23,
5381 0x34, 0xD9, 0x3C, 0x76, 0xF9, 0x22, 0x5C, 0x1A, 0xE9, 0x81,
5382 0xE5, 0x31, 0xA3, 0xF1, 0xB7, 0x7F, 0xE2, 0x75, 0x42, 0x27,
5383 0x82, 0xC7, 0xBA, 0x68, 0x20, 0x0E, 0xAC, 0xD0, 0x32, 0x28,
5384 0xB5, 0x99, 0x71, 0xBA, 0x48, 0x2C, 0x95, 0xA5, 0xC8, 0x65,
5385 0x2E, 0x19, 0x70, 0xAD, 0x12, 0x3A, 0xAD, 0x83, 0x87, 0x15,
5386 0xA7, 0xEA, 0x9D, 0x6E, 0x11, 0x94, 0x95, 0x23, 0x51, 0xDA,
5387 0x5F, 0x67, 0xBD, 0xDD, 0xA7, 0xF9, 0xF8, 0x76, 0xE4, 0x3C,
5388 0x83, 0x0A, 0xAB, 0xBE, 0x6A, 0xB0, 0xC5, 0xA8, 0xBE, 0xD9,
5389 0xDD, 0xBC, 0x4E, 0xA6, 0xCF, 0x91, 0xB3, 0x42, 0x30, 0x96,
5390 0x8E, 0x45, 0xC6, 0x1F, 0x55, 0x6B, 0x2C, 0x0A, 0xBC, 0x9F,
5391 0x69, 0x65, 0x98, 0x34, 0x95, 0x6A, 0x1E, 0x86, 0x78, 0x8B,
5392 0x26, 0x4F, 0x05, 0x76, 0x03, 0x22, 0xCB, 0x72, 0xF1, 0xD0,
5393 0x1A, 0x64, 0x19, 0xC7, 0x21, 0x5C, 0x51, 0xD0, 0x6C, 0x0B,
5394 0xDA, 0xB9, 0x67, 0x7A, 0x83, 0xC3, 0x1E, 0x16, 0x27, 0x4A,
5395 0x00, 0x5F, 0xBA, 0x0E, 0x45, 0x81, 0x6E, 0xE7, 0x5B, 0x5A,
5396 0x8F, 0x0D, 0x6D, 0x47, 0xB1, 0x30, 0xA7, 0x42, 0x1E, 0xA9,
5397 0x8A, 0x27, 0x4A, 0xB0, 0x60, 0x2F, 0xA9, 0x12, 0x42, 0xD6,
5398 0x7F, 0x10, 0x01, 0xF3, 0x59, 0xD2, 0x40, 0x11, 0x19, 0x92,
5399 0xFE, 0x80, 0x25, 0x1B, 0x60, 0xDC, 0x02, 0x7B, 0x10, 0x45,
5400 0x17, 0x66, 0x70, 0xB9, 0x64, 0x4A, 0xBA, 0xAD, 0xBF, 0x55,
5401 0x7C, 0xB3, 0xD8, 0x18, 0x6D, 0x16, 0x53, 0xED, 0x89, 0xE5,
5402 0xD2, 0x50, 0xFA, 0xA8, 0xFE, 0x74, 0x67, 0xC4, 0x35, 0x4C,
5403 0xC4, 0xBE, 0x52, 0x9A, 0x8E, 0xBB, 0xB6, 0xE0, 0xAF, 0x52,
5404 0x57, 0x3D, 0x99, 0x79, 0x10, 0xB8, 0xE6, 0xAB, 0x24, 0x9E,
5405 0x75, 0xC2, 0x2A, 0xFB, 0xDB, 0xF8, 0xE0, 0x02, 0xCB, 0x49,
5406 0x56, 0x52, 0x6B, 0x8C, 0xFA, 0x8E, 0xCF, 0xFA, 0x18, 0x50,
5407 0xDD, 0x98, 0x49, 0xEC, 0xA8, 0x08, 0x6C, 0x60, 0xC0, 0x68,
5408 0xBF, 0x7B, 0x49, 0xB4, 0xE6, 0x49, 0x59, 0x6E, 0x65, 0x0E,
5409 0x41, 0xEA, 0x64, 0xC8, 0xD3, 0x1A, 0x9F, 0x39, 0xAE, 0xEB,
5410 0x3C, 0x88, 0xFB, 0x40, 0xDC, 0xB8, 0x07, 0x82, 0x56, 0x01,
5411 0xAC, 0x04, 0x0B, 0x6B, 0x0B, 0x15, 0xAA, 0x4F, 0xD2, 0x04,
5412 0xF3, 0x65, 0xCD, 0xF7, 0x32, 0xB1, 0x95, 0xC4, 0x91, 0xB8,
5413 0x63, 0x02, 0x26, 0x47, 0x1D, 0x6E, 0x6D, 0xCF, 0x3D, 0x39,
5414 0x3D, 0xDC, 0x18, 0x33, 0xD8, 0xF5, 0x8C, 0xB0, 0x69, 0x53,
5415 0x48, 0x86, 0x14, 0x50, 0xA3, 0x65, 0xEE, 0x2C, 0x2F, 0x72,
5416 0xF7, 0x43, 0xE7, 0xEA, 0xA0, 0x3E, 0x3C, 0x30, 0x33, 0xD9,
5417 0x1D, 0x6E, 0x5D, 0xCB, 0xE1, 0xE0, 0x8D, 0x95, 0xD2, 0x58,
5418 0x8D, 0xD5, 0xB3, 0x1C, 0x22, 0x28, 0x6A, 0xBB, 0xB3, 0x09,
5419 0xB1, 0x91, 0x60, 0xE2, 0xC6, 0x48, 0x11, 0xF0, 0x49, 0xB6,
5420 0xE9, 0xEF, 0x4B, 0xC6, 0xDB, 0xB1, 0xBF, 0x6C, 0xB2, 0x92,

NetBurner, Inc.
1156 File Documentation

5421 0x5C, 0x65, 0x91, 0x67, 0x81, 0x9C, 0x71, 0x5A, 0x2C, 0xFE,
5422 0xC8, 0xF9, 0xF5, 0x96, 0x7D, 0x3E, 0xBB, 0x7F, 0xEF, 0xF7,
5423 0xBF, 0xF8, 0xAC, 0xCF, 0xA6, 0x6F, 0x28, 0x9C, 0x09, 0x65,
5424 0x8F, 0xF7, 0xDC, 0xEF, 0x3E, 0x4B, 0xCD, 0x6D, 0x97, 0xD3,
5425 0xCC, 0x9C, 0xF7, 0xF2, 0x4C, 0xE6, 0x64, 0x31, 0xE8, 0x1E,
5426 0xDE, 0x56, 0xAE, 0xA6, 0x04, 0xFB, 0xED, 0x2E, 0x3F, 0x23,
5427 0x7D, 0xBC, 0x6D, 0xCC, 0x4B, 0xD4, 0x9E, 0x06, 0x83, 0xE1,
5428 0x95, 0xAE, 0xC4, 0xAA, 0x6E, 0xFF, 0x9E, 0x1C, 0xB9, 0x07,
5429 0x60, 0x6D, 0xD5, 0x09, 0x06, 0x30, 0x0C, 0x3F, 0xB5, 0xE8,
5430 0x8B, 0x01, 0x94, 0x1B, 0x84, 0xE9, 0xB7, 0x37, 0x03, 0xA7,
5431 0xAF, 0x4B, 0x63, 0x3F, 0xD2, 0x57, 0xBB, 0xB8, 0xBF, 0xE2,
5432 0x53, 0x4F, 0xA1, 0x9E, 0xC7, 0x4C, 0xDA, 0x89, 0x25, 0x0E,
5433 0x7E, 0xC9, 0x44, 0x7F, 0x4C, 0x02, 0x7F, 0xA4, 0x08, 0xEC,
5434 0x7F, 0x44, 0xEA, 0xF7, 0xCF, 0x1B, 0x19, 0xFA, 0x6A, 0x0A,
5435 0x3E, 0xE1, 0xF4, 0x78, 0xDF, 0x93, 0xAB, 0x86, 0x9E, 0xE1,
5436 0x31, 0xBF, 0x70, 0x20, 0x8B, 0x87, 0xCE, 0xFC, 0x84, 0x03,
5437 0x8D, 0xF1, 0x25, 0xE6, 0x88, 0x30, 0x79, 0x63, 0xAF, 0x5C,
5438 0x3B, 0x84, 0xA9, 0xB8, 0x89, 0xB4, 0x23, 0x58, 0x78, 0xF9,
5439 0xAB, 0x76, 0x1B, 0x20, 0x56, 0xDB, 0x9E, 0xFE, 0x59, 0x29,
5440 0xB9, 0x8C, 0xD7, 0x4E, 0xA4, 0x5C, 0x7F, 0x40, 0xA8, 0xEB,
5441 0x0D, 0x90, 0xBA, 0x30, 0x68, 0x5E, 0x9C, 0x90, 0xBE, 0xD4,
5442 0x43, 0x4B, 0x67, 0x27, 0xE7, 0x7D, 0x06, 0xB8, 0xF0, 0x96,
5443 0xEF, 0xF4, 0x47, 0x5F, 0x8E, 0xCA, 0x46, 0x85, 0x3C, 0x94,
5444 0x9E, 0xDE, 0x09, 0x40, 0x45, 0xB3, 0x69, 0xF1, 0x8F, 0x90,
5445 0xF5, 0x5C, 0x22, 0x69, 0xBF, 0x5F, 0x11, 0x66, 0xD9, 0xDC,
5446 0x37, 0x6A, 0x2C, 0xAF, 0x72, 0x66, 0xC8, 0x28, 0xEA, 0x59,
5447 0x71, 0xB1, 0x7F, 0x10, 0xA5, 0xBC, 0x42, 0x99, 0xF6, 0xD6,
5448 0xB4, 0xC4, 0x18, 0x49, 0x72, 0x37, 0xF3, 0xCD, 0x01, 0xD6,
5449 0xAB, 0x2A, 0xFE, 0x1A, 0xBC, 0x52, 0x15, 0x38, 0x30, 0xF2,
5450 0x4F, 0xC0, 0xD3, 0x5B, 0x91, 0x5A, 0x55, 0xD1, 0x82, 0x5A,
5451 0x50, 0xE8, 0x16, 0x8C, 0x3D, 0xC8, 0x97, 0x3D, 0x2A, 0xA9,
5452 0xF3, 0xEA, 0x48, 0x57, 0x51, 0x29, 0xB0, 0x81, 0x4D, 0x6B,
5453 0x69, 0xFE, 0xF8, 0xA8, 0xE0, 0x5F, 0xF4, 0x98, 0xBE, 0x3D,
5454 0x39, 0xB6, 0x10, 0x3E, 0x70, 0x16, 0x60, 0x46, 0xA1, 0x74,
5455 0x5C, 0xF5, 0x53, 0x24, 0xF4, 0x56, 0x33, 0x97, 0x18, 0xB6,
5456 0x4A, 0x91, 0xE1, 0xF4, 0x36, 0x11, 0x80, 0xCF, 0xDE, 0xE3,
5457 0x7C, 0x8C, 0x27, 0xC9, 0x29, 0xA6, 0xCC, 0xA2, 0xE3, 0x61,
5458 0xED, 0x46, 0x10, 0x0D, 0x43, 0x1D, 0x63, 0xB2, 0x4B, 0xC0,
5459 0xFF, 0x79, 0x2D, 0x6D, 0xD1, 0x0E, 0xD4, 0x73, 0x24, 0xE2,
5460 0xFE, 0x07, 0x15, 0xC4, 0xB3, 0xFC, 0xDA, 0x14, 0x44, 0x81,
5461 0x89, 0xA9, 0x16, 0xEF, 0x8C, 0x60, 0xEE, 0x2D, 0xBC, 0x81,
5462 0xF1, 0xD8, 0xE1, 0x37, 0x5D, 0xC0, 0xD2, 0xA5, 0x8C, 0xF9,
5463 0xAF, 0xAA, 0xBE, 0xF6, 0x46, 0x65, 0xEB, 0x53, 0x97, 0x2F,
5464 0xDA, 0x28, 0x66, 0x29, 0x67, 0x1F, 0x1F, 0x0A, 0x61, 0x61,
5465 0x66, 0x61, 0xF2, 0xA7, 0x1F, 0x1C, 0x30, 0x1F, 0xDD, 0xDE,
5466 0xAB, 0xC7, 0x6C, 0x1C, 0xED, 0xC8, 0xDC, 0x09, 0xBA, 0xF9,
5467 0x93, 0x76, 0x4C, 0xCC, 0xAE, 0xF5, 0x2D, 0xA4, 0xAB, 0x3F,
5468 0xA0, 0x42, 0x4E, 0x8F, 0x28, 0x87, 0xE1, 0x64, 0xCA, 0xF4,
5469 0xB6, 0xAC, 0x39, 0x1E, 0x1C, 0xF2, 0x69, 0xFF, 0x30, 0x3B,
5470 0x2F, 0x5C, 0xB2, 0x82, 0xD8, 0x28, 0x2D, 0xA8, 0x2C, 0xDA,
5471 0x6D, 0x76, 0x38, 0xFC, 0x50, 0x6F, 0xA4, 0xB9, 0x52, 0x9F,
5472 0xD5, 0xFA, 0x94, 0xDC, 0x54, 0xED, 0xD9, 0x10, 0x6F, 0xDA,
5473 0x7E, 0x5E, 0x8A, 0xFB, 0xB3, 0x68, 0xD0, 0xD1, 0x25, 0x77,
5474 0x7E, 0x8B, 0x91, 0x68, 0x4E, 0xF4, 0x74, 0x99, 0x77, 0xB8,
5475 0x5C, 0xCE, 0xCC, 0x3D, 0x54, 0xA8, 0xD8, 0x4F, 0x01, 0x30,
5476 0x37, 0xB0, 0x82, 0x42, 0xB9, 0xB1, 0xBF, 0x83, 0xC8, 0xB6,
5477 0x40, 0x7F, 0xF2, 0xD8, 0x3C, 0xBD, 0x63, 0xCB, 0x23, 0x34,
5478 0xA4, 0xFB, 0x4C, 0xE0, 0x8B, 0x85, 0xA4, 0xA9, 0x7B, 0xA4,
5479 0x78, 0x86, 0xD4, 0xE9, 0x68, 0xA4, 0x40, 0x8D, 0xBC, 0x56,
5480 0x44, 0x8B, 0x24, 0x80, 0x6B, 0xC1, 0x84, 0xEC, 0xB3, 0x70,
5481 0x01, 0x0A, 0xFE, 0xED, 0x7D, 0xD9, 0x7E, 0xAB, 0x89, 0xDB,
5482 0xE3, 0x90, 0x5C, 0x6A, 0x75, 0x8E, 0x16, 0xF2, 0x0A, 0xFE,
5483 0x9E, 0x08, 0xC8, 0xB2, 0x35, 0x3C, 0xC3, 0x20, 0x29, 0xD4,
5484 0x8A, 0xA6, 0x58, 0x25, 0x43, 0x9B, 0x27, 0xAE, 0xBF, 0xC7,
5485 0x50, 0x82, 0x9F, 0x04, 0x88, 0x4C, 0xB0, 0x4E, 0x38, 0xA5,
5486 0x84, 0xC1, 0xBA, 0x6A, 0xA7, 0x16, 0x85, 0x76, 0xF5, 0x21,
5487 0x15, 0x3F, 0x00, 0x2C, 0x0A, 0xBD, 0x18, 0x66, 0x0C, 0xD1,
5488 0x46, 0x33, 0x1A, 0xF3, 0x85, 0x34, 0x68, 0x49, 0x05, 0x10,
5489 0x85, 0xF9, 0x61, 0xD6, 0xB6, 0x97, 0xFC, 0xAA, 0x2C, 0xBC,
5490 0xF1, 0x75, 0xF3, 0xFC, 0x57, 0x20, 0x54, 0xF2, 0x02, 0x5E,
5491 0xAB, 0xDD, 0x19, 0x31, 0xAB, 0x97, 0x5F, 0x11, 0x4F, 0xCE,
5492 0x4F, 0xB9, 0xBB, 0xA2, 0x01, 0x51, 0x48, 0x5A, 0x2C, 0x52,
5493 0xAD, 0x58, 0x00, 0x22, 0x41, 0x4D, 0x24, 0x68, 0x9F, 0xD9,
5494 0x13, 0x5C, 0x55, 0x0A, 0x62, 0xAD, 0x3E, 0x29, 0x86, 0x34,
5495 0x3B, 0x2D, 0x34, 0xBE, 0x0A, 0xDB, 0x85, 0x3A, 0x41, 0x2C,
5496 0x30, 0x56, 0x65, 0x04, 0x0A, 0x20, 0x31, 0x2A, 0xF3, 0x88,
5497 0x4C, 0x38, 0x64, 0x86, 0x14, 0x06, 0xF5, 0xF0, 0x7F, 0x63,
5498 0xC1, 0x87, 0x24, 0x39, 0xFB, 0xC0, 0xC2, 0x6B, 0x57, 0xB3,
5499 0xA9, 0x7C, 0x21, 0xD7, 0x17, 0xB5, 0x23, 0x89, 0x8B, 0x9A,
5500 0x53, 0xC6, 0x26, 0xD6, 0xC1, 0xD8, 0x3B, 0xD2, 0x30, 0x0B,
5501 0x30, 0x76, 0xB3, 0x21, 0x2B, 0xCF, 0x64, 0xB8, 0xCD, 0x8C,
5502 0xB9, 0x33, 0x73, 0xA5, 0x19, 0x5C, 0xBB, 0x4A, 0x6F, 0x9E,
5503 0xA7, 0x62, 0x61, 0x1C, 0x32, 0xBB, 0x3E, 0x1B, 0x8A, 0xAC,
5504 0xE5, 0xE1, 0xA9, 0xDD, 0x50, 0xFB, 0x3B, 0xCF, 0xB6, 0x49,
5505 0x7B, 0xED, 0x1A, 0x7E, 0x8E, 0x73, 0xAE, 0x8B, 0x31, 0x06,
5506 0x11, 0xC4, 0x84, 0x4C, 0xCA, 0x6D, 0x5A, 0x79, 0x50, 0x2E,
5507 0x66, 0x90, 0x0A, 0x13, 0x86, 0x15, 0x78, 0x06, 0xAD, 0x5D,

NetBurner, Inc.
22.205 certs_test.h 1157

5508 0x8C, 0x5E, 0xC8, 0x73, 0xB0, 0x82, 0xFB, 0x03, 0xE6, 0x30,
5509 0xE7, 0x0B, 0x99, 0xF0, 0xD9, 0x8C, 0x2C, 0xFA, 0x34, 0xAB,
5510 0x8B, 0xDD, 0x06, 0x2F, 0x39, 0xE0, 0x53, 0x37, 0x61, 0x3D,
5511 0xC3, 0x77, 0x4C, 0x9F, 0x66, 0x95, 0x81, 0x94, 0x0A, 0xE5,
5512 0xCE, 0x59, 0xA1, 0x83, 0x5C, 0x77, 0xBD, 0xF5, 0xAD, 0xE2,
5513 0x9C, 0x10, 0x64, 0x22, 0xAD, 0x99, 0x02, 0x3F, 0x6A, 0xB2,
5514 0x96, 0x2C, 0xF3, 0x21, 0xEB, 0x5A, 0x7D, 0xFC, 0x02, 0x9B,
5515 0x53, 0x94, 0xB1, 0x88, 0x3E, 0x07, 0x78, 0x31, 0x8F, 0xDF,
5516 0xDA, 0xAF, 0xB7, 0x55, 0xC9, 0x30, 0x74, 0x61, 0xD1, 0x75,
5517 0x15, 0xF1, 0x29, 0xB0, 0x8B, 0xD9, 0x19, 0xB3, 0x2E, 0x8C,
5518 0x3C, 0x4C, 0xED, 0x22, 0x0B, 0x07, 0xEC, 0xA8, 0x2B, 0x26,
5519 0xBA, 0x2A, 0xE3, 0xEB, 0x91, 0x2C, 0xDF, 0x28, 0xFD, 0xE3,
5520 0x12, 0x6D, 0xA8, 0x8C, 0xA9, 0xA0, 0x18, 0xAE, 0x18, 0xC4,
5521 0x05, 0x53, 0xF6, 0xF7, 0x69, 0xEF, 0xBB, 0xF8, 0xFF, 0x55,
5522 0xD9, 0x4E, 0xA0, 0xC9, 0x58, 0x38, 0x67, 0x31, 0xE7, 0x5C,
5523 0x46, 0x41, 0x58, 0x26, 0x48, 0x8C, 0x82, 0x91, 0xE4, 0x46,
5524 0x91, 0xE0, 0xA4, 0x4F, 0xA5, 0xFD, 0x28, 0x14, 0xC8, 0x07,
5525 0x73, 0xB9, 0x20, 0x7D, 0x94, 0xAF, 0xDC, 0xBF, 0x4A, 0x55,
5526 0xA8, 0x82, 0xBF, 0x6D, 0x22, 0xD2, 0xFF, 0x18, 0x5E, 0xFB,
5527 0xC4, 0xDE, 0x8B, 0x12, 0x58, 0x1E, 0x05, 0x51, 0x4A, 0x31,
5528 0x54, 0x26, 0xA5, 0xFD, 0x36, 0xED, 0x14, 0x80, 0x4E, 0x3F,
5529 0xB2, 0x4F, 0x43, 0x70, 0xAF, 0x63, 0x77, 0x86, 0x68, 0xF4,
5530 0x35, 0xC2, 0x4E, 0x57, 0x43, 0x63, 0x06, 0x07, 0x21, 0xCE,
5531 0x61, 0xDD, 0x5D, 0x1D, 0xA3, 0xF7, 0x24, 0x72, 0xED, 0x73,
5532 0x6A, 0xA0, 0xE6, 0x9C, 0x1A, 0xA3, 0xCF, 0x98, 0x47, 0xC2,
5533 0xE1, 0x29, 0x22, 0x1B, 0x7C, 0x14, 0x0E, 0xE2, 0x6B, 0x58,
5534 0x54, 0xA7, 0x3E, 0x0F, 0x07, 0x1D, 0xAB, 0xFD, 0x1C, 0x1E,
5535 0xE0, 0x24, 0xCB, 0x2B, 0xC8, 0x7D, 0x90, 0x83, 0x8D, 0x46,
5536 0x43, 0xB4, 0x30, 0x39, 0x26, 0x29, 0xEE, 0xAF, 0x67, 0x61,
5537 0x4C, 0x16, 0xF1, 0xF4, 0x01, 0x55, 0x71, 0x30, 0x1B, 0x18,
5538 0xC2, 0xF3, 0x8A, 0x26, 0x52, 0x63, 0xD0, 0xEA, 0x66, 0x04,
5539 0xD7, 0xCC, 0x09, 0xF1, 0x66, 0x62, 0xD1, 0x29, 0xFD, 0xCE,
5540 0x0A, 0x85, 0xD5, 0x2C, 0x5B, 0x0D, 0xC3, 0x53, 0x8F, 0x45,
5541 0xA1, 0x95, 0xEE, 0xAF, 0xC3, 0xC5, 0xEE, 0xE6, 0xCE, 0x4A,
5542 0x33, 0xDB, 0x8B, 0x29, 0x79, 0xBC, 0xF7, 0xC5, 0x33, 0xCD,
5543 0xC1, 0x74, 0x25, 0x69, 0xEC, 0x75, 0xA4, 0x05, 0x1D, 0x6D,
5544 0x6E, 0xEC, 0x77, 0xDC, 0xF9, 0x08, 0xB1, 0xFA, 0x38, 0x7F,
5545 0x8E, 0xDF, 0x74, 0x10, 0x27, 0x19, 0x52, 0xAB, 0x6B, 0x08,
5546 0xEB, 0x51, 0x22, 0xE7, 0x79, 0xDA, 0x9F, 0xC0, 0xD2, 0x5E,
5547 0x5C, 0x2A, 0xC7, 0xF8, 0x6B, 0xB6, 0x63, 0x06, 0x49, 0xB4,
5548 0xDD, 0xEB, 0x20, 0x6F, 0x5A, 0x5E, 0x78, 0x79, 0xA5, 0xAF,
5549 0x35, 0x6D, 0x36, 0xBA, 0xA4, 0x38, 0x98, 0x38, 0xD9, 0x59,
5550 0x81, 0x16, 0x8C, 0xCE, 0x78, 0xCA, 0xD1, 0x86, 0x8B, 0x3A,
5551 0xD9, 0xA5, 0x5B, 0x7C, 0x53, 0x24, 0xB8, 0xD2, 0x2B, 0x09,
5552 0x73, 0x04, 0x87, 0x3E, 0x39, 0x64, 0x42, 0x5A, 0xE1, 0xC8,
5553 0x72, 0xD5, 0x00, 0x06, 0x06, 0x81, 0x91, 0x7A, 0x12, 0xA1,
5554 0x91, 0xEC, 0xBF, 0xD6, 0xBC, 0xFD, 0x82, 0xDA, 0xEE, 0x3A,
5555 0xB7, 0xF1, 0x54, 0xE3, 0xBD, 0xE5, 0xC0, 0x18, 0xE9, 0x5C,
5556 0x49, 0x0C, 0xFA, 0x64, 0x80, 0x98, 0x5C, 0x44, 0x9B, 0x4A,
5557 0x48, 0x3E, 0x0C, 0xBE, 0x5E, 0xBB, 0x68, 0xDA, 0x09, 0xD7,
5558 0x00, 0x51, 0x5B, 0x13, 0x96, 0xC2, 0x8A, 0xCE, 0xB0, 0x8F,
5559 0xDF, 0x84, 0x77, 0x70, 0x4B, 0x0F, 0x6E, 0xC7, 0x62, 0x47,
5560 0xFA, 0xA8, 0x35, 0x18, 0x43, 0x93, 0x4C, 0x83, 0x13, 0x45,
5561 0x74, 0x76, 0x19, 0xA7, 0x71, 0x98, 0x8C, 0x2E, 0xFC, 0xA9,
5562 0x83, 0x64, 0xD1, 0xA3, 0x95, 0x33, 0x31, 0xDB, 0xA8, 0xC3,
5563 0xB9, 0x72, 0x80, 0x58, 0xEC, 0xEB, 0xFC, 0xF3, 0x03, 0x44,
5564 0xDC, 0x11, 0x06, 0x3A, 0x95, 0x81, 0x28, 0xDB, 0xAB, 0x36,
5565 0xC4, 0x37, 0x0C, 0xD4, 0x6B, 0xAF, 0x04, 0xD0, 0x23, 0x3F,
5566 0xDD, 0x08, 0x88, 0x06, 0x23, 0x39, 0xCF, 0xB2, 0xCF, 0x13,
5567 0x27, 0xE1, 0x4E, 0x21, 0xDA, 0x81, 0x58, 0x29, 0x70, 0x2B,
5568 0x26, 0xB7, 0xA7, 0x69, 0xA1, 0x86, 0xBC, 0xD9, 0x88, 0xED,
5569 0x70, 0x61, 0x94, 0x2D, 0xCD, 0x47, 0x57, 0xD0, 0xBD, 0x07,
5570 0x05, 0x7E, 0xA5, 0x35, 0x29, 0x15, 0xFA, 0x62, 0x7E, 0xB7,
5571 0x2A, 0xEB, 0x4F, 0xC4, 0x0D, 0x6D, 0x2E, 0x6D, 0x8F, 0x53,
5572 0x7C, 0x0B, 0x62, 0x72, 0xA5, 0x01, 0x5D, 0xD9, 0x52, 0xAF,
5573 0x60, 0x22, 0x90, 0xD0, 0xE6, 0x37, 0x25, 0x57, 0x73, 0x66,
5574 0xD5, 0x96, 0x6A, 0x23, 0x75, 0x43, 0xF7, 0x6A, 0xC8, 0x3E,
5575 0xAC, 0x20, 0xC8, 0x8A, 0xE3, 0xD1, 0xB4, 0x07, 0x87, 0x8E,
5576 0x3A, 0xEB, 0x43, 0x10, 0x91, 0x7F, 0x17, 0x96, 0x4B, 0x7A,
5577 0x31, 0x2A, 0x84, 0xFC, 0xFE, 0xB1, 0x26, 0x67, 0xD6, 0xAD,
5578 0xB8, 0xB7, 0x3D, 0x3A, 0x2F, 0xEE, 0x94, 0x2F, 0x05, 0xF1,
5579 0xD8, 0x8E, 0xD4, 0x97, 0xAF, 0x36, 0xCE, 0x01, 0x18, 0x0B,
5580 0x68, 0x41, 0x26, 0xEB, 0x38, 0x2B, 0xF6, 0xD2, 0x8A, 0x5A,
5581 0x79, 0x02, 0xA1, 0xE4, 0x49, 0x48, 0xCF, 0x55, 0x2B, 0x74,
5582 0x16, 0x63, 0x27, 0x9D, 0x25, 0xAA, 0x7F, 0x8A, 0x5D, 0x96,
5583 0x68, 0xF3, 0x58, 0x7C, 0x10, 0xCF, 0x6A, 0xE3, 0xE2, 0x80,
5584 0x90, 0xD3, 0x39, 0xF5, 0x62, 0x01, 0x33, 0x5F, 0xC2, 0xFD,
5585 0xAD, 0xE6, 0x2A, 0xB2, 0x3D, 0x89, 0x99, 0x7B, 0x17, 0x35,
5586 0xE4, 0x5C, 0x62, 0x10, 0x69, 0x10, 0x93, 0x57, 0x92, 0x15,
5587 0x53, 0xEC, 0x82, 0x17, 0x00, 0xFC, 0x13, 0x49, 0x58, 0x79,
5588 0x90, 0x36, 0x0D, 0x50, 0xA5, 0xFE, 0xAE, 0xE1, 0xB3, 0xAF,
5589 0x40, 0x98, 0x3C, 0xB7, 0xAB, 0xC9, 0x0B, 0x2B, 0xE8, 0x31,
5590 0x71, 0x0D, 0x47, 0xE1, 0xE0, 0x3D, 0xCB, 0xB0, 0x3E, 0x44,
5591 0x00, 0x18, 0x66, 0xD5, 0x44, 0xEF, 0x58, 0x6A, 0xC3, 0x98,
5592 0x86, 0x19, 0xBA, 0xCE, 0x24, 0xF0, 0x9A, 0xED, 0x55, 0xA9,
5593 0x1F, 0x52, 0xB2, 0xBA, 0x1A, 0x2C, 0x71, 0x9F, 0xD7, 0xE6,
5594 0xA1, 0x01, 0x64, 0x8B, 0x22, 0x22, 0x23, 0xC8, 0x2A, 0xBA,

NetBurner, Inc.
1158 File Documentation

5595 0x13, 0x5A, 0xDD, 0xC4, 0x0C, 0x1A, 0x3C, 0x4F, 0x1E, 0x0B,
5596 0x5B, 0xB5, 0x45, 0xA3, 0xDD, 0x4D, 0xE9, 0x00, 0x06, 0x60,
5597 0x59, 0xFC, 0x48, 0xB2, 0x3E, 0x32, 0xBF, 0xF8, 0x74, 0x4E,
5598 0x65, 0x9F, 0x89, 0x8D, 0xE4, 0x0C, 0xC1, 0x89, 0xCF, 0x19,
5599 0xF0, 0xBC, 0x75, 0xDC, 0xE4, 0xEA, 0x23, 0x18, 0x23, 0xC2,
5600 0xD2, 0xA4, 0x96, 0xA6, 0xC2, 0x73, 0x41, 0x1E, 0xD8, 0x9D,
5601 0x02, 0x02, 0x35, 0x16, 0x61, 0x9B, 0x6F, 0xCC, 0x16, 0x80,
5602 0x2B, 0xA5, 0xE2, 0x9B, 0x63, 0x9B, 0x4E, 0x75, 0xBD, 0xBD,
5603 0xF3, 0x36, 0x16, 0x53, 0x6B, 0x34, 0x33, 0xF4, 0xBC, 0x05,
5604 0x79, 0x8A, 0x1F, 0x23, 0xD8, 0x36, 0xCC, 0xDB, 0x37, 0x5A,
5605 0x1E, 0xCE, 0x6D, 0x27, 0x7B, 0x6C, 0x66, 0x11, 0xE3, 0x96,
5606 0xAD, 0xC3, 0xF9, 0x57, 0xF9, 0xA7, 0x4C, 0x4F, 0x8E, 0x97,
5607 0x70, 0xB1, 0x70, 0xE9, 0x77, 0xF0, 0xC2, 0xD0, 0x79, 0x12,
5608 0x79, 0x3F, 0xDB, 0x71, 0x66, 0x48, 0xDB, 0x5A, 0xFC, 0xA7,
5609 0x8E, 0xE4, 0x1A, 0x93, 0xFE, 0x49, 0xF5, 0x7D, 0xEF, 0xC4,
5610 0x4B, 0xC1, 0x10, 0x2A, 0xD6, 0xF0, 0x5D, 0xC4, 0x80, 0x8B,
5611 0x9C, 0x2E, 0x44, 0xFB, 0x71, 0xD3, 0xA3, 0x80, 0xFB, 0x77,
5612 0x60, 0x16, 0xAD, 0x0B, 0xEC, 0x75, 0x9A, 0x58, 0x4B, 0x6E,
5613 0xD8, 0xFD, 0xE9, 0x41, 0x46, 0x85, 0x43, 0xFD, 0x82, 0x53,
5614 0x51, 0x65, 0xF8, 0xD0, 0x26, 0x2B, 0xF2, 0xF9, 0xE9, 0x26,
5615 0xD7, 0x15, 0x84, 0x31, 0x80, 0xAE, 0xFD, 0xA5, 0x30, 0x65,
5616 0xEE, 0x52, 0xCA, 0x3C, 0x76, 0x16, 0x91, 0x5A, 0x26, 0x49,
5617 0x1A, 0x28, 0xC7, 0x81, 0x10, 0x95, 0xB8, 0x96, 0x09, 0x50,
5618 0x6D, 0xB1, 0x64, 0xA2, 0x87, 0xCF, 0x38, 0x3C, 0x3C, 0x6E,
5619 0x0B, 0x96, 0x97, 0xFC, 0x81, 0xBD, 0x7D, 0xE7, 0xCC, 0xB6,
5620 0xF7, 0xE8, 0x15, 0x05, 0xAF, 0xDE, 0x1C, 0x68, 0xC0, 0xCF,
5621 0xF8, 0x68, 0x94, 0x90, 0x7B, 0x7D, 0x98, 0x57, 0xDC, 0x86,
5622 0x6D, 0x69, 0xD6, 0x98, 0x62, 0x0F, 0x38, 0x99, 0x93, 0x99,
5623 0x55, 0xD6, 0xA5, 0x8C, 0x94, 0x62, 0xCB, 0xD9, 0xE8, 0xA4,
5624 0x7C, 0xDF, 0x21, 0xF4, 0x36, 0x65, 0xCF, 0x3F, 0xE4, 0x10,
5625 0xA5, 0xB4, 0x71, 0x08, 0x65, 0x98, 0x59, 0x70, 0x19, 0x7E,
5626 0x27, 0x13, 0x71, 0x3F, 0xD2, 0x91, 0x20, 0xFF, 0x53, 0xDB,
5627 0xD2, 0xD4, 0x07, 0x3A, 0x49, 0x72, 0x05, 0x66, 0xED, 0x7D,
5628 0xBC, 0x61, 0x70, 0x7F, 0x64, 0x41, 0xDD, 0xB3, 0x1B, 0x03,
5629 0xB8, 0x20, 0xE1, 0x5D, 0x07, 0x39, 0xFC, 0xD2, 0x30, 0x72,
5630 0xE8, 0x0F, 0xA7, 0xA2, 0x71, 0xE8, 0x3D, 0xD9, 0x2B, 0x5B,
5631 0xB4, 0x97, 0x2B, 0xC3, 0x58, 0xE1, 0x2B, 0x0F, 0xAA, 0x8C,
5632 0x5A, 0x72, 0xC7, 0xBB, 0xB6, 0x59, 0x2B, 0x73, 0x39, 0x9A,
5633 0x20, 0xE5, 0x9A, 0x70, 0x30, 0x7B, 0x28, 0xBE, 0xD6, 0x6A,
5634 0x04, 0x18, 0x41, 0xEF, 0x18, 0xCD, 0xB5, 0x69, 0xB6, 0x00,
5635 0x50, 0xEE, 0xF9, 0x45, 0x2F, 0x86, 0xEE, 0x04, 0xBE, 0xF8,
5636 0x88, 0x9E, 0x0D, 0xAC, 0x1B, 0xA9, 0xD1, 0xC1, 0xA5, 0x3E,
5637 0xF6, 0xD9, 0x78, 0x99, 0x9D, 0x2E, 0x26, 0x6C, 0xCA, 0x7C,
5638 0x4C, 0xC7, 0xAF, 0xAB, 0xF0, 0xBB, 0x93, 0x32, 0x03, 0x22,
5639 0xAF, 0x27, 0x6A, 0x9F, 0x53, 0x77, 0xA9, 0x6C, 0x83, 0xA2,
5640 0x46, 0x15, 0x61, 0x6C, 0xB3, 0x08, 0x6F, 0x5B, 0x85, 0x73,
5641 0x8A, 0xCD, 0x8A, 0xB0, 0x70, 0xAC, 0xA5, 0x22, 0x18, 0x87,
5642 0x54, 0x91, 0x6B, 0x34, 0x7F, 0x0B, 0x4E, 0xCA, 0x44, 0xB3,
5643 0xBE, 0xB0, 0x77, 0x28, 0x85, 0x73, 0xDD, 0x29, 0x70, 0x53,
5644 0xD9, 0xA2, 0x4F, 0x12, 0xCB, 0x41, 0xFD, 0x99, 0x27, 0xC7,
5645 0xA9, 0xCF, 0xB7, 0x5B, 0xFB, 0xCC, 0x77, 0xBA, 0x12, 0xE1,
5646 0xD6, 0xF6, 0x7C, 0x22, 0xB4, 0xED, 0xB0, 0xA0, 0x71, 0x59,
5647 0xD2, 0xF3, 0x14, 0xB2, 0x7C, 0x4A, 0x0A, 0xD6, 0x43, 0x10,
5648 0xA0, 0xF6, 0xC0, 0x6F, 0xB4, 0x31, 0x8F, 0x7B, 0xF8, 0x5A,
5649 0xC9, 0x91, 0x0F, 0x7A, 0xE5, 0xDF, 0x29, 0x11, 0x66, 0xFF,
5650 0x4C, 0x73, 0xA6, 0xC7, 0xA0, 0xCC, 0x7B, 0x73, 0x79, 0x36,
5651 0x1D, 0x5E, 0x7C, 0xE2, 0xC9, 0xF7, 0x56, 0xC4, 0x88, 0x71,
5652 0xC1, 0x03, 0xEE, 0xE7, 0xE0, 0xEE, 0x12, 0xD7, 0x3D, 0x3A,
5653 0xB2, 0x91, 0x51, 0xE1, 0x18, 0xFE, 0x66, 0x22, 0x84, 0xA6,
5654 0xC3, 0xD2, 0x54, 0xE9, 0xE5, 0xF8, 0xDB, 0xF1, 0xF9, 0x6A,
5655 0x01, 0x61, 0xCF, 0x3D, 0xDA, 0x89, 0x5B, 0xED, 0x89, 0x10,
5656 0xBA, 0x18, 0xB8, 0xBA, 0x66, 0x38, 0x0D, 0x37, 0xEC, 0x1E,
5657 0xF7, 0x06, 0xD6, 0xC0, 0x84, 0x06, 0x2F, 0x43, 0xBD, 0x50,
5658 0xA0, 0x05, 0x9B, 0x50, 0xCD, 0xBB, 0xB7, 0x93, 0xF0, 0x70,
5659 0x50, 0xB7, 0x03, 0x0F, 0x27, 0x70, 0x47, 0x8E, 0xEB, 0x14,
5660 0xE0, 0x81, 0xBC, 0x7F, 0xA5, 0x60, 0xB0, 0x09, 0xCA, 0x38,
5661 0xCB, 0x59, 0x85, 0x49, 0xB3, 0xD4, 0x29, 0x50, 0xE1, 0x04,
5662 0xBD, 0x9F, 0x6C, 0xA5, 0x76, 0xCB, 0xE6, 0x79, 0xED, 0xDD,
5663 0xB8, 0x98, 0xA9, 0x94, 0xDD, 0xD3, 0x2E, 0xE0, 0xEA, 0xCD,
5664 0xD3, 0x34, 0xDA, 0x78, 0xBE, 0x7A, 0xC9, 0x8C, 0xD6, 0x12,
5665 0x5B, 0xD0, 0x36, 0x11, 0x79, 0x52, 0xCA, 0xA1, 0xCC, 0x3D,
5666 0x5B, 0x1F, 0x35, 0x80, 0xCC, 0x56, 0xDA, 0xC9, 0x88, 0xB7,
5667 0xD3, 0x28, 0x86, 0x6F, 0x4E, 0x20, 0x56, 0x56, 0x62, 0x12,
5668 0x79, 0xDA, 0x3F, 0x75, 0xEC, 0x89, 0xDC, 0x90, 0x44, 0xAE,
5669 0xB8, 0x0E, 0x34, 0x76, 0xF9, 0xAE, 0xDF, 0x2C, 0x28, 0x0F,
5670 0xCF, 0x28, 0x0B, 0x7B, 0x8A, 0xC4, 0x9B, 0x0B, 0x3C, 0x3E,
5671 0xC2, 0x70, 0x88, 0x71, 0xED, 0x3B, 0x3D, 0x61, 0x73, 0xDC,
5672 0x1B, 0x1A, 0x89, 0x16, 0xE2, 0x36, 0x50, 0x96, 0x38, 0x44,
5673 0xB1, 0xB6, 0x23, 0xB1, 0x83, 0x51, 0x43, 0x7C, 0x37, 0x9C,
5674 0x83, 0xDB, 0x63, 0x3E, 0x02, 0x42, 0xFA, 0xE9, 0x0B, 0x22,
5675 0xCB, 0xA5, 0x1F, 0x09, 0x03, 0x1C, 0xD0, 0xAD, 0xCB, 0xEE,
5676 0xB5, 0x3F, 0xFC, 0xCD, 0x80, 0x04, 0x63, 0x44, 0x4F, 0x3F,
5677 0x2B, 0x17, 0x66, 0xE0, 0xA7, 0x1E, 0xA2, 0xB5, 0xE3, 0xD3,
5678 0x23, 0x76, 0xF9, 0x75, 0x7C, 0x39, 0x5C, 0x6A, 0x64, 0xF8,
5679 0x61, 0xDE, 0x66, 0x3F, 0xCD, 0x4F, 0x06, 0xEF, 0x9C, 0xCA,
5680 0x43, 0xA9, 0x32, 0x30, 0xDC, 0xB8, 0xA2, 0xE0, 0xAA, 0xEB,
5681 0x4D, 0x30, 0x8D, 0x0C, 0xD1, 0x5E, 0x04, 0xEE, 0xED, 0x46,

NetBurner, Inc.
22.205 certs_test.h 1159

5682 0x07, 0x9C, 0xF4, 0xD8, 0xD5, 0x78, 0x9A, 0x51, 0x93, 0xC6,
5683 0x95, 0x5C, 0x12, 0x48, 0x2B, 0x92, 0x7A, 0xE4, 0x57, 0x3D,
5684 0x37, 0xEC, 0xA0, 0x19, 0xEC, 0x0A, 0x45, 0x0B, 0xFE, 0x9F,
5685 0x5F, 0xA0, 0xB3, 0x05, 0xEE, 0xF9, 0x87, 0x76, 0x5C, 0xC1,
5686 0xAD, 0x92, 0x79, 0x50, 0xAC, 0x70, 0xB6, 0xE8, 0xBB, 0x7C,
5687 0xCA, 0xC2, 0x49, 0xAD, 0xB0, 0xDA, 0xD0, 0x28, 0x90, 0xC2,
5688 0xEE, 0x3D, 0x4C, 0xCD, 0xC8, 0x41, 0x89, 0x5C, 0x65, 0xB9,
5689 0x1C, 0xCA, 0x67, 0x7B, 0xEF, 0x0D, 0x7B, 0x69, 0x4B, 0x8E,
5690 0x51, 0x0D, 0xF7, 0x70, 0xB7, 0xB3, 0x4E, 0xC8, 0x87, 0x8D,
5691 0xD1, 0xDD, 0x20, 0x11, 0x3C, 0x34, 0xA3, 0x3B, 0x6F, 0xDD,
5692 0xF5, 0xB2, 0xB1, 0x21, 0x9A, 0xE0, 0x4A, 0xF0, 0xB9, 0xEB,
5693 0x64, 0xDB, 0xC6, 0xD6, 0x64, 0x8F, 0x1A, 0x2C, 0x40, 0x0A,
5694 0x24, 0xF4, 0x0C, 0x0F, 0x60, 0x04, 0xBA, 0x9D, 0x3A, 0xE7,
5695 0x05, 0x58, 0xB5, 0x29, 0xD4, 0xD3, 0x64, 0xED, 0xCE, 0x47,
5696 0x7B, 0xB0, 0x6E, 0xCC, 0x2F, 0x46, 0x3A, 0xFE, 0x11, 0xC6,
5697 0x6B, 0x91, 0x51, 0x6A, 0x17, 0xCD, 0x03, 0x35, 0x0E, 0x1C,
5698 0x0E, 0x8B, 0xDD, 0x46, 0x4F, 0x5D, 0x9A, 0x5C, 0xE1, 0x14,
5699 0x99, 0xE8, 0xF2, 0xA4, 0xED, 0xCF, 0x6F, 0xC6, 0xC1, 0x67,
5700 0x36, 0x49, 0x1F, 0x1E, 0x42, 0x92, 0x4D, 0x32, 0x05, 0x4E,
5701 0xA6, 0xD7, 0xC0, 0xEC, 0xB0, 0x3E, 0xFD, 0xA1, 0xA7, 0x08,
5702 0x6B, 0xE8, 0x7F, 0xCD, 0xF8, 0x3C, 0x53, 0x58, 0x4C, 0x97,
5703 0xE6, 0x8D, 0xFE, 0xA9, 0x49, 0x61, 0xD1, 0xF0, 0xA0, 0xC7,
5704 0xB4, 0x4F, 0xBE, 0xDD, 0x90, 0x92, 0x0B, 0xA0, 0x5E, 0x69,
5705 0xAC, 0xDA, 0x26, 0x99, 0xF8, 0xE3, 0x07, 0xB5, 0xB9, 0xB7,
5706 0x48, 0xC7, 0xA3, 0x64, 0x3E, 0xA0, 0xB6, 0xC1, 0xF8, 0x6E,
5707 0x23, 0xA3, 0x11, 0x52, 0xA8, 0x26, 0xBD, 0x1C, 0xAD, 0xEB,
5708 0xF7, 0xDF, 0xC6, 0x35, 0xB4, 0x92, 0xE5, 0xB0, 0x5B, 0x53,
5709 0x55, 0xAA, 0x6E, 0xAD, 0x36, 0x4B, 0xF0, 0xE5, 0x9E, 0x32,
5710 0xB6, 0xFF, 0x1C, 0x01, 0x35, 0x20, 0x5E, 0xAD, 0x3E, 0xA3,
5711 0x01, 0x5D, 0xA0, 0xC5, 0x1B, 0xC8, 0x69, 0xB8, 0xF2, 0x2B,
5712 0x2B, 0x69, 0xC4, 0x4E, 0xA3, 0xC6, 0x1C, 0xFE, 0xCC, 0x0C,
5713 0x79, 0x6E, 0xDD, 0xD4, 0x59, 0x93, 0x51, 0xA2, 0x41, 0x3A,
5714 0x7A, 0x7D, 0x19, 0x5C, 0x1A, 0x91, 0x3C, 0x68, 0x00, 0x42,
5715 0x58, 0x51, 0x26, 0x11, 0x1A, 0x1E, 0xDE, 0x3B, 0x64, 0x16,
5716 0xBC, 0xDC, 0x5A, 0xF7, 0x7E, 0x80, 0x04, 0x63, 0xED, 0xDB,
5717 0x68, 0x74, 0xC2, 0x6B, 0x36, 0x67, 0xFC, 0x81, 0xB3, 0x64,
5718 0xBC, 0xAC, 0xA4, 0x56, 0x55, 0x77, 0x86, 0x74, 0xE2, 0x68,
5719 0x02, 0xD5, 0x5A, 0x84, 0x8F, 0x0E, 0x7F, 0xA1, 0xE9, 0xA5,
5720 0x30, 0xEB, 0xB4, 0x3E, 0x31, 0x09, 0x7F, 0xE2, 0x21, 0x35,
5721 0x4F, 0xFA, 0x61, 0xD2, 0x42, 0xB5, 0xCC, 0x31, 0xDE, 0x9C,
5722 0xDD, 0x39, 0x71, 0x90, 0x69, 0x9C, 0xF3, 0x7B, 0x91, 0xB1,
5723 0x65, 0x44, 0x10, 0xEC, 0x5C, 0x31, 0xF5, 0xA5, 0x37, 0xFF,
5724 0x52, 0xDF, 0x21, 0x85, 0x8A, 0x08, 0x77, 0xD7, 0xEE, 0xCC,
5725 0xD8, 0x58, 0xEF, 0x5B, 0xDD, 0x12, 0xC0, 0x4E, 0xC2, 0x20,
5726 0xAD, 0x5E, 0x74, 0x37, 0xE0, 0x70, 0x1B, 0xBA, 0xA3, 0x84,
5727 0x39, 0x2C, 0x4F, 0x63, 0x77, 0x69, 0x6C, 0x60, 0x69, 0x00,
5728 0xF0, 0xCE, 0x19, 0x29, 0x62, 0xDA, 0x10, 0xD9, 0x15, 0x79,
5729 0xC5, 0x2B, 0xB0, 0xB3, 0x97, 0x8C, 0x98, 0x83, 0x9F, 0x25,
5730 0x3F, 0x56, 0x1F, 0x2C, 0x63, 0x77, 0xFA, 0xDB, 0x27, 0xDF,
5731 0x94, 0xAE, 0x08, 0x44, 0x75, 0x8A, 0xE8, 0x91, 0x72, 0xB0,
5732 0xD0, 0x93, 0xC5, 0x7B, 0xB1, 0xD0, 0xEB, 0xD8, 0xDD, 0x88,
5733 0x29, 0xF8, 0x36, 0xE7, 0x7C, 0xFD, 0x88, 0xFE, 0xA1, 0xEE,
5734 0x12, 0x9A, 0x0E, 0x84, 0x75, 0x15, 0xA8, 0xA0, 0xD7, 0xBC,
5735 0x72, 0x75, 0x7D, 0x4E, 0xDF, 0xEE, 0x30, 0x30, 0x23, 0x6D,
5736 0xCC, 0xE5, 0xD7, 0xFD, 0x11, 0xE0, 0x87, 0x65, 0xDE, 0xAA,
5737 0xF4, 0x2C, 0x64, 0x74, 0x1A, 0x0C, 0x7A, 0x0A, 0x5B, 0x85,
5738 0xF3, 0x35, 0xB8, 0x41, 0x27, 0x14, 0xFC, 0x2A, 0x8D, 0x28,
5739 0xD0, 0xA7, 0xDB, 0xB0, 0xD9, 0x5A, 0xA9, 0x0F, 0x0B, 0x2F,
5740 0xE0, 0x8E, 0x37, 0x82, 0x5E, 0x8E, 0x1E, 0x2F, 0xC2, 0xA6,
5741 0xF5, 0x89, 0x54, 0x77, 0x49, 0x49, 0xDC, 0xF4, 0x03, 0xF2,
5742 0x04, 0xD6, 0xC0, 0x43, 0xB1, 0x13, 0x2B, 0x0C, 0xC2, 0x14,
5743 0x93, 0x5A, 0x90, 0x20, 0x87, 0xA0, 0x4A, 0xB2, 0xD7, 0x25,
5744 0x81, 0x79, 0x3C, 0x9C, 0xF6, 0x92, 0xBB, 0x26, 0xB0, 0x25,
5745 0x93, 0x05, 0x60, 0xEC, 0x56, 0x3C, 0x92, 0x41, 0x63, 0x52,
5746 0x0F, 0x95, 0x06, 0x7D, 0xE8, 0x46, 0x90, 0x39, 0x69, 0xEA,
5747 0x6B, 0xA6, 0x64, 0x09, 0x7B, 0x2F, 0x34, 0xE0, 0x21, 0x29,
5748 0xDA, 0xE3, 0xCF, 0xFE, 0xA7, 0x8E, 0x14, 0x3A, 0xD7, 0x53,
5749 0x26, 0xD7, 0x82, 0x0E, 0x2A, 0x00, 0x43, 0xEB, 0x6A, 0x23,
5750 0x75, 0x28, 0xD0, 0x9B, 0x85, 0xE0, 0xFB, 0x14, 0x19, 0xF3,
5751 0x6A, 0x73, 0x6C, 0x97, 0x0E, 0x21, 0xFC, 0x0F, 0x26, 0xC5,
5752 0xCE, 0xB7, 0xC6, 0x59, 0xA2, 0xE6, 0x4C, 0xF4, 0xC7, 0xBB,
5753 0x9B, 0xA8, 0xFA, 0x12, 0xC7, 0xDA, 0x33, 0x26, 0x69, 0x83,
5754 0x49, 0xA8, 0x0A, 0x3E, 0xF0, 0xD4
5755 };
5756 static const int sizeof_bench_dilithium_level5_key = sizeof(bench_dilithium_level5_key);
5757
5758 /* certs/dilithium/bench_dilithium_aes_level2_key.der */
5759 static const unsigned char bench_dilithium_aes_level2_key[] =
5760 {
5761 0x30, 0x82, 0x0F, 0x1A, 0x02, 0x01, 0x00, 0x30, 0x0D, 0x06,
5762 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x02, 0x82, 0x0B, 0x0B,
5763 0x04, 0x04, 0x04, 0x82, 0x0F, 0x04, 0x04, 0x82, 0x0F, 0x00,
5764 0xDF, 0x3D, 0x6F, 0x4F, 0x6C, 0x02, 0x60, 0x28, 0x0D, 0xD1,
5765 0x31, 0xF7, 0xA6, 0xAF, 0x05, 0x6E, 0xCE, 0x17, 0xBC, 0x6A,
5766 0x1B, 0xF7, 0xCB, 0x0D, 0x3F, 0x06, 0x8A, 0x01, 0x9A, 0xF2,
5767 0x40, 0xF9, 0x70, 0xD7, 0x18, 0x17, 0xDF, 0xD2, 0x8D, 0x9A,
5768 0xFF, 0xC9, 0x44, 0x27, 0xDF, 0xCD, 0xAA, 0x41, 0x15, 0xBB,

NetBurner, Inc.
1160 File Documentation

5769 0xDF, 0x53, 0x98, 0x20, 0xC1, 0x26, 0x28, 0xC0, 0x3B, 0x58,
5770 0xFF, 0xA0, 0x34, 0x8A, 0xA2, 0x36, 0x8E, 0x9A, 0xA1, 0x87,
5771 0x8B, 0x55, 0xBF, 0x04, 0xA8, 0x3D, 0xA6, 0x23, 0x22, 0xF9,
5772 0x26, 0xA4, 0xC1, 0xF0, 0xEF, 0x11, 0x3D, 0xAA, 0x49, 0x91,
5773 0xAA, 0xAB, 0x90, 0xAF, 0x6C, 0x42, 0x0A, 0x38, 0x48, 0x21,
5774 0x17, 0x4C, 0x01, 0x41, 0x0C, 0x09, 0x06, 0x51, 0xD4, 0x20,
5775 0x00, 0xCC, 0xB2, 0x84, 0x49, 0x18, 0x24, 0xE3, 0x30, 0x66,
5776 0xD9, 0x06, 0x70, 0xC8, 0xB2, 0x44, 0x24, 0x08, 0x11, 0x0B,
5777 0x90, 0x29, 0xE2, 0x86, 0x81, 0xE3, 0x28, 0x0E, 0xA2, 0x92,
5778 0x50, 0x0C, 0x31, 0x6D, 0x10, 0xA9, 0x4C, 0xA4, 0x48, 0x60,
5779 0x03, 0x36, 0x10, 0x64, 0x80, 0x91, 0x43, 0xA8, 0x68, 0x60,
5780 0x42, 0x20, 0x19, 0x44, 0x80, 0x51, 0x82, 0x64, 0x18, 0x87,
5781 0x09, 0x51, 0x84, 0x29, 0x40, 0x34, 0x31, 0x91, 0x42, 0x8D,
5782 0x09, 0xB4, 0x6C, 0xD3, 0xC6, 0x68, 0x58, 0x00, 0x12, 0x82,
5783 0x44, 0x4C, 0x21, 0x29, 0x6C, 0x44, 0x12, 0x65, 0x14, 0x22,
5784 0x48, 0x24, 0x46, 0x2D, 0xC3, 0x02, 0x08, 0x43, 0xC4, 0x61,
5785 0x52, 0x04, 0x8D, 0x92, 0x44, 0x45, 0x91, 0x20, 0x50, 0x01,
5786 0x41, 0x84, 0x5A, 0xA0, 0x0C, 0x09, 0xC1, 0x05, 0xD2, 0x28,
5787 0x86, 0x22, 0x09, 0x84, 0x04, 0xA6, 0x29, 0x9C, 0x12, 0x2A,
5788 0x61, 0x16, 0x90, 0xC4, 0x22, 0x82, 0x80, 0x92, 0x65, 0x5B,
5789 0x00, 0x82, 0x40, 0xB0, 0x40, 0x04, 0xA6, 0x25, 0x1A, 0x36,
5790 0x09, 0xD3, 0x92, 0x10, 0x62, 0xA6, 0x10, 0xA1, 0x32, 0x51,
5791 0x11, 0x14, 0x20, 0x1C, 0xB4, 0x65, 0x94, 0x38, 0x06, 0x49,
5792 0x20, 0x01, 0x1A, 0x27, 0x0C, 0xD2, 0x84, 0x31, 0x02, 0x49,
5793 0x28, 0x1B, 0x44, 0x45, 0x0C, 0x01, 0x60, 0x5C, 0x00, 0x2E,
5794 0x23, 0x31, 0x41, 0x8B, 0x14, 0x4A, 0xC0, 0x48, 0x45, 0x04,
5795 0xC0, 0x4C, 0x40, 0x02, 0x92, 0x94, 0x48, 0x48, 0x5A, 0x36,
5796 0x91, 0x1C, 0xA2, 0x21, 0x8B, 0x42, 0x82, 0x09, 0x01, 0x46,
5797 0x11, 0x85, 0x6D, 0x1C, 0x35, 0x62, 0xC9, 0x34, 0x45, 0xC1,
5798 0x42, 0x6C, 0x40, 0x28, 0x6E, 0x1A, 0x27, 0x4C, 0x19, 0x09,
5799 0x6D, 0x92, 0xB8, 0x41, 0x04, 0x31, 0x4D, 0xC4, 0x20, 0x4A,
5800 0x8C, 0x84, 0x6D, 0xD1, 0x32, 0x02, 0xE1, 0x82, 0x21, 0x41,
5801 0x34, 0x44, 0xC3, 0x14, 0x49, 0xD9, 0x22, 0x8D, 0x63, 0x32,
5802 0x48, 0x99, 0xB8, 0x0C, 0x03, 0x21, 0x69, 0xCC, 0x30, 0x40,
5803 0xA4, 0x32, 0x4D, 0xD8, 0xB8, 0x09, 0x00, 0x17, 0x45, 0x02,
5804 0xC0, 0x68, 0xCA, 0xA4, 0x91, 0x02, 0x99, 0x8D, 0x9B, 0x46,
5805 0x24, 0x42, 0x28, 0x8C, 0x90, 0x94, 0x61, 0x1C, 0xC3, 0x0C,
5806 0x00, 0x37, 0x89, 0x1C, 0x99, 0x8D, 0x83, 0xB6, 0x64, 0x01,
5807 0xC1, 0x88, 0xC0, 0x30, 0x44, 0x9C, 0x82, 0x48, 0x82, 0x22,
5808 0x29, 0x9C, 0x96, 0x30, 0x4C, 0x10, 0x50, 0x24, 0x07, 0x6E,
5809 0x98, 0x46, 0x8A, 0xC4, 0x38, 0x89, 0x60, 0x90, 0x11, 0x24,
5810 0x46, 0x00, 0x58, 0x80, 0x69, 0x11, 0x33, 0x85, 0x43, 0xB2,
5811 0x90, 0xD1, 0x20, 0x4C, 0x44, 0xA6, 0x28, 0xA1, 0x44, 0x45,
5812 0x01, 0xB7, 0x85, 0x9B, 0x22, 0x6C, 0x11, 0x22, 0x04, 0x13,
5813 0x13, 0x05, 0x01, 0x22, 0x88, 0x4C, 0x30, 0x80, 0x00, 0xC8,
5814 0x20, 0x51, 0xC2, 0x28, 0x10, 0x04, 0x71, 0x00, 0x14, 0x0A,
5815 0x89, 0x94, 0x05, 0x4A, 0x28, 0x6E, 0x88, 0x24, 0x52, 0x03,
5816 0x22, 0x69, 0xDC, 0x16, 0x71, 0x0C, 0x25, 0x6D, 0x10, 0x07,
5817 0x10, 0xCB, 0x12, 0x85, 0x53, 0x32, 0x2C, 0x0B, 0x94, 0x40,
5818 0x54, 0x88, 0x11, 0x99, 0x42, 0x69, 0x40, 0x00, 0x65, 0xA2,
5819 0x12, 0x0A, 0x22, 0xC4, 0x88, 0x99, 0x32, 0x31, 0x0C, 0xA5,
5820 0x91, 0x11, 0xC5, 0x49, 0x1A, 0x37, 0x31, 0x0A, 0x11, 0x88,
5821 0xD1, 0x28, 0x0C, 0x09, 0x30, 0x49, 0x13, 0x04, 0x02, 0x01,
5822 0x91, 0x0C, 0x0A, 0x15, 0x25, 0xC8, 0xC6, 0x28, 0x24, 0x46,
5823 0x86, 0x82, 0x02, 0x42, 0x98, 0x00, 0x69, 0x11, 0x16, 0x32,
5824 0xE4, 0x24, 0x31, 0x04, 0x88, 0x31, 0xE2, 0x30, 0x61, 0x0B,
5825 0x01, 0x6D, 0x43, 0xA2, 0x00, 0x19, 0x42, 0x60, 0x12, 0xA0,
5826 0x61, 0x8C, 0x08, 0x31, 0x12, 0xA3, 0x90, 0x1A, 0x12, 0x8C,
5827 0x1A, 0xA5, 0x85, 0x0B, 0x34, 0x45, 0x03, 0x39, 0x51, 0x1B,
5828 0x14, 0x44, 0x99, 0x24, 0x10, 0x5B, 0xB8, 0x4D, 0x48, 0x96,
5829 0x84, 0x8C, 0x94, 0x84, 0x63, 0x28, 0x21, 0x53, 0x80, 0x80,
5830 0x23, 0x23, 0x86, 0xD3, 0x90, 0x31, 0xDB, 0x00, 0x28, 0x18,
5831 0x09, 0x48, 0x01, 0xA1, 0x91, 0x8C, 0x38, 0x09, 0xE0, 0xB8,
5832 0x20, 0xD0, 0x30, 0x22, 0x61, 0xB6, 0x71, 0xD3, 0xC8, 0x05,
5833 0x00, 0x80, 0x09, 0x9C, 0x28, 0x8D, 0x83, 0x00, 0x2A, 0x92,
5834 0x00, 0x41, 0x90, 0x12, 0x12, 0x40, 0x18, 0x46, 0x19, 0x03,
5835 0x8A, 0x19, 0x23, 0x66, 0x08, 0x09, 0x32, 0xD9, 0x46, 0x69,
5836 0xE0, 0x26, 0x2C, 0x04, 0x80, 0x85, 0x04, 0x94, 0x29, 0x1B,
5837 0x44, 0x01, 0x92, 0x34, 0x45, 0xD0, 0xC6, 0x50, 0x02, 0x46,
5838 0x45, 0x24, 0x22, 0x90, 0x5B, 0x34, 0x50, 0x23, 0x22, 0x24,
5839 0x18, 0x36, 0x0D, 0x1B, 0x04, 0x68, 0xD9, 0xB8, 0x11, 0x49,
5840 0xC0, 0x89, 0x19, 0xA5, 0x84, 0x00, 0x99, 0x0D, 0x22, 0xA6,
5841 0x88, 0x82, 0x90, 0x6C, 0x42, 0x80, 0x2D, 0xC0, 0x88, 0x40,
5842 0x93, 0x84, 0x51, 0x9C, 0x46, 0x40, 0xDA, 0x04, 0x32, 0xD9,
5843 0x02, 0x84, 0x02, 0x44, 0x2E, 0x08, 0xB5, 0x81, 0x20, 0xA6,
5844 0x71, 0xD0, 0x26, 0x0A, 0x23, 0xC7, 0x70, 0x41, 0x42, 0x41,
5845 0x0B, 0x43, 0x4C, 0x20, 0xC9, 0x30, 0x5A, 0x22, 0x8C, 0x14,
5846 0xC5, 0x20, 0xA3, 0x30, 0x66, 0xE4, 0x10, 0x85, 0xC3, 0xB2,
5847 0x91, 0xA1, 0xA6, 0x05, 0x98, 0xA2, 0x80, 0x00, 0x81, 0x29,
5848 0x24, 0x47, 0x32, 0x10, 0x26, 0x2E, 0xCC, 0xA0, 0x0D, 0x22,
5849 0x80, 0x51, 0xCB, 0x46, 0x4A, 0x91, 0x04, 0x85, 0xD0, 0x90,
5850 0x88, 0x94, 0xC6, 0x11, 0x86, 0x3F, 0xAE, 0xE7, 0xA7, 0xD2,
5851 0xAB, 0x91, 0x16, 0x25, 0x66, 0x80, 0x76, 0x84, 0x42, 0x9E,
5852 0xE2, 0xDB, 0x76, 0xE3, 0xE7, 0xF8, 0xB8, 0x6E, 0x21, 0x0E,
5853 0x36, 0x8D, 0xB7, 0xE4, 0xAD, 0x3C, 0xC0, 0xDD, 0xC2, 0xDB,
5854 0xC7, 0x78, 0xFA, 0x83, 0x8B, 0x46, 0xAF, 0xD7, 0x2C, 0xF9,
5855 0xC1, 0x55, 0xFA, 0x94, 0x80, 0x27, 0x33, 0xEF, 0x4B, 0x4E,

NetBurner, Inc.
22.205 certs_test.h 1161

5856 0x2E, 0x3E, 0x8A, 0xDE, 0x83, 0x00, 0xDB, 0x61, 0x4A, 0x0D,
5857 0x8D, 0x6B, 0xEC, 0x73, 0xDE, 0x2F, 0xA1, 0xBC, 0xC5, 0x00,
5858 0xB9, 0xDF, 0x91, 0x0A, 0x3A, 0xD6, 0x2F, 0x9E, 0xE3, 0xED,
5859 0x7D, 0x9B, 0xEB, 0x9A, 0x70, 0xD0, 0x28, 0x0A, 0x7F, 0xDC,
5860 0x36, 0x38, 0x51, 0x0F, 0xDD, 0xD5, 0x3B, 0xFD, 0x0C, 0xA2,
5861 0x1A, 0xF0, 0x77, 0x92, 0x7F, 0x47, 0x92, 0x1C, 0x09, 0xDE,
5862 0x8B, 0xAD, 0x09, 0x82, 0x6F, 0x40, 0xC1, 0xDA, 0xE8, 0x01,
5863 0x19, 0x75, 0xC1, 0xE3, 0x74, 0xA4, 0x6E, 0x23, 0xEF, 0xBA,
5864 0xD0, 0x19, 0x4B, 0xDF, 0xB7, 0x15, 0x3C, 0x91, 0x59, 0x17,
5865 0xCD, 0x63, 0x44, 0x68, 0xDC, 0xBB, 0xBF, 0x6D, 0x81, 0xC5,
5866 0x05, 0x27, 0x94, 0x5C, 0x3E, 0xB1, 0x02, 0x07, 0x61, 0xE7,
5867 0x26, 0x70, 0xB6, 0x9A, 0x0B, 0x1F, 0x3F, 0x7D, 0x60, 0xE9,
5868 0xED, 0xDC, 0xB5, 0xCD, 0x63, 0x0E, 0x96, 0xB2, 0x65, 0x76,
5869 0x29, 0x10, 0xF3, 0x5D, 0xC2, 0x1D, 0xC6, 0x18, 0xE7, 0x07,
5870 0x3A, 0xE2, 0x19, 0xEC, 0xE5, 0xE7, 0x1A, 0xB6, 0xE1, 0xAE,
5871 0x38, 0xE6, 0xDB, 0xB8, 0x81, 0x42, 0x8E, 0x24, 0x2A, 0xF6,
5872 0xE7, 0x28, 0xBB, 0x3B, 0xF9, 0x3F, 0x0B, 0x8D, 0x4D, 0xE5,
5873 0x62, 0xC3, 0x82, 0x70, 0xD2, 0x67, 0x0C, 0x44, 0xFA, 0x9C,
5874 0x86, 0xF0, 0x72, 0x5E, 0x9F, 0xED, 0x42, 0x4E, 0xE8, 0xD8,
5875 0xAE, 0xB6, 0x45, 0xC8, 0xEA, 0x4A, 0xD8, 0xD7, 0x38, 0xDC,
5876 0xB6, 0x8D, 0x81, 0xF7, 0x2B, 0x2E, 0xF6, 0x5E, 0x03, 0xF3,
5877 0x45, 0x91, 0x9B, 0x5E, 0x5C, 0xF2, 0xDA, 0x86, 0x55, 0xB0,
5878 0x92, 0xC0, 0x88, 0x09, 0x00, 0x4F, 0xE2, 0x01, 0x0B, 0x3C,
5879 0xDC, 0x3C, 0x67, 0x38, 0xF0, 0x26, 0x01, 0x49, 0x35, 0x14,
5880 0x23, 0x52, 0x1D, 0x2D, 0x1E, 0x10, 0x72, 0x7D, 0x57, 0xB6,
5881 0x47, 0x08, 0xBA, 0x1E, 0x92, 0x0F, 0x94, 0x23, 0x18, 0x02,
5882 0x0F, 0x6E, 0x80, 0xEA, 0x12, 0xB4, 0xBC, 0x4E, 0x89, 0xA7,
5883 0x4C, 0x77, 0x63, 0x2E, 0x28, 0xB4, 0x11, 0xF1, 0x20, 0xD4,
5884 0xF1, 0xAE, 0x52, 0x09, 0x56, 0x65, 0xDB, 0xD2, 0xAA, 0xFF,
5885 0x2F, 0xCA, 0x23, 0x9A, 0xD1, 0x98, 0x91, 0x50, 0x4C, 0x79,
5886 0xDA, 0x56, 0x56, 0x4D, 0x04, 0x54, 0xAB, 0x74, 0x97, 0xDE,
5887 0xA2, 0xF2, 0xDF, 0xD0, 0x30, 0x13, 0x86, 0x9B, 0x0F, 0xC7,
5888 0xFE, 0xFF, 0x48, 0x7A, 0x8E, 0x33, 0x8C, 0x59, 0xBB, 0x07,
5889 0x16, 0x7D, 0x99, 0x4E, 0xA9, 0x88, 0x1A, 0xA1, 0xE1, 0x87,
5890 0x70, 0xFD, 0x13, 0xC7, 0xBB, 0x0D, 0xBD, 0x74, 0xAC, 0x93,
5891 0xDF, 0x84, 0x01, 0xA0, 0x8D, 0xB1, 0x0D, 0x9B, 0x0F, 0xE9,
5892 0x2A, 0xC3, 0x9F, 0xC8, 0x1E, 0xA6, 0xE5, 0x7A, 0x56, 0xCE,
5893 0xA2, 0xA8, 0x34, 0xCC, 0x55, 0x00, 0x89, 0x63, 0xA1, 0xE3,
5894 0x2C, 0x35, 0xE0, 0x36, 0x9D, 0x5A, 0x58, 0xFD, 0xF5, 0x9A,
5895 0x9B, 0x26, 0xF8, 0x8F, 0x97, 0x90, 0xAC, 0x91, 0xCD, 0x57,
5896 0x86, 0x28, 0x3B, 0x96, 0x3F, 0xED, 0xD6, 0x33, 0x41, 0x36,
5897 0x77, 0xC9, 0xD6, 0x7C, 0x86, 0x8C, 0x4C, 0xA9, 0xC1, 0xFC,
5898 0x9B, 0x3D, 0x9C, 0xAE, 0x61, 0x12, 0x44, 0x8A, 0x0F, 0x09,
5899 0x0F, 0x7E, 0x6E, 0xB2, 0x0C, 0x2B, 0x6F, 0xE8, 0xB6, 0xD0,
5900 0x8B, 0xF5, 0x6D, 0x75, 0xE3, 0x31, 0x7A, 0x67, 0x47, 0x78,
5901 0xEE, 0xA4, 0x95, 0x39, 0x7C, 0xF4, 0x37, 0x3A, 0xBC, 0xB7,
5902 0xC3, 0xAC, 0x45, 0x99, 0x84, 0xE2, 0xB4, 0xF4, 0xB0, 0x92,
5903 0xA4, 0x60, 0x1B, 0xCA, 0x77, 0x0F, 0xB3, 0x17, 0x58, 0x4F,
5904 0x40, 0x6D, 0xAB, 0x23, 0x1B, 0x22, 0x07, 0x7E, 0x23, 0xF5,
5905 0x8C, 0xB7, 0xAF, 0x01, 0xE1, 0x0E, 0x57, 0x5E, 0x9D, 0x37,
5906 0xDF, 0xDF, 0xF7, 0xC5, 0x72, 0xC5, 0x7A, 0xEA, 0x53, 0xD1,
5907 0x7C, 0x8D, 0x80, 0x90, 0x3D, 0x29, 0x72, 0x61, 0x93, 0x8F,
5908 0x0C, 0x54, 0xF9, 0x2E, 0x46, 0x48, 0x21, 0xF2, 0xB7, 0x97,
5909 0x50, 0xAD, 0x55, 0xD1, 0x1D, 0x5F, 0xFC, 0x5D, 0x76, 0x50,
5910 0x9E, 0x40, 0x1D, 0xF6, 0x82, 0xFE, 0x7A, 0xDA, 0xB8, 0x5C,
5911 0xCA, 0x1D, 0x53, 0xEB, 0xAE, 0x98, 0x60, 0x25, 0x5E, 0x59,
5912 0x39, 0x86, 0xE8, 0xCA, 0x8D, 0x28, 0x89, 0x45, 0x83, 0xD1,
5913 0xC7, 0x66, 0x7A, 0x2E, 0x30, 0x9A, 0x76, 0xD6, 0x21, 0xB5,
5914 0x33, 0x43, 0x9F, 0xAF, 0xBF, 0x9E, 0xAE, 0xE7, 0xD6, 0xAA,
5915 0x13, 0x70, 0x35, 0x5F, 0x36, 0xF3, 0xAE, 0x4F, 0xD5, 0xB5,
5916 0xEE, 0x39, 0x1E, 0x40, 0x4B, 0x2C, 0xE2, 0xDC, 0x0B, 0x91,
5917 0xED, 0x61, 0xB8, 0x47, 0xD2, 0x3A, 0xAF, 0x9D, 0x29, 0x65,
5918 0xA6, 0x35, 0xD2, 0xB0, 0x3B, 0x44, 0x6B, 0x21, 0x6C, 0x24,
5919 0x6D, 0x4A, 0x2C, 0xA6, 0xF5, 0x5C, 0xC7, 0x32, 0x83, 0x84,
5920 0x96, 0xBB, 0x54, 0xDD, 0x5B, 0x44, 0x78, 0x90, 0x90, 0xB0,
5921 0x75, 0x2B, 0x1A, 0x7B, 0xDD, 0xC8, 0x7D, 0x72, 0xBA, 0xAC,
5922 0xAD, 0x38, 0x3D, 0xBA, 0x46, 0x38, 0x06, 0x9C, 0xF3, 0xA8,
5923 0x6C, 0x36, 0x98, 0x0B, 0xB8, 0xDC, 0xE9, 0x22, 0x77, 0x53,
5924 0x03, 0xD6, 0xA6, 0xBF, 0x18, 0x0E, 0x60, 0x19, 0xA7, 0x16,
5925 0x5F, 0x9A, 0x04, 0x3D, 0x01, 0xDD, 0x06, 0xCD, 0xD7, 0xA3,
5926 0xD6, 0x0D, 0x5D, 0x49, 0xB1, 0x85, 0xEA, 0xEC, 0xF5, 0xA2,
5927 0x97, 0x82, 0x98, 0xCB, 0x8E, 0xFA, 0xF5, 0xFB, 0x59, 0x16,
5928 0x1B, 0x51, 0x43, 0xFA, 0xD5, 0x46, 0xA7, 0x07, 0x21, 0x92,
5929 0xBB, 0x56, 0x67, 0xD8, 0xF3, 0x9E, 0x94, 0x18, 0x00, 0x9E,
5930 0xFA, 0x36, 0x1C, 0x1B, 0x24, 0x37, 0x48, 0x07, 0x91, 0xF7,
5931 0xD1, 0x4C, 0x53, 0x11, 0xBE, 0x15, 0x5D, 0x77, 0x1E, 0x86,
5932 0xE9, 0xF4, 0xBD, 0x69, 0x63, 0x75, 0x3E, 0x41, 0x6B, 0xC0,
5933 0x99, 0xD2, 0xC4, 0x2F, 0x5E, 0xAC, 0x64, 0xB7, 0xB2, 0xA9,
5934 0xEB, 0x88, 0x32, 0xD6, 0x93, 0x39, 0xCD, 0xBD, 0x16, 0x3D,
5935 0x27, 0xCA, 0xD3, 0xF6, 0x5B, 0x41, 0x23, 0xAC, 0xC5, 0x4C,
5936 0x3F, 0x72, 0x6A, 0xF7, 0x08, 0x31, 0x6B, 0x61, 0x21, 0x47,
5937 0xA1, 0x67, 0x54, 0xCE, 0x17, 0x01, 0x07, 0x7F, 0x41, 0xA1,
5938 0x7A, 0xC2, 0x73, 0xFD, 0x08, 0xE1, 0xF9, 0x9E, 0xBB, 0xE2,
5939 0x91, 0x0C, 0x21, 0x1D, 0x93, 0x82, 0x9F, 0x5D, 0xE2, 0x10,
5940 0x9B, 0x8F, 0x4D, 0xEC, 0x22, 0x76, 0x29, 0xE5, 0xF1, 0x0C,
5941 0x15, 0x62, 0x50, 0x1B, 0xB7, 0x6F, 0x6C, 0xDB, 0xE2, 0xDD,
5942 0x7F, 0x15, 0xD6, 0xFE, 0x7E, 0x22, 0x31, 0x7B, 0x53, 0x8D,

NetBurner, Inc.
1162 File Documentation

5943 0xC7, 0xB6, 0x30, 0xBB, 0xDD, 0x07, 0x7B, 0x18, 0x97, 0x43,
5944 0x5E, 0x3D, 0xDE, 0xC7, 0xAB, 0xAD, 0x04, 0x4B, 0x26, 0xF0,
5945 0xD3, 0xB6, 0xC5, 0xE2, 0x65, 0x9A, 0xCA, 0xF1, 0xD7, 0xBD,
5946 0x25, 0xFF, 0x25, 0x58, 0x42, 0xD2, 0x42, 0xDD, 0x3A, 0x95,
5947 0xE1, 0xF5, 0xAA, 0xE1, 0xDF, 0x52, 0x8D, 0x7B, 0xAA, 0x91,
5948 0x4B, 0xB3, 0xF1, 0x4F, 0x02, 0xDC, 0xA2, 0xEF, 0x98, 0xCD,
5949 0xDE, 0xFF, 0x8F, 0xAD, 0x77, 0xB5, 0x9C, 0x66, 0x22, 0x4F,
5950 0x38, 0xE5, 0xC8, 0x9F, 0x4C, 0xA9, 0xC1, 0xFB, 0x1F, 0xBB,
5951 0xCA, 0x21, 0xD7, 0xF5, 0xCC, 0xDD, 0x65, 0x84, 0x11, 0x85,
5952 0x4D, 0xFB, 0xF3, 0x6A, 0x7E, 0x0C, 0xE9, 0x1C, 0x18, 0xD1,
5953 0x19, 0x7C, 0x4B, 0x0A, 0xC3, 0x7A, 0x4D, 0x9C, 0x82, 0x02,
5954 0xF9, 0xF2, 0x4B, 0xF7, 0xA2, 0xED, 0x46, 0x1A, 0x9F, 0x21,
5955 0x18, 0x19, 0x97, 0x4A, 0x3D, 0xD8, 0x02, 0xE1, 0x25, 0xF4,
5956 0xDA, 0x8F, 0x71, 0x0B, 0xD4, 0x8F, 0x65, 0x72, 0x44, 0x2F,
5957 0x00, 0x6F, 0x25, 0xD0, 0x91, 0x26, 0x0F, 0xC0, 0x3E, 0xFF,
5958 0xC7, 0x83, 0x6F, 0x44, 0xDE, 0x91, 0xC8, 0xFC, 0x9A, 0xE5,
5959 0x25, 0xF5, 0x6E, 0x24, 0xAB, 0x60, 0x3A, 0x93, 0x34, 0xFB,
5960 0x69, 0x4E, 0xFA, 0x33, 0x64, 0x34, 0x20, 0x86, 0x75, 0x91,
5961 0xEF, 0xAE, 0xDC, 0xD2, 0xCD, 0xB7, 0x75, 0x5D, 0xCF, 0x53,
5962 0xF1, 0xB7, 0x25, 0x58, 0x01, 0x51, 0x41, 0xA8, 0xFA, 0xE7,
5963 0x85, 0x93, 0x3F, 0x63, 0x65, 0x59, 0x4D, 0x2C, 0x36, 0xB5,
5964 0x68, 0x80, 0xD9, 0x0A, 0xFF, 0x24, 0xF4, 0xE6, 0x92, 0xAA,
5965 0xF1, 0xDE, 0x9D, 0x8A, 0x1C, 0x95, 0xB5, 0x2C, 0x4A, 0x65,
5966 0xFF, 0x36, 0x80, 0xCD, 0xB9, 0x66, 0xAB, 0x5C, 0x38, 0xA7,
5967 0x4A, 0xD4, 0xDC, 0x19, 0x05, 0x7E, 0xC5, 0x89, 0xAF, 0x62,
5968 0x3A, 0xF7, 0xBA, 0x37, 0x6A, 0x20, 0x56, 0xBB, 0x93, 0x36,
5969 0xAF, 0x72, 0x9F, 0xC2, 0x27, 0x95, 0xE0, 0x9D, 0xB3, 0x44,
5970 0xC5, 0xA7, 0xF9, 0xE6, 0x55, 0x65, 0xD6, 0xFA, 0x3E, 0xB5,
5971 0x1E, 0xF0, 0x1D, 0x14, 0x8D, 0xF2, 0x35, 0xF7, 0x01, 0xA0,
5972 0x8B, 0x6F, 0xED, 0x20, 0xC2, 0x10, 0x36, 0x4F, 0x24, 0x75,
5973 0x3A, 0xA6, 0x3F, 0x88, 0x06, 0x0F, 0x26, 0x6E, 0x06, 0x5C,
5974 0xC3, 0x59, 0x74, 0x05, 0x85, 0xC2, 0x5D, 0xB0, 0x91, 0x25,
5975 0x15, 0x13, 0xEE, 0x32, 0x2F, 0x86, 0x5D, 0x4F, 0x93, 0x50,
5976 0x80, 0x1F, 0x16, 0x8D, 0x35, 0xCC, 0x9F, 0xB5, 0xAB, 0xD3,
5977 0x84, 0x56, 0xEF, 0x26, 0x56, 0x25, 0x9B, 0x6C, 0xAF, 0x62,
5978 0xDE, 0xC2, 0x97, 0xF5, 0x51, 0x52, 0x97, 0x0A, 0x06, 0x90,
5979 0xF8, 0xB7, 0xCE, 0x38, 0xD8, 0xE2, 0xBC, 0x4E, 0x36, 0x67,
5980 0x50, 0xF9, 0xE7, 0x48, 0x84, 0x9B, 0x73, 0x98, 0x0C, 0xC4,
5981 0xF8, 0xC8, 0x87, 0x9B, 0x04, 0xBC, 0x5F, 0x3E, 0x32, 0x00,
5982 0x4E, 0x89, 0xF8, 0xCA, 0xFA, 0x88, 0x69, 0x63, 0xD6, 0x51,
5983 0x62, 0x89, 0x5C, 0x83, 0x5B, 0xC0, 0x6C, 0xD1, 0x84, 0x77,
5984 0x94, 0x9A, 0x91, 0xFE, 0x53, 0x4A, 0x53, 0x13, 0x4A, 0xF9,
5985 0x8F, 0xB9, 0x84, 0x9A, 0xC8, 0xB6, 0x40, 0xEC, 0xA4, 0x22,
5986 0xCE, 0x57, 0x52, 0x2B, 0x4F, 0x11, 0x79, 0x7C, 0x42, 0xE8,
5987 0x37, 0x42, 0x84, 0xE6, 0x07, 0x94, 0xFA, 0x32, 0x14, 0x3E,
5988 0x2C, 0x7B, 0x6D, 0xE4, 0xAC, 0x10, 0xBF, 0xF3, 0x57, 0x8A,
5989 0x8E, 0x42, 0xBF, 0xEB, 0x17, 0x3B, 0xAC, 0x15, 0xA4, 0xAC,
5990 0x8F, 0x0E, 0xDA, 0x83, 0xF2, 0x73, 0x39, 0x37, 0x11, 0x9B,
5991 0x51, 0x96, 0x02, 0xA5, 0x11, 0xD3, 0xF6, 0xB6, 0x06, 0x72,
5992 0xEB, 0xED, 0x8E, 0x28, 0x4E, 0x55, 0x37, 0xF0, 0x71, 0xF9,
5993 0xAB, 0x26, 0x75, 0x00, 0x50, 0x78, 0x5A, 0x90, 0xCD, 0xCB,
5994 0xE2, 0x42, 0x9C, 0xE4, 0xD3, 0x65, 0x48, 0x45, 0x14, 0xDD,
5995 0xB2, 0x4A, 0x83, 0x64, 0x94, 0x6E, 0x96, 0x0B, 0xB1, 0x57,
5996 0xFE, 0xBE, 0x51, 0x5C, 0x33, 0x77, 0x7C, 0x5D, 0xBF, 0xF3,
5997 0xD1, 0x27, 0x25, 0x8A, 0x4B, 0x92, 0x8E, 0x53, 0x63, 0x68,
5998 0xB8, 0xA1, 0x62, 0xAD, 0x7B, 0x86, 0x12, 0xF9, 0x24, 0xFD,
5999 0x8F, 0x61, 0xEC, 0xE9, 0x5B, 0x5F, 0xA3, 0xA7, 0x2C, 0xC2,
6000 0xFB, 0x0C, 0x25, 0x17, 0x8E, 0x82, 0x2B, 0x1B, 0xDA, 0x58,
6001 0xEF, 0xB8, 0x6E, 0x64, 0xC3, 0x8D, 0xC7, 0x82, 0x26, 0x72,
6002 0xED, 0xDC, 0x97, 0x89, 0xF2, 0xD4, 0x40, 0x7C, 0xA5, 0x1B,
6003 0x04, 0x24, 0xFC, 0x2C, 0x36, 0x57, 0xA7, 0xB8, 0x1A, 0xA2,
6004 0x28, 0xB3, 0x16, 0x56, 0x77, 0xF7, 0xA3, 0x50, 0x62, 0x5E,
6005 0xFE, 0x72, 0x74, 0xB3, 0x76, 0xD9, 0xF4, 0xD5, 0xCA, 0x7E,
6006 0x14, 0x80, 0x98, 0xB9, 0x50, 0xA8, 0x22, 0xB5, 0x5B, 0xD6,
6007 0xB3, 0x1D, 0x8B, 0xFC, 0xA5, 0xD0, 0x0F, 0x65, 0x33, 0x3B,
6008 0x21, 0x55, 0x19, 0x40, 0x2E, 0x9C, 0xCB, 0xB5, 0xE0, 0x0B,
6009 0x68, 0x63, 0x95, 0x2F, 0x97, 0xCC, 0xB0, 0x5C, 0xF3, 0xA4,
6010 0x5C, 0x05, 0x21, 0x55, 0x3F, 0xBF, 0x5F, 0xE6, 0xF1, 0x4D,
6011 0x75, 0xAA, 0x69, 0xE0, 0x98, 0x0F, 0x39, 0x95, 0x33, 0x99,
6012 0xCF, 0xEA, 0x53, 0x45, 0x9C, 0x08, 0xCF, 0x7F, 0x58, 0x27,
6013 0x64, 0x71, 0x64, 0x20, 0x42, 0xBD, 0xA2, 0x07, 0x5C, 0xA6,
6014 0xEB, 0x4C, 0x65, 0x69, 0x4F, 0x16, 0x46, 0x58, 0x80, 0xD3,
6015 0xC3, 0x75, 0x91, 0x1F, 0x55, 0xD7, 0xF2, 0x87, 0xB3, 0x17,
6016 0x82, 0xC8, 0x12, 0x59, 0x56, 0x1B, 0x9C, 0x3C, 0xDF, 0x3D,
6017 0x6F, 0x4F, 0x6C, 0x02, 0x60, 0x28, 0x0D, 0xD1, 0x31, 0xF7,
6018 0xA6, 0xAF, 0x05, 0x6E, 0xCE, 0x17, 0xBC, 0x6A, 0x1B, 0xF7,
6019 0xCB, 0x0D, 0x3F, 0x06, 0x8A, 0x01, 0x9A, 0xF2, 0x40, 0xF9,
6020 0x0D, 0x01, 0x8E, 0xCC, 0x24, 0x0C, 0xEC, 0x50, 0x44, 0xD5,
6021 0x2F, 0xD5, 0x51, 0x10, 0xF5, 0x20, 0x3D, 0x87, 0x5A, 0x39,
6022 0xEE, 0x55, 0x2B, 0x9C, 0x34, 0xD8, 0xDF, 0xF6, 0x12, 0xA7,
6023 0xE0, 0xBC, 0xB2, 0x3D, 0x5D, 0x42, 0x1B, 0x2F, 0x9C, 0x96,
6024 0xAD, 0x1F, 0x2F, 0x89, 0x8B, 0x26, 0x80, 0xF8, 0xA4, 0x07,
6025 0xF9, 0x2E, 0xD4, 0xDE, 0xF5, 0x5A, 0x4D, 0xF0, 0x98, 0x7C,
6026 0x78, 0xF1, 0x15, 0xBA, 0x16, 0xC7, 0x97, 0x37, 0xF5, 0x6B,
6027 0x6A, 0x21, 0x66, 0x61, 0xD1, 0x0C, 0x9E, 0x6C, 0x31, 0x4E,
6028 0x20, 0xCB, 0x93, 0x90, 0xD5, 0x3C, 0x2F, 0xCE, 0xF6, 0xEE,
6029 0x9E, 0x8F, 0x10, 0xB9, 0xFD, 0x45, 0x32, 0x2D, 0x78, 0x8E,

NetBurner, Inc.
22.205 certs_test.h 1163

6030 0x1C, 0x19, 0xC5, 0x07, 0xD9, 0xE4, 0xC0, 0x07, 0xB3, 0x2F,
6031 0xB6, 0x1E, 0xCE, 0x27, 0x0F, 0xF5, 0x97, 0x46, 0x95, 0xE4,
6032 0xC0, 0xE9, 0x42, 0x4A, 0xF9, 0xED, 0x3D, 0xD5, 0x37, 0x1A,
6033 0x2B, 0x63, 0x2A, 0xBA, 0x22, 0xD4, 0xC5, 0x67, 0x4B, 0x77,
6034 0xB8, 0xD2, 0xEA, 0xE3, 0x42, 0xDE, 0x54, 0x3B, 0xE2, 0x42,
6035 0xA4, 0x96, 0xDF, 0xAD, 0xEB, 0x34, 0xB5, 0xDA, 0x7E, 0xEF,
6036 0xC9, 0xBF, 0xA2, 0x11, 0x01, 0xC2, 0xF2, 0x0C, 0x5D, 0x6C,
6037 0xA8, 0x9A, 0x2F, 0xA9, 0x9A, 0x47, 0x17, 0x9D, 0xF8, 0x34,
6038 0x01, 0xC0, 0x8F, 0xBA, 0xE2, 0xC9, 0xA5, 0xA3, 0x02, 0x6C,
6039 0x18, 0x01, 0x4B, 0xEA, 0x44, 0xD4, 0x88, 0x9C, 0x36, 0x32,
6040 0x55, 0xA2, 0x7E, 0xBF, 0x74, 0x0C, 0xEC, 0x8C, 0x16, 0x4F,
6041 0x2E, 0xFB, 0xC2, 0xA9, 0xB6, 0x0E, 0xE6, 0x26, 0x59, 0x40,
6042 0x21, 0xB2, 0x97, 0x4C, 0x99, 0xA8, 0xE4, 0xAE, 0xED, 0x66,
6043 0x4C, 0x22, 0xAD, 0xD3, 0x62, 0x5A, 0x51, 0x23, 0x2F, 0x3C,
6044 0x1D, 0x3A, 0xF5, 0x92, 0x00, 0x7B, 0x42, 0xFA, 0xC1, 0x49,
6045 0x37, 0x42, 0xB7, 0x64, 0x8E, 0x1F, 0x5F, 0xA9, 0xB2, 0x03,
6046 0xFA, 0xDA, 0xAC, 0x48, 0x3F, 0xF3, 0x80, 0xE0, 0xE1, 0x3D,
6047 0x07, 0x99, 0x31, 0x9E, 0x7D, 0x2C, 0x9B, 0x19, 0x6F, 0x81,
6048 0x0D, 0x1F, 0x95, 0x04, 0x44, 0x47, 0x80, 0xE0, 0xD6, 0x7C,
6049 0x96, 0xF8, 0x6B, 0x1A, 0x2B, 0xAC, 0xC7, 0x6B, 0x6E, 0x12,
6050 0xF8, 0x15, 0xA2, 0xB7, 0xFF, 0x2C, 0x94, 0x2E, 0xEF, 0xB0,
6051 0xF9, 0xF7, 0x3F, 0x41, 0xF5, 0x8B, 0x17, 0x22, 0x58, 0x72,
6052 0x00, 0xD1, 0xB8, 0x44, 0x5A, 0x75, 0xDC, 0x5D, 0xF5, 0x5F,
6053 0x7F, 0x4C, 0xD6, 0xFD, 0x6E, 0xE5, 0xBD, 0x80, 0xD6, 0x5C,
6054 0x59, 0x5F, 0x0E, 0x6A, 0xAA, 0x4A, 0x57, 0x40, 0x63, 0xB6,
6055 0xBD, 0x4F, 0xDF, 0xD8, 0x40, 0x07, 0x17, 0x8D, 0x85, 0x79,
6056 0xD2, 0x2F, 0x64, 0xC0, 0xC9, 0xA3, 0x73, 0x2F, 0xB2, 0xA9,
6057 0x23, 0x78, 0xE3, 0xB9, 0x21, 0x85, 0x91, 0x34, 0x45, 0xCF,
6058 0x0A, 0x1C, 0x55, 0x52, 0xF8, 0x5D, 0x2C, 0x42, 0x19, 0x10,
6059 0xDB, 0x4E, 0x1E, 0x33, 0x5C, 0xED, 0x8F, 0xD7, 0x94, 0x6A,
6060 0x43, 0x6A, 0xD2, 0xBF, 0x54, 0xB8, 0x8C, 0xFA, 0x6A, 0xEB,
6061 0xD0, 0x12, 0x65, 0xA4, 0x2F, 0x14, 0x51, 0xAC, 0xE4, 0x83,
6062 0x0F, 0xDC, 0x39, 0xB0, 0xCD, 0x31, 0xC4, 0x61, 0xEB, 0xE7,
6063 0x26, 0x9A, 0x4C, 0xCE, 0x49, 0x99, 0xD0, 0xBB, 0x90, 0x8A,
6064 0x30, 0xDF, 0x24, 0xA9, 0x50, 0x0B, 0xAA, 0xC8, 0xEB, 0x7D,
6065 0xD9, 0x72, 0xF8, 0x93, 0xCF, 0x76, 0x6A, 0x6F, 0x38, 0xCC,
6066 0x50, 0x88, 0x45, 0x2E, 0x78, 0xAD, 0xD4, 0xEC, 0xC1, 0xB8,
6067 0xBE, 0x7C, 0x4B, 0x79, 0xA1, 0xA1, 0xA8, 0x25, 0xD9, 0x72,
6068 0x20, 0x2D, 0x22, 0x20, 0x5E, 0x80, 0x92, 0x88, 0x08, 0x27,
6069 0xE5, 0xB4, 0xF4, 0xAA, 0xCC, 0xB0, 0x42, 0x67, 0x61, 0xD6,
6070 0x80, 0x31, 0x4A, 0xA8, 0xFF, 0xE4, 0xBA, 0x49, 0x7A, 0xF9,
6071 0x85, 0xD3, 0xE4, 0x96, 0xB6, 0x42, 0x87, 0x23, 0xF6, 0x81,
6072 0xBD, 0x1F, 0xB0, 0xC9, 0x02, 0xC2, 0x61, 0x9D, 0xA0, 0xCE,
6073 0xF6, 0x28, 0xF5, 0xA8, 0x3E, 0x97, 0xBB, 0xB9, 0xE5, 0x0D,
6074 0x2B, 0x8E, 0x32, 0x6A, 0x18, 0x06, 0xA5, 0xC4, 0xCF, 0xC0,
6075 0xF7, 0xB8, 0x12, 0x76, 0x91, 0xDE, 0xD1, 0xD6, 0xA8, 0x3A,
6076 0xF8, 0xEC, 0xCB, 0xD0, 0x26, 0x76, 0x31, 0xE3, 0xC9, 0x0A,
6077 0xC5, 0xB3, 0xEF, 0x00, 0x10, 0xEA, 0xED, 0x1D, 0x95, 0x30,
6078 0x6F, 0x0B, 0xA5, 0x44, 0xD9, 0xF1, 0x1E, 0x65, 0xE6, 0x0F,
6079 0xD1, 0x85, 0xC7, 0x77, 0xE2, 0x30, 0x21, 0x1A, 0x94, 0x26,
6080 0xF8, 0x4A, 0x54, 0x57, 0x48, 0x88, 0x03, 0x25, 0xF1, 0x67,
6081 0x21, 0x8E, 0xA9, 0xFD, 0x2F, 0x4F, 0x49, 0x06, 0xC5, 0x83,
6082 0x44, 0xC4, 0xC7, 0x33, 0x59, 0x59, 0x83, 0x59, 0x70, 0xA9,
6083 0x2C, 0xF6, 0xE9, 0x02, 0xA5, 0xF8, 0x07, 0xAF, 0x7C, 0xFD,
6084 0xCA, 0x6A, 0x53, 0x3B, 0xBF, 0x80, 0x15, 0x0C, 0xE8, 0xB7,
6085 0x15, 0xF9, 0xC3, 0x5A, 0x32, 0xF4, 0x26, 0x78, 0x03, 0xE7,
6086 0x7C, 0x1A, 0x0D, 0x52, 0x4A, 0x2B, 0x1F, 0xDE, 0x90, 0x30,
6087 0x2C, 0x4A, 0x48, 0x94, 0x4E, 0xB9, 0x74, 0x85, 0x00, 0x37,
6088 0xD9, 0xAF, 0xCE, 0x91, 0xC3, 0xEC, 0xC8, 0xDA, 0x64, 0x54,
6089 0xAE, 0x44, 0x34, 0x4E, 0xAA, 0x22, 0x29, 0xEE, 0xD5, 0x2B,
6090 0xAC, 0x40, 0x7F, 0x2E, 0x05, 0x98, 0x31, 0x85, 0xD1, 0x9E,
6091 0x3E, 0xE8, 0xDB, 0xFC, 0x18, 0x5C, 0x29, 0x61, 0x18, 0x9A,
6092 0x68, 0x56, 0x0E, 0x66, 0x78, 0x1B, 0x0A, 0x85, 0x7F, 0xD2,
6093 0x70, 0xD8, 0x67, 0xFC, 0x57, 0xB6, 0x60, 0x75, 0x8A, 0xF3,
6094 0xAE, 0x91, 0x4E, 0xEC, 0xC9, 0x14, 0x22, 0x3E, 0x8C, 0x08,
6095 0x84, 0x1B, 0x58, 0x3C, 0x95, 0x03, 0x7D, 0x33, 0x1A, 0x31,
6096 0x01, 0x26, 0xC8, 0x4B, 0x9D, 0x4D, 0x2A, 0x53, 0xAE, 0xB8,
6097 0xA3, 0xCF, 0x8C, 0x4F, 0xE6, 0x5C, 0x9A, 0x1A, 0xFD, 0xBC,
6098 0xE0, 0x03, 0x45, 0xB0, 0x96, 0xE7, 0xC5, 0x3B, 0xA3, 0x09,
6099 0x93, 0x08, 0x13, 0x6B, 0xF0, 0x68, 0x12, 0x13, 0x10, 0xE6,
6100 0x9B, 0xAF, 0x5D, 0x68, 0xEE, 0x31, 0x09, 0xD8, 0xC9, 0x5E,
6101 0xC8, 0xE3, 0x85, 0x0B, 0xE7, 0x1A, 0x3A, 0x2B, 0xFE, 0x80,
6102 0xAF, 0x13, 0x13, 0xED, 0xB3, 0xA4, 0xE7, 0x23, 0xE7, 0xA9,
6103 0x8E, 0xA3, 0x9E, 0xC5, 0x73, 0x1A, 0x47, 0x4E, 0x0A, 0xFB,
6104 0xDD, 0x17, 0x19, 0x9E, 0xCB, 0x29, 0x6D, 0x2D, 0x94, 0xB2,
6105 0xF8, 0x3E, 0x1B, 0x5F, 0x5C, 0xB1, 0x6E, 0x0A, 0x6B, 0x7B,
6106 0xEE, 0x9F, 0x35, 0x2C, 0xD8, 0x81, 0xDF, 0x25, 0xFA, 0x9B,
6107 0xCD, 0x28, 0xA6, 0x7D, 0x08, 0x3D, 0x54, 0xF3, 0x67, 0x30,
6108 0x36, 0xD2, 0xEE, 0x22, 0x13, 0xB9, 0xB2, 0x71, 0x07, 0xBF,
6109 0xB3, 0x81, 0x25, 0xB7, 0xFA, 0xDA, 0xEE, 0xCF, 0x04, 0xA9,
6110 0xC0, 0xF0, 0xC1, 0xC2, 0xFE, 0x77, 0x19, 0xA6, 0x3B, 0xCC,
6111 0x7C, 0xE1, 0x9A, 0x99, 0xDA, 0x11, 0xEF, 0x7B, 0x9D, 0x89,
6112 0xE0, 0x9F, 0x22, 0x8E, 0x93, 0x6D, 0x86, 0x60, 0x7E, 0x61,
6113 0xD4, 0xD9, 0xC9, 0x6B, 0x74, 0x6E, 0x17, 0xDC, 0x7A, 0xB5,
6114 0xF3, 0xFF, 0xD2, 0xDB, 0xFC, 0xCD, 0x34, 0x05, 0x96, 0xDE,
6115 0x62, 0xDF, 0x60, 0x8F, 0xBA, 0x29, 0x7C, 0xE2, 0x5A, 0xDB,
6116 0x21, 0x39, 0x3D, 0x27, 0x6B, 0x7B, 0x9E, 0xFC, 0x3F, 0x78,

NetBurner, Inc.
1164 File Documentation

6117 0xAA, 0xFA, 0xE7, 0x07, 0x64, 0xAB, 0xA0, 0x20, 0x72, 0x31,
6118 0xE5, 0x25, 0x53, 0x65, 0x91, 0x8A, 0x33, 0x4E, 0x0B, 0x84,
6119 0x30, 0xB4, 0x15, 0xD3, 0x28, 0x4D, 0xB5, 0x28, 0xF5, 0x20,
6120 0xF0, 0x4C, 0x8B, 0x7A, 0xC4, 0x74, 0x64, 0x54, 0xF0, 0x52,
6121 0x6D, 0x45, 0xF1, 0x79, 0xD4, 0xBB, 0xE0, 0xB6, 0xA7, 0x2C,
6122 0x38, 0x1A, 0x7B, 0xF3, 0x17, 0x6B, 0x53, 0x73, 0x3F, 0xC3,
6123 0x22, 0x55, 0x34, 0x92, 0x5D, 0xB5, 0x80, 0x5F, 0x37, 0xB8,
6124 0xAF, 0x2C, 0x12, 0xA1, 0xA1, 0x29, 0x1A, 0xDC, 0x31, 0xA5,
6125 0xA3, 0xE6, 0xED, 0xD9, 0x4C, 0x34, 0x53, 0x01, 0x79, 0xDE,
6126 0xF1, 0x48, 0x31, 0x80, 0x5D, 0x0D, 0x4C, 0x62, 0x70, 0xC1,
6127 0x3C, 0xB1, 0x0E, 0x4D, 0x72, 0x45, 0x25, 0x33, 0x0B, 0x38,
6128 0xB2, 0x3E, 0x95, 0xC0, 0xA8, 0x42, 0x51, 0xD9, 0x35, 0x75,
6129 0xFE, 0x10, 0x4A, 0x48, 0x11, 0x82, 0xE8, 0x87, 0x04, 0x6B,
6130 0x06, 0x60, 0xA8, 0x0E, 0xAC, 0x8B, 0xFA, 0x40, 0xB1, 0x63,
6131 0x63, 0x91, 0x17, 0x2A, 0x4F, 0x2A, 0xD8, 0x6C, 0x43, 0xAF,
6132 0xDC, 0xE2, 0x72, 0x76, 0xBE, 0x46, 0xCB, 0x12, 0xA4, 0x73,
6133 0x03, 0xAB, 0x11, 0x9E, 0x0D, 0x41, 0x27, 0x8C, 0x18, 0xEF,
6134 0xE6, 0xC2, 0xB3, 0x09, 0xF0, 0x36, 0xA6, 0xE4, 0xFF, 0xE5,
6135 0x91, 0xD8, 0xD7, 0xF5, 0x1E, 0x6D, 0x34, 0x19, 0xF1, 0xAF,
6136 0x9B, 0x9A, 0xF8, 0x10, 0x92, 0x11, 0x85, 0xEA, 0x38, 0xF6,
6137 0x89, 0x40, 0x6D, 0xB0, 0x84, 0xEB, 0xBA, 0xAD, 0xB1, 0x55,
6138 0xB0, 0x73, 0x52, 0xF6, 0xB8, 0xD2, 0xCF, 0xED, 0x6B, 0xF5,
6139 0xFA, 0x01, 0x2A, 0x8E, 0xC7, 0x06, 0x77, 0xEB, 0xF3, 0x84,
6140 0xFD, 0x9B, 0x17, 0x54, 0x31, 0x73, 0xFE, 0xC3, 0x71, 0xF8,
6141 0x41, 0xFF, 0xA4, 0xD3, 0x7D, 0xB2, 0xBD, 0xBA, 0xD6, 0xE9,
6142 0x1E, 0x8F, 0x5B, 0x8D, 0x3A, 0x3C, 0x0C, 0xB4, 0xFE, 0x9B,
6143 0x49, 0x69, 0x8C, 0x3D, 0xA7, 0xF5, 0x79, 0x46, 0xE9, 0x5E,
6144 0xE1, 0x07, 0x52, 0xB7, 0x24, 0x51, 0x6C, 0x59, 0x74, 0x2C,
6145 0xEC, 0x7C, 0x88, 0x41, 0x2E, 0x45, 0x91, 0x23, 0xA4, 0x81,
6146 0xC9, 0x37, 0xC0, 0xDE, 0xC0, 0x09, 0x5A, 0x00, 0xFD, 0x2D,
6147 0x97, 0x71, 0x6A, 0xAF, 0x6E, 0x5D, 0x03, 0x67, 0xAA, 0xFD
6148
6149 };
6150 static const int sizeof_bench_dilithium_aes_level2_key = sizeof(bench_dilithium_aes_level2_key);
6151
6152 /* certs/dilithium/bench_dilithium_aes_level3_key.der */
6153 static const unsigned char bench_dilithium_aes_level3_key[] =
6154 {
6155 0x30, 0x82, 0x17, 0x5A, 0x02, 0x01, 0x00, 0x30, 0x0D, 0x06,
6156 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x02, 0x82, 0x0B, 0x0B,
6157 0x06, 0x05, 0x04, 0x82, 0x17, 0x44, 0x04, 0x82, 0x17, 0x40,
6158 0x62, 0x93, 0x71, 0x4C, 0xCD, 0x7A, 0xD1, 0x75, 0xD1, 0xBB,
6159 0x2A, 0xC9, 0x54, 0xBF, 0xDA, 0xF1, 0x70, 0xE9, 0xEF, 0x8D,
6160 0x08, 0x66, 0xE9, 0xD6, 0xE3, 0x6F, 0x4B, 0x99, 0xEB, 0x44,
6161 0x51, 0x12, 0x64, 0x80, 0x0D, 0x29, 0x4B, 0x24, 0x6B, 0x6A,
6162 0xAC, 0xD9, 0x87, 0x9A, 0x2D, 0x49, 0xF6, 0xCC, 0x69, 0xC0,
6163 0xAE, 0xD9, 0xB2, 0xE1, 0xF5, 0xB8, 0xC1, 0x98, 0x77, 0x73,
6164 0x1F, 0x1E, 0xE6, 0x11, 0x0A, 0x1F, 0x51, 0xDF, 0xD1, 0x4A,
6165 0x32, 0x8D, 0xC2, 0x36, 0xA6, 0xAF, 0x6F, 0x01, 0x57, 0xA3,
6166 0x56, 0x17, 0x5F, 0x5E, 0xDC, 0x39, 0xD8, 0xC8, 0xB7, 0xE1,
6167 0x1B, 0x2F, 0x51, 0xC6, 0xAF, 0xC4, 0x65, 0x53, 0x34, 0x21,
6168 0x81, 0x28, 0x44, 0x82, 0x23, 0x80, 0x21, 0x17, 0x08, 0x42,
6169 0x88, 0x48, 0x17, 0x22, 0x31, 0x01, 0x42, 0x36, 0x83, 0x76,
6170 0x00, 0x45, 0x40, 0x23, 0x54, 0x85, 0x74, 0x11, 0x22, 0x85,
6171 0x31, 0x38, 0x81, 0x26, 0x38, 0x55, 0x15, 0x51, 0x42, 0x44,
6172 0x53, 0x81, 0x81, 0x47, 0x76, 0x70, 0x84, 0x15, 0x78, 0x70,
6173 0x34, 0x34, 0x02, 0x54, 0x65, 0x07, 0x35, 0x66, 0x51, 0x10,
6174 0x84, 0x03, 0x45, 0x33, 0x02, 0x51, 0x55, 0x20, 0x37, 0x76,
6175 0x00, 0x24, 0x58, 0x33, 0x24, 0x18, 0x67, 0x77, 0x31, 0x83,
6176 0x45, 0x17, 0x55, 0x12, 0x64, 0x07, 0x31, 0x08, 0x42, 0x56,
6177 0x45, 0x80, 0x32, 0x28, 0x61, 0x04, 0x83, 0x17, 0x10, 0x58,
6178 0x00, 0x18, 0x80, 0x85, 0x24, 0x15, 0x73, 0x38, 0x67, 0x84,
6179 0x68, 0x64, 0x85, 0x21, 0x32, 0x18, 0x41, 0x22, 0x34, 0x10,
6180 0x76, 0x05, 0x84, 0x47, 0x86, 0x26, 0x50, 0x86, 0x76, 0x72,
6181 0x25, 0x01, 0x36, 0x36, 0x67, 0x57, 0x42, 0x62, 0x10, 0x77,
6182 0x15, 0x66, 0x52, 0x20, 0x81, 0x86, 0x28, 0x42, 0x52, 0x73,
6183 0x44, 0x22, 0x04, 0x34, 0x15, 0x68, 0x65, 0x52, 0x30, 0x83,
6184 0x60, 0x20, 0x00, 0x57, 0x56, 0x28, 0x14, 0x16, 0x51, 0x87,
6185 0x57, 0x72, 0x01, 0x31, 0x31, 0x41, 0x58, 0x85, 0x80, 0x51,
6186 0x72, 0x27, 0x86, 0x11, 0x80, 0x76, 0x13, 0x66, 0x50, 0x18,
6187 0x75, 0x21, 0x06, 0x83, 0x20, 0x54, 0x44, 0x64, 0x44, 0x38,
6188 0x50, 0x56, 0x12, 0x78, 0x80, 0x71, 0x66, 0x20, 0x28, 0x83,
6189 0x50, 0x02, 0x46, 0x51, 0x86, 0x43, 0x55, 0x73, 0x38, 0x06,
6190 0x70, 0x06, 0x63, 0x43, 0x70, 0x81, 0x68, 0x21, 0x27, 0x14,
6191 0x75, 0x68, 0x68, 0x34, 0x03, 0x71, 0x34, 0x02, 0x28, 0x44,
6192 0x48, 0x46, 0x27, 0x16, 0x73, 0x60, 0x86, 0x86, 0x18, 0x80,
6193 0x05, 0x71, 0x88, 0x22, 0x13, 0x78, 0x50, 0x01, 0x60, 0x11,
6194 0x60, 0x77, 0x14, 0x66, 0x67, 0x66, 0x55, 0x56, 0x33, 0x53,
6195 0x28, 0x25, 0x54, 0x52, 0x31, 0x23, 0x56, 0x24, 0x44, 0x55,
6196 0x48, 0x67, 0x37, 0x64, 0x82, 0x02, 0x65, 0x88, 0x63, 0x41,
6197 0x83, 0x34, 0x30, 0x54, 0x63, 0x80, 0x07, 0x60, 0x81, 0x05,
6198 0x70, 0x83, 0x14, 0x60, 0x74, 0x04, 0x82, 0x38, 0x28, 0x24,
6199 0x84, 0x20, 0x68, 0x78, 0x81, 0x53, 0x71, 0x34, 0x81, 0x62,
6200 0x07, 0x63, 0x22, 0x45, 0x81, 0x74, 0x75, 0x03, 0x27, 0x26,
6201 0x50, 0x34, 0x47, 0x36, 0x86, 0x38, 0x17, 0x13, 0x10, 0x06,
6202 0x68, 0x43, 0x62, 0x33, 0x32, 0x53, 0x44, 0x48, 0x46, 0x08,
6203 0x87, 0x40, 0x27, 0x17, 0x68, 0x52, 0x38, 0x11, 0x57, 0x58,

NetBurner, Inc.
22.205 certs_test.h 1165

6204 0x70, 0x83, 0x32, 0x70, 0x60, 0x45, 0x67, 0x64, 0x88, 0x73,
6205 0x01, 0x40, 0x71, 0x60, 0x60, 0x20, 0x13, 0x71, 0x23, 0x75,
6206 0x14, 0x32, 0x78, 0x60, 0x55, 0x84, 0x63, 0x11, 0x47, 0x82,
6207 0x64, 0x68, 0x48, 0x63, 0x04, 0x14, 0x64, 0x85, 0x64, 0x58,
6208 0x10, 0x62, 0x70, 0x07, 0x02, 0x88, 0x57, 0x67, 0x42, 0x35,
6209 0x30, 0x02, 0x56, 0x17, 0x41, 0x57, 0x54, 0x77, 0x06, 0x43,
6210 0x71, 0x48, 0x64, 0x34, 0x18, 0x42, 0x08, 0x12, 0x47, 0x70,
6211 0x78, 0x24, 0x85, 0x34, 0x68, 0x30, 0x02, 0x01, 0x24, 0x01,
6212 0x53, 0x17, 0x67, 0x58, 0x72, 0x68, 0x53, 0x61, 0x63, 0x30,
6213 0x36, 0x87, 0x60, 0x77, 0x35, 0x14, 0x31, 0x17, 0x47, 0x60,
6214 0x25, 0x47, 0x64, 0x06, 0x77, 0x13, 0x63, 0x48, 0x43, 0x85,
6215 0x40, 0x88, 0x62, 0x01, 0x07, 0x83, 0x03, 0x21, 0x86, 0x34,
6216 0x48, 0x44, 0x71, 0x72, 0x85, 0x77, 0x64, 0x82, 0x78, 0x66,
6217 0x73, 0x28, 0x30, 0x71, 0x74, 0x76, 0x21, 0x12, 0x26, 0x24,
6218 0x72, 0x24, 0x66, 0x58, 0x27, 0x66, 0x71, 0x20, 0x26, 0x30,
6219 0x07, 0x60, 0x26, 0x62, 0x05, 0x21, 0x83, 0x77, 0x61, 0x60,
6220 0x24, 0x55, 0x64, 0x73, 0x00, 0x52, 0x35, 0x21, 0x27, 0x01,
6221 0x78, 0x78, 0x45, 0x38, 0x87, 0x23, 0x51, 0x88, 0x31, 0x62,
6222 0x36, 0x20, 0x10, 0x67, 0x23, 0x53, 0x38, 0x18, 0x76, 0x71,
6223 0x40, 0x68, 0x08, 0x86, 0x80, 0x46, 0x25, 0x27, 0x84, 0x76,
6224 0x81, 0x00, 0x20, 0x06, 0x50, 0x85, 0x15, 0x32, 0x27, 0x77,
6225 0x30, 0x77, 0x21, 0x52, 0x05, 0x76, 0x24, 0x51, 0x18, 0x06,
6226 0x50, 0x26, 0x52, 0x86, 0x30, 0x27, 0x31, 0x11, 0x12, 0x31,
6227 0x34, 0x75, 0x48, 0x62, 0x45, 0x64, 0x08, 0x26, 0x23, 0x48,
6228 0x66, 0x41, 0x78, 0x26, 0x26, 0x40, 0x36, 0x44, 0x36, 0x34,
6229 0x00, 0x61, 0x34, 0x67, 0x31, 0x03, 0x11, 0x24, 0x32, 0x80,
6230 0x06, 0x44, 0x34, 0x48, 0x42, 0x27, 0x52, 0x48, 0x76, 0x04,
6231 0x83, 0x07, 0x36, 0x86, 0x40, 0x84, 0x72, 0x56, 0x50, 0x37,
6232 0x23, 0x51, 0x52, 0x64, 0x20, 0x16, 0x05, 0x17, 0x57, 0x26,
6233 0x22, 0x58, 0x32, 0x65, 0x47, 0x35, 0x51, 0x32, 0x04, 0x74,
6234 0x37, 0x00, 0x11, 0x01, 0x66, 0x17, 0x12, 0x14, 0x81, 0x02,
6235 0x07, 0x53, 0x72, 0x48, 0x43, 0x73, 0x20, 0x60, 0x70, 0x73,
6236 0x47, 0x56, 0x07, 0x76, 0x36, 0x66, 0x72, 0x40, 0x83, 0x66,
6237 0x07, 0x11, 0x13, 0x16, 0x40, 0x45, 0x53, 0x58, 0x75, 0x21,
6238 0x83, 0x15, 0x36, 0x67, 0x65, 0x83, 0x32, 0x82, 0x54, 0x41,
6239 0x71, 0x61, 0x60, 0x74, 0x30, 0x16, 0x35, 0x81, 0x33, 0x35,
6240 0x16, 0x06, 0x13, 0x37, 0x36, 0x24, 0x57, 0x54, 0x43, 0x44,
6241 0x85, 0x74, 0x38, 0x11, 0x27, 0x23, 0x33, 0x41, 0x70, 0x36,
6242 0x52, 0x87, 0x42, 0x23, 0x31, 0x08, 0x01, 0x50, 0x17, 0x80,
6243 0x64, 0x46, 0x06, 0x50, 0x23, 0x20, 0x88, 0x85, 0x05, 0x24,
6244 0x68, 0x44, 0x36, 0x32, 0x20, 0x84, 0x55, 0x07, 0x23, 0x70,
6245 0x52, 0x14, 0x61, 0x17, 0x20, 0x03, 0x25, 0x58, 0x74, 0x24,
6246 0x71, 0x48, 0x20, 0x51, 0x25, 0x24, 0x53, 0x28, 0x15, 0x37,
6247 0x57, 0x00, 0x76, 0x05, 0x13, 0x52, 0x82, 0x43, 0x64, 0x10,
6248 0x51, 0x15, 0x37, 0x57, 0x41, 0x50, 0x64, 0x60, 0x08, 0x60,
6249 0x83, 0x83, 0x27, 0x22, 0x77, 0x54, 0x88, 0x26, 0x12, 0x10,
6250 0x00, 0x27, 0x65, 0x86, 0x04, 0x67, 0x82, 0x65, 0x42, 0x30,
6251 0x50, 0x10, 0x15, 0x35, 0x03, 0x12, 0x50, 0x00, 0x63, 0x50,
6252 0x53, 0x65, 0x21, 0x48, 0x03, 0x52, 0x36, 0x78, 0x06, 0x01,
6253 0x20, 0x80, 0x01, 0x52, 0x68, 0x26, 0x80, 0x67, 0x06, 0x08,
6254 0x11, 0x80, 0x80, 0x74, 0x68, 0x75, 0x13, 0x00, 0x80, 0x12,
6255 0x28, 0x28, 0x02, 0x53, 0x06, 0x04, 0x54, 0x70, 0x46, 0x00,
6256 0x62, 0x82, 0x44, 0x71, 0x45, 0x67, 0x82, 0x37, 0x17, 0x58,
6257 0x32, 0x04, 0x17, 0x34, 0x52, 0x08, 0x83, 0x25, 0x32, 0x23,
6258 0x46, 0x61, 0x37, 0x53, 0x12, 0x35, 0x14, 0x35, 0x82, 0x17,
6259 0x76, 0x82, 0x74, 0x51, 0x32, 0x85, 0x71, 0x01, 0x62, 0x28,
6260 0x28, 0x22, 0x23, 0x27, 0x54, 0x00, 0x86, 0x16, 0x88, 0x27,
6261 0x62, 0x38, 0x87, 0x67, 0x84, 0x74, 0x45, 0x45, 0x33, 0x06,
6262 0x21, 0x67, 0x81, 0x63, 0x07, 0x87, 0x55, 0x43, 0x08, 0x32,
6263 0x36, 0x66, 0x48, 0x00, 0x48, 0x75, 0x14, 0x14, 0x68, 0x43,
6264 0x57, 0x10, 0x46, 0x15, 0x87, 0x84, 0x15, 0x87, 0x18, 0x34,
6265 0x24, 0x10, 0x41, 0x77, 0x87, 0x01, 0x64, 0x33, 0x10, 0x83,
6266 0x10, 0x15, 0x43, 0x40, 0x00, 0x26, 0x72, 0x76, 0x01, 0x12,
6267 0x68, 0x33, 0x05, 0x42, 0x14, 0x70, 0x75, 0x65, 0x64, 0x03,
6268 0x03, 0x31, 0x66, 0x38, 0x14, 0x20, 0x42, 0x74, 0x02, 0x40,
6269 0x84, 0x64, 0x65, 0x45, 0x00, 0x41, 0x86, 0x66, 0x27, 0x06,
6270 0x56, 0x02, 0x17, 0x41, 0x76, 0x45, 0x66, 0x85, 0x25, 0x43,
6271 0x28, 0x21, 0x01, 0x62, 0x70, 0x50, 0x75, 0x00, 0x24, 0x21,
6272 0x65, 0x70, 0x54, 0x16, 0x33, 0x62, 0x14, 0x28, 0x64, 0x86,
6273 0x24, 0x70, 0x36, 0x46, 0x50, 0x60, 0x11, 0x32, 0x46, 0x86,
6274 0x07, 0x23, 0x70, 0x53, 0x01, 0x43, 0x80, 0x84, 0x41, 0x61,
6275 0x34, 0x10, 0x24, 0x57, 0x06, 0x51, 0x60, 0x22, 0x66, 0x88,
6276 0x25, 0x74, 0x72, 0x74, 0x64, 0x44, 0x27, 0x03, 0x10, 0x23,
6277 0x20, 0x16, 0x22, 0x35, 0x28, 0x32, 0x10, 0x73, 0x22, 0x26,
6278 0x31, 0x20, 0x57, 0x65, 0x71, 0x58, 0x14, 0x14, 0x08, 0x87,
6279 0x85, 0x80, 0x45, 0x83, 0x77, 0x55, 0x20, 0x34, 0x86, 0x72,
6280 0x10, 0x76, 0x76, 0x01, 0x16, 0x33, 0x40, 0x83, 0x32, 0x86,
6281 0x04, 0x03, 0x12, 0x78, 0x46, 0x10, 0x88, 0x10, 0x33, 0x76,
6282 0x83, 0x14, 0x01, 0x37, 0x62, 0x78, 0x43, 0x21, 0x27, 0x22,
6283 0x16, 0x22, 0x55, 0x00, 0x11, 0x74, 0x81, 0x28, 0x60, 0x78,
6284 0x74, 0x80, 0x81, 0x80, 0x63, 0x05, 0x51, 0x35, 0x34, 0x70,
6285 0x61, 0x02, 0x77, 0x47, 0x40, 0x47, 0x40, 0x87, 0x75, 0x06,
6286 0x26, 0x46, 0x53, 0x36, 0x14, 0x66, 0x10, 0x20, 0x43, 0x52,
6287 0x47, 0x08, 0x55, 0x26, 0x65, 0x53, 0x28, 0x41, 0x43, 0x11,
6288 0x61, 0x27, 0x16, 0x46, 0x31, 0x08, 0x71, 0x26, 0x27, 0x15,
6289 0x05, 0x06, 0x66, 0x57, 0x41, 0x31, 0x37, 0x03, 0x15, 0x68,
6290 0x08, 0x88, 0x63, 0x34, 0x01, 0x61, 0x01, 0x11, 0x58, 0x66,

NetBurner, Inc.
1166 File Documentation

6291 0x14, 0x22, 0x44, 0x40, 0x02, 0x66, 0x35, 0x37, 0x54, 0x44,
6292 0x67, 0x44, 0x08, 0x43, 0x70, 0x20, 0x45, 0x70, 0x38, 0x04,
6293 0x65, 0x61, 0x57, 0x32, 0x15, 0x12, 0x83, 0x31, 0x58, 0x46,
6294 0x28, 0x08, 0x86, 0x55, 0x12, 0x16, 0x21, 0x70, 0x50, 0x88,
6295 0x07, 0x34, 0x32, 0x61, 0x18, 0x50, 0x86, 0x03, 0x58, 0x41,
6296 0x43, 0x40, 0x76, 0x63, 0x37, 0x43, 0x71, 0x18, 0x23, 0x25,
6297 0x06, 0x71, 0x62, 0x47, 0x16, 0x12, 0x77, 0x84, 0x01, 0x70,
6298 0x85, 0x41, 0x07, 0x42, 0x80, 0x71, 0x26, 0x05, 0x85, 0x73,
6299 0x14, 0x38, 0x66, 0x31, 0x25, 0x67, 0x82, 0x07, 0x22, 0x73,
6300 0x23, 0x34, 0x61, 0x65, 0x45, 0x46, 0x74, 0x64, 0x34, 0x57,
6301 0x47, 0x72, 0x75, 0x34, 0x76, 0x11, 0x31, 0x61, 0x77, 0x57,
6302 0x68, 0x42, 0x18, 0x18, 0x37, 0x80, 0x06, 0x77, 0x71, 0x30,
6303 0x85, 0x42, 0x67, 0x56, 0x42, 0x70, 0x32, 0x53, 0x55, 0x48,
6304 0x40, 0x32, 0x37, 0x21, 0x35, 0x15, 0x45, 0x27, 0x85, 0x36,
6305 0x61, 0x73, 0x21, 0x26, 0x81, 0x83, 0x64, 0x84, 0x75, 0x75,
6306 0x54, 0x68, 0x84, 0x54, 0x75, 0x17, 0x10, 0x35, 0x13, 0x37,
6307 0x55, 0x11, 0x62, 0x44, 0x38, 0x38, 0x70, 0x45, 0x84, 0x73,
6308 0x78, 0x75, 0x22, 0x42, 0x34, 0x0C, 0x86, 0xF0, 0x92, 0x29,
6309 0xBC, 0x51, 0xBB, 0x69, 0x5E, 0x8A, 0x57, 0x55, 0x1E, 0xE8,
6310 0x00, 0xF7, 0x97, 0xC7, 0xF5, 0x35, 0xEA, 0xDC, 0x86, 0xD5,
6311 0x95, 0x70, 0x09, 0x28, 0x44, 0x93, 0x8B, 0xE1, 0xE2, 0xCE,
6312 0xA6, 0x37, 0xAC, 0x68, 0x94, 0x2E, 0xC5, 0xD3, 0xC9, 0x6D,
6313 0xAA, 0xF0, 0x46, 0x12, 0xC6, 0xA2, 0xC9, 0x84, 0xD1, 0xB2,
6314 0x80, 0x32, 0xC5, 0xBD, 0x41, 0x6D, 0x7C, 0xF8, 0x9C, 0xCA,
6315 0x1F, 0xE6, 0x25, 0xBA, 0xDD, 0x18, 0x3F, 0xAE, 0xC3, 0x12,
6316 0x39, 0xA6, 0xF5, 0xF1, 0xA0, 0x5A, 0xF7, 0x67, 0x4F, 0x5C,
6317 0xF1, 0x72, 0x60, 0x7D, 0xB5, 0xC1, 0x63, 0x9E, 0x4F, 0x96,
6318 0x93, 0x6F, 0x56, 0xD3, 0xE1, 0x98, 0xED, 0xA0, 0x3A, 0x5D,
6319 0x85, 0x3C, 0x65, 0x57, 0x12, 0x28, 0x17, 0x54, 0x4D, 0x50,
6320 0x1B, 0x3C, 0x93, 0x81, 0x05, 0x53, 0x79, 0xFD, 0x1C, 0xC0,
6321 0x55, 0x1E, 0xC2, 0xC3, 0x5B, 0xE8, 0x10, 0xF3, 0x4D, 0x89,
6322 0x1C, 0x0A, 0xC9, 0xF9, 0x4E, 0x3D, 0x30, 0xF1, 0x52, 0xC3,
6323 0xE7, 0xE1, 0xF6, 0x59, 0xEC, 0xCF, 0xF6, 0x87, 0xA6, 0xAD,
6324 0xAD, 0x0A, 0x8A, 0x35, 0x84, 0xCB, 0x53, 0x7F, 0x4C, 0x5D,
6325 0xD2, 0xAD, 0xB4, 0xBE, 0x28, 0xC6, 0xCC, 0x35, 0xA8, 0x48,
6326 0x0A, 0xEA, 0xE9, 0x85, 0x89, 0xE6, 0xC1, 0xA2, 0x7E, 0x72,
6327 0x0F, 0xAF, 0xDC, 0xEA, 0x54, 0x4C, 0xF8, 0xA0, 0xB4, 0x4F,
6328 0x82, 0x6B, 0xEF, 0x7E, 0xC5, 0xFF, 0x82, 0x9D, 0xE7, 0x6D,
6329 0x7A, 0x64, 0x3E, 0xF8, 0x9F, 0x67, 0x34, 0x3D, 0x72, 0xC4,
6330 0x6B, 0x5B, 0xE8, 0xE9, 0xBF, 0x7E, 0x3C, 0xC8, 0xB6, 0xF5,
6331 0xCA, 0x0D, 0x9A, 0x2E, 0x76, 0xDE, 0xC6, 0x34, 0xCA, 0xEC,
6332 0xBC, 0x07, 0x0D, 0x5A, 0x0C, 0xD3, 0x3C, 0xCE, 0xB0, 0x31,
6333 0x20, 0xD4, 0x7C, 0x4C, 0x49, 0x52, 0xBA, 0xD2, 0x3C, 0x25,
6334 0x36, 0xF1, 0x8A, 0x7F, 0x51, 0x0B, 0x3C, 0xAA, 0xE4, 0xD0,
6335 0xA8, 0x07, 0x6B, 0x7E, 0x2C, 0xE0, 0xF0, 0x4B, 0xDE, 0x00,
6336 0xD8, 0xD0, 0xD0, 0xA0, 0x2A, 0x2C, 0x5A, 0xB5, 0x84, 0x9A,
6337 0x8A, 0x7C, 0x40, 0x41, 0x0B, 0xF3, 0x78, 0x33, 0xBC, 0xC9,
6338 0x84, 0xCE, 0x0B, 0xA3, 0x2E, 0x53, 0x43, 0xA5, 0x04, 0x2E,
6339 0xD4, 0xA0, 0x88, 0x9B, 0x7C, 0xA1, 0xDD, 0xF4, 0xE9, 0x64,
6340 0xCB, 0x13, 0x72, 0x0F, 0xE6, 0x9D, 0x52, 0xDD, 0x17, 0xC3,
6341 0x80, 0xEE, 0xD0, 0xB2, 0xD3, 0x34, 0xDF, 0xEC, 0xDE, 0x52,
6342 0x5A, 0xFE, 0x0A, 0x1F, 0x51, 0x14, 0x92, 0x56, 0xEC, 0xA4,
6343 0x89, 0x8C, 0x4C, 0x0F, 0xAB, 0xB3, 0x67, 0x65, 0x24, 0xAF,
6344 0x68, 0x68, 0x01, 0xBD, 0xF7, 0x51, 0x6F, 0x58, 0x59, 0x47,
6345 0x04, 0xE1, 0x12, 0xD1, 0x51, 0x42, 0x98, 0x88, 0xFA, 0xFF,
6346 0x2D, 0xE3, 0xB8, 0xB1, 0xAE, 0xE3, 0x82, 0xDC, 0xB2, 0x3A,
6347 0x4F, 0x2F, 0xBC, 0x99, 0xCD, 0x47, 0xD9, 0xF0, 0x81, 0xAB,
6348 0xCE, 0x61, 0x0A, 0x03, 0xC2, 0xF4, 0x7A, 0x09, 0x2F, 0xD3,
6349 0x2C, 0xE2, 0x3E, 0xBE, 0xFA, 0xB7, 0x0C, 0xA7, 0x3D, 0xF3,
6350 0x1C, 0x46, 0x4C, 0xDC, 0x87, 0xCF, 0x11, 0x47, 0xB2, 0xDE,
6351 0x2E, 0x05, 0x2F, 0x9C, 0x40, 0x87, 0x67, 0xF6, 0xE1, 0x49,
6352 0x89, 0x9B, 0x3C, 0x52, 0x86, 0x4D, 0x6C, 0xC8, 0x45, 0x90,
6353 0xC9, 0x30, 0x09, 0x79, 0xB7, 0x5D, 0xFA, 0x74, 0x4C, 0x9D,
6354 0x3C, 0x8B, 0x3C, 0x90, 0xD0, 0x96, 0x59, 0xBD, 0x3E, 0x61,
6355 0xD5, 0xC6, 0xCF, 0x05, 0xD7, 0xD3, 0x0F, 0x8A, 0x6E, 0x79,
6356 0xBA, 0x85, 0x9C, 0x53, 0x83, 0x28, 0xDC, 0x2C, 0x06, 0xE3,
6357 0x10, 0x4B, 0xD9, 0xED, 0x4C, 0xEA, 0x28, 0x9C, 0x3B, 0xF9,
6358 0xB1, 0x6B, 0x91, 0xEA, 0xF5, 0x1B, 0x14, 0x6E, 0x6E, 0xBF,
6359 0xBC, 0xF4, 0x61, 0x5D, 0x0A, 0x9A, 0xC4, 0x29, 0xC7, 0x50,
6360 0x91, 0x6D, 0x6C, 0x5F, 0x5D, 0xB0, 0xBB, 0x5C, 0x2B, 0x40,
6361 0xFF, 0x75, 0x73, 0xE3, 0xB6, 0x52, 0x78, 0x32, 0x33, 0x91,
6362 0x00, 0x3B, 0xF1, 0x11, 0xA6, 0xBF, 0x9A, 0x1A, 0xD2, 0x0E,
6363 0xE2, 0xBB, 0xDF, 0x4F, 0x55, 0x7E, 0x45, 0x4A, 0x1E, 0x45,
6364 0x22, 0x42, 0xCA, 0x87, 0x63, 0x9E, 0x82, 0xB7, 0x67, 0xE8,
6365 0x2A, 0xDE, 0x3A, 0x2E, 0x61, 0xF1, 0x56, 0xA4, 0x63, 0x9F,
6366 0x32, 0xD8, 0xD0, 0xA4, 0xFB, 0xAE, 0xCF, 0x6C, 0xEC, 0x66,
6367 0x4D, 0xA7, 0xA4, 0xE1, 0x8C, 0x39, 0xFF, 0x2E, 0xA3, 0xDB,
6368 0x01, 0x67, 0xA4, 0x80, 0x03, 0x73, 0xA7, 0x9C, 0x6B, 0x51,
6369 0x57, 0x35, 0x0D, 0x1A, 0x44, 0xCD, 0x80, 0x06, 0xA5, 0x2F,
6370 0xA0, 0xF3, 0x65, 0x7A, 0xCB, 0x34, 0x58, 0xD3, 0xCF, 0xF7,
6371 0x28, 0xBC, 0xB9, 0x1C, 0xE2, 0x22, 0x6C, 0x1E, 0xE5, 0x0D,
6372 0x73, 0x1F, 0x8C, 0xA6, 0xF2, 0x94, 0x9B, 0xE5, 0xDA, 0xE3,
6373 0x9B, 0x1A, 0xE1, 0x5E, 0x9D, 0xE3, 0x6F, 0x0F, 0x29, 0x57,
6374 0xE4, 0x12, 0x32, 0xC1, 0x5C, 0xD3, 0xE8, 0xDE, 0xC1, 0x44,
6375 0x40, 0x9B, 0x59, 0x4F, 0xDD, 0x7E, 0xA4, 0x32, 0x8E, 0xE0,
6376 0x0D, 0xDC, 0x3F, 0x67, 0x7A, 0xA7, 0x52, 0x67, 0xF1, 0xA1,
6377 0xF5, 0x8C, 0xEF, 0xB5, 0xFC, 0x9E, 0x48, 0x39, 0xAC, 0xEF,

NetBurner, Inc.
22.205 certs_test.h 1167

6378 0xE6, 0x7A, 0x58, 0xFB, 0xEF, 0x2B, 0xBE, 0x80, 0x09, 0x85,
6379 0x53, 0x5E, 0x9D, 0x9B, 0x07, 0x18, 0xE8, 0x44, 0x5A, 0xE3,
6380 0xDD, 0xE5, 0x17, 0xE7, 0x8C, 0x9A, 0x55, 0x51, 0x14, 0xD9,
6381 0x1C, 0x2D, 0x41, 0x00, 0xBC, 0x1F, 0x78, 0x85, 0x44, 0x38,
6382 0xC7, 0x59, 0x71, 0x69, 0x81, 0x2D, 0x7A, 0x27, 0x3B, 0xC2,
6383 0x65, 0x00, 0xAC, 0x47, 0x0D, 0x81, 0xF7, 0x81, 0x50, 0x97,
6384 0x69, 0x98, 0xE7, 0x55, 0x2E, 0x77, 0xA4, 0x43, 0x7B, 0xF0,
6385 0x27, 0xCC, 0xB5, 0xC9, 0x9E, 0xEB, 0x8E, 0x7F, 0xE0, 0x7F,
6386 0xE7, 0x0A, 0x3B, 0xDF, 0x40, 0x3D, 0x5F, 0x43, 0xA4, 0x20,
6387 0x11, 0x06, 0x8C, 0xC9, 0x8D, 0xCA, 0xAD, 0xDD, 0xED, 0xD4,
6388 0x0F, 0xCA, 0xA2, 0xA5, 0x04, 0x8B, 0x59, 0x13, 0xBE, 0xE9,
6389 0xC2, 0x38, 0x23, 0x26, 0x64, 0x29, 0x08, 0xF6, 0xC2, 0xD0,
6390 0x92, 0x02, 0x6B, 0x45, 0x05, 0x53, 0xF0, 0xC6, 0xC6, 0x6C,
6391 0xB7, 0xDE, 0x94, 0xDE, 0x74, 0x5F, 0x24, 0x43, 0x85, 0x94,
6392 0x6F, 0x5B, 0xFC, 0xD8, 0x12, 0xC6, 0xF7, 0xA8, 0xF0, 0x15,
6393 0x4B, 0x05, 0x08, 0xD0, 0x49, 0xD0, 0xB5, 0xEB, 0x39, 0x67,
6394 0xCC, 0xD0, 0x28, 0xD7, 0xF3, 0x13, 0xC7, 0xDA, 0x93, 0xEE,
6395 0x93, 0x33, 0xAB, 0x7C, 0x7F, 0x92, 0xBD, 0x23, 0xC1, 0x35,
6396 0x3B, 0x59, 0xEE, 0x55, 0xE7, 0x25, 0xAC, 0x79, 0x61, 0xEF,
6397 0xE7, 0x19, 0xEF, 0x26, 0xDF, 0x67, 0x04, 0xD0, 0x57, 0xBF,
6398 0x8A, 0x34, 0x66, 0x8A, 0xD0, 0xFF, 0x04, 0x76, 0xF4, 0x52,
6399 0x4F, 0xC1, 0xA0, 0xE5, 0x18, 0x13, 0x14, 0x9B, 0xC7, 0x93,
6400 0x14, 0xAA, 0xCE, 0x12, 0x1A, 0x28, 0x04, 0x4A, 0xC4, 0xC6,
6401 0x32, 0x13, 0x38, 0xDA, 0x7D, 0x2A, 0x03, 0x00, 0x12, 0xB9,
6402 0x76, 0x33, 0x44, 0xFF, 0xEC, 0xC8, 0x7D, 0xFF, 0x01, 0x35,
6403 0xCF, 0xD0, 0x13, 0xEA, 0x7B, 0x54, 0x53, 0x44, 0x76, 0x8B,
6404 0xCB, 0x7E, 0xF1, 0xF5, 0x78, 0xEB, 0xEC, 0xE3, 0x11, 0xD8,
6405 0x29, 0xBB, 0x86, 0x1D, 0x98, 0xFB, 0xE6, 0x5E, 0x6E, 0xC2,
6406 0x29, 0xD6, 0x42, 0x8E, 0xE5, 0x8B, 0x1F, 0x11, 0x7E, 0x31,
6407 0x86, 0x4C, 0x21, 0x3E, 0x15, 0xD8, 0xE9, 0x3B, 0x32, 0x3D,
6408 0x1E, 0x59, 0xC5, 0x90, 0xF9, 0xFE, 0x8A, 0xF1, 0xCF, 0x51,
6409 0x26, 0x6A, 0xBD, 0xEB, 0xDC, 0x61, 0x4F, 0x39, 0x82, 0x17,
6410 0xB6, 0x48, 0x36, 0x01, 0xD7, 0xFE, 0x84, 0x28, 0x7A, 0x4E,
6411 0xC7, 0x85, 0x5A, 0x67, 0xDF, 0xAC, 0xD2, 0xC3, 0xFD, 0x43,
6412 0x5A, 0x5E, 0xFB, 0x27, 0x94, 0x86, 0x39, 0x57, 0xC1, 0xC3,
6413 0xB8, 0xB9, 0x6C, 0x42, 0x76, 0xCC, 0xF7, 0x92, 0xCC, 0xB4,
6414 0x66, 0xD7, 0x96, 0x36, 0xE6, 0x00, 0xCA, 0xE9, 0x1D, 0xDF,
6415 0xBB, 0x50, 0xF5, 0xCF, 0x19, 0xCF, 0x5D, 0x51, 0x79, 0xE2,
6416 0xE5, 0x97, 0xEC, 0xB0, 0x31, 0xC6, 0xE7, 0x85, 0xB2, 0x5F,
6417 0x2D, 0xB2, 0x19, 0x41, 0x9A, 0x2F, 0xB3, 0x77, 0xB9, 0x55,
6418 0xFE, 0x58, 0x66, 0xE9, 0x36, 0x28, 0x07, 0x02, 0xEC, 0xAA,
6419 0xD7, 0xC6, 0x7F, 0x86, 0x22, 0xF6, 0x4A, 0x99, 0x42, 0xD8,
6420 0x4E, 0xFC, 0x39, 0x18, 0xCE, 0x97, 0xF2, 0xE7, 0xCE, 0x58,
6421 0xB2, 0x4B, 0x4C, 0x84, 0x74, 0x60, 0xC1, 0xF8, 0x6C, 0xDD,
6422 0x81, 0x4D, 0x42, 0x8D, 0x3C, 0x90, 0x25, 0x3D, 0xF8, 0xCE,
6423 0x86, 0xEA, 0x44, 0x54, 0xE1, 0xB0, 0x62, 0x37, 0x6C, 0xE0,
6424 0x9B, 0xFC, 0x55, 0x7D, 0x71, 0x9E, 0x94, 0x82, 0xD4, 0x62,
6425 0x6B, 0x8A, 0x1C, 0xA4, 0xF1, 0x1E, 0x07, 0x3D, 0xF8, 0xB8,
6426 0x57, 0xAF, 0x40, 0x35, 0xDF, 0x8B, 0x37, 0x24, 0xDC, 0x67,
6427 0x35, 0x5B, 0x65, 0x66, 0x2C, 0x0D, 0x41, 0x40, 0x8A, 0xB1,
6428 0xE2, 0xFA, 0x8D, 0x3D, 0x23, 0xA6, 0x15, 0xDF, 0x5C, 0x88,
6429 0xA2, 0x40, 0xE0, 0x7C, 0xF1, 0x33, 0x39, 0x9B, 0xC7, 0x7E,
6430 0xD5, 0xC1, 0xA8, 0x21, 0x6B, 0xB4, 0x9C, 0x9E, 0xE1, 0x7A,
6431 0xAE, 0xDC, 0x30, 0x40, 0x54, 0x66, 0xA0, 0x60, 0xA0, 0x73,
6432 0xF9, 0x7D, 0xA1, 0xCC, 0x51, 0x33, 0x2C, 0x2E, 0x16, 0xA2,
6433 0x87, 0x98, 0x70, 0x43, 0xCF, 0x40, 0x09, 0x0D, 0xC2, 0x6E,
6434 0x20, 0xEF, 0xED, 0xE3, 0xDE, 0xF3, 0x35, 0x01, 0xB3, 0x21,
6435 0xC0, 0x37, 0x44, 0xB9, 0xE8, 0xDB, 0x4A, 0xD1, 0x7E, 0x7E,
6436 0x9F, 0x3D, 0xFE, 0x3A, 0xEF, 0x86, 0xD5, 0x4C, 0x4A, 0x03,
6437 0x6C, 0xFE, 0x0F, 0x76, 0x7B, 0xB2, 0xE5, 0x99, 0xAE, 0x34,
6438 0x34, 0xF9, 0x47, 0x97, 0x0F, 0x59, 0x24, 0xCD, 0xB1, 0x74,
6439 0x8D, 0xC8, 0x8A, 0x5D, 0x0A, 0xD6, 0x78, 0xA4, 0x9D, 0x10,
6440 0x87, 0xA7, 0xD4, 0x2B, 0x19, 0xA4, 0x45, 0x1F, 0xE9, 0x5D,
6441 0x6D, 0x14, 0x4D, 0xA0, 0x5E, 0x01, 0x64, 0xEE, 0x12, 0x89,
6442 0xD0, 0x77, 0xCC, 0x88, 0x5B, 0x00, 0x77, 0xE1, 0x09, 0xE6,
6443 0x32, 0x6A, 0xDF, 0x14, 0xE3, 0x2F, 0xF7, 0x14, 0x2A, 0x89,
6444 0x54, 0x4B, 0x07, 0xD9, 0x04, 0x3A, 0xFE, 0x22, 0xF2, 0x81,
6445 0x19, 0x92, 0x69, 0x70, 0xF7, 0x29, 0x2B, 0x5C, 0x74, 0x99,
6446 0x20, 0xF9, 0xEE, 0x69, 0x1C, 0xA5, 0x7E, 0x44, 0xBC, 0xEC,
6447 0x88, 0xBB, 0x0D, 0xC8, 0xAD, 0xE5, 0x47, 0x82, 0x9D, 0x9E,
6448 0xCF, 0xAD, 0x3B, 0x7F, 0xDD, 0xE8, 0x4C, 0x79, 0xDB, 0x1A,
6449 0xA5, 0x39, 0x76, 0x6F, 0x99, 0x6B, 0x32, 0x24, 0xAC, 0x39,
6450 0xEA, 0x98, 0x81, 0xA7, 0x9F, 0xD0, 0x10, 0x4C, 0xA7, 0xA5,
6451 0x39, 0x1D, 0x30, 0x05, 0xFA, 0xB7, 0xF7, 0x0A, 0x0D, 0xBA,
6452 0x8C, 0xA0, 0x90, 0xB1, 0x4A, 0x75, 0x17, 0x2C, 0x87, 0xBA,
6453 0x27, 0x41, 0x7F, 0xA5, 0xCF, 0x0B, 0xA4, 0x3B, 0x5F, 0xB6,
6454 0xCC, 0x6F, 0x0A, 0x0A, 0x25, 0x04, 0x67, 0xF5, 0x92, 0x7F,
6455 0xD2, 0xF6, 0x6A, 0xAF, 0xB2, 0x43, 0x93, 0xCB, 0x92, 0x7D,
6456 0xA6, 0xB4, 0x52, 0xBF, 0x76, 0x5A, 0xC2, 0xFB, 0xC1, 0x12,
6457 0xEB, 0x94, 0xC2, 0x49, 0x4C, 0x9C, 0x0B, 0x93, 0x0E, 0x68,
6458 0x83, 0x78, 0xA3, 0x72, 0xFE, 0xE9, 0x00, 0x65, 0x57, 0x55,
6459 0x07, 0xFA, 0xB8, 0xCF, 0x8E, 0xCF, 0x8E, 0xCF, 0x44, 0x01,
6460 0x4D, 0xDF, 0x66, 0x7E, 0x64, 0xE1, 0x1B, 0x19, 0x5C, 0x12,
6461 0xDD, 0x8E, 0x23, 0x68, 0x2B, 0xF0, 0xD3, 0xF5, 0x7A, 0x91,
6462 0x47, 0x5C, 0xE3, 0xF0, 0x85, 0x41, 0xD8, 0x9A, 0xFF, 0x24,
6463 0x26, 0x21, 0x6B, 0xA1, 0x6E, 0x62, 0x12, 0xFD, 0xD3, 0xD8,
6464 0x36, 0x5B, 0xCC, 0xB0, 0x59, 0x4F, 0x0C, 0x5A, 0xD6, 0x5B,

NetBurner, Inc.
1168 File Documentation

6465 0x11, 0xA6, 0x65, 0xB1, 0x3F, 0x0A, 0x96, 0xD2, 0x31, 0x00,
6466 0x9D, 0xD5, 0x73, 0x86, 0xE8, 0x82, 0x11, 0xFB, 0x71, 0x4B,
6467 0x92, 0xA1, 0x3E, 0x39, 0x6C, 0x42, 0x51, 0x2F, 0x69, 0x69,
6468 0x56, 0xC2, 0xED, 0xE3, 0x2E, 0x9F, 0xFD, 0x88, 0xC6, 0xA9,
6469 0xAC, 0xDC, 0xB9, 0xA6, 0x36, 0x57, 0xBD, 0x15, 0xF0, 0xE1,
6470 0x36, 0xEE, 0x90, 0xB0, 0xBD, 0x27, 0xED, 0xCB, 0x29, 0xBB,
6471 0x0C, 0x83, 0xB0, 0x18, 0x42, 0x36, 0x18, 0x98, 0x28, 0x0F,
6472 0xFC, 0xB0, 0x2A, 0xD5, 0x72, 0x10, 0x5A, 0x1A, 0x58, 0xE5,
6473 0x95, 0xA7, 0x86, 0x19, 0xAC, 0x92, 0xAD, 0x21, 0x53, 0x67,
6474 0x2E, 0x66, 0x59, 0xB0, 0x03, 0xF4, 0xE1, 0x29, 0x79, 0x0A,
6475 0xAA, 0x9D, 0x2D, 0x61, 0xC2, 0xE7, 0x36, 0x2D, 0x8B, 0x22,
6476 0x3E, 0x3D, 0x9F, 0xD8, 0xE3, 0x34, 0xD9, 0x47, 0x3C, 0x2E,
6477 0x9A, 0x97, 0x4F, 0x9F, 0x8E, 0x9A, 0xEA, 0x18, 0x2A, 0x8C,
6478 0xD5, 0x0D, 0x1A, 0xA1, 0x27, 0xBB, 0x95, 0xF2, 0xDF, 0xA5,
6479 0xB2, 0x7F, 0xFD, 0x8D, 0xC4, 0xB1, 0xA7, 0xFD, 0xA5, 0x82,
6480 0x78, 0x04, 0xFA, 0x92, 0xD1, 0x54, 0x0A, 0x40, 0x0D, 0x59,
6481 0x36, 0xC3, 0x16, 0x1D, 0xE7, 0xF8, 0x88, 0xBF, 0xE6, 0x74,
6482 0xD8, 0x26, 0xFC, 0x77, 0x4D, 0x3D, 0x68, 0xD6, 0x37, 0x0C,
6483 0x0F, 0x5A, 0xC5, 0x47, 0x02, 0x90, 0x7A, 0x5A, 0x96, 0x79,
6484 0x69, 0x30, 0x4F, 0xD5, 0xAA, 0x60, 0x3D, 0xE7, 0x5D, 0x09,
6485 0x41, 0x54, 0x06, 0xC2, 0xCA, 0xD5, 0xB8, 0xFB, 0x12, 0x15,
6486 0x22, 0x0E, 0x49, 0x8C, 0xD9, 0xB4, 0x3C, 0x36, 0x7C, 0xCB,
6487 0x3C, 0xFA, 0x97, 0xF4, 0x1C, 0xCF, 0x49, 0x81, 0x96, 0xF3,
6488 0x5E, 0xC8, 0x43, 0xB9, 0x28, 0xD6, 0xE9, 0x3D, 0x9E, 0xB3,
6489 0x4C, 0xE5, 0x87, 0x23, 0xDD, 0xC9, 0x93, 0x69, 0x3E, 0x5F,
6490 0x3B, 0xB6, 0xA8, 0x11, 0x3F, 0x70, 0x10, 0x3E, 0x13, 0xCF,
6491 0x69, 0x89, 0xAB, 0x58, 0xB0, 0x68, 0x74, 0x68, 0x4A, 0x61,
6492 0x0A, 0x6E, 0xFE, 0xF0, 0xDA, 0xA1, 0x11, 0x67, 0xC1, 0x90,
6493 0xAB, 0xE7, 0x23, 0x69, 0x73, 0xD2, 0xF0, 0xD8, 0x6F, 0x09,
6494 0x22, 0x35, 0xA3, 0xBA, 0x3A, 0x80, 0x6B, 0x45, 0x90, 0x2F,
6495 0x17, 0x68, 0xF6, 0x0D, 0x52, 0x32, 0x51, 0x67, 0xDE, 0x70,
6496 0x88, 0x7B, 0x33, 0xF9, 0x2C, 0xE0, 0xE1, 0x0C, 0x56, 0x26,
6497 0xE6, 0x86, 0xD9, 0x80, 0x6E, 0xD0, 0x86, 0xF1, 0xC9, 0x1A,
6498 0x08, 0x94, 0x1E, 0x01, 0x72, 0x51, 0x04, 0x73, 0x47, 0xAE,
6499 0x6C, 0xFC, 0x16, 0x48, 0x73, 0x30, 0xCF, 0xC6, 0xBD, 0x6E,
6500 0x26, 0xF6, 0x9F, 0xAE, 0xF3, 0x3D, 0x39, 0x12, 0xF3, 0x39,
6501 0x00, 0x87, 0x10, 0x30, 0x83, 0xDC, 0x75, 0x38, 0x2B, 0x83,
6502 0x43, 0xAB, 0xC0, 0x56, 0x08, 0x6F, 0x54, 0x9E, 0xCD, 0x78,
6503 0x05, 0x86, 0x38, 0xFC, 0x95, 0x18, 0x76, 0xC0, 0x19, 0x5A,
6504 0xCA, 0xAF, 0xEB, 0x1E, 0x07, 0x1A, 0x35, 0x12, 0x63, 0xF8,
6505 0x3F, 0xC8, 0x7F, 0xCE, 0x0A, 0x13, 0xBD, 0x9A, 0x6D, 0x03,
6506 0x77, 0xE3, 0xB9, 0x04, 0x84, 0xCD, 0x37, 0x95, 0x39, 0x25,
6507 0xA8, 0x73, 0x06, 0x1F, 0x99, 0x15, 0xBA, 0xA8, 0xFA, 0x97,
6508 0x8B, 0x44, 0x69, 0x01, 0xB2, 0xE5, 0xD1, 0x0B, 0xD6, 0x09,
6509 0x37, 0x3D, 0x2E, 0x06, 0x51, 0xEC, 0x62, 0x4B, 0x34, 0x50,
6510 0x80, 0xB6, 0xA4, 0xA6, 0x16, 0x3B, 0x2A, 0xE7, 0x97, 0x1D,
6511 0xA9, 0x8D, 0xE1, 0x11, 0xCB, 0x7C, 0xD4, 0xF0, 0x85, 0x61,
6512 0x80, 0xC9, 0x6C, 0x4C, 0x9F, 0x85, 0x6F, 0xA7, 0xA5, 0x23,
6513 0x5D, 0x7B, 0xB5, 0x47, 0xA2, 0xCA, 0xDC, 0x5D, 0x0B, 0x62,
6514 0xBA, 0x61, 0x0E, 0xD4, 0xE2, 0xD6, 0x96, 0xDF, 0xE7, 0x5C,
6515 0x7F, 0xED, 0x4B, 0x9A, 0x7F, 0xDB, 0x7A, 0x6F, 0x4F, 0x4C,
6516 0x88, 0x94, 0x26, 0x86, 0xA9, 0x58, 0x09, 0xB0, 0xB3, 0x49,
6517 0x40, 0xD2, 0xF4, 0x35, 0xDB, 0x90, 0x32, 0x5D, 0xCB, 0x9D,
6518 0xE5, 0x03, 0x8D, 0x97, 0x13, 0x8C, 0x2C, 0xEF, 0x16, 0x5B,
6519 0x47, 0x3E, 0xDD, 0x9D, 0x00, 0x45, 0x9D, 0x43, 0xB1, 0xC0,
6520 0x65, 0x36, 0x87, 0xE2, 0x72, 0x84, 0x70, 0xE4, 0x40, 0x2E,
6521 0xD3, 0x47, 0x19, 0xCD, 0x13, 0x57, 0x4D, 0x1F, 0xD6, 0x64,
6522 0x38, 0x5A, 0x14, 0xFA, 0xCE, 0xF0, 0x9E, 0x23, 0xF6, 0xA7,
6523 0x3E, 0x24, 0xBD, 0x03, 0xD4, 0x94, 0xFD, 0x9F, 0x91, 0x6F,
6524 0x04, 0x99, 0x57, 0xBA, 0x04, 0x6B, 0x7D, 0xFA, 0xB8, 0x69,
6525 0xC0, 0xCF, 0x95, 0x42, 0x29, 0xD7, 0x2A, 0x6D, 0x63, 0xC4,
6526 0x45, 0x14, 0x7B, 0xE9, 0x5E, 0x0B, 0x55, 0x54, 0x9C, 0x8D,
6527 0x7C, 0x65, 0x62, 0x33, 0xD2, 0x3B, 0xC6, 0xD1, 0xD3, 0xEB,
6528 0xBA, 0xA8, 0xE3, 0xEA, 0xBB, 0x73, 0xAF, 0x52, 0xFE, 0xB9,
6529 0x91, 0xD2, 0x34, 0xEA, 0xE9, 0x87, 0x62, 0x90, 0xA0, 0x7C,
6530 0x96, 0x73, 0x59, 0x0D, 0x7C, 0x25, 0x68, 0x34, 0xAF, 0x4B,
6531 0xCF, 0xE4, 0x78, 0xC0, 0xFF, 0x26, 0x6A, 0x42, 0xE0, 0xF4,
6532 0xEC, 0x1E, 0xA5, 0x05, 0xEE, 0xED, 0x4E, 0x68, 0xA4, 0x0B,
6533 0x3C, 0xF6, 0x7A, 0x41, 0x53, 0xE6, 0xCA, 0x1B, 0x1F, 0x8B,
6534 0xE4, 0xEA, 0xD2, 0x66, 0x40, 0xEF, 0x83, 0x74, 0xB3, 0x0C,
6535 0x6E, 0x66, 0x00, 0xF3, 0xE6, 0x94, 0xC3, 0x0B, 0x60, 0xFB,
6536 0x15, 0x7F, 0x39, 0x85, 0x60, 0x5F, 0xBF, 0xA8, 0x94, 0x45,
6537 0x86, 0x3F, 0xD4, 0x54, 0xC5, 0xA3, 0xE9, 0x51, 0x18, 0x51,
6538 0x40, 0x64, 0xFD, 0xEB, 0x9B, 0x11, 0x33, 0x8C, 0xDD, 0x9B,
6539 0xC8, 0xB2, 0xD7, 0x44, 0x2C, 0x56, 0xB0, 0x81, 0xEA, 0x0C,
6540 0x0B, 0x9F, 0xF7, 0x1D, 0x9C, 0x27, 0xD6, 0x76, 0x80, 0x01,
6541 0x68, 0xC2, 0xA8, 0x69, 0x80, 0x5E, 0xE8, 0x93, 0x32, 0xA0,
6542 0xB1, 0x43, 0x35, 0xE6, 0x73, 0x9E, 0x69, 0x60, 0xC8, 0x31,
6543 0x69, 0xE0, 0xAF, 0xFD, 0xD2, 0xE9, 0x25, 0x9E, 0x3D, 0xDA,
6544 0x66, 0xE6, 0xD7, 0x8E, 0xDB, 0x68, 0x04, 0xB0, 0xFE, 0x04,
6545 0xF8, 0x72, 0x01, 0x0B, 0xE1, 0x66, 0xC4, 0xA0, 0xE4, 0xF7,
6546 0xF3, 0x6E, 0x91, 0x60, 0xAD, 0x53, 0xE7, 0x9D, 0xBC, 0x6A,
6547 0xDF, 0x47, 0x8D, 0x25, 0x9F, 0xB3, 0x60, 0x6C, 0x87, 0x5C,
6548 0x60, 0x00, 0x98, 0xE3, 0x4A, 0x96, 0xA5, 0xAF, 0x1F, 0x96,
6549 0x0B, 0x96, 0x4F, 0xC6, 0x54, 0x1F, 0x48, 0x67, 0xC7, 0xA4,
6550 0x6E, 0xC0, 0x82, 0x8C, 0x43, 0x0D, 0x8D, 0x10, 0x84, 0x48,
6551 0xEA, 0x46, 0xF2, 0x15, 0x85, 0x70, 0x5A, 0x8F, 0x76, 0xD7,

NetBurner, Inc.
22.205 certs_test.h 1169

6552 0x37, 0x82, 0xE4, 0x07, 0x09, 0x4D, 0xB7, 0xCF, 0xA3, 0xAA,
6553 0xE8, 0xD7, 0x3C, 0x8B, 0xE4, 0x86, 0xD4, 0xA9, 0xC9, 0x30,
6554 0x9A, 0xCE, 0xE4, 0x7B, 0x0C, 0x17, 0xC6, 0x2E, 0x4E, 0x4A,
6555 0x7C, 0x4E, 0xB3, 0xAD, 0xE3, 0x93, 0x8A, 0x31, 0x11, 0x2D,
6556 0x43, 0xBE, 0x02, 0x8D, 0x5C, 0xEA, 0x7D, 0x9A, 0x08, 0xAB,
6557 0x3D, 0x70, 0x84, 0x4F, 0x8F, 0xB0, 0x77, 0x02, 0x99, 0x85,
6558 0x62, 0x93, 0x71, 0x4C, 0xCD, 0x7A, 0xD1, 0x75, 0xD1, 0xBB,
6559 0x2A, 0xC9, 0x54, 0xBF, 0xDA, 0xF1, 0x70, 0xE9, 0xEF, 0x8D,
6560 0x08, 0x66, 0xE9, 0xD6, 0xE3, 0x6F, 0x4B, 0x99, 0xEB, 0x44,
6561 0x51, 0x12, 0xEE, 0x21, 0x34, 0xE1, 0xD1, 0x3A, 0x4D, 0x17,
6562 0xEF, 0xE7, 0x7F, 0x48, 0xD7, 0x35, 0x45, 0x05, 0xF0, 0x0E,
6563 0xFF, 0x32, 0xB5, 0x20, 0xF5, 0x19, 0xCF, 0x5A, 0x0E, 0xD8,
6564 0x2C, 0x85, 0x42, 0xF2, 0x60, 0xD0, 0xA1, 0x49, 0xD6, 0xEE,
6565 0x14, 0x3B, 0x2F, 0xCD, 0x0B, 0x2D, 0x8F, 0x11, 0x68, 0xF2,
6566 0x97, 0x22, 0xFF, 0x88, 0x76, 0x48, 0xF8, 0x3A, 0x10, 0x0F,
6567 0x66, 0x26, 0x73, 0x60, 0x68, 0x91, 0xEE, 0x54, 0xE2, 0xC8,
6568 0x04, 0xFB, 0xCD, 0x3E, 0xEB, 0x07, 0x84, 0xA1, 0x7A, 0x93,
6569 0x1B, 0x4A, 0xD7, 0xB6, 0xB2, 0x0E, 0xE4, 0x79, 0x1C, 0xB0,
6570 0x77, 0x1D, 0x86, 0x1D, 0x99, 0x9A, 0x40, 0x6F, 0x3E, 0x30,
6571 0xCD, 0xA1, 0xC2, 0x74, 0x55, 0x56, 0x1E, 0xE2, 0x05, 0x04,
6572 0x10, 0xDB, 0x88, 0xF6, 0xE3, 0x2E, 0x58, 0xF3, 0x35, 0x6E,
6573 0x05, 0x6B, 0xA9, 0x4F, 0x42, 0x9E, 0x8D, 0xA8, 0x99, 0x7F,
6574 0x15, 0x63, 0x41, 0x27, 0x81, 0xE7, 0x73, 0xDE, 0x1F, 0x0B,
6575 0x9B, 0xFE, 0xDF, 0x5E, 0xC7, 0x06, 0x8E, 0x33, 0x20, 0x19,
6576 0xA3, 0xFB, 0x9B, 0xD9, 0xA0, 0xBE, 0x5F, 0x44, 0x45, 0x1A,
6577 0x9C, 0x11, 0xAA, 0x6A, 0x8F, 0xA0, 0x20, 0x02, 0xCC, 0xBC,
6578 0xC9, 0xD9, 0x09, 0x46, 0x00, 0xF3, 0x50, 0xDC, 0x21, 0xEF,
6579 0xBB, 0x35, 0x18, 0xD7, 0x2A, 0x3A, 0x0F, 0x0D, 0x7D, 0x5F,
6580 0x1B, 0x57, 0xB0, 0x34, 0xFB, 0x55, 0xBD, 0xE9, 0x72, 0xBD,
6581 0x46, 0xBF, 0x90, 0x0D, 0xB0, 0xEE, 0x7D, 0x57, 0xB6, 0x4D,
6582 0x82, 0xB0, 0xD8, 0x27, 0xCC, 0xFC, 0xEB, 0xE9, 0x3C, 0x7B,
6583 0x98, 0xF3, 0x95, 0x15, 0xA6, 0xBE, 0x64, 0x77, 0x7D, 0x50,
6584 0xC0, 0x68, 0x09, 0x7D, 0x8F, 0x18, 0xEE, 0xB6, 0x76, 0xFF,
6585 0x0E, 0x87, 0xE3, 0xAE, 0x59, 0xD2, 0x27, 0xBA, 0x0A, 0xC2,
6586 0x96, 0x96, 0x5C, 0x2B, 0x93, 0x30, 0x36, 0x36, 0x7F, 0x70,
6587 0x82, 0xB3, 0x5C, 0x2C, 0x42, 0xD5, 0xFE, 0xDB, 0xC5, 0x58,
6588 0xA0, 0x71, 0xAB, 0x17, 0x06, 0x10, 0x0F, 0x49, 0x19, 0x42,
6589 0x65, 0x29, 0x22, 0xC4, 0x69, 0x58, 0xA8, 0xE1, 0xA9, 0xB3,
6590 0x51, 0xBA, 0x9B, 0xAD, 0x03, 0xE8, 0xCB, 0x34, 0xFF, 0x24,
6591 0x47, 0x9A, 0x1E, 0x0F, 0xFC, 0x1F, 0xE7, 0xDE, 0x68, 0x33,
6592 0xA4, 0x54, 0xBE, 0xF0, 0x7D, 0x16, 0x3C, 0x27, 0x79, 0x1F,
6593 0x24, 0x24, 0xEF, 0x41, 0xB8, 0xA7, 0x25, 0xC3, 0xE8, 0x93,
6594 0xF5, 0x9F, 0xC3, 0x3B, 0x08, 0xDE, 0xF0, 0x54, 0xF5, 0xE7,
6595 0x79, 0x71, 0x1F, 0x89, 0x7A, 0xA9, 0xB0, 0x47, 0xCA, 0x53,
6596 0x3C, 0xD2, 0xA8, 0xB7, 0x5C, 0xF5, 0xDD, 0xD4, 0x07, 0x6E,
6597 0xA5, 0xAB, 0x66, 0x91, 0x5B, 0x44, 0x91, 0xA7, 0x1F, 0x05,
6598 0xB1, 0x3D, 0x79, 0xEC, 0x9D, 0x12, 0x14, 0xF7, 0xEC, 0x46,
6599 0xEA, 0x51, 0x2A, 0xC8, 0xBD, 0x3C, 0xCB, 0xAE, 0x1D, 0x07,
6600 0x6D, 0xE2, 0x85, 0xB0, 0xC4, 0xAB, 0x42, 0x52, 0xD4, 0x1C,
6601 0x89, 0x1D, 0xDE, 0x5A, 0x5A, 0x20, 0x21, 0x19, 0x8C, 0xF8,
6602 0xD2, 0xF1, 0x25, 0x88, 0x79, 0xAF, 0x8F, 0x8E, 0xF0, 0xC5,
6603 0x35, 0x05, 0x15, 0x88, 0x04, 0x5C, 0x2F, 0xB3, 0xD2, 0x07,
6604 0x2F, 0x1B, 0x5D, 0x68, 0x71, 0x91, 0x94, 0x8C, 0xCE, 0x11,
6605 0x30, 0xA6, 0x48, 0x21, 0x2E, 0xE8, 0x52, 0xBE, 0xD0, 0xB3,
6606 0x8E, 0x4C, 0x16, 0xEB, 0x04, 0x6C, 0x45, 0x92, 0x08, 0xD4,
6607 0x45, 0x97, 0x60, 0xC6, 0xC5, 0x07, 0x4D, 0x3D, 0xAA, 0x90,
6608 0xD7, 0xE8, 0xBF, 0xA1, 0x17, 0xDC, 0xBF, 0x5E, 0x18, 0x44,
6609 0xE5, 0x97, 0xBB, 0x33, 0x23, 0x87, 0x71, 0x05, 0x83, 0x17,
6610 0x00, 0x69, 0x9E, 0x8B, 0x59, 0x3A, 0x30, 0x1F, 0x8B, 0x11,
6611 0xBC, 0xB8, 0xF2, 0x1A, 0x3E, 0x5F, 0xDB, 0x02, 0xE8, 0x05,
6612 0x73, 0xF9, 0x58, 0xE9, 0x8E, 0xB8, 0x62, 0xF4, 0x63, 0x70,
6613 0x7E, 0x46, 0xED, 0x51, 0xAB, 0x92, 0x66, 0x81, 0x06, 0xAC,
6614 0xC9, 0x3F, 0xCC, 0xB1, 0xF9, 0x38, 0x7C, 0xCB, 0x75, 0x85,
6615 0x65, 0x1D, 0x2B, 0x09, 0xF0, 0xB8, 0x10, 0x4B, 0xA7, 0xF1,
6616 0x2D, 0x99, 0xFB, 0xC5, 0xEA, 0xEA, 0xCE, 0x25, 0x5A, 0xFA,
6617 0x97, 0xF1, 0x1E, 0x70, 0x23, 0xB9, 0xA6, 0x79, 0x98, 0xEC,
6618 0x0D, 0xCE, 0x96, 0x0C, 0xB0, 0xF5, 0x50, 0x21, 0xB9, 0xF7,
6619 0x88, 0xAB, 0x40, 0x7E, 0xE8, 0x4A, 0xA4, 0x2C, 0x02, 0xED,
6620 0x83, 0xAB, 0x68, 0xDA, 0x21, 0x4D, 0x1C, 0x2A, 0xEB, 0xF9,
6621 0xD5, 0x5F, 0xB1, 0xDC, 0xFA, 0x75, 0xA3, 0x7D, 0xC6, 0x84,
6622 0x80, 0x73, 0xE8, 0xCE, 0x64, 0x11, 0xDE, 0x1B, 0x75, 0x9F,
6623 0xDD, 0xFB, 0xFE, 0x82, 0xA2, 0xE0, 0x45, 0xA3, 0xD4, 0x2C,
6624 0x46, 0xD0, 0xC6, 0x45, 0x5F, 0x1B, 0xD6, 0x93, 0x20, 0xAE,
6625 0xA4, 0x62, 0xDE, 0xB4, 0x24, 0xAD, 0x73, 0xD9, 0x46, 0x8D,
6626 0x4B, 0x6D, 0xF9, 0x49, 0xA9, 0xB5, 0x43, 0xDA, 0x34, 0xDD,
6627 0x72, 0x68, 0xB4, 0x82, 0x1B, 0x54, 0xA9, 0xC6, 0x0E, 0xB4,
6628 0x25, 0x0C, 0xDC, 0x97, 0x5F, 0xAB, 0x20, 0xFB, 0x4D, 0x33,
6629 0x15, 0xD1, 0xC3, 0x15, 0x27, 0xC4, 0x3A, 0x06, 0xE3, 0x72,
6630 0xD4, 0xF8, 0xFD, 0xB3, 0xE8, 0x04, 0x59, 0xBC, 0xAB, 0xA3,
6631 0x43, 0xBE, 0x60, 0x34, 0x09, 0x53, 0x78, 0x64, 0x9C, 0x8C,
6632 0x72, 0xE4, 0x74, 0x62, 0x83, 0x2D, 0xB1, 0xA9, 0x67, 0xEC,
6633 0x80, 0x92, 0x43, 0x94, 0x2E, 0x4B, 0xCE, 0x40, 0x16, 0xA5,
6634 0xD4, 0x1C, 0xE9, 0x5B, 0xF6, 0x47, 0x70, 0x55, 0x7B, 0x16,
6635 0xF1, 0x96, 0x29, 0x4F, 0x77, 0x83, 0x39, 0x80, 0x46, 0xD0,
6636 0x67, 0x96, 0x32, 0x22, 0xBC, 0x8A, 0x9E, 0x3B, 0xC3, 0xC1,
6637 0xD6, 0x8D, 0x0B, 0x35, 0xE3, 0x61, 0x27, 0x54, 0xEA, 0x6C,
6638 0x9B, 0x75, 0x8C, 0x58, 0x2A, 0x90, 0x9E, 0x28, 0xBC, 0xD8,

NetBurner, Inc.
1170 File Documentation

6639 0xAE, 0xBD, 0xDD, 0xA0, 0x7A, 0xE4, 0x2A, 0x11, 0xFE, 0xAA,
6640 0x7C, 0x64, 0x53, 0x69, 0x7B, 0xC9, 0xBB, 0xBB, 0xF3, 0x0A,
6641 0xE9, 0xAD, 0x44, 0x14, 0xD0, 0x2D, 0x82, 0x20, 0x3C, 0x82,
6642 0xBB, 0x03, 0x54, 0x54, 0x97, 0xEF, 0x86, 0xD3, 0xC8, 0xEB,
6643 0x37, 0x7D, 0x3A, 0xF4, 0x2E, 0xDE, 0x5F, 0x80, 0xB1, 0xBE,
6644 0xCC, 0x27, 0xA8, 0xD5, 0x0C, 0xB6, 0x69, 0xEF, 0xAC, 0x6A,
6645 0x50, 0x19, 0x68, 0xCA, 0xB2, 0x9F, 0x8E, 0x1E, 0x2B, 0x64,
6646 0x94, 0xA2, 0x8A, 0x32, 0x82, 0x4B, 0x6B, 0x4A, 0xB8, 0xF3,
6647 0x7D, 0xF0, 0xAC, 0xF0, 0x33, 0xFC, 0x2A, 0x3A, 0x93, 0x2B,
6648 0xF0, 0xE7, 0xB2, 0x73, 0x75, 0xB8, 0x89, 0xD9, 0x25, 0xA5,
6649 0xD1, 0x8C, 0x8E, 0x57, 0x49, 0x86, 0x58, 0x36, 0x76, 0xAA,
6650 0xE7, 0x4C, 0x76, 0x08, 0x7F, 0xFC, 0x9E, 0xF2, 0xC5, 0xB5,
6651 0xF3, 0xFD, 0xF2, 0xB3, 0x3B, 0x76, 0x29, 0xDB, 0x9B, 0x3B,
6652 0xA1, 0x09, 0xA9, 0x38, 0x5E, 0xE8, 0xC4, 0x9F, 0x88, 0x53,
6653 0x2E, 0xFB, 0x52, 0xBB, 0x3B, 0x2B, 0xE1, 0xE1, 0x28, 0x26,
6654 0x88, 0x14, 0x09, 0xF1, 0xCC, 0x98, 0xD9, 0xA4, 0x0C, 0xA0,
6655 0x54, 0xD0, 0xB7, 0x3C, 0x8C, 0xE9, 0x4F, 0x64, 0xCB, 0xBE,
6656 0xA5, 0x06, 0xAE, 0x27, 0xF0, 0x37, 0xB2, 0x60, 0x27, 0x9A,
6657 0x93, 0x67, 0xB2, 0x39, 0x54, 0x95, 0xA8, 0x6E, 0x93, 0x6C,
6658 0x09, 0x6C, 0xFF, 0xA1, 0xC2, 0x99, 0x66, 0x0A, 0x01, 0x2A,
6659 0x8C, 0x2D, 0x9C, 0x23, 0x0B, 0x19, 0x4E, 0xA1, 0x3E, 0x43,
6660 0x42, 0x1A, 0x72, 0x11, 0xAC, 0x92, 0x56, 0x32, 0xD4, 0xFE,
6661 0x5A, 0x0E, 0xDF, 0xEB, 0x7B, 0x1F, 0x61, 0x9B, 0xDA, 0x3C,
6662 0x2E, 0xAE, 0xFF, 0x12, 0x11, 0x3E, 0xB2, 0xC3, 0xAE, 0xD1,
6663 0xD9, 0xB2, 0xE8, 0xD5, 0x9E, 0x85, 0xA4, 0xF1, 0x49, 0x06,
6664 0x16, 0x73, 0xCA, 0x65, 0x3A, 0x2D, 0x51, 0x38, 0xBA, 0x37,
6665 0xF3, 0xCF, 0xDC, 0xDF, 0x40, 0xF5, 0x5D, 0x39, 0x74, 0x60,
6666 0x15, 0xF5, 0xDC, 0x73, 0xE2, 0x48, 0xF2, 0x2A, 0x2C, 0x4F,
6667 0x26, 0xD2, 0x61, 0x5B, 0x31, 0xA0, 0xF4, 0xEA, 0x80, 0xAE,
6668 0xB2, 0x57, 0x81, 0x64, 0xD1, 0xFB, 0xE9, 0xA0, 0x3B, 0xB7,
6669 0xDE, 0x17, 0x42, 0x7B, 0xCD, 0xDE, 0xE4, 0xA3, 0x45, 0x5E,
6670 0x88, 0x29, 0x85, 0x26, 0xB7, 0xD6, 0xA4, 0xE9, 0x73, 0x9E,
6671 0x1D, 0x73, 0x92, 0xF4, 0xFF, 0x66, 0xA8, 0xB9, 0x1D, 0x25,
6672 0x1B, 0x12, 0xB2, 0x9E, 0x6E, 0xE1, 0xA8, 0xB5, 0x73, 0x64,
6673 0x0B, 0x8D, 0xDC, 0xE3, 0x2C, 0x60, 0x32, 0x82, 0x4E, 0x9C,
6674 0x47, 0x0B, 0x5E, 0x92, 0xF0, 0x21, 0x62, 0x50, 0x8E, 0x1A,
6675 0xE4, 0x2B, 0x4B, 0x6F, 0xB5, 0xDA, 0xAB, 0xAB, 0x4A, 0xBE,
6676 0xB6, 0x6F, 0x09, 0x3A, 0xF4, 0x67, 0x75, 0x07, 0xB1, 0xB1,
6677 0xAA, 0xAD, 0x16, 0x3F, 0x5B, 0xD1, 0xA3, 0x9F, 0xF5, 0x7F,
6678 0xA8, 0xEA, 0xC8, 0x8D, 0x5A, 0xA9, 0xF3, 0x7B, 0xE8, 0x83,
6679 0xDB, 0xB0, 0xA7, 0xFD, 0x2C, 0xA1, 0xD6, 0x39, 0xDE, 0x65,
6680 0x2C, 0xE3, 0x4F, 0xA5, 0x0E, 0x2D, 0x47, 0xA0, 0x32, 0x8A,
6681 0x1F, 0x55, 0x3B, 0x92, 0x3D, 0x4A, 0x84, 0x67, 0xE2, 0x5A,
6682 0x10, 0x80, 0x1B, 0xA2, 0xFE, 0x4B, 0x8F, 0x73, 0xB5, 0xA5,
6683 0x6B, 0xFA, 0x5B, 0x86, 0x95, 0xB8, 0x89, 0x9B, 0x8E, 0xBF,
6684 0x39, 0xAF, 0x4F, 0x2B, 0x1A, 0xC6, 0x4E, 0xAC, 0xD6, 0xDA,
6685 0x34, 0xDA, 0x6B, 0xD6, 0x1A, 0x49, 0x99, 0xD0, 0x87, 0x4F,
6686 0x1A, 0x51, 0xA0, 0x46, 0x89, 0x0E, 0x0B, 0x81, 0x4C, 0x63,
6687 0xE2, 0xCA, 0x7C, 0xED, 0x81, 0x53, 0x11, 0x11, 0x5F, 0x8D,
6688 0xFD, 0xDD, 0x08, 0xEE, 0x6B, 0x8E, 0xF0, 0x8B, 0x39, 0x59,
6689 0x24, 0x13, 0xA4, 0x23, 0xF2, 0xFE, 0xDC, 0x0C, 0xEE, 0xDF,
6690 0xD7, 0xAA, 0x9D, 0x4E, 0x54, 0x1A, 0x27, 0xA3, 0xE5, 0x20,
6691 0xDE, 0x55, 0x37, 0xE2, 0xBF, 0x8E, 0x2F, 0xB9, 0x9C, 0x98,
6692 0xFE, 0x8F, 0x8D, 0xBD, 0x09, 0x91, 0x2D, 0xBF, 0x1E, 0x0B,
6693 0x26, 0x90, 0xDE, 0xE2, 0xB1, 0x5E, 0x81, 0x0A, 0x07, 0x5F,
6694 0xF1, 0x54, 0xFC, 0x31, 0xB0, 0x94, 0x2A, 0x13, 0x93, 0xA3,
6695 0x00, 0xEA, 0x43, 0xBE, 0xD7, 0x26, 0x15, 0x8A, 0x15, 0xA3,
6696 0x46, 0x84, 0xD5, 0x6A, 0x24, 0x9D, 0x8D, 0x1A, 0x07, 0xB2,
6697 0x87, 0x99, 0x6F, 0xFD, 0xF6, 0x1D, 0xD7, 0x88, 0xF2, 0x94,
6698 0xAA, 0xD1, 0x73, 0x7F, 0x69, 0x2F, 0x0A, 0x2A, 0x66, 0xDC,
6699 0x56, 0x1D, 0xFA, 0xF6, 0xC3, 0x47, 0xDF, 0x7A, 0x77, 0x0E,
6700 0xF2, 0x22, 0xA8, 0xDD, 0xE5, 0x6D, 0x04, 0xDA, 0x06, 0x1C,
6701 0xDB, 0x15, 0x07, 0xF9, 0x04, 0xD4, 0x56, 0xFF, 0x3E, 0x63,
6702 0x98, 0x08, 0xEB, 0xF3, 0x63, 0xC1, 0x29, 0x8E, 0xA5, 0xC7,
6703 0x40, 0x39, 0xD1, 0xE6, 0xFA, 0xA9, 0xF5, 0x0F, 0x63, 0x6D,
6704 0x85, 0x35, 0xC9, 0x0C, 0x9A, 0xA3, 0x02, 0xC3, 0x4A, 0x70,
6705 0x11, 0x5C, 0x9B, 0x9A, 0x7F, 0x81, 0xE2, 0x44, 0x91, 0x4E,
6706 0x7A, 0x6A, 0x14, 0x15, 0x2C, 0xCB, 0xC9, 0x1C, 0x69, 0x91,
6707 0x8C, 0x41, 0xE0, 0xBB, 0x85, 0xC8, 0x6E, 0xCC, 0x4A, 0x75,
6708 0x3B, 0xBB, 0x33, 0x1B, 0x6A, 0x2B, 0x95, 0xF9, 0x5E, 0x03,
6709 0xF2, 0x25, 0xD5, 0xD9, 0xFB, 0x9D, 0x38, 0x14, 0x1A, 0x31,
6710 0xB9, 0xE7, 0xE6, 0x9B, 0x4B, 0x0D, 0xE9, 0x7C, 0x59, 0x12,
6711 0xD2, 0x6B, 0x98, 0x0C, 0x41, 0x07, 0xDB, 0xC1, 0xA9, 0x95,
6712 0x53, 0xAE, 0xAD, 0xBB, 0x92, 0x36, 0xC1, 0x93, 0xF6, 0xBB,
6713 0x43, 0xFD, 0x16, 0xAC, 0x63, 0x27, 0x27, 0xC5, 0xF0, 0xC6,
6714 0x4E, 0x56, 0xE6, 0x39, 0x75, 0xC8, 0xF5, 0xDE, 0x79, 0xCE,
6715 0x11, 0x0F, 0x6F, 0x45, 0x70, 0xAB, 0xB4, 0x45, 0x75, 0x14,
6716 0xD7, 0x91, 0xD5, 0x97, 0x3F, 0xC0, 0xB9, 0x19, 0x25, 0xE6,
6717 0x35, 0x72, 0xB9, 0xB5, 0x8A, 0xFD, 0x24, 0x73, 0x9F, 0x1B,
6718 0x73, 0xE7, 0x6E, 0xE0, 0x3E, 0x9F, 0x55, 0x55, 0x29, 0x5C,
6719 0x6F, 0xDB, 0x6B, 0x95, 0x0C, 0x60, 0xB7, 0x52, 0xC4, 0x7E,
6720 0x8F, 0xDD, 0x0E, 0x8F, 0x5D, 0x7B, 0xEE, 0x17, 0x3E, 0xA1,
6721 0x1D, 0x84, 0xA5, 0xD8, 0x16, 0x61, 0x75, 0x88, 0xDA, 0xF3,
6722 0x27, 0x45, 0x0B, 0xB8, 0xDA, 0x8E, 0x96, 0xFC, 0x27, 0xFC,
6723 0xAA, 0x35, 0x6B, 0xAD, 0x0B, 0x0F, 0x0E, 0x8B, 0x92, 0x99,
6724 0x2F, 0xBF, 0x6F, 0x53, 0xC4, 0x2C, 0x84, 0x23, 0x57, 0xED,
6725 0xA9, 0x32, 0xCE, 0x06, 0x16, 0x4B, 0xEE, 0xF6, 0x1E, 0xA2,

NetBurner, Inc.
22.205 certs_test.h 1171

6726 0x31, 0x39, 0x49, 0xCC, 0x65, 0xBC, 0x70, 0x6D, 0xBE, 0x69,
6727 0x0D, 0x24, 0x25, 0xBB, 0x63, 0x09, 0xCC, 0x11, 0x0B, 0x49,
6728 0x5F, 0xD5, 0xFB, 0x93, 0xF7, 0x48, 0x04, 0x09, 0xE0, 0x5D,
6729 0x4F, 0x7A, 0x20, 0x6C, 0x42, 0x29, 0x5C, 0x21, 0x83, 0x06,
6730 0x88, 0xB5, 0xEF, 0x4C, 0xAC, 0x00, 0x01, 0xC6, 0xA4, 0x48,
6731 0x24, 0xFC, 0x77, 0xFE, 0xEE, 0xBF, 0xF0, 0x4E, 0x0C, 0xC5,
6732 0x6B, 0x89, 0x57, 0xC7, 0xB9, 0xF5, 0x61, 0x27, 0x24, 0x09,
6733 0xDA, 0x45, 0x00, 0x0B, 0x10, 0xB8, 0x7D, 0xF3, 0xE9, 0x56,
6734 0x59, 0x62, 0x65, 0x8C, 0x5E, 0x03, 0xB4, 0xB1, 0x85, 0x20,
6735 0x60, 0x25, 0x1D, 0xA7, 0xF4, 0x28, 0xF6, 0xB0, 0x32, 0x7B,
6736 0xEB, 0x76, 0x85, 0x7B, 0xD4, 0xE2, 0x15, 0x1C, 0xCB, 0xF2,
6737 0x31, 0xBA, 0x00, 0xBB, 0xD0, 0x90, 0x16, 0xB6, 0x48, 0x1F,
6738 0x2F, 0x4F, 0xE4, 0x1C, 0x1D, 0xD7, 0x09, 0xB6, 0x54, 0x70,
6739 0x2D, 0x7F, 0x68, 0xB9, 0x87, 0xE7, 0xCB, 0xD4, 0xD5, 0xE6,
6740 0xB4, 0xFD, 0x0C, 0x68, 0x5C, 0x96, 0xF4, 0x06, 0x64, 0x3B,
6741 0x74, 0x6B, 0xD1, 0xAC, 0xB5, 0x41, 0xEE, 0xBD, 0x55, 0x07,
6742 0xBF, 0x29, 0x51, 0x2B, 0xC5, 0x4A, 0xCF, 0x2A, 0xF1, 0xEE,
6743 0x5A, 0x64, 0x2F, 0x0B, 0x80, 0x7E, 0xF4, 0x50, 0x14, 0x28,
6744 0xF4, 0x39, 0x04, 0xB5, 0xC7, 0xCF, 0x53, 0xEA, 0x6C, 0xBD,
6745 0x76, 0x6C, 0x67, 0x6E, 0x3E, 0x9F, 0xEF, 0x60, 0xD0, 0xF6,
6746 0x73, 0x90, 0xDD, 0x1E, 0xE9, 0x75, 0x8B, 0x34, 0x6A, 0xB2,
6747 0xCC, 0xD1, 0x0B, 0x51, 0x6E, 0x44, 0x55, 0x55, 0x22, 0xBB,
6748 0x3F, 0xD1, 0x9F, 0xF4, 0x1E, 0xB5, 0xD6, 0x89, 0x3C, 0xDB,
6749 0xB7, 0x07, 0x83, 0x5C, 0x63, 0x45, 0x78, 0x4B, 0xFA, 0x1E,
6750 0x7D, 0x3D, 0x44, 0x91, 0xD3, 0xDD, 0x57, 0x07, 0xD9, 0x0F,
6751 0x58, 0xC3, 0x20, 0x5E, 0xF0, 0x42, 0x05, 0x61, 0xE5, 0x03,
6752 0xB3, 0xB8, 0x1B, 0xBB, 0x05, 0xC2, 0x1B, 0x7A, 0x7E, 0x8B,
6753 0xC9, 0x06
6754 };
6755 static const int sizeof_bench_dilithium_aes_level3_key = sizeof(bench_dilithium_aes_level3_key);
6756
6757 /* certs/dilithium/bench_dilithium_aes_level5_key.der */
6758 static const unsigned char bench_dilithium_aes_level5_key[] =
6759 {
6760 0x30, 0x82, 0x1D, 0x3A, 0x02, 0x01, 0x00, 0x30, 0x0D, 0x06,
6761 0x0B, 0x2B, 0x06, 0x01, 0x04, 0x01, 0x02, 0x82, 0x0B, 0x0B,
6762 0x08, 0x07, 0x04, 0x82, 0x1D, 0x24, 0x04, 0x82, 0x1D, 0x20,
6763 0x90, 0xBC, 0x63, 0x0F, 0xD4, 0xC2, 0x6D, 0x49, 0x01, 0xCD,
6764 0x1F, 0x92, 0xEC, 0xEE, 0xDB, 0x3B, 0x19, 0x0C, 0xFA, 0x4D,
6765 0x6C, 0x57, 0x16, 0xE0, 0x6E, 0x48, 0xB5, 0x5D, 0xB3, 0xE5,
6766 0xEA, 0xE6, 0xCA, 0x23, 0xD3, 0xE6, 0xE9, 0xEA, 0x3B, 0x1B,
6767 0x0C, 0x80, 0xD9, 0xFD, 0x2E, 0x9C, 0xD9, 0x1C, 0x44, 0x56,
6768 0xDD, 0xCC, 0x7C, 0x9F, 0x98, 0x1C, 0xEC, 0x7A, 0x3D, 0xB4,
6769 0x66, 0xCE, 0x91, 0x9F, 0x1E, 0x34, 0x96, 0xFB, 0xC6, 0x1D,
6770 0x3D, 0x93, 0x4A, 0x05, 0x43, 0xF8, 0xD7, 0x95, 0x10, 0x21,
6771 0x6C, 0xD4, 0x6F, 0xA6, 0x7B, 0x69, 0x3A, 0x1B, 0x9F, 0x0C,
6772 0x26, 0x84, 0x34, 0x39, 0xE6, 0xB5, 0x19, 0x83, 0x10, 0x92,
6773 0x30, 0x85, 0x19, 0x38, 0x31, 0x81, 0xB2, 0x51, 0x09, 0xB1,
6774 0x11, 0x19, 0xA6, 0x30, 0x9B, 0x80, 0x2D, 0x63, 0x26, 0x29,
6775 0x18, 0x93, 0x65, 0x84, 0x48, 0x72, 0x8C, 0x38, 0x81, 0xA3,
6776 0x18, 0x04, 0x19, 0x84, 0x20, 0x49, 0x40, 0x68, 0xA2, 0x82,
6777 0x80, 0x08, 0x19, 0x84, 0x4C, 0xC6, 0x90, 0x89, 0xA4, 0x80,
6778 0xC8, 0xA2, 0x85, 0xD2, 0x40, 0x04, 0x50, 0xA6, 0x81, 0x50,
6779 0xB4, 0x00, 0x18, 0x46, 0x30, 0x24, 0xC5, 0x80, 0x00, 0x93,
6780 0x84, 0x54, 0x22, 0x89, 0x21, 0x00, 0x88, 0xC8, 0x06, 0x64,
6781 0x8B, 0x20, 0x69, 0x9A, 0xB8, 0x6D, 0x58, 0x30, 0x02, 0x53,
6782 0x28, 0x6A, 0x20, 0xC9, 0x0C, 0x03, 0xC5, 0x60, 0x20, 0xA5,
6783 0x24, 0x5A, 0xC4, 0x29, 0x44, 0x38, 0x89, 0xD2, 0xB6, 0x11,
6784 0x24, 0x44, 0x6E, 0x12, 0x23, 0x2C, 0x99, 0x40, 0x26, 0x94,
6785 0x36, 0x20, 0xA2, 0x94, 0x6D, 0x49, 0x06, 0x2A, 0x52, 0x28,
6786 0x90, 0x09, 0x24, 0x25, 0x91, 0x20, 0x92, 0x49, 0x84, 0x0D,
6787 0x24, 0x83, 0x84, 0x61, 0xA4, 0x6C, 0x59, 0x32, 0x81, 0x21,
6788 0x34, 0x46, 0x09, 0x07, 0x05, 0xC0, 0x84, 0x8C, 0x62, 0x16,
6789 0x4D, 0x11, 0x90, 0x68, 0x11, 0xC8, 0x04, 0x40, 0x24, 0x41,
6790 0xC4, 0x14, 0x08, 0xCA, 0x38, 0x8A, 0x12, 0xB0, 0x25, 0x04,
6791 0xB5, 0x05, 0x22, 0x00, 0x2A, 0x48, 0x12, 0x2C, 0x1A, 0x29,
6792 0x20, 0xC8, 0x46, 0x4C, 0x22, 0x31, 0x60, 0xA3, 0x22, 0x6E,
6793 0x43, 0x12, 0x4C, 0x9B, 0xA8, 0x10, 0xD0, 0x32, 0x29, 0xE1,
6794 0x34, 0x82, 0x13, 0xA5, 0x31, 0x08, 0x45, 0x71, 0x01, 0x21,
6795 0x68, 0x12, 0xC4, 0x21, 0x0C, 0x82, 0x51, 0x40, 0x26, 0x11,
6796 0xDA, 0xA6, 0x09, 0x52, 0x92, 0x44, 0xC9, 0xB4, 0x51, 0x00,
6797 0x28, 0x8E, 0x24, 0x26, 0x42, 0xCB, 0xC4, 0x81, 0x09, 0x48,
6798 0x65, 0x23, 0xB9, 0x85, 0x01, 0xB2, 0x71, 0xC2, 0xC0, 0x2D,
6799 0x42, 0x06, 0x0D, 0x14, 0x93, 0x8C, 0x8B, 0xC0, 0x48, 0x60,
6800 0x82, 0x50, 0x18, 0x39, 0x50, 0x64, 0x12, 0x08, 0x11, 0x15,
6801 0x45, 0x02, 0x04, 0x8A, 0x0A, 0x21, 0x0D, 0x22, 0x35, 0x04,
6802 0xD0, 0x02, 0x41, 0x40, 0x14, 0x26, 0xCA, 0x20, 0x49, 0xA1,
6803 0xB0, 0x21, 0x18, 0x22, 0x64, 0xE0, 0x38, 0x11, 0x20, 0x87,
6804 0x8D, 0x50, 0x20, 0x6D, 0x11, 0x27, 0x42, 0x5C, 0x04, 0x41,
6805 0x09, 0x97, 0x88, 0xDA, 0x06, 0x91, 0x8A, 0x94, 0x0D, 0x9A,
6806 0x36, 0x42, 0xDC, 0x94, 0x2C, 0xCA, 0x32, 0x44, 0x52, 0x00,
6807 0x26, 0x02, 0x33, 0x92, 0xDA, 0x40, 0x30, 0x4A, 0xB0, 0x64,
6808 0xCC, 0xB2, 0x91, 0x24, 0x19, 0x08, 0x0A, 0x17, 0x88, 0xD8,
6809 0xB6, 0x01, 0xE4, 0x82, 0x09, 0xE4, 0xB0, 0x49, 0x12, 0x01,
6810 0x84, 0x09, 0xA0, 0x0D, 0xC8, 0x86, 0x8D, 0x0C, 0xA6, 0x31,
6811 0x1C, 0x07, 0x68, 0x43, 0x18, 0x04, 0xD8, 0x88, 0x69, 0x02,
6812 0x44, 0x41, 0x19, 0x23, 0x48, 0xA1, 0x18, 0x4D, 0xE0, 0xA4,

NetBurner, Inc.
1172 File Documentation

6813 0x68, 0x63, 0x38, 0x2A, 0x88, 0x18, 0x25, 0xE3, 0x90, 0x6D,
6814 0xD1, 0xB8, 0x04, 0x09, 0x44, 0x50, 0x14, 0xB4, 0x70, 0x0B,
6815 0x47, 0x8C, 0x1C, 0xC8, 0x6C, 0x43, 0xC0, 0x6C, 0xD0, 0x14,
6816 0x02, 0x22, 0xC2, 0x70, 0x04, 0x38, 0x49, 0x14, 0x33, 0x2C,
6817 0xCB, 0x16, 0x71, 0x1C, 0x05, 0x2C, 0x0A, 0x33, 0x81, 0xC0,
6818 0x90, 0x89, 0xA1, 0x38, 0x11, 0x1B, 0x36, 0x09, 0x62, 0x08,
6819 0x62, 0x24, 0xC1, 0x44, 0xCB, 0xC6, 0x01, 0xD4, 0x06, 0x31,
6820 0x44, 0x36, 0x2C, 0x54, 0xA0, 0x89, 0x1A, 0x80, 0x51, 0x0B,
6821 0x34, 0x91, 0x0B, 0xB1, 0x45, 0xA4, 0x24, 0x92, 0xA1, 0xC0,
6822 0x01, 0x09, 0xB2, 0x89, 0x8B, 0x40, 0x48, 0x09, 0xB0, 0x2C,
6823 0x1A, 0x33, 0x48, 0xA4, 0x04, 0x06, 0xD8, 0x00, 0x08, 0xA2,
6824 0xA2, 0x61, 0x04, 0x04, 0x64, 0x9A, 0xB2, 0x11, 0x11, 0x21,
6825 0x4E, 0x63, 0xC2, 0x20, 0x22, 0x31, 0x8E, 0xA2, 0xB2, 0x69,
6826 0x10, 0x10, 0x88, 0x88, 0x42, 0x4E, 0x41, 0xA2, 0x0D, 0x99,
6827 0x32, 0x44, 0x8C, 0xA6, 0x4D, 0x00, 0x16, 0x69, 0x13, 0x90,
6828 0x8C, 0xD4, 0x16, 0x51, 0x08, 0x29, 0x70, 0x83, 0x88, 0x68,
6829 0x90, 0x44, 0x28, 0x84, 0x10, 0x05, 0x1C, 0xA8, 0x01, 0x11,
6830 0xA6, 0x0D, 0x90, 0x06, 0x30, 0x4C, 0x44, 0x31, 0x14, 0x03,
6831 0x00, 0x54, 0xB2, 0x08, 0x5B, 0x20, 0x01, 0x10, 0x40, 0x0E,
6832 0x14, 0x86, 0x85, 0x60, 0x24, 0x71, 0xC3, 0xC0, 0x85, 0xE0,
6833 0x42, 0x0D, 0xE0, 0x46, 0x80, 0x5A, 0xC6, 0x45, 0x59, 0x98,
6834 0x28, 0xA4, 0x30, 0x8A, 0xDB, 0x06, 0x88, 0x43, 0x16, 0x04,
6835 0x1A, 0xA1, 0x31, 0xA2, 0x08, 0x02, 0x5A, 0x22, 0x41, 0x4A,
6836 0x42, 0x89, 0xA2, 0x82, 0x09, 0x90, 0xC2, 0x09, 0x03, 0x31,
6837 0x8A, 0xC4, 0xC8, 0x44, 0x21, 0xC5, 0x6C, 0x01, 0xB9, 0x10,
6838 0x09, 0x41, 0x29, 0x64, 0x30, 0x30, 0x44, 0x02, 0x65, 0x82,
6839 0x24, 0x68, 0xC2, 0x28, 0x0C, 0x0B, 0x90, 0x45, 0x11, 0xC2,
6840 0x70, 0x53, 0x86, 0x44, 0x10, 0x91, 0x81, 0x10, 0x21, 0x2E,
6841 0x99, 0x44, 0x04, 0xE0, 0xB0, 0x88, 0x18, 0x28, 0x4E, 0x64,
6842 0x22, 0x4D, 0x0B, 0x30, 0x71, 0xC2, 0x96, 0x80, 0x80, 0x08,
6843 0x89, 0x03, 0x46, 0x2C, 0x53, 0x96, 0x28, 0x10, 0x24, 0x89,
6844 0x09, 0x03, 0x2E, 0xC2, 0x04, 0x0C, 0x4B, 0xB6, 0x41, 0x89,
6845 0x84, 0x31, 0x0C, 0x08, 0x2C, 0xA4, 0x36, 0x04, 0x08, 0x85,
6846 0x05, 0x04, 0xC8, 0x2C, 0x03, 0xB8, 0x29, 0x0A, 0xB0, 0x45,
6847 0x93, 0x80, 0x20, 0x94, 0xC6, 0x30, 0x8A, 0x22, 0x09, 0xA2,
6848 0xC6, 0x60, 0x4A, 0x08, 0x8A, 0xC3, 0x42, 0x4C, 0x4B, 0x38,
6849 0x40, 0x02, 0xC3, 0x68, 0x0A, 0x09, 0x4E, 0x18, 0xC8, 0x44,
6850 0x12, 0x14, 0x6D, 0x53, 0x44, 0x25, 0x09, 0x27, 0x12, 0x11,
6851 0xB4, 0x91, 0xD2, 0x30, 0x8C, 0x0C, 0x10, 0x8C, 0x99, 0x38,
6852 0x05, 0x1A, 0xC8, 0x41, 0xA2, 0x10, 0x31, 0x0A, 0x33, 0x6C,
6853 0x9C, 0x42, 0x60, 0xA0, 0x38, 0x6D, 0x5A, 0x90, 0x89, 0x91,
6854 0x08, 0x46, 0x52, 0x10, 0x6C, 0x23, 0x02, 0x48, 0x0C, 0x36,
6855 0x4A, 0x59, 0x92, 0x41, 0x24, 0xA4, 0x21, 0x1B, 0x13, 0x62,
6856 0x02, 0xB1, 0x80, 0xC0, 0x86, 0x84, 0xC2, 0x28, 0x00, 0x4A,
6857 0x48, 0x0A, 0x61, 0x34, 0x62, 0x5A, 0xA6, 0x45, 0x08, 0x47,
6858 0x08, 0x21, 0x00, 0x6C, 0x20, 0x24, 0x90, 0xA1, 0x34, 0x91,
6859 0x09, 0x15, 0x28, 0x0A, 0x42, 0x6E, 0x21, 0x29, 0x49, 0x0B,
6860 0x24, 0x84, 0x1C, 0x86, 0x69, 0x59, 0x16, 0x10, 0x04, 0x12,
6861 0x70, 0xCB, 0x90, 0x08, 0x18, 0x24, 0x64, 0x02, 0x13, 0x8D,
6862 0x23, 0x38, 0x61, 0x1B, 0x34, 0x61, 0x0C, 0x80, 0x68, 0xCC,
6863 0xB8, 0x11, 0xC8, 0x24, 0x92, 0xC0, 0x88, 0x81, 0xC9, 0x48,
6864 0x6E, 0x09, 0x32, 0x2D, 0xA1, 0x08, 0x81, 0x0B, 0x30, 0x02,
6865 0x19, 0xA8, 0x84, 0xD2, 0x84, 0x11, 0x50, 0x86, 0x09, 0x04,
6866 0xA0, 0x20, 0x81, 0xA2, 0x41, 0x93, 0x24, 0x49, 0x03, 0x07,
6867 0x41, 0xC8, 0xA8, 0x60, 0x0A, 0x11, 0x61, 0x64, 0x08, 0x81,
6868 0x1B, 0x36, 0x62, 0xD4, 0x00, 0x4E, 0x44, 0xC6, 0x10, 0xDB,
6869 0x20, 0x4A, 0xA0, 0xB4, 0x29, 0x84, 0x00, 0x6E, 0x20, 0x47,
6870 0x4E, 0x23, 0x45, 0x51, 0xE2, 0xB6, 0x45, 0x18, 0xB5, 0x09,
6871 0x51, 0xC6, 0x2D, 0x99, 0x92, 0x89, 0x0A, 0x84, 0x51, 0x94,
6872 0x32, 0x24, 0x42, 0x24, 0x29, 0xD3, 0x94, 0x01, 0xC2, 0x80,
6873 0x24, 0xA2, 0x92, 0x6D, 0x09, 0x46, 0x11, 0x83, 0x12, 0x0D,
6874 0x03, 0x39, 0x84, 0xA1, 0xA2, 0x04, 0xC0, 0x24, 0x0D, 0x48,
6875 0x98, 0x30, 0x88, 0x10, 0x20, 0x9B, 0xA6, 0x21, 0x82, 0x46,
6876 0x6D, 0x0A, 0x96, 0x01, 0xA0, 0x14, 0x46, 0xE4, 0x08, 0x42,
6877 0x08, 0x43, 0x8D, 0x0A, 0x12, 0x0D, 0x13, 0x37, 0x20, 0x22,
6878 0x49, 0x21, 0x9C, 0x10, 0x66, 0xC0, 0x20, 0x31, 0x11, 0xB3,
6879 0x81, 0x1C, 0x29, 0x09, 0x03, 0xB0, 0x08, 0x5C, 0x18, 0x82,
6880 0x5C, 0xC2, 0x90, 0xD9, 0x44, 0x8C, 0xE2, 0x18, 0x85, 0x9A,
6881 0x08, 0x29, 0x21, 0x25, 0x48, 0x90, 0x10, 0x8D, 0x19, 0x17,
6882 0x60, 0x24, 0x39, 0x28, 0x19, 0x81, 0x45, 0x49, 0x32, 0x2D,
6883 0xCC, 0xB6, 0x81, 0x03, 0x81, 0x25, 0x99, 0x08, 0x11, 0x0C,
6884 0xA2, 0x81, 0x41, 0x18, 0x29, 0x91, 0x38, 0x12, 0x09, 0xB6,
6885 0x71, 0x02, 0x26, 0x81, 0x82, 0x48, 0x85, 0x19, 0x44, 0x6C,
6886 0x02, 0xC0, 0x49, 0x18, 0xA4, 0x65, 0x1B, 0x14, 0x6E, 0xA1,
6887 0x42, 0x11, 0x12, 0x30, 0x25, 0x61, 0xA6, 0x4C, 0xDC, 0x10,
6888 0x04, 0x88, 0x04, 0x30, 0x93, 0xB8, 0x2D, 0x23, 0x26, 0x52,
6889 0x14, 0xB3, 0x00, 0xCA, 0x32, 0x44, 0x52, 0x14, 0x90, 0xE4,
6890 0x26, 0x85, 0x24, 0xB7, 0x70, 0xDB, 0x28, 0x72, 0xE4, 0x96,
6891 0x25, 0x99, 0x00, 0x65, 0x23, 0x29, 0x2C, 0xA1, 0x98, 0x08,
6892 0x62, 0x16, 0x32, 0x09, 0x29, 0x52, 0x24, 0x19, 0x2A, 0x4A,
6893 0x90, 0x89, 0x1C, 0x88, 0x65, 0x98, 0x16, 0x52, 0x0C, 0x95,
6894 0x11, 0x11, 0x32, 0x4D, 0xD2, 0x86, 0x31, 0x92, 0x10, 0x6D,
6895 0x82, 0xC0, 0x04, 0xE3, 0x14, 0x0A, 0x04, 0x24, 0x61, 0x0C,
6896 0x93, 0x44, 0xC1, 0xC4, 0x2D, 0x4C, 0x16, 0x0A, 0x1A, 0x44,
6897 0x0A, 0x5A, 0x42, 0x46, 0x10, 0xC8, 0x8C, 0x5B, 0xC4, 0x4D,
6898 0xE2, 0xB4, 0x71, 0x61, 0xA8, 0x10, 0xC2, 0x02, 0x4E, 0xC4,
6899 0x08, 0x4E, 0x52, 0x94, 0x70, 0x20, 0x19, 0x84, 0xA4, 0x18,

NetBurner, Inc.
22.205 certs_test.h 1173

6900 0x71, 0xC9, 0x10, 0x52, 0x9B, 0x40, 0x21, 0x4C, 0x80, 0x28,
6901 0x40, 0x44, 0x89, 0x20, 0x25, 0x11, 0x13, 0x91, 0x29, 0x1A,
6902 0x84, 0x10, 0x49, 0x14, 0x6E, 0x03, 0x27, 0x2D, 0x4C, 0x12,
6903 0x42, 0x04, 0x03, 0x04, 0x1C, 0x43, 0x72, 0x44, 0x16, 0x82,
6904 0x1B, 0x12, 0x46, 0x90, 0x94, 0x05, 0x93, 0xB8, 0x10, 0x64,
6905 0x00, 0x22, 0x83, 0x38, 0x69, 0x0B, 0x43, 0x52, 0x0C, 0xA9,
6906 0x6D, 0x19, 0xB3, 0x09, 0xD2, 0x32, 0x25, 0x9B, 0x46, 0x21,
6907 0x5B, 0xA8, 0x89, 0xE3, 0xC8, 0x65, 0x12, 0xA0, 0x28, 0x9A,
6908 0x18, 0x30, 0x54, 0xA8, 0x69, 0x88, 0x32, 0x10, 0x23, 0xB3,
6909 0x21, 0x22, 0x92, 0x48, 0x92, 0x38, 0x12, 0x9B, 0x24, 0x86,
6910 0xCB, 0x18, 0x02, 0x08, 0x25, 0x71, 0x9C, 0xC6, 0x69, 0x08,
6911 0x30, 0x11, 0x42, 0x36, 0x62, 0xCB, 0x30, 0x0C, 0x02, 0x12,
6912 0x90, 0xE1, 0x40, 0x8A, 0x90, 0x10, 0x42, 0x19, 0x83, 0x48,
6913 0xD4, 0x48, 0x32, 0xD9, 0x04, 0x46, 0x00, 0x05, 0x52, 0x1C,
6914 0x16, 0x92, 0x13, 0x23, 0x22, 0x08, 0xB6, 0x05, 0x1B, 0xC3,
6915 0x41, 0x18, 0x98, 0x50, 0xDC, 0x96, 0x00, 0xE4, 0x32, 0x2A,
6916 0x8B, 0x10, 0x25, 0x40, 0x14, 0x8A, 0xEC, 0x96, 0x58, 0x14,
6917 0xF8, 0xEE, 0xD7, 0x19, 0x19, 0x51, 0x76, 0xA9, 0xAD, 0xB7,
6918 0x18, 0x12, 0x37, 0x3C, 0xC2, 0xC8, 0x07, 0x57, 0x8B, 0xBE,
6919 0x1C, 0x27, 0x62, 0xE4, 0x68, 0xF6, 0x88, 0x23, 0xD2, 0x89,
6920 0xC0, 0x02, 0x09, 0xBE, 0x8D, 0x64, 0x93, 0x7B, 0xB3, 0x04,
6921 0xD4, 0x5C, 0x3C, 0xAE, 0xF1, 0xC5, 0x67, 0x34, 0x52, 0x34,
6922 0x1E, 0xEB, 0x72, 0x02, 0x09, 0x27, 0x5B, 0x39, 0xD0, 0x67,
6923 0xEE, 0x1E, 0x02, 0xC3, 0x7F, 0x98, 0x9A, 0xA8, 0x66, 0x7D,
6924 0x2B, 0x5B, 0xA7, 0x89, 0x74, 0xC7, 0xB6, 0x98, 0xC9, 0xFE,
6925 0x9B, 0x18, 0xCA, 0x8F, 0x21, 0xCB, 0x32, 0x01, 0x55, 0xD1,
6926 0x99, 0x53, 0x91, 0x31, 0x8E, 0x92, 0xFD, 0xD1, 0xCC, 0x25,
6927 0xDF, 0xCC, 0x68, 0x29, 0x2B, 0x91, 0x74, 0x18, 0x2F, 0x54,
6928 0xBC, 0x70, 0xD4, 0x06, 0xDA, 0xC2, 0x00, 0xA6, 0x6D, 0xE1,
6929 0x01, 0xDE, 0xD3, 0x55, 0x4A, 0x28, 0x21, 0x40, 0x72, 0x59,
6930 0x1A, 0x94, 0x10, 0xCD, 0xF4, 0xBB, 0x63, 0x2C, 0x01, 0xEA,
6931 0xCF, 0x42, 0x53, 0x54, 0x7C, 0xF4, 0x06, 0xE0, 0x89, 0x88,
6932 0xC4, 0x60, 0x9A, 0xDB, 0x72, 0x50, 0x81, 0x8C, 0x02, 0x57,
6933 0x7D, 0x14, 0x6E, 0x39, 0x64, 0x38, 0xF7, 0xB0, 0xB2, 0x4C,
6934 0x80, 0x70, 0x3A, 0x91, 0xDB, 0x31, 0xA5, 0x2A, 0x17, 0x02,
6935 0xC9, 0x2D, 0x41, 0x73, 0x22, 0x6C, 0x4F, 0xAA, 0xF3, 0x32,
6936 0x4B, 0xF3, 0x34, 0x2E, 0xB1, 0x0F, 0x86, 0x5F, 0xE1, 0x3D,
6937 0x2F, 0x42, 0x61, 0x6D, 0x75, 0x07, 0xB2, 0xDB, 0x4B, 0x0E,
6938 0x28, 0x41, 0x66, 0x15, 0xFE, 0xD9, 0x79, 0x7F, 0x2F, 0xEE,
6939 0xD2, 0xDC, 0xE5, 0x53, 0x32, 0x8E, 0x81, 0xA7, 0x06, 0x99,
6940 0xDC, 0x20, 0xEB, 0xCD, 0xD5, 0xDE, 0xCB, 0x39, 0x48, 0xA4,
6941 0xB6, 0x66, 0x47, 0xD5, 0xD5, 0x46, 0xE6, 0x5D, 0xEA, 0xFF,
6942 0xC1, 0x1E, 0xE7, 0xAB, 0x99, 0xAD, 0xE1, 0xD9, 0x47, 0x71,
6943 0x3A, 0x6D, 0xC6, 0x66, 0xCC, 0x7E, 0x5C, 0x9D, 0x25, 0xB0,
6944 0x2C, 0x3A, 0x72, 0x16, 0xE2, 0x67, 0x2F, 0xB2, 0xC5, 0x37,
6945 0x3C, 0xBF, 0xDF, 0xC7, 0xE9, 0x48, 0xB6, 0x2C, 0x3B, 0x2B,
6946 0x89, 0x76, 0xCB, 0x33, 0xCC, 0xCF, 0xF0, 0xE6, 0x32, 0x06,
6947 0xE7, 0x3C, 0x6A, 0xDF, 0x24, 0x50, 0x6E, 0xEA, 0xEF, 0x31,
6948 0xF7, 0x2C, 0xC3, 0xFA, 0x94, 0xBF, 0x4D, 0xF7, 0x1D, 0x03,
6949 0xEB, 0x70, 0x14, 0x0D, 0x25, 0x87, 0x95, 0x1D, 0x8C, 0x61,
6950 0x21, 0xC7, 0x05, 0x21, 0x2E, 0x2B, 0x6F, 0x9E, 0x87, 0x0D,
6951 0xF3, 0x0C, 0x62, 0x27, 0x65, 0x74, 0x6E, 0xEB, 0x1C, 0x07,
6952 0xDE, 0x62, 0x9B, 0xBA, 0x4F, 0xF0, 0x46, 0xD6, 0x6A, 0x18,
6953 0x03, 0x4B, 0x24, 0xEB, 0x07, 0x78, 0xD0, 0x81, 0x3D, 0x00,
6954 0xD6, 0xCB, 0x16, 0x60, 0x77, 0x91, 0xCC, 0xEE, 0xA5, 0x32,
6955 0x02, 0x7C, 0x36, 0xE4, 0x60, 0xDC, 0xED, 0xBC, 0x47, 0x48,
6956 0x59, 0xA5, 0x28, 0x02, 0x57, 0x75, 0xCE, 0xA0, 0x83, 0x45,
6957 0x9A, 0xBD, 0xB9, 0x48, 0xFB, 0x0F, 0x45, 0xD9, 0x95, 0xE8,
6958 0x2B, 0xFF, 0xAD, 0x32, 0xEF, 0x9D, 0x1D, 0x54, 0x4E, 0xCE,
6959 0xA1, 0x2D, 0x0A, 0x41, 0xCB, 0xD1, 0x08, 0xB9, 0x45, 0x17,
6960 0x97, 0xC1, 0x5C, 0x0D, 0x21, 0x5E, 0x27, 0xB8, 0x19, 0xB5,
6961 0x1E, 0x89, 0x80, 0xE3, 0xBA, 0x0B, 0x66, 0xCE, 0xEF, 0x5B,
6962 0x35, 0x38, 0xC2, 0xFB, 0x6E, 0xD9, 0x23, 0x18, 0xE1, 0x45,
6963 0x98, 0x64, 0x60, 0xF1, 0xD0, 0xE1, 0xAA, 0x50, 0xD3, 0xB1,
6964 0x8E, 0xEB, 0x08, 0x34, 0xC5, 0x99, 0x3F, 0xB4, 0x7F, 0x5A,
6965 0xE2, 0x80, 0xF6, 0x22, 0x06, 0x1F, 0xB7, 0x3D, 0x58, 0xE6,
6966 0xF6, 0x82, 0x3C, 0x15, 0x34, 0x2E, 0xC0, 0xE3, 0x80, 0x54,
6967 0xB3, 0x55, 0xE8, 0x37, 0xC5, 0x1D, 0x3A, 0x36, 0x26, 0x05,
6968 0x24, 0xFB, 0x65, 0xDE, 0x95, 0x63, 0xF0, 0xC3, 0xFA, 0x43,
6969 0x1D, 0xCE, 0x7B, 0x21, 0x0E, 0x52, 0x6F, 0xA7, 0x27, 0xBD,
6970 0x3E, 0x7A, 0xE7, 0x59, 0xD0, 0xC3, 0xFB, 0x4C, 0x56, 0xCB,
6971 0x2A, 0x20, 0x7F, 0xCC, 0x94, 0xFE, 0xC0, 0x58, 0xD0, 0xFC,
6972 0x99, 0xB9, 0x97, 0x1A, 0x37, 0xF0, 0xB1, 0x83, 0xF3, 0x52,
6973 0x1E, 0x50, 0x2C, 0x74, 0x67, 0xFF, 0x62, 0x83, 0xB0, 0x79,
6974 0xE4, 0xF3, 0x92, 0x45, 0xFA, 0x94, 0x73, 0xC4, 0x24, 0xD8,
6975 0xDE, 0x88, 0x8C, 0x85, 0xE2, 0xA7, 0x84, 0xD9, 0xB4, 0x58,
6976 0x02, 0xFF, 0x64, 0xDE, 0x2A, 0x9D, 0x41, 0xEB, 0xE7, 0xEE,
6977 0x2B, 0x0A, 0x4D, 0x8E, 0xDC, 0x39, 0x56, 0xE2, 0x00, 0xF0,
6978 0x9D, 0xE1, 0x4F, 0x33, 0xD1, 0x6C, 0xF9, 0xF5, 0x89, 0x45,
6979 0x78, 0xA4, 0x15, 0x86, 0xFD, 0x70, 0x7A, 0xEC, 0xA5, 0xDB,
6980 0x6B, 0x7A, 0x28, 0x2D, 0x81, 0x63, 0xD2, 0x04, 0xF6, 0xC6,
6981 0x95, 0x14, 0xD0, 0x6B, 0x22, 0x7C, 0x87, 0x63, 0x13, 0x93,
6982 0x43, 0x04, 0xB7, 0x85, 0x4C, 0x9F, 0xF3, 0xE1, 0x96, 0x23,
6983 0x0E, 0xC9, 0x9E, 0x2C, 0x86, 0xF0, 0x9A, 0xC1, 0xF9, 0x65,
6984 0x69, 0x40, 0x6D, 0x6E, 0x7C, 0xA1, 0x68, 0x72, 0x44, 0xEF,
6985 0x46, 0x7F, 0xFB, 0x18, 0x40, 0x17, 0xFC, 0x0B, 0x30, 0xEF,
6986 0x13, 0xFF, 0xAE, 0x92, 0x97, 0x52, 0xEB, 0x9F, 0xEE, 0x88,

NetBurner, Inc.
1174 File Documentation

6987 0x51, 0xDC, 0x8C, 0x93, 0xAD, 0xB8, 0x5E, 0x8A, 0xF8, 0x4A,
6988 0x57, 0x2C, 0xAD, 0x23, 0xA4, 0x06, 0x26, 0x80, 0x2F, 0xF7,
6989 0x4D, 0x7C, 0xE0, 0xF2, 0xE7, 0x0E, 0x60, 0xBE, 0x96, 0xE9,
6990 0x89, 0xCF, 0x73, 0x62, 0x40, 0xB5, 0x12, 0x8C, 0x5D, 0x91,
6991 0x29, 0x7E, 0x30, 0x91, 0x7E, 0xA5, 0x91, 0xF5, 0x5B, 0xA0,
6992 0x94, 0x96, 0x0C, 0x6A, 0x2A, 0x01, 0x87, 0x44, 0x05, 0xE4,
6993 0xFB, 0x81, 0x19, 0x3A, 0x96, 0x8B, 0xE8, 0x80, 0xF3, 0xA4,
6994 0x45, 0xD7, 0xF9, 0x29, 0x3F, 0xBB, 0x9F, 0x34, 0x35, 0x64,
6995 0xA9, 0x9A, 0xD4, 0x8D, 0xFE, 0xF8, 0xC1, 0x13, 0xF7, 0xDE,
6996 0x98, 0x9B, 0x31, 0xB4, 0x8F, 0x57, 0xBB, 0x93, 0x1B, 0xC2,
6997 0x64, 0x33, 0x8D, 0x97, 0x8C, 0x57, 0xB3, 0x23, 0x70, 0x72,
6998 0x14, 0xC2, 0x45, 0x7F, 0xF7, 0x16, 0xB2, 0xD5, 0x7D, 0xA2,
6999 0xB7, 0xAD, 0xC9, 0x86, 0x92, 0xD7, 0xF9, 0x2E, 0x20, 0x35,
7000 0x64, 0xC7, 0x74, 0x64, 0xFF, 0xC2, 0x85, 0x84, 0xBC, 0xBF,
7001 0xB0, 0x96, 0xC2, 0x37, 0x66, 0x56, 0x21, 0x8E, 0xDC, 0x0F,
7002 0x98, 0xEC, 0x9F, 0x78, 0xB2, 0x71, 0xA5, 0x88, 0xEE, 0xFD,
7003 0x03, 0xA8, 0xBA, 0xF6, 0x39, 0x77, 0xA0, 0x69, 0x99, 0x34,
7004 0x9B, 0x32, 0x3C, 0x69, 0x88, 0xBF, 0xB5, 0xB5, 0x50, 0x4D,
7005 0xB2, 0xA1, 0xE6, 0xDD, 0x1E, 0xA4, 0xA8, 0xF1, 0xA6, 0x9B,
7006 0xAF, 0x6A, 0xAE, 0x72, 0x92, 0x73, 0x33, 0x39, 0xDD, 0xC6,
7007 0xCE, 0xA0, 0x72, 0xFA, 0x66, 0x75, 0x3D, 0x9B, 0xA0, 0x04,
7008 0x88, 0x37, 0x2A, 0x88, 0x36, 0xE5, 0x43, 0x96, 0x68, 0x41,
7009 0x6D, 0x3B, 0x0E, 0xB8, 0xE9, 0x51, 0x92, 0x28, 0x72, 0x7D,
7010 0xC4, 0x27, 0x95, 0x7F, 0xBF, 0x66, 0x7B, 0x47, 0x77, 0xB7,
7011 0xA4, 0x75, 0x02, 0x43, 0x0B, 0x34, 0x2B, 0x2D, 0x6E, 0xD5,
7012 0xCD, 0x1C, 0x78, 0x56, 0x0B, 0x15, 0x4E, 0x80, 0xF2, 0x4D,
7013 0xB2, 0x1F, 0xAC, 0x82, 0x3B, 0xE7, 0x09, 0xC8, 0x41, 0x22,
7014 0xDD, 0xEA, 0xB1, 0xA8, 0x6B, 0xE8, 0x21, 0x12, 0x09, 0x19,
7015 0x19, 0xA2, 0x04, 0xDB, 0xFA, 0x59, 0x87, 0x85, 0x10, 0x44,
7016 0x1B, 0xE6, 0xA8, 0xD9, 0x33, 0x27, 0xF7, 0x05, 0x0D, 0x2D,
7017 0x98, 0xE2, 0x2A, 0x96, 0xD6, 0xEB, 0x32, 0x9D, 0x75, 0x8A,
7018 0xC5, 0x78, 0x30, 0x49, 0x19, 0x94, 0x7C, 0x33, 0xC4, 0xEF,
7019 0xA9, 0xA3, 0xD1, 0xB4, 0xF4, 0xB7, 0x6D, 0x13, 0x1E, 0x7D,
7020 0xE3, 0x60, 0x7C, 0x9F, 0x10, 0x93, 0x8C, 0xE4, 0x52, 0x07,
7021 0x58, 0x03, 0x57, 0xA1, 0x6A, 0x94, 0x66, 0xD3, 0xEC, 0xF0,
7022 0x14, 0x96, 0xBE, 0x2F, 0xA5, 0xB1, 0xA9, 0xEE, 0xC8, 0x25,
7023 0x39, 0xA5, 0xA0, 0x82, 0xFC, 0x40, 0xA5, 0x7D, 0x87, 0x48,
7024 0xD1, 0x1C, 0x88, 0xA5, 0x34, 0x29, 0xC9, 0x73, 0xC6, 0x5A,
7025 0xDC, 0x89, 0xDF, 0xCB, 0x0F, 0x67, 0xA8, 0x72, 0xB4, 0xF2,
7026 0x99, 0xDE, 0x9E, 0xBE, 0x1B, 0x76, 0xAB, 0x23, 0x9C, 0x5E,
7027 0xE3, 0xEC, 0xD9, 0x34, 0x70, 0x63, 0x32, 0x03, 0x74, 0xCB,
7028 0x1C, 0x76, 0x0D, 0x5B, 0xEB, 0xDD, 0x7E, 0xF5, 0x78, 0x9F,
7029 0xE6, 0xC8, 0x9F, 0x63, 0x47, 0x05, 0xAD, 0xD0, 0x21, 0xA8,
7030 0x44, 0xAA, 0x70, 0x93, 0xD3, 0xCE, 0x21, 0x79, 0xE9, 0x5B,
7031 0x2F, 0x07, 0x32, 0xE5, 0x42, 0xF9, 0xE8, 0x61, 0x33, 0x39,
7032 0xFA, 0x13, 0x03, 0x0C, 0x44, 0x80, 0x1D, 0x70, 0x70, 0xFE,
7033 0xF8, 0x3A, 0x46, 0x18, 0x15, 0x68, 0x01, 0xA7, 0x90, 0xDB,
7034 0x8E, 0xDF, 0xB9, 0x1B, 0x06, 0xE0, 0xD4, 0x2D, 0x68, 0x9B,
7035 0x72, 0xEA, 0xA9, 0xEA, 0x74, 0x67, 0x18, 0x62, 0x8E, 0x2D,
7036 0x21, 0x0D, 0x6F, 0xED, 0xA2, 0x64, 0x0C, 0x4F, 0x9D, 0xA3,
7037 0xD4, 0x3F, 0x28, 0xF5, 0xDA, 0x41, 0x80, 0xB0, 0x71, 0x5C,
7038 0xDE, 0xF3, 0xA4, 0xC1, 0x55, 0x46, 0x57, 0x9E, 0x6B, 0xA3,
7039 0xD1, 0x40, 0xED, 0x29, 0x37, 0x00, 0xB5, 0xF2, 0x88, 0x0A,
7040 0x85, 0xDE, 0x2B, 0x64, 0xBC, 0x07, 0x21, 0x43, 0xDF, 0x36,
7041 0xAA, 0xFD, 0x7B, 0x65, 0x2D, 0x1A, 0xA5, 0xB7, 0x06, 0xEE,
7042 0x18, 0xC6, 0x26, 0xB9, 0x47, 0x24, 0x21, 0xB1, 0x67, 0x6F,
7043 0xC8, 0x51, 0xA6, 0x6D, 0x8F, 0xF4, 0x4B, 0xCA, 0x26, 0x9D,
7044 0xA7, 0xED, 0xAF, 0x0B, 0x8A, 0x02, 0x1F, 0xDA, 0x93, 0x12,
7045 0xFE, 0x25, 0x02, 0xFE, 0x23, 0x06, 0x4F, 0x22, 0x2D, 0x61,
7046 0x52, 0xD6, 0xFC, 0x1E, 0x36, 0x50, 0x43, 0x30, 0x45, 0x31,
7047 0x38, 0x7D, 0xCF, 0xA4, 0xBF, 0xB2, 0xA7, 0xCA, 0x5D, 0x80,
7048 0xBB, 0xD3, 0xD0, 0x47, 0x14, 0xC3, 0x87, 0xA8, 0x7D, 0x0F,
7049 0x0D, 0x16, 0xCD, 0x4D, 0x54, 0xB5, 0x1F, 0x04, 0x2D, 0xC1,
7050 0x5E, 0x20, 0x5C, 0x8F, 0x52, 0x3F, 0x9A, 0x17, 0xE1, 0x9E,
7051 0x5E, 0xBB, 0x64, 0x5B, 0x2C, 0x80, 0x7D, 0x80, 0x3A, 0xE1,
7052 0x0D, 0xE1, 0x83, 0xEB, 0x70, 0xF2, 0xE0, 0x12, 0x94, 0x48,
7053 0xDF, 0x44, 0xFF, 0x5B, 0x1B, 0x27, 0xEE, 0x94, 0x01, 0x38,
7054 0xE2, 0x91, 0x8A, 0x5D, 0x1C, 0xEA, 0xC9, 0x5A, 0x42, 0xF8,
7055 0x62, 0x41, 0x8E, 0xCB, 0x86, 0x4D, 0x81, 0x10, 0xCD, 0x4B,
7056 0x0F, 0x2E, 0xBE, 0x80, 0x1B, 0xA6, 0x17, 0xB6, 0x13, 0xE6,
7057 0x85, 0xA6, 0x3D, 0x95, 0xE2, 0xFC, 0x69, 0xD8, 0x90, 0xFA,
7058 0x8B, 0x51, 0xE5, 0x56, 0xCA, 0x7A, 0xA4, 0x92, 0x83, 0x43,
7059 0xA1, 0x3D, 0xA4, 0xC5, 0xD6, 0x56, 0xAC, 0x6A, 0xEE, 0x37,
7060 0x73, 0x63, 0x71, 0xF1, 0x76, 0xBD, 0x70, 0x20, 0x0C, 0xE4,
7061 0xD7, 0xC9, 0x44, 0x47, 0x7E, 0xA6, 0x8B, 0xD3, 0x7F, 0x64,
7062 0x9F, 0xF0, 0x7F, 0x25, 0xAF, 0xF3, 0x0C, 0x9B, 0x03, 0x05,
7063 0x91, 0x9A, 0xCE, 0x7E, 0xA7, 0x26, 0x0F, 0x52, 0xA8, 0xDA,
7064 0xBE, 0x2D, 0x80, 0x31, 0xE7, 0x6D, 0x3C, 0xAE, 0xEF, 0xC6,
7065 0x64, 0x44, 0x84, 0x6B, 0xF1, 0xE0, 0x4B, 0x75, 0xF2, 0x76,
7066 0x6F, 0x58, 0x03, 0x45, 0xAC, 0x47, 0xBD, 0x66, 0xA3, 0x31,
7067 0x29, 0x87, 0xF7, 0xD2, 0x88, 0x63, 0xA3, 0x2B, 0x16, 0x1A,
7068 0xC2, 0x71, 0xEE, 0x9A, 0x09, 0x40, 0x3E, 0xC9, 0x5F, 0x49,
7069 0xFE, 0x18, 0xF0, 0x4E, 0x2C, 0x64, 0xEB, 0x11, 0xFB, 0x28,
7070 0xA1, 0xAD, 0xCE, 0x36, 0x6A, 0xC7, 0x38, 0xDD, 0x48, 0x34,
7071 0xC0, 0x69, 0x49, 0x25, 0x12, 0xDF, 0x6C, 0x46, 0x97, 0xF0,
7072 0xB5, 0x55, 0x97, 0x36, 0x66, 0x40, 0x4C, 0x4D, 0x36, 0xC4,
7073 0xD5, 0xFB, 0x3A, 0x22, 0x35, 0xCB, 0xDC, 0xA4, 0x50, 0xF6,

NetBurner, Inc.
22.205 certs_test.h 1175

7074 0xBD, 0x40, 0x20, 0xB8, 0x24, 0xA3, 0xBA, 0x42, 0x27, 0x29,
7075 0x16, 0xB8, 0x41, 0xAD, 0xE0, 0x14, 0x01, 0x9A, 0x1C, 0x44,
7076 0xEE, 0x1C, 0xC1, 0x59, 0xEE, 0x0D, 0x13, 0xC4, 0x27, 0x4D,
7077 0x18, 0x7E, 0x28, 0x03, 0xAB, 0xF9, 0xEC, 0xFC, 0x9B, 0x00,
7078 0xAC, 0xFF, 0xA6, 0x0B, 0xB1, 0x15, 0x4B, 0xC8, 0x89, 0xF9,
7079 0x56, 0xA5, 0xB2, 0x8D, 0x24, 0x93, 0xB8, 0xA0, 0x51, 0xE2,
7080 0xF9, 0xE7, 0xEF, 0xBD, 0x67, 0x06, 0x15, 0x85, 0xB4, 0xB3,
7081 0xD3, 0x0A, 0x1F, 0xBA, 0xCD, 0x53, 0xB8, 0xB8, 0xD0, 0xE1,
7082 0x00, 0x2E, 0x3C, 0xC0, 0xD7, 0xFA, 0xB2, 0xAB, 0x40, 0xA2,
7083 0xFE, 0x63, 0x92, 0x5F, 0x97, 0xBF, 0x6F, 0xD6, 0xEA, 0x18,
7084 0x69, 0xE4, 0x2D, 0xE0, 0x50, 0x34, 0x74, 0x00, 0xE8, 0xB5,
7085 0xD1, 0xBC, 0x67, 0x0E, 0xAA, 0xCC, 0x0C, 0x6A, 0xCF, 0x02,
7086 0x4D, 0x86, 0x7D, 0x76, 0xE8, 0xD6, 0x60, 0xF0, 0xD3, 0x4F,
7087 0x37, 0x85, 0xAF, 0x3B, 0x68, 0xEB, 0xE6, 0x0F, 0x47, 0xA3,
7088 0xEA, 0xAE, 0xDE, 0xFA, 0xF8, 0x88, 0xFF, 0x90, 0xA8, 0x5C,
7089 0x33, 0x6F, 0x69, 0x90, 0x44, 0x84, 0x13, 0x1B, 0xE9, 0x69,
7090 0x5E, 0x37, 0x32, 0xFD, 0xD0, 0x13, 0xD8, 0xEA, 0x91, 0x42,
7091 0x24, 0x7E, 0xF1, 0x5A, 0xFD, 0xB7, 0xEB, 0x45, 0xBB, 0x1C,
7092 0xAA, 0xAA, 0xD1, 0x0B, 0xE0, 0xDB, 0x6D, 0xFF, 0xE5, 0xC0,
7093 0xF9, 0x63, 0x12, 0x8B, 0x1B, 0x66, 0x3B, 0x5E, 0x73, 0xC5,
7094 0x90, 0x67, 0xC8, 0xAE, 0x13, 0xAE, 0xBE, 0xBE, 0x37, 0x6F,
7095 0x12, 0xBE, 0x0F, 0x3E, 0x1B, 0xB7, 0x69, 0xD0, 0x29, 0x20,
7096 0xFD, 0x3D, 0x6D, 0x2F, 0x4D, 0xCF, 0xB9, 0x8F, 0x30, 0x4C,
7097 0x4F, 0x7E, 0x72, 0x83, 0x59, 0xB8, 0xD3, 0xF4, 0x01, 0x78,
7098 0x3E, 0x1B, 0xF7, 0xF9, 0x41, 0xCC, 0xAD, 0xC0, 0x5C, 0x9B,
7099 0x9A, 0xDE, 0xDD, 0xDF, 0x36, 0x07, 0xA0, 0x77, 0x16, 0x3F,
7100 0x6F, 0xC9, 0x44, 0x21, 0xAE, 0xA0, 0xD7, 0x84, 0x97, 0x26,
7101 0xCB, 0x7F, 0x84, 0xF1, 0x01, 0x18, 0xC0, 0x7C, 0xA1, 0x54,
7102 0x34, 0x91, 0xBE, 0xA7, 0x52, 0xC9, 0x8E, 0x23, 0xCE, 0x4D,
7103 0xE2, 0xF1, 0x72, 0xDD, 0x95, 0x43, 0xD4, 0x66, 0xBF, 0x1A,
7104 0xBF, 0x44, 0x68, 0xD0, 0xFC, 0xAE, 0xD9, 0x16, 0x12, 0x51,
7105 0x34, 0x86, 0x85, 0xB8, 0x0D, 0xF9, 0x68, 0x1C, 0x75, 0x3A,
7106 0x9B, 0x12, 0x27, 0xF8, 0x66, 0xF2, 0x1C, 0x89, 0xA8, 0xC0,
7107 0xC7, 0x91, 0x16, 0xD3, 0xDD, 0x52, 0xFB, 0xF8, 0x73, 0xA4,
7108 0xDE, 0x0F, 0xB1, 0x1F, 0x8E, 0xF8, 0x09, 0x28, 0x59, 0xD1,
7109 0x11, 0xD2, 0x22, 0xA1, 0x1E, 0x83, 0x82, 0x7A, 0xCA, 0xBE,
7110 0x56, 0xF2, 0x77, 0x4A, 0xFE, 0x2C, 0xD6, 0x37, 0x9E, 0x94,
7111 0x48, 0xF0, 0x19, 0x82, 0x88, 0x96, 0x7C, 0xDB, 0x9B, 0x42,
7112 0xC5, 0xD9, 0xC5, 0xBC, 0x80, 0x09, 0x49, 0xAA, 0xA4, 0x1F,
7113 0xB1, 0x1C, 0x52, 0xEE, 0x20, 0x58, 0xB3, 0x1F, 0x48, 0xF1,
7114 0xBD, 0x8F, 0x52, 0xCE, 0x65, 0x2F, 0xC2, 0x1C, 0x64, 0x39,
7115 0xE9, 0xDB, 0xF2, 0x4C, 0xEA, 0xED, 0x6C, 0x67, 0x6D, 0x3C,
7116 0x94, 0x79, 0x00, 0xA7, 0x05, 0x8F, 0x66, 0x0F, 0xE4, 0x5D,
7117 0xEB, 0x23, 0xFF, 0xCC, 0xFE, 0x98, 0x8B, 0xA4, 0x4F, 0x2A,
7118 0x2D, 0xC2, 0x8F, 0xB6, 0x2B, 0xAB, 0x06, 0xC0, 0x5B, 0xD5,
7119 0x24, 0x1F, 0x20, 0xE1, 0xCC, 0x12, 0x86, 0xD8, 0x94, 0xFC,
7120 0x2D, 0xDF, 0x42, 0xF8, 0x70, 0x53, 0xF2, 0xD5, 0x8F, 0x66,
7121 0xD3, 0x8B, 0x2C, 0xA7, 0x85, 0xAA, 0x74, 0x44, 0x14, 0x32,
7122 0x87, 0x9A, 0x8E, 0x92, 0x05, 0x31, 0x2F, 0xE0, 0x49, 0xFC,
7123 0xBC, 0x04, 0x1C, 0x57, 0x25, 0x8D, 0x56, 0x54, 0x0D, 0xA7,
7124 0x6D, 0xAD, 0x1E, 0x5A, 0x68, 0x48, 0x9D, 0xAD, 0xE0, 0x52,
7125 0xF5, 0xC0, 0x76, 0x9C, 0x5A, 0xAC, 0x17, 0xD6, 0x37, 0x16,
7126 0x89, 0xE6, 0x97, 0x75, 0x0E, 0x88, 0x3C, 0x53, 0xFC, 0x73,
7127 0x16, 0x14, 0xCA, 0x62, 0x07, 0x84, 0x95, 0xA6, 0x21, 0x20,
7128 0xDA, 0xAA, 0xC2, 0x26, 0x72, 0xEA, 0x6B, 0x5E, 0xE1, 0x17,
7129 0x01, 0xB6, 0x46, 0xA6, 0x55, 0x36, 0xFB, 0x25, 0xFD, 0xF0,
7130 0x37, 0xC6, 0xC6, 0x30, 0x29, 0xC7, 0x19, 0xEA, 0x32, 0xE1,
7131 0xFB, 0x92, 0x31, 0x87, 0x6D, 0xC7, 0x94, 0xC6, 0xB2, 0x89,
7132 0x20, 0xC4, 0x2F, 0x6C, 0x14, 0xB8, 0xAB, 0x1A, 0x3A, 0xD0,
7133 0x1F, 0x59, 0x55, 0x76, 0x70, 0x44, 0xC8, 0x5F, 0x33, 0x9F,
7134 0xA3, 0xE3, 0x2D, 0xF1, 0x0C, 0xCA, 0x33, 0xB9, 0xC3, 0xFD,
7135 0x66, 0xE8, 0xD9, 0x9A, 0xE9, 0x4A, 0xCD, 0xB9, 0x09, 0x04,
7136 0xDB, 0x6B, 0x39, 0x71, 0xA3, 0x04, 0x68, 0xE3, 0x20, 0xDD,
7137 0x3C, 0x59, 0xF8, 0x36, 0xD2, 0x5C, 0xE4, 0x8F, 0x5D, 0xBF,
7138 0x39, 0xDC, 0xB6, 0x23, 0x01, 0x0C, 0xDF, 0x2D, 0x83, 0xAE,
7139 0x2C, 0x27, 0xCE, 0xAE, 0x2A, 0x9D, 0x40, 0xC2, 0x55, 0x58,
7140 0x48, 0x3C, 0x9B, 0x5D, 0x9F, 0xC6, 0xA6, 0x54, 0x29, 0x5E,
7141 0x36, 0xAC, 0xDC, 0xDA, 0xED, 0x8C, 0x1D, 0x73, 0x7B, 0x62,
7142 0x7F, 0x8F, 0xF6, 0xCC, 0x8A, 0xF2, 0x9B, 0x43, 0x8E, 0x6C,
7143 0x46, 0xF2, 0x9B, 0x59, 0x38, 0xD4, 0x57, 0x0A, 0x83, 0x6C,
7144 0x9A, 0x78, 0x72, 0x31, 0x42, 0x53, 0x6A, 0x91, 0xE1, 0xE2,
7145 0xAF, 0x77, 0xE0, 0x86, 0x0C, 0x37, 0x12, 0xD7, 0xEC, 0x10,
7146 0x5C, 0x05, 0x29, 0x1A, 0x27, 0x0E, 0x48, 0x25, 0xF7, 0x5F,
7147 0x57, 0x50, 0x15, 0x4F, 0x41, 0x8B, 0xAB, 0x25, 0x0F, 0xDE,
7148 0x5F, 0x12, 0x64, 0xA3, 0xF0, 0x35, 0x38, 0x7C, 0xD8, 0xD8,
7149 0xC1, 0x88, 0x9A, 0x34, 0xB6, 0xAF, 0xA9, 0x22, 0x87, 0x62,
7150 0x1C, 0xE8, 0xF2, 0xD3, 0x25, 0x50, 0x92, 0x91, 0xFF, 0x32,
7151 0x07, 0xF7, 0xC5, 0x7B, 0xB4, 0x69, 0xB7, 0x00, 0x36, 0x8A,
7152 0x12, 0x7E, 0x4B, 0x35, 0xC2, 0x39, 0x9E, 0x90, 0x77, 0xBC,
7153 0x50, 0x33, 0x46, 0x02, 0x12, 0x09, 0xF2, 0xEC, 0x4C, 0x3D,
7154 0xBF, 0x7A, 0xBB, 0x7D, 0x99, 0x1A, 0x70, 0x55, 0x24, 0x34,
7155 0x68, 0xD2, 0xD6, 0x27, 0xEA, 0xED, 0x87, 0x3A, 0x04, 0xDF,
7156 0xC5, 0xE6, 0x4E, 0x88, 0xFE, 0x8B, 0xED, 0xE0, 0x4C, 0xFF,
7157 0x6E, 0x97, 0x42, 0x3C, 0x0F, 0x60, 0x1F, 0xDC, 0x62, 0x69,
7158 0xB2, 0xBC, 0xB4, 0x18, 0x3C, 0x6D, 0x69, 0x8B, 0xD8, 0xA5,
7159 0x15, 0x2F, 0xA4, 0xD8, 0x1C, 0x62, 0x3F, 0x9A, 0x8B, 0x15,
7160 0x22, 0xAE, 0x37, 0xB6, 0xB8, 0x4D, 0xC4, 0xA5, 0x65, 0x65,

NetBurner, Inc.
1176 File Documentation

7161 0x6D, 0x22, 0x59, 0x61, 0xE1, 0x08, 0xD5, 0xE2, 0x86, 0xB8,
7162 0xBA, 0xD5, 0x68, 0x53, 0xEE, 0x62, 0xD7, 0xF9, 0x46, 0x8C,
7163 0x51, 0x01, 0xC5, 0x55, 0x22, 0xE5, 0xFE, 0xA0, 0xAA, 0x6A,
7164 0x4D, 0xCA, 0xC3, 0x20, 0x64, 0x12, 0xDB, 0x6F, 0x63, 0xAE,
7165 0xDC, 0xF6, 0x8C, 0xEA, 0x24, 0x43, 0xCD, 0x61, 0x74, 0xDF,
7166 0x61, 0x19, 0x56, 0x8A, 0x55, 0x1C, 0x16, 0x67, 0x15, 0x68,
7167 0x78, 0xE3, 0x51, 0x63, 0x4F, 0x97, 0x9A, 0xC0, 0xE5, 0xC2,
7168 0xD4, 0xD3, 0x8C, 0xA0, 0x80, 0x3B, 0xFE, 0x07, 0x14, 0xAF,
7169 0x1C, 0x16, 0x0B, 0x2C, 0x52, 0x87, 0xFB, 0x8E, 0x91, 0xB4,
7170 0x30, 0x00, 0x22, 0xD1, 0x4D, 0xAE, 0x8A, 0x1F, 0x19, 0x3E,
7171 0xD8, 0x75, 0x83, 0x85, 0x84, 0x3E, 0xEA, 0xC5, 0x87, 0xB9,
7172 0x70, 0x53, 0x25, 0xB2, 0xAB, 0xD0, 0x9C, 0x17, 0x5E, 0xA0,
7173 0x3C, 0xB0, 0x95, 0x5C, 0xDF, 0x86, 0x02, 0x82, 0xEA, 0x7B,
7174 0xB2, 0xF1, 0x9B, 0x56, 0xAE, 0x47, 0xA0, 0xB6, 0x65, 0x96,
7175 0xF0, 0x40, 0x6D, 0x60, 0xE7, 0x57, 0xC7, 0xE4, 0x1B, 0x63,
7176 0x91, 0x0F, 0x1B, 0xA8, 0x1D, 0x05, 0xDA, 0x43, 0x7C, 0x94,
7177 0x9A, 0x02, 0x4D, 0xA4, 0x70, 0xFC, 0x6E, 0xFE, 0x5D, 0xA0,
7178 0x55, 0x5D, 0xE9, 0x90, 0x07, 0x6B, 0x58, 0x9A, 0xA2, 0x5C,
7179 0x79, 0xE3, 0x27, 0x90, 0x8C, 0x97, 0x2D, 0xAB, 0x9E, 0x6E,
7180 0x54, 0x66, 0x51, 0xAD, 0x76, 0x7D, 0x83, 0xDD, 0x26, 0x5B,
7181 0x68, 0x7D, 0x94, 0x7E, 0x34, 0xEC, 0x25, 0x8E, 0x91, 0x4D,
7182 0xB9, 0x38, 0xD2, 0xFE, 0xDD, 0x03, 0x92, 0xA3, 0x88, 0x5B,
7183 0xBD, 0xE4, 0xDB, 0xE4, 0x32, 0x8A, 0x30, 0xAA, 0x72, 0x83,
7184 0x3F, 0xBC, 0x9A, 0xC4, 0x47, 0x42, 0xD4, 0x1E, 0x4D, 0x4D,
7185 0xA1, 0x4D, 0x10, 0x61, 0x7D, 0x69, 0x65, 0xEC, 0x3E, 0xBE,
7186 0x57, 0x54, 0x5E, 0x97, 0x28, 0x1E, 0xAE, 0xFA, 0x33, 0x4F,
7187 0xD0, 0x55, 0x42, 0x1A, 0xA7, 0x02, 0xC1, 0xCC, 0x25, 0x45,
7188 0x5A, 0x95, 0x7A, 0x29, 0x95, 0x27, 0x1B, 0xF2, 0xE2, 0x6F,
7189 0x45, 0xDA, 0x48, 0x6E, 0x39, 0x26, 0xF7, 0xDD, 0x2A, 0x83,
7190 0x23, 0xDD, 0xA7, 0xEC, 0x3E, 0xC0, 0x27, 0xC0, 0xCF, 0x38,
7191 0xDD, 0x61, 0x71, 0xCC, 0xE0, 0xB6, 0x80, 0x84, 0x2E, 0x7C,
7192 0x82, 0x7F, 0x21, 0x17, 0xB4, 0xDC, 0x35, 0xC8, 0xAA, 0x23,
7193 0x58, 0xD0, 0x1E, 0x6B, 0xD0, 0xAB, 0x82, 0xCF, 0x49, 0xCB,
7194 0x91, 0x95, 0x64, 0x32, 0xA7, 0x2F, 0x1D, 0x3B, 0x00, 0x33,
7195 0xEA, 0x2A, 0x9E, 0x7B, 0x27, 0xB7, 0x0E, 0x8F, 0x5C, 0x61,
7196 0x03, 0x0F, 0xF7, 0x7F, 0xE8, 0xA9, 0x23, 0x10, 0x54, 0x47,
7197 0xCC, 0x8B, 0x08, 0x65, 0x0A, 0x9D, 0x23, 0x86, 0xD1, 0xB1,
7198 0xB4, 0x08, 0x0A, 0x9E, 0xBD, 0xC1, 0xAC, 0xF6, 0xDF, 0x59,
7199 0xDA, 0x81, 0xCC, 0x81, 0xF9, 0xF9, 0x51, 0x81, 0x0F, 0x2B,
7200 0x6D, 0x8D, 0x6B, 0x1D, 0x29, 0xD8, 0x3E, 0xFE, 0x2D, 0xBA,
7201 0x4F, 0xA5, 0xD6, 0x7B, 0x4B, 0x3F, 0x0E, 0x34, 0x80, 0x17,
7202 0x78, 0x13, 0xB7, 0xCF, 0x81, 0x1F, 0xE9, 0x12, 0xA1, 0x8F,
7203 0x84, 0xB8, 0x78, 0x82, 0xFC, 0xCC, 0xAB, 0xDF, 0x0C, 0x48,
7204 0xAC, 0x9A, 0x92, 0x6B, 0xA8, 0xEA, 0x20, 0x34, 0x81, 0x5E,
7205 0x6A, 0x83, 0x73, 0xA5, 0x0B, 0xAF, 0xCF, 0x53, 0x42, 0x2E,
7206 0xDC, 0x75, 0x37, 0x32, 0xCB, 0x52, 0x7B, 0x0E, 0xCA, 0x16,
7207 0x32, 0x81, 0x4F, 0xE7, 0x04, 0x13, 0xEB, 0x7A, 0xBA, 0xF0,
7208 0xDF, 0x1D, 0x61, 0x4B, 0x5F, 0x52, 0x08, 0x52, 0x2D, 0x87,
7209 0x7C, 0x1A, 0x5B, 0x6F, 0x04, 0x16, 0xE3, 0x8D, 0xE0, 0x63,
7210 0x0B, 0xBE, 0xC6, 0x16, 0xF0, 0x47, 0x03, 0x8A, 0xD6, 0x8D,
7211 0xC2, 0xA8, 0xFB, 0xA8, 0x34, 0x52, 0xB4, 0xBF, 0xFF, 0x48,
7212 0x82, 0xC3, 0x22, 0x03, 0xE5, 0xD0, 0x34, 0x4C, 0x6A, 0x8B,
7213 0x09, 0xB2, 0x37, 0x5B, 0x09, 0xAB, 0xE2, 0x25, 0xD0, 0xAE,
7214 0x67, 0x05, 0x37, 0xA1, 0x1C, 0x5E, 0x99, 0xAA, 0xD9, 0xE2,
7215 0x45, 0x53, 0x3E, 0x97, 0xBB, 0x27, 0x3C, 0x6B, 0x00, 0x1F,
7216 0x4D, 0xCE, 0x8C, 0x8B, 0xF1, 0xF3, 0x05, 0x57, 0xC0, 0x63,
7217 0x41, 0xC5, 0xFA, 0x14, 0x9D, 0xB8, 0xA0, 0x75, 0x96, 0xB3,
7218 0x72, 0xCF, 0x56, 0x28, 0x29, 0x05, 0xB0, 0x4C, 0xB6, 0x78,
7219 0xEA, 0x36, 0x6A, 0x12, 0x5B, 0xFF, 0x59, 0x2E, 0xBD, 0xDF,
7220 0xDA, 0x41, 0x75, 0xC5, 0xFA, 0x87, 0x3F, 0x2F, 0x96, 0x0C,
7221 0x18, 0xCC, 0x8B, 0x72, 0xE7, 0x29, 0xF5, 0xB8, 0x56, 0xE8,
7222 0x92, 0x10, 0xB0, 0xCE, 0x3D, 0x40, 0x10, 0x40, 0x13, 0x9B,
7223 0xAC, 0x63, 0xD9, 0x31, 0xB1, 0xF1, 0x4C, 0xFA, 0x51, 0x19,
7224 0x62, 0xE5, 0x2E, 0x7A, 0x3F, 0x9A, 0xF0, 0x85, 0x83, 0x04,
7225 0xC0, 0x07, 0xB8, 0x04, 0x1A, 0xAD, 0x53, 0x2A, 0xB7, 0xDD,
7226 0xD8, 0x86, 0x0D, 0x1F, 0x24, 0x8A, 0xE9, 0xDC, 0x1F, 0x46,
7227 0xDE, 0x1E, 0xDD, 0x4E, 0xD3, 0xF3, 0x92, 0x43, 0xBF, 0x98,
7228 0xC8, 0x57, 0xC0, 0xB7, 0xC4, 0xD7, 0xE7, 0xA8, 0x78, 0x53,
7229 0x93, 0x42, 0x4C, 0x9A, 0x71, 0x82, 0x20, 0x3C, 0x32, 0xB5,
7230 0x30, 0x51, 0x54, 0x5D, 0x45, 0x81, 0x1B, 0x61, 0x6E, 0x7B,
7231 0xCC, 0x2C, 0x44, 0x87, 0x6F, 0x2E, 0xFC, 0x9D, 0x79, 0x63,
7232 0x20, 0xCA, 0x0E, 0xB3, 0x36, 0x9E, 0xDB, 0x31, 0xA3, 0xD0,
7233 0xD9, 0x01, 0x56, 0xEC, 0xCF, 0x09, 0xBC, 0xAE, 0x4B, 0x2C,
7234 0xE6, 0x61, 0xFA, 0x9F, 0xDD, 0x39, 0x4A, 0x01, 0xFF, 0xBA,
7235 0x60, 0x2B, 0x07, 0x38, 0x64, 0x36, 0x33, 0xDB, 0xEA, 0x3E,
7236 0xC3, 0xC0, 0x93, 0xBD, 0x63, 0xC8, 0xC9, 0x47, 0x33, 0xB6,
7237 0x21, 0x10, 0x21, 0x4E, 0xD6, 0xCB, 0xEA, 0x23, 0x48, 0x14,
7238 0x30, 0x21, 0x0E, 0x7D, 0xDD, 0x63, 0xD7, 0xAA, 0xAB, 0xDE,
7239 0x8B, 0x6E, 0x7A, 0x25, 0x19, 0x89, 0x2A, 0xF4, 0x65, 0x52,
7240 0x42, 0xBD, 0xB4, 0xBB, 0x00, 0x4C, 0x48, 0x1B, 0x3F, 0xC5,
7241 0x58, 0xEE, 0xE8, 0xEB, 0x49, 0x74, 0x0A, 0xD8, 0x34, 0x5F,
7242 0xFF, 0xF7, 0x66, 0x9C, 0xF6, 0x9D, 0xA2, 0x56, 0x68, 0x73,
7243 0x14, 0x6B, 0x58, 0xE9, 0x5E, 0xC7, 0x75, 0x2D, 0xB3, 0x01,
7244 0x19, 0xAA, 0xCF, 0x4A, 0xE9, 0xB1, 0x5E, 0x33, 0xC4, 0x68,
7245 0xE2, 0xA3, 0xF5, 0x14, 0x7F, 0xBB, 0xC5, 0x82, 0x1D, 0xA6,
7246 0x7D, 0x94, 0x9E, 0x0B, 0x1E, 0xDE, 0xAE, 0x3A, 0x5F, 0x52,
7247 0xF9, 0x39, 0xFD, 0x70, 0x98, 0x35, 0x7B, 0x80, 0x4E, 0xA9,

NetBurner, Inc.
22.205 certs_test.h 1177

7248 0xCA, 0xDF, 0xB1, 0xF3, 0x41, 0xE6, 0x88, 0x9A, 0x25, 0x59,
7249 0xF2, 0x1B, 0xE8, 0x57, 0x90, 0xBC, 0x63, 0x0F, 0xD4, 0xC2,
7250 0x6D, 0x49, 0x01, 0xCD, 0x1F, 0x92, 0xEC, 0xEE, 0xDB, 0x3B,
7251 0x19, 0x0C, 0xFA, 0x4D, 0x6C, 0x57, 0x16, 0xE0, 0x6E, 0x48,
7252 0xB5, 0x5D, 0xB3, 0xE5, 0xEA, 0xE6, 0xCC, 0x48, 0xD2, 0xF0,
7253 0x3A, 0x83, 0x63, 0x75, 0x01, 0x15, 0x9D, 0x41, 0xD5, 0x0B,
7254 0x99, 0x17, 0x9A, 0x0B, 0xEF, 0xBC, 0xE8, 0x6C, 0x29, 0xEF,
7255 0xE9, 0x2E, 0x97, 0x67, 0xA3, 0x8F, 0xEB, 0xD6, 0x57, 0xBF,
7256 0x8B, 0xB5, 0x2E, 0x4A, 0xAE, 0x23, 0x43, 0x1A, 0x46, 0x3C,
7257 0x9A, 0x48, 0x9C, 0x70, 0x89, 0x84, 0x4A, 0x42, 0x61, 0xAE,
7258 0x96, 0x1F, 0x7F, 0x00, 0xBF, 0x6C, 0x85, 0x3C, 0x41, 0x40,
7259 0xB3, 0x15, 0xE8, 0xC2, 0x05, 0x3E, 0x58, 0x0B, 0x1B, 0xEC,
7260 0x9F, 0x4F, 0x1E, 0x73, 0xD0, 0x8B, 0x9E, 0x45, 0x8A, 0x27,
7261 0xA2, 0x41, 0xF0, 0x18, 0xA5, 0x7A, 0x24, 0x64, 0x07, 0xA9,
7262 0xC0, 0x79, 0x2B, 0x02, 0x2D, 0xF0, 0xEC, 0x1E, 0xBD, 0xB0,
7263 0x1B, 0x16, 0x9C, 0x12, 0xBE, 0x7D, 0x58, 0xB2, 0x43, 0x1D,
7264 0xE6, 0x57, 0xBC, 0x8D, 0xC3, 0xD6, 0x78, 0xDC, 0xBB, 0xFD,
7265 0xE8, 0x4B, 0xC3, 0x05, 0x57, 0xA9, 0xC1, 0xEB, 0x2A, 0x6A,
7266 0xD3, 0xBC, 0x73, 0xFB, 0x1C, 0xE9, 0xE1, 0xC5, 0xBB, 0x89,
7267 0x15, 0xF0, 0xE1, 0x22, 0x11, 0x67, 0xC4, 0xF7, 0xD8, 0xD2,
7268 0x8A, 0xFB, 0x52, 0x25, 0xD2, 0x7B, 0x7C, 0x53, 0x29, 0x74,
7269 0xF4, 0x41, 0xB1, 0x50, 0x3B, 0x0F, 0x64, 0xFC, 0x1A, 0xEC,
7270 0x80, 0xCA, 0x2C, 0xF0, 0xE0, 0x37, 0x10, 0xA2, 0x83, 0x7E,
7271 0xE3, 0x46, 0x17, 0xB3, 0x56, 0x1C, 0x0A, 0x97, 0x65, 0xAC,
7272 0x23, 0x8D, 0xD8, 0x53, 0x3D, 0x0E, 0xA9, 0x7C, 0xC9, 0x04,
7273 0x7A, 0xE3, 0x1A, 0x3F, 0x73, 0x0D, 0x44, 0x4A, 0xA3, 0x65,
7274 0xC4, 0xF4, 0x6A, 0x78, 0x29, 0x3C, 0x7F, 0x4B, 0x05, 0xFF,
7275 0x29, 0x5B, 0x99, 0x89, 0x4F, 0xD5, 0x9A, 0x50, 0x1F, 0x52,
7276 0xB4, 0xB5, 0x2A, 0x1E, 0x6C, 0x7E, 0xEC, 0x5D, 0xDF, 0x15,
7277 0xDD, 0x96, 0x90, 0xF0, 0xD2, 0x5A, 0xA0, 0xB2, 0x0B, 0x05,
7278 0x50, 0x64, 0x41, 0xBB, 0x4B, 0xC9, 0x19, 0xD9, 0x10, 0xB7,
7279 0x18, 0x42, 0x57, 0x5B, 0x98, 0x87, 0x0E, 0x9B, 0x48, 0x33,
7280 0xD9, 0x5B, 0xEA, 0xA6, 0x77, 0x72, 0xEA, 0x1A, 0x9E, 0x54,
7281 0xBC, 0xF4, 0xED, 0x67, 0xAF, 0x58, 0x59, 0x97, 0xCD, 0x28,
7282 0xA3, 0xD3, 0x83, 0x8C, 0x0B, 0xFE, 0x76, 0x5B, 0xC6, 0x41,
7283 0xB3, 0x4B, 0x02, 0xB8, 0x89, 0x2E, 0x48, 0x2C, 0x6D, 0x4D,
7284 0x68, 0xA0, 0x50, 0x1A, 0x7D, 0x8A, 0x5D, 0x60, 0x24, 0xAC,
7285 0x69, 0x74, 0x3F, 0x76, 0x1B, 0xDA, 0x78, 0xE1, 0xEC, 0x1F,
7286 0x70, 0xAF, 0x6C, 0xFA, 0x9E, 0xF0, 0x4E, 0x32, 0x14, 0xBA,
7287 0x10, 0x38, 0xB5, 0xB8, 0xDA, 0x92, 0x03, 0xE6, 0xF6, 0x81,
7288 0x16, 0x78, 0x39, 0x5E, 0x2F, 0x79, 0x15, 0xAE, 0xE1, 0xA4,
7289 0x13, 0x02, 0x5E, 0x1D, 0x2D, 0x19, 0xE6, 0x07, 0x80, 0x80,
7290 0xAA, 0xB7, 0x1A, 0x7A, 0xF4, 0x2A, 0xDF, 0x9E, 0x7E, 0xAF,
7291 0x13, 0x07, 0xCC, 0x32, 0xA4, 0x0F, 0x77, 0xDF, 0x5D, 0xF1,
7292 0xD5, 0x3A, 0x6C, 0x06, 0xEE, 0x18, 0x84, 0x3E, 0xB1, 0x97,
7293 0x1F, 0x93, 0x1B, 0xF3, 0x8E, 0xC9, 0x01, 0x74, 0xC0, 0x97,
7294 0xE6, 0xFE, 0xFB, 0xF2, 0x90, 0xA1, 0x93, 0xA0, 0x06, 0xFE,
7295 0x1D, 0x40, 0x15, 0xFB, 0xE2, 0x68, 0xA0, 0xE2, 0xF9, 0x99,
7296 0xC3, 0xA9, 0xD7, 0xD9, 0x81, 0x98, 0x91, 0xE2, 0x6A, 0x13,
7297 0x81, 0xED, 0x1F, 0xFF, 0x63, 0x9B, 0x61, 0x9F, 0x44, 0xEC,
7298 0x66, 0x32, 0x1B, 0xCD, 0xE4, 0xD6, 0xD7, 0x2C, 0x28, 0xC1,
7299 0x2B, 0x16, 0xDD, 0x7D, 0x90, 0xFD, 0x8B, 0x7A, 0x1E, 0x06,
7300 0xD7, 0xEC, 0xBF, 0x4A, 0x24, 0x76, 0xD2, 0x46, 0xE0, 0x35,
7301 0x50, 0xCB, 0xD1, 0x2B, 0xA4, 0xC6, 0xFE, 0x72, 0xEC, 0x74,
7302 0xA3, 0x6D, 0x95, 0xA5, 0x3E, 0x38, 0x28, 0xD3, 0x6B, 0xCF,
7303 0x02, 0xF7, 0xF4, 0x8C, 0xBB, 0x8B, 0xB4, 0x19, 0x1E, 0x84,
7304 0xDC, 0xDD, 0x19, 0x31, 0x43, 0x07, 0x7F, 0xDE, 0x15, 0xE2,
7305 0xE9, 0x94, 0x27, 0x4F, 0x70, 0x81, 0x0D, 0x15, 0xAE, 0x24,
7306 0x02, 0x55, 0x25, 0xBE, 0x30, 0xEA, 0x69, 0xFA, 0x10, 0x05,
7307 0x54, 0xD0, 0x2F, 0x2C, 0xAF, 0x98, 0x56, 0x3B, 0x0F, 0xCB,
7308 0x4C, 0xED, 0xCE, 0x4E, 0x90, 0xA1, 0x18, 0xE0, 0x08, 0x71,
7309 0xA0, 0xF5, 0x5C, 0x87, 0xE6, 0x3F, 0x0A, 0x66, 0xC5, 0xB7,
7310 0x48, 0x58, 0x11, 0xF7, 0x2C, 0xF1, 0x78, 0xCC, 0x93, 0x92,
7311 0x6C, 0x39, 0x11, 0xFB, 0x68, 0xF9, 0x3C, 0x94, 0x43, 0x62,
7312 0xE4, 0x28, 0xD7, 0x4C, 0x73, 0x69, 0x78, 0x8F, 0x56, 0xEE,
7313 0x57, 0xD7, 0xDE, 0x00, 0x56, 0xB1, 0x1C, 0x50, 0x9C, 0x6C,
7314 0x10, 0xE8, 0x56, 0x2D, 0xD4, 0x64, 0x75, 0x29, 0xDF, 0xDB,
7315 0xC9, 0x50, 0x17, 0xC7, 0x2A, 0xA8, 0x3C, 0x79, 0x43, 0x73,
7316 0xE6, 0x23, 0x82, 0xEC, 0x56, 0x80, 0xA0, 0x9C, 0x25, 0x1F,
7317 0x3F, 0x2A, 0x67, 0x44, 0xC8, 0x93, 0x7F, 0x13, 0x62, 0x0C,
7318 0x2A, 0x6D, 0x4F, 0x8F, 0x02, 0x05, 0x7D, 0x0D, 0x0E, 0x71,
7319 0xC6, 0xF5, 0xB9, 0xB3, 0x92, 0x4C, 0xFC, 0x04, 0xE7, 0xB9,
7320 0xD6, 0x76, 0x88, 0xAB, 0xA3, 0x2F, 0xD1, 0x04, 0x96, 0x04,
7321 0xC1, 0xDB, 0x16, 0x04, 0x50, 0x4D, 0x65, 0x9D, 0x87, 0x0E,
7322 0x68, 0x3B, 0x28, 0x74, 0xDD, 0x88, 0x58, 0xBF, 0x22, 0xD3,
7323 0xD5, 0xD2, 0xEB, 0x2E, 0x78, 0xEC, 0xB3, 0xB6, 0x37, 0x53,
7324 0xC0, 0x29, 0x32, 0xE8, 0x7F, 0x0C, 0x56, 0x56, 0x12, 0x18,
7325 0x1E, 0x04, 0x90, 0x56, 0xAA, 0x32, 0x7B, 0xA2, 0xE0, 0x7D,
7326 0x20, 0x6E, 0x4D, 0x22, 0x66, 0x0F, 0xEE, 0xC3, 0x05, 0xD0,
7327 0x64, 0x25, 0xAE, 0x4D, 0x86, 0x3E, 0xC0, 0xC0, 0xC1, 0x35,
7328 0x5D, 0xD1, 0x5D, 0xD3, 0x9A, 0xC2, 0x83, 0x56, 0x35, 0x18,
7329 0x25, 0xE5, 0xCD, 0x39, 0x07, 0xA2, 0x11, 0x84, 0x51, 0xC5,
7330 0xF9, 0xB1, 0x12, 0xEC, 0x65, 0x0B, 0x1D, 0xBE, 0x76, 0x26,
7331 0x19, 0xA1, 0xA0, 0xF9, 0x7A, 0x82, 0x4E, 0xE6, 0x71, 0x43,
7332 0x60, 0x04, 0x10, 0xB5, 0x42, 0x75, 0xE1, 0x79, 0xF8, 0xD8,
7333 0x96, 0x0D, 0x91, 0xD8, 0x9C, 0x9E, 0x6B, 0xE6, 0xBA, 0x9C,
7334 0x3D, 0xE7, 0x51, 0xAC, 0xFB, 0xC4, 0x28, 0x80, 0x23, 0xCC,

NetBurner, Inc.
1178 File Documentation

7335 0xA4, 0xBE, 0x49, 0x33, 0xE5, 0x40, 0xDE, 0x72, 0xC0, 0x6B,
7336 0x32, 0xDE, 0x64, 0x99, 0x10, 0xB0, 0x39, 0x6F, 0x37, 0x5A,
7337 0xEB, 0xE8, 0xB6, 0x12, 0xEE, 0x03, 0xEF, 0x96, 0xE0, 0x4E,
7338 0x09, 0x83, 0xAF, 0xFA, 0x18, 0x94, 0x6E, 0x3C, 0x41, 0xDF,
7339 0x64, 0xF6, 0x92, 0xF8, 0x36, 0x2B, 0x77, 0xC7, 0x3E, 0x31,
7340 0x8A, 0x3B, 0x63, 0xE3, 0xBC, 0x4F, 0x3B, 0xBF, 0x7E, 0x35,
7341 0xFD, 0x87, 0x78, 0x55, 0xA8, 0x12, 0xC1, 0xAA, 0x79, 0x69,
7342 0xEC, 0xEC, 0x59, 0x41, 0x43, 0xA5, 0x2F, 0x88, 0x33, 0x83,
7343 0xF2, 0x11, 0x68, 0x6C, 0x96, 0xD3, 0x39, 0x20, 0x92, 0x3E,
7344 0xFF, 0x8F, 0xD6, 0xC1, 0x70, 0xA1, 0x78, 0x02, 0xCA, 0x7E,
7345 0xC3, 0x34, 0xB6, 0x04, 0x12, 0x8A, 0xB7, 0x53, 0x11, 0xB3,
7346 0x12, 0xAD, 0xA2, 0xBE, 0xDE, 0xE8, 0x3A, 0xED, 0xB1, 0x37,
7347 0xDB, 0x50, 0xE8, 0xCD, 0xCE, 0x9E, 0x6F, 0x2E, 0x05, 0xC6,
7348 0xFC, 0x98, 0xAE, 0xD7, 0xCF, 0x67, 0xF6, 0x4B, 0x74, 0x92,
7349 0xC2, 0xEF, 0x47, 0x09, 0xD1, 0x0C, 0xBC, 0x3C, 0x9D, 0xAC,
7350 0x19, 0xC1, 0x31, 0x48, 0x08, 0xFA, 0x34, 0xD5, 0x17, 0xDB,
7351 0xF2, 0x52, 0xF3, 0x65, 0x6A, 0xA3, 0xE8, 0x1F, 0xDD, 0x1F,
7352 0x9B, 0x7A, 0x9A, 0xC6, 0x4C, 0x48, 0x43, 0x2D, 0xC5, 0x91,
7353 0x89, 0xFF, 0x15, 0xB3, 0xD8, 0x65, 0xDA, 0xB1, 0xFE, 0xB5,
7354 0x65, 0xC9, 0xDD, 0xCA, 0xD3, 0x5B, 0x5C, 0xEC, 0xDA, 0x68,
7355 0x6B, 0xBB, 0xAF, 0x10, 0x8A, 0x9D, 0xF6, 0x0A, 0xDC, 0xCA,
7356 0xC8, 0xD4, 0xF0, 0xB9, 0x60, 0xBA, 0x58, 0x4C, 0x2A, 0x0B,
7357 0xD0, 0xC9, 0xDC, 0x58, 0x12, 0xD2, 0x8C, 0xC4, 0x7C, 0x05,
7358 0xC0, 0xFE, 0x59, 0x77, 0x64, 0x67, 0x62, 0x83, 0x4E, 0x72,
7359 0x04, 0x44, 0x76, 0x46, 0x0D, 0x3D, 0x56, 0xFB, 0xE3, 0x25,
7360 0xB8, 0x20, 0x14, 0x96, 0xD5, 0xF1, 0x36, 0x76, 0x5D, 0x8D,
7361 0xE6, 0xF7, 0xE7, 0x36, 0x32, 0x30, 0x30, 0x63, 0x84, 0x3A,
7362 0x7D, 0x00, 0x3A, 0x65, 0x1E, 0xB3, 0xD5, 0x50, 0xF1, 0x5D,
7363 0x2B, 0xC9, 0x48, 0x82, 0x9D, 0x0E, 0xC7, 0x53, 0xB1, 0xDD,
7364 0x51, 0xF3, 0x56, 0x29, 0x72, 0xE0, 0xFD, 0xA0, 0xAF, 0xB1,
7365 0x62, 0xF6, 0xA1, 0x24, 0x22, 0x99, 0x18, 0x64, 0xEF, 0x34,
7366 0x41, 0x2A, 0xFA, 0xC7, 0x6C, 0xF6, 0x5D, 0x72, 0x06, 0x12,
7367 0x83, 0xB2, 0x14, 0xEF, 0x5D, 0x25, 0x11, 0x48, 0xE1, 0xD5,
7368 0x01, 0xE8, 0xA5, 0x99, 0x62, 0x2C, 0xF4, 0xDD, 0x78, 0x9D,
7369 0x64, 0xF2, 0x3F, 0x41, 0x1C, 0xB0, 0x87, 0x0C, 0x19, 0x04,
7370 0x6D, 0x16, 0x72, 0x2F, 0x7B, 0x6D, 0xFE, 0xF3, 0x0C, 0x77,
7371 0x04, 0xCD, 0xEB, 0xE4, 0xC8, 0x0A, 0xC1, 0x9E, 0x41, 0x1E,
7372 0xAC, 0xF2, 0x5B, 0xED, 0xD1, 0xE5, 0x72, 0x8F, 0x0E, 0xBF,
7373 0x59, 0xA8, 0x1D, 0x1C, 0x1E, 0xED, 0xB7, 0xD2, 0xA6, 0x8B,
7374 0x23, 0x7F, 0x40, 0x39, 0xD6, 0xD8, 0xEE, 0x50, 0x0F, 0xC3,
7375 0x1B, 0x03, 0xAA, 0x0A, 0xA4, 0xFF, 0xB6, 0xC5, 0xB3, 0x97,
7376 0x4C, 0xB6, 0xA8, 0x01, 0x0D, 0xDC, 0x2B, 0xEE, 0x6C, 0x29,
7377 0xF9, 0x59, 0x06, 0x5F, 0xCC, 0xE3, 0x28, 0xED, 0xEB, 0xB2,
7378 0x9F, 0x7F, 0x43, 0xBB, 0x02, 0x5F, 0xC4, 0xC8, 0x48, 0xC8,
7379 0xF8, 0x2B, 0xB7, 0xCD, 0xC4, 0x64, 0x4B, 0xEF, 0xC9, 0x9C,
7380 0xEB, 0xC5, 0x41, 0xDF, 0xB4, 0xC3, 0x5D, 0x95, 0xCE, 0x1E,
7381 0xC7, 0x5C, 0xB2, 0x4D, 0x81, 0x25, 0xDD, 0x19, 0xF3, 0x39,
7382 0xE8, 0x1B, 0x0E, 0x4F, 0x71, 0xF5, 0xE5, 0x99, 0x90, 0x32,
7383 0x77, 0xA9, 0x73, 0x3E, 0x58, 0x9B, 0x41, 0x1B, 0x77, 0x06,
7384 0x92, 0xDF, 0x1A, 0x96, 0x93, 0x02, 0xFF, 0xE7, 0xDF, 0xD3,
7385 0x09, 0x9A, 0xB7, 0x12, 0xB7, 0xE0, 0xF1, 0x73, 0x47, 0x6A,
7386 0x48, 0x06, 0x42, 0x41, 0x93, 0x4C, 0x57, 0x61, 0xFF, 0x90,
7387 0xA3, 0x18, 0xCE, 0xBE, 0x35, 0x6B, 0x78, 0x05, 0x01, 0x5F,
7388 0x2F, 0x0F, 0xA8, 0x05, 0xB1, 0x6B, 0x22, 0x7E, 0xC9, 0x5E,
7389 0x4F, 0xB6, 0xEE, 0x4E, 0xEC, 0xF6, 0xF0, 0x9F, 0x74, 0x8B,
7390 0xE4, 0xFF, 0x5C, 0x69, 0xCB, 0xD2, 0x8F, 0x2D, 0x4B, 0x06,
7391 0x6C, 0x64, 0x76, 0xAE, 0x03, 0x12, 0xCB, 0x98, 0xD2, 0xBF,
7392 0x1E, 0xAB, 0x76, 0x24, 0x95, 0xD7, 0xB1, 0x62, 0x63, 0xBC,
7393 0x21, 0xC6, 0x16, 0xEA, 0x81, 0x2A, 0x01, 0xFC, 0x2E, 0x43,
7394 0x18, 0x62, 0xFD, 0xFB, 0x06, 0xF2, 0x17, 0xF1, 0xD5, 0x91,
7395 0x9A, 0x0E, 0x75, 0xFF, 0x53, 0x61, 0xE9, 0x8C, 0x51, 0x99,
7396 0x9B, 0x32, 0x5B, 0x2A, 0x56, 0x3E, 0xB1, 0x7D, 0x26, 0x1D,
7397 0x47, 0xFC, 0x05, 0x5A, 0x79, 0xC6, 0xEF, 0x62, 0x58, 0xA4,
7398 0xEF, 0xBB, 0xB8, 0xF7, 0x84, 0xEE, 0xA3, 0x12, 0x83, 0x28,
7399 0xA0, 0xD1, 0x9D, 0x1A, 0x8B, 0xD1, 0x56, 0x2A, 0xAA, 0x41,
7400 0xFD, 0xF2, 0x4F, 0xD9, 0x68, 0xF1, 0xB9, 0xEB, 0xB0, 0xEC,
7401 0xAF, 0x99, 0xDE, 0xE4, 0xDD, 0x26, 0xD2, 0xBA, 0x54, 0x29,
7402 0x6E, 0x31, 0xE4, 0x91, 0x40, 0x8B, 0x39, 0xC8, 0xDF, 0x8C,
7403 0x6F, 0xDF, 0xA6, 0x2D, 0xAE, 0x13, 0x5E, 0xF3, 0xD7, 0x62,
7404 0xC9, 0xE7, 0xC6, 0x51, 0xCA, 0x8E, 0xB2, 0xB3, 0x0B, 0x0C,
7405 0xA8, 0xC5, 0x95, 0x95, 0xFF, 0x72, 0x3C, 0xC7, 0x6E, 0xAA,
7406 0x44, 0x41, 0x82, 0xB6, 0x84, 0x78, 0xC7, 0x47, 0xC6, 0x18,
7407 0x31, 0x95, 0x08, 0x4D, 0xCE, 0x83, 0x80, 0x5B, 0x12, 0xF5,
7408 0xCB, 0x83, 0xD7, 0x60, 0x02, 0xFF, 0x22, 0xCD, 0x59, 0xB0,
7409 0xA8, 0x61, 0xDE, 0x50, 0x53, 0x9C, 0xF8, 0xF4, 0x12, 0xEB,
7410 0x33, 0x98, 0xCA, 0xC1, 0x63, 0x1D, 0x39, 0xA5, 0xC8, 0x89,
7411 0x39, 0x0A, 0x43, 0xFE, 0x67, 0x71, 0xC7, 0x91, 0x5B, 0xFA,
7412 0xA4, 0x76, 0x6C, 0x02, 0xF0, 0x23, 0xEB, 0x01, 0x43, 0xF5,
7413 0xDC, 0xD7, 0x3A, 0x2E, 0x54, 0xB4, 0xF6, 0xF3, 0x03, 0xE4,
7414 0x60, 0x62, 0x2B, 0xE4, 0x53, 0x5C, 0x6E, 0x17, 0x07, 0x0D,
7415 0x67, 0x18, 0x6B, 0xCD, 0x7D, 0xF9, 0x98, 0x0F, 0xAC, 0x17,
7416 0x9E, 0xD2, 0xB7, 0xE6, 0xE5, 0x89, 0xBD, 0xFF, 0x74, 0x06,
7417 0x0E, 0xE7, 0x52, 0x7F, 0x1C, 0xBA, 0x21, 0x14, 0xFB, 0xE7,
7418 0x86, 0x11, 0x53, 0x80, 0xC0, 0xCF, 0xD8, 0x4B, 0x13, 0x0F,
7419 0xF8, 0xC7, 0x12, 0xC2, 0x9D, 0x85, 0x2E, 0x58, 0xF1, 0x81,
7420 0xD6, 0x61, 0x64, 0x40, 0x20, 0xA2, 0x0A, 0xC4, 0x49, 0x6A,
7421 0x60, 0xE0, 0x47, 0x75, 0x02, 0x71, 0xEC, 0x54, 0x5E, 0x26,

NetBurner, Inc.
22.205 certs_test.h 1179

7422 0x3E, 0x5A, 0xEA, 0x09, 0x25, 0x03, 0xDC, 0xBF, 0x9C, 0xFE,
7423 0xFA, 0x19, 0xFB, 0x90, 0x91, 0x93, 0x21, 0x13, 0x96, 0x4C,
7424 0x80, 0xAF, 0x48, 0x5B, 0xDD, 0x0D, 0xC5, 0x02, 0x1F, 0x77,
7425 0x3D, 0x49, 0xBF, 0xAD, 0xFE, 0x90, 0x59, 0x93, 0xEB, 0x17,
7426 0xDA, 0x42, 0x18, 0x65, 0xFE, 0x9D, 0x7E, 0x11, 0xFF, 0x5A,
7427 0x2C, 0xCA, 0x48, 0x32, 0x50, 0xFA, 0xC4, 0xFF, 0x43, 0xC5,
7428 0xE3, 0x66, 0x97, 0x88, 0x8A, 0x2A, 0x7F, 0x90, 0x4C, 0xDA,
7429 0x61, 0x79, 0xBF, 0xB1, 0xF5, 0x94, 0xF0, 0x46, 0x70, 0xB6,
7430 0x62, 0x4C, 0xC1, 0x1B, 0x32, 0x6E, 0x76, 0x63, 0xB2, 0x22,
7431 0x5C, 0x22, 0xC1, 0x20, 0x6C, 0xD4, 0xF0, 0x22, 0x02, 0xA0,
7432 0xCF, 0xE4, 0x17, 0x42, 0xCD, 0x2E, 0xF2, 0x38, 0xF9, 0xB4,
7433 0x6B, 0x50, 0xE9, 0x38, 0x20, 0x59, 0x8F, 0x67, 0xE5, 0x4F,
7434 0x03, 0xDC, 0xE3, 0x9F, 0x24, 0xA8, 0xAD, 0x5B, 0xF4, 0xC4,
7435 0x07, 0x5D, 0x0D, 0x65, 0x6A, 0xA5, 0xA8, 0x05, 0xB5, 0xAE,
7436 0xCB, 0xF4, 0xCB, 0xDF, 0xC9, 0x76, 0x54, 0xAC, 0x07, 0x23,
7437 0x28, 0x5C, 0x60, 0x58, 0x60, 0xB5, 0xBE, 0xBD, 0xAC, 0xEA,
7438 0x65, 0x69, 0x4F, 0x9B, 0x61, 0x9A, 0xDF, 0x25, 0x89, 0x16,
7439 0x4A, 0x25, 0x6E, 0xA6, 0xA5, 0x00, 0x0F, 0xAD, 0xA7, 0x73,
7440 0xD4, 0x02, 0x2D, 0x1D, 0x6C, 0x03, 0x8E, 0x5F, 0x09, 0x62,
7441 0xA8, 0x35, 0xA4, 0x4B, 0xB7, 0xDB, 0xC7, 0x31, 0x7C, 0xD9,
7442 0x1F, 0xBD, 0xE8, 0x9D, 0x05, 0x7D, 0xEC, 0xBD, 0x0A, 0x90,
7443 0x87, 0x99, 0xB0, 0x61, 0x04, 0x5D, 0xA3, 0x33, 0xF8, 0xFA,
7444 0x55, 0xBD, 0x5B, 0x90, 0xFE, 0x89, 0x83, 0x47, 0x96, 0xCF,
7445 0xCC, 0x0D, 0x80, 0x49, 0x1E, 0x9B, 0xF9, 0xEA, 0x13, 0x2C,
7446 0x13, 0xEA, 0xF0, 0xA5, 0x31, 0x0F, 0xE8, 0xB0, 0xF6, 0xA1,
7447 0x83, 0xC5, 0x1A, 0x02, 0x7A, 0x8B, 0x7A, 0x8C, 0x3A, 0x45,
7448 0x12, 0x30, 0x07, 0x71, 0x67, 0x47, 0xA7, 0x10, 0x6E, 0x18,
7449 0xE8, 0x8B, 0x7D, 0x86, 0xFF, 0x11, 0x6A, 0x3D, 0xAF, 0x9E,
7450 0x78, 0xC0, 0x71, 0x85, 0x22, 0x89, 0x73, 0x73, 0x5E, 0x8C,
7451 0x75, 0x29, 0xEE, 0x1F, 0x83, 0x1F, 0xF3, 0x7F, 0x90, 0xEC,
7452 0x0B, 0x12, 0x7D, 0x38, 0x86, 0xA7, 0x8D, 0xEA, 0xA3, 0xD8,
7453 0xFD, 0xD9, 0xED, 0x83, 0x92, 0xE6, 0xBE, 0x31, 0x40, 0xDC,
7454 0xEF, 0x9A, 0x06, 0x29, 0xF5, 0xA0, 0xF2, 0x14, 0x9F, 0x90,
7455 0xB5, 0x8F, 0x48, 0x4A, 0x25, 0x19, 0xB8, 0xA6, 0x17, 0xEF,
7456 0xC9, 0xDE, 0x48, 0x49, 0xD8, 0xEA, 0x15, 0xEE, 0x6C, 0xAB,
7457 0x10, 0xCE, 0x7F, 0xFC, 0x00, 0x54, 0x89, 0x1F, 0x8F, 0x1E,
7458 0x73, 0x14, 0x86, 0x10, 0x16, 0xB6, 0x38, 0xAC, 0x4B, 0x36,
7459 0x83, 0xCE, 0x65, 0xE2, 0xC3, 0x99, 0xEF, 0x26, 0x2B, 0xC0,
7460 0x09, 0x35, 0xF3, 0xCA, 0x99, 0x3B, 0x4D, 0x9D, 0xC4, 0x08,
7461 0x7A, 0x7B, 0x0D, 0xDD, 0x05, 0x1B, 0x42, 0x8B, 0x41, 0x0E,
7462 0x9B, 0x51, 0x08, 0x04, 0x1E, 0x1C, 0x76, 0x32, 0x6C, 0xA0,
7463 0x29, 0x52, 0xFB, 0x73, 0xB0, 0x6E, 0xE8, 0x0E, 0x40, 0x1E,
7464 0xCE, 0x0A, 0x8E, 0xF9, 0xE0, 0xC9, 0x18, 0xDC, 0x28, 0xCF,
7465 0xC5, 0x71, 0x9B, 0xCE, 0x3B, 0xA0, 0x22, 0x59, 0xBB, 0x3F,
7466 0x68, 0x97, 0xAA, 0x89, 0xD1, 0x8F, 0xC8, 0x8D, 0x63, 0xE3,
7467 0x1F, 0x0F, 0xD7, 0xFB, 0x07, 0x82, 0x2D, 0x44, 0x79, 0x6A,
7468 0x85, 0x15, 0xD9, 0xE1, 0x8E, 0xBB, 0x57, 0xF1, 0xFA, 0x80,
7469 0x8D, 0xB8, 0x71, 0xA3, 0x74, 0x60, 0x03, 0xFB, 0x5F, 0x5E,
7470 0x51, 0x88, 0x37, 0x41, 0x9A, 0x83, 0x6D, 0x84, 0xE5, 0x9A,
7471 0x8B, 0x34, 0xCA, 0x65, 0x7D, 0x27, 0xAF, 0x32, 0x4D, 0x00,
7472 0x3D, 0xC3, 0x40, 0x98, 0xCF, 0xB2, 0xDE, 0xE1, 0x71, 0x69,
7473 0xB5, 0xAB, 0xE6, 0xC3, 0x8D, 0x6C, 0xDE, 0x95, 0x5E, 0x16,
7474 0x12, 0x16, 0x19, 0xFA, 0x89, 0x6D, 0xD6, 0xAB, 0x90, 0xFC,
7475 0x15, 0x9B, 0xD3, 0x8D, 0x78, 0x8D, 0xBD, 0x7A, 0x0C, 0xF2,
7476 0xB9, 0xE7, 0x34, 0xDE, 0x63, 0x72, 0x0B, 0x33, 0xE1, 0xBC,
7477 0xF7, 0x43, 0xB2, 0xDA, 0x74, 0x1E, 0x7A, 0x4D, 0xF4, 0xEE,
7478 0xB4, 0xA1, 0x7E, 0x34, 0x12, 0xC7, 0xC7, 0x04, 0xA7, 0x60,
7479 0x83, 0xD1, 0x0A, 0xC0, 0xB9, 0xCA, 0x53, 0xFE, 0x0F, 0xF0,
7480 0xAF, 0xA3, 0x59, 0xED, 0x62, 0x21, 0x88, 0xCD, 0xD3, 0x3C,
7481 0xA4, 0x11, 0xFF, 0x28, 0xAD, 0xDA, 0xB1, 0xEA, 0x58, 0xFF,
7482 0xA9, 0x05, 0x88, 0xAA, 0x30, 0x77, 0xB5, 0x91, 0x9C, 0xD1,
7483 0x80, 0xC1, 0x88, 0x0D, 0xAA, 0x1E, 0x7A, 0xA7, 0x06, 0xDA,
7484 0xFB, 0xE2, 0x0A, 0x71, 0xE2, 0x24, 0xDF, 0xA9, 0xD7, 0x4F,
7485 0xD8, 0x2D, 0xAE, 0x81, 0x74, 0xB1, 0xDA, 0x13, 0x74, 0xB4,
7486 0x39, 0xCF, 0x16, 0xCE, 0x4C, 0xF5, 0xA4, 0x9C, 0x35, 0x32,
7487 0x80, 0x69, 0x9B, 0x3A, 0xC9, 0x27, 0x54, 0xA1, 0x5F, 0x98,
7488 0x79, 0xBE, 0x6A, 0x42, 0x8E, 0x04, 0xCE, 0x68, 0xDD, 0x05,
7489 0x82, 0xA4, 0xE4, 0x19, 0xEA, 0x3F, 0x27, 0xD8, 0x01, 0x0F,
7490 0x0B, 0x3D, 0x52, 0xFF, 0x7F, 0xC6, 0xD1, 0xED, 0x98, 0x38,
7491 0xFF, 0xC5, 0xA8, 0xBE, 0x47, 0x79, 0x45, 0x4B, 0x5D, 0x4A,
7492 0xA6, 0x7E, 0xCF, 0xA8, 0x7E, 0x24, 0xC9, 0x45, 0x6F, 0xAF,
7493 0x75, 0xB2, 0x95, 0x7F, 0x36, 0xB9, 0xA5, 0xAA, 0x36, 0x71,
7494 0x84, 0x01, 0xED, 0x65, 0x83, 0x8A, 0x70, 0x9F, 0xAB, 0xF7,
7495 0xBF, 0x8B, 0x99, 0x6F, 0xCF, 0xC3, 0x8B, 0xC5, 0x54, 0x74,
7496 0xE0, 0x01, 0x38, 0x0D, 0xF6, 0x1C, 0x54, 0x37, 0x3B, 0x1D,
7497 0xDE, 0xCA, 0x5B, 0x0D, 0xF7, 0x8E, 0xA7, 0x9C, 0xB9, 0xF7,
7498 0xD6, 0x91, 0x33, 0xB2, 0xCB, 0xB4, 0x0F, 0x71, 0xF8, 0x20,
7499 0xFA, 0xCD, 0x57, 0x7A, 0xA4, 0xE0, 0x8A, 0xC2, 0x6C, 0x3F,
7500 0xB9, 0xBF, 0x22, 0x77, 0xC3, 0x7B, 0xFB, 0x89, 0x17, 0x3F,
7501 0x61, 0xBC, 0xBF, 0xA1, 0x4C, 0xFC, 0x05, 0x21, 0xC1, 0x72,
7502 0x40, 0x1C, 0x88, 0xEC, 0xE9, 0x21, 0xA3, 0xCF, 0x4E, 0x17,
7503 0xFB, 0x85, 0x57, 0xCE, 0x85, 0x46, 0x5F, 0xD3, 0xE4, 0x3D,
7504 0x91, 0xC6, 0x86, 0x6B, 0x76, 0x44, 0xB4, 0xD2, 0x13, 0x6D,
7505 0xAA, 0xC2, 0x42, 0xE5, 0xD6, 0xEA, 0xE3, 0xD6, 0x5B, 0xF9,
7506 0x8F, 0xA6, 0x23, 0xA6, 0x82, 0xCC, 0x1D, 0xF6, 0xAF, 0x2F,
7507 0x06, 0x75, 0x7D, 0x9A, 0x26, 0x0E, 0x80, 0x42, 0xC4, 0xAB,
7508 0xF5, 0xFB, 0x46, 0x83, 0xBF, 0x35

NetBurner, Inc.
1180 File Documentation

7509 };
7510 static const int sizeof_bench_dilithium_aes_level5_key = sizeof(bench_dilithium_aes_level5_key);
7511
7512 #endif /* HAVE_PQC */
7513
7514 #if defined(HAVE_ECC) && defined(USE_CERT_BUFFERS_256)
7515
7516 /* ./certs/ecc-client-key.der, ECC */
7517 static const unsigned char ecc_clikey_der_256[] =
7518 {
7519 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0xF8, 0xCF, 0x92,
7520 0x6B, 0xBD, 0x1E, 0x28, 0xF1, 0xA8, 0xAB, 0xA1, 0x23, 0x4F,
7521 0x32, 0x74, 0x18, 0x88, 0x50, 0xAD, 0x7E, 0xC7, 0xEC, 0x92,
7522 0xF8, 0x8F, 0x97, 0x4D, 0xAF, 0x56, 0x89, 0x65, 0xC7, 0xA0,
7523 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01,
7524 0x07, 0xA1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x55, 0xBF, 0xF4,
7525 0x0F, 0x44, 0x50, 0x9A, 0x3D, 0xCE, 0x9B, 0xB7, 0xF0, 0xC5,
7526 0x4D, 0xF5, 0x70, 0x7B, 0xD4, 0xEC, 0x24, 0x8E, 0x19, 0x80,
7527 0xEC, 0x5A, 0x4C, 0xA2, 0x24, 0x03, 0x62, 0x2C, 0x9B, 0xDA,
7528 0xEF, 0xA2, 0x35, 0x12, 0x43, 0x84, 0x76, 0x16, 0xC6, 0x56,
7529 0x95, 0x06, 0xCC, 0x01, 0xA9, 0xBD, 0xF6, 0x75, 0x1A, 0x42,
7530 0xF7, 0xBD, 0xA9, 0xB2, 0x36, 0x22, 0x5F, 0xC7, 0x5D, 0x7F,
7531 0xB4
7532 };
7533 static const int sizeof_ecc_clikey_der_256 = sizeof(ecc_clikey_der_256);
7534
7535 /* ./certs/ecc-client-keyPub.der, ECC */
7536 static const unsigned char ecc_clikeypub_der_256[] =
7537 {
7538 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE,
7539 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D,
7540 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x55, 0xBF, 0xF4,
7541 0x0F, 0x44, 0x50, 0x9A, 0x3D, 0xCE, 0x9B, 0xB7, 0xF0, 0xC5,
7542 0x4D, 0xF5, 0x70, 0x7B, 0xD4, 0xEC, 0x24, 0x8E, 0x19, 0x80,
7543 0xEC, 0x5A, 0x4C, 0xA2, 0x24, 0x03, 0x62, 0x2C, 0x9B, 0xDA,
7544 0xEF, 0xA2, 0x35, 0x12, 0x43, 0x84, 0x76, 0x16, 0xC6, 0x56,
7545 0x95, 0x06, 0xCC, 0x01, 0xA9, 0xBD, 0xF6, 0x75, 0x1A, 0x42,
7546 0xF7, 0xBD, 0xA9, 0xB2, 0x36, 0x22, 0x5F, 0xC7, 0x5D, 0x7F,
7547 0xB4
7548 };
7549 static const int sizeof_ecc_clikeypub_der_256 = sizeof(ecc_clikeypub_der_256);
7550
7551 /* ./certs/client-ecc-cert.der, ECC */
7552 static const unsigned char cliecc_cert_der_256[] =
7553 {
7554 0x30, 0x82, 0x03, 0x5E, 0x30, 0x82, 0x03, 0x04, 0xA0, 0x03,
7555 0x02, 0x01, 0x02, 0x02, 0x14, 0x60, 0x55, 0xB1, 0x7F, 0xCA,
7556 0x72, 0x4D, 0x35, 0x39, 0x56, 0x26, 0xE7, 0x7D, 0x16, 0xE3,
7557 0x82, 0x18, 0x36, 0xCB, 0x1D, 0x30, 0x0A, 0x06, 0x08, 0x2A,
7558 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x81, 0x8D,
7559 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
7560 0x02, 0x55, 0x53, 0x31, 0x0F, 0x30, 0x0D, 0x06, 0x03, 0x55,
7561 0x04, 0x08, 0x0C, 0x06, 0x4F, 0x72, 0x65, 0x67, 0x6F, 0x6E,
7562 0x31, 0x0E, 0x30, 0x0C, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C,
7563 0x05, 0x53, 0x61, 0x6C, 0x65, 0x6D, 0x31, 0x13, 0x30, 0x11,
7564 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0A, 0x43, 0x6C, 0x69,
7565 0x65, 0x6E, 0x74, 0x20, 0x45, 0x43, 0x43, 0x31, 0x0D, 0x30,
7566 0x0B, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x04, 0x46, 0x61,
7567 0x73, 0x74, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
7568 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
7569 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
7570 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
7571 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
7572 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
7573 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
7574 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
7575 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
7576 0x32, 0x34, 0x5A, 0x30, 0x81, 0x8D, 0x31, 0x0B, 0x30, 0x09,
7577 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
7578 0x0F, 0x30, 0x0D, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x06,
7579 0x4F, 0x72, 0x65, 0x67, 0x6F, 0x6E, 0x31, 0x0E, 0x30, 0x0C,
7580 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x05, 0x53, 0x61, 0x6C,
7581 0x65, 0x6D, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
7582 0x0A, 0x0C, 0x0A, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20,
7583 0x45, 0x43, 0x43, 0x31, 0x0D, 0x30, 0x0B, 0x06, 0x03, 0x55,
7584 0x04, 0x0B, 0x0C, 0x04, 0x46, 0x61, 0x73, 0x74, 0x31, 0x18,
7585 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77,
7586 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
7587 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09,
7588 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16,
7589 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66,
7590 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x59, 0x30,
7591 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01,
7592 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07,
7593 0x03, 0x42, 0x00, 0x04, 0x55, 0xBF, 0xF4, 0x0F, 0x44, 0x50,
7594 0x9A, 0x3D, 0xCE, 0x9B, 0xB7, 0xF0, 0xC5, 0x4D, 0xF5, 0x70,
7595 0x7B, 0xD4, 0xEC, 0x24, 0x8E, 0x19, 0x80, 0xEC, 0x5A, 0x4C,

NetBurner, Inc.
22.205 certs_test.h 1181

7596 0xA2, 0x24, 0x03, 0x62, 0x2C, 0x9B, 0xDA, 0xEF, 0xA2, 0x35,
7597 0x12, 0x43, 0x84, 0x76, 0x16, 0xC6, 0x56, 0x95, 0x06, 0xCC,
7598 0x01, 0xA9, 0xBD, 0xF6, 0x75, 0x1A, 0x42, 0xF7, 0xBD, 0xA9,
7599 0xB2, 0x36, 0x22, 0x5F, 0xC7, 0x5D, 0x7F, 0xB4, 0xA3, 0x82,
7600 0x01, 0x3E, 0x30, 0x82, 0x01, 0x3A, 0x30, 0x1D, 0x06, 0x03,
7601 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0xEB, 0xD4, 0x4B,
7602 0x59, 0x6B, 0x95, 0x61, 0x3F, 0x51, 0x57, 0xB6, 0x04, 0x4D,
7603 0x89, 0x41, 0x88, 0x44, 0x5C, 0xAB, 0xF2, 0x30, 0x81, 0xCD,
7604 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x81, 0xC5, 0x30, 0x81,
7605 0xC2, 0x80, 0x14, 0xEB, 0xD4, 0x4B, 0x59, 0x6B, 0x95, 0x61,
7606 0x3F, 0x51, 0x57, 0xB6, 0x04, 0x4D, 0x89, 0x41, 0x88, 0x44,
7607 0x5C, 0xAB, 0xF2, 0xA1, 0x81, 0x93, 0xA4, 0x81, 0x90, 0x30,
7608 0x81, 0x8D, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
7609 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x0F, 0x30, 0x0D, 0x06,
7610 0x03, 0x55, 0x04, 0x08, 0x0C, 0x06, 0x4F, 0x72, 0x65, 0x67,
7611 0x6F, 0x6E, 0x31, 0x0E, 0x30, 0x0C, 0x06, 0x03, 0x55, 0x04,
7612 0x07, 0x0C, 0x05, 0x53, 0x61, 0x6C, 0x65, 0x6D, 0x31, 0x13,
7613 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0A, 0x43,
7614 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x20, 0x45, 0x43, 0x43, 0x31,
7615 0x0D, 0x30, 0x0B, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x04,
7616 0x46, 0x61, 0x73, 0x74, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03,
7617 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77,
7618 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
7619 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86,
7620 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66,
7621 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
7622 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x60, 0x55, 0xB1, 0x7F, 0xCA,
7623 0x72, 0x4D, 0x35, 0x39, 0x56, 0x26, 0xE7, 0x7D, 0x16, 0xE3,
7624 0x82, 0x18, 0x36, 0xCB, 0x1D, 0x30, 0x0C, 0x06, 0x03, 0x55,
7625 0x1D, 0x13, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF, 0x30,
7626 0x1C, 0x06, 0x03, 0x55, 0x1D, 0x11, 0x04, 0x15, 0x30, 0x13,
7627 0x82, 0x0B, 0x65, 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x2E,
7628 0x63, 0x6F, 0x6D, 0x87, 0x04, 0x7F, 0x00, 0x00, 0x01, 0x30,
7629 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14,
7630 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01,
7631 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02,
7632 0x30, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04,
7633 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00,
7634 0xE8, 0xF6, 0x1C, 0x8D, 0x9B, 0xA0, 0xE2, 0x49, 0xEB, 0x4D,
7635 0x9D, 0xF5, 0xE6, 0xB3, 0x6C, 0xE4, 0x22, 0xC8, 0x2B, 0x6D,
7636 0x34, 0x79, 0x9D, 0x0F, 0xC1, 0x24, 0x19, 0x66, 0xC1, 0x35,
7637 0x58, 0xBE, 0x02, 0x20, 0x41, 0xE8, 0xB2, 0x8E, 0xE0, 0x83,
7638 0xFB, 0xB8, 0x4C, 0x25, 0xA8, 0x90, 0xFF, 0x23, 0xF0, 0xBC,
7639 0x24, 0x96, 0xBE, 0x3E, 0x08, 0x5A, 0x46, 0x85, 0x4E, 0x0D,
7640 0x12, 0xF7, 0x27, 0x3E, 0x5D, 0x86
7641 };
7642 static const int sizeof_cliecc_cert_der_256 = sizeof(cliecc_cert_der_256);
7643
7644 /* ./certs/ecc-key.der, ECC */
7645 static const unsigned char ecc_key_der_256[] =
7646 {
7647 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x45, 0xB6, 0x69,
7648 0x02, 0x73, 0x9C, 0x6C, 0x85, 0xA1, 0x38, 0x5B, 0x72, 0xE8,
7649 0xE8, 0xC7, 0xAC, 0xC4, 0x03, 0x8D, 0x53, 0x35, 0x04, 0xFA,
7650 0x6C, 0x28, 0xDC, 0x34, 0x8D, 0xE1, 0xA8, 0x09, 0x8C, 0xA0,
7651 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01,
7652 0x07, 0xA1, 0x44, 0x03, 0x42, 0x00, 0x04, 0xBB, 0x33, 0xAC,
7653 0x4C, 0x27, 0x50, 0x4A, 0xC6, 0x4A, 0xA5, 0x04, 0xC3, 0x3C,
7654 0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D, 0xCE, 0x94, 0xEA, 0x2B,
7655 0xFA, 0xCB, 0x20, 0x09, 0x39, 0x2C, 0x16, 0xE8, 0x61, 0x02,
7656 0xE9, 0xAF, 0x4D, 0xD3, 0x02, 0x93, 0x9A, 0x31, 0x5B, 0x97,
7657 0x92, 0x21, 0x7F, 0xF0, 0xCF, 0x18, 0xDA, 0x91, 0x11, 0x02,
7658 0x34, 0x86, 0xE8, 0x20, 0x58, 0x33, 0x0B, 0x80, 0x34, 0x89,
7659 0xD8
7660 };
7661 static const int sizeof_ecc_key_der_256 = sizeof(ecc_key_der_256);
7662
7663 /* ./certs/ecc-keyPub.der, ECC */
7664 static const unsigned char ecc_key_pub_der_256[] =
7665 {
7666 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE,
7667 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D,
7668 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xBB, 0x33, 0xAC,
7669 0x4C, 0x27, 0x50, 0x4A, 0xC6, 0x4A, 0xA5, 0x04, 0xC3, 0x3C,
7670 0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D, 0xCE, 0x94, 0xEA, 0x2B,
7671 0xFA, 0xCB, 0x20, 0x09, 0x39, 0x2C, 0x16, 0xE8, 0x61, 0x02,
7672 0xE9, 0xAF, 0x4D, 0xD3, 0x02, 0x93, 0x9A, 0x31, 0x5B, 0x97,
7673 0x92, 0x21, 0x7F, 0xF0, 0xCF, 0x18, 0xDA, 0x91, 0x11, 0x02,
7674 0x34, 0x86, 0xE8, 0x20, 0x58, 0x33, 0x0B, 0x80, 0x34, 0x89,
7675 0xD8
7676 };
7677 static const int sizeof_ecc_key_pub_der_256 = sizeof(ecc_key_pub_der_256);
7678
7679 /* ./certs/server-ecc-comp.der, ECC */
7680 static const unsigned char serv_ecc_comp_der_256[] =
7681 {
7682 0x30, 0x82, 0x03, 0x77, 0x30, 0x82, 0x03, 0x1D, 0xA0, 0x03,

NetBurner, Inc.
1182 File Documentation

7683 0x02, 0x01, 0x02, 0x02, 0x14, 0x02, 0x9B, 0x25, 0x1A, 0x89,
7684 0xE0, 0x61, 0xBB, 0x02, 0x0B, 0x03, 0xAD, 0x40, 0x9F, 0x1B,
7685 0xFC, 0x54, 0x46, 0x7B, 0x08, 0x30, 0x0A, 0x06, 0x08, 0x2A,
7686 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x81, 0xA0,
7687 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
7688 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
7689 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E,
7690 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07,
7691 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31,
7692 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0F,
7693 0x45, 0x6C, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x20, 0x2D,
7694 0x20, 0x63, 0x6F, 0x6D, 0x70, 0x31, 0x18, 0x30, 0x16, 0x06,
7695 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0F, 0x53, 0x65, 0x72, 0x76,
7696 0x65, 0x72, 0x20, 0x45, 0x43, 0x43, 0x2D, 0x63, 0x6F, 0x6D,
7697 0x70, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03,
7698 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66,
7699 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30,
7700 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
7701 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
7702 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
7703 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31, 0x35,
7704 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D, 0x32,
7705 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30, 0x32,
7706 0x34, 0x5A, 0x30, 0x81, 0xA0, 0x31, 0x0B, 0x30, 0x09, 0x06,
7707 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10,
7708 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D,
7709 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E,
7710 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A,
7711 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03,
7712 0x55, 0x04, 0x0A, 0x0C, 0x0F, 0x45, 0x6C, 0x6C, 0x69, 0x70,
7713 0x74, 0x69, 0x63, 0x20, 0x2D, 0x20, 0x63, 0x6F, 0x6D, 0x70,
7714 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C,
7715 0x0F, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x45, 0x43,
7716 0x43, 0x2D, 0x63, 0x6F, 0x6D, 0x70, 0x31, 0x18, 0x30, 0x16,
7717 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77,
7718 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63,
7719 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86,
7720 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69,
7721 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73,
7722 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x39, 0x30, 0x13, 0x06,
7723 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08,
7724 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x22,
7725 0x00, 0x02, 0xBB, 0x33, 0xAC, 0x4C, 0x27, 0x50, 0x4A, 0xC6,
7726 0x4A, 0xA5, 0x04, 0xC3, 0x3C, 0xDE, 0x9F, 0x36, 0xDB, 0x72,
7727 0x2D, 0xCE, 0x94, 0xEA, 0x2B, 0xFA, 0xCB, 0x20, 0x09, 0x39,
7728 0x2C, 0x16, 0xE8, 0x61, 0xA3, 0x82, 0x01, 0x51, 0x30, 0x82,
7729 0x01, 0x4D, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04,
7730 0x16, 0x04, 0x14, 0x8C, 0x38, 0x3A, 0x6B, 0xB8, 0x24, 0xB7,
7731 0xDF, 0x6E, 0xF4, 0x59, 0xAC, 0x56, 0x4E, 0xAA, 0xE2, 0x58,
7732 0xA6, 0x5A, 0x18, 0x30, 0x81, 0xE0, 0x06, 0x03, 0x55, 0x1D,
7733 0x23, 0x04, 0x81, 0xD8, 0x30, 0x81, 0xD5, 0x80, 0x14, 0x8C,
7734 0x38, 0x3A, 0x6B, 0xB8, 0x24, 0xB7, 0xDF, 0x6E, 0xF4, 0x59,
7735 0xAC, 0x56, 0x4E, 0xAA, 0xE2, 0x58, 0xA6, 0x5A, 0x18, 0xA1,
7736 0x81, 0xA6, 0xA4, 0x81, 0xA3, 0x30, 0x81, 0xA0, 0x31, 0x0B,
7737 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
7738 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08,
7739 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31,
7740 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07,
7741 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30,
7742 0x16, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0F, 0x45, 0x6C,
7743 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x20, 0x2D, 0x20, 0x63,
7744 0x6F, 0x6D, 0x70, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55,
7745 0x04, 0x0B, 0x0C, 0x0F, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
7746 0x20, 0x45, 0x43, 0x43, 0x2D, 0x63, 0x6F, 0x6D, 0x70, 0x31,
7747 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F,
7748 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73,
7749 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06,
7750 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01,
7751 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C,
7752 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14,
7753 0x02, 0x9B, 0x25, 0x1A, 0x89, 0xE0, 0x61, 0xBB, 0x02, 0x0B,
7754 0x03, 0xAD, 0x40, 0x9F, 0x1B, 0xFC, 0x54, 0x46, 0x7B, 0x08,
7755 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30,
7756 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x1D,
7757 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65, 0x78, 0x61,
7758 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x87, 0x04,
7759 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
7760 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, 0x01,
7761 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01,
7762 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x0A, 0x06, 0x08, 0x2A,
7763 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00,
7764 0x30, 0x45, 0x02, 0x21, 0x00, 0x9D, 0x4E, 0x4C, 0x4D, 0xE5,
7765 0xA4, 0xB6, 0x73, 0x92, 0xC7, 0xC8, 0x2B, 0x69, 0x89, 0x29,
7766 0x97, 0x30, 0x19, 0x92, 0xD9, 0x47, 0xB2, 0x9B, 0x56, 0x9F,
7767 0x0B, 0xEC, 0xBA, 0xEC, 0xFC, 0x95, 0x45, 0x02, 0x20, 0x4F,
7768 0x50, 0x56, 0x5B, 0x50, 0xB2, 0x33, 0x2C, 0xCA, 0xB9, 0xCB,
7769 0x78, 0xD6, 0x58, 0x33, 0xA3, 0x51, 0xAC, 0xBB, 0x4F, 0x96,

NetBurner, Inc.
22.205 certs_test.h 1183

7770 0x57, 0x30, 0x1A, 0xB0, 0xE1, 0xA2, 0xF2, 0xF8, 0xAA, 0xBB,
7771 0x7B
7772 };
7773 static const int sizeof_serv_ecc_comp_der_256 = sizeof(serv_ecc_comp_der_256);
7774
7775 /* ./certs/server-ecc-rsa.der, ECC */
7776 static const unsigned char serv_ecc_rsa_der_256[] =
7777 {
7778 0x30, 0x82, 0x04, 0x2A, 0x30, 0x82, 0x03, 0x12, 0xA0, 0x03,
7779 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x0D, 0x06, 0x09,
7780 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05,
7781 0x00, 0x30, 0x81, 0x94, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03,
7782 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30,
7783 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F,
7784 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06,
7785 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65,
7786 0x6D, 0x61, 0x6E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55,
7787 0x04, 0x0A, 0x0C, 0x08, 0x53, 0x61, 0x77, 0x74, 0x6F, 0x6F,
7788 0x74, 0x68, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
7789 0x0B, 0x0C, 0x0A, 0x43, 0x6F, 0x6E, 0x73, 0x75, 0x6C, 0x74,
7790 0x69, 0x6E, 0x67, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55,
7791 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F,
7792 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31,
7793 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
7794 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F,
7795 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63,
7796 0x6F, 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32,
7797 0x31, 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17,
7798 0x0D, 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35,
7799 0x30, 0x32, 0x34, 0x5A, 0x30, 0x81, 0x9D, 0x31, 0x0B, 0x30,
7800 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
7801 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C,
7802 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10,
7803 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42,
7804 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x1A, 0x30, 0x18,
7805 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x11, 0x45, 0x6C, 0x6C,
7806 0x69, 0x70, 0x74, 0x69, 0x63, 0x20, 0x2D, 0x20, 0x52, 0x53,
7807 0x41, 0x73, 0x69, 0x67, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
7808 0x55, 0x04, 0x0B, 0x0C, 0x0A, 0x45, 0x43, 0x43, 0x2D, 0x52,
7809 0x53, 0x41, 0x73, 0x69, 0x67, 0x31, 0x18, 0x30, 0x16, 0x06,
7810 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
7811 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
7812 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
7813 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
7814 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
7815 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07,
7816 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A,
7817 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00,
7818 0x04, 0xBB, 0x33, 0xAC, 0x4C, 0x27, 0x50, 0x4A, 0xC6, 0x4A,
7819 0xA5, 0x04, 0xC3, 0x3C, 0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D,
7820 0xCE, 0x94, 0xEA, 0x2B, 0xFA, 0xCB, 0x20, 0x09, 0x39, 0x2C,
7821 0x16, 0xE8, 0x61, 0x02, 0xE9, 0xAF, 0x4D, 0xD3, 0x02, 0x93,
7822 0x9A, 0x31, 0x5B, 0x97, 0x92, 0x21, 0x7F, 0xF0, 0xCF, 0x18,
7823 0xDA, 0x91, 0x11, 0x02, 0x34, 0x86, 0xE8, 0x20, 0x58, 0x33,
7824 0x0B, 0x80, 0x34, 0x89, 0xD8, 0xA3, 0x82, 0x01, 0x45, 0x30,
7825 0x82, 0x01, 0x41, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E,
7826 0x04, 0x16, 0x04, 0x14, 0x5D, 0x5D, 0x26, 0xEF, 0xAC, 0x7E,
7827 0x36, 0xF9, 0x9B, 0x76, 0x15, 0x2B, 0x4A, 0x25, 0x02, 0x23,
7828 0xEF, 0xB2, 0x89, 0x30, 0x30, 0x81, 0xD4, 0x06, 0x03, 0x55,
7829 0x1D, 0x23, 0x04, 0x81, 0xCC, 0x30, 0x81, 0xC9, 0x80, 0x14,
7830 0x27, 0x8E, 0x67, 0x11, 0x74, 0xC3, 0x26, 0x1D, 0x3F, 0xED,
7831 0x33, 0x63, 0xB3, 0xA4, 0xD8, 0x1D, 0x30, 0xE5, 0xE8, 0xD5,
7832 0xA1, 0x81, 0x9A, 0xA4, 0x81, 0x97, 0x30, 0x81, 0x94, 0x31,
7833 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
7834 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04,
7835 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61,
7836 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C,
7837 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x11,
7838 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x08, 0x53,
7839 0x61, 0x77, 0x74, 0x6F, 0x6F, 0x74, 0x68, 0x31, 0x13, 0x30,
7840 0x11, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0A, 0x43, 0x6F,
7841 0x6E, 0x73, 0x75, 0x6C, 0x74, 0x69, 0x6E, 0x67, 0x31, 0x18,
7842 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77,
7843 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
7844 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09,
7845 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16,
7846 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66,
7847 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x82, 0x14, 0x26,
7848 0x8C, 0x93, 0xF9, 0xF9, 0xF4, 0x1E, 0xB3, 0x01, 0x72, 0x94,
7849 0x55, 0x67, 0x6D, 0xE2, 0xF8, 0x3D, 0xDA, 0xE9, 0xF4, 0x30,
7850 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x05, 0x30, 0x03,
7851 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03, 0x55, 0x1D, 0x11,
7852 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65, 0x78, 0x61, 0x6D,
7853 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D, 0x87, 0x04, 0x7F,
7854 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x25,
7855 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05,
7856 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05,

NetBurner, Inc.
1184 File Documentation

7857 0x05, 0x07, 0x03, 0x02, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86,
7858 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03,
7859 0x82, 0x01, 0x01, 0x00, 0x24, 0x9C, 0x9A, 0xB4, 0x89, 0xA3,
7860 0x91, 0xE5, 0xA3, 0x49, 0x2F, 0x31, 0xA3, 0xD3, 0x0D, 0xFC,
7861 0x75, 0xD8, 0x56, 0xA6, 0x61, 0x5B, 0x2F, 0x9D, 0x23, 0xFF,
7862 0xAC, 0x5C, 0x49, 0x55, 0x41, 0xD6, 0xCE, 0xEC, 0xC2, 0xCA,
7863 0x6C, 0x6C, 0x6E, 0x10, 0x73, 0xC7, 0xE5, 0x9C, 0x51, 0x29,
7864 0xF8, 0x00, 0xC7, 0x2B, 0x69, 0xB3, 0xE4, 0x0B, 0xE8, 0x68,
7865 0xC7, 0x92, 0x4E, 0xDA, 0xEE, 0x1F, 0xC1, 0x6E, 0x98, 0x63,
7866 0xEA, 0x6E, 0xAE, 0x79, 0x7C, 0xF1, 0x45, 0x07, 0xBA, 0xA9,
7867 0xFD, 0xEE, 0x46, 0x2E, 0xB5, 0xFC, 0x6F, 0x83, 0x14, 0x63,
7868 0xB9, 0x31, 0x99, 0xB4, 0xF7, 0xB2, 0x38, 0x6B, 0x53, 0xD9,
7869 0x29, 0x24, 0xE5, 0x0F, 0xA3, 0x5A, 0x48, 0xD9, 0x07, 0x8E,
7870 0xB6, 0xFE, 0xC3, 0x75, 0xCF, 0x21, 0xC6, 0xB4, 0x0A, 0x9F,
7871 0xD3, 0xE5, 0xD5, 0xAE, 0xA9, 0xC0, 0x1C, 0x2D, 0x64, 0x1C,
7872 0x6B, 0x77, 0x50, 0x75, 0x7D, 0x54, 0x65, 0x52, 0x24, 0x95,
7873 0x25, 0x94, 0xCB, 0xC4, 0x26, 0x98, 0x86, 0xE0, 0x40, 0x42,
7874 0x6E, 0x14, 0x22, 0xA1, 0xCC, 0x4A, 0xA6, 0xE8, 0x13, 0x3A,
7875 0x66, 0xDF, 0x9E, 0xDA, 0xEA, 0x4E, 0xC3, 0x09, 0x20, 0x87,
7876 0x9A, 0x32, 0x86, 0xD5, 0x18, 0xFA, 0x01, 0x39, 0x0B, 0xEC,
7877 0x14, 0x07, 0x2E, 0x15, 0xDC, 0x61, 0x4E, 0xA8, 0xC8, 0xD6,
7878 0xD5, 0xC4, 0xD0, 0xE7, 0xCD, 0xED, 0x33, 0xB8, 0x29, 0xF2,
7879 0xE0, 0xE8, 0x5E, 0x3B, 0xFC, 0xA2, 0xC9, 0x49, 0xB2, 0xF5,
7880 0x54, 0x0D, 0x38, 0x6F, 0x32, 0xB5, 0xD1, 0x94, 0x9D, 0xCD,
7881 0x2F, 0x58, 0x20, 0xCF, 0x41, 0x74, 0xE3, 0xE1, 0xBC, 0x74,
7882 0x7B, 0xBB, 0xEB, 0x5A, 0x5E, 0x70, 0xD9, 0x1B, 0x20, 0x64,
7883 0x58, 0x3E, 0x42, 0x68, 0x5B, 0xD3, 0x52, 0xDB, 0xFA, 0x82,
7884 0x8D, 0x6F, 0xF2, 0x02, 0x60, 0xE3, 0xE3, 0x93, 0x76, 0xC6
7885
7886 };
7887 static const int sizeof_serv_ecc_rsa_der_256 = sizeof(serv_ecc_rsa_der_256);
7888
7889 /* ./certs/server-ecc.der, ECC */
7890 static const unsigned char serv_ecc_der_256[] =
7891 {
7892 0x30, 0x82, 0x02, 0xA1, 0x30, 0x82, 0x02, 0x47, 0xA0, 0x03,
7893 0x02, 0x01, 0x02, 0x02, 0x01, 0x03, 0x30, 0x0A, 0x06, 0x08,
7894 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x81,
7895 0x97, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
7896 0x13, 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03,
7897 0x55, 0x04, 0x08, 0x0C, 0x0A, 0x57, 0x61, 0x73, 0x68, 0x69,
7898 0x6E, 0x67, 0x74, 0x6F, 0x6E, 0x31, 0x10, 0x30, 0x0E, 0x06,
7899 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74,
7900 0x74, 0x6C, 0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55,
7901 0x04, 0x0A, 0x0C, 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53,
7902 0x4C, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0B,
7903 0x0C, 0x0B, 0x44, 0x65, 0x76, 0x65, 0x6C, 0x6F, 0x70, 0x6D,
7904 0x65, 0x6E, 0x74, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55,
7905 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F,
7906 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31,
7907 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7,
7908 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F,
7909 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63,
7910 0x6F, 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32,
7911 0x31, 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17,
7912 0x0D, 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35,
7913 0x30, 0x32, 0x34, 0x5A, 0x30, 0x81, 0x8F, 0x31, 0x0B, 0x30,
7914 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53,
7915 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C,
7916 0x0A, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F,
7917 0x6E, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07,
7918 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74, 0x74, 0x6C, 0x65, 0x31,
7919 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x07,
7920 0x45, 0x6C, 0x69, 0x70, 0x74, 0x69, 0x63, 0x31, 0x0C, 0x30,
7921 0x0A, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x03, 0x45, 0x43,
7922 0x43, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03,
7923 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66,
7924 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30,
7925 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
7926 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
7927 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
7928 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE,
7929 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D,
7930 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0xBB, 0x33, 0xAC,
7931 0x4C, 0x27, 0x50, 0x4A, 0xC6, 0x4A, 0xA5, 0x04, 0xC3, 0x3C,
7932 0xDE, 0x9F, 0x36, 0xDB, 0x72, 0x2D, 0xCE, 0x94, 0xEA, 0x2B,
7933 0xFA, 0xCB, 0x20, 0x09, 0x39, 0x2C, 0x16, 0xE8, 0x61, 0x02,
7934 0xE9, 0xAF, 0x4D, 0xD3, 0x02, 0x93, 0x9A, 0x31, 0x5B, 0x97,
7935 0x92, 0x21, 0x7F, 0xF0, 0xCF, 0x18, 0xDA, 0x91, 0x11, 0x02,
7936 0x34, 0x86, 0xE8, 0x20, 0x58, 0x33, 0x0B, 0x80, 0x34, 0x89,
7937 0xD8, 0xA3, 0x81, 0x89, 0x30, 0x81, 0x86, 0x30, 0x1D, 0x06,
7938 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0x5D, 0x5D,
7939 0x26, 0xEF, 0xAC, 0x7E, 0x36, 0xF9, 0x9B, 0x76, 0x15, 0x2B,
7940 0x4A, 0x25, 0x02, 0x23, 0xEF, 0xB2, 0x89, 0x30, 0x30, 0x1F,
7941 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80,
7942 0x14, 0x56, 0x8E, 0x9A, 0xC3, 0xF0, 0x42, 0xDE, 0x18, 0xB9,
7943 0x45, 0x55, 0x6E, 0xF9, 0x93, 0xCF, 0xEA, 0xC3, 0xF3, 0xA5,

NetBurner, Inc.
22.205 certs_test.h 1185

7944 0x21, 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x01, 0x01,
7945 0xFF, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0E, 0x06, 0x03, 0x55,
7946 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03, 0x02, 0x03,
7947 0xA8, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x0C,
7948 0x30, 0x0A, 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07,
7949 0x03, 0x01, 0x30, 0x11, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
7950 0x86, 0xF8, 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x06,
7951 0x40, 0x30, 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D,
7952 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x20,
7953 0x5B, 0x9D, 0xF4, 0x69, 0x17, 0x88, 0xC0, 0x13, 0x34, 0x3D,
7954 0x81, 0x81, 0xDC, 0xFB, 0x27, 0x7C, 0xA0, 0x63, 0x00, 0x87,
7955 0xD5, 0x48, 0xE1, 0x9C, 0x57, 0xC9, 0x01, 0xC1, 0xD2, 0x5F,
7956 0x30, 0x58, 0x02, 0x21, 0x00, 0x89, 0x93, 0xA5, 0xB6, 0x04,
7957 0xDE, 0x4D, 0x3D, 0x98, 0xED, 0x0B, 0xCE, 0x3A, 0x74, 0x3E,
7958 0x6C, 0xF1, 0x80, 0x1F, 0x28, 0xD8, 0xEE, 0x78, 0xAF, 0xDA,
7959 0x8A, 0x3B, 0xB4, 0x27, 0x38, 0xE2, 0xB1
7960 };
7961 static const int sizeof_serv_ecc_der_256 = sizeof(serv_ecc_der_256);
7962
7963 /* ./certs/ca-ecc-key.der, ECC */
7964 static const unsigned char ca_ecc_key_der_256[] =
7965 {
7966 0x30, 0x77, 0x02, 0x01, 0x01, 0x04, 0x20, 0x02, 0xE1, 0x33,
7967 0x98, 0x77, 0x97, 0xAC, 0x4A, 0x59, 0x6D, 0x28, 0x9B, 0x6E,
7968 0xA0, 0x93, 0x9B, 0x07, 0x71, 0x8B, 0x4D, 0x60, 0x63, 0x85,
7969 0x99, 0xE6, 0xBB, 0x16, 0x70, 0xE9, 0x0A, 0xF6, 0x80, 0xA0,
7970 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01,
7971 0x07, 0xA1, 0x44, 0x03, 0x42, 0x00, 0x04, 0x02, 0xD3, 0xD9,
7972 0x6E, 0xD6, 0x01, 0x8E, 0x45, 0xC8, 0xB9, 0x90, 0x31, 0xE5,
7973 0xC0, 0x4C, 0xE3, 0x9E, 0xAD, 0x29, 0x38, 0x98, 0xBA, 0x10,
7974 0xD6, 0xE9, 0x09, 0x2A, 0x80, 0xA9, 0x2E, 0x17, 0x2A, 0xB9,
7975 0x8A, 0xBF, 0x33, 0x83, 0x46, 0xE3, 0x95, 0x0B, 0xE4, 0x77,
7976 0x40, 0xB5, 0x3B, 0x43, 0x45, 0x33, 0x0F, 0x61, 0x53, 0x7C,
7977 0x37, 0x44, 0xC1, 0xCB, 0xFC, 0x80, 0xCA, 0xE8, 0x43, 0xEA,
7978 0xA7
7979 };
7980 static const int sizeof_ca_ecc_key_der_256 = sizeof(ca_ecc_key_der_256);
7981
7982 /* ./certs/ca-ecc-cert.der, ECC */
7983 static const unsigned char ca_ecc_cert_der_256[] =
7984 {
7985 0x30, 0x82, 0x02, 0x94, 0x30, 0x82, 0x02, 0x3B, 0xA0, 0x03,
7986 0x02, 0x01, 0x02, 0x02, 0x14, 0x29, 0xBF, 0x2B, 0xCD, 0xBF,
7987 0x55, 0x54, 0x49, 0x85, 0xB3, 0x69, 0x4E, 0xE1, 0x85, 0x37,
7988 0x79, 0x1E, 0x81, 0xF9, 0xC2, 0x30, 0x0A, 0x06, 0x08, 0x2A,
7989 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x02, 0x30, 0x81, 0x97,
7990 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
7991 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
7992 0x04, 0x08, 0x0C, 0x0A, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6E,
7993 0x67, 0x74, 0x6F, 0x6E, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
7994 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74, 0x74,
7995 0x6C, 0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04,
7996 0x0A, 0x0C, 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C,
7997 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C,
7998 0x0B, 0x44, 0x65, 0x76, 0x65, 0x6C, 0x6F, 0x70, 0x6D, 0x65,
7999 0x6E, 0x74, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
8000 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
8001 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
8002 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
8003 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
8004 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
8005 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
8006 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
8007 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
8008 0x32, 0x34, 0x5A, 0x30, 0x81, 0x97, 0x31, 0x0B, 0x30, 0x09,
8009 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
8010 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A,
8011 0x57, 0x61, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E,
8012 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C,
8013 0x07, 0x53, 0x65, 0x61, 0x74, 0x74, 0x6C, 0x65, 0x31, 0x10,
8014 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x07, 0x77,
8015 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x31, 0x14, 0x30, 0x12,
8016 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0B, 0x44, 0x65, 0x76,
8017 0x65, 0x6C, 0x6F, 0x70, 0x6D, 0x65, 0x6E, 0x74, 0x31, 0x18,
8018 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77,
8019 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
8020 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09,
8021 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16,
8022 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66,
8023 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x59, 0x30,
8024 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01,
8025 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07,
8026 0x03, 0x42, 0x00, 0x04, 0x02, 0xD3, 0xD9, 0x6E, 0xD6, 0x01,
8027 0x8E, 0x45, 0xC8, 0xB9, 0x90, 0x31, 0xE5, 0xC0, 0x4C, 0xE3,
8028 0x9E, 0xAD, 0x29, 0x38, 0x98, 0xBA, 0x10, 0xD6, 0xE9, 0x09,
8029 0x2A, 0x80, 0xA9, 0x2E, 0x17, 0x2A, 0xB9, 0x8A, 0xBF, 0x33,
8030 0x83, 0x46, 0xE3, 0x95, 0x0B, 0xE4, 0x77, 0x40, 0xB5, 0x3B,

NetBurner, Inc.
1186 File Documentation

8031 0x43, 0x45, 0x33, 0x0F, 0x61, 0x53, 0x7C, 0x37, 0x44, 0xC1,
8032 0xCB, 0xFC, 0x80, 0xCA, 0xE8, 0x43, 0xEA, 0xA7, 0xA3, 0x63,
8033 0x30, 0x61, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04,
8034 0x16, 0x04, 0x14, 0x56, 0x8E, 0x9A, 0xC3, 0xF0, 0x42, 0xDE,
8035 0x18, 0xB9, 0x45, 0x55, 0x6E, 0xF9, 0x93, 0xCF, 0xEA, 0xC3,
8036 0xF3, 0xA5, 0x21, 0x30, 0x1F, 0x06, 0x03, 0x55, 0x1D, 0x23,
8037 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x56, 0x8E, 0x9A, 0xC3,
8038 0xF0, 0x42, 0xDE, 0x18, 0xB9, 0x45, 0x55, 0x6E, 0xF9, 0x93,
8039 0xCF, 0xEA, 0xC3, 0xF3, 0xA5, 0x21, 0x30, 0x0F, 0x06, 0x03,
8040 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04, 0x05, 0x30, 0x03,
8041 0x01, 0x01, 0xFF, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x1D, 0x0F,
8042 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30,
8043 0x0A, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03,
8044 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x78, 0xED,
8045 0x4C, 0x1C, 0xA7, 0x2D, 0xB3, 0x35, 0x0B, 0x1D, 0x46, 0xA3,
8046 0x37, 0x31, 0x0B, 0x8A, 0x05, 0x39, 0xC8, 0x28, 0x31, 0x58,
8047 0x35, 0xF1, 0x98, 0xF7, 0x4B, 0x72, 0xC0, 0x4F, 0xE6, 0x7F,
8048 0x02, 0x20, 0x02, 0xF2, 0x09, 0x2B, 0x3A, 0xE1, 0x36, 0x92,
8049 0xBF, 0x58, 0x6A, 0x03, 0x12, 0x2D, 0x79, 0xE6, 0xBD, 0x06,
8050 0x45, 0x61, 0xB9, 0x0E, 0x39, 0xE1, 0x9C, 0xF0, 0xA8, 0x2E,
8051 0x0B, 0x1E, 0x8C, 0xB2
8052 };
8053 static const int sizeof_ca_ecc_cert_der_256 = sizeof(ca_ecc_cert_der_256);
8054
8055 /* ./certs/ca-ecc384-key.der, ECC */
8056 static const unsigned char ca_ecc_key_der_384[] =
8057 {
8058 0x30, 0x81, 0xA4, 0x02, 0x01, 0x01, 0x04, 0x30, 0x7B, 0x16,
8059 0xE3, 0xD6, 0xD2, 0x81, 0x94, 0x6C, 0x8A, 0xDD, 0xA8, 0x78,
8060 0xEE, 0xC7, 0x7E, 0xB3, 0xC5, 0xD1, 0xDB, 0x2E, 0xF3, 0xED,
8061 0x0E, 0x48, 0x85, 0xB1, 0xF2, 0xE1, 0x7A, 0x39, 0x56, 0xC0,
8062 0xF1, 0x62, 0x12, 0x0F, 0x35, 0xB7, 0x39, 0xBC, 0x9C, 0x25,
8063 0xC0, 0x76, 0xEB, 0xFE, 0x55, 0x70, 0xA0, 0x07, 0x06, 0x05,
8064 0x2B, 0x81, 0x04, 0x00, 0x22, 0xA1, 0x64, 0x03, 0x62, 0x00,
8065 0x04, 0xEE, 0x82, 0xD4, 0x39, 0x9A, 0xB1, 0x27, 0x82, 0xF4,
8066 0xD7, 0xEA, 0xC6, 0xBC, 0x03, 0x1D, 0x4D, 0x83, 0x61, 0xF4,
8067 0x03, 0xAE, 0x7E, 0xBD, 0xD8, 0x5A, 0xA5, 0xB9, 0xF0, 0x8E,
8068 0xA2, 0xA5, 0xDA, 0xCE, 0x87, 0x3B, 0x5A, 0xAB, 0x44, 0x16,
8069 0x9C, 0xF5, 0x9F, 0x62, 0xDD, 0xF6, 0x20, 0xCD, 0x9C, 0x76,
8070 0x3C, 0x40, 0xB1, 0x3F, 0x97, 0x17, 0xDF, 0x59, 0xF6, 0xCD,
8071 0xDE, 0xCD, 0x46, 0x35, 0xC0, 0xED, 0x5E, 0x2E, 0x48, 0xB6,
8072 0x66, 0x91, 0x71, 0x74, 0xB7, 0x0C, 0x3F, 0xB9, 0x9A, 0xB7,
8073 0x83, 0xBD, 0x93, 0x3F, 0x5F, 0x50, 0x2D, 0x70, 0x3F, 0xDE,
8074 0x35, 0x25, 0xE1, 0x90, 0x3B, 0x86, 0xE0
8075 };
8076 static const int sizeof_ca_ecc_key_der_384 = sizeof(ca_ecc_key_der_384);
8077
8078 /* ./certs/ca-ecc384-cert.der, ECC */
8079 static const unsigned char ca_ecc_cert_der_384[] =
8080 {
8081 0x30, 0x82, 0x02, 0xD3, 0x30, 0x82, 0x02, 0x58, 0xA0, 0x03,
8082 0x02, 0x01, 0x02, 0x02, 0x14, 0x67, 0xA7, 0x7B, 0x83, 0x4D,
8083 0x94, 0xC2, 0x18, 0x53, 0x0E, 0x0C, 0x98, 0x82, 0xC2, 0xA2,
8084 0x5D, 0x9E, 0x3D, 0xCD, 0xB6, 0x30, 0x0A, 0x06, 0x08, 0x2A,
8085 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03, 0x30, 0x81, 0x97,
8086 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
8087 0x02, 0x55, 0x53, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
8088 0x04, 0x08, 0x0C, 0x0A, 0x57, 0x61, 0x73, 0x68, 0x69, 0x6E,
8089 0x67, 0x74, 0x6F, 0x6E, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
8090 0x55, 0x04, 0x07, 0x0C, 0x07, 0x53, 0x65, 0x61, 0x74, 0x74,
8091 0x6C, 0x65, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04,
8092 0x0A, 0x0C, 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C,
8093 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C,
8094 0x0B, 0x44, 0x65, 0x76, 0x65, 0x6C, 0x6F, 0x70, 0x6D, 0x65,
8095 0x6E, 0x74, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
8096 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
8097 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
8098 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
8099 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
8100 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
8101 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31,
8102 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D,
8103 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30,
8104 0x32, 0x34, 0x5A, 0x30, 0x81, 0x97, 0x31, 0x0B, 0x30, 0x09,
8105 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
8106 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x0A,
8107 0x57, 0x61, 0x73, 0x68, 0x69, 0x6E, 0x67, 0x74, 0x6F, 0x6E,
8108 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C,
8109 0x07, 0x53, 0x65, 0x61, 0x74, 0x74, 0x6C, 0x65, 0x31, 0x10,
8110 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x07, 0x77,
8111 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x31, 0x14, 0x30, 0x12,
8112 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0B, 0x44, 0x65, 0x76,
8113 0x65, 0x6C, 0x6F, 0x70, 0x6D, 0x65, 0x6E, 0x74, 0x31, 0x18,
8114 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77,
8115 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
8116 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09,
8117 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16,

NetBurner, Inc.
22.205 certs_test.h 1187

8118 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66,
8119 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x76, 0x30,
8120 0x10, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01,
8121 0x06, 0x05, 0x2B, 0x81, 0x04, 0x00, 0x22, 0x03, 0x62, 0x00,
8122 0x04, 0xEE, 0x82, 0xD4, 0x39, 0x9A, 0xB1, 0x27, 0x82, 0xF4,
8123 0xD7, 0xEA, 0xC6, 0xBC, 0x03, 0x1D, 0x4D, 0x83, 0x61, 0xF4,
8124 0x03, 0xAE, 0x7E, 0xBD, 0xD8, 0x5A, 0xA5, 0xB9, 0xF0, 0x8E,
8125 0xA2, 0xA5, 0xDA, 0xCE, 0x87, 0x3B, 0x5A, 0xAB, 0x44, 0x16,
8126 0x9C, 0xF5, 0x9F, 0x62, 0xDD, 0xF6, 0x20, 0xCD, 0x9C, 0x76,
8127 0x3C, 0x40, 0xB1, 0x3F, 0x97, 0x17, 0xDF, 0x59, 0xF6, 0xCD,
8128 0xDE, 0xCD, 0x46, 0x35, 0xC0, 0xED, 0x5E, 0x2E, 0x48, 0xB6,
8129 0x66, 0x91, 0x71, 0x74, 0xB7, 0x0C, 0x3F, 0xB9, 0x9A, 0xB7,
8130 0x83, 0xBD, 0x93, 0x3F, 0x5F, 0x50, 0x2D, 0x70, 0x3F, 0xDE,
8131 0x35, 0x25, 0xE1, 0x90, 0x3B, 0x86, 0xE0, 0xA3, 0x63, 0x30,
8132 0x61, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16,
8133 0x04, 0x14, 0xAB, 0xE0, 0xC3, 0x26, 0x4C, 0x18, 0xD4, 0x72,
8134 0xBB, 0xD2, 0x84, 0x8C, 0x9C, 0x0A, 0x05, 0x92, 0x80, 0x12,
8135 0x53, 0x52, 0x30, 0x1F, 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04,
8136 0x18, 0x30, 0x16, 0x80, 0x14, 0xAB, 0xE0, 0xC3, 0x26, 0x4C,
8137 0x18, 0xD4, 0x72, 0xBB, 0xD2, 0x84, 0x8C, 0x9C, 0x0A, 0x05,
8138 0x92, 0x80, 0x12, 0x53, 0x52, 0x30, 0x0F, 0x06, 0x03, 0x55,
8139 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04, 0x05, 0x30, 0x03, 0x01,
8140 0x01, 0xFF, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01,
8141 0x01, 0xFF, 0x04, 0x04, 0x03, 0x02, 0x01, 0x86, 0x30, 0x0A,
8142 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x04, 0x03, 0x03,
8143 0x03, 0x69, 0x00, 0x30, 0x66, 0x02, 0x31, 0x00, 0xDA, 0x8A,
8144 0xD6, 0xC6, 0x2F, 0x16, 0x82, 0x4B, 0x0B, 0xE1, 0x16, 0x58,
8145 0x2A, 0xC3, 0xF2, 0x6A, 0xC7, 0x4A, 0x68, 0x8F, 0xF8, 0xCD,
8146 0xD9, 0x90, 0x95, 0x6D, 0x0E, 0xC7, 0xE1, 0x41, 0x2B, 0xA1,
8147 0xC1, 0x79, 0x26, 0xF7, 0xBB, 0xCA, 0x40, 0xC3, 0x73, 0xD7,
8148 0x96, 0x9F, 0xE4, 0x02, 0x31, 0x33, 0x02, 0x31, 0x00, 0xB1,
8149 0xD0, 0x27, 0xDE, 0x94, 0x6B, 0x22, 0xF2, 0xD8, 0x2C, 0x14,
8150 0xA7, 0x95, 0x57, 0x9C, 0xA4, 0x08, 0xBE, 0x33, 0x46, 0x08,
8151 0x29, 0xD3, 0xA9, 0x9A, 0x48, 0x3E, 0x3B, 0xC5, 0x6F, 0x3C,
8152 0x18, 0xD5, 0x61, 0x43, 0x03, 0xFC, 0xDC, 0xB5, 0xCA, 0x01,
8153 0xC3, 0x48, 0x87, 0xE8, 0x96, 0x1F, 0x98
8154 };
8155 static const int sizeof_ca_ecc_cert_der_384 = sizeof(ca_ecc_cert_der_384);
8156
8157 #endif /* HAVE_ECC && USE_CERT_BUFFERS_256 */
8158
8159 /* dh1024 p */
8160 static const unsigned char dh_p[] =
8161 {
8162 0xE6, 0x96, 0x9D, 0x3D, 0x49, 0x5B, 0xE3, 0x2C, 0x7C, 0xF1, 0x80, 0xC3,
8163 0xBD, 0xD4, 0x79, 0x8E, 0x91, 0xB7, 0x81, 0x82, 0x51, 0xBB, 0x05, 0x5E,
8164 0x2A, 0x20, 0x64, 0x90, 0x4A, 0x79, 0xA7, 0x70, 0xFA, 0x15, 0xA2, 0x59,
8165 0xCB, 0xD5, 0x23, 0xA6, 0xA6, 0xEF, 0x09, 0xC4, 0x30, 0x48, 0xD5, 0xA2,
8166 0x2F, 0x97, 0x1F, 0x3C, 0x20, 0x12, 0x9B, 0x48, 0x00, 0x0E, 0x6E, 0xDD,
8167 0x06, 0x1C, 0xBC, 0x05, 0x3E, 0x37, 0x1D, 0x79, 0x4E, 0x53, 0x27, 0xDF,
8168 0x61, 0x1E, 0xBB, 0xBE, 0x1B, 0xAC, 0x9B, 0x5C, 0x60, 0x44, 0xCF, 0x02,
8169 0x3D, 0x76, 0xE0, 0x5E, 0xEA, 0x9B, 0xAD, 0x99, 0x1B, 0x13, 0xA6, 0x3C,
8170 0x97, 0x4E, 0x9E, 0xF1, 0x83, 0x9E, 0xB5, 0xDB, 0x12, 0x51, 0x36, 0xF7,
8171 0x26, 0x2E, 0x56, 0xA8, 0x87, 0x15, 0x38, 0xDF, 0xD8, 0x23, 0xC6, 0x50,
8172 0x50, 0x85, 0xE2, 0x1F, 0x0D, 0xD5, 0xC8, 0x6B,
8173 };
8174
8175 /* dh1024 g */
8176 static const unsigned char dh_g[] =
8177 {
8178 0x02,
8179 };
8180
8181 #if defined(HAVE_ED25519)
8182
8183 /* ./certs/ed25519/server-ed25519.der, ED25519 */
8184 static const unsigned char server_ed25519_cert[] =
8185 {
8186 0x30, 0x82, 0x02, 0xA7, 0x30, 0x82, 0x02, 0x59, 0xA0, 0x03,
8187 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x05, 0x06, 0x03,
8188 0x2B, 0x65, 0x70, 0x30, 0x81, 0xB4, 0x31, 0x0B, 0x30, 0x09,
8189 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
8190 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
8191 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
8192 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
8193 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30, 0x16, 0x06,
8194 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0F, 0x77, 0x6F, 0x6C, 0x66,
8195 0x53, 0x53, 0x4C, 0x5F, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31,
8196 0x39, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x0B,
8197 0x0C, 0x0A, 0x43, 0x41, 0x2D, 0x65, 0x64, 0x32, 0x35, 0x35,
8198 0x31, 0x39, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04,
8199 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C,
8200 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F,
8201 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D,
8202 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40,
8203 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
8204 0x6D, 0x31, 0x17, 0x30, 0x15, 0x06, 0x0A, 0x09, 0x92, 0x26,

NetBurner, Inc.
1188 File Documentation

8205 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x01, 0x0C, 0x07, 0x77,
8206 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x30, 0x1E, 0x17, 0x0D,
8207 0x32, 0x32, 0x30, 0x32, 0x31, 0x35, 0x31, 0x32, 0x35, 0x30,
8208 0x32, 0x34, 0x5A, 0x17, 0x0D, 0x32, 0x34, 0x31, 0x31, 0x31,
8209 0x31, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x30, 0x81,
8210 0xB8, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
8211 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03,
8212 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61,
8213 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04,
8214 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E,
8215 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C,
8216 0x0F, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x5F, 0x65,
8217 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x31, 0x17, 0x30, 0x15,
8218 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0E, 0x53, 0x65, 0x72,
8219 0x76, 0x65, 0x72, 0x2D, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31,
8220 0x39, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x03,
8221 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77, 0x6F, 0x6C, 0x66,
8222 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1F, 0x30,
8223 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01,
8224 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66, 0x6F, 0x40, 0x77,
8225 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
8226 0x31, 0x17, 0x30, 0x15, 0x06, 0x0A, 0x09, 0x92, 0x26, 0x89,
8227 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x01, 0x0C, 0x07, 0x77, 0x6F,
8228 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x30, 0x2A, 0x30, 0x05, 0x06,
8229 0x03, 0x2B, 0x65, 0x70, 0x03, 0x21, 0x00, 0x23, 0xAA, 0x4D,
8230 0x60, 0x50, 0xE0, 0x13, 0xD3, 0x3A, 0xED, 0xAB, 0xF6, 0xA9,
8231 0xCC, 0x4A, 0xFE, 0xD7, 0x4D, 0x2F, 0xD2, 0x5B, 0x1A, 0x10,
8232 0x05, 0xEF, 0x5A, 0x41, 0x25, 0xCE, 0x1B, 0x53, 0x78, 0xA3,
8233 0x81, 0x89, 0x30, 0x81, 0x86, 0x30, 0x1D, 0x06, 0x03, 0x55,
8234 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0xA3, 0x29, 0x81, 0xE7,
8235 0x90, 0x6F, 0xB9, 0x60, 0xF8, 0xAF, 0xCC, 0x15, 0x7A, 0xAE,
8236 0xD7, 0xA1, 0xF4, 0xB4, 0x86, 0xBA, 0x30, 0x1F, 0x06, 0x03,
8237 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x74,
8238 0xD5, 0x38, 0x19, 0x5E, 0x83, 0xB9, 0x03, 0xF8, 0x01, 0x8A,
8239 0x35, 0x35, 0xBB, 0x89, 0x4C, 0x49, 0xB4, 0x23, 0xE9, 0x30,
8240 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04,
8241 0x02, 0x30, 0x00, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x1D, 0x0F,
8242 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03, 0x02, 0x03, 0xA8, 0x30,
8243 0x13, 0x06, 0x03, 0x55, 0x1D, 0x25, 0x04, 0x0C, 0x30, 0x0A,
8244 0x06, 0x08, 0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01,
8245 0x30, 0x11, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8,
8246 0x42, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x06, 0x40, 0x30,
8247 0x05, 0x06, 0x03, 0x2B, 0x65, 0x70, 0x03, 0x41, 0x00, 0x40,
8248 0x4C, 0x3E, 0xCD, 0x8F, 0xC0, 0x27, 0x99, 0x9D, 0x3D, 0x83,
8249 0x42, 0xD0, 0x2F, 0xD3, 0x05, 0xC5, 0x82, 0xF4, 0xF2, 0x07,
8250 0x35, 0xB9, 0xDF, 0xBA, 0xD9, 0xD2, 0xC6, 0x69, 0x52, 0x01,
8251 0x57, 0xC9, 0xE7, 0xAE, 0x80, 0x70, 0x3D, 0xA1, 0xCF, 0xFD,
8252 0x6A, 0x9C, 0xDD, 0x44, 0xE0, 0xA3, 0x26, 0x31, 0xED, 0x2C,
8253 0x0A, 0xAF, 0x26, 0xCA, 0x90, 0x6F, 0x23, 0x5E, 0x5D, 0xD4,
8254 0x14, 0xE4, 0x06
8255 };
8256 static const int sizeof_server_ed25519_cert = sizeof(server_ed25519_cert);
8257
8258 /* ./certs/ed25519/server-ed25519-key.der, ED25519 */
8259 static const unsigned char server_ed25519_key[] =
8260 {
8261 0x30, 0x2A, 0x30, 0x05, 0x06, 0x03, 0x2B, 0x65, 0x70, 0x03,
8262 0x21, 0x00, 0x23, 0xAA, 0x4D, 0x60, 0x50, 0xE0, 0x13, 0xD3,
8263 0x3A, 0xED, 0xAB, 0xF6, 0xA9, 0xCC, 0x4A, 0xFE, 0xD7, 0x4D,
8264 0x2F, 0xD2, 0x5B, 0x1A, 0x10, 0x05, 0xEF, 0x5A, 0x41, 0x25,
8265 0xCE, 0x1B, 0x53, 0x78
8266 };
8267 static const int sizeof_server_ed25519_key = sizeof(server_ed25519_key);
8268
8269 /* ./certs/ed25519/ca-ed25519.der, ED25519 */
8270 static const unsigned char ca_ed25519_cert[] =
8271 {
8272 0x30, 0x82, 0x02, 0x65, 0x30, 0x82, 0x02, 0x17, 0xA0, 0x03,
8273 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x05, 0x06, 0x03,
8274 0x2B, 0x65, 0x70, 0x30, 0x81, 0x9D, 0x31, 0x0B, 0x30, 0x09,
8275 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
8276 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
8277 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
8278 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
8279 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30, 0x16, 0x06,
8280 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0F, 0x77, 0x6F, 0x6C, 0x66,
8281 0x53, 0x53, 0x4C, 0x5F, 0x45, 0x64, 0x32, 0x35, 0x35, 0x31,
8282 0x39, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0B,
8283 0x0C, 0x0C, 0x52, 0x6F, 0x6F, 0x74, 0x2D, 0x45, 0x64, 0x32,
8284 0x35, 0x35, 0x31, 0x39, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03,
8285 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77,
8286 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
8287 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86,
8288 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66,
8289 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
8290 0x63, 0x6F, 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30,
8291 0x32, 0x31, 0x35, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A,

NetBurner, Inc.
22.205 certs_test.h 1189

8292 0x17, 0x0D, 0x32, 0x34, 0x31, 0x31, 0x31, 0x31, 0x31, 0x32,
8293 0x35, 0x30, 0x32, 0x34, 0x5A, 0x30, 0x81, 0xB4, 0x31, 0x0B,
8294 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55,
8295 0x53, 0x31, 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08,
8296 0x0C, 0x07, 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31,
8297 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07,
8298 0x42, 0x6F, 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30,
8299 0x16, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0F, 0x77, 0x6F,
8300 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x5F, 0x65, 0x64, 0x32, 0x35,
8301 0x35, 0x31, 0x39, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
8302 0x04, 0x0B, 0x0C, 0x0A, 0x43, 0x41, 0x2D, 0x65, 0x64, 0x32,
8303 0x35, 0x35, 0x31, 0x39, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03,
8304 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77,
8305 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,
8306 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86,
8307 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66,
8308 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
8309 0x63, 0x6F, 0x6D, 0x31, 0x17, 0x30, 0x15, 0x06, 0x0A, 0x09,
8310 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x01, 0x0C,
8311 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x30, 0x2A,
8312 0x30, 0x05, 0x06, 0x03, 0x2B, 0x65, 0x70, 0x03, 0x21, 0x00,
8313 0x42, 0x3B, 0x7A, 0xF9, 0x82, 0xCF, 0xF9, 0xDF, 0x19, 0xDD,
8314 0xF3, 0xF0, 0x32, 0x29, 0x6D, 0xFA, 0xFD, 0x76, 0x4F, 0x68,
8315 0xC2, 0xC2, 0xE0, 0x6C, 0x47, 0xAE, 0xC2, 0x55, 0x68, 0xAC,
8316 0x0D, 0x4D, 0xA3, 0x63, 0x30, 0x61, 0x30, 0x1D, 0x06, 0x03,
8317 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0x74, 0xD5, 0x38,
8318 0x19, 0x5E, 0x83, 0xB9, 0x03, 0xF8, 0x01, 0x8A, 0x35, 0x35,
8319 0xBB, 0x89, 0x4C, 0x49, 0xB4, 0x23, 0xE9, 0x30, 0x1F, 0x06,
8320 0x03, 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14,
8321 0xFA, 0xBA, 0x5B, 0x76, 0x1D, 0xF1, 0x1D, 0x1D, 0x4D, 0x74,
8322 0x48, 0xD8, 0x98, 0x3B, 0x56, 0xEF, 0xB3, 0x14, 0xF3, 0xDE,
8323 0x30, 0x0F, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF,
8324 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF, 0x30, 0x0E, 0x06,
8325 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03,
8326 0x02, 0x01, 0x86, 0x30, 0x05, 0x06, 0x03, 0x2B, 0x65, 0x70,
8327 0x03, 0x41, 0x00, 0xD6, 0xA6, 0xF7, 0xC6, 0x62, 0xCB, 0x2A,
8328 0x3E, 0x18, 0x0D, 0x88, 0x58, 0x00, 0xB0, 0x95, 0x0A, 0xAC,
8329 0x3A, 0xD6, 0x6F, 0x69, 0xDD, 0x1C, 0x91, 0x1C, 0x50, 0x77,
8330 0x9C, 0x18, 0xD4, 0x6E, 0x2B, 0x26, 0x7C, 0x5C, 0x6C, 0x04,
8331 0x03, 0xDF, 0x3E, 0x7D, 0x68, 0x95, 0x5E, 0x74, 0x34, 0xE6,
8332 0x3B, 0x43, 0x31, 0x0C, 0x86, 0xDC, 0x23, 0x1F, 0x4A, 0x9F,
8333 0x02, 0x23, 0x17, 0x02, 0x0E, 0x91, 0x08
8334 };
8335 static const int sizeof_ca_ed25519_cert = sizeof(ca_ed25519_cert);
8336
8337 /* ./certs/ed25519/client-ed25519.der, ED25519 */
8338 static const unsigned char client_ed25519_cert[] =
8339 {
8340 0x30, 0x82, 0x03, 0x9F, 0x30, 0x82, 0x03, 0x51, 0xA0, 0x03,
8341 0x02, 0x01, 0x02, 0x02, 0x14, 0x6F, 0x46, 0xF6, 0xFD, 0x19,
8342 0x1D, 0x61, 0xAA, 0x0E, 0x30, 0x9A, 0x97, 0x8D, 0x52, 0x40,
8343 0x67, 0xB8, 0x8C, 0x8C, 0xAC, 0x30, 0x05, 0x06, 0x03, 0x2B,
8344 0x65, 0x70, 0x30, 0x81, 0xB8, 0x31, 0x0B, 0x30, 0x09, 0x06,
8345 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10,
8346 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D,
8347 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E,
8348 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A,
8349 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03,
8350 0x55, 0x04, 0x0A, 0x0C, 0x0F, 0x77, 0x6F, 0x6C, 0x66, 0x53,
8351 0x53, 0x4C, 0x5F, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39,
8352 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C,
8353 0x0E, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x2D, 0x65, 0x64,
8354 0x32, 0x35, 0x35, 0x31, 0x39, 0x31, 0x18, 0x30, 0x16, 0x06,
8355 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E,
8356 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F,
8357 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48,
8358 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E,
8359 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C,
8360 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x17, 0x30, 0x15, 0x06, 0x0A,
8361 0x09, 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x01,
8362 0x0C, 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x30,
8363 0x1E, 0x17, 0x0D, 0x32, 0x32, 0x30, 0x32, 0x31, 0x35, 0x31,
8364 0x32, 0x35, 0x30, 0x32, 0x34, 0x5A, 0x17, 0x0D, 0x32, 0x34,
8365 0x31, 0x31, 0x31, 0x31, 0x31, 0x32, 0x35, 0x30, 0x32, 0x34,
8366 0x5A, 0x30, 0x81, 0xB8, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03,
8367 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31, 0x10, 0x30,
8368 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07, 0x4D, 0x6F,
8369 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30, 0x0E, 0x06,
8370 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F, 0x7A, 0x65,
8371 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03, 0x55,
8372 0x04, 0x0A, 0x0C, 0x0F, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53,
8373 0x4C, 0x5F, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x31,
8374 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0E,
8375 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x2D, 0x65, 0x64, 0x32,
8376 0x35, 0x35, 0x31, 0x39, 0x31, 0x18, 0x30, 0x16, 0x06, 0x03,
8377 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77, 0x2E, 0x77,
8378 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63, 0x6F, 0x6D,

NetBurner, Inc.
1190 File Documentation

8379 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86,
8380 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69, 0x6E, 0x66,
8381 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E,
8382 0x63, 0x6F, 0x6D, 0x31, 0x17, 0x30, 0x15, 0x06, 0x0A, 0x09,
8383 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x01, 0x0C,
8384 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C, 0x30, 0x2A,
8385 0x30, 0x05, 0x06, 0x03, 0x2B, 0x65, 0x70, 0x03, 0x21, 0x00,
8386 0xE6, 0x57, 0x5B, 0x13, 0x1B, 0xC7, 0x51, 0x14, 0x6B, 0xED,
8387 0x3B, 0xF5, 0xD1, 0xFA, 0xAB, 0x9E, 0x6C, 0xB6, 0xEB, 0x02,
8388 0x09, 0xA3, 0x99, 0xF5, 0x6E, 0xBF, 0x9D, 0x3C, 0xFE, 0x54,
8389 0x39, 0xE6, 0xA3, 0x82, 0x01, 0x69, 0x30, 0x82, 0x01, 0x65,
8390 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04,
8391 0x14, 0xFE, 0x41, 0x5E, 0x3E, 0x81, 0xE2, 0x2E, 0x46, 0xB3,
8392 0x3E, 0x47, 0x89, 0x90, 0xD4, 0xC2, 0xB4, 0x8E, 0x11, 0xD6,
8393 0x8A, 0x30, 0x81, 0xF8, 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04,
8394 0x81, 0xF0, 0x30, 0x81, 0xED, 0x80, 0x14, 0xFE, 0x41, 0x5E,
8395 0x3E, 0x81, 0xE2, 0x2E, 0x46, 0xB3, 0x3E, 0x47, 0x89, 0x90,
8396 0xD4, 0xC2, 0xB4, 0x8E, 0x11, 0xD6, 0x8A, 0xA1, 0x81, 0xBE,
8397 0xA4, 0x81, 0xBB, 0x30, 0x81, 0xB8, 0x31, 0x0B, 0x30, 0x09,
8398 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x55, 0x53, 0x31,
8399 0x10, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x04, 0x08, 0x0C, 0x07,
8400 0x4D, 0x6F, 0x6E, 0x74, 0x61, 0x6E, 0x61, 0x31, 0x10, 0x30,
8401 0x0E, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x07, 0x42, 0x6F,
8402 0x7A, 0x65, 0x6D, 0x61, 0x6E, 0x31, 0x18, 0x30, 0x16, 0x06,
8403 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0F, 0x77, 0x6F, 0x6C, 0x66,
8404 0x53, 0x53, 0x4C, 0x5F, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31,
8405 0x39, 0x31, 0x17, 0x30, 0x15, 0x06, 0x03, 0x55, 0x04, 0x0B,
8406 0x0C, 0x0E, 0x43, 0x6C, 0x69, 0x65, 0x6E, 0x74, 0x2D, 0x65,
8407 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x31, 0x18, 0x30, 0x16,
8408 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0F, 0x77, 0x77, 0x77,
8409 0x2E, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73, 0x6C, 0x2E, 0x63,
8410 0x6F, 0x6D, 0x31, 0x1F, 0x30, 0x1D, 0x06, 0x09, 0x2A, 0x86,
8411 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x10, 0x69,
8412 0x6E, 0x66, 0x6F, 0x40, 0x77, 0x6F, 0x6C, 0x66, 0x73, 0x73,
8413 0x6C, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x17, 0x30, 0x15, 0x06,
8414 0x0A, 0x09, 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01,
8415 0x01, 0x0C, 0x07, 0x77, 0x6F, 0x6C, 0x66, 0x53, 0x53, 0x4C,
8416 0x82, 0x14, 0x6F, 0x46, 0xF6, 0xFD, 0x19, 0x1D, 0x61, 0xAA,
8417 0x0E, 0x30, 0x9A, 0x97, 0x8D, 0x52, 0x40, 0x67, 0xB8, 0x8C,
8418 0x8C, 0xAC, 0x30, 0x0C, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04,
8419 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF, 0x30, 0x1C, 0x06, 0x03,
8420 0x55, 0x1D, 0x11, 0x04, 0x15, 0x30, 0x13, 0x82, 0x0B, 0x65,
8421 0x78, 0x61, 0x6D, 0x70, 0x6C, 0x65, 0x2E, 0x63, 0x6F, 0x6D,
8422 0x87, 0x04, 0x7F, 0x00, 0x00, 0x01, 0x30, 0x1D, 0x06, 0x03,
8423 0x55, 0x1D, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06, 0x08, 0x2B,
8424 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2B,
8425 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, 0x30, 0x05, 0x06,
8426 0x03, 0x2B, 0x65, 0x70, 0x03, 0x41, 0x00, 0x31, 0xF6, 0x00,
8427 0xBC, 0x7D, 0x2E, 0x3C, 0x5A, 0xBA, 0xF1, 0xFC, 0xF6, 0x94,
8428 0xCE, 0xB5, 0xEA, 0x7D, 0xFD, 0x18, 0x6D, 0xD8, 0x22, 0x15,
8429 0x2D, 0x48, 0xFC, 0x36, 0xCB, 0xD8, 0xDD, 0x7F, 0x43, 0xC5,
8430 0x23, 0xCB, 0x4D, 0xCB, 0x70, 0xDB, 0x08, 0xA5, 0x66, 0xBA,
8431 0xE5, 0xDE, 0x48, 0xCD, 0x7E, 0x86, 0x05, 0x7A, 0xAC, 0x6F,
8432 0x9C, 0x05, 0x76, 0x34, 0x24, 0xB8, 0x1F, 0xE8, 0xE3, 0xB1,
8433 0x0C
8434 };
8435 static const int sizeof_client_ed25519_cert = sizeof(client_ed25519_cert);
8436
8437 /* ./certs/ed25519/client-ed25519-key.der, ED25519 */
8438 static const unsigned char client_ed25519_key[] =
8439 {
8440 0x30, 0x2A, 0x30, 0x05, 0x06, 0x03, 0x2B, 0x65, 0x70, 0x03,
8441 0x21, 0x00, 0xE6, 0x57, 0x5B, 0x13, 0x1B, 0xC7, 0x51, 0x14,
8442 0x6B, 0xED, 0x3B, 0xF5, 0xD1, 0xFA, 0xAB, 0x9E, 0x6C, 0xB6,
8443 0xEB, 0x02, 0x09, 0xA3, 0x99, 0xF5, 0x6E, 0xBF, 0x9D, 0x3C,
8444 0xFE, 0x54, 0x39, 0xE6
8445 };
8446 static const int sizeof_client_ed25519_key = sizeof(client_ed25519_key);
8447
8448 #endif /* HAVE_ED25519 */
8449
8450 #endif /* WOLFSSL_CERTS_TEST_H */
8451

22.206 crl.h
1 /* crl.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com

NetBurner, Inc.
22.207 error-ssl.h 1191

10 */
11
12
13
14 #ifndef WOLFSSL_CRL_H
15 #define WOLFSSL_CRL_H
16
17
18 #ifdef HAVE_CRL
19
20 #include <wolfssl/ssl.h>
21 #include <wolfssl/wolfcrypt/asn.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 WOLFSSL_LOCAL int InitCRL(WOLFSSL_CRL* crl, WOLFSSL_CERT_MANAGER* cm);
28 WOLFSSL_LOCAL void FreeCRL(WOLFSSL_CRL* crl, int dynamic);
29
30 WOLFSSL_LOCAL int LoadCRL(WOLFSSL_CRL* crl, const char* path, int type,
31 int monitor);
32 WOLFSSL_LOCAL int BufferLoadCRL(WOLFSSL_CRL* crl, const byte* buff, long sz,
33 int type, int verify);
34 WOLFSSL_LOCAL int CheckCertCRL(WOLFSSL_CRL* crl, DecodedCert* cert);
35
36
37 #ifdef __cplusplus
38 } /* extern "C" */
39 #endif
40
41 #endif /* HAVE_CRL */
42 #endif /* WOLFSSL_CRL_H */

22.207 error-ssl.h
1 /* error-ssl.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 #ifndef WOLFSSL_ERROR_H
15 #define WOLFSSL_ERROR_H
16
17 #include <wolfssl/wolfcrypt/error-crypt.h> /* pull in wolfCrypt errors */
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 enum wolfSSL_ErrorCodes {
24 INPUT_CASE_ERROR = -301, /* process input state error */
25 PREFIX_ERROR = -302, /* bad index to key rounds */
26 MEMORY_ERROR = -303, /* out of memory */
27 VERIFY_FINISHED_ERROR = -304, /* verify problem on finished */
28 VERIFY_MAC_ERROR = -305, /* verify mac problem */
29 PARSE_ERROR = -306, /* parse error on header */
30 UNKNOWN_HANDSHAKE_TYPE = -307, /* weird handshake type */
31 SOCKET_ERROR_E = -308, /* error state on socket */
32 SOCKET_NODATA = -309, /* expected data, not there */
33 INCOMPLETE_DATA = -310, /* don’t have enough data to
34 complete task */
35 UNKNOWN_RECORD_TYPE = -311, /* unknown type in record hdr */
36 DECRYPT_ERROR = -312, /* error during decryption */
37 FATAL_ERROR = -313, /* recvd alert fatal error */
38 ENCRYPT_ERROR = -314, /* error during encryption */
39 FREAD_ERROR = -315, /* fread problem */
40 NO_PEER_KEY = -316, /* need peer’s key */
41 NO_PRIVATE_KEY = -317, /* need the private key */
42 RSA_PRIVATE_ERROR = -318, /* error during rsa priv op */
43 NO_DH_PARAMS = -319, /* server missing DH params */
44 BUILD_MSG_ERROR = -320, /* build message failure */
45 BAD_HELLO = -321, /* client hello malformed */
46 DOMAIN_NAME_MISMATCH = -322, /* peer subject name mismatch */
47 WANT_READ = -323, /* want read, call again */
48 NOT_READY_ERROR = -324, /* handshake layer not ready */
49 IPADDR_MISMATCH = -325, /* peer ip address mismatch */

NetBurner, Inc.
1192 File Documentation

50 VERSION_ERROR = -326, /* record layer version error */


51 WANT_WRITE = -327, /* want write, call again */
52 BUFFER_ERROR = -328, /* malformed buffer input */
53 VERIFY_CERT_ERROR = -329, /* verify cert error */
54 VERIFY_SIGN_ERROR = -330, /* verify sign error */
55 CLIENT_ID_ERROR = -331, /* psk client identity error */
56 SERVER_HINT_ERROR = -332, /* psk server hint error */
57 PSK_KEY_ERROR = -333, /* psk key error */
58
59 GETTIME_ERROR = -337, /* gettimeofday failed ??? */
60 GETITIMER_ERROR = -338, /* getitimer failed ??? */
61 SIGACT_ERROR = -339, /* sigaction failed ??? */
62 SETITIMER_ERROR = -340, /* setitimer failed ??? */
63 LENGTH_ERROR = -341, /* record layer length error */
64 PEER_KEY_ERROR = -342, /* can’t decode peer key */
65 ZERO_RETURN = -343, /* peer sent close notify */
66 SIDE_ERROR = -344, /* wrong client/server type */
67 NO_PEER_CERT = -345, /* peer didn’t send key */
68 ECC_CURVETYPE_ERROR = -350, /* Bad ECC Curve Type */
69 ECC_CURVE_ERROR = -351, /* Bad ECC Curve */
70 ECC_PEERKEY_ERROR = -352, /* Bad Peer ECC Key */
71 ECC_MAKEKEY_ERROR = -353, /* Bad Make ECC Key */
72 ECC_EXPORT_ERROR = -354, /* Bad ECC Export Key */
73 ECC_SHARED_ERROR = -355, /* Bad ECC Shared Secret */
74 NOT_CA_ERROR = -357, /* Not a CA cert error */
75
76 BAD_CERT_MANAGER_ERROR = -359, /* Bad Cert Manager */
77 OCSP_CERT_REVOKED = -360, /* OCSP Certificate revoked */
78 CRL_CERT_REVOKED = -361, /* CRL Certificate revoked */
79 CRL_MISSING = -362, /* CRL Not loaded */
80 MONITOR_SETUP_E = -363, /* CRL Monitor setup error */
81 THREAD_CREATE_E = -364, /* Thread Create Error */
82 OCSP_NEED_URL = -365, /* OCSP need an URL for lookup */
83 OCSP_CERT_UNKNOWN = -366, /* OCSP responder doesn’t know */
84 OCSP_LOOKUP_FAIL = -367, /* OCSP lookup not successful */
85 MAX_CHAIN_ERROR = -368, /* max chain depth exceeded */
86 COOKIE_ERROR = -369, /* dtls cookie error */
87 SEQUENCE_ERROR = -370, /* dtls sequence error */
88 SUITES_ERROR = -371, /* suites pointer error */
89
90 OUT_OF_ORDER_E = -373, /* out of order message */
91 BAD_KEA_TYPE_E = -374, /* bad KEA type found */
92 SANITY_CIPHER_E = -375, /* sanity check on cipher error */
93 RECV_OVERFLOW_E = -376, /* RXCB returned more than read */
94 GEN_COOKIE_E = -377, /* Generate Cookie Error */
95 NO_PEER_VERIFY = -378, /* Need peer cert verify Error */
96 FWRITE_ERROR = -379, /* fwrite problem */
97 CACHE_MATCH_ERROR = -380, /* Cache hdr match error */
98 UNKNOWN_SNI_HOST_NAME_E = -381, /* Unrecognized host name Error */
99 UNKNOWN_MAX_FRAG_LEN_E = -382, /* Unrecognized max frag len Error */
100 KEYUSE_SIGNATURE_E = -383, /* KeyUse digSignature error */
101
102 KEYUSE_ENCIPHER_E = -385, /* KeyUse keyEncipher error */
103 EXTKEYUSE_AUTH_E = -386, /* ExtKeyUse server|client_auth */
104 SEND_OOB_READ_E = -387, /* Send Cb out of bounds read */
105 SECURE_RENEGOTIATION_E = -388, /* Invalid Renegotiation Info */
106 SESSION_TICKET_LEN_E = -389, /* Session Ticket too large */
107 SESSION_TICKET_EXPECT_E = -390, /* Session Ticket missing */
108 SCR_DIFFERENT_CERT_E = -391, /* SCR Different cert error */
109 SESSION_SECRET_CB_E = -392, /* Session secret Cb fcn failure */
110 NO_CHANGE_CIPHER_E = -393, /* Finished before change cipher */
111 SANITY_MSG_E = -394, /* Sanity check on msg order error */
112 DUPLICATE_MSG_E = -395, /* Duplicate message error */
113 SNI_UNSUPPORTED = -396, /* SSL 3.0 does not support SNI */
114 SOCKET_PEER_CLOSED_E = -397, /* Underlying transport closed */
115 BAD_TICKET_KEY_CB_SZ = -398, /* Bad session ticket key cb size */
116 BAD_TICKET_MSG_SZ = -399, /* Bad session ticket msg size */
117 BAD_TICKET_ENCRYPT = -400, /* Bad user ticket encrypt */
118 DH_KEY_SIZE_E = -401, /* DH Key too small */
119 SNI_ABSENT_ERROR = -402, /* No SNI request. */
120 RSA_SIGN_FAULT = -403, /* RSA Sign fault */
121 HANDSHAKE_SIZE_ERROR = -404, /* Handshake message too large */
122 UNKNOWN_ALPN_PROTOCOL_NAME_E = -405, /* Unrecognized protocol name Error*/
123 BAD_CERTIFICATE_STATUS_ERROR = -406, /* Bad certificate status message */
124 OCSP_INVALID_STATUS = -407, /* Invalid OCSP Status */
125 OCSP_WANT_READ = -408, /* OCSP callback response WOLFSSL_CBIO_ERR_WANT_READ */
126 RSA_KEY_SIZE_E = -409, /* RSA key too small */
127 ECC_KEY_SIZE_E = -410, /* ECC key too small */
128 DTLS_EXPORT_VER_E = -411, /* export version error */
129 INPUT_SIZE_E = -412, /* input size too big error */
130 CTX_INIT_MUTEX_E = -413, /* initialize ctx mutex error */
131 EXT_MASTER_SECRET_NEEDED_E = -414, /* need EMS enabled to resume */
132 DTLS_POOL_SZ_E = -415, /* exceeded DTLS pool size */
133 DECODE_E = -416, /* decode handshake message error */
134 HTTP_TIMEOUT_E = -417, /* HTTP timeout for OCSP or CRL req */
135 WRITE_DUP_READ_E = -418, /* Write dup write side can’t read */
136 WRITE_DUP_WRITE_E = -419, /* Write dup read side can’t write */

NetBurner, Inc.
22.208 internal.h 1193

137 INVALID_CERT_CTX_E = -420, /* TLS cert ctx not matching */


138 BAD_KEY_SHARE_DATA = -421, /* Key Share data invalid */
139 MISSING_HANDSHAKE_DATA = -422, /* Handshake message missing data */
140 BAD_BINDER = -423, /* Binder does not match */
141 EXT_NOT_ALLOWED = -424, /* Extension not allowed in msg */
142 INVALID_PARAMETER = -425, /* Security parameter invalid */
143 MCAST_HIGHWATER_CB_E = -426, /* Multicast highwater cb err */
144 ALERT_COUNT_E = -427, /* Alert Count exceeded err */
145 EXT_MISSING = -428, /* Required extension not found */
146 UNSUPPORTED_EXTENSION = -429, /* TLSX not requested by client */
147 PRF_MISSING = -430, /* PRF not compiled in */
148 DTLS_RETX_OVER_TX = -431, /* Retransmit DTLS flight over */
149 DH_PARAMS_NOT_FFDHE_E = -432, /* DH params from server not FFDHE */
150 TCA_INVALID_ID_TYPE = -433, /* TLSX TCA ID type invalid */
151 TCA_ABSENT_ERROR = -434, /* TLSX TCA ID no response */
152 TSIP_MAC_DIGSZ_E = -435, /* Invalid MAC size for TSIP */
153 CLIENT_CERT_CB_ERROR = -436, /* Client cert callback error */
154 SSL_SHUTDOWN_ALREADY_DONE_E = -437, /* Shutdown called redundantly */
155 TLS13_SECRET_CB_E = -438, /* TLS1.3 secret Cb fcn failure */
156 DTLS_SIZE_ERROR = -439, /* Trying to send too much data */
157 NO_CERT_ERROR = -440, /* TLS1.3 - no cert set error */
158 APP_DATA_READY = -441, /* DTLS1.2 application data ready for read */
159 TOO_MUCH_EARLY_DATA = -442, /* Too much Early data */
160 SOCKET_FILTERED_E = -443, /* Session stopped by network filter */
161 HTTP_RECV_ERR = -444, /* HTTP Receive error */
162 HTTP_HEADER_ERR = -445, /* HTTP Header error */
163 HTTP_PROTO_ERR = -446, /* HTTP Protocol error */
164 HTTP_STATUS_ERR = -447, /* HTTP Status error */
165 HTTP_VERSION_ERR = -448, /* HTTP Version error */
166 HTTP_APPSTR_ERR = -449, /* HTTP Application string error */
167 UNSUPPORTED_PROTO_VERSION = -450, /* bad/unsupported protocol version*/
168 FALCON_KEY_SIZE_E = -451, /* Wrong key size for Falcon. */
169 QUIC_TP_MISSING_E = -452, /* QUIC transport parameter missing */
170 DILITHIUM_KEY_SIZE_E = -453, /* Wrong key size for Dilithium. */
171
172 DTLS_CID_ERROR = -454, /* Wrong or missing CID */
173 /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
174
175 /* begin negotiation parameter errors */
176 UNSUPPORTED_SUITE = -500, /* unsupported cipher suite */
177 MATCH_SUITE_ERROR = -501, /* can’t match cipher suite */
178 COMPRESSION_ERROR = -502, /* compression mismatch */
179 KEY_SHARE_ERROR = -503, /* key share mismatch */
180 POST_HAND_AUTH_ERROR = -504, /* client won’t do post-hand auth */
181 HRR_COOKIE_ERROR = -505 /* HRR msg cookie mismatch */
182 /* end negotiation parameter errors only 10 for now */
183 /* add strings to wolfSSL_ERR_reason_error_string in internal.c !!!!! */
184
185 /* no error stings go down here, add above negotiation errors !!!! */
186 };
187
188
189 #if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)
190 enum {
191 MIN_PARAM_ERR = UNSUPPORTED_SUITE,
192 MAX_PARAM_ERR = MIN_PARAM_ERR - 10
193 };
194 #endif
195
196
197 WOLFSSL_LOCAL
198 void SetErrorString(int err, char* buff);
199
200
201 #ifdef __cplusplus
202 } /* extern "C" */
203 #endif
204
205
206 #endif /* wolfSSL_ERROR_H */

22.208 internal.h
1 /* internal.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12

NetBurner, Inc.
1194 File Documentation

13
14 #ifndef WOLFSSL_INT_H
15 #define WOLFSSL_INT_H
16 #define WOLFSSL_NETBURNER (1)
17
18
19 #include <wolfssl/wolfcrypt/types.h>
20 #include <wolfssl/ssl.h>
21 #ifdef HAVE_CRL
22 #include <wolfssl/crl.h>
23 #endif
24 #include <wolfssl/wolfcrypt/random.h>
25 #ifndef NO_DES3
26 #include <wolfssl/wolfcrypt/des3.h>
27 #endif
28 #ifdef HAVE_CHACHA
29 #include <wolfssl/wolfcrypt/chacha.h>
30 #endif
31 #ifndef NO_ASN
32 #include <wolfssl/wolfcrypt/asn.h>
33 #include <wolfssl/wolfcrypt/pkcs12.h>
34 #endif
35 #ifndef NO_MD5
36 #include <wolfssl/wolfcrypt/md5.h>
37 #endif
38 #ifndef NO_SHA
39 #include <wolfssl/wolfcrypt/sha.h>
40 #endif
41 #ifndef NO_AES
42 #include <wolfssl/wolfcrypt/aes.h>
43 #endif
44 #ifdef HAVE_POLY1305
45 #include <wolfssl/wolfcrypt/poly1305.h>
46 #endif
47 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && defined(OPENSSL_EXTRA)
48 #include <wolfssl/wolfcrypt/chacha20_poly1305.h>
49 #endif
50 #ifdef HAVE_CAMELLIA
51 #include <wolfssl/wolfcrypt/camellia.h>
52 #endif
53 #include <wolfssl/wolfcrypt/logging.h>
54 #ifndef NO_HMAC
55 #include <wolfssl/wolfcrypt/hmac.h>
56 #endif
57 #ifndef NO_RC4
58 #include <wolfssl/wolfcrypt/arc4.h>
59 #endif
60 #ifndef NO_SHA256
61 #include <wolfssl/wolfcrypt/sha256.h>
62 #endif
63 #if defined(WOLFSSL_SHA384)
64 #include <wolfssl/wolfcrypt/sha512.h>
65 #endif
66 #ifdef HAVE_OCSP
67 #include <wolfssl/ocsp.h>
68 #endif
69 #ifdef WOLFSSL_QUIC
70 #include <wolfssl/quic.h>
71 #endif
72 #ifdef WOLFSSL_SHA384
73 #include <wolfssl/wolfcrypt/sha512.h>
74 #endif
75 #ifdef WOLFSSL_SHA512
76 #include <wolfssl/wolfcrypt/sha512.h>
77 #endif
78 #ifdef HAVE_AESGCM
79 #include <wolfssl/wolfcrypt/sha512.h>
80 #endif
81 #ifdef WOLFSSL_RIPEMD
82 #include <wolfssl/wolfcrypt/ripemd.h>
83 #endif
84 #ifndef NO_RSA
85 #include <wolfssl/wolfcrypt/rsa.h>
86 #endif
87 #ifdef HAVE_ECC
88 #include <wolfssl/wolfcrypt/ecc.h>
89 #endif
90 #ifndef NO_DH
91 #include <wolfssl/wolfcrypt/dh.h>
92 #endif
93 #ifdef HAVE_ED25519
94 #include <wolfssl/wolfcrypt/ed25519.h>
95 #endif
96 #ifdef HAVE_CURVE25519
97 #include <wolfssl/wolfcrypt/curve25519.h>
98 #endif
99 #ifdef HAVE_ED448

NetBurner, Inc.
22.208 internal.h 1195

100 #include <wolfssl/wolfcrypt/ed448.h>


101 #endif
102 #ifdef HAVE_CURVE448
103 #include <wolfssl/wolfcrypt/curve448.h>
104 #endif
105 #ifdef HAVE_PQC
106 #include <wolfssl/wolfcrypt/falcon.h>
107 #include <wolfssl/wolfcrypt/dilithium.h>
108 #endif
109 #ifdef HAVE_HKDF
110 #include <wolfssl/wolfcrypt/kdf.h>
111 #endif
112 #ifndef WOLFSSL_NO_DEF_TICKET_ENC_CB
113 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && \
114 !defined(WOLFSSL_TICKET_ENC_AES128_GCM) && \
115 !defined(WOLFSSL_TICKET_ENC_AES256_GCM)
116 #include <wolfssl/wolfcrypt/chacha20_poly1305.h>
117 #else
118 #include <wolfssl/wolfcrypt/aes.h>
119 #endif
120 #endif
121
122 #include <wolfssl/wolfcrypt/wc_encrypt.h>
123 #include <wolfssl/wolfcrypt/hash.h>
124
125 #if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)
126 #include <wolfssl/callbacks.h>
127 #endif
128 #ifdef WOLFSSL_CALLBACKS
129 #include <signal.h>
130 #endif
131
132 #ifdef USE_WINDOWS_API
133 #ifdef WOLFSSL_GAME_BUILD
134 #include "system/xtl.h"
135 #else
136 #if defined(_WIN32_WCE) || defined(WIN32_LEAN_AND_MEAN)
137 /* On WinCE winsock2.h must be included before windows.h */
138 #include <winsock2.h>
139 #endif
140 #include <windows.h>
141 #endif
142 #elif defined(THREADX)
143 #ifndef SINGLE_THREADED
144 #include "tx_api.h"
145 #endif
146
147 #elif defined(WOLFSSL_DEOS)
148 /* do nothing, just don’t pick Unix */
149 #elif defined(MICRIUM)
150 /* do nothing, just don’t pick Unix */
151 #elif defined(FREERTOS) || defined(FREERTOS_TCP) || defined(WOLFSSL_SAFERTOS)
152 /* do nothing */
153 #elif defined(RTTHREAD)
154 /* do nothing */
155 #elif defined(EBSNET)
156 /* do nothing */
157 #elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
158 /* do nothing */
159 #elif defined(FREESCALE_FREE_RTOS)
160 #include "fsl_os_abstraction.h"
161 #elif defined(WOLFSSL_uITRON4)
162 /* do nothing */
163 #elif defined(WOLFSSL_uTKERNEL2)
164 /* do nothing */
165 #elif defined(WOLFSSL_CMSIS_RTOS)
166 #include "cmsis_os.h"
167 #elif defined(WOLFSSL_CMSIS_RTOSv2)
168 #include "cmsis_os2.h"
169 #elif defined(WOLFSSL_MDK_ARM)
170 #if defined(WOLFSSL_MDK5)
171 #include "cmsis_os.h"
172 #else
173 #include <rtl.h>
174 #endif
175 #elif defined(MBED)
176 #elif defined(WOLFSSL_TIRTOS)
177 /* do nothing */
178 #elif defined(INTIME_RTOS)
179 #include <rt.h>
180 #elif defined(WOLFSSL_NUCLEUS_1_2)
181 /* do nothing */
182 #elif defined(WOLFSSL_APACHE_MYNEWT)
183 #if !defined(WOLFSSL_LWIP)
184 void mynewt_ctx_clear(void *ctx);
185 void* mynewt_ctx_new();
186 #endif

NetBurner, Inc.
1196 File Documentation

187 #elif defined(WOLFSSL_ZEPHYR)


188 #ifndef SINGLE_THREADED
189 #include <kernel.h>
190 #endif
191 #elif defined(WOLFSSL_TELIT_M2MB)
192 /* do nothing */
193 #elif defined(WOLFSSL_EMBOS)
194 /* do nothing */
195 #elif defined(WOLFSSL_NETBURNER)
196 /* do nothing */
197 #else
198 #ifndef SINGLE_THREADED
199 #if defined(WOLFSSL_LINUXKM)
200 /* setup is in linuxkm/linuxkm_wc_port.h */
201 #elif defined(WOLFSSL_USER_MUTEX)
202 /* do nothing */
203 #else
204 #define WOLFSSL_PTHREADS
205 #include <pthread.h>
206 #endif
207 #endif
208 #if defined(OPENSSL_EXTRA) && !defined(NO_FILESYSTEM)
209 #ifdef FUSION_RTOS
210 #include <fclunistd.h>
211 #else
212 #include <unistd.h> /* for close of BIO */
213 #endif
214 #endif
215 #endif
216
217 #if !defined(CHAR_BIT) || (defined(OPENSSL_EXTRA) && !defined(INT_MAX))
218 /* Needed for DTLS without big math and INT_MAX */
219 #include <limits.h>
220 #endif
221
222
223 #ifdef HAVE_LIBZ
224 #include "zlib.h"
225 #endif
226
227 #ifdef WOLFSSL_ASYNC_CRYPT
228 #include <wolfssl/wolfcrypt/async.h>
229 #endif
230
231 #ifdef OPENSSL_EXTRA
232 #ifdef WOLFCRYPT_HAVE_SRP
233 #include <wolfssl/wolfcrypt/srp.h>
234 #endif
235 #endif
236
237 #ifdef _MSC_VER
238 /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
239 #pragma warning(disable: 4996)
240 #endif
241
242 #ifdef NO_SHA
243 #define WC_SHA_DIGEST_SIZE 20
244 #endif
245
246 #ifdef NO_SHA256
247 #define WC_SHA256_DIGEST_SIZE 32
248 #endif
249
250 #ifdef NO_MD5
251 #define WC_MD5_DIGEST_SIZE 16
252 #endif
253
254 #ifdef WOLFSSL_IOTSAFE
255 #include <wolfssl/wolfcrypt/port/iotsafe/iotsafe.h>
256 #endif
257
258 #if defined(WOLFSSL_RENESAS_TSIP_TLS)
259 #include <wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h>
260 #endif
261
262 #ifdef __cplusplus
263 extern "C" {
264 #endif
265
266 /* Define or comment out the cipher suites you’d like to be compiled in
267 make sure to use at least one BUILD_SSL_xxx or BUILD_TLS_xxx is defined
268
269 When adding cipher suites, add name to cipher_names, idx to cipher_name_idx
270
271 Now that there is a maximum strength crypto build, the following BUILD_XXX
272 flags need to be divided into two groups selected by WOLFSSL_MAX_STRENGTH.
273 Those that do not use Perfect Forward Security and do not use AEAD ciphers

NetBurner, Inc.
22.208 internal.h 1197

274 need to be switched off. Allowed suites use (EC)DHE, AES-GCM|CCM, or


275 CHACHA-POLY.
276 */
277
278 /* Check that if WOLFSSL_MAX_STRENGTH is set that all the required options are
279 * not turned off. */
280 #if defined(WOLFSSL_MAX_STRENGTH) && \
281 ((!defined(HAVE_ECC) && (defined(NO_DH) || defined(NO_RSA))) || \
282 (!defined(HAVE_AESGCM) && !defined(HAVE_AESCCM) && \
283 (!defined(HAVE_POLY1305) || !defined(HAVE_CHACHA))) || \
284 (defined(NO_SHA256) && !defined(WOLFSSL_SHA384)) || \
285 !defined(NO_OLD_TLS))
286
287 #error "You are trying to build max strength with requirements disabled."
288 #endif
289
290 #ifndef WOLFSSL_NO_TLS12
291
292 #ifndef WOLFSSL_MAX_STRENGTH
293
294 #ifdef WOLFSSL_AEAD_ONLY
295 /* AES CBC ciphers are not allowed in AEAD only mode */
296 #undef HAVE_AES_CBC
297 #endif
298
299 #ifndef WOLFSSL_AEAD_ONLY
300 #if !defined(NO_RSA) && !defined(NO_RC4)
301 #if defined(WOLFSSL_STATIC_RSA)
302 #if !defined(NO_SHA)
303 #define BUILD_SSL_RSA_WITH_RC4_128_SHA
304 #endif
305 #if !defined(NO_MD5)
306 #define BUILD_SSL_RSA_WITH_RC4_128_MD5
307 #endif
308 #endif
309 #endif
310
311 #if !defined(NO_RSA) && !defined(NO_DES3)
312 #if !defined(NO_SHA)
313 #if defined(WOLFSSL_STATIC_RSA)
314 #define BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA
315 #endif
316 #endif
317 #endif
318 #endif /* !WOLFSSL_AEAD_ONLY */
319
320 #if !defined(NO_RSA) && !defined(NO_AES) && !defined(NO_TLS)
321 #if !defined(NO_SHA) && defined(HAVE_AES_CBC)
322 #if defined(WOLFSSL_STATIC_RSA)
323 #ifdef WOLFSSL_AES_128
324 #define BUILD_TLS_RSA_WITH_AES_128_CBC_SHA
325 #endif
326 #ifdef WOLFSSL_AES_256
327 #define BUILD_TLS_RSA_WITH_AES_256_CBC_SHA
328 #endif
329 #endif
330 #endif
331 #if defined(WOLFSSL_STATIC_RSA)
332 #if !defined (NO_SHA256) && defined(HAVE_AES_CBC)
333 #ifdef WOLFSSL_AES_128
334 #define BUILD_TLS_RSA_WITH_AES_128_CBC_SHA256
335 #endif
336 #ifdef WOLFSSL_AES_256
337 #define BUILD_TLS_RSA_WITH_AES_256_CBC_SHA256
338 #endif
339 #endif
340 #if defined (HAVE_AESGCM)
341 #ifdef WOLFSSL_AES_128
342 #define BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256
343 #endif
344 #if defined (WOLFSSL_SHA384) && defined(WOLFSSL_AES_256)
345 #define BUILD_TLS_RSA_WITH_AES_256_GCM_SHA384
346 #endif
347 #endif
348 #if defined (HAVE_AESCCM)
349 #ifdef WOLFSSL_AES_128
350 #define BUILD_TLS_RSA_WITH_AES_128_CCM_8
351 #endif
352 #ifdef WOLFSSL_AES_256
353 #define BUILD_TLS_RSA_WITH_AES_256_CCM_8
354 #endif
355 #endif
356 #endif
357 #endif
358
359 #if defined(HAVE_CAMELLIA) && !defined(NO_TLS) && !defined(NO_CAMELLIA_CBC)
360 #ifndef NO_RSA

NetBurner, Inc.
1198 File Documentation

361 #if defined(WOLFSSL_STATIC_RSA)


362 #if !defined(NO_SHA)
363 #define BUILD_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
364 #define BUILD_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
365 #endif
366 #ifndef NO_SHA256
367 #define BUILD_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256
368 #define BUILD_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256
369 #endif
370 #endif
371 #if !defined(NO_DH)
372 #if !defined(NO_SHA)
373 #define BUILD_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
374 #define BUILD_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA
375 #endif
376 #ifndef NO_SHA256
377 #define BUILD_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256
378 #define BUILD_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256
379 #endif
380 #endif
381 #endif
382 #endif
383
384 #if defined(WOLFSSL_STATIC_PSK)
385 #if !defined(NO_PSK) && !defined(NO_AES) && !defined(NO_TLS)
386 #if !defined(NO_SHA)
387 #ifdef WOLFSSL_AES_128
388 #define BUILD_TLS_PSK_WITH_AES_128_CBC_SHA
389 #endif
390 #ifdef WOLFSSL_AES_256
391 #define BUILD_TLS_PSK_WITH_AES_256_CBC_SHA
392 #endif
393 #endif
394 #ifndef NO_SHA256
395 #ifdef WOLFSSL_AES_128
396 #ifdef HAVE_AES_CBC
397 #define BUILD_TLS_PSK_WITH_AES_128_CBC_SHA256
398 #endif
399 #ifdef HAVE_AESGCM
400 #define BUILD_TLS_PSK_WITH_AES_128_GCM_SHA256
401 #endif
402 #endif /* WOLFSSL_AES_128 */
403 #ifdef HAVE_AESCCM
404 #ifdef WOLFSSL_AES_128
405 #define BUILD_TLS_PSK_WITH_AES_128_CCM_8
406 #define BUILD_TLS_PSK_WITH_AES_128_CCM
407 #endif
408 #ifdef WOLFSSL_AES_256
409 #define BUILD_TLS_PSK_WITH_AES_256_CCM_8
410 #define BUILD_TLS_PSK_WITH_AES_256_CCM
411 #endif
412 #endif
413 #endif
414 #if defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256)
415 #ifdef HAVE_AES_CBC
416 #define BUILD_TLS_PSK_WITH_AES_256_CBC_SHA384
417 #endif
418 #ifdef HAVE_AESGCM
419 #define BUILD_TLS_PSK_WITH_AES_256_GCM_SHA384
420 #endif
421 #endif
422 #endif
423 #endif
424
425 #if !defined(NO_TLS) && defined(HAVE_NULL_CIPHER)
426 #if !defined(NO_RSA)
427 #if defined(WOLFSSL_STATIC_RSA)
428 #ifndef NO_MD5
429 #define BUILD_TLS_RSA_WITH_NULL_MD5
430 #endif
431 #if !defined(NO_SHA)
432 #define BUILD_TLS_RSA_WITH_NULL_SHA
433 #endif
434 #ifndef NO_SHA256
435 #define BUILD_TLS_RSA_WITH_NULL_SHA256
436 #endif
437 #endif
438 #endif
439 #if !defined(NO_PSK) && defined(WOLFSSL_STATIC_PSK)
440 #if !defined(NO_SHA)
441 #define BUILD_TLS_PSK_WITH_NULL_SHA
442 #endif
443 #ifndef NO_SHA256
444 #define BUILD_TLS_PSK_WITH_NULL_SHA256
445 #endif
446 #ifdef WOLFSSL_SHA384
447 #define BUILD_TLS_PSK_WITH_NULL_SHA384

NetBurner, Inc.
22.208 internal.h 1199

448 #endif
449 #endif
450 #endif
451
452 #if !defined(NO_DH) && !defined(NO_AES) && !defined(NO_TLS) && \
453 !defined(NO_RSA)
454
455 #if !defined(NO_SHA)
456 #if defined(WOLFSSL_AES_128) && defined(HAVE_AES_CBC)
457 #define BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA
458 #endif
459 #if defined(WOLFSSL_AES_256) && defined(HAVE_AES_CBC)
460 #define BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA
461 #endif
462 #if !defined(NO_DES3)
463 #define BUILD_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
464 #endif
465 #endif
466 #if !defined(NO_SHA256) && defined(HAVE_AES_CBC)
467 #ifdef WOLFSSL_AES_128
468 #define BUILD_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
469 #endif
470 #ifdef WOLFSSL_AES_256
471 #define BUILD_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
472 #endif
473 #endif
474 #endif
475
476 #if defined(HAVE_ANON) && !defined(NO_TLS) && !defined(NO_DH) && \
477 !defined(NO_AES) && !defined(NO_SHA) && defined(WOLFSSL_AES_128)
478 #ifdef HAVE_AES_CBC
479 #define BUILD_TLS_DH_anon_WITH_AES_128_CBC_SHA
480 #endif
481
482 #if defined(WOLFSSL_SHA384) && defined(HAVE_AESGCM)
483 #define BUILD_TLS_DH_anon_WITH_AES_256_GCM_SHA384
484 #endif
485 #endif
486
487 #if !defined(NO_DH) && !defined(NO_PSK) && !defined(NO_TLS)
488 #ifndef NO_SHA256
489 #if !defined(NO_AES) && defined(WOLFSSL_AES_128) && \
490 defined(HAVE_AES_CBC)
491 #define BUILD_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256
492 #endif
493 #ifdef HAVE_NULL_CIPHER
494 #define BUILD_TLS_DHE_PSK_WITH_NULL_SHA256
495 #endif
496 #endif
497 #ifdef WOLFSSL_SHA384
498 #if !defined(NO_AES) && defined(WOLFSSL_AES_256) && \
499 defined(HAVE_AES_CBC)
500 #define BUILD_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384
501 #endif
502 #ifdef HAVE_NULL_CIPHER
503 #define BUILD_TLS_DHE_PSK_WITH_NULL_SHA384
504 #endif
505 #endif
506 #endif
507
508 #if (defined(HAVE_ECC) || defined(HAVE_CURVE25519) || \
509 defined(HAVE_CURVE448)) && !defined(NO_TLS)
510 #if !defined(NO_AES)
511 #if !defined(NO_SHA) && defined(HAVE_AES_CBC)
512 #if !defined(NO_RSA)
513 #ifdef WOLFSSL_AES_128
514 #define BUILD_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
515 #endif
516 #ifdef WOLFSSL_AES_256
517 #define BUILD_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
518 #endif
519 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
520 #ifdef WOLFSSL_AES_128
521 #define BUILD_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
522 #endif
523 #ifdef WOLFSSL_AES_256
524 #define BUILD_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
525 #endif
526 #endif
527 #endif
528
529 #if defined(HAVE_ECC) || \
530 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
531 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
532 #ifdef WOLFSSL_AES_128
533 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
534 #endif

NetBurner, Inc.
1200 File Documentation

535 #ifdef WOLFSSL_AES_256


536 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
537 #endif
538 #endif
539
540 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
541 #ifdef WOLFSSL_AES_128
542 #define BUILD_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
543 #endif
544 #ifdef WOLFSSL_AES_256
545 #define BUILD_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
546 #endif
547 #endif
548 #endif /* NO_SHA */
549 #if !defined(NO_SHA256) && defined(WOLFSSL_AES_128) && \
550 defined(HAVE_AES_CBC)
551 #if !defined(NO_RSA)
552 #define BUILD_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
553 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
554 #define BUILD_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
555 #endif
556 #endif
557 #if defined(HAVE_ECC) || \
558 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
559 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
560 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
561 #endif
562 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
563 #define BUILD_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
564 #endif
565 #endif
566
567 #if defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256) && \
568 defined(HAVE_AES_CBC)
569 #if !defined(NO_RSA)
570 #define BUILD_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
571 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
572 #define BUILD_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
573 #endif
574 #endif
575 #if defined(HAVE_ECC) || \
576 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
577 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
578 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
579 #endif
580 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
581 #define BUILD_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
582 #endif
583 #endif
584
585 #if defined (HAVE_AESGCM)
586 #if !defined(NO_RSA)
587 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
588 #ifdef WOLFSSL_AES_128
589 #define BUILD_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
590 #endif
591 #endif
592 #if defined(WOLFSSL_SHA384)
593 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
594 #ifdef WOLFSSL_AES_256
595 #define BUILD_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
596 #endif
597 #endif
598 #endif
599 #endif
600
601 #if defined(WOLFSSL_STATIC_DH) && defined(WOLFSSL_AES_128) && \
602 defined(HAVE_ECC)
603 #define BUILD_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
604 #endif
605
606 #if defined(WOLFSSL_SHA384)
607 #if defined(WOLFSSL_STATIC_DH) && \
608 defined(WOLFSSL_AES_256) && defined(HAVE_ECC)
609 #define BUILD_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
610 #endif
611 #endif
612 #endif
613 #endif /* NO_AES */
614 #if !defined(NO_RC4)
615 #if !defined(NO_SHA)
616 #if !defined(NO_RSA)
617 #ifndef WOLFSSL_AEAD_ONLY
618 #define BUILD_TLS_ECDHE_RSA_WITH_RC4_128_SHA
619 #endif
620 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
621 #define BUILD_TLS_ECDH_RSA_WITH_RC4_128_SHA

NetBurner, Inc.
22.208 internal.h 1201

622 #endif
623 #endif
624
625 #if defined(HAVE_ECC) || \
626 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
627 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
628 #ifndef WOLFSSL_AEAD_ONLY
629 #define BUILD_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
630 #endif
631 #endif
632 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
633 #define BUILD_TLS_ECDH_ECDSA_WITH_RC4_128_SHA
634 #endif
635 #endif
636 #endif
637 #if !defined(NO_DES3)
638 #ifndef NO_SHA
639 #if !defined(NO_RSA)
640 #define BUILD_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
641 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
642 #define BUILD_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
643 #endif
644 #endif
645
646 #if defined(HAVE_ECC) || \
647 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
648 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
649 #define BUILD_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA
650 #endif
651 #if defined(WOLFSSL_STATIC_DH) && defined(HAVE_ECC)
652 #define BUILD_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
653 #endif
654 #endif /* NO_SHA */
655 #endif
656 #if defined(HAVE_NULL_CIPHER)
657 #if !defined(NO_SHA)
658 #if defined(HAVE_ECC) || \
659 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
660 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
661 #define BUILD_TLS_ECDHE_ECDSA_WITH_NULL_SHA
662 #endif
663 #endif
664 #if !defined(NO_PSK) && !defined(NO_SHA256)
665 #define BUILD_TLS_ECDHE_PSK_WITH_NULL_SHA256
666 #endif
667 #endif
668 #if !defined(NO_PSK) && !defined(NO_SHA256) && !defined(NO_AES) && \
669 defined(WOLFSSL_AES_128) && defined(HAVE_AES_CBC)
670 #define BUILD_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
671 #endif
672 #if !defined(NO_PSK) && !defined(NO_SHA256) && !defined(NO_AES) && \
673 defined(WOLFSSL_AES_128) && defined(HAVE_AESGCM)
674 #define BUILD_TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256
675 #endif
676 #endif
677 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && !defined(NO_SHA256)
678 #if !defined(NO_OLD_POLY1305)
679 #if defined(HAVE_ECC) || \
680 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
681 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
682 #define BUILD_TLS_ECDHE_ECDSA_WITH_CHACHA20_OLD_POLY1305_SHA256
683 #endif
684 #if !defined(NO_RSA) && defined(HAVE_ECC)
685 #define BUILD_TLS_ECDHE_RSA_WITH_CHACHA20_OLD_POLY1305_SHA256
686 #endif
687 #if !defined(NO_DH) && !defined(NO_RSA)
688 #define BUILD_TLS_DHE_RSA_WITH_CHACHA20_OLD_POLY1305_SHA256
689 #endif
690 #endif /* NO_OLD_POLY1305 */
691 #if !defined(NO_PSK)
692 #define BUILD_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256
693 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || \
694 defined(HAVE_ED448)
695 #define BUILD_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256
696 #endif
697 #ifndef NO_DH
698 #define BUILD_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256
699 #endif
700 #endif /* !NO_PSK */
701 #endif
702
703 #endif /* !WOLFSSL_MAX_STRENGTH */
704
705 #if !defined(NO_DH) && !defined(NO_AES) && !defined(NO_TLS) && \
706 !defined(NO_RSA) && defined(HAVE_AESGCM)
707
708 #if !defined(NO_SHA256) && defined(WOLFSSL_AES_128)

NetBurner, Inc.
1202 File Documentation

709 #define BUILD_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256


710 #endif
711
712 #if defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256)
713 #define BUILD_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
714 #endif
715 #endif
716
717 #if !defined(NO_DH) && !defined(NO_PSK) && !defined(NO_TLS)
718 #ifndef NO_SHA256
719 #if defined(HAVE_AESGCM) && defined(WOLFSSL_AES_128)
720 #define BUILD_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256
721 #endif
722 #ifdef HAVE_AESCCM
723 #ifdef WOLFSSL_AES_128
724 #define BUILD_TLS_DHE_PSK_WITH_AES_128_CCM
725 #endif
726 #ifdef WOLFSSL_AES_256
727 #define BUILD_TLS_DHE_PSK_WITH_AES_256_CCM
728 #endif
729 #endif
730 #endif
731 #if defined(WOLFSSL_SHA384) && defined(HAVE_AESGCM) && \
732 defined(WOLFSSL_AES_256)
733 #define BUILD_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384
734 #endif
735 #endif
736
737 #if (defined(HAVE_ECC) || defined(HAVE_CURVE25519) || defined(HAVE_CURVE448)) \
738 && !defined(NO_TLS) && !defined(NO_AES)
739 #ifdef HAVE_AESGCM
740 #if !defined(NO_SHA256) && defined(WOLFSSL_AES_128)
741 #if defined(HAVE_ECC) || \
742 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
743 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
744 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
745 #endif
746 #ifndef NO_RSA
747 #define BUILD_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
748 #endif
749 #endif
750 #if defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256)
751 #if defined(HAVE_ECC) || \
752 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
753 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
754 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
755 #endif
756 #ifndef NO_RSA
757 #define BUILD_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
758 #endif
759 #endif
760 #endif
761 #if defined(HAVE_AESCCM) && !defined(NO_SHA256)
762 #if defined(HAVE_ECC) || \
763 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
764 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
765 #ifdef WOLFSSL_AES_128
766 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM
767 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
768 #endif
769 #ifdef WOLFSSL_AES_256
770 #define BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8
771 #endif
772 #endif
773 #endif
774 #endif
775
776 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && !defined(NO_SHA256)
777 #if defined(HAVE_ECC) || defined(HAVE_CURVE25519) || defined(HAVE_CURVE448)
778 #if defined(HAVE_ECC) || \
779 (defined(HAVE_CURVE25519) && defined(HAVE_ED25519)) || \
780 (defined(HAVE_CURVE448) && defined(HAVE_ED448))
781 #define BUILD_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
782 #endif
783 #ifndef NO_RSA
784 #define BUILD_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
785 #endif
786 #endif
787 #if !defined(NO_DH) && !defined(NO_RSA)
788 #define BUILD_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256
789 #endif
790 #endif
791
792 #endif
793
794 #if defined(WOLFSSL_TLS13)
795 #ifdef HAVE_AESGCM

NetBurner, Inc.
22.208 internal.h 1203

796 #if !defined(NO_SHA256) && defined(WOLFSSL_AES_128)


797 #define BUILD_TLS_AES_128_GCM_SHA256
798 #endif
799 #if defined(WOLFSSL_SHA384) && defined(WOLFSSL_AES_256)
800 #define BUILD_TLS_AES_256_GCM_SHA384
801 #endif
802 #endif
803
804 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
805 #ifndef NO_SHA256
806 #define BUILD_TLS_CHACHA20_POLY1305_SHA256
807 #endif
808 #endif
809
810 #ifdef HAVE_AESCCM
811 #if !defined(NO_SHA256) && defined(WOLFSSL_AES_128)
812 #define BUILD_TLS_AES_128_CCM_SHA256
813 #define BUILD_TLS_AES_128_CCM_8_SHA256
814 #endif
815 #endif
816 #ifdef HAVE_NULL_CIPHER
817 #ifndef NO_SHA256
818 #define BUILD_TLS_SHA256_SHA256
819 #endif
820 #ifdef WOLFSSL_SHA384
821 #define BUILD_TLS_SHA384_SHA384
822 #endif
823 #endif
824 #endif
825
826 #if !defined(WOLFCRYPT_ONLY) && defined(NO_PSK) && \
827 (defined(NO_DH) || !defined(HAVE_ANON)) && \
828 defined(NO_RSA) && !defined(HAVE_ECC) && \
829 !defined(HAVE_ED25519) && !defined(HAVE_ED448)
830 #error "No cipher suites available with this build"
831 #endif
832
833 #ifdef WOLFSSL_MULTICAST
834 #if defined(HAVE_NULL_CIPHER) && !defined(NO_SHA256)
835 #define BUILD_WDM_WITH_NULL_SHA256
836 #endif
837 #endif
838
839 #if defined(BUILD_SSL_RSA_WITH_RC4_128_SHA) || \
840 defined(BUILD_SSL_RSA_WITH_RC4_128_MD5)
841 #define BUILD_ARC4
842 #endif
843
844 #if defined(BUILD_SSL_RSA_WITH_3DES_EDE_CBC_SHA)
845 #define BUILD_DES3
846 #endif
847
848 #if defined(BUILD_TLS_RSA_WITH_AES_128_CBC_SHA) || \
849 defined(BUILD_TLS_RSA_WITH_AES_256_CBC_SHA) || \
850 defined(BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256) || \
851 defined(BUILD_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256)
852 #undef BUILD_AES
853 #define BUILD_AES
854 #endif
855
856 #if defined(BUILD_TLS_RSA_WITH_AES_128_GCM_SHA256) || \
857 defined(BUILD_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256) || \
858 defined(BUILD_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) || \
859 defined(BUILD_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256) || \
860 defined(BUILD_TLS_PSK_WITH_AES_128_GCM_SHA256) || \
861 defined(BUILD_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256) || \
862 defined(BUILD_TLS_RSA_WITH_AES_256_GCM_SHA384) || \
863 defined(BUILD_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384) || \
864 defined(BUILD_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) || \
865 defined(BUILD_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384) || \
866 defined(BUILD_TLS_PSK_WITH_AES_256_GCM_SHA384) || \
867 defined(BUILD_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384) || \
868 defined(BUILD_TLS_AES_128_GCM_SHA256) || \
869 defined(BUILD_TLS_AES_256_GCM_SHA384)
870 #define BUILD_AESGCM
871 #else
872 /* No AES-GCM cipher suites available with build */
873 #define NO_AESGCM_AEAD
874 #endif
875
876 #if defined(BUILD_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256) || \
877 defined(BUILD_TLS_DHE_RSA_WITH_CHACHA20_OLD_POLY1305_SHA256) || \
878 defined(BUILD_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256) || \
879 defined(BUILD_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256) || \
880 defined(BUILD_TLS_ECDHE_ECDSA_WITH_CHACHA20_OLD_POLY1305_SHA256) || \
881 defined(BUILD_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256) || \
882 defined(BUILD_TLS_ECDHE_RSA_WITH_CHACHA20_OLD_POLY1305_SHA256) || \

NetBurner, Inc.
1204 File Documentation

883 defined(BUILD_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256) || \
884 defined(BUILD_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256) || \
885 defined(BUILD_TLS_CHACHA20_POLY1305_SHA256)
886 /* Have an available ChaCha Poly cipher suite */
887 #else
888 /* No ChaCha Poly cipher suites available with build */
889 #define NO_CHAPOL_AEAD
890 #endif
891
892 #ifdef NO_DES3
893 #define DES_BLOCK_SIZE 8
894 #else
895 #undef BUILD_DES3
896 #define BUILD_DES3
897 #endif
898
899 #if defined(NO_AES) || !defined(HAVE_AES_DECRYPT)
900 #define AES_BLOCK_SIZE 16
901 #undef BUILD_AES
902 #else
903 #undef BUILD_AES
904 #define BUILD_AES
905 #endif
906
907 #ifndef NO_RC4
908 #undef BUILD_ARC4
909 #define BUILD_ARC4
910 #endif
911
912 #ifdef HAVE_CHACHA
913 #define CHACHA20_BLOCK_SIZE 16
914 #endif
915
916 #if defined(WOLFSSL_MAX_STRENGTH) || \
917 (defined(HAVE_AESGCM) && !defined(NO_AESGCM_AEAD)) || \
918 defined(HAVE_AESCCM) || \
919 (defined(HAVE_CHACHA) && defined(HAVE_POLY1305) && \
920 !defined(NO_CHAPOL_AEAD)) || \
921 (defined(WOLFSSL_TLS13) && defined(HAVE_NULL_CIPHER))
922
923 #define HAVE_AEAD
924 #endif
925
926 #if defined(WOLFSSL_MAX_STRENGTH) || \
927 defined(HAVE_ECC) || !defined(NO_DH)
928
929 #define HAVE_PFS
930 #endif
931
932 /* actual cipher values, 2nd byte */
933 enum {
934 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x16,
935 TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x39,
936 TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x33,
937 TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x34,
938 TLS_RSA_WITH_AES_256_CBC_SHA = 0x35,
939 TLS_RSA_WITH_AES_128_CBC_SHA = 0x2F,
940 TLS_RSA_WITH_NULL_MD5 = 0x01,
941 TLS_RSA_WITH_NULL_SHA = 0x02,
942 TLS_PSK_WITH_AES_256_CBC_SHA = 0x8d,
943 TLS_PSK_WITH_AES_128_CBC_SHA256 = 0xae,
944 TLS_PSK_WITH_AES_256_CBC_SHA384 = 0xaf,
945 TLS_PSK_WITH_AES_128_CBC_SHA = 0x8c,
946 TLS_PSK_WITH_NULL_SHA256 = 0xb0,
947 TLS_PSK_WITH_NULL_SHA384 = 0xb1,
948 TLS_PSK_WITH_NULL_SHA = 0x2c,
949 SSL_RSA_WITH_RC4_128_SHA = 0x05,
950 SSL_RSA_WITH_RC4_128_MD5 = 0x04,
951 SSL_RSA_WITH_3DES_EDE_CBC_SHA = 0x0A,
952
953 /* ECC suites, first byte is 0xC0 (ECC_BYTE) */
954 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA = 0x14,
955 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA = 0x13,
956 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = 0x0A,
957 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = 0x09,
958 TLS_ECDHE_RSA_WITH_RC4_128_SHA = 0x11,
959 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA = 0x07,
960 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x12,
961 TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = 0x08,
962 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = 0x27,
963 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = 0x23,
964 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = 0x28,
965 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = 0x24,
966 TLS_ECDHE_ECDSA_WITH_NULL_SHA = 0x06,
967 TLS_ECDHE_PSK_WITH_NULL_SHA256 = 0x3a,
968 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 = 0x37,
969

NetBurner, Inc.
22.208 internal.h 1205

970 /* static ECDH, first byte is 0xC0 (ECC_BYTE) */


971 TLS_ECDH_RSA_WITH_AES_256_CBC_SHA = 0x0F,
972 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA = 0x0E,
973 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = 0x05,
974 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = 0x04,
975 TLS_ECDH_RSA_WITH_RC4_128_SHA = 0x0C,
976 TLS_ECDH_ECDSA_WITH_RC4_128_SHA = 0x02,
977 TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA = 0x0D,
978 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA = 0x03,
979 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = 0x29,
980 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = 0x25,
981 TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = 0x2A,
982 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = 0x26,
983
984 WDM_WITH_NULL_SHA256 = 0xFE, /* wolfSSL DTLS Multicast */
985
986 /* SHA256 */
987 TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x6b,
988 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x67,
989 TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x3d,
990 TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x3c,
991 TLS_RSA_WITH_NULL_SHA256 = 0x3b,
992 TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 = 0xb2,
993 TLS_DHE_PSK_WITH_NULL_SHA256 = 0xb4,
994
995 /* SHA384 */
996 TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 = 0xb3,
997 TLS_DHE_PSK_WITH_NULL_SHA384 = 0xb5,
998
999 /* AES-GCM */
1000 TLS_RSA_WITH_AES_128_GCM_SHA256 = 0x9c,
1001 TLS_RSA_WITH_AES_256_GCM_SHA384 = 0x9d,
1002 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 = 0x9e,
1003 TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 = 0x9f,
1004 TLS_DH_anon_WITH_AES_256_GCM_SHA384 = 0xa7,
1005 TLS_PSK_WITH_AES_128_GCM_SHA256 = 0xa8,
1006 TLS_PSK_WITH_AES_256_GCM_SHA384 = 0xa9,
1007 TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 = 0xaa,
1008 TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 = 0xab,
1009
1010 /* ECC AES-GCM, first byte is 0xC0 (ECC_BYTE) */
1011 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = 0x2b,
1012 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = 0x2c,
1013 TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = 0x2d,
1014 TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = 0x2e,
1015 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = 0x2f,
1016 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = 0x30,
1017 TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = 0x31,
1018 TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = 0x32,
1019
1020 /* AES-CCM, first byte is 0xC0 but isn’t ECC,
1021 * also, in some of the other AES-CCM suites
1022 * there will be second byte number conflicts
1023 * with non-ECC AES-GCM */
1024 TLS_RSA_WITH_AES_128_CCM_8 = 0xa0,
1025 TLS_RSA_WITH_AES_256_CCM_8 = 0xa1,
1026 TLS_ECDHE_ECDSA_WITH_AES_128_CCM = 0xac,
1027 TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 = 0xae,
1028 TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 = 0xaf,
1029 TLS_PSK_WITH_AES_128_CCM = 0xa4,
1030 TLS_PSK_WITH_AES_256_CCM = 0xa5,
1031 TLS_PSK_WITH_AES_128_CCM_8 = 0xa8,
1032 TLS_PSK_WITH_AES_256_CCM_8 = 0xa9,
1033 TLS_DHE_PSK_WITH_AES_128_CCM = 0xa6,
1034 TLS_DHE_PSK_WITH_AES_256_CCM = 0xa7,
1035
1036 /* Camellia */
1037 TLS_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x41,
1038 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x84,
1039 TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xba,
1040 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0xc0,
1041 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA = 0x45,
1042 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA = 0x88,
1043 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 = 0xbe,
1044 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 = 0xc4,
1045
1046 /* chacha20-poly1305 suites first byte is 0xCC (CHACHA_BYTE) */
1047 TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xa8,
1048 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = 0xa9,
1049 TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = 0xaa,
1050 TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xac,
1051 TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xab,
1052 TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 = 0xad,
1053
1054 /* chacha20-poly1305 earlier version of nonce and padding (CHACHA_BYTE) */
1055 TLS_ECDHE_RSA_WITH_CHACHA20_OLD_POLY1305_SHA256 = 0x13,
1056 TLS_ECDHE_ECDSA_WITH_CHACHA20_OLD_POLY1305_SHA256 = 0x14,

NetBurner, Inc.
1206 File Documentation

1057 TLS_DHE_RSA_WITH_CHACHA20_OLD_POLY1305_SHA256 = 0x15,


1058
1059 /* ECDHE_PSK RFC8442, first byte is 0xD0 (EDHE_PSK_BYTE) */
1060 TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 = 0x01,
1061
1062 /* TLS v1.3 cipher suites */
1063 TLS_AES_128_GCM_SHA256 = 0x01,
1064 TLS_AES_256_GCM_SHA384 = 0x02,
1065 TLS_CHACHA20_POLY1305_SHA256 = 0x03,
1066 TLS_AES_128_CCM_SHA256 = 0x04,
1067 TLS_AES_128_CCM_8_SHA256 = 0x05,
1068
1069 /* TLS v1.3 Integrity only cipher suites - 0xC0 (ECC) first byte */
1070 TLS_SHA256_SHA256 = 0xB4,
1071 TLS_SHA384_SHA384 = 0xB5,
1072
1073 /* Fallback SCSV (Signaling Cipher Suite Value) */
1074 TLS_FALLBACK_SCSV = 0x56,
1075 /* Renegotiation Indication Extension Special Suite */
1076 TLS_EMPTY_RENEGOTIATION_INFO_SCSV = 0xff
1077 };
1078
1079
1080 #ifndef WOLFSSL_SESSION_TIMEOUT
1081 #define WOLFSSL_SESSION_TIMEOUT 500
1082 /* default session resumption cache timeout in seconds */
1083 #endif
1084
1085
1086 #ifndef WOLFSSL_DTLS_WINDOW_WORDS
1087 #define WOLFSSL_DTLS_WINDOW_WORDS 2
1088 #endif /* WOLFSSL_DTLS_WINDOW_WORDS */
1089 #define DTLS_WORD_BITS (sizeof(word32) * CHAR_BIT)
1090 #define DTLS_SEQ_BITS (WOLFSSL_DTLS_WINDOW_WORDS * DTLS_WORD_BITS)
1091 #define DTLS_SEQ_SZ (sizeof(word32) * WOLFSSL_DTLS_WINDOW_WORDS)
1092
1093 #ifndef WOLFSSL_MULTICAST
1094 #define WOLFSSL_DTLS_PEERSEQ_SZ 1
1095 #else
1096 #ifndef WOLFSSL_MULTICAST_PEERS
1097 /* max allowed multicast group peers */
1098 #define WOLFSSL_MULTICAST_PEERS 100
1099 #endif
1100 #define WOLFSSL_DTLS_PEERSEQ_SZ WOLFSSL_MULTICAST_PEERS
1101 #endif /* WOLFSSL_MULTICAST */
1102
1103 #ifndef WOLFSSL_MAX_MTU
1104 /* 1500 - 100 bytes to account for UDP and IP headers */
1105 #define WOLFSSL_MAX_MTU 1400
1106 #endif /* WOLFSSL_MAX_MTU */
1107
1108 #ifndef WOLFSSL_DTLS_MTU_ADDITIONAL_READ_BUFFER
1109 #define WOLFSSL_DTLS_MTU_ADDITIONAL_READ_BUFFER 500
1110 #endif /* WOLFSSL_DTLS_MTU_ADDITIONAL_READ_BUFFER */
1111
1112
1113 /* set minimum DH key size allowed */
1114 #ifndef WOLFSSL_MIN_DHKEY_BITS
1115 #ifdef WOLFSSL_MAX_STRENGTH
1116 #define WOLFSSL_MIN_DHKEY_BITS 2048
1117 #else
1118 #define WOLFSSL_MIN_DHKEY_BITS 1024
1119 #endif
1120 #endif
1121 #if (WOLFSSL_MIN_DHKEY_BITS % 8)
1122 #error DH minimum bit size must be multiple of 8
1123 #endif
1124 #if (WOLFSSL_MIN_DHKEY_BITS > 16000)
1125 #error DH minimum bit size must not be greater than 16000
1126 #endif
1127 #define MIN_DHKEY_SZ (WOLFSSL_MIN_DHKEY_BITS / 8)
1128 /* set maximum DH key size allowed */
1129 #ifndef WOLFSSL_MAX_DHKEY_BITS
1130 #if (defined(USE_FAST_MATH) && defined(FP_MAX_BITS) && FP_MAX_BITS >= 16384)
1131 #define WOLFSSL_MAX_DHKEY_BITS (FP_MAX_BITS / 2)
1132 #else
1133 #define WOLFSSL_MAX_DHKEY_BITS 4096
1134 #endif
1135 #endif
1136 #if (WOLFSSL_MAX_DHKEY_BITS % 8)
1137 #error DH maximum bit size must be multiple of 8
1138 #endif
1139 #if (WOLFSSL_MAX_DHKEY_BITS > 16384)
1140 #error DH maximum bit size must not be greater than 16384
1141 #endif
1142 #define MAX_DHKEY_SZ (WOLFSSL_MAX_DHKEY_BITS / 8)
1143

NetBurner, Inc.
22.208 internal.h 1207

1144 #ifndef MAX_PSK_ID_LEN


1145 /* max psk identity/hint supported */
1146 #if defined(WOLFSSL_TLS13)
1147 /* OpenSSL has a 1472 byte session ticket */
1148 #define MAX_PSK_ID_LEN 1536
1149 #else
1150 #define MAX_PSK_ID_LEN 128
1151 #endif
1152 #endif
1153
1154 #ifndef MAX_EARLY_DATA_SZ
1155 /* maximum early data size */
1156 #define MAX_EARLY_DATA_SZ 4096
1157 #endif
1158
1159 #ifndef WOLFSSL_MAX_RSA_BITS
1160 #ifdef USE_FAST_MATH
1161 /* FP implementation support numbers up to FP_MAX_BITS / 2 bits. */
1162 #define WOLFSSL_MAX_RSA_BITS (FP_MAX_BITS / 2)
1163 #elif defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)
1164 /* SP implementation supports numbers of SP_INT_BITS bits. */
1165 #define WOLFSSL_MAX_RSA_BITS (((SP_INT_BITS + 7) / 8) * 8)
1166 #else
1167 /* Integer maths is dynamic but we only go up to 4096 bits. */
1168 #define WOLFSSL_MAX_RSA_BITS 4096
1169 #endif
1170 #endif
1171 #if (WOLFSSL_MAX_RSA_BITS % 8)
1172 #error RSA maximum bit size must be multiple of 8
1173 #endif
1174
1175
1176 /* MySQL wants to be able to use 8192-bit numbers. */
1177 #if defined(USE_FAST_MATH) && defined(FP_MAX_BITS)
1178 /* Use the FP size up to 8192-bit and down to a min of 1024-bit. */
1179 #if FP_MAX_BITS >= 16384
1180 #define ENCRYPT_BASE_BITS 8192
1181 #elif defined(HAVE_ECC)
1182 #if FP_MAX_BITS > 2224
1183 #define ENCRYPT_BASE_BITS (FP_MAX_BITS / 2)
1184 #else
1185 /* 521-bit ASN.1 signature - 3 + 2 * (2 + 66) bytes. */
1186 #define ENCRYPT_BASE_BITS 1112
1187 #endif
1188 #else
1189 #if FP_MAX_BITS > 2048
1190 #define ENCRYPT_BASE_BITS (FP_MAX_BITS / 2)
1191 #else
1192 #define ENCRYPT_BASE_BITS 1024
1193 #endif
1194 #endif
1195
1196 /* Check MySQL size requirements met. */
1197 #if defined(WOLFSSL_MYSQL_COMPATIBLE) && ENCRYPT_BASE_BITS < 8192
1198 #error "MySQL needs FP_MAX_BITS at least at 16384"
1199 #endif
1200
1201 #if WOLFSSL_MAX_RSA_BITS > ENCRYPT_BASE_BITS
1202 #error "FP_MAX_BITS too small for WOLFSSL_MAX_RSA_BITS"
1203 #endif
1204 #elif defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)
1205 /* Use the SP size up to 8192-bit and down to a min of 1024-bit. */
1206 #if SP_INT_BITS >= 8192
1207 #define ENCRYPT_BASE_BITS 8192
1208 #elif defined(HAVE_ECC)
1209 #if SP_INT_BITS > 1112
1210 #define ENCRYPT_BASE_BITS SP_INT_BITS
1211 #else
1212 /* 521-bit ASN.1 signature - 3 + 2 * (2 + 66) bytes. */
1213 #define ENCRYPT_BASE_BITS 1112
1214 #endif
1215 #else
1216 #if SP_INT_BITS > 1024
1217 #define ENCRYPT_BASE_BITS SP_INT_BITS
1218 #else
1219 #define ENCRYPT_BASE_BITS 1024
1220 #endif
1221 #endif
1222
1223 /* Check MySQL size requirements met. */
1224 #if defined(WOLFSSL_MYSQL_COMPATIBLE) && ENCRYPT_BASE_BITS < 8192
1225 #error "MySQL needs SP_INT_BITS at least at 8192"
1226 #endif
1227
1228 #if WOLFSSL_MAX_RSA_BITS > SP_INT_BITS
1229 #error "SP_INT_BITS too small for WOLFSSL_MAX_RSA_BITS"
1230 #endif

NetBurner, Inc.
1208 File Documentation

1231 #else
1232 /* Integer/heap maths - support 4096-bit. */
1233 #define ENCRYPT_BASE_BITS 4096
1234 #endif
1235
1236 #ifdef WOLFSSL_DTLS_CID
1237 #ifndef DTLS_CID_MAX_SIZE
1238 /* DTLSv1.3 parsing code copies the record header in a static buffer to decrypt
1239 * the record. Increasing the CID max size does increase also this buffer,
1240 * impacting on per-session runtime memory footprint. */
1241 #define DTLS_CID_MAX_SIZE 2
1242 #endif
1243 #else
1244 #undef DTLS_CID_MAX_SIZE
1245 #define DTLS_CID_MAX_SIZE 0
1246 #endif /* WOLFSSL_DTLS_CID */
1247
1248 #if DTLS_CID_MAX_SIZE > 255
1249 #error "Max size for DTLS CID is 255 bytes"
1250 #endif
1251
1252 enum Misc {
1253 CIPHER_BYTE = 0x00, /* Default ciphers */
1254 ECC_BYTE = 0xC0, /* ECC first cipher suite byte */
1255 CHACHA_BYTE = 0xCC, /* ChaCha first cipher suite */
1256 TLS13_BYTE = 0x13, /* TLS v1.3 first byte of cipher suite */
1257 ECDHE_PSK_BYTE = 0xD0, /* RFC 8442 */
1258
1259 SEND_CERT = 1,
1260 SEND_BLANK_CERT = 2,
1261
1262 DTLS_MAJOR = 0xfe, /* DTLS major version number */
1263 DTLS_MINOR = 0xff, /* DTLS minor version number */
1264 DTLS_BOGUS_MINOR = 0xfe, /* DTLS 0xfe was skipped, see RFC6347 Sec. 1 */
1265 DTLSv1_2_MINOR = 0xfd, /* DTLS minor version number */
1266 DTLSv1_3_MINOR = 0xfc, /* DTLS minor version number */
1267 SSLv3_MAJOR = 3, /* SSLv3 and TLSv1+ major version number */
1268 SSLv3_MINOR = 0, /* TLSv1 minor version number */
1269 TLSv1_MINOR = 1, /* TLSv1 minor version number */
1270 TLSv1_1_MINOR = 2, /* TLSv1_1 minor version number */
1271 TLSv1_2_MINOR = 3, /* TLSv1_2 minor version number */
1272 TLSv1_3_MINOR = 4, /* TLSv1_3 minor version number */
1273 TLS_DRAFT_MAJOR = 0x7f, /* Draft TLS major version number */
1274 OLD_HELLO_ID = 0x01, /* SSLv2 Client Hello Indicator */
1275 INVALID_BYTE = 0xff, /* Used to initialize cipher specs values */
1276 NO_COMPRESSION = 0,
1277 ZLIB_COMPRESSION = 221, /* wolfSSL zlib compression */
1278 HELLO_EXT_SIG_ALGO = 13, /* ID for the sig_algo hello extension */
1279 HELLO_EXT_EXTMS = 0x0017, /* ID for the extended master secret ext */
1280 SECRET_LEN = WOLFSSL_MAX_MASTER_KEY_LENGTH,
1281 /* pre RSA and all master */
1282 TIMESTAMP_LEN = 4, /* timestamp size in ticket */
1283 #ifdef WOLFSSL_TLS13
1284 AGEADD_LEN = 4, /* ageAdd size in ticket */
1285 NAMEDGROUP_LEN = 2, /* namedGroup size in ticket */
1286 #ifdef WOLFSSL_EARLY_DATA
1287 MAXEARLYDATASZ_LEN = 4, /* maxEarlyDataSz size in ticket */
1288 #endif
1289 #endif
1290 #ifdef HAVE_PQC
1291 ENCRYPT_LEN = 4600, /* allow 4600 byte buffer for dilithium. */
1292 #else
1293 #ifndef NO_PSK
1294 ENCRYPT_LEN = (ENCRYPT_BASE_BITS / 8) + MAX_PSK_ID_LEN + 2,
1295 #else
1296 ENCRYPT_LEN = (ENCRYPT_BASE_BITS / 8),
1297 #endif
1298 #endif
1299 SIZEOF_SENDER = 4, /* clnt or srvr */
1300 FINISHED_SZ = 36, /* WC_MD5_DIGEST_SIZE + WC_SHA_DIGEST_SIZE */
1301 MAX_RECORD_SIZE = 16384, /* 2^14, max size by standard */
1302 MAX_PLAINTEXT_SZ = (1 « 14), /* Max plaintext sz */
1303 MAX_TLS_CIPHER_SZ = (1 « 14) + 2048, /* Max TLS encrypted data sz */
1304 #ifdef WOLFSSL_TLS13
1305 MAX_TLS13_PLAIN_SZ = (1 « 14) + 1, /* Max unencrypted data sz */
1306 MAX_TLS13_ENC_SZ = (1 « 14) + 256, /* Max encrypted data sz */
1307 #endif
1308 MAX_MSG_EXTRA = 38 + WC_MAX_DIGEST_SIZE,
1309 /* max added to msg, mac + pad from */
1310 /* RECORD_HEADER_SZ + BLOCK_SZ (pad) + Max
1311 digest sz + BLOC_SZ (iv) + pad byte (1) */
1312 MAX_COMP_EXTRA = 1024, /* max compression extra */
1313 MAX_MTU = WOLFSSL_MAX_MTU, /* max expected MTU */
1314 MAX_UDP_SIZE = 8192 - 100, /* was MAX_MTU - 100 */
1315 MAX_DH_SZ = (MAX_DHKEY_SZ * 3) + 12, /* DH_P, DH_G and DH_Pub */
1316 /* 4096 p, pub, g + 2 byte size for each */
1317 MAX_STR_VERSION = 8, /* string rep of protocol version */

NetBurner, Inc.
22.208 internal.h 1209

1318
1319 PAD_MD5 = 48, /* pad length for finished */
1320 PAD_SHA = 40, /* pad length for finished */
1321 MAX_PAD_SIZE = 256, /* maximum length of padding */
1322
1323 LENGTH_SZ = 2, /* length field for HMAC, data only */
1324 VERSION_SZ = 2, /* length of proctocol version */
1325 SEQ_SZ = 8, /* 64 bit sequence number */
1326 ALERT_SIZE = 2, /* level + description */
1327 VERIFY_HEADER = 2, /* always use 2 bytes */
1328 EXTS_SZ = 2, /* always use 2 bytes */
1329 EXT_ID_SZ = 2, /* always use 2 bytes */
1330 MAX_DH_SIZE = MAX_DHKEY_SZ+1,
1331 /* Max size plus possible leading 0 */
1332 MIN_FFHDE_GROUP = 0x100, /* Named group minimum for FFDHE parameters */
1333 MAX_FFHDE_GROUP = 0x1FF, /* Named group maximum for FFDHE parameters */
1334 SESSION_HINT_SZ = 4, /* session timeout hint */
1335 SESSION_ADD_SZ = 4, /* session age add */
1336 TICKET_NONCE_LEN_SZ = 1, /* Ticket nonce length size */
1337 DEF_TICKET_NONCE_SZ = 1, /* Default ticket nonce size */
1338 MAX_TICKET_NONCE_SZ = 8, /* maximum ticket nonce size */
1339 MAX_LIFETIME = 604800, /* maximum ticket lifetime */
1340
1341 RAN_LEN = 32, /* random length */
1342 SEED_LEN = RAN_LEN * 2, /* tls prf seed length */
1343 ID_LEN = 32, /* session id length */
1344 COOKIE_SECRET_SZ = 14, /* dtls cookie secret size */
1345 MAX_COOKIE_LEN = 32, /* max dtls cookie size */
1346 COOKIE_SZ = 20, /* use a 20 byte cookie */
1347 SUITE_LEN = 2, /* cipher suite sz length */
1348 ENUM_LEN = 1, /* always a byte */
1349 OPAQUE8_LEN = 1, /* 1 byte */
1350 OPAQUE16_LEN = 2, /* 2 bytes */
1351 OPAQUE24_LEN = 3, /* 3 bytes */
1352 OPAQUE32_LEN = 4, /* 4 bytes */
1353 OPAQUE64_LEN = 8, /* 8 bytes */
1354 COMP_LEN = 1, /* compression length */
1355 CURVE_LEN = 2, /* ecc named curve length */
1356 KE_GROUP_LEN = 2, /* key exchange group length */
1357 SERVER_ID_LEN = 20, /* server session id length */
1358
1359 HANDSHAKE_HEADER_SZ = 4, /* type + length(3) */
1360 RECORD_HEADER_SZ = 5, /* type + version + len(2) */
1361 CERT_HEADER_SZ = 3, /* always 3 bytes */
1362 REQ_HEADER_SZ = 2, /* cert request header sz */
1363 HINT_LEN_SZ = 2, /* length of hint size field */
1364 TRUNCATED_HMAC_SZ = 10, /* length of hmac w/ truncated hmac extension */
1365 HELLO_EXT_SZ = 4, /* base length of a hello extension */
1366 HELLO_EXT_TYPE_SZ = 2, /* length of a hello extension type */
1367 HELLO_EXT_SZ_SZ = 2, /* length of a hello extension size */
1368 HELLO_EXT_SIGALGO_SZ = 2, /* length of number of items in sigalgo list */
1369
1370 DTLS_HANDSHAKE_HEADER_SZ = 12, /* normal + seq(2) + offset(3) + length(3) */
1371 DTLS_RECORD_HEADER_SZ = 13, /* normal + epoch(2) + seq_num(6) */
1372 DTLS_UNIFIED_HEADER_MIN_SZ = 2,
1373 /* flags + seq_number(2) + length(2) + CID */
1374 DTLS_RECVD_RL_HEADER_MAX_SZ = 5 + DTLS_CID_MAX_SIZE,
1375 DTLS_RECORD_HEADER_MAX_SZ = 13,
1376 DTLS_HANDSHAKE_EXTRA = 8, /* diff from normal */
1377 DTLS_RECORD_EXTRA = 8, /* diff from normal */
1378 DTLS_HANDSHAKE_SEQ_SZ = 2, /* handshake header sequence number */
1379 DTLS_HANDSHAKE_FRAG_SZ = 3, /* fragment offset and length are 24 bit */
1380 DTLS_POOL_SZ = 255,/* allowed number of list items in TX pool */
1381 DTLS_EXPORT_PRO = 165,/* wolfSSL protocol for serialized session */
1382 DTLS_EXPORT_STATE_PRO = 166,/* wolfSSL protocol for serialized state */
1383 TLS_EXPORT_PRO = 167,/* wolfSSL protocol for serialized TLS */
1384 DTLS_EXPORT_OPT_SZ = 61, /* amount of bytes used from Options */
1385 TLS_EXPORT_OPT_SZ = 65, /* amount of bytes used from Options */
1386 DTLS_EXPORT_OPT_SZ_3 = 60, /* amount of bytes used from Options */
1387 DTLS_EXPORT_KEY_SZ = 325 + (DTLS_SEQ_SZ * 2),
1388 /* max amount of bytes used from Keys */
1389 DTLS_EXPORT_MIN_KEY_SZ = 85 + (DTLS_SEQ_SZ * 2),
1390 /* min amount of bytes used from Keys */
1391 WOLFSSL_EXPORT_TLS = 1,
1392 WOLFSSL_EXPORT_DTLS = 0,
1393 #ifndef WOLFSSL_EXPORT_SPC_SZ
1394 WOLFSSL_EXPORT_SPC_SZ = 16, /* amount of bytes used from CipherSpecs */
1395 #endif
1396 WOLFSSL_EXPORT_LEN = 2, /* 2 bytes for length and protocol */
1397 WOLFSSL_EXPORT_VERSION = 4, /* wolfSSL version for serialized session */
1398
1399 /* older export versions supported */
1400 WOLFSSL_EXPORT_VERSION_3 = 3, /* wolfSSL version before TLS 1.3 addition */
1401
1402 MAX_EXPORT_IP = 46, /* max ip size IPv4 mapped IPv6 */
1403 DTLS_MTU_ADDITIONAL_READ_BUFFER = WOLFSSL_DTLS_MTU_ADDITIONAL_READ_BUFFER,
1404 /* Additional bytes to read so that

NetBurner, Inc.
1210 File Documentation

1405 * we can work with a peer that has


1406 * a slightly different MTU than us. */
1407 MAX_EXPORT_BUFFER = 514, /* max size of buffer for exporting */
1408 MAX_EXPORT_STATE_BUFFER = (DTLS_EXPORT_MIN_KEY_SZ) + (3 * WOLFSSL_EXPORT_LEN),
1409 /* max size of buffer for exporting state */
1410 FINISHED_LABEL_SZ = 15, /* TLS finished label size */
1411 TLS_FINISHED_SZ = 12, /* TLS has a shorter size */
1412 TLS_FINISHED_SZ_MAX = WC_MAX_DIGEST_SIZE,
1413 /* longest message digest size is SHA512, 64 */
1414 EXT_MASTER_LABEL_SZ = 22, /* TLS extended master secret label sz */
1415 MASTER_LABEL_SZ = 13, /* TLS master secret label sz */
1416 KEY_LABEL_SZ = 13, /* TLS key block expansion sz */
1417 PROTOCOL_LABEL_SZ = 9, /* Length of the protocol label */
1418 MAX_LABEL_SZ = 34, /* Maximum length of a label */
1419 MAX_REQUEST_SZ = 256, /* Maximum cert req len (no auth yet */
1420 SESSION_FLUSH_COUNT = 256, /* Flush session cache unless user turns off */
1421 TLS_MAX_PAD_SZ = 255, /* Max padding in TLS */
1422
1423 #if defined(HAVE_FIPS) && \
1424 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
1425 MAX_SYM_KEY_SIZE = AES_256_KEY_SIZE,
1426 #else
1427 #if defined(HAVE_NULL_CIPHER) && defined(WOLFSSL_TLS13)
1428 #if defined(WOLFSSL_SHA384) && WC_MAX_SYM_KEY_SIZE < 48
1429 MAX_SYM_KEY_SIZE = WC_SHA384_DIGEST_SIZE,
1430 #elif !defined(NO_SHA256) && WC_MAX_SYM_KEY_SIZE < 32
1431 MAX_SYM_KEY_SIZE = WC_SHA256_DIGEST_SIZE,
1432 #else
1433 MAX_SYM_KEY_SIZE = WC_MAX_SYM_KEY_SIZE,
1434 #endif
1435 #else
1436 MAX_SYM_KEY_SIZE = WC_MAX_SYM_KEY_SIZE,
1437 #endif
1438 #endif
1439
1440 #if defined(HAVE_SELFTEST) && \
1441 (!defined(HAVE_SELFTEST_VERSION) || (HAVE_SELFTEST_VERSION < 2))
1442 #ifndef WOLFSSL_AES_KEY_SIZE_ENUM
1443 #define WOLFSSL_AES_KEY_SIZE_ENUM
1444 AES_IV_SIZE = 16,
1445 AES_128_KEY_SIZE = 16,
1446 AES_192_KEY_SIZE = 24,
1447 AES_256_KEY_SIZE = 32,
1448 #endif
1449 #endif
1450
1451 MAX_IV_SZ = AES_BLOCK_SIZE,
1452
1453 AEAD_SEQ_OFFSET = 4, /* Auth Data: Sequence number */
1454 AEAD_TYPE_OFFSET = 8, /* Auth Data: Type */
1455 AEAD_VMAJ_OFFSET = 9, /* Auth Data: Major Version */
1456 AEAD_VMIN_OFFSET = 10, /* Auth Data: Minor Version */
1457 AEAD_LEN_OFFSET = 11, /* Auth Data: Length */
1458 AEAD_AUTH_DATA_SZ = 13, /* Size of the data to authenticate */
1459 AEAD_NONCE_SZ = 12,
1460 AESGCM_IMP_IV_SZ = 4, /* Size of GCM/CCM AEAD implicit IV */
1461 AESGCM_EXP_IV_SZ = 8, /* Size of GCM/CCM AEAD explicit IV */
1462 AESGCM_NONCE_SZ = AESGCM_EXP_IV_SZ + AESGCM_IMP_IV_SZ,
1463
1464 CHACHA20_IMP_IV_SZ = 12, /* Size of ChaCha20 AEAD implicit IV */
1465 CHACHA20_NONCE_SZ = 12, /* Size of ChacCha20 nonce */
1466 CHACHA20_OLD_OFFSET = 4, /* Offset for seq # in old poly1305 */
1467
1468 /* For any new implicit/explicit IV size adjust AEAD_MAX_***_SZ */
1469
1470 AES_GCM_AUTH_SZ = 16, /* AES-GCM Auth Tag length */
1471 AES_CCM_16_AUTH_SZ = 16, /* AES-CCM-16 Auth Tag length */
1472 AES_CCM_8_AUTH_SZ = 8, /* AES-CCM-8 Auth Tag Length */
1473 AESCCM_NONCE_SZ = 12,
1474
1475 CAMELLIA_128_KEY_SIZE = 16, /* for 128 bit */
1476 CAMELLIA_192_KEY_SIZE = 24, /* for 192 bit */
1477 CAMELLIA_256_KEY_SIZE = 32, /* for 256 bit */
1478 CAMELLIA_IV_SIZE = 16, /* always block size */
1479
1480 CHACHA20_256_KEY_SIZE = 32, /* for 256 bit */
1481 CHACHA20_128_KEY_SIZE = 16, /* for 128 bit */
1482 CHACHA20_IV_SIZE = 12, /* 96 bits for iv */
1483
1484 POLY1305_AUTH_SZ = 16, /* 128 bits */
1485
1486 HMAC_NONCE_SZ = 12, /* Size of HMAC nonce */
1487
1488 EVP_SALT_SIZE = 8, /* evp salt size 64 bits */
1489
1490 #ifndef ECDHE_SIZE /* allow this to be overridden at compile-time */
1491 ECDHE_SIZE = 32, /* ECDHE server size defaults to 256 bit */

NetBurner, Inc.
22.208 internal.h 1211

1492 #endif
1493 MAX_EXPORT_ECC_SZ = 256, /* Export ANS X9.62 max future size */
1494 MAX_CURVE_NAME_SZ = 16, /* Maximum size of curve name string */
1495
1496 NEW_SA_MAJOR = 8, /* Most significant byte used with new sig algos */
1497 ED25519_SA_MAJOR = 8, /* Most significant byte for ED25519 */
1498 ED25519_SA_MINOR = 7, /* Least significant byte for ED25519 */
1499 ED448_SA_MAJOR = 8, /* Most significant byte for ED448 */
1500 ED448_SA_MINOR = 8, /* Least significant byte for ED448 */
1501
1502 PQC_SA_MAJOR = 0xFE,/* Most significant byte used with PQC sig algs */
1503
1504 /* These values for falcon and dilithium match what OQS has defined in their OpenSSL fork. */
1505 FALCON_LEVEL1_SA_MAJOR = 0xFE,
1506 FALCON_LEVEL1_SA_MINOR = 0x0B,
1507 FALCON_LEVEL5_SA_MAJOR = 0xFE,
1508 FALCON_LEVEL5_SA_MINOR = 0x0E,
1509
1510 DILITHIUM_LEVEL2_SA_MAJOR = 0xFE,
1511 DILITHIUM_LEVEL2_SA_MINOR = 0xA0,
1512 DILITHIUM_LEVEL3_SA_MAJOR = 0xFE,
1513 DILITHIUM_LEVEL3_SA_MINOR = 0xA3,
1514 DILITHIUM_LEVEL5_SA_MAJOR = 0xFE,
1515 DILITHIUM_LEVEL5_SA_MINOR = 0xA5,
1516
1517 DILITHIUM_AES_LEVEL2_SA_MAJOR = 0xFE,
1518 DILITHIUM_AES_LEVEL2_SA_MINOR = 0xA7,
1519 DILITHIUM_AES_LEVEL3_SA_MAJOR = 0xFE,
1520 DILITHIUM_AES_LEVEL3_SA_MINOR = 0xAA,
1521 DILITHIUM_AES_LEVEL5_SA_MAJOR = 0xFE,
1522 DILITHIUM_AES_LEVEL5_SA_MINOR = 0xAC,
1523
1524 MIN_RSA_SHA512_PSS_BITS = 512 * 2 + 8 * 8, /* Min key size */
1525 MIN_RSA_SHA384_PSS_BITS = 384 * 2 + 8 * 8, /* Min key size */
1526
1527 #if defined(HAVE_PQC)
1528 MAX_CERT_VERIFY_SZ = 6000, /* For Dilithium */
1529 #elif !defined(NO_RSA)
1530 MAX_CERT_VERIFY_SZ = WOLFSSL_MAX_RSA_BITS / 8, /* max RSA bytes */
1531 #elif defined(HAVE_ECC)
1532 MAX_CERT_VERIFY_SZ = ECC_MAX_SIG_SIZE, /* max ECC */
1533 #elif defined(HAVE_ED448)
1534 MAX_CERT_VERIFY_SZ = ED448_SIG_SIZE, /* max Ed448 */
1535 #elif defined(HAVE_ED25519)
1536 MAX_CERT_VERIFY_SZ = ED25519_SIG_SIZE, /* max Ed25519 */
1537 #else
1538 MAX_CERT_VERIFY_SZ = 1024, /* max default */
1539 #endif
1540 CLIENT_HELLO_FIRST = 35, /* Protocol + RAN_LEN + sizeof(id_len) */
1541 MAX_SUITE_NAME = 48, /* maximum length of cipher suite string */
1542
1543 DTLS_TIMEOUT_INIT = 1, /* default timeout init for DTLS receive */
1544 DTLS_TIMEOUT_MAX = 64, /* default max timeout for DTLS receive */
1545 DTLS_TIMEOUT_MULTIPLIER = 2, /* default timeout multiplier for DTLS recv */
1546
1547 NULL_TERM_LEN = 1, /* length of null ’\0’ termination character */
1548 MAX_PSK_KEY_LEN = 64, /* max psk key supported */
1549 MIN_PSK_ID_LEN = 6, /* min length of identities */
1550 MIN_PSK_BINDERS_LEN = 33, /* min length of binders */
1551 MAX_TICKET_AGE_DIFF = 10, /* maximum ticket age difference in seconds */
1552 TLS13_MAX_TICKET_AGE = 7*24*60*60, /* max ticket age in seconds, 7 days */
1553
1554 #ifndef MAX_WOLFSSL_FILE_SIZE
1555 MAX_WOLFSSL_FILE_SIZE = 1024UL * 1024UL * 4, /* 4 mb file size alloc limit */
1556 #endif
1557
1558 #if defined(HAVE_PQC)
1559 MAX_X509_SIZE = 8*1024, /* max static x509 buffer size; dilithium is big */
1560 #elif defined(WOLFSSL_HAPROXY)
1561 MAX_X509_SIZE = 3072, /* max static x509 buffer size */
1562 #else
1563 MAX_X509_SIZE = 2048, /* max static x509 buffer size */
1564 #endif
1565 CERT_MIN_SIZE = 256, /* min PEM cert size with header/footer */
1566
1567 NO_SNIFF = 0, /* not sniffing */
1568 SNIFF = 1, /* currently sniffing */
1569
1570 HASH_SIG_SIZE = 2, /* default SHA1 RSA */
1571
1572 NO_COPY = 0, /* should we copy static buffer for write */
1573 COPY = 1, /* should we copy static buffer for write */
1574
1575 INVALID_PEER_ID = 0xFFFF, /* Initialize value for peer ID. */
1576
1577 PREV_ORDER = -1, /* Sequence number is in previous epoch. */
1578 PEER_ORDER = 1, /* Peer sequence number for verify. */

NetBurner, Inc.
1212 File Documentation

1579 CUR_ORDER = 0, /* Current sequence number. */


1580 WRITE_PROTO = 1, /* writing a protocol message */
1581 READ_PROTO = 0 /* reading a protocol message */
1582 };
1583
1584 #define WOLFSSL_NAMED_GROUP_IS_FFHDE(group) \
1585 (MIN_FFHDE_GROUP <= (group) && (group) <= MAX_FFHDE_GROUP)
1586 #ifdef HAVE_PQC
1587 #define WOLFSSL_NAMED_GROUP_IS_PQC(group) \
1588 (WOLFSSL_PQC_MIN <= (group) && (group) <= WOLFSSL_PQC_MAX)
1589 #else
1590 #define WOLFSSL_NAMED_GROUP_IS_PQC(group) ((void)(group), 0)
1591 #endif /* HAVE_PQC */
1592
1593 /* minimum Downgrade Minor version */
1594 #ifndef WOLFSSL_MIN_DOWNGRADE
1595 #ifndef NO_OLD_TLS
1596 #define WOLFSSL_MIN_DOWNGRADE TLSv1_MINOR
1597 #else
1598 #define WOLFSSL_MIN_DOWNGRADE TLSv1_2_MINOR
1599 #endif
1600 #endif
1601
1602 /* minimum DTLS Downgrade Minor version */
1603 #ifndef WOLFSSL_MIN_DTLS_DOWNGRADE
1604 #define WOLFSSL_MIN_DTLS_DOWNGRADE DTLS_MINOR;
1605 #endif
1606
1607 /* Set max implicit IV size for AEAD cipher suites */
1608 #define AEAD_MAX_IMP_SZ 12
1609
1610 /* Set max explicit IV size for AEAD cipher suites */
1611 #define AEAD_MAX_EXP_SZ 8
1612
1613
1614 #ifndef WOLFSSL_MAX_SUITE_SZ
1615 #define WOLFSSL_MAX_SUITE_SZ 300
1616 /* 150 suites for now! */
1617 #endif
1618
1619 /* number of items in the signature algo list */
1620 #ifndef WOLFSSL_MAX_SIGALGO
1621 #ifdef HAVE_PQC
1622 /* If we are building with post-quantum algorithms, we likely want to
1623 * inter-op with OQS’s OpenSSL and they send a lot more sigalgs.
1624 */
1625 #define WOLFSSL_MAX_SIGALGO 128
1626 #else
1627 #define WOLFSSL_MAX_SIGALGO 38
1628 #endif
1629 #endif
1630
1631
1632 /* set minimum ECC key size allowed */
1633 #ifndef WOLFSSL_MIN_ECC_BITS
1634 #ifdef WOLFSSL_MAX_STRENGTH
1635 #define WOLFSSL_MIN_ECC_BITS 256
1636 #else
1637 #define WOLFSSL_MIN_ECC_BITS 224
1638 #endif
1639 #endif /* WOLFSSL_MIN_ECC_BITS */
1640 #if (WOLFSSL_MIN_ECC_BITS % 8)
1641 /* Some ECC keys are not divisible by 8 such as prime239v1 or sect131r1.
1642 In these cases round down to the nearest value divisible by 8. The
1643 restriction of being divisible by 8 is in place to match wc_ecc_size
1644 function from wolfSSL.
1645 */
1646 #error ECC minimum bit size must be a multiple of 8
1647 #endif
1648 #define MIN_ECCKEY_SZ (WOLFSSL_MIN_ECC_BITS / 8)
1649
1650 #ifdef HAVE_PQC
1651 #ifndef MIN_FALCONKEY_SZ
1652 #define MIN_FALCONKEY_SZ 897
1653 #endif
1654 #ifndef MIN_DILITHIUMKEY_SZ
1655 #define MIN_DILITHIUMKEY_SZ 1312
1656 #endif
1657 #endif
1658
1659 /* set minimum RSA key size allowed */
1660 #ifndef WOLFSSL_MIN_RSA_BITS
1661 #ifdef WOLFSSL_MAX_STRENGTH
1662 #define WOLFSSL_MIN_RSA_BITS 2048
1663 #else
1664 #define WOLFSSL_MIN_RSA_BITS 1024
1665 #endif

NetBurner, Inc.
22.208 internal.h 1213

1666 #endif /* WOLFSSL_MIN_RSA_BITS */


1667 #if (WOLFSSL_MIN_RSA_BITS % 8)
1668 /* This is to account for the example case of a min size of 2050 bits but
1669 still allows 2049 bit key. So we need the measurement to be in bytes. */
1670 #error RSA minimum bit size must be a multiple of 8
1671 #endif
1672 #define MIN_RSAKEY_SZ (WOLFSSL_MIN_RSA_BITS / 8)
1673
1674 #ifdef SESSION_INDEX
1675 /* Shift values for making a session index */
1676 #define SESSIDX_ROW_SHIFT 4
1677 #define SESSIDX_IDX_MASK 0x0F
1678 #endif
1679
1680
1681 /* max cert chain peer depth */
1682 #ifndef MAX_CHAIN_DEPTH
1683 #define MAX_CHAIN_DEPTH 9
1684 #endif
1685
1686 /* max size of a certificate message payload */
1687 /* assumes MAX_CHAIN_DEPTH number of certificates at 2kb per certificate */
1688 #ifndef MAX_CERTIFICATE_SZ
1689 #define MAX_CERTIFICATE_SZ \
1690 (CERT_HEADER_SZ + \
1691 (MAX_X509_SIZE + CERT_HEADER_SZ) * MAX_CHAIN_DEPTH)
1692 #endif
1693
1694 /* max size of a handshake message, currently set to the certificate */
1695 #ifndef MAX_HANDSHAKE_SZ
1696 #define MAX_HANDSHAKE_SZ MAX_CERTIFICATE_SZ
1697 #endif
1698
1699 #ifndef PREALLOC_SESSION_TICKET_LEN
1700 #define PREALLOC_SESSION_TICKET_LEN 512
1701 #endif
1702
1703 #ifndef SESSION_TICKET_HINT_DEFAULT
1704 #define SESSION_TICKET_HINT_DEFAULT 300
1705 #endif
1706
1707 #if !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && !defined(NO_WOLFSSL_SERVER)
1708 /* Check chosen encryption is available. */
1709 #if !(defined(HAVE_CHACHA) && defined(HAVE_POLY1305)) && \
1710 defined(WOLFSSL_TICKET_ENC_CHACHA20_POLY1305)
1711 #error "ChaCha20-Poly1305 not available for default ticket encryption"
1712 #endif
1713 #if !defined(HAVE_AESGCM) && (defined(WOLFSSL_TICKET_ENC_AES128_GCM) || \
1714 defined(WOLFSSL_TICKET_ENC_AES256_GCM))
1715 #error "AES-GCM not available for default ticket encryption"
1716 #endif
1717
1718 #ifndef WOLFSSL_TICKET_KEY_LIFETIME
1719 /* Default lifetime is 1 hour from issue of first ticket with key. */
1720 #define WOLFSSL_TICKET_KEY_LIFETIME (60 * 60)
1721 #endif
1722 #if WOLFSSL_TICKET_KEY_LIFETIME <= SESSION_TICKET_HINT_DEFAULT
1723 #error "Ticket Key lifetime must be longer than ticket life hint."
1724 #endif
1725 #endif
1726
1727 #define MAX_ENCRYPT_SZ ENCRYPT_LEN
1728
1729 #define WOLFSSL_ASSERT_SIZEOF_GE(x, y) do { \
1730 typedef char _args_test_[sizeof((x)) >= sizeof((y)) ? 1 : -1]; \
1731 (void)sizeof(_args_test_); \
1732 } while(0)
1733
1734 /* states. Adding state before HANDSHAKE_DONE will break session importing */
1735 enum states {
1736 NULL_STATE = 0,
1737
1738 SERVER_HELLOVERIFYREQUEST_COMPLETE,
1739 SERVER_HELLO_RETRY_REQUEST_COMPLETE,
1740 SERVER_HELLO_COMPLETE,
1741 SERVER_ENCRYPTED_EXTENSIONS_COMPLETE,
1742 SERVER_CERT_COMPLETE,
1743 SERVER_CERT_VERIFY_COMPLETE,
1744 SERVER_KEYEXCHANGE_COMPLETE,
1745 SERVER_HELLODONE_COMPLETE,
1746 SERVER_CHANGECIPHERSPEC_COMPLETE,
1747 SERVER_FINISHED_COMPLETE,
1748
1749 CLIENT_HELLO_RETRY,
1750 CLIENT_HELLO_COMPLETE,
1751 CLIENT_KEYEXCHANGE_COMPLETE,
1752 CLIENT_CHANGECIPHERSPEC_COMPLETE,

NetBurner, Inc.
1214 File Documentation

1753 CLIENT_FINISHED_COMPLETE,
1754
1755 HANDSHAKE_DONE,
1756
1757 #ifdef WOLFSSL_DTLS13
1758 SERVER_FINISHED_ACKED,
1759 #endif /* WOLFSSL_DTLS13 */
1760
1761 };
1762
1763 /* SSL Version */
1764 typedef struct ProtocolVersion {
1765 byte major;
1766 byte minor;
1767 } WOLFSSL_PACK ProtocolVersion;
1768
1769
1770 WOLFSSL_LOCAL ProtocolVersion MakeSSLv3(void);
1771 WOLFSSL_LOCAL ProtocolVersion MakeTLSv1(void);
1772 WOLFSSL_LOCAL ProtocolVersion MakeTLSv1_1(void);
1773 WOLFSSL_LOCAL ProtocolVersion MakeTLSv1_2(void);
1774 WOLFSSL_LOCAL ProtocolVersion MakeTLSv1_3(void);
1775
1776 #ifdef WOLFSSL_DTLS
1777 WOLFSSL_LOCAL ProtocolVersion MakeDTLSv1(void);
1778 WOLFSSL_LOCAL ProtocolVersion MakeDTLSv1_2(void);
1779
1780 #ifdef WOLFSSL_DTLS13
1781 WOLFSSL_LOCAL ProtocolVersion MakeDTLSv1_3(void);
1782 #endif /* WOLFSSL_DTLS13 */
1783
1784 #endif
1785 #ifdef WOLFSSL_SESSION_EXPORT
1786 WOLFSSL_LOCAL int wolfSSL_session_export_internal(WOLFSSL* ssl, byte* buf,
1787 word32* sz, int type);
1788 WOLFSSL_LOCAL int wolfSSL_session_import_internal(WOLFSSL* ssl, const byte* buf,
1789 word32 sz, int type);
1790 #ifdef WOLFSSL_DTLS
1791 WOLFSSL_LOCAL int wolfSSL_dtls_export_state_internal(WOLFSSL* ssl,
1792 byte* buf, word32 sz);
1793 WOLFSSL_LOCAL int wolfSSL_dtls_import_state_internal(WOLFSSL* ssl,
1794 const byte* buf, word32 sz);
1795 WOLFSSL_LOCAL int wolfSSL_send_session(WOLFSSL* ssl);
1796 #endif
1797 #endif
1798
1799 struct WOLFSSL_BY_DIR_HASH {
1800 unsigned long hash_value;
1801 int last_suffix;
1802 };
1803
1804 struct WOLFSSL_BY_DIR_entry {
1805 char* dir_name;
1806 int dir_type;
1807 WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH) *hashes;
1808 };
1809
1810 struct WOLFSSL_BY_DIR {
1811 WOLF_STACK_OF(WOLFSSL_BY_DIR_entry) *dir_entry;
1812 wolfSSL_Mutex lock; /* dir list lock */
1813 };
1814
1815 /* wolfSSL method type */
1816 struct WOLFSSL_METHOD {
1817 ProtocolVersion version;
1818 byte side; /* connection side, server or client */
1819 byte downgrade; /* whether to downgrade version, default no */
1820 };
1821
1822 /* wolfSSL buffer type - internal uses "buffer" type */
1823 typedef WOLFSSL_BUFFER_INFO buffer;
1824
1825 typedef struct Suites Suites;
1826
1827 /* Declare opaque struct for API to use */
1828 #ifndef WOLFSSL_CLIENT_SESSION_DEFINED
1829 typedef struct ClientSession ClientSession;
1830 #define WOLFSSL_CLIENT_SESSION_DEFINED
1831 #endif
1832
1833 /* defaults to client */
1834 WOLFSSL_LOCAL void InitSSL_Method(WOLFSSL_METHOD* method, ProtocolVersion pv);
1835
1836 WOLFSSL_LOCAL int InitSSL_Suites(WOLFSSL* ssl);
1837 WOLFSSL_LOCAL int InitSSL_Side(WOLFSSL* ssl, word16 side);
1838
1839 /* for sniffer */

NetBurner, Inc.
22.208 internal.h 1215

1840 WOLFSSL_LOCAL int DoFinished(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
1841 word32 size, word32 totalSz, int sniff);
1842 #ifdef WOLFSSL_TLS13
1843 WOLFSSL_LOCAL int DoTls13Finished(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
1844 word32 size, word32 totalSz, int sniff);
1845 #endif
1846 WOLFSSL_LOCAL int DoApplicationData(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1847 int sniff);
1848 /* TLS v1.3 needs these */
1849 WOLFSSL_LOCAL int HandleTlsResumption(WOLFSSL* ssl, int bogusID,
1850 Suites* clSuites);
1851 #ifdef WOLFSSL_TLS13
1852 WOLFSSL_LOCAL byte SuiteMac(byte* suite);
1853 #endif
1854 WOLFSSL_LOCAL int DoClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
1855 word32 helloSz);
1856 #ifdef WOLFSSL_TLS13
1857 WOLFSSL_LOCAL int DoTls13ClientHello(WOLFSSL* ssl, const byte* input,
1858 word32* inOutIdx, word32 helloSz);
1859 #endif
1860 WOLFSSL_LOCAL int DoServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
1861 word32 helloSz);
1862 WOLFSSL_LOCAL int CompleteServerHello(WOLFSSL *ssl);
1863 WOLFSSL_LOCAL int CheckVersion(WOLFSSL *ssl, ProtocolVersion pv);
1864 WOLFSSL_LOCAL int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo,
1865 word32 hashSigAlgoSz);
1866 #if defined(WOLF_PRIVATE_KEY_ID) && !defined(NO_CHECK_PRIVATE_KEY)
1867 WOLFSSL_LOCAL int CreateDevPrivateKey(void** pkey, byte* data, word32 length,
1868 int hsType, int label, int id,
1869 void* heap, int devId);
1870 #endif
1871 WOLFSSL_LOCAL int DecodePrivateKey(WOLFSSL *ssl, word16* length);
1872 #ifdef WOLF_PRIVATE_KEY_ID
1873 WOLFSSL_LOCAL int GetPrivateKeySigSize(WOLFSSL* ssl);
1874 #ifndef NO_ASN
1875 WOLFSSL_LOCAL int InitSigPkCb(WOLFSSL* ssl, SignatureCtx* sigCtx);
1876 #endif
1877 #endif
1878 #ifdef WOLFSSL_ASYNC_IO
1879 WOLFSSL_LOCAL void FreeAsyncCtx(WOLFSSL* ssl, byte freeAsync);
1880 #endif
1881 WOLFSSL_LOCAL void FreeKeyExchange(WOLFSSL* ssl);
1882 WOLFSSL_LOCAL void FreeSuites(WOLFSSL* ssl);
1883 WOLFSSL_LOCAL int ProcessPeerCerts(WOLFSSL* ssl, byte* input, word32* inOutIdx, word32 totalSz);
1884 WOLFSSL_LOCAL int MatchDomainName(const char* pattern, int len, const char* str);
1885 #ifndef NO_CERTS
1886 WOLFSSL_LOCAL int CheckForAltNames(DecodedCert* dCert, const char* domain, int* checkCN);
1887 WOLFSSL_LOCAL int CheckIPAddr(DecodedCert* dCert, const char* ipasc);
1888 #endif
1889 WOLFSSL_LOCAL int CreateTicket(WOLFSSL* ssl);
1890 WOLFSSL_LOCAL int HashRaw(WOLFSSL* ssl, const byte* output, int sz);
1891 WOLFSSL_LOCAL int HashOutput(WOLFSSL* ssl, const byte* output, int sz,
1892 int ivSz);
1893 WOLFSSL_LOCAL int HashInput(WOLFSSL* ssl, const byte* input, int sz);
1894
1895 #ifdef HAVE_SNI
1896 #ifndef NO_WOLFSSL_SERVER
1897 WOLFSSL_LOCAL int SNI_Callback(WOLFSSL* ssl);
1898 #endif
1899 #endif
1900
1901 WOLFSSL_LOCAL int ChachaAEADEncrypt(WOLFSSL* ssl, byte* out, const byte* input,
1902 word16 sz); /* needed by sniffer */
1903
1904 #ifdef WOLFSSL_TLS13
1905 WOLFSSL_LOCAL int DecryptTls13(WOLFSSL* ssl, byte* output, const byte* input,
1906 word16 sz, const byte* aad, word16 aadSz);
1907 WOLFSSL_LOCAL int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input,
1908 word32* inOutIdx, byte type,
1909 word32 size, word32 totalSz);
1910 WOLFSSL_LOCAL int DoTls13HandShakeMsg(WOLFSSL* ssl, byte* input,
1911 word32* inOutIdx, word32 totalSz);
1912 WOLFSSL_LOCAL int DoTls13ServerHello(WOLFSSL* ssl, const byte* input,
1913 word32* inOutIdx, word32 helloSz,
1914 byte* extMsgType);
1915 WOLFSSL_LOCAL int RestartHandshakeHash(WOLFSSL* ssl);
1916
1917 WOLFSSL_LOCAL int Tls13DeriveKey(WOLFSSL *ssl, byte *output, int outputLen,
1918 const byte *secret, const byte *label, word32 labelLen, int hashAlgo,
1919 int includeMsgs);
1920 #endif
1921 int TimingPadVerify(WOLFSSL* ssl, const byte* input, int padLen, int macSz,
1922 int pLen, int content);
1923
1924
1925 enum {
1926 FORCED_FREE = 1,

NetBurner, Inc.
1216 File Documentation

1927 NO_FORCED_FREE = 0
1928 };
1929
1930
1931 /* only use compression extra if using compression */
1932 #ifdef HAVE_LIBZ
1933 #define COMP_EXTRA MAX_COMP_EXTRA
1934 #else
1935 #define COMP_EXTRA 0
1936 #endif
1937
1938 /* only the sniffer needs space in the buffer for extra MTU record(s) */
1939 #ifdef WOLFSSL_SNIFFER
1940 #define MTU_EXTRA MAX_MTU * 3
1941 #else
1942 #define MTU_EXTRA 0
1943 #endif
1944
1945
1946 /* embedded callbacks require large static buffers, make sure on */
1947 #ifdef WOLFSSL_CALLBACKS
1948 #undef LARGE_STATIC_BUFFERS
1949 #define LARGE_STATIC_BUFFERS
1950 #endif
1951
1952
1953 /* determine maximum record size */
1954 #ifdef RECORD_SIZE
1955 /* user supplied value */
1956 #if RECORD_SIZE < 128 || RECORD_SIZE > MAX_RECORD_SIZE
1957 #error Invalid record size
1958 #endif
1959 #else
1960 /* give user option to use 16K static buffers */
1961 #if defined(LARGE_STATIC_BUFFERS)
1962 #define RECORD_SIZE MAX_RECORD_SIZE
1963 #else
1964 #ifdef WOLFSSL_DTLS
1965 #define RECORD_SIZE MAX_MTU
1966 #else
1967 #define RECORD_SIZE 128
1968 #endif
1969 #endif
1970 #endif
1971
1972
1973 /* user option to turn off 16K output option */
1974 /* if using small static buffers (default) and SSL_write tries to write data
1975 larger than the record we have, dynamically get it, unless user says only
1976 write in static buffer chunks */
1977 #ifndef STATIC_CHUNKS_ONLY
1978 #define OUTPUT_RECORD_SIZE MAX_RECORD_SIZE
1979 #else
1980 #define OUTPUT_RECORD_SIZE RECORD_SIZE
1981 #endif
1982
1983 /* wolfSSL input buffer
1984
1985 RFC 2246:
1986
1987 length
1988 The length (in bytes) of the following TLSPlaintext.fragment.
1989 The length should not exceed 2^14.
1990 */
1991 #ifdef STATIC_BUFFER_LEN
1992 /* user supplied option */
1993 #if STATIC_BUFFER_LEN < 5 || STATIC_BUFFER_LEN > (RECORD_HEADER_SZ + \
1994 RECORD_SIZE + COMP_EXTRA + MTU_EXTRA + MAX_MSG_EXTRA))
1995 #error Invalid static buffer length
1996 #endif
1997 #elif defined(LARGE_STATIC_BUFFERS)
1998 #define STATIC_BUFFER_LEN RECORD_HEADER_SZ + RECORD_SIZE + COMP_EXTRA + \
1999 MTU_EXTRA + MAX_MSG_EXTRA
2000 #else
2001 /* don’t fragment memory from the record header */
2002 #define STATIC_BUFFER_LEN RECORD_HEADER_SZ
2003 #endif
2004
2005 typedef struct {
2006 ALIGN16 byte staticBuffer[STATIC_BUFFER_LEN];
2007 byte* buffer; /* place holder for static or dynamic buffer */
2008 word32 length; /* total buffer length used */
2009 word32 idx; /* idx to part of length already consumed */
2010 word32 bufferSize; /* current buffer size */
2011 byte dynamicFlag; /* dynamic memory currently in use */
2012 byte offset; /* alignment offset attempt */
2013 } bufferStatic;

NetBurner, Inc.
22.208 internal.h 1217

2014
2015 /* Cipher Suites holder */
2016 struct Suites {
2017 word16 suiteSz; /* suite length in bytes */
2018 word16 hashSigAlgoSz; /* SigAlgo extension length in bytes */
2019 byte suites[WOLFSSL_MAX_SUITE_SZ];
2020 byte hashSigAlgo[WOLFSSL_MAX_SIGALGO]; /* sig/algo to offer */
2021 byte setSuites; /* user set suites from default */
2022 byte hashAlgo; /* selected hash algorithm */
2023 byte sigAlgo; /* selected sig algorithm */
2024 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
2025 WOLF_STACK_OF(WOLFSSL_CIPHER)* stack; /* stack of available cipher suites */
2026 #endif
2027 };
2028
2029 WOLFSSL_LOCAL void InitSuitesHashSigAlgo(Suites* suites, int haveECDSAsig,
2030 int haveRSAsig, int haveFalconSig,
2031 int haveDilithiumSig, int haveAnon,
2032 int tls1_2, int keySz);
2033 WOLFSSL_LOCAL void InitSuites(Suites* suites, ProtocolVersion pv, int keySz,
2034 word16 haveRSA, word16 havePSK, word16 haveDH,
2035 word16 haveECDSAsig, word16 haveECC,
2036 word16 haveStaticRSA, word16 haveStaticECC,
2037 word16 haveFalconSig, word16 haveDilithiumSig,
2038 word16 haveAnon, word16 haveNull, int side);
2039
2040 WOLFSSL_LOCAL int MatchSuite(WOLFSSL* ssl, Suites* peerSuites);
2041 WOLFSSL_LOCAL int SetCipherList(WOLFSSL_CTX* ctx, Suites* suites,
2042 const char* list);
2043 WOLFSSL_LOCAL int SetSuitesHashSigAlgo(Suites* suites, const char* list);
2044
2045 #ifndef PSK_TYPES_DEFINED
2046 typedef unsigned int (*wc_psk_client_callback)(WOLFSSL*, const char*, char*,
2047 unsigned int, unsigned char*, unsigned int);
2048 typedef unsigned int (*wc_psk_server_callback)(WOLFSSL*, const char*,
2049 unsigned char*, unsigned int);
2050 #ifdef WOLFSSL_TLS13
2051 typedef unsigned int (*wc_psk_client_cs_callback)(WOLFSSL*, const char*,
2052 char*, unsigned int, unsigned char*, unsigned int,
2053 const char* cipherName);
2054 typedef unsigned int (*wc_psk_client_tls13_callback)(WOLFSSL*, const char*,
2055 char*, unsigned int, unsigned char*, unsigned int,
2056 const char** cipherName);
2057 typedef unsigned int (*wc_psk_server_tls13_callback)(WOLFSSL*, const char*,
2058 unsigned char*, unsigned int,
2059 const char** cipherName);
2060 #endif
2061 #endif /* PSK_TYPES_DEFINED */
2062 #if defined(WOLFSSL_DTLS) && defined(WOLFSSL_SESSION_EXPORT) && \
2063 !defined(WOLFSSL_DTLS_EXPORT_TYPES)
2064 typedef int (*wc_dtls_export)(WOLFSSL* ssl,
2065
2066 #define WOLFSSL_DTLS_EXPORT_TYPES
2067 #endif /* WOLFSSL_DTLS_EXPORT_TYPES */
2068
2069
2070 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
2071 #define MAX_DESCRIPTION_SZ 255
2072 #endif
2073 struct WOLFSSL_CIPHER {
2074 byte cipherSuite0;
2075 byte cipherSuite;
2076 const WOLFSSL* ssl;
2077 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
2078 char description[MAX_DESCRIPTION_SZ];
2079 unsigned long offset;
2080 unsigned int in_stack; /* TRUE if added to stack in wolfSSL_get_ciphers_compat */
2081 int bits;
2082 #endif
2083 };
2084
2085
2086 #ifdef NO_ASN
2087 /* no_asn won’t have */
2088 typedef struct CertStatus CertStatus;
2089 #endif
2090
2091 #ifndef HAVE_OCSP
2092 typedef struct WOLFSSL_OCSP WOLFSSL_OCSP;
2093 #endif
2094
2095 /* wolfSSL OCSP controller */
2096 #ifdef HAVE_OCSP
2097 struct WOLFSSL_OCSP {
2098 WOLFSSL_CERT_MANAGER* cm; /* pointer back to cert manager */
2099 OcspEntry* ocspList; /* OCSP response list */
2100 wolfSSL_Mutex ocspLock; /* OCSP list lock */

NetBurner, Inc.
1218 File Documentation

2101 int error;


2102 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || \
2103 defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
2104 int(*statusCb)(WOLFSSL*, void*);
2105 #endif
2106 };
2107 #endif
2108
2109 #ifndef MAX_DATE_SIZE
2110 #define MAX_DATE_SIZE 32
2111 #endif
2112
2113 typedef struct CRL_Entry CRL_Entry;
2114
2115 #ifdef NO_SHA
2116 #define CRL_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
2117 #else
2118 #define CRL_DIGEST_SIZE WC_SHA_DIGEST_SIZE
2119 #endif
2120
2121 #ifdef NO_ASN
2122 typedef struct RevokedCert RevokedCert;
2123 #endif
2124
2125 /* Complete CRL */
2126 struct CRL_Entry {
2127 CRL_Entry* next; /* next entry */
2128 byte issuerHash[CRL_DIGEST_SIZE]; /* issuer hash */
2129 /* byte crlHash[CRL_DIGEST_SIZE]; raw crl data hash */
2130 /* restore the hash here if needed for optimized comparisons */
2131 byte lastDate[MAX_DATE_SIZE]; /* last date updated */
2132 byte nextDate[MAX_DATE_SIZE]; /* next update date */
2133 byte lastDateFormat; /* last date format */
2134 byte nextDateFormat; /* next date format */
2135 RevokedCert* certs; /* revoked cert list */
2136 int totalCerts; /* number on list */
2137 int version; /* version of certficate */
2138 int verified;
2139 byte* toBeSigned;
2140 word32 tbsSz;
2141 byte* signature;
2142 word32 signatureSz;
2143 word32 signatureOID;
2144 #if !defined(NO_SKID) && !defined(NO_ASN)
2145 byte extAuthKeyIdSet;
2146 byte extAuthKeyId[KEYID_SIZE];
2147 #endif
2148 int crlNumber; /* CRL number extension */
2149 #if defined(OPENSSL_EXTRA)
2150 WOLFSSL_X509_NAME* issuer; /* X509_NAME type issuer */
2151 #endif
2152 };
2153
2154
2155 typedef struct CRL_Monitor CRL_Monitor;
2156
2157 /* CRL directory monitor */
2158 struct CRL_Monitor {
2159 char* path; /* full dir path, if valid pointer we’re using */
2160 int type; /* PEM or ASN1 type */
2161 };
2162
2163
2164 #if defined(HAVE_CRL) && defined(NO_FILESYSTEM)
2165 #undef HAVE_CRL_MONITOR
2166 #endif
2167
2168 /* wolfSSL CRL controller */
2169 struct WOLFSSL_CRL {
2170 WOLFSSL_CERT_MANAGER* cm; /* pointer back to cert manager */
2171 CRL_Entry* crlList; /* our CRL list */
2172 #ifdef HAVE_CRL_IO
2173 CbCrlIO crlIOCb;
2174 #endif
2175 wolfSSL_Mutex crlLock; /* CRL list lock */
2176 CRL_Monitor monitors[2]; /* PEM and DER possible */
2177 #ifdef HAVE_CRL_MONITOR
2178 pthread_cond_t cond; /* condition to signal setup */
2179 pthread_t tid; /* monitoring thread */
2180 int mfd; /* monitor fd, -1 if no init yet */
2181 int setup; /* thread is setup predicate */
2182 #endif
2183 void* heap; /* heap hint for dynamic memory */
2184 };
2185
2186
2187 #ifdef NO_ASN

NetBurner, Inc.
22.208 internal.h 1219

2188 typedef struct Signer Signer;


2189 #ifdef WOLFSSL_TRUST_PEER_CERT
2190 typedef struct TrustedPeerCert TrustedPeerCert;
2191 #endif
2192 #endif
2193
2194
2195 #ifndef CA_TABLE_SIZE
2196 #define CA_TABLE_SIZE 11
2197 #endif
2198 #ifdef WOLFSSL_TRUST_PEER_CERT
2199 #define TP_TABLE_SIZE 11
2200 #endif
2201
2202 /* wolfSSL Certificate Manager */
2203 struct WOLFSSL_CERT_MANAGER {
2204 Signer* caTable[CA_TABLE_SIZE]; /* the CA signer table */
2205 void* heap; /* heap helper */
2206 #ifdef WOLFSSL_TRUST_PEER_CERT
2207 TrustedPeerCert* tpTable[TP_TABLE_SIZE]; /* table of trusted peer certs */
2208 wolfSSL_Mutex tpLock; /* trusted peer list lock */
2209 #endif
2210 WOLFSSL_CRL* crl; /* CRL checker */
2211 WOLFSSL_OCSP* ocsp; /* OCSP checker */
2212 #if !defined(NO_WOLFSSL_SERVER) && (defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
2213 || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2))
2214 WOLFSSL_OCSP* ocsp_stapling; /* OCSP checker for OCSP stapling */
2215 #endif
2216 char* ocspOverrideURL; /* use this responder */
2217 void* ocspIOCtx; /* I/O callback CTX */
2218 #ifndef NO_WOLFSSL_CM_VERIFY
2219 VerifyCallback verifyCallback; /* Verify callback */
2220 #endif
2221 CallbackCACache caCacheCallback; /* CA cache addition callback */
2222 CbMissingCRL cbMissingCRL; /* notify thru cb of missing crl */
2223 CbOCSPIO ocspIOCb; /* I/O callback for OCSP lookup */
2224 CbOCSPRespFree ocspRespFreeCb; /* Frees OCSP Response from IO Cb */
2225 wolfSSL_Mutex caLock; /* CA list lock */
2226 byte crlEnabled:1; /* is CRL on ? */
2227 byte crlCheckAll:1; /* always leaf, but all ? */
2228 byte ocspEnabled:1; /* is OCSP on ? */
2229 byte ocspCheckAll:1; /* always leaf, but all ? */
2230 byte ocspSendNonce:1; /* send the OCSP nonce ? */
2231 byte ocspUseOverrideURL:1; /* ignore cert responder, override */
2232 byte ocspStaplingEnabled:1; /* is OCSP Stapling on ? */
2233 #if defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
2234 || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2)
2235 byte ocspMustStaple:1; /* server must respond with staple */
2236 #endif
2237
2238 #ifndef NO_RSA
2239 short minRsaKeySz; /* minimum allowed RSA key size */
2240 #endif
2241 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
2242 short minEccKeySz; /* minimum allowed ECC key size */
2243 #endif
2244 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
2245 WOLFSSL_X509_STORE *x509_store_p; /* a pointer back to CTX x509 store */
2246 /* CTX has ownership and free this */
2247 /* with CTX free. */
2248 #endif
2249 #ifndef SINGLE_THREADED
2250 wolfSSL_Mutex refMutex; /* reference count mutex */
2251 #endif
2252 int refCount; /* reference count */
2253 #ifdef HAVE_PQC
2254 short minFalconKeySz; /* minimum allowed Falcon key size */
2255 short minDilithiumKeySz; /* minimum allowed Dilithium key size */
2256 #endif
2257
2258 };
2259
2260 WOLFSSL_LOCAL int CM_SaveCertCache(WOLFSSL_CERT_MANAGER* cm,
2261 const char* fname);
2262 WOLFSSL_LOCAL int CM_RestoreCertCache(WOLFSSL_CERT_MANAGER* cm,
2263 const char* fname);
2264 WOLFSSL_LOCAL int CM_MemSaveCertCache(WOLFSSL_CERT_MANAGER* cm, void* mem,
2265 int sz, int* used);
2266 WOLFSSL_LOCAL int CM_MemRestoreCertCache(WOLFSSL_CERT_MANAGER* cm,
2267 const void* mem, int sz);
2268 WOLFSSL_LOCAL int CM_GetCertCacheMemSize(WOLFSSL_CERT_MANAGER* cm);
2269 WOLFSSL_LOCAL int CM_VerifyBuffer_ex(WOLFSSL_CERT_MANAGER* cm, const byte* buff,
2270 long sz, int format, int err_val);
2271
2272
2273 #ifndef NO_CERTS
2274 #if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)

NetBurner, Inc.
1220 File Documentation

2275 typedef struct ProcPeerCertArgs {


2276 buffer* certs;
2277 #ifdef WOLFSSL_TLS13
2278 buffer* exts; /* extensions */
2279 #endif
2280 DecodedCert* dCert;
2281 word32 idx;
2282 word32 begin;
2283 int totalCerts; /* number of certs in certs buffer */
2284 int count;
2285 int certIdx;
2286 int lastErr;
2287 #ifdef WOLFSSL_TLS13
2288 byte ctxSz;
2289 #endif
2290 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
2291 char untrustedDepth;
2292 #endif
2293 word16 fatal:1;
2294 word16 verifyErr:1;
2295 word16 dCertInit:1;
2296 #ifdef WOLFSSL_TRUST_PEER_CERT
2297 word16 haveTrustPeer:1; /* was cert verified by loaded trusted peer cert */
2298 #endif
2299 } ProcPeerCertArgs;
2300 WOLFSSL_LOCAL int DoVerifyCallback(WOLFSSL_CERT_MANAGER* cm, WOLFSSL* ssl,
2301 int ret, ProcPeerCertArgs* args);
2302 #endif /* !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH) */
2303 #endif /* !defined NO_CERTS */
2304
2305 /* wolfSSL Sock Addr */
2306 struct WOLFSSL_SOCKADDR {
2307 unsigned int sz; /* sockaddr size */
2308 unsigned int bufSz; /* size of allocated buffer */
2309 void* sa; /* pointer to the sockaddr_in or sockaddr_in6 */
2310 };
2311
2312 typedef struct WOLFSSL_DTLS_CTX {
2313 WOLFSSL_SOCKADDR peer;
2314 int rfd;
2315 int wfd;
2316 byte userSet:1;
2317 byte connected:1; /* When set indicates rfd and wfd sockets are
2318 * connected (connect() and bind() both called).
2319 * This means that sendto and recvfrom do not need to
2320 * specify and store the peer address. */
2321 } WOLFSSL_DTLS_CTX;
2322
2323
2324 typedef struct WOLFSSL_DTLS_PEERSEQ {
2325 word32 window[WOLFSSL_DTLS_WINDOW_WORDS];
2326 /* Sliding window for current epoch */
2327 word16 nextEpoch; /* Expected epoch in next record */
2328 word16 nextSeq_hi; /* Expected sequence in next record */
2329 word32 nextSeq_lo;
2330
2331 word32 prevWindow[WOLFSSL_DTLS_WINDOW_WORDS];
2332 /* Sliding window for old epoch */
2333 word32 prevSeq_lo;
2334 word16 prevSeq_hi; /* Next sequence in allowed old epoch */
2335
2336 #ifdef WOLFSSL_MULTICAST
2337 word16 peerId;
2338 word32 highwaterMark;
2339 #endif
2340 } WOLFSSL_DTLS_PEERSEQ;
2341
2342
2343 #define MAX_WRITE_IV_SZ 16 /* max size of client/server write_IV */
2344
2345 /* keys and secrets
2346 * keep as a constant size (no additional ifdefs) for session export */
2347 typedef struct Keys {
2348 #if !defined(WOLFSSL_AEAD_ONLY) || defined(WOLFSSL_TLS13)
2349 byte client_write_MAC_secret[WC_MAX_DIGEST_SIZE]; /* max sizes */
2350 byte server_write_MAC_secret[WC_MAX_DIGEST_SIZE];
2351 #endif
2352 byte client_write_key[MAX_SYM_KEY_SIZE]; /* max sizes */
2353 byte server_write_key[MAX_SYM_KEY_SIZE];
2354 byte client_write_IV[MAX_WRITE_IV_SZ]; /* max sizes */
2355 byte server_write_IV[MAX_WRITE_IV_SZ];
2356 #if defined(HAVE_AEAD) || defined(WOLFSSL_SESSION_EXPORT)
2357 byte aead_exp_IV[AEAD_MAX_EXP_SZ];
2358 byte aead_enc_imp_IV[AEAD_MAX_IMP_SZ];
2359 byte aead_dec_imp_IV[AEAD_MAX_IMP_SZ];
2360 #endif
2361

NetBurner, Inc.
22.208 internal.h 1221

2362 #ifdef WOLFSSL_DTLS13


2363 byte client_sn_key[MAX_SYM_KEY_SIZE];
2364 byte server_sn_key[MAX_SYM_KEY_SIZE];
2365 #endif /* WOLFSSL_DTLS13 */
2366
2367 word32 peer_sequence_number_hi;
2368 word32 peer_sequence_number_lo;
2369 word32 sequence_number_hi;
2370 word32 sequence_number_lo;
2371
2372 #ifdef WOLFSSL_DTLS
2373 word16 curEpoch; /* Received epoch in current record */
2374 word16 curSeq_hi; /* Received sequence in current record */
2375 word32 curSeq_lo;
2376
2377 #ifdef WOLFSSL_DTLS13
2378 w64wrapper curEpoch64; /* Received epoch in current record */
2379 w64wrapper curSeq;
2380 #endif /* WOLFSSL_DTLS13 */
2381
2382 #ifdef WOLFSSL_MULTICAST
2383 byte curPeerId; /* Received peer group ID in current record */
2384 #endif
2385 WOLFSSL_DTLS_PEERSEQ peerSeq[WOLFSSL_DTLS_PEERSEQ_SZ];
2386
2387 word16 dtls_peer_handshake_number;
2388 word16 dtls_expected_peer_handshake_number;
2389
2390 word16 dtls_epoch; /* Current epoch */
2391 word16 dtls_sequence_number_hi; /* Current epoch */
2392 word32 dtls_sequence_number_lo;
2393 word16 dtls_prev_sequence_number_hi; /* Previous epoch */
2394 word32 dtls_prev_sequence_number_lo;
2395 word16 dtls_handshake_number; /* Current tx handshake seq */
2396 #endif
2397
2398 word32 encryptSz; /* last size of encrypted data */
2399 word32 padSz; /* how much to advance after decrypt part */
2400 byte encryptionOn; /* true after change cipher spec */
2401 byte decryptedCur; /* only decrypt current record once */
2402 #ifdef WOLFSSL_TLS13
2403 byte updateResponseReq:1; /* KeyUpdate response from peer required. */
2404 byte keyUpdateRespond:1; /* KeyUpdate is to be responded to. */
2405 #endif
2406 #ifdef WOLFSSL_RENESAS_TSIP_TLS
2407
2408 tsip_hmac_sha_key_index_t tsip_client_write_MAC_secret;
2409 tsip_hmac_sha_key_index_t tsip_server_write_MAC_secret;
2410
2411 #endif
2412 #ifdef WOLFSSL_RENESAS_SCEPROTECT
2413
2414 sce_hmac_sha_wrapped_key_t sce_client_write_MAC_secret;
2415 sce_hmac_sha_wrapped_key_t sce_server_write_MAC_secret;
2416 #endif
2417 } Keys;
2418
2419
2420
2422 #ifdef HAVE_TLS_EXTENSIONS
2423
2424 typedef enum {
2425 #ifdef HAVE_SNI
2426 TLSX_SERVER_NAME = 0x0000, /* a.k.a. SNI */
2427 #endif
2428 TLSX_MAX_FRAGMENT_LENGTH = 0x0001,
2429 TLSX_TRUSTED_CA_KEYS = 0x0003,
2430 TLSX_TRUNCATED_HMAC = 0x0004,
2431 TLSX_STATUS_REQUEST = 0x0005, /* a.k.a. OCSP stapling */
2432 TLSX_SUPPORTED_GROUPS = 0x000a, /* a.k.a. Supported Curves */
2433 TLSX_EC_POINT_FORMATS = 0x000b,
2434 #if !defined(NO_CERTS) && !defined(WOLFSSL_NO_SIGALG)
2435 TLSX_SIGNATURE_ALGORITHMS = 0x000d, /* HELLO_EXT_SIG_ALGO */
2436 #endif
2437 #ifdef WOLFSSL_SRTP
2438 TLSX_USE_SRTP = 0x000e, /* 14 */
2439 #endif
2440 TLSX_APPLICATION_LAYER_PROTOCOL = 0x0010, /* a.k.a. ALPN */
2441 TLSX_STATUS_REQUEST_V2 = 0x0011, /* a.k.a. OCSP stapling v2 */
2442 #if defined(HAVE_ENCRYPT_THEN_MAC) && !defined(WOLFSSL_AEAD_ONLY)
2443 TLSX_ENCRYPT_THEN_MAC = 0x0016, /* RFC 7366 */
2444 #endif
2445 TLSX_EXTENDED_MASTER_SECRET = 0x0017, /* HELLO_EXT_EXTMS */
2446 TLSX_SESSION_TICKET = 0x0023,
2447 #ifdef WOLFSSL_TLS13
2448 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
2449 TLSX_PRE_SHARED_KEY = 0x0029,

NetBurner, Inc.
1222 File Documentation

2450 #endif
2451 #ifdef WOLFSSL_EARLY_DATA
2452 TLSX_EARLY_DATA = 0x002a,
2453 #endif
2454 TLSX_SUPPORTED_VERSIONS = 0x002b,
2455 #ifdef WOLFSSL_SEND_HRR_COOKIE
2456 TLSX_COOKIE = 0x002c,
2457 #endif
2458 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
2459 TLSX_PSK_KEY_EXCHANGE_MODES = 0x002d,
2460 #endif
2461 #ifdef WOLFSSL_POST_HANDSHAKE_AUTH
2462 TLSX_POST_HANDSHAKE_AUTH = 0x0031,
2463 #endif
2464 #if !defined(NO_CERTS) && !defined(WOLFSSL_NO_SIGALG)
2465 TLSX_SIGNATURE_ALGORITHMS_CERT = 0x0032,
2466 #endif
2467 TLSX_KEY_SHARE = 0x0033,
2468 #if defined(WOLFSSL_DTLS_CID)
2469 TLSX_CONNECTION_ID = 0x0036,
2470 #endif /* defined(WOLFSSL_DTLS_CID) */
2471 #ifdef WOLFSSL_QUIC
2472 TLSX_KEY_QUIC_TP_PARAMS = 0x0039, /* RFC 9001, ch. 8.2 */
2473 #endif
2474 #endif
2475 TLSX_RENEGOTIATION_INFO = 0xff01,
2476 #ifdef WOLFSSL_QUIC
2477 TLSX_KEY_QUIC_TP_PARAMS_DRAFT = 0xffa5, /* from draft-ietf-quic-tls-27 */
2478 #endif
2479 } TLSX_Type;
2480
2481 typedef struct TLSX {
2482 TLSX_Type type; /* Extension Type */
2483 void* data; /* Extension Data */
2484 word32 val; /* Extension Value */
2485 byte resp; /* IsResponse Flag */
2486 struct TLSX* next; /* List Behavior */
2487 } TLSX;
2488
2489 WOLFSSL_LOCAL TLSX* TLSX_Find(TLSX* list, TLSX_Type type);
2490 WOLFSSL_LOCAL void TLSX_Remove(TLSX** list, TLSX_Type type, void* heap);
2491 WOLFSSL_LOCAL void TLSX_FreeAll(TLSX* list, void* heap);
2492 WOLFSSL_LOCAL int TLSX_SupportExtensions(WOLFSSL* ssl);
2493 WOLFSSL_LOCAL int TLSX_PopulateExtensions(WOLFSSL* ssl, byte isRequest);
2494
2495 #if defined(WOLFSSL_TLS13) || !defined(NO_WOLFSSL_CLIENT)
2496 WOLFSSL_LOCAL int TLSX_GetRequestSize(WOLFSSL* ssl, byte msgType,
2497 word16* pLength);
2498 WOLFSSL_LOCAL int TLSX_WriteRequest(WOLFSSL* ssl, byte* output,
2499 byte msgType, word16* pOffset);
2500 #endif
2501
2502 #if defined(WOLFSSL_TLS13) || !defined(NO_WOLFSSL_SERVER)
2503 /* TLS 1.3 Certificate messages have extensions. */
2504 WOLFSSL_LOCAL int TLSX_GetResponseSize(WOLFSSL* ssl, byte msgType,
2505 word16* pLength);
2506 WOLFSSL_LOCAL int TLSX_WriteResponse(WOLFSSL *ssl, byte* output, byte msgType,
2507 word16* pOffset);
2508 #endif
2509
2510 WOLFSSL_LOCAL int TLSX_ParseVersion(WOLFSSL* ssl, const byte* input,
2511 word16 length, byte msgType, int* found);
2512 WOLFSSL_LOCAL int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length,
2513 byte msgType, Suites *suites);
2514 WOLFSSL_LOCAL int TLSX_Push(TLSX** list, TLSX_Type type,
2515 const void* data, void* heap);
2516
2517 #elif defined(HAVE_SNI) \
2518 || defined(HAVE_MAX_FRAGMENT) \
2519 || defined(HAVE_TRUSTED_CA) \
2520 || defined(HAVE_TRUNCATED_HMAC) \
2521 || defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
2522 || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2) \
2523 || defined(HAVE_SUPPORTED_CURVES) \
2524 || defined(HAVE_ALPN) \
2525 || defined(HAVE_SESSION_TICKET) \
2526 || defined(HAVE_SECURE_RENEGOTIATION) \
2527 || defined(HAVE_SERVER_RENEGOTIATION_INFO)
2528
2529 #error Using TLS extensions requires HAVE_TLS_EXTENSIONS to be defined.
2530
2531 #endif /* HAVE_TLS_EXTENSIONS */
2532
2534 #ifdef HAVE_SNI
2535
2536 typedef struct SNI {
2537 byte type; /* SNI Type */

NetBurner, Inc.
22.208 internal.h 1223

2538 union { char* host_name; } data; /* SNI Data */


2539 struct SNI* next; /* List Behavior */
2540 byte status; /* Matching result */
2541 #ifndef NO_WOLFSSL_SERVER
2542 byte options; /* Behavior options */
2543 #endif
2544 } SNI;
2545
2546 WOLFSSL_LOCAL int TLSX_UseSNI(TLSX** extensions, byte type, const void* data,
2547 word16 size, void* heap);
2548 WOLFSSL_LOCAL byte TLSX_SNI_Status(TLSX* extensions, byte type);
2549 WOLFSSL_LOCAL word16 TLSX_SNI_GetRequest(TLSX* extensions, byte type,
2550 void** data);
2551
2552 #ifndef NO_WOLFSSL_SERVER
2553 WOLFSSL_LOCAL void TLSX_SNI_SetOptions(TLSX* extensions, byte type,
2554 byte options);
2555 WOLFSSL_LOCAL int TLSX_SNI_GetFromBuffer(const byte* clientHello,
2556 word32 helloSz, byte type, byte* sni, word32* inOutSz);
2557 #endif
2558
2559 #endif /* HAVE_SNI */
2560
2561 /* Trusted CA Key Indication - RFC 6066 (section 6) */
2562 #ifdef HAVE_TRUSTED_CA
2563
2564 typedef struct TCA {
2565 byte type; /* TCA Type */
2566 byte* id; /* TCA identifier */
2567 word16 idSz; /* TCA identifier size */
2568 struct TCA* next; /* List Behavior */
2569 } TCA;
2570
2571 WOLFSSL_LOCAL int TLSX_UseTrustedCA(TLSX** extensions, byte type,
2572 const byte* id, word16 idSz, void* heap);
2573
2574 #endif /* HAVE_TRUSTED_CA */
2575
2576 /* Application-Layer Protocol Negotiation - RFC 7301 */
2577 #ifdef HAVE_ALPN
2578 typedef struct ALPN {
2579 char* protocol_name; /* ALPN protocol name */
2580 struct ALPN* next; /* List Behavior */
2581 byte options; /* Behavior options */
2582 byte negotiated; /* ALPN protocol negotiated or not */
2583 } ALPN;
2584
2585 WOLFSSL_LOCAL int TLSX_ALPN_GetRequest(TLSX* extensions,
2586 void** data, word16 *dataSz);
2587
2588 WOLFSSL_LOCAL int TLSX_UseALPN(TLSX** extensions, const void* data,
2589 word16 size, byte options, void* heap);
2590
2591 WOLFSSL_LOCAL int TLSX_ALPN_SetOptions(TLSX** extensions, byte option);
2592
2593 #endif /* HAVE_ALPN */
2594
2596 #ifdef HAVE_MAX_FRAGMENT
2597
2598 WOLFSSL_LOCAL int TLSX_UseMaxFragment(TLSX** extensions, byte mfl, void* heap);
2599
2600 #endif /* HAVE_MAX_FRAGMENT */
2601
2603 #ifdef HAVE_TRUNCATED_HMAC
2604
2605 WOLFSSL_LOCAL int TLSX_UseTruncatedHMAC(TLSX** extensions, void* heap);
2606
2607 #endif /* HAVE_TRUNCATED_HMAC */
2608
2610 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST
2611
2612 typedef struct {
2613 byte status_type;
2614 byte options;
2615 WOLFSSL* ssl;
2616 union {
2617 OcspRequest ocsp;
2618 } request;
2619 #if defined(WOLFSSL_TLS13)
2620 buffer response;
2621 #endif
2622 } CertificateStatusRequest;
2623
2624 WOLFSSL_LOCAL int TLSX_UseCertificateStatusRequest(TLSX** extensions,
2625 byte status_type, byte options, WOLFSSL* ssl, void* heap, int devId);
2626 #ifndef NO_CERTS
2627 WOLFSSL_LOCAL int TLSX_CSR_InitRequest(TLSX* extensions, DecodedCert* cert,

NetBurner, Inc.
1224 File Documentation

2628 void* heap);


2629 #endif
2630 WOLFSSL_LOCAL void* TLSX_CSR_GetRequest(TLSX* extensions);
2631 WOLFSSL_LOCAL int TLSX_CSR_ForceRequest(WOLFSSL* ssl);
2632
2633 #endif
2634
2636 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST_V2
2637
2638 typedef struct CSRIv2 {
2639 byte status_type;
2640 byte options;
2641 word16 requests;
2642 union {
2643 OcspRequest ocsp[1 + MAX_CHAIN_DEPTH];
2644 } request;
2645 struct CSRIv2* next;
2646 } CertificateStatusRequestItemV2;
2647
2648 WOLFSSL_LOCAL int TLSX_UseCertificateStatusRequestV2(TLSX** extensions,
2649 byte status_type, byte options, void* heap, int devId);
2650 #ifndef NO_CERTS
2651 WOLFSSL_LOCAL int TLSX_CSR2_InitRequests(TLSX* extensions, DecodedCert* cert,
2652 byte isPeer, void* heap);
2653 #endif
2654 WOLFSSL_LOCAL void* TLSX_CSR2_GetRequest(TLSX* extensions, byte status_type,
2655 byte idx);
2656 WOLFSSL_LOCAL int TLSX_CSR2_ForceRequest(WOLFSSL* ssl);
2657
2658 #endif
2659
2661 #ifdef HAVE_SUPPORTED_CURVES
2662
2663 typedef struct SupportedCurve {
2664 word16 name; /* Curve Names */
2665 struct SupportedCurve* next; /* List Behavior */
2666 } SupportedCurve;
2667
2668 typedef struct PointFormat {
2669 byte format; /* PointFormat */
2670 struct PointFormat* next; /* List Behavior */
2671 } PointFormat;
2672
2673 WOLFSSL_LOCAL int TLSX_UseSupportedCurve(TLSX** extensions, word16 name,
2674 void* heap);
2675
2676 WOLFSSL_LOCAL int TLSX_UsePointFormat(TLSX** extensions, byte point,
2677 void* heap);
2678
2679 #ifndef NO_WOLFSSL_SERVER
2680 WOLFSSL_LOCAL int TLSX_ValidateSupportedCurves(WOLFSSL* ssl, byte first,
2681 byte second);
2682 WOLFSSL_LOCAL int TLSX_SupportedCurve_CheckPriority(WOLFSSL* ssl);
2683 WOLFSSL_LOCAL int TLSX_SupportedFFDHE_Set(WOLFSSL* ssl);
2684 #endif
2685 WOLFSSL_LOCAL int TLSX_SupportedCurve_Preferred(WOLFSSL* ssl,
2686 int checkSupported);
2687
2688 #endif /* HAVE_SUPPORTED_CURVES */
2689
2691 #if defined(HAVE_SECURE_RENEGOTIATION) \
2692 || defined(HAVE_SERVER_RENEGOTIATION_INFO)
2693
2694 enum key_cache_state {
2695 SCR_CACHE_NULL = 0, /* empty / begin state */
2696 SCR_CACHE_NEEDED, /* need to cache keys */
2697 SCR_CACHE_COPY, /* we have a cached copy */
2698 SCR_CACHE_PARTIAL, /* partial restore to real keys */
2699 SCR_CACHE_COMPLETE /* complete restore to real keys */
2700 };
2701
2702 /* Additional Connection State according to rfc5746 section 3.1 */
2703 typedef struct SecureRenegotiation {
2704 byte enabled; /* secure_renegotiation flag in rfc */
2705 byte verifySet;
2706 byte startScr; /* server requested client to start scr */
2707 enum key_cache_state cache_status; /* track key cache state */
2708 byte client_verify_data[TLS_FINISHED_SZ]; /* cached */
2709 byte server_verify_data[TLS_FINISHED_SZ]; /* cached */
2710 byte subject_hash_set; /* if peer cert hash is set */
2711 byte subject_hash[KEYID_SIZE]; /* peer cert hash */
2712 Keys tmp_keys; /* can’t overwrite real keys yet */
2713 } SecureRenegotiation;
2714
2715 WOLFSSL_LOCAL int TLSX_UseSecureRenegotiation(TLSX** extensions, void* heap);
2716
2717 #ifdef HAVE_SERVER_RENEGOTIATION_INFO

NetBurner, Inc.
22.208 internal.h 1225

2718 WOLFSSL_LOCAL int TLSX_AddEmptyRenegotiationInfo(TLSX** extensions, void* heap);


2719 #endif
2720
2721 #endif /* HAVE_SECURE_RENEGOTIATION */
2722
2724 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
2725 /* Ticket nonce - for deriving PSK.
2726 * Length allowed to be: 1..255. Only support 4 bytes.
2727 * Defined here so that it can be included in InternalTicket.
2728 */
2729 typedef struct TicketNonce {
2730 byte len;
2731 byte data[MAX_TICKET_NONCE_SZ];
2732 } TicketNonce;
2733 #endif
2734
2735 #ifdef HAVE_SESSION_TICKET
2736 /* Our ticket format. All members need to be a byte or array of byte to
2737 * avoid alignment issues */
2738 typedef struct InternalTicket {
2739 ProtocolVersion pv; /* version when ticket created */
2740 byte suite[SUITE_LEN]; /* cipher suite when created */
2741 byte msecret[SECRET_LEN]; /* master secret */
2742 byte timestamp[TIMESTAMP_LEN]; /* born on */
2743 byte haveEMS; /* have extended master secret */
2744 #ifdef WOLFSSL_TLS13
2745 byte ageAdd[AGEADD_LEN]; /* Obfuscation of age */
2746 byte namedGroup[NAMEDGROUP_LEN]; /* Named group used */
2747 TicketNonce ticketNonce; /* Ticket nonce */
2748 #ifdef WOLFSSL_EARLY_DATA
2749 byte maxEarlyDataSz[MAXEARLYDATASZ_LEN]; /* Max size of
2750 * early data */
2751 #endif
2752 #endif
2753 #ifdef WOLFSSL_TICKET_HAVE_ID
2754 byte id[ID_LEN];
2755 #endif
2756 } InternalTicket;
2757
2758 #ifndef WOLFSSL_TICKET_EXTRA_PADDING_SZ
2759 #define WOLFSSL_TICKET_EXTRA_PADDING_SZ 32
2760 #endif
2761
2762 #define WOLFSSL_TICKET_ENC_SZ \
2763 (sizeof(InternalTicket) + WOLFSSL_TICKET_EXTRA_PADDING_SZ)
2764
2765 /* RFC 5077 defines this for session tickets. All members need to be a byte or
2766 * array of byte to avoid alignment issues */
2767 typedef struct ExternalTicket {
2768 byte key_name[WOLFSSL_TICKET_NAME_SZ]; /* key context name - 16 */
2769 byte iv[WOLFSSL_TICKET_IV_SZ]; /* this ticket’s iv - 16 */
2770 byte enc_len[OPAQUE16_LEN]; /* encrypted length - 2 */
2771 byte enc_ticket[WOLFSSL_TICKET_ENC_SZ];
2772 /* encrypted internal ticket */
2773 byte mac[WOLFSSL_TICKET_MAC_SZ]; /* total mac - 32 */
2774 } ExternalTicket;
2775
2776 /* Cast to int to reduce amount of casts in code */
2777 #define SESSION_TICKET_LEN ((int)sizeof(ExternalTicket))
2778 #define WOLFSSL_TICKET_FIXED_SZ (SESSION_TICKET_LEN - WOLFSSL_TICKET_ENC_SZ)
2779
2780 typedef struct SessionTicket {
2781 word32 lifetime;
2782 #ifdef WOLFSSL_TLS13
2783 word64 seen;
2784 word32 ageAdd;
2785 #endif
2786 byte* data;
2787 word16 size;
2788 } SessionTicket;
2789
2790 #if !defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && !defined(NO_WOLFSSL_SERVER)
2791
2792 /* Data passed to default SessionTicket enc/dec callback. */
2793 typedef struct TicketEncCbCtx {
2794 /* Name for this context. */
2795 byte name[WOLFSSL_TICKET_NAME_SZ];
2796 /* Current keys - current and next. */
2797 byte key[2][WOLFSSL_TICKET_KEY_SZ];
2798 /* Expirary date of keys. */
2799 word32 expirary[2];
2800 /* Random number generator to use for generating name, keys and IV. */
2801 WC_RNG rng;
2802 #ifndef SINGLE_THREADED
2803 /* Mutex for access to changing keys. */
2804 wolfSSL_Mutex mutex;
2805 #endif

NetBurner, Inc.
1226 File Documentation

2806 /* Pointer back to SSL_CTX. */


2807 WOLFSSL_CTX* ctx;
2808 } TicketEncCbCtx;
2809
2810 #endif /* !WOLFSSL_NO_DEF_TICKET_ENC_CB && !NO_WOLFSSL_SERVER */
2811
2812 WOLFSSL_LOCAL int TLSX_UseSessionTicket(TLSX** extensions,
2813 SessionTicket* ticket, void* heap);
2814 WOLFSSL_LOCAL SessionTicket* TLSX_SessionTicket_Create(word32 lifetime,
2815 byte* data, word16 size, void* heap);
2816 WOLFSSL_LOCAL void TLSX_SessionTicket_Free(SessionTicket* ticket, void* heap);
2817
2818 #endif /* HAVE_SESSION_TICKET */
2819
2820 #if defined(HAVE_ENCRYPT_THEN_MAC) && !defined(WOLFSSL_AEAD_ONLY)
2821 int TLSX_EncryptThenMac_Respond(WOLFSSL* ssl);
2822 #endif
2823
2824 #ifdef WOLFSSL_TLS13
2825 /* Cookie extension information - cookie data. */
2826 typedef struct Cookie {
2827 word16 len;
2828 byte data;
2829 } Cookie;
2830
2831 WOLFSSL_LOCAL int TLSX_Cookie_Use(WOLFSSL* ssl, const byte* data, word16 len,
2832 byte* mac, byte macSz, int resp);
2833
2834
2835 /* Key Share - TLS v1.3 Specification */
2836
2837 /* The KeyShare extension information - entry in a linked list. */
2838 typedef struct KeyShareEntry {
2839 word16 group; /* NamedGroup */
2840 byte* ke; /* Key exchange data */
2841 word32 keLen; /* Key exchange data length */
2842 void* key; /* Key struct */
2843 word32 keyLen; /* Key size (bytes) */
2844 byte* pubKey; /* Public key */
2845 word32 pubKeyLen; /* Public key length */
2846 #if !defined(NO_DH) || defined(HAVE_PQC)
2847 byte* privKey; /* Private key - DH ond PQ KEMs only */
2848 #endif
2849 #ifdef WOLFSSL_ASYNC_CRYPT
2850 int lastRet;
2851 #endif
2852 struct KeyShareEntry* next; /* List pointer */
2853 } KeyShareEntry;
2854
2855 WOLFSSL_LOCAL int TLSX_KeyShare_Use(WOLFSSL* ssl, word16 group, word16 len,
2856 byte* data, KeyShareEntry **kse);
2857 WOLFSSL_LOCAL int TLSX_KeyShare_Empty(WOLFSSL* ssl);
2858 WOLFSSL_LOCAL int TLSX_KeyShare_Establish(WOLFSSL* ssl, int* doHelloRetry);
2859 WOLFSSL_LOCAL int TLSX_KeyShare_DeriveSecret(WOLFSSL* ssl);
2860
2861
2862 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
2863
2864 /* The PreSharedKey extension information - entry in a linked list. */
2865 typedef struct PreSharedKey {
2866 word16 identityLen; /* Length of identity */
2867 byte* identity; /* PSK identity */
2868 word32 ticketAge; /* Age of the ticket */
2869 byte cipherSuite0; /* Cipher Suite */
2870 byte cipherSuite; /* Cipher Suite */
2871 word32 binderLen; /* Length of HMAC */
2872 byte binder[WC_MAX_DIGEST_SIZE]; /* HMAC of handshake */
2873 byte hmac; /* HMAC algorithm */
2874 byte resumption:1; /* Resumption PSK */
2875 byte chosen:1; /* Server’s choice */
2876 struct PreSharedKey* next; /* List pointer */
2877 } PreSharedKey;
2878
2879 WOLFSSL_LOCAL int TLSX_PreSharedKey_WriteBinders(PreSharedKey* list,
2880 byte* output, byte msgType,
2881 word16* pSz);
2882 WOLFSSL_LOCAL int TLSX_PreSharedKey_GetSizeBinders(PreSharedKey* list,
2883 byte msgType, word16* pSz);
2884 WOLFSSL_LOCAL int TLSX_PreSharedKey_Use(WOLFSSL* ssl, const byte* identity,
2885 word16 len, word32 age, byte hmac,
2886 byte cipherSuite0, byte cipherSuite,
2887 byte resumption,
2888 PreSharedKey **preSharedKey);
2889
2890 /* The possible Pre-Shared Key key exchange modes. */
2891 enum PskKeyExchangeMode {
2892 PSK_KE,

NetBurner, Inc.
22.208 internal.h 1227

2893 PSK_DHE_KE
2894 };
2895
2896 /* User can define this. */
2897 #ifndef WOLFSSL_DEF_PSK_CIPHER
2898 #define WOLFSSL_DEF_PSK_CIPHER TLS_AES_128_GCM_SHA256
2899 #endif
2900
2901 WOLFSSL_LOCAL int TLSX_PskKeModes_Use(WOLFSSL* ssl, byte modes);
2902
2903 #ifdef WOLFSSL_EARLY_DATA
2904 WOLFSSL_LOCAL int TLSX_EarlyData_Use(WOLFSSL* ssl, word32 max, int is_response);
2905 #endif
2906 #endif /* HAVE_SESSION_TICKET || !NO_PSK */
2907
2908
2909 /* The types of keys to derive for. */
2910 enum DeriveKeyType {
2911 no_key,
2912 early_data_key,
2913 handshake_key,
2914 traffic_key,
2915 update_traffic_key
2916 };
2917
2918 WOLFSSL_LOCAL int DeriveEarlySecret(WOLFSSL* ssl);
2919 WOLFSSL_LOCAL int DeriveHandshakeSecret(WOLFSSL* ssl);
2920 WOLFSSL_LOCAL int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store);
2921 WOLFSSL_LOCAL int DeriveMasterSecret(WOLFSSL* ssl);
2922 WOLFSSL_LOCAL int DeriveResumptionPSK(WOLFSSL* ssl, byte* nonce, byte nonceLen, byte* secret);
2923 WOLFSSL_LOCAL int DeriveResumptionSecret(WOLFSSL* ssl, byte* key);
2924
2925 WOLFSSL_LOCAL int Tls13_Exporter(WOLFSSL* ssl, unsigned char *out, size_t outLen,
2926 const char *label, size_t labelLen,
2927 const unsigned char *context, size_t contextLen);
2928
2929 /* The key update request values for KeyUpdate message. */
2930 enum KeyUpdateRequest {
2931 update_not_requested,
2932 update_requested
2933 };
2934 #endif /* WOLFSSL_TLS13 */
2935
2936 #ifdef WOLFSSL_DTLS_CID
2937 WOLFSSL_LOCAL void TLSX_ConnectionID_Free(byte* ext, void* heap);
2938 WOLFSSL_LOCAL word16 TLSX_ConnectionID_Write(byte* ext, byte* output);
2939 WOLFSSL_LOCAL word16 TLSX_ConnectionID_GetSize(byte* ext);
2940 WOLFSSL_LOCAL int TLSX_ConnectionID_Use(WOLFSSL* ssl);
2941 WOLFSSL_LOCAL int TLSX_ConnectionID_Parse(WOLFSSL* ssl, const byte* input,
2942 word16 length, byte isRequest);
2943 WOLFSSL_LOCAL void DtlsCIDOnExtensionsParsed(WOLFSSL* ssl);
2944 WOLFSSL_LOCAL byte DtlsCIDCheck(WOLFSSL* ssl, const byte* input,
2945 word16 inputSize);
2946 #endif /* WOLFSSL_DTLS_CID */
2947
2948 #ifdef OPENSSL_EXTRA
2949 enum SetCBIO {
2950 WOLFSSL_CBIO_NONE = 0,
2951 WOLFSSL_CBIO_RECV = 0x1,
2952 WOLFSSL_CBIO_SEND = 0x2,
2953 };
2954 #endif
2955
2956 #ifdef WOLFSSL_STATIC_EPHEMERAL
2957 /* contains static ephemeral keys */
2958 typedef struct {
2959 #ifndef NO_DH
2960 DerBuffer* dhKey;
2961 #endif
2962 #ifdef HAVE_ECC
2963 DerBuffer* ecKey;
2964 #endif
2965 #ifdef HAVE_CURVE25519
2966 DerBuffer* x25519Key;
2967 #endif
2968 #ifdef HAVE_CURVE448
2969 DerBuffer* x448Key;
2970 #endif
2971 } StaticKeyExchangeInfo_t;
2972 #endif /* WOLFSSL_STATIC_EPHEMERAL */
2973
2974
2975 /* wolfSSL context type */
2976 struct WOLFSSL_CTX {
2977 WOLFSSL_METHOD* method;
2978 #ifdef SINGLE_THREADED
2979 WC_RNG* rng; /* to be shared with WOLFSSL w/o locking */

NetBurner, Inc.
1228 File Documentation

2980 #endif
2981 wolfSSL_Mutex countMutex; /* reference count mutex */
2982 int refCount; /* reference count */
2983 int err; /* error code in case of mutex not created */
2984 #ifndef NO_DH
2985 buffer serverDH_P;
2986 buffer serverDH_G;
2987 #endif
2988 #ifndef NO_CERTS
2989 DerBuffer* certificate;
2990 DerBuffer* certChain;
2991 /* chain after self, in DER, with leading size for each cert */
2992 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_EXTRA) || defined(HAVE_LIGHTY)
2993 WOLF_STACK_OF(WOLFSSL_X509_NAME)* ca_names;
2994 #endif
2995 #ifdef OPENSSL_EXTRA
2996 WOLF_STACK_OF(WOLFSSL_X509)* x509Chain;
2997 client_cert_cb CBClientCert; /* client certificate callback */
2998 CertSetupCallback certSetupCb;
2999 void* certSetupCbArg;
3000 #endif
3001 #ifdef WOLFSSL_TLS13
3002 int certChainCnt;
3003 #endif
3004 DerBuffer* privateKey;
3005 byte privateKeyType:6;
3006 byte privateKeyId:1;
3007 byte privateKeyLabel:1;
3008 int privateKeySz;
3009 int privateKeyDevId;
3010 #ifdef OPENSSL_ALL
3011 WOLFSSL_EVP_PKEY* privateKeyPKey;
3012 #endif
3013 WOLFSSL_CERT_MANAGER* cm; /* our cert manager, ctx owns SSL will use */
3014 #endif
3015 #ifdef KEEP_OUR_CERT
3016 WOLFSSL_X509* ourCert; /* keep alive a X509 struct of cert */
3017 int ownOurCert; /* Dispose of certificate if we own */
3018 #endif
3019 Suites* suites; /* make dynamic, user may not need/set */
3020 void* heap; /* for user memory overrides */
3021 byte verifyDepth;
3022 byte verifyPeer:1;
3023 byte verifyNone:1;
3024 byte failNoCert:1;
3025 byte failNoCertxPSK:1; /* fail if no cert with the exception of PSK*/
3026 byte sessionCacheOff:1;
3027 byte sessionCacheFlushOff:1;
3028 #ifdef HAVE_EXT_CACHE
3029 byte internalCacheOff:1;
3030 byte internalCacheLookupOff:1;
3031 #endif
3032 byte sendVerify:2; /* for client side (can not be single bit) */
3033 byte haveRSA:1; /* RSA available */
3034 byte haveECC:1; /* ECC available */
3035 byte haveDH:1; /* server DH parms set by user */
3036 byte haveECDSAsig:1; /* server cert signed w/ ECDSA */
3037 byte haveFalconSig:1; /* server cert signed w/ Falcon */
3038 byte haveDilithiumSig:1;/* server cert signed w/ Dilithium */
3039 byte haveStaticECC:1; /* static server ECC private key */
3040 byte partialWrite:1; /* only one msg per write call */
3041 byte autoRetry:1; /* retry read/write on a WANT_{READ|WRITE} */
3042 byte quietShutdown:1; /* don’t send close notify */
3043 byte groupMessages:1; /* group handshake messages before sending */
3044 byte minDowngrade; /* minimum downgrade version */
3045 byte haveEMS:1; /* have extended master secret extension */
3046 byte useClientOrder:1; /* Use client’s cipher preference order */
3047 #if defined(HAVE_SESSION_TICKET)
3048 byte noTicketTls12:1; /* TLS 1.2 server won’t send ticket */
3049 #endif
3050 #ifdef WOLFSSL_TLS13
3051 #if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER)
3052 unsigned int maxTicketTls13; /* maximum number of tickets to send */
3053 #endif
3054 byte noTicketTls13:1; /* TLS 1.3 Server won’t create new Ticket */
3055 byte noPskDheKe:1; /* Don’t use (EC)DHE with PSK */
3056 #endif
3057 byte mutualAuth:1; /* Mutual authentication required */
3058 #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH)
3059 byte postHandshakeAuth:1; /* Post-handshake auth supported. */
3060 byte verifyPostHandshake:1; /* Only send client cert req post
3061 * handshake, not also during */
3062 #endif
3063 #ifndef NO_DH
3064 #if !defined(WOLFSSL_OLD_PRIME_CHECK) && !defined(HAVE_FIPS) && \
3065 !defined(HAVE_SELFTEST)
3066 byte dhKeyTested:1; /* Set when key has been tested. */

NetBurner, Inc.
22.208 internal.h 1229

3067 #endif
3068 #endif
3069 #if defined(HAVE_SECURE_RENEGOTIATION) || defined(HAVE_SERVER_RENEGOTIATION_INFO)
3070 byte useSecureReneg:1; /* when set will set WOLFSSL objects generated to enable */
3071 #endif
3072 #ifdef HAVE_ENCRYPT_THEN_MAC
3073 byte disallowEncThenMac:1; /* Don’t do Encrypt-Then-MAC */
3074 #endif
3075 #ifdef WOLFSSL_STATIC_MEMORY
3076 byte onHeapHint:1; /* whether the ctx/method is put on heap hint */
3077 #endif
3078 #if defined(WOLFSSL_STATIC_EPHEMERAL) && !defined(SINGLE_THREADED)
3079 byte staticKELockInit:1;
3080 #endif
3081 #if defined(WOLFSSL_DTLS) && defined(WOLFSSL_SCTP)
3082 byte dtlsSctp:1; /* DTLS-over-SCTP mode */
3083 #endif
3084 word16 minProto:1; /* sets min to min available */
3085 word16 maxProto:1; /* sets max to max available */
3086
3087 #ifdef WOLFSSL_SRTP
3088 word16 dtlsSrtpProfiles; /* DTLS-with-SRTP mode
3089 * (list of selected profiles - up to 16) */
3090 #endif
3091 #if defined(WOLFSSL_DTLS) && defined(WOLFSSL_MULTICAST)
3092 byte haveMcast; /* multicast requested */
3093 byte mcastID; /* multicast group ID */
3094 #endif
3095 #if defined(WOLFSSL_DTLS) && \
3096 (defined(WOLFSSL_SCTP) || defined(WOLFSSL_DTLS_MTU))
3097 word16 dtlsMtuSz; /* DTLS MTU size */
3098 #endif
3099 #ifndef NO_DH
3100 word16 minDhKeySz; /* minimum DH key size */
3101 word16 maxDhKeySz; /* maximum DH key size */
3102 #endif
3103 #ifndef NO_RSA
3104 short minRsaKeySz; /* minimum RSA key size */
3105 #endif
3106 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
3107 short minEccKeySz; /* minimum ECC key size */
3108 #endif
3109 #ifdef HAVE_PQC
3110 short minFalconKeySz; /* minimum Falcon key size */
3111 short minDilithiumKeySz;/* minimum Dilithium key size */
3112 #endif
3113 unsigned long mask; /* store SSL_OP_ flags */
3114 #ifdef OPENSSL_EXTRA
3115 byte sessionCtx[ID_LEN]; /* app session context ID */
3116 word32 disabledCurves; /* curves disabled by user */
3117 const unsigned char *alpn_cli_protos;/* ALPN client protocol list */
3118 unsigned int alpn_cli_protos_len;
3119 byte sessionCtxSz;
3120 byte cbioFlag; /* WOLFSSL_CBIO_RECV/SEND: CBIORecv/Send is set */
3121 CallbackInfoState* CBIS; /* used to get info about SSL state */
3122 WOLFSSL_X509_VERIFY_PARAM* param; /* verification parameters*/
3123 #endif
3124 #ifdef WOLFSSL_WOLFSENTRY_HOOKS
3125 NetworkFilterCallback_t AcceptFilter;
3126 void *AcceptFilter_arg;
3127 NetworkFilterCallback_t ConnectFilter;
3128 void *ConnectFilter_arg;
3129 #endif /* WOLFSSL_WOLFSENTRY_HOOKS */
3130 CallbackIORecv CBIORecv;
3131 CallbackIOSend CBIOSend;
3132 #ifdef WOLFSSL_DTLS
3133 CallbackGenCookie CBIOCookie; /* gen cookie callback */
3134 #endif /* WOLFSSL_DTLS */
3135 #ifdef WOLFSSL_SESSION_EXPORT
3136 #ifdef WOLFSSL_DTLS
3137 wc_dtls_export dtls_export; /* export function for DTLS session */
3138 #endif
3139 CallbackGetPeer CBGetPeer;
3140 CallbackSetPeer CBSetPeer;
3141 #endif
3142 VerifyCallback verifyCallback; /* cert verification callback */
3143 void* verifyCbCtx; /* cert verify callback user ctx*/
3144 #ifdef OPENSSL_ALL
3145 CertVerifyCallback verifyCertCb;
3146 void* verifyCertCbArg;
3147 #endif /* OPENSSL_ALL */
3148 #ifdef OPENSSL_EXTRA
3149 SSL_Msg_Cb protoMsgCb; /* inspect protocol message callback */
3150 void* protoMsgCtx; /* user set context with msg callback */
3151 #endif
3152 word32 timeout; /* session timeout */
3153 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_CURVE25519) || \

NetBurner, Inc.
1230 File Documentation

3154 defined(HAVE_ED448)
3155 word32 ecdhCurveOID; /* curve Ecc_Sum */
3156 #endif
3157 #ifdef HAVE_ECC
3158 word16 eccTempKeySz; /* in octets 20 - 66 */
3159 #endif
3160 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
3161 word32 pkCurveOID; /* curve Ecc_Sum */
3162 #endif
3163 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
3164 byte havePSK; /* psk key set by user */
3165 wc_psk_client_callback client_psk_cb; /* client callback */
3166 wc_psk_server_callback server_psk_cb; /* server callback */
3167 #ifdef WOLFSSL_TLS13
3168 wc_psk_client_cs_callback client_psk_cs_cb; /* client callback */
3169 wc_psk_client_tls13_callback client_psk_tls13_cb; /* client callback */
3170 wc_psk_server_tls13_callback server_psk_tls13_cb; /* server callback */
3171 #endif
3172 void* psk_ctx;
3173 char server_hint[MAX_PSK_ID_LEN + NULL_TERM_LEN];
3174 #endif /* HAVE_SESSION_TICKET || !NO_PSK */
3175 #ifdef WOLFSSL_TLS13
3176 word16 group[WOLFSSL_MAX_GROUP_COUNT];
3177 byte numGroups;
3178 #endif
3179 #ifdef WOLFSSL_EARLY_DATA
3180 word32 maxEarlyDataSz;
3181 #endif
3182 #ifdef HAVE_ANON
3183 byte haveAnon; /* User wants to allow Anon suites */
3184 #endif /* HAVE_ANON */
3185 #ifdef WOLFSSL_ENCRYPTED_KEYS
3186 wc_pem_password_cb* passwd_cb;
3187 void* passwd_userdata;
3188 #endif
3189 #ifdef WOLFSSL_LOCAL_X509_STORE
3190 WOLFSSL_X509_STORE x509_store; /* points to ctx->cm */
3191 WOLFSSL_X509_STORE* x509_store_pt; /* take ownership of external store */
3192 #endif
3193 #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL)
3194 byte readAhead;
3195 void* userPRFArg; /* passed to prf callback */
3196 #endif
3197 #ifdef HAVE_EX_DATA
3198 WOLFSSL_CRYPTO_EX_DATA ex_data;
3199 #endif
3200 #if defined(HAVE_ALPN) && (defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
3201 defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY) || defined(WOLFSSL_QUIC))
3202 CallbackALPNSelect alpnSelect;
3203 void* alpnSelectArg;
3204 #endif
3205 #ifdef HAVE_SNI
3206 CallbackSniRecv sniRecvCb;
3207 void* sniRecvCbArg;
3208 #endif
3209 #if defined(WOLFSSL_MULTICAST) && defined(WOLFSSL_DTLS)
3210 CallbackMcastHighwater mcastHwCb; /* Sequence number highwater callback */
3211 word32 mcastFirstSeq; /* first trigger level */
3212 word32 mcastSecondSeq; /* second trigger level */
3213 word32 mcastMaxSeq; /* max level */
3214 #endif
3215 #ifdef HAVE_OCSP
3216 WOLFSSL_OCSP ocsp;
3217 #endif
3218 int devId; /* async device id to use */
3219 #ifdef HAVE_TLS_EXTENSIONS
3220 TLSX* extensions; /* RFC 6066 TLS Extensions data */
3221 #ifndef NO_WOLFSSL_SERVER
3222 #if defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
3223 || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2)
3224 OcspRequest* certOcspRequest;
3225 #endif
3226 #if defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2)
3227 OcspRequest* chainOcspRequest[MAX_CHAIN_DEPTH];
3228 #endif
3229 #endif
3230 #if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER)
3231 SessionTicketEncCb ticketEncCb; /* enc/dec session ticket Cb */
3232 void* ticketEncCtx; /* session encrypt context */
3233 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) \
3234 || defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY)
3235 ticketCompatCb ticketEncWrapCb; /* callback for OpenSSL ticket key callback */
3236 #endif
3237 int ticketHint; /* ticket hint in seconds */
3238 #ifndef WOLFSSL_NO_DEF_TICKET_ENC_CB
3239 TicketEncCbCtx ticketKeyCtx;
3240 #endif

NetBurner, Inc.
22.208 internal.h 1231

3241 #endif
3242 #endif
3243 #ifdef HAVE_SUPPORTED_CURVES
3244 byte userCurves; /* indicates user called wolfSSL_CTX_UseSupportedCurve */
3245 #endif
3246 #ifdef ATOMIC_USER
3247 CallbackMacEncrypt MacEncryptCb; /* Atomic User Mac/Encrypt Cb */
3248 CallbackDecryptVerify DecryptVerifyCb; /* Atomic User Decrypt/Verify Cb */
3249 #ifdef HAVE_ENCRYPT_THEN_MAC
3250 CallbackEncryptMac EncryptMacCb; /* Atomic User Mac/Enc Cb */
3251 CallbackVerifyDecrypt VerifyDecryptCb; /* Atomic User Dec/Verify Cb */
3252 #endif
3253 #endif
3254 #ifdef HAVE_PK_CALLBACKS
3255 #ifdef HAVE_ECC
3256 CallbackEccKeyGen EccKeyGenCb; /* User EccKeyGen Callback Handler */
3257 CallbackEccSign EccSignCb; /* User EccSign Callback handler */
3258 void* EccSignCtx; /* Ecc Sign Callback Context */
3259 CallbackEccVerify EccVerifyCb; /* User EccVerify Callback handler */
3260 CallbackEccSharedSecret EccSharedSecretCb; /* User EccVerify Callback handler */
3261 #endif /* HAVE_ECC */
3262 #ifdef HAVE_HKDF
3263 CallbackHKDFExtract HkdfExtractCb; /* User hkdf Extract Callback handler */
3264 #endif
3265 #ifdef HAVE_ED25519
3266 /* User Ed25519Sign Callback handler */
3267 CallbackEd25519Sign Ed25519SignCb;
3268 /* User Ed25519Verify Callback handler */
3269 CallbackEd25519Verify Ed25519VerifyCb;
3270 #endif
3271 #ifdef HAVE_CURVE25519
3272 /* User X25519 KeyGen Callback Handler */
3273 CallbackX25519KeyGen X25519KeyGenCb;
3274 /* User X25519 SharedSecret Callback handler */
3275 CallbackX25519SharedSecret X25519SharedSecretCb;
3276 #endif
3277 #ifdef HAVE_ED448
3278 /* User Ed448Sign Callback handler */
3279 CallbackEd448Sign Ed448SignCb;
3280 /* User Ed448Verify Callback handler */
3281 CallbackEd448Verify Ed448VerifyCb;
3282 #endif
3283 #ifdef HAVE_CURVE448
3284 /* User X448 KeyGen Callback Handler */
3285 CallbackX448KeyGen X448KeyGenCb;
3286 /* User X448 SharedSecret Callback handler */
3287 CallbackX448SharedSecret X448SharedSecretCb;
3288 #endif
3289 #ifndef NO_DH
3290 CallbackDhAgree DhAgreeCb; /* User DH Agree Callback handler */
3291 #endif
3292 #ifndef NO_RSA
3293 CallbackRsaSign RsaSignCb; /* User RsaSign Callback handler (priv key) */
3294 CallbackRsaVerify RsaVerifyCb; /* User RsaVerify Callback handler (pub key) */
3295 CallbackRsaVerify RsaSignCheckCb; /* User VerifyRsaSign Callback handler (priv key) */
3296 #ifdef WC_RSA_PSS
3297 CallbackRsaPssSign RsaPssSignCb; /* User RsaSign (priv key) */
3298 CallbackRsaPssVerify RsaPssVerifyCb; /* User RsaVerify (pub key) */
3299 CallbackRsaPssVerify RsaPssSignCheckCb; /* User VerifyRsaSign (priv key) */
3300 #endif
3301 CallbackRsaEnc RsaEncCb; /* User Rsa Public Encrypt handler */
3302 CallbackRsaDec RsaDecCb; /* User Rsa Private Decrypt handler */
3303 #endif /* NO_RSA */
3304 CallbackGenPreMaster GenPreMasterCb; /* Use generate pre-master handler */
3305 CallbackGenMasterSecret GenMasterCb; /* Use generate master secret handler */
3306 CallbackGenSessionKey GenSessionKeyCb; /* Use generate session key handler */
3307 CallbackEncryptKeys EncryptKeysCb;/* Use setting encrypt keys handler */
3308 CallbackTlsFinished TlsFinishedCb; /* Use Tls finished handler */
3309 #if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
3310 CallbackVerifyMac VerifyMacCb; /* Use Verify mac handler */
3311 #endif
3312 #endif /* HAVE_PK_CALLBACKS */
3313 #ifdef HAVE_WOLF_EVENT
3314 WOLF_EVENT_QUEUE event_queue;
3315 #endif /* HAVE_WOLF_EVENT */
3316 #ifdef HAVE_EXT_CACHE
3317 WOLFSSL_SESSION*(*get_sess_cb)(WOLFSSL*, const unsigned char*, int, int*);
3318 int (*new_sess_cb)(WOLFSSL*, WOLFSSL_SESSION*);
3319 #endif
3320 #if defined(HAVE_EXT_CACHE) || defined(HAVE_EX_DATA)
3321 Rem_Sess_Cb rem_sess_cb;
3322 #endif
3323 #if defined(OPENSSL_EXTRA) && defined(WOLFCRYPT_HAVE_SRP) && !defined(NO_SHA256)
3324 Srp* srp; /* TLS Secure Remote Password Protocol*/
3325 byte* srp_password;
3326 #endif
3327 #if defined(OPENSSL_EXTRA) && defined(HAVE_SECRET_CALLBACK)

NetBurner, Inc.
1232 File Documentation

3328 wolfSSL_CTX_keylog_cb_func keyLogCb;


3329 #endif /* OPENSSL_EXTRA && HAVE_SECRET_CALLBACK */
3330 #ifdef WOLFSSL_STATIC_EPHEMERAL
3331 StaticKeyExchangeInfo_t staticKE;
3332 #ifndef SINGLE_THREADED
3333 wolfSSL_Mutex staticKELock;
3334 #endif
3335 #endif
3336 #ifdef WOLFSSL_QUIC
3337 struct {
3338 const WOLFSSL_QUIC_METHOD *method;
3339 } quic;
3340 #endif
3341 };
3342
3343 WOLFSSL_LOCAL
3344 int InitSSL_Ctx(WOLFSSL_CTX* ctx, WOLFSSL_METHOD* method, void* heap);
3345 WOLFSSL_LOCAL
3346 void FreeSSL_Ctx(WOLFSSL_CTX* ctx);
3347 WOLFSSL_LOCAL
3348 void SSL_CtxResourceFree(WOLFSSL_CTX* ctx);
3349
3350 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
3351 #ifndef HAVE_EX_DATA
3352 #error "HAVE_EX_DATA_CLEANUP_HOOKS requires HAVE_EX_DATA to be defined"
3353 #endif
3354 void wolfSSL_CRYPTO_cleanup_ex_data(WOLFSSL_CRYPTO_EX_DATA* ex_data);
3355 #endif
3356
3357 WOLFSSL_LOCAL
3358 int DeriveTlsKeys(WOLFSSL* ssl);
3359 WOLFSSL_LOCAL
3360 int ProcessOldClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3361 word32 inSz, word16 sz);
3362
3363 #ifndef NO_CERTS
3364 WOLFSSL_LOCAL
3365 int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify);
3366 WOLFSSL_LOCAL
3367 int AlreadySigner(WOLFSSL_CERT_MANAGER* cm, byte* hash);
3368 #ifdef WOLFSSL_TRUST_PEER_CERT
3369 WOLFSSL_LOCAL
3370 int AddTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int verify);
3371 WOLFSSL_LOCAL
3372 int AlreadyTrustedPeer(WOLFSSL_CERT_MANAGER* cm, DecodedCert* cert);
3373 #endif
3374 #endif
3375
3376 /* All cipher suite related info
3377 * Keep as a constant size (no ifdefs) for session export */
3378 typedef struct CipherSpecs {
3379 word16 key_size;
3380 word16 iv_size;
3381 word16 block_size;
3382 word16 aead_mac_size;
3383 byte bulk_cipher_algorithm;
3384 byte cipher_type; /* block, stream, or aead */
3385 byte mac_algorithm;
3386 byte kea; /* key exchange algo */
3387 byte sig_algo;
3388 byte hash_size;
3389 byte pad_size;
3390 byte static_ecdh;
3391 } CipherSpecs;
3392
3393
3394 void InitCipherSpecs(CipherSpecs* cs);
3395
3396
3397 /* Supported Key Exchange Protocols */
3398 enum KeyExchangeAlgorithm {
3399 no_kea,
3400 rsa_kea,
3401 diffie_hellman_kea,
3402 fortezza_kea,
3403 psk_kea,
3404 dhe_psk_kea,
3405 ecdhe_psk_kea,
3406 ecc_diffie_hellman_kea,
3407 ecc_static_diffie_hellman_kea /* for verify suite only */
3408 };
3409
3410 /* Supported Authentication Schemes */
3411 enum SignatureAlgorithm {
3412 anonymous_sa_algo = 0,
3413 rsa_sa_algo = 1,
3414 dsa_sa_algo = 2,

NetBurner, Inc.
22.208 internal.h 1233

3415 ecc_dsa_sa_algo = 3,
3416 rsa_pss_sa_algo = 8,
3417 ed25519_sa_algo = 9,
3418 rsa_pss_pss_algo = 10,
3419 ed448_sa_algo = 11,
3420 falcon_level1_sa_algo = 12,
3421 falcon_level5_sa_algo = 13,
3422 dilithium_level2_sa_algo = 14,
3423 dilithium_level3_sa_algo = 15,
3424 dilithium_level5_sa_algo = 16,
3425 dilithium_aes_level2_sa_algo = 17,
3426 dilithium_aes_level3_sa_algo = 18,
3427 dilithium_aes_level5_sa_algo = 19,
3428 invalid_sa_algo = 255
3429 };
3430
3431 #define PSS_RSAE_TO_PSS_PSS(macAlgo) \
3432 ((macAlgo) + (pss_sha256 - sha256_mac))
3433
3434 #define PSS_PSS_HASH_TO_MAC(macAlgo) \
3435 ((macAlgo) - (pss_sha256 - sha256_mac))
3436
3437 enum SigAlgRsaPss {
3438 pss_sha256 = 0x09,
3439 pss_sha384 = 0x0a,
3440 pss_sha512 = 0x0b,
3441 };
3442
3443
3444 /* Supported ECC Curve Types */
3445 enum EccCurves {
3446 named_curve = 3
3447 };
3448
3449
3450 /* Valid client certificate request types from page 27 */
3451 enum ClientCertificateType {
3452 rsa_sign = 1,
3453 dss_sign = 2,
3454 rsa_fixed_dh = 3,
3455 dss_fixed_dh = 4,
3456 rsa_ephemeral_dh = 5,
3457 dss_ephemeral_dh = 6,
3458 fortezza_kea_cert = 20,
3459 ecdsa_sign = 64,
3460 rsa_fixed_ecdh = 65,
3461 ecdsa_fixed_ecdh = 66,
3462 falcon_sign = 67,
3463 dilithium_sign = 68,
3464 };
3465
3466
3467 #ifndef WOLFSSL_AEAD_ONLY
3468 enum CipherType { stream, block, aead };
3469 #else
3470 enum CipherType { aead };
3471 #endif
3472
3473
3474 #if defined(BUILD_AES) || defined(BUILD_AESGCM) || (defined(HAVE_CHACHA) && \
3475 defined(HAVE_POLY1305)) || defined(WOLFSSL_TLS13)
3476 #define CIPHER_NONCE
3477 #endif
3478
3479 #if defined(WOLFSSL_DTLS) && defined(HAVE_SECURE_RENEGOTIATION)
3480 enum CipherSrc {
3481 KEYS_NOT_SET = 0,
3482 KEYS, /* keys from ssl->keys are loaded */
3483 SCR /* keys from ssl->secure_renegotiation->tmp_keys are loaded */
3484 };
3485 #endif
3486
3487 #ifdef WOLFSSL_CIPHER_TEXT_CHECK
3488 #ifndef WOLFSSL_CIPHER_CHECK_SZ
3489 /* 64-bits to confirm encrypt operation worked */
3490 #define WOLFSSL_CIPHER_CHECK_SZ 8
3491 #endif
3492 #endif
3493
3494 /* cipher for now */
3495 typedef struct Ciphers {
3496 #ifdef BUILD_ARC4
3497 Arc4* arc4;
3498 #endif
3499 #ifdef BUILD_DES3
3500 Des3* des3;
3501 #endif

NetBurner, Inc.
1234 File Documentation

3502 #if defined(BUILD_AES) || defined(BUILD_AESGCM)


3503 Aes* aes;
3504 #if (defined(BUILD_AESGCM) || defined(HAVE_AESCCM)) && \
3505 !defined(WOLFSSL_NO_TLS12)
3506 byte* additional;
3507 #endif
3508 #endif
3509 #ifdef CIPHER_NONCE
3510 byte* nonce;
3511 #endif
3512 #ifdef HAVE_CAMELLIA
3513 Camellia* cam;
3514 #endif
3515 #ifdef HAVE_CHACHA
3516 ChaCha* chacha;
3517 #endif
3518 #if defined(WOLFSSL_TLS13) && defined(HAVE_NULL_CIPHER)
3519 Hmac* hmac;
3520 #endif
3521 #ifdef WOLFSSL_CIPHER_TEXT_CHECK
3522 word32 sanityCheck[WOLFSSL_CIPHER_CHECK_SZ/sizeof(word32)];
3523 #endif
3524 byte state;
3525 byte setup; /* have we set it up flag for detection */
3526 #if defined(WOLFSSL_DTLS) && defined(HAVE_SECURE_RENEGOTIATION)
3527 enum CipherSrc src; /* DTLS uses this to determine which keys
3528 * are currently loaded */
3529 #endif
3530 } Ciphers;
3531
3532 #ifdef WOLFSSL_DTLS13
3533 typedef struct RecordNumberCiphers {
3534 #if defined(BUILD_AES) || defined(BUILD_AESGCM)
3535 Aes *aes;
3536 #endif /* BUILD_AES || BUILD_AESGCM */
3537 #ifdef HAVE_CHACHA
3538 ChaCha *chacha;
3539 #endif
3540 } RecordNumberCiphers;
3541 #endif /* WOLFSSL_DTLS13 */
3542
3543 #ifdef HAVE_ONE_TIME_AUTH
3544 /* Ciphers for one time authentication such as poly1305 */
3545 typedef struct OneTimeAuth {
3546 #ifdef HAVE_POLY1305
3547 Poly1305* poly1305;
3548 #endif
3549 byte setup; /* flag for if a cipher has been set */
3550
3551 } OneTimeAuth;
3552 #endif
3553
3554
3555 WOLFSSL_LOCAL void InitCiphers(WOLFSSL* ssl);
3556 WOLFSSL_LOCAL void FreeCiphers(WOLFSSL* ssl);
3557
3558
3559 /* hashes type */
3560 typedef struct Hashes {
3561 #if !defined(NO_MD5) && !defined(NO_OLD_TLS)
3562 byte md5[WC_MD5_DIGEST_SIZE];
3563 #endif
3564 #if !defined(NO_SHA)
3565 byte sha[WC_SHA_DIGEST_SIZE];
3566 #endif
3567 #ifndef NO_SHA256
3568 byte sha256[WC_SHA256_DIGEST_SIZE];
3569 #endif
3570 #ifdef WOLFSSL_SHA384
3571 byte sha384[WC_SHA384_DIGEST_SIZE];
3572 #endif
3573 #ifdef WOLFSSL_SHA512
3574 byte sha512[WC_SHA512_DIGEST_SIZE];
3575 #endif
3576 } Hashes;
3577
3578 WOLFSSL_LOCAL int BuildCertHashes(WOLFSSL* ssl, Hashes* hashes);
3579
3580 #ifdef WOLFSSL_TLS13
3581 typedef union Digest {
3582 #ifndef NO_WOLFSSL_SHA256
3583 wc_Sha256 sha256;
3584 #endif
3585 #ifdef WOLFSSL_SHA384
3586 wc_Sha384 sha384;
3587 #endif
3588 #ifdef WOLFSSL_SHA512

NetBurner, Inc.
22.208 internal.h 1235

3589 wc_Sha512 sha512;


3590 #endif
3591 } Digest;
3592 #endif
3593
3594 /* Static x509 buffer */
3595 typedef struct x509_buffer {
3596 int length; /* actual size */
3597 byte buffer[MAX_X509_SIZE]; /* max static cert size */
3598 } x509_buffer;
3599
3600
3601 /* wolfSSL X509_CHAIN, for no dynamic memory SESSION_CACHE */
3602 struct WOLFSSL_X509_CHAIN {
3603 int count; /* total number in chain */
3604 x509_buffer certs[MAX_CHAIN_DEPTH]; /* only allow max depth 4 for now */
3605 };
3606
3607 typedef enum WOLFSSL_SESSION_TYPE {
3608 WOLFSSL_SESSION_TYPE_UNKNOWN,
3609 WOLFSSL_SESSION_TYPE_SSL, /* in ssl->session */
3610 WOLFSSL_SESSION_TYPE_CACHE, /* pointer to internal cache */
3611 WOLFSSL_SESSION_TYPE_HEAP /* allocated from heap SESSION_new */
3612 } WOLFSSL_SESSION_TYPE;
3613
3614 #ifdef WOLFSSL_QUIC
3615 typedef struct QuicRecord QuicRecord;
3616 typedef struct QuicRecord {
3617 struct QuicRecord *next;
3618 uint8_t *data;
3619 word32 capacity;
3620 word32 len;
3621 word32 start;
3622 word32 end;
3623 WOLFSSL_ENCRYPTION_LEVEL level;
3624 word32 rec_hdr_remain;
3625 } QuicEncData;
3626
3627 typedef struct QuicTransportParam QuicTransportParam;
3628 struct QuicTransportParam {
3629 const uint8_t *data;
3630 word16 len;
3631 };
3632
3633 WOLFSSL_LOCAL const QuicTransportParam *QuicTransportParam_new(const uint8_t *data, size_t len, void
*heap);
3634 WOLFSSL_LOCAL const QuicTransportParam *QuicTransportParam_dup(const QuicTransportParam *tp, void
*heap);
3635 WOLFSSL_LOCAL void QuicTransportParam_free(const QuicTransportParam *tp, void *heap);
3636 WOLFSSL_LOCAL int TLSX_QuicTP_Use(WOLFSSL* ssl, TLSX_Type ext_type, int is_response);
3637 WOLFSSL_LOCAL int wolfSSL_quic_add_transport_extensions(WOLFSSL *ssl, int msg_type);
3638
3639 #define QTP_FREE QuicTransportParam_free
3640
3641 #endif /* WOLFSSL_QUIC */
3642
3643 /* wolfSSL session type */
3644 struct WOLFSSL_SESSION {
3645 /* WARNING Do not add fields here. They will be ignored in
3646 * wolfSSL_DupSession. */
3647 WOLFSSL_SESSION_TYPE type;
3648 #ifndef NO_SESSION_CACHE
3649 int cacheRow; /* row in session cache */
3650 #endif
3651 int refCount; /* reference count */
3652 #ifndef SINGLE_THREADED
3653 wolfSSL_Mutex refMutex; /* ref count mutex */
3654 #endif
3655 byte altSessionID[ID_LEN];
3656 byte haveAltSessionID:1;
3657 #ifdef HAVE_EX_DATA
3658 byte ownExData:1;
3659 Rem_Sess_Cb rem_sess_cb;
3660 #endif
3661 void* heap;
3662 /* WARNING The above fields (up to and including the heap) are not copied
3663 * in wolfSSL_DupSession. Place new fields after the heap
3664 * member */
3665
3666 byte side; /* Either WOLFSSL_CLIENT_END or
3667 WOLFSSL_SERVER_END */
3668
3669 word32 bornOn; /* create time in seconds */
3670 word32 timeout; /* timeout in seconds */
3671
3672 byte sessionID[ID_LEN]; /* id for protocol or bogus
3673 * ID for TLS 1.3 */

NetBurner, Inc.
1236 File Documentation

3674 byte sessionIDSz;


3675
3676 byte masterSecret[SECRET_LEN]; /* stored secret */
3677 word16 haveEMS; /* ext master secret flag */
3678 #if defined(SESSION_CERTS) && defined(OPENSSL_EXTRA)
3679 WOLFSSL_X509* peer; /* peer cert */
3680 #endif
3681 #if defined(SESSION_CERTS) || (defined(WOLFSSL_TLS13) && \
3682 defined(HAVE_SESSION_TICKET))
3683 ProtocolVersion version; /* which version was used */
3684 #endif
3685 #if defined(SESSION_CERTS) || !defined(NO_RESUME_SUITE_CHECK) || \
3686 (defined(WOLFSSL_TLS13) && defined(HAVE_SESSION_TICKET))
3687 byte cipherSuite0; /* first byte, normally 0 */
3688 byte cipherSuite; /* 2nd byte, actual suite */
3689 #endif
3690 #ifndef NO_CLIENT_CACHE
3691 word16 idLen; /* serverID length */
3692 byte serverID[SERVER_ID_LEN]; /* for easier client lookup */
3693 #endif
3694 #ifdef OPENSSL_EXTRA
3695 byte sessionCtxSz; /* sessionCtx length */
3696 byte sessionCtx[ID_LEN]; /* app specific context id */
3697 #endif /* OPENSSL_EXTRA */
3698 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
3699 byte peerVerifyRet; /* cert verify error */
3700 #endif
3701 #ifdef WOLFSSL_TLS13
3702 word16 namedGroup;
3703 #endif
3704 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
3705 #ifdef WOLFSSL_TLS13
3706 word32 ticketSeen; /* Time ticket seen (ms) */
3707 word32 ticketAdd; /* Added by client */
3708 TicketNonce ticketNonce; /* Nonce used to derive PSK */
3709 #endif
3710 #ifdef WOLFSSL_EARLY_DATA
3711 word32 maxEarlyDataSz;
3712 #endif
3713 #endif
3714 #ifdef HAVE_SESSION_TICKET
3715 byte staticTicket[SESSION_TICKET_LEN];
3716 byte* ticket;
3717 word16 ticketLen;
3718 word16 ticketLenAlloc; /* is dynamic */
3719 #endif
3720
3721 #ifdef SESSION_CERTS
3722 WOLFSSL_X509_CHAIN chain; /* peer cert chain, static */
3723 #ifdef WOLFSSL_ALT_CERT_CHAINS
3724 WOLFSSL_X509_CHAIN altChain; /* peer alt cert chain, static */
3725 #endif
3726 #endif
3727 #ifdef HAVE_EX_DATA
3728 WOLFSSL_CRYPTO_EX_DATA ex_data;
3729 #endif
3730 };
3731
3732 WOLFSSL_LOCAL int wolfSSL_RAND_Init(void);
3733
3734 WOLFSSL_LOCAL WOLFSSL_SESSION* wolfSSL_NewSession(void* heap);
3735 WOLFSSL_LOCAL WOLFSSL_SESSION* wolfSSL_GetSession(
3736 WOLFSSL* ssl, byte* masterSecret, byte restoreSessionCerts);
3737 WOLFSSL_LOCAL void AddSession(WOLFSSL* ssl);
3738 WOLFSSL_LOCAL int AddSessionToCache(WOLFSSL_CTX* ssl,
3739 WOLFSSL_SESSION* addSession, const byte* id, byte idSz, int* sessionIndex,
3740 int side, word16 useTicket, ClientSession** clientCacheEntry);
3741 #ifndef NO_CLIENT_CACHE
3742 WOLFSSL_LOCAL ClientSession* AddSessionToClientCache(int side, int row, int idx,
3743 byte* serverID, word16 idLen, const byte* sessionID,
3744 word16 useTicket);
3745 #endif
3746 WOLFSSL_LOCAL
3747 WOLFSSL_SESSION* ClientSessionToSession(const WOLFSSL_SESSION* session);
3748 WOLFSSL_LOCAL int wolfSSL_GetSessionFromCache(WOLFSSL* ssl, WOLFSSL_SESSION* output);
3749 WOLFSSL_LOCAL int wolfSSL_SetSession(WOLFSSL* ssl, WOLFSSL_SESSION* session);
3750 WOLFSSL_LOCAL void wolfSSL_FreeSession(WOLFSSL_CTX* ctx,
3751 WOLFSSL_SESSION* session);
3752 WOLFSSL_LOCAL int wolfSSL_DupSession(const WOLFSSL_SESSION* input,
3753 WOLFSSL_SESSION* output, int avoidSysCalls);
3754
3755
3756 typedef int (*hmacfp) (WOLFSSL*, byte*, const byte*, word32, int, int, int, int);
3757
3758 #ifndef NO_CLIENT_CACHE
3759 WOLFSSL_LOCAL WOLFSSL_SESSION* wolfSSL_GetSessionClient(
3760 WOLFSSL* ssl, const byte* id, int len);

NetBurner, Inc.
22.208 internal.h 1237

3761 #endif
3762
3763 /* client connect state for nonblocking restart */
3764 enum ConnectState {
3765 CONNECT_BEGIN = 0,
3766 CLIENT_HELLO_SENT,
3767 HELLO_AGAIN, /* HELLO_AGAIN s for DTLS case */
3768 HELLO_AGAIN_REPLY,
3769 FIRST_REPLY_DONE,
3770 FIRST_REPLY_FIRST,
3771 FIRST_REPLY_SECOND,
3772 FIRST_REPLY_THIRD,
3773 FIRST_REPLY_FOURTH,
3774 FINISHED_DONE,
3775 SECOND_REPLY_DONE,
3776
3777 #ifdef WOLFSSL_DTLS13
3778 WAIT_FINISHED_ACK
3779 #endif /* WOLFSSL_DTLS13 */
3780
3781 };
3782
3783
3784 /* server accept state for nonblocking restart */
3785 enum AcceptState {
3786 ACCEPT_BEGIN = 0,
3787 ACCEPT_BEGIN_RENEG,
3788 ACCEPT_CLIENT_HELLO_DONE,
3789 ACCEPT_HELLO_RETRY_REQUEST_DONE,
3790 ACCEPT_FIRST_REPLY_DONE,
3791 SERVER_HELLO_SENT,
3792 CERT_SENT,
3793 CERT_VERIFY_SENT,
3794 CERT_STATUS_SENT,
3795 KEY_EXCHANGE_SENT,
3796 CERT_REQ_SENT,
3797 SERVER_HELLO_DONE,
3798 ACCEPT_SECOND_REPLY_DONE,
3799 TICKET_SENT,
3800 CHANGE_CIPHER_SENT,
3801 ACCEPT_FINISHED_DONE,
3802 ACCEPT_THIRD_REPLY_DONE
3803 };
3804
3805 /* TLS 1.3 server accept state for nonblocking restart */
3806 enum AcceptStateTls13 {
3807 TLS13_ACCEPT_BEGIN = 0,
3808 TLS13_ACCEPT_BEGIN_RENEG,
3809 TLS13_ACCEPT_CLIENT_HELLO_DONE,
3810 TLS13_ACCEPT_HELLO_RETRY_REQUEST_DONE,
3811 TLS13_ACCEPT_FIRST_REPLY_DONE,
3812 TLS13_ACCEPT_SECOND_REPLY_DONE,
3813 TLS13_SERVER_HELLO_SENT,
3814 TLS13_ACCEPT_THIRD_REPLY_DONE,
3815 TLS13_SERVER_EXTENSIONS_SENT,
3816 TLS13_CERT_REQ_SENT,
3817 TLS13_CERT_SENT,
3818 TLS13_CERT_VERIFY_SENT,
3819 TLS13_ACCEPT_FINISHED_SENT,
3820 TLS13_PRE_TICKET_SENT,
3821 TLS13_ACCEPT_FINISHED_DONE,
3822 TLS13_TICKET_SENT
3823 };
3824
3825 /* buffers for struct WOLFSSL */
3826 typedef struct Buffers {
3827 bufferStatic inputBuffer;
3828 bufferStatic outputBuffer;
3829 buffer domainName; /* for client check */
3830 buffer clearOutputBuffer;
3831 buffer sig; /* signature data */
3832 buffer digest; /* digest data */
3833 int prevSent; /* previous plain text bytes sent
3834 when got WANT_WRITE */
3835 int plainSz; /* plain text bytes in buffer to send
3836 when got WANT_WRITE */
3837 byte weOwnCert; /* SSL own cert flag */
3838 byte weOwnCertChain; /* SSL own cert chain flag */
3839 byte weOwnKey; /* SSL own key flag */
3840 byte weOwnDH; /* SSL own dh (p,g) flag */
3841 #ifndef NO_DH
3842 buffer serverDH_P; /* WOLFSSL_CTX owns, unless we own */
3843 buffer serverDH_G; /* WOLFSSL_CTX owns, unless we own */
3844 buffer serverDH_Pub;
3845 buffer serverDH_Priv;
3846 DhKey* serverDH_Key;
3847 #endif

NetBurner, Inc.
1238 File Documentation

3848 #ifndef NO_CERTS


3849 DerBuffer* certificate; /* WOLFSSL_CTX owns, unless we own */
3850 DerBuffer* key; /* WOLFSSL_CTX owns, unless we own */
3851 byte keyType:6; /* Type of key: RSA, ECC, Ed25519 */
3852 byte keyId:1; /* Key data is an id not data */
3853 byte keyLabel:1; /* Key data is a label not data */
3854 int keySz; /* Size of RSA key */
3855 int keyDevId; /* Device Id for key */
3856 DerBuffer* certChain; /* WOLFSSL_CTX owns, unless we own */
3857 /* chain after self, in DER, with leading size for each cert */
3858 #ifdef WOLFSSL_TLS13
3859 int certChainCnt;
3860 DerBuffer* certExts;
3861 #endif
3862 #endif
3863 #ifdef WOLFSSL_SEND_HRR_COOKIE
3864 buffer tls13CookieSecret; /* HRR cookie secret */
3865 #endif
3866 #ifdef WOLFSSL_DTLS
3867 WOLFSSL_DTLS_CTX dtlsCtx; /* DTLS connection context */
3868 #ifndef NO_WOLFSSL_SERVER
3869 buffer dtlsCookieSecret; /* DTLS cookie secret */
3870 #endif /* NO_WOLFSSL_SERVER */
3871 #endif
3872 #ifdef HAVE_PK_CALLBACKS
3873 #ifdef HAVE_ECC
3874 buffer peerEccDsaKey; /* we own for Ecc Verify Callbacks */
3875 #endif /* HAVE_ECC */
3876 #ifdef HAVE_ED25519
3877 buffer peerEd25519Key; /* for Ed25519 Verify Callbacks */
3878 #endif /* HAVE_ED25519 */
3879 #ifdef HAVE_ED448
3880 buffer peerEd448Key; /* for Ed448 Verify Callbacks */
3881 #endif /* HAVE_ED448 */
3882 #ifndef NO_RSA
3883 buffer peerRsaKey; /* we own for Rsa Verify Callbacks */
3884 #endif /* NO_RSA */
3885 #endif /* HAVE_PK_CALLBACKS */
3886 } Buffers;
3887
3888 /* sub-states for send/do key share (key exchange) */
3889 enum asyncState {
3890 TLS_ASYNC_BEGIN = 0,
3891 TLS_ASYNC_BUILD,
3892 TLS_ASYNC_DO,
3893 TLS_ASYNC_VERIFY,
3894 TLS_ASYNC_FINALIZE,
3895 TLS_ASYNC_END
3896 };
3897
3898 /* sub-states for build message */
3899 enum buildMsgState {
3900 BUILD_MSG_BEGIN = 0,
3901 BUILD_MSG_SIZE,
3902 BUILD_MSG_HASH,
3903 BUILD_MSG_VERIFY_MAC,
3904 BUILD_MSG_ENCRYPT,
3905 BUILD_MSG_ENCRYPTED_VERIFY_MAC,
3906 };
3907
3908 /* sub-states for cipher operations */
3909 enum cipherState {
3910 CIPHER_STATE_BEGIN = 0,
3911 CIPHER_STATE_DO,
3912 CIPHER_STATE_END,
3913 };
3914
3915 typedef struct Options {
3916 #ifndef NO_PSK
3917 wc_psk_client_callback client_psk_cb;
3918 wc_psk_server_callback server_psk_cb;
3919 #ifdef OPENSSL_EXTRA
3920 wc_psk_use_session_cb_func session_psk_cb;
3921 #endif
3922 #ifdef WOLFSSL_TLS13
3923 wc_psk_client_cs_callback client_psk_cs_cb; /* client callback */
3924 wc_psk_client_tls13_callback client_psk_tls13_cb; /* client callback */
3925 wc_psk_server_tls13_callback server_psk_tls13_cb; /* server callback */
3926 #endif
3927 void* psk_ctx;
3928 #endif /* NO_PSK */
3929 unsigned long mask; /* store SSL_OP_ flags */
3930 #if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) || defined(WOLFSSL_WPAS_SMALL)
3931 word16 minProto:1; /* sets min to min available */
3932 word16 maxProto:1; /* sets max to max available */
3933 #endif
3934 #if defined(HAVE_SESSION_TICKET) && defined(WOLFSSL_TLS13)

NetBurner, Inc.
22.208 internal.h 1239

3935 unsigned int maxTicketTls13; /* maximum number of tickets to send */


3936 unsigned int ticketsSent; /* keep track of the total sent */
3937 #endif
3938
3939 /* on/off or small bit flags, optimize layout */
3940 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
3941 word16 havePSK:1; /* psk key set by user */
3942 #endif /* HAVE_SESSION_TICKET || !NO_PSK */
3943 word16 sendVerify:2; /* false = 0, true = 1, sendBlank = 2 */
3944 word16 sessionCacheOff:1;
3945 word16 sessionCacheFlushOff:1;
3946 #ifdef HAVE_EXT_CACHE
3947 word16 internalCacheOff:1;
3948 word16 internalCacheLookupOff:1;
3949 #endif
3950 word16 side:2; /* client, server or neither end */
3951 word16 verifyPeer:1;
3952 word16 verifyNone:1;
3953 word16 failNoCert:1;
3954 word16 failNoCertxPSK:1; /* fail for no cert except with PSK */
3955 word16 downgrade:1; /* allow downgrade of versions */
3956 word16 resuming:1;
3957 word16 isPSK:1;
3958 word16 haveSessionId:1; /* server may not send */
3959 word16 tls:1; /* using TLS ? */
3960 word16 tls1_1:1; /* using TLSv1.1+ ? */
3961 word16 tls1_3:1; /* using TLSv1.3+ ? */
3962 word16 dtls:1; /* using datagrams ? */
3963 word16 connReset:1; /* has the peer reset */
3964 word16 isClosed:1; /* if we consider conn closed */
3965 word16 closeNotify:1; /* we’ve received a close notify */
3966 word16 sentNotify:1; /* we’ve sent a close notify */
3967 word16 usingCompression:1; /* are we using compression */
3968 word16 haveRSA:1; /* RSA available */
3969 word16 haveECC:1; /* ECC available */
3970 word16 haveDH:1; /* server DH parms set by user */
3971 word16 haveECDSAsig:1; /* server ECDSA signed cert */
3972 word16 haveStaticECC:1; /* static server ECC private key */
3973 word16 haveFalconSig:1; /* server Falcon signed cert */
3974 word16 haveDilithiumSig:1; /* server Dilithium signed cert */
3975 word16 havePeerCert:1; /* do we have peer’s cert */
3976 word16 havePeerVerify:1; /* and peer’s cert verify */
3977 word16 usingPSK_cipher:1; /* are using psk as cipher */
3978 word16 usingAnon_cipher:1; /* are we using an anon cipher */
3979 word16 noPskDheKe:1; /* Don’t use (EC)DHE with PSK */
3980 word16 partialWrite:1; /* only one msg per write call */
3981 word16 quietShutdown:1; /* don’t send close notify */
3982 word16 certOnly:1; /* stop once we get cert */
3983 word16 groupMessages:1; /* group handshake messages */
3984 word16 saveArrays:1; /* save array Memory for user get keys
3985 or psk */
3986 word16 weOwnRng:1; /* will be true unless CTX owns */
3987 word16 haveEMS:1; /* using extended master secret */
3988 #ifdef HAVE_POLY1305
3989 word16 oldPoly:1; /* set when to use old rfc way of poly*/
3990 #endif
3991 word16 haveAnon:1; /* User wants to allow Anon suites */
3992 #ifdef HAVE_SESSION_TICKET
3993 word16 createTicket:1; /* Server to create new Ticket */
3994 word16 useTicket:1; /* Use Ticket not session cache */
3995 word16 rejectTicket:1; /* Callback rejected ticket */
3996 word16 noTicketTls12:1; /* TLS 1.2 server won’t send ticket */
3997 #ifdef WOLFSSL_TLS13
3998 word16 noTicketTls13:1; /* Server won’t create new Ticket */
3999 #endif
4000 #endif
4001 #ifdef WOLFSSL_DTLS
4002 word16 dtlsUseNonblock:1; /* are we using nonblocking socket */
4003 word16 dtlsHsRetain:1; /* DTLS retaining HS data */
4004 word16 haveMcast:1; /* using multicast ? */
4005 #ifdef WOLFSSL_SCTP
4006 word16 dtlsSctp:1; /* DTLS-over-SCTP mode */
4007 #endif
4008 #endif /* WOLFSSL_DTLS */
4009 #if defined(HAVE_TLS_EXTENSIONS) && defined(HAVE_SUPPORTED_CURVES)
4010 word16 userCurves:1; /* indicates user called wolfSSL_UseSupportedCurve */
4011 #endif
4012 word16 keepResources:1; /* Keep resources after handshake */
4013 word16 useClientOrder:1; /* Use client’s cipher order */
4014 word16 mutualAuth:1; /* Mutual authentication is required */
4015 word16 peerAuthGood:1; /* Any required peer auth done */
4016 #if defined(WOLFSSL_TLS13) && (defined(HAVE_SESSION_TICKET) || !defined(NO_PSK))
4017 word16 pskNegotiated:1; /* Session Ticket/PSK negotiated. */
4018 #endif
4019 #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH)
4020 word16 postHandshakeAuth:1;/* Client send post_handshake_auth
4021 * extension */

NetBurner, Inc.
1240 File Documentation

4022 word16 verifyPostHandshake:1; /* Only send client cert req post


4023 * handshake, not also during */
4024 #endif
4025 #if defined(WOLFSSL_TLS13) && !defined(NO_WOLFSSL_SERVER)
4026 word16 sendCookie:1; /* Server creates a Cookie in HRR */
4027 #endif
4028 #ifdef WOLFSSL_ALT_CERT_CHAINS
4029 word16 usingAltCertChain:1;/* Alternate cert chain was used */
4030 #endif
4031 #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_TLS13_MIDDLEBOX_COMPAT)
4032 word16 sentChangeCipher:1; /* Change Cipher Spec sent */
4033 #endif
4034 #if !defined(WOLFSSL_NO_CLIENT_AUTH) && \
4035 ((defined(HAVE_ED25519) && !defined(NO_ED25519_CLIENT_AUTH)) || \
4036 (defined(HAVE_ED448) && !defined(NO_ED448_CLIENT_AUTH)))
4037 word16 cacheMessages:1; /* Cache messages for sign/verify */
4038 #endif
4039 #ifndef NO_DH
4040 #if !defined(WOLFSSL_OLD_PRIME_CHECK) && \
4041 !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
4042 word16 dhDoKeyTest:1; /* Need to do the DH Key prime test */
4043 word16 dhKeyTested:1; /* Set when key has been tested. */
4044 #endif
4045 #endif
4046 #ifdef SINGLE_THREADED
4047 word16 ownSuites:1; /* if suites are malloced in ssl object */
4048 #endif
4049 #ifdef HAVE_ENCRYPT_THEN_MAC
4050 word16 disallowEncThenMac:1; /* Don’t do Encrypt-Then-MAC */
4051 word16 encThenMac:1; /* Doing Encrypt-Then-MAC */
4052 word16 startedETMRead:1; /* Doing Encrypt-Then-MAC read */
4053 word16 startedETMWrite:1; /* Doing Encrypt-Then-MAC write */
4054 #endif
4055 #ifdef WOLFSSL_ASYNC_CRYPT
4056 word16 buildArgsSet:1; /* buildArgs are set and need to
4057 * be free’d */
4058 #endif
4059 word16 buildingMsg:1; /* If set then we need to re-enter the
4060 * handshake logic. */
4061 #ifdef WOLFSSL_DTLS13
4062 word16 dtls13SendMoreAcks:1; /* Send more acks during the
4063 * handshake process */
4064 #endif
4065 #ifdef WOLFSSL_TLS13
4066 word16 tls13MiddleBoxCompat:1; /* TLSv1.3 middlebox compatibility */
4067 #endif
4068
4069 /* need full byte values for this section */
4070 byte processReply; /* nonblocking resume */
4071 byte cipherSuite0; /* first byte, normally 0 */
4072 byte cipherSuite; /* second byte, actual suite */
4073 byte serverState;
4074 byte clientState;
4075 byte handShakeState;
4076 byte handShakeDone; /* at least one handshake complete */
4077 byte minDowngrade; /* minimum downgrade version */
4078 byte connectState; /* nonblocking resume */
4079 byte acceptState; /* nonblocking resume */
4080 byte asyncState; /* sub-state for enum asyncState */
4081 byte buildMsgState; /* sub-state for enum buildMsgState */
4082 byte alertCount; /* detect warning dos attempt */
4083 #ifdef WOLFSSL_MULTICAST
4084 word16 mcastID; /* Multicast group ID */
4085 #endif
4086 #ifndef NO_DH
4087 word16 minDhKeySz; /* minimum DH key size */
4088 word16 maxDhKeySz; /* minimum DH key size */
4089 word16 dhKeySz; /* actual DH key size */
4090 #endif
4091 #ifndef NO_RSA
4092 short minRsaKeySz; /* minimum RSA key size */
4093 #endif
4094 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
4095 short minEccKeySz; /* minimum ECC key size */
4096 #endif
4097 #if defined(HAVE_PQC)
4098 short minFalconKeySz; /* minimum Falcon key size */
4099 short minDilithiumKeySz;/* minimum Dilithium key size */
4100 #endif
4101 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
4102 byte verifyDepth; /* maximum verification depth */
4103 #endif
4104 #ifdef WOLFSSL_EARLY_DATA
4105 word16 pskIdIndex;
4106 word32 maxEarlyDataSz;
4107 #endif
4108 #ifdef WOLFSSL_TLS13

NetBurner, Inc.
22.208 internal.h 1241

4109 byte oldMinor; /* client preferred version < TLS 1.3 */


4110 #endif
4111 #ifdef WOLFSSL_DTLS_CID
4112 byte useDtlsCID:1;
4113 #endif /* WOLFSSL_DTLS_CID */
4114 } Options;
4115
4116 typedef struct Arrays {
4117 byte* pendingMsg; /* defrag buffer */
4118 byte* preMasterSecret;
4119 word32 preMasterSz; /* differs for DH, actual size */
4120 word32 pendingMsgSz; /* defrag buffer size */
4121 word32 pendingMsgOffset; /* current offset into defrag buffer */
4122 #if defined(HAVE_SESSION_TICKET) || !defined(NO_PSK)
4123 word32 psk_keySz; /* actual size */
4124 char client_identity[MAX_PSK_ID_LEN + NULL_TERM_LEN];
4125 char server_hint[MAX_PSK_ID_LEN + NULL_TERM_LEN];
4126 byte psk_key[MAX_PSK_KEY_LEN];
4127 #endif
4128 byte clientRandom[RAN_LEN];
4129 byte serverRandom[RAN_LEN];
4130 byte sessionID[ID_LEN];
4131 byte sessionIDSz;
4132 #ifdef WOLFSSL_TLS13
4133 byte secret[SECRET_LEN];
4134 #endif
4135 #ifdef HAVE_KEYING_MATERIAL
4136 byte exporterSecret[WC_MAX_DIGEST_SIZE];
4137 #endif
4138 byte masterSecret[SECRET_LEN];
4139 #if defined(WOLFSSL_RENESAS_TSIP_TLS) && \
4140 !defined(NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION)
4141 byte tsip_masterSecret[TSIP_TLS_MASTERSECRET_SIZE];
4142 #endif
4143 #if defined(WOLFSSL_RENESAS_SCEPROTECT)
4144 byte sce_masterSecret[SCE_TLS_MASTERSECRET_SIZE];
4145 #endif
4146 #ifdef WOLFSSL_DTLS
4147 byte cookie[MAX_COOKIE_LEN];
4148 byte cookieSz;
4149 #endif
4150 byte pendingMsgType; /* defrag buffer message type */
4151 } Arrays;
4152
4153 #ifndef ASN_NAME_MAX
4154 #ifndef NO_ASN
4155 /* use value from asn.h */
4156 #define ASN_NAME_MAX WC_ASN_NAME_MAX
4157 #else
4158 /* calculate for WOLFSSL_X509 */
4159 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
4160 defined(WOLFSSL_CERT_EXT)
4161 #define ASN_NAME_MAX 330
4162 #else
4163 #define ASN_NAME_MAX 256
4164 #endif
4165 #endif
4166 #endif
4167
4168 #ifndef MAX_DATE_SZ
4169 #define MAX_DATE_SZ 32
4170 #endif
4171
4172 typedef enum {
4173 STACK_TYPE_X509 = 0,
4174 STACK_TYPE_GEN_NAME = 1,
4175 STACK_TYPE_BIO = 2,
4176 STACK_TYPE_OBJ = 3,
4177 STACK_TYPE_STRING = 4,
4178 STACK_TYPE_CIPHER = 5,
4179 STACK_TYPE_ACCESS_DESCRIPTION = 6,
4180 STACK_TYPE_X509_EXT = 7,
4181 STACK_TYPE_NULL = 8,
4182 STACK_TYPE_X509_NAME = 9,
4183 STACK_TYPE_CONF_VALUE = 10,
4184 STACK_TYPE_X509_INFO = 11,
4185 STACK_TYPE_BY_DIR_entry = 12,
4186 STACK_TYPE_BY_DIR_hash = 13,
4187 STACK_TYPE_X509_OBJ = 14,
4188 STACK_TYPE_DIST_POINT = 15,
4189 STACK_TYPE_X509_CRL = 16,
4190 STACK_TYPE_X509_NAME_ENTRY = 17,
4191 STACK_TYPE_X509_REQ_ATTR = 18,
4192 } WOLF_STACK_TYPE;
4193
4194 struct WOLFSSL_STACK {
4195 unsigned long num; /* number of nodes in stack

NetBurner, Inc.
1242 File Documentation

4196 * (safety measure for freeing and shortcut for count) */


4197 #if defined(OPENSSL_ALL)
4198 wolf_sk_compare_cb comp;
4199 wolf_sk_hash_cb hash_fn;
4200 unsigned long hash;
4201 #endif
4202
4203 union {
4204 WOLFSSL_X509* x509;
4205 WOLFSSL_X509_NAME* name;
4206 WOLFSSL_X509_NAME_ENTRY* name_entry;
4207 WOLFSSL_X509_INFO* info;
4208 WOLFSSL_BIO* bio;
4209 WOLFSSL_ASN1_OBJECT* obj;
4210 WOLFSSL_CIPHER cipher;
4211 WOLFSSL_ACCESS_DESCRIPTION* access;
4212 WOLFSSL_X509_EXTENSION* ext;
4213 #ifdef OPENSSL_EXTRA
4214 WOLFSSL_CONF_VALUE* conf;
4215 #endif
4216 void* generic;
4217 char* string;
4218 WOLFSSL_GENERAL_NAME* gn;
4219 WOLFSSL_BY_DIR_entry* dir_entry;
4220 WOLFSSL_BY_DIR_HASH* dir_hash;
4221 WOLFSSL_X509_OBJECT* x509_obj;
4222 WOLFSSL_DIST_POINT* dp;
4223 WOLFSSL_X509_CRL* crl;
4224 } data;
4225 void* heap; /* memory heap hint */
4226 WOLFSSL_STACK* next;
4227 WOLF_STACK_TYPE type; /* Identifies type of stack. */
4228 };
4229
4230 struct WOLFSSL_X509_NAME {
4231 char *name;
4232 int dynamicName;
4233 int sz;
4234 char staticName[ASN_NAME_MAX];
4235 #if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) && \
4236 !defined(NO_ASN)
4237 DecodedName fullName;
4238 int entrySz; /* number of entries */
4239 WOLFSSL_X509_NAME_ENTRY entry[MAX_NAME_ENTRIES]; /* all entries i.e. CN */
4240 WOLFSSL_X509* x509; /* x509 that struct belongs to */
4241 #endif /* OPENSSL_EXTRA */
4242 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(HAVE_LIGHTY)
4243 byte raw[ASN_NAME_MAX];
4244 int rawLen;
4245
4246 WOLF_STACK_OF(WOLFSSL_X509_NAME_ENTRY)* entries;
4247 #endif
4248 void* heap;
4249 };
4250
4251 #ifndef EXTERNAL_SERIAL_SIZE
4252 #define EXTERNAL_SERIAL_SIZE 32
4253 #endif
4254
4255 #ifdef NO_ASN
4256 typedef struct DNS_entry DNS_entry;
4257 #endif
4258
4259 struct WOLFSSL_X509 {
4260 int version;
4261 int serialSz;
4262 #ifdef WOLFSSL_SEP
4263 int deviceTypeSz;
4264 int hwTypeSz;
4265 byte deviceType[EXTERNAL_SERIAL_SIZE];
4266 byte hwType[EXTERNAL_SERIAL_SIZE];
4267 int hwSerialNumSz;
4268 byte hwSerialNum[EXTERNAL_SERIAL_SIZE];
4269 #endif /* WOLFSSL_SEP */
4270 #if (defined(WOLFSSL_SEP) || defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || \
4271 defined (OPENSSL_EXTRA)) && \
4272 (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
4273 byte certPolicySet;
4274 byte certPolicyCrit;
4275 #endif /* (WOLFSSL_SEP || WOLFSSL_QT) && (OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL) */
4276 #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
4277 WOLFSSL_STACK* ext_sk; /* Store X509_EXTENSIONS from wolfSSL_X509_get_ext */
4278 WOLFSSL_STACK* ext_sk_full; /* Store X509_EXTENSIONS from wolfSSL_X509_get0_extensions */
4279 WOLFSSL_STACK* ext_d2i;/* Store d2i extensions from wolfSSL_X509_get_ext_d2i */
4280 #endif /* WOLFSSL_QT || OPENSSL_ALL */
4281 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
4282 WOLFSSL_ASN1_INTEGER* serialNumber; /* Stores SN from wolfSSL_X509_get_serialNumber */

NetBurner, Inc.
22.208 internal.h 1243

4283 #endif
4284 WOLFSSL_ASN1_TIME notBefore;
4285 WOLFSSL_ASN1_TIME notAfter;
4286 buffer sig;
4287 int sigOID;
4288 DNS_entry* altNames; /* alt names list */
4289 buffer pubKey;
4290 int pubKeyOID;
4291 DNS_entry* altNamesNext; /* hint for retrieval */
4292 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || \
4293 defined(HAVE_PQC)
4294 word32 pkCurveOID;
4295 #endif /* HAVE_ECC || HAVE_PQC */
4296 #ifndef NO_CERTS
4297 DerBuffer* derCert; /* may need */
4298 #endif
4299 void* heap; /* heap hint */
4300 byte dynamicMemory; /* dynamic memory flag */
4301 byte isCa:1;
4302 #ifdef WOLFSSL_CERT_EXT
4303 char certPolicies[MAX_CERTPOL_NB][MAX_CERTPOL_SZ];
4304 int certPoliciesNb;
4305 #endif /* WOLFSSL_CERT_EXT */
4306 #if defined(OPENSSL_EXTRA_X509_SMALL) || defined(OPENSSL_EXTRA)
4307 #ifndef SINGLE_THREADED
4308 wolfSSL_Mutex refMutex; /* ref count mutex */
4309 #endif
4310 int refCount; /* reference count */
4311 #endif
4312 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
4313 #ifdef HAVE_EX_DATA
4314 WOLFSSL_CRYPTO_EX_DATA ex_data;
4315 #endif
4316 byte* authKeyId; /* Points into authKeyIdSrc */
4317 byte* authKeyIdSrc;
4318 byte* subjKeyId;
4319 byte* extKeyUsageSrc;
4320 #ifdef OPENSSL_ALL
4321 byte* subjAltNameSrc;
4322 #endif
4323 byte* rawCRLInfo;
4324 byte* CRLInfo;
4325 byte* authInfo;
4326 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(WOLFSSL_QT)
4327 byte* authInfoCaIssuer;
4328 int authInfoCaIssuerSz;
4329 #endif
4330 word32 pathLength;
4331 word16 keyUsage;
4332 int rawCRLInfoSz;
4333 int CRLInfoSz;
4334 int authInfoSz;
4335 word32 authKeyIdSz;
4336 word32 authKeyIdSrcSz;
4337 word32 subjKeyIdSz;
4338 byte extKeyUsage;
4339 word32 extKeyUsageSz;
4340 word32 extKeyUsageCount;
4341 #ifndef IGNORE_NETSCAPE_CERT_TYPE
4342 byte nsCertType;
4343 #endif
4344 #ifdef OPENSSL_ALL
4345 word32 subjAltNameSz;
4346 #endif
4347
4348 byte CRLdistSet:1;
4349 byte CRLdistCrit:1;
4350 byte authInfoSet:1;
4351 byte authInfoCrit:1;
4352 byte keyUsageSet:1;
4353 byte keyUsageCrit:1;
4354 byte extKeyUsageCrit:1;
4355 byte subjKeyIdSet:1;
4356
4357 byte subjKeyIdCrit:1;
4358 byte basicConstSet:1;
4359 byte basicConstCrit:1;
4360 byte basicConstPlSet:1;
4361 byte subjAltNameSet:1;
4362 byte subjAltNameCrit:1;
4363 byte authKeyIdSet:1;
4364 byte authKeyIdCrit:1;
4365 byte issuerSet:1;
4366 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
4367 #ifdef WOLFSSL_CERT_REQ
4368 byte isCSR:1;
4369 #endif

NetBurner, Inc.
1244 File Documentation

4370 byte serial[EXTERNAL_SERIAL_SIZE];


4371 char subjectCN[ASN_NAME_MAX]; /* common name short cut */
4372 #if defined(WOLFSSL_CERT_REQ) || defined(WOLFSSL_CERT_GEN)
4373 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
4374 /* stack of CSR attributes */
4375 WOLF_STACK_OF(WOLFSSL_X509_ATRIBUTE)* reqAttributes;
4376 #endif
4377 #if defined(WOLFSSL_CERT_REQ)
4378 char challengePw[CTC_NAME_SIZE]; /* for REQ certs */
4379 char contentType[CTC_NAME_SIZE];
4380 #endif
4381 #endif /* WOLFSSL_CERT_REQ || WOLFSSL_CERT_GEN */
4382 WOLFSSL_X509_NAME issuer;
4383 WOLFSSL_X509_NAME subject;
4384 #if defined(OPENSSL_ALL) || defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_WPAS)
4385 WOLFSSL_X509_ALGOR algor;
4386 WOLFSSL_X509_PUBKEY key;
4387 #endif
4388 #if defined(OPENSSL_EXTRA_X509_SMALL) || defined(OPENSSL_EXTRA) || \
4389 defined(OPENSSL_ALL) || defined(KEEP_OUR_CERT) || \
4390 defined(KEEP_PEER_CERT) || defined(SESSION_CERTS)
4391 byte notBeforeData[CTC_DATE_SIZE];
4392 byte notAfterData[CTC_DATE_SIZE];
4393 #endif
4394 };
4395
4396
4397 /* record layer header for PlainText, Compressed, and CipherText */
4398 typedef struct RecordLayerHeader {
4399 byte type;
4400 byte pvMajor;
4401 byte pvMinor;
4402 byte length[2];
4403 } RecordLayerHeader;
4404
4405
4406 /* record layer header for DTLS PlainText, Compressed, and CipherText */
4407 typedef struct DtlsRecordLayerHeader {
4408 byte type;
4409 byte pvMajor;
4410 byte pvMinor;
4411 byte sequence_number[8]; /* per record */
4412 byte length[2];
4413 } DtlsRecordLayerHeader;
4414
4415
4416 typedef struct DtlsFrag {
4417 word32 begin;
4418 word32 end;
4419 struct DtlsFrag* next;
4420 } DtlsFrag;
4421
4422
4423 typedef struct DtlsMsg {
4424 struct DtlsMsg* next;
4425 byte* buf;
4426 byte* msg;
4427 DtlsFrag* fragList;
4428 word32 fragSz; /* Length of fragments received */
4429 word16 epoch; /* Epoch that this message belongs to */
4430 word32 seq; /* Handshake sequence number */
4431 word32 sz; /* Length of whole message */
4432 byte type;
4433 } DtlsMsg;
4434
4435
4436 #ifdef HAVE_NETX
4437
4438 /* NETX I/O Callback default */
4439 typedef struct NetX_Ctx {
4440 NX_TCP_SOCKET* nxSocket; /* send/recv socket handle */
4441 NX_PACKET* nxPacket; /* incoming packet handle for short reads */
4442 ULONG nxOffset; /* offset already read from nxPacket */
4443 ULONG nxWait; /* wait option flag */
4444 } NetX_Ctx;
4445
4446 #endif
4447
4448 /* Handshake messages received from peer (plus change cipher */
4449 typedef struct MsgsReceived {
4450 word16 got_hello_request:1;
4451 word16 got_client_hello:2;
4452 word16 got_server_hello:1;
4453 word16 got_hello_verify_request:1;
4454 word16 got_session_ticket:1;
4455 word16 got_end_of_early_data:1;
4456 word16 got_hello_retry_request:1;

NetBurner, Inc.
22.208 internal.h 1245

4457 word16 got_encrypted_extensions:1;


4458 word16 got_certificate:1;
4459 word16 got_certificate_status:1;
4460 word16 got_server_key_exchange:1;
4461 word16 got_certificate_request:1;
4462 word16 got_server_hello_done:1;
4463 word16 got_certificate_verify:1;
4464 word16 got_client_key_exchange:1;
4465 word16 got_finished:1;
4466 word16 got_key_update:1;
4467 word16 got_change_cipher:1;
4468 } MsgsReceived;
4469
4470
4471 /* Handshake hashes */
4472 typedef struct HS_Hashes {
4473 Hashes verifyHashes;
4474 Hashes certHashes; /* for cert verify */
4475 #ifndef NO_SHA
4476 wc_Sha hashSha; /* sha hash of handshake msgs */
4477 #endif
4478 #if !defined(NO_MD5) && !defined(NO_OLD_TLS)
4479 wc_Md5 hashMd5; /* md5 hash of handshake msgs */
4480 #endif
4481 #ifndef NO_SHA256
4482 wc_Sha256 hashSha256; /* sha256 hash of handshake msgs */
4483 #endif
4484 #ifdef WOLFSSL_SHA384
4485 wc_Sha384 hashSha384; /* sha384 hash of handshake msgs */
4486 #endif
4487 #ifdef WOLFSSL_SHA512
4488 wc_Sha512 hashSha512; /* sha512 hash of handshake msgs */
4489 #endif
4490 #if (defined(HAVE_ED25519) || defined(HAVE_ED448)) && \
4491 !defined(WOLFSSL_NO_CLIENT_AUTH)
4492 byte* messages; /* handshake messages */
4493 int length; /* length of handshake messages’ data */
4494 int prevLen; /* length of messages but last */
4495 #endif
4496 } HS_Hashes;
4497
4498
4499 #ifndef WOLFSSL_NO_TLS12
4500 /* Persistable BuildMessage arguments */
4501 typedef struct BuildMsgArgs {
4502 word32 digestSz;
4503 word32 sz;
4504 word32 pad;
4505 word32 idx;
4506 word32 headerSz;
4507 word16 size;
4508 word32 ivSz; /* TLSv1.1 IV */
4509 byte* iv;
4510 ALIGN16 byte staticIvBuffer[MAX_IV_SZ];
4511 } BuildMsgArgs;
4512 #endif
4513
4514 #ifdef WOLFSSL_ASYNC_IO
4515 #define MAX_ASYNC_ARGS 18
4516 typedef void (*FreeArgsCb)(struct WOLFSSL* ssl, void* pArgs);
4517
4518 struct WOLFSSL_ASYNC {
4519 #if defined(WOLFSSL_ASYNC_CRYPT) && !defined(WOLFSSL_NO_TLS12)
4520 BuildMsgArgs buildArgs; /* holder for current BuildMessage args */
4521 #endif
4522 FreeArgsCb freeArgs; /* function pointer to cleanup args */
4523 word32 args[MAX_ASYNC_ARGS]; /* holder for current args */
4524 };
4525 #endif
4526
4527 #ifdef HAVE_WRITE_DUP
4528
4529 #define WRITE_DUP_SIDE 1
4530 #define READ_DUP_SIDE 2
4531
4532 typedef struct WriteDup {
4533 wolfSSL_Mutex dupMutex; /* reference count mutex */
4534 int dupCount; /* reference count */
4535 int dupErr; /* under dupMutex, pass to other side */
4536 } WriteDup;
4537
4538 WOLFSSL_LOCAL void FreeWriteDup(WOLFSSL* ssl);
4539 WOLFSSL_LOCAL int NotifyWriteSide(WOLFSSL* ssl, int err);
4540 #endif /* HAVE_WRITE_DUP */
4541
4542 #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH)
4543 typedef struct CertReqCtx CertReqCtx;

NetBurner, Inc.
1246 File Documentation

4544
4545 struct CertReqCtx {
4546 CertReqCtx* next;
4547 byte len;
4548 byte ctx;
4549 };
4550 #endif
4551
4552 #ifdef WOLFSSL_EARLY_DATA
4553 typedef enum EarlyDataState {
4554 no_early_data,
4555 early_data_ext,
4556 expecting_early_data,
4557 process_early_data,
4558 done_early_data
4559 } EarlyDataState;
4560 #endif
4561
4562 #ifdef WOLFSSL_DTLS13
4563
4564 typedef struct Dtls13UnifiedHdrInfo {
4565 word16 recordLength;
4566 byte seqLo;
4567 byte seqHi;
4568 byte seqHiPresent:1;
4569 byte epochBits;
4570 } Dtls13UnifiedHdrInfo;
4571
4572 enum {
4573 DTLS13_EPOCH_EARLYDATA = 1,
4574 DTLS13_EPOCH_HANDSHAKE = 2,
4575 DTLS13_EPOCH_TRAFFIC0 = 3
4576 };
4577
4578 typedef struct Dtls13Epoch {
4579 w64wrapper epochNumber;
4580
4581 w64wrapper nextSeqNumber;
4582 w64wrapper nextPeerSeqNumber;
4583
4584 word32 window[WOLFSSL_DTLS_WINDOW_WORDS];
4585
4586 /* key material for the epoch */
4587 byte client_write_key[MAX_SYM_KEY_SIZE];
4588 byte server_write_key[MAX_SYM_KEY_SIZE];
4589 byte client_write_IV[MAX_WRITE_IV_SZ];
4590 byte server_write_IV[MAX_WRITE_IV_SZ];
4591
4592 byte aead_exp_IV[AEAD_MAX_EXP_SZ];
4593 byte aead_enc_imp_IV[AEAD_MAX_IMP_SZ];
4594 byte aead_dec_imp_IV[AEAD_MAX_IMP_SZ];
4595
4596 byte client_sn_key[MAX_SYM_KEY_SIZE];
4597 byte server_sn_key[MAX_SYM_KEY_SIZE];
4598
4599 byte isValid;
4600 byte side;
4601 } Dtls13Epoch;
4602
4603 #ifndef DTLS13_EPOCH_SIZE
4604 #define DTLS13_EPOCH_SIZE 4
4605 #endif
4606
4607 #ifndef DTLS13_RETRANS_RN_SIZE
4608 #define DTLS13_RETRANS_RN_SIZE 3
4609 #endif
4610
4611 enum Dtls13RtxFsmState {
4612 DTLS13_RTX_FSM_PREPARING = 0,
4613 DTLS13_RTX_FSM_SENDING,
4614 DTLS13_RTX_FSM_WAITING,
4615 DTLS13_RTX_FSM_FINISHED
4616 };
4617
4618 typedef struct Dtls13RtxRecord {
4619 struct Dtls13RtxRecord *next;
4620 word16 length;
4621 byte *data;
4622 w64wrapper epoch;
4623 w64wrapper seq[DTLS13_RETRANS_RN_SIZE];
4624 byte rnIdx;
4625 byte handshakeType;
4626 } Dtls13RtxRecord;
4627
4628 typedef struct Dtls13RecordNumber {
4629 struct Dtls13RecordNumber *next;
4630 w64wrapper epoch;

NetBurner, Inc.
22.208 internal.h 1247

4631 w64wrapper seq;


4632 } Dtls13RecordNumber;
4633
4634 typedef struct Dtls13Rtx {
4635 enum Dtls13RtxFsmState state;
4636 Dtls13RtxRecord *rtxRecords;
4637 Dtls13RtxRecord **rtxRecordTailPtr;
4638 Dtls13RecordNumber *seenRecords;
4639 byte triggeredRtxs;
4640 byte sendAcks:1;
4641 byte retransmit:1;
4642 word32 lastRtx;
4643 } Dtls13Rtx;
4644
4645 #endif /* WOLFSSL_DTLS13 */
4646
4647 #ifdef WOLFSSL_DTLS_CID
4648 typedef struct CIDInfo CIDInfo;
4649 #endif /* WOLFSSL_DTLS_CID */
4650
4651 /* wolfSSL ssl type */
4652 struct WOLFSSL {
4653 WOLFSSL_CTX* ctx;
4654 Suites* suites; /* only need during handshake */
4655 Arrays* arrays;
4656 #ifdef WOLFSSL_TLS13
4657 byte clientSecret[SECRET_LEN];
4658 byte serverSecret[SECRET_LEN];
4659 #endif
4660 HS_Hashes* hsHashes;
4661 void* IOCB_ReadCtx;
4662 void* IOCB_WriteCtx;
4663 WC_RNG* rng;
4664 void* verifyCbCtx; /* cert verify callback user ctx*/
4665 VerifyCallback verifyCallback; /* cert verification callback */
4666 void* heap; /* for user overrides */
4667 #ifdef HAVE_WRITE_DUP
4668 WriteDup* dupWrite; /* valid pointer indicates ON */
4669 /* side that decrements dupCount to zero frees overall structure */
4670 byte dupSide; /* write side or read side */
4671 #endif
4672 #ifdef OPENSSL_EXTRA
4673 byte cbioFlag; /* WOLFSSL_CBIO_RECV/SEND: CBIORecv/Send is set */
4674 #endif
4675 #ifdef WOLFSSL_WOLFSENTRY_HOOKS
4676 NetworkFilterCallback_t AcceptFilter;
4677 void *AcceptFilter_arg;
4678 NetworkFilterCallback_t ConnectFilter;
4679 void *ConnectFilter_arg;
4680 #endif /* WOLFSSL_WOLFSENTRY_HOOKS */
4681 CallbackIORecv CBIORecv;
4682 CallbackIOSend CBIOSend;
4683 #ifdef WOLFSSL_STATIC_MEMORY
4684 WOLFSSL_HEAP_HINT heap_hint;
4685 #endif
4686 #if defined(WOLFSSL_DTLS) && !defined(NO_WOLFSSL_SERVER)
4687 ClientHelloGoodCb chGoodCb; /* notify user we parsed a verified
4688 * ClientHello */
4689 void* chGoodCtx; /* user ClientHello cb context */
4690 #endif
4691 #ifndef NO_HANDSHAKE_DONE_CB
4692 HandShakeDoneCb hsDoneCb; /* notify user handshake done */
4693 void* hsDoneCtx; /* user handshake cb context */
4694 #endif
4695 #ifdef WOLFSSL_ASYNC_IO
4696 #ifdef WOLFSSL_ASYNC_CRYPT
4697 WC_ASYNC_DEV* asyncDev;
4698 #endif
4699 /* Message building context should be stored here for functions that expect
4700 * to encounter encryption blocking or fragment the message. */
4701 struct WOLFSSL_ASYNC* async;
4702 #endif
4703 void* hsKey; /* Handshake key (RsaKey or ecc_key) allocated from heap */
4704 word32 hsType; /* Type of Handshake key (hsKey) */
4705 WOLFSSL_CIPHER cipher;
4706 #ifndef WOLFSSL_AEAD_ONLY
4707 hmacfp hmac;
4708 #endif
4709 Ciphers encrypt;
4710 Ciphers decrypt;
4711 Buffers buffers;
4712 WOLFSSL_SESSION* session;
4713 #ifndef NO_CLIENT_CACHE
4714 ClientSession* clientSession;
4715 #endif
4716 WOLFSSL_ALERT_HISTORY alert_history;
4717 WOLFSSL_ALERT pendingAlert;

NetBurner, Inc.
1248 File Documentation

4718 int error;


4719 int rfd; /* read file descriptor */
4720 int wfd; /* write file descriptor */
4721 int rflags; /* user read flags */
4722 int wflags; /* user write flags */
4723 word32 timeout; /* session timeout */
4724 word32 fragOffset; /* fragment offset */
4725 word16 curSize;
4726 byte verifyDepth;
4727 RecordLayerHeader curRL;
4728 MsgsReceived msgsReceived; /* peer messages received */
4729 ProtocolVersion version; /* negotiated version */
4730 ProtocolVersion chVersion; /* client hello version */
4731 CipherSpecs specs;
4732 Keys keys;
4733 Options options;
4734 #ifdef OPENSSL_EXTRA
4735 CallbackInfoState* CBIS; /* used to get info about SSL state */
4736 int cbmode; /* read or write on info callback */
4737 int cbtype; /* event type in info callback */
4738 WOLFSSL_BIO* biord; /* socket bio read to free/close */
4739 WOLFSSL_BIO* biowr; /* socket bio write to free/close */
4740 byte sessionCtx[ID_LEN]; /* app session context ID */
4741 WOLFSSL_X509_VERIFY_PARAM* param; /* verification parameters*/
4742 word32 disabledCurves; /* curves disabled by user */
4743 #endif
4744 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
4745 unsigned long peerVerifyRet;
4746 #endif
4747 #ifdef OPENSSL_EXTRA
4748 byte readAhead;
4749 byte sessionCtxSz; /* size of sessionCtx stored */
4750 #ifdef HAVE_PK_CALLBACKS
4751 void* loggingCtx; /* logging callback argument */
4752 #endif
4753 #endif /* OPENSSL_EXTRA */
4754 #ifndef NO_RSA
4755 RsaKey* peerRsaKey;
4756 #if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_SCEPROTECT)
4757 void* RenesasUserCtx;
4758 byte* peerSceTsipEncRsaKeyIndex;
4759 #endif
4760 byte peerRsaKeyPresent;
4761 #endif
4762 #if defined(WOLFSSL_TLS13) || defined(HAVE_FFDHE)
4763 word16 namedGroup;
4764 #endif
4765 #ifdef WOLFSSL_TLS13
4766 word16 group[WOLFSSL_MAX_GROUP_COUNT];
4767 byte numGroups;
4768 #endif
4769 word16 pssAlgo;
4770 #ifdef WOLFSSL_TLS13
4771 word16 certHashSigAlgoSz; /* SigAlgoCert ext length in bytes */
4772 byte certHashSigAlgo[WOLFSSL_MAX_SIGALGO]; /* cert sig/algo to
4773 * offer */
4774 #endif
4775 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
4776 int eccVerifyRes;
4777 #endif
4778 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_CURVE25519) || \
4779 defined(HAVE_ED448) || defined(HAVE_CURVE448)
4780 word32 ecdhCurveOID; /* curve Ecc_Sum */
4781 ecc_key* eccTempKey; /* private ECDHE key */
4782 byte eccTempKeyPresent; /* also holds type */
4783 byte peerEccKeyPresent;
4784 #endif
4785 #ifdef HAVE_ECC
4786 ecc_key* peerEccKey; /* peer’s ECDHE key */
4787 ecc_key* peerEccDsaKey; /* peer’s ECDSA key */
4788 word16 eccTempKeySz; /* in octets 20 - 66 */
4789 byte peerEccDsaKeyPresent;
4790 #endif
4791 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || \
4792 defined(HAVE_CURVE448) || defined(HAVE_ED448)
4793 word32 pkCurveOID; /* curve Ecc_Sum */
4794 #endif
4795 #ifdef HAVE_ED25519
4796 ed25519_key* peerEd25519Key;
4797 byte peerEd25519KeyPresent;
4798 #endif
4799 #ifdef HAVE_CURVE25519
4800 curve25519_key* peerX25519Key;
4801 byte peerX25519KeyPresent;
4802 #endif
4803 #ifdef HAVE_ED448
4804 ed448_key* peerEd448Key;

NetBurner, Inc.
22.208 internal.h 1249

4805 byte peerEd448KeyPresent;


4806 #endif
4807 #ifdef HAVE_CURVE448
4808 curve448_key* peerX448Key;
4809 byte peerX448KeyPresent;
4810 #endif
4811 #ifdef HAVE_PQC
4812 falcon_key* peerFalconKey;
4813 byte peerFalconKeyPresent;
4814 dilithium_key* peerDilithiumKey;
4815 byte peerDilithiumKeyPresent;
4816 #endif
4817 #ifdef HAVE_LIBZ
4818 z_stream c_stream; /* compression stream */
4819 z_stream d_stream; /* decompression stream */
4820 byte didStreamInit; /* for stream init and end */
4821 #endif
4822 #ifdef WOLFSSL_DTLS
4823 int dtls_timeout_init; /* starting timeout value */
4824 int dtls_timeout_max; /* maximum timeout value */
4825 int dtls_timeout; /* current timeout value, changes */
4826 #ifndef NO_ASN_TIME
4827 word32 dtls_start_timeout;
4828 #endif /* !NO_ASN_TIME */
4829 word32 dtls_tx_msg_list_sz;
4830 word32 dtls_rx_msg_list_sz;
4831 DtlsMsg* dtls_tx_msg_list;
4832 DtlsMsg* dtls_tx_msg;
4833 DtlsMsg* dtls_rx_msg_list;
4834 void* IOCB_CookieCtx; /* gen cookie ctx */
4835 word32 dtls_expected_rx;
4836 #ifdef WOLFSSL_SESSION_EXPORT
4837 wc_dtls_export dtls_export; /* export function for session */
4838 #endif
4839 #if defined(WOLFSSL_SCTP) || defined(WOLFSSL_DTLS_MTU)
4840 word16 dtlsMtuSz;
4841 #endif /* WOLFSSL_SCTP || WOLFSSL_DTLS_MTU */
4842 #ifdef WOLFSSL_MULTICAST
4843 void* mcastHwCbCtx; /* Multicast highwater callback ctx */
4844 #endif /* WOLFSSL_MULTICAST */
4845 #ifdef WOLFSSL_DTLS_DROP_STATS
4846 word32 macDropCount;
4847 word32 replayDropCount;
4848 #endif /* WOLFSSL_DTLS_DROP_STATS */
4849 #ifdef WOLFSSL_SRTP
4850 word16 dtlsSrtpProfiles; /* DTLS-with-SRTP profiles list
4851 * (selected profiles - up to 16) */
4852 word16 dtlsSrtpId; /* DTLS-with-SRTP profile ID selected */
4853 #endif
4854 #ifdef WOLFSSL_DTLS13
4855 RecordNumberCiphers dtlsRecordNumberEncrypt;
4856 RecordNumberCiphers dtlsRecordNumberDecrypt;
4857 Dtls13Epoch dtls13Epochs[DTLS13_EPOCH_SIZE];
4858 Dtls13Epoch *dtls13EncryptEpoch;
4859 Dtls13Epoch *dtls13DecryptEpoch;
4860 w64wrapper dtls13Epoch;
4861 w64wrapper dtls13PeerEpoch;
4862 byte dtls13CurRL[DTLS_RECVD_RL_HEADER_MAX_SZ];
4863 word16 dtls13CurRlLength;
4864
4865 /* used to store the message if it needs to be fragmented */
4866 buffer dtls13FragmentsBuffer;
4867 byte dtls13SendingFragments:1;
4868 byte dtls13SendingAckOrRtx:1;
4869 byte dtls13FastTimeout:1;
4870 byte dtls13WaitKeyUpdateAck:1;
4871 word32 dtls13MessageLength;
4872 word32 dtls13FragOffset;
4873 byte dtls13FragHandshakeType;
4874 Dtls13Rtx dtls13Rtx;
4875 byte *dtls13ClientHello;
4876 word16 dtls13ClientHelloSz;
4877
4878 #endif /* WOLFSSL_DTLS13 */
4879 #ifdef WOLFSSL_DTLS_CID
4880 CIDInfo *dtlsCidInfo;
4881 #endif /* WOLFSSL_DTLS_CID */
4882
4883 #endif /* WOLFSSL_DTLS */
4884 #ifdef WOLFSSL_CALLBACKS
4885 TimeoutInfo timeoutInfo; /* info saved during handshake */
4886 HandShakeInfo handShakeInfo; /* info saved during handshake */
4887 #endif
4888 #ifdef OPENSSL_EXTRA
4889 SSL_Msg_Cb protoMsgCb; /* inspect protocol message callback */
4890 void* protoMsgCtx; /* user set context with msg callback */
4891 #endif

NetBurner, Inc.
1250 File Documentation

4892 #if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)


4893 byte hsInfoOn; /* track handshake info */
4894 byte toInfoOn; /* track timeout info */
4895 #endif
4896 #ifdef HAVE_FUZZER
4897 CallbackFuzzer fuzzerCb; /* for testing with using fuzzer */
4898 void* fuzzerCtx; /* user defined pointer */
4899 #endif
4900 #if defined(WOLFSSL_TLS13) && defined(WOLFSSL_POST_HANDSHAKE_AUTH)
4901 CertReqCtx* certReqCtx;
4902 #endif
4903 #ifdef WOLFSSL_LOCAL_X509_STORE
4904 WOLFSSL_X509_STORE* x509_store_pt; /* take ownership of external store */
4905 #endif
4906 #ifdef KEEP_PEER_CERT
4907 /* TODO put this on the heap so we can properly use the
4908 * reference counter and not have to duplicate it. */
4909 WOLFSSL_X509 peerCert; /* X509 peer cert */
4910 #endif
4911 #ifdef KEEP_OUR_CERT
4912 WOLFSSL_X509* ourCert; /* keep alive a X509 struct of cert.
4913 points to ctx if not owned (owned
4914 flag found in buffers.weOwnCert) */
4915 #endif
4916 byte keepCert; /* keep certificate after handshake */
4917 #ifdef HAVE_EX_DATA
4918 WOLFSSL_CRYPTO_EX_DATA ex_data; /* external data, for Fortress */
4919 #endif
4920 int devId; /* async device id to use */
4921 #ifdef HAVE_ONE_TIME_AUTH
4922 OneTimeAuth auth;
4923 #endif
4924 #ifdef HAVE_TLS_EXTENSIONS
4925 TLSX* extensions; /* RFC 6066 TLS Extensions data */
4926 #ifdef HAVE_MAX_FRAGMENT
4927 word16 max_fragment;
4928 #endif
4929 #ifdef HAVE_TRUNCATED_HMAC
4930 byte truncated_hmac;
4931 #endif
4932 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST
4933 byte status_request;
4934 #endif
4935 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST_V2
4936 byte status_request_v2;
4937 #endif
4938 #if defined(HAVE_SECURE_RENEGOTIATION) \
4939 || defined(HAVE_SERVER_RENEGOTIATION_INFO)
4940 int secure_rene_count; /* how many times */
4941 SecureRenegotiation* secure_renegotiation; /* valid pointer indicates */
4942 #endif /* user turned on */
4943 #ifdef HAVE_ALPN
4944 char* alpn_client_list; /* keep the client’s list */
4945 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
4946 defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_QUIC)
4947 CallbackALPNSelect alpnSelect;
4948 void* alpnSelectArg;
4949 #endif
4950 #endif /* of accepted protocols */
4951 #if !defined(NO_WOLFSSL_CLIENT) && defined(HAVE_SESSION_TICKET)
4952 CallbackSessionTicket session_ticket_cb;
4953 void* session_ticket_ctx;
4954 byte expect_session_ticket;
4955 #endif
4956 #endif /* HAVE_TLS_EXTENSIONS */
4957 #ifdef HAVE_OCSP
4958 void* ocspIOCtx;
4959 byte ocspProducedDate[MAX_DATE_SZ];
4960 int ocspProducedDateFormat;
4961 #ifdef OPENSSL_EXTRA
4962 byte* ocspResp;
4963 int ocspRespSz;
4964 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
4965 char* url;
4966 #endif
4967 #endif
4968 #endif
4969 #ifdef HAVE_NETX
4970 NetX_Ctx nxCtx; /* NetX IO Context */
4971 #endif
4972 #if defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP)
4973 void* mnCtx; /* mynewt mn_socket IO Context */
4974 #endif /* defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP) */
4975 #ifdef WOLFSSL_GNRC
4976 struct gnrc_wolfssl_ctx *gnrcCtx; /* Riot-OS GNRC UDP/IP context */
4977 #endif
4978 #ifdef SESSION_INDEX

NetBurner, Inc.
22.208 internal.h 1251

4979 int sessionIndex; /* Session’s location in the cache. */


4980 #endif
4981 #ifdef ATOMIC_USER
4982 void* MacEncryptCtx; /* Atomic User Mac/Encrypt Callback Context */
4983 void* DecryptVerifyCtx; /* Atomic User Decrypt/Verify Callback Context */
4984 #ifdef HAVE_ENCRYPT_THEN_MAC
4985 void* EncryptMacCtx; /* Atomic User Encrypt/Mac Callback Ctx */
4986 void* VerifyDecryptCtx; /* Atomic User Verify/Decrypt Callback Ctx */
4987 #endif
4988 #endif
4989 #ifdef HAVE_PK_CALLBACKS
4990 #ifdef HAVE_ECC
4991 void* EccKeyGenCtx; /* EccKeyGen Callback Context */
4992 void* EccSignCtx; /* Ecc Sign Callback Context */
4993 void* EccVerifyCtx; /* Ecc Verify Callback Context */
4994 void* EccSharedSecretCtx; /* Ecc Pms Callback Context */
4995 #endif /* HAVE_ECC */
4996 #ifdef HAVE_HKDF
4997 void* HkdfExtractCtx; /* Hkdf extract callback context */
4998 #endif
4999 #ifdef HAVE_ED25519
5000 void* Ed25519SignCtx; /* ED25519 Sign Callback Context */
5001 void* Ed25519VerifyCtx; /* ED25519 Verify Callback Context */
5002 #endif
5003 #ifdef HAVE_CURVE25519
5004 void* X25519KeyGenCtx; /* X25519 KeyGen Callback Context */
5005 void* X25519SharedSecretCtx; /* X25519 Pms Callback Context */
5006 #endif
5007 #ifdef HAVE_ED448
5008 void* Ed448SignCtx; /* ED448 Sign Callback Context */
5009 void* Ed448VerifyCtx; /* ED448 Verify Callback Context */
5010 #endif
5011 #ifdef HAVE_CURVE448
5012 void* X448KeyGenCtx; /* X448 KeyGen Callback Context */
5013 void* X448SharedSecretCtx; /* X448 Pms Callback Context */
5014 #endif
5015 #ifndef NO_DH
5016 void* DhAgreeCtx; /* DH Pms Callback Context */
5017 #endif /* !NO_DH */
5018 #ifndef NO_RSA
5019 void* RsaSignCtx; /* Rsa Sign Callback Context */
5020 void* RsaVerifyCtx; /* Rsa Verify Callback Context */
5021 #ifdef WC_RSA_PSS
5022 void* RsaPssSignCtx; /* Rsa PSS Sign Callback Context */
5023 void* RsaPssVerifyCtx; /* Rsa PSS Verify Callback Context */
5024 #endif
5025 void* RsaEncCtx; /* Rsa Public Encrypt Callback Context */
5026 void* RsaDecCtx; /* Rsa Private Decrypt Callback Context */
5027 #endif /* NO_RSA */
5028 void* GenPreMasterCtx; /* Generate Premaster Callback Context */
5029 void* GenMasterCtx; /* Generate Master Callback Context */
5030 void* GenSessionKeyCtx; /* Generate Session Key Callback Context */
5031 void* EncryptKeysCtx; /* Set Encrypt keys Callback Context */
5032 void* TlsFinishedCtx; /* Generate Tls Finished Callback Context */
5033 void* VerifyMacCtx; /* Verify mac Callback Context */
5034 #endif /* HAVE_PK_CALLBACKS */
5035 #ifdef HAVE_SECRET_CALLBACK
5036 SessionSecretCb sessionSecretCb;
5037 void* sessionSecretCtx;
5038 #ifdef WOLFSSL_TLS13
5039 Tls13SecretCb tls13SecretCb;
5040 void* tls13SecretCtx;
5041 #endif
5042 #ifdef OPENSSL_EXTRA
5043 SessionSecretCb keyLogCb;
5044 #ifdef WOLFSSL_TLS13
5045 Tls13SecretCb tls13KeyLogCb;
5046 #endif
5047 #endif
5048 #endif /* HAVE_SECRET_CALLBACK */
5049 #ifdef WOLFSSL_JNI
5050 void* jObjectRef; /* reference to WolfSSLSession in JNI wrapper */
5051 #endif /* WOLFSSL_JNI */
5052 #ifdef WOLFSSL_EARLY_DATA
5053 EarlyDataState earlyData;
5054 word32 earlyDataSz;
5055 byte earlyDataStatus;
5056 #endif
5057 #ifdef OPENSSL_ALL
5058 long verifyCallbackResult;
5059 #endif
5060 #if defined(OPENSSL_EXTRA)
5061 WOLFSSL_STACK* supportedCiphers; /* Used in wolfSSL_get_ciphers_compat */
5062 WOLFSSL_STACK* peerCertChain; /* Used in wolfSSL_get_peer_cert_chain */
5063 #ifdef KEEP_OUR_CERT
5064 WOLFSSL_STACK* ourCertChain; /* Used in wolfSSL_add1_chain_cert */
5065 #endif

NetBurner, Inc.
1252 File Documentation

5066 #endif
5067 #ifdef WOLFSSL_STATIC_EPHEMERAL
5068 StaticKeyExchangeInfo_t staticKE;
5069 #endif
5070 #ifdef WOLFSSL_HAVE_TLS_UNIQUE
5071 /* Added in libest port: allow applications to get the ’tls-unique’ Channel
5072 * Binding Type (https://tools.ietf.org/html/rfc5929#section-3). This is
5073 * used in the EST protocol to bind an enrollment to a TLS session through
5074 * ’proof-of-possession’ (https://tools.ietf.org/html/rfc7030#section-3.4
5075 * and https://tools.ietf.org/html/rfc7030#section-3.5). */
5076 byte clientFinished[TLS_FINISHED_SZ_MAX];
5077 byte serverFinished[TLS_FINISHED_SZ_MAX];
5078 byte clientFinished_len;
5079 byte serverFinished_len;
5080 #endif
5081 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_EXTRA) || defined(HAVE_LIGHTY)
5082 WOLF_STACK_OF(WOLFSSL_X509_NAME)* ca_names;
5083 #endif
5084 #if defined(WOLFSSL_IOTSAFE) && defined(HAVE_PK_CALLBACKS)
5085 IOTSAFE iotsafe;
5086 #endif
5087 #ifdef WOLFSSL_LWIP_NATIVE
5088 WOLFSSL_LWIP_NATIVE_STATE lwipCtx; /* LwIP native socket IO Context */
5089 #endif
5090 #ifdef WOLFSSL_QUIC
5091 struct {
5092 const WOLFSSL_QUIC_METHOD* method;
5093 WOLFSSL_ENCRYPTION_LEVEL enc_level_read;
5094 WOLFSSL_ENCRYPTION_LEVEL enc_level_read_next;
5095 WOLFSSL_ENCRYPTION_LEVEL enc_level_latest_recvd;
5096 WOLFSSL_ENCRYPTION_LEVEL enc_level_write;
5097 WOLFSSL_ENCRYPTION_LEVEL enc_level_write_next;
5098 int transport_version;
5099 int early_data_enabled;
5100 const QuicTransportParam* transport_local;
5101 const QuicTransportParam* transport_peer;
5102 const QuicTransportParam* transport_peer_draft;
5103 QuicRecord* input_head; /* we own, data for handshake */
5104 QuicRecord* input_tail; /* points to last element for append */
5105 QuicRecord* scratch; /* we own, record construction */
5106 enum wolfssl_encryption_level_t output_rec_level;
5107 /* encryption level of current output record */
5108 word32 output_rec_remain; /* how many bytes of output TLS record
5109 * content have not been handled yet by quic */
5110 } quic;
5111 #endif /* WOLFSSL_QUIC */
5112 };
5113
5114 /*
5115 * wolfSSL_PEM_read_bio_X509 pushes an ASN_NO_PEM_HEADER error
5116 * to the error queue on file end. This should not be left
5117 * for the caller to find so we clear the last error.
5118 */
5119 #if defined(OPENSSL_EXTRA) && defined(WOLFSSL_HAVE_ERROR_QUEUE)
5120 #define CLEAR_ASN_NO_PEM_HEADER_ERROR(err) \
5121 (err) = wolfSSL_ERR_peek_last_error(); \
5122 if (ERR_GET_LIB(err) == ERR_LIB_PEM && \
5123 ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { \
5124 wc_RemoveErrorNode(-1); \
5125 }
5126 #else
5127 #define CLEAR_ASN_NO_PEM_HEADER_ERROR(err) (void)(err);
5128 #endif
5129
5130 /*
5131 * The SSL object may have its own certificate store. The below macros simplify
5132 * logic for choosing which WOLFSSL_CERT_MANAGER and WOLFSSL_X509_STORE to use.
5133 * Always use SSL specific objects when available and revert to CTX otherwise.
5134 */
5135 #ifdef WOLFSSL_LOCAL_X509_STORE
5136 #define SSL_CM(ssl) ((ssl)->x509_store_pt ? (ssl)->x509_store_pt->cm : (ssl)->ctx->cm)
5137 #define SSL_STORE(ssl) ((ssl)->x509_store_pt ? (ssl)->x509_store_pt : \
5138 ((ssl)->ctx->x509_store_pt ? (ssl)->ctx->x509_store_pt : \
5139 &(ssl)->ctx->x509_store))
5140 #else
5141 #define SSL_CM(ssl) (ssl)->ctx->cm
5142 #endif
5143
5144 #define SSL_CA_NAMES(ssl) ((ssl)->ca_names != NULL ? (ssl)->ca_names : \
5145 (ssl)->ctx->ca_names)
5146
5147 WOLFSSL_LOCAL int SSL_CTX_RefCount(WOLFSSL_CTX* ctx, int incr);
5148 WOLFSSL_LOCAL int SetSSL_CTX(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup);
5149 WOLFSSL_LOCAL int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup);
5150 WOLFSSL_LOCAL int ReinitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup);
5151 WOLFSSL_LOCAL void FreeSSL(WOLFSSL* ssl, void* heap);
5152 WOLFSSL_API void SSL_ResourceFree(WOLFSSL* ssl); /* Micrium uses */

NetBurner, Inc.
22.208 internal.h 1253

5153
5154
5155 #ifndef NO_CERTS
5156
5157 WOLFSSL_LOCAL int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
5158 long sz, int format, int type, WOLFSSL* ssl,
5159 long* used, int userChain, int verify);
5160 WOLFSSL_LOCAL int ProcessFile(WOLFSSL_CTX* ctx, const char* fname, int format,
5161 int type, WOLFSSL* ssl, int userChain,
5162 WOLFSSL_CRL* crl, int verify);
5163
5164 WOLFSSL_LOCAL int CheckHostName(DecodedCert* dCert, const char *domainName,
5165 size_t domainNameLen);
5166 #endif
5167
5168
5169 #if defined(WOLFSSL_CALLBACKS) || defined(OPENSSL_EXTRA)
5170 WOLFSSL_LOCAL void InitHandShakeInfo(HandShakeInfo* info, WOLFSSL* ssl);
5171 WOLFSSL_LOCAL void FinishHandShakeInfo(HandShakeInfo* info);
5172 WOLFSSL_LOCAL void AddPacketName(WOLFSSL* ssl, const char* name);
5173
5174 WOLFSSL_LOCAL void InitTimeoutInfo(TimeoutInfo* info);
5175 WOLFSSL_LOCAL void FreeTimeoutInfo(TimeoutInfo* info, void* heap);
5176 WOLFSSL_LOCAL void AddPacketInfo(WOLFSSL* ssl, const char* name, int type,
5177 const byte* data, int sz, int written, void* heap);
5178 WOLFSSL_LOCAL void AddLateName(const char* name, TimeoutInfo* info);
5179 WOLFSSL_LOCAL void AddLateRecordHeader(const RecordLayerHeader* rl,
5180 TimeoutInfo* info);
5181 #endif
5182
5183
5184 /* Record Layer Header identifier from page 12 */
5185 enum ContentType {
5186 no_type = 0,
5187 change_cipher_spec = 20,
5188 alert = 21,
5189 handshake = 22,
5190 application_data = 23,
5191 #ifdef WOLFSSL_DTLS13
5192 ack = 26,
5193 #endif /* WOLFSSL_DTLS13 */
5194 };
5195
5196
5197 /* handshake header, same for each message type, pgs 20/21 */
5198 typedef struct HandShakeHeader {
5199 byte type;
5200 word24 length;
5201 } HandShakeHeader;
5202
5203
5204 /* DTLS handshake header, same for each message type */
5205 typedef struct DtlsHandShakeHeader {
5206 byte type;
5207 word24 length;
5208 byte message_seq[2]; /* start at 0, retransmit gets same # */
5209 word24 fragment_offset; /* bytes in previous fragments */
5210 word24 fragment_length; /* length of this fragment */
5211 } DtlsHandShakeHeader;
5212
5213
5214 enum HandShakeType {
5215 hello_request = 0,
5216 client_hello = 1,
5217 server_hello = 2,
5218 hello_verify_request = 3, /* DTLS addition */
5219 session_ticket = 4,
5220 end_of_early_data = 5,
5221 hello_retry_request = 6,
5222 encrypted_extensions = 8,
5223 certificate = 11,
5224 server_key_exchange = 12,
5225 certificate_request = 13,
5226 server_hello_done = 14,
5227 certificate_verify = 15,
5228 client_key_exchange = 16,
5229 finished = 20,
5230 certificate_status = 22,
5231 key_update = 24,
5232 change_cipher_hs = 55, /* simulate unique handshake type for sanity
5233 checks. record layer change_cipher
5234 conflicts with handshake finished */
5235 message_hash = 254, /* synthetic message type for TLS v1.3 */
5236 no_shake = 255 /* used to initialize the DtlsMsg record */
5237 };
5238
5239 enum ProvisionSide {

NetBurner, Inc.
1254 File Documentation

5240 PROVISION_CLIENT = 1,
5241 PROVISION_SERVER = 2,
5242 PROVISION_CLIENT_SERVER = 3
5243 };
5244
5245
5246 static const byte kTlsClientStr[SIZEOF_SENDER+1] = { 0x43, 0x4C, 0x4E, 0x54, 0x00 }; /* CLNT */
5247 static const byte kTlsServerStr[SIZEOF_SENDER+1] = { 0x53, 0x52, 0x56, 0x52, 0x00 }; /* SRVR */
5248
5249 static const byte kTlsClientFinStr[FINISHED_LABEL_SZ + 1] = "client finished";
5250 static const byte kTlsServerFinStr[FINISHED_LABEL_SZ + 1] = "server finished";
5251
5252 #if defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)
5253 typedef struct {
5254 int name_len;
5255 const char *name;
5256 int nid;
5257 } WOLF_EC_NIST_NAME;
5258 extern const WOLF_EC_NIST_NAME kNistCurves[];
5259 /* This is the longest and shortest curve name in the kNistCurves list. Note we
5260 * also have quantum-safe group names as well. */
5261 #define kNistCurves_MIN_NAME_LEN 5
5262 #ifdef HAVE_PQC
5263 #define kNistCurves_MAX_NAME_LEN 32
5264 #else
5265 #define kNistCurves_MAX_NAME_LEN 7
5266 #endif
5267 #endif /* OPENSSL_EXTRA || WOLFSSL_WPAS_SMALL */
5268
5269 /* internal functions */
5270 WOLFSSL_LOCAL int SendChangeCipher(WOLFSSL* ssl);
5271 WOLFSSL_LOCAL int SendTicket(WOLFSSL* ssl);
5272 WOLFSSL_LOCAL int DoClientTicket(WOLFSSL* ssl, const byte* input, word32 len);
5273 WOLFSSL_LOCAL int SendData(WOLFSSL* ssl, const void* data, int sz);
5274 #ifdef WOLFSSL_TLS13
5275 WOLFSSL_LOCAL int SendTls13ServerHello(WOLFSSL* ssl, byte extMsgType);
5276 #endif
5277 WOLFSSL_LOCAL int SendCertificate(WOLFSSL* ssl);
5278 WOLFSSL_LOCAL int SendCertificateRequest(WOLFSSL* ssl);
5279 #if defined(HAVE_CERTIFICATE_STATUS_REQUEST) \
5280 || defined(HAVE_CERTIFICATE_STATUS_REQUEST_V2)
5281 WOLFSSL_LOCAL int CreateOcspResponse(WOLFSSL* ssl, OcspRequest** ocspRequest,
5282 buffer* response);
5283 #endif
5284 #if defined(HAVE_SECURE_RENEGOTIATION) && \
5285 !defined(NO_WOLFSSL_SERVER)
5286 WOLFSSL_LOCAL int SendHelloRequest(WOLFSSL* ssl);
5287 #endif
5288 WOLFSSL_LOCAL int SendCertificateStatus(WOLFSSL* ssl);
5289 WOLFSSL_LOCAL int SendServerKeyExchange(WOLFSSL* ssl);
5290 WOLFSSL_LOCAL int SendBuffered(WOLFSSL* ssl);
5291 WOLFSSL_LOCAL int ReceiveData(WOLFSSL* ssl, byte* output, int sz, int peek);
5292 WOLFSSL_LOCAL int SendFinished(WOLFSSL* ssl);
5293 WOLFSSL_LOCAL int RetrySendAlert(WOLFSSL* ssl);
5294 WOLFSSL_LOCAL int SendAlert(WOLFSSL* ssl, int severity, int type);
5295 WOLFSSL_LOCAL int ProcessReply(WOLFSSL* ssl);
5296 WOLFSSL_LOCAL int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr);
5297
5298 WOLFSSL_LOCAL const char* AlertTypeToString(int type);
5299
5300 WOLFSSL_LOCAL int SetCipherSpecs(WOLFSSL* ssl);
5301 WOLFSSL_LOCAL int MakeMasterSecret(WOLFSSL* ssl);
5302
5303 WOLFSSL_LOCAL int DeriveKeys(WOLFSSL* ssl);
5304 WOLFSSL_LOCAL int StoreKeys(WOLFSSL* ssl, const byte* keyData, int side);
5305
5306 WOLFSSL_LOCAL int IsTLS(const WOLFSSL* ssl);
5307 WOLFSSL_LOCAL int IsAtLeastTLSv1_2(const WOLFSSL* ssl);
5308 WOLFSSL_LOCAL int IsAtLeastTLSv1_3(ProtocolVersion pv);
5309 WOLFSSL_LOCAL int TLSv1_3_Capable(WOLFSSL* ssl);
5310
5311 WOLFSSL_LOCAL void FreeHandshakeResources(WOLFSSL* ssl);
5312 WOLFSSL_LOCAL void ShrinkInputBuffer(WOLFSSL* ssl, int forcedFree);
5313 WOLFSSL_LOCAL void ShrinkOutputBuffer(WOLFSSL* ssl);
5314
5315 WOLFSSL_LOCAL int VerifyClientSuite(WOLFSSL* ssl);
5316
5317 WOLFSSL_LOCAL int SetTicket(WOLFSSL* ssl, const byte* ticket, word32 length);
5318 WOLFSSL_LOCAL int wolfSSL_GetMaxFragSize(WOLFSSL* ssl, int maxFragment);
5319
5320 #if defined(WOLFSSL_IOTSAFE) && defined(HAVE_PK_CALLBACKS)
5321 WOLFSSL_LOCAL IOTSAFE *wolfSSL_get_iotsafe_ctx(WOLFSSL *ssl);
5322 WOLFSSL_LOCAL int wolfSSL_set_iotsafe_ctx(WOLFSSL *ssl, IOTSAFE *iotsafe);
5323 #endif
5324
5325 #if (defined(OPENSSL_EXTRA) || defined(WOLFSSL_WPAS_SMALL)) && defined(HAVE_ECC)
5326 WOLFSSL_LOCAL int SetECKeyInternal(WOLFSSL_EC_KEY* eckey);

NetBurner, Inc.
22.208 internal.h 1255

5327 WOLFSSL_LOCAL int SetECKeyExternal(WOLFSSL_EC_KEY* eckey);


5328 #endif
5329
5330 #if defined(OPENSSL_EXTRA)
5331 WOLFSSL_LOCAL int wolfSSL_curve_is_disabled(WOLFSSL* ssl, word16 named_curve);
5332 #else
5333 #define wolfSSL_curve_is_disabled(ssl, c) ((void)(ssl), (void)(c), 0)
5334 #endif
5335
5336 WOLFSSL_LOCAL WC_RNG* WOLFSSL_RSA_GetRNG(WOLFSSL_RSA *rsa, WC_RNG **tmpRNG,
5337 int *initTmpRng);
5338
5339 #ifndef NO_CERTS
5340 #ifndef NO_RSA
5341 #ifdef WC_RSA_PSS
5342 WOLFSSL_LOCAL int CheckRsaPssPadding(const byte* plain, word32 plainSz,
5343 byte* out, word32 sigSz, enum wc_HashType hashType);
5344 WOLFSSL_LOCAL int ConvertHashPss(int hashAlgo,
5345 enum wc_HashType* hashType, int* mgf);
5346 #endif
5347 WOLFSSL_LOCAL int VerifyRsaSign(WOLFSSL* ssl, byte* verifySig,
5348 word32 sigSz, const byte* plain, word32 plainSz, int sigAlgo,
5349 int hashAlgo, RsaKey* key, DerBuffer* keyBufInfo);
5350 WOLFSSL_LOCAL int RsaSign(WOLFSSL* ssl, const byte* in, word32 inSz,
5351 byte* out, word32* outSz, int sigAlgo, int hashAlgo, RsaKey* key,
5352 DerBuffer* keyBufInfo);
5353 WOLFSSL_LOCAL int RsaVerify(WOLFSSL* ssl, byte* in, word32 inSz,
5354 byte** out, int sigAlgo, int hashAlgo, RsaKey* key,
5355 buffer* keyBufInfo);
5356 WOLFSSL_LOCAL int RsaDec(WOLFSSL* ssl, byte* in, word32 inSz, byte** out,
5357 word32* outSz, RsaKey* key, DerBuffer* keyBufInfo);
5358 WOLFSSL_LOCAL int RsaEnc(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out,
5359 word32* outSz, RsaKey* key, buffer* keyBufInfo);
5360 #endif /* !NO_RSA */
5361
5362 #ifdef HAVE_ECC
5363 WOLFSSL_LOCAL int EccSign(WOLFSSL* ssl, const byte* in, word32 inSz,
5364 byte* out, word32* outSz, ecc_key* key, DerBuffer* keyBufInfo);
5365 WOLFSSL_LOCAL int EccVerify(WOLFSSL* ssl, const byte* in, word32 inSz,
5366 const byte* out, word32 outSz, ecc_key* key, buffer* keyBufInfo);
5367 WOLFSSL_LOCAL int EccSharedSecret(WOLFSSL* ssl, ecc_key* priv_key,
5368 ecc_key* pub_key, byte* pubKeyDer, word32* pubKeySz, byte* out,
5369 word32* outlen, int side);
5370 #endif /* HAVE_ECC */
5371 #ifdef HAVE_ED25519
5372 WOLFSSL_LOCAL int Ed25519CheckPubKey(WOLFSSL* ssl);
5373 WOLFSSL_LOCAL int Ed25519Sign(WOLFSSL* ssl, const byte* in, word32 inSz,
5374 byte* out, word32* outSz, ed25519_key* key, DerBuffer* keyBufInfo);
5375 WOLFSSL_LOCAL int Ed25519Verify(WOLFSSL* ssl, const byte* in,
5376 word32 inSz, const byte* msg, word32 msgSz, ed25519_key* key,
5377 buffer* keyBufInfo);
5378 #endif /* HAVE_ED25519 */
5379 #ifdef HAVE_ED448
5380 WOLFSSL_LOCAL int Ed448CheckPubKey(WOLFSSL* ssl);
5381 WOLFSSL_LOCAL int Ed448Sign(WOLFSSL* ssl, const byte* in, word32 inSz,
5382 byte* out, word32* outSz, ed448_key* key, DerBuffer* keyBufInfo);
5383 WOLFSSL_LOCAL int Ed448Verify(WOLFSSL* ssl, const byte* in,
5384 word32 inSz, const byte* msg, word32 msgSz, ed448_key* key,
5385 buffer* keyBufInfo);
5386 #endif /* HAVE_ED448 */
5387
5388
5389 #ifdef WOLFSSL_TRUST_PEER_CERT
5390
5391 /* options for searching hash table for a matching trusted peer cert */
5392 #define WC_MATCH_SKID 0
5393 #define WC_MATCH_NAME 1
5394
5395 WOLFSSL_LOCAL TrustedPeerCert* GetTrustedPeer(void* vp, DecodedCert* cert);
5396 WOLFSSL_LOCAL int MatchTrustedPeer(TrustedPeerCert* tp,
5397 DecodedCert* cert);
5398 #endif
5399
5400 WOLFSSL_LOCAL Signer* GetCA(void* cm, byte* hash);
5401 #ifndef NO_SKID
5402 WOLFSSL_LOCAL Signer* GetCAByName(void* cm, byte* hash);
5403 #endif
5404 #endif /* !NO_CERTS */
5405 WOLFSSL_LOCAL int BuildTlsHandshakeHash(WOLFSSL* ssl, byte* hash,
5406 word32* hashLen);
5407 WOLFSSL_LOCAL int BuildTlsFinished(WOLFSSL* ssl, Hashes* hashes,
5408 const byte* sender);
5409 WOLFSSL_LOCAL void FreeArrays(WOLFSSL* ssl, int keep);
5410 WOLFSSL_LOCAL int CheckAvailableSize(WOLFSSL *ssl, int size);
5411 WOLFSSL_LOCAL int GrowInputBuffer(WOLFSSL* ssl, int size, int usedLength);
5412 #if !defined(NO_WOLFSSL_CLIENT) || !defined(WOLFSSL_NO_CLIENT_AUTH)
5413 WOLFSSL_LOCAL void DoCertFatalAlert(WOLFSSL* ssl, int ret);

NetBurner, Inc.
1256 File Documentation

5414 #endif
5415 #ifndef NO_TLS
5416 WOLFSSL_LOCAL int MakeTlsMasterSecret(WOLFSSL* ssl);
5417 #ifndef WOLFSSL_AEAD_ONLY
5418 WOLFSSL_LOCAL int TLS_hmac(WOLFSSL* ssl, byte* digest, const byte* in,
5419 word32 sz, int padSz, int content, int verify, int epochOrder);
5420 #endif
5421 #endif
5422
5423 WOLFSSL_LOCAL int cipherExtraData(WOLFSSL* ssl);
5424
5425 #ifndef NO_WOLFSSL_CLIENT
5426 WOLFSSL_LOCAL int SendClientHello(WOLFSSL* ssl);
5427 WOLFSSL_LOCAL int DoHelloVerifyRequest(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
5428 word32 size);
5429 #ifdef WOLFSSL_TLS13
5430 WOLFSSL_LOCAL int SendTls13ClientHello(WOLFSSL* ssl);
5431 #endif
5432 WOLFSSL_LOCAL int SendClientKeyExchange(WOLFSSL* ssl);
5433 WOLFSSL_LOCAL int SendCertificateVerify(WOLFSSL* ssl);
5434 #endif /* NO_WOLFSSL_CLIENT */
5435
5436 #ifndef NO_WOLFSSL_SERVER
5437 WOLFSSL_LOCAL int SendServerHello(WOLFSSL* ssl);
5438 WOLFSSL_LOCAL int SendServerHelloDone(WOLFSSL* ssl);
5439 #endif /* NO_WOLFSSL_SERVER */
5440
5441 #ifdef WOLFSSL_DTLS
5442 WOLFSSL_LOCAL DtlsMsg* DtlsMsgNew(word32 sz, void* heap);
5443 WOLFSSL_LOCAL void DtlsMsgDelete(DtlsMsg* item, void* heap);
5444 WOLFSSL_LOCAL void DtlsMsgListDelete(DtlsMsg* head, void* heap);
5445 WOLFSSL_LOCAL void DtlsTxMsgListClean(WOLFSSL* ssl);
5446 WOLFSSL_LOCAL int DtlsMsgSet(DtlsMsg* msg, word32 seq, word16 epoch,
5447 const byte* data, byte type,
5448 word32 fragOffset, word32 fragSz, void* heap);
5449 WOLFSSL_LOCAL DtlsMsg* DtlsMsgFind(DtlsMsg* head, word16 epoch, word32 seq);
5450
5451 WOLFSSL_LOCAL void DtlsMsgStore(WOLFSSL* ssl, word16 epoch, word32 seq,
5452 const byte* data, word32 dataSz, byte type,
5453 word32 fragOffset, word32 fragSz,
5454 void* heap);
5455 WOLFSSL_LOCAL DtlsMsg* DtlsMsgInsert(DtlsMsg* head, DtlsMsg* item);
5456
5457 WOLFSSL_LOCAL int DtlsMsgPoolSave(WOLFSSL* ssl, const byte* data,
5458 word32 dataSz, enum HandShakeType type);
5459 WOLFSSL_LOCAL int DtlsMsgPoolTimeout(WOLFSSL* ssl);
5460 WOLFSSL_LOCAL int VerifyForDtlsMsgPoolSend(WOLFSSL* ssl, byte type,
5461 word32 fragOffset);
5462 WOLFSSL_LOCAL int VerifyForTxDtlsMsgDelete(WOLFSSL* ssl, DtlsMsg* item);
5463 WOLFSSL_LOCAL void DtlsMsgPoolReset(WOLFSSL* ssl);
5464 WOLFSSL_LOCAL int DtlsMsgPoolSend(WOLFSSL* ssl, int sendOnlyFirstPacket);
5465 WOLFSSL_LOCAL int GetDtlsHandShakeHeader(WOLFSSL *ssl, const byte *input,
5466 word32 *inOutIdx, byte *type, word32 *size, word32 *fragOffset,
5467 word32 *fragSz, word32 totalSz);
5468 WOLFSSL_LOCAL int DtlsMsgDrain(WOLFSSL *ssl);
5469 #endif /* WOLFSSL_DTLS */
5470
5471 #if defined(HAVE_SECURE_RENEGOTIATION) && defined(WOLFSSL_DTLS)
5472 WOLFSSL_LOCAL int DtlsSCRKeysSet(WOLFSSL* ssl);
5473 WOLFSSL_LOCAL int IsDtlsMsgSCRKeys(WOLFSSL* ssl);
5474 WOLFSSL_LOCAL int DtlsUseSCRKeys(WOLFSSL* ssl);
5475 WOLFSSL_LOCAL int DtlsCheckOrder(WOLFSSL* ssl, int order);
5476 #endif
5477 WOLFSSL_LOCAL int IsSCR(WOLFSSL* ssl);
5478 WOLFSSL_LOCAL int IsDtlsNotSctpMode(WOLFSSL* ssl);
5479
5480 WOLFSSL_LOCAL void WriteSEQ(WOLFSSL* ssl, int verifyOrder, byte* out);
5481
5482 #if defined(WOLFSSL_TLS13) && (defined(HAVE_SESSION_TICKET) || !defined(NO_PSK))
5483 WOLFSSL_LOCAL word32 TimeNowInMilliseconds(void);
5484
5485 WOLFSSL_LOCAL int FindSuiteMac(WOLFSSL* ssl, byte* suite);
5486 #endif
5487 WOLFSSL_LOCAL word32 LowResTimer(void);
5488
5489 #ifndef NO_CERTS
5490 WOLFSSL_LOCAL void InitX509Name(WOLFSSL_X509_NAME* name, int dynamicFlag,
5491 void* heap);
5492 WOLFSSL_LOCAL void FreeX509Name(WOLFSSL_X509_NAME* name);
5493 WOLFSSL_LOCAL void InitX509(WOLFSSL_X509* x509, int dynamicFlag,
5494 void* heap);
5495 WOLFSSL_LOCAL void FreeX509(WOLFSSL_X509* x509);
5496 WOLFSSL_LOCAL int CopyDecodedToX509(WOLFSSL_X509* x509,
5497 DecodedCert* dCert);
5498 #endif
5499
5500 #ifndef MAX_CIPHER_NAME

NetBurner, Inc.
22.208 internal.h 1257

5501 #define MAX_CIPHER_NAME 50


5502 #endif
5503
5504 #ifdef WOLFSSL_NAMES_STATIC
5505 typedef char cipher_name[MAX_CIPHER_NAME];
5506 #else
5507 typedef const char* cipher_name;
5508 #endif
5509
5510 typedef struct CipherSuiteInfo {
5511 cipher_name name;
5512 #ifndef NO_ERROR_STRINGS
5513 cipher_name name_iana;
5514 #endif
5515 byte cipherSuite0;
5516 byte cipherSuite;
5517 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT) || \
5518 defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_NGINX)
5519 byte minor;
5520 byte major;
5521 #endif
5522 byte flags;
5523 } CipherSuiteInfo;
5524
5525 WOLFSSL_LOCAL const CipherSuiteInfo* GetCipherNames(void);
5526 WOLFSSL_LOCAL int GetCipherNamesSize(void);
5527 WOLFSSL_LOCAL const char* GetCipherNameInternal(byte cipherSuite0, byte cipherSuite);
5528 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
5529 /* used in wolfSSL_sk_CIPHER_description */
5530 #define MAX_SEGMENTS 5
5531 #define MAX_SEGMENT_SZ 20
5532 WOLFSSL_LOCAL int wolfSSL_sk_CIPHER_description(WOLFSSL_CIPHER* cipher);
5533 WOLFSSL_LOCAL const char* GetCipherSegment(const WOLFSSL_CIPHER* cipher,
5534 char n[][MAX_SEGMENT_SZ]);
5535 WOLFSSL_LOCAL const char* GetCipherProtocol(byte minor);
5536 WOLFSSL_LOCAL const char* GetCipherKeaStr(char n[][MAX_SEGMENT_SZ]);
5537 WOLFSSL_LOCAL const char* GetCipherAuthStr(char n[][MAX_SEGMENT_SZ]);
5538 WOLFSSL_LOCAL const char* GetCipherEncStr(char n[][MAX_SEGMENT_SZ]);
5539 WOLFSSL_LOCAL const char* GetCipherMacStr(char n[][MAX_SEGMENT_SZ]);
5540 WOLFSSL_LOCAL int SetCipherBits(const char* enc);
5541 WOLFSSL_LOCAL int IsCipherAEAD(char n[][MAX_SEGMENT_SZ]);
5542 #endif
5543 WOLFSSL_LOCAL const char* GetCipherNameIana(byte cipherSuite0, byte cipherSuite);
5544 WOLFSSL_LOCAL const char* wolfSSL_get_cipher_name_internal(WOLFSSL* ssl);
5545 WOLFSSL_LOCAL const char* wolfSSL_get_cipher_name_iana(WOLFSSL* ssl);
5546 WOLFSSL_LOCAL int GetCipherSuiteFromName(const char* name, byte* cipherSuite0,
5547 byte* cipherSuite, int* flags);
5548
5549
5550 enum encrypt_side {
5551 ENCRYPT_SIDE_ONLY = 1,
5552 DECRYPT_SIDE_ONLY,
5553 ENCRYPT_AND_DECRYPT_SIDE
5554 };
5555
5556 WOLFSSL_LOCAL int SetKeysSide(WOLFSSL* ssl, enum encrypt_side side);
5557
5558 /* Set*Internal and Set*External functions */
5559 WOLFSSL_LOCAL int SetDsaInternal(WOLFSSL_DSA* dsa);
5560 WOLFSSL_LOCAL int SetDsaExternal(WOLFSSL_DSA* dsa);
5561 #ifndef HAVE_USER_RSA
5562 WOLFSSL_LOCAL int SetRsaExternal(WOLFSSL_RSA* rsa);
5563 WOLFSSL_LOCAL int SetRsaInternal(WOLFSSL_RSA* rsa);
5564 #endif
5565
5566 typedef enum elem_set {
5567 ELEMENT_P = 0x01,
5568 ELEMENT_Q = 0x02,
5569 ELEMENT_G = 0x04,
5570 ELEMENT_PUB = 0x08,
5571 ELEMENT_PRV = 0x10,
5572 } Element_Set;
5573 WOLFSSL_LOCAL int SetDhExternal_ex(WOLFSSL_DH *dh, int elm );
5574 WOLFSSL_LOCAL int SetDhInternal(WOLFSSL_DH* dh);
5575 WOLFSSL_LOCAL int SetDhExternal(WOLFSSL_DH *dh);
5576
5577 #if !defined(NO_DH) && (!defined(NO_CERTS) || !defined(NO_PSK))
5578 WOLFSSL_LOCAL int DhGenKeyPair(WOLFSSL* ssl, DhKey* dhKey,
5579 byte* priv, word32* privSz,
5580 byte* pub, word32* pubSz);
5581 WOLFSSL_LOCAL int DhAgree(WOLFSSL* ssl, DhKey* dhKey,
5582 const byte* priv, word32 privSz,
5583 const byte* otherPub, word32 otherPubSz,
5584 byte* agree, word32* agreeSz,
5585 const byte* prime, word32 primeSz);
5586 #endif /* !NO_DH */
5587

NetBurner, Inc.
1258 File Documentation

5588 #ifdef HAVE_ECC


5589 WOLFSSL_LOCAL int EccMakeKey(WOLFSSL* ssl, ecc_key* key, ecc_key* peer);
5590 WOLFSSL_LOCAL word16 GetCurveByOID(int oidSum);
5591 #endif
5592
5593 WOLFSSL_LOCAL int InitHandshakeHashes(WOLFSSL* ssl);
5594 WOLFSSL_LOCAL void FreeHandshakeHashes(WOLFSSL* ssl);
5595
5596
5597 #ifndef WOLFSSL_NO_TLS12
5598 WOLFSSL_LOCAL void FreeBuildMsgArgs(WOLFSSL* ssl, BuildMsgArgs* args);
5599 #endif
5600 WOLFSSL_LOCAL int BuildMessage(WOLFSSL* ssl, byte* output, int outSz,
5601 const byte* input, int inSz, int type, int hashOutput,
5602 int sizeOnly, int asyncOkay, int epochOrder);
5603
5604 #ifdef WOLFSSL_TLS13
5605 int BuildTls13Message(WOLFSSL* ssl, byte* output, int outSz, const byte* input,
5606 int inSz, int type, int hashOutput, int sizeOnly, int asyncOkay);
5607 #endif
5608
5609 WOLFSSL_LOCAL int AllocKey(WOLFSSL* ssl, int type, void** pKey);
5610 WOLFSSL_LOCAL void FreeKey(WOLFSSL* ssl, int type, void** pKey);
5611
5612 #ifdef WOLFSSL_ASYNC_CRYPT
5613 WOLFSSL_LOCAL int wolfSSL_AsyncInit(WOLFSSL* ssl, WC_ASYNC_DEV* asyncDev, word32 flags);
5614 WOLFSSL_LOCAL int wolfSSL_AsyncPop(WOLFSSL* ssl, byte* state);
5615 WOLFSSL_LOCAL int wolfSSL_AsyncPush(WOLFSSL* ssl, WC_ASYNC_DEV* asyncDev);
5616 #endif
5617
5618 #if defined(OPENSSL_ALL) && defined(WOLFSSL_CERT_GEN) && \
5619 (defined(WOLFSSL_CERT_REQ) || defined(WOLFSSL_CERT_EXT)) && \
5620 !defined(NO_FILESYSTEM) && !defined(NO_WOLFSSL_DIR)
5621 WOLFSSL_LOCAL int LoadCertByIssuer(WOLFSSL_X509_STORE* store,
5622 X509_NAME* issuer, int Type);
5623 #endif
5624 #if defined(OPENSSL_ALL) && !defined(NO_FILESYSTEM) && !defined(NO_WOLFSSL_DIR)
5625 WOLFSSL_LOCAL WOLFSSL_BY_DIR_HASH* wolfSSL_BY_DIR_HASH_new(void);
5626 WOLFSSL_LOCAL void wolfSSL_BY_DIR_HASH_free(WOLFSSL_BY_DIR_HASH* dir_hash);
5627 WOLFSSL_LOCAL WOLFSSL_STACK* wolfSSL_sk_BY_DIR_HASH_new_null(void);
5628 WOLFSSL_LOCAL int wolfSSL_sk_BY_DIR_HASH_find(
5629 WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH)* sk, const WOLFSSL_BY_DIR_HASH* toFind);
5630 WOLFSSL_LOCAL int wolfSSL_sk_BY_DIR_HASH_num(const WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH) *sk);
5631 WOLFSSL_LOCAL WOLFSSL_BY_DIR_HASH* wolfSSL_sk_BY_DIR_HASH_value(
5632 const WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH) *sk, int i);
5633 WOLFSSL_LOCAL WOLFSSL_BY_DIR_HASH* wolfSSL_sk_BY_DIR_HASH_pop(
5634 WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH)* sk);
5635 WOLFSSL_LOCAL void wolfSSL_sk_BY_DIR_HASH_pop_free(WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH)* sk,
5636 void (*f) (WOLFSSL_BY_DIR_HASH*));
5637 WOLFSSL_LOCAL void wolfSSL_sk_BY_DIR_HASH_free(WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH) *sk);
5638 WOLFSSL_LOCAL int wolfSSL_sk_BY_DIR_HASH_push(WOLF_STACK_OF(WOLFSSL_BY_DIR_HASH)* sk,
5639 WOLFSSL_BY_DIR_HASH* in);
5640 /* WOLFSSL_BY_DIR_entry stuff */
5641 WOLFSSL_LOCAL WOLFSSL_BY_DIR_entry* wolfSSL_BY_DIR_entry_new(void);
5642 WOLFSSL_LOCAL void wolfSSL_BY_DIR_entry_free(WOLFSSL_BY_DIR_entry* entry);
5643 WOLFSSL_LOCAL WOLFSSL_STACK* wolfSSL_sk_BY_DIR_entry_new_null(void);
5644 WOLFSSL_LOCAL int wolfSSL_sk_BY_DIR_entry_num(const WOLF_STACK_OF(WOLFSSL_BY_DIR_entry) *sk);
5645 WOLFSSL_LOCAL WOLFSSL_BY_DIR_entry* wolfSSL_sk_BY_DIR_entry_value(
5646 const WOLF_STACK_OF(WOLFSSL_BY_DIR_entry) *sk, int i);
5647 WOLFSSL_LOCAL WOLFSSL_BY_DIR_entry* wolfSSL_sk_BY_DIR_entry_pop(
5648 WOLF_STACK_OF(WOLFSSL_BY_DIR_entry)* sk);
5649 WOLFSSL_LOCAL void wolfSSL_sk_BY_DIR_entry_pop_free(WOLF_STACK_OF(wolfSSL_BY_DIR_entry)* sk,
5650 void (*f) (WOLFSSL_BY_DIR_entry*));
5651 WOLFSSL_LOCAL void wolfSSL_sk_BY_DIR_entry_free(WOLF_STACK_OF(wolfSSL_BY_DIR_entry) *sk);
5652 WOLFSSL_LOCAL int wolfSSL_sk_BY_DIR_entry_push(WOLF_STACK_OF(wolfSSL_BY_DIR_entry)* sk,
5653 WOLFSSL_BY_DIR_entry* in);
5654 #endif /* OPENSSL_ALL && !NO_FILESYSTEM && !NO_WOLFSSL_DIR */
5655 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
5656 WOLFSSL_LOCAL int oid2nid(word32 oid, int grp);
5657 WOLFSSL_LOCAL word32 nid2oid(int nid, int grp);
5658 #endif
5659
5660 #ifdef WOLFSSL_DTLS
5661 WOLFSSL_API int wolfSSL_DtlsUpdateWindow(word16 cur_hi, word32 cur_lo,
5662 word16* next_hi, word32* next_lo, word32 *window);
5663 #endif
5664
5665 #ifdef WOLFSSL_DTLS13
5666
5667 WOLFSSL_LOCAL struct Dtls13Epoch* Dtls13GetEpoch(WOLFSSL* ssl,
5668 w64wrapper epochNumber);
5669 WOLFSSL_LOCAL int Dtls13NewEpoch(WOLFSSL* ssl, w64wrapper epochNumber,
5670 int side);
5671 WOLFSSL_LOCAL int Dtls13SetEpochKeys(WOLFSSL* ssl, w64wrapper epochNumber,
5672 enum encrypt_side side);
5673 WOLFSSL_LOCAL int Dtls13GetSeq(WOLFSSL* ssl, int order, word32* seq,
5674 byte increment);

NetBurner, Inc.
22.208 internal.h 1259

5675 WOLFSSL_LOCAL int Dtls13DoScheduledWork(WOLFSSL* ssl);


5676 WOLFSSL_LOCAL int Dtls13DeriveSnKeys(WOLFSSL* ssl, int provision);
5677 WOLFSSL_LOCAL int Dtls13SetRecordNumberKeys(WOLFSSL* ssl,
5678 enum encrypt_side side);
5679
5680 WOLFSSL_LOCAL int Dtls13AddHeaders(byte* output, word32 length,
5681 enum HandShakeType hs_type, WOLFSSL* ssl);
5682 WOLFSSL_LOCAL word16 Dtls13GetHeadersLength(WOLFSSL *ssl,
5683 enum HandShakeType type);
5684 WOLFSSL_LOCAL word16 Dtls13GetRlHeaderLength(WOLFSSL *ssl, byte is_encrypted);
5685 WOLFSSL_LOCAL int Dtls13RlAddCiphertextHeader(WOLFSSL* ssl, byte* out,
5686 word16 length);
5687 WOLFSSL_LOCAL int Dtls13RlAddPlaintextHeader(WOLFSSL* ssl, byte* out,
5688 enum ContentType content_type, word16 length);
5689 WOLFSSL_LOCAL int Dtls13EncryptRecordNumber(WOLFSSL* ssl, byte* hdr,
5690 word16 recordLength);
5691 WOLFSSL_LOCAL int Dtls13IsUnifiedHeader(byte header_flags);
5692 WOLFSSL_LOCAL int Dtls13GetUnifiedHeaderSize(WOLFSSL* ssl, const byte input,
5693 word16* size);
5694 WOLFSSL_LOCAL int Dtls13ParseUnifiedRecordLayer(WOLFSSL* ssl, const byte* input,
5695 word16 input_size, Dtls13UnifiedHdrInfo* hdrInfo);
5696 WOLFSSL_LOCAL int Dtls13HandshakeSend(WOLFSSL* ssl, byte* output,
5697 word16 output_size, word16 length, enum HandShakeType handshake_type,
5698 int hash_output);
5699 WOLFSSL_LOCAL int Dtls13RecordRecvd(WOLFSSL* ssl);
5700 WOLFSSL_LOCAL int Dtls13HandshakeRecv(WOLFSSL* ssl, byte* input,
5701 word32* inOutIdx, word32 totalSz);
5702 WOLFSSL_LOCAL int Dtls13HandshakeAddHeader(WOLFSSL* ssl, byte* output,
5703 enum HandShakeType msg_type, word32 length);
5704 #define EE_MASK (0x3)
5705 WOLFSSL_LOCAL int Dtls13FragmentsContinue(WOLFSSL* ssl);
5706 WOLFSSL_LOCAL int DoDtls13Ack(WOLFSSL* ssl, const byte* input, word32 inputSize,
5707 word32* processedSize);
5708 WOLFSSL_LOCAL int Dtls13ReconstructEpochNumber(WOLFSSL* ssl, byte epochBits,
5709 w64wrapper* epoch);
5710 WOLFSSL_LOCAL int Dtls13ReconstructSeqNumber(WOLFSSL* ssl,
5711 Dtls13UnifiedHdrInfo* hdrInfo, w64wrapper* out);
5712 WOLFSSL_LOCAL int SendDtls13Ack(WOLFSSL* ssl);
5713 WOLFSSL_LOCAL int Dtls13RtxProcessingCertificate(WOLFSSL* ssl, byte* input,
5714 word32 inputSize);
5715 WOLFSSL_LOCAL int Dtls13HashHandshake(WOLFSSL* ssl, const byte* output,
5716 word16 length);
5717 WOLFSSL_LOCAL void Dtls13FreeFsmResources(WOLFSSL* ssl);
5718 WOLFSSL_LOCAL int Dtls13RtxTimeout(WOLFSSL* ssl);
5719 WOLFSSL_LOCAL int Dtls13ProcessBufferedMessages(WOLFSSL* ssl);
5720 #endif /* WOLFSSL_DTLS13 */
5721
5722 #ifdef WOLFSSL_STATIC_EPHEMERAL
5723 WOLFSSL_LOCAL int wolfSSL_StaticEphemeralKeyLoad(WOLFSSL* ssl, int keyAlgo, void* keyPtr);
5724 #endif
5725
5726 #ifndef NO_CERTS
5727 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || \
5728 defined(OPENSSL_EXTRA_X509_SMALL)
5729 WOLFSSL_LOCAL int wolfSSL_ASN1_STRING_canon(WOLFSSL_ASN1_STRING* asn_out,
5730 const WOLFSSL_ASN1_STRING* asn_in);
5731 #endif
5732 #ifdef OPENSSL_EXTRA
5733 WOLFSSL_LOCAL int GetX509Error(int e);
5734 #endif
5735 #endif
5736
5737 #if defined(HAVE_EX_DATA) && \
5738 (defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
5739 defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) || \
5740 defined(HAVE_LIGHTY)) || defined(HAVE_EX_DATA) || \
5741 defined(WOLFSSL_WPAS_SMALL)
5742 WOLFSSL_LOCAL int wolfssl_get_ex_new_index(int class_index);
5743 #endif
5744
5745 #if !defined(WC_NO_RNG) && (defined(OPENSSL_EXTRA) || \
5746 (defined(OPENSSL_EXTRA_X509_SMALL) && !defined(NO_RSA)))
5747 WOLFSSL_LOCAL WC_RNG* wolfssl_get_global_rng(void);
5748 #endif
5749
5750 #if !defined(WOLFCRYPT_ONLY) && defined(OPENSSL_EXTRA)
5751 #if defined(WOLFSSL_KEY_GEN) && defined(WOLFSSL_PEM_TO_DER)
5752 WOLFSSL_LOCAL int EncryptDerKey(byte *der, int *derSz, const EVP_CIPHER* cipher,
5753 unsigned char* passwd, int passwdSz, byte **cipherInfo, int maxDerSz);
5754 #endif
5755 #endif
5756
5757 #if defined(WOLFSSL_KEY_GEN) && !defined(NO_RSA) && !defined(HAVE_USER_RSA)
5758 WOLFSSL_LOCAL int wolfSSL_RSA_To_Der(WOLFSSL_RSA* rsa, byte** outBuf,
5759 int publicKey, void* heap);
5760 #endif
5761

NetBurner, Inc.
1260 File Documentation

5762 #ifdef WOLFSSL_QUIC


5763 #define WOLFSSL_IS_QUIC(s) (((s) != NULL) && ((s)->quic.method != NULL))
5764 WOLFSSL_LOCAL int wolfSSL_quic_receive(WOLFSSL* ssl, byte* buf, word32 sz);
5765 WOLFSSL_LOCAL int wolfSSL_quic_send(WOLFSSL* ssl);
5766 WOLFSSL_LOCAL void wolfSSL_quic_clear(WOLFSSL* ssl);
5767 WOLFSSL_LOCAL void wolfSSL_quic_free(WOLFSSL* ssl);
5768 WOLFSSL_LOCAL int wolfSSL_quic_forward_secrets(WOLFSSL *ssl,
5769 int ktype, int side);
5770 WOLFSSL_LOCAL int wolfSSL_quic_keys_active(WOLFSSL* ssl, enum encrypt_side side);
5771
5772 #else
5773 #define WOLFSSL_IS_QUIC(s) 0
5774 #endif /* WOLFSSL_QUIC (else) */
5775
5776 #ifdef __cplusplus
5777 } /* extern "C" */
5778 #endif
5779
5780 #endif /* wolfSSL_INT_H */

22.209 ocsp.h
1 /* ocsp.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 /* wolfSSL OCSP API */
15
16 #ifndef WOLFSSL_OCSP_H
17 #define WOLFSSL_OCSP_H
18
19 #ifdef HAVE_OCSP
20
21 #include <wolfssl/ssl.h>
22 #include <wolfssl/wolfcrypt/asn.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 typedef struct WOLFSSL_OCSP WOLFSSL_OCSP;
29
30 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(WOLFSSL_NGINX) ||\
31 defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY)
32 typedef struct OcspResponse WOLFSSL_OCSP_BASICRESP;
33
34 typedef struct OcspEntry WOLFSSL_OCSP_CERTID;
35
36 typedef struct OcspEntry WOLFSSL_OCSP_SINGLERESP;
37
38 typedef struct OcspRequest WOLFSSL_OCSP_ONEREQ;
39
40 typedef struct OcspRequest WOLFSSL_OCSP_REQUEST;
41 #endif
42
43 WOLFSSL_LOCAL int InitOCSP(WOLFSSL_OCSP* ocsp, WOLFSSL_CERT_MANAGER* cm);
44 WOLFSSL_LOCAL void FreeOCSP(WOLFSSL_OCSP* ocsp, int dynamic);
45
46 WOLFSSL_LOCAL int CheckCertOCSP(WOLFSSL_OCSP* ocsp, DecodedCert* cert,
47 WOLFSSL_BUFFER_INFO* responseBuffer);
48 WOLFSSL_LOCAL int CheckCertOCSP_ex(WOLFSSL_OCSP* ocsp, DecodedCert* cert,
49 WOLFSSL_BUFFER_INFO* responseBuffer, WOLFSSL* ssl);
50 WOLFSSL_LOCAL int CheckOcspRequest(WOLFSSL_OCSP* ocsp,
51 OcspRequest* ocspRequest, WOLFSSL_BUFFER_INFO* responseBuffer);
52 WOLFSSL_LOCAL int CheckOcspResponse(WOLFSSL_OCSP *ocsp, byte *response, int responseSz,
53 WOLFSSL_BUFFER_INFO *responseBuffer, CertStatus *status,
54 OcspEntry *entry, OcspRequest *ocspRequest);
55
56 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
57 defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIGHTY)
58
59 WOLFSSL_API int wolfSSL_OCSP_resp_find_status(WOLFSSL_OCSP_BASICRESP *bs,
60 WOLFSSL_OCSP_CERTID *id, int *status, int *reason,
61 WOLFSSL_ASN1_TIME **revtime, WOLFSSL_ASN1_TIME
**thisupd,
62 WOLFSSL_ASN1_TIME **nextupd);

NetBurner, Inc.
22.209 ocsp.h 1261

63 WOLFSSL_API const char *wolfSSL_OCSP_cert_status_str(long s);


64 WOLFSSL_API int wolfSSL_OCSP_check_validity(WOLFSSL_ASN1_TIME* thisupd,
65 WOLFSSL_ASN1_TIME* nextupd, long sec, long maxsec);
66
67 WOLFSSL_API void wolfSSL_OCSP_CERTID_free(WOLFSSL_OCSP_CERTID* certId);
68 WOLFSSL_API WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_cert_to_id(
69 const WOLFSSL_EVP_MD *dgst, const WOLFSSL_X509 *subject,
70 const WOLFSSL_X509 *issuer);
71
72 WOLFSSL_API void wolfSSL_OCSP_BASICRESP_free(WOLFSSL_OCSP_BASICRESP* basicResponse);
73 WOLFSSL_API int wolfSSL_OCSP_basic_verify(WOLFSSL_OCSP_BASICRESP *bs,
74 WOLF_STACK_OF(WOLFSSL_X509) *certs, WOLFSSL_X509_STORE *st, unsigned long flags);
75
76 WOLFSSL_API void wolfSSL_OCSP_RESPONSE_free(OcspResponse* response);
77 #ifndef NO_BIO
78 WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE_bio(WOLFSSL_BIO* bio,
79 OcspResponse** response);
80 #endif
81 WOLFSSL_API OcspResponse* wolfSSL_d2i_OCSP_RESPONSE(OcspResponse** response,
82 const unsigned char** data, int len);
83 WOLFSSL_API int wolfSSL_i2d_OCSP_RESPONSE(OcspResponse* response,
84 unsigned char** data);
85 WOLFSSL_API int wolfSSL_OCSP_response_status(OcspResponse *response);
86 WOLFSSL_API const char *wolfSSL_OCSP_response_status_str(long s);
87 WOLFSSL_API WOLFSSL_OCSP_BASICRESP* wolfSSL_OCSP_response_get1_basic(
88 OcspResponse* response);
89
90 WOLFSSL_API OcspRequest* wolfSSL_OCSP_REQUEST_new(void);
91 WOLFSSL_API void wolfSSL_OCSP_REQUEST_free(OcspRequest* request);
92 WOLFSSL_API int wolfSSL_i2d_OCSP_REQUEST(OcspRequest* request,
93 unsigned char** data);
94 WOLFSSL_API WOLFSSL_OCSP_ONEREQ* wolfSSL_OCSP_request_add0_id(OcspRequest *req,
95 WOLFSSL_OCSP_CERTID *cid);
96 WOLFSSL_API WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_CERTID_dup(
97 WOLFSSL_OCSP_CERTID* id);
98 #ifndef NO_BIO
99 WOLFSSL_API int wolfSSL_i2d_OCSP_REQUEST_bio(WOLFSSL_BIO* out,
100 WOLFSSL_OCSP_REQUEST *req);
101 #endif
102
103 WOLFSSL_API int wolfSSL_i2d_OCSP_CERTID(WOLFSSL_OCSP_CERTID* id,
104 unsigned char** data);
105 WOLFSSL_API const WOLFSSL_OCSP_CERTID* wolfSSL_OCSP_SINGLERESP_get0_id(
106 const WOLFSSL_OCSP_SINGLERESP *single);
107 WOLFSSL_API int wolfSSL_OCSP_id_cmp(WOLFSSL_OCSP_CERTID *a, WOLFSSL_OCSP_CERTID *b);
108 WOLFSSL_API int wolfSSL_OCSP_single_get0_status(WOLFSSL_OCSP_SINGLERESP *single,
109 int *reason,
110 WOLFSSL_ASN1_TIME **revtime,
111 WOLFSSL_ASN1_TIME **thisupd,
112 WOLFSSL_ASN1_TIME **nextupd);
113 WOLFSSL_API int wolfSSL_OCSP_resp_count(WOLFSSL_OCSP_BASICRESP *bs);
114 WOLFSSL_API WOLFSSL_OCSP_SINGLERESP* wolfSSL_OCSP_resp_get0(
115 WOLFSSL_OCSP_BASICRESP *bs, int idx);
116
117 #endif
118 #ifdef OPENSSL_EXTRA
119 WOLFSSL_API int wolfSSL_OCSP_REQUEST_add_ext(OcspRequest* req,
120 WOLFSSL_X509_EXTENSION* ext, int idx);
121 WOLFSSL_API OcspResponse* wolfSSL_OCSP_response_create(int status,
122 WOLFSSL_OCSP_BASICRESP* bs);
123 WOLFSSL_API const char* wolfSSL_OCSP_crl_reason_str(long s);
124
125 WOLFSSL_API int wolfSSL_OCSP_id_get0_info(WOLFSSL_ASN1_STRING **name,
126 WOLFSSL_ASN1_OBJECT **pmd, WOLFSSL_ASN1_STRING **keyHash,
127 WOLFSSL_ASN1_INTEGER **serial, WOLFSSL_OCSP_CERTID *cid);
128
129 WOLFSSL_API int wolfSSL_OCSP_request_add1_nonce(OcspRequest* req,
130 unsigned char* val, int sz);
131 WOLFSSL_API int wolfSSL_OCSP_check_nonce(OcspRequest* req,
132 WOLFSSL_OCSP_BASICRESP* bs);
133 #endif
134
135
136 #ifdef __cplusplus
137 } /* extern "C" */
138 #endif
139
140
141 #endif /* HAVE_OCSP */
142 #endif /* WOLFSSL_OCSP_H */
143
144

NetBurner, Inc.
1262 File Documentation

22.210 openssl/ocsp.h
1 /* ocsp.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ocsp.h for libcurl */
13
14 #ifndef WOLFSSL_OCSP_H_
15 #define WOLFSSL_OCSP_H_
16
17 #ifdef HAVE_OCSP
18 #include <wolfssl/ocsp.h>
19
20 #define OCSP_REQUEST OcspRequest
21 #define OCSP_RESPONSE OcspResponse
22 #define OCSP_BASICRESP WOLFSSL_OCSP_BASICRESP
23 #define OCSP_SINGLERESP WOLFSSL_OCSP_SINGLERESP
24 #define OCSP_CERTID WOLFSSL_OCSP_CERTID
25 #define OCSP_ONEREQ WOLFSSL_OCSP_ONEREQ
26
27 #define OCSP_REVOKED_STATUS_NOSTATUS (-1)
28
29
30 #define OCSP_RESPONSE_STATUS_SUCCESSFUL 0
31 #define OCSP_RESPONSE_STATUS_TRYLATER 3
32
33 #define V_OCSP_CERTSTATUS_GOOD 0
34 #define V_OCSP_CERTSTATUS_REVOKED 1
35 #define V_OCSP_CERTSTATUS_UNKNOWN 2
36
37 #define OCSP_resp_find_status wolfSSL_OCSP_resp_find_status
38 #define OCSP_cert_status_str wolfSSL_OCSP_cert_status_str
39 #define OCSP_check_validity wolfSSL_OCSP_check_validity
40
41 #define OCSP_CERTID_free wolfSSL_OCSP_CERTID_free
42 #define OCSP_cert_to_id wolfSSL_OCSP_cert_to_id
43
44 #define OCSP_BASICRESP_free wolfSSL_OCSP_BASICRESP_free
45 #define OCSP_basic_verify wolfSSL_OCSP_basic_verify
46
47 #define OCSP_RESPONSE_free wolfSSL_OCSP_RESPONSE_free
48 #define d2i_OCSP_RESPONSE_bio wolfSSL_d2i_OCSP_RESPONSE_bio
49 #define d2i_OCSP_RESPONSE wolfSSL_d2i_OCSP_RESPONSE
50 #define i2d_OCSP_RESPONSE wolfSSL_i2d_OCSP_RESPONSE
51 #define OCSP_response_status wolfSSL_OCSP_response_status
52 #define OCSP_response_status_str wolfSSL_OCSP_response_status_str
53 #define OCSP_response_get1_basic wolfSSL_OCSP_response_get1_basic
54 #define OCSP_response_create wolfSSL_OCSP_response_create
55
56 #define OCSP_REQUEST_new wolfSSL_OCSP_REQUEST_new
57 #define OCSP_REQUEST_free wolfSSL_OCSP_REQUEST_free
58 #define i2d_OCSP_REQUEST wolfSSL_i2d_OCSP_REQUEST
59 #define OCSP_request_add0_id wolfSSL_OCSP_request_add0_id
60 #define OCSP_request_add1_nonce wolfSSL_OCSP_request_add1_nonce
61 #define OCSP_check_nonce wolfSSL_OCSP_check_nonce
62 #define OCSP_id_get0_info wolfSSL_OCSP_id_get0_info
63 #define OCSP_crl_reason_str wolfSSL_OCSP_crl_reason_str
64 #define OCSP_REQUEST_add_ext wolfSSL_OCSP_REQUEST_add_ext
65
66 #define OCSP_CERTID_dup wolfSSL_OCSP_CERTID_dup
67
68 #define i2d_OCSP_REQUEST_bio wolfSSL_i2d_OCSP_REQUEST_bio
69
70 #define i2d_OCSP_CERTID wolfSSL_i2d_OCSP_CERTID
71 #define OCSP_SINGLERESP_get0_id wolfSSL_OCSP_SINGLERESP_get0_id
72 #define OCSP_id_cmp wolfSSL_OCSP_id_cmp
73 #define OCSP_single_get0_status wolfSSL_OCSP_single_get0_status
74 #define OCSP_resp_count wolfSSL_OCSP_resp_count
75 #define OCSP_resp_get0 wolfSSL_OCSP_resp_get0
76
77 #endif /* HAVE_OCSP */
78
79 #endif /* WOLFSSL_OCSP_H_ */
80

NetBurner, Inc.
22.211 asn1.h 1263

22.211 asn1.h
1 /* asn1.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* asn1.h for openssl */
13
14 #ifndef WOLFSSL_ASN1_H_
15 #define WOLFSSL_ASN1_H_
16
17 #include <wolfssl/openssl/ssl.h>
18
19 #define ASN1_STRING_new wolfSSL_ASN1_STRING_new
20 #define ASN1_STRING_type_new wolfSSL_ASN1_STRING_type_new
21 #define ASN1_STRING_type wolfSSL_ASN1_STRING_type
22 #define ASN1_STRING_set wolfSSL_ASN1_STRING_set
23 #define ASN1_OCTET_STRING_set wolfSSL_ASN1_STRING_set
24 #define ASN1_STRING_free wolfSSL_ASN1_STRING_free
25
26 #define ASN1_get_object wolfSSL_ASN1_get_object
27 #define d2i_ASN1_OBJECT wolfSSL_d2i_ASN1_OBJECT
28 #define c2i_ASN1_OBJECT wolfSSL_c2i_ASN1_OBJECT
29
30 #define V_ASN1_INTEGER 0x02
31 #define V_ASN1_OCTET_STRING 0x04 /* tag for ASN1_OCTET_STRING */
32 #define V_ASN1_NEG 0x100
33 #define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
34 #define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
35
36 /* Type for ASN1_print_ex */
37 # define ASN1_STRFLGS_ESC_2253 1
38 # define ASN1_STRFLGS_ESC_CTRL 2
39 # define ASN1_STRFLGS_ESC_MSB 4
40 # define ASN1_STRFLGS_ESC_QUOTE 8
41 # define ASN1_STRFLGS_UTF8_CONVERT 0x10
42 # define ASN1_STRFLGS_IGNORE_TYPE 0x20
43 # define ASN1_STRFLGS_SHOW_TYPE 0x40
44 # define ASN1_STRFLGS_DUMP_ALL 0x80
45 # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
46 # define ASN1_STRFLGS_DUMP_DER 0x200
47 # define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
48 ASN1_STRFLGS_ESC_CTRL | \
49 ASN1_STRFLGS_ESC_MSB | \
50 ASN1_STRFLGS_UTF8_CONVERT | \
51 ASN1_STRFLGS_DUMP_UNKNOWN | \
52 ASN1_STRFLGS_DUMP_DER)
53
54 #define MBSTRING_UTF8 0x1000
55 #define MBSTRING_ASC 0x1001
56 #define MBSTRING_BMP 0x1002
57 #define MBSTRING_UNIV 0x1004
58
59 #define ASN1_UTCTIME_print wolfSSL_ASN1_UTCTIME_print
60 #define ASN1_TIME_check wolfSSL_ASN1_TIME_check
61 #define ASN1_TIME_diff wolfSSL_ASN1_TIME_diff
62 #define ASN1_TIME_compare wolfSSL_ASN1_TIME_compare
63 #define ASN1_TIME_set wolfSSL_ASN1_TIME_set
64
65 #define V_ASN1_EOC 0
66 #define V_ASN1_NULL 5
67 #define V_ASN1_OBJECT 6
68 #define V_ASN1_UTF8STRING 12
69 #define V_ASN1_SEQUENCE 16
70 #define V_ASN1_SET 17
71 #define V_ASN1_PRINTABLESTRING 19
72 #define V_ASN1_T61STRING 20
73 #define V_ASN1_IA5STRING 22
74 #define V_ASN1_UTCTIME 23
75 #define V_ASN1_GENERALIZEDTIME 24
76 #define V_ASN1_UNIVERSALSTRING 28
77 #define V_ASN1_BMPSTRING 30
78
79
80 #define V_ASN1_CONSTRUCTED 0x20
81
82 #define ASN1_STRING_FLAG_BITS_LEFT 0x008
83 #define ASN1_STRING_FLAG_NDEF 0x010
84 #define ASN1_STRING_FLAG_CONT 0x020
85 #define ASN1_STRING_FLAG_MSTRING 0x040

NetBurner, Inc.
1264 File Documentation

86 #define ASN1_STRING_FLAG_EMBED 0x080


87
88 /* X.509 PKI size limits from RFC2459 (appendix A) */
89 /* internally our limit is CTC_NAME_SIZE (64) - overriden with WC_CTC_NAME_SIZE */
90 #define ub_name CTC_NAME_SIZE /* 32768 */
91 #define ub_common_name CTC_NAME_SIZE /* 64 */
92 #define ub_locality_name CTC_NAME_SIZE /* 128 */
93 #define ub_state_name CTC_NAME_SIZE /* 128 */
94 #define ub_organization_name CTC_NAME_SIZE /* 64 */
95 #define ub_organization_unit_name CTC_NAME_SIZE /* 64 */
96 #define ub_title CTC_NAME_SIZE /* 64 */
97 #define ub_email_address CTC_NAME_SIZE /* 128 */
98
99
100 WOLFSSL_API WOLFSSL_ASN1_INTEGER *wolfSSL_BN_to_ASN1_INTEGER(
101 const WOLFSSL_BIGNUM *bn, WOLFSSL_ASN1_INTEGER *ai);
102
103 WOLFSSL_API void wolfSSL_ASN1_TYPE_set(WOLFSSL_ASN1_TYPE *a, int type, void *value);
104
105 WOLFSSL_API int wolfSSL_ASN1_get_object(const unsigned char **in, long *len, int *tag,
106 int *cls, long inLen);
107
108 WOLFSSL_API WOLFSSL_ASN1_OBJECT *wolfSSL_c2i_ASN1_OBJECT(WOLFSSL_ASN1_OBJECT **a,
109 const unsigned char **pp, long len);
110
111 #ifdef OPENSSL_ALL
112 /* IMPLEMENT_ASN1_FUNCTIONS is strictly for external use only. Internally
113 * we don’t use this. Some projects use OpenSSL to implement ASN1 types and
114 * this section is only to provide those projects with ASN1 functionality. */
115 typedef struct {
116 size_t offset; /* Offset of this field in structure */
117 byte type; /* The type of the member as defined in
118 * WOLFSSL_ASN1_TYPES */
119 } WOLFSSL_ASN1_TEMPLATE;
120
121 typedef struct {
122 byte type; /* One of the ASN_Tags types */
123 const WOLFSSL_ASN1_TEMPLATE *members; /* If SEQUENCE or CHOICE this
124 * contains the contents */
125 size_t mcount; /* Number of members if SEQUENCE
126 * or CHOICE */
127 size_t size; /* Structure size */
128 } WOLFSSL_ASN1_ITEM;
129
130 typedef enum {
131 WOLFSSL_X509_ALGOR_ASN1 = 0,
132 WOLFSSL_ASN1_BIT_STRING_ASN1,
133 } WOLFSSL_ASN1_TYPES;
134
135 #define ASN1_SEQUENCE(type) \
136 static const WOLFSSL_ASN1_TEMPLATE type##_member_data[]
137
138 #define ASN1_SIMPLE(type, member, member_type) \
139 { OFFSETOF(type, member), \
140 WOLFSSL_##member_type##_ASN1 }
141
142 #define ASN1_SEQUENCE_END(type) \
143 ; \
144 const WOLFSSL_ASN1_ITEM type##_template_data = { \
145 ASN_SEQUENCE, \
146 type##_member_data, \
147 sizeof(type##_member_data) / sizeof(WOLFSSL_ASN1_TEMPLATE), \
148 sizeof(type) \
149 };
150
151 WOLFSSL_API void *wolfSSL_ASN1_item_new(const WOLFSSL_ASN1_ITEM *tpl);
152 WOLFSSL_API void wolfSSL_ASN1_item_free(void *val, const WOLFSSL_ASN1_ITEM *tpl);
153 WOLFSSL_API int wolfSSL_ASN1_item_i2d(const void *src, byte **dest,
154 const WOLFSSL_ASN1_ITEM *tpl);
155
156 /* Need function declaration otherwise compiler complains */
157 /* // NOLINTBEGIN(readability-named-parameter) */
158 #define IMPLEMENT_ASN1_FUNCTIONS(type) \
159 type *type##_new(void); \
160 type *type##_new(void){ \
161 return (type*)wolfSSL_ASN1_item_new(&type##_template_data); \
162 } \
163 void type##_free(type *t); \
164 void type##_free(type *t){ \
165 wolfSSL_ASN1_item_free(t, &type##_template_data); \
166 } \
167 int i2d_##type(type *src, byte **dest); \
168 int i2d_##type(type *src, byte **dest) \
169 { \
170 return wolfSSL_ASN1_item_i2d(src, dest, &type##_template_data);\
171 }
172 /* // NOLINTEND(readability-named-parameter) */

NetBurner, Inc.
22.212 asn1t.h 1265

173
174 #endif /* OPENSSL_ALL */
175
176 #define BN_to_ASN1_INTEGER wolfSSL_BN_to_ASN1_INTEGER
177 #define ASN1_TYPE_set wolfSSL_ASN1_TYPE_set
178
179 #endif /* WOLFSSL_ASN1_H_ */

22.212 asn1t.h
1 /* asn1t.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* asn1t.h for openssl */
13
14 #ifndef WOLFSSL_ASN1T_H_
15 #define WOLFSSL_ASN1T_H_
16
17 #include <wolfssl/wolfcrypt/asn.h>
18 #include <wolfssl/openssl/asn1.h>
19
20 #endif /* WOLFSSL_ASN1T_H_ */

22.213 bio.h
1 /* bio.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* bio.h for openssl */
13
14
15 #ifndef WOLFSSL_BIO_H_
16 #define WOLFSSL_BIO_H_
17
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
24
25 #define BIO_FLAGS_BASE64_NO_NL WOLFSSL_BIO_FLAG_BASE64_NO_NL
26 #define BIO_FLAGS_READ WOLFSSL_BIO_FLAG_READ
27 #define BIO_FLAGS_WRITE WOLFSSL_BIO_FLAG_WRITE
28 #define BIO_FLAGS_IO_SPECIAL WOLFSSL_BIO_FLAG_IO_SPECIAL
29 #define BIO_FLAGS_SHOULD_RETRY WOLFSSL_BIO_FLAG_RETRY
30
31 #define BIO_new_fp wolfSSL_BIO_new_fp
32 #if defined(OPENSSL_ALL) \
33 || defined(HAVE_STUNNEL) \
34 || defined(HAVE_LIGHTY) \
35 || defined(WOLFSSL_MYSQL_COMPATIBLE) \
36 || defined(WOLFSSL_HAPROXY) \
37 || defined(OPENSSL_EXTRA)
38 #define BIO_new_file wolfSSL_BIO_new_file
39 #endif
40 #define BIO_new_fp wolfSSL_BIO_new_fp
41 #define BIO_ctrl wolfSSL_BIO_ctrl
42 #define BIO_ctrl_pending wolfSSL_BIO_ctrl_pending
43 #define BIO_wpending wolfSSL_BIO_wpending
44 #define BIO_get_mem_ptr wolfSSL_BIO_get_mem_ptr
45 #define BIO_int_ctrl wolfSSL_BIO_int_ctrl
46 #define BIO_reset wolfSSL_BIO_reset
47 #define BIO_s_file wolfSSL_BIO_s_file
48 #define BIO_s_bio wolfSSL_BIO_s_bio
49 #define BIO_s_socket wolfSSL_BIO_s_socket

NetBurner, Inc.
1266 File Documentation

50 #define BIO_s_accept wolfSSL_BIO_s_socket


51 #define BIO_set_fd wolfSSL_BIO_set_fd
52 #define BIO_set_close wolfSSL_BIO_set_close
53 #define BIO_ctrl_reset_read_request wolfSSL_BIO_ctrl_reset_read_request
54 #define BIO_set_write_buf_size wolfSSL_BIO_set_write_buf_size
55 #define BIO_make_bio_pair wolfSSL_BIO_make_bio_pair
56 #define BIO_up_ref wolfSSL_BIO_up_ref
57
58 #define BIO_new_fd wolfSSL_BIO_new_fd
59 #define BIO_set_fp wolfSSL_BIO_set_fp
60 #define BIO_get_fp wolfSSL_BIO_get_fp
61 #define BIO_seek wolfSSL_BIO_seek
62 #define BIO_tell wolfSSL_BIO_tell
63 #define BIO_write_filename wolfSSL_BIO_write_filename
64 #define BIO_set_mem_eof_return wolfSSL_BIO_set_mem_eof_return
65
66 #define BIO_find_type wolfSSL_BIO_find_type
67 #define BIO_next wolfSSL_BIO_next
68 #define BIO_gets wolfSSL_BIO_gets
69 #define BIO_puts wolfSSL_BIO_puts
70
71 #define BIO_should_retry wolfSSL_BIO_should_retry
72
73 #define BIO_TYPE_FILE WOLFSSL_BIO_FILE
74 #define BIO_TYPE_BIO WOLFSSL_BIO_BIO
75 #define BIO_TYPE_MEM WOLFSSL_BIO_MEMORY
76 #define BIO_TYPE_BASE64 WOLFSSL_BIO_BASE64
77
78 #define BIO_vprintf wolfSSL_BIO_vprintf
79 #define BIO_printf wolfSSL_BIO_printf
80 #define BIO_dump wolfSSL_BIO_dump
81
82 /* BIO info callback */
83 #define BIO_CB_FREE WOLFSSL_BIO_CB_FREE
84 #define BIO_CB_READ WOLFSSL_BIO_CB_READ
85 #define BIO_CB_WRITE WOLFSSL_BIO_CB_WRITE
86 #define BIO_CB_PUTS WOLFSSL_BIO_CB_PUTS
87 #define BIO_CB_GETS WOLFSSL_BIO_CB_GETS
88 #define BIO_CB_CTRL WOLFSSL_BIO_CB_CTRL
89 #define BIO_CB_RETURN WOLFSSL_BIO_CB_RETURN
90
91 #define BIO_set_callback wolfSSL_BIO_set_callback
92 #define BIO_get_callback wolfSSL_BIO_get_callback
93 #define BIO_set_callback_arg wolfSSL_BIO_set_callback_arg
94 #define BIO_get_callback_arg wolfSSL_BIO_get_callback_arg
95
96 /* BIO for 1.1.0 or later */
97 #define BIO_set_init wolfSSL_BIO_set_init
98 #define BIO_get_data wolfSSL_BIO_get_data
99 #define BIO_set_data wolfSSL_BIO_set_data
100 #define BIO_get_shutdown wolfSSL_BIO_get_shutdown
101 #define BIO_set_shutdown wolfSSL_BIO_set_shutdown
102
103 #define BIO_get_fd wolfSSL_BIO_get_fd
104
105 #define BIO_clear_flags wolfSSL_BIO_clear_flags
106 #define BIO_set_ex_data wolfSSL_BIO_set_ex_data
107 #define BIO_get_ex_data wolfSSL_BIO_get_ex_data
108
109 /* helper to set specific retry/read flags */
110 #define BIO_set_retry_read(bio)\
111 wolfSSL_BIO_set_flags((bio), WOLFSSL_BIO_FLAG_RETRY | WOLFSSL_BIO_FLAG_READ)
112 #define BIO_set_retry_write(bio)\
113 wolfSSL_BIO_set_flags((bio), WOLFSSL_BIO_FLAG_RETRY | WOLFSSL_BIO_FLAG_WRITE)
114
115 #define BIO_clear_retry_flags wolfSSL_BIO_clear_retry_flags
116
117 #define BIO_meth_new wolfSSL_BIO_meth_new
118 #define BIO_meth_set_write wolfSSL_BIO_meth_set_write
119 #define BIO_meth_free wolfSSL_BIO_meth_free
120 #define BIO_meth_set_write wolfSSL_BIO_meth_set_write
121 #define BIO_meth_set_read wolfSSL_BIO_meth_set_read
122 #define BIO_meth_set_puts wolfSSL_BIO_meth_set_puts
123 #define BIO_meth_set_gets wolfSSL_BIO_meth_set_gets
124 #define BIO_meth_set_ctrl wolfSSL_BIO_meth_set_ctrl
125 #define BIO_meth_set_create wolfSSL_BIO_meth_set_create
126 #define BIO_meth_set_destroy wolfSSL_BIO_meth_set_destroy
127
128 #define BIO_snprintf XSNPRINTF
129
130 /* BIO CTRL */
131 #define BIO_CTRL_RESET 1
132 #define BIO_CTRL_EOF 2
133 #define BIO_CTRL_INFO 3
134 #define BIO_CTRL_SET 4
135 #define BIO_CTRL_GET 5
136 #define BIO_CTRL_PUSH 6

NetBurner, Inc.
22.214 bn.h File Reference 1267

137 #define BIO_CTRL_POP 7


138 #define BIO_CTRL_GET_CLOSE 8
139 #define BIO_CTRL_SET_CLOSE 9
140 #define BIO_CTRL_PENDING 10
141 #define BIO_CTRL_FLUSH 11
142 #define BIO_CTRL_DUP 12
143 #define BIO_CTRL_WPENDING 13
144
145 #define BIO_C_SET_FILE_PTR 106
146 #define BIO_C_GET_FILE_PTR 107
147 #define BIO_C_SET_FILENAME 108
148 #define BIO_C_SET_BUF_MEM 114
149 #define BIO_C_GET_BUF_MEM_PTR 115
150 #define BIO_C_FILE_SEEK 128
151 #define BIO_C_SET_BUF_MEM_EOF_RETURN 130
152 #define BIO_C_SET_WRITE_BUF_SIZE 136
153 #define BIO_C_MAKE_BIO_PAIR 138
154
155 #define BIO_CTRL_DGRAM_QUERY_MTU 40
156
157 #define BIO_FP_TEXT 0x00
158 #define BIO_NOCLOSE 0x00
159 #define BIO_CLOSE 0x01
160
161 #define BIO_FP_WRITE 0x04
162
163 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
164
165
166 #ifdef __cplusplus
167 } /* extern "C" */
168 #endif
169
170 #endif /* WOLFSSL_BIO_H_ */

22.214 bn.h File Reference


bn.h for openssl
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/integer.h>

22.214.1 Detailed Description


bn.h for openssl

22.215 bn.h
Go to the documentation of this file.
1 /* bn.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* bn.h for openssl */
13
20 #ifndef WOLFSSL_BN_H_
21 #define WOLFSSL_BN_H_
22
23 #include <wolfssl/wolfcrypt/settings.h>
24 #include <wolfssl/wolfcrypt/integer.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 typedef struct WOLFSSL_BIGNUM {
31 int neg; /* openssh deference */
32 void *internal; /* our big num */
33 #if defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL)
34 sp_int fp;

NetBurner, Inc.
1268 File Documentation

35 #elif defined(USE_FAST_MATH) && !defined(HAVE_WOLF_BIGINT)


36 fp_int fp;
37 #endif
38 } WOLFSSL_BIGNUM;
39
40 #define WOLFSSL_BN_ULONG unsigned long
41 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
42 #define BN_ULONG WOLFSSL_BN_ULONG
43 #endif
44
45 typedef struct WOLFSSL_BN_CTX WOLFSSL_BN_CTX;
46 typedef struct WOLFSSL_BN_GENCB WOLFSSL_BN_GENCB;
47
48 WOLFSSL_API WOLFSSL_BN_CTX* wolfSSL_BN_CTX_new(void);
49 WOLFSSL_API void wolfSSL_BN_CTX_init(WOLFSSL_BN_CTX* ctx);
50 WOLFSSL_API void wolfSSL_BN_CTX_free(WOLFSSL_BN_CTX* ctx);
51
52 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_new(void);
53 #if defined(USE_FAST_MATH) && !defined(HAVE_WOLF_BIGINT)
54 WOLFSSL_API void wolfSSL_BN_init(WOLFSSL_BIGNUM* bn);
55 #endif
56 WOLFSSL_API void wolfSSL_BN_free(WOLFSSL_BIGNUM* bn);
57 WOLFSSL_API void wolfSSL_BN_clear_free(WOLFSSL_BIGNUM* bn);
58 WOLFSSL_API void wolfSSL_BN_clear(WOLFSSL_BIGNUM* bn);
59
60
61 WOLFSSL_API int wolfSSL_BN_sub(WOLFSSL_BIGNUM* r, const WOLFSSL_BIGNUM* a,
62 const WOLFSSL_BIGNUM* b);
63 WOLFSSL_API int wolfSSL_BN_mul(WOLFSSL_BIGNUM *r, WOLFSSL_BIGNUM *a,
64 WOLFSSL_BIGNUM *b, WOLFSSL_BN_CTX *ctx);
65 WOLFSSL_API int wolfSSL_BN_div(WOLFSSL_BIGNUM* dv, WOLFSSL_BIGNUM* rem,
66 const WOLFSSL_BIGNUM* a, const WOLFSSL_BIGNUM* d,
67 WOLFSSL_BN_CTX* ctx);
68 #if defined(WOLFSSL_KEY_GEN) && !defined(NO_RSA)
69 WOLFSSL_API int wolfSSL_BN_gcd(WOLFSSL_BIGNUM* r, WOLFSSL_BIGNUM* a,
70 WOLFSSL_BIGNUM* b, WOLFSSL_BN_CTX* ctx);
71 #endif
72 WOLFSSL_API int wolfSSL_BN_mod(WOLFSSL_BIGNUM* r, const WOLFSSL_BIGNUM* a,
73 const WOLFSSL_BIGNUM* b, const WOLFSSL_BN_CTX* c);
74 WOLFSSL_API int wolfSSL_BN_mod_exp(WOLFSSL_BIGNUM *r, const WOLFSSL_BIGNUM *a,
75 const WOLFSSL_BIGNUM *p, const WOLFSSL_BIGNUM *m, WOLFSSL_BN_CTX *ctx);
76 WOLFSSL_API int wolfSSL_BN_mod_mul(WOLFSSL_BIGNUM *r, const WOLFSSL_BIGNUM *a,
77 const WOLFSSL_BIGNUM *p, const WOLFSSL_BIGNUM *m, WOLFSSL_BN_CTX *ctx);
78 WOLFSSL_API const WOLFSSL_BIGNUM* wolfSSL_BN_value_one(void);
79
80
81 WOLFSSL_API int wolfSSL_BN_num_bytes(const WOLFSSL_BIGNUM* bn);
82 WOLFSSL_API int wolfSSL_BN_num_bits(const WOLFSSL_BIGNUM* bn);
83
84 WOLFSSL_API void wolfSSL_BN_zero(WOLFSSL_BIGNUM* bn);
85 WOLFSSL_API int wolfSSL_BN_one(WOLFSSL_BIGNUM* bn);
86 WOLFSSL_API int wolfSSL_BN_is_zero(const WOLFSSL_BIGNUM* bn);
87 WOLFSSL_API int wolfSSL_BN_is_one(const WOLFSSL_BIGNUM* bn);
88 WOLFSSL_API int wolfSSL_BN_is_odd(const WOLFSSL_BIGNUM* bn);
89 WOLFSSL_API int wolfSSL_BN_is_negative(const WOLFSSL_BIGNUM* bn);
90 WOLFSSL_API int wolfSSL_BN_is_word(const WOLFSSL_BIGNUM* bn, WOLFSSL_BN_ULONG w);
91
92 WOLFSSL_API int wolfSSL_BN_cmp(const WOLFSSL_BIGNUM* a, const WOLFSSL_BIGNUM* b);
93
94 WOLFSSL_API int wolfSSL_BN_bn2bin(const WOLFSSL_BIGNUM* bn, unsigned char* r);
95 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_bin2bn(const unsigned char* str, int len,
96 WOLFSSL_BIGNUM* ret);
97
98 WOLFSSL_API int wolfSSL_mask_bits(WOLFSSL_BIGNUM* bn, int n);
99
100 WOLFSSL_API int wolfSSL_BN_pseudo_rand(WOLFSSL_BIGNUM* bn, int bits, int top,
101 int bottom);
102 WOLFSSL_API int wolfSSL_BN_rand_range(WOLFSSL_BIGNUM *r, const WOLFSSL_BIGNUM *range);
103 WOLFSSL_API int wolfSSL_BN_rand(WOLFSSL_BIGNUM* bn, int bits, int top, int bottom);
104 WOLFSSL_API int wolfSSL_BN_is_bit_set(const WOLFSSL_BIGNUM* bn, int n);
105 WOLFSSL_API int wolfSSL_BN_hex2bn(WOLFSSL_BIGNUM** bn, const char* str);
106
107 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_dup(const WOLFSSL_BIGNUM* bn);
108 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_BN_copy(WOLFSSL_BIGNUM* r,
109 const WOLFSSL_BIGNUM* bn);
110
111 WOLFSSL_API int wolfSSL_BN_dec2bn(WOLFSSL_BIGNUM** bn, const char* str);
112 WOLFSSL_API char* wolfSSL_BN_bn2dec(const WOLFSSL_BIGNUM* bn);
113
114 WOLFSSL_API int wolfSSL_BN_lshift(WOLFSSL_BIGNUM* r, const WOLFSSL_BIGNUM* bn,
115 int n);
116 WOLFSSL_API int wolfSSL_BN_add_word(WOLFSSL_BIGNUM* bn, WOLFSSL_BN_ULONG w);
117 WOLFSSL_API int wolfSSL_BN_sub_word(WOLFSSL_BIGNUM* bn, WOLFSSL_BN_ULONG w);
118 WOLFSSL_API int wolfSSL_BN_set_bit(WOLFSSL_BIGNUM* bn, int n);
119 WOLFSSL_API int wolfSSL_BN_clear_bit(WOLFSSL_BIGNUM* bn, int n);
120 WOLFSSL_API int wolfSSL_BN_set_word(WOLFSSL_BIGNUM* bn, WOLFSSL_BN_ULONG w);
121 WOLFSSL_API WOLFSSL_BN_ULONG wolfSSL_BN_get_word(const WOLFSSL_BIGNUM* bn);

NetBurner, Inc.
22.215 bn.h 1269

122
123 WOLFSSL_API int wolfSSL_BN_add(WOLFSSL_BIGNUM* r, WOLFSSL_BIGNUM* a,
124 WOLFSSL_BIGNUM* b);
125 WOLFSSL_API int wolfSSL_BN_mod_add(WOLFSSL_BIGNUM *r, const WOLFSSL_BIGNUM *a,
126 const WOLFSSL_BIGNUM *b, const WOLFSSL_BIGNUM *m,
127 WOLFSSL_BN_CTX *ctx);
128 WOLFSSL_API char *wolfSSL_BN_bn2hex(const WOLFSSL_BIGNUM* bn);
129 #if defined(WOLFSSL_KEY_GEN) && (!defined(NO_RSA) || !defined(NO_DH) || !defined(NO_DSA))
130 WOLFSSL_API int wolfSSL_BN_generate_prime_ex(
131 WOLFSSL_BIGNUM* prime, int bits, int safe, const WOLFSSL_BIGNUM* add,
132 const WOLFSSL_BIGNUM* rem, WOLFSSL_BN_GENCB* cb);
133 WOLFSSL_API int wolfSSL_BN_is_prime_ex(const WOLFSSL_BIGNUM *bn, int nbchecks,
134 WOLFSSL_BN_CTX *ctx, WOLFSSL_BN_GENCB *cb);
135 WOLFSSL_API WOLFSSL_BN_ULONG wolfSSL_BN_mod_word(const WOLFSSL_BIGNUM *bn,
136 WOLFSSL_BN_ULONG w);
137 #endif
138 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
139 WOLFSSL_API int wolfSSL_BN_print_fp(XFILE fp, const WOLFSSL_BIGNUM *bn);
140 #endif
141 WOLFSSL_API int wolfSSL_BN_rshift(WOLFSSL_BIGNUM *r, const WOLFSSL_BIGNUM *bn,
142 int n);
143 WOLFSSL_API WOLFSSL_BIGNUM *wolfSSL_BN_CTX_get(WOLFSSL_BN_CTX *ctx);
144 WOLFSSL_API void wolfSSL_BN_CTX_start(WOLFSSL_BN_CTX *ctx);
145 WOLFSSL_API WOLFSSL_BIGNUM *wolfSSL_BN_mod_inverse(
146 WOLFSSL_BIGNUM *r,
147 WOLFSSL_BIGNUM *a,
148 const WOLFSSL_BIGNUM *n,
149 WOLFSSL_BN_CTX *ctx);
150
151
152 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
153
154 typedef WOLFSSL_BIGNUM BIGNUM;
155 typedef WOLFSSL_BN_CTX BN_CTX;
156 typedef WOLFSSL_BN_GENCB BN_GENCB;
157
158 #define BN_CTX_new wolfSSL_BN_CTX_new
159 #define BN_CTX_init wolfSSL_BN_CTX_init
160 #define BN_CTX_free wolfSSL_BN_CTX_free
161
162 #define BN_new wolfSSL_BN_new
163 #define BN_init wolfSSL_BN_init
164 #define BN_free wolfSSL_BN_free
165 #define BN_clear_free wolfSSL_BN_clear_free
166 #define BN_clear wolfSSL_BN_clear
167
168 #define BN_num_bytes wolfSSL_BN_num_bytes
169 #define BN_num_bits wolfSSL_BN_num_bits
170
171 #define BN_zero wolfSSL_BN_zero
172 #define BN_one wolfSSL_BN_one
173 #define BN_is_zero wolfSSL_BN_is_zero
174 #define BN_is_one wolfSSL_BN_is_one
175 #define BN_is_odd wolfSSL_BN_is_odd
176 #define BN_is_negative wolfSSL_BN_is_negative
177 #define BN_is_word wolfSSL_BN_is_word
178
179 #define BN_cmp wolfSSL_BN_cmp
180
181 #define BN_bn2bin wolfSSL_BN_bn2bin
182 #define BN_bin2bn wolfSSL_BN_bin2bn
183
184 #define BN_mod wolfSSL_BN_mod
185 #define BN_mod_exp wolfSSL_BN_mod_exp
186 #define BN_mod_mul wolfSSL_BN_mod_mul
187 #define BN_sub wolfSSL_BN_sub
188 #define BN_mul wolfSSL_BN_mul
189 #define BN_div wolfSSL_BN_div
190 #define BN_gcd wolfSSL_BN_gcd
191 #define BN_value_one wolfSSL_BN_value_one
192
193 #define BN_mask_bits wolfSSL_mask_bits
194
195 #define BN_pseudo_rand wolfSSL_BN_pseudo_rand
196 #define BN_rand wolfSSL_BN_rand
197 #define BN_rand_range wolfSSL_BN_rand_range
198 #define BN_is_bit_set wolfSSL_BN_is_bit_set
199 #define BN_hex2bn wolfSSL_BN_hex2bn
200
201 #define BN_dup wolfSSL_BN_dup
202 #define BN_copy wolfSSL_BN_copy
203
204 #define BN_get_word wolfSSL_BN_get_word
205 #define BN_set_word wolfSSL_BN_set_word
206
207 #define BN_dec2bn wolfSSL_BN_dec2bn
208 #define BN_bn2dec wolfSSL_BN_bn2dec

NetBurner, Inc.
1270 File Documentation

209 #define BN_bn2hex wolfSSL_BN_bn2hex


210
211 #define BN_lshift wolfSSL_BN_lshift
212 #define BN_add_word wolfSSL_BN_add_word
213 #define BN_sub_word wolfSSL_BN_sub_word
214 #define BN_add wolfSSL_BN_add
215 #define BN_mod_add wolfSSL_BN_mod_add
216 #define BN_set_word wolfSSL_BN_set_word
217 #define BN_set_bit wolfSSL_BN_set_bit
218 #define BN_clear_bit wolfSSL_BN_clear_bit
219
220 #define BN_generate_prime_ex wolfSSL_BN_generate_prime_ex
221 #define BN_is_prime_ex wolfSSL_BN_is_prime_ex
222 #define BN_print_fp wolfSSL_BN_print_fp
223 #define BN_rshift wolfSSL_BN_rshift
224 #define BN_rshift1(r, a) wolfSSL_BN_rshift((r), (a), 1)
225 #define BN_mod_word wolfSSL_BN_mod_word
226
227 #define BN_CTX_get wolfSSL_BN_CTX_get
228 #define BN_CTX_start wolfSSL_BN_CTX_start
229
230 #define BN_mod_inverse wolfSSL_BN_mod_inverse
231
232 #define BN_set_flags(x1, x2)
233
234 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
235 #define BN_get_rfc2409_prime_768 wolfSSL_DH_768_prime
236 #define BN_get_rfc2409_prime_1024 wolfSSL_DH_1024_prime
237 #define BN_get_rfc3526_prime_1536 wolfSSL_DH_1536_prime
238 #define BN_get_rfc3526_prime_2048 wolfSSL_DH_2048_prime
239 #define BN_get_rfc3526_prime_3072 wolfSSL_DH_3072_prime
240 #define BN_get_rfc3526_prime_4096 wolfSSL_DH_4096_prime
241 #define BN_get_rfc3526_prime_6144 wolfSSL_DH_6144_prime
242 #define BN_get_rfc3526_prime_8192 wolfSSL_DH_8192_prime
243 #endif
244
245 #define BN_prime_checks 0
246
247 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
248
249
250 #ifdef __cplusplus
251 } /* extern "C" */
252 #endif
253
254
255 #endif /* WOLFSSL__H_ */

22.216 buffer.h
1 /* buffer.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLFSSL_BUFFER_H_
14 #define WOLFSSL_BUFFER_H_
15
16 #include <wolfssl/wolfcrypt/settings.h>
17 #include <wolfssl/openssl/ssl.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23
24 WOLFSSL_API WOLFSSL_BUF_MEM* wolfSSL_BUF_MEM_new(void);
25 WOLFSSL_API int wolfSSL_BUF_MEM_grow(WOLFSSL_BUF_MEM* buf, size_t len);
26 WOLFSSL_API int wolfSSL_BUF_MEM_grow_ex(WOLFSSL_BUF_MEM* buf, size_t len,
27 char zeroFill);
28 WOLFSSL_API int wolfSSL_BUF_MEM_resize(WOLFSSL_BUF_MEM* buf, size_t len);
29 WOLFSSL_API void wolfSSL_BUF_MEM_free(WOLFSSL_BUF_MEM* buf);
30
31
32 #define BUF_MEM_new wolfSSL_BUF_MEM_new
33 #define BUF_MEM_grow wolfSSL_BUF_MEM_grow
34 #define BUF_MEM_free wolfSSL_BUF_MEM_free
35

NetBurner, Inc.
22.217 openssl/camellia.h 1271

36 #define BUF_strdup strdup


37 #define BUF_strlcpy wc_strlcpy
38 #define BUF_strlcat wc_strlcat
39
40 #ifdef __cplusplus
41 } /* extern "C" */
42 #endif
43
44 #endif /* WOLFSSL_BUFFER_H_ */

22.217 openssl/camellia.h
1 /* camellia.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_CAMELLIA_H_
13 #define WOLFSSL_CAMELLIA_H_
14
15 #include <wolfssl/wolfcrypt/camellia.h>
16
17 #endif /* WOLFSSL_CAMELLIA_H_ */

22.218 camellia.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.219 wolfcrypt/camellia.h
Go to the documentation of this file.
1 /* camellia.h ver 1.2.0
2 *
3 * Copyright (c) 2006,2007
4 * NTT (Nippon Telegraph and Telephone Corporation) . All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer as
11 * the first lines of this file unmodified.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY NTT “AS IS” AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL NTT BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28 /* camellia.h
29 *
30 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
31 *
32 * This file is part of wolfSSL.
33 *
34 * Contact [email protected] with any questions or comments.
35 *
36 * https://www.wolfssl.com
37 */
38
44 #ifndef WOLF_CRYPT_CAMELLIA_H
45 #define WOLF_CRYPT_CAMELLIA_H

NetBurner, Inc.
1272 File Documentation

46
47 #include <wolfssl/wolfcrypt/types.h>
48
49 #ifdef HAVE_CAMELLIA
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 enum {
56 CAMELLIA_BLOCK_SIZE = 16
57 };
58
59 #define CAMELLIA_TABLE_BYTE_LEN 272
60 #define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / sizeof(word32))
61
62 typedef word32 KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN];
63
64 typedef struct Camellia {
65 word32 keySz;
66 KEY_TABLE_TYPE key;
67 word32 reg[CAMELLIA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
68 word32 tmp[CAMELLIA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
69 } Camellia;
70
71
72 WOLFSSL_API int wc_CamelliaSetKey(Camellia* cam,
73 const byte* key, word32 len, const byte* iv);
74 WOLFSSL_API int wc_CamelliaSetIV(Camellia* cam, const byte* iv);
75 WOLFSSL_API int wc_CamelliaEncryptDirect(Camellia* cam, byte* out,
76 const byte* in);
77 WOLFSSL_API int wc_CamelliaDecryptDirect(Camellia* cam, byte* out,
78 const byte* in);
79 WOLFSSL_API int wc_CamelliaCbcEncrypt(Camellia* cam,
80 byte* out, const byte* in, word32 sz);
81 WOLFSSL_API int wc_CamelliaCbcDecrypt(Camellia* cam,
82 byte* out, const byte* in, word32 sz);
83
84
85 #ifdef __cplusplus
86 } /* extern "C" */
87 #endif
88
89 #endif /* HAVE_CAMELLIA */
90 #endif /* WOLF_CRYPT_CAMELLIA_H */
91

22.220 openssl/cmac.h
1 /* cmac.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_CMAC_H_
13 #define WOLFSSL_CMAC_H_
14
15 #include <wolfssl/wolfcrypt/cmac.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 typedef struct WOLFSSL_CMAC_CTX {
22 void* internal; /* internal Cmac object */
23 WOLFSSL_EVP_CIPHER_CTX* cctx;
24 } WOLFSSL_CMAC_CTX;
25
26 typedef WOLFSSL_CMAC_CTX CMAC_CTX;
27
28 WOLFSSL_API WOLFSSL_CMAC_CTX* wolfSSL_CMAC_CTX_new(void);
29 WOLFSSL_API void wolfSSL_CMAC_CTX_free(WOLFSSL_CMAC_CTX *ctx);
30 WOLFSSL_API WOLFSSL_EVP_CIPHER_CTX* wolfSSL_CMAC_CTX_get0_cipher_ctx(
31 WOLFSSL_CMAC_CTX* ctx);
32 WOLFSSL_API int wolfSSL_CMAC_Init(
33 WOLFSSL_CMAC_CTX* ctx, const void *key, size_t keyLen,
34 const WOLFSSL_EVP_CIPHER* cipher, WOLFSSL_ENGINE* engine);
35 WOLFSSL_API int wolfSSL_CMAC_Update(
36 WOLFSSL_CMAC_CTX* ctx, const void* data, size_t len);

NetBurner, Inc.
22.221 wolfcrypt/cmac.h 1273

37 WOLFSSL_API int wolfSSL_CMAC_Final(


38 WOLFSSL_CMAC_CTX* ctx, unsigned char* out, size_t* len);
39
40 #define CMAC_CTX_new wolfSSL_CMAC_CTX_new
41 #define CMAC_CTX_free wolfSSL_CMAC_CTX_free
42 #define CMAC_CTX_get0_cipher_ctx wolfSSL_CMAC_CTX_get0_cipher_ctx
43 #define CMAC_Init wolfSSL_CMAC_Init
44 #define CMAC_Update wolfSSL_CMAC_Update
45 #define CMAC_Final wolfSSL_CMAC_Final
46
47 #ifdef __cplusplus
48 } /* extern "C" */
49 #endif
50
51 #endif /* WOLFSSL_CMAC_H_ */

22.221 wolfcrypt/cmac.h
1 /* cmac.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLF_CRYPT_CMAC_H
14 #define WOLF_CRYPT_CMAC_H
15
16 #include <wolfssl/wolfcrypt/types.h>
17 #include <wolfssl/wolfcrypt/aes.h>
18
19 #if !defined(NO_AES) && defined(WOLFSSL_CMAC)
20
21 #if defined(HAVE_FIPS) && \
22 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
23 #include <wolfssl/wolfcrypt/fips.h>
24 #endif /* HAVE_FIPS_VERSION >= 2 */
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /* avoid redefinition of structs */
31 #if !defined(HAVE_FIPS) || \
32 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
33
34 #ifndef WC_CMAC_TYPE_DEFINED
35 typedef struct Cmac Cmac;
36 #define WC_CMAC_TYPE_DEFINED
37 #endif
38 struct Cmac {
39 Aes aes;
40 byte buffer[AES_BLOCK_SIZE]; /* partially stored block */
41 byte digest[AES_BLOCK_SIZE]; /* running digest */
42 byte k1[AES_BLOCK_SIZE];
43 byte k2[AES_BLOCK_SIZE];
44 word32 bufferSz;
45 word32 totalSz;
46 #ifdef WOLF_CRYPTO_CB
47 int devId;
48 void* devCtx;
49 #ifdef WOLFSSL_CAAM
50 byte ctx[32]; /* hold state for save and return */
51 word32 blackKey;
52 word32 keylen;
53 byte initialized;
54 #endif
55 #endif
56 #if defined(WOLFSSL_HASH_KEEP)
57 byte* msg;
58 word32 used;
59 word32 len;
60 #endif
61 };
62
63
64
65 typedef enum CmacType {
66 WC_CMAC_AES = 1
67 } CmacType;

NetBurner, Inc.
1274 File Documentation

68
69 #define WC_CMAC_TAG_MAX_SZ AES_BLOCK_SIZE
70 #define WC_CMAC_TAG_MIN_SZ (AES_BLOCK_SIZE/4)
71
72 #endif /* HAVE_FIPS */
73
74 WOLFSSL_API
75 int wc_InitCmac(Cmac* cmac,
76 const byte* key, word32 keySz,
77 int type, void* unused);
78
79 WOLFSSL_API
80 int wc_InitCmac_ex(Cmac* cmac,
81 const byte* key, word32 keySz,
82 int type, void* unused, void* heap, int devId);
83
84 WOLFSSL_API
85 int wc_CmacUpdate(Cmac* cmac,
86 const byte* in, word32 inSz);
87 WOLFSSL_API
88 int wc_CmacFinal(Cmac* cmac,
89 byte* out, word32* outSz);
90
91 WOLFSSL_API
92 int wc_AesCmacGenerate(byte* out, word32* outSz,
93 const byte* in, word32 inSz,
94 const byte* key, word32 keySz);
95
96 WOLFSSL_API
97 int wc_AesCmacVerify(const byte* check, word32 checkSz,
98 const byte* in, word32 inSz,
99 const byte* key, word32 keySz);
100
101 WOLFSSL_LOCAL
102 void ShiftAndXorRb(byte* out, byte* in);
103
104 #ifdef WOLFSSL_HASH_KEEP
105 WOLFSSL_API
106 int wc_CMAC_Grow(Cmac* cmac, const byte* in, int inSz);
107 #endif
108
109 #ifdef __cplusplus
110 } /* extern "C" */
111 #endif
112
113
114 #endif /* NO_AES && WOLFSSL_CMAC */
115 #endif /* WOLF_CRYPT_CMAC_H */
116

22.222 cms.h
1 /* cms.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_CMS_H_
13 #define WOLFSSL_CMS_H_
14
15
16 #endif /* WOLFSSL_CMS_H_ */

22.223 compat_types.h
1 /* compat_types.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11

NetBurner, Inc.
22.224 conf.h 1275

12 /*
13 * Move types that cause cyclical dependency errors here.
14 */
15
16 #ifndef WOLFSSL_OPENSSL_COMPAT_TYPES_H_
17 #define WOLFSSL_OPENSSL_COMPAT_TYPES_H_
18
19 #include <wolfssl/wolfcrypt/settings.h>
20 #include <wolfssl/wolfcrypt/types.h>
21 #include <wolfssl/wolfcrypt/hmac.h>
22
23 #ifndef NO_HMAC
24 typedef struct WOLFSSL_HMAC_CTX {
25 Hmac hmac;
26 int type;
27 word32 save_ipad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/
28 word32 save_opad[WC_HMAC_BLOCK_SIZE / sizeof(word32)];
29 } WOLFSSL_HMAC_CTX;
30 #endif
31
32 typedef char WOLFSSL_EVP_MD;
33 typedef char WOLFSSL_EVP_CIPHER;
34 typedef int WOLFSSL_ENGINE;
35
36 typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY;
37 typedef struct WOLFSSL_EVP_MD_CTX WOLFSSL_EVP_MD_CTX;
38 typedef struct WOLFSSL_EVP_PKEY WOLFSSL_PKCS8_PRIV_KEY_INFO;
39 typedef struct WOLFSSL_EVP_PKEY_CTX WOLFSSL_EVP_PKEY_CTX;
40 typedef struct WOLFSSL_EVP_CIPHER_CTX WOLFSSL_EVP_CIPHER_CTX;
41 typedef struct WOLFSSL_ASN1_PCTX WOLFSSL_ASN1_PCTX;
42
43 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
44 typedef WOLFSSL_EVP_MD EVP_MD;
45 typedef WOLFSSL_EVP_MD_CTX EVP_MD_CTX;
46 typedef WOLFSSL_EVP_CIPHER EVP_CIPHER;
47 typedef WOLFSSL_EVP_CIPHER_CTX EVP_CIPHER_CTX;
48 typedef WOLFSSL_ASN1_PCTX ASN1_PCTX;
49 typedef WOLFSSL_EVP_PKEY EVP_PKEY;
50 typedef WOLFSSL_EVP_PKEY PKCS8_PRIV_KEY_INFO;
51
52 typedef WOLFSSL_ENGINE ENGINE;
53 typedef WOLFSSL_EVP_PKEY_CTX EVP_PKEY_CTX;
54 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
55
56 #endif /* !WOLFSSL_OPENSSL_COMPAT_TYPES_H_ */

22.224 conf.h
1 /* conf.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* conf.h for openSSL */
13
14 #ifndef WOLFSSL_conf_H_
15 #define WOLFSSL_conf_H_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 #include <wolfssl/wolfcrypt/settings.h>
22 #include <wolfssl/version.h>
23
24 typedef struct WOLFSSL_CONF_VALUE {
25 char *section;
26 char *name;
27 char *value;
28 } WOLFSSL_CONF_VALUE;
29
30 /* ssl.h requires WOLFSSL_CONF_VALUE */
31 #include <wolfssl/ssl.h>
32
33 typedef struct WOLFSSL_CONF {
34 void *meth_data;
35 WOLF_LHASH_OF(WOLFSSL_CONF_VALUE) *data;
36 } WOLFSSL_CONF;
37

NetBurner, Inc.
1276 File Documentation

38 typedef WOLFSSL_CONF CONF;


39 typedef WOLFSSL_CONF_VALUE CONF_VALUE;
40
41 #ifdef OPENSSL_EXTRA
42
43 WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_CONF_VALUE_new(void);
44 WOLFSSL_API int wolfSSL_CONF_add_string(WOLFSSL_CONF *conf,
45 WOLFSSL_CONF_VALUE *section, WOLFSSL_CONF_VALUE *value);
46 WOLFSSL_API void wolfSSL_X509V3_conf_free(WOLFSSL_CONF_VALUE *val);
47
48 WOLFSSL_API WOLFSSL_CONF *wolfSSL_NCONF_new(void *meth);
49 WOLFSSL_API char *wolfSSL_NCONF_get_string(const WOLFSSL_CONF *conf,
50 const char *group, const char *name);
51 WOLFSSL_API int wolfSSL_NCONF_get_number(const CONF *conf, const char *group,
52 const char *name, long *result);
53 WOLFSSL_API WOLFSSL_STACK *wolfSSL_NCONF_get_section(
54 const WOLFSSL_CONF *conf, const char *section);
55 WOLFSSL_API int wolfSSL_NCONF_load(WOLFSSL_CONF *conf, const char *file, long *eline);
56 WOLFSSL_API void wolfSSL_NCONF_free(WOLFSSL_CONF *conf);
57
58 WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_lh_WOLFSSL_CONF_VALUE_retrieve(
59 WOLF_LHASH_OF(WOLFSSL_CONF_VALUE) *sk, WOLFSSL_CONF_VALUE *data);
60
61 WOLFSSL_API int wolfSSL_CONF_modules_load(const WOLFSSL_CONF *cnf, const char *appname,
62 unsigned long flags);
63 WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_CONF_new_section(WOLFSSL_CONF *conf,
64 const char *section);
65 WOLFSSL_API WOLFSSL_CONF_VALUE *wolfSSL_CONF_get_section(WOLFSSL_CONF *conf,
66 const char *section);
67
68 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509V3_EXT_nconf_nid(WOLFSSL_CONF* conf,
69 WOLFSSL_X509V3_CTX *ctx, int nid, const char *value);
70 WOLFSSL_API WOLFSSL_X509_EXTENSION* wolfSSL_X509V3_EXT_nconf(WOLFSSL_CONF *conf,
71 WOLFSSL_X509V3_CTX *ctx, const char *sName, const char *value);
72
73 #define sk_CONF_VALUE_new wolfSSL_sk_CONF_VALUE_new
74 #define sk_CONF_VALUE_free wolfSSL_sk_CONF_VALUE_free
75 #define sk_CONF_VALUE_pop_free(a,b) wolfSSL_sk_CONF_VALUE_free(a)
76 #define sk_CONF_VALUE_num wolfSSL_sk_CONF_VALUE_num
77 #define sk_CONF_VALUE_value wolfSSL_sk_CONF_VALUE_value
78
79 #define lh_CONF_VALUE_retrieve wolfSSL_lh_WOLFSSL_CONF_VALUE_retrieve
80 #define lh_CONF_VALUE_insert wolfSSL_sk_CONF_VALUE_push
81
82 #define NCONF_new wolfSSL_NCONF_new
83 #define NCONF_free wolfSSL_NCONF_free
84 #define NCONF_get_string wolfSSL_NCONF_get_string
85 #define NCONF_get_section wolfSSL_NCONF_get_section
86 #define NCONF_get_number wolfSSL_NCONF_get_number
87 #define NCONF_load wolfSSL_NCONF_load
88
89 #define CONF_modules_load wolfSSL_CONF_modules_load
90 #define _CONF_new_section wolfSSL_CONF_new_section
91 #define _CONF_get_section wolfSSL_CONF_get_section
92
93 #define X509V3_EXT_nconf_nid wolfSSL_X509V3_EXT_nconf_nid
94 #define X509V3_EXT_nconf wolfSSL_X509V3_EXT_nconf
95 #define X509V3_conf_free wolfSSL_X509V3_conf_free
96
97 #endif /* OPENSSL_EXTRA */
98
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102
103 #endif /* WOLFSSL_conf_H_ */

22.225 crypto.h
1 /* crypto.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* crypto.h for openSSL */
13
14 #ifndef WOLFSSL_CRYPTO_H_
15 #define WOLFSSL_CRYPTO_H_
16

NetBurner, Inc.
22.225 crypto.h 1277

17 #include <wolfssl/wolfcrypt/settings.h>
18
19 typedef struct WOLFSSL_INIT_SETTINGS {
20 char* appname;
21 } WOLFSSL_INIT_SETTINGS;
22 typedef WOLFSSL_INIT_SETTINGS OPENSSL_INIT_SETTINGS;
23
24 typedef struct WOLFSSL_CRYPTO_THREADID {
25 int dummy;
26 } WOLFSSL_CRYPTO_THREADID;
27 typedef struct crypto_threadid_st CRYPTO_THREADID;
28
29 typedef struct CRYPTO_EX_DATA CRYPTO_EX_DATA;
30 typedef void (CRYPTO_free_func)(void* parent, void* ptr, CRYPTO_EX_DATA* ad, int idx,
31 long argl, void* argp);
32
33 #include <wolfssl/openssl/opensslv.h>
34 #include <wolfssl/openssl/conf.h>
35
36 #ifdef WOLFSSL_PREFIX
37 #include "prefix_crypto.h"
38 #endif
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 WOLFSSL_API const char* wolfSSLeay_version(int type);
45 WOLFSSL_API unsigned long wolfSSLeay(void);
46 WOLFSSL_API unsigned long wolfSSL_OpenSSL_version_num(void);
47
48 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
49 WOLFSSL_API void wolfSSL_OPENSSL_free(void* p);
50 #endif
51
52 #ifdef OPENSSL_EXTRA
53 WOLFSSL_API void *wolfSSL_OPENSSL_malloc(size_t a);
54 WOLFSSL_API int wolfSSL_OPENSSL_hexchar2int(unsigned char c);
55 WOLFSSL_API unsigned char *wolfSSL_OPENSSL_hexstr2buf(const char *str, long *len);
56
57 WOLFSSL_API int wolfSSL_OPENSSL_init_crypto(word64 opts, const OPENSSL_INIT_SETTINGS *settings);
58 #endif
59
60 /* class index for wolfSSL_CRYPTO_get_ex_new_index */
61 #define CRYPTO_EX_INDEX_SSL WOLF_CRYPTO_EX_INDEX_SSL
62 #define CRYPTO_EX_INDEX_SSL_CTX WOLF_CRYPTO_EX_INDEX_SSL_CTX
63 #define CRYPTO_EX_INDEX_SSL_SESSION WOLF_CRYPTO_EX_INDEX_SSL_SESSION
64 #define CRYPTO_EX_INDEX_X509 WOLF_CRYPTO_EX_INDEX_X509
65 #define CRYPTO_EX_INDEX_X509_STORE WOLF_CRYPTO_EX_INDEX_X509_STORE
66 #define CRYPTO_EX_INDEX_X509_STORE_CTX WOLF_CRYPTO_EX_INDEX_X509_STORE_CTX
67 #define CRYPTO_EX_INDEX_DH WOLF_CRYPTO_EX_INDEX_DH
68 #define CRYPTO_EX_INDEX_DSA WOLF_CRYPTO_EX_INDEX_DSA
69 #define CRYPTO_EX_INDEX_EC_KEY WOLF_CRYPTO_EX_INDEX_EC_KEY
70 #define CRYPTO_EX_INDEX_RSA WOLF_CRYPTO_EX_INDEX_RSA
71 #define CRYPTO_EX_INDEX_ENGINE WOLF_CRYPTO_EX_INDEX_ENGINE
72 #define CRYPTO_EX_INDEX_UI WOLF_CRYPTO_EX_INDEX_UI
73 #define CRYPTO_EX_INDEX_BIO WOLF_CRYPTO_EX_INDEX_BIO
74 #define CRYPTO_EX_INDEX_APP WOLF_CRYPTO_EX_INDEX_APP
75 #define CRYPTO_EX_INDEX_UI_METHOD WOLF_CRYPTO_EX_INDEX_UI_METHOD
76 #define CRYPTO_EX_INDEX_DRBG WOLF_CRYPTO_EX_INDEX_DRBG
77 #define CRYPTO_EX_INDEX__COUNT WOLF_CRYPTO_EX_INDEX__COUNT
78
79 #define crypto_threadid_st WOLFSSL_CRYPTO_THREADID
80 #define CRYPTO_THREADID WOLFSSL_CRYPTO_THREADID
81
82 #define SSLeay_version wolfSSLeay_version
83 #define SSLeay wolfSSLeay
84 #define OpenSSL_version_num wolfSSL_OpenSSL_version_num
85
86 #ifdef WOLFSSL_QT
87 #define SSLEAY_VERSION 0x10001000L
88 #else
89 #define SSLEAY_VERSION 0x0090600fL
90 #endif
91 #define SSLEAY_VERSION_NUMBER SSLEAY_VERSION
92 #define CRYPTO_lock wc_LockMutex_ex
93
94 /* this function was used to set the default malloc, free, and realloc */
95 #define CRYPTO_malloc_init() 0 /* CRYPTO_malloc_init is not needed */
96
97 #define OPENSSL_free wolfSSL_OPENSSL_free
98 #define OPENSSL_malloc wolfSSL_OPENSSL_malloc
99 #define OPENSSL_hexchar2int wolfSSL_OPENSSL_hexchar2int
100 #define OPENSSL_hexstr2buf wolfSSL_OPENSSL_hexstr2buf
101
102 #define OPENSSL_INIT_ENGINE_ALL_BUILTIN 0x00000001L
103 #define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L

NetBurner, Inc.
1278 File Documentation

104 #define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L


105 #define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
106
107 #define OPENSSL_init_crypto wolfSSL_OPENSSL_init_crypto
108
109 #ifdef WOLFSSL_OPENVPN
110 # define OPENSSL_assert(e) \
111 if (!(e)) { \
112 fprintf(stderr, "%s:%d wolfSSL internal error: assertion failed: " #e, \
113 __FILE__, __LINE__); \
114 raise(SIGABRT); \
115 _exit(3); \
116 }
117 #endif
118
119 #if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || \
120 defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA) || defined(HAVE_EX_DATA)
121 #define CRYPTO_set_mem_ex_functions wolfSSL_CRYPTO_set_mem_ex_functions
122 #define FIPS_mode wolfSSL_FIPS_mode
123 #define FIPS_mode_set wolfSSL_FIPS_mode_set
124 #define CRYPTO_THREADID_set_callback wolfSSL_THREADID_set_callback
125 #define CRYPTO_THREADID_set_numeric wolfSSL_THREADID_set_numeric
126 #define CRYPTO_THREADID_current wolfSSL_THREADID_current
127 #define CRYPTO_THREADID_hash wolfSSL_THREADID_hash
128
129 #define CRYPTO_r_lock wc_LockMutex_ex
130 #define CRYPTO_unlock wc_LockMutex_ex
131
132 #define CRYPTO_THREAD_lock wc_LockMutex
133 #define CRYPTO_THREAD_r_lock wc_LockMutex
134 #define CRYPTO_THREAD_unlock wc_UnLockMutex
135
136 #define CRYPTO_THREAD_lock_new wc_InitAndAllocMutex
137 #define CRYPTO_THREAD_read_lock wc_LockMutex
138 #define CRYPTO_THREAD_write_lock wc_LockMutex
139 #define CRYPTO_THREAD_lock_free wc_FreeMutex
140
141 #define CRYPTO_set_ex_data wolfSSL_CRYPTO_set_ex_data
142
143 #endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY || HAVE_EX_DATA */
144
145 #ifdef __cplusplus
146 } /* extern "C" */
147 #endif
148
149 #endif /* header */

22.226 des.h
1 /* des.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 /* des.h defines mini des openssl compatibility layer
15 *
16 */
17
18
19 #ifndef WOLFSSL_DES_H_
20 #define WOLFSSL_DES_H_
21
22 #include <wolfssl/wolfcrypt/settings.h>
23
24 #ifndef NO_DES3
25
26 #ifdef WOLFSSL_PREFIX
27 #include "prefix_des.h"
28 #endif
29
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef unsigned char WOLFSSL_DES_cblock[8];
36 typedef /* const */ WOLFSSL_DES_cblock WOLFSSL_const_DES_cblock;

NetBurner, Inc.
22.227 openssl/dh.h 1279

37 typedef WOLFSSL_DES_cblock WOLFSSL_DES_key_schedule;


38 typedef unsigned int WOLFSSL_DES_LONG;
39
40
41 enum {
42 DES_ENCRYPT = 1,
43 DES_DECRYPT = 0
44 };
45
46
47 WOLFSSL_API int wolfSSL_DES_is_weak_key(WOLFSSL_const_DES_cblock* key);
48 WOLFSSL_API WOLFSSL_DES_LONG wolfSSL_DES_cbc_cksum(const unsigned char* in,
49 WOLFSSL_DES_cblock* out, long length, WOLFSSL_DES_key_schedule* sc,
50 WOLFSSL_const_DES_cblock* iv);
51 WOLFSSL_API int wolfSSL_DES_set_key(WOLFSSL_const_DES_cblock* myDes,
52 WOLFSSL_DES_key_schedule* key);
53 WOLFSSL_API int wolfSSL_DES_set_key_checked(WOLFSSL_const_DES_cblock* myDes,
54 WOLFSSL_DES_key_schedule* key);
55 WOLFSSL_API void wolfSSL_DES_set_key_unchecked(WOLFSSL_const_DES_cblock* myDes,
56 WOLFSSL_DES_key_schedule* key);
57 WOLFSSL_API int wolfSSL_DES_key_sched(WOLFSSL_const_DES_cblock* key,
58 WOLFSSL_DES_key_schedule* schedule);
59 WOLFSSL_API void wolfSSL_DES_cbc_encrypt(const unsigned char* input,
60 unsigned char* output, long length,
61 WOLFSSL_DES_key_schedule* schedule, WOLFSSL_DES_cblock* ivec,
62 int enc);
63 WOLFSSL_API void wolfSSL_DES_ede3_cbc_encrypt(const unsigned char* input,
64 unsigned char* output, long sz,
65 WOLFSSL_DES_key_schedule* ks1,
66 WOLFSSL_DES_key_schedule* ks2,
67 WOLFSSL_DES_key_schedule* ks3,
68 WOLFSSL_DES_cblock* ivec, int enc);
69 WOLFSSL_API void wolfSSL_DES_ncbc_encrypt(const unsigned char* input,
70 unsigned char* output, long length,
71 WOLFSSL_DES_key_schedule* schedule,
72 WOLFSSL_DES_cblock* ivec, int enc);
73
74 WOLFSSL_API void wolfSSL_DES_set_odd_parity(WOLFSSL_DES_cblock* myDes);
75 WOLFSSL_API void wolfSSL_DES_ecb_encrypt(WOLFSSL_DES_cblock* desa,
76 WOLFSSL_DES_cblock* desb, WOLFSSL_DES_key_schedule* key, int enc);
77 WOLFSSL_API int wolfSSL_DES_check_key_parity(WOLFSSL_DES_cblock *myDes);
78
79
80 typedef WOLFSSL_DES_cblock DES_cblock;
81 typedef WOLFSSL_const_DES_cblock const_DES_cblock;
82 typedef WOLFSSL_DES_key_schedule DES_key_schedule;
83 typedef WOLFSSL_DES_LONG DES_LONG;
84
85 #define DES_check_key(x) /* Define WOLFSSL_CHECK_DESKEY to check key */
86 #define DES_is_weak_key wolfSSL_DES_is_weak_key
87 #define DES_set_key wolfSSL_DES_set_key
88 #define DES_set_key_checked wolfSSL_DES_set_key_checked
89 #define DES_set_key_unchecked wolfSSL_DES_set_key_unchecked
90 #define DES_key_sched wolfSSL_DES_key_sched
91 #define DES_cbc_encrypt wolfSSL_DES_cbc_encrypt
92 #define DES_ncbc_encrypt wolfSSL_DES_ncbc_encrypt
93 #define DES_set_odd_parity wolfSSL_DES_set_odd_parity
94 #define DES_ecb_encrypt wolfSSL_DES_ecb_encrypt
95 #define DES_ede3_cbc_encrypt wolfSSL_DES_ede3_cbc_encrypt
96 #define DES_cbc_cksum wolfSSL_DES_cbc_cksum
97 #define DES_check_key_parity wolfSSL_DES_check_key_parity
98
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102
103 #endif /* NO_DES3 */
104
105 #endif /* WOLFSSL_DES_H_ */

22.227 openssl/dh.h
1 /* dh.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* dh.h for openSSL */
13

NetBurner, Inc.
1280 File Documentation

14
15 #ifndef WOLFSSL_DH_H_
16 #define WOLFSSL_DH_H_
17
18 #include <wolfssl/openssl/bn.h>
19 #include <wolfssl/openssl/opensslv.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #ifndef WOLFSSL_DH_TYPE_DEFINED /* guard on redeclaration */
26 typedef struct WOLFSSL_DH WOLFSSL_DH;
27 #define WOLFSSL_DH_TYPE_DEFINED
28 #endif
29
30 struct WOLFSSL_DH {
31 WOLFSSL_BIGNUM* p;
32 WOLFSSL_BIGNUM* g;
33 WOLFSSL_BIGNUM* q;
34 WOLFSSL_BIGNUM* pub_key; /* openssh deference g^x */
35 WOLFSSL_BIGNUM* priv_key; /* openssh deference x */
36 void* internal; /* our DH */
37 char inSet; /* internal set from external ? */
38 char exSet; /* external set from internal ? */
39 /*added for lighttpd openssl compatibility, go back and add a getter in
40 * lighttpd src code.
41 */
42 int length;
43 #ifndef SINGLE_THREADED
44 wolfSSL_Mutex refMutex; /* ref count mutex */
45 #endif
46 int refCount; /* reference count */
47 };
48
49 WOLFSSL_API WOLFSSL_DH *wolfSSL_d2i_DHparams(WOLFSSL_DH **dh,
50 const unsigned char **pp, long length);
51 WOLFSSL_API int wolfSSL_i2d_DHparams(const WOLFSSL_DH *dh, unsigned char **out);
52 WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new(void);
53 WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new_by_nid(int nid);
54 WOLFSSL_API void wolfSSL_DH_free(WOLFSSL_DH* dh);
55 WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_dup(WOLFSSL_DH* dh);
56 WOLFSSL_API int wolfSSL_DH_up_ref(WOLFSSL_DH* dh);
57
58 WOLFSSL_API int wolfSSL_DH_check(const WOLFSSL_DH *dh, int *codes);
59 WOLFSSL_API int wolfSSL_DH_size(WOLFSSL_DH* dh);
60 WOLFSSL_API int wolfSSL_DH_generate_key(WOLFSSL_DH* dh);
61 WOLFSSL_API int wolfSSL_DH_compute_key(unsigned char* key, const WOLFSSL_BIGNUM* pub,
62 WOLFSSL_DH* dh);
63 WOLFSSL_API int wolfSSL_DH_LoadDer(WOLFSSL_DH* dh, const unsigned char* derBuf,
64 int derSz);
65 WOLFSSL_API int wolfSSL_DH_set_length(WOLFSSL_DH* dh, long len);
66 WOLFSSL_API int wolfSSL_DH_set0_pqg(WOLFSSL_DH *dh, WOLFSSL_BIGNUM *p,
67 WOLFSSL_BIGNUM *q, WOLFSSL_BIGNUM *g);
68
69 WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_get_2048_256(void);
70
71 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
72
73 typedef WOLFSSL_DH DH;
74
75 #define DH_new wolfSSL_DH_new
76 #define DH_free wolfSSL_DH_free
77 #define DH_up_ref wolfSSL_DH_up_ref
78 #define DH_new_by_nid wolfSSL_DH_new_by_nid
79
80 #define d2i_DHparams wolfSSL_d2i_DHparams
81 #define i2d_DHparams wolfSSL_i2d_DHparams
82 #define DH_check wolfSSL_DH_check
83
84 #define DH_size wolfSSL_DH_size
85 #define DH_generate_key wolfSSL_DH_generate_key
86 #define DH_compute_key wolfSSL_DH_compute_key
87 #define DH_set_length wolfSSL_DH_set_length
88 #define DH_set0_pqg wolfSSL_DH_set0_pqg
89 #define DH_get0_pqg wolfSSL_DH_get0_pqg
90 #define DH_get0_key wolfSSL_DH_get0_key
91 #define DH_set0_key wolfSSL_DH_set0_key
92 #define DH_bits(x) (BN_num_bits((x)->p))
93
94 #define DH_GENERATOR_2 2
95 #define DH_CHECK_P_NOT_PRIME 0x01
96 #define DH_CHECK_P_NOT_SAFE_PRIME 0x02
97 #define DH_NOT_SUITABLE_GENERATOR 0x08
98
99 /* Temporary values for wolfSSL_DH_Check*/
100 #define DH_CHECK_INVALID_Q_VALUE 0x10

NetBurner, Inc.
22.228 dh.h File Reference 1281

101 #define DH_CHECK_Q_NOT_PRIME 0x11


102 /* end temp */
103
104 /* for pre 1.1.0 */
105 #define get_rfc2409_prime_768 wolfSSL_DH_768_prime
106 #define get_rfc2409_prime_1024 wolfSSL_DH_1024_prime
107 #define get_rfc3526_prime_1536 wolfSSL_DH_1536_prime
108 #define get_rfc3526_prime_2048 wolfSSL_DH_2048_prime
109 #define get_rfc3526_prime_3072 wolfSSL_DH_3072_prime
110 #define get_rfc3526_prime_4096 wolfSSL_DH_4096_prime
111 #define get_rfc3526_prime_6144 wolfSSL_DH_6144_prime
112 #define get_rfc3526_prime_8192 wolfSSL_DH_8192_prime
113
114 #define DH_get_2048_256 wolfSSL_DH_get_2048_256
115
116 #if defined(OPENSSL_ALL) || defined(HAVE_STUNNEL)
117 #define DH_generate_parameters wolfSSL_DH_generate_parameters
118 #define DH_generate_parameters_ex wolfSSL_DH_generate_parameters_ex
119 #endif /* OPENSSL_ALL || HAVE_STUNNEL */
120
121 #define DH_GENERATOR_2 2
122 #define DH_GENERATOR_5 5
123
124 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
125
126 #ifdef __cplusplus
127 } /* extern "C" */
128 #endif
129
130 #endif /* WOLFSSL_DH_H_ */

22.228 dh.h File Reference


#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/integer.h>
#include <wolfssl/wolfcrypt/random.h>

22.229 wolfcrypt/dh.h
Go to the documentation of this file.
1 /* dh.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_DH_H
17 #define WOLF_CRYPT_DH_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifndef NO_DH
22
23 #if defined(HAVE_FIPS) && \
24 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
25 #include <wolfssl/wolfcrypt/fips.h>
26 #endif /* HAVE_FIPS_VERSION >= 2 */
27
28 #include <wolfssl/wolfcrypt/integer.h>
29 #include <wolfssl/wolfcrypt/random.h>
30
31 #ifdef WOLFSSL_KCAPI_DH
32 #include <wolfssl/wolfcrypt/port/kcapi/kcapi_dh.h>
33 #endif
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #ifdef WOLFSSL_ASYNC_CRYPT
40 #include <wolfssl/wolfcrypt/async.h>
41 #endif
42

NetBurner, Inc.
1282 File Documentation

43 typedef struct DhParams {


44 #ifdef HAVE_FFDHE_Q
45 const byte* q;
46 word32 q_len;
47 #endif /* HAVE_FFDHE_Q */
48 const byte* p;
49 word32 p_len;
50 const byte* g;
51 word32 g_len;
52 } DhParams;
53
54 /* Diffie-Hellman Key */
55 struct DhKey {
56 mp_int p, g, q; /* group parameters */
57 #ifdef WOLFSSL_DH_EXTRA
58 mp_int pub;
59 mp_int priv;
60 #endif
61 void* heap;
62 #ifdef WOLFSSL_ASYNC_CRYPT
63 WC_ASYNC_DEV asyncDev;
64 #endif
65 int trustedGroup;
66 #ifdef WOLFSSL_KCAPI_DH
67 struct kcapi_handle* handle;
68 #endif
69 };
70
71 #ifndef WC_DH_TYPE_DEFINED
72 typedef struct DhKey DhKey;
73 #define WC_DH_TYPE_DEFINED
74 #endif
75
76 enum {
77 WC_FFDHE_2048 = 256,
78 WC_FFDHE_3072 = 257,
79 WC_FFDHE_4096 = 258,
80 WC_FFDHE_6144 = 259,
81 WC_FFDHE_8192 = 260,
82 };
83
84 /* DH Private Key size up to 8192 bit */
85 #ifndef WC_DH_PRIV_MAX_SZ
86 #define WC_DH_PRIV_MAX_SZ 52
87 #endif
88
89 #ifdef HAVE_PUBLIC_FFDHE
90 #ifdef HAVE_FFDHE_2048
91 WOLFSSL_API const DhParams* wc_Dh_ffdhe2048_Get(void);
92 #endif
93 #ifdef HAVE_FFDHE_3072
94 WOLFSSL_API const DhParams* wc_Dh_ffdhe3072_Get(void);
95 #endif
96 #ifdef HAVE_FFDHE_4096
97 WOLFSSL_API const DhParams* wc_Dh_ffdhe4096_Get(void);
98 #endif
99 #ifdef HAVE_FFDHE_6144
100 WOLFSSL_API const DhParams* wc_Dh_ffdhe6144_Get(void);
101 #endif
102 #ifdef HAVE_FFDHE_8192
103 WOLFSSL_API const DhParams* wc_Dh_ffdhe8192_Get(void);
104 #endif
105 #endif
106
107 WOLFSSL_API int wc_InitDhKey(DhKey* key);
108 WOLFSSL_API int wc_InitDhKey_ex(DhKey* key, void* heap, int devId);
109 WOLFSSL_API int wc_FreeDhKey(DhKey* key);
110
111 WOLFSSL_API int wc_DhGenerateKeyPair(DhKey* key, WC_RNG* rng, byte* priv,
112 word32* privSz, byte* pub, word32* pubSz);
113 WOLFSSL_API int wc_DhAgree(DhKey* key, byte* agree, word32* agreeSz,
114 const byte* priv, word32 privSz, const byte* otherPub,
115 word32 pubSz);
116
117 WOLFSSL_API int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key,
118 word32 inSz); /* wc_DhKeyDecode is in asn.c */
119
120 WOLFSSL_API int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g,
121 word32 gSz);
122 WOLFSSL_API int wc_DhSetKey_ex(DhKey* key, const byte* p, word32 pSz,
123 const byte* g, word32 gSz, const byte* q, word32 qSz);
124 WOLFSSL_API int wc_DhSetNamedKey(DhKey* key, int name);
125 WOLFSSL_API int wc_DhGetNamedKeyParamSize(int name,
126 word32* p, word32* g, word32* q);
127 WOLFSSL_API word32 wc_DhGetNamedKeyMinSize(int name);
128 WOLFSSL_API int wc_DhCmpNamedKey(int name, int noQ,
129 const byte* p, word32 pSz,

NetBurner, Inc.
22.230 openssl/dsa.h 1283

130 const byte* g, word32 gSz,


131 const byte* q, word32 qSz);
132 WOLFSSL_API int wc_DhCopyNamedKey(int name,
133 byte* p, word32* pSz, byte* g, word32* gSz, byte* q, word32* qSz);
134
135 #ifdef WOLFSSL_DH_EXTRA
136 WOLFSSL_API int wc_DhImportKeyPair(DhKey* key, const byte* priv, word32 privSz,
137 const byte* pub, word32 pubSz);
138 WOLFSSL_API int wc_DhExportKeyPair(DhKey* key, byte* priv, word32* pPrivSz,
139 byte* pub, word32* pPubSz);
140 WOLFSSL_LOCAL int wc_DhKeyCopy(DhKey* src, DhKey* dst);
141 #endif
142 WOLFSSL_API int wc_DhSetCheckKey(DhKey* key, const byte* p, word32 pSz,
143 const byte* g, word32 gSz, const byte* q, word32 qSz,
144 int trusted, WC_RNG* rng);
145 WOLFSSL_API int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p,
146 word32* pInOutSz, byte* g, word32* gInOutSz);
147 WOLFSSL_API int wc_DhCheckPubKey(DhKey* key, const byte* pub, word32 pubSz);
148 WOLFSSL_API int wc_DhCheckPubKey_ex(DhKey* key, const byte* pub, word32 pubSz,
149 const byte* prime, word32 primeSz);
150 WOLFSSL_API int wc_DhCheckPubValue(const byte* prime, word32 primeSz,
151 const byte* pub, word32 pubSz);
152 WOLFSSL_API int wc_DhCheckPrivKey(DhKey* key, const byte* priv, word32 pubSz);
153 WOLFSSL_API int wc_DhCheckPrivKey_ex(DhKey* key, const byte* priv, word32 pubSz,
154 const byte* prime, word32 primeSz);
155 WOLFSSL_API int wc_DhCheckKeyPair(DhKey* key, const byte* pub, word32 pubSz,
156 const byte* priv, word32 privSz);
157 WOLFSSL_API int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh);
158 WOLFSSL_API int wc_DhExportParamsRaw(DhKey* dh, byte* p, word32* pSz,
159 byte* q, word32* qSz, byte* g, word32* gSz);
160
161
162 #ifdef __cplusplus
163 } /* extern "C" */
164 #endif
165
166 #endif /* NO_DH */
167 #endif /* WOLF_CRYPT_DH_H */

22.230 openssl/dsa.h
1 /* dsa.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* dsa.h for openSSL */
13
14
15 #ifndef WOLFSSL_DSA_H_
16 #define WOLFSSL_DSA_H_
17
18 #include <wolfssl/openssl/bn.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 typedef struct WOLFSSL_DSA_SIG {
25 WOLFSSL_BIGNUM *r;
26 WOLFSSL_BIGNUM *s;
27 } WOLFSSL_DSA_SIG;
28
29 #ifndef WOLFSSL_DSA_TYPE_DEFINED /* guard on redeclaration */
30 typedef struct WOLFSSL_DSA WOLFSSL_DSA;
31 #define WOLFSSL_DSA_TYPE_DEFINED
32 #endif
33
34 struct WOLFSSL_DSA {
35 WOLFSSL_BIGNUM* p;
36 WOLFSSL_BIGNUM* q;
37 WOLFSSL_BIGNUM* g;
38 WOLFSSL_BIGNUM* pub_key; /* our y */
39 WOLFSSL_BIGNUM* priv_key; /* our x */
40 void* internal; /* our Dsa Key */
41 char inSet; /* internal set from external ? */
42 char exSet; /* external set from internal ? */
43 };
44

NetBurner, Inc.
1284 File Documentation

45
46 WOLFSSL_API WOLFSSL_DSA* wolfSSL_DSA_new(void);
47 WOLFSSL_API void wolfSSL_DSA_free(WOLFSSL_DSA* dsa);
48 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
49 WOLFSSL_API int wolfSSL_DSA_print_fp(XFILE fp, WOLFSSL_DSA* dsa, int indent);
50 #endif /* !NO_FILESYSTEM && NO_STDIO_FILESYSTEM */
51
52 WOLFSSL_API int wolfSSL_DSA_generate_key(WOLFSSL_DSA* dsa);
53
54 typedef void (*WOLFSSL_BN_CB)(int i, int j, void* exArg);
55 WOLFSSL_API WOLFSSL_DSA* wolfSSL_DSA_generate_parameters(int bits,
56 unsigned char* seed, int seedLen, int* counterRet,
57 unsigned long* hRet, WOLFSSL_BN_CB cb, void* CBArg);
58 WOLFSSL_API int wolfSSL_DSA_generate_parameters_ex(WOLFSSL_DSA* dsa, int bits,
59 unsigned char* seed, int seedLen, int* counterRet,
60 unsigned long* hRet, void* cb);
61
62 WOLFSSL_API void wolfSSL_DSA_get0_pqg(const WOLFSSL_DSA *d, const WOLFSSL_BIGNUM **p,
63 const WOLFSSL_BIGNUM **q, const WOLFSSL_BIGNUM **g);
64 WOLFSSL_API int wolfSSL_DSA_set0_pqg(WOLFSSL_DSA *d, WOLFSSL_BIGNUM *p,
65 WOLFSSL_BIGNUM *q, WOLFSSL_BIGNUM *g);
66
67 WOLFSSL_API void wolfSSL_DSA_get0_key(const WOLFSSL_DSA *d,
68 const WOLFSSL_BIGNUM **pub_key, const WOLFSSL_BIGNUM **priv_key);
69 WOLFSSL_API int wolfSSL_DSA_set0_key(WOLFSSL_DSA *d, WOLFSSL_BIGNUM *pub_key,
70 WOLFSSL_BIGNUM *priv_key);
71
72
73 WOLFSSL_API int wolfSSL_DSA_LoadDer(
74 WOLFSSL_DSA* dsa, const unsigned char* derBuf, int derSz);
75
76 WOLFSSL_API int wolfSSL_DSA_LoadDer_ex(
77 WOLFSSL_DSA* dsa, const unsigned char* derBuf, int derSz, int opt);
78
79 WOLFSSL_API int wolfSSL_DSA_do_sign(
80 const unsigned char* d, unsigned char* sigRet, WOLFSSL_DSA* dsa);
81
82 WOLFSSL_API int wolfSSL_DSA_do_verify(
83 const unsigned char* d, unsigned char* sig, WOLFSSL_DSA* dsa, int *dsacheck);
84
85 WOLFSSL_API int wolfSSL_DSA_bits(const WOLFSSL_DSA *d);
86
87 WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_DSA_SIG_new(void);
88 WOLFSSL_API void wolfSSL_DSA_SIG_free(WOLFSSL_DSA_SIG *sig);
89
90 WOLFSSL_API void wolfSSL_DSA_SIG_get0(const WOLFSSL_DSA_SIG *sig,
91 const WOLFSSL_BIGNUM **r, const WOLFSSL_BIGNUM **s);
92 WOLFSSL_API int wolfSSL_DSA_SIG_set0(WOLFSSL_DSA_SIG *sig, WOLFSSL_BIGNUM *r,
93 WOLFSSL_BIGNUM *s);
94
95 WOLFSSL_API int wolfSSL_i2d_DSA_SIG(const WOLFSSL_DSA_SIG *sig, byte **out);
96 WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_d2i_DSA_SIG(WOLFSSL_DSA_SIG **sig,
97 const unsigned char **pp, long length);
98 WOLFSSL_API WOLFSSL_DSA_SIG* wolfSSL_DSA_do_sign_ex(const unsigned char* digest,
99 int inLen, WOLFSSL_DSA* dsa);
100 WOLFSSL_API int wolfSSL_DSA_do_verify_ex(const unsigned char* digest, int digest_len,
101 WOLFSSL_DSA_SIG* sig, WOLFSSL_DSA* dsa);
102
103 WOLFSSL_API int wolfSSL_i2d_DSAparams(
104 const WOLFSSL_DSA* dsa, unsigned char** out);
105 WOLFSSL_API WOLFSSL_DSA* wolfSSL_d2i_DSAparams(
106 WOLFSSL_DSA** dsa, const unsigned char** der, long derLen);
107
108 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
109
110 typedef WOLFSSL_DSA DSA;
111
112 #define WOLFSSL_DSA_LOAD_PRIVATE 1
113 #define WOLFSSL_DSA_LOAD_PUBLIC 2
114
115 #define DSA_new wolfSSL_DSA_new
116 #define DSA_free wolfSSL_DSA_free
117 #define DSA_print_fp wolfSSL_DSA_print_fp
118
119 #define DSA_LoadDer wolfSSL_DSA_LoadDer
120 #define DSA_generate_key wolfSSL_DSA_generate_key
121 #define DSA_generate_parameters wolfSSL_DSA_generate_parameters
122 #define DSA_generate_parameters_ex wolfSSL_DSA_generate_parameters_ex
123 #define DSA_get0_pqg wolfSSL_DSA_get0_pqg
124 #define DSA_set0_pqg wolfSSL_DSA_set0_pqg
125 #define DSA_get0_key wolfSSL_DSA_get0_key
126 #define DSA_set0_key wolfSSL_DSA_set0_key
127
128 #define DSA_SIG_new wolfSSL_DSA_SIG_new
129 #define DSA_SIG_free wolfSSL_DSA_SIG_free
130 #define DSA_SIG_get0 wolfSSL_DSA_SIG_get0
131 #define DSA_SIG_set0 wolfSSL_DSA_SIG_set0

NetBurner, Inc.
22.231 dsa.h File Reference 1285

132 #define i2d_DSA_SIG wolfSSL_i2d_DSA_SIG


133 #define d2i_DSA_SIG wolfSSL_d2i_DSA_SIG
134 #define DSA_do_sign wolfSSL_DSA_do_sign_ex
135 #define DSA_do_verify wolfSSL_DSA_do_verify_ex
136 #define i2d_DSAparams wolfSSL_i2d_DSAparams
137 #define d2i_DSAparams wolfSSL_d2i_DSAparams
138
139 #define DSA_SIG WOLFSSL_DSA_SIG
140
141 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
142
143 #ifdef __cplusplus
144 } /* extern "C" */
145 #endif
146
147 #endif /* header */

22.231 dsa.h File Reference


#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/integer.h>
#include <wolfssl/wolfcrypt/random.h>

22.232 wolfcrypt/dsa.h
Go to the documentation of this file.
1 /* dsa.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_DSA_H
17 #define WOLF_CRYPT_DSA_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifndef NO_DSA
22
23 #include <wolfssl/wolfcrypt/integer.h>
24 #include <wolfssl/wolfcrypt/random.h>
25
26 /* for DSA reverse compatibility */
27 #define InitDsaKey wc_InitDsaKey
28 #define FreeDsaKey wc_FreeDsaKey
29 #define DsaSign wc_DsaSign
30 #define DsaVerify wc_DsaVerify
31 #define DsaPublicKeyDecode wc_DsaPublicKeyDecode
32 #define DsaPrivateKeyDecode wc_DsaPrivateKeyDecode
33 #define DsaKeyToDer wc_DsaKeyToDer
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39
40 enum {
41 DSA_PUBLIC = 0,
42 DSA_PRIVATE = 1
43 };
44
45 enum {
46 /* 160 bit q length */
47 DSA_160_HALF_SIZE = 20, /* r and s size */
48 DSA_160_SIG_SIZE = 40, /* signature size */
49 DSA_HALF_SIZE = DSA_160_HALF_SIZE, /* kept for compatiblity */
50 DSA_SIG_SIZE = DSA_160_SIG_SIZE, /* kept for compatiblity */
51 /* 256 bit q length */
52 DSA_256_HALF_SIZE = 32, /* r and s size */
53 DSA_256_SIG_SIZE = 64, /* signature size */
54
55 DSA_MIN_HALF_SIZE = DSA_160_HALF_SIZE,
56 DSA_MIN_SIG_SIZE = DSA_160_SIG_SIZE,

NetBurner, Inc.
1286 File Documentation

57
58 DSA_MAX_HALF_SIZE = DSA_256_HALF_SIZE,
59 DSA_MAX_SIG_SIZE = DSA_256_SIG_SIZE,
60 };
61
62 /* DSA */
63 typedef struct DsaKey {
64 mp_int p, q, g, y, x;
65 int type; /* public or private */
66 void* heap; /* memory hint */
67 } DsaKey;
68
69 WOLFSSL_API int wc_InitDsaKey(DsaKey* key);
70 WOLFSSL_API int wc_InitDsaKey_h(DsaKey* key, void* h);
71 WOLFSSL_API void wc_FreeDsaKey(DsaKey* key);
72 WOLFSSL_API int wc_DsaSign(const byte* digest, byte* out,
73 DsaKey* key, WC_RNG* rng);
74 WOLFSSL_API int wc_DsaVerify(const byte* digest, const byte* sig,
75 DsaKey* key, int* answer);
76 WOLFSSL_API int wc_DsaPublicKeyDecode(const byte* input, word32* inOutIdx,
77 DsaKey* key, word32 inSz);
78 WOLFSSL_API int wc_DsaPrivateKeyDecode(const byte* input, word32* inOutIdx,
79 DsaKey* key, word32 inSz);
80 WOLFSSL_API int wc_DsaKeyToDer(DsaKey* key, byte* output, word32 inLen);
81 WOLFSSL_API int wc_SetDsaPublicKey(byte* output, DsaKey* key,
82 int outLen, int with_header);
83 WOLFSSL_API int wc_DsaKeyToPublicDer(DsaKey* key, byte* output, word32 inLen);
84
85 #ifdef WOLFSSL_KEY_GEN
86 WOLFSSL_API int wc_MakeDsaKey(WC_RNG *rng, DsaKey *dsa);
87 WOLFSSL_API int wc_MakeDsaParameters(WC_RNG *rng, int modulus_size, DsaKey *dsa);
88 #endif
89
90 /* raw export functions */
91 WOLFSSL_API int wc_DsaImportParamsRaw(DsaKey* dsa, const char* p,
92 const char* q, const char* g);
93 WOLFSSL_API int wc_DsaImportParamsRawCheck(DsaKey* dsa, const char* p,
94 const char* q, const char* g,
95 int trusted, WC_RNG* rng);
96 WOLFSSL_API int wc_DsaExportParamsRaw(DsaKey* dsa, byte* p, word32* pSz,
97 byte* q, word32* qSz, byte* g,
98 word32* gSz);
99 WOLFSSL_API int wc_DsaExportKeyRaw(DsaKey* dsa, byte* x, word32* xSz, byte* y,
100 word32* ySz);
101 #ifdef __cplusplus
102 } /* extern "C" */
103 #endif
104
105 #endif /* NO_DSA */
106 #endif /* WOLF_CRYPT_DSA_H */
107

22.233 ec.h
1 /* ec.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ec.h for openssl */
13
14 #ifndef WOLFSSL_EC_H_
15 #define WOLFSSL_EC_H_
16
17 #include <wolfssl/openssl/bn.h>
18 #include <wolfssl/wolfcrypt/asn.h>
19 #include <wolfssl/wolfcrypt/ecc.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
26 /* Map OpenSSL NID value */
27 enum {
28 POINT_CONVERSION_COMPRESSED = 2,
29 POINT_CONVERSION_UNCOMPRESSED = 4,
30
31 #ifdef HAVE_ECC

NetBurner, Inc.
22.233 ec.h 1287

32 /* Use OpenSSL NIDs. NIDs can be mapped to ecc_curve_id enum values by


33 calling NIDToEccEnum() in ssl.c */
34 NID_X9_62_prime192v1 = 409,
35 NID_X9_62_prime192v2 = 410,
36 NID_X9_62_prime192v3 = 411,
37 NID_X9_62_prime239v1 = 412,
38 NID_X9_62_prime239v2 = 413,
39 NID_X9_62_prime239v3 = 418, /* Previous value conflicted with AES128CBCb */
40 NID_X9_62_prime256v1 = 415,
41 NID_secp112r1 = 704,
42 NID_secp112r2 = 705,
43 NID_secp128r1 = 706,
44 NID_secp128r2 = 707,
45 NID_secp160r1 = 709,
46 NID_secp160r2 = 710,
47 NID_secp224r1 = 713,
48 NID_secp384r1 = 715,
49 NID_secp521r1 = 716,
50 NID_secp160k1 = 708,
51 NID_secp192k1 = 711,
52 NID_secp224k1 = 712,
53 NID_secp256k1 = 714,
54 NID_brainpoolP160r1 = 921,
55 NID_brainpoolP192r1 = 923,
56 NID_brainpoolP224r1 = 925,
57 NID_brainpoolP256r1 = 927,
58 NID_brainpoolP320r1 = 929,
59 NID_brainpoolP384r1 = 931,
60 NID_brainpoolP512r1 = 933,
61 #endif
62
63 #ifdef HAVE_ED448
64 NID_ED448 = ED448k,
65 #endif
66 #ifdef HAVE_ED25519
67 NID_ED25519 = ED25519k,
68 #endif
69
70 OPENSSL_EC_EXPLICIT_CURVE = 0x000,
71 OPENSSL_EC_NAMED_CURVE = 0x001,
72 };
73 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
74
75 #ifndef WOLFSSL_EC_TYPE_DEFINED /* guard on redeclaration */
76 typedef struct WOLFSSL_EC_KEY WOLFSSL_EC_KEY;
77 typedef struct WOLFSSL_EC_POINT WOLFSSL_EC_POINT;
78 typedef struct WOLFSSL_EC_GROUP WOLFSSL_EC_GROUP;
79 typedef struct WOLFSSL_EC_BUILTIN_CURVE WOLFSSL_EC_BUILTIN_CURVE;
80 /* WOLFSSL_EC_METHOD is just an alias of WOLFSSL_EC_GROUP for now */
81 typedef struct WOLFSSL_EC_GROUP WOLFSSL_EC_METHOD;
82
83 #define WOLFSSL_EC_TYPE_DEFINED
84 #endif
85
86 struct WOLFSSL_EC_POINT {
87 WOLFSSL_BIGNUM *X;
88 WOLFSSL_BIGNUM *Y;
89 WOLFSSL_BIGNUM *Z;
90
91 void* internal; /* our ECC point */
92 char inSet; /* internal set from external ? */
93 char exSet; /* external set from internal ? */
94 };
95
96 struct WOLFSSL_EC_GROUP {
97 int curve_idx; /* index of curve, used by WolfSSL as reference */
98 int curve_nid; /* NID of curve, used by OpenSSL/OpenSSH as reference */
99 int curve_oid; /* OID of curve, used by OpenSSL/OpenSSH as reference */
100 };
101
102 struct WOLFSSL_EC_KEY {
103 WOLFSSL_EC_GROUP *group;
104 WOLFSSL_EC_POINT *pub_key;
105 WOLFSSL_BIGNUM *priv_key;
106
107 void* internal; /* our ECC Key */
108 void* heap;
109 char form; /* Either POINT_CONVERSION_UNCOMPRESSED or
110 * POINT_CONVERSION_COMPRESSED */
111 word16 pkcs8HeaderSz;
112
113 /* option bits */
114 byte inSet:1; /* internal set from external ? */
115 byte exSet:1; /* external set from internal ? */
116
117 #ifndef SINGLE_THREADED
118 wolfSSL_Mutex refMutex; /* ref count mutex */

NetBurner, Inc.
1288 File Documentation

119 #endif
120 int refCount; /* reference count */
121 };
122
123 struct WOLFSSL_EC_BUILTIN_CURVE {
124 int nid;
125 const char *comment;
126 };
127
128 #define WOLFSSL_EC_KEY_LOAD_PRIVATE 1
129 #define WOLFSSL_EC_KEY_LOAD_PUBLIC 2
130
131 typedef int point_conversion_form_t;
132
133 WOLFSSL_API
134 size_t wolfSSL_EC_get_builtin_curves(WOLFSSL_EC_BUILTIN_CURVE *r,size_t nitems);
135
136 WOLFSSL_API
137 WOLFSSL_EC_KEY *wolfSSL_EC_KEY_dup(const WOLFSSL_EC_KEY *src);
138 WOLFSSL_API
139 int wolfSSL_EC_KEY_up_ref(WOLFSSL_EC_KEY* key);
140
141 WOLFSSL_API
142 int wolfSSL_ECPoint_i2d(const WOLFSSL_EC_GROUP *curve,
143 const WOLFSSL_EC_POINT *p,
144 unsigned char *out, unsigned int *len);
145 WOLFSSL_API
146 int wolfSSL_ECPoint_d2i(unsigned char *in, unsigned int len,
147 const WOLFSSL_EC_GROUP *curve, WOLFSSL_EC_POINT *p);
148 WOLFSSL_API
149 size_t wolfSSL_EC_POINT_point2oct(const WOLFSSL_EC_GROUP *group,
150 const WOLFSSL_EC_POINT *p,
151 char form,
152 byte *buf, size_t len, WOLFSSL_BN_CTX *ctx);
153 WOLFSSL_API
154 int wolfSSL_EC_POINT_oct2point(const WOLFSSL_EC_GROUP *group,
155 WOLFSSL_EC_POINT *p, const unsigned char *buf,
156 size_t len, WOLFSSL_BN_CTX *ctx);
157 WOLFSSL_API
158 WOLFSSL_EC_KEY *wolfSSL_o2i_ECPublicKey(WOLFSSL_EC_KEY **a, const unsigned char **in,
159 long len);
160 WOLFSSL_API
161 int wolfSSL_i2o_ECPublicKey(const WOLFSSL_EC_KEY *in, unsigned char **out);
162 WOLFSSL_API
163 WOLFSSL_EC_KEY *wolfSSL_d2i_ECPrivateKey(WOLFSSL_EC_KEY **key, const unsigned char **in,
164 long len);
165 WOLFSSL_API
166 int wolfSSL_i2d_ECPrivateKey(const WOLFSSL_EC_KEY *in, unsigned char **out);
167 WOLFSSL_API
168 void wolfSSL_EC_KEY_set_conv_form(WOLFSSL_EC_KEY *eckey, char form);
169 WOLFSSL_API
170 point_conversion_form_t wolfSSL_EC_KEY_get_conv_form(const WOLFSSL_EC_KEY* key);
171 WOLFSSL_API
172 WOLFSSL_BIGNUM *wolfSSL_EC_POINT_point2bn(const WOLFSSL_EC_GROUP *group,
173 const WOLFSSL_EC_POINT *p,
174 char form,
175 WOLFSSL_BIGNUM *in, WOLFSSL_BN_CTX *ctx);
176 WOLFSSL_API
177 int wolfSSL_EC_POINT_is_on_curve(const WOLFSSL_EC_GROUP *group,
178 const WOLFSSL_EC_POINT *point,
179 WOLFSSL_BN_CTX *ctx);
180
181 WOLFSSL_API
182 int wolfSSL_EC_KEY_LoadDer(WOLFSSL_EC_KEY* key,
183 const unsigned char* der, int derSz);
184 WOLFSSL_API
185 int wolfSSL_EC_KEY_LoadDer_ex(WOLFSSL_EC_KEY* key,
186 const unsigned char* der, int derSz, int opt);
187 WOLFSSL_API
188 void wolfSSL_EC_KEY_free(WOLFSSL_EC_KEY *key);
189 WOLFSSL_API
190 WOLFSSL_EC_POINT *wolfSSL_EC_KEY_get0_public_key(const WOLFSSL_EC_KEY *key);
191 WOLFSSL_API
192 const WOLFSSL_EC_GROUP *wolfSSL_EC_KEY_get0_group(const WOLFSSL_EC_KEY *key);
193 WOLFSSL_API
194 int wolfSSL_EC_KEY_set_private_key(WOLFSSL_EC_KEY *key,
195 const WOLFSSL_BIGNUM *priv_key);
196 WOLFSSL_API
197 WOLFSSL_BIGNUM *wolfSSL_EC_KEY_get0_private_key(const WOLFSSL_EC_KEY *key);
198 WOLFSSL_API
199 WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new_by_curve_name(int nid);
200 WOLFSSL_API const char* wolfSSL_EC_curve_nid2nist(int nid);
201 WOLFSSL_API int wolfSSL_EC_curve_nist2nid(const char* name);
202 WOLFSSL_API
203 WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new_ex(void* heap, int devId);
204 WOLFSSL_API
205 WOLFSSL_EC_KEY *wolfSSL_EC_KEY_new(void);

NetBurner, Inc.
22.233 ec.h 1289

206 WOLFSSL_API
207 int wolfSSL_EC_KEY_set_group(WOLFSSL_EC_KEY *key, WOLFSSL_EC_GROUP *group);
208 WOLFSSL_API
209 int wolfSSL_EC_KEY_generate_key(WOLFSSL_EC_KEY *key);
210 WOLFSSL_API
211 void wolfSSL_EC_KEY_set_asn1_flag(WOLFSSL_EC_KEY *key, int asn1_flag);
212 WOLFSSL_API
213 int wolfSSL_EC_KEY_set_public_key(WOLFSSL_EC_KEY *key,
214 const WOLFSSL_EC_POINT *pub);
215 WOLFSSL_API int wolfSSL_EC_KEY_check_key(const WOLFSSL_EC_KEY *key);
216 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
217 WOLFSSL_API int wolfSSL_EC_KEY_print_fp(XFILE fp, WOLFSSL_EC_KEY* key,
218 int indent);
219 #endif /* !NO_FILESYSTEM && !NO_STDIO_FILESYSTEM */
220 WOLFSSL_API int wolfSSL_ECDSA_size(const WOLFSSL_EC_KEY *key);
221 WOLFSSL_API int wolfSSL_ECDSA_sign(int type, const unsigned char *digest,
222 int digestSz, unsigned char *sig,
223 unsigned int *sigSz, WOLFSSL_EC_KEY *key);
224 WOLFSSL_API int wolfSSL_ECDSA_verify(int type, const unsigned char *digest,
225 int digestSz, const unsigned char *sig,
226 int sigSz, WOLFSSL_EC_KEY *key);
227
228 WOLFSSL_API
229 void wolfSSL_EC_GROUP_set_asn1_flag(WOLFSSL_EC_GROUP *group, int flag);
230 WOLFSSL_API
231 WOLFSSL_EC_GROUP *wolfSSL_EC_GROUP_new_by_curve_name(int nid);
232 WOLFSSL_API
233 int wolfSSL_EC_GROUP_cmp(const WOLFSSL_EC_GROUP *a, const WOLFSSL_EC_GROUP *b,
234 WOLFSSL_BN_CTX *ctx);
235 WOLFSSL_API
236 WOLFSSL_EC_GROUP *wolfSSL_EC_GROUP_dup(const WOLFSSL_EC_GROUP *src);
237 WOLFSSL_API
238 int wolfSSL_EC_GROUP_get_curve_name(const WOLFSSL_EC_GROUP *group);
239 WOLFSSL_API
240 int wolfSSL_EC_GROUP_get_degree(const WOLFSSL_EC_GROUP *group);
241 WOLFSSL_API
242 int wolfSSL_EC_GROUP_get_order(const WOLFSSL_EC_GROUP *group,
243 WOLFSSL_BIGNUM *order, WOLFSSL_BN_CTX *ctx);
244 WOLFSSL_API
245 int wolfSSL_EC_GROUP_order_bits(const WOLFSSL_EC_GROUP *group);
246 WOLFSSL_API
247 void wolfSSL_EC_GROUP_free(WOLFSSL_EC_GROUP *group);
248 WOLFSSL_API
249 const WOLFSSL_EC_METHOD* wolfSSL_EC_GROUP_method_of(
250 const WOLFSSL_EC_GROUP *group);
251 WOLFSSL_API
252 int wolfSSL_EC_METHOD_get_field_type(const WOLFSSL_EC_METHOD *meth);
253 WOLFSSL_API
254 WOLFSSL_EC_POINT *wolfSSL_EC_POINT_new(const WOLFSSL_EC_GROUP *group);
255 WOLFSSL_API
256 int wolfSSL_EC_POINT_get_affine_coordinates_GFp(const WOLFSSL_EC_GROUP *group,
257 const WOLFSSL_EC_POINT *p,
258 WOLFSSL_BIGNUM *x,
259 WOLFSSL_BIGNUM *y,
260 WOLFSSL_BN_CTX *ctx);
261 WOLFSSL_API
262 int wolfSSL_EC_POINT_set_affine_coordinates_GFp(const WOLFSSL_EC_GROUP *group,
263 WOLFSSL_EC_POINT *point,
264 const WOLFSSL_BIGNUM *x,
265 const WOLFSSL_BIGNUM *y,
266 WOLFSSL_BN_CTX *ctx);
267 WOLFSSL_API
268 int wolfSSL_EC_POINT_add(const WOLFSSL_EC_GROUP *group, WOLFSSL_EC_POINT *r,
269 const WOLFSSL_EC_POINT *p1,
270 const WOLFSSL_EC_POINT *p2, WOLFSSL_BN_CTX *ctx);
271 WOLFSSL_API
272 int wolfSSL_EC_POINT_mul(const WOLFSSL_EC_GROUP *group, WOLFSSL_EC_POINT *r,
273 const WOLFSSL_BIGNUM *n,
274 const WOLFSSL_EC_POINT *q, const WOLFSSL_BIGNUM *m,
275 WOLFSSL_BN_CTX *ctx);
276 WOLFSSL_API
277 int wolfSSL_EC_POINT_invert(const WOLFSSL_EC_GROUP *group, WOLFSSL_EC_POINT *a,
278 WOLFSSL_BN_CTX *ctx);
279 WOLFSSL_API
280 void wolfSSL_EC_POINT_clear_free(WOLFSSL_EC_POINT *point);
281 WOLFSSL_API
282 int wolfSSL_EC_POINT_cmp(const WOLFSSL_EC_GROUP *group,
283 const WOLFSSL_EC_POINT *a, const WOLFSSL_EC_POINT *b,
284 WOLFSSL_BN_CTX *ctx);
285 WOLFSSL_API int wolfSSL_EC_POINT_copy(WOLFSSL_EC_POINT *dest,
286 const WOLFSSL_EC_POINT *src);
287 WOLFSSL_API
288 void wolfSSL_EC_POINT_free(WOLFSSL_EC_POINT *point);
289 WOLFSSL_API
290 int wolfSSL_EC_POINT_is_at_infinity(const WOLFSSL_EC_GROUP *group,
291 const WOLFSSL_EC_POINT *a);
292

NetBurner, Inc.
1290 File Documentation

293 #ifndef HAVE_SELFTEST


294 WOLFSSL_API
295 char* wolfSSL_EC_POINT_point2hex(const WOLFSSL_EC_GROUP* group,
296 const WOLFSSL_EC_POINT* point, int form,
297 WOLFSSL_BN_CTX* ctx);
298 #endif
299
300 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
301
302 typedef WOLFSSL_EC_KEY EC_KEY;
303 typedef WOLFSSL_EC_GROUP EC_GROUP;
304 typedef WOLFSSL_EC_GROUP EC_METHOD;
305 typedef WOLFSSL_EC_POINT EC_POINT;
306 typedef WOLFSSL_EC_BUILTIN_CURVE EC_builtin_curve;
307
308 #ifndef HAVE_ECC
309 #define OPENSSL_NO_EC
310 #endif
311
312 #define EC_KEY_new wolfSSL_EC_KEY_new
313 #define EC_KEY_free wolfSSL_EC_KEY_free
314 #define EC_KEY_up_ref wolfSSL_EC_KEY_up_ref
315 #define EC_KEY_dup wolfSSL_EC_KEY_dup
316 #define EC_KEY_get0_public_key wolfSSL_EC_KEY_get0_public_key
317 #define EC_KEY_get0_group wolfSSL_EC_KEY_get0_group
318 #define EC_KEY_set_private_key wolfSSL_EC_KEY_set_private_key
319 #define EC_KEY_get0_private_key wolfSSL_EC_KEY_get0_private_key
320 #define EC_KEY_new_by_curve_name wolfSSL_EC_KEY_new_by_curve_name
321 #define EC_KEY_set_group wolfSSL_EC_KEY_set_group
322 #define EC_KEY_generate_key wolfSSL_EC_KEY_generate_key
323 #define EC_KEY_set_asn1_flag wolfSSL_EC_KEY_set_asn1_flag
324 #define EC_KEY_set_public_key wolfSSL_EC_KEY_set_public_key
325 #define EC_KEY_check_key wolfSSL_EC_KEY_check_key
326 #define EC_KEY_print_fp wolfSSL_EC_KEY_print_fp
327
328 #define ECDSA_size wolfSSL_ECDSA_size
329 #define ECDSA_sign wolfSSL_ECDSA_sign
330 #define ECDSA_verify wolfSSL_ECDSA_verify
331
332 #define EC_GROUP_free wolfSSL_EC_GROUP_free
333 #define EC_GROUP_set_asn1_flag wolfSSL_EC_GROUP_set_asn1_flag
334 #define EC_GROUP_new_by_curve_name wolfSSL_EC_GROUP_new_by_curve_name
335 #define EC_GROUP_cmp wolfSSL_EC_GROUP_cmp
336 #define EC_GROUP_dup wolfSSL_EC_GROUP_dup
337 #define EC_GROUP_get_curve_name wolfSSL_EC_GROUP_get_curve_name
338 #define EC_GROUP_get_degree wolfSSL_EC_GROUP_get_degree
339 #define EC_GROUP_get_order wolfSSL_EC_GROUP_get_order
340 #define EC_GROUP_order_bits wolfSSL_EC_GROUP_order_bits
341 #define EC_GROUP_method_of wolfSSL_EC_GROUP_method_of
342 #ifndef NO_WOLFSSL_STUB
343 #define EC_GROUP_set_point_conversion_form(...)
344 #endif
345
346 #define EC_METHOD_get_field_type wolfSSL_EC_METHOD_get_field_type
347
348 #define EC_POINT_new wolfSSL_EC_POINT_new
349 #define EC_POINT_free wolfSSL_EC_POINT_free
350 #define EC_POINT_get_affine_coordinates_GFp \
351 wolfSSL_EC_POINT_get_affine_coordinates_GFp
352 #define EC_POINT_get_affine_coordinates \
353 wolfSSL_EC_POINT_get_affine_coordinates_GFp
354 #define EC_POINT_set_affine_coordinates_GFp \
355 wolfSSL_EC_POINT_set_affine_coordinates_GFp
356 #define EC_POINT_set_affine_coordinates \
357 wolfSSL_EC_POINT_set_affine_coordinates_GFp
358 #define EC_POINT_add wolfSSL_EC_POINT_add
359 #define EC_POINT_mul wolfSSL_EC_POINT_mul
360 #define EC_POINT_invert wolfSSL_EC_POINT_invert
361 #define EC_POINT_clear_free wolfSSL_EC_POINT_clear_free
362 #define EC_POINT_cmp wolfSSL_EC_POINT_cmp
363 #define EC_POINT_copy wolfSSL_EC_POINT_copy
364 #define EC_POINT_is_at_infinity wolfSSL_EC_POINT_is_at_infinity
365
366 #define EC_get_builtin_curves wolfSSL_EC_get_builtin_curves
367
368 #define ECPoint_i2d wolfSSL_ECPoint_i2d
369 #define ECPoint_d2i wolfSSL_ECPoint_d2i
370 #define EC_POINT_point2oct wolfSSL_EC_POINT_point2oct
371 #define EC_POINT_oct2point wolfSSL_EC_POINT_oct2point
372 #define EC_POINT_point2bn wolfSSL_EC_POINT_point2bn
373 #define EC_POINT_is_on_curve wolfSSL_EC_POINT_is_on_curve
374 #define o2i_ECPublicKey wolfSSL_o2i_ECPublicKey
375 #define i2o_ECPublicKey wolfSSL_i2o_ECPublicKey
376 #define i2d_EC_PUBKEY wolfSSL_i2o_ECPublicKey
377 #define d2i_ECPrivateKey wolfSSL_d2i_ECPrivateKey
378 #define i2d_ECPrivateKey wolfSSL_i2d_ECPrivateKey
379 #define EC_KEY_set_conv_form wolfSSL_EC_KEY_set_conv_form

NetBurner, Inc.
22.234 ec25519.h 1291

380 #define EC_KEY_get_conv_form wolfSSL_EC_KEY_get_conv_form


381
382 #ifndef HAVE_SELFTEST
383 #define EC_POINT_point2hex wolfSSL_EC_POINT_point2hex
384 #endif
385
386 #define EC_POINT_dump wolfSSL_EC_POINT_dump
387 #define EC_get_builtin_curves wolfSSL_EC_get_builtin_curves
388
389 #define EC_curve_nid2nist wolfSSL_EC_curve_nid2nist
390 #define EC_curve_nist2nid wolfSSL_EC_curve_nist2nid
391
392 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
393
394 #ifdef __cplusplus
395 } /* extern "C" */
396 #endif
397
398 #endif /* header */

22.234 ec25519.h
1 /* ec25519.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ec25519.h */
13
14 #ifndef WOLFSSL_EC25519_H_
15 #define WOLFSSL_EC25519_H_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 WOLFSSL_API
22 int wolfSSL_EC25519_generate_key(unsigned char *priv, unsigned int *privSz,
23 unsigned char *pub, unsigned int *pubSz);
24
25 WOLFSSL_API
26 int wolfSSL_EC25519_shared_key(unsigned char *shared, unsigned int *sharedSz,
27 const unsigned char *priv, unsigned int privSz,
28 const unsigned char *pub, unsigned int pubSz);
29
30 #ifdef __cplusplus
31 } /* extern "C" */
32 #endif
33
34 #endif /* header */

22.235 ec448.h
1 /* ec448.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ec448.h */
13
14 #ifndef WOLFSSL_EC448_H_
15 #define WOLFSSL_EC448_H_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 WOLFSSL_API
22 int wolfSSL_EC448_generate_key(unsigned char *priv, unsigned int *privSz,
23 unsigned char *pub, unsigned int *pubSz);

NetBurner, Inc.
1292 File Documentation

24
25 WOLFSSL_API
26 int wolfSSL_EC448_shared_key(unsigned char *shared, unsigned int *sharedSz,
27 const unsigned char *priv, unsigned int privSz,
28 const unsigned char *pub, unsigned int pubSz);
29
30 #ifdef __cplusplus
31 } /* extern "C" */
32 #endif
33
34 #endif /* header */

22.236 ecdh.h
1 /* ecdh.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ecdh.h for openssl */
13
14 #ifndef WOLFSSL_ECDH_H_
15 #define WOLFSSL_ECDH_H_
16
17 #include <wolfssl/openssl/ssl.h>
18 #include <wolfssl/openssl/bn.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24
25 WOLFSSL_API int wolfSSL_ECDH_compute_key(void *out, size_t outlen,
26 const WOLFSSL_EC_POINT *pub_key,
27 WOLFSSL_EC_KEY *ecdh,
28 void *(*KDF) (const void *in,
29 size_t inlen,
30 void *out,
31 size_t *outlen));
32
33 #define ECDH_compute_key wolfSSL_ECDH_compute_key
34
35 #ifdef __cplusplus
36 } /* extern C */
37 #endif
38
39 #endif /* header */

22.237 ecdsa.h
1 /* ecdsa.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ecdsa.h for openssl */
13
14 #ifndef WOLFSSL_ECDSA_H_
15 #define WOLFSSL_ECDSA_H_
16
17 #include <wolfssl/openssl/bn.h>
18 #include <wolfssl/openssl/ec.h>
19
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #ifndef WOLFSSL_ECDSA_TYPE_DEFINED /* guard on redeclaration */
26 typedef struct WOLFSSL_ECDSA_SIG WOLFSSL_ECDSA_SIG;

NetBurner, Inc.
22.238 openssl/ed25519.h 1293

27 #define WOLFSSL_ECDSA_TYPE_DEFINED
28 #endif
29
30 typedef WOLFSSL_ECDSA_SIG ECDSA_SIG;
31
32 struct WOLFSSL_ECDSA_SIG {
33 WOLFSSL_BIGNUM *r;
34 WOLFSSL_BIGNUM *s;
35 };
36
37 WOLFSSL_API void wolfSSL_ECDSA_SIG_free(WOLFSSL_ECDSA_SIG *sig);
38 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_SIG_new(void);
39 WOLFSSL_API void wolfSSL_ECDSA_SIG_get0(const WOLFSSL_ECDSA_SIG* sig,
40 const WOLFSSL_BIGNUM** r, const WOLFSSL_BIGNUM** s);
41 WOLFSSL_API int wolfSSL_ECDSA_SIG_set0(WOLFSSL_ECDSA_SIG* sig, WOLFSSL_BIGNUM* r,
42 WOLFSSL_BIGNUM* s);
43 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_do_sign(const unsigned char *dgst,
44 int dgst_len,
45 WOLFSSL_EC_KEY *eckey);
46 WOLFSSL_API int wolfSSL_ECDSA_do_verify(const unsigned char *dgst,
47 int dgst_len,
48 const WOLFSSL_ECDSA_SIG *sig,
49 WOLFSSL_EC_KEY *eckey);
50
51 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_d2i_ECDSA_SIG(WOLFSSL_ECDSA_SIG **sig,
52 const unsigned char **pp,
53 long len);
54 WOLFSSL_API int wolfSSL_i2d_ECDSA_SIG(const WOLFSSL_ECDSA_SIG *sig,
55 unsigned char **pp);
56
57 #define ECDSA_SIG_free wolfSSL_ECDSA_SIG_free
58 #define ECDSA_SIG_new wolfSSL_ECDSA_SIG_new
59 #define ECDSA_SIG_get0 wolfSSL_ECDSA_SIG_get0
60 #define ECDSA_SIG_set0 wolfSSL_ECDSA_SIG_set0
61 #define ECDSA_do_sign wolfSSL_ECDSA_do_sign
62 #define ECDSA_do_verify wolfSSL_ECDSA_do_verify
63 #define d2i_ECDSA_SIG wolfSSL_d2i_ECDSA_SIG
64 #define i2d_ECDSA_SIG wolfSSL_i2d_ECDSA_SIG
65
66 #ifdef __cplusplus
67 } /* extern "C" */
68 #endif
69
70 #endif /* header */
71

22.238 openssl/ed25519.h
1 /* ed25519.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ed25519.h */
13
14 #ifndef WOLFSSL_ED25519_H_
15 #define WOLFSSL_ED25519_H_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 WOLFSSL_API
22 int wolfSSL_ED25519_generate_key(unsigned char *priv, unsigned int *privSz,
23 unsigned char *pub, unsigned int *pubSz);
24 WOLFSSL_API
25 int wolfSSL_ED25519_sign(const unsigned char *msg, unsigned int msgSz,
26 const unsigned char *priv, unsigned int privSz,
27 unsigned char *sig, unsigned int *sigSz);
28 WOLFSSL_API
29 int wolfSSL_ED25519_verify(const unsigned char *msg, unsigned int msgSz,
30 const unsigned char *pub, unsigned int pubSz,
31 const unsigned char *sig, unsigned int sigSz);
32
33 #ifdef __cplusplus
34 } /* extern "C" */
35 #endif
36
37 #endif /* header */

NetBurner, Inc.
1294 File Documentation

22.239 ed25519.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.240 wolfcrypt/ed25519.h
Go to the documentation of this file.
1 /* ed25519.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_ED25519_H
18 #define WOLF_CRYPT_ED25519_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifdef HAVE_ED25519
23
24 #include <wolfssl/wolfcrypt/fe_operations.h>
25 #include <wolfssl/wolfcrypt/ge_operations.h>
26 #include <wolfssl/wolfcrypt/random.h>
27 #ifndef WOLFSSL_SHA512
28 #error ED25519 requires SHA512
29 #endif
30 #include <wolfssl/wolfcrypt/sha512.h>
31
32 #ifdef WOLFSSL_ASYNC_CRYPT
33 #include <wolfssl/wolfcrypt/async.h>
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40
41 /* info about EdDSA curve specifically ed25519, defined as an elliptic curve
42 over GF(p) */
43 /*
44 32, key size
45 "ED25519", curve name
46 "2^255-19", prime number
47 "SHA512", hash function
48 "-121665/121666", value of d
49 */
50
51 #define ED25519_KEY_SIZE 32 /* private key only */
52 #define ED25519_SIG_SIZE 64
53
54 #define ED25519_PUB_KEY_SIZE 32 /* compressed */
55 /* both private and public key */
56 #define ED25519_PRV_KEY_SIZE (ED25519_PUB_KEY_SIZE+ED25519_KEY_SIZE)
57
58
59 enum {
60 Ed25519 = -1,
61 Ed25519ctx = 0,
62 Ed25519ph = 1,
63 };
64
65 #ifndef WC_ED25519KEY_TYPE_DEFINED
66 typedef struct ed25519_key ed25519_key;
67 #define WC_ED25519KEY_TYPE_DEFINED
68 #endif
69
70 /* ED25519 Flags */
71 enum {
72 WC_ED25519_FLAG_NONE = 0x00,
73 WC_ED25519_FLAG_DEC_SIGN = 0x01,
74 };
75
76 /* An ED25519 Key */
77 struct ed25519_key {
78 byte p[ED25519_PUB_KEY_SIZE]; /* compressed public key */
79 byte k[ED25519_PRV_KEY_SIZE]; /* private key : 32 secret -- 32 public */
80 #ifdef FREESCALE_LTC_ECC

NetBurner, Inc.
22.240 wolfcrypt/ed25519.h 1295

81 /* uncompressed point coordinates */


82 byte pointX[ED25519_KEY_SIZE]; /* recovered X coordinate */
83 byte pointY[ED25519_KEY_SIZE]; /* Y coordinate is the public key with The most significant bit of the
final octet always zero. */
84 #endif
85 #ifdef WOLFSSL_SE050
86 int keyId;
87 word32 flags;
88 #endif
89 word16 privKeySet:1;
90 word16 pubKeySet:1;
91 #ifdef WOLFSSL_ASYNC_CRYPT
92 WC_ASYNC_DEV asyncDev;
93 #endif
94 #if defined(WOLF_CRYPTO_CB)
95 int devId;
96 #endif
97 void *heap;
98 #ifdef WOLFSSL_ED25519_PERSISTENT_SHA
99 wc_Sha512 sha;
100 int sha_clean_flag;
101 #endif
102 };
103
104
105 WOLFSSL_API
106 int wc_ed25519_make_public(ed25519_key* key, unsigned char* pubKey,
107 word32 pubKeySz);
108 WOLFSSL_API
109 int wc_ed25519_make_key(WC_RNG* rng, int keysize, ed25519_key* key);
110 #ifdef HAVE_ED25519_SIGN
111 WOLFSSL_API
112 int wc_ed25519_sign_msg(const byte* in, word32 inLen, byte* out,
113 word32 *outLen, ed25519_key* key);
114 WOLFSSL_API
115 int wc_ed25519ctx_sign_msg(const byte* in, word32 inLen, byte* out,
116 word32 *outLen, ed25519_key* key,
117 const byte* context, byte contextLen);
118 WOLFSSL_API
119 int wc_ed25519ph_sign_hash(const byte* hash, word32 hashLen, byte* out,
120 word32 *outLen, ed25519_key* key,
121 const byte* context, byte contextLen);
122 WOLFSSL_API
123 int wc_ed25519ph_sign_msg(const byte* in, word32 inLen, byte* out,
124 word32 *outLen, ed25519_key* key, const byte* context,
125 byte contextLen);
126 WOLFSSL_API
127 int wc_ed25519_sign_msg_ex(const byte* in, word32 inLen, byte* out,
128 word32 *outLen, ed25519_key* key, byte type,
129 const byte* context, byte contextLen);
130 #endif /* HAVE_ED25519_SIGN */
131 #ifdef HAVE_ED25519_VERIFY
132 WOLFSSL_API
133 int wc_ed25519_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
134 word32 msgLen, int* res, ed25519_key* key);
135 WOLFSSL_API
136 int wc_ed25519ctx_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
137 word32 msgLen, int* res, ed25519_key* key,
138 const byte* context, byte contextLen);
139 WOLFSSL_API
140 int wc_ed25519ph_verify_hash(const byte* sig, word32 sigLen, const byte* hash,
141 word32 hashLen, int* res, ed25519_key* key,
142 const byte* context, byte contextLen);
143 WOLFSSL_API
144 int wc_ed25519ph_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
145 word32 msgLen, int* res, ed25519_key* key,
146 const byte* context, byte contextLen);
147 WOLFSSL_API
148 int wc_ed25519_verify_msg_ex(const byte* sig, word32 sigLen, const byte* msg,
149 word32 msgLen, int* res, ed25519_key* key,
150 byte type, const byte* context, byte contextLen);
151 #ifdef WOLFSSL_ED25519_STREAMING_VERIFY
152 WOLFSSL_API
153 int wc_ed25519_verify_msg_init(const byte* sig, word32 sigLen, ed25519_key* key,
154 byte type, const byte* context, byte contextLen);
155 WOLFSSL_API
156 int wc_ed25519_verify_msg_update(const byte* msgSegment, word32 msgSegmentLen,
157 ed25519_key* key);
158 WOLFSSL_API
159 int wc_ed25519_verify_msg_final(const byte* sig, word32 sigLen, int* res,
160 ed25519_key* key);
161 #endif /* WOLFSSL_ED25519_STREAMING_VERIFY */
162 #endif /* HAVE_ED25519_VERIFY */
163
164
165 WOLFSSL_API
166 int wc_ed25519_init(ed25519_key* key);

NetBurner, Inc.
1296 File Documentation

167 WOLFSSL_API
168 int wc_ed25519_init_ex(ed25519_key* key, void* heap, int devId);
169 WOLFSSL_API
170 void wc_ed25519_free(ed25519_key* key);
171 #ifdef HAVE_ED25519_KEY_IMPORT
172 WOLFSSL_API
173 int wc_ed25519_import_public(const byte* in, word32 inLen, ed25519_key* key);
174 WOLFSSL_API
175 int wc_ed25519_import_public_ex(const byte* in, word32 inLen, ed25519_key* key,
176 int trusted);
177 WOLFSSL_API
178 int wc_ed25519_import_private_only(const byte* priv, word32 privSz,
179 ed25519_key* key);
180 WOLFSSL_API
181 int wc_ed25519_import_private_key(const byte* priv, word32 privSz,
182 const byte* pub, word32 pubSz, ed25519_key* key);
183 WOLFSSL_API
184 int wc_ed25519_import_private_key_ex(const byte* priv, word32 privSz,
185 const byte* pub, word32 pubSz, ed25519_key* key, int trusted);
186 #endif /* HAVE_ED25519_KEY_IMPORT */
187
188 #ifdef HAVE_ED25519_KEY_EXPORT
189 WOLFSSL_API
190 int wc_ed25519_export_public(ed25519_key* key, byte* out, word32* outLen);
191 WOLFSSL_API
192 int wc_ed25519_export_private_only(ed25519_key* key, byte* out, word32* outLen);
193 WOLFSSL_API
194 int wc_ed25519_export_private(ed25519_key* key, byte* out, word32* outLen);
195 WOLFSSL_API
196 int wc_ed25519_export_key(ed25519_key* key,
197 byte* priv, word32 *privSz,
198 byte* pub, word32 *pubSz);
199 #endif /* HAVE_ED25519_KEY_EXPORT */
200
201 WOLFSSL_API
202 int wc_ed25519_check_key(ed25519_key* key);
203
204 /* size helper */
205 WOLFSSL_API
206 int wc_ed25519_size(ed25519_key* key);
207 WOLFSSL_API
208 int wc_ed25519_priv_size(ed25519_key* key);
209 WOLFSSL_API
210 int wc_ed25519_pub_size(ed25519_key* key);
211 WOLFSSL_API
212 int wc_ed25519_sig_size(ed25519_key* key);
213
214 #ifdef __cplusplus
215 } /* extern "C" */
216 #endif
217
218 #endif /* HAVE_ED25519 */
219 #endif /* WOLF_CRYPT_ED25519_H */

22.241 openssl/ed448.h
1 /* ed448.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ed448.h */
13
14 #ifndef WOLFSSL_ED448_H_
15 #define WOLFSSL_ED448_H_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 WOLFSSL_API
22 int wolfSSL_ED448_generate_key(unsigned char *priv, unsigned int *privSz,
23 unsigned char *pub, unsigned int *pubSz);
24 WOLFSSL_API
25 int wolfSSL_ED448_sign(const unsigned char *msg, unsigned int msgSz,
26 const unsigned char *priv, unsigned int privSz,
27 unsigned char *sig, unsigned int *sigSz);
28 WOLFSSL_API
29 int wolfSSL_ED448_verify(const unsigned char *msg, unsigned int msgSz,

NetBurner, Inc.
22.242 ed448.h File Reference 1297

30 const unsigned char *pub, unsigned int pubSz,


31 const unsigned char *sig, unsigned int sigSz);
32
33 #ifdef __cplusplus
34 } /* extern "C" */
35 #endif
36
37 #endif /* header */

22.242 ed448.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.243 wolfcrypt/ed448.h
Go to the documentation of this file.
1 /* ed448.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_ED448_H
18 #define WOLF_CRYPT_ED448_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifdef HAVE_ED448
23
24 #include <wolfssl/wolfcrypt/fe_448.h>
25 #include <wolfssl/wolfcrypt/ge_448.h>
26 #include <wolfssl/wolfcrypt/random.h>
27 #ifndef WOLFSSL_SHAKE256
28 #error ED448 requires SHAKE256
29 #endif
30 #include <wolfssl/wolfcrypt/sha3.h>
31
32 #ifdef WOLFSSL_ASYNC_CRYPT
33 #include <wolfssl/wolfcrypt/async.h>
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40
41 /* info about EdDSA curve specifically ed448, defined as an elliptic curve
42 * over GF(p)
43 *
44 * 56 key size
45 * "ED448" curve name
46 * "2^448-2^224-1" prime number
47 * "-39081" value of d
48 * "SHAKE256" hash function
49 */
50
51 #define ED448_KEY_SIZE 57 /* private key only */
52 #define ED448_SIG_SIZE 114 /* two elements */
53
54 #define ED448_PUB_KEY_SIZE 57 /* compressed */
55 /* both private and public key */
56 #define ED448_PRV_KEY_SIZE (ED448_PUB_KEY_SIZE+ED448_KEY_SIZE)
57
58 #define ED448_PREHASH_SIZE 64
59
60 enum {
61 Ed448 = 0,
62 Ed448ph = 1,
63 };
64
65 #ifndef WC_ED448KEY_TYPE_DEFINED
66 typedef struct ed448_key ed448_key;
67 #define WC_ED448KEY_TYPE_DEFINED
68 #endif

NetBurner, Inc.
1298 File Documentation

69
70 /* An ED448 Key */
71 struct ed448_key {
72 byte p[ED448_PUB_KEY_SIZE]; /* compressed public key */
73 byte k[ED448_PRV_KEY_SIZE]; /* private key : 56 secret -- 56 public */
74 #ifdef FREESCALE_LTC_ECC
75 /* uncompressed point coordinates */
76 byte pointX[ED448_KEY_SIZE]; /* recovered X coordinate */
77 byte pointY[ED448_KEY_SIZE]; /* Y coordinate is the public key with The most significant bit of the
final octet always zero. */
78 #endif
79 word16 privKeySet:1;
80 word16 pubKeySet:1;
81 #ifdef WOLFSSL_ASYNC_CRYPT
82 WC_ASYNC_DEV asyncDev;
83 #endif
84 #if defined(WOLF_CRYPTO_CB)
85 int devId;
86 #endif
87 void *heap;
88 #ifdef WOLFSSL_ED448_PERSISTENT_SHA
89 wc_Shake sha;
90 int sha_clean_flag;
91 #endif
92 };
93
94
95 WOLFSSL_API
96 int wc_ed448_make_public(ed448_key* key, unsigned char* pubKey,
97 word32 pubKeySz);
98 WOLFSSL_API
99 int wc_ed448_make_key(WC_RNG* rng, int keysize, ed448_key* key);
100 #ifdef HAVE_ED448_SIGN
101 WOLFSSL_API
102 int wc_ed448_sign_msg(const byte* in, word32 inLen, byte* out, word32 *outLen,
103 ed448_key* key, const byte* context, byte contextLen);
104 WOLFSSL_API
105 int wc_ed448ph_sign_hash(const byte* hash, word32 hashLen, byte* out,
106 word32 *outLen, ed448_key* key,
107 const byte* context, byte contextLen);
108 WOLFSSL_API
109 int wc_ed448_sign_msg_ex(const byte* in, word32 inLen, byte* out,
110 word32 *outLen, ed448_key* key, byte type,
111 const byte* context, byte contextLen);
112 WOLFSSL_API
113 int wc_ed448ph_sign_msg(const byte* in, word32 inLen, byte* out,
114 word32 *outLen, ed448_key* key, const byte* context,
115 byte contextLen);
116 #endif /* HAVE_ED448_SIGN */
117 #ifdef HAVE_ED448_VERIFY
118 WOLFSSL_API
119 int wc_ed448_verify_msg_ex(const byte* sig, word32 sigLen, const byte* msg,
120 word32 msgLen, int* res, ed448_key* key,
121 byte type, const byte* context, byte contextLen);
122 #ifdef WOLFSSL_ED448_STREAMING_VERIFY
123 WOLFSSL_API
124 int wc_ed448_verify_msg_init(const byte* sig, word32 sigLen, ed448_key* key,
125 byte type, const byte* context, byte contextLen);
126 WOLFSSL_API
127 int wc_ed448_verify_msg_update(const byte* msgSegment, word32 msgSegmentLen,
128 ed448_key* key);
129 WOLFSSL_API
130 int wc_ed448_verify_msg_final(const byte* sig, word32 sigLen,
131 int* res, ed448_key* key);
132 #endif /* WOLFSSL_ED448_STREAMING_VERIFY */
133 WOLFSSL_API
134 int wc_ed448_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
135 word32 msgLen, int* res, ed448_key* key,
136 const byte* context, byte contextLen);
137 WOLFSSL_API
138 int wc_ed448ph_verify_hash(const byte* sig, word32 sigLen, const byte* hash,
139 word32 hashLen, int* res, ed448_key* key,
140 const byte* context, byte contextLen);
141 WOLFSSL_API
142 int wc_ed448ph_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
143 word32 msgLen, int* res, ed448_key* key,
144 const byte* context, byte contextLen);
145 #endif /* HAVE_ED448_VERIFY */
146 WOLFSSL_API
147 int wc_ed448_init_ex(ed448_key* key, void *heap, int devId);
148 WOLFSSL_API
149 int wc_ed448_init(ed448_key* key);
150 WOLFSSL_API
151 void wc_ed448_free(ed448_key* key);
152
153 #ifdef HAVE_ED448_KEY_IMPORT
154 WOLFSSL_API

NetBurner, Inc.
22.244 engine.h 1299

155 int wc_ed448_import_public(const byte* in, word32 inLen, ed448_key* key);


156 WOLFSSL_API
157 int wc_ed448_import_public_ex(const byte* in, word32 inLen, ed448_key* key,
158 int trusted);
159 WOLFSSL_API
160 int wc_ed448_import_private_only(const byte* priv, word32 privSz,
161 ed448_key* key);
162 WOLFSSL_API
163 int wc_ed448_import_private_key(const byte* priv, word32 privSz,
164 const byte* pub, word32 pubSz, ed448_key* key);
165 WOLFSSL_API
166 int wc_ed448_import_private_key_ex(const byte* priv, word32 privSz,
167 const byte* pub, word32 pubSz, ed448_key* key, int trusted);
168 #endif /* HAVE_ED448_KEY_IMPORT */
169
170 #ifdef HAVE_ED448_KEY_EXPORT
171 WOLFSSL_API
172 int wc_ed448_export_public(ed448_key* key, byte* out, word32* outLen);
173 WOLFSSL_API
174 int wc_ed448_export_private_only(ed448_key* key, byte* out, word32* outLen);
175 WOLFSSL_API
176 int wc_ed448_export_private(ed448_key* key, byte* out, word32* outLen);
177 WOLFSSL_API
178 int wc_ed448_export_key(ed448_key* key, byte* priv, word32 *privSz,
179 byte* pub, word32 *pubSz);
180 #endif /* HAVE_ED448_KEY_EXPORT */
181
182 WOLFSSL_API
183 int wc_ed448_check_key(ed448_key* key);
184
185 /* size helper */
186 WOLFSSL_API
187 int wc_ed448_size(ed448_key* key);
188 WOLFSSL_API
189 int wc_ed448_priv_size(ed448_key* key);
190 WOLFSSL_API
191 int wc_ed448_pub_size(ed448_key* key);
192 WOLFSSL_API
193 int wc_ed448_sig_size(ed448_key* key);
194
195 #ifdef __cplusplus
196 } /* extern "C" */
197 #endif
198
199 #endif /* HAVE_ED448 */
200 #endif /* WOLF_CRYPT_ED448_H */

22.244 engine.h
1 /* engine.h for libcurl */
2
3 #include <wolfssl/openssl/err.h>
4
5 #undef HAVE_OPENSSL_ENGINE_H
6
7 /* ENGINE_load_builtin_engines not needed, as all builtin engines are already
8 loaded into memory and used on startup. */
9 #define ENGINE_load_builtin_engines()
10

22.245 err.h
1 /* err.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_OPENSSL_ERR_
13 #define WOLFSSL_OPENSSL_ERR_
14
15 #include <wolfssl/wolfcrypt/logging.h>
16
17 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
18 /* err.h for openssl */
19 #define ERR_load_ERR_strings wolfSSL_ERR_load_ERR_strings
20 #define ERR_load_crypto_strings wolfSSL_ERR_load_crypto_strings

NetBurner, Inc.
1300 File Documentation

21 #define ERR_load_CRYPTO_strings wolfSSL_ERR_load_crypto_strings


22 #define ERR_peek_last_error wolfSSL_ERR_peek_last_error
23
24 /* fatal error */
25 #define ERR_R_MALLOC_FAILURE MEMORY_E
26 #define ERR_R_PASSED_NULL_PARAMETER BAD_FUNC_ARG
27 #define ERR_R_DISABLED NOT_COMPILED_IN
28 #define ERR_R_PASSED_INVALID_ARGUMENT BAD_FUNC_ARG
29 #define RSA_R_UNKNOWN_PADDING_TYPE RSA_PAD_E
30 #define EC_R_BUFFER_TOO_SMALL BUFFER_E
31
32 #define ERR_TXT_MALLOCED 1
33
34 /* SSL function codes */
35 #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT 1
36 #define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 2
37 #define SSL_F_SSL_USE_PRIVATEKEY 3
38 #define EC_F_EC_GFP_SIMPLE_POINT2OCT 4
39
40 /* reasons */
41 #define ERR_R_SYS_LIB 1
42 #define PKCS12_R_MAC_VERIFY_FAILURE 2
43
44 #define RSAerr(f,r) ERR_put_error(0,(f),(r),__FILE__,__LINE__)
45 #define SSLerr(f,r) ERR_put_error(0,(f),(r),__FILE__,__LINE__)
46 #define ECerr(f,r) ERR_put_error(0,(f),(r),__FILE__,__LINE__)
47
48 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
49
50 #endif /* WOLFSSL_OPENSSL_ERR_ */
51

22.246 evp.h File Reference


evp.h defines mini evp openssl compatibility layer
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/openssl/md4.h>
#include <wolfssl/openssl/md5.h>
#include <wolfssl/openssl/sha.h>
#include <wolfssl/openssl/sha3.h>
#include <wolfssl/openssl/ripemd.h>
#include <wolfssl/openssl/rsa.h>
#include <wolfssl/openssl/dsa.h>
#include <wolfssl/openssl/ec.h>
#include <wolfssl/openssl/dh.h>
#include <wolfssl/openssl/compat_types.h>
#include <wolfssl/wolfcrypt/aes.h>
#include <wolfssl/wolfcrypt/des3.h>
#include <wolfssl/wolfcrypt/arc4.h>
#include <wolfssl/wolfcrypt/chacha20_poly1305.h>
#include <wolfssl/wolfcrypt/hmac.h>
#include <wolfssl/wolfcrypt/pwdbased.h>
#include <wolfssl/openssl/objects.h>

22.246.1 Detailed Description


evp.h defines mini evp openssl compatibility layer

22.247 evp.h
Go to the documentation of this file.
1 /* evp.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.

NetBurner, Inc.
22.247 evp.h 1301

8 *
9 * https://www.wolfssl.com
10 */
11
12
13
20 #ifndef WOLFSSL_EVP_H_
21 #define WOLFSSL_EVP_H_
22
23 #include <wolfssl/wolfcrypt/settings.h>
24
25 #ifdef WOLFSSL_PREFIX
26 #include "prefix_evp.h"
27 #endif
28
29 #ifndef NO_MD4
30 #include <wolfssl/openssl/md4.h>
31 #endif
32 #ifndef NO_MD5
33 #include <wolfssl/openssl/md5.h>
34 #endif
35 #include <wolfssl/openssl/sha.h>
36 #include <wolfssl/openssl/sha3.h>
37 #include <wolfssl/openssl/ripemd.h>
38 #include <wolfssl/openssl/rsa.h>
39 #include <wolfssl/openssl/dsa.h>
40 #include <wolfssl/openssl/ec.h>
41 #include <wolfssl/openssl/dh.h>
42 #include <wolfssl/openssl/compat_types.h>
43
44 #include <wolfssl/wolfcrypt/aes.h>
45 #include <wolfssl/wolfcrypt/des3.h>
46 #include <wolfssl/wolfcrypt/arc4.h>
47 #include <wolfssl/wolfcrypt/chacha20_poly1305.h>
48 #include <wolfssl/wolfcrypt/hmac.h>
49 #include <wolfssl/wolfcrypt/pwdbased.h>
50
51 #if defined(WOLFSSL_BASE64_ENCODE) || defined(WOLFSSL_BASE64_DECODE)
52 #include <wolfssl/wolfcrypt/coding.h>
53 #endif
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59
60 #ifndef NO_MD4
61 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_md4(void);
62 #endif
63 #ifndef NO_MD5
64 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_md5(void);
65 #endif
66 WOLFSSL_API void wolfSSL_EVP_set_pw_prompt(const char *prompt);
67 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_mdc2(void);
68 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha1(void);
69 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha224(void);
70 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha256(void);
71 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha384(void);
72 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha512(void);
73 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_shake128(void);
74 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_shake256(void);
75 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_sha512_224(void);
76 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_sha512_256(void);
77 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_ripemd160(void);
78
79 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_224(void);
80 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_256(void);
81 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_384(void);
82 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_sha3_512(void);
83
84 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ecb(void);
85 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ecb(void);
86 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ecb(void);
87 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cbc(void);
88 #if !defined(NO_AES) && (defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_DIRECT))
89 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cbc(void);
90 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cbc(void);
91 #endif
92 #ifndef NO_AES
93 #ifdef WOLFSSL_AES_CFB
94 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb1(void);
95 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb1(void);
96 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb1(void);
97 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb8(void);
98 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb8(void);
99 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb8(void);
100 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_cfb128(void);

NetBurner, Inc.
1302 File Documentation

101 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_cfb128(void);


102 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_cfb128(void);
103 #endif
104 #ifdef WOLFSSL_AES_OFB
105 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ofb(void);
106 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ofb(void);
107 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ofb(void);
108 #endif
109 #ifdef WOLFSSL_AES_XTS
110 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_xts(void);
111 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_xts(void);
112 #endif
113 #endif /* NO_AES */
114 #if !defined(NO_AES) && defined(HAVE_AESGCM)
115 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_gcm(void);
116 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_gcm(void);
117 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_gcm(void);
118 #endif
119 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_128_ctr(void);
120 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_192_ctr(void);
121 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_aes_256_ctr(void);
122 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ecb(void);
123 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ede3_ecb(void);
124 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_cbc(void);
125 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_des_ede3_cbc(void);
126 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc4(void);
127 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_enc_null(void);
128 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_rc2_cbc(void);
129 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
130 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_chacha20_poly1305(void);
131 #endif
132
133
134 typedef union {
135 #ifndef NO_MD4
136 WOLFSSL_MD4_CTX md4;
137 #endif
138 #ifndef NO_MD5
139 WOLFSSL_MD5_CTX md5;
140 #endif
141 #ifndef NO_SHA
142 WOLFSSL_SHA_CTX sha;
143 #endif
144 #ifdef WOLFSSL_SHA224
145 WOLFSSL_SHA224_CTX sha224;
146 #endif
147 #ifndef NO_SHA256
148 WOLFSSL_SHA256_CTX sha256;
149 #endif
150 #ifdef WOLFSSL_SHA384
151 WOLFSSL_SHA384_CTX sha384;
152 #endif
153 #ifdef WOLFSSL_SHA512
154 WOLFSSL_SHA512_CTX sha512;
155 #endif
156 #ifdef WOLFSSL_RIPEMD
157 WOLFSSL_RIPEMD_CTX ripemd;
158 #endif
159 #ifndef WOLFSSL_NOSHA3_224
160 WOLFSSL_SHA3_224_CTX sha3_224;
161 #endif
162 #ifndef WOLFSSL_NOSHA3_256
163 WOLFSSL_SHA3_256_CTX sha3_256;
164 #endif
165 WOLFSSL_SHA3_384_CTX sha3_384;
166 #ifndef WOLFSSL_NOSHA3_512
167 WOLFSSL_SHA3_512_CTX sha3_512;
168 #endif
169 } WOLFSSL_Hasher;
170
171
172 struct WOLFSSL_EVP_MD_CTX {
173 union {
174 WOLFSSL_Hasher digest;
175 #ifndef NO_HMAC
176 Hmac hmac;
177 #endif
178 } hash;
179 enum wc_HashType macType;
180 WOLFSSL_EVP_PKEY_CTX *pctx;
181 #ifndef NO_HMAC
182 unsigned int isHMAC;
183 #endif
184 };
185
186
187 typedef union {

NetBurner, Inc.
22.247 evp.h 1303

188 #ifndef NO_AES


189 Aes aes;
190 #ifdef WOLFSSL_AES_XTS
191 XtsAes xts;
192 #endif
193 #endif
194 #ifndef NO_DES3
195 Des des;
196 Des3 des3;
197 #endif
198 Arc4 arc4;
199 #ifdef WOLFSSL_QT
200 int (*ctrl) (WOLFSSL_EVP_CIPHER_CTX *, int type, int arg, void *ptr);
201 #endif
202 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
203 ChaChaPoly_Aead chachaPoly;
204 #endif
205 } WOLFSSL_Cipher;
206
207 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
208 enum {
209 AES_128_CBC_TYPE = 1,
210 AES_192_CBC_TYPE = 2,
211 AES_256_CBC_TYPE = 3,
212 AES_128_CTR_TYPE = 4,
213 AES_192_CTR_TYPE = 5,
214 AES_256_CTR_TYPE = 6,
215 AES_128_ECB_TYPE = 7,
216 AES_192_ECB_TYPE = 8,
217 AES_256_ECB_TYPE = 9,
218 DES_CBC_TYPE = 10,
219 DES_ECB_TYPE = 11,
220 DES_EDE3_CBC_TYPE = 12,
221 DES_EDE3_ECB_TYPE = 13,
222 ARC4_TYPE = 14,
223 NULL_CIPHER_TYPE = 15,
224 EVP_PKEY_RSA = 16,
225 EVP_PKEY_DSA = 17,
226 EVP_PKEY_EC = 18,
227 AES_128_GCM_TYPE = 21,
228 AES_192_GCM_TYPE = 22,
229 AES_256_GCM_TYPE = 23,
230 NID_sha1 = 64,
231 NID_sha224 = 675,
232 NID_md2 = 77,
233 NID_md4 = 257,
234 NID_md5 = 40,
235 NID_hmac = 855,
236 NID_hmacWithSHA1 = 163,
237 NID_hmacWithSHA224 = 798,
238 NID_hmacWithSHA256 = 799,
239 NID_hmacWithSHA384 = 800,
240 NID_hmacWithSHA512 = 801,
241 NID_hkdf = 1036,
242 NID_cmac = 894,
243 NID_dhKeyAgreement= 28,
244 NID_ffdhe2048 = 1126,
245 NID_ffdhe3072 = 1127,
246 NID_ffdhe4096 = 1128,
247 NID_rc4 = 5,
248 NID_bf_cbc = 91,
249 NID_bf_ecb = 92,
250 NID_bf_cfb64 = 93,
251 NID_bf_ofb64 = 94,
252 NID_cast5_cbc = 108,
253 NID_cast5_ecb = 109,
254 NID_cast5_cfb64 = 110,
255 NID_cast5_ofb64 = 111,
256 EVP_PKEY_DH = NID_dhKeyAgreement,
257 EVP_PKEY_HMAC = NID_hmac,
258 EVP_PKEY_HKDF = NID_hkdf,
259 EVP_PKEY_FALCON = 300, /* Randomly picked value. */
260 EVP_PKEY_DILITHIUM= 301, /* Randomly picked value. */
261 AES_128_CFB1_TYPE = 24,
262 AES_192_CFB1_TYPE = 25,
263 AES_256_CFB1_TYPE = 26,
264 AES_128_CFB8_TYPE = 27,
265 AES_192_CFB8_TYPE = 28,
266 AES_256_CFB8_TYPE = 29,
267 AES_128_CFB128_TYPE = 30,
268 AES_192_CFB128_TYPE = 31,
269 AES_256_CFB128_TYPE = 32,
270 AES_128_OFB_TYPE = 33,
271 AES_192_OFB_TYPE = 34,
272 AES_256_OFB_TYPE = 35,
273 AES_128_XTS_TYPE = 36,
274 AES_256_XTS_TYPE = 37,

NetBurner, Inc.
1304 File Documentation

275 CHACHA20_POLY1305_TYPE = 38
276 };
277
278 enum {
279 NID_md5WithRSA = 104,
280 NID_md2WithRSAEncryption = 9,
281 NID_md5WithRSAEncryption = 99,
282 NID_dsaWithSHA1 = 113,
283 NID_dsaWithSHA1_2 = 70,
284 NID_sha1WithRSA = 115,
285 NID_sha1WithRSAEncryption = 65,
286 NID_sha224WithRSAEncryption = 671,
287 NID_sha256WithRSAEncryption = 668,
288 NID_sha384WithRSAEncryption = 669,
289 NID_sha512WithRSAEncryption = 670,
290 NID_RSA_SHA3_224 = 1116,
291 NID_RSA_SHA3_256 = 1117,
292 NID_RSA_SHA3_384 = 1118,
293 NID_RSA_SHA3_512 = 1119,
294 NID_ecdsa_with_SHA1 = 416,
295 NID_ecdsa_with_SHA224 = 793,
296 NID_ecdsa_with_SHA256 = 794,
297 NID_ecdsa_with_SHA384 = 795,
298 NID_ecdsa_with_SHA512 = 796,
299 NID_ecdsa_with_SHA3_224 = 1112,
300 NID_ecdsa_with_SHA3_256 = 1113,
301 NID_ecdsa_with_SHA3_384 = 1114,
302 NID_ecdsa_with_SHA3_512 = 1115,
303 NID_dsa_with_SHA224 = 802,
304 NID_dsa_with_SHA256 = 803,
305 NID_sha3_224 = 1096,
306 NID_sha3_256 = 1097,
307 NID_sha3_384 = 1098,
308 NID_sha3_512 = 1099,
309 NID_blake2b512 = 1056,
310 NID_blake2s256 = 1057,
311 NID_shake128 = 1100,
312 NID_shake256 = 1101,
313 };
314
315 enum {
316 NID_aes_128_cbc = 419,
317 NID_aes_192_cbc = 423,
318 NID_aes_256_cbc = 427,
319 NID_aes_128_ccm = 896,
320 NID_aes_256_ccm = 902,
321 NID_aes_128_gcm = 895,
322 NID_aes_192_gcm = 898,
323 NID_aes_256_gcm = 901,
324 NID_aes_128_ctr = 904,
325 NID_aes_192_ctr = 905,
326 NID_aes_256_ctr = 906,
327 NID_aes_128_ecb = 418,
328 NID_aes_192_ecb = 422,
329 NID_aes_256_ecb = 426,
330 NID_des_cbc = 31,
331 NID_des_ecb = 29,
332 NID_des_ede3_cbc= 44,
333 NID_des_ede3_ecb= 33,
334 NID_aes_128_cfb1= 650,
335 NID_aes_192_cfb1= 651,
336 NID_aes_256_cfb1= 652,
337 NID_aes_128_cfb8= 653,
338 NID_aes_192_cfb8= 654,
339 NID_aes_256_cfb8= 655,
340 NID_aes_128_cfb128 = 421,
341 NID_aes_192_cfb128 = 425,
342 NID_aes_256_cfb128 = 429,
343 NID_aes_128_ofb = 420,
344 NID_aes_192_ofb = 424,
345 NID_aes_256_ofb = 428,
346 NID_aes_128_xts = 913,
347 NID_aes_256_xts = 914,
348 NID_camellia_128_cbc = 751,
349 NID_camellia_256_cbc = 753,
350 NID_chacha20_poly1305 = 1018
351 };
352
353 enum {
354 /* key exchange */
355 NID_kx_rsa = 1037,
356 NID_kx_ecdhe = 1038,
357 NID_kx_dhe = 1039,
358 NID_kx_ecdhe_psk= 1040,
359 NID_kx_dhe_psk = 1041,
360 NID_kx_rsa_psk= 1042,
361 NID_kx_psk = 1043,

NetBurner, Inc.
22.247 evp.h 1305

362 NID_kx_srp = 1044,


363 NID_kx_gost = 1045,
364 NID_kx_any = 1063,
365
366 /* server authentication */
367 NID_auth_rsa = 1046,
368 NID_auth_ecdsa = 1047,
369 NID_auth_psk = 1048,
370 NID_auth_dss = 1049,
371 NID_auth_srp = 1052,
372 NID_auth_null = 1054,
373 NID_auth_any = 1055
374
375 };
376
377 #define NID_X9_62_id_ecPublicKey EVP_PKEY_EC
378 #define NID_dhKeyAgreement EVP_PKEY_DH
379 #define NID_rsaEncryption EVP_PKEY_RSA
380 #define NID_dsa EVP_PKEY_DSA
381
382 #define EVP_PKEY_OP_SIGN (1 « 3)
383 #define EVP_PKEY_OP_VERIFY (1 « 5)
384 #define EVP_PKEY_OP_ENCRYPT (1 « 6)
385 #define EVP_PKEY_OP_DECRYPT (1 « 7)
386 #define EVP_PKEY_OP_DERIVE (1 « 8)
387
388 #define EVP_PKEY_PRINT_INDENT_MAX 128
389
390 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
391
392
393 #define WOLFSSL_EVP_BUF_SIZE 16
394 struct WOLFSSL_EVP_CIPHER_CTX {
395 int keyLen; /* user may set for variable */
396 int block_size;
397 unsigned long flags;
398 unsigned char enc; /* if encrypt side, then true */
399 unsigned char cipherType;
400 #if !defined(NO_AES)
401 /* working iv pointer into cipher */
402 ALIGN16 unsigned char iv[AES_BLOCK_SIZE];
403 #elif defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
404 ALIGN16 unsigned char iv[CHACHA20_POLY1305_AEAD_IV_SIZE];
405 #elif !defined(NO_DES3)
406 ALIGN16 unsigned char iv[DES_BLOCK_SIZE];
407 #endif
408 WOLFSSL_Cipher cipher;
409 ALIGN16 byte buf[WOLFSSL_EVP_BUF_SIZE];
410 int bufUsed;
411 ALIGN16 byte lastBlock[WOLFSSL_EVP_BUF_SIZE];
412 int lastUsed;
413 #if !defined(NO_AES) || !defined(NO_DES3) || defined(HAVE_AESGCM) || \
414 defined (WOLFSSL_AES_XTS) || (defined(HAVE_CHACHA) || \
415 defined(HAVE_POLY1305))
416 #define HAVE_WOLFSSL_EVP_CIPHER_CTX_IV
417 int ivSz;
418 #ifdef HAVE_AESGCM
419 byte* gcmBuffer;
420 int gcmBufferLen;
421 byte* gcmAuthIn;
422 int gcmAuthInSz;
423 #endif
424 #if defined(HAVE_AESGCM) || (defined(HAVE_CHACHA) && defined(HAVE_POLY1305))
425 #ifdef HAVE_AESGCM
426 ALIGN16 unsigned char authTag[AES_BLOCK_SIZE];
427 #else
428 ALIGN16 unsigned char authTag[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE];
429 #endif
430 int authTagSz;
431 #endif
432 #ifdef HAVE_AESGCM
433 byte gcmIvGenEnable:1;
434 byte gcmIncIv:1;
435 #endif
436 #endif
437 };
438
439 struct WOLFSSL_EVP_PKEY_CTX {
440 WOLFSSL_EVP_PKEY *pkey;
441 WOLFSSL_EVP_PKEY *peerKey;
442 int op; /* operation */
443 int padding;
444 int nbits;
445 #ifdef HAVE_ECC
446 int curveNID;
447 #endif
448 #ifndef NO_RSA

NetBurner, Inc.
1306 File Documentation

449 const WOLFSSL_EVP_MD* md;


450 #endif
451 };
452
453 struct WOLFSSL_ASN1_PCTX {
454 int dummy;
455 };
456 #if defined(WOLFSSL_BASE64_ENCODE) || defined(WOLFSSL_BASE64_DECODE)
457
458 #define BASE64_ENCODE_BLOCK_SIZE 48
459 #define BASE64_ENCODE_RESULT_BLOCK_SIZE 64
460 #define BASE64_DECODE_BLOCK_SIZE 4
461
462 struct WOLFSSL_EVP_ENCODE_CTX {
463 void* heap;
464 int remaining; /* num of bytes in data[] */
465 byte data[BASE64_ENCODE_BLOCK_SIZE];/* storage for unprocessed raw data */
466 };
467 typedef struct WOLFSSL_EVP_ENCODE_CTX WOLFSSL_EVP_ENCODE_CTX;
468
469 WOLFSSL_API struct WOLFSSL_EVP_ENCODE_CTX* wolfSSL_EVP_ENCODE_CTX_new(void);
470 WOLFSSL_API void wolfSSL_EVP_ENCODE_CTX_free(WOLFSSL_EVP_ENCODE_CTX* ctx);
471 #endif /* WOLFSSL_BASE64_ENCODE || WOLFSSL_BASE64_DECODE */
472
473 #if defined(WOLFSSL_BASE64_ENCODE)
474 WOLFSSL_API void wolfSSL_EVP_EncodeInit(WOLFSSL_EVP_ENCODE_CTX* ctx);
475 WOLFSSL_API int wolfSSL_EVP_EncodeUpdate(WOLFSSL_EVP_ENCODE_CTX* ctx,
476 unsigned char*out, int *outl, const unsigned char*in, int inl);
477 WOLFSSL_API void wolfSSL_EVP_EncodeFinal(WOLFSSL_EVP_ENCODE_CTX* ctx,
478 unsigned char*out, int *outl);
479 WOLFSSL_API int wolfSSL_EVP_EncodeBlock(unsigned char *out,
480 const unsigned char *in, int inLen);
481 WOLFSSL_API int wolfSSL_EVP_DecodeBlock(unsigned char *out,
482 const unsigned char *in, int inLen);
483 #endif /* WOLFSSL_BASE64_ENCODE */
484
485 #if defined(WOLFSSL_BASE64_DECODE)
486 WOLFSSL_API void wolfSSL_EVP_DecodeInit(WOLFSSL_EVP_ENCODE_CTX* ctx);
487 WOLFSSL_API int wolfSSL_EVP_DecodeUpdate(WOLFSSL_EVP_ENCODE_CTX* ctx,
488 unsigned char*out, int *outl, const unsigned char*in, int inl);
489 WOLFSSL_API int wolfSSL_EVP_DecodeFinal(WOLFSSL_EVP_ENCODE_CTX* ctx,
490 unsigned char*out, int *outl);
491 #endif /* WOLFSSL_BASE64_DECODE */
492
493 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2b512(void);
494 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_blake2s256(void);
495
496 WOLFSSL_API void wolfSSL_EVP_init(void);
497 WOLFSSL_API int wolfSSL_EVP_MD_size(const WOLFSSL_EVP_MD* type);
498 WOLFSSL_API int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type);
499 WOLFSSL_API int wolfSSL_EVP_MD_block_size(const WOLFSSL_EVP_MD* type);
500 WOLFSSL_API int wolfSSL_EVP_MD_pkey_type(const WOLFSSL_EVP_MD* type);
501
502 WOLFSSL_API WOLFSSL_EVP_MD_CTX *wolfSSL_EVP_MD_CTX_new (void);
503 WOLFSSL_API void wolfSSL_EVP_MD_CTX_free(WOLFSSL_EVP_MD_CTX* ctx);
504 WOLFSSL_API void wolfSSL_EVP_MD_CTX_init(WOLFSSL_EVP_MD_CTX* ctx);
505 WOLFSSL_API int wolfSSL_EVP_MD_CTX_cleanup(WOLFSSL_EVP_MD_CTX* ctx);
506 WOLFSSL_API int wolfSSL_EVP_MD_CTX_copy(WOLFSSL_EVP_MD_CTX *out, const WOLFSSL_EVP_MD_CTX *in);
507 WOLFSSL_API int wolfSSL_EVP_MD_CTX_copy_ex(WOLFSSL_EVP_MD_CTX *out, const WOLFSSL_EVP_MD_CTX *in);
508 WOLFSSL_API int wolfSSL_EVP_MD_CTX_type(const WOLFSSL_EVP_MD_CTX *ctx);
509 WOLFSSL_API int wolfSSL_EVP_MD_CTX_size(const WOLFSSL_EVP_MD_CTX *ctx);
510 WOLFSSL_API int wolfSSL_EVP_MD_CTX_block_size(const WOLFSSL_EVP_MD_CTX *ctx);
511 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_MD_CTX_md(const WOLFSSL_EVP_MD_CTX *ctx);
512 WOLFSSL_API const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_get_cipherbyname(const char *name);
513 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_EVP_get_digestbyname(const char *name);
514 WOLFSSL_API int wolfSSL_EVP_CIPHER_nid(const WOLFSSL_EVP_CIPHER *cipher);
515
516 WOLFSSL_API int wolfSSL_EVP_DigestInit(WOLFSSL_EVP_MD_CTX* ctx,
517 const WOLFSSL_EVP_MD* type);
518 WOLFSSL_API int wolfSSL_EVP_DigestUpdate(WOLFSSL_EVP_MD_CTX* ctx, const void* data,
519 size_t sz);
520 WOLFSSL_API int wolfSSL_EVP_DigestFinal(WOLFSSL_EVP_MD_CTX* ctx, unsigned char* md,
521 unsigned int* s);
522 WOLFSSL_API int wolfSSL_EVP_DigestFinal_ex(WOLFSSL_EVP_MD_CTX* ctx,
523 unsigned char* md, unsigned int* s);
524 WOLFSSL_API int wolfSSL_EVP_DigestSignUpdate(WOLFSSL_EVP_MD_CTX *ctx,
525 const void *d, unsigned int cnt);
526 WOLFSSL_API int wolfSSL_EVP_DigestSignFinal(WOLFSSL_EVP_MD_CTX *ctx,
527 unsigned char *sig, size_t *siglen);
528 WOLFSSL_API int wolfSSL_EVP_DigestVerifyUpdate(WOLFSSL_EVP_MD_CTX *ctx,
529 const void *d, size_t cnt);
530 WOLFSSL_API int wolfSSL_EVP_DigestVerifyFinal(WOLFSSL_EVP_MD_CTX *ctx,
531 const unsigned char *sig,
532 size_t siglen);
533
534 WOLFSSL_API int wolfSSL_EVP_BytesToKey(const WOLFSSL_EVP_CIPHER* type,
535 const WOLFSSL_EVP_MD* md, const byte* salt,

NetBurner, Inc.
22.247 evp.h 1307

536 const byte* data, int sz, int count, byte* key, byte* iv);
537
538 WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_init(WOLFSSL_EVP_CIPHER_CTX* ctx);
539 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_cleanup(WOLFSSL_EVP_CIPHER_CTX* ctx);
540 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_ctrl(WOLFSSL_EVP_CIPHER_CTX *ctx, \
541 int type, int arg, void *ptr);
542 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_iv_length(
543 const WOLFSSL_EVP_CIPHER_CTX* ctx);
544 WOLFSSL_API int wolfSSL_EVP_CIPHER_iv_length(const WOLFSSL_EVP_CIPHER* cipher);
545 WOLFSSL_API int wolfSSL_EVP_Cipher_key_length(const WOLFSSL_EVP_CIPHER* c);
546
547
548 WOLFSSL_API int wolfSSL_EVP_CipherInit(WOLFSSL_EVP_CIPHER_CTX* ctx,
549 const WOLFSSL_EVP_CIPHER* type,
550 const unsigned char* key,
551 const unsigned char* iv,
552 int enc);
553 WOLFSSL_API int wolfSSL_EVP_CipherUpdate(WOLFSSL_EVP_CIPHER_CTX *ctx,
554 unsigned char *out, int *outl,
555 const unsigned char *in, int inl);
556 WOLFSSL_API int wolfSSL_EVP_CipherFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
557 unsigned char *out, int *outl);
558 WOLFSSL_API int wolfSSL_EVP_CipherFinal_ex(WOLFSSL_EVP_CIPHER_CTX *ctx,
559 unsigned char *out, int *outl, int enc);
560 WOLFSSL_API int wolfSSL_EVP_EncryptFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
561 unsigned char *out, int *outl);
562 WOLFSSL_API int wolfSSL_EVP_EncryptFinal_ex(WOLFSSL_EVP_CIPHER_CTX *ctx,
563 unsigned char *out, int *outl);
564 WOLFSSL_API int wolfSSL_EVP_DecryptFinal(WOLFSSL_EVP_CIPHER_CTX *ctx,
565 unsigned char *out, int *outl);
566 WOLFSSL_API int wolfSSL_EVP_DecryptFinal_ex(WOLFSSL_EVP_CIPHER_CTX *ctx,
567 unsigned char *out, int *outl);
568 WOLFSSL_API int wolfSSL_EVP_DecryptFinal_legacy(WOLFSSL_EVP_CIPHER_CTX *ctx,
569 unsigned char *out, int *outl);
570
571 WOLFSSL_API WOLFSSL_EVP_CIPHER_CTX *wolfSSL_EVP_CIPHER_CTX_new(void);
572 WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_free(WOLFSSL_EVP_CIPHER_CTX *ctx);
573 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_reset(WOLFSSL_EVP_CIPHER_CTX *ctx);
574 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_key_length(WOLFSSL_EVP_CIPHER_CTX* ctx);
575 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_key_length(WOLFSSL_EVP_CIPHER_CTX* ctx,
576 int keylen);
577 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_iv_length(WOLFSSL_EVP_CIPHER_CTX* ctx,
578 int ivLen);
579 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, byte* iv,
580 int ivLen);
581 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_get_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, byte* iv,
582 int ivLen);
583 WOLFSSL_API int wolfSSL_EVP_Cipher(WOLFSSL_EVP_CIPHER_CTX* ctx,
584 unsigned char* dst, unsigned char* src,
585 unsigned int len);
586
587 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_EVP_get_cipherbynid(int id);
588 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_EVP_get_digestbynid(int id);
589 WOLFSSL_API const WOLFSSL_EVP_CIPHER *wolfSSL_EVP_CIPHER_CTX_cipher(const WOLFSSL_EVP_CIPHER_CTX *ctx);
590
591 WOLFSSL_API int wolfSSL_EVP_PKEY_assign_RSA(WOLFSSL_EVP_PKEY* pkey,
592 WOLFSSL_RSA* key);
593 WOLFSSL_API int wolfSSL_EVP_PKEY_assign_EC_KEY(WOLFSSL_EVP_PKEY* pkey,
594 WOLFSSL_EC_KEY* key);
595 WOLFSSL_API int wolfSSL_EVP_PKEY_assign_DSA(WOLFSSL_EVP_PKEY* pkey, WOLFSSL_DSA* key);
596 WOLFSSL_API int wolfSSL_EVP_PKEY_assign_DH(WOLFSSL_EVP_PKEY* pkey, WOLFSSL_DH* key);
597 WOLFSSL_API WOLFSSL_RSA* wolfSSL_EVP_PKEY_get0_RSA(WOLFSSL_EVP_PKEY *pkey);
598 WOLFSSL_API WOLFSSL_DSA* wolfSSL_EVP_PKEY_get0_DSA(WOLFSSL_EVP_PKEY *pkey);
599 WOLFSSL_API WOLFSSL_RSA* wolfSSL_EVP_PKEY_get1_RSA(WOLFSSL_EVP_PKEY* key);
600 WOLFSSL_API WOLFSSL_DSA* wolfSSL_EVP_PKEY_get1_DSA(WOLFSSL_EVP_PKEY* key);
601 WOLFSSL_API WOLFSSL_EC_KEY *wolfSSL_EVP_PKEY_get0_EC_KEY(WOLFSSL_EVP_PKEY *pkey);
602 WOLFSSL_API WOLFSSL_EC_KEY *wolfSSL_EVP_PKEY_get1_EC_KEY(WOLFSSL_EVP_PKEY *key);
603 WOLFSSL_API WOLFSSL_DH* wolfSSL_EVP_PKEY_get0_DH(WOLFSSL_EVP_PKEY* key);
604 WOLFSSL_API WOLFSSL_DH* wolfSSL_EVP_PKEY_get1_DH(WOLFSSL_EVP_PKEY* key);
605 WOLFSSL_API int wolfSSL_EVP_PKEY_set1_RSA(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_RSA *key);
606 WOLFSSL_API int wolfSSL_EVP_PKEY_set1_DSA(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_DSA *key);
607 WOLFSSL_API int wolfSSL_EVP_PKEY_set1_DH(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_DH *key);
608 WOLFSSL_API int wolfSSL_EVP_PKEY_set1_EC_KEY(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_EC_KEY *key);
609 WOLFSSL_API int wolfSSL_EVP_PKEY_assign(WOLFSSL_EVP_PKEY *pkey, int type, void *key);
610
611 WOLFSSL_API const unsigned char* wolfSSL_EVP_PKEY_get0_hmac(const WOLFSSL_EVP_PKEY* pkey,
612 size_t* len);
613 WOLFSSL_API int wolfSSL_EVP_PKEY_sign_init(WOLFSSL_EVP_PKEY_CTX *ctx);
614 WOLFSSL_API int wolfSSL_EVP_PKEY_sign(WOLFSSL_EVP_PKEY_CTX *ctx,
615 unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen);
616 WOLFSSL_API int wolfSSL_EVP_PKEY_verify_init(WOLFSSL_EVP_PKEY_CTX *ctx);
617 WOLFSSL_API int wolfSSL_EVP_PKEY_verify(WOLFSSL_EVP_PKEY_CTX *ctx, const unsigned char *sig,
618 size_t siglen, const unsigned char *tbs, size_t tbslen);
619 WOLFSSL_API int wolfSSL_EVP_PKEY_paramgen_init(WOLFSSL_EVP_PKEY_CTX *ctx);
620 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_ec_paramgen_curve_nid(WOLFSSL_EVP_PKEY_CTX *ctx,
621 int nid);
622 WOLFSSL_API int wolfSSL_EVP_PKEY_paramgen(WOLFSSL_EVP_PKEY_CTX* ctx,

NetBurner, Inc.
1308 File Documentation

623 WOLFSSL_EVP_PKEY** pkey);


624 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_ec_param_enc(WOLFSSL_EVP_PKEY_CTX *ctx,
625 int flag);
626 WOLFSSL_API int wolfSSL_EVP_PKEY_keygen_init(WOLFSSL_EVP_PKEY_CTX *ctx);
627 WOLFSSL_API int wolfSSL_EVP_PKEY_keygen(WOLFSSL_EVP_PKEY_CTX *ctx,
628 WOLFSSL_EVP_PKEY **ppkey);
629 WOLFSSL_API int wolfSSL_EVP_PKEY_bits(const WOLFSSL_EVP_PKEY *pkey);
630 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
631 WOLFSSL_API void wolfSSL_EVP_PKEY_CTX_free(WOLFSSL_EVP_PKEY_CTX *ctx);
632 #else
633 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_free(WOLFSSL_EVP_PKEY_CTX *ctx);
634 #endif
635 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_rsa_padding(WOLFSSL_EVP_PKEY_CTX *ctx, int padding);
636 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_signature_md(WOLFSSL_EVP_PKEY_CTX *ctx,
637 const WOLFSSL_EVP_MD* md);
638 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_rsa_keygen_bits(WOLFSSL_EVP_PKEY_CTX *ctx, int bits);
639
640 WOLFSSL_API int wolfSSL_EVP_PKEY_derive_init(WOLFSSL_EVP_PKEY_CTX *ctx);
641 WOLFSSL_API int wolfSSL_EVP_PKEY_derive_set_peer(WOLFSSL_EVP_PKEY_CTX *ctx, WOLFSSL_EVP_PKEY *peer);
642 WOLFSSL_API int wolfSSL_EVP_PKEY_derive(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);
643
644 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_ctrl_str(WOLFSSL_EVP_PKEY_CTX *ctx,
645 const char *name, const char *value);
646
647 WOLFSSL_API int wolfSSL_EVP_PKEY_decrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
648 unsigned char *out, size_t *outlen,
649 const unsigned char *in, size_t inlen);
650 WOLFSSL_API int wolfSSL_EVP_PKEY_decrypt_init(WOLFSSL_EVP_PKEY_CTX *ctx);
651 WOLFSSL_API int wolfSSL_EVP_PKEY_encrypt(WOLFSSL_EVP_PKEY_CTX *ctx,
652 unsigned char *out, size_t *outlen,
653 const unsigned char *in, size_t inlen);
654 WOLFSSL_API int wolfSSL_EVP_PKEY_encrypt_init(WOLFSSL_EVP_PKEY_CTX *ctx);
655 WOLFSSL_API WOLFSSL_EVP_PKEY *wolfSSL_EVP_PKEY_new(void);
656 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_EVP_PKEY_new_ex(void* heap);
657 WOLFSSL_API void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY* key);
658 WOLFSSL_API int wolfSSL_EVP_PKEY_size(WOLFSSL_EVP_PKEY *pkey);
659 WOLFSSL_API int wolfSSL_EVP_PKEY_copy_parameters(WOLFSSL_EVP_PKEY *to, const WOLFSSL_EVP_PKEY *from);
660 WOLFSSL_API int wolfSSL_EVP_PKEY_missing_parameters(WOLFSSL_EVP_PKEY *pkey);
661 WOLFSSL_API int wolfSSL_EVP_PKEY_cmp(const WOLFSSL_EVP_PKEY *a, const WOLFSSL_EVP_PKEY *b);
662 WOLFSSL_API int wolfSSL_EVP_PKEY_type(int type);
663 WOLFSSL_API int wolfSSL_EVP_PKEY_id(const WOLFSSL_EVP_PKEY *pkey);
664 WOLFSSL_API int wolfSSL_EVP_PKEY_base_id(const WOLFSSL_EVP_PKEY *pkey);
665 WOLFSSL_API int wolfSSL_EVP_PKEY_get_default_digest_nid(WOLFSSL_EVP_PKEY *pkey, int *pnid);
666 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_EVP_PKCS82PKEY(const WOLFSSL_PKCS8_PRIV_KEY_INFO* p8);
667 WOLFSSL_API WOLFSSL_PKCS8_PRIV_KEY_INFO* wolfSSL_EVP_PKEY2PKCS8(const WOLFSSL_EVP_PKEY* pkey);
668
669 WOLFSSL_API int wolfSSL_EVP_SignFinal(WOLFSSL_EVP_MD_CTX *ctx, unsigned char *sigret,
670 unsigned int *siglen, WOLFSSL_EVP_PKEY *pkey);
671 WOLFSSL_API int wolfSSL_EVP_SignInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
672 WOLFSSL_API int wolfSSL_EVP_SignUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
673 WOLFSSL_API int wolfSSL_EVP_VerifyFinal(WOLFSSL_EVP_MD_CTX *ctx,
674 const unsigned char* sig, unsigned int sig_len, WOLFSSL_EVP_PKEY *pkey);
675 WOLFSSL_API int wolfSSL_EVP_VerifyInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type);
676 WOLFSSL_API int wolfSSL_EVP_VerifyUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len);
677
678
679 /* these next ones don’t need real OpenSSL type, for OpenSSH compat only */
680 WOLFSSL_API void* wolfSSL_EVP_X_STATE(const WOLFSSL_EVP_CIPHER_CTX* ctx);
681 WOLFSSL_API int wolfSSL_EVP_X_STATE_LEN(const WOLFSSL_EVP_CIPHER_CTX* ctx);
682
683 WOLFSSL_API void wolfSSL_3des_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, int doset,
684 unsigned char* iv, int len);
685 WOLFSSL_API void wolfSSL_aes_ctr_iv(WOLFSSL_EVP_CIPHER_CTX* ctx, int doset,
686 unsigned char* iv, int len);
687
688 WOLFSSL_API int wolfSSL_StoreExternalIV(WOLFSSL_EVP_CIPHER_CTX* ctx);
689 WOLFSSL_API int wolfSSL_SetInternalIV(WOLFSSL_EVP_CIPHER_CTX* ctx);
690
691 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_block_size(const WOLFSSL_EVP_CIPHER_CTX *ctx);
692 WOLFSSL_API int wolfSSL_EVP_CIPHER_block_size(const WOLFSSL_EVP_CIPHER *cipher);
693 WOLFSSL_API unsigned long WOLFSSL_EVP_CIPHER_mode(const WOLFSSL_EVP_CIPHER *cipher);
694 WOLFSSL_API unsigned long WOLFSSL_CIPHER_mode(const WOLFSSL_EVP_CIPHER *cipher);
695 WOLFSSL_API unsigned long wolfSSL_EVP_CIPHER_flags(const WOLFSSL_EVP_CIPHER *cipher);
696 WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_set_flags(WOLFSSL_EVP_CIPHER_CTX *ctx, int flags);
697 WOLFSSL_API void wolfSSL_EVP_CIPHER_CTX_clear_flags(WOLFSSL_EVP_CIPHER_CTX *ctx, int flags);
698 WOLFSSL_API unsigned long wolfSSL_EVP_CIPHER_CTX_flags(const WOLFSSL_EVP_CIPHER_CTX *ctx);
699 WOLFSSL_API unsigned long wolfSSL_EVP_CIPHER_CTX_mode(const WOLFSSL_EVP_CIPHER_CTX *ctx);
700 WOLFSSL_API int wolfSSL_EVP_CIPHER_CTX_set_padding(WOLFSSL_EVP_CIPHER_CTX *c, int pad);
701 WOLFSSL_API int wolfSSL_EVP_add_digest(const WOLFSSL_EVP_MD *digest);
702 WOLFSSL_API int wolfSSL_EVP_add_cipher(const WOLFSSL_EVP_CIPHER *cipher);
703 WOLFSSL_API void wolfSSL_EVP_cleanup(void);
704 WOLFSSL_API int wolfSSL_add_all_algorithms(void);
705 WOLFSSL_API int wolfSSL_OpenSSL_add_all_algorithms_conf(void);
706 WOLFSSL_API int wolfSSL_OpenSSL_add_all_algorithms_noconf(void);
707 WOLFSSL_API int wolfSSL_EVP_read_pw_string(char*, int, const char*, int);
708
709 WOLFSSL_API int wolfSSL_PKCS5_PBKDF2_HMAC_SHA1(const char * pass, int passlen,

NetBurner, Inc.
22.247 evp.h 1309

710 const unsigned char * salt,


711 int saltlen, int iter,
712 int keylen, unsigned char *out);
713
714 WOLFSSL_API int wolfSSL_PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
715 const unsigned char *salt,
716 int saltlen, int iter,
717 const WOLFSSL_EVP_MD *digest,
718 int keylen, unsigned char *out);
719
720 #if defined(HAVE_SCRYPT) && defined(HAVE_PBKDF2) && !defined(NO_PWDBASED) && \
721 !defined(NO_SHA)
722 WOLFSSL_API int wolfSSL_EVP_PBE_scrypt(const char *pass, size_t passlen,
723 const unsigned char *salt, size_t saltlen,
724 word64 N, word64 r, word64 p,
725 word64 maxmem, unsigned char *key, size_t keylen);
726 #endif /* HAVE_SCRYPT && HAVE_PBKDF2 && !NO_PWDBASED && !NO_SHA */
727
728 WOLFSSL_LOCAL int wolfSSL_EVP_get_hashinfo(const WOLFSSL_EVP_MD* evp,
729 int* pHash, int* pHashSz);
730
731 WOLFSSL_API void wolfSSL_EVP_MD_do_all(void (*fn) (const WOLFSSL_EVP_MD *md,
732 const char* from, const char* to,
733 void* xx), void* args);
734
735 #ifdef HAVE_HKDF
736 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set_hkdf_md(WOLFSSL_EVP_PKEY_CTX* ctx,
737 const WOLFSSL_EVP_MD* md);
738 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set1_hkdf_salt(WOLFSSL_EVP_PKEY_CTX* ctx,
739 byte* salt, int saltSz);
740 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_set1_hkdf_key(WOLFSSL_EVP_PKEY_CTX* ctx,
741 byte* key, int keySz);
742 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_add1_hkdf_info(WOLFSSL_EVP_PKEY_CTX* ctx,
743 byte* info, int infoSz);
744 WOLFSSL_API int wolfSSL_EVP_PKEY_CTX_hkdf_mode(WOLFSSL_EVP_PKEY_CTX* ctx,
745 int mode);
746 #endif
747
748 #define WOLFSSL_EVP_CIPH_MODE 0x0007
749 #define WOLFSSL_EVP_CIPH_STREAM_CIPHER 0x0
750 #define WOLFSSL_EVP_CIPH_ECB_MODE 0x1
751 #define WOLFSSL_EVP_CIPH_CBC_MODE 0x2
752 #define WOLFSSL_EVP_CIPH_CFB_MODE 0x3
753 #define WOLFSSL_EVP_CIPH_OFB_MODE 0x4
754 #define WOLFSSL_EVP_CIPH_CTR_MODE 0x5
755 #define WOLFSSL_EVP_CIPH_GCM_MODE 0x6
756 #define WOLFSSL_EVP_CIPH_CCM_MODE 0x7
757 #define WOLFSSL_EVP_CIPH_XTS_MODE 0x10
758 #define WOLFSSL_EVP_CIPH_FLAG_AEAD_CIPHER 0x20
759 #define WOLFSSL_EVP_CIPH_NO_PADDING 0x100
760 #define WOLFSSL_EVP_CIPH_VARIABLE_LENGTH 0x200
761 #define WOLFSSL_EVP_CIPH_TYPE_INIT 0xff
762
763
764 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
765
766 /* EVP ENGINE API’s */
767 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_EVP_PKEY_new_mac_key(int type, WOLFSSL_ENGINE* e,
768 const unsigned char* key, int keylen);
769 WOLFSSL_API int wolfSSL_EVP_DigestInit_ex(WOLFSSL_EVP_MD_CTX* ctx,
770 const WOLFSSL_EVP_MD* type,
771 WOLFSSL_ENGINE *impl);
772
773 WOLFSSL_API int wolfSSL_EVP_DigestSignInit(WOLFSSL_EVP_MD_CTX *ctx,
774 WOLFSSL_EVP_PKEY_CTX **pctx,
775 const WOLFSSL_EVP_MD *type,
776 WOLFSSL_ENGINE *e,
777 WOLFSSL_EVP_PKEY *pkey);
778 WOLFSSL_API int wolfSSL_EVP_DigestVerifyInit(WOLFSSL_EVP_MD_CTX *ctx,
779 WOLFSSL_EVP_PKEY_CTX **pctx,
780 const WOLFSSL_EVP_MD *type,
781 WOLFSSL_ENGINE *e,
782 WOLFSSL_EVP_PKEY *pkey);
783 WOLFSSL_API int wolfSSL_EVP_Digest(const unsigned char* in, int inSz, unsigned char* out,
784 unsigned int* outSz, const WOLFSSL_EVP_MD* evp,
785 WOLFSSL_ENGINE* eng);
786 WOLFSSL_API int wolfSSL_EVP_CipherInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
787 const WOLFSSL_EVP_CIPHER* type,
788 WOLFSSL_ENGINE *impl,
789 const unsigned char* key,
790 const unsigned char* iv,
791 int enc);
792 WOLFSSL_API int wolfSSL_EVP_EncryptInit(WOLFSSL_EVP_CIPHER_CTX* ctx,
793 const WOLFSSL_EVP_CIPHER* type,
794 const unsigned char* key,
795 const unsigned char* iv);
796 WOLFSSL_API int wolfSSL_EVP_EncryptInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,

NetBurner, Inc.
1310 File Documentation

797 const WOLFSSL_EVP_CIPHER* type,


798 WOLFSSL_ENGINE *impl,
799 const unsigned char* key,
800 const unsigned char* iv);
801 WOLFSSL_API int wolfSSL_EVP_DecryptInit(WOLFSSL_EVP_CIPHER_CTX* ctx,
802 const WOLFSSL_EVP_CIPHER* type,
803 const unsigned char* key,
804 const unsigned char* iv);
805 WOLFSSL_API int wolfSSL_EVP_DecryptInit_ex(WOLFSSL_EVP_CIPHER_CTX* ctx,
806 const WOLFSSL_EVP_CIPHER* type,
807 WOLFSSL_ENGINE *impl,
808 const unsigned char* key,
809 const unsigned char* iv);
810 WOLFSSL_API WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new(WOLFSSL_EVP_PKEY *pkey, WOLFSSL_ENGINE *e);
811 WOLFSSL_API WOLFSSL_EVP_PKEY_CTX *wolfSSL_EVP_PKEY_CTX_new_id(int id, WOLFSSL_ENGINE *e);
812 WOLFSSL_API int wolfSSL_EVP_SignInit_ex(WOLFSSL_EVP_MD_CTX* ctx,
813 const WOLFSSL_EVP_MD* type,
814 WOLFSSL_ENGINE *impl);
815
816 #define EVP_CIPH_STREAM_CIPHER WOLFSSL_EVP_CIPH_STREAM_CIPHER
817 #define EVP_CIPH_VARIABLE_LENGTH WOLFSSL_EVP_CIPH_VARIABLE_LENGTH
818 #define EVP_CIPH_ECB_MODE WOLFSSL_EVP_CIPH_ECB_MODE
819 #define EVP_CIPH_CBC_MODE WOLFSSL_EVP_CIPH_CBC_MODE
820 #define EVP_CIPH_CFB_MODE WOLFSSL_EVP_CIPH_CFB_MODE
821 #define EVP_CIPH_OFB_MODE WOLFSSL_EVP_CIPH_OFB_MODE
822 #define EVP_CIPH_CTR_MODE WOLFSSL_EVP_CIPH_CTR_MODE
823 #define EVP_CIPH_GCM_MODE WOLFSSL_EVP_CIPH_GCM_MODE
824 #define EVP_CIPH_CCM_MODE WOLFSSL_EVP_CIPH_CCM_MODE
825 #define EVP_CIPH_XTS_MODE WOLFSSL_EVP_CIPH_XTS_MODE
826
827 #define EVP_CIPH_FLAG_AEAD_CIPHER WOLFSSL_EVP_CIPH_FLAG_AEAD_CIPHER
828
829 #ifndef NO_MD4
830 #define EVP_md4 wolfSSL_EVP_md4
831 #endif
832 #ifndef NO_MD5
833 #define EVP_md5 wolfSSL_EVP_md5
834 #endif
835 #define EVP_sha1 wolfSSL_EVP_sha1
836 #define EVP_mdc2 wolfSSL_EVP_mdc2
837 #define EVP_dds1 wolfSSL_EVP_sha1
838 #define EVP_sha224 wolfSSL_EVP_sha224
839 #define EVP_sha256 wolfSSL_EVP_sha256
840 #define EVP_sha384 wolfSSL_EVP_sha384
841 #define EVP_sha512 wolfSSL_EVP_sha512
842 #define EVP_sha512_224 wolfSSL_EVP_sha512_224
843 #define EVP_sha512_256 wolfSSL_EVP_sha512_256
844 #define EVP_ripemd160 wolfSSL_EVP_ripemd160
845 #define EVP_shake128 wolfSSL_EVP_shake128
846 #define EVP_shake256 wolfSSL_EVP_shake256
847 #define EVP_set_pw_prompt wolfSSL_EVP_set_pw_prompt
848
849 #define EVP_sha3_224 wolfSSL_EVP_sha3_224
850 #define EVP_sha3_256 wolfSSL_EVP_sha3_256
851 #define EVP_sha3_384 wolfSSL_EVP_sha3_384
852 #define EVP_sha3_512 wolfSSL_EVP_sha3_512
853
854 #define EVP_aes_128_cbc wolfSSL_EVP_aes_128_cbc
855 #define EVP_aes_192_cbc wolfSSL_EVP_aes_192_cbc
856 #define EVP_aes_256_cbc wolfSSL_EVP_aes_256_cbc
857 #define EVP_aes_128_cfb1 wolfSSL_EVP_aes_128_cfb1
858 #define EVP_aes_192_cfb1 wolfSSL_EVP_aes_192_cfb1
859 #define EVP_aes_256_cfb1 wolfSSL_EVP_aes_256_cfb1
860 #define EVP_aes_128_cfb8 wolfSSL_EVP_aes_128_cfb8
861 #define EVP_aes_192_cfb8 wolfSSL_EVP_aes_192_cfb8
862 #define EVP_aes_256_cfb8 wolfSSL_EVP_aes_256_cfb8
863 #define EVP_aes_128_cfb128 wolfSSL_EVP_aes_128_cfb128
864 #define EVP_aes_192_cfb128 wolfSSL_EVP_aes_192_cfb128
865 #define EVP_aes_256_cfb128 wolfSSL_EVP_aes_256_cfb128
866 #define EVP_aes_128_cfb wolfSSL_EVP_aes_128_cfb128
867 #define EVP_aes_192_cfb wolfSSL_EVP_aes_192_cfb128
868 #define EVP_aes_256_cfb wolfSSL_EVP_aes_256_cfb128
869 #define EVP_aes_128_ofb wolfSSL_EVP_aes_128_ofb
870 #define EVP_aes_192_ofb wolfSSL_EVP_aes_192_ofb
871 #define EVP_aes_256_ofb wolfSSL_EVP_aes_256_ofb
872 #define EVP_aes_128_xts wolfSSL_EVP_aes_128_xts
873 #define EVP_aes_256_xts wolfSSL_EVP_aes_256_xts
874 #define EVP_aes_128_gcm wolfSSL_EVP_aes_128_gcm
875 #define EVP_aes_192_gcm wolfSSL_EVP_aes_192_gcm
876 #define EVP_aes_256_gcm wolfSSL_EVP_aes_256_gcm
877 #define EVP_aes_128_ecb wolfSSL_EVP_aes_128_ecb
878 #define EVP_aes_192_ecb wolfSSL_EVP_aes_192_ecb
879 #define EVP_aes_256_ecb wolfSSL_EVP_aes_256_ecb
880 #define EVP_aes_128_ctr wolfSSL_EVP_aes_128_ctr
881 #define EVP_aes_192_ctr wolfSSL_EVP_aes_192_ctr
882 #define EVP_aes_256_ctr wolfSSL_EVP_aes_256_ctr
883 #define EVP_des_cbc wolfSSL_EVP_des_cbc

NetBurner, Inc.
22.247 evp.h 1311

884 #define EVP_des_ecb wolfSSL_EVP_des_ecb


885 #define EVP_des_ede3_cbc wolfSSL_EVP_des_ede3_cbc
886 #define EVP_des_ede3_ecb wolfSSL_EVP_des_ede3_ecb
887 #define EVP_rc4 wolfSSL_EVP_rc4
888 #define EVP_chacha20_poly1305 wolfSSL_EVP_chacha20_poly1305
889 #define EVP_enc_null wolfSSL_EVP_enc_null
890
891 #define EVP_MD_size wolfSSL_EVP_MD_size
892 #define EVP_MD_pkey_type wolfSSL_EVP_MD_pkey_type
893 #define EVP_MD_CTX_new wolfSSL_EVP_MD_CTX_new
894 #define EVP_MD_CTX_create wolfSSL_EVP_MD_CTX_new
895 #define EVP_MD_CTX_free wolfSSL_EVP_MD_CTX_free
896 #define EVP_MD_CTX_destroy wolfSSL_EVP_MD_CTX_free
897 #define EVP_MD_CTX_init wolfSSL_EVP_MD_CTX_init
898 #define EVP_MD_CTX_cleanup wolfSSL_EVP_MD_CTX_cleanup
899 #define EVP_MD_CTX_reset wolfSSL_EVP_MD_CTX_cleanup
900 #define EVP_MD_CTX_md wolfSSL_EVP_MD_CTX_md
901 #define EVP_MD_CTX_type wolfSSL_EVP_MD_CTX_type
902 #define EVP_MD_CTX_size wolfSSL_EVP_MD_CTX_size
903 #define EVP_MD_CTX_block_size wolfSSL_EVP_MD_CTX_block_size
904 #define EVP_MD_block_size wolfSSL_EVP_MD_block_size
905 #define EVP_MD_type wolfSSL_EVP_MD_type
906 #ifndef NO_WOLFSSL_STUB
907 #define EVP_MD_CTX_set_flags(...)
908 #endif
909
910 #define EVP_Digest wolfSSL_EVP_Digest
911 #define EVP_DigestInit wolfSSL_EVP_DigestInit
912 #define EVP_DigestInit_ex wolfSSL_EVP_DigestInit_ex
913 #define EVP_DigestUpdate wolfSSL_EVP_DigestUpdate
914 #define EVP_DigestFinal wolfSSL_EVP_DigestFinal
915 #define EVP_DigestFinal_ex wolfSSL_EVP_DigestFinal_ex
916 #define EVP_DigestSignInit wolfSSL_EVP_DigestSignInit
917 #define EVP_DigestSignUpdate wolfSSL_EVP_DigestSignUpdate
918 #define EVP_DigestSignFinal wolfSSL_EVP_DigestSignFinal
919 #define EVP_DigestVerifyInit wolfSSL_EVP_DigestVerifyInit
920 #define EVP_DigestVerifyUpdate wolfSSL_EVP_DigestVerifyUpdate
921 #define EVP_DigestVerifyFinal wolfSSL_EVP_DigestVerifyFinal
922 #define EVP_BytesToKey wolfSSL_EVP_BytesToKey
923
924 #define EVP_get_cipherbyname wolfSSL_EVP_get_cipherbyname
925 #define EVP_get_digestbyname wolfSSL_EVP_get_digestbyname
926
927 #define EVP_CIPHER_CTX_init wolfSSL_EVP_CIPHER_CTX_init
928 #define EVP_CIPHER_CTX_cleanup wolfSSL_EVP_CIPHER_CTX_cleanup
929 #define EVP_CIPHER_CTX_iv_length wolfSSL_EVP_CIPHER_CTX_iv_length
930 #define EVP_CIPHER_CTX_key_length wolfSSL_EVP_CIPHER_CTX_key_length
931 #define EVP_CIPHER_CTX_set_key_length wolfSSL_EVP_CIPHER_CTX_set_key_length
932 #define EVP_CIPHER_CTX_set_iv_length wolfSSL_EVP_CIPHER_CTX_set_iv_length
933 #define EVP_CIPHER_CTX_mode wolfSSL_EVP_CIPHER_CTX_mode
934 #define EVP_CIPHER_CTX_cipher wolfSSL_EVP_CIPHER_CTX_cipher
935
936 #define EVP_CIPHER_iv_length wolfSSL_EVP_CIPHER_iv_length
937 #define EVP_CIPHER_key_length wolfSSL_EVP_Cipher_key_length
938
939 #define EVP_CipherInit wolfSSL_EVP_CipherInit
940 #define EVP_CipherInit_ex wolfSSL_EVP_CipherInit_ex
941 #define EVP_EncryptInit wolfSSL_EVP_EncryptInit
942 #define EVP_EncryptInit_ex wolfSSL_EVP_EncryptInit_ex
943 #define EVP_DecryptInit wolfSSL_EVP_DecryptInit
944 #define EVP_DecryptInit_ex wolfSSL_EVP_DecryptInit_ex
945
946 #define EVP_Cipher wolfSSL_EVP_Cipher
947 #define EVP_CipherUpdate wolfSSL_EVP_CipherUpdate
948 #define EVP_EncryptUpdate wolfSSL_EVP_CipherUpdate
949 #define EVP_DecryptUpdate wolfSSL_EVP_CipherUpdate
950 #define EVP_CipherFinal wolfSSL_EVP_CipherFinal
951 #define EVP_CipherFinal_ex wolfSSL_EVP_CipherFinal
952 #define EVP_EncryptFinal wolfSSL_EVP_CipherFinal
953 #define EVP_EncryptFinal_ex wolfSSL_EVP_CipherFinal
954 #define EVP_DecryptFinal wolfSSL_EVP_CipherFinal
955 #define EVP_DecryptFinal_ex wolfSSL_EVP_CipherFinal
956
957 #define EVP_CIPHER_CTX_free wolfSSL_EVP_CIPHER_CTX_free
958 #define EVP_CIPHER_CTX_reset wolfSSL_EVP_CIPHER_CTX_reset
959 #define EVP_CIPHER_CTX_new wolfSSL_EVP_CIPHER_CTX_new
960
961 #define EVP_get_cipherbynid wolfSSL_EVP_get_cipherbynid
962 #define EVP_get_digestbynid wolfSSL_EVP_get_digestbynid
963 #define EVP_MD_nid wolfSSL_EVP_MD_type
964 #define EVP_get_cipherbyname wolfSSL_EVP_get_cipherbyname
965 #define EVP_get_digestbyname wolfSSL_EVP_get_digestbyname
966
967 #define EVP_PKEY_assign wolfSSL_EVP_PKEY_assign
968 #define EVP_PKEY_assign_RSA wolfSSL_EVP_PKEY_assign_RSA
969 #define EVP_PKEY_assign_DSA wolfSSL_EVP_PKEY_assign_DSA
970 #define EVP_PKEY_assign_DH wolfSSL_EVP_PKEY_assign_DH

NetBurner, Inc.
1312 File Documentation

971 #define EVP_PKEY_assign_EC_KEY wolfSSL_EVP_PKEY_assign_EC_KEY


972 #define EVP_PKEY_get1_DSA wolfSSL_EVP_PKEY_get1_DSA
973 #define EVP_PKEY_set1_DSA wolfSSL_EVP_PKEY_set1_DSA
974 #define EVP_PKEY_get0_RSA wolfSSL_EVP_PKEY_get0_RSA
975 #define EVP_PKEY_get1_RSA wolfSSL_EVP_PKEY_get1_RSA
976 #define EVP_PKEY_set1_RSA wolfSSL_EVP_PKEY_set1_RSA
977 #define EVP_PKEY_set1_EC_KEY wolfSSL_EVP_PKEY_set1_EC_KEY
978 #define EVP_PKEY_get1_EC_KEY wolfSSL_EVP_PKEY_get1_EC_KEY
979 #define EVP_PKEY_set1_DH wolfSSL_EVP_PKEY_set1_DH
980 #define EVP_PKEY_get0_DH wolfSSL_EVP_PKEY_get0_DH
981 #define EVP_PKEY_get1_DH wolfSSL_EVP_PKEY_get1_DH
982 #define EVP_PKEY_get0_EC_KEY wolfSSL_EVP_PKEY_get0_EC_KEY
983 #define EVP_PKEY_get0_hmac wolfSSL_EVP_PKEY_get0_hmac
984 #define EVP_PKEY_new_mac_key wolfSSL_EVP_PKEY_new_mac_key
985 #define EVP_MD_CTX_copy wolfSSL_EVP_MD_CTX_copy
986 #define EVP_MD_CTX_copy_ex wolfSSL_EVP_MD_CTX_copy_ex
987 #define EVP_PKEY_sign_init wolfSSL_EVP_PKEY_sign_init
988 #define EVP_PKEY_sign wolfSSL_EVP_PKEY_sign
989 #define EVP_PKEY_verify_init wolfSSL_EVP_PKEY_verify_init
990 #define EVP_PKEY_verify wolfSSL_EVP_PKEY_verify
991 #define EVP_PKEY_paramgen_init wolfSSL_EVP_PKEY_paramgen_init
992 #define EVP_PKEY_CTX_set_ec_param_enc wolfSSL_EVP_PKEY_CTX_set_ec_param_enc
993 #define EVP_PKEY_CTX_set_ec_paramgen_curve_nid wolfSSL_EVP_PKEY_CTX_set_ec_paramgen_curve_nid
994 #define EVP_PKEY_paramgen wolfSSL_EVP_PKEY_paramgen
995 #define EVP_PKEY_keygen wolfSSL_EVP_PKEY_keygen
996 #define EVP_PKEY_keygen_init wolfSSL_EVP_PKEY_keygen_init
997 #define EVP_PKEY_bits wolfSSL_EVP_PKEY_bits
998 #define EVP_PKEY_CTX_free wolfSSL_EVP_PKEY_CTX_free
999 #define EVP_PKEY_CTX_new wolfSSL_EVP_PKEY_CTX_new
1000 #define EVP_PKEY_CTX_set_rsa_padding wolfSSL_EVP_PKEY_CTX_set_rsa_padding
1001 #define EVP_PKEY_CTX_set_signature_md wolfSSL_EVP_PKEY_CTX_set_signature_md
1002 #define EVP_PKEY_CTX_new_id wolfSSL_EVP_PKEY_CTX_new_id
1003 #define EVP_PKEY_CTX_set_rsa_keygen_bits wolfSSL_EVP_PKEY_CTX_set_rsa_keygen_bits
1004 #define EVP_PKEY_derive_init wolfSSL_EVP_PKEY_derive_init
1005 #define EVP_PKEY_derive_set_peer wolfSSL_EVP_PKEY_derive_set_peer
1006 #define EVP_PKEY_derive wolfSSL_EVP_PKEY_derive
1007 #define EVP_PKEY_decrypt wolfSSL_EVP_PKEY_decrypt
1008 #define EVP_PKEY_decrypt_init wolfSSL_EVP_PKEY_decrypt_init
1009 #define EVP_PKEY_encrypt wolfSSL_EVP_PKEY_encrypt
1010 #define EVP_PKEY_encrypt_init wolfSSL_EVP_PKEY_encrypt_init
1011 #define EVP_PKEY_new wolfSSL_EVP_PKEY_new
1012 #define EVP_PKEY_free wolfSSL_EVP_PKEY_free
1013 #define EVP_PKEY_up_ref wolfSSL_EVP_PKEY_up_ref
1014 #define EVP_PKEY_size wolfSSL_EVP_PKEY_size
1015 #define EVP_PKEY_copy_parameters wolfSSL_EVP_PKEY_copy_parameters
1016 #define EVP_PKEY_missing_parameters wolfSSL_EVP_PKEY_missing_parameters
1017 #define EVP_PKEY_cmp wolfSSL_EVP_PKEY_cmp
1018 #define EVP_PKEY_type wolfSSL_EVP_PKEY_type
1019 #define EVP_PKEY_base_id wolfSSL_EVP_PKEY_base_id
1020 #define EVP_PKEY_get_default_digest_nid wolfSSL_EVP_PKEY_get_default_digest_nid
1021 #define EVP_PKEY_id wolfSSL_EVP_PKEY_id
1022 #define EVP_PKEY_CTX_ctrl_str wolfSSL_EVP_PKEY_CTX_ctrl_str
1023 #define EVP_PKCS82PKEY wolfSSL_EVP_PKCS82PKEY
1024 #define EVP_PKEY2PKCS8 wolfSSL_EVP_PKEY2PKCS8
1025 #define EVP_SignFinal wolfSSL_EVP_SignFinal
1026 #define EVP_SignInit wolfSSL_EVP_SignInit
1027 #define EVP_SignInit_ex wolfSSL_EVP_SignInit_ex
1028 #define EVP_SignUpdate wolfSSL_EVP_SignUpdate
1029 #define EVP_VerifyFinal wolfSSL_EVP_VerifyFinal
1030 #define EVP_VerifyInit wolfSSL_EVP_VerifyInit
1031 #define EVP_VerifyUpdate wolfSSL_EVP_VerifyUpdate
1032
1033 #define EVP_CIPHER_CTX_ctrl wolfSSL_EVP_CIPHER_CTX_ctrl
1034 #define EVP_CIPHER_CTX_block_size wolfSSL_EVP_CIPHER_CTX_block_size
1035 #define EVP_CIPHER_block_size wolfSSL_EVP_CIPHER_block_size
1036 #define EVP_CIPHER_flags wolfSSL_EVP_CIPHER_flags
1037 #define EVP_CIPHER_CTX_set_flags wolfSSL_EVP_CIPHER_CTX_set_flags
1038 #define EVP_CIPHER_CTX_clear_flags wolfSSL_EVP_CIPHER_CTX_clear_flags
1039 #define EVP_CIPHER_CTX_set_padding wolfSSL_EVP_CIPHER_CTX_set_padding
1040 #define EVP_CIPHER_CTX_flags wolfSSL_EVP_CIPHER_CTX_flags
1041 #define EVP_CIPHER_CTX_set_iv wolfSSL_EVP_CIPHER_CTX_set_iv
1042 #define EVP_CIPHER_CTX_get_iv wolfSSL_EVP_CIPHER_CTX_get_iv
1043 #define EVP_add_digest wolfSSL_EVP_add_digest
1044 #define EVP_add_cipher wolfSSL_EVP_add_cipher
1045 #define EVP_cleanup wolfSSL_EVP_cleanup
1046 #define EVP_read_pw_string wolfSSL_EVP_read_pw_string
1047 #define EVP_rc2_cbc wolfSSL_EVP_rc2_cbc
1048
1049 #define OpenSSL_add_all_digests() wolfSSL_EVP_init()
1050 #define OpenSSL_add_all_ciphers() wolfSSL_EVP_init()
1051 #define OpenSSL_add_all_algorithms wolfSSL_add_all_algorithms
1052 #define OpenSSL_add_all_algorithms_noconf wolfSSL_OpenSSL_add_all_algorithms_noconf
1053 #define OpenSSL_add_all_algorithms_conf wolfSSL_OpenSSL_add_all_algorithms_conf
1054
1055 #define wolfSSL_OPENSSL_add_all_algorithms_noconf wolfSSL_OpenSSL_add_all_algorithms_noconf
1056 #define wolfSSL_OPENSSL_add_all_algorithms_conf wolfSSL_OpenSSL_add_all_algorithms_conf
1057

NetBurner, Inc.
22.247 evp.h 1313

1058 /* provides older OpenSSL API compatibility */


1059 #define OPENSSL_add_all_algorithms OpenSSL_add_all_algorithms
1060 #define OPENSSL_add_all_algorithms_noconf OpenSSL_add_all_algorithms_noconf
1061 #define OPENSSL_add_all_algorithms_conf OpenSSL_add_all_algorithms_conf
1062
1063 #define NO_PADDING_BLOCK_SIZE 1
1064
1065 #define PKCS5_PBKDF2_HMAC_SHA1 wolfSSL_PKCS5_PBKDF2_HMAC_SHA1
1066 #define PKCS5_PBKDF2_HMAC wolfSSL_PKCS5_PBKDF2_HMAC
1067 #define EVP_PBE_scrypt wolfSSL_EVP_PBE_scrypt
1068
1069 /* OpenSSL compat. ctrl values */
1070 #define EVP_CTRL_INIT 0x0
1071 #define EVP_CTRL_SET_KEY_LENGTH 0x1
1072 #define EVP_CTRL_SET_RC2_KEY_BITS 0x3 /* needed for qt compilation */
1073
1074 #define EVP_CTRL_AEAD_SET_IVLEN 0x9
1075 #define EVP_CTRL_AEAD_GET_TAG 0x10
1076 #define EVP_CTRL_AEAD_SET_TAG 0x11
1077 #define EVP_CTRL_AEAD_SET_IV_FIXED 0x12
1078 #define EVP_CTRL_GCM_IV_GEN 0x13
1079 #define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN
1080 #define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG
1081 #define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG
1082 #define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED
1083
1084 #define EVP_PKEY_print_public wolfSSL_EVP_PKEY_print_public
1085 #define EVP_PKEY_print_private(arg1, arg2, arg3, arg4)
1086
1087 #ifndef EVP_MAX_MD_SIZE
1088 #define EVP_MAX_MD_SIZE 64 /* sha512 */
1089 #endif
1090
1091 #ifndef EVP_MAX_KEY_LENGTH
1092 #define EVP_MAX_KEY_LENGTH 64
1093 #endif
1094
1095 #ifndef EVP_MAX_IV_LENGTH
1096 #define EVP_MAX_IV_LENGTH 16
1097 #endif
1098
1099 #ifndef EVP_MAX_BLOCK_LENGTH
1100 #define EVP_MAX_BLOCK_LENGTH 32 /* 2 * blocklen(AES)? */
1101 /* They define this as 32. Using the same value here. */
1102 #endif
1103
1104 #ifndef EVP_MAX_IV_LENGTH
1105 #define EVP_MAX_IV_LENGTH 16
1106 #endif
1107
1108
1109 #define EVP_R_BAD_DECRYPT (-MIN_CODE_E + 100 + 1)
1110 #define EVP_R_BN_DECODE_ERROR (-MIN_CODE_E + 100 + 2)
1111 #define EVP_R_DECODE_ERROR (-MIN_CODE_E + 100 + 3)
1112 #define EVP_R_PRIVATE_KEY_DECODE_ERROR (-MIN_CODE_E + 100 + 4)
1113
1114 #define EVP_PKEY_NONE NID_undef
1115 #define EVP_PKEY_DH 28
1116 #define EVP_CIPHER_mode WOLFSSL_EVP_CIPHER_mode
1117 /* WOLFSSL_EVP_CIPHER is just the string name of the cipher */
1118 #define EVP_CIPHER_name(x) x
1119 #define EVP_MD_CTX_reset wolfSSL_EVP_MD_CTX_cleanup
1120 /* WOLFSSL_EVP_MD is just the string name of the digest */
1121 #define EVP_MD_name(x) x
1122 #define EVP_CIPHER_nid wolfSSL_EVP_CIPHER_nid
1123
1124 /* Base64 encoding/decoding APIs */
1125 #if defined(WOLFSSL_BASE64_ENCODE) || defined(WOLFSSL_BASE64_DECODE)
1126 #define EVP_ENCODE_CTX WOLFSSL_EVP_ENCODE_CTX
1127 #define EVP_ENCODE_CTX_new wolfSSL_EVP_ENCODE_CTX_new
1128 #define EVP_ENCODE_CTX_free wolfSSL_EVP_ENCODE_CTX_free
1129 #endif /* WOLFSSL_BASE64_ENCODE || WOLFSSL_BASE64_DECODE*/
1130 #if defined(WOLFSSL_BASE64_ENCODE)
1131 #define EVP_EncodeInit wolfSSL_EVP_EncodeInit
1132 #define EVP_EncodeUpdate wolfSSL_EVP_EncodeUpdate
1133 #define EVP_EncodeFinal wolfSSL_EVP_EncodeFinal
1134 #define EVP_EncodeBlock wolfSSL_EVP_EncodeBlock
1135 #define EVP_DecodeBlock wolfSSL_EVP_DecodeBlock
1136 #endif /* WOLFSSL_BASE64_ENCODE */
1137 #if defined(WOLFSSL_BASE64_DECODE)
1138 #define EVP_DecodeInit wolfSSL_EVP_DecodeInit
1139 #define EVP_DecodeUpdate wolfSSL_EVP_DecodeUpdate
1140 #define EVP_DecodeFinal wolfSSL_EVP_DecodeFinal
1141 #endif /* WOLFSSL_BASE64_DECODE */
1142
1143 #define EVP_blake2b512 wolfSSL_EVP_blake2b512
1144 #define EVP_blake2s256 wolfSSL_EVP_blake2s256

NetBurner, Inc.
1314 File Documentation

1145 #define EVP_MD_do_all wolfSSL_EVP_MD_do_all


1146
1147 #ifdef HAVE_HKDF
1148 #define EVP_PKEY_CTX_set_hkdf_md wolfSSL_EVP_PKEY_CTX_set_hkdf_md
1149 #define EVP_PKEY_CTX_set1_hkdf_salt wolfSSL_EVP_PKEY_CTX_set1_hkdf_salt
1150 #define EVP_PKEY_CTX_set1_hkdf_key wolfSSL_EVP_PKEY_CTX_set1_hkdf_key
1151 #define EVP_PKEY_CTX_add1_hkdf_info wolfSSL_EVP_PKEY_CTX_add1_hkdf_info
1152 #define EVP_PKEY_CTX_hkdf_mode wolfSSL_EVP_PKEY_CTX_hkdf_mode
1153 #endif
1154
1155 WOLFSSL_API void printPKEY(WOLFSSL_EVP_PKEY *k);
1156
1157 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
1158
1159 #ifdef __cplusplus
1160 } /* extern "C" */
1161 #endif
1162
1163 #include <wolfssl/openssl/objects.h>
1164
1165 #endif /* WOLFSSL_EVP_H_ */

22.248 fips_rand.h
1 /* fips_rand.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* fips_rand.h for openSSL compatibility */
13
14 #ifndef WOLFSSL_OPENSSL_FIPS_RAND_H_
15 #define WOLFSSL_OPENSSL_FIPS_RAND_H_
16
17 #include <wolfssl/openssl/ssl.h>
18 #include <wolfssl/wolfcrypt/random.h>
19
20 #if !defined(WC_NO_RNG) && defined(HAVE_HASHDRBG)
21
22 struct WOLFSSL_DRBG_CTX;
23
24 typedef size_t (*drbg_entropy_get)(struct WOLFSSL_DRBG_CTX* ctx, unsigned char** pout,
25 int entropy, size_t min_len, size_t max_len);
26 typedef void (*drbg_entropy_clean)(struct WOLFSSL_DRBG_CTX* ctx, unsigned char* out,
27 size_t olen);
28 typedef size_t (*drbg_nonce_get)(struct WOLFSSL_DRBG_CTX* ctx, unsigned char** pout,
29 int entropy, size_t min_len, size_t max_len);
30 typedef void (*drbg_nonce_clean)(struct WOLFSSL_DRBG_CTX* ctx, unsigned char* out,
31 size_t olen);
32
33 typedef struct WOLFSSL_DRBG_CTX {
34 WC_RNG* rng;
35 drbg_entropy_get entropy_get;
36 drbg_entropy_clean entropy_clean;
37 size_t entropy_blocklen;
38 drbg_nonce_get none_get;
39 drbg_nonce_clean nonce_clean;
40
41 int type;
42 int status;
43 int xflags;
44 void* app_data;
45 } WOLFSSL_DRBG_CTX;
46
47 #define DRBG_FLAG_CTR_USE_DF 0x1
48 #define DRBG_FLAG_TEST 0x2
49
50 #define DRBG_FLAG_NOERR 0x1
51 #define DRBG_CUSTOM_RESEED 0x2
52
53 #define DRBG_STATUS_UNINITIALISED 0
54 #define DRBG_STATUS_READY 1
55 #define DRBG_STATUS_RESEED 2
56 #define DRBG_STATUS_ERROR 3
57
58 WOLFSSL_API WOLFSSL_DRBG_CTX* wolfSSL_FIPS_drbg_new(int type,
59 unsigned int flags);
60
61 WOLFSSL_API int wolfSSL_FIPS_drbg_init(WOLFSSL_DRBG_CTX *ctx,

NetBurner, Inc.
22.249 openssl/hmac.h 1315

62 int type, unsigned int flags);


63
64 WOLFSSL_API int wolfSSL_FIPS_drbg_instantiate(WOLFSSL_DRBG_CTX* ctx,
65 const unsigned char* pers, size_t perslen);
66
67 WOLFSSL_API int wolfSSL_FIPS_drbg_set_callbacks(WOLFSSL_DRBG_CTX* ctx,
68 drbg_entropy_get entropy_get, drbg_entropy_clean entropy_clean,
69 size_t entropy_blocklen,
70 drbg_nonce_get none_get, drbg_nonce_clean nonce_clean);
71
72 WOLFSSL_API void wolfSSL_FIPS_rand_add(const void* buf, int num,
73 double entropy);
74 WOLFSSL_API int wolfSSL_FIPS_drbg_reseed(WOLFSSL_DRBG_CTX* ctx,
75 const unsigned char* adin, size_t adinlen);
76
77 WOLFSSL_API int wolfSSL_FIPS_drbg_generate(WOLFSSL_DRBG_CTX* ctx,
78 unsigned char* out, size_t outlen, int prediction_resistance,
79 const unsigned char* adin, size_t adinlen);
80
81 WOLFSSL_API int wolfSSL_FIPS_drbg_uninstantiate(WOLFSSL_DRBG_CTX *ctx);
82
83 WOLFSSL_API void wolfSSL_FIPS_drbg_free(WOLFSSL_DRBG_CTX *ctx);
84
85 WOLFSSL_API WOLFSSL_DRBG_CTX* wolfSSL_FIPS_get_default_drbg(void);
86
87 WOLFSSL_API void wolfSSL_FIPS_get_timevec(unsigned char* buf,
88 unsigned long* pctr);
89
90 WOLFSSL_API void* wolfSSL_FIPS_drbg_get_app_data(WOLFSSL_DRBG_CTX *ctx);
91
92 WOLFSSL_API void wolfSSL_FIPS_drbg_set_app_data(WOLFSSL_DRBG_CTX *ctx,
93 void *app_data);
94
95
96 /* compatibility mapping */
97 typedef WOLFSSL_DRBG_CTX DRBG_CTX;
98
99 #define FIPS_drbg_init wolfSSL_FIPS_drbg_init
100 #define FIPS_drbg_new wolfSSL_FIPS_drbg_new
101 #define FIPS_drbg_instantiate wolfSSL_FIPS_drbg_instantiate
102 #define FIPS_drbg_set_callbacks wolfSSL_FIPS_drbg_set_callbacks
103 #define FIPS_rand_add wolfSSL_FIPS_rand_add
104 #define FIPS_drbg_reseed wolfSSL_FIPS_drbg_reseed
105 #define FIPS_drbg_generate wolfSSL_FIPS_drbg_generate
106 #define FIPS_drbg_uninstantiate wolfSSL_FIPS_drbg_uninstantiate
107 #define FIPS_drbg_free wolfSSL_FIPS_drbg_free
108 #define FIPS_get_default_drbg wolfSSL_FIPS_get_default_drbg
109 #define FIPS_get_timevec wolfSSL_FIPS_get_timevec
110 #define FIPS_drbg_get_app_data wolfSSL_FIPS_drbg_get_app_data
111 #define FIPS_drbg_set_app_data wolfSSL_FIPS_drbg_set_app_data
112
113 #endif /* !WC_NO_RNG && HAVE_HASHDRBG */
114
115 #endif /* WOLFSSL_OPENSSL_FIPS_RAND_H_ */

22.249 openssl/hmac.h
1 /* hmac.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 /* hmac.h defines mini hmac openssl compatibility layer
15 *
16 */
17
18
19 #ifndef WOLFSSL_HMAC_H_
20 #define WOLFSSL_HMAC_H_
21
22 #include <wolfssl/wolfcrypt/settings.h>
23
24 #ifdef WOLFSSL_PREFIX
25 #include "prefix_hmac.h"
26 #endif
27
28 #include <wolfssl/openssl/compat_types.h>

NetBurner, Inc.
1316 File Documentation

29 #include <wolfssl/openssl/opensslv.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35
36 WOLFSSL_API unsigned char* wolfSSL_HMAC(const WOLFSSL_EVP_MD* evp_md,
37 const void* key, int key_len,
38 const unsigned char* d, int n, unsigned char* md,
39 unsigned int* md_len);
40
41 WOLFSSL_API WOLFSSL_HMAC_CTX* wolfSSL_HMAC_CTX_new(void);
42 WOLFSSL_API int wolfSSL_HMAC_CTX_Init(WOLFSSL_HMAC_CTX* ctx);
43 WOLFSSL_API int wolfSSL_HMAC_CTX_copy(WOLFSSL_HMAC_CTX* des,
44 WOLFSSL_HMAC_CTX* src);
45 WOLFSSL_LOCAL int wolfSSL_HmacCopy(Hmac* des, Hmac* src);
46 WOLFSSL_API int wolfSSL_HMAC_Init(WOLFSSL_HMAC_CTX* ctx, const void* key,
47 int keylen, const WOLFSSL_EVP_MD* type);
48 WOLFSSL_API int wolfSSL_HMAC_Init_ex(WOLFSSL_HMAC_CTX* ctx, const void* key,
49 int keylen, const EVP_MD* type, WOLFSSL_ENGINE* e);
50 WOLFSSL_API int wolfSSL_HMAC_Update(WOLFSSL_HMAC_CTX* ctx,
51 const unsigned char* data, int len);
52 WOLFSSL_API int wolfSSL_HMAC_Final(WOLFSSL_HMAC_CTX* ctx, unsigned char* hash,
53 unsigned int* len);
54 WOLFSSL_API int wolfSSL_HMAC_cleanup(WOLFSSL_HMAC_CTX* ctx);
55 WOLFSSL_API void wolfSSL_HMAC_CTX_cleanup(WOLFSSL_HMAC_CTX* ctx);
56 WOLFSSL_API void wolfSSL_HMAC_CTX_free(WOLFSSL_HMAC_CTX* ctx);
57 WOLFSSL_API size_t wolfSSL_HMAC_size(const WOLFSSL_HMAC_CTX *ctx);
58 WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_HMAC_CTX_get_md(const WOLFSSL_HMAC_CTX *ctx);
59
60 typedef struct WOLFSSL_HMAC_CTX HMAC_CTX;
61
62 #define HMAC(a,b,c,d,e,f,g) wolfSSL_HMAC((a),(b),(c),(d),(e),(f),(g))
63
64 #define HMAC_CTX_new wolfSSL_HMAC_CTX_new
65 #define HMAC_CTX_init wolfSSL_HMAC_CTX_Init
66 #define HMAC_CTX_copy wolfSSL_HMAC_CTX_copy
67 #define HMAC_CTX_free wolfSSL_HMAC_CTX_free
68 #define HMAC_CTX_cleanup wolfSSL_HMAC_CTX_cleanup
69 #define HMAC_CTX_reset wolfSSL_HMAC_cleanup
70 #define HMAC_Init_ex wolfSSL_HMAC_Init_ex
71 #define HMAC_Init wolfSSL_HMAC_Init
72 #define HMAC_Update wolfSSL_HMAC_Update
73 #define HMAC_Final wolfSSL_HMAC_Final
74 #define HMAC_cleanup wolfSSL_HMAC_cleanup
75 #define HMAC_size wolfSSL_HMAC_size
76 #define HMAC_CTX_get_md wolfSSL_HMAC_CTX_get_md
77
78
79 #ifdef __cplusplus
80 } /* extern "C" */
81 #endif
82
83
84 #endif /* WOLFSSL_HMAC_H_ */

22.250 hmac.h File Reference


#include <wolfssl/wolfcrypt/hash.h>

22.251 wolfcrypt/hmac.h
Go to the documentation of this file.
1 /* hmac.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_HMAC_H
17 #define WOLF_CRYPT_HMAC_H
18
19 #include <wolfssl/wolfcrypt/hash.h>

NetBurner, Inc.
22.251 wolfcrypt/hmac.h 1317

20
21 #ifndef NO_HMAC
22
23 #if defined(HAVE_FIPS) && \
24 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
25 /* for fips @wc_fips */
26 #include <cyassl/ctaocrypt/hmac.h>
27 #define WC_HMAC_BLOCK_SIZE HMAC_BLOCK_SIZE
28 #endif
29
30
31 #if defined(HAVE_FIPS) && \
32 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
33 #include <wolfssl/wolfcrypt/fips.h>
34 #endif
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /* avoid redefinition of structs */
41 #if !defined(HAVE_FIPS) || \
42 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
43
44 #ifdef WOLFSSL_ASYNC_CRYPT
45 #include <wolfssl/wolfcrypt/async.h>
46 #endif
47
48 #if defined(WOLFSSL_DEVCRYPTO_AES) || defined(WOLFSSL_DEVCRYPTO_HMAC)
49 #include <wolfssl/wolfcrypt/port/devcrypto/wc_devcrypto.h>
50 #endif
51
52 #ifndef NO_OLD_WC_NAMES
53 #define HMAC_BLOCK_SIZE WC_HMAC_BLOCK_SIZE
54 #endif
55
56 #define WC_HMAC_INNER_HASH_KEYED_SW 1
57 #define WC_HMAC_INNER_HASH_KEYED_DEV 2
58
59 enum {
60 HMAC_FIPS_MIN_KEY = 14, /* 112 bit key length minimum */
61
62 IPAD = 0x36,
63 OPAD = 0x5C,
64
65 /* If any hash is not enabled, add the ID here. */
66 #ifdef NO_MD5
67 WC_MD5 = WC_HASH_TYPE_MD5,
68 #endif
69 #ifdef NO_SHA
70 WC_SHA = WC_HASH_TYPE_SHA,
71 #endif
72 #ifdef NO_SHA256
73 WC_SHA256 = WC_HASH_TYPE_SHA256,
74 #endif
75 #ifndef WOLFSSL_SHA512
76 WC_SHA512 = WC_HASH_TYPE_SHA512,
77 #ifndef WOLFSSL_NOSHA512_224
78 WC_SHA512_224 = WC_HASH_TYPE_SHA512_224,
79 #endif
80 #ifndef WOLFSSL_NOSHA512_256
81 WC_SHA512_256 = WC_HASH_TYPE_SHA512_256,
82 #endif
83 #endif
84 #ifndef WOLFSSL_SHA384
85 WC_SHA384 = WC_HASH_TYPE_SHA384,
86 #endif
87 #ifndef WOLFSSL_SHA224
88 WC_SHA224 = WC_HASH_TYPE_SHA224,
89 #endif
90 #ifndef WOLFSSL_SHA3
91 WC_SHA3_224 = WC_HASH_TYPE_SHA3_224,
92 WC_SHA3_256 = WC_HASH_TYPE_SHA3_256,
93 WC_SHA3_384 = WC_HASH_TYPE_SHA3_384,
94 WC_SHA3_512 = WC_HASH_TYPE_SHA3_512,
95 #endif
96 #ifdef WOLF_PRIVATE_KEY_ID
97 HMAC_MAX_ID_LEN = 32,
98 HMAC_MAX_LABEL_LEN = 32,
99 #endif
100 };
101
102 /* Select the largest available hash for the buffer size. */
103 #define WC_HMAC_BLOCK_SIZE WC_MAX_BLOCK_SIZE
104
105 #if !defined(WOLFSSL_SHA3) && !defined(WOLFSSL_SHA512) && \
106 !defined(WOLFSSL_SHA384) && defined(NO_SHA256) && \

NetBurner, Inc.
1318 File Documentation

107 defined(WOLFSSL_SHA224) && defined(NO_SHA) && defined(NO_MD5)


108 #error "You have to have some kind of hash if you want to use HMAC."
109 #endif
110
111
112 /* hmac hash union */
113 typedef union {
114 #ifndef NO_MD5
115 wc_Md5 md5;
116 #endif
117 #ifndef NO_SHA
118 wc_Sha sha;
119 #endif
120 #ifdef WOLFSSL_SHA224
121 wc_Sha224 sha224;
122 #endif
123 #ifndef NO_SHA256
124 wc_Sha256 sha256;
125 #endif
126 #ifdef WOLFSSL_SHA384
127 wc_Sha384 sha384;
128 #endif
129 #ifdef WOLFSSL_SHA512
130 wc_Sha512 sha512;
131 #endif
132 #ifdef WOLFSSL_SHA3
133 wc_Sha3 sha3;
134 #endif
135 } wc_HmacHash;
136
137 /* Hmac digest */
138 struct Hmac {
139 wc_HmacHash hash;
140 word32 ipad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/
141 word32 opad[WC_HMAC_BLOCK_SIZE / sizeof(word32)];
142 word32 innerHash[WC_MAX_DIGEST_SIZE / sizeof(word32)];
143 void* heap; /* heap hint */
144 byte macType; /* md5 sha or sha256 */
145 byte innerHashKeyed; /* keyed flag */
146 #ifdef WOLFSSL_KCAPI_HMAC
147 struct kcapi_handle* handle;
148 #endif
149 #ifdef WOLFSSL_ASYNC_CRYPT
150 WC_ASYNC_DEV asyncDev;
151 #endif /* WOLFSSL_ASYNC_CRYPT */
152 #if defined(WOLFSSL_DEVCRYPTO) && defined(WOLFSSL_DEVCRYPTO_HMAC)
153 WC_CRYPTODEV ctx;
154 #endif
155 #ifdef WOLF_CRYPTO_CB
156 int devId;
157 void* devCtx;
158 const byte* keyRaw;
159 #endif
160 #ifdef WOLF_PRIVATE_KEY_ID
161 byte id[HMAC_MAX_ID_LEN];
162 int idLen;
163 char label[HMAC_MAX_LABEL_LEN];
164 int labelLen;
165 #endif
166 #if defined(WOLFSSL_ASYNC_CRYPT) || defined(WOLF_CRYPTO_CB)
167 word16 keyLen; /* hmac key length (key in ipad) */
168 #endif
169 };
170
171 #ifndef WC_HMAC_TYPE_DEFINED
172 typedef struct Hmac Hmac;
173 #define WC_HMAC_TYPE_DEFINED
174 #endif
175
176
177 #endif /* HAVE_FIPS */
178
179 /* does init */
180 WOLFSSL_API int wc_HmacSetKey(Hmac* hmac, int type, const byte* key, word32 keySz);
181 WOLFSSL_API int wc_HmacUpdate(Hmac* hmac, const byte* in, word32 sz);
182 WOLFSSL_API int wc_HmacFinal(Hmac* hmac, byte* out);
183 #ifdef WOLFSSL_KCAPI_HMAC
184 WOLFSSL_API int wc_HmacSetKey_Software(Hmac* hmac, int type, const byte* key,
185 word32 keySz);
186 WOLFSSL_API int wc_HmacUpdate_Software(Hmac* hmac, const byte* in, word32 sz);
187 WOLFSSL_API int wc_HmacFinal_Software(Hmac* hmac, byte* out);
188 #endif
189 WOLFSSL_API int wc_HmacSizeByType(int type);
190
191 WOLFSSL_API int wc_HmacInit(Hmac* hmac, void* heap, int devId);
192 #ifdef WOLF_PRIVATE_KEY_ID
193 WOLFSSL_API int wc_HmacInit_Id(Hmac* hmac, byte* id, int len, void* heap,

NetBurner, Inc.
22.252 openssl/kdf.h 1319

194 int devId);


195 WOLFSSL_API int wc_HmacInit_Label(Hmac* hmac, const char* label, void* heap,
196 int devId);
197 #endif
198 WOLFSSL_API void wc_HmacFree(Hmac* hmac);
199
200 WOLFSSL_API int wolfSSL_GetHmacMaxSize(void);
201
202 WOLFSSL_LOCAL int _InitHmac(Hmac* hmac, int type, void* heap);
203
204 #ifdef HAVE_HKDF
205
206 WOLFSSL_API int wc_HKDF_Extract(int type, const byte* salt, word32 saltSz,
207 const byte* inKey, word32 inKeySz, byte* out);
208 WOLFSSL_API int wc_HKDF_Expand(int type, const byte* inKey, word32 inKeySz,
209 const byte* info, word32 infoSz,
210 byte* out, word32 outSz);
211
212 WOLFSSL_API int wc_HKDF(int type, const byte* inKey, word32 inKeySz,
213 const byte* salt, word32 saltSz,
214 const byte* info, word32 infoSz,
215 byte* out, word32 outSz);
216
217 #endif /* HAVE_HKDF */
218
219 #ifdef __cplusplus
220 } /* extern "C" */
221 #endif
222
223 #endif /* NO_HMAC */
224 #endif /* WOLF_CRYPT_HMAC_H */

22.252 openssl/kdf.h
1 /* kdf.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_KDF_H_
13 #define WOLFSSL_KDF_H_
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0
20 #define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1
21 #define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2
22
23 #ifdef __cplusplus
24 } /* extern "C" */
25 #endif
26
27 #endif /* WOLFSSL_KDF_H_ */

22.253 kdf.h File Reference


#include <wolfssl/wolfcrypt/hmac.h>

22.254 wolfcrypt/kdf.h
Go to the documentation of this file.
1 /* kdf.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *

NetBurner, Inc.
1320 File Documentation

9 * https://www.wolfssl.com
10 */
11
16 #ifndef NO_KDF
17
18 #ifndef WOLF_CRYPT_KDF_H
19 #define WOLF_CRYPT_KDF_H
20
21 #if defined(HAVE_FIPS) && \
22 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 5)
23 #include <wolfssl/wolfcrypt/fips.h>
24 #endif
25
26 #include <wolfssl/wolfcrypt/hmac.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 enum max_prf {
33 #ifdef HAVE_FFDHE_8192
34 MAX_PRF_HALF = 516, /* Maximum half secret len */
35 #elif defined(HAVE_FFDHE_6144)
36 MAX_PRF_HALF = 388, /* Maximum half secret len */
37 #else
38 MAX_PRF_HALF = 260, /* Maximum half secret len */
39 #endif
40 MAX_PRF_LABSEED = 128, /* Maximum label + seed len */
41 MAX_PRF_DIG = 224 /* Maximum digest len */
42 };
43
44
45 #ifdef WOLFSSL_HAVE_PRF
46 WOLFSSL_API int wc_PRF(byte* result, word32 resLen, const byte* secret,
47 word32 secLen, const byte* seed, word32 seedLen, int hash,
48 void* heap, int devId);
49 WOLFSSL_API int wc_PRF_TLSv1(byte* digest, word32 digLen, const byte* secret,
50 word32 secLen, const byte* label, word32 labLen,
51 const byte* seed, word32 seedLen, void* heap, int devId);
52 WOLFSSL_API int wc_PRF_TLS(byte* digest, word32 digLen, const byte* secret,
53 word32 secLen, const byte* label, word32 labLen,
54 const byte* seed, word32 seedLen, int useAtLeastSha256,
55 int hash_type, void* heap, int devId);
56 #endif /* WOLFSSL_HAVE_PRF */
57
58 #ifdef HAVE_HKDF
59
60 enum {
61 /*
62 MAX_HKDF_LABEL_SZ = OPAQUE16_LEN +
63 OPAQUE8_LEN + PROTOCOL_LABEL_SZ + MAX_LABEL_SZ +
64 OPAQUE8_LEN + WC_MAX_DIGEST_SIZE
65 */
66 MAX_TLS13_HKDF_LABEL_SZ = 47 + WC_MAX_DIGEST_SIZE
67 };
68
69 WOLFSSL_API int wc_Tls13_HKDF_Extract(byte* prk, const byte* salt, int saltLen,
70 byte* ikm, int ikmLen, int digest);
71
72 WOLFSSL_API int wc_Tls13_HKDF_Expand_Label(byte* okm, word32 okmLen,
73 const byte* prk, word32 prkLen,
74 const byte* protocol, word32 protocolLen,
75 const byte* label, word32 labelLen,
76 const byte* info, word32 infoLen,
77 int digest);
78
79 #endif /* HAVE_HKDF */
80
81 #ifdef WOLFSSL_WOLFSSH
82
83 WOLFSSL_API int wc_SSH_KDF(byte hashId, byte keyId,
84 byte* key, word32 keySz,
85 const byte* k, word32 kSz,
86 const byte* h, word32 hSz,
87 const byte* sessionId, word32 sessionIdSz);
88
89 #endif /* WOLFSSL_WOLFSSH */
90
91 #ifdef __cplusplus
92 } /* extern "C" */
93 #endif
94
95 #endif /* WOLF_CRYPT_KDF_H */
96
97 #endif /* NO_KDF */
98

NetBurner, Inc.
22.255 lhash.h 1321

22.255 lhash.h
1 /* lhash.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* lhash.h for openSSL */
13
14 #ifndef WOLFSSL_lhash_H_
15 #define WOLFSSL_lhash_H_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 #include <wolfssl/openssl/ssl.h>
22
23 #ifdef OPENSSL_ALL
24 #define IMPLEMENT_LHASH_HASH_FN(name, type) \
25 unsigned long wolfSSL_##name##_LHASH_HASH(const void *arg) \
26 { \
27 const type *a = arg; \
28 return name##_hash(a); \
29 }
30 #define IMPLEMENT_LHASH_COMP_FN(name, type) \
31 int wolfSSL_##name##_LHASH_COMP(const void *p1, const void *p2) \
32 { \
33 const type *_p1 = p1; \
34 const type *_p2 = p2; \
35 return name##_cmp(_p1, _p2); \
36 }
37
38 #define LHASH_HASH_FN(name) wolfSSL_##name##_LHASH_HASH
39 #define LHASH_COMP_FN(name) wolfSSL_##name##_LHASH_COMP
40
41 WOLFSSL_API unsigned long wolfSSL_LH_strhash(const char *str);
42
43 WOLFSSL_API void *wolfSSL_lh_retrieve(WOLFSSL_STACK *sk, void *data);
44
45 #define lh_strhash wolfSSL_LH_strhash
46
47 #endif
48
49
50 #ifdef __cplusplus
51 } /* extern "C" */
52 #endif
53
54 #endif /* WOLFSSL_lhash_H_ */

22.256 openssl/md4.h
1 /* md4.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLFSSL_MD4_H_
14 #define WOLFSSL_MD4_H_
15
16 #include <wolfssl/wolfcrypt/settings.h>
17
18 #ifndef NO_MD4
19
20 #ifdef WOLFSSL_PREFIX
21 #include "prefix_md4.h"
22 #endif
23
24 #ifdef __cplusplus
25 extern "C" {

NetBurner, Inc.
1322 File Documentation

26 #endif
27
28
29 typedef struct WOLFSSL_MD4_CTX {
30 int buffer[32]; /* big enough to hold, check size in Init */
31 } WOLFSSL_MD4_CTX;
32
33
34 WOLFSSL_API void wolfSSL_MD4_Init(WOLFSSL_MD4_CTX* md4);
35 WOLFSSL_API void wolfSSL_MD4_Update(WOLFSSL_MD4_CTX* md4, const void* data,
36 unsigned long len);
37 WOLFSSL_API void wolfSSL_MD4_Final(unsigned char* digest, WOLFSSL_MD4_CTX* md4);
38
39
40 typedef WOLFSSL_MD4_CTX MD4_CTX;
41
42 #define MD4_Init wolfSSL_MD4_Init
43 #define MD4_Update wolfSSL_MD4_Update
44 #define MD4_Final wolfSSL_MD4_Final
45
46 #ifdef __cplusplus
47 } /* extern "C" */
48 #endif
49
50 #endif /* NO_MD4 */
51
52 #endif /* WOLFSSL_MD4_H_ */
53

22.257 md4.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.258 wolfcrypt/md4.h
Go to the documentation of this file.
1 /* md4.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_MD4_H
17 #define WOLF_CRYPT_MD4_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifndef NO_MD4
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* in bytes */
28 enum {
29 MD4 = WC_HASH_TYPE_MD4,
30 MD4_BLOCK_SIZE = 64,
31 MD4_DIGEST_SIZE = 16,
32 MD4_PAD_SIZE = 56
33 };
34
35
36 /* MD4 digest */
37 typedef struct Md4 {
38 word32 buffLen; /* in bytes */
39 word32 loLen; /* length in bytes */
40 word32 hiLen; /* length in bytes */
41 word32 digest[MD4_DIGEST_SIZE / sizeof(word32)];
42 word32 buffer[MD4_BLOCK_SIZE / sizeof(word32)];
43 } Md4;
44
45
46 WOLFSSL_API void wc_InitMd4(Md4* md4);
47 WOLFSSL_API void wc_Md4Update(Md4* md4, const byte* data, word32 len);

NetBurner, Inc.
22.259 modes.h 1323

48 WOLFSSL_API void wc_Md4Final(Md4* md4, byte* hash);


49
50
51 #ifdef __cplusplus
52 } /* extern "C" */
53 #endif
54
55 #endif /* NO_MD4 */
56 #endif /* WOLF_CRYPT_MD4_H */
57

22.259 modes.h
1 /* modes.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11 #ifndef WOLFSSL_OPENSSL_MODES_H
12 #define WOLFSSL_OPENSSL_MODES_H
13
14 #include <wolfssl/wolfcrypt/settings.h>
15 #include <wolfssl/openssl/ssl.h>
16
17 typedef void (*WOLFSSL_CBC128_CB) (const unsigned char *in,
18 unsigned char *out, size_t len, const void *key,
19 unsigned char *iv, int enc);
20
21 WOLFSSL_API size_t wolfSSL_CRYPTO_cts128_encrypt(const unsigned char *in,
22 unsigned char *out, size_t len, const void *key,
23 unsigned char *iv, WOLFSSL_CBC128_CB cbc);
24 WOLFSSL_API size_t wolfSSL_CRYPTO_cts128_decrypt(const unsigned char *in,
25 unsigned char *out, size_t len, const void *key,
26 unsigned char *iv, WOLFSSL_CBC128_CB cbc);
27
28 #define WOLFSSL_CTS128_BLOCK_SZ 16
29
30 /* Compatibility layer defines */
31 #define CRYPTO_cts128_encrypt wolfSSL_CRYPTO_cts128_encrypt
32 #define CRYPTO_cts128_decrypt wolfSSL_CRYPTO_cts128_decrypt
33 #define cbc128_f WOLFSSL_CBC128_CB
34
35 #endif /* WOLFSSL_OPENSSL_MODES_H */

22.260 obj_mac.h
1 /* obj_mac.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* obj_mac.h for openSSL */
13
14 #ifndef WOLFSSL_OBJ_MAC_H_
15 #define WOLFSSL_OBJ_MAC_H_
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 #define NID_sect163k1 721
21 #define NID_sect163r1 722
22 #define NID_sect163r2 723
23 #define NID_sect193r1 724
24 #define NID_sect193r2 725
25 #define NID_sect233k1 726
26 #define NID_sect233r1 727
27 #define NID_sect239k1 728
28 #define NID_sect283k1 729
29 #define NID_sect283r1 730
30 #define NID_sect409k1 731
31 #define NID_sect409r1 732

NetBurner, Inc.
1324 File Documentation

32 #define NID_sect571k1 733


33 #define NID_sect571r1 734
34
35 /* the definition is for Qt Unit test */
36 #define SN_jurisdictionCountryName "jurisdictionC"
37 #ifdef __cplusplus
38 } /* extern "C" */
39 #endif
40
41 #endif /* WOLFSSL_OBJ_MAC_H_ */
42

22.261 objects.h
1 /* objects.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLFSSL_OBJECTS_H_
14 #define WOLFSSL_OBJECTS_H_
15
16 #include <wolfssl/wolfcrypt/settings.h>
17 #ifndef OPENSSL_EXTRA_SSL_GUARD
18 #define OPENSSL_EXTRA_SSL_GUARD
19 #include <wolfssl/ssl.h>
20 #endif /* OPENSSL_EXTRA_SSL_GUARD */
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
27
28 #define OBJ_NAME_TYPE_UNDEF WOLFSSL_OBJ_NAME_TYPE_UNDEF
29 #define OBJ_NAME_TYPE_MD_METH WOLFSSL_OBJ_NAME_TYPE_MD_METH
30 #define OBJ_NAME_TYPE_CIPHER_METH WOLFSSL_OBJ_NAME_TYPE_CIPHER_METH
31 #define OBJ_NAME_TYPE_PKEY_METH WOLFSSL_OBJ_NAME_TYPE_PKEY_METH
32 #define OBJ_NAME_TYPE_COMP_METH WOLFSSL_OBJ_NAME_TYPE_COMP_METH
33 #define OBJ_NAME_TYPE_NUM WOLFSSL_OBJ_NAME_TYPE_NUM
34 #define OBJ_NAME_ALIAS WOLFSSL_OBJ_NAME_ALIAS
35
36 #define OBJ_nid2sn wolfSSL_OBJ_nid2sn
37 #define OBJ_obj2nid wolfSSL_OBJ_obj2nid
38 #define OBJ_sn2nid wolfSSL_OBJ_sn2nid
39 #define OBJ_length wolfSSL_OBJ_length
40 #define OBJ_get0_data wolfSSL_OBJ_get0_data
41 #define OBJ_nid2ln wolfSSL_OBJ_nid2ln
42 #define OBJ_ln2nid wolfSSL_OBJ_ln2nid
43 #define OBJ_txt2nid wolfSSL_OBJ_txt2nid
44 #define OBJ_txt2obj wolfSSL_OBJ_txt2obj
45 #define OBJ_nid2obj wolfSSL_OBJ_nid2obj
46 #define OBJ_obj2txt wolfSSL_OBJ_obj2txt
47 #define OBJ_cleanup wolfSSL_OBJ_cleanup
48 #define OBJ_cmp wolfSSL_OBJ_cmp
49 #define OBJ_create wolfSSL_OBJ_create
50 #define ASN1_OBJECT_free wolfSSL_ASN1_OBJECT_free
51 #define OBJ_NAME_do_all wolfSSL_OBJ_NAME_do_all
52 #define i2t_ASN1_OBJECT wolfSSL_i2t_ASN1_OBJECT
53
54 /* not required for wolfSSL */
55 #define OPENSSL_load_builtin_modules()
56
57
58 #define NID_ad_OCSP 178
59 #define NID_ad_ca_issuers 179
60
61 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
62
63
64 #ifdef __cplusplus
65 } /* extern "C" */
66 #endif
67
68 #endif /* WOLFSSL_OBJECTS_H_ */

NetBurner, Inc.
22.262 opensslconf.h 1325

22.262 opensslconf.h
1 /* opensslconf.h for openSSL */
2
3
4 #ifndef OPENSSL_THREADS
5 #define OPENSSL_THREADS
6 #endif
7
8

22.263 opensslv.h
1 /* opensslv.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* opensslv.h compatibility */
13
14 #ifndef WOLFSSL_OPENSSLV_H_
15 #define WOLFSSL_OPENSSLV_H_
16
17 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
18
19 /* api version compatibility */
20 #if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x009070dfL) ||\
21 defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x0090810fL) ||\
22 defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x10100000L) ||\
23 defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x10001040L)
24 /* valid version */
25 #elif defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIBEST) || \
26 defined(WOLFSSL_BIND) || defined(WOLFSSL_NGINX) || \
27 defined(WOLFSSL_RSYSLOG) || defined(WOLFSSL_KRB) || defined(HAVE_STUNNEL)
28 /* For Apache httpd, Use 1.1.0 compatibility */
29 #define OPENSSL_VERSION_NUMBER 0x10100003L
30 #elif defined(WOLFSSL_QT) || defined(WOLFSSL_PYTHON)
31 /* For Qt and Python 3.8.5 compatibility */
32 #define OPENSSL_VERSION_NUMBER 0x10101000L
33 #elif defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_FFMPEG)
34 #define OPENSSL_VERSION_NUMBER 0x1010000fL
35 #elif defined(OPENSSL_ALL) || defined(HAVE_LIGHTY) || \
36 defined(WOLFSSL_NGINX) || defined(WOLFSSL_OPENSSH) || defined(WOLFSSL_OPENVPN)
37 /* version number can be increased for Lighty after compatibility for ECDH
38 is added */
39 #define OPENSSL_VERSION_NUMBER 0x10001040L
40 #else
41 #define OPENSSL_VERSION_NUMBER 0x0090810fL
42 #endif
43
44 #define OPENSSL_VERSION_TEXT "wolfSSL " LIBWOLFSSL_VERSION_STRING
45 #define OPENSSL_VERSION 0
46
47 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
48
49 #endif /* header */

22.264 ossl_typ.h File Reference


#include <wolfssl/openssl/ssl.h>

22.265 ossl_typ.h
Go to the documentation of this file.
1 /* ossl_typ.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *

NetBurner, Inc.
1326 File Documentation

7 * Contact [email protected] with any questions or comments.


8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLFSSL_OSSL_TYP_H_
18 #define WOLFSSL_OSSL_TYP_H_
19
20 #include <wolfssl/openssl/ssl.h>
21
22 #endif /* !WOLFSSL_OSSL_TYP_H_ */

22.266 pem.h File Reference


#include <wolfssl/openssl/evp.h>
#include <wolfssl/openssl/bio.h>
#include <wolfssl/openssl/rsa.h>
#include <wolfssl/openssl/dsa.h>
#include <wolfssl/ssl.h>

22.267 pem.h
Go to the documentation of this file.
1 /* pem.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* pem.h for openssl */
13
19 #ifndef WOLFSSL_PEM_H_
20 #define WOLFSSL_PEM_H_
21
22 #include <wolfssl/openssl/evp.h>
23 #include <wolfssl/openssl/bio.h>
24 #include <wolfssl/openssl/rsa.h>
25 #include <wolfssl/openssl/dsa.h>
26 #include <wolfssl/ssl.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 /* RSA */
33 WOLFSSL_API
34 int wolfSSL_PEM_write_bio_RSAPrivateKey(WOLFSSL_BIO* bio, WOLFSSL_RSA* rsa,
35 const WOLFSSL_EVP_CIPHER* cipher,
36 unsigned char* passwd, int len,
37 wc_pem_password_cb* cb, void* arg);
38 WOLFSSL_API
39 WOLFSSL_RSA* wolfSSL_PEM_read_bio_RSAPrivateKey(WOLFSSL_BIO* bio,
40 WOLFSSL_RSA** rsa, wc_pem_password_cb* cb, void* pass);
41
42 WOLFSSL_API
43 int wolfSSL_PEM_write_bio_RSA_PUBKEY(WOLFSSL_BIO* bio, WOLFSSL_RSA* rsa);
44
45 WOLFSSL_API
46 WOLFSSL_RSA *wolfSSL_PEM_read_bio_RSA_PUBKEY(WOLFSSL_BIO* bio,
47 WOLFSSL_RSA** rsa,
48 wc_pem_password_cb* cb, void *u);
49
50 WOLFSSL_API
51 WOLFSSL_EC_GROUP* wolfSSL_PEM_read_bio_ECPKParameters(WOLFSSL_BIO* bio,
52 WOLFSSL_EC_GROUP** group,
53 wc_pem_password_cb* cb,
54 void* pass);
55 WOLFSSL_API
56 int wolfSSL_PEM_write_mem_RSAPrivateKey(WOLFSSL_RSA* rsa,
57 const WOLFSSL_EVP_CIPHER* cipher,
58 unsigned char* passwd, int len,
59 unsigned char **pem, int *plen);

NetBurner, Inc.
22.267 pem.h 1327

60 #if !defined(NO_FILESYSTEM)
61 WOLFSSL_API
62 int wolfSSL_PEM_write_RSAPrivateKey(XFILE fp, WOLFSSL_RSA *rsa,
63 const WOLFSSL_EVP_CIPHER *enc,
64 unsigned char *kstr, int klen,
65 wc_pem_password_cb *cb, void *u);
66
67 WOLFSSL_API
68 WOLFSSL_RSA* wolfSSL_PEM_read_RSAPrivateKey(XFILE fp, WOLFSSL_RSA** rsa,
69 wc_pem_password_cb* cb, void* pass);
70
71 WOLFSSL_API
72 WOLFSSL_RSA *wolfSSL_PEM_read_RSAPublicKey(XFILE fp, WOLFSSL_RSA **x,
73 wc_pem_password_cb *cb, void *u);
74 WOLFSSL_API
75 int wolfSSL_PEM_write_RSAPublicKey(XFILE fp, WOLFSSL_RSA* key);
76
77 WOLFSSL_API
78 int wolfSSL_PEM_write_RSA_PUBKEY(XFILE fp, WOLFSSL_RSA *x);
79
80 WOLFSSL_API
81 WOLFSSL_RSA *wolfSSL_PEM_read_RSA_PUBKEY(XFILE fp, WOLFSSL_RSA** rsa,
82 wc_pem_password_cb* cb, void *pass);
83 #endif /* NO_FILESYSTEM */
84
85 /* DSA */
86 WOLFSSL_API
87 int wolfSSL_PEM_write_bio_DSAPrivateKey(WOLFSSL_BIO* bio,
88 WOLFSSL_DSA* dsa,
89 const WOLFSSL_EVP_CIPHER* cipher,
90 unsigned char* passwd, int len,
91 wc_pem_password_cb* cb, void* arg);
92
93 WOLFSSL_API
94 WOLFSSL_DSA* wolfSSL_PEM_read_bio_DSAPrivateKey(WOLFSSL_BIO* bio,
95 WOLFSSL_DSA** dsa,
96 wc_pem_password_cb* cb,
97 void *pass);
98
99 WOLFSSL_API
100 WOLFSSL_DSA *wolfSSL_PEM_read_bio_DSA_PUBKEY(WOLFSSL_BIO* bio,
101 WOLFSSL_DSA** dsa,
102 wc_pem_password_cb* cb,
103 void *pass);
104
105 WOLFSSL_API
106 int wolfSSL_PEM_write_bio_DSA_PUBKEY(WOLFSSL_BIO* bio, WOLFSSL_DSA* dsa);
107
108 WOLFSSL_API
109 int wolfSSL_PEM_write_mem_DSAPrivateKey(WOLFSSL_DSA* dsa,
110 const WOLFSSL_EVP_CIPHER* cipher,
111 unsigned char* passwd, int len,
112 unsigned char **pem, int *plen);
113 #if !defined(NO_FILESYSTEM)
114 WOLFSSL_API
115 int wolfSSL_PEM_write_DSAPrivateKey(XFILE fp, WOLFSSL_DSA *dsa,
116 const WOLFSSL_EVP_CIPHER *enc,
117 unsigned char *kstr, int klen,
118 wc_pem_password_cb *cb, void *u);
119 WOLFSSL_API
120 int wolfSSL_PEM_write_DSA_PUBKEY(XFILE fp, WOLFSSL_DSA *x);
121 #endif /* NO_FILESYSTEM */
122
123 /* ECC */
124 WOLFSSL_API
125 int wolfSSL_PEM_write_bio_ECPrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EC_KEY* ec,
126 const WOLFSSL_EVP_CIPHER* cipher,
127 unsigned char* passwd, int len,
128 wc_pem_password_cb* cb, void* arg);
129 WOLFSSL_API
130 WOLFSSL_EC_KEY* wolfSSL_PEM_read_bio_ECPrivateKey(WOLFSSL_BIO* bio,
131 WOLFSSL_EC_KEY** ec,
132 wc_pem_password_cb* cb,
133 void *pass);
134 WOLFSSL_API
135 int wolfSSL_PEM_write_bio_EC_PUBKEY(WOLFSSL_BIO* bio, WOLFSSL_EC_KEY* ec);
136
137 WOLFSSL_API
138 int wolfSSL_PEM_write_mem_ECPrivateKey(WOLFSSL_EC_KEY* key,
139 const WOLFSSL_EVP_CIPHER* cipher,
140 unsigned char* passwd, int len,
141 unsigned char **pem, int *plen);
142 #if !defined(NO_FILESYSTEM)
143 WOLFSSL_API
144 int wolfSSL_PEM_write_ECPrivateKey(XFILE fp, WOLFSSL_EC_KEY *key,
145 const WOLFSSL_EVP_CIPHER *enc,
146 unsigned char *kstr, int klen,

NetBurner, Inc.
1328 File Documentation

147 wc_pem_password_cb *cb, void *u);


148 WOLFSSL_API
149 int wolfSSL_PEM_write_EC_PUBKEY(XFILE fp, WOLFSSL_EC_KEY* key);
150
151 WOLFSSL_API
152 WOLFSSL_EC_KEY* wolfSSL_PEM_read_bio_EC_PUBKEY(WOLFSSL_BIO* bio,
153 WOLFSSL_EC_KEY** ec,
154 wc_pem_password_cb* cb,
155 void *pass);
156 #endif /* NO_FILESYSTEM */
157
158 /* EVP_KEY */
159 WOLFSSL_API
160 WOLFSSL_EVP_PKEY* wolfSSL_PEM_read_bio_PrivateKey(WOLFSSL_BIO* bio,
161 WOLFSSL_EVP_PKEY** key,
162 wc_pem_password_cb* cb,
163 void* pass);
164 WOLFSSL_API
165 WOLFSSL_EVP_PKEY *wolfSSL_PEM_read_bio_PUBKEY(WOLFSSL_BIO* bio,
166 WOLFSSL_EVP_PKEY **key,
167 wc_pem_password_cb *cb,
168 void *pass);
169 WOLFSSL_API
170 int wolfSSL_PEM_write_bio_PrivateKey(WOLFSSL_BIO* bio, WOLFSSL_EVP_PKEY* key,
171 const WOLFSSL_EVP_CIPHER* cipher,
172 unsigned char* passwd, int len,
173 wc_pem_password_cb* cb, void* arg);
174 WOLFSSL_API
175 int wolfSSL_PEM_write_bio_PUBKEY(WOLFSSL_BIO* bio, WOLFSSL_EVP_PKEY* key);
176
177
178 WOLFSSL_API
179 int wolfSSL_PEM_read_bio(WOLFSSL_BIO* bio, char **name, char **header,
180 unsigned char **data, long *len);
181 WOLFSSL_API
182 int wolfSSL_PEM_write_bio(WOLFSSL_BIO *bio, const char *name,
183 const char *header, const unsigned char *data,
184 long len);
185 #if !defined(NO_FILESYSTEM)
186 WOLFSSL_API
187 int wolfSSL_PEM_read(XFILE fp, char **name, char **header, unsigned char **data,
188 long *len);
189 WOLFSSL_API
190 int wolfSSL_PEM_write(XFILE fp, const char *name, const char *header,
191 const unsigned char *data, long len);
192 #endif
193
194 #if !defined(NO_FILESYSTEM)
195 WOLFSSL_API
196 WOLFSSL_EVP_PKEY *wolfSSL_PEM_read_PUBKEY(XFILE fp, WOLFSSL_EVP_PKEY **x,
197 wc_pem_password_cb *cb, void *u);
198 WOLFSSL_API
199 WOLFSSL_X509 *wolfSSL_PEM_read_X509(XFILE fp, WOLFSSL_X509 **x,
200 wc_pem_password_cb *cb, void *u);
201 WOLFSSL_API
202 WOLFSSL_EVP_PKEY *wolfSSL_PEM_read_PrivateKey(XFILE fp, WOLFSSL_EVP_PKEY **x,
203 wc_pem_password_cb *cb, void *u);
204
205 WOLFSSL_API
206 int wolfSSL_PEM_write_X509(XFILE fp, WOLFSSL_X509 *x);
207 WOLFSSL_API
208 int wolfSSL_PEM_write_DHparams(XFILE fp, WOLFSSL_DH* dh);
209 #endif /* NO_FILESYSTEM */
210
211 #define PEM_read wolfSSL_PEM_read
212 #define PEM_read_bio wolfSSL_PEM_read_bio
213 #define PEM_write wolfSSL_PEM_write
214 #define PEM_write_bio wolfSSL_PEM_write_bio
215
216 #define PEM_read_X509 wolfSSL_PEM_read_X509
217 #define PEM_read_PrivateKey wolfSSL_PEM_read_PrivateKey
218 #define PEM_write_X509 wolfSSL_PEM_write_X509
219 #define PEM_write_bio_PrivateKey wolfSSL_PEM_write_bio_PrivateKey
220 #define PEM_write_bio_PKCS8PrivateKey wolfSSL_PEM_write_bio_PKCS8PrivateKey
221 #define PEM_write_PKCS8PrivateKey wolfSSL_PEM_write_PKCS8PrivateKey
222
223 /* DH */
224 #define PEM_write_DHparams wolfSSL_PEM_write_DHparams
225 /* RSA */
226 #define PEM_write_bio_RSAPrivateKey wolfSSL_PEM_write_bio_RSAPrivateKey
227 #define PEM_read_bio_RSAPrivateKey wolfSSL_PEM_read_bio_RSAPrivateKey
228 #define PEM_read_RSAPrivateKey wolfSSL_PEM_read_RSAPrivateKey
229 #define PEM_write_bio_RSA_PUBKEY wolfSSL_PEM_write_bio_RSA_PUBKEY
230 #define PEM_read_bio_RSA_PUBKEY wolfSSL_PEM_read_bio_RSA_PUBKEY
231 #define PEM_read_bio_RSAPublicKey wolfSSL_PEM_read_bio_RSA_PUBKEY
232 #define PEM_read_bio_ECPKParameters wolfSSL_PEM_read_bio_ECPKParameters
233 #define PEM_write_RSAPrivateKey wolfSSL_PEM_write_RSAPrivateKey

NetBurner, Inc.
22.268 openssl/pkcs12.h 1329

234 #define PEM_write_RSA_PUBKEY wolfSSL_PEM_write_RSA_PUBKEY


235 #define PEM_read_RSA_PUBKEY wolfSSL_PEM_read_RSA_PUBKEY
236 #define PEM_write_RSAPublicKey wolfSSL_PEM_write_RSAPublicKey
237 #define PEM_read_RSAPublicKey wolfSSL_PEM_read_RSAPublicKey
238 /* DSA */
239 #define PEM_write_bio_DSAPrivateKey wolfSSL_PEM_write_bio_DSAPrivateKey
240 #define PEM_write_DSAPrivateKey wolfSSL_PEM_write_DSAPrivateKey
241 #define PEM_write_bio_DSA_PUBKEY wolfSSL_PEM_write_bio_DSA_PUBKEY
242 #define PEM_write_DSA_PUBKEY wolfSSL_PEM_write_DSA_PUBKEY
243 #define PEM_read_bio_DSAPrivateKey wolfSSL_PEM_read_bio_DSAPrivateKey
244 #define PEM_read_bio_DSA_PUBKEY wolfSSL_PEM_read_bio_DSA_PUBKEY
245 /* ECC */
246 #define PEM_write_bio_ECPrivateKey wolfSSL_PEM_write_bio_ECPrivateKey
247 #define PEM_write_bio_EC_PUBKEY wolfSSL_PEM_write_bio_EC_PUBKEY
248 #define PEM_write_EC_PUBKEY wolfSSL_PEM_write_EC_PUBKEY
249 #define PEM_write_ECPrivateKey wolfSSL_PEM_write_ECPrivateKey
250 #define PEM_read_bio_ECPrivateKey wolfSSL_PEM_read_bio_ECPrivateKey
251 #define PEM_read_bio_EC_PUBKEY wolfSSL_PEM_read_bio_EC_PUBKEY
252 #ifndef NO_WOLFSSL_STUB
253 #define PEM_write_bio_ECPKParameters(...) 0
254 #endif
255 /* EVP_KEY */
256 #define PEM_read_bio_PrivateKey wolfSSL_PEM_read_bio_PrivateKey
257 #define PEM_read_PUBKEY wolfSSL_PEM_read_PUBKEY
258 #define PEM_read_bio_PUBKEY wolfSSL_PEM_read_bio_PUBKEY
259 #define PEM_write_bio_PUBKEY wolfSSL_PEM_write_bio_PUBKEY
260
261 #ifdef __cplusplus
262 } /* extern "C" */
263 #endif
264
265 #endif /* WOLFSSL_PEM_H_ */
266

22.268 openssl/pkcs12.h
1 /* pkcs12.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* pkcs12.h for openssl */
13
14
15 #include <wolfssl/openssl/ssl.h>
16 #include <wolfssl/wolfcrypt/pkcs12.h>
17
18 #ifndef WOLFSSL_PKCS12_COMPAT_H_
19 #define WOLFSSL_PKCS12_COMPAT_H_
20
21 #define NID_pbe_WithSHA1AndDES_CBC 2
22 #define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 3
23 #define NID_pbe_WithSHA1And128BitRC4 1
24
25 #define PKCS12_DEFAULT_ITER WC_PKCS12_ITT_DEFAULT
26
27 /* wolfCrypt level does not make use of ssl.h */
28 #define PKCS12 WC_PKCS12
29 #define PKCS12_new wc_PKCS12_new
30 #define PKCS12_free wc_PKCS12_free
31
32 /* wolfSSL level using structs from ssl.h and calls down to wolfCrypt */
33 #define d2i_PKCS12_bio wolfSSL_d2i_PKCS12_bio
34 #define PKCS12_parse wolfSSL_PKCS12_parse
35 #define PKCS12_verify_mac wolfSSL_PKCS12_verify_mac
36 #define PKCS12_create wolfSSL_PKCS12_create
37 #define PKCS12_PBE_add wolfSSL_PKCS12_PBE_add
38
39 #endif /* WOLFSSL_PKCS12_COMPAT_H_ */
40

22.269 wolfcrypt/pkcs12.h
1 /* pkcs12.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.

NetBurner, Inc.
1330 File Documentation

4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLF_CRYPT_PKCS12_H
14 #define WOLF_CRYPT_PKCS12_H
15
16 #include <wolfssl/wolfcrypt/types.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 #ifndef WOLFSSL_TYPES_DEFINED /* do not redeclare from ssl.h */
23 typedef struct WC_PKCS12 WC_PKCS12;
24 #endif
25
26 typedef struct WC_DerCertList { /* dereferenced in ssl.c */
27 byte* buffer;
28 word32 bufferSz;
29 struct WC_DerCertList* next;
30 } WC_DerCertList;
31
32 /* default values for creating PKCS12 */
33 enum {
34 WC_PKCS12_ITT_DEFAULT = 2048,
35 WC_PKCS12_VERSION_DEFAULT = 3,
36 WC_PKCS12_MAC_DEFAULT = 1,
37 };
38
39 WOLFSSL_API WC_PKCS12* wc_PKCS12_new(void);
40 WOLFSSL_API void wc_PKCS12_free(WC_PKCS12* pkcs12);
41 WOLFSSL_API int wc_d2i_PKCS12(const byte* der, word32 derSz, WC_PKCS12* pkcs12);
42 #ifndef NO_FILESYSTEM
43 WOLFSSL_API int wc_d2i_PKCS12_fp(const char* file, WC_PKCS12** pkcs12);
44 #endif
45 WOLFSSL_API int wc_i2d_PKCS12(WC_PKCS12* pkcs12, byte** der, int* derSz);
46 WOLFSSL_API int wc_PKCS12_parse(WC_PKCS12* pkcs12, const char* psw,
47 byte** pkey, word32* pkeySz, byte** cert, word32* certSz,
48 WC_DerCertList** ca);
49 WOLFSSL_LOCAL int wc_PKCS12_verify_ex(WC_PKCS12* pkcs12,
50 const byte* psw, word32 pswSz);
51 WOLFSSL_API WC_PKCS12* wc_PKCS12_create(char* pass, word32 passSz,
52 char* name, byte* key, word32 keySz, byte* cert, word32 certSz,
53 WC_DerCertList* ca, int nidKey, int nidCert, int iter, int macIter,
54 int keyType, void* heap);
55
56
57 WOLFSSL_LOCAL int wc_PKCS12_SetHeap(WC_PKCS12* pkcs12, void* heap);
58 WOLFSSL_LOCAL void* wc_PKCS12_GetHeap(WC_PKCS12* pkcs12);
59
60 WOLFSSL_LOCAL void wc_FreeCertList(WC_DerCertList* list, void* heap);
61
62 #ifdef __cplusplus
63 } /* extern "C" */
64 #endif
65
66 #endif /* WOLF_CRYPT_PKCS12_H */
67

22.270 openssl/pkcs7.h
1 /* pkcs7.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* pkcs7.h for openSSL */
13
14
15 #ifndef WOLFSSL_PKCS7_H_
16 #define WOLFSSL_PKCS7_H_
17
18 #include <wolfssl/openssl/ssl.h>

NetBurner, Inc.
22.270 openssl/pkcs7.h 1331

19 #include <wolfssl/wolfcrypt/pkcs7.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #if defined(OPENSSL_ALL) && defined(HAVE_PKCS7)
26
27 #define PKCS7_TEXT 0x1
28 #define PKCS7_NOCERTS 0x2
29 #define PKCS7_DETACHED 0x40
30 #define PKCS7_BINARY 0x80
31 #define PKCS7_NOINTERN 0x0010
32 #define PKCS7_NOVERIFY 0x0020
33 #define PKCS7_STREAM 0x1000
34 #define PKCS7_PARTIAL 0x4000
35
36 typedef struct WOLFSSL_PKCS7
37 {
38 PKCS7 pkcs7;
39 unsigned char* data;
40 int len;
41 int type; /* from PKCS7_TYPES, for PKCS7_final() */
42 WOLFSSL_STACK* certs;
43 } WOLFSSL_PKCS7;
44
45
46 WOLFSSL_API PKCS7* wolfSSL_PKCS7_new(void);
47 WOLFSSL_API PKCS7_SIGNED* wolfSSL_PKCS7_SIGNED_new(void);
48 WOLFSSL_API void wolfSSL_PKCS7_free(PKCS7* p7);
49 WOLFSSL_API void wolfSSL_PKCS7_SIGNED_free(PKCS7_SIGNED* p7);
50 WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7(PKCS7** p7, const unsigned char** in,
51 int len);
52 WOLFSSL_LOCAL PKCS7* wolfSSL_d2i_PKCS7_ex(PKCS7** p7, const unsigned char** in,
53 int len, byte* content, word32 contentSz);
54 WOLFSSL_API PKCS7* wolfSSL_d2i_PKCS7_bio(WOLFSSL_BIO* bio, PKCS7** p7);
55 WOLFSSL_API int wolfSSL_i2d_PKCS7_bio(WOLFSSL_BIO *bio, PKCS7 *p7);
56 WOLFSSL_API int wolfSSL_i2d_PKCS7(PKCS7 *p7, unsigned char **out);
57 WOLFSSL_API PKCS7* wolfSSL_PKCS7_sign(WOLFSSL_X509* signer,
58 WOLFSSL_EVP_PKEY* pkey, WOLFSSL_STACK* certs, WOLFSSL_BIO* in, int flags);
59 WOLFSSL_API int wolfSSL_PKCS7_verify(PKCS7* p7, WOLFSSL_STACK* certs,
60 WOLFSSL_X509_STORE* store, WOLFSSL_BIO* in, WOLFSSL_BIO* out, int flags);
61 WOLFSSL_API int wolfSSL_PKCS7_final(PKCS7* pkcs7, WOLFSSL_BIO* in, int flags);
62 WOLFSSL_API int wolfSSL_PKCS7_encode_certs(PKCS7* p7, WOLFSSL_STACK* certs,
63 WOLFSSL_BIO* out);
64 WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_to_stack(PKCS7* pkcs7);
65 WOLFSSL_API WOLFSSL_STACK* wolfSSL_PKCS7_get0_signers(PKCS7* p7,
66 WOLFSSL_STACK* certs, int flags);
67 WOLFSSL_API int wolfSSL_PEM_write_bio_PKCS7(WOLFSSL_BIO* bio, PKCS7* p7);
68 #if defined(HAVE_SMIME)
69 WOLFSSL_API PKCS7* wolfSSL_SMIME_read_PKCS7(WOLFSSL_BIO* in, WOLFSSL_BIO** bcont);
70 WOLFSSL_API int wolfSSL_SMIME_write_PKCS7(WOLFSSL_BIO* out, PKCS7* pkcs7,
71 WOLFSSL_BIO* in, int flags);
72 #endif /* HAVE_SMIME */
73
74
75 #define PKCS7_new wolfSSL_PKCS7_new
76 #define PKCS7_SIGNED_new wolfSSL_PKCS7_SIGNED_new
77 #define PKCS7_free wolfSSL_PKCS7_free
78 #define PKCS7_SIGNED_free wolfSSL_PKCS7_SIGNED_free
79 #define d2i_PKCS7 wolfSSL_d2i_PKCS7
80 #define d2i_PKCS7_bio wolfSSL_d2i_PKCS7_bio
81 #define i2d_PKCS7_bio wolfSSL_i2d_PKCS7_bio
82 #define i2d_PKCS7 wolfSSL_i2d_PKCS7
83 #define PKCS7_sign wolfSSL_PKCS7_sign
84 #define PKCS7_verify wolfSSL_PKCS7_verify
85 #define PKCS7_final wolfSSL_PKCS7_final
86 #define PKCS7_get0_signers wolfSSL_PKCS7_get0_signers
87 #define PEM_write_bio_PKCS7 wolfSSL_PEM_write_bio_PKCS7
88 #if defined(HAVE_SMIME)
89 #define SMIME_read_PKCS7 wolfSSL_SMIME_read_PKCS7
90 #define SMIME_write_PKCS7 wolfSSL_SMIME_write_PKCS7
91 #endif /* HAVE_SMIME */
92
93 #endif /* OPENSSL_ALL && HAVE_PKCS7 */
94
95 #ifdef __cplusplus
96 } /* extern "C" */
97 #endif
98
99 #endif /* WOLFSSL_PKCS7_H_ */
100

NetBurner, Inc.
1332 File Documentation

22.271 pkcs7.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.272 wolfcrypt/pkcs7.h
Go to the documentation of this file.
1 /* pkcs7.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_PKCS7_H
17 #define WOLF_CRYPT_PKCS7_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef HAVE_PKCS7
22
23 #ifndef NO_ASN
24 #include <wolfssl/wolfcrypt/asn.h>
25 #endif
26 #include <wolfssl/wolfcrypt/asn_public.h>
27 #include <wolfssl/wolfcrypt/random.h>
28 #ifndef NO_AES
29 #include <wolfssl/wolfcrypt/aes.h>
30 #endif
31 #ifndef NO_DES3
32 #include <wolfssl/wolfcrypt/des3.h>
33 #endif
34 #include <wolfssl/wolfcrypt/wc_encrypt.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /* Max number of certificates that PKCS7 structure can parse */
41 #ifndef MAX_PKCS7_CERTS
42 #ifdef OPENSSL_ALL
43 #define MAX_PKCS7_CERTS 15
44 #else
45 #define MAX_PKCS7_CERTS 4
46 #endif
47 #endif
48
49 #ifndef MAX_ORI_TYPE_SZ
50 #define MAX_ORI_TYPE_SZ MAX_OID_SZ
51 #endif
52 #ifndef MAX_ORI_VALUE_SZ
53 #define MAX_ORI_VALUE_SZ 512
54 #endif
55
56 #ifndef MAX_SIGNED_ATTRIBS_SZ
57 #define MAX_SIGNED_ATTRIBS_SZ 7
58 #endif
59
60 #ifndef MAX_AUTH_ATTRIBS_SZ
61 #define MAX_AUTH_ATTRIBS_SZ 7
62 #endif
63
64 #ifndef MAX_UNAUTH_ATTRIBS_SZ
65 #define MAX_UNAUTH_ATTRIBS_SZ 7
66 #endif
67
68 /* PKCS#7 content types, ref RFC 2315 (Section 14) */
69 enum PKCS7_TYPES {
70 PKCS7_MSG = 650, /* 1.2.840.113549.1.7 */
71 DATA = 651, /* 1.2.840.113549.1.7.1 */
72 SIGNED_DATA = 652, /* 1.2.840.113549.1.7.2 */
73 ENVELOPED_DATA = 653, /* 1.2.840.113549.1.7.3 */
74 SIGNED_AND_ENVELOPED_DATA = 654, /* 1.2.840.113549.1.7.4 */
75 DIGESTED_DATA = 655, /* 1.2.840.113549.1.7.5 */
76 ENCRYPTED_DATA = 656, /* 1.2.840.113549.1.7.6 */
77 #if defined(HAVE_LIBZ) && !defined(NO_PKCS7_COMPRESSED_DATA)
78 COMPRESSED_DATA = 678, /* 1.2.840.113549.1.9.16.1.9, RFC 3274 */
79 #endif

NetBurner, Inc.
22.272 wolfcrypt/pkcs7.h 1333

80 FIRMWARE_PKG_DATA = 685, /* 1.2.840.113549.1.9.16.1.16, RFC 4108 */


81 AUTH_ENVELOPED_DATA = 692 /* 1.2.840.113549.1.9.16.1.23, RFC 5083 */
82 };
83
84 enum PKCS7_STATE {
85 WC_PKCS7_START = 0,
86
87 /* decode encrypted */
88 WC_PKCS7_STAGE2,
89 WC_PKCS7_STAGE3,
90 WC_PKCS7_STAGE4,
91 WC_PKCS7_STAGE5,
92 WC_PKCS7_STAGE6,
93
94 WC_PKCS7_VERIFY_STAGE2,
95 WC_PKCS7_VERIFY_STAGE3,
96 WC_PKCS7_VERIFY_STAGE4,
97 WC_PKCS7_VERIFY_STAGE5,
98 WC_PKCS7_VERIFY_STAGE6,
99
100 /* parse info set */
101 WC_PKCS7_INFOSET_START,
102 WC_PKCS7_INFOSET_BER,
103 WC_PKCS7_INFOSET_STAGE1,
104 WC_PKCS7_INFOSET_STAGE2,
105 WC_PKCS7_INFOSET_END,
106
107 /* decode enveloped data */
108 WC_PKCS7_ENV_2,
109 WC_PKCS7_ENV_3,
110 WC_PKCS7_ENV_4,
111 WC_PKCS7_ENV_5,
112
113 /* decode auth enveloped */
114 WC_PKCS7_AUTHENV_2,
115 WC_PKCS7_AUTHENV_3,
116 WC_PKCS7_AUTHENV_4,
117 WC_PKCS7_AUTHENV_5,
118 WC_PKCS7_AUTHENV_6,
119 WC_PKCS7_AUTHENV_ATRB,
120 WC_PKCS7_AUTHENV_ATRBEND,
121 WC_PKCS7_AUTHENV_7,
122
123 /* decryption state types */
124 WC_PKCS7_DECRYPT_KTRI,
125 WC_PKCS7_DECRYPT_KTRI_2,
126 WC_PKCS7_DECRYPT_KTRI_3,
127
128
129 WC_PKCS7_DECRYPT_KARI,
130 WC_PKCS7_DECRYPT_KEKRI,
131 WC_PKCS7_DECRYPT_PWRI,
132 WC_PKCS7_DECRYPT_ORI,
133
134 WC_PKCS7_DECRYPT_DONE,
135
136 };
137
138 enum Pkcs7_Misc {
139 PKCS7_NONCE_SZ = 16,
140 MAX_ENCRYPTED_KEY_SZ = 512, /* max enc. key size, RSA <= 4096 */
141 MAX_CONTENT_KEY_LEN = 32, /* highest current cipher is AES-256-CBC */
142 MAX_CONTENT_IV_SIZE = 16, /* highest current is AES128 */
143 #ifndef NO_AES
144 MAX_CONTENT_BLOCK_LEN = AES_BLOCK_SIZE,
145 #else
146 MAX_CONTENT_BLOCK_LEN = DES_BLOCK_SIZE,
147 #endif
148 MAX_RECIP_SZ = MAX_VERSION_SZ +
149 MAX_SEQ_SZ + WC_ASN_NAME_MAX + MAX_SN_SZ +
150 MAX_SEQ_SZ + MAX_ALGO_SZ + 1 + MAX_ENCRYPTED_KEY_SZ,
151 };
152
153 enum Cms_Options {
154 CMS_SKID = 1,
155 CMS_ISSUER_AND_SERIAL_NUMBER = 2,
156 };
157 #define DEGENERATE_SID 3
158
159 /* CMS/PKCS#7 RecipientInfo types, RFC 5652, Section 6.2 */
160 enum Pkcs7_RecipientInfo_Types {
161 PKCS7_KTRI = 0,
162 PKCS7_KARI = 1,
163 PKCS7_KEKRI = 2,
164 PKCS7_PWRI = 3,
165 PKCS7_ORI = 4
166 };

NetBurner, Inc.
1334 File Documentation

167
168 typedef struct PKCS7Attrib {
169 const byte* oid;
170 word32 oidSz;
171 const byte* value;
172 word32 valueSz;
173 } PKCS7Attrib;
174
175
176 typedef struct PKCS7DecodedAttrib {
177 struct PKCS7DecodedAttrib* next;
178 byte* oid;
179 word32 oidSz;
180 byte* value;
181 word32 valueSz;
182 } PKCS7DecodedAttrib;
183
184 typedef struct PKCS7State PKCS7State;
185 typedef struct Pkcs7Cert Pkcs7Cert;
186 typedef struct Pkcs7EncodedRecip Pkcs7EncodedRecip;
187 typedef struct PKCS7 PKCS7;
188 typedef struct PKCS7 PKCS7_SIGNED;
189 typedef struct PKCS7SignerInfo PKCS7SignerInfo;
190
191 /* OtherRecipientInfo decrypt callback prototype */
192 typedef int (*CallbackOriDecrypt)(PKCS7* pkcs7, byte* oriType, word32 oriTypeSz,
193 byte* oriValue, word32 oriValueSz,
194 byte* decryptedKey, word32* decryptedKeySz,
195 void* ctx);
196 typedef int (*CallbackOriEncrypt)(PKCS7* pkcs7, byte* cek, word32 cekSz,
197 byte* oriType, word32* oriTypeSz,
198 byte* oriValue, word32* oriValueSz,
199 void* ctx);
200 typedef int (*CallbackDecryptContent)(PKCS7* pkcs7, int encryptOID,
201 byte* iv, int ivSz, byte* aad, word32 aadSz,
202 byte* authTag, word32 authTagSz, byte* in,
203 int inSz, byte* out, void* ctx);
204 typedef int (*CallbackWrapCEK)(PKCS7* pkcs7, byte* cek, word32 cekSz,
205 byte* keyId, word32 keyIdSz,
206 byte* originKey, word32 originKeySz,
207 byte* out, word32 outSz,
208 int keyWrapAlgo, int type, int dir);
209
210 #if defined(HAVE_PKCS7_RSA_RAW_SIGN_CALLBACK) && !defined(NO_RSA)
211 /* RSA sign raw digest callback, user builds DigestInfo */
212 typedef int (*CallbackRsaSignRawDigest)(PKCS7* pkcs7, byte* digest,
213 word32 digestSz, byte* out, word32 outSz,
214 byte* privateKey, word32 privateKeySz,
215 int devId, int hashOID);
216 #endif
217
218 /* Public Structure Warning:
219 * Existing members must not be changed to maintain backwards compatibility!
220 */
221 struct PKCS7 {
222 WC_RNG* rng;
223 PKCS7Attrib* signedAttribs;
224 byte* content; /* inner content, not owner */
225 byte* contentDynamic; /* content if constructed OCTET_STRING */
226 byte* singleCert; /* recipient cert, DER, not owner */
227 const byte* issuer; /* issuer name of singleCert */
228 byte* privateKey; /* private key, DER, not owner */
229 void* heap; /* heap hint for dynamic memory */
230 #ifdef ASN_BER_TO_DER
231 byte* der; /* DER encoded version of message */
232 word32 derSz;
233 #endif
234 byte* cert[MAX_PKCS7_CERTS]; /* array of certs parsed from bundle */
235 byte* verifyCert; /* cert from array used for verify */
236 word32 verifyCertSz;
237
238 /* Encrypted-data Content Type */
239 byte* encryptionKey; /* block cipher encryption key */
240 PKCS7Attrib* unprotectedAttribs; /* optional */
241 PKCS7DecodedAttrib* decodedAttrib; /* linked list of decoded attribs */
242
243 /* Enveloped-data optional ukm, not owner */
244 byte* ukm;
245 word32 ukmSz;
246
247 word32 encryptionKeySz; /* size of key buffer, bytes */
248 word32 unprotectedAttribsSz;
249 word32 contentSz; /* content size */
250 word32 singleCertSz; /* size of recipient cert buffer, bytes */
251 word32 issuerSz; /* length of issuer name */
252 word32 issuerSnSz; /* length of serial number */
253

NetBurner, Inc.
22.272 wolfcrypt/pkcs7.h 1335

254 word32 publicKeySz;


255 word32 publicKeyOID; /* key OID (RSAk, ECDSAk, etc) */
256 word32 privateKeySz; /* size of private key buffer, bytes */
257 word32 signedAttribsSz;
258 int contentOID; /* PKCS#7 content type OID sum */
259 int hashOID;
260 int encryptOID; /* key encryption algorithm OID */
261 int keyWrapOID; /* key wrap algorithm OID */
262 int keyAgreeOID; /* key agreement algorithm OID */
263 int devId; /* device ID for HW based private key */
264 byte issuerHash[KEYID_SIZE]; /* hash of all alt Names */
265 byte issuerSn[MAX_SN_SZ]; /* singleCert’s serial number */
266 byte publicKey[MAX_RSA_INT_SZ + MAX_RSA_E_SZ]; /* MAX RSA key size (m + e)*/
267 word32 certSz[MAX_PKCS7_CERTS];
268
269 /* flags - up to 16-bits */
270 word16 isDynamic:1;
271 word16 noDegenerate:1; /* allow degenerate case in verify function */
272 word16 detached:1; /* generate detached SignedData signature bundles */
273
274 byte contentType[MAX_OID_SZ]; /* custom contentType byte array */
275 word32 contentTypeSz; /* size of contentType, bytes */
276
277 int sidType; /* SignerIdentifier type to use, of type
278 Pkcs7_SignerIdentifier_Types, default to
279 SID_ISSUER_AND_SERIAL_NUMBER */
280 byte issuerSubjKeyId[KEYID_SIZE]; /* SubjectKeyIdentifier of singleCert */
281 Pkcs7Cert* certList; /* certificates list for SignedData set */
282 Pkcs7EncodedRecip* recipList; /* recipients list */
283 byte* cek; /* content encryption key, random, dynamic */
284 word32 cekSz; /* size of cek, bytes */
285 byte* pass; /* password, for PWRI decryption */
286 word32 passSz; /* size of pass, bytes */
287 int kekEncryptOID; /* KEK encryption algorithm OID */
288
289 CallbackOriEncrypt oriEncryptCb; /* ORI encrypt callback */
290 CallbackOriDecrypt oriDecryptCb; /* ORI decrypt callback */
291 void* oriEncryptCtx; /* ORI encrypt user context ptr */
292 void* oriDecryptCtx; /* ORI decrypt user context ptr */
293
294 PKCS7Attrib* authAttribs; /* authenticated attribs */
295 word32 authAttribsSz;
296 PKCS7Attrib* unauthAttribs; /* unauthenticated attribs */
297 word32 unauthAttribsSz;
298
299 #ifndef NO_PKCS7_STREAM
300 PKCS7State* stream;
301 #endif
302 word32 state;
303
304 word16 skipDefaultSignedAttribs:1; /* skip adding default signed attribs */
305
306 byte version; /* 1 for RFC 2315 and 3 for RFC 4108 */
307 PKCS7SignerInfo* signerInfo;
308 CallbackDecryptContent decryptionCb;
309 CallbackWrapCEK wrapCEKCb;
310 void* decryptionCtx;
311
312 byte* signature;
313 byte* plainDigest;
314 byte* pkcs7Digest;
315 word32 signatureSz;
316 word32 plainDigestSz;
317 word32 pkcs7DigestSz;
318
319 #if defined(HAVE_PKCS7_RSA_RAW_SIGN_CALLBACK) && !defined(NO_RSA)
320 CallbackRsaSignRawDigest rsaSignRawDigestCb;
321 #endif
322
323 /* used by DecodeEnvelopedData with multiple encrypted contents */
324 byte* cachedEncryptedContent;
325 word32 cachedEncryptedContentSz;
326 word16 contentCRLF:1; /* have content line endings been converted to CRLF */
327 /* !! NEW DATA MEMBERS MUST BE ADDED AT END !! */
328 };
329
330 WOLFSSL_API PKCS7* wc_PKCS7_New(void* heap, int devId);
331 WOLFSSL_API int wc_PKCS7_Init(PKCS7* pkcs7, void* heap, int devId);
332 WOLFSSL_API int wc_PKCS7_InitWithCert(PKCS7* pkcs7, byte* der, word32 derSz);
333 WOLFSSL_API int wc_PKCS7_AddCertificate(PKCS7* pkcs7, byte* der, word32 derSz);
334 WOLFSSL_API void wc_PKCS7_Free(PKCS7* pkcs7);
335
336 WOLFSSL_API int wc_PKCS7_GetAttributeValue(PKCS7* pkcs7, const byte* oid,
337 word32 oidSz, byte* out, word32* outSz);
338
339 WOLFSSL_API int wc_PKCS7_SetSignerIdentifierType(PKCS7* pkcs7, int type);
340 WOLFSSL_API int wc_PKCS7_SetContentType(PKCS7* pkcs7, byte* contentType,

NetBurner, Inc.
1336 File Documentation

341 word32 sz);


342 WOLFSSL_API int wc_PKCS7_GetPadSize(word32 inputSz, word32 blockSz);
343 WOLFSSL_API int wc_PKCS7_PadData(byte* in, word32 inSz, byte* out, word32 outSz,
344 word32 blockSz);
345
346 /* CMS/PKCS#7 Data */
347 WOLFSSL_API int wc_PKCS7_EncodeData(PKCS7* pkcs7, byte* output,
348 word32 outputSz);
349
350 /* CMS/PKCS#7 SignedData */
351 WOLFSSL_API int wc_PKCS7_SetDetached(PKCS7* pkcs7, word16 flag);
352 WOLFSSL_API int wc_PKCS7_NoDefaultSignedAttribs(PKCS7* pkcs7);
353 WOLFSSL_API int wc_PKCS7_EncodeSignedData(PKCS7* pkcs7,
354 byte* output, word32 outputSz);
355 WOLFSSL_API int wc_PKCS7_EncodeSignedData_ex(PKCS7* pkcs7, const byte* hashBuf,
356 word32 hashSz, byte* outputHead,
357 word32* outputHeadSz,
358 byte* outputFoot,
359 word32* outputFootSz);
360 WOLFSSL_API void wc_PKCS7_AllowDegenerate(PKCS7* pkcs7, word16 flag);
361 WOLFSSL_API int wc_PKCS7_VerifySignedData(PKCS7* pkcs7,
362 byte* pkiMsg, word32 pkiMsgSz);
363 WOLFSSL_API int wc_PKCS7_VerifySignedData_ex(PKCS7* pkcs7, const byte* hashBuf,
364 word32 hashSz, byte* pkiMsgHead,
365 word32 pkiMsgHeadSz, byte* pkiMsgFoot,
366 word32 pkiMsgFootSz);
367
368 WOLFSSL_API int wc_PKCS7_GetSignerSID(PKCS7* pkcs7, byte* out, word32* outSz);
369
370 /* CMS single-shot API for Signed FirmwarePkgData */
371 WOLFSSL_API int wc_PKCS7_EncodeSignedFPD(PKCS7* pkcs7, byte* privateKey,
372 word32 privateKeySz, int signOID,
373 int hashOID, byte* content,
374 word32 contentSz,
375 PKCS7Attrib* signedAttribs,
376 word32 signedAttribsSz, byte* output,
377 word32 outputSz);
378 #ifndef NO_PKCS7_ENCRYPTED_DATA
379 /* CMS single-shot API for Signed Encrypted FirmwarePkgData */
380 WOLFSSL_API int wc_PKCS7_EncodeSignedEncryptedFPD(PKCS7* pkcs7,
381 byte* encryptKey, word32 encryptKeySz,
382 byte* privateKey, word32 privateKeySz,
383 int encryptOID, int signOID,
384 int hashOID, byte* content,
385 word32 contentSz,
386 PKCS7Attrib* unprotectedAttribs,
387 word32 unprotectedAttribsSz,
388 PKCS7Attrib* signedAttribs,
389 word32 signedAttribsSz,
390 byte* output, word32 outputSz);
391 #endif /* NO_PKCS7_ENCRYPTED_DATA */
392 #if defined(HAVE_LIBZ) && !defined(NO_PKCS7_COMPRESSED_DATA)
393 /* CMS single-shot API for Signed Compressed FirmwarePkgData */
394 WOLFSSL_API int wc_PKCS7_EncodeSignedCompressedFPD(PKCS7* pkcs7,
395 byte* privateKey, word32 privateKeySz,
396 int signOID, int hashOID,
397 byte* content, word32 contentSz,
398 PKCS7Attrib* signedAttribs,
399 word32 signedAttribsSz, byte* output,
400 word32 outputSz);
401
402 #ifndef NO_PKCS7_ENCRYPTED_DATA
403 /* CMS single-shot API for Signed Encrypted Compressed FirmwarePkgData */
404 WOLFSSL_API int wc_PKCS7_EncodeSignedEncryptedCompressedFPD(PKCS7* pkcs7,
405 byte* encryptKey, word32 encryptKeySz,
406 byte* privateKey, word32 privateKeySz,
407 int encryptOID, int signOID,
408 int hashOID, byte* content,
409 word32 contentSz,
410 PKCS7Attrib* unprotectedAttribs,
411 word32 unprotectedAttribsSz,
412 PKCS7Attrib* signedAttribs,
413 word32 signedAttribsSz,
414 byte* output, word32 outputSz);
415 #endif /* !NO_PKCS7_ENCRYPTED_DATA */
416 #endif /* HAVE_LIBZ && !NO_PKCS7_COMPRESSED_DATA */
417
418 /* EnvelopedData and AuthEnvelopedData RecipientInfo functions */
419 WOLFSSL_API int wc_PKCS7_AddRecipient_KTRI(PKCS7* pkcs7, const byte* cert,
420 word32 certSz, int options);
421 WOLFSSL_API int wc_PKCS7_AddRecipient_KARI(PKCS7* pkcs7, const byte* cert,
422 word32 certSz, int keyWrapOID,
423 int keyAgreeOID, byte* ukm,
424 word32 ukmSz, int options);
425
426 WOLFSSL_API int wc_PKCS7_SetKey(PKCS7* pkcs7, byte* key, word32 keySz);
427 WOLFSSL_API int wc_PKCS7_AddRecipient_KEKRI(PKCS7* pkcs7, int keyWrapOID,

NetBurner, Inc.
22.273 rand.h 1337

428 byte* kek, word32 kekSz,


429 byte* keyID, word32 keyIdSz,
430 void* timePtr, byte* otherOID,
431 word32 otherOIDSz, byte* other,
432 word32 otherSz, int options);
433
434 WOLFSSL_API int wc_PKCS7_SetPassword(PKCS7* pkcs7, byte* passwd, word32 pLen);
435 WOLFSSL_API int wc_PKCS7_AddRecipient_PWRI(PKCS7* pkcs7, byte* passwd,
436 word32 pLen, byte* salt,
437 word32 saltSz, int kdfOID,
438 int prfOID, int iterations,
439 int kekEncryptOID, int options);
440 WOLFSSL_API int wc_PKCS7_SetOriEncryptCtx(PKCS7* pkcs7, void* ctx);
441 WOLFSSL_API int wc_PKCS7_SetOriDecryptCtx(PKCS7* pkcs7, void* ctx);
442 WOLFSSL_API int wc_PKCS7_SetOriDecryptCb(PKCS7* pkcs7, CallbackOriDecrypt cb);
443 WOLFSSL_API int wc_PKCS7_AddRecipient_ORI(PKCS7* pkcs7, CallbackOriEncrypt cb,
444 int options);
445 WOLFSSL_API int wc_PKCS7_SetWrapCEKCb(PKCS7* pkcs7,
446 CallbackWrapCEK wrapCEKCb);
447
448 #if defined(HAVE_PKCS7_RSA_RAW_SIGN_CALLBACK) && !defined(NO_RSA)
449 WOLFSSL_API int wc_PKCS7_SetRsaSignRawDigestCb(PKCS7* pkcs7,
450 CallbackRsaSignRawDigest cb);
451 #endif
452
453 /* CMS/PKCS#7 EnvelopedData */
454 WOLFSSL_API int wc_PKCS7_EncodeEnvelopedData(PKCS7* pkcs7,
455 byte* output, word32 outputSz);
456 WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* pkiMsg,
457 word32 pkiMsgSz, byte* output,
458 word32 outputSz);
459
460 /* CMS/PKCS#7 AuthEnvelopedData */
461 WOLFSSL_API int wc_PKCS7_EncodeAuthEnvelopedData(PKCS7* pkcs7,
462 byte* output, word32 outputSz);
463 WOLFSSL_API int wc_PKCS7_DecodeAuthEnvelopedData(PKCS7* pkcs7, byte* pkiMsg,
464 word32 pkiMsgSz, byte* output,
465 word32 outputSz);
466
467 /* CMS/PKCS#7 EncryptedData */
468 #ifndef NO_PKCS7_ENCRYPTED_DATA
469 WOLFSSL_API int wc_PKCS7_EncodeEncryptedData(PKCS7* pkcs7,
470 byte* output, word32 outputSz);
471 WOLFSSL_API int wc_PKCS7_DecodeEncryptedData(PKCS7* pkcs7, byte* pkiMsg,
472 word32 pkiMsgSz, byte* output,
473 word32 outputSz);
474 WOLFSSL_API int wc_PKCS7_SetDecodeEncryptedCb(PKCS7* pkcs7,
475 CallbackDecryptContent decryptionCb);
476 WOLFSSL_API int wc_PKCS7_SetDecodeEncryptedCtx(PKCS7* pkcs7, void* ctx);
477 #endif /* NO_PKCS7_ENCRYPTED_DATA */
478
479 /* CMS/PKCS#7 CompressedData */
480 #if defined(HAVE_LIBZ) && !defined(NO_PKCS7_COMPRESSED_DATA)
481 WOLFSSL_API int wc_PKCS7_EncodeCompressedData(PKCS7* pkcs7, byte* output,
482 word32 outputSz);
483 WOLFSSL_API int wc_PKCS7_DecodeCompressedData(PKCS7* pkcs7, byte* pkiMsg,
484 word32 pkiMsgSz, byte* output,
485 word32 outputSz);
486 #endif /* HAVE_LIBZ && !NO_PKCS7_COMPRESSED_DATA */
487
488 #ifdef __cplusplus
489 } /* extern "C" */
490 #endif
491
492 #endif /* HAVE_PKCS7 */
493 #endif /* WOLF_CRYPT_PKCS7_H */
494

22.273 rand.h
1 /* rand.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* rand.h for openSSL */
13
14 #include <wolfssl/openssl/ssl.h>
15 #include <wolfssl/wolfcrypt/random.h>

NetBurner, Inc.
1338 File Documentation

16
17 typedef WOLFSSL_RAND_METHOD RAND_METHOD;
18
19 #define RAND_set_rand_method wolfSSL_RAND_set_rand_method

22.274 rc4.h
1 /* rc4.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 /* rc4.h defines mini des openssl compatibility layer
15 *
16 */
17
18 #ifndef WOLFSSL_RC4_COMPAT_H_
19 #define WOLFSSL_RC4_COMPAT_H_
20
21 #include <wolfssl/wolfcrypt/settings.h>
22 #include <wolfssl/openssl/ssl.h> /* included for size_t */
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /* applications including wolfssl/openssl/rc4.h are expecting to have access to
29 * the size of RC4_KEY structures. */
30 typedef struct WOLFSSL_RC4_KEY {
31 /* big enough for Arc4 from wolfssl/wolfcrypt/arc4.h */
32 void* holder[(272 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
33 } WOLFSSL_RC4_KEY;
34 typedef WOLFSSL_RC4_KEY RC4_KEY;
35
36 WOLFSSL_API void wolfSSL_RC4_set_key(WOLFSSL_RC4_KEY* key, int len,
37 const unsigned char* data);
38 WOLFSSL_API void wolfSSL_RC4(WOLFSSL_RC4_KEY* key, size_t len,
39 const unsigned char* in, unsigned char* out);
40
41 #define RC4 wolfSSL_RC4
42 #define RC4_set_key wolfSSL_RC4_set_key
43
44 #ifdef __cplusplus
45 } /* extern "C" */
46 #endif
47
48 #endif /* WOLFSSL_RC4_COMPAT_H_ */
49

22.275 openssl/ripemd.h
1 /* ripemd.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* ripemd.h for openssl */
13
14
15 #ifndef WOLFSSL_RIPEMD_H_
16 #define WOLFSSL_RIPEMD_H_
17
18 #include <wolfssl/wolfcrypt/settings.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23

NetBurner, Inc.
22.276 ripemd.h File Reference 1339

24
25 typedef struct WOLFSSL_RIPEMD_CTX {
26 int holder[32]; /* big enough to hold wolfcrypt, but check on init */
27 } WOLFSSL_RIPEMD_CTX;
28
29 WOLFSSL_API void wolfSSL_RIPEMD_Init(WOLFSSL_RIPEMD_CTX*);
30 WOLFSSL_API void wolfSSL_RIPEMD_Update(WOLFSSL_RIPEMD_CTX*, const void*,
31 unsigned long);
32 WOLFSSL_API void wolfSSL_RIPEMD_Final(unsigned char*, WOLFSSL_RIPEMD_CTX*);
33
34
35 typedef WOLFSSL_RIPEMD_CTX RIPEMD_CTX;
36
37 #define RIPEMD_Init wolfSSL_RIPEMD_Init
38 #define RIPEMD_Update wolfSSL_RIPEMD_Update
39 #define RIPEMD_Final wolfSSL_RIPEMD_Final
40
41
42 #ifdef __cplusplus
43 } /* extern "C" */
44 #endif
45
46
47 #endif /* WOLFSSL_MD5_H_ */
48

22.276 ripemd.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.277 wolfcrypt/ripemd.h
Go to the documentation of this file.
1 /* ripemd.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_RIPEMD_H
17 #define WOLF_CRYPT_RIPEMD_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef WOLFSSL_RIPEMD
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27
28 /* in bytes */
29 enum {
30 RIPEMD = 3, /* hash type unique */
31 RIPEMD_BLOCK_SIZE = 64,
32 RIPEMD_DIGEST_SIZE = 20,
33 RIPEMD_PAD_SIZE = 56
34 };
35
36
37 /* RipeMd 160 digest */
38 typedef struct RipeMd {
39 word32 buffLen; /* in bytes */
40 word32 loLen; /* length in bytes */
41 word32 hiLen; /* length in bytes */
42 word32 digest[RIPEMD_DIGEST_SIZE / sizeof(word32)];
43 word32 buffer[RIPEMD_BLOCK_SIZE / sizeof(word32)];
44 } RipeMd;
45
46
47 WOLFSSL_API int wc_InitRipeMd(RipeMd* ripemd);
48 WOLFSSL_API int wc_RipeMdUpdate(RipeMd* ripemd, const byte* data, word32 len);
49 WOLFSSL_API int wc_RipeMdFinal(RipeMd* ripemd, byte* hash);
50

NetBurner, Inc.
1340 File Documentation

51
52 #ifdef __cplusplus
53 } /* extern "C" */
54 #endif
55
56 #endif /* WOLFSSL_RIPEMD */
57 #endif /* WOLF_CRYPT_RIPEMD_H */

22.278 openssl/rsa.h
1 /* rsa.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* rsa.h for openSSL */
13
14
15 #ifndef WOLFSSL_RSA_H_
16 #define WOLFSSL_RSA_H_
17
18 #include <wolfssl/openssl/bn.h>
19 #include <wolfssl/openssl/err.h>
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
27 /* Padding types */
28 #define RSA_PKCS1_PADDING 0
29 #define RSA_PKCS1_OAEP_PADDING 1
30 #define RSA_PKCS1_PSS_PADDING 2
31 #define RSA_NO_PADDING 3
32
33 /* Emulate OpenSSL flags */
34 #define RSA_METHOD_FLAG_NO_CHECK (1 « 1)
35 #define RSA_FLAG_CACHE_PUBLIC (1 « 2)
36 #define RSA_FLAG_CACHE_PRIVATE (1 « 3)
37 #define RSA_FLAG_BLINDING (1 « 4)
38 #define RSA_FLAG_THREAD_SAFE (1 « 5)
39 #define RSA_FLAG_EXT_PKEY (1 « 6)
40 #define RSA_FLAG_NO_BLINDING (1 « 7)
41 #define RSA_FLAG_NO_CONSTTIME (1 « 8)
42
43 /* Salt length same as digest length */
44 #define RSA_PSS_SALTLEN_DIGEST (-1)
45 /* Old max salt length */
46 #define RSA_PSS_SALTLEN_MAX_SIGN (-2)
47 /* Max salt length */
48 #define RSA_PSS_SALTLEN_MAX (-3)
49 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
50
51 typedef struct WOLFSSL_RSA_METHOD {
52 /* Flags of RSA key implementation. */
53 int flags;
54 /* Name of RSA key implementation. */
55 char *name;
56 /* RSA method dynamically allocated. */
57 word16 dynamic:1;
58 } WOLFSSL_RSA_METHOD;
59
60 #ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */
61 #define WOLFSSL_RSA_TYPE_DEFINED
62 /* RSA key compatable with OpenSSL. */
63 typedef struct WOLFSSL_RSA {
64 WOLFSSL_BIGNUM* n; /* Modulus. */
65 WOLFSSL_BIGNUM* e; /* Public exponent. */
66 WOLFSSL_BIGNUM* d; /* Private exponent. */
67 WOLFSSL_BIGNUM* p; /* First prime. */
68 WOLFSSL_BIGNUM* q; /* Second prime. */
69 WOLFSSL_BIGNUM* dmp1; /* dP = d mod (p - 1) */
70 WOLFSSL_BIGNUM* dmq1; /* dQ = d mod (q - 1) */
71 WOLFSSL_BIGNUM* iqmp; /* u = (1 / q) mod p */
72 void* heap; /* Heap used for memory allocations. */
73 void* internal; /* wolfCrypt RSA key. */
74 #if defined(OPENSSL_EXTRA)
75 const WOLFSSL_RSA_METHOD* meth; /* RSA method. */

NetBurner, Inc.
22.278 openssl/rsa.h 1341

76 #endif
77 #ifdef HAVE_EX_DATA
78 WOLFSSL_CRYPTO_EX_DATA ex_data; /* external data */
79 #endif
80 wolfSSL_Ref ref; /* Reference count information. */
81 word16 pkcs8HeaderSz; /* Size of PKCS#8 header from decode. */
82 int flags; /* Flags of implementation. */
83
84 /* bits */
85 byte inSet:1; /* Internal set from external. */
86 byte exSet:1; /* External set from internal. */
87 byte ownRng:1; /* Rng needs to be free’d. */
88 } WOLFSSL_RSA;
89 #endif
90
91 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
92 typedef WOLFSSL_RSA RSA;
93 typedef WOLFSSL_RSA_METHOD RSA_METHOD;
94 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
95
96 WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_new_ex(void* heap, int devId);
97 WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_new(void);
98 WOLFSSL_API void wolfSSL_RSA_free(WOLFSSL_RSA* rsa);
99
100 WOLFSSL_API int wolfSSL_RSA_generate_key_ex(WOLFSSL_RSA* rsa, int bits,
101 WOLFSSL_BIGNUM* bn, void* cb);
102
103 WOLFSSL_API int wolfSSL_RSA_blinding_on(WOLFSSL_RSA* rsa, WOLFSSL_BN_CTX* bn);
104 WOLFSSL_API int wolfSSL_RSA_check_key(const WOLFSSL_RSA* rsa);
105 WOLFSSL_API int wolfSSL_RSA_public_encrypt(int len, const unsigned char* fr,
106 unsigned char* to, WOLFSSL_RSA* rsa,
107 int padding);
108 WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, const unsigned char* fr,
109 unsigned char* to, WOLFSSL_RSA* rsa,
110 int padding);
111 WOLFSSL_API int wolfSSL_RSA_private_encrypt(int len, const unsigned char* in,
112 unsigned char* out, WOLFSSL_RSA* rsa, int padding);
113
114 WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA* rsa);
115 WOLFSSL_API int wolfSSL_RSA_bits(const WOLFSSL_RSA* rsa);
116 WOLFSSL_API int wolfSSL_RSA_sign(int type, const unsigned char* m,
117 unsigned int mLen, unsigned char* sigRet,
118 unsigned int* sigLen, WOLFSSL_RSA* rsa);
119 WOLFSSL_API int wolfSSL_RSA_sign_ex(int type, const unsigned char* m,
120 unsigned int mLen, unsigned char* sigRet,
121 unsigned int* sigLen, WOLFSSL_RSA* rsa,
122 int flag);
123 WOLFSSL_API int wolfSSL_RSA_sign_generic_padding(int type, const unsigned char* m,
124 unsigned int mLen, unsigned char* sigRet,
125 unsigned int* sigLen, WOLFSSL_RSA* rsa, int flag,
126 int padding);
127 WOLFSSL_API int wolfSSL_RSA_verify(int type, const unsigned char* m,
128 unsigned int mLen, const unsigned char* sig,
129 unsigned int sigLen, WOLFSSL_RSA* rsa);
130 WOLFSSL_API int wolfSSL_RSA_verify_ex(int type, const unsigned char* m,
131 unsigned int mLen, const unsigned char* sig,
132 unsigned int sigLen, WOLFSSL_RSA* rsa,
133 int padding);
134 WOLFSSL_API int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from,
135 unsigned char* to, WOLFSSL_RSA* rsa, int padding);
136 WOLFSSL_API int wolfSSL_RSA_GenAdd(WOLFSSL_RSA* rsa);
137 WOLFSSL_API int wolfSSL_RSA_LoadDer(WOLFSSL_RSA* rsa,
138 const unsigned char* derBuf, int derSz);
139 WOLFSSL_API int wolfSSL_RSA_LoadDer_ex(WOLFSSL_RSA* rsa,
140 const unsigned char* derBuf, int derSz, int opt);
141
142 WOLFSSL_API WOLFSSL_RSA_METHOD *wolfSSL_RSA_meth_new(const char *name, int flags);
143 WOLFSSL_API void wolfSSL_RSA_meth_free(WOLFSSL_RSA_METHOD *meth);
144 WOLFSSL_API int wolfSSL_RSA_meth_set(WOLFSSL_RSA_METHOD *rsa, void* p);
145 WOLFSSL_API int wolfSSL_RSA_set_method(WOLFSSL_RSA *rsa, WOLFSSL_RSA_METHOD *meth);
146 WOLFSSL_API const WOLFSSL_RSA_METHOD* wolfSSL_RSA_get_method(const WOLFSSL_RSA *rsa);
147 WOLFSSL_API const WOLFSSL_RSA_METHOD* wolfSSL_RSA_get_default_method(void);
148
149 WOLFSSL_API void wolfSSL_RSA_get0_crt_params(const WOLFSSL_RSA *r,
150 const WOLFSSL_BIGNUM **dmp1,
151 const WOLFSSL_BIGNUM **dmq1,
152 const WOLFSSL_BIGNUM **iqmp);
153 WOLFSSL_API int wolfSSL_RSA_set0_crt_params(WOLFSSL_RSA *r, WOLFSSL_BIGNUM *dmp1,
154 WOLFSSL_BIGNUM *dmq1, WOLFSSL_BIGNUM *iqmp);
155 WOLFSSL_API void wolfSSL_RSA_get0_factors(const WOLFSSL_RSA *r, const WOLFSSL_BIGNUM **p,
156 const WOLFSSL_BIGNUM **q);
157 WOLFSSL_API int wolfSSL_RSA_set0_factors(WOLFSSL_RSA *r, WOLFSSL_BIGNUM *p, WOLFSSL_BIGNUM *q);
158 WOLFSSL_API void wolfSSL_RSA_get0_key(const WOLFSSL_RSA *r, const WOLFSSL_BIGNUM **n,
159 const WOLFSSL_BIGNUM **e, const WOLFSSL_BIGNUM **d);
160 WOLFSSL_API int wolfSSL_RSA_set0_key(WOLFSSL_RSA *r, WOLFSSL_BIGNUM *n, WOLFSSL_BIGNUM *e,
161 WOLFSSL_BIGNUM *d);
162 WOLFSSL_API int wolfSSL_RSA_flags(const WOLFSSL_RSA *r);

NetBurner, Inc.
1342 File Documentation

163 WOLFSSL_API void wolfSSL_RSA_set_flags(WOLFSSL_RSA *r, int flags);


164 WOLFSSL_API void wolfSSL_RSA_clear_flags(WOLFSSL_RSA *r, int flags);
165 WOLFSSL_API int wolfSSL_RSA_test_flags(const WOLFSSL_RSA *r, int flags);
166
167 WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSAPublicKey_dup(WOLFSSL_RSA *rsa);
168
169 WOLFSSL_API void* wolfSSL_RSA_get_ex_data(const WOLFSSL_RSA *rsa, int idx);
170 WOLFSSL_API int wolfSSL_RSA_set_ex_data(WOLFSSL_RSA *rsa, int idx, void *data);
171 #ifdef HAVE_EX_DATA_CLEANUP_HOOKS
172 WOLFSSL_API int wolfSSL_RSA_set_ex_data_with_cleanup(
173 WOLFSSL_RSA *rsa,
174 int idx,
175 void *data,
176 wolfSSL_ex_data_cleanup_routine_t cleanup_routine);
177 #endif
178
179 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
180 #define WOLFSSL_RSA_LOAD_PRIVATE 1
181 #define WOLFSSL_RSA_LOAD_PUBLIC 2
182 #define WOLFSSL_RSA_F4 0x10001L
183
184 #define RSA_new wolfSSL_RSA_new
185 #define RSA_free wolfSSL_RSA_free
186
187 #define RSA_generate_key_ex wolfSSL_RSA_generate_key_ex
188
189 #define RSA_blinding_on wolfSSL_RSA_blinding_on
190 #define RSA_check_key wolfSSL_RSA_check_key
191 #define RSA_public_encrypt wolfSSL_RSA_public_encrypt
192 #define RSA_private_decrypt wolfSSL_RSA_private_decrypt
193 #define RSA_private_encrypt wolfSSL_RSA_private_encrypt
194
195 #define RSA_size wolfSSL_RSA_size
196 #define RSA_sign wolfSSL_RSA_sign
197 #define RSA_verify wolfSSL_RSA_verify
198 #define RSA_public_decrypt wolfSSL_RSA_public_decrypt
199
200 #define RSA_meth_new wolfSSL_RSA_meth_new
201 #define RSA_meth_free wolfSSL_RSA_meth_free
202 #define RSA_meth_set_pub_enc wolfSSL_RSA_meth_set
203 #define RSA_meth_set_pub_dec wolfSSL_RSA_meth_set
204 #define RSA_meth_set_priv_enc wolfSSL_RSA_meth_set
205 #define RSA_meth_set_priv_dec wolfSSL_RSA_meth_set
206 #define RSA_meth_set_init wolfSSL_RSA_meth_set
207 #define RSA_meth_set_finish wolfSSL_RSA_meth_set
208 #define RSA_meth_set0_app_data wolfSSL_RSA_meth_set
209 #define RSA_get_default_method wolfSSL_RSA_get_default_method
210 #define RSA_get_method wolfSSL_RSA_get_method
211 #define RSA_set_method wolfSSL_RSA_set_method
212 #define RSA_get0_crt_params wolfSSL_RSA_get0_crt_params
213 #define RSA_set0_crt_params wolfSSL_RSA_set0_crt_params
214 #define RSA_get0_factors wolfSSL_RSA_get0_factors
215 #define RSA_set0_factors wolfSSL_RSA_set0_factors
216 #define RSA_get0_key wolfSSL_RSA_get0_key
217 #define RSA_set0_key wolfSSL_RSA_set0_key
218 #define RSA_flags wolfSSL_RSA_flags
219 #define RSA_set_flags wolfSSL_RSA_set_flags
220 #define RSA_clear_flags wolfSSL_RSA_clear_flags
221 #define RSA_test_flags wolfSSL_RSA_test_flags
222
223 #define RSAPublicKey_dup wolfSSL_RSAPublicKey_dup
224 #define RSA_get_ex_data wolfSSL_RSA_get_ex_data
225 #define RSA_set_ex_data wolfSSL_RSA_set_ex_data
226
227 #define RSA_get0_key wolfSSL_RSA_get0_key
228
229 #define RSA_F4 WOLFSSL_RSA_F4
230
231 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
232
233 #ifdef __cplusplus
234 } /* extern "C" */
235 #endif
236
237 #endif /* header */

22.279 rsa.h File Reference


#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/integer.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/hash.h>

NetBurner, Inc.
22.280 wolfcrypt/rsa.h 1343

22.280 wolfcrypt/rsa.h
Go to the documentation of this file.
1 /* rsa.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 /*
17
18 DESCRIPTION
19 This library provides the interface to the RSA.
20 RSA keys can be used to encrypt, decrypt, sign and verify data.
21
22 */
23 #ifndef WOLF_CRYPT_RSA_H
24 #define WOLF_CRYPT_RSA_H
25
26 #include <wolfssl/wolfcrypt/types.h>
27
28 #ifndef NO_RSA
29
30
31 /* RSA default exponent */
32 #ifndef WC_RSA_EXPONENT
33 #define WC_RSA_EXPONENT 65537L
34 #endif
35
36 #if defined(WC_RSA_NONBLOCK)
37 /* enable support for fast math based non-blocking exptmod */
38 /* this splits the RSA function into many smaller operations */
39 #ifndef USE_FAST_MATH
40 #error RSA non-blocking mode only supported using fast math
41 #endif
42 #ifndef TFM_TIMING_RESISTANT
43 #error RSA non-blocking mode only supported with timing resistance enabled
44 #endif
45
46 /* RSA bounds check is not supported with RSA non-blocking mode */
47 #undef NO_RSA_BOUNDS_CHECK
48 #define NO_RSA_BOUNDS_CHECK
49 #endif
50
51 /* allow for user to plug in own crypto */
52 #if !defined(HAVE_FIPS) && (defined(HAVE_USER_RSA) || defined(HAVE_FAST_RSA))
53 #include "user_rsa.h"
54 #else
55
56 #if defined(HAVE_FIPS) && \
57 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
58 /* for fips @wc_fips */
59 #include <cyassl/ctaocrypt/rsa.h>
60 #if defined(CYASSL_KEY_GEN) && !defined(WOLFSSL_KEY_GEN)
61 #define WOLFSSL_KEY_GEN
62 #endif
63 #else
64 #include <wolfssl/wolfcrypt/integer.h>
65 #include <wolfssl/wolfcrypt/random.h>
66 #endif /* HAVE_FIPS && HAVE_FIPS_VERION 1 */
67 #if defined(HAVE_FIPS) && \
68 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
69 #include <wolfssl/wolfcrypt/fips.h>
70 #endif
71
72 /* header file needed for OAEP padding */
73 #include <wolfssl/wolfcrypt/hash.h>
74
75 #ifdef WOLFSSL_XILINX_CRYPT
76 #include "xsecure_rsa.h"
77 #endif
78
79 #if defined(WOLFSSL_CRYPTOCELL)
80 #include <wolfssl/wolfcrypt/port/arm/cryptoCell.h>
81 #endif
82
83 #if defined(WOLFSSL_KCAPI_RSA)

NetBurner, Inc.
1344 File Documentation

84 #include <wolfssl/wolfcrypt/port/kcapi/kcapi_rsa.h>
85 #endif
86
87 #if defined(WOLFSSL_DEVCRYPTO_RSA)
88 #include <wolfssl/wolfcrypt/port/devcrypto/wc_devcrypto.h>
89 #endif
90
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94
95 #ifndef RSA_MIN_SIZE
96 #define RSA_MIN_SIZE 512
97 #endif
98
99 #ifndef RSA_MAX_SIZE
100 #ifdef USE_FAST_MATH
101 /* FP implementation support numbers up to FP_MAX_BITS / 2 bits. */
102 #define RSA_MAX_SIZE (FP_MAX_BITS / 2)
103 #if defined(WOLFSSL_MYSQL_COMPATIBLE) && RSA_MAX_SIZE < 8192
104 #error "MySQL needs FP_MAX_BITS at least at 16384"
105 #endif
106 #elif defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)
107 /* SP implementation supports numbers of SP_INT_BITS bits. */
108 #define RSA_MAX_SIZE (((SP_INT_BITS + 7) / 8) * 8)
109 #if defined(WOLFSSL_MYSQL_COMPATIBLE) && RSA_MAX_SIZE < 8192
110 #error "MySQL needs SP_INT_BITS at least at 8192"
111 #endif
112 #else
113 #ifdef WOLFSSL_MYSQL_COMPATIBLE
114 /* Integer maths is dynamic but we only go up to 8192 bits. */
115 #define RSA_MAX_SIZE 8192
116 #else
117 /* Integer maths is dynamic but we only go up to 4096 bits. */
118 #define RSA_MAX_SIZE 4096
119 #endif
120 #endif
121 #endif
122
123 /* avoid redefinition of structs */
124 #if !defined(HAVE_FIPS) || \
125 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
126
127 #ifdef WOLFSSL_ASYNC_CRYPT
128 #include <wolfssl/wolfcrypt/async.h>
129 #ifdef WOLFSSL_CERT_GEN
130 #include <wolfssl/wolfcrypt/asn.h>
131 #endif
132 #endif
133
134 enum {
135 RSA_PUBLIC = 0,
136 RSA_PRIVATE = 1,
137
138 RSA_TYPE_UNKNOWN = -1,
139 RSA_PUBLIC_ENCRYPT = 0,
140 RSA_PUBLIC_DECRYPT = 1,
141 RSA_PRIVATE_ENCRYPT = 2,
142 RSA_PRIVATE_DECRYPT = 3,
143
144 RSA_BLOCK_TYPE_1 = 1,
145 RSA_BLOCK_TYPE_2 = 2,
146
147 RSA_MIN_PAD_SZ = 11, /* separator + 0 + pad value + 8 pads */
148
149 RSA_PSS_PAD_SZ = 8,
150 RSA_PSS_SALT_MAX_SZ = 62,
151
152 #ifdef OPENSSL_EXTRA
153 RSA_PKCS1_PADDING_SIZE = 11,
154 RSA_PKCS1_OAEP_PADDING_SIZE = 42, /* (2 * hashlen(SHA-1)) + 2 */
155 #endif
156 #ifdef WC_RSA_PSS
157 RSA_PSS_PAD_TERM = 0xBC,
158 #endif
159
160 RSA_PSS_SALT_LEN_DEFAULT = -1,
161 #ifdef WOLFSSL_PSS_SALT_LEN_DISCOVER
162 RSA_PSS_SALT_LEN_DISCOVER = -2,
163 #endif
164
165 #ifdef WOLF_PRIVATE_KEY_ID
166 RSA_MAX_ID_LEN = 32,
167 RSA_MAX_LABEL_LEN = 32,
168 #endif
169 };
170

NetBurner, Inc.
22.280 wolfcrypt/rsa.h 1345

171 #ifdef WC_RSA_NONBLOCK


172 typedef struct RsaNb {
173 exptModNb_t exptmod; /* non-block expt_mod */
174 mp_int tmp;
175 } RsaNb;
176 #endif
177
178 /* RSA */
179 struct RsaKey {
180 mp_int n, e;
181 #ifndef WOLFSSL_RSA_PUBLIC_ONLY
182 mp_int d, p, q;
183 #if defined(WOLFSSL_KEY_GEN) || defined(OPENSSL_EXTRA) || !defined(RSA_LOW_MEM)
184 mp_int dP, dQ, u;
185 #endif
186 #endif
187 void* heap; /* for user memory overrides */
188 byte* data; /* temp buffer for async RSA */
189 int type; /* public or private */
190 int state;
191 word32 dataLen;
192 #ifdef WC_RSA_BLINDING
193 WC_RNG* rng; /* for PrivateDecrypt blinding */
194 #endif
195 #ifdef WOLF_CRYPTO_CB
196 int devId;
197 #endif
198 #ifdef WOLFSSL_ASYNC_CRYPT
199 WC_ASYNC_DEV asyncDev;
200 #ifdef WOLFSSL_CERT_GEN
201 CertSignCtx certSignCtx; /* context info for cert sign (MakeSignature) */
202 #endif
203 #endif /* WOLFSSL_ASYNC_CRYPT */
204 #ifdef WOLFSSL_XILINX_CRYPT
205 word32 pubExp; /* to keep values in scope they are here in struct */
206 byte* mod;
207 XSecure_Rsa xRsa;
208 #endif
209 #if defined(WOLFSSL_KCAPI_RSA)
210 struct kcapi_handle* handle;
211 #endif
212 #ifdef WOLF_PRIVATE_KEY_ID
213 byte id[RSA_MAX_ID_LEN];
214 int idLen;
215 char label[RSA_MAX_LABEL_LEN];
216 int labelLen;
217 #endif
218 #if defined(WOLFSSL_ASYNC_CRYPT) || !defined(WOLFSSL_RSA_VERIFY_INLINE) && \
219 !defined(WOLFSSL_NO_MALLOC)
220 byte dataIsAlloc;
221 #endif
222 #ifdef WC_RSA_NONBLOCK
223 RsaNb* nb;
224 #endif
225 #ifdef WOLFSSL_AFALG_XILINX_RSA
226 int alFd;
227 int rdFd;
228 #endif
229 #if defined(WOLFSSL_CRYPTOCELL)
230 rsa_context_t ctx;
231 #endif
232 #if defined(WOLFSSL_CAAM)
233 word32 blackKey;
234 #endif
235 #if defined(WOLFSSL_DEVCRYPTO_RSA)
236 WC_CRYPTODEV ctx;
237 #endif
238 };
239
240 #ifndef WC_RSAKEY_TYPE_DEFINED
241 typedef struct RsaKey RsaKey;
242 #define WC_RSAKEY_TYPE_DEFINED
243 #endif
244
245 #endif /* HAVE_FIPS */
246
247 WOLFSSL_API int wc_InitRsaKey(RsaKey* key, void* heap);
248 WOLFSSL_API int wc_InitRsaKey_ex(RsaKey* key, void* heap, int devId);
249 WOLFSSL_API int wc_FreeRsaKey(RsaKey* key);
250 #ifdef WOLF_PRIVATE_KEY_ID
251 WOLFSSL_API int wc_InitRsaKey_Id(RsaKey* key, unsigned char* id, int len,
252 void* heap, int devId);
253 WOLFSSL_API int wc_InitRsaKey_Label(RsaKey* key, const char* label, void* heap,
254 int devId);
255 #endif
256 WOLFSSL_API int wc_CheckRsaKey(RsaKey* key);
257 #ifdef WOLFSSL_XILINX_CRYPT

NetBurner, Inc.
1346 File Documentation

258 WOLFSSL_LOCAL int wc_InitRsaHw(RsaKey* key);


259 #endif /* WOLFSSL_XILINX_CRYPT */
260
261 WOLFSSL_API int wc_RsaFunction(const byte* in, word32 inLen, byte* out,
262 word32* outLen, int type, RsaKey* key, WC_RNG* rng);
263
264 WOLFSSL_API int wc_RsaPublicEncrypt(const byte* in, word32 inLen, byte* out,
265 word32 outLen, RsaKey* key, WC_RNG* rng);
266 WOLFSSL_API int wc_RsaPrivateDecryptInline(byte* in, word32 inLen, byte** out,
267 RsaKey* key);
268 WOLFSSL_API int wc_RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out,
269 word32 outLen, RsaKey* key);
270 WOLFSSL_API int wc_RsaSSL_Sign(const byte* in, word32 inLen, byte* out,
271 word32 outLen, RsaKey* key, WC_RNG* rng);
272 WOLFSSL_API int wc_RsaPSS_Sign(const byte* in, word32 inLen, byte* out,
273 word32 outLen, enum wc_HashType hash, int mgf,
274 RsaKey* key, WC_RNG* rng);
275 WOLFSSL_API int wc_RsaPSS_Sign_ex(const byte* in, word32 inLen, byte* out,
276 word32 outLen, enum wc_HashType hash,
277 int mgf, int saltLen, RsaKey* key,
278 WC_RNG* rng);
279 WOLFSSL_API int wc_RsaSSL_VerifyInline(byte* in, word32 inLen, byte** out,
280 RsaKey* key);
281 WOLFSSL_API int wc_RsaSSL_Verify(const byte* in, word32 inLen, byte* out,
282 word32 outLen, RsaKey* key);
283 WOLFSSL_API int wc_RsaSSL_Verify_ex(const byte* in, word32 inLen, byte* out,
284 word32 outLen, RsaKey* key, int pad_type);
285 WOLFSSL_API int wc_RsaSSL_Verify_ex2(const byte* in, word32 inLen, byte* out,
286 word32 outLen, RsaKey* key, int pad_type,
287 enum wc_HashType hash);
288 WOLFSSL_API int wc_RsaPSS_VerifyInline(byte* in, word32 inLen, byte** out,
289 enum wc_HashType hash, int mgf,
290 RsaKey* key);
291 WOLFSSL_API int wc_RsaPSS_VerifyInline_ex(byte* in, word32 inLen, byte** out,
292 enum wc_HashType hash, int mgf,
293 int saltLen, RsaKey* key);
294 WOLFSSL_API int wc_RsaPSS_Verify(byte* in, word32 inLen, byte* out,
295 word32 outLen, enum wc_HashType hash, int mgf,
296 RsaKey* key);
297 WOLFSSL_API int wc_RsaPSS_Verify_ex(byte* in, word32 inLen, byte* out,
298 word32 outLen, enum wc_HashType hash,
299 int mgf, int saltLen, RsaKey* key);
300 WOLFSSL_API int wc_RsaPSS_CheckPadding(const byte* in, word32 inLen, byte* sig,
301 word32 sigSz,
302 enum wc_HashType hashType);
303 WOLFSSL_API int wc_RsaPSS_CheckPadding_ex(const byte* in, word32 inLen,
304 byte* sig, word32 sigSz,
305 enum wc_HashType hashType,
306 int saltLen, int bits);
307 WOLFSSL_API int wc_RsaPSS_CheckPadding_ex2(const byte* in, word32 inLen,
308 byte* sig, word32 sigSz,
309 enum wc_HashType hashType,
310 int saltLen, int bits, void* heap);
311 WOLFSSL_API int wc_RsaPSS_VerifyCheckInline(byte* in, word32 inLen, byte** out,
312 const byte* digest, word32 digentLen,
313 enum wc_HashType hash, int mgf,
314 RsaKey* key);
315 WOLFSSL_API int wc_RsaPSS_VerifyCheck(byte* in, word32 inLen,
316 byte* out, word32 outLen,
317 const byte* digest, word32 digestLen,
318 enum wc_HashType hash, int mgf,
319 RsaKey* key);
320
321 WOLFSSL_API int wc_RsaEncryptSize(const RsaKey* key);
322
323 #if !defined(HAVE_FIPS) || \
324 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
325 /* to avoid asn duplicate symbols @wc_fips */
326 WOLFSSL_API int wc_RsaPrivateKeyDecode(const byte* input, word32* inOutIdx,
327 RsaKey* key, word32 inSz);
328 WOLFSSL_API int wc_RsaPublicKeyDecode(const byte* input, word32* inOutIdx,
329 RsaKey* key, word32 inSz);
330 WOLFSSL_API int wc_RsaPublicKeyDecodeRaw(const byte* n, word32 nSz,
331 const byte* e, word32 eSz, RsaKey* key);
332 #if defined(WOLFSSL_KEY_GEN) || defined(OPENSSL_EXTRA) || \
333 defined(WOLFSSL_KCAPI_RSA)
334 WOLFSSL_API int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen);
335 #endif
336
337 #ifdef WC_RSA_BLINDING
338 WOLFSSL_API int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng);
339 #endif
340 #ifdef WC_RSA_NONBLOCK
341 WOLFSSL_API int wc_RsaSetNonBlock(RsaKey* key, RsaNb* nb);
342 #ifdef WC_RSA_NONBLOCK_TIME
343 WOLFSSL_API int wc_RsaSetNonBlockTime(RsaKey* key, word32 maxBlockUs,
344 word32 cpuMHz);

NetBurner, Inc.
22.281 openssl/sha.h 1347

345 #endif
346 #endif
347
348 /*
349 choice of padding added after fips, so not available when using fips RSA
350 */
351
352 /* Mask Generation Function Identifiers */
353 #define WC_MGF1NONE 0
354 #define WC_MGF1SHA1 26
355 #define WC_MGF1SHA224 4
356 #define WC_MGF1SHA256 1
357 #define WC_MGF1SHA384 2
358 #define WC_MGF1SHA512 3
359 #define WC_MGF1SHA512_224 5
360 #define WC_MGF1SHA512_256 6
361
362 /* Padding types */
363 #define WC_RSA_PKCSV15_PAD 0
364 #define WC_RSA_OAEP_PAD 1
365 #define WC_RSA_PSS_PAD 2
366 #define WC_RSA_NO_PAD 3
367
368 WOLFSSL_API int wc_RsaPublicEncrypt_ex(const byte* in, word32 inLen, byte* out,
369 word32 outLen, RsaKey* key, WC_RNG* rng, int type,
370 enum wc_HashType hash, int mgf, byte* label, word32 labelSz);
371 WOLFSSL_API int wc_RsaPrivateDecrypt_ex(const byte* in, word32 inLen,
372 byte* out, word32 outLen, RsaKey* key, int type,
373 enum wc_HashType hash, int mgf, byte* label, word32 labelSz);
374 WOLFSSL_API int wc_RsaPrivateDecryptInline_ex(byte* in, word32 inLen,
375 byte** out, RsaKey* key, int type, enum wc_HashType hash,
376 int mgf, byte* label, word32 labelSz);
377 #if defined(WC_RSA_DIRECT) || defined(WC_RSA_NO_PADDING)
378 WOLFSSL_API int wc_RsaDirect(byte* in, word32 inLen, byte* out, word32* outSz,
379 RsaKey* key, int type, WC_RNG* rng);
380 #endif
381
382 #endif /* HAVE_FIPS */
383
384 WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey* key, byte* e, word32* eSz,
385 byte* n, word32* nSz);
386 WOLFSSL_API int wc_RsaExportKey(RsaKey* key,
387 byte* e, word32* eSz,
388 byte* n, word32* nSz,
389 byte* d, word32* dSz,
390 byte* p, word32* pSz,
391 byte* q, word32* qSz);
392
393 #ifdef WOLFSSL_KEY_GEN
394 WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng);
395 WOLFSSL_API int wc_CheckProbablePrime_ex(const byte* p, word32 pSz,
396 const byte* q, word32 qSz,
397 const byte* e, word32 eSz,
398 int nlen, int* isPrime, WC_RNG* rng);
399 WOLFSSL_API int wc_CheckProbablePrime(const byte* p, word32 pSz,
400 const byte* q, word32 qSz,
401 const byte* e, word32 eSz,
402 int nlen, int* isPrime);
403 #endif
404
405 WOLFSSL_LOCAL int wc_RsaPad_ex(const byte* input, word32 inputLen, byte* pkcsBlock,
406 word32 pkcsBlockLen, byte padValue, WC_RNG* rng, int padType,
407 enum wc_HashType hType, int mgf, byte* optLabel, word32 labelLen,
408 int saltLen, int bits, void* heap);
409 WOLFSSL_LOCAL int wc_RsaUnPad_ex(byte* pkcsBlock, word32 pkcsBlockLen, byte** out,
410 byte padValue, int padType, enum wc_HashType hType,
411 int mgf, byte* optLabel, word32 labelLen, int saltLen,
412 int bits, void* heap);
413
414 WOLFSSL_LOCAL int wc_hash2mgf(enum wc_HashType hType);
415
416 #endif /* HAVE_USER_RSA */
417
418 #ifdef __cplusplus
419 } /* extern "C" */
420 #endif
421
422 #endif /* NO_RSA */
423 #endif /* WOLF_CRYPT_RSA_H */
424

22.281 openssl/sha.h
1 /* sha.h
2 *

NetBurner, Inc.
1348 File Documentation

3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.


4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* sha.h for openssl */
13
14
15 #ifndef WOLFSSL_SHA_H_
16 #define WOLFSSL_SHA_H_
17
18 #include <wolfssl/wolfcrypt/settings.h>
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef WOLFSSL_PREFIX
22 #include "prefix_sha.h"
23 #endif
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #ifndef NO_SHA
30 typedef struct WOLFSSL_SHA_CTX {
31 /* big enough to hold wolfcrypt Sha, but check on init */
32 #if defined(STM32_HASH)
33 void* holder[(112 + WC_ASYNC_DEV_SIZE + sizeof(STM32_HASH_Context)) / sizeof(void*)];
34 #else
35 void* holder[(112 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
36 #endif
37 #if defined(WOLFSSL_DEVCRYPTO_HASH) || defined(WOLFSSL_HASH_KEEP)
38 void* keephash_holder[sizeof(void*) + (2 * sizeof(unsigned int))];
39 #endif
40 #ifdef WOLF_CRYPTO_CB
41 void* cryptocb_holder[(sizeof(int) + sizeof(void*) + 4) / sizeof(void*)];
42 #endif
43 } WOLFSSL_SHA_CTX;
44
45 WOLFSSL_API int wolfSSL_SHA_Init(WOLFSSL_SHA_CTX* sha);
46 WOLFSSL_API int wolfSSL_SHA_Update(WOLFSSL_SHA_CTX* sha, const void* input,
47 unsigned long sz);
48 WOLFSSL_API int wolfSSL_SHA_Final(byte* input, WOLFSSL_SHA_CTX* sha);
49 WOLFSSL_API int wolfSSL_SHA_Transform(WOLFSSL_SHA_CTX* sha,
50 const unsigned char* data);
51 /* SHA1 points to above, shouldn’t use SHA0 ever */
52 WOLFSSL_API int wolfSSL_SHA1_Init(WOLFSSL_SHA_CTX* sha);
53 WOLFSSL_API int wolfSSL_SHA1_Update(WOLFSSL_SHA_CTX* sha, const void* input,
54 unsigned long sz);
55 WOLFSSL_API int wolfSSL_SHA1_Final(byte* output, WOLFSSL_SHA_CTX* sha);
56 WOLFSSL_API int wolfSSL_SHA1_Transform(WOLFSSL_SHA_CTX* sha,
57 const unsigned char *data);
58 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
59 enum {
60 SHA_DIGEST_LENGTH = 20
61 };
62
63 typedef WOLFSSL_SHA_CTX SHA_CTX;
64
65 #define SHA_Init wolfSSL_SHA_Init
66 #define SHA_Update wolfSSL_SHA_Update
67 #define SHA_Final wolfSSL_SHA_Final
68 #define SHA_Transform wolfSSL_SHA_Transform
69
70 #if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_SELFTEST) && \
71 (!defined(HAVE_FIPS) || \
72 (defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION > 2))
73 /* SHA is only available in non-fips mode or fips version > 2 mode
74 * because of SHA enum in FIPS build. */
75 #define SHA wolfSSL_SHA1
76 #endif
77
78 #define SHA1_Init wolfSSL_SHA1_Init
79 #define SHA1_Update wolfSSL_SHA1_Update
80 #define SHA1_Final wolfSSL_SHA1_Final
81 #define SHA1_Transform wolfSSL_SHA1_Transform
82
83 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
84 #endif /* !NO_SHA */
85
86 /* adder for HW crypto */
87 #ifdef STM32_HASH
88 #define CTX_SHA2_HW_ADDER 34
89 #else

NetBurner, Inc.
22.281 openssl/sha.h 1349

90 #define CTX_SHA2_HW_ADDER 0
91 #endif
92
93 #ifdef WOLFSSL_SHA224
94
95 /* Using ALIGN16 because when AES-NI is enabled digest and buffer in Sha256
96 * struct are 16 byte aligned. Any dereference to those elements after casting
97 * to Sha224, is expected to also be 16 byte aligned addresses. */
98 typedef struct WOLFSSL_SHA224_CTX {
99 /* big enough to hold wolfcrypt Sha224, but check on init */
100 ALIGN16 void* holder[(274 + CTX_SHA2_HW_ADDER + WC_ASYNC_DEV_SIZE) /
101 sizeof(void*)];
102 } WOLFSSL_SHA224_CTX;
103
104 WOLFSSL_API int wolfSSL_SHA224_Init(WOLFSSL_SHA224_CTX* sha);
105 WOLFSSL_API int wolfSSL_SHA224_Update(WOLFSSL_SHA224_CTX* sha, const void* input,
106 unsigned long sz);
107 WOLFSSL_API int wolfSSL_SHA224_Final(byte* output, WOLFSSL_SHA224_CTX* sha);
108 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
109 enum {
110 SHA224_DIGEST_LENGTH = 28
111 };
112
113 typedef WOLFSSL_SHA224_CTX SHA224_CTX;
114
115 #define SHA224_Init wolfSSL_SHA224_Init
116 #define SHA224_Update wolfSSL_SHA224_Update
117 #define SHA224_Final wolfSSL_SHA224_Final
118 #if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_SELFTEST) && \
119 (!defined(HAVE_FIPS) || \
120 (defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION > 2))
121 /* SHA224 is only available in non-fips mode or fips version > 2 mode
122 * because of SHA224 enum in FIPS build. */
123 #define SHA224 wolfSSL_SHA224
124 #endif
125 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
126 #endif /* WOLFSSL_SHA224 */
127
128 #ifndef NO_SHA256
129 /* Using ALIGN16 because when AES-NI is enabled digest and buffer in Sha256
130 * struct are 16 byte aligned. Any dereference to those elements after casting
131 * to Sha256, is expected to also be 16 byte aligned addresses. */
132 typedef struct WOLFSSL_SHA256_CTX {
133 /* big enough to hold wolfcrypt Sha256, but check on init */
134 ALIGN16 void* holder[(274 + CTX_SHA2_HW_ADDER + WC_ASYNC_DEV_SIZE) /
135 sizeof(void*)];
136 } WOLFSSL_SHA256_CTX;
137
138 WOLFSSL_API int wolfSSL_SHA256_Init(WOLFSSL_SHA256_CTX* sha256);
139 WOLFSSL_API int wolfSSL_SHA256_Update(WOLFSSL_SHA256_CTX* sha, const void* input,
140 unsigned long sz);
141 WOLFSSL_API int wolfSSL_SHA256_Final(byte* output, WOLFSSL_SHA256_CTX* sha);
142 WOLFSSL_API int wolfSSL_SHA256_Transform(WOLFSSL_SHA256_CTX* sha256,
143 const unsigned char *data);
144 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
145 enum {
146 SHA256_DIGEST_LENGTH = 32
147 };
148
149 typedef WOLFSSL_SHA256_CTX SHA256_CTX;
150
151 #define SHA256_Init wolfSSL_SHA256_Init
152 #define SHA256_Update wolfSSL_SHA256_Update
153 #define SHA256_Final wolfSSL_SHA256_Final
154 #define SHA256_Transform wolfSSL_SHA256_Transform
155
156 /* "SHA256" has some conflicts
157 * If not FIPS and NO_OLD_SHA_NAMES defined
158 * If FIPS V3 or higher and NO_OLD_SHA_NAMES defined
159 * If FIPS V2 and NO_OLD_SHA256_NAMES defined
160 * If FIPS v1 not allowed
161 * If HAVE_SELFTEST not allowed
162 */
163 #if !defined(HAVE_SELFTEST) && \
164 (defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS)) || \
165 (defined(NO_OLD_SHA_NAMES) && defined(HAVE_FIPS) && \
166 defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION >= 3) || \
167 (defined(NO_OLD_SHA256_NAMES) && defined(HAVE_FIPS) && \
168 defined(HAVE_FIPS_VERSION) && HAVE_FIPS_VERSION == 2)
169
170 #define SHA256 wolfSSL_SHA256
171 #endif
172 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
173 #endif /* !NO_SHA256 */
174
175 #ifdef WOLFSSL_SHA384
176 typedef struct WOLFSSL_SHA384_CTX {

NetBurner, Inc.
1350 File Documentation

177 /* big enough to hold wolfCrypt Sha384, but check on init */


178 void* holder[(268 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
179 } WOLFSSL_SHA384_CTX;
180
181 WOLFSSL_API int wolfSSL_SHA384_Init(WOLFSSL_SHA384_CTX* sha);
182 WOLFSSL_API int wolfSSL_SHA384_Update(WOLFSSL_SHA384_CTX* sha, const void* input,
183 unsigned long sz);
184 WOLFSSL_API int wolfSSL_SHA384_Final(byte* output, WOLFSSL_SHA384_CTX* sha);
185 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
186 enum {
187 SHA384_DIGEST_LENGTH = 48
188 };
189
190 typedef WOLFSSL_SHA384_CTX SHA384_CTX;
191
192 #define SHA384_Init wolfSSL_SHA384_Init
193 #define SHA384_Update wolfSSL_SHA384_Update
194 #define SHA384_Final wolfSSL_SHA384_Final
195 #if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
196 /* SHA384 is only available in non-fips mode because of SHA384 enum in FIPS
197 * build. */
198 #define SHA384 wolfSSL_SHA384
199 #endif
200 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
201
202 #endif /* WOLFSSL_SHA384 */
203
204 #ifdef WOLFSSL_SHA512
205 typedef struct WOLFSSL_SHA512_CTX {
206 /* big enough to hold wolfCrypt Sha384, but check on init */
207 void* holder[(288 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
208 } WOLFSSL_SHA512_CTX;
209
210 WOLFSSL_API int wolfSSL_SHA512_Init(WOLFSSL_SHA512_CTX* sha);
211 WOLFSSL_API int wolfSSL_SHA512_Update(WOLFSSL_SHA512_CTX* sha,
212 const void* input, unsigned long sz);
213 WOLFSSL_API int wolfSSL_SHA512_Final(byte* output, WOLFSSL_SHA512_CTX* sha);
214 WOLFSSL_API int wolfSSL_SHA512_Transform(WOLFSSL_SHA512_CTX* sha512,
215 const unsigned char* data);
216 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
217 enum {
218 SHA512_DIGEST_LENGTH = 64
219 };
220
221 typedef WOLFSSL_SHA512_CTX SHA512_CTX;
222
223 #define SHA512_Init wolfSSL_SHA512_Init
224 #define SHA512_Update wolfSSL_SHA512_Update
225 #define SHA512_Final wolfSSL_SHA512_Final
226 #define SHA512_Transform wolfSSL_SHA512_Transform
227 #if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
228 /* SHA512 is only available in non-fips mode because of SHA512 enum in FIPS
229 * build. */
230 #define SHA512 wolfSSL_SHA512
231 #endif
232 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
233
234 #if !defined(WOLFSSL_NOSHA512_224)
235 typedef struct WOLFSSL_SHA512_CTX WOLFSSL_SHA512_224_CTX;
236 typedef WOLFSSL_SHA512_224_CTX SHA512_224_CTX;
237
238 WOLFSSL_API int wolfSSL_SHA512_224_Init(WOLFSSL_SHA512_CTX* sha);
239 WOLFSSL_API int wolfSSL_SHA512_224_Update(WOLFSSL_SHA512_224_CTX* sha,
240 const void* input, unsigned long sz);
241 WOLFSSL_API int wolfSSL_SHA512_224_Final(byte* output,
242 WOLFSSL_SHA512_224_CTX* sha);
243 WOLFSSL_API int wolfSSL_SHA512_224_Transform(WOLFSSL_SHA512_CTX* sha512,
244 const unsigned char* data);
245
246 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
247 #define SHA512_224_Init wolfSSL_SHA512_224_Init
248 #define SHA512_224_Update wolfSSL_SHA512_224_Update
249 #define SHA512_224_Final wolfSSL_SHA512_224_Final
250 #define SHA512_224_Transform wolfSSL_SHA512_224_Transform
251
252 #if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
253 #define SHA512_224 wolfSSL_SHA512_224
254 #endif
255 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
256 #endif /* !WOLFSSL_NOSHA512_224 */
257
258 #if !defined(WOLFSSL_NOSHA512_256)
259 typedef struct WOLFSSL_SHA512_CTX WOLFSSL_SHA512_256_CTX;
260 typedef WOLFSSL_SHA512_256_CTX SHA512_256_CTX;
261
262 WOLFSSL_API int wolfSSL_SHA512_256_Init(WOLFSSL_SHA512_CTX* sha);
263 WOLFSSL_API int wolfSSL_SHA512_256_Update(WOLFSSL_SHA512_256_CTX* sha,

NetBurner, Inc.
22.282 sha.h File Reference 1351

264 const void* input, unsigned long sz);


265 WOLFSSL_API int wolfSSL_SHA512_256_Final(byte* output, WOLFSSL_SHA512_256_CTX* sha);
266 WOLFSSL_API int wolfSSL_SHA512_256_Transform(WOLFSSL_SHA512_CTX* sha512,
267 const unsigned char* data);
268
269 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
270 #define SHA512_256_Init wolfSSL_SHA512_256_Init
271 #define SHA512_256_Update wolfSSL_SHA512_256_Update
272 #define SHA512_256_Final wolfSSL_SHA512_256_Final
273 #define SHA512_256_Transform wolfSSL_SHA512_256_Transform
274
275 #if defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
276 #define SHA512_256 wolfSSL_SHA512_256
277 #endif
278 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
279 #endif /* !WOLFSSL_NOSHA512_256 */
280
281
282 #endif /* WOLFSSL_SHA512 */
283
284
285
286
287 #ifdef __cplusplus
288 } /* extern "C" */
289 #endif
290
291
292 #endif /* WOLFSSL_SHA_H_ */
293

22.282 sha.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.283 wolfcrypt/sha.h
Go to the documentation of this file.
1 /* sha.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_SHA_H
18 #define WOLF_CRYPT_SHA_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifndef NO_SHA
23
24 #if defined(HAVE_FIPS) && \
25 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
26 #include <wolfssl/wolfcrypt/fips.h>
27 #endif /* HAVE_FIPS_VERSION >= 2 */
28
29 #if defined(HAVE_FIPS) && \
30 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
31 #define wc_Sha Sha
32 #define WC_SHA SHA
33 #define WC_SHA_BLOCK_SIZE SHA_BLOCK_SIZE
34 #define WC_SHA_DIGEST_SIZE SHA_DIGEST_SIZE
35 #define WC_SHA_PAD_SIZE SHA_PAD_SIZE
36
37 /* for fips @wc_fips */
38 #include <cyassl/ctaocrypt/sha.h>
39 #endif
40
41 #ifdef FREESCALE_LTC_SHA
42 #include "fsl_ltc.h"
43 #endif
44
45 #ifdef WOLFSSL_IMXRT_DCP
46 #include "fsl_dcp.h"

NetBurner, Inc.
1352 File Documentation

47 #endif
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 /* avoid redefinition of structs */
54 #if !defined(HAVE_FIPS) || \
55 (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
56
57 #ifdef WOLFSSL_MICROCHIP_PIC32MZ
58 #include <wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h>
59 #endif
60 #ifdef STM32_HASH
61 #include <wolfssl/wolfcrypt/port/st/stm32.h>
62 #endif
63 #ifdef WOLFSSL_ASYNC_CRYPT
64 #include <wolfssl/wolfcrypt/async.h>
65 #endif
66 #ifdef WOLFSSL_ESP32WROOM32_CRYPT
67 #include <wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h>
68 #endif
69 #if defined(WOLFSSL_SILABS_SE_ACCEL)
70 #include <wolfssl/wolfcrypt/port/silabs/silabs_hash.h>
71 #endif
72
73 #if !defined(NO_OLD_SHA_NAMES)
74 #define SHA WC_SHA
75 #endif
76
77 #ifndef NO_OLD_WC_NAMES
78 #define Sha wc_Sha
79 #define SHA_BLOCK_SIZE WC_SHA_BLOCK_SIZE
80 #define SHA_DIGEST_SIZE WC_SHA_DIGEST_SIZE
81 #define SHA_PAD_SIZE WC_SHA_PAD_SIZE
82 #endif
83
84 /* in bytes */
85 enum {
86 WC_SHA = WC_HASH_TYPE_SHA,
87 WC_SHA_BLOCK_SIZE = 64,
88 WC_SHA_DIGEST_SIZE = 20,
89 WC_SHA_PAD_SIZE = 56
90 };
91
92
93 #if defined(WOLFSSL_TI_HASH)
94 #include "wolfssl/wolfcrypt/port/ti/ti-hash.h"
95
96 #elif defined(WOLFSSL_IMX6_CAAM) && !defined(WOLFSSL_QNX_CAAM)
97 #include "wolfssl/wolfcrypt/port/caam/wolfcaam_sha.h"
98 #elif defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
99 !defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
100 #include "wolfssl/wolfcrypt/port/Renesas/renesas_tsip_types.h"
101 #else
102
103 #if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
104 #include "wolfssl/wolfcrypt/port/nxp/se050_port.h"
105 #endif
106
107 #if defined(WOLFSSL_HAVE_PSA) && !defined(WOLFSSL_PSA_NO_HASH)
108 #include <psa/crypto.h>
109 #undef WOLFSSL_NO_HASH_RAW
110 #define WOLFSSL_NO_HASH_RAW
111 #endif
112
113 /* Sha digest */
114 struct wc_Sha {
115 #ifdef FREESCALE_LTC_SHA
116 ltc_hash_ctx_t ctx;
117 #elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
118 SE050_HASH_Context se050Ctx;
119 #elif defined(STM32_HASH)
120 STM32_HASH_Context stmCtx;
121 #elif defined(WOLFSSL_SILABS_SE_ACCEL)
122 wc_silabs_sha_t silabsCtx;
123 #elif defined(WOLFSSL_IMXRT_DCP)
124 dcp_handle_t handle;
125 dcp_hash_ctx_t ctx;
126 #elif defined(WOLFSSL_HAVE_PSA) && !defined(WOLFSSL_PSA_NO_HASH)
127 psa_hash_operation_t psa_ctx;
128 #else
129 word32 buffLen; /* in bytes */
130 word32 loLen; /* length in bytes */
131 word32 hiLen; /* length in bytes */
132 word32 buffer[WC_SHA_BLOCK_SIZE / sizeof(word32)];
133 #ifdef WOLFSSL_PIC32MZ_HASH

NetBurner, Inc.
22.284 openssl/sha3.h 1353

134 word32 digest[PIC32_DIGEST_SIZE / sizeof(word32)];


135 #else
136 word32 digest[WC_SHA_DIGEST_SIZE / sizeof(word32)];
137 #endif
138 void* heap;
139 #ifdef WOLFSSL_PIC32MZ_HASH
140 hashUpdCache cache; /* cache for updates */
141 #endif
142 #ifdef WOLFSSL_ASYNC_CRYPT
143 WC_ASYNC_DEV asyncDev;
144 #endif /* WOLFSSL_ASYNC_CRYPT */
145 #ifdef WOLF_CRYPTO_CB
146 int devId;
147 void* devCtx; /* generic crypto callback context */
148 #endif
149 #if defined(WOLFSSL_DEVCRYPTO_HASH) || defined(WOLFSSL_HASH_KEEP)
150 byte* msg;
151 word32 used;
152 word32 len;
153 #endif
154 #endif
155 #if defined(WOLFSSL_ESP32WROOM32_CRYPT) && \
156 !defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)
157 WC_ESP32SHA ctx;
158 #endif
159 #ifdef WOLFSSL_HASH_FLAGS
160 word32 flags; /* enum wc_HashFlags in hash.h */
161 #endif
162 };
163
164 #ifndef WC_SHA_TYPE_DEFINED
165 typedef struct wc_Sha wc_Sha;
166 #define WC_SHA_TYPE_DEFINED
167 #endif
168
169 #endif /* WOLFSSL_TI_HASH */
170
171
172 #endif /* HAVE_FIPS */
173
174 WOLFSSL_API int wc_InitSha(wc_Sha* sha);
175 WOLFSSL_API int wc_InitSha_ex(wc_Sha* sha, void* heap, int devId);
176 WOLFSSL_API int wc_ShaUpdate(wc_Sha* sha, const byte* data, word32 len);
177 WOLFSSL_API int wc_ShaFinalRaw(wc_Sha* sha, byte* hash);
178 WOLFSSL_API int wc_ShaFinal(wc_Sha* sha, byte* hash);
179 WOLFSSL_API void wc_ShaFree(wc_Sha* sha);
180
181 WOLFSSL_API int wc_ShaGetHash(wc_Sha* sha, byte* hash);
182 WOLFSSL_API int wc_ShaCopy(wc_Sha* src, wc_Sha* dst);
183 #if defined(OPENSSL_EXTRA)
184 WOLFSSL_API int wc_ShaTransform(wc_Sha* sha, const unsigned char* data);
185 #endif
186
187 #ifdef WOLFSSL_PIC32MZ_HASH
188 WOLFSSL_API void wc_ShaSizeSet(wc_Sha* sha, word32 len);
189 #endif
190
191 #ifdef WOLFSSL_HASH_FLAGS
192 WOLFSSL_API int wc_ShaSetFlags(wc_Sha* sha, word32 flags);
193 WOLFSSL_API int wc_ShaGetFlags(wc_Sha* sha, word32* flags);
194 #endif
195
196 #ifdef __cplusplus
197 } /* extern "C" */
198 #endif
199
200 #endif /* NO_SHA */
201 #endif /* WOLF_CRYPT_SHA_H */
202

22.284 openssl/sha3.h
1 /* sha3.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* sha3.h for openssl */
13

NetBurner, Inc.
1354 File Documentation

14
15 #ifndef WOLFSSL_SHA3_H_
16 #define WOLFSSL_SHA3_H_
17
18 #include <wolfssl/wolfcrypt/settings.h>
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef WOLFSSL_PREFIX
22 #include "prefix_sha.h"
23 #endif
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /* Using ALIGN16 because when AES-NI is enabled digest and buffer in Sha3
30 * struct are 16 byte aligned. Any dereference to those elements after casting
31 * to Sha3 is expected to also be 16 byte aligned addresses. */
32 struct WOLFSSL_SHA3_CTX {
33 /* big enough to hold wolfcrypt Sha3, but check on init */
34 ALIGN16 void* holder[(424 + WC_ASYNC_DEV_SIZE) / sizeof(void*)];
35 };
36
37 #ifndef WOLFSSL_NOSHA3_224
38 typedef struct WOLFSSL_SHA3_CTX WOLFSSL_SHA3_224_CTX;
39
40 WOLFSSL_API int wolfSSL_SHA3_224_Init(WOLFSSL_SHA3_224_CTX* sha);
41 WOLFSSL_API int wolfSSL_SHA3_224_Update(WOLFSSL_SHA3_224_CTX* sha, const void* input,
42 unsigned long sz);
43 WOLFSSL_API int wolfSSL_SHA3_224_Final(unsigned char* output,
44 WOLFSSL_SHA3_224_CTX* sha);
45
46 enum {
47 SHA3_224_DIGEST_LENGTH = 28
48 };
49
50 typedef WOLFSSL_SHA3_224_CTX SHA3_224_CTX;
51
52 #define SHA3_224_Init wolfSSL_SHA3_224_Init
53 #define SHA3_224_Update wolfSSL_SHA3_224_Update
54 #define SHA3_224_Final wolfSSL_SHA3_224_Final
55 #if defined(NO_OLD_WC_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
56 #define SHA3_224 wolfSSL_SHA3_224
57 #endif
58 #endif /* WOLFSSL_NOSHA3_224 */
59
60
61 #ifndef WOLFSSL_NOSHA3_256
62 typedef struct WOLFSSL_SHA3_CTX WOLFSSL_SHA3_256_CTX;
63
64
65 WOLFSSL_API int wolfSSL_SHA3_256_Init(WOLFSSL_SHA3_256_CTX* sha);
66 WOLFSSL_API int wolfSSL_SHA3_256_Update(WOLFSSL_SHA3_256_CTX* sha,
67 const void* input, unsigned long sz);
68 WOLFSSL_API int wolfSSL_SHA3_256_Final(unsigned char* output,
69 WOLFSSL_SHA3_256_CTX* sha);
70
71 enum {
72 SHA3_256_DIGEST_LENGTH = 32
73 };
74
75
76 typedef WOLFSSL_SHA3_256_CTX SHA3_256_CTX;
77
78 #define SHA3_256_Init wolfSSL_SHA3_256_Init
79 #define SHA3_256_Update wolfSSL_SHA3_256_Update
80 #define SHA3_256_Final wolfSSL_SHA3_256_Final
81 #if defined(NO_OLD_WC_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
82 #define SHA3_256 wolfSSL_SHA3_256
83 #endif
84 #endif /* WOLFSSL_NOSHA3_256 */
85
86
87 typedef struct WOLFSSL_SHA3_CTX WOLFSSL_SHA3_384_CTX;
88
89 WOLFSSL_API int wolfSSL_SHA3_384_Init(WOLFSSL_SHA3_384_CTX* sha);
90 WOLFSSL_API int wolfSSL_SHA3_384_Update(WOLFSSL_SHA3_384_CTX* sha,
91 const void* input, unsigned long sz);
92 WOLFSSL_API int wolfSSL_SHA3_384_Final(unsigned char* output,
93 WOLFSSL_SHA3_384_CTX* sha);
94
95 enum {
96 SHA3_384_DIGEST_LENGTH = 48
97 };
98
99 typedef WOLFSSL_SHA3_384_CTX SHA3_384_CTX;
100

NetBurner, Inc.
22.285 wolfcrypt/sha3.h 1355

101 #define SHA3_384_Init wolfSSL_SHA3_384_Init


102 #define SHA3_384_Update wolfSSL_SHA3_384_Update
103 #define SHA3_384_Final wolfSSL_SHA3_384_Final
104 #if defined(NO_OLD_WC_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
105 #define SHA3_384 wolfSSL_SHA3_384
106 #endif
107
108
109 #ifndef WOLFSSL_NOSHA3_512
110
111 typedef struct WOLFSSL_SHA3_CTX WOLFSSL_SHA3_512_CTX;
112
113 WOLFSSL_API int wolfSSL_SHA3_512_Init(WOLFSSL_SHA3_512_CTX* sha);
114 WOLFSSL_API int wolfSSL_SHA3_512_Update(WOLFSSL_SHA3_512_CTX* sha,
115 const void* input, unsigned long sz);
116 WOLFSSL_API int wolfSSL_SHA3_512_Final(unsigned char* output,
117 WOLFSSL_SHA3_512_CTX* sha);
118
119 enum {
120 SHA3_512_DIGEST_LENGTH = 64
121 };
122
123
124 typedef WOLFSSL_SHA3_512_CTX SHA3_512_CTX;
125
126 #define SHA3_512_Init wolfSSL_SHA3_512_Init
127 #define SHA3_512_Update wolfSSL_SHA3_512_Update
128 #define SHA3_512_Final wolfSSL_SHA3_512_Final
129 #if defined(NO_OLD_WC_NAMES) && !defined(HAVE_FIPS) && !defined(HAVE_SELFTEST)
130 #define SHA3_512 wolfSSL_SHA3_512
131 #endif
132 #endif /* WOLFSSL_NOSHA3_512 */
133
134
135
136
137 #ifdef __cplusplus
138 } /* extern "C" */
139 #endif
140
141
142 #endif /* WOLFSSL_SHA3_H_ */
143

22.285 wolfcrypt/sha3.h
1 /* sha3.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLF_CRYPT_SHA3_H
14 #define WOLF_CRYPT_SHA3_H
15
16 #include <wolfssl/wolfcrypt/types.h>
17
18 #ifdef WOLFSSL_SHA3
19
20 #ifdef HAVE_FIPS
21 /* for fips @wc_fips */
22 #include <wolfssl/wolfcrypt/fips.h>
23 #endif
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #ifdef WOLFSSL_ASYNC_CRYPT
30 #include <wolfssl/wolfcrypt/async.h>
31 #endif
32
33 /* in bytes */
34 enum {
35 WC_SHA3_224 = WC_HASH_TYPE_SHA3_224,
36 WC_SHA3_224_DIGEST_SIZE = 28,
37 WC_SHA3_224_COUNT = 18,
38
39 WC_SHA3_256 = WC_HASH_TYPE_SHA3_256,

NetBurner, Inc.
1356 File Documentation

40 WC_SHA3_256_DIGEST_SIZE = 32,
41 WC_SHA3_256_COUNT = 17,
42
43 WC_SHA3_384 = WC_HASH_TYPE_SHA3_384,
44 WC_SHA3_384_DIGEST_SIZE = 48,
45 WC_SHA3_384_COUNT = 13,
46
47 WC_SHA3_512 = WC_HASH_TYPE_SHA3_512,
48 WC_SHA3_512_DIGEST_SIZE = 64,
49 WC_SHA3_512_COUNT = 9,
50
51 #ifndef WOLFSSL_NO_SHAKE256
52 WC_SHAKE128 = WC_HASH_TYPE_SHAKE128,
53 WC_SHAKE256 = WC_HASH_TYPE_SHAKE256,
54 #endif
55
56 #if !defined(HAVE_SELFTEST) || \
57 defined(HAVE_SELFTEST_VERSION) && (HAVE_SELFTEST_VERSION >= 2)
58 /* These values are used for HMAC, not SHA-3 directly.
59 * They come from from FIPS PUB 202. */
60 WC_SHA3_224_BLOCK_SIZE = 144,
61 WC_SHA3_256_BLOCK_SIZE = 136,
62 WC_SHA3_384_BLOCK_SIZE = 104,
63 WC_SHA3_512_BLOCK_SIZE = 72,
64 #endif
65 };
66
67 #ifndef NO_OLD_WC_NAMES
68 #define SHA3_224 WC_SHA3_224
69 #define SHA3_224_DIGEST_SIZE WC_SHA3_224_DIGEST_SIZE
70 #define SHA3_256 WC_SHA3_256
71 #define SHA3_256_DIGEST_SIZE WC_SHA3_256_DIGEST_SIZE
72 #define SHA3_384 WC_SHA3_384
73 #define SHA3_384_DIGEST_SIZE WC_SHA3_384_DIGEST_SIZE
74 #define SHA3_512 WC_SHA3_512
75 #define SHA3_512_DIGEST_SIZE WC_SHA3_512_DIGEST_SIZE
76 #define Sha3 wc_Sha3
77 #ifndef WOLFSSL_NO_SHAKE256
78 #define SHAKE128 WC_SHAKE128
79 #define SHAKE256 WC_SHAKE256
80 #endif
81 #endif
82
83
84
85 #ifdef WOLFSSL_XILINX_CRYPT
86 #include "wolfssl/wolfcrypt/port/xilinx/xil-sha3.h"
87 #elif defined(WOLFSSL_AFALG_XILINX_SHA3)
88 #include <wolfssl/wolfcrypt/port/af_alg/afalg_hash.h>
89 #else
90
91 /* Sha3 digest */
92 struct wc_Sha3 {
93 /* State data that is processed for each block. */
94 word64 s[25];
95 /* Unprocessed message data. */
96 byte t[200];
97 /* Index into unprocessed data to place next message byte. */
98 byte i;
99
100 void* heap;
101
102 #ifdef WOLFSSL_ASYNC_CRYPT
103 WC_ASYNC_DEV asyncDev;
104 #endif /* WOLFSSL_ASYNC_CRYPT */
105 #ifdef WOLFSSL_HASH_FLAGS
106 word32 flags; /* enum wc_HashFlags in hash.h */
107 #endif
108 };
109
110 #ifndef WC_SHA3_TYPE_DEFINED
111 typedef struct wc_Sha3 wc_Sha3;
112 #define WC_SHA3_TYPE_DEFINED
113 #endif
114
115 #endif
116
117 #ifndef WOLFSSL_NO_SHAKE256
118 typedef wc_Sha3 wc_Shake;
119 #endif
120
121 #if defined(WOLFSSL_ARMASM) && defined(WOLFSSL_ARMASM_CRYPTO_SHA3)
122 WOLFSSL_LOCAL void BlockSha3(word64 *s);
123 #endif
124
125 WOLFSSL_API int wc_InitSha3_224(wc_Sha3* sha3, void* heap, int devId);
126 WOLFSSL_API int wc_Sha3_224_Update(wc_Sha3* sha3, const byte* data, word32 len);

NetBurner, Inc.
22.286 openssl/srp.h 1357

127 WOLFSSL_API int wc_Sha3_224_Final(wc_Sha3* sha3, byte* hash);


128 WOLFSSL_API void wc_Sha3_224_Free(wc_Sha3* sha3);
129 WOLFSSL_API int wc_Sha3_224_GetHash(wc_Sha3* sha3, byte* hash);
130 WOLFSSL_API int wc_Sha3_224_Copy(wc_Sha3* src, wc_Sha3* dst);
131
132 WOLFSSL_API int wc_InitSha3_256(wc_Sha3* sha3, void* heap, int devId);
133 WOLFSSL_API int wc_Sha3_256_Update(wc_Sha3* sha3, const byte* data, word32 len);
134 WOLFSSL_API int wc_Sha3_256_Final(wc_Sha3* sha3, byte* hash);
135 WOLFSSL_API void wc_Sha3_256_Free(wc_Sha3* sha3);
136 WOLFSSL_API int wc_Sha3_256_GetHash(wc_Sha3* sha3, byte* hash);
137 WOLFSSL_API int wc_Sha3_256_Copy(wc_Sha3* src, wc_Sha3* dst);
138
139 WOLFSSL_API int wc_InitSha3_384(wc_Sha3* sha3, void* heap, int devId);
140 WOLFSSL_API int wc_Sha3_384_Update(wc_Sha3* sha3, const byte* data, word32 len);
141 WOLFSSL_API int wc_Sha3_384_Final(wc_Sha3* sha3, byte* hash);
142 WOLFSSL_API void wc_Sha3_384_Free(wc_Sha3* sha3);
143 WOLFSSL_API int wc_Sha3_384_GetHash(wc_Sha3* sha3, byte* hash);
144 WOLFSSL_API int wc_Sha3_384_Copy(wc_Sha3* src, wc_Sha3* dst);
145
146 WOLFSSL_API int wc_InitSha3_512(wc_Sha3* sha3, void* heap, int devId);
147 WOLFSSL_API int wc_Sha3_512_Update(wc_Sha3* sha3, const byte* data, word32 len);
148 WOLFSSL_API int wc_Sha3_512_Final(wc_Sha3* sha3, byte* hash);
149 WOLFSSL_API void wc_Sha3_512_Free(wc_Sha3* sha3);
150 WOLFSSL_API int wc_Sha3_512_GetHash(wc_Sha3* sha3, byte* hash);
151 WOLFSSL_API int wc_Sha3_512_Copy(wc_Sha3* src, wc_Sha3* dst);
152
153 #ifndef WOLFSSL_NO_SHAKE256
154 WOLFSSL_API int wc_InitShake256(wc_Shake* shake, void* heap, int devId);
155 WOLFSSL_API int wc_Shake256_Update(wc_Shake* shake, const byte* data, word32 len);
156 WOLFSSL_API int wc_Shake256_Final(wc_Shake* shake, byte* hash, word32 hashLen);
157 WOLFSSL_API void wc_Shake256_Free(wc_Shake* shake);
158 WOLFSSL_API int wc_Shake256_Copy(wc_Shake* src, wc_Sha3* dst);
159 #endif
160
161 #ifdef WOLFSSL_HASH_FLAGS
162 WOLFSSL_API int wc_Sha3_SetFlags(wc_Sha3* sha3, word32 flags);
163 WOLFSSL_API int wc_Sha3_GetFlags(wc_Sha3* sha3, word32* flags);
164 #endif
165
166 #ifdef __cplusplus
167 } /* extern "C" */
168 #endif
169
170 #endif /* WOLFSSL_SHA3 */
171 #endif /* WOLF_CRYPT_SHA3_H */
172

22.286 openssl/srp.h
1 /* srp.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_SRP_H_
13 #define WOLFSSL_SRP_H_
14
15 #include <wolfssl/wolfcrypt/srp.h>
16
17 #define SRP_MINIMAL_N SRP_MODULUS_MIN_BITS
18
19 #endif /* WOLFSSL_SRP_H_ */

22.287 srp.h File Reference

22.288 wolfcrypt/srp.h
Go to the documentation of this file.
1 /* srp.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *

NetBurner, Inc.
1358 File Documentation

7 * Contact [email protected] with any questions or comments.


8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifdef WOLFCRYPT_HAVE_SRP
17
18 #ifndef WOLFCRYPT_SRP_H
19 #define WOLFCRYPT_SRP_H
20
21 #include <wolfssl/wolfcrypt/types.h>
22 #include <wolfssl/wolfcrypt/sha.h>
23 #include <wolfssl/wolfcrypt/sha256.h>
24 #include <wolfssl/wolfcrypt/sha512.h>
25 #include <wolfssl/wolfcrypt/integer.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /* Select the largest available hash for the buffer size. */
32 #if defined(WOLFSSL_SHA512)
33 #define SRP_MAX_DIGEST_SIZE WC_SHA512_DIGEST_SIZE
34 #elif defined(WOLFSSL_SHA384)
35 #define SRP_MAX_DIGEST_SIZE WC_SHA384_DIGEST_SIZE
36 #elif !defined(NO_SHA256)
37 #define SRP_MAX_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
38 #elif !defined(NO_SHA)
39 #define SRP_MAX_DIGEST_SIZE WC_SHA_DIGEST_SIZE
40 #else
41 #error "You have to have some kind of SHA hash if you want to use SRP."
42 #endif
43
44 /* Set the minimum number of bits acceptable in an SRP modulus */
45 #define SRP_MODULUS_MIN_BITS 512
46
47 /* Set the minimum number of bits acceptable for private keys (RFC 5054) */
48 #define SRP_PRIVATE_KEY_MIN_BITS 256
49
50 /* salt size for SRP password */
51 #define SRP_SALT_SIZE 16
52
56 typedef enum {
57 SRP_CLIENT_SIDE = 0,
58 SRP_SERVER_SIDE = 1,
59 } SrpSide;
60
64 typedef enum {
65 SRP_TYPE_SHA = 1,
66 SRP_TYPE_SHA256 = 2,
67 SRP_TYPE_SHA384 = 3,
68 SRP_TYPE_SHA512 = 4,
69 } SrpType;
70
71
75 typedef struct {
76 byte type;
77 union {
78 #ifndef NO_SHA
79 wc_Sha sha;
80 #endif
81 #ifndef NO_SHA256
82 wc_Sha256 sha256;
83 #endif
84 #ifdef WOLFSSL_SHA384
85 wc_Sha384 sha384;
86 #endif
87 #ifdef WOLFSSL_SHA512
88 wc_Sha512 sha512;
89 #endif
90 } data;
91 } SrpHash;
92
93 typedef struct Srp {
94 SrpSide side;
95 SrpType type;
96 byte* user;
97 word32 userSz;
98 byte* salt;
99 word32 saltSz;
100 mp_int N;
101 mp_int g;
102 byte k[SRP_MAX_DIGEST_SIZE];
103 mp_int auth;
105 mp_int priv;
106 SrpHash client_proof;
107 SrpHash server_proof;

NetBurner, Inc.
22.289 ssl23.h 1359

108 byte* key;


109 word32 keySz;
110 int (*keyGenFunc_cb) (struct Srp* srp, byte* secret, word32 size);
117 void* heap;
118 } Srp;
119
129 WOLFSSL_API int wc_SrpInit(Srp* srp, SrpType type, SrpSide side);
130 WOLFSSL_API int wc_SrpInit_ex(Srp* srp, SrpType type, SrpSide side,
131 void* heap, int devId);
132
138 WOLFSSL_API void wc_SrpTerm(Srp* srp);
139
151 WOLFSSL_API int wc_SrpSetUsername(Srp* srp, const byte* username, word32 size);
152
153
169 WOLFSSL_API int wc_SrpSetParams(Srp* srp, const byte* N, word32 nSz,
170 const byte* g, word32 gSz,
171 const byte* salt, word32 saltSz);
172
188 WOLFSSL_API int wc_SrpSetPassword(Srp* srp, const byte* password, word32 size);
189
201 WOLFSSL_API int wc_SrpSetVerifier(Srp* srp, const byte* verifier, word32 size);
202
216 WOLFSSL_API int wc_SrpGetVerifier(Srp* srp, byte* verifier, word32* size);
217
234 WOLFSSL_API int wc_SrpSetPrivate(Srp* srp, const byte* priv, word32 size);
235
251 WOLFSSL_API int wc_SrpGetPublic(Srp* srp, byte* pub, word32* size);
252
253
267 WOLFSSL_API int wc_SrpComputeKey(Srp* srp,
268 byte* clientPubKey, word32 clientPubKeySz,
269 byte* serverPubKey, word32 serverPubKeySz);
270
283 WOLFSSL_API int wc_SrpGetProof(Srp* srp, byte* proof, word32* size);
284
296 WOLFSSL_API int wc_SrpVerifyPeersProof(Srp* srp, byte* proof, word32 size);
297
298 #ifdef __cplusplus
299 } /* extern "C" */
300 #endif
301
302 #endif /* WOLFCRYPT_SRP_H */
303 #endif /* WOLFCRYPT_HAVE_SRP */

22.289 ssl23.h
1 /* ssl23.h for openssl */

22.290 stack.h
1 /* stack.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* stack.h for openSSL */
13
14 #ifndef WOLFSSL_STACK_H_
15 #define WOLFSSL_STACK_H_
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 typedef void (*wolfSSL_sk_freefunc)(void *);
22
23 WOLFSSL_API void wolfSSL_sk_GENERIC_pop_free(WOLFSSL_STACK* sk, wolfSSL_sk_freefunc f);
24 WOLFSSL_API void wolfSSL_sk_GENERIC_free(WOLFSSL_STACK *sk);
25 WOLFSSL_API int wolfSSL_sk_GENERIC_push(WOLFSSL_STACK *sk, void *data);
26 WOLFSSL_API void wolfSSL_sk_pop_free(WOLFSSL_STACK *st, void (*func) (void *));
27 WOLFSSL_API WOLFSSL_STACK *wolfSSL_sk_new_null(void);
28
29 WOLFSSL_API int wolfSSL_sk_CIPHER_push(WOLFSSL_STACK *st,WOLFSSL_CIPHER *cipher);
30 WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_sk_CIPHER_pop(WOLF_STACK_OF(WOLFSSL_CIPHER)* sk);
31 WOLFSSL_API WOLFSSL_STACK* wolfSSL_sk_new_cipher(void);

NetBurner, Inc.
1360 File Documentation

32
33 #define OPENSSL_sk_free wolfSSL_sk_free
34 #define OPENSSL_sk_pop_free wolfSSL_sk_pop_free
35 #define OPENSSL_sk_new_null wolfSSL_sk_new_null
36 #define OPENSSL_sk_push wolfSSL_sk_push
37
38 /* provides older OpenSSL API compatibility */
39 #define sk_free OPENSSL_sk_free
40 #define sk_pop_free OPENSSL_sk_pop_free
41 #define sk_new_null OPENSSL_sk_new_null
42 #define sk_push OPENSSL_sk_push
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif

22.291 tls1.h
1 /* tls1.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLFSSL_OPENSSL_TLS1_H_
14 #define WOLFSSL_OPENSSL_TLS1_H_
15
16 #ifndef TLS1_VERSION
17 #define TLS1_VERSION 0x0301
18 #endif
19
20 #ifndef TLS1_1_VERSION
21 #define TLS1_1_VERSION 0x0302
22 #endif
23
24 #ifndef TLS1_2_VERSION
25 #define TLS1_2_VERSION 0x0303
26 #endif
27
28 #ifndef TLS1_3_VERSION
29 #define TLS1_3_VERSION 0x0304
30 #endif
31
32 #ifndef TLS_MAX_VERSION
33 #define TLS_MAX_VERSION TLS1_3_VERSION
34 #endif
35
36 #endif /* WOLFSSL_OPENSSL_TLS1_H_ */

22.292 txt_db.h
1 /* txt_db.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_TXT_DB_H_
13 #define WOLFSSL_TXT_DB_H_
14
15 #include <wolfssl/openssl/ssl.h>
16
17 #define WOLFSSL_TXT_DB_MAX_FIELDS 10
18
19 struct WOLFSSL_TXT_DB {
20 int num_fields;
21 WOLF_STACK_OF(WOLFSSL_STRING) *data;
22 long error;
23 long arg1;

NetBurner, Inc.
22.293 ui.h 1361

24 long arg2;
25 wolf_sk_compare_cb comp[WOLFSSL_TXT_DB_MAX_FIELDS];
26 wolf_sk_hash_cb hash_fn[WOLFSSL_TXT_DB_MAX_FIELDS];
27 };
28
29 typedef struct WOLFSSL_TXT_DB WOLFSSL_TXT_DB;
30
31 WOLFSSL_API WOLFSSL_TXT_DB *wolfSSL_TXT_DB_read(WOLFSSL_BIO *in, int num);
32 WOLFSSL_API long wolfSSL_TXT_DB_write(WOLFSSL_BIO *out, WOLFSSL_TXT_DB *db);
33 WOLFSSL_API int wolfSSL_TXT_DB_insert(WOLFSSL_TXT_DB *db, WOLFSSL_STRING *row);
34 WOLFSSL_API void wolfSSL_TXT_DB_free(WOLFSSL_TXT_DB *db);
35 WOLFSSL_API int wolfSSL_TXT_DB_create_index(WOLFSSL_TXT_DB *db, int field,
36 void* qual, wolf_sk_hash_cb hash, wolf_sk_compare_cb cmp);
37 WOLFSSL_API WOLFSSL_STRING *wolfSSL_TXT_DB_get_by_index(WOLFSSL_TXT_DB *db,
38 int idx, WOLFSSL_STRING *value);
39
40 #define TXT_DB WOLFSSL_TXT_DB
41
42 #define TXT_DB_read wolfSSL_TXT_DB_read
43 #define TXT_DB_write wolfSSL_TXT_DB_write
44 #define TXT_DB_insert wolfSSL_TXT_DB_insert
45 #define TXT_DB_free wolfSSL_TXT_DB_free
46 #define TXT_DB_create_index wolfSSL_TXT_DB_create_index
47 #define TXT_DB_get_by_index wolfSSL_TXT_DB_get_by_index
48
49 #endif /* WOLFSSL_TXT_DB_H_ */

22.293 ui.h
1 /* ui.h for openssl */
2

22.294 x509.h
1 /* x509.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* x509.h for openssl */
13
14 #ifndef WOLFSSL_OPENSSL_509_H_
15 #define WOLFSSL_OPENSSL_509_H_
16
17 #include <wolfssl/openssl/ssl.h>
18 #include <wolfssl/openssl/crypto.h>
19 #include <wolfssl/openssl/dh.h>
20 #include <wolfssl/openssl/ec.h>
21 #include <wolfssl/openssl/ecdsa.h>
22 #include <wolfssl/openssl/pkcs7.h>
23
24 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
25
26 /* wolfSSL_X509_print_ex flags */
27 #define X509_FLAG_COMPAT (0UL)
28 #define X509_FLAG_NO_HEADER (1UL « 0)
29 #define X509_FLAG_NO_VERSION (1UL « 1)
30 #define X509_FLAG_NO_SERIAL (1UL « 2)
31 #define X509_FLAG_NO_SIGNAME (1UL « 3)
32 #define X509_FLAG_NO_ISSUER (1UL « 4)
33 #define X509_FLAG_NO_VALIDITY (1UL « 5)
34 #define X509_FLAG_NO_SUBJECT (1UL « 6)
35 #define X509_FLAG_NO_PUBKEY (1UL « 7)
36 #define X509_FLAG_NO_EXTENSIONS (1UL « 8)
37 #define X509_FLAG_NO_SIGDUMP (1UL « 9)
38 #define X509_FLAG_NO_AUX (1UL « 10)
39 #define X509_FLAG_NO_ATTRIBUTES (1UL « 11)
40 #define X509_FLAG_NO_IDS (1UL « 12)
41
42 #define XN_FLAG_FN_SN 0
43 #define XN_FLAG_ONELINE 0
44 #define XN_FLAG_COMPAT 0
45 #define XN_FLAG_RFC2253 1
46 #define XN_FLAG_SEP_COMMA_PLUS (1 « 16)
47 #define XN_FLAG_SEP_CPLUS_SPC (2 « 16)
48 #define XN_FLAG_SEP_SPLUS_SPC (3 « 16)

NetBurner, Inc.
1362 File Documentation

49 #define XN_FLAG_SEP_MULTILINE (4 « 16)


50 #define XN_FLAG_SEP_MASK (0xF « 16)
51 #define XN_FLAG_DN_REV (1 « 20)
52 #define XN_FLAG_FN_LN (1 « 21)
53 #define XN_FLAG_FN_OID (2 « 21)
54 #define XN_FLAG_FN_NONE (3 « 21)
55 #define XN_FLAG_FN_MASK (3 « 21)
56 #define XN_FLAG_SPC_EQ (1 « 23)
57 #define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 « 24)
58 #define XN_FLAG_FN_ALIGN (1 « 25)
59
60 #define XN_FLAG_MULTILINE 0xFFFF
61
62 #define X509_EXTENSION_set_critical wolfSSL_X509_EXTENSION_set_critical
63 #define X509_EXTENSION_set_object wolfSSL_X509_EXTENSION_set_object
64 #define X509_EXTENSION_set_data wolfSSL_X509_EXTENSION_set_data
65
66 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
67
68 #endif /* WOLFSSL_OPENSSL_509_H_ */

22.295 x509_vfy.h
1 /* x509_vfy.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* x509_vfy.h for openSSL */
13
14 #ifndef WOLFSSL_x509_vfy_H_
15 #define WOLFSSL_x509_vfy_H_
16
17 #include <wolfssl/openssl/x509v3.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
24 WOLFSSL_API int wolfSSL_X509_STORE_CTX_set_purpose(WOLFSSL_X509_STORE_CTX *ctx, int purpose);
25 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_flags(WOLFSSL_X509_STORE_CTX *ctx,
26 unsigned long flags);
27 #endif
28
29 #define X509_STORE_CTX_set_purpose wolfSSL_X509_STORE_CTX_set_purpose
30 #define X509_STORE_CTX_set_flags wolfSSL_X509_STORE_CTX_set_flags
31
32 #ifdef __cplusplus
33 } /* extern "C" */
34 #endif
35
36 #endif /* WOLFSSL_x509_vfy_H_ */

22.296 x509v3.h
1 /* x509v3.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* x509v3.h for openSSL */
13
14 #ifndef WOLFSSL_x509v3_H
15 #define WOLFSSL_x509v3_H
16
17 #include <wolfssl/openssl/conf.h>
18 #include <wolfssl/openssl/bio.h>
19
20 #ifdef __cplusplus

NetBurner, Inc.
22.296 x509v3.h 1363

21 extern "C" {
22 #endif
23
24 #define EXFLAG_KUSAGE 0x2
25 #define EXFLAG_XKUSAGE 0x4
26
27 #define KU_DIGITAL_SIGNATURE KEYUSE_DIGITAL_SIG
28 #define KU_NON_REPUDIATION KEYUSE_CONTENT_COMMIT
29 #define KU_KEY_ENCIPHERMENT KEYUSE_KEY_ENCIPHER
30 #define KU_DATA_ENCIPHERMENT KEYUSE_DATA_ENCIPHER
31 #define KU_KEY_AGREEMENT KEYUSE_KEY_AGREE
32 #define KU_KEY_CERT_SIGN KEYUSE_KEY_CERT_SIGN
33 #define KU_CRL_SIGN KEYUSE_CRL_SIGN
34 #define KU_ENCIPHER_ONLY KEYUSE_ENCIPHER_ONLY
35 #define KU_DECIPHER_ONLY KEYUSE_DECIPHER_ONLY
36
37 #define XKU_SSL_SERVER 0x1
38 #define XKU_SSL_CLIENT 0x2
39 #define XKU_SMIME 0x4
40 #define XKU_CODE_SIGN 0x8
41 #define XKU_SGC 0x10
42 #define XKU_OCSP_SIGN 0x20
43 #define XKU_TIMESTAMP 0x40
44 #define XKU_DVCS 0x80
45 #define XKU_ANYEKU 0x100
46
47 #define X509_PURPOSE_SSL_CLIENT 0
48 #define X509_PURPOSE_SSL_SERVER 1
49
50 #define NS_SSL_CLIENT WC_NS_SSL_CLIENT
51 #define NS_SSL_SERVER WC_NS_SSL_SERVER
52
53 /* Forward reference */
54
55 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x0090801fL
56 typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long);
57 #else
58 typedef void *(*X509V3_EXT_D2I)(void *, unsigned char **, long);
59 #endif
60 typedef int (*X509V3_EXT_I2D) (void *, unsigned char **);
61 typedef STACK_OF(CONF_VALUE) *(*X509V3_EXT_I2V) (
62 struct WOLFSSL_v3_ext_method *method,
63 void *ext, STACK_OF(CONF_VALUE) *extlist);
64 typedef char *(*X509V3_EXT_I2S)(struct WOLFSSL_v3_ext_method *method, void *ext);
65 typedef int (*X509V3_EXT_I2R) (struct WOLFSSL_v3_ext_method *method,
66 void *ext, BIO *out, int indent);
67 typedef struct WOLFSSL_v3_ext_method X509V3_EXT_METHOD;
68
69 struct WOLFSSL_v3_ext_method {
70 int ext_nid;
71 int ext_flags;
72 void *usr_data;
73 X509V3_EXT_D2I d2i;
74 X509V3_EXT_I2D i2d;
75 X509V3_EXT_I2V i2v;
76 X509V3_EXT_I2S i2s;
77 X509V3_EXT_I2R i2r;
78 };
79
80 struct WOLFSSL_X509_EXTENSION {
81 WOLFSSL_ASN1_OBJECT *obj;
82 WOLFSSL_ASN1_BOOLEAN crit;
83 ASN1_OCTET_STRING value; /* DER format of extension */
84 WOLFSSL_v3_ext_method ext_method;
85 WOLFSSL_STACK* ext_sk; /* For extension specific data */
86 };
87
88 #define WOLFSSL_ASN1_BOOLEAN int
89 #define GEN_OTHERNAME 0
90 #define GEN_EMAIL 1
91 #define GEN_DNS 2
92 #define GEN_X400 3
93 #define GEN_DIRNAME 4
94 #define GEN_EDIPARTY 5
95 #define GEN_URI 6
96 #define GEN_IPADD 7
97 #define GEN_RID 8
98
99 #define GENERAL_NAME WOLFSSL_GENERAL_NAME
100
101 #define X509V3_CTX WOLFSSL_X509V3_CTX
102
103 #define CTX_TEST 0x1
104
105 typedef struct WOLFSSL_AUTHORITY_KEYID AUTHORITY_KEYID;
106 typedef struct WOLFSSL_BASIC_CONSTRAINTS BASIC_CONSTRAINTS;
107 typedef struct WOLFSSL_ACCESS_DESCRIPTION ACCESS_DESCRIPTION;

NetBurner, Inc.
1364 File Documentation

108 typedef WOLF_STACK_OF(WOLFSSL_ACCESS_DESCRIPTION) WOLFSSL_AUTHORITY_INFO_ACCESS;


109
110 WOLFSSL_API WOLFSSL_BASIC_CONSTRAINTS* wolfSSL_BASIC_CONSTRAINTS_new(void);
111 WOLFSSL_API void wolfSSL_BASIC_CONSTRAINTS_free(WOLFSSL_BASIC_CONSTRAINTS *bc);
112 WOLFSSL_API WOLFSSL_AUTHORITY_KEYID* wolfSSL_AUTHORITY_KEYID_new(void);
113 WOLFSSL_API void wolfSSL_AUTHORITY_KEYID_free(WOLFSSL_AUTHORITY_KEYID *id);
114 #if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10100000L
115 WOLFSSL_API const WOLFSSL_v3_ext_method* wolfSSL_X509V3_EXT_get(
116 WOLFSSL_X509_EXTENSION* ex);
117 #else
118 WOLFSSL_API WOLFSSL_v3_ext_method* wolfSSL_X509V3_EXT_get(
119 WOLFSSL_X509_EXTENSION* ex);
120 #endif
121 WOLFSSL_API void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ex);
122 WOLFSSL_API char* wolfSSL_i2s_ASN1_STRING(WOLFSSL_v3_ext_method *method,
123 const WOLFSSL_ASN1_STRING *s);
124 WOLFSSL_API int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out,
125 WOLFSSL_X509_EXTENSION *ext, unsigned long flag, int indent);
126 WOLFSSL_API int wolfSSL_X509V3_EXT_add_nconf(WOLFSSL_CONF *conf, WOLFSSL_X509V3_CTX *ctx,
127 const char *section, WOLFSSL_X509 *cert);
128 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_a2i_IPADDRESS(const char* ipa);
129
130 #define BASIC_CONSTRAINTS_free wolfSSL_BASIC_CONSTRAINTS_free
131 #define AUTHORITY_KEYID_free wolfSSL_AUTHORITY_KEYID_free
132 #define SSL_CTX_get_cert_store(x) wolfSSL_CTX_get_cert_store ((WOLFSSL_CTX*) (x))
133 #define ASN1_INTEGER WOLFSSL_ASN1_INTEGER
134 #define ASN1_OCTET_STRING WOLFSSL_ASN1_STRING
135 #define X509V3_EXT_get wolfSSL_X509V3_EXT_get
136 #define X509V3_EXT_d2i wolfSSL_X509V3_EXT_d2i
137 #define X509V3_EXT_add_nconf wolfSSL_X509V3_EXT_add_nconf
138 #ifndef NO_WOLFSSL_STUB
139 #define X509V3_parse_list(...) NULL
140 #endif
141 #define i2s_ASN1_OCTET_STRING wolfSSL_i2s_ASN1_STRING
142 #define a2i_IPADDRESS wolfSSL_a2i_IPADDRESS
143 #define X509V3_EXT_print wolfSSL_X509V3_EXT_print
144 #define X509V3_EXT_conf_nid wolfSSL_X509V3_EXT_conf_nid
145 #define X509V3_set_ctx wolfSSL_X509V3_set_ctx
146 #ifndef NO_WOLFSSL_STUB
147 #define X509V3_set_nconf(...)
148 #define X509V3_EXT_cleanup(...)
149 #endif
150 #define X509V3_set_ctx_test(ctx) wolfSSL_X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
151 #define X509V3_set_ctx_nodb wolfSSL_X509V3_set_ctx_nodb
152 #define X509v3_get_ext_count wolfSSL_sk_num
153
154 #ifdef __cplusplus
155 }
156 #endif
157
158 #endif

22.297 options.h
1 /* options.h.in
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 /* default blank options for autoconf */
14
15 #ifndef WOLFSSL_OPTIONS_H
16 #define WOLFSSL_OPTIONS_H
17
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23
24 #ifdef __cplusplus
25 }
26 #endif
27
28
29 #endif /* WOLFSSL_OPTIONS_H */
30

NetBurner, Inc.
22.298 quic.h 1365

22.298 quic.h
1 /* quic.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 /* wolfSSL QUIC API */
15
16 #ifndef WOLFSSL_QUIC_H
17 #define WOLFSSL_QUIC_H
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #ifdef WOLFSSL_QUIC
24
25 /* QUIC operates on three encryption levels which determine
26 * which keys/algos are used for de-/encryption. These are
27 * kept separately for incoming and outgoing data and.
28 * Due to the nature of UDP, more than one might be in use
29 * at the same time due to resends or out-of-order arrivals.
30 */
31 typedef enum wolfssl_encryption_level_t {
32 wolfssl_encryption_initial = 0,
33 wolfssl_encryption_early_data,
34 wolfssl_encryption_handshake,
35 wolfssl_encryption_application
36 } WOLFSSL_ENCRYPTION_LEVEL;
37
38
39 /* All QUIC related callbacks to the application.
40 */
41 typedef struct wolfssl_quic_method_t WOLFSSL_QUIC_METHOD;
42
43 struct wolfssl_quic_method_t {
49 int (*set_encryption_secrets)(WOLFSSL* ssl, WOLFSSL_ENCRYPTION_LEVEL level,
50 const uint8_t* read_secret,
51 const uint8_t* write_secret,
52 size_t secret_len);
57 int (*add_handshake_data)(WOLFSSL* ssl, WOLFSSL_ENCRYPTION_LEVEL level,
58 const uint8_t* data, size_t len);
62 int (*flush_flight)(WOLFSSL* ssl);
67 int (*send_alert)(WOLFSSL* ssl, WOLFSSL_ENCRYPTION_LEVEL level,
68 uint8_t alert);
69 };
70
71
77 WOLFSSL_API
78 int wolfSSL_CTX_set_quic_method(WOLFSSL_CTX* ctx,
79 const WOLFSSL_QUIC_METHOD* quic_method);
84 WOLFSSL_API
85 int wolfSSL_set_quic_method(WOLFSSL* ssl,
86 const WOLFSSL_QUIC_METHOD* quic_method);
87
91 WOLFSSL_API int wolfSSL_is_quic(WOLFSSL* ssl);
92
96 WOLFSSL_API
97 WOLFSSL_ENCRYPTION_LEVEL wolfSSL_quic_read_level(const WOLFSSL* ssl);
98
102 WOLFSSL_API
103 WOLFSSL_ENCRYPTION_LEVEL wolfSSL_quic_write_level(const WOLFSSL* ssl);
104
105
112 WOLFSSL_API
113 void wolfSSL_set_quic_use_legacy_codepoint(WOLFSSL* ssl, int use_legacy);
114
123 WOLFSSL_API
124 void wolfSSL_set_quic_transport_version(WOLFSSL* ssl, int version);
125
129 WOLFSSL_API int wolfSSL_get_quic_transport_version(const WOLFSSL* ssl);
130
135 WOLFSSL_API int wolfSSL_set_quic_transport_params(WOLFSSL* ssl,
136 const uint8_t* params,
137 size_t params_len);
145 WOLFSSL_API
146 void wolfSSL_get_peer_quic_transport_params(const WOLFSSL* ssl,
147 const uint8_t* *out_params,

NetBurner, Inc.
1366 File Documentation

148 size_t* out_params_len);


149
153 WOLFSSL_API int wolfSSL_get_peer_quic_transport_version(const WOLFSSL* ssl);
154
155 #ifdef WOLFSSL_EARLY_DATA
156 WOLFSSL_API void wolfSSL_set_quic_early_data_enabled(WOLFSSL* ssl, int enabled);
157 #endif
158
164 WOLFSSL_API
165 size_t wolfSSL_quic_max_handshake_flight_len(const WOLFSSL* ssl,
166 WOLFSSL_ENCRYPTION_LEVEL level);
167
168
178 WOLFSSL_API
179 int wolfSSL_provide_quic_data(WOLFSSL* ssl, WOLFSSL_ENCRYPTION_LEVEL level,
180 const uint8_t* data, size_t len);
181
182 WOLFSSL_API
183 int wolfSSL_quic_do_handshake(WOLFSSL* ssl);
184
188 WOLFSSL_API int wolfSSL_process_quic_post_handshake(WOLFSSL* ssl);
189
194 WOLFSSL_API int wolfSSL_quic_read_write(WOLFSSL* ssl);
195
201 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_quic_get_aead(WOLFSSL* ssl);
202
206 WOLFSSL_API int wolfSSL_quic_aead_is_gcm(const WOLFSSL_EVP_CIPHER* aead_cipher);
207 WOLFSSL_API int wolfSSL_quic_aead_is_ccm(const WOLFSSL_EVP_CIPHER* aead_cipher);
208 WOLFSSL_API
209 int wolfSSL_quic_aead_is_chacha20(const WOLFSSL_EVP_CIPHER* aead_cipher);
210
215 WOLFSSL_API
216 size_t wolfSSL_quic_get_aead_tag_len(const WOLFSSL_EVP_CIPHER* aead_cipher);
217
221 WOLFSSL_API const WOLFSSL_EVP_MD* wolfSSL_quic_get_md(WOLFSSL* ssl);
222
227 WOLFSSL_API const WOLFSSL_EVP_CIPHER* wolfSSL_quic_get_hp(WOLFSSL* ssl);
228
232 WOLFSSL_API WOLFSSL_EVP_CIPHER_CTX*
233 wolfSSL_quic_crypt_new(const WOLFSSL_EVP_CIPHER* cipher,
234 const uint8_t* key, const uint8_t* iv, int encrypt);
235
239 WOLFSSL_API
240 int wolfSSL_quic_aead_encrypt(uint8_t* dest, WOLFSSL_EVP_CIPHER_CTX* aead_ctx,
241 const uint8_t* plain, size_t plainlen,
242 const uint8_t* iv, const uint8_t* aad,
243 size_t aadlen);
247 WOLFSSL_API
248 int wolfSSL_quic_aead_decrypt(uint8_t* dest, WOLFSSL_EVP_CIPHER_CTX* ctx,
249 const uint8_t* enc, size_t enclen,
250 const uint8_t* iv, const uint8_t* aad,
251 size_t aadlen);
252
257 WOLFSSL_API
258 int wolfSSL_quic_hkdf_extract(uint8_t* dest, const WOLFSSL_EVP_MD* md,
259 const uint8_t* secret, size_t secretlen,
260 const uint8_t* salt, size_t saltlen);
265 WOLFSSL_API
266 int wolfSSL_quic_hkdf_expand(uint8_t* dest, size_t destlen,
267 const WOLFSSL_EVP_MD* md,
268 const uint8_t* secret, size_t secretlen,
269 const uint8_t* info, size_t infolen);
270
274 WOLFSSL_API
275 int wolfSSL_quic_hkdf(uint8_t* dest, size_t destlen,
276 const WOLFSSL_EVP_MD* md,
277 const uint8_t* secret, size_t secretlen,
278 const uint8_t* salt, size_t saltlen,
279 const uint8_t* info, size_t infolen);
280
281 #endif /* WOLFSSL_QUIC */
282
283 #ifdef __cplusplus
284 } /* extern "C" */
285 #endif
286
287 #endif /* WOLFSSL_QUIC_H */

22.299 sniffer.h
1 /* sniffer.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.

NetBurner, Inc.
22.299 sniffer.h 1367

6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 #ifndef WOLFSSL_SNIFFER_H
15 #define WOLFSSL_SNIFFER_H
16
17 #include <wolfssl/wolfcrypt/settings.h>
18 #include <wolfssl/wolfcrypt/asn_public.h>
19
20 #ifdef HAVE_WOLF_EVENT
21 #include <wolfssl/wolfcrypt/wolfevent.h>
22 #endif
23
24
25 #ifdef _WIN32
26 #ifdef SSL_SNIFFER_EXPORTS
27 #define SSL_SNIFFER_API __declspec(dllexport)
28 #else
29 #define SSL_SNIFFER_API __declspec(dllimport)
30 #endif
31 #else
32 #define SSL_SNIFFER_API
33 #endif /* _WIN32 */
34
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 /* @param typeK: (formerly keyType) was shadowing a global declaration in
41 * wolfssl/wolfcrypt/asn.h line 175
42 */
43 WOLFSSL_API
44 SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port,
45 const char* keyFile, int typeK,
46 const char* password, char* error);
47
48 WOLFSSL_API
49 SSL_SNIFFER_API int ssl_SetPrivateKeyBuffer(const char* address, int port,
50 const char* keyBuf, int keySz,
51 int typeK, const char* password,
52 char* error);
53
54
55 WOLFSSL_API
56 SSL_SNIFFER_API int ssl_SetNamedPrivateKey(const char* name,
57 const char* address, int port,
58 const char* keyFile, int typeK,
59 const char* password, char* error);
60
61 WOLFSSL_API
62 SSL_SNIFFER_API int ssl_SetNamedPrivateKeyBuffer(const char* name,
63 const char* address, int port,
64 const char* keyBuf, int keySz,
65 int typeK, const char* password,
66 char* error);
67
68 WOLFSSL_API
69 SSL_SNIFFER_API int ssl_SetEphemeralKey(const char* address, int port,
70 const char* keyFile, int typeKey,
71 const char* password, char* error);
72
73 WOLFSSL_API
74 SSL_SNIFFER_API int ssl_SetEphemeralKeyBuffer(const char* address, int port,
75 const char* keyBuf, int keySz, int typeKey,
76 const char* password, char* error);
77
78
79 WOLFSSL_API
80 SSL_SNIFFER_API int ssl_SetNamedEphemeralKey(const char* name,
81 const char* address, int port,
82 const char* keyFile, int typeKey,
83 const char* password, char* error);
84
85 WOLFSSL_API
86 SSL_SNIFFER_API int ssl_SetNamedEphemeralKeyBuffer(const char* name,
87 const char* address, int port,
88 const char* keyBuf, int keySz, int typeKey,
89 const char* password, char* error);
90
91 WOLFSSL_API
92 SSL_SNIFFER_API int ssl_DecodePacket(const unsigned char* packet, int length,

NetBurner, Inc.
1368 File Documentation

93 unsigned char** data, char* error);


94
95 WOLFSSL_API
96 SSL_SNIFFER_API int ssl_FreeDecodeBuffer(unsigned char** data, char* error);
97
98 WOLFSSL_API
99 SSL_SNIFFER_API int ssl_FreeZeroDecodeBuffer(unsigned char** data, int sz,
100 char* error);
101
102 WOLFSSL_API
103 SSL_SNIFFER_API int ssl_Trace(const char* traceFile, char* error);
104
105 WOLFSSL_API
106 SSL_SNIFFER_API int ssl_EnableRecovery(int onOff, int maxMemory, char* error);
107
108 WOLFSSL_API
109 SSL_SNIFFER_API int ssl_GetSessionStats(unsigned int* active,
110 unsigned int* total,
111 unsigned int* peak,
112 unsigned int* maxSessions,
113 unsigned int* missedData,
114 unsigned int* reassemblyMemory,
115 char* error);
116
117 WOLFSSL_API
118 SSL_SNIFFER_API void ssl_InitSniffer(void);
119 WOLFSSL_API
120 SSL_SNIFFER_API void ssl_InitSniffer_ex(int devId);
121
122 WOLFSSL_API
123 SSL_SNIFFER_API void ssl_FreeSniffer(void);
124
125
126 /* ssl_SetPrivateKey typeKs */
127 enum {
128 FILETYPE_PEM = 1,
129 FILETYPE_DER = 2,
130 };
131
132
133 /*
134 * New Sniffer API that provides read-only access to the TLS and cipher
135 * information associated with the SSL session.
136 */
137
138 typedef struct SSLInfo
139 {
140 unsigned char isValid;
141 /* indicates if the info in this struct is valid: 0 = no, 1 = yes */
142 unsigned char protocolVersionMajor; /* SSL Version: major */
143 unsigned char protocolVersionMinor; /* SSL Version: minor */
144 unsigned char serverCipherSuite0; /* first byte, normally 0 */
145 unsigned char serverCipherSuite; /* second byte, actual suite */
146 unsigned char serverCipherSuiteName[256];
147 /* cipher name, e.g., "TLS_RSA_..." */
148 unsigned char serverNameIndication[128];
149 unsigned int keySize;
150 } SSLInfo;
151
152
153 WOLFSSL_API
154 SSL_SNIFFER_API int ssl_DecodePacketWithSessionInfo(
155 const unsigned char* packet, int length,
156 unsigned char** data, SSLInfo* sslInfo, char* error);
157
158 typedef void (*SSLConnCb)(const void* session, SSLInfo* info, void* ctx);
159
160 WOLFSSL_API
161 SSL_SNIFFER_API int ssl_SetConnectionCb(SSLConnCb cb);
162
163 WOLFSSL_API
164 SSL_SNIFFER_API int ssl_SetConnectionCtx(void* ctx);
165
166
167 typedef struct SSLStats
168 {
169 unsigned long int sslStandardConns; /* server_hello count not including resumed sessions */
170 unsigned long int sslClientAuthConns; /* client’s who have presented certificates (mutual
authentication) */
171 unsigned long int sslResumedConns; /* resumed connections */
172 unsigned long int sslEphemeralMisses; /* TLS v1.2 and older PFS / ephemeral connections missed
(not able to decrypt) */
173 unsigned long int sslResumeMisses; /* Resumption sessions not found */
174 unsigned long int sslCiphersUnsupported; /* No cipher suite match found when compared to supported
*/
175 unsigned long int sslKeysUnmatched; /* Key callback failures (not found). Applies to
WOLFSSL_SNIFFER_WATCH only */

NetBurner, Inc.
22.299 sniffer.h 1369

176 unsigned long int sslKeyFails; /* Failures loading or using keys */


177 unsigned long int sslDecodeFails; /* Dropped packets (not application_data or match protocol
version) */
178 unsigned long int sslAlerts; /* Number of decoded alert messages */
179 unsigned long int sslDecryptedBytes; /* Number of decrypted bytes */
180 unsigned long int sslEncryptedBytes; /* Number of encrypted bytes */
181 unsigned long int sslEncryptedPackets; /* Number of encrypted packets */
182 unsigned long int sslDecryptedPackets; /* Number of decrypted packets */
183 unsigned long int sslKeyMatches; /* Key callback successes (failures tracked in
sslKeysUnmatched). Applies to WOLFSSL_SNIFFER_WATCH only. */
184 unsigned long int sslEncryptedConns; /* Number of created sniffer sessions */
185 unsigned long int sslResumptionInserts; /* Number of sessions reused with resumption */
186 } SSLStats;
187
188 WOLFSSL_API
189 SSL_SNIFFER_API int ssl_ResetStatistics(void);
190
191 WOLFSSL_API
192 SSL_SNIFFER_API int ssl_ReadStatistics(SSLStats* stats);
193
194 WOLFSSL_API
195 SSL_SNIFFER_API int ssl_ReadResetStatistics(SSLStats* stats);
196
197
198 #if defined(WOLFSSL_STATIC_EPHEMERAL) && defined(WOLFSSL_TLS13)
199 /* macro indicating support for key callback */
200 #undef WOLFSSL_SNIFFER_KEY_CALLBACK
201 #define WOLFSSL_SNIFFER_KEY_CALLBACK
202
203 typedef int (*SSLKeyCb)(void* vSniffer, int namedGroup,
204 const unsigned char* srvPub, unsigned int srvPubSz,
205 const unsigned char* cliPub, unsigned int cliPubSz,
206 DerBuffer* privKey, void* cbCtx, char* error);
207
208 WOLFSSL_API
209 SSL_SNIFFER_API int ssl_SetKeyCallback(SSLKeyCb cb, void* cbCtx);
210 #endif
211
212
213 #ifdef WOLFSSL_SNIFFER_WATCH
214 typedef int (*SSLWatchCb)(void* vSniffer,
215 const unsigned char* certHash,
216 unsigned int certHashSz,
217 const unsigned char* certChain,
218 unsigned int certChainSz,
219 void* ctx, char* error);
220
221 WOLFSSL_API
222 SSL_SNIFFER_API int ssl_SetWatchKeyCallback(SSLWatchCb cb, char* error);
223
224 WOLFSSL_API
225 SSL_SNIFFER_API int ssl_SetWatchKeyCallback_ex(SSLWatchCb cb, int devId,
226 char* error);
227
228 WOLFSSL_API
229 SSL_SNIFFER_API int ssl_SetWatchKeyCtx(void* ctx, char* error);
230
231 WOLFSSL_API
232 SSL_SNIFFER_API int ssl_SetWatchKey_buffer(void* vSniffer,
233 const unsigned char* key, unsigned int keySz,
234 int keyType, char* error);
235
236 WOLFSSL_API
237 SSL_SNIFFER_API int ssl_SetWatchKey_file(void* vSniffer,
238 const char* keyFile, int keyType,
239 const char* password, char* error);
240 #endif
241
242 #ifdef WOLFSSL_SNIFFER_STORE_DATA_CB
243 typedef int (*SSLStoreDataCb)(const unsigned char* decryptBuf,
244 unsigned int decryptBufSz, unsigned int decryptBufOffset, void* ctx);
245
246 WOLFSSL_API
247 SSL_SNIFFER_API int ssl_SetStoreDataCallback(SSLStoreDataCb cb);
248 #endif
249
250 #ifdef WOLFSSL_SNIFFER_STORE_DATA_CB
251 WOLFSSL_API
252 SSL_SNIFFER_API int ssl_DecodePacketWithSessionInfoStoreData(
253 const unsigned char* packet, int length, void* ctx,
254 SSLInfo* sslInfo, char* error);
255 #endif
256
257 #ifdef WOLFSSL_SNIFFER_CHAIN_INPUT
258 WOLFSSL_API
259 SSL_SNIFFER_API int ssl_DecodePacketWithChain(void* vChain,
260 unsigned int chainSz, unsigned char** data, char* error);

NetBurner, Inc.
1370 File Documentation

261 #endif
262
263 #if defined(WOLFSSL_SNIFFER_CHAIN_INPUT) && \
264 defined(WOLFSSL_SNIFFER_STORE_DATA_CB)
265 WOLFSSL_API
266 SSL_SNIFFER_API int ssl_DecodePacketWithChainSessionInfoStoreData(
267 void* vChain, unsigned int chainSz, void* ctx, SSLInfo* sslInfo,
268 char* error);
269 #endif
270
271
272 #ifdef WOLFSSL_ASYNC_CRYPT
273
274 WOLFSSL_API
275 SSL_SNIFFER_API int ssl_DecodePacketAsync(void* packet, unsigned int packetSz,
276 int isChain, unsigned char** data, char* error, SSLInfo* sslInfo,
277 void* userCtx);
278
279 WOLFSSL_API
280 SSL_SNIFFER_API int ssl_PollSniffer(WOLF_EVENT** events, int maxEvents,
281 WOLF_EVENT_FLAG flags, int* eventCount);
282
283 #endif /* WOLFSSL_ASYNC_CRYPT */
284
285
286
287 #ifdef __cplusplus
288 } /* extern "C" */
289 #endif
290
291 #endif /* wolfSSL_SNIFFER_H */
292

22.300 sniffer_error.h
1 /* sniffer_error.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 #ifndef WOLFSSL_SNIFFER_ERROR_H
15 #define WOLFSSL_SNIFFER_ERROR_H
16
17
18 /* General Sniffer Error */
19 #define WOLFSSL_SNIFFER_ERROR -1
20
21 /* Sniffer failed and is in Fatal state */
22 #define WOLFSSL_SNIFFER_FATAL_ERROR -2
23
24 /* need to have errors as #defines since .rc files can’t handle enums */
25 /* need to start at 1 and go in order for same reason */
26
27 #define MEMORY_STR 1
28 #define NEW_SERVER_STR 2
29 #define IP_CHECK_STR 3
30 #define SERVER_NOT_REG_STR 4
31 #define TCP_CHECK_STR 5
32 #define SERVER_PORT_NOT_REG_STR 6
33 #define RSA_DECRYPT_STR 7
34 #define RSA_DECODE_STR 8
35 #define BAD_CIPHER_SPEC_STR 9
36 #define SERVER_HELLO_INPUT_STR 10
37
38 #define BAD_SESSION_RESUME_STR 11
39 #define SERVER_DID_RESUMPTION_STR 12
40 #define CLIENT_HELLO_INPUT_STR 13
41 #define CLIENT_RESUME_TRY_STR 14
42 #define HANDSHAKE_INPUT_STR 15
43 #define GOT_HELLO_VERIFY_STR 16
44 #define GOT_SERVER_HELLO_STR 17
45 #define GOT_CERT_REQ_STR 18
46 #define GOT_SERVER_KEY_EX_STR 19
47 #define GOT_CERT_STR 20
48
49 #define GOT_SERVER_HELLO_DONE_STR 21
50 #define GOT_FINISHED_STR 22

NetBurner, Inc.
22.300 sniffer_error.h 1371

51 #define GOT_CLIENT_HELLO_STR 23
52 #define GOT_CLIENT_KEY_EX_STR 24
53 #define GOT_CERT_VER_STR 25
54 #define GOT_UNKNOWN_HANDSHAKE_STR 26
55 #define NEW_SESSION_STR 27
56 #define BAD_NEW_SSL_STR 28
57 #define GOT_PACKET_STR 29
58 #define NO_DATA_STR 30
59
60 #define BAD_SESSION_STR 31
61 #define GOT_OLD_CLIENT_HELLO_STR 32
62 #define OLD_CLIENT_INPUT_STR 33
63 #define OLD_CLIENT_OK_STR 34
64 #define BAD_OLD_CLIENT_STR 35
65 #define BAD_RECORD_HDR_STR 36
66 #define RECORD_INPUT_STR 37
67 #define GOT_HANDSHAKE_STR 38
68 #define BAD_HANDSHAKE_STR 39
69 #define GOT_CHANGE_CIPHER_STR 40
70
71 #define GOT_APP_DATA_STR 41
72 #define BAD_APP_DATA_STR 42
73 #define GOT_ALERT_STR 43
74 #define ANOTHER_MSG_STR 44
75 #define REMOVE_SESSION_STR 45
76 #define KEY_FILE_STR 46
77 #define BAD_IPVER_STR 47
78 #define BAD_PROTO_STR 48
79 #define PACKET_HDR_SHORT_STR 49
80 #define GOT_UNKNOWN_RECORD_STR 50
81
82 #define BAD_TRACE_FILE_STR 51
83 #define FATAL_ERROR_STR 52
84 #define PARTIAL_INPUT_STR 53
85 #define BUFFER_ERROR_STR 54
86 #define PARTIAL_ADD_STR 55
87 #define DUPLICATE_STR 56
88 #define OUT_OF_ORDER_STR 57
89 #define OVERLAP_DUPLICATE_STR 58
90 #define OVERLAP_REASSEMBLY_BEGIN_STR 59
91 #define OVERLAP_REASSEMBLY_END_STR 60
92
93 #define MISSED_CLIENT_HELLO_STR 61
94 #define GOT_HELLO_REQUEST_STR 62
95 #define GOT_SESSION_TICKET_STR 63
96 #define BAD_INPUT_STR 64
97 #define BAD_DECRYPT_TYPE 65
98 #define BAD_FINISHED_MSG 66
99 #define BAD_COMPRESSION_STR 67
100 #define BAD_DERIVE_STR 68
101 #define ACK_MISSED_STR 69
102 #define BAD_DECRYPT 70
103
104 #define DECRYPT_KEYS_NOT_SETUP 71
105 #define CLIENT_HELLO_LATE_KEY_STR 72
106 #define GOT_CERT_STATUS_STR 73
107 #define RSA_KEY_MISSING_STR 74
108 #define NO_SECURE_RENEGOTIATION 75
109 #define BAD_SESSION_STATS 76
110 #define REASSEMBLY_MAX_STR 77
111 #define DROPPING_LOST_FRAG_STR 78
112 #define DROPPING_PARTIAL_RECORD 79
113 #define CLEAR_ACK_FAULT 80
114
115 #define BAD_DECRYPT_SIZE 81
116 #define EXTENDED_MASTER_HASH_STR 82
117 #define SPLIT_HANDSHAKE_MSG_STR 83
118 #define ECC_DECODE_STR 84
119 #define ECC_PUB_DECODE_STR 85
120 #define WATCH_CB_MISSING_STR 86
121 #define WATCH_HASH_STR 87
122 #define WATCH_FAIL_STR 88
123 #define BAD_CERT_MSG_STR 89
124 #define STORE_DATA_CB_MISSING_STR 90
125
126 #define NO_DATA_DEST_STR 91
127 #define STORE_DATA_FAIL_STR 92
128 #define CHAIN_INPUT_STR 93
129 #define GOT_ENC_EXT_STR 94
130 #define GOT_HELLO_RETRY_REQ_STR 95
131 #define SNIFFER_KEY_SETUP_STR 96
132 /* !!!! also add to msgTable in sniffer.c and .rc file !!!! */
133
134
135 #endif /* wolfSSL_SNIFFER_ERROR_H */
136

NetBurner, Inc.
1372 File Documentation

22.301 test.h
1 /* test.h */
2
3 #ifndef wolfSSL_TEST_H
4 #define wolfSSL_TEST_H
5
6 #ifdef FUSION_RTOS
7 #include <fclstdio.h>
8 #include <fclstdlib.h>
9 #else
10 #include <stdio.h>
11 #include <stdlib.h>
12 #endif
13 #include <assert.h>
14 #include <ctype.h>
15 #ifdef HAVE_ERRNO_H
16 #include <errno.h>
17 #endif
18 #include <wolfssl/wolfcrypt/types.h>
19 #include <wolfssl/error-ssl.h>
20 #include <wolfssl/wolfcrypt/random.h>
21 #include <wolfssl/wolfcrypt/mem_track.h>
22 #include <wolfssl/wolfio.h>
23 #include <wolfssl/wolfcrypt/asn.h>
24
25 #ifdef ATOMIC_USER
26 #include <wolfssl/wolfcrypt/aes.h>
27 #include <wolfssl/wolfcrypt/arc4.h>
28 #include <wolfssl/wolfcrypt/hmac.h>
29 #endif
30 #ifdef HAVE_PK_CALLBACKS
31 #ifndef NO_RSA
32 #include <wolfssl/wolfcrypt/rsa.h>
33 #endif
34 #ifdef HAVE_ECC
35 #include <wolfssl/wolfcrypt/ecc.h>
36 #endif /* HAVE_ECC */
37 #ifndef NO_DH
38 #include <wolfssl/wolfcrypt/dh.h>
39 #endif /* !NO_DH */
40 #ifdef HAVE_ED25519
41 #include <wolfssl/wolfcrypt/ed25519.h>
42 #endif /* HAVE_ED25519 */
43 #ifdef HAVE_CURVE25519
44 #include <wolfssl/wolfcrypt/curve25519.h>
45 #endif /* HAVE_ECC */
46 #ifdef HAVE_ED448
47 #include <wolfssl/wolfcrypt/ed448.h>
48 #endif /* HAVE_ED448 */
49 #ifdef HAVE_CURVE448
50 #include <wolfssl/wolfcrypt/curve448.h>
51 #endif /* HAVE_ECC */
52 #endif /*HAVE_PK_CALLBACKS */
53
54 #ifdef USE_WINDOWS_API
55 #include <winsock2.h>
56 #include <process.h>
57 #ifdef TEST_IPV6 /* don’t require newer SDK for IPV4 */
58 #include <ws2tcpip.h>
59 #include <wspiapi.h>
60 #endif
61 #define SOCKET_T SOCKET
62 #define SNPRINTF _snprintf
63 #define XSLEEP_MS(t) Sleep(t)
64 #elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)
65 #include <string.h>
66 #include "rl_net.h"
67 #define SOCKET_T int
68 typedef int socklen_t ;
69 #define inet_addr wolfSSL_inet_addr
70 static unsigned long wolfSSL_inet_addr(const char *cp)
71 {
72 unsigned int a[4] ; unsigned long ret ;
73 sscanf(cp, "%u.%u.%u.%u", &a[0], &a[1], &a[2], &a[3]) ;
74 ret = ((a[3]«24) + (a[2]«16) + (a[1]«8) + a[0]) ;
75 return(ret) ;
76 }
77 #if defined(HAVE_KEIL_RTX)
78 #define XSLEEP_MS(t) os_dly_wait(t)
79 #elif defined(WOLFSSL_CMSIS_RTOS) || defined(WOLFSSL_CMSIS_RTOSv2)
80 #define XSLEEP_MS(t) osDelay(t)
81 #endif
82 #elif defined(WOLFSSL_TIRTOS)
83 #include <string.h>
84 #include <netdb.h>
85 #include <sys/types.h>

NetBurner, Inc.
22.301 test.h 1373

86 #include <arpa/inet.h>
87 #include <sys/socket.h>
88 #include <ti/sysbios/knl/Task.h>
89 struct hostent {
90 char *h_name; /* official name of host */
91 char **h_aliases; /* alias list */
92 int h_addrtype; /* host address type */
93 int h_length; /* length of address */
94 char **h_addr_list; /* list of addresses from name server */
95 };
96 #define SOCKET_T int
97 #define XSLEEP_MS(t) Task_sleep(t/1000)
98 #elif defined(WOLFSSL_VXWORKS)
99 #include <hostLib.h>
100 #include <sockLib.h>
101 #include <arpa/inet.h>
102 #include <string.h>
103 #include <selectLib.h>
104 #include <sys/types.h>
105 #include <netinet/in.h>
106 #include <fcntl.h>
107 #ifdef WOLFSSL_VXWORKS_6_x
108 #include <time.h>
109 #else
110 #include <sys/time.h>
111 #endif
112 #include <netdb.h>
113 #include <pthread.h>
114 #define SOCKET_T int
115 #elif defined(WOLFSSL_ZEPHYR)
116 #include <string.h>
117 #include <sys/types.h>
118 #include <net/socket.h>
119 #define SOCKET_T int
120 #define SOL_SOCKET 1
121 #define WOLFSSL_USE_GETADDRINFO
122
123 static unsigned long inet_addr(const char *cp)
124 {
125 unsigned int a[4]; unsigned long ret;
126 int i, j;
127 for (i=0, j=0; i<4; i++) {
128 a[i] = 0;
129 while (cp[j] != ’.’ && cp[j] != ’\0’) {
130 a[i] *= 10;
131 a[i] += cp[j] - ’0’;
132 j++;
133 }
134 }
135 ret = ((a[3]«24) + (a[2]«16) + (a[1]«8) + a[0]) ;
136 return(ret) ;
137 }
138 #elif defined(NETOS)
139 #include <string.h>
140 #include <sys/types.h>
141 struct hostent {
142 char* h_name; /* official name of host */
143 char** h_aliases; /* alias list */
144 int h_addrtype; /* host address type */
145 int h_length; /* length of address */
146 char** h_addr_list; /* list of addresses from the name server */
147 };
148 #else
149 #include <string.h>
150 #include <sys/types.h>
151 #ifndef WOLFSSL_LEANPSK
152 #include <unistd.h>
153 #include <netdb.h>
154 #include <netinet/in.h>
155 #include <netinet/tcp.h>
156 #include <arpa/inet.h>
157 #include <sys/ioctl.h>
158 #include <sys/time.h>
159 #include <sys/socket.h>
160 #include <pthread.h>
161 #include <fcntl.h>
162 #ifdef TEST_IPV6
163 #include <netdb.h>
164 #endif
165 #endif
166 #ifdef FREESCALE_MQX
167 typedef int socklen_t ;
168 #endif
169 #define SOCKET_T int
170 #ifndef SO_NOSIGPIPE
171 #include <signal.h> /* ignore SIGPIPE */
172 #endif

NetBurner, Inc.
1374 File Documentation

173 #define SNPRINTF snprintf


174
175 #define XSELECT_WAIT(x,y) do { \
176 struct timeval tv = {((x) + ((y) / 1000000)),((y) % 1000000)}; \
177 if ((select(0, NULL, NULL, NULL, &tv) < 0) && (errno != EINTR)) \
178 err_sys("select for XSELECT_WAIT failed."); \
179 } while (0)
180 #define XSLEEP_US(u) XSELECT_WAIT(0,u)
181 #define XSLEEP_MS(m) XSELECT_WAIT(0,(m)*1000)
182 #endif /* USE_WINDOWS_API */
183
184 #ifndef XSLEEP_MS
185 #define XSLEEP_MS(t) sleep(t/1000)
186 #endif
187
188 #ifdef WOLFSSL_ASYNC_CRYPT
189 #include <wolfssl/wolfcrypt/async.h>
190 #endif
191 #ifdef HAVE_CAVIUM
192 #include <wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h>
193 #endif
194 #ifdef _MSC_VER
195 /* disable conversion warning */
196 /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */
197 #pragma warning(disable:4244 4996)
198 #endif
199
200 #ifndef WOLFSSL_CIPHER_LIST_MAX_SIZE
201 #define WOLFSSL_CIPHER_LIST_MAX_SIZE 4096
202 #endif
203 /* Buffer for benchmark tests */
204 #ifndef TEST_BUFFER_SIZE
205 #define TEST_BUFFER_SIZE 16384
206 #endif
207
208 #ifndef WOLFSSL_HAVE_MIN
209 #define WOLFSSL_HAVE_MIN
210 static WC_INLINE word32 min(word32 a, word32 b)
211 {
212 return a > b ? b : a;
213 }
214 #endif /* WOLFSSL_HAVE_MIN */
215
216 /* Socket Handling */
217 #ifndef WOLFSSL_SOCKET_INVALID
218 #ifdef USE_WINDOWS_API
219 #define WOLFSSL_SOCKET_INVALID ((SOCKET_T)INVALID_SOCKET)
220 #elif defined(WOLFSSL_TIRTOS)
221 #define WOLFSSL_SOCKET_INVALID ((SOCKET_T)-1)
222 #else
223 #define WOLFSSL_SOCKET_INVALID (SOCKET_T)(0)
224 #endif
225 #endif /* WOLFSSL_SOCKET_INVALID */
226
227 #ifndef WOLFSSL_SOCKET_IS_INVALID
228 #if defined(USE_WINDOWS_API) || defined(WOLFSSL_TIRTOS)
229 #define WOLFSSL_SOCKET_IS_INVALID(s) ((SOCKET_T)(s) == WOLFSSL_SOCKET_INVALID)
230 #else
231 #define WOLFSSL_SOCKET_IS_INVALID(s) ((SOCKET_T)(s) < WOLFSSL_SOCKET_INVALID)
232 #endif
233 #endif /* WOLFSSL_SOCKET_IS_INVALID */
234
235 #if defined(__MACH__) || defined(USE_WINDOWS_API)
236 #ifndef _SOCKLEN_T
237 typedef int socklen_t;
238 #endif
239 #endif
240
241
242 /* HPUX doesn’t use socklent_t for third parameter to accept, unless
243 _XOPEN_SOURCE_EXTENDED is defined */
244 #if !defined(__hpux__) && !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM)\
245 && !defined(WOLFSSL_ROWLEY_ARM) && !defined(WOLFSSL_KEIL_TCP_NET)
246 typedef socklen_t* ACCEPT_THIRD_T;
247 #else
248 #if defined _XOPEN_SOURCE_EXTENDED
249 typedef socklen_t* ACCEPT_THIRD_T;
250 #else
251 typedef int* ACCEPT_THIRD_T;
252 #endif
253 #endif
254
255
256
257 #ifdef SINGLE_THREADED
258 #if defined(WC_32BIT_CPU)
259 typedef void* THREAD_RETURN;

NetBurner, Inc.
22.301 test.h 1375

260 #else
261 typedef unsigned int THREAD_RETURN;
262 #endif
263 typedef void* THREAD_TYPE;
264 #define WOLFSSL_THREAD
265 #else
266 #if defined(_POSIX_THREADS) && !defined(__MINGW32__)
267 typedef void* THREAD_RETURN;
268 typedef pthread_t THREAD_TYPE;
269 #define WOLFSSL_THREAD
270 #define INFINITE (-1)
271 #define WAIT_OBJECT_0 0L
272 #elif defined(WOLFSSL_MDK_ARM)|| defined(WOLFSSL_KEIL_TCP_NET) || defined(FREESCALE_MQX)
273 typedef unsigned int THREAD_RETURN;
274 typedef int THREAD_TYPE;
275 #define WOLFSSL_THREAD
276 #elif defined(WOLFSSL_TIRTOS)
277 typedef void THREAD_RETURN;
278 typedef Task_Handle THREAD_TYPE;
279 #ifdef HAVE_STACK_SIZE
280 #undef EXIT_TEST
281 #define EXIT_TEST(ret)
282 #endif
283 #define WOLFSSL_THREAD
284 #elif defined(WOLFSSL_ZEPHYR)
285 typedef void THREAD_RETURN;
286 typedef struct k_thread THREAD_TYPE;
287 #ifdef HAVE_STACK_SIZE
288 #undef EXIT_TEST
289 #define EXIT_TEST(ret)
290 #endif
291 #define WOLFSSL_THREAD
292 #elif defined(NETOS)
293 typedef UINT THREAD_RETURN;
294 typedef TX_THREAD THREAD_TYPE;
295 #define WOLFSSL_THREAD
296 #define INFINITE TX_WAIT_FOREVER
297 #define WAIT_OBJECT_0 TX_NO_WAIT
298 #else
299 typedef unsigned int THREAD_RETURN;
300 typedef intptr_t THREAD_TYPE;
301 #define WOLFSSL_THREAD __stdcall
302 #endif
303 #endif
304
305
306 #ifndef MY_EX_USAGE
307 #define MY_EX_USAGE 2
308 #endif
309
310 #ifndef EXIT_FAILURE
311 #define EXIT_FAILURE 1
312 #endif
313
314 #if defined(WOLFSSL_FORCE_MALLOC_FAIL_TEST) || defined(WOLFSSL_ZEPHYR)
315 #ifndef EXIT_SUCCESS
316 #define EXIT_SUCCESS 0
317 #endif
318 #define XEXIT(rc) return rc
319 #define XEXIT_T(rc) return (THREAD_RETURN)rc
320 #else
321 #define XEXIT(rc) exit((int)(rc))
322 #define XEXIT_T(rc) exit((int)(rc))
323 #endif
324
325 static WC_INLINE
326 #if defined(WOLFSSL_FORCE_MALLOC_FAIL_TEST) || defined(WOLFSSL_ZEPHYR)
327 THREAD_RETURN
328 #else
329 WC_NORETURN void
330 #endif
331 err_sys(const char* msg)
332 {
333 #if !defined(__GNUC__)
334 /* scan-build (which pretends to be gnuc) can get confused and think the
335 * msg pointer can be null even when hardcoded and then it won’t exit,
336 * making null pointer checks above the err_sys() call useless.
337 * We could just always exit() but some compilers will complain about no
338 * possible return, with gcc we know the attribute to handle that with
339 * WC_NORETURN. */
340 if (msg)
341 #endif
342 {
343 fprintf(stderr, "wolfSSL error: %s\n", msg);
344 }
345 XEXIT_T(EXIT_FAILURE);
346 }

NetBurner, Inc.
1376 File Documentation

347
348 static WC_INLINE
349 #if defined(WOLFSSL_FORCE_MALLOC_FAIL_TEST) || defined(WOLFSSL_ZEPHYR)
350 THREAD_RETURN
351 #else
352 WC_NORETURN void
353 #endif
354 err_sys_with_errno(const char* msg)
355 {
356 #if !defined(__GNUC__)
357 /* scan-build (which pretends to be gnuc) can get confused and think the
358 * msg pointer can be null even when hardcoded and then it won’t exit,
359 * making null pointer checks above the err_sys() call useless.
360 * We could just always exit() but some compilers will complain about no
361 * possible return, with gcc we know the attribute to handle that with
362 * WC_NORETURN. */
363 if (msg)
364 #endif
365 {
366 #if defined(HAVE_STRING_H) && defined(HAVE_ERRNO_H)
367 fprintf(stderr, "wolfSSL error: %s: %s\n", msg, strerror(errno));
368 #else
369 fprintf(stderr, "wolfSSL error: %s\n", msg);
370 #endif
371 }
372 XEXIT_T(EXIT_FAILURE);
373 }
374
375 #define LIBCALL_CHECK_RET(...) do { \
376 int _libcall_ret = (__VA_ARGS__); \
377 if (_libcall_ret < 0) { \
378 fprintf(stderr, "%s L%d error %d for \"%s\"\n", \
379 __FILE__, __LINE__, errno, #__VA_ARGS__); \
380 err_sys("library/system call failed"); \
381 } \
382 } while(0)
383
384 #define PTHREAD_CHECK_RET(...) do { \
385 int _pthread_ret = (__VA_ARGS__); \
386 if (_pthread_ret != 0) { \
387 errno = _pthread_ret; \
388 fprintf(stderr, "%s L%d error %d for \"%s\"\n", \
389 __FILE__, __LINE__, _pthread_ret, #__VA_ARGS__); \
390 err_sys("pthread call failed"); \
391 } \
392 } while(0)
393
394
395 #ifndef WOLFSSL_NO_TLS12
396 #define SERVER_DEFAULT_VERSION 3
397 #else
398 #define SERVER_DEFAULT_VERSION 4
399 #endif
400 #define SERVER_DTLS_DEFAULT_VERSION (-2)
401 #define SERVER_INVALID_VERSION (-99)
402 #define SERVER_DOWNGRADE_VERSION (-98)
403 #ifndef WOLFSSL_NO_TLS12
404 #define CLIENT_DEFAULT_VERSION 3
405 #else
406 #define CLIENT_DEFAULT_VERSION 4
407 #endif
408 #define CLIENT_DTLS_DEFAULT_VERSION (-2)
409 #define CLIENT_INVALID_VERSION (-99)
410 #define CLIENT_DOWNGRADE_VERSION (-98)
411 #define EITHER_DOWNGRADE_VERSION (-97)
412 #if !defined(NO_FILESYSTEM) && defined(WOLFSSL_MAX_STRENGTH)
413 #define DEFAULT_MIN_DHKEY_BITS 2048
414 #define DEFAULT_MAX_DHKEY_BITS 3072
415 #else
416 #define DEFAULT_MIN_DHKEY_BITS 1024
417 #define DEFAULT_MAX_DHKEY_BITS 2048
418 #endif
419 #if !defined(NO_FILESYSTEM) && defined(WOLFSSL_MAX_STRENGTH)
420 #define DEFAULT_MIN_RSAKEY_BITS 2048
421 #else
422 #ifndef DEFAULT_MIN_RSAKEY_BITS
423 #define DEFAULT_MIN_RSAKEY_BITS 1024
424 #endif
425 #endif
426 #if !defined(NO_FILESYSTEM) && defined(WOLFSSL_MAX_STRENGTH)
427 #define DEFAULT_MIN_ECCKEY_BITS 256
428 #else
429 #ifndef DEFAULT_MIN_ECCKEY_BITS
430 #define DEFAULT_MIN_ECCKEY_BITS 224
431 #endif
432 #endif
433

NetBurner, Inc.
22.301 test.h 1377

434 #ifndef DEFAULT_TIMEOUT_SEC


435 #define DEFAULT_TIMEOUT_SEC 2
436 #endif
437
438 /* all certs relative to wolfSSL home directory now */
439 #if defined(WOLFSSL_NO_CURRDIR) || defined(WOLFSSL_MDK_SHELL)
440 #define caCertFile "certs/ca-cert.pem"
441 #define eccCertFile "certs/server-ecc.pem"
442 #define eccKeyFile "certs/ecc-key.pem"
443 #define eccKeyPubFile "certs/ecc-keyPub.pem"
444 #define eccRsaCertFile "certs/server-ecc-rsa.pem"
445 #define svrCertFile "certs/server-cert.pem"
446 #define svrKeyFile "certs/server-key.pem"
447 #define svrKeyPubFile "certs/server-keyPub.pem"
448 #define cliCertFile "certs/client-cert.pem"
449 #define cliCertDerFile "certs/client-cert.der"
450 #define cliCertFileExt "certs/client-cert-ext.pem"
451 #define cliCertDerFileExt "certs/client-cert-ext.der"
452 #define cliKeyFile "certs/client-key.pem"
453 #define cliKeyPubFile "certs/client-keyPub.pem"
454 #define dhParamFile "certs/dh2048.pem"
455 #define cliEccKeyFile "certs/ecc-client-key.pem"
456 #define cliEccKeyPubFile "certs/ecc-client-keyPub.pem"
457 #define cliEccCertFile "certs/client-ecc-cert.pem"
458 #define caEccCertFile "certs/ca-ecc-cert.pem"
459 #define crlPemDir "certs/crl"
460 #define edCertFile "certs/ed25519/server-ed25519-cert.pem"
461 #define edKeyFile "certs/ed25519/server-ed25519-priv.pem"
462 #define edKeyPubFile "certs/ed25519/server-ed25519-key.pem"
463 #define cliEdCertFile "certs/ed25519/client-ed25519.pem"
464 #define cliEdKeyFile "certs/ed25519/client-ed25519-priv.pem"
465 #define cliEdKeyPubFile "certs/ed25519/client-ed25519-key.pem"
466 #define caEdCertFile "certs/ed25519/ca-ed25519.pem"
467 #define ed448CertFile "certs/ed448/server-ed448-cert.pem"
468 #define ed448KeyFile "certs/ed448/server-ed448-priv.pem"
469 #define cliEd448CertFile "certs/ed448/client-ed448.pem"
470 #define cliEd448KeyFile "certs/ed448/client-ed448-priv.pem"
471 #define caEd448CertFile "certs/ed448/ca-ed448.pem"
472 #define caCertFolder "certs/"
473 #ifdef HAVE_WNR
474 /* Whitewood netRandom default config file */
475 #define wnrConfig "wnr-example.conf"
476 #endif
477 #elif defined(NETOS) && defined(HAVE_FIPS)
478 /* These defines specify the file system volume and root directory used by
479 * the FTP server used in the only supported NETOS FIPS solution (at this
480 * time), these can be tailored in the event a future FIPS solution is added
481 * for an alternate NETOS use-case */
482 #define FS_VOLUME1 "FLASH0"
483 #define FS_VOLUME1_DIR FS_VOLUME1 "/"
484 #define caCertFile FS_VOLUME1_DIR "certs/ca-cert.pem"
485 #define eccCertFile FS_VOLUME1_DIR "certs/server-ecc.pem"
486 #define eccKeyFile FS_VOLUME1_DIR "certs/ecc-key.pem"
487 #define svrCertFile FS_VOLUME1_DIR "certs/server-cert.pem"
488 #define svrKeyFile FS_VOLUME1_DIR "certs/server-key.pem"
489 #define cliCertFile FS_VOLUME1_DIR "certs/client-cert.pem"
490 #define cliKeyFile FS_VOLUME1_DIR "certs/client-key.pem"
491 #define ntruCertFile FS_VOLUME1_DIR "certs/ntru-cert.pem"
492 #define ntruKeyFile FS_VOLUME1_DIR "certs/ntru-key.raw"
493 #define dhParamFile FS_VOLUME1_DIR "certs/dh2048.pem"
494 #define cliEccKeyFile FS_VOLUME1_DIR "certs/ecc-client-key.pem"
495 #define cliEccCertFile FS_VOLUME1_DIR "certs/client-ecc-cert.pem"
496 #define caEccCertFile FS_VOLUME1_DIR "certs/ca-ecc-cert/pem"
497 #define crlPemDir FS_VOLUME1_DIR "certs/crl"
498 #ifdef HAVE_WNR
499 /* Whitewood netRandom default config file */
500 #define wnrConfig "wnr-example.conf"
501 #endif
502 #else
503 #define caCertFile "./certs/ca-cert.pem"
504 #define eccCertFile "./certs/server-ecc.pem"
505 #define eccKeyFile "./certs/ecc-key.pem"
506 #define eccKeyPubFile "./certs/ecc-keyPub.pem"
507 #define eccRsaCertFile "./certs/server-ecc-rsa.pem"
508 #define svrCertFile "./certs/server-cert.pem"
509 #define svrKeyFile "./certs/server-key.pem"
510 #define svrKeyPubFile "./certs/server-keyPub.pem"
511 #define cliCertFile "./certs/client-cert.pem"
512 #define cliCertDerFile "./certs/client-cert.der"
513 #define cliCertFileExt "./certs/client-cert-ext.pem"
514 #define cliCertDerFileExt "./certs/client-cert-ext.der"
515 #define cliKeyFile "./certs/client-key.pem"
516 #define cliKeyPubFile "./certs/client-keyPub.pem"
517 #define dhParamFile "./certs/dh2048.pem"
518 #define cliEccKeyFile "./certs/ecc-client-key.pem"
519 #define cliEccKeyPubFile "./certs/ecc-client-keyPub.pem"
520 #define cliEccCertFile "./certs/client-ecc-cert.pem"

NetBurner, Inc.
1378 File Documentation

521 #define caEccCertFile "./certs/ca-ecc-cert.pem"


522 #define crlPemDir "./certs/crl"
523 #define edCertFile "./certs/ed25519/server-ed25519-cert.pem"
524 #define edKeyFile "./certs/ed25519/server-ed25519-priv.pem"
525 #define edKeyPubFile "./certs/ed25519/server-ed25519-key.pem"
526 #define cliEdCertFile "./certs/ed25519/client-ed25519.pem"
527 #define cliEdKeyFile "./certs/ed25519/client-ed25519-priv.pem"
528 #define cliEdKeyPubFile "./certs/ed25519/client-ed25519-key.pem"
529 #define caEdCertFile "./certs/ed25519/ca-ed25519.pem"
530 #define ed448CertFile "./certs/ed448/server-ed448-cert.pem"
531 #define ed448KeyFile "./certs/ed448/server-ed448-priv.pem"
532 #define cliEd448CertFile "./certs/ed448/client-ed448.pem"
533 #define cliEd448KeyFile "./certs/ed448/client-ed448-priv.pem"
534 #define caEd448CertFile "./certs/ed448/ca-ed448.pem"
535 #define caCertFolder "./certs/"
536 #ifdef HAVE_WNR
537 /* Whitewood netRandom default config file */
538 #define wnrConfig "./wnr-example.conf"
539 #endif
540 #endif
541
542
543 #ifdef TEST_IPV6
544 typedef struct sockaddr_in6 SOCKADDR_IN_T;
545 #define AF_INET_V AF_INET6
546 #else
547 typedef struct sockaddr_in SOCKADDR_IN_T;
548 #define AF_INET_V AF_INET
549 #endif
550
551 typedef struct tcp_ready {
552 word16 ready; /* predicate */
553 word16 port;
554 char* srfName; /* server ready file name */
555 #if defined(_POSIX_THREADS) && !defined(__MINGW32__)
556 pthread_mutex_t mutex;
557 pthread_cond_t cond;
558 #endif
559 #ifdef NETOS
560 TX_MUTEX mutex;
561 #endif
562 } tcp_ready;
563
564 static WC_INLINE void InitTcpReady(tcp_ready* ready)
565 {
566 ready->ready = 0;
567 ready->port = 0;
568 ready->srfName = NULL;
569 #ifdef SINGLE_THREADED
570 #elif defined(_POSIX_THREADS) && !defined(__MINGW32__)
571 PTHREAD_CHECK_RET(pthread_mutex_init(&ready->mutex, 0));
572 PTHREAD_CHECK_RET(pthread_cond_init(&ready->cond, 0));
573 #elif defined(NETOS)
574 tx_mutex_create(&ready->mutex, "wolfSSL Lock", TX_INHERIT);
575 #endif
576 }
577
578 #ifdef NETOS
579 struct hostent* gethostbyname(const char* name);
580 #endif
581
582 static WC_INLINE void FreeTcpReady(tcp_ready* ready)
583 {
584 #ifdef SINGLE_THREADED
585 (void)ready;
586 #elif defined(_POSIX_THREADS) && !defined(__MINGW32__)
587 PTHREAD_CHECK_RET(pthread_mutex_destroy(&ready->mutex));
588 PTHREAD_CHECK_RET(pthread_cond_destroy(&ready->cond));
589 #elif defined(NETOS)
590 tx_mutex_delete(&ready->mutex);
591 #else
592 (void)ready;
593 #endif
594 }
595
596 typedef WOLFSSL_METHOD* (*method_provider)(void);
597 typedef void (*ctx_callback)(WOLFSSL_CTX* ctx);
598 typedef void (*ssl_callback)(WOLFSSL* ssl);
599
600 typedef struct callback_functions {
601 method_provider method;
602 ctx_callback ctx_ready;
603 ssl_callback ssl_ready;
604 ssl_callback on_result;
605 WOLFSSL_CTX* ctx;
606 const char* caPemFile;
607 const char* certPemFile;

NetBurner, Inc.
22.301 test.h 1379

608 const char* keyPemFile;


609 #ifdef WOLFSSL_STATIC_MEMORY
610 byte* mem;
611 word32 memSz;
612 wolfSSL_method_func method_ex;
613 #endif
614 int devId;
615 int return_code;
616 unsigned char isSharedCtx:1;
617 unsigned char loadToSSL:1;
618 unsigned char ticNoInit:1;
619 unsigned char doUdp:1;
620 } callback_functions;
621
622 #if defined(WOLFSSL_SRTP) && !defined(SINGLE_THREADED) && defined(_POSIX_THREADS)
623 typedef struct srtp_test_helper {
624 pthread_mutex_t mutex;
625 pthread_cond_t cond;
626 uint8_t* server_srtp_ekm;
627 size_t server_srtp_ekm_size;
628 } srtp_test_helper;
629 #endif
630
631 typedef struct func_args {
632 int argc;
633 char** argv;
634 int return_code;
635 tcp_ready* signal;
636 callback_functions *callbacks;
637 #if defined(WOLFSSL_SRTP) && !defined(SINGLE_THREADED) && defined(_POSIX_THREADS)
638 srtp_test_helper* srtp_helper;
639 #endif
640 } func_args;
641
642 #ifdef NETOS
643 int dc_log_printf(char* format, ...);
644 #undef printf
645 #define printf dc_log_printf
646 #endif
647
648 void wait_tcp_ready(func_args* args);
649
650 #ifdef WOLFSSL_ZEPHYR
651 typedef void THREAD_FUNC(void*, void*, void*);
652 #else
653 typedef THREAD_RETURN WOLFSSL_THREAD THREAD_FUNC(void*);
654 #endif
655
656 void start_thread(THREAD_FUNC fun, func_args* args, THREAD_TYPE* thread);
657 void join_thread(THREAD_TYPE thread);
658
659 /* wolfSSL */
660 #ifndef TEST_IPV6
661 static const char* const wolfSSLIP = "127.0.0.1";
662 #else
663 static const char* const wolfSSLIP = "::1";
664 #endif
665 static const word16 wolfSSLPort = 11111;
666
667
668 extern int myoptind;
669 extern char* myoptarg;
670
671 #if defined(WOLFSSL_SRTP) && !defined(SINGLE_THREADED) && defined(_POSIX_THREADS)
672
673 static WC_INLINE void srtp_helper_init(srtp_test_helper *srtp)
674 {
675 srtp->server_srtp_ekm_size = 0;
676 srtp->server_srtp_ekm = NULL;
677
678 PTHREAD_CHECK_RET(pthread_mutex_init(&srtp->mutex, 0));
679 PTHREAD_CHECK_RET(pthread_cond_init(&srtp->cond, 0));
680 }
681
691 static WC_INLINE void srtp_helper_get_ekm(srtp_test_helper *srtp,
692 uint8_t **ekm, size_t *size)
693 {
694 PTHREAD_CHECK_RET(pthread_mutex_lock(&srtp->mutex));
695
696 if (srtp->server_srtp_ekm == NULL)
697 PTHREAD_CHECK_RET(pthread_cond_wait(&srtp->cond, &srtp->mutex));
698
699 *ekm = srtp->server_srtp_ekm;
700 *size = srtp->server_srtp_ekm_size;
701
702 /* reset */
703 srtp->server_srtp_ekm = NULL;

NetBurner, Inc.
1380 File Documentation

704 srtp->server_srtp_ekm_size = 0;
705
706 PTHREAD_CHECK_RET(pthread_mutex_unlock(&srtp->mutex));
707 }
708
720 static WC_INLINE void srtp_helper_set_ekm(srtp_test_helper *srtp,
721 uint8_t *ekm, size_t size)
722 {
723 PTHREAD_CHECK_RET(pthread_mutex_lock(&srtp->mutex));
724
725 srtp->server_srtp_ekm_size = size;
726 srtp->server_srtp_ekm = ekm;
727 PTHREAD_CHECK_RET(pthread_cond_signal(&srtp->cond));
728
729 PTHREAD_CHECK_RET(pthread_mutex_unlock(&srtp->mutex));
730 }
731
732 static WC_INLINE void srtp_helper_free(srtp_test_helper *srtp)
733 {
734 PTHREAD_CHECK_RET(pthread_mutex_destroy(&srtp->mutex));
735 PTHREAD_CHECK_RET(pthread_cond_destroy(&srtp->cond));
736 }
737
738 #endif /* WOLFSSL_SRTP && !SINGLE_THREADED && POSIX_THREADS */
739
751 static WC_INLINE int mygetopt(int argc, char** argv, const char* optstring)
752 {
753 static char* next = NULL;
754
755 char c;
756 char* cp;
757
758 /* Added sanity check because scan-build complains argv[myoptind] access
759 * results in a null pointer dereference. */
760 if (argv == NULL) {
761 myoptarg = NULL;
762 return -1;
763 }
764
765 if (myoptind == 0)
766 next = NULL; /* we’re starting new/over */
767
768 if (next == NULL || *next == ’\0’) {
769 if (myoptind == 0)
770 myoptind++;
771
772 if (myoptind >= argc || argv[myoptind] == NULL ||
773 argv[myoptind][0] != ’-’ || argv[myoptind][1] == ’\0’) {
774 myoptarg = NULL;
775 if (myoptind < argc)
776 myoptarg = argv[myoptind];
777
778 return -1;
779 }
780
781 if (strcmp(argv[myoptind], "--") == 0) {
782 myoptind++;
783 myoptarg = NULL;
784
785 if (myoptind < argc)
786 myoptarg = argv[myoptind];
787
788 return -1;
789 }
790
791 next = argv[myoptind];
792 next++; /* skip - */
793 myoptind++;
794 }
795
796 c = *next++;
797 /* The C++ strchr can return a different value */
798 cp = (char*)strchr(optstring, c);
799
800 if (cp == NULL || c == ’:’ || c == ’;’)
801 return ’?’;
802
803 cp++;
804
805 if (*cp == ’:’) {
806 if (*next != ’\0’) {
807 myoptarg = next;
808 next = NULL;
809 }
810 else if (myoptind < argc) {
811 myoptarg = argv[myoptind];
812 myoptind++;

NetBurner, Inc.
22.301 test.h 1381

813 }
814 else
815 return ’?’;
816 }
817 else if (*cp == ’;’) {
818 myoptarg = (char*)"";
819 if (*next != ’\0’) {
820 myoptarg = next;
821 next = NULL;
822 }
823 else if (myoptind < argc) {
824 /* Check if next argument is not a parameter argument */
825 if (argv[myoptind] && argv[myoptind][0] != ’-’) {
826 myoptarg = argv[myoptind];
827 myoptind++;
828 }
829 }
830 }
831
832 return c;
833 }
834
835 struct mygetopt_long_config {
836 const char *name;
837 int takes_arg; /* 0=no arg, 1=required arg, 2=optional arg */
838 int value;
839 };
840
852 static WC_INLINE int mygetopt_long(int argc, char** argv, const char* optstring,
853 const struct mygetopt_long_config *longopts, int *longindex)
854 {
855 static char* next = NULL;
856
857 int c;
858 char* cp;
859
860 /* Added sanity check because scan-build complains argv[myoptind] access
861 * results in a null pointer dereference. */
862 if (argv == NULL) {
863 myoptarg = NULL;
864 return -1;
865 }
866
867 if (myoptind == 0)
868 next = NULL; /* we’re starting new/over */
869
870 if (next == NULL || *next == ’\0’) {
871 if (myoptind == 0)
872 myoptind++;
873
874 if (myoptind >= argc || argv[myoptind] == NULL ||
875 argv[myoptind][0] != ’-’ || argv[myoptind][1] == ’\0’) {
876 myoptarg = NULL;
877 if (myoptind < argc)
878 myoptarg = argv[myoptind];
879
880 return -1;
881 }
882
883 if (strcmp(argv[myoptind], "--") == 0) {
884 myoptind++;
885 myoptarg = NULL;
886
887 if (myoptind < argc)
888 myoptarg = argv[myoptind];
889
890 return -1;
891 }
892
893 if (strncmp(argv[myoptind], "--", 2) == 0) {
894 const struct mygetopt_long_config *i;
895 c = -1;
896 myoptarg = NULL;
897 for (i = longopts; i->name; ++i) {
898 if (! strcmp(argv[myoptind] + 2, i->name)) {
899 c = i->value;
900 myoptind++;
901 if (longindex)
902 *longindex = (int)((size_t)(i - longopts) / sizeof i[0]);
903 if (i->takes_arg) {
904 if (myoptind < argc) {
905 if (i->takes_arg == 1 || argv[myoptind][0] != ’-’) {
906 myoptarg = argv[myoptind];
907 myoptind++;
908 }
909 } else if (i->takes_arg != 2) {
910 return -1;

NetBurner, Inc.
1382 File Documentation

911 }
912 }
913 break;
914 }
915 }
916
917 return c;
918 }
919
920 next = argv[myoptind];
921 next++; /* skip - */
922 myoptind++;
923 }
924
925 c = (int)(unsigned char)*next++;
926 /* The C++ strchr can return a different value */
927 cp = (char*)strchr(optstring, c);
928
929 if (cp == NULL || c == ’:’ || c == ’;’)
930 return ’?’;
931
932 cp++;
933
934 if (*cp == ’:’) {
935 if (*next != ’\0’) {
936 myoptarg = next;
937 next = NULL;
938 }
939 else if (myoptind < argc) {
940 myoptarg = argv[myoptind];
941 myoptind++;
942 }
943 else
944 return ’?’;
945 }
946 else if (*cp == ’;’) {
947 myoptarg = (char*)"";
948 if (*next != ’\0’) {
949 myoptarg = next;
950 next = NULL;
951 }
952 else if (myoptind < argc) {
953 /* Check if next argument is not a parameter argument */
954 if (argv[myoptind] && argv[myoptind][0] != ’-’) {
955 myoptarg = argv[myoptind];
956 myoptind++;
957 }
958 }
959 }
960
961 return c;
962 }
963
964
965 #ifdef WOLFSSL_ENCRYPTED_KEYS
966
967 static WC_INLINE int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
968 {
969 (void)rw;
970 (void)userdata;
971 if (userdata != NULL) {
972 strncpy(passwd, (char*)userdata, sz);
973 return (int)XSTRLEN((char*)userdata);
974 }
975 else {
976 strncpy(passwd, "yassl123", sz);
977 return 8;
978 }
979 }
980
981 #endif
982
983 static const char* client_showpeer_msg[][9] = {
984 /* English */
985 {
986 "SSL version is",
987 "SSL cipher suite is",
988 "SSL signature algorithm is",
989 "SSL curve name is",
990 "SSL DH size is",
991 "SSL reused session",
992 "Alternate cert chain used",
993 "peer’s cert info:",
994 NULL
995 },
996 #ifndef NO_MULTIBYTE_PRINT
997 /* Japanese */

NetBurner, Inc.
22.301 test.h 1383

998 {
999 "SSL ",
1000 "SSL ",
1001 "SSL signature algorithm is",
1002 "SSL ",
1003 "SSL DH ",
1004 "SSL ",
1005 "",
1006 "",
1007 NULL
1008 },
1009 #endif
1010 };
1011
1012 #if defined(KEEP_PEER_CERT) || defined(KEEP_OUR_CERT) || defined(SESSION_CERTS)
1013 static const char* client_showx509_msg[][5] = {
1014 /* English */
1015 {
1016 "issuer",
1017 "subject",
1018 "altname",
1019 "serial number",
1020 NULL
1021 },
1022 #ifndef NO_MULTIBYTE_PRINT
1023 /* Japanese */
1024 {
1025 "",
1026 "",
1027 "",
1028 "",
1029 NULL
1030 },
1031 #endif
1032 };
1033
1034 /* lng_index is to specify the language for displaying message. */
1035 /* 0:English, 1:Japanese */
1036 static WC_INLINE void ShowX509Ex(WOLFSSL_X509* x509, const char* hdr,
1037 int lng_index)
1038 {
1039 char* altName;
1040 char* issuer;
1041 char* subject;
1042 byte serial[32];
1043 int ret;
1044 int sz = sizeof(serial);
1045 const char** words = client_showx509_msg[lng_index];
1046
1047 if (x509 == NULL) {
1048 fprintf(stderr, "%s No Cert\n", hdr);
1049 return;
1050 }
1051
1052 issuer = wolfSSL_X509_NAME_oneline(
1053 wolfSSL_X509_get_issuer_name(x509), 0, 0);
1054 subject = wolfSSL_X509_NAME_oneline(
1055 wolfSSL_X509_get_subject_name(x509), 0, 0);
1056
1057 printf("%s\n %s : %s\n %s: %s\n", hdr, words[0], issuer, words[1], subject);
1058
1059 while ( (altName = wolfSSL_X509_get_next_altname(x509)) != NULL)
1060 printf(" %s = %s\n", words[2], altName);
1061
1062 ret = wolfSSL_X509_get_serial_number(x509, serial, &sz);
1063 if (ret == WOLFSSL_SUCCESS) {
1064 int i;
1065 int strLen;
1066 char serialMsg[80];
1067
1068 /* testsuite has multiple threads writing to stdout, get output
1069 message ready to write once */
1070 strLen = sprintf(serialMsg, " %s", words[3]);
1071 for (i = 0; i < sz; i++)
1072 sprintf(serialMsg + strLen + (i*3), ":%02x ", serial[i]);
1073 printf("%s\n", serialMsg);
1074 }
1075
1076 XFREE(subject, 0, DYNAMIC_TYPE_OPENSSL);
1077 XFREE(issuer, 0, DYNAMIC_TYPE_OPENSSL);
1078
1079 #if defined(SHOW_CERTS) && defined(OPENSSL_EXTRA)
1080 {
1081 WOLFSSL_BIO* bio;
1082 char buf[WC_ASN_NAME_MAX];
1083 int textSz;
1084

NetBurner, Inc.
1384 File Documentation

1085 /* print out domain component if certificate has it */


1086 textSz = wolfSSL_X509_NAME_get_text_by_NID(
1087 wolfSSL_X509_get_subject_name(x509), NID_domainComponent,
1088 buf, sizeof(buf));
1089 if (textSz > 0) {
1090 printf("Domain Component = %s\n", buf);
1091 }
1092
1093 bio = wolfSSL_BIO_new(wolfSSL_BIO_s_file());
1094 if (bio != NULL) {
1095 wolfSSL_BIO_set_fp(bio, stdout, BIO_NOCLOSE);
1096 wolfSSL_X509_print(bio, x509);
1097 wolfSSL_BIO_free(bio);
1098 }
1099 }
1100 #endif /* SHOW_CERTS && OPENSSL_EXTRA */
1101 }
1102 /* original ShowX509 to maintain compatibility */
1103 static WC_INLINE void ShowX509(WOLFSSL_X509* x509, const char* hdr)
1104 {
1105 ShowX509Ex(x509, hdr, 0);
1106 }
1107
1108 #endif /* KEEP_PEER_CERT || KEEP_OUR_CERT || SESSION_CERTS */
1109
1110 #if defined(SHOW_CERTS) && defined(SESSION_CERTS) && \
1111 (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
1112 static WC_INLINE void ShowX509Chain(WOLFSSL_X509_CHAIN* chain, int count,
1113 const char* hdr)
1114 {
1115 int i;
1116 int length;
1117 unsigned char buffer[3072];
1118 WOLFSSL_X509* chainX509;
1119
1120 for (i = 0; i < count; i++) {
1121 wolfSSL_get_chain_cert_pem(chain, i, buffer, sizeof(buffer), &length);
1122 buffer[length] = 0;
1123 printf("\n%s: %d has length %d data = \n%s\n", hdr, i, length, buffer);
1124
1125 chainX509 = wolfSSL_get_chain_X509(chain, i);
1126 if (chainX509)
1127 ShowX509(chainX509, hdr);
1128 else
1129 fprintf(stderr, "get_chain_X509 failed\n");
1130 wolfSSL_FreeX509(chainX509);
1131 }
1132 }
1133 #endif /* SHOW_CERTS && SESSION_CERTS */
1134
1135 /* lng_index is to specify the language for displaying message. */
1136 /* 0:English, 1:Japanese */
1137 static WC_INLINE void showPeerEx(WOLFSSL* ssl, int lng_index)
1138 {
1139 WOLFSSL_CIPHER* cipher;
1140 const char** words = client_showpeer_msg[lng_index];
1141
1142 #if defined(HAVE_ECC) || defined(HAVE_CURVE25519) || defined(HAVE_CURVE448) || \
1143 !defined(NO_DH)
1144 const char *name;
1145 #endif
1146 #ifndef NO_DH
1147 int bits;
1148 #endif
1149 #ifdef OPENSSL_EXTRA
1150 int nid;
1151 #endif
1152 #ifdef KEEP_PEER_CERT
1153 WOLFSSL_X509* peer = wolfSSL_get_peer_certificate(ssl);
1154 if (peer)
1155 ShowX509Ex(peer, words[6], lng_index);
1156 else
1157 fprintf(stderr, "peer has no cert!\n");
1158 wolfSSL_FreeX509(peer);
1159 #endif
1160 #if defined(SHOW_CERTS) && defined(KEEP_OUR_CERT) && \
1161 (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
1162 ShowX509(wolfSSL_get_certificate(ssl), "our cert info:");
1163 printf("Peer verify result = %lu\n", wolfSSL_get_verify_result(ssl));
1164 #endif /* SHOW_CERTS && KEEP_OUR_CERT */
1165 printf("%s %s\n", words[0], wolfSSL_get_version(ssl));
1166
1167 cipher = wolfSSL_get_current_cipher(ssl);
1168 printf("%s %s\n", words[1], wolfSSL_CIPHER_get_name(cipher));
1169 #ifdef OPENSSL_EXTRA
1170 if (wolfSSL_get_signature_nid(ssl, &nid) == WOLFSSL_SUCCESS) {
1171 printf("%s %s\n", words[2], OBJ_nid2sn(nid));

NetBurner, Inc.
22.301 test.h 1385

1172 }
1173 #endif
1174 #if defined(HAVE_ECC) || defined(HAVE_CURVE25519) || defined(HAVE_CURVE448) || \
1175 !defined(NO_DH)
1176 if ((name = wolfSSL_get_curve_name(ssl)) != NULL)
1177 printf("%s %s\n", words[3], name);
1178 #endif
1179 #ifndef NO_DH
1180 else if ((bits = wolfSSL_GetDhKey_Sz(ssl)) > 0)
1181 printf("%s %d bits\n", words[4], bits);
1182 #endif
1183 if (wolfSSL_session_reused(ssl))
1184 printf("%s\n", words[5]);
1185 #ifdef WOLFSSL_ALT_CERT_CHAINS
1186 if (wolfSSL_is_peer_alt_cert_chain(ssl))
1187 printf("%s\n", words[6]);
1188 #endif
1189
1190 #if defined(SHOW_CERTS) && defined(SESSION_CERTS) && \
1191 (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
1192 {
1193 WOLFSSL_X509_CHAIN* chain;
1194
1195 chain = wolfSSL_get_peer_chain(ssl);
1196 ShowX509Chain(chain, wolfSSL_get_chain_count(chain), "session cert");
1197
1198 #ifdef WOLFSSL_ALT_CERT_CHAINS
1199 if (wolfSSL_is_peer_alt_cert_chain(ssl)) {
1200 chain = wolfSSL_get_peer_alt_chain(ssl);
1201 ShowX509Chain(chain, wolfSSL_get_chain_count(chain), "alt cert");
1202 }
1203 #endif
1204 }
1205 #endif /* SHOW_CERTS && SESSION_CERTS */
1206 (void)ssl;
1207 }
1208 /* original showPeer to maintain compatibility */
1209 static WC_INLINE void showPeer(WOLFSSL* ssl)
1210 {
1211 showPeerEx(ssl, 0);
1212 }
1213
1214 static WC_INLINE void build_addr(SOCKADDR_IN_T* addr, const char* peer,
1215 word16 port, int udp, int sctp)
1216 {
1217 int useLookup = 0;
1218 (void)useLookup;
1219 (void)udp;
1220 (void)sctp;
1221
1222 if (addr == NULL) {
1223 err_sys("invalid argument to build_addr, addr is NULL");
1224 return;
1225 }
1226
1227 XMEMSET(addr, 0, sizeof(SOCKADDR_IN_T));
1228
1229 #ifndef TEST_IPV6
1230 /* peer could be in human readable form */
1231 if ( ((size_t)peer != INADDR_ANY) && isalpha((int)peer[0])) {
1232 #ifdef WOLFSSL_USE_POPEN_HOST
1233 char host_ipaddr[4] = { 127, 0, 0, 1 };
1234 int found = 1;
1235
1236 if ((XSTRCMP(peer, "localhost") != 0) &&
1237 (XSTRCMP(peer, "127.0.0.1") != 0)) {
1238 FILE* fp;
1239 char host_out[100];
1240 char cmd[100];
1241
1242 XSTRNCPY(cmd, "host ", 6);
1243 XSTRNCAT(cmd, peer, 99 - XSTRLEN(cmd));
1244 found = 0;
1245 fp = popen(cmd, "r");
1246 if (fp != NULL) {
1247 while (fgets(host_out, sizeof(host_out), fp) != NULL) {
1248 int i;
1249 int j = 0;
1250 for (j = 0; host_out[j] != ’\0’; j++) {
1251 if ((host_out[j] >= ’0’) && (host_out[j] <= ’9’)) {
1252 break;
1253 }
1254 }
1255 found = (host_out[j] >= ’0’) && (host_out[j] <= ’9’);
1256 if (!found) {
1257 continue;
1258 }

NetBurner, Inc.
1386 File Documentation

1259
1260 for (i = 0; i < 4; i++) {
1261 host_ipaddr[i] = atoi(host_out + j);
1262 while ((host_out[j] >= ’0’) && (host_out[j] <= ’9’)) {
1263 j++;
1264 }
1265 if (host_out[j] == ’.’) {
1266 j++;
1267 found &= (i != 3);
1268 }
1269 else {
1270 found &= (i == 3);
1271 break;
1272 }
1273 }
1274 if (found) {
1275 break;
1276 }
1277 }
1278 pclose(fp);
1279 }
1280 }
1281 if (found) {
1282 XMEMCPY(&addr->sin_addr.s_addr, host_ipaddr, sizeof(host_ipaddr));
1283 useLookup = 1;
1284 }
1285 #elif !defined(WOLFSSL_USE_GETADDRINFO)
1286 #if defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)
1287 int err;
1288 struct hostent* entry = gethostbyname(peer, &err);
1289 #elif defined(WOLFSSL_TIRTOS)
1290 struct hostent* entry = DNSGetHostByName(peer);
1291 #elif defined(WOLFSSL_VXWORKS)
1292 struct hostent* entry = (struct hostent*)hostGetByName((char*)peer);
1293 #else
1294 struct hostent* entry = gethostbyname(peer);
1295 #endif
1296
1297 if (entry) {
1298 XMEMCPY(&addr->sin_addr.s_addr, entry->h_addr_list[0],
1299 entry->h_length);
1300 useLookup = 1;
1301 }
1302 #else
1303 struct zsock_addrinfo hints, *addrInfo;
1304 char portStr[6];
1305 XSNPRINTF(portStr, sizeof(portStr), "%d", port);
1306 XMEMSET(&hints, 0, sizeof(hints));
1307 hints.ai_family = AF_UNSPEC;
1308 hints.ai_socktype = udp ? SOCK_DGRAM : SOCK_STREAM;
1309 hints.ai_protocol = udp ? IPPROTO_UDP : IPPROTO_TCP;
1310 if (getaddrinfo((char*)peer, portStr, &hints, &addrInfo) == 0) {
1311 XMEMCPY(addr, addrInfo->ai_addr, sizeof(*addr));
1312 useLookup = 1;
1313 }
1314 #endif
1315 else
1316 err_sys("no entry for host");
1317 }
1318 #endif
1319
1320
1321 #ifndef TEST_IPV6
1322 #if defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET)
1323 addr->sin_family = PF_INET;
1324 #else
1325 addr->sin_family = AF_INET_V;
1326 #endif
1327 addr->sin_port = XHTONS(port);
1328 if ((size_t)peer == INADDR_ANY)
1329 addr->sin_addr.s_addr = INADDR_ANY;
1330 else {
1331 if (!useLookup)
1332 addr->sin_addr.s_addr = inet_addr(peer);
1333 }
1334 #else
1335 addr->sin6_family = AF_INET_V;
1336 addr->sin6_port = XHTONS(port);
1337 if ((size_t)peer == INADDR_ANY) {
1338 addr->sin6_addr = in6addr_any;
1339 }
1340 else {
1341 #if defined(HAVE_GETADDRINFO)
1342 struct addrinfo hints;
1343 struct addrinfo* answer = NULL;
1344 int ret;
1345 char strPort[80];

NetBurner, Inc.
22.301 test.h 1387

1346
1347 XMEMSET(&hints, 0, sizeof(hints));
1348
1349 hints.ai_family = AF_INET_V;
1350 if (udp) {
1351 hints.ai_socktype = SOCK_DGRAM;
1352 hints.ai_protocol = IPPROTO_UDP;
1353 }
1354 #ifdef WOLFSSL_SCTP
1355 else if (sctp) {
1356 hints.ai_socktype = SOCK_STREAM;
1357 hints.ai_protocol = IPPROTO_SCTP;
1358 }
1359 #endif
1360 else {
1361 hints.ai_socktype = SOCK_STREAM;
1362 hints.ai_protocol = IPPROTO_TCP;
1363 }
1364
1365 (void)SNPRINTF(strPort, sizeof(strPort), "%d", port);
1366 strPort[79] = ’\0’;
1367
1368 ret = getaddrinfo(peer, strPort, &hints, &answer);
1369 if (ret < 0 || answer == NULL)
1370 err_sys("getaddrinfo failed");
1371
1372 XMEMCPY(addr, answer->ai_addr, answer->ai_addrlen);
1373 freeaddrinfo(answer);
1374 #else
1375 printf("no ipv6 getaddrinfo, loopback only tests/examples\n");
1376 addr->sin6_addr = in6addr_loopback;
1377 #endif
1378 }
1379 #endif
1380 }
1381
1382
1383 static WC_INLINE void tcp_socket(SOCKET_T* sockfd, int udp, int sctp)
1384 {
1385 (void)sctp;
1386
1387 if (udp)
1388 *sockfd = socket(AF_INET_V, SOCK_DGRAM, IPPROTO_UDP);
1389 #ifdef WOLFSSL_SCTP
1390 else if (sctp)
1391 *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_SCTP);
1392 #endif
1393 else
1394 *sockfd = socket(AF_INET_V, SOCK_STREAM, IPPROTO_TCP);
1395
1396 if(WOLFSSL_SOCKET_IS_INVALID(*sockfd)) {
1397 err_sys_with_errno("socket failed\n");
1398 }
1399
1400 #ifndef USE_WINDOWS_API
1401 #ifdef SO_NOSIGPIPE
1402 {
1403 int on = 1;
1404 socklen_t len = sizeof(on);
1405 int res = setsockopt(*sockfd, SOL_SOCKET, SO_NOSIGPIPE, &on, len);
1406 if (res < 0)
1407 err_sys_with_errno("setsockopt SO_NOSIGPIPE failed\n");
1408 }
1409 #elif defined(WOLFSSL_MDK_ARM) || defined (WOLFSSL_TIRTOS) ||\
1410 defined(WOLFSSL_KEIL_TCP_NET) || defined(WOLFSSL_ZEPHYR)
1411 /* nothing to define */
1412 #elif defined(NETOS)
1413 /* TODO: signal(SIGPIPE, SIG_IGN); */
1414 #else /* no S_NOSIGPIPE */
1415 signal(SIGPIPE, SIG_IGN);
1416 #endif /* S_NOSIGPIPE */
1417
1418 #if defined(TCP_NODELAY)
1419 if (!udp && !sctp)
1420 {
1421 int on = 1;
1422 socklen_t len = sizeof(on);
1423 int res = setsockopt(*sockfd, IPPROTO_TCP, TCP_NODELAY, &on, len);
1424 if (res < 0)
1425 err_sys_with_errno("setsockopt TCP_NODELAY failed\n");
1426 }
1427 #endif
1428 #endif /* USE_WINDOWS_API */
1429 }
1430
1431 #if defined(WOLFSSL_WOLFSENTRY_HOOKS) && defined(WOLFSENTRY_H)
1432

NetBurner, Inc.
1388 File Documentation

1433 #include <wolfsentry/wolfsentry_util.h>


1434
1435 #if !defined(NO_FILESYSTEM) && !defined(WOLFSENTRY_NO_JSON)
1436 #include <wolfsentry/wolfsentry_json.h>
1437 #endif
1438
1439 struct wolfsentry_data {
1440 WOLFSENTRY_SOCKADDR(128) remote;
1441 WOLFSENTRY_SOCKADDR(128) local;
1442 wolfsentry_route_flags_t flags;
1443 void *heap;
1444 int alloctype;
1445 };
1446
1447 static void free_wolfsentry_data(struct wolfsentry_data *data) {
1448 XFREE(data, data->heap, data->alloctype);
1449 }
1450
1451 static struct wolfsentry_context *wolfsentry = NULL;
1452
1453 static int wolfsentry_data_index = -1;
1454
1455 static WC_INLINE int wolfsentry_store_endpoints(
1456 WOLFSSL *ssl,
1457 SOCKADDR_IN_T *remote,
1458 SOCKADDR_IN_T *local,
1459 int proto,
1460 wolfsentry_route_flags_t flags,
1461 struct wolfsentry_data **wolfsentry_data_out)
1462 {
1463 struct wolfsentry_data *wolfsentry_data = (struct wolfsentry_data *)XMALLOC(
1464 sizeof *wolfsentry_data, NULL, DYNAMIC_TYPE_SOCKADDR);
1465 if (wolfsentry_data == NULL)
1466 return WOLFSSL_FAILURE;
1467
1468 wolfsentry_data->heap = NULL;
1469 wolfsentry_data->alloctype = DYNAMIC_TYPE_SOCKADDR;
1470
1471 #ifdef TEST_IPV6
1472 if ((sizeof wolfsentry_data->remote.addr < sizeof remote->sin6_addr) ||
1473 (sizeof wolfsentry_data->local.addr < sizeof local->sin6_addr))
1474 return WOLFSSL_FAILURE;
1475 wolfsentry_data->remote.sa_family = wolfsentry_data->local.sa_family = remote->sin6_family;
1476 wolfsentry_data->remote.sa_port = ntohs(remote->sin6_port);
1477 wolfsentry_data->local.sa_port = ntohs(local->sin6_port);
1478 if (WOLFSENTRY_MASKIN_BITS(flags, WOLFSENTRY_ROUTE_FLAG_SA_REMOTE_ADDR_WILDCARD)) {
1479 wolfsentry_data->remote.addr_len = 0;
1480 XMEMSET(wolfsentry_data->remote.addr, 0, sizeof remote->sin6_addr);
1481 } else {
1482 wolfsentry_data->remote.addr_len = sizeof remote->sin6_addr * BITS_PER_BYTE;
1483 XMEMCPY(wolfsentry_data->remote.addr, &remote->sin6_addr, sizeof remote->sin6_addr);
1484 }
1485 if (WOLFSENTRY_MASKIN_BITS(flags, WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_ADDR_WILDCARD)) {
1486 wolfsentry_data->local.addr_len = 0;
1487 XMEMSET(wolfsentry_data->local.addr, 0, sizeof local->sin6_addr);
1488 } else {
1489 wolfsentry_data->local.addr_len = sizeof local->sin6_addr * BITS_PER_BYTE;
1490 XMEMCPY(wolfsentry_data->local.addr, &local->sin6_addr, sizeof local->sin6_addr);
1491 }
1492 #else
1493 if ((sizeof wolfsentry_data->remote.addr < sizeof remote->sin_addr) ||
1494 (sizeof wolfsentry_data->local.addr < sizeof local->sin_addr))
1495 return WOLFSSL_FAILURE;
1496 wolfsentry_data->remote.sa_family = wolfsentry_data->local.sa_family = remote->sin_family;
1497 wolfsentry_data->remote.sa_port = ntohs(remote->sin_port);
1498 wolfsentry_data->local.sa_port = ntohs(local->sin_port);
1499 if (WOLFSENTRY_MASKIN_BITS(flags, WOLFSENTRY_ROUTE_FLAG_SA_REMOTE_ADDR_WILDCARD)) {
1500 wolfsentry_data->remote.addr_len = 0;
1501 XMEMSET(wolfsentry_data->remote.addr, 0, sizeof remote->sin_addr);
1502 } else {
1503 wolfsentry_data->remote.addr_len = sizeof remote->sin_addr * BITS_PER_BYTE;
1504 XMEMCPY(wolfsentry_data->remote.addr, &remote->sin_addr, sizeof remote->sin_addr);
1505 }
1506 if (WOLFSENTRY_MASKIN_BITS(flags, WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_ADDR_WILDCARD)) {
1507 wolfsentry_data->local.addr_len = 0;
1508 XMEMSET(wolfsentry_data->local.addr, 0, sizeof local->sin_addr);
1509 } else {
1510 wolfsentry_data->local.addr_len = sizeof local->sin_addr * BITS_PER_BYTE;
1511 XMEMCPY(wolfsentry_data->local.addr, &local->sin_addr, sizeof local->sin_addr);
1512 }
1513 #endif
1514 wolfsentry_data->remote.sa_proto = wolfsentry_data->local.sa_proto = proto;
1515 wolfsentry_data->remote.interface = wolfsentry_data->local.interface = 0;
1516 wolfsentry_data->flags = flags;
1517
1518 if (wolfSSL_set_ex_data_with_cleanup(
1519 ssl, wolfsentry_data_index, wolfsentry_data,

NetBurner, Inc.
22.301 test.h 1389

1520 (wolfSSL_ex_data_cleanup_routine_t)free_wolfsentry_data) !=
1521 WOLFSSL_SUCCESS) {
1522 free_wolfsentry_data(wolfsentry_data);
1523 return WOLFSSL_FAILURE;
1524 }
1525
1526 if (wolfsentry_data_out != NULL)
1527 *wolfsentry_data_out = wolfsentry_data;
1528
1529 return WOLFSSL_SUCCESS;
1530 }
1531
1532 static int wolfSentry_NetworkFilterCallback(
1533 WOLFSSL *ssl,
1534 struct wolfsentry_context *_wolfsentry,
1535 wolfSSL_netfilter_decision_t *decision)
1536 {
1537 struct wolfsentry_data *data;
1538 char inet_ntop_buf[INET6_ADDRSTRLEN], inet_ntop_buf2[INET6_ADDRSTRLEN];
1539 wolfsentry_errcode_t ret;
1540 wolfsentry_action_res_t action_results;
1541
1542 if ((data = wolfSSL_get_ex_data(ssl, wolfsentry_data_index)) == NULL)
1543 return WOLFSSL_FAILURE;
1544
1545 ret = wolfsentry_route_event_dispatch(
1546 _wolfsentry,
1547 (const struct wolfsentry_sockaddr *)&data->remote,
1548 (const struct wolfsentry_sockaddr *)&data->local,
1549 data->flags,
1550 NULL /* event_label */,
1551 0 /* event_label_len */,
1552 NULL /* caller_context */,
1553 NULL /* id */,
1554 NULL /* inexact_matches */,
1555 &action_results);
1556
1557 if (ret >= 0) {
1558 if (WOLFSENTRY_MASKIN_BITS(action_results, WOLFSENTRY_ACTION_RES_REJECT))
1559 *decision = WOLFSSL_NETFILTER_REJECT;
1560 else if (WOLFSENTRY_MASKIN_BITS(action_results, WOLFSENTRY_ACTION_RES_ACCEPT))
1561 *decision = WOLFSSL_NETFILTER_ACCEPT;
1562 else
1563 *decision = WOLFSSL_NETFILTER_PASS;
1564 } else {
1565 fprintf(stderr, "wolfsentry_route_event_dispatch error "
1566 WOLFSENTRY_ERROR_FMT "\n", WOLFSENTRY_ERROR_FMT_ARGS(ret));
1567 *decision = WOLFSSL_NETFILTER_PASS;
1568 }
1569
1570 printf("wolfSentry got network filter callback: family=%d proto=%d rport=%d"
1571 " lport=%d raddr=%s laddr=%s interface=%d; decision=%d (%s)\n",
1572 data->remote.sa_family,
1573 data->remote.sa_proto,
1574 data->remote.sa_port,
1575 data->local.sa_port,
1576 inet_ntop(data->remote.sa_family, data->remote.addr, inet_ntop_buf,
1577 sizeof inet_ntop_buf),
1578 inet_ntop(data->local.sa_family, data->local.addr, inet_ntop_buf2,
1579 sizeof inet_ntop_buf2),
1580 data->remote.interface,
1581 *decision,
1582 *decision == WOLFSSL_NETFILTER_REJECT ? "REJECT" :
1583 *decision == WOLFSSL_NETFILTER_ACCEPT ? "ACCEPT" :
1584 *decision == WOLFSSL_NETFILTER_PASS ? "PASS" :
1585 "???");
1586
1587 return WOLFSSL_SUCCESS;
1588 }
1589
1590 static int wolfsentry_setup(
1591 struct wolfsentry_context **_wolfsentry,
1592 const char *_wolfsentry_config_path,
1593 wolfsentry_route_flags_t route_flags)
1594 {
1595 wolfsentry_errcode_t ret;
1596 ret = wolfsentry_init(NULL /* hpi */, NULL /* default config */,
1597 _wolfsentry);
1598 if (ret < 0) {
1599 fprintf(stderr, "wolfsentry_init() returned " WOLFSENTRY_ERROR_FMT "\n",
1600 WOLFSENTRY_ERROR_FMT_ARGS(ret));
1601 err_sys("unable to initialize wolfSentry");
1602 }
1603
1604 if (wolfsentry_data_index < 0)
1605 wolfsentry_data_index = wolfSSL_get_ex_new_index(0, NULL, NULL, NULL,
1606 NULL);

NetBurner, Inc.
1390 File Documentation

1607
1608 #if !defined(NO_FILESYSTEM) && !defined(WOLFSENTRY_NO_JSON)
1609 if (_wolfsentry_config_path != NULL) {
1610 char buf[512], err_buf[512];
1611 struct wolfsentry_json_process_state *jps;
1612
1613 FILE *f = fopen(_wolfsentry_config_path, "r");
1614
1615 if (f == NULL) {
1616 fprintf(stderr, "fopen(%s): %s\n",_wolfsentry_config_path,strerror(errno));
1617 err_sys("unable to open wolfSentry config file");
1618 }
1619
1620 if ((ret = wolfsentry_config_json_init(
1621 *_wolfsentry,
1622 WOLFSENTRY_CONFIG_LOAD_FLAG_NONE,
1623 &jps)) < 0) {
1624 fprintf(stderr, "wolfsentry_config_json_init() returned "
1625 WOLFSENTRY_ERROR_FMT "\n",
1626 WOLFSENTRY_ERROR_FMT_ARGS(ret));
1627 err_sys("error while initializing wolfSentry config parser");
1628 }
1629
1630 for (;;) {
1631 size_t n = fread(buf, 1, sizeof buf, f);
1632 if ((n < sizeof buf) && ferror(f)) {
1633 fprintf(stderr,"fread(%s): %s\n",_wolfsentry_config_path, strerror(errno));
1634 err_sys("error while reading wolfSentry config file");
1635 }
1636
1637 ret = wolfsentry_config_json_feed(jps, buf, n, err_buf, sizeof err_buf);
1638 if (ret < 0) {
1639 fprintf(stderr, "%.*s\n", (int)sizeof err_buf, err_buf);
1640 err_sys("error while loading wolfSentry config file");
1641 }
1642 if ((n < sizeof buf) && feof(f))
1643 break;
1644 }
1645 fclose(f);
1646
1647 if ((ret = wolfsentry_config_json_fini(&jps, err_buf, sizeof err_buf)) < 0) {
1648 fprintf(stderr, "%.*s\n", (int)sizeof err_buf, err_buf);
1649 err_sys("error while loading wolfSentry config file");
1650 }
1651
1652 } else
1653 #endif /* !NO_FILESYSTEM && !WOLFSENTRY_NO_JSON */
1654 {
1655 struct wolfsentry_route_table *table;
1656
1657 if ((ret = wolfsentry_route_get_table_static(*_wolfsentry,
1658 &table)) < 0)
1659 fprintf(stderr, "wolfsentry_route_get_table_static() returned "
1660 WOLFSENTRY_ERROR_FMT "\n",
1661 WOLFSENTRY_ERROR_FMT_ARGS(ret));
1662
1663 if (ret < 0)
1664 return ret;
1665
1666 if (WOLFSENTRY_MASKIN_BITS(route_flags, WOLFSENTRY_ROUTE_FLAG_DIRECTION_OUT)) {
1667 WOLFSENTRY_SOCKADDR(128) remote, local;
1668 wolfsentry_ent_id_t id;
1669 wolfsentry_action_res_t action_results;
1670
1671 if ((ret = wolfsentry_route_table_default_policy_set(
1672 *_wolfsentry, table,
1673 WOLFSENTRY_ACTION_RES_ACCEPT))
1674 < 0) {
1675 fprintf(stderr,
1676 "wolfsentry_route_table_default_policy_set() returned "
1677 WOLFSENTRY_ERROR_FMT "\n",
1678 WOLFSENTRY_ERROR_FMT_ARGS(ret));
1679 return ret;
1680 }
1681
1682 XMEMSET(&remote, 0, sizeof remote);
1683 XMEMSET(&local, 0, sizeof local);
1684 #ifdef TEST_IPV6
1685 remote.sa_family = local.sa_family = AF_INET6;
1686 remote.addr_len = 128;
1687 XMEMCPY(remote.addr, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001",
16);
1688 #else
1689 remote.sa_family = local.sa_family = AF_INET;
1690 remote.addr_len = 32;
1691 XMEMCPY(remote.addr, "\177\000\000\001", 4);
1692 #endif

NetBurner, Inc.
22.301 test.h 1391

1693
1694 if ((ret = wolfsentry_route_insert_static
1695 (*_wolfsentry, NULL /* caller_context */,
1696 (const struct wolfsentry_sockaddr *)&remote,
1697 (const struct wolfsentry_sockaddr *)&local,
1698 route_flags |
1699 WOLFSENTRY_ROUTE_FLAG_GREENLISTED |
1700 WOLFSENTRY_ROUTE_FLAG_PARENT_EVENT_WILDCARD |
1701 WOLFSENTRY_ROUTE_FLAG_REMOTE_INTERFACE_WILDCARD|
1702 WOLFSENTRY_ROUTE_FLAG_LOCAL_INTERFACE_WILDCARD |
1703 WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_ADDR_WILDCARD |
1704 WOLFSENTRY_ROUTE_FLAG_SA_PROTO_WILDCARD |
1705 WOLFSENTRY_ROUTE_FLAG_SA_REMOTE_PORT_WILDCARD |
1706 WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_PORT_WILDCARD,
1707 0 /* event_label_len */, 0 /* event_label */, &id,
1708 &action_results)) < 0) {
1709 fprintf(stderr, "wolfsentry_route_insert_static() returned "
1710 WOLFSENTRY_ERROR_FMT "\n",
1711 WOLFSENTRY_ERROR_FMT_ARGS(ret));
1712 return ret;
1713 }
1714 } else if (WOLFSENTRY_MASKIN_BITS(route_flags, WOLFSENTRY_ROUTE_FLAG_DIRECTION_IN)) {
1715 WOLFSENTRY_SOCKADDR(128) remote, local;
1716 wolfsentry_ent_id_t id;
1717 wolfsentry_action_res_t action_results;
1718
1719 if ((ret = wolfsentry_route_table_default_policy_set(
1720 *_wolfsentry, table,
1721 WOLFSENTRY_ACTION_RES_REJECT|WOLFSENTRY_ACTION_RES_STOP))
1722 < 0) {
1723 fprintf(stderr,
1724 "wolfsentry_route_table_default_policy_set() returned "
1725 WOLFSENTRY_ERROR_FMT "\n",
1726 WOLFSENTRY_ERROR_FMT_ARGS(ret));
1727 return ret;
1728 }
1729
1730 XMEMSET(&remote, 0, sizeof remote);
1731 XMEMSET(&local, 0, sizeof local);
1732 #ifdef TEST_IPV6
1733 remote.sa_family = local.sa_family = AF_INET6;
1734 remote.addr_len = 128;
1735 XMEMCPY(remote.addr, "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001",
16);
1736 #else
1737 remote.sa_family = local.sa_family = AF_INET;
1738 remote.addr_len = 32;
1739 XMEMCPY(remote.addr, "\177\000\000\001", 4);
1740 #endif
1741
1742 if ((ret = wolfsentry_route_insert_static
1743 (*_wolfsentry, NULL /* caller_context */,
1744 (const struct wolfsentry_sockaddr *)&remote, (const struct wolfsentry_sockaddr
*)&local,
1745 route_flags |
1746 WOLFSENTRY_ROUTE_FLAG_GREENLISTED |
1747 WOLFSENTRY_ROUTE_FLAG_PARENT_EVENT_WILDCARD |
1748 WOLFSENTRY_ROUTE_FLAG_REMOTE_INTERFACE_WILDCARD|
1749 WOLFSENTRY_ROUTE_FLAG_LOCAL_INTERFACE_WILDCARD |
1750 WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_ADDR_WILDCARD |
1751 WOLFSENTRY_ROUTE_FLAG_SA_PROTO_WILDCARD |
1752 WOLFSENTRY_ROUTE_FLAG_SA_REMOTE_PORT_WILDCARD |
1753 WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_PORT_WILDCARD,
1754 0 /* event_label_len */, 0 /* event_label */, &id,
1755 &action_results)) < 0) {
1756 fprintf(stderr, "wolfsentry_route_insert_static() returned "
1757 WOLFSENTRY_ERROR_FMT "\n",
1758 WOLFSENTRY_ERROR_FMT_ARGS(ret));
1759 return ret;
1760 }
1761 }
1762 }
1763
1764 return 0;
1765 }
1766
1767 static WC_INLINE int tcp_connect_with_wolfSentry(
1768 SOCKET_T* sockfd,
1769 const char* ip,
1770 word16 port,
1771 int udp,
1772 int sctp,
1773 WOLFSSL* ssl,
1774 struct wolfsentry_context *_wolfsentry)
1775 {
1776 SOCKADDR_IN_T remote_addr;
1777 struct wolfsentry_data *wolfsentry_data;

NetBurner, Inc.
1392 File Documentation

1778 char inet_ntop_buf[INET6_ADDRSTRLEN], inet_ntop_buf2[INET6_ADDRSTRLEN];


1779 wolfsentry_errcode_t ret;
1780 wolfsentry_action_res_t action_results;
1781 wolfSSL_netfilter_decision_t decision;
1782
1783 build_addr(&remote_addr, ip, port, udp, sctp);
1784
1785 {
1786 SOCKADDR_IN_T local_addr;
1787 #ifdef TEST_IPV6
1788 local_addr.sin6_port = 0;
1789 #else
1790 local_addr.sin_port = 0;
1791 #endif
1792 ((struct sockaddr *)&local_addr)->sa_family = ((struct sockaddr *)&remote_addr)->sa_family;
1793
1794 if (wolfsentry_store_endpoints(
1795 ssl, &remote_addr, &local_addr,
1796 udp ? IPPROTO_UDP : IPPROTO_TCP,
1797 WOLFSENTRY_ROUTE_FLAG_DIRECTION_OUT|
1798 WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_ADDR_WILDCARD|
1799 WOLFSENTRY_ROUTE_FLAG_SA_LOCAL_PORT_WILDCARD, &wolfsentry_data) != WOLFSSL_SUCCESS)
1800 return WOLFSSL_FAILURE;
1801 }
1802
1803 ret = wolfsentry_route_event_dispatch(
1804 _wolfsentry,
1805 (const struct wolfsentry_sockaddr *)&wolfsentry_data->remote,
1806 (const struct wolfsentry_sockaddr *)&wolfsentry_data->local,
1807 wolfsentry_data->flags,
1808 NULL /* event_label */,
1809 0 /* event_label_len */,
1810 NULL /* caller_context */,
1811 NULL /* id */,
1812 NULL /* inexact_matches */,
1813 &action_results);
1814
1815 if (ret < 0) {
1816 fprintf(stderr, "wolfsentry_route_event_dispatch error "
1817 WOLFSENTRY_ERROR_FMT "\n", WOLFSENTRY_ERROR_FMT_ARGS(ret));
1818 decision = WOLFSSL_NETFILTER_PASS;
1819 } else {
1820 if (WOLFSENTRY_MASKIN_BITS(action_results, WOLFSENTRY_ACTION_RES_REJECT))
1821 decision = WOLFSSL_NETFILTER_REJECT;
1822 else if (WOLFSENTRY_MASKIN_BITS(action_results, WOLFSENTRY_ACTION_RES_ACCEPT))
1823 decision = WOLFSSL_NETFILTER_ACCEPT;
1824 else
1825 decision = WOLFSSL_NETFILTER_PASS;
1826 }
1827
1828 printf("wolfSentry callin from tcp_connect_with_wolfSentry: family=%d proto=%d rport=%d"
1829 " lport=%d raddr=%s laddr=%s interface=%d; decision=%d (%s)\n",
1830 wolfsentry_data->remote.sa_family,
1831 wolfsentry_data->remote.sa_proto,
1832 wolfsentry_data->remote.sa_port,
1833 wolfsentry_data->local.sa_port,
1834 inet_ntop(wolfsentry_data->remote.sa_family, wolfsentry_data->remote.addr, inet_ntop_buf,
1835 sizeof inet_ntop_buf),
1836 inet_ntop(wolfsentry_data->local.sa_family, wolfsentry_data->local.addr, inet_ntop_buf2,
1837 sizeof inet_ntop_buf2),
1838 wolfsentry_data->remote.interface,
1839 decision,
1840 decision == WOLFSSL_NETFILTER_REJECT ? "REJECT" :
1841 decision == WOLFSSL_NETFILTER_ACCEPT ? "ACCEPT" :
1842 decision == WOLFSSL_NETFILTER_PASS ? "PASS" :
1843 "???");
1844
1845 if (decision == WOLFSSL_NETFILTER_REJECT)
1846 return SOCKET_FILTERED_E;
1847
1848 if (udp) {
1849 wolfSSL_dtls_set_peer(ssl, &remote_addr, sizeof(remote_addr));
1850 }
1851 tcp_socket(sockfd, udp, sctp);
1852
1853 if (!udp) {
1854 if (connect(*sockfd, (const struct sockaddr*)&remote_addr, sizeof(remote_addr)) != 0)
1855 err_sys_with_errno("tcp connect failed");
1856 }
1857
1858 return WOLFSSL_SUCCESS;
1859 }
1860
1861 #define tcp_connect(sockfd, ip, port, udp, sctp, ssl) \
1862 tcp_connect_with_wolfSentry(sockfd, ip, port, udp, sctp, ssl, wolfsentry)
1863
1864 #else /* !WOLFSSL_WOLFSENTRY_HOOKS */

NetBurner, Inc.
22.301 test.h 1393

1865
1866 static WC_INLINE void tcp_connect(SOCKET_T* sockfd, const char* ip, word16 port,
1867 int udp, int sctp, WOLFSSL* ssl)
1868 {
1869 SOCKADDR_IN_T addr;
1870 build_addr(&addr, ip, port, udp, sctp);
1871 if (udp) {
1872 wolfSSL_dtls_set_peer(ssl, &addr, sizeof(addr));
1873 }
1874 tcp_socket(sockfd, udp, sctp);
1875
1876 if (!udp) {
1877 if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
1878 err_sys_with_errno("tcp connect failed");
1879 }
1880 }
1881
1882 #endif /* WOLFSSL_WOLFSENTRY_HOOKS */
1883
1884
1885 static WC_INLINE void udp_connect(SOCKET_T* sockfd, const char* ip, word16 port)
1886 {
1887 SOCKADDR_IN_T addr;
1888 build_addr(&addr, ip, port, 1, 0);
1889 if (connect(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
1890 err_sys_with_errno("tcp connect failed");
1891 }
1892
1893
1894 enum {
1895 TEST_SELECT_FAIL,
1896 TEST_TIMEOUT,
1897 TEST_RECV_READY,
1898 TEST_SEND_READY,
1899 TEST_ERROR_READY
1900 };
1901
1902
1903 #if !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_TCP_NET) && \
1904 !defined(WOLFSSL_TIRTOS)
1905 static WC_INLINE int tcp_select_ex(SOCKET_T socketfd, int to_sec, int rx)
1906 {
1907 fd_set fds, errfds;
1908 fd_set* recvfds = NULL;
1909 fd_set* sendfds = NULL;
1910 SOCKET_T nfds = socketfd + 1;
1911 #if !defined(__INTEGRITY)
1912 struct timeval timeout = {(to_sec > 0) ? to_sec : 0, 0};
1913 #else
1914 struct timeval timeout;
1915 #endif
1916 int result;
1917
1918 FD_ZERO(&fds);
1919 FD_SET(socketfd, &fds);
1920 FD_ZERO(&errfds);
1921 FD_SET(socketfd, &errfds);
1922
1923 if (rx)
1924 recvfds = &fds;
1925 else
1926 sendfds = &fds;
1927
1928 #if defined(__INTEGRITY)
1929 timeout.tv_sec = (long long)(to_sec > 0) ? to_sec : 0, 0;
1930 #endif
1931 result = select(nfds, recvfds, sendfds, &errfds, &timeout);
1932
1933 if (result == 0)
1934 return TEST_TIMEOUT;
1935 else if (result > 0) {
1936 if (FD_ISSET(socketfd, &fds)) {
1937 if (rx)
1938 return TEST_RECV_READY;
1939 else
1940 return TEST_SEND_READY;
1941 }
1942 else if(FD_ISSET(socketfd, &errfds))
1943 return TEST_ERROR_READY;
1944 }
1945
1946 return TEST_SELECT_FAIL;
1947 }
1948
1949 static WC_INLINE int tcp_select(SOCKET_T socketfd, int to_sec)
1950 {
1951 return tcp_select_ex(socketfd, to_sec, 1);

NetBurner, Inc.
1394 File Documentation

1952 }
1953
1954 static WC_INLINE int tcp_select_tx(SOCKET_T socketfd, int to_sec)
1955 {
1956 return tcp_select_ex(socketfd, to_sec, 0);
1957 }
1958
1959 #elif defined(WOLFSSL_TIRTOS) || defined(WOLFSSL_KEIL_TCP_NET)
1960 static WC_INLINE int tcp_select(SOCKET_T socketfd, int to_sec)
1961 {
1962 return TEST_RECV_READY;
1963 }
1964 static WC_INLINE int tcp_select_tx(SOCKET_T socketfd, int to_sec)
1965 {
1966 return TEST_SEND_READY;
1967 }
1968 #endif /* !WOLFSSL_MDK_ARM */
1969
1970
1971 static WC_INLINE void tcp_listen(SOCKET_T* sockfd, word16* port, int useAnyAddr,
1972 int udp, int sctp)
1973 {
1974 SOCKADDR_IN_T addr;
1975
1976 /* don’t use INADDR_ANY by default, firewall may block, make user switch
1977 on */
1978 build_addr(&addr, (useAnyAddr ? INADDR_ANY : wolfSSLIP), *port, udp, sctp);
1979 tcp_socket(sockfd, udp, sctp);
1980
1981 #if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_MDK_ARM)\
1982 && !defined(WOLFSSL_KEIL_TCP_NET) && !defined(WOLFSSL_ZEPHYR)
1983 {
1984 int res, on = 1;
1985 socklen_t len = sizeof(on);
1986 res = setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, &on, len);
1987 if (res < 0)
1988 err_sys_with_errno("setsockopt SO_REUSEADDR failed\n");
1989 }
1990 #ifdef SO_REUSEPORT
1991 {
1992 int res, on = 1;
1993 socklen_t len = sizeof(on);
1994 res = setsockopt(*sockfd, SOL_SOCKET, SO_REUSEPORT, &on, len);
1995 if (res < 0)
1996 err_sys_with_errno("setsockopt SO_REUSEPORT failed\n");
1997 }
1998 #endif
1999 #endif
2000
2001 if (bind(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
2002 err_sys_with_errno("tcp bind failed");
2003 if (!udp) {
2004 #ifdef WOLFSSL_KEIL_TCP_NET
2005 #define SOCK_LISTEN_MAX_QUEUE 1
2006 #else
2007 #define SOCK_LISTEN_MAX_QUEUE 5
2008 #endif
2009 if (listen(*sockfd, SOCK_LISTEN_MAX_QUEUE) != 0)
2010 err_sys_with_errno("tcp listen failed");
2011 }
2012 #if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_TIRTOS) \
2013 && !defined(WOLFSSL_ZEPHYR)
2014 if (*port == 0) {
2015 socklen_t len = sizeof(addr);
2016 if (getsockname(*sockfd, (struct sockaddr*)&addr, &len) == 0) {
2017 #ifndef TEST_IPV6
2018 *port = XNTOHS(addr.sin_port);
2019 #else
2020 *port = XNTOHS(addr.sin6_port);
2021 #endif
2022 }
2023 }
2024 #endif
2025 }
2026
2027
2028 #if 0
2029 static WC_INLINE int udp_read_connect(SOCKET_T sockfd)
2030 {
2031 SOCKADDR_IN_T cliaddr;
2032 byte b[1500];
2033 int n;
2034 socklen_t len = sizeof(cliaddr);
2035
2036 n = (int)recvfrom(sockfd, (char*)b, sizeof(b), MSG_PEEK,
2037 (struct sockaddr*)&cliaddr, &len);
2038 if (n > 0) {

NetBurner, Inc.
22.301 test.h 1395

2039 if (connect(sockfd, (const struct sockaddr*)&cliaddr,


2040 sizeof(cliaddr)) != 0)
2041 err_sys("udp connect failed");
2042 }
2043 else
2044 err_sys("recvfrom failed");
2045
2046 return sockfd;
2047 }
2048 #endif
2049
2050 static WC_INLINE void udp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd,
2051 int useAnyAddr, word16 port, func_args* args)
2052 {
2053 SOCKADDR_IN_T addr;
2054
2055 (void)args;
2056 build_addr(&addr, (useAnyAddr ? INADDR_ANY : wolfSSLIP), port, 1, 0);
2057 tcp_socket(sockfd, 1, 0);
2058
2059
2060 #if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_MDK_ARM) \
2061 && !defined(WOLFSSL_KEIL_TCP_NET) && !defined(WOLFSSL_ZEPHYR)
2062 {
2063 int res, on = 1;
2064 socklen_t len = sizeof(on);
2065 res = setsockopt(*sockfd, SOL_SOCKET, SO_REUSEADDR, &on, len);
2066 if (res < 0)
2067 err_sys_with_errno("setsockopt SO_REUSEADDR failed\n");
2068 }
2069 #ifdef SO_REUSEPORT
2070 {
2071 int res, on = 1;
2072 socklen_t len = sizeof(on);
2073 res = setsockopt(*sockfd, SOL_SOCKET, SO_REUSEPORT, &on, len);
2074 if (res < 0)
2075 err_sys_with_errno("setsockopt SO_REUSEPORT failed\n");
2076 }
2077 #endif
2078 #endif
2079
2080 if (bind(*sockfd, (const struct sockaddr*)&addr, sizeof(addr)) != 0)
2081 err_sys_with_errno("tcp bind failed");
2082
2083 #if !defined(USE_WINDOWS_API) && !defined(WOLFSSL_TIRTOS)
2084 if (port == 0) {
2085 socklen_t len = sizeof(addr);
2086 if (getsockname(*sockfd, (struct sockaddr*)&addr, &len) == 0) {
2087 #ifndef TEST_IPV6
2088 port = XNTOHS(addr.sin_port);
2089 #else
2090 port = XNTOHS(addr.sin6_port);
2091 #endif
2092 }
2093 }
2094 #endif
2095
2096 #if defined(_POSIX_THREADS) && !defined(__MINGW32__)
2097 /* signal ready to accept data */
2098 {
2099 tcp_ready* ready = args->signal;
2100 PTHREAD_CHECK_RET(pthread_mutex_lock(&ready->mutex));
2101 ready->ready = 1;
2102 ready->port = port;
2103 PTHREAD_CHECK_RET(pthread_cond_signal(&ready->cond));
2104 PTHREAD_CHECK_RET(pthread_mutex_unlock(&ready->mutex));
2105 }
2106 #elif defined (WOLFSSL_TIRTOS)
2107 /* Need mutex? */
2108 tcp_ready* ready = args->signal;
2109 ready->ready = 1;
2110 ready->port = port;
2111 #elif defined(NETOS)
2112 {
2113 tcp_ready* ready = args->signal;
2114 (void)tx_mutex_get(&ready->mutex, TX_WAIT_FOREVER);
2115 ready->ready = 1;
2116 ready->port = port;
2117 (void)tx_mutex_put(&ready->mutex);
2118 }
2119 #else
2120 (void)port;
2121 #endif
2122
2123 *clientfd = *sockfd;
2124 }
2125

NetBurner, Inc.
1396 File Documentation

2126 static WC_INLINE void tcp_accept(SOCKET_T* sockfd, SOCKET_T* clientfd,


2127 func_args* args, word16 port, int useAnyAddr,
2128 int udp, int sctp, int ready_file, int do_listen,
2129 SOCKADDR_IN_T *client_addr, socklen_t *client_len)
2130 {
2131 tcp_ready* ready = NULL;
2132
2133 (void) ready; /* Account for case when "ready" is not used */
2134
2135 if (udp) {
2136 udp_accept(sockfd, clientfd, useAnyAddr, port, args);
2137 return;
2138 }
2139
2140 if(do_listen) {
2141 tcp_listen(sockfd, &port, useAnyAddr, udp, sctp);
2142
2143 #if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER) && !defined(__MINGW32__)
2144 /* signal ready to tcp_accept */
2145 if (args)
2146 ready = args->signal;
2147 if (ready) {
2148 PTHREAD_CHECK_RET(pthread_mutex_lock(&ready->mutex));
2149 ready->ready = 1;
2150 ready->port = port;
2151 PTHREAD_CHECK_RET(pthread_cond_signal(&ready->cond));
2152 PTHREAD_CHECK_RET(pthread_mutex_unlock(&ready->mutex));
2153 }
2154 #elif defined (WOLFSSL_TIRTOS)
2155 /* Need mutex? */
2156 if (args)
2157 ready = args->signal;
2158 if (ready) {
2159 ready->ready = 1;
2160 ready->port = port;
2161 }
2162 #elif defined(NETOS)
2163 /* signal ready to tcp_accept */
2164 if (args)
2165 ready = args->signal;
2166 if (ready) {
2167 (void)tx_mutex_get(&ready->mutex, TX_WAIT_FOREVER);
2168 ready->ready = 1;
2169 ready->port = port;
2170 (void)tx_mutex_put(&ready->mutex);
2171 }
2172 #endif
2173
2174 if (ready_file) {
2175 #if !defined(NO_FILESYSTEM) || defined(FORCE_BUFFER_TEST) && \
2176 !defined(NETOS)
2177 XFILE srf = (XFILE)NULL;
2178 if (args)
2179 ready = args->signal;
2180
2181 if (ready) {
2182 srf = XFOPEN(ready->srfName, "w");
2183
2184 if (srf) {
2185 /* let’s write port sever is listening on to ready file
2186 external monitor can then do ephemeral ports by passing
2187 -p 0 to server on supported platforms with -R ready_file
2188 client can then wait for existence of ready_file and see
2189 which port the server is listening on. */
2190 LIBCALL_CHECK_RET(fprintf(srf, "%d\n", (int)port));
2191 fclose(srf);
2192 }
2193 }
2194 #endif
2195 }
2196 }
2197
2198 *clientfd = accept(*sockfd, (struct sockaddr*)client_addr,
2199 (ACCEPT_THIRD_T)client_len);
2200 if(WOLFSSL_SOCKET_IS_INVALID(*clientfd)) {
2201 err_sys_with_errno("tcp accept failed");
2202 }
2203 }
2204
2205
2206 static WC_INLINE void tcp_set_nonblocking(SOCKET_T* sockfd)
2207 {
2208 #ifdef USE_WINDOWS_API
2209 unsigned long blocking = 1;
2210 int ret = ioctlsocket(*sockfd, FIONBIO, &blocking);
2211 if (ret == SOCKET_ERROR)
2212 err_sys_with_errno("ioctlsocket failed");

NetBurner, Inc.
22.301 test.h 1397

2213 #elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET) \


2214 || defined (WOLFSSL_TIRTOS)|| defined(WOLFSSL_VXWORKS) \
2215 || defined(WOLFSSL_ZEPHYR)
2216 /* non blocking not supported, for now */
2217 #else
2218 int flags = fcntl(*sockfd, F_GETFL, 0);
2219 if (flags < 0)
2220 err_sys_with_errno("fcntl get failed");
2221 flags = fcntl(*sockfd, F_SETFL, flags | O_NONBLOCK);
2222 if (flags < 0)
2223 err_sys_with_errno("fcntl set failed");
2224 #endif
2225 }
2226
2227
2228 #ifndef NO_PSK
2229
2230 /* identity is OpenSSL testing default for openssl s_client, keep same */
2231 static const char* kIdentityStr = "Client_identity";
2232
2233 static WC_INLINE unsigned int my_psk_client_cb(WOLFSSL* ssl, const char* hint,
2234 char* identity, unsigned int id_max_len, unsigned char* key,
2235 unsigned int key_max_len)
2236 {
2237 (void)ssl;
2238 (void)hint;
2239 (void)key_max_len;
2240
2241 /* see internal.h MAX_PSK_ID_LEN for PSK identity limit */
2242 XSTRNCPY(identity, kIdentityStr, id_max_len);
2243
2244 if (wolfSSL_GetVersion(ssl) < WOLFSSL_TLSV1_3) {
2245 /* test key in hex is 0x1a2b3c4d , in decimal 439,041,101 , we’re using
2246 unsigned binary */
2247 key[0] = 0x1a;
2248 key[1] = 0x2b;
2249 key[2] = 0x3c;
2250 key[3] = 0x4d;
2251
2252 return 4; /* length of key in octets or 0 for error */
2253 }
2254 else {
2255 int i;
2256 int b = 0x01;
2257
2258 for (i = 0; i < 32; i++, b += 0x22) {
2259 if (b >= 0x100)
2260 b = 0x01;
2261 key[i] = b;
2262 }
2263
2264 return 32; /* length of key in octets or 0 for error */
2265 }
2266 }
2267
2268
2269 static WC_INLINE unsigned int my_psk_server_cb(WOLFSSL* ssl, const char* identity,
2270 unsigned char* key, unsigned int key_max_len)
2271 {
2272 (void)ssl;
2273 (void)key_max_len;
2274
2275 /* see internal.h MAX_PSK_ID_LEN for PSK identity limit */
2276 if (XSTRCMP(identity, kIdentityStr) != 0)
2277 return 0;
2278
2279 if (wolfSSL_GetVersion(ssl) < WOLFSSL_TLSV1_3) {
2280 /* test key in hex is 0x1a2b3c4d , in decimal 439,041,101 , we’re using
2281 unsigned binary */
2282 key[0] = 0x1a;
2283 key[1] = 0x2b;
2284 key[2] = 0x3c;
2285 key[3] = 0x4d;
2286
2287 return 4; /* length of key in octets or 0 for error */
2288 }
2289 else {
2290 int i;
2291 int b = 0x01;
2292
2293 for (i = 0; i < 32; i++, b += 0x22) {
2294 if (b >= 0x100)
2295 b = 0x01;
2296 key[i] = b;
2297 }
2298
2299 return 32; /* length of key in octets or 0 for error */

NetBurner, Inc.
1398 File Documentation

2300 }
2301 }
2302
2303 #ifdef WOLFSSL_TLS13
2304 static WC_INLINE unsigned int my_psk_client_tls13_cb(WOLFSSL* ssl,
2305 const char* hint, char* identity, unsigned int id_max_len,
2306 unsigned char* key, unsigned int key_max_len, const char** ciphersuite)
2307 {
2308 int i;
2309 int b = 0x01;
2310 const char* userCipher = (const char*)wolfSSL_get_psk_callback_ctx(ssl);
2311
2312 (void)ssl;
2313 (void)hint;
2314 (void)key_max_len;
2315
2316 /* see internal.h MAX_PSK_ID_LEN for PSK identity limit */
2317 XSTRNCPY(identity, kIdentityStr, id_max_len);
2318
2319 for (i = 0; i < 32; i++, b += 0x22) {
2320 if (b >= 0x100)
2321 b = 0x01;
2322 key[i] = b;
2323 }
2324
2325 *ciphersuite = userCipher ? userCipher : "TLS13-AES128-GCM-SHA256";
2326
2327 return 32; /* length of key in octets or 0 for error */
2328 }
2329
2330
2331 static WC_INLINE unsigned int my_psk_server_tls13_cb(WOLFSSL* ssl,
2332 const char* identity, unsigned char* key, unsigned int key_max_len,
2333 const char** ciphersuite)
2334 {
2335 int i;
2336 int b = 0x01;
2337 int kIdLen = (int)XSTRLEN(kIdentityStr);
2338 const char* userCipher = (const char*)wolfSSL_get_psk_callback_ctx(ssl);
2339
2340 (void)ssl;
2341 (void)key_max_len;
2342
2343 /* see internal.h MAX_PSK_ID_LEN for PSK identity limit */
2344 if (XSTRNCMP(identity, kIdentityStr, kIdLen) != 0)
2345 return 0;
2346 if (identity[kIdLen] != ’\0’) {
2347 userCipher = wolfSSL_get_cipher_name_by_hash(ssl, identity + kIdLen);
2348 }
2349
2350 for (i = 0; i < 32; i++, b += 0x22) {
2351 if (b >= 0x100)
2352 b = 0x01;
2353 key[i] = b;
2354 }
2355
2356 *ciphersuite = userCipher ? userCipher : "TLS13-AES128-GCM-SHA256";
2357
2358 return 32; /* length of key in octets or 0 for error */
2359 }
2360 #endif
2361
2362 #if defined(OPENSSL_ALL) && !defined(NO_CERTS) && \
2363 !defined(NO_FILESYSTEM)
2364 static unsigned char local_psk[32];
2365 #endif
2366 static WC_INLINE int my_psk_use_session_cb(WOLFSSL* ssl,
2367 const WOLFSSL_EVP_MD* md, const unsigned char **id,
2368 size_t* idlen, WOLFSSL_SESSION **sess)
2369 {
2370 #if defined(OPENSSL_ALL) && !defined(NO_CERTS) && \
2371 !defined(NO_FILESYSTEM)
2372 int i;
2373 int b = 0x01;
2374 WOLFSSL_SESSION* lsess;
2375 char buf[256];
2376 const char* cipher_id = "TLS13-AES128-GCM-SHA256";
2377 const SSL_CIPHER* cipher = NULL;
2378 STACK_OF(SSL_CIPHER) *supportedCiphers = NULL;
2379 int numCiphers = 0;
2380 (void)ssl;
2381 (void)md;
2382
2383 printf("use psk session callback \n");
2384
2385 lsess = SSL_SESSION_new();
2386 if (lsess == NULL) {

NetBurner, Inc.
22.301 test.h 1399

2387 return 0;
2388 }
2389 supportedCiphers = SSL_get_ciphers(ssl);
2390 numCiphers = sk_num(supportedCiphers);
2391
2392 for (i = 0; i < numCiphers; ++i) {
2393
2394 if ((cipher = (const WOLFSSL_CIPHER*)sk_value(supportedCiphers, i))) {
2395 SSL_CIPHER_description(cipher, buf, sizeof(buf));
2396 }
2397
2398 if (XMEMCMP(cipher_id, buf, XSTRLEN(cipher_id)) == 0) {
2399 break;
2400 }
2401 }
2402
2403 if (i != numCiphers) {
2404 SSL_SESSION_set_cipher(lsess, cipher);
2405 for (i = 0; i < 32; i++, b += 0x22) {
2406 if (b >= 0x100)
2407 b = 0x01;
2408 local_psk[i] = b;
2409 }
2410
2411 *id = local_psk;
2412 *idlen = 32;
2413 *sess = lsess;
2414
2415 return 1;
2416 }
2417 else {
2418 *id = NULL;
2419 *idlen = 0;
2420 *sess = NULL;
2421 SSL_SESSION_free(lsess);
2422 return 0;
2423 }
2424 #else
2425 (void)ssl;
2426 (void)md;
2427 (void)id;
2428 (void)idlen;
2429 (void)sess;
2430
2431 return 0;
2432 #endif
2433 }
2434
2435 static WC_INLINE unsigned int my_psk_client_cs_cb(WOLFSSL* ssl,
2436 const char* hint, char* identity, unsigned int id_max_len,
2437 unsigned char* key, unsigned int key_max_len, const char* ciphersuite)
2438 {
2439 int i;
2440 int b = 0x01;
2441
2442 (void)ssl;
2443 (void)hint;
2444 (void)key_max_len;
2445
2446 #ifdef WOLFSSL_PSK_MULTI_ID_PER_CS
2447 /* Multiple calls for each cipher suite. First identity byte indicates the
2448 * number of identites seen so far for cipher suite. */
2449 if (identity[0] != 0) {
2450 return 0;
2451 }
2452 #endif
2453
2454 /* see internal.h MAX_PSK_ID_LEN for PSK identity limit */
2455 XSTRNCPY(identity, kIdentityStr, id_max_len);
2456 XSTRNCAT(identity, ciphersuite + XSTRLEN(ciphersuite) - 6, id_max_len);
2457
2458 for (i = 0; i < 32; i++, b += 0x22) {
2459 if (b >= 0x100)
2460 b = 0x01;
2461 key[i] = b;
2462 }
2463
2464 return 32; /* length of key in octets or 0 for error */
2465 }
2466
2467 #endif /* !NO_PSK */
2468
2469
2470 #if defined(WOLFSSL_USER_CURRTIME)
2471 extern double current_time(int reset);
2472
2473 #elif defined(USE_WINDOWS_API)

NetBurner, Inc.
1400 File Documentation

2474
2475 #define WIN32_LEAN_AND_MEAN
2476 #include <windows.h>
2477
2478 static WC_INLINE double current_time(int reset)
2479 {
2480 static int init = 0;
2481 static LARGE_INTEGER freq;
2482
2483 LARGE_INTEGER count;
2484
2485 if (!init) {
2486 QueryPerformanceFrequency(&freq);
2487 init = 1;
2488 }
2489
2490 QueryPerformanceCounter(&count);
2491
2492 (void)reset;
2493 return (double)count.QuadPart / freq.QuadPart;
2494 }
2495
2496 #elif defined(WOLFSSL_TIRTOS)
2497 extern double current_time();
2498 #elif defined(WOLFSSL_ZEPHYR)
2499 extern double current_time();
2500 #else
2501
2502 #if !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_TCP_NET) && !defined(WOLFSSL_CHIBIOS)
2503 #ifndef NETOS
2504 #include <sys/time.h>
2505 #endif
2506
2507 static WC_INLINE double current_time(int reset)
2508 {
2509 struct timeval tv;
2510 if (gettimeofday(&tv, NULL) < 0)
2511 err_sys_with_errno("gettimeofday");
2512 (void)reset;
2513
2514 return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
2515 }
2516 #else
2517 extern double current_time(int reset);
2518 #endif
2519 #endif /* USE_WINDOWS_API */
2520
2521
2522 #if defined(HAVE_OCSP) && defined(WOLFSSL_NONBLOCK_OCSP)
2523 static WC_INLINE int OCSPIOCb(void* ioCtx, const char* url, int urlSz,
2524 unsigned char* request, int requestSz, unsigned char** response)
2525 {
2526 #ifdef TEST_NONBLOCK_CERTS
2527 static int ioCbCnt = 0;
2528 #endif
2529
2530 (void)ioCtx;
2531 (void)url;
2532 (void)urlSz;
2533 (void)request;
2534 (void)requestSz;
2535 (void)response;
2536
2537 #ifdef TEST_NONBLOCK_CERTS
2538 if (ioCbCnt) {
2539 ioCbCnt = 0;
2540 return EmbedOcspLookup(ioCtx, url, urlSz, request, requestSz, response);
2541 }
2542 else {
2543 ioCbCnt = 1;
2544 return WOLFSSL_CBIO_ERR_WANT_READ;
2545 }
2546 #else
2547 return EmbedOcspLookup(ioCtx, url, urlSz, request, requestSz, response);
2548 #endif
2549 }
2550
2551 static WC_INLINE void OCSPRespFreeCb(void* ioCtx, unsigned char* response)
2552 {
2553 EmbedOcspRespFree(ioCtx, response);
2554 }
2555 #endif
2556
2557 #if !defined(NO_CERTS)
2558 #if !defined(NO_FILESYSTEM) || \
2559 (defined(NO_FILESYSTEM) && defined(FORCE_BUFFER_TEST)) && \
2560 !defined(NETOS)

NetBurner, Inc.
22.301 test.h 1401

2561
2562 /* reads file size, allocates buffer, reads into buffer, returns buffer */
2563 static WC_INLINE int load_file(const char* fname, byte** buf, size_t* bufLen)
2564 {
2565 int ret;
2566 long int fileSz;
2567 XFILE lFile;
2568
2569 if (fname == NULL || buf == NULL || bufLen == NULL)
2570 return BAD_FUNC_ARG;
2571
2572 /* set defaults */
2573 *buf = NULL;
2574 *bufLen = 0;
2575
2576 /* open file (read-only binary) */
2577 lFile = XFOPEN(fname, "rb");
2578 if (!lFile) {
2579 fprintf(stderr, "Error loading %s\n", fname);
2580 return BAD_PATH_ERROR;
2581 }
2582
2583 LIBCALL_CHECK_RET(fseek(lFile, 0, SEEK_END));
2584 fileSz = (int)ftell(lFile);
2585 rewind(lFile);
2586 if (fileSz > 0) {
2587 *bufLen = (size_t)fileSz;
2588 *buf = (byte*)malloc(*bufLen);
2589 if (*buf == NULL) {
2590 ret = MEMORY_E;
2591 fprintf(stderr,
2592 "Error allocating %lu bytes\n", (unsigned long)*bufLen);
2593 }
2594 else {
2595 size_t readLen = fread(*buf, *bufLen, 1, lFile);
2596
2597 /* check response code */
2598 ret = (readLen > 0) ? 0 : -1;
2599 }
2600 }
2601 else {
2602 ret = BUFFER_E;
2603 }
2604 fclose(lFile);
2605
2606 return ret;
2607 }
2608
2609 enum {
2610 WOLFSSL_CA = 1,
2611 WOLFSSL_CERT = 2,
2612 WOLFSSL_KEY = 3,
2613 WOLFSSL_CERT_CHAIN = 4,
2614 };
2615
2616 static WC_INLINE void load_buffer(WOLFSSL_CTX* ctx, const char* fname, int type)
2617 {
2618 int format = WOLFSSL_FILETYPE_PEM;
2619 byte* buff = NULL;
2620 size_t sz = 0;
2621
2622 if (load_file(fname, &buff, &sz) != 0) {
2623 err_sys("can’t open file for buffer load "
2624 "Please run from wolfSSL home directory if not");
2625 }
2626
2627 /* determine format */
2628 if (strstr(fname, ".der"))
2629 format = WOLFSSL_FILETYPE_ASN1;
2630
2631 if (type == WOLFSSL_CA) {
2632 if (wolfSSL_CTX_load_verify_buffer(ctx, buff, (long)sz, format)
2633 != WOLFSSL_SUCCESS)
2634 err_sys("can’t load buffer ca file");
2635 }
2636 else if (type == WOLFSSL_CERT) {
2637 if (wolfSSL_CTX_use_certificate_buffer(ctx, buff, (long)sz,
2638 format) != WOLFSSL_SUCCESS)
2639 err_sys("can’t load buffer cert file");
2640 }
2641 else if (type == WOLFSSL_KEY) {
2642 if (wolfSSL_CTX_use_PrivateKey_buffer(ctx, buff, (long)sz,
2643 format) != WOLFSSL_SUCCESS)
2644 err_sys("can’t load buffer key file");
2645 }
2646 else if (type == WOLFSSL_CERT_CHAIN) {
2647 if (wolfSSL_CTX_use_certificate_chain_buffer_format(ctx, buff,

NetBurner, Inc.
1402 File Documentation

2648 (long)sz, format) != WOLFSSL_SUCCESS)


2649 err_sys("can’t load cert chain buffer");
2650 }
2651
2652 if (buff)
2653 free(buff);
2654 }
2655
2656 static WC_INLINE void load_ssl_buffer(WOLFSSL* ssl, const char* fname, int type)
2657 {
2658 int format = WOLFSSL_FILETYPE_PEM;
2659 byte* buff = NULL;
2660 size_t sz = 0;
2661
2662 if (load_file(fname, &buff, &sz) != 0) {
2663 err_sys("can’t open file for buffer load "
2664 "Please run from wolfSSL home directory if not");
2665 }
2666
2667 /* determine format */
2668 if (strstr(fname, ".der"))
2669 format = WOLFSSL_FILETYPE_ASN1;
2670
2671 if (type == WOLFSSL_CA) {
2672 /* verify certs (CA’s) use the shared ctx->cm (WOLFSSL_CERT_MANAGER) */
2673 WOLFSSL_CTX* ctx = wolfSSL_get_SSL_CTX(ssl);
2674 if (wolfSSL_CTX_load_verify_buffer(ctx, buff, (long)sz, format)
2675 != WOLFSSL_SUCCESS)
2676 err_sys("can’t load buffer ca file");
2677 }
2678 else if (type == WOLFSSL_CERT) {
2679 if (wolfSSL_use_certificate_buffer(ssl, buff, (long)sz,
2680 format) != WOLFSSL_SUCCESS)
2681 err_sys("can’t load buffer cert file");
2682 }
2683 else if (type == WOLFSSL_KEY) {
2684 if (wolfSSL_use_PrivateKey_buffer(ssl, buff, (long)sz,
2685 format) != WOLFSSL_SUCCESS)
2686 err_sys("can’t load buffer key file");
2687 }
2688 else if (type == WOLFSSL_CERT_CHAIN) {
2689 if (wolfSSL_use_certificate_chain_buffer_format(ssl, buff,
2690 (long)sz, format) != WOLFSSL_SUCCESS)
2691 err_sys("can’t load cert chain buffer");
2692 }
2693
2694 if (buff)
2695 free(buff);
2696 }
2697
2698 #ifdef TEST_PK_PRIVKEY
2699 static WC_INLINE int load_key_file(const char* fname, byte** derBuf, word32* derLen)
2700 {
2701 int ret;
2702 byte* buf = NULL;
2703 size_t bufLen;
2704
2705 ret = load_file(fname, &buf, &bufLen);
2706 if (ret != 0)
2707 return ret;
2708
2709 *derBuf = (byte*)malloc(bufLen);
2710 if (*derBuf == NULL) {
2711 free(buf);
2712 return MEMORY_E;
2713 }
2714
2715 ret = wc_KeyPemToDer(buf, (word32)bufLen, *derBuf, (word32)bufLen, NULL);
2716 if (ret < 0) {
2717 free(buf);
2718 free(*derBuf);
2719 return ret;
2720 }
2721 *derLen = ret;
2722 free(buf);
2723
2724 return 0;
2725 }
2726 #endif /* TEST_PK_PRIVKEY */
2727
2728 #endif /* !NO_FILESYSTEM || (NO_FILESYSTEM && FORCE_BUFFER_TEST) */
2729 #endif /* !NO_CERTS */
2730
2731 enum {
2732 VERIFY_OVERRIDE_ERROR,
2733 VERIFY_FORCE_FAIL,
2734 VERIFY_USE_PREVERFIY,

NetBurner, Inc.
22.301 test.h 1403

2735 VERIFY_OVERRIDE_DATE_ERR,
2736 };
2737 static THREAD_LS_T int myVerifyAction = VERIFY_OVERRIDE_ERROR;
2738
2739 /* The verify callback is called for every certificate only when
2740 * --enable-opensslextra is defined because it sets WOLFSSL_ALWAYS_VERIFY_CB and
2741 * WOLFSSL_VERIFY_CB_ALL_CERTS.
2742 * Normal cases of the verify callback only occur on certificate failures when the
2743 * wolfSSL_set_verify(ssl, SSL_VERIFY_PEER, myVerifyCb); is called
2744 */
2745
2746 static WC_INLINE int myVerify(int preverify, WOLFSSL_X509_STORE_CTX* store)
2747 {
2748 char buffer[WOLFSSL_MAX_ERROR_SZ];
2749 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
2750 WOLFSSL_X509* peer;
2751 #if defined(SHOW_CERTS) && !defined(NO_FILESYSTEM)
2752 WOLFSSL_BIO* bio = NULL;
2753 WOLFSSL_STACK* sk = NULL;
2754 X509* x509 = NULL;
2755 int i = 0;
2756 #endif
2757 #endif
2758 (void)preverify;
2759
2760 /* Verify Callback Arguments:
2761 * preverify: 1=Verify Okay, 0=Failure
2762 * store->error: Failure error code (0 indicates no failure)
2763 * store->current_cert: Current WOLFSSL_X509 object (only with OPENSSL_EXTRA)
2764 * store->error_depth: Current Index
2765 * store->domain: Subject CN as string (null term)
2766 * store->totalCerts: Number of certs presented by peer
2767 * store->certs[i]: A ‘WOLFSSL_BUFFER_INFO‘ with plain DER for each cert
2768 * store->store: WOLFSSL_X509_STORE with CA cert chain
2769 * store->store->cm: WOLFSSL_CERT_MANAGER
2770 * store->ex_data: The WOLFSSL object pointer
2771 * store->discardSessionCerts: When set to non-zero value session certs
2772 will be discarded (only with SESSION_CERTS)
2773 */
2774
2775 fprintf(stderr, "In verification callback, error = %d, %s\n", store->error,
2776 wolfSSL_ERR_error_string(store->error, buffer));
2777 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
2778 peer = store->current_cert;
2779 if (peer) {
2780 char* issuer = wolfSSL_X509_NAME_oneline(
2781 wolfSSL_X509_get_issuer_name(peer), 0, 0);
2782 char* subject = wolfSSL_X509_NAME_oneline(
2783 wolfSSL_X509_get_subject_name(peer), 0, 0);
2784 printf("\tPeer’s cert info:\n issuer : %s\n subject: %s\n", issuer,
2785 subject);
2786
2787 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
2788 /* preverify needs to be self-signer error for Qt compat.
2789 * Should be ASN_SELF_SIGNED_E */
2790 if (XSTRCMP(issuer, subject) == 0 && preverify == ASN_NO_SIGNER_E)
2791 return 0;
2792 #endif
2793
2794 XFREE(subject, 0, DYNAMIC_TYPE_OPENSSL);
2795 XFREE(issuer, 0, DYNAMIC_TYPE_OPENSSL);
2796 #if defined(SHOW_CERTS) && !defined(NO_FILESYSTEM)
2797 /* avoid printing duplicate certs */
2798 if (store->depth == 1) {
2799 /* retrieve x509 certs and display them on stdout */
2800 sk = wolfSSL_X509_STORE_GetCerts(store);
2801
2802 for (i = 0; i < wolfSSL_sk_X509_num(sk); i++) {
2803 x509 = wolfSSL_sk_X509_value(sk, i);
2804 bio = wolfSSL_BIO_new(wolfSSL_BIO_s_file());
2805 if (bio != NULL) {
2806 wolfSSL_BIO_set_fp(bio, stdout, BIO_NOCLOSE);
2807 wolfSSL_X509_print(bio, x509);
2808 wolfSSL_BIO_free(bio);
2809 }
2810 }
2811 wolfSSL_sk_X509_free(sk);
2812 }
2813 #endif
2814 }
2815 else
2816 fprintf(stderr, "\tPeer has no cert!\n");
2817 #else
2818 printf("\tPeer certs: %d\n", store->totalCerts);
2819 #ifdef SHOW_CERTS
2820 { int i;
2821 for (i=0; i<store->totalCerts; i++) {

NetBurner, Inc.
1404 File Documentation

2822 WOLFSSL_BUFFER_INFO* cert = &store->certs[i];


2823 printf("\t\tCert %d: Ptr %p, Len %u\n", i, cert->buffer, cert->length);
2824 }
2825 }
2826 #endif /* SHOW_CERTS */
2827 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
2828
2829 printf("\tSubject’s domain name at %d is %s\n", store->error_depth, store->domain);
2830
2831 /* Testing forced fail case by return zero */
2832 if (myVerifyAction == VERIFY_FORCE_FAIL) {
2833 return 0; /* test failure case */
2834 }
2835
2836 if (myVerifyAction == VERIFY_OVERRIDE_DATE_ERR &&
2837 (store->error == ASN_BEFORE_DATE_E || store->error == ASN_AFTER_DATE_E)) {
2838 printf("Overriding cert date error as example for bad clock testing\n");
2839 return 1;
2840 }
2841
2842 /* If error indicate we are overriding it for testing purposes */
2843 if (store->error != 0 && myVerifyAction == VERIFY_OVERRIDE_ERROR) {
2844 printf("\tAllowing failed certificate check, testing only "
2845 "(shouldn’t do this in production)\n");
2846 }
2847
2848 /* A non-zero return code indicates failure override */
2849 return (myVerifyAction == VERIFY_OVERRIDE_ERROR) ? 1 : preverify;
2850 }
2851
2852
2853 #ifdef HAVE_EXT_CACHE
2854
2855 static WC_INLINE WOLFSSL_SESSION* mySessGetCb(WOLFSSL* ssl,
2856 const unsigned char* id, int id_len, int* copy)
2857 {
2858 (void)ssl;
2859 (void)id;
2860 (void)id_len;
2861 (void)copy;
2862
2863 /* using internal cache, this is for testing only */
2864 return NULL;
2865 }
2866
2867 static WC_INLINE int mySessNewCb(WOLFSSL* ssl, WOLFSSL_SESSION* session)
2868 {
2869 (void)ssl;
2870 (void)session;
2871
2872 /* using internal cache, this is for testing only */
2873 return 0;
2874 }
2875
2876 static WC_INLINE void mySessRemCb(WOLFSSL_CTX* ctx, WOLFSSL_SESSION* session)
2877 {
2878 (void)ctx;
2879 (void)session;
2880
2881 /* using internal cache, this is for testing only */
2882 }
2883
2884 #endif /* HAVE_EXT_CACHE */
2885
2886
2887 #ifdef HAVE_CRL
2888
2889 static WC_INLINE void CRL_CallBack(const char* url)
2890 {
2891 printf("CRL callback url = %s\n", url);
2892 }
2893
2894 #endif
2895
2896 #ifndef NO_DH
2897 static WC_INLINE void SetDH(WOLFSSL* ssl)
2898 {
2899 /* dh1024 p */
2900 static const unsigned char p[] =
2901 {
2902 0xE6, 0x96, 0x9D, 0x3D, 0x49, 0x5B, 0xE3, 0x2C, 0x7C, 0xF1, 0x80, 0xC3,
2903 0xBD, 0xD4, 0x79, 0x8E, 0x91, 0xB7, 0x81, 0x82, 0x51, 0xBB, 0x05, 0x5E,
2904 0x2A, 0x20, 0x64, 0x90, 0x4A, 0x79, 0xA7, 0x70, 0xFA, 0x15, 0xA2, 0x59,
2905 0xCB, 0xD5, 0x23, 0xA6, 0xA6, 0xEF, 0x09, 0xC4, 0x30, 0x48, 0xD5, 0xA2,
2906 0x2F, 0x97, 0x1F, 0x3C, 0x20, 0x12, 0x9B, 0x48, 0x00, 0x0E, 0x6E, 0xDD,
2907 0x06, 0x1C, 0xBC, 0x05, 0x3E, 0x37, 0x1D, 0x79, 0x4E, 0x53, 0x27, 0xDF,
2908 0x61, 0x1E, 0xBB, 0xBE, 0x1B, 0xAC, 0x9B, 0x5C, 0x60, 0x44, 0xCF, 0x02,

NetBurner, Inc.
22.301 test.h 1405

2909 0x3D, 0x76, 0xE0, 0x5E, 0xEA, 0x9B, 0xAD, 0x99, 0x1B, 0x13, 0xA6, 0x3C,
2910 0x97, 0x4E, 0x9E, 0xF1, 0x83, 0x9E, 0xB5, 0xDB, 0x12, 0x51, 0x36, 0xF7,
2911 0x26, 0x2E, 0x56, 0xA8, 0x87, 0x15, 0x38, 0xDF, 0xD8, 0x23, 0xC6, 0x50,
2912 0x50, 0x85, 0xE2, 0x1F, 0x0D, 0xD5, 0xC8, 0x6B,
2913 };
2914
2915 /* dh1024 g */
2916 static const unsigned char g[] =
2917 {
2918 0x02,
2919 };
2920
2921 wolfSSL_SetTmpDH(ssl, p, sizeof(p), g, sizeof(g));
2922 }
2923
2924 static WC_INLINE void SetDHCtx(WOLFSSL_CTX* ctx)
2925 {
2926 /* dh1024 p */
2927 static const unsigned char p[] =
2928 {
2929 0xE6, 0x96, 0x9D, 0x3D, 0x49, 0x5B, 0xE3, 0x2C, 0x7C, 0xF1, 0x80, 0xC3,
2930 0xBD, 0xD4, 0x79, 0x8E, 0x91, 0xB7, 0x81, 0x82, 0x51, 0xBB, 0x05, 0x5E,
2931 0x2A, 0x20, 0x64, 0x90, 0x4A, 0x79, 0xA7, 0x70, 0xFA, 0x15, 0xA2, 0x59,
2932 0xCB, 0xD5, 0x23, 0xA6, 0xA6, 0xEF, 0x09, 0xC4, 0x30, 0x48, 0xD5, 0xA2,
2933 0x2F, 0x97, 0x1F, 0x3C, 0x20, 0x12, 0x9B, 0x48, 0x00, 0x0E, 0x6E, 0xDD,
2934 0x06, 0x1C, 0xBC, 0x05, 0x3E, 0x37, 0x1D, 0x79, 0x4E, 0x53, 0x27, 0xDF,
2935 0x61, 0x1E, 0xBB, 0xBE, 0x1B, 0xAC, 0x9B, 0x5C, 0x60, 0x44, 0xCF, 0x02,
2936 0x3D, 0x76, 0xE0, 0x5E, 0xEA, 0x9B, 0xAD, 0x99, 0x1B, 0x13, 0xA6, 0x3C,
2937 0x97, 0x4E, 0x9E, 0xF1, 0x83, 0x9E, 0xB5, 0xDB, 0x12, 0x51, 0x36, 0xF7,
2938 0x26, 0x2E, 0x56, 0xA8, 0x87, 0x15, 0x38, 0xDF, 0xD8, 0x23, 0xC6, 0x50,
2939 0x50, 0x85, 0xE2, 0x1F, 0x0D, 0xD5, 0xC8, 0x6B,
2940 };
2941
2942 /* dh1024 g */
2943 static const unsigned char g[] =
2944 {
2945 0x02,
2946 };
2947
2948 wolfSSL_CTX_SetTmpDH(ctx, p, sizeof(p), g, sizeof(g));
2949 }
2950 #endif /* NO_DH */
2951
2952 #ifndef NO_CERTS
2953
2954 static WC_INLINE void CaCb(unsigned char* der, int sz, int type)
2955 {
2956 (void)der;
2957 printf("Got CA cache add callback, derSz = %d, type = %d\n", sz, type);
2958 }
2959
2960 #endif /* !NO_CERTS */
2961
2962
2963 /* Wolf Root Directory Helper */
2964 /* KEIL-RL File System does not support relative directory */
2965 #if !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_FS) && !defined(WOLFSSL_TIRTOS)
2966 /* Maximum depth to search for WolfSSL root */
2967 #define MAX_WOLF_ROOT_DEPTH 5
2968
2969 static WC_INLINE int ChangeToWolfRoot(void)
2970 {
2971 #if !defined(NO_FILESYSTEM) || defined(FORCE_BUFFER_TEST) && \
2972 !defined(NETOS)
2973 int depth, res;
2974 XFILE keyFile;
2975 for(depth = 0; depth <= MAX_WOLF_ROOT_DEPTH; depth++) {
2976 keyFile = XFOPEN(dhParamFile, "rb");
2977 if (keyFile != NULL) {
2978 fclose(keyFile);
2979 return depth;
2980 }
2981 #ifdef USE_WINDOWS_API
2982 res = SetCurrentDirectoryA("..\\");
2983 #elif defined(NETOS)
2984 return 0;
2985 #else
2986 res = chdir("../");
2987 #endif
2988 if (res < 0) {
2989 printf("chdir to ../ failed!\n");
2990 break;
2991 }
2992 }
2993
2994 err_sys("wolf root not found");
2995 return -1;

NetBurner, Inc.
1406 File Documentation

2996 #else
2997 return 0;
2998 #endif
2999 }
3000 #endif /* !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_KEIL_FS) && !defined(WOLFSSL_TIRTOS) */
3001
3002 #ifdef HAVE_STACK_SIZE
3003
3004 typedef THREAD_RETURN WOLFSSL_THREAD (*thread_func)(void* args);
3005 #define STACK_CHECK_VAL 0x01
3006
3007 struct stack_size_debug_context {
3008 unsigned char *myStack;
3009 size_t stackSize;
3010 #ifdef HAVE_STACK_SIZE_VERBOSE
3011 size_t *stackSizeHWM_ptr;
3012 thread_func fn;
3013 void *args;
3014 #endif
3015 };
3016
3017 #ifdef HAVE_STACK_SIZE_VERBOSE
3018
3019 /* per-subtest stack high water mark tracking.
3020 *
3021 * enable with
3022 *
3023 * ./configure --enable-stacksize=verbose [...]
3024 */
3025
3026 static THREAD_RETURN debug_stack_size_verbose_shim(struct stack_size_debug_context *shim_args) {
3027 StackSizeCheck_myStack = shim_args->myStack;
3028 StackSizeCheck_stackSize = shim_args->stackSize;
3029 StackSizeCheck_stackSizeHWM_ptr = shim_args->stackSizeHWM_ptr;
3030 return shim_args->fn(shim_args->args);
3031 }
3032
3033 static WC_INLINE int StackSizeSetOffset(const char *funcname, void *p)
3034 {
3035 if (StackSizeCheck_myStack == NULL)
3036 return -BAD_FUNC_ARG;
3037
3038 StackSizeCheck_stackOffsetPointer = p;
3039
3040 printf("setting stack relative offset reference mark in %s to +%lu\n",
3041 funcname, (unsigned long)((char*)(StackSizeCheck_myStack +
3042 StackSizeCheck_stackSize) - (char *)p));
3043
3044 return 0;
3045 }
3046
3047 static WC_INLINE ssize_t StackSizeHWM(void)
3048 {
3049 size_t i;
3050 ssize_t used;
3051
3052 if (StackSizeCheck_myStack == NULL)
3053 return -BAD_FUNC_ARG;
3054
3055 for (i = 0; i < StackSizeCheck_stackSize; i++) {
3056 if (StackSizeCheck_myStack[i] != STACK_CHECK_VAL) {
3057 break;
3058 }
3059 }
3060
3061 used = StackSizeCheck_stackSize - i;
3062 if ((ssize_t)*StackSizeCheck_stackSizeHWM_ptr < used)
3063 *StackSizeCheck_stackSizeHWM_ptr = used;
3064
3065 return used;
3066 }
3067
3068 static WC_INLINE ssize_t StackSizeHWM_OffsetCorrected(void)
3069 {
3070 ssize_t used = StackSizeHWM();
3071 if (used < 0)
3072 return used;
3073 if (StackSizeCheck_stackOffsetPointer)
3074 used -= (ssize_t)(((char *)StackSizeCheck_myStack + StackSizeCheck_stackSize) - (char
*)StackSizeCheck_stackOffsetPointer);
3075 return used;
3076 }
3077
3078 static
3079 #ifdef __GNUC__
3080 __attribute__((unused)) __attribute__((noinline))
3081 #endif

NetBurner, Inc.
22.301 test.h 1407

3082 int StackSizeHWMReset(void)


3083 {
3084 volatile ssize_t i;
3085
3086 if (StackSizeCheck_myStack == NULL)
3087 return -BAD_FUNC_ARG;
3088
3089 for (i = (ssize_t)((char *)&i - (char *)StackSizeCheck_myStack) - (ssize_t)sizeof i - 1; i >= 0;
--i)
3090 {
3091 StackSizeCheck_myStack[i] = STACK_CHECK_VAL;
3092 }
3093
3094 return 0;
3095 }
3096
3097 #define STACK_SIZE_CHECKPOINT(...) ({ \
3098 ssize_t HWM = StackSizeHWM_OffsetCorrected(); \
3099 __VA_ARGS__; \
3100 printf(" relative stack peak usage = %ld bytes\n", (long int)HWM); \
3101 StackSizeHWMReset(); \
3102 })
3103
3104 #define STACK_SIZE_CHECKPOINT_WITH_MAX_CHECK(max, ...) ({ \
3105 ssize_t HWM = StackSizeHWM_OffsetCorrected(); \
3106 int _ret; \
3107 __VA_ARGS__; \
3108 printf(" relative stack peak usage = %ld bytes\n", (long int)HWM); \
3109 _ret = StackSizeHWMReset(); \
3110 if ((max >= 0) && (HWM > (ssize_t)(max))) { \
3111 fprintf(stderr, \
3112 " relative stack usage at %s L%d exceeds designated max %ld bytes.\n", \
3113 __FILE__, __LINE__, (long int)(max)); \
3114 _ret = -1; \
3115 } \
3116 _ret; \
3117 })
3118
3119
3120 #ifdef __GNUC__
3121 #define STACK_SIZE_INIT() (void)StackSizeSetOffset(__FUNCTION__, __builtin_frame_address(0))
3122 #endif
3123
3124 #endif /* HAVE_STACK_SIZE_VERBOSE */
3125
3126 static WC_INLINE int StackSizeCheck(func_args* args, thread_func tf)
3127 {
3128 size_t i;
3129 int ret;
3130 void* status;
3131 unsigned char* myStack = NULL;
3132 size_t stackSize = 1024*1024*2;
3133 pthread_attr_t myAttr;
3134 pthread_t threadId;
3135 #ifdef HAVE_STACK_SIZE_VERBOSE
3136 struct stack_size_debug_context shim_args;
3137 #endif
3138
3139 #ifdef PTHREAD_STACK_MIN
3140 if (stackSize < PTHREAD_STACK_MIN)
3141 stackSize = PTHREAD_STACK_MIN;
3142 #endif
3143
3144 ret = posix_memalign((void**)&myStack, sysconf(_SC_PAGESIZE), stackSize);
3145 if (ret != 0 || myStack == NULL) {
3146 err_sys_with_errno("posix_memalign failed\n");
3147 return -1;
3148 }
3149
3150 XMEMSET(myStack, STACK_CHECK_VAL, stackSize);
3151
3152 ret = pthread_attr_init(&myAttr);
3153 if (ret != 0)
3154 err_sys("attr_init failed");
3155
3156 ret = pthread_attr_setstack(&myAttr, myStack, stackSize);
3157 if (ret != 0)
3158 err_sys("attr_setstackaddr failed");
3159
3160 #ifdef HAVE_STACK_SIZE_VERBOSE
3161 StackSizeCheck_stackSizeHWM = 0;
3162 shim_args.myStack = myStack;
3163 shim_args.stackSize = stackSize;
3164 shim_args.stackSizeHWM_ptr = &StackSizeCheck_stackSizeHWM;
3165 shim_args.fn = tf;
3166 shim_args.args = args;
3167 ret = pthread_create(&threadId, &myAttr, (thread_func)debug_stack_size_verbose_shim, (void

NetBurner, Inc.
1408 File Documentation

*)&shim_args);
3168 #else
3169 ret = pthread_create(&threadId, &myAttr, tf, args);
3170 #endif
3171 if (ret != 0) {
3172 printf("ret = %d\n", ret);
3173 perror("pthread_create failed");
3174 exit(EXIT_FAILURE);
3175 }
3176
3177 ret = pthread_join(threadId, &status);
3178 if (ret != 0)
3179 err_sys("pthread_join failed");
3180
3181 for (i = 0; i < stackSize; i++) {
3182 if (myStack[i] != STACK_CHECK_VAL) {
3183 break;
3184 }
3185 }
3186
3187 free(myStack);
3188 #ifdef HAVE_STACK_SIZE_VERBOSE
3189 printf("stack used = %lu\n", StackSizeCheck_stackSizeHWM > (stackSize - i)
3190 ? (unsigned long)StackSizeCheck_stackSizeHWM
3191 : (unsigned long)(stackSize - i));
3192 #else
3193 {
3194 size_t used = stackSize - i;
3195 printf("stack used = %lu\n", (unsigned long)used);
3196 }
3197 #endif
3198
3199 return (int)((size_t)status);
3200 }
3201
3202 static WC_INLINE int StackSizeCheck_launch(func_args* args, thread_func tf, pthread_t *threadId, void
**stack_context)
3203 {
3204 int ret;
3205 unsigned char* myStack = NULL;
3206 size_t stackSize = 1024*1024*2;
3207 pthread_attr_t myAttr;
3208
3209 #ifdef PTHREAD_STACK_MIN
3210 if (stackSize < PTHREAD_STACK_MIN)
3211 stackSize = PTHREAD_STACK_MIN;
3212 #endif
3213
3214 struct stack_size_debug_context *shim_args = (struct stack_size_debug_context *)malloc(sizeof
*shim_args);
3215 if (! shim_args) {
3216 perror("malloc");
3217 exit(EXIT_FAILURE);
3218 }
3219
3220 ret = posix_memalign((void**)&myStack, sysconf(_SC_PAGESIZE), stackSize);
3221 if (ret != 0 || myStack == NULL) {
3222 err_sys_with_errno("posix_memalign failed\n");
3223 free(shim_args);
3224 return -1;
3225 }
3226
3227 XMEMSET(myStack, STACK_CHECK_VAL, stackSize);
3228
3229 ret = pthread_attr_init(&myAttr);
3230 if (ret != 0)
3231 err_sys("attr_init failed");
3232
3233 ret = pthread_attr_setstack(&myAttr, myStack, stackSize);
3234 if (ret != 0)
3235 err_sys("attr_setstackaddr failed");
3236
3237 shim_args->myStack = myStack;
3238 shim_args->stackSize = stackSize;
3239 #ifdef HAVE_STACK_SIZE_VERBOSE
3240 shim_args->stackSizeHWM_ptr = &StackSizeCheck_stackSizeHWM;
3241 shim_args->fn = tf;
3242 shim_args->args = args;
3243 ret = pthread_create(threadId, &myAttr, (thread_func)debug_stack_size_verbose_shim, (void
*)shim_args);
3244 #else
3245 ret = pthread_create(threadId, &myAttr, tf, args);
3246 #endif
3247 if (ret != 0) {
3248 fprintf(stderr,"pthread_create failed: %s",strerror(ret));
3249 exit(EXIT_FAILURE);
3250 }

NetBurner, Inc.
22.301 test.h 1409

3251
3252 *stack_context = (void *)shim_args;
3253
3254 return 0;
3255 }
3256
3257 static WC_INLINE int StackSizeCheck_reap(pthread_t threadId, void *stack_context)
3258 {
3259 struct stack_size_debug_context *shim_args = (struct stack_size_debug_context *)stack_context;
3260 size_t i;
3261 void *status;
3262 int ret = pthread_join(threadId, &status);
3263 if (ret != 0)
3264 err_sys("pthread_join failed");
3265
3266 for (i = 0; i < shim_args->stackSize; i++) {
3267 if (shim_args->myStack[i] != STACK_CHECK_VAL) {
3268 break;
3269 }
3270 }
3271
3272 free(shim_args->myStack);
3273 #ifdef HAVE_STACK_SIZE_VERBOSE
3274 printf("stack used = %lu\n",
3275 *shim_args->stackSizeHWM_ptr > (shim_args->stackSize - i)
3276 ? (unsigned long)*shim_args->stackSizeHWM_ptr
3277 : (unsigned long)(shim_args->stackSize - i));
3278 #else
3279 {
3280 size_t used = shim_args->stackSize - i;
3281 printf("stack used = %lu\n", (unsigned long)used);
3282 }
3283 #endif
3284 free(shim_args);
3285
3286 return (int)((size_t)status);
3287 }
3288
3289
3290 #endif /* HAVE_STACK_SIZE */
3291
3292 #ifndef STACK_SIZE_CHECKPOINT
3293 #define STACK_SIZE_CHECKPOINT(...) (__VA_ARGS__)
3294 #endif
3295 #ifndef STACK_SIZE_INIT
3296 #define STACK_SIZE_INIT()
3297 #endif
3298
3299 #ifdef STACK_TRAP
3300
3301 /* good settings
3302 --enable-debug --disable-shared C_EXTRA_FLAGS="-DUSER_TIME -DTFM_TIMING_RESISTANT
-DPOSITIVE_EXP_ONLY -DSTACK_TRAP"
3303
3304 */
3305
3306 #ifdef HAVE_STACK_SIZE
3307 /* client only for now, setrlimit will fail if pthread_create() called */
3308 /* STACK_SIZE does pthread_create() on client */
3309 #error "can’t use STACK_TRAP with STACK_SIZE, setrlimit will fail"
3310 #endif /* HAVE_STACK_SIZE */
3311
3312 static WC_INLINE void StackTrap(void)
3313 {
3314 struct rlimit rl;
3315 if (getrlimit(RLIMIT_STACK, &rl) != 0)
3316 err_sys_with_errno("getrlimit failed");
3317 printf("rlim_cur = %llu\n", rl.rlim_cur);
3318 rl.rlim_cur = 1024*21; /* adjust trap size here */
3319 if (setrlimit(RLIMIT_STACK, &rl) != 0)
3320 err_sys_with_errno("setrlimit failed");
3321 }
3322
3323 #else /* STACK_TRAP */
3324
3325 static WC_INLINE void StackTrap(void)
3326 {
3327 }
3328
3329 #endif /* STACK_TRAP */
3330
3331
3332 #if defined(ATOMIC_USER) && !defined(WOLFSSL_AEAD_ONLY)
3333
3334 /* Atomic Encrypt Context example */
3335 typedef struct AtomicEncCtx {
3336 int keySetup; /* have we done key setup yet */

NetBurner, Inc.
1410 File Documentation

3337 Aes aes; /* for aes example */


3338 } AtomicEncCtx;
3339
3340
3341 /* Atomic Decrypt Context example */
3342 typedef struct AtomicDecCtx {
3343 int keySetup; /* have we done key setup yet */
3344 Aes aes; /* for aes example */
3345 } AtomicDecCtx;
3346
3347 #if !defined(NO_HMAC) && !defined(NO_AES) && defined(HAVE_AES_CBC)
3348 static WC_INLINE int myMacEncryptCb(WOLFSSL* ssl, unsigned char* macOut,
3349 const unsigned char* macIn, unsigned int macInSz, int macContent,
3350 int macVerify, unsigned char* encOut, const unsigned char* encIn,
3351 unsigned int encSz, void* ctx)
3352 {
3353 int ret;
3354 Hmac hmac;
3355 byte myInner[WOLFSSL_TLS_HMAC_INNER_SZ];
3356 AtomicEncCtx* encCtx = (AtomicEncCtx*)ctx;
3357 const char* tlsStr = "TLS";
3358
3359 /* example supports (d)tls aes */
3360 if (wolfSSL_GetBulkCipher(ssl) != wolfssl_aes) {
3361 printf("myMacEncryptCb not using AES\n");
3362 return -1;
3363 }
3364
3365 if (strstr(wolfSSL_get_version(ssl), tlsStr) == NULL) {
3366 printf("myMacEncryptCb not using (D)TLS\n");
3367 return -1;
3368 }
3369
3370 /* hmac, not needed if aead mode */
3371 wolfSSL_SetTlsHmacInner(ssl, myInner, macInSz, macContent, macVerify);
3372
3373 ret = wc_HmacInit(&hmac, NULL, INVALID_DEVID);
3374 if (ret != 0)
3375 return ret;
3376 ret = wc_HmacSetKey(&hmac, wolfSSL_GetHmacType(ssl),
3377 wolfSSL_GetMacSecret(ssl, macVerify), wolfSSL_GetHmacSize(ssl));
3378 if (ret != 0)
3379 return ret;
3380 ret = wc_HmacUpdate(&hmac, myInner, sizeof(myInner));
3381 if (ret != 0)
3382 return ret;
3383 ret = wc_HmacUpdate(&hmac, macIn, macInSz);
3384 if (ret != 0)
3385 return ret;
3386 ret = wc_HmacFinal(&hmac, macOut);
3387 if (ret != 0)
3388 return ret;
3389
3390
3391 /* encrypt setup on first time */
3392 if (encCtx->keySetup == 0) {
3393 int keyLen = wolfSSL_GetKeySize(ssl);
3394 const byte* key;
3395 const byte* iv;
3396
3397 if (wolfSSL_GetSide(ssl) == WOLFSSL_CLIENT_END) {
3398 key = wolfSSL_GetClientWriteKey(ssl);
3399 iv = wolfSSL_GetClientWriteIV(ssl);
3400 }
3401 else {
3402 key = wolfSSL_GetServerWriteKey(ssl);
3403 iv = wolfSSL_GetServerWriteIV(ssl);
3404 }
3405
3406 ret = wc_AesSetKey(&encCtx->aes, key, keyLen, iv, AES_ENCRYPTION);
3407 if (ret != 0) {
3408 fprintf(stderr, "AesSetKey failed in myMacEncryptCb\n");
3409 return ret;
3410 }
3411 encCtx->keySetup = 1;
3412 }
3413
3414 /* encrypt */
3415 return wc_AesCbcEncrypt(&encCtx->aes, encOut, encIn, encSz);
3416 }
3417
3418 static WC_INLINE int myDecryptVerifyCb(WOLFSSL* ssl,
3419 unsigned char* decOut, const unsigned char* decIn,
3420 unsigned int decSz, int macContent, int macVerify,
3421 unsigned int* padSz, void* ctx)
3422 {
3423 AtomicDecCtx* decCtx = (AtomicDecCtx*)ctx;

NetBurner, Inc.
22.301 test.h 1411

3424 int ret = 0;


3425 int macInSz = 0;
3426 int ivExtra = 0;
3427 int digestSz = wolfSSL_GetHmacSize(ssl);
3428 unsigned int pad = 0;
3429 unsigned int padByte = 0;
3430 Hmac hmac;
3431 byte myInner[WOLFSSL_TLS_HMAC_INNER_SZ];
3432 byte verify[WC_MAX_DIGEST_SIZE];
3433 const char* tlsStr = "TLS";
3434
3435 /* example supports (d)tls aes */
3436 if (wolfSSL_GetBulkCipher(ssl) != wolfssl_aes) {
3437 printf("myMacEncryptCb not using AES\n");
3438 return -1;
3439 }
3440
3441 if (strstr(wolfSSL_get_version(ssl), tlsStr) == NULL) {
3442 printf("myMacEncryptCb not using (D)TLS\n");
3443 return -1;
3444 }
3445
3446 /*decrypt */
3447 if (decCtx->keySetup == 0) {
3448 int keyLen = wolfSSL_GetKeySize(ssl);
3449 const byte* key;
3450 const byte* iv;
3451
3452 /* decrypt is from other side (peer) */
3453 if (wolfSSL_GetSide(ssl) == WOLFSSL_SERVER_END) {
3454 key = wolfSSL_GetClientWriteKey(ssl);
3455 iv = wolfSSL_GetClientWriteIV(ssl);
3456 }
3457 else {
3458 key = wolfSSL_GetServerWriteKey(ssl);
3459 iv = wolfSSL_GetServerWriteIV(ssl);
3460 }
3461
3462 ret = wc_AesSetKey(&decCtx->aes, key, keyLen, iv, AES_DECRYPTION);
3463 if (ret != 0) {
3464 fprintf(stderr, "AesSetKey failed in myDecryptVerifyCb\n");
3465 return ret;
3466 }
3467 decCtx->keySetup = 1;
3468 }
3469
3470 /* decrypt */
3471 ret = wc_AesCbcDecrypt(&decCtx->aes, decOut, decIn, decSz);
3472 if (ret != 0)
3473 return ret;
3474
3475 if (wolfSSL_GetCipherType(ssl) == WOLFSSL_AEAD_TYPE) {
3476 *padSz = wolfSSL_GetAeadMacSize(ssl);
3477 return 0; /* hmac, not needed if aead mode */
3478 }
3479
3480 if (wolfSSL_GetCipherType(ssl) == WOLFSSL_BLOCK_TYPE) {
3481 pad = *(decOut + decSz - 1);
3482 padByte = 1;
3483 if (wolfSSL_IsTLSv1_1(ssl))
3484 ivExtra = wolfSSL_GetCipherBlockSize(ssl);
3485 }
3486
3487 *padSz = wolfSSL_GetHmacSize(ssl) + pad + padByte;
3488 macInSz = decSz - ivExtra - digestSz - pad - padByte;
3489
3490 wolfSSL_SetTlsHmacInner(ssl, myInner, macInSz, macContent, macVerify);
3491
3492 ret = wc_HmacInit(&hmac, NULL, INVALID_DEVID);
3493 if (ret != 0)
3494 return ret;
3495 ret = wc_HmacSetKey(&hmac, wolfSSL_GetHmacType(ssl),
3496 wolfSSL_GetMacSecret(ssl, macVerify), digestSz);
3497 if (ret != 0)
3498 return ret;
3499 ret = wc_HmacUpdate(&hmac, myInner, sizeof(myInner));
3500 if (ret != 0)
3501 return ret;
3502 ret = wc_HmacUpdate(&hmac, decOut + ivExtra, macInSz);
3503 if (ret != 0)
3504 return ret;
3505 ret = wc_HmacFinal(&hmac, verify);
3506 if (ret != 0)
3507 return ret;
3508
3509 if (XMEMCMP(verify, decOut + decSz - digestSz - pad - padByte,
3510 digestSz) != 0) {

NetBurner, Inc.
1412 File Documentation

3511 printf("myDecryptVerify verify failed\n");


3512 return -1;
3513 }
3514
3515 return ret;
3516 }
3517
3518 #ifdef HAVE_ENCRYPT_THEN_MAC
3519
3520 static WC_INLINE int myEncryptMacCb(WOLFSSL* ssl, unsigned char* macOut,
3521 int content, int macVerify, unsigned char* encOut,
3522 const unsigned char* encIn, unsigned int encSz, void* ctx)
3523 {
3524 int ret;
3525 Hmac hmac;
3526 AtomicEncCtx* encCtx = (AtomicEncCtx*)ctx;
3527 byte myInner[WOLFSSL_TLS_HMAC_INNER_SZ];
3528 const char* tlsStr = "TLS";
3529
3530 /* example supports (d)tls aes */
3531 if (wolfSSL_GetBulkCipher(ssl) != wolfssl_aes) {
3532 printf("myMacEncryptCb not using AES\n");
3533 return -1;
3534 }
3535
3536 if (strstr(wolfSSL_get_version(ssl), tlsStr) == NULL) {
3537 printf("myMacEncryptCb not using (D)TLS\n");
3538 return -1;
3539 }
3540
3541 /* encrypt setup on first time */
3542 if (encCtx->keySetup == 0) {
3543 int keyLen = wolfSSL_GetKeySize(ssl);
3544 const byte* key;
3545 const byte* iv;
3546
3547 if (wolfSSL_GetSide(ssl) == WOLFSSL_CLIENT_END) {
3548 key = wolfSSL_GetClientWriteKey(ssl);
3549 iv = wolfSSL_GetClientWriteIV(ssl);
3550 }
3551 else {
3552 key = wolfSSL_GetServerWriteKey(ssl);
3553 iv = wolfSSL_GetServerWriteIV(ssl);
3554 }
3555
3556 ret = wc_AesSetKey(&encCtx->aes, key, keyLen, iv, AES_ENCRYPTION);
3557 if (ret != 0) {
3558 fprintf(stderr, "AesSetKey failed in myMacEncryptCb\n");
3559 return ret;
3560 }
3561 encCtx->keySetup = 1;
3562 }
3563
3564 /* encrypt */
3565 ret = wc_AesCbcEncrypt(&encCtx->aes, encOut, encIn, encSz);
3566 if (ret != 0)
3567 return ret;
3568
3569 /* Reconstruct record header. */
3570 wolfSSL_SetTlsHmacInner(ssl, myInner, encSz, content, macVerify);
3571
3572 ret = wc_HmacInit(&hmac, NULL, INVALID_DEVID);
3573 if (ret != 0)
3574 return ret;
3575 ret = wc_HmacSetKey(&hmac, wolfSSL_GetHmacType(ssl),
3576 wolfSSL_GetMacSecret(ssl, macVerify), wolfSSL_GetHmacSize(ssl));
3577 if (ret != 0)
3578 return ret;
3579 ret = wc_HmacUpdate(&hmac, myInner, sizeof(myInner));
3580 if (ret != 0)
3581 return ret;
3582 ret = wc_HmacUpdate(&hmac, encOut, encSz);
3583 if (ret != 0)
3584 return ret;
3585 return wc_HmacFinal(&hmac, macOut);
3586 }
3587
3588
3589 static WC_INLINE int myVerifyDecryptCb(WOLFSSL* ssl,
3590 unsigned char* decOut, const unsigned char* decIn,
3591 unsigned int decSz, int content, int macVerify,
3592 unsigned int* padSz, void* ctx)
3593 {
3594 AtomicDecCtx* decCtx = (AtomicDecCtx*)ctx;
3595 int ret = 0;
3596 int digestSz = wolfSSL_GetHmacSize(ssl);
3597 Hmac hmac;

NetBurner, Inc.
22.301 test.h 1413

3598 byte myInner[WOLFSSL_TLS_HMAC_INNER_SZ];


3599 byte verify[WC_MAX_DIGEST_SIZE];
3600 const char* tlsStr = "TLS";
3601
3602 /* example supports (d)tls aes */
3603 if (wolfSSL_GetBulkCipher(ssl) != wolfssl_aes) {
3604 printf("myMacEncryptCb not using AES\n");
3605 return -1;
3606 }
3607
3608 if (strstr(wolfSSL_get_version(ssl), tlsStr) == NULL) {
3609 printf("myMacEncryptCb not using (D)TLS\n");
3610 return -1;
3611 }
3612
3613 /* Reconstruct record header. */
3614 wolfSSL_SetTlsHmacInner(ssl, myInner, decSz, content, macVerify);
3615
3616 ret = wc_HmacInit(&hmac, NULL, INVALID_DEVID);
3617 if (ret != 0)
3618 return ret;
3619 ret = wc_HmacSetKey(&hmac, wolfSSL_GetHmacType(ssl),
3620 wolfSSL_GetMacSecret(ssl, macVerify), digestSz);
3621 if (ret != 0)
3622 return ret;
3623 ret = wc_HmacUpdate(&hmac, myInner, sizeof(myInner));
3624 if (ret != 0)
3625 return ret;
3626 ret = wc_HmacUpdate(&hmac, decIn, decSz);
3627 if (ret != 0)
3628 return ret;
3629 ret = wc_HmacFinal(&hmac, verify);
3630 if (ret != 0)
3631 return ret;
3632
3633 if (XMEMCMP(verify, decOut + decSz, digestSz) != 0) {
3634 printf("myDecryptVerify verify failed\n");
3635 return -1;
3636 }
3637
3638 /* decrypt */
3639 if (decCtx->keySetup == 0) {
3640 int keyLen = wolfSSL_GetKeySize(ssl);
3641 const byte* key;
3642 const byte* iv;
3643
3644 /* decrypt is from other side (peer) */
3645 if (wolfSSL_GetSide(ssl) == WOLFSSL_SERVER_END) {
3646 key = wolfSSL_GetClientWriteKey(ssl);
3647 iv = wolfSSL_GetClientWriteIV(ssl);
3648 }
3649 else {
3650 key = wolfSSL_GetServerWriteKey(ssl);
3651 iv = wolfSSL_GetServerWriteIV(ssl);
3652 }
3653
3654 ret = wc_AesSetKey(&decCtx->aes, key, keyLen, iv, AES_DECRYPTION);
3655 if (ret != 0) {
3656 fprintf(stderr, "AesSetKey failed in myDecryptVerifyCb\n");
3657 return ret;
3658 }
3659 decCtx->keySetup = 1;
3660 }
3661
3662 /* decrypt */
3663 ret = wc_AesCbcDecrypt(&decCtx->aes, decOut, decIn, decSz);
3664 if (ret != 0)
3665 return ret;
3666
3667 *padSz = *(decOut + decSz - 1) + 1;
3668
3669 return 0;
3670 }
3671
3672 #endif /* HAVE_ENCRYPT_THEN_MAC */
3673 #endif /* !NO_HMAC && !NO_AES && HAVE_AES_CBC */
3674
3675
3676 static WC_INLINE void SetupAtomicUser(WOLFSSL_CTX* ctx, WOLFSSL* ssl)
3677 {
3678 AtomicEncCtx* encCtx;
3679 AtomicDecCtx* decCtx;
3680
3681 encCtx = (AtomicEncCtx*)malloc(sizeof(AtomicEncCtx));
3682 if (encCtx == NULL)
3683 err_sys_with_errno("AtomicEncCtx malloc failed");
3684 XMEMSET(encCtx, 0, sizeof(AtomicEncCtx));

NetBurner, Inc.
1414 File Documentation

3685
3686 decCtx = (AtomicDecCtx*)malloc(sizeof(AtomicDecCtx));
3687 if (decCtx == NULL) {
3688 free(encCtx);
3689 err_sys_with_errno("AtomicDecCtx malloc failed");
3690 }
3691 XMEMSET(decCtx, 0, sizeof(AtomicDecCtx));
3692
3693 #if !defined(NO_HMAC) && !defined(NO_AES) && defined(HAVE_AES_CBC)
3694 wolfSSL_CTX_SetMacEncryptCb(ctx, myMacEncryptCb);
3695 wolfSSL_SetMacEncryptCtx(ssl, encCtx);
3696
3697 wolfSSL_CTX_SetDecryptVerifyCb(ctx, myDecryptVerifyCb);
3698 wolfSSL_SetDecryptVerifyCtx(ssl, decCtx);
3699
3700 #ifdef HAVE_ENCRYPT_THEN_MAC
3701 wolfSSL_CTX_SetEncryptMacCb(ctx, myEncryptMacCb);
3702 wolfSSL_SetEncryptMacCtx(ssl, encCtx);
3703
3704 wolfSSL_CTX_SetVerifyDecryptCb(ctx, myVerifyDecryptCb);
3705 wolfSSL_SetVerifyDecryptCtx(ssl, decCtx);
3706 #endif
3707 #else
3708 (void)ctx;
3709 (void)ssl;
3710 #endif
3711 }
3712
3713
3714 static WC_INLINE void FreeAtomicUser(WOLFSSL* ssl)
3715 {
3716 AtomicEncCtx* encCtx = (AtomicEncCtx*)wolfSSL_GetMacEncryptCtx(ssl);
3717 AtomicDecCtx* decCtx = (AtomicDecCtx*)wolfSSL_GetDecryptVerifyCtx(ssl);
3718
3719 /* Encrypt-Then-MAC callbacks use same contexts. */
3720
3721 if (encCtx != NULL) {
3722 if (encCtx->keySetup == 1)
3723 wc_AesFree(&encCtx->aes);
3724 free(encCtx);
3725 }
3726 if (decCtx != NULL) {
3727 if (decCtx->keySetup == 1)
3728 wc_AesFree(&decCtx->aes);
3729 free(decCtx);
3730 }
3731 }
3732
3733 #endif /* ATOMIC_USER */
3734
3735 #ifdef WOLFSSL_STATIC_MEMORY
3736 static WC_INLINE int wolfSSL_PrintStats(WOLFSSL_MEM_STATS* stats)
3737 {
3738 word16 i;
3739
3740 if (stats == NULL) {
3741 return 0;
3742 }
3743
3744 /* print to stderr so is on the same pipe as WOLFSSL_DEBUG */
3745 fprintf(stderr, "Total mallocs = %d\n", stats->totalAlloc);
3746 fprintf(stderr, "Total frees = %d\n", stats->totalFr);
3747 fprintf(stderr, "Current mallocs = %d\n", stats->curAlloc);
3748 fprintf(stderr, "Available IO = %d\n", stats->avaIO);
3749 fprintf(stderr, "Max con. handshakes = %d\n", stats->maxHa);
3750 fprintf(stderr, "Max con. IO = %d\n", stats->maxIO);
3751 fprintf(stderr, "State of memory blocks: size : available \n");
3752 for (i = 0; i < WOLFMEM_MAX_BUCKETS; i++) {
3753 fprintf(stderr, " : %d\t : %d\n", stats->blockSz[i],
3754 stats->avaBlock[i]);
3755 }
3756
3757 return 1;
3758 }
3759
3760 static WC_INLINE int wolfSSL_PrintStatsConn(WOLFSSL_MEM_CONN_STATS* stats)
3761 {
3762 if (stats == NULL) {
3763 return 0;
3764 }
3765
3766 fprintf(stderr, "peak connection memory = %d\n", stats->peakMem);
3767 fprintf(stderr, "current memory in use = %d\n", stats->curMem);
3768 fprintf(stderr, "peak connection allocs = %d\n", stats->peakAlloc);
3769 fprintf(stderr, "current connection allocs = %d\n",stats->curAlloc);
3770 fprintf(stderr, "total connection allocs = %d\n", stats->totalAlloc);
3771 fprintf(stderr, "total connection frees = %d\n\n", stats->totalFr);

NetBurner, Inc.
22.301 test.h 1415

3772
3773 return 1;
3774 }
3775 #endif /* WOLFSSL_STATIC_MEMORY */
3776
3777 #ifdef HAVE_PK_CALLBACKS
3778
3779 typedef struct PkCbInfo {
3780 const char* ourKey;
3781 #ifdef TEST_PK_PRIVKEY
3782 union {
3783 #ifdef HAVE_ECC
3784 /* only ECC PK callback with TLS v1.2 needs this */
3785 ecc_key ecc;
3786 #endif
3787 } keyGen;
3788 int hasKeyGen;
3789 #endif
3790 } PkCbInfo;
3791
3792 #if defined(DEBUG_PK_CB) || defined(TEST_PK_PRIVKEY)
3793 #define WOLFSSL_PKMSG(...) printf(__VA_ARGS__)
3794 #else
3795 #define WOLFSSL_PKMSG(...)
3796 #endif
3797
3798 #ifdef HAVE_ECC
3799
3800 static WC_INLINE int myEccKeyGen(WOLFSSL* ssl, ecc_key* key, word32 keySz,
3801 int ecc_curve, void* ctx)
3802 {
3803 int ret;
3804 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
3805 ecc_key* new_key;
3806
3807 #ifdef TEST_PK_PRIVKEY
3808 new_key = cbInfo ? &cbInfo->keyGen.ecc : key;
3809 #else
3810 new_key = key;
3811 #endif
3812
3813 (void)ssl;
3814 (void)cbInfo;
3815
3816 WOLFSSL_PKMSG("PK ECC KeyGen: keySz %u, Curve ID %d\n", keySz, ecc_curve);
3817
3818 ret = wc_ecc_init(new_key);
3819 if (ret == 0) {
3820 WC_RNG *rng = wolfSSL_GetRNG(ssl);
3821
3822 /* create new key */
3823 ret = wc_ecc_make_key_ex(rng, keySz, new_key, ecc_curve);
3824
3825 #ifdef TEST_PK_PRIVKEY
3826 if (ret == 0 && new_key != key) {
3827 byte qx[MAX_ECC_BYTES], qy[MAX_ECC_BYTES];
3828 word32 qxLen = sizeof(qx), qyLen = sizeof(qy);
3829
3830 /* extract public portion from new key into ‘key‘ arg */
3831 ret = wc_ecc_export_public_raw(new_key, qx, &qxLen, qy, &qyLen);
3832 if (ret == 0) {
3833 /* load public portion only into key */
3834 ret = wc_ecc_import_unsigned(key, qx, qy, NULL, ecc_curve);
3835 }
3836 (void)qxLen;
3837 (void)qyLen;
3838 }
3839 if (ret == 0 && cbInfo != NULL) {
3840 cbInfo->hasKeyGen = 1;
3841 }
3842 #endif
3843 }
3844
3845 WOLFSSL_PKMSG("PK ECC KeyGen: ret %d\n", ret);
3846
3847 return ret;
3848 }
3849
3850 static WC_INLINE int myEccSign(WOLFSSL* ssl, const byte* in, word32 inSz,
3851 byte* out, word32* outSz, const byte* key, word32 keySz, void* ctx)
3852 {
3853 int ret;
3854 word32 idx = 0;
3855 ecc_key myKey;
3856 byte* keyBuf = (byte*)key;
3857 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
3858

NetBurner, Inc.
1416 File Documentation

3859 (void)ssl;
3860 (void)cbInfo;
3861
3862 WOLFSSL_PKMSG("PK ECC Sign: inSz %u, keySz %u\n", inSz, keySz);
3863
3864 #ifdef TEST_PK_PRIVKEY
3865 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
3866 if (ret != 0)
3867 return ret;
3868 #endif
3869
3870 ret = wc_ecc_init(&myKey);
3871 if (ret == 0) {
3872 ret = wc_EccPrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
3873 if (ret == 0) {
3874 WC_RNG *rng = wolfSSL_GetRNG(ssl);
3875
3876 WOLFSSL_PKMSG("PK ECC Sign: Curve ID %d\n", myKey.dp->id);
3877 ret = wc_ecc_sign_hash(in, inSz, out, outSz, rng, &myKey);
3878 }
3879 wc_ecc_free(&myKey);
3880 }
3881
3882 #ifdef TEST_PK_PRIVKEY
3883 free(keyBuf);
3884 #endif
3885
3886 WOLFSSL_PKMSG("PK ECC Sign: ret %d outSz %u\n", ret, *outSz);
3887
3888 return ret;
3889 }
3890
3891
3892 static WC_INLINE int myEccVerify(WOLFSSL* ssl, const byte* sig, word32 sigSz,
3893 const byte* hash, word32 hashSz, const byte* key, word32 keySz,
3894 int* result, void* ctx)
3895 {
3896 int ret;
3897 word32 idx = 0;
3898 ecc_key myKey;
3899 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
3900
3901 (void)ssl;
3902 (void)cbInfo;
3903
3904 WOLFSSL_PKMSG("PK ECC Verify: sigSz %u, hashSz %u, keySz %u\n", sigSz, hashSz, keySz);
3905
3906 ret = wc_ecc_init(&myKey);
3907 if (ret == 0) {
3908 ret = wc_EccPublicKeyDecode(key, &idx, &myKey, keySz);
3909 if (ret == 0)
3910 ret = wc_ecc_verify_hash(sig, sigSz, hash, hashSz, result, &myKey);
3911 wc_ecc_free(&myKey);
3912 }
3913
3914 WOLFSSL_PKMSG("PK ECC Verify: ret %d, result %d\n", ret, *result);
3915
3916 return ret;
3917 }
3918
3919 static WC_INLINE int myEccSharedSecret(WOLFSSL* ssl, ecc_key* otherKey,
3920 unsigned char* pubKeyDer, unsigned int* pubKeySz,
3921 unsigned char* out, unsigned int* outlen,
3922 int side, void* ctx)
3923 {
3924 int ret;
3925 ecc_key* privKey = NULL;
3926 ecc_key* pubKey = NULL;
3927 ecc_key tmpKey;
3928 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
3929
3930 (void)ssl;
3931 (void)cbInfo;
3932
3933 WOLFSSL_PKMSG("PK ECC PMS: Side %s, Peer Curve %d\n",
3934 side == WOLFSSL_CLIENT_END ? "client" : "server", otherKey->dp->id);
3935
3936 ret = wc_ecc_init(&tmpKey);
3937 if (ret != 0) {
3938 return ret;
3939 }
3940
3941 /* for client: create and export public key */
3942 if (side == WOLFSSL_CLIENT_END) {
3943 #ifdef TEST_PK_PRIVKEY
3944 privKey = cbInfo ? &cbInfo->keyGen.ecc : &tmpKey;
3945 #else

NetBurner, Inc.
22.301 test.h 1417

3946 privKey = &tmpKey;


3947 #endif
3948 pubKey = otherKey;
3949
3950 /* TLS v1.2 and older we must generate a key here for the client ony.
3951 * TLS v1.3 calls key gen early with key share */
3952 if (wolfSSL_GetVersion(ssl) < WOLFSSL_TLSV1_3) {
3953 ret = myEccKeyGen(ssl, privKey, 0, otherKey->dp->id, ctx);
3954 if (ret == 0) {
3955 ret = wc_ecc_export_x963(privKey, pubKeyDer, pubKeySz);
3956 }
3957 }
3958 }
3959
3960 /* for server: import public key */
3961 else if (side == WOLFSSL_SERVER_END) {
3962 #ifdef TEST_PK_PRIVKEY
3963 privKey = cbInfo ? &cbInfo->keyGen.ecc : otherKey;
3964 #else
3965 privKey = otherKey;
3966 #endif
3967 pubKey = &tmpKey;
3968
3969 ret = wc_ecc_import_x963_ex(pubKeyDer, *pubKeySz, pubKey,
3970 otherKey->dp->id);
3971 }
3972 else {
3973 ret = BAD_FUNC_ARG;
3974 }
3975
3976 if (privKey == NULL || pubKey == NULL) {
3977 ret = BAD_FUNC_ARG;
3978 }
3979
3980 #if defined(ECC_TIMING_RESISTANT) && !defined(HAVE_FIPS) && \
3981 !defined(HAVE_SELFTEST)
3982 if (ret == 0) {
3983 ret = wc_ecc_set_rng(privKey, wolfSSL_GetRNG(ssl));
3984 }
3985 #endif
3986
3987 /* generate shared secret and return it */
3988 if (ret == 0) {
3989 ret = wc_ecc_shared_secret(privKey, pubKey, out, outlen);
3990
3991 #ifdef WOLFSSL_ASYNC_CRYPT
3992 if (ret == WC_PENDING_E) {
3993 ret = wc_AsyncWait(ret, &privKey->asyncDev, WC_ASYNC_FLAG_CALL_AGAIN);
3994 }
3995 #endif
3996 }
3997
3998 #ifdef TEST_PK_PRIVKEY
3999 if (cbInfo && cbInfo->hasKeyGen) {
4000 wc_ecc_free(&cbInfo->keyGen.ecc);
4001 cbInfo->hasKeyGen = 0;
4002 }
4003 #endif
4004
4005 wc_ecc_free(&tmpKey);
4006
4007 WOLFSSL_PKMSG("PK ECC PMS: ret %d, PubKeySz %u, OutLen %u\n", ret, *pubKeySz, *outlen);
4008
4009 return ret;
4010 }
4011
4012 #endif /* HAVE_ECC */
4013
4014 #ifdef HAVE_HKDF
4015 static WC_INLINE int myHkdfExtract(byte* prk, const byte* salt, word32 saltLen,
4016 byte* ikm, word32 ikmLen, int digest, void* ctx)
4017 {
4018 int ret;
4019 int len = 0;
4020
4021 switch (digest) {
4022 #ifndef NO_SHA256
4023 case WC_SHA256:
4024 len = WC_SHA256_DIGEST_SIZE;
4025 break;
4026 #endif
4027
4028 #ifdef WOLFSSL_SHA384
4029 case WC_SHA384:
4030 len = WC_SHA384_DIGEST_SIZE;
4031 break;
4032 #endif

NetBurner, Inc.
1418 File Documentation

4033
4034 #ifdef WOLFSSL_TLS13_SHA512
4035 case WC_SHA512:
4036 len = WC_SHA512_DIGEST_SIZE;
4037 break;
4038 #endif
4039 default:
4040 return BAD_FUNC_ARG;
4041 }
4042
4043 /* When length is 0 then use zeroed data of digest length. */
4044 if (ikmLen == 0) {
4045 ikmLen = len;
4046 XMEMSET(ikm, 0, len);
4047 }
4048
4049 (void)ctx;
4050 ret = wc_HKDF_Extract(digest, salt, saltLen, ikm, ikmLen, prk);
4051 WOLFSSL_PKMSG("PK HKDF Extract: ret %d saltLen %d ikmLen %d\n", ret, saltLen,
4052 ikmLen);
4053 return ret;
4054 }
4055 #endif /* HAVE_HKDF */
4056
4057 #if defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT)
4058 #ifdef HAVE_ED25519_SIGN
4059 static WC_INLINE int myEd25519Sign(WOLFSSL* ssl, const byte* in, word32 inSz,
4060 byte* out, word32* outSz, const byte* key, word32 keySz, void* ctx)
4061 {
4062 int ret;
4063 word32 idx = 0;
4064 ed25519_key myKey;
4065 byte* keyBuf = (byte*)key;
4066 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4067
4068 (void)ssl;
4069 (void)cbInfo;
4070
4071 WOLFSSL_PKMSG("PK 25519 Sign: inSz %d, keySz %d\n", inSz, keySz);
4072
4073 #ifdef TEST_PK_PRIVKEY
4074 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
4075 if (ret != 0)
4076 return ret;
4077 #endif
4078
4079 ret = wc_ed25519_init(&myKey);
4080 if (ret == 0) {
4081 ret = wc_Ed25519PrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
4082 if (ret == 0) {
4083 ret = wc_ed25519_make_public(&myKey, myKey.p, ED25519_PUB_KEY_SIZE);
4084 }
4085 if (ret == 0) {
4086 myKey.pubKeySet = 1;
4087 ret = wc_ed25519_sign_msg(in, inSz, out, outSz, &myKey);
4088 }
4089 wc_ed25519_free(&myKey);
4090 }
4091
4092 #ifdef TEST_PK_PRIVKEY
4093 free(keyBuf);
4094 #endif
4095
4096 WOLFSSL_PKMSG("PK 25519 Sign: ret %d, outSz %d\n", ret, *outSz);
4097
4098 return ret;
4099 }
4100 #endif /* HAVE_ED25519_SIGN */
4101
4102
4103 #ifdef HAVE_ED25519_VERIFY
4104 static WC_INLINE int myEd25519Verify(WOLFSSL* ssl, const byte* sig, word32 sigSz,
4105 const byte* msg, word32 msgSz, const byte* key, word32 keySz,
4106 int* result, void* ctx)
4107 {
4108 int ret;
4109 ed25519_key myKey;
4110 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4111
4112 (void)ssl;
4113 (void)cbInfo;
4114
4115 WOLFSSL_PKMSG("PK 25519 Verify: sigSz %d, msgSz %d, keySz %d\n", sigSz, msgSz, keySz);
4116
4117 ret = wc_ed25519_init(&myKey);
4118 if (ret == 0) {
4119 ret = wc_ed25519_import_public(key, keySz, &myKey);

NetBurner, Inc.
22.301 test.h 1419

4120 if (ret == 0) {
4121 ret = wc_ed25519_verify_msg(sig, sigSz, msg, msgSz, result, &myKey);
4122 }
4123 wc_ed25519_free(&myKey);
4124 }
4125
4126 WOLFSSL_PKMSG("PK 25519 Verify: ret %d, result %d\n", ret, *result);
4127
4128 return ret;
4129 }
4130 #endif /* HAVE_ED25519_VERIFY */
4131 #endif /* HAVE_ED25519 && HAVE_ED25519_KEY_IMPORT */
4132
4133 #ifdef HAVE_CURVE25519
4134 static WC_INLINE int myX25519KeyGen(WOLFSSL* ssl, curve25519_key* key,
4135 unsigned int keySz, void* ctx)
4136 {
4137 int ret;
4138 WC_RNG rng;
4139 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4140
4141 (void)ssl;
4142 (void)cbInfo;
4143
4144 WOLFSSL_PKMSG("PK 25519 KeyGen: keySz %u\n", keySz);
4145
4146 ret = wc_InitRng(&rng);
4147 if (ret != 0)
4148 return ret;
4149
4150 ret = wc_curve25519_make_key(&rng, keySz, key);
4151
4152 wc_FreeRng(&rng);
4153
4154 WOLFSSL_PKMSG("PK 25519 KeyGen: ret %d\n", ret);
4155
4156 return ret;
4157 }
4158
4159 static WC_INLINE int myX25519SharedSecret(WOLFSSL* ssl, curve25519_key* otherKey,
4160 unsigned char* pubKeyDer, unsigned int* pubKeySz,
4161 unsigned char* out, unsigned int* outlen,
4162 int side, void* ctx)
4163 {
4164 int ret;
4165 curve25519_key* privKey = NULL;
4166 curve25519_key* pubKey = NULL;
4167 curve25519_key tmpKey;
4168 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4169
4170 (void)ssl;
4171 (void)cbInfo;
4172
4173 WOLFSSL_PKMSG("PK 25519 PMS: side %s\n",
4174 side == WOLFSSL_CLIENT_END ? "client" : "server");
4175
4176 ret = wc_curve25519_init(&tmpKey);
4177 if (ret != 0) {
4178 return ret;
4179 }
4180
4181 /* for client: create and export public key */
4182 if (side == WOLFSSL_CLIENT_END) {
4183 WC_RNG rng;
4184
4185 privKey = &tmpKey;
4186 pubKey = otherKey;
4187
4188 ret = wc_InitRng(&rng);
4189 if (ret == 0) {
4190 ret = wc_curve25519_make_key(&rng, CURVE25519_KEYSIZE, privKey);
4191 if (ret == 0) {
4192 ret = wc_curve25519_export_public_ex(privKey, pubKeyDer,
4193 pubKeySz, EC25519_LITTLE_ENDIAN);
4194 }
4195 wc_FreeRng(&rng);
4196 }
4197 }
4198
4199 /* for server: import public key */
4200 else if (side == WOLFSSL_SERVER_END) {
4201 privKey = otherKey;
4202 pubKey = &tmpKey;
4203
4204 ret = wc_curve25519_import_public_ex(pubKeyDer, *pubKeySz, pubKey,
4205 EC25519_LITTLE_ENDIAN);
4206 }

NetBurner, Inc.
1420 File Documentation

4207 else {
4208 ret = BAD_FUNC_ARG;
4209 }
4210
4211 /* generate shared secret and return it */
4212 if (ret == 0) {
4213 ret = wc_curve25519_shared_secret_ex(privKey, pubKey, out, outlen,
4214 EC25519_LITTLE_ENDIAN);
4215 }
4216
4217 wc_curve25519_free(&tmpKey);
4218
4219 WOLFSSL_PKMSG("PK 25519 PMS: ret %d, pubKeySz %u, outLen %u\n",
4220 ret, *pubKeySz, *outlen);
4221
4222 return ret;
4223 }
4224 #endif /* HAVE_CURVE25519 */
4225
4226 #if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)
4227 #ifdef HAVE_ED448_SIGN
4228 static WC_INLINE int myEd448Sign(WOLFSSL* ssl, const byte* in, word32 inSz,
4229 byte* out, word32* outSz, const byte* key, word32 keySz, void* ctx)
4230 {
4231 int ret;
4232 word32 idx = 0;
4233 ed448_key myKey;
4234 byte* keyBuf = (byte*)key;
4235 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4236
4237 (void)ssl;
4238 (void)cbInfo;
4239
4240 WOLFSSL_PKMSG("PK 448 Sign: inSz %u, keySz %u\n", inSz, keySz);
4241
4242 #ifdef TEST_PK_PRIVKEY
4243 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
4244 if (ret != 0)
4245 return ret;
4246 #endif
4247
4248 ret = wc_ed448_init(&myKey);
4249 if (ret == 0) {
4250 ret = wc_Ed448PrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
4251 if (ret == 0) {
4252 ret = wc_ed448_make_public(&myKey, myKey.p, ED448_PUB_KEY_SIZE);
4253 }
4254 if (ret == 0) {
4255 myKey.pubKeySet = 1;
4256 ret = wc_ed448_sign_msg(in, inSz, out, outSz, &myKey, NULL, 0);
4257 }
4258 wc_ed448_free(&myKey);
4259 }
4260
4261 #ifdef TEST_PK_PRIVKEY
4262 free(keyBuf);
4263 #endif
4264
4265 WOLFSSL_PKMSG("PK 448 Sign: ret %d, outSz %u\n", ret, *outSz);
4266
4267 return ret;
4268 }
4269 #endif /* HAVE_ED448_SIGN */
4270
4271
4272 #ifdef HAVE_ED448_VERIFY
4273 static WC_INLINE int myEd448Verify(WOLFSSL* ssl, const byte* sig, word32 sigSz,
4274 const byte* msg, word32 msgSz, const byte* key, word32 keySz,
4275 int* result, void* ctx)
4276 {
4277 int ret;
4278 ed448_key myKey;
4279 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4280
4281 (void)ssl;
4282 (void)cbInfo;
4283
4284 WOLFSSL_PKMSG("PK 448 Verify: sigSz %u, msgSz %u, keySz %u\n", sigSz, msgSz,
4285 keySz);
4286
4287 ret = wc_ed448_init(&myKey);
4288 if (ret == 0) {
4289 ret = wc_ed448_import_public(key, keySz, &myKey);
4290 if (ret == 0) {
4291 ret = wc_ed448_verify_msg(sig, sigSz, msg, msgSz, result, &myKey,
4292 NULL, 0);
4293 }

NetBurner, Inc.
22.301 test.h 1421

4294 wc_ed448_free(&myKey);
4295 }
4296
4297 WOLFSSL_PKMSG("PK 448 Verify: ret %d, result %d\n", ret, *result);
4298
4299 return ret;
4300 }
4301 #endif /* HAVE_ED448_VERIFY */
4302 #endif /* HAVE_ED448 && HAVE_ED448_KEY_IMPORT */
4303
4304 #ifdef HAVE_CURVE448
4305 static WC_INLINE int myX448KeyGen(WOLFSSL* ssl, curve448_key* key,
4306 unsigned int keySz, void* ctx)
4307 {
4308 int ret;
4309 WC_RNG rng;
4310 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4311
4312 (void)ssl;
4313 (void)cbInfo;
4314
4315 WOLFSSL_PKMSG("PK 448 KeyGen: keySz %u\n", keySz);
4316
4317 ret = wc_InitRng(&rng);
4318 if (ret != 0)
4319 return ret;
4320
4321 ret = wc_curve448_make_key(&rng, keySz, key);
4322
4323 wc_FreeRng(&rng);
4324
4325 WOLFSSL_PKMSG("PK 448 KeyGen: ret %d\n", ret);
4326
4327 return ret;
4328 }
4329
4330 static WC_INLINE int myX448SharedSecret(WOLFSSL* ssl, curve448_key* otherKey,
4331 unsigned char* pubKeyDer, unsigned int* pubKeySz,
4332 unsigned char* out, unsigned int* outlen,
4333 int side, void* ctx)
4334 {
4335 int ret;
4336 curve448_key* privKey = NULL;
4337 curve448_key* pubKey = NULL;
4338 curve448_key tmpKey;
4339 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4340
4341 (void)ssl;
4342 (void)cbInfo;
4343
4344 WOLFSSL_PKMSG("PK 448 PMS: side %s\n",
4345 side == WOLFSSL_CLIENT_END ? "client" : "server");
4346
4347 ret = wc_curve448_init(&tmpKey);
4348 if (ret != 0) {
4349 return ret;
4350 }
4351
4352 /* for client: create and export public key */
4353 if (side == WOLFSSL_CLIENT_END) {
4354 WC_RNG rng;
4355
4356 privKey = &tmpKey;
4357 pubKey = otherKey;
4358
4359 ret = wc_InitRng(&rng);
4360 if (ret == 0) {
4361 ret = wc_curve448_make_key(&rng, CURVE448_KEY_SIZE, privKey);
4362 if (ret == 0) {
4363 ret = wc_curve448_export_public_ex(privKey, pubKeyDer,
4364 pubKeySz, EC448_LITTLE_ENDIAN);
4365 }
4366 wc_FreeRng(&rng);
4367 }
4368 }
4369
4370 /* for server: import public key */
4371 else if (side == WOLFSSL_SERVER_END) {
4372 privKey = otherKey;
4373 pubKey = &tmpKey;
4374
4375 ret = wc_curve448_import_public_ex(pubKeyDer, *pubKeySz, pubKey,
4376 EC448_LITTLE_ENDIAN);
4377 }
4378 else {
4379 ret = BAD_FUNC_ARG;
4380 }

NetBurner, Inc.
1422 File Documentation

4381
4382 /* generate shared secret and return it */
4383 if (ret == 0) {
4384 ret = wc_curve448_shared_secret_ex(privKey, pubKey, out, outlen,
4385 EC448_LITTLE_ENDIAN);
4386 }
4387
4388 wc_curve448_free(&tmpKey);
4389
4390 WOLFSSL_PKMSG("PK 448 PMS: ret %d, pubKeySz %u, outLen %u\n",
4391 ret, *pubKeySz, *outlen);
4392
4393 return ret;
4394 }
4395 #endif /* HAVE_CURVE448 */
4396
4397 #ifndef NO_DH
4398 static WC_INLINE int myDhCallback(WOLFSSL* ssl, struct DhKey* key,
4399 const unsigned char* priv, unsigned int privSz,
4400 const unsigned char* pubKeyDer, unsigned int pubKeySz,
4401 unsigned char* out, unsigned int* outlen,
4402 void* ctx)
4403 {
4404 int ret;
4405 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4406
4407 (void)ssl;
4408 (void)cbInfo;
4409
4410 /* return 0 on success */
4411 ret = wc_DhAgree(key, out, outlen, priv, privSz, pubKeyDer, pubKeySz);
4412
4413 WOLFSSL_PKMSG("PK ED Agree: ret %d, privSz %u, pubKeySz %u, outlen %u\n",
4414 ret, privSz, pubKeySz, *outlen);
4415
4416 return ret;
4417 }
4418
4419 #endif /* !NO_DH */
4420
4421 #ifndef NO_RSA
4422
4423 static WC_INLINE int myRsaSign(WOLFSSL* ssl, const byte* in, word32 inSz,
4424 byte* out, word32* outSz, const byte* key, word32 keySz, void* ctx)
4425 {
4426 WC_RNG rng;
4427 int ret;
4428 word32 idx = 0;
4429 RsaKey myKey;
4430 byte* keyBuf = (byte*)key;
4431 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4432
4433 (void)ssl;
4434 (void)cbInfo;
4435
4436 WOLFSSL_PKMSG("PK RSA Sign: inSz %u, keySz %u\n", inSz, keySz);
4437
4438 #ifdef TEST_PK_PRIVKEY
4439 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
4440 if (ret != 0)
4441 return ret;
4442 #endif
4443
4444 ret = wc_InitRng(&rng);
4445 if (ret != 0)
4446 return ret;
4447
4448 ret = wc_InitRsaKey(&myKey, NULL);
4449 if (ret == 0) {
4450 ret = wc_RsaPrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
4451 if (ret == 0)
4452 ret = wc_RsaSSL_Sign(in, inSz, out, *outSz, &myKey, &rng);
4453 if (ret > 0) { /* save and convert to 0 success */
4454 *outSz = ret;
4455 ret = 0;
4456 }
4457 wc_FreeRsaKey(&myKey);
4458 }
4459 wc_FreeRng(&rng);
4460
4461 #ifdef TEST_PK_PRIVKEY
4462 free(keyBuf);
4463 #endif
4464
4465 WOLFSSL_PKMSG("PK RSA Sign: ret %d, outSz %u\n", ret, *outSz);
4466
4467 return ret;

NetBurner, Inc.
22.301 test.h 1423

4468 }
4469
4470
4471 static WC_INLINE int myRsaVerify(WOLFSSL* ssl, byte* sig, word32 sigSz,
4472 byte** out, const byte* key, word32 keySz, void* ctx)
4473 {
4474 int ret;
4475 word32 idx = 0;
4476 RsaKey myKey;
4477 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4478
4479 (void)ssl;
4480 (void)cbInfo;
4481
4482 WOLFSSL_PKMSG("PK RSA Verify: sigSz %u, keySz %u\n", sigSz, keySz);
4483
4484 ret = wc_InitRsaKey(&myKey, NULL);
4485 if (ret == 0) {
4486 ret = wc_RsaPublicKeyDecode(key, &idx, &myKey, keySz);
4487 if (ret == 0)
4488 ret = wc_RsaSSL_VerifyInline(sig, sigSz, out, &myKey);
4489 wc_FreeRsaKey(&myKey);
4490 }
4491
4492 WOLFSSL_PKMSG("PK RSA Verify: ret %d\n", ret);
4493
4494 return ret;
4495 }
4496
4497 static WC_INLINE int myRsaSignCheck(WOLFSSL* ssl, byte* sig, word32 sigSz,
4498 byte** out, const byte* key, word32 keySz, void* ctx)
4499 {
4500 int ret;
4501 word32 idx = 0;
4502 RsaKey myKey;
4503 byte* keyBuf = (byte*)key;
4504 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4505
4506 (void)ssl;
4507 (void)cbInfo;
4508
4509 WOLFSSL_PKMSG("PK RSA SignCheck: sigSz %u, keySz %u\n", sigSz, keySz);
4510
4511 #ifdef TEST_PK_PRIVKEY
4512 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
4513 if (ret != 0)
4514 return ret;
4515 #endif
4516
4517 ret = wc_InitRsaKey(&myKey, NULL);
4518 if (ret == 0) {
4519 ret = wc_RsaPrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
4520 if (ret == 0)
4521 ret = wc_RsaSSL_VerifyInline(sig, sigSz, out, &myKey);
4522 wc_FreeRsaKey(&myKey);
4523 }
4524 #ifdef TEST_PK_PRIVKEY
4525 free(keyBuf);
4526 #endif
4527
4528 WOLFSSL_PKMSG("PK RSA SignCheck: ret %d\n", ret);
4529
4530 return ret;
4531 }
4532
4533 #ifdef WC_RSA_PSS
4534 static WC_INLINE int myRsaPssSign(WOLFSSL* ssl, const byte* in, word32 inSz,
4535 byte* out, word32* outSz, int hash, int mgf, const byte* key,
4536 word32 keySz, void* ctx)
4537 {
4538 enum wc_HashType hashType = WC_HASH_TYPE_NONE;
4539 WC_RNG rng;
4540 int ret;
4541 word32 idx = 0;
4542 RsaKey myKey;
4543 byte* keyBuf = (byte*)key;
4544 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4545
4546 (void)ssl;
4547 (void)cbInfo;
4548
4549 WOLFSSL_PKMSG("PK RSA PSS Sign: inSz %u, hash %d, mgf %d, keySz %u\n",
4550 inSz, hash, mgf, keySz);
4551
4552 #ifdef TEST_PK_PRIVKEY
4553 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
4554 if (ret != 0)

NetBurner, Inc.
1424 File Documentation

4555 return ret;


4556 #endif
4557
4558 switch (hash) {
4559 #ifndef NO_SHA256
4560 case SHA256h:
4561 hashType = WC_HASH_TYPE_SHA256;
4562 break;
4563 #endif
4564 #ifdef WOLFSSL_SHA384
4565 case SHA384h:
4566 hashType = WC_HASH_TYPE_SHA384;
4567 break;
4568 #endif
4569 #ifdef WOLFSSL_SHA512
4570 case SHA512h:
4571 hashType = WC_HASH_TYPE_SHA512;
4572 break;
4573 #endif
4574 }
4575
4576 ret = wc_InitRng(&rng);
4577 if (ret != 0)
4578 return ret;
4579
4580 ret = wc_InitRsaKey(&myKey, NULL);
4581 if (ret == 0) {
4582 ret = wc_RsaPrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
4583 if (ret == 0) {
4584 ret = wc_RsaPSS_Sign(in, inSz, out, *outSz, hashType, mgf, &myKey,
4585 &rng);
4586 }
4587 if (ret > 0) { /* save and convert to 0 success */
4588 *outSz = ret;
4589 ret = 0;
4590 }
4591 wc_FreeRsaKey(&myKey);
4592 }
4593 wc_FreeRng(&rng);
4594
4595 #ifdef TEST_PK_PRIVKEY
4596 free(keyBuf);
4597 #endif
4598
4599 WOLFSSL_PKMSG("PK RSA PSS Sign: ret %d, outSz %u\n", ret, *outSz);
4600
4601 return ret;
4602 }
4603
4604
4605 static WC_INLINE int myRsaPssVerify(WOLFSSL* ssl, byte* sig, word32 sigSz,
4606 byte** out, int hash, int mgf, const byte* key, word32 keySz, void* ctx)
4607 {
4608 int ret;
4609 word32 idx = 0;
4610 RsaKey myKey;
4611 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4612 enum wc_HashType hashType = WC_HASH_TYPE_NONE;
4613
4614 (void)ssl;
4615 (void)cbInfo;
4616
4617 WOLFSSL_PKMSG("PK RSA PSS Verify: sigSz %u, hash %d, mgf %d, keySz %u\n",
4618 sigSz, hash, mgf, keySz);
4619
4620 switch (hash) {
4621 #ifndef NO_SHA256
4622 case SHA256h:
4623 hashType = WC_HASH_TYPE_SHA256;
4624 break;
4625 #endif
4626 #ifdef WOLFSSL_SHA384
4627 case SHA384h:
4628 hashType = WC_HASH_TYPE_SHA384;
4629 break;
4630 #endif
4631 #ifdef WOLFSSL_SHA512
4632 case SHA512h:
4633 hashType = WC_HASH_TYPE_SHA512;
4634 break;
4635 #endif
4636 }
4637
4638 ret = wc_InitRsaKey(&myKey, NULL);
4639 if (ret == 0) {
4640 ret = wc_RsaPublicKeyDecode(key, &idx, &myKey, keySz);
4641 if (ret == 0) {

NetBurner, Inc.
22.301 test.h 1425

4642 ret = wc_RsaPSS_VerifyInline(sig, sigSz, out, hashType, mgf,


4643 &myKey);
4644 }
4645 wc_FreeRsaKey(&myKey);
4646 }
4647
4648 WOLFSSL_PKMSG("PK RSA PSS Verify: ret %d\n", ret);
4649
4650 return ret;
4651 }
4652
4653 static WC_INLINE int myRsaPssSignCheck(WOLFSSL* ssl, byte* sig, word32 sigSz,
4654 byte** out, int hash, int mgf, const byte* key, word32 keySz, void* ctx)
4655 {
4656 int ret;
4657 word32 idx = 0;
4658 RsaKey myKey;
4659 byte* keyBuf = (byte*)key;
4660 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4661 enum wc_HashType hashType = WC_HASH_TYPE_NONE;
4662
4663 (void)ssl;
4664 (void)cbInfo;
4665
4666 WOLFSSL_PKMSG("PK RSA PSS SignCheck: sigSz %u, hash %d, mgf %d, keySz %u\n",
4667 sigSz, hash, mgf, keySz);
4668
4669 #ifdef TEST_PK_PRIVKEY
4670 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
4671 if (ret != 0)
4672 return ret;
4673 #endif
4674
4675 switch (hash) {
4676 #ifndef NO_SHA256
4677 case SHA256h:
4678 hashType = WC_HASH_TYPE_SHA256;
4679 break;
4680 #endif
4681 #ifdef WOLFSSL_SHA384
4682 case SHA384h:
4683 hashType = WC_HASH_TYPE_SHA384;
4684 break;
4685 #endif
4686 #ifdef WOLFSSL_SHA512
4687 case SHA512h:
4688 hashType = WC_HASH_TYPE_SHA512;
4689 break;
4690 #endif
4691 }
4692
4693 ret = wc_InitRsaKey(&myKey, NULL);
4694 if (ret == 0) {
4695 ret = wc_RsaPrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
4696 if (ret == 0) {
4697 ret = wc_RsaPSS_VerifyInline(sig, sigSz, out, hashType, mgf,
4698 &myKey);
4699 }
4700 wc_FreeRsaKey(&myKey);
4701 }
4702
4703 #ifdef TEST_PK_PRIVKEY
4704 free(keyBuf);
4705 #endif
4706
4707 WOLFSSL_PKMSG("PK RSA PSS SignCheck: ret %d\n", ret);
4708
4709 return ret;
4710 }
4711 #endif
4712
4713
4714 static WC_INLINE int myRsaEnc(WOLFSSL* ssl, const byte* in, word32 inSz,
4715 byte* out, word32* outSz, const byte* key,
4716 word32 keySz, void* ctx)
4717 {
4718 int ret;
4719 word32 idx = 0;
4720 RsaKey myKey;
4721 WC_RNG rng;
4722 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4723
4724 (void)ssl;
4725 (void)cbInfo;
4726
4727 WOLFSSL_PKMSG("PK RSA Enc: inSz %u, keySz %u\n", inSz, keySz);
4728

NetBurner, Inc.
1426 File Documentation

4729 ret = wc_InitRng(&rng);


4730 if (ret != 0)
4731 return ret;
4732
4733 ret = wc_InitRsaKey(&myKey, NULL);
4734 if (ret == 0) {
4735 ret = wc_RsaPublicKeyDecode(key, &idx, &myKey, keySz);
4736 if (ret == 0) {
4737 ret = wc_RsaPublicEncrypt(in, inSz, out, *outSz, &myKey, &rng);
4738 if (ret > 0) {
4739 *outSz = ret;
4740 ret = 0; /* reset to success */
4741 }
4742 }
4743 wc_FreeRsaKey(&myKey);
4744 }
4745 wc_FreeRng(&rng);
4746
4747 WOLFSSL_PKMSG("PK RSA Enc: ret %d, outSz %u\n", ret, *outSz);
4748
4749 return ret;
4750 }
4751
4752 static WC_INLINE int myRsaDec(WOLFSSL* ssl, byte* in, word32 inSz,
4753 byte** out,
4754 const byte* key, word32 keySz, void* ctx)
4755 {
4756 int ret;
4757 word32 idx = 0;
4758 RsaKey myKey;
4759 byte* keyBuf = (byte*)key;
4760 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4761
4762 (void)ssl;
4763 (void)cbInfo;
4764
4765 WOLFSSL_PKMSG("PK RSA Dec: inSz %u, keySz %u\n", inSz, keySz);
4766
4767 #ifdef TEST_PK_PRIVKEY
4768 ret = load_key_file(cbInfo->ourKey, &keyBuf, &keySz);
4769 if (ret != 0)
4770 return ret;
4771 #endif
4772
4773 ret = wc_InitRsaKey(&myKey, NULL);
4774 if (ret == 0) {
4775 ret = wc_RsaPrivateKeyDecode(keyBuf, &idx, &myKey, keySz);
4776 if (ret == 0) {
4777 #ifdef WC_RSA_BLINDING
4778 ret = wc_RsaSetRNG(&myKey, wolfSSL_GetRNG(ssl));
4779 if (ret != 0) {
4780 wc_FreeRsaKey(&myKey);
4781 return ret;
4782 }
4783 #endif
4784 ret = wc_RsaPrivateDecryptInline(in, inSz, out, &myKey);
4785 }
4786 wc_FreeRsaKey(&myKey);
4787 }
4788
4789 #ifdef TEST_PK_PRIVKEY
4790 free(keyBuf);
4791 #endif
4792
4793 WOLFSSL_PKMSG("PK RSA Dec: ret %d\n", ret);
4794
4795 return ret;
4796 }
4797
4798 #endif /* NO_RSA */
4799
4800 static WC_INLINE int myGenMaster(WOLFSSL* ssl, void* ctx)
4801 {
4802 int ret;
4803 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4804
4805 (void)ssl;
4806 (void)cbInfo;
4807
4808 WOLFSSL_PKMSG("Gen Master");
4809 /* fall through to original routine */
4810 ret = PROTOCOLCB_UNAVAILABLE;
4811 WOLFSSL_PKMSG("Gen Master: ret %d\n", ret);
4812
4813 return ret;
4814 }
4815

NetBurner, Inc.
22.301 test.h 1427

4816 static WC_INLINE int myGenPreMaster(WOLFSSL* ssl, byte *premaster,


4817 word32 preSz, void* ctx)
4818 {
4819 int ret;
4820 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4821
4822 (void) ssl;
4823 (void) cbInfo;
4824 (void) premaster;
4825 (void) preSz;
4826
4827 WOLFSSL_PKMSG("Gen Pre-Master Cb");
4828 /* fall through to original routine */
4829 ret = PROTOCOLCB_UNAVAILABLE;
4830 WOLFSSL_PKMSG("Gen Pre-Master Cb: ret %d\n", ret);
4831
4832 return ret;
4833 }
4834
4835 static WC_INLINE int myGenSessionKey(WOLFSSL* ssl, void* ctx)
4836 {
4837 int ret;
4838 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4839
4840 (void)ssl;
4841 (void)cbInfo;
4842
4843 WOLFSSL_PKMSG("Gen Master Cb");
4844 /* fall through to original routine */
4845 ret = PROTOCOLCB_UNAVAILABLE;
4846 WOLFSSL_PKMSG("Gen Master Cb: ret %d\n", ret);
4847
4848 return ret;
4849 }
4850
4851 static WC_INLINE int mySetEncryptKeys(WOLFSSL* ssl, void* ctx)
4852 {
4853 int ret;
4854 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4855
4856 (void)ssl;
4857 (void)cbInfo;
4858
4859 WOLFSSL_PKMSG("Set Encrypt Keys Cb");
4860 /* fall through to original routine */
4861 ret = PROTOCOLCB_UNAVAILABLE;
4862 WOLFSSL_PKMSG("Set Encrypt Keys Cb: ret %d\n", ret);
4863
4864 return ret;
4865 }
4866
4867 #if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
4868 static WC_INLINE int myVerifyMac(WOLFSSL *ssl, const byte* message,
4869 word32 messageSz, word32 macSz, word32 content, void* ctx)
4870 {
4871 int ret;
4872 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4873
4874 (void)ssl;
4875 (void)message;
4876 (void)messageSz;
4877 (void)macSz;
4878 (void)content;
4879 (void)cbInfo;
4880
4881 WOLFSSL_PKMSG("Verify Mac Cb");
4882 /* fall through to original routine */
4883 ret = PROTOCOLCB_UNAVAILABLE;
4884 WOLFSSL_PKMSG("Verify Mac Cb: ret %d\n", ret);
4885
4886 return ret;
4887 }
4888 #endif
4889
4890 static WC_INLINE int myTlsFinished(WOLFSSL* ssl,
4891 const byte *side,
4892 const byte *handshake_hash,
4893 byte *hashes, void* ctx)
4894 {
4895 int ret;
4896 PkCbInfo* cbInfo = (PkCbInfo*)ctx;
4897
4898 (void)ssl;
4899 (void)cbInfo;
4900 (void)side;
4901 (void)handshake_hash;
4902 (void)hashes;

NetBurner, Inc.
1428 File Documentation

4903
4904 WOLFSSL_PKMSG("Tls Finished Cb");
4905 /* fall through to original routine */
4906 ret = PROTOCOLCB_UNAVAILABLE;
4907 WOLFSSL_PKMSG("Tls Finished Cb: ret %d\n", ret);
4908
4909 return ret;
4910 }
4911
4912 static WC_INLINE void SetupPkCallbacks(WOLFSSL_CTX* ctx)
4913 {
4914 (void)ctx;
4915
4916 #ifdef HAVE_ECC
4917 wolfSSL_CTX_SetEccKeyGenCb(ctx, myEccKeyGen);
4918 wolfSSL_CTX_SetEccSignCb(ctx, myEccSign);
4919 wolfSSL_CTX_SetEccVerifyCb(ctx, myEccVerify);
4920 wolfSSL_CTX_SetEccSharedSecretCb(ctx, myEccSharedSecret);
4921 #endif /* HAVE_ECC */
4922 #ifdef HAVE_HKDF
4923 wolfSSL_CTX_SetHKDFExtractCb(ctx, myHkdfExtract);
4924 #endif /* HAVE_HKDF */
4925 #ifndef NO_DH
4926 wolfSSL_CTX_SetDhAgreeCb(ctx, myDhCallback);
4927 #endif
4928 #if defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT)
4929 #ifdef HAVE_ED25519_SIGN
4930 wolfSSL_CTX_SetEd25519SignCb(ctx, myEd25519Sign);
4931 #endif
4932 #ifdef HAVE_ED25519_VERIFY
4933 wolfSSL_CTX_SetEd25519VerifyCb(ctx, myEd25519Verify);
4934 #endif
4935 #endif
4936 #ifdef HAVE_CURVE25519
4937 wolfSSL_CTX_SetX25519KeyGenCb(ctx, myX25519KeyGen);
4938 wolfSSL_CTX_SetX25519SharedSecretCb(ctx, myX25519SharedSecret);
4939 #endif
4940 #if defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)
4941 #if defined(HAVE_ED448_SIGN)
4942 wolfSSL_CTX_SetEd448SignCb(ctx, myEd448Sign);
4943 #endif
4944 #if defined(HAVE_ED448_VERIFY)
4945 wolfSSL_CTX_SetEd448VerifyCb(ctx, myEd448Verify);
4946 #endif
4947 #endif
4948 #ifdef HAVE_CURVE448
4949 wolfSSL_CTX_SetX448KeyGenCb(ctx, myX448KeyGen);
4950 wolfSSL_CTX_SetX448SharedSecretCb(ctx, myX448SharedSecret);
4951 #endif
4952 #ifndef NO_RSA
4953 wolfSSL_CTX_SetRsaSignCb(ctx, myRsaSign);
4954 wolfSSL_CTX_SetRsaVerifyCb(ctx, myRsaVerify);
4955 wolfSSL_CTX_SetRsaSignCheckCb(ctx, myRsaSignCheck);
4956 #ifdef WC_RSA_PSS
4957 wolfSSL_CTX_SetRsaPssSignCb(ctx, myRsaPssSign);
4958 wolfSSL_CTX_SetRsaPssVerifyCb(ctx, myRsaPssVerify);
4959 wolfSSL_CTX_SetRsaPssSignCheckCb(ctx, myRsaPssSignCheck);
4960 #endif
4961 wolfSSL_CTX_SetRsaEncCb(ctx, myRsaEnc);
4962 wolfSSL_CTX_SetRsaDecCb(ctx, myRsaDec);
4963 #endif /* NO_RSA */
4964
4965 #ifndef NO_CERTS
4966 wolfSSL_CTX_SetGenMasterSecretCb(ctx, myGenMaster);
4967 wolfSSL_CTX_SetGenPreMasterCb(ctx, myGenPreMaster);
4968 wolfSSL_CTX_SetGenSessionKeyCb(ctx, myGenSessionKey);
4969 wolfSSL_CTX_SetEncryptKeysCb(ctx, mySetEncryptKeys);
4970
4971 #if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
4972 wolfSSL_CTX_SetVerifyMacCb(ctx, myVerifyMac);
4973 #endif
4974
4975 wolfSSL_CTX_SetTlsFinishedCb(ctx, myTlsFinished);
4976 #endif /* NO_CERTS */
4977 }
4978
4979 static WC_INLINE void SetupPkCallbackContexts(WOLFSSL* ssl, void* myCtx)
4980 {
4981 #ifdef HAVE_ECC
4982 wolfSSL_SetEccKeyGenCtx(ssl, myCtx);
4983 wolfSSL_SetEccSignCtx(ssl, myCtx);
4984 wolfSSL_SetEccVerifyCtx(ssl, myCtx);
4985 wolfSSL_SetEccSharedSecretCtx(ssl, myCtx);
4986 #endif /* HAVE_ECC */
4987 #ifdef HAVE_HKDF
4988 wolfSSL_SetHKDFExtractCtx(ssl, myCtx);
4989 #endif /* HAVE_HKDF */

NetBurner, Inc.
22.301 test.h 1429

4990 #ifndef NO_DH


4991 wolfSSL_SetDhAgreeCtx(ssl, myCtx);
4992 #endif
4993 #ifdef HAVE_ED25519
4994 wolfSSL_SetEd25519SignCtx(ssl, myCtx);
4995 wolfSSL_SetEd25519VerifyCtx(ssl, myCtx);
4996 #endif
4997 #ifdef HAVE_CURVE25519
4998 wolfSSL_SetX25519KeyGenCtx(ssl, myCtx);
4999 wolfSSL_SetX25519SharedSecretCtx(ssl, myCtx);
5000 #endif
5001 #ifdef HAVE_ED448
5002 wolfSSL_SetEd448SignCtx(ssl, myCtx);
5003 wolfSSL_SetEd448VerifyCtx(ssl, myCtx);
5004 #endif
5005 #ifdef HAVE_CURVE448
5006 wolfSSL_SetX448KeyGenCtx(ssl, myCtx);
5007 wolfSSL_SetX448SharedSecretCtx(ssl, myCtx);
5008 #endif
5009 #ifndef NO_RSA
5010 wolfSSL_SetRsaSignCtx(ssl, myCtx);
5011 wolfSSL_SetRsaVerifyCtx(ssl, myCtx);
5012 #ifdef WC_RSA_PSS
5013 wolfSSL_SetRsaPssSignCtx(ssl, myCtx);
5014 wolfSSL_SetRsaPssVerifyCtx(ssl, myCtx);
5015 #endif
5016 wolfSSL_SetRsaEncCtx(ssl, myCtx);
5017 wolfSSL_SetRsaDecCtx(ssl, myCtx);
5018 #endif /* NO_RSA */
5019
5020 #ifndef NO_CERTS
5021 wolfSSL_SetGenMasterSecretCtx(ssl, myCtx);
5022 wolfSSL_SetGenPreMasterCtx(ssl, myCtx);
5023 wolfSSL_SetGenSessionKeyCtx(ssl, myCtx);
5024 wolfSSL_SetEncryptKeysCtx(ssl, myCtx);
5025
5026 #if !defined(WOLFSSL_NO_TLS12) && !defined(WOLFSSL_AEAD_ONLY)
5027 wolfSSL_SetVerifyMacCtx(ssl, myCtx);
5028 #endif
5029
5030 wolfSSL_SetTlsFinishedCtx(ssl, myCtx);
5031 #endif
5032 }
5033
5034 #endif /* HAVE_PK_CALLBACKS */
5035
5036 #ifdef USE_WOLFSSL_IO
5037 static WC_INLINE int SimulateWantWriteIOSendCb(WOLFSSL *ssl, char *buf, int sz, void *ctx)
5038 {
5039 static int wantWriteFlag = 1;
5040
5041 int sent;
5042 int sd = *(int*)ctx;
5043
5044 (void)ssl;
5045
5046 if (!wantWriteFlag)
5047 {
5048 wantWriteFlag = 1;
5049
5050 sent = wolfIO_Send(sd, buf, sz, 0);
5051 if (sent < 0) {
5052 int err = errno;
5053
5054 if (err == SOCKET_EWOULDBLOCK || err == SOCKET_EAGAIN) {
5055 return WOLFSSL_CBIO_ERR_WANT_WRITE;
5056 }
5057 else if (err == SOCKET_ECONNRESET) {
5058 return WOLFSSL_CBIO_ERR_CONN_RST;
5059 }
5060 else if (err == SOCKET_EINTR) {
5061 return WOLFSSL_CBIO_ERR_ISR;
5062 }
5063 else if (err == SOCKET_EPIPE) {
5064 return WOLFSSL_CBIO_ERR_CONN_CLOSE;
5065 }
5066 else {
5067 return WOLFSSL_CBIO_ERR_GENERAL;
5068 }
5069 }
5070
5071 return sent;
5072 }
5073 else
5074 {
5075 wantWriteFlag = 0;
5076 return WOLFSSL_CBIO_ERR_WANT_WRITE;

NetBurner, Inc.
1430 File Documentation

5077 }
5078 }
5079 #endif /* USE_WOLFSSL_IO */
5080
5081 #if defined(__hpux__) || defined(__MINGW32__) || defined (WOLFSSL_TIRTOS) \
5082 || defined(_MSC_VER)
5083
5084 /* HP/UX doesn’t have strsep, needed by test/suites.c */
5085 static WC_INLINE char* strsep(char **stringp, const char *delim)
5086 {
5087 char* start;
5088 char* end;
5089
5090 start = *stringp;
5091 if (start == NULL)
5092 return NULL;
5093
5094 if ((end = strpbrk(start, delim))) {
5095 *end++ = ’\0’;
5096 *stringp = end;
5097 } else {
5098 *stringp = NULL;
5099 }
5100
5101 return start;
5102 }
5103
5104 #endif /* __hpux__ and others */
5105
5106 /* Create unique filename, len is length of tempfn name, assuming
5107 len does not include null terminating character,
5108 num is number of characters in tempfn name to randomize */
5109 static WC_INLINE const char* mymktemp(char *tempfn, int len, int num)
5110 {
5111 int x, size;
5112 static const char alphanum[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5113 "abcdefghijklmnopqrstuvwxyz";
5114 WC_RNG rng;
5115 byte out = 0;
5116
5117 if (tempfn == NULL || len < 1 || num < 1 || len <= num) {
5118 fprintf(stderr, "Bad input\n");
5119 return NULL;
5120 }
5121
5122 size = len - 1;
5123
5124 if (wc_InitRng(&rng) != 0) {
5125 fprintf(stderr, "InitRng failed\n");
5126 return NULL;
5127 }
5128
5129 for (x = size; x > size - num; x--) {
5130 if (wc_RNG_GenerateBlock(&rng,(byte*)&out, sizeof(out)) != 0) {
5131 fprintf(stderr, "RNG_GenerateBlock failed\n");
5132 return NULL;
5133 }
5134 tempfn[x] = alphanum[out % (sizeof(alphanum) - 1)];
5135 }
5136 tempfn[len] = ’\0’;
5137
5138 wc_FreeRng(&rng);
5139 (void)rng; /* for WC_NO_RNG case */
5140
5141 return tempfn;
5142 }
5143
5144
5145
5146 #if defined(HAVE_SESSION_TICKET) && defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && \
5147 ((defined(HAVE_CHACHA) && defined(HAVE_POLY1305)) || \
5148 defined(HAVE_AESGCM))
5149
5150 #define HAVE_TEST_SESSION_TICKET
5151
5152 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
5153 #include <wolfssl/wolfcrypt/chacha20_poly1305.h>
5154 #define WOLFSSL_TICKET_KEY_SZ CHACHA20_POLY1305_AEAD_KEYSIZE
5155 #elif defined(HAVE_AESGCM)
5156 #include <wolfssl/wolfcrypt/aes.h>
5157 #include <wolfssl/wolfcrypt/wc_encrypt.h> /* AES IV sizes in FIPS mode */
5158 #define WOLFSSL_TICKET_KEY_SZ AES_256_KEY_SIZE
5159 #endif
5160
5161 typedef struct key_ctx {
5162 byte name[WOLFSSL_TICKET_NAME_SZ]; /* name for this context */
5163 byte key[WOLFSSL_TICKET_KEY_SZ]; /* cipher key */

NetBurner, Inc.
22.301 test.h 1431

5164 } key_ctx;
5165
5166 static THREAD_LS_T key_ctx myKey_ctx;
5167 static THREAD_LS_T WC_RNG myKey_rng;
5168
5169 static WC_INLINE int TicketInit(void)
5170 {
5171 int ret = wc_InitRng(&myKey_rng);
5172 if (ret == 0) {
5173 ret = wc_RNG_GenerateBlock(&myKey_rng, myKey_ctx.key,
5174 sizeof(myKey_ctx.key));
5175 }
5176 if (ret == 0) {
5177 ret = wc_RNG_GenerateBlock(&myKey_rng, myKey_ctx.name,
5178 sizeof(myKey_ctx.name));
5179 }
5180 return ret;
5181 }
5182
5183 static WC_INLINE void TicketCleanup(void)
5184 {
5185 wc_FreeRng(&myKey_rng);
5186 }
5187
5188 typedef enum MyTicketState {
5189 MY_TICKET_STATE_NONE,
5190 MY_TICKET_STATE_INIT,
5191 MY_TICKET_STATE_RNG,
5192 MY_TICKET_STATE_CIPHER_SETUP,
5193 MY_TICKET_STATE_CIPHER,
5194 MY_TICKET_STATE_FINAL
5195 } MyTicketState;
5196 typedef struct MyTicketCtx {
5197 MyTicketState state;
5198 byte aad[WOLFSSL_TICKET_NAME_SZ + WOLFSSL_TICKET_IV_SZ + 2];
5199 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
5200 /* chahca20/poly1305 */
5201 #elif defined(HAVE_AESGCM)
5202 Aes aes;
5203 #endif
5204 } MyTicketCtx;
5205
5206 static WC_INLINE int myTicketEncCb(WOLFSSL* ssl,
5207 byte key_name[WOLFSSL_TICKET_NAME_SZ],
5208 byte iv[WOLFSSL_TICKET_IV_SZ],
5209 byte mac[WOLFSSL_TICKET_MAC_SZ],
5210 int enc, byte* ticket, int inLen, int* outLen,
5211 void* userCtx)
5212 {
5213 int ret = 0;
5214 MyTicketCtx tickCtx_lcl;
5215 MyTicketCtx* tickCtx = (MyTicketCtx*)userCtx;
5216
5217 (void)ssl;
5218
5219 if (tickCtx == NULL) {
5220 /* for test cases where userCtx is not set use local stack for context */
5221 XMEMSET(&tickCtx_lcl, 0, sizeof(tickCtx_lcl));
5222 tickCtx = &tickCtx_lcl;
5223 }
5224
5225 switch (tickCtx->state) {
5226 case MY_TICKET_STATE_NONE:
5227 case MY_TICKET_STATE_INIT:
5228 {
5229 /* encrypt */
5230 if (enc) {
5231 XMEMCPY(key_name, myKey_ctx.name, WOLFSSL_TICKET_NAME_SZ);
5232 }
5233 else {
5234 /* see if we know this key */
5235 if (XMEMCMP(key_name, myKey_ctx.name, WOLFSSL_TICKET_NAME_SZ) != 0) {
5236 printf("client presented unknown ticket key name %s\n", key_name);
5237 return WOLFSSL_TICKET_RET_FATAL;
5238 }
5239 }
5240 tickCtx->state = MY_TICKET_STATE_RNG;
5241 }
5242 FALL_THROUGH;
5243 case MY_TICKET_STATE_RNG:
5244 {
5245 if (enc) {
5246 ret = wc_RNG_GenerateBlock(&myKey_rng, iv, WOLFSSL_TICKET_IV_SZ);
5247 if (ret != 0)
5248 break;
5249 }
5250 tickCtx->state = MY_TICKET_STATE_CIPHER_SETUP;

NetBurner, Inc.
1432 File Documentation

5251 }
5252 FALL_THROUGH;
5253 case MY_TICKET_STATE_CIPHER_SETUP:
5254 {
5255 byte* tmp = tickCtx->aad;
5256 word16 sLen = XHTONS(inLen);
5257
5258 /* build aad from key name, iv, and length */
5259 XMEMCPY(tmp, key_name, WOLFSSL_TICKET_NAME_SZ);
5260 tmp += WOLFSSL_TICKET_NAME_SZ;
5261 XMEMCPY(tmp, iv, WOLFSSL_TICKET_IV_SZ);
5262 tmp += WOLFSSL_TICKET_IV_SZ;
5263 XMEMCPY(tmp, &sLen, sizeof(sLen));
5264
5265 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
5266 #elif defined(HAVE_AESGCM)
5267 ret = wc_AesInit(&tickCtx->aes, NULL, INVALID_DEVID);
5268 if (ret == 0) {
5269 ret = wc_AesGcmSetKey(&tickCtx->aes, myKey_ctx.key,
5270 sizeof(myKey_ctx.key));
5271 }
5272 if (ret != 0)
5273 break;
5274 #endif
5275 tickCtx->state = MY_TICKET_STATE_CIPHER;
5276 }
5277 FALL_THROUGH;
5278 case MY_TICKET_STATE_CIPHER:
5279 {
5280 int aadSz = (int)sizeof(tickCtx->aad);
5281
5282 /* encrypt */
5283 if (enc) {
5284 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
5285 ret = wc_ChaCha20Poly1305_Encrypt(myKey_ctx.key, iv,
5286 tickCtx->aad, aadSz,
5287 ticket, inLen,
5288 ticket,
5289 mac);
5290 #elif defined(HAVE_AESGCM)
5291 ret = wc_AesGcmEncrypt(&tickCtx->aes, ticket, ticket, inLen,
5292 iv, GCM_NONCE_MID_SZ, mac, AES_BLOCK_SIZE,
5293 tickCtx->aad, aadSz);
5294 #endif
5295 }
5296 /* decrypt */
5297 else {
5298 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
5299 ret = wc_ChaCha20Poly1305_Decrypt(myKey_ctx.key, iv,
5300 tickCtx->aad, aadSz,
5301 ticket, inLen,
5302 mac,
5303 ticket);
5304 #elif defined(HAVE_AESGCM)
5305 ret = wc_AesGcmDecrypt(&tickCtx->aes, ticket, ticket, inLen,
5306 iv, GCM_NONCE_MID_SZ, mac, AES_BLOCK_SIZE,
5307 tickCtx->aad, aadSz);
5308 #endif
5309 }
5310 if (ret != 0) {
5311 break;
5312 }
5313 tickCtx->state = MY_TICKET_STATE_FINAL;
5314 }
5315 FALL_THROUGH;
5316 case MY_TICKET_STATE_FINAL:
5317 *outLen = inLen; /* no padding in this mode */
5318 break;
5319 } /* switch */
5320
5321 #ifdef WOLFSSL_ASYNC_CRYPT
5322 if (ret == WC_PENDING_E) {
5323 return ret;
5324 }
5325 #endif
5326
5327 /* cleanup */
5328 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
5329 #elif defined(HAVE_AESGCM)
5330 wc_AesFree(&tickCtx->aes);
5331 #endif
5332
5333 /* reset context */
5334 XMEMSET(tickCtx, 0, sizeof(MyTicketCtx));
5335
5336 return (ret == 0) ? WOLFSSL_TICKET_RET_OK : WOLFSSL_TICKET_RET_REJECT;
5337 }

NetBurner, Inc.
22.301 test.h 1433

5338
5339 #endif /* HAVE_SESSION_TICKET && ((HAVE_CHACHA && HAVE_POLY1305) || HAVE_AESGCM) */
5340
5341
5342 static WC_INLINE word16 GetRandomPort(void)
5343 {
5344 word16 port = 0;
5345
5346 /* Generate random port for testing */
5347 WC_RNG rng;
5348 if (wc_InitRng(&rng) == 0) {
5349 if (wc_RNG_GenerateBlock(&rng, (byte*)&port, sizeof(port)) == 0) {
5350 port |= 0xC000; /* Make sure its in the 49152 - 65535 range */
5351 }
5352 wc_FreeRng(&rng);
5353 }
5354 (void)rng; /* for WC_NO_RNG case */
5355 return port;
5356 }
5357
5358 #ifdef WOLFSSL_EARLY_DATA
5359 static WC_INLINE void EarlyDataStatus(WOLFSSL* ssl)
5360 {
5361 int earlyData_status;
5362 #ifdef OPENSSL_EXTRA
5363 earlyData_status = SSL_get_early_data_status(ssl);
5364 #else
5365 earlyData_status = wolfSSL_get_early_data_status(ssl);
5366 #endif
5367 if (earlyData_status < 0) return;
5368
5369 printf("Early Data was ");
5370
5371 switch(earlyData_status) {
5372 case WOLFSSL_EARLY_DATA_NOT_SENT:
5373 printf("not sent.\n");
5374 break;
5375 case WOLFSSL_EARLY_DATA_REJECTED:
5376 printf("rejected.\n");
5377 break;
5378 case WOLFSSL_EARLY_DATA_ACCEPTED:
5379 printf("accepted\n");
5380 break;
5381 default:
5382 printf("unknown...\n");
5383 }
5384 }
5385 #endif /* WOLFSSL_EARLY_DATA */
5386
5387 #if defined(HAVE_SESSION_TICKET) || defined (WOLFSSL_DTLS13)
5388 static WC_INLINE int process_handshake_messages(WOLFSSL* ssl, int blocking,
5389 int* zero_return)
5390 {
5391 int timeout = DEFAULT_TIMEOUT_SEC;
5392 char foo[1];
5393 int ret = 0;
5394 int dtls;
5395
5396 if (zero_return == NULL || ssl == NULL)
5397 return -1;
5398
5399 dtls = wolfSSL_dtls(ssl);
5400 (void)dtls;
5401 *zero_return = 0;
5402
5403 if (!blocking) {
5404 #ifdef WOLFSSL_DTLS
5405 if (dtls) {
5406 timeout = wolfSSL_dtls_get_current_timeout(ssl);
5407
5408 #ifdef WOLFSSL_DTLS13
5409 if (timeout > 4 && wolfSSL_dtls13_use_quick_timeout(ssl))
5410 timeout /= 4;
5411 #endif /* WOLFSSL_DTLS13 */
5412 }
5413 #endif /* WOLFSSL_DTLS */
5414
5415 ret = tcp_select(wolfSSL_get_fd(ssl), timeout);
5416 if (ret == TEST_ERROR_READY) {
5417 err_sys("tcp_select error");
5418 return -1;
5419 }
5420
5421 if (ret == TEST_TIMEOUT) {
5422 #ifdef WOLFSSL_DTLS
5423 if (dtls) {
5424 ret = wolfSSL_dtls_got_timeout(ssl);

NetBurner, Inc.
1434 File Documentation

5425 if (ret != WOLFSSL_SUCCESS && !wolfSSL_want_write(ssl) &&


5426 !wolfSSL_want_read(ssl)) {
5427 err_sys("got timeout error");
5428 return -1;
5429 }
5430 }
5431 #endif /* WOLFSSL_DTLS */
5432 /* do the peek to detect if the peer closed the connection*/
5433 }
5434 }
5435
5436 ret = wolfSSL_peek(ssl, foo, 0);
5437 if (ret < 0 && !wolfSSL_want_read(ssl) && !wolfSSL_want_write(ssl)) {
5438 ret = wolfSSL_get_error(ssl, ret);
5439 if (ret == WOLFSSL_ERROR_ZERO_RETURN)
5440 *zero_return = 1;
5441 return -1;
5442 }
5443
5444 return 0;
5445 }
5446 #endif /* HAVE_SESSION_TICKET || WOLFSSL_DTLS13 */
5447
5448 static WC_INLINE void printBuffer(const byte *buf, int size)
5449 {
5450 int i;
5451 for (i = 0; i < size; i++)
5452 printf("%x", buf[i]);
5453 }
5454
5455 #if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA) && \
5456 defined(DEBUG_UNIT_TEST_CERTS)
5457 void DEBUG_WRITE_CERT_X509(WOLFSSL_X509* x509, const char* fileName);
5458 void DEBUG_WRITE_DER(const byte* der, int derSz, const char* fileName);
5459 #endif
5460
5461 #define DTLS_CID_BUFFER_SIZE 256
5462
5463 #endif /* wolfSSL_TEST_H */

22.302 version.h
1 /* wolfssl_version.h.in
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLFSSL_VERSION_H
14 #define WOLFSSL_VERSION_H
15
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 #define LIBWOLFSSL_VERSION_STRING "5.5.0"
22 #define LIBWOLFSSL_VERSION_HEX 0x05005000
23
24 #ifdef __cplusplus
25 }
26 #endif
27
28
29 #endif /* WOLFSSL_VERSION_H */
30

22.303 arc4.h File Reference


#include <wolfssl/wolfcrypt/types.h>

NetBurner, Inc.
22.304 arc4.h 1435

22.304 arc4.h
Go to the documentation of this file.
1 /* arc4.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_ARC4_H
17 #define WOLF_CRYPT_ARC4_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #ifdef WOLFSSL_ASYNC_CRYPT
26 #include <wolfssl/wolfcrypt/async.h>
27 #endif
28
29 enum {
30 ARC4_ENC_TYPE = 4, /* cipher unique type */
31 ARC4_STATE_SIZE = 256,
32 RC4_KEY_SIZE = 16, /* always 128bit */
33 };
34
35 /* ARC4 encryption and decryption */
36 typedef struct Arc4 {
37 byte x;
38 byte y;
39 byte state[ARC4_STATE_SIZE];
40 #ifdef WOLFSSL_ASYNC_CRYPT
41 WC_ASYNC_DEV asyncDev;
42 #endif
43 void* heap;
44 } Arc4;
45
46 WOLFSSL_API int wc_Arc4Process(Arc4* arc4, byte* out, const byte* in,
47 word32 length);
48 WOLFSSL_API int wc_Arc4SetKey(Arc4* arc4, const byte* key, word32 length);
49
50 WOLFSSL_API int wc_Arc4Init(Arc4* arc4, void* heap, int devId);
51 WOLFSSL_API void wc_Arc4Free(Arc4* arc4);
52
53 #ifdef __cplusplus
54 } /* extern "C" */
55 #endif
56
57
58 #endif /* WOLF_CRYPT_ARC4_H */
59

22.305 asn.h File Reference


#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/integer.h>
#include <wolfssl/wolfcrypt/dh.h>
#include <wolfssl/wolfcrypt/dsa.h>
#include <wolfssl/wolfcrypt/sha.h>
#include <wolfssl/wolfcrypt/md5.h>
#include <wolfssl/wolfcrypt/sha256.h>
#include <wolfssl/wolfcrypt/asn_public.h>

22.306 asn.h
Go to the documentation of this file.
1 /* asn.h
2 *

NetBurner, Inc.
1436 File Documentation

3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.


4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 /*
17
18 DESCRIPTION
19 This library provides the interface to Abstract Syntax Notation One (ASN.1) objects.
20 ASN.1 is a standard interface description language for defining data structures
21 that can be serialized and deserialized in a cross-platform way.
22
23 */
24 #ifndef WOLF_CRYPT_ASN_H
25 #define WOLF_CRYPT_ASN_H
26
27 #include <wolfssl/wolfcrypt/types.h>
28
29 #ifndef NO_ASN
30
31
32 #if !defined(NO_ASN_TIME) && defined(NO_TIME_H)
33 #define NO_ASN_TIME /* backwards compatibility with NO_TIME_H */
34 #endif
35
36 #include <wolfssl/wolfcrypt/integer.h>
37
38 /* fips declare of RsaPrivateKeyDecode @wc_fips */
39 #if defined(HAVE_FIPS) && !defined(NO_RSA) && \
40 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
41 #include <cyassl/ctaocrypt/rsa.h>
42 #endif
43
44 #ifndef NO_DH
45 #include <wolfssl/wolfcrypt/dh.h>
46 #endif
47 #ifndef NO_DSA
48 #include <wolfssl/wolfcrypt/dsa.h>
49 #endif
50 #ifndef NO_SHA
51 #include <wolfssl/wolfcrypt/sha.h>
52 #endif
53 #ifndef NO_MD5
54 #include <wolfssl/wolfcrypt/md5.h>
55 #endif
56 #include <wolfssl/wolfcrypt/sha256.h>
57 #include <wolfssl/wolfcrypt/asn_public.h> /* public interface */
58
59 #if defined(NO_SHA) && defined(NO_SHA256)
60 #define WC_SHA256_DIGEST_SIZE 32
61 #endif
62
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66
67 #ifndef EXTERNAL_SERIAL_SIZE
68 #define EXTERNAL_SERIAL_SIZE 32
69 #endif
70
71 enum {
72 ISSUER = 0,
73 SUBJECT = 1,
74
75 BEFORE = 0,
76 AFTER = 1
77 };
78
79 /* ASN Tags */
80 enum ASN_Tags {
81 ASN_EOC = 0x00,
82 ASN_BOOLEAN = 0x01,
83 ASN_INTEGER = 0x02,
84 ASN_BIT_STRING = 0x03,
85 ASN_OCTET_STRING = 0x04,
86 ASN_TAG_NULL = 0x05,
87 ASN_OBJECT_ID = 0x06,
88 ASN_ENUMERATED = 0x0a,
89 ASN_UTF8STRING = 0x0c,
90 ASN_SEQUENCE = 0x10,
91 ASN_SET = 0x11,
92 ASN_PRINTABLE_STRING = 0x13,
93 ASN_T61STRING = 0x14,

NetBurner, Inc.
22.306 asn.h 1437

94 ASN_IA5_STRING = 0x16,
95 ASN_UTC_TIME = 0x17,
96 ASN_GENERALIZED_TIME = 0x18,
97 ASN_UNIVERSALSTRING = 0x1c,
98 ASN_BMPSTRING = 0x1e,
99 ASN_TYPE_MASK = 0x1f,
100
101 ASN_LONG_LENGTH = 0x80,
102 ASN_INDEF_LENGTH = 0x80,
103
104 /* ASN_Flags - Bitmask */
105 ASN_CONSTRUCTED = 0x20,
106 ASN_APPLICATION = 0x40,
107 ASN_CONTEXT_SPECIFIC = 0x80,
108 ASN_PRIVATE = 0xC0,
109
110 CRL_EXTENSIONS = 0xa0,
111 ASN_EXTENSIONS = 0xa3,
112
113 /* GeneralName types */
114 ASN_OTHER_TYPE = 0x00,
115 ASN_RFC822_TYPE = 0x01,
116 ASN_DNS_TYPE = 0x02,
117 ASN_DIR_TYPE = 0x04,
118 ASN_URI_TYPE = 0x06, /* the value 6 is from GeneralName OID */
119 ASN_IP_TYPE = 0x07, /* the value 7 is from GeneralName OID */
120
121 /* PKCS #7 types */
122 ASN_ENC_CONTENT = 0x00,
123 ASN_OTHERNAME_VALUE = 0x00,
124
125 /* AuthorityKeyIdentifier fields */
126 ASN_AUTHKEYID_KEYID = 0x00,
127 ASN_AUTHKEYID_ISSUER = 0x01,
128 ASN_AUTHKEYID_SERIAL = 0x02,
129
130 /* GeneralSubtree fields */
131 ASN_SUBTREE_MIN = 0x00,
132 ASN_SUBTREE_MAX = 0x01,
133
134 /* x509 Cert Fields */
135 ASN_X509_CERT_VERSION = 0x00,
136
137 /* x509 Cert Extension Fields */
138 ASN_AKID_KEYID = 0x00,
139
140 /* ECC Key Fields */
141 ASN_ECC_PARAMS = 0x00,
142 ASN_ECC_PUBKEY = 0x01,
143
144 /* OneAsymmetricKey Fields */
145 ASN_ASYMKEY_ATTRS = 0x00,
146 ASN_ASYMKEY_PUBKEY = 0x01,
147 };
148
149 /* NOTE: If ASN_UTC_TIME_SIZE or ASN_GENERALIZED_TIME_SIZE are ever modified
150 * one needs to update the logic in asn.c function GetAsnTimeString()
151 * which depends on the size 14 and/or 16 to determine which format to
152 * place in the "buf" (output)
153 */
154 #define ASN_UTC_TIME_SIZE 14 /* Read note above before modifying */
155 #define ASN_GENERALIZED_TIME_SIZE 16 /* Read note above before modifying */
156 #define ASN_GENERALIZED_TIME_MAX 68
157
158 #ifdef WOLFSSL_ASN_TEMPLATE
159 /* Different data types that can be stored in ASNGetData/ASNSetData. */
160 enum ASNItem_DataType {
161 /* Default for tag type. */
162 ASN_DATA_TYPE_NONE = 0,
163 /* 8-bit integer value. */
164 ASN_DATA_TYPE_WORD8 = 1,
165 /* 16-bit integer value. */
166 ASN_DATA_TYPE_WORD16 = 2,
167 /* 32-bit integer value. */
168 ASN_DATA_TYPE_WORD32 = 4,
169 /* Buffer with data and length. */
170 ASN_DATA_TYPE_BUFFER = 5,
171 /* An expected/required buffer with data and length. */
172 ASN_DATA_TYPE_EXP_BUFFER = 6,
173 /* Replace the item with buffer (data and length). */
174 ASN_DATA_TYPE_REPLACE_BUFFER = 7,
175 /* Big number as an mp_int. */
176 ASN_DATA_TYPE_MP = 8,
177 /* Big number as a positive or negative mp_int. */
178 ASN_DATA_TYPE_MP_POS_NEG = 9,
179 /* ASN.1 CHOICE. A 0 terminated list of tags that are valid. */
180 ASN_DATA_TYPE_CHOICE = 10,

NetBurner, Inc.
1438 File Documentation

181 };
182
183 /* A template entry describing an ASN.1 item. */
184 typedef struct ASNItem {
185 /* Depth of ASN.1 item - how many constructed ASN.1 items above. */
186 byte depth;
187 /* BER/DER tag to expect. */
188 byte tag;
189 /* Whether the ASN.1 item is constructed. */
190 byte constructed:1;
191 /* Whether to parse the header only or skip data. If
192 * ASNSetData.data.buffer.data is supplied then this option gets
193 * overwritten and the child nodes get ignored. */
194 byte headerOnly:1;
195 /* Whether ASN.1 item is optional.
196 * - 0 means not optional
197 * - 1 means is optional
198 * - 2+ means one of these at the same level with same value must appear.
199 */
200 byte optional;
201 } ASNItem;
202
203 /* Dynamic data for setting (encoding) an ASN.1 item. */
204 typedef struct ASNSetData {
205 /* Reverse offset into buffer of ASN.1 item - calculated in SizeASN_Items().
206 * SetASN_Items() subtracts from total length to get usable value.
207 */
208 word32 offset;
209 /* Length of data in ASN.1 item - calculated in SizeASN_Items(). */
210 word32 length;
211 /* Different data type representation. */
212 union {
213 /* 8-bit integer value. */
214 byte u8;
215 /* 16-bit integer value. */
216 word16 u16;
217 /* 32-bit integer value. */
218 word32 u32;
219 /* Big number as an mp_int. */
220 mp_int* mp;
221 /* Buffer as data pointer and length. */
222 struct {
223 /* Data to write out. */
224 const byte* data;
225 /* Length of data to write out. */
226 word32 length;
227 } buffer;
228 } data;
229 /* Type of data stored in data field - enum ASNItem_DataType. */
230 byte dataType;
231 /* Don’t write this ASN.1 item out.
232 * Optional items are dependent on the data being encoded.
233 */
234 byte noOut;
235 } ASNSetData;
236
237 /* Dynamic data for getting (decoding) an ASN.1 item. */
238 typedef struct ASNGetData {
239 /* Offset into buffer where encoding starts. */
240 word32 offset;
241 /* Total length of data in ASN.1 item.
242 * BIT_STRING and INTEGER lengths include leading byte. */
243 word32 length;
244 union {
245 /* Pointer to 8-bit integer. */
246 byte* u8;
247 /* Pointer to 16-bit integer. */
248 word16* u16;
249 /* Pointer to 32-bit integer. */
250 word32* u32;
251 /* Pointer to mp_int for big number. */
252 mp_int* mp;
253 /* List of possible tags. Useful for CHOICE ASN.1 items. */
254 const byte* choice;
255 /* Buffer to copy into. */
256 struct {
257 /* Buffer to hold ASN.1 data. */
258 byte* data;
259 /* Maximum length of buffer. */
260 word32* length;
261 } buffer;
262 /* Refernce to ASN.1 item’s data. */
263 struct {
264 /* Pointer reference into input buffer. */
265 const byte* data;
266 /* Length of data. */
267 word32 length;

NetBurner, Inc.
22.306 asn.h 1439

268 } ref;
269 /* Data of an OBJECT_ID. */
270 struct {
271 /* OID data reference into input buffer. */
272 const byte* data;
273 /* Length of OID data. */
274 word32 length;
275 /* Type of OID expected. */
276 word32 type;
277 /* OID sum - 32-bit id. */
278 word32 sum;
279 } oid;
280 } data;
281 /* Type of data stored in data field - enum ASNItem_DataType. */
282 byte dataType;
283 /* Tag found in BER/DER item. */
284 byte tag;
285 } ASNGetData;
286
287 WOLFSSL_LOCAL int SizeASN_Items(const ASNItem* asn, ASNSetData *data,
288 int count, int* encSz);
289 WOLFSSL_LOCAL int SetASN_Items(const ASNItem* asn, ASNSetData *data, int count,
290 byte* output);
291 WOLFSSL_LOCAL int GetASN_Items(const ASNItem* asn, ASNGetData *data, int count,
292 int complete, const byte* input, word32* inOutIdx, word32 maxIdx);
293
294 #ifdef WOLFSSL_ASN_TEMPLATE_TYPE_CHECK
295 WOLFSSL_LOCAL void GetASN_Int8Bit(ASNGetData *dataASN, byte* num);
296 WOLFSSL_LOCAL void GetASN_Int16Bit(ASNGetData *dataASN, word16* num);
297 WOLFSSL_LOCAL void GetASN_Int32Bit(ASNGetData *dataASN, word32* num);
298 WOLFSSL_LOCAL void GetASN_Buffer(ASNGetData *dataASN, byte* data,
299 word32* length);
300 WOLFSSL_LOCAL void GetASN_ExpBuffer(ASNGetData *dataASN, const byte* data,
301 word32 length);
302 WOLFSSL_LOCAL void GetASN_MP(ASNGetData *dataASN, mp_int* num);
303 WOLFSSL_LOCAL void GetASN_MP_PosNeg(ASNGetData *dataASN, mp_int* num);
304 WOLFSSL_LOCAL void GetASN_Choice(ASNGetData *dataASN, const byte* options);
305 WOLFSSL_LOCAL void GetASN_Boolean(ASNGetData *dataASN, byte* num);
306 WOLFSSL_LOCAL void GetASN_OID(ASNGetData *dataASN, int oidType);
307 WOLFSSL_LOCAL void GetASN_GetConstRef(ASNGetData * dataASN, const byte** data,
308 word32* length);
309 WOLFSSL_LOCAL void GetASN_GetRef(ASNGetData * dataASN, byte** data,
310 word32* length);
311 WOLFSSL_LOCAL void GetASN_OIDData(ASNGetData * dataASN, byte** data,
312 word32* length);
313 WOLFSSL_LOCAL void SetASN_Boolean(ASNSetData *dataASN, byte val);
314 WOLFSSL_LOCAL void SetASN_Int8Bit(ASNSetData *dataASN, byte num);
315 WOLFSSL_LOCAL void SetASN_Int16Bit(ASNSetData *dataASN, word16 num);
316 WOLFSSL_LOCAL void SetASN_Buffer(ASNSetData *dataASN, const byte* data,
317 word32 length);
318 WOLFSSL_LOCAL void SetASN_ReplaceBuffer(ASNSetData *dataASN, const byte* data,
319 word32 length);
320 WOLFSSL_LOCAL void SetASN_MP(ASNSetData *dataASN, mp_int* num);
321 WOLFSSL_LOCAL void SetASN_OID(ASNSetData *dataASN, int oid, int oidType);
322 #else
323 /* Setup ASN data item to get an 8-bit number.
324 *
325 * @param [in] dataASN Dynamic ASN data item.
326 * @param [in] num Pointer to an 8-bit variable.
327 */
328 #define GetASN_Int8Bit(dataASN, num) \
329 do { \
330 (dataASN)->dataType = ASN_DATA_TYPE_WORD8; \
331 (dataASN)->data.u8 = num; \
332 } while (0)
333
334 /* Setup ASN data item to get a 16-bit number.
335 *
336 * @param [in] dataASN Dynamic ASN data item.
337 * @param [in] num Pointer to a 16-bit variable.
338 */
339 #define GetASN_Int16Bit(dataASN, num) \
340 do { \
341 (dataASN)->dataType = ASN_DATA_TYPE_WORD16; \
342 (dataASN)->data.u16 = num; \
343 } while (0)
344
345 /* Setup ASN data item to get a 32-bit number.
346 *
347 * @param [in] dataASN Dynamic ASN data item.
348 * @param [in] num Pointer to a 32-bit variable.
349 */
350 #define GetASN_Int32Bit(dataASN, num) \
351 do { \
352 (dataASN)->dataType = ASN_DATA_TYPE_WORD32; \
353 (dataASN)->data.u32 = num; \
354 } while (0)

NetBurner, Inc.
1440 File Documentation

355
356 /* Setup ASN data item to get data into a buffer of a specific length.
357 *
358 * @param [in] dataASN Dynamic ASN data item.
359 * @param [in] d Buffer to hold data.
360 * @param [in] l Length of buffer in bytes.
361 */
362 #define GetASN_Buffer(dataASN, d, l) \
363 do { \
364 (dataASN)->dataType = ASN_DATA_TYPE_BUFFER; \
365 (dataASN)->data.buffer.data = d; \
366 (dataASN)->data.buffer.length = l; \
367 } while (0)
368
369 /* Setup ASN data item to check parsed data against expected buffer.
370 *
371 * @param [in] dataASN Dynamic ASN data item.
372 * @param [in] d Buffer containing expected data.
373 * @param [in] l Length of buffer in bytes.
374 */
375 #define GetASN_ExpBuffer(dataASN, d, l) \
376 do { \
377 (dataASN)->dataType = ASN_DATA_TYPE_EXP_BUFFER; \
378 (dataASN)->data.ref.data = d; \
379 (dataASN)->data.ref.length = l; \
380 } while (0)
381
382 /* Setup ASN data item to get a number into an mp_int.
383 *
384 * @param [in] dataASN Dynamic ASN data item.
385 * @param [in] num Multi-precision number object.
386 */
387 #define GetASN_MP(dataASN, num) \
388 do { \
389 (dataASN)->dataType = ASN_DATA_TYPE_MP; \
390 (dataASN)->data.mp = num; \
391 } while (0)
392
393 /* Setup ASN data item to get a positive or negative number into an mp_int.
394 *
395 * @param [in] dataASN Dynamic ASN data item.
396 * @param [in] num Multi-precision number object.
397 */
398 #define GetASN_MP_PosNeg(dataASN, num) \
399 do { \
400 (dataASN)->dataType = ASN_DATA_TYPE_MP_POS_NEG; \
401 (dataASN)->data.mp = num; \
402 } while (0)
403
404 /* Setup ASN data item to be a choice of tags.
405 *
406 * @param [in] dataASN Dynamic ASN data item.
407 * @param [in] choice 0 terminated list of tags that are valid.
408 */
409 #define GetASN_Choice(dataASN, options) \
410 do { \
411 (dataASN)->dataType = ASN_DATA_TYPE_CHOICE; \
412 (dataASN)->data.choice = options; \
413 } while (0)
414
415 /* Setup ASN data item to get a boolean value.
416 *
417 * @param [in] dataASN Dynamic ASN data item.
418 * @param [in] num Pointer to an 8-bit variable.
419 */
420 #define GetASN_Boolean(dataASN, num) \
421 do { \
422 (dataASN)->dataType = ASN_DATA_TYPE_NONE; \
423 (dataASN)->data.u8 = num; \
424 } while (0)
425
426 /* Setup ASN data item to be a an OID of a specific type.
427 *
428 * @param [in] dataASN Dynamic ASN data item.
429 * @param [in] oidType Type of OID to expect.
430 */
431 #define GetASN_OID(dataASN, oidType) \
432 (dataASN)->data.oid.type = oidType
433
434 /* Get the data and length from an ASN data item.
435 *
436 * @param [in] dataASN Dynamic ASN data item.
437 * @param [out] d Pointer to data of item.
438 * @param [out] l Length of buffer in bytes.
439 */
440 #define GetASN_GetConstRef(dataASN, d, l) \
441 do { \

NetBurner, Inc.
22.306 asn.h 1441

442 *(d) = (dataASN)->data.ref.data; \


443 *(l) = (dataASN)->data.ref.length; \
444 } while (0)
445
446 /* Get the data and length from an ASN data item.
447 *
448 * @param [in] dataASN Dynamic ASN data item.
449 * @param [out] d Pointer to data of item.
450 * @param [out] l Length of buffer in bytes.
451 */
452 #define GetASN_GetRef(dataASN, d, l) \
453 do { \
454 *(d) = (byte*)(dataASN)->data.ref.data; \
455 *(l) = (dataASN)->data.ref.length; \
456 } while (0)
457
458 /* Get the data and length from an ASN data item that is an OID.
459 *
460 * @param [in] dataASN Dynamic ASN data item.
461 * @param [out] d Pointer to .
462 * @param [out] l Length of buffer in bytes.
463 */
464 #define GetASN_OIDData(dataASN, d, l) \
465 do { \
466 *(d) = (byte*)(dataASN)->data.oid.data; \
467 *(l) = (dataASN)->data.oid.length; \
468 } while (0)
469
470 /* Setup an ASN data item to set a boolean.
471 *
472 * @param [in] dataASN Dynamic ASN data item.
473 * @param [in] val Boolean value.
474 */
475 #define SetASN_Boolean(dataASN, val) \
476 do { \
477 (dataASN)->dataType = ASN_DATA_TYPE_NONE; \
478 (dataASN)->data.u8 = val; \
479 } while (0)
480
481 /* Setup an ASN data item to set an 8-bit number.
482 *
483 * @param [in] dataASN Dynamic ASN data item.
484 * @param [in] num 8-bit number to set.
485 */
486 #define SetASN_Int8Bit(dataASN, num) \
487 do { \
488 (dataASN)->dataType = ASN_DATA_TYPE_WORD8; \
489 (dataASN)->data.u8 = num; \
490 } while (0)
491
492 /* Setup an ASN data item to set a 16-bit number.
493 *
494 * @param [in] dataASN Dynamic ASN data item.
495 * @param [in] num 16-bit number to set.
496 */
497 #define SetASN_Int16Bit(dataASN, num) \
498 do { \
499 (dataASN)->dataType = ASN_DATA_TYPE_WORD16; \
500 (dataASN)->data.u16 = num; \
501 } while (0)
502
503 /* Setup an ASN data item to set the data in a buffer.
504 *
505 * @param [in] dataASN Dynamic ASN data item.
506 * @param [in] d Buffer containing data to set.
507 * @param [in] l Length of data in buffer in bytes.
508 */
509 #define SetASN_Buffer(dataASN, d, l) \
510 do { \
511 (dataASN)->data.buffer.data = d; \
512 (dataASN)->data.buffer.length = l; \
513 } while (0)
514
515 /* Setup an ASN data item to set the DER encode data in a buffer.
516 *
517 * @param [in] dataASN Dynamic ASN data item.
518 * @param [in] d Buffer containing BER encoded data to set.
519 * @param [in] l Length of data in buffer in bytes.
520 */
521 #define SetASN_ReplaceBuffer(dataASN, d, l) \
522 do { \
523 (dataASN)->dataType = ASN_DATA_TYPE_REPLACE_BUFFER; \
524 (dataASN)->data.buffer.data = d; \
525 (dataASN)->data.buffer.length = l; \
526 } while (0)
527
528 /* Setup an ASN data item to set an muli-precision number.

NetBurner, Inc.
1442 File Documentation

529 *
530 * @param [in] dataASN Dynamic ASN data item.
531 * @param [in] num Multi-precision number.
532 */
533 #define SetASN_MP(dataASN, num) \
534 do { \
535 (dataASN)->dataType = ASN_DATA_TYPE_MP; \
536 (dataASN)->data.mp = num; \
537 } while (0)
538
539 /* Setup an ASN data item to set an OID based on id and type.
540 *
541 * oid and oidType pair are unique.
542 *
543 * @param [in] dataASN Dynamic ASN data item.
544 * @param [in] oid OID identifier.
545 * @param [in] oidType Type of OID.
546 */
547 #define SetASN_OID(dataASN, oid, oidType) \
548 (dataASN)->data.buffer.data = OidFromId(oid, oidType, \
549 &(dataASN)->data.buffer.length)
550 #endif /* WOLFSSL_ASN_TEMPLATE_TYPE_CHECK */
551
552
553 /* Get address at the start of the BER item.
554 *
555 * @param [in] dataASN Dynamic ASN data item.
556 * @param [in] in Input buffer.
557 * @return Address at start of BER item.
558 */
559 #define GetASNItem_Addr(dataASN, in) \
560 ((in) + (dataASN).offset)
561
562 /* Get length of a BER item - including tag and length.
563 *
564 * @param [in] dataASN Dynamic ASN data item.
565 * @param [in] in Input buffer.
566 * @return Length of a BER item.
567 */
568 #define GetASNItem_Length(dataASN, in) \
569 ((dataASN).length + (word32)((dataASN).data.buffer.data - (in)) - \
570 (dataASN).offset)
571
572 /* Get the index of a BER item’s data.
573 *
574 * @param [in] dataASN Dynamic ASN data item.
575 * @param [in] in Input buffer.
576 * @return Index of a BER item’s data.
577 */
578 #define GetASNItem_DataIdx(dataASN, in) \
579 (word32)((dataASN).data.ref.data - (in))
580
581 /* Get the end index of a BER item - index of the start of the next item.
582 *
583 * @param [in] dataASN Dynamic ASN data item.
584 * @param [in] in Input buffer.
585 * @return End index of a BER item.
586 */
587 #define GetASNItem_EndIdx(dataASN, in) \
588 ((word32)((dataASN).data.ref.data - (in)) + \
589 (dataASN).data.ref.length)
590
591 /* For a BIT_STRING, get the unused bits byte.
592 *
593 * @param [in] dataASN Dynamic ASN data item.
594 * @return Unused bits byte in BIT_STRING.
595 */
596 #define GetASNItem_UnusedBits(dataASN) \
597 (*((dataASN).data.ref.data - 1))
598
599 /* Set the data items at indices start to end inclusive to not be encoded.
600 *
601 * @param [in] dataASN Dynamic ASN data item.
602 * @param [in] start First item not to be encoded.
603 * @param [in] end Last item not to be encoded.
604 */
605 #define SetASNItem_NoOut(dataASN, start, end) \
606 do { \
607 int ii; \
608 for (ii = (start); ii <= (end); ii++) { \
609 (dataASN)[ii].noOut = 1; \
610 } \
611 } \
612 while (0)
613
614 /* Set the data items below node to not be encoded.
615 *

NetBurner, Inc.
22.306 asn.h 1443

616 * @param [in] dataASN Dynamic ASN data item.


617 * @param [in] node Node who’s children should not be encoded.
618 * @param [in] dataASNLen Number of items in dataASN.
619 */
620 #define SetASNItem_NoOutBelow(dataASN, asn, node, dataASNLen) \
621 do { \
622 int ii; \
623 for (ii = (node) + 1; ii < (int)(dataASNLen); ii++) { \
624 if ((asn)[ii].depth <= (asn)[node].depth) \
625 break; \
626 (dataASN)[ii].noOut = 1; \
627 } \
628 } \
629 while (0)
630
631 /* Set the node and all nodes below to not be encoded.
632 *
633 * @param [in] dataASN Dynamic ASN data item.
634 * @param [in] node Node which should not be encoded. Child nodes will
635 * also not be encoded.
636 * @param [in] dataASNLen Number of items in dataASN.
637 */
638 #define SetASNItem_NoOutNode(dataASN, asn, node, dataASNLen) \
639 do { \
640 int ii; \
641 (dataASN)[node].noOut = 1; \
642 for (ii = (node) + 1; ii < (int)(dataASNLen); ii++) { \
643 if ((asn)[ii].depth <= (asn)[node].depth) \
644 break; \
645 (dataASN)[ii].noOut = 1; \
646 } \
647 } \
648 while (0)
649
650 #endif /* WOLFSSL_ASN_TEMPLATE */
651
652
653 enum DN_Tags {
654 ASN_DN_NULL = 0x00,
655 ASN_COMMON_NAME = 0x03, /* CN */
656 ASN_SUR_NAME = 0x04, /* SN */
657 ASN_SERIAL_NUMBER = 0x05, /* serialNumber */
658 ASN_COUNTRY_NAME = 0x06, /* C */
659 ASN_LOCALITY_NAME = 0x07, /* L */
660 ASN_STATE_NAME = 0x08, /* ST */
661 ASN_STREET_ADDR = 0x09, /* street */
662 ASN_ORG_NAME = 0x0a, /* O */
663 ASN_ORGUNIT_NAME = 0x0b, /* OU */
664 ASN_BUS_CAT = 0x0f, /* businessCategory */
665 ASN_POSTAL_CODE = 0x11, /* postalCode */
666 ASN_USER_ID = 0x12, /* UserID */
667 #ifdef WOLFSSL_CERT_NAME_ALL
668 ASN_NAME = 0x2a, /* name */
669 ASN_GIVEN_NAME = 0x29, /* GN */
670 ASN_INITIALS = 0x2b, /* initials */
671 ASN_DNQUALIFIER = 0x2e, /* dnQualifier */
672 #endif /* WOLFSSL_CERT_NAME_ALL */
673
674 ASN_EMAIL_NAME = 0x98, /* not actual OID (see attrEmailOid) */
675 ASN_CUSTOM_NAME = 0x99, /* not actual OID (see CertOidField) */
676
677 /* pilot attribute types
678 * OID values of 0.9.2342.19200300.100.1.* */
679 ASN_FAVOURITE_DRINK = 0x05, /* favouriteDrink */
680 ASN_DOMAIN_COMPONENT = 0x19 /* DC */
681 };
682
683 /* This is the size of the smallest possible PEM header and footer */
684 extern const int pem_struct_min_sz;
685
686 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
687 typedef struct WOLFSSL_ObjectInfo {
688 int nid;
689 int id;
690 word32 type;
691 const char* sName;
692 const char* lName;
693 } WOLFSSL_ObjectInfo;
694 extern const size_t wolfssl_object_info_sz;
695 extern const WOLFSSL_ObjectInfo wolfssl_object_info[];
696 #endif /* defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) */
697
698 /* DN Tag Strings */
699 #define WOLFSSL_COMMON_NAME "/CN="
700 #define WOLFSSL_LN_COMMON_NAME "/commonName="
701 #define WOLFSSL_SUR_NAME "/SN="
702 #ifdef WOLFSSL_CERT_NAME_ALL

NetBurner, Inc.
1444 File Documentation

703 #define WOLFSSL_NAME "/N="


704 #define WOLFSSL_INITIALS "/initials="
705 #define WOLFSSL_GIVEN_NAME "/GN="
706 #define WOLFSSL_DNQUALIFIER "/dnQualifier="
707 #endif /* WOLFSSL_CERT_NAME_ALL */
708 #define WOLFSSL_SERIAL_NUMBER "/serialNumber="
709 #define WOLFSSL_COUNTRY_NAME "/C="
710 #define WOLFSSL_LN_COUNTRY_NAME "/countryName="
711 #define WOLFSSL_LOCALITY_NAME "/L="
712 #define WOLFSSL_LN_LOCALITY_NAME "/localityName="
713 #define WOLFSSL_STATE_NAME "/ST="
714 #define WOLFSSL_LN_STATE_NAME "/stateOrProvinceName="
715 #define WOLFSSL_STREET_ADDR_NAME "/street="
716 #define WOLFSSL_LN_STREET_ADDR_NAME "/streetAddress="
717 #define WOLFSSL_POSTAL_NAME "/postalCode="
718 #define WOLFSSL_ORG_NAME "/O="
719 #define WOLFSSL_LN_ORG_NAME "/organizationName="
720 #define WOLFSSL_ORGUNIT_NAME "/OU="
721 #define WOLFSSL_LN_ORGUNIT_NAME "/organizationalUnitName="
722 #define WOLFSSL_DOMAIN_COMPONENT "/DC="
723 #define WOLFSSL_LN_DOMAIN_COMPONENT "/domainComponent="
724 #define WOLFSSL_BUS_CAT "/businessCategory="
725 #define WOLFSSL_JOI_C "/jurisdictionC="
726 #define WOLFSSL_JOI_ST "/jurisdictionST="
727 #define WOLFSSL_EMAIL_ADDR "/emailAddress="
728
729 #define WOLFSSL_USER_ID "/UID="
730 #define WOLFSSL_DOMAIN_COMPONENT "/DC="
731 #define WOLFSSL_FAVOURITE_DRINK "/favouriteDrink="
732
733 #if defined(WOLFSSL_APACHE_HTTPD)
734 /* otherName strings */
735 #define WOLFSSL_SN_MS_UPN "msUPN"
736 #define WOLFSSL_LN_MS_UPN "Microsoft User Principal Name"
737 #define WOLFSSL_MS_UPN_SUM 265
738 #define WOLFSSL_SN_DNS_SRV "id-on-dnsSRV"
739 #define WOLFSSL_LN_DNS_SRV "SRVName"
740 /* TLS features extension strings */
741 #define WOLFSSL_SN_TLS_FEATURE "tlsfeature"
742 #define WOLFSSL_LN_TLS_FEATURE "TLS Feature"
743 #define WOLFSSL_TLS_FEATURE_SUM 92
744 #endif
745
746 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
747 /* NIDs */
748 enum
749 {
750 NID_undef = 0,
751 NID_netscape_cert_type = NID_undef,
752 NID_des = 66,
753 NID_des3 = 67,
754 NID_sha256 = 672,
755 NID_sha384 = 673,
756 NID_sha512 = 674,
757 NID_sha512_224 = 1094,
758 NID_sha512_256 = 1095,
759 NID_pkcs7_signed = 22,
760 NID_pkcs7_enveloped = 23,
761 NID_pkcs7_signedAndEnveloped = 24,
762 NID_pkcs9_unstructuredName = 49,
763 NID_pkcs9_contentType = 50, /* 1.2.840.113549.1.9.3 */
764 NID_pkcs9_challengePassword = 54,
765 NID_hw_name_oid = 73,
766 NID_id_pkix_OCSP_basic = 74,
767 NID_any_policy = 75,
768 NID_anyExtendedKeyUsage = 76,
769 NID_givenName = 99, /* 2.5.4.42 */
770 NID_initials = 101, /* 2.5.4.43 */
771 NID_title = 106,
772 NID_description = 107,
773 NID_basic_constraints = 133,
774 NID_key_usage = 129, /* 2.5.29.15 */
775 NID_ext_key_usage = 151, /* 2.5.29.37 */
776 NID_subject_key_identifier = 128,
777 NID_authority_key_identifier = 149,
778 NID_private_key_usage_period = 130, /* 2.5.29.16 */
779 NID_subject_alt_name = 131,
780 NID_issuer_alt_name = 132,
781 NID_info_access = 69,
782 NID_sinfo_access = 79, /* id-pe 11 */
783 NID_name_constraints = 144, /* 2.5.29.30 */
784 NID_crl_distribution_points = 145, /* 2.5.29.31 */
785 NID_certificate_policies = 146,
786 NID_policy_mappings = 147,
787 NID_policy_constraints = 150,
788 NID_inhibit_any_policy = 168, /* 2.5.29.54 */
789 NID_tlsfeature = 1020, /* id-pe 24 */

NetBurner, Inc.
22.306 asn.h 1445

790 NID_buildingName = 1494,


791
792
793 NID_dnQualifier = 174, /* 2.5.4.46 */
794 NID_commonName = 14, /* CN Changed to not conflict
795 * with PBE_SHA1_DES3 */
796 NID_name = 173, /* N , OID = 2.5.4.41 */
797 NID_surname = 0x04, /* SN */
798 NID_serialNumber = 0x05, /* serialNumber */
799 NID_countryName = 0x06, /* C */
800 NID_localityName = 0x07, /* L */
801 NID_stateOrProvinceName = 0x08, /* ST */
802 NID_streetAddress = ASN_STREET_ADDR, /* street */
803 NID_organizationName = 0x0a, /* O */
804 NID_organizationalUnitName = 0x0b, /* OU */
805 NID_jurisdictionCountryName = 0xc,
806 NID_jurisdictionStateOrProvinceName = 0xd,
807 NID_businessCategory = ASN_BUS_CAT,
808 NID_domainComponent = ASN_DOMAIN_COMPONENT,
809 NID_postalCode = ASN_POSTAL_CODE, /* postalCode */
810 NID_favouriteDrink = 462,
811 NID_userId = 458,
812 NID_emailAddress = 0x30, /* emailAddress */
813 NID_id_on_dnsSRV = 82, /* 1.3.6.1.5.5.7.8.7 */
814 NID_ms_upn = 265, /* 1.3.6.1.4.1.311.20.2.3 */
815
816 NID_X9_62_prime_field = 406 /* 1.2.840.10045.1.1 */
817 };
818 #endif /* OPENSSL_EXTRA */
819
820 enum ECC_TYPES
821 {
822 ECC_PREFIX_0 = 160,
823 ECC_PREFIX_1 = 161
824 };
825
826 #ifdef WOLFSSL_CERT_PIV
827 enum PIV_Tags {
828 ASN_PIV_CERT = 0x0A,
829 ASN_PIV_NONCE = 0x0B,
830 ASN_PIV_SIGNED_NONCE = 0x0C,
831
832 ASN_PIV_TAG_CERT = 0x70,
833 ASN_PIV_TAG_CERT_INFO = 0x71,
834 ASN_PIV_TAG_MSCUID = 0x72,
835 ASN_PIV_TAG_ERR_DET = 0xFE,
836
837 /* certificate info masks */
838 ASN_PIV_CERT_INFO_COMPRESSED = 0x03,
839 ASN_PIV_CERT_INFO_ISX509 = 0x04,
840 /* GZIP is 0x01 */
841 ASN_PIV_CERT_INFO_GZIP = 0x01,
842 };
843 #endif /* WOLFSSL_CERT_PIV */
844
845
846 #define ASN_JOI_PREFIX_SZ 10
847 #define ASN_JOI_PREFIX "\x2b\x06\x01\x04\x01\x82\x37\x3c\x02\x01"
848 #define ASN_JOI_C 0x3
849 #define ASN_JOI_ST 0x2
850
851 #ifndef WC_ASN_NAME_MAX
852 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
853 defined(WOLFSSL_CERT_EXT)
854 #define WC_ASN_NAME_MAX 330
855 #else
856 #define WC_ASN_NAME_MAX 256
857 #endif
858 #endif
859
860 enum Misc_ASN {
861 MAX_SALT_SIZE = 64, /* MAX PKCS Salt length */
862 MAX_IV_SIZE = 64, /* MAX PKCS Iv length */
863 ASN_BOOL_SIZE = 2, /* including type */
864 ASN_ECC_HEADER_SZ = 2, /* String type + 1 byte len */
865 ASN_ECC_CONTEXT_SZ = 2, /* Content specific type + 1 byte len */
866 #ifdef NO_SHA
867 KEYID_SIZE = WC_SHA256_DIGEST_SIZE,
868 #else
869 KEYID_SIZE = WC_SHA_DIGEST_SIZE,
870 #endif
871 RSA_INTS = 8, /* RSA ints in private key */
872 DSA_PARAM_INTS = 3, /* DSA paramater ints */
873 RSA_PUB_INTS = 2, /* RSA ints in public key */
874 DSA_PUB_INTS = 4, /* DSA ints in public key */
875 DSA_INTS = 5, /* DSA ints in private key */
876 MIN_DATE_SIZE = 12,

NetBurner, Inc.
1446 File Documentation

877 MAX_DATE_SIZE = 32,


878 ASN_GEN_TIME_SZ = 15, /* 7 numbers * 2 + Zulu tag */
879 #ifndef NO_RSA
880 #ifdef WOLFSSL_HAPROXY
881 MAX_ENCODED_SIG_SZ = 1024, /* Supports 8192 bit keys */
882 #else
883 MAX_ENCODED_SIG_SZ = 512, /* Supports 4096 bit keys */
884 #endif
885 #elif defined(HAVE_ECC)
886 MAX_ENCODED_SIG_SZ = 140,
887 #elif defined(HAVE_CURVE448)
888 MAX_ENCODED_SIG_SZ = 114,
889 #else
890 MAX_ENCODED_SIG_SZ = 64,
891 #endif
892 MAX_SIG_SZ = 256,
893 MAX_ALGO_SZ = 20,
894 MAX_SHORT_SZ = 6, /* asn int + byte len + 4 byte length */
895 MAX_LENGTH_SZ = 4, /* Max length size for DER encoding */
896 MAX_SEQ_SZ = 5, /* enum(seq | con) + length(4) */
897 MAX_SET_SZ = 5, /* enum(set | con) + length(4) */
898 MAX_OCTET_STR_SZ = 5, /* enum(set | con) + length(4) */
899 MAX_EXP_SZ = 5, /* enum(contextspec|con|exp) + length(4) */
900 MAX_PRSTR_SZ = 5, /* enum(prstr) + length(4) */
901 MAX_VERSION_SZ = 5, /* enum + id + version(byte) + (header(2))*/
902 MAX_ENCODED_DIG_ASN_SZ= 9, /* enum(bit or octet) + length(4) */
903 MAX_ENCODED_DIG_SZ = 64 + MAX_ENCODED_DIG_ASN_SZ, /* asn header + sha512 */
904 MAX_RSA_INT_SZ = 517, /* RSA raw sz 4096 for bits + tag + len(4) */
905 MAX_DSA_INT_SZ = 389, /* DSA raw sz 3072 for bits + tag + len(4) */
906 MAX_DSA_PUBKEY_SZ = (DSA_PUB_INTS * MAX_DSA_INT_SZ) + (2 * MAX_SEQ_SZ) +
907 2 + MAX_LENGTH_SZ, /* Maximum size of a DSA public
908 key taken from wc_SetDsaPublicKey. */
909 MAX_DSA_PRIVKEY_SZ = (DSA_INTS * MAX_DSA_INT_SZ) + MAX_SEQ_SZ +
910 MAX_VERSION_SZ, /* Maximum size of a DSA Private
911 key taken from DsaKeyIntsToDer. */
912 MAX_RSA_E_SZ = 16, /* Max RSA public e size */
913 MAX_CA_SZ = 32, /* Max encoded CA basic constraint length */
914 MAX_SN_SZ = 35, /* Max encoded serial number (INT) length */
915 MAX_DER_DIGEST_SZ = MAX_ENCODED_DIG_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ,
916 /* Maximum DER digest size */
917 MAX_DER_DIGEST_ASN_SZ = MAX_ENCODED_DIG_ASN_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ,
918 /* Maximum DER digest ASN header size */
919 /* Max X509 header length indicates the max length + 2 (’\n’, ’\0’) */
920 MAX_X509_HEADER_SZ = (37 + 2), /* Maximum PEM Header/Footer Size */
921 #ifdef WOLFSSL_CERT_GEN
922 #ifdef WOLFSSL_CERT_REQ
923 /* Max encoded cert req attributes length */
924 MAX_ATTRIB_SZ = MAX_SEQ_SZ * 4 + (11 + MAX_SEQ_SZ) * 3 +
925 MAX_PRSTR_SZ * 2 + CTC_NAME_SIZE * 2,
926 /* 11 is the OID size */
927 #endif
928 #if defined(WOLFSSL_ALT_NAMES) || defined(WOLFSSL_CERT_EXT)
929 MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + CTC_MAX_ALT_SIZE,
930 #else
931 MAX_EXTENSIONS_SZ = 1 + MAX_LENGTH_SZ + MAX_CA_SZ,
932 #endif
933 /* Max total extensions, id + len + others */
934 #endif
935 #if defined(WOLFSSL_CERT_EXT) || defined(OPENSSL_EXTRA) || \
936 defined(HAVE_PKCS7) || defined(OPENSSL_EXTRA_X509_SMALL) || \
937 defined(HAVE_OID_DECODING) || defined(HAVE_OID_ENCODING)
938 MAX_OID_SZ = 32, /* Max DER length of OID*/
939 MAX_OID_STRING_SZ = 64, /* Max string length representation of OID*/
940 #endif
941 #ifdef WOLFSSL_CERT_EXT
942 MAX_KID_SZ = 45, /* Max encoded KID length (SHA-256 case) */
943 MAX_KEYUSAGE_SZ = 18, /* Max encoded Key Usage length */
944 MAX_EXTKEYUSAGE_SZ = 12 + (6 * (8 + 2)) +
945 CTC_MAX_EKU_OID_SZ, /* Max encoded ExtKeyUsage
946 (SEQ/LEN + OBJID + OCTSTR/LEN + SEQ +
947 (6 * (SEQ + OID))) */
948 #ifndef IGNORE_NETSCAPE_CERT_TYPE
949 MAX_NSCERTTYPE_SZ = MAX_SEQ_SZ + 17, /* SEQ + OID + OCTET STR +
950 * NS BIT STR */
951 #endif
952 MAX_CERTPOL_NB = CTC_MAX_CERTPOL_NB,/* Max number of Cert Policy */
953 MAX_CERTPOL_SZ = CTC_MAX_CERTPOL_SZ,
954 #endif
955 MAX_AIA_SZ = 2, /* Max Authority Info Access extension size*/
956 OCSP_NONCE_EXT_SZ = 35, /* OCSP Nonce Extension size */
957 MAX_OCSP_EXT_SZ = 58, /* Max OCSP Extension length */
958 MAX_OCSP_NONCE_SZ = 16, /* OCSP Nonce size */
959 MAX_PUBLIC_KEY_SZ = MAX_DSA_PUBKEY_SZ + MAX_ALGO_SZ + MAX_SEQ_SZ * 2,
960 #ifdef WOLFSSL_ENCRYPTED_KEYS
961 HEADER_ENCRYPTED_KEY_SIZE = 88,/* Extra header size for encrypted key */
962 #else
963 HEADER_ENCRYPTED_KEY_SIZE = 0,

NetBurner, Inc.
22.306 asn.h 1447

964 #endif
965 TRAILING_ZERO = 1, /* Used for size of zero pad */
966 ASN_TAG_SZ = 1, /* single byte ASN.1 tag */
967 MIN_VERSION_SZ = 3, /* Min bytes needed for GetMyVersion */
968 MAX_X509_VERSION = 3, /* Max X509 version allowed */
969 MIN_X509_VERSION = 0, /* Min X509 version allowed */
970 WOLFSSL_X509_V1 = 0,
971 WOLFSSL_X509_V2 = 1,
972 WOLFSSL_X509_V3 = 2,
973 #if defined(OPENSSL_ALL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \
974 defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) || \
975 defined(OPENSSL_EXTRA) || defined(HAVE_PKCS7)
976 MAX_TIME_STRING_SZ = 25, /* Max length of formatted time string */
977 #endif
978
979 PKCS5_SALT_SZ = 8,
980
981 PEM_LINE_SZ = 64, /* Length of Base64 encoded line, not including new line */
982 PEM_LINE_LEN = PEM_LINE_SZ + 12, /* PEM line max + fudge */
983
984 COUNTRY_CODE_LEN = 2, /* RFC 3739 */
985 };
986
987 #ifndef WC_MAX_NAME_ENTRIES
988 /* entries added to x509 name struct */
989 #ifdef OPENSSL_EXTRA
990 #define WC_MAX_NAME_ENTRIES 16
991 #else
992 #define WC_MAX_NAME_ENTRIES 14
993 #endif
994 #endif
995 #define MAX_NAME_ENTRIES WC_MAX_NAME_ENTRIES
996
997
998 enum Oid_Types {
999 oidHashType = 0,
1000 oidSigType = 1,
1001 oidKeyType = 2,
1002 oidCurveType = 3,
1003 oidBlkType = 4,
1004 oidOcspType = 5,
1005 oidCertExtType = 6,
1006 oidCertAuthInfoType = 7,
1007 oidCertPolicyType = 8,
1008 oidCertAltNameType = 9,
1009 oidCertKeyUseType = 10,
1010 oidKdfType = 11,
1011 oidKeyWrapType = 12,
1012 oidCmsKeyAgreeType = 13,
1013 oidPBEType = 14,
1014 oidHmacType = 15,
1015 oidCompressType = 16,
1016 oidCertNameType = 17,
1017 oidTlsExtType = 18,
1018 oidCrlExtType = 19,
1019 oidCsrAttrType = 20,
1020 #ifdef WOLFSSL_SUBJ_DIR_ATTR
1021 oidSubjDirAttrType = 21,
1022 #endif
1023 oidIgnoreType
1024 };
1025
1026
1027 enum Hash_Sum {
1028 MD2h = 646,
1029 MD5h = 649,
1030 SHAh = 88,
1031 SHA224h = 417,
1032 SHA256h = 414,
1033 SHA384h = 415,
1034 SHA512h = 416,
1035 SHA512_224h = 418,
1036 SHA512_256h = 419,
1037 SHA3_224h = 420,
1038 SHA3_256h = 421,
1039 SHA3_384h = 422,
1040 SHA3_512h = 423,
1041 SHAKE128h = 424,
1042 SHAKE256h = 425
1043 };
1044
1045 #if !defined(NO_DES3) || !defined(NO_AES)
1046 enum Block_Sum {
1047 #ifdef WOLFSSL_AES_128
1048 AES128CBCb = 414,
1049 AES128GCMb = 418,
1050 AES128CCMb = 419,

NetBurner, Inc.
1448 File Documentation

1051 #endif
1052 #ifdef WOLFSSL_AES_192
1053 AES192CBCb = 434,
1054 AES192GCMb = 438,
1055 AES192CCMb = 439,
1056 #endif
1057 #ifdef WOLFSSL_AES_256
1058 AES256CBCb = 454,
1059 AES256GCMb = 458,
1060 AES256CCMb = 459,
1061 #endif
1062 #ifndef NO_DES3
1063 DESb = 69,
1064 DES3b = 652
1065 #endif
1066 };
1067 #endif /* !NO_DES3 || !NO_AES */
1068
1069
1070 enum Key_Sum {
1071 DSAk = 515,
1072 RSAk = 645,
1073 RSAPSSk = 654,
1074 ECDSAk = 518,
1075 ED25519k = 256, /* 1.3.101.112 */
1076 X25519k = 254, /* 1.3.101.110 */
1077 ED448k = 257, /* 1.3.101.113 */
1078 X448k = 255, /* 1.3.101.111 */
1079 DHk = 647, /* dhKeyAgreement OID: 1.2.840.113549.1.3.1 */
1080 FALCON_LEVEL1k = 268, /* 1.3.9999.3.1 */
1081 FALCON_LEVEL5k = 271, /* 1.3.9999.3.4 */
1082 DILITHIUM_LEVEL2k = 213, /* 1.3.6.1.4.1.2.267.7.4.4 */
1083 DILITHIUM_LEVEL3k = 216, /* 1.3.6.1.4.1.2.267.7.6.5 */
1084 DILITHIUM_LEVEL5k = 220, /* 1.3.6.1.4.1.2.267.7.8.7 */
1085 DILITHIUM_AES_LEVEL2k = 217,/* 1.3.6.1.4.1.2.267.11.4.4 */
1086 DILITHIUM_AES_LEVEL3k = 221,/* 1.3.6.1.4.1.2.267.11.6.5 + 1 (See GetOID() in asn.c) */
1087 DILITHIUM_AES_LEVEL5k = 224,/* 1.3.6.1.4.1.2.267.11.8.7 */
1088 };
1089
1090 #if !defined(NO_AES) || defined(HAVE_PKCS7)
1091 enum KeyWrap_Sum {
1092 #ifdef WOLFSSL_AES_128
1093 AES128_WRAP = 417,
1094 #endif
1095 #ifdef WOLFSSL_AES_192
1096 AES192_WRAP = 437,
1097 #endif
1098 #ifdef WOLFSSL_AES_256
1099 AES256_WRAP = 457,
1100 #endif
1101 #ifdef HAVE_PKCS7
1102 PWRI_KEK_WRAP = 680 /*id-alg-PWRI-KEK, 1.2.840.113549.1.9.16.3.9 */
1103 #endif
1104 };
1105 #endif /* !NO_AES || PKCS7 */
1106
1107 enum Key_Agree {
1108 dhSinglePass_stdDH_sha1kdf_scheme = 464,
1109 dhSinglePass_stdDH_sha224kdf_scheme = 188,
1110 dhSinglePass_stdDH_sha256kdf_scheme = 189,
1111 dhSinglePass_stdDH_sha384kdf_scheme = 190,
1112 dhSinglePass_stdDH_sha512kdf_scheme = 191,
1113 };
1114
1115
1116
1117 enum KDF_Sum {
1118 PBKDF2_OID = 660,
1119 MGF1_OID = 652,
1120 };
1121
1122
1123 enum HMAC_Sum {
1124 HMAC_SHA224_OID = 652,
1125 HMAC_SHA256_OID = 653,
1126 HMAC_SHA384_OID = 654,
1127 HMAC_SHA512_OID = 655,
1128 HMAC_SHA3_224_OID = 426,
1129 HMAC_SHA3_256_OID = 427,
1130 HMAC_SHA3_384_OID = 428,
1131 HMAC_SHA3_512_OID = 429
1132 };
1133
1134
1135 enum Extensions_Sum {
1136 BASIC_CA_OID = 133, /* 2.5.29.19 */
1137 ALT_NAMES_OID = 131, /* 2.5.29.17 */

NetBurner, Inc.
22.306 asn.h 1449

1138 CRL_DIST_OID = 145, /* 2.5.29.31 */


1139 AUTH_INFO_OID = 69, /* 1.3.6.1.5.5.7.1.1 */
1140 AUTH_KEY_OID = 149, /* 2.5.29.35 */
1141 SUBJ_KEY_OID = 128, /* 2.5.29.14 */
1142 CERT_POLICY_OID = 146, /* 2.5.29.32 */
1143 CRL_NUMBER_OID = 134, /* 2.5.29.20 */
1144 KEY_USAGE_OID = 129, /* 2.5.29.15 */
1145 INHIBIT_ANY_OID = 168, /* 2.5.29.54 */
1146 EXT_KEY_USAGE_OID = 151, /* 2.5.29.37 */
1147 NAME_CONS_OID = 144, /* 2.5.29.30 */
1148 PRIV_KEY_USAGE_PERIOD_OID = 130, /* 2.5.29.16 */
1149 SUBJ_INFO_ACC_OID = 79, /* 1.3.6.1.5.5.7.1.11 */
1150 POLICY_MAP_OID = 147, /* 2.5.29.33 */
1151 POLICY_CONST_OID = 150, /* 2.5.29.36 */
1152 ISSUE_ALT_NAMES_OID = 132, /* 2.5.29.18 */
1153 TLS_FEATURE_OID = 92, /* 1.3.6.1.5.5.7.1.24 */
1154 NETSCAPE_CT_OID = 753, /* 2.16.840.1.113730.1.1 */
1155 OCSP_NOCHECK_OID = 121, /* 1.3.6.1.5.5.7.48.1.5
1156 id-pkix-ocsp-nocheck */
1157 SUBJ_DIR_ATTR_OID = 123, /* 2.5.29.9 */
1158
1159 AKEY_PACKAGE_OID = 1048, /* 2.16.840.1.101.2.1.2.78.5
1160 RFC 5958 - Asymmetric Key Packages */
1161 FASCN_OID = 419, /* 2.16.840.1.101.3.6.6 Federal PKI Policy FASC-N */
1162 UPN_OID = 265 /* 1.3.6.1.4.1.311.20.2.3 UPN */
1163 };
1164
1165 enum CertificatePolicy_Sum {
1166 CP_ANY_OID = 146, /* id-ce 32 0 */
1167 #ifdef WOLFSSL_FPKI
1168 CP_FPKI_COMMON_AUTH_OID = 426, /* 2.16.840.1.101.3.2.1.3.13 */
1169 CP_FPKI_PIV_AUTH_OID = 453, /* 2.16.840.1.101.3.2.1.3.40 */
1170 CP_FPKI_PIV_AUTH_HW_OID = 454, /* 2.16.840.1.101.3.2.1.3.41 */
1171 CP_FPKI_PIVI_AUTH_OID = 458 /* 2.16.840.1.101.3.2.1.3.45 */
1172 #endif /* WOLFSSL_FPKI */
1173 };
1174
1175 enum SepHardwareName_Sum {
1176 HW_NAME_OID = 79 /* 1.3.6.1.5.5.7.8.4 from RFC 4108*/
1177 };
1178
1179 enum AuthInfo_Sum {
1180 AIA_OCSP_OID = 116, /* 1.3.6.1.5.5.7.48.1, id-ad-ocsp */
1181 AIA_CA_ISSUER_OID = 117, /* 1.3.6.1.5.5.7.48.2, id-ad-caIssuers */
1182 #ifdef WOLFSSL_SUBJ_INFO_ACC
1183 AIA_CA_REPO_OID = 120 /* 1.3.6.1.5.5.7.48.5, id-ad-caRepository */
1184 #endif /* WOLFSSL_SUBJ_INFO_ACC */
1185 };
1186
1187 #define ID_PKIX(num) (67+(num)) /* 1.3.6.1.5.5.7.num, id-pkix num */
1188 #define ID_KP(num) (ID_PKIX(3)+(num)) /* 1.3.6.1.5.5.7.3.num, id-kp num */
1189 enum ExtKeyUsage_Sum { /* From RFC 5280 */
1190 EKU_ANY_OID = 151, /* 2.5.29.37.0, anyExtendedKeyUsage */
1191 EKU_SERVER_AUTH_OID = 71, /* 1.3.6.1.5.5.7.3.1, id-kp-serverAuth */
1192 EKU_CLIENT_AUTH_OID = 72, /* 1.3.6.1.5.5.7.3.2, id-kp-clientAuth */
1193 EKU_CODESIGNING_OID = 73, /* 1.3.6.1.5.5.7.3.3, id-kp-codeSigning */
1194 EKU_EMAILPROTECT_OID = 74, /* 1.3.6.1.5.5.7.3.4, id-kp-emailProtection */
1195 EKU_TIMESTAMP_OID = 78, /* 1.3.6.1.5.5.7.3.8, id-kp-timeStamping */
1196 EKU_OCSP_SIGN_OID = 79, /* 1.3.6.1.5.5.7.3.9, id-kp-OCSPSigning */
1197
1198 /* From RFC 6187: X.509v3 Certificates for Secure Shell Authenticaiton */
1199 EKU_SSH_CLIENT_AUTH_OID = ID_KP(21), /* id-kp-secureShellClient */
1200 EKU_SSH_MSCL_OID = 264,
1201 /* 1.3.6.1.4.1.311.20.2.2, MS Smart Card Logon */
1202 EKU_SSH_KP_CLIENT_AUTH_OID = 64
1203 /* 1.3.6.1.5.2.3.4, id-pkinit-KPClientAuth*/
1204 };
1205
1206 #ifdef WOLFSSL_SUBJ_DIR_ATTR
1207 #define ID_PDA(num) (ID_PKIX(9)+(num)) /* 1.3.6.1.5.5.7.9.num, id-pda num */
1208 enum SubjDirAttr_Sum { /* From RFC 3739, section 3.3.2 */
1209 SDA_DOB_OID = ID_PDA(1), /* id-pda-dateOfBirth */
1210 SDA_POB_OID = ID_PDA(2), /* id-pda-placeOfBirth */
1211 SDA_GENDER_OID = ID_PDA(3), /* id-pda-gender */
1212 SDA_COC_OID = ID_PDA(4), /* id-pda-countryOfCitizenship */
1213 SDA_COR_OID = ID_PDA(5) /* id-pda-countryOfResidence */
1214 };
1215 #endif /* WOLFSSL_SUBJ_DIR_ATTR */
1216
1217 #ifdef HAVE_LIBZ
1218 enum CompressAlg_Sum {
1219 ZLIBc = 679 /* 1.2.840.113549.1.9.16.3.8, id-alg-zlibCompress */
1220 };
1221 #endif
1222
1223 enum VerifyType {
1224 NO_VERIFY = 0,

NetBurner, Inc.
1450 File Documentation

1225 VERIFY = 1,
1226 VERIFY_CRL = 2,
1227 VERIFY_OCSP = 3,
1228 VERIFY_NAME = 4,
1229 VERIFY_SKIP_DATE = 5,
1230 VERIFY_OCSP_CERT = 6,
1231 };
1232
1233 #ifdef WOLFSSL_CERT_EXT
1234 enum KeyIdType {
1235 SKID_TYPE = 0,
1236 AKID_TYPE = 1
1237 };
1238 #endif
1239
1240 #ifdef WOLFSSL_CERT_REQ
1241 enum CsrAttrType {
1242 UNSTRUCTURED_NAME_OID = 654,
1243 PKCS9_CONTENT_TYPE_OID = 655,
1244 CHALLENGE_PASSWORD_OID = 659,
1245 SERIAL_NUMBER_OID = 94,
1246 EXTENSION_REQUEST_OID = 666,
1247 USER_ID_OID = 865,
1248 DNQUALIFIER_OID = 135,
1249 INITIALS_OID = 132,
1250 SURNAME_OID = 93,
1251 NAME_OID = 130,
1252 GIVEN_NAME_OID = 131,
1253 };
1254 #endif
1255
1256 /* Key usage extension bits (based on RFC 5280) */
1257 #define KEYUSE_DIGITAL_SIG 0x0080
1258 #define KEYUSE_CONTENT_COMMIT 0x0040
1259 #define KEYUSE_KEY_ENCIPHER 0x0020
1260 #define KEYUSE_DATA_ENCIPHER 0x0010
1261 #define KEYUSE_KEY_AGREE 0x0008
1262 #define KEYUSE_KEY_CERT_SIGN 0x0004
1263 #define KEYUSE_CRL_SIGN 0x0002
1264 #define KEYUSE_ENCIPHER_ONLY 0x0001
1265 #define KEYUSE_DECIPHER_ONLY 0x8000
1266
1267 /* Extended Key Usage bits (internal mapping only) */
1268 #define EXTKEYUSE_USER 0x80
1269 #define EXTKEYUSE_OCSP_SIGN 0x40
1270 #define EXTKEYUSE_TIMESTAMP 0x20
1271 #define EXTKEYUSE_EMAILPROT 0x10
1272 #define EXTKEYUSE_CODESIGN 0x08
1273 #define EXTKEYUSE_CLIENT_AUTH 0x04
1274 #define EXTKEYUSE_SERVER_AUTH 0x02
1275 #define EXTKEYUSE_ANY 0x01
1276 #ifdef WOLFSSL_WOLFSSH
1277 #define EXTKEYUSE_SSH_CLIENT_AUTH 0x01
1278 #define EXTKEYUSE_SSH_MSCL 0x02
1279 #define EXTKEYUSE_SSH_KP_CLIENT_AUTH 0x04
1280 #endif /* WOLFSSL_WOLFSSH */
1281
1282 #define WC_NS_SSL_CLIENT 0x80
1283 #define WC_NS_SSL_SERVER 0x40
1284 #define WC_NS_SMIME 0x20
1285 #define WC_NS_OBJSIGN 0x10
1286 #define WC_NS_SSL_CA 0x04
1287 #define WC_NS_SMIME_CA 0x02
1288 #define WC_NS_OBJSIGN_CA 0x01
1289
1290
1291 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || \
1292 defined(WOLFSSL_WPAS_SMALL) || defined(WOLFSSL_IP_ALT_NAME)
1293 #ifndef WOLFSSL_MAX_IPSTR
1294 #define WOLFSSL_MAX_IPSTR 46 /* max ip size IPv4 mapped IPv6 */
1295 #endif
1296 #define WOLFSSL_IP4_ADDR_LEN 4
1297 #define WOLFSSL_IP6_ADDR_LEN 16
1298 #endif /* OPENSSL_ALL || WOLFSSL_IP_ALT_NAME */
1299
1300 typedef struct DNS_entry DNS_entry;
1301
1302 struct DNS_entry {
1303 DNS_entry* next; /* next on DNS list */
1304 int type; /* i.e. ASN_DNS_TYPE */
1305 int len; /* actual DNS len */
1306 char* name; /* actual DNS name */
1307 #if defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME)
1308 char* ipString; /* human readable form of IP address */
1309 #endif
1310 #ifdef WOLFSSL_FPKI
1311 int oidSum; /* provide oid sum for verification */

NetBurner, Inc.
22.306 asn.h 1451

1312 #endif
1313 };
1314
1315 #ifdef WOLFSSL_FPKI
1316 /* RFC4122 i.e urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6 */
1317 #define DEFAULT_UUID_SZ 45
1318 #endif
1319
1320 typedef struct Base_entry Base_entry;
1321
1322 struct Base_entry {
1323 Base_entry* next; /* next on name base list */
1324 char* name; /* actual name base */
1325 int nameSz; /* name length */
1326 byte type; /* Name base type (DNS or RFC822) */
1327 };
1328
1329
1330 enum SignatureState {
1331 SIG_STATE_BEGIN,
1332 SIG_STATE_HASH,
1333 SIG_STATE_KEY,
1334 SIG_STATE_DO,
1335 SIG_STATE_CHECK,
1336 };
1337
1338
1339 #ifdef HAVE_PK_CALLBACKS
1340 #ifdef HAVE_ECC
1341 typedef int (*wc_CallbackEccVerify)(
1342 const unsigned char* sig, unsigned int sigSz,
1343 const unsigned char* hash, unsigned int hashSz,
1344 const unsigned char* keyDer, unsigned int keySz,
1345 int* result, void* ctx);
1346 #endif
1347 #ifndef NO_RSA
1348 typedef int (*wc_CallbackRsaVerify)(
1349 unsigned char* sig, unsigned int sigSz,
1350 unsigned char** out,
1351 const unsigned char* keyDer, unsigned int keySz,
1352 void* ctx);
1353 #endif
1354 #endif /* HAVE_PK_CALLBACKS */
1355
1356 #if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_SCEPROTECT) ||\
1357 defined(HAVE_PK_CALLBACKS)
1358 typedef struct tagCertAttribute {
1359 byte verifyByTSIP_SCE;
1360 word32 certBegin;
1361 word32 pubkey_n_start;
1362 word32 pubkey_n_len;
1363 word32 pubkey_e_start;
1364 word32 pubkey_e_len;
1365 int curve_id;
1366 const byte* cert;
1367 word32 certSz;
1368 const byte* keyIndex;
1369 } CertAttribute;
1370 #endif
1371
1372 struct SignatureCtx {
1373 void* heap;
1374 byte* digest;
1375 #ifndef NO_RSA
1376 byte* out;
1377 #endif
1378 #if !(defined(NO_RSA) && defined(NO_DSA))
1379 byte* sigCpy;
1380 #endif
1381 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448) || \
1382 !defined(NO_DSA)
1383 int verify;
1384 #endif
1385 union {
1386 #ifndef NO_RSA
1387 struct RsaKey* rsa;
1388 #endif
1389 #ifndef NO_DSA
1390 struct DsaKey* dsa;
1391 #endif
1392 #ifdef HAVE_ECC
1393 struct ecc_key* ecc;
1394 #endif
1395 #ifdef HAVE_ED25519
1396 struct ed25519_key* ed25519;
1397 #endif
1398 #ifdef HAVE_ED448

NetBurner, Inc.
1452 File Documentation

1399 struct ed448_key* ed448;


1400 #endif
1401 #ifdef HAVE_PQC
1402 struct falcon_key* falcon;
1403 struct dilithium_key* dilithium;
1404 #endif
1405 void* ptr;
1406 } key;
1407 int devId;
1408 int state;
1409 int typeH;
1410 int digestSz;
1411 word32 keyOID;
1412 #ifdef WOLFSSL_ASYNC_CRYPT
1413 WC_ASYNC_DEV* asyncDev;
1414 void* asyncCtx;
1415 #endif
1416
1417 #ifdef HAVE_PK_CALLBACKS
1418 #ifdef HAVE_ECC
1419 wc_CallbackEccVerify pkCbEcc;
1420 void* pkCtxEcc;
1421 #endif
1422 #ifndef NO_RSA
1423 wc_CallbackRsaVerify pkCbRsa;
1424 void* pkCtxRsa;
1425 #endif
1426 #endif /* HAVE_PK_CALLBACKS */
1427 #ifndef NO_RSA
1428 #if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_SCEPROTECT) ||\
1429 defined(HAVE_PK_CALLBACKS)
1430 CertAttribute CertAtt;
1431 #endif
1432 #ifdef WC_RSA_PSS
1433 enum wc_HashType hash;
1434 int mgf;
1435 int saltLen;
1436 #endif
1437 #endif
1438 };
1439
1440 enum CertSignState {
1441 CERTSIGN_STATE_BEGIN,
1442 CERTSIGN_STATE_DIGEST,
1443 CERTSIGN_STATE_ENCODE,
1444 CERTSIGN_STATE_DO,
1445 };
1446
1447 struct CertSignCtx {
1448 byte* sig;
1449 byte* digest;
1450 #ifndef NO_RSA
1451 byte* encSig;
1452 int encSigSz;
1453 #endif
1454 int state; /* enum CertSignState */
1455 };
1456
1457 #define DOMAIN_COMPONENT_MAX 10
1458
1459 struct DecodedName {
1460 char* fullName;
1461 int fullNameLen;
1462 int entryCount;
1463 int cnIdx;
1464 int cnLen;
1465 int cnNid;
1466 int snIdx;
1467 int snLen;
1468 int snNid;
1469 int cIdx;
1470 int cLen;
1471 int cNid;
1472 int lIdx;
1473 int lLen;
1474 int lNid;
1475 int stIdx;
1476 int stLen;
1477 int stNid;
1478 int oIdx;
1479 int oLen;
1480 int oNid;
1481 int ouIdx;
1482 int ouLen;
1483 #ifdef WOLFSSL_CERT_EXT
1484 int bcIdx;
1485 int bcLen;

NetBurner, Inc.
22.306 asn.h 1453

1486 int jcIdx;


1487 int jcLen;
1488 int jsIdx;
1489 int jsLen;
1490 #endif
1491 int ouNid;
1492 int emailIdx;
1493 int emailLen;
1494 int emailNid;
1495 int uidIdx;
1496 int uidLen;
1497 int uidNid;
1498 int serialIdx;
1499 int serialLen;
1500 int serialNid;
1501 int dcIdx[DOMAIN_COMPONENT_MAX];
1502 int dcLen[DOMAIN_COMPONENT_MAX];
1503 int dcNum;
1504 int dcMode;
1505 };
1506
1507 /* ASN Encoded Name field */
1508 typedef struct EncodedName {
1509 int nameLen; /* actual string value length */
1510 int totalLen; /* total encoded length */
1511 int type; /* type of name */
1512 int used; /* are we actually using this one */
1513 byte encoded[CTC_NAME_SIZE * 2]; /* encoding */
1514 } EncodedName;
1515
1516 #ifndef WOLFSSL_MAX_PATH_LEN
1517 /* RFC 5280 Section 6.1.2. "Initialization" - item (k) defines
1518 * (k) max_path_length: this integer is initialized to "n", is
1519 * decremented for each non-self-issued certificate in the path,
1520 * and may be reduced to the value in the path length constraint
1521 * field within the basic constraints extension of a CA
1522 * certificate.
1523 *
1524 * wolfSSL has arbitrarily selected the value 127 for "n" in the above
1525 * description. Users can modify the maximum path length by setting
1526 * WOLFSSL_MAX_PATH_LEN to a preferred value at build time
1527 */
1528 #define WOLFSSL_MAX_PATH_LEN 127
1529 #endif
1530
1531 typedef struct DecodedName DecodedName;
1532 typedef struct DecodedCert DecodedCert;
1533 typedef struct Signer Signer;
1534 #ifdef WOLFSSL_TRUST_PEER_CERT
1535 typedef struct TrustedPeerCert TrustedPeerCert;
1536 #endif /* WOLFSSL_TRUST_PEER_CERT */
1537 typedef struct SignatureCtx SignatureCtx;
1538 typedef struct CertSignCtx CertSignCtx;
1539
1540 #if defined(WOLFSSL_CUSTOM_OID) && defined(WOLFSSL_ASN_TEMPLATE) \
1541 && defined(HAVE_OID_DECODING)
1542 typedef int (*wc_UnknownExtCallback)(const word16* oid, word32 oidSz, int crit,
1543 const unsigned char* der, word32 derSz);
1544 #endif
1545
1546 struct DecodedCert {
1547 const byte* publicKey;
1548 word32 pubKeySize;
1549 int pubKeyStored;
1550 word32 certBegin; /* offset to start of cert */
1551 word32 sigIndex; /* offset to start of signature */
1552 word32 sigLength; /* length of signature */
1553 word32 signatureOID; /* sum of algorithm object id */
1554 word32 keyOID; /* sum of key algo object id */
1555 #ifdef WC_RSA_PSS
1556 word32 sigParamsIndex; /* start of signature parameters */
1557 word32 sigParamsLength; /* length of signature parameters */
1558 #endif
1559 int version; /* cert version, 1 or 3 */
1560 DNS_entry* altNames; /* alt names list of dns entries */
1561 #ifndef IGNORE_NAME_CONSTRAINTS
1562 DNS_entry* altEmailNames; /* alt names list of RFC822 entries */
1563 DNS_entry* altDirNames; /* alt names list of DIR entries */
1564 Base_entry* permittedNames; /* Permitted name bases */
1565 Base_entry* excludedNames; /* Excluded name bases */
1566 #endif /* IGNORE_NAME_CONSTRAINTS */
1567 byte subjectHash[KEYID_SIZE]; /* hash of all Names */
1568 byte issuerHash[KEYID_SIZE]; /* hash of all Names */
1569 #ifdef HAVE_OCSP
1570 byte subjectKeyHash[KEYID_SIZE]; /* hash of the public Key */
1571 byte issuerKeyHash[KEYID_SIZE]; /* hash of the public Key */
1572 #endif /* HAVE_OCSP */

NetBurner, Inc.
1454 File Documentation

1573 const byte* signature; /* not owned, points into raw cert */
1574 char* subjectCN; /* CommonName */
1575 int subjectCNLen; /* CommonName Length */
1576 char subjectCNEnc; /* CommonName Encoding */
1577 char issuer[WC_ASN_NAME_MAX]; /* full name including common name */
1578 char subject[WC_ASN_NAME_MAX];/* full name including common name */
1579 int verify; /* Default to yes, but could be off */
1580 const byte* source; /* byte buffer holder cert, NOT owner */
1581 word32 srcIdx; /* current offset into buffer */
1582 word32 maxIdx; /* max offset based on init size */
1583 void* heap; /* for user memory overrides */
1584 byte serial[EXTERNAL_SERIAL_SIZE]; /* raw serial number */
1585 int serialSz; /* raw serial bytes stored */
1586 const byte* extensions; /* not owned, points into raw cert */
1587 int extensionsSz; /* length of cert extensions */
1588 word32 extensionsIdx; /* if want to go back and parse later */
1589 const byte* extAuthInfo; /* Authority Information Access URI */
1590 int extAuthInfoSz; /* length of the URI */
1591 #if defined(OPENSSL_ALL) || defined(WOLFSSL_QT)
1592 const byte* extAuthInfoCaIssuer; /* Authority Info Access caIssuer URI */
1593 int extAuthInfoCaIssuerSz; /* length of the caIssuer URI */
1594 #endif
1595 const byte* extCrlInfoRaw; /* Entire CRL Distribution Points
1596 * Extension. This is useful when
1597 * re-generating the DER. */
1598 int extCrlInfoRawSz; /* length of the extension */
1599 const byte* extCrlInfo; /* CRL Distribution Points */
1600 int extCrlInfoSz; /* length of the URI */
1601 byte extSubjKeyId[KEYID_SIZE]; /* Subject Key ID */
1602 byte extAuthKeyId[KEYID_SIZE]; /* Authority Key ID */
1603 byte pathLength; /* CA basic constraint path length */
1604 byte maxPathLen; /* max_path_len see RFC 5280 section
1605 * 6.1.2 "Initialization" - (k) for
1606 * description of max_path_len */
1607 byte policyConstSkip; /* Policy Constraints skip certs value */
1608 word16 extKeyUsage; /* Key usage bitfield */
1609 byte extExtKeyUsage; /* Extended Key usage bitfield */
1610 #ifdef WOLFSSL_WOLFSSH
1611 byte extExtKeyUsageSsh; /* Extended Key Usage bitfield for SSH */
1612 #endif /* WOLFSSL_WOLFSSH */
1613
1614 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
1615 const byte* extExtKeyUsageSrc;
1616 word32 extExtKeyUsageSz;
1617 word32 extExtKeyUsageCount;
1618 #ifdef WOLFSSL_AKID_NAME
1619 const byte* extRawAuthKeyIdSrc;
1620 word32 extRawAuthKeyIdSz;
1621 #endif
1622 const byte* extAuthKeyIdSrc;
1623 word32 extAuthKeyIdSz;
1624 const byte* extSubjKeyIdSrc;
1625 word32 extSubjKeyIdSz;
1626 #endif
1627 #ifdef OPENSSL_ALL
1628 const byte* extSubjAltNameSrc;
1629 word32 extSubjAltNameSz;
1630 #endif
1631 #ifdef WOLFSSL_SUBJ_DIR_ATTR
1632 char countryOfCitizenship[COUNTRY_CODE_LEN+1]; /* ISO 3166 Country Code */
1633 #ifdef OPENSSL_ALL
1634 const byte* extSubjDirAttrSrc;
1635 word32 extSubjDirAttrSz;
1636 #endif
1637 #endif /* WOLFSSL_SUBJ_DIR_ATTR */
1638 #ifdef WOLFSSL_SUBJ_INFO_ACC
1639 const byte* extSubjInfoAccCaRepo;
1640 word32 extSubjInfoAccCaRepoSz;
1641 #ifdef OPENSSL_ALL
1642 const byte* extSubjInfoAccSrc;
1643 word32 extSubjInfoAccSz;
1644 #endif
1645 #endif /* WOLFSSL_SUBJ_INFO_ACC */
1646
1647 #if defined(HAVE_ECC) || defined(HAVE_ED25519) || defined(HAVE_ED448)
1648 word32 pkCurveOID; /* Public Key’s curve OID */
1649 #endif /* HAVE_ECC */
1650 const byte* beforeDate;
1651 int beforeDateLen;
1652 const byte* afterDate;
1653 int afterDateLen;
1654 #if defined(HAVE_PKCS7) || defined(WOLFSSL_CERT_EXT)
1655 const byte* issuerRaw; /* pointer to issuer inside source */
1656 int issuerRawLen;
1657 #endif
1658 #if !defined(IGNORE_NAME_CONSTRAINTS) || defined(WOLFSSL_CERT_EXT)
1659 const byte* subjectRaw; /* pointer to subject inside source */

NetBurner, Inc.
22.306 asn.h 1455

1660 int subjectRawLen;


1661 #endif
1662 #if !defined(IGNORE_NAME_CONSTRAINTS) || \
1663 defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
1664 char* subjectEmail;
1665 int subjectEmailLen;
1666 #endif
1667 #if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
1668 /* easy access to subject info for other sign */
1669 char* subjectSN;
1670 int subjectSNLen;
1671 char subjectSNEnc;
1672 #ifdef WOLFSSL_CERT_NAME_ALL
1673 char* subjectN;
1674 int subjectNLen;
1675 char subjectNEnc;
1676 char* subjectI;
1677 int subjectILen;
1678 char subjectIEnc;
1679 char* subjectGN;
1680 int subjectGNLen;
1681 char subjectGNEnc;
1682 char* subjectDNQ;
1683 int subjectDNQLen;
1684 char subjectDNQEnc;
1685 #endif /*WOLFSSL_CERT_NAME_ALL */
1686 char* subjectC;
1687 int subjectCLen;
1688 char subjectCEnc;
1689 char* subjectL;
1690 int subjectLLen;
1691 char subjectLEnc;
1692 char* subjectST;
1693 int subjectSTLen;
1694 char subjectSTEnc;
1695 char* subjectO;
1696 int subjectOLen;
1697 char subjectOEnc;
1698 char* subjectOU;
1699 int subjectOULen;
1700 char subjectOUEnc;
1701 char* subjectSND;
1702 int subjectSNDLen;
1703 char subjectSNDEnc;
1704 char* subjectUID;
1705 int subjectUIDLen;
1706 char subjectUIDEnc;
1707 char* subjectStreet;
1708 int subjectStreetLen;
1709 char subjectStreetEnc;
1710 char* subjectBC;
1711 int subjectBCLen;
1712 char subjectBCEnc;
1713 char* subjectJC;
1714 int subjectJCLen;
1715 char subjectJCEnc;
1716 char* subjectJS;
1717 int subjectJSLen;
1718 char subjectJSEnc;
1719 char* subjectPC;
1720 int subjectPCLen;
1721 char subjectPCEnc;
1722 #if defined(WOLFSSL_HAVE_ISSUER_NAMES)
1723 char* issuerCN;
1724 int issuerCNLen;
1725 char issuerCNEnc;
1726 char* issuerSN;
1727 int issuerSNLen;
1728 char issuerSNEnc;
1729 char* issuerC;
1730 int issuerCLen;
1731 char issuerCEnc;
1732 char* issuerL;
1733 int issuerLLen;
1734 char issuerLEnc;
1735 char* issuerST;
1736 int issuerSTLen;
1737 char issuerSTEnc;
1738 char* issuerO;
1739 int issuerOLen;
1740 char issuerOEnc;
1741 char* issuerOU;
1742 int issuerOULen;
1743 char issuerOUEnc;
1744 char* issuerSND;
1745 int issuerSNDLen;
1746 char issuerSNDEnc;

NetBurner, Inc.
1456 File Documentation

1747 char* issuerEmail;


1748 int issuerEmailLen;
1749 #endif /* WOLFSSL_HAVE_ISSUER_NAMES */
1750 #endif /* defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT) */
1751 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
1752 /* WOLFSSL_X509_NAME structures (used void* to avoid including ssl.h) */
1753 void* issuerName;
1754 void* subjectName;
1755 #endif /* OPENSSL_EXTRA */
1756 #ifdef WOLFSSL_SEP
1757 int deviceTypeSz;
1758 byte* deviceType;
1759 int hwTypeSz;
1760 byte* hwType;
1761 int hwSerialNumSz;
1762 byte* hwSerialNum;
1763 #endif /* WOLFSSL_SEP */
1764 #ifdef WOLFSSL_CERT_EXT
1765 char extCertPolicies[MAX_CERTPOL_NB][MAX_CERTPOL_SZ];
1766 int extCertPoliciesNb;
1767 #endif /* WOLFSSL_CERT_EXT */
1768 #ifndef IGNORE_NETSCAPE_CERT_TYPE
1769 byte nsCertType;
1770 #endif
1771
1772 #ifdef WOLFSSL_CERT_REQ
1773 /* CSR attributes */
1774 char* contentType; /* Content Type */
1775 int contentTypeLen;
1776 char* cPwd; /* Challenge Password */
1777 int cPwdLen;
1778 char* sNum; /* Serial Number */
1779 int sNumLen;
1780 char* dnQualifier;
1781 int dnQualifierLen;
1782 char* initials;
1783 int initialsLen;
1784 char* surname;
1785 int surnameLen;
1786 char* givenName;
1787 int givenNameLen;
1788 char* unstructuredName;
1789 int unstructuredNameLen;
1790 #endif /* WOLFSSL_CERT_REQ */
1791
1792 Signer* ca;
1793 #ifndef NO_CERTS
1794 SignatureCtx sigCtx;
1795 #endif
1796 #if defined(WOLFSSL_RENESAS_TSIP) || defined(WOLFSSL_RENESAS_SCEPROTECT)
1797 byte* sce_tsip_encRsaKeyIdx;
1798 #endif
1799
1800 int badDate;
1801 int criticalExt;
1802
1803 /* Option Bits */
1804 byte subjectCNStored : 1; /* have we saved a copy we own */
1805 byte extSubjKeyIdSet : 1; /* Set when the SKID was read from cert */
1806 byte extAuthKeyIdSet : 1; /* Set when the AKID was read from cert */
1807 #ifndef IGNORE_NAME_CONSTRAINTS
1808 byte extNameConstraintSet : 1;
1809 #endif
1810 byte isCA : 1; /* CA basic constraint true */
1811 byte pathLengthSet : 1; /* CA basic const path length set */
1812 byte weOwnAltNames : 1; /* altNames haven’t been given to copy */
1813 byte extKeyUsageSet : 1;
1814 byte extExtKeyUsageSet : 1; /* Extended Key Usage set */
1815 #ifdef HAVE_OCSP
1816 byte ocspNoCheckSet : 1; /* id-pkix-ocsp-nocheck set */
1817 #endif
1818 byte extCRLdistSet : 1;
1819 byte extAuthInfoSet : 1;
1820 byte extBasicConstSet : 1;
1821 byte extPolicyConstSet : 1;
1822 byte extPolicyConstRxpSet : 1; /* requireExplicitPolicy set */
1823 byte extPolicyConstIpmSet : 1; /* inhibitPolicyMapping set */
1824 byte extSubjAltNameSet : 1;
1825 byte inhibitAnyOidSet : 1;
1826 byte selfSigned : 1; /* Indicates subject and issuer are same */
1827 #if defined(WOLFSSL_SEP) || defined(WOLFSSL_QT)
1828 byte extCertPolicySet : 1;
1829 #endif
1830 byte extCRLdistCrit : 1;
1831 byte extAuthInfoCrit : 1;
1832 byte extBasicConstCrit : 1;
1833 byte extPolicyConstCrit : 1;

NetBurner, Inc.
22.306 asn.h 1457

1834 byte extSubjAltNameCrit : 1;


1835 byte extAuthKeyIdCrit : 1;
1836 #ifndef IGNORE_NAME_CONSTRAINTS
1837 byte extNameConstraintCrit : 1;
1838 #endif
1839 byte extSubjKeyIdCrit : 1;
1840 byte extKeyUsageCrit : 1;
1841 byte extExtKeyUsageCrit : 1;
1842 #ifdef WOLFSSL_SUBJ_DIR_ATTR
1843 byte extSubjDirAttrSet : 1;
1844 #endif
1845 #ifdef WOLFSSL_SUBJ_INFO_ACC
1846 byte extSubjInfoAccSet : 1;
1847 #endif
1848 #if defined(WOLFSSL_SEP) || defined(WOLFSSL_QT)
1849 byte extCertPolicyCrit : 1;
1850 #endif
1851 #ifdef WOLFSSL_CERT_REQ
1852 byte isCSR : 1; /* Do we intend on parsing a CSR? */
1853 #endif
1854 #if defined(WOLFSSL_CUSTOM_OID) && defined(WOLFSSL_ASN_TEMPLATE) \
1855 && defined(HAVE_OID_DECODING)
1856 wc_UnknownExtCallback unknownExtCallback;
1857 #endif
1858 };
1859
1860 #ifdef NO_SHA
1861 #define SIGNER_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
1862 #else
1863 #define SIGNER_DIGEST_SIZE WC_SHA_DIGEST_SIZE
1864 #endif
1865
1866 /* CA Signers */
1867 /* if change layout change PERSIST_CERT_CACHE functions too */
1868 struct Signer {
1869 word32 pubKeySize;
1870 word32 keyOID; /* key type */
1871 word16 keyUsage;
1872 byte maxPathLen;
1873 byte pathLength;
1874 byte pathLengthSet : 1;
1875 byte selfSigned : 1;
1876 const byte* publicKey;
1877 int nameLen;
1878 char* name; /* common name */
1879 #ifndef IGNORE_NAME_CONSTRAINTS
1880 Base_entry* permittedNames;
1881 Base_entry* excludedNames;
1882 #endif /* IGNORE_NAME_CONSTRAINTS */
1883 byte subjectNameHash[SIGNER_DIGEST_SIZE];
1884 /* sha hash of names in certificate */
1885 #ifndef NO_SKID
1886 byte subjectKeyIdHash[SIGNER_DIGEST_SIZE];
1887 /* sha hash of names in certificate */
1888 #endif
1889 #ifdef HAVE_OCSP
1890 byte subjectKeyHash[KEYID_SIZE];
1891 #endif
1892 #ifdef WOLFSSL_SIGNER_DER_CERT
1893 DerBuffer* derCert;
1894 #endif
1895 #if defined(WOLFSSL_RENESAS_TSIP_TLS) || defined(WOLFSSL_RENESAS_SCEPROTECT)
1896 word32 cm_idx;
1897 #endif
1898 Signer* next;
1899 };
1900
1901
1902 #ifdef WOLFSSL_TRUST_PEER_CERT
1903 /* used for having trusted peer certs rather then CA */
1904 struct TrustedPeerCert {
1905 int nameLen;
1906 char* name; /* common name */
1907 #ifndef IGNORE_NAME_CONSTRAINTS
1908 Base_entry* permittedNames;
1909 Base_entry* excludedNames;
1910 #endif /* IGNORE_NAME_CONSTRAINTS */
1911 byte subjectNameHash[SIGNER_DIGEST_SIZE];
1912 /* sha hash of names in certificate */
1913 #ifndef NO_SKID
1914 byte subjectKeyIdHash[SIGNER_DIGEST_SIZE];
1915 /* sha hash of SKID in certificate */
1916 #endif
1917 word32 sigLen;
1918 byte* sig;
1919 struct TrustedPeerCert* next;
1920 };

NetBurner, Inc.
1458 File Documentation

1921 #endif /* WOLFSSL_TRUST_PEER_CERT */


1922
1923
1924 /* for testing or custom openssl wrappers */
1925 #if defined(WOLFSSL_TEST_CERT) || defined(OPENSSL_EXTRA) || \
1926 defined(OPENSSL_EXTRA_X509_SMALL) || defined(WOLFSSL_PUBLIC_ASN)
1927 #define WOLFSSL_ASN_API WOLFSSL_API
1928 #else
1929 #define WOLFSSL_ASN_API WOLFSSL_LOCAL
1930 #endif
1931
1932 #ifdef HAVE_SMIME
1933 #define MIME_HEADER_ASCII_MIN 33
1934 #define MIME_HEADER_ASCII_MAX 126
1935
1936 typedef struct MimeParam MimeParam;
1937 typedef struct MimeHdr MimeHdr;
1938
1939 struct MimeParam
1940 {
1941 MimeParam* next;
1942 char* attribute;
1943 char* value;
1944 };
1945
1946 struct MimeHdr
1947 {
1948 MimeHdr* next;
1949 MimeParam* params;
1950 char* name;
1951 char* body;
1952 };
1953
1954 typedef enum MimeTypes
1955 {
1956 MIME_HDR,
1957 MIME_PARAM
1958 } MimeTypes;
1959
1960 typedef enum MimeStatus
1961 {
1962 MIME_NAMEATTR,
1963 MIME_BODYVAL
1964 } MimeStatus;
1965 #endif /* HAVE_SMIME */
1966
1967
1968 WOLFSSL_LOCAL int CalcHashId(const byte* data, word32 len, byte* hash);
1969 WOLFSSL_LOCAL int GetName(DecodedCert* cert, int nameType, int maxIdx);
1970
1971 WOLFSSL_ASN_API int wc_BerToDer(const byte* ber, word32 berSz, byte* der,
1972 word32* derSz);
1973
1974 WOLFSSL_ASN_API void FreeAltNames(DNS_entry* altNames, void* heap);
1975 WOLFSSL_ASN_API DNS_entry* AltNameNew(void* heap);
1976 #ifndef IGNORE_NAME_CONSTRAINTS
1977 WOLFSSL_ASN_API void FreeNameSubtrees(Base_entry* names, void* heap);
1978 #endif /* IGNORE_NAME_CONSTRAINTS */
1979 WOLFSSL_ASN_API void InitDecodedCert(DecodedCert* cert, const byte* source,
1980 word32 inSz, void* heap);
1981 WOLFSSL_ASN_API void FreeDecodedCert(DecodedCert* cert);
1982 WOLFSSL_ASN_API int ParseCert(DecodedCert* cert, int type, int verify,
1983 void* cm);
1984
1985 #if defined(WOLFSSL_CUSTOM_OID) && defined(WOLFSSL_ASN_TEMPLATE) \
1986 && defined(HAVE_OID_DECODING)
1987 WOLFSSL_ASN_API int wc_SetUnknownExtCallback(DecodedCert* cert,
1988 wc_UnknownExtCallback cb);
1989 #endif
1990
1991 WOLFSSL_LOCAL int DecodePolicyOID(char *out, word32 outSz, const byte *in,
1992 word32 inSz);
1993 WOLFSSL_LOCAL int EncodePolicyOID(byte *out, word32 *outSz,
1994 const char *in, void* heap);
1995 WOLFSSL_API int CheckCertSignature(const byte*,word32,void*,void* cm);
1996 WOLFSSL_LOCAL int CheckCertSignaturePubKey(const byte* cert, word32 certSz,
1997 void* heap, const byte* pubKey, word32 pubKeySz, int pubKeyOID);
1998 #ifdef OPENSSL_EXTRA
1999 WOLFSSL_API int wc_CheckCertSigPubKey(const byte* cert, word32 certSz,
2000 void* heap, const byte* pubKey,
2001 word32 pubKeySz, int pubKeyOID);
2002 #endif
2003
2004 #ifdef WOLFSSL_CERT_REQ
2005 WOLFSSL_LOCAL int CheckCSRSignaturePubKey(const byte* cert, word32 certSz,
2006 void* heap, const byte* pubKey, word32 pubKeySz, int pubKeyOID);
2007 #endif /* WOLFSSL_CERT_REQ */

NetBurner, Inc.
22.306 asn.h 1459

2008 WOLFSSL_ASN_API int AddSignature(byte* buf, int bodySz, const byte* sig, int sigSz,
2009 int sigAlgoType);
2010 WOLFSSL_LOCAL int ParseCertRelative(DecodedCert* cert, int type, int verify,
2011 void* cm);
2012 WOLFSSL_LOCAL int DecodeToKey(DecodedCert* cert, int verify);
2013 #ifdef WOLFSSL_ASN_TEMPLATE
2014 WOLFSSL_LOCAL int DecodeCert(DecodedCert* cert, int verify, int* criticalExt);
2015 #endif
2016 WOLFSSL_LOCAL int wc_GetPubX509(DecodedCert* cert, int verify, int* badDate);
2017
2018 WOLFSSL_LOCAL const byte* OidFromId(word32 id, word32 type, word32* oidSz);
2019 WOLFSSL_LOCAL Signer* MakeSigner(void* heap);
2020 WOLFSSL_LOCAL void FreeSigner(Signer* signer, void* heap);
2021 WOLFSSL_LOCAL void FreeSignerTable(Signer** table, int rows, void* heap);
2022 #ifdef WOLFSSL_TRUST_PEER_CERT
2023 WOLFSSL_LOCAL void FreeTrustedPeer(TrustedPeerCert* tp, void* heap);
2024 WOLFSSL_LOCAL void FreeTrustedPeerTable(TrustedPeerCert** table, int rows,
2025 void* heap);
2026 #endif /* WOLFSSL_TRUST_PEER_CERT */
2027
2028 WOLFSSL_ASN_API int ToTraditional(byte* buffer, word32 length);
2029 WOLFSSL_ASN_API int ToTraditional_ex(byte* buffer, word32 length,
2030 word32* algId);
2031 WOLFSSL_LOCAL int ToTraditionalInline(const byte* input, word32* inOutIdx,
2032 word32 length);
2033 WOLFSSL_LOCAL int ToTraditionalInline_ex(const byte* input, word32* inOutIdx,
2034 word32 length, word32* algId);
2035 WOLFSSL_LOCAL int ToTraditionalEnc(byte* input, word32 sz, const char* password,
2036 int passwordSz, word32* algId);
2037 WOLFSSL_ASN_API int UnTraditionalEnc(byte* key, word32 keySz, byte* out,
2038 word32* outSz, const char* password, int passwordSz, int vPKCS,
2039 int vAlgo, byte* salt, word32 saltSz, int itt, WC_RNG* rng, void* heap);
2040 WOLFSSL_ASN_API int TraditionalEnc(byte* key, word32 keySz, byte* out,
2041 word32* outSz, const char* password, int passwordSz, int vPKCS,
2042 int vAlgo, int encAlgId, byte* salt, word32 saltSz, int itt,
2043 WC_RNG* rng, void* heap);
2044 WOLFSSL_LOCAL int DecryptContent(byte* input, word32 sz,const char* psw,int pswSz);
2045 WOLFSSL_LOCAL int EncryptContent(byte* input, word32 sz, byte* out, word32* outSz,
2046 const char* password,int passwordSz, int vPKCS, int vAlgo,
2047 byte* salt, word32 saltSz, int itt, WC_RNG* rng, void* heap);
2048 WOLFSSL_LOCAL int wc_GetKeyOID(byte* key, word32 keySz, const byte** curveOID,
2049 word32* oidSz, int* algoID, void* heap);
2050
2051 typedef struct tm wolfssl_tm;
2052 #if defined(OPENSSL_ALL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(OPENSSL_EXTRA) || \
2053 defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
2054 WOLFSSL_LOCAL int GetTimeString(byte* date, int format, char* buf, int len);
2055 #endif
2056 #if !defined(NO_ASN_TIME) && !defined(USER_TIME) && \
2057 !defined(TIME_OVERRIDES) && (defined(OPENSSL_EXTRA) || defined(HAVE_PKCS7))
2058 WOLFSSL_LOCAL int GetFormattedTime(void* currTime, byte* buf, word32 len);
2059 WOLFSSL_LOCAL int GetAsnTimeString(void* currTime, byte* buf, word32 len);
2060 #endif
2061 WOLFSSL_LOCAL int ExtractDate(const unsigned char* date, unsigned char format,
2062 wolfssl_tm* certTime, int* idx);
2063 WOLFSSL_LOCAL int DateGreaterThan(const struct tm* a, const struct tm* b);
2064 WOLFSSL_LOCAL int wc_ValidateDate(const byte* date, byte format, int dateType);
2065 WOLFSSL_LOCAL int wc_OBJ_sn2nid(const char *sn);
2066
2067 /* ASN.1 helper functions */
2068 #ifdef WOLFSSL_CERT_GEN
2069 WOLFSSL_LOCAL int SetNameEx(byte* output, word32 outputSz, CertName* name, void* heap);
2070 WOLFSSL_ASN_API int SetName(byte* output, word32 outputSz, CertName* name);
2071 WOLFSSL_LOCAL const char* GetOneCertName(CertName* name, int idx);
2072 WOLFSSL_LOCAL byte GetCertNameId(int idx);
2073 #endif
2074 WOLFSSL_LOCAL int GetShortInt(const byte* input, word32* inOutIdx, int* number,
2075 word32 maxIdx);
2076 WOLFSSL_LOCAL int SetShortInt(byte* input, word32* inOutIdx, word32 number,
2077 word32 maxIdx);
2078
2079 WOLFSSL_LOCAL const char* GetSigName(int oid);
2080 WOLFSSL_LOCAL int GetLength(const byte* input, word32* inOutIdx, int* len,
2081 word32 maxIdx);
2082 WOLFSSL_LOCAL int GetLength_ex(const byte* input, word32* inOutIdx, int* len,
2083 word32 maxIdx, int check);
2084 WOLFSSL_LOCAL int GetSequence(const byte* input, word32* inOutIdx, int* len,
2085 word32 maxIdx);
2086 WOLFSSL_LOCAL int GetSequence_ex(const byte* input, word32* inOutIdx, int* len,
2087 word32 maxIdx, int check);
2088 WOLFSSL_LOCAL int GetOctetString(const byte* input, word32* inOutIdx, int* len,
2089 word32 maxIdx);
2090 WOLFSSL_LOCAL int CheckBitString(const byte* input, word32* inOutIdx, int* len,
2091 word32 maxIdx, int zeroBits, byte* unusedBits);
2092 WOLFSSL_LOCAL int GetSet(const byte* input, word32* inOutIdx, int* len,
2093 word32 maxIdx);
2094 WOLFSSL_LOCAL int GetSet_ex(const byte* input, word32* inOutIdx, int* len,

NetBurner, Inc.
1460 File Documentation

2095 word32 maxIdx, int check);


2096 WOLFSSL_LOCAL int GetMyVersion(const byte* input, word32* inOutIdx,
2097 int* version, word32 maxIdx);
2098 WOLFSSL_LOCAL int GetInt(mp_int* mpi, const byte* input, word32* inOutIdx,
2099 word32 maxIdx);
2100
2101 #ifdef HAVE_OID_ENCODING
2102 WOLFSSL_LOCAL int EncodeObjectId(const word16* in, word32 inSz,
2103 byte* out, word32* outSz);
2104 #endif
2105 #ifdef HAVE_OID_DECODING
2106 WOLFSSL_LOCAL int DecodeObjectId(const byte* in, word32 inSz,
2107 word16* out, word32* outSz);
2108 #endif
2109 WOLFSSL_LOCAL int GetASNObjectId(const byte* input, word32* inOutIdx, int* len,
2110 word32 maxIdx);
2111 WOLFSSL_LOCAL int SetObjectId(int len, byte* output);
2112 WOLFSSL_LOCAL int GetObjectId(const byte* input, word32* inOutIdx, word32* oid,
2113 word32 oidType, word32 maxIdx);
2114 WOLFSSL_LOCAL int GetAlgoId(const byte* input, word32* inOutIdx, word32* oid,
2115 word32 oidType, word32 maxIdx);
2116 WOLFSSL_LOCAL int GetASNTag(const byte* input, word32* idx, byte* tag,
2117 word32 inputSz);
2118
2119 WOLFSSL_LOCAL word32
SetASNLength(word32 length, byte* output);
2120 WOLFSSL_LOCAL word32
SetASNSequence(word32 len, byte* output);
2121 WOLFSSL_LOCAL word32
SetASNOctetString(word32 len, byte* output);
2122 WOLFSSL_LOCAL word32
SetASNImplicit(byte tag,byte number, word32 len,
2123 byte* output);
2124 WOLFSSL_LOCAL word32 SetASNExplicit(byte number, word32 len, byte* output);
2125 WOLFSSL_LOCAL word32 SetASNSet(word32 len, byte* output);
2126
2127 WOLFSSL_LOCAL word32 SetLength(word32 length, byte* output);
2128 WOLFSSL_LOCAL word32 SetSequence(word32 len, byte* output);
2129 WOLFSSL_LOCAL word32 SetOctetString(word32 len, byte* output);
2130 WOLFSSL_LOCAL int SetASNInt(int len, byte firstByte, byte* output);
2131 WOLFSSL_LOCAL word32 SetBitString(word32 len, byte unusedBits, byte* output);
2132 WOLFSSL_LOCAL word32 SetImplicit(byte tag,byte number,word32 len,byte* output);
2133 WOLFSSL_LOCAL word32 SetExplicit(byte number, word32 len, byte* output);
2134 WOLFSSL_LOCAL word32 SetSet(word32 len, byte* output);
2135 WOLFSSL_LOCAL word32 SetAlgoID(int algoOID,byte* output,int type,int curveSz);
2136 WOLFSSL_LOCAL int SetMyVersion(word32 version, byte* output, int header);
2137 WOLFSSL_LOCAL int SetSerialNumber(const byte* sn, word32 snSz, byte* output,
2138 word32 outputSz, int maxSnSz);
2139 #ifndef WOLFSSL_ASN_TEMPLATE
2140 WOLFSSL_LOCAL int wc_GetSerialNumber(const byte* input, word32* inOutIdx,
2141 byte* serial, int* serialSz, word32 maxIdx);
2142 #endif
2143 WOLFSSL_LOCAL int GetNameHash(const byte* source, word32* idx, byte* hash,
2144 int maxIdx);
2145 WOLFSSL_LOCAL int wc_CheckPrivateKeyCert(const byte* key, word32 keySz, DecodedCert* der);
2146 WOLFSSL_LOCAL int wc_CheckPrivateKey(const byte* privKey, word32 privKeySz,
2147 const byte* pubKey, word32 pubKeySz, enum Key_Sum ks);
2148 WOLFSSL_LOCAL int StoreDHparams(byte* out, word32* outLen, mp_int* p, mp_int* g);
2149 #ifdef WOLFSSL_DH_EXTRA
2150 WOLFSSL_API int wc_DhPublicKeyDecode(const byte* input, word32* inOutIdx,
2151 DhKey* key, word32 inSz);
2152 #endif
2153 WOLFSSL_LOCAL int FlattenAltNames(byte* output, word32 outputSz,
2154 const DNS_entry* names);
2155
2156 WOLFSSL_LOCAL int wc_EncodeName(EncodedName* name, const char* nameStr,
2157 char nameType, byte type);
2158 WOLFSSL_LOCAL int wc_EncodeNameCanonical(EncodedName* name, const char* nameStr,
2159 char nameType, byte type);
2160
2161 #if defined(HAVE_ECC) || !defined(NO_DSA)
2162 /* ASN sig helpers */
2163 WOLFSSL_LOCAL int StoreECC_DSA_Sig(byte* out, word32* outLen, mp_int* r,
2164 mp_int* s);
2165 WOLFSSL_LOCAL int StoreECC_DSA_Sig_Bin(byte* out, word32* outLen,
2166 const byte* r, word32 rLen, const byte* s, word32 sLen);
2167 WOLFSSL_LOCAL int DecodeECC_DSA_Sig_Bin(const byte* sig, word32 sigLen,
2168 byte* r, word32* rLen, byte* s, word32* sLen);
2169 WOLFSSL_LOCAL int DecodeECC_DSA_Sig(const byte* sig, word32 sigLen,
2170 mp_int* r, mp_int* s);
2171 #endif
2172 #ifndef NO_DSA
2173 WOLFSSL_LOCAL int StoreDSAParams(byte*, word32*, const mp_int*, const mp_int*,
2174 const mp_int*);
2175 #endif
2176 #if defined HAVE_ECC && (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
2177 WOLFSSL_API int EccEnumToNID(int n);
2178 #endif
2179
2180 WOLFSSL_LOCAL void InitSignatureCtx(SignatureCtx* sigCtx, void* heap, int devId);
2181 WOLFSSL_LOCAL void FreeSignatureCtx(SignatureCtx* sigCtx);

NetBurner, Inc.
22.306 asn.h 1461

2182
2183 WOLFSSL_LOCAL int SetAsymKeyDerPublic(const byte* pubKey, word32 pubKeyLen,
2184 byte* output, word32 outLen, int keyType, int withHeader);
2185 WOLFSSL_LOCAL int DecodeAsymKeyPublic(const byte* input, word32* inOutIdx, word32 inSz,
2186 byte* pubKey, word32* pubKeyLen, int keyType);
2187
2188 #ifndef NO_CERTS
2189
2190 WOLFSSL_LOCAL int wc_EncryptedInfoParse(EncryptedInfo* info,
2191 const char** pBuffer, size_t bufSz);
2192
2193 WOLFSSL_LOCAL int PemToDer(const unsigned char* buff, long sz, int type,
2194 DerBuffer** pDer, void* heap, EncryptedInfo* info,
2195 int* eccKey);
2196 WOLFSSL_LOCAL int AllocDer(DerBuffer** der, word32 length, int type, void* heap);
2197 WOLFSSL_LOCAL void FreeDer(DerBuffer** der);
2198
2199 #endif /* !NO_CERTS */
2200
2201 #ifdef HAVE_SMIME
2202 WOLFSSL_LOCAL int wc_MIME_parse_headers(char* in, int inLen, MimeHdr** hdrs);
2203 WOLFSSL_LOCAL int wc_MIME_header_strip(char* in, char** out, size_t start, size_t end);
2204 WOLFSSL_LOCAL MimeHdr* wc_MIME_find_header_name(const char* name, MimeHdr* hdr);
2205 WOLFSSL_LOCAL MimeParam* wc_MIME_find_param_attr(const char* attribute, MimeParam* param);
2206 WOLFSSL_LOCAL char* wc_MIME_single_canonicalize(const char* line, word32* len);
2207 WOLFSSL_LOCAL int wc_MIME_free_hdrs(MimeHdr* head);
2208 #endif /* HAVE_SMIME */
2209
2210 #ifdef WOLFSSL_CERT_GEN
2211
2212 enum cert_enums {
2213 RSA_KEY = 10,
2214 ECC_KEY = 12,
2215 ED25519_KEY = 13,
2216 ED448_KEY = 14,
2217 DSA_KEY = 15,
2218 FALCON_LEVEL1_KEY = 16,
2219 FALCON_LEVEL5_KEY = 17,
2220 DILITHIUM_LEVEL2_KEY = 18,
2221 DILITHIUM_LEVEL3_KEY = 19,
2222 DILITHIUM_LEVEL5_KEY = 20,
2223 DILITHIUM_AES_LEVEL2_KEY = 21,
2224 DILITHIUM_AES_LEVEL3_KEY = 22,
2225 DILITHIUM_AES_LEVEL5_KEY = 23,
2226 };
2227
2228 #endif /* WOLFSSL_CERT_GEN */
2229
2230
2231
2232 /* for pointer use */
2233 typedef struct CertStatus CertStatus;
2234
2235 #ifdef HAVE_OCSP
2236
2237 enum Ocsp_Response_Status {
2238 OCSP_SUCCESSFUL = 0, /* Response has valid confirmations */
2239 OCSP_MALFORMED_REQUEST = 1, /* Illegal confirmation request */
2240 OCSP_INTERNAL_ERROR = 2, /* Internal error in issuer */
2241 OCSP_TRY_LATER = 3, /* Try again later */
2242 OCSP_SIG_REQUIRED = 5, /* Must sign the request (4 is skipped) */
2243 OCSP_UNAUTHORIZED = 6 /* Request unauthorized */
2244 };
2245
2246
2247 enum Ocsp_Cert_Status {
2248 CERT_GOOD = 0,
2249 CERT_REVOKED = 1,
2250 CERT_UNKNOWN = 2
2251 };
2252
2253
2254 enum Ocsp_Sums {
2255 OCSP_BASIC_OID = 117,
2256 OCSP_NONCE_OID = 118
2257 };
2258
2259 #ifdef OPENSSL_EXTRA
2260 enum Ocsp_Verify_Error {
2261 OCSP_VERIFY_ERROR_NONE = 0,
2262 OCSP_BAD_ISSUER = 1
2263 };
2264 #endif
2265
2266
2267 typedef struct OcspRequest OcspRequest;
2268 typedef struct OcspResponse OcspResponse;

NetBurner, Inc.
1462 File Documentation

2269
2270
2271 struct CertStatus {
2272 CertStatus* next;
2273
2274 byte serial[EXTERNAL_SERIAL_SIZE];
2275 int serialSz;
2276 #ifdef OPENSSL_EXTRA
2277 WOLFSSL_ASN1_INTEGER* serialInt;
2278 #endif
2279
2280 int status;
2281
2282 byte thisDate[MAX_DATE_SIZE];
2283 byte nextDate[MAX_DATE_SIZE];
2284 byte thisDateFormat;
2285 byte nextDateFormat;
2286 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
2287 defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY)
2288 WOLFSSL_ASN1_TIME thisDateParsed;
2289 WOLFSSL_ASN1_TIME nextDateParsed;
2290 byte* thisDateAsn;
2291 byte* nextDateAsn;
2292 #endif
2293
2294 byte* rawOcspResponse;
2295 word32 rawOcspResponseSz;
2296 };
2297
2298 typedef struct OcspEntry OcspEntry;
2299
2300 #ifdef NO_SHA
2301 #define OCSP_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
2302 #else
2303 #define OCSP_DIGEST_SIZE WC_SHA_DIGEST_SIZE
2304 #endif
2305
2306 struct OcspEntry
2307 {
2308 OcspEntry *next; /* next entry */
2309 word32 hashAlgoOID; /* hash algo ID */
2310 byte issuerHash[OCSP_DIGEST_SIZE]; /* issuer hash */
2311 byte issuerKeyHash[OCSP_DIGEST_SIZE]; /* issuer public key hash */
2312 CertStatus *status; /* OCSP response list */
2313 int totalStatus; /* number on list */
2314 byte* rawCertId; /* raw bytes of the CertID */
2315 int rawCertIdSize; /* num bytes in raw CertID */
2316 /* option bits - using 32-bit for alignment */
2317 word32 ownStatus:1; /* do we need to free the status
2318 * response list */
2319 word32 isDynamic:1; /* was dynamically allocated */
2320 word32 used:1; /* entry used */
2321 };
2322
2323 /* TODO: Long-term, it would be helpful if we made this struct and other OCSP
2324 structs conform to the ASN spec as described in RFC 6960. It will help
2325 with readability and with implementing OpenSSL compatibility API
2326 functions, because OpenSSL’s OCSP data structures conform to the
2327 RFC. */
2328 struct OcspResponse {
2329 int responseStatus; /* return code from Responder */
2330
2331 byte* response; /* Pointer to beginning of OCSP Response */
2332 word32 responseSz; /* length of the OCSP Response */
2333
2334 byte producedDate[MAX_DATE_SIZE];
2335 /* Date at which this response was signed */
2336 byte producedDateFormat; /* format of the producedDate */
2337
2338 byte* cert;
2339 word32 certSz;
2340
2341 byte* sig; /* Pointer to sig in source */
2342 word32 sigSz; /* Length in octets for the sig */
2343 word32 sigOID; /* OID for hash used for sig */
2344
2345 OcspEntry* single; /* chain of OCSP single responses */
2346
2347 byte* nonce; /* pointer to nonce inside ASN.1 response */
2348 int nonceSz; /* length of the nonce string */
2349
2350 byte* source; /* pointer to source buffer, not owned */
2351 word32 maxIdx; /* max offset based on init size */
2352
2353 #ifdef OPENSSL_EXTRA
2354 int verifyError;
2355 #endif

NetBurner, Inc.
22.306 asn.h 1463

2356 void* heap;


2357 };
2358
2359
2360 struct OcspRequest {
2361 byte issuerHash[KEYID_SIZE];
2362 byte issuerKeyHash[KEYID_SIZE];
2363 byte* serial; /* copy of the serial number in source cert */
2364 int serialSz;
2365 #ifdef OPENSSL_EXTRA
2366 WOLFSSL_ASN1_INTEGER* serialInt;
2367 #endif
2368 byte* url; /* copy of the extAuthInfo in source cert */
2369 int urlSz;
2370
2371 byte nonce[MAX_OCSP_NONCE_SZ];
2372 int nonceSz;
2373 void* heap;
2374 void* ssl;
2375 };
2376
2377 WOLFSSL_LOCAL void InitOcspResponse(OcspResponse* resp, OcspEntry* single,
2378 CertStatus* status, byte* source, word32 inSz, void* heap);
2379 WOLFSSL_LOCAL void FreeOcspResponse(OcspResponse* resp);
2380 WOLFSSL_LOCAL int OcspResponseDecode(OcspResponse* resp, void* cm, void* heap,
2381 int noVerify);
2382
2383 WOLFSSL_LOCAL int InitOcspRequest(OcspRequest* req, DecodedCert* cert,
2384 byte useNonce, void* heap);
2385 WOLFSSL_LOCAL void FreeOcspRequest(OcspRequest* req);
2386 WOLFSSL_LOCAL int EncodeOcspRequest(OcspRequest* req, byte* output,
2387 word32 size);
2388 WOLFSSL_LOCAL word32 EncodeOcspRequestExtensions(OcspRequest* req, byte* output,
2389 word32 size);
2390
2391
2392 WOLFSSL_LOCAL int CompareOcspReqResp(OcspRequest* req, OcspResponse* resp);
2393
2394
2395 #endif /* HAVE_OCSP */
2396
2397
2398 /* for pointer use */
2399 typedef struct RevokedCert RevokedCert;
2400
2401 #ifdef HAVE_CRL
2402
2403 struct RevokedCert {
2404 byte serialNumber[EXTERNAL_SERIAL_SIZE];
2405 int serialSz;
2406 RevokedCert* next;
2407 byte revDate[MAX_DATE_SIZE];
2408 byte revDateFormat;
2409 };
2410
2411 typedef struct DecodedCRL DecodedCRL;
2412
2413 struct DecodedCRL {
2414 word32 certBegin; /* offset to start of cert */
2415 word32 sigIndex; /* offset to start of signature */
2416 word32 sigLength; /* length of signature */
2417 word32 signatureOID; /* sum of algorithm object id */
2418 byte* signature; /* pointer into raw source, not owned */
2419 byte issuerHash[SIGNER_DIGEST_SIZE]; /* issuer name hash */
2420 byte crlHash[SIGNER_DIGEST_SIZE]; /* raw crl data hash */
2421 byte lastDate[MAX_DATE_SIZE]; /* last date updated */
2422 byte nextDate[MAX_DATE_SIZE]; /* next update date */
2423 byte lastDateFormat; /* format of last date */
2424 byte nextDateFormat; /* format of next date */
2425 RevokedCert* certs; /* revoked cert list */
2426 #if defined(OPENSSL_EXTRA)
2427 byte* issuer; /* full name including common name */
2428 word32 issuerSz; /* length of the issuer */
2429 #endif
2430 int totalCerts; /* number on list */
2431 int version; /* version of cert */
2432 void* heap;
2433 #ifndef NO_SKID
2434 byte extAuthKeyIdSet;
2435 byte extAuthKeyId[SIGNER_DIGEST_SIZE]; /* Authority Key ID */
2436 #endif
2437 int crlNumber; /* CRL number extension */
2438 };
2439
2440 WOLFSSL_LOCAL void InitDecodedCRL(DecodedCRL* dcrl, void* heap);
2441 WOLFSSL_LOCAL int VerifyCRL_Signature(SignatureCtx* sigCtx,
2442 const byte* toBeSigned, word32 tbsSz,

NetBurner, Inc.
1464 File Documentation

2443 const byte* signature, word32 sigSz,


2444 word32 signatureOID, Signer *ca,
2445 void* heap);
2446 WOLFSSL_LOCAL int ParseCRL(DecodedCRL* dcrl, const byte* buff, word32 sz,
2447 int verify, void* cm);
2448 WOLFSSL_LOCAL void FreeDecodedCRL(DecodedCRL* dcrl);
2449
2450
2451 #endif /* HAVE_CRL */
2452
2453
2454 #ifdef __cplusplus
2455 } /* extern "C" */
2456 #endif
2457
2458 #endif /* !NO_ASN */
2459
2460
2461 #if ((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT)) \
2462 || (defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_IMPORT)) \
2463 || (defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)) \
2464 || (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)) \
2465 || (defined(HAVE_PQC) && defined(HAVE_FALCON)) \
2466 || (defined(HAVE_PQC) && defined(HAVE_DILITHIUM)))
2467 WOLFSSL_LOCAL int DecodeAsymKey(const byte* input, word32* inOutIdx,
2468 word32 inSz, byte* privKey, word32* privKeyLen, byte* pubKey,
2469 word32* pubKeyLen, int keyType);
2470 #endif
2471
2472 #ifdef WC_ENABLE_ASYM_KEY_EXPORT
2473 WOLFSSL_LOCAL int SetAsymKeyDer(const byte* privKey, word32 privKeyLen,
2474 const byte* pubKey, word32 pubKeyLen, byte* output, word32 outLen,
2475 int keyType);
2476 #endif
2477
2478
2479 #if !defined(NO_ASN) || !defined(NO_PWDBASED)
2480
2481 #ifndef PKCS_MAX_KEY_SIZE
2482 #define PKCS_MAX_KEY_SIZE 64 /* MAX PKCS Key length */
2483 #endif
2484 #if !defined(WOLFSSL_GAME_BUILD) && !defined(MAX_KEY_SIZE)
2485 /* for backwards compatibility */
2486 #define MAX_KEY_SIZE PKCS_MAX_KEY_SIZE
2487 #endif
2488 #ifndef MAX_UNICODE_SZ
2489 #define MAX_UNICODE_SZ 256
2490 #endif
2491
2492 enum PBESTypes {
2493 PBE_MD5_DES = 0,
2494 PBE_SHA1_RC4_128 = 1,
2495 PBE_SHA1_DES = 2,
2496 PBE_SHA1_DES3 = 3,
2497 PBE_AES256_CBC = 4,
2498 PBE_AES128_CBC = 5,
2499 PBE_SHA1_40RC2_CBC = 6,
2500
2501 PBE_SHA1_RC4_128_SUM = 657,
2502 PBE_SHA1_DES3_SUM = 659,
2503 PBE_MD5_DES_SUM = 651,
2504 PBE_SHA1_DES_SUM = 658,
2505 PBES2_SUM = 661,
2506
2507 PBES2 = 13, /* algo ID */
2508 PBES1_MD5_DES = 3,
2509 PBES1_SHA1_DES = 10,
2510 };
2511
2512 enum PKCSTypes {
2513 PKCS5v2 = 6, /* PKCS #5 v2.0 */
2514 PKCS12v1 = 12, /* PKCS #12 */
2515 PKCS5 = 5, /* PKCS oid tag */
2516 PKCS8v0 = 0, /* default PKCS#8 version */
2517 PKCS8v1 = 1, /* PKCS#8 version including public key */
2518 PKCS1v0 = 0, /* default PKCS#1 version */
2519 PKCS1v1 = 1, /* Multi-prime version */
2520 };
2521
2522 #endif /* !NO_ASN || !NO_PWDBASED */
2523
2524 #endif /* WOLF_CRYPT_ASN_H */

NetBurner, Inc.
22.307 asn_public.h File Reference 1465

22.307 asn_public.h File Reference


#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/dsa.h>
#include <wolfssl/wolfcrypt/random.h>

22.308 asn_public.h
Go to the documentation of this file.
1 /* asn_public.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 /*
17 DESCRIPTION
18 This library defines the interface APIs for X509 certificates.
19
20 */
21 #ifndef WOLF_CRYPT_ASN_PUBLIC_H
22 #define WOLF_CRYPT_ASN_PUBLIC_H
23
24 #include <wolfssl/wolfcrypt/types.h>
25 #include <wolfssl/wolfcrypt/dsa.h>
26 #include <wolfssl/wolfcrypt/random.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 /* guard on redeclaration */
33 #ifndef WC_ECCKEY_TYPE_DEFINED
34 typedef struct ecc_key ecc_key;
35 #define WC_ECCKEY_TYPE_DEFINED
36 #endif
37 #ifndef WC_ED25519KEY_TYPE_DEFINED
38 typedef struct ed25519_key ed25519_key;
39 #define WC_ED25519KEY_TYPE_DEFINED
40 #endif
41 #ifndef WC_CURVE25519KEY_TYPE_DEFINED
42 typedef struct curve25519_key curve25519_key;
43 #define WC_CURVE25519KEY_TYPE_DEFINED
44 #endif
45 #ifndef WC_ED448KEY_TYPE_DEFINED
46 typedef struct ed448_key ed448_key;
47 #define WC_ED448KEY_TYPE_DEFINED
48 #endif
49 #ifndef WC_CURVE448KEY_TYPE_DEFINED
50 typedef struct curve448_key curve448_key;
51 #define WC_CURVE448KEY_TYPE_DEFINED
52 #endif
53 #ifndef WC_RSAKEY_TYPE_DEFINED
54 typedef struct RsaKey RsaKey;
55 #define WC_RSAKEY_TYPE_DEFINED
56 #endif
57 #ifndef WC_DH_TYPE_DEFINED
58 typedef struct DhKey DhKey;
59 #define WC_DH_TYPE_DEFINED
60 #endif
61 #ifndef WC_FALCONKEY_TYPE_DEFINED
62 typedef struct falcon_key falcon_key;
63 #define WC_FALCONKEY_TYPE_DEFINED
64 #endif
65 #ifndef WC_DILITHIUMKEY_TYPE_DEFINED
66 typedef struct dilithium_key dilithium_key;
67 #define WC_DILITHIUMKEY_TYPE_DEFINED
68 #endif
69
70 enum Ecc_Sum {
71 ECC_SECP112R1_OID = 182,
72 ECC_SECP112R2_OID = 183,
73 ECC_SECP128R1_OID = 204,
74 ECC_SECP128R2_OID = 205,
75 ECC_SECP160R1_OID = 184,
76 ECC_SECP160R2_OID = 206,

NetBurner, Inc.
1466 File Documentation

77 ECC_SECP160K1_OID = 185,
78 ECC_BRAINPOOLP160R1_OID = 98,
79 ECC_SECP192R1_OID = 520,
80 ECC_PRIME192V2_OID = 521,
81 ECC_PRIME192V3_OID = 522,
82 ECC_SECP192K1_OID = 207,
83 ECC_BRAINPOOLP192R1_OID = 100,
84 ECC_SECP224R1_OID = 209,
85 ECC_SECP224K1_OID = 208,
86 ECC_BRAINPOOLP224R1_OID = 102,
87 ECC_PRIME239V1_OID = 523,
88 ECC_PRIME239V2_OID = 524,
89 ECC_PRIME239V3_OID = 525,
90 ECC_SECP256R1_OID = 526,
91 ECC_SECP256K1_OID = 186,
92 ECC_BRAINPOOLP256R1_OID = 104,
93 ECC_X25519_OID = 365,
94 ECC_ED25519_OID = 256,
95 ECC_BRAINPOOLP320R1_OID = 106,
96 ECC_X448_OID = 362,
97 ECC_ED448_OID = 257,
98 ECC_SECP384R1_OID = 210,
99 ECC_BRAINPOOLP384R1_OID = 108,
100 ECC_BRAINPOOLP512R1_OID = 110,
101 ECC_SECP521R1_OID = 211,
102 };
103
104
105 /* Certificate file Type */
106 enum CertType {
107 CERT_TYPE = 0,
108 PRIVATEKEY_TYPE,
109 DH_PARAM_TYPE,
110 DSA_PARAM_TYPE,
111 CRL_TYPE,
112 CA_TYPE,
113 ECC_PRIVATEKEY_TYPE,
114 DSA_PRIVATEKEY_TYPE,
115 CERTREQ_TYPE,
116 DSA_TYPE,
117 ECC_TYPE,
118 RSA_TYPE,
119 PUBLICKEY_TYPE,
120 RSA_PUBLICKEY_TYPE,
121 ECC_PUBLICKEY_TYPE,
122 TRUSTED_PEER_TYPE,
123 EDDSA_PRIVATEKEY_TYPE,
124 ED25519_TYPE,
125 ED448_TYPE,
126 PKCS12_TYPE,
127 PKCS8_PRIVATEKEY_TYPE,
128 PKCS8_ENC_PRIVATEKEY_TYPE,
129 DETECT_CERT_TYPE,
130 DH_PRIVATEKEY_TYPE,
131 X942_PARAM_TYPE,
132 FALCON_LEVEL1_TYPE,
133 FALCON_LEVEL5_TYPE,
134 DILITHIUM_LEVEL2_TYPE,
135 DILITHIUM_LEVEL3_TYPE,
136 DILITHIUM_LEVEL5_TYPE,
137 DILITHIUM_AES_LEVEL2_TYPE,
138 DILITHIUM_AES_LEVEL3_TYPE,
139 DILITHIUM_AES_LEVEL5_TYPE,
140 };
141
142
143 /* Signature type, by OID sum */
144 enum Ctc_SigType {
145 CTC_SHAwDSA = 517,
146 CTC_SHA256wDSA = 416,
147 CTC_MD2wRSA = 646,
148 CTC_MD5wRSA = 648,
149 CTC_SHAwRSA = 649,
150 CTC_SHAwECDSA = 520,
151 CTC_SHA224wRSA = 658,
152 CTC_SHA224wECDSA = 523,
153 CTC_SHA256wRSA = 655,
154 CTC_SHA256wECDSA = 524,
155 CTC_SHA384wRSA = 656,
156 CTC_SHA384wECDSA = 525,
157 CTC_SHA512wRSA = 657,
158 CTC_SHA512wECDSA = 526,
159
160 /* https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration */
161 CTC_SHA3_224wECDSA = 423,
162 CTC_SHA3_256wECDSA = 424,
163 CTC_SHA3_384wECDSA = 425,

NetBurner, Inc.
22.308 asn_public.h 1467

164 CTC_SHA3_512wECDSA = 426,


165 CTC_SHA3_224wRSA = 427,
166 CTC_SHA3_256wRSA = 428,
167 CTC_SHA3_384wRSA = 429,
168 CTC_SHA3_512wRSA = 430,
169
170 CTC_RSASSAPSS = 654,
171
172 CTC_ED25519 = 256,
173 CTC_ED448 = 257,
174
175 CTC_FALCON_LEVEL1 = 268,
176 CTC_FALCON_LEVEL5 = 271,
177
178 CTC_DILITHIUM_LEVEL2 = 213,
179 CTC_DILITHIUM_LEVEL3 = 216,
180 CTC_DILITHIUM_LEVEL5 = 220,
181 CTC_DILITHIUM_AES_LEVEL2 = 217,
182 CTC_DILITHIUM_AES_LEVEL3 = 221,
183 CTC_DILITHIUM_AES_LEVEL5 = 224,
184 };
185
186 enum Ctc_Encoding {
187 CTC_UTF8 = 0x0c, /* utf8 */
188 CTC_PRINTABLE = 0x13 /* printable */
189 };
190
191 #ifndef WC_CTC_NAME_SIZE
192 #define WC_CTC_NAME_SIZE 64
193 #endif
194 #ifndef WC_CTC_MAX_ALT_SIZE
195 #define WC_CTC_MAX_ALT_SIZE 16384
196 #endif
197
198 enum Ctc_Misc {
199 CTC_COUNTRY_SIZE = 2,
200 CTC_NAME_SIZE = WC_CTC_NAME_SIZE,
201 CTC_DATE_SIZE = 32,
202 CTC_MAX_ALT_SIZE = WC_CTC_MAX_ALT_SIZE, /* may be huge, default: 16384 */
203 CTC_SERIAL_SIZE = 20,
204 CTC_GEN_SERIAL_SZ = 16,
205 CTC_FILETYPE_ASN1 = 2,
206 CTC_FILETYPE_PEM = 1,
207 CTC_FILETYPE_DEFAULT = 2,
208 #ifdef WOLFSSL_CERT_EXT
209 /* AKID could contains: hash + (Option) AuthCertIssuer,AuthCertSerialNum
210 * We support only hash */
211 CTC_MAX_SKID_SIZE = 32, /* SHA256_DIGEST_SIZE */
212 CTC_MAX_AKID_SIZE = 32, /* SHA256_DIGEST_SIZE */
213 CTC_MAX_CERTPOL_SZ = 64,
214 CTC_MAX_CERTPOL_NB = 2, /* Max number of Certificate Policy */
215 CTC_MAX_CRLINFO_SZ = 200, /* Arbitrary size that should be enough for at
216 * least two distribution points. */
217 #endif /* WOLFSSL_CERT_EXT */
218 };
219
220 /* DER buffer */
221 typedef struct DerBuffer {
222 byte* buffer;
223 void* heap;
224 word32 length;
225 int type; /* enum CertType */
226 int dynType; /* DYNAMIC_TYPE_* */
227 } DerBuffer;
228
229 typedef struct WOLFSSL_ASN1_TIME {
230 unsigned char data[CTC_DATE_SIZE]; /* date bytes */
231 int length;
232 int type;
233 } WOLFSSL_ASN1_TIME;
234
235 enum {
236 IV_SZ = 32, /* max iv sz */
237 #ifdef OPENSSL_ALL
238 NAME_SZ = 160, /* larger max one line, allows for longer
239 encryption password support */
240 #else
241 NAME_SZ = 80, /* max one line */
242 #endif
243
244 PEM_PASS_READ = 0,
245 PEM_PASS_WRITE = 1,
246 };
247
248 typedef int (wc_pem_password_cb)(char* passwd, int sz, int rw, void* userdata);
249 #ifndef OPENSSL_COEXIST
250 /* In the past, wc_pem_password_cb was called pem_password_cb, which is the same

NetBurner, Inc.
1468 File Documentation

251 * name as an identical typedef in OpenSSL. We don’t want to break existing code
252 * that uses the name pem_password_cb, so we define it here as a macro alias for
253 * wc_pem_password_cb. In cases where a user needs to use both OpenSSL and
254 * wolfSSL headers in the same code, they should define OPENSSL_COEXIST to
255 * avoid errors stemming from the typedef being declared twice. */
256 #define pem_password_cb wc_pem_password_cb
257 #endif
258
259 typedef struct EncryptedInfo {
260 wc_pem_password_cb* passwd_cb;
261 void* passwd_userdata;
262
263 long consumed; /* tracks PEM bytes consumed */
264
265 int cipherType;
266 word32 keySz;
267 word32 ivSz; /* salt or encrypted IV size */
268
269 char name[NAME_SZ]; /* cipher name, such as "DES-CBC" */
270 byte iv[IV_SZ]; /* salt or encrypted IV */
271
272 word16 set:1; /* if encryption set */
273 } EncryptedInfo;
274
275
276 #define WOLFSSL_ASN1_INTEGER_MAX 20
277 typedef struct WOLFSSL_ASN1_INTEGER {
278 /* size can be increased set at 20 for tag, length then to hold at least 16
279 * byte type */
280 unsigned char intData[WOLFSSL_ASN1_INTEGER_MAX];
281 /* ASN_INTEGER | LENGTH | hex of number */
282 unsigned char negative; /* negative number flag */
283
284 unsigned char* data;
285 unsigned int dataMax; /* max size of data buffer */
286 unsigned int isDynamic:1; /* flag for if data pointer dynamic (1 is yes 0 is no) */
287
288 int length;
289 int type;
290 } WOLFSSL_ASN1_INTEGER;
291
292
293 #if defined(WOLFSSL_CERT_GEN) || defined(WOLFSSL_CERT_EXT)
294 #ifdef WOLFSSL_EKU_OID
295 #ifndef CTC_MAX_EKU_NB
296 #define CTC_MAX_EKU_NB 1
297 #endif
298 #ifndef CTC_MAX_EKU_OID_SZ
299 #define CTC_MAX_EKU_OID_SZ 30
300 #endif
301 #else
302 #undef CTC_MAX_EKU_OID_SZ
303 #define CTC_MAX_EKU_OID_SZ 0
304 #endif
305 #endif /* WOLFSSL_CERT_GEN || WOLFSSL_CERT_EXT */
306
307 #if defined(WOLFSSL_CERT_GEN) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
308 #ifdef WOLFSSL_MULTI_ATTRIB
309 #ifndef CTC_MAX_ATTRIB
310 #define CTC_MAX_ATTRIB 4
311 #endif
312
313 /* ASN Encoded Name field */
314 typedef struct NameAttrib {
315 int sz; /* actual string value length */
316 int id; /* id of name */
317 int type; /* enc of name */
318 char value[CTC_NAME_SIZE]; /* name */
319 } NameAttrib;
320 #endif /* WOLFSSL_MULTI_ATTRIB */
321 #endif /* WOLFSSL_CERT_GEN || OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
322
323 #ifdef WOLFSSL_CERT_GEN
324 #ifdef WOLFSSL_CUSTOM_OID
325 typedef struct CertOidField {
326 byte* oid;
327 byte* val;
328 int oidSz;
329 int valSz;
330 char enc;
331 } CertOidField;
332
333 typedef struct CertExtension {
334 const char* oid;
335 byte crit;
336 const byte* val;
337 int valSz;

NetBurner, Inc.
22.308 asn_public.h 1469

338 } CertExtension;
339 #endif
340 #endif /* WOLFSSL_CERT_GEN */
341
342 #if defined(WOLFSSL_CERT_GEN) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
343 typedef struct CertName {
344 char country[CTC_NAME_SIZE];
345 char countryEnc;
346 char state[CTC_NAME_SIZE];
347 char stateEnc;
348 char street[CTC_NAME_SIZE];
349 char streetEnc;
350 char locality[CTC_NAME_SIZE];
351 char localityEnc;
352 char sur[CTC_NAME_SIZE];
353 char surEnc;
354 #ifdef WOLFSSL_CERT_NAME_ALL
355 char givenName[CTC_NAME_SIZE];
356 char givenNameEnc;
357 char initials[CTC_NAME_SIZE];
358 char initialsEnc;
359 char dnQualifier[CTC_NAME_SIZE];
360 char dnQualifierEnc;
361 char dnName[CTC_NAME_SIZE];
362 char dnNameEnc;
363 #endif /* WOLFSSL_CERT_NAME_ALL */
364 char org[CTC_NAME_SIZE];
365 char orgEnc;
366 char unit[CTC_NAME_SIZE];
367 char unitEnc;
368 char commonName[CTC_NAME_SIZE];
369 char commonNameEnc;
370 char serialDev[CTC_NAME_SIZE];
371 char serialDevEnc;
372 char userId[CTC_NAME_SIZE];
373 char userIdEnc;
374 char postalCode[CTC_NAME_SIZE];
375 char postalCodeEnc;
376 #ifdef WOLFSSL_CERT_EXT
377 char busCat[CTC_NAME_SIZE];
378 char busCatEnc;
379 char joiC[CTC_NAME_SIZE];
380 char joiCEnc;
381 char joiSt[CTC_NAME_SIZE];
382 char joiStEnc;
383 #endif
384 char email[CTC_NAME_SIZE]; /* !!!! email has to be last !!!! */
385 #ifdef WOLFSSL_MULTI_ATTRIB
386 NameAttrib name[CTC_MAX_ATTRIB];
387 #endif
388 #ifdef WOLFSSL_CUSTOM_OID
389 CertOidField custom;
390 #endif
391 } CertName;
392 #endif /* WOLFSSL_CERT_GEN || OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL*/
393
394 #ifdef WOLFSSL_CERT_GEN
395
396 #ifndef NUM_CUSTOM_EXT
397 #define NUM_CUSTOM_EXT 16
398 #endif
399
400 /* for user to fill for certificate generation */
401 typedef struct Cert {
402 int version; /* x509 version */
403 byte serial[CTC_SERIAL_SIZE]; /* serial number */
404 int serialSz; /* serial size */
405 int sigType; /* signature algo type */
406 CertName issuer; /* issuer info */
407 int daysValid; /* validity days */
408 int selfSigned; /* self signed flag */
409 CertName subject; /* subject info */
410 int isCA; /* is this going to be a CA */
411 byte pathLen; /* max depth of valid certification
412 * paths that include this cert */
413 /* internal use only */
414 int bodySz; /* pre sign total size */
415 int keyType; /* public key type of subject */
416 #ifdef WOLFSSL_ALT_NAMES
417 byte altNames[CTC_MAX_ALT_SIZE]; /* altNames copy */
418 int altNamesSz; /* altNames size in bytes */
419 #endif
420 byte beforeDate[CTC_DATE_SIZE]; /* before date copy */
421 int beforeDateSz; /* size of copy */
422 byte afterDate[CTC_DATE_SIZE]; /* after date copy */
423 int afterDateSz; /* size of copy */
424 #ifdef WOLFSSL_CERT_EXT

NetBurner, Inc.
1470 File Documentation

425 byte skid[CTC_MAX_SKID_SIZE]; /* Subject Key Identifier */


426 int skidSz; /* SKID size in bytes */
427 byte akid[CTC_MAX_AKID_SIZE
428 #ifdef WOLFSSL_AKID_NAME
429 + sizeof(CertName) + CTC_SERIAL_SIZE
430 #endif
431 ]; /* Authority Key
432 * Identifier */
433 int akidSz; /* AKID size in bytes */
434 #ifdef WOLFSSL_AKID_NAME
435 byte rawAkid; /* Set to true if akid is a
436 * AuthorityKeyIdentifier object.
437 * Set to false if akid is just a
438 * KeyIdentifier object. */
439 #endif
440 word16 keyUsage; /* Key Usage */
441 byte extKeyUsage; /* Extended Key Usage */
442 #ifndef IGNORE_NETSCAPE_CERT_TYPE
443 byte nsCertType; /* Netscape Certificate Type */
444 #endif
445 #ifdef WOLFSSL_EKU_OID
446 /* Extended Key Usage OIDs */
447 byte extKeyUsageOID[CTC_MAX_EKU_NB][CTC_MAX_EKU_OID_SZ];
448 byte extKeyUsageOIDSz[CTC_MAX_EKU_NB];
449 #endif
450 char certPolicies[CTC_MAX_CERTPOL_NB][CTC_MAX_CERTPOL_SZ];
451 word16 certPoliciesNb; /* Number of Cert Policy */
452 byte crlInfo[CTC_MAX_CRLINFO_SZ]; /* CRL Distribution points */
453 int crlInfoSz;
454 #endif
455 #if defined(WOLFSSL_CERT_EXT) || defined(OPENSSL_EXTRA) || \
456 defined(WOLFSSL_CERT_REQ)
457 byte issRaw[sizeof(CertName)]; /* raw issuer info */
458 byte sbjRaw[sizeof(CertName)]; /* raw subject info */
459 #endif
460 #ifdef WOLFSSL_CERT_REQ
461 char challengePw[CTC_NAME_SIZE];
462 char unstructuredName[CTC_NAME_SIZE];
463 int challengePwPrintableString; /* encode as PrintableString */
464 #endif
465 #ifdef WOLFSSL_CUSTOM_OID
466 /* user oid and value to go in req extensions */
467 CertOidField extCustom;
468
469 /* Extensions to go into X.509 certificates */
470 CertExtension customCertExt[NUM_CUSTOM_EXT];
471 int customCertExtCount;
472 #endif
473 void* decodedCert; /* internal DecodedCert allocated from heap */
474 byte* der; /* Pointer to buffer of current DecodedCert cache */
475 void* heap; /* heap hint */
476 byte basicConstSet:1; /* Indicator for when Basic Constaint is set */
477 byte pathLenSet:1; /* Indicator for when path length is set */
478 #ifdef WOLFSSL_ALT_NAMES
479 byte altNamesCrit:1; /* Indicator of criticality of SAN extension */
480 #endif
481 } Cert;
482
483
484 /* Initialize and Set Certificate defaults:
485 version = 3 (0x2)
486 serial = 0 (Will be randomly generated)
487 sigType = SHA_WITH_RSA
488 issuer = blank
489 daysValid = 500
490 selfSigned = 1 (true) use subject as issuer
491 subject = blank
492 isCA = 0 (false)
493 keyType = RSA_KEY (default)
494 */
495 WOLFSSL_ABI WOLFSSL_API int wc_InitCert(Cert* cert);
496 WOLFSSL_ABI WOLFSSL_API Cert* wc_CertNew(void* heap);
497 WOLFSSL_ABI WOLFSSL_API void wc_CertFree(Cert* cert);
498 WOLFSSL_API int wc_InitCert_ex(Cert* cert, void* heap, int devId);
499 WOLFSSL_API int wc_MakeCert_ex(Cert* cert, byte* derBuffer, word32 derSz,
500 int keyType, void* key, WC_RNG* rng);
501 WOLFSSL_ABI
502 WOLFSSL_API int wc_MakeCert(Cert* cert, byte* derBuffer, word32 derSz,
503 RsaKey* rsaKey, ecc_key* eccKey, WC_RNG* rng);
504 #ifdef WOLFSSL_CERT_REQ
505 WOLFSSL_API int wc_MakeCertReq_ex(Cert* cert, byte* derBuffer, word32 derSz,
506 int keyType, void* key);
507 WOLFSSL_ABI
508 WOLFSSL_API int wc_MakeCertReq(Cert* cert, byte* derBuffer, word32 derSz,
509 RsaKey* rsaKey, ecc_key* eccKey);
510 #endif
511 WOLFSSL_API int wc_SignCert_ex(int requestSz, int sType, byte* buf,

NetBurner, Inc.
22.308 asn_public.h 1471

512 word32 buffSz, int keyType, void* key,


513 WC_RNG* rng);
514 WOLFSSL_API int wc_SignCert(int requestSz, int sType, byte* buf, word32 buffSz,
515 RsaKey* rsaKey, ecc_key* eccKey, WC_RNG* rng);
516 WOLFSSL_ABI
517 WOLFSSL_API int wc_MakeSelfCert(Cert* cert, byte* buf, word32 buffSz,
518 RsaKey* key, WC_RNG* rng);
519 WOLFSSL_ABI WOLFSSL_API int wc_SetIssuer(Cert* cert, const char* issuerFile);
520 WOLFSSL_ABI WOLFSSL_API int wc_SetSubject(Cert* cert, const char* subjectFile);
521 #ifdef WOLFSSL_ALT_NAMES
522 WOLFSSL_ABI WOLFSSL_API int wc_SetAltNames(Cert* cert, const char* file);
523 #endif
524
525 #ifdef WOLFSSL_CERT_GEN_CACHE
526 WOLFSSL_ABI WOLFSSL_API void wc_SetCert_Free(Cert* cert);
527 #endif
528
529 WOLFSSL_ABI
530 WOLFSSL_API int wc_SetIssuerBuffer(Cert* cert, const byte* der, int derSz);
531 WOLFSSL_ABI
532 WOLFSSL_API int wc_SetSubjectBuffer(Cert* cert, const byte* der, int derSz);
533 WOLFSSL_ABI
534 WOLFSSL_API int wc_SetAltNamesBuffer(Cert* cert, const byte* der, int derSz);
535 WOLFSSL_ABI
536 WOLFSSL_API int wc_SetDatesBuffer(Cert* cert, const byte* der, int derSz);
537
538 #ifndef NO_ASN_TIME
539 WOLFSSL_API int wc_GetCertDates(Cert* cert, struct tm* before,
540 struct tm* after);
541 #endif
542
543 #ifdef WOLFSSL_CERT_EXT
544 WOLFSSL_API int wc_SetAuthKeyIdFromPublicKey_ex(Cert *cert, int keyType,
545 void* key);
546 WOLFSSL_API int wc_SetAuthKeyIdFromPublicKey(Cert *cert, RsaKey *rsakey,
547 ecc_key *eckey);
548 WOLFSSL_API int wc_SetAuthKeyIdFromCert(Cert *cert, const byte *der, int derSz);
549 WOLFSSL_API int wc_SetAuthKeyId(Cert *cert, const char* file);
550 WOLFSSL_API int wc_SetSubjectKeyIdFromPublicKey_ex(Cert *cert, int keyType,
551 void* key);
552 WOLFSSL_API int wc_SetSubjectKeyIdFromPublicKey(Cert *cert, RsaKey *rsakey,
553 ecc_key *eckey);
554 WOLFSSL_API int wc_SetSubjectKeyId(Cert *cert, const char* file);
555 WOLFSSL_ABI WOLFSSL_API int wc_GetSubjectRaw(byte **subjectRaw, Cert *cert);
556 WOLFSSL_ABI
557 WOLFSSL_API int wc_SetSubjectRaw(Cert* cert, const byte* der, int derSz);
558 WOLFSSL_ABI
559 WOLFSSL_API int wc_SetIssuerRaw(Cert* cert, const byte* der, int derSz);
560
561 /* Set the KeyUsage.
562 * Value is a string separated tokens with ’,’. Accepted tokens are :
563 * digitalSignature,nonRepudiation,contentCommitment,keyCertSign,cRLSign,
564 * dataEncipherment,keyAgreement,keyEncipherment,encipherOnly and decipherOnly.
565 *
566 * nonRepudiation and contentCommitment are for the same usage.
567 */
568 WOLFSSL_API int wc_SetKeyUsage(Cert *cert, const char *value);
569
570 /* Set ExtendedKeyUsage
571 * Value is a string separated tokens with ’,’. Accepted tokens are :
572 * any,serverAuth,clientAuth,codeSigning,emailProtection,timeStamping,OCSPSigning
573 */
574 WOLFSSL_API int wc_SetExtKeyUsage(Cert *cert, const char *value);
575
576
577 #ifdef WOLFSSL_EKU_OID
578 /* Set ExtendedKeyUsage with unique OID
579 * oid is expected to be in byte representation
580 */
581 WOLFSSL_API int wc_SetExtKeyUsageOID(Cert *cert, const char *oid, word32 sz,
582 byte idx, void* heap);
583 #endif /* WOLFSSL_EKU_OID */
584
585 #if defined(WOLFSSL_ASN_TEMPLATE) && defined(WOLFSSL_CUSTOM_OID) && \
586 defined(HAVE_OID_ENCODING)
587 WOLFSSL_API int wc_SetCustomExtension(Cert *cert, int critical, const char *oid,
588 const byte *der, word32 derSz);
589 #endif
590
591 #endif /* WOLFSSL_CERT_EXT */
592 #endif /* WOLFSSL_CERT_GEN */
593
594 WOLFSSL_API int wc_GetDateInfo(const byte* certDate, int certDateSz,
595 const byte** date, byte* format, int* length);
596 #ifndef NO_ASN_TIME
597 WOLFSSL_API int wc_GetDateAsCalendarTime(const byte* date, int length,
598 byte format, struct tm* timearg);

NetBurner, Inc.
1472 File Documentation

599 #endif
600
601 #if defined(WOLFSSL_PEM_TO_DER) || defined(WOLFSSL_DER_TO_PEM)
602
603 WOLFSSL_API int wc_PemGetHeaderFooter(int type, const char** header,
604 const char** footer);
605
606 #endif
607
608 WOLFSSL_API int wc_AllocDer(DerBuffer** pDer, word32 length, int type, void* heap);
609 WOLFSSL_API void wc_FreeDer(DerBuffer** pDer);
610
611 #ifdef WOLFSSL_PEM_TO_DER
612 WOLFSSL_API int wc_PemToDer(const unsigned char* buff, long longSz, int type,
613 DerBuffer** pDer, void* heap, EncryptedInfo* info, int* keyFormat);
614
615 WOLFSSL_API int wc_KeyPemToDer(const unsigned char* pem, int pemSz,
616 unsigned char* buff, int buffSz, const char* pass);
617 WOLFSSL_API int wc_CertPemToDer(const unsigned char* pem, int pemSz,
618 unsigned char* buff, int buffSz, int type);
619 #endif /* WOLFSSL_PEM_TO_DER */
620
621 #if defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER)
622 #if !defined(NO_FILESYSTEM) && defined(WOLFSSL_PEM_TO_DER)
623 WOLFSSL_API int wc_PemPubKeyToDer(const char* fileName,
624 unsigned char* derBuf, int derSz);
625 WOLFSSL_API int wc_PemPubKeyToDer_ex(const char* fileName, DerBuffer** der);
626 #endif
627
628 WOLFSSL_API int wc_PubKeyPemToDer(const unsigned char* pem, int pemSz,
629 unsigned char* buff, int buffSz);
630 #endif /* WOLFSSL_CERT_EXT || WOLFSSL_PUB_PEM_TO_DER */
631
632 #ifdef WOLFSSL_CERT_GEN
633 #if !defined(NO_FILESYSTEM) && defined(WOLFSSL_PEM_TO_DER)
634 WOLFSSL_API int wc_PemCertToDer(const char* fileName,
635 unsigned char* derBuf, int derSz);
636 WOLFSSL_API int wc_PemCertToDer_ex(const char* fileName, DerBuffer** der);
637 #endif
638 #endif /* WOLFSSL_CERT_GEN */
639
640 #ifdef WOLFSSL_DER_TO_PEM
641 WOLFSSL_ABI
642 WOLFSSL_API int wc_DerToPem(const byte* der, word32 derSz, byte* output,
643 word32 outputSz, int type);
644 WOLFSSL_API int wc_DerToPemEx(const byte* der, word32 derSz, byte* output,
645 word32 outputSz, byte *cipherIno, int type);
646 #endif
647
648 #ifndef NO_RSA
649 #if !defined(HAVE_USER_RSA)
650 WOLFSSL_API int wc_RsaPublicKeyDecode_ex(const byte* input, word32* inOutIdx,
651 word32 inSz, const byte** n, word32* nSz, const byte** e, word32* eSz);
652 /* For FIPS v1/v2 and selftest this is in rsa.h */
653 #if (!defined(HAVE_SELFTEST) || \
654 (defined(HAVE_SELFTEST) && defined(WOLFSSL_CERT_GEN) && \
655 !defined(WOLFSSL_KEY_GEN))) && \
656 (!defined(HAVE_FIPS) || \
657 !defined(HAVE_FIPS_VERSION) || \
658 ((HAVE_FIPS_VERSION > 2) && \
659 (! ((HAVE_FIPS_VERSION == 5) && (HAVE_FIPS_VERSION_MINOR == 0)))))
660 WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
661 #endif
662 #endif
663 WOLFSSL_API int wc_RsaPublicKeyDerSize(RsaKey* key, int with_header);
664 WOLFSSL_API int wc_RsaKeyToPublicDer_ex(RsaKey* key, byte* output, word32 inLen,
665 int with_header);
666 #endif
667
668 #ifndef NO_DSA
669 /* DSA parameter DER helper functions */
670 WOLFSSL_API int wc_DsaParamsDecode(const byte* input, word32* inOutIdx, DsaKey* key,
671 word32 inSz);
672 WOLFSSL_API int wc_DsaKeyToParamsDer(DsaKey* key, byte* output,
673 word32 inLen);
674 WOLFSSL_API int wc_DsaKeyToParamsDer_ex(DsaKey* key, byte* output,
675 word32* inLen);
676 #endif
677
678 #if !defined(NO_DH) && defined(WOLFSSL_DH_EXTRA)
679 WOLFSSL_LOCAL int wc_DhKeyToDer(DhKey* key, byte* output, word32* outSz, int exportPriv);
680 WOLFSSL_API int wc_DhParamsToDer(DhKey* key, byte* out, word32* outSz);
681 WOLFSSL_API int wc_DhPubKeyToDer(DhKey* key, byte* out, word32* outSz);
682 WOLFSSL_API int wc_DhPrivKeyToDer(DhKey* key, byte* out, word32* outSz);
683 #endif
684
685 #ifdef HAVE_ECC

NetBurner, Inc.
22.308 asn_public.h 1473

686 /* private key helpers */


687 WOLFSSL_ABI
688 WOLFSSL_API int wc_EccPrivateKeyDecode(const byte* input, word32* inOutIdx,
689 ecc_key* key, word32 inSz);
690 WOLFSSL_ABI
691 WOLFSSL_API int wc_EccKeyToDer(ecc_key* key, byte* output, word32 inLen);
692 WOLFSSL_API int wc_EccPrivateKeyToDer(ecc_key* key, byte* output,
693 word32 inLen);
694 WOLFSSL_API int wc_EccKeyDerSize(ecc_key* key, int pub);
695 WOLFSSL_API int wc_EccPrivateKeyToPKCS8(ecc_key* key, byte* output,
696 word32* outLen);
697 WOLFSSL_API int wc_EccKeyToPKCS8(ecc_key* key, byte* output,
698 word32* outLen);
699
700 /* public key helper */
701 WOLFSSL_ABI
702 WOLFSSL_API int wc_EccPublicKeyDecode(const byte* input, word32* inOutIdx,
703 ecc_key* key, word32 inSz);
704 WOLFSSL_ABI WOLFSSL_API int wc_EccPublicKeyToDer(ecc_key* key, byte* output,
705 word32 inLen, int with_AlgCurve);
706 WOLFSSL_API int wc_EccPublicKeyToDer_ex(ecc_key* key, byte* output,
707 word32 inLen, int with_AlgCurve,
708 int comp);
709 WOLFSSL_API int wc_EccPublicKeyDerSize(ecc_key* key, int with_AlgCurve);
710 #endif
711
712 /* RFC 5958 (Asymmetric Key Packages) */
713 #if !defined(WC_ENABLE_ASYM_KEY_EXPORT) && \
714 ((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_EXPORT)) || \
715 (defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_EXPORT)) || \
716 (defined(HAVE_ED448) && defined(HAVE_ED448_KEY_EXPORT)) || \
717 (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_EXPORT)) || \
718 (defined(HAVE_PQC) && (defined(HAVE_FALCON) || defined(HAVE_DILITHIUM))))
719 #define WC_ENABLE_ASYM_KEY_EXPORT
720 #endif
721
722 #if !defined(WC_ENABLE_ASYM_KEY_IMPORT) && \
723 ((defined(HAVE_ED25519) && defined(HAVE_ED25519_KEY_IMPORT)) || \
724 (defined(HAVE_CURVE25519) && defined(HAVE_CURVE25519_KEY_IMPORT)) || \
725 (defined(HAVE_ED448) && defined(HAVE_ED448_KEY_IMPORT)) || \
726 (defined(HAVE_CURVE448) && defined(HAVE_CURVE448_KEY_IMPORT)) || \
727 (defined(HAVE_PQC)))
728 #define WC_ENABLE_ASYM_KEY_IMPORT
729 #endif
730
731 #ifdef HAVE_ED25519
732 #ifdef HAVE_ED25519_KEY_IMPORT
733 WOLFSSL_API int wc_Ed25519PrivateKeyDecode(const byte* input, word32* inOutIdx,
734 ed25519_key* key, word32 inSz);
735 WOLFSSL_API int wc_Ed25519PublicKeyDecode(const byte* input, word32* inOutIdx,
736 ed25519_key* key, word32 inSz);
737 #endif
738 #ifdef HAVE_ED25519_KEY_EXPORT
739 WOLFSSL_API int wc_Ed25519KeyToDer(ed25519_key* key, byte* output,
740 word32 inLen);
741 WOLFSSL_API int wc_Ed25519PrivateKeyToDer(ed25519_key* key, byte* output,
742 word32 inLen);
743 WOLFSSL_API int wc_Ed25519PublicKeyToDer(ed25519_key* key, byte* output,
744 word32 inLen, int withAlg);
745 #endif
746 #endif /* HAVE_ED25519 */
747
748 #ifdef HAVE_CURVE25519
749 #ifdef HAVE_CURVE25519_KEY_IMPORT
750 WOLFSSL_API int wc_Curve25519PrivateKeyDecode(
751 const byte* input, word32* inOutIdx, curve25519_key* key, word32 inSz);
752 WOLFSSL_API int wc_Curve25519PublicKeyDecode(
753 const byte* input, word32* inOutIdx, curve25519_key* key, word32 inSz);
754 #endif
755 #ifdef HAVE_CURVE25519_KEY_EXPORT
756 WOLFSSL_API int wc_Curve25519PrivateKeyToDer(
757 curve25519_key* key, byte* output, word32 inLen);
758 WOLFSSL_API int wc_Curve25519PublicKeyToDer(
759 curve25519_key* key, byte* output, word32 inLen, int withAlg);
760 #endif
761 #endif /* HAVE_CURVE25519 */
762
763 #ifdef HAVE_ED448
764 #ifdef HAVE_ED448_KEY_IMPORT
765 WOLFSSL_API int wc_Ed448PrivateKeyDecode(
766 const byte* input, word32* inOutIdx, ed448_key* key, word32 inSz);
767 WOLFSSL_API int wc_Ed448PublicKeyDecode(
768 const byte* input, word32* inOutIdx, ed448_key* key, word32 inSz);
769 #endif
770 #ifdef HAVE_ED448_KEY_EXPORT
771 WOLFSSL_API int wc_Ed448KeyToDer(ed448_key* key, byte* output, word32 inLen);
772 WOLFSSL_API int wc_Ed448PrivateKeyToDer(

NetBurner, Inc.
1474 File Documentation

773 ed448_key* key, byte* output, word32 inLen);


774 WOLFSSL_API int wc_Ed448PublicKeyToDer(
775 ed448_key* key, byte* output, word32 inLen, int withAlg);
776 #endif
777 #endif /* HAVE_ED448 */
778
779 #ifdef HAVE_PQC
780 WOLFSSL_API int wc_Falcon_PrivateKeyDecode(const byte* input, word32* inOutIdx,
781 falcon_key* key, word32 inSz);
782 WOLFSSL_API int wc_Falcon_PublicKeyDecode(const byte* input, word32* inOutIdx,
783 falcon_key* key, word32 inSz);
784 WOLFSSL_API int wc_Falcon_KeyToDer(falcon_key* key, byte* output,
785 word32 inLen);
786 WOLFSSL_API int wc_Falcon_PrivateKeyToDer(falcon_key* key, byte* output,
787 word32 inLen);
788 WOLFSSL_API int wc_Falcon_PublicKeyToDer(falcon_key* key, byte* output,
789 word32 inLen, int withAlg);
790
791 WOLFSSL_API int wc_Dilithium_PrivateKeyDecode(const byte* input,
792 word32* inOutIdx,
793 dilithium_key* key, word32 inSz);
794 WOLFSSL_API int wc_Dilithium_PublicKeyDecode(const byte* input,
795 word32* inOutIdx,
796 dilithium_key* key, word32 inSz);
797 WOLFSSL_API int wc_Dilithium_KeyToDer(dilithium_key* key, byte* output,
798 word32 inLen);
799 WOLFSSL_API int wc_Dilithium_PrivateKeyToDer(dilithium_key* key, byte* output,
800 word32 inLen);
801 WOLFSSL_API int wc_Dilithium_PublicKeyToDer(dilithium_key* key, byte* output,
802 word32 inLen, int withAlg);
803 #endif /* HAVE_PQC */
804
805 #ifdef HAVE_CURVE448
806 #ifdef HAVE_CURVE448_KEY_IMPORT
807 WOLFSSL_API int wc_Curve448PrivateKeyDecode(const byte* input, word32* inOutIdx,
808 curve448_key* key, word32 inSz);
809 WOLFSSL_API int wc_Curve448PublicKeyDecode(const byte* input, word32* inOutIdx,
810 curve448_key* key, word32 inSz);
811 #endif
812 #ifdef HAVE_CURVE448_KEY_EXPORT
813 WOLFSSL_API int wc_Curve448PrivateKeyToDer(curve448_key* key, byte* output,
814 word32 inLen);
815 WOLFSSL_API int wc_Curve448PublicKeyToDer(curve448_key* key, byte* output,
816 word32 inLen, int withAlg);
817 #endif
818 #endif /* HAVE_CURVE448 */
819
820
821 /* DER encode signature */
822 WOLFSSL_API word32 wc_EncodeSignature(byte* out, const byte* digest,
823 word32 digSz, int hashOID);
824 WOLFSSL_API int wc_GetCTC_HashOID(int type);
825
826 WOLFSSL_API int wc_GetPkcs8TraditionalOffset(byte* input,
827 word32* inOutIdx, word32 sz);
828 WOLFSSL_API int wc_CreatePKCS8Key(byte* out, word32* outSz,
829 byte* key, word32 keySz, int algoID, const byte* curveOID,
830 word32 oidSz);
831 WOLFSSL_API int wc_EncryptPKCS8Key(byte* key, word32 keySz, byte* out, word32* outSz,
832 const char* password, int passwordSz, int vPKCS, int pbeOid,
833 int encAlgId, byte* salt, word32 saltSz, int itt, WC_RNG* rng,
834 void* heap);
835 WOLFSSL_API int wc_DecryptPKCS8Key(byte* input, word32 sz, const char* password,
836 int passwordSz);
837 WOLFSSL_API int wc_CreateEncryptedPKCS8Key(byte* key, word32 keySz, byte* out,
838 word32* outSz, const char* password, int passwordSz, int vPKCS,
839 int pbeOid, int encAlgId, byte* salt, word32 saltSz, int itt,
840 WC_RNG* rng, void* heap);
841
842 #ifndef NO_ASN_TIME
843 /* Time */
844 /* Returns seconds (Epoch/UTC)
845 * timePtr: is "time_t", which is typically "long"
846 * Example:
847 long lTime;
848 rc = wc_GetTime(&lTime, (word32)sizeof(lTime));
849 */
850 WOLFSSL_API int wc_GetTime(void* timePtr, word32 timeSize);
851
852 typedef time_t (*wc_time_cb)(time_t* t);
853 WOLFSSL_API int wc_SetTimeCb(wc_time_cb f);
854 WOLFSSL_API time_t wc_Time(time_t* t);
855 #endif
856
857 #ifdef WOLFSSL_ENCRYPTED_KEYS
858 WOLFSSL_API int wc_EncryptedInfoGet(EncryptedInfo* info,
859 const char* cipherInfo);

NetBurner, Inc.
22.309 async.h 1475

860 #endif
861
862
863 #ifdef WOLFSSL_CERT_PIV
864
865 typedef struct _wc_CertPIV {
866 const byte* cert;
867 word32 certSz;
868 const byte* certErrDet;
869 word32 certErrDetSz;
870 const byte* nonce; /* Identiv Only */
871 word32 nonceSz; /* Identiv Only */
872 const byte* signedNonce; /* Identiv Only */
873 word32 signedNonceSz; /* Identiv Only */
874
875 /* flags */
876 word16 compression:2;
877 word16 isX509:1;
878 word16 isIdentiv:1;
879 } wc_CertPIV;
880
881 WOLFSSL_API int wc_ParseCertPIV(wc_CertPIV* cert, const byte* buf, word32 totalSz);
882 #endif /* WOLFSSL_CERT_PIV */
883
884 /* Forward declaration needed, as DecodedCert is defined in asn.h.*/
885 struct DecodedCert;
886
887 WOLFSSL_API void wc_InitDecodedCert(
888 struct DecodedCert* cert, const byte* source, word32 inSz, void* heap);
889 WOLFSSL_API void wc_FreeDecodedCert(struct DecodedCert* cert);
890 WOLFSSL_API int wc_ParseCert(
891 struct DecodedCert* cert, int type, int verify, void* cm);
892
893 WOLFSSL_API int wc_GetPubKeyDerFromCert(struct DecodedCert* cert,
894 byte* derKey, word32* derKeySz);
895
896 #ifdef WOLFSSL_FPKI
897 WOLFSSL_API int wc_GetUUIDFromCert(struct DecodedCert* cert,
898 byte* uuid, word32* uuidSz);
899 WOLFSSL_API int wc_GetFASCNFromCert(struct DecodedCert* cert,
900 byte* fascn, word32* fascnSz);
901 #endif /* WOLFSSL_FPKI */
902 #ifdef __cplusplus
903 } /* extern "C" */
904 #endif
905
906 #endif /* WOLF_CRYPT_ASN_PUBLIC_H */

22.309 async.h

22.310 blake2-impl.h
1 /*
2 BLAKE2 reference source code package - reference C implementations
3
4 Written in 2012 by Samuel Neves <[email protected]>
5
6 To the extent possible under law, the author(s) have dedicated all copyright
7 and related and neighboring rights to this software to the public domain
8 worldwide. This software is distributed without any warranty.
9
10 You should have received a copy of the CC0 Public Domain Dedication along with
11 this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
12 */
13 /* blake2-impl.h
14 *
15 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
16 *
17 * This file is part of wolfSSL.
18 *
19 * Contact [email protected] with any questions or comments.
20 *
21 * https://www.wolfssl.com
22 */
23
24
25
26 #ifndef WOLFCRYPT_BLAKE2_IMPL_H
27 #define WOLFCRYPT_BLAKE2_IMPL_H
28
29 #include <wolfssl/wolfcrypt/types.h>
30
31 static WC_INLINE word32 load32( const void *src )

NetBurner, Inc.
1476 File Documentation

32 {
33 #if defined(LITTLE_ENDIAN_ORDER)
34 return *( word32 * )( src );
35 #else
36 const byte *p = ( byte * )src;
37 word32 w = *p++;
38 w |= ( word32 )( *p++ ) « 8;
39 w |= ( word32 )( *p++ ) « 16;
40 w |= ( word32 )( *p++ ) « 24;
41 return w;
42 #endif
43 }
44
45 static WC_INLINE word64 load64( const void *src )
46 {
47 #if defined(LITTLE_ENDIAN_ORDER)
48 return *( word64 * )( src );
49 #else
50 const byte *p = ( byte * )src;
51 word64 w = *p++;
52 w |= ( word64 )( *p++ ) « 8;
53 w |= ( word64 )( *p++ ) « 16;
54 w |= ( word64 )( *p++ ) « 24;
55 w |= ( word64 )( *p++ ) « 32;
56 w |= ( word64 )( *p++ ) « 40;
57 w |= ( word64 )( *p++ ) « 48;
58 w |= ( word64 )( *p++ ) « 56;
59 return w;
60 #endif
61 }
62
63 static WC_INLINE void store32( void *dst, word32 w )
64 {
65 #if defined(LITTLE_ENDIAN_ORDER)
66 *( word32 * )( dst ) = w;
67 #else
68 byte *p = ( byte * )dst;
69 *p++ = ( byte )w; w »= 8;
70 *p++ = ( byte )w; w »= 8;
71 *p++ = ( byte )w; w »= 8;
72 *p++ = ( byte )w;
73 #endif
74 }
75
76 static WC_INLINE void store64( void *dst, word64 w )
77 {
78 #if defined(LITTLE_ENDIAN_ORDER) && !defined(WOLFSSL_GENERAL_ALIGNMENT)
79 *( word64 * )( dst ) = w;
80 #else
81 byte *p = ( byte * )dst;
82 *p++ = ( byte )w; w »= 8;
83 *p++ = ( byte )w; w »= 8;
84 *p++ = ( byte )w; w »= 8;
85 *p++ = ( byte )w; w »= 8;
86 *p++ = ( byte )w; w »= 8;
87 *p++ = ( byte )w; w »= 8;
88 *p++ = ( byte )w; w »= 8;
89 *p++ = ( byte )w;
90 #endif
91 }
92
93 static WC_INLINE word64 load48( const void *src )
94 {
95 const byte *p = ( const byte * )src;
96 word64 w = *p++;
97 w |= ( word64 )( *p++ ) « 8;
98 w |= ( word64 )( *p++ ) « 16;
99 w |= ( word64 )( *p++ ) « 24;
100 w |= ( word64 )( *p++ ) « 32;
101 w |= ( word64 )( *p++ ) « 40;
102 return w;
103 }
104
105 static WC_INLINE void store48( void *dst, word64 w )
106 {
107 byte *p = ( byte * )dst;
108 *p++ = ( byte )w; w »= 8;
109 *p++ = ( byte )w; w »= 8;
110 *p++ = ( byte )w; w »= 8;
111 *p++ = ( byte )w; w »= 8;
112 *p++ = ( byte )w; w »= 8;
113 *p++ = ( byte )w;
114 }
115
116 static WC_INLINE word32 rotl32( const word32 w, const unsigned c )
117 {
118 return ( w « c ) | ( w » ( 32 - c ) );

NetBurner, Inc.
22.311 blake2-int.h 1477

119 }
120
121 static WC_INLINE word64 rotl64( const word64 w, const unsigned c )
122 {
123 return ( w « c ) | ( w » ( 64 - c ) );
124 }
125
126 static WC_INLINE word32 rotr32( const word32 w, const unsigned c )
127 {
128 return ( w » c ) | ( w « ( 32 - c ) );
129 }
130
131 static WC_INLINE word64 rotr64( const word64 w, const unsigned c )
132 {
133 return ( w » c ) | ( w « ( 64 - c ) );
134 }
135
136 /* prevents compiler optimizing out memset() */
137 static WC_INLINE void secure_zero_memory( void *v, word64 n )
138 {
139 volatile byte *p = ( volatile byte * )v;
140
141 while( n-- ) *p++ = 0;
142 }
143
144 #endif /* WOLFCRYPT_BLAKE2_IMPL_H */
145

22.311 blake2-int.h
1 /*
2 BLAKE2 reference source code package - reference C implementations
3
4 Written in 2012 by Samuel Neves <[email protected]>
5
6 To the extent possible under law, the author(s) have dedicated all copyright
7 and related and neighboring rights to this software to the public domain
8 worldwide. This software is distributed without any warranty.
9
10 You should have received a copy of the CC0 Public Domain Dedication along with
11 this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
12 */
13 /* blake2-int.h
14 *
15 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
16 *
17 * This file is part of wolfSSL.
18 *
19 * Contact [email protected] with any questions or comments.
20 *
21 * https://www.wolfssl.com
22 */
23
24
25
26
27 #ifndef WOLFCRYPT_BLAKE2_INT_H
28 #define WOLFCRYPT_BLAKE2_INT_H
29
30 #include <wolfssl/wolfcrypt/types.h>
31
32 #if defined(__cplusplus)
33 extern "C" {
34 #endif
35
36 enum blake2s_constant
37 {
38 BLAKE2S_BLOCKBYTES = 64,
39 BLAKE2S_OUTBYTES = 32,
40 BLAKE2S_KEYBYTES = 32,
41 BLAKE2S_SALTBYTES = 8,
42 BLAKE2S_PERSONALBYTES = 8
43 };
44
45 enum blake2b_constant
46 {
47 BLAKE2B_BLOCKBYTES = 128,
48 BLAKE2B_OUTBYTES = 64,
49 BLAKE2B_KEYBYTES = 64,
50 BLAKE2B_SALTBYTES = 16,
51 BLAKE2B_PERSONALBYTES = 16
52 };
53
54 #pragma pack(push, 1)
55 typedef struct __blake2s_param

NetBurner, Inc.
1478 File Documentation

56 {
57 byte digest_length; /* 1 */
58 byte key_length; /* 2 */
59 byte fanout; /* 3 */
60 byte depth; /* 4 */
61 word32 leaf_length; /* 8 */
62 byte node_offset[6];/* 14 */
63 byte node_depth; /* 15 */
64 byte inner_length; /* 16 */
65 /* byte reserved[0]; */
66 byte salt[BLAKE2S_SALTBYTES]; /* 24 */
67 byte personal[BLAKE2S_PERSONALBYTES]; /* 32 */
68 } blake2s_param;
69
70 typedef struct __blake2s_state
71 {
72 word32 h[8];
73 word32 t[2];
74 word32 f[2];
75 byte buf[2 * BLAKE2S_BLOCKBYTES];
76 word32 buflen;
77 byte last_node;
78 } blake2s_state ;
79
80 typedef struct __blake2b_param
81 {
82 byte digest_length; /* 1 */
83 byte key_length; /* 2 */
84 byte fanout; /* 3 */
85 byte depth; /* 4 */
86 word32 leaf_length; /* 8 */
87 word64 node_offset; /* 16 */
88 byte node_depth; /* 17 */
89 byte inner_length; /* 18 */
90 byte reserved[14]; /* 32 */
91 byte salt[BLAKE2B_SALTBYTES]; /* 48 */
92 byte personal[BLAKE2B_PERSONALBYTES]; /* 64 */
93 } blake2b_param;
94
95 typedef struct __blake2b_state
96 {
97 word64 h[8];
98 word64 t[2];
99 word64 f[2];
100 byte buf[2 * BLAKE2B_BLOCKBYTES];
101 word64 buflen;
102 byte last_node;
103 } blake2b_state;
104
105 typedef struct __blake2sp_state
106 {
107 blake2s_state S[8][1];
108 blake2s_state R[1];
109 byte buf[8 * BLAKE2S_BLOCKBYTES];
110 word32 buflen;
111 } blake2sp_state;
112
113 typedef struct __blake2bp_state
114 {
115 blake2b_state S[4][1];
116 blake2b_state R[1];
117 byte buf[4 * BLAKE2B_BLOCKBYTES];
118 word64 buflen;
119 } blake2bp_state;
120 #pragma pack(pop)
121
122 /* Streaming API */
123 int blake2s_init( blake2s_state *S, byte outlen );
124 int blake2s_init_key( blake2s_state *S, byte outlen, const void *key, byte keylen );
125 int blake2s_init_param( blake2s_state *S, const blake2s_param *P );
126 int blake2s_update( blake2s_state *S, const byte *in, word32 inlen );
127 int blake2s_final( blake2s_state *S, byte *out, byte outlen );
128
129 int blake2b_init( blake2b_state *S, byte outlen );
130 int blake2b_init_key( blake2b_state *S, byte outlen, const void *key, byte keylen );
131 int blake2b_init_param( blake2b_state *S, const blake2b_param *P );
132 int blake2b_update( blake2b_state *S, const byte *in, word64 inlen );
133 int blake2b_final( blake2b_state *S, byte *out, byte outlen );
134
135 int blake2sp_init( blake2sp_state *S, byte outlen );
136 int blake2sp_init_key( blake2sp_state *S, byte outlen, const void *key, byte keylen );
137 int blake2sp_update( blake2sp_state *S, const byte *in, word32 inlen );
138 int blake2sp_final( blake2sp_state *S, byte *out, byte outlen );
139
140 int blake2bp_init( blake2bp_state *S, byte outlen );
141 int blake2bp_init_key( blake2bp_state *S, byte outlen, const void *key, byte keylen );
142 int blake2bp_update( blake2bp_state *S, const byte *in, word64 inlen );

NetBurner, Inc.
22.312 blake2.h File Reference 1479

143 int blake2bp_final( blake2bp_state *S, byte *out, byte outlen );


144
145 /* Simple API */
146 int blake2s( byte *out, const void *in, const void *key, byte outlen, word32 inlen, byte keylen );
147 int blake2b( byte *out, const void *in, const void *key, byte outlen, word64 inlen, byte keylen );
148
149 int blake2sp( byte *out, const void *in, const void *key, byte outlen, word32 inlen, byte keylen );
150 int blake2bp( byte *out, const void *in, const void *key, byte outlen, word64 inlen, byte keylen );
151
152 static WC_INLINE int blake2( byte *out, const void *in, const void *key, byte outlen, word64 inlen,
byte keylen )
153 {
154 return blake2b( out, in, key, outlen, inlen, keylen );
155 }
156
157
158
159 #if defined(__cplusplus)
160 }
161 #endif
162
163 #endif /* WOLFCRYPT_BLAKE2_INT_H */
164

22.312 blake2.h File Reference


#include <wolfssl/wolfcrypt/settings.h>

22.313 blake2.h
Go to the documentation of this file.
1 /* blake2.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_BLAKE2_H
17 #define WOLF_CRYPT_BLAKE2_H
18
19 #include <wolfssl/wolfcrypt/settings.h>
20
21 #if defined(HAVE_BLAKE2) || defined(HAVE_BLAKE2S)
22
23 #include <wolfssl/wolfcrypt/blake2-int.h>
24
25 /* call old functions if using fips for the sake of hmac @wc_fips */
26 #ifdef HAVE_FIPS
27 /* Since hmac can call blake functions provide original calls */
28 #define wc_InitBlake2b InitBlake2b
29 #define wc_Blake2bUpdate Blake2bUpdate
30 #define wc_Blake2bFinal Blake2bFinal
31 #endif
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 /* in bytes, variable digest size up to 512 bits (64 bytes) */
38 enum {
39 #ifdef HAVE_BLAKE2B
40 BLAKE2B_ID = WC_HASH_TYPE_BLAKE2B,
41 BLAKE2B_256 = 32, /* 256 bit type, SSL default */
42 #endif
43 #ifdef HAVE_BLAKE2S
44 BLAKE2S_ID = WC_HASH_TYPE_BLAKE2S,
45 BLAKE2S_256 = 32 /* 256 bit type */
46 #endif
47 };
48
49
50 #ifdef HAVE_BLAKE2B
51 /* BLAKE2b digest */
52 typedef struct Blake2b {

NetBurner, Inc.
1480 File Documentation

53 blake2b_state S[1]; /* our state */


54 word32 digestSz; /* digest size used on init */
55 } Blake2b;
56 #endif
57
58 #ifdef HAVE_BLAKE2S
59 /* BLAKE2s digest */
60 typedef struct Blake2s {
61 blake2s_state S[1]; /* our state */
62 word32 digestSz; /* digest size used on init */
63 } Blake2s;
64 #endif
65
66
67 #ifdef HAVE_BLAKE2B
68 WOLFSSL_API int wc_InitBlake2b(Blake2b* b2b, word32 digestSz);
69 WOLFSSL_API int wc_InitBlake2b_WithKey(Blake2b* b2b, word32 digestSz,
70 const byte *key, word32 keylen);
71 WOLFSSL_API int wc_Blake2bUpdate(Blake2b* b2b, const byte* data, word32 sz);
72 WOLFSSL_API int wc_Blake2bFinal(Blake2b* b2b, byte* final, word32 requestSz);
73 #endif
74
75 #ifdef HAVE_BLAKE2S
76 WOLFSSL_API int wc_InitBlake2s(Blake2s* b2s, word32 digestSz);
77 WOLFSSL_API int wc_InitBlake2s_WithKey(Blake2s* b2s, word32 digestSz,
78 const byte *key, word32 keylen);
79 WOLFSSL_API int wc_Blake2sUpdate(Blake2s* b2s, const byte* data, word32 sz);
80 WOLFSSL_API int wc_Blake2sFinal(Blake2s* b2s, byte* final, word32 requestSz);
81 #endif
82
83
84 #ifdef __cplusplus
85 }
86 #endif
87
88 #endif /* HAVE_BLAKE2 || HAVE_BLAKE2S */
89 #endif /* WOLF_CRYPT_BLAKE2_H */
90

22.314 chacha.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.315 chacha.h
Go to the documentation of this file.
1 /* chacha.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11 /*
12
13 DESCRIPTION
14 This library contains implementation for the ChaCha20 stream cipher.
15
16 */
22 #ifndef WOLF_CRYPT_CHACHA_H
23 #define WOLF_CRYPT_CHACHA_H
24
25 #include <wolfssl/wolfcrypt/types.h>
26
27 #ifdef HAVE_CHACHA
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /*
34 Initialization vector starts at 13 with zero being the index origin of a matrix.
35 Block counter is located at index 12.
36 0 1 2 3
37 4 5 6 7
38 8 9 10 11

NetBurner, Inc.
22.316 chacha20_poly1305.h File Reference 1481

39 12 13 14 15
40 */
41 #define CHACHA_MATRIX_CNT_IV 12
42
43 /* Size of the IV */
44 #define CHACHA_IV_WORDS 3
45
46 /* Size of IV in bytes*/
47 #define CHACHA_IV_BYTES 12
48 #ifdef HAVE_XCHACHA
49 #define XCHACHA_NONCE_BYTES 24
50 #endif
51
52 /* Size of ChaCha chunks */
53 #define CHACHA_CHUNK_WORDS 16
54 #define CHACHA_CHUNK_BYTES (CHACHA_CHUNK_WORDS * sizeof(word32))
55
56 #ifdef WOLFSSL_X86_64_BUILD
57 #if defined(USE_INTEL_SPEEDUP) && !defined(NO_CHACHA_ASM)
58 #define USE_INTEL_CHACHA_SPEEDUP
59 #define HAVE_INTEL_AVX1
60 #endif
61 #endif
62
63 enum {
64 CHACHA_ENC_TYPE = WC_CIPHER_CHACHA, /* cipher unique type */
65 CHACHA_MAX_KEY_SZ = 32,
66 };
67
68 typedef struct ChaCha {
69 word32 X[CHACHA_CHUNK_WORDS]; /* state of cipher */
70 #ifdef HAVE_INTEL_AVX1
71 /* vpshufd reads 16 bytes but we only use bottom 4. */
72 byte extra[12];
73 #endif
74 word32 left; /* number of bytes leftover */
75 #if defined(USE_INTEL_CHACHA_SPEEDUP) || defined(WOLFSSL_ARMASM)
76 word32 over[CHACHA_CHUNK_WORDS];
77 #endif
78 } ChaCha;
79
84 WOLFSSL_API int wc_Chacha_SetIV(ChaCha* ctx, const byte* inIv, word32 counter);
85
86 WOLFSSL_API int wc_Chacha_Process(ChaCha* ctx, byte* cipher, const byte* plain,
87 word32 msglen);
88
89 WOLFSSL_LOCAL void wc_Chacha_purge_current_block(ChaCha* ctx);
90
91 WOLFSSL_API int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz);
92
93 #ifdef HAVE_XCHACHA
94 WOLFSSL_API int wc_XChacha_SetKey(ChaCha *ctx, const byte *key, word32 keySz,
95 const byte *nonce, word32 nonceSz,
96 word32 counter);
97 #endif
98
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102
103 #endif /* HAVE_CHACHA */
104 #endif /* WOLF_CRYPT_CHACHA_H */
105

22.316 chacha20_poly1305.h File Reference


#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/chacha.h>
#include <wolfssl/wolfcrypt/poly1305.h>

22.317 chacha20_poly1305.h
Go to the documentation of this file.
1 /* chacha20_poly1305.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.

NetBurner, Inc.
1482 File Documentation

6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11 /*
12
13 DESCRIPTION
14 This library contains implementation for the ChaCha20 stream cipher and
15 the Poly1305 authenticator, both as as combined-mode,
16 or Authenticated Encryption with Additional Data (AEAD) algorithm.
17
18 */
19
24 #ifndef WOLF_CRYPT_CHACHA20_POLY1305_H
25 #define WOLF_CRYPT_CHACHA20_POLY1305_H
26
27 #include <wolfssl/wolfcrypt/types.h>
28 #include <wolfssl/wolfcrypt/chacha.h>
29 #include <wolfssl/wolfcrypt/poly1305.h>
30
31 #if defined(HAVE_CHACHA) && defined(HAVE_POLY1305)
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37 #define CHACHA20_POLY1305_AEAD_KEYSIZE 32
38 #define CHACHA20_POLY1305_AEAD_IV_SIZE 12
39 #define CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE 16
40 #define CHACHA20_POLY1305_MAX 4294967295U
41 #define XCHACHA20_POLY1305_AEAD_NONCE_SIZE 24
42
43 enum {
44 CHACHA20_POLY_1305_ENC_TYPE = 8, /* cipher unique type */
45
46 /* AEAD Cipher Direction */
47 CHACHA20_POLY1305_AEAD_DECRYPT = 0,
48 CHACHA20_POLY1305_AEAD_ENCRYPT = 1,
49
50 /* AEAD State */
51 CHACHA20_POLY1305_STATE_INIT = 0,
52 CHACHA20_POLY1305_STATE_READY = 1,
53 CHACHA20_POLY1305_STATE_AAD = 2,
54 CHACHA20_POLY1305_STATE_DATA = 3,
55 };
56
57 typedef struct ChaChaPoly_Aead {
58 ChaCha chacha;
59 Poly1305 poly;
60
61 word32 aadLen;
62 word32 dataLen;
63
64 byte state;
65 byte isEncrypt:1;
66 } ChaChaPoly_Aead;
67
68
69 /*
70 * The IV for this implementation is 96 bits to give the most flexibility.
71 *
72 * Some protocols may have unique per-invocation inputs that are not
73 * 96-bit in length. For example, IPsec may specify a 64-bit nonce. In
74 * such a case, it is up to the protocol document to define how to
75 * transform the protocol nonce into a 96-bit nonce, for example by
76 * concatenating a constant value.
77 */
78
79 WOLFSSL_ABI WOLFSSL_API
80 int wc_ChaCha20Poly1305_Encrypt(
81 const byte inKey[CHACHA20_POLY1305_AEAD_KEYSIZE],
82 const byte inIV[CHACHA20_POLY1305_AEAD_IV_SIZE],
83 const byte* inAAD, word32 inAADLen,
84 const byte* inPlaintext, word32 inPlaintextLen,
85 byte* outCiphertext,
86 byte outAuthTag[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE]);
87
88 WOLFSSL_ABI WOLFSSL_API
89 int wc_ChaCha20Poly1305_Decrypt(
90 const byte inKey[CHACHA20_POLY1305_AEAD_KEYSIZE],
91 const byte inIV[CHACHA20_POLY1305_AEAD_IV_SIZE],
92 const byte* inAAD, word32 inAADLen,
93 const byte* inCiphertext, word32 inCiphertextLen,
94 const byte inAuthTag[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE],
95 byte* outPlaintext);
96

NetBurner, Inc.
22.318 coding.h File Reference 1483

97 WOLFSSL_API
98 int wc_ChaCha20Poly1305_CheckTag(
99 const byte authTag[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE],
100 const byte authTagChk[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE]);
101
102
103
104 /* Implementation of AEAD, which includes support for adding
105 data, then final calculation of authentication tag */
106 WOLFSSL_API int wc_ChaCha20Poly1305_Init(ChaChaPoly_Aead* aead,
107 const byte inKey[CHACHA20_POLY1305_AEAD_KEYSIZE],
108 const byte inIV[CHACHA20_POLY1305_AEAD_IV_SIZE],
109 int isEncrypt);
110 WOLFSSL_API int wc_ChaCha20Poly1305_UpdateAad(ChaChaPoly_Aead* aead,
111 const byte* inAAD, word32 inAADLen);
112 WOLFSSL_API int wc_ChaCha20Poly1305_UpdateData(ChaChaPoly_Aead* aead,
113 const byte* inData, byte* outData, word32 dataLen);
114 WOLFSSL_API int wc_ChaCha20Poly1305_Final(ChaChaPoly_Aead* aead,
115 byte outAuthTag[CHACHA20_POLY1305_AEAD_AUTHTAG_SIZE]);
116
117 #ifdef HAVE_XCHACHA
118
119 WOLFSSL_API int wc_XChaCha20Poly1305_Init(
120 ChaChaPoly_Aead* aead,
121 const byte *ad, word32 ad_len,
122 const byte *inKey, word32 inKeySz,
123 const byte *inIV, word32 inIVSz,
124 int isEncrypt);
125
126 WOLFSSL_API int wc_XChaCha20Poly1305_Encrypt(
127 byte *dst, size_t dst_space,
128 const byte *src, size_t src_len,
129 const byte *ad, size_t ad_len,
130 const byte *nonce, size_t nonce_len,
131 const byte *key, size_t key_len);
132
133 WOLFSSL_API int wc_XChaCha20Poly1305_Decrypt(
134 byte *dst, size_t dst_space,
135 const byte *src, size_t src_len,
136 const byte *ad, size_t ad_len,
137 const byte *nonce, size_t nonce_len,
138 const byte *key, size_t key_len);
139
140 #endif /* HAVE_XCHACHA */
141
142 #ifdef __cplusplus
143 } /* extern "C" */
144 #endif
145
146 #endif /* HAVE_CHACHA && HAVE_POLY1305 */
147 #endif /* WOLF_CRYPT_CHACHA20_POLY1305_H */

22.318 coding.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.319 coding.h
Go to the documentation of this file.
1 /* coding.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_CODING_H
17 #define WOLF_CRYPT_CODING_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24

NetBurner, Inc.
1484 File Documentation

25
26 WOLFSSL_API int Base64_Decode(const byte* in, word32 inLen, byte* out,
27 word32* outLen);
28
29 #if defined(OPENSSL_EXTRA) || defined(SESSION_CERTS) || defined(WOLFSSL_KEY_GEN) \
30 || defined(WOLFSSL_CERT_GEN) || defined(HAVE_WEBSERVER) || !defined(NO_DSA)
31 #ifndef WOLFSSL_BASE64_ENCODE
32 #define WOLFSSL_BASE64_ENCODE
33 #endif
34 #endif
35
36
37 #ifdef WOLFSSL_BASE64_ENCODE
38 enum Escaped {
39 WC_STD_ENC = 0, /* normal \n line ending encoding */
40 WC_ESC_NL_ENC, /* use escape sequence encoding */
41 WC_NO_NL_ENC /* no encoding at all */
42 }; /* Encoding types */
43
44 /* encode isn’t */
45 WOLFSSL_API
46 int Base64_Encode(const byte* in, word32 inLen, byte* out,
47 word32* outLen);
48 WOLFSSL_API
49 int Base64_EncodeEsc(const byte* in, word32 inLen, byte* out,
50 word32* outLen);
51 WOLFSSL_API
52 int Base64_Encode_NoNl(const byte* in, word32 inLen, byte* out,
53 word32* outLen);
54 #endif
55
56 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
57 defined(HAVE_WEBSERVER) || defined(HAVE_FIPS) || \
58 defined(HAVE_ECC_CDH) || defined(HAVE_SELFTEST) || \
59 defined(WOLFSSL_ENCRYPTED_KEYS)
60 #ifndef WOLFSSL_BASE16
61 #define WOLFSSL_BASE16
62 #endif
63 #endif
64
65 #ifdef WOLFSSL_BASE16
66 WOLFSSL_API
67 int Base16_Decode(const byte* in, word32 inLen, byte* out, word32* outLen);
68 WOLFSSL_API
69 int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen);
70 #endif
71
72 WOLFSSL_LOCAL int Base64_SkipNewline(const byte* in, word32* inLen,
73 word32* outJ);
74
75 #ifdef __cplusplus
76 } /* extern "C" */
77 #endif
78
79 #endif /* WOLF_CRYPT_CODING_H */
80

22.320 compress.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.321 compress.h
Go to the documentation of this file.
1 /* compress.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_COMPRESS_H
18 #define WOLF_CRYPT_COMPRESS_H
19
20 #include <wolfssl/wolfcrypt/types.h>

NetBurner, Inc.
22.322 cpuid.h 1485

21
22 #ifdef HAVE_LIBZ
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28
29 #define COMPRESS_FIXED 1
30
31 #define LIBZ_WINBITS_GZIP 16
32
33
34 WOLFSSL_API int wc_Compress(byte*, word32, const byte*, word32, word32);
35 WOLFSSL_API int wc_Compress_ex(byte* out, word32 outSz, const byte* in,
36 word32 inSz, word32 flags, word32 windowBits);
37 WOLFSSL_API int wc_DeCompress(byte*, word32, const byte*, word32);
38 WOLFSSL_API int wc_DeCompress_ex(byte* out, word32 outSz, const byte* in,
39 word32 inSz, int windowBits);
40 WOLFSSL_API int wc_DeCompressDynamic(byte** out, int max, int memoryType,
41 const byte* in, word32 inSz, int windowBits, void* heap);
42
43 #ifdef __cplusplus
44 } /* extern "C" */
45 #endif
46
47
48 #endif /* HAVE_LIBZ */
49 #endif /* WOLF_CRYPT_COMPRESS_H */
50

22.322 cpuid.h
1 /* cpuid.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 #ifndef WOLF_CRYPT_CPUID_H
15 #define WOLF_CRYPT_CPUID_H
16
17
18 #include <wolfssl/wolfcrypt/types.h>
19
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #if (defined(WOLFSSL_X86_64_BUILD) || defined(USE_INTEL_SPEEDUP) || \
26 defined(WOLFSSL_AESNI) || defined(WOLFSSL_SP_X86_64_ASM)) && \
27 !defined(WOLFSSL_NO_ASM)
28 #define HAVE_CPUID
29 #define HAVE_CPUID_INTEL
30 #endif
31
32 #ifdef HAVE_CPUID_INTEL
33
34 #define CPUID_AVX1 0x0001
35 #define CPUID_AVX2 0x0002
36 #define CPUID_RDRAND 0x0004
37 #define CPUID_RDSEED 0x0008
38 #define CPUID_BMI2 0x0010 /* MULX, RORX */
39 #define CPUID_AESNI 0x0020
40 #define CPUID_ADX 0x0040 /* ADCX, ADOX */
41 #define CPUID_MOVBE 0x0080 /* Move and byte swap */
42
43 #define IS_INTEL_AVX1(f) ((f) & CPUID_AVX1)
44 #define IS_INTEL_AVX2(f) ((f) & CPUID_AVX2)
45 #define IS_INTEL_RDRAND(f) ((f) & CPUID_RDRAND)
46 #define IS_INTEL_RDSEED(f) ((f) & CPUID_RDSEED)
47 #define IS_INTEL_BMI2(f) ((f) & CPUID_BMI2)
48 #define IS_INTEL_AESNI(f) ((f) & CPUID_AESNI)
49 #define IS_INTEL_ADX(f) ((f) & CPUID_ADX)
50 #define IS_INTEL_MOVBE(f) ((f) & CPUID_MOVBE)
51
52 #endif

NetBurner, Inc.
1486 File Documentation

53
54 #ifdef HAVE_CPUID
55 void cpuid_set_flags(void);
56 word32 cpuid_get_flags(void);
57
58 /* Public APIs to modify flags. */
59 WOLFSSL_API void cpuid_select_flags(word32 flags);
60 WOLFSSL_API void cpuid_set_flag(word32 flag);
61 WOLFSSL_API void cpuid_clear_flag(word32 flag);
62
63 #endif
64
65 #ifdef __cplusplus
66 } /* extern "C" */
67 #endif
68
69
70 #endif /* WOLF_CRYPT_CPUID_H */

22.323 cryptocb.h
1 /* cryptocb.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef _WOLF_CRYPTO_CB_H_
13 #define _WOLF_CRYPTO_CB_H_
14
15 #include <wolfssl/wolfcrypt/types.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 /* Defines the Crypto Callback interface version, for compatibility */
22 /* Increment this when Crypto Callback interface changes are made */
23 #define CRYPTO_CB_VER 2
24
25
26 #ifdef WOLF_CRYPTO_CB
27
28 #ifndef NO_RSA
29 #include <wolfssl/wolfcrypt/rsa.h>
30 #endif
31 #ifdef HAVE_ECC
32 #include <wolfssl/wolfcrypt/ecc.h>
33 #endif
34 #ifndef NO_AES
35 #include <wolfssl/wolfcrypt/aes.h>
36 #endif
37 #ifndef NO_SHA
38 #include <wolfssl/wolfcrypt/sha.h>
39 #endif
40 #ifndef NO_SHA256
41 #include <wolfssl/wolfcrypt/sha256.h>
42 #endif
43 #ifndef NO_HMAC
44 #include <wolfssl/wolfcrypt/hmac.h>
45 #endif
46 #ifndef WC_NO_RNG
47 #include <wolfssl/wolfcrypt/random.h>
48 #endif
49 #ifndef NO_DES3
50 #include <wolfssl/wolfcrypt/des3.h>
51 #endif
52 #ifdef WOLFSSL_CMAC
53 #include <wolfssl/wolfcrypt/cmac.h>
54 #endif
55 #ifdef HAVE_ED25519
56 #include <wolfssl/wolfcrypt/ed25519.h>
57 #endif
58 #ifdef HAVE_CURVE25519
59 #include <wolfssl/wolfcrypt/curve25519.h>
60 #endif
61 #if defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
62 #include <wolfssl/wolfcrypt/sha512.h>
63 #endif
64

NetBurner, Inc.
22.323 cryptocb.h 1487

65 /* Crypto Information Structure for callbacks */


66 typedef struct wc_CryptoInfo {
67 int algo_type; /* enum wc_AlgoType */
68 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
69 union {
70 #endif
71 #if !defined(NO_RSA) || defined(HAVE_ECC)
72 struct {
73 int type; /* enum wc_PkType */
74 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
75 union {
76 #endif
77 #ifndef NO_RSA
78 struct {
79 const byte* in;
80 word32 inLen;
81 byte* out;
82 word32* outLen;
83 int type;
84 RsaKey* key;
85 WC_RNG* rng;
86 } rsa;
87 #ifdef WOLFSSL_KEY_GEN
88 struct {
89 RsaKey* key;
90 int size;
91 long e;
92 WC_RNG* rng;
93 } rsakg;
94 #endif
95 struct {
96 RsaKey* key;
97 const byte* pubKey;
98 word32 pubKeySz;
99 } rsa_check;
100 #endif
101 #ifdef HAVE_ECC
102 struct {
103 WC_RNG* rng;
104 int size;
105 ecc_key* key;
106 int curveId;
107 } eckg;
108 struct {
109 ecc_key* private_key;
110 ecc_key* public_key;
111 byte* out;
112 word32* outlen;
113 } ecdh;
114 struct {
115 const byte* in;
116 word32 inlen;
117 byte* out;
118 word32* outlen;
119 WC_RNG* rng;
120 ecc_key* key;
121 } eccsign;
122 struct {
123 const byte* sig;
124 word32 siglen;
125 const byte* hash;
126 word32 hashlen;
127 int* res;
128 ecc_key* key;
129 } eccverify;
130 struct {
131 ecc_key* key;
132 const byte* pubKey;
133 word32 pubKeySz;
134 } ecc_check;
135 #endif
136 #ifdef HAVE_CURVE25519
137 struct {
138 WC_RNG* rng;
139 int size;
140 curve25519_key* key;
141 int curveId;
142 } curve25519kg;
143 struct {
144 curve25519_key* private_key;
145 curve25519_key* public_key;
146 byte* out;
147 word32* outlen;
148 int endian;
149 } curve25519;
150 #endif
151 #ifdef HAVE_ED25519

NetBurner, Inc.
1488 File Documentation

152 struct {
153 WC_RNG* rng;
154 int size;
155 ed25519_key* key;
156 int curveId;
157 } ed25519kg;
158 struct {
159 const byte* in;
160 word32 inLen;
161 byte* out;
162 word32* outLen;
163 ed25519_key* key;
164 byte type;
165 const byte* context;
166 byte contextLen;
167 } ed25519sign;
168 struct {
169 const byte* sig;
170 word32 sigLen;
171 const byte* msg;
172 word32 msgLen;
173 int* res;
174 ed25519_key* key;
175 byte type;
176 const byte* context;
177 byte contextLen;
178 } ed25519verify;
179 #endif
180 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
181 };
182 #endif
183 } pk;
184 #endif /* !NO_RSA || HAVE_ECC */
185 #if !defined(NO_AES) || !defined(NO_DES3)
186 struct {
187 int type; /* enum wc_CipherType */
188 int enc;
189 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
190 union {
191 #endif
192 #ifdef HAVE_AESGCM
193 struct {
194 Aes* aes;
195 byte* out;
196 const byte* in;
197 word32 sz;
198 const byte* iv;
199 word32 ivSz;
200 byte* authTag;
201 word32 authTagSz;
202 const byte* authIn;
203 word32 authInSz;
204 } aesgcm_enc;
205 struct {
206 Aes* aes;
207 byte* out;
208 const byte* in;
209 word32 sz;
210 const byte* iv;
211 word32 ivSz;
212 const byte* authTag;
213 word32 authTagSz;
214 const byte* authIn;
215 word32 authInSz;
216 } aesgcm_dec;
217 #endif /* HAVE_AESGCM */
218 #ifdef HAVE_AESCCM
219 struct {
220 Aes* aes;
221 byte* out;
222 const byte* in;
223 word32 sz;
224 const byte* nonce;
225 word32 nonceSz;
226 byte* authTag;
227 word32 authTagSz;
228 const byte* authIn;
229 word32 authInSz;
230 } aesccm_enc;
231 struct {
232 Aes* aes;
233 byte* out;
234 const byte* in;
235 word32 sz;
236 const byte* nonce;
237 word32 nonceSz;
238 const byte* authTag;

NetBurner, Inc.
22.323 cryptocb.h 1489

239 word32 authTagSz;


240 const byte* authIn;
241 word32 authInSz;
242 } aesccm_dec;
243 #endif /* HAVE_AESCCM */
244 #if defined(HAVE_AES_CBC)
245 struct {
246 Aes* aes;
247 byte* out;
248 const byte* in;
249 word32 sz;
250 } aescbc;
251 #endif /* HAVE_AES_CBC */
252 #if defined(WOLFSSL_AES_COUNTER)
253 struct {
254 Aes* aes;
255 byte* out;
256 const byte* in;
257 word32 sz;
258 } aesctr;
259 #endif /* WOLFSSL_AES_COUNTER */
260 #if defined(HAVE_AES_ECB)
261 struct {
262 Aes* aes;
263 byte* out;
264 const byte* in;
265 word32 sz;
266 } aesecb;
267 #endif /* HAVE_AES_ECB */
268 #ifndef NO_DES3
269 struct {
270 Des3* des;
271 byte* out;
272 const byte* in;
273 word32 sz;
274 } des3;
275 #endif
276 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
277 };
278 #endif
279 } cipher;
280 #endif /* !NO_AES || !NO_DES3 */
281 #if !defined(NO_SHA) || !defined(NO_SHA256) || \
282 defined(WOLFSSL_SHA512) || defined(WOLFSSL_SHA384)
283 struct {
284 int type; /* enum wc_HashType */
285 const byte* in;
286 word32 inSz;
287 byte* digest;
288 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
289 union {
290 #endif
291 #ifndef NO_SHA
292 wc_Sha* sha1;
293 #endif
294 #ifdef WOLFSSL_SHA224
295 wc_Sha224* sha224;
296 #endif
297 #ifndef NO_SHA256
298 wc_Sha256* sha256;
299 #endif
300 #ifdef WOLFSSL_SHA384
301 wc_Sha384* sha384;
302 #endif
303 #ifdef WOLFSSL_SHA512
304 wc_Sha512* sha512;
305 #endif
306 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
307 };
308 #endif
309 } hash;
310 #endif /* !NO_SHA || !NO_SHA256 */
311 #ifndef NO_HMAC
312 struct {
313 int macType; /* enum wc_HashType */
314 const byte* in;
315 word32 inSz;
316 byte* digest;
317 Hmac* hmac;
318 } hmac;
319 #endif
320 #ifndef WC_NO_RNG
321 struct {
322 WC_RNG* rng;
323 byte* out;
324 word32 sz;
325 } rng;

NetBurner, Inc.
1490 File Documentation

326 struct {
327 OS_Seed* os;
328 byte* seed;
329 word32 sz;
330 } seed;
331 #endif
332 #ifdef WOLFSSL_CMAC
333 struct {
334 Cmac* cmac;
335 void* ctx;
336 const byte* key;
337 const byte* in;
338 byte* out;
339 word32* outSz;
340 word32 keySz;
341 word32 inSz;
342 int type;
343 } cmac;
344 #endif
345 #if HAVE_ANONYMOUS_INLINE_AGGREGATES
346 };
347 #endif
348 } wc_CryptoInfo;
349
350
351 typedef int (*CryptoDevCallbackFunc)(int devId, wc_CryptoInfo* info, void* ctx);
352
353 WOLFSSL_LOCAL void wc_CryptoCb_Init(void);
354 WOLFSSL_LOCAL int wc_CryptoCb_GetDevIdAtIndex(int startIdx);
355 WOLFSSL_API int wc_CryptoCb_RegisterDevice(int devId, CryptoDevCallbackFunc cb, void* ctx);
356 WOLFSSL_API void wc_CryptoCb_UnRegisterDevice(int devId);
357 WOLFSSL_API int wc_CryptoCb_DefaultDevID(void);
358
359 #ifdef DEBUG_CRYPTOCB
360 WOLFSSL_API void wc_CryptoCb_InfoString(wc_CryptoInfo* info);
361 #endif
362
363 /* old function names */
364 #define wc_CryptoDev_RegisterDevice wc_CryptoCb_RegisterDevice
365 #define wc_CryptoDev_UnRegisterDevice wc_CryptoCb_UnRegisterDevice
366
367
368 #ifndef NO_RSA
369 WOLFSSL_LOCAL int wc_CryptoCb_Rsa(const byte* in, word32 inLen, byte* out,
370 word32* outLen, int type, RsaKey* key, WC_RNG* rng);
371
372 #ifdef WOLFSSL_KEY_GEN
373 WOLFSSL_LOCAL int wc_CryptoCb_MakeRsaKey(RsaKey* key, int size, long e,
374 WC_RNG* rng);
375 #endif /* WOLFSSL_KEY_GEN */
376
377 WOLFSSL_LOCAL int wc_CryptoCb_RsaCheckPrivKey(RsaKey* key, const byte* pubKey,
378 word32 pubKeySz);
379 #endif /* !NO_RSA */
380
381 #ifdef HAVE_ECC
382 WOLFSSL_LOCAL int wc_CryptoCb_MakeEccKey(WC_RNG* rng, int keySize,
383 ecc_key* key, int curveId);
384
385 WOLFSSL_LOCAL int wc_CryptoCb_Ecdh(ecc_key* private_key, ecc_key* public_key,
386 byte* out, word32* outlen);
387
388 WOLFSSL_LOCAL int wc_CryptoCb_EccSign(const byte* in, word32 inlen, byte* out,
389 word32 *outlen, WC_RNG* rng, ecc_key* key);
390
391 WOLFSSL_LOCAL int wc_CryptoCb_EccVerify(const byte* sig, word32 siglen,
392 const byte* hash, word32 hashlen, int* res, ecc_key* key);
393
394 WOLFSSL_LOCAL int wc_CryptoCb_EccCheckPrivKey(ecc_key* key, const byte* pubKey,
395 word32 pubKeySz);
396 #endif /* HAVE_ECC */
397
398 #ifdef HAVE_CURVE25519
399 WOLFSSL_LOCAL int wc_CryptoCb_Curve25519Gen(WC_RNG* rng, int keySize,
400 curve25519_key* key);
401
402 WOLFSSL_LOCAL int wc_CryptoCb_Curve25519(curve25519_key* private_key,
403 curve25519_key* public_key, byte* out, word32* outlen, int endian);
404 #endif /* HAVE_CURVE25519 */
405
406 #ifdef HAVE_ED25519
407 WOLFSSL_LOCAL int wc_CryptoCb_Ed25519Gen(WC_RNG* rng, int keySize,
408 ed25519_key* key);
409 WOLFSSL_LOCAL int wc_CryptoCb_Ed25519Sign(const byte* in, word32 inLen,
410 byte* out, word32 *outLen, ed25519_key* key, byte type, const byte* context,
411 byte contextLen);
412 WOLFSSL_LOCAL int wc_CryptoCb_Ed25519Verify(const byte* sig, word32 sigLen,

NetBurner, Inc.
22.323 cryptocb.h 1491

413 const byte* msg, word32 msgLen, int* res, ed25519_key* key, byte type,
414 const byte* context, byte contextLen);
415 #endif /* HAVE_ED25519 */
416
417 #ifndef NO_AES
418 #ifdef HAVE_AESGCM
419 WOLFSSL_LOCAL int wc_CryptoCb_AesGcmEncrypt(Aes* aes, byte* out,
420 const byte* in, word32 sz, const byte* iv, word32 ivSz,
421 byte* authTag, word32 authTagSz, const byte* authIn, word32 authInSz);
422
423 WOLFSSL_LOCAL int wc_CryptoCb_AesGcmDecrypt(Aes* aes, byte* out,
424 const byte* in, word32 sz, const byte* iv, word32 ivSz,
425 const byte* authTag, word32 authTagSz,
426 const byte* authIn, word32 authInSz);
427 #endif /* HAVE_AESGCM */
428 #ifdef HAVE_AESCCM
429 WOLFSSL_LOCAL int wc_CryptoCb_AesCcmEncrypt(Aes* aes, byte* out,
430 const byte* in, word32 sz,
431 const byte* nonce, word32 nonceSz,
432 byte* authTag, word32 authTagSz,
433 const byte* authIn, word32 authInSz);
434
435 WOLFSSL_LOCAL int wc_CryptoCb_AesCcmDecrypt(Aes* aes, byte* out,
436 const byte* in, word32 sz,
437 const byte* nonce, word32 nonceSz,
438 const byte* authTag, word32 authTagSz,
439 const byte* authIn, word32 authInSz);
440 #endif /* HAVE_AESCCM */
441 #ifdef HAVE_AES_CBC
442 WOLFSSL_LOCAL int wc_CryptoCb_AesCbcEncrypt(Aes* aes, byte* out,
443 const byte* in, word32 sz);
444 WOLFSSL_LOCAL int wc_CryptoCb_AesCbcDecrypt(Aes* aes, byte* out,
445 const byte* in, word32 sz);
446 #endif /* HAVE_AES_CBC */
447 #ifdef WOLFSSL_AES_COUNTER
448 WOLFSSL_LOCAL int wc_CryptoCb_AesCtrEncrypt(Aes* aes, byte* out,
449 const byte* in, word32 sz);
450 #endif /* WOLFSSL_AES_COUNTER */
451 #ifdef HAVE_AES_ECB
452 WOLFSSL_LOCAL int wc_CryptoCb_AesEcbEncrypt(Aes* aes, byte* out,
453 const byte* in, word32 sz);
454 WOLFSSL_LOCAL int wc_CryptoCb_AesEcbDecrypt(Aes* aes, byte* out,
455 const byte* in, word32 sz);
456 #endif /* HAVE_AES_ECB */
457 #endif /* !NO_AES */
458
459 #ifndef NO_DES3
460 WOLFSSL_LOCAL int wc_CryptoCb_Des3Encrypt(Des3* des3, byte* out,
461 const byte* in, word32 sz);
462 WOLFSSL_LOCAL int wc_CryptoCb_Des3Decrypt(Des3* des3, byte* out,
463 const byte* in, word32 sz);
464 #endif /* !NO_DES3 */
465
466 #ifndef NO_SHA
467 WOLFSSL_LOCAL int wc_CryptoCb_ShaHash(wc_Sha* sha, const byte* in,
468 word32 inSz, byte* digest);
469 #endif /* !NO_SHA */
470
471 #ifndef NO_SHA256
472 WOLFSSL_LOCAL int wc_CryptoCb_Sha256Hash(wc_Sha256* sha256, const byte* in,
473 word32 inSz, byte* digest);
474 #endif /* !NO_SHA256 */
475 #ifdef WOLFSSL_SHA384
476 WOLFSSL_LOCAL int wc_CryptoCb_Sha384Hash(wc_Sha384* sha384, const byte* in,
477 word32 inSz, byte* digest);
478 #endif
479 #ifdef WOLFSSL_SHA512
480 WOLFSSL_LOCAL int wc_CryptoCb_Sha512Hash(wc_Sha512* sha512, const byte* in,
481 word32 inSz, byte* digest);
482 #endif
483
484 #ifndef NO_HMAC
485 WOLFSSL_LOCAL int wc_CryptoCb_Hmac(Hmac* hmac, int macType, const byte* in,
486 word32 inSz, byte* digest);
487 #endif /* !NO_HMAC */
488
489 #ifndef WC_NO_RNG
490 WOLFSSL_LOCAL int wc_CryptoCb_RandomBlock(WC_RNG* rng, byte* out, word32 sz);
491 WOLFSSL_LOCAL int wc_CryptoCb_RandomSeed(OS_Seed* os, byte* seed, word32 sz);
492 #endif
493
494 #ifdef WOLFSSL_CMAC
495 WOLFSSL_LOCAL int wc_CryptoCb_Cmac(Cmac* cmac, const byte* key, word32 keySz,
496 const byte* in, word32 inSz, byte* out, word32* outSz, int type,
497 void* ctx);
498 #endif
499

NetBurner, Inc.
1492 File Documentation

500 #endif /* WOLF_CRYPTO_CB */


501
502 #ifdef __cplusplus
503 } /* extern "C" */
504 #endif
505
506 #endif /* _WOLF_CRYPTO_CB_H_ */

22.324 curve25519.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.325 curve25519.h
Go to the documentation of this file.
1 /* curve25519.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_CURVE25519_H
18 #define WOLF_CRYPT_CURVE25519_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifdef HAVE_CURVE25519
23
24 #include <wolfssl/wolfcrypt/fe_operations.h>
25 #include <wolfssl/wolfcrypt/random.h>
26
27 #ifdef WOLFSSL_ASYNC_CRYPT
28 #include <wolfssl/wolfcrypt/async.h>
29 #endif
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #define CURVE25519_KEYSIZE 32
36 #define CURVE25519_PUB_KEY_SIZE 32
37
38 #ifdef WOLFSSL_NAMES_STATIC
39 typedef char curve25519_str[12];
40 #else
41 typedef const char* curve25519_str;
42 #endif
43
44 /* curve25519 set type */
45 typedef struct {
46 int size; /* The size of the curve in octets */
47 curve25519_str name; /* name of this curve */
48 } curve25519_set_type;
49
50
51 /* ECC point, the internal structure is Little endian
52 * the mathematical functions used the endianness */
53 typedef struct ECPoint {
54 byte point[CURVE25519_KEYSIZE];
55 #ifdef FREESCALE_LTC_ECC
56 byte pointY[CURVE25519_KEYSIZE];
57 #endif
58 byte pointSz;
59 } ECPoint;
60
61 #ifndef WC_CURVE25519KEY_TYPE_DEFINED
62 typedef struct curve25519_key curve25519_key;
63 #define WC_CURVE25519KEY_TYPE_DEFINED
64 #endif
65
66 /* A CURVE25519 Key */
67 struct curve25519_key {
68 int idx; /* Index into the ecc_sets[] for the parameters of
69 this curve if -1, this key is using user supplied

NetBurner, Inc.
22.325 curve25519.h 1493

70 curve in dp */
71 const curve25519_set_type* dp; /* domain parameters, either points to
72 curves (idx >= 0) or user supplied */
73 ECPoint p; /* public point for key */
74 byte k[CURVE25519_KEYSIZE]; /* private scaler for key */
75
76 #ifdef WOLFSSL_ASYNC_CRYPT
77 WC_ASYNC_DEV asyncDev;
78 #endif
79 #if defined(WOLF_CRYPTO_CB)
80 int devId;
81 #endif
82
83 #ifdef WOLFSSL_SE050
84 int keyId;
85 #endif
86
87 /* bit fields */
88 byte pubSet:1;
89 byte privSet:1;
90 };
91
92 enum {
93 EC25519_LITTLE_ENDIAN=0,
94 EC25519_BIG_ENDIAN=1
95 };
96
97 WOLFSSL_API
98 int wc_curve25519_make_pub(int public_size, byte* pub, int private_size,
99 const byte* priv);
100
101 WOLFSSL_API
102 int wc_curve25519_generic(int public_size, byte* pub,
103 int private_size, const byte* priv,
104 int basepoint_size, const byte* basepoint);
105
106 WOLFSSL_API
107 int wc_curve25519_make_priv(WC_RNG* rng, int keysize, byte* priv);
108
109 WOLFSSL_API
110 int wc_curve25519_make_key(WC_RNG* rng, int keysize, curve25519_key* key);
111
112 WOLFSSL_API
113 int wc_curve25519_shared_secret(curve25519_key* private_key,
114 curve25519_key* public_key,
115 byte* out, word32* outlen);
116
117 WOLFSSL_API
118 int wc_curve25519_shared_secret_ex(curve25519_key* private_key,
119 curve25519_key* public_key,
120 byte* out, word32* outlen, int endian);
121
122 WOLFSSL_API
123 int wc_curve25519_init(curve25519_key* key);
124 WOLFSSL_API
125 int wc_curve25519_init_ex(curve25519_key* key, void* heap, int devId);
126
127 WOLFSSL_API
128 void wc_curve25519_free(curve25519_key* key);
129
130
131 /* raw key helpers */
132 WOLFSSL_API
133 int wc_curve25519_import_private(const byte* priv, word32 privSz,
134 curve25519_key* key);
135 WOLFSSL_API
136 int wc_curve25519_import_private_ex(const byte* priv, word32 privSz,
137 curve25519_key* key, int endian);
138
139 WOLFSSL_API
140 int wc_curve25519_import_private_raw(const byte* priv, word32 privSz,
141 const byte* pub, word32 pubSz, curve25519_key* key);
142 WOLFSSL_API
143 int wc_curve25519_import_private_raw_ex(const byte* priv, word32 privSz,
144 const byte* pub, word32 pubSz,
145 curve25519_key* key, int endian);
146 WOLFSSL_API
147 int wc_curve25519_export_private_raw(curve25519_key* key, byte* out,
148 word32* outLen);
149 WOLFSSL_API
150 int wc_curve25519_export_private_raw_ex(curve25519_key* key, byte* out,
151 word32* outLen, int endian);
152
153 WOLFSSL_API
154 int wc_curve25519_import_public(const byte* in, word32 inLen,
155 curve25519_key* key);
156 WOLFSSL_API

NetBurner, Inc.
1494 File Documentation

157 int wc_curve25519_import_public_ex(const byte* in, word32 inLen,


158 curve25519_key* key, int endian);
159 WOLFSSL_API
160 int wc_curve25519_check_public(const byte* pub, word32 pubSz, int endian);
161
162 WOLFSSL_API
163 int wc_curve25519_export_public(curve25519_key* key, byte* out, word32* outLen);
164 WOLFSSL_API
165 int wc_curve25519_export_public_ex(curve25519_key* key, byte* out,
166 word32* outLen, int endian);
167
168 WOLFSSL_API
169 int wc_curve25519_export_key_raw(curve25519_key* key,
170 byte* priv, word32 *privSz,
171 byte* pub, word32 *pubSz);
172 WOLFSSL_API
173 int wc_curve25519_export_key_raw_ex(curve25519_key* key,
174 byte* priv, word32 *privSz,
175 byte* pub, word32 *pubSz,
176 int endian);
177 /* size helper */
178 WOLFSSL_API
179 int wc_curve25519_size(curve25519_key* key);
180
181 #ifdef __cplusplus
182 } /* extern "C" */
183 #endif
184
185 #endif /* HAVE_CURVE25519 */
186 #endif /* WOLF_CRYPT_CURVE25519_H */

22.326 curve448.h
1 /* curve448.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 /* Implemented to: RFC 7748 */
13
14
15 #ifndef WOLF_CRYPT_CURVE448_H
16 #define WOLF_CRYPT_CURVE448_H
17
18 #include <wolfssl/wolfcrypt/types.h>
19
20 #ifdef HAVE_CURVE448
21
22 #include <wolfssl/wolfcrypt/fe_448.h>
23 #include <wolfssl/wolfcrypt/random.h>
24
25 #ifdef WOLFSSL_ASYNC_CRYPT
26 #include <wolfssl/wolfcrypt/async.h>
27 #endif
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #define CURVE448_KEY_SIZE 56
34 #define CURVE448_PUB_KEY_SIZE 56
35
36 #ifndef WC_CURVE448KEY_TYPE_DEFINED
37 typedef struct curve448_key curve448_key;
38 #define WC_CURVE448KEY_TYPE_DEFINED
39 #endif
40
41 /* A CURVE448 Key */
42 struct curve448_key {
43 byte p[CURVE448_PUB_KEY_SIZE]; /* public key */
44 byte k[CURVE448_KEY_SIZE]; /* private key */
45
46 #ifdef WOLFSSL_ASYNC_CRYPT
47 WC_ASYNC_DEV asyncDev;
48 #endif
49
50 /* bit fields */
51 byte pubSet:1;
52 byte privSet:1;

NetBurner, Inc.
22.326 curve448.h 1495

53 };
54
55 enum {
56 EC448_LITTLE_ENDIAN = 0,
57 EC448_BIG_ENDIAN = 1
58 };
59
60 WOLFSSL_API
61 int wc_curve448_make_key(WC_RNG* rng, int keysize, curve448_key* key);
62
63 WOLFSSL_API
64 int wc_curve448_make_pub(int public_size, byte* pub, int private_size,
65 const byte* priv);
66
67 WOLFSSL_API
68 int wc_curve448_shared_secret(curve448_key* private_key,
69 curve448_key* public_key,
70 byte* out, word32* outlen);
71
72 WOLFSSL_API
73 int wc_curve448_shared_secret_ex(curve448_key* private_key,
74 curve448_key* public_key,
75 byte* out, word32* outlen, int endian);
76
77 WOLFSSL_API
78 int wc_curve448_init(curve448_key* key);
79
80 WOLFSSL_API
81 void wc_curve448_free(curve448_key* key);
82
83
84 /* raw key helpers */
85 WOLFSSL_API
86 int wc_curve448_import_private(const byte* priv, word32 privSz,
87 curve448_key* key);
88 WOLFSSL_API
89 int wc_curve448_import_private_ex(const byte* priv, word32 privSz,
90 curve448_key* key, int endian);
91
92 WOLFSSL_API
93 int wc_curve448_import_private_raw(const byte* priv, word32 privSz,
94 const byte* pub, word32 pubSz,
95 curve448_key* key);
96 WOLFSSL_API
97 int wc_curve448_import_private_raw_ex(const byte* priv, word32 privSz,
98 const byte* pub, word32 pubSz,
99 curve448_key* key, int endian);
100 WOLFSSL_API
101 int wc_curve448_export_private_raw(curve448_key* key, byte* out,
102 word32* outLen);
103 WOLFSSL_API
104 int wc_curve448_export_private_raw_ex(curve448_key* key, byte* out,
105 word32* outLen, int endian);
106
107 WOLFSSL_API
108 int wc_curve448_import_public(const byte* in, word32 inLen,
109 curve448_key* key);
110 WOLFSSL_API
111 int wc_curve448_import_public_ex(const byte* in, word32 inLen,
112 curve448_key* key, int endian);
113 WOLFSSL_API
114 int wc_curve448_check_public(const byte* pub, word32 pubSz, int endian);
115
116 WOLFSSL_API
117 int wc_curve448_export_public(curve448_key* key, byte* out, word32* outLen);
118 WOLFSSL_API
119 int wc_curve448_export_public_ex(curve448_key* key, byte* out,
120 word32* outLen, int endian);
121
122 WOLFSSL_API
123 int wc_curve448_export_key_raw(curve448_key* key,
124 byte* priv, word32 *privSz,
125 byte* pub, word32 *pubSz);
126 WOLFSSL_API
127 int wc_curve448_export_key_raw_ex(curve448_key* key,
128 byte* priv, word32 *privSz,
129 byte* pub, word32 *pubSz,
130 int endian);
131 /* size helper */
132 WOLFSSL_API
133 int wc_curve448_size(curve448_key* key);
134
135 #ifdef __cplusplus
136 } /* extern "C" */
137 #endif
138
139 #endif /* HAVE_CURVE448 */

NetBurner, Inc.
1496 File Documentation

140 #endif /* WOLF_CRYPT_CURVE448_H */


141

22.327 des3.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.328 des3.h
Go to the documentation of this file.
1 /* des3.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_DES3_H
17 #define WOLF_CRYPT_DES3_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifndef NO_DES3
22
23 #if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && \
24 (HAVE_FIPS_VERSION == 2 || HAVE_FIPS_VERSION == 3)
25 #include <wolfssl/wolfcrypt/fips.h>
26 #endif /* HAVE_FIPS_VERSION >= 2 */
27
28 #if defined(HAVE_FIPS) && \
29 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
30 /* included for fips @wc_fips */
31 #include <cyassl/ctaocrypt/des3.h>
32 #endif
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /* these are required for FIPS and non-FIPS */
39 enum {
40 DES_KEY_SIZE = 8, /* des */
41 DES3_KEY_SIZE = 24, /* 3 des ede */
42 DES_IV_SIZE = 8, /* should be the same as DES_BLOCK_SIZE */
43 };
44
45
46 /* avoid redefinition of structs */
47 #if !defined(HAVE_FIPS) || (defined(HAVE_FIPS_VERSION) && \
48 HAVE_FIPS_VERSION >= 2)
49
50 #ifdef WOLFSSL_ASYNC_CRYPT
51 #include <wolfssl/wolfcrypt/async.h>
52 #endif
53
54 enum {
55 DES_ENC_TYPE = WC_CIPHER_DES, /* cipher unique type */
56 DES3_ENC_TYPE = WC_CIPHER_DES3, /* cipher unique type */
57
58 DES_BLOCK_SIZE = 8,
59 DES_KS_SIZE = 32, /* internal DES key buffer size */
60
61 DES_ENCRYPTION = 0,
62 DES_DECRYPTION = 1
63 };
64
65 #define DES_IVLEN 8
66 #define DES_KEYLEN 8
67 #define DES3_IVLEN 8
68 #define DES3_KEYLEN 24
69
70
71 #if defined(STM32_CRYPTO)
72
73 #include <wolfssl/wolfcrypt/port/st/stm32.h>

NetBurner, Inc.
22.329 dilithium.h File Reference 1497

74
75 enum {
76 DES_CBC = 0,
77 DES_ECB = 1
78 };
79 #endif
80
81
82 /* DES encryption and decryption */
83 typedef struct Des {
84 word32 reg[DES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
85 word32 tmp[DES_BLOCK_SIZE / sizeof(word32)]; /* same */
86 word32 key[DES_KS_SIZE];
87 } Des;
88
89
90 /* DES3 encryption and decryption */
91 struct Des3 {
92 word32 key[3][DES_KS_SIZE];
93 word32 reg[DES_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
94 word32 tmp[DES_BLOCK_SIZE / sizeof(word32)]; /* same */
95 #ifdef WOLFSSL_ASYNC_CRYPT
96 WC_ASYNC_DEV asyncDev;
97 #endif
98 #if defined(WOLF_CRYPTO_CB) || \
99 (defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_3DES))
100 word32 devKey[DES3_KEYLEN/sizeof(word32)]; /* raw key */
101 #endif
102 #ifdef WOLF_CRYPTO_CB
103 int devId;
104 void* devCtx;
105 #endif
106 void* heap;
107 };
108
109 #ifndef WC_DES3_TYPE_DEFINED
110 typedef struct Des3 Des3;
111 #define WC_DES3_TYPE_DEFINED
112 #endif
113 #endif /* HAVE_FIPS && HAVE_FIPS_VERSION >= 2 */
114
115
116 WOLFSSL_API int wc_Des_SetKey(Des* des, const byte* key,
117 const byte* iv, int dir);
118 WOLFSSL_API void wc_Des_SetIV(Des* des, const byte* iv);
119 WOLFSSL_API int wc_Des_CbcEncrypt(Des* des, byte* out,
120 const byte* in, word32 sz);
121 WOLFSSL_API int wc_Des_CbcDecrypt(Des* des, byte* out,
122 const byte* in, word32 sz);
123 WOLFSSL_API int wc_Des_EcbEncrypt(Des* des, byte* out,
124 const byte* in, word32 sz);
125 WOLFSSL_API int wc_Des3_EcbEncrypt(Des3* des, byte* out,
126 const byte* in, word32 sz);
127
128 /* ECB decrypt same process as encrypt but with decrypt key */
129 #define wc_Des_EcbDecrypt wc_Des_EcbEncrypt
130 #define wc_Des3_EcbDecrypt wc_Des3_EcbEncrypt
131
132 WOLFSSL_API int wc_Des3_SetKey(Des3* des, const byte* key,
133 const byte* iv,int dir);
134 WOLFSSL_API int wc_Des3_SetIV(Des3* des, const byte* iv);
135 WOLFSSL_API int wc_Des3_CbcEncrypt(Des3* des, byte* out,
136 const byte* in,word32 sz);
137 WOLFSSL_API int wc_Des3_CbcDecrypt(Des3* des, byte* out,
138 const byte* in,word32 sz);
139
140 /* These are only required when using either:
141 static memory (WOLFSSL_STATIC_MEMORY) or asynchronous (WOLFSSL_ASYNC_CRYPT) */
142 WOLFSSL_API int wc_Des3Init(Des3* des3, void* heap, int devId);
143 WOLFSSL_API void wc_Des3Free(Des3* des3);
144
145 #ifdef __cplusplus
146 } /* extern "C" */
147 #endif
148
149 #endif /* NO_DES3 */
150 #endif /* WOLF_CRYPT_DES3_H */
151

22.329 dilithium.h File Reference


#include <wolfssl/wolfcrypt/types.h>

NetBurner, Inc.
1498 File Documentation

22.330 dilithium.h
Go to the documentation of this file.
1 /* dilithium.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 /* Interfaces for Dilithium NIST Level 1 (Dilithium512) and Dilithium NIST Level 5
17 * (Dilithium1024). */
18
19 #ifndef WOLF_CRYPT_DILITHIUM_H
20 #define WOLF_CRYPT_DILITHIUM_H
21
22 #include <wolfssl/wolfcrypt/types.h>
23
24 #if defined(HAVE_PQC) && defined(HAVE_DILITHIUM)
25
26 #ifdef HAVE_LIBOQS
27 #include <oqs/oqs.h>
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* Macros Definitions */
35
36 #ifdef HAVE_LIBOQS
37 #define DILITHIUM_LEVEL2_KEY_SIZE OQS_SIG_dilithium_2_length_secret_key
38 #define DILITHIUM_LEVEL2_SIG_SIZE OQS_SIG_dilithium_2_length_signature
39 #define DILITHIUM_LEVEL2_PUB_KEY_SIZE OQS_SIG_dilithium_2_length_public_key
40 #define DILITHIUM_LEVEL2_PRV_KEY_SIZE (DILITHIUM_LEVEL2_PUB_KEY_SIZE+DILITHIUM_LEVEL2_KEY_SIZE)
41
42 #define DILITHIUM_LEVEL3_KEY_SIZE OQS_SIG_dilithium_3_length_secret_key
43 #define DILITHIUM_LEVEL3_SIG_SIZE OQS_SIG_dilithium_3_length_signature
44 #define DILITHIUM_LEVEL3_PUB_KEY_SIZE OQS_SIG_dilithium_3_length_public_key
45 #define DILITHIUM_LEVEL3_PRV_KEY_SIZE (DILITHIUM_LEVEL3_PUB_KEY_SIZE+DILITHIUM_LEVEL3_KEY_SIZE)
46
47 #define DILITHIUM_LEVEL5_KEY_SIZE OQS_SIG_dilithium_5_length_secret_key
48 #define DILITHIUM_LEVEL5_SIG_SIZE OQS_SIG_dilithium_5_length_signature
49 #define DILITHIUM_LEVEL5_PUB_KEY_SIZE OQS_SIG_dilithium_5_length_public_key
50 #define DILITHIUM_LEVEL5_PRV_KEY_SIZE (DILITHIUM_LEVEL5_PUB_KEY_SIZE+DILITHIUM_LEVEL5_KEY_SIZE)
51 #endif
52
53 #define DILITHIUM_MAX_KEY_SIZE DILITHIUM_LEVEL5_PRV_KEY_SIZE
54 #define DILITHIUM_MAX_SIG_SIZE DILITHIUM_LEVEL5_SIG_SIZE
55 #define DILITHIUM_MAX_PUB_KEY_SIZE DILITHIUM_LEVEL5_PUB_KEY_SIZE
56 #define DILITHIUM_MAX_PRV_KEY_SIZE DILITHIUM_LEVEL5_PRV_KEY_SIZE
57
58 #define SHAKE_VARIANT 1
59 #define AES_VARIANT 2
60
61 /* Structs */
62
63 struct dilithium_key {
64 bool pubKeySet;
65 bool prvKeySet;
66 byte level; /* 2,3 or 5 */
67 byte sym; /* SHAKE_VARIANT or AES_VARIANT */
68 byte p[DILITHIUM_MAX_PUB_KEY_SIZE];
69 byte k[DILITHIUM_MAX_PRV_KEY_SIZE];
70 };
71
72 #ifndef WC_DILITHIUMKEY_TYPE_DEFINED
73 typedef struct dilithium_key dilithium_key;
74 #define WC_DILITHIUMKEY_TYPE_DEFINED
75 #endif
76
77 /* Functions */
78
79 WOLFSSL_API
80 int wc_dilithium_sign_msg(const byte* in, word32 inLen, byte* out, word32 *outLen,
81 dilithium_key* key);
82 WOLFSSL_API
83 int wc_dilithium_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
84 word32 msgLen, int* res, dilithium_key* key);
85
86 WOLFSSL_API
87 int wc_dilithium_init(dilithium_key* key);

NetBurner, Inc.
22.331 ecc.h File Reference 1499

88 WOLFSSL_API
89 int wc_dilithium_set_level_and_sym(dilithium_key* key, byte level, byte sym);
90 WOLFSSL_API
91 int wc_dilithium_get_level_and_sym(dilithium_key* key, byte* level, byte *sym);
92 WOLFSSL_API
93 void wc_dilithium_free(dilithium_key* key);
94
95 WOLFSSL_API
96 int wc_dilithium_import_public(const byte* in, word32 inLen, dilithium_key* key);
97 WOLFSSL_API
98 int wc_dilithium_import_private_only(const byte* priv, word32 privSz,
99 dilithium_key* key);
100 WOLFSSL_API
101 int wc_dilithium_import_private_key(const byte* priv, word32 privSz,
102 const byte* pub, word32 pubSz,
103 dilithium_key* key);
104
105 WOLFSSL_API
106 int wc_dilithium_export_public(dilithium_key*, byte* out, word32* outLen);
107 WOLFSSL_API
108 int wc_dilithium_export_private_only(dilithium_key* key, byte* out, word32* outLen);
109 WOLFSSL_API
110 int wc_dilithium_export_private(dilithium_key* key, byte* out, word32* outLen);
111 WOLFSSL_API
112 int wc_dilithium_export_key(dilithium_key* key, byte* priv, word32 *privSz,
113 byte* pub, word32 *pubSz);
114
115 WOLFSSL_API
116 int wc_dilithium_check_key(dilithium_key* key);
117
118 WOLFSSL_API
119 int wc_dilithium_size(dilithium_key* key);
120 WOLFSSL_API
121 int wc_dilithium_priv_size(dilithium_key* key);
122 WOLFSSL_API
123 int wc_dilithium_pub_size(dilithium_key* key);
124 WOLFSSL_API
125 int wc_dilithium_sig_size(dilithium_key* key);
126
127 #ifdef __cplusplus
128 } /* extern "C" */
129 #endif
130
131 #endif /* HAVE_PQC && HAVE_DILITHIUM */
132 #endif /* WOLF_CRYPT_DILITHIUM_H */

22.331 ecc.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.332 ecc.h
Go to the documentation of this file.
1 /* ecc.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_ECC_H
18 #define WOLF_CRYPT_ECC_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifdef HAVE_ECC
23
24 #if defined(HAVE_FIPS) && \
25 defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)
26 #include <wolfssl/wolfcrypt/fips.h>
27 #endif /* HAVE_FIPS_VERSION >= 2 */
28
29 #include <wolfssl/wolfcrypt/integer.h>
30 #include <wolfssl/wolfcrypt/random.h>
31

NetBurner, Inc.
1500 File Documentation

32 #ifdef HAVE_X963_KDF
33 #include <wolfssl/wolfcrypt/hash.h>
34 #endif
35
36 #ifdef WOLFSSL_ASYNC_CRYPT
37 #include <wolfssl/wolfcrypt/async.h>
38 #ifdef WOLFSSL_CERT_GEN
39 #include <wolfssl/wolfcrypt/asn.h>
40 #endif
41 #endif
42
43 #if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
44 #include <wolfssl/wolfcrypt/port/atmel/atmel.h>
45 #endif /* WOLFSSL_ATECC508A */
46
47 #if defined(WOLFSSL_CRYPTOCELL)
48 #include <wolfssl/wolfcrypt/port/arm/cryptoCell.h>
49 #endif
50
51 #ifdef WOLFSSL_SILABS_SE_ACCEL
52 #include <wolfssl/wolfcrypt/port/silabs/silabs_ecc.h>
53 #endif
54
55 #if defined(WOLFSSL_KCAPI_ECC)
56 #include <wolfssl/wolfcrypt/port/kcapi/kcapi_ecc.h>
57 #endif
58
59 #ifdef WOLFSSL_SE050
60 #include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
61 #endif
62
63 #ifdef WOLFSSL_HAVE_SP_ECC
64 #include <wolfssl/wolfcrypt/sp_int.h>
65 #endif
66
67
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71
72
73 /* Enable curve B parameter if needed */
74 #if defined(HAVE_COMP_KEY) || defined(ECC_CACHE_CURVE)
75 #ifndef USE_ECC_B_PARAM /* Allow someone to force enable */
76 #define USE_ECC_B_PARAM
77 #endif
78 #endif
79
80
81 /* Use this as the key->idx if a custom ecc_set is used for key->dp */
82 #define ECC_CUSTOM_IDX (-1)
83
84
85 /* Determine max ECC bits based on enabled curves */
86 #if defined(WOLFCRYPT_HAVE_SAKKE)
87 #define MAX_ECC_BITS_NEEDED 1024
88 #elif defined(HAVE_ECC521) || defined(HAVE_ALL_CURVES)
89 #define MAX_ECC_BITS_NEEDED 521
90 #elif defined(HAVE_ECC512)
91 #define MAX_ECC_BITS_NEEDED 512
92 #elif defined(HAVE_ECC384)
93 #define MAX_ECC_BITS_NEEDED 384
94 #elif defined(HAVE_ECC320)
95 #define MAX_ECC_BITS_NEEDED 320
96 #elif !defined(NO_ECC256)
97 #define MAX_ECC_BITS_NEEDED 256
98 #elif defined(HAVE_ECC239)
99 #define MAX_ECC_BITS_NEEDED 239
100 #elif defined(HAVE_ECC224)
101 #define MAX_ECC_BITS_NEEDED 224
102 #elif defined(HAVE_ECC192)
103 #define MAX_ECC_BITS_NEEDED 192
104 #elif defined(HAVE_ECC160)
105 #define MAX_ECC_BITS_NEEDED 160
106 #elif defined(HAVE_ECC128)
107 #define MAX_ECC_BITS_NEEDED 128
108 #elif defined(HAVE_ECC112)
109 #define MAX_ECC_BITS_NEEDED 112
110 #endif
111
112 #ifndef MAX_ECC_BITS
113 #define MAX_ECC_BITS MAX_ECC_BITS_NEEDED
114 #else
115 #if MAX_ECC_BITS_NEEDED > MAX_ECC_BITS
116 #error configured MAX_ECC_BITS is less than required by enabled curves.
117 #endif
118 #endif

NetBurner, Inc.
22.332 ecc.h 1501

119
120
121 /* calculate max ECC bytes */
122 #if ((MAX_ECC_BITS * 2) % 8) == 0
123 #define MAX_ECC_BYTES (MAX_ECC_BITS / 8)
124 #else
125 /* add byte if not aligned */
126 #define MAX_ECC_BYTES ((MAX_ECC_BITS / 8) + 1)
127 #endif
128
129 #ifndef ECC_MAX_PAD_SZ
130 /* ECC maximum padding size (when MSB is set extra byte required for R and S) */
131 #define ECC_MAX_PAD_SZ 2
132 #endif
133
134 enum {
135 ECC_PUBLICKEY = 1,
136 ECC_PRIVATEKEY = 2,
137 ECC_PRIVATEKEY_ONLY = 3,
138 ECC_MAXNAME = 16, /* MAX CURVE NAME LENGTH */
139 SIG_HEADER_SZ = 7, /* ECC signature header size (30 81 87 02 42 [R] 02 42 [S]) */
140 ECC_BUFSIZE = 257, /* for exported keys temp buffer */
141 ECC_MINSIZE = ECC_MIN_KEY_SZ/8, /* MIN Private Key size */
142 #ifdef WOLFCRYPT_HAVE_SAKKE
143 ECC_MAXSIZE = 128, /* MAX Private Key size */
144 ECC_MAXSIZE_GEN = 128, /* MAX Buffer size required when generating ECC keys*/
145 #else
146 ECC_MAXSIZE = 66, /* MAX Private Key size */
147 ECC_MAXSIZE_GEN = 74, /* MAX Buffer size required when generating ECC keys*/
148 #endif
149 ECC_MAX_OID_LEN = 16,
150 ECC_MAX_SIG_SIZE= ((MAX_ECC_BYTES * 2) + ECC_MAX_PAD_SZ + SIG_HEADER_SZ),
151
152 /* max crypto hardware size */
153 #if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
154 ECC_MAX_CRYPTO_HW_SIZE = ATECC_KEY_SIZE, /* from port/atmel/atmel.h */
155 ECC_MAX_CRYPTO_HW_PUBKEY_SIZE = (ATECC_KEY_SIZE*2),
156 #elif defined(PLUTON_CRYPTO_ECC)
157 ECC_MAX_CRYPTO_HW_SIZE = 32,
158 #elif defined(WOLFSSL_SILABS_SE_ACCEL)
159 ECC_MAX_CRYPTO_HW_SIZE = 32,
160 #elif defined(WOLFSSL_CRYPTOCELL)
161 #ifndef CRYPTOCELL_KEY_SIZE
162 CRYPTOCELL_KEY_SIZE = ECC_MAXSIZE,
163 #endif
164 ECC_MAX_CRYPTO_HW_SIZE = CRYPTOCELL_KEY_SIZE,
165 #elif defined(WOLFSSL_SE050)
166 ECC_MAX_CRYPTO_HW_SIZE = 32,
167 ECC_MAX_CRYPTO_HW_PUBKEY_SIZE = 64,
168 #endif
169
170
171 /* point compression type */
172 ECC_POINT_COMP_EVEN = 0x02,
173 ECC_POINT_COMP_ODD = 0x03,
174 ECC_POINT_UNCOMP = 0x04,
175
176 /* Shamir’s dual add constants */
177 SHAMIR_PRECOMP_SZ = 16,
178
179 #ifdef WOLF_PRIVATE_KEY_ID
180 ECC_MAX_ID_LEN = 32,
181 ECC_MAX_LABEL_LEN = 32,
182 #endif
183 };
184
185 #endif /* HAVE_ECC */
186
187 #if defined(HAVE_ECC) || defined(HAVE_CURVE25519) || \
188 defined(HAVE_CURVE448) || defined(WOLFCRYPT_HAVE_SAKKE)
189 /* Curve Types */
190 typedef enum ecc_curve_id {
191 ECC_CURVE_INVALID = -1,
192 ECC_CURVE_DEF = 0, /* NIST or SECP */
193
194 /* NIST Prime Curves */
195 ECC_SECP192R1,
196 ECC_PRIME192V2,
197 ECC_PRIME192V3,
198 ECC_PRIME239V1,
199 ECC_PRIME239V2,
200 ECC_PRIME239V3,
201 ECC_SECP256R1,
202
203 /* SECP Curves */
204 ECC_SECP112R1,
205 ECC_SECP112R2,

NetBurner, Inc.
1502 File Documentation

206 ECC_SECP128R1,
207 ECC_SECP128R2,
208 ECC_SECP160R1,
209 ECC_SECP160R2,
210 ECC_SECP224R1,
211 ECC_SECP384R1,
212 ECC_SECP521R1,
213
214 /* Koblitz */
215 ECC_SECP160K1,
216 ECC_SECP192K1,
217 ECC_SECP224K1,
218 ECC_SECP256K1,
219
220 /* Brainpool Curves */
221 ECC_BRAINPOOLP160R1,
222 ECC_BRAINPOOLP192R1,
223 ECC_BRAINPOOLP224R1,
224 ECC_BRAINPOOLP256R1,
225 ECC_BRAINPOOLP320R1,
226 ECC_BRAINPOOLP384R1,
227 ECC_BRAINPOOLP512R1,
228
229 /* Twisted Edwards Curves */
230 #ifdef HAVE_CURVE25519
231 ECC_X25519,
232 #endif
233 #ifdef HAVE_CURVE448
234 ECC_X448,
235 #endif
236 #ifdef WOLFCRYPT_HAVE_SAKKE
237 ECC_SAKKE_1,
238 #endif
239
240 #ifdef WOLFSSL_CUSTOM_CURVES
241 ECC_CURVE_CUSTOM,
242 #endif
243 ECC_CURVE_MAX
244 } ecc_curve_id;
245 #endif
246
247 #ifdef HAVE_ECC
248
249 #ifdef HAVE_OID_ENCODING
250 typedef word16 ecc_oid_t;
251 #else
252 typedef byte ecc_oid_t;
253 /* OID encoded with ASN scheme:
254 first element = (oid[0] * 40) + oid[1]
255 if any element > 127 then MSB 0x80 indicates additional byte */
256 #endif
257
258
259 #if !defined(WOLFSSL_ECC_CURVE_STATIC) && defined(USE_WINDOWS_API)
260 /* MSC does something different with the pointers to the arrays than GCC,
261 * and it causes the FIPS checksum to fail. In the case of windows builds,
262 * store everything as arrays instead of pointers to strings. */
263
264 #define WOLFSSL_ECC_CURVE_STATIC
265 #endif
266
267 /* ECC set type defined a GF(p) curve */
268 #ifndef WOLFSSL_ECC_CURVE_STATIC
269 typedef struct ecc_set_type {
270 int size; /* The size of the curve in octets */
271 int id; /* id of this curve */
272 const char* name; /* name of this curve */
273 const char* prime; /* prime that defines the field, curve is in (hex) */
274 const char* Af; /* fields A param (hex) */
275 const char* Bf; /* fields B param (hex) */
276 const char* order; /* order of the curve (hex) */
277 const char* Gx; /* x coordinate of the base point on curve (hex) */
278 const char* Gy; /* y coordinate of the base point on curve (hex) */
279 const ecc_oid_t* oid;
280 word32 oidSz;
281 word32 oidSum; /* sum of encoded OID bytes */
282 int cofactor;
283 } ecc_set_type;
284 #else
285 #define MAX_ECC_NAME 16
286 #define MAX_ECC_STRING ((MAX_ECC_BYTES * 2) + 2)
287 /* The values are stored as text strings. */
288
289 typedef struct ecc_set_type {
290 int size; /* The size of the curve in octets */
291 int id; /* id of this curve */
292 const char name[MAX_ECC_NAME]; /* name of this curve */

NetBurner, Inc.
22.332 ecc.h 1503

293 const char prime[MAX_ECC_STRING]; /* prime that defines the field, curve is in (hex) */
294 const char Af[MAX_ECC_STRING]; /* fields A param (hex) */
295 const char Bf[MAX_ECC_STRING]; /* fields B param (hex) */
296 const char order[MAX_ECC_STRING]; /* order of the curve (hex) */
297 const char Gx[MAX_ECC_STRING]; /* x coordinate of the base point on curve (hex) */
298 const char Gy[MAX_ECC_STRING]; /* y coordinate of the base point on curve (hex) */
299 const ecc_oid_t oid[10];
300 word32 oidSz;
301 word32 oidSum; /* sum of encoded OID bytes */
302 int cofactor;
303 } ecc_set_type;
304 #endif
305
306
307 #ifdef ALT_ECC_SIZE
308
309 /* Note on ALT_ECC_SIZE:
310 * The fast math code uses an array of a fixed size to store the big integers.
311 * By default, the array is big enough for RSA keys. There is a size,
312 * FP_MAX_BITS which can be used to make the array smaller when one wants ECC
313 * but not RSA. Some people want fast math sized for both RSA and ECC, where
314 * ECC won’t use as much as RSA. The flag ALT_ECC_SIZE switches in an alternate
315 * ecc_point structure that uses an alternate fp_int that has a shorter array
316 * of fp_digits.
317 *
318 * Now, without ALT_ECC_SIZE, the ecc_point has three single item arrays of
319 * mp_ints for the components of the point. With ALT_ECC_SIZE, the components
320 * of the point are pointers that are set to each of a three item array of
321 * alt_fp_ints. While an mp_int will have 4096 bits of digit inside the
322 * structure, the alt_fp_int will only have 512 bits for ECC 256-bit and
323 * 1056-bits for ECC 521-bit. A size value was added in the ALT case, as well,
324 * and is set by mp_init() and alt_fp_init(). The functions fp_zero() and
325 * fp_copy() use the size parameter. An int needs to be initialized before
326 * using it instead of just fp_zeroing it, the init will call zero. The
327 * FP_MAX_BITS_ECC defaults to calculating based on MAX_ECC_BITS, but
328 * can be set to change the number of bits used in the alternate FP_INT.
329 *
330 * The ALT_ECC_SIZE option only applies to stack based fast math USE_FAST_MATH.
331 */
332
333 #ifndef USE_FAST_MATH
334 #error USE_FAST_MATH must be defined to use ALT_ECC_SIZE
335 #endif
336 #ifdef WOLFSSL_NO_MALLOC
337 #error ALT_ECC_SIZE cannot be used with no malloc (WOLFSSL_NO_MALLOC)
338 #endif
339
340 /* determine max bits required for ECC math */
341 #ifndef FP_MAX_BITS_ECC
342 /* max bits rounded up by 8 then doubled */
343 /* (ROUND8(MAX_ECC_BITS) * 2) */
344 #define FP_MAX_BITS_ECC (2 * \
345 ((MAX_ECC_BITS + DIGIT_BIT - 1) / DIGIT_BIT) * DIGIT_BIT)
346
347 /* Note: For ECC verify only FP_MAX_BITS_ECC can be reduced to:
348 ROUND8(MAX_ECC_BITS) + ROUND8(DIGIT_BIT) */
349 #endif
350
351 /* verify alignment */
352 #if CHAR_BIT == 0
353 #error CHAR_BIT must be nonzero
354 #endif
355 #if FP_MAX_BITS_ECC % CHAR_BIT
356 #error FP_MAX_BITS_ECC must be a multiple of CHAR_BIT
357 #endif
358
359 /* determine buffer size */
360 /* Add one to accommodate extra digit used by sp_mul(), sp_mulmod(), sp_sqr(), and sp_sqrmod(). */
361 #define FP_SIZE_ECC ((FP_MAX_BITS_ECC/DIGIT_BIT) + 1)
362
363
364 /* This needs to match the size of the fp_int struct, except the
365 * fp_digit array will be shorter. */
366 typedef struct alt_fp_int {
367 int used, sign, size;
368 mp_digit dp[FP_SIZE_ECC];
369 } alt_fp_int;
370 #endif /* ALT_ECC_SIZE */
371
372 #ifndef WC_ECCKEY_TYPE_DEFINED
373 typedef struct ecc_key ecc_key;
374 #define WC_ECCKEY_TYPE_DEFINED
375 #endif
376
377
378 /* A point on an ECC curve, stored in Jacobian format such that (x,y,z) =>
379 (x/z^2, y/z^3, 1) when interpreted as affine */

NetBurner, Inc.
1504 File Documentation

380 typedef struct {


381 #ifndef ALT_ECC_SIZE
382 mp_int x[1]; /* The x coordinate */
383 mp_int y[1]; /* The y coordinate */
384 mp_int z[1]; /* The z coordinate */
385 #else
386 mp_int* x; /* The x coordinate */
387 mp_int* y; /* The y coordinate */
388 mp_int* z; /* The z coordinate */
389 alt_fp_int xyz[3];
390 #endif
391 #if defined(WOLFSSL_SMALL_STACK_CACHE) && !defined(WOLFSSL_ECC_NO_SMALL_STACK)
392 ecc_key* key;
393 #endif
394 } ecc_point;
395
396 /* ECC Flags */
397 enum {
398 WC_ECC_FLAG_NONE = 0x00,
399 WC_ECC_FLAG_COFACTOR = 0x01,
400 WC_ECC_FLAG_DEC_SIGN = 0x02,
401 };
402
403 /* ECC non-blocking */
404 #ifdef WC_ECC_NONBLOCK
405 typedef struct ecc_nb_ctx {
406 #if defined(WOLFSSL_HAVE_SP_ECC) && defined(WOLFSSL_SP_NONBLOCK)
407 sp_ecc_ctx_t sp_ctx;
408 #else
409 /* build configuration not supported */
410 #error ECC non-blocking only supports SP (--enable-sp=nonblock)
411 #endif
412 } ecc_nb_ctx_t;
413 #endif /* WC_ECC_NONBLOCK */
414
415
416 /* An ECC Key */
417 struct ecc_key {
418 int type; /* Public or Private */
419 int idx; /* Index into the ecc_sets[] for the parameters of
420 this curve if -1, this key is using user supplied
421 curve in dp */
422 int state;
423 word32 flags;
424 const ecc_set_type* dp; /* domain parameters, either points to NIST
425 curves (idx >= 0) or user supplied */
426 #ifdef WOLFSSL_CUSTOM_CURVES
427 int deallocSet;
428 #endif
429 void* heap; /* heap hint */
430 ecc_point pubkey; /* public key */
431 mp_int k; /* private key */
432
433 #ifdef WOLFSSL_CAAM
434 word32 blackKey; /* address of key encrypted and in secure memory */
435 word32 securePubKey; /* address of public key in secure memory */
436 int partNum; /* partition number*/
437 #endif
438 #ifdef WOLFSSL_SE050
439 int keyId;
440 #endif
441 #if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
442 int slot; /* Key Slot Number (-1 unknown) */
443 byte pubkey_raw[ECC_MAX_CRYPTO_HW_PUBKEY_SIZE];
444 #endif
445 #if defined(PLUTON_CRYPTO_ECC) || defined(WOLF_CRYPTO_CB)
446 int devId;
447 #endif
448 #ifdef WOLFSSL_SILABS_SE_ACCEL
449 sl_se_command_context_t cmd_ctx;
450 sl_se_key_descriptor_t key;
451 /* Used for SiLabs "plaintext" with public X, public Y, and
452 * private D concatenated. These are respectively at offset ‘0‘,
453 * offset ‘keysize‘, and offset ‘2 * keysize‘.
454 */
455 byte key_raw[3 * ECC_MAX_CRYPTO_HW_SIZE];
456 #endif
457 #ifdef WOLFSSL_KCAPI_ECC
458 struct kcapi_handle* handle;
459 byte pubkey_raw[MAX_ECC_BYTES * 2];
460 #endif
461
462 #ifdef WOLFSSL_ASYNC_CRYPT
463 mp_int* r; /* sign/verify temps */
464 mp_int* s;
465 WC_ASYNC_DEV asyncDev;
466 #ifdef HAVE_CAVIUM_V

NetBurner, Inc.
22.332 ecc.h 1505

467 mp_int* e; /* Sign, Verify and Shared Secret */


468 mp_int* signK;
469 #endif
470 #ifdef WOLFSSL_CERT_GEN
471 CertSignCtx certSignCtx; /* context info for cert sign (MakeSignature) */
472 #endif
473 #endif /* WOLFSSL_ASYNC_CRYPT */
474 #ifdef WOLF_PRIVATE_KEY_ID
475 byte id[ECC_MAX_ID_LEN];
476 int idLen;
477 char label[ECC_MAX_LABEL_LEN];
478 int labelLen;
479 #endif
480 #if defined(WOLFSSL_CRYPTOCELL)
481 ecc_context_t ctx;
482 #endif
483
484 #if defined(WOLFSSL_ECDSA_SET_K) || defined(WOLFSSL_ECDSA_SET_K_ONE_LOOP) || \
485 defined(WOLFSSL_ECDSA_DETERMINISTIC_K) || \
486 defined(WOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT)
487 mp_int *sign_k;
488 #endif
489 #if defined(WOLFSSL_ECDSA_DETERMINISTIC_K) || \
490 defined(WOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT)
491 byte deterministic:1;
492 #endif
493
494 #if defined(WOLFSSL_SMALL_STACK_CACHE) && !defined(WOLFSSL_ECC_NO_SMALL_STACK)
495 mp_int* t1;
496 mp_int* t2;
497 #ifdef ALT_ECC_SIZE
498 mp_int* x;
499 mp_int* y;
500 mp_int* z;
501 #endif
502 #endif
503
504 #ifdef WOLFSSL_DSP
505 remote_handle64 handle;
506 #endif
507 #ifdef ECC_TIMING_RESISTANT
508 WC_RNG* rng;
509 #endif
510 #ifdef WC_ECC_NONBLOCK
511 ecc_nb_ctx_t* nb_ctx;
512 #endif
513 };
514
515
516 WOLFSSL_ABI WOLFSSL_API ecc_key* wc_ecc_key_new(void* heap);
517 WOLFSSL_ABI WOLFSSL_API void wc_ecc_key_free(ecc_key* key);
518
519
520 /* ECC predefined curve sets */
521 extern const ecc_set_type ecc_sets[];
522 extern const size_t ecc_sets_count;
523
524 WOLFSSL_API
525 const char* wc_ecc_get_name(int curve_id);
526
527 #ifdef WOLFSSL_PUBLIC_ECC_ADD_DBL
528 #define ECC_API WOLFSSL_API
529 #else
530 #define ECC_API WOLFSSL_LOCAL
531 #endif
532
533 ECC_API int ecc_mul2add(ecc_point* A, mp_int* kA,
534 ecc_point* B, mp_int* kB,
535 ecc_point* C, mp_int* a, mp_int* modulus, void* heap);
536
537 ECC_API int ecc_map(ecc_point* P, mp_int* modulus, mp_digit mp);
538 ECC_API int ecc_map_ex(ecc_point* P, mp_int* modulus, mp_digit mp, int ct);
539 ECC_API int ecc_projective_add_point(ecc_point* P, ecc_point* Q, ecc_point* R,
540 mp_int* a, mp_int* modulus, mp_digit mp);
541 ECC_API int ecc_projective_dbl_point(ecc_point* P, ecc_point* R, mp_int* a,
542 mp_int* modulus, mp_digit mp);
543
544 WOLFSSL_LOCAL
545 int ecc_projective_add_point_safe(ecc_point* A, ecc_point* B, ecc_point* R,
546 mp_int* a, mp_int* modulus, mp_digit mp, int* infinity);
547 WOLFSSL_LOCAL
548 int ecc_projective_dbl_point_safe(ecc_point* P, ecc_point* R, mp_int* a,
549 mp_int* modulus, mp_digit mp);
550
551 WOLFSSL_ABI WOLFSSL_API
552 int wc_ecc_make_key(WC_RNG* rng, int keysize, ecc_key* key);
553 WOLFSSL_ABI WOLFSSL_API

NetBurner, Inc.
1506 File Documentation

554 int wc_ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, int curve_id);
555 WOLFSSL_API
556 int wc_ecc_make_key_ex2(WC_RNG* rng, int keysize, ecc_key* key, int curve_id,
557 int flags);
558 WOLFSSL_API
559 int wc_ecc_make_pub(ecc_key* key, ecc_point* pubOut);
560 WOLFSSL_API
561 int wc_ecc_make_pub_ex(ecc_key* key, ecc_point* pubOut, WC_RNG* rng);
562 WOLFSSL_ABI WOLFSSL_API
563 int wc_ecc_check_key(ecc_key* key);
564 WOLFSSL_API
565 int wc_ecc_is_point(ecc_point* ecp, mp_int* a, mp_int* b, mp_int* prime);
566 WOLFSSL_API
567 int wc_ecc_get_generator(ecc_point* ecp, int curve_idx);
568
569 #ifdef HAVE_ECC_DHE
570 WOLFSSL_ABI WOLFSSL_API
571 int wc_ecc_shared_secret(ecc_key* private_key, ecc_key* public_key, byte* out,
572 word32* outlen);
573 WOLFSSL_LOCAL
574 int wc_ecc_shared_secret_gen(ecc_key* private_key, ecc_point* point,
575 byte* out, word32 *outlen);
576 WOLFSSL_API
577 int wc_ecc_shared_secret_ex(ecc_key* private_key, ecc_point* point,
578 byte* out, word32 *outlen);
579
580 #if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \
581 defined(PLUTON_CRYPTO_ECC) || defined(WOLFSSL_CRYPTOCELL)
582 #define wc_ecc_shared_secret_ssh wc_ecc_shared_secret
583 #else
584 #define wc_ecc_shared_secret_ssh wc_ecc_shared_secret_ex /* For backwards compat */
585 #endif
586
587 #endif /* HAVE_ECC_DHE */
588
589 #ifdef HAVE_ECC_SIGN
590 WOLFSSL_ABI WOLFSSL_API
591 int wc_ecc_sign_hash(const byte* in, word32 inlen, byte* out, word32 *outlen,
592 WC_RNG* rng, ecc_key* key);
593 WOLFSSL_API
594 int wc_ecc_sign_hash_ex(const byte* in, word32 inlen, WC_RNG* rng,
595 ecc_key* key, mp_int *r, mp_int *s);
596 #if defined(WOLFSSL_ECDSA_DETERMINISTIC_K) || \
597 defined(WOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT)
598 WOLFSSL_API
599 int wc_ecc_set_deterministic(ecc_key* key, byte flag);
600 WOLFSSL_API
601 int wc_ecc_gen_deterministic_k(const byte* hash, word32 hashSz,
602 enum wc_HashType hashType, mp_int* priv, mp_int* k, mp_int* order,
603 void* heap);
604 #endif
605 #if defined(WOLFSSL_ECDSA_SET_K) || defined(WOLFSSL_ECDSA_SET_K_ONE_LOOP)
606 WOLFSSL_API
607 int wc_ecc_sign_set_k(const byte* k, word32 klen, ecc_key* key);
608 #endif
609 #endif /* HAVE_ECC_SIGN */
610
611 #ifdef HAVE_ECC_VERIFY
612 WOLFSSL_ABI WOLFSSL_API
613 int wc_ecc_verify_hash(const byte* sig, word32 siglen, const byte* hash,
614 word32 hashlen, int* res, ecc_key* key);
615 WOLFSSL_API
616 int wc_ecc_verify_hash_ex(mp_int *r, mp_int *s, const byte* hash,
617 word32 hashlen, int* res, ecc_key* key);
618 #endif /* HAVE_ECC_VERIFY */
619
620 WOLFSSL_ABI WOLFSSL_API
621 int wc_ecc_init(ecc_key* key);
622 WOLFSSL_ABI WOLFSSL_API
623 int wc_ecc_init_ex(ecc_key* key, void* heap, int devId);
624 #ifdef WOLF_PRIVATE_KEY_ID
625 WOLFSSL_API
626 int wc_ecc_init_id(ecc_key* key, unsigned char* id, int len, void* heap,
627 int devId);
628 WOLFSSL_API
629 int wc_ecc_init_label(ecc_key* key, const char* label, void* heap, int devId);
630 #endif
631 #ifdef WOLFSSL_CUSTOM_CURVES
632 WOLFSSL_LOCAL
633 void wc_ecc_free_curve(const ecc_set_type* curve, void* heap);
634 #endif
635 WOLFSSL_ABI WOLFSSL_API
636 int wc_ecc_free(ecc_key* key);
637 WOLFSSL_API
638 int wc_ecc_set_flags(ecc_key* key, word32 flags);
639 WOLFSSL_ABI WOLFSSL_API
640 void wc_ecc_fp_free(void);

NetBurner, Inc.
22.332 ecc.h 1507

641 WOLFSSL_LOCAL
642 void wc_ecc_fp_init(void);
643 #ifdef ECC_TIMING_RESISTANT
644 WOLFSSL_API
645 int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng);
646 #endif
647
648 WOLFSSL_API
649 int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id);
650
651 WOLFSSL_API
652 int wc_ecc_is_valid_idx(int n);
653 WOLFSSL_API
654 int wc_ecc_get_curve_idx(int curve_id);
655 WOLFSSL_API
656 int wc_ecc_get_curve_id(int curve_idx);
657 #define wc_ecc_get_curve_name_from_id wc_ecc_get_name
658 WOLFSSL_API
659 int wc_ecc_get_curve_size_from_id(int curve_id);
660
661 WOLFSSL_API
662 int wc_ecc_get_curve_idx_from_name(const char* curveName);
663 WOLFSSL_API
664 int wc_ecc_get_curve_size_from_name(const char* curveName);
665 WOLFSSL_API
666 int wc_ecc_get_curve_id_from_name(const char* curveName);
667 WOLFSSL_API
668 int wc_ecc_get_curve_id_from_params(int fieldSize,
669 const byte* prime, word32 primeSz, const byte* Af, word32 AfSz,
670 const byte* Bf, word32 BfSz, const byte* order, word32 orderSz,
671 const byte* Gx, word32 GxSz, const byte* Gy, word32 GySz, int cofactor);
672 WOLFSSL_API
673 int wc_ecc_get_curve_id_from_dp_params(const ecc_set_type* dp);
674
675 WOLFSSL_API
676 int wc_ecc_get_curve_id_from_oid(const byte* oid, word32 len);
677
678 WOLFSSL_API const ecc_set_type* wc_ecc_get_curve_params(int curve_idx);
679
680 WOLFSSL_API
681 ecc_point* wc_ecc_new_point(void);
682 WOLFSSL_API
683 ecc_point* wc_ecc_new_point_h(void* h);
684 WOLFSSL_API
685 void wc_ecc_del_point(ecc_point* p);
686 WOLFSSL_API
687 void wc_ecc_del_point_h(ecc_point* p, void* h);
688 WOLFSSL_API
689 void wc_ecc_forcezero_point(ecc_point* p);
690 WOLFSSL_API
691 int wc_ecc_copy_point(const ecc_point* p, ecc_point *r);
692 WOLFSSL_API
693 int wc_ecc_cmp_point(ecc_point* a, ecc_point *b);
694 WOLFSSL_API
695 int wc_ecc_point_is_at_infinity(ecc_point *p);
696 WOLFSSL_API
697 int wc_ecc_point_is_on_curve(ecc_point *p, int curve_idx);
698
699 #if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A)
700 WOLFSSL_API
701 int wc_ecc_mulmod(const mp_int* k, ecc_point *G, ecc_point *R,
702 mp_int* a, mp_int* modulus, int map);
703 WOLFSSL_LOCAL
704 int wc_ecc_mulmod_ex(const mp_int* k, ecc_point *G, ecc_point *R,
705 mp_int* a, mp_int* modulus, int map, void* heap);
706 WOLFSSL_LOCAL
707 int wc_ecc_mulmod_ex2(const mp_int* k, ecc_point *G, ecc_point *R, mp_int* a,
708 mp_int* modulus, mp_int* order, WC_RNG* rng, int map,
709 void* heap);
710 #endif /* !WOLFSSL_ATECC508A */
711
712
713 #ifdef HAVE_ECC_KEY_EXPORT
714 /* ASN key helpers */
715 WOLFSSL_ABI WOLFSSL_API
716 int wc_ecc_export_x963(ecc_key* key, byte* out, word32* outLen);
717 WOLFSSL_ABI WOLFSSL_API
718 int wc_ecc_export_x963_ex(ecc_key* key, byte* out, word32* outLen,
719 int compressed);
720 /* extended functionality with compressed option */
721 #endif /* HAVE_ECC_KEY_EXPORT */
722
723 #ifdef HAVE_ECC_KEY_IMPORT
724 WOLFSSL_ABI WOLFSSL_API
725 int wc_ecc_import_x963(const byte* in, word32 inLen, ecc_key* key);
726 WOLFSSL_API
727 int wc_ecc_import_x963_ex(const byte* in, word32 inLen, ecc_key* key,

NetBurner, Inc.
1508 File Documentation

728 int curve_id);


729 WOLFSSL_ABI WOLFSSL_API
730 int wc_ecc_import_private_key(const byte* priv, word32 privSz, const byte* pub,
731 word32 pubSz, ecc_key* key);
732 WOLFSSL_API
733 int wc_ecc_import_private_key_ex(const byte* priv, word32 privSz,
734 const byte* pub, word32 pubSz, ecc_key* key, int curve_id);
735 WOLFSSL_ABI WOLFSSL_API
736 int wc_ecc_rs_to_sig(const char* r, const char* s, byte* out, word32* outlen);
737 WOLFSSL_API
738 int wc_ecc_rs_raw_to_sig(const byte* r, word32 rSz, const byte* s, word32 sSz,
739 byte* out, word32* outlen);
740 WOLFSSL_API
741 int wc_ecc_sig_to_rs(const byte* sig, word32 sigLen, byte* r, word32* rLen,
742 byte* s, word32* sLen);
743 WOLFSSL_ABI WOLFSSL_API
744 int wc_ecc_import_raw(ecc_key* key, const char* qx, const char* qy,
745 const char* d, const char* curveName);
746 WOLFSSL_API
747 int wc_ecc_import_raw_ex(ecc_key* key, const char* qx, const char* qy,
748 const char* d, int curve_id);
749 WOLFSSL_API
750 int wc_ecc_import_unsigned(ecc_key* key, const byte* qx, const byte* qy,
751 const byte* d, int curve_id);
752 #endif /* HAVE_ECC_KEY_IMPORT */
753
754 #ifdef HAVE_ECC_KEY_EXPORT
755 WOLFSSL_API
756 int wc_ecc_export_ex(ecc_key* key, byte* qx, word32* qxLen,
757 byte* qy, word32* qyLen, byte* d, word32* dLen,
758 int encType);
759 WOLFSSL_ABI WOLFSSL_API
760 int wc_ecc_export_private_only(ecc_key* key, byte* out, word32* outLen);
761 WOLFSSL_API
762 int wc_ecc_export_public_raw(ecc_key* key, byte* qx, word32* qxLen,
763 byte* qy, word32* qyLen);
764 WOLFSSL_API
765 int wc_ecc_export_private_raw(ecc_key* key, byte* qx, word32* qxLen,
766 byte* qy, word32* qyLen, byte* d, word32* dLen);
767 #endif /* HAVE_ECC_KEY_EXPORT */
768
769 #ifdef HAVE_ECC_KEY_EXPORT
770 WOLFSSL_API
771 int wc_ecc_export_point_der_ex(const int curve_idx, ecc_point* point, byte* out,
772 word32* outLen, int compressed);
773 WOLFSSL_API
774 int wc_ecc_export_point_der(const int curve_idx, ecc_point* point,
775 byte* out, word32* outLen);
776 WOLFSSL_LOCAL
777 int wc_ecc_export_point_der_compressed(const int curve_idx, ecc_point* point,
778 byte* out, word32* outLen);
779 #endif /* HAVE_ECC_KEY_EXPORT */
780
781
782 #ifdef HAVE_ECC_KEY_IMPORT
783 WOLFSSL_API
784 int wc_ecc_import_point_der_ex(const byte* in, word32 inLen,
785 const int curve_idx, ecc_point* point,
786 int shortKeySize);
787 WOLFSSL_API
788 int wc_ecc_import_point_der(const byte* in, word32 inLen, const int curve_idx,
789 ecc_point* point);
790 #endif /* HAVE_ECC_KEY_IMPORT */
791
792 /* size helper */
793 WOLFSSL_ABI WOLFSSL_API
794 int wc_ecc_size(ecc_key* key);
795 WOLFSSL_ABI WOLFSSL_API
796 int wc_ecc_sig_size_calc(int sz);
797 WOLFSSL_ABI WOLFSSL_API
798 int wc_ecc_sig_size(const ecc_key* key);
799
800 WOLFSSL_API
801 int wc_ecc_get_oid(word32 oidSum, const byte** oid, word32* oidSz);
802
803 #ifdef WOLFSSL_CUSTOM_CURVES
804 WOLFSSL_API
805 int wc_ecc_set_custom_curve(ecc_key* key, const ecc_set_type* dp);
806 #endif
807
808 #ifdef HAVE_ECC_ENCRYPT
809 /* ecc encrypt */
810
811 enum ecEncAlgo {
812 ecAES_128_CBC = 1, /* default */
813 ecAES_256_CBC = 2,
814 ecAES_128_CTR = 3,

NetBurner, Inc.
22.332 ecc.h 1509

815 ecAES_256_CTR = 4
816 };
817
818 enum ecKdfAlgo {
819 ecHKDF_SHA256 = 1, /* default */
820 ecHKDF_SHA1 = 2
821 };
822
823 enum ecMacAlgo {
824 ecHMAC_SHA256 = 1, /* default */
825 ecHMAC_SHA1 = 2
826 };
827
828 enum {
829 KEY_SIZE_128 = 16,
830 KEY_SIZE_256 = 32,
831 IV_SIZE_64 = 8,
832 IV_SIZE_128 = 16,
833 ECC_MAX_IV_SIZE = 16,
834 EXCHANGE_SALT_SZ = 16,
835 EXCHANGE_INFO_SZ = 23
836 };
837
838 enum ecFlags {
839 REQ_RESP_CLIENT = 1,
840 REQ_RESP_SERVER = 2
841 };
842
843 #ifndef WOLFSSL_ECIES_GEN_IV_SIZE
844 #define WOLFSSL_ECIES_GEN_IV_SIZE 12
845 #endif
846
847
848 typedef struct ecEncCtx ecEncCtx;
849
850 WOLFSSL_ABI WOLFSSL_API
851 ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng);
852 WOLFSSL_API
853 ecEncCtx* wc_ecc_ctx_new_ex(int flags, WC_RNG* rng, void* heap);
854 WOLFSSL_ABI WOLFSSL_API
855 void wc_ecc_ctx_free(ecEncCtx* ctx);
856 WOLFSSL_ABI WOLFSSL_API
857 int wc_ecc_ctx_reset(ecEncCtx* ctx, WC_RNG* rng); /* reset for use again w/o alloc/free */
858
859 WOLFSSL_API
860 int wc_ecc_ctx_set_algo(ecEncCtx* ctx, byte encAlgo, byte kdfAlgo,
861 byte macAlgo);
862 WOLFSSL_API
863 const byte* wc_ecc_ctx_get_own_salt(ecEncCtx* ctx);
864 WOLFSSL_API
865 int wc_ecc_ctx_set_peer_salt(ecEncCtx* ctx, const byte* salt);
866 WOLFSSL_API
867 int wc_ecc_ctx_set_kdf_salt(ecEncCtx* ctx, const byte* salt, word32 sz);
868 WOLFSSL_API
869 int wc_ecc_ctx_set_info(ecEncCtx* ctx, const byte* info, int sz);
870
871 WOLFSSL_ABI WOLFSSL_API
872 int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
873 word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
874 WOLFSSL_API
875 int wc_ecc_encrypt_ex(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
876 word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx, int compressed);
877 WOLFSSL_ABI WOLFSSL_API
878 int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
879 word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
880
881 #endif /* HAVE_ECC_ENCRYPT */
882
883 #ifdef HAVE_X963_KDF
884 WOLFSSL_API int wc_X963_KDF(enum wc_HashType type, const byte* secret,
885 word32 secretSz, const byte* sinfo, word32 sinfoSz,
886 byte* out, word32 outSz);
887 #endif
888
889 #ifdef ECC_CACHE_CURVE
890 WOLFSSL_API int wc_ecc_curve_cache_init(void);
891 WOLFSSL_API void wc_ecc_curve_cache_free(void);
892 #endif
893
894 WOLFSSL_API
895 int wc_ecc_gen_k(WC_RNG* rng, int size, mp_int* k, mp_int* order);
896
897 #ifdef WOLFSSL_DSP
898 WOLFSSL_API
899 int wc_ecc_set_handle(ecc_key* key, remote_handle64 handle);
900 WOLFSSL_LOCAL
901 int sp_dsp_ecc_verify_256(remote_handle64 handle, const byte* hash, word32 hashLen, mp_int* pX,

NetBurner, Inc.
1510 File Documentation

902 mp_int* pY, mp_int* pZ, mp_int* r, mp_int* sm, int* res, void* heap);
903 #endif
904
905 #ifdef WC_ECC_NONBLOCK
906 WOLFSSL_API int wc_ecc_set_nonblock(ecc_key *key, ecc_nb_ctx_t* ctx);
907 #endif
908
909 #ifdef __cplusplus
910 } /* extern "C" */
911 #endif
912
913 #endif /* HAVE_ECC */
914 #endif /* WOLF_CRYPT_ECC_H */

22.333 eccsi.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.334 eccsi.h
Go to the documentation of this file.
1 /* eccsi.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_ECCSI_H
18 #define WOLF_CRYPT_ECCSI_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifdef WOLFCRYPT_HAVE_ECCSI
23
24 #include <wolfssl/wolfcrypt/integer.h>
25 #include <wolfssl/wolfcrypt/ecc.h>
26 #include <wolfssl/wolfcrypt/hash.h>
27 #include <wolfssl/wolfcrypt/hmac.h>
28
29 #define WOLFCRYPT_ECCSI_KMS
30 #define WOLFCRYPT_ECCSI_CLIENT
31
32 #define MAX_ECCSI_BYTES (256 / 8)
33
34 /* Maximum number of loops of attempting to generate key pairs and signatures.
35 */
36 #ifndef ECCSI_MAX_GEN_COUNT
37 #define ECCSI_MAX_GEN_COUNT 10
38 #endif
39
40 typedef struct EccsiKeyParams {
42 mp_int order;
43 #ifdef WOLFCRYPT_ECCSI_CLIENT
45 mp_int a;
47 mp_int b;
49 mp_int prime;
50 #endif
52 ecc_point* base;
53
55 byte haveOrder:1;
57 byte haveA:1;
59 byte haveB:1;
61 byte havePrime:1;
63 byte haveBase:1;
64 } EccsiKeyParams;
65
69 typedef struct EccsiKey {
71 ecc_key ecc;
73 ecc_key pubkey;
75 EccsiKeyParams params;
76 #ifdef WOLFCRYPT_ECCSI_CLIENT
78 mp_int tmp;
80 mp_int ssk;
82 ecc_point* pvt;

NetBurner, Inc.
22.335 error-crypt.h File Reference 1511

83 #endif
85 wc_HashAlg hash;
87 byte data[(MAX_ECCSI_BYTES * 2) + 1];
88 #ifdef WOLFCRYPT_ECCSI_CLIENT
90 byte idHash[WC_MAX_DIGEST_SIZE];
92 byte idHashSz;
93 #endif
95 void* heap;
97 word16 kpakMont:1;
98 } EccsiKey;
99
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103
104 WOLFSSL_API int wc_InitEccsiKey(EccsiKey* key, void* heap, int devId);
105 WOLFSSL_API int wc_InitEccsiKey_ex(EccsiKey* key, int keySz, int curveId,
106 void* heap, int devId);
107 WOLFSSL_API void wc_FreeEccsiKey(EccsiKey* key);
108
109 WOLFSSL_API int wc_MakeEccsiKey(EccsiKey* key, WC_RNG* rng);
110
111 WOLFSSL_API int wc_MakeEccsiPair(EccsiKey* key, WC_RNG* rng,
112 enum wc_HashType hashType, const byte* id, word32 idSz, mp_int* ssk,
113 ecc_point* pvt);
114 WOLFSSL_API int wc_ValidateEccsiPair(EccsiKey* key, enum wc_HashType hashType,
115 const byte* id, word32 idSz, const mp_int* ssk, ecc_point* pvt,
116 int* valid);
117 WOLFSSL_API int wc_ValidateEccsiPvt(EccsiKey* key, const ecc_point* pvt,
118 int* valid);
119 WOLFSSL_API int wc_EncodeEccsiPair(const EccsiKey* key, mp_int* ssk,
120 ecc_point* pvt, byte* data, word32* sz);
121 WOLFSSL_API int wc_EncodeEccsiSsk(const EccsiKey* key, mp_int* ssk, byte* data,
122 word32* sz);
123 WOLFSSL_API int wc_EncodeEccsiPvt(const EccsiKey* key, ecc_point* pvt,
124 byte* data, word32* sz, int raw);
125 WOLFSSL_API int wc_DecodeEccsiPair(const EccsiKey* key, const byte* data,
126 word32 sz, mp_int* ssk, ecc_point* pvt);
127 WOLFSSL_API int wc_DecodeEccsiSsk(const EccsiKey* key, const byte* data,
128 word32 sz, mp_int* ssk);
129 WOLFSSL_API int wc_DecodeEccsiPvt(const EccsiKey* key, const byte* data,
130 word32 sz, ecc_point* pvt);
131 WOLFSSL_API int wc_DecodeEccsiPvtFromSig(const EccsiKey* key, const byte* sig,
132 word32 sz, ecc_point* pvt);
133
134 WOLFSSL_API int wc_ExportEccsiKey(EccsiKey* key, byte* data, word32* sz);
135 WOLFSSL_API int wc_ImportEccsiKey(EccsiKey* key, const byte* data, word32 sz);
136
137 WOLFSSL_API int wc_ExportEccsiPrivateKey(EccsiKey* key, byte* data, word32* sz);
138 WOLFSSL_API int wc_ImportEccsiPrivateKey(EccsiKey* key, const byte* data,
139 word32 sz);
140
141 WOLFSSL_API int wc_ExportEccsiPublicKey(EccsiKey* key, byte* data, word32* sz,
142 int raw);
143 WOLFSSL_API int wc_ImportEccsiPublicKey(EccsiKey* key, const byte* data,
144 word32 sz, int trusted);
145
146 WOLFSSL_API int wc_HashEccsiId(EccsiKey* key, enum wc_HashType hashType,
147 const byte* id, word32 idSz, ecc_point* pvt, byte* hash, byte* hashSz);
148 WOLFSSL_API int wc_SetEccsiHash(EccsiKey* key, const byte* hash, byte hashSz);
149 WOLFSSL_API int wc_SetEccsiPair(EccsiKey* key, const mp_int* ssk,
150 const ecc_point* pvt);
151
152 WOLFSSL_API int wc_SignEccsiHash(EccsiKey* key, WC_RNG* rng,
153 enum wc_HashType hashType, const byte* msg, word32 msgSz, byte* sig,
154 word32* sigSz);
155 WOLFSSL_API int wc_VerifyEccsiHash(EccsiKey* key, enum wc_HashType hashType,
156 const byte* msg, word32 msgSz, const byte* sig, word32 sigSz,
157 int* verified);
158
159 #ifdef __cplusplus
160 } /* extern "C" */
161 #endif
162
163 #endif /* WOLFCRYPT_HAVE_ECCSI */
164
165 #endif /* WOLF_CRYPT_ECCSI_H */
166

22.335 error-crypt.h File Reference


#include <wolfssl/wolfcrypt/types.h>

NetBurner, Inc.
1512 File Documentation

22.336 error-crypt.h
Go to the documentation of this file.
1 /* error-crypt.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
15 /*
16 DESCRIPTION
17 This library defines error codes and contains routines for setting and examining
18 the error status.
19 */
20
21 #ifndef WOLF_CRYPT_ERROR_H
22 #define WOLF_CRYPT_ERROR_H
23
24 #include <wolfssl/wolfcrypt/types.h>
25
26 #if defined(HAVE_FIPS) && \
27 (!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION < 2))
28 #include <cyassl/ctaocrypt/error-crypt.h>
29 #endif /* HAVE_FIPS V1 */
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35
36 /* error codes, add string for new errors !!! */
37 enum {
38 MAX_CODE_E = -100, /* errors -101 - -299 */
39 OPEN_RAN_E = -101, /* opening random device error */
40 READ_RAN_E = -102, /* reading random device error */
41 WINCRYPT_E = -103, /* windows crypt init error */
42 CRYPTGEN_E = -104, /* windows crypt generation error */
43 RAN_BLOCK_E = -105, /* reading random device would block */
44 BAD_MUTEX_E = -106, /* Bad mutex operation */
45 WC_TIMEOUT_E = -107, /* timeout error */
46 WC_PENDING_E = -108, /* wolfCrypt operation pending (would block) */
47 WC_NOT_PENDING_E = -109, /* wolfCrypt operation not pending */
48
49 MP_INIT_E = -110, /* mp_init error state */
50 MP_READ_E = -111, /* mp_read error state */
51 MP_EXPTMOD_E = -112, /* mp_exptmod error state */
52 MP_TO_E = -113, /* mp_to_xxx error state, can’t convert */
53 MP_SUB_E = -114, /* mp_sub error state, can’t subtract */
54 MP_ADD_E = -115, /* mp_add error state, can’t add */
55 MP_MUL_E = -116, /* mp_mul error state, can’t multiply */
56 MP_MULMOD_E = -117, /* mp_mulmod error state, can’t multiply mod */
57 MP_MOD_E = -118, /* mp_mod error state, can’t mod */
58 MP_INVMOD_E = -119, /* mp_invmod error state, can’t inv mod */
59 MP_CMP_E = -120, /* mp_cmp error state */
60 MP_ZERO_E = -121, /* got a mp zero result, not expected */
61
62 MEMORY_E = -125, /* out of memory error */
63 VAR_STATE_CHANGE_E = -126, /* var state modified by different thread */
64
65 RSA_WRONG_TYPE_E = -130, /* RSA wrong block type for RSA function */
66 RSA_BUFFER_E = -131, /* RSA buffer error, output too small or
67 input too large */
68 BUFFER_E = -132, /* output buffer too small or input too large */
69 ALGO_ID_E = -133, /* setting algo id error */
70 PUBLIC_KEY_E = -134, /* setting public key error */
71 DATE_E = -135, /* setting date validity error */
72 SUBJECT_E = -136, /* setting subject name error */
73 ISSUER_E = -137, /* setting issuer name error */
74 CA_TRUE_E = -138, /* setting CA basic constraint true error */
75 EXTENSIONS_E = -139, /* setting extensions error */
76
77 ASN_PARSE_E = -140, /* ASN parsing error, invalid input */
78 ASN_VERSION_E = -141, /* ASN version error, invalid number */
79 ASN_GETINT_E = -142, /* ASN get big int error, invalid data */
80 ASN_RSA_KEY_E = -143, /* ASN key init error, invalid input */
81 ASN_OBJECT_ID_E = -144, /* ASN object id error, invalid id */
82 ASN_TAG_NULL_E = -145, /* ASN tag error, not null */
83 ASN_EXPECT_0_E = -146, /* ASN expect error, not zero */
84 ASN_BITSTR_E = -147, /* ASN bit string error, wrong id */
85 ASN_UNKNOWN_OID_E = -148, /* ASN oid error, unknown sum id */
86 ASN_DATE_SZ_E = -149, /* ASN date error, bad size */

NetBurner, Inc.
22.336 error-crypt.h 1513

87 ASN_BEFORE_DATE_E = -150, /* ASN date error, current date before */


88 ASN_AFTER_DATE_E = -151, /* ASN date error, current date after */
89 ASN_SIG_OID_E = -152, /* ASN signature error, mismatched oid */
90 ASN_TIME_E = -153, /* ASN time error, unknown time type */
91 ASN_INPUT_E = -154, /* ASN input error, not enough data */
92 ASN_SIG_CONFIRM_E = -155, /* ASN sig error, confirm failure */
93 ASN_SIG_HASH_E = -156, /* ASN sig error, unsupported hash type */
94 ASN_SIG_KEY_E = -157, /* ASN sig error, unsupported key type */
95 ASN_DH_KEY_E = -158, /* ASN key init error, invalid input */
96 ASN_CRIT_EXT_E = -160, /* ASN unsupported critical extension */
97 ASN_ALT_NAME_E = -161, /* ASN alternate name error */
98 ASN_NO_PEM_HEADER = -162, /* ASN no PEM header found */
99
100 ECC_BAD_ARG_E = -170, /* ECC input argument of wrong type */
101 ASN_ECC_KEY_E = -171, /* ASN ECC bad input */
102 ECC_CURVE_OID_E = -172, /* Unsupported ECC OID curve type */
103 BAD_FUNC_ARG = -173, /* Bad function argument provided */
104 NOT_COMPILED_IN = -174, /* Feature not compiled in */
105 UNICODE_SIZE_E = -175, /* Unicode password too big */
106 NO_PASSWORD = -176, /* no password provided by user */
107 ALT_NAME_E = -177, /* alt name size problem, too big */
108 BAD_OCSP_RESPONDER = -178, /* missing key usage extensions */
109 CRL_CERT_DATE_ERR = -179, /* CRL date error */
110
111 AES_GCM_AUTH_E = -180, /* AES-GCM Authentication check failure */
112 AES_CCM_AUTH_E = -181, /* AES-CCM Authentication check failure */
113
114 ASYNC_INIT_E = -182, /* Async Init type error */
115
116 COMPRESS_INIT_E = -183, /* Compress init error */
117 COMPRESS_E = -184, /* Compress error */
118 DECOMPRESS_INIT_E = -185, /* DeCompress init error */
119 DECOMPRESS_E = -186, /* DeCompress error */
120
121 BAD_ALIGN_E = -187, /* Bad alignment for operation, no alloc */
122 ASN_NO_SIGNER_E = -188, /* ASN no signer to confirm failure */
123 ASN_CRL_CONFIRM_E = -189, /* ASN CRL signature confirm failure */
124 ASN_CRL_NO_SIGNER_E = -190, /* ASN CRL no signer to confirm failure */
125 ASN_OCSP_CONFIRM_E = -191, /* ASN OCSP signature confirm failure */
126
127 BAD_STATE_E = -192, /* Bad state operation */
128 BAD_PADDING_E = -193, /* Bad padding, msg not correct length */
129
130 REQ_ATTRIBUTE_E = -194, /* setting cert request attributes error */
131
132 PKCS7_OID_E = -195, /* PKCS#7, mismatched OID error */
133 PKCS7_RECIP_E = -196, /* PKCS#7, recipient error */
134 FIPS_NOT_ALLOWED_E = -197, /* FIPS not allowed error */
135 ASN_NAME_INVALID_E = -198, /* ASN name constraint error */
136
137 RNG_FAILURE_E = -199, /* RNG Failed, Reinitialize */
138 HMAC_MIN_KEYLEN_E = -200, /* FIPS Mode HMAC Minimum Key Length error */
139 RSA_PAD_E = -201, /* RSA Padding Error */
140 LENGTH_ONLY_E = -202, /* Returning output length only */
141
142 IN_CORE_FIPS_E = -203, /* In Core Integrity check failure */
143 AES_KAT_FIPS_E = -204, /* AES KAT failure */
144 DES3_KAT_FIPS_E = -205, /* DES3 KAT failure */
145 HMAC_KAT_FIPS_E = -206, /* HMAC KAT failure */
146 RSA_KAT_FIPS_E = -207, /* RSA KAT failure */
147 DRBG_KAT_FIPS_E = -208, /* HASH DRBG KAT failure */
148 DRBG_CONT_FIPS_E = -209, /* HASH DRBG Continuous test failure */
149 AESGCM_KAT_FIPS_E = -210, /* AESGCM KAT failure */
150 THREAD_STORE_KEY_E = -211, /* Thread local storage key create failure */
151 THREAD_STORE_SET_E = -212, /* Thread local storage key set failure */
152
153 MAC_CMP_FAILED_E = -213, /* MAC comparison failed */
154 IS_POINT_E = -214, /* ECC is point on curve failed */
155 ECC_INF_E = -215, /* ECC point infinity error */
156 ECC_PRIV_KEY_E = -216, /* ECC private key not valid error */
157 ECC_OUT_OF_RANGE_E = -217, /* ECC key component out of range */
158
159 SRP_CALL_ORDER_E = -218, /* SRP function called in the wrong order. */
160 SRP_VERIFY_E = -219, /* SRP proof verification failed. */
161 SRP_BAD_KEY_E = -220, /* SRP bad ephemeral values. */
162
163 ASN_NO_SKID = -221, /* ASN no Subject Key Identifier found */
164 ASN_NO_AKID = -222, /* ASN no Authority Key Identifier found */
165 ASN_NO_KEYUSAGE = -223, /* ASN no Key Usage found */
166 SKID_E = -224, /* setting Subject Key Identifier error */
167 AKID_E = -225, /* setting Authority Key Identifier error */
168 KEYUSAGE_E = -226, /* Bad Key Usage value */
169 CERTPOLICIES_E = -227, /* setting Certificate Policies error */
170
171 WC_INIT_E = -228, /* wolfcrypt failed to initialize */
172 SIG_VERIFY_E = -229, /* wolfcrypt signature verify error */
173 BAD_COND_E = -230, /* Bad condition variable operation */

NetBurner, Inc.
1514 File Documentation

174 SIG_TYPE_E = -231, /* Signature Type not enabled/available */


175 HASH_TYPE_E = -232, /* Hash Type not enabled/available */
176
177 WC_KEY_SIZE_E = -234, /* Key size error, either too small or large */
178 ASN_COUNTRY_SIZE_E = -235, /* ASN Cert Gen, invalid country code size */
179 MISSING_RNG_E = -236, /* RNG required but not provided */
180 ASN_PATHLEN_SIZE_E = -237, /* ASN CA path length too large error */
181 ASN_PATHLEN_INV_E = -238, /* ASN CA path length inversion error */
182
183 BAD_KEYWRAP_ALG_E = -239,
184 BAD_KEYWRAP_IV_E = -240, /* Decrypted AES key wrap IV incorrect */
185 WC_CLEANUP_E = -241, /* wolfcrypt cleanup failed */
186 ECC_CDH_KAT_FIPS_E = -242, /* ECC CDH Known Answer Test failure */
187 DH_CHECK_PUB_E = -243, /* DH Check Pub Key error */
188 BAD_PATH_ERROR = -244, /* Bad path for opendir */
189
190 ASYNC_OP_E = -245, /* Async operation error */
191
192 ECC_PRIVATEONLY_E = -246, /* Invalid use of private only ECC key*/
193 EXTKEYUSAGE_E = -247, /* Bad Extended Key Usage value */
194 WC_HW_E = -248, /* Error with hardware crypto use */
195 WC_HW_WAIT_E = -249, /* Hardware waiting on resource */
196
197 PSS_SALTLEN_E = -250, /* PSS length of salt is too long for hash */
198 PRIME_GEN_E = -251, /* Failure finding a prime. */
199 BER_INDEF_E = -252, /* Cannot decode indefinite length BER. */
200 RSA_OUT_OF_RANGE_E = -253, /* Ciphertext to decrypt out of range. */
201 RSAPSS_PAT_FIPS_E = -254, /* RSA-PSS PAT failure */
202 ECDSA_PAT_FIPS_E = -255, /* ECDSA PAT failure */
203 DH_KAT_FIPS_E = -256, /* DH KAT failure */
204 AESCCM_KAT_FIPS_E = -257, /* AESCCM KAT failure */
205 SHA3_KAT_FIPS_E = -258, /* SHA-3 KAT failure */
206 ECDHE_KAT_FIPS_E = -259, /* ECDHE KAT failure */
207 AES_GCM_OVERFLOW_E = -260, /* AES-GCM invocation counter overflow. */
208 AES_CCM_OVERFLOW_E = -261, /* AES-CCM invocation counter overflow. */
209 RSA_KEY_PAIR_E = -262, /* RSA Key Pair-Wise Consistency check fail. */
210 DH_CHECK_PRIV_E = -263, /* DH Check Priv Key error */
211
212 WC_AFALG_SOCK_E = -264, /* AF_ALG socket error */
213 WC_DEVCRYPTO_E = -265, /* /dev/crypto error */
214
215 ZLIB_INIT_ERROR = -266, /* zlib init error */
216 ZLIB_COMPRESS_ERROR = -267, /* zlib compression error */
217 ZLIB_DECOMPRESS_ERROR = -268, /* zlib decompression error */
218
219 PKCS7_NO_SIGNER_E = -269, /* No signer in PKCS#7 signed data msg */
220 WC_PKCS7_WANT_READ_E= -270, /* PKCS7 operations wants more input */
221
222 CRYPTOCB_UNAVAILABLE= -271, /* Crypto callback unavailable */
223 PKCS7_SIGNEEDS_CHECK= -272, /* signature needs verified by caller */
224 PSS_SALTLEN_RECOVER_E=-273, /* PSS slat length not recoverable */
225 CHACHA_POLY_OVERFLOW =-274, /* ChaCha20Poly1305 limit overflow */
226 ASN_SELF_SIGNED_E = -275, /* ASN self-signed certificate error */
227 SAKKE_VERIFY_FAIL_E = -276, /* SAKKE derivation verification error */
228 MISSING_IV = -277, /* IV was not set */
229 MISSING_KEY = -278, /* Key was not set */
230 BAD_LENGTH_E = -279, /* Value of length parameter is invalid. */
231 ECDSA_KAT_FIPS_E = -280, /* ECDSA KAT failure */
232 RSA_PAT_FIPS_E = -281, /* RSA Pairwise failure */
233 KDF_TLS12_KAT_FIPS_E = -282, /* TLS12 KDF KAT failure */
234 KDF_TLS13_KAT_FIPS_E = -283, /* TLS13 KDF KAT failure */
235 KDF_SSH_KAT_FIPS_E = -284, /* SSH KDF KAT failure */
236 DHE_PCT_E = -285, /* DHE Pairwise Consistency Test failure */
237 ECC_PCT_E = -286, /* ECDHE Pairwise Consistency Test failure */
238 FIPS_PRIVATE_KEY_LOCKED_E = -287, /* Cannot export private key. */
239 PROTOCOLCB_UNAVAILABLE = -288, /* Protocol callback unavailable */
240 AES_SIV_AUTH_E = -289, /* AES-SIV authentication failed */
241 NO_VALID_DEVID = -290, /* no valid device ID */
242
243 IO_FAILED_E = -291, /* Input/output failure */
244 SYSLIB_FAILED_E = -292, /* System/library call failed */
245
246 WC_LAST_E = -292, /* Update this to indicate last error */
247 MIN_CODE_E = -300 /* errors -101 - -299 */
248
249 /* add new companion error id strings for any new error codes
250 wolfcrypt/src/error.c !!! */
251 };
252
253
254 #ifdef NO_ERROR_STRINGS
255 #define wc_GetErrorString(error) "no support for error strings built in"
256 #define wc_ErrorString(err, buf) \
257 (void)err; XSTRNCPY((buf), wc_GetErrorString((err)), \
258 WOLFSSL_MAX_ERROR_SZ);
259
260 #else

NetBurner, Inc.
22.337 falcon.h File Reference 1515

261 WOLFSSL_API void wc_ErrorString(int err, char* buff);


262 WOLFSSL_ABI WOLFSSL_API const char* wc_GetErrorString(int error);
263 #endif
264
265 #ifdef __cplusplus
266 } /* extern "C" */
267 #endif
268 #endif /* WOLF_CRYPT_ERROR_H */

22.337 falcon.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.338 falcon.h
Go to the documentation of this file.
1 /* falcon.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 /* Interfaces for Falcon NIST Level 1 (Falcon512) and Falcon NIST Level 5
17 * (Falcon1024). */
18
19 #ifndef WOLF_CRYPT_FALCON_H
20 #define WOLF_CRYPT_FALCON_H
21
22 #include <wolfssl/wolfcrypt/types.h>
23
24 #if defined(HAVE_PQC) && defined(HAVE_FALCON)
25
26 #ifdef HAVE_LIBOQS
27 #include <oqs/oqs.h>
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* Macros Definitions */
35
36 #ifdef HAVE_LIBOQS
37 #define FALCON_LEVEL1_KEY_SIZE OQS_SIG_falcon_512_length_secret_key
38 #define FALCON_LEVEL1_SIG_SIZE OQS_SIG_falcon_512_length_signature
39 #define FALCON_LEVEL1_PUB_KEY_SIZE OQS_SIG_falcon_512_length_public_key
40 #define FALCON_LEVEL1_PRV_KEY_SIZE (FALCON_LEVEL1_PUB_KEY_SIZE+FALCON_LEVEL1_KEY_SIZE)
41
42 #define FALCON_LEVEL5_KEY_SIZE OQS_SIG_falcon_1024_length_secret_key
43 #define FALCON_LEVEL5_SIG_SIZE OQS_SIG_falcon_1024_length_signature
44 #define FALCON_LEVEL5_PUB_KEY_SIZE OQS_SIG_falcon_1024_length_public_key
45 #define FALCON_LEVEL5_PRV_KEY_SIZE (FALCON_LEVEL5_PUB_KEY_SIZE+FALCON_LEVEL5_KEY_SIZE)
46 #endif
47
48 #define FALCON_MAX_KEY_SIZE FALCON_LEVEL5_PRV_KEY_SIZE
49 #define FALCON_MAX_SIG_SIZE FALCON_LEVEL5_SIG_SIZE
50 #define FALCON_MAX_PUB_KEY_SIZE FALCON_LEVEL5_PUB_KEY_SIZE
51 #define FALCON_MAX_PRV_KEY_SIZE FALCON_LEVEL5_PRV_KEY_SIZE
52
53 /* Structs */
54
55 struct falcon_key {
56 bool pubKeySet;
57 bool prvKeySet;
58 byte level;
59 byte p[FALCON_MAX_PUB_KEY_SIZE];
60 byte k[FALCON_MAX_PRV_KEY_SIZE];
61 };
62
63 #ifndef WC_FALCONKEY_TYPE_DEFINED
64 typedef struct falcon_key falcon_key;
65 #define WC_FALCONKEY_TYPE_DEFINED
66 #endif
67

NetBurner, Inc.
1516 File Documentation

68 /* Functions */
69
70 WOLFSSL_API
71 int wc_falcon_sign_msg(const byte* in, word32 inLen, byte* out, word32 *outLen,
72 falcon_key* key);
73 WOLFSSL_API
74 int wc_falcon_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
75 word32 msgLen, int* res, falcon_key* key);
76
77 WOLFSSL_API
78 int wc_falcon_init(falcon_key* key);
79 WOLFSSL_API
80 int wc_falcon_set_level(falcon_key* key, byte level);
81 WOLFSSL_API
82 int wc_falcon_get_level(falcon_key* key, byte* level);
83 WOLFSSL_API
84 void wc_falcon_free(falcon_key* key);
85
86 WOLFSSL_API
87 int wc_falcon_import_public(const byte* in, word32 inLen, falcon_key* key);
88 WOLFSSL_API
89 int wc_falcon_import_private_only(const byte* priv, word32 privSz,
90 falcon_key* key);
91 WOLFSSL_API
92 int wc_falcon_import_private_key(const byte* priv, word32 privSz,
93 const byte* pub, word32 pubSz,
94 falcon_key* key);
95
96 WOLFSSL_API
97 int wc_falcon_export_public(falcon_key*, byte* out, word32* outLen);
98 WOLFSSL_API
99 int wc_falcon_export_private_only(falcon_key* key, byte* out, word32* outLen);
100 WOLFSSL_API
101 int wc_falcon_export_private(falcon_key* key, byte* out, word32* outLen);
102 WOLFSSL_API
103 int wc_falcon_export_key(falcon_key* key, byte* priv, word32 *privSz,
104 byte* pub, word32 *pubSz);
105
106 WOLFSSL_API
107 int wc_falcon_check_key(falcon_key* key);
108
109 WOLFSSL_API
110 int wc_falcon_size(falcon_key* key);
111 WOLFSSL_API
112 int wc_falcon_priv_size(falcon_key* key);
113 WOLFSSL_API
114 int wc_falcon_pub_size(falcon_key* key);
115 WOLFSSL_API
116 int wc_falcon_sig_size(falcon_key* key);
117
118 #ifdef __cplusplus
119 } /* extern "C" */
120 #endif
121
122 #endif /* HAVE_PQC && HAVE_FALCON */
123 #endif /* WOLF_CRYPT_FALCON_H */

22.339 fe_448.h
1 /* fe448_448.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLF_CRYPT_FE_448_H
14 #define WOLF_CRYPT_FE_448_H
15
16 #include <wolfssl/wolfcrypt/settings.h>
17
18 #if defined(HAVE_CURVE448) || defined(HAVE_ED448)
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #if defined(HAVE___UINT128_T) && !defined(NO_CURVED448_128BIT)
23 #define CURVED448_128BIT
24 #endif
25
26 #ifdef __cplusplus

NetBurner, Inc.
22.339 fe_448.h 1517

27 extern "C" {
28 #endif
29
30 /* default to be faster but take more memory */
31 #if !defined(CURVE448_SMALL) && !defined(ED448_SMALL)
32
33 #if defined(CURVED448_128BIT)
34 typedef sword64 fe448;
35 #ifndef WOLFSSL_UINT128_T_DEFINED
36 #ifdef __SIZEOF_INT128__
37 typedef __uint128_t uint128_t;
38 typedef __int128_t int128_t;
39 typedef __uint128_t word128;
40 typedef __int128_t sword128;
41 #else
42 typedef unsigned long uint128_t __attribute__ ((mode(TI)));
43 typedef long int128_t __attribute__ ((mode(TI)));
44 typedef uint128_t word128;
45 typedef int128_t sword128;
46 #endif
47 #define WOLFSSL_UINT128_T_DEFINED
48 #endif
49 #else
50 typedef sword32 fe448;
51 #endif
52
53 WOLFSSL_LOCAL void fe448_init(void);
54 WOLFSSL_LOCAL int curve448(byte* r, const byte* n, const byte* a);
55
56 #if !defined(CURVED448_128BIT)
57 WOLFSSL_LOCAL void fe448_reduce(fe448*);
58 #else
59 #define fe448_reduce(a)
60 #endif
61 WOLFSSL_LOCAL void fe448_neg(fe448* r, const fe448* a);
62 WOLFSSL_LOCAL void fe448_add(fe448* r, const fe448* a, const fe448* b);
63 WOLFSSL_LOCAL void fe448_sub(fe448* r, const fe448* a, const fe448* b);
64 WOLFSSL_LOCAL void fe448_mul(fe448* r, const fe448* a, const fe448* b);
65 WOLFSSL_LOCAL void fe448_sqr(fe448* r, const fe448* a);
66 WOLFSSL_LOCAL void fe448_mul39081(fe448* r, const fe448* a);
67 WOLFSSL_LOCAL void fe448_invert(fe448* r, const fe448* a);
68
69 WOLFSSL_LOCAL void fe448_0(fe448* a);
70 WOLFSSL_LOCAL void fe448_1(fe448* a);
71 WOLFSSL_LOCAL void fe448_copy(fe448* d, const fe448* a);
72 WOLFSSL_LOCAL int fe448_isnonzero(const fe448* a);
73 WOLFSSL_LOCAL int fe448_isnegative(const fe448* a);
74
75 WOLFSSL_LOCAL void fe448_from_bytes(fe448* r, const unsigned char* b);
76 WOLFSSL_LOCAL void fe448_to_bytes(unsigned char* b, const fe448* a);
77
78 WOLFSSL_LOCAL void fe448_cmov(fe448* a, const fe448* b, int c);
79 WOLFSSL_LOCAL void fe448_pow_2_446_222_1(fe448* r, const fe448* a);
80
81 #else
82
83 WOLFSSL_LOCAL void fe448_init(void);
84 WOLFSSL_LOCAL int curve448(byte* r, const byte* n, const byte* a);
85
86 #define fe448_reduce(a)
87
88 WOLFSSL_LOCAL void fe448_neg(word8* r, const word8* a);
89 WOLFSSL_LOCAL void fe448_add(word8* r, const word8* a, const word8* b);
90 WOLFSSL_LOCAL void fe448_sub(word8* r, const word8* a, const word8* b);
91 WOLFSSL_LOCAL void fe448_mul(word8* r, const word8* a, const word8* b);
92 WOLFSSL_LOCAL void fe448_sqr(word8* r, const word8* a);
93 WOLFSSL_LOCAL void fe448_mul39081(word8* r, const word8* a);
94 WOLFSSL_LOCAL void fe448_invert(word8* r, const word8* a);
95
96 WOLFSSL_LOCAL void fe448_norm(byte *a);
97 WOLFSSL_LOCAL void fe448_copy(word8* d, const word8* a);
98 WOLFSSL_LOCAL int fe448_isnonzero(const word8* a);
99
100 WOLFSSL_LOCAL void fe448_cmov(word8* a, const word8* b, int c);
101 WOLFSSL_LOCAL void fe448_pow_2_446_222_1(word8* r, const word8* a);
102
103 #endif /* !CURVE448_SMALL || !ED448_SMALL */
104
105 #ifdef __cplusplus
106 } /* extern "C" */
107 #endif
108
109 #endif /* HAVE_CURVE448 || HAVE_ED448 */
110
111 #endif /* WOLF_CRYPT_FE_448_H */

NetBurner, Inc.
1518 File Documentation

22.340 fe_operations.h
1 /* fe_operations.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLF_CRYPT_FE_OPERATIONS_H
14 #define WOLF_CRYPT_FE_OPERATIONS_H
15
16 #include <wolfssl/wolfcrypt/settings.h>
17
18 #if defined(HAVE_CURVE25519) || defined(HAVE_ED25519)
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #if defined(USE_INTEL_SPEEDUP) && !defined(NO_CURVED25519_X64)
23 #define CURVED25519_X64
24 #elif defined(HAVE___UINT128_T) && !defined(NO_CURVED25519_128BIT)
25 #define CURVED25519_128BIT
26 #endif
27
28 #if defined(CURVED25519_X64)
29 #define CURVED25519_ASM_64BIT
30 #define CURVED25519_ASM
31 #endif
32 #if defined(WOLFSSL_ARMASM)
33 #ifdef __aarch64__
34 #define CURVED25519_ASM_64BIT
35 #else
36 #define CURVED25519_ASM_32BIT
37 #endif
38 #define CURVED25519_ASM
39 #endif
40
41 /*
42 fe means field element.
43 Here the field is \Z/(2^255-19).
44 An element t, entries t[0]...t[9], represents the integer
45 t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
46 Bounds on each t[i] vary depending on context.
47 */
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
53 #if defined(CURVE25519_SMALL) || defined(ED25519_SMALL)
54 #define F25519_SIZE 32
55
56 WOLFSSL_LOCAL void lm_copy(byte*, const byte*);
57 WOLFSSL_LOCAL void lm_add(byte*, const byte*, const byte*);
58 WOLFSSL_LOCAL void lm_sub(byte*, const byte*, const byte*);
59 WOLFSSL_LOCAL void lm_neg(byte*,const byte*);
60 WOLFSSL_LOCAL void lm_invert(byte*, const byte*);
61 WOLFSSL_LOCAL void lm_mul(byte*,const byte*,const byte*);
62 #endif
63
64
65 #if !defined(FREESCALE_LTC_ECC)
66 WOLFSSL_LOCAL void fe_init(void);
67
68 WOLFSSL_LOCAL int curve25519(byte * q, const byte * n, const byte * p);
69 #endif
70
71 /* default to be faster but take more memory */
72 #if !defined(CURVE25519_SMALL) || !defined(ED25519_SMALL)
73
74 #ifdef CURVED25519_ASM_64BIT
75 typedef sword64 fe[4];
76 #elif defined(CURVED25519_ASM_32BIT)
77 typedef sword32 fe[8];
78 #elif defined(CURVED25519_128BIT)
79 typedef sword64 fe[5];
80 #else
81 typedef sword32 fe[10];
82 #endif
83
84 WOLFSSL_LOCAL void fe_copy(fe h,const fe f);
85 WOLFSSL_LOCAL void fe_add(fe h,const fe f,const fe g);

NetBurner, Inc.
22.340 fe_operations.h 1519

86 WOLFSSL_LOCAL void fe_neg(fe h,const fe f);


87 WOLFSSL_LOCAL void fe_sub(fe h,const fe f,const fe g);
88 WOLFSSL_LOCAL void fe_invert(fe out,const fe z);
89 WOLFSSL_LOCAL void fe_mul(fe h,const fe f,const fe g);
90
91
92 /* Based On Daniel J Bernstein’s curve25519 and ed25519 Public Domain ref10
93 work. */
94
95 WOLFSSL_LOCAL void fe_0(fe h);
96 WOLFSSL_LOCAL void fe_1(fe h);
97 WOLFSSL_LOCAL int fe_isnonzero(const fe f);
98 WOLFSSL_LOCAL int fe_isnegative(const fe f);
99 WOLFSSL_LOCAL void fe_tobytes(unsigned char *s,const fe h);
100 WOLFSSL_LOCAL void fe_sq(fe h,const fe f);
101 WOLFSSL_LOCAL void fe_sq2(fe h,const fe f);
102 WOLFSSL_LOCAL void fe_frombytes(fe h,const unsigned char *s);
103 WOLFSSL_LOCAL void fe_cswap(fe f, fe g, int b);
104 WOLFSSL_LOCAL void fe_mul121666(fe h,fe f);
105 WOLFSSL_LOCAL void fe_cmov(fe f, const fe g, int b);
106 WOLFSSL_LOCAL void fe_pow22523(fe out,const fe z);
107
108 /* 64 type needed for SHA512 */
109 WOLFSSL_LOCAL word64 load_3(const unsigned char *in);
110 WOLFSSL_LOCAL word64 load_4(const unsigned char *in);
111
112 #ifdef CURVED25519_ASM
113 WOLFSSL_LOCAL void fe_ge_to_p2(fe rx, fe ry, fe rz, const fe px, const fe py,
114 const fe pz, const fe pt);
115 WOLFSSL_LOCAL void fe_ge_to_p3(fe rx, fe ry, fe rz, fe rt, const fe px,
116 const fe py, const fe pz, const fe pt);
117 WOLFSSL_LOCAL void fe_ge_dbl(fe rx, fe ry, fe rz, fe rt, const fe px,
118 const fe py, const fe pz);
119 WOLFSSL_LOCAL void fe_ge_madd(fe rx, fe ry, fe rz, fe rt, const fe px,
120 const fe py, const fe pz, const fe pt,
121 const fe qxy2d, const fe qyplusx,
122 const fe qyminusx);
123 WOLFSSL_LOCAL void fe_ge_msub(fe rx, fe ry, fe rz, fe rt, const fe px,
124 const fe py, const fe pz, const fe pt,
125 const fe qxy2d, const fe qyplusx,
126 const fe qyminusx);
127 WOLFSSL_LOCAL void fe_ge_add(fe rx, fe ry, fe rz, fe rt, const fe px,
128 const fe py, const fe pz, const fe pt, const fe qz,
129 const fe qt2d, const fe qyplusx,
130 const fe qyminusx);
131 WOLFSSL_LOCAL void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px,
132 const fe py, const fe pz, const fe pt, const fe qz,
133 const fe qt2d, const fe qyplusx,
134 const fe qyminusx);
135 WOLFSSL_LOCAL void fe_cmov_table(fe* r, fe* base, signed char b);
136 #endif /* CURVED25519_ASM */
137 #endif /* !CURVE25519_SMALL || !ED25519_SMALL */
138
139 /* Use less memory and only 32bit types or less, but is slower
140 Based on Daniel Beer’s public domain work. */
141 #if defined(CURVE25519_SMALL) || defined(ED25519_SMALL)
142 static const byte c25519_base_x[F25519_SIZE] = {9};
143 static const byte f25519_zero[F25519_SIZE] = {0};
144 static const byte f25519_one[F25519_SIZE] = {1};
145 static const byte fprime_zero[F25519_SIZE] = {0};
146 static const byte fprime_one[F25519_SIZE] = {1};
147
148 WOLFSSL_LOCAL void fe_load(byte *x, word32 c);
149 WOLFSSL_LOCAL void fe_normalize(byte *x);
150 WOLFSSL_LOCAL void fe_inv__distinct(byte *r, const byte *x);
151
152 /* Conditional copy. If condition == 0, then zero is copied to dst. If
153 * condition == 1, then one is copied to dst. Any other value results in
154 * undefined behavior.
155 */
156 WOLFSSL_LOCAL void fe_select(byte *dst, const byte *zero, const byte *one,
157 byte condition);
158
159 /* Multiply a point by a small constant. The two pointers are not
160 * required to be distinct.
161 *
162 * The constant must be less than 2^24.
163 */
164 WOLFSSL_LOCAL void fe_mul_c(byte *r, const byte *a, word32 b);
165 WOLFSSL_LOCAL void fe_mul__distinct(byte *r, const byte *a, const byte *b);
166
167 /* Compute one of the square roots of the field element, if the element
168 * is square. The other square is -r.
169 *
170 * If the input is not square, the returned value is a valid field
171 * element, but not the correct answer. If you don’t already know that
172 * your element is square, you should square the return value and test.

NetBurner, Inc.
1520 File Documentation

173 */
174 WOLFSSL_LOCAL void fe_sqrt(byte *r, const byte *x);
175
176 /* Conditional copy. If condition == 0, then zero is copied to dst. If
177 * condition == 1, then one is copied to dst. Any other value results in
178 * undefined behavior.
179 */
180 WOLFSSL_LOCAL void fprime_select(byte *dst, const byte *zero, const byte *one,
181 byte condition);
182 WOLFSSL_LOCAL void fprime_add(byte *r, const byte *a, const byte *modulus);
183 WOLFSSL_LOCAL void fprime_sub(byte *r, const byte *a, const byte *modulus);
184 WOLFSSL_LOCAL void fprime_mul(byte *r, const byte *a, const byte *b,
185 const byte *modulus);
186 WOLFSSL_LOCAL void fprime_copy(byte *x, const byte *a);
187
188 #endif /* CURVE25519_SMALL || ED25519_SMALL */
189
190 #ifdef __cplusplus
191 } /* extern "C" */
192 #endif
193
194 #endif /* HAVE_CURVE25519 || HAVE_ED25519 */
195
196 #endif /* WOLF_CRYPT_FE_OPERATIONS_H */

22.341 fips.h

22.342 fips_test.h
1 /* fips_test.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 #ifndef WOLF_CRYPT_FIPS_TEST_H
15 #define WOLF_CRYPT_FIPS_TEST_H
16
17 #include <wolfssl/wolfcrypt/types.h>
18
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /* Added for FIPS v5.3 or later */
25 #if defined(FIPS_VERSION_GE) && FIPS_VERSION_GE(5,3)
26 /* Determine FIPS in core hash type and size */
27 #ifndef NO_SHA256
28 #define FIPS_IN_CORE_DIGEST_SIZE 32
29 #define FIPS_IN_CORE_HASH_TYPE WC_SHA256
30 #define FIPS_IN_CORE_KEY_SZ 32
31 #define FIPS_IN_CORE_VERIFY_SZ FIPS_IN_CORE_KEY_SZ
32 #elif defined(WOLFSSL_SHA384)
33 #define FIPS_IN_CORE_DIGEST_SIZE 48
34 #define FIPS_IN_CORE_HASH_TYPE WC_SHA384
35 #define FIPS_IN_CORE_KEY_SZ 48
36 #define FIPS_IN_CORE_VERIFY_SZ FIPS_IN_CORE_KEY_SZ
37 #else
38 #error No FIPS hash (SHA2-256 or SHA2-384)
39 #endif
40 #endif /* FIPS v5.3 or later */
41
42
43 enum FipsCastId {
44 FIPS_CAST_AES_CBC,
45 FIPS_CAST_AES_GCM,
46 FIPS_CAST_HMAC_SHA1,
47 FIPS_CAST_HMAC_SHA2_256,
48 FIPS_CAST_HMAC_SHA2_512,
49 FIPS_CAST_HMAC_SHA3_256,
50 FIPS_CAST_DRBG,
51 FIPS_CAST_RSA_SIGN_PKCS1v15,
52 FIPS_CAST_ECC_CDH,
53 FIPS_CAST_ECC_PRIMITIVE_Z,
54 FIPS_CAST_DH_PRIMITIVE_Z,

NetBurner, Inc.
22.343 ge_448.h 1521

55 FIPS_CAST_ECDSA,
56 FIPS_CAST_KDF_TLS12,
57 FIPS_CAST_KDF_TLS13,
58 FIPS_CAST_KDF_SSH,
59 FIPS_CAST_COUNT
60 };
61
62 enum FipsCastStateId {
63 FIPS_CAST_STATE_INIT,
64 FIPS_CAST_STATE_PROCESSING,
65 FIPS_CAST_STATE_SUCCESS,
66 FIPS_CAST_STATE_FAILURE
67 };
68
69 enum FipsModeId {
70 FIPS_MODE_INIT,
71 FIPS_MODE_NORMAL,
72 FIPS_MODE_DEGRADED,
73 FIPS_MODE_FAILED
74 };
75
76
77 /* FIPS failure callback */
78 typedef void(*wolfCrypt_fips_cb)(int ok, int err, const char* hash);
79
80 /* Public set function */
81 WOLFSSL_API int wolfCrypt_SetCb_fips(wolfCrypt_fips_cb cbf);
82
83 /* Public get status functions */
84 WOLFSSL_API int wolfCrypt_GetStatus_fips(void);
85 WOLFSSL_API const char* wolfCrypt_GetCoreHash_fips(void);
86
87 #ifdef HAVE_FORCE_FIPS_FAILURE
88 /* Public function to force failure mode for operational testing */
89 WOLFSSL_API int wolfCrypt_SetStatus_fips(int status);
90 #endif
91
92 WOLFSSL_LOCAL int DoPOST(char* base16_hash, int base16_hashSz);
93 WOLFSSL_LOCAL int DoCAST(int type);
94 WOLFSSL_LOCAL int DoKnownAnswerTests(char* base16_hash, int base16_hashSz); /* FIPSv1 and FIPSv2 */
95
96 WOLFSSL_API int wc_RunCast_fips(int type);
97 WOLFSSL_API int wc_GetCastStatus_fips(int type);
98
99 #ifdef __cplusplus
100 } /* extern "C" */
101 #endif
102
103 #endif /* WOLF_CRYPT_FIPS_TEST_H */
104

22.343 ge_448.h
1 /* ge_448.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLF_CRYPT_GE_448_H
14 #define WOLF_CRYPT_GE_448_H
15
16 #include <wolfssl/wolfcrypt/settings.h>
17
18 #ifdef HAVE_ED448
19
20 #include <wolfssl/wolfcrypt/fe_448.h>
21
22 /*
23 ge448 means group element.
24
25 Here the group is the set of pairs (x,y) of field elements (see fe.h)
26 satisfying -x^2 + y^2 = 1 + d x^2y^2
27 where d = -39081.
28
29 Representations:
30 ge448_p2 (projective) : (X:Y:Z) satisfying x=X/Z, y=Y/Z
31 ge448_precomp (affine): (x,y)
32 */

NetBurner, Inc.
1522 File Documentation

33
34 #ifdef ED448_SMALL
35 typedef byte ge448;
36 #define GE448_WORDS 56
37 #elif defined(CURVED448_128BIT)
38 typedef sword64 ge448;
39 #define GE448_WORDS 8
40 #else
41 typedef sword32 ge448;
42 #define GE448_WORDS 16
43 #endif
44
45 typedef struct {
46 ge448 X[GE448_WORDS];
47 ge448 Y[GE448_WORDS];
48 ge448 Z[GE448_WORDS];
49 } ge448_p2;
50
51
52 WOLFSSL_LOCAL int ge448_compress_key(byte* out, const byte* xIn, const byte* yIn);
53 WOLFSSL_LOCAL int ge448_from_bytes_negate_vartime(ge448_p2 *r, const byte *b);
54
55 WOLFSSL_LOCAL int ge448_double_scalarmult_vartime(ge448_p2 *r, const byte *a,
56 const ge448_p2 *A, const byte *b);
57 WOLFSSL_LOCAL void ge448_scalarmult_base(ge448_p2* h, const byte* a);
58 WOLFSSL_LOCAL void sc448_reduce(byte* b);
59 WOLFSSL_LOCAL void sc448_muladd(byte* r, const byte* a, const byte* b, const byte* d);
60 WOLFSSL_LOCAL void ge448_to_bytes(byte *s, const ge448_p2 *h);
61
62
63 #ifndef ED448_SMALL
64 typedef struct {
65 ge448 x[GE448_WORDS];
66 ge448 y[GE448_WORDS];
67 } ge448_precomp;
68
69 #endif /* !ED448_SMALL */
70
71 #endif /* HAVE_ED448 */
72
73 #endif /* WOLF_CRYPT_GE_448_H */

22.344 ge_operations.h
1 /* ge_operations.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 /* Based On Daniel J Bernstein’s ed25519 Public Domain ref10 work. */
14
15 #ifndef WOLF_CRYPT_GE_OPERATIONS_H
16 #define WOLF_CRYPT_GE_OPERATIONS_H
17
18 #include <wolfssl/wolfcrypt/settings.h>
19
20 #ifdef HAVE_ED25519
21
22 #include <wolfssl/wolfcrypt/fe_operations.h>
23
24 /*
25 ge means group element.
26
27 Here the group is the set of pairs (x,y) of field elements (see fe.h)
28 satisfying -x^2 + y^2 = 1 + d x^2y^2
29 where d = -121665/121666.
30
31 Representations:
32 ge_p2 (projective): (X:Y:Z) satisfying x=X/Z, y=Y/Z
33 ge_p3 (extended): (X:Y:Z:T) satisfying x=X/Z, y=Y/Z, XY=ZT
34 ge_p1p1 (completed): ((X:Z),(Y:T)) satisfying x=X/Z, y=Y/T
35 ge_precomp (Duif): (y+x,y-x,2dxy)
36 */
37
38 #ifdef ED25519_SMALL
39 typedef byte ge[F25519_SIZE];
40 #elif defined(CURVED25519_ASM_64BIT)
41 typedef sword64 ge[4];

NetBurner, Inc.
22.345 hc128.h File Reference 1523

42 #elif defined(CURVED25519_ASM_32BIT)
43 typedef sword32 ge[8];
44 #elif defined(CURVED25519_128BIT)
45 typedef sword64 ge[5];
46 #else
47 typedef sword32 ge[10];
48 #endif
49
50 typedef struct {
51 ge X;
52 ge Y;
53 ge Z;
54 } ge_p2;
55
56 typedef struct {
57 ge X;
58 ge Y;
59 ge Z;
60 ge T;
61 } ge_p3;
62
63
64 WOLFSSL_LOCAL int ge_compress_key(byte* out, const byte* xIn, const byte* yIn,
65 word32 keySz);
66 WOLFSSL_LOCAL int ge_frombytes_negate_vartime(ge_p3 *h,const unsigned char *s);
67
68 WOLFSSL_LOCAL int ge_double_scalarmult_vartime(ge_p2 *r, const unsigned char *a,
69 const ge_p3 *A, const unsigned char *b);
70 WOLFSSL_LOCAL void ge_scalarmult_base(ge_p3 *h,const unsigned char *a);
71 WOLFSSL_LOCAL void sc_reduce(byte* s);
72 WOLFSSL_LOCAL void sc_muladd(byte* s, const byte* a, const byte* b,
73 const byte* c);
74 WOLFSSL_LOCAL void ge_tobytes(unsigned char *s,const ge_p2 *h);
75 WOLFSSL_LOCAL void ge_p3_tobytes(unsigned char *s,const ge_p3 *h);
76
77
78 #ifndef ED25519_SMALL
79 typedef struct {
80 ge X;
81 ge Y;
82 ge Z;
83 ge T;
84 } ge_p1p1;
85
86 typedef struct {
87 ge yplusx;
88 ge yminusx;
89 ge xy2d;
90 } ge_precomp;
91
92 typedef struct {
93 ge YplusX;
94 ge YminusX;
95 ge Z;
96 ge T2d;
97 } ge_cached;
98
99 #endif /* !ED25519_SMALL */
100
101 #endif /* HAVE_ED25519 */
102
103 #endif /* WOLF_CRYPT_GE_OPERATIONS_H */

22.345 hc128.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.346 hc128.h
Go to the documentation of this file.
1 /* hc128.h
2 *
3 * Copyright (C) 2006-2021 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com

NetBurner, Inc.
1524 File Documentation

10 */
11
17 #ifndef WOLF_CRYPT_HC128_H
18 #define WOLF_CRYPT_HC128_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #ifndef NO_HC128
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 enum {
29 HC128_ENC_TYPE = WC_CIPHER_HC128, /* cipher unique type */
30 };
31
32 /* HC-128 stream cipher */
33 typedef struct HC128 {
34 word32 T[1024]; /* P[i] = T[i]; Q[i] = T[1024 + i ]; */
35 word32 X[16];
36 word32 Y[16];
37 word32 counter1024; /* counter1024 = i mod 1024 at the ith step */
38 word32 key[8];
39 word32 iv[8];
40 #ifdef XSTREAM_ALIGN
41 void* heap; /* heap hint, currently XMALLOC only used with aligning */
42 #endif
43 } HC128;
44
45
46 WOLFSSL_API int wc_Hc128_Process(HC128*, byte*, const byte*, word32);
47 WOLFSSL_API int wc_Hc128_SetKey(HC128*, const byte* key, const byte* iv);
48
49 WOLFSSL_LOCAL int wc_Hc128_SetHeap(HC128* ctx, void* heap);
50
51 #ifdef __cplusplus
52 } /* extern "C" */
53 #endif
54
55 #endif /* HAVE_HC128 */
56 #endif /* WOLF_CRYPT_HC128_H */
57

22.347 idea.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.348 idea.h
Go to the documentation of this file.
1 /* idea.h
2 *
3 * Copyright (C) 2006-2021 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_IDEA_H
17 #define WOLF_CRYPT_IDEA_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef HAVE_IDEA
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 enum {
28 IDEA_MODULO = 0x10001, /* 2^16+1 */
29 IDEA_2EXP16 = 0x10000, /* 2^16 */
30 IDEA_MASK = 0xFFFF, /* 16 bits set to one */
31 IDEA_ROUNDS = 8, /* number of rounds for IDEA */
32 IDEA_SK_NUM = (6*IDEA_ROUNDS + 4), /* number of subkeys */

NetBurner, Inc.
22.349 integer.h 1525

33 IDEA_KEY_SIZE = 16, /* size of key in bytes */


34 IDEA_BLOCK_SIZE = 8, /* size of IDEA blocks in bytes */
35 IDEA_IV_SIZE = 8, /* size of IDEA IV in bytes */
36 IDEA_ENCRYPTION = 0,
37 IDEA_DECRYPTION = 1
38 };
39
40 /* IDEA encryption and decryption */
41 typedef struct Idea {
42 word32 reg[IDEA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
43 word32 tmp[IDEA_BLOCK_SIZE / sizeof(word32)]; /* for CBC mode */
44 word16 skey[IDEA_SK_NUM]; /* 832 bits expanded key */
45 } Idea;
46
47 WOLFSSL_API int wc_IdeaSetKey(Idea *idea, const byte* key, word16 keySz,
48 const byte *iv, int dir);
49 WOLFSSL_API int wc_IdeaSetIV(Idea *idea, const byte* iv);
50 WOLFSSL_API int wc_IdeaCipher(Idea *idea, byte* out, const byte* in);
51 WOLFSSL_API int wc_IdeaCbcEncrypt(Idea *idea, byte* out,
52 const byte* in, word32 len);
53 WOLFSSL_API int wc_IdeaCbcDecrypt(Idea *idea, byte* out,
54 const byte* in, word32 len);
55 #ifdef __cplusplus
56 } /* extern "C" */
57 #endif
58
59 #endif /* HAVE_IDEA */
60 #endif /* WOLF_CRYPT_IDEA_H */

22.349 integer.h
1 /* integer.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 /*
14 * Based on public domain LibTomMath 0.38 by Tom St Denis, [email protected],
15 * http://math.libtomcrypt.com
16 */
17
18
19 #ifndef WOLF_CRYPT_INTEGER_H
20 #define WOLF_CRYPT_INTEGER_H
21
22 /* may optionally use fast math instead, not yet supported on all platforms and
23 may not be faster on all
24 */
25 #include <wolfssl/wolfcrypt/types.h> /* will set MP_xxBIT if not default */
26 #if defined(WOLFSSL_SP_MATH) || defined(WOLFSSL_SP_MATH_ALL)
27 #include <wolfssl/wolfcrypt/sp_int.h>
28 #elif defined(USE_FAST_MATH)
29 #include <wolfssl/wolfcrypt/tfm.h>
30 #else
31
32 #include <wolfssl/wolfcrypt/random.h>
33
34 #ifndef CHAR_BIT
35 #if defined(WOLFSSL_LINUXKM)
36 #include <linux/limits.h>
37 #else
38 #include <limits.h>
39 #endif
40 #endif
41
42 #include <wolfssl/wolfcrypt/mpi_class.h>
43
44
45 #ifdef __cplusplus
46 extern "C" {
47
48 /* C++ compilers don’t like assigning void * to mp_digit * */
49 #define OPT_CAST(x) (x *)
50
51 #elif defined(_SH3)
52
53 /* SuperH SH3 compiler doesn’t like assigning voi* to mp_digit* */
54 #define OPT_CAST(x) (x *)

NetBurner, Inc.
1526 File Documentation

55
56 #else
57
58 /* C on the other hand doesn’t care */
59 #define OPT_CAST(x)
60
61 #endif /* __cplusplus */
62
63
64 /* detect 64-bit mode if possible */
65 #if (defined(__x86_64__) || defined(__aarch64__)) && !(defined (_MSC_VER) && defined(__clang__))
66 #if !(defined(MP_64BIT) && defined(MP_16BIT) && defined(MP_8BIT))
67 #define MP_64BIT
68 #endif
69 #endif
70 /* if intel compiler doesn’t provide 128 bit type don’t turn on 64bit */
71 #if defined(MP_64BIT) && defined(__INTEL_COMPILER) && !defined(HAVE___UINT128_T)
72 #undef MP_64BIT
73 #endif
74
75
76 /* allow user to define on mp_digit, mp_word, DIGIT_BIT types */
77 #ifndef WOLFSSL_BIGINT_TYPES
78
79 /* some default configurations.
80 *
81 * A "mp_digit" must be able to hold DIGIT_BIT + 1 bits
82 * A "mp_word" must be able to hold 2*DIGIT_BIT + 1 bits
83 *
84 * At the very least a mp_digit must be able to hold 7 bits
85 * [any size beyond that is ok provided it doesn’t overflow the data type]
86 */
87 #ifdef MP_8BIT
88 /* 8-bit */
89 typedef unsigned char mp_digit;
90 typedef unsigned short mp_word;
91 /* don’t define DIGIT_BIT, so its calculated below */
92 #elif defined(MP_16BIT)
93 /* 16-bit */
94 typedef unsigned int mp_digit;
95 typedef unsigned long mp_word;
96 /* don’t define DIGIT_BIT, so its calculated below */
97 #elif defined(NO_64BIT)
98 /* 32-bit forced to 16-bit */
99 typedef unsigned short mp_digit;
100 typedef unsigned int mp_word;
101 #define DIGIT_BIT 12
102 #elif defined(MP_64BIT)
103 /* 64-bit */
104 /* for GCC only on supported platforms */
105 typedef unsigned long long mp_digit; /* 64 bit type, 128 uses mode(TI) */
106 typedef unsigned long mp_word __attribute__ ((mode(TI)));
107 #define DIGIT_BIT 60
108 #else
109 /* 32-bit default case */
110
111 #if defined(_MSC_VER) || defined(__BORLANDC__)
112 typedef unsigned __int64 ulong64;
113 #else
114 typedef unsigned long long ulong64;
115 #endif
116
117 typedef unsigned int mp_digit; /* long could be 64 now, changed TAO */
118 typedef ulong64 mp_word;
119
120 #ifdef MP_31BIT
121 /* this is an extension that uses 31-bit digits */
122 #define DIGIT_BIT 31
123 #else
124 /* default case is 28-bit digits, defines MP_28BIT as a handy test macro */
125 #define DIGIT_BIT 28
126 #define MP_28BIT
127 #endif
128 #endif
129
130 #endif /* WOLFSSL_BIGINT_TYPES */
131
132 /* otherwise the bits per digit is calculated automatically from the size of
133 a mp_digit */
134 #ifndef DIGIT_BIT
135 #define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1)))
136 /* bits per digit */
137 #endif
138
139 #define MP_DIGIT_BIT DIGIT_BIT
140 #define MP_MASK ((((mp_digit)1)«((mp_digit)DIGIT_BIT))-((mp_digit)1))
141 #define MP_DIGIT_MAX MP_MASK

NetBurner, Inc.
22.349 integer.h 1527

142
143 /* equalities */
144 #define MP_LT (-1) /* less than */
145 #define MP_EQ 0 /* equal to */
146 #define MP_GT 1 /* greater than */
147
148 #define MP_ZPOS 0 /* positive integer */
149 #define MP_NEG 1 /* negative */
150
151 #define MP_OKAY 0 /* ok result */
152 #define MP_MEM (-2) /* out of mem */
153 #define MP_VAL (-3) /* invalid input */
154 #define MP_NOT_INF (-4) /* point not at infinity */
155 #define MP_RANGE MP_NOT_INF
156
157 #define MP_YES 1 /* yes response */
158 #define MP_NO 0 /* no response */
159
160 /* Primality generation flags */
161 #define LTM_PRIME_BBS 0x0001 /* BBS style prime */
162 #define LTM_PRIME_SAFE 0x0002 /* Safe prime (p-1)/2 == prime */
163 #define LTM_PRIME_2MSB_ON 0x0008 /* force 2nd MSB to 1 */
164
165 typedef int mp_err;
166
167 /* define this to use lower memory usage routines (exptmods mostly) */
168 #define MP_LOW_MEM
169
170 /* default precision */
171 #ifndef MP_PREC
172 #ifndef MP_LOW_MEM
173 #define MP_PREC 32 /* default digits of precision */
174 #else
175 #define MP_PREC 1 /* default digits of precision */
176 #endif
177 #endif
178
179 /* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD -
180 BITS_PER_DIGIT*2) */
181 #define MP_WARRAY ((mp_word)1 « (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
182
183 #ifdef HAVE_WOLF_BIGINT
184 /* raw big integer */
185 typedef struct WC_BIGINT {
186 byte* buf;
187 word32 len;
188 void* heap;
189 } WC_BIGINT;
190 #define WOLF_BIGINT_DEFINED
191 #endif
192
193 /* the mp_int structure */
194 typedef struct mp_int {
195 int used, alloc, sign;
196 mp_digit *dp;
197
198 #ifdef HAVE_WOLF_BIGINT
199 struct WC_BIGINT raw; /* unsigned binary (big endian) */
200 #endif
201 } mp_int;
202
203 /* wolf big int and common functions */
204 #include <wolfssl/wolfcrypt/wolfmath.h>
205
206
207 /* callback for mp_prime_random, should fill dst with random bytes and return
208 how many read [up to len] */
209 typedef int ltm_prime_callback(unsigned char *dst, int len, void *dat);
210
211
212 #define USED(m) ((m)->used)
213 #define DIGIT(m,k) ((m)->dp[(k)])
214 #define SIGN(m) ((m)->sign)
215
216
217 /* ---> Basic Manipulations <--- */
218 #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
219 #define mp_isone(a) \
220 (((((a)->used == 1)) && ((a)->dp[0] == 1u) && ((a)->sign == MP_ZPOS)) \
221 ? MP_YES : MP_NO)
222 #define mp_iseven(a) \
223 (((a)->used > 0 && (((a)->dp[0] & 1u) == 0u)) ? MP_YES : MP_NO)
224 #define mp_isodd(a) \
225 (((a)->used > 0 && (((a)->dp[0] & 1u) == 1u)) ? MP_YES : MP_NO)
226 #define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
227 #define mp_isword(a, w) \
228 ((((a)->used == 1) && ((a)->dp[0] == (w))) || (((w) == 0) && ((a)->used == 0)) \

NetBurner, Inc.
1528 File Documentation

229 ? MP_YES : MP_NO)


230
231 /* number of primes */
232 #ifdef MP_8BIT
233 #define PRIME_SIZE 31
234 #else
235 #define PRIME_SIZE 256
236 #endif
237
238 #ifndef MAX_INVMOD_SZ
239 #if defined(WOLFSSL_MYSQL_COMPATIBLE)
240 #define MAX_INVMOD_SZ 8192
241 #else
242 #define MAX_INVMOD_SZ 4096
243 #endif
244 #endif
245
246 #define mp_prime_random(a, t, size, bbs, cb, dat) \
247 mp_prime_random_ex(a, t, ((size) * 8) + 1, ((bbs)==1)?LTM_PRIME_BBS:0, cb, dat)
248
249 #define mp_read_mag(mp, str, len) mp_read_unsigned_bin((mp), (str), (len))
250 #define mp_mag_size(mp) mp_unsigned_bin_size(mp)
251 #define mp_tomag(mp, str) mp_to_unsigned_bin((mp), (str))
252
253 #define MP_RADIX_BIN 2
254 #define MP_RADIX_OCT 8
255 #define MP_RADIX_DEC 10
256 #define MP_RADIX_HEX 16
257 #define MP_RADIX_MAX 64
258
259 #define mp_tobinary(M, S) mp_toradix((M), (S), MP_RADIX_BIN)
260 #define mp_tooctal(M, S) mp_toradix((M), (S), MP_RADIX_OCT)
261 #define mp_todecimal(M, S) mp_toradix((M), (S), MP_RADIX_DEC)
262 #define mp_tohex(M, S) mp_toradix((M), (S), MP_RADIX_HEX)
263
264 #define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
265
266 #if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) || \
267 defined(WOLFSSL_DEBUG_MATH) || defined(DEBUG_WOLFSSL)
268 extern const char *mp_s_rmap;
269 #endif
270
271 /* 6 functions needed by Rsa */
272 MP_API int mp_init (mp_int * a);
273 MP_API void mp_clear (mp_int * a);
274 MP_API void mp_free (mp_int * a);
275 MP_API void mp_forcezero(mp_int * a);
276 MP_API int mp_unsigned_bin_size(const mp_int * a);
277 MP_API int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
278 MP_API int mp_to_unsigned_bin_at_pos(int x, mp_int *t, unsigned char *b);
279 MP_API int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
280 MP_API int mp_to_unsigned_bin_len(mp_int * a, unsigned char *b, int c);
281 MP_API int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y);
282 MP_API int mp_exptmod_ex (mp_int * G, mp_int * X, int digits, mp_int * P,
283 mp_int * Y);
284 /* end functions needed by Rsa */
285
286 /* functions added to support above needed, removed TOOM and KARATSUBA */
287 MP_API int mp_count_bits (const mp_int * a);
288 MP_API int mp_leading_bit (mp_int * a);
289 MP_API int mp_init_copy (mp_int * a, mp_int * b);
290 MP_API int mp_copy (const mp_int * a, mp_int * b);
291 MP_API int mp_grow (mp_int * a, int size);
292 MP_API int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d);
293 MP_API void mp_zero (mp_int * a);
294 MP_API void mp_clamp (mp_int * a);
295 MP_API int mp_exch (mp_int * a, mp_int * b);
296 MP_API int mp_cond_swap_ct (mp_int * a, mp_int * b, int c, int m);
297 MP_API void mp_rshd (mp_int * a, int b);
298 MP_API void mp_rshb (mp_int * a, int b);
299 MP_API int mp_mod_2d (mp_int * a, int b, mp_int * c);
300 MP_API int mp_mul_2d (mp_int * a, int b, mp_int * c);
301 MP_API int mp_lshd (mp_int * a, int b);
302 MP_API int mp_abs (mp_int * a, mp_int * b);
303 MP_API int mp_invmod (mp_int * a, mp_int * b, mp_int * c);
304 int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c);
305 MP_API int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c);
306 MP_API int mp_cmp_mag (mp_int * a, mp_int * b);
307 MP_API int mp_cmp (mp_int * a, mp_int * b);
308 MP_API int mp_cmp_d(mp_int * a, mp_digit b);
309 MP_API int mp_set (mp_int * a, mp_digit b);
310 MP_API int mp_is_bit_set (mp_int * a, mp_digit b);
311 MP_API int mp_mod (mp_int * a, mp_int * b, mp_int * c);
312 MP_API int mp_div(mp_int * a, mp_int * b, mp_int * c, mp_int * d);
313 MP_API int mp_div_2(mp_int * a, mp_int * b);
314 MP_API int mp_div_2_mod_ct (mp_int* a, mp_int* b, mp_int* c);
315 MP_API int mp_add (mp_int * a, mp_int * b, mp_int * c);

NetBurner, Inc.
22.349 integer.h 1529

316 int s_mp_add (mp_int * a, mp_int * b, mp_int * c);


317 int s_mp_sub (mp_int * a, mp_int * b, mp_int * c);
318 MP_API int mp_sub (mp_int * a, mp_int * b, mp_int * c);
319 MP_API int mp_reduce_is_2k_l(mp_int *a);
320 MP_API int mp_reduce_is_2k(mp_int *a);
321 MP_API int mp_dr_is_modulus(mp_int *a);
322 MP_API int mp_exptmod_fast (mp_int * G, mp_int * X, mp_int * P, mp_int * Y,
323 int redmode);
324 MP_API int mp_exptmod_base_2 (mp_int * X, mp_int * P, mp_int * Y);
325 #define mp_exptmod_nct(G,X,P,Y) mp_exptmod_fast(G,X,P,Y,0)
326 MP_API int mp_montgomery_setup (mp_int * n, mp_digit * rho);
327 int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
328 MP_API int mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho);
329 #define mp_montgomery_reduce_ex(x, n, rho, ct) mp_montgomery_reduce (x, n, rho)
330 MP_API void mp_dr_setup(mp_int *a, mp_digit *d);
331 MP_API int mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k);
332 MP_API int mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d);
333 int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
334 int s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
335 MP_API int mp_reduce_2k_setup_l(mp_int *a, mp_int *d);
336 MP_API int mp_reduce_2k_l(mp_int *a, mp_int *n, mp_int *d);
337 MP_API int mp_reduce (mp_int * x, mp_int * m, mp_int * mu);
338 MP_API int mp_reduce_setup (mp_int * a, mp_int * b);
339 int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int redmode);
340 MP_API int mp_montgomery_calc_normalization (mp_int * a, mp_int * b);
341 int s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
342 int s_mp_sqr (mp_int * a, mp_int * b);
343 int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs);
344 int fast_s_mp_sqr (mp_int * a, mp_int * b);
345 MP_API int mp_init_size (mp_int * a, int size);
346 MP_API int mp_div_3 (mp_int * a, mp_int *c, mp_digit * d);
347 MP_API int mp_mul_2(mp_int * a, mp_int * b);
348 MP_API int mp_mul (mp_int * a, mp_int * b, mp_int * c);
349 MP_API int mp_sqr (mp_int * a, mp_int * b);
350 MP_API int mp_mulmod (mp_int * a, mp_int * b, mp_int * c, mp_int * d);
351 MP_API int mp_submod (mp_int* a, mp_int* b, mp_int* c, mp_int* d);
352 MP_API int mp_addmod (mp_int* a, mp_int* b, mp_int* c, mp_int* d);
353 MP_API int mp_submod_ct (mp_int* a, mp_int* b, mp_int* c, mp_int* d);
354 MP_API int mp_addmod_ct (mp_int* a, mp_int* b, mp_int* c, mp_int* d);
355 MP_API int mp_mul_d (mp_int * a, mp_digit b, mp_int * c);
356 MP_API int mp_2expt (mp_int * a, int b);
357 MP_API int mp_set_bit (mp_int * a, int b);
358 MP_API int mp_reduce_2k_setup(mp_int *a, mp_digit *d);
359 MP_API int mp_add_d (mp_int* a, mp_digit b, mp_int* c);
360 MP_API int mp_set_int (mp_int * a, unsigned long b);
361 MP_API int mp_sub_d (mp_int * a, mp_digit b, mp_int * c);
362 /* end support added functions */
363
364 /* added */
365 MP_API int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e,
366 mp_int* f);
367 MP_API int mp_toradix (mp_int *a, char *str, int radix);
368 MP_API int mp_radix_size (mp_int * a, int radix, int *size);
369
370 #ifdef WOLFSSL_DEBUG_MATH
371 MP_API void mp_dump(const char* desc, mp_int* a, byte verbose);
372 #else
373 #define mp_dump(desc, a, verbose)
374 #endif
375
376 #if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN) || !defined(NO_RSA) || \
377 !defined(NO_DSA) || !defined(NO_DH)
378 MP_API int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
379 #endif
380 #if !defined(NO_DSA) || defined(HAVE_ECC)
381 MP_API int mp_read_radix(mp_int* a, const char* str, int radix);
382 #endif
383
384 #if defined(WOLFSSL_KEY_GEN) || !defined(NO_RSA) || !defined(NO_DSA) || !defined(NO_DH)
385 MP_API int mp_prime_is_prime (mp_int * a, int t, int *result);
386 MP_API int mp_prime_is_prime_ex (mp_int * a, int t, int *result, WC_RNG* rng);
387 #endif /* WOLFSSL_KEY_GEN NO_RSA NO_DSA NO_DH */
388 #ifdef WOLFSSL_KEY_GEN
389 MP_API int mp_gcd (mp_int * a, mp_int * b, mp_int * c);
390 MP_API int mp_lcm (mp_int * a, mp_int * b, mp_int * c);
391 MP_API int mp_rand_prime(mp_int* a, int len, WC_RNG* rng, void* heap);
392 #endif
393
394 MP_API int mp_cnt_lsb(mp_int *a);
395 MP_API int mp_mod_d(mp_int* a, mp_digit b, mp_digit* c);
396
397
398 #ifdef __cplusplus
399 }
400 #endif
401
402

NetBurner, Inc.
1530 File Documentation

403 #endif /* USE_FAST_MATH */


404
405 #endif /* WOLF_CRYPT_INTEGER_H */
406

22.350 logging.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.351 logging.h
Go to the documentation of this file.
1 /* logging.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 /* submitted by eof */
18
19
20 #ifndef WOLFSSL_LOGGING_H
21 #define WOLFSSL_LOGGING_H
22
23 #include <wolfssl/wolfcrypt/types.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29
30 enum wc_LogLevels {
31 ERROR_LOG = 0,
32 INFO_LOG,
33 ENTER_LOG,
34 LEAVE_LOG,
35 OTHER_LOG
36 };
37
38 #ifdef WOLFSSL_FUNC_TIME
39 /* WARNING: This code is only to be used for debugging performance.
40 * The code is not thread-safe.
41 * Do not use WOLFSSL_FUNC_TIME in production code.
42 */
43 enum wc_FuncNum {
44 WC_FUNC_HELLO_REQUEST_SEND = 0,
45 WC_FUNC_HELLO_REQUEST_DO,
46 WC_FUNC_CLIENT_HELLO_SEND,
47 WC_FUNC_CLIENT_HELLO_DO,
48 WC_FUNC_SERVER_HELLO_SEND,
49 WC_FUNC_SERVER_HELLO_DO,
50 WC_FUNC_ENCRYPTED_EXTENSIONS_SEND,
51 WC_FUNC_ENCRYPTED_EXTENSIONS_DO,
52 WC_FUNC_CERTIFICATE_REQUEST_SEND,
53 WC_FUNC_CERTIFICATE_REQUEST_DO,
54 WC_FUNC_CERTIFICATE_SEND,
55 WC_FUNC_CERTIFICATE_DO,
56 WC_FUNC_CERTIFICATE_VERIFY_SEND,
57 WC_FUNC_CERTIFICATE_VERIFY_DO,
58 WC_FUNC_FINISHED_SEND,
59 WC_FUNC_FINISHED_DO,
60 WC_FUNC_KEY_UPDATE_SEND,
61 WC_FUNC_KEY_UPDATE_DO,
62 WC_FUNC_EARLY_DATA_SEND,
63 WC_FUNC_EARLY_DATA_DO,
64 WC_FUNC_NEW_SESSION_TICKET_SEND,
65 WC_FUNC_NEW_SESSION_TICKET_DO,
66 WC_FUNC_SERVER_HELLO_DONE_SEND,
67 WC_FUNC_SERVER_HELLO_DONE_DO,
68 WC_FUNC_TICKET_SEND,
69 WC_FUNC_TICKET_DO,
70 WC_FUNC_CLIENT_KEY_EXCHANGE_SEND,
71 WC_FUNC_CLIENT_KEY_EXCHANGE_DO,
72 WC_FUNC_CERTIFICATE_STATUS_SEND,

NetBurner, Inc.
22.351 logging.h 1531

73 WC_FUNC_CERTIFICATE_STATUS_DO,
74 WC_FUNC_SERVER_KEY_EXCHANGE_SEND,
75 WC_FUNC_SERVER_KEY_EXCHANGE_DO,
76 WC_FUNC_END_OF_EARLY_DATA_SEND,
77 WC_FUNC_END_OF_EARLY_DATA_DO,
78 WC_FUNC_COUNT
79 };
80 #endif
81
82 typedef void (*wolfSSL_Logging_cb)(const int logLevel,
83 const char *const logMessage);
84
85 WOLFSSL_API int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);
86 WOLFSSL_API wolfSSL_Logging_cb wolfSSL_GetLoggingCb(void);
87
88 /* turn logging on, only if compiled in */
89 WOLFSSL_API int wolfSSL_Debugging_ON(void);
90 /* turn logging off */
91 WOLFSSL_API void wolfSSL_Debugging_OFF(void);
92
93 #ifdef HAVE_WC_INTROSPECTION
94 WOLFSSL_API const char *wolfSSL_configure_args(void);
95 WOLFSSL_API const char *wolfSSL_global_cflags(void);
96 #endif
97
98
99 #if (defined(OPENSSL_EXTRA) && !defined(_WIN32) && \
100 !defined(NO_ERROR_QUEUE)) || defined(DEBUG_WOLFSSL_VERBOSE)
101 #define WOLFSSL_HAVE_ERROR_QUEUE
102 #endif
103
104 #if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
105 WOLFSSL_LOCAL int wc_LoggingInit(void);
106 WOLFSSL_LOCAL int wc_LoggingCleanup(void);
107 WOLFSSL_LOCAL int wc_AddErrorNode(int error, int line, char* buf,
108 char* file);
109 WOLFSSL_LOCAL int wc_PeekErrorNode(int idx, const char **file,
110 const char **reason, int *line);
111 WOLFSSL_LOCAL void wc_RemoveErrorNode(int idx);
112 WOLFSSL_LOCAL void wc_ClearErrorNodes(void);
113 WOLFSSL_LOCAL int wc_PullErrorNode(const char **file, const char **reason,
114 int *line);
115 WOLFSSL_API int wc_SetLoggingHeap(void* h);
116 WOLFSSL_API int wc_ERR_remove_state(void);
117 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
118 WOLFSSL_API void wc_ERR_print_errors_fp(XFILE fp);
119 WOLFSSL_API void wc_ERR_print_errors_cb(int (*cb)(const char *str,
120 size_t len, void *u), void *u);
121 #endif
122 #endif /* OPENSSL_EXTRA || DEBUG_WOLFSSL_VERBOSE */
123
124 #ifdef WOLFSSL_FUNC_TIME
125 /* WARNING: This code is only to be used for debugging performance.
126 * The code is not thread-safe.
127 * Do not use WOLFSSL_FUNC_TIME in production code.
128 */
129 WOLFSSL_API void WOLFSSL_START(int funcNum);
130 WOLFSSL_API void WOLFSSL_END(int funcNum);
131 WOLFSSL_API void WOLFSSL_TIME(int count);
132 #else
133 #define WOLFSSL_START(n)
134 #define WOLFSSL_END(n)
135 #define WOLFSSL_TIME(n)
136 #endif
137
138 #if defined(DEBUG_WOLFSSL) && !defined(WOLFSSL_DEBUG_ERRORS_ONLY)
139 #if defined(_WIN32)
140 #if defined(INTIME_RTOS)
141 #define __func__ NULL
142 #else
143 #define __func__ __FUNCTION__
144 #endif
145 #endif
146
147 /* a is prepended to m and b is appended, creating a log msg a + m + b */
148 #define WOLFSSL_LOG_CAT(a, m, b) #a " " m " " #b
149
150 WOLFSSL_API void WOLFSSL_ENTER(const char* msg);
151 WOLFSSL_API void WOLFSSL_LEAVE(const char* msg, int ret);
152 #define WOLFSSL_STUB(m) \
153 WOLFSSL_MSG(WOLFSSL_LOG_CAT(wolfSSL Stub, m, not implemented))
154 WOLFSSL_API int WOLFSSL_IS_DEBUG_ON(void);
155 #if !defined(_WIN32) && defined(XVSNPRINTF)
156 WOLFSSL_API void WOLFSSL_MSG_EX(const char* fmt, ...);
157 #define HAVE_WOLFSSL_MSG_EX
158 #else
159 #define WOLFSSL_MSG_EX(m, ...)

NetBurner, Inc.
1532 File Documentation

160 #endif
161 WOLFSSL_API void WOLFSSL_MSG(const char* msg);
162 WOLFSSL_API void WOLFSSL_BUFFER(const byte* buffer, word32 length);
163
164 #else
165
166 #define WOLFSSL_ENTER(m)
167 #define WOLFSSL_LEAVE(m, r)
168 #define WOLFSSL_STUB(m)
169 #define WOLFSSL_IS_DEBUG_ON() 0
170
171 #define WOLFSSL_MSG_EX(m, ...) do{} while(0)
172 #define WOLFSSL_MSG(m) do{} while(0)
173 #define WOLFSSL_BUFFER(b, l) do{} while(0)
174
175 #endif /* DEBUG_WOLFSSL && !WOLFSSL_DEBUG_ERRORS_ONLY */
176
177 #if defined(DEBUG_WOLFSSL) || defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) ||\
178 defined(WOLFSSL_HAPROXY) || defined(OPENSSL_EXTRA)
179
180 #ifdef WOLFSSL_HAVE_ERROR_QUEUE
181 WOLFSSL_API void WOLFSSL_ERROR_LINE(int err, const char* func, unsigned int line,
182 const char* file, void* ctx);
183 #define WOLFSSL_ERROR(x) \
184 WOLFSSL_ERROR_LINE((x), __func__, __LINE__, __FILE__, NULL)
185 #else
186 WOLFSSL_API void WOLFSSL_ERROR(int err);
187 #endif /* WOLFSSL_HAVE_ERROR_QUEUE */
188
189 WOLFSSL_API void WOLFSSL_ERROR_MSG(const char* msg);
190 #else
191 #define WOLFSSL_ERROR(e)
192 #define WOLFSSL_ERROR_MSG(m)
193 #endif /* DEBUG_WOLFSSL | OPENSSL_ALL || WOLFSSL_NGINX || WOLFSSL_HAPROXY ||
194 OPENSSL_EXTRA */
195
196 #ifdef WOLFSSL_VERBOSE_ERRORS
197 #define WOLFSSL_ERROR_VERBOSE(e) WOLFSSL_ERROR(e)
198 #else
199 #define WOLFSSL_ERROR_VERBOSE(e) (void)(e)
200 #endif /* WOLFSSL_VERBOSE_ERRORS */
201
202 #ifdef HAVE_STACK_SIZE_VERBOSE
203 extern WOLFSSL_API THREAD_LS_T unsigned char *StackSizeCheck_myStack;
204 extern WOLFSSL_API THREAD_LS_T size_t StackSizeCheck_stackSize;
205 extern WOLFSSL_API THREAD_LS_T size_t StackSizeCheck_stackSizeHWM;
206 extern WOLFSSL_API THREAD_LS_T size_t *StackSizeCheck_stackSizeHWM_ptr;
207 extern WOLFSSL_API THREAD_LS_T void *StackSizeCheck_stackOffsetPointer;
208 #endif
209
210 #ifdef __cplusplus
211 }
212 #endif
213 #endif /* WOLFSSL_LOGGING_H */
214

22.352 md2.h File Reference


#include <wolfssl/wolfcrypt/types.h>

22.353 md2.h
Go to the documentation of this file.
1 /* md2.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
17 #ifndef WOLF_CRYPT_MD2_H
18 #define WOLF_CRYPT_MD2_H
19
20 #include <wolfssl/wolfcrypt/types.h>
21

NetBurner, Inc.
22.354 mem_track.h 1533

22 #ifdef WOLFSSL_MD2
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /* in bytes */
29 enum {
30 MD2 = WC_HASH_TYPE_MD2,
31 MD2_BLOCK_SIZE = 16,
32 MD2_DIGEST_SIZE = 16,
33 MD2_PAD_SIZE = 16,
34 MD2_X_SIZE = 48
35 };
36
37
38 /* Md2 digest */
39 typedef struct Md2 {
40 word32 count; /* bytes % PAD_SIZE */
41 byte X[MD2_X_SIZE];
42 byte C[MD2_BLOCK_SIZE];
43 byte buffer[MD2_BLOCK_SIZE];
44 } Md2;
45
46
47 WOLFSSL_API void wc_InitMd2(Md2* md2);
48 WOLFSSL_API void wc_Md2Update(Md2* md2, const byte* data, word32 len);
49 WOLFSSL_API void wc_Md2Final(Md2* md2, byte* hash);
50 WOLFSSL_API int wc_Md2Hash(const byte* data, word32 len, byte* hash);
51
52
53 #ifdef __cplusplus
54 } /* extern "C" */
55 #endif
56
57 #endif /* WOLFSSL_MD2 */
58 #endif /* WOLF_CRYPT_MD2_H */
59

22.354 mem_track.h
1 /* mem_track.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 /* The memory tracker overrides the wolfSSL memory callback system and uses a
14 * static to track the total, peak and currently allocated bytes.
15 *
16 * If you are already using the memory callbacks then enabling this will
17 * override the memory callbacks and prevent your memory callbacks from
18 * working. This assumes malloc() and free() are available. Feel free to
19 * customize this for your needs.
20
21 * The enable this feature define the following:
22 * #define USE_WOLFSSL_MEMORY
23 * #define WOLFSSL_TRACK_MEMORY
24 *
25 * On startup call:
26 * InitMemoryTracker();
27 *
28 * When ready to dump the memory report call:
29 * ShowMemoryTracker();
30 *
31 * Report example:
32 * total Allocs = 228
33 * total Bytes = 93442
34 * peak Bytes = 8840
35 * current Bytes = 0
36 *
37 *
38 * You can also:
39 * #define WOLFSSL_DEBUG_MEMORY
40 *
41 * To print every alloc/free along with the function and line number.
42 * Example output:
43 * Alloc: 0x7fa14a500010 -> 120 at wc_InitRng:496
44 * Free: 0x7fa14a500010 -> 120 at wc_FreeRng:606

NetBurner, Inc.
1534 File Documentation

45 */
46
47
48 #ifndef WOLFSSL_MEM_TRACK_H
49 #define WOLFSSL_MEM_TRACK_H
50
51 #if defined(USE_WOLFSSL_MEMORY) && !defined(WOLFSSL_STATIC_MEMORY)
52
53 #include "wolfssl/wolfcrypt/logging.h"
54
55 #if defined(WOLFSSL_TRACK_MEMORY)
56 #define DO_MEM_STATS
57 #if defined(__linux__) || defined(__MACH__)
58 #define DO_MEM_LIST
59 #endif
60 #endif
61
62
63 typedef struct memoryStats {
64 long totalAllocs; /* number of allocations */
65 long totalDeallocs; /* number of deallocations */
66 long totalBytes; /* total number of bytes allocated */
67 long peakBytes; /* concurrent max bytes */
68 long currentBytes; /* total current bytes in use */
69 #ifdef WOLFSSL_TRACK_MEMORY_VERBOSE
70 long peakAllocsTripOdometer; /* peak number of concurrent allocations,
71 * subject to reset by
72 * wolfCrypt_heap_peak_checkpoint()
73 */
74 long peakBytesTripOdometer; /* peak concurrent bytes, subject to reset
75 * by wolfCrypt_heap_peak_checkpoint()
76 */
77 #endif
78 } memoryStats;
79
80 typedef struct memHint {
81 size_t thisSize; /* size of this memory */
82
83 #ifdef DO_MEM_LIST
84 struct memHint* next;
85 struct memHint* prev;
86 #ifdef WOLFSSL_DEBUG_MEMORY
87 const char* func;
88 unsigned int line;
89 #endif
90 #endif
91 void* thisMemory; /* actual memory for user */
92 } memHint;
93
94 typedef struct memoryTrack {
95 union {
96 memHint hint;
97 byte alignit[sizeof(memHint) + ((16-1) & ~(16-1))]; /* make sure we have strong alignment
*/
98 } u;
99 } memoryTrack;
100
101 #ifdef DO_MEM_LIST
102 /* track allocations and report at end */
103 typedef struct memoryList {
104 memHint* head;
105 memHint* tail;
106 word32 count;
107 } memoryList;
108 #endif
109
110 #if defined(WOLFSSL_TRACK_MEMORY)
111 static memoryStats ourMemStats;
112
113 #ifdef DO_MEM_LIST
114 #include <pthread.h>
115 static memoryList ourMemList;
116 static pthread_mutex_t memLock = PTHREAD_MUTEX_INITIALIZER;
117 #endif
118 #endif
119
120
121 /* if defined to not using inline then declare function prototypes */
122 #ifdef NO_INLINE
123 #define WC_STATIC
124 #ifdef WOLFSSL_DEBUG_MEMORY
125 WOLFSSL_LOCAL void* TrackMalloc(size_t sz, const char* func, unsigned int line);
126 WOLFSSL_LOCAL void TrackFree(void* ptr, const char* func, unsigned int line);
127 WOLFSSL_LOCAL void* TrackRealloc(void* ptr, size_t sz, const char* func, unsigned int
line);
128 #else
129 WOLFSSL_LOCAL void* TrackMalloc(size_t sz);

NetBurner, Inc.
22.354 mem_track.h 1535

130 WOLFSSL_LOCAL void TrackFree(void* ptr);


131 WOLFSSL_LOCAL void* TrackRealloc(void* ptr, size_t sz);
132 #endif
133 WOLFSSL_LOCAL int InitMemoryTracker(void);
134 WOLFSSL_LOCAL void ShowMemoryTracker(void);
135 #else
136 #define WC_STATIC static
137 #endif
138
139 #ifdef WOLFSSL_DEBUG_MEMORY
140 WC_STATIC WC_INLINE void* TrackMalloc(size_t sz, const char* func, unsigned int line)
141 #else
142 WC_STATIC WC_INLINE void* TrackMalloc(size_t sz)
143 #endif
144 {
145 memoryTrack* mt;
146 memHint* header;
147
148 if (sz == 0)
149 return NULL;
150
151 #ifdef FREERTOS
152 mt = (memoryTrack*)pvPortMalloc(sizeof(memoryTrack) + sz);
153 #else
154 mt = (memoryTrack*)malloc(sizeof(memoryTrack) + sz);
155 #endif
156 if (mt == NULL)
157 return NULL;
158
159 header = &mt->u.hint;
160 header->thisSize = sz;
161 header->thisMemory = (byte*)mt + sizeof(memoryTrack);
162
163 #ifdef WOLFSSL_DEBUG_MEMORY
164 #ifdef WOLFSSL_DEBUG_MEMORY_PRINT
165 fprintf(stderr, "Alloc: %p -> %u at %s:%d\n", header->thisMemory, (word32)sz, func, line);
166 #else
167 (void)func;
168 (void)line;
169 #endif
170 #endif
171
172 #ifdef DO_MEM_STATS
173 ourMemStats.totalAllocs++;
174 ourMemStats.totalBytes += sz;
175 ourMemStats.currentBytes += sz;
176 #ifdef WOLFSSL_TRACK_MEMORY_VERBOSE
177 if (ourMemStats.peakAllocsTripOdometer < ourMemStats.totalAllocs - ourMemStats.totalDeallocs)
178 ourMemStats.peakAllocsTripOdometer = ourMemStats.totalAllocs - ourMemStats.totalDeallocs;
179 if (ourMemStats.peakBytesTripOdometer < ourMemStats.currentBytes) {
180 ourMemStats.peakBytesTripOdometer = ourMemStats.currentBytes;
181 #endif
182 if (ourMemStats.currentBytes > ourMemStats.peakBytes)
183 ourMemStats.peakBytes = ourMemStats.currentBytes;
184 #ifdef WOLFSSL_TRACK_MEMORY_VERBOSE
185 }
186 #endif
187 #endif
188 #ifdef DO_MEM_LIST
189 if (pthread_mutex_lock(&memLock) == 0) {
190 #ifdef WOLFSSL_DEBUG_MEMORY
191 header->func = func;
192 header->line = line;
193 #endif
194
195 /* Setup event */
196 header->next = NULL;
197 if (ourMemList.tail == NULL) {
198 ourMemList.head = header;
199 header->prev = NULL;
200 }
201 else {
202 ourMemList.tail->next = header;
203 header->prev = ourMemList.tail;
204 }
205 ourMemList.tail = header; /* add to the end either way */
206 ourMemList.count++;
207
208 pthread_mutex_unlock(&memLock);
209 }
210 #endif
211
212 return header->thisMemory;
213 }
214
215
216 #ifdef WOLFSSL_DEBUG_MEMORY

NetBurner, Inc.
1536 File Documentation

217 WC_STATIC WC_INLINE void TrackFree(void* ptr, const char* func, unsigned int line)
218 #else
219 WC_STATIC WC_INLINE void TrackFree(void* ptr)
220 #endif
221 {
222 memoryTrack* mt;
223 memHint* header;
224 size_t sz;
225
226 if (ptr == NULL) {
227 return;
228 }
229
230 mt = (memoryTrack*)((byte*)ptr - sizeof(memoryTrack));
231 header = &mt->u.hint;
232 sz = header->thisSize;
233
234 #ifdef DO_MEM_LIST
235 if (pthread_mutex_lock(&memLock) == 0)
236 {
237 #endif
238
239 #ifdef DO_MEM_STATS
240 ourMemStats.currentBytes -= header->thisSize;
241 ourMemStats.totalDeallocs++;
242 #endif
243
244 #ifdef DO_MEM_LIST
245 if (header == ourMemList.head && header == ourMemList.tail) {
246 ourMemList.head = NULL;
247 ourMemList.tail = NULL;
248 }
249 else if (header == ourMemList.head) {
250 ourMemList.head = header->next;
251 ourMemList.head->prev = NULL;
252 }
253 else if (header == ourMemList.tail) {
254 ourMemList.tail = header->prev;
255 ourMemList.tail->next = NULL;
256 }
257 else {
258 memHint* next = header->next;
259 memHint* prev = header->prev;
260 if (next)
261 next->prev = prev;
262 if (prev)
263 prev->next = next;
264 }
265 ourMemList.count--;
266
267 pthread_mutex_unlock(&memLock);
268 }
269 #endif
270
271 #ifdef WOLFSSL_DEBUG_MEMORY
272 #ifdef WOLFSSL_DEBUG_MEMORY_PRINT
273 fprintf(stderr, "Free: %p -> %u at %s:%d\n", ptr, (word32)sz, func, line);
274 #else
275 (void)func;
276 (void)line;
277 #endif
278 #endif
279 (void)sz;
280
281 #ifdef FREERTOS
282 vPortFree(mt);
283 #else
284 free(mt);
285 #endif
286 }
287
288
289 #ifdef WOLFSSL_DEBUG_MEMORY
290 WC_STATIC WC_INLINE void* TrackRealloc(void* ptr, size_t sz, const char* func, unsigned int line)
291 #else
292 WC_STATIC WC_INLINE void* TrackRealloc(void* ptr, size_t sz)
293 #endif
294 {
295 #ifdef WOLFSSL_DEBUG_MEMORY
296 void* ret = TrackMalloc(sz, func, line);
297 #else
298 void* ret = TrackMalloc(sz);
299 #endif
300
301 if (ptr) {
302 /* if realloc is bigger, don’t overread old ptr */
303 memoryTrack* mt;

NetBurner, Inc.
22.354 mem_track.h 1537

304 memHint* header;


305
306 mt = (memoryTrack*)((byte*)ptr - sizeof(memoryTrack));
307 header = &mt->u.hint;
308
309 if (header->thisSize < sz)
310 sz = header->thisSize;
311 }
312
313 if (ret && ptr)
314 XMEMCPY(ret, ptr, sz);
315
316 if (ret) {
317 #ifdef WOLFSSL_DEBUG_MEMORY
318 TrackFree(ptr, func, line);
319 #else
320 TrackFree(ptr);
321 #endif
322 }
323
324 return ret;
325 }
326
327 #ifdef WOLFSSL_TRACK_MEMORY
328 static wolfSSL_Malloc_cb mfDefault = NULL;
329 static wolfSSL_Free_cb ffDefault = NULL;
330 static wolfSSL_Realloc_cb rfDefault = NULL;
331
332 WC_STATIC WC_INLINE int InitMemoryTracker(void)
333 {
334 int ret;
335
336 ret = wolfSSL_GetAllocators(&mfDefault, &ffDefault, &rfDefault);
337 if (ret < 0) {
338 fprintf(stderr, "wolfSSL GetAllocators failed to get the defaults\n");
339 }
340 ret = wolfSSL_SetAllocators(TrackMalloc, TrackFree, TrackRealloc);
341 if (ret < 0) {
342 fprintf(stderr, "wolfSSL SetAllocators failed for track memory\n");
343 return ret;
344 }
345
346 #ifdef DO_MEM_LIST
347 if (pthread_mutex_lock(&memLock) == 0)
348 {
349 #endif
350
351 #ifdef DO_MEM_STATS
352 ourMemStats.totalAllocs = 0;
353 ourMemStats.totalDeallocs = 0;
354 ourMemStats.totalBytes = 0;
355 ourMemStats.peakBytes = 0;
356 ourMemStats.currentBytes = 0;
357 #ifdef WOLFSSL_TRACK_MEMORY_VERBOSE
358 ourMemStats.peakAllocsTripOdometer = 0;
359 ourMemStats.peakBytesTripOdometer = 0;
360 #endif
361 #endif
362
363 #ifdef DO_MEM_LIST
364 XMEMSET(&ourMemList, 0, sizeof(ourMemList));
365
366 pthread_mutex_unlock(&memLock);
367 }
368 #endif
369
370 return ret;
371 }
372
373 WC_STATIC WC_INLINE void ShowMemoryTracker(void)
374 {
375 #ifdef DO_MEM_LIST
376 if (pthread_mutex_lock(&memLock) == 0)
377 {
378 #endif
379
380 #ifdef DO_MEM_STATS
381 fprintf(stderr, "total Allocs = %9ld\n", ourMemStats.totalAllocs);
382 fprintf(stderr, "total Deallocs = %9ld\n", ourMemStats.totalDeallocs);
383 fprintf(stderr, "total Bytes = %9ld\n", ourMemStats.totalBytes);
384 fprintf(stderr, "peak Bytes = %9ld\n", ourMemStats.peakBytes);
385 fprintf(stderr, "current Bytes = %9ld\n", ourMemStats.currentBytes);
386 #endif
387
388 #ifdef DO_MEM_LIST
389 if (ourMemList.count > 0) {
390 /* print list of allocations */

NetBurner, Inc.
1538 File Documentation

391 memHint* header;


392 for (header = ourMemList.head; header != NULL; header = header->next) {
393 fprintf(stderr, "Leak: Ptr %p, Size %u"
394 #ifdef WOLFSSL_DEBUG_MEMORY
395 ", Func %s, Line %d"
396 #endif
397 "\n",
398 (byte*)header + sizeof(memHint), (unsigned int)header->thisSize
399 #ifdef WOLFSSL_DEBUG_MEMORY
400 , header->func, header->line
401 #endif
402 );
403 }
404 }
405
406 pthread_mutex_unlock(&memLock);
407 }
408 #endif
409 }
410
411 WC_STATIC WC_INLINE int CleanupMemoryTracker(void)
412 {
413 /* restore default allocators */
414 return wolfSSL_SetAllocators(mfDefault, ffDefault, rfDefault);
415 }
416 #endif
417
418 #endif /* USE_WOLFSSL_MEMORY */
419
420 #endif /* WOLFSSL_MEM_TRACK_H */
421

22.355 memory.h File Reference


#include <stdlib.h>
#include <wolfssl/wolfcrypt/types.h>

22.356 memory.h
Go to the documentation of this file.
1 /* memory.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 /* submitted by eof */
14
19 #ifndef WOLFSSL_MEMORY_H
20 #define WOLFSSL_MEMORY_H
21
22 #if !defined(STRING_USER) && !defined(WOLFSSL_LINUXKM)
23 #include <stdlib.h>
24 #endif
25
26 #ifndef WOLF_CRYPT_TYPES_H
27 #include <wolfssl/wolfcrypt/types.h>
28 #endif
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 #ifdef WOLFSSL_FORCE_MALLOC_FAIL_TEST
35 WOLFSSL_API void wolfSSL_SetMemFailCount(int memFailCount);
36 #endif
37
38 #ifdef OPENSSL_EXTRA
39 typedef void *(*wolfSSL_OSSL_Malloc_cb)(size_t, const char *, int);
40 typedef void (*wolfSSL_OSSL_Free_cb)(void *, const char *, int);
41 typedef void *(*wolfSSL_OSSL_Realloc_cb)(void *, size_t, const char *, int);
42 #endif /* OPENSSL_EXTRA */
43

NetBurner, Inc.
22.356 memory.h 1539

44 #ifdef WOLFSSL_STATIC_MEMORY
45 #ifdef WOLFSSL_DEBUG_MEMORY
46 typedef void *(*wolfSSL_Malloc_cb)(size_t size, void* heap, int type, const char* func, unsigned
int line);
47 typedef void (*wolfSSL_Free_cb)(void *ptr, void* heap, int type, const char* func, unsigned int
line);
48 typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size, void* heap, int type, const char*
func, unsigned int line);
49 WOLFSSL_API void* wolfSSL_Malloc(size_t size, void* heap, int type, const char* func, unsigned
int line);
50 WOLFSSL_API void wolfSSL_Free(void *ptr, void* heap, int type, const char* func, unsigned int
line);
51 WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size, void* heap, int type, const char* func,
unsigned int line);
52 #else
53 typedef void *(*wolfSSL_Malloc_cb)(size_t size, void* heap, int type);
54 typedef void (*wolfSSL_Free_cb)(void *ptr, void* heap, int type);
55 typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size, void* heap, int type);
56 WOLFSSL_API void* wolfSSL_Malloc(size_t size, void* heap, int type);
57 WOLFSSL_API void wolfSSL_Free(void *ptr, void* heap, int type);
58 WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size, void* heap, int type);
59 #endif /* WOLFSSL_DEBUG_MEMORY */
60 #else
61 #ifdef WOLFSSL_DEBUG_MEMORY
62 typedef void *(*wolfSSL_Malloc_cb)(size_t size, const char* func, unsigned int line);
63 typedef void (*wolfSSL_Free_cb)(void *ptr, const char* func, unsigned int line);
64 typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size, const char* func, unsigned int line);
65
66 /* Public in case user app wants to use XMALLOC/XFREE */
67 WOLFSSL_API void* wolfSSL_Malloc(size_t size, const char* func, unsigned int line);
68 WOLFSSL_API void wolfSSL_Free(void *ptr, const char* func, unsigned int line);
69 WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size, const char* func, unsigned int line);
70 #else
71 typedef void *(*wolfSSL_Malloc_cb)(size_t size);
72 typedef void (*wolfSSL_Free_cb)(void *ptr);
73 typedef void *(*wolfSSL_Realloc_cb)(void *ptr, size_t size);
74 /* Public in case user app wants to use XMALLOC/XFREE */
75 WOLFSSL_API void* wolfSSL_Malloc(size_t size);
76 WOLFSSL_API void wolfSSL_Free(void *ptr);
77 WOLFSSL_API void* wolfSSL_Realloc(void *ptr, size_t size);
78 #endif /* WOLFSSL_DEBUG_MEMORY */
79 #endif /* WOLFSSL_STATIC_MEMORY */
80
81 /* Public get/set functions */
82 WOLFSSL_API int wolfSSL_SetAllocators(wolfSSL_Malloc_cb mf,
83 wolfSSL_Free_cb ff,
84 wolfSSL_Realloc_cb rf);
85 WOLFSSL_API int wolfSSL_GetAllocators(wolfSSL_Malloc_cb* mf,
86 wolfSSL_Free_cb* ff,
87 wolfSSL_Realloc_cb* rf);
88
89 #ifdef WOLFSSL_STATIC_MEMORY
90 #define WOLFSSL_STATIC_TIMEOUT 1
91 #ifndef WOLFSSL_STATIC_ALIGN
92 #define WOLFSSL_STATIC_ALIGN 16
93 #endif
94 #ifndef WOLFMEM_MAX_BUCKETS
95 #define WOLFMEM_MAX_BUCKETS 9
96 #endif
97 #define WOLFMEM_DEF_BUCKETS 9 /* number of default memory blocks */
98 #ifndef WOLFMEM_IO_SZ
99 #define WOLFMEM_IO_SZ 16992 /* 16 byte aligned */
100 #endif
101 #ifndef WOLFMEM_BUCKETS
102 #ifndef SESSION_CERTS
103 /* default size of chunks of memory to separate into */
104 #ifndef LARGEST_MEM_BUCKET
105 #define LARGEST_MEM_BUCKET 16128
106 #endif
107 #define WOLFMEM_BUCKETS 64,128,256,512,1024,2432,3456,4544,\
108 LARGEST_MEM_BUCKET
109 #elif defined (OPENSSL_EXTRA)
110 /* extra storage in structs for multiple attributes and order */
111 #ifndef LARGEST_MEM_BUCKET
112 #ifdef WOLFSSL_TLS13
113 #define LARGEST_MEM_BUCKET 30400
114 #else
115 #define LARGEST_MEM_BUCKET 25600
116 #endif
117 #endif
118 #define WOLFMEM_BUCKETS 64,128,256,512,1024,2432,3360,4480,\
119 LARGEST_MEM_BUCKET
120 #elif defined (WOLFSSL_CERT_EXT)
121 /* certificate extensions requires 24k for the SSL struct */
122 #ifndef LARGEST_MEM_BUCKET
123 #define LARGEST_MEM_BUCKET 24576
124 #endif

NetBurner, Inc.
1540 File Documentation

125 #define WOLFMEM_BUCKETS 64,128,256,512,1024,2432,3456,4544,\


126 LARGEST_MEM_BUCKET
127 #else
128 /* increase 23k for object member of WOLFSSL_X509_NAME_ENTRY */
129 #ifndef LARGEST_MEM_BUCKET
130 #define LARGEST_MEM_BUCKET 23440
131 #endif
132 #define WOLFMEM_BUCKETS 64,128,256,512,1024,2432,3456,4544,\
133 LARGEST_MEM_BUCKET
134 #endif
135 #endif
136 #ifndef WOLFMEM_DIST
137 #ifndef WOLFSSL_STATIC_MEMORY_SMALL
138 #define WOLFMEM_DIST 49,10,6,14,5,6,9,1,1
139 #else
140 /* Low resource and not RSA */
141 #define WOLFMEM_DIST 29, 7,6, 9,4,4,0,0,0
142 #endif
143 #endif
144
145 /* flags for loading static memory (one hot bit) */
146 #define WOLFMEM_GENERAL 0x01
147 #define WOLFMEM_IO_POOL 0x02
148 #define WOLFMEM_IO_POOL_FIXED 0x04
149 #define WOLFMEM_TRACK_STATS 0x08
150
151 #ifndef WOLFSSL_MEM_GUARD
152 #define WOLFSSL_MEM_GUARD
153 typedef struct WOLFSSL_MEM_STATS WOLFSSL_MEM_STATS;
154 typedef struct WOLFSSL_MEM_CONN_STATS WOLFSSL_MEM_CONN_STATS;
155 #endif
156
157 struct WOLFSSL_MEM_CONN_STATS {
158 word32 peakMem; /* peak memory usage */
159 word32 curMem; /* current memory usage */
160 word32 peakAlloc; /* peak memory allocations */
161 word32 curAlloc; /* current memory allocations */
162 word32 totalAlloc;/* total memory allocations for lifetime */
163 word32 totalFr; /* total frees for lifetime */
164 };
165
166 struct WOLFSSL_MEM_STATS {
167 word32 curAlloc; /* current memory allocations */
168 word32 totalAlloc;/* total memory allocations for lifetime */
169 word32 totalFr; /* total frees for lifetime */
170 word32 totalUse; /* total amount of memory used in blocks */
171 word32 avaIO; /* available IO specific pools */
172 word32 maxHa; /* max number of concurrent handshakes allowed */
173 word32 maxIO; /* max number of concurrent IO connections allowed */
174 word32 blockSz[WOLFMEM_MAX_BUCKETS]; /* block sizes in stacks */
175 word32 avaBlock[WOLFMEM_MAX_BUCKETS];/* ava block sizes */
176 word32 usedBlock[WOLFMEM_MAX_BUCKETS];
177 int flag; /* flag used */
178 };
179
180 typedef struct wc_Memory wc_Memory; /* internal structure for mem bucket */
181 typedef struct WOLFSSL_HEAP {
182 wc_Memory* ava[WOLFMEM_MAX_BUCKETS];
183 wc_Memory* io; /* list of buffers to use for IO */
184 word32 maxHa; /* max concurrent handshakes */
185 word32 curHa;
186 word32 maxIO; /* max concurrent IO connections */
187 word32 curIO;
188 word32 sizeList[WOLFMEM_MAX_BUCKETS];/* memory sizes in ava list */
189 word32 distList[WOLFMEM_MAX_BUCKETS];/* general distribution */
190 word32 inUse; /* amount of memory currently in use */
191 word32 ioUse;
192 word32 alloc; /* total number of allocs */
193 word32 frAlc; /* total number of frees */
194 int flag;
195 wolfSSL_Mutex memory_mutex;
196 } WOLFSSL_HEAP;
197
198 /* structure passed into XMALLOC as heap hint
199 * having this abstraction allows tracking statistics of individual ssl’s
200 */
201 typedef struct WOLFSSL_HEAP_HINT {
202 WOLFSSL_HEAP* memory;
203 WOLFSSL_MEM_CONN_STATS* stats; /* hold individual connection stats */
204 wc_Memory* outBuf; /* set if using fixed io buffers */
205 wc_Memory* inBuf;
206 byte haFlag; /* flag used for checking handshake count */
207 } WOLFSSL_HEAP_HINT;
208
209 WOLFSSL_API int wc_LoadStaticMemory(WOLFSSL_HEAP_HINT** pHint,
210 unsigned char* buf, unsigned int sz, int flag, int max);
211

NetBurner, Inc.
22.357 misc.h 1541

212 WOLFSSL_LOCAL int wolfSSL_init_memory_heap(WOLFSSL_HEAP* heap);


213 WOLFSSL_LOCAL int wolfSSL_load_static_memory(byte* buffer, word32 sz,
214 int flag, WOLFSSL_HEAP* heap);
215 WOLFSSL_LOCAL int wolfSSL_GetMemStats(WOLFSSL_HEAP* heap,
216 WOLFSSL_MEM_STATS* stats);
217 WOLFSSL_LOCAL int SetFixedIO(WOLFSSL_HEAP* heap, wc_Memory** io);
218 WOLFSSL_LOCAL int FreeFixedIO(WOLFSSL_HEAP* heap, wc_Memory** io);
219
220 WOLFSSL_API int wolfSSL_StaticBufferSz(byte* buffer, word32 sz, int flag);
221 WOLFSSL_API int wolfSSL_MemoryPaddingSz(void);
222 #endif /* WOLFSSL_STATIC_MEMORY */
223
224 #ifdef WOLFSSL_STACK_LOG
225 WOLFSSL_API void __attribute__((no_instrument_function))
226 __cyg_profile_func_enter(void *func, void *caller);
227 WOLFSSL_API void __attribute__((no_instrument_function))
228 __cyg_profile_func_exit(void *func, void *caller);
229 #endif /* WOLFSSL_STACK_LOG */
230
231 #ifdef WOLFSSL_CHECK_MEM_ZERO
232 WOLFSSL_LOCAL void wc_MemZero_Init(void);
233 WOLFSSL_LOCAL void wc_MemZero_Free(void);
234 WOLFSSL_LOCAL void wc_MemZero_Add(const char* name, const void* addr,
235 size_t len);
236 WOLFSSL_LOCAL void wc_MemZero_Check(void* addr, size_t len);
237 #endif
238
239 #ifdef __cplusplus
240 } /* extern "C" */
241 #endif
242
243 #endif /* WOLFSSL_MEMORY_H */
244

22.357 misc.h
1 /* misc.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11 /*
12
13 DESCRIPTION
14 This module implements the arithmetic-shift right, left, byte swapping, XOR,
15 masking and clearing memory logic.
16
17 */
18 #ifndef WOLF_CRYPT_MISC_H
19 #define WOLF_CRYPT_MISC_H
20
21
22 #include <wolfssl/wolfcrypt/types.h>
23
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29
30 #ifdef NO_INLINE
31 WOLFSSL_LOCAL
32 word32 rotlFixed(word32, word32);
33 WOLFSSL_LOCAL
34 word32 rotrFixed(word32, word32);
35
36 #ifdef WC_RC2
37 WOLFSSL_LOCAL
38 word16 rotlFixed16(word16, word16);
39 WOLFSSL_LOCAL
40 word16 rotrFixed16(word16, word16);
41 #endif
42
43 WOLFSSL_LOCAL
44 word32 ByteReverseWord32(word32);
45 WOLFSSL_LOCAL
46 void ByteReverseWords(word32*, const word32*, word32);
47
48 WOLFSSL_LOCAL
49 void XorWordsOut(wolfssl_word* r, const wolfssl_word* a, const wolfssl_word* b,

NetBurner, Inc.
1542 File Documentation

50 word32 n);
51 WOLFSSL_LOCAL
52 void xorbufout(void*, const void*, const void*, word32);
53 WOLFSSL_LOCAL
54 void XorWords(wolfssl_word*, const wolfssl_word*, word32);
55 WOLFSSL_LOCAL
56 void xorbuf(void*, const void*, word32);
57
58 WOLFSSL_LOCAL
59 void ForceZero(void*, word32);
60
61 WOLFSSL_LOCAL
62 int ConstantCompare(const byte*, const byte*, int);
63
64 #ifdef WORD64_AVAILABLE
65 WOLFSSL_LOCAL
66 word64 rotlFixed64(word64, word64);
67 WOLFSSL_LOCAL
68 word64 rotrFixed64(word64, word64);
69
70 WOLFSSL_LOCAL
71 word64 ByteReverseWord64(word64);
72 WOLFSSL_LOCAL
73 void ByteReverseWords64(word64*, const word64*, word32);
74 #endif /* WORD64_AVAILABLE */
75
76 #ifndef WOLFSSL_HAVE_MIN
77 #if defined(HAVE_FIPS) && !defined(min) /* so ifdef check passes */
78 #define min min
79 #endif
80 WOLFSSL_LOCAL word32 min(word32 a, word32 b);
81 #endif
82
83 #ifndef WOLFSSL_HAVE_MAX
84 #if defined(HAVE_FIPS) && !defined(max) /* so ifdef check passes */
85 #define max max
86 #endif
87 WOLFSSL_LOCAL word32 max(word32 a, word32 b);
88 #endif /* WOLFSSL_HAVE_MAX */
89
90
91 void c32to24(word32 in, word24 out);
92 void c16toa(word16 u16, byte* c);
93 void c32toa(word32 u32, byte* c);
94 void c24to32(const word24 u24, word32* u32);
95 void ato16(const byte* c, word16* u16);
96 void ato24(const byte* c, word32* u24);
97 void ato32(const byte* c, word32* u32);
98 word32 btoi(byte b);
99
100 WOLFSSL_LOCAL signed char HexCharToByte(char ch);
101 WOLFSSL_LOCAL char ByteToHex(byte in);
102 WOLFSSL_LOCAL int ByteToHexStr(byte in, char* out);
103
104 WOLFSSL_LOCAL byte ctMaskGT(int a, int b);
105 WOLFSSL_LOCAL byte ctMaskGTE(int a, int b);
106 WOLFSSL_LOCAL int ctMaskIntGTE(int a, int b);
107 WOLFSSL_LOCAL byte ctMaskLT(int a, int b);
108 WOLFSSL_LOCAL byte ctMaskLTE(int a, int b);
109 WOLFSSL_LOCAL byte ctMaskEq(int a, int b);
110 WOLFSSL_LOCAL word16 ctMask16GT(int a, int b);
111 WOLFSSL_LOCAL word16 ctMask16GTE(int a, int b);
112 WOLFSSL_LOCAL word16 ctMask16LT(int a, int b);
113 WOLFSSL_LOCAL word16 ctMask16LTE(int a, int b);
114 WOLFSSL_LOCAL word16 ctMask16Eq(int a, int b);
115 WOLFSSL_LOCAL byte ctMaskNotEq(int a, int b);
116 WOLFSSL_LOCAL byte ctMaskSel(byte m, byte a, byte b);
117 WOLFSSL_LOCAL int ctMaskSelInt(byte m, int a, int b);
118 WOLFSSL_LOCAL byte ctSetLTE(int a, int b);
119 WOLFSSL_LOCAL void ctMaskCopy(byte mask, byte* dst, byte* src, word16 size);
120 WOLFSSL_LOCAL word32 MakeWordFromHash(const byte* hashID);
121 WOLFSSL_LOCAL word32 HashObject(const byte* o, word32 len, int* error);
122
123 #endif /* NO_INLINE */
124
125
126 #ifdef __cplusplus
127 } /* extern "C" */
128 #endif
129
130
131 #endif /* WOLF_CRYPT_MISC_H */
132

NetBurner, Inc.
22.358 mpi_class.h 1543

22.358 mpi_class.h
1 /* mpi_class.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 #if !(defined(LTM1) && defined(LTM2) && defined(LTM3))
15 #if defined(LTM2)
16 #define LTM3
17 #endif
18 #if defined(LTM1)
19 #define LTM2
20 #endif
21 #define LTM1
22
23 #if defined(LTM_ALL)
24 #define BN_ERROR_C
25 #define BN_FAST_MP_INVMOD_C
26 #define BN_FAST_MP_MONTGOMERY_REDUCE_C
27 #define BN_FAST_S_MP_MUL_DIGS_C
28 #define BN_FAST_S_MP_MUL_HIGH_DIGS_C
29 #define BN_FAST_S_MP_SQR_C
30 #define BN_MP_2EXPT_C
31 #define BN_MP_ABS_C
32 #define BN_MP_ADD_C
33 #define BN_MP_ADD_D_C
34 #define BN_MP_ADDMOD_C
35 #define BN_MP_AND_C
36 #define BN_MP_CLAMP_C
37 #define BN_MP_CLEAR_C
38 #define BN_MP_CLEAR_MULTI_C
39 #define BN_MP_CMP_C
40 #define BN_MP_CMP_D_C
41 #define BN_MP_CMP_MAG_C
42 #define BN_MP_CNT_LSB_C
43 #define BN_MP_COPY_C
44 #define BN_MP_COUNT_BITS_C
45 #define BN_MP_DIV_C
46 #define BN_MP_DIV_2_C
47 #define BN_MP_DIV_2D_C
48 #define BN_MP_DIV_3_C
49 #define BN_MP_DIV_D_C
50 #define BN_MP_DR_IS_MODULUS_C
51 #define BN_MP_DR_REDUCE_C
52 #define BN_MP_DR_SETUP_C
53 #define BN_MP_EXCH_C
54 #define BN_MP_EXPT_D_C
55 #define BN_MP_EXPTMOD_BASE_2
56 #define BN_MP_EXPTMOD_C
57 #define BN_MP_EXPTMOD_FAST_C
58 #define BN_MP_EXTEUCLID_C
59 #define BN_MP_FREAD_C
60 #define BN_MP_FWRITE_C
61 #define BN_MP_GCD_C
62 #define BN_MP_GET_INT_C
63 #define BN_MP_GROW_C
64 #define BN_MP_INIT_C
65 #define BN_MP_INIT_COPY_C
66 #define BN_MP_INIT_MULTI_C
67 #define BN_MP_INIT_SET_C
68 #define BN_MP_INIT_SET_INT_C
69 #define BN_MP_INIT_SIZE_C
70 #define BN_MP_INVMOD_C
71 #define BN_MP_INVMOD_SLOW_C
72 #define BN_MP_IS_SQUARE_C
73 #define BN_MP_JACOBI_C
74 #define BN_MP_KARATSUBA_MUL_C
75 #define BN_MP_KARATSUBA_SQR_C
76 #define BN_MP_LCM_C
77 #define BN_MP_LSHD_C
78 #define BN_MP_MOD_C
79 #define BN_MP_MOD_2D_C
80 #define BN_MP_MOD_D_C
81 #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
82 #define BN_MP_MONTGOMERY_REDUCE_C
83 #define BN_MP_MONTGOMERY_SETUP_C
84 #define BN_MP_MUL_C
85 #define BN_MP_MUL_2_C

NetBurner, Inc.
1544 File Documentation

86 #define BN_MP_MUL_2D_C
87 #define BN_MP_MUL_D_C
88 #define BN_MP_MULMOD_C
89 #define BN_MP_N_ROOT_C
90 #define BN_MP_NEG_C
91 #define BN_MP_OR_C
92 #define BN_MP_PRIME_FERMAT_C
93 #define BN_MP_PRIME_IS_DIVISIBLE_C
94 #define BN_MP_PRIME_IS_PRIME_C
95 #define BN_MP_PRIME_MILLER_RABIN_C
96 #define BN_MP_PRIME_NEXT_PRIME_C
97 #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
98 #define BN_MP_PRIME_RANDOM_EX_C
99 #define BN_MP_RADIX_SIZE_C
100 #define BN_MP_RADIX_SMAP_C
101 #define BN_MP_RAND_C
102 #define BN_MP_READ_RADIX_C
103 #define BN_MP_READ_SIGNED_BIN_C
104 #define BN_MP_READ_UNSIGNED_BIN_C
105 #define BN_MP_REDUCE_C
106 #define BN_MP_REDUCE_2K_C
107 #define BN_MP_REDUCE_2K_L_C
108 #define BN_MP_REDUCE_2K_SETUP_C
109 #define BN_MP_REDUCE_2K_SETUP_L_C
110 #define BN_MP_REDUCE_IS_2K_C
111 #define BN_MP_REDUCE_IS_2K_L_C
112 #define BN_MP_REDUCE_SETUP_C
113 #define BN_MP_RSHD_C
114 #define BN_MP_SET_C
115 #define BN_MP_SET_INT_C
116 #define BN_MP_SHRINK_C
117 #define BN_MP_SIGNED_BIN_SIZE_C
118 #define BN_MP_SQR_C
119 #define BN_MP_SQRMOD_C
120 #define BN_MP_SQRT_C
121 #define BN_MP_SUB_C
122 #define BN_MP_SUB_D_C
123 #define BN_MP_SUBMOD_C
124 #define BN_MP_TO_SIGNED_BIN_C
125 #define BN_MP_TO_SIGNED_BIN_N_C
126 #define BN_MP_TO_UNSIGNED_BIN_C
127 #define BN_MP_TO_UNSIGNED_BIN_N_C
128 #define BN_MP_TOOM_MUL_C
129 #define BN_MP_TOOM_SQR_C
130 #define BN_MP_TORADIX_C
131 #define BN_MP_TORADIX_N_C
132 #define BN_MP_UNSIGNED_BIN_SIZE_C
133 #define BN_MP_XOR_C
134 #define BN_MP_ZERO_C
135 #define BN_PRIME_TAB_C
136 #define BN_REVERSE_C
137 #define BN_S_MP_ADD_C
138 #define BN_S_MP_EXPTMOD_C
139 #define BN_S_MP_MUL_DIGS_C
140 #define BN_S_MP_MUL_HIGH_DIGS_C
141 #define BN_S_MP_SQR_C
142 #define BN_S_MP_SUB_C
143 #define BNCORE_C
144 #endif
145
146 #if defined(BN_ERROR_C)
147 #define BN_MP_ERROR_TO_STRING_C
148 #endif
149
150 #if defined(BN_FAST_MP_INVMOD_C)
151 #define BN_MP_ISEVEN_C
152 #define BN_MP_INIT_MULTI_C
153 #define BN_MP_COPY_C
154 #define BN_MP_MOD_C
155 #define BN_MP_SET_C
156 #define BN_MP_DIV_2_C
157 #define BN_MP_ISODD_C
158 #define BN_MP_SUB_C
159 #define BN_MP_CMP_C
160 #define BN_MP_ISZERO_C
161 #define BN_MP_CMP_D_C
162 #define BN_MP_ADD_C
163 #define BN_MP_EXCH_C
164 #define BN_MP_CLEAR_MULTI_C
165 #endif
166
167 #if defined(BN_FAST_MP_MONTGOMERY_REDUCE_C)
168 #define BN_MP_GROW_C
169 #define BN_MP_RSHD_C
170 #define BN_MP_CLAMP_C
171 #define BN_MP_CMP_MAG_C
172 #define BN_S_MP_SUB_C

NetBurner, Inc.
22.358 mpi_class.h 1545

173 #endif
174
175 #if defined(BN_FAST_S_MP_MUL_DIGS_C)
176 #define BN_MP_GROW_C
177 #define BN_MP_CLAMP_C
178 #endif
179
180 #if defined(BN_FAST_S_MP_MUL_HIGH_DIGS_C)
181 #define BN_MP_GROW_C
182 #define BN_MP_CLAMP_C
183 #endif
184
185 #if defined(BN_FAST_S_MP_SQR_C)
186 #define BN_MP_GROW_C
187 #define BN_MP_CLAMP_C
188 #endif
189
190 #if defined(BN_MP_2EXPT_C)
191 #define BN_MP_ZERO_C
192 #define BN_MP_GROW_C
193 #endif
194
195 #if defined(BN_MP_ABS_C)
196 #define BN_MP_COPY_C
197 #endif
198
199 #if defined(BN_MP_ADD_C)
200 #define BN_S_MP_ADD_C
201 #define BN_MP_CMP_MAG_C
202 #define BN_S_MP_SUB_C
203 #endif
204
205 #if defined(BN_MP_ADD_D_C)
206 #define BN_MP_GROW_C
207 #define BN_MP_SUB_D_C
208 #define BN_MP_CLAMP_C
209 #endif
210
211 #if defined(BN_MP_ADDMOD_C)
212 #define BN_MP_INIT_C
213 #define BN_MP_ADD_C
214 #define BN_MP_CLEAR_C
215 #define BN_MP_MOD_C
216 #endif
217
218 #if defined(BN_MP_AND_C)
219 #define BN_MP_INIT_COPY_C
220 #define BN_MP_CLAMP_C
221 #define BN_MP_EXCH_C
222 #define BN_MP_CLEAR_C
223 #endif
224
225 #if defined(BN_MP_CLAMP_C)
226 #endif
227
228 #if defined(BN_MP_CLEAR_C)
229 #endif
230
231 #if defined(BN_MP_CLEAR_MULTI_C)
232 #define BN_MP_CLEAR_C
233 #endif
234
235 #if defined(BN_MP_CMP_C)
236 #define BN_MP_CMP_MAG_C
237 #endif
238
239 #if defined(BN_MP_CMP_D_C)
240 #endif
241
242 #if defined(BN_MP_CMP_MAG_C)
243 #endif
244
245 #if defined(BN_MP_CNT_LSB_C)
246 #define BN_MP_ISZERO_C
247 #endif
248
249 #if defined(BN_MP_COPY_C)
250 #define BN_MP_GROW_C
251 #endif
252
253 #if defined(BN_MP_COUNT_BITS_C)
254 #endif
255
256 #if defined(BN_MP_DIV_C)
257 #define BN_MP_ISZERO_C
258 #define BN_MP_CMP_MAG_C
259 #define BN_MP_COPY_C

NetBurner, Inc.
1546 File Documentation

260 #define BN_MP_ZERO_C


261 #define BN_MP_INIT_MULTI_C
262 #define BN_MP_SET_C
263 #define BN_MP_COUNT_BITS_C
264 #define BN_MP_ABS_C
265 #define BN_MP_MUL_2D_C
266 #define BN_MP_CMP_C
267 #define BN_MP_SUB_C
268 #define BN_MP_ADD_C
269 #define BN_MP_DIV_2D_C
270 #define BN_MP_EXCH_C
271 #define BN_MP_CLEAR_MULTI_C
272 #define BN_MP_INIT_SIZE_C
273 #define BN_MP_INIT_C
274 #define BN_MP_INIT_COPY_C
275 #define BN_MP_LSHD_C
276 #define BN_MP_RSHD_C
277 #define BN_MP_MUL_D_C
278 #define BN_MP_CLAMP_C
279 #define BN_MP_CLEAR_C
280 #endif
281
282 #if defined(BN_MP_DIV_2_C)
283 #define BN_MP_GROW_C
284 #define BN_MP_CLAMP_C
285 #endif
286
287 #if defined(BN_MP_DIV_2D_C)
288 #define BN_MP_COPY_C
289 #define BN_MP_ZERO_C
290 #define BN_MP_INIT_C
291 #define BN_MP_MOD_2D_C
292 #define BN_MP_CLEAR_C
293 #define BN_MP_RSHD_C
294 #define BN_MP_CLAMP_C
295 #define BN_MP_EXCH_C
296 #endif
297
298 #if defined(BN_MP_DIV_3_C)
299 #define BN_MP_INIT_SIZE_C
300 #define BN_MP_CLAMP_C
301 #define BN_MP_EXCH_C
302 #define BN_MP_CLEAR_C
303 #endif
304
305 #if defined(BN_MP_DIV_D_C)
306 #define BN_MP_ISZERO_C
307 #define BN_MP_COPY_C
308 #define BN_MP_DIV_2D_C
309 #define BN_MP_DIV_3_C
310 #define BN_MP_INIT_SIZE_C
311 #define BN_MP_CLAMP_C
312 #define BN_MP_EXCH_C
313 #define BN_MP_CLEAR_C
314 #endif
315
316 #if defined(BN_MP_DR_IS_MODULUS_C)
317 #endif
318
319 #if defined(BN_MP_DR_REDUCE_C)
320 #define BN_MP_GROW_C
321 #define BN_MP_CLAMP_C
322 #define BN_MP_CMP_MAG_C
323 #define BN_S_MP_SUB_C
324 #endif
325
326 #if defined(BN_MP_DR_SETUP_C)
327 #endif
328
329 #if defined(BN_MP_EXCH_C)
330 #endif
331
332 #if defined(BN_MP_EXPT_D_C)
333 #define BN_MP_INIT_COPY_C
334 #define BN_MP_SET_C
335 #define BN_MP_SQR_C
336 #define BN_MP_CLEAR_C
337 #define BN_MP_MUL_C
338 #endif
339
340 #if defined(BN_MP_EXPTMOD_C)
341 #define BN_MP_INIT_C
342 #define BN_MP_INVMOD_C
343 #define BN_MP_CLEAR_C
344 #define BN_MP_ABS_C
345 #define BN_MP_CLEAR_MULTI_C
346 #define BN_MP_REDUCE_IS_2K_L_C

NetBurner, Inc.
22.358 mpi_class.h 1547

347 #define BN_S_MP_EXPTMOD_C


348 #define BN_MP_DR_IS_MODULUS_C
349 #define BN_MP_REDUCE_IS_2K_C
350 #define BN_MP_ISODD_C
351 #define BN_MP_EXPTMOD_FAST_C
352 #define BN_MP_EXPTMOD_BASE_2
353 #endif
354
355 #if defined(BN_MP_EXPTMOD_FAST_C)
356 #define BN_MP_COUNT_BITS_C
357 #define BN_MP_INIT_C
358 #define BN_MP_CLEAR_C
359 #define BN_MP_MONTGOMERY_SETUP_C
360 #define BN_FAST_MP_MONTGOMERY_REDUCE_C
361 #define BN_MP_MONTGOMERY_REDUCE_C
362 #define BN_MP_DR_SETUP_C
363 #define BN_MP_DR_REDUCE_C
364 #define BN_MP_REDUCE_2K_SETUP_C
365 #define BN_MP_REDUCE_2K_C
366 #define BN_MP_MONTGOMERY_CALC_NORMALIZATION_C
367 #define BN_MP_MULMOD_C
368 #define BN_MP_SET_C
369 #define BN_MP_MOD_C
370 #define BN_MP_COPY_C
371 #define BN_MP_SQR_C
372 #define BN_MP_MUL_C
373 #define BN_MP_EXCH_C
374 #endif
375
376 #if defined(BN_MP_EXTEUCLID_C)
377 #define BN_MP_INIT_MULTI_C
378 #define BN_MP_SET_C
379 #define BN_MP_COPY_C
380 #define BN_MP_ISZERO_C
381 #define BN_MP_DIV_C
382 #define BN_MP_MUL_C
383 #define BN_MP_SUB_C
384 #define BN_MP_NEG_C
385 #define BN_MP_EXCH_C
386 #define BN_MP_CLEAR_MULTI_C
387 #endif
388
389 #if defined(BN_MP_FREAD_C)
390 #define BN_MP_ZERO_C
391 #define BN_MP_S_RMAP_C
392 #define BN_MP_MUL_D_C
393 #define BN_MP_ADD_D_C
394 #define BN_MP_CMP_D_C
395 #endif
396
397 #if defined(BN_MP_FWRITE_C)
398 #define BN_MP_RADIX_SIZE_C
399 #define BN_MP_TORADIX_C
400 #endif
401
402 #if defined(BN_MP_GCD_C)
403 #define BN_MP_ISZERO_C
404 #define BN_MP_ABS_C
405 #define BN_MP_ZERO_C
406 #define BN_MP_INIT_COPY_C
407 #define BN_MP_CNT_LSB_C
408 #define BN_MP_DIV_2D_C
409 #define BN_MP_CMP_MAG_C
410 #define BN_MP_EXCH_C
411 #define BN_S_MP_SUB_C
412 #define BN_MP_MUL_2D_C
413 #define BN_MP_CLEAR_C
414 #endif
415
416 #if defined(BN_MP_GET_INT_C)
417 #endif
418
419 #if defined(BN_MP_GROW_C)
420 #endif
421
422 #if defined(BN_MP_INIT_C)
423 #endif
424
425 #if defined(BN_MP_INIT_COPY_C)
426 #define BN_MP_COPY_C
427 #endif
428
429 #if defined(BN_MP_INIT_MULTI_C)
430 #define BN_MP_ERR_C
431 #define BN_MP_INIT_C
432 #define BN_MP_CLEAR_C
433 #endif

NetBurner, Inc.
1548 File Documentation

434
435 #if defined(BN_MP_INIT_SET_C)
436 #define BN_MP_INIT_C
437 #define BN_MP_SET_C
438 #endif
439
440 #if defined(BN_MP_INIT_SET_INT_C)
441 #define BN_MP_INIT_C
442 #define BN_MP_SET_INT_C
443 #endif
444
445 #if defined(BN_MP_INIT_SIZE_C)
446 #define BN_MP_INIT_C
447 #endif
448
449 #if defined(BN_MP_INVMOD_C)
450 #define BN_MP_ISZERO_C
451 #define BN_MP_ISODD_C
452 #define BN_FAST_MP_INVMOD_C
453 #define BN_MP_INVMOD_SLOW_C
454 #endif
455
456 #if defined(BN_MP_INVMOD_SLOW_C)
457 #define BN_MP_ISZERO_C
458 #define BN_MP_INIT_MULTI_C
459 #define BN_MP_MOD_C
460 #define BN_MP_COPY_C
461 #define BN_MP_ISEVEN_C
462 #define BN_MP_SET_C
463 #define BN_MP_DIV_2_C
464 #define BN_MP_ISODD_C
465 #define BN_MP_ADD_C
466 #define BN_MP_SUB_C
467 #define BN_MP_CMP_C
468 #define BN_MP_CMP_D_C
469 #define BN_MP_CMP_MAG_C
470 #define BN_MP_EXCH_C
471 #define BN_MP_CLEAR_MULTI_C
472 #endif
473
474 #if defined(BN_MP_IS_SQUARE_C)
475 #define BN_MP_MOD_D_C
476 #define BN_MP_INIT_SET_INT_C
477 #define BN_MP_MOD_C
478 #define BN_MP_GET_INT_C
479 #define BN_MP_SQRT_C
480 #define BN_MP_SQR_C
481 #define BN_MP_CMP_MAG_C
482 #define BN_MP_CLEAR_C
483 #endif
484
485 #if defined(BN_MP_JACOBI_C)
486 #define BN_MP_CMP_D_C
487 #define BN_MP_ISZERO_C
488 #define BN_MP_INIT_COPY_C
489 #define BN_MP_CNT_LSB_C
490 #define BN_MP_DIV_2D_C
491 #define BN_MP_MOD_C
492 #define BN_MP_CLEAR_C
493 #endif
494
495 #if defined(BN_MP_KARATSUBA_MUL_C)
496 #define BN_MP_MUL_C
497 #define BN_MP_INIT_SIZE_C
498 #define BN_MP_CLAMP_C
499 #define BN_MP_SUB_C
500 #define BN_MP_ADD_C
501 #define BN_MP_LSHD_C
502 #define BN_MP_CLEAR_C
503 #endif
504
505 #if defined(BN_MP_KARATSUBA_SQR_C)
506 #define BN_MP_INIT_SIZE_C
507 #define BN_MP_CLAMP_C
508 #define BN_MP_SQR_C
509 #define BN_MP_SUB_C
510 #define BN_S_MP_ADD_C
511 #define BN_MP_LSHD_C
512 #define BN_MP_ADD_C
513 #define BN_MP_CLEAR_C
514 #endif
515
516 #if defined(BN_MP_LCM_C)
517 #define BN_MP_INIT_MULTI_C
518 #define BN_MP_GCD_C
519 #define BN_MP_CMP_MAG_C
520 #define BN_MP_DIV_C

NetBurner, Inc.
22.358 mpi_class.h 1549

521 #define BN_MP_MUL_C


522 #define BN_MP_CLEAR_MULTI_C
523 #endif
524
525 #if defined(BN_MP_LSHD_C)
526 #define BN_MP_GROW_C
527 #define BN_MP_RSHD_C
528 #endif
529
530 #if defined(BN_MP_MOD_C)
531 #define BN_MP_INIT_C
532 #define BN_MP_DIV_C
533 #define BN_MP_CLEAR_C
534 #define BN_MP_ADD_C
535 #define BN_MP_EXCH_C
536 #endif
537
538 #if defined(BN_MP_MOD_2D_C)
539 #define BN_MP_ZERO_C
540 #define BN_MP_COPY_C
541 #define BN_MP_CLAMP_C
542 #endif
543
544 #if defined(BN_MP_MOD_D_C)
545 #define BN_MP_DIV_D_C
546 #endif
547
548 #if defined(BN_MP_MONTGOMERY_CALC_NORMALIZATION_C)
549 #define BN_MP_COUNT_BITS_C
550 #define BN_MP_2EXPT_C
551 #define BN_MP_SET_C
552 #define BN_MP_MUL_2_C
553 #define BN_MP_CMP_MAG_C
554 #define BN_S_MP_SUB_C
555 #endif
556
557 #if defined(BN_MP_MONTGOMERY_REDUCE_C)
558 #define BN_FAST_MP_MONTGOMERY_REDUCE_C
559 #define BN_MP_GROW_C
560 #define BN_MP_CLAMP_C
561 #define BN_MP_RSHD_C
562 #define BN_MP_CMP_MAG_C
563 #define BN_S_MP_SUB_C
564 #endif
565
566 #if defined(BN_MP_MONTGOMERY_SETUP_C)
567 #endif
568
569 #if defined(BN_MP_MUL_C)
570 #define BN_MP_TOOM_MUL_C
571 #define BN_MP_KARATSUBA_MUL_C
572 #define BN_FAST_S_MP_MUL_DIGS_C
573 #define BN_S_MP_MUL_C
574 #define BN_S_MP_MUL_DIGS_C
575 #endif
576
577 #if defined(BN_MP_MUL_2_C)
578 #define BN_MP_GROW_C
579 #endif
580
581 #if defined(BN_MP_MUL_2D_C)
582 #define BN_MP_COPY_C
583 #define BN_MP_GROW_C
584 #define BN_MP_LSHD_C
585 #define BN_MP_CLAMP_C
586 #endif
587
588 #if defined(BN_MP_MUL_D_C)
589 #define BN_MP_GROW_C
590 #define BN_MP_CLAMP_C
591 #endif
592
593 #if defined(BN_MP_MULMOD_C)
594 #define BN_MP_INIT_C
595 #define BN_MP_MUL_C
596 #define BN_MP_CLEAR_C
597 #define BN_MP_MOD_C
598 #endif
599
600 #if defined(BN_MP_N_ROOT_C)
601 #define BN_MP_INIT_C
602 #define BN_MP_SET_C
603 #define BN_MP_COPY_C
604 #define BN_MP_EXPT_D_C
605 #define BN_MP_MUL_C
606 #define BN_MP_SUB_C
607 #define BN_MP_MUL_D_C

NetBurner, Inc.
1550 File Documentation

608 #define BN_MP_DIV_C


609 #define BN_MP_CMP_C
610 #define BN_MP_SUB_D_C
611 #define BN_MP_EXCH_C
612 #define BN_MP_CLEAR_C
613 #endif
614
615 #if defined(BN_MP_NEG_C)
616 #define BN_MP_COPY_C
617 #define BN_MP_ISZERO_C
618 #endif
619
620 #if defined(BN_MP_OR_C)
621 #define BN_MP_INIT_COPY_C
622 #define BN_MP_CLAMP_C
623 #define BN_MP_EXCH_C
624 #define BN_MP_CLEAR_C
625 #endif
626
627 #if defined(BN_MP_PRIME_FERMAT_C)
628 #define BN_MP_CMP_D_C
629 #define BN_MP_INIT_C
630 #define BN_MP_EXPTMOD_C
631 #define BN_MP_CMP_C
632 #define BN_MP_CLEAR_C
633 #endif
634
635 #if defined(BN_MP_PRIME_IS_DIVISIBLE_C)
636 #define BN_MP_MOD_D_C
637 #endif
638
639 #if defined(BN_MP_PRIME_IS_PRIME_C)
640 #define BN_MP_CMP_D_C
641 #define BN_MP_PRIME_IS_DIVISIBLE_C
642 #define BN_MP_INIT_C
643 #define BN_MP_SET_C
644 #define BN_MP_PRIME_MILLER_RABIN_C
645 #define BN_MP_CLEAR_C
646 #endif
647
648 #if defined(BN_MP_PRIME_MILLER_RABIN_C)
649 #define BN_MP_CMP_D_C
650 #define BN_MP_INIT_COPY_C
651 #define BN_MP_SUB_D_C
652 #define BN_MP_CNT_LSB_C
653 #define BN_MP_DIV_2D_C
654 #define BN_MP_EXPTMOD_C
655 #define BN_MP_CMP_C
656 #define BN_MP_SQRMOD_C
657 #define BN_MP_CLEAR_C
658 #endif
659
660 #if defined(BN_MP_PRIME_NEXT_PRIME_C)
661 #define BN_MP_CMP_D_C
662 #define BN_MP_SET_C
663 #define BN_MP_SUB_D_C
664 #define BN_MP_ISEVEN_C
665 #define BN_MP_MOD_D_C
666 #define BN_MP_INIT_C
667 #define BN_MP_ADD_D_C
668 #define BN_MP_PRIME_MILLER_RABIN_C
669 #define BN_MP_CLEAR_C
670 #endif
671
672 #if defined(BN_MP_PRIME_RABIN_MILLER_TRIALS_C)
673 #endif
674
675 #if defined(BN_MP_PRIME_RANDOM_EX_C)
676 #define BN_MP_READ_UNSIGNED_BIN_C
677 #define BN_MP_PRIME_IS_PRIME_C
678 #define BN_MP_SUB_D_C
679 #define BN_MP_DIV_2_C
680 #define BN_MP_MUL_2_C
681 #define BN_MP_ADD_D_C
682 #endif
683
684 #if defined(BN_MP_RADIX_SIZE_C)
685 #define BN_MP_COUNT_BITS_C
686 #define BN_MP_INIT_COPY_C
687 #define BN_MP_ISZERO_C
688 #define BN_MP_DIV_D_C
689 #define BN_MP_CLEAR_C
690 #endif
691
692 #if defined(BN_MP_RADIX_SMAP_C)
693 #define BN_MP_S_RMAP_C
694 #endif

NetBurner, Inc.
22.358 mpi_class.h 1551

695
696 #if defined(BN_MP_RAND_C)
697 #define BN_MP_ZERO_C
698 #define BN_MP_ADD_D_C
699 #define BN_MP_LSHD_C
700 #endif
701
702 #if defined(BN_MP_READ_RADIX_C)
703 #define BN_MP_ZERO_C
704 #define BN_MP_S_RMAP_C
705 #define BN_MP_RADIX_SMAP_C
706 #define BN_MP_MUL_D_C
707 #define BN_MP_ADD_D_C
708 #define BN_MP_ISZERO_C
709 #endif
710
711 #if defined(BN_MP_READ_SIGNED_BIN_C)
712 #define BN_MP_READ_UNSIGNED_BIN_C
713 #endif
714
715 #if defined(BN_MP_READ_UNSIGNED_BIN_C)
716 #define BN_MP_GROW_C
717 #define BN_MP_ZERO_C
718 #define BN_MP_MUL_2D_C
719 #define BN_MP_CLAMP_C
720 #endif
721
722 #if defined(BN_MP_REDUCE_C)
723 #define BN_MP_REDUCE_SETUP_C
724 #define BN_MP_INIT_COPY_C
725 #define BN_MP_RSHD_C
726 #define BN_MP_MUL_C
727 #define BN_S_MP_MUL_HIGH_DIGS_C
728 #define BN_FAST_S_MP_MUL_HIGH_DIGS_C
729 #define BN_MP_MOD_2D_C
730 #define BN_S_MP_MUL_DIGS_C
731 #define BN_MP_SUB_C
732 #define BN_MP_CMP_D_C
733 #define BN_MP_SET_C
734 #define BN_MP_LSHD_C
735 #define BN_MP_ADD_C
736 #define BN_MP_CMP_C
737 #define BN_S_MP_SUB_C
738 #define BN_MP_CLEAR_C
739 #endif
740
741 #if defined(BN_MP_REDUCE_2K_C)
742 #define BN_MP_INIT_C
743 #define BN_MP_COUNT_BITS_C
744 #define BN_MP_DIV_2D_C
745 #define BN_MP_MUL_D_C
746 #define BN_S_MP_ADD_C
747 #define BN_MP_CMP_MAG_C
748 #define BN_S_MP_SUB_C
749 #define BN_MP_CLEAR_C
750 #endif
751
752 #if defined(BN_MP_REDUCE_2K_L_C)
753 #define BN_MP_INIT_C
754 #define BN_MP_COUNT_BITS_C
755 #define BN_MP_DIV_2D_C
756 #define BN_MP_MUL_C
757 #define BN_S_MP_ADD_C
758 #define BN_MP_CMP_MAG_C
759 #define BN_S_MP_SUB_C
760 #define BN_MP_CLEAR_C
761 #endif
762
763 #if defined(BN_MP_REDUCE_2K_SETUP_C)
764 #define BN_MP_INIT_C
765 #define BN_MP_COUNT_BITS_C
766 #define BN_MP_2EXPT_C
767 #define BN_MP_CLEAR_C
768 #define BN_S_MP_SUB_C
769 #endif
770
771 #if defined(BN_MP_REDUCE_2K_SETUP_L_C)
772 #define BN_MP_INIT_C
773 #define BN_MP_2EXPT_C
774 #define BN_MP_COUNT_BITS_C
775 #define BN_S_MP_SUB_C
776 #define BN_MP_CLEAR_C
777 #endif
778
779 #if defined(BN_MP_REDUCE_IS_2K_C)
780 #define BN_MP_REDUCE_2K_C
781 #define BN_MP_COUNT_BITS_C

NetBurner, Inc.
1552 File Documentation

782 #endif
783
784 #if defined(BN_MP_REDUCE_IS_2K_L_C)
785 #endif
786
787 #if defined(BN_MP_REDUCE_SETUP_C)
788 #define BN_MP_2EXPT_C
789 #define BN_MP_DIV_C
790 #endif
791
792 #if defined(BN_MP_RSHD_C)
793 #define BN_MP_ZERO_C
794 #endif
795
796 #if defined(BN_MP_SET_C)
797 #define BN_MP_ZERO_C
798 #endif
799
800 #if defined(BN_MP_SET_INT_C)
801 #define BN_MP_ZERO_C
802 #define BN_MP_MUL_2D_C
803 #define BN_MP_CLAMP_C
804 #endif
805
806 #if defined(BN_MP_SHRINK_C)
807 #endif
808
809 #if defined(BN_MP_SIGNED_BIN_SIZE_C)
810 #define BN_MP_UNSIGNED_BIN_SIZE_C
811 #endif
812
813 #if defined(BN_MP_SQR_C)
814 #define BN_MP_TOOM_SQR_C
815 #define BN_MP_KARATSUBA_SQR_C
816 #define BN_FAST_S_MP_SQR_C
817 #define BN_S_MP_SQR_C
818 #endif
819
820 #if defined(BN_MP_SQRMOD_C)
821 #define BN_MP_INIT_C
822 #define BN_MP_SQR_C
823 #define BN_MP_CLEAR_C
824 #define BN_MP_MOD_C
825 #endif
826
827 #if defined(BN_MP_SQRT_C)
828 #define BN_MP_N_ROOT_C
829 #define BN_MP_ISZERO_C
830 #define BN_MP_ZERO_C
831 #define BN_MP_INIT_COPY_C
832 #define BN_MP_RSHD_C
833 #define BN_MP_DIV_C
834 #define BN_MP_ADD_C
835 #define BN_MP_DIV_2_C
836 #define BN_MP_CMP_MAG_C
837 #define BN_MP_EXCH_C
838 #define BN_MP_CLEAR_C
839 #endif
840
841 #if defined(BN_MP_SUB_C)
842 #define BN_S_MP_ADD_C
843 #define BN_MP_CMP_MAG_C
844 #define BN_S_MP_SUB_C
845 #endif
846
847 #if defined(BN_MP_SUB_D_C)
848 #define BN_MP_GROW_C
849 #define BN_MP_ADD_D_C
850 #define BN_MP_CLAMP_C
851 #endif
852
853 #if defined(BN_MP_SUBMOD_C)
854 #define BN_MP_INIT_C
855 #define BN_MP_SUB_C
856 #define BN_MP_CLEAR_C
857 #define BN_MP_MOD_C
858 #endif
859
860 #if defined(BN_MP_TO_SIGNED_BIN_C)
861 #define BN_MP_TO_UNSIGNED_BIN_C
862 #endif
863
864 #if defined(BN_MP_TO_SIGNED_BIN_N_C)
865 #define BN_MP_SIGNED_BIN_SIZE_C
866 #define BN_MP_TO_SIGNED_BIN_C
867 #endif
868

NetBurner, Inc.
22.358 mpi_class.h 1553

869 #if defined(BN_MP_TO_UNSIGNED_BIN_C)


870 #define BN_MP_INIT_COPY_C
871 #define BN_MP_ISZERO_C
872 #define BN_MP_DIV_2D_C
873 #define BN_MP_CLEAR_C
874 #endif
875
876 #if defined(BN_MP_TO_UNSIGNED_BIN_N_C)
877 #define BN_MP_UNSIGNED_BIN_SIZE_C
878 #define BN_MP_TO_UNSIGNED_BIN_C
879 #endif
880
881 #if defined(BN_MP_TOOM_MUL_C)
882 #define BN_MP_INIT_MULTI_C
883 #define BN_MP_MOD_2D_C
884 #define BN_MP_COPY_C
885 #define BN_MP_RSHD_C
886 #define BN_MP_MUL_C
887 #define BN_MP_MUL_2_C
888 #define BN_MP_ADD_C
889 #define BN_MP_SUB_C
890 #define BN_MP_DIV_2_C
891 #define BN_MP_MUL_2D_C
892 #define BN_MP_MUL_D_C
893 #define BN_MP_DIV_3_C
894 #define BN_MP_LSHD_C
895 #define BN_MP_CLEAR_MULTI_C
896 #endif
897
898 #if defined(BN_MP_TOOM_SQR_C)
899 #define BN_MP_INIT_MULTI_C
900 #define BN_MP_MOD_2D_C
901 #define BN_MP_COPY_C
902 #define BN_MP_RSHD_C
903 #define BN_MP_SQR_C
904 #define BN_MP_MUL_2_C
905 #define BN_MP_ADD_C
906 #define BN_MP_SUB_C
907 #define BN_MP_DIV_2_C
908 #define BN_MP_MUL_2D_C
909 #define BN_MP_MUL_D_C
910 #define BN_MP_DIV_3_C
911 #define BN_MP_LSHD_C
912 #define BN_MP_CLEAR_MULTI_C
913 #endif
914
915 #if defined(BN_MP_TORADIX_C)
916 #define BN_MP_ISZERO_C
917 #define BN_MP_INIT_COPY_C
918 #define BN_MP_DIV_D_C
919 #define BN_MP_CLEAR_C
920 #define BN_MP_S_RMAP_C
921 #endif
922
923 #if defined(BN_MP_TORADIX_N_C)
924 #define BN_MP_ISZERO_C
925 #define BN_MP_INIT_COPY_C
926 #define BN_MP_DIV_D_C
927 #define BN_MP_CLEAR_C
928 #define BN_MP_S_RMAP_C
929 #endif
930
931 #if defined(BN_MP_UNSIGNED_BIN_SIZE_C)
932 #define BN_MP_COUNT_BITS_C
933 #endif
934
935 #if defined(BN_MP_XOR_C)
936 #define BN_MP_INIT_COPY_C
937 #define BN_MP_CLAMP_C
938 #define BN_MP_EXCH_C
939 #define BN_MP_CLEAR_C
940 #endif
941
942 #if defined(BN_MP_ZERO_C)
943 #endif
944
945 #if defined(BN_PRIME_TAB_C)
946 #endif
947
948 #if defined(BN_REVERSE_C)
949 #endif
950
951 #if defined(BN_S_MP_ADD_C)
952 #define BN_MP_GROW_C
953 #define BN_MP_CLAMP_C
954 #endif
955

NetBurner, Inc.
1554 File Documentation

956 #if defined(BN_S_MP_EXPTMOD_C)


957 #define BN_MP_COUNT_BITS_C
958 #define BN_MP_INIT_C
959 #define BN_MP_CLEAR_C
960 #define BN_MP_REDUCE_SETUP_C
961 #define BN_MP_REDUCE_C
962 #define BN_MP_REDUCE_2K_SETUP_L_C
963 #define BN_MP_REDUCE_2K_L_C
964 #define BN_MP_MOD_C
965 #define BN_MP_COPY_C
966 #define BN_MP_SQR_C
967 #define BN_MP_MUL_C
968 #define BN_MP_SET_C
969 #define BN_MP_EXCH_C
970 #endif
971
972 #if defined(BN_S_MP_MUL_DIGS_C)
973 #define BN_FAST_S_MP_MUL_DIGS_C
974 #define BN_MP_INIT_SIZE_C
975 #define BN_MP_CLAMP_C
976 #define BN_MP_EXCH_C
977 #define BN_MP_CLEAR_C
978 #endif
979
980 #if defined(BN_S_MP_MUL_HIGH_DIGS_C)
981 #define BN_FAST_S_MP_MUL_HIGH_DIGS_C
982 #define BN_MP_INIT_SIZE_C
983 #define BN_MP_CLAMP_C
984 #define BN_MP_EXCH_C
985 #define BN_MP_CLEAR_C
986 #endif
987
988 #if defined(BN_S_MP_SQR_C)
989 #define BN_MP_INIT_SIZE_C
990 #define BN_MP_CLAMP_C
991 #define BN_MP_EXCH_C
992 #define BN_MP_CLEAR_C
993 #endif
994
995 #if defined(BN_S_MP_SUB_C)
996 #define BN_MP_GROW_C
997 #define BN_MP_CLAMP_C
998 #endif
999
1000 #if defined(BNCORE_C)
1001 #endif
1002
1003 #ifdef LTM3
1004 #define LTM_LAST
1005 #endif
1006 #include "mpi_superclass.h"
1007 #include "mpi_class.h"
1008 #else
1009 #define LTM_LAST
1010 #endif
1011

22.359 mpi_superclass.h
1 /* mpi_superclass.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13
14 /* super class file for PK algos */
15
16 /* default ... include all MPI */
17 #define LTM_ALL
18
19 /* RSA only (does not support DH/DSA/ECC) */
20 /* #define SC_RSA_1 */
21
22 /* For reference.... On an Athlon64 optimizing for speed...
23
24 LTM’s mpi.o with all functions [striped] is 142KiB in size.
25
26 */

NetBurner, Inc.
22.360 pkcs11.h 1555

27
28 /* Works for RSA only, mpi.o is 68KiB */
29 #ifdef SC_RSA_1
30 #define BN_MP_SHRINK_C
31 #define BN_MP_LCM_C
32 #define BN_MP_PRIME_RANDOM_EX_C
33 #define BN_MP_INVMOD_C
34 #define BN_MP_GCD_C
35 #define BN_MP_MOD_C
36 #define BN_MP_MULMOD_C
37 #define BN_MP_ADDMOD_C
38 #define BN_MP_EXPTMOD_C
39 #define BN_MP_SET_INT_C
40 #define BN_MP_INIT_MULTI_C
41 #define BN_MP_CLEAR_MULTI_C
42 #define BN_MP_UNSIGNED_BIN_SIZE_C
43 #define BN_MP_TO_UNSIGNED_BIN_C
44 #define BN_MP_MOD_D_C
45 #define BN_MP_PRIME_RABIN_MILLER_TRIALS_C
46 #define BN_REVERSE_C
47 #define BN_PRIME_TAB_C
48
49 /* other modifiers */
50 #define BN_MP_DIV_SMALL /* Slower division, not critical */
51
52 /* here we are on the last pass so we turn things off. The functions classes are still there
53 * but we remove them specifically from the build. This also invokes tweaks in functions
54 * like removing support for even moduli, etc...
55 */
56 #ifdef LTM_LAST
57 #undef BN_MP_TOOM_MUL_C
58 #undef BN_MP_TOOM_SQR_C
59 #undef BN_MP_KARATSUBA_MUL_C
60 #undef BN_MP_KARATSUBA_SQR_C
61 #undef BN_MP_REDUCE_C
62 #undef BN_MP_REDUCE_SETUP_C
63 #undef BN_MP_DR_IS_MODULUS_C
64 #undef BN_MP_DR_SETUP_C
65 #undef BN_MP_DR_REDUCE_C
66 #undef BN_MP_REDUCE_IS_2K_C
67 #undef BN_MP_REDUCE_2K_SETUP_C
68 #undef BN_MP_REDUCE_2K_C
69 #undef BN_S_MP_EXPTMOD_C
70 #undef BN_MP_DIV_3_C
71 #undef BN_S_MP_MUL_HIGH_DIGS_C
72 #undef BN_FAST_S_MP_MUL_HIGH_DIGS_C
73 #undef BN_FAST_MP_INVMOD_C
74
75 /* To safely undefine these you have to make sure your RSA key won’t exceed the Comba threshold
76 * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines]
77 * which means roughly speaking you can handle up to 2536-bit RSA keys with these defined without
78 * trouble.
79 */
80 #undef BN_S_MP_MUL_DIGS_C
81 #undef BN_S_MP_SQR_C
82 #undef BN_MP_MONTGOMERY_REDUCE_C
83 #endif
84
85 #endif
86

22.360 pkcs11.h
1 /* pkcs11.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef _PKCS11_H_
13 #define _PKCS11_H_
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 #ifndef NULL_PTR
20 #define NULL_PTR 0
21 #endif
22 #define CK_TRUE 1

NetBurner, Inc.
1556 File Documentation

23 #define CK_FALSE 0
24
25
26 #define CK_INVALID_HANDLE 0UL
27
28 #define CKN_SURRENDER 0UL
29
30 #define CKF_TOKEN_PRESENT 0x00000001UL
31 #define CKF_REMOVABLE_DEVICE 0x00000002UL
32 #define CKF_HW_SLOT 0x00000004UL
33
34 #define CKF_HW 0x00000001UL
35 #define CKF_ENCRYPT 0x00000100UL
36 #define CKF_DECRYPT 0x00000200UL
37 #define CKF_DIGEST 0x00000400UL
38 #define CKF_SIGN 0x00000800UL
39 #define CKF_SIGN_RECOVER 0x00001000UL
40 #define CKF_VERIFY 0x00002000UL
41 #define CKF_VERIFY_RECOVER 0x00004000UL
42 #define CKF_GENERATE 0x00008000UL
43 #define CKF_GENERATE_KEY_PAIR 0x00010000UL
44 #define CKF_WRAP 0x00020000UL
45 #define CKF_UNWRAP 0x00040000UL
46 #define CKF_DERIVE 0x00080000UL
47 #define CKF_EC_F_P 0x00100000UL
48 #define CKF_EC_F_2M 0x00200000UL
49 #define CKF_EC_ECPARAMETERS 0x00400000UL
50 #define CKF_EC_NAMEDCURVE 0x00800000UL
51 #define CKF_EC_UNCOMPRESS 0x01000000UL
52 #define CKF_EC_COMPRESS 0x02000000UL
53
54 #define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001UL
55 #define CKF_OS_LOCKING_OK 0x00000002UL
56
57 #define CKU_SO 0UL
58 #define CKU_USER 1UL
59 #define CKU_CONTEXT_SPECIFIC 2UL
60
61 #define CKF_RW_SESSION 0x00000002UL
62 #define CKF_SERIAL_SESSION 0x00000004UL
63
64 #define CKO_PUBLIC_KEY 0x00000002UL
65 #define CKO_PRIVATE_KEY 0x00000003UL
66 #define CKO_SECRET_KEY 0x00000004UL
67
68 #define CKK_RSA 0x00000000UL
69 #define CKK_DH 0x00000002UL
70 #define CKK_EC 0x00000003UL
71 #define CKK_GENERIC_SECRET 0x00000010UL
72 #define CKK_AES 0x0000001FUL
73 #define CKK_MD5_HMAC 0x00000027UL
74 #define CKK_SHA_1_HMAC 0x00000028UL
75 #define CKK_SHA256_HMAC 0x0000002bUL
76 #define CKK_SHA384_HMAC 0x0000002cUL
77 #define CKK_SHA512_HMAC 0x0000002dUL
78 #define CKK_SHA224_HMAC 0x0000002eUL
79
80 #define CKA_CLASS 0x00000000UL
81 #define CKA_TOKEN 0x00000001UL
82 #define CKA_PRIVATE 0x00000002UL
83 #define CKA_LABEL 0x00000003UL
84 #define CKA_VALUE 0x00000011UL
85 #define CKA_OBJECT_ID 0x00000012UL
86 #define CKA_OWNER 0x00000084UL
87 #define CKA_TRUSTED 0x00000086UL
88 #define CKA_KEY_TYPE 0x00000100UL
89 #define CKA_ID 0x00000102UL
90 #define CKA_SENSITIVE 0x00000103UL
91 #define CKA_ENCRYPT 0x00000104UL
92 #define CKA_DECRYPT 0x00000105UL
93 #define CKA_WRAP 0x00000106UL
94 #define CKA_UNWRAP 0x00000107UL
95 #define CKA_SIGN 0x00000108UL
96 #define CKA_SIGN_RECOVER 0x00000109UL
97 #define CKA_VERIFY 0x0000010AUL
98 #define CKA_VERIFY_RECOVER 0x0000010BUL
99 #define CKA_DERIVE 0x0000010CUL
100 #define CKA_MODULUS 0x00000120UL
101 #define CKA_MODULUS_BITS 0x00000121UL
102 #define CKA_PUBLIC_EXPONENT 0x00000122UL
103 #define CKA_PRIVATE_EXPONENT 0x00000123UL
104 #define CKA_PRIME_1 0x00000124UL
105 #define CKA_PRIME_2 0x00000125UL
106 #define CKA_EXPONENT_1 0x00000126UL
107 #define CKA_EXPONENT_2 0x00000127UL
108 #define CKA_COEFFICIENT 0x00000128UL
109 #define CKA_PUBLIC_KEY_INFO 0x00000129UL

NetBurner, Inc.
22.360 pkcs11.h 1557

110 #define CKA_PRIME 0x00000130UL


111 #define CKA_BASE 0x00000132UL
112 #define CKA_PRIME_BITS 0x00000133UL
113 #define CKA_VALUE_BITS 0x00000160UL
114 #define CKA_VALUE_LEN 0x00000161UL
115 #define CKA_EXTRACTABLE 0x00000162UL
116 #define CKA_LOCAL 0x00000163UL
117 #define CKA_NEVER_EXTRACTABLE 0x00000164UL
118 #define CKA_ALWAYS_SENSITIVE 0x00000165UL
119 #define CKA_KEY_GEN_MECHANISM 0x00000166UL
120 #define CKA_MODIFIABLE 0x00000170UL
121 #define CKA_COPYABLE 0x00000171UL
122 #define CKA_DESTROYABLE 0x00000172UL
123 #define CKA_EC_PARAMS 0x00000180UL
124 #define CKA_EC_POINT 0x00000181UL
125 #define CKA_ALWAYS_AUTHENTICATE 0x00000202UL
126 #define CKA_HW_FEATURE_TYPE 0x00000300UL
127 #define CKA_RESET_ON_INIT 0x00000301UL
128 #define CKA_HAS_RESET 0x00000302UL
129
130 #define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
131 #define CKM_RSA_X_509 0x00000003UL
132 #define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
133 #define CKM_DH_PKCS_DERIVE 0x00000021UL
134 #define CKM_MD5_HMAC 0x00000211UL
135 #define CKM_SHA_1_HMAC 0x00000221UL
136 #define CKM_SHA256_HMAC 0x00000251UL
137 #define CKM_SHA224_HMAC 0x00000256UL
138 #define CKM_SHA384_HMAC 0x00000261UL
139 #define CKM_SHA512_HMAC 0x00000271UL
140 #define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
141 #define CKM_EC_KEY_PAIR_GEN 0x00001040UL
142 #define CKM_ECDSA 0x00001041UL
143 #define CKM_ECDH1_DERIVE 0x00001050UL
144 #define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL
145 #define CKM_AES_KEY_GEN 0x00001080UL
146 #define CKM_AES_CBC 0x00001082UL
147 #define CKM_AES_GCM 0x00001087UL
148
149 #define CKR_OK 0x00000000UL
150 #define CKR_MECHANISM_INVALID 0x00000070UL
151 #define CKR_SIGNATURE_INVALID 0x000000C0UL
152
153 #define CKD_NULL 0x00000001UL
154
155
156 typedef unsigned char CK_BYTE;
157 typedef CK_BYTE CK_CHAR;
158 typedef CK_BYTE CK_UTF8CHAR;
159 typedef CK_BYTE CK_BBOOL;
160 typedef unsigned long int CK_ULONG;
161 typedef long int CK_LONG;
162 typedef CK_ULONG CK_FLAGS;
163 typedef CK_BYTE* CK_BYTE_PTR;
164 typedef CK_CHAR* CK_CHAR_PTR;
165 typedef CK_UTF8CHAR* CK_UTF8CHAR_PTR;
166 typedef CK_ULONG* CK_ULONG_PTR;
167 typedef void* CK_VOID_PTR;
168 typedef CK_VOID_PTR* CK_VOID_PTR_PTR;
169
170
171 typedef CK_ULONG CK_RV;
172
173
174 typedef struct CK_VERSION {
175 CK_BYTE major;
176 CK_BYTE minor;
177 } CK_VERSION;
178 typedef CK_VERSION* CK_VERSION_PTR;
179
180
181 /* Info Types */
182 typedef struct CK_INFO {
183 CK_VERSION cryptokiVersion;
184 CK_UTF8CHAR manufacturerID[32];
185 CK_FLAGS flags;
186 CK_UTF8CHAR libraryDescription[32];
187 CK_VERSION libraryVersion;
188 } CK_INFO;
189 typedef CK_INFO* CK_INFO_PTR;
190
191
192 /* Slot Types */
193 typedef CK_ULONG CK_SLOT_ID;
194 typedef CK_SLOT_ID* CK_SLOT_ID_PTR;
195
196 typedef struct CK_SLOT_INFO {

NetBurner, Inc.
1558 File Documentation

197 CK_UTF8CHAR slotDescription[64];


198 CK_UTF8CHAR manufacturerID[32];
199 CK_FLAGS flags;
200
201 CK_VERSION hardwareVersion;
202 CK_VERSION firmwareVersion;
203 } CK_SLOT_INFO;
204 typedef CK_SLOT_INFO* CK_SLOT_INFO_PTR;
205
206
207 /* Token Types */
208 typedef struct CK_TOKEN_INFO {
209 CK_UTF8CHAR label[32];
210 CK_UTF8CHAR manufacturerID[32];
211 CK_UTF8CHAR model[16];
212 CK_CHAR serialNumber[16];
213 CK_FLAGS flags;
214 CK_ULONG ulMaxSessionCount;
215 CK_ULONG ulSessionCount;
216 CK_ULONG ulMaxRwSessionCount;
217 CK_ULONG ulRwSessionCount;
218 CK_ULONG ulMaxPinLen;
219 CK_ULONG ulMinPinLen;
220 CK_ULONG ulTotalPublicMemory;
221 CK_ULONG ulFreePublicMemory;
222 CK_ULONG ulTotalPrivateMemory;
223 CK_ULONG ulFreePrivateMemory;
224 CK_VERSION hardwareVersion;
225 CK_VERSION firmwareVersion;
226 CK_CHAR utcTime[16];
227 } CK_TOKEN_INFO;
228 typedef CK_TOKEN_INFO* CK_TOKEN_INFO_PTR;
229
230
231 /* Session Types */
232 typedef CK_ULONG CK_SESSION_HANDLE;
233 typedef CK_SESSION_HANDLE* CK_SESSION_HANDLE_PTR;
234
235 typedef CK_ULONG CK_USER_TYPE;
236
237 typedef CK_ULONG CK_STATE;
238
239 typedef struct CK_SESSION_INFO {
240 CK_SLOT_ID slotID;
241 CK_STATE state;
242 CK_FLAGS flags;
243 CK_ULONG ulDeviceError;
244 } CK_SESSION_INFO;
245 typedef CK_SESSION_INFO* CK_SESSION_INFO_PTR;
246
247
248 /* Object Types */
249 typedef CK_ULONG CK_OBJECT_HANDLE;
250 typedef CK_OBJECT_HANDLE* CK_OBJECT_HANDLE_PTR;
251
252 typedef CK_ULONG CK_OBJECT_CLASS;
253 typedef CK_OBJECT_CLASS* CK_OBJECT_CLASS_PTR;
254
255 typedef CK_ULONG CK_KEY_TYPE;
256
257 typedef CK_ULONG CK_ATTRIBUTE_TYPE;
258
259 typedef struct CK_ATTRIBUTE {
260 CK_ATTRIBUTE_TYPE type;
261 CK_VOID_PTR pValue;
262 CK_ULONG ulValueLen;
263 } CK_ATTRIBUTE;
264 typedef CK_ATTRIBUTE* CK_ATTRIBUTE_PTR;
265
266
267 /* Mechanism Types */
268 typedef CK_ULONG CK_MECHANISM_TYPE;
269 typedef CK_MECHANISM_TYPE* CK_MECHANISM_TYPE_PTR;
270
271 typedef struct CK_MECHANISM {
272 CK_MECHANISM_TYPE mechanism;
273 CK_VOID_PTR pParameter;
274 CK_ULONG ulParameterLen;
275 } CK_MECHANISM;
276 typedef CK_MECHANISM* CK_MECHANISM_PTR;
277
278 typedef struct CK_MECHANISM_INFO {
279 CK_ULONG ulMinKeySize;
280 CK_ULONG ulMaxKeySize;
281 CK_FLAGS flags;
282 } CK_MECHANISM_INFO;
283 typedef CK_MECHANISM_INFO * CK_MECHANISM_INFO_PTR;

NetBurner, Inc.
22.360 pkcs11.h 1559

284
285
286 typedef CK_ULONG CK_NOTIFICATION;
287
288 typedef CK_RV (*CK_NOTIFY)(CK_SESSION_HANDLE hSession, CK_NOTIFICATION event,
289 CK_VOID_PTR pApplication);
290
291
292 /* Threading types. */
293 typedef CK_RV (*CK_CREATEMUTEX)(CK_VOID_PTR_PTR ppMutex);
294 typedef CK_RV (*CK_DESTROYMUTEX)(CK_VOID_PTR pMutex);
295 typedef CK_RV (*CK_LOCKMUTEX)(CK_VOID_PTR pMutex);
296 typedef CK_RV (*CK_UNLOCKMUTEX)(CK_VOID_PTR pMutex);
297
298 typedef struct CK_C_INITIALIZE_ARGS {
299 CK_CREATEMUTEX CreateMutex;
300 CK_DESTROYMUTEX DestroyMutex;
301 CK_LOCKMUTEX LockMutex;
302 CK_UNLOCKMUTEX UnlockMutex;
303 CK_FLAGS flags;
304 CK_VOID_PTR pReserved;
305 } CK_C_INITIALIZE_ARGS;
306 typedef CK_C_INITIALIZE_ARGS* CK_C_INITIALIZE_ARGS_PTR;
307
308
309 /* Cryptographic algorithm types. */
310 typedef CK_ULONG CK_EC_KDF_TYPE;
311
312 typedef struct CK_ECDH1_DERIVE_PARAMS {
313 CK_EC_KDF_TYPE kdf;
314 CK_ULONG ulSharedDataLen;
315 CK_BYTE_PTR pSharedData;
316 CK_ULONG ulPublicDataLen;
317 CK_BYTE_PTR pPublicData;
318 } CK_ECDH1_DERIVE_PARAMS;
319 typedef CK_ECDH1_DERIVE_PARAMS* CK_ECDH1_DERIVE_PARAMS_PTR;
320
321
322 typedef struct CK_GCM_PARAMS {
323 CK_BYTE_PTR pIv;
324 CK_ULONG ulIvLen;
325 CK_ULONG ulIvBits;
326 CK_BYTE_PTR pAAD;
327 CK_ULONG ulAADLen;
328 CK_ULONG ulTagBits;
329 } CK_GCM_PARAMS;
330 typedef CK_GCM_PARAMS* CK_GCM_PARAMS_PTR;
331
332 /* Function list types. */
333 typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST;
334 typedef CK_FUNCTION_LIST* CK_FUNCTION_LIST_PTR;
335 typedef CK_FUNCTION_LIST_PTR* CK_FUNCTION_LIST_PTR_PTR;
336
337 typedef CK_RV (*CK_C_GetFunctionList)(CK_FUNCTION_LIST_PTR_PTR ppFunctionList);
338
339 #ifdef HAVE_PKCS11_STATIC
340 CK_RV C_GetFunctionList(CK_FUNCTION_LIST_PTR_PTR ppFunctionList);
341 #endif
342
343 struct CK_FUNCTION_LIST {
344 CK_VERSION version;
345
346 CK_RV (*C_Initialize)(CK_VOID_PTR pInitArgs);
347 CK_RV (*C_Finalize)(CK_VOID_PTR pReserved);
348 CK_RV (*C_GetInfo)(CK_INFO_PTR pInfo);
349 CK_RV (*C_GetFunctionList)(CK_FUNCTION_LIST_PTR_PTR ppFunctionList);
350 CK_RV (*C_GetSlotList)(CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList,
351 CK_ULONG_PTR pulCount);
352 CK_RV (*C_GetSlotInfo)(CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo);
353 CK_RV (*C_GetTokenInfo)(CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo);
354 CK_RV (*C_GetMechanismList)(CK_SLOT_ID slotID,
355 CK_MECHANISM_TYPE_PTR pMechanismList,
356 CK_ULONG_PTR pulCount);
357 CK_RV (*C_GetMechanismInfo)(CK_SLOT_ID slotID, CK_MECHANISM_TYPE type,
358 CK_MECHANISM_INFO_PTR pInfo);
359 CK_RV (*C_InitToken)(CK_SLOT_ID slotID, CK_UTF8CHAR_PTR pPin,
360 CK_ULONG ulPinLen, CK_UTF8CHAR_PTR pLabel);
361 CK_RV (*C_InitPIN)(CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pPin,
362 CK_ULONG ulPinLen);
363 CK_RV (*C_SetPIN)(CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pOldPin,
364 CK_ULONG ulOldLen, CK_UTF8CHAR_PTR pNewPin,
365 CK_ULONG ulNewLen);
366 CK_RV (*C_OpenSession)(CK_SLOT_ID slotID, CK_FLAGS flags,
367 CK_VOID_PTR pApplication, CK_NOTIFY Notify,
368 CK_SESSION_HANDLE_PTR phSession);
369 CK_RV (*C_CloseSession)(CK_SESSION_HANDLE hSession);
370 CK_RV (*C_CloseAllSessions)(CK_SLOT_ID slotID);

NetBurner, Inc.
1560 File Documentation

371 CK_RV (*C_GetSessionInfo)(CK_SESSION_HANDLE hSession,


372 CK_SESSION_INFO_PTR pInfo);
373 CK_RV (*C_GetOperationState)(CK_SESSION_HANDLE hSession,
374 CK_BYTE_PTR pOperationState,
375 CK_ULONG_PTR pulOperationStateLen);
376 CK_RV (*C_SetOperationState)(CK_SESSION_HANDLE hSession,
377 CK_BYTE_PTR pOperationState,
378 CK_ULONG ulOperationStateLen,
379 CK_OBJECT_HANDLE hEncryptionKey,
380 CK_OBJECT_HANDLE hAuthenticationKey);
381 CK_RV (*C_Login)(CK_SESSION_HANDLE hSession, CK_USER_TYPE userType,
382 CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen);
383 CK_RV (*C_Logout)(CK_SESSION_HANDLE hSession);
384 CK_RV (*C_CreateObject)(CK_SESSION_HANDLE hSession,
385 CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount,
386 CK_OBJECT_HANDLE_PTR phObject);
387 CK_RV (*C_CopyObject)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject,
388 CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount,
389 CK_OBJECT_HANDLE_PTR phNewObject);
390 CK_RV (*C_DestroyObject)(CK_SESSION_HANDLE hSession,
391 CK_OBJECT_HANDLE hObject);
392 CK_RV (*C_GetObjectSize)(CK_SESSION_HANDLE hSession,
393 CK_OBJECT_HANDLE hObject, CK_ULONG_PTR pulSize);
394 CK_RV (*C_GetAttributeValue)(CK_SESSION_HANDLE hSession,
395 CK_OBJECT_HANDLE hObject,
396 CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount);
397 CK_RV (*C_SetAttributeValue)(CK_SESSION_HANDLE hSession,
398 CK_OBJECT_HANDLE hObject,
399 CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount);
400 CK_RV (*C_FindObjectsInit)(CK_SESSION_HANDLE hSession,
401 CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount);
402 CK_RV (*C_FindObjects)(CK_SESSION_HANDLE hSession,
403 CK_OBJECT_HANDLE_PTR phObject,
404 CK_ULONG ulMaxObjectCount,
405 CK_ULONG_PTR pulObjectCount);
406 CK_RV (*C_FindObjectsFinal)(CK_SESSION_HANDLE hSession);
407 CK_RV (*C_EncryptInit)(CK_SESSION_HANDLE hSession,
408 CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey);
409 CK_RV (*C_Encrypt)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData,
410 CK_ULONG ulDataLen, CK_BYTE_PTR pEncryptedData,
411 CK_ULONG_PTR pulEncryptedDataLen);
412 CK_RV (*C_EncryptUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
413 CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart,
414 CK_ULONG_PTR pulEncryptedPartLen);
415 CK_RV (*C_EncryptFinal)(CK_SESSION_HANDLE hSession,
416 CK_BYTE_PTR pLastEncryptedPart,
417 CK_ULONG_PTR pulLastEncryptedPartLen);
418 CK_RV (*C_DecryptInit)(CK_SESSION_HANDLE hSession,
419 CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey);
420 CK_RV (*C_Decrypt)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedData,
421 CK_ULONG ulEncryptedDataLen, CK_BYTE_PTR pData,
422 CK_ULONG_PTR pulDataLen);
423 CK_RV (*C_DecryptUpdate)(CK_SESSION_HANDLE hSession,
424 CK_BYTE_PTR pEncryptedPart,
425 CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart,
426 CK_ULONG_PTR pulPartLen);
427 CK_RV (*C_DecryptFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastPart,
428 CK_ULONG_PTR pulLastPartLen);
429 CK_RV (*C_DigestInit)(CK_SESSION_HANDLE hSession,
430 CK_MECHANISM_PTR pMechanism);
431 CK_RV (*C_Digest)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData,
432 CK_ULONG ulDataLen, CK_BYTE_PTR pDigest,
433 CK_ULONG_PTR pulDigestLen);
434 CK_RV (*C_DigestUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
435 CK_ULONG ulPartLen);
436 CK_RV (*C_DigestKey)(CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey);
437 CK_RV (*C_DigestFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pDigest,
438 CK_ULONG_PTR pulDigestLen);
439 CK_RV (*C_SignInit)(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism,
440 CK_OBJECT_HANDLE hKey);
441 CK_RV (*C_Sign)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData,
442 CK_ULONG ulDataLen, CK_BYTE_PTR pSignature,
443 CK_ULONG_PTR pulSignatureLen);
444 CK_RV (*C_SignUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
445 CK_ULONG ulPartLen);
446 CK_RV (*C_SignFinal)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature,
447 CK_ULONG_PTR pulSignatureLen);
448 CK_RV (*C_SignRecoverInit)(CK_SESSION_HANDLE hSession,
449 CK_MECHANISM_PTR pMechanism,
450 CK_OBJECT_HANDLE hKey);
451 CK_RV (*C_SignRecover)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData,
452 CK_ULONG ulDataLen, CK_BYTE_PTR pSignature,
453 CK_ULONG_PTR pulSignatureLen);
454 CK_RV (*C_VerifyInit)(CK_SESSION_HANDLE hSession,
455 CK_MECHANISM_PTR pMechanism, CK_OBJECT_HANDLE hKey);
456 CK_RV (*C_Verify)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData,
457 CK_ULONG ulDataLen, CK_BYTE_PTR pSignature,

NetBurner, Inc.
22.361 poly1305.h File Reference 1561

458 CK_ULONG ulSignatureLen);


459 CK_RV (*C_VerifyUpdate)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
460 CK_ULONG ulPartLen);
461 CK_RV (*C_VerifyFinal)(CK_SESSION_HANDLE hSession,
462 CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen);
463 CK_RV (*C_VerifyRecoverInit)(CK_SESSION_HANDLE hSession,
464 CK_MECHANISM_PTR pMechanism,
465 CK_OBJECT_HANDLE hKey);
466 CK_RV (*C_VerifyRecover)(CK_SESSION_HANDLE hSession,
467 CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen,
468 CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen);
469 CK_RV (*C_DigestEncryptUpdate)(CK_SESSION_HANDLE hSession,
470 CK_BYTE_PTR pPart, CK_ULONG ulPartLen,
471 CK_BYTE_PTR pEncryptedPart,
472 CK_ULONG_PTR pulEncryptedPartLen);
473 CK_RV (*C_DecryptDigestUpdate)(CK_SESSION_HANDLE hSession,
474 CK_BYTE_PTR pEncryptedPart,
475 CK_ULONG ulEncryptedPartLen,
476 CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen);
477 CK_RV (*C_SignEncryptUpdate)(CK_SESSION_HANDLE hSession,
478 CK_BYTE_PTR pPart, CK_ULONG ulPartLen,
479 CK_BYTE_PTR pEncryptedPart,
480 CK_ULONG_PTR pulEncryptedPartLen);
481 CK_RV (*C_DecryptVerifyUpdate)(CK_SESSION_HANDLE hSession,
482 CK_BYTE_PTR pEncryptedPart,
483 CK_ULONG ulEncryptedPartLen,
484 CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen);
485 CK_RV (*C_GenerateKey)(CK_SESSION_HANDLE hSession,
486 CK_MECHANISM_PTR pMechanism,
487 CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount,
488 CK_OBJECT_HANDLE_PTR phKey);
489 CK_RV (*C_GenerateKeyPair)(CK_SESSION_HANDLE hSession,
490 CK_MECHANISM_PTR pMechanism,
491 CK_ATTRIBUTE_PTR pPublicKeyTemplate,
492 CK_ULONG ulPublicKeyAttributeCount,
493 CK_ATTRIBUTE_PTR pPrivateKeyTemplate,
494 CK_ULONG ulPrivateKeyAttributeCount,
495 CK_OBJECT_HANDLE_PTR phPublicKey,
496 CK_OBJECT_HANDLE_PTR phPrivateKey);
497 CK_RV (*C_WrapKey)(CK_SESSION_HANDLE hSession,
498 CK_MECHANISM_PTR pMechanism,
499 CK_OBJECT_HANDLE hWrappingKey, CK_OBJECT_HANDLE hKey,
500 CK_BYTE_PTR pWrappedKey,
501 CK_ULONG_PTR pulWrappedKeyLen);
502 CK_RV (*C_UnwrapKey)(CK_SESSION_HANDLE hSession,
503 CK_MECHANISM_PTR pMechanism,
504 CK_OBJECT_HANDLE hUnwrappingKey,
505 CK_BYTE_PTR pWrappedKey, CK_ULONG ulWrappedKeyLen,
506 CK_ATTRIBUTE_PTR pTemplate,
507 CK_ULONG ulAttributeCount,
508 CK_OBJECT_HANDLE_PTR phKey);
509 CK_RV (*C_DeriveKey)(CK_SESSION_HANDLE hSession,
510 CK_MECHANISM_PTR pMechanism,
511 CK_OBJECT_HANDLE hBaseKey,
512 CK_ATTRIBUTE_PTR pTemplate,
513 CK_ULONG ulAttributeCount,
514 CK_OBJECT_HANDLE_PTR phKey);
515 CK_RV (*C_SeedRandom)(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSeed,
516 CK_ULONG ulSeedLen);
517 CK_RV (*C_GenerateRandom)(CK_SESSION_HANDLE hSession,
518 CK_BYTE_PTR RandomData, CK_ULONG ulRandomLen);
519 CK_RV (*C_GetFunctionStatus)(CK_SESSION_HANDLE hSession);
520 CK_RV (*C_CancelFunction)(CK_SESSION_HANDLE hSession);
521 CK_RV (*C_WaitForSlotEvent)(CK_FLAGS flags, CK_SLOT_ID_PTR pSlot,
522 CK_VOID_PTR pRserved);
523
524 };
525
526 #ifdef __cplusplus
527 }
528 #endif
529
530 #endif /* _PKCS11_H_ */
531

22.361 poly1305.h File Reference


#include <wolfssl/wolfcrypt/types.h>

NetBurner, Inc.
1562 File Documentation

22.362 poly1305.h
Go to the documentation of this file.
1 /* poly1305.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
16 #ifndef WOLF_CRYPT_POLY1305_H
17 #define WOLF_CRYPT_POLY1305_H
18
19 #include <wolfssl/wolfcrypt/types.h>
20
21 #ifdef HAVE_POLY1305
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* auto detect between 32bit / 64bit */
28 #if defined(__SIZEOF_INT128__) && defined(__LP64__)
29 #define WC_HAS_SIZEOF_INT128_64BIT
30 #endif
31
32 #if defined(_MSC_VER) && defined(_M_X64)
33 #define WC_HAS_MSVC_64BIT
34 #endif
35
36 #if (defined(__GNUC__) && defined(__LP64__) && \
37 ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))))
38 #define WC_HAS_GCC_4_4_64BIT
39 #endif
40
41 #ifdef USE_INTEL_SPEEDUP
42 #elif (defined(WC_HAS_SIZEOF_INT128_64BIT) || defined(WC_HAS_MSVC_64BIT) || \
43 defined(WC_HAS_GCC_4_4_64BIT))
44 #define POLY130564
45 #else
46 #define POLY130532
47 #endif
48
49 enum {
50 POLY1305 = 7,
51 POLY1305_BLOCK_SIZE = 16,
52 POLY1305_DIGEST_SIZE = 16,
53 };
54
55 #define WC_POLY1305_PAD_SZ 16
56 #define WC_POLY1305_MAC_SZ 16
57
58 /* Poly1305 state */
59 typedef struct Poly1305 {
60 #ifdef USE_INTEL_SPEEDUP
61 word64 r[3];
62 word64 h[3];
63 word64 pad[2];
64 word64 hh[20];
65 word32 r1[8];
66 word32 r2[8];
67 word32 r3[8];
68 word32 r4[8];
69 word64 hm[16];
70 unsigned char buffer[8*POLY1305_BLOCK_SIZE];
71 size_t leftover;
72 unsigned char finished;
73 unsigned char started;
74 #else
75 #if defined(WOLFSSL_ARMASM) && defined(__aarch64__)
76 ALIGN128 word32 r[5];
77 ALIGN128 word32 r_2[5]; /* r^2 */
78 ALIGN128 word32 r_4[5]; /* r^4 */
79 ALIGN128 word32 h[5];
80 word32 pad[4];
81 word64 leftover;
82 #else
83 #if defined(POLY130564)
84 word64 r[3];
85 word64 h[3];
86 word64 pad[2];
87 #else

NetBurner, Inc.
22.363 afalg_hash.h 1563

88 word32 r[5];
89 word32 h[5];
90 word32 pad[4];
91 #endif
92 size_t leftover;
93 #endif /* WOLFSSL_ARMASM */
94 unsigned char buffer[POLY1305_BLOCK_SIZE];
95 unsigned char finished;
96 #endif
97 } Poly1305;
98
99 /* does init */
100
101 WOLFSSL_API int wc_Poly1305SetKey(Poly1305* poly1305, const byte* key,
102 word32 kySz);
103 WOLFSSL_API int wc_Poly1305Update(Poly1305* poly1305, const byte* m, word32 bytes);
104 WOLFSSL_API int wc_Poly1305Final(Poly1305* poly1305, byte* tag);
105
106 /* AEAD Functions */
107 WOLFSSL_API int wc_Poly1305_Pad(Poly1305* ctx, word32 lenToPad);
108 WOLFSSL_API int wc_Poly1305_EncodeSizes(Poly1305* ctx, word32 aadSz,
109 word32 dataSz);
110 #ifdef WORD64_AVAILABLE
111 WOLFSSL_API int wc_Poly1305_EncodeSizes64(Poly1305* ctx, word64 aadSz,
112 word64 dataSz);
113 #endif
114 WOLFSSL_API int wc_Poly1305_MAC(Poly1305* ctx, const byte* additional,
115 word32 addSz, const byte* input, word32 sz, byte* tag, word32 tagSz);
116
117 #if defined(__aarch64__ ) && defined(WOLFSSL_ARMASM)
118 void poly1305_blocks(Poly1305* ctx, const unsigned char *m,
119 size_t bytes);
120 void poly1305_block(Poly1305* ctx, const unsigned char *m);
121 #endif
122
123 #ifdef __cplusplus
124 } /* extern "C" */
125 #endif
126
127 #endif /* HAVE_POLY1305 */
128 #endif /* WOLF_CRYPT_POLY1305_H */

22.363 afalg_hash.h
1 /* afalg_hash.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLF_CRYPT_AFALG_HASH_H
14 #define WOLF_CRYPT_AFALG_HASH_H
15
16 #include <wolfssl/wolfcrypt/types.h>
17
18 #undef WOLFSSL_NO_HASH_RAW
19 #define WOLFSSL_NO_HASH_RAW
20
21 typedef struct {
22 byte* msg;
23 void* heap;
24 word32 used;
25 word32 len;
26 int alFd;
27 int rdFd;
28 } wolfssl_AFALG_Hash;
29
30
31
32 #if !defined(NO_SHA256) && defined(WOLFSSL_AFALG_HASH)
33 typedef wolfssl_AFALG_Hash wc_Sha256;
34 #endif
35 #if defined(WOLFSSL_SHA3) && defined(WOLFSSL_AFALG_XILINX_SHA3)
36 typedef wolfssl_AFALG_Hash wc_Sha3;
37 #endif
38
39 #endif /* WOLF_CRYPT_AFALG_HASH_H */
40

NetBurner, Inc.
1564 File Documentation

22.364 wc_afalg.h
1 /* wc_afalg.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #ifndef WOLFSSL_AFALG_H
14 #define WOLFSSL_AFALG_H
15
16 #include <wolfssl/wolfcrypt/types.h>
17
18 #include <sys/socket.h>
19 #include <linux/if_alg.h>
20 #include <linux/socket.h>
21
22 #define WC_SOCK_NOTSET -1
23
24 /* In some cases these flags are not set in AF_ALG header files.
25 * Documentation provided at kernel.org/doc/html/v4.16/crypto/userspace-if.html
26 * suggests using these values if not set */
27 #ifndef AF_ALG
28 #define AF_ALG 38
29 #endif
30 #ifndef SOL_ALG
31 #define SOL_ALG 279
32 #endif
33
34 WOLFSSL_LOCAL void wc_Afalg_SockAddr(struct sockaddr_alg* in, const char* type, const char* name);
35 WOLFSSL_LOCAL int wc_Afalg_Accept(struct sockaddr_alg* in, int inSz, int sock);
36 WOLFSSL_LOCAL int wc_Afalg_Socket(void);
37 WOLFSSL_LOCAL int wc_Afalg_CreateRead(int sock, const char* type, const char* name);
38 WOLFSSL_LOCAL int wc_Afalg_SetIv(struct cmsghdr* cmsg, byte* iv, word32 ivSz);
39 WOLFSSL_LOCAL int wc_Afalg_SetOp(struct cmsghdr* cmsg, int dir);
40 WOLFSSL_LOCAL int wc_Afalg_SetAad(struct cmsghdr* cmsg, word32 sz);
41
42 #endif /* WOLFSSL_AFALG_H */
43

22.365 cryptoCell.h
1 /* cryptoCell.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLFSSL_CRYPTOCELL_H
13 #define WOLFSSL_CRYPTOCELL_H
14
15 #if defined(WOLFSSL_CRYPTOCELL)
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 #include <wolfssl/wolfcrypt/types.h>
21
22 #include "sns_silib.h"
23
24 #ifndef NO_SHA256
25 #include "crys_hash.h"
26 #include "crys_hash_error.h"
27 /* largest possible input data on CC310 DMA. */
28 #define CC310_MAX_LENGTH_DMA (0xFFFF)
29 #endif
30
31 #ifndef NO_AES
32 #include "ssi_aes.h"
33
34 typedef struct aes_context_t {
35 SaSiAesUserContext_t user_ctx; /* CC310 AES User context */
36 SaSiAesUserKeyData_t key; /* CC310 AES key structure */

NetBurner, Inc.
22.366 atmel.h 1565

37 SaSiAesEncryptMode_t mode; /* encrypt or decrypt */


38 } aes_context_t;
39 #define CC310_MAX_LENGTH_DMA_AES (0xFFF0)
40 #endif /* NO_AES */
41
42 #if !defined(WC_NO_RNG)
43 #if defined(WOLFSSL_nRF5x_SDK_15_2)
44
45 /* To fix warning. MIN/MAX are defined in tfm.h and Nordic (re)defines them */
46 #undef MIN
47 #undef MAX
48 /* includes to use RNG on the nRF52 */
49 #include "nrf_drv_rng.h"
50 #include "nrf_assert.h"
51 #endif
52
53 /*RNG Global variables*/
54 extern CRYS_RND_State_t wc_rndState;
55 extern CRYS_RND_WorkBuff_t wc_rndWorkBuff;
56 extern SaSiRndGenerateVectWorkFunc_t wc_rndGenVectFunc;
57 int cc310_random_generate(byte* output, word32 size);
58 #endif
59
60 #ifndef NO_RSA
61 #include "crys_rsa_types.h"
62 #include "crys_rnd.h"
63 #include "crys_rsa_schemes.h"
64 #include "crys_rsa_kg.h"
65 #include "crys_rsa_build.h"
66
67 typedef struct rsa_context_t {
68 CRYS_RSAUserPrivKey_t privKey;
69 CRYS_RSAUserPubKey_t pubKey;
70 } rsa_context_t;
71 CRYS_RSA_HASH_OpMode_t cc310_hashModeRSA(enum wc_HashType hash_type, int isHashed);
72 #endif
73
74 #ifdef HAVE_ECC
75 #include "crys_ecpki_kg.h"
76 #include "crys_ecpki_dh.h"
77 #include "crys_ecpki_build.h"
78 #include "crys_ecpki_domain.h"
79 #include "crys_ecpki_ecdsa.h"
80
81 typedef struct ecc_context_t {
82 CRYS_ECPKI_UserPrivKey_t privKey;
83 CRYS_ECPKI_UserPublKey_t pubKey;
84 } ecc_context_t;
85
86 CRYS_ECPKI_DomainID_t cc310_mapCurve(int curve_id);
87 CRYS_ECPKI_HASH_OpMode_t cc310_hashModeECC(int hash_size);
88 #endif /* HAVE_ECC */
89
90 #if !defined(NO_CRYPT_BENCHMARK) && defined(WOLFSSL_nRF5x_SDK_15_2)
91 /* includes to use Real-time counter (RTC) on nRF52840 */
92 #include "nrf_gpio.h"
93 #include "nrf_drv_rtc.h"
94 #include "nrf_drv_clock.h"
95 #include "boards.h"
96 #include <stdint.h>
97 #include <stdbool.h>
98 #endif /* NO_CRYPT_BENCHMARK && WOLFSSL_nRF5x_SDK_15_2*/
99
100 int cc310_Init(void);
101 void cc310_Free(void);
102
103 #ifdef __cplusplus
104 }
105 #endif
106 #endif /* WOLFSSL_CRYPTOCELL */
107 #endif /* WOLFSSL_CRYPTOCELL_H */

22.366 atmel.h
1 /* atmel.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11

NetBurner, Inc.
1566 File Documentation

12 #ifndef _ATECC508_H_
13 #define _ATECC508_H_
14
15 #include <stdint.h>
16
17 #include <wolfssl/wolfcrypt/settings.h>
18 #include <wolfssl/wolfcrypt/error-crypt.h>
19
20 #if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \
21 defined(WOLFSSL_ATECC_PKCB)
22 #undef SHA_BLOCK_SIZE
23 #include <cryptoauthlib.h>
24 #endif
25
26 /* ATECC508A/608A only supports ECC P-256 */
27 #define ATECC_KEY_SIZE (32)
28 #define ATECC_PUBKEY_SIZE (ATECC_KEY_SIZE*2) /* X and Y */
29 #define ATECC_SIG_SIZE (ATECC_KEY_SIZE*2) /* R and S */
30 #ifndef ATECC_MAX_SLOT
31 #define ATECC_MAX_SLOT (0x8) /* Only use 0-7 */
32 #endif
33 #define ATECC_INVALID_SLOT (0xFF)
34
35 /* Device Key for signing */
36 #ifndef ATECC_SLOT_AUTH_PRIV
37 #define ATECC_SLOT_AUTH_PRIV (0x0)
38 #endif
39 /* Ephemeral key */
40 #ifndef ATECC_SLOT_ECDHE_PRIV
41 #define ATECC_SLOT_ECDHE_PRIV (0x2)
42 #endif
43 /* Symmetric encryption key */
44 #ifndef ATECC_SLOT_I2C_ENC
45 #ifdef WOLFSSL_ATECC_TNGTLS
46 #define ATECC_SLOT_I2C_ENC (0x06)
47 #else
48 #define ATECC_SLOT_I2C_ENC (0x04)
49 #endif
50 #endif
51 /* Parent encryption key */
52 #ifndef ATECC_SLOT_ENC_PARENT
53 #ifdef WOLFSSL_ATECC_TNGTLS
54 #define ATECC_SLOT_ENC_PARENT (0x6)
55 #else
56 #define ATECC_SLOT_ENC_PARENT (0x7)
57 #endif
58 #endif
59
60 /* ATECC_KEY_SIZE required for ecc.h */
61 #include <wolfssl/wolfcrypt/ecc.h>
62
63 struct WOLFSSL;
64 struct WOLFSSL_CTX;
65 struct WOLFSSL_X509_STORE_CTX;
66 struct ecc_key;
67
68 /* Atmel port functions */
69 int atmel_init(void);
70 void atmel_finish(void);
71 int atmel_get_random_number(uint32_t count, uint8_t* rand_out);
72 #ifndef ATMEL_GET_RANDOM_BLOCK_DEFINED
73 int atmel_get_random_block(unsigned char* output, unsigned int sz);
74 #define ATMEL_GET_RANDOM_BLOCK_DEFINED
75 #endif
76 long atmel_get_curr_time_and_date(long* tm);
77
78 #if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
79
80 enum atmelSlotType {
81 ATMEL_SLOT_ANY,
82 ATMEL_SLOT_ENCKEY,
83 ATMEL_SLOT_DEVICE,
84 ATMEL_SLOT_ECDHE,
85 ATMEL_SLOT_ECDHE_ENC,
86 };
87
88 int atmel_ecc_alloc(int slotType);
89 void atmel_ecc_free(int slotId);
90
91 typedef int (*atmel_slot_alloc_cb)(int);
92 typedef void (*atmel_slot_dealloc_cb)(int);
93 int atmel_set_slot_allocator(atmel_slot_alloc_cb alloc,
94 atmel_slot_dealloc_cb dealloc);
95
96 int atmel_ecc_translate_err(int status);
97 int atmel_get_rev_info(word32* revision);
98 void atmel_show_rev_info(void);

NetBurner, Inc.
22.367 caam_driver.h 1567

99
100 WOLFSSL_API int wolfCrypt_ATECC_SetConfig(ATCAIfaceCfg* cfg);
101
102 /* The macro ATECC_GET_ENC_KEY can be set to override the default
103 encryption key with your own at build-time */
104 #ifndef ATECC_GET_ENC_KEY
105 #define ATECC_GET_ENC_KEY(enckey, keysize) atmel_get_enc_key_default((enckey), (keysize))
106 #endif
107 int atmel_get_enc_key_default(byte* enckey, word16 keysize);
108 int atmel_ecc_create_pms(int slotId, const uint8_t* peerKey, uint8_t* pms);
109 int atmel_ecc_create_key(int slotId, byte* peerKey);
110 int atmel_ecc_sign(int slotId, const byte* message, byte* signature);
111 int atmel_ecc_verify(const byte* message, const byte* signature,
112 const byte* pubkey, int* pVerified);
113
114 #endif /* WOLFSSL_ATECC508A */
115
116 #ifdef HAVE_PK_CALLBACKS
117 int atcatls_create_key_cb(struct WOLFSSL* ssl, struct ecc_key* key, unsigned int keySz,
118 int ecc_curve, void* ctx);
119 int atcatls_create_pms_cb(struct WOLFSSL* ssl, struct ecc_key* otherKey,
120 unsigned char* pubKeyDer, word32* pubKeySz,
121 unsigned char* out, word32* outlen,
122 int side, void* ctx);
123 int atcatls_sign_certificate_cb(struct WOLFSSL* ssl, const byte* in, unsigned int inSz,
124 byte* out, word32* outSz, const byte* key, unsigned int keySz, void* ctx);
125 int atcatls_verify_signature_cb(struct WOLFSSL* ssl, const byte* sig, unsigned int sigSz,
126 const byte* hash, unsigned int hashSz, const byte* key, unsigned int keySz,
127 int* result, void* ctx);
128
129 int atcatls_set_callbacks(struct WOLFSSL_CTX* ctx);
130 int atcatls_set_callback_ctx(struct WOLFSSL* ssl, void* user_ctx);
131 #endif
132
133 #endif /* _ATECC508_H_ */

22.367 caam_driver.h
1 /* caam_driver.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef CAAM_DRIVER_H
13 #define CAAM_DRIVER_H
14
15 #if (defined(__QNX__) || defined(__QNXNTO__))
16 int InitCAAM(void);
17 #include "caam_qnx.h"
18 #endif
19 #if (defined(__INTEGRITY) || defined(INTEGRITY))
20 #define CAAM_BASE 0xf2100000
21 #define CAAM_PAGE 0xf0100000
22 #endif
23
24 #ifdef WOLFSSL_CAAM_PRINT
25 #include <stdio.h>
26 #define WOLFSSL_MSG(in) printf("%s\n", (in))
27 void DEBUG_PRINT_ARRAY(void* a, int aSz, char* str);
28 #else
29 #define WOLFSSL_MSG(in)
30 #define DEBUG_PRINT_ARRAY(a,aSz,str)
31 #endif
32
33 #define CAAM_PAGE_MAX 6
34
35 /* max size of 64 word32’s */
36 #define CAAM_DESC_MAX 256
37
38 #ifndef CAAM_JOBRING_SIZE
39 #define CAAM_JOBRING_SIZE 1
40 #endif
41
42 /* black key stored in secure memory location */
43 #define CAAM_BLACK_KEY_SM 1
44
45 /* black key encrypted with AES-CCM (has MAC) */
46 #define CAAM_BLACK_KEY_CCM 2
47

NetBurner, Inc.
1568 File Documentation

48 /* black key encrypted with AES-ECB (no MAC) */


49 #define CAAM_BLACK_KEY_ECB 3
50
51 /******************************************************************************
52 Basic Descriptors
53 ****************************************************************************/
54
55 /* descriptor commands */
56 #define CAAM_KEY 0x00000000
57 #define CAAM_LOAD 0x10000000
58 #define CAAM_LOAD_CTX 0x10200000
59 #define CAAM_IMM 0x00800000
60 #define CAAM_FIFO_L 0x20000000
61 #define CAAM_FIFO_S 0x60000000
62 #define CAAM_FIFO_S_SKEY 0x60260000
63 #define CAAM_STORE 0x50000000
64 #define CAAM_STORE_CTX 0x50200000
65 #define CAAM_MOVE 0x78000000
66 #define CAAM_OP 0x80000000
67 #define CAAM_SIG 0x90000000
68 #define CAAM_JUMP 0xA0000000
69 #define CAAM_SEQI 0xF0000000/* SEQ in */
70 #define CAAM_SEQO 0xF8000000/* SEQ out */
71 #define CAAM_HEAD 0xB0800000
72 #define CAAM_NWB 0x00200000
73
74 /* PROTOCOL OPERATION command */
75 #define CAAM_PROT_UNIDI 0
76 #define CAAM_BLOB_ENCAP 0x07000000
77 #define CAAM_BLOB_DECAP 0x06000000
78 #define CAAM_PKHA_OP 0x01000000
79
80 #define CAAM_OPID_BLOB 0x000D0000
81
82 /* algorithms modes and types */
83 #define CAAM_CLASS1 0x02000000/* i.e. AES, PKHA */
84 #define CAAM_CLASS2 0x04000000/* i.e. hash algos */
85
86 #define CAAM_ENC 0x00000001
87 #define CAAM_DEC 0x00000000
88 #define CAAM_ALG_INIT 0x00000004
89 #define CAAM_ALG_INITF 0x0000000C
90 #define CAAM_ALG_UPDATE 0x00000000
91 #define CAAM_ALG_FINAL 0x00000008
92 #define CAAM_ALG_IVC 0x00000002
93
94 /* AES 10h */
95 #define CAAM_AESCTR 0x00100000
96 #define CAAM_AESCBC 0x00100100
97 #define CAAM_AESECB 0x00100200
98 #define CAAM_AESCFB 0x00100300
99 #define CAAM_AESOFB 0x00100400
100 #define CAAM_CMAC 0x00100600
101 #define CAAM_AESCCM 0x00100800
102 #define CAAM_AESGCM 0x00100900
103
104 /* HASH 40h */
105 #define CAAM_MD5 0x00400000
106 #define CAAM_SHA 0x00410000
107 #define CAAM_SHA224 0x00420000
108 #define CAAM_SHA256 0x00430000
109 #define CAAM_SHA384 0x00440000
110 #define CAAM_SHA512 0x00450000
111
112 /* HMAC 40h + 10 AAI */
113 #define CAAM_HMAC_MD5 0x00400010
114 #define CAAM_HMAC_SHA 0x00410010
115 #define CAAM_HMAC_SHA224 0x00420010
116 #define CAAM_HMAC_SHA256 0x00430010
117 #define CAAM_HMAC_SHA384 0x00440010
118 #define CAAM_HMAC_SHA512 0x00450010
119
120 /* ECDSA ECDSEL (pre defined flags for ECDSA parameters i.e. order) */
121 #define CAAM_ECDSEL_SHIFT 7
122 #define CAAM_ECDSA_PD 0x00400000
123 #define CAAM_ECDSA_KEYGEN_PD 0x02000000
124 #define CAAM_ECDSA_P192 (0x00 « CAAM_ECDSEL_SHIFT)
125 #define CAAM_ECDSA_P224 (0x01 « CAAM_ECDSEL_SHIFT)
126 #define CAAM_ECDSA_P256 (0x02 « CAAM_ECDSEL_SHIFT)
127 #define CAAM_ECDSA_P384 (0x03 « CAAM_ECDSEL_SHIFT)
128 #define CAAM_ECDSA_P521 (0x04 « CAAM_ECDSEL_SHIFT)
129
130 #define CAAM_ECDSA_BRAINPOOL_P256 (0x0B « CAAM_ECDSEL_SHIFT)
131
132 /* PKHA Operation ID ECDSA */
133 #define CAAM_ECDSA_KEYPAIR 0x00140000
134 #define CAAM_ECDSA_SIGN 0x00150000

NetBurner, Inc.
22.367 caam_driver.h 1569

135 #define CAAM_ECDSA_VERIFY 0x00160000


136 #define CAAM_ECDSA_ECDH 0x00170000
137
138 #define CAAM_ECDSA_MESREP_HASHED (0x10 « 7)
139
140 /* key encryption bit */
141 #define CAAM_PKHA_ECC 0x00000002
142 #define CAAM_PKHA_ENC_PRI_AESECB 0x00000004
143 #define CAAM_PKHA_ENC_PRI_AESCCM (0x00000010 | CAAM_PKHA_ENC_PRI_AESECB)
144 #define CAAM_PKHA_NO_TIMING_RESISTANCE 0x40000000
145 #define CAAM_LOAD_BLACK_KEY 0x500000
146
147 /* PKHA RSA */
148 #define CAAM_OPID_RSA_ENCRYPT 0x00180000
149 #define CAAM_OPID_RSA_DECRYPT 0x00190000
150
151
152 #define CAAM_MD5_CTXSZ (16 + 8)
153 #define CAAM_SHA_CTXSZ (20 + 8)
154 #define CAAM_SHA224_CTXSZ (32 + 8)
155 #define CAAM_SHA256_CTXSZ (32 + 8)
156 #define CAAM_SHA384_CTXSZ (64 + 8)
157 #define CAAM_SHA512_CTXSZ (64 + 8)
158
159 /* RNG 50h */
160 #define CAAM_RNG 0x00500000
161
162 /* Used to get raw entropy from TRNG */
163 #define CAAM_ENTROPY 0x00500001
164
165 #define FIFOL_TYPE_MSG 0x00100000
166 #define FIFOL_TYPE_IV 0x00200000
167 #define FIFOL_TYPE_IVC 0x00380000
168 #define FIFOL_TYPE_AAD 0x00300000
169 #define FIFOL_TYPE_FC1 0x00010000
170 #define FIFOL_TYPE_LC1 0x00020000
171 #define FIFOL_TYPE_LC2 0x00040000
172
173 #define FIFOS_TYPE_MSG 0x00300000
174 #define FIFOS_TYPE_RNG 0x00340000
175 #define FIFOS_EXT 0x00400000
176
177 /* continue bit set if more output is expected */
178 #define CAAM_FIFOS_CONT 0x00800000
179
180 #define CAAM_PAGE_SZ 4096
181
182 /* RNG Registers */
183 #define CAAM_RTMCTL 0X0600
184 #define CAAM_RTSDCTL 0X0610
185 #define CAAM_RTFRQMIN 0X0618
186 #define CAAM_RTFRQMAX 0X061C
187 #define CAAM_RDSTA 0X06C0
188 #define CAAM_RTSTATUS 0x063C
189 #define CAAM_RDINT0 0x06D0
190
191 /* each of the following 11 RTENT registers are an offset of 4 from RTENT0 */
192 #define CAAM_RTENT0 0x0640
193 #define CAAM_RTENT11 0x066C /* Max RTENT register */
194 #define CAAM_RTENT_MAX 0x067C
195
196 /* RNG Masks/Values */
197 #ifndef CAAM_ENT_DLY
198 /* Less than half the default value to try and increase entropy collection.
199 * Value is system clock cycles. */
200 #define CAAM_ENT_DLY 1200
201 #endif
202 #ifndef CAAM_ENT_DLY_INCREMENT
203 #define CAAM_ENT_DLY_INCREMENT 500
204 #endif
205 #ifndef CAAM_ENT_SAMPLE
206 /* default sample value from reference manual */
207 #define CAAM_ENT_SAMPLE 0x09C4
208 #endif
209 #ifndef CAAM_ENT_DLY_MAX
210 #define CAAM_ENT_DLY_MAX 12000
211 #endif
212 #ifndef CAAM_ENT_MINSHIFT
213 /* default to the minimum entropy delay of 1/4 */
214 #define CAAM_ENT_MINSHIFT 2
215 #endif
216 #ifndef CAAM_ENT_MAXSHIFT
217 /* default to the maximum entropy delay of 16 times */
218 #define CAAM_ENT_MAXSHIFT 4
219 #endif
220
221 #define CAAM_PRGM 0x00010000 /* Set RTMCTL to program state */

NetBurner, Inc.
1570 File Documentation

222 #define CAAM_TRNG 0x00000020 /* Set TRNG access */


223 #define CAAM_RTMCTL_RESET 0x40 /* TRNG reset to defaults */
224 #define CAAM_CTLERR 0x00001000
225 #define CAAM_ENTVAL 0x00000400 /* checking RTMCTL for entropy ready */
226
227 /* Input Job Ring Registers */
228 #define CAAM_IRBAR0 0x0004
229 #define CAAM_IRSR0 0x000C
230 #define CAAM_IRJAR0 0x001C
231
232 #define CAAM_IRBAR2 0x3004
233 #define CAAM_IRSR2 0x300C
234 #define CAAM_IRJAR2 0x301C
235 #define CAAM_IRSAR_JR 0x0014
236
237 /* Output Job Ring Registers */
238 #define CAAM_ORBAR 0x0024
239 #define CAAM_ORSR0 0x002C
240 #define CAAM_ORJAR 0x003C
241 #define CAAM_ORJRR 0x0034
242
243 #define JRCFGR_JR 0x0054
244 #define JRCR_JR 0x006C
245
246 /* Status Registers */
247 #define CAAM_STATUS 0x0FD4
248 #define CAAM_CHA_VERSION_MS 0x0FE8
249 #define CAAM_CHA_VERSION_LS 0x0FEC
250 #define CAMM_CHA_SUPPORT_MS 0x0FF0
251 #define CAMM_CHA_SUPPORT_LS 0x0FF4
252 #define CAAM_VERSION_MS 0x0FF8
253 #define CAAM_VERSION_LS 0x0FFC
254 #define CAAM_CHA_CCBVID 0x0FE4
255
256 #define CAAM_SM_CMD 0x0BE4
257 #define CAAM_SM_SMPO 0x0FBC
258 #define CAAM_SMAPR 0x0A04
259 #define CAAM_SM_SMVID_MS 0x0FD8
260 #define CAAM_SM_SMVID_LS 0x0FDC
261 #define CAAM_SM_STATUS 0x0BEC
262 #define CAAM_SM_CSP 0x00008000
263 #define CAAM_SM_SMAP_LOCK 0x00002000
264 #define CAAM_SM_SMAG_LOCK 0x00001000
265 #define CAAM_SM_ALL_RW 0x000000FF
266
267 #define CAAM_C1DSR_LS 0x8014
268 #define CAAM_C1MR 0x8004
269 #define CAAM_RSTA 0x0004
270 #define CAAM_DRR 0x0124
271 #define CAAM_CRNR_LS 0x0FA4
272
273
274 /* output FIFO is 16 entries deep and each entry has a two 4 byte registers */
275 #define CAAM_FIFOO_MS 0x87F0
276 #define CAAM_FIFOO_LS 0x87F4
277
278 /* input FIFO is 16 entries deep with each entry having two 4 byte registers
279 All data written to it from IP bus should be in big endian format */
280 #define CAAM_FIFOI_LS 0x87E0
281
282 /* offset of 4 with range 0 .. 13 */
283 #define CAAM_CTX1 0x8100
284 #define CAAM_CTRIV CAAM_CTX1 + 8 /* AES-CTR iv is in 2 and 3 */
285 #define CAAM_CBCIV CAAM_CTX1 /* AES-CBC iv is in 1 and 2 */
286
287
288 /* debugging registers */
289 #define CAAM_DECORR 0x009C /* used to set DECO into debug mode */
290 #define CAAM_DODJR 0x8E00 /* for hung operations */
291 #define CAAM_DOJQCR_MS 0x8800
292 #define CAAM_DOOPSTA_MS 0x8810 /* DECO operation status register */
293 #define CAAM_DODAR 0x8808 /* address of current descriptor */
294 #define CAAM_DODESB 0x8A00 /* 64 registers that hold the current descriptor buffer */
295
296 #define JRINTR_JR 0x004C
297
298 #define CAAM_SINGLE_STEP_MODE 0x40000000
299 #define CAAM_STEP 0x80000000
300
301 /* Port layer for CAAM driver, functions defined in caam_<env>.c */
302 unsigned int CAAM_READ(CAAM_ADDRESS reg);
303 void CAAM_WRITE(CAAM_ADDRESS reg, unsigned int in);
304 int CAAM_SET_BASEADDR(CAAM_ADDRESS* baseAddr);
305 void CAAM_UNSET_BASEADDR(CAAM_ADDRESS baseAddr);
306 void CAAM_UNSET_JOBRING_ADDR(CAAM_ADDRESS base, CAAM_ADDRESS ringInPhy,
307 void* ringInVir);
308 int CAAM_SET_JOBRING_ADDR(CAAM_ADDRESS* base, CAAM_ADDRESS* ringInPhy,

NetBurner, Inc.
22.367 caam_driver.h 1571

309 void** ringInVir);


310 CAAM_ADDRESS CAAM_ADR_TO_PHYSICAL(void* in, int inSz);
311 void* CAAM_ADR_MAP(CAAM_ADDRESS in, int inSz, unsigned char copy);
312 void CAAM_ADR_UNMAP(void* vaddr, CAAM_ADDRESS out, int outSz,
313 unsigned char copy);
314 int CAAM_ADR_SYNC(void* vaddr, int sz);
315 CAAM_ADDRESS CAAM_ADR_TO_VIRTUAL(CAAM_ADDRESS in, int length);
316
317 #ifndef WOLFSSL_CAAM_BUFFER
318 #define WOLFSSL_CAAM_BUFFER
319 typedef struct CAAM_BUFFER {
320 int BufferType;
321 CAAM_ADDRESS TheAddress;
322 int Length;
323 } CAAM_BUFFER;
324 #endif
325 unsigned int caamReadRegister(unsigned int reg);
326 void caamWriteRegister(unsigned int reg, unsigned int in);
327 int SynchronousSendRequest(int type, unsigned int args[4], CAAM_BUFFER *buf, int sz);
328 int CleanupCAAM(void);
329
330
331 /* Driver API that can be called by caam_<env>.c port layers */
332 typedef struct DESCSTRUCT DESCSTRUCT;
333
334 int caamKeyCover(DESCSTRUCT *desc, int sz, unsigned int args[4]);
335 int caamEntropy(unsigned char *out, int outSz);
336 int caamECDSA_ECDH(DESCSTRUCT *desc, int sz, unsigned int args[4]);
337 int caamECDSASign(DESCSTRUCT *desc, int sz, unsigned int args[4]);
338 int caamECDSAVerify(DESCSTRUCT *desc, CAAM_BUFFER *buf, int sz,
339 unsigned int args[4]);
340 int caamECDSAMake(DESCSTRUCT *desc, CAAM_BUFFER *buf, unsigned int args[4]);
341
342
343 int caamAes(DESCSTRUCT* desc, CAAM_BUFFER* buf, unsigned int args[4]);
344 int caamAead(DESCSTRUCT* desc, CAAM_BUFFER* buf, unsigned int args[4]);
345 int caamAesCmac(DESCSTRUCT *desc, int sz, unsigned int args[4]);
346 int caamBlob(DESCSTRUCT *desc);
347
348 CAAM_ADDRESS caamGetPartition(unsigned int part, int partSz, unsigned int flag);
349 int caamFreePart(unsigned int part);
350 int caamFindUnusedPartition(void);
351
352
353
354 void caamDescInit(DESCSTRUCT* desc, int type, unsigned int args[4],
355 CAAM_BUFFER* buf, int sz);
356
357
358 /* CAAM descriptor */
359 #define DESC_COUNT 1
360 #define MAX_BUF 20
361 #define BUFFER_COUNT (MAX_BUF * DESC_COUNT)
362
363 /* CAAM descriptors can only be 64 unsigned ints */
364 #define MAX_DESC_SZ 64
365
366 /* 64 byte buffer for when data crosses a page boundary */
367 #define ALIGN_BUF 16
368
369 /* MAX_CTX is 64 bytes (sha512 digest) + 8 bytes (CAAM length value) */
370 #define MAX_CTX 18
371
372 #define MIN_READ_REG CAAM_BASE
373 #define MAX_READ_REG (CAAM_BASE + 0x00010000)
374
375 struct buffer {
376 CAAM_ADDRESS data;
377 CAAM_ADDRESS dataSz;
378 };
379
380 struct DESCSTRUCT {
381 #if defined(__INTEGRITY) || defined(INTEGRITY)
382 struct IORequestStruct TheIORequest;
383 #endif
384 struct CAAM_DEVICE* caam;
385 struct buffer buf[MAX_BUF]; /* buffers holding data input address */
386 unsigned int desc[MAX_DESC_SZ]; /* max size of 64 word32 */
387 unsigned int aadSzBuf[4]; /* Formatted AAD size for CCM */
388 unsigned int alignBuf[ALIGN_BUF]; /* 64 byte buffer for non page
389 align */
390 unsigned int iv[MAX_CTX]; /* AES IV and also hash state */
391 unsigned int ctxBuf[MAX_CTX]; /* key */
392 CAAM_ADDRESS output; /* address to output buffer */
393 CAAM_ADDRESS ctxOut; /* address to update buffer holding state */
394 Value alignIdx;/* index for align buffer */
395 Value idx; /* index for descriptor buffer */

NetBurner, Inc.
1572 File Documentation

396 Value headIdx; /* for first portion of descriptor buffer */


397 Value lastIdx; /* for last portion of descriptor buffer */
398 Value outputIdx; /* idx to output buffer in "buf" */
399 Value inputSz; /* size of input buffer */
400 Value ctxSz; /* size of CTX/Key buffer */
401 Value aadSz; /* AAD size for CCM */
402 Value startIdx; /* for telling header where to start */
403 Value lastFifo;
404 Value type;
405 Value state;
406 Value DescriptorCount;
407 Boolean running; /* True if building/running descriptor is
408 in process */
409 };
410
411 /* wolfSSL specific flags */
412 #define CAAM_FIND_PART 0xFFFFFFFF
413 #define CAAM_GET_PART 0xFFFFFFFE
414 #define CAAM_FREE_PART 0xFFFFFFFD
415 #define CAAM_READ_PART 0xFFFFFFFC
416 #define CAAM_WRITE_PART 0xFFFFFFFB
417
418
419 #define MAX_ECDSA_VERIFY_ADDR 8
420 #define MAX_ECDSA_SIGN_ADDR 8
421 #define BLACK_KEY_MAC_SZ 16
422 #define BLACK_BLOB_KEYMOD_SZ 16
423 #define RED_BLOB_KEYMOD_SZ 8
424 #endif /* CAAM_DRIVER_H */

22.368 caam_error.h
1 /* caam_error.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef CAAM_ERROR_H
13 #define CAAM_ERROR_H
14
15 int caamParseError(unsigned int error);
16 int caamParseDECOError(unsigned int error);
17 int caamParseCCBError(unsigned int error);
18 unsigned int caamParseJRError(unsigned int error);
19
20 #endif /* CAAM_ERROR_H */

22.369 caam_qnx.h
1 /* caam_qnx.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 /* This file is porting low level QNX interactions, such as reading register */
14
15 #ifndef CAAM_QNX_H
16 #define CAAM_QNX_H
17
18 #include <sys/mman.h>
19 #ifdef __aarch64__
20 #include <aarch64/inout.h>
21 #else
22 #include <hw/inout.h>
23 #endif
24 #include <sys/iofunc.h>
25 #include <sys/neutrino.h>
26 #include <pthread.h>
27

NetBurner, Inc.
22.370 wolfcaam.h 1573

28 #define CAAM_MUTEX pthread_mutex_t


29 #define CAAM_INIT_MUTEX(x) pthread_mutex_init((x), NULL)
30 #define CAAM_FREE_MUTEX(x) pthread_mutex_destroy((x))
31 #define CAAM_LOCK_MUTEX(x) pthread_mutex_lock((x))
32 #define CAAM_UNLOCK_MUTEX(x) pthread_mutex_unlock((x))
33
34 #define Error int
35 #define Value int
36 #define Boolean int
37 #define CAAM_ADDRESS uintptr_t
38 #define Success 1
39 #define Failure 0
40 #define INTERRUPT_Panic()
41 #define MemoryMapMayNotBeEmpty -1
42 #define CAAM_WAITING -2
43 #define NoActivityReady -1
44 #define MemoryOperationNotPerformed -1
45 #define CAAM_ARGS_E -3
46
47 #ifndef WOLFSSL_CAAM_BUFFER
48 #define WOLFSSL_CAAM_BUFFER
49 typedef struct CAAM_BUFFER {
50 int BufferType;
51 CAAM_ADDRESS TheAddress;
52 int Length;
53 } CAAM_BUFFER;
54 #endif
55
56 /* check kernel and yield to same priority threads waiting */
57 #define CAAM_CPU_CHILL() sched_yield()
58
59 #ifdef __aarch64__
60 /* if on an AArch64 system make assumption that it is an i.MX8 QXP */
61 /* use block of memory set aside for job ring 2 */
62 #define CAAM_BASE 0x31400000
63 #define CAAM_PAGE 0x31800000
64 #else
65 /* IMX6UL */
66 #define CAAM_BASE 0x02140000
67 #define CAAM_PAGE 0x00100000
68 #endif
69
70 #endif /* CAAM_QNX_H */

22.370 wolfcaam.h
1 /* wolfcaam.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #ifndef WOLF_CRYPT_CAAM_INIT_H
13 #define WOLF_CRYPT_CAAM_INIT_H
14
15 #include <wolfssl/wolfcrypt/settings.h>
16 #include <wolfssl/wolfcrypt/types.h>
17
18 /* include for porting layer */
19 #ifdef WOLFSSL_QNX_CAAM
20 #include <wolfssl/wolfcrypt/port/caam/wolfcaam_qnx.h>
21 #elif defined(WOLFSSL_SECO_CAAM)
22 #include <wolfssl/wolfcrypt/port/caam/wolfcaam_seco.h>
23 #endif
24
25 #if defined(WOLFSSL_IMX6_CAAM) || defined(WOLFSSL_IMX6_CAAM_RNG) || \
26 defined(WOLFSSL_QNX_CAAM) || defined(WOLFSSL_SECO_CAAM)
27
28
29 /* unique devId for CAAM use on crypto callbacks */
30 #ifndef WOLFSSL_CAAM_DEVID
31 #define WOLFSSL_CAAM_DEVID 7
32 #endif
33
34 /* black key stored in secure memory location */
35 #define CAAM_BLACK_KEY_SM 1
36
37 /* black key encrypted with AES-CCM (has MAC) */
38 #define CAAM_BLACK_KEY_CCM 2
39

NetBurner, Inc.
1574 File Documentation

40 /* black key encrypted with AES-ECB (no MAC) */


41 #define CAAM_BLACK_KEY_ECB 3
42
43 #if defined(__INTEGRITY) || defined(INTEGRITY)
44 #include <INTEGRITY.h>
45 typedef Buffer CAAM_BUFFER;
46 #endif
47
48 WOLFSSL_LOCAL int wc_caamInit(void);
49 WOLFSSL_LOCAL int wc_caamFree(void);
50 WOLFSSL_LOCAL int wc_caamInitRng(void);
51 WOLFSSL_LOCAL int wc_caamFreeRng(void);
52
53 WOLFSSL_LOCAL word32 wc_caamReadRegister(word32 reg);
54 WOLFSSL_LOCAL void wc_caamWriteRegister(word32 reg, word32 value);
55 WOLFSSL_LOCAL int wc_caamAddAndWait(CAAM_BUFFER* buf, int sz, word32 arg[4],
56 word32 type);
57
58 WOLFSSL_LOCAL int caamFindUnusedPartition(void);
59 WOLFSSL_LOCAL CAAM_ADDRESS caamGetPartition(int part, int sz);
60 WOLFSSL_LOCAL int caamFreePart(int partNum);
61 WOLFSSL_LOCAL int caamWriteToPartition(CAAM_ADDRESS addr, const unsigned char* in, int inSz);
62 WOLFSSL_LOCAL int caamReadPartition(CAAM_ADDRESS addr, unsigned char* out, int outSz);
63
64 WOLFSSL_API int wc_caamOpenBlob(byte* data, word32 dataSz, byte* out,
65 word32* outSz);
66 WOLFSSL_API int wc_caamCreateBlob(byte* data, word32 dataSz, byte* out,
67 word32* outSz);
68
69 WOLFSSL_API int wc_caamOpenBlob_ex(byte* data, word32 dataSz, byte* out,
70 word32* outSz, int type, byte* mod, word32 modSz);
71 WOLFSSL_API int wc_caamCreateBlob_ex(byte* data, word32 dataSz, byte* out,
72 word32* outSz, int type, byte* mod, word32 modSz);
73 WOLFSSL_API int wc_caamCoverKey(byte* in, word32 inSz, byte* out, word32* outSz,
74 int flag);
75
76 /* additional size that is added by CAAM when creating a blob */
77 #define WC_CAAM_BLOB_SZ 48
78 #define WC_CAAM_MAC_SZ 16
79 #define WC_CAAM_BLOB_RED 1
80 #define WC_CAAM_BLOB_BLACK 2
81 #define WC_CAAM_RED_KEYMOD_SZ 8
82 #define WC_CAAM_BLACK_KEYMOD_SZ 16
83 #define WC_CAAM_MAX_ENTROPY 44
84
85 #if !defined(WOLFSSL_QNX_CAAM) && !defined(WOLFSSL_SECO_CAAM)
86 WOLFSSL_API int wc_caamSetResource(IODevice ioDev);
87 #ifndef WC_CAAM_READ
88 #define WC_CAAM_READ(reg) wc_caamReadRegister((reg))
89 #endif
90 #ifndef WC_CAAM_WRITE
91 #define WC_CAAM_WRITE(reg, x) wc_caamWriteRegister((reg), (x))
92 #endif
93 #endif
94
95
96 #define CAAM_AESCTR 0x00100000
97 #define CAAM_AESCBC 0x00100100
98 #define CAAM_AESECB 0x00100200
99 #define CAAM_AESCFB 0x00100300
100 #define CAAM_AESOFB 0x00100400
101 #define CAAM_CMAC 0x00100600
102 #define CAAM_AESCCM 0x00100800
103 #define CAAM_AESGCM 0x00100900
104
105 #define CAAM_MD5 0x00400000
106 #define CAAM_SHA 0x00410000
107 #define CAAM_SHA224 0x00420000
108 #define CAAM_SHA256 0x00430000
109 #define CAAM_SHA384 0x00440000
110 #define CAAM_SHA512 0x00450000
111
112 #define CAAM_HMAC_MD5 0x00400010
113 #define CAAM_HMAC_SHA 0x00410010
114 #define CAAM_HMAC_SHA224 0x00420010
115 #define CAAM_HMAC_SHA256 0x00430010
116 #define CAAM_HMAC_SHA384 0x00440010
117 #define CAAM_HMAC_SHA512 0x00450010
118
119 #define CAAM_ECDSA_KEYPAIR 0x00140000
120 #define CAAM_ECDSA_SIGN 0x00150000
121 #define CAAM_ECDSA_VERIFY 0x00160000
122 #define CAAM_ECDSA_ECDH 0x00170000
123
124 #define CAAM_BLOB_ENCAP 0x07000000
125 #define CAAM_BLOB_DECAP 0x06000000
126 #define CAAM_FIFO_S 0x60000000

NetBurner, Inc.
22.371 wolfcaam_aes.h 1575

127 #define CAAM_FIFO_CCM_FLAG 0x00140000


128
129 #define CAAM_ENC 0x00000001
130 #define CAAM_DEC 0x00000000
131 #define CAAM_ALG_INIT 0x00000004
132 #define CAAM_ALG_INITF 0x0000000C
133 #define CAAM_ALG_UPDATE 0x00000000
134 #define CAAM_ALG_FINAL 0x00000008
135
136 /* ECDSA ECDSEL (pre defined flags for ECDSA parameters i.e. order) */
137 #define CAAM_ECDSEL_SHIFT 7
138 #define CAAM_ECDSA_PD 0x00400000
139 #define CAAM_ECDSA_KEYGEN_PD 0x02000000
140 #define CAAM_ECDSA_P192 (0x00 « CAAM_ECDSEL_SHIFT)
141 #define CAAM_ECDSA_P224 (0x01 « CAAM_ECDSEL_SHIFT)
142 #define CAAM_ECDSA_P256 (0x02 « CAAM_ECDSEL_SHIFT)
143 #define CAAM_ECDSA_P384 (0x03 « CAAM_ECDSEL_SHIFT)
144 #define CAAM_ECDSA_P521 (0x04 « CAAM_ECDSEL_SHIFT)
145
146 #define CAAM_ECDSA_BRAINPOOL_P256 (0x0B « CAAM_ECDSEL_SHIFT)
147
148 #define CAAM_ENTROPY 0x00500001
149
150 /* wolfSSL specific flags */
151 #define CAAM_FIND_PART 0xFFFFFFFF
152 #define CAAM_GET_PART 0xFFFFFFFE
153 #define CAAM_FREE_PART 0xFFFFFFFD
154 #define CAAM_READ_PART 0xFFFFFFFC
155 #define CAAM_WRITE_PART 0xFFFFFFFB
156
157 #endif /* WOLFSSL_IMX6_CAAM */
158
159 #endif /* WOLF_CRYPT_CAAM_INIT_H */

22.371 wolfcaam_aes.h
1 /* wolfcaam_aes.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #include <wolfssl/wolfcrypt/settings.h>
14
15 #ifndef WOLFCAAM_AES_H
16 #define WOLFCAAM_AES_H
17
18 #if !defined(NO_AES) && defined(WOLFSSL_CAAM)
19
20 #include <wolfssl/wolfcrypt/aes.h>
21
22 WOLFSSL_LOCAL int wc_CAAM_AesCcmEncrypt(Aes* aes, const byte* in, byte* out,
23 word32 sz, const byte* nonce, word32 nonceSz, byte* authTag,
24 word32 authTagSz, const byte* authIn, word32 authInSz);
25
26 WOLFSSL_LOCAL int wc_CAAM_AesCcmDecrypt(Aes* aes, const byte* in, byte* out,
27 word32 sz, const byte* nonce, word32 nonceSz, const byte* authTag,
28 word32 authTagSz, const byte* authIn, word32 authInSz);
29
30 WOLFSSL_LOCAL int wc_CAAM_AesGcmEncrypt(Aes* aes, const byte* in, byte* out,
31 word32 sz, const byte* nonce, word32 nonceSz, byte* authTag,
32 word32 authTagSz, const byte* authIn, word32 authInSz);
33
34 WOLFSSL_LOCAL int wc_CAAM_AesGcmDecrypt(Aes* aes, const byte* in, byte* out,
35 word32 sz, const byte* nonce, word32 nonceSz, const byte* authTag,
36 word32 authTagSz, const byte* authIn, word32 authInSz);
37
38 WOLFSSL_LOCAL int wc_CAAM_AesCtrEncrypt(Aes* aes, byte* out, const byte* in,
39 word32 sz);
40
41 WOLFSSL_LOCAL int wc_CAAM_AesCbcEncrypt(Aes* aes, byte* out, const byte* in,
42 word32 sz);
43
44 WOLFSSL_LOCAL int wc_CAAM_AesCbcDecrypt(Aes* aes, byte* out, const byte* in,
45 word32 sz);
46
47 WOLFSSL_LOCAL int wc_CAAM_AesEcbEncrypt(Aes* aes, byte* out, const byte* in,
48 word32 sz);
49

NetBurner, Inc.
1576 File Documentation

50 WOLFSSL_LOCAL int wc_CAAM_AesEcbDecrypt(Aes* aes, byte* out, const byte* in,


51 word32 sz);
52 #endif /* WOLFSSL_CAAM && !NO_AES */
53 #endif /* WOLFCAAM_AES_H */
54

22.372 wolfcaam_cmac.h
1 /* wolfcaam_cmac.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 #include <wolfssl/wolfcrypt/settings.h>
14
15 #ifndef WOLFCAAM_CMAC_H
16 #define WOLFCAAM_CMAC_H
17
18 #if defined(WOLFSSL_CMAC) && defined(WOLFSSL_CAAM)
19
20 #include <wolfssl/wolfcrypt/cmac.h>
21
22 WOLFSSL_LOCAL int wc_CAAM_Cmac(Cmac* cmac, const byte* key, word32 keySz,
23 const byte* in, word32 inSz, byte* out, word32* outSz, int type,
24 void* ctx);
25 #endif
26 #endif /* WOLFCAAM_CMAC_H */

22.373 wolfcaam_ecdsa.h
1 /* wolfcaam_ecdsa.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12 #include <wolfssl/wolfcrypt/settings.h>
13
14 #ifndef WOLFCAAM_ECDSA_H
15 #define WOLFCAAM_ECDSA_H
16
17 #if defined(HAVE_ECC) && defined(WOLFSSL_CAAM)
18
19 #include <wolfssl/wolfcrypt/ecc.h>
20
21 WOLFSSL_LOCAL int wc_CAAM_EccSign(const byte* in, int inlen, byte* out,
22 word32* outlen, WC_RNG *rng, ecc_key *key, int devId);
23 WOLFSSL_LOCAL int wc_CAAM_EccVerify(const byte* sig, word32 siglen,
24 const byte* hash, word32 hashlen, int* res, ecc_key* key, int devId);
25 WOLFSSL_LOCAL int wc_CAAM_Ecdh(ecc_key* private_key, ecc_key* public_key,
26 byte* out, word32* outlen, int devId);
27 WOLFSSL_LOCAL int wc_CAAM_MakeEccKey(WC_RNG* rng, int keySize, ecc_key* key,
28 int curveId, int devId);
29 WOLFSSL_LOCAL int wc_CAAM_EccCheckPrivKey(ecc_key* key, const byte* pubKey,
30 word32 pubKeySz);
31 #endif /* HAVE_ECC && WOLFSSL_QNX_CAAM */
32 #endif /* WOLFCAAM_ECDSA_H */

22.374 wolfcaam_hash.h
1 /* wolfcaam_hash.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.

NetBurner, Inc.
22.375 wolfcaam_qnx.h 1577

8 *
9 * https://www.wolfssl.com
10 */
11
12 #include <wolfssl/wolfcrypt/settings.h>
13
14 #ifndef WOLFCAAM_HASH_H
15 #define WOLFCAAM_HASH_H
16
17 #include <wolfssl/wolfcrypt/sha256.h>
18
19 #ifndef NO_SHA
20 WOLFSSL_LOCAL int wc_CAAM_ShaHash(wc_Sha* sha, const byte* in, word32 inSz,
21 byte* digest);
22 #endif
23 #ifdef WOLFSSL_SHA224
24 WOLFSSL_LOCAL int wc_CAAM_Sha224Hash(wc_Sha224* sha224, const byte* in,
25 word32 inSz, byte* digest);
26 #endif
27 WOLFSSL_LOCAL int wc_CAAM_Sha256Hash(wc_Sha256* sha256, const byte* in,
28 word32 inSz, byte* digest);
29 #if defined(WOLFSSL_SHA384)
30 WOLFSSL_LOCAL int wc_CAAM_Sha384Hash(wc_Sha384* sha384, const byte* in,
31 word32 inSz, byte* digest);
32 #endif
33 #if defined(WOLFSSL_SHA512)
34 WOLFSSL_LOCAL int wc_CAAM_Sha512Hash(wc_Sha512* sha512, const byte* in,
35 word32 inSz, byte* digest);
36 #endif
37
38 #if !defined(NO_HMAC)
39 #ifndef WC_HMAC_TYPE_DEFINED
40 typedef struct Hmac Hmac;
41 #define WC_HMAC_TYPE_DEFINED
42 #endif
43 WOLFSSL_LOCAL int wc_CAAM_Hmac(Hmac* hmac, int macType, const byte* msg,
44 int msgSz, byte* digest);
45 #endif
46
47 #endif
48

22.375 wolfcaam_qnx.h
1 /* wolfcaam_qnx.h
2 *
3 * Copyright (C) 2006-2022 wolfSSL Inc. All rights reserved.
4 *
5 * This file is part of wolfSSL.
6 *
7 * Contact [email protected] with any questions or comments.
8 *
9 * https://www.wolfssl.com
10 */
11
12
13 /* This file is for interacting with the driver code */
14 #ifndef WOLFCAAM_QNX_H
15 #define WOLFCAAM_QNX_H
16
17 #include <wolfssl/wolfcrypt/settings.h>
18
19 #ifdef WOLFSSL_QNX_CAAM
20 #include <sys/iofunc.h>
21 #include <sys/neutrino.h>
22
23 #define Error int
24 #define Value int
25 #define Boolean i

You might also like