Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f8dae53736 | |||
| 5c90e58864 | |||
| df47710990 | |||
| 9b03d4b850 | |||
| 06b43589d6 | |||
| 1722f04928 | |||
| 16ef7de4bf | |||
| 7521a419d1 | |||
| 5f0ad3de3f | |||
| 40eeef07a5 | |||
| 11563b5094 | |||
| 35815fcd7c | |||
| 17c598d414 | |||
| cff64329b3 | |||
| 9ba44a9a15 | |||
| 5c9d107b0c | |||
| 3a5ced4184 | |||
| e2f0cb0a92 | |||
| 75a9f76523 | |||
| db9c32529b | |||
| 064fe09bc9 | |||
| 5d872a9fec | |||
| b0190be957 | |||
| 92ca444675 | |||
| cc431c6205 | |||
| 84791b8679 | |||
| 89796e1ad1 | |||
| 1f7835f417 | |||
| e577f8b637 | |||
| d0ff482635 | |||
| efbe0322ae | |||
| 2ae1233aa1 | |||
| a35fec85d0 | |||
| 343f435bf6 | |||
| 72e1306a26 | |||
| 15e9264581 | |||
| f6bbc9dfa5 | |||
| bfb77a3bdd | |||
| 3d3548d523 | |||
| 80f80c5cb4 | |||
| ec467faa75 | |||
| 57c53573b8 | |||
| 3f5d730c65 | |||
| a2ce0c56c3 | |||
| 93694a77ef | |||
| b9a65b4b6d | |||
| e99bef59e0 | |||
| bf86bb9ce4 |
+2
-2
@@ -1,2 +1,2 @@
|
||||
Hekate/Hekate/OpenSSL/include-ios/* linguist-vendored
|
||||
Hekate/Hekate/OpenSSL/include-macos/* linguist-vendored
|
||||
AppReceiptValidator/AppReceiptValidator/OpenSSL/include-ios/* linguist-vendored
|
||||
AppReceiptValidator/AppReceiptValidator/OpenSSL/include-macos/* linguist-vendored
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
language: objective-c
|
||||
osx_image: xcode9.2
|
||||
|
||||
env:
|
||||
global:
|
||||
- LC_CTYPE=en_US.UTF-8
|
||||
- LANG=en_US.UTF-8
|
||||
- PROJECT=AppReceiptValidator/AppReceiptValidator.xcodeproj
|
||||
matrix:
|
||||
- DESTINATION="OS=11.2,name=iPhone X" SCHEME="AppReceiptValidator Demo iOS"
|
||||
- DESTINATION="arch=x86_64" SCHEME="AppReceiptValidator Demo macOS"
|
||||
|
||||
script:
|
||||
- set -o pipefail
|
||||
- xcodebuild -version
|
||||
- xcodebuild -showsdks
|
||||
- echo "PROJECT $PROJECT, SCHEME $SCHEME, DESTINATION $DESTINATION"
|
||||
- xcodebuild -project "$PROJECT" -scheme "$SCHEME" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty;
|
||||
@@ -4,7 +4,7 @@ disabled_rules:
|
||||
- nesting
|
||||
- todo
|
||||
excluded:
|
||||
- Sourcery/Generated
|
||||
- excluded_dir_example
|
||||
file_length:
|
||||
warning: 500
|
||||
large_tuple:
|
||||
+5
-8
@@ -1,10 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13189.4" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13165.3"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
@@ -14,11 +11,11 @@
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hekate" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zp8-aJ-GRo">
|
||||
<rect key="frame" x="160" y="333" width="55" height="21"/>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="AppReceiptValidator" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zp8-aJ-GRo">
|
||||
<rect key="frame" x="221.5" y="299" width="156" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Hekate_Demo_iOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="AppReceiptValidator_Demo_iOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Hekate Demo</string>
|
||||
<string>AppReceiptValidator Demo</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import Hekate
|
||||
import AppReceiptValidator
|
||||
import UIKit
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ private extension ViewController {
|
||||
return
|
||||
}
|
||||
do {
|
||||
let result = try LocalReceiptValidator().parseUnofficialReceipt(origin: .data(data))
|
||||
let result = try AppReceiptValidator().parseUnofficialReceipt(origin: .data(data))
|
||||
render(string: "\(result.receipt)\n\(result.unofficialReceipt)")
|
||||
} catch {
|
||||
self.render(string: "\(error)")
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// Hekate Demo macOS
|
||||
// AppReceiptValidator Demo macOS
|
||||
//
|
||||
// Created by Hannes Oud on 06.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
||||
+12
-11
@@ -13,11 +13,11 @@
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="Hekate Demo macOS" id="1Xt-HY-uBw">
|
||||
<menuItem title="AppReceiptValidator Demo macOS" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Hekate Demo macOS" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<menu key="submenu" title="AppReceiptValidator Demo macOS" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About Hekate Demo macOS" id="5kV-Vb-QxS">
|
||||
<menuItem title="About AppReceiptValidator Demo macOS" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
@@ -31,7 +31,7 @@
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
||||
<menuItem title="Hide Hekate Demo macOS" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<menuItem title="Hide AppReceiptValidator Demo macOS" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
@@ -49,7 +49,7 @@
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit Hekate Demo macOS" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<menuItem title="Quit AppReceiptValidator Demo macOS" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
@@ -662,7 +662,7 @@
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="Hekate Demo macOS Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<menuItem title="AppReceiptValidator Demo macOS Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
||||
</connections>
|
||||
@@ -676,7 +676,7 @@
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Hekate_Demo_macOS" customModuleProvider="target"/>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="AppReceiptValidator_Demo_macOS" customModuleProvider="target"/>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
@@ -686,7 +686,7 @@
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
|
||||
<window key="window" title="Hekate Receipt Parser" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<window key="window" title="AppReceiptValidator Receipt Parser" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
||||
@@ -706,7 +706,7 @@
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="Hekate_Demo_macOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="AppReceiptValidator_Demo_macOS" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="631" height="270"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@@ -717,7 +717,7 @@
|
||||
<rect key="frame" x="1" y="1" width="314" height="268"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView toolTip="Paste Base64 here" importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsCharacterPickerTouchBarItem="NO" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" textCompletion="NO" id="0xW-mT-lME" customClass="TextView" customModule="Hekate_Demo_macOS" customModuleProvider="target">
|
||||
<textView toolTip="Paste Base64 here" importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsCharacterPickerTouchBarItem="NO" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" textCompletion="NO" id="0xW-mT-lME" customClass="DropAcceptingTextView" customModule="AppReceiptValidator_Demo_macOS" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="314" height="268"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
@@ -743,7 +743,7 @@
|
||||
<rect key="frame" x="1" y="1" width="313" height="268"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsCharacterPickerTouchBarItem="NO" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" textCompletion="NO" id="GHT-gS-G1g" customClass="TextView" customModule="Hekate_Demo_macOS" customModuleProvider="target">
|
||||
<textView importsGraphics="NO" richText="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" allowsCharacterPickerTouchBarItem="NO" allowsUndo="YES" usesRuler="YES" allowsNonContiguousLayout="YES" textCompletion="NO" id="GHT-gS-G1g" customClass="TextView" customModule="AppReceiptValidator_Demo_macOS" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="313" height="268"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
@@ -776,6 +776,7 @@
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="dropReceivingView" destination="0xW-mT-lME" id="cuR-H1-BKN"/>
|
||||
<outlet property="inputTextView" destination="0xW-mT-lME" id="8Y7-yb-63r"/>
|
||||
<outlet property="outputTextView" destination="GHT-gS-G1g" id="cVN-4m-knJ"/>
|
||||
</connections>
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// DropAcceptingTextView.swift
|
||||
// AppReceiptValidator Demo macOS
|
||||
//
|
||||
// Created by Hannes Oud on 13.02.18.
|
||||
// Copyright © 2018 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
private enum AttachmentDropError: Error {
|
||||
case noAttachments
|
||||
}
|
||||
|
||||
final class DropAcceptingTextView: NSTextView {
|
||||
|
||||
var handleDroppedFile: ((URL) -> Void)?
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
|
||||
var draggedTypes = self.registeredDraggedTypes
|
||||
draggedTypes.insert(makeFileNameType(), at: 0)
|
||||
self.registerForDraggedTypes(draggedTypes)
|
||||
}
|
||||
|
||||
override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
|
||||
if sender.fileURLs.isEmpty == false {
|
||||
return .copy
|
||||
}
|
||||
return super.draggingEntered(sender)
|
||||
}
|
||||
|
||||
override func performDragOperation(_ sender: NSDraggingInfo) -> Bool {
|
||||
if let fileURL = sender.fileURLs.first {
|
||||
self.handleDroppedFile?(fileURL)
|
||||
return true
|
||||
}
|
||||
return super.performDragOperation(sender)
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate extension NSDraggingInfo {
|
||||
|
||||
var fileURLs: [URL] {
|
||||
let asStrings = self.draggingPasteboard().propertyList(forType: makeFileNameType()) as? [String] ?? []
|
||||
return asStrings.map { URL(fileURLWithPath: $0) }
|
||||
}
|
||||
}
|
||||
|
||||
private func makeFileNameType() -> NSPasteboard.PasteboardType {
|
||||
// in 10.13 there is more modern NSPasteboard.PasteboardType.fileURL or previously
|
||||
// NSPasteboard.PasteboardType("public.file-url"), but so far couldn't find a way
|
||||
// to read them from draggingPasteboard()
|
||||
return NSPasteboard.PasteboardType(rawValue: "NSFilenamesPboardType")
|
||||
}
|
||||
+25
-4
@@ -1,13 +1,13 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// Hekate Demo macOS
|
||||
// AppReceiptValidator Demo macOS
|
||||
//
|
||||
// Created by Hannes Oud on 06.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import AppReceiptValidator
|
||||
import Cocoa
|
||||
import Hekate
|
||||
|
||||
|
||||
// MARK: - ViewController
|
||||
@@ -16,14 +16,18 @@ class ViewController: NSViewController, NSTextViewDelegate {
|
||||
|
||||
@IBOutlet private var inputTextView: NSTextView!
|
||||
@IBOutlet private var outputTextView: NSTextView!
|
||||
@IBOutlet private var dropReceivingView: DropAcceptingTextView!
|
||||
|
||||
// MARK: - Lifecycle
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
self.inputTextView.delegate = self
|
||||
self.inputTextView.string = "Paste Base64 here"
|
||||
self.inputTextView.string = "Drag Application or receipt here, or paste Base64 receipt contents."
|
||||
self.outputTextView.string = "Parsed Receipt will be shown here"
|
||||
self.dropReceivingView.handleDroppedFile = { [unowned self] url in
|
||||
self.update(url: url)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - NSTextViewDelegate
|
||||
@@ -45,19 +49,36 @@ class ViewController: NSViewController, NSTextViewDelegate {
|
||||
private extension ViewController {
|
||||
|
||||
// MARK: Updating
|
||||
|
||||
func update(base64String: String) {
|
||||
guard let data = Data(base64Encoded: base64String, options: .ignoreUnknownCharacters) else {
|
||||
self.render(string: "Base64 decoding failed.")
|
||||
return
|
||||
}
|
||||
do {
|
||||
let result = try LocalReceiptValidator().parseUnofficialReceipt(origin: .data(data))
|
||||
let result = try AppReceiptValidator().parseUnofficialReceipt(origin: .data(data))
|
||||
self.render(string: "\(result.receipt)\n\(result.unofficialReceipt)")
|
||||
} catch {
|
||||
self.render(string: "\(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func update(url: URL) {
|
||||
var url = url
|
||||
let subURLInApplication = url.appendingPathComponent("Contents/_MASReceipt/receipt")
|
||||
if FileManager.default.fileExists(atPath: subURLInApplication.path) {
|
||||
url = subURLInApplication
|
||||
}
|
||||
if let data = try? Data(contentsOf: url) {
|
||||
let base64 = data.base64EncodedString()
|
||||
self.inputTextView.string = base64
|
||||
self.update(base64String: base64)
|
||||
} else {
|
||||
self.inputTextView.string = "<No Receipt found>"
|
||||
self.update(base64String: "")
|
||||
}
|
||||
}
|
||||
|
||||
func render(string: String) {
|
||||
self.outputTextView.string = string
|
||||
}
|
||||
+7
-7
@@ -1,17 +1,17 @@
|
||||
//
|
||||
// LocalReceiptPropertyValidationTests.swift
|
||||
// Hekate iOS
|
||||
// AppReceiptPropertyValidationTests.swift
|
||||
// AppReceiptValidator iOS
|
||||
//
|
||||
// Created by Hannes Oud on 14.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import Hekate
|
||||
import AppReceiptValidator
|
||||
import XCTest
|
||||
|
||||
class LocalReceiptPropertyValidationTests: XCTestCase {
|
||||
class AppReceiptPropertyValidationTests: XCTestCase {
|
||||
|
||||
private let receiptValidator = LocalReceiptValidator()
|
||||
private let receiptValidator = AppReceiptValidator()
|
||||
|
||||
func testCorrectMainBundlePropertiesiOS() {
|
||||
let receipt = Receipt(bundleIdentifier: Bundle.main.bundleIdentifier,
|
||||
@@ -78,7 +78,7 @@ class LocalReceiptPropertyValidationTests: XCTestCase {
|
||||
guard let data = assertTestAsset(filename: "hannes_mac_mindnode_pro_receipt") else { return }
|
||||
|
||||
@discardableResult
|
||||
func assertPropertyMismatch(line: UInt = #line, configuration: (inout LocalReceiptValidator.Parameters) -> Void) -> Bool {
|
||||
func assertPropertyMismatch(line: UInt = #line, configuration: (inout AppReceiptValidator.Parameters) -> Void) -> Bool {
|
||||
let result = receiptValidator.validateReceipt {
|
||||
$0.receiptOrigin = .data(data)
|
||||
$0.shouldValidateHash = false // the original device identifier is unknown
|
||||
@@ -89,7 +89,7 @@ class LocalReceiptPropertyValidationTests: XCTestCase {
|
||||
XCTFail("Unexpectedly succeeded validating, but expected a property mismatch)", file: #file, line: line)
|
||||
return false
|
||||
}
|
||||
guard error == LocalReceiptValidator.Error.propertyValueMismatch else {
|
||||
guard error == AppReceiptValidator.Error.propertyValueMismatch else {
|
||||
XCTFail("Expected a property mismatch, but found an \(error)", file: #file, line: line)
|
||||
return false
|
||||
}
|
||||
+6
-7
@@ -1,17 +1,17 @@
|
||||
//
|
||||
// LocalReceiptValidationInAppPurchaseTests.swift
|
||||
// Hekate
|
||||
// AppReceiptValidationInAppPurchaseTests.swift
|
||||
// AppReceiptValidator
|
||||
//
|
||||
// Created by Hannes Oud on 11.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import Hekate
|
||||
import AppReceiptValidator
|
||||
import XCTest
|
||||
|
||||
class LocalReceiptValidationInAppPurchaseTests: XCTestCase {
|
||||
class AppReceiptValidationInAppPurchaseTests: XCTestCase {
|
||||
|
||||
var receiptValidator = LocalReceiptValidator()
|
||||
var receiptValidator = AppReceiptValidator()
|
||||
|
||||
func testNonMindNodeReceiptParsingWithoutValidation() {
|
||||
guard let data = assertB64TestAsset(filename: "grandUnifiedExpiredAppleCert_receipt.b64") else { return }
|
||||
@@ -22,7 +22,6 @@ class LocalReceiptValidationInAppPurchaseTests: XCTestCase {
|
||||
} catch {
|
||||
XCTFail("Unexpectedly failed parsing a receipt \(error)")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func testNonMindNodeReceiptParsingWithMultipleInAppPurchases() {
|
||||
@@ -33,7 +32,7 @@ class LocalReceiptValidationInAppPurchaseTests: XCTestCase {
|
||||
let result = receiptValidator.validateReceipt {
|
||||
$0.receiptOrigin = .data(data)
|
||||
$0.shouldValidateHash = false
|
||||
$0.shouldValidateSignatureAuthenticity = false
|
||||
$0.signatureValidation = .skip
|
||||
$0.propertyValidations = []
|
||||
}
|
||||
guard let receipt = result.receipt else {
|
||||
+18
-18
@@ -1,19 +1,19 @@
|
||||
//
|
||||
// LocalReceiptValidationTests.swift
|
||||
// Hekate_macOSTests
|
||||
// AppReceiptValidationTests.swift
|
||||
// AppReceiptValidator_macOSTests
|
||||
//
|
||||
// Created by Hannes Oud on 04.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import Hekate
|
||||
import AppReceiptValidator
|
||||
import XCTest
|
||||
|
||||
class LocalReceiptValidationTests: XCTestCase {
|
||||
class AppReceiptValidationTests: XCTestCase {
|
||||
|
||||
private let receiptValidator = LocalReceiptValidator()
|
||||
private let receiptValidator = AppReceiptValidator()
|
||||
|
||||
private let exampleDeviceIdentifier = LocalReceiptValidator.Parameters.DeviceIdentifier(base64Encoded: "bEAItZRe")!
|
||||
private let exampleDeviceIdentifier = AppReceiptValidator.Parameters.DeviceIdentifier(base64Encoded: "bEAItZRe")!
|
||||
|
||||
func testFailedReceiptValidating() {
|
||||
guard let data = assertTestAsset(filename: "not_a_receipt") else { return }
|
||||
@@ -27,7 +27,7 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
if error != LocalReceiptValidator.Error.emptyReceiptContents {
|
||||
if error != AppReceiptValidator.Error.emptyReceiptContents {
|
||||
XCTFail("Unexpected error, expected .emptyReceiptContents, got \(error)")
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
_ = try receiptValidator.parseReceipt(origin: .data(data))
|
||||
XCTFail("Unexpectedly succeeded in parsing a non-receipt")
|
||||
} catch {
|
||||
guard let e = error as? LocalReceiptValidator.Error, e == LocalReceiptValidator.Error.emptyReceiptContents else {
|
||||
guard error as? AppReceiptValidator.Error == AppReceiptValidator.Error.emptyReceiptContents else {
|
||||
XCTFail("Unexpected error, expeced .emptyReceiptContents, got \(error)")
|
||||
return
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
)
|
||||
let result = receiptValidator.validateReceipt {
|
||||
$0.receiptOrigin = .data(data)
|
||||
$0.deviceIdentifier = LocalReceiptValidator.Parameters.DeviceIdentifier(base64Encoded: "bEAItZRe")!
|
||||
$0.deviceIdentifier = AppReceiptValidator.Parameters.DeviceIdentifier(base64Encoded: "bEAItZRe")!
|
||||
}
|
||||
guard let receipt = result.receipt else {
|
||||
XCTFail("Unexpectedly failed parsing a receipt \(result.error!)")
|
||||
@@ -173,7 +173,7 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
$0.receiptOrigin = .data(data)
|
||||
$0.shouldValidateHash = false
|
||||
$0.shouldValidateSignaturePresence = false
|
||||
$0.shouldValidateSignatureAuthenticity = false
|
||||
$0.signatureValidation = .skip
|
||||
}
|
||||
guard let receipt = result.receipt else {
|
||||
XCTFail("Unexpectedly failed parsing a receipt \(result.error!)")
|
||||
@@ -208,7 +208,7 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
func testNonMindNodeFailingDeprecatedSinglesTypeExpiredAppleCertParsing() {
|
||||
guard let data = assertB64TestAsset(filename: "deprecatedSinglesTypeExpiredAppleCert_receipt.b64") else { return }
|
||||
|
||||
let result = receiptValidator.validateReceipt { (parameters: inout LocalReceiptValidator.Parameters) -> Void in
|
||||
let result = receiptValidator.validateReceipt { (parameters: inout AppReceiptValidator.Parameters) -> Void in
|
||||
parameters.receiptOrigin = .data(data)
|
||||
}
|
||||
guard let error = result.error else {
|
||||
@@ -216,7 +216,7 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
return
|
||||
}
|
||||
|
||||
if error != LocalReceiptValidator.Error.emptyReceiptContents {
|
||||
if error != AppReceiptValidator.Error.emptyReceiptContents {
|
||||
XCTFail("Unexpected error, expeced .emptyReceiptContents, got \(error)")
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,7 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
|
||||
let result = receiptValidator.validateReceipt {
|
||||
$0.receiptOrigin = .data(data)
|
||||
$0.deviceIdentifier = LocalReceiptValidator.Parameters.DeviceIdentifier(uuid: UUID(uuidString: "3B76A7BD-8F5B-46A4-BCB1-CCE8DBD1B3CD")!)
|
||||
$0.deviceIdentifier = AppReceiptValidator.Parameters.DeviceIdentifier(uuid: UUID(uuidString: "3B76A7BD-8F5B-46A4-BCB1-CCE8DBD1B3CD")!)
|
||||
}
|
||||
let expected = Receipt(
|
||||
bundleIdentifier: "com.mindnode.mindnodetouch",
|
||||
@@ -276,9 +276,9 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
func testiOSParsingPerformance() {
|
||||
guard let data = assertB64TestAsset(filename: "mindnode_ios_michaelsandbox_receipt1.b64") else { return }
|
||||
|
||||
let parameters = LocalReceiptValidator.Parameters.default.with {
|
||||
let parameters = AppReceiptValidator.Parameters.default.with {
|
||||
$0.receiptOrigin = .data(data)
|
||||
$0.deviceIdentifier = LocalReceiptValidator.Parameters.DeviceIdentifier(uuid: UUID(uuidString: "3B76A7BD-8F5B-46A4-BCB1-CCE8DBD1B3CD")!)
|
||||
$0.deviceIdentifier = AppReceiptValidator.Parameters.DeviceIdentifier(uuid: UUID(uuidString: "3B76A7BD-8F5B-46A4-BCB1-CCE8DBD1B3CD")!)
|
||||
}
|
||||
measure {
|
||||
_ = receiptValidator.validateReceipt(parameters: parameters)
|
||||
@@ -286,11 +286,11 @@ class LocalReceiptValidationTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - LocalReceiptValidator + Convenience
|
||||
// MARK: - AppReceiptValidator + Convenience
|
||||
|
||||
extension LocalReceiptValidator {
|
||||
extension AppReceiptValidator {
|
||||
|
||||
/// Validates a local receipt and returns the result using the parameters `LocalReceiptValidator.Parameters.default`, which can be further configured in the passed block.
|
||||
/// Validates a receipt and returns the result using the parameters `AppReceiptValidator.Parameters.default`, which can be further configured in the passed block.
|
||||
func validateReceipt(configuration: (inout Parameters) -> Void) -> Result {
|
||||
return validateReceipt(parameters: Parameters.default.with(block: configuration))
|
||||
}
|
||||
+4
-4
@@ -1,21 +1,21 @@
|
||||
//
|
||||
// Date+Convenience.swift
|
||||
// Hekate iOS
|
||||
// AppReceiptValidator iOS
|
||||
//
|
||||
// Created by Hannes Oud on 07.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import AppReceiptValidator
|
||||
import Foundation
|
||||
import Hekate
|
||||
|
||||
extension Date {
|
||||
|
||||
/// Returns a date which is independent of the current date, based on the LocalReceiptValidators dataformatter. Useful for tests.
|
||||
/// Returns a date which is independent of the current date, based on the AppReceiptValidator's Date formatter. Useful for tests.
|
||||
/// - Parameter string: Example "2018-07-12T10:57:42Z", defaults to "2017-01-01T12:00:00Z"
|
||||
/// - Returns: The date
|
||||
public static func demoDate(string: String = "2017-01-01T12:00:00Z") -> Date {
|
||||
guard let date = LocalReceiptValidator.asn1DateFormatter.date(from: string) else {
|
||||
guard let date = AppReceiptValidator.asn1DateFormatter.date(from: string) else {
|
||||
fatalError("Failed to deserialize expected date \(string), use format like '2017-01-01T12:00:00Z'")
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// KnownOrUnknown.swift
|
||||
// Hekate
|
||||
// AppReceiptValidator
|
||||
//
|
||||
// Created by Hannes Oud on 08.01.18.
|
||||
// Copyright © 2018 IdeasOnCanvas GmbH. All rights reserved.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// TestAssetLoading.swift
|
||||
// Hekate_macOSTests
|
||||
// AppReceiptValidator_macOSTests
|
||||
//
|
||||
// Created by Hannes Oud on 04.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
+201
-232
File diff suppressed because it is too large
Load Diff
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:/Users/hannes/Projekte/Workspace/iOS/IdeasOnCanvas/AppReceiptValidator/AppReceiptValidator/AppReceiptValidator.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
+2
-4
@@ -2,9 +2,7 @@
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.files.user-selected.read-only</key>
|
||||
<true/>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
+19
-21
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -15,9 +15,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4E31F5D691400E86FE1"
|
||||
BuildableName = "Hekate Demo iOS.app"
|
||||
BlueprintName = "Hekate Demo iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo iOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
@@ -29,9 +29,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095A81F6001800095729B"
|
||||
BuildableName = "Hekate Tests iOS.xctest"
|
||||
BlueprintName = "Hekate Tests iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Tests iOS.xctest"
|
||||
BlueprintName = "AppReceiptValidator Tests iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
@@ -40,7 +40,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
@@ -48,9 +47,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095A81F6001800095729B"
|
||||
BuildableName = "Hekate Tests iOS.xctest"
|
||||
BlueprintName = "Hekate Tests iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Tests iOS.xctest"
|
||||
BlueprintName = "AppReceiptValidator Tests iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
@@ -58,9 +57,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4E31F5D691400E86FE1"
|
||||
BuildableName = "Hekate Demo iOS.app"
|
||||
BlueprintName = "Hekate Demo iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo iOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
@@ -70,7 +69,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
@@ -82,9 +80,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4E31F5D691400E86FE1"
|
||||
BuildableName = "Hekate Demo iOS.app"
|
||||
BlueprintName = "Hekate Demo iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo iOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
@@ -101,9 +99,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4E31F5D691400E86FE1"
|
||||
BuildableName = "Hekate Demo iOS.app"
|
||||
BlueprintName = "Hekate Demo iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo iOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
+19
-21
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -15,9 +15,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095801F6000A40095729B"
|
||||
BuildableName = "Hekate Demo macOS.app"
|
||||
BlueprintName = "Hekate Demo macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo macOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
@@ -29,9 +29,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095911F6000A40095729B"
|
||||
BuildableName = "Hekate Tests macOS.xctest"
|
||||
BlueprintName = "Hekate Tests macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Tests macOS.xctest"
|
||||
BlueprintName = "AppReceiptValidator Tests macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
@@ -40,7 +40,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
@@ -48,9 +47,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095911F6000A40095729B"
|
||||
BuildableName = "Hekate Tests macOS.xctest"
|
||||
BlueprintName = "Hekate Tests macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Tests macOS.xctest"
|
||||
BlueprintName = "AppReceiptValidator Tests macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
@@ -58,9 +57,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095801F6000A40095729B"
|
||||
BuildableName = "Hekate Demo macOS.app"
|
||||
BlueprintName = "Hekate Demo macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo macOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
@@ -70,7 +69,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
@@ -82,9 +80,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095801F6000A40095729B"
|
||||
BuildableName = "Hekate Demo macOS.app"
|
||||
BlueprintName = "Hekate Demo macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo macOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
@@ -101,9 +99,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D19095801F6000A40095729B"
|
||||
BuildableName = "Hekate Demo macOS.app"
|
||||
BlueprintName = "Hekate Demo macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator Demo macOS.app"
|
||||
BlueprintName = "AppReceiptValidator Demo macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
+10
-12
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -15,9 +15,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4B41F5D684C00E86FE1"
|
||||
BuildableName = "Hekate.framework"
|
||||
BlueprintName = "Hekate iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator.framework"
|
||||
BlueprintName = "AppReceiptValidator iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
@@ -26,7 +26,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
@@ -37,7 +36,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
@@ -48,9 +46,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4B41F5D684C00E86FE1"
|
||||
BuildableName = "Hekate.framework"
|
||||
BlueprintName = "Hekate iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator.framework"
|
||||
BlueprintName = "AppReceiptValidator iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
@@ -66,9 +64,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4B41F5D684C00E86FE1"
|
||||
BuildableName = "Hekate.framework"
|
||||
BlueprintName = "Hekate iOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator.framework"
|
||||
BlueprintName = "AppReceiptValidator iOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
+19
-21
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0900"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -15,9 +15,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4C11F5D687400E86FE1"
|
||||
BuildableName = "Hekate.framework"
|
||||
BlueprintName = "Hekate macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator.framework"
|
||||
BlueprintName = "AppReceiptValidator macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
<BuildActionEntry
|
||||
@@ -29,9 +29,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F5321F5D894900E86FE1"
|
||||
BuildableName = "Hekate_macOSTests.xctest"
|
||||
BlueprintName = "Hekate_macOSTests"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator_macOSTests.xctest"
|
||||
BlueprintName = "AppReceiptValidator_macOSTests"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
@@ -40,7 +40,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
@@ -48,9 +47,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F5321F5D894900E86FE1"
|
||||
BuildableName = "Hekate_macOSTests.xctest"
|
||||
BlueprintName = "Hekate_macOSTests"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator_macOSTests.xctest"
|
||||
BlueprintName = "AppReceiptValidator_macOSTests"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
@@ -58,9 +57,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4C11F5D687400E86FE1"
|
||||
BuildableName = "Hekate.framework"
|
||||
BlueprintName = "Hekate macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator.framework"
|
||||
BlueprintName = "AppReceiptValidator macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
@@ -70,7 +69,6 @@
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
@@ -81,9 +79,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4C11F5D687400E86FE1"
|
||||
BuildableName = "Hekate.framework"
|
||||
BlueprintName = "Hekate macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator.framework"
|
||||
BlueprintName = "AppReceiptValidator macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
@@ -99,9 +97,9 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "D1D6F4C11F5D687400E86FE1"
|
||||
BuildableName = "Hekate.framework"
|
||||
BlueprintName = "Hekate macOS"
|
||||
ReferencedContainer = "container:Hekate.xcodeproj">
|
||||
BuildableName = "AppReceiptValidator.framework"
|
||||
BlueprintName = "AppReceiptValidator macOS"
|
||||
ReferencedContainer = "container:AppReceiptValidator.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
+28
-16
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// LocalReceiptValidator+Parameters.swift
|
||||
// Hekate
|
||||
// AppReceiptValidator+Parameters.swift
|
||||
// AppReceiptValidator
|
||||
//
|
||||
// Created by Hannes Oud on 06.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
public extension LocalReceiptValidator {
|
||||
public extension AppReceiptValidator {
|
||||
|
||||
/// Describes how to validate a receipt, and how/where to obtain the dependencies (receipt, deviceIdentifier, apple root certificate)
|
||||
/// Use .default to initialize the standard parameters. By default, no `propertyValidations` are active.
|
||||
@@ -18,22 +18,20 @@ public extension LocalReceiptValidator {
|
||||
|
||||
public var receiptOrigin: ReceiptOrigin = .installedInMainBundle
|
||||
public var shouldValidateSignaturePresence: Bool = true
|
||||
public var shouldValidateSignatureAuthenticity: Bool = true
|
||||
public var signatureValidation: SignatureValidation = .shouldValidate(rootCertificateOrigin: .cerFileBundledWithAppReceiptValidator)
|
||||
public var shouldValidateHash: Bool = true
|
||||
public var deviceIdentifier: DeviceIdentifier = .currentDevice
|
||||
public var rootCertificateOrigin: RootCertificateOrigin = .cerFileBundledWithHekate
|
||||
public var propertyValidations: [PropertyValidation] = []
|
||||
|
||||
// MARK: - Lifecycle
|
||||
|
||||
/// Or use .default to initialize a sensible defaults
|
||||
public init(receiptOrigin: ReceiptOrigin, shouldValidateSignaturePresence: Bool, shouldValidateSignatureAuthenticity: Bool, shouldValidateHash: Bool, deviceIdentifier: DeviceIdentifier, rootCertificateOrigin: RootCertificateOrigin, propertyValidations: [PropertyValidation]) {
|
||||
public init(receiptOrigin: ReceiptOrigin, shouldValidateSignaturePresence: Bool, signatureValidation: SignatureValidation, shouldValidateHash: Bool, deviceIdentifier: DeviceIdentifier, propertyValidations: [PropertyValidation]) {
|
||||
self.receiptOrigin = receiptOrigin
|
||||
self.shouldValidateSignaturePresence = shouldValidateSignaturePresence
|
||||
self.shouldValidateSignatureAuthenticity = shouldValidateSignatureAuthenticity
|
||||
self.signatureValidation = signatureValidation
|
||||
self.shouldValidateHash = shouldValidateHash
|
||||
self.deviceIdentifier = deviceIdentifier
|
||||
self.rootCertificateOrigin = rootCertificateOrigin
|
||||
}
|
||||
|
||||
/// Either use `.default` to get a default preset, or specify everything via the complete init(…) with all parameters.
|
||||
@@ -54,7 +52,7 @@ public extension LocalReceiptValidator {
|
||||
|
||||
// MARK: - ReceiptOrigin
|
||||
|
||||
extension LocalReceiptValidator.Parameters {
|
||||
extension AppReceiptValidator.Parameters {
|
||||
|
||||
/// Used for obtaining the receipt data to parse or validate.
|
||||
///
|
||||
@@ -81,7 +79,7 @@ extension LocalReceiptValidator.Parameters {
|
||||
|
||||
// MARK: - DeviceIdentifier
|
||||
|
||||
public extension LocalReceiptValidator.Parameters {
|
||||
public extension AppReceiptValidator.Parameters {
|
||||
|
||||
/// Used for calculating/validating the SHA1-Hash part of a receipt.
|
||||
///
|
||||
@@ -116,23 +114,37 @@ public extension LocalReceiptValidator.Parameters {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - SignatureValidation
|
||||
|
||||
extension AppReceiptValidator.Parameters {
|
||||
|
||||
/// Used for verifying the signature
|
||||
///
|
||||
/// - skip: The signature authenticity is not validated
|
||||
/// - shouldValidate: The signature is verified against the provided root certificate
|
||||
public enum SignatureValidation {
|
||||
case skip
|
||||
case shouldValidate(rootCertificateOrigin: RootCertificateOrigin)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - RootCertificateOrigin
|
||||
|
||||
extension LocalReceiptValidator.Parameters {
|
||||
extension AppReceiptValidator.Parameters {
|
||||
|
||||
/// Instructs how to find the Apple root certificate for receipt validation.
|
||||
///
|
||||
/// - cerFileBundledWithHekate: Uses the "AppleIncRootCertificate.cer" bundled with Hekate
|
||||
/// - cerFileBundledWithAppReceiptValidator: Uses the "AppleIncRootCertificate.cer" bundled with AppReceiptValidator
|
||||
/// - data: Specific Data to use
|
||||
public enum RootCertificateOrigin {
|
||||
case cerFileBundledWithHekate
|
||||
case cerFileBundledWithAppReceiptValidator
|
||||
case data(Data)
|
||||
|
||||
public func loadData() -> Data? {
|
||||
switch self {
|
||||
case .data(let data):
|
||||
return data
|
||||
case .cerFileBundledWithHekate:
|
||||
case .cerFileBundledWithAppReceiptValidator:
|
||||
guard let appleRootCertificateURL = Bundle(for: BundleToken.self).url(forResource: "AppleIncRootCertificate", withExtension: "cer") else { return nil }
|
||||
|
||||
return try? Data(contentsOf: appleRootCertificateURL)
|
||||
@@ -144,7 +156,7 @@ extension LocalReceiptValidator.Parameters {
|
||||
|
||||
// MARK: - PropertyValidation
|
||||
|
||||
extension LocalReceiptValidator.Parameters {
|
||||
extension AppReceiptValidator.Parameters {
|
||||
|
||||
/// Compares a String property of a receipt with an info dictionary entry or a provided value.
|
||||
///
|
||||
@@ -184,7 +196,7 @@ extension LocalReceiptValidator.Parameters {
|
||||
let expected = self.getExpectedValue()
|
||||
|
||||
if self.propertyValue(of: receipt) != expected {
|
||||
throw LocalReceiptValidator.Error.propertyValueMismatch
|
||||
throw AppReceiptValidator.Error.propertyValueMismatch
|
||||
}
|
||||
}
|
||||
|
||||
+17
-18
@@ -1,13 +1,13 @@
|
||||
//
|
||||
// LocalReceiptValidator.swift
|
||||
// Hekate iOS
|
||||
// AppReceiptValidator.swift
|
||||
// AppReceiptValidator iOS
|
||||
//
|
||||
// Created by Hannes Oud on 04.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import AppReceiptValidator.OpenSSL
|
||||
import Foundation
|
||||
import Hekate.OpenSSL
|
||||
|
||||
/// Apple guide: https://developer.apple.com/library/content/releasenotes/General/ValidateAppStoreReceipt/Introduction.html
|
||||
///
|
||||
@@ -15,7 +15,7 @@ import Hekate.OpenSSL
|
||||
///
|
||||
/// More: See README.md
|
||||
/// - Note: If on iOS, use this only on Main Queue, because UIDevice is called
|
||||
public struct LocalReceiptValidator {
|
||||
public struct AppReceiptValidator {
|
||||
|
||||
// MARK: - Lifecycle
|
||||
|
||||
@@ -37,8 +37,8 @@ public struct LocalReceiptValidator {
|
||||
if parameters.shouldValidateSignaturePresence {
|
||||
try self.checkSignaturePresence(pkcs7: receiptContainer)
|
||||
}
|
||||
if parameters.shouldValidateSignatureAuthenticity {
|
||||
guard let appleRootCertificateData = parameters.rootCertificateOrigin.loadData() else { throw Error.appleRootCertificateNotFound }
|
||||
if case .shouldValidate(let rootCertificateOrigin) = parameters.signatureValidation {
|
||||
guard let appleRootCertificateData = rootCertificateOrigin.loadData() else { throw Error.appleRootCertificateNotFound }
|
||||
|
||||
try self.checkSignatureAuthenticity(pkcs7: receiptContainer, appleRootCertificateData: appleRootCertificateData)
|
||||
}
|
||||
@@ -54,8 +54,8 @@ public struct LocalReceiptValidator {
|
||||
}
|
||||
return .success(receipt, receiptData: receiptData, deviceIdentifier: deviceIdData)
|
||||
} catch {
|
||||
assert(error is LocalReceiptValidator.Error)
|
||||
return .error(error as? LocalReceiptValidator.Error ?? .unknown, receiptData: data, deviceIdentifier: deviceIdData)
|
||||
assert(error is AppReceiptValidator.Error)
|
||||
return .error(error as? AppReceiptValidator.Error ?? .unknown, receiptData: data, deviceIdentifier: deviceIdData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ public struct LocalReceiptValidator {
|
||||
|
||||
// MARK: - Full Validation
|
||||
|
||||
private extension LocalReceiptValidator {
|
||||
private extension AppReceiptValidator {
|
||||
|
||||
func validateHash(receipt: Receipt, deviceIdentifierData: Data) throws {
|
||||
// Make sure that the Receipt instances has non-nil values needed for hash comparison
|
||||
@@ -140,7 +140,7 @@ private extension LocalReceiptValidator {
|
||||
|
||||
// MARK: - PKCS7 Extraction
|
||||
|
||||
private extension LocalReceiptValidator {
|
||||
private extension AppReceiptValidator {
|
||||
|
||||
func extractPKCS7Container(data: Data) throws -> PKCS7Wrapper {
|
||||
let receiptBIO = BIOWrapper(data: data)
|
||||
@@ -159,7 +159,7 @@ private extension LocalReceiptValidator {
|
||||
|
||||
// MARK: - PKCS7 Signature checking
|
||||
|
||||
private extension LocalReceiptValidator {
|
||||
private extension AppReceiptValidator {
|
||||
|
||||
func checkSignaturePresence(pkcs7: PKCS7Wrapper) throws {
|
||||
let pkcs7SignedTypeCode = OBJ_obj2nid(pkcs7.pkcs7.pointee.type)
|
||||
@@ -197,7 +197,7 @@ private extension LocalReceiptValidator {
|
||||
|
||||
// MARK: - Parsing of properties
|
||||
|
||||
private extension LocalReceiptValidator {
|
||||
private extension AppReceiptValidator {
|
||||
|
||||
// swiftlint:disable:next cyclomatic_complexity
|
||||
func parseReceipt(pkcs7: PKCS7Wrapper, parseUnofficialParts: Bool = false) throws -> (receipt: Receipt, unofficialReceipt: UnofficialReceipt) {
|
||||
@@ -322,7 +322,7 @@ private extension LocalReceiptValidator {
|
||||
|
||||
// MARK: Receipt ASN1 Sequence Attribute Types
|
||||
|
||||
private extension LocalReceiptValidator {
|
||||
private extension AppReceiptValidator {
|
||||
|
||||
/// See Receipt.swift for details and a link to Apple reference
|
||||
enum KnownReceiptAttribute: Int32 {
|
||||
@@ -336,7 +336,6 @@ private extension LocalReceiptValidator {
|
||||
case expirationDate = 21
|
||||
}
|
||||
|
||||
|
||||
/// See Receipt.swift for details and a link to Apple reference
|
||||
enum KnownInAppPurchaseAttribute: Int32 {
|
||||
case quantity = 1701
|
||||
@@ -353,12 +352,12 @@ private extension LocalReceiptValidator {
|
||||
|
||||
// MARK: - Result
|
||||
|
||||
extension LocalReceiptValidator {
|
||||
extension AppReceiptValidator {
|
||||
|
||||
public enum Result {
|
||||
|
||||
case success(Receipt, receiptData: Data, deviceIdentifier: Data?)
|
||||
case error(LocalReceiptValidator.Error, receiptData: Data?, deviceIdentifier: Data?)
|
||||
case error(AppReceiptValidator.Error, receiptData: Data?, deviceIdentifier: Data?)
|
||||
|
||||
public var receipt: Receipt? {
|
||||
switch self {
|
||||
@@ -369,7 +368,7 @@ extension LocalReceiptValidator {
|
||||
}
|
||||
}
|
||||
|
||||
public var error: LocalReceiptValidator.Error? {
|
||||
public var error: AppReceiptValidator.Error? {
|
||||
switch self {
|
||||
case .success:
|
||||
return nil
|
||||
@@ -402,7 +401,7 @@ extension LocalReceiptValidator {
|
||||
|
||||
// MARK: - Error
|
||||
|
||||
extension LocalReceiptValidator {
|
||||
extension AppReceiptValidator {
|
||||
|
||||
public enum Error: Int, Swift.Error {
|
||||
case couldNotFindReceipt
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// DeviceIdentifier+installedDeviceIdentifier_iOS.swift
|
||||
// Hekate macOS
|
||||
// AppReceiptValidator macOS
|
||||
//
|
||||
// Created by Hannes Oud on 06.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
extension LocalReceiptValidator.Parameters.DeviceIdentifier {
|
||||
extension AppReceiptValidator.Parameters.DeviceIdentifier {
|
||||
|
||||
/// On iOS this is the UIDevice's identifierForVendor UUID data
|
||||
static var installedDeviceIdentifierData: Data? {
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// DeviceIdentifier+installedDeviceIdentifier macOS.swift
|
||||
// Hekate macOS
|
||||
// AppReceiptValidator macOS
|
||||
//
|
||||
// Created by Hannes Oud on 06.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
@@ -9,7 +9,7 @@
|
||||
import Foundation
|
||||
import IOKit
|
||||
|
||||
extension LocalReceiptValidator.Parameters.DeviceIdentifier {
|
||||
extension AppReceiptValidator.Parameters.DeviceIdentifier {
|
||||
|
||||
/// On mac this is the primary network interface's MAC Adress as bytes
|
||||
static var installedDeviceIdentifierData: Data? {
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
//
|
||||
// ASN1Helpers.swift
|
||||
// Hekate
|
||||
// AppReceiptValidator
|
||||
//
|
||||
// Created by Hannes Oud on 07.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import AppReceiptValidator.OpenSSL
|
||||
import Foundation
|
||||
import Hekate.OpenSSL
|
||||
|
||||
/// An ASN1 Sequence Object. Of interest are the attributeType and the valueObject.
|
||||
/// The attributeType determines how to interpret the valueObject.
|
||||
@@ -29,7 +29,7 @@ struct ASN1Sequence {
|
||||
/// |type | length | value | …
|
||||
/// +----------------+---------+------------------+---------------
|
||||
///
|
||||
/// - Note: This object cannot ensure that it's pointers are safe, guarantee this from the outside.
|
||||
/// - Note: This object cannot ensure that its pointers are safe, guarantee this from the outside.
|
||||
struct ASN1Object {
|
||||
|
||||
fileprivate(set) var type = Int32(0)
|
||||
@@ -147,7 +147,7 @@ extension ASN1Object {
|
||||
var dateValue: Date? {
|
||||
guard let string = self.stringValue else { return nil }
|
||||
|
||||
return LocalReceiptValidator.asn1DateFormatter.date(from: string)
|
||||
return AppReceiptValidator.asn1DateFormatter.date(from: string)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,13 +1,13 @@
|
||||
//
|
||||
// OpenSSLWrappers.swift
|
||||
// Hekate iOS
|
||||
// AppReceiptValidator iOS
|
||||
//
|
||||
// Created by Hannes Oud on 07.09.17.
|
||||
// Copyright © 2017 IdeasOnCanvas GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
import AppReceiptValidator.OpenSSL
|
||||
import Foundation
|
||||
import Hekate.OpenSSL
|
||||
|
||||
final class BIOWrapper {
|
||||
|
||||
+6
-4
@@ -207,13 +207,13 @@ typedef struct asn1_const_ctx_st {
|
||||
# define ASN1_OBJECT_FLAG_CRITICAL 0x02/* critical x509v3 object id */
|
||||
# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */
|
||||
# define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08/* internal use */
|
||||
typedef struct asn1_object_st {
|
||||
struct asn1_object_st {
|
||||
const char *sn, *ln;
|
||||
int nid;
|
||||
int length;
|
||||
const unsigned char *data; /* data remains const after init */
|
||||
int flags; /* Should we free this one */
|
||||
} ASN1_OBJECT;
|
||||
};
|
||||
|
||||
# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
|
||||
/*
|
||||
@@ -843,7 +843,7 @@ int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
|
||||
|
||||
int ASN1_UTCTIME_check(ASN1_UTCTIME *a);
|
||||
int ASN1_UTCTIME_check(const ASN1_UTCTIME *a);
|
||||
ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);
|
||||
ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
|
||||
int offset_day, long offset_sec);
|
||||
@@ -853,13 +853,15 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
|
||||
time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
|
||||
# endif
|
||||
|
||||
int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
|
||||
int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,
|
||||
time_t t);
|
||||
ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
|
||||
time_t t, int offset_day,
|
||||
long offset_sec);
|
||||
int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
|
||||
int ASN1_TIME_diff(int *pday, int *psec,
|
||||
const ASN1_TIME *from, const ASN1_TIME *to);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
|
||||
ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);
|
||||
+10
-6
@@ -174,6 +174,7 @@ extern "C" {
|
||||
|
||||
# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout
|
||||
* to adjust socket timeouts */
|
||||
# define BIO_CTRL_DGRAM_SET_DONT_FRAG 48
|
||||
|
||||
# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49
|
||||
|
||||
@@ -558,11 +559,11 @@ int BIO_read_filename(BIO *b, const char *name);
|
||||
# define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)
|
||||
# define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)
|
||||
# define BIO_set_ssl_renegotiate_bytes(b,num) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL);
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL)
|
||||
# define BIO_get_num_renegotiates(b) \
|
||||
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL);
|
||||
BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL)
|
||||
# define BIO_set_ssl_renegotiate_timeout(b,seconds) \
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL);
|
||||
BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL)
|
||||
|
||||
/* defined in evp.h */
|
||||
/* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */
|
||||
@@ -688,7 +689,7 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
|
||||
BIO_METHOD *BIO_s_mem(void);
|
||||
BIO *BIO_new_mem_buf(void *buf, int len);
|
||||
BIO *BIO_new_mem_buf(const void *buf, int len);
|
||||
BIO_METHOD *BIO_s_socket(void);
|
||||
BIO_METHOD *BIO_s_connect(void);
|
||||
BIO_METHOD *BIO_s_accept(void);
|
||||
@@ -729,6 +730,9 @@ int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent);
|
||||
int BIO_dump_fp(FILE *fp, const char *s, int len);
|
||||
int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
|
||||
# endif
|
||||
int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data,
|
||||
int datalen);
|
||||
|
||||
struct hostent *BIO_gethostbyname(const char *name);
|
||||
/*-
|
||||
* We might want a thread-safe interface too:
|
||||
@@ -765,8 +769,8 @@ int BIO_dgram_sctp_wait_for_dry(BIO *b);
|
||||
int BIO_dgram_sctp_msg_waiting(BIO *b);
|
||||
# endif
|
||||
BIO *BIO_new_fd(int fd, int close_flag);
|
||||
BIO *BIO_new_connect(char *host_port);
|
||||
BIO *BIO_new_accept(char *host_port);
|
||||
BIO *BIO_new_connect(const char *host_port);
|
||||
BIO *BIO_new_accept(const char *host_port);
|
||||
|
||||
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
|
||||
BIO **bio2, size_t writebuf2);
|
||||
+2
-18
@@ -257,24 +257,6 @@ extern "C" {
|
||||
# define BN_HEX_FMT2 "%08X"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* 2011-02-22 SMS. In various places, a size_t variable or a type cast to
|
||||
* size_t was used to perform integer-only operations on pointers. This
|
||||
* failed on VMS with 64-bit pointers (CC /POINTER_SIZE = 64) because size_t
|
||||
* is still only 32 bits. What's needed in these cases is an integer type
|
||||
* with the same size as a pointer, which size_t is not certain to be. The
|
||||
* only fix here is VMS-specific.
|
||||
*/
|
||||
# if defined(OPENSSL_SYS_VMS)
|
||||
# if __INITIAL_POINTER_SIZE == 64
|
||||
# define PTR_SIZE_INT long long
|
||||
# else /* __INITIAL_POINTER_SIZE == 64 */
|
||||
# define PTR_SIZE_INT int
|
||||
# endif /* __INITIAL_POINTER_SIZE == 64 [else] */
|
||||
# else /* defined(OPENSSL_SYS_VMS) */
|
||||
# define PTR_SIZE_INT size_t
|
||||
# endif /* defined(OPENSSL_SYS_VMS) [else] */
|
||||
|
||||
# define BN_DEFAULT_BITS 1280
|
||||
|
||||
# define BN_FLG_MALLOCED 0x01
|
||||
@@ -860,6 +842,8 @@ int RAND_pseudo_bytes(unsigned char *buf, int num);
|
||||
if (*(ftl--)) break; \
|
||||
(a)->top = tmp_top; \
|
||||
} \
|
||||
if ((a)->top == 0) \
|
||||
(a)->neg = 0; \
|
||||
bn_pollute(a); \
|
||||
}
|
||||
|
||||
+1
@@ -84,6 +84,7 @@ BUF_MEM *BUF_MEM_new(void);
|
||||
void BUF_MEM_free(BUF_MEM *a);
|
||||
int BUF_MEM_grow(BUF_MEM *str, size_t len);
|
||||
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
|
||||
size_t BUF_strnlen(const char *str, size_t maxlen);
|
||||
char *BUF_strdup(const char *str);
|
||||
|
||||
/*
|
||||
+51
-1
@@ -72,9 +72,12 @@ typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
|
||||
typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
|
||||
typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
|
||||
typedef struct CMS_Receipt_st CMS_Receipt;
|
||||
typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
|
||||
typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
|
||||
|
||||
DECLARE_STACK_OF(CMS_SignerInfo)
|
||||
DECLARE_STACK_OF(GENERAL_NAMES)
|
||||
DECLARE_STACK_OF(CMS_RecipientEncryptedKey)
|
||||
DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
|
||||
DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
|
||||
DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
||||
@@ -82,6 +85,7 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
||||
# define CMS_SIGNERINFO_ISSUER_SERIAL 0
|
||||
# define CMS_SIGNERINFO_KEYIDENTIFIER 1
|
||||
|
||||
# define CMS_RECIPINFO_NONE -1
|
||||
# define CMS_RECIPINFO_TRANS 0
|
||||
# define CMS_RECIPINFO_AGREE 1
|
||||
# define CMS_RECIPINFO_KEK 2
|
||||
@@ -111,6 +115,7 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
||||
# define CMS_REUSE_DIGEST 0x8000
|
||||
# define CMS_USE_KEYID 0x10000
|
||||
# define CMS_DEBUG_DECRYPT 0x20000
|
||||
# define CMS_KEY_PARAM 0x40000
|
||||
|
||||
const ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);
|
||||
|
||||
@@ -189,6 +194,7 @@ int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
|
||||
|
||||
STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
|
||||
int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
|
||||
EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
|
||||
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
|
||||
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
|
||||
X509 *recip, unsigned int flags);
|
||||
@@ -234,6 +240,7 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
|
||||
const EVP_CIPHER *kekciph);
|
||||
|
||||
int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
||||
int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
||||
|
||||
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
||||
unsigned int flags);
|
||||
@@ -256,6 +263,8 @@ int CMS_SignedData_init(CMS_ContentInfo *cms);
|
||||
CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
|
||||
X509 *signer, EVP_PKEY *pk, const EVP_MD *md,
|
||||
unsigned int flags);
|
||||
EVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);
|
||||
EVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);
|
||||
STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);
|
||||
|
||||
void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);
|
||||
@@ -268,6 +277,7 @@ int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
|
||||
void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
|
||||
X509 **signer, X509_ALGOR **pdig,
|
||||
X509_ALGOR **psig);
|
||||
ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
|
||||
int CMS_SignerInfo_sign(CMS_SignerInfo *si);
|
||||
int CMS_SignerInfo_verify(CMS_SignerInfo *si);
|
||||
int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
|
||||
@@ -331,8 +341,37 @@ void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
|
||||
int *pallorfirst,
|
||||
STACK_OF(GENERAL_NAMES) **plist,
|
||||
STACK_OF(GENERAL_NAMES) **prto);
|
||||
|
||||
# endif
|
||||
int CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,
|
||||
X509_ALGOR **palg,
|
||||
ASN1_OCTET_STRING **pukm);
|
||||
STACK_OF(CMS_RecipientEncryptedKey)
|
||||
*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);
|
||||
|
||||
int CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,
|
||||
X509_ALGOR **pubalg,
|
||||
ASN1_BIT_STRING **pubkey,
|
||||
ASN1_OCTET_STRING **keyid,
|
||||
X509_NAME **issuer,
|
||||
ASN1_INTEGER **sno);
|
||||
|
||||
int CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
||||
|
||||
int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
|
||||
ASN1_OCTET_STRING **keyid,
|
||||
ASN1_GENERALIZEDTIME **tm,
|
||||
CMS_OtherKeyAttribute **other,
|
||||
X509_NAME **issuer, ASN1_INTEGER **sno);
|
||||
int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
|
||||
X509 *cert);
|
||||
int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
|
||||
EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
|
||||
int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
|
||||
CMS_RecipientInfo *ri,
|
||||
CMS_RecipientEncryptedKey *rek);
|
||||
|
||||
int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
|
||||
ASN1_OCTET_STRING *ukm, int keylen);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
@@ -377,6 +416,7 @@ void ERR_load_CMS_strings(void);
|
||||
# define CMS_F_CMS_ENVELOPEDDATA_CREATE 124
|
||||
# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125
|
||||
# define CMS_F_CMS_ENVELOPED_DATA_INIT 126
|
||||
# define CMS_F_CMS_ENV_ASN1_CTRL 171
|
||||
# define CMS_F_CMS_FINAL 127
|
||||
# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128
|
||||
# define CMS_F_CMS_GET0_CONTENT 129
|
||||
@@ -388,6 +428,12 @@ void ERR_load_CMS_strings(void);
|
||||
# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159
|
||||
# define CMS_F_CMS_RECEIPT_VERIFY 160
|
||||
# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134
|
||||
# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137
|
||||
@@ -401,6 +447,9 @@ void ERR_load_CMS_strings(void);
|
||||
# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
|
||||
# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
|
||||
# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
|
||||
# define CMS_F_CMS_SD_ASN1_CTRL 170
|
||||
# define CMS_F_CMS_SET1_IAS 176
|
||||
# define CMS_F_CMS_SET1_KEYID 177
|
||||
# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
|
||||
# define CMS_F_CMS_SET_DETACHED 147
|
||||
# define CMS_F_CMS_SIGN 148
|
||||
@@ -452,6 +501,7 @@ void ERR_load_CMS_strings(void);
|
||||
# define CMS_R_NOT_A_SIGNED_RECEIPT 165
|
||||
# define CMS_R_NOT_ENCRYPTED_DATA 122
|
||||
# define CMS_R_NOT_KEK 123
|
||||
# define CMS_R_NOT_KEY_AGREEMENT 181
|
||||
# define CMS_R_NOT_KEY_TRANSPORT 124
|
||||
# define CMS_R_NOT_PWRI 177
|
||||
# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 125
|
||||
+2
-2
@@ -14,7 +14,7 @@ extern "C" {
|
||||
|
||||
typedef struct comp_ctx_st COMP_CTX;
|
||||
|
||||
typedef struct comp_method_st {
|
||||
struct comp_method_st {
|
||||
int type; /* NID for compression library */
|
||||
const char *name; /* A text string to identify the library */
|
||||
int (*init) (COMP_CTX *ctx);
|
||||
@@ -30,7 +30,7 @@ typedef struct comp_method_st {
|
||||
*/
|
||||
long (*ctrl) (void);
|
||||
long (*callback_ctrl) (void);
|
||||
} COMP_METHOD;
|
||||
};
|
||||
|
||||
struct comp_ctx_st {
|
||||
COMP_METHOD *meth;
|
||||
+1
@@ -259,6 +259,7 @@ void ERR_load_CONF_strings(void);
|
||||
# define CONF_R_NO_VALUE 108
|
||||
# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103
|
||||
# define CONF_R_UNKNOWN_MODULE_NAME 113
|
||||
# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116
|
||||
# define CONF_R_VARIABLE_HAS_NO_VALUE 104
|
||||
|
||||
#ifdef __cplusplus
|
||||
+1
-1
@@ -628,7 +628,7 @@ void OPENSSL_init(void);
|
||||
* into a defined order as the return value when a != b is undefined, other
|
||||
* than to be non-zero.
|
||||
*/
|
||||
int CRYPTO_memcmp(const void *a, const void *b, size_t len);
|
||||
int CRYPTO_memcmp(const volatile void *a, const volatile void *b, size_t len);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
+1
-1
@@ -104,7 +104,7 @@
|
||||
# endif
|
||||
|
||||
# ifdef _KERBEROS_DES_H
|
||||
# error "des_old.h" replaces <kerberos/des.h>.
|
||||
# error <openssl/des_old.h> replaces <kerberos/des.h>.
|
||||
# endif
|
||||
|
||||
# include "symhacks.h"
|
||||
+132
-7
@@ -142,7 +142,7 @@ struct dh_st {
|
||||
BIGNUM *p;
|
||||
BIGNUM *g;
|
||||
long length; /* optional */
|
||||
BIGNUM *pub_key; /* g^x */
|
||||
BIGNUM *pub_key; /* g^x % p */
|
||||
BIGNUM *priv_key; /* x */
|
||||
int flags;
|
||||
BN_MONT_CTX *method_mont_p;
|
||||
@@ -167,10 +167,14 @@ struct dh_st {
|
||||
# define DH_CHECK_P_NOT_SAFE_PRIME 0x02
|
||||
# define DH_UNABLE_TO_CHECK_GENERATOR 0x04
|
||||
# define DH_NOT_SUITABLE_GENERATOR 0x08
|
||||
# define DH_CHECK_Q_NOT_PRIME 0x10
|
||||
# define DH_CHECK_INVALID_Q_VALUE 0x20
|
||||
# define DH_CHECK_INVALID_J_VALUE 0x40
|
||||
|
||||
/* DH_check_pub_key error codes */
|
||||
# define DH_CHECK_PUBKEY_TOO_SMALL 0x01
|
||||
# define DH_CHECK_PUBKEY_TOO_LARGE 0x02
|
||||
# define DH_CHECK_PUBKEY_INVALID 0x04
|
||||
|
||||
/*
|
||||
* primes p where (p-1)/2 is prime too are called "safe"; we define this for
|
||||
@@ -178,12 +182,29 @@ struct dh_st {
|
||||
*/
|
||||
# define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
|
||||
|
||||
# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
|
||||
(char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
|
||||
# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \
|
||||
(unsigned char *)(x))
|
||||
# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x)
|
||||
# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
|
||||
# define d2i_DHparams_fp(fp,x) \
|
||||
(DH *)ASN1_d2i_fp((char *(*)())DH_new, \
|
||||
(char *(*)())d2i_DHparams, \
|
||||
(fp), \
|
||||
(unsigned char **)(x))
|
||||
# define i2d_DHparams_fp(fp,x) \
|
||||
ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x))
|
||||
# define d2i_DHparams_bio(bp,x) \
|
||||
ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x)
|
||||
# define i2d_DHparams_bio(bp,x) \
|
||||
ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
|
||||
|
||||
# define d2i_DHxparams_fp(fp,x) \
|
||||
(DH *)ASN1_d2i_fp((char *(*)())DH_new, \
|
||||
(char *(*)())d2i_DHxparams, \
|
||||
(fp), \
|
||||
(unsigned char **)(x))
|
||||
# define i2d_DHxparams_fp(fp,x) \
|
||||
ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x))
|
||||
# define d2i_DHxparams_bio(bp,x) \
|
||||
ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x)
|
||||
# define i2d_DHxparams_bio(bp,x) \
|
||||
ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x)
|
||||
|
||||
DH *DHparams_dup(DH *);
|
||||
|
||||
@@ -217,8 +238,11 @@ int DH_check(const DH *dh, int *codes);
|
||||
int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);
|
||||
int DH_generate_key(DH *dh);
|
||||
int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
||||
int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
|
||||
DH *d2i_DHparams(DH **a, const unsigned char **pp, long length);
|
||||
int i2d_DHparams(const DH *a, unsigned char **pp);
|
||||
DH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);
|
||||
int i2d_DHxparams(const DH *a, unsigned char **pp);
|
||||
# ifndef OPENSSL_NO_FP_API
|
||||
int DHparams_print_fp(FILE *fp, const DH *x);
|
||||
# endif
|
||||
@@ -228,16 +252,111 @@ int DHparams_print(BIO *bp, const DH *x);
|
||||
int DHparams_print(char *bp, const DH *x);
|
||||
# endif
|
||||
|
||||
/* RFC 5114 parameters */
|
||||
DH *DH_get_1024_160(void);
|
||||
DH *DH_get_2048_224(void);
|
||||
DH *DH_get_2048_256(void);
|
||||
|
||||
# ifndef OPENSSL_NO_CMS
|
||||
/* RFC2631 KDF */
|
||||
int DH_KDF_X9_42(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
ASN1_OBJECT *key_oid,
|
||||
const unsigned char *ukm, size_t ukmlen, const EVP_MD *md);
|
||||
# endif
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
|
||||
EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
|
||||
EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \
|
||||
EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)oid)
|
||||
|
||||
# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)poid)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)md)
|
||||
|
||||
# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)pmd)
|
||||
|
||||
# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)plen)
|
||||
|
||||
# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)p)
|
||||
|
||||
# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)p)
|
||||
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1)
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2)
|
||||
# define EVP_PKEY_CTRL_DH_RFC5114 (EVP_PKEY_ALG_CTRL + 3)
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN (EVP_PKEY_ALG_CTRL + 4)
|
||||
# define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE (EVP_PKEY_ALG_CTRL + 5)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_TYPE (EVP_PKEY_ALG_CTRL + 6)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 7)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_MD (EVP_PKEY_ALG_CTRL + 8)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 9)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 10)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 11)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_UKM (EVP_PKEY_ALG_CTRL + 12)
|
||||
# define EVP_PKEY_CTRL_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 13)
|
||||
# define EVP_PKEY_CTRL_GET_DH_KDF_OID (EVP_PKEY_ALG_CTRL + 14)
|
||||
|
||||
/* KDF types */
|
||||
# define EVP_PKEY_DH_KDF_NONE 1
|
||||
# define EVP_PKEY_DH_KDF_X9_42 2
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
@@ -252,6 +371,9 @@ void ERR_load_DH_strings(void);
|
||||
# define DH_F_COMPUTE_KEY 102
|
||||
# define DH_F_DHPARAMS_PRINT_FP 101
|
||||
# define DH_F_DH_BUILTIN_GENPARAMS 106
|
||||
# define DH_F_DH_CMS_DECRYPT 117
|
||||
# define DH_F_DH_CMS_SET_PEERKEY 118
|
||||
# define DH_F_DH_CMS_SET_SHARED_INFO 119
|
||||
# define DH_F_DH_COMPUTE_KEY 114
|
||||
# define DH_F_DH_GENERATE_KEY 115
|
||||
# define DH_F_DH_GENERATE_PARAMETERS_EX 116
|
||||
@@ -273,6 +395,7 @@ void ERR_load_DH_strings(void);
|
||||
# define DH_R_BN_ERROR 106
|
||||
# define DH_R_DECODE_ERROR 104
|
||||
# define DH_R_INVALID_PUBKEY 102
|
||||
# define DH_R_KDF_PARAMETER_ERROR 112
|
||||
# define DH_R_KEYS_NOT_SET 108
|
||||
# define DH_R_KEY_SIZE_TOO_SMALL 110
|
||||
# define DH_R_MODULUS_TOO_LARGE 103
|
||||
@@ -280,6 +403,8 @@ void ERR_load_DH_strings(void);
|
||||
# define DH_R_NO_PARAMETERS_SET 107
|
||||
# define DH_R_NO_PRIVATE_VALUE 100
|
||||
# define DH_R_PARAMETER_ENCODING_ERROR 105
|
||||
# define DH_R_PEER_KEY_ERROR 113
|
||||
# define DH_R_SHARED_INFO_ERROR 114
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
+3
@@ -287,6 +287,7 @@ void ERR_load_DSA_strings(void);
|
||||
# define DSA_F_DO_DSA_PRINT 104
|
||||
# define DSA_F_DSAPARAMS_PRINT 100
|
||||
# define DSA_F_DSAPARAMS_PRINT_FP 101
|
||||
# define DSA_F_DSA_BUILTIN_PARAMGEN2 126
|
||||
# define DSA_F_DSA_DO_SIGN 112
|
||||
# define DSA_F_DSA_DO_VERIFY 113
|
||||
# define DSA_F_DSA_GENERATE_KEY 124
|
||||
@@ -316,12 +317,14 @@ void ERR_load_DSA_strings(void);
|
||||
# define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100
|
||||
# define DSA_R_DECODE_ERROR 104
|
||||
# define DSA_R_INVALID_DIGEST_TYPE 106
|
||||
# define DSA_R_INVALID_PARAMETERS 112
|
||||
# define DSA_R_MISSING_PARAMETERS 101
|
||||
# define DSA_R_MODULUS_TOO_LARGE 103
|
||||
# define DSA_R_NEED_NEW_SETUP_VALUES 110
|
||||
# define DSA_R_NON_FIPS_DSA_METHOD 111
|
||||
# define DSA_R_NO_PARAMETERS_SET 107
|
||||
# define DSA_R_PARAMETER_ENCODING_ERROR 105
|
||||
# define DSA_R_Q_NOT_PRIME 113
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
+5
-1
@@ -84,11 +84,15 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
# define DTLS1_VERSION 0xFEFF
|
||||
# define DTLS_MAX_VERSION DTLS1_VERSION
|
||||
# define DTLS1_2_VERSION 0xFEFD
|
||||
# define DTLS_MAX_VERSION DTLS1_2_VERSION
|
||||
# define DTLS1_VERSION_MAJOR 0xFE
|
||||
|
||||
# define DTLS1_BAD_VER 0x0100
|
||||
|
||||
/* Special value for method supporting multiple versions */
|
||||
# define DTLS_ANY_VERSION 0x1FFFF
|
||||
|
||||
# if 0
|
||||
/* this alert description is not specified anywhere... */
|
||||
# define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE 110
|
||||
+1
-1
@@ -101,7 +101,7 @@ extern "C" {
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# define OPENSSL_SYS_WIN32_UWIN
|
||||
# else
|
||||
# if defined(__CYGWIN32__) || defined(OPENSSL_SYSNAME_CYGWIN32)
|
||||
# if defined(__CYGWIN__) || defined(OPENSSL_SYSNAME_CYGWIN)
|
||||
# undef OPENSSL_SYS_UNIX
|
||||
# define OPENSSL_SYS_WIN32_CYGWIN
|
||||
# else
|
||||
+90
-1
@@ -240,6 +240,12 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
|
||||
*/
|
||||
const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);
|
||||
|
||||
/** Returns the montgomery data for order(Generator)
|
||||
* \param group EC_GROUP object
|
||||
* \return the currently used generator (possibly NULL).
|
||||
*/
|
||||
BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);
|
||||
|
||||
/** Gets the order of a EC_GROUP
|
||||
* \param group EC_GROUP object
|
||||
* \param order BIGNUM to which the order is copied
|
||||
@@ -404,6 +410,9 @@ typedef struct {
|
||||
*/
|
||||
size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
|
||||
|
||||
const char *EC_curve_nid2nist(int nid);
|
||||
int EC_curve_nist2nid(const char *name);
|
||||
|
||||
/********************************************************************/
|
||||
/* EC_POINT functions */
|
||||
/********************************************************************/
|
||||
@@ -986,10 +995,78 @@ int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);
|
||||
# endif
|
||||
|
||||
# define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_PARAMGEN, \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \
|
||||
EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_ec_param_enc(ctx, flag) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \
|
||||
EVP_PKEY_CTRL_EC_PARAM_ENC, flag, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, flag) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_EC_ECDH_COFACTOR, flag, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_EC_ECDH_COFACTOR, -2, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx, kdf) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_EC_KDF_TYPE, kdf, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_EC_KDF_TYPE, -2, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)md)
|
||||
|
||||
# define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx, pmd) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)pmd)
|
||||
|
||||
# define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx, len) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_EC_KDF_OUTLEN, len, NULL)
|
||||
|
||||
# define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx, plen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN, 0, (void *)plen)
|
||||
|
||||
# define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p, plen) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)p)
|
||||
|
||||
# define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx, p) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \
|
||||
EVP_PKEY_OP_DERIVE, \
|
||||
EVP_PKEY_CTRL_GET_EC_KDF_UKM, 0, (void *)p)
|
||||
|
||||
# define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 1)
|
||||
# define EVP_PKEY_CTRL_EC_PARAM_ENC (EVP_PKEY_ALG_CTRL + 2)
|
||||
# define EVP_PKEY_CTRL_EC_ECDH_COFACTOR (EVP_PKEY_ALG_CTRL + 3)
|
||||
# define EVP_PKEY_CTRL_EC_KDF_TYPE (EVP_PKEY_ALG_CTRL + 4)
|
||||
# define EVP_PKEY_CTRL_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 5)
|
||||
# define EVP_PKEY_CTRL_GET_EC_KDF_MD (EVP_PKEY_ALG_CTRL + 6)
|
||||
# define EVP_PKEY_CTRL_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 7)
|
||||
# define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN (EVP_PKEY_ALG_CTRL + 8)
|
||||
# define EVP_PKEY_CTRL_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 9)
|
||||
# define EVP_PKEY_CTRL_GET_EC_KDF_UKM (EVP_PKEY_ALG_CTRL + 10)
|
||||
/* KDF types */
|
||||
# define EVP_PKEY_ECDH_KDF_NONE 1
|
||||
# define EVP_PKEY_ECDH_KDF_X9_62 2
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
@@ -1007,6 +1084,8 @@ void ERR_load_EC_strings(void);
|
||||
# define EC_F_D2I_ECPKPARAMETERS 145
|
||||
# define EC_F_D2I_ECPRIVATEKEY 146
|
||||
# define EC_F_DO_EC_KEY_PRINT 221
|
||||
# define EC_F_ECDH_CMS_DECRYPT 238
|
||||
# define EC_F_ECDH_CMS_SET_SHARED_INFO 239
|
||||
# define EC_F_ECKEY_PARAM2TYPE 223
|
||||
# define EC_F_ECKEY_PARAM_DECODE 212
|
||||
# define EC_F_ECKEY_PRIV_DECODE 213
|
||||
@@ -1018,6 +1097,12 @@ void ERR_load_EC_strings(void);
|
||||
# define EC_F_ECPARAMETERS_PRINT_FP 148
|
||||
# define EC_F_ECPKPARAMETERS_PRINT 149
|
||||
# define EC_F_ECPKPARAMETERS_PRINT_FP 150
|
||||
# define EC_F_ECP_NISTZ256_GET_AFFINE 240
|
||||
# define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE 243
|
||||
# define EC_F_ECP_NISTZ256_POINTS_MUL 241
|
||||
# define EC_F_ECP_NISTZ256_PRE_COMP_NEW 244
|
||||
# define EC_F_ECP_NISTZ256_SET_WORDS 245
|
||||
# define EC_F_ECP_NISTZ256_WINDOWED_MUL 242
|
||||
# define EC_F_ECP_NIST_MOD_192 203
|
||||
# define EC_F_ECP_NIST_MOD_224 204
|
||||
# define EC_F_ECP_NIST_MOD_256 205
|
||||
@@ -1157,6 +1242,7 @@ void ERR_load_EC_strings(void);
|
||||
# define EC_R_INVALID_COMPRESSED_POINT 110
|
||||
# define EC_R_INVALID_COMPRESSION_BIT 109
|
||||
# define EC_R_INVALID_CURVE 141
|
||||
# define EC_R_INVALID_DIGEST 151
|
||||
# define EC_R_INVALID_DIGEST_TYPE 138
|
||||
# define EC_R_INVALID_ENCODING 102
|
||||
# define EC_R_INVALID_FIELD 103
|
||||
@@ -1165,6 +1251,7 @@ void ERR_load_EC_strings(void);
|
||||
# define EC_R_INVALID_PENTANOMIAL_BASIS 132
|
||||
# define EC_R_INVALID_PRIVATE_KEY 123
|
||||
# define EC_R_INVALID_TRINOMIAL_BASIS 137
|
||||
# define EC_R_KDF_PARAMETER_ERROR 148
|
||||
# define EC_R_KEYS_NOT_SET 140
|
||||
# define EC_R_MISSING_PARAMETERS 124
|
||||
# define EC_R_MISSING_PRIVATE_KEY 125
|
||||
@@ -1175,9 +1262,11 @@ void ERR_load_EC_strings(void);
|
||||
# define EC_R_NO_FIELD_MOD 133
|
||||
# define EC_R_NO_PARAMETERS_SET 139
|
||||
# define EC_R_PASSED_NULL_PARAMETER 134
|
||||
# define EC_R_PEER_KEY_ERROR 149
|
||||
# define EC_R_PKPARAMETERS2GROUP_FAILURE 127
|
||||
# define EC_R_POINT_AT_INFINITY 106
|
||||
# define EC_R_POINT_IS_NOT_ON_CURVE 107
|
||||
# define EC_R_SHARED_INFO_ERROR 150
|
||||
# define EC_R_SLOT_FULL 108
|
||||
# define EC_R_UNDEFINED_GENERATOR 113
|
||||
# define EC_R_UNDEFINED_ORDER 128
|
||||
+7
@@ -85,6 +85,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# define EC_FLAG_COFACTOR_ECDH 0x1000
|
||||
|
||||
const ECDH_METHOD *ECDH_OpenSSL(void);
|
||||
|
||||
void ECDH_set_default_method(const ECDH_METHOD *);
|
||||
@@ -101,6 +103,11 @@ int ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
|
||||
int ECDH_set_ex_data(EC_KEY *d, int idx, void *arg);
|
||||
void *ECDH_get_ex_data(EC_KEY *d, int idx);
|
||||
|
||||
int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
|
||||
const unsigned char *Z, size_t Zlen,
|
||||
const unsigned char *sinfo, size_t sinfolen,
|
||||
const EVP_MD *md);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
+75
@@ -228,6 +228,80 @@ int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
|
||||
int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
|
||||
void *ECDSA_get_ex_data(EC_KEY *d, int idx);
|
||||
|
||||
/** Allocates and initialize a ECDSA_METHOD structure
|
||||
* \param ecdsa_method pointer to ECDSA_METHOD to copy. (May be NULL)
|
||||
* \return pointer to a ECDSA_METHOD structure or NULL if an error occurred
|
||||
*/
|
||||
|
||||
ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method);
|
||||
|
||||
/** frees a ECDSA_METHOD structure
|
||||
* \param ecdsa_method pointer to the ECDSA_METHOD structure
|
||||
*/
|
||||
void ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method);
|
||||
|
||||
/** Sets application specific data in the ECDSA_METHOD
|
||||
* \param ecdsa_method pointer to existing ECDSA_METHOD
|
||||
* \param app application specific data to set
|
||||
*/
|
||||
|
||||
void ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app);
|
||||
|
||||
/** Returns application specific data from a ECDSA_METHOD structure
|
||||
* \param ecdsa_method pointer to ECDSA_METHOD structure
|
||||
* \return pointer to application specific data.
|
||||
*/
|
||||
|
||||
void *ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method);
|
||||
|
||||
/** Set the ECDSA_do_sign function in the ECDSA_METHOD
|
||||
* \param ecdsa_method pointer to existing ECDSA_METHOD
|
||||
* \param ecdsa_do_sign a funtion of type ECDSA_do_sign
|
||||
*/
|
||||
|
||||
void ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method,
|
||||
ECDSA_SIG *(*ecdsa_do_sign) (const unsigned char
|
||||
*dgst, int dgst_len,
|
||||
const BIGNUM *inv,
|
||||
const BIGNUM *rp,
|
||||
EC_KEY *eckey));
|
||||
|
||||
/** Set the ECDSA_sign_setup function in the ECDSA_METHOD
|
||||
* \param ecdsa_method pointer to existing ECDSA_METHOD
|
||||
* \param ecdsa_sign_setup a funtion of type ECDSA_sign_setup
|
||||
*/
|
||||
|
||||
void ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method,
|
||||
int (*ecdsa_sign_setup) (EC_KEY *eckey,
|
||||
BN_CTX *ctx,
|
||||
BIGNUM **kinv,
|
||||
BIGNUM **r));
|
||||
|
||||
/** Set the ECDSA_do_verify function in the ECDSA_METHOD
|
||||
* \param ecdsa_method pointer to existing ECDSA_METHOD
|
||||
* \param ecdsa_do_verify a funtion of type ECDSA_do_verify
|
||||
*/
|
||||
|
||||
void ECDSA_METHOD_set_verify(ECDSA_METHOD *ecdsa_method,
|
||||
int (*ecdsa_do_verify) (const unsigned char
|
||||
*dgst, int dgst_len,
|
||||
const ECDSA_SIG *sig,
|
||||
EC_KEY *eckey));
|
||||
|
||||
void ECDSA_METHOD_set_flags(ECDSA_METHOD *ecdsa_method, int flags);
|
||||
|
||||
/** Set the flags field in the ECDSA_METHOD
|
||||
* \param ecdsa_method pointer to existing ECDSA_METHOD
|
||||
* \param flags flags value to set
|
||||
*/
|
||||
|
||||
void ECDSA_METHOD_set_name(ECDSA_METHOD *ecdsa_method, char *name);
|
||||
|
||||
/** Set the name field in the ECDSA_METHOD
|
||||
* \param ecdsa_method pointer to existing ECDSA_METHOD
|
||||
* \param name name to set
|
||||
*/
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
@@ -242,6 +316,7 @@ void ERR_load_ECDSA_strings(void);
|
||||
# define ECDSA_F_ECDSA_DATA_NEW_METHOD 100
|
||||
# define ECDSA_F_ECDSA_DO_SIGN 101
|
||||
# define ECDSA_F_ECDSA_DO_VERIFY 102
|
||||
# define ECDSA_F_ECDSA_METHOD_NEW 105
|
||||
# define ECDSA_F_ECDSA_SIGN_SETUP 103
|
||||
|
||||
/* Reason codes. */
|
||||
-1
@@ -413,7 +413,6 @@ void ENGINE_load_gost(void);
|
||||
# endif
|
||||
# endif
|
||||
void ENGINE_load_cryptodev(void);
|
||||
void ENGINE_load_rsax(void);
|
||||
void ENGINE_load_rdrand(void);
|
||||
void ENGINE_load_builtin_engines(void);
|
||||
|
||||
+1
@@ -258,6 +258,7 @@ typedef struct err_state_st {
|
||||
# define SYS_F_WSASTARTUP 9/* Winsock stuff */
|
||||
# define SYS_F_OPENDIR 10
|
||||
# define SYS_F_FREAD 11
|
||||
# define SYS_F_FFLUSH 18
|
||||
|
||||
/* reasons */
|
||||
# define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */
|
||||
+151
-3
@@ -113,6 +113,7 @@
|
||||
# define EVP_PKEY_DSA3 NID_dsaWithSHA1
|
||||
# define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
|
||||
# define EVP_PKEY_DH NID_dhKeyAgreement
|
||||
# define EVP_PKEY_DHX NID_dhpublicnumber
|
||||
# define EVP_PKEY_EC NID_X9_62_id_ecPublicKey
|
||||
# define EVP_PKEY_HMAC NID_hmac
|
||||
# define EVP_PKEY_CMAC NID_cmac
|
||||
@@ -345,6 +346,7 @@ struct evp_cipher_st {
|
||||
# define EVP_CIPH_GCM_MODE 0x6
|
||||
# define EVP_CIPH_CCM_MODE 0x7
|
||||
# define EVP_CIPH_XTS_MODE 0x10001
|
||||
# define EVP_CIPH_WRAP_MODE 0x10002
|
||||
# define EVP_CIPH_MODE 0xF0007
|
||||
/* Set if variable length cipher */
|
||||
# define EVP_CIPH_VARIABLE_LENGTH 0x8
|
||||
@@ -375,6 +377,14 @@ struct evp_cipher_st {
|
||||
*/
|
||||
# define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000
|
||||
# define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000
|
||||
# define EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000
|
||||
|
||||
/*
|
||||
* Cipher context flag to indicate we can handle wrap mode: if allowed in
|
||||
* older applications it could overflow buffers.
|
||||
*/
|
||||
|
||||
# define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0x1
|
||||
|
||||
/* ctrl() values */
|
||||
|
||||
@@ -408,9 +418,21 @@ struct evp_cipher_st {
|
||||
/* Set the GCM invocation field, decrypt only */
|
||||
# define EVP_CTRL_GCM_SET_IV_INV 0x18
|
||||
|
||||
# define EVP_CTRL_TLS1_1_MULTIBLOCK_AAD 0x19
|
||||
# define EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT 0x1a
|
||||
# define EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT 0x1b
|
||||
# define EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE 0x1c
|
||||
|
||||
/* RFC 5246 defines additional data to be 13 bytes in length */
|
||||
# define EVP_AEAD_TLS1_AAD_LEN 13
|
||||
|
||||
typedef struct {
|
||||
unsigned char *out;
|
||||
const unsigned char *inp;
|
||||
size_t len;
|
||||
unsigned int interleave;
|
||||
} EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM;
|
||||
|
||||
/* GCM TLS constants */
|
||||
/* Length of fixed part of IV derived from PRF */
|
||||
# define EVP_GCM_TLS_FIXED_IV_LEN 4
|
||||
@@ -639,7 +661,8 @@ int EVP_DigestSignFinal(EVP_MD_CTX *ctx,
|
||||
|
||||
int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,
|
||||
const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
|
||||
int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen);
|
||||
int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx,
|
||||
const unsigned char *sig, size_t siglen);
|
||||
|
||||
int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
|
||||
const unsigned char *ek, int ekl, const unsigned char *iv,
|
||||
@@ -744,6 +767,7 @@ const EVP_CIPHER *EVP_des_cbc(void);
|
||||
const EVP_CIPHER *EVP_des_ede_cbc(void);
|
||||
const EVP_CIPHER *EVP_des_ede3_cbc(void);
|
||||
const EVP_CIPHER *EVP_desx_cbc(void);
|
||||
const EVP_CIPHER *EVP_des_ede3_wrap(void);
|
||||
/*
|
||||
* This should now be supported through the dev_crypto ENGINE. But also, why
|
||||
* are rc4 and md5 declarations made here inside a "NO_DES" precompiler
|
||||
@@ -813,6 +837,7 @@ const EVP_CIPHER *EVP_aes_128_ctr(void);
|
||||
const EVP_CIPHER *EVP_aes_128_ccm(void);
|
||||
const EVP_CIPHER *EVP_aes_128_gcm(void);
|
||||
const EVP_CIPHER *EVP_aes_128_xts(void);
|
||||
const EVP_CIPHER *EVP_aes_128_wrap(void);
|
||||
const EVP_CIPHER *EVP_aes_192_ecb(void);
|
||||
const EVP_CIPHER *EVP_aes_192_cbc(void);
|
||||
const EVP_CIPHER *EVP_aes_192_cfb1(void);
|
||||
@@ -823,6 +848,7 @@ const EVP_CIPHER *EVP_aes_192_ofb(void);
|
||||
const EVP_CIPHER *EVP_aes_192_ctr(void);
|
||||
const EVP_CIPHER *EVP_aes_192_ccm(void);
|
||||
const EVP_CIPHER *EVP_aes_192_gcm(void);
|
||||
const EVP_CIPHER *EVP_aes_192_wrap(void);
|
||||
const EVP_CIPHER *EVP_aes_256_ecb(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cbc(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cfb1(void);
|
||||
@@ -834,10 +860,15 @@ const EVP_CIPHER *EVP_aes_256_ctr(void);
|
||||
const EVP_CIPHER *EVP_aes_256_ccm(void);
|
||||
const EVP_CIPHER *EVP_aes_256_gcm(void);
|
||||
const EVP_CIPHER *EVP_aes_256_xts(void);
|
||||
const EVP_CIPHER *EVP_aes_256_wrap(void);
|
||||
# if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
|
||||
const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void);
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SHA256
|
||||
const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void);
|
||||
const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void);
|
||||
# endif
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CAMELLIA
|
||||
const EVP_CIPHER *EVP_camellia_128_ecb(void);
|
||||
@@ -1028,6 +1059,7 @@ void EVP_PBE_cleanup(void);
|
||||
# define ASN1_PKEY_CTRL_DEFAULT_MD_NID 0x3
|
||||
# define ASN1_PKEY_CTRL_CMS_SIGN 0x5
|
||||
# define ASN1_PKEY_CTRL_CMS_ENVELOPE 0x7
|
||||
# define ASN1_PKEY_CTRL_CMS_RI_TYPE 0x8
|
||||
|
||||
int EVP_PKEY_asn1_get_count(void);
|
||||
const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);
|
||||
@@ -1091,6 +1123,19 @@ void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,
|
||||
void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
|
||||
int (*pkey_ctrl) (EVP_PKEY *pkey, int op,
|
||||
long arg1, void *arg2));
|
||||
void EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,
|
||||
int (*item_verify) (EVP_MD_CTX *ctx,
|
||||
const ASN1_ITEM *it,
|
||||
void *asn,
|
||||
X509_ALGOR *a,
|
||||
ASN1_BIT_STRING *sig,
|
||||
EVP_PKEY *pkey),
|
||||
int (*item_sign) (EVP_MD_CTX *ctx,
|
||||
const ASN1_ITEM *it,
|
||||
void *asn,
|
||||
X509_ALGOR *alg1,
|
||||
X509_ALGOR *alg2,
|
||||
ASN1_BIT_STRING *sig));
|
||||
|
||||
# define EVP_PKEY_OP_UNDEFINED 0
|
||||
# define EVP_PKEY_OP_PARAMGEN (1<<1)
|
||||
@@ -1121,6 +1166,10 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
|
||||
EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \
|
||||
EVP_PKEY_CTRL_MD, 0, (void *)md)
|
||||
|
||||
# define EVP_PKEY_CTX_get_signature_md(ctx, pmd) \
|
||||
EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG, \
|
||||
EVP_PKEY_CTRL_GET_MD, 0, (void *)pmd)
|
||||
|
||||
# define EVP_PKEY_CTRL_MD 1
|
||||
# define EVP_PKEY_CTRL_PEER_KEY 2
|
||||
|
||||
@@ -1142,6 +1191,8 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,
|
||||
|
||||
# define EVP_PKEY_CTRL_CIPHER 12
|
||||
|
||||
# define EVP_PKEY_CTRL_GET_MD 13
|
||||
|
||||
# define EVP_PKEY_ALG_CTRL 0x1000
|
||||
|
||||
# define EVP_PKEY_FLAG_AUTOARGLEN 2
|
||||
@@ -1312,6 +1363,98 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,
|
||||
const char *type,
|
||||
const char *value));
|
||||
|
||||
void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pinit) (EVP_PKEY_CTX *ctx));
|
||||
|
||||
void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pcopy) (EVP_PKEY_CTX *dst,
|
||||
EVP_PKEY_CTX *src));
|
||||
|
||||
void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth,
|
||||
void (**pcleanup) (EVP_PKEY_CTX *ctx));
|
||||
|
||||
void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pparamgen_init) (EVP_PKEY_CTX *ctx),
|
||||
int (**pparamgen) (EVP_PKEY_CTX *ctx,
|
||||
EVP_PKEY *pkey));
|
||||
|
||||
void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pkeygen_init) (EVP_PKEY_CTX *ctx),
|
||||
int (**pkeygen) (EVP_PKEY_CTX *ctx,
|
||||
EVP_PKEY *pkey));
|
||||
|
||||
void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth,
|
||||
int (**psign_init) (EVP_PKEY_CTX *ctx),
|
||||
int (**psign) (EVP_PKEY_CTX *ctx,
|
||||
unsigned char *sig, size_t *siglen,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen));
|
||||
|
||||
void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pverify_init) (EVP_PKEY_CTX *ctx),
|
||||
int (**pverify) (EVP_PKEY_CTX *ctx,
|
||||
const unsigned char *sig,
|
||||
size_t siglen,
|
||||
const unsigned char *tbs,
|
||||
size_t tbslen));
|
||||
|
||||
void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pverify_recover_init) (EVP_PKEY_CTX
|
||||
*ctx),
|
||||
int (**pverify_recover) (EVP_PKEY_CTX
|
||||
*ctx,
|
||||
unsigned char
|
||||
*sig,
|
||||
size_t *siglen,
|
||||
const unsigned
|
||||
char *tbs,
|
||||
size_t tbslen));
|
||||
|
||||
void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth,
|
||||
int (**psignctx_init) (EVP_PKEY_CTX *ctx,
|
||||
EVP_MD_CTX *mctx),
|
||||
int (**psignctx) (EVP_PKEY_CTX *ctx,
|
||||
unsigned char *sig,
|
||||
size_t *siglen,
|
||||
EVP_MD_CTX *mctx));
|
||||
|
||||
void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pverifyctx_init) (EVP_PKEY_CTX *ctx,
|
||||
EVP_MD_CTX *mctx),
|
||||
int (**pverifyctx) (EVP_PKEY_CTX *ctx,
|
||||
const unsigned char *sig,
|
||||
int siglen,
|
||||
EVP_MD_CTX *mctx));
|
||||
|
||||
void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pencrypt_init) (EVP_PKEY_CTX *ctx),
|
||||
int (**pencryptfn) (EVP_PKEY_CTX *ctx,
|
||||
unsigned char *out,
|
||||
size_t *outlen,
|
||||
const unsigned char *in,
|
||||
size_t inlen));
|
||||
|
||||
void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pdecrypt_init) (EVP_PKEY_CTX *ctx),
|
||||
int (**pdecrypt) (EVP_PKEY_CTX *ctx,
|
||||
unsigned char *out,
|
||||
size_t *outlen,
|
||||
const unsigned char *in,
|
||||
size_t inlen));
|
||||
|
||||
void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pderive_init) (EVP_PKEY_CTX *ctx),
|
||||
int (**pderive) (EVP_PKEY_CTX *ctx,
|
||||
unsigned char *key,
|
||||
size_t *keylen));
|
||||
|
||||
void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth,
|
||||
int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1,
|
||||
void *p2),
|
||||
int (**pctrl_str) (EVP_PKEY_CTX *ctx,
|
||||
const char *type,
|
||||
const char *value));
|
||||
|
||||
void EVP_add_alg_module(void);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
@@ -1319,6 +1462,7 @@ void EVP_add_alg_module(void);
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
|
||||
void ERR_load_EVP_strings(void);
|
||||
|
||||
/* Error codes for the EVP functions. */
|
||||
@@ -1327,11 +1471,13 @@ void ERR_load_EVP_strings(void);
|
||||
# define EVP_F_AESNI_INIT_KEY 165
|
||||
# define EVP_F_AESNI_XTS_CIPHER 176
|
||||
# define EVP_F_AES_INIT_KEY 133
|
||||
# define EVP_F_AES_T4_INIT_KEY 178
|
||||
# define EVP_F_AES_XTS 172
|
||||
# define EVP_F_AES_XTS_CIPHER 175
|
||||
# define EVP_F_ALG_MODULE_INIT 177
|
||||
# define EVP_F_CAMELLIA_INIT_KEY 159
|
||||
# define EVP_F_CMAC_INIT 173
|
||||
# define EVP_F_CMLL_T4_INIT_KEY 179
|
||||
# define EVP_F_D2I_PKEY 100
|
||||
# define EVP_F_DO_SIGVER_INIT 161
|
||||
# define EVP_F_DSAPKEY2PKCS8 134
|
||||
@@ -1436,6 +1582,7 @@ void ERR_load_EVP_strings(void);
|
||||
# define EVP_R_INPUT_NOT_INITIALIZED 111
|
||||
# define EVP_R_INVALID_DIGEST 152
|
||||
# define EVP_R_INVALID_FIPS_MODE 168
|
||||
# define EVP_R_INVALID_KEY 171
|
||||
# define EVP_R_INVALID_KEY_LENGTH 130
|
||||
# define EVP_R_INVALID_OPERATION 148
|
||||
# define EVP_R_IV_TOO_LARGE 102
|
||||
@@ -1471,10 +1618,11 @@ void ERR_load_EVP_strings(void);
|
||||
# define EVP_R_UNSUPPORTED_PRF 125
|
||||
# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118
|
||||
# define EVP_R_UNSUPPORTED_SALT_TYPE 126
|
||||
# define EVP_R_WRAP_MODE_NOT_ALLOWED 170
|
||||
# define EVP_R_WRONG_FINAL_BLOCK_LENGTH 109
|
||||
# define EVP_R_WRONG_PUBLIC_KEY_TYPE 110
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
+10
@@ -148,6 +148,16 @@ int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
|
||||
const unsigned char *inp, unsigned char *out,
|
||||
size_t len, int enc);
|
||||
|
||||
size_t CRYPTO_128_wrap(void *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, size_t inlen,
|
||||
block128_f block);
|
||||
|
||||
size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, size_t inlen,
|
||||
block128_f block);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
+163
@@ -590,6 +590,11 @@
|
||||
#define NID_mgf1 911
|
||||
#define OBJ_mgf1 OBJ_pkcs1,8L
|
||||
|
||||
#define SN_pSpecified "PSPECIFIED"
|
||||
#define LN_pSpecified "pSpecified"
|
||||
#define NID_pSpecified 935
|
||||
#define OBJ_pSpecified OBJ_pkcs1,9L
|
||||
|
||||
#define SN_rsassaPss "RSASSA-PSS"
|
||||
#define LN_rsassaPss "rsassaPss"
|
||||
#define NID_rsassaPss 912
|
||||
@@ -4029,3 +4034,161 @@
|
||||
#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1"
|
||||
#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1"
|
||||
#define NID_aes_256_cbc_hmac_sha1 918
|
||||
|
||||
#define SN_aes_128_cbc_hmac_sha256 "AES-128-CBC-HMAC-SHA256"
|
||||
#define LN_aes_128_cbc_hmac_sha256 "aes-128-cbc-hmac-sha256"
|
||||
#define NID_aes_128_cbc_hmac_sha256 948
|
||||
|
||||
#define SN_aes_192_cbc_hmac_sha256 "AES-192-CBC-HMAC-SHA256"
|
||||
#define LN_aes_192_cbc_hmac_sha256 "aes-192-cbc-hmac-sha256"
|
||||
#define NID_aes_192_cbc_hmac_sha256 949
|
||||
|
||||
#define SN_aes_256_cbc_hmac_sha256 "AES-256-CBC-HMAC-SHA256"
|
||||
#define LN_aes_256_cbc_hmac_sha256 "aes-256-cbc-hmac-sha256"
|
||||
#define NID_aes_256_cbc_hmac_sha256 950
|
||||
|
||||
#define SN_dhpublicnumber "dhpublicnumber"
|
||||
#define LN_dhpublicnumber "X9.42 DH"
|
||||
#define NID_dhpublicnumber 920
|
||||
#define OBJ_dhpublicnumber OBJ_ISO_US,10046L,2L,1L
|
||||
|
||||
#define SN_brainpoolP160r1 "brainpoolP160r1"
|
||||
#define NID_brainpoolP160r1 921
|
||||
#define OBJ_brainpoolP160r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,1L
|
||||
|
||||
#define SN_brainpoolP160t1 "brainpoolP160t1"
|
||||
#define NID_brainpoolP160t1 922
|
||||
#define OBJ_brainpoolP160t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,2L
|
||||
|
||||
#define SN_brainpoolP192r1 "brainpoolP192r1"
|
||||
#define NID_brainpoolP192r1 923
|
||||
#define OBJ_brainpoolP192r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,3L
|
||||
|
||||
#define SN_brainpoolP192t1 "brainpoolP192t1"
|
||||
#define NID_brainpoolP192t1 924
|
||||
#define OBJ_brainpoolP192t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,4L
|
||||
|
||||
#define SN_brainpoolP224r1 "brainpoolP224r1"
|
||||
#define NID_brainpoolP224r1 925
|
||||
#define OBJ_brainpoolP224r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,5L
|
||||
|
||||
#define SN_brainpoolP224t1 "brainpoolP224t1"
|
||||
#define NID_brainpoolP224t1 926
|
||||
#define OBJ_brainpoolP224t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,6L
|
||||
|
||||
#define SN_brainpoolP256r1 "brainpoolP256r1"
|
||||
#define NID_brainpoolP256r1 927
|
||||
#define OBJ_brainpoolP256r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,7L
|
||||
|
||||
#define SN_brainpoolP256t1 "brainpoolP256t1"
|
||||
#define NID_brainpoolP256t1 928
|
||||
#define OBJ_brainpoolP256t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,8L
|
||||
|
||||
#define SN_brainpoolP320r1 "brainpoolP320r1"
|
||||
#define NID_brainpoolP320r1 929
|
||||
#define OBJ_brainpoolP320r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,9L
|
||||
|
||||
#define SN_brainpoolP320t1 "brainpoolP320t1"
|
||||
#define NID_brainpoolP320t1 930
|
||||
#define OBJ_brainpoolP320t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,10L
|
||||
|
||||
#define SN_brainpoolP384r1 "brainpoolP384r1"
|
||||
#define NID_brainpoolP384r1 931
|
||||
#define OBJ_brainpoolP384r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,11L
|
||||
|
||||
#define SN_brainpoolP384t1 "brainpoolP384t1"
|
||||
#define NID_brainpoolP384t1 932
|
||||
#define OBJ_brainpoolP384t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,12L
|
||||
|
||||
#define SN_brainpoolP512r1 "brainpoolP512r1"
|
||||
#define NID_brainpoolP512r1 933
|
||||
#define OBJ_brainpoolP512r1 1L,3L,36L,3L,3L,2L,8L,1L,1L,13L
|
||||
|
||||
#define SN_brainpoolP512t1 "brainpoolP512t1"
|
||||
#define NID_brainpoolP512t1 934
|
||||
#define OBJ_brainpoolP512t1 1L,3L,36L,3L,3L,2L,8L,1L,1L,14L
|
||||
|
||||
#define OBJ_x9_63_scheme 1L,3L,133L,16L,840L,63L,0L
|
||||
|
||||
#define OBJ_secg_scheme OBJ_certicom_arc,1L
|
||||
|
||||
#define SN_dhSinglePass_stdDH_sha1kdf_scheme "dhSinglePass-stdDH-sha1kdf-scheme"
|
||||
#define NID_dhSinglePass_stdDH_sha1kdf_scheme 936
|
||||
#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme OBJ_x9_63_scheme,2L
|
||||
|
||||
#define SN_dhSinglePass_stdDH_sha224kdf_scheme "dhSinglePass-stdDH-sha224kdf-scheme"
|
||||
#define NID_dhSinglePass_stdDH_sha224kdf_scheme 937
|
||||
#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme OBJ_secg_scheme,11L,0L
|
||||
|
||||
#define SN_dhSinglePass_stdDH_sha256kdf_scheme "dhSinglePass-stdDH-sha256kdf-scheme"
|
||||
#define NID_dhSinglePass_stdDH_sha256kdf_scheme 938
|
||||
#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme OBJ_secg_scheme,11L,1L
|
||||
|
||||
#define SN_dhSinglePass_stdDH_sha384kdf_scheme "dhSinglePass-stdDH-sha384kdf-scheme"
|
||||
#define NID_dhSinglePass_stdDH_sha384kdf_scheme 939
|
||||
#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme OBJ_secg_scheme,11L,2L
|
||||
|
||||
#define SN_dhSinglePass_stdDH_sha512kdf_scheme "dhSinglePass-stdDH-sha512kdf-scheme"
|
||||
#define NID_dhSinglePass_stdDH_sha512kdf_scheme 940
|
||||
#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme OBJ_secg_scheme,11L,3L
|
||||
|
||||
#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme "dhSinglePass-cofactorDH-sha1kdf-scheme"
|
||||
#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme 941
|
||||
#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme OBJ_x9_63_scheme,3L
|
||||
|
||||
#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme "dhSinglePass-cofactorDH-sha224kdf-scheme"
|
||||
#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme 942
|
||||
#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme OBJ_secg_scheme,14L,0L
|
||||
|
||||
#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme "dhSinglePass-cofactorDH-sha256kdf-scheme"
|
||||
#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme 943
|
||||
#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme OBJ_secg_scheme,14L,1L
|
||||
|
||||
#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme "dhSinglePass-cofactorDH-sha384kdf-scheme"
|
||||
#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme 944
|
||||
#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme OBJ_secg_scheme,14L,2L
|
||||
|
||||
#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme "dhSinglePass-cofactorDH-sha512kdf-scheme"
|
||||
#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme 945
|
||||
#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme OBJ_secg_scheme,14L,3L
|
||||
|
||||
#define SN_dh_std_kdf "dh-std-kdf"
|
||||
#define NID_dh_std_kdf 946
|
||||
|
||||
#define SN_dh_cofactor_kdf "dh-cofactor-kdf"
|
||||
#define NID_dh_cofactor_kdf 947
|
||||
|
||||
#define SN_ct_precert_scts "ct_precert_scts"
|
||||
#define LN_ct_precert_scts "CT Precertificate SCTs"
|
||||
#define NID_ct_precert_scts 951
|
||||
#define OBJ_ct_precert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L
|
||||
|
||||
#define SN_ct_precert_poison "ct_precert_poison"
|
||||
#define LN_ct_precert_poison "CT Precertificate Poison"
|
||||
#define NID_ct_precert_poison 952
|
||||
#define OBJ_ct_precert_poison 1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L
|
||||
|
||||
#define SN_ct_precert_signer "ct_precert_signer"
|
||||
#define LN_ct_precert_signer "CT Precertificate Signer"
|
||||
#define NID_ct_precert_signer 953
|
||||
#define OBJ_ct_precert_signer 1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L
|
||||
|
||||
#define SN_ct_cert_scts "ct_cert_scts"
|
||||
#define LN_ct_cert_scts "CT Certificate SCTs"
|
||||
#define NID_ct_cert_scts 954
|
||||
#define OBJ_ct_cert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L
|
||||
|
||||
#define SN_jurisdictionLocalityName "jurisdictionL"
|
||||
#define LN_jurisdictionLocalityName "jurisdictionLocalityName"
|
||||
#define NID_jurisdictionLocalityName 955
|
||||
#define OBJ_jurisdictionLocalityName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,1L
|
||||
|
||||
#define SN_jurisdictionStateOrProvinceName "jurisdictionST"
|
||||
#define LN_jurisdictionStateOrProvinceName "jurisdictionStateOrProvinceName"
|
||||
#define NID_jurisdictionStateOrProvinceName 956
|
||||
#define OBJ_jurisdictionStateOrProvinceName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,2L
|
||||
|
||||
#define SN_jurisdictionCountryName "jurisdictionC"
|
||||
#define LN_jurisdictionCountryName "jurisdictionCountryName"
|
||||
#define NID_jurisdictionCountryName 957
|
||||
#define OBJ_jurisdictionCountryName 1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,3L
|
||||
+14
-3
@@ -394,11 +394,22 @@ typedef struct ocsp_service_locator_st {
|
||||
|
||||
OCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);
|
||||
|
||||
OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, char *path, OCSP_REQUEST *req);
|
||||
OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, char *path, OCSP_REQUEST *req,
|
||||
OCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);
|
||||
OCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,
|
||||
int maxline);
|
||||
int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx);
|
||||
int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);
|
||||
OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline);
|
||||
void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);
|
||||
void OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len);
|
||||
int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
|
||||
ASN1_VALUE *val);
|
||||
int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval,
|
||||
const ASN1_ITEM *it);
|
||||
BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx);
|
||||
int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,
|
||||
ASN1_VALUE *val);
|
||||
int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path);
|
||||
int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);
|
||||
int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,
|
||||
const char *name, const char *value);
|
||||
@@ -447,7 +458,7 @@ int OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,
|
||||
int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
|
||||
X509_STORE *store, unsigned long flags);
|
||||
|
||||
int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath,
|
||||
int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,
|
||||
int *pssl);
|
||||
|
||||
int OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);
|
||||
+14
-2
@@ -23,6 +23,9 @@ extern "C" {
|
||||
#ifndef OPENSSL_NO_KRB5
|
||||
# define OPENSSL_NO_KRB5
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_LIBUNBOUND
|
||||
# define OPENSSL_NO_LIBUNBOUND
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_MD2
|
||||
# define OPENSSL_NO_MD2
|
||||
#endif
|
||||
@@ -35,6 +38,9 @@ extern "C" {
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
# define OPENSSL_NO_SCTP
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SSL_TRACE
|
||||
# define OPENSSL_NO_SSL_TRACE
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_SSL2
|
||||
# define OPENSSL_NO_SSL2
|
||||
#endif
|
||||
@@ -77,6 +83,9 @@ extern "C" {
|
||||
# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)
|
||||
# define NO_KRB5
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND)
|
||||
# define NO_LIBUNBOUND
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)
|
||||
# define NO_MD2
|
||||
# endif
|
||||
@@ -89,6 +98,9 @@ extern "C" {
|
||||
# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP)
|
||||
# define NO_SCTP
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE)
|
||||
# define NO_SSL_TRACE
|
||||
# endif
|
||||
# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2)
|
||||
# define NO_SSL2
|
||||
# endif
|
||||
@@ -110,8 +122,8 @@ extern "C" {
|
||||
|
||||
#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */
|
||||
#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)
|
||||
#define ENGINESDIR "/tmp/openssl-1.0.1u-arm64/lib/engines"
|
||||
#define OPENSSLDIR "/tmp/openssl-1.0.1u-arm64"
|
||||
#define ENGINESDIR "/tmp/openssl-1.0.2n-arm64/lib/engines"
|
||||
#define OPENSSLDIR "/tmp/openssl-1.0.2n-arm64"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -30,11 +30,11 @@ extern "C" {
|
||||
* (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
|
||||
* major minor fix final patch/beta)
|
||||
*/
|
||||
# define OPENSSL_VERSION_NUMBER 0x1000115fL
|
||||
# define OPENSSL_VERSION_NUMBER 0x100020efL
|
||||
# ifdef OPENSSL_FIPS
|
||||
# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1u-fips 22 Sep 2016"
|
||||
# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2n-fips 7 Dec 2017"
|
||||
# else
|
||||
# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1u 22 Sep 2016"
|
||||
# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2n 7 Dec 2017"
|
||||
# endif
|
||||
# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
+4
@@ -100,6 +100,8 @@ typedef int ASN1_BOOLEAN;
|
||||
typedef int ASN1_NULL;
|
||||
# endif
|
||||
|
||||
typedef struct asn1_object_st ASN1_OBJECT;
|
||||
|
||||
typedef struct ASN1_ITEM_st ASN1_ITEM;
|
||||
typedef struct asn1_pctx_st ASN1_PCTX;
|
||||
|
||||
@@ -176,6 +178,8 @@ typedef struct engine_st ENGINE;
|
||||
typedef struct ssl_st SSL;
|
||||
typedef struct ssl_ctx_st SSL_CTX;
|
||||
|
||||
typedef struct comp_method_st COMP_METHOD;
|
||||
|
||||
typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
|
||||
typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
|
||||
typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
|
||||
+11
-6
@@ -129,6 +129,7 @@ extern "C" {
|
||||
# define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY"
|
||||
# define PEM_STRING_PKCS8INF "PRIVATE KEY"
|
||||
# define PEM_STRING_DHPARAMS "DH PARAMETERS"
|
||||
# define PEM_STRING_DHXPARAMS "X9.42 DH PARAMETERS"
|
||||
# define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS"
|
||||
# define PEM_STRING_DSAPARAMS "DSA PARAMETERS"
|
||||
# define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY"
|
||||
@@ -181,7 +182,6 @@ typedef struct pem_ctx_st {
|
||||
|
||||
int num_recipient;
|
||||
PEM_USER **recipient;
|
||||
|
||||
/*-
|
||||
XXX(ben): don#t think this is used!
|
||||
STACK *x509_chain; / * certificate chain */
|
||||
@@ -399,8 +399,8 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,
|
||||
# ifndef OPENSSL_NO_BIO
|
||||
int PEM_read_bio(BIO *bp, char **name, char **header,
|
||||
unsigned char **data, long *len);
|
||||
int PEM_write_bio(BIO *bp, const char *name, char *hdr, unsigned char *data,
|
||||
long len);
|
||||
int PEM_write_bio(BIO *bp, const char *name, const char *hdr,
|
||||
const unsigned char *data, long len);
|
||||
int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,
|
||||
const char *name, BIO *bp, pem_password_cb *cb,
|
||||
void *u);
|
||||
@@ -419,7 +419,8 @@ int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,
|
||||
|
||||
int PEM_read(FILE *fp, char **name, char **header,
|
||||
unsigned char **data, long *len);
|
||||
int PEM_write(FILE *fp, char *name, char *hdr, unsigned char *data, long len);
|
||||
int PEM_write(FILE *fp, const char *name, const char *hdr,
|
||||
const unsigned char *data, long len);
|
||||
void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,
|
||||
pem_password_cb *cb, void *u);
|
||||
int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,
|
||||
@@ -474,6 +475,7 @@ DECLARE_PEM_rw(EC_PUBKEY, EC_KEY)
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DH
|
||||
DECLARE_PEM_rw_const(DHparams, DH)
|
||||
DECLARE_PEM_write_const(DHxparams, DH)
|
||||
# endif
|
||||
DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
|
||||
DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
|
||||
@@ -529,6 +531,7 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
|
||||
void ERR_load_PEM_strings(void);
|
||||
|
||||
/* Error codes for the PEM functions. */
|
||||
@@ -562,8 +565,10 @@ void ERR_load_PEM_strings(void);
|
||||
# define PEM_F_PEM_PK8PKEY 119
|
||||
# define PEM_F_PEM_READ 108
|
||||
# define PEM_F_PEM_READ_BIO 109
|
||||
# define PEM_F_PEM_READ_BIO_DHPARAMS 141
|
||||
# define PEM_F_PEM_READ_BIO_PARAMETERS 140
|
||||
# define PEM_F_PEM_READ_BIO_PRIVATEKEY 123
|
||||
# define PEM_F_PEM_READ_DHPARAMS 142
|
||||
# define PEM_F_PEM_READ_PRIVATEKEY 124
|
||||
# define PEM_F_PEM_SEALFINAL 110
|
||||
# define PEM_F_PEM_SEALINIT 111
|
||||
@@ -606,7 +611,7 @@ void ERR_load_PEM_strings(void);
|
||||
# define PEM_R_UNSUPPORTED_ENCRYPTION 114
|
||||
# define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user