[pkg-wpa-devel] r1381 - in /crda/trunk: debian/changelog reglib.c utils/key2pub.py
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Wed May 13 20:03:15 UTC 2009
Author: kelmo-guest
Date: Wed May 13 20:03:15 2009
New Revision: 1381
URL: http://svn.debian.org/wsvn/pkg-wpa/?sc=1&rev=1381
Log:
New upstream release.
Modified:
crda/trunk/debian/changelog
crda/trunk/reglib.c
crda/trunk/utils/key2pub.py
Modified: crda/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/debian/changelog?rev=1381&op=diff
==============================================================================
--- crda/trunk/debian/changelog (original)
+++ crda/trunk/debian/changelog Wed May 13 20:03:15 2009
@@ -1,4 +1,4 @@
-crda (1.0.2-1) unstable; urgency=low
+crda (1.1.0-1) unstable; urgency=low
* Initial release
Modified: crda/trunk/reglib.c
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/reglib.c?rev=1381&op=diff
==============================================================================
--- crda/trunk/reglib.c (original)
+++ crda/trunk/reglib.c Wed May 13 20:03:15 2009
@@ -49,32 +49,28 @@
unsigned int i;
int ok = 0;
- rsa = RSA_new();
- if (!rsa) {
- fprintf(stderr, "Failed to create RSA key.\n");
- goto out;
- }
-
if (SHA1(db, dblen, hash) != hash) {
fprintf(stderr, "Failed to calculate SHA1 sum.\n");
- RSA_free(rsa);
goto out;
}
for (i = 0; (i < sizeof(keys)/sizeof(keys[0])) && (!ok); i++) {
+ rsa = RSA_new();
+ if (!rsa) {
+ fprintf(stderr, "Failed to create RSA key.\n");
+ goto out;
+ }
+
rsa->e = &keys[i].e;
rsa->n = &keys[i].n;
- if (RSA_size(rsa) != siglen)
- continue;
-
ok = RSA_verify(NID_sha1, hash, SHA_DIGEST_LENGTH,
db + dblen, siglen, rsa) == 1;
+
+ rsa->e = NULL;
+ rsa->n = NULL;
+ RSA_free(rsa);
}
-
- rsa->e = NULL;
- rsa->n = NULL;
- RSA_free(rsa);
#endif
#ifdef USE_GCRYPT
Modified: crda/trunk/utils/key2pub.py
URL: http://svn.debian.org/wsvn/pkg-wpa/crda/trunk/utils/key2pub.py?rev=1381&op=diff
==============================================================================
--- crda/trunk/utils/key2pub.py (original)
+++ crda/trunk/utils/key2pub.py Wed May 13 20:03:15 2009
@@ -9,7 +9,31 @@
sys.stderr.write('On Debian GNU/Linux the package is called "python-m2crypto".\n')
sys.exit(1)
-def print_ssl(output, name, val):
+def print_ssl_64(output, name, val):
+ while val[0] == '\0':
+ val = val[1:]
+ while len(val) % 8:
+ val = '\0' + val
+ vnew = []
+ while len(val):
+ vnew.append((val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]))
+ val = val[8:]
+ vnew.reverse()
+ output.write('static BN_ULONG %s[%d] = {\n' % (name, len(vnew)))
+ idx = 0
+ for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
+ if not idx:
+ output.write('\t')
+ output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
+ idx += 1
+ if idx == 2:
+ idx = 0
+ output.write('\n')
+ if idx:
+ output.write('\n')
+ output.write('};\n\n')
+
+def print_ssl_32(output, name, val):
while val[0] == '\0':
val = val[1:]
while len(val) % 4:
@@ -32,6 +56,13 @@
if idx:
output.write('\n')
output.write('};\n\n')
+
+def print_ssl(output, name, val):
+ import struct
+ if len(struct.pack('@L', 0)) == 8:
+ return print_ssl_64(output, name, val)
+ else:
+ return print_ssl_32(output, name, val)
def print_ssl_keys(output, n):
output.write(r'''
More information about the Pkg-wpa-devel
mailing list