2 # Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
12 use lib "$FindBin::Bin/../../util/perl";
13 use OpenSSL::copyright;
19 my $PUNCTUATION = 0x0200;
25 my $FCOMMENT = 0x0800;
34 $c = sprintf("%c", $_);
36 $v |= $NUMBER if $c =~ /[0-9]/;
37 $v |= $UPPER if $c =~ /[A-Z]/;
38 $v |= $LOWER if $c =~ /[a-z]/;
39 $v |= $UNDER if $c =~ /_/;
40 $v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
41 $v |= $WS if $c =~ /[ \t\r\n]/;
42 $v |= $ESC if $c =~ /\\/;
43 $v |= $QUOTE if $c =~ /['`"]/; # for emacs: "`'
44 $v |= $COMMENT if $c =~ /\#/;
45 $v |= $DOLLAR if $c eq '$';
46 $v |= $EOF if $c =~ /\0/;
50 $v |= $NUMBER if $c =~ /[0-9]/;
51 $v |= $UPPER if $c =~ /[A-Z]/;
52 $v |= $LOWER if $c =~ /[a-z]/;
53 $v |= $UNDER if $c =~ /_/;
54 $v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
55 $v |= $WS if $c =~ /[ \t\r\n]/;
56 $v |= $DQUOTE if $c =~ /["]/; # for emacs: "
57 $v |= $FCOMMENT if $c =~ /;/;
58 $v |= $DOLLAR if $c eq '$';
59 $v |= $EOF if $c =~ /\0/;
63 # The year the output file is generated.
64 my $YEAR = OpenSSL::copyright::year_of($0);
67 * WARNING: do not edit!
68 * Generated by crypto/conf/keysets.pl
70 * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.
71 * Licensed under the Apache License 2.0 (the "License"). You may not use
72 * this file except in compliance with the License. You can obtain a copy
73 * in the file LICENSE in the source distribution or at
74 * https://www.openssl.org/source/license.html
77 #define CONF_NUMBER $NUMBER
78 #define CONF_UPPER $UPPER
79 #define CONF_LOWER $LOWER
80 #define CONF_UNDER $UNDER
81 #define CONF_PUNCT $PUNCTUATION
84 #define CONF_QUOTE $QUOTE
85 #define CONF_DQUOTE $DQUOTE
86 #define CONF_COMMENT $COMMENT
87 #define CONF_FCOMMENT $FCOMMENT
88 #define CONF_DOLLAR $DOLLAR
90 #define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
91 #define CONF_ALNUM (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
92 #define CONF_ALNUM_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
95 #define IS_COMMENT(conf,c) is_keytype(conf, c, CONF_COMMENT)
96 #define IS_FCOMMENT(conf,c) is_keytype(conf, c, CONF_FCOMMENT)
97 #define IS_EOF(conf,c) is_keytype(conf, c, CONF_EOF)
98 #define IS_ESC(conf,c) is_keytype(conf, c, CONF_ESC)
99 #define IS_NUMBER(conf,c) is_keytype(conf, c, CONF_NUMBER)
100 #define IS_WS(conf,c) is_keytype(conf, c, CONF_WS)
101 #define IS_ALNUM(conf,c) is_keytype(conf, c, CONF_ALNUM)
102 #define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT)
103 #define IS_QUOTE(conf,c) is_keytype(conf, c, CONF_QUOTE)
104 #define IS_DQUOTE(conf,c) is_keytype(conf, c, CONF_DQUOTE)
105 #define IS_DOLLAR(conf,c) is_keytype(conf, c, CONF_DOLLAR)
111 print "static const unsigned short CONF_type_default[128] = {";
112 for ($i = 0; $i < 128; $i++) {
113 print "\n " if ($i % 8) == 0;
114 printf " 0x%04X,", $V_def[$i];
118 print "#ifndef OPENSSL_NO_DEPRECATED_3_0\n";
119 print "static const unsigned short CONF_type_win32[128] = {";
120 for ($i = 0; $i < 128; $i++) {
121 print "\n " if ($i % 8) == 0;
122 printf " 0x%04X,", $V_w32[$i];