Skip to content

Commit 8e391f4

Browse files
committed
Define LIBP11_VERSION_NUMBER
close #642
1 parent 95751ea commit 8e391f4

File tree

6 files changed

+72
-1
lines changed

6 files changed

+72
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
NEWS for Libp11 -- History of user visible changes
22

33
New in 0.4.19; unreleased
4+
* Define LIBP11_VERSION_NUMBER (Michał Trojnara)
45

56
New in 0.4.18; 2026-02-16; Michał Trojnara
67
* Support for RSA-PSS and RSA-OAEP using keys retrieved using the

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ esac
294294
AC_CONFIG_FILES([
295295
Makefile
296296
src/Makefile
297+
src/p11_ver.h
297298
src/libp11.pc
298299
src/libp11.rc
299300
src/pkcs11.rc

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ EXTRA_DIST = Makefile.mak libp11.rc.in pkcs11.rc.in
99

1010
# Headers
1111
noinst_HEADERS= libp11-int.h pkcs11.h p11_pthread.h util.h
12-
include_HEADERS= libp11.h p11_err.h
12+
include_HEADERS= libp11.h p11_ver.h p11_err.h
1313

1414
# Libraries to build (static-engine optional)
1515
if ENABLE_STATIC_ENGINE

src/libp11.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#ifndef _LIB11_H
2626
#define _LIB11_H
2727

28+
#include "p11_ver.h"
2829
#include "p11_err.h"
2930
#include <openssl/bio.h>
3031
#include <openssl/err.h>

src/p11_ver.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* libp11, a simple layer on top of PKCS#11 API
2+
* Copyright © 2026 Mobi - Com Polska Sp. z o.o.
3+
*
4+
* This library is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This library is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with this library; if not, write to the Free Software
16+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17+
*/
18+
19+
#define LIBP11_VERSION_MAJOR 0
20+
#define LIBP11_VERSION_MINOR 4
21+
#define LIBP11_VERSION_FIX 19
22+
23+
/*
24+
* The LIBP11_VERSION_NUMBER layout is 0xMMmmffff, where
25+
* - MM represents hexadecimal encoding of LIBP11_VERSION_MAJOR
26+
* - mm represents hexadecimal encoding of LIBP11_VERSION_MINOR
27+
* - ffff represents hexadecimal encoding of LIBP11_VERSION_FIX
28+
*/
29+
#define LIBP11_VERSION_NUMBER ( \
30+
(LIBP11_VERSION_MAJOR<<24) | \
31+
(LIBP11_VERSION_MINOR<<16) | \
32+
LIBP11_VERSION_FIX)
33+
34+
/* vim: set noexpandtab: */

src/p11_ver.h.in

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* libp11, a simple layer on top of PKCS#11 API
2+
* Copyright © 2026 Mobi - Com Polska Sp. z o.o.
3+
*
4+
* This library is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This library is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with this library; if not, write to the Free Software
16+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17+
*/
18+
19+
#define LIBP11_VERSION_MAJOR @LIBP11_VERSION_MAJOR@
20+
#define LIBP11_VERSION_MINOR @LIBP11_VERSION_MINOR@
21+
#define LIBP11_VERSION_FIX @LIBP11_VERSION_FIX@
22+
23+
/*
24+
* The LIBP11_VERSION_NUMBER layout is 0xMMmmffff, where
25+
* - MM represents hexadecimal encoding of LIBP11_VERSION_MAJOR
26+
* - mm represents hexadecimal encoding of LIBP11_VERSION_MINOR
27+
* - ffff represents hexadecimal encoding of LIBP11_VERSION_FIX
28+
*/
29+
#define LIBP11_VERSION_NUMBER ( \
30+
(LIBP11_VERSION_MAJOR<<24) | \
31+
(LIBP11_VERSION_MINOR<<16) | \
32+
LIBP11_VERSION_FIX)
33+
34+
/* vim: set noexpandtab: */

0 commit comments

Comments
 (0)