Import OpenSSL 1.1.0f
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
|
||||
# Written by Dr Stephen N Henson (steve@openssl.org).
|
||||
# Licensed under the terms of the OpenSSL license.
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
# in the file LICENSE in the source distribution or at
|
||||
# https://www.openssl.org/source/license.html
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -18,6 +21,11 @@ my $NOESC_QUOTE = 8; # Not escaped if quoted
|
||||
my $PSTRING_CHAR = 0x10; # Valid PrintableString character
|
||||
my $RFC2253_FIRST_ESC = 0x20; # Escaped with \ if first character
|
||||
my $RFC2253_LAST_ESC = 0x40; # Escaped with \ if last character
|
||||
my $RFC2254_ESC = 0x400; # Character escaped \XX
|
||||
my $HOST_ANY = 0x1000; # Valid hostname character anywhere in label
|
||||
my $HOST_DOT = 0x2000; # Dot: hostname label separator
|
||||
my $HOST_HYPHEN = 0x4000; # Hyphen: not valid at start or end.
|
||||
my $HOST_WILD = 0x8000; # Wildcard character
|
||||
|
||||
for($i = 0; $i < 128; $i++) {
|
||||
# Set the RFC2253 escape characters (control)
|
||||
@@ -30,7 +38,7 @@ for($i = 0; $i < 128; $i++) {
|
||||
if( ( ( $i >= ord("a")) && ( $i <= ord("z")) )
|
||||
|| ( ( $i >= ord("A")) && ( $i <= ord("Z")) )
|
||||
|| ( ( $i >= ord("0")) && ( $i <= ord("9")) ) ) {
|
||||
$arr[$i] |= $PSTRING_CHAR;
|
||||
$arr[$i] |= $PSTRING_CHAR | $HOST_ANY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +57,14 @@ $arr[ord("<")] |= $NOESC_QUOTE | $RFC2253_ESC;
|
||||
$arr[ord(">")] |= $NOESC_QUOTE | $RFC2253_ESC;
|
||||
$arr[ord(";")] |= $NOESC_QUOTE | $RFC2253_ESC;
|
||||
|
||||
# Remaining RFC2254 characters
|
||||
|
||||
$arr[0] |= $RFC2254_ESC;
|
||||
$arr[ord("(")] |= $RFC2254_ESC;
|
||||
$arr[ord(")")] |= $RFC2254_ESC;
|
||||
$arr[ord("*")] |= $RFC2254_ESC | $HOST_WILD;
|
||||
$arr[ord("\\")] |= $RFC2254_ESC;
|
||||
|
||||
# Remaining PrintableString characters
|
||||
|
||||
$arr[ord(" ")] |= $PSTRING_CHAR;
|
||||
@@ -57,8 +73,8 @@ $arr[ord("(")] |= $PSTRING_CHAR;
|
||||
$arr[ord(")")] |= $PSTRING_CHAR;
|
||||
$arr[ord("+")] |= $PSTRING_CHAR;
|
||||
$arr[ord(",")] |= $PSTRING_CHAR;
|
||||
$arr[ord("-")] |= $PSTRING_CHAR;
|
||||
$arr[ord(".")] |= $PSTRING_CHAR;
|
||||
$arr[ord("-")] |= $PSTRING_CHAR | $HOST_HYPHEN;
|
||||
$arr[ord(".")] |= $PSTRING_CHAR | $HOST_DOT;
|
||||
$arr[ord("/")] |= $PSTRING_CHAR;
|
||||
$arr[ord(":")] |= $PSTRING_CHAR;
|
||||
$arr[ord("=")] |= $PSTRING_CHAR;
|
||||
@@ -68,17 +84,33 @@ $arr[ord("?")] |= $PSTRING_CHAR;
|
||||
|
||||
print <<EOF;
|
||||
/*
|
||||
* Auto generated with chartype.pl script. Mask of various character
|
||||
* properties
|
||||
* WARNING: do not edit!
|
||||
* Generated by crypto/asn1/charmap.pl
|
||||
*
|
||||
* Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
static const unsigned char char_type[] = {
|
||||
#define CHARTYPE_HOST_ANY $HOST_ANY
|
||||
#define CHARTYPE_HOST_DOT $HOST_DOT
|
||||
#define CHARTYPE_HOST_HYPHEN $HOST_HYPHEN
|
||||
#define CHARTYPE_HOST_WILD $HOST_WILD
|
||||
|
||||
/*
|
||||
* Mask of various character properties
|
||||
*/
|
||||
|
||||
static const unsigned short char_type[] = {
|
||||
EOF
|
||||
|
||||
print " ";
|
||||
for($i = 0; $i < 128; $i++) {
|
||||
print("\n ") if($i && (($i % 16) == 0));
|
||||
printf(" %d", $arr[$i]);
|
||||
print("\n ") if($i && (($i % 12) == 0));
|
||||
printf(" %4d", $arr[$i]);
|
||||
print(",") if ($i != 127);
|
||||
}
|
||||
print("\n};\n");
|
||||
|
||||
Reference in New Issue
Block a user