diff options
author | Norbert Preining <norbert@preining.info> | 2022-12-03 03:02:05 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-12-03 03:02:05 +0000 |
commit | 34896a353fe22e8ac88ef0b4e39f4fa878e2b0b6 (patch) | |
tree | 9b956161389da3b7c067aaa01731f1d11649e57e /macros/latex/contrib | |
parent | 42cda2ed3fa7472e6c064fdbf998d636556343db (diff) |
CTAN sync 202212030302
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r-- | macros/latex/contrib/csbulletin/README | 3 | ||||
-rw-r--r-- | macros/latex/contrib/csbulletin/doc/csbulletin.pdf | bin | 276573 -> 276383 bytes | |||
-rw-r--r-- | macros/latex/contrib/csbulletin/doc/csbulletin.tex | 4 | ||||
-rw-r--r-- | macros/latex/contrib/csbulletin/tex/csbulacronym.sty | 76 | ||||
-rw-r--r-- | macros/latex/contrib/cvss/README.md | 43 | ||||
-rw-r--r-- | macros/latex/contrib/cvss/cvss.dtx | 385 | ||||
-rw-r--r-- | macros/latex/contrib/cvss/cvss.ins | 196 | ||||
-rw-r--r-- | macros/latex/contrib/cvss/cvss.pdf | bin | 484458 -> 569546 bytes | |||
-rw-r--r-- | macros/latex/contrib/ffcode/ffcode.dtx | 30 | ||||
-rw-r--r-- | macros/latex/contrib/ffcode/ffcode.pdf | bin | 574021 -> 574072 bytes |
10 files changed, 421 insertions, 316 deletions
diff --git a/macros/latex/contrib/csbulletin/README b/macros/latex/contrib/csbulletin/README index cc91b62aee..2dbbecfc7a 100644 --- a/macros/latex/contrib/csbulletin/README +++ b/macros/latex/contrib/csbulletin/README @@ -1,5 +1,6 @@ ============================================================================= -Package: csbulletin 29 November 2022 +Package: csbulletin 2 December 2022 +Maintainer: Vít Novotný <witiko@mail.muni.cz> License: LPPL 1.3c ============================================================================= The package provides the class for articles for the CSTUG Bulletin diff --git a/macros/latex/contrib/csbulletin/doc/csbulletin.pdf b/macros/latex/contrib/csbulletin/doc/csbulletin.pdf Binary files differindex 25b26cf7df..5f6da725a6 100644 --- a/macros/latex/contrib/csbulletin/doc/csbulletin.pdf +++ b/macros/latex/contrib/csbulletin/doc/csbulletin.pdf diff --git a/macros/latex/contrib/csbulletin/doc/csbulletin.tex b/macros/latex/contrib/csbulletin/doc/csbulletin.tex index a9d644de60..c4c30b0954 100644 --- a/macros/latex/contrib/csbulletin/doc/csbulletin.tex +++ b/macros/latex/contrib/csbulletin/doc/csbulletin.tex @@ -1,6 +1,6 @@ %% $Id$ \documentclass{csbulletin} -\DeclareRobustCommand\version{\unskip~2022/11/29} +\DeclareRobustCommand\version{\unskip~2022/12/02} \let\pkg\textsc \usepackage[pdftitle=LaTeX\ Class\ for\ CSTUG\ Bulletin, pdfauthor={Zdenek\ Wagner, Vit\ Novotny}, @@ -134,7 +134,7 @@ Použití různých balíčků může vést k~dalším problémům. Redakce se b nahlášených potíží. \section{Licence} -Balíček může být používán a šířen podle \LaTeX\ Project Public License verze~1.3 nebo novější, jejíž +Balíček může být používán a šířen podle \LaTeX\ Project Public License verze~1.3c nebo novější, jejíž text najdete v~souboru \texttt{LICENSE.txt} v~adresáři \texttt{doc}, nebo na \url{http://www.latex-project.org/lppl.txt} diff --git a/macros/latex/contrib/csbulletin/tex/csbulacronym.sty b/macros/latex/contrib/csbulletin/tex/csbulacronym.sty new file mode 100644 index 0000000000..374627b45b --- /dev/null +++ b/macros/latex/contrib/csbulletin/tex/csbulacronym.sty @@ -0,0 +1,76 @@ +\ProvidesPackage{csbulacronym}[2020/01/10 Acronyms for CSTUG bulletin] +\PackageInfo{csbulacronym}{$Id$} + +%==================================================== TeX logos +\DeclareRobustCommand\CS[1]{\def\next{#1}\leavevmode{$\cal C$}\kern-.3em + \lower .67ex\hbox{$\cal S$}\if E\next\kern-.045em\else + \kern-.145em\fi#1} +\DeclareRobustCommand\CSTeX{\leavevmode{$\cal C$}\kern-.3em + \lower .67ex\hbox{$\cal S$}\kern-.145em\TeX} +\let\cstex\CSTeX +\DeclareRobustCommand\csplain{\leavevmode{$\cal C$}\kern-.3em + \lower .67ex\hbox{$\cal S$}\kern-.145emplain} +\DeclareRobustCommand\CSLaTeX{\leavevmode{$\cal C$}\kern-.3em + \lower .67ex\hbox{$\cal S$}\LaTeX} +\let\cslatex\CSLaTeX +\DeclareRobustCommand\CSTUG{\leavevmode{$\cal C$}\kern-.3em + \lower .67ex\hbox{$\cal S$}\kern-.145em TUG} +\let\cstug\CSTUG +\DeclareRobustCommand\CSED{{$\cal C$}\kern-.3em + \lower .67ex\hbox{$\cal S$}\kern-.045emED} +\let\csed\CSED +\DeclareRobustCommand\lm{L\kern-.4em\raise.4ex\hbox{$\scriptstyle\cal A$}\kern-.2em + \lower.4ex\hbox{$\scriptstyle{\cal M}$}\kern-.1em{$\cal S$}-\TeX} +\DeclareRobustCommand\lmb{L\kern-.35em\raise.35ex\hbox{$\scriptstyle\cal A$}\kern-.15em + \lower.4ex\hbox{$\cal M$}\kern-.05em{$\cal S$}-\TeX} +\let\LAmSTeX\lm +\DeclareRobustCommand\AmSTeX{\protect\AmS-\protect\TeX} +\let\AMSTeX\AmSTeX +\let\amstex\AmSTeX +\DeclareRobustCommand\AmS{{$\cal\protect A\kern-.1667em\lower.5ex + \hbox{$\cal M$}\kern-.125emS$}} +\let\AMS\AmS +\def\manual{\fontencoding{U}\fontfamily{logo}\selectfont} +\DeclareRobustCommand\font@mp{\fontencoding{U}\fontfamily{mplogo}\selectfont} +\DeclareRobustCommand\MF{{\manual META}\-{\manual FONT}} \let\mf\MF +\DeclareRobustCommand\MP{{\manual META}\-{\manual POST}} \let\mp\MP +\DeclareRobustCommand\BibTeX{{\sc Bib}\TeX} \let\BIBTeX\BibTeX +\DeclareRobustCommand\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC} +\DeclareRobustCommand\PiCTeX{\PiC\kern-.11em\TeX} +\DeclareRobustCommand\SliTeX{{\rm S\kern-.06em{\sc l\kern-.035emi}\kern-.06em\TeX}} +\let\SLiTeX\SliTeX +\DeclareRobustCommand\WPtoLaTeX{% +W\kern-.06em\hbox{P}\kern-.2em\lower.7ex\hbox{2}\kern-.07em\LaTeX} +\let\Protected@LaTeX\LaTeX +\let\Protected@LaTeXe\LaTeXe +%\DeclareRobustCommand\LaTeX{\Protected@LaTeX} +%\DeclareRobustCommand\LaTeXe{\Protected@LaTeXe} +\DeclareRobustCommand\miktex{MiK\TeX}\let\MikTeX\miktex \let\MiKTeX\miktex \let\Miktex\miktex + +\DeclareRobustCommand\ForTeX{\leavevmode\lower.5ex\hbox{4}\kern-.1667em\TeX} +\DeclareRobustCommand\ForAllTeX{\leavevmode\lower.3ex\hbox{4}all\TeX} +\DeclareRobustCommand\LyX{L\kern\minus.1667em\lower.25em\hbox{Y}\kern\minus.125emX\spacefactor1000} +\DeclareRobustCommand\OzTeX{Oz\kern\minus.1em\TeX} +\DeclareRobustCommand\eTeX{$\varepsilon$\minus\TeX} +\DeclareRobustCommand\NTS{$\cal N$\kern\minus.1667em\lower.5ex\hbox{$\cal T$}% + \kern\minus.125em$\cal S$} + +\DeclareRobustCommand\XeTeX{X\kern-.125em\lower.5ex\hbox{\csname + reflectbox\endcsname{E}}\kern-.1667em\TeX} +\DeclareRobustCommand\XeLaTeX{X\kern-.125em\lower.5ex\hbox{\csname + reflectbox\endcsname{E}}\LaTeX} + +\DeclareRobustCommand\THANH{H\`an Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh} +\DeclareRobustCommand\Thanh{Th\`anh} +\DeclareRobustCommand\ConTeXt{\textsc{Con\kern-.15em\TeX t}} + +\DeclareRobustCommand\ps{PostScript}\let\PS\ps + +\chardef\bs`\\ +\let\bslash\bs +\DeclareRobustCommand\cmd[1]{\texttt{\bs#1}} +{\catcode`\#=12 +\gdef\hash{#}} + +\def\bul#1(#2)#3(#4){Zpravodaj \v Ceskoslovensk\'eho sdru\v zen\'i u\v zivatel\r{u} \TeX u, +\textbf{#1}\,(#2), \hbox{#3}~(#4)} diff --git a/macros/latex/contrib/cvss/README.md b/macros/latex/contrib/cvss/README.md index acdeccf477..61b3457272 100644 --- a/macros/latex/contrib/cvss/README.md +++ b/macros/latex/contrib/cvss/README.md @@ -1,16 +1,47 @@ # CVSS-latex -This LaTeX package allows anyone to use and nicely print the CVSS base score for a given CVSS string. +This aims to become a LaTeX package allowing anyone to use and nicely print the CVSS ratings for a given CVSS string. +## Usage -## To-do -- Fix the expansion error preventing nested commands like `\category{\computeCVSS{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}` -- Add support for CVSS complete string -- Add CVSS values as variables (future CVSS version) -- Add support for full CVSS vector (temporal and environmental score) +### Direct forms + +```latex +\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} +\cvssLevel{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} +\cvssLevelpretty{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H} +\cvssTag{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} + +The vuln has a \textbf{\cvssLevel{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}-level and we can output it inline. +``` + + +![Direct forms](https://github.com/3isenHeiM/CVSS-latex/raw/main/img/direct-form.png) + +### Imbricated Form + +```latex +\cvssFrame{Low} +\category{9.9} + +We can even combine them: +\category{\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}} +\cvssFrame{\category{\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}} +``` + +![Imbricated forms](https://github.com/3isenHeiM/CVSS-latex/raw/main/img/imbricated-form.png) + + +## To-do +- [x] Fix the expansion error preventing nested commands like `\category{\computeCVSS{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}` +- [x] Add support for CVSS complete string (starting wiht `CVSS:3.1`) +- [ ] Add CVSS values as variables (future CVSS version) +- [ ] Add support for full CVSS vector (temporal and environmental score) +- [x] Turn this into a latex package ## Licence This package is licensed under the [LPPL-1.3c](https://www.latex-project.org/lppl/lppl-1-3c/). +The author of this package is [Pierre VIVEGNIS](https://ctan.org/author/vivegnis). diff --git a/macros/latex/contrib/cvss/cvss.dtx b/macros/latex/contrib/cvss/cvss.dtx index 522be904cb..dee4061ab7 100644 --- a/macros/latex/contrib/cvss/cvss.dtx +++ b/macros/latex/contrib/cvss/cvss.dtx @@ -77,7 +77,7 @@ and the derived files cvss.ins, %</internal> %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{cvss}[2022/11/03 First Release] +\ProvidesPackage{cvss}[2022/12/02 v1.1.0 ] %</package> %<*driver> \documentclass{l3doc} @@ -88,6 +88,7 @@ and the derived files cvss.ins, \setlength{\parindent}{0pt} \begin{document} \DocInput{\jobname.dtx} + \newpage \PrintChanges \PrintIndex \end{document} @@ -111,9 +112,10 @@ and the derived files cvss.ins, %\maketitle % \tableofcontents % +% \newpage % \section{Introduction} % -% The \textsf{cvss} package allows the user to compute CVSS3.1 base scores and use them in documents. The Common Vulnerability Scoring System (CVSS) is an open framework for communicating the characteristics and severity of software vulnerabilities. CVSS consists of three metric groups: Base, Temporal, and Environmental. +% The \textsf{cvss} package allows the user to compute CVSS 3.1 base scores and use them in documents. The Common Vulnerability Scoring System (CVSS) is an open framework for communicating the characteristics and severity of software vulnerabilities. CVSS consists of three metric groups: Base, Temporal, and Environmental. % % This packages only deal with Base score. Temporal and Environental scores will be part of a future release. % @@ -143,104 +145,104 @@ and the derived files cvss.ins, % % \subsection{Direct Macros} % \begin{function}{\cvssScore} - % \begin{syntax} - % \cs{cvssScore} \Arg{CVSS string} - % \end{syntax} +% \changes{v1.0.0}{2022/10/22}{Full CVSS vector as input is now supported} +% \changes{v1.1.0}{2022/12/02}{Full CVSS vector as input is now supported} +% \begin{syntax} +% \cs{cvssScore} \Arg{CVSS string} +% \end{syntax} % This is the main macro of this package, responsible for computing the base CVSS 3.1 score of an \marg{input vector} (without \texttt{CVSS3.1/}). The output of this macro is a floating point CVSS score, for example \texttt{5.4}. % \end{function} % -% \noindent\llap{\bfseries \textcolor{red}{Important!}\qquad}\indent -% \textbf{The CVSS vector string must be stripped from the \texttt{CVSS3.1/}!} % % % \begin{verbatim} -% \cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} +% \cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} % \end{verbatim} % -% This will output the following CVSS base score: \texttt{\cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}} +% This will output the following CVSS base score: \texttt{\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}} % % % \begin{function}{\cvssScorepretty} - % \begin{syntax} - % \cs{cvssScorepretty} \Arg{CVSS string} - % \end{syntax} - % This macro will print a \textbf{colored} base CVSS 3.1 score of an \marg{input vector} (without \texttt{CVSS3.1/}). The output of this macro is a floating point CVSS score. - % \end{function} + % \begin{syntax} +% \cs{cvssScorepretty} \Arg{CVSS string} +% \end{syntax} +% This macro will print a \textbf{colored} base CVSS 3.1 score of an \marg{input vector} (without \texttt{CVSS3.1/}). The output of this macro is a floating point CVSS score. + % \end{function} % % \begin{verbatim} -% \cvssScorepretty{AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} +% \cvssScorepretty{CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} % \end{verbatim} % -% This will output the following CVSS score: \cvssScorepretty{AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} +% This will output the following CVSS score: \cvssScorepretty{CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} % % % \begin{function}{\cvssLevel} - % \begin{syntax} - % \cs{cvssLevel} \Arg{CVSS string} - % \end{syntax} + % \begin{syntax} + % \cs{cvssLevel} \Arg{CVSS string} + % \end{syntax} % This macro will output the CVSS level from an \marg{input vector} (without \texttt{CVSS3.1/}), for example \texttt{Info}. % \end{function} % % \begin{verbatim} -% \cvssLevel{AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} +% \cvssLevel{CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} % \end{verbatim} % -% This will output the following CVSS level: \cvssLevel{AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} +% This will output the following CVSS level: \cvssLevel{CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:H/I:L/A:N} % % % \begin{function}{\cvssLevelpretty} - % \begin{syntax} - % \cs{cvssLevelpretty} \Arg{CVSS string} - % \end{syntax} + % \begin{syntax} + % \cs{cvssLevelpretty} \Arg{CVSS string} + % \end{syntax} % This macro will output the \textbf{colored} CVSS level from an \marg{input vector} (without \texttt{CVSS3.1/}). % \end{function} % % \begin{verbatim} -% \cvssLevelpretty{AV:A/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:N} +% \cvssLevelpretty{CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:N} % \end{verbatim} % -% This will output the following CVSS level: \cvssLevelpretty{AV:A/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:N} +% This will output the following CVSS level: \cvssLevelpretty{CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:L/I:L/A:N} % % % \begin{function}{\cvssTag} - % \begin{syntax} - % \cs{cvssTag} \Arg{CVSS string} - % \end{syntax} + % \begin{syntax} + % \cs{cvssTag} \Arg{CVSS string} + % \end{syntax} % This macro will output a colored tag with the CVSS level inside, from an \marg{input vector} (without \texttt{CVSS3.1/}). % \end{function} % % \begin{verbatim} -% \cvssTag{AV:A/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:N} +% \cvssTag{CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:N} % \end{verbatim} % -% This will output the following CVSS level: \cvssTag{AV:A/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:N}. +% This will output the following CVSS level: \cvssTag{CVSS:3.1/AV:A/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:N}. % % % \begin{function}{\cvssPrint} - % \begin{syntax} - % \cs{cvssPrint} \Arg{CVSS string} - % \end{syntax} - % This macro will print all details of a CVSS string: colored level, score, and hyperlink to FIRST calculator, from an \marg{input vector} (without \texttt{CVSS3.1/}). - % \end{function} +% \begin{syntax} +% \cs{cvssPrint} \Arg{CVSS string} +% \end{syntax} +% This macro will print all details of a CVSS string: colored level, score, and hyperlink to FIRST calculator, from an \marg{input vector} (without \texttt{CVSS3.1/}). +% \end{function} % % \begin{verbatim} -% \cvssPrint{AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} +% \cvssPrint{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} % \end{verbatim} % % This will output the following CVSS level: % -% \cvssPrint{AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} +% \cvssPrint{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} % % % % \subsection{Indirect Macros} % -% \changes{v1.0}{2022/11/03}{First public release} +% \changes{v1.0.0}{2022/11/03}{First public release} % % \begin{function}{\category} - % \begin{syntax} - % \cs{category} \Arg{CVSS score} - % \end{syntax} + % \begin{syntax} + % \cs{category} \Arg{CVSS score} + % \end{syntax} % This macro will output the CVSS category (None, Info, Low, Medium, High or Critical) based on the input CVSS vector passed as argument \marg{numerical score}. The mandatory argument is a floating point CVSS score, for example \texttt{5.4}. % \end{function} % @@ -252,11 +254,11 @@ and the derived files cvss.ins, % % % \begin{function}{\cvssFrame} - % \begin{syntax} - % \cs{cvssFrame} \Arg{CVSS score} - % \end{syntax} - % This macro will output a CVSS tag based on a CVSS \textbf{level} passed as argument. The mandatory argument must be one of the defined CVSS levels (None, Info, Low, Medium, High or Critical), for example \texttt{Info}. - % \end{function} +% \begin{syntax} +% \cs{cvssFrame} \Arg{CVSS score} +% \end{syntax} +% This macro will output a CVSS tag based on a CVSS \textbf{level} passed as argument. The mandatory argument must be one of the defined CVSS levels (None, Info, Low, Medium, High or Critical), for example \texttt{Info}. +% \end{function} % % \begin{verbatim} % \cvssFrame{High} @@ -270,133 +272,138 @@ and the derived files cvss.ins, % % \subsection{Direct Form} -%\begin{minipage}{.75\textwidth} - % \begin{verbatim} -%\\cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} - % \end{verbatim} - %\end{minipage}% -%\begin{minipage}{0.25\textwidth} -%\cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} - %\end{minipage} - -%\begin{minipage}{.75\textwidth} - % \begin{verbatim} -%\\cvssLevel{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} - % \end{verbatim} - %\end{minipage}% -%\begin{minipage}{0.25\textwidth} -%\cvssLevel{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} - %\end{minipage} +%\begin{minipage}{.85\textwidth} +% \begin{verbatim} +%\\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} +% \end{verbatim} +%\end{minipage}% +%\begin{minipage}{0.15\textwidth} +%\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} +%\end{minipage} +%\begin{minipage}{.85\textwidth} +% \begin{verbatim} +%\\cvssLevel{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} +% \end{verbatim} +%\end{minipage}% +%\begin{minipage}{0.15\textwidth} +%\cvssLevel{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N} +%\end{minipage} -%\begin{minipage}{.75\textwidth} - % \begin{verbatim} -%\\cvssLevelpretty{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H} - % \end{verbatim} - %\end{minipage}% -%\begin{minipage}{0.25\textwidth} -%\cvssLevelpretty{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H} - %\end{minipage} -%\begin{minipage}{.75\textwidth} - % \begin{verbatim} -%\\cvssTag{AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} - % \end{verbatim} - %\end{minipage}% -%\begin{minipage}{0.25\textwidth} -%\cvssTag{AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} - %\end{minipage} +%\begin{minipage}{.85\textwidth} +% \begin{verbatim} +%\\cvssLevelpretty{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H} +% \end{verbatim} +%\end{minipage}% +%\begin{minipage}{0.15\textwidth} +%\cvssLevelpretty{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H} +%\end{minipage} +%\begin{minipage}{.85\textwidth} +% \begin{verbatim} +%\\cvssTag{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} +% \end{verbatim} +%\end{minipage}% +%\begin{minipage}{0.15\textwidth} +%\cvssTag{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H} +%\end{minipage}% +%\newline % -% The vuln has a \textbf{\cvssLevel{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}-level and we can output it inline. +% We can thus embed this in text lines like this: +% \begin{verbatim} +%\\textbf{\cvssLevel{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}-level +% \end{verbatim} +% +% Which will be rendered like this : \textit{the vuln has a \textbf{\cvssLevel{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}-level and we can output it inline.} %\subsection{Imbricated Form} %\begin{minipage}{.5\textwidth} - % \begin{verbatim} - %\cvssFrame{Low} - % \end{verbatim} - %\end{minipage}% +% \begin{verbatim} +%\\cvssFrame{Low} +% \end{verbatim} +%\end{minipage}% %\begin{minipage}{0.5\textwidth} - %\cvssFrame{Low} +%\cvssFrame{Low} %\end{minipage} %\begin{minipage}{.5\textwidth} % \begin{verbatim} - %\category{9.9} +%%\category{9.9} % \end{verbatim} %\end{minipage}% %\begin{minipage}{0.5\textwidth} - %\category{9.9} +%\category{9.9} %\end{minipage} +%\newline % % We can even combine them: % \begin{verbatim} -%\\category{\cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}} +%\\category{\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}} % \end{verbatim} % -%And this outputs: \category{\cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}} +%And this outputs: \category{\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}} % % \begin{verbatim} -%\\cvssFrame{\category{\cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}} +%\\cvssFrame{\category{\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}} % \end{verbatim} -% And the result is: %\cvssFrame{\category{\cvssScore{AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}} +% And the result is: %\cvssFrame{\category{\cvssScore{CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N}}} % %\subsection{Test Computations} % \begin{verbatim} -% Should be 7.3: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L} +% Should be 7.3: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L} % -% Should be 8.3: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L} +% Should be 8.3: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L} % -% Should be 9.9: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H} +% Should be 9.9: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H} % -% Should be 9.9: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L} +% Should be 9.9: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L} % -% Should be 7.2: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N} +% Should be 7.2: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N} % -% Should be 7.1: \cvssScore{AV:A/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L} +% Should be 7.1: \cvssScore{CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L} % -% Should be 5.8: \cvssScore{AV:A/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L} +% Should be 5.8: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L} % -% Should be 5.5: \cvssScore{AV:A/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L} +% Should be 5.5: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L} % -% Should be 5.1: \cvssScore{AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L} +% Should be 5.1: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L} % -% Should be 4.3: \cvssScore{AV:A/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L} +% Should be 4.3: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L} % -% Should be 2.4: \cvssScore{AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:N/A:N} +% Should be 2.4: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:N/A:N} % -% Should be 0.0: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:N} +% Should be 0.0: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:N} % \end{verbatim} % % And the results of the computations: % -%Should be 7.3: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L} +%Should be 7.3: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L} % -%Should be 8.3: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L}% +%Should be 8.3: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L}% % -%Should be 9.9: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H}% +%Should be 9.9: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:H}% % -%Should be 9.9: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L}% +%Should be 9.9: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:H/A:L}% % -%Should be 7.2: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N}% +%Should be 7.2: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N}% % -%Should be 7.1: \cvssScore{AV:A/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L}% +%Should be 7.1: \cvssScore{CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L}% % -%Should be 5.8: \cvssScore{AV:A/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L}% +%Should be 5.8: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L}% % -%Should be 5.5: \cvssScore{AV:A/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L}% +%Should be 5.5: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L}% % -%Should be 5.1: \cvssScore{AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L}% +%Should be 5.1: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:L}% % -%Should be 4.3: \cvssScore{AV:A/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L}% +%Should be 4.3: \cvssScore{CVSS:3.1/AV:A/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L}% % -%Should be 2.4: \cvssScore{AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:N/A:N} +%Should be 2.4: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:N/A:N} % -%Should be 0.0: \cvssScore{AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:N} +%Should be 0.0: \cvssScore{CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:N} % % \end{documentation} %\newpage -% \StopEventually{\setlength\IndexMin{200pt} \PrintIndex } % \begin{implementation} % \section{Implementation} % \subsection{Initial set up} @@ -447,6 +454,7 @@ and the derived files cvss.ins, \msg_new:nnn { CVSS } { invalid-option }{ Value~'#2'~invalid~for~#1~#3.} \msg_new:nnn { CVSS } { invalid-structure } { CVSS~metric~#1~is~not~correct~(#2)~#3.} \msg_new:nnn { CVSS } { invalid-length } { CVSS~vector~"#1"~is~badly~formatted~#2.} +\msg_new:nnn { CVSS } { wrong-version } { Wrong~CVSS~version~(#2)~#3.} % \end{macrocode}% % % @@ -709,70 +717,82 @@ and the derived files cvss.ins, %\begin{macro}{\cvssScore} % \begin{macrocode} \NewExpandableDocumentCommand \cvssScore { m }{% - - % Check that there are 35 chars - \int_compare:nNnTF { \str_count_ignore_spaces:n {#1} } = {35}{}{ - \msg_error:nnxx{CVSS}{invalid-length}{#1}{\msg_line_context:} - } - % Check AV value - \str_if_eq:eeTF {\str_range:nnn {#1} {1} {3}} {AV:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{AV}{\str_range:nnn {#1} {1} {3}}{\msg_line_context:} - } - - % Check AC value - \str_if_eq:eeTF {\str_range:nnn {#1} {5} {8}} {/AC:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{AC}{\str_range:nnn {#1} {5} {8}}{\msg_line_context:} - } - - - % Check PR value - \str_if_eq:eeTF {\str_range:nnn {#1} {10} {13}} {/PR:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{PR}{\str_range:nnn {#1} {10} {13}}{\msg_line_context:} - } - - % Check UI value - \str_if_eq:eeTF {\str_range:nnn {#1} {15} {18}} {/UI:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{UI}{\str_range:nnn {#1} {15} {18}}{\msg_line_context:} - } - - % Check S value - \str_if_eq:eeTF {\str_range:nnn {#1} {20} {22}} {/S:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{S}{\str_range:nnn {#1} {20} {22}}{\msg_line_context:} - } - - % Check I value - \str_if_eq:eeTF {\str_range:nnn {#1} {24} {26}} {/C:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{C}{\str_range:nnn {#1} {24} {26}}{\msg_line_context:} - } - - % Check I value - \str_if_eq:eeTF {\str_range:nnn {#1} {28} {30}} {/I:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{I}{\str_range:nnn {#1} {28} {30}}{\msg_line_context:} - } - - % Check A value - \str_if_eq:eeTF {\str_range:nnn {#1} {32} {34}} {/A:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{A}{\str_range:nnn {#1} {32} {34}}{\msg_line_context:} - } - - \exp_args:Ne \__CVSS_cvssBaseScore:nnnnnnnn - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 4 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 9 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 14 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 19 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 23 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 27 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 31 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 35 } } - + % Check that there are 44 chars + \int_compare:nNnTF { \str_count_ignore_spaces:n {#1} } = {44}{}{ + \msg_error:nnxx{CVSS}{invalid-length}{#1}{\msg_line_context:} + } + % Check CVSS: value + \str_if_eq:eeTF {\str_range:nnn {#1} {1} {5}} {CVSS:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{AV}{\str_range:nnn {#1} {1} {5}}{\msg_line_context:} + } + % Check 3.1 value + \str_if_eq:eeTF {\str_range:nnn {#1} {6} {8}} {3.1} + {} { + \msg_error:nnxxx{CVSS}{wrong-version}{3.1}{\str_range:nnn {#1} {6} {8}}{\msg_line_context:} + } + % Check 3.1 value + \str_if_eq:eeTF {\str_range:nnn {#1} {9} {9}} {/} + {} { + \msg_error:nnxxx{CVSS}{wrong-version}{/}{\str_range:nnn {#1} {9} {9}}{\msg_line_context:} + } + % Check AV value + \str_if_eq:eeTF {\str_range:nnn {#1} {10} {12}} {AV:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{AV}{\str_range:nnn {#1} {10} {12}}{\msg_line_context:} + } + % Check AC value + \str_if_eq:eeTF {\str_range:nnn {#1} {14} {17}} {/AC:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{AC}{\str_range:nnn {#1} {14} {17}}{\msg_line_context:} + } + + + % Check PR value + \str_if_eq:eeTF {\str_range:nnn {#1} {19} {22}} {/PR:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{PR}{\str_range:nnn {#1} {19} {22}}{\msg_line_context:} + } + + % Check UI value + \str_if_eq:eeTF {\str_range:nnn {#1} {24} {27}} {/UI:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{UI}{\str_range:nnn {#1} {24} {27}}{\msg_line_context:} + } + + % Check S value + \str_if_eq:eeTF {\str_range:nnn {#1} {29} {31}} {/S:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{S}{\str_range:nnn {#1} {29} {31}}{\msg_line_context:} + } + + % Check I value + \str_if_eq:eeTF {\str_range:nnn {#1} {33} {35}} {/C:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{C}{\str_range:nnn {#1} {33} {35}}{\msg_line_context:} + } + + % Check I value + \str_if_eq:eeTF {\str_range:nnn {#1} {37} {39}} {/I:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{I}{\str_range:nnn {#1} {37} {39}}{\msg_line_context:} + } + + % Check A value + \str_if_eq:eeTF {\str_range:nnn {#1} {41} {43}} {/A:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{A}{\str_range:nnn {#1} {41} {43}}{\msg_line_context:} + } + + \exp_args:Ne \__CVSS_cvssBaseScore:nnnnnnnn + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 13 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 18 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 23 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 28 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 32 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 36 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 40 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 44 } } }% \ExplSyntaxOff % \end{macrocode} @@ -881,12 +901,13 @@ and the derived files cvss.ins, % \subsubsection{Full CVSS display} % We can even have a nice all-in display of the category, the scrore and a hyperlink to the FIRST calculator using a combination of all the functions we've defined: %\begin{macro}{\cvssPrint} +% {v1.1}{2022/11/30}{Full CVSS vector as input is now supported} % This macro will output the \textbf{colored} CVSS level based on the numerical CVSS score. % \begin{macrocode} \newcommand{\cvssPrint}[1]{% \def\CVSSscore{\cvssScore{#1}} \cvssFrame{\category{\CVSSscore}} \quad \CVSSscore \quad% - \href{https://www.first.org/cvss/calculator/3.1\#CVSS:3.1/#1}{CVSS:3.1/#1} + \href{https://www.first.org/cvss/calculator/3.1\##1}{#1} }% % \end{macrocode} %\end{macro} diff --git a/macros/latex/contrib/cvss/cvss.ins b/macros/latex/contrib/cvss/cvss.ins index a11eb8b58d..4b2b03aa6b 100644 --- a/macros/latex/contrib/cvss/cvss.ins +++ b/macros/latex/contrib/cvss/cvss.ins @@ -49,67 +49,28 @@ and the derived files cvss.ins, \file{\jobname.sty}{\from{\jobname.dtx}{package}} } \endbatchfile - % \begin{syntax} - % \cs{cvssScore} \Arg{CVSS string} - % \end{syntax} - % \begin{syntax} - % \cs{cvssScorepretty} \Arg{CVSS string} - % \end{syntax} - % This macro will print a \textbf{colored} base CVSS 3.1 score of an \marg{input vector} (without \texttt{CVSS3.1/}). The output of this macro is a floating point CVSS score. - % \end{function} - % \begin{syntax} - % \cs{cvssLevel} \Arg{CVSS string} - % \end{syntax} - % \begin{syntax} - % \cs{cvssLevelpretty} \Arg{CVSS string} - % \end{syntax} - % \begin{syntax} - % \cs{cvssTag} \Arg{CVSS string} - % \end{syntax} - % \begin{syntax} - % \cs{cvssPrint} \Arg{CVSS string} - % \end{syntax} - % This macro will print all details of a CVSS string: colored level, score, and hyperlink to FIRST calculator, from an \marg{input vector} (without \texttt{CVSS3.1/}). - % \end{function} - % \begin{syntax} - % \cs{category} \Arg{CVSS score} - % \end{syntax} - % \begin{syntax} - % \cs{cvssFrame} \Arg{CVSS score} - % \end{syntax} - % This macro will output a CVSS tag based on a CVSS \textbf{level} passed as argument. The mandatory argument must be one of the defined CVSS levels (None, Info, Low, Medium, High or Critical), for example \texttt{Info}. - % \end{function} + % \begin{syntax} + % \end{function} + % \begin{syntax} + % \cs{cvssLevel} \Arg{CVSS string} + % \end{syntax} + % \begin{syntax} + % \cs{cvssLevelpretty} \Arg{CVSS string} + % \end{syntax} + % \begin{syntax} + % \cs{cvssTag} \Arg{CVSS string} + % \end{syntax} + % \begin{syntax} + % \cs{category} \Arg{CVSS score} + % \end{syntax} - % \begin{verbatim} - % \end{verbatim} - %\end{minipage}% - %\end{minipage} - % \begin{verbatim} - % \end{verbatim} - %\end{minipage}% - %\end{minipage} - % \begin{verbatim} - % \end{verbatim} - %\end{minipage}% - %\end{minipage} - % \begin{verbatim} - % \end{verbatim} - %\end{minipage}% - %\end{minipage} - % \begin{verbatim} - %\cvssFrame{Low} - % \end{verbatim} - %\end{minipage}% - %\cvssFrame{Low} - - %\category{9.9} - %\category{9.9} +%%\category{9.9} \RequirePackage{expl3} \RequirePackage[skins]{tcolorbox} \tcbuselibrary{xparse} @@ -132,6 +93,7 @@ and the derived files cvss.ins, \msg_new:nnn { CVSS } { invalid-option }{ Value~'#2'~invalid~for~#1~#3.} \msg_new:nnn { CVSS } { invalid-structure } { CVSS~metric~#1~is~not~correct~(#2)~#3.} \msg_new:nnn { CVSS } { invalid-length } { CVSS~vector~"#1"~is~badly~formatted~#2.} +\msg_new:nnn { CVSS } { wrong-version } { Wrong~CVSS~version~(#2)~#3.} \cs_new:Npn \__CVSS_parseAV:n #1 { \str_case_e:nnF {#1} @@ -265,69 +227,81 @@ and the derived files cvss.ins, }% } \NewExpandableDocumentCommand \cvssScore { m }{% + % Check that there are 44 chars + \int_compare:nNnTF { \str_count_ignore_spaces:n {#1} } = {44}{}{ + \msg_error:nnxx{CVSS}{invalid-length}{#1}{\msg_line_context:} + } + % Check CVSS: value + \str_if_eq:eeTF {\str_range:nnn {#1} {1} {5}} {CVSS:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{AV}{\str_range:nnn {#1} {1} {5}}{\msg_line_context:} + } + % Check 3.1 value + \str_if_eq:eeTF {\str_range:nnn {#1} {6} {8}} {3.1} + {} { + \msg_error:nnxxx{CVSS}{wrong-version}{3.1}{\str_range:nnn {#1} {6} {8}}{\msg_line_context:} + } + % Check 3.1 value + \str_if_eq:eeTF {\str_range:nnn {#1} {9} {9}} {/} + {} { + \msg_error:nnxxx{CVSS}{wrong-version}{/}{\str_range:nnn {#1} {9} {9}}{\msg_line_context:} + } + % Check AV value + \str_if_eq:eeTF {\str_range:nnn {#1} {10} {12}} {AV:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{AV}{\str_range:nnn {#1} {10} {12}}{\msg_line_context:} + } + % Check AC value + \str_if_eq:eeTF {\str_range:nnn {#1} {14} {17}} {/AC:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{AC}{\str_range:nnn {#1} {14} {17}}{\msg_line_context:} + } - % Check that there are 35 chars - \int_compare:nNnTF { \str_count_ignore_spaces:n {#1} } = {35}{}{ - \msg_error:nnxx{CVSS}{invalid-length}{#1}{\msg_line_context:} - } - % Check AV value - \str_if_eq:eeTF {\str_range:nnn {#1} {1} {3}} {AV:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{AV}{\str_range:nnn {#1} {1} {3}}{\msg_line_context:} - } + % Check PR value + \str_if_eq:eeTF {\str_range:nnn {#1} {19} {22}} {/PR:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{PR}{\str_range:nnn {#1} {19} {22}}{\msg_line_context:} + } - % Check AC value - \str_if_eq:eeTF {\str_range:nnn {#1} {5} {8}} {/AC:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{AC}{\str_range:nnn {#1} {5} {8}}{\msg_line_context:} - } + % Check UI value + \str_if_eq:eeTF {\str_range:nnn {#1} {24} {27}} {/UI:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{UI}{\str_range:nnn {#1} {24} {27}}{\msg_line_context:} + } - % Check PR value - \str_if_eq:eeTF {\str_range:nnn {#1} {10} {13}} {/PR:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{PR}{\str_range:nnn {#1} {10} {13}}{\msg_line_context:} - } + % Check S value + \str_if_eq:eeTF {\str_range:nnn {#1} {29} {31}} {/S:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{S}{\str_range:nnn {#1} {29} {31}}{\msg_line_context:} + } - % Check UI value - \str_if_eq:eeTF {\str_range:nnn {#1} {15} {18}} {/UI:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{UI}{\str_range:nnn {#1} {15} {18}}{\msg_line_context:} - } + % Check I value + \str_if_eq:eeTF {\str_range:nnn {#1} {33} {35}} {/C:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{C}{\str_range:nnn {#1} {33} {35}}{\msg_line_context:} + } - % Check S value - \str_if_eq:eeTF {\str_range:nnn {#1} {20} {22}} {/S:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{S}{\str_range:nnn {#1} {20} {22}}{\msg_line_context:} - } - - % Check I value - \str_if_eq:eeTF {\str_range:nnn {#1} {24} {26}} {/C:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{C}{\str_range:nnn {#1} {24} {26}}{\msg_line_context:} - } - - % Check I value - \str_if_eq:eeTF {\str_range:nnn {#1} {28} {30}} {/I:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{I}{\str_range:nnn {#1} {28} {30}}{\msg_line_context:} - } - - % Check A value - \str_if_eq:eeTF {\str_range:nnn {#1} {32} {34}} {/A:} - {} { - \msg_error:nnxxx{CVSS}{invalid-structure}{A}{\str_range:nnn {#1} {32} {34}}{\msg_line_context:} - } + % Check I value + \str_if_eq:eeTF {\str_range:nnn {#1} {37} {39}} {/I:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{I}{\str_range:nnn {#1} {37} {39}}{\msg_line_context:} + } - \exp_args:Ne \__CVSS_cvssBaseScore:nnnnnnnn - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 4 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 9 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 14 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 19 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 23 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 27 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 31 } } - { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 35 } } + % Check A value + \str_if_eq:eeTF {\str_range:nnn {#1} {41} {43}} {/A:} + {} { + \msg_error:nnxxx{CVSS}{invalid-structure}{A}{\str_range:nnn {#1} {41} {43}}{\msg_line_context:} + } + \exp_args:Ne \__CVSS_cvssBaseScore:nnnnnnnn + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 13 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 18 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 23 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 28 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 32 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 36 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 40 } } + { \str_use:N \str_item_ignore_spaces:nn { #1 }{ 44 } } }% \ExplSyntaxOff \ExplSyntaxOn @@ -377,7 +351,7 @@ and the derived files cvss.ins, \newcommand{\cvssPrint}[1]{% \def\CVSSscore{\cvssScore{#1}} \cvssFrame{\category{\CVSSscore}} \quad \CVSSscore \quad% - \href{https://www.first.org/cvss/calculator/3.1\#CVSS:3.1/#1}{CVSS:3.1/#1} + \href{https://www.first.org/cvss/calculator/3.1\##1}{#1} }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/macros/latex/contrib/cvss/cvss.pdf b/macros/latex/contrib/cvss/cvss.pdf Binary files differindex b92d3a84a7..75a97ce687 100644 --- a/macros/latex/contrib/cvss/cvss.pdf +++ b/macros/latex/contrib/cvss/cvss.pdf diff --git a/macros/latex/contrib/ffcode/ffcode.dtx b/macros/latex/contrib/ffcode/ffcode.dtx index 2107516f3e..e8c71aa8ed 100644 --- a/macros/latex/contrib/ffcode/ffcode.dtx +++ b/macros/latex/contrib/ffcode/ffcode.dtx @@ -50,7 +50,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{ffcode} %<*package> -[2022-11-28 0.7.0 Fixed Font Code] +[2022-12-02 0.8.0 Fixed Font Code] %</package> %<*driver> \documentclass{ltxdoc} @@ -152,7 +152,7 @@ % \DescribeMacro{sf} % You can change the font family of |\ff| pieces to |\sffamily|: -% \docshotOptions{firstline=4,lastline=9} +% \docshotOptions{firstline=4,lastline=10} % \begin{docshot} % \documentclass{article} % \usepackage[paperwidth=3in]{geometry} @@ -161,7 +161,8 @@ % \begin{document} % Sometimes you may want them to look % not strictly fixed-width, but more -% elegant, like the |fibo()| here. +% elegant, like the \emph{|fibo()|} +% here. % \end{document} % \end{docshot} @@ -243,7 +244,7 @@ novert/.store in=\ff@novert, nocn/.store in=\ff@nocn, } -\ProcessPgfOptions{/ff} +\ProcessPgfPackageOptions{/ff} % \end{macrocode} % Then, we disable pygments for \href{https://ctan.org/pkg/minted}{minted}, if necessary: @@ -347,7 +348,17 @@ % Then, we define |\ff@x| internal command for printing a piece of fixed-width-font text: % \begin{macrocode} \makeatletter -\NewDocumentCommand\ff@x{v}{% +\NewDocumentCommand\ff@x{v}{\ff{#1}} +\makeatother +% \end{macrocode} +% \end{macro} + +% \begin{macro}{\ff} +% \changes{v0.8.0}{2022/12/01}{The \texttt{\char`\\ff} command is now a normal command, not verbatim.} +% Then, we define |\ff| macro: +% \begin{macrocode} +\makeatletter +\newcommand\ff[1]{% \ifdefined\ff@noframes% \ff@rule\ff@print{#1}% \else% @@ -362,15 +373,6 @@ % \end{macrocode} % \end{macro} -% \begin{macro}{\ff} -% Then, we define |\ff| macro: -% \begin{macrocode} -\makeatletter -\def\ff{\ff@x} -\makeatother -% \end{macrocode} -% \end{macro} - % \begin{macro}{novert} % Finally, we let vertical bars work similar to |\ff|, as suggested % \href{https://tex.stackexchange.com/a/665105/1449}{here} diff --git a/macros/latex/contrib/ffcode/ffcode.pdf b/macros/latex/contrib/ffcode/ffcode.pdf Binary files differindex b2a318eb0d..81e04f3bf7 100644 --- a/macros/latex/contrib/ffcode/ffcode.pdf +++ b/macros/latex/contrib/ffcode/ffcode.pdf |