2 # Copyright 1995-2020 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
16 my $PUNCTUATION = 0x0200;
22 my $FCOMMENT = 0x0800;
31 $c = sprintf("%c", $_);
33 $v |= $NUMBER if $c =~ /[0-9]/;
34 $v |= $UPPER if $c =~ /[A-Z]/;
35 $v |= $LOWER if $c =~ /[a-z]/;
36 $v |= $UNDER if $c =~ /_/;
37 $v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
38 $v |= $WS if $c =~ /[ \t\r\n]/;
39 $v |= $ESC if $c =~ /\\/;
40 $v |= $QUOTE if $c =~ /['`"]/; # for emacs: "`'
41 $v |= $COMMENT if $c =~ /\#/;
42 $v |= $DOLLAR if $c eq '$';
43 $v |= $EOF if $c =~ /\0/;
47 $v |= $NUMBER if $c =~ /[0-9]/;
48 $v |= $UPPER if $c =~ /[A-Z]/;
49 $v |= $LOWER if $c =~ /[a-z]/;
50 $v |= $UNDER if $c =~ /_/;
51 $v |= $PUNCTUATION if $c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/;
52 $v |= $WS if $c =~ /[ \t\r\n]/;
53 $v |= $DQUOTE if $c =~ /["]/; # for emacs: "
54 $v |= $FCOMMENT if $c =~ /;/;
55 $v |= $DOLLAR if $c eq '$';
56 $v |= $EOF if $c =~ /\0/;
60 # The year the output file is generated.
61 my $YEAR = [localtime()]->[5] + 1900;
64 * WARNING: do not edit!
65 * Generated by crypto/conf/keysets.pl
67 * Copyright 1995-$YEAR The OpenSSL Project Authors. All Rights Reserved.
68 * Licensed under the Apache License 2.0 (the "License"). You may not use
69 * this file except in compliance with the License. You can obtain a copy
70 * in the file LICENSE in the source distribution or at
71 * https://www.openssl.org/source/license.html
74 #define CONF_NUMBER $NUMBER
75 #define CONF_UPPER $UPPER
76 #define CONF_LOWER $LOWER
77 #define CONF_UNDER $UNDER
78 #define CONF_PUNCT $PUNCTUATION
81 #define CONF_QUOTE $QUOTE
82 #define CONF_DQUOTE $DQUOTE
83 #define CONF_COMMENT $COMMENT
84 #define CONF_FCOMMENT $FCOMMENT
85 #define CONF_DOLLAR $DOLLAR
87 #define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
88 #define CONF_ALNUM (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
89 #define CONF_ALNUM_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER|CONF_PUNCT)
92 #define IS_COMMENT(conf,c) is_keytype(conf, c, CONF_COMMENT)
93 #define IS_FCOMMENT(conf,c) is_keytype(conf, c, CONF_FCOMMENT)
94 #define IS_EOF(conf,c) is_keytype(conf, c, CONF_EOF)
95 #define IS_ESC(conf,c) is_keytype(conf, c, CONF_ESC)
96 #define IS_NUMBER(conf,c) is_keytype(conf, c, CONF_NUMBER)
97 #define IS_WS(conf,c) is_keytype(conf, c, CONF_WS)
98 #define IS_ALNUM(conf,c) is_keytype(conf, c, CONF_ALNUM)
99 #define IS_ALNUM_PUNCT(conf,c) is_keytype(conf, c, CONF_ALNUM_PUNCT)
100 #define IS_QUOTE(conf,c) is_keytype(conf, c, CONF_QUOTE)
101 #define IS_DQUOTE(conf,c) is_keytype(conf, c, CONF_DQUOTE)
102 #define IS_DOLLAR(conf,c) is_keytype(conf, c, CONF_DOLLAR)
108 print "static const unsigned short CONF_type_default[128] = {";
109 for ($i = 0; $i < 128; $i++) {
110 print "\n " if ($i % 8) == 0;
111 printf " 0x%04X,", $V_def[$i];
115 print "#ifndef OPENSSL_NO_DEPRECATED_3_0\n";
116 print "static const unsigned short CONF_type_win32[128] = {";
117 for ($i = 0; $i < 128; $i++) {
118 print "\n " if ($i % 8) == 0;
119 printf " 0x%04X,", $V_w32[$i];