GnuTLS 2.12.3.

svn path=/nixpkgs/trunk/; revision=27039

+635 -124
+3 -3
pkgs/development/libraries/gnutls/default.nix
··· 5 5 6 6 stdenv.mkDerivation rec { 7 7 8 - name = "gnutls-2.12.2"; 8 + name = "gnutls-2.12.3"; 9 9 10 10 src = fetchurl { 11 11 url = "mirror://gnu/gnutls/${name}.tar.bz2"; 12 - sha256 = "0hvymf1q3d63hbi3hia876alaq7asprgwzhy49192i2h2gjlx5nc"; 12 + sha256 = "1lrr4mkv6ygi4r8gqfgv528wc9lhqfs60wnlgj0w59iz1nhxpcwz"; 13 13 }; 14 14 15 - patches = [ ./no-libgcrypt.patch ]; 15 + patches = [ ./fix-guile-tests.patch ]; 16 16 17 17 configurePhase = '' 18 18 ./configure --prefix="$out" \
+632
pkgs/development/libraries/gnutls/fix-guile-tests.patch
··· 1 + From ccbd77f6dc0b8440e7d80bddce2c8f950674eb46 Mon Sep 17 00:00:00 2001 2 + From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org> 3 + Date: Thu, 28 Apr 2011 19:41:08 +0200 4 + Subject: [PATCH] guile: Fix tests to match the `exit' behavior introduced in Guile 2.0.1. 5 + 6 + This fix makes tests behave correctly wrt. to the Guile bug fix at 7 + <http://git.sv.gnu.org/cgit/guile.git/commit/?id=e309f3bf9ee910c4772353ca3ff95f6f4ef466b5>. 8 + --- 9 + guile/modules/Makefile.am | 3 +- 10 + guile/modules/gnutls/build/tests.scm | 41 ++++++++++++++++++++++++++++++++++ 11 + guile/tests/anonymous-auth.scm | 18 +++++---------- 12 + guile/tests/errors.scm | 22 ++++++----------- 13 + guile/tests/openpgp-auth.scm | 18 +++++---------- 14 + guile/tests/openpgp-keyring.scm | 24 ++++++------------- 15 + guile/tests/openpgp-keys.scm | 35 +++++++++++----------------- 16 + guile/tests/pkcs-import-export.scm | 32 ++++++++++---------------- 17 + guile/tests/session-record-port.scm | 26 ++++++++------------- 18 + guile/tests/srp-base64.scm | 15 +++++++----- 19 + guile/tests/x509-auth.scm | 18 +++++---------- 20 + guile/tests/x509-certificates.scm | 41 ++++++++++++++------------------- 21 + 12 files changed, 139 insertions(+), 154 deletions(-) 22 + create mode 100644 guile/modules/gnutls/build/tests.scm 23 + 24 + diff --git a/guile/modules/Makefile.am b/guile/modules/Makefile.am 25 + index c1829ed..d1b1cac 100644 26 + --- a/guile/modules/Makefile.am 27 + +++ b/guile/modules/Makefile.am 28 + @@ -1,5 +1,5 @@ 29 + # GnuTLS --- Guile bindings for GnuTLS. 30 + -# Copyright (C) 2007, 2010 Free Software Foundation, Inc. 31 + +# Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 32 + # 33 + # GnuTLS is free software; you can redistribute it and/or 34 + # modify it under the terms of the GNU Lesser General Public 35 + @@ -25,4 +25,5 @@ documentation_modules = system/documentation/README \ 36 + 37 + EXTRA_DIST = gnutls/build/enums.scm gnutls/build/smobs.scm \ 38 + gnutls/build/utils.scm gnutls/build/priorities.scm \ 39 + + gnutls/build/tests.scm \ 40 + $(documentation_modules) 41 + diff --git a/guile/modules/gnutls/build/tests.scm b/guile/modules/gnutls/build/tests.scm 42 + new file mode 100644 43 + index 0000000..ca3985f 44 + --- /dev/null 45 + +++ b/guile/modules/gnutls/build/tests.scm 46 + @@ -0,0 +1,41 @@ 47 + +;;; GnuTLS --- Guile bindings for GnuTLS. 48 + +;;; Copyright (C) 2011 Free Software Foundation, Inc. 49 + +;;; 50 + +;;; GnuTLS is free software; you can redistribute it and/or 51 + +;;; modify it under the terms of the GNU Lesser General Public 52 + +;;; License as published by the Free Software Foundation; either 53 + +;;; version 2.1 of the License, or (at your option) any later version. 54 + +;;; 55 + +;;; GnuTLS is distributed in the hope that it will be useful, 56 + +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 57 + +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 58 + +;;; Lesser General Public License for more details. 59 + +;;; 60 + +;;; You should have received a copy of the GNU Lesser General Public 61 + +;;; License along with GnuTLS; if not, write to the Free Software 62 + +;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 63 + + 64 + +;;; Written by Ludovic Courtès <ludo@gnu.org>. 65 + + 66 + +(define-module (gnutls build tests) 67 + + #:export (run-test)) 68 + + 69 + +(define (run-test thunk) 70 + + "Call `(exit (THUNK))'. If THUNK raises an exception, then call `(exit 1)' and 71 + +display a backtrace. Otherwise, return THUNK's return value." 72 + + (exit 73 + + (catch #t 74 + + thunk 75 + + (lambda (key . args) 76 + + ;; Never reached. 77 + + (exit 1)) 78 + + (lambda (key . args) 79 + + (dynamic-wind ;; to be on the safe side 80 + + (lambda () #t) 81 + + (lambda () 82 + + (format (current-error-port) 83 + + "~%throw to `~a' with args ~s~%" key args) 84 + + (display-backtrace (make-stack #t) (current-output-port))) 85 + + (lambda () 86 + + (exit 1))) 87 + + (exit 1))))) 88 + diff --git a/guile/tests/anonymous-auth.scm b/guile/tests/anonymous-auth.scm 89 + index 17f5e80..63616a6 100644 90 + --- a/guile/tests/anonymous-auth.scm 91 + +++ b/guile/tests/anonymous-auth.scm 92 + @@ -1,5 +1,5 @@ 93 + ;;; GnuTLS --- Guile bindings for GnuTLS. 94 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 95 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 96 + ;;; 97 + ;;; GnuTLS is free software; you can redistribute it and/or 98 + ;;; modify it under the terms of the GNU Lesser General Public 99 + @@ -24,6 +24,7 @@ 100 + ;;; 101 + 102 + (use-modules (gnutls) 103 + + (gnutls build tests) 104 + (srfi srfi-4)) 105 + 106 + 107 + @@ -54,10 +55,7 @@ 108 + ;; (set-log-procedure! (lambda (level str) 109 + ;; (format #t "[~a|~a] ~a" (getpid) level str))) 110 + 111 + -(dynamic-wind 112 + - (lambda () 113 + - #t) 114 + - 115 + +(run-test 116 + (lambda () 117 + (let ((socket-pair (socketpair PF_UNIX SOCK_STREAM 0)) 118 + (pid (primitive-fork))) 119 + @@ -80,7 +78,7 @@ 120 + (record-send client %message) 121 + (bye client close-request/rdwr) 122 + 123 + - (exit)) 124 + + (primitive-exit)) 125 + 126 + (let ((server (make-session connection-end/server))) 127 + ;; server-side 128 + @@ -103,11 +101,7 @@ 129 + (let* ((buf (make-u8vector (u8vector-length %message))) 130 + (amount (record-receive! server buf))) 131 + (bye server close-request/rdwr) 132 + - (exit (= amount (u8vector-length %message)) 133 + - (equal? buf %message))))))) 134 + - 135 + - (lambda () 136 + - ;; failure 137 + - (exit 1))) 138 + + (and (= amount (u8vector-length %message)) 139 + + (equal? buf %message)))))))) 140 + 141 + ;;; arch-tag: 8c98de24-0a53-4290-974e-4b071ad162a0 142 + diff --git a/guile/tests/errors.scm b/guile/tests/errors.scm 143 + index cec6491..65b4ae9 100644 144 + --- a/guile/tests/errors.scm 145 + +++ b/guile/tests/errors.scm 146 + @@ -1,5 +1,5 @@ 147 + ;;; GnuTLS --- Guile bindings for GnuTLS. 148 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 149 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 150 + ;;; 151 + ;;; GnuTLS is free software; you can redistribute it and/or 152 + ;;; modify it under the terms of the GNU Lesser General Public 153 + @@ -22,25 +22,19 @@ 154 + ;;; Test the error/exception mechanism. 155 + ;;; 156 + 157 + -(use-modules (gnutls)) 158 + - 159 + -(dynamic-wind 160 + - (lambda () 161 + - #t) 162 + +(use-modules (gnutls) 163 + + (gnutls build tests)) 164 + 165 + +(run-test 166 + (lambda () 167 + (let ((s (make-session connection-end/server))) 168 + (catch 'gnutls-error 169 + (lambda () 170 + (handshake s)) 171 + (lambda (key err function . currently-unused) 172 + - (exit (and (eq? key 'gnutls-error) 173 + - err 174 + - (string? (error->string err)) 175 + - (eq? function 'handshake))))))) 176 + - 177 + - (lambda () 178 + - ;; failure 179 + - (exit 1))) 180 + + (and (eq? key 'gnutls-error) 181 + + err 182 + + (string? (error->string err)) 183 + + (eq? function 'handshake))))))) 184 + 185 + ;;; arch-tag: 73ed6229-378d-4a12-a5c6-4c2586c6e3a2 186 + diff --git a/guile/tests/openpgp-auth.scm b/guile/tests/openpgp-auth.scm 187 + index 3db9e42..4b43c90 100644 188 + --- a/guile/tests/openpgp-auth.scm 189 + +++ b/guile/tests/openpgp-auth.scm 190 + @@ -1,5 +1,5 @@ 191 + ;;; GnuTLS-extra --- Guile bindings for GnuTLS-EXTRA. 192 + -;;; Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc. 193 + +;;; Copyright (C) 2007, 2008, 2010, 2011 Free Software Foundation, Inc. 194 + ;;; 195 + ;;; GnuTLS-extra is free software; you can redistribute it and/or modify 196 + ;;; it under the terms of the GNU General Public License as published by 197 + @@ -25,6 +25,7 @@ 198 + 199 + (use-modules (gnutls) 200 + (gnutls extra) 201 + + (gnutls build tests) 202 + (srfi srfi-4)) 203 + 204 + 205 + @@ -63,10 +64,7 @@ 206 + ;; (set-log-procedure! (lambda (level str) 207 + ;; (format #t "[~a|~a] ~a" (getpid) level str))) 208 + 209 + -(dynamic-wind 210 + - (lambda () 211 + - #t) 212 + - 213 + +(run-test 214 + (lambda () 215 + (let ((socket-pair (socketpair PF_UNIX SOCK_STREAM 0)) 216 + (pub (import-key import-openpgp-certificate 217 + @@ -96,7 +94,7 @@ 218 + (write %message (session-record-port client)) 219 + (bye client close-request/rdwr) 220 + 221 + - (exit)) 222 + + (primitive-exit)) 223 + 224 + (let ((server (make-session connection-end/server)) 225 + (rsa (import-rsa-params "rsa-parameters.pem")) 226 + @@ -123,11 +121,7 @@ 227 + (let ((msg (read (session-record-port server))) 228 + (auth-type (session-authentication-type server))) 229 + (bye server close-request/rdwr) 230 + - (exit (and (eq? auth-type credentials/certificate) 231 + - (equal? msg %message))))))))) 232 + - 233 + - (lambda () 234 + - ;; failure 235 + - (exit 1))) 236 + + (and (eq? auth-type credentials/certificate) 237 + + (equal? msg %message))))))))) 238 + 239 + ;;; arch-tag: 1a973ed5-f45d-45a4-8160-900b6a8c27ff 240 + diff --git a/guile/tests/openpgp-keyring.scm b/guile/tests/openpgp-keyring.scm 241 + index e5cffc5..576a9db 100644 242 + --- a/guile/tests/openpgp-keyring.scm 243 + +++ b/guile/tests/openpgp-keyring.scm 244 + @@ -1,5 +1,5 @@ 245 + ;;; GnuTLS-extra --- Guile bindings for GnuTLS-EXTRA. 246 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 247 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 248 + ;;; 249 + ;;; GnuTLS-extra is free software; you can redistribute it and/or modify 250 + ;;; it under the terms of the GNU General Public License as published by 251 + @@ -24,6 +24,7 @@ 252 + ;;; 253 + 254 + (use-modules (gnutls extra) (gnutls) 255 + + (gnutls build tests) 256 + (srfi srfi-1) 257 + (srfi srfi-4)) 258 + 259 + @@ -59,21 +60,12 @@ 260 + (openpgp-keyring-contains-key-id? keyring id)) 261 + %ids-in-keyring))))) 262 + 263 + -(dynamic-wind 264 + - 265 + - (lambda () 266 + - #t) 267 + - 268 + - (lambda () 269 + - (exit 270 + - (every valid-keyring? 271 + - (list %raw-keyring-file 272 + - %ascii-keyring-file) 273 + - (list openpgp-certificate-format/raw 274 + - openpgp-certificate-format/base64)))) 275 + - 276 + +(run-test 277 + (lambda () 278 + - ;; failure 279 + - (exit 1))) 280 + + (every valid-keyring? 281 + + (list %raw-keyring-file 282 + + %ascii-keyring-file) 283 + + (list openpgp-certificate-format/raw 284 + + openpgp-certificate-format/base64)))) 285 + 286 + ;;; arch-tag: 516bf608-5c8b-4787-abe9-5f7b6e6d660b 287 + diff --git a/guile/tests/openpgp-keys.scm b/guile/tests/openpgp-keys.scm 288 + index 6049984..2ded32d 100644 289 + --- a/guile/tests/openpgp-keys.scm 290 + +++ b/guile/tests/openpgp-keys.scm 291 + @@ -1,5 +1,5 @@ 292 + ;;; GnuTLS-extra --- Guile bindings for GnuTLS-EXTRA. 293 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 294 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 295 + ;;; 296 + ;;; GnuTLS-extra is free software; you can redistribute it and/or modify 297 + ;;; it under the terms of the GNU General Public License as published by 298 + @@ -25,6 +25,7 @@ 299 + 300 + (use-modules (gnutls) 301 + (gnutls extra) 302 + + (gnutls build tests) 303 + (srfi srfi-1) 304 + (srfi srfi-4) 305 + (srfi srfi-11)) 306 + @@ -43,11 +44,7 @@ 307 + (stat:size (stat file))) 308 + 309 + 310 + -(dynamic-wind 311 + - 312 + - (lambda () 313 + - #t) 314 + - 315 + +(run-test 316 + (lambda () 317 + (let ((raw-pubkey (make-u8vector (file-size %certificate-file))) 318 + (raw-privkey (make-u8vector (file-size %private-key-file)))) 319 + @@ -60,20 +57,16 @@ 320 + (sec (import-openpgp-private-key raw-privkey 321 + openpgp-certificate-format/base64))) 322 + 323 + - (exit (and (openpgp-certificate? pub) 324 + - (openpgp-private-key? sec) 325 + - (equal? (openpgp-certificate-id pub) %key-id) 326 + - (u8vector? (openpgp-certificate-fingerprint pub)) 327 + - (every string? (openpgp-certificate-names pub)) 328 + - (member (openpgp-certificate-version pub) '(3 4)) 329 + - (list? (openpgp-certificate-usage pub)) 330 + - (let-values (((pk bits) 331 + - (openpgp-certificate-algorithm pub))) 332 + - (and (string? (pk-algorithm->string pk)) 333 + - (number? bits)))))))) 334 + - 335 + - (lambda () 336 + - ;; failure 337 + - (exit 1))) 338 + + (and (openpgp-certificate? pub) 339 + + (openpgp-private-key? sec) 340 + + (equal? (openpgp-certificate-id pub) %key-id) 341 + + (u8vector? (openpgp-certificate-fingerprint pub)) 342 + + (every string? (openpgp-certificate-names pub)) 343 + + (member (openpgp-certificate-version pub) '(3 4)) 344 + + (list? (openpgp-certificate-usage pub)) 345 + + (let-values (((pk bits) 346 + + (openpgp-certificate-algorithm pub))) 347 + + (and (string? (pk-algorithm->string pk)) 348 + + (number? bits)))))))) 349 + 350 + ;;; arch-tag: 2ee2a377-7f4d-4031-92a8-275090e4f83d 351 + diff --git a/guile/tests/pkcs-import-export.scm b/guile/tests/pkcs-import-export.scm 352 + index 8900f15..4121b18 100644 353 + --- a/guile/tests/pkcs-import-export.scm 354 + +++ b/guile/tests/pkcs-import-export.scm 355 + @@ -1,5 +1,5 @@ 356 + ;;; GnuTLS --- Guile bindings for GnuTLS. 357 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 358 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 359 + ;;; 360 + ;;; GnuTLS is free software; you can redistribute it and/or 361 + ;;; modify it under the terms of the GNU Lesser General Public 362 + @@ -23,6 +23,7 @@ 363 + ;;; 364 + 365 + (use-modules (gnutls) 366 + + (gnutls build tests) 367 + (srfi srfi-4)) 368 + 369 + (define (import-something import-proc file fmt) 370 + @@ -36,25 +37,16 @@ 371 + (import-something pkcs3-import-dh-parameters file 372 + x509-certificate-format/pem)) 373 + 374 + -(dynamic-wind 375 + - 376 + - (lambda () 377 + - #t) 378 + - 379 + - (lambda () 380 + - (exit 381 + - (let* ((dh-params (import-dh-params "dh-parameters.pem")) 382 + - (export 383 + - (pkcs3-export-dh-parameters dh-params 384 + - x509-certificate-format/pem))) 385 + - (and (u8vector? export) 386 + - (let ((import 387 + - (pkcs3-import-dh-parameters export 388 + - x509-certificate-format/pem))) 389 + - (dh-parameters? import)))))) 390 + - 391 + +(run-test 392 + (lambda () 393 + - ;; failure 394 + - (exit 1))) 395 + + (let* ((dh-params (import-dh-params "dh-parameters.pem")) 396 + + (export 397 + + (pkcs3-export-dh-parameters dh-params 398 + + x509-certificate-format/pem))) 399 + + (and (u8vector? export) 400 + + (let ((import 401 + + (pkcs3-import-dh-parameters export 402 + + x509-certificate-format/pem))) 403 + + (dh-parameters? import)))))) 404 + 405 + ;;; arch-tag: adff0f07-479e-421e-b47f-8956e06b9902 406 + diff --git a/guile/tests/session-record-port.scm b/guile/tests/session-record-port.scm 407 + index a41ea2c..1d53d9b 100644 408 + --- a/guile/tests/session-record-port.scm 409 + +++ b/guile/tests/session-record-port.scm 410 + @@ -1,5 +1,5 @@ 411 + ;;; GnuTLS --- Guile bindings for GnuTLS. 412 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 413 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 414 + ;;; 415 + ;;; GnuTLS is free software; you can redistribute it and/or 416 + ;;; modify it under the terms of the GNU Lesser General Public 417 + @@ -24,6 +24,7 @@ 418 + ;;; 419 + 420 + (use-modules (gnutls) 421 + + (gnutls build tests) 422 + (srfi srfi-4)) 423 + 424 + 425 + @@ -54,10 +55,7 @@ 426 + ;; (set-log-procedure! (lambda (level str) 427 + ;; (format #t "[~a|~a] ~a" (getpid) level str))) 428 + 429 + -(dynamic-wind 430 + - (lambda () 431 + - #t) 432 + - 433 + +(run-test 434 + (lambda () 435 + ;; Stress the GC. In 0.0, this triggered an abort due to 436 + ;; "scm_unprotect_object called during GC". 437 + @@ -104,7 +102,7 @@ 438 + (uniform-vector-write %message (session-record-port client)) 439 + (bye client close-request/rdwr) 440 + 441 + - (exit)) 442 + + (primitive-exit)) 443 + 444 + (let ((server (make-session connection-end/server))) 445 + ;; server-side 446 + @@ -130,15 +128,11 @@ 447 + (bye server close-request/rdwr) 448 + 449 + ;; Make sure we got everything right. 450 + - (exit (eq? (session-record-port server) 451 + - (session-record-port server)) 452 + - (= amount (u8vector-length %message)) 453 + - (equal? buf %message) 454 + - (eof-object? 455 + - (read-char (session-record-port server))))))))) 456 + - 457 + - (lambda () 458 + - ;; failure 459 + - (exit 1))) 460 + + (and (eq? (session-record-port server) 461 + + (session-record-port server)) 462 + + (= amount (u8vector-length %message)) 463 + + (equal? buf %message) 464 + + (eof-object? 465 + + (read-char (session-record-port server)))))))))) 466 + 467 + ;;; arch-tag: e873226a-d0b6-4a93-87ec-a1b5ad2ae8a2 468 + diff --git a/guile/tests/srp-base64.scm b/guile/tests/srp-base64.scm 469 + index c928f25..484288a 100644 470 + --- a/guile/tests/srp-base64.scm 471 + +++ b/guile/tests/srp-base64.scm 472 + @@ -1,5 +1,5 @@ 473 + ;;; GnuTLS --- Guile bindings for GnuTLS. 474 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 475 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 476 + ;;; 477 + ;;; GnuTLS is free software; you can redistribute it and/or 478 + ;;; modify it under the terms of the GNU Lesser General Public 479 + @@ -22,7 +22,8 @@ 480 + ;;; Test SRP base64 encoding and decoding. 481 + ;;; 482 + 483 + -(use-modules (gnutls)) 484 + +(use-modules (gnutls) 485 + + (gnutls build tests)) 486 + 487 + (define %message 488 + "GnuTLS is free software; you can redistribute it and/or 489 + @@ -30,10 +31,12 @@ modify it under the terms of the GNU Lesser General Public 490 + License as published by the Free Software Foundation; either 491 + version 2.1 of the License, or (at your option) any later version.") 492 + 493 + -(exit (let ((encoded (srp-base64-encode %message))) 494 + - (and (string? encoded) 495 + - (string=? (srp-base64-decode encoded) 496 + - %message)))) 497 + +(run-test 498 + + (lambda () 499 + + (let ((encoded (srp-base64-encode %message))) 500 + + (and (string? encoded) 501 + + (string=? (srp-base64-decode encoded) 502 + + %message))))) 503 + 504 + 505 + ;;; arch-tag: ea1534a5-d513-4208-9a75-54bd4710f915 506 + diff --git a/guile/tests/x509-auth.scm b/guile/tests/x509-auth.scm 507 + index 83cf423..e5c3437 100644 508 + --- a/guile/tests/x509-auth.scm 509 + +++ b/guile/tests/x509-auth.scm 510 + @@ -1,5 +1,5 @@ 511 + ;;; GnuTLS --- Guile bindings for GnuTLS. 512 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 513 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 514 + ;;; 515 + ;;; GnuTLS is free software; you can redistribute it and/or 516 + ;;; modify it under the terms of the GNU Lesser General Public 517 + @@ -24,6 +24,7 @@ 518 + ;;; 519 + 520 + (use-modules (gnutls) 521 + + (gnutls build tests) 522 + (srfi srfi-4)) 523 + 524 + 525 + @@ -62,10 +63,7 @@ 526 + ;; (set-log-procedure! (lambda (level str) 527 + ;; (format #t "[~a|~a] ~a" (getpid) level str))) 528 + 529 + -(dynamic-wind 530 + - (lambda () 531 + - #t) 532 + - 533 + +(run-test 534 + (lambda () 535 + (let ((socket-pair (socketpair PF_UNIX SOCK_STREAM 0)) 536 + (pub (import-key import-x509-certificate 537 + @@ -95,7 +93,7 @@ 538 + (write %message (session-record-port client)) 539 + (bye client close-request/rdwr) 540 + 541 + - (exit)) 542 + + (primitive-exit)) 543 + 544 + (let ((server (make-session connection-end/server)) 545 + (rsa (import-rsa-params "rsa-parameters.pem")) 546 + @@ -128,11 +126,7 @@ 547 + (let ((msg (read (session-record-port server))) 548 + (auth-type (session-authentication-type server))) 549 + (bye server close-request/rdwr) 550 + - (exit (and (eq? auth-type credentials/certificate) 551 + - (equal? msg %message))))))))) 552 + - 553 + - (lambda () 554 + - ;; failure 555 + - (exit 1))) 556 + + (and (eq? auth-type credentials/certificate) 557 + + (equal? msg %message))))))))) 558 + 559 + ;;; arch-tag: 1f88f835-a5c8-4fd6-94b6-5a13571ba03d 560 + diff --git a/guile/tests/x509-certificates.scm b/guile/tests/x509-certificates.scm 561 + index fda227b..67c1885 100644 562 + --- a/guile/tests/x509-certificates.scm 563 + +++ b/guile/tests/x509-certificates.scm 564 + @@ -1,5 +1,5 @@ 565 + ;;; GnuTLS --- Guile bindings for GnuTLS. 566 + -;;; Copyright (C) 2007, 2010 Free Software Foundation, Inc. 567 + +;;; Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. 568 + ;;; 569 + ;;; GnuTLS is free software; you can redistribute it and/or 570 + ;;; modify it under the terms of the GNU Lesser General Public 571 + @@ -23,6 +23,7 @@ 572 + ;;; 573 + 574 + (use-modules (gnutls) 575 + + (gnutls build tests) 576 + (srfi srfi-4) 577 + (srfi srfi-11)) 578 + 579 + @@ -45,11 +46,7 @@ 580 + (stat:size (stat file))) 581 + 582 + 583 + -(dynamic-wind 584 + - 585 + - (lambda () 586 + - #t) 587 + - 588 + +(run-test 589 + (lambda () 590 + (let ((raw-certificate (make-u8vector (file-size %certificate-file))) 591 + (raw-privkey (make-u8vector (file-size %private-key-file)))) 592 + @@ -64,23 +61,19 @@ 593 + (sec (import-x509-private-key raw-privkey 594 + x509-certificate-format/pem))) 595 + 596 + - (exit (and (x509-certificate? cert) 597 + - (x509-private-key? sec) 598 + - (string? (x509-certificate-dn cert)) 599 + - (string? (x509-certificate-issuer-dn cert)) 600 + - (string=? (x509-certificate-dn-oid cert 0) %first-oid) 601 + - (eq? (x509-certificate-signature-algorithm cert) 602 + - %signature-algorithm) 603 + - (x509-certificate-matches-hostname? cert "localhost") 604 + - (let-values (((type name) 605 + - (x509-certificate-subject-alternative-name 606 + - cert 0))) 607 + - (and (string? name) 608 + - (string? 609 + - (x509-subject-alternative-name->string type))))))))) 610 + - 611 + - (lambda () 612 + - ;; failure 613 + - (exit 1))) 614 + + (and (x509-certificate? cert) 615 + + (x509-private-key? sec) 616 + + (string? (x509-certificate-dn cert)) 617 + + (string? (x509-certificate-issuer-dn cert)) 618 + + (string=? (x509-certificate-dn-oid cert 0) %first-oid) 619 + + (eq? (x509-certificate-signature-algorithm cert) 620 + + %signature-algorithm) 621 + + (x509-certificate-matches-hostname? cert "localhost") 622 + + (let-values (((type name) 623 + + (x509-certificate-subject-alternative-name 624 + + cert 0))) 625 + + (and (string? name) 626 + + (string? 627 + + (x509-subject-alternative-name->string type))))))))) 628 + 629 + ;;; arch-tag: eef09b52-30e8-472a-8b93-cb636434f6eb 630 + -- 631 + 1.7.4.1 632 +
-121
pkgs/development/libraries/gnutls/no-libgcrypt.patch
··· 1 - Libgcrypt is no longer required. 2 - 3 - diff --git a/src/certtool-common.c b/src/certtool-common.c 4 - index f3c6658..7e7083d 100644 5 - --- a/src/certtool-common.c 6 - +++ b/src/certtool-common.c 7 - @@ -1,5 +1,6 @@ 8 - /* 9 - - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 10 - + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 11 - + * 2011 Free Software Foundation, Inc. 12 - * 13 - * This file is part of GnuTLS. 14 - * 15 - @@ -28,8 +29,6 @@ 16 - #include <gnutls/pkcs11.h> 17 - #include <gnutls/abstract.h> 18 - 19 - -#include <gcrypt.h> 20 - - 21 - #include <stdio.h> 22 - #include <stdlib.h> 23 - #include <string.h> 24 - diff --git a/src/certtool.c b/src/certtool.c 25 - index 9da4318..e5de9a3 100644 26 - --- a/src/certtool.c 27 - +++ b/src/certtool.c 28 - @@ -1,5 +1,6 @@ 29 - /* 30 - - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 31 - + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 32 - + * 2011 Free Software Foundation, Inc. 33 - * 34 - * This file is part of GnuTLS. 35 - * 36 - @@ -28,8 +29,6 @@ 37 - #include <gnutls/pkcs11.h> 38 - #include <gnutls/abstract.h> 39 - 40 - -#include <gcrypt.h> 41 - - 42 - #include <stdio.h> 43 - #include <stdlib.h> 44 - #include <string.h> 45 - diff --git a/src/p11tool.c b/src/p11tool.c 46 - index 0125531..4c10f59 100644 47 - --- a/src/p11tool.c 48 - +++ b/src/p11tool.c 49 - @@ -1,5 +1,5 @@ 50 - /* 51 - - * Copyright (C) 2010 Free Software Foundation, Inc. 52 - + * Copyright (C) 2010, 2011 Free Software Foundation, Inc. 53 - * 54 - * Author: Nikos Mavrogiannopoulos 55 - * 56 - @@ -30,8 +30,6 @@ 57 - #include <gnutls/pkcs11.h> 58 - #include <gnutls/abstract.h> 59 - 60 - -#include <gcrypt.h> 61 - - 62 - #include <stdio.h> 63 - #include <stdlib.h> 64 - #include <string.h> 65 - diff --git a/tests/crq_key_id.c b/tests/crq_key_id.c 66 - index 2d7a9c4..fff9f8f 100644 67 - --- a/tests/crq_key_id.c 68 - +++ b/tests/crq_key_id.c 69 - @@ -1,5 +1,5 @@ 70 - /* 71 - - * Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. 72 - + * Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 73 - * 74 - * Author: David Marín Carreño 75 - * 76 - @@ -27,7 +27,6 @@ 77 - #include <stdlib.h> 78 - #include <stdio.h> 79 - #include <string.h> 80 - -#include <gcrypt.h> 81 - #include <gnutls/gnutls.h> 82 - #include <gnutls/x509.h> 83 - #include <gnutls/abstract.h> 84 - diff --git a/tests/cve-2009-1416.c b/tests/cve-2009-1416.c 85 - index 784521f..b9a66e5 100644 86 - --- a/tests/cve-2009-1416.c 87 - +++ b/tests/cve-2009-1416.c 88 - @@ -1,5 +1,5 @@ 89 - /* 90 - - * Copyright (C) 2009, 2010 Free Software Foundation, Inc. 91 - + * Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. 92 - * 93 - * Author: Simon Josefsson 94 - * 95 - @@ -41,7 +41,6 @@ 96 - #include <stdarg.h> 97 - #include <stdlib.h> 98 - 99 - -#include <gcrypt.h> 100 - #include <gnutls/gnutls.h> 101 - #include <gnutls/x509.h> 102 - 103 - diff --git a/tests/pkcs12_s2k_pem.c b/tests/pkcs12_s2k_pem.c 104 - index d20df0c..a09faae 100644 105 - --- a/tests/pkcs12_s2k_pem.c 106 - +++ b/tests/pkcs12_s2k_pem.c 107 - @@ -1,5 +1,5 @@ 108 - /* 109 - - * Copyright (C) 2009, 2010 Free Software Foundation, Inc. 110 - + * Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. 111 - * 112 - * Author: Simon Josefsson 113 - * 114 - @@ -34,7 +34,6 @@ 115 - #include <stdarg.h> 116 - #include <stdlib.h> 117 - 118 - -#include <gcrypt.h> 119 - #include <gnutls/gnutls.h> 120 - #include <gnutls/x509.h> 121 -