packages: libica2/libica2-headers.patch (NEW), libica2/libica2.spec (NEW) -...
qboosh
qboosh at pld-linux.org
Sat Oct 9 20:48:27 CEST 2010
Author: qboosh Date: Sat Oct 9 18:48:27 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- libica 2.0.x; supports only zSeries
---- Files affected:
packages/libica2:
libica2-headers.patch (NONE -> 1.1) (NEW), libica2.spec (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/libica2/libica2-headers.patch
diff -u /dev/null packages/libica2/libica2-headers.patch:1.1
--- /dev/null Sat Oct 9 20:48:27 2010
+++ packages/libica2/libica2-headers.patch Sat Oct 9 20:48:21 2010
@@ -0,0 +1,222 @@
+--- libica-1.3.8/include/linux/icaioctl.h.orig 1970-01-01 01:00:00.000000000 +0100
++++ libica-1.3.8/include/linux/icaioctl.h 2007-09-01 23:48:00.181252077 +0200
+@@ -0,0 +1,219 @@
++/* Copyright (c) International Business Machines Corp., 2001 */
++/*
++ * linux/include/linux/icaioctl.h
++ *
++ */
++
++
++
++#ifndef _LINUX_ICAIOCTL_H_
++#define _LINUX_ICAIOCTL_H_
++
++enum _sizelimits {
++ ICA_DES_DATALENGTH_MIN = 8,
++ ICA_DES_DATALENGTH_MAX = 32 * 1024 * 1024 - 8,
++ ICA_SHA_DATALENGTH = 20,
++ ICA_SHA_BLOCKLENGTH = 64,
++ ICA_RSA_DATALENGTH_MIN = 256/8,
++ ICA_RSA_DATALENGTH_MAX = 2048/8
++};
++
++
++typedef struct _ica_rng_rec {
++ unsigned int nbytes;
++ char *buf;
++} ica_rng_t;
++
++
++// May have some porting issues here
++
++typedef struct _ica_rsa_modexpo {
++ char *inputdata;
++ unsigned int inputdatalength;
++ char *outputdata;
++ unsigned int outputdatalength;
++ char *b_key;
++ char *n_modulus;
++} ica_rsa_modexpo_t;
++
++typedef ica_rsa_modexpo_t ica_rsa_modmult_t;
++
++typedef struct _ica_rsa_modexpo_crt {
++ char *inputdata;
++ unsigned int inputdatalength;
++ char *outputdata;
++ unsigned int outputdatalength;
++ char *bp_key;
++ char *bq_key;
++ char *np_prime;
++ char *nq_prime;
++ char *u_mult_inv;
++} ica_rsa_modexpo_crt_t;
++
++typedef unsigned char ica_des_vector_t[8];
++typedef unsigned char ica_des_key_t[8];
++typedef ica_des_key_t ica_des_single_t[1];
++typedef ica_des_single_t ica_des_triple_t[3];
++
++enum _ica_mode_des {
++ DEVICA_MODE_DES_CBC = 0,
++ DEVICA_MODE_DES_ECB = 1
++};
++
++enum _ica_direction_des {
++ DEVICA_DIR_DES_ENCRYPT = 0,
++ DEVICA_DIR_DES_DECRYPT = 1
++};
++
++typedef struct _ica_des {
++ unsigned int mode;
++ unsigned int direction;
++ unsigned char *inputdata;
++ unsigned int inputdatalength;
++ ica_des_vector_t *iv;
++ ica_des_key_t *keys;
++ unsigned char *outputdata;
++ int outputdatalength;
++} ica_des_t;
++
++typedef struct _ica_desmac {
++ unsigned char *inputdata;
++ unsigned int inputdatalength;
++ ica_des_vector_t *iv;
++ ica_des_key_t *keys;
++ unsigned char *outputdata;
++ int outputdatalength;
++} ica_desmac_t;
++
++
++typedef unsigned char ica_sha1_result_t[ICA_SHA_DATALENGTH];
++
++
++typedef struct _ica_sha1 {
++ unsigned char *inputdata;
++ unsigned int inputdatalength;
++ ica_sha1_result_t *outputdata;
++ ica_sha1_result_t *initialh;
++} ica_sha1_t;
++
++/* The following structs are used by conversion functions
++ on PowerPC 64 bit only. They should not be used by externel
++ applications. Should the non PPC specific structs change, these
++ structures may need to change as well. Also, new conversion
++ routines will need to be added to devica.c to deal with new
++ structs or structure members.
++*/
++#ifdef CONFIG_PPC64
++typedef struct _ica_rng_rec_32 {
++ unsigned int nbytes;
++ unsigned int buf;
++} ica_rng_t_32;
++
++typedef struct _ica_des_32 {
++ unsigned int mode;
++ unsigned int direction;
++ unsigned int inputdata;
++ unsigned int iv;
++ unsigned int keys;
++ unsigned int outputdata;
++ unsigned int inputdatalength;
++ unsigned int outputdatalength;
++} ica_des_t_32;
++
++typedef struct _ica_sha1_32 {
++ unsigned int inputdata;
++ unsigned int inputdatalength;
++ unsigned int outputdata;
++ unsigned int initialh;
++} ica_sha1_t_32;
++
++typedef struct _ica_desmac_32 {
++ unsigned int inputdata;
++ unsigned int inputdatalength;
++ unsigned int iv;
++ unsigned int keys;
++ unsigned int outputdata;
++ int outputdatalength;
++} ica_desmac_t_32;
++
++typedef struct _ica_rsa_modexpo_crt_32 {
++ unsigned int inputdata;
++ unsigned int inputdatalength;
++ unsigned int outputdata;
++ unsigned int outputdatalength;
++ unsigned int bp_key;
++ unsigned int bq_key;
++ unsigned int np_prime;
++ unsigned int nq_prime;
++ unsigned int u_mult_inv;
++} ica_rsa_modexpo_crt_t_32;
++
++typedef struct _ica_rsa_modexpo_32 {
++ unsigned int inputdata;
++ unsigned int inputdatalength;
++ unsigned int outputdata;
++ unsigned int outputdatalength;
++ unsigned int b_key;
++ unsigned int n_modulus;
++} ica_rsa_modexpo_t_32;
++
++#endif
++
++#define ICA_IOCTL_MAGIC '?' // NOTE: Need to allocate from linux folks
++
++/*
++ * Note: Some platforms only use 8 bits to define the parameter size. As
++ * the macros in ioctl.h don't seem to mask off offending bits, they look
++ * a little unsafe. We should probably just not use the parameter size
++ * at all for these ioctls. I don't know if we'll ever run on any of those
++ * architectures, but seems easier just to not count on this feature.
++ */
++
++#define ICASETBIND _IOW(ICA_IOCTL_MAGIC, 0x01, int)
++#define ICAGETBIND _IOR(ICA_IOCTL_MAGIC, 0x02, int)
++#define ICAGETCOUNT _IOR(ICA_IOCTL_MAGIC, 0x03, int)
++#define ICAGETID _IOR(ICA_IOCTL_MAGIC, 0x04, int)
++#define ICARSAMODEXPO _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x05, 0)
++#define ICARSACRT _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x06, 0)
++#define ICARSAMODMULT _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x07, 0)
++#define ICADES _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x08, 0)
++#define ICADESMAC _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x09, 0)
++#define ICATDES _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x0a, 0)
++#define ICATDESSHA _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x0b, 0)
++#define ICATDESMAC _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x0c, 0)
++#define ICASHA1 _IOC(_IOC_READ|_IOC_WRITE, ICA_IOCTL_MAGIC, 0x0d, 0)
++#define ICARNG _IOC(_IOC_READ, ICA_IOCTL_MAGIC, 0x0e, 0)
++#define ICAGETVPD _IOC(_IOC_READ, ICA_IOCTL_MAGIC, 0x0f, 0)
++
++#ifdef __KERNEL__
++
++#ifndef assertk
++#ifdef NDEBUG
++# define assertk(expr) do {} while (0)
++#else
++# define assertk(expr) \
++ if(!(expr)) { \
++ printk( "Assertion failed! %s,%s,%s,line=%d\n", \
++ #expr,__FILE__,__FUNCTION__,__LINE__); \
++ }
++#endif
++#endif
++
++
++struct ica_operations {
++ ssize_t (*read) (struct file *, char *, size_t, loff_t *, void *);
++ int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long, void *);
++};
++
++typedef struct ica_worker {
++ struct ica_operations *icaops;
++ void * private_data;
++} ica_worker_t;
++
++
++extern int ica_register_worker(int partitionnum, ica_worker_t *device);
++extern int ica_unregister_worker(int partitionnum, ica_worker_t *device);
++
++#endif /* __KERNEL__ */
++
++#endif /* _LINUX_ICAIOCTL_H_ */
================================================================
Index: packages/libica2/libica2.spec
diff -u /dev/null packages/libica2/libica2.spec:1.1
--- /dev/null Sat Oct 9 20:48:27 2010
+++ packages/libica2/libica2.spec Sat Oct 9 20:48:21 2010
@@ -0,0 +1,109 @@
+# $Revision$, $Date$
+Summary: Interface library to the ICA device driver
+Summary(pl.UTF-8): Biblioteka interfejsu do sterownika urządzenia ICA
+Name: libica2
+Version: 2.0.3
+Release: 1
+License: CPL v1.0
+Group: Libraries
+Source0: http://downloads.sourceforge.net/opencryptoki/libica-%{version}.tar.gz
+# Source0-md5: da90d6c3f5ef28c67ba8e7cf17e1dc8b
+Patch0: %{name}-headers.patch
+URL: http://opencryptoki.sourceforge.net/
+BuildRequires: autoconf
+BuildRequires: automake >= 1:1.9.5
+BuildRequires: libtool
+BuildRequires: openssl-devel
+Provides: libica = %{version}
+Obsoletes: libica < 2.0
+ExclusiveArch: s390 s390x
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Interface library routines used by IBM modules to interface to the IBM
+eServer Cryptographic Accelerator (ICA).
+
+%description -l pl.UTF-8
+Biblioteka interfejsu używana przez moduły IBM-a do współpracy z
+akceleratorem kryptograficznym IBM eServer Cryptographic Accelerator
+(ICA).
+
+%package devel
+Summary: Header files for ICA library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki ICA
+Group: Development/Libraries
+Provides: libica-devel = %{version}
+Requires: %{name} = %{version}-%{release}
+Requires: openssl-devel
+Obsoletes: libica-devel < 2.0
+
+%description devel
+Header files for ICA library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki ICA.
+
+%package static
+Summary: Static ICA library
+Summary(pl.UTF-8): Statyczna biblioteka ICA
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+Provides: libica-static = %{version}
+Obsoletes: libica-static < 2.0
+
+%description static
+Static ICA library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka ICA.
+
+%prep
+%setup -q -n libica-2
+%patch0 -p1
+
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
+%configure \
+ CPPFLAGS="%{rpmcppflags} -I$(pwd)/include"
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog LICENSE
+%attr(755,root,root) %{_bindir}/icainfo
+%attr(755,root,root) %{_bindir}/icastats
+%attr(755,root,root) %{_libdir}/libica-%{version}.so
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libica.so
+%{_libdir}/libica.la
+%{_includedir}/ica_api.h
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libica.a
+
+%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
+%changelog
+* %{date} PLD Team <feedback at pld-linux.org>
+All persons listed below can be reached at <cvs_login>@pld-linux.org
+
+$Log$
+Revision 1.1 2010/10/09 18:48:21 qboosh
+- libica 2.0.x; supports only zSeries
================================================================
More information about the pld-cvs-commit
mailing list